wwh 2 ماه پیش
والد
کامیت
158abcc5af
27فایلهای تغییر یافته به همراه736 افزوده شده و 509 حذف شده
  1. 18 1
      huimv-receive/src/main/java/com/huimv/receive/common/utils/FlowUtil.java
  2. 50 32
      huimv-receive/src/main/java/com/huimv/receive/controller/BaseVisitingMidController.java
  3. 14 6
      huimv-receive/src/main/java/com/huimv/receive/controller/BillPersonnelAdmissionController.java
  4. 3 3
      huimv-receive/src/main/java/com/huimv/receive/controller/LoginController.java
  5. 7 1
      huimv-receive/src/main/java/com/huimv/receive/entity/BaseVisitingMid.java
  6. 3 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BaseWashoutPoint.java
  7. 4 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillClean.java
  8. 4 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillCleanBefore.java
  9. 3 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillDry.java
  10. 4 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillGoodsInventory.java
  11. 3 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillIsolate.java
  12. 4 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillPcr.java
  13. 4 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillPersonnelAdmission.java
  14. 4 0
      huimv-receive/src/main/java/com/huimv/receive/entity/BillSampling.java
  15. 4 0
      huimv-receive/src/main/java/com/huimv/receive/entity/dto/GetWashoutPointDto.java
  16. 5 0
      huimv-receive/src/main/java/com/huimv/receive/service/IBaseVisitingMidService.java
  17. 12 5
      huimv-receive/src/main/java/com/huimv/receive/service/IBillPersonnelAdmissionService.java
  18. 52 0
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BaseVisitingMidServiceImpl.java
  19. 19 14
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BaseWashoutPointServiceImpl.java
  20. 3 2
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanBeforeServiceImpl.java
  21. 4 4
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanServiceImpl.java
  22. 3 2
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillGoodsInventoryServiceImpl.java
  23. 19 4
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPcrServiceImpl.java
  24. 85 30
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPersonnelAdmissionServiceImpl.java
  25. 2 2
      huimv-receive/src/main/java/com/huimv/receive/service/impl/BillSamplingServiceImpl.java
  26. 401 401
      huimv-receive/src/main/java/com/huimv/receive/timer/SafeTimer.java
  27. 2 2
      huimv-receive/src/main/resources/mapper/BaseWashoutPointMapper.xml

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

