浏览代码

fix: 客户导入更新

caozixuan 1 年之前
父节点
当前提交
d20d3416ce

+ 35 - 41
sop-api/src/main/java/com/qmth/sop/server/api/TBUserArchivesController.java

@@ -47,6 +47,7 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_USER_ARCHIVES)
 public class TBUserArchivesController {
+
     @Resource
     private TBTaskService tbTaskService;
 
@@ -62,52 +63,48 @@ public class TBUserArchivesController {
     @Resource
     private SequenceService sequenceService;
 
-
     @ApiOperation(value = "人员档案管理-分页查询")
     @RequestMapping(value = "/page", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = UserArchivesResult.class)})
-    public Result findUserArchivesPage(@ApiParam(value = "城市") @RequestParam(required = false) String city,
-                                       @ApiParam(value = "供应商") @RequestParam(required = false) String supplierId,
-                                       @ApiParam(value = "档案名称") @RequestParam(required = false) String archivesName,
-                                       @ApiParam(value = "认证角色") @RequestParam(required = false) RoleTypeEnum roleType,
-                                       @ApiParam(value = "认证状态") @RequestParam(required = false) Boolean authenticationStatus,
-                                       @ApiParam(value = "入档时间-开始") @RequestParam(required = false) Long archivesTimeStart,
-                                       @ApiParam(value = "入档时间-截止") @RequestParam(required = false) Long archivesTimeEnd,
-                                       @ApiParam(value = "剩余有效天数") @RequestParam(required = false) Integer remainValidDay,
-                                       @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
-                                       @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) throws Exception {
-
-        return ResultUtil.ok(tbUserArchivesService.findUserArchivesPage(city, SystemConstant.convertIdToLong(supplierId), archivesName,
-                roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidDay, pageNumber, pageSize));
+    @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = UserArchivesResult.class) })
+    public Result findUserArchivesPage(@ApiParam(value = "城市") @RequestParam(required = false) String city, @ApiParam(value = "供应商") @RequestParam(required = false) String supplierId,
+            @ApiParam(value = "档案名称") @RequestParam(required = false) String archivesName, @ApiParam(value = "认证角色") @RequestParam(required = false) RoleTypeEnum roleType,
+            @ApiParam(value = "认证状态") @RequestParam(required = false) Boolean authenticationStatus, @ApiParam(value = "入档时间-开始") @RequestParam(required = false) Long archivesTimeStart,
+            @ApiParam(value = "入档时间-截止") @RequestParam(required = false) Long archivesTimeEnd, @ApiParam(value = "剩余有效天数") @RequestParam(required = false) Integer remainValidDay,
+            @ApiParam(value = "未上传图片") @RequestParam(required = false) Boolean unUploadPic, @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+            @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize)
+            throws Exception {
+
+        return ResultUtil.ok(tbUserArchivesService.findUserArchivesPage(city, SystemConstant.convertIdToLong(supplierId),
+                archivesName, roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidDay,
+                unUploadPic, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "人员档案管理-小计")
     @RequestMapping(value = "/sub_total", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = UserArchivesSubTotalResult.class)})
-    public Result findUserArchivesSubTotal(@ApiParam(value = "城市") @RequestParam(required = false) String city,
-                                           @ApiParam(value = "供应商") @RequestParam(required = false) String supplierId,
-                                           @ApiParam(value = "档案名称") @RequestParam(required = false) String archivesName,
-                                           @ApiParam(value = "认证角色") @RequestParam(required = false) RoleTypeEnum roleType,
-                                           @ApiParam(value = "认证状态") @RequestParam(required = false) Boolean authenticationStatus,
-                                           @ApiParam(value = "入档时间-开始") @RequestParam(required = false) Long archivesTimeStart,
-                                           @ApiParam(value = "入档时间-截止") @RequestParam(required = false) Long archivesTimeEnd,
-                                           @ApiParam(value = "剩余有效天数") @RequestParam(required = false) Integer remainValidDay) {
-        return ResultUtil.ok(tbUserArchivesService.findUserArchivesSubTotal(city, SystemConstant.convertIdToLong(supplierId), archivesName,
-                roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidDay));
+    @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = UserArchivesSubTotalResult.class) })
+    public Result findUserArchivesSubTotal(@ApiParam(value = "城市") @RequestParam(required = false) String city, @ApiParam(value = "供应商") @RequestParam(required = false) String supplierId,
+            @ApiParam(value = "档案名称") @RequestParam(required = false) String archivesName, @ApiParam(value = "认证角色") @RequestParam(required = false) RoleTypeEnum roleType,
+            @ApiParam(value = "认证状态") @RequestParam(required = false) Boolean authenticationStatus, @ApiParam(value = "入档时间-开始") @RequestParam(required = false) Long archivesTimeStart,
+            @ApiParam(value = "入档时间-截止") @RequestParam(required = false) Long archivesTimeEnd, @ApiParam(value = "剩余有效天数") @RequestParam(required = false) Integer remainValidDay,
+            @ApiParam(value = "未上传图片") @RequestParam(required = false) Boolean unUploadPic) {
+        return ResultUtil.ok(tbUserArchivesService.findUserArchivesSubTotal(city, SystemConstant.convertIdToLong(supplierId),
+                archivesName, roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidDay,
+                unUploadPic));
     }
 
     @ApiOperation(value = "人员档案管理-生成编号")
     @RequestMapping(value = "/create_code", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
+    @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = Result.class) })
     public Result createUserArchivesCode() throws InterruptedException {
         return ResultUtil.ok(sequenceService.createSerialNo(SequenceEnum.USER_ARCHIVES_CODE), ExceptionResultEnum.SUCCESS.getMessage());
     }
 
     @ApiOperation(value = "人员档案管理-编辑")
     @RequestMapping(value = "/edit", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "更新成功", response = Result.class)})
