Explorar o código

添加物资分类流程

wwh hai 1 ano
pai
achega
a4624e8f9c

+ 24 - 7
huimv-receive/src/main/java/com/huimv/receive/common/utils/FlowUtil.java

@@ -7,8 +7,8 @@ import java.time.LocalDateTime;
 
 @Component
 public class FlowUtil {
-    public Object getEntity(Integer nextFlowId,Integer vistitType, String destName, Integer destId, Integer userId, String userName, String phone, LocalDateTime vistitDate, Integer locationId, String locationName, Integer farmId, Integer processId, String departureName, Integer departureId){
-        if (nextFlowId == 1){
+    public Object getEntity(Integer nextFlowId, Integer vistitType, String destName, Integer destId, Integer userId, String userName, String phone, LocalDateTime vistitDate, Integer locationId, String locationName, Integer farmId, Integer processId, String departureName, Integer departureId) {
+        if (nextFlowId == 1) {
             BillSampling billSampling = new BillSampling();
             billSampling.setVistitType(vistitType);
             billSampling.setDestName(destName);
@@ -25,7 +25,7 @@ public class FlowUtil {
             billSampling.setDepartureId(departureId);
             billSampling.setDepartureName(departureName);
             return billSampling;
-        }else if (nextFlowId == 2){
+        } else if (nextFlowId == 2) {
             BillPcr billPcr = new BillPcr();
             billPcr.setVistitType(vistitType);
             billPcr.setDestName(destName);
@@ -42,7 +42,7 @@ public class FlowUtil {
             billPcr.setDepartureId(departureId);
             billPcr.setDepartureName(departureName);
             return billPcr;
-        }else if (nextFlowId == 3){
+        } else if (nextFlowId == 3) {
             BillClean billClean = new BillClean();
             billClean.setVistitType(vistitType);
             billClean.setDestName(destName);
@@ -59,7 +59,7 @@ public class FlowUtil {
             billClean.setDepartureId(departureId);
             billClean.setDepartureName(departureName);
             return billClean;
-        }else if (nextFlowId == 4){
+        } else if (nextFlowId == 4) {
             BillIsolate billIsolate = new BillIsolate();
             billIsolate.setVistitType(vistitType);
             billIsolate.setDestName(destName);
@@ -76,7 +76,7 @@ public class FlowUtil {
             billIsolate.setDepartureId(departureId);
             billIsolate.setDepartureName(departureName);
             return billIsolate;
-        }else if (nextFlowId == 5){
+        } else if (nextFlowId == 5) {
             BillDry billDry = new BillDry();
             billDry.setVistitType(vistitType);
             billDry.setDestName(destName);
@@ -93,7 +93,7 @@ public class FlowUtil {
             billDry.setDepartureId(departureId);
             billDry.setDepartureName(departureName);
             return billDry;
-        }else {
+        } else if (nextFlowId == 6) {
             BillCleanBefore billCleanBefore = new BillCleanBefore();
             billCleanBefore.setVistitType(vistitType);
             billCleanBefore.setDestName(destName);
@@ -110,6 +110,23 @@ public class FlowUtil {
             billCleanBefore.setDepartureId(departureId);
             billCleanBefore.setDepartureName(departureName);
             return billCleanBefore;
+        } else{
+            BillGoodsInventory billCleanBefore = new BillGoodsInventory();
+            billCleanBefore.setVistitType(vistitType);
+            billCleanBefore.setDestName(destName);
+            billCleanBefore.setDestId(destId);
+            billCleanBefore.setAdmissionUserName(userName);
+            billCleanBefore.setAdmissionUserId(userId);
+            billCleanBefore.setVistitDate(vistitDate);
+            billCleanBefore.setSubDate(LocalDateTime.now());
+            billCleanBefore.setPhone(phone);
+            billCleanBefore.setCurrentLocation(locationName);
+            billCleanBefore.setCurrentLocationId(locationId);
+            billCleanBefore.setBillAdmission(processId);
+            billCleanBefore.setFarmId(String.valueOf(farmId));
+            billCleanBefore.setDepartureId(departureId);
+            billCleanBefore.setDepartureName(departureName);
+            return billCleanBefore;
         }
     }
 }

+ 17 - 0
huimv-receive/src/main/java/com/huimv/receive/controller/BillGoodsInventoryController.java

@@ -2,6 +2,7 @@ package com.huimv.receive.controller;
 
 
 import com.huimv.receive.common.utils.Result;
+import com.huimv.receive.common.utils.ResultCode;
 import com.huimv.receive.service.IBillGoodsInventoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
@@ -32,4 +33,20 @@ public class BillGoodsInventoryController {
     public Result listAll(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
         return goodsInventoryService.listAll(httpServletRequest, paramsMap);
     }
+
+    @RequestMapping("/edit")
+    public Result edit(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
+        return goodsInventoryService.edit(httpServletRequest, paramsMap);
+    }
+
+    @RequestMapping("/list")
+    public Result list(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
+        return goodsInventoryService.list(httpServletRequest, paramsMap);
+    }
+
+    @RequestMapping("/listById")
+    public Result listById(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
+        String id = paramsMap.get("id");
+        return new Result(ResultCode.SUCCESS,goodsInventoryService.getById(id));
+    }
 }

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

@@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.time.LocalDateTime;
 import java.util.Date;
 
 /**
@@ -66,5 +67,50 @@ public class BillGoodsInventory implements Serializable {
 
     private String farmId;
 
+    private Integer vistitType;
+
+    /**
+     * 目的地
+     */
+    private String destName;
+
+    /**
+     * 目的地 id
+     */
+    private Integer destId;
+
+    /**
+     * 申请人
+     */
+    private String admissionUserName;
+
+    /**
+     * 申请人id
+     */
+    private Integer admissionUserId;
+
+    /**
+     * 来访时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private LocalDateTime vistitDate;
+
+    /**
+     * 提交时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private LocalDateTime subDate;
+
+    private String departureName;
+
+    private Integer departureId;
+
+    private Integer userId;
+
+    private String userName;
+
+    private String phone;
+
+    private String carNum;
 
 }

+ 4 - 0
huimv-receive/src/main/java/com/huimv/receive/service/IBillGoodsInventoryService.java

@@ -17,4 +17,8 @@ import java.util.Map;
  */
 public interface IBillGoodsInventoryService extends IService<BillGoodsInventory> {
     Result listAll(HttpServletRequest httpServletRequest, Map<String,String> paramsMap);
+
+    Result edit(HttpServletRequest httpServletRequest, Map<String,String> paramsMap);
+
+    Result list(HttpServletRequest httpServletRequest, Map<String,String> paramsMap);
 }

+ 18 - 0
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanBeforeServiceImpl.java

@@ -57,6 +57,8 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
     private BillSamplingMapper samplingMapper;
     @Autowired
     private BillDryMapper dryMapper;
+    @Autowired
+    private BillGoodsInventoryMapper inventoryMapper;
 
 
     @Override
@@ -230,6 +232,13 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
                         before.setCarNum(cleanBefore.getCarNum());
                     }
                     billCleanBeforeMapper.insert(before);
+                }else if (Integer.parseInt(split[1]) == 7) {
+                    //新增洗澡前拍照
+                    BillGoodsInventory before = (BillGoodsInventory) entity;
+                    if (cleanBefore.getVistitType() != 0) {
+                        before.setCarNum(cleanBefore.getCarNum());
+                    }
+                    inventoryMapper.insert(before);
                 }
                 baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + split[1]);
                 if (allLocationId.length() > 9) {
@@ -288,6 +297,15 @@ public class BillCleanBeforeServiceImpl extends ServiceImpl<BillCleanBeforeMappe
             billCleanBeforeMapper.insert(before);
             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
         }
+        else if (nextId == 7) {
+            //新增洗澡前拍照
+            BillGoodsInventory before = (BillGoodsInventory) newObject;
+            if (cleanBefore.getVistitType() != 0) {
+                before.setCarNum(cleanBefore.getCarNum());
+            }
+            inventoryMapper.insert(before);
+            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+        }
         baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + LocalDateTime.now().format(dateTimeFormatter));
         baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
         baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());

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

@@ -566,6 +566,8 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
     private BillCleanBeforeMapper beforeMapper;
     @Autowired
     private BillSamplingMapper samplingMapper;
+    @Autowired
+    private BillGoodsInventoryMapper inventoryMapper;
 
 
     @Override
@@ -919,6 +921,13 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                                 before.setCarNum(billClean.getCarNum());
                             }
                             beforeMapper.insert(before);
+                        }else if (Integer.parseInt(splits[1]) == 7) {
+                            //新增洗澡前拍照
+                            BillGoodsInventory before = (BillGoodsInventory) entity;
+                            if (billClean.getVistitType() != 0) {
+                                before.setCarNum(billClean.getCarNum());
+                            }
+                            inventoryMapper.insert(before);
                         }
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + splits[1]);
                         if (allLocationId.length() > 9) {
@@ -976,6 +985,14 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     }
                     beforeMapper.insert(before);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                }else if (nextId == 7) {
+                    //新增洗澡前拍照
+                    BillGoodsInventory before = (BillGoodsInventory) newObject;
+                    if (billClean.getVistitType() != 0) {
+                        before.setCarNum(billClean.getCarNum());
+                    }
+                    inventoryMapper.insert(before);
+                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                 }
                 baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
                 baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
