wwh 1 kuukausi sitten
vanhempi
commit
ee7e8da068
22 muutettua tiedostoa jossa 874 lisäystä ja 210 poistoa
  1. 8 1
      huimv-receive/src/main/java/com/huimv/receive/common/utils/FlowUtil.java
  2. 2 2
      huimv-receive/src/main/java/com/huimv/receive/controller/BaseProcessController.java
  3. 15 0
      huimv-receive/src/main/java/com/huimv/receive/controller/BillPcrController.java
  4. 2 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillClean.java
  5. 2 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillCleanBefore.java
  6. 1 1
      huimv-receive/src/main/java/com/huimv/receive/entity/BillDry.java
  7. 2 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillGoodsInventory.java
  8. 2 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillIsolate.java
  9. 2 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillPcr.java
  10. 1 1
      huimv-receive/src/main/java/com/huimv/receive/entity/BillSampling.java
  11. 4 0
      huimv-receive/src/main/java/com/huimv/receive/mapper/BillCleanMapper.java
  12. 1 1
      huimv-receive/src/main/java/com/huimv/receive/service/IBaseProcessService.java
  13. 5 0
      huimv-receive/src/main/java/com/huimv/receive/service/IBillPcrService.java
  14. 27 2
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BaseProcessServiceImpl.java
  15. 7 5
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanBeforeServiceImpl.java
  16. 76 24
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanServiceImpl.java
  17. 8 4
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillGoodsInventoryServiceImpl.java
  18. 575 13
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPcrServiceImpl.java
  19. 71 151
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPersonnelAdmissionServiceImpl.java
  20. 5 3
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillSamplingServiceImpl.java
  21. 4 2
      huimv-receive/src/main/java/com/huimv/receive/timer/SafeTimer.java
  22. 54 0
      huimv-receive/src/main/resources/com/huimv/receive/mapper/BillCleanMapper.xml

+ 8 - 1
huimv-receive/src/main/java/com/huimv/receive/common/utils/FlowUtil.java

