ソースを参照

add:考勤打卡

caozixuan 1 年間 前
コミット
8bd897211d

+ 13 - 10
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBUserArchivesAllocationServiceImpl.java

@@ -228,16 +228,19 @@ public class TBUserArchivesAllocationServiceImpl extends ServiceImpl<TBUserArchi
         if (regionCoordinatorId != null && regionCoordinatorId > 0) {
 
             UserArchivesResult userArchivesResult = tbUserArchivesService.findUserArchivesByArchivesIdORUserId(null, regionCoordinatorId);
-            CrmArchivesAllocationResult region = new CrmArchivesAllocationResult();
-            region.setType(RoleTypeEnum.REGION_COORDINATOR);
-            region.setArchivesId(userArchivesResult.getUserArchivesId());
-            region.setArchiverName(userArchivesResult.getName());
-            region.setSupplierId(userArchivesResult.getSupplierId());
-            region.setSupplierName(userArchivesResult.getSupplierName());
-            region.setArchivesProvince(userArchivesResult.getProvince());
-            region.setArchivesCity(userArchivesResult.getCity());
-            region.setUserId(userArchivesResult.getUserId());
-            list.add(region);
+            if (Objects.nonNull(userArchivesResult)){
+                // 为空是大区经理兼任的情况 不处理
+                CrmArchivesAllocationResult region = new CrmArchivesAllocationResult();
+                region.setType(RoleTypeEnum.REGION_COORDINATOR);
+                region.setArchivesId(userArchivesResult.getUserArchivesId());
+                region.setArchiverName(userArchivesResult.getName());
+                region.setSupplierId(userArchivesResult.getSupplierId());
+                region.setSupplierName(userArchivesResult.getSupplierName());
+                region.setArchivesProvince(userArchivesResult.getProvince());
+                region.setArchivesCity(userArchivesResult.getCity());
+                region.setUserId(userArchivesResult.getUserId());
+                list.add(region);
+            }
         }
         return list.stream().peek(e -> e.setRoleResult(sysRoleService.findRoleInfoByArchivesType(e.getType()))).collect(Collectors.toList());
     }

+ 8 - 7
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBUserArchivesServiceImpl.java

@@ -422,14 +422,15 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
 
     @Override
     public UserArchivesResult findUserArchivesByArchivesIdORUserId(Long archivesId, Long userId) {
-        List<UserArchivesResult> result = this.baseMapper.findUserArchivesById(archivesId, userId);
-        if (CollectionUtils.isEmpty(result)) {
-            throw ExceptionResultEnum.ERROR.exception("档案信息不存在");
-        }
-        if (result.size() > 1) {
-            throw ExceptionResultEnum.ERROR.exception("档案数据异常");
+        UserArchivesResult result = null;
+        List<UserArchivesResult> userArchivesResultList = this.baseMapper.findUserArchivesById(archivesId, userId);
+        if (CollectionUtils.isNotEmpty(userArchivesResultList)) {
+            if (userArchivesResultList.size() > 1) {
+                throw ExceptionResultEnum.ERROR.exception("档案数据异常");
+            }
+            result = userArchivesResultList.get(0);
         }
-        return result.get(0);
+        return result;
     }
 
     @Override