wwh hace 1 año
padre
commit
dc277b95c8

+ 28 - 28
huimv-receive/src/main/java/com/huimv/receive/ReceiveApplication.java

@@ -18,32 +18,32 @@ public class ReceiveApplication {
         SpringApplication.run(ReceiveApplication.class, args);
     }
 
-    @Bean
-    public TomcatServletWebServerFactory servletContainer() {
-        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() {
-            @Override
-            protected void postProcessContext(Context context) {
-                SecurityConstraint constraint = new SecurityConstraint();
-                constraint.setUserConstraint("CONFIDENTIAL");
-                SecurityCollection collection = new SecurityCollection();
-                collection.addPattern("/*");
-                constraint.addCollection(collection);
-                context.addConstraint(constraint);
-            }
-        };
-        tomcat.addAdditionalTomcatConnectors(httpConnector());
-        return tomcat;
-    }
-
-    @Bean
-    public Connector httpConnector() {
-        Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
-        connector.setScheme("http");
-        //Connector监听的http的默认端口号
-        connector.setPort(8014);
-        connector.setSecure(false);
-        //监听到http的端口号后转向到的https的端口号,也就是项目配置的port
-        connector.setRedirectPort(8015);
-        return connector;
-    }
+//    @Bean
+//    public TomcatServletWebServerFactory servletContainer() {
+//        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() {
+//            @Override
+//            protected void postProcessContext(Context context) {
+//                SecurityConstraint constraint = new SecurityConstraint();
+//                constraint.setUserConstraint("CONFIDENTIAL");
+//                SecurityCollection collection = new SecurityCollection();
+//                collection.addPattern("/*");
+//                constraint.addCollection(collection);
+//                context.addConstraint(constraint);
+//            }
+//        };
+//        tomcat.addAdditionalTomcatConnectors(httpConnector());
+//        return tomcat;
+//    }
+//
+//    @Bean
+//    public Connector httpConnector() {
+//        Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
+//        connector.setScheme("http");
+//        //Connector监听的http的默认端口号
+//        connector.setPort(8014);
+//        connector.setSecure(false);
+//        //监听到http的端口号后转向到的https的端口号,也就是项目配置的port
+//        connector.setRedirectPort(8015);
+//        return connector;
+//    }
 }

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

