111
This commit is contained in:
		@ -0,0 +1,124 @@
 | 
			
		||||
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.BusFormalitiesAreConsolidatedVo;
 | 
			
		||||
import org.dromara.formalities.domain.bo.BusFormalitiesAreConsolidatedBo;
 | 
			
		||||
import org.dromara.formalities.service.IBusFormalitiesAreConsolidatedService;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续合账
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Validated
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/formalities/formalitiesAreConsolidated")
 | 
			
		||||
public class BusFormalitiesAreConsolidatedController extends BaseController {
 | 
			
		||||
 | 
			
		||||
    private final IBusFormalitiesAreConsolidatedService busFormalitiesAreConsolidatedService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询合规性手续合账列表
 | 
			
		||||
     */
 | 
			
		||||
//    @SaCheckPermission("formalities:formalitiesAreConsolidated:list")
 | 
			
		||||
//    @GetMapping("/list")
 | 
			
		||||
//    public TableDataInfo<BusFormalitiesAreConsolidatedVo> list(BusFormalitiesAreConsolidatedBo bo, PageQuery pageQuery) {
 | 
			
		||||
//        return busFormalitiesAreConsolidatedService.queryPageList(bo, pageQuery);
 | 
			
		||||
//    }
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAreConsolidated:list")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public R<List<BusFormalitiesAreConsolidatedVo>> list(BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
        return R.ok(busFormalitiesAreConsolidatedService.queryList(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 导出合规性手续合账列表
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAreConsolidated:export")
 | 
			
		||||
    @Log(title = "合规性手续合账", businessType = BusinessType.EXPORT)
 | 
			
		||||
    @PostMapping("/export")
 | 
			
		||||
    public void export(BusFormalitiesAreConsolidatedBo bo, HttpServletResponse response) {
 | 
			
		||||
        List<BusFormalitiesAreConsolidatedVo> list = busFormalitiesAreConsolidatedService.queryList(bo);
 | 
			
		||||
        ExcelUtil.exportExcel(list, "合规性手续合账", BusFormalitiesAreConsolidatedVo.class, response);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取合规性手续合账详细信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAreConsolidated:query")
 | 
			
		||||
    @GetMapping("/{id}")
 | 
			
		||||
    public R<BusFormalitiesAreConsolidatedVo> getInfo(@NotNull(message = "主键不能为空")
 | 
			
		||||
                                     @PathVariable Long id) {
 | 
			
		||||
        return R.ok(busFormalitiesAreConsolidatedService.queryById(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增合规性手续合账
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAreConsolidated:add")
 | 
			
		||||
    @Log(title = "合规性手续合账", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping()
 | 
			
		||||
    public R<Void> add(@Validated(AddGroup.class) @RequestBody BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
        return toAjax(busFormalitiesAreConsolidatedService.insertByBo(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改合规性手续合账
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAreConsolidated:edit")
 | 
			
		||||
    @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));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改合规性手续合账
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAreConsolidated:edit")
 | 
			
		||||
    @Log(title = "合规性手续合账", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping("/editStatus")
 | 
			
		||||
    public R<Void> editStatus(@Validated(EditGroup.class) @RequestBody BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
        return toAjax(busFormalitiesAreConsolidatedService.editStatus(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除合规性手续合账
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 主键串
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:formalitiesAreConsolidated:remove")
 | 
			
		||||
    @Log(title = "合规性手续合账", businessType = BusinessType.DELETE)
 | 
			
		||||
    @DeleteMapping("/{ids}")
 | 
			
		||||
    public R<Void> remove(@NotEmpty(message = "主键不能为空")
 | 
			
		||||
                          @PathVariable Long[] ids) {
 | 
			
		||||
        return toAjax(busFormalitiesAreConsolidatedService.deleteWithValidByIds(List.of(ids), true));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,112 @@
 | 
			
		||||
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.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.BusListOfFormalitiesVo;
 | 
			
		||||
import org.dromara.formalities.domain.bo.BusListOfFormalitiesBo;
 | 
			
		||||
import org.dromara.formalities.service.IBusListOfFormalitiesService;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 手续办理清单模板
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Validated
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/formalities/listOfFormalities")
 | 
			
		||||
public class BusListOfFormalitiesController extends BaseController {
 | 
			
		||||
 | 
			
		||||
    private final IBusListOfFormalitiesService busListOfFormalitiesService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询手续办理清单模板列表
 | 
			
		||||
     */
 | 
			
		||||
//    @SaCheckPermission("formalities:listOfFormalities:list")
 | 
			
		||||
//    @GetMapping("/list")
 | 
			
		||||
//    public TableDataInfo<BusListOfFormalitiesVo> list(BusListOfFormalitiesBo bo, PageQuery pageQuery) {
 | 
			
		||||
//        return busListOfFormalitiesService.queryPageList(bo, pageQuery);
 | 
			
		||||
//    }
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询手续办理清单模板列表
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:listOfFormalities:list")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public R<List<BusListOfFormalitiesVo>> list(BusListOfFormalitiesBo bo) {
 | 
			
		||||
        List<BusListOfFormalitiesVo> vo = busListOfFormalitiesService.getTree(bo);
 | 
			
		||||
        return R.ok(vo);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 导出手续办理清单模板列表
 | 
			
		||||
     */
 | 
			
		||||
    @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:add")
 | 
			
		||||
    @Log(title = "手续办理清单模板", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping()
 | 
			
		||||
    public R<Void> add(@Validated(AddGroup.class) @RequestBody BusListOfFormalitiesBo bo) {
 | 
			
		||||
        return toAjax(busListOfFormalitiesService.insertByBo(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改手续办理清单模板
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:listOfFormalities:edit")
 | 
			
		||||
    @Log(title = "手续办理清单模板", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping()
 | 
			
		||||
    public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusListOfFormalitiesBo bo) {
 | 
			
		||||
        return toAjax(busListOfFormalitiesService.updateByBo(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除手续办理清单模板
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("formalities:listOfFormalities:remove")
 | 
			
		||||
    @Log(title = "手续办理清单模板", businessType = BusinessType.DELETE)
 | 
			
		||||
    @DeleteMapping("/{id}")
 | 
			
		||||
    public R<Void> remove(@NotEmpty(message = "主键不能为空")
 | 
			
		||||
                          @PathVariable Long id) {
 | 
			
		||||
        return toAjax(busListOfFormalitiesService.deleteWithValidByIds(id, true));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,93 @@
 | 
			
		||||
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.util.Date;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续合账对象 bus_formalities_are_consolidated
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@TableName("bus_formalities_are_consolidated")
 | 
			
		||||
public class BusFormalitiesAreConsolidated extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板父名称
 | 
			
		||||
     */
 | 
			
		||||
    private String formalitiesPname;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板父id
 | 
			
		||||
     */
 | 
			
		||||
    private Long formalitiesPid;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板名称
 | 
			
		||||
     */
 | 
			
		||||
    private String formalitiesName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板id
 | 
			
		||||
     */
 | 
			
		||||
    private Long formalitiesId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划开始时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date planTheStartTime;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 负责人
 | 
			
		||||
     */
 | 
			
		||||
    private String head;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 实际完成时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date actualCompletionTime;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 办理状态
 | 
			
		||||
     */
 | 
			
		||||
    private String processingStatus;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续材料
 | 
			
		||||
     */
 | 
			
		||||
    private String formalitiesUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    private Integer status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,41 @@
 | 
			
		||||
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_list_of_formalities
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@TableName("bus_list_of_formalities")
 | 
			
		||||
public class BusListOfFormalities extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 父级id
 | 
			
		||||
     */
 | 
			
		||||
    private Long pid;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 名称
 | 
			
		||||
     */
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,27 @@
 | 
			
		||||
package org.dromara.formalities.domain.bo;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续合账业务对象 bus_formalities_are_consolidated
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class AddBusFormalitiesAreConsolidatedBo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板父id
 | 
			
		||||
     */
 | 
			
		||||
    private Long formalitiesPid;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板id
 | 
			
		||||
     */
 | 
			
		||||
    private Long formalitiesId;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,103 @@
 | 
			
		||||
package org.dromara.formalities.domain.bo;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAreConsolidated;
 | 
			
		||||
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.*;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续合账业务对象 bus_formalities_are_consolidated
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@AutoMapper(target = BusFormalitiesAreConsolidated.class, reverseConvertGenerate = false)
 | 
			
		||||
public class BusFormalitiesAreConsolidatedBo extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "不能为空", groups = { EditGroup.class })
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板父名称
 | 
			
		||||
     */
 | 
			
		||||
    private String formalitiesPname;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板父id
 | 
			
		||||
     */
 | 
			
		||||
    private Long formalitiesPid;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板名称
 | 
			
		||||
     */
 | 
			
		||||
    private String formalitiesName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板id
 | 
			
		||||
     */
 | 
			
		||||
    private Long formalitiesId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划开始时间
 | 
			
		||||
     */
 | 
			
		||||
//    @JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING)
 | 
			
		||||
    private LocalDate planTheStartTime;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 负责人
 | 
			
		||||
     */
 | 
			
		||||
    private String head;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 实际完成时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date actualCompletionTime;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 办理状态
 | 
			
		||||
     */
 | 
			
		||||
    private String processingStatus;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续材料
 | 
			
		||||
     */
 | 
			
		||||
    private String formalitiesUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    private Integer status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 选择的模板id
 | 
			
		||||
     */
 | 
			
		||||
    private List<AddBusFormalitiesAreConsolidatedBo> addBusFormalitiesAreConsolidatedBos;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,40 @@
 | 
			
		||||
package org.dromara.formalities.domain.bo;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.BusListOfFormalities;
 | 
			
		||||
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_list_of_formalities
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@AutoMapper(target = BusListOfFormalities.class, reverseConvertGenerate = false)
 | 
			
		||||
public class BusListOfFormalitiesBo extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "不能为空", groups = { EditGroup.class })
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 父级id
 | 
			
		||||
     */
 | 
			
		||||
    private Long pid;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 名称
 | 
			
		||||
     */
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,111 @@
 | 
			
		||||
package org.dromara.formalities.domain.vo;
 | 
			
		||||
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAreConsolidated;
 | 
			
		||||
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_are_consolidated
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@ExcelIgnoreUnannotated
 | 
			
		||||
@AutoMapper(target = BusFormalitiesAreConsolidated.class)
 | 
			
		||||
public class BusFormalitiesAreConsolidatedVo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "项目id")
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板父id
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    private Long formalitiesPid;
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板父名称
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "手续办理清单模板父名称")
 | 
			
		||||
    private String formalitiesPname;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板名称
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "手续办理清单模板名称")
 | 
			
		||||
    private String formalitiesName;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续办理清单模板id
 | 
			
		||||
     */
 | 
			
		||||
    private Long formalitiesId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划开始时间
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "计划开始时间")
 | 
			
		||||
    private Date planTheStartTime;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 负责人
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "负责人")
 | 
			
		||||
    private String head;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 实际完成时间
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "实际完成时间")
 | 
			
		||||
    private Date actualCompletionTime;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 办理状态
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "办理状态")
 | 
			
		||||
    private String processingStatus;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手续材料
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "手续材料")
 | 
			
		||||
    private String formalitiesUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    private Integer status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "备注")
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,49 @@
 | 
			
		||||
package org.dromara.formalities.domain.vo;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.BusListOfFormalities;
 | 
			
		||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 | 
			
		||||
import com.alibaba.excel.annotation.ExcelProperty;
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 手续办理清单模板视图对象 bus_list_of_formalities
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@ExcelIgnoreUnannotated
 | 
			
		||||
@AutoMapper(target = BusListOfFormalities.class)
 | 
			
		||||
public class BusListOfFormalitiesVo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 父级id
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "父级id")
 | 
			
		||||
    private Long pid;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 名称
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "名称")
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    private List<BusListOfFormalitiesVo> children = new ArrayList<>();
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,21 @@
 | 
			
		||||
package org.dromara.formalities.enums;
 | 
			
		||||
 | 
			
		||||
import lombok.Getter;
 | 
			
		||||
 | 
			
		||||
@Getter
 | 
			
		||||
public enum FormalitiesStatusEnum {
 | 
			
		||||
 | 
			
		||||
    TOSTART("待开始", "0"),
 | 
			
		||||
    PROCESSING("处理中", "1"),
 | 
			
		||||
    DELETE("已完成", "2");
 | 
			
		||||
 | 
			
		||||
    private final String text;
 | 
			
		||||
 | 
			
		||||
    private final String value;
 | 
			
		||||
 | 
			
		||||
    FormalitiesStatusEnum(String text, String value) {
 | 
			
		||||
        this.text = text;
 | 
			
		||||
        this.value = value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package org.dromara.formalities.mapper;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAreConsolidated;
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusFormalitiesAreConsolidatedVo;
 | 
			
		||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续合账Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
public interface BusFormalitiesAreConsolidatedMapper extends BaseMapperPlus<BusFormalitiesAreConsolidated, BusFormalitiesAreConsolidatedVo> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package org.dromara.formalities.mapper;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.BusListOfFormalities;
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusListOfFormalitiesVo;
 | 
			
		||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 手续办理清单模板Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
public interface BusListOfFormalitiesMapper extends BaseMapperPlus<BusListOfFormalities, BusListOfFormalitiesVo> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,80 @@
 | 
			
		||||
package org.dromara.formalities.service;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusFormalitiesAreConsolidatedVo;
 | 
			
		||||
import org.dromara.formalities.domain.bo.BusFormalitiesAreConsolidatedBo;
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAreConsolidated;
 | 
			
		||||
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-14
 | 
			
		||||
 */
 | 
			
		||||
public interface IBusFormalitiesAreConsolidatedService extends IService<BusFormalitiesAreConsolidated>{
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询合规性手续合账
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 合规性手续合账
 | 
			
		||||
     */
 | 
			
		||||
    BusFormalitiesAreConsolidatedVo queryById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询合规性手续合账列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo        查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 合规性手续合账分页列表
 | 
			
		||||
     */
 | 
			
		||||
    TableDataInfo<BusFormalitiesAreConsolidatedVo> queryPageList(BusFormalitiesAreConsolidatedBo bo, PageQuery pageQuery);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的合规性手续合账列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 查询条件
 | 
			
		||||
     * @return 合规性手续合账列表
 | 
			
		||||
     */
 | 
			
		||||
    List<BusFormalitiesAreConsolidatedVo> queryList(BusFormalitiesAreConsolidatedBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增合规性手续合账
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 合规性手续合账
 | 
			
		||||
     * @return 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean insertByBo(BusFormalitiesAreConsolidatedBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改合规性手续合账
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo   合规性手续合账
 | 
			
		||||
     * @param files
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean updateByBo(BusFormalitiesAreConsolidatedBo bo, List<MultipartFile> files);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除合规性手续合账信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids     待删除的主键集合
 | 
			
		||||
     * @param isValid 是否进行有效性校验
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改提交状态
 | 
			
		||||
     * @param bo
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    Boolean editStatus(BusFormalitiesAreConsolidatedBo bo);
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,77 @@
 | 
			
		||||
package org.dromara.formalities.service;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusListOfFormalitiesVo;
 | 
			
		||||
import org.dromara.formalities.domain.bo.BusListOfFormalitiesBo;
 | 
			
		||||
import org.dromara.formalities.domain.BusListOfFormalities;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 手续办理清单模板Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
public interface IBusListOfFormalitiesService extends IService<BusListOfFormalities>{
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询手续办理清单模板
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 手续办理清单模板
 | 
			
		||||
     */
 | 
			
		||||
    BusListOfFormalitiesVo queryById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询手续办理清单模板列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo        查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 手续办理清单模板分页列表
 | 
			
		||||
     */
 | 
			
		||||
    TableDataInfo<BusListOfFormalitiesVo> queryPageList(BusListOfFormalitiesBo bo, PageQuery pageQuery);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的手续办理清单模板列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 查询条件
 | 
			
		||||
     * @return 手续办理清单模板列表
 | 
			
		||||
     */
 | 
			
		||||
    List<BusListOfFormalitiesVo> queryList(BusListOfFormalitiesBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增手续办理清单模板
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 手续办理清单模板
 | 
			
		||||
     * @return 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean insertByBo(BusListOfFormalitiesBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改手续办理清单模板
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 手续办理清单模板
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean updateByBo(BusListOfFormalitiesBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除手续办理清单模板信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id    待删除的主键集合
 | 
			
		||||
     * @param isValid 是否进行有效性校验
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean deleteWithValidByIds(Long id, Boolean isValid);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取树形结构数据
 | 
			
		||||
     * @param bo
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    List<BusListOfFormalitiesVo> getTree(BusListOfFormalitiesBo bo);
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,216 @@
 | 
			
		||||
package org.dromara.formalities.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import org.dromara.common.core.exception.ServiceException;
 | 
			
		||||
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.formalities.domain.BusListOfFormalities;
 | 
			
		||||
import org.dromara.formalities.domain.bo.AddBusFormalitiesAreConsolidatedBo;
 | 
			
		||||
import org.dromara.formalities.enums.FormalitiesStatusEnum;
 | 
			
		||||
import org.dromara.formalities.service.IBusListOfFormalitiesService;
 | 
			
		||||
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.BusFormalitiesAreConsolidatedBo;
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusFormalitiesAreConsolidatedVo;
 | 
			
		||||
import org.dromara.formalities.domain.BusFormalitiesAreConsolidated;
 | 
			
		||||
import org.dromara.formalities.mapper.BusFormalitiesAreConsolidatedMapper;
 | 
			
		||||
import org.dromara.formalities.service.IBusFormalitiesAreConsolidatedService;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
import java.util.*;
 | 
			
		||||
 | 
			
		||||
import static org.dromara.common.constant.MinioPathConstant.ContactNoticeTemplate;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 合规性手续合账Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
@Service
 | 
			
		||||
public class BusFormalitiesAreConsolidatedServiceImpl extends ServiceImpl<BusFormalitiesAreConsolidatedMapper, BusFormalitiesAreConsolidated> implements IBusFormalitiesAreConsolidatedService {
 | 
			
		||||
 | 
			
		||||
    private final BusFormalitiesAreConsolidatedMapper baseMapper;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private IBusListOfFormalitiesService busListOfFormalitiesService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISysOssService ossService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询合规性手续合账
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 合规性手续合账
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public BusFormalitiesAreConsolidatedVo queryById(Long id){
 | 
			
		||||
        return baseMapper.selectVoById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询合规性手续合账列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo        查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 合规性手续合账分页列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TableDataInfo<BusFormalitiesAreConsolidatedVo> queryPageList(BusFormalitiesAreConsolidatedBo bo, PageQuery pageQuery) {
 | 
			
		||||
        LambdaQueryWrapper<BusFormalitiesAreConsolidated> lqw = buildQueryWrapper(bo);
 | 
			
		||||
        Page<BusFormalitiesAreConsolidatedVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
 | 
			
		||||
        return TableDataInfo.build(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的合规性手续合账列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 查询条件
 | 
			
		||||
     * @return 合规性手续合账列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<BusFormalitiesAreConsolidatedVo> queryList(BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
        LambdaQueryWrapper<BusFormalitiesAreConsolidated> lqw = buildQueryWrapper(bo);
 | 
			
		||||
        return baseMapper.selectVoList(lqw);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private LambdaQueryWrapper<BusFormalitiesAreConsolidated> buildQueryWrapper(BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
        Map<String, Object> params = bo.getParams();
 | 
			
		||||
        LambdaQueryWrapper<BusFormalitiesAreConsolidated> lqw = Wrappers.lambdaQuery();
 | 
			
		||||
        lqw.orderByDesc(BusFormalitiesAreConsolidated::getId);
 | 
			
		||||
        lqw.eq(bo.getProjectId() != null, BusFormalitiesAreConsolidated::getProjectId, bo.getProjectId());
 | 
			
		||||
        lqw.eq(bo.getFormalitiesPid() != null, BusFormalitiesAreConsolidated::getFormalitiesPid, bo.getFormalitiesPid());
 | 
			
		||||
        lqw.eq(bo.getFormalitiesId() != null, BusFormalitiesAreConsolidated::getFormalitiesId, bo.getFormalitiesId());
 | 
			
		||||
        lqw.eq(bo.getPlanTheStartTime() != null, BusFormalitiesAreConsolidated::getPlanTheStartTime, bo.getPlanTheStartTime());
 | 
			
		||||
        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;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增合规性手续合账
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 合规性手续合账
 | 
			
		||||
     * @return 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean insertByBo(BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
        List<AddBusFormalitiesAreConsolidatedBo> addBusFormalitiesAreConsolidatedBos = bo.getAddBusFormalitiesAreConsolidatedBos();
 | 
			
		||||
        List<BusFormalitiesAreConsolidated> list = new ArrayList<>();
 | 
			
		||||
        addBusFormalitiesAreConsolidatedBos.forEach(addBusFormalitiesAreConsolidatedBo -> {
 | 
			
		||||
            BusFormalitiesAreConsolidated busFormalitiesAreConsolidated = new BusFormalitiesAreConsolidated();
 | 
			
		||||
            busFormalitiesAreConsolidated.setFormalitiesId(addBusFormalitiesAreConsolidatedBo.getFormalitiesId());
 | 
			
		||||
            BusListOfFormalities ofFormalities = busListOfFormalitiesService.getById(addBusFormalitiesAreConsolidatedBo.getFormalitiesId());
 | 
			
		||||
            if (ofFormalities != null) {
 | 
			
		||||
                busFormalitiesAreConsolidated.setFormalitiesName(ofFormalities.getName());
 | 
			
		||||
            }
 | 
			
		||||
            if (addBusFormalitiesAreConsolidatedBo.getFormalitiesPid() != null) {
 | 
			
		||||
                busFormalitiesAreConsolidated.setFormalitiesPid(addBusFormalitiesAreConsolidatedBo.getFormalitiesPid());
 | 
			
		||||
                BusListOfFormalities formalities = busListOfFormalitiesService.getById(addBusFormalitiesAreConsolidatedBo.getFormalitiesPid());
 | 
			
		||||
                if (formalities != null) {
 | 
			
		||||
                    busFormalitiesAreConsolidated.setFormalitiesPname(formalities.getName());
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            busFormalitiesAreConsolidated.setProjectId(bo.getProjectId());
 | 
			
		||||
            busFormalitiesAreConsolidated.setProcessingStatus(FormalitiesStatusEnum.TOSTART.getText());
 | 
			
		||||
            list.add(busFormalitiesAreConsolidated);
 | 
			
		||||
        });
 | 
			
		||||
//        BusFormalitiesAreConsolidated add = MapstructUtils.convert(bo, BusFormalitiesAreConsolidated.class);
 | 
			
		||||
//        validEntityBeforeSave(add);
 | 
			
		||||
//        boolean flag = baseMapper.insert(add) > 0;
 | 
			
		||||
//        if (flag) {
 | 
			
		||||
//            bo.setId(add.getId());
 | 
			
		||||
//        }
 | 
			
		||||
        return baseMapper.insertBatch(list);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改合规性手续合账
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo   合规性手续合账
 | 
			
		||||
     * @param files
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean updateByBo(BusFormalitiesAreConsolidatedBo bo, List<MultipartFile> files) {
 | 
			
		||||
 | 
			
		||||
        // 先判断数组是否为空或长度为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(ContactNoticeTemplate,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);
 | 
			
		||||
        return baseMapper.updateById(update) > 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存前的数据校验
 | 
			
		||||
     */
 | 
			
		||||
    private void validEntityBeforeSave(BusFormalitiesAreConsolidated entity){
 | 
			
		||||
        //TODO 做一些数据校验,如唯一约束
 | 
			
		||||
        if (entity.getStatus() == 1){
 | 
			
		||||
            throw new ServiceException("已完成不允许修改");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除合规性手续合账信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids     待删除的主键集合
 | 
			
		||||
     * @param isValid 是否进行有效性校验
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
 | 
			
		||||
        if(isValid){
 | 
			
		||||
            //TODO 做一些业务上的校验,判断是否需要校验
 | 
			
		||||
        }
 | 
			
		||||
        return baseMapper.deleteByIds(ids) > 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean editStatus(BusFormalitiesAreConsolidatedBo bo) {
 | 
			
		||||
        BusFormalitiesAreConsolidated busFormalitiesAreConsolidated = baseMapper.selectById(bo.getId());
 | 
			
		||||
        if (busFormalitiesAreConsolidated == null) {
 | 
			
		||||
            throw new ServiceException("数据不存在");
 | 
			
		||||
        }
 | 
			
		||||
        if (busFormalitiesAreConsolidated.getHead() != null) {
 | 
			
		||||
            throw new ServiceException("负责人为空不能提交");
 | 
			
		||||
        }
 | 
			
		||||
        if (busFormalitiesAreConsolidated.getPlanTheStartTime() != null) {
 | 
			
		||||
            throw new ServiceException("计划开始时间为空不能提交");
 | 
			
		||||
        }
 | 
			
		||||
        if (busFormalitiesAreConsolidated.getFormalitiesUrl() != null && !busFormalitiesAreConsolidated.getFormalitiesUrl().isEmpty()) {
 | 
			
		||||
            throw new ServiceException("手续材料为空不能提交");
 | 
			
		||||
        }
 | 
			
		||||
        busFormalitiesAreConsolidated.setActualCompletionTime(new Date());
 | 
			
		||||
        busFormalitiesAreConsolidated.setProcessingStatus(FormalitiesStatusEnum.DELETE.getText());
 | 
			
		||||
        busFormalitiesAreConsolidated.setStatus(1);
 | 
			
		||||
//        BusFormalitiesAreConsolidated update = MapstructUtils.convert(bo, BusFormalitiesAreConsolidated.class);
 | 
			
		||||
        return baseMapper.updateById(busFormalitiesAreConsolidated) > 0;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,156 @@
 | 
			
		||||
package org.dromara.formalities.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import org.dromara.common.core.exception.ServiceException;
 | 
			
		||||
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.formalities.utils.TreeUtil;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.dromara.formalities.domain.bo.BusListOfFormalitiesBo;
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusListOfFormalitiesVo;
 | 
			
		||||
import org.dromara.formalities.domain.BusListOfFormalities;
 | 
			
		||||
import org.dromara.formalities.mapper.BusListOfFormalitiesMapper;
 | 
			
		||||
import org.dromara.formalities.service.IBusListOfFormalitiesService;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 手续办理清单模板Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
@Service
 | 
			
		||||
public class BusListOfFormalitiesServiceImpl extends ServiceImpl<BusListOfFormalitiesMapper, BusListOfFormalities> implements IBusListOfFormalitiesService {
 | 
			
		||||
 | 
			
		||||
    private final BusListOfFormalitiesMapper baseMapper;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询手续办理清单模板
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 手续办理清单模板
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public BusListOfFormalitiesVo queryById(Long id){
 | 
			
		||||
        return baseMapper.selectVoById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询手续办理清单模板列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo        查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 手续办理清单模板分页列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TableDataInfo<BusListOfFormalitiesVo> queryPageList(BusListOfFormalitiesBo bo, PageQuery pageQuery) {
 | 
			
		||||
        LambdaQueryWrapper<BusListOfFormalities> lqw = buildQueryWrapper(bo);
 | 
			
		||||
        Page<BusListOfFormalitiesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
 | 
			
		||||
        return TableDataInfo.build(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取树形结构数据
 | 
			
		||||
     * @param bo
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<BusListOfFormalitiesVo> getTree(BusListOfFormalitiesBo bo) {
 | 
			
		||||
        List<BusListOfFormalitiesVo> voList = queryList(bo);
 | 
			
		||||
        return TreeUtil.buildTree(voList);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的手续办理清单模板列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 查询条件
 | 
			
		||||
     * @return 手续办理清单模板列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<BusListOfFormalitiesVo> queryList(BusListOfFormalitiesBo bo) {
 | 
			
		||||
        LambdaQueryWrapper<BusListOfFormalities> lqw = buildQueryWrapper(bo);
 | 
			
		||||
        return baseMapper.selectVoList(lqw);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private LambdaQueryWrapper<BusListOfFormalities> buildQueryWrapper(BusListOfFormalitiesBo bo) {
 | 
			
		||||
        Map<String, Object> params = bo.getParams();
 | 
			
		||||
        LambdaQueryWrapper<BusListOfFormalities> lqw = Wrappers.lambdaQuery();
 | 
			
		||||
        lqw.orderByDesc(BusListOfFormalities::getId);
 | 
			
		||||
        lqw.eq(bo.getPid() != null, BusListOfFormalities::getPid, bo.getPid());
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(bo.getName()), BusListOfFormalities::getName, bo.getName());
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增手续办理清单模板
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 手续办理清单模板
 | 
			
		||||
     * @return 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean insertByBo(BusListOfFormalitiesBo bo) {
 | 
			
		||||
        BusListOfFormalities add = MapstructUtils.convert(bo, BusListOfFormalities.class);
 | 
			
		||||
        validEntityBeforeSave(add);
 | 
			
		||||
        boolean flag = baseMapper.insert(add) > 0;
 | 
			
		||||
        if (flag) {
 | 
			
		||||
            bo.setId(add.getId());
 | 
			
		||||
        }
 | 
			
		||||
        return flag;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改手续办理清单模板
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 手续办理清单模板
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean updateByBo(BusListOfFormalitiesBo bo) {
 | 
			
		||||
        BusListOfFormalities update = MapstructUtils.convert(bo, BusListOfFormalities.class);
 | 
			
		||||
        validEntityBeforeSave(update);
 | 
			
		||||
        return baseMapper.updateById(update) > 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存前的数据校验
 | 
			
		||||
     */
 | 
			
		||||
    private void validEntityBeforeSave(BusListOfFormalities entity){
 | 
			
		||||
        //TODO 做一些数据校验,如唯一约束
 | 
			
		||||
        Long count = baseMapper.selectCount(new LambdaQueryWrapper<BusListOfFormalities>().eq(BusListOfFormalities::getName, entity.getName()));
 | 
			
		||||
        if(count > 0){
 | 
			
		||||
            throw new ServiceException("名称已存在,请修改后再提交");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除手续办理清单模板信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id     待删除的主键集合
 | 
			
		||||
     * @param isValid 是否进行有效性校验
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean deleteWithValidByIds(Long id, Boolean isValid) {
 | 
			
		||||
        if(isValid){
 | 
			
		||||
            //TODO 做一些业务上的校验,判断是否需要校验
 | 
			
		||||
            Long count = baseMapper.selectCount(new LambdaQueryWrapper<BusListOfFormalities>().eq(BusListOfFormalities::getPid, id));
 | 
			
		||||
            if (count > 0){
 | 
			
		||||
                baseMapper.delete(new LambdaQueryWrapper<BusListOfFormalities>().eq(BusListOfFormalities::getPid, id));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return baseMapper.deleteById(id) > 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,46 @@
 | 
			
		||||
package org.dromara.formalities.utils;
 | 
			
		||||
 | 
			
		||||
import org.dromara.formalities.domain.vo.BusListOfFormalitiesVo;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.Collections;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
 | 
			
		||||
public class TreeUtil {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建树形结构
 | 
			
		||||
     * @param list 所有节点列表
 | 
			
		||||
     * @return 树形结构的根节点列表
 | 
			
		||||
     */
 | 
			
		||||
    public static List<BusListOfFormalitiesVo> buildTree(List<BusListOfFormalitiesVo> list) {
 | 
			
		||||
        List<BusListOfFormalitiesVo> result = new ArrayList<>();
 | 
			
		||||
 | 
			
		||||
        // 找到所有根节点(pid为null或0的节点)
 | 
			
		||||
        for (BusListOfFormalitiesVo node : list) {
 | 
			
		||||
            if (node.getPid() == null || node.getPid() == 0) {
 | 
			
		||||
                result.add(node);
 | 
			
		||||
                // 递归设置子节点
 | 
			
		||||
                setChildren(node, list);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 为节点设置子节点
 | 
			
		||||
     * @param parent 父节点
 | 
			
		||||
     * @param allNodes 所有节点
 | 
			
		||||
     */
 | 
			
		||||
    private static void setChildren(BusListOfFormalitiesVo parent, List<BusListOfFormalitiesVo> allNodes) {
 | 
			
		||||
        for (BusListOfFormalitiesVo node : allNodes) {
 | 
			
		||||
            if (parent.getId().equals(node.getPid())) {
 | 
			
		||||
                parent.getChildren().add(node);
 | 
			
		||||
                // 递归设置子节点的子节点
 | 
			
		||||
                setChildren(node, allNodes);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,7 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8" ?>
 | 
			
		||||
<!DOCTYPE mapper
 | 
			
		||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
			
		||||
<mapper namespace="org.dromara.formalities.mapper.BusFormalitiesAreConsolidatedMapper">
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
@ -0,0 +1,7 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8" ?>
 | 
			
		||||
<!DOCTYPE mapper
 | 
			
		||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
			
		||||
<mapper namespace="org.dromara.formalities.mapper.BusListOfFormalitiesMapper">
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
		Reference in New Issue
	
	Block a user