jiangping
2024-01-18 553831c82c2e8f8ff7b230c4d536cf99c47ece5b
Merge remote-tracking branch 'origin/master'
已添加11个文件
已修改17个文件
1029 ■■■■■ 文件已修改
server/company/src/main/java/com/doumee/api/business/DispatchUnitController.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/company/src/main/java/com/doumee/api/business/InsuranceApplyController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/company/src/main/java/com/doumee/api/business/SolutionsController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/company/src/main/java/com/doumee/api/business/WorktypeController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/dto/DispatchUnitAuditDTO.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/dto/InsuranceApplyQueryDTO.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/dto/SaveDispatchUnitDTO.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/dto/SaveDuSolutionDTO.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/dto/SaveDuWorkTypeDTO.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/dto/SolutionsDTO.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/join/DuLogJoinMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/join/DuSolutionJoinMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/join/DuWorkTypeJoinMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/join/InsuranceApplyJoinMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/DispatchUnit.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/DuLog.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/DuSolution.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/DuWorktype.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/InsuranceApply.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/vo/SolutionsVO.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/DispatchUnitService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/InsuranceApplyService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/SolutionsService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/WorktypeService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/DispatchUnitServiceImpl.java 415 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/SolutionWorktypeServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/WorktypeServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/company/src/main/java/com/doumee/api/business/DispatchUnitController.java
@@ -6,6 +6,7 @@
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageWrap;
import com.doumee.core.model.PageData;
import com.doumee.dao.business.dto.SaveDispatchUnitDTO;
import com.doumee.dao.business.model.DispatchUnit;
import com.doumee.service.business.DispatchUnitService;
import io.swagger.annotations.Api;
@@ -34,9 +35,27 @@
    @ApiOperation("新建")
    @PostMapping("/create")
    @RequiresPermissions("business:dispatchunit:create")
    public ApiResponse create(@RequestBody DispatchUnit dispatchUnit) {
        return ApiResponse.success(dispatchUnitService.create(dispatchUnit));
    public ApiResponse create(@RequestBody SaveDispatchUnitDTO saveDispatchUnitDTO) {
        return ApiResponse.success(dispatchUnitService.create(saveDispatchUnitDTO));
    }
    @PreventRepeat
    @ApiOperation("添加工种")
    @PostMapping("/createSolution")
    @RequiresPermissions("business:dispatchunit:create")
    public ApiResponse createSolution(@RequestBody SaveDispatchUnitDTO saveDispatchUnitDTO) {
        return ApiResponse.success(dispatchUnitService.createSolution(saveDispatchUnitDTO));
    }
    @ApiOperation("修改信息")
    @PostMapping("/editDispatchUnit")
    @RequiresPermissions("business:dispatchunit:update")
    public ApiResponse editDispatchUnit(@RequestBody SaveDispatchUnitDTO saveDispatchUnitDTO) {
        dispatchUnitService.editDispatchUnit(saveDispatchUnitDTO);
        return ApiResponse.success(null);
    }
    @ApiOperation("根据ID删除")
    @GetMapping("/delete/{id}")
@@ -85,6 +104,6 @@
    @GetMapping("/{id}")
    @RequiresPermissions("business:dispatchunit:query")
    public ApiResponse findById(@PathVariable Integer id) {
        return ApiResponse.success(dispatchUnitService.findById(id));
        return ApiResponse.success(dispatchUnitService.detailById(id));
    }
}
server/company/src/main/java/com/doumee/api/business/InsuranceApplyController.java
@@ -6,6 +6,7 @@
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageWrap;
import com.doumee.core.model.PageData;
import com.doumee.dao.business.dto.InsuranceApplyQueryDTO;
import com.doumee.dao.business.model.InsuranceApply;
import com.doumee.service.business.InsuranceApplyService;
import io.swagger.annotations.Api;
@@ -70,14 +71,14 @@
    @ApiOperation("分页查询")
    @PostMapping("/page")
    @RequiresPermissions("business:insuranceapply:query")
    public ApiResponse<PageData<InsuranceApply>> findPage (@RequestBody PageWrap<InsuranceApply> pageWrap) {
    public ApiResponse<PageData<InsuranceApply>> findPage (@RequestBody PageWrap<InsuranceApplyQueryDTO> pageWrap) {
        return ApiResponse.success(insuranceApplyService.findPage(pageWrap));
    }
    @ApiOperation("导出Excel")
    @PostMapping("/exportExcel")
    @RequiresPermissions("business:insuranceapply:exportExcel")
    public void exportExcel (@RequestBody PageWrap<InsuranceApply> pageWrap, HttpServletResponse response) {
    public void exportExcel (@RequestBody PageWrap<InsuranceApplyQueryDTO> pageWrap, HttpServletResponse response) {
        ExcelExporter.build(InsuranceApply.class).export(insuranceApplyService.findPage(pageWrap).getRecords(), "投保申请信息表", response);
    }
server/company/src/main/java/com/doumee/api/business/SolutionsController.java
@@ -81,6 +81,12 @@
        return ApiResponse.success(solutionsService.findList(pageWrap));
    }
    @ApiOperation("列表查询")
    @PostMapping("/page")
    public ApiResponse<List<Solutions>> findPage (@RequestBody Solutions solutions) {
        return ApiResponse.success(solutionsService.findList(solutions));
    }
    @ApiOperation("导出Excel")
    @PostMapping("/exportExcel")
    @RequiresPermissions("business:solutions:exportExcel")
server/company/src/main/java/com/doumee/api/business/WorktypeController.java
@@ -10,6 +10,8 @@
import com.doumee.dao.business.model.Worktype;
import com.doumee.service.business.WorktypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;    
import org.springframework.beans.factory.annotation.Autowired;
@@ -94,4 +96,16 @@
    public ApiResponse findById(@PathVariable Integer id) {
        return ApiResponse.success(worktypeService.findById(id));
    }
    @ApiOperation("根据保险方案查询工种信息")
    @GetMapping("/getBySolutionsId")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "solutionId", value = "方案主键", required = true),
    })
    public ApiResponse<List<Worktype>> getBySolutionsId (@RequestParam Integer solutionId) {
        return ApiResponse.success(worktypeService.getBySolutionsId(solutionId));
    }
}
server/service/src/main/java/com/doumee/dao/business/dto/DispatchUnitAuditDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.doumee.dao.business.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/1/16 10:36
 */