@@ -193,7 +193,7 @@ public class LoginController {
             accessToken.setCreated(new Date());
             accessToken.setAccountName(accountName);
             accessToken.setFarmId(accountEntity.getFarmIds());
-            String token = TokenSign.sign(accountName, id, accountEntity.getFarmIds(), null, null);
+            String token = TokenSign.sign(accountName, id, accountEntity.getLastFarmId().toString(), null, null);
             accessToken.setToken(token);
 
             accessToken.setId(id);
@@ -226,7 +226,7 @@ public class LoginController {
             accessToken.setFarmId(data.getFarmIds());
             accessToken.setType(data.getType());
             accessToken.setId(data.getId());
-            String token = TokenSign.sign(data.getUserName(), data.getId(), data.getFarmIds(), data.getWorkLocationType()+"", data.getType());
+            String token = TokenSign.sign(data.getUserName(), data.getId(), data.getLastFarmId().toString(), data.getWorkLocationType()+"", data.getType());
             accessToken.setToken(token);
             Integer lastFarmId = data.getLastFarmId();
             if (ObjectUtil.isEmpty(lastFarmId)) {
@@ -336,7 +336,7 @@ public class LoginController {
             accessToken.setFarmId(data.getFarmIds());
             accessToken.setType(data.getType());
             accessToken.setId(data.getId());
-            String token = TokenSign.sign(data.getUserName(), data.getId(), data.getFarmIds(), data.getWorkLocationType()+"", 7);
+            String token = TokenSign.sign(data.getUserName(), data.getId(), data.getLastFarmId().toString(), data.getWorkLocationType()+"", 7);
             accessToken.setToken(token);
             Integer lastFarmId = data.getLastFarmId();
             if (ObjectUtil.isEmpty(lastFarmId)) {
@@ -370,7 +370,7 @@ public class LoginController {
         return new Result(ResultCode.SUCCESS,JSON.parseObject(stringResponseEntity.getBody()));
     }
     @PostMapping("/register2")
-    public String register2( @RequestParam(value = "video", required = false) MultipartFile imgUrl) throws IOException {
+    public String register2( @RequestParam(value = "video", required = false) MultipartFile video) throws IOException {
         return   uploadImage.getVideoCom(video);
     }
 
@@ -425,7 +425,7 @@ public class LoginController {
         accessToken.setFarmId(sysAccountMultilevel.getFarmIds());
         accessToken.setType(sysAccountMultilevel.getType());
         accessToken.setId(sysAccountMultilevel.getId());
-        String token = TokenSign.sign(sysAccountMultilevel.getUserName(), sysAccountMultilevel.getId(), sysAccountMultilevel.getFarmIds(), sysAccountMultilevel.getWorkLocationType()+"", sysAccountMultilevel.getType());
+        String token = TokenSign.sign(sysAccountMultilevel.getUserName(), sysAccountMultilevel.getId(), sysAccountMultilevel.getLastFarmId().toString(), sysAccountMultilevel.getWorkLocationType()+"", sysAccountMultilevel.getType());
         accessToken.setToken(token);
         Integer lastFarmId = sysAccountMultilevel.getLastFarmId();
         if (ObjectUtil.isEmpty(lastFarmId)) {

+ 6 - 0
huimv-receive/src/main/java/com/huimv/receive/service/IBillCleanBeforeService.java

@@ -3,8 +3,11 @@ package com.huimv.receive.service;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.entity.BillCleanBefore;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.text.ParseException;
 import java.util.Map;
 
 /**
@@ -18,4 +21,7 @@ import java.util.Map;
 public interface IBillCleanBeforeService extends IService<BillCleanBefore> {
 
     Result listPersonalCleanBefore(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
+
+    Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date,
+                MultipartFile img) throws ParseException, IOException;
 }

+ 34 - 29
huimv-receive/src/main/java/com/huimv/receive/service/impl/BaseWashoutPointServiceImpl.java

@@ -1,15 +1,18 @@
 package com.huimv.receive.service.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.huimv.receive.common.token.TokenSign;
 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.BaseWashoutPoint;
 import com.huimv.receive.entity.dto.GetFlowListDto;
 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.mapper.BaseVisitingMapper;
 import com.huimv.receive.mapper.BaseWashoutPointMapper;
 import com.huimv.receive.service.IBaseWashoutPointService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -35,30 +38,39 @@ public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMap
 
     @Autowired
     private BaseWashoutPointMapper washoutPointMapper;
+    @Autowired
+    private BaseVisitingMapper visitingMapper;
 
     @Override
     public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
         String farmId = paramsMap.get("farmId");
-        String type = paramsMap.get("type");//访问类型
-        List<BaseWashoutPoint> list = washoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>()
-                .like("farm_ids", farmId).eq("visiting_type", type));
+        List<BaseVisiting> visitings = visitingMapper.selectList(new QueryWrapper<BaseVisiting>().eq("farm_id", farmId));
         List<GetWashoutPointDto> washoutPointDtos = new ArrayList<>();
-        List<WashListDto> washListDtos = new ArrayList<>();
-        if (list.size() != 0) {
-            for (BaseWashoutPoint point : list) {
-                WashListDto washListDto = new WashListDto();
-                washListDto.setAddressId(point.getLocationId());
-                washListDto.setFlowLists(point.getFlowList());
-                washListDto.setNextName(point.getTailLocationName());
-                washListDto.setPcrTime(point.getPcrTime());
-                washListDtos.add(washListDto);
+        if (ObjectUtil.isEmpty(visitings)) {
+            return new Result(ResultCode.SUCCESS, washoutPointDtos);
+        } else {
+            for (BaseVisiting visiting : visitings) {
+                Integer type = visiting.getId();
+                List<BaseWashoutPoint> list = washoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>()
+                        .like("farm_ids", farmId).eq("visiting_type", type));
+                List<WashListDto> washListDtos = new ArrayList<>();
+                if (list.size() != 0) {
+                    for (BaseWashoutPoint point : list) {
+                        WashListDto washListDto = new WashListDto();
+                        washListDto.setAddressId(point.getLocationId());
+                        washListDto.setFlowLists(point.getFlowList());
+                        washListDto.setNextName(point.getTailLocationName());
+                        washListDto.setPcrTime(point.getPcrTime());
+                        washListDtos.add(washListDto);
+                    }
+                    GetWashoutPointDto getWashoutPointDto = new GetWashoutPointDto();
+                    getWashoutPointDto.setFarmIds(farmId);
+                    getWashoutPointDto.setNumber(list.size());
+                    getWashoutPointDto.setVisitingType(type);
+                    getWashoutPointDto.setWashListDtos(washListDtos);
+                    washoutPointDtos.add(getWashoutPointDto);
+                }
             }
-            GetWashoutPointDto getWashoutPointDto = new GetWashoutPointDto();
-            getWashoutPointDto.setFarmIds(farmId);
-            getWashoutPointDto.setNumber(list.size());
-            getWashoutPointDto.setVisitingType(Integer.parseInt(type));
-            getWashoutPointDto.setWashListDtos(washListDtos);
-            washoutPointDtos.add(getWashoutPointDto);
         }
         return new Result(ResultCode.SUCCESS, washoutPointDtos);
     }
@@ -67,6 +79,9 @@ public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMap
     public Result add(HttpServletRequest httpServletRequest, List<GetWashoutPointDto> washoutPointDtos) {
         String farmIds = TokenSign.getFarmIds(httpServletRequest);
         //访问类型集合
+        QueryWrapper<BaseWashoutPoint> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("farm_ids",farmIds);
+        washoutPointMapper.delete(queryWrapper);
         for (GetWashoutPointDto washoutPointDto : washoutPointDtos) {
             //流程集合
             List<WashListDto> washListDtos = washoutPointDto.getWashListDtos();
@@ -82,17 +97,7 @@ public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMap
                 washoutPoint.setTailLocationName(washListDto.getNextName());
                 washoutPoint.setFarmIds(farmIds);
                 washoutPoint.setPointLevel(i);
-                QueryWrapper<BaseWashoutPoint> queryWrapper = new QueryWrapper<>();
-                queryWrapper.like("farm_ids",farmIds)
-                        .eq("visiting_type", washoutPointDto.getVisitingType())
-                        .eq("location_id", washListDto.getAddressId());
-                BaseWashoutPoint point = washoutPointMapper.selectOne(queryWrapper);
-                if (ObjectUtil.isEmpty(point)) {
-                    washoutPointMapper.insert(washoutPoint);
-                } else {
-                    washoutPointMapper.updateById(washoutPoint);
-                }
-
+                washoutPointMapper.insert(washoutPoint);
                 i++;
             }
         }

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

@@ -3,19 +3,28 @@ package com.huimv.receive.service.impl;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.huimv.receive.common.token.TokenSign;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.ResultCode;
-import com.huimv.receive.entity.BillCleanBefore;
-import com.huimv.receive.entity.BillSampling;
+import com.huimv.receive.common.utils.UploadImage;
+import com.huimv.receive.entity.*;
+import com.huimv.receive.mapper.BaseLocationMapper;
+import com.huimv.receive.mapper.BaseProcessMapper;
 import com.huimv.receive.mapper.BillCleanBeforeMapper;
 import com.huimv.receive.service.IBillCleanBeforeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.Map;
 
 /**
@@ -31,6 +40,12 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
 
     @Autowired
     private BillCleanBeforeMapper billCleanBeforeMapper;
+    @Autowired
+    private UploadImage uploadImage;
+    @Autowired
+    private BaseProcessMapper processMapper;
+    @Autowired
+    private BaseLocationMapper locationMapper;
 
     @Override
     public Result listPersonalCleanBefore(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
@@ -39,14 +54,107 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
         String pageSize = paramsMap.get("pageSize");
         String vistitType = paramsMap.get("vistitType");
         Integer userId = TokenSign.getMemberIdByJwtToken(httpServletRequest);
-        Page<BillCleanBefore> page = new Page<>(Integer.parseInt(pageNo),Integer.parseInt(pageSize));
+        Page<BillCleanBefore> page = new Page<>(Integer.parseInt(pageNo), Integer.parseInt(pageSize));
         LambdaQueryWrapper<BillCleanBefore> queryWrapper = new QueryWrapper<BillCleanBefore>().lambda()
-                .eq(BillCleanBefore::getFarmId,farmId)
-                .eq(BillCleanBefore::getAdmissionUserId,userId)
-                .eq(ObjectUtil.isNotEmpty(vistitType),BillCleanBefore::getVistitType,vistitType)
+                .eq(BillCleanBefore::getFarmId, farmId)
+                .eq(BillCleanBefore::getAdmissionUserId, userId)
+                .eq(ObjectUtil.isNotEmpty(vistitType), BillCleanBefore::getVistitType, vistitType)
                 .orderByDesc(BillCleanBefore::getSubDate);
         Page<BillCleanBefore> billCleanBeforePage = billCleanBeforeMapper.selectPage(page, queryWrapper);
         Integer count = billCleanBeforeMapper.selectCount(queryWrapper);
-        return new Result(ResultCode.SUCCESS,billCleanBeforePage,count);
+        return new Result(ResultCode.SUCCESS, billCleanBeforePage, count);
+    }
+
+    @Override
+    public Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date, MultipartFile img) throws ParseException, IOException {
+        //1为合格2为异常
+        String s = "";
+        if (uploadImage.getImageCom(img).equals("上传失败")) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return new Result(10001, "图片1上传失败", false);
+        }
+        s = uploadImage.uploadImg(img);
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+
+        if (StringUtils.isBlank(date)) {
+            date = sdf.format(new Date());
+        }
+        BillCleanBefore cleanBefore = billCleanBeforeMapper.selectById(id);
+      /*  billPcr.setImgUrl(s);
+        billPcr.setImgStatus(1);
+
+
+        QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
+        processQueryWrapper.eq("farm_id", farmId).eq("id", billPcr.getProcessId());
+        BaseProcess baseProcess = processMapper.selectOne(processQueryWrapper);//进程
+
+        QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
+        locationQueryWrapper.eq("id", billPcr.getTestLocationId());
+        BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前pcr检测所在的位置
+
+        String allLocationId = baseProcess.getAllLocationId();//所有的位置id
+        String allFlowId = baseProcess.getAllFlowId();//所有的流程id
+        String currentFlowId = baseProcess.getCurrentFlowId();//当前已经完成的流程id
+        String substring1 = allFlowId.substring(currentFlowId.length() + 1, allFlowId.length());
+        String[] split = substring1.split(",");
+        Integer nextId = Integer.parseInt(split[0]);
+
+
+        billPcr.setBillStatus(1);
+        billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
+        billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
+        billPcr.setTestLocation(baseLocation.getLocationName());
+        billPcr.setTestLocationId(baseLocation.getId());
+        billPcr.setCheckDate(sdf.parse(date));
+        billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
+
+
+        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());
+        if (nextId == 0) {
+            int index = allLocationId.indexOf(baseLocation.getId());
+            StringBuilder status = new StringBuilder(baseProcess.getAllLocationId());
+            status.setCharAt(index, '1');
+            status.setCharAt(index + 2, '1');
+            baseProcess.setAllLocationStatus(status.toString());
+        } else if (nextId == 1) {
+            //新增采样
+            BillSampling billSampling = (BillSampling) newObject;
+            samplingMapper.insert(billSampling);
+        } else if (nextId == 2) {
+            //新增pcr
+            BillPcr billClean = (BillPcr) newObject;
+            pcrMapper.insert(billClean);
+        } else if (nextId == 3) {
+            //新增洗澡
+            BillClean billClean = (BillClean) newObject;
+            cleanMapper.insert(billClean);
+        } else if (nextId == 4) {
+            //新增隔离
+            BillIsolate pcr = (BillIsolate) newObject;
+            isolateMapper.insert(pcr);
+        } else if (nextId == 5) {
+            BillDry billClean = (BillDry) newObject;
+            dryMapper.insert(billClean);
+            //新增烘干
+        } else if (nextId == 6) {
+            //新增洗澡前拍照
+            BillCleanBefore before = new BillCleanBefore();
+            beforeMapper.insert(before);
+        }
+        baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
+        baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
+        baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
+        String status = baseProcess.getCurrentStatus();
+        String substring = status.substring(0, status.length() - 1);
+
+        baseProcess.setCurrentStatus(substring + "1," + 0);
+        baseProcess.setCurrentFlowId(baseProcess.getCurrentLocationId() + "," + nextId);
+        processMapper.updateById(baseProcess);
+        pcrMapper.updateById(billPcr);*/
+        return new Result(10000, "修改成功!", true);
     }
 }

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

@@ -15,6 +15,7 @@ import com.huimv.receive.entity.vo.CleanVo;
 import com.huimv.receive.entity.vo.PcrVo1;
 import com.huimv.receive.mapper.*;
 import com.huimv.receive.service.IBillCleanService;
+import com.huimv.receive.service.IBillPcrService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -577,6 +578,11 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
 
     @Resource
     private BillCleanMapper billCleanMapper;
+    @Autowired
+    private BillCleanBeforeMapper beforeMapper;
+    @Autowired
+    private BillSamplingMapper samplingMapper;
+
 
 
     @Override
@@ -784,18 +790,10 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                                 MultipartFile img2, MultipartFile img3, MultipartFile img4, MultipartFile img5, String type, String result
     ) throws ParseException, IOException {
 
-        QueryWrapper<Exist> existQueryWrapper = new QueryWrapper<>();
-        existQueryWrapper.eq("farm_id", farmId);
-        Exist exist = existMapper.selectOne(existQueryWrapper);//判断是否有二级洗消站
-
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
         if (StringUtils.isBlank(date)) {
             date = sdf.format(new Date());
         }
-     /*   BillClean billClean1 = cleanMapper.selectById(id);//某条洗消记录
-        if (billClean1.getBillStatus() != 0) {
-            return new Result(10001, "该订单已通过,无需再次提交!", false);
-        }*/
         String s1 = "";
         String s2 = "";
         String s3 = "";
@@ -847,174 +845,71 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
             locationQueryWrapper.eq("id", billClean.getTestLocationId());
             BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前所在的位置
 
-            if (billClean.getDestId() >= billClean.getTestLocationId() || billClean.getDestId() == 7) { //不是目的地
-
-                if ("1".equals(result)) {
-                    billClean.setBillStatus(1);
-                    billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                    billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-                    billClean.setTestLocation(baseLocation.getLocationName());
-                    billClean.setTestLocationId(baseLocation.getId());
-                    billClean.setCheckDate(sdf.parse(date));
-                    billClean.setPassDate(sdf.parse(sdf.format(new Date())));
-                    billClean.setImgUrl(s);
-                    billClean.setImgStatus(1);
-                    billClean.setCleanTime("10");
-                    cleanMapper.updateById(billClean);
-
-                    if (billClean.getDestId() == 11) {
-                        baseProcess.setAllLocationStatus("2,2,2,2");
-                    }
-                    if (billClean.getTestLocationId() == 9 || billClean.getTestLocationId() == 10) {
-                        if (billClean.getDestId() > 9 || billClean.getDestId() > 10) {
-                            Integer processId = billClean.getProcessId();
-                            QueryWrapper<BillPersonnelAdmission> queryWrapper1 = new QueryWrapper<>();
-                            queryWrapper1.eq("farm_id", farmId).eq("process_id", processId);
-                            BillPersonnelAdmission admission = admissionMapper.selectOne(queryWrapper1);
-                            admission.setBillStatus(1);
-                            admission.setPassDate(LocalDateTime.now());
-                            admission.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-                            admission.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                            admissionMapper.updateById(admission);
-                            if (billClean.getTestLocationId() == 10) {
-                                baseProcess.setAllLocationStatus("2,2,2,1");
-                            } else {
-                                baseProcess.setAllLocationStatus("2,2,1,0");
-                            }
-                        }
-                        if (billClean.getDestId() == 9) {
-                            baseProcess.setAllLocationStatus("2,2");
-                        }
-                        if (billClean.getDestId() == 10) {
-                            baseProcess.setAllLocationStatus("2,2,2");
-                        }
-
-                    }
+            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]);
 
-                    //第一次通过生成洗消
-                    if (billClean.getTestLocationId() == 6 && exist.getExist() == 0 && billClean.getDestId() > 6) {
-
-                        BillClean clean = new BillClean();
-                        clean.setVistitType(billClean.getVistitType());
-                        clean.setVistitDate(billClean.getVistitDate());
-                        clean.setDestName(billClean.getDestName());
-                        clean.setDestId(billClean.getDestId());
-                        clean.setAdmissionUserId(billClean.getAdmissionUserId());
-                        clean.setAdmissionUserName(billClean.getAdmissionUserName());
-                        clean.setSubDate(LocalDateTime.now());
-                        clean.setBillStatus(0);
-                        clean.setImgStatus(0);
-                        clean.setFarmId(billClean.getFarmId());
-                        clean.setCarNum(billClean.getCarNum());
-                        clean.setPhone(billClean.getPhone());
-                        clean.setProcessId(billClean.getProcessId());
-//                        clean.setTestLocationId(baseLocation.getNextId());
-//                        clean.setTestLocation(baseLocation.getNextLocation());
-                        cleanMapper.insert(clean);
-                        if (billClean.getDestId() == 7) {
-                            baseProcess.setAllLocationStatus("2,2,1");
-                        } else {
-                            baseProcess.setAllLocationStatus("2,2,1,0");
-                        }
-                    }
-                    if (billClean.getTestLocationId() == 6 && exist.getExist() == 1) {
-                        if (baseProcess.getDestId() > 6) {
-                            baseProcess.setAllLocationStatus("2,2,2");
-                        } else {
-                            baseProcess.setAllLocationStatus("2,2");
-                        }
-                    }
-
-                    if (billClean.getTestLocationId() == 7) {
-                        //生成烘干申请
-                        BillDry billPcr = new BillDry();
-                        billPcr.setPhone(billClean.getPhone());
-                        billPcr.setVistitType(billClean.getVistitType());
-                        billPcr.setDestName(billClean.getDestName());
-                        billPcr.setDestId(billClean.getDestId());
-                        billPcr.setAdmissionUserName(billClean.getAdmissionUserName());
-                        billPcr.setAdmissionUserId(billClean.getAdmissionUserId());
-                        billPcr.setVistitDate(billClean.getVistitDate());
-                        billPcr.setSubDate(LocalDateTime.now());
-                        billPcr.setBillStatus(0);
-                        billPcr.setImgStatus(0);
-                        billPcr.setCarNum(billClean.getCarNum());
-                        billPcr.setProcessId(billClean.getProcessId());
-                        billPcr.setFarmId(billClean.getFarmId());
-                        billPcr.setTestLocation(baseLocation.getLocationName());
-                        billPcr.setTestLocationId(baseLocation.getId());
-                        dryMapper.insert(billPcr);
-                        baseProcess.setAllLocationStatus("2,2,1,0");
-                    }
-                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
-                    String status = baseProcess.getCurrentStatus();
-                    String substring = status.substring(0, status.length() - 1);
-                    baseProcess.setCurrentStatus(substring + "1," + 0);
-                    processMapper.updateById(baseProcess);
-                } else {
-                    billClean.setImgStatus(1);
-                    billClean.setImgUrl(s);
-                    billClean.setBillStatus(2);
-                    billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                    billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-                    billClean.setTestLocation(baseLocation.getLocationName());
-                    billClean.setTestLocationId(baseLocation.getId());
-                    billClean.setCheckDate(sdf.parse(date));
-                    billClean.setPassDate(sdf.parse(sdf.format(new Date())));
-                    billClean.setCleanTime("10");
-                    cleanMapper.updateById(billClean);
-
-                    baseProcess.setProcessType(2);
-                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-                    String status = baseProcess.getCurrentStatus();
-                    String substring = status.substring(0, status.length() - 1);
-                    baseProcess.setCurrentStatus(substring + "2");
-
-                    String status1 = baseProcess.getAllLocationStatus();
-                    String[] split = status1.split(",");
-                    if (billClean.getTestLocationId() == 6) {
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    if (billClean.getTestLocationId() == 7) {
-                        split[0] = "2";
-                        split[1] = "2";
-                        split[2] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + status1.substring(5));
-                    }
-                    if (billClean.getTestLocationId() == 9) {
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    if (billClean.getTestLocationId() == 10) {
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    if (billClean.getTestLocationId() == 11) {
-                        baseProcess.setAllLocationStatus("2,3");
-                    }
+            if ("1".equals(result)) {
+                billClean.setBillStatus(1);
+                billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
+                billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
+                billClean.setTestLocation(baseLocation.getLocationName());
+                billClean.setTestLocationId(baseLocation.getId());
+                billClean.setCheckDate(sdf.parse(date));
+                billClean.setPassDate(sdf.parse(sdf.format(new Date())));
+                billClean.setImgUrl(s);
+                billClean.setImgStatus(1);
+                billClean.setCleanTime("10");
+                cleanMapper.updateById(billClean);
 
-                    processMapper.updateById(baseProcess);
+                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());
+                if (nextId == 0) {
+                    int index = allLocationId.indexOf(baseLocation.getId());
+                    StringBuilder status = new StringBuilder(baseProcess.getAllLocationId());
+                    status.setCharAt(index, '1');
+                    status.setCharAt(index + 2, '1');
+                    baseProcess.setAllLocationStatus(status.toString());
+                } else if (nextId == 1) {
+                    //新增采样
+                    BillSampling billSampling = (BillSampling) newObject;
+                    samplingMapper.insert(billSampling);
+                }else if (nextId == 2) {
+                    //新增pcr
+                    BillPcr pcr = (BillPcr) newObject;
+                    pcrMapper.insert(pcr);
+                }else if (nextId == 3) {
+                    //新增洗澡
+                    BillClean pcr = (BillClean) newObject;
+                    cleanMapper.insert(pcr);
+                }else if (nextId == 4) {
+                    //新增隔离
+                }else if (nextId == 5) {
+                    BillDry pcr = (BillDry) newObject;
+                    dryMapper.insert(pcr);
+                    //新增烘干
+                }else if (nextId == 6) {
+                    //新增洗澡前拍照
+                    BillCleanBefore before = new BillCleanBefore();
+                    beforeMapper.insert(before);
                 }
-                return new Result(10000, "修改成功!", true);
+                baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
+                baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
+                baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
+                String status = baseProcess.getCurrentStatus();
+                String substring = status.substring(0, status.length() - 1);
+                baseProcess.setCurrentStatus(substring + "1," + 0);
+                baseProcess.setCurrentFlowId(baseProcess.getCurrentLocationId() + "," + nextId);
+                processMapper.updateById(baseProcess);
             } else {
-                //当前是目的地
-                if ("1".equals(result)) {
-                    billClean.setBillStatus(1);
-                    baseProcess.setProcessType(1);
-                } else {
-                    billClean.setBillStatus(2);
-                    baseProcess.setProcessType(2);
-                }
                 billClean.setImgStatus(1);
                 billClean.setImgUrl(s);
+                billClean.setBillStatus(2);
                 billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
                 billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
                 billClean.setTestLocation(baseLocation.getLocationName());
@@ -1022,44 +917,23 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                 billClean.setCheckDate(sdf.parse(date));
                 billClean.setPassDate(sdf.parse(sdf.format(new Date())));
                 billClean.setCleanTime("10");
-
-                String status1 = baseProcess.getAllLocationStatus();
-                String[] split = status1.split(",");
-                if (billClean.getTestLocationId() == 6) {
-                    split[0] = "2";
-                    split[1] = "3";
-                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                }
-                if (billClean.getTestLocationId() == 7) {
-                    split[0] = "2";
-                    split[1] = "2";
-                    split[2] = "3";
-                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + status1.substring(5));
-                }
-                if (billClean.getTestLocationId() == 9) {
-                    split[0] = "2";
-                    split[1] = "3";
-                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                }
-                if (billClean.getTestLocationId() == 10) {
-                    split[0] = "2";
-                    split[1] = "3";
-                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                }
-                if (billClean.getTestLocationId() == 11) {
-                    baseProcess.setAllLocationStatus("2,3");
-                }
-
+                cleanMapper.updateById(billClean);
+                baseProcess.setProcessType(2);
                 baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
                 baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
                 baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
                 String status = baseProcess.getCurrentStatus();
                 String substring = status.substring(0, status.length() - 1);
-                baseProcess.setCurrentStatus(substring + "1");
+                baseProcess.setCurrentStatus(substring + "2");
+                String status1 = baseProcess.getAllLocationStatus();
+                StringBuilder sb = new StringBuilder(status1);
+                Integer a = status1.length() - 3;
+                sb.setCharAt(a, '3');
+                baseProcess.setAllLocationStatus(sb.toString());
                 processMapper.updateById(baseProcess);
-                cleanMapper.updateById(billClean);
-                return new Result(10000, "修改成功!", true);
             }
+            return new Result(10000, "修改成功!", true);
+
 
         } else {
             BillDry billClean = dryMapper.selectById(id);//某条烘干记录
@@ -1069,6 +943,13 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
             QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
             locationQueryWrapper.eq("id", billClean.getTestLocationId());
             BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前所在的位置
+
+            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]);
             if (baseProcess.getProcessType() == 2 || baseProcess.getProcessType() == 1) {
                 return new Result(10001, "修改失败!该申请已提前结束或者被拒绝", false);
             } else {
@@ -1089,15 +970,50 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     billClean.setDryTem("70");
                     dryMapper.updateById(billClean);
 
-                    baseProcess.setProcessType(1);
+                    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());
+                    if (nextId == 0) {
+                        int index = allLocationId.indexOf(baseLocation.getId());
+                        StringBuilder status = new StringBuilder(baseProcess.getAllLocationId());
+                        status.setCharAt(index, '1');
+                        status.setCharAt(index + 2, '1');
+                        baseProcess.setAllLocationStatus(status.toString());
+                    } else if (nextId == 1) {
+                        //新增采样
+                        BillSampling billSampling = (BillSampling) newObject;
+                        samplingMapper.insert(billSampling);
+                    }else if (nextId == 2) {
+                        //新增pcr
+                        BillPcr pcr = (BillPcr) newObject;
+                        pcrMapper.insert(pcr);
+                    }else if (nextId == 3) {
+                        //新增洗澡
+                        BillClean pcr = (BillClean) newObject;
+                        cleanMapper.insert(pcr);
+                    }else if (nextId == 4) {
+                        //新增隔离
+                        BillIsolate pcr = (BillIsolate) newObject;
+                        isolateMapper.insert(pcr);
+                    }else if (nextId == 5) {
+                        BillDry pcr = (BillDry) newObject;
+                        dryMapper.insert(pcr);
+                        //新增烘干
+                    }else if (nextId == 6) {
+                        //新增洗澡前拍照
+                        BillCleanBefore before = new BillCleanBefore();
+                        beforeMapper.insert(before);
+                    }
+
                     baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
+                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
+                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
                     String status = baseProcess.getCurrentStatus();
                     String substring = status.substring(0, status.length() - 1);
-                    baseProcess.setCurrentStatus(substring + "1");
+                    baseProcess.setCurrentStatus(substring + "1," + 0);
+                    baseProcess.setCurrentFlowId(baseProcess.getCurrentLocationId() + "," + nextId);
 
-                    baseProcess.setAllLocationStatus("2,2,2,2");
                     processMapper.updateById(baseProcess);
                 } else {
                     billClean.setImgStatus(1);
@@ -1120,17 +1036,11 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     String status = baseProcess.getCurrentStatus();
                     String substring = status.substring(0, status.length() - 1);
                     baseProcess.setCurrentStatus(substring + "2");
-
-//                    baseProcess.setAllLocationStatus("2,2,2,3");
-
                     String status1 = baseProcess.getAllLocationStatus();
-                    String[] split = status1.split(",");
-                    if (billClean.getTestLocationId() == 7) {
-                        split[0] = "2";
-                        split[1] = "2";
-                        split[2] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + status1.substring(5));
-                    }
+                    StringBuilder sb = new StringBuilder(status1);
+                    Integer a = status1.length() - 3;
+                    sb.setCharAt(a, '3');
+                    baseProcess.setAllLocationStatus(sb.toString());
 
                     processMapper.updateById(baseProcess);
                 }

+ 274 - 357
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPcrServiceImpl.java

@@ -277,7 +277,16 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
     private PeopleListMapper peopleListMapper;
     @Autowired
     private BillPersonnelAdmissionMapper personnelAdmissionMapper;
-
+    @Autowired
+    private BaseWashoutPointMapper washoutPointMapper;
+    @Autowired
+    private BillDryMapper dryMapper;
+    @Autowired
+    private BillIsolateMapper isolateMapper;
+    @Autowired
+    private BillSamplingMapper samplingMapper;
+    @Autowired
+    private BillCleanBeforeMapper beforeMapper;
     @Override
     public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
         String farmId = paramsMap.get("farmId");
@@ -372,13 +381,13 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
         locationQueryWrapper.eq("id", billPcr.getTestLocationId());
         BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前pcr检测所在的位置
 
-        QueryWrapper<Configuration> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("farm_id", farmId);
-        Configuration configuration = configurationMapper.selectOne(queryWrapper);
+        String allLocationId = baseProcess.getAllLocationId();//所有的位置id
+        String allFlowId = baseProcess.getAllFlowId();//所有的流程id
+        String currentFlowId = baseProcess.getCurrentFlowId();//当前已经完成的流程id
+        String substring1 = allFlowId.substring(currentFlowId.length() + 1, allFlowId.length());
+        String[] split = substring1.split(",");
+        Integer nextId = Integer.parseInt(split[0]);
 
-        QueryWrapper<Exist> existQueryWrapper = new QueryWrapper<>();
-        existQueryWrapper.eq("farm_id", farmId);
-        Exist exist = existMapper.selectOne(existQueryWrapper);//判断是否有二级洗消站
 
         if (billPcr.getBillStatus() != 0) {
             return new Result(10001, "该订单已通过,无需再次提交!", false);
@@ -386,365 +395,169 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
         if (baseProcess.getProcessType() == 2 || baseProcess.getProcessType() == 1) {
             return new Result(10001, "修改失败!该申请已提前结束或者被拒绝", false);
         } else {
-            if (billPcr.getDestId() >= billPcr.getTestLocationId() || billPcr.getTestLocationId() == 9 || billPcr.getTestLocationId() == 10 || billPcr.getTestLocationId() == 11 || billPcr.getTestLocationId() == 6) { //说明当前不是目的地
-
-                if ("1".equals(result)) {
-                    billPcr.setBillStatus(1);
-                    billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                    billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-                    billPcr.setTestLocation(baseLocation.getLocationName());
-                    billPcr.setTestLocationId(baseLocation.getId());
-                    billPcr.setCheckDate(sdf.parse(date));
-                    billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
-                    billPcr.setQualifiedDate(configuration.getPcr());
-
-
-                    //通过生成洗消记录
-                    BillClean billClean = new BillClean();
-                    billClean.setVistitType(billPcr.getVistitType());
-                    billClean.setDestName(billPcr.getDestName());
-                    billClean.setDestId(billPcr.getDestId());
-                    billClean.setAdmissionUserName(billPcr.getAdmissionUserName());
-                    billClean.setAdmissionUserId(billPcr.getAdmissionUserId());
-                    billClean.setVistitDate(billPcr.getVistitDate());
-                    billClean.setSubDate(LocalDateTime.now());
-                    billClean.setFarmId(billPcr.getFarmId());
-                    billClean.setPassUserName(billPcr.getPassUserName());
-                    billClean.setPassDate(billPcr.getPassDate());
-                    billClean.setPassUserId(billPcr.getPassUserId());
-                    billClean.setProcessId(billPcr.getProcessId());
-                    billClean.setTestLocation(baseLocation.getLocationName());
-                    billClean.setTestLocationId(baseLocation.getId());
-                    billClean.setPhone(billPcr.getPhone());
-                    billClean.setImgStatus(0);
-                    billClean.setCarNum(billPcr.getCarNum());
+            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();
+
+                billPcr.setBillStatus(1);
+                billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
+                billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
+                billPcr.setTestLocation(baseLocation.getLocationName());
+                billPcr.setTestLocationId(baseLocation.getId());
+                billPcr.setCheckDate(sdf.parse(date));
+                billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
+                billPcr.setQualifiedDate(pcrTime);
+
+
+                Object newObject = getNewObject(nextId, billPcr.getDestName(), billPcr.getDestId(), billPcr.getAdmissionUserName(),
+                        billPcr.getAdmissionUserId(), billPcr.getVistitDate(), billPcr.getSubDate(),
+                        billPcr.getProcessId(), billPcr.getFarmId(), billPcr.getTestLocation(), billPcr.getTestLocationId(),
+                        billPcr.getVistitType(),billPcr.getPhone());
+                if (nextId == 0) {
+                    int index = allLocationId.indexOf(baseLocation.getId());
+                    StringBuilder status = new StringBuilder(baseProcess.getAllLocationId());
+                    status.setCharAt(index, '1');
+                    status.setCharAt(index + 2, '1');
+                    baseProcess.setAllLocationStatus(status.toString());
+                } else if (nextId == 1) {
+                    //新增采样
+                    BillSampling billSampling = (BillSampling) newObject;
+                    samplingMapper.insert(billSampling);
+                }else if (nextId == 2) {
+                    //新增pcr
+                    BillPcr billClean = (BillPcr) newObject;
+                    pcrMapper.insert(billClean);
+                }else if (nextId == 3) {
+                    //新增洗澡
+                    BillClean billClean = (BillClean) newObject;
                     cleanMapper.insert(billClean);
-                    //通过生成门禁白名单
-                    QueryWrapper<DeviceList> deviceListQueryWrapper = new QueryWrapper<>();
-                    deviceListQueryWrapper.eq("farm_id", billPcr.getFarmId()).eq("location_id", baseLocation.getId());
-                    List<DeviceList> deviceLists = deviceListMapper.selectList(deviceListQueryWrapper);
-                    //找到对应的入场申请表
-                    QueryWrapper<BillPersonnelAdmission> queryWrapper1 = new QueryWrapper<>();
-                    queryWrapper1.eq("farm_id", billPcr.getFarmId()).eq("process_id", baseProcess.getId());
-                    BillPersonnelAdmission billPersonnelAdmission = personnelAdmissionMapper.selectOne(queryWrapper1);
-                    if (deviceLists.size() > 0) {
-                        for (DeviceList deviceList : deviceLists) {
-                            //通过生成门禁白名单
-                            PeopleList peopleList = new PeopleList();
-                            peopleList.setFarmId(billPcr.getFarmId().toString());
-                            peopleList.setDeviceCode(deviceList.getDeviceCode());
-                            peopleList.setUserId(billPcr.getAdmissionUserId());
-                            peopleList.setUserName(billPcr.getAdmissionUserName());
-                            peopleList.setPassword("123456");
-                            peopleList.setType(0);
-                            peopleList.setCreateTime(new Date());
-                            Date date2 = new Date();
-                            Calendar calendar = Calendar.getInstance();
-                            calendar.setTime(date2);
-                            calendar.add(Calendar.HOUR_OF_DAY, 2);
-                            Date date1 = calendar.getTime();
-                            peopleList.setOutTime(date1);
-                            peopleListMapper.insert(peopleList);
-
-                            HashMap<String, Object> jsonObject = new HashMap<>();
-                            jsonObject.put("seq", deviceList.getDeviceCode());
-//                    String savePath = "D:\\works\\pig_projects\\甜妹.jpg";
-                            String savePath = "/opt/huatong/test.jpg";
-                            URL url = new URL(billPersonnelAdmission.getUserImgUrl());
-                            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-                            connection.setRequestMethod("GET");
-                            int resCode = connection.getResponseCode();
-                            if (resCode == HttpURLConnection.HTTP_OK) {
-                                InputStream inputStream = connection.getInputStream();
-                                byte[] buffer = new byte[4096];
-                                int length;
-                                //读取数据并写入到文件中
-                                try (FileOutputStream outStream = new FileOutputStream(savePath)) {
-                                    while ((length = inputStream.read(buffer)) != -1) {
-                                        outStream.write(buffer, 0, length);
-                                    }
-                                    outStream.flush();
-                                } finally {
-                                    inputStream.close();
-                                }
-                            } else {
-                                System.out.println("文件下载错误码为" + resCode);
-                            }
-
-//                    jsonObject.put("face", FileUtil.file("D:\\works\\pig_projects\\甜妹.jpg"));
-                            jsonObject.put("face", FileUtil.file(savePath));
-                            jsonObject.put("name", billPersonnelAdmission.getAdmissionUserName());
-                            jsonObject.put("password", "123456");
-                            jsonObject.put("timestamp", date1.getTime());
-                            jsonObject.put("uid", billPersonnelAdmission.getAdmissionUserId());
-                            String post = HttpRequest.post("http://39.173.90.137:8040/addDeviceUser")
-                                    .header(Header.CONTENT_TYPE, "multipart/form-data")
-                                    .form(jsonObject)
-                                    .timeout(30 * 1000).execute().body();
-                            System.out.println(post);
-                        }
-                    }
-
-
-                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
-                    String status = baseProcess.getCurrentStatus();
-                    String substring = status.substring(0, status.length() - 1);
-
-                    baseProcess.setCurrentStatus(substring + "1," + 0);
-
-                    if (billPcr.getDestId() == 11) {
-                        baseProcess.setAllLocationStatus("2,1");
-                    }
-                    if (billPcr.getDestId() == 10) {
-                        baseProcess.setAllLocationStatus("2,1");
-                    }
-                    if (billPcr.getDestId() == 9) {
-                        baseProcess.setAllLocationStatus("2,1");
-                    }
-
-                    processMapper.updateById(baseProcess);
-                    pcrMapper.updateById(billPcr);
-                    return new Result(10000, "修改成功!", true);
-                } else {
-
-                    billPcr.setBillStatus(2);
-                    billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                    billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-
-                    billPcr.setTestLocation(baseLocation.getLocationName());
-                    billPcr.setTestLocationId(baseLocation.getId());
-                    billPcr.setCheckDate(sdf.parse(date));
-                    billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
-                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-
-                    String status = baseProcess.getCurrentStatus();
-                    String substring = status.substring(0, status.length() - 1);
-
-                    baseProcess.setCurrentStatus(substring + "2," + 0);
-                    if (baseLocation.getId() == 1) {
-                        //第一次检测不合格
-                        billPcr.setPcrType(1);
-                        baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + ",初级洗消站污区");
-                        baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + ",2");
-                    }
-                    if (baseLocation.getId() == 12) {
-                        //环保车第一次不合格
-                        billPcr.setPcrType(1);
-                        baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + ",销售中转站");
-                        baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + ",2");
-                    }
-                    if (baseLocation.getId() == 15) {
-                        //拉猪车第一次不合格
-                        billPcr.setPcrType(1);
-                        baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + ",销售中转站");
-                        baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + ",2");
-                    }
-                    if (baseLocation.getId() == 6) {
-                        //饲料车第一次不合格
-                        billPcr.setPcrType(1);
-                        baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + ",车辆初级洗消站");
-                        baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + ",2");
-                    }
-                    if (baseLocation.getId() == 3) {
-                        //第二次检测不合格
-                        baseProcess.setProcessType(2);
-                        baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                        baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "2";
-                        split[2] = "2";
-                        split[3] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + status1.substring(7));
-                    }
-                    if (baseLocation.getId() == 4 && exist.getExist() == 0) {
-                        //第三次不合格
-                        baseProcess.setProcessType(2);
-                        baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                        baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "2";
-                        split[2] = "2";
-                        split[3] = "2";
-                        split[4] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + "," + split[4] + status1.substring(9));
-                    }
-                    if (baseLocation.getId() == 4 && exist.getExist() == 1) {
-                        //第三次不合格
-                        baseProcess.setProcessType(2);
-                        baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                        baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "2";
-                        split[2] = "2";
-                        split[3] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + status1.substring(7));
-                    }
-
-                    if (baseLocation.getId() == 17) {
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    if (baseLocation.getId() == 15) {
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    if (baseLocation.getId() == 9) {
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    if (baseLocation.getId() == 10) {
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    if (baseLocation.getId() == 11) {
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-
-                    processMapper.updateById(baseProcess);
-                    pcrMapper.updateById(billPcr);
-                    return new Result(10000, "修改成功!", true);
+                }else if (nextId == 4) {
+                    //新增隔离
+                    BillIsolate pcr = (BillIsolate) newObject;
+                    isolateMapper.insert(pcr);
+                }else if (nextId == 5) {
+                    BillDry billClean = (BillDry) newObject;
+                    dryMapper.insert(billClean);
+                    //新增烘干
+                }else if (nextId == 6) {
+                    //新增洗澡前拍照
+                    BillCleanBefore before = new BillCleanBefore();
+                    beforeMapper.insert(before);
                 }
+//                //通过生成门禁白名单
+//                QueryWrapper<DeviceList> deviceListQueryWrapper = new QueryWrapper<>();
+//                deviceListQueryWrapper.eq("farm_id", billPcr.getFarmId()).eq("location_id", baseLocation.getId());
+//                List<DeviceList> deviceLists = deviceListMapper.selectList(deviceListQueryWrapper);
+//                //找到对应的入场申请表
+//                QueryWrapper<BillPersonnelAdmission> queryWrapper1 = new QueryWrapper<>();
+//                queryWrapper1.eq("farm_id", billPcr.getFarmId()).eq("process_id", baseProcess.getId());
+//                BillPersonnelAdmission billPersonnelAdmission = personnelAdmissionMapper.selectOne(queryWrapper1);
+//                if (deviceLists.size() > 0) {
+//                    for (DeviceList deviceList : deviceLists) {
+//                        //通过生成门禁白名单
+//                        PeopleList peopleList = new PeopleList();
+//                        peopleList.setFarmId(billPcr.getFarmId().toString());
+//                        peopleList.setDeviceCode(deviceList.getDeviceCode());
+//                        peopleList.setUserId(billPcr.getAdmissionUserId());
+//                        peopleList.setUserName(billPcr.getAdmissionUserName());
+//                        peopleList.setPassword("123456");
+//                        peopleList.setType(0);
+//                        peopleList.setCreateTime(new Date());
+//                        Date date2 = new Date();
+//                        Calendar calendar = Calendar.getInstance();
+//                        calendar.setTime(date2);
+//                        calendar.add(Calendar.HOUR_OF_DAY, 2);
+//                        Date date1 = calendar.getTime();
+//                        peopleList.setOutTime(date1);
+//                        peopleListMapper.insert(peopleList);
+//
+//                        HashMap<String, Object> jsonObject = new HashMap<>();
+//                        jsonObject.put("seq", deviceList.getDeviceCode());
+////                    String savePath = "D:\\works\\pig_projects\\甜妹.jpg";
+//                        String savePath = "/opt/huatong/test.jpg";
+//                        URL url = new URL(billPersonnelAdmission.getUserImgUrl());
+//                        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+//                        connection.setRequestMethod("GET");
+//                        int resCode = connection.getResponseCode();
+//                        if (resCode == HttpURLConnection.HTTP_OK) {
+//                            InputStream inputStream = connection.getInputStream();
+//                            byte[] buffer = new byte[4096];
+//                            int length;
+//                            //读取数据并写入到文件中
+//                            try (FileOutputStream outStream = new FileOutputStream(savePath)) {
+//                                while ((length = inputStream.read(buffer)) != -1) {
+//                                    outStream.write(buffer, 0, length);
+//                                }
+//                                outStream.flush();
+//                            } finally {
+//                                inputStream.close();
+//                            }
+//                        } else {
+//                            System.out.println("文件下载错误码为" + resCode);
+//                        }
+//
+////                    jsonObject.put("face", FileUtil.file("D:\\works\\pig_projects\\甜妹.jpg"));
+//                        jsonObject.put("face", FileUtil.file(savePath));
+//                        jsonObject.put("name", billPersonnelAdmission.getAdmissionUserName());
+//                        jsonObject.put("password", "123456");
+//                        jsonObject.put("timestamp", date1.getTime());
+//                        jsonObject.put("uid", billPersonnelAdmission.getAdmissionUserId());
+//                        String post = HttpRequest.post("http://39.173.90.137:8040/addDeviceUser")
+//                                .header(Header.CONTENT_TYPE, "multipart/form-data")
+//                                .form(jsonObject)
+//                                .timeout(30 * 1000).execute().body();
+//                        System.out.println(post);
+//                    }
+//                }
+                baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
+                baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
+                baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
+                String status = baseProcess.getCurrentStatus();
+                String substring = status.substring(0, status.length() - 1);
+
+                baseProcess.setCurrentStatus(substring + "1," + 0);
+                baseProcess.setCurrentFlowId(baseProcess.getCurrentLocationId() + "," + nextId);
+                processMapper.updateById(baseProcess);
+                pcrMapper.updateById(billPcr);
+                return new Result(10000, "修改成功!", true);
             } else {
-
-                if ("1".equals(result)) {
-                    billPcr.setBillStatus(1);
-                    billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                    billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-                    billPcr.setTestLocation(baseLocation.getLocationName());
-                    billPcr.setTestLocationId(baseLocation.getId());
-                    billPcr.setQualifiedDate(configuration.getPcr());
-                    billPcr.setCheckDate(sdf.parse(date));
-                    billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
-
-                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-                    String status = baseProcess.getCurrentStatus();
-                    String substring = status.substring(0, status.length() - 1);
-                    baseProcess.setCurrentStatus(substring + "1");
-                    baseProcess.setProcessType(1);
-
-                    if (baseLocation.getId() == 9) {
-                        baseProcess.setAllLocationStatus("2,2");
-                    }
-                    if (baseLocation.getId() == 10) {
-
-                        baseProcess.setAllLocationStatus("2,2");
-                    }
-                    if (baseLocation.getId() == 11) {
-                        baseProcess.setAllLocationStatus("2,2");
-                    }
-
-                    processMapper.updateById(baseProcess);
-                    pcrMapper.updateById(billPcr);
-                    return new Result(10000, "修改成功!", true);
-                } else {
-                    if (baseLocation.getId() == 1) {
-                        //第一次检测不合格
-                        billPcr.setPcrType(1);
-                        baseProcess.setProcessType(2);
-                    } else if (baseLocation.getId() == 12) {
-                        //环保车检测不合格
-                        billPcr.setPcrType(1);
-                        baseProcess.setProcessType(2);
-                    } else if (baseLocation.getId() == 15) {
-                        //拉猪车检测不合格
-                        billPcr.setPcrType(1);
-                        baseProcess.setProcessType(2);
-                    } else if (baseLocation.getId() == 6) {
-                        //饲料车检测不合格
-                        billPcr.setPcrType(1);
-                        baseProcess.setProcessType(2);
-                    } else {
-                        baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-                        baseProcess.setProcessType(2);
-                    }
-
-                    if (baseLocation.getId() == 15) {
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-                    String status = baseProcess.getCurrentStatus();
-                    String substring = status.substring(0, status.length() - 1);
-                    baseProcess.setCurrentStatus(substring + "2," + 0);
-
-                    if (baseLocation.getId() == 9) {
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    if (baseLocation.getId() == 10) {
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    if (baseLocation.getId() == 11) {
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-                    if (baseLocation.getId() == 17) {
-                        String status1 = baseProcess.getAllLocationStatus();
-                        String[] split = status1.split(",");
-                        split[0] = "2";
-                        split[1] = "3";
-                        baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
-                    }
-
-                    billPcr.setBillStatus(2);
-                    billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                    billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-                    billPcr.setTestLocation(baseLocation.getLocationName());
-                    billPcr.setTestLocationId(baseLocation.getId());
-                    billPcr.setCheckDate(sdf.parse(date));
-                    billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
-                    processMapper.updateById(baseProcess);
-                    pcrMapper.updateById(billPcr);
-                    return new Result(10000, "修改成功!", true);
-                }
-
+                billPcr.setBillStatus(2);
+                billPcr.setPcrType(1);
+                billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
+                billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
+                billPcr.setTestLocation(baseLocation.getLocationName());
+                billPcr.setTestLocationId(baseLocation.getId());
+                billPcr.setCheckDate(sdf.parse(date));
+                billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
+                baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
+                String status = baseProcess.getCurrentStatus();
+                String substring = status.substring(0, status.length() - 1);
+                baseProcess.setCurrentStatus(substring + "2," + 0);
+
+                processMapper.updateById(baseProcess);
+                pcrMapper.updateById(billPcr);
+                return new Result(10000, "修改成功!", true);
             }
 
 
         }
     }
 
+    public static void main(String[] args) {
+        String s = "0,1,0,2,0,3,0";
+        StringBuilder sb = new StringBuilder(s);
+        Integer a = s.length() - 3;
+        sb.setCharAt(a,'0');
+        System.out.println(sb.toString());
+
+//        String s1 = "1,1,1,0,0,0";
+//        System.out.println(s.indexOf("2"));
+//        StringBuilder sb = new StringBuilder(s1);
+//        sb.setCharAt(6, '1');
+//        sb.setCharAt(8, '1');
+//        System.out.println(sb.toString());
+
+    }
 
     private void xiugaiPro(BaseProcess baseProcess, BillPcr billPcr) {
         baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + new Date());
@@ -772,6 +585,110 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
         System.out.println("完结");
         return "成功";
     }
+
+    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) {
+        if (id == 1) {
+            //采样
+            BillSampling billSampling = new BillSampling();
+            billSampling.setVistitType(vistitType);
+            billSampling.setDestName(destName);
+            billSampling.setDestId(destId);
+            billSampling.setAdmissionUserName(admissionUserName);
+            billSampling.setAdmissionUserId(admissionUserId);
+            billSampling.setVistitDate(vistitDate);
+            billSampling.setSubDate(LocalDateTime.now());
+            billSampling.setPhone(phone);
+            billSampling.setTestLocation(testLocation);
+            billSampling.setTestLocationId(testLocationId);
+            billSampling.setProcessId(processId);
+            billSampling.setFarmId(String.valueOf(farmId));
+            return billSampling;
+        }
+        if (id == 2) {
+            //pcr
+            BillPcr billPcr = new BillPcr();
+            billPcr.setDestName(destName);
+            billPcr.setDestId(destId);
+            billPcr.setAdmissionUserId(admissionUserId);
+            billPcr.setAdmissionUserName(admissionUserName);
+            billPcr.setVistitDate(vistitDate);
+            billPcr.setSubDate(subDate);
+            billPcr.setBillStatus(0);
+            billPcr.setProcessId(processId);
+            billPcr.setFarmId(farmId);
+            billPcr.setTestLocationId(testLocationId);
+            billPcr.setTestLocation(testLocation);
+            return billPcr;
+        }
+        if (id == 3) {
+            //洗消
+            BillClean billPcr = new BillClean();
+            billPcr.setDestName(destName);
+            billPcr.setDestId(destId);
+            billPcr.setAdmissionUserId(admissionUserId);
+            billPcr.setAdmissionUserName(admissionUserName);
+            billPcr.setVistitDate(vistitDate);
+            billPcr.setSubDate(subDate);
+            billPcr.setBillStatus(0);
+            billPcr.setProcessId(processId);
+            billPcr.setFarmId(farmId);
+            billPcr.setTestLocationId(testLocationId);
+            billPcr.setTestLocation(testLocation);
+            return billPcr;
+        }
+        if (id == 4) {
+            //隔离
+            BillIsolate billPcr = new BillIsolate();
+            billPcr.setDestName(destName);
+            billPcr.setDestId(destId);
+            billPcr.setAdmissionUserId(admissionUserId);
+            billPcr.setAdmissionUserName(admissionUserName);
+            billPcr.setVistitDate(vistitDate);
+            billPcr.setSubDate(subDate);
+            billPcr.setBillStatus(0);
+            billPcr.setProcessId(processId);
+            billPcr.setFarmId(farmId);
+            billPcr.setIsolateLocation(testLocation);
+            billPcr.setIsolateLocationId(testLocationId);
+            return billPcr;
+        }
+        if (id == 5) {
+            //烘干
+            BillDry billPcr = new BillDry();
+            billPcr.setDestName(destName);
+            billPcr.setDestId(destId);
+            billPcr.setAdmissionUserId(admissionUserId);
+            billPcr.setAdmissionUserName(admissionUserName);
+            billPcr.setVistitDate(vistitDate);
+            billPcr.setSubDate(subDate);
+            billPcr.setBillStatus(0);
+            billPcr.setProcessId(processId);
+            billPcr.setFarmId(farmId);
+            billPcr.setTestLocationId(testLocationId);
+            billPcr.setTestLocation(testLocation);
+            return billPcr;
+        }
+        if (id == 6) {
+            //洗澡前拍照
+            BillCleanBefore billCleanBefore = new BillCleanBefore();
+            billCleanBefore.setVistitType(vistitType);
+            billCleanBefore.setDestName(destName);
+            billCleanBefore.setDestId(destId);
+            billCleanBefore.setAdmissionUserName(admissionUserName);
+            billCleanBefore.setAdmissionUserId(admissionUserId);
+            billCleanBefore.setVistitDate(vistitDate);
+            billCleanBefore.setSubDate(LocalDateTime.now());
+            billCleanBefore.setPhone(phone);
+            billCleanBefore.setTestLocation(testLocation);
+            billCleanBefore.setTestLocationId(testLocationId);
+            billCleanBefore.setProcessId(processId);
+            billCleanBefore.setFarmId(String.valueOf(farmId));
+            return billCleanBefore;
+        }
+        return null;
+    }
 }
 
 

+ 135 - 193
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPersonnelAdmissionServiceImpl.java

@@ -166,7 +166,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
             allLocation = allLocation + "," + baseWashoutPoint.getTailLocationName();
             allLocationId = allLocationId + "," + "0";
             allLocationStatus = allLocationStatus + "," + "0";
-            if (!baseWashoutPoint.equals(baseWashoutPoints.get(baseWashoutPoints.size()-1))){
+            if (!baseWashoutPoint.equals(baseWashoutPoints.get(baseWashoutPoints.size() - 1))) {
                 allFlowId = allFlowId + ",";
             }
         }
@@ -444,7 +444,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
 
             //通过生成门禁白名单
             QueryWrapper<DeviceList> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("farm_id", billPersonnelAdmission.getFarmId()).eq("location_id", strings[strings.length-1]);
+            queryWrapper.eq("farm_id", billPersonnelAdmission.getFarmId()).eq("location_id", strings[strings.length - 1]);
             DeviceList deviceList = deviceListMapper.selectOne(queryWrapper);
             if (ObjectUtil.isNotEmpty(deviceList)) {
                 if (deviceList.getDeviceType() == 0) {
@@ -551,6 +551,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                         }
                     }
 
+
                     JSONObject jsonObject1 = new JSONObject();
                     JSONArray jsonArray = new JSONArray();
                     JSONObject object1 = new JSONObject();
@@ -964,6 +965,10 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
     private BillCleanMapper cleanMapper;
     @Autowired
     private BillIsolateMapper isolateMapper;
+    @Autowired
+    private BillSamplingMapper samplingMapper;
+    @Autowired
+    private BillCleanBeforeMapper beforeMapper;
 
     @Override
     public Result listPrc(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
@@ -1032,144 +1037,101 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         locationQueryWrapper.eq("id", billPcr.getTestLocationId());
         BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前pcr检测所在的位置
 
-
+        String allLocationId = baseProcess.getAllLocationId();//所有的位置id
+        String allFlowId = baseProcess.getAllFlowId();//所有的流程id
+        String currentFlowId = baseProcess.getCurrentFlowId();//当前已经完成的流程id
+        String substring1 = allFlowId.substring(currentFlowId.length() + 1, allFlowId.length());
+        String[] split = substring1.split(",");
+        Integer nextId = Integer.parseInt(split[0]);
         if (baseProcess.getProcessType() == 2 || baseProcess.getProcessType() == 1) {
             return new Result(10001, "修改失败!该申请已提前结束或者被拒绝", false);
         } else {
-            if (billPcr.getDestId() >= billPcr.getTestLocationId()) {
-                //说明当前不是目的地
-                if ("1".equals(type)) {
-
-                    billPcr.setBillStatus(1);
-                    billPcr.setPcrType(2);
-                    billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                    billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-                    billPcr.setTestLocation(baseLocation.getLocationName());
-                    billPcr.setTestLocationId(baseLocation.getId());
-                    billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
-                    billPcr.setCheckDate(sdf.parse(data));
-
-                    //通过生成洗消记录
-                    BillClean billClean = new BillClean();
-                    billClean.setPhone(billPcr.getPhone());
-                    billClean.setVistitType(billPcr.getVistitType());
-                    billClean.setDestName(billPcr.getDestName());
-                    billClean.setDestId(billPcr.getDestId());
-                    billClean.setAdmissionUserName(billPcr.getAdmissionUserName());
-                    billClean.setAdmissionUserId(billPcr.getAdmissionUserId());
-                    billClean.setVistitDate(billPcr.getVistitDate());
-                    billClean.setSubDate(LocalDateTime.now());
-                    billClean.setFarmId(billPcr.getFarmId());
-                    billClean.setPassUserName(billPcr.getPassUserName());
-                    billClean.setPassDate(billPcr.getPassDate());
-                    billClean.setPassUserId(billPcr.getPassUserId());
-                    billClean.setProcessId(billPcr.getProcessId());
-                    billClean.setTestLocation(baseLocation.getLocationName());
-                    billClean.setTestLocationId(baseLocation.getId());
-                    billClean.setImgStatus(0);
-                    billClean.setCarNum(billPcr.getCarNum());
+            //说明当前不是目的地
+            if ("1".equals(type)) {
+
+                billPcr.setBillStatus(1);
+                billPcr.setPcrType(2);
+                billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
+                billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
+                billPcr.setTestLocation(baseLocation.getLocationName());
+                billPcr.setTestLocationId(baseLocation.getId());
+                billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
+                billPcr.setCheckDate(sdf.parse(data));
+
+                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());
+                if (nextId == 0) {
+                    int index = allLocationId.indexOf(baseLocation.getId());
+                    StringBuilder status = new StringBuilder(baseProcess.getAllLocationId());
+                    status.setCharAt(index, '1');
+                    status.setCharAt(index + 2, '1');
+                    baseProcess.setAllLocationStatus(status.toString());
+                } else if (nextId == 1) {
+                    //新增采样
+                    BillSampling sampling = (BillSampling) newObject;
+                    samplingMapper.insert(sampling);
+                } else if (nextId == 2) {
+                    //新增pcr
+                    BillPcr billClean = (BillPcr) newObject;
+                    pcrMapper.insert(billClean);
+                } else if (nextId == 3) {
+                    //新增洗澡
+                    BillClean billClean = (BillClean) newObject;
                     cleanMapper.insert(billClean);
+                } else if (nextId == 4) {
+                    //新增隔离
+                } else if (nextId == 5) {
+                    BillDry billClean = (BillDry) newObject;
+                    dryMapper.insert(billClean);
+                    //新增烘干
+                } else if (nextId == 6) {
+                    //新增洗澡前拍照
+                    BillCleanBefore before = (BillCleanBefore) newObject;
+                    beforeMapper.insert(before);
+                }
 
-                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-//                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
-//                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
-                    String status = baseProcess.getCurrentStatus();
-                    String substring = status.substring(0, status.length() - 1);
-
-                    baseProcess.setCurrentStatus(substring + "1," + 0);
-
-                    processMapper.updateById(baseProcess);
-                    pcrMapper.updateById(billPcr);
-                    return new Result(10000, "修改成功!", true);
-                } else {
-                    billPcr.setBillStatus(2);
-                    billPcr.setPcrType(3);
-                    billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                    billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-                    billPcr.setTestLocation(baseLocation.getLocationName());
-                    billPcr.setTestLocationId(baseLocation.getId());
-                    billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
-                    billPcr.setCheckDate(sdf.parse(data));
-
-                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-                    String status = baseProcess.getCurrentStatus();
-                    String substring = status.substring(0, status.length() - 1);
+                baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
+                String status = baseProcess.getCurrentStatus();
+                String substring = status.substring(0, status.length() - 1);
 
-                    baseProcess.setCurrentStatus(substring + "2");
-                    baseProcess.setProcessType(2);
+                baseProcess.setCurrentStatus(substring + "1," + 0);
 
-                    String status1 = baseProcess.getAllLocationStatus();
-                    String[] split1 = status1.split(",");
-                    split1[0] = "2";
-                    split1[1] = "3";
-                    baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + status1.substring(3));
-
-                    processMapper.updateById(baseProcess);
-                    pcrMapper.updateById(billPcr);
-                    return new Result(10000, "修改成功!", true);
-                }
+                processMapper.updateById(baseProcess);
+                pcrMapper.updateById(billPcr);
+                return new Result(10000, "修改成功!", true);
             } else {
+                billPcr.setBillStatus(2);
+                billPcr.setPcrType(3);
+                billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
+                billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
+                billPcr.setTestLocation(baseLocation.getLocationName());
+                billPcr.setTestLocationId(baseLocation.getId());
+                billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
+                billPcr.setCheckDate(sdf.parse(data));
 
-                if ("1".equals(type)) {
-
-                    billPcr.setBillStatus(1);
-                    billPcr.setPcrType(2);
-                    billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                    billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-                    billPcr.setTestLocation(baseLocation.getLocationName());
-                    billPcr.setTestLocationId(baseLocation.getId());
-                    billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
-                    billPcr.setCheckDate(sdf.parse(data));
-
-                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-                    String status = baseProcess.getCurrentStatus();
-                    String substring = status.substring(0, status.length() - 1);
-                    baseProcess.setCurrentStatus(substring + "1");
-                    baseProcess.setProcessType(1);
+                baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
+                baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
+                baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
+                String status = baseProcess.getCurrentStatus();
+                String substring = status.substring(0, status.length() - 1);
 
-                    String status1 = baseProcess.getAllLocationStatus();
-                    String[] split1 = status1.split(",");
-                    split1[0] = "2";
-                    split1[1] = "1";
-                    baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + status1.substring(3));
-
-                    processMapper.updateById(baseProcess);
-                    pcrMapper.updateById(billPcr);
-                    return new Result(10000, "修改成功!", true);
-                } else {
-                    baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-                    String status = baseProcess.getCurrentStatus();
-                    String substring = status.substring(0, status.length() - 1);
-                    baseProcess.setCurrentStatus(substring + "2");
-                    baseProcess.setProcessType(2);
-                    billPcr.setBillStatus(2);
-                    billPcr.setPcrType(3);
-                    billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
-                    billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
-                    billPcr.setTestLocation(baseLocation.getLocationName());
-                    billPcr.setTestLocationId(baseLocation.getId());
-                    billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
-                    billPcr.setCheckDate(sdf.parse(data));
+                baseProcess.setCurrentStatus(substring + "2");
+                baseProcess.setProcessType(2);
 
-                    String status1 = baseProcess.getAllLocationStatus();
-                    String[] split1 = status.split(",");
-                    split1[0] = "2";
-                    split1[1] = "3";
-                    baseProcess.setAllLocationStatus(split1[0] + "," + split1[1] + status1.substring(3));
-
-                    processMapper.updateById(baseProcess);
-                    pcrMapper.updateById(billPcr);
-                    return new Result(10000, "修改成功!", true);
-                }
+                String status1 = baseProcess.getAllLocationStatus();
+                StringBuilder sb = new StringBuilder(status1);
+                Integer a = status1.length() - 3;
+                sb.setCharAt(a, '3');
+                baseProcess.setAllLocationStatus(sb.toString());
 
+                processMapper.updateById(baseProcess);
+                pcrMapper.updateById(billPcr);
+                return new Result(10000, "修改成功!", true);
             }
         }
+
     }
 
     @Override