@@ -1117,6 +1134,13 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                                     before.setCarNum(billClean.getCarNum());
                                 }
                                 beforeMapper.insert(before);
+                            }else if (Integer.parseInt(splits[1]) == 7) {
+                                //新增洗澡前拍照
+                                BillGoodsInventory before = (BillGoodsInventory) entity;
+                                if (billClean.getVistitType() != 0) {
+                                    before.setCarNum(billClean.getCarNum());
+                                }
+                                inventoryMapper.insert(before);
                             }
                             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + splits[1]);
                             if (allLocationId.length() > 9) {
@@ -1174,6 +1198,14 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                         }
                         beforeMapper.insert(before);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                    }else if (nextId == 7) {
+                        //新增洗澡前拍照
+                        BillGoodsInventory before = (BillGoodsInventory) newObject;
+                        if (billClean.getVistitType() != 0) {
+                            before.setCarNum(billClean.getCarNum());
+                        }
+                        inventoryMapper.insert(before);
+                        baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                     }
 
                     baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));

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

@@ -1,17 +1,23 @@
 package com.huimv.receive.service.impl;
 
 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huimv.receive.common.token.TokenSign;
+import com.huimv.receive.common.utils.FlowUtil;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.ResultCode;
-import com.huimv.receive.entity.BillGoodsInventory;
+import com.huimv.receive.entity.*;
 import com.huimv.receive.entity.vo.BillGoodsInventoryVo;
