修改合规性手续模块
This commit is contained in:
		@ -0,0 +1,107 @@
 | 
			
		||||
package org.dromara.formalities.controller;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import lombok.RequiredArgsConstructor;
 | 
			
		||||
import jakarta.servlet.http.HttpServletResponse;
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
import cn.dev33.satoken.annotation.SaCheckPermission;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
 | 
			
		||||
import org.dromara.common.log.annotation.Log;
 | 
			
		||||
import org.dromara.common.web.core.BaseController;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
import org.dromara.common.core.domain.R;
 | 
			
		||||
import org.dromara.common.core.validate.AddGroup;
 | 
			
		||||
import org.dromara.common.core.validate.EditGroup;
 | 
			
		||||
import org.dromara.common.log.enums.BusinessType;
 | 
			
		||||
import org.dromara.common.excel.utils.ExcelUtil;
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusFormalitiesAnnexVo;
 | 
			
		||||
import org.dromara.formalities.domain.bo.BusFormalitiesAnnexBo;
 | 
			
		||||
import org.dromara.formalities.service.IBusFormalitiesAnnexService;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续附件
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-15
 | 
			
		||||
 */
 | 
			
		||||
@Validated
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/formalities/formalitiesAnnex")
 | 
			
		||||
public class BusFormalitiesAnnexController extends BaseController {
 | 
			
		||||
 | 
			
		||||
    private final IBusFormalitiesAnnexService busFormalitiesAnnexService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询合规性手续附件列表
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAnnex:list")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public TableDataInfo<BusFormalitiesAnnexVo> list(BusFormalitiesAnnexBo bo, PageQuery pageQuery) {
 | 
			
		||||
        return busFormalitiesAnnexService.queryPageList(bo, pageQuery);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 导出合规性手续附件列表
 | 
			
		||||
     */
 | 
			
		||||
//    @SaCheckPermission("formalities:formalitiesAnnex:export")
 | 
			
		||||
//    @Log(title = "合规性手续附件", businessType = BusinessType.EXPORT)
 | 
			
		||||
//    @PostMapping("/export")
 | 
			
		||||
//    public void export(BusFormalitiesAnnexBo bo, HttpServletResponse response) {
 | 
			
		||||
//        List<BusFormalitiesAnnexVo> list = busFormalitiesAnnexService.queryList(bo);
 | 
			
		||||
//        ExcelUtil.exportExcel(list, "合规性手续附件", BusFormalitiesAnnexVo.class, response);
 | 
			
		||||
//    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取合规性手续附件详细信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
//    @SaCheckPermission("formalities:formalitiesAnnex:query")
 | 
			
		||||
//    @GetMapping("/{id}")
 | 
			
		||||
//    public R<BusFormalitiesAnnexVo> getInfo(@NotNull(message = "主键不能为空")
 | 
			
		||||
//                                     @PathVariable Long id) {
 | 
			
		||||
//        return R.ok(busFormalitiesAnnexService.queryById(id));
 | 
			
		||||
//    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增合规性手续附件
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAnnex:add")
 | 
			
