Quellcode durchsuchen

fix. 考勤打卡特殊情况更改

caozixuan vor 9 Monaten
Ursprung
Commit
6940c3b305

+ 11 - 2
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDingServiceImpl.java

@@ -151,6 +151,8 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
             dingQueryWrapper.lambda().eq(TBDing::getServiceId, serviceId).eq(TBDing::getUserId, userId).orderByAsc(TBDing::getId);
             if (SystemConstant.strNotNull(sopNo)) {
                 dingQueryWrapper.lambda().eq(TBDing::getSopNo, sopNo);
+            } else {
+                dingQueryWrapper.lambda().isNull(TBDing::getSopNo);
             }
 
             List<TBDing> tbDingList = this.list(dingQueryWrapper);
@@ -406,8 +408,15 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
             List<TBDing> unFinishDingList = otherSopDingList.stream()
                     .filter(e -> !SystemConstant.longNotNull(e.getSignInTime()) || !SystemConstant.longNotNull(e.getSignOutTime())).collect(Collectors.toList());
             if (CollectionUtils.isNotEmpty(unFinishDingList)) {
-                String unFinishDingError = String.format("请先完成sopNo为[%s]的打卡",
-                        unFinishDingList.stream().map(TBDing::getSopNo).collect(Collectors.joining(",")));
+                String unFinishDingError = "";
+                if (isCoordinator) {
+                    unFinishDingError = String.format("请先完成服务单元为[%s]的打卡",
+                            tbServiceService.listByIds(unFinishDingList.stream().map(TBDing::getServiceId).distinct().collect(Collectors.toList()))
+                                    .stream().map(TBService::getName).collect(Collectors.joining(",")));
+                } else {
+                    unFinishDingError = String.format("请先完成sopNo为[%s]的打卡",
+                            unFinishDingList.stream().map(TBDing::getSopNo).collect(Collectors.joining(",")));
+                }
                 throw ExceptionResultEnum.ERROR.exception(unFinishDingError);
             }
         }

+ 1 - 0
sop-business/src/main/resources/mapper/TBCrmMapper.xml

@@ -465,6 +465,7 @@
         LEFT JOIN
         t_b_crm tbc ON tbuaa.crm_no = tbc.crm_no
         <where>
+            AND tbc.status != 'UN_PUBLISH'
             <if test="userId != null">
                 AND tbuaa.user_id = #{userId}
             </if>