-import com.huimv.receive.mapper.BillGoodsInventoryMapper;
+import com.huimv.receive.mapper.*;
 import com.huimv.receive.service.IBillGoodsInventoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Calendar;
 import java.util.List;
 import java.util.Map;
@@ -29,6 +35,22 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
 
     @Autowired
     private BillGoodsInventoryMapper inventoryMapper;
+    @Autowired
+    private BaseProcessMapper processMapper;
+    @Autowired
+    private BaseLocationMapper locationMapper;
+    @Autowired
+    private BillPcrMapper pcrMapper;
+    @Autowired
+    private BillCleanMapper cleanMapper;
+    @Autowired
+    private BillIsolateMapper isolateMapper;
+    @Autowired
+    private BillDryMapper dryMapper;
+    @Autowired
+    private BillCleanBeforeMapper billCleanBeforeMapper;
+    @Autowired
+    private BillSamplingMapper billSamplingMapper;
 
     @Override
     public Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
@@ -40,4 +62,223 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
         List<BillGoodsInventoryVo> billGoodsInventoryVos = inventoryMapper.listAll(queryWrapper);
         return new Result(ResultCode.SUCCESS, billGoodsInventoryVos);
     }
+
+    @Override
+    public Result edit(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
+        String id = paramsMap.get("id");
+        String goodsType = paramsMap.get("goodsType");
+        String goodsTypeName = paramsMap.get("goodsTypeName");
+        String goodsNum = paramsMap.get("goodsNum");
+        String goodsName = paramsMap.get("goodsName");
+        String goodsUnit = paramsMap.get("goodsUnit");
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
+        BillGoodsInventory goodsInventory = inventoryMapper.selectById(id);
+        goodsInventory.setGoodsName(goodsName);
+        goodsInventory.setGoodsType(goodsType);
+        goodsInventory.setGoodsNums(goodsNum);
+        goodsInventory.setGoodsTypeName(goodsTypeName);
+        goodsInventory.setUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
+        goodsInventory.setUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
+        goodsInventory.setGoodsUnit(goodsUnit);
+        goodsInventory.setSubDate(LocalDateTime.now());
+
+        QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
+        processQueryWrapper.eq("farm_id", goodsInventory.getFarmId()).eq("id", goodsInventory.getBillAdmission());
+        BaseProcess baseProcess = processMapper.selectOne(processQueryWrapper);//进程
+
+        QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
+        locationQueryWrapper.eq("id", goodsInventory.getCurrentLocationId());
+        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]);
+
+
+        Object newObject = BillPcrServiceImpl.getNewObject(nextId, goodsInventory.getDestName(), goodsInventory.getDestId(), goodsInventory.getAdmissionUserName(),
+                goodsInventory.getAdmissionUserId(), goodsInventory.getVistitDate(), goodsInventory.getSubDate(),
+                goodsInventory.getBillAdmission(), Integer.parseInt(goodsInventory.getFarmId()), goodsInventory.getCurrentLocation(), goodsInventory.getCurrentLocationId(),
+                goodsInventory.getVistitType(), goodsInventory.getPhone(),goodsInventory.getDepartureName(),goodsInventory.getDepartureId());
+        if (nextId == 0) {
+            if (split.length == 1) {
+                baseProcess.setProcessType(1);
+                if (allLocationId.length() > 9) {
+                    baseProcess.setAllLocationStatus("2,2,2,2,2,2,2");
+                } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
+                    baseProcess.setAllLocationStatus("2,2,2,2,2");
+                } else {
+                    baseProcess.setAllLocationStatus("2,2,2");
+                }
+            } else {
+                String[] strings = allLocationId.split(",");
+                Integer index = 0;
+                for (int i = 0; i < strings.length; i++) {
+                    if ((baseLocation.getId().toString()).equals(strings[i])) {
+                        index = i;
+                    }
+                }
+                QueryWrapper<BaseLocation> queryWrapper1 = new QueryWrapper();
+                queryWrapper1.eq("id", strings[index + 2]);
+                BaseLocation location = locationMapper.selectOne(queryWrapper1);
+                FlowUtil flowUtil = new FlowUtil();
+                Object entity = flowUtil.getEntity(Integer.parseInt(split[1]), goodsInventory.getVistitType(), goodsInventory.getDestName()
+                        , goodsInventory.getDestId(), goodsInventory.getAdmissionUserId(), goodsInventory.getAdmissionUserName(), goodsInventory.getPhone(),
+                        goodsInventory.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(goodsInventory.getFarmId())
+                        , baseProcess.getId(), goodsInventory.getDepartureName(), goodsInventory.getDepartureId());
+                if (Integer.parseInt(split[1]) == 1) {
+                    //新增采样
+                    BillSampling billSampling = (BillSampling) entity;
+                    if (goodsInventory.getVistitType() != 0) {
+                        billSampling.setCarNum(goodsInventory.getCarNum());
+                    }
+                    billSamplingMapper.insert(billSampling);
+                } else if (Integer.parseInt(split[1]) == 2) {
+                    //新增pcr
+                    BillPcr billClean = (BillPcr) entity;
+                    if (goodsInventory.getVistitType() != 0) {
+                        billClean.setCarNum(goodsInventory.getCarNum());
+                    }
+                    pcrMapper.insert(billClean);
+                } else if (Integer.parseInt(split[1]) == 3) {
+                    //新增洗澡
+                    BillClean billClean = (BillClean) entity;
+                    if (goodsInventory.getVistitType() != 0) {
+                        billClean.setCarNum(goodsInventory.getCarNum());
+                    }
+                    cleanMapper.insert(billClean);
+                } else if (Integer.parseInt(split[1]) == 4) {
+                    //新增隔离
+                    BillIsolate pcr = (BillIsolate) entity;
+                    isolateMapper.insert(pcr);
+                } else if (Integer.parseInt(split[1]) == 5) {
+                    BillDry billClean = (BillDry) entity;
+                    if (goodsInventory.getVistitType() != 0) {
+                        billClean.setCarNum(goodsInventory.getCarNum());
+                    }
+                    dryMapper.insert(billClean);
+                    //新增烘干
+                } else if (Integer.parseInt(split[1]) == 6) {
+                    //新增洗澡前拍照
+                    BillCleanBefore before = (BillCleanBefore) entity;
+                    if (goodsInventory.getVistitType() != 0) {
+                        before.setCarNum(goodsInventory.getCarNum());
+                    }
+                    billCleanBeforeMapper.insert(before);
+                }
+                else if (Integer.parseInt(split[1]) == 7) {
+                    //新增洗澡前拍照
+                    BillGoodsInventory before = (BillGoodsInventory) entity;
+                    if (goodsInventory.getVistitType() != 0) {
+                        before.setCarNum(goodsInventory.getCarNum());
+                    }
+                    inventoryMapper.insert(before);
+                }
+                baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + split[1]);
+                if (allLocationId.length() > 9) {
+                    if (index == 1) {
+                        baseProcess.setAllLocationStatus("2,2,2,1,0,0,0");
+                    } else {
+                        baseProcess.setAllLocationStatus("2,2,2,2,2,1,0");
+                    }
+                } else if (allLocationId.length() > 5 && allLocationId.length() < 10) {
+                    baseProcess.setAllLocationStatus("2,2,2,1,0");
+                }
+            }
+        } else if (nextId == 1) {
+            //新增采样
+            BillSampling billSampling = (BillSampling) newObject;
+            if (goodsInventory.getVistitType() != 0) {
+                billSampling.setCarNum(goodsInventory.getCarNum());
+            }
+            billSamplingMapper.insert(billSampling);
+            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+        }else if (nextId == 2) {
+            //新增pcr
+            BillPcr billClean = (BillPcr) newObject;
+            if (goodsInventory.getVistitType() != 0) {
+                billClean.setCarNum(goodsInventory.getCarNum());
+            }
+            pcrMapper.insert(billClean);
+            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+        }else if (nextId == 3) {
+            //新增洗澡
+            BillClean billClean = (BillClean) newObject;
+            if (goodsInventory.getVistitType() != 0) {
+                billClean.setCarNum(goodsInventory.getCarNum());
+            }
+            cleanMapper.insert(billClean);
+            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+        }else if (nextId == 4) {
+            //新增隔离
+            BillIsolate pcr = (BillIsolate) newObject;
+            isolateMapper.insert(pcr);
+            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+        }else if (nextId == 5) {
+            BillDry billClean = (BillDry) newObject;
+            if (goodsInventory.getVistitType() != 0) {
+                billClean.setCarNum(goodsInventory.getCarNum());
+            }
+            dryMapper.insert(billClean);
+            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+            //新增烘干
+        }else if (nextId == 6) {
+            //新增洗澡前拍照
+            BillCleanBefore before = (BillCleanBefore) newObject;
+            if (goodsInventory.getVistitType() != 0) {
+                before.setCarNum(goodsInventory.getCarNum());
+            }
+            billCleanBeforeMapper.insert(before);
+            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+        }
+        else if (nextId == 7) {
+            //新增洗澡前拍照
+            BillGoodsInventory before = (BillGoodsInventory) newObject;
+            if (goodsInventory.getVistitType() != 0) {
+                before.setCarNum(goodsInventory.getCarNum());
+            }
+            inventoryMapper.insert(before);
+            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+        }
+        baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + LocalDateTime.now().format(dateTimeFormatter));
+        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);
+        inventoryMapper.updateById(goodsInventory);
+        return new Result(10000, "修改成功!", true);
+    }
+
+    @Override
+    public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
+        String farmId = paramsMap.get("farmId");
+        String type = paramsMap.get("type");//0 全部 1未填写 2已填写
+        String data = paramsMap.get("data");//来访类型
+        String pageNum = paramsMap.get("pageNum");
+        String pageSize = paramsMap.get("pageSize");
+        if ("".equals(pageNum) || null == pageNum) {
+            pageNum = "1";
+        }
+        if ("".equals(pageSize) || null == pageSize) {
+            pageSize = "10";
+        }
+        if ("".equals(type) || null == type) {
+            type = "0";
+        }
+        QueryWrapper<BillGoodsInventory> queryWrapper = new QueryWrapper<>();
+        Page<BillGoodsInventory> page = new Page(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+        queryWrapper.eq("farm_id", farmId).orderByDesc("sub_date");
+        queryWrapper.eq(StringUtils.isNotBlank(data), "vistit_type", data);
+        if ("0".equals(type)) {
+            queryWrapper.in("status", 0, 1);
+        } else {
+            queryWrapper.eq("status", type);
+        }
+        return new Result(ResultCode.SUCCESS,inventoryMapper.selectPage(page,queryWrapper));
+    }
 }