@Data
public class DispatchUnitAuditDTO {
    @ApiModelProperty(value = "主键")
    private Integer id;
    @ApiModelProperty(value = "审批类别:0=单位审批;1=工种审批")
    private Integer auditType;
    @ApiModelProperty(value = "审批状态 1审核通过 2审核不通过")
    private Integer status;
    @ApiModelProperty(value = "审批备注")
    private String auditRemark;
}
server/service/src/main/java/com/doumee/dao/business/dto/InsuranceApplyQueryDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
package com.doumee.dao.business.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.doumee.core.annotation.excel.ExcelColumn;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * @author RenKang
 */
@Data
public class InsuranceApplyQueryDTO {
    @ApiModelProperty(value = "方案编码(关联solutions)", example = "1")
    private Integer solutionId;
    @ApiModelProperty(value = "实际保险生效止期开始")
    private Date endTimeS;
    @ApiModelProperty(value = "实际保险生效止期结束")
    private Date endTimeE;
    @ApiModelProperty(value = "实际保险生效起期开始")
    private Date startTimeS;
    @ApiModelProperty(value = "实际保险生效起期结束")
    private Date startTimeE;
    @ApiModelProperty(value = "单号")
    private String code;
    @ApiModelProperty(value = "状态 0待审核 1平台退回保单(已退回) 2已上传代签申请表待企业签章(待签署)  3已签章待上传保险单(待出单) 4保单出具失败退回(已退回) 5已上传保单(保障中)6企业申请退回中 7平台同意退回(已退回) 8企业关闭  ï¼ˆå·²å…³é—­ï¼‰", example = "1")
    private Integer status;
}
server/service/src/main/java/com/doumee/dao/business/dto/SaveDispatchUnitDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
package com.doumee.dao.business.dto;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/1/16 10:36
 */
@Data
public class SaveDispatchUnitDTO {
    @ApiModelProperty(value = "主键")
    private Integer id;
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "派遣单位信用代码")
    private String code;
    @ApiModelProperty(value = "派遣单位描述")
    private String content;
    @ApiModelProperty(value = "派遣单位方案关联数据")
    private List<SaveDuSolutionDTO> saveDuSolutionDTOList;
}
server/service/src/main/java/com/doumee/dao/business/dto/SaveDuSolutionDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
package com.doumee.dao.business.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/1/16 10:36
 */
@Data
public class SaveDuSolutionDTO {
    @ApiModelProperty(value = "主键")
    private Integer id;
    @ApiModelProperty(value = "方案主键")
    private Integer solutionId;
    @ApiModelProperty(value = "方案名称")
    private String solutionName;
    @ApiModelProperty(value = "工种关联信息")
    List<SaveDuWorkTypeDTO> saveDuWorkTypeDTOList;
}
server/service/src/main/java/com/doumee/dao/business/dto/SaveDuWorkTypeDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package com.doumee.dao.business.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/1/16 10:36
 */
@Data
public class SaveDuWorkTypeDTO {
    @ApiModelProperty(value = "主键")
    private Integer id;
    @ApiModelProperty(value = "工种主键")
    private Integer workTypeId;
    @ApiModelProperty(value = "工种名称")
    private String workTypeName;
    @ApiModelProperty(value = "视频地址")
    private String videoUrl;
}
server/service/src/main/java/com/doumee/dao/business/dto/SolutionsDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package com.doumee.dao.business.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/1/16 9:35
 */
@Data
public class SolutionsDTO {
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "所属保险公司编码(insurance)", example = "1")
    private Integer insuranceId;
    @ApiModelProperty(value = "生效时间方式 0日后生效 1次月生效", example = "1")
    private Integer validType;
    @ApiModelProperty(value = "类型 0直保 1委托投保", example = "1")
    private Integer type;
}
server/service/src/main/java/com/doumee/dao/business/join/DuLogJoinMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
package com.doumee.dao.business.join;
import com.doumee.dao.business.model.DuLog;
import com.github.yulichang.base.mapper.MPJJoinMapper;
/**
 * @author T14
 */
//@Repository
public interface DuLogJoinMapper extends MPJJoinMapper<DuLog> {
}
server/service/src/main/java/com/doumee/dao/business/join/DuSolutionJoinMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package com.doumee.dao.business.join;
import com.doumee.dao.business.model.DuLog;
import com.doumee.dao.business.model.DuSolution;
import com.github.yulichang.base.mapper.MPJJoinMapper;
/**
 * @author T14
 */
//@Repository
public interface DuSolutionJoinMapper extends MPJJoinMapper<DuSolution> {
}
server/service/src/main/java/com/doumee/dao/business/join/DuWorkTypeJoinMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
package com.doumee.dao.business.join;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.DuWorktype;
import com.github.yulichang.base.mapper.MPJJoinMapper;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2024/01/16 10:03
 */
public interface DuWorkTypeJoinMapper extends MPJJoinMapper<DuWorktype> {
}
server/service/src/main/java/com/doumee/dao/business/join/InsuranceApplyJoinMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
package com.doumee.dao.business.join;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.InsuranceApply;
import com.github.yulichang.base.mapper.MPJJoinMapper;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2024/01/16 10:03
 */
