Prechádzať zdrojové kódy

修改履职逻辑,添加是否必须扫描和必须检查逻辑

gaoxiong 2 rokov pred
rodič
commit
cec7b0a5a5

+ 32 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/service/ResumptionServiceImpl.java

@@ -268,15 +268,28 @@ public class ResumptionServiceImpl implements ResumptionService {
             List<ResumptionPlanVo> supplementItems = new ArrayList<>();
 
             for (ResumptionPlanVo resumptionPlanVo : resumptionPlanVos) {
+
                 if (ObjectUtil.isNotNull(resumptionPlanVo.getCheckId()) && ObjectUtil.isNull(resumptionPlanVo.getAreaId())) {
-                    Map<Long, List<ResumptionNFCVo>> areaGroup = orgNFCs.stream()
+
+                    /*Map<Long, List<ResumptionNFCVo>> areaGroup = orgNFCs.stream()
                             .filter(n -> ObjectUtil.equal(n.getCheckId(), resumptionPlanVo.getCheckId()))
                             .collect(Collectors.groupingBy(n -> n.getAreaId()));
+                    */
+                    Map<Long,List<ResumptionNFCVo>> areaGroup = new HashMap<>();
+                    List<ResumptionNFCVo> vos = new ArrayList<>();
+                    for (ResumptionNFCVo nfcVo : orgNFCs) {
+                        if(nfcVo.getCheckId().equals(resumptionPlanVo.getCheckId())){
+                            nfcVo.setPointScan(resumptionPlanVo.getPointScan());
+                            vos.add(nfcVo);
+                        }
+                    }
+                    areaGroup= vos.stream().collect(Collectors.groupingBy(n -> n.getAreaId()));
+
+
                     if (CollectionUtils.isEmpty(areaGroup)) {
                         ResumptionPlanVo newVo = new ResumptionPlanVo();
                         BeanUtils.copyProperties(resumptionPlanVo, newVo);
                         newVo.setAreaId(-1L);
-
                         supplementItems.add(newVo);
                     } else {
                         areaGroup.forEach((area, nfcs) -> {
@@ -288,12 +301,24 @@ public class ResumptionServiceImpl implements ResumptionService {
                         });
                     }
                 } else {
+                    for (ResumptionNFCVo nfcVo : orgNFCs) {
+                        if(nfcVo.getAreaId().equals(resumptionPlanVo.getAreaId())){
+                            nfcVo.setPointScan(resumptionPlanVo.getPointScan());
+                        }
+                    }
                     //如果是绑定到区域的,直接使用
                     supplementItems.add(resumptionPlanVo);
                 }
             }
 
             resumptionPlanVos = supplementItems;
+        }else{
+            //反馈给前端,只需要保存后的数据
+            if(resumption.getStatus() == 3){
+                //如果已经提交
+                orgNFCs = orgNFCs.stream().filter(n -> n.getStatus() == 1).collect(Collectors.toList());
+            }
+
         }
 
         Integer yesPointNum = 0;
@@ -302,6 +327,8 @@ public class ResumptionServiceImpl implements ResumptionService {
         Map<Long, Map<String, Integer>> itComMap = new HashMap<>();
         Map<Long, AreaResumptionVo> map = new HashMap<>();
         for (ResumptionPlanVo vo : resumptionPlanVos) {
+            //是否必捡,1必须检查,0非必须检查
+            Integer required = vo.getRequired();
             if (vo.getDataStatus() == 1) {
                 noPointNum++;
             } else {
@@ -340,6 +367,7 @@ public class ResumptionServiceImpl implements ResumptionService {
             pointVo.setCheckId(vo.getCheckId());
             pointVo.setPointId(vo.getPointId());
             pointVo.setResRemark(vo.getResRemark());
+            pointVo.setRequired(vo.getRequired());
             if (vo.getResValue() == null) {
                 pointVo.setResValue(0);
             } else {
@@ -352,7 +380,7 @@ public class ResumptionServiceImpl implements ResumptionService {
             if (itCom == null) {
                 itCom = new HashMap<>();
                 itCom.put("total", 1);
-                if (pointVo.getDataStatus() == 1) {
+                if (pointVo.getDataStatus() == 1 ) {
                     itCom.put("yes", 0);
                 } else {
                     itCom.put("yes", 1);
@@ -394,7 +422,7 @@ public class ResumptionServiceImpl implements ResumptionService {
             Long areaId = entry.getKey();
             //获取每个区域下的nfc
             List<ResumptionNFCVo> resumptionNFCVos = orgNFCs.stream().filter(n -> ObjectUtil.equal(n.getAreaId(), areaId)).collect(Collectors.toList());
-            //resumptionMapper.selectResumptionNFC(resumption.getId(), areaId, resumption.getOrgId());
+            /*resumptionMapper.selectResumptionNFC(resumption.getId(), areaId, resumption.getOrgId());*/
 
             for (ResumptionNFCVo resumptionNFCVo : resumptionNFCVos) {
                 Integer status = resumptionNFCVo.getStatus();

+ 5 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/vo/ResumptionNFCVo.java

@@ -66,4 +66,9 @@ public class ResumptionNFCVo {
      * 扫描或上传图片的人
      */
     private Long submitBy;
+
+    /**
+     * 是否扫描NFC 1扫描,0不扫描
+     */
+    private  Integer pointScan;
 }

+ 5 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/vo/ResumptionPointVo.java

@@ -46,6 +46,11 @@ public class ResumptionPointVo {
      * 1未处理,2已处理
      */
     private Integer dataStatus;
+
+    /**
+     * 是否检查 1检查,0不检查
+     */
+    private Integer required;
     /**
      * 图片
      */