@@ -10,7 +10,7 @@ public class FlowUtil {
     public Object getEntity(Integer nextFlowId, Integer vistitType, String destName, Integer destId, Integer userId,
                             String userName, String phone, LocalDateTime vistitDate, Integer locationId,
                             String locationName, Integer farmId, Integer processId, String departureName,
-                            Integer departureId,Integer midId,String midName) {
+                            Integer departureId,Integer midId,String midName,String farmName) {
         if (nextFlowId == 1) {
             BillSampling billSampling = new BillSampling();
             billSampling.setVistitType(vistitType);
@@ -29,6 +29,7 @@ public class FlowUtil {
             billSampling.setDepartureName(departureName);
             billSampling.setMidId(midId);
             billSampling.setMidName(midName);
+            billSampling.setFarmName(farmName);
             return billSampling;
         } else if (nextFlowId == 2) {
             BillPcr billPcr = new BillPcr();
@@ -48,6 +49,7 @@ public class FlowUtil {
             billPcr.setDepartureName(departureName);
             billPcr.setMidId(midId);
             billPcr.setMidName(midName);
+            billPcr.setFarmName(farmName);
             return billPcr;
         } else if (nextFlowId == 3) {
             BillClean billClean = new BillClean();
@@ -67,6 +69,7 @@ public class FlowUtil {
             billClean.setDepartureName(departureName);
             billClean.setMidId(midId);
             billClean.setMidName(midName);
+            billClean.setFarmName(farmName);
             return billClean;
         } else if (nextFlowId == 4) {
             BillIsolate billIsolate = new BillIsolate();
@@ -86,6 +89,7 @@ public class FlowUtil {
             billIsolate.setDepartureName(departureName);
             billIsolate.setMidId(midId);
             billIsolate.setMidName(midName);
+            billIsolate.setFarmName(farmName);
             return billIsolate;
         } else if (nextFlowId == 5) {
             BillDry billDry = new BillDry();
@@ -105,6 +109,7 @@ public class FlowUtil {
             billDry.setDepartureName(departureName);
             billDry.setMidId(midId);
             billDry.setMidName(midName);
+            billDry.setFarmName(farmName);
             return billDry;
         } else if (nextFlowId == 6) {
             BillCleanBefore billCleanBefore = new BillCleanBefore();
@@ -124,6 +129,7 @@ public class FlowUtil {
             billCleanBefore.setDepartureName(departureName);
             billCleanBefore.setMidId(midId);
             billCleanBefore.setMidName(midName);
+            billCleanBefore.setFarmName(farmName);
             return billCleanBefore;
         } else{
             BillGoodsInventory billCleanBefore = new BillGoodsInventory();
@@ -144,6 +150,7 @@ public class FlowUtil {
             billCleanBefore.setProcessId(processId);
             billCleanBefore.setMidId(midId);
             billCleanBefore.setMidName(midName);
+            billCleanBefore.setFarmName(farmName);
             return billCleanBefore;
         }
     }

+ 2 - 2
huimv-receive/src/main/java/com/huimv/receive/controller/BaseProcessController.java

@@ -37,8 +37,8 @@ public class BaseProcessController {
     }
 
     @PostMapping("/listAll")
-    public Result listAll(@RequestBody Map<String,String> map) {
-        return processService.listAll(map);
+    public Result listAll(HttpServletRequest httpServletRequest,@RequestBody Map<String,String> map) {
+        return processService.listAll(httpServletRequest,map);
     }
 
     @PostMapping("/edit")

+ 15 - 0
huimv-receive/src/main/java/com/huimv/receive/controller/BillPcrController.java

@@ -62,6 +62,21 @@ public class BillPcrController {
                           @RequestParam(value = "picture3",required = false) MultipartFile picture3) throws ParseException, IOException {
         return pcrService.edit(httpServletRequest, farmId,id,date,result,img1,img2,img3,picture1,picture2,picture3);
     }
+
+    @RequestMapping("/editBatch")
+    public Result editBatch(HttpServletRequest httpServletRequest,
+                          @RequestParam("farmId") String farmId,
+                          @RequestParam("ids") String ids,
+                          @RequestParam("date") String date,
+                          @RequestParam("result") String result,
+                          @RequestParam(value = "img1",required = false) MultipartFile img1,
+                          @RequestParam(value = "img2",required = false) MultipartFile img2,
+                          @RequestParam(value = "img3",required = false) MultipartFile img3,
+                          @RequestParam(value = "picture1",required = false) MultipartFile picture1,
+                          @RequestParam(value = "picture2",required = false) MultipartFile picture2,
+                          @RequestParam(value = "picture3",required = false) MultipartFile picture3) throws ParseException, IOException {
+        return pcrService.editBatch(httpServletRequest, farmId,ids,date,result,img1,img2,img3,picture1,picture2,picture3);
+    }
     @Autowired
     private IBillPcrService billPcrService;
 

+ 2 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/BillClean.java

@@ -133,4 +133,6 @@ public class BillClean implements Serializable {
     private Integer midId;
 
     private String midName;
+
+    private String farmName;
 }

+ 2 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/BillCleanBefore.java

@@ -144,4 +144,6 @@ public class BillCleanBefore implements Serializable {
     private Integer midId;
 
     private String midName;
+
+    private String farmName;
 }

+ 1 - 1
huimv-receive/src/main/java/com/huimv/receive/entity/BillDry.java

@@ -147,5 +147,5 @@ public class BillDry implements Serializable {
     private Integer midId;
 
     private String midName;
-
+    private String farmName;
 }

+ 2 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/BillGoodsInventory.java

@@ -134,4 +134,6 @@ public class BillGoodsInventory implements Serializable {
     private Integer midId;
 
     private String midName;
+
+    private String farmName;
 }

+ 2 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/BillIsolate.java

@@ -153,4 +153,6 @@ public class BillIsolate implements Serializable {
     private Integer midId;
 
     private String midName;
+
+    private String farmName;
 }

+ 2 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/BillPcr.java

@@ -154,4 +154,6 @@ public class BillPcr implements Serializable {
     private Integer midId;
 
     private String midName;
+
+    private String farmName;
 }

+ 1 - 1
huimv-receive/src/main/java/com/huimv/receive/entity/BillSampling.java

@@ -155,5 +155,5 @@ public class BillSampling implements Serializable {
     private Integer midId;
 
     private String midName;
-
+    private String farmName;
 }

+ 4 - 0
huimv-receive/src/main/java/com/huimv/receive/mapper/BillCleanMapper.java

@@ -29,6 +29,8 @@ public interface BillCleanMapper extends BaseMapper<BillClean> {
 
     Page<CleanAndDryVo2> CleanAndDry(Page<CleanAndDryVo2> page, String farmId, String type, String[] status, String[] locations);
 
+    Page<CleanAndDryVo2> CleanAndDryNo(Page<CleanAndDryVo2> page, String type, String[] status, String[] locations);
+
     Page<CleanAndDryVo2> CleanAndDry2(Page<CleanAndDryVo2> page, String farmId, String[] status);
 
     Page<CleanAndDryVo2> CleanList(Page<CleanAndDryVo2> page, String farmId, String[] status, String location);
@@ -37,5 +39,7 @@ public interface BillCleanMapper extends BaseMapper<BillClean> {
 
     Page<CleanDryGoodsVo> listCleanDryGoods(Page<CleanDryGoodsVo> page, String farmId, String type, String[] status, String[] locations);
 
+    Page<CleanDryGoodsVo> listCleanDryGoodsNo(Page<CleanDryGoodsVo> page, String type, String[] status, String[] locations);
+
     Page<CleanDryGoodsVo> listCleanDryGoods2(Page<CleanDryGoodsVo> page, String farmId, String type, String[] status, String[] locations);
 }

+ 1 - 1
huimv-receive/src/main/java/com/huimv/receive/service/IBaseProcessService.java

@@ -24,7 +24,7 @@ public interface IBaseProcessService extends IService<BaseProcess> {
     Result pageByLocationId(Map<String, String> map);
 
     //进程展示
-    Result listAll(Map<String, String> map);
+    Result listAll(HttpServletRequest httpServletRequest,Map<String, String> map);
 
     //进程终止
     Result edit(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);

+ 5 - 0
huimv-receive/src/main/java/com/huimv/receive/service/IBillPcrService.java

@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.text.ParseException;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -26,6 +27,10 @@ public interface IBillPcrService extends IService<BillPcr> {
 
     Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date, String result,
                 MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws ParseException, IOException;
+
+    //pcr批量修改
+    Result editBatch(HttpServletRequest httpServletRequest,String farmId, String ids, String date, String result,
+                     MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws ParseException, IOException;
     Result listPersonalPcr(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
     //后台总体概况

+ 27 - 2
huimv-receive/src/main/java/com/huimv/receive/service/impl/BaseProcessServiceImpl.java

@@ -48,6 +48,12 @@ public class BaseProcessServiceImpl extends ServiceImpl<BaseProcessMapper, BaseP
     private BillSamplingMapper samplingMapper;
     @Autowired
     private BillGoodsInventoryMapper goodsInventoryMapper;
+    @Autowired
+    private BillPersonnelAdmissionMapper admissionMapper;
+    @Autowired
+    private SysAccountMultilevelMapper accountMultilevelMapper;
+    @Autowired
+    private SysUserMapper userMapper;
     @Override
     public Result getOne(Map<String, String> map) {
         String id = map.get("processId");
@@ -87,7 +93,9 @@ public class BaseProcessServiceImpl extends ServiceImpl<BaseProcessMapper, BaseP
     }
 
     @Override
-    public Result listAll(Map<String, String> map) {
+    public Result listAll(HttpServletRequest httpServletRequest,Map<String, String> map) {
+        Integer id = TokenSign.getMemberIdByJwtToken(httpServletRequest);//账户id
+        SysAccountMultilevel sysAccountMultilevel = accountMultilevelMapper.selectById(id);
         String farmId = map.get("farmId");
         String type = map.get("type");//0 全部 1进行中 2 已完成
         String pageNum = map.get("pageNum");
@@ -107,7 +115,17 @@ public class BaseProcessServiceImpl extends ServiceImpl<BaseProcessMapper, BaseP
         queryWrapper.orderByDesc("a.sub_date");
         Page<ProcessVo> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
         QueryWrapper<BaseProcess> queryWrapper1 = new QueryWrapper<>();
-        queryWrapper1.eq("farm_id", farmId).eq("process_type", 0);
+        if (sysAccountMultilevel.getType() == 3) {
+            SysUser user = userMapper.selectById(sysAccountMultilevel.getUserId());
+            if (user.getIsAllFarm() == 1) {
+                queryWrapper1.eq("process_type", 0);
+            } else {
+                queryWrapper1.eq("farm_id", farmId).eq("process_type", 0);
+            }
+        } else {
+            queryWrapper1.eq("farm_id", farmId).eq("process_type", 0);
+        }
+
         return new Result(ResultCode.SUCCESS, baseProcessMapper.listAll(queryWrapper, page),baseProcessMapper.selectCount(queryWrapper1));
     }
 
@@ -131,6 +149,13 @@ public class BaseProcessServiceImpl extends ServiceImpl<BaseProcessMapper, BaseP
         String ss2=allLocationId.substring(0, a) + '4' + allLocationId.substring(a + 1);
         baseProcess.setAllLocationStatus(ss2);
 
+        //入场申请未审核,直接结束流程
+        if (currentFlowId.length() == 1 && "0".equals(currentFlowId)) {
+            BillPersonnelAdmission admission = admissionMapper.selectOne(new QueryWrapper<BillPersonnelAdmission>().eq("process_id", processId));
+            admission.setBillStatus(2);
+            admissionMapper.updateById(admission);
+        }
+
         String s = currentFlowId.substring(currentFlowId.length() - 1);
         if ("1".equals(s)) {
             BillSampling billSampling = samplingMapper.selectOne(new QueryWrapper<BillSampling>()

+ 7 - 5
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanBeforeServiceImpl.java

@@ -122,11 +122,12 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
     @Override
     public Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date, MultipartFile img) throws ParseException, IOException {
         String s = "";
-        if (uploadImage.getImageCom(img).equals("上传失败")) {
+        String imgCom = uploadImage.getImageCom(img);
+        if (imgCom.equals("上传失败")) {
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return new Result(10001, "图片1上传失败", false);
         }
-        s = uploadImage.uploadImg(img);
+        s = imgCom;
 
         DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
 
@@ -167,7 +168,7 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
                 cleanBefore.getAdmissionUserId(), cleanBefore.getVistitDate(), cleanBefore.getSubDate(),
                 cleanBefore.getProcessId(), Integer.parseInt(cleanBefore.getFarmId()), cleanBefore.getTestLocation(), cleanBefore.getTestLocationId(),
                 cleanBefore.getVistitType(), cleanBefore.getPhone(), cleanBefore.getDepartureName(), cleanBefore.getDepartureId()
-                ,cleanBefore.getMidId(),cleanBefore.getMidName());
+                ,cleanBefore.getMidId(),cleanBefore.getMidName(),cleanBefore.getFarmName());
         if (nextId == 0) {
             if (split.length == 1) {
                 baseProcess.setProcessType(1);
@@ -196,8 +197,8 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
                 FlowUtil flowUtil = new FlowUtil();
                 Object entity = flowUtil.getEntity(Integer.parseInt(split[1]), cleanBefore.getVistitType(), cleanBefore.getDestName()
                         , cleanBefore.getDestId(), cleanBefore.getAdmissionUserId(), cleanBefore.getAdmissionUserName(), cleanBefore.getPhone(),
-                        cleanBefore.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(farmId)
-                        , baseProcess.getId(), cleanBefore.getDepartureName(), cleanBefore.getDepartureId(),cleanBefore.getMidId(),cleanBefore.getMidName());
+                        cleanBefore.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(cleanBefore.getFarmId())
+                        , baseProcess.getId(), cleanBefore.getDepartureName(), cleanBefore.getDepartureId(),cleanBefore.getMidId(),cleanBefore.getMidName(),cleanBefore.getFarmName());
                 if (Integer.parseInt(split[1]) == 1) {
                     //新增采样
                     BillSampling billSampling = (BillSampling) entity;
@@ -221,6 +222,7 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
                         billClean.setFeedImgUrl(cleanBefore.getFeedImgUrl());
                         billClean.setRemark(cleanBefore.getRemark());
                     }
+
                     pcrMapper.insert(billClean);
                 } else if (Integer.parseInt(split[1]) == 3) {
                     //新增洗澡

+ 76 - 24
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanServiceImpl.java

@@ -102,6 +102,11 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 queryWrapper.eq("bill_status", 1);
             }
             QueryWrapper<BillClean> queryWrapper2 = new QueryWrapper<>();
+            if (baseLocation.getId() == 47) {
+            } else {
+                queryWrapper.eq("farm_id", farmId);
+                queryWrapper2.eq("farm_id", farmId);
+            }
             queryWrapper2.eq("vistit_type", type).orderByDesc("sub_date")
                     .eq("test_location_id", baseLocation.getId()).eq("bill_status", 0);
 
@@ -117,7 +122,11 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
             if ("0".equals(data)) {
                 String[] s = {TokenSign.getWorkIdByJwtToken(httpServletRequest)};
                 System.out.println("传入自定义sql的位置参数形式:" + s);
-                cleanDryGoodPage = cleanMapper.listCleanDryGoods(page, farmId, type, "0,1".split(","), s);
+                if (Integer.parseInt(TokenSign.getWorkIdByJwtToken(httpServletRequest)) == 47) {
+                    cleanDryGoodPage = cleanMapper.listCleanDryGoodsNo(page, type, "0,1".split(","), s);
+                } else {
+                    cleanDryGoodPage = cleanMapper.listCleanDryGoods(page, farmId, type, "0,1".split(","), s);
+                }
                 queryWrapper.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
                 queryWrapper2.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
                 queryWrapper3.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
@@ -127,7 +136,11 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 ArrayList<String> arrayList = new ArrayList<>();
                 arrayList.add("0");
                 String[] s = arrayList.toArray(new String[arrayList.size()]);
-                cleanDryGoodPage = cleanMapper.listCleanDryGoods(page, farmId, type, s, ids);
+                if (Integer.parseInt(TokenSign.getWorkIdByJwtToken(httpServletRequest)) == 47) {
+                    cleanDryGoodPage = cleanMapper.listCleanDryGoodsNo(page, type, s, ids);
+                } else {
+                    cleanDryGoodPage = cleanMapper.listCleanDryGoods(page, farmId, type, s, ids);
+                }
                 queryWrapper.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
                 queryWrapper2.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
                 queryWrapper3.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
@@ -137,11 +150,23 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 ArrayList<String> arrayList = new ArrayList<>();
                 arrayList.add("1");
                 String[] s = arrayList.toArray(new String[arrayList.size()]);
-                cleanDryGoodPage = cleanMapper.listCleanDryGoods(page, farmId, type, s, ids);
+                if (Integer.parseInt(TokenSign.getWorkIdByJwtToken(httpServletRequest)) == 47) {
+                    cleanDryGoodPage = cleanMapper.listCleanDryGoodsNo(page, type, s, ids);
+                } else {
+                    cleanDryGoodPage = cleanMapper.listCleanDryGoods(page, farmId, type, s, ids);
+                }
+                if (Integer.parseInt(TokenSign.getWorkIdByJwtToken(httpServletRequest)) == 47) {
+
+                } else {
+                    queryWrapper.eq("farm_id", farmId);
+                    queryWrapper2.eq("farm_id", farmId);
+                    queryWrapper3.eq("farm_id", farmId);
+                }
                 queryWrapper.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
                 queryWrapper2.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
                 queryWrapper3.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
             }
+
             queryWrapper.eq("img_status", 0);
             queryWrapper2.eq("img_status", 0);
             queryWrapper3.eq("bill_status", 0);
@@ -159,7 +184,13 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
             if ("0".equals(data)) {
                 String[] s = {TokenSign.getWorkIdByJwtToken(httpServletRequest)};
                 System.out.println("传入自定义sql的位置参数形式:" + s);
-                cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, "0,1".split(","), s);
+                if (Integer.parseInt(TokenSign.getWorkIdByJwtToken(httpServletRequest)) == 47) {
+                    cleanAndDryVo2Page = cleanMapper.CleanAndDryNo(page, type, "0,1".split(","), s);
+                } else {
+                    cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, "0,1".split(","), s);
+                    queryWrapper.eq("farm_id",farmId);
+                    queryWrapper2.eq("farm_id", farmId);
+                }
                 queryWrapper.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
                 queryWrapper2.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
             }
@@ -168,7 +199,13 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 ArrayList<String> arrayList = new ArrayList<>();
                 arrayList.add("0");
                 String[] s = arrayList.toArray(new String[arrayList.size()]);
-                cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s, ids);
+                if (Integer.parseInt(TokenSign.getWorkIdByJwtToken(httpServletRequest)) == 47) {
+                    cleanAndDryVo2Page = cleanMapper.CleanAndDryNo(page, type, s, ids);
+                } else {
+                    cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s, ids);
+                    queryWrapper.eq("farm_id",farmId);
+                    queryWrapper2.eq("farm_id", farmId);
+                }
                 queryWrapper.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
                 queryWrapper2.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
             }
@@ -177,7 +214,13 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 ArrayList<String> arrayList = new ArrayList<>();
                 arrayList.add("1");
                 String[] s = arrayList.toArray(new String[arrayList.size()]);
-                cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s, ids);
+                if (Integer.parseInt(TokenSign.getWorkIdByJwtToken(httpServletRequest)) == 47) {
+                    cleanAndDryVo2Page = cleanMapper.CleanAndDryNo(page, type, s, ids);
+                } else {
+                    cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s, ids);
+                    queryWrapper.eq("farm_id",farmId);
+                    queryWrapper2.eq("farm_id", farmId);
+                }
                 queryWrapper.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
                 queryWrapper2.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
             }
@@ -839,39 +882,44 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
         String s4 = "";
         String s5 = "";
         if (ObjectUtil.isNotEmpty(img1)) {
-            if (uploadImage.getImageCom(img1).equals("上传失败")) {
+            String imageCom = uploadImage.getImageCom(img1);
+            if (imageCom.equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return new Result(10001, "图片1上传失败", false);
             }
-            s1 = uploadImage.uploadImg(img1);
+            s1 = imageCom;
         }
         if (ObjectUtil.isNotEmpty(img2)) {
-            if (uploadImage.getImageCom(img2).equals("上传失败")) {
+            String imageCom = uploadImage.getImageCom(img2);
+            if (imageCom.equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return new Result(10001, "图片2上传失败", false);
             }
-            s2 = "," + uploadImage.uploadImg(img2);
+            s2 = "," + imageCom;
         }
         if (ObjectUtil.isNotEmpty(img3)) {
-            if (uploadImage.getImageCom(img3).equals("上传失败")) {
+            String imageCom = uploadImage.getImageCom(img3);
+            if (imageCom.equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return new Result(10001, "图片3上传失败", false);
             }
-            s3 = "," + uploadImage.uploadImg(img3);
+            s3 = "," + imageCom;
         }
         if (ObjectUtil.isNotEmpty(img4)) {
-            if (uploadImage.getImageCom(img4).equals("上传失败")) {
+            String imageCom = uploadImage.getImageCom(img4);
+            if (imageCom.equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return new Result(10001, "图片4上传失败", false);
             }
-            s4 = "," + uploadImage.uploadImg(img4);
+            s4 = "," + imageCom;
         }
         if (ObjectUtil.isNotEmpty(img5)) {
-            if (uploadImage.getImageCom(img5).equals("上传失败")) {
+            String imageCom = uploadImage.getImageCom(img5);
+            if (imageCom.equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return new Result(10001, "图片5上传失败", false);
             }
-            s5 = "," + uploadImage.uploadImg(img5);
+            s5 = "," + imageCom;
         }
         String s = s1 + s2 + s3 + s4 + s5;
 
@@ -881,7 +929,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 return new Result(10001, "此条记录已被他人修改,请退出刷新查看!", false);
             }
             QueryWrapper<BaseProcess> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("farm_id", farmId).eq("id", billClean.getProcessId());
+            queryWrapper.eq("id", billClean.getProcessId());
             BaseProcess baseProcess = processMapper.selectOne(queryWrapper);//某条进程
             QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
             locationQueryWrapper.eq("id", billClean.getTestLocationId());
@@ -910,7 +958,8 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 Object newObject = BillPcrServiceImpl.getNewObject(nextId, billClean.getDestName(), billClean.getDestId(), billClean.getAdmissionUserName(),
                         billClean.getAdmissionUserId(), billClean.getVistitDate(), billClean.getSubDate(),
                         billClean.getProcessId(), billClean.getFarmId(), billClean.getTestLocation(), billClean.getTestLocationId(),
-                        billClean.getVistitType(), billClean.getPhone(), billClean.getDepartureName(), billClean.getDepartureId(),billClean.getMidId(),billClean.getMidName());
+                        billClean.getVistitType(), billClean.getPhone(), billClean.getDepartureName(), billClean.getDepartureId(),
+                        billClean.getMidId(),billClean.getMidName(),billClean.getFarmName());
                 if (nextId == 0) {
                     if (splits.length == 1) {
                         baseProcess.setProcessType(1);
@@ -939,8 +988,9 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                         FlowUtil flowUtil = new FlowUtil();
                         Object entity = flowUtil.getEntity(Integer.parseInt(splits[1]), billClean.getVistitType(), billClean.getDestName()
                                 , billClean.getDestId(), billClean.getAdmissionUserId(), billClean.getAdmissionUserName(), billClean.getPhone(),
-                                billClean.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(farmId)
-                                , baseProcess.getId(), billClean.getDepartureName(), billClean.getDepartureId(),billClean.getMidId(),billClean.getMidName());
+                                billClean.getVistitDate(), location.getId(), location.getLocationName(),  billClean.getFarmId()
+                                , baseProcess.getId(), billClean.getDepartureName(), billClean.getDepartureId(),
+                                billClean.getMidId(),billClean.getMidName(),billClean.getFarmName());
                         if (Integer.parseInt(splits[1]) == 1) {
                             //新增采样
                             BillSampling billSampling = (BillSampling) entity;
@@ -1191,7 +1241,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 return new Result(10001, "此条记录已被他人修改,请退出刷新查看!", false);
             }
             QueryWrapper<BaseProcess> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("farm_id", farmId).eq("id", billClean.getProcessId());
+            queryWrapper.eq("id", billClean.getProcessId());
             BaseProcess baseProcess = processMapper.selectOne(queryWrapper);//某条进程
             QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
             locationQueryWrapper.eq("id", billClean.getTestLocationId());
@@ -1226,7 +1276,8 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     Object newObject = BillPcrServiceImpl.getNewObject(nextId, billClean.getDestName(), billClean.getDestId(), billClean.getAdmissionUserName(),
                             billClean.getAdmissionUserId(), billClean.getVistitDate(), billClean.getSubDate(),
                             billClean.getProcessId(), billClean.getFarmId(), billClean.getTestLocation(), billClean.getTestLocationId(),
-                            billClean.getVistitType(), billClean.getPhone(), billClean.getDepartureName(), billClean.getDepartureId(),billClean.getMidId(),billClean.getMidName());
+                            billClean.getVistitType(), billClean.getPhone(), billClean.getDepartureName(),
+                            billClean.getDepartureId(),billClean.getMidId(),billClean.getMidName(),billClean.getFarmName());
                     if (nextId == 0) {
                         if (splits.length == 1) {
                             baseProcess.setProcessType(1);
@@ -1255,8 +1306,9 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                             FlowUtil flowUtil = new FlowUtil();
                             Object entity = flowUtil.getEntity(Integer.parseInt(splits[1]), billClean.getVistitType(), billClean.getDestName()
                                     , billClean.getDestId(), billClean.getAdmissionUserId(), billClean.getAdmissionUserName(), billClean.getPhone(),
-                                    billClean.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(farmId)
-                                    , baseProcess.getId(), billClean.getDepartureName(), billClean.getDepartureId(),billClean.getMidId(),billClean.getMidName());
+                                    billClean.getVistitDate(), location.getId(), location.getLocationName(),  billClean.getFarmId()
+                                    , baseProcess.getId(), billClean.getDepartureName(),
+                                    billClean.getDepartureId(),billClean.getMidId(),billClean.getMidName(),billClean.getFarmName());
                             if (Integer.parseInt(splits[1]) == 1) {
                                 //新增采样
                                 BillSampling billSampling = (BillSampling) entity;

+ 8 - 4
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillGoodsInventoryServiceImpl.java

@@ -99,13 +99,16 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
         goodsInventory.setBillStatus(1);
         goodsInventory.setSubDate(LocalDateTime.now());
 //        goodsInventory.setWayType(wayType);
+
         if (ObjectUtil.isNotEmpty(imgUrl)) {
-            if (uploadImage.getImageCom(imgUrl).equals("上传失败")) {
+            String  imageCom = uploadImage.getImageCom(imgUrl);
+            if (imageCom.equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return new Result(10001, "图片1上传失败", false);
             }
+            goodsInventory.setImgUrl(imageCom);
         }
-        goodsInventory.setImgUrl(uploadImage.getImageCom(imgUrl));
+
 
         QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
         processQueryWrapper.eq("id", goodsInventory.getBillAdmission());
@@ -127,7 +130,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
                 goodsInventory.getAdmissionUserId(), goodsInventory.getVistitDate(), goodsInventory.getSubDate(),
                 goodsInventory.getBillAdmission(), Integer.parseInt(goodsInventory.getFarmId()), goodsInventory.getTestLocation(), goodsInventory.getTestLocationId(),
                 goodsInventory.getVistitType(), goodsInventory.getPhone(), goodsInventory.getDepartureName(), goodsInventory.getDepartureId()
-                ,goodsInventory.getMidId(),goodsInventory.getMidName());
+                ,goodsInventory.getMidId(),goodsInventory.getMidName(),goodsInventory.getFarmName());
         if (nextId == 0) {
             if (split.length == 1) {
                 baseProcess.setProcessType(1);
@@ -157,7 +160,8 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
                 Object entity = flowUtil.getEntity(Integer.parseInt(split[1]), goodsInventory.getVistitType(), goodsInventory.getDestName()
                         , goodsInventory.getDestId(), goodsInventory.getAdmissionUserId(), goodsInventory.getAdmissionUserName(), goodsInventory.getPhone(),
                         goodsInventory.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(goodsInventory.getFarmId())
-                        , baseProcess.getId(), goodsInventory.getDepartureName(), goodsInventory.getDepartureId(),goodsInventory.getMidId(),goodsInventory.getMidName());
+                        , baseProcess.getId(), goodsInventory.getDepartureName(), goodsInventory.getDepartureId(),goodsInventory.getMidId()
+                        ,goodsInventory.getMidName(),goodsInventory.getFarmName());
                 if (Integer.parseInt(split[1]) == 1) {
                     //新增采样
                     BillSampling billSampling = (BillSampling) entity;

+ 575 - 13
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPcrServiceImpl.java

@@ -304,7 +304,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
         Page<BillPcr> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
         String[] locationIds = TokenSign.getWorkIdByJwtToken(httpServletRequest).split(",");
         QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
-        queryWrapper.in("test_location_id", locationIds).orderByDesc("sub_date");
+        queryWrapper/*.in("test_location_id", locationIds)*/.orderByDesc("sub_date");
         if ("0".equals(type)) {
             queryWrapper.in("bill_status", 0, 1, 2, 3, 4);
         }
@@ -318,7 +318,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             queryWrapper.in("bill_status", 2, 3);
         }
         QueryWrapper<BillPcr> queryWrapper2 = new QueryWrapper<>();
-        queryWrapper2.in("test_location_id", locationIds).orderByDesc("sub_date");
+        queryWrapper2/*.in("test_location_id", locationIds)*/.orderByDesc("sub_date");
         queryWrapper2.eq("bill_status", 0);
         return new Result(ResultCode.SUCCESS, pcrMapper.selectPage(page, queryWrapper), pcrMapper.selectCount(queryWrapper2));
     }
@@ -333,7 +333,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
     @Override
     @Transactional
     public Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date, String result,
-                       MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws ParseException, IOException {
+                       MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile picture1, MultipartFile picture2,
+                       MultipartFile picture3) throws ParseException, IOException {
         //1为合格2为异常
         String s1 = "";
         String s2 = "";
@@ -453,7 +454,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
                 Object newObject = getNewObject(nextId, billPcr.getDestName(), billPcr.getDestId(), billPcr.getAdmissionUserName(),
                         billPcr.getAdmissionUserId(), billPcr.getVistitDate(), billPcr.getSubDate(),
                         billPcr.getProcessId(), billPcr.getFarmId(), billPcr.getTestLocation(), billPcr.getTestLocationId(),
-                        billPcr.getVistitType(), billPcr.getPhone(), billPcr.getDepartureName(), billPcr.getDepartureId(),billPcr.getMidId(),billPcr.getMidName());
+                        billPcr.getVistitType(), billPcr.getPhone(), billPcr.getDepartureName(), billPcr.getDepartureId()
+                        ,billPcr.getMidId(),billPcr.getMidName(),billPcr.getFarmName());
                 System.out.println("这里是pcr通过的下一个流程id:" + nextId);
                 if (nextId == 0) {
                     if (split.length == 1) {
@@ -498,8 +500,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
                                 PeopleList peopleList = new PeopleList();
                                 peopleList.setFarmId(billPcr.getFarmId().toString());
                                 peopleList.setDeviceCode(deviceList.getDeviceCode());
-                                UUID uuid = UUID.randomUUID();
-                                peopleList.setUserId(uuid.toString());
+                                peopleList.setUserId(billPcr.getProcessId().toString());
                                 peopleList.setUserName(billPcr.getAdmissionUserName());
                                 peopleList.setPassword("123456");
                                 peopleList.setType(0);
@@ -529,8 +530,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
                         FlowUtil flowUtil = new FlowUtil();
                         Object entity = 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(),billPcr.getMidId(),billPcr.getMidName());
+                                billPcr.getVistitDate(), location.getId(), location.getLocationName(), billPcr.getFarmId()
+                                , baseProcess.getId(), billPcr.getDepartureName(), billPcr.getDepartureId(),billPcr.getMidId(),billPcr.getMidName(),billPcr.getFarmName());
                         if (Integer.parseInt(split[1]) == 1) {
                             //新增采样
                             BillSampling billSampling = (BillSampling) entity;
@@ -572,8 +573,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
                                     PeopleList peopleList = new PeopleList();
                                     peopleList.setFarmId(billPcr.getFarmId().toString());
                                     peopleList.setDeviceCode(deviceList.getDeviceCode());
-                                    UUID uuid = UUID.randomUUID();
-                                    peopleList.setUserId(uuid.toString());
+                                    peopleList.setUserId(billPcr.getProcessId().toString());
                                     peopleList.setUserName(billPcr.getAdmissionUserName());
                                     peopleList.setPassword("123456");
                                     peopleList.setType(0);
@@ -746,8 +746,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
                             PeopleList peopleList = new PeopleList();
                             peopleList.setFarmId(billPcr.getFarmId().toString());
                             peopleList.setDeviceCode(deviceList.getDeviceCode());
-                            UUID uuid = UUID.randomUUID();
-                            peopleList.setUserId(uuid.toString());
+                            peopleList.setUserId(billPcr.getProcessId().toString());
                             peopleList.setUserName(billPcr.getAdmissionUserName());
                             peopleList.setPassword("123456");
                             peopleList.setType(0);
@@ -864,6 +863,562 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
         }
     }
 
+    @Override
+    @Transactional
+    public Result editBatch(HttpServletRequest httpServletRequest,String farmId,  String ids, String date, String result,
+                            MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws ParseException, IOException {
+
+        String s1 = "";
+        String s2 = "";
+        String s3 = "";
+        if (ObjectUtil.isNotEmpty(img1)) {
+            s1 = uploadImage.uploadImg(img1);
+            if (s1.equals("上传失败")) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "检测图片1上传失败", false);
+            }
+        }
+        if (ObjectUtil.isNotEmpty(img2)) {
+            String s = uploadImage.uploadImg(img2);
+            s2 = "," + s;
+            if (s.equals("上传失败")) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "检测图片2上传失败", false);
+            }
+        }
+        if (ObjectUtil.isNotEmpty(img3)) {
+            String s = uploadImage.uploadImg(img3);
+            s3 = "," + s;
+            if (s.equals("上传失败")) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "检测图片3上传失败", false);
+            }
+        }
+        String s = s1 + s2 + s3;
+        String picUrl = null;
+        if (ObjectUtil.isNotEmpty(picture1)){
+            String pic1 = uploadImage.getImageCom(picture1);
+            if (pic1.equals("上传失败")){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "物品检测图片1上传失败", false);
+            }else {
+                picUrl = pic1;
+            }
+        }
+        if (ObjectUtil.isNotEmpty(picture2)){
+            String pic2 = uploadImage.getImageCom(picture2);
+            if (pic2.equals("上传失败")){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "物品检测图片2上传失败", false);
+            }else {
+                picUrl = picUrl + ","+pic2;
+            }
+        }
+        if (ObjectUtil.isNotEmpty(picture3)){
+            String pic3 = uploadImage.getImageCom(picture3);
+            if (pic3.equals("上传失败")){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "物品检测图片3上传失败", false);
+            }else {
+                picUrl = picUrl + ","+pic3;
+            }
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+        if (StringUtils.isBlank(date)) {
+            date = sdf.format(new Date());
+        }
+
+        String[] splits = ids.split(",");
+        for (String id : splits) {
+            //1为合格2为异常
+            BillPcr billPcr = pcrMapper.selectById(id);
+            if (billPcr.getBillStatus() != 0) {
+                return new Result(10001, "此条记录已被他人修改,请退出刷新查看!", false);
+            }
+            billPcr.setImgUrl(s);
+            billPcr.setImgStatus(1);
+            if (billPcr.getVistitType() == 0){
+                if (ObjectUtil.isNotEmpty(picUrl)){
+                    billPcr.setIsCarry(1);
+                    billPcr.setPicUrl(picUrl);
+                }else {
+                    billPcr.setIsCarry(0);
+                }
+            }
+
+
+            QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
+            processQueryWrapper.eq("id", billPcr.getProcessId());
+            BaseProcess baseProcess = processMapper.selectOne(processQueryWrapper);//进程
+
+            QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
+            locationQueryWrapper.eq("id", billPcr.getTestLocationId());
+            BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前pcr检测所在的位置
+
+            String allLocationId = baseProcess.getAllLocationId();//所有的位置id
+            String allFlowId = baseProcess.getAllFlowId();//所有的流程id
+            String currentFlowId = baseProcess.getCurrentFlowId();//当前已经完成的流程id
+            String substring1 = allFlowId.substring(currentFlowId.length() + 1, allFlowId.length());
+            String[] split = substring1.split(",");
+            Integer nextId = Integer.parseInt(split[0]);
+
+
+            if (billPcr.getBillStatus() != 0) {
+                return new Result(10001, "该订单已通过,无需再次提交!", false);
+            }
+            if (baseProcess.getProcessType() == 2 || baseProcess.getProcessType() == 1) {
+                return new Result(10001, "修改失败!该申请已提前结束或者被拒绝", false);
+            } else {
+                if ("1".equals(result)) {
+                    Integer pcrTime = washoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().eq("farm_ids", baseProcess.getFarmId())
+                            .eq("visiting_type", billPcr.getVistitType()).eq("mid_id",billPcr.getMidId())
+                            .eq("location_id", baseLocation.getId())).getPcrTime();
+                    System.out.println("pcr的下一个流程id:" + nextId);
+                    billPcr.setBillStatus(1);
+                    billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
+                    billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
+                    billPcr.setTestLocation(baseLocation.getLocationName());
+                    billPcr.setTestLocationId(baseLocation.getId());
+                    billPcr.setCheckDate(sdf.parse(date));
+                    billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
+                    billPcr.setQualifiedDate(pcrTime);
+
+
+                    Object newObject = getNewObject(nextId, billPcr.getDestName(), billPcr.getDestId(), billPcr.getAdmissionUserName(),
+                            billPcr.getAdmissionUserId(), billPcr.getVistitDate(), billPcr.getSubDate(),
+                            billPcr.getProcessId(), billPcr.getFarmId(), billPcr.getTestLocation(), billPcr.getTestLocationId(),
+                            billPcr.getVistitType(), billPcr.getPhone(), billPcr.getDepartureName(), billPcr.getDepartureId(),billPcr.getMidId()
+                            ,billPcr.getMidName(),billPcr.getFarmName());
+                    System.out.println("这里是pcr通过的下一个流程id:" + nextId);
+                    if (nextId == 0) {
+                        if (split.length == 1) {
+                            baseProcess.setProcessType(1);
+                            String[] strings = allLocationId.split(",");
+                            String ss2 = "";
+                            for (int i = 0; i < strings.length; i++) {
+                                strings[i].replaceAll(strings[i], "2");
+                                if (i == strings.length - 1) {
+                                    ss2 = ss2 + strings[i].replaceAll(strings[i], "2");
+                                } else {
+                                    ss2 = strings[i].replaceAll(strings[i], "2") + "," + ss2;
+                                }
+                            }
+                            baseProcess.setAllLocationStatus(ss2);
+                            //下发人脸门禁白名单
+                            if (billPcr.getVistitType() == 0) {
+                                //人员隔离中心流程
+                                if (billPcr.getMidId() == 16 || billPcr.getMidId() == 29 || billPcr.getMidId() == 41 || billPcr.getMidId() == 53) {
+                                    DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", "2"));
+                                    PeopleList peopleList = new PeopleList();
+                                    peopleList.setFarmId("2");
+                                    peopleList.setDeviceCode(deviceList.getDeviceCode());
+                                    peopleList.setUserId(billPcr.getProcessId().toString());
+                                    peopleList.setUserName(billPcr.getAdmissionUserName());
+                                    peopleList.setPassword("123456");
+                                    peopleList.setType(0);
+                                    peopleList.setCreateTime(new Date());
+                                    Date now = new Date();
+                                    Calendar calendar = Calendar.getInstance();
+                                    calendar.setTime(now);
+                                    calendar.add(Calendar.HOUR_OF_DAY, 4);
+                                    Date date1 = calendar.getTime();
+                                    peopleList.setOutTime(date1);
+                                    SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPcr.getAdmissionUserId());
+                                    peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
+                                    peopleListMapper.insert(peopleList);
+                                }
+                                //人员基地外围
+                                if (billPcr.getMidId() == 17 || billPcr.getMidId() == 30 || billPcr.getMidId() == 42 || billPcr.getMidId() == 54) {
+                                    DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", billPcr.getFarmId()));
+                                    PeopleList peopleList = new PeopleList();
+                                    peopleList.setFarmId(billPcr.getFarmId().toString());
+                                    peopleList.setDeviceCode(deviceList.getDeviceCode());
+                                    peopleList.setUserId(billPcr.getProcessId().toString());
+                                    peopleList.setUserName(billPcr.getAdmissionUserName());
+                                    peopleList.setPassword("123456");
+                                    peopleList.setType(0);
+                                    peopleList.setCreateTime(new Date());
+                                    Date now = new Date();
+                                    Calendar calendar = Calendar.getInstance();
+                                    calendar.setTime(now);
+                                    calendar.add(Calendar.HOUR_OF_DAY, 4);
+                                    Date date1 = calendar.getTime();
+                                    peopleList.setOutTime(date1);
+                                    SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPcr.getAdmissionUserId());
+                                    peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
+                                    peopleListMapper.insert(peopleList);
+                                }
+                            }
+                        } else {
+                            String[] strings = allLocationId.split(",");
+                            Integer index = 0;
+                            for (int i = 0; i < strings.length; i++) {
+                                if ((baseLocation.getId().toString()).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();
+                            Object entity = flowUtil.getEntity(Integer.parseInt(split[1]), billPcr.getVistitType(), billPcr.getDestName()
+                                    , billPcr.getDestId(), billPcr.getAdmissionUserId(), billPcr.getAdmissionUserName(), billPcr.getPhone(),
+                                    billPcr.getVistitDate(), location.getId(), location.getLocationName(), billPcr.getFarmId()
+                                    , baseProcess.getId(), billPcr.getDepartureName(), billPcr.getDepartureId(),billPcr.getMidId(),billPcr.getMidName(),billPcr.getFarmName());
+                            if (Integer.parseInt(split[1]) == 1) {
+                                //新增采样
+                                BillSampling billSampling = (BillSampling) entity;
+                                if (billPcr.getVistitType() != 0) {
+                                    billSampling.setCarNum(billPcr.getCarNum());
+                                }
+                                if (billPcr.getVistitType() == 5) {
+                                    billSampling.setResource(billPcr.getResource());
+                                    billSampling.setFeedImgUrl(billPcr.getFeedImgUrl());
+                                    billSampling.setRemark(billPcr.getRemark());
+                                }
+                                samplingMapper.insert(billSampling);
+                                //下发人脸门禁白名单
+                                if (billPcr.getVistitType() == 0) {
+                                    //人员隔离中心流程
+                                    if (billPcr.getMidId() == 16 || billPcr.getMidId() == 29 || billPcr.getMidId() == 41 || billPcr.getMidId() == 53) {
+                                        DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", "2"));
+                                        PeopleList peopleList = new PeopleList();
+                                        peopleList.setFarmId("2");
+                                        peopleList.setDeviceCode(deviceList.getDeviceCode());
+                                        peopleList.setUserId(billPcr.getProcessId().toString());
+                                        peopleList.setUserName(billPcr.getAdmissionUserName());
+                                        peopleList.setPassword("123456");
+                                        peopleList.setType(0);
+                                        peopleList.setCreateTime(new Date());
+                                        Date now = new Date();
+                                        Calendar calendar = Calendar.getInstance();
+                                        calendar.setTime(now);
+                                        calendar.add(Calendar.HOUR_OF_DAY, 4);
+                                        Date date1 = calendar.getTime();
+                                        peopleList.setOutTime(date1);
+                                        SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPcr.getAdmissionUserId());
+                                        peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
+                                        peopleListMapper.insert(peopleList);
+                                    }
+                                    //人员基地外围
+                                    if (billPcr.getMidId() == 17 || billPcr.getMidId() == 30 || billPcr.getMidId() == 42 || billPcr.getMidId() == 54) {
+                                        DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", billPcr.getFarmId()));
+                                        PeopleList peopleList = new PeopleList();
+                                        peopleList.setFarmId(billPcr.getFarmId().toString());
+                                        peopleList.setDeviceCode(deviceList.getDeviceCode());
+                                        peopleList.setUserId(billPcr.getProcessId().toString());
+                                        peopleList.setUserName(billPcr.getAdmissionUserName());
+                                        peopleList.setPassword("123456");
+                                        peopleList.setType(0);
+                                        peopleList.setCreateTime(new Date());
+                                        Date now = new Date();
+                                        Calendar calendar = Calendar.getInstance();
+                                        calendar.setTime(now);
+                                        calendar.add(Calendar.HOUR_OF_DAY, 4);
+                                        Date date1 = calendar.getTime();
+                                        peopleList.setOutTime(date1);
+                                        SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPcr.getAdmissionUserId());
+                                        peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
+                                        peopleListMapper.insert(peopleList);
+                                    }
+                                }
+                            } else if (Integer.parseInt(split[1]) == 2) {
+                                //新增pcr
+                                BillPcr billClean = (BillPcr) entity;
+                                if (billPcr.getVistitType() != 0) {
+                                    billClean.setCarNum(billPcr.getCarNum());
+                                }
+                                if (billPcr.getVistitType() == 5) {
+                                    billClean.setResource(billPcr.getResource());
+                                    billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
+                                    billClean.setRemark(billPcr.getRemark());
+                                }
+                                pcrMapper.insert(billClean);
+                            } else if (Integer.parseInt(split[1]) == 3) {
+                                //新增洗澡
+                                BillClean billClean = (BillClean) entity;
+                                if (billPcr.getVistitType() != 0) {
+                                    billClean.setCarNum(billPcr.getCarNum());
+                                }
+                                if (billPcr.getVistitType() == 5) {
+                                    billClean.setResource(billPcr.getResource());
+                                    billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
+                                    billClean.setRemark(billPcr.getRemark());
+                                }
+                                cleanMapper.insert(billClean);
+                            } else if (Integer.parseInt(split[1]) == 4) {
+                                //新增隔离
+                                BillIsolate pcr = (BillIsolate) entity;
+                                if (billPcr.getVistitType() != 0) {
+                                    pcr.setCarNum(billPcr.getCarNum());
+                                }
+                                if (billPcr.getVistitType() == 5) {
+                                    pcr.setResource(billPcr.getResource());
+                                    pcr.setFeedImgUrl(billPcr.getFeedImgUrl());
+                                    pcr.setRemark(billPcr.getRemark());
+                                }
+                                isolateMapper.insert(pcr);
+                            } else if (Integer.parseInt(split[1]) == 5) {
+                                BillDry billClean = (BillDry) entity;
+                                if (billPcr.getVistitType() != 0) {
+                                    billClean.setCarNum(billPcr.getCarNum());
+                                }
+                                if (billPcr.getVistitType() == 5) {
+                                    billClean.setResource(billPcr.getResource());
+                                    billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
+                                    billClean.setRemark(billPcr.getRemark());
+                                }
+                                dryMapper.insert(billClean);
+                                //新增烘干
+                            } else if (Integer.parseInt(split[1]) == 6) {
+                                //新增洗澡前拍照
+                                BillCleanBefore before = (BillCleanBefore) entity;
+                                if (billPcr.getVistitType() != 0) {
+                                    before.setCarNum(billPcr.getCarNum());
+                                }
+                                if (billPcr.getVistitType() == 5) {
+                                    before.setResource(billPcr.getResource());
+                                    before.setFeedImgUrl(billPcr.getFeedImgUrl());
+                                    before.setRemark(billPcr.getRemark());
+                                }
+                                beforeMapper.insert(before);
+                            } else if (Integer.parseInt(split[1]) == 7) {
+                                //新增洗澡前拍照
+                                BillGoodsInventory before = (BillGoodsInventory) entity;
+                                if (billPcr.getVistitType() != 0) {
+                                    before.setCarNum(billPcr.getCarNum());
+                                }
+                                if (billPcr.getVistitType() == 5) {
+                                    before.setResource(billPcr.getResource());
+                                    before.setFeedImgUrl(billPcr.getFeedImgUrl());
+                                    before.setRemark(billPcr.getRemark());
+                                }
+                                inventoryMapper.insert(before);
+                            }
+                            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + split[1]);
+
+                            Integer locationId = billPcr.getTestLocationId();
+                            String[] split2 = allLocationId.split(",");
+                            int a = 0;
+                            for (int i = 0; i < split2.length; i++) {
+                                if (locationId.toString().equals(split2[i])) {
+                                    a = i + 1;
+                                }
+                            }
+                            int indexOf = 2 * (a - 2);//当前位置在所有流程位置中的下标
+
+                            String substring = baseProcess.getAllLocationStatus().substring(0, indexOf + 3);//截取已经过的位置状态
+                            String[] split1 = substring.split(",");
+                            String sb2 = "";
+                            for (int i = 0; i < split1.length; i++) {
+                                if (i == split1.length - 1) {
+                                    sb2 = sb2 + split1[i].replaceAll(split1[i], "2");
+                                } else {
+                                    sb2 = split1[i].replaceAll(split1[i], "2") + "," + sb2;
+                                }
+                            }
+                            sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
+                            StringBuilder sb = new StringBuilder(sb2);
+                            sb.replace(indexOf + 4, indexOf + 5, "2");
+                            sb.replace(indexOf + 6, indexOf + 7, "1");
+                            baseProcess.setAllLocationStatus(sb.toString());
+
+                        }
+                    } else if (nextId == 1) {
+                        //新增采样
+                        BillSampling billSampling = (BillSampling) newObject;
+                        if (billPcr.getVistitType() != 0) {
+                            billSampling.setCarNum(billPcr.getCarNum());
+                        }
+                        if (billPcr.getVistitType() == 5) {
+                            billSampling.setResource(billPcr.getResource());
+                            billSampling.setFeedImgUrl(billPcr.getFeedImgUrl());
+                            billSampling.setRemark(billPcr.getRemark());
+                        }
+                        samplingMapper.insert(billSampling);
+                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                    } else if (nextId == 2) {
+                        //新增pcr
+                        BillPcr billClean = (BillPcr) newObject;
+                        if (billPcr.getVistitType() != 0) {
+                            billClean.setCarNum(billPcr.getCarNum());
+                        }
+                        if (billPcr.getVistitType() == 5) {
+                            billClean.setResource(billPcr.getResource());
+                            billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
+                            billClean.setRemark(billPcr.getRemark());
+                        }
+                        pcrMapper.insert(billClean);
+                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                        //下发人脸门禁白名单
+                        if (billPcr.getVistitType() == 0) {
+                            //人员隔离中心流程
+                            if (billPcr.getMidId() == 16 || billPcr.getMidId() == 29 || billPcr.getMidId() == 41 || billPcr.getMidId() == 53) {
+                                DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", "2"));
+                                PeopleList peopleList = new PeopleList();
+                                peopleList.setFarmId("2");
+                                peopleList.setDeviceCode(deviceList.getDeviceCode());
+                                peopleList.setUserId(billPcr.getProcessId().toString());
+                                peopleList.setUserName(billPcr.getAdmissionUserName());
+                                peopleList.setPassword("123456");
+                                peopleList.setType(0);
+                                peopleList.setCreateTime(new Date());
+                                Date now = new Date();
+                                Calendar calendar = Calendar.getInstance();
+                                calendar.setTime(now);
+                                calendar.add(Calendar.HOUR_OF_DAY, 4);
+                                Date date1 = calendar.getTime();
+                                peopleList.setOutTime(date1);
+                                SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPcr.getAdmissionUserId());
+                                peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
+                                peopleListMapper.insert(peopleList);
+                            }
+                            //人员基地外围
+                            if (billPcr.getMidId() == 17 || billPcr.getMidId() == 30 || billPcr.getMidId() == 42 || billPcr.getMidId() == 54) {
+                                DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", billPcr.getFarmId()));
+                                PeopleList peopleList = new PeopleList();
+                                peopleList.setFarmId(billPcr.getFarmId().toString());
+                                peopleList.setDeviceCode(deviceList.getDeviceCode());
+                                peopleList.setUserId(billPcr.getProcessId().toString());
+                                peopleList.setUserName(billPcr.getAdmissionUserName());
+                                peopleList.setPassword("123456");
+                                peopleList.setType(0);
+                                peopleList.setCreateTime(new Date());
+                                Date now = new Date();
+                                Calendar calendar = Calendar.getInstance();
+                                calendar.setTime(now);
+                                calendar.add(Calendar.HOUR_OF_DAY, 4);
+                                Date date1 = calendar.getTime();
+                                peopleList.setOutTime(date1);
+                                SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPcr.getAdmissionUserId());
+                                peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
+                                peopleListMapper.insert(peopleList);
+                            }
+                        }
+                    } else if (nextId == 3) {
+                        //新增洗澡
+                        BillClean billClean = (BillClean) newObject;
+                        if (billPcr.getVistitType() != 0) {
+                            billClean.setCarNum(billPcr.getCarNum());
+                        }
+                        if (billPcr.getVistitType() == 5) {
+                            billClean.setResource(billPcr.getResource());
+                            billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
+                            billClean.setRemark(billPcr.getRemark());
+                        }
+                        cleanMapper.insert(billClean);
+                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                    } else if (nextId == 4) {
+                        //新增隔离
+                        BillIsolate pcr = (BillIsolate) newObject;
+                        if (billPcr.getVistitType() != 0) {
+                            pcr.setCarNum(billPcr.getCarNum());
+                        }
+                        if (billPcr.getVistitType() == 5) {
+                            pcr.setResource(billPcr.getResource());
+                            pcr.setFeedImgUrl(billPcr.getFeedImgUrl());
+                            pcr.setRemark(billPcr.getRemark());
+                        }
+                        isolateMapper.insert(pcr);
+                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                    } else if (nextId == 5) {
+                        BillDry billClean = (BillDry) newObject;
+                        if (billPcr.getVistitType() != 0) {
+                            billClean.setCarNum(billPcr.getCarNum());
+                        }
+                        if (billPcr.getVistitType() == 5) {
+                            billClean.setResource(billPcr.getResource());
+                            billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
+                            billClean.setRemark(billPcr.getRemark());
+                        }
+                        dryMapper.insert(billClean);
+                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                        //新增烘干
+                    } else if (nextId == 6) {
+                        //新增洗澡前拍照
+                        BillCleanBefore before = (BillCleanBefore) newObject;
+                        if (billPcr.getVistitType() != 0) {
+                            before.setCarNum(billPcr.getCarNum());
+                        }
+                        if (billPcr.getVistitType() == 5) {
+                            before.setResource(billPcr.getResource());
+                            before.setFeedImgUrl(billPcr.getFeedImgUrl());
+                            before.setRemark(billPcr.getRemark());
+                        }
+                        beforeMapper.insert(before);
+                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                    } else if (nextId == 7) {
+                        //新增洗澡前拍照
+                        BillGoodsInventory before = (BillGoodsInventory) newObject;
+                        if (billPcr.getVistitType() != 0) {
+                            before.setCarNum(billPcr.getCarNum());
+                        }
+                        if (billPcr.getVistitType() == 5) {
+                            before.setResource(billPcr.getResource());
+                            before.setFeedImgUrl(billPcr.getFeedImgUrl());
+                            before.setRemark(billPcr.getRemark());
+                        }
+                        inventoryMapper.insert(before);
+                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                    }
+
+                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
+                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
+                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
+                    String status = baseProcess.getCurrentStatus();
+                    String substring = status.substring(0, status.length() - 1);
+
+                    baseProcess.setCurrentStatus(substring + "1," + 0);
+
+                    processMapper.updateById(baseProcess);
+                    pcrMapper.updateById(billPcr);
+                    if (billPcr.getVistitType() == 3 && billPcr.getFarmId() == 31 || billPcr.getTestLocationId() == 45) {
+                        //风行下发单独的饲料车流程门禁
+                        DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", "31"));
+                        PeopleList peopleList = new PeopleList();
+                        peopleList.setFarmId("31");
+                        peopleList.setDeviceCode(deviceList.getDeviceCode());
+                        peopleList.setUserId(billPcr.getProcessId().toString());
+                        peopleList.setUserName(billPcr.getAdmissionUserName());
+                        peopleList.setPassword("123456");
+                        peopleList.setType(0);
+                        peopleList.setCreateTime(new Date());
+                        Date now = new Date();
+                        Calendar calendar = Calendar.getInstance();
+                        calendar.setTime(now);
+                        calendar.add(Calendar.HOUR_OF_DAY, 4);
+                        Date date1 = calendar.getTime();
+                        peopleList.setOutTime(date1);
+                        SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPcr.getAdmissionUserId());
+                        peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
+                        peopleListMapper.insert(peopleList);
+                    }
+
+                    return new Result(10000, "修改成功!", true);
+                } else {
+                    billPcr.setBillStatus(2);
+                    billPcr.setPcrType(1);
+                    billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
+                    billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
+                    billPcr.setTestLocation(baseLocation.getLocationName());
+                    billPcr.setTestLocationId(baseLocation.getId());
+                    billPcr.setCheckDate(sdf.parse(date));
+                    billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
+                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
+                    String status = baseProcess.getCurrentStatus();
+                    String substring = status.substring(0, status.length() - 1);
+                    baseProcess.setCurrentStatus(substring + "2," + 0);
+
+                    processMapper.updateById(baseProcess);
+                    pcrMapper.updateById(billPcr);
+                    return new Result(10000, "修改成功!", true);
+                }
+
+            }
+        }
+        return new Result(10000, "修改成功!", true);
+    }
+
     public static void main(String[] args) {
         Random random = new Random();
         int randomNum = random.nextInt(90000000) + 1000;
@@ -931,7 +1486,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
 
     public static Object getNewObject(Integer id, String destName, Integer destId, String admissionUserName, Integer admissionUserId
             , LocalDateTime vistitDate, LocalDateTime subDate, Integer processId, Integer farmId, String testLocation
-            , Integer testLocationId, Integer vistitType, String phone, String departureName, Integer departureId,Integer midId,String midName) {
+            , Integer testLocationId, Integer vistitType, String phone, String departureName, Integer departureId,Integer midId,String midName,String farmName) {
         if (id == 1) {
             //采样
             BillSampling billSampling = new BillSampling();
@@ -951,6 +1506,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billSampling.setDepartureId(departureId);
             billSampling.setMidId(midId);
             billSampling.setMidName(midName);
+            billSampling.setFarmName(farmName);
             return billSampling;
         }
         if (id == 2) {
@@ -973,6 +1529,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billPcr.setDepartureId(departureId);
             billPcr.setMidId(midId);
             billPcr.setMidName(midName);
+            billPcr.setFarmName(farmName);
             return billPcr;
         }
         if (id == 3) {
@@ -995,6 +1552,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billPcr.setDepartureId(departureId);
             billPcr.setMidId(midId);
             billPcr.setMidName(midName);
+            billPcr.setFarmName(farmName);
             return billPcr;
         }
         if (id == 4) {
@@ -1017,6 +1575,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billPcr.setDepartureId(departureId);
             billPcr.setMidId(midId);
             billPcr.setMidName(midName);
+            billPcr.setFarmName(farmName);
             return billPcr;
         }
         if (id == 5) {
@@ -1039,6 +1598,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billPcr.setDepartureId(departureId);
             billPcr.setMidId(midId);
             billPcr.setMidName(midName);
+            billPcr.setFarmName(farmName);
             return billPcr;
         }
         if (id == 6) {
@@ -1061,6 +1621,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billCleanBefore.setDepartureId(departureId);
             billCleanBefore.setMidId(midId);
             billCleanBefore.setMidName(midName);
+            billCleanBefore.setFarmName(farmName);
             return billCleanBefore;
         }
 
@@ -1085,6 +1646,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billCleanBefore.setProcessId(processId);
             billCleanBefore.setMidId(midId);
             billCleanBefore.setMidName(midName);
+            billCleanBefore.setFarmName(farmName);
             return billCleanBefore;
         }
         return null;

+ 71 - 151
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPersonnelAdmissionServiceImpl.java

@@ -596,12 +596,13 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                 SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPersonnelAdmission.getAdmissionUserId());
                 peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
                 peopleListMapper.insert(peopleList);