public interface InsuranceApplyJoinMapper extends MPJJoinMapper<InsuranceApply> {
}
server/service/src/main/java/com/doumee/dao/business/model/DispatchUnit.java
@@ -1,5 +1,6 @@
package com.doumee.dao.business.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -9,6 +10,7 @@
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.util.List;
/**
 * æ´¾é£å•位信息表
@@ -50,6 +52,15 @@
    @ApiModelProperty(value = "名称")
    @ExcelColumn(name="名称")
    private String name;
    @ApiModelProperty(value = "派遣单位信用代码")
    @ExcelColumn(name="派遣单位信用代码")
    private String code;
    @ApiModelProperty(value = "派遣单位描述")
    @ExcelColumn(name="派遣单位描述")
    private String content;
    @ApiModelProperty(value = "备注")
    @ExcelColumn(name="备注")
@@ -108,4 +119,14 @@
    @ExcelColumn(name="基表编码(自关联)")
    private Integer baseId;
    @ApiModelProperty(value = "派遣单位方案管关联信息表", example = "1")
    @TableField(exist = false)
    private List<DuSolution> duSolutionList;
    @ApiModelProperty(value = "派遣单位操作历史记录表", example = "1")
    @TableField(exist = false)
    private List<DuLog> duLogList;
}
server/service/src/main/java/com/doumee/dao/business/model/DuLog.java
@@ -1,5 +1,6 @@
package com.doumee.dao.business.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -83,4 +84,13 @@
    @ExcelColumn(name="状态0正常 1停用")
    private Integer status;
    @ApiModelProperty(value = "创建人名称", example = "1")
    @TableField(exist = false)
    private String  creatorName;
    @ApiModelProperty(value = "公司名称", example = "1")
    @TableField(exist = false)
    private String  companyName;
}
server/service/src/main/java/com/doumee/dao/business/model/DuSolution.java
@@ -1,5 +1,6 @@
package com.doumee.dao.business.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -9,6 +10,7 @@
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.util.List;
/**
 * æ´¾é£å•位方案管关联信息表
@@ -80,4 +82,13 @@
    @ExcelColumn(name="审核人编码(关联system_user)")
    private Integer checkUserId;
    @ApiModelProperty(value = "方案名称")
    @TableField(exist = false)
    private String solutionName;
    @ApiModelProperty(value = "派遣单位方案管工种关联信息表", example = "1")
    @TableField(exist = false)
    private List<DuWorktype> duWorktypeList;
}
server/service/src/main/java/com/doumee/dao/business/model/DuWorktype.java
@@ -1,5 +1,6 @@
package com.doumee.dao.business.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -88,4 +89,7 @@
    @ExcelColumn(name="状态0正常 1停用")
    private Integer status2;
    @ApiModelProperty(value = "工种名称")
    @TableField(exist = false)
    private String workTypeName;
}
server/service/src/main/java/com/doumee/dao/business/model/InsuranceApply.java
@@ -1,5 +1,6 @@
package com.doumee.dao.business.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -104,4 +105,13 @@
    @ExcelColumn(name="状态 0待审核 1平台退回保单(已退回) 2已上传代签申请表待企业签章(待签署)  3已签章待上传保险单(待出单) 4保单出具失败退回(已退回) 5已上传保单(保障中)6企业申请退回中 7平台同意退回(已退回) 8企业关闭  ï¼ˆå·²å…³é—­ï¼‰")
    private Integer status;
    @ApiModelProperty(value = "企业名称")
    @TableField(exist = false)
    private String companyName;
    @ApiModelProperty(value = "方案名称")
    @TableField(exist = false)
    private String solutionsName;
}
server/service/src/main/java/com/doumee/dao/business/vo/SolutionsVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
package com.doumee.dao.business.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.doumee.core.annotation.excel.ExcelColumn;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/1/16 9:35
 */
