Newspaper 10 hónapja
szülő
commit
f4cfc08ea9

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

@@ -56,8 +56,11 @@ public class BillPcrController {
                           @RequestParam("result") String result,
                           @RequestParam(value = "img1",required = false) MultipartFile img1,
                           @RequestParam(value = "img2",required = false) MultipartFile img2,
-                          @RequestParam(value = "img3",required = false) MultipartFile img3) throws ParseException, IOException {
-        return pcrService.edit(httpServletRequest, farmId,id,date,result,img1,img2,img3);
+                          @RequestParam(value = "img3",required = false) MultipartFile img3,
+                          @RequestParam(value = "picture1",required = false) MultipartFile picture1,
+                          @RequestParam(value = "picture2",required = false) MultipartFile picture2,
+                          @RequestParam(value = "picture3",required = false) MultipartFile picture3) throws ParseException, IOException {
+        return pcrService.edit(httpServletRequest, farmId,id,date,result,img1,img2,img3,picture1,picture2,picture3);
     }
     @Autowired
     private IBillPcrService billPcrService;

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

@@ -66,8 +66,11 @@ public class BillPersonnelAdmissionController {
                                @RequestParam(value = "carNum", required = false) String carNum,
                                @RequestParam(value = "source", required = false) String source,
                                @RequestParam(value = "goods", required = false) String goods,
+                               @RequestParam(value = "picture1",required = false) MultipartFile picture1,
+                               @RequestParam(value = "picture2",required = false) MultipartFile picture2,
+                               @RequestParam(value = "picture3",required = false) MultipartFile picture3,
                                @RequestParam("farmId") String farmId) throws IOException {
-        return billPersonnelAdmissionService.addAdmission(httpServletRequest, admissionType, vistitType, userName, phone, workName, papersType, papersCode, imgUrl, img, vistitDate, vistitReson, destId, destName, farmId, carNum, source, goods, departureId, departureName);
+        return billPersonnelAdmissionService.addAdmission(httpServletRequest, admissionType, vistitType, userName, phone, workName, papersType, papersCode, imgUrl, img, vistitDate, vistitReson, destId, destName, farmId, carNum, source, goods, departureId, departureName, picture1, picture2, picture3);
     }
 
     @PostMapping("/addAdmissionFeed")

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

@@ -1,8 +1,15 @@
 package com.huimv.receive.controller;
 
 
+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.utils.Result;
 import com.huimv.receive.common.utils.ResultCode;