-                billPersonnelAdmission.setBillStatus(2);
+
+                billPersonnelAdmission.setBillStatus(1);
                 baseProcess.setProcessType(1);
                 baseProcess.setCurrentStatus("2");
                 String status = baseProcess.getAllLocationStatus();
                 String[] split1 = status.split(",");
-                split1[0] = "3";
+                split1[0] = "2";
                 baseProcess.setAllLocationStatus(split1[0] + status.substring(1));
                 baseProcessMapper.updateById(baseProcess);
                 billPersonnelAdmissionMapper.updateById(billPersonnelAdmission);
@@ -658,7 +659,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                            billPersonnelAdmission.getFarmName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                         billSampling.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -692,7 +694,9 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(),
+                            billPersonnelAdmission.getMidName(),
+                            billPersonnelAdmission.getFarmName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                         billPcr.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -726,7 +730,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                            billPersonnelAdmission.getFarmName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                         billClean.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -760,7 +765,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                            billPersonnelAdmission.getFarmName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                         billIsolate.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -794,7 +800,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                            billPersonnelAdmission.getFarmName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                         billDry.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -828,7 +835,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                            billPersonnelAdmission.getFarmName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                         billCleanBefore.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -862,7 +870,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                            billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                            billPersonnelAdmission.getFarmName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                         billCleanBefore.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -1495,6 +1504,39 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                 if (billPersonnelAdmission.getBillStatus() != 0) {
                     return new Result(10001, "该订单已通过,无需再次点击!", false);
                 }