+ 40 - 0
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPcrServiceImpl.java

@@ -53,6 +53,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
 
     @Resource
     private BillPcrMapper billPcrMapper;
+    @Autowired
+    private BillGoodsInventoryMapper inventoryMapper;
 
     @Override
     public Result listPersonalPcr(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
@@ -476,6 +478,14 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
                             }
                             beforeMapper.insert(before);
                         }
+                        else if (Integer.parseInt(split[1]) == 7) {
+                            //新增洗澡前拍照
+                            BillGoodsInventory before = (BillGoodsInventory) entity;
+                            if (billPcr.getVistitType() != 0) {
+                                before.setCarNum(billPcr.getCarNum());
+                            }
+                            inventoryMapper.insert(before);
+                        }
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + split[1]);
                         if (allLocationId.length() > 9) {
                             if (index == 1) {
@@ -533,6 +543,15 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
                     beforeMapper.insert(before);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                 }
+                else if (nextId == 7) {
+                    //新增洗澡前拍照
+                    BillGoodsInventory before = (BillGoodsInventory) newObject;
+                    if (billPcr.getVistitType() != 0) {
+                        before.setCarNum(billPcr.getCarNum());
+                    }
+                    inventoryMapper.insert(before);
+                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                }
 //                //通过生成门禁白名单
 //                QueryWrapper<DeviceList> deviceListQueryWrapper = new QueryWrapper<>();
 //                deviceListQueryWrapper.eq("farm_id", billPcr.getFarmId()).eq("location_id", baseLocation.getId());
@@ -806,6 +825,27 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
             billCleanBefore.setDepartureId(departureId);
             return billCleanBefore;
         }