		||||
    @Log(title = "合规性手续附件", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping()
 | 
			
		||||
    public R<Void> add(BusFormalitiesAnnexBo bo,
 | 
			
		||||
                       @RequestPart("file") List<MultipartFile> file) {
 | 
			
		||||
        return toAjax(busFormalitiesAnnexService.insertByBo(bo,file));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改合规性手续附件
 | 
			
		||||
     */
 | 
			
		||||
//    @SaCheckPermission("formalities:formalitiesAnnex:edit")
 | 
			
		||||
//    @Log(title = "合规性手续附件", businessType = BusinessType.UPDATE)
 | 
			
		||||
//    @RepeatSubmit()
 | 
			
		||||
//    @PutMapping()
 | 
			
		||||
//    public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusFormalitiesAnnexBo bo) {
 | 
			
		||||
//        return toAjax(busFormalitiesAnnexService.updateByBo(bo));
 | 
			
		||||
//    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除合规性手续附件
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 主键串
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAnnex:remove")
 | 
			
		||||
    @Log(title = "合规性手续附件", businessType = BusinessType.DELETE)
 | 
			
		||||
    @DeleteMapping("/{ids}")
 | 
			
		||||
    public R<Void> remove(@NotEmpty(message = "主键不能为空")
 | 
			
		||||
                          @PathVariable Long[] ids) {
 | 
			
		||||
        return toAjax(busFormalitiesAnnexService.deleteWithValidByIds(List.of(ids), true));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -51,6 +51,13 @@ public class BusFormalitiesAreConsolidatedController extends BaseController {
 | 
			
		||||
        return R.ok(busFormalitiesAreConsolidatedService.queryList(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAreConsolidated:list")
 | 
			
		||||
    @GetMapping("/getWhetherItExists")
 | 
			
		||||
    public R<Boolean> getWhetherItExists(BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
        return R.ok(busFormalitiesAreConsolidatedService.getWhetherItExists(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 导出合规性手续合账列表
 | 
			
		||||
     */
 | 
			
		||||
@ -92,9 +99,8 @@ public class BusFormalitiesAreConsolidatedController extends BaseController {
 | 
			
		||||
    @Log(title = "合规性手续合账", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping("/edit")
 | 
			
		||||
    public R<Void> edit( BusFormalitiesAreConsolidatedBo bo,
 | 
			
		||||
                        @RequestPart("file") List<MultipartFile> file) {
 | 
			
		||||
        return toAjax(busFormalitiesAreConsolidatedService.updateByBo(bo,file));
 | 
			
		||||
    public R<Void> edit( @Validated(EditGroup.class) @RequestBody BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
        return toAjax(busFormalitiesAreConsolidatedService.updateByBo(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -55,25 +55,25 @@ public class BusListOfFormalitiesController extends BaseController {
 | 
			
		||||
    /**
 | 
			
		||||
     * 导出手续办理清单模板列表
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:listOfFormalities:export")
 | 
			
		||||
    @Log(title = "手续办理清单模板", businessType = BusinessType.EXPORT)
 | 
			
		||||
    @PostMapping("/export")
 | 
			
		||||
    public void export(BusListOfFormalitiesBo bo, HttpServletResponse response) {
 | 
			
		||||
        List<BusListOfFormalitiesVo> list = busListOfFormalitiesService.queryList(bo);
 | 
			
		||||
        ExcelUtil.exportExcel(list, "手续办理清单模板", BusListOfFormalitiesVo.class, response);
 | 
			
		||||
    }
 | 
			
		||||
//    @SaCheckPermission("formalities:listOfFormalities:export")
 | 
			
		||||
//    @Log(title = "手续办理清单模板", businessType = BusinessType.EXPORT)
 | 
			
		||||
//    @PostMapping("/export")
 | 
			
		||||
//    public void export(BusListOfFormalitiesBo bo, HttpServletResponse response) {
 | 
			
		||||
//        List<BusListOfFormalitiesVo> list = busListOfFormalitiesService.queryList(bo);
 | 
			
		||||
//        ExcelUtil.exportExcel(list, "手续办理清单模板", BusListOfFormalitiesVo.class, response);
 | 
			
		||||
//    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取手续办理清单模板详细信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:listOfFormalities:query")
 | 
			
		||||
    @GetMapping("/{id}")
 | 
			
		||||
    public R<BusListOfFormalitiesVo> getInfo(@NotNull(message = "主键不能为空")
 | 
			
		||||
                                     @PathVariable Long id) {
 | 
			
		||||
        return R.ok(busListOfFormalitiesService.queryById(id));
 | 
			
		||||
    }
 | 
			
		||||
//    @SaCheckPermission("formalities:listOfFormalities:query")
 | 
			
		||||
//    @GetMapping("/{id}")
 | 
			
		||||
//    public R<BusListOfFormalitiesVo> getInfo(@NotNull(message = "主键不能为空")
 | 
			
		||||
//                                     @PathVariable Long id) {
 | 
			
		||||
//        return R.ok(busListOfFormalitiesService.queryById(id));
 | 
			
		||||
//    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增手续办理清单模板
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,46 @@
 | 
			
		||||
package org.dromara.formalities.domain;
 | 
			
		||||
 | 
			
		||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.*;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续附件对象 bus_formalities_annex
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-15
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@TableName("bus_formalities_annex")
 | 
			
		||||
public class BusFormalitiesAnnex extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合规性手续id
 | 
			
		||||
     */
 | 
			
		||||
    private Long formalitiesId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 附件地址
 | 
			
		||||
     */
 | 
			
		||||
    private String annexUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件名
 | 
			
		||||
     */
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -4,6 +4,9 @@ import org.dromara.common.mybatis.core.domain.BaseEntity;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.*;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
 | 
			
		||||
@ -57,7 +60,7 @@ public class BusFormalitiesAreConsolidated extends BaseEntity {
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划开始时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date planTheStartTime;
 | 
			
		||||
    private LocalDate planTheStartTime;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 负责人
 | 
			
		||||
@ -74,10 +77,6 @@ public class BusFormalitiesAreConsolidated extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String processingStatus;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续材料
 | 
			
		||||
     */
 | 
			
		||||
    private String formalitiesUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,44 @@
 | 
			
		||||
package org.dromara.formalities.domain.bo;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAnnex;
 | 
			
		||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
 | 
			
		||||
import org.dromara.common.core.validate.AddGroup;
 | 
			
		||||
import org.dromara.common.core.validate.EditGroup;
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续附件业务对象 bus_formalities_annex
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-15
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@AutoMapper(target = BusFormalitiesAnnex.class, reverseConvertGenerate = false)
 | 
			
		||||
public class BusFormalitiesAnnexBo extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "不能为空", groups = { EditGroup.class })
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合规性手续id
 | 
			
		||||
     */
 | 
			
		||||
    private Long formalitiesId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 附件地址
 | 
			
		||||
     */
 | 
			
		||||
    private String annexUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件名
 | 
			
		||||
     */
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@ -79,10 +80,7 @@ public class BusFormalitiesAreConsolidatedBo extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String processingStatus;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续材料
 | 
			
		||||
     */
 | 
			
		||||
    private String formalitiesUrl;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,56 @@
 | 
			
		||||
package org.dromara.formalities.domain.vo;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAnnex;
 | 
			
		||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 | 
			
		||||
import com.alibaba.excel.annotation.ExcelProperty;
 | 
			
		||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
 | 
			
		||||
import org.dromara.common.excel.convert.ExcelDictConvert;
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续附件视图对象 bus_formalities_annex
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-15
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@ExcelIgnoreUnannotated
 | 
			
		||||
@AutoMapper(target = BusFormalitiesAnnex.class)
 | 
			
		||||
public class BusFormalitiesAnnexVo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合规性手续id
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "合规性手续id")
 | 
			
		||||
    private Long formalitiesId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 附件地址
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "附件地址")
 | 
			
		||||
    private String annexUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件名
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "文件名")
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -1,5 +1,6 @@
 | 
			
		||||
package org.dromara.formalities.domain.vo;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAreConsolidated;
 | 
			
		||||
@ -70,7 +71,7 @@ public class BusFormalitiesAreConsolidatedVo implements Serializable {
 | 
			
		||||
     * 计划开始时间
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "计划开始时间")
 | 
			
		||||
    private Date planTheStartTime;
 | 
			
		||||
    private LocalDate planTheStartTime;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 负责人
 | 
			
		||||
@ -90,11 +91,6 @@ public class BusFormalitiesAreConsolidatedVo implements Serializable {
 | 
			
		||||
    @ExcelProperty(value = "办理状态")
 | 
			
		||||
    private String processingStatus;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续材料
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "手续材料")
 | 
			
		||||
    private String formalitiesUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package org.dromara.formalities.mapper;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAnnex;
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusFormalitiesAnnexVo;
 | 
			
		||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续附件Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-15
 | 
			
		||||
 */
 | 
			
		||||
public interface BusFormalitiesAnnexMapper extends BaseMapperPlus<BusFormalitiesAnnex, BusFormalitiesAnnexVo> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,73 @@
 | 
			
		||||
package org.dromara.formalities.service;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusFormalitiesAnnexVo;
 | 
			
		||||
import org.dromara.formalities.domain.bo.BusFormalitiesAnnexBo;
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAnnex;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续附件Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-15
 | 
			
		||||
 */
 | 
			
		||||
public interface IBusFormalitiesAnnexService extends IService<BusFormalitiesAnnex>{
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询合规性手续附件
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 合规性手续附件
 | 
			
		||||
     */
 | 
			
		||||
    BusFormalitiesAnnexVo queryById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询合规性手续附件列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo        查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 合规性手续附件分页列表
 | 
			
		||||
     */
 | 
			
		||||
    TableDataInfo<BusFormalitiesAnnexVo> queryPageList(BusFormalitiesAnnexBo bo, PageQuery pageQuery);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的合规性手续附件列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 查询条件
 | 
			
		||||
     * @return 合规性手续附件列表
 | 
			
		||||
     */
 | 
			
		||||
    List<BusFormalitiesAnnexVo> queryList(BusFormalitiesAnnexBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增合规性手续附件
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo   合规性手续附件
 | 
			
		||||
     * @param file
 | 
			
		||||
     * @return 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean insertByBo(BusFormalitiesAnnexBo bo, List<MultipartFile> file);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改合规性手续附件
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 合规性手续附件
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean updateByBo(BusFormalitiesAnnexBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除合规性手续附件信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids     待删除的主键集合
 | 
			
		||||
     * @param isValid 是否进行有效性校验
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 | 
			
		||||
}
 | 
			
		||||
@ -57,10 +57,9 @@ public interface IBusFormalitiesAreConsolidatedService extends IService<BusForma
 | 
			
		||||
     * 修改合规性手续合账
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo   合规性手续合账
 | 
			
		||||
     * @param files
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean updateByBo(BusFormalitiesAreConsolidatedBo bo, List<MultipartFile> files);
 | 
			
		||||
    Boolean updateByBo(BusFormalitiesAreConsolidatedBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除合规性手续合账信息
 | 
			
		||||
@ -77,4 +76,6 @@ public interface IBusFormalitiesAreConsolidatedService extends IService<BusForma
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    Boolean editStatus(BusFormalitiesAreConsolidatedBo bo);
 | 
			
		||||
 | 
			
		||||
    Boolean getWhetherItExists(BusFormalitiesAreConsolidatedBo bo);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,157 @@
 | 
			
		||||
package org.dromara.formalities.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import org.dromara.common.core.utils.MapstructUtils;
 | 
			
		||||
import org.dromara.common.core.utils.StringUtils;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
import lombok.RequiredArgsConstructor;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssUploadVo;
 | 
			
		||||
import org.dromara.system.service.ISysOssService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.dromara.formalities.domain.bo.BusFormalitiesAnnexBo;
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusFormalitiesAnnexVo;
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAnnex;
 | 
			
		||||
import org.dromara.formalities.mapper.BusFormalitiesAnnexMapper;
 | 
			
		||||
import org.dromara.formalities.service.IBusFormalitiesAnnexService;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
 | 
			
		||||
import static org.dromara.common.constant.MinioPathConstant.FormalitiesAnnex;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续附件Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-15
 | 
			
		||||
 */
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
@Service
 | 
			
		||||
public class BusFormalitiesAnnexServiceImpl extends ServiceImpl<BusFormalitiesAnnexMapper, BusFormalitiesAnnex> implements IBusFormalitiesAnnexService {
 | 
			
		||||
 | 
			
		||||
    private final BusFormalitiesAnnexMapper baseMapper;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISysOssService ossService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询合规性手续附件
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 合规性手续附件
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public BusFormalitiesAnnexVo queryById(Long id){
 | 
			
		||||
        return baseMapper.selectVoById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询合规性手续附件列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo        查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 合规性手续附件分页列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TableDataInfo<BusFormalitiesAnnexVo> queryPageList(BusFormalitiesAnnexBo bo, PageQuery pageQuery) {
 | 
			
		||||
        LambdaQueryWrapper<BusFormalitiesAnnex> lqw = buildQueryWrapper(bo);
 | 
			
		||||
        Page<BusFormalitiesAnnexVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
 | 
			
		||||
        return TableDataInfo.build(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的合规性手续附件列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 查询条件
 | 
			
		||||
     * @return 合规性手续附件列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<BusFormalitiesAnnexVo> queryList(BusFormalitiesAnnexBo bo) {
 | 
			
		||||
        LambdaQueryWrapper<BusFormalitiesAnnex> lqw = buildQueryWrapper(bo);
 | 
			
		||||
        return baseMapper.selectVoList(lqw);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private LambdaQueryWrapper<BusFormalitiesAnnex> buildQueryWrapper(BusFormalitiesAnnexBo bo) {
 | 
			
		||||
        Map<String, Object> params = bo.getParams();
 | 
			
		||||
        LambdaQueryWrapper<BusFormalitiesAnnex> lqw = Wrappers.lambdaQuery();
 | 
			
		||||
        lqw.orderByDesc(BusFormalitiesAnnex::getId);
 | 
			
		||||
        lqw.eq(bo.getFormalitiesId() != null, BusFormalitiesAnnex::getFormalitiesId, bo.getFormalitiesId());
 | 
			
		||||
//        lqw.eq(StringUtils.isNotBlank(bo.getAnnexUrl()), BusFormalitiesAnnex::getAnnexUrl, bo.getAnnexUrl());
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增合规性手续附件
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo   合规性手续附件
 | 
			
		||||
     * @param files
 | 
			
		||||
     * @return 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean insertByBo(BusFormalitiesAnnexBo bo, List<MultipartFile> files) {
 | 
			
		||||
        List<BusFormalitiesAnnex> annexArrayList = new ArrayList<>();
 | 
			
		||||
        // 先判断数组是否为空或长度为0
 | 
			
		||||
        if (files != null && !files.isEmpty()) {
 | 
			
		||||
            String url = "";
 | 
			
		||||
            // 遍历文件数组
 | 
			
		||||
            for (MultipartFile file : files) {
 | 
			
		||||
                // 处理单个文件前,先判断是否为空文件(isEmpty())
 | 
			
		||||
                if (file.isEmpty()) {
 | 
			
		||||
                    System.out.println("跳过空文件");
 | 
			
		||||
                    continue;
 | 
			
		||||
                }
 | 
			
		||||
                SysOssUploadVo wordEntity = ossService.uploadWithNoSave(file, ossService.minioFileName(FormalitiesAnnex,file));
 | 
			
		||||
                BusFormalitiesAnnex formalitiesAnnex = new BusFormalitiesAnnex();
 | 
			
		||||
                formalitiesAnnex.setAnnexUrl(wordEntity.getUrl());
 | 
			
		||||
                formalitiesAnnex.setFileName(wordEntity.getFileName());
 | 
			
		||||
                formalitiesAnnex.setFormalitiesId(bo.getFormalitiesId());
 | 
			
		||||
                annexArrayList.add(formalitiesAnnex);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
        return  baseMapper.insertBatch(annexArrayList);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改合规性手续附件
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 合规性手续附件
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean updateByBo(BusFormalitiesAnnexBo bo) {
 | 
			
		||||
        BusFormalitiesAnnex update = MapstructUtils.convert(bo, BusFormalitiesAnnex.class);
 | 
			
		||||
        validEntityBeforeSave(update);
 | 
			
		||||
        return baseMapper.updateById(update) > 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存前的数据校验
 | 
			
		||||
     */
 | 
			
		||||
    private void validEntityBeforeSave(BusFormalitiesAnnex entity){
 | 
			
		||||
        //TODO 做一些数据校验,如唯一约束
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除合规性手续附件信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids     待删除的主键集合
 | 
			
		||||
     * @param isValid 是否进行有效性校验
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
 | 
			
		||||
        if(isValid){
 | 
			
		||||
            //TODO 做一些业务上的校验,判断是否需要校验
 | 
			
		||||
        }
 | 
			
		||||
        return baseMapper.deleteByIds(ids) > 0;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -10,9 +10,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
import lombok.RequiredArgsConstructor;
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAnnex;
 | 
			
		||||
import org.dromara.formalities.domain.BusListOfFormalities;
 | 
			
		||||
import org.dromara.formalities.domain.bo.AddBusFormalitiesAreConsolidatedBo;
 | 
			
		||||
import org.dromara.formalities.enums.FormalitiesStatusEnum;
 | 
			
		||||
import org.dromara.formalities.service.IBusFormalitiesAnnexService;
 | 
			
		||||
import org.dromara.formalities.service.IBusListOfFormalitiesService;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssUploadVo;
 | 
			
		||||
import org.dromara.system.service.ISysOssService;
 | 
			
		||||
@ -45,7 +47,8 @@ public class BusFormalitiesAreConsolidatedServiceImpl extends ServiceImpl<BusFor
 | 
			
		||||
    private IBusListOfFormalitiesService busListOfFormalitiesService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISysOssService ossService;
 | 
			
		||||
    private IBusFormalitiesAnnexService busFormalitiesAnnexService;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询合规性手续合账
 | 
			
		||||
@ -95,7 +98,6 @@ public class BusFormalitiesAreConsolidatedServiceImpl extends ServiceImpl<BusFor
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(bo.getHead()), BusFormalitiesAreConsolidated::getHead, bo.getHead());
 | 
			
		||||
        lqw.eq(bo.getActualCompletionTime() != null, BusFormalitiesAreConsolidated::getActualCompletionTime, bo.getActualCompletionTime());
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(bo.getProcessingStatus()), BusFormalitiesAreConsolidated::getProcessingStatus, bo.getProcessingStatus());
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(bo.getFormalitiesUrl()), BusFormalitiesAreConsolidated::getFormalitiesUrl, bo.getFormalitiesUrl());
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -140,27 +142,11 @@ public class BusFormalitiesAreConsolidatedServiceImpl extends ServiceImpl<BusFor
 | 
			
		||||
     * 修改合规性手续合账
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo   合规性手续合账
 | 
			
		||||
     * @param files
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean updateByBo(BusFormalitiesAreConsolidatedBo bo, List<MultipartFile> files) {
 | 
			
		||||
    public Boolean updateByBo(BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
 | 
			
		||||
        // 先判断数组是否为空或长度为0
 | 
			
		||||
        if (files != null && !files.isEmpty()) {
 | 
			
		||||
            String url = "";
 | 
			
		||||
            // 遍历文件数组
 | 
			
		||||
            for (MultipartFile file : files) {
 | 
			
		||||
                // 处理单个文件前,先判断是否为空文件(isEmpty())
 | 
			
		||||
                if (file.isEmpty()) {
 | 
			
		||||
                    System.out.println("跳过空文件");
 | 
			
		||||
                    continue;
 | 
			
		||||
                }
 | 
			
		||||
                SysOssUploadVo wordEntity = ossService.uploadWithNoSave(file, ossService.minioFileName(FormalitiesAnnex,file));
 | 
			
		||||
                url = url.equals("")? wordEntity.getUrl() :  url+","+wordEntity.getUrl();
 | 
			
		||||
            }
 | 
			
		||||
            bo.setFormalitiesUrl(url);
 | 
			
		||||
        }
 | 
			
		||||
        bo.setProcessingStatus(FormalitiesStatusEnum.PROCESSING.getText());
 | 
			
		||||
        BusFormalitiesAreConsolidated update = MapstructUtils.convert(bo, BusFormalitiesAreConsolidated.class);
 | 
			
		||||
        validEntityBeforeSave(update);
 | 
			
		||||
@ -198,13 +184,14 @@ public class BusFormalitiesAreConsolidatedServiceImpl extends ServiceImpl<BusFor
 | 
			
		||||
        if (busFormalitiesAreConsolidated == null) {
 | 
			
		||||
            throw new ServiceException("数据不存在");
 | 
			
		||||
        }
 | 
			
		||||
        if (busFormalitiesAreConsolidated.getHead() != null) {
 | 
			
		||||
        if (busFormalitiesAreConsolidated.getHead() == null) {
 | 
			
		||||
            throw new ServiceException("负责人为空不能提交");
 | 
			
		||||
        }
 | 
			
		||||
        if (busFormalitiesAreConsolidated.getPlanTheStartTime() != null) {
 | 
			
		||||
        if (busFormalitiesAreConsolidated.getPlanTheStartTime() == null) {
 | 
			
		||||
            throw new ServiceException("计划开始时间为空不能提交");
 | 
			
		||||
        }
 | 
			
		||||
        if (busFormalitiesAreConsolidated.getFormalitiesUrl() != null && !busFormalitiesAreConsolidated.getFormalitiesUrl().isEmpty()) {
 | 
			
		||||
        long count = busFormalitiesAnnexService.count(new LambdaQueryWrapper<BusFormalitiesAnnex>().eq(BusFormalitiesAnnex::getFormalitiesId, bo.getId()));
 | 
			
		||||
        if (count == 0) {
 | 
			
		||||
            throw new ServiceException("手续材料为空不能提交");
 | 
			
		||||
        }
 | 
			
		||||
        busFormalitiesAreConsolidated.setActualCompletionTime(new Date());
 | 
			
		||||
@ -213,4 +200,10 @@ public class BusFormalitiesAreConsolidatedServiceImpl extends ServiceImpl<BusFor
 | 
			
		||||
//        BusFormalitiesAreConsolidated update = MapstructUtils.convert(bo, BusFormalitiesAreConsolidated.class);
 | 
			
		||||
        return baseMapper.updateById(busFormalitiesAreConsolidated) > 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean getWhetherItExists(BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
        Long count = baseMapper.selectCount(new LambdaQueryWrapper<BusFormalitiesAreConsolidated>().eq(BusFormalitiesAreConsolidated::getProjectId, bo.getProjectId()));
 | 
			
		||||
        return count > 0;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user