+                //新增人员转场,不需要流程,入场审批通过后直接下发门禁,流程结束
+                if (billPersonnelAdmission.getMidId()==60||billPersonnelAdmission.getMidId()==61
+                        ||billPersonnelAdmission.getMidId()==67||billPersonnelAdmission.getMidId()==68) {
+                    DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", billPersonnelAdmission.getFarmId()));
+                    PeopleList peopleList = new PeopleList();
+                    peopleList.setFarmId(billPersonnelAdmission.getFarmId().toString());
+                    peopleList.setDeviceCode(deviceList.getDeviceCode());
+                    peopleList.setUserId(billPersonnelAdmission.getProcessId().toString());
+                    peopleList.setUserName(billPersonnelAdmission.getAdmissionUserName());
+                    peopleList.setPassword("123456");
+                    peopleList.setType(0);
+                    peopleList.setCreateTime(new Date());
+                    Date now = new Date();
+                    Calendar calendar = Calendar.getInstance();
+                    calendar.setTime(now);
+                    calendar.add(Calendar.HOUR_OF_DAY, 4);
+                    Date date1 = calendar.getTime();
+                    peopleList.setOutTime(date1);
+                    SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPersonnelAdmission.getAdmissionUserId());
+                    peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
+                    peopleListMapper.insert(peopleList);
+
+                    billPersonnelAdmission.setBillStatus(1);
+                    baseProcess.setProcessType(1);
+                    baseProcess.setCurrentStatus("2");
+                    String status = baseProcess.getAllLocationStatus();
+                    String[] split1 = status.split(",");
+                    split1[0] = "2";
+                    baseProcess.setAllLocationStatus(split1[0] + status.substring(1));
+                    baseProcessMapper.updateById(baseProcess);
+                    billPersonnelAdmissionMapper.updateById(billPersonnelAdmission);
+                    return Result.SUCCESS();
+                }
                 //通过
                 billPersonnelAdmission.setBillStatus(1);
 
