wwh 10 mesiacov pred
rodič
commit
ce5d268418

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

@@ -38,8 +38,9 @@ public class BillGoodsInventoryController {
     @RequestMapping("/edit")
     public Result edit(HttpServletRequest httpServletRequest, @RequestParam("id") String id,
                        @RequestParam("goods") String goods,
-                       @RequestParam("imgUrl")MultipartFile imgUrl) throws IOException {
-        return goodsInventoryService.edit(httpServletRequest, id,goods,imgUrl);
+                       @RequestParam("imgUrl")MultipartFile imgUrl,
+                       @RequestParam("wayType")String wayType) throws IOException {
+        return goodsInventoryService.edit(httpServletRequest, id,goods,imgUrl,wayType);
     }
 
     @RequestMapping("/list")

+ 32 - 1
huimv-receive/src/main/java/com/huimv/receive/controller/BillPersonnelAdmissionController.java

@@ -100,7 +100,7 @@ public class BillPersonnelAdmissionController {
                                    @RequestParam("remark") String remark) throws IOException {
         return billPersonnelAdmissionService.addAdmissionFeed(httpServletRequest, admissionType,
                 vistitType, userName, phone, workName, papersType, papersCode, imgUrl, img, vistitDate, vistitReson, destId
-                , destName, farmId, carNum, source, goods, departureId, departureName,resource,feedImgUrl,cleanId,cleanName,remark);
+                , destName, farmId, carNum, source, goods, departureId, departureName, resource, feedImgUrl, cleanId, cleanName, remark);
     }
 
     @PostMapping("/listPersonalAdmission")
@@ -263,4 +263,35 @@ public class BillPersonnelAdmissionController {
     public Result listDoor(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) throws ParseException {
         return admissionService.listDoor(httpServletRequest, paramsMap);
     }
+
+    //
+    @PostMapping("/helpAddAdmission")
+    public Result helpAddAdmission(HttpServletRequest httpServletRequest, @RequestParam("admissionType") String admissionType,
+                                   @RequestParam("vistitType") String vistitType,
+                                   @RequestParam("userName") String userName,
+                                   @RequestParam("phone") String phone,
+                                   @RequestParam("workName") String workName,
+                                   @RequestParam("papersType") String papersType,
+                                   @RequestParam("papersCode") String papersCode,
+                                   @RequestParam(value = "userImgUrl", required = false) MultipartFile userImgUrl,
+                                   @RequestParam(value = "imgUrl", required = false) MultipartFile imgUrl,
+                                   @RequestParam(value = "img", required = false) String img,
+                                   @RequestParam("vistitDate") String vistitDate,
+                                   @RequestParam("vistitReson") String vistitReson,
+                                   @RequestParam("departureId") String departureId,
+                                   @RequestParam("departureName") String departureName,
+                                   @RequestParam("destId") String destId,
+                                   @RequestParam("destName") String destName,
+                                   @RequestParam(value = "carNum", required = false) String carNum,
+                                   @RequestParam(value = "source", required = false) String source,
+                                   @RequestParam(value = "goods", required = false) String goods,
+                                   @RequestParam("farmId") String farmId,
+                                   @RequestParam(value = "picture1",required = false) MultipartFile picture1,
+                                   @RequestParam(value = "picture2",required = false) MultipartFile picture2,
+                                   @RequestParam(value = "picture3",required = false) MultipartFile picture3) throws IOException {
+        return billPersonnelAdmissionService.helpAddAdmission(httpServletRequest, userImgUrl, admissionType,
+                vistitType, userName, phone, workName, papersType, papersCode, imgUrl, img, vistitDate, vistitReson,
+                destId, destName, farmId, carNum, source, goods, departureId, departureName,picture1,picture2,picture3);
+    }
+
 }

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

@@ -128,4 +128,6 @@ public class BillGoodsInventory implements Serializable {
     private Integer billStatus;
 
     private Integer processId;
+
+    private String wayType;
 }

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

@@ -20,7 +20,7 @@ import java.util.Map;
 public interface IBillGoodsInventoryService extends IService<BillGoodsInventory> {
     Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
-    Result edit(HttpServletRequest httpServletRequest, String id, String goods, MultipartFile imgUrl) throws IOException;
+    Result edit(HttpServletRequest httpServletRequest, String id, String goods, MultipartFile imgUrl, String wayType) throws IOException;
 
     Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 }