+import com.huimv.receive.entity.BillPcr;
+import com.huimv.receive.entity.BillSampling;
+import com.huimv.receive.entity.vo.BillSamplingVo;
+import com.huimv.receive.service.IBillPcrService;
 import com.huimv.receive.service.IBillSamplingService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -28,6 +35,8 @@ public class BillSamplingController {
 
     @Autowired
     private IBillSamplingService billSamplingService;
+    @Autowired
+    private IBillPcrService billPcrService;
 
     @RequestMapping("/listSampling")
     public Result listSampling(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
@@ -46,15 +55,27 @@ public class BillSamplingController {
 
     @PostMapping("/getDetail")
     public Result getDetail(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap){
-        return new Result(ResultCode.SUCCESS,billSamplingService.getById(paramsMap.get("id")));
+        String id = paramsMap.get("id");
+        BillSampling billSampling = billSamplingService.getById(id);
+        BillSamplingVo billSamplingVo = new BillSamplingVo();
+        BeanUtil.copyProperties(billSampling,billSamplingVo);
+        BillPcr billPcr = billPcrService.getOne(new QueryWrapper<BillPcr>().lambda().eq(BillPcr::getSamplingId, id));
+        if (ObjectUtil.isNotEmpty(billPcr)){
+            billSamplingVo.setPcrType(billPcr.getPcrType());
+            billSamplingVo.setBillStatus(billPcr.getBillStatus());
+        }
+        return new Result(ResultCode.SUCCESS, billSamplingVo);
     }
 
     @PostMapping("/edit")
     public Result goodsCarClean(HttpServletRequest httpServletRequest, @RequestParam("id") String id,
                                 @RequestParam("date") String data,
                                 @RequestParam(value = "video", required = false) MultipartFile video,
+                                @RequestParam(value = "picture1", required = false) MultipartFile picture1,
+                                @RequestParam(value = "picture2", required = false) MultipartFile picture2,
+                                @RequestParam(value = "picture3", required = false) MultipartFile picture3,
                                 @RequestParam("farmId") String farmId) throws IOException, ParseException {
-        return billSamplingService.edit(httpServletRequest, farmId, id, data, video);
+        return billSamplingService.edit(httpServletRequest, farmId, id, data, video,picture1,picture2,picture3);
     }
 
     @RequestMapping("/listAll")

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

@@ -138,4 +138,16 @@ public class BillPcr implements Serializable {
     private String cleanName;
 
     private String remark;
+
+    /*
+     * 0没有 1有
+     */
+    private Integer isCarry;
+
+    /*
+     * 物品照片地址
+     */
+    private String picUrl;
+
+    private Integer samplingId;
 }

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

@@ -157,5 +157,13 @@ public class BillPersonnelAdmission implements Serializable {
 
     private String remark;
 
+    /*
+     * 0没有 1有
+     */
+    private Integer isCarry;
 
+    /*
+     * 物品照片地址
+     */
+    private String picUrl;
 }

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

@@ -142,4 +142,14 @@ public class BillSampling implements Serializable {
 
     private String remark;
 
+    /*
+     * 0没有 1有
+     */
+    private Integer isCarry;
+
+    /*
+     * 物品照片地址
+     */
+    private String picUrl;
+
 }

+ 27 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/vo/BillSamplingVo.java

@@ -0,0 +1,27 @@
+package com.huimv.receive.entity.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.huimv.receive.entity.BillSampling;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 洗消表
+ * </p>
+ *
+ * @author author
+ * @since 2024-03-11
+ */
+@Data
+public class BillSamplingVo extends BillSampling {
+    private Integer pcrType;
+    private Integer billStatus;
+}

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

@@ -25,7 +25,7 @@ public interface IBillPcrService extends IService<BillPcr> {
     Result listById(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
     Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date, String result,
-                MultipartFile img1, MultipartFile img2, MultipartFile img3) throws ParseException, IOException;
+                MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws ParseException, IOException;
     Result listPersonalPcr(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
     //后台总体概况

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

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

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

@@ -27,7 +27,7 @@ public interface IBillSamplingService extends IService<BillSampling> {
     Result listPersonalSample(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
     Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date,
-                MultipartFile img) throws ParseException, IOException;
+                MultipartFile img, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws ParseException, IOException;
 
     Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 }

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

@@ -331,7 +331,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
     @Override
     @Transactional
     public Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date, String result,
-                       MultipartFile img1, MultipartFile img2, MultipartFile img3) throws ParseException, IOException {
+                       MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws ParseException, IOException {
         //1为合格2为异常
         String s1 = "";
         String s2 = "";
@@ -339,25 +339,55 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
         if (ObjectUtil.isNotEmpty(img1)) {
             if (uploadImage.getImageCom(img1).equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                return new Result(10001, "图片1上传失败", false);
+                return new Result(10001, "检测图片1上传失败", false);
             }
             s1 = uploadImage.uploadImg(img1);
         }
         if (ObjectUtil.isNotEmpty(img2)) {
             if (uploadImage.getImageCom(img2).equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                return new Result(10001, "图片2上传失败", false);
+                return new Result(10001, "检测图片2上传失败", false);
             }
             s2 = "," + uploadImage.uploadImg(img2);
         }
         if (ObjectUtil.isNotEmpty(img3)) {
             if (uploadImage.getImageCom(img3).equals("上传失败")) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                return new Result(10001, "图片3上传失败", false);
+                return new Result(10001, "检测图片3上传失败", false);
             }
             s3 = "," + uploadImage.uploadImg(img3);
         }
         String s = s1 + s2 + s3;
+
+        String picUrl = null;
+
+        if (ObjectUtil.isNotEmpty(picture1)){
+            String pic1 = uploadImage.getImageCom(picture1);
+            if (pic1.equals("上传失败")){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "物品检测图片1上传失败", false);
+            }else {
+                picUrl = pic1;
+            }
+        }
+        if (ObjectUtil.isNotEmpty(picture2)){
+            String pic2 = uploadImage.getImageCom(picture2);
+            if (pic2.equals("上传失败")){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "物品检测图片2上传失败", false);
+            }else {
+                picUrl = picUrl + ","+pic2;
+            }
+        }
+        if (ObjectUtil.isNotEmpty(picture3)){
+            String pic3 = uploadImage.getImageCom(picture3);
+            if (pic3.equals("上传失败")){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "物品检测图片3上传失败", false);
+            }else {
+                picUrl = picUrl + ","+pic3;
+            }
+        }
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
 
         if (StringUtils.isBlank(date)) {
@@ -369,6 +399,14 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
         }
         billPcr.setImgUrl(s);
         billPcr.setImgStatus(1);
+        if (billPcr.getVistitType() == 0){
+            if (ObjectUtil.isNotEmpty(picUrl)){
+                billPcr.setIsCarry(1);
+                billPcr.setPicUrl(picUrl);
+            }else {
+                billPcr.setIsCarry(0);
+            }
+        }
 
 
         QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();

+ 39 - 1
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPersonnelAdmissionServiceImpl.java

@@ -96,7 +96,7 @@ 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) 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);
@@ -113,12 +113,50 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                 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;
+            }
+        }
+
         SysAccountMultilevel sysAccountMultilevel1 = sysAccountMultilevelMapper.selectById(userId);
 
         DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
         BillPersonnelAdmission billPersonnelAdmission = new BillPersonnelAdmission();
         billPersonnelAdmission.setAdmissionType(Integer.parseInt(admissionType));
         billPersonnelAdmission.setVistitType(Integer.parseInt(vistitType));
+        if (vistitType.equals("0")){
+            if (ObjectUtil.isNotEmpty(picUrl)){
+                billPersonnelAdmission.setIsCarry(1);
+                billPersonnelAdmission.setPicUrl(picUrl);
+            }else {
+                billPersonnelAdmission.setIsCarry(0);
+            }
+        }
         billPersonnelAdmission.setDestId(Integer.parseInt(destId));
         billPersonnelAdmission.setDestName(destName);
         billPersonnelAdmission.setDepartureName(departureName);

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

@@ -120,7 +120,7 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
 
 
     @Override
-    public Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date, MultipartFile img) throws ParseException, IOException {
+    public Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date, MultipartFile img, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws ParseException, IOException {
         String s = "";
         s = uploadImage.getVideoCom(img);
         if (s.equals("上传失败")) {
@@ -128,6 +128,37 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
             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;
+            }
+        }
+
+
 
         DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
 
@@ -137,7 +168,14 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
         }
         sampling.setImgUrl(s);
         sampling.setImgStatus(1);
-
+        if (sampling.getVistitType() == 0){
+            if (ObjectUtil.isNotEmpty(picUrl)){
+                sampling.setIsCarry(1);
+                sampling.setPicUrl(picUrl);
+            }else {
+                sampling.setIsCarry(0);
+            }
+        }
 
         QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
         processQueryWrapper.eq("farm_id", farmId).eq("id", sampling.getProcessId());