+
+        if (id == 7) {
+            //洗澡前拍照
+            BillGoodsInventory billCleanBefore = new BillGoodsInventory();
+            billCleanBefore.setVistitType(vistitType);
+            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.setCurrentLocation(testLocation);
+            billCleanBefore.setCurrentLocationId(testLocationId);
+            billCleanBefore.setBillAdmission(processId);
+            billCleanBefore.setFarmId(String.valueOf(farmId));
+            billCleanBefore.setDepartureName(departureName);
+            billCleanBefore.setDepartureId(departureId);
+            return billCleanBefore;
+        }
         return null;
     }
 }

+ 11 - 0
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPersonnelAdmissionServiceImpl.java

@@ -93,6 +93,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
     private BillCleanBeforeMapper billCleanBeforeMapper;
     @Autowired
     private FlowUtil flowUtil;
+    @Autowired
+    private BillGoodsInventoryMapper inventoryMapper;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -1352,6 +1354,10 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                     //新增洗澡前拍照
                     BillCleanBefore before = (BillCleanBefore) entity;
                     beforeMapper.insert(before);
+                }else if (Integer.parseInt(splits[1]) == 7) {
+                    //新增洗澡前拍照
+                    BillGoodsInventory before = (BillGoodsInventory) entity;
+                    inventoryMapper.insert(before);
                 }
                 baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + splits[1]);
                 if (allLocationId.length() > 9) {
@@ -1394,6 +1400,11 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
             BillCleanBefore before = (BillCleanBefore) newObject;
             beforeMapper.insert(before);
             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+        }else if (nextId == 7) {
+            //新增洗澡前拍照
+            BillGoodsInventory before = (BillGoodsInventory) newObject;
+            inventoryMapper.insert(before);
+            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
         }
 
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

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