@@ -1544,7 +1586,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                                 billPersonnelAdmission.getFarmId(),
                                 baseProcess.getId(),
                                 billPersonnelAdmission.getDepartureName(),
-                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                                billPersonnelAdmission.getFarmName());
                         if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                             billSampling.setCarNum(billPersonnelAdmission.getCarNum());
                         }
@@ -1578,7 +1621,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                                 billPersonnelAdmission.getFarmId(),
                                 baseProcess.getId(),
                                 billPersonnelAdmission.getDepartureName(),
-                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                                billPersonnelAdmission.getFarmName());
                         if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                             billPcr.setCarNum(billPersonnelAdmission.getCarNum());
                         }
@@ -1612,7 +1656,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                                 billPersonnelAdmission.getFarmId(),
                                 baseProcess.getId(),
                                 billPersonnelAdmission.getDepartureName(),
-                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                                billPersonnelAdmission.getFarmName());
                         if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                             billClean.setCarNum(billPersonnelAdmission.getCarNum());
                         }
@@ -1646,7 +1691,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                                 billPersonnelAdmission.getFarmId(),
                                 baseProcess.getId(),
                                 billPersonnelAdmission.getDepartureName(),
-                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                                billPersonnelAdmission.getFarmName());
                         if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                             billIsolate.setCarNum(billPersonnelAdmission.getCarNum());
                         }
