Parcourir la source

Merge remote-tracking branch 'origin/dev_1.1.0' into dev_1.1.0

caozixuan il y a 1 an
Parent
commit
4e04ba2b4c

+ 11 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/params/SopInfoListParam.java

@@ -79,6 +79,17 @@ public class SopInfoListParam extends TBSopInfo implements Serializable {
     @ApiModelProperty(value = "sop单号")
     String sopNo;
 
+    @ApiModelProperty(value = "打卡在时限内")
+    Boolean dingPlan;
+
+    public Boolean getDingPlan() {
+        return dingPlan;
+    }
+
+    public void setDingPlan(Boolean dingPlan) {
+        this.dingPlan = dingPlan;
+    }
+
     public FormWidgetMetadataOperation getFormWidgetMetadataOperation() {
         return formWidgetMetadataOperation;
     }

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/mapper/TBSopInfoMapper.java

@@ -98,7 +98,7 @@ public interface TBSopInfoMapper extends BaseMapper<TBSopInfo> {
             @Param("fieldValue") String fieldValue, @Param("dpr") DataPermissionDto dpr,
             @Param("fieldOrder") String fieldOrder, @Param("leadId") Long leadId, @Param("crmUserId") Long crmUserId,
             @Param("customName") String customName, @Param("taskKey") String taskKey, @Param("crmName") String crmName,
-            @Param("sopNo") String sopNo);
+            @Param("sopNo") String sopNo, @Param("dingPlan") String dingPlan);
 
     /**
      * 根据crmNo查询在途的sop信息

+ 2 - 3
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -851,11 +851,10 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 Objects.nonNull(sopInfoListParam.getType()) ? sopInfoListParam.getType().name() : null,
                 sopInfoListParam.getServiceId(), tableName, fieldName, fieldValue, dpr, fieldOrder,
                 sopInfoListParam.getLeadId(), sopInfoListParam.getCrmUserId(), sopInfoListParam.getCustomName(),
-                sopInfoListParam.getTaskKey(), sopInfoListParam.getCrmName(), sopInfoListParam.getSopNo());
+                sopInfoListParam.getTaskKey(), sopInfoListParam.getCrmName(), sopInfoListParam.getSopNo(),
+                Objects.nonNull(sopInfoListParam.getDingPlan()) ? sopInfoListParam.getDingPlan().toString() : null);
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         for (Map m : list.getRecords()) {
-            String sopNo = (String) m.get("sopNo");
-            m.put("dingException", tbDingService.checkDingExceptionBySopNo(sopNo));
             String engineerUsersId = (String) m.get("engineer_users_id");
             List<Long> userIdList = new ArrayList<>();
             Map<Long, String> map = new HashMap<>();

+ 11 - 0
sop-business/src/main/resources/mapper/TBSopInfoMapper.xml

@@ -78,6 +78,7 @@
                art.TASK_DEF_KEY_ as taskDefKey,
                tbcd.id as crmDetailId,
                tbcd.course_name as courseName,
+               if((select count(1) from t_b_ding tbd where tbd.sop_no = tbsi.sop_no and tbd.ding_exception = 1) > 0,true,false) as dingException,
                (select group_concat(cast(art.ID_ as char)) from ACT_RU_TASK art where art.PROC_INST_ID_ = tffa.flow_id) as taskId
                 <if test="fieldName != null and fieldName != ''">
                     ,${fieldName}
@@ -123,6 +124,16 @@
             <if test="sopNo != null and sopNo != ''">
                 and tbsi.sop_no like concat('%', #{sopNo} , '%')
             </if>
+            <if test="dingPlan != null and dingPlan != ''">
+                <choose>
+                    <when test="dingPlan == 'false'">
+                        and (select count(1) from t_b_ding tbd where tbd.sop_no = tbsi.sop_no and tbd.ding_exception = 1) > 0
+                    </when>
+                    <otherwise>
+                        and (select count(1) from t_b_ding tbd where tbd.sop_no = tbsi.sop_no and tbd.ding_exception = 0) <![CDATA[ >= ]]> 0
+                    </otherwise>
+                </choose>
+            </if>
             <if test="taskKey != null and taskKey != ''">
                 <choose>
                     <when test="taskKey == '已完结'">