@@ -7,7 +7,10 @@ import java.time.LocalDateTime;
 
 @Component
 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) {
+    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) {
         if (nextFlowId == 1) {
             BillSampling billSampling = new BillSampling();
             billSampling.setVistitType(vistitType);
@@ -24,6 +27,8 @@ public class FlowUtil {
             billSampling.setFarmId(String.valueOf(farmId));
             billSampling.setDepartureId(departureId);
             billSampling.setDepartureName(departureName);
+            billSampling.setMidId(midId);
+            billSampling.setMidName(midName);
             return billSampling;
         } else if (nextFlowId == 2) {
             BillPcr billPcr = new BillPcr();
@@ -41,6 +46,8 @@ public class FlowUtil {
             billPcr.setFarmId(farmId);
             billPcr.setDepartureId(departureId);
             billPcr.setDepartureName(departureName);
+            billPcr.setMidId(midId);
+            billPcr.setMidName(midName);
             return billPcr;
         } else if (nextFlowId == 3) {
             BillClean billClean = new BillClean();
@@ -58,6 +65,8 @@ public class FlowUtil {
             billClean.setFarmId(farmId);
             billClean.setDepartureId(departureId);
             billClean.setDepartureName(departureName);
+            billClean.setMidId(midId);
+            billClean.setMidName(midName);
             return billClean;
         } else if (nextFlowId == 4) {
             BillIsolate billIsolate = new BillIsolate();
@@ -75,6 +84,8 @@ public class FlowUtil {
             billIsolate.setFarmId(farmId);
             billIsolate.setDepartureId(departureId);
             billIsolate.setDepartureName(departureName);
+            billIsolate.setMidId(midId);
+            billIsolate.setMidName(midName);
             return billIsolate;
         } else if (nextFlowId == 5) {
             BillDry billDry = new BillDry();
@@ -92,6 +103,8 @@ public class FlowUtil {
             billDry.setFarmId(farmId);
             billDry.setDepartureId(departureId);
             billDry.setDepartureName(departureName);
+            billDry.setMidId(midId);
+            billDry.setMidName(midName);
             return billDry;
         } else if (nextFlowId == 6) {
             BillCleanBefore billCleanBefore = new BillCleanBefore();
@@ -109,6 +122,8 @@ public class FlowUtil {
             billCleanBefore.setFarmId(String.valueOf(farmId));
             billCleanBefore.setDepartureId(departureId);
             billCleanBefore.setDepartureName(departureName);
+            billCleanBefore.setMidId(midId);
+            billCleanBefore.setMidName(midName);
             return billCleanBefore;
         } else{
             BillGoodsInventory billCleanBefore = new BillGoodsInventory();
@@ -127,6 +142,8 @@ public class FlowUtil {
             billCleanBefore.setDepartureId(departureId);
             billCleanBefore.setDepartureName(departureName);
             billCleanBefore.setProcessId(processId);
+            billCleanBefore.setMidId(midId);
+            billCleanBefore.setMidName(midName);
             return billCleanBefore;
         }
     }

+ 50 - 32
huimv-receive/src/main/java/com/huimv/receive/controller/BaseVisitingMidController.java

@@ -6,15 +6,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.ResultCode;
 import com.huimv.receive.entity.BaseVisiting;
+import com.huimv.receive.entity.BaseVisitingMid;
 import com.huimv.receive.entity.BaseWashoutPoint;
 import com.huimv.receive.service.IBaseJobService;
 import com.huimv.receive.service.IBaseVisitingMidService;
+import com.huimv.receive.service.IBaseWashoutPointService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
@@ -29,37 +27,57 @@ import java.util.Map;
  */
 @RestController
 @RequestMapping("/base-visiting-mid")
+@CrossOrigin
 public class BaseVisitingMidController {
 
     @Autowired
     private IBaseVisitingMidService baseVisitingMidService;
+    @Autowired
+    private IBaseWashoutPointService baseWashoutPointService;
+
+      @PostMapping("/add")
+    public Result add(@RequestBody BaseVisitingMid baseVisitingMid){
+        return baseVisitingMidService.add(baseVisitingMid);
+    }
+
+    @PostMapping("/delete")
+    public Result delete(@RequestBody Map<String,String> paramsMap){
+        String id = paramsMap.get("id");
+        if (baseWashoutPointService.count(new QueryWrapper<BaseWashoutPoint>().lambda().eq(BaseWashoutPoint::getVisitingType,id)) > 0) {
+            return new Result(10001,"请先删除该来访类型相关洗消点!",false);
+        }
+        baseVisitingMidService.removeById(id);
+        return new Result(ResultCode.SUCCESS);
+    }
+
+    @PostMapping("/update")
+    public Result page(@RequestBody BaseVisitingMid baseVisitingMid){
+        return baseVisitingMidService.update(baseVisitingMid);
+    }
+
+    @PostMapping("/list")
+    public Result list(@RequestBody Map<String,String> paramsMap){
+        String farmId = paramsMap.get("farmId");
+        return new Result(ResultCode.SUCCESS, baseVisitingMidService.list(new QueryWrapper<BaseVisitingMid>().eq("farm_id", farmId)));
+    }
+
+    @PostMapping("/page")
+    public Result page(@RequestBody Map<String,String> paramsMap){
+        String pageNum = paramsMap.get("pageNum");
+        String pageSize = paramsMap.get("pageSize");
+        String farmId = paramsMap.get("farmId");
+        Page<BaseVisitingMid> baseVisitingPage = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
+        return new Result(ResultCode.SUCCESS,baseVisitingMidService.page(baseVisitingPage,new QueryWrapper<BaseVisitingMid>().eq("farm_id", farmId)));
+    }
 
-//      @PostMapping("/add")
-//    public Result add(HttpServletRequest httpServletRequest, @RequestBody BaseVisiting baseVisiting){
-//        return baseVisitingService.add(httpServletRequest,baseVisiting);
-//    }
-//
-//    @PostMapping("/delete")
-//    public Result delete(@RequestBody Map<String,String> paramsMap){
-//        String id = paramsMap.get("id");
-//        if (baseWashoutPointService.count(new QueryWrapper<BaseWashoutPoint>().lambda().eq(BaseWashoutPoint::getVisitingType,id)) > 0) {
-//            return new Result(10001,"请先删除该来访类型相关洗消点!",false);
-//        }
-//        return baseVisitingService.delete(id);
-//    }
-//
-//    @PostMapping("/page")
-//    public Result page(@RequestBody Map<String,String> paramsMap){
-//        String pageNum = paramsMap.get("pageNum");
-//        String pageSize = paramsMap.get("pageSize");
-//        Page<BaseVisiting> baseVisitingPage = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
-//        return new Result(ResultCode.SUCCESS,baseVisitingService.page(baseVisitingPage,new QueryWrapper<>()));
-//    }
-//
-//    @PostMapping("/list")
-//    public Result list(@RequestBody Map<String,String> paramsMap){
-//        return new Result(ResultCode.SUCCESS,baseVisitingService.list(new QueryWrapper<>()));
-//    }
-//
+    @PostMapping("/listByType")
+    public Result listByType(@RequestBody Map<String,String> paramsMap){
+        String farmId = paramsMap.get("farmId");
+        String type = paramsMap.get("type");
+        if ("7".equals(type)) {
+            type = "0";
+        }
+        return new Result(ResultCode.SUCCESS, baseVisitingMidService.list(new QueryWrapper<BaseVisitingMid>().eq("farm_id", farmId).eq("visiting_type",type)));
+    }
 
 }

+ 14 - 6
huimv-receive/src/main/java/com/huimv/receive/controller/BillPersonnelAdmissionController.java

@@ -69,8 +69,12 @@ public class BillPersonnelAdmissionController {
                                @RequestParam(value = "picture1",required = false) MultipartFile picture1,
                                @RequestParam(value = "picture2",required = false) MultipartFile picture2,
                                @RequestParam(value = "picture3",required = false) MultipartFile picture3,
-                               @RequestParam("farmId") String farmId) throws IOException {
-        return billPersonnelAdmissionService.addAdmission(httpServletRequest, admissionType, vistitType, userName, phone, workName, papersType, papersCode, imgUrl, img, vistitDate, vistitReson, destId, destName, farmId, carNum, source, goods, departureId, departureName, picture1, picture2, picture3);
+                               @RequestParam("farmId") String farmId,
+                               @RequestParam("midId") Integer midId,
+                               @RequestParam("midName") String midName) throws IOException {
+        return billPersonnelAdmissionService.addAdmission(httpServletRequest, admissionType, vistitType, userName, phone,
+                workName, papersType, papersCode, imgUrl, img, vistitDate, vistitReson, destId, destName, farmId, carNum,
+                source, goods, departureId, departureName, picture1, picture2, picture3,midId,midName);
     }
 
     @PostMapping("/addAdmissionFeed")
@@ -97,10 +101,12 @@ public class BillPersonnelAdmissionController {
                                    @RequestParam("feedImgUrl") MultipartFile feedImgUrl,
                                    @RequestParam(value = "cleanId", required = false) Integer cleanId,
                                    @RequestParam(value = "cleanName", required = false) String cleanName,
-                                   @RequestParam("remark") String remark) throws IOException {
+                                   @RequestParam("remark") String remark,
+                                   @RequestParam("midId") Integer midId,
+                                   @RequestParam("midName") String midName) throws IOException {
         return billPersonnelAdmissionService.addAdmissionFeed(httpServletRequest, admissionType,
                 vistitType, userName, phone, workName, papersType, papersCode, imgUrl, img, vistitDate, vistitReson, destId
-                , destName, farmId, carNum, source, goods, departureId, departureName, resource, feedImgUrl, cleanId, cleanName, remark);
+                , destName, farmId, carNum, source, goods, departureId, departureName, resource, feedImgUrl, cleanId, cleanName, remark,midId,midName);
     }
 
     @PostMapping("/listPersonalAdmission")
@@ -288,10 +294,12 @@ public class BillPersonnelAdmissionController {
                                    @RequestParam("farmId") String farmId,
                                    @RequestParam(value = "picture1",required = false) MultipartFile picture1,
                                    @RequestParam(value = "picture2",required = false) MultipartFile picture2,
-                                   @RequestParam(value = "picture3",required = false) MultipartFile picture3) throws IOException {
+                                   @RequestParam(value = "picture3",required = false) MultipartFile picture3,
+                                   @RequestParam("midId") Integer midId,
+                                   @RequestParam("midName") String midName) throws IOException {
         return billPersonnelAdmissionService.helpAddAdmission(httpServletRequest, userImgUrl, admissionType,
                 vistitType, userName, phone, workName, papersType, papersCode, imgUrl, img, vistitDate, vistitReson,
-                destId, destName, farmId, carNum, source, goods, departureId, departureName,picture1,picture2,picture3);
+                destId, destName, farmId, carNum, source, goods, departureId, departureName,picture1,picture2,picture3,midId,midName);
     }
 
 }

+ 3 - 3
huimv-receive/src/main/java/com/huimv/receive/controller/LoginController.java

@@ -316,8 +316,8 @@ public class LoginController {
     public Result logoutWeChat(HttpServletRequest req, @RequestParam String jsCode,@RequestParam String phone) {
         String remoteHost = req.getRemoteHost();
         Map<String, Object> paramsMap = new HashMap<>();
-        paramsMap.put("appid", "wxa28e45fe5cb10ff1");
-        paramsMap.put("secret", "c16e584ec6e69fd35edd98ec21ec5e94");
+        paramsMap.put("appid", "wx221c66f51278c05f");
+        paramsMap.put("secret", "b553cf2e2de240ac93db6b6c8d135f55");
         paramsMap.put("js_code", jsCode);
         paramsMap.put("grant_type", "authorization_code");
         String result = HttpUtil.get("https://api.weixin.qq.com/sns/jscode2session", paramsMap);
@@ -407,7 +407,7 @@ public class LoginController {
     public Result logWeChatGetPhone(HttpServletRequest req, @RequestParam String jsCode) {
         String access_token ="";
         if ( !redisTemplate.hasKey("weChatGetPhone") || redisTemplate.getExpire("weChatGetPhone") ==null || redisTemplate.getExpire("weChatGetPhone") <=0){
-            String result = HttpUtil.get("https://api.weixin.qq.com/cgi-bin/token?appid=wxa28e45fe5cb10ff1&secret=c16e584ec6e69fd35edd98ec21ec5e94&grant_type=client_credential");
+            String result = HttpUtil.get("https://api.weixin.qq.com/cgi-bin/token?appid=wx221c66f51278c05f&secret=b553cf2e2de240ac93db6b6c8d135f55&grant_type=client_credential");
             System.out.println(result);
             JSONObject jsonObject = JSON.parseObject(result);
             access_token =  (String) jsonObject.get("access_token");

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

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.Date;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -31,11 +33,15 @@ public class BaseVisitingMid implements Serializable {
     /**
      * 来访类型名称
      */
+
     private String visitingName;
 
-    private LocalDateTime createTime;
+    private Date createTime;
 
     private Integer createUser;
 
+    private Integer visitingType;
+
+    private Integer farmId;
 
 }

+ 3 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/BaseWashoutPoint.java

@@ -86,5 +86,8 @@ public class BaseWashoutPoint implements Serializable {
      */
     private Integer visitingType;
 
+    private Integer midId;
+
+    private String midName;
 
 }

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

@@ -129,4 +129,8 @@ public class BillClean implements Serializable {
     private String cleanName;
 
     private String remark;
+
+    private Integer midId;
+
+    private String midName;
 }

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

@@ -140,4 +140,8 @@ public class BillCleanBefore implements Serializable {
     private String cleanName;
 
     private String remark;
+
+    private Integer midId;
+
+    private String midName;
 }

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

@@ -144,5 +144,8 @@ public class BillDry implements Serializable {
 
     private String remark;
 
+    private Integer midId;
+
+    private String midName;
 
 }

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

@@ -130,4 +130,8 @@ public class BillGoodsInventory implements Serializable {
     private Integer processId;
 
     private String wayType;
+
+    private Integer midId;
+
+    private String midName;
 }

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

@@ -150,4 +150,7 @@ public class BillIsolate implements Serializable {
 
     private String remark;
 
+    private Integer midId;
+
+    private String midName;
 }

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

@@ -150,4 +150,8 @@ public class BillPcr implements Serializable {
     private String picUrl;
 
     private Integer samplingId;
+
+    private Integer midId;
+
+    private String midName;
 }

+ 4 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/BillPersonnelAdmission.java

@@ -166,4 +166,8 @@ public class BillPersonnelAdmission implements Serializable {
      * 物品照片地址
      */
     private String picUrl;
+
+    private Integer midId;
+
+    private String midName;
 }

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

@@ -152,4 +152,8 @@ public class BillSampling implements Serializable {
      */
     private String picUrl;
 
+    private Integer midId;
+
+    private String midName;
+
 }

+ 4 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/dto/GetWashoutPointDto.java

@@ -17,4 +17,8 @@ public class GetWashoutPointDto {
 
     /*洗消点集合*/
     private List<WashListDto> washListDtos;
+
+    private String midName;
+
+    private Integer midId;
 }

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

@@ -1,5 +1,6 @@
 package com.huimv.receive.service;
 
+import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.entity.BaseVisitingMid;
 import com.baomidou.mybatisplus.extension.service.IService;
 
@@ -13,4 +14,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IBaseVisitingMidService extends IService<BaseVisitingMid> {
 
+    Result add(BaseVisitingMid baseVisitingMid);
+
+    Result update(BaseVisitingMid baseVisitingMid);
+
 }

+ 12 - 5
huimv-receive/src/main/java/com/huimv/receive/service/IBillPersonnelAdmissionService.java

@@ -41,10 +41,17 @@ public interface IBillPersonnelAdmissionService extends IService<BillPersonnelAd
     Result listByIdClean(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
     Result editClean(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException;
     Result editDry(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException;
-    Result addAdmission(HttpServletRequest httpServletRequest, String admissionType, String vistitType, String userName, String phone, String workName, String papersType, String papersCode, MultipartFile imgUrl, String img, String vistitDate, String vistitReson, String destId, String destName, String farmId, String carNum, String source, String goods, String departureId, String departureName, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws IOException;
-    Result addAdmissionFeed(HttpServletRequest httpServletRequest, String admissionType, String vistitType, String userName, String phone, String workName, String papersType, String papersCode, MultipartFile imgUrl, String img, String vistitDate, String vistitReson, String destId, String destName,
-                            String farmId, String carNum, String source, String goods, String departureId, String departureName,
-                            String resource, MultipartFile feedImgUrl, Integer cleanId, String cleanName, String remark) throws IOException;
+    Result addAdmission(HttpServletRequest httpServletRequest, String admissionType, String vistitType, String userName
+            , String phone, String workName, String papersType, String papersCode, MultipartFile imgUrl, String img,
+                        String vistitDate, String vistitReson, String destId, String destName, String farmId,
+                        String carNum, String source, String goods, String departureId, String departureName,
+                        MultipartFile picture1, MultipartFile picture2, MultipartFile picture3,Integer midId,String midName) throws IOException;
+    Result addAdmissionFeed(HttpServletRequest httpServletRequest, String admissionType, String vistitType,
+                            String userName, String phone, String workName, String papersType, String papersCode,
+                            MultipartFile imgUrl, String img, String vistitDate, String vistitReson, String destId,
+                            String destName, String farmId, String carNum, String source, String goods, String departureId,
+                            String departureName, String resource, MultipartFile feedImgUrl, Integer cleanId,
+                            String cleanName, String remark,Integer midId,String midName) throws IOException;
 
     Result listPersonalAdmission(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
@@ -86,5 +93,5 @@ public interface IBillPersonnelAdmissionService extends IService<BillPersonnelAd
                             String phone, String workName, String papersType, String papersCode, MultipartFile imgUrl,
                             String img, String vistitDate, String vistitReson, String destId, String destName,
                             String farmId, String carNum, String source, String goods, String departureId, String departureName,
-                            MultipartFile picture1,MultipartFile picture2,MultipartFile picture3) throws IOException;
+                            MultipartFile picture1,MultipartFile picture2,MultipartFile picture3,Integer midId,String midName) throws IOException;
 }

+ 52 - 0
huimv-receive/src/main/java/com/huimv/receive/service/impl/BaseVisitingMidServiceImpl.java

@@ -1,9 +1,16 @@
 package com.huimv.receive.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.huimv.receive.common.utils.Result;
+import com.huimv.receive.common.utils.ResultCode;
 import com.huimv.receive.entity.BaseVisitingMid;
+import com.huimv.receive.entity.BaseWashoutPoint;
 import com.huimv.receive.mapper.BaseVisitingMidMapper;
+import com.huimv.receive.mapper.BaseWashoutPointMapper;
 import com.huimv.receive.service.IBaseVisitingMidService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 /**
@@ -17,4 +24,49 @@ import org.springframework.stereotype.Service;
 @Service
 public class BaseVisitingMidServiceImpl extends ServiceImpl<BaseVisitingMidMapper, BaseVisitingMid> implements IBaseVisitingMidService {
 
+    @Autowired
+    private BaseVisitingMidMapper midMapper;
+    @Autowired
+    private BaseWashoutPointMapper pointMapper;
+
+    @Override
+    public Result add(BaseVisitingMid baseVisitingMid) {
+        Integer visitingType = baseVisitingMid.getVisitingType();
+        String visitingName = baseVisitingMid.getVisitingName();
+        Integer farmId = baseVisitingMid.getFarmId();
+        QueryWrapper<BaseVisitingMid> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("visiting_type", visitingType).eq("visiting_name", visitingName).eq("farm_id", farmId);
+        BaseVisitingMid visitingMid = midMapper.selectOne(queryWrapper);
+        if (ObjectUtil.isNotEmpty(visitingMid)) {
+            return new Result(10001,"同类型的流程名称已存在!",false);
+        } else {
+            midMapper.insert(baseVisitingMid);
+            return new Result(ResultCode.SUCCESS);
+        }
+
+    }
+
+    @Override
+    public Result update(BaseVisitingMid baseVisitingMid) {
+        Integer visitingType = baseVisitingMid.getVisitingType();
+        String visitingName = baseVisitingMid.getVisitingName();
+        Integer farmId = baseVisitingMid.getFarmId();
+        QueryWrapper<BaseVisitingMid> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("visiting_type", visitingType).eq("visiting_name", visitingName)
+                .ne("id", baseVisitingMid.getId()).eq("farm_id", farmId);
+        Integer count = midMapper.selectCount(queryWrapper);
+        if (0 == count) {
+            midMapper.updateById(baseVisitingMid);
+            QueryWrapper<BaseWashoutPoint> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("mid_id", baseVisitingMid.getId());
+            BaseWashoutPoint washoutPoint = pointMapper.selectOne(queryWrapper1);
+            if (ObjectUtil.isNotEmpty(washoutPoint)) {
+                washoutPoint.setMidName(baseVisitingMid.getVisitingName());
+                pointMapper.updateById(washoutPoint);
+            }
+            return new Result(ResultCode.SUCCESS);
+        } else {
+            return new Result(10001,"同类型的流程名称已存在!",false);
+        }
+    }
 }

+ 19 - 14
huimv-receive/src/main/java/com/huimv/receive/service/impl/BaseWashoutPointServiceImpl.java

@@ -8,15 +8,13 @@ import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.ResultCode;
 import com.huimv.receive.entity.BaseProcess;
 import com.huimv.receive.entity.BaseVisiting;
+import com.huimv.receive.entity.BaseVisitingMid;
 import com.huimv.receive.entity.BaseWashoutPoint;
 import com.huimv.receive.entity.dto.GetWashoutPointDto;
 import com.huimv.receive.entity.dto.WashListDto;
 import com.huimv.receive.entity.vo.DestVo;
 import com.huimv.receive.entity.vo.WashOutVo;
-import com.huimv.receive.mapper.BaseProcessMapper;
-import com.huimv.receive.mapper.BaseVisitingMapper;
-import com.huimv.receive.mapper.BaseWashoutPointMapper;
-import com.huimv.receive.mapper.SysAccountMultilevelMapper;
+import com.huimv.receive.mapper.*;
 import com.huimv.receive.service.IBaseWashoutPointService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -46,19 +44,22 @@ public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMap
     private SysAccountMultilevelMapper accountMultilevelMapper;
     @Autowired
     private BaseProcessMapper processMapper;
+    @Autowired
+    private BaseVisitingMidMapper midMapper;
 
     @Override
     public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
         String farmId = paramsMap.get("farmId");
-        List<BaseVisiting> visitings = visitingMapper.selectList(new QueryWrapper<>());
+        List<BaseVisitingMid> midList = midMapper.selectList(new QueryWrapper<BaseVisitingMid>().eq("farm_id", farmId));
+//        List<BaseVisiting> visitings = visitingMapper.selectList(new QueryWrapper<>());
         List<GetWashoutPointDto> washoutPointDtos = new ArrayList<>();
-        if (ObjectUtil.isEmpty(visitings)) {
+        if (ObjectUtil.isEmpty(midList)) {
             return new Result(ResultCode.SUCCESS, washoutPointDtos);
         } else {
-            for (BaseVisiting visiting : visitings) {
+            for (BaseVisitingMid visiting : midList) {
                 Integer type = visiting.getId();
                 List<BaseWashoutPoint> list = washoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>()
-                        .eq("farm_ids", farmId).eq("visiting_type", type));
+                        .eq("farm_ids", farmId).eq("mid_id", type));
                 List<WashListDto> washListDtos = new ArrayList<>();
                 if (list.size() != 0) {
                     for (BaseWashoutPoint point : list) {
@@ -72,7 +73,9 @@ public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMap
                     GetWashoutPointDto getWashoutPointDto = new GetWashoutPointDto();
                     getWashoutPointDto.setFarmIds(farmId);
                     getWashoutPointDto.setNumber(list.size());
-                    getWashoutPointDto.setVisitingType(type);
+                    getWashoutPointDto.setVisitingType(visiting.getVisitingType());
+                    getWashoutPointDto.setMidId(visiting.getId());
+                    getWashoutPointDto.setMidName(visiting.getVisitingName());
                     getWashoutPointDto.setWashListDtos(washListDtos);
                     washoutPointDtos.add(getWashoutPointDto);
                 }
@@ -112,6 +115,8 @@ public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMap
                 washoutPoint.setTailLocationName(washListDto.getNextName());
                 washoutPoint.setFarmIds(farmId);
                 washoutPoint.setPointLevel(i);
+                washoutPoint.setMidName(washoutPointDto.getMidName());
+                washoutPoint.setMidId(washoutPointDto.getMidId());
                 washoutPointMapper.insert(washoutPoint);
                 i++;
             }
@@ -132,10 +137,10 @@ public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMap
     @Override
     public Result listDest(Map<String, String> paramsMap) {
         String farmId = paramsMap.get("farmId");
-        String vistitType = paramsMap.get("vistitType");
-        if ("0".equals(vistitType)){
-            vistitType=  "7";
-        }
+        String vistitType = paramsMap.get("midId");
+//        if ("0".equals(vistitType)){
+//            vistitType=  "7";
+//        }
         List<BaseWashoutPoint> baseWashoutPointList = washoutPointMapper.listDest(farmId,vistitType);
         List<DestVo> destVoList = new ArrayList<>();
         for (BaseWashoutPoint baseWashoutPoint : baseWashoutPointList) {
@@ -150,7 +155,7 @@ public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMap
     @Override
     public Result listWash(Map<String, String> paramsMap) {
         String farmId = paramsMap.get("farmId");
-        String vistitType = paramsMap.get("vistitType");
+        String vistitType = paramsMap.get("midId");
         List<BaseWashoutPoint> points = washoutPointMapper.listWash(farmId, vistitType);
         List<DestVo> destVoList = new ArrayList<>();
         for (BaseWashoutPoint baseWashoutPoint : points) {

+ 3 - 2
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanBeforeServiceImpl.java

@@ -166,7 +166,8 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
         Object newObject = BillPcrServiceImpl.getNewObject(nextId, cleanBefore.getDestName(), cleanBefore.getDestId(), cleanBefore.getAdmissionUserName(),
                 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.getVistitType(), cleanBefore.getPhone(), cleanBefore.getDepartureName(), cleanBefore.getDepartureId()
+                ,cleanBefore.getMidId(),cleanBefore.getMidName());
         if (nextId == 0) {
             if (split.length == 1) {
                 baseProcess.setProcessType(1);
@@ -196,7 +197,7 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
                 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());
+                        , baseProcess.getId(), cleanBefore.getDepartureName(), cleanBefore.getDepartureId(),cleanBefore.getMidId(),cleanBefore.getMidName());
                 if (Integer.parseInt(split[1]) == 1) {
                     //新增采样
                     BillSampling billSampling = (BillSampling) entity;

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

@@ -910,7 +910,7 @@ 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.getVistitType(), billClean.getPhone(), billClean.getDepartureName(), billClean.getDepartureId(),billClean.getMidId(),billClean.getMidName());
                 if (nextId == 0) {
                     if (splits.length == 1) {
                         baseProcess.setProcessType(1);
@@ -940,7 +940,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                         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());
+                                , baseProcess.getId(), billClean.getDepartureName(), billClean.getDepartureId(),billClean.getMidId(),billClean.getMidName());
                         if (Integer.parseInt(splits[1]) == 1) {
                             //新增采样
                             BillSampling billSampling = (BillSampling) entity;
@@ -1226,7 +1226,7 @@ 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.getVistitType(), billClean.getPhone(), billClean.getDepartureName(), billClean.getDepartureId(),billClean.getMidId(),billClean.getMidName());
                     if (nextId == 0) {
                         if (splits.length == 1) {
                             baseProcess.setProcessType(1);
@@ -1256,7 +1256,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                             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());
+                                    , baseProcess.getId(), billClean.getDepartureName(), billClean.getDepartureId(),billClean.getMidId(),billClean.getMidName());
                             if (Integer.parseInt(splits[1]) == 1) {
                                 //新增采样
                                 BillSampling billSampling = (BillSampling) entity;

+ 3 - 2
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillGoodsInventoryServiceImpl.java

@@ -126,7 +126,8 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
         Object newObject = BillPcrServiceImpl.getNewObject(nextId, goodsInventory.getDestName(), goodsInventory.getDestId(), goodsInventory.getAdmissionUserName(),
                 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.getVistitType(), goodsInventory.getPhone(), goodsInventory.getDepartureName(), goodsInventory.getDepartureId()
+                ,goodsInventory.getMidId(),goodsInventory.getMidName());
         if (nextId == 0) {
             if (split.length == 1) {
                 baseProcess.setProcessType(1);
@@ -156,7 +157,7 @@ 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());
+                        , baseProcess.getId(), goodsInventory.getDepartureName(), goodsInventory.getDepartureId(),goodsInventory.getMidId(),goodsInventory.getMidName());
                 if (Integer.parseInt(split[1]) == 1) {
                     //新增采样
                     BillSampling billSampling = (BillSampling) entity;

+ 19 - 4
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPcrServiceImpl.java

@@ -435,7 +435,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
         } else {
             if ("1".equals(result)) {
                 Integer pcrTime = washoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().eq("farm_ids", farmId)
-                        .eq("visiting_type", billPcr.getVistitType()).eq("location_id", baseLocation.getId())).getPcrTime();
+                        .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));
@@ -450,7 +451,7 @@ 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.getVistitType(), billPcr.getPhone(), billPcr.getDepartureName(), billPcr.getDepartureId(),billPcr.getMidId(),billPcr.getMidName());
                 System.out.println("这里是pcr通过的下一个流程id:" + nextId);
                 if (nextId == 0) {
                     if (split.length == 1) {
@@ -481,7 +482,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
                         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());
+                                , baseProcess.getId(), billPcr.getDepartureName(), billPcr.getDepartureId(),billPcr.getMidId(),billPcr.getMidName());
                         if (Integer.parseInt(split[1]) == 1) {
                             //新增采样
                             BillSampling billSampling = (BillSampling) entity;
@@ -858,7 +859,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 testLocationId, Integer vistitType, String phone, String departureName, Integer departureId,Integer midId,String midName) {
         if (id == 1) {
             //采样
             BillSampling billSampling = new BillSampling();
@@ -876,6 +877,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billSampling.setFarmId(String.valueOf(farmId));
             billSampling.setDepartureName(departureName);
             billSampling.setDepartureId(departureId);
+            billSampling.setMidId(midId);
+            billSampling.setMidName(midName);
             return billSampling;
         }
         if (id == 2) {
@@ -896,6 +899,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billPcr.setTestLocation(testLocation);
             billPcr.setDepartureName(departureName);
             billPcr.setDepartureId(departureId);
+            billPcr.setMidId(midId);
+            billPcr.setMidName(midName);
             return billPcr;
         }
         if (id == 3) {
@@ -916,6 +921,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billPcr.setTestLocation(testLocation);
             billPcr.setDepartureName(departureName);
             billPcr.setDepartureId(departureId);
+            billPcr.setMidId(midId);
+            billPcr.setMidName(midName);
             return billPcr;
         }
         if (id == 4) {
@@ -936,6 +943,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billPcr.setIsolateLocationId(testLocationId);
             billPcr.setDepartureName(departureName);
             billPcr.setDepartureId(departureId);
+            billPcr.setMidId(midId);
+            billPcr.setMidName(midName);
             return billPcr;
         }
         if (id == 5) {
@@ -956,6 +965,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billPcr.setTestLocation(testLocation);
             billPcr.setDepartureName(departureName);
             billPcr.setDepartureId(departureId);
+            billPcr.setMidId(midId);
+            billPcr.setMidName(midName);
             return billPcr;
         }
         if (id == 6) {
@@ -976,6 +987,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billCleanBefore.setFarmId(String.valueOf(farmId));
             billCleanBefore.setDepartureName(departureName);
             billCleanBefore.setDepartureId(departureId);
+            billCleanBefore.setMidId(midId);
+            billCleanBefore.setMidName(midName);
             return billCleanBefore;
         }
 
@@ -998,6 +1011,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billCleanBefore.setDepartureName(departureName);
             billCleanBefore.setDepartureId(departureId);
             billCleanBefore.setProcessId(processId);
+            billCleanBefore.setMidId(midId);
+            billCleanBefore.setMidName(midName);
             return billCleanBefore;
         }
         return null;

+ 85 - 30
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPersonnelAdmissionServiceImpl.java

@@ -103,7 +103,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                                MultipartFile imgUrl, String img, String vistitDate, String vistitReson, String destId,
                                String destName, String farmId, String carNum, String source, String goods,
                                String departureId, String departureName, MultipartFile picture1, MultipartFile picture2,
-                               MultipartFile picture3) throws IOException {
+                               MultipartFile picture3,Integer midId,String midName) throws IOException {
         Integer userId = TokenSign.getMemberIdByJwtToken(httpServletRequest);
         if (!PhoneNumberValidator.isValidPhoneNumber(phone)) {
             return new Result(10001, "手机号格式错误!", false);
@@ -113,8 +113,12 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                 return new Result(10001, "身份证号格式错误!", false);
             }
         }
-        BaseWashoutPoint baseWashoutPoint1 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda().eq(BaseWashoutPoint::getLocationId, departureId).like(BaseWashoutPoint::getFarmIds, farmId).eq(BaseWashoutPoint::getVisitingType, vistitType));
-        BaseWashoutPoint baseWashoutPoint2 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda().eq(BaseWashoutPoint::getLocationId, destId).like(BaseWashoutPoint::getFarmIds, farmId).eq(BaseWashoutPoint::getVisitingType, vistitType));
+        BaseWashoutPoint baseWashoutPoint1 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda()
+                .eq(BaseWashoutPoint::getLocationId, departureId).like(BaseWashoutPoint::getFarmIds, farmId)
+                .eq(BaseWashoutPoint::getVisitingType, vistitType).eq(BaseWashoutPoint::getMidId,midId));
+        BaseWashoutPoint baseWashoutPoint2 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda()
+                .eq(BaseWashoutPoint::getLocationId, destId).like(BaseWashoutPoint::getFarmIds, farmId)
+                .eq(BaseWashoutPoint::getVisitingType, vistitType).eq(BaseWashoutPoint::getMidId,midId));
         if (!departureId.equals("0")){
             if (baseWashoutPoint1.getPointLevel()>=baseWashoutPoint2.getPointLevel()){
                 return new Result(10001, "出发地应在目的地之前!", false);
@@ -214,10 +218,19 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         List<BaseWashoutPoint> baseWashoutPoints = new ArrayList<>();
         if (ObjectUtil.isEmpty(baseWashoutPoint1)){
             System.out.println("出发地为场外");
-            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda().le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel()).eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId).orderByAsc(BaseWashoutPoint::getPointLevel));
+            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda()
+                    .le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel())
+                    .eq(BaseWashoutPoint::getMidId,midId)
+                    .eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId)
+                    .orderByAsc(BaseWashoutPoint::getPointLevel));
         }else {
             System.out.println("出发地不为场外");
-            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda().gt(BaseWashoutPoint::getPointLevel,baseWashoutPoint1.getPointLevel()).le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel()).eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId).orderByAsc(BaseWashoutPoint::getPointLevel));
+            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda()
+                    .gt(BaseWashoutPoint::getPointLevel,baseWashoutPoint1.getPointLevel())
+                    .le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel())
+                    .eq(BaseWashoutPoint::getMidId,midId)
+                    .eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId)
+                    .orderByAsc(BaseWashoutPoint::getPointLevel));
         }
         System.out.println("所有洗消点:"+baseWashoutPoints);
         for (BaseWashoutPoint baseWashoutPoint : baseWashoutPoints) {
@@ -250,9 +263,12 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         baseProcess.setFarmId(Integer.parseInt(farmId));
         baseProcessMapper.insert(baseProcess);
         billPersonnelAdmission.setProcessId(baseProcess.getId());
+        billPersonnelAdmission.setMidId(midId);
+        billPersonnelAdmission.setMidName(midName);
         billPersonnelAdmissionMapper.insert(billPersonnelAdmission);
         ArrayList<String> phoneList = new ArrayList<>();
-        List<SysAccountMultilevel> safe = sysAccountMultilevelMapper.selectList(new QueryWrapper<SysAccountMultilevel>().eq("farm_ids", farmId).eq("type", 3));
+        List<SysAccountMultilevel> safe = sysAccountMultilevelMapper.selectList(new QueryWrapper<SysAccountMultilevel>()
+                .eq("farm_ids", farmId).eq("type", 3));
         for (SysAccountMultilevel sysAccountMultilevel : safe) {
             phoneList.add(sysAccountMultilevel.getPhone());
         }
@@ -275,10 +291,13 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
     }
 
     @Override
-    public Result addAdmissionFeed(HttpServletRequest httpServletRequest, String admissionType, String vistitType, String userName, String phone, String workName, String papersType, String papersCode, MultipartFile imgUrl, String img, String vistitDate, String vistitReson, String destId, String destName,
+    public Result addAdmissionFeed(HttpServletRequest httpServletRequest, String admissionType, String vistitType,
+                                   String userName, String phone, String workName, String papersType, String papersCode,
+                                   MultipartFile imgUrl, String img, String vistitDate, String vistitReson, String destId, String destName,
                                    String farmId, String carNum, String source,
                                    String goods, String departureId, String departureName,
-                                   String resource, MultipartFile feedImgUrl,Integer cleanId,String cleanName,String remark) throws IOException {
+                                   String resource, MultipartFile feedImgUrl,Integer cleanId,String cleanName,
+                                   String remark,Integer midId,String midName) throws IOException {
         Integer userId = TokenSign.getMemberIdByJwtToken(httpServletRequest);
         if (!PhoneNumberValidator.isValidPhoneNumber(phone)) {
             return new Result(10001, "手机号格式错误!", false);
@@ -288,8 +307,14 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                 return new Result(10001, "身份证号格式错误!", false);
             }
         }
-        BaseWashoutPoint baseWashoutPoint1 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda().eq(BaseWashoutPoint::getLocationId, departureId).like(BaseWashoutPoint::getFarmIds, farmId).eq(BaseWashoutPoint::getVisitingType, vistitType));
-        BaseWashoutPoint baseWashoutPoint2 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda().eq(BaseWashoutPoint::getLocationId, destId).like(BaseWashoutPoint::getFarmIds, farmId).eq(BaseWashoutPoint::getVisitingType, vistitType));
+        BaseWashoutPoint baseWashoutPoint1 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>()
+                .lambda().eq(BaseWashoutPoint::getLocationId, departureId).like(BaseWashoutPoint::getFarmIds, farmId)
+                .eq(BaseWashoutPoint::getVisitingType, vistitType)
+                .eq(BaseWashoutPoint::getMidId,midId));
+        BaseWashoutPoint baseWashoutPoint2 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>()
+                .lambda().eq(BaseWashoutPoint::getLocationId, destId).like(BaseWashoutPoint::getFarmIds, farmId)
+                .eq(BaseWashoutPoint::getVisitingType, vistitType)
+                .eq(BaseWashoutPoint::getMidId,midId));
         if (!departureId.equals("0")){
             if (baseWashoutPoint1.getPointLevel()>=baseWashoutPoint2.getPointLevel()){
                 return new Result(10001, "出发地应在目的地之前!", false);
@@ -357,9 +382,18 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
 
         List<BaseWashoutPoint> baseWashoutPoints = new ArrayList<>();
         if (ObjectUtil.isEmpty(baseWashoutPoint1)){
-            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda().le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel()).eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId).orderByAsc(BaseWashoutPoint::getPointLevel));
+            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda()
+                    .le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel())
+                    .eq(BaseWashoutPoint::getMidId,midId)
+                    .eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId)
+                    .orderByAsc(BaseWashoutPoint::getPointLevel));
         }else {
-            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda().gt(BaseWashoutPoint::getPointLevel,baseWashoutPoint1.getPointLevel()).le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel()).eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId).orderByAsc(BaseWashoutPoint::getPointLevel));
+            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>()
+                    .lambda().gt(BaseWashoutPoint::getPointLevel,baseWashoutPoint1.getPointLevel())
+                    .le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel())
+                    .eq(BaseWashoutPoint::getMidId,midId)
+                    .eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId)
+                    .orderByAsc(BaseWashoutPoint::getPointLevel));
         }
         for (BaseWashoutPoint baseWashoutPoint : baseWashoutPoints) {
             allLocation = allLocation + "," + baseLocationMapper.selectById(baseWashoutPoint.getLocationId()).getLocationName();
@@ -384,9 +418,12 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         baseProcess.setFarmId(Integer.parseInt(farmId));
         baseProcessMapper.insert(baseProcess);
         billPersonnelAdmission.setProcessId(baseProcess.getId());
+        billPersonnelAdmission.setMidId(midId);
+        billPersonnelAdmission.setMidName(midName);
         billPersonnelAdmissionMapper.insert(billPersonnelAdmission);
         ArrayList<String> phoneList = new ArrayList<>();
-        List<SysAccountMultilevel> safe = sysAccountMultilevelMapper.selectList(new QueryWrapper<SysAccountMultilevel>().eq("farm_ids", farmId).eq("type", 3));
+        List<SysAccountMultilevel> safe = sysAccountMultilevelMapper.selectList(new QueryWrapper<SysAccountMultilevel>()
+                .eq("farm_ids", farmId).eq("type", 3));
         for (SysAccountMultilevel sysAccountMultilevel : safe) {
             phoneList.add(sysAccountMultilevel.getPhone());
         }
@@ -561,7 +598,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId());
+                            billPersonnelAdmission.getDepartureId(),billPersonnelAdmission.getMidId(),billPersonnelAdmission.getMidName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())){
                         billSampling.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -595,7 +632,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId());
+                            billPersonnelAdmission.getDepartureId(),billPersonnelAdmission.getMidId(),billPersonnelAdmission.getMidName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())){
                         billPcr.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -629,7 +666,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId());
+                            billPersonnelAdmission.getDepartureId(),billPersonnelAdmission.getMidId(),billPersonnelAdmission.getMidName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())){
                         billClean.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -663,7 +700,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId());
+                            billPersonnelAdmission.getDepartureId(),billPersonnelAdmission.getMidId(),billPersonnelAdmission.getMidName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())){
                         billIsolate.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -697,7 +734,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId());
+                            billPersonnelAdmission.getDepartureId(),billPersonnelAdmission.getMidId(),billPersonnelAdmission.getMidName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())){
                         billDry.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -731,7 +768,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId());
+                            billPersonnelAdmission.getDepartureId(),billPersonnelAdmission.getMidId(),billPersonnelAdmission.getMidName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())){
                         billCleanBefore.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -765,7 +802,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                             billPersonnelAdmission.getFarmId(),
                             baseProcess.getId(),
                             billPersonnelAdmission.getDepartureName(),
-                            billPersonnelAdmission.getDepartureId());
+                            billPersonnelAdmission.getDepartureId(),billPersonnelAdmission.getMidId(),billPersonnelAdmission.getMidName());
                     if (ObjectUtil.isNotEmpty(billPersonnelAdmission.getCarNum())){
                         billCleanBefore.setCarNum(billPersonnelAdmission.getCarNum());
                     }
@@ -1279,7 +1316,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                                    String papersCode, MultipartFile imgUrl, String img, String vistitDate,
                                    String vistitReson, String destId, String destName, String farmId, String carNum,
                                    String source, String goods, String departureId, String departureName,
-                                   MultipartFile picture1,MultipartFile picture2,MultipartFile picture3) throws IOException {
+                                   MultipartFile picture1,MultipartFile picture2,MultipartFile picture3,Integer midId,String midName) throws IOException {
         if (!PhoneNumberValidator.isValidPhoneNumber(phone)) {
             return new Result(10001, "手机号格式错误!", false);
         }
@@ -1350,8 +1387,14 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
 
 
 
-        BaseWashoutPoint baseWashoutPoint1 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda().eq(BaseWashoutPoint::getLocationId, departureId).like(BaseWashoutPoint::getFarmIds, farmId).eq(BaseWashoutPoint::getVisitingType, vistitType));
-        BaseWashoutPoint baseWashoutPoint2 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda().eq(BaseWashoutPoint::getLocationId, destId).like(BaseWashoutPoint::getFarmIds, farmId).eq(BaseWashoutPoint::getVisitingType, vistitType));
+        BaseWashoutPoint baseWashoutPoint1 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda()
+                .eq(BaseWashoutPoint::getLocationId, departureId).like(BaseWashoutPoint::getFarmIds, farmId)
+                .eq(BaseWashoutPoint::getMidId,midId)
+                .eq(BaseWashoutPoint::getVisitingType, vistitType));
+        BaseWashoutPoint baseWashoutPoint2 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda()
+                .eq(BaseWashoutPoint::getLocationId, destId).like(BaseWashoutPoint::getFarmIds, farmId)
+                .eq(BaseWashoutPoint::getMidId,midId)
+                .eq(BaseWashoutPoint::getVisitingType, vistitType));
         if (!departureId.equals("0")){
             if (baseWashoutPoint1.getPointLevel()>=baseWashoutPoint2.getPointLevel()){
                 return new Result(10001, "出发地应在目的地之前!", false);
@@ -1415,10 +1458,19 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         List<BaseWashoutPoint> baseWashoutPoints = new ArrayList<>();
         if (ObjectUtil.isEmpty(baseWashoutPoint1)){
             System.out.println("出发地为场外");
-            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda().le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel()).eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId).orderByAsc(BaseWashoutPoint::getPointLevel));
+            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda()
+                    .le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel())
+                    .eq(BaseWashoutPoint::getMidId,midId)
+                    .eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId)
+                    .orderByAsc(BaseWashoutPoint::getPointLevel));
         }else {
             System.out.println("出发地不为场外");
-            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda().gt(BaseWashoutPoint::getPointLevel,baseWashoutPoint1.getPointLevel()).le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel()).eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId).orderByAsc(BaseWashoutPoint::getPointLevel));
+            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda()
+                    .gt(BaseWashoutPoint::getPointLevel,baseWashoutPoint1.getPointLevel())
+                    .le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel())
+                    .eq(BaseWashoutPoint::getMidId,midId)
+                    .eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId)
+                    .orderByAsc(BaseWashoutPoint::getPointLevel));
         }
         System.out.println("所有洗消点:"+baseWashoutPoints);
         for (BaseWashoutPoint baseWashoutPoint : baseWashoutPoints) {
@@ -1451,6 +1503,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         baseProcess.setFarmId(Integer.parseInt(farmId));
         baseProcessMapper.insert(baseProcess);
         billPersonnelAdmission.setProcessId(baseProcess.getId());
+        billPersonnelAdmission.setMidId(midId);
+        billPersonnelAdmission.setMidName(midName);
         billPersonnelAdmissionMapper.insert(billPersonnelAdmission);
         ArrayList<String> phoneList = new ArrayList<>();
         List<SysAccountMultilevel> safe = sysAccountMultilevelMapper.selectList(new QueryWrapper<SysAccountMultilevel>().eq("farm_ids", farmId).eq("type", 3));
@@ -1621,7 +1675,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
             if ("1".equals(type)) {
 
                 Integer pcrTime = washoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().eq("farm_ids", farmId)
-                        .eq("visiting_type", billPcr.getVistitType()).eq("location_id", baseLocation.getId())).getPcrTime();
+                        .eq("visiting_type", billPcr.getVistitType()).eq("mid_id",billPcr.getMidId()).eq("location_id", baseLocation.getId())).getPcrTime();
                 billPcr.setQualifiedDate(pcrTime);
                 billPcr.setBillStatus(1);
                 billPcr.setPcrType(2);
@@ -1635,7 +1689,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.getPhone(),billPcr.getDepartureName(),billPcr.getDepartureId(),billPcr.getMidId(),billPcr.getMidName());
                 if (nextId == 0) {
                     if (split.length == 1) {
                         baseProcess.setProcessType(1);
@@ -1665,7 +1719,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                         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());
+                                , baseProcess.getId(), billPcr.getDepartureName(), billPcr.getDepartureId()
+                                ,billPcr.getMidId(),billPcr.getMidName());
                         if (Integer.parseInt(split[1]) == 1) {
                             //新增采样
                             BillSampling billSampling = (BillSampling) entity;
@@ -2063,7 +2118,7 @@ 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.getVistitType(),billIsolate.getPhone(),billIsolate.getDepartureName(),billIsolate.getDepartureId(),billIsolate.getMidId(),billIsolate.getMidName());
         if (nextId == 0) {
             if (splits.length == 1) {
                 baseProcess.setProcessType(1);
@@ -2093,7 +2148,7 @@ 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());
+                        , baseProcess.getId(), billIsolate.getDepartureName(), billIsolate.getDepartureId(),billIsolate.getMidId(),billIsolate.getMidName());
                 if (Integer.parseInt(splits[1]) == 1) {
                     //新增采样
                     BillSampling billSampling = (BillSampling) entity;

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

@@ -215,7 +215,7 @@ 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.getVistitType(), sampling.getPhone(),sampling.getDepartureName(),sampling.getDepartureId(),sampling.getMidId(),sampling.getMidName());
         if (nextId == 0) {
             if (split.length == 1) {
                 baseProcess.setProcessType(1);
@@ -245,7 +245,7 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
                 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());
+                        , baseProcess.getId(), sampling.getDepartureName(), sampling.getDepartureId(),sampling.getMidId(),sampling.getMidName());
                 if (Integer.parseInt(split[1]) == 1) {
                     //新增采样
                     BillSampling billSampling = (BillSampling) entity;

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

@@ -1,401 +1,401 @@
-package com.huimv.receive.timer;
-
-
-import cn.hutool.core.date.DateUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
-import com.huimv.receive.common.utils.FlowUtil;
-import com.huimv.receive.entity.*;
-import com.huimv.receive.service.*;
-import com.huimv.receive.service.impl.BillPcrServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-
-@Configuration
-@EnableScheduling
-public  class SafeTimer {
-
-
-    @Autowired
-    private IBillPcrService pcrService;
-    @Autowired
-    private IBillIsolateService isolateService;
-    @Autowired
-    private IConfigurationService configurationService;
-
-    @Autowired
-    private ISysUserService sysUserService;
-    @Autowired
-    private IBaseProcessService processService;
-    @Autowired
-    private IBaseLocationService locationService;
-    @Autowired
-    private IBillCleanService cleanService;
-    @Autowired
-    private IBillDryService dryService;
-    @Autowired
-    private IBillCleanBeforeService beforeService;
-    @Autowired
-    private IBillSamplingService samplingService;
-    @Autowired
-    private IBillGoodsInventoryService inventoryService;
-
-
-    @Scheduled(cron = "0 0/1 * * * ? ")
-    private void getShenChan() throws Exception {
-        QueryWrapper<BillIsolate> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("bill_status", 1);
-        List<BillIsolate> isolates = isolateService.list(queryWrapper);
-        Date date = new Date();
-        for (BillIsolate billIsolate : isolates) {
-            if (billIsolate.getIsolateEndDate().getTime() <= date.getTime()) {
-                billIsolate.setIsolateRealEndDate(date);
-                billIsolate.setIsolateRealDayNum(billIsolate.getIsolateDayNum());
-                billIsolate.setBillStatus(2);
-                billIsolate.setPassUserName("自然解除隔离");
-                billIsolate.setPassDate(date);
-                BaseProcess baseProcess = processService.getById(billIsolate.getProcessId());
-                QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
-                locationQueryWrapper.eq("id", billIsolate.getIsolateLocationId());
-                BaseLocation baseLocation = locationService.getOne(locationQueryWrapper);//当前隔离所在的位置
-
-                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-                String end = sdf.format(billIsolate.getIsolateEndDate());
-                String start = sdf.format(billIsolate.getIsolateStartDate());
-                String now = sdf.format(new Date());
-
-                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[] splits = substring1.split(",");
-                Integer nextId = Integer.parseInt(splits[0]);
-                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());
-                if (nextId == 0) {
-                    if (splits.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);
-                    } 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> queryWrapper1 = new QueryWrapper();
-                        queryWrapper1.eq("id", strings[index + 2]);
-                        BaseLocation location = locationService.getOne(queryWrapper1);
-                        FlowUtil flowUtil = new FlowUtil();
-                        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());
-                        if (Integer.parseInt(splits[1]) == 1) {
-                            //新增采样
-                            BillSampling billSampling = (BillSampling) entity;
-                            if (billIsolate.getVistitType() != 0) {
-                                billSampling.setCarNum(billIsolate.getCarNum());
-                            }
-                            if (billIsolate.getVistitType() == 5) {
-                                billSampling.setResource(billIsolate.getResource());
-                                billSampling.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                                billSampling.setRemark(billIsolate.getRemark());
-                            }
-                            samplingService.save(billSampling);
-                        } else if (Integer.parseInt(splits[1]) == 2) {
-                            //新增pcr
-                            BillPcr billClean = (BillPcr) entity;
-                            if (billIsolate.getVistitType() != 0) {
-                                billClean.setCarNum(billIsolate.getCarNum());
-                            }
-                            if (billIsolate.getVistitType() == 5) {
-                                billClean.setResource(billIsolate.getResource());
-                                billClean.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                                billClean.setRemark(billIsolate.getRemark());
-                            }
-                            pcrService.save(billClean);
-                        } else if (Integer.parseInt(splits[1]) == 3) {
-                            //新增洗澡
-                            BillClean billClean = (BillClean) entity;
-                            if (billIsolate.getVistitType() != 0) {
-                                billClean.setCarNum(billIsolate.getCarNum());
-                            }
-                            if (billIsolate.getVistitType() == 5) {
-                                billClean.setResource(billIsolate.getResource());
-                                billClean.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                                billClean.setRemark(billIsolate.getRemark());
-                            }
-                            cleanService.save(billClean);
-                        } else if (Integer.parseInt(splits[1]) == 4) {
-                            //新增隔离
-                            BillIsolate pcr = (BillIsolate) entity;
-                            if (billIsolate.getVistitType() != 0) {
-                                pcr.setCarNum(billIsolate.getCarNum());
-                            }
-                            if (billIsolate.getVistitType() == 5) {
-                                pcr.setResource(billIsolate.getResource());
-                                pcr.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                                pcr.setRemark(billIsolate.getRemark());
-                            }
-                            isolateService.save(pcr);
-                        } else if (Integer.parseInt(splits[1]) == 5) {
-                            BillDry billClean = (BillDry) entity;
-                            if (billIsolate.getVistitType() != 0) {
-                                billClean.setCarNum(billIsolate.getCarNum());
-                            }
-                            if (billIsolate.getVistitType() == 5) {
-                                billClean.setResource(billIsolate.getResource());
-                                billClean.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                                billClean.setRemark(billIsolate.getRemark());
-                            }
-                            dryService.save(billClean);
-                            //新增烘干
-                        } else if (Integer.parseInt(splits[1]) == 6) {
-                            //新增洗澡前拍照
-                            BillCleanBefore before = (BillCleanBefore) entity;
-                            if (billIsolate.getVistitType() != 0) {
-                                before.setCarNum(billIsolate.getCarNum());
-                            }
-                            if (billIsolate.getVistitType() == 5) {
-                                before.setResource(billIsolate.getResource());
-                                before.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                                before.setRemark(billIsolate.getRemark());
-                            }
-                            beforeService.save(before);
-                        } else if (Integer.parseInt(splits[1]) == 7) {
-                            //新增洗澡前拍照
-                            BillGoodsInventory before = (BillGoodsInventory) entity;
-                            if (billIsolate.getVistitType() != 0) {
-                                before.setCarNum(billIsolate.getCarNum());
-                            }
-                            if (billIsolate.getVistitType() == 5) {
-                                before.setResource(billIsolate.getResource());
-                                before.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                                before.setRemark(billIsolate.getRemark());
-                            }
-                            inventoryService.save(before);
-                        }
-                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + splits[1]);
-                        Integer locationId = billIsolate.getIsolateLocationId();
-                        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 (billIsolate.getVistitType() != 0) {
-                        billSampling.setCarNum(billIsolate.getCarNum());
-                    }
-                    if (billIsolate.getVistitType() == 5) {
-                        billSampling.setResource(billIsolate.getResource());
-                        billSampling.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                        billSampling.setRemark(billIsolate.getRemark());
-                    }
-
-                    samplingService.save(billSampling);
-                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                } else if (nextId == 2) {
-                    //新增pcr
-                    BillPcr pcr = (BillPcr) newObject;
-                    if (billIsolate.getVistitType() != 0) {
-                        pcr.setCarNum(billIsolate.getCarNum());
-                    }
-                    if (billIsolate.getVistitType() == 5) {
-                        pcr.setResource(billIsolate.getResource());
-                        pcr.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                        pcr.setRemark(billIsolate.getRemark());
-                    }
-                    pcrService.save(pcr);
-                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                } else if (nextId == 3) {
-                    //新增洗澡
-                    BillClean pcr = (BillClean) newObject;
-                    if (billIsolate.getVistitType() != 0) {
-                        pcr.setCarNum(billIsolate.getCarNum());
-                    }
-                    if (billIsolate.getVistitType() == 5) {
-                        pcr.setResource(billIsolate.getResource());
-                        pcr.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                        pcr.setRemark(billIsolate.getRemark());
-                    }
-                    cleanService.save(pcr);
-                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                } else if (nextId == 4) {
-                    //新增隔离
-                    BillIsolate pcr = (BillIsolate) newObject;
-                    if (billIsolate.getVistitType() != 0) {
-                        pcr.setCarNum(billIsolate.getCarNum());
-                    }
-                    if (billIsolate.getVistitType() == 5) {
-                        pcr.setResource(billIsolate.getResource());
-                        pcr.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                        pcr.setRemark(billIsolate.getRemark());
-                    }
-
-                    isolateService.save(pcr);
-                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                } else if (nextId == 5) {
-                    BillDry pcr = (BillDry) newObject;
-                    if (billIsolate.getVistitType() != 0) {
-                        pcr.setCarNum(billIsolate.getCarNum());
-                    }
-                    if (billIsolate.getVistitType() == 5) {
-                        pcr.setResource(billIsolate.getResource());
-                        pcr.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                        pcr.setRemark(billIsolate.getRemark());
-                    }
-                    dryService.save(pcr);
-                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                    //新增烘干
-                } else if (nextId == 6) {
-                    //新增洗澡前拍照
-                    BillCleanBefore before = (BillCleanBefore) newObject;
-                    if (billIsolate.getVistitType() != 0) {
-                        before.setCarNum(billIsolate.getCarNum());
-                    }
-                    if (billIsolate.getVistitType() == 5) {
-                        before.setResource(billIsolate.getResource());
-                        before.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                        before.setRemark(billIsolate.getRemark());
-                    }
-                    beforeService.save(before);
-                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                } else if (nextId == 7) {
-                    //新增洗澡前拍照
-                    BillGoodsInventory before = (BillGoodsInventory) newObject;
-                    if (billIsolate.getVistitType() != 0) {
-                        before.setCarNum(billIsolate.getCarNum());
-                    }
-                    if (billIsolate.getVistitType() == 5) {
-                        before.setResource(billIsolate.getResource());
-                        before.setFeedImgUrl(billIsolate.getFeedImgUrl());
-                        before.setRemark(billIsolate.getRemark());
-                    }
-                    inventoryService.save(before);
-                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                }
-
-
-                billIsolate.setIsolateRealEndDate(new Date());
-                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
-                Calendar cal1 = Calendar.getInstance();
-                Calendar cal2 = Calendar.getInstance();
-                Date startDate = sdf1.parse(start);
-                Date endDate = sdf1.parse(now);
-                cal1.setTime(startDate);
-                cal2.setTime(endDate);
-                long days = (cal2.getTimeInMillis() - cal1.getTimeInMillis()) / (1000 * 3600 * 24);
-                billIsolate.setIsolateRealDayNum(Long.toString(days));
-                billIsolate.setBillStatus(2);
-
-                baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
-
-                String status = baseProcess.getCurrentStatus();
-                String substring = status.substring(0, status.length() - 1);
-                baseProcess.setCurrentStatus(substring + "1," + 0);
-
-
-                isolateService.updateById(billIsolate);
-                processService.updateById(baseProcess);
-            }
-        }
-    }
-
-    @Scheduled(cron = "0 0/1 * * * ? ")
-    private void pcr() throws Exception {
-        QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("bill_status", 1);
-        List<BillPcr> pcrs = pcrService.list(queryWrapper);
-        Date date = new Date();
-        for (BillPcr pcr : pcrs) {
-            Date subDate = pcr.getCheckDate();
-            // 将LocalDateTime转换为Date
-
-            if ((subDate.getTime() + pcr.getQualifiedDate() * 60 * 1000) <= date.getTime()) {
-                pcr.setBillStatus(3);
-                pcrService.updateById(pcr);
-            }
-        }
-    }
-
-    //计算年龄
-    @Scheduled(cron = "0 0 0 * * ? ")
-    private void getAge() {
-        System.out.println("开始");
-        List<SysUser> sysUsers = sysUserService.list();
-        for (SysUser sysUser : sysUsers) {
-            int i = DateUtil.ageOfNow(sysUser.getBirthday());
-            if (i != sysUser.getAge()) {
-                sysUser.setAge(i);
-                sysUserService.updateById(sysUser);
-            }
-        }
-    }
-
-    public static void main(String[] args) {
-        String s = "0,1,0,2,0,3,0";
-        String s1 = "2,2,2,1,0,0,0";
-        int indexOf = s.indexOf("2");//当前位置在所有流程位置中的下标
-        System.out.println(indexOf);
-        String substring = s1.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 + s1.substring(indexOf + 3);
-        StringBuilder sb = new StringBuilder(sb2);
-        sb.replace(indexOf + 2, indexOf + 3, "2");
-        sb.replace(indexOf + 4, indexOf + 5, "1");
-        System.out.println(sb.toString());
-    }
-}
-
+//package com.huimv.receive.timer;
+//
+//
+//import cn.hutool.core.date.DateUtil;
+//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+//import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+//import com.huimv.receive.common.utils.FlowUtil;
+//import com.huimv.receive.entity.*;
+//import com.huimv.receive.service.*;
+//import com.huimv.receive.service.impl.BillPcrServiceImpl;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.scheduling.annotation.EnableScheduling;
+//import org.springframework.scheduling.annotation.Scheduled;
+//
+//import java.text.SimpleDateFormat;
+//import java.util.Calendar;
+//import java.util.Date;
+//import java.util.List;
+//
+//
+//@Configuration
+//@EnableScheduling
+//public  class SafeTimer {
+//
+//
+//    @Autowired
+//    private IBillPcrService pcrService;
+//    @Autowired
+//    private IBillIsolateService isolateService;
+//    @Autowired
+//    private IConfigurationService configurationService;
+//
+//    @Autowired
+//    private ISysUserService sysUserService;
+//    @Autowired
+//    private IBaseProcessService processService;
+//    @Autowired
+//    private IBaseLocationService locationService;
+//    @Autowired
+//    private IBillCleanService cleanService;
+//    @Autowired
+//    private IBillDryService dryService;
+//    @Autowired
+//    private IBillCleanBeforeService beforeService;
+//    @Autowired
+//    private IBillSamplingService samplingService;
+//    @Autowired
+//    private IBillGoodsInventoryService inventoryService;
+//
+//
+//    @Scheduled(cron = "0 0/1 * * * ? ")
+//    private void getShenChan() throws Exception {
+//        QueryWrapper<BillIsolate> queryWrapper = new QueryWrapper<>();
+//        queryWrapper.eq("bill_status", 1);
+//        List<BillIsolate> isolates = isolateService.list(queryWrapper);
+//        Date date = new Date();
+//        for (BillIsolate billIsolate : isolates) {
+//            if (billIsolate.getIsolateEndDate().getTime() <= date.getTime()) {
+//                billIsolate.setIsolateRealEndDate(date);
+//                billIsolate.setIsolateRealDayNum(billIsolate.getIsolateDayNum());
+//                billIsolate.setBillStatus(2);
+//                billIsolate.setPassUserName("自然解除隔离");
+//                billIsolate.setPassDate(date);
+//                BaseProcess baseProcess = processService.getById(billIsolate.getProcessId());
+//                QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
+//                locationQueryWrapper.eq("id", billIsolate.getIsolateLocationId());
+//                BaseLocation baseLocation = locationService.getOne(locationQueryWrapper);//当前隔离所在的位置
+//
+//                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//                String end = sdf.format(billIsolate.getIsolateEndDate());
+//                String start = sdf.format(billIsolate.getIsolateStartDate());
+//                String now = sdf.format(new Date());
+//
+//                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[] splits = substring1.split(",");
+//                Integer nextId = Integer.parseInt(splits[0]);
+//                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());
+//                if (nextId == 0) {
+//                    if (splits.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);
+//                    } 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> queryWrapper1 = new QueryWrapper();
+//                        queryWrapper1.eq("id", strings[index + 2]);
+//                        BaseLocation location = locationService.getOne(queryWrapper1);
+//                        FlowUtil flowUtil = new FlowUtil();
+//                        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());
+//                        if (Integer.parseInt(splits[1]) == 1) {
+//                            //新增采样
+//                            BillSampling billSampling = (BillSampling) entity;
+//                            if (billIsolate.getVistitType() != 0) {
+//                                billSampling.setCarNum(billIsolate.getCarNum());
+//                            }
+//                            if (billIsolate.getVistitType() == 5) {
+//                                billSampling.setResource(billIsolate.getResource());
+//                                billSampling.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                                billSampling.setRemark(billIsolate.getRemark());
+//                            }
+//                            samplingService.save(billSampling);
+//                        } else if (Integer.parseInt(splits[1]) == 2) {
+//                            //新增pcr
+//                            BillPcr billClean = (BillPcr) entity;
+//                            if (billIsolate.getVistitType() != 0) {
+//                                billClean.setCarNum(billIsolate.getCarNum());
+//                            }
+//                            if (billIsolate.getVistitType() == 5) {
+//                                billClean.setResource(billIsolate.getResource());
+//                                billClean.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                                billClean.setRemark(billIsolate.getRemark());
+//                            }
+//                            pcrService.save(billClean);
+//                        } else if (Integer.parseInt(splits[1]) == 3) {
+//                            //新增洗澡
+//                            BillClean billClean = (BillClean) entity;
+//                            if (billIsolate.getVistitType() != 0) {
+//                                billClean.setCarNum(billIsolate.getCarNum());
+//                            }
+//                            if (billIsolate.getVistitType() == 5) {
+//                                billClean.setResource(billIsolate.getResource());
+//                                billClean.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                                billClean.setRemark(billIsolate.getRemark());
+//                            }
+//                            cleanService.save(billClean);
+//                        } else if (Integer.parseInt(splits[1]) == 4) {
+//                            //新增隔离
+//                            BillIsolate pcr = (BillIsolate) entity;
+//                            if (billIsolate.getVistitType() != 0) {
+//                                pcr.setCarNum(billIsolate.getCarNum());
+//                            }
+//                            if (billIsolate.getVistitType() == 5) {
+//                                pcr.setResource(billIsolate.getResource());
+//                                pcr.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                                pcr.setRemark(billIsolate.getRemark());
+//                            }
+//                            isolateService.save(pcr);
+//                        } else if (Integer.parseInt(splits[1]) == 5) {
+//                            BillDry billClean = (BillDry) entity;
+//                            if (billIsolate.getVistitType() != 0) {
+//                                billClean.setCarNum(billIsolate.getCarNum());
+//                            }
+//                            if (billIsolate.getVistitType() == 5) {
+//                                billClean.setResource(billIsolate.getResource());
+//                                billClean.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                                billClean.setRemark(billIsolate.getRemark());
+//                            }
+//                            dryService.save(billClean);
+//                            //新增烘干
+//                        } else if (Integer.parseInt(splits[1]) == 6) {
+//                            //新增洗澡前拍照
+//                            BillCleanBefore before = (BillCleanBefore) entity;
+//                            if (billIsolate.getVistitType() != 0) {
+//                                before.setCarNum(billIsolate.getCarNum());
+//                            }
+//                            if (billIsolate.getVistitType() == 5) {
+//                                before.setResource(billIsolate.getResource());
+//                                before.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                                before.setRemark(billIsolate.getRemark());
+//                            }
+//                            beforeService.save(before);
+//                        } else if (Integer.parseInt(splits[1]) == 7) {
+//                            //新增洗澡前拍照
+//                            BillGoodsInventory before = (BillGoodsInventory) entity;
+//                            if (billIsolate.getVistitType() != 0) {
+//                                before.setCarNum(billIsolate.getCarNum());
+//                            }
+//                            if (billIsolate.getVistitType() == 5) {
+//                                before.setResource(billIsolate.getResource());
+//                                before.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                                before.setRemark(billIsolate.getRemark());
+//                            }
+//                            inventoryService.save(before);
+//                        }
+//                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + splits[1]);
+//                        Integer locationId = billIsolate.getIsolateLocationId();
+//                        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 (billIsolate.getVistitType() != 0) {
+//                        billSampling.setCarNum(billIsolate.getCarNum());
+//                    }
+//                    if (billIsolate.getVistitType() == 5) {
+//                        billSampling.setResource(billIsolate.getResource());
+//                        billSampling.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                        billSampling.setRemark(billIsolate.getRemark());
+//                    }
+//
+//                    samplingService.save(billSampling);
+//                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+//                } else if (nextId == 2) {
+//                    //新增pcr
+//                    BillPcr pcr = (BillPcr) newObject;
+//                    if (billIsolate.getVistitType() != 0) {
+//                        pcr.setCarNum(billIsolate.getCarNum());
+//                    }
+//                    if (billIsolate.getVistitType() == 5) {
+//                        pcr.setResource(billIsolate.getResource());
+//                        pcr.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                        pcr.setRemark(billIsolate.getRemark());
+//                    }
+//                    pcrService.save(pcr);
+//                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+//                } else if (nextId == 3) {
+//                    //新增洗澡
+//                    BillClean pcr = (BillClean) newObject;
+//                    if (billIsolate.getVistitType() != 0) {
+//                        pcr.setCarNum(billIsolate.getCarNum());
+//                    }
+//                    if (billIsolate.getVistitType() == 5) {
+//                        pcr.setResource(billIsolate.getResource());
+//                        pcr.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                        pcr.setRemark(billIsolate.getRemark());
+//                    }
+//                    cleanService.save(pcr);
+//                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+//                } else if (nextId == 4) {
+//                    //新增隔离
+//                    BillIsolate pcr = (BillIsolate) newObject;
+//                    if (billIsolate.getVistitType() != 0) {
+//                        pcr.setCarNum(billIsolate.getCarNum());
+//                    }
+//                    if (billIsolate.getVistitType() == 5) {
+//                        pcr.setResource(billIsolate.getResource());
+//                        pcr.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                        pcr.setRemark(billIsolate.getRemark());
+//                    }
+//
+//                    isolateService.save(pcr);
+//                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+//                } else if (nextId == 5) {
+//                    BillDry pcr = (BillDry) newObject;
+//                    if (billIsolate.getVistitType() != 0) {
+//                        pcr.setCarNum(billIsolate.getCarNum());
+//                    }
+//                    if (billIsolate.getVistitType() == 5) {
+//                        pcr.setResource(billIsolate.getResource());
+//                        pcr.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                        pcr.setRemark(billIsolate.getRemark());
+//                    }
+//                    dryService.save(pcr);
+//                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+//                    //新增烘干
+//                } else if (nextId == 6) {
+//                    //新增洗澡前拍照
+//                    BillCleanBefore before = (BillCleanBefore) newObject;
+//                    if (billIsolate.getVistitType() != 0) {
+//                        before.setCarNum(billIsolate.getCarNum());
+//                    }
+//                    if (billIsolate.getVistitType() == 5) {
+//                        before.setResource(billIsolate.getResource());
+//                        before.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                        before.setRemark(billIsolate.getRemark());
+//                    }
+//                    beforeService.save(before);
+//                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+//                } else if (nextId == 7) {
+//                    //新增洗澡前拍照
+//                    BillGoodsInventory before = (BillGoodsInventory) newObject;
+//                    if (billIsolate.getVistitType() != 0) {
+//                        before.setCarNum(billIsolate.getCarNum());
+//                    }
+//                    if (billIsolate.getVistitType() == 5) {
+//                        before.setResource(billIsolate.getResource());
+//                        before.setFeedImgUrl(billIsolate.getFeedImgUrl());
+//                        before.setRemark(billIsolate.getRemark());
+//                    }
+//                    inventoryService.save(before);
+//                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+//                }
+//
+//
+//                billIsolate.setIsolateRealEndDate(new Date());
+//                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
+//                Calendar cal1 = Calendar.getInstance();
+//                Calendar cal2 = Calendar.getInstance();
+//                Date startDate = sdf1.parse(start);
+//                Date endDate = sdf1.parse(now);
+//                cal1.setTime(startDate);
+//                cal2.setTime(endDate);
+//                long days = (cal2.getTimeInMillis() - cal1.getTimeInMillis()) / (1000 * 3600 * 24);
+//                billIsolate.setIsolateRealDayNum(Long.toString(days));
+//                billIsolate.setBillStatus(2);
+//
+//                baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
+//
+//                String status = baseProcess.getCurrentStatus();
+//                String substring = status.substring(0, status.length() - 1);
+//                baseProcess.setCurrentStatus(substring + "1," + 0);
+//
+//
+//                isolateService.updateById(billIsolate);
+//                processService.updateById(baseProcess);
+//            }
+//        }
+//    }
+//
+//    @Scheduled(cron = "0 0/1 * * * ? ")
+//    private void pcr() throws Exception {
+//        QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
+//        queryWrapper.eq("bill_status", 1);
+//        List<BillPcr> pcrs = pcrService.list(queryWrapper);
+//        Date date = new Date();
+//        for (BillPcr pcr : pcrs) {
+//            Date subDate = pcr.getCheckDate();
+//            // 将LocalDateTime转换为Date
+//
+//            if ((subDate.getTime() + pcr.getQualifiedDate() * 60 * 1000) <= date.getTime()) {
+//                pcr.setBillStatus(3);
+//                pcrService.updateById(pcr);
+//            }
+//        }
+//    }
+//
+//    //计算年龄
+//    @Scheduled(cron = "0 0 0 * * ? ")
+//    private void getAge() {
+//        System.out.println("开始");
+//        List<SysUser> sysUsers = sysUserService.list();
+//        for (SysUser sysUser : sysUsers) {
+//            int i = DateUtil.ageOfNow(sysUser.getBirthday());
+//            if (i != sysUser.getAge()) {
+//                sysUser.setAge(i);
+//                sysUserService.updateById(sysUser);
+//            }
+//        }
+//    }
+//
+//    public static void main(String[] args) {
+//        String s = "0,1,0,2,0,3,0";
+//        String s1 = "2,2,2,1,0,0,0";
+//        int indexOf = s.indexOf("2");//当前位置在所有流程位置中的下标
+//        System.out.println(indexOf);
+//        String substring = s1.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 + s1.substring(indexOf + 3);
+//        StringBuilder sb = new StringBuilder(sb2);
+//        sb.replace(indexOf + 2, indexOf + 3, "2");
+//        sb.replace(indexOf + 4, indexOf + 5, "1");
+//        System.out.println(sb.toString());
+//    }
+//}
+//

+ 2 - 2
huimv-receive/src/main/resources/mapper/BaseWashoutPointMapper.xml

@@ -19,7 +19,7 @@
     <select id="listDest" resultType="com.huimv.receive.entity.BaseWashoutPoint">
         SELECT w.location_id,l.location_name ,w.tail_location_name FROM `base_washout_point` w
         LEFT JOIN `base_location` l ON l.id = w.location_id
-        WHERE w.farm_ids LIKE concat('%',#{farmId},'%') AND w.visiting_type = #{vistitType}
+        WHERE w.farm_ids LIKE concat('%',#{farmId},'%') AND w.mid_id = #{vistitType}
 
     </select>
 
@@ -27,7 +27,7 @@
     <select id="listWash" resultType="com.huimv.receive.entity.BaseWashoutPoint">
         SELECT w.location_id,l.location_name  FROM `base_washout_point` w
         inner JOIN `base_location` l ON l.id = w.location_id
-        WHERE w.farm_ids LIKE concat('%',#{farmId},'%') AND w.visiting_type = #{vistitType}
+        WHERE w.farm_ids LIKE concat('%',#{farmId},'%') AND w.mid_id = #{vistitType}
 
     </select>
 </mapper>