+    @ApiResponses({ @ApiResponse(code = 200, message = "更新成功", response = Result.class) })
     @OperationLog(logType = LogTypeEnum.EDIT)
-    public Result editUserArchives(@Valid @RequestBody UserArchivesParam userArchivesParam, BindingResult bindingResult) throws InterruptedException {
+    public Result editUserArchives(@Valid @RequestBody UserArchivesParam userArchivesParam, BindingResult bindingResult)
+            throws InterruptedException {
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }
@@ -117,7 +114,7 @@ public class TBUserArchivesController {
 
     @ApiOperation(value = "人员档案导入")
     @RequestMapping(value = "/import", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
+    @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = Object.class) })
     @OperationLog(logType = LogTypeEnum.IMPORT)
     public Result importUserArchives(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file) throws Exception {
         Map<String, Object> map = tbTaskService.saveTask(file, TaskTypeEnum.USER_ARCHIVES_IMPORT);
@@ -128,16 +125,13 @@ public class TBUserArchivesController {
 
     @ApiOperation(value = "人员档案导出")
     @RequestMapping(value = "/export", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
+    @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = Object.class) })
     @OperationLog(logType = LogTypeEnum.EXPORT)
-    public Result exportUserArchives(@ApiParam(value = "城市") @RequestParam(required = false) String city,
-                                     @ApiParam(value = "供应商") @RequestParam(required = false) String supplierId,
-                                     @ApiParam(value = "档案名") @RequestParam(required = false) String archivesName,
-                                     @ApiParam(value = "角色类型") @RequestParam(required = false) RoleTypeEnum roleType,
-                                     @ApiParam(value = "认证状态") @RequestParam(required = false) Boolean authenticationStatus,
-                                     @ApiParam(value = "入档时间 - 起始") @RequestParam(required = false) Long archivesTimeStart,
-                                     @ApiParam(value = "入档时间 - 截止") @RequestParam(required = false) Long archivesTimeEnd,
-                                     @ApiParam(value = "有效期") @RequestParam(required = false) Integer remainValidDay) throws Exception {
+    public Result exportUserArchives(@ApiParam(value = "城市") @RequestParam(required = false) String city, @ApiParam(value = "供应商") @RequestParam(required = false) String supplierId,
+            @ApiParam(value = "档案名") @RequestParam(required = false) String archivesName, @ApiParam(value = "角色类型") @RequestParam(required = false) RoleTypeEnum roleType,
+            @ApiParam(value = "认证状态") @RequestParam(required = false) Boolean authenticationStatus, @ApiParam(value = "入档时间 - 起始") @RequestParam(required = false) Long archivesTimeStart,
+            @ApiParam(value = "入档时间 - 截止") @RequestParam(required = false) Long archivesTimeEnd, @ApiParam(value = "有效期") @RequestParam(required = false) Integer remainValidDay,
+            @ApiParam(value = "未上传图片") @RequestParam(required = false) Boolean unUploadPic) throws Exception {
         Map<String, Object> map = tbTaskService.saveTask(TaskTypeEnum.USER_ARCHIVES_EXPORT);
         UserArchivesQuery query = new UserArchivesQuery();
         query.setCity(city);
@@ -148,6 +142,7 @@ public class TBUserArchivesController {
         query.setArchivesTimeStart(archivesTimeStart);
         query.setArchivesTimeEnd(archivesTimeEnd);
         query.setRemainValidDay(remainValidDay);
+        query.setUnUploadPic(unUploadPic);
         map.put(SystemConstant.QUERY, query);
         asyncUserArchivesExportService.exportTask(map);
         TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
@@ -156,7 +151,7 @@ public class TBUserArchivesController {
 
     @ApiOperation(value = "人员档案管理-作废")
     @RequestMapping(value = "/cancel", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "作废成功", response = Result.class)})
+    @ApiResponses({ @ApiResponse(code = 200, message = "作废成功", response = Result.class) })
     @OperationLog(logType = LogTypeEnum.UPDATE)
     public Result cancelUserArchives(@ApiParam(value = "人员档案id集合", required = true) @RequestParam List<String> idList) {
         if (CollectionUtils.isNotEmpty(idList)) {
@@ -166,7 +161,6 @@ public class TBUserArchivesController {
         return ResultUtil.ok();
     }
 
-
     @ApiOperation(value = "生成底照(测试用批量上传照片)")
     @ApiResponses({ @ApiResponse(code = 200, message = "生成底照", response = Object.class) })
     @RequestMapping(value = "/pic/upload", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")

+ 11 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/query/UserArchivesQuery.java

@@ -36,6 +36,9 @@ public class UserArchivesQuery {
     @ApiModelProperty("有效期")
     private Integer remainValidDay;
 
+    @ApiModelProperty("未上传照片")
+    private Boolean unUploadPic;
+
     public String getCity() {
         return city;
     }
@@ -99,4 +102,12 @@ public class UserArchivesQuery {
     public void setRemainValidDay(Integer remainValidDay) {
         this.remainValidDay = remainValidDay;
     }
+
+    public Boolean getUnUploadPic() {
+        return unUploadPic;
+    }
+
+    public void setUnUploadPic(Boolean unUploadPic) {
+        this.unUploadPic = unUploadPic;
+    }
 }

+ 13 - 32
sop-business/src/main/java/com/qmth/sop/business/mapper/TBUserArchivesMapper.java

@@ -22,26 +22,15 @@ import java.util.Map;
  * @since 2023-08-01
  */
 public interface TBUserArchivesMapper extends BaseMapper<TBUserArchives> {
-    IPage<UserArchivesResult> findUserArchivesPage(@Param("iPage") Page<UserArchivesResult> iPage,
-                                                   @Param("city") String city,
-                                                   @Param("supplierId") Long supplierId,
-                                                   @Param("archivesName") String archivesName,
-                                                   @Param("roleType") RoleTypeEnum roleType,
-                                                   @Param("status") Boolean status,
-                                                   @Param("archivesTimeStart") Long archivesTimeStart,
-                                                   @Param("archivesTimeEnd") Long archivesTimeEnd,
-                                                   @Param("remainValidTime") Long remainValidTime,
-                                                   @Param("currentTime") Long currentTime);
 
-    List<UserArchivesImportDto> findExportData(@Param("city") String city,
-                                               @Param("supplierId") Long supplierId,
-                                               @Param("archivesName") String archivesName,
-                                               @Param("roleType") RoleTypeEnum roleType,
-                                               @Param("status") Boolean status,
-                                               @Param("archivesTimeStart") Long archivesTimeStart,
-                                               @Param("archivesTimeEnd") Long archivesTimeEnd,
-                                               @Param("remainValidTime") Long remainValidTime,
-                                               @Param("currentTime") Long currentTime);
+    IPage<UserArchivesResult> findUserArchivesPage(@Param("iPage") Page<UserArchivesResult> iPage, @Param("city") String city,
+            @Param("supplierId") Long supplierId, @Param("archivesName") String archivesName, @Param("roleType") RoleTypeEnum roleType,
+            @Param("status") Boolean status, @Param("archivesTimeStart") Long archivesTimeStart, @Param("archivesTimeEnd") Long archivesTimeEnd,
+            @Param("remainValidTime") Long remainValidTime, @Param("currentTime") Long currentTime, @Param("unUploadPic") Boolean unUploadPic);
+
+    List<UserArchivesImportDto> findExportData(@Param("city") String city, @Param("supplierId") Long supplierId, @Param("archivesName") String archivesName,
+            @Param("roleType") RoleTypeEnum roleType, @Param("status") Boolean status, @Param("archivesTimeStart") Long archivesTimeStart,
+            @Param("archivesTimeEnd") Long archivesTimeEnd, @Param("remainValidTime") Long remainValidTime, @Param("currentTime") Long currentTime, @Param("unUploadPic") Boolean unUploadPic);
 
     /**
      * 根据用户id或档案id查询档案详情
@@ -67,19 +56,11 @@ public interface TBUserArchivesMapper extends BaseMapper<TBUserArchives> {
      * @param crmNo    派单号
      * @return 派单已分配档案
      */
-    List<ArchivesSourceResult> findArchivesUsed(@Param("roleType") RoleTypeEnum roleType,
-                                                @Param("crmNo") String crmNo);
-
+    List<ArchivesSourceResult> findArchivesUsed(@Param("roleType") RoleTypeEnum roleType, @Param("crmNo") String crmNo);
 
-    List<UserArchivesResult> findUserArchivesList(@Param("city") String city,
-                                                  @Param("supplierId") Long supplierId,
-                                                  @Param("archivesName") String archivesName,
-                                                  @Param("roleType") RoleTypeEnum roleType,
-                                                  @Param("status") Boolean status,
-                                                  @Param("archivesTimeStart") Long archivesTimeStart,
-                                                  @Param("archivesTimeEnd") Long archivesTimeEnd,
-                                                  @Param("remainValidTime") Long remainValidTime,
-                                                  @Param("currentTime") Long currentTime);
+    List<UserArchivesResult> findUserArchivesList(@Param("city") String city, @Param("supplierId") Long supplierId, @Param("archivesName") String archivesName,
+            @Param("roleType") RoleTypeEnum roleType, @Param("status") Boolean status, @Param("archivesTimeStart") Long archivesTimeStart,
+            @Param("archivesTimeEnd") Long archivesTimeEnd, @Param("remainValidTime") Long remainValidTime, @Param("currentTime") Long currentTime, @Param("unUploadPic") Boolean unUploadPic);
 
     /**
      * 档案小计
@@ -88,5 +69,5 @@ public interface TBUserArchivesMapper extends BaseMapper<TBUserArchives> {
      */
     List<UserArchivesResult> findSubTotal();
 
-    List<Map<String,Object>> findTempEmp();
+    List<Map<String, Object>> findTempEmp();
 }

+ 7 - 7
sop-business/src/main/java/com/qmth/sop/business/service/TBUserArchivesService.java

@@ -35,13 +35,13 @@ public interface TBUserArchivesService extends IService<TBUserArchives> {
      * @param archivesTimeStart    入档时间-起始
      * @param archivesTimeEnd      入档时间-终止
      * @param remainValidDay       剩余有效天
+     * @param unUploadPic          未上传图片
      * @param pageNumber           分页页数
      * @param pageSize             分页容量
      * @return 结果
      */
     IPage<UserArchivesResult> findUserArchivesPage(String city, Long supplierId, String archivesName, RoleTypeEnum roleType,
-                                                   Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd,
-                                                   Integer remainValidDay, Integer pageNumber, Integer pageSize) throws Exception;
+            Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay, Boolean unUploadPic, Integer pageNumber, Integer pageSize) throws Exception;
 
     /**
      * 编辑用户档案
@@ -58,8 +58,7 @@ public interface TBUserArchivesService extends IService<TBUserArchives> {
      * @return 档案小计情况
      */
     UserArchivesSubTotalResult findUserArchivesSubTotal(String city, Long supplierId, String archivesName, RoleTypeEnum roleType,
-                                                        Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd,
-                                                        Integer remainValidDay);
+            Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay, Boolean unUploadPic);
 
     /**
      * 人员档案管理分页查询
@@ -72,10 +71,11 @@ public interface TBUserArchivesService extends IService<TBUserArchives> {
      * @param archivesTimeStart    入档时间-起始
      * @param archivesTimeEnd      入档时间-终止
      * @param remainValidDay       剩余有效天
+     * @param unUploadPic          未上传图片
      * @return 结果
      */
-    List<UserArchivesImportDto> findExportData(String city, Long supplierId, String archivesName, RoleTypeEnum roleType, Boolean authenticationStatus,
-                                               Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay);
+    List<UserArchivesImportDto> findExportData(String city, Long supplierId, String archivesName, RoleTypeEnum roleType,
+            Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay,Boolean unUploadPic);
 
     /**
      * 作废人员档案
@@ -120,5 +120,5 @@ public interface TBUserArchivesService extends IService<TBUserArchives> {
      */
     List<ArchivesSourceResult> findFreeCoordinatorByServiceId(Long serviceUnitId, String crmNo, boolean verifyRate);
 
-    List<Map<String,Object>> findTempEmp();
+    List<Map<String, Object>> findTempEmp();
 }

+ 56 - 44
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBUserArchivesServiceImpl.java

@@ -34,31 +34,44 @@ import java.util.stream.Collectors;
  */
 @Service
 public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper, TBUserArchives> implements TBUserArchivesService {
+
     @Resource
     private SysUserRoleService sysUserRoleService;
+
     @Resource
     private SysSupplierService sysSupplierService;
+
     @Resource
     private TBUserArchivesSupplierService tbUserArchivesSupplierService;
+
     @Resource
     private SysUserService sysUserService;
+
     @Resource
     private TBServiceService tbServiceService;
+
     @Resource
     private TBCrmService tbCrmService;
+
     @Resource
     private SysRoleService sysRoleService;
+
     @Resource
     private BasicAttachmentService basicAttachmentService;
+
     @Resource
     private TBUserArchivesService tbUserArchivesService;
+
     @Resource
     private SequenceService sequenceService;
+
     @Resource
     private TBSopInfoService tbSopInfoService;
 
     @Override
-    public IPage<UserArchivesResult> findUserArchivesPage(String city, Long supplierId, String archivesName, RoleTypeEnum roleType, Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay, Integer pageNumber, Integer pageSize) throws Exception {
+    public IPage<UserArchivesResult> findUserArchivesPage(String city, Long supplierId, String archivesName,
+            RoleTypeEnum roleType, Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay,
+            Boolean unUploadPic, Integer pageNumber, Integer pageSize) throws Exception {
         if (city != null && city.length() > 0) {
             city = SystemConstant.translateSpecificSign(city);
         }
@@ -76,7 +89,9 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
             remainValidTime = SystemConstant.processMiniutePlus(Duration.ofDays(remainValidDay));
         }
         Long currentTime = System.currentTimeMillis();
-        IPage<UserArchivesResult> page = this.baseMapper.findUserArchivesPage(new Page<>(pageNumber, pageSize), city, supplierId, archivesName, roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidTime, currentTime);
+        IPage<UserArchivesResult> page = this.baseMapper.findUserArchivesPage(new Page<>(pageNumber, pageSize), city,
+                supplierId, archivesName, roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd,
+                remainValidTime, currentTime, unUploadPic);
         for (UserArchivesResult record : page.getRecords()) {
             List<RoleResult> roleResultList = new ArrayList<>();
             Long userId = record.getUserId();
@@ -102,8 +117,7 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
             // 人员占用情况
             List<TBCrm> occupiedCrm = tbCrmService.findOccupiedCrm(userId, null);
             if (CollectionUtils.isNotEmpty(occupiedCrm)) {
-                String occupiedInfo = occupiedCrm.stream()
-                        .map(e -> String.format("%s(%s)", e.getName(), e.getCrmNo()))
+                String occupiedInfo = occupiedCrm.stream().map(e -> String.format("%s(%s)", e.getName(), e.getCrmNo()))
                         .collect(Collectors.joining(";"));
                 record.setOccupiedInfo(occupiedInfo);
             }
@@ -139,7 +153,8 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
         Long id = userArchivesParam.getId();
         // 校验身份证号唯一
         String identify = userArchivesParam.getIdentity();
-        List<TBUserArchives> identifyCheckList = this.list(new QueryWrapper<TBUserArchives>().lambda().eq(TBUserArchives::getIdentity, identify));
+        List<TBUserArchives> identifyCheckList = this.list(
+                new QueryWrapper<TBUserArchives>().lambda().eq(TBUserArchives::getIdentity, identify));
         if (identifyCheckList.size() > 1) {
             throw ExceptionResultEnum.ERROR.exception("系统中存在多个相同的身份证号异常[" + identify + "]");
         } else if (identifyCheckList.size() == 1) {
@@ -150,7 +165,8 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
         }
         // 校验手机号唯一
         String mobileNumber = userArchivesParam.getMobileNumber();
-        List<TBUserArchives> mobileNumberCheckList = this.list(new QueryWrapper<TBUserArchives>().lambda().eq(TBUserArchives::getMobileNumber, mobileNumber));
+        List<TBUserArchives> mobileNumberCheckList = this.list(
+                new QueryWrapper<TBUserArchives>().lambda().eq(TBUserArchives::getMobileNumber, mobileNumber));
         if (mobileNumberCheckList.size() > 1) {
             throw ExceptionResultEnum.ERROR.exception("系统中存在多个相同的手机号异常[" + mobileNumber + "]");
         } else if (mobileNumberCheckList.size() == 1) {
@@ -208,7 +224,8 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
             tbUserArchives.setCode(code);
             this.save(tbUserArchives);
             id = tbUserArchives.getId();
-            List<SysUser> userList = sysUserService.list(new QueryWrapper<SysUser>().lambda().eq(SysUser::getMobileNumber, mobileNumber));
+            List<SysUser> userList = sysUserService.list(
+                    new QueryWrapper<SysUser>().lambda().eq(SysUser::getMobileNumber, mobileNumber));
             if (CollectionUtils.isNotEmpty(userList)) {
                 if (userList.size() > 1) {
                     throw ExceptionResultEnum.ERROR.exception("用户表数据异常: 存在多个手机号相同的用户[" + mobileNumber + "]");
@@ -221,7 +238,8 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
             if (Objects.isNull(old)) {
                 throw ExceptionResultEnum.ERROR.exception("用户不存在");
             }
-            List<SysUser> userList = sysUserService.list(new QueryWrapper<SysUser>().lambda().eq(SysUser::getMobileNumber, old.getMobileNumber()));
+            List<SysUser> userList = sysUserService.list(
+                    new QueryWrapper<SysUser>().lambda().eq(SysUser::getMobileNumber, old.getMobileNumber()));
             if (CollectionUtils.isNotEmpty(userList)) {
                 if (userList.size() > 1) {
                     throw ExceptionResultEnum.ERROR.exception("用户表数据异常: 存在多个手机号相同的用户[" + mobileNumber + "]");
@@ -234,7 +252,8 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
         }
 
         // 档案详细表编辑 (先根据档案id删除再新增)
-        tbUserArchivesSupplierService.remove(new QueryWrapper<TBUserArchivesSupplier>().lambda().eq(TBUserArchivesSupplier::getUserArchivesId, id));
+        tbUserArchivesSupplierService.remove(
+                new QueryWrapper<TBUserArchivesSupplier>().lambda().eq(TBUserArchivesSupplier::getUserArchivesId, id));
         TBUserArchivesSupplier tbUserArchivesSupplier = new TBUserArchivesSupplier();
         tbUserArchivesSupplier.setUserArchivesId(id);
         tbUserArchivesSupplier.setArchivesTime(archivesTime);
@@ -262,7 +281,8 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
     }
 
     @Override
-    public UserArchivesSubTotalResult findUserArchivesSubTotal(String city, Long supplierId, String archivesName, RoleTypeEnum roleType, Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay) {
+    public UserArchivesSubTotalResult findUserArchivesSubTotal(String city, Long supplierId, String archivesName,
+            RoleTypeEnum roleType, Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay, Boolean unUploadPic) {
         UserArchivesSubTotalResult result = new UserArchivesSubTotalResult();
         if (city != null && city.length() > 0) {
             city = SystemConstant.translateSpecificSign(city);
@@ -276,7 +296,9 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
             remainValidTime = SystemConstant.processMiniutePlus(Duration.ofDays(remainValidDay));
         }
         Long currentTime = System.currentTimeMillis();
-        List<UserArchivesResult> userArchivesResultList = this.baseMapper.findUserArchivesList(city, supplierId, archivesName, roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidTime, currentTime);
+        List<UserArchivesResult> userArchivesResultList = this.baseMapper.findUserArchivesList(city, supplierId,
+                archivesName, roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidTime,
+                currentTime, unUploadPic);
         if (CollectionUtils.isNotEmpty(userArchivesResultList)) {
             Integer totalCount = userArchivesResultList.size();
             List<UserArchivesResult> validList = userArchivesResultList.stream()
@@ -318,7 +340,8 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
     }
 
     @Override
-    public List<UserArchivesImportDto> findExportData(String city, Long supplierId, String archivesName, RoleTypeEnum roleType, Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay) {
+    public List<UserArchivesImportDto> findExportData(String city, Long supplierId, String archivesName, RoleTypeEnum roleType, Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd,
+            Integer remainValidDay, Boolean unUploadPic) {
         if (city != null && city.length() > 0) {
             city = SystemConstant.translateSpecificSign(city);
         }
@@ -329,24 +352,16 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
         if (remainValidDay != null && remainValidDay > 0) {
             remainValidTime = SystemConstant.processMiniutePlus(Duration.ofDays(remainValidDay));
         }
-        List<UserArchivesImportDto> userArchivesImportDtoList = this.baseMapper.findExportData(city, supplierId, archivesName, roleType, authenticationStatus,
-                archivesTimeStart, archivesTimeEnd, remainValidTime, System.currentTimeMillis());
-
-        List<Long> effectEngineerIdList = sysUserService.findUserListByRoleType(RoleTypeEnum.EFFECT_ENGINEER)
-                .stream()
-                .map(SysUserBriefResult::getId)
-                .distinct()
-                .collect(Collectors.toList());
+        List<UserArchivesImportDto> userArchivesImportDtoList = this.baseMapper.findExportData(city, supplierId,
+                archivesName, roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidTime,
+                System.currentTimeMillis(), unUploadPic);
+
+        List<Long> effectEngineerIdList = sysUserService.findUserListByRoleType(RoleTypeEnum.EFFECT_ENGINEER).stream()
+                .map(SysUserBriefResult::getId).distinct().collect(Collectors.toList());
         List<Long> regionCoordinatorIdList = sysUserService.findUserListByRoleType(RoleTypeEnum.REGION_COORDINATOR)
-                .stream()
-                .map(SysUserBriefResult::getId)
-                .distinct()
-                .collect(Collectors.toList());
+                .stream().map(SysUserBriefResult::getId).distinct().collect(Collectors.toList());
         List<Long> assistantEngineerIdList = sysUserService.findUserListByRoleType(RoleTypeEnum.ASSISTANT_ENGINEER)
-                .stream()
-                .map(SysUserBriefResult::getId)
-                .distinct()
-                .collect(Collectors.toList());
+                .stream().map(SysUserBriefResult::getId).distinct().collect(Collectors.toList());
 
         for (UserArchivesImportDto userArchivesImportDto : userArchivesImportDtoList) {
             Long userId = userArchivesImportDto.getUserId();
@@ -415,8 +430,7 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
                     }
                 } else {
                     // 包含区域协调人判断该区域协调人涉及的所有派单均完成
-                    if (tbCrmService.list(new QueryWrapper<TBCrm>().lambda()
-                            .eq(TBCrm::getRegionCoordinatorId, userId)
+                    if (tbCrmService.list(new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getRegionCoordinatorId, userId)
                             .ne(TBCrm::getStatus, CrmStatusEnum.FINISH)).size() > 0) {
                         throw ExceptionResultEnum.ERROR.exception(String.format("区域协调人[%s]有未完成的派单,不能作废", userArchivesResult.getName()));
                     }
@@ -436,9 +450,8 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
         }
         String mobileNumber = sysUser.getMobileNumber();
 
-        List<TBUserArchives> tbUserArchivesList = this.list(new QueryWrapper<TBUserArchives>().lambda()
-                .eq(TBUserArchives::getMobileNumber, mobileNumber)
-                .eq(TBUserArchives::getEnable, true));
+        List<TBUserArchives> tbUserArchivesList = this.list(
+                new QueryWrapper<TBUserArchives>().lambda().eq(TBUserArchives::getMobileNumber, mobileNumber).eq(TBUserArchives::getEnable, true));
         if (CollectionUtils.isEmpty(tbUserArchivesList)) {
             throw ExceptionResultEnum.ERROR.exception("不存在档案");
         }
@@ -472,8 +485,8 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
         if (CollectionUtils.isNotEmpty(list)) {
             Long currentTime = System.currentTimeMillis();
             list = list.stream()
-                    .filter(e -> e.getAuthenticationValidTime() != null && e.getAuthenticationValidTime() >= currentTime && UserArchivesStatusEnum.FREE.equals(e.getArchivesStatus()))
-                    .peek(e -> e.setRemainCount(1))
+                    .filter(e -> e.getAuthenticationValidTime() != null && e.getAuthenticationValidTime() >= currentTime
+                            && UserArchivesStatusEnum.FREE.equals(e.getArchivesStatus())).peek(e -> e.setRemainCount(1))
                     .collect(Collectors.toList());
 
             List<Long> idList = list.stream().map(ArchivesSourceResult::getUserId).collect(Collectors.toList());
@@ -496,19 +509,18 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
             throw ExceptionResultEnum.ERROR.exception("服务单元不存在");
         }
         int rate = tbService.getRegionProjectCount() / tbService.getRegionPeopleCount();
-        List<TBCrm> tbCrmList = tbCrmService.list(new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getServiceId, serviceUnitId));
+        List<TBCrm> tbCrmList = tbCrmService.list(
+                new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getServiceId, serviceUnitId));
 
         Long currentTime = System.currentTimeMillis();
         List<ArchivesSourceResult> list = this.baseMapper.findArchivesSourceByType(RoleTypeEnum.REGION_COORDINATOR);
         if (CollectionUtils.isNotEmpty(list)) {
-            list = list.stream()
-                    .filter(e -> e.getAuthenticationValidTime() != null && e.getAuthenticationValidTime() >= currentTime)
-                    .peek(e -> {
-                        Long userId = e.getUserId();
-                        int count = Math.toIntExact(tbCrmList.stream().filter(c -> userId.equals(c.getRegionCoordinatorId())).count());
-                        e.setRemainCount(rate - count);
-                    })
-                    .collect(Collectors.toList());
+            list = list.stream().filter(e -> e.getAuthenticationValidTime() != null && e.getAuthenticationValidTime() >= currentTime).peek(e -> {
+                Long userId = e.getUserId();
+                int count = Math.toIntExact(
+                        tbCrmList.stream().filter(c -> userId.equals(c.getRegionCoordinatorId())).count());
+                e.setRemainCount(rate - count);
+            }).collect(Collectors.toList());
 
             if (verifyRate) {
                 // 只有自动调配才启用服务单元区域配比

+ 17 - 6
sop-business/src/main/java/com/qmth/sop/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -33,8 +33,6 @@ import java.io.InputStream;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -262,7 +260,15 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     sysCustom.setArea(e.getArea());
                     sysCustom.setCity(e.getCity());
                     sysCustom.setCode(e.getCode());
-                    ProductTypeEnum type = ProductTypeEnum.OFFICE.getTitle().equals(e.getType()) ? ProductTypeEnum.OFFICE : ProductTypeEnum.CLOUD_MARK;
+                    ProductTypeEnum type = null;
+                    String typeStr = e.getType();
+                    if (ProductTypeEnum.OFFICE.getTitle().equals(typeStr)){
+                        type = ProductTypeEnum.OFFICE;
+                    } else if (ProductTypeEnum.CLOUD_MARK.getTitle().equals(typeStr)){
+                        type = ProductTypeEnum.CLOUD_MARK;
+                    } else {
+                        throw ExceptionResultEnum.ERROR.exception("客户类型只能是" + ProductTypeEnum.OFFICE.getTitle() + "或" + ProductTypeEnum.CLOUD_MARK.getTitle());
+                    }
                     sysCustom.setType(type);
                     sysCustom.setProvince(e.getProvince());
                     sysCustom.setPeoperDay(e.getPeoperDay());
@@ -271,10 +277,12 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                         throw ExceptionResultEnum.ERROR.exception("客户经理不存在!");
                     }
                     SysLevel sysLevel = sysLevelService.getOne(new QueryWrapper<SysLevel>().lambda().eq(SysLevel::getLevel, e.getLevel()).eq(SysLevel::getType, type));
-                    if (Objects.isNull(sysLevel)) {
+                    if (Objects.isNull(sysLevel) && ProductTypeEnum.CLOUD_MARK.equals(sysCustom.getType())) {
                         throw ExceptionResultEnum.ERROR.exception("服务档位不存在!");
                     }
-                    sysCustom.setLevelId(sysLevel.getId());
+                    if (Objects.nonNull(sysLevel)){
+                        sysCustom.setLevelId(sysLevel.getId());
+                    }
                     sysCustom.setSync(false);
                     sysCustom.setEnable(true);
                     sysCustom.setCreateId(((SysUser) map.get("account")).getId());
@@ -540,7 +548,10 @@ public class TaskLogicServiceImpl implements TaskLogicService {
             Long archivesTimeStart = query.getArchivesTimeStart();
             Long archivesTimeEnd = query.getArchivesTimeEnd();
             Integer remainValidDay = query.getRemainValidDay();
-            List<UserArchivesImportDto> archivesImportDtoList = tbUserArchivesService.findExportData(city, supplierId, archivesName, roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidDay);
+            Boolean unUploadPic = query.getUnUploadPic();
+            List<UserArchivesImportDto> archivesImportDtoList = tbUserArchivesService.findExportData(city, supplierId,
+                    archivesName, roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidDay,
+                    unUploadPic);
             //数据读取逻辑end
             EasyExcel.write(fileTemp, UserArchivesImportDto.class).sheet("人员档案导出").doWrite(archivesImportDtoList);
 

+ 30 - 0
sop-business/src/main/resources/mapper/TBUserArchivesMapper.xml

@@ -73,6 +73,16 @@
                             su.id = sur.user_id
                                 AND sr.type = #{roleType})
             </if>
+            <if test="unUploadPic != null">
+                <choose>
+                    <when test="unUploadPic">
+                        AND tbua.base_photo_path IS NOT NULL
+                    </when>
+                    <otherwise>
+                        AND tbua.base_photo_path IS NULL
+                    </otherwise>
+                </choose>
+            </if>
         </where>
         ORDER BY tbua.update_time DESC,tbua.code DESC
     </select>
@@ -154,6 +164,16 @@
                 su.id = sur.user_id
                 AND sr.type = #{roleType})
             </if>
+            <if test="unUploadPic != null">
+                <choose>
+                    <when test="unUploadPic">
+                        AND tbua.base_photo_path IS NOT NULL
+                    </when>
+                    <otherwise>
+                        AND tbua.base_photo_path IS NULL
+                    </otherwise>
+                </choose>
+            </if>
         </where>
         ORDER BY tbua.update_time DESC,tbua.code DESC
     </select>
@@ -346,6 +366,16 @@
                 su.id = sur.user_id
                 AND sr.type = #{roleType})
             </if>
+            <if test="unUploadPic != null">
+                <choose>
+                    <when test="unUploadPic">
+                        AND tbua.base_photo_path IS NOT NULL
+                    </when>
+                    <otherwise>
+                        AND tbua.base_photo_path IS NULL
+                    </otherwise>
+                </choose>
+            </if>
         </where>
     </select>
     <select id="findTempEmp" resultType="java.util.Map">