@Data
public class SolutionsVO {
    @ApiModelProperty(value = "主键", example = "1")
    private Integer id;
    @ApiModelProperty(value = "创建人编码", example = "1")
    private Integer creator;
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createDate;
    @ApiModelProperty(value = "更新人编码", example = "1")
    private Integer editor;
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;
    @ApiModelProperty(value = "是否删除0否 1是", example = "1")
    private Integer isdeleted;
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "状态 0启用 1禁用", example = "1")
    private Integer status;
    @ApiModelProperty(value = "排序码", example = "1")
    private Integer sortnum;
    @ApiModelProperty(value = "所属保险公司编码(insurance)", example = "1")
    private Integer insuranceId;
    @ApiModelProperty(value = "生效时间方式 0日后生效 1次月生效", example = "1")
    private Integer validType;
    @ApiModelProperty(value = "类型 0直保 1委托投保", example = "1")
    private Integer type;
    @ApiModelProperty(value = "最低年龄", example = "1")
    private Integer minAge;
    @ApiModelProperty(value = "最高年龄", example = "1")
    private Integer maxAge;
    @ApiModelProperty(value = "保险费用(人/天)", example = "1")
    private BigDecimal price;
    @ApiModelProperty(value = "保险时间单位0天 1半月 2月 3å¹´", example = "1")
    private Integer timeUnit;
    @ApiModelProperty(value = "开户行")
    private String insureCycle;
    @ApiModelProperty(value = "最小投保周期时间单位0天 1半月 2月 3å¹´", example = "1")
    private Integer insureCycleUnit;
    @ApiModelProperty(value = "最小计费周期时间单位 0天 1半月 2月 3å¹´", example = "1")
    private Integer priceCycleUnit;
    @ApiModelProperty(value = "是否单独指派工种 0否 1四", example = "1")
    private Integer singleWorktype;
    @ApiModelProperty(value = "接收文件邮箱")
    private String email;
    @ApiModelProperty(value = "特别约定")
    private String specialAgreement;
    @ApiModelProperty(value = "特别说明")
    private String specialInfo;
    @ApiModelProperty(value = "其他说明")
    private String ortherInfo;
    @ApiModelProperty(value = "所属方案基表编码(solution_base_id)", example = "1")
    private Integer solutionBaseId;
    @ApiModelProperty(value = "版本号")
    private String version;
}
server/service/src/main/java/com/doumee/service/business/DispatchUnitService.java
@@ -2,6 +2,8 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.dto.DispatchUnitAuditDTO;
import com.doumee.dao.business.dto.SaveDispatchUnitDTO;
import com.doumee.dao.business.model.DispatchUnit;
import java.util.List;
@@ -15,11 +17,30 @@
    /**
     * åˆ›å»º
     * 
     * @param dispatchUnit å®žä½“对象
     * @param saveDispatchUnitDTO å®žä½“对象
     * @return Integer
     */
    Integer create(DispatchUnit dispatchUnit);
    Integer create(SaveDispatchUnitDTO saveDispatchUnitDTO);
    /**
     * æ›´æ–°
     * @param saveDispatchUnitDTO
     * @return
     */
    Integer editDispatchUnit(SaveDispatchUnitDTO saveDispatchUnitDTO);
    /**
     * æ·»åŠ å·¥ç§
     * @param saveDispatchUnitDTO
     * @return
     */
    Integer createSolution(SaveDispatchUnitDTO saveDispatchUnitDTO);
    /**
     * æ´¾é£å•位审批/工种审批
     * @param dispatchUnitAuditDTO
     */
    void auditData(DispatchUnitAuditDTO dispatchUnitAuditDTO);
    /**
     * ä¸»é”®åˆ é™¤
     *
@@ -94,4 +115,11 @@
     * @return long
     */
    long count(DispatchUnit dispatchUnit);
    /**
     * æŸ¥è¯¢è¯¦æƒ…信息
     * @param id
     * @return
     */
    DispatchUnit detailById(Integer id);
}
server/service/src/main/java/com/doumee/service/business/InsuranceApplyService.java
@@ -2,6 +2,7 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.dto.InsuranceApplyQueryDTO;
import com.doumee.dao.business.model.InsuranceApply;
import java.util.List;
@@ -85,7 +86,7 @@
     * @param pageWrap åˆ†é¡µå¯¹è±¡
     * @return PageData<InsuranceApply>
     */
    PageData<InsuranceApply> findPage(PageWrap<InsuranceApply> pageWrap);
    PageData<InsuranceApply> findPage(PageWrap<InsuranceApplyQueryDTO> pageWrap);
    /**
     * æ¡ä»¶ç»Ÿè®¡
server/service/src/main/java/com/doumee/service/business/SolutionsService.java
@@ -89,6 +89,8 @@
    PageData<Solutions> findPage(PageWrap<Solutions> pageWrap);
    PageData<Solutions> findPageCom(PageWrap<Solutions> pageWrap);
    /**
     * æ¡ä»¶ç»Ÿè®¡
     *
server/service/src/main/java/com/doumee/service/business/WorktypeService.java
@@ -78,6 +78,15 @@
     * @return List<Worktype>
     */
    List<Worktype> findList(Worktype worktype);
    /**
     * æ ¹æ®ä¿é™©æ–¹æ¡ˆæŸ¥è¯¢å·¥ç§ä¿¡æ¯
     * @param solutionId
     * @return
     */
    List<Worktype> getBySolutionsId(Integer solutionId);
  
    /**
     * åˆ†é¡µæŸ¥è¯¢
server/service/src/main/java/com/doumee/service/business/impl/DispatchUnitServiceImpl.java
@@ -1,20 +1,42 @@
package com.doumee.service.business.impl;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.DispatchUnitMapper;
import com.doumee.dao.business.model.DispatchUnit;
import com.doumee.dao.business.DuLogMapper;
import com.doumee.dao.business.DuSolutionMapper;
import com.doumee.dao.business.DuWorktypeMapper;
import com.doumee.dao.business.dto.DispatchUnitAuditDTO;
import com.doumee.dao.business.dto.SaveDispatchUnitDTO;
import com.doumee.dao.business.dto.SaveDuSolutionDTO;
import com.doumee.dao.business.dto.SaveDuWorkTypeDTO;
import com.doumee.dao.business.join.DuLogJoinMapper;
import com.doumee.dao.business.join.DuSolutionJoinMapper;
import com.doumee.dao.business.join.DuWorkTypeJoinMapper;
import com.doumee.dao.business.model.*;
import com.doumee.service.business.DispatchUnitService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
/**
 * æ´¾é£å•位信息表Service实现
@@ -27,11 +49,358 @@
    @Autowired
    private DispatchUnitMapper dispatchUnitMapper;
    @Autowired
    private DuSolutionMapper duSolutionMapper;
    @Autowired
    private DuWorktypeMapper    duWorktypeMapper;
    @Autowired
    private DuLogMapper duLogMapper;
    @Autowired
    private DuLogJoinMapper duLogJoinMapper;
    @Autowired
    private DuSolutionJoinMapper duSolutionJoinMapper;
    @Autowired
    private DuWorkTypeJoinMapper duWorkTypeJoinMapper;
    @Override
    public Integer create(DispatchUnit dispatchUnit) {
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    public Integer create(SaveDispatchUnitDTO saveDispatchUnitDTO) {
        if(Objects.isNull(saveDispatchUnitDTO)
            || StringUtils.isEmpty(saveDispatchUnitDTO.getName())
            || StringUtils.isEmpty(saveDispatchUnitDTO.getCode())
            || StringUtils.isEmpty(saveDispatchUnitDTO.getContent())
            || CollectionUtils.isEmpty(saveDispatchUnitDTO.getSaveDuSolutionDTOList())
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(dispatchUnitMapper.selectCount(new QueryWrapper<DispatchUnit>().lambda()
                .eq(DispatchUnit::getCompanyId,loginUserInfo.getCompanyId())
                .eq(DispatchUnit::getName,saveDispatchUnitDTO.getName())
                .eq(DispatchUnit::getIsdeleted,Constants.ZERO)
        )> Constants.ZERO){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【派遣单位名称】已存在");
        };
        if(dispatchUnitMapper.selectCount(new QueryWrapper<DispatchUnit>().lambda()
                .eq(DispatchUnit::getCompanyId,loginUserInfo.getCompanyId())
                .eq(DispatchUnit::getCode,saveDispatchUnitDTO.getCode())
                .eq(DispatchUnit::getIsdeleted,Constants.ZERO)
        )> Constants.ZERO){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【派遣单位信用代码】已存在");
        };
        DispatchUnit dispatchUnit = new DispatchUnit();
        dispatchUnit.setCreateDate(new Date());
        dispatchUnit.setCreator(loginUserInfo.getId());
        dispatchUnit.setCompanyId(loginUserInfo.getCompanyId());
        dispatchUnit.setIsdeleted(Constants.ZERO);
        dispatchUnit.setName(saveDispatchUnitDTO.getName());
        dispatchUnit.setCode(saveDispatchUnitDTO.getCode());
        dispatchUnit.setContent(saveDispatchUnitDTO.getContent());
        dispatchUnit.setStatus(Constants.ZERO);
        dispatchUnit.setVersion(UUID.randomUUID().toString());
        dispatchUnit.setUnitStatus(Constants.ZERO);
        dispatchUnit.setWorktypeStatus(Constants.ZERO);
        dispatchUnit.setDataType(Constants.ZERO);
        dispatchUnitMapper.insert(dispatchUnit);
        //存储操作历史
        this.saveDuLog(dispatchUnit,Constants.DispatchUnitLogType.UPLOAD,null);
        List<SaveDuSolutionDTO> saveDuSolutionDTOList = saveDispatchUnitDTO.getSaveDuSolutionDTOList();
        for (int i = 0; i < saveDuSolutionDTOList.size(); i++) {
            SaveDuSolutionDTO saveDuSolutionDTO = saveDuSolutionDTOList.get(i);
            DuSolution duSolution = new DuSolution();
            duSolution.setCreateDate(new Date());
            duSolution.setCreator(loginUserInfo.getId());
            duSolution.setIsdeleted(Constants.ZERO);
            duSolution.setDispatchUnitId(dispatchUnit.getId());
            duSolution.setSortnum(i);
            duSolution.setSolutionId(saveDuSolutionDTO.getSolutionId());
            duSolutionMapper.insert(duSolution);
            List<SaveDuWorkTypeDTO> saveDuWorkTypeDTOList = saveDuSolutionDTO.getSaveDuWorkTypeDTOList();
            if(!CollectionUtils.isNotEmpty(saveDuSolutionDTOList)){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【"+saveDuSolutionDTO.getSolutionName()+"】该方案下未选择工种!");
            }
            for (int j = 0; j < saveDuWorkTypeDTOList.size(); j++) {
                SaveDuWorkTypeDTO saveDuWorkTypeDTO = saveDuWorkTypeDTOList.get(j);
                DuWorktype duWorktype = new DuWorktype();
                duWorktype.setCreateDate(new Date());
                duWorktype.setCreator(loginUserInfo.getId());
                duWorktype.setIsdeleted(Constants.ZERO);
                duWorktype.setDuSolutionId(duSolution.getId());
                duWorktype.setSortnum(j);
                duWorktype.setWorkTypeId(saveDuWorkTypeDTO.getWorkTypeId());
                duWorktype.setVideoUrl(saveDuWorkTypeDTO.getVideoUrl());
                duWorktype.setStatus2(Constants.ZERO);
                duWorktypeMapper.insert(duWorktype);
            }
        }
        return dispatchUnit.getId();
    }
    @Override
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    public Integer editDispatchUnit(SaveDispatchUnitDTO saveDispatchUnitDTO) {
        if(Objects.isNull(saveDispatchUnitDTO)
                ||Objects.isNull(saveDispatchUnitDTO.getId())
                || CollectionUtils.isEmpty(saveDispatchUnitDTO.getSaveDuSolutionDTOList())
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        DispatchUnit dispatchUnit = this.dispatchUnitMapper.selectById(saveDispatchUnitDTO.getId());
        if(Objects.isNull(dispatchUnit)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到派遣单位信息");
        }
        if(dispatchUnitMapper.selectCount(new QueryWrapper<DispatchUnit>().lambda()
                .ne(DispatchUnit::getId,saveDispatchUnitDTO.getId())
                .eq(DispatchUnit::getCompanyId,loginUserInfo.getCompanyId())
                .eq(DispatchUnit::getName,saveDispatchUnitDTO.getName())
                .eq(DispatchUnit::getIsdeleted,Constants.ZERO)
        )> Constants.ZERO){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【派遣单位名称】已存在");
        };
        if(dispatchUnitMapper.selectCount(new QueryWrapper<DispatchUnit>().lambda()
                .ne(DispatchUnit::getId,saveDispatchUnitDTO.getId())
                .eq(DispatchUnit::getCompanyId,loginUserInfo.getCompanyId())
                .eq(DispatchUnit::getCode,saveDispatchUnitDTO.getCode())
                .eq(DispatchUnit::getIsdeleted,Constants.ZERO)
        )> Constants.ZERO){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【派遣单位信用代码】已存在");
        }
        dispatchUnit.setCode(saveDispatchUnitDTO.getCode());
        dispatchUnit.setContent(saveDispatchUnitDTO.getContent());
        dispatchUnit.setName(saveDispatchUnitDTO.getName());
        dispatchUnit.setUnitStatus(Constants.ZERO);
        dispatchUnit.setWorktypeStatus(Constants.ZERO);
        dispatchUnit.setEditDate(new Date());
        dispatchUnit.setEditor(loginUserInfo.getId());
        dispatchUnitMapper.updateById(dispatchUnit);
        //存储操作记录
        this.saveDuLog(dispatchUnit,Constants.DispatchUnitLogType.EDIT_UNIT,null);
        this.dealDuData(saveDispatchUnitDTO,loginUserInfo);
        return dispatchUnit.getId();
    }
    /**
     * æ·»åŠ æ–¹æ¡ˆä¿¡æ¯
     * @param saveDispatchUnitDTO
     * @return
     */
    @Override
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    public Integer createSolution(SaveDispatchUnitDTO saveDispatchUnitDTO) {
        if(Objects.isNull(saveDispatchUnitDTO)
                ||Objects.isNull(saveDispatchUnitDTO.getId())
                || CollectionUtils.isEmpty(saveDispatchUnitDTO.getSaveDuSolutionDTOList())
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        DispatchUnit dispatchUnit = this.dispatchUnitMapper.selectById(saveDispatchUnitDTO.getId());
        dispatchUnit.setWorktypeStatus(Constants.ZERO);
        dispatchUnit.setEditDate(new Date());
        dispatchUnit.setEditor(loginUserInfo.getId());
        dispatchUnitMapper.updateById(dispatchUnit);
        if(Objects.isNull(dispatchUnit)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到派遣单位信息");
        }
        //存储操作历史
        this.saveDuLog(dispatchUnit,Constants.DispatchUnitLogType.ADD_WORK_TYPE,null);
        this.dealDuData(saveDispatchUnitDTO,loginUserInfo);
        return dispatchUnit.getId();
    }
    public void dealDuData(SaveDispatchUnitDTO saveDispatchUnitDTO,LoginUserInfo loginUserInfo){
        List<SaveDuSolutionDTO> saveDuSolutionDTOList = saveDispatchUnitDTO.getSaveDuSolutionDTOList();
        for (int i = 0; i < saveDuSolutionDTOList.size(); i++) {
            SaveDuSolutionDTO saveDuSolutionDTO = saveDuSolutionDTOList.get(i);
            DuSolution duSolution = duSolutionMapper.selectOne(new QueryWrapper<DuSolution>().lambda().eq(DuSolution::getDispatchUnitId,saveDuSolutionDTO.getId())
                    .eq(DuSolution::getIsdeleted,Constants.ZERO)
                    .eq(DuSolution::getSolutionId,saveDuSolutionDTO.getSolutionId()).last("limit 1"));
            Integer duSolutionNum = duSolutionMapper.selectCount(new QueryWrapper<DuSolution>().lambda().eq(DuSolution::getDispatchUnitId,saveDuSolutionDTO.getId()));
            if(Objects.isNull(duSolution)){
                duSolution = new DuSolution();
                duSolution.setCreateDate(new Date());
                duSolution.setCreator(loginUserInfo.getId());
                duSolution.setIsdeleted(Constants.ZERO);
                duSolution.setDispatchUnitId(saveDispatchUnitDTO.getId());
                duSolution.setSortnum(duSolutionNum + i);
                duSolution.setSolutionId(saveDuSolutionDTO.getSolutionId());
                duSolutionMapper.insert(duSolution);
            }
            List<SaveDuWorkTypeDTO> saveDuWorkTypeDTOList = saveDuSolutionDTO.getSaveDuWorkTypeDTOList();
            if(!CollectionUtils.isNotEmpty(saveDuSolutionDTOList)){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【"+saveDuSolutionDTO.getSolutionName()+"】该方案下未选择工种!");
            }
            for (int j = 0; j < saveDuWorkTypeDTOList.size(); j++) {
                SaveDuWorkTypeDTO saveDuWorkTypeDTO = saveDuWorkTypeDTOList.get(j);
                if(duWorktypeMapper.selectCount(new QueryWrapper<DuWorktype>().lambda().eq(DuWorktype::getDuSolutionId,duSolution.getId())
                        .eq(DuWorktype::getIsdeleted,Constants.ZERO)
                        .eq(DuWorktype::getWorkTypeId,saveDuWorkTypeDTO.getWorkTypeId()))>0){
                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【"+saveDuSolutionDTO.getSolutionName()+"】该方案下"+saveDuWorkTypeDTO.getWorkTypeName()+"该工种已存在工种已存在");
                }
                Integer duWorkTypeNum = duWorktypeMapper.selectCount(new QueryWrapper<DuWorktype>().lambda().eq(DuWorktype::getDuSolutionId,duSolution.getId()));
                DuWorktype duWorktype = new DuWorktype();
                duWorktype.setCreateDate(new Date());
                duWorktype.setCreator(loginUserInfo.getId());
                duWorktype.setIsdeleted(Constants.ZERO);
                duWorktype.setDuSolutionId(duSolution.getId());
                duWorktype.setSortnum(duWorkTypeNum + j);
                duWorktype.setWorkTypeId(saveDuWorkTypeDTO.getWorkTypeId());
                duWorktype.setVideoUrl(saveDuWorkTypeDTO.getVideoUrl());
                duWorktype.setStatus2(Constants.ZERO);
                duWorktypeMapper.insert(duWorktype);
            }
        }
    }
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    public void auditData(DispatchUnitAuditDTO dispatchUnitAuditDTO){
        if(Objects.isNull(dispatchUnitAuditDTO)
                || Objects.isNull(dispatchUnitAuditDTO.getId())
                || Objects.isNull(dispatchUnitAuditDTO.getAuditType())
                || Objects.isNull(dispatchUnitAuditDTO.getStatus())
                || !(dispatchUnitAuditDTO.getAuditType().equals(Constants.ZERO) || dispatchUnitAuditDTO.getAuditType().equals(Constants.ONE))
                || !(dispatchUnitAuditDTO.getStatus().equals(Constants.ONE) || dispatchUnitAuditDTO.getAuditType().equals(Constants.TWO))
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(loginUserInfo.getType().equals(Constants.ONE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户类型错误:企业用户无法进行该操作");
        }
        DispatchUnit dispatchUnit = this.dispatchUnitMapper.selectById(dispatchUnitAuditDTO.getId());
        if(Objects.isNull(dispatchUnit)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到派遣单位信息");
        }
        //派遣单位审批
        if(dispatchUnitAuditDTO.getAuditType().equals(Constants.ZERO)){
            if(dispatchUnit.getStatus().equals(Constants.ONE)){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"派遣单位信息已审核");
            }
            dispatchUnit.setStatus(dispatchUnitAuditDTO.getStatus());
            dispatchUnit.setCheckDate(new Date());
            dispatchUnit.setCheckUserId(loginUserInfo.getId());
            dispatchUnit.setCheckInfo(dispatchUnitAuditDTO.getAuditRemark());
            dispatchUnitMapper.updateById(dispatchUnit);
            if(dispatchUnitAuditDTO.getStatus().equals(Constants.ONE)){
                this.saveDuLog(dispatchUnit,Constants.DispatchUnitLogType.AUDIT_PASS,dispatchUnitAuditDTO.getAuditRemark());
            }else{
                this.saveDuLog(dispatchUnit,Constants.DispatchUnitLogType.AUDIT_UN_PASS,dispatchUnitAuditDTO.getAuditRemark());
            }
        }else if(dispatchUnitAuditDTO.getAuditType().equals(Constants.ONE)){
            if(!dispatchUnit.getStatus().equals(Constants.ONE)){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"派遣单位信息未审核,无法进行该操作");
            }
            if(dispatchUnitAuditDTO.getStatus().equals(Constants.ONE)){
                this.saveDuLog(dispatchUnit,Constants.DispatchUnitLogType.WORK_TYPE_AUDIT_PASS,dispatchUnitAuditDTO.getAuditRemark());
            }else{
                this.saveDuLog(dispatchUnit,Constants.DispatchUnitLogType.WORK_TYPE_AUDIT_UN_PASS,dispatchUnitAuditDTO.getAuditRemark());
            }
        }else{
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        //更新方案数据
        List<DuSolution> duSolutionList = duSolutionMapper.selectList(new QueryWrapper<DuSolution>().lambda()
                .eq(DuSolution::getStatus,Constants.ZERO)
                .eq(DuSolution::getIsdeleted,Constants.ZERO)
                .eq(DuSolution::getDispatchUnitId,dispatchUnit.getId()));
        for (DuSolution duSolution:duSolutionList) {
            duSolution.setStatus(dispatchUnitAuditDTO.getStatus());
            duSolution.setCheckDate(new Date());
            duSolution.setCheckUserId(loginUserInfo.getId());
            duSolution.setCheckInfo(dispatchUnitAuditDTO.getAuditRemark());
            dispatchUnitMapper.updateById(dispatchUnit);
            //查询工种数据
            List<DuWorktype> duWorktypeList = duWorktypeMapper.selectList(new QueryWrapper<DuWorktype>().lambda()
                    .eq(DuWorktype::getStatus,Constants.ZERO)
                    .eq(DuWorktype::getIsdeleted,Constants.ZERO)
                    .eq(DuWorktype::getDuSolutionId,duSolution.getId()));
            for (DuWorktype duWorktype:duWorktypeList) {
                duWorktype.setStatus(dispatchUnitAuditDTO.getStatus());
                duWorktype.setCheckDate(new Date());
                duWorktype.setCheckUserId(loginUserInfo.getId());
                duWorktype.setCheckInfo(dispatchUnitAuditDTO.getAuditRemark());
                dispatchUnitMapper.updateById(dispatchUnit);
            }
        }
        this.saveHistory(dispatchUnit);
    }
    public void saveHistory(DispatchUnit dispatchUnit){
        if(dispatchUnit.getStatus().equals(Constants.ONE)){
            DispatchUnit his = new DispatchUnit();
            BeanUtils.copyProperties(dispatchUnit,his);
            his.setBaseId(dispatchUnit.getId());
            his.setId(null);
            his.setDataType(Constants.TWO);
            dispatchUnitMapper.insert(his);
            //修改其他历史版本数据为 åŽ†å²ç‰ˆæœ¬
            dispatchUnitMapper.update(null,new UpdateWrapper<DispatchUnit>().lambda().set(DispatchUnit::getDataType,Constants.ONE).eq(DispatchUnit::getBaseId,dispatchUnit.getId())
                    .eq(DispatchUnit::getDataType,Constants.TWO).ne(DispatchUnit::getId,his.getId())
            );
            //存储方案数据
            List<DuSolution> duSolutionList = duSolutionMapper.selectList(new QueryWrapper<DuSolution>().lambda()
                    .eq(DuSolution::getStatus,Constants.ONE)
                    .eq(DuSolution::getDispatchUnitId,dispatchUnit.getId()));
            for (DuSolution duSolution:duSolutionList) {
                DuSolution hisDuSolution = new DuSolution();
                BeanUtils.copyProperties(duSolution,hisDuSolution);
                hisDuSolution.setId(null);
                hisDuSolution.setDispatchUnitId(his.getId());
                duSolutionMapper.insert(hisDuSolution);
                //查询工种数据
                List<DuWorktype> duWorktypeList = duWorktypeMapper.selectList(new QueryWrapper<DuWorktype>().lambda()
                        .eq(DuWorktype::getStatus,Constants.ONE)
                        .eq(DuWorktype::getDuSolutionId,duSolution.getId()));
                for (DuWorktype duWorktype:duWorktypeList) {
                    DuWorktype hisDuWorktype = new DuWorktype();
                    BeanUtils.copyProperties(duWorktype,hisDuWorktype);
                    hisDuWorktype.setId(null);
                    hisDuWorktype.setDuSolutionId(hisDuSolution.getId());
                    duWorktypeMapper.insert(hisDuWorktype);
                }
            }
        }
    }
    public void saveDuLog(DispatchUnit dispatchUnit,Constants.DispatchUnitLogType dispatchUnitLogType,String content){
        LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        DuLog duLog = new DuLog();
        duLog.setCreateDate(new Date());
        duLog.setCreator(loginUserInfo.getId());
        duLog.setIsdeleted(Constants.ZERO);
        duLog.setDuId(dispatchUnit.getId());
        duLog.setTitle(dispatchUnitLogType.getName());
        duLog.setContent(content);
        duLog.setObjType(dispatchUnitLogType.getKey());
        duLog.setObjId(Integer.toString(dispatchUnit.getId()));
        duLog.setStatus(Constants.ZERO);
        duLogMapper.insert(duLog);
    }
    @Override
    public void deleteById(Integer id) {
@@ -170,4 +539,44 @@
        QueryWrapper<DispatchUnit> wrapper = new QueryWrapper<>(dispatchUnit);
        return dispatchUnitMapper.selectCount(wrapper);
    }
    @Override
    public DispatchUnit detailById(Integer id) {
        DispatchUnit dispatchUnit = dispatchUnitMapper.selectById(id);
        //方案配置表
        List<DuSolution> duSolutionList = duSolutionJoinMapper.selectJoinList(DuSolution.class,
                new MPJLambdaWrapper<DuSolution>()
                        .selectAll(DuSolution.class)
                        .selectAs(Solutions::getName,DuSolution::getSolutionName)
                        .leftJoin(Solutions.class,Solutions::getId,DuSolution::getSolutionId)
                        .eq(DuSolution::getSolutionId,dispatchUnit.getId())
                        .orderByAsc(DuSolution::getSortnum)
        );
        if(CollectionUtils.isNotEmpty(duSolutionList)){
            for (DuSolution duSolution:duSolutionList) {
                //查询方案下的工种信息
                List<DuWorktype> duWorkTypeList = duWorkTypeJoinMapper.selectJoinList(DuWorktype.class,
                        new MPJLambdaWrapper<DuWorktype>()
                                .selectAll(DuWorktype.class)
                                .selectAs(Worktype::getName,DuWorktype::getWorkTypeName)
                                .leftJoin(Worktype.class,Worktype::getId,DuWorktype::getWorkTypeId)
                                .eq(DuWorktype::getDuSolutionId,duSolution.getId())
                );
                duSolution.setDuWorktypeList(duWorkTypeList);
            }
            dispatchUnit.setDuSolutionList(duSolutionList);
        }
        //查询操作记录
        List<DuLog> duLogList = duLogJoinMapper.selectJoinList(DuLog.class,
                new MPJLambdaWrapper<DuLog>()
                        .eq(DuLog::getDuId,dispatchUnit.getId())
                        .orderByAsc(DuLog::getCreateDate)
        );
        dispatchUnit.setDuLogList(duLogList);
        return dispatchUnit;
    }
}
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -1,15 +1,24 @@
package com.doumee.service.business.impl;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.InsuranceApplyMapper;
import com.doumee.dao.business.dto.InsuranceApplyQueryDTO;
import com.doumee.dao.business.join.InsuranceApplyJoinMapper;
import com.doumee.dao.business.model.Company;
import com.doumee.dao.business.model.InsuranceApply;
import com.doumee.dao.business.model.Solutions;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.InsuranceApplyService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -26,6 +35,9 @@
    @Autowired
    private InsuranceApplyMapper insuranceApplyMapper;
    @Autowired
    private InsuranceApplyJoinMapper insuranceApplyJoinMapper;
    @Override
    public Integer create(InsuranceApply insuranceApply) {
@@ -85,73 +97,40 @@
    }
  
    @Override
    public PageData<InsuranceApply> findPage(PageWrap<InsuranceApply> pageWrap) {
    public PageData<InsuranceApply> findPage(PageWrap<InsuranceApplyQueryDTO> pageWrap) {
        LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        IPage<InsuranceApply> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        QueryWrapper<InsuranceApply> queryWrapper = new QueryWrapper<>();
        MPJLambdaWrapper<InsuranceApply> queryWrapper = new MPJLambdaWrapper<>();
        Utils.MP.blankToNull(pageWrap.getModel());
        if (pageWrap.getModel().getId() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getId, pageWrap.getModel().getId());
        }
        if (pageWrap.getModel().getCreator() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getCreator, pageWrap.getModel().getCreator());
        }
        if (pageWrap.getModel().getCreateDate() != null) {
            queryWrapper.lambda().ge(InsuranceApply::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
            queryWrapper.lambda().le(InsuranceApply::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
        }
        if (pageWrap.getModel().getEditor() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getEditor, pageWrap.getModel().getEditor());
        }
        if (pageWrap.getModel().getEditDate() != null) {
            queryWrapper.lambda().ge(InsuranceApply::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate()));
            queryWrapper.lambda().le(InsuranceApply::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate()));
        }
        if (pageWrap.getModel().getIsdeleted() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getIsdeleted, pageWrap.getModel().getIsdeleted());
        }
        if (pageWrap.getModel().getRemark() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getRemark, pageWrap.getModel().getRemark());
        }
        if (pageWrap.getModel().getSortnum() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getSortnum, pageWrap.getModel().getSortnum());
        queryWrapper.selectAll(InsuranceApply.class);
        queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName);
        queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName);
        queryWrapper.eq(InsuranceApply::getIsdeleted,Constants.ZERO);
        if(loginUserInfo.getType().equals(Constants.ONE)){
            queryWrapper.eq(InsuranceApply::getCompanyId, loginUserInfo.getCompanyId());
        }
        if (pageWrap.getModel().getSolutionId() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getSolutionId, pageWrap.getModel().getSolutionId());
            queryWrapper.eq(InsuranceApply::getSolutionId, pageWrap.getModel().getSolutionId());
        }
        if (pageWrap.getModel().getCompanyId() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getCompanyId, pageWrap.getModel().getCompanyId());
        if (pageWrap.getModel().getEndTimeS() != null) {
            queryWrapper.ge(InsuranceApply::getEndTime, Utils.Date.getStart(pageWrap.getModel().getEndTimeS()));
        }
        if (pageWrap.getModel().getApplyEndTime() != null) {
            queryWrapper.lambda().ge(InsuranceApply::getApplyEndTime, Utils.Date.getStart(pageWrap.getModel().getApplyEndTime()));
            queryWrapper.lambda().le(InsuranceApply::getApplyEndTime, Utils.Date.getEnd(pageWrap.getModel().getApplyEndTime()));
        if (pageWrap.getModel().getEndTimeE() != null) {
            queryWrapper.le(InsuranceApply::getEndTime, Utils.Date.getEnd(pageWrap.getModel().getEndTimeE()));
        }
        if (pageWrap.getModel().getApplyStartTime() != null) {
            queryWrapper.lambda().ge(InsuranceApply::getApplyStartTime, Utils.Date.getStart(pageWrap.getModel().getApplyStartTime()));
            queryWrapper.lambda().le(InsuranceApply::getApplyStartTime, Utils.Date.getEnd(pageWrap.getModel().getApplyStartTime()));
        if (pageWrap.getModel().getStartTimeS() != null) {
            queryWrapper.ge(InsuranceApply::getStartTime, Utils.Date.getStart(pageWrap.getModel().getStartTimeS()));
        }
        if (pageWrap.getModel().getEndTime() != null) {
            queryWrapper.lambda().ge(InsuranceApply::getEndTime, Utils.Date.getStart(pageWrap.getModel().getEndTime()));
            queryWrapper.lambda().le(InsuranceApply::getEndTime, Utils.Date.getEnd(pageWrap.getModel().getEndTime()));
        }
        if (pageWrap.getModel().getStartTime() != null) {
            queryWrapper.lambda().ge(InsuranceApply::getStartTime, Utils.Date.getStart(pageWrap.getModel().getStartTime()));
            queryWrapper.lambda().le(InsuranceApply::getStartTime, Utils.Date.getEnd(pageWrap.getModel().getStartTime()));
        }
        if (pageWrap.getModel().getCheckDate() != null) {
            queryWrapper.lambda().ge(InsuranceApply::getCheckDate, Utils.Date.getStart(pageWrap.getModel().getCheckDate()));
            queryWrapper.lambda().le(InsuranceApply::getCheckDate, Utils.Date.getEnd(pageWrap.getModel().getCheckDate()));
        }
        if (pageWrap.getModel().getCheckInfo() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getCheckInfo, pageWrap.getModel().getCheckInfo());
        }
        if (pageWrap.getModel().getCheckUserId() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getCheckUserId, pageWrap.getModel().getCheckUserId());
        if (pageWrap.getModel().getStartTimeE() != null) {
            queryWrapper.le(InsuranceApply::getStartTime, Utils.Date.getEnd(pageWrap.getModel().getStartTimeE()));
        }
        if (pageWrap.getModel().getCode() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getCode, pageWrap.getModel().getCode());
            queryWrapper.eq(InsuranceApply::getCode, pageWrap.getModel().getCode());
        }
        if (pageWrap.getModel().getStatus() != null) {
            queryWrapper.lambda().eq(InsuranceApply::getStatus, pageWrap.getModel().getStatus());
            queryWrapper.eq(InsuranceApply::getStatus, pageWrap.getModel().getStatus());
        }
        for(PageWrap.SortData sortData: pageWrap.getSorts()) {
            if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
@@ -160,7 +139,7 @@
                queryWrapper.orderByAsc(sortData.getProperty());
            }
        }
        return PageData.from(insuranceApplyMapper.selectPage(page, queryWrapper));
        return PageData.from(insuranceApplyJoinMapper.selectJoinPage(page,InsuranceApply.class, queryWrapper));
    }
    @Override