@@ -1680,7 +1726,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                                 billPersonnelAdmission.getFarmId(),
                                 baseProcess.getId(),
                                 billPersonnelAdmission.getDepartureName(),
-                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                                billPersonnelAdmission.getFarmName());
                         if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                             billDry.setCarNum(billPersonnelAdmission.getCarNum());
                         }
@@ -1714,7 +1761,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                                 billPersonnelAdmission.getFarmId(),
                                 baseProcess.getId(),
                                 billPersonnelAdmission.getDepartureName(),
-                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                                billPersonnelAdmission.getFarmName());
                         if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                             billCleanBefore.setCarNum(billPersonnelAdmission.getCarNum());
                         }
@@ -1748,7 +1796,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                                 billPersonnelAdmission.getFarmId(),
                                 baseProcess.getId(),
                                 billPersonnelAdmission.getDepartureName(),
-                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName());
+                                billPersonnelAdmission.getDepartureId(), billPersonnelAdmission.getMidId(), billPersonnelAdmission.getMidName(),
+                                billPersonnelAdmission.getFarmName());
                         if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())) {
                             billCleanBefore.setCarNum(billPersonnelAdmission.getCarNum());
                         }
@@ -1776,137 +1825,6 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                     //TODO 紧急入场通过先不处理
                 }
 