@@ -1226,7 +1188,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         isolateMapper.updateById(isolate);
 
         /*这个地方是人员下发进入生产区洗澡前的一个人脸门禁,可以直接写死 等后期生产区划分后再修改*/
-        //通过生成门禁白名单
+/*        //通过生成门禁白名单
         QueryWrapper<DeviceList> deviceListQueryWrapper = new QueryWrapper<>();
         deviceListQueryWrapper.eq("farm_id", isolate.getFarmId()).eq("location_id", 5);
         List<DeviceList> deviceLists = deviceListMapper.selectList(deviceListQueryWrapper);
@@ -1290,7 +1252,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                         .timeout(30 * 1000).execute().body();
                 System.out.println(post);
             }
-        }
+        }*/
         return new Result(10000, "提交成功!", true);
     }
 
@@ -1298,65 +1260,64 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
     public Result editIsolate(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException {
         String id = paramsMap.get("id");
         String farmId = paramsMap.get("farmId");
-        String remark = paramsMap.get("remark");//是否提前结束隔离的标识
         BillIsolate billIsolate = isolateMapper.selectById(id);
         BaseProcess baseProcess = processMapper.selectById(billIsolate.getProcessId());
         QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
         locationQueryWrapper.eq("id", billIsolate.getIsolateLocationId());
         BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前隔离所在的位置
 
-        QueryWrapper<Exist> existQueryWrapper = new QueryWrapper<>();
-        existQueryWrapper.eq("farm_id", farmId);
-        Exist exist = existMapper.selectOne(existQueryWrapper);//判断是否有二级洗消站
+        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());
+        if (nextId == 0) {
+            int index = allLocationId.indexOf(baseLocation.getId());
+            StringBuilder status = new StringBuilder(baseProcess.getAllLocationId());
+            status.setCharAt(index, '1');
+            status.setCharAt(index + 2, '1');
+            baseProcess.setAllLocationStatus(status.toString());
+        } else if (nextId == 1) {
+            //新增采样
+            BillSampling billSampling = (BillSampling) newObject;
+            samplingMapper.insert(billSampling);
+        }else if (nextId == 2) {
+            //新增pcr
+            BillPcr pcr = (BillPcr) newObject;
+            pcrMapper.insert(pcr);
+        }else if (nextId == 3) {
+            //新增洗澡
+            BillClean pcr = (BillClean) newObject;
+            cleanMapper.insert(pcr);
+        }else if (nextId == 4) {
+            //新增隔离
+            BillIsolate pcr = (BillIsolate) newObject;
+            isolateMapper.insert(pcr);
+        }else if (nextId == 5) {
+            BillDry pcr = (BillDry) newObject;
+            dryMapper.insert(pcr);
+            //新增烘干
+        }else if (nextId == 6) {
+            //新增洗澡前拍照
+            BillCleanBefore before = (BillCleanBefore) newObject;
+            beforeMapper.insert(before);
+        }
 
         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());
