wwh 1 سال پیش
والد
کامیت
c68c52b7ec
1فایلهای تغییر یافته به همراه57 افزوده شده و 17 حذف شده
  1. 57 17
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPcrServiceImpl.java

+ 57 - 17
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPcrServiceImpl.java

@@ -410,35 +410,66 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
                         billPcr.getVistitType(),billPcr.getPhone(),billPcr.getDepartureName(),billPcr.getDepartureId());
                 System.out.println("这里是pcr通过的下一个流程id:" + nextId);
                 if (nextId == 0) {
-                    int index = allLocationId.indexOf(baseLocation.getId());
-                    StringBuilder status = new StringBuilder(baseProcess.getAllLocationId());
-                    status.setCharAt(index, '1');
-                    status.setCharAt(index + 2, '1');
-                    baseProcess.setAllLocationStatus(status.toString());
+                    if (StringUtils.isBlank(split[1])) {
+                        baseProcess.setProcessType(1);
+                        if (allLocationId.length() > 5) {
+                            baseProcess.setAllLocationStatus("2,2,2,2,2");
+                        } else {
+                            baseProcess.setAllLocationStatus("2,2,2");
+                        }
+                    } else {
+                        String[] strings = allLocationId.split(",");
+                        Integer index = 0;
+                        for (int i = 0; i < strings.length; i++) {
+                            if (baseLocation.getId().equals(strings[i])) {
+                                index=i;
+                            }
+                        }
+                        QueryWrapper<BaseLocation> queryWrapper = new QueryWrapper();
+                        queryWrapper.eq("id", strings[index + 2]);
+                        BaseLocation location = locationMapper.selectOne(queryWrapper);
+                        FlowUtil flowUtil = new FlowUtil();
+                        flowUtil.getEntity(Integer.parseInt(split[1]),billPcr.getVistitType(),billPcr.getDestName()
+                                ,billPcr.getDestId(), billPcr.getAdmissionUserId(),billPcr.getAdmissionUserName(),billPcr.getPhone(),
+                                billPcr.getVistitDate(),location.getId(),location.getLocationName(),Integer.parseInt(farmId)
+                                ,baseProcess.getId(),billPcr.getDepartureName(),billPcr.getDepartureId());
+                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId+","+split[1]);
+                        int index1 = allLocationId.indexOf(baseLocation.getId());
+                        StringBuilder status = new StringBuilder(baseProcess.getAllLocationId());
+                        status.setCharAt(index1, '1');
+                        status.setCharAt(index1 + 2, '1');
+                        baseProcess.setAllLocationStatus(status.toString());
+                    }
                 } else if (nextId == 1) {
                     //新增采样
                     BillSampling billSampling = (BillSampling) newObject;
                     samplingMapper.insert(billSampling);
+                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                 }else if (nextId == 2) {
                     //新增pcr
                     BillPcr billClean = (BillPcr) newObject;
                     pcrMapper.insert(billClean);
+                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                 }else if (nextId == 3) {
                     //新增洗澡
                     BillClean billClean = (BillClean) newObject;
                     cleanMapper.insert(billClean);
+                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                 }else if (nextId == 4) {
                     //新增隔离
                     BillIsolate pcr = (BillIsolate) newObject;
                     isolateMapper.insert(pcr);
+                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                 }else if (nextId == 5) {
                     BillDry billClean = (BillDry) newObject;
                     dryMapper.insert(billClean);
+                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                     //新增烘干
                 }else if (nextId == 6) {
                     //新增洗澡前拍照
                     BillCleanBefore before = (BillCleanBefore) newObject;
                     beforeMapper.insert(before);
+                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                 }
 //                //通过生成门禁白名单
 //                QueryWrapper<DeviceList> deviceListQueryWrapper = new QueryWrapper<>();
@@ -512,7 +543,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
                 String substring = status.substring(0, status.length() - 1);
 
                 baseProcess.setCurrentStatus(substring + "1," + 0);
-                baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+
                 processMapper.updateById(baseProcess);
                 pcrMapper.updateById(billPcr);
                 return new Result(10000, "修改成功!", true);
@@ -540,19 +571,28 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
     }
 
     public static void main(String[] args) {
-        String s = "0,1,0,2,0,3,0";
-        StringBuilder sb = new StringBuilder(s);
-        Integer a = s.length() - 3;
-        sb.setCharAt(a,'0');
-        System.out.println(sb.toString());
-
-//        String s1 = "1,1,1,0,0,0";
-//        System.out.println(s.indexOf("2"));
-//        StringBuilder sb = new StringBuilder(s1);
-//        sb.setCharAt(6, '1');
-//        sb.setCharAt(8, '1');
+//        String s = "0,1,0";
+//        String[] split = s.split(",");
+//        Integer index = 0;
+//        for (int i = 0; i < split.length; i++) {
+//            if ("1".equals(split[i])) {
+//                index = i;
+//            }
+//        }
+//        System.out.println(index);
+//        System.out.println(split[index]);
+//        StringBuilder sb = new StringBuilder(s);
+//        Integer a = s.length() - 3;
+//        sb.setCharAt(a,'0');
 //        System.out.println(sb.toString());
 
+        String s1 = "2,0,0";
+        System.out.println(s1.indexOf("2"));
+        StringBuilder sb = new StringBuilder(s1);
+        sb.setCharAt(2, '1');
+        sb.setCharAt(4, '1');
+        System.out.println(sb.toString());
+
     }
 
     private void xiugaiPro(BaseProcess baseProcess, BillPcr billPcr) {