-                //通过生成门禁白名单
-                QueryWrapper<DeviceList> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("farm_id", billPersonnelAdmission.getFarmId()).eq("location_id", billPersonnelAdmission.getDestId());
-                DeviceList deviceList = deviceListMapper.selectOne(queryWrapper);
-               /* if (ObjectUtil.isNotEmpty(deviceList)) {
-                    if (deviceList.getDeviceType() == 0) {
-                        //通过生成门禁白名单
-                        PeopleList peopleList = new PeopleList();
-                        peopleList.setFarmId(billPersonnelAdmission.getFarmId().toString());
-                        peopleList.setDeviceCode(deviceList.getDeviceCode());
-                        peopleList.setUserId(billPersonnelAdmission.getAdmissionUserId());
-                        peopleList.setUserName(billPersonnelAdmission.getAdmissionUserName());
-                        peopleList.setPassword("123456");
-                        peopleList.setType(0);
-                        peopleList.setCreateTime(new Date());
-                        Date date = new Date();
-                        Calendar calendar = Calendar.getInstance();
-                        calendar.setTime(date);
-                        calendar.add(Calendar.HOUR_OF_DAY, 3);
-                        Date date1 = calendar.getTime();
-                        peopleList.setOutTime(date1);
-                        peopleListMapper.insert(peopleList);
-
-                        HashMap<String, Object> jsonObject = new HashMap<>();
-                        jsonObject.put("seq", deviceList.getDeviceCode());
-//                    String savePath = "D:\\works\\pig_projects\\甜妹.jpg";
-                        String savePath = "/opt/huatong/test.jpg";
-                        URL url = new URL(billPersonnelAdmission.getUserImgUrl());
-                        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-                        connection.setRequestMethod("GET");
-                        int resCode = connection.getResponseCode();
-                        if (resCode == HttpURLConnection.HTTP_OK) {
-                            InputStream inputStream = connection.getInputStream();
-                            byte[] buffer = new byte[4096];
-                            int length;
-                            //读取数据并写入到文件中
-                            try (FileOutputStream outStream = new FileOutputStream(savePath)) {
-                                while ((length = inputStream.read(buffer)) != -1) {
-                                    outStream.write(buffer, 0, length);
-                                }
-                                outStream.flush();
-                            } finally {
-                                inputStream.close();
-                            }
-                        } else {
-                            System.out.println("文件下载错误码为" + resCode);
-                        }
-
-//                    jsonObject.put("face", FileUtil.file("D:\\works\\pig_projects\\甜妹.jpg"));
-                        jsonObject.put("face", FileUtil.file(savePath));
-                        jsonObject.put("name", billPersonnelAdmission.getAdmissionUserName());
-                        jsonObject.put("password", "123456");
-                        jsonObject.put("timestamp", date1.getTime());
-                        jsonObject.put("uid", billPersonnelAdmission.getAdmissionUserId());
-                        String post = HttpRequest.post("http://127.0.0.1:8050/addDeviceUser")
-                                .header(Header.CONTENT_TYPE, "multipart/form-data")
-                                .form(jsonObject)
-                                .timeout(30 * 1000).execute().body();
-                        System.out.println(post);
-                    } else {
-                        //车辆闸机
-                        PeopleList peopleList = new PeopleList();
-                        peopleList.setFarmId(billPersonnelAdmission.getFarmId().toString());
-                        peopleList.setDeviceCode(deviceList.getDeviceCode());
-                        peopleList.setUserId(billPersonnelAdmission.getAdmissionUserId());
-                        peopleList.setUserName(billPersonnelAdmission.getAdmissionUserName());
-                        peopleList.setPassword("123456");
-                        peopleList.setType(1);
-                        peopleList.setCreateTime(new Date());
-                        Date date = new Date();
-                        Calendar calendar = Calendar.getInstance();
-                        calendar.setTime(date);
-                        calendar.add(Calendar.HOUR_OF_DAY, 3);
-                        Date date1 = calendar.getTime();
-                        peopleList.setOutTime(date1);
-                        peopleListMapper.insert(peopleList);
-
-                        //需要先验证车辆是否存在白名单内,如果车辆已存在于白名单当中,则需要更新白名单,将车牌从白名单中删除后
-                        //重新进行添加,如果车辆不存在于白名单当中则直接添加入白名单
-                        JSONObject jsonObject = new JSONObject();
-                        jsonObject.put("seq", deviceList.getDeviceCode());
-                        jsonObject.put("isBlack", false);
-                        String request = HttpRequest.get("http://127.0.0.1:8050/getCarDeviceWoBList")
-                                .body(jsonObject.toJSONString())
-                                .header(Header.CONTENT_TYPE, "application/json")
-                                .timeout(30 * 1000).execute().body();
-                        JSONObject object = JSON.parseObject(request);
-                        System.out.println(object);
-                        JSONArray data = (JSONArray) object.get("data");
-                        System.out.println(data);
-                        if (data.size() > 0) {
-                            for (int i = 0; i < data.size(); i++) {
-                                JSONObject jsonObject1 = (JSONObject) data.get(i);
-                                if (jsonObject1.get("plate").equals(billPersonnelAdmission.getCarNum())) {
-                                    JSONObject jsonObject2 = new JSONObject();
-                                    jsonObject2.put("isBlack", false);
-                                    jsonObject2.put("seq", deviceList.getDeviceCode());
-                                    List<Integer> list = new ArrayList<>();
-                                    list.add((Integer) jsonObject1.get("cid"));
-                                    jsonObject2.put("cids", list);
-
-                                    String body = HttpRequest.post(" http://127.0.0.1:8050/delCarDeviceWoBList").header(Header.CONTENT_TYPE, "application/json")
-                                            .body(jsonObject2.toJSONString())
-                                            .timeout(30 * 1000).execute().body();
-                                    System.out.println(body);
-                                }
-                            }
-                        }
-
-
-                        JSONObject jsonObject1 = new JSONObject();
-                        JSONArray jsonArray = new JSONArray();
-                        JSONObject object1 = new JSONObject();
-                        jsonObject1.put("seq", deviceList.getDeviceCode());
-                        jsonObject1.put("isBlack", false);
-
-                        object1.put("timestamp", date1.getTime());
-                        object1.put("name", billPersonnelAdmission.getAdmissionUserName());
-                        object1.put("plate", billPersonnelAdmission.getCarNum());
-
-                        jsonArray.add(object1);
-                        jsonObject1.put("plates", jsonArray);
-
-                        String post = HttpRequest.post(" http://127.0.0.1:8050/addCarDeviceWoBList")
-                                .header(Header.CONTENT_TYPE, "application/json")
-                                .body(jsonObject1.toJSONString())
-                                .timeout(30 * 1000).execute().body();
-                        System.out.println(post);
-                    }
-
-                }*/
             }
             baseProcessMapper.updateById(baseProcess);
             billPersonnelAdmissionMapper.updateById(billPersonnelAdmission);