-        int res = now.compareTo(end);
 
 
         //提前结束隔离
-        if (baseProcess.getDestId().equals(billIsolate.getIsolateLocationId())) {
-            //目的地就是当前隔离地点
-            baseProcess.setProcessType(1);
-            baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-            baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-        } else {
-            baseProcess.setProcessType(0);
-//            baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
-//            baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
-        }
-
-        if (billIsolate.getIsolateLocationId() == 3 && baseProcess.getDestId() >= 4) {
-            //通过生成洗消记录
-            BillClean billClean = new BillClean();
-            billClean.setVistitType(billIsolate.getVistitType());
-            billClean.setDestName(billIsolate.getDestName());
-            billClean.setDestId(billIsolate.getDestId());
-            billClean.setAdmissionUserName(billIsolate.getAdmissionUserName());
-            billClean.setAdmissionUserId(billIsolate.getAdmissionUserId());
-            billClean.setVistitDate(billIsolate.getVistitDate());
-            billClean.setSubDate(LocalDateTime.now());
-            billClean.setFarmId(billIsolate.getFarmId());
-            billClean.setPassUserName(billIsolate.getPassUserName());
-            billClean.setPassDate(billIsolate.getPassDate());
-            billClean.setPassUserId(billIsolate.getPassUserId());
-            billClean.setProcessId(billIsolate.getProcessId());
-            billClean.setTestLocation("场内");
-            billClean.setTestLocationId(4);
-            billClean.setPhone(billIsolate.getPhone());
-            cleanMapper.insert(billClean);
-
-            String status = baseProcess.getAllLocationStatus();
-            String[] split = status.split(",");
-            split[0] = "2";
-            split[1] = "2";
-            split[2] = "2";
-            split[3] = "2";
-            split[4] = "1";
-            baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + "," + split[4] + status.substring(9));
-        }
+        baseProcess.setProcessType(1);
+        baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
+        baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
         billIsolate.setIsolateRealEndDate(new Date());
         SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
         Calendar cal1 = Calendar.getInstance();