@@ -59,6 +59,8 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
     private BillDryMapper dryMapper;
     @Autowired
     private BillCleanBeforeMapper billCleanBeforeMapper;
+    @Autowired
+    private BillGoodsInventoryMapper inventoryMapper;
 
     @Override
     public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
@@ -233,6 +235,13 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
                         before.setCarNum(sampling.getCarNum());
                     }
                     billCleanBeforeMapper.insert(before);
+                }else if (Integer.parseInt(split[1]) == 7) {
+                    //新增洗澡前拍照
+                    BillGoodsInventory before = (BillGoodsInventory) entity;
+                    if (sampling.getVistitType() != 0) {
+                        before.setCarNum(sampling.getCarNum());
+                    }
+                    inventoryMapper.insert(before);
                 }
                 baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + split[1]);
                 if (allLocationId.length() > 9) {
@@ -291,6 +300,15 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
             billCleanBeforeMapper.insert(before);
             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
         }
+        else if (nextId == 7) {
+            //新增洗澡前拍照
+            BillGoodsInventory before = (BillGoodsInventory) newObject;
+            if (sampling.getVistitType() != 0) {
+                before.setCarNum(sampling.getCarNum());
+            }
+            inventoryMapper.insert(before);
+            baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+        }
         baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + LocalDateTime.now().format(dateTimeFormatter));
         baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
         baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());

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

@@ -48,6 +48,8 @@ public class SafeTimer {
     private IBillCleanBeforeService beforeService;
     @Autowired
     private IBillSamplingService samplingService;
+    @Autowired
+    private IBillGoodsInventoryService inventoryService;
 
 
     @Scheduled(cron = "0 0/1 * * * ? ")
@@ -133,6 +135,10 @@ public class SafeTimer {
                             //新增洗澡前拍照
                             BillCleanBefore before = (BillCleanBefore) entity;
                             beforeService.save(before);
+                        } else if (Integer.parseInt(splits[1]) == 7) {
+                            //新增洗澡前拍照
+                            BillGoodsInventory before = (BillGoodsInventory) entity;
+                            inventoryService.save(before);
                         }
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + splits[1]);
                         if (allLocationId.length() > 9) {
@@ -175,6 +181,11 @@ public class SafeTimer {
                     BillCleanBefore before = (BillCleanBefore) newObject;
                     beforeService.save(before);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
+                }else if (nextId == 7) {
+                    //新增洗澡前拍照
+                    BillGoodsInventory before = (BillGoodsInventory) newObject;
+                    inventoryService.save(before);
+                    baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                 }