@@ -2075,7 +1993,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                 Object newObject = BillPcrServiceImpl.getNewObject(nextId, billPcr.getDestName(), billPcr.getDestId(), billPcr.getAdmissionUserName(),
                         billPcr.getAdmissionUserId(), billPcr.getVistitDate(), billPcr.getSubDate(),
                         billPcr.getProcessId(), billPcr.getFarmId(), billPcr.getTestLocation(), billPcr.getTestLocationId(), billPcr.getVistitType(),
-                        billPcr.getPhone(), billPcr.getDepartureName(), billPcr.getDepartureId(), billPcr.getMidId(), billPcr.getMidName());
+                        billPcr.getPhone(), billPcr.getDepartureName(), billPcr.getDepartureId(), billPcr.getMidId(), billPcr.getMidName(),billPcr.getFarmName());
                 if (nextId == 0) {
                     if (split.length == 1) {
                         baseProcess.setProcessType(1);
@@ -2106,7 +2024,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                                 , billPcr.getDestId(), billPcr.getAdmissionUserId(), billPcr.getAdmissionUserName(), billPcr.getPhone(),
                                 billPcr.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(farmId)
                                 , baseProcess.getId(), billPcr.getDepartureName(), billPcr.getDepartureId()
-                                , billPcr.getMidId(), billPcr.getMidName());
+                                , billPcr.getMidId(), billPcr.getMidName(),billPcr.getFarmName());
                         if (Integer.parseInt(split[1]) == 1) {
                             //新增采样
                             BillSampling billSampling = (BillSampling) entity;
@@ -2504,7 +2422,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         Object newObject = BillPcrServiceImpl.getNewObject(nextId, billIsolate.getDestName(), billIsolate.getDestId(), billIsolate.getAdmissionUserName(),
                 billIsolate.getAdmissionUserId(), billIsolate.getVistitDate(), billIsolate.getSubDate(),
                 billIsolate.getProcessId(), billIsolate.getFarmId(), billIsolate.getIsolateLocation(), billIsolate.getIsolateLocationId(),
-                billIsolate.getVistitType(), billIsolate.getPhone(), billIsolate.getDepartureName(), billIsolate.getDepartureId(), billIsolate.getMidId(), billIsolate.getMidName());
+                billIsolate.getVistitType(), billIsolate.getPhone(), billIsolate.getDepartureName(), billIsolate.getDepartureId(),
+                billIsolate.getMidId(), billIsolate.getMidName(),billIsolate.getFarmName());
         if (nextId == 0) {
             if (splits.length == 1) {
                 baseProcess.setProcessType(1);
@@ -2534,7 +2453,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                 Object entity = flowUtil.getEntity(Integer.parseInt(splits[1]), billIsolate.getVistitType(), billIsolate.getDestName()
                         , billIsolate.getDestId(), billIsolate.getAdmissionUserId(), billIsolate.getAdmissionUserName(), billIsolate.getPhone(),
                         billIsolate.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(farmId)
-                        , baseProcess.getId(), billIsolate.getDepartureName(), billIsolate.getDepartureId(), billIsolate.getMidId(), billIsolate.getMidName());
+                        , baseProcess.getId(), billIsolate.getDepartureName(), billIsolate.getDepartureId(), billIsolate.getMidId(),
+                        billIsolate.getMidName(),billIsolate.getFarmName());
                 if (Integer.parseInt(splits[1]) == 1) {
                     //新增采样
                     BillSampling billSampling = (BillSampling) entity;

+ 5 - 3
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillSamplingServiceImpl.java

@@ -241,7 +241,8 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
         Object newObject = BillPcrServiceImpl.getNewObject(nextId, sampling.getDestName(), sampling.getDestId(), sampling.getAdmissionUserName(),
                 sampling.getAdmissionUserId(), sampling.getVistitDate(), sampling.getSubDate(),
                 sampling.getProcessId(), Integer.parseInt(sampling.getFarmId()), sampling.getTestLocation(), sampling.getTestLocationId(),
-                sampling.getVistitType(), sampling.getPhone(), sampling.getDepartureName(), sampling.getDepartureId(), sampling.getMidId(), sampling.getMidName());
+                sampling.getVistitType(), sampling.getPhone(), sampling.getDepartureName(), sampling.getDepartureId(), sampling.getMidId()
+                , sampling.getMidName(),sampling.getFarmName());
         if (nextId == 0) {
             if (split.length == 1) {
                 baseProcess.setProcessType(1);
@@ -270,8 +271,9 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
                 FlowUtil flowUtil = new FlowUtil();
                 Object entity = flowUtil.getEntity(Integer.parseInt(split[1]), sampling.getVistitType(), sampling.getDestName()
                         , sampling.getDestId(), sampling.getAdmissionUserId(), sampling.getAdmissionUserName(), sampling.getPhone(),
-                        sampling.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(farmId)
-                        , baseProcess.getId(), sampling.getDepartureName(), sampling.getDepartureId(), sampling.getMidId(), sampling.getMidName());
+                        sampling.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(sampling.getFarmId())
+                        , baseProcess.getId(), sampling.getDepartureName(), sampling.getDepartureId(), sampling.getMidId()
+                        , sampling.getMidName(),sampling.getFarmName());
                 if (Integer.parseInt(split[1]) == 1) {
                     //新增采样
                     BillSampling billSampling = (BillSampling) entity;

+ 4 - 2
huimv-receive/src/main/java/com/huimv/receive/timer/SafeTimer.java

@@ -81,7 +81,8 @@
 //                Object newObject = BillPcrServiceImpl.getNewObject(nextId, billIsolate.getDestName(), billIsolate.getDestId(), billIsolate.getAdmissionUserName(),
 //                        billIsolate.getAdmissionUserId(), billIsolate.getVistitDate(), billIsolate.getSubDate(),
 //                        billIsolate.getProcessId(), billIsolate.getFarmId(), billIsolate.getIsolateLocation(), billIsolate.getIsolateLocationId(),
-//                        billIsolate.getVistitType(), billIsolate.getPhone(), billIsolate.getDepartureName(), billIsolate.getDepartureId());
+//                        billIsolate.getVistitType(), billIsolate.getPhone(), billIsolate.getDepartureName(), billIsolate.getDepartureId()
+//                        ,billIsolate.getMidId(),billIsolate.getMidName(),billIsolate.getFarmName());
 //                if (nextId == 0) {
 //                    if (splits.length == 1) {
 //                        baseProcess.setProcessType(1);
@@ -111,7 +112,8 @@
 //                        Object entity = flowUtil.getEntity(Integer.parseInt(splits[1]), billIsolate.getVistitType(), billIsolate.getDestName()
 //                                , billIsolate.getDestId(), billIsolate.getAdmissionUserId(), billIsolate.getAdmissionUserName(), billIsolate.getPhone(),
 //                                billIsolate.getVistitDate(), location.getId(), location.getLocationName(), billIsolate.getFarmId()
-//                                , baseProcess.getId(), billIsolate.getDepartureName(), billIsolate.getDepartureId());
+//                                , baseProcess.getId(), billIsolate.getDepartureName(), billIsolate.getDepartureId()
+//                                ,billIsolate.getMidId(),billIsolate.getMidName(),billIsolate.getFarmName());
 //                        if (Integer.parseInt(splits[1]) == 1) {
 //                            //新增采样
 //                            BillSampling billSampling = (BillSampling) entity;

+ 54 - 0
huimv-receive/src/main/resources/com/huimv/receive/mapper/BillCleanMapper.xml

@@ -72,6 +72,28 @@
         </foreach>
         ORDER BY sub_date DESC
     </select>
+    <select id="CleanAndDryNo" resultType="com.huimv.receive.entity.vo.CleanAndDryVo2">
+        select *,null,1 AS 'type' from bill_clean where  vistit_type=#{type}
+        and test_location_id in
+        <foreach collection="locations" item="location" separator="," open="(" close=")">
+            #{location}
+        </foreach>
+        and img_status in
+        <foreach collection="status" item="statu" separator="," open="(" close=")">
+            #{statu}
+        </foreach>
+        union all
+        select *,2 AS 'type' from bill_dry where  vistit_type=#{type}
+        and test_location_id in
+        <foreach collection="locations" item="location" separator="," open="(" close=")">
+            #{location}
+        </foreach>
+        and img_status in
+        <foreach collection="status" item="statu" separator="," open="(" close=")">
+            #{statu}
+        </foreach>
+        ORDER BY sub_date DESC
+    </select>
 
 
     <select id="CleanAndDry2" resultType="com.huimv.receive.entity.vo.CleanAndDryVo2">
@@ -152,6 +174,38 @@ ORDER BY
         </foreach>
         ORDER BY sub_date DESC
     </select>
+    <select id="listCleanDryGoodsNo" resultType="com.huimv.receive.entity.vo.CleanDryGoodsVo">
+        select id,vistit_Type,test_location,admission_user_name,car_num,clean_time,null as 'dryTime',check_date,sub_date,bill_status,img_status,1 AS 'type' from bill_clean where  vistit_type=#{type}
+        and test_location_id in
+        <foreach collection="locations" item="location" separator="," open="(" close=")">
+            #{location}
+        </foreach>
+        and img_status in
+        <foreach collection="status" item="statu" separator="," open="(" close=")">
+            #{statu}
+        </foreach>
+        union all
+        select id,vistit_Type,test_location,admission_user_name,car_num,null as 'cleanTime',dry_time,check_date,sub_date,bill_status,img_status,2 AS 'type' from bill_dry where  vistit_type=#{type}
+        and test_location_id in
+        <foreach collection="locations" item="location" separator="," open="(" close=")">
+            #{location}
+        </foreach>
+        and img_status in
+        <foreach collection="status" item="statu" separator="," open="(" close=")">
+            #{statu}
+        </foreach>
+        union all
+        select id,'5' as 'vistitType',test_location as 'testLocation',admission_user_name,car_num,null as 'cleanTime',null as 'dryTime',null as 'checkDate' ,sub_date,bill_status as 'billStatus' ,null,3 AS 'type' from bill_goods_inventory where
+         test_location_id in
+        <foreach collection="locations" item="location" separator="," open="(" close=")">
+            #{location}
+        </foreach>
+        and bill_status in
+        <foreach collection="status" item="statu" separator="," open="(" close=")">
+            #{statu}
+        </foreach>
+        ORDER BY sub_date DESC
+    </select>
 
     <select id="listCleanDryGoods2" resultType="com.huimv.receive.entity.vo.CleanDryGoodsVo">
         select id,vistit_Type,test_location,admission_user_name,car_num,clean_time,null as 'dryTime',check_date,sub_date,bill_status,img_status,1 AS 'type' from bill_clean where farm_id=#{farmId} and vistit_type=#{type}