server/service/src/main/java/com/doumee/service/business/impl/SolutionWorktypeServiceImpl.java
@@ -1,15 +1,18 @@
package com.doumee.service.business.impl;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.SolutionWorktypeMapper;
import com.doumee.dao.business.dto.SaveDispatchUnitDTO;
import com.doumee.dao.business.model.SolutionWorktype;
import com.doumee.service.business.SolutionWorktypeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -33,6 +36,8 @@
        return solutionWorktype.getId();
    }
    @Override
    public void deleteById(Integer id) {
        solutionWorktypeMapper.deleteById(id);
server/service/src/main/java/com/doumee/service/business/impl/WorktypeServiceImpl.java
@@ -85,6 +85,13 @@
        QueryWrapper<Worktype> wrapper = new QueryWrapper<>(worktype);
        return worktypeMapper.selectList(wrapper);
    }
    @Override
    public List<Worktype> getBySolutionsId(Integer solutionId){
        QueryWrapper<Worktype> wrapper = new QueryWrapper<>();
        wrapper.apply(" id in ( select  sw.WORKTYPE_ID from solution_worktype sw where sw.SOLUTION_ID = "+solutionId+" ) ");
        return worktypeMapper.selectList(wrapper);
    }
  
    @Override
    public PageData<Worktype> findPage(PageWrap<Worktype> pageWrap) {