+ 9 - 0
huimv-receive/src/main/java/com/huimv/receive/service/IBillPersonnelAdmissionService.java

@@ -1,6 +1,7 @@
 package com.huimv.receive.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.entity.BillIsolate;
 import com.huimv.receive.entity.BillPersonnelAdmission;
@@ -78,4 +79,12 @@ public interface IBillPersonnelAdmissionService extends IService<BillPersonnelAd
     Result allCount(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
     Result uploadImgAndAdmissin(MultipartFile imgUrl, Integer id) throws IOException;
+
+
+    //站点人员帮忙提交入场申请
+    Result helpAddAdmission(HttpServletRequest httpServletRequest,MultipartFile userImgUrl,  String admissionType, String vistitType, String userName,
+                            String phone, String workName, String papersType, String papersCode, MultipartFile imgUrl,
+                            String img, String vistitDate, String vistitReson, String destId, String destName,
+                            String farmId, String carNum, String source, String goods, String departureId, String departureName,
+                            MultipartFile picture1,MultipartFile picture2,MultipartFile picture3) throws IOException;
 }

+ 10 - 11
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillGoodsInventoryServiceImpl.java

@@ -75,7 +75,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
     }
 
     @Override
-    public Result edit(HttpServletRequest httpServletRequest, String id,String goods, MultipartFile imgUrl) throws IOException {
+    public Result edit(HttpServletRequest httpServletRequest, String id, String goods, MultipartFile imgUrl, String wayType) throws IOException {
 
         DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
         BillGoodsInventory goodsInventory = inventoryMapper.selectById(id);
@@ -98,6 +98,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
         goodsInventory.setGoodsUnit(goodsUnit);
         goodsInventory.setBillStatus(1);
         goodsInventory.setSubDate(LocalDateTime.now());
+        goodsInventory.setWayType(wayType);
         if (ObjectUtil.isNotEmpty(imgUrl)) {
             if (uploadImage.getImageCom(imgUrl).equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -125,7 +126,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
         Object newObject = BillPcrServiceImpl.getNewObject(nextId, goodsInventory.getDestName(), goodsInventory.getDestId(), goodsInventory.getAdmissionUserName(),
                 goodsInventory.getAdmissionUserId(), goodsInventory.getVistitDate(), goodsInventory.getSubDate(),
                 goodsInventory.getBillAdmission(), Integer.parseInt(goodsInventory.getFarmId()), goodsInventory.getTestLocation(), goodsInventory.getTestLocationId(),
-                goodsInventory.getVistitType(), goodsInventory.getPhone(),goodsInventory.getDepartureName(),goodsInventory.getDepartureId());
+                goodsInventory.getVistitType(), goodsInventory.getPhone(), goodsInventory.getDepartureName(), goodsInventory.getDepartureId());
         if (nextId == 0) {
             if (split.length == 1) {
                 baseProcess.setProcessType(1);
@@ -228,8 +229,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
                         before.setRemark(goodsInventory.getRemark());
                     }
                     billCleanBeforeMapper.insert(before);
-                }
-                else if (Integer.parseInt(split[1]) == 7) {
+                } else if (Integer.parseInt(split[1]) == 7) {
                     //新增洗澡前拍照
                     BillGoodsInventory before = (BillGoodsInventory) entity;
                     if (goodsInventory.getVistitType() != 0) {
@@ -274,7 +274,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
             }
             billSamplingMapper.insert(billSampling);
             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-        }else if (nextId == 2) {
+        } else if (nextId == 2) {
             //新增pcr
             BillPcr billClean = (BillPcr) newObject;
             if (goodsInventory.getVistitType() != 0) {
@@ -287,7 +287,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
             }
             pcrMapper.insert(billClean);
             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-        }else if (nextId == 3) {
+        } else if (nextId == 3) {
             //新增洗澡
             BillClean billClean = (BillClean) newObject;
             if (goodsInventory.getVistitType() != 0) {
@@ -300,7 +300,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
             }
             cleanMapper.insert(billClean);
             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-        }else if (nextId == 4) {
+        } else if (nextId == 4) {
             //新增隔离
             BillIsolate pcr = (BillIsolate) newObject;
             if (goodsInventory.getVistitType() != 0) {
@@ -313,7 +313,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
             }
             isolateMapper.insert(pcr);
             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-        }else if (nextId == 5) {
+        } else if (nextId == 5) {
             BillDry billClean = (BillDry) newObject;
             if (goodsInventory.getVistitType() != 0) {
                 billClean.setCarNum(goodsInventory.getCarNum());
@@ -326,7 +326,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
             dryMapper.insert(billClean);
             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
             //新增烘干
-        }else if (nextId == 6) {
+        } else if (nextId == 6) {
             //新增洗澡前拍照
             BillCleanBefore before = (BillCleanBefore) newObject;
             if (goodsInventory.getVistitType() != 0) {
@@ -339,8 +339,7 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
             }
             billCleanBeforeMapper.insert(before);
             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-        }
-        else if (nextId == 7) {
+        } else if (nextId == 7) {
             //新增洗澡前拍照
             BillGoodsInventory before = (BillGoodsInventory) newObject;
             if (goodsInventory.getVistitType() != 0) {

+ 10 - 8
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPcrServiceImpl.java

@@ -304,7 +304,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
         QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("test_location_id", locationIds).orderByDesc("sub_date");
         if ("0".equals(type)) {
-            queryWrapper.in("bill_status", 0, 1, 2, 3,4);
+            queryWrapper.in("bill_status", 0, 1, 2, 3, 4);
         }
         if ("1".equals(type)) {
             queryWrapper.eq("bill_status", 0);
@@ -337,25 +337,27 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
         String s2 = "";
         String s3 = "";
         if (ObjectUtil.isNotEmpty(img1)) {
-            if (uploadImage.getImageCom(img1).equals("上传失败")) {
+            s1 = uploadImage.uploadImg(img1);
+            if (s1.equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return new Result(10001, "检测图片1上传失败", false);
             }
-            s1 = uploadImage.uploadImg(img1);
         }
         if (ObjectUtil.isNotEmpty(img2)) {
-            if (uploadImage.getImageCom(img2).equals("上传失败")) {
+            String s = uploadImage.uploadImg(img2);
+            s2 = "," + s;
+            if (s.equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return new Result(10001, "检测图片2上传失败", false);
             }
-            s2 = "," + uploadImage.uploadImg(img2);
         }
         if (ObjectUtil.isNotEmpty(img3)) {
-            if (uploadImage.getImageCom(img3).equals("上传失败")) {
+            String s = uploadImage.uploadImg(img3);
+            s3 = "," + s;
+            if (s.equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return new Result(10001, "检测图片3上传失败", false);
             }
-            s3 = "," + uploadImage.uploadImg(img3);
         }
         String s = s1 + s2 + s3;
 
@@ -569,7 +571,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
 
                         Integer locationId = billPcr.getTestLocationId();
                         String[] split2 = allLocationId.split(",");
-                        int a=0;
+                        int a = 0;
                         for (int i = 0; i < split2.length; i++) {
                             if (locationId.toString().equals(split2[i])) {
                                 a = i + 1;

+ 209 - 3
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPersonnelAdmissionServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.http.Header;
 import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONException;
@@ -15,6 +16,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 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.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.huimv.receive.common.token.TokenSign;
@@ -96,7 +98,12 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public Result addAdmission(HttpServletRequest httpServletRequest, String admissionType, String vistitType, String userName, String phone, String workName, String papersType, String papersCode, MultipartFile imgUrl, String img, String vistitDate, String vistitReson, String destId, String destName, String farmId, String carNum, String source, String goods, String departureId, String departureName, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws IOException {
+    public Result addAdmission(HttpServletRequest httpServletRequest, String admissionType, String vistitType,
+                               String userName, String phone, String workName, String papersType, String papersCode,
+                               MultipartFile imgUrl, String img, String vistitDate, String vistitReson, String destId,
+                               String destName, String farmId, String carNum, String source, String goods,
+                               String departureId, String departureName, MultipartFile picture1, MultipartFile picture2,
+                               MultipartFile picture3) throws IOException {
         Integer userId = TokenSign.getMemberIdByJwtToken(httpServletRequest);
         if (!PhoneNumberValidator.isValidPhoneNumber(phone)) {
             return new Result(10001, "手机号格式错误!", false);
@@ -174,11 +181,12 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
             billPersonnelAdmission.setCarNum(carNum);
         }
         if (ObjectUtil.isNotEmpty(imgUrl)) {
-            if (uploadImage.getImageCom(imgUrl).equals("上传失败")) {
+            String s = uploadImage.getImageCom(imgUrl);
+            if (s.equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return new Result(10001, "图片上传失败", false);
             }
-            billPersonnelAdmission.setImgUrl(uploadImage.getImageCom(imgUrl));
+            billPersonnelAdmission.setImgUrl(s);
         }
         if (ObjectUtil.isNotEmpty(img)) {
             billPersonnelAdmission.setImgUrl(img);
@@ -1265,6 +1273,204 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         return new Result(10000, "修改成功", true);
     }
 
+    @Override
+    public Result helpAddAdmission(HttpServletRequest httpServletRequest,MultipartFile userImgUrl,String admissionType, String vistitType,
+                                   String userName, String phone, String workName, String papersType,
+                                   String papersCode, MultipartFile imgUrl, String img, String vistitDate,
+                                   String vistitReson, String destId, String destName, String farmId, String carNum,
+                                   String source, String goods, String departureId, String departureName,
+                                   MultipartFile picture1,MultipartFile picture2,MultipartFile picture3) throws IOException {
+        if (!PhoneNumberValidator.isValidPhoneNumber(phone)) {
+            return new Result(10001, "手机号格式错误!", false);
+        }
+        if (papersType.equals("0")) {
+            if (!IDCardValidator.isValidIDCard(papersCode)) {
+                return new Result(10001, "身份证号格式错误!", false);
+            }
+        }
+        String picUrl = null;
+        if (ObjectUtil.isNotEmpty(picture1)){
+            String pic1 = uploadImage.getImageCom(picture1);
+            if (pic1.equals("上传失败")){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "物品照片1上传失败", false);
+            }else {
+                picUrl = pic1;
+            }
+        }
+        if (ObjectUtil.isNotEmpty(picture2)){
+            String pic2 = uploadImage.getImageCom(picture2);
+            if (pic2.equals("上传失败")){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "物品照片2上传失败", false);
+            }else {
+                picUrl = picUrl + ","+pic2;
+            }
+        }
+        if (ObjectUtil.isNotEmpty(picture3)){
+            String pic3 = uploadImage.getImageCom(picture3);
+            if (pic3.equals("上传失败")){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "物品照片3上传失败", false);
+            }else {
+                picUrl = picUrl + ","+pic3;
+            }
+        }
+        Integer userId = TokenSign.getMemberIdByJwtToken(httpServletRequest);
+        SysAccountMultilevel sysAccountMultilevel1;
+        //先进行账号注册
+        QueryWrapper<SysAccountMultilevel> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("type",7).and(i->i.eq("phone", phone).or().eq("papers_code", papersCode));
+        SysAccountMultilevel data = sysAccountMultilevelMapper.selectOne(queryWrapper);
+        if (ObjectUtil.isEmpty(data)) {
+            SysAccountMultilevel sysAccountMultilevel = new SysAccountMultilevel();
+            sysAccountMultilevel.setUserName(userName);
+            sysAccountMultilevel.setPapersCode(papersCode);
+            sysAccountMultilevel.setPhone(phone);
+            sysAccountMultilevel.setAccount(phone);
+            sysAccountMultilevel.setPid(0);
+            sysAccountMultilevel.setPids("0");
+            sysAccountMultilevel.setPassword("123456");
+            sysAccountMultilevel.setWorkName(workName);
+            sysAccountMultilevel.setAccountStatus(1);
+            sysAccountMultilevel.setFarmIds(farmId);
+            sysAccountMultilevel.setLastFarmId(Integer.parseInt(farmId));
+            sysAccountMultilevel.setPapersType(papersType);
+            sysAccountMultilevel.setType(7);
+            String imageCom = uploadImage.getImageCom(userImgUrl);
+            if ("上传失败".equals(imageCom)) {
+                return new Result(10001, "图片上传失败!", false);
+            }
+            sysAccountMultilevel.setImgUrl(imageCom);
+            sysAccountMultilevelMapper.insert(sysAccountMultilevel);
+            sysAccountMultilevel1 = sysAccountMultilevelMapper.selectOne(new QueryWrapper<SysAccountMultilevel>().eq("papers_code", papersCode));
+        } else {
+            sysAccountMultilevel1 = data;
+        }
+
+
+
+        BaseWashoutPoint baseWashoutPoint1 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda().eq(BaseWashoutPoint::getLocationId, departureId).like(BaseWashoutPoint::getFarmIds, farmId).eq(BaseWashoutPoint::getVisitingType, vistitType));
+        BaseWashoutPoint baseWashoutPoint2 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda().eq(BaseWashoutPoint::getLocationId, destId).like(BaseWashoutPoint::getFarmIds, farmId).eq(BaseWashoutPoint::getVisitingType, vistitType));
+        if (!departureId.equals("0")){
+            if (baseWashoutPoint1.getPointLevel()>=baseWashoutPoint2.getPointLevel()){
+                return new Result(10001, "出发地应在目的地之前!", false);
+            }
+        }
+
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
+        BillPersonnelAdmission billPersonnelAdmission = new BillPersonnelAdmission();
+        billPersonnelAdmission.setAdmissionType(Integer.parseInt(admissionType));
+        billPersonnelAdmission.setVistitType(Integer.parseInt(vistitType));
+        billPersonnelAdmission.setDestId(Integer.parseInt(destId));
+        billPersonnelAdmission.setDestName(destName);
+        billPersonnelAdmission.setDepartureName(departureName);
+        billPersonnelAdmission.setDepartureId(Integer.valueOf(departureId));
+        billPersonnelAdmission.setAdmissionUserId(userId);
+        billPersonnelAdmission.setAdmissionUserName(userName);
+        billPersonnelAdmission.setVistitDate(LocalDateTime.parse(vistitDate, dateTimeFormatter));
+        billPersonnelAdmission.setSubDate(LocalDateTime.now());
+        billPersonnelAdmission.setPhone(phone);
+        billPersonnelAdmission.setWorkName(workName);
+        billPersonnelAdmission.setPapersType(Integer.parseInt(papersType));
+        billPersonnelAdmission.setPapersCode(papersCode);
+        billPersonnelAdmission.setUserImgUrl(sysAccountMultilevel1.getImgUrl());
+        billPersonnelAdmission.setPicUrl(picUrl);
+        if (ObjectUtil.isNotEmpty(carNum)) {
+            billPersonnelAdmission.setCarNum(carNum);
+        }
+        if (ObjectUtil.isNotEmpty(imgUrl)) {
+            String s = uploadImage.getImageCom(imgUrl);
+            if (s.equals("上传失败")) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "图片上传失败", false);
+            }
+            billPersonnelAdmission.setImgUrl(s);
+        }
+        if (ObjectUtil.isNotEmpty(img)) {
+            billPersonnelAdmission.setImgUrl(img);
+        }
+        if (ObjectUtil.isNotEmpty(source)) {
+            billPersonnelAdmission.setSource(source);
+        }
+        billPersonnelAdmission.setVistitReson(vistitReson);
+        billPersonnelAdmission.setFarmId(Integer.parseInt(farmId));
+        BaseProcess baseProcess = new BaseProcess();
+        baseProcess.setDestName(destName);
+        baseProcess.setDestId(Integer.parseInt(destId));
+        baseProcess.setAdmissionUserId(userId);
+        baseProcess.setAdmissionUserName(userName);
+        baseProcess.setSubDate(DateTime.now());
+        baseProcess.setCurrentStatus("0");
+
+        String allLocation = departureName;
+        String allLocationId = "0";
+        String allLocationStatus = "0";
+        String allFlowId = "";
+
+        List<BaseWashoutPoint> baseWashoutPoints = new ArrayList<>();
+        if (ObjectUtil.isEmpty(baseWashoutPoint1)){
+            System.out.println("出发地为场外");
+            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda().le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel()).eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId).orderByAsc(BaseWashoutPoint::getPointLevel));
+        }else {
+            System.out.println("出发地不为场外");
+            baseWashoutPoints = baseWashoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>().lambda().gt(BaseWashoutPoint::getPointLevel,baseWashoutPoint1.getPointLevel()).le(BaseWashoutPoint::getPointLevel,baseWashoutPoint2.getPointLevel()).eq(BaseWashoutPoint::getVisitingType, vistitType).like(BaseWashoutPoint::getFarmIds, farmId).orderByAsc(BaseWashoutPoint::getPointLevel));
+        }
+        System.out.println("所有洗消点:"+baseWashoutPoints);
+        for (BaseWashoutPoint baseWashoutPoint : baseWashoutPoints) {
+            allLocation = allLocation + "," + baseLocationMapper.selectById(baseWashoutPoint.getLocationId()).getLocationName();
+            allLocationId = allLocationId + "," + baseWashoutPoint.getLocationId();
+            allLocationStatus = allLocationStatus + "," + "0";
+            allFlowId = allFlowId + "0," + baseWashoutPoint.getFlowList();
+
+            allLocation = allLocation + "," + baseWashoutPoint.getTailLocationName();
+            allLocationId = allLocationId + "," + "0";
+            allLocationStatus = allLocationStatus + "," + "0";
+            if (!baseWashoutPoint.equals(baseWashoutPoints.get(baseWashoutPoints.size() - 1))) {
+                allFlowId = allFlowId + ",";
+            }
+        }
+        if(admissionType.equals("1")){
+            baseProcess.setAllLocation(departureName);
+            baseProcess.setAllLocationId("0");
+            baseProcess.setAllLocationStatus("0");
+        }else {
+            baseProcess.setAllLocation(allLocation);
+            baseProcess.setAllLocationId(allLocationId);
+            baseProcess.setAllLocationStatus(allLocationStatus);
+        }
+
+        baseProcess.setAllFlowId(allFlowId+",0");
+        baseProcess.setCurrentFlowId("0");
+        baseProcess.setCurrentLocation("场外");
+        baseProcess.setCurrentLocationId("0");
+        baseProcess.setFarmId(Integer.parseInt(farmId));
+        baseProcessMapper.insert(baseProcess);
+        billPersonnelAdmission.setProcessId(baseProcess.getId());
+        billPersonnelAdmissionMapper.insert(billPersonnelAdmission);
+        ArrayList<String> phoneList = new ArrayList<>();
+        List<SysAccountMultilevel> safe = sysAccountMultilevelMapper.selectList(new QueryWrapper<SysAccountMultilevel>().eq("farm_ids", farmId).eq("type", 3));
+        for (SysAccountMultilevel sysAccountMultilevel : safe) {
+            phoneList.add(sysAccountMultilevel.getPhone());
+        }
+        if (ObjectUtil.isNotEmpty(goods)) {
+            ObjectMapper objectMapper = new ObjectMapper();
+            List<BillGoodsInventory> admissionAndGoods = objectMapper.readValue(goods, new TypeReference<List<BillGoodsInventory>>() {
+            });
+            for (BillGoodsInventory good : admissionAndGoods) {
+                good.setBillAdmission(billPersonnelAdmission.getId());
+                BaseLocation baseLocation1 = baseLocationMapper.selectById(destId);
+                good.setTestLocation(baseLocation1.getLocationName());
+                good.setTestLocationId(baseLocation1.getId());
+                good.setCreateDate(new Date());
+                good.setFarmId(farmId);
+                billGoodsInventoryMapper.insert(good);
+            }
+        }
+        return Result.SUCCESS();
+
+    }
+
     /*数组排序*/
     public static JSONArray jsonArraySort(JSONArray jsonArr, String sortKey, boolean is_desc) {
         //存放排序结果json数组

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

@@ -259,6 +259,7 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
                         billClean.setFeedImgUrl(sampling.getFeedImgUrl());
                         billClean.setRemark(sampling.getRemark());
                     }
+                    billClean.setSamplingId(Integer.parseInt(id));
                     pcrMapper.insert(billClean);
                 } else if (Integer.parseInt(split[1]) == 3) {
                     //新增洗澡
@@ -372,6 +373,7 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
                 billClean.setFeedImgUrl(sampling.getFeedImgUrl());
                 billClean.setRemark(sampling.getRemark());
             }
+            billClean.setSamplingId(Integer.parseInt(id));
             pcrMapper.insert(billClean);
             baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
         }else if (nextId == 3) {

+ 1 - 1
huimv-receive/src/main/resources/application-test2.yml

@@ -17,7 +17,7 @@ spring:
 
   datasource:
     druid:
-      url: jdbc:mysql://115.238.57.190:3306/huimv-huatong-test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+      url: jdbc:mysql://115.238.57.190:3306/huimv-huatong-test2?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