@@ -1369,7 +1330,6 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         Integer l1 = (Integer.parseInt(String.valueOf(days / 24)));
         long l = l1 % 24;
         String num = l1.toString() + "天" + l + "小时";
-//            long days = (cal2.getTimeInMillis() - cal1.getTimeInMillis()) / (1000 * 3600 * 24);
         billIsolate.setIsolateRealDayNum(num);
         billIsolate.setBillStatus(3);
         billIsolate.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
@@ -1380,25 +1340,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         String status = baseProcess.getCurrentStatus();
         String substring = status.substring(0, status.length() - 1);
         baseProcess.setCurrentStatus(substring + "1," + 0);
-
-        if (billIsolate.getIsolateLocationId() == 5 && exist.getExist() == 0) {
-
-            baseProcess.setAllLocationStatus("2,2,2,2,2,2");
-        }
-        if (billIsolate.getIsolateLocationId() == 5 && exist.getExist() == 1) {
-
-            baseProcess.setAllLocationStatus("2,2,2,2,2");
-        }
-
-        if (billIsolate.getIsolateLocationId() == 3) {
-            String status1 = baseProcess.getAllLocationStatus();
-            String[] split = status1.split(",");
-            split[0] = "2";
-            split[1] = "2";
-            split[2] = "2";
-            split[3] = "2";
-            baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + status1.substring(7));
-        }
+        baseProcess.setCurrentFlowId(baseProcess.getCurrentLocationId() + "," + nextId);
 
 
         isolateMapper.updateById(billIsolate);

+ 5 - 5
huimv-receive/src/main/resources/application-prod.yml

@@ -1,9 +1,9 @@
 server:
   port: 8015
-  ssl:
-    key-store: classpath:10767421_huatong.ifarmcloud.com.jks
-    key-store-type: jks
-    key-store-password: sjp124g3
+#  ssl:
+#    key-store: classpath:10767421_huatong.ifarmcloud.com.jks
+#    key-store-type: jks
+#    key-store-password: sjp124g3
 
 spring:
   application:
@@ -17,7 +17,7 @@ spring:
 
   datasource:
     druid:
-      url: jdbc:mysql://115.238.57.190:3306/huimv-huatong-secure?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+      url: jdbc:mysql://115.238.57.190:3306/huimv-huatong-test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
       username: root
       password: WICi9V6VC1GYjMR0ITj5mzmW7dzu7UsYubjyyHJbx3TlL7L8n+CGCnPE61gLWuhxn4mKqX7zdrYCfKy/4rITtg==
       driver-class-name: com.mysql.cj.jdbc.Driver