wwh 1 rok temu
rodzic
commit
dbd5e823c1

+ 35 - 4
huimv-receive/src/main/java/com/huimv/receive/controller/BillCleanController.java

@@ -1,6 +1,7 @@
 package com.huimv.receive.controller;
 package com.huimv.receive.controller;
 
 
 
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
@@ -9,9 +10,14 @@ import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.ResultCode;
 import com.huimv.receive.common.utils.ResultCode;
 import com.huimv.receive.entity.BillClean;
 import com.huimv.receive.entity.BillClean;
 import com.huimv.receive.entity.BillDry;
 import com.huimv.receive.entity.BillDry;
+import com.huimv.receive.entity.BillGoodsInventory;
 import com.huimv.receive.entity.Configuration;
 import com.huimv.receive.entity.Configuration;
+import com.huimv.receive.entity.vo.BillCleanVo;
+import com.huimv.receive.entity.vo.BillDryVo;
+import com.huimv.receive.entity.vo.GoodsVo;
 import com.huimv.receive.service.IBillCleanService;
 import com.huimv.receive.service.IBillCleanService;
 import com.huimv.receive.service.IBillDryService;
 import com.huimv.receive.service.IBillDryService;
+import com.huimv.receive.service.IBillGoodsInventoryService;
 import com.huimv.receive.service.IConfigurationService;
 import com.huimv.receive.service.IConfigurationService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -40,6 +46,8 @@ public class BillCleanController {
     private IBillCleanService billCleanService;
     private IBillCleanService billCleanService;
     @Autowired
     @Autowired
     private IBillDryService billDryService;
     private IBillDryService billDryService;
+    @Autowired
+    private IBillGoodsInventoryService goodsInventoryService;
 
 
     @PostMapping("/listPersonalClean")
     @PostMapping("/listPersonalClean")
     public Result listPersonalClean(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
     public Result listPersonalClean(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
@@ -69,20 +77,38 @@ public class BillCleanController {
             if (ObjectUtil.isEmpty(billClean.getImgUrl())) {
             if (ObjectUtil.isEmpty(billClean.getImgUrl())) {
                 billClean.setImgUrl("");
                 billClean.setImgUrl("");
             }
             }
-            return new Result(ResultCode.SUCCESS, billClean);
+            BillCleanVo billCleanVo = new BillCleanVo();
+            BeanUtil.copyProperties(billClean, billCleanVo);
+            billCleanVo.setType("");
+            return new Result(ResultCode.SUCCESS, billCleanVo);
         }
         }
         if ("1".equals(type)) {
         if ("1".equals(type)) {
             BillClean billClean = billCleanService.getById(paramsMap.get("id"));
             BillClean billClean = billCleanService.getById(paramsMap.get("id"));
             if (ObjectUtil.isEmpty(billClean.getImgUrl())) {
             if (ObjectUtil.isEmpty(billClean.getImgUrl())) {
                 billClean.setImgUrl("");
                 billClean.setImgUrl("");
             }
             }
-            return new Result(ResultCode.SUCCESS, billClean);
-        } else {
+            BillCleanVo billCleanVo = new BillCleanVo();
+            BeanUtil.copyProperties(billClean, billCleanVo);
+            billCleanVo.setType(type);
+            return new Result(ResultCode.SUCCESS, billCleanVo);
+        } else if ("2".equals(type)) {
             BillDry billDry = billDryService.getById(paramsMap.get("id"));
             BillDry billDry = billDryService.getById(paramsMap.get("id"));
             if (ObjectUtil.isEmpty(billDry.getImgUrl())) {
             if (ObjectUtil.isEmpty(billDry.getImgUrl())) {
                 billDry.setImgUrl("");
                 billDry.setImgUrl("");
             }
             }
-            return new Result(ResultCode.SUCCESS, billDry);
+            BillDryVo billCleanVo = new BillDryVo();
+            BeanUtil.copyProperties(billDry, billCleanVo);
+            billCleanVo.setType(type);
+            return new Result(ResultCode.SUCCESS, billCleanVo);
+        } else {
+            BillGoodsInventory goodsInventory = goodsInventoryService.getById(paramsMap.get("id"));
+            if (ObjectUtil.isEmpty(goodsInventory.getImgUrl())) {
+                goodsInventory.setImgUrl("");
+            }
+            GoodsVo billCleanVo = new GoodsVo();
+            BeanUtil.copyProperties(goodsInventory, billCleanVo);
+            billCleanVo.setType(type);
+            return new Result(ResultCode.SUCCESS, billCleanVo);
         }
         }
 
 
     }
     }
@@ -97,6 +123,11 @@ public class BillCleanController {
         return cleanService.listAll(httpServletRequest, paramsMap);
         return cleanService.listAll(httpServletRequest, paramsMap);
     }
     }
 
 
+    @RequestMapping("/listPersonCleanAndDryAndGoods")
+    public Result listPersonCleanAndDryAndGoods(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
+        return cleanService.listPersonCleanAndDryAndGoods(httpServletRequest, paramsMap);
+    }
+
     @RequestMapping("/listById")
     @RequestMapping("/listById")
     public Result listById(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
     public Result listById(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
         return cleanService.listById(httpServletRequest, paramsMap);
         return cleanService.listById(httpServletRequest, paramsMap);

+ 9 - 6
huimv-receive/src/main/java/com/huimv/receive/controller/BillGoodsInventoryController.java

@@ -3,14 +3,15 @@ package com.huimv.receive.controller;
 
 
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.ResultCode;
 import com.huimv.receive.common.utils.ResultCode;
+import com.huimv.receive.entity.vo.GoodsVo;
 import com.huimv.receive.service.IBillGoodsInventoryService;
 import com.huimv.receive.service.IBillGoodsInventoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.CrossOrigin;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 /**
 /**
@@ -35,8 +36,10 @@ public class BillGoodsInventoryController {
     }
     }
 
 
     @RequestMapping("/edit")
     @RequestMapping("/edit")
-    public Result edit(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
-        return goodsInventoryService.edit(httpServletRequest, paramsMap);
+    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);
     }
     }
 
 
     @RequestMapping("/list")
     @RequestMapping("/list")

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

@@ -122,4 +122,8 @@ public class BillGoodsInventory implements Serializable {
     private String cleanName;
     private String cleanName;
 
 
     private String remark;
     private String remark;
+
+    private String imgUrl;
+
+    private Integer billStatus;
 }
 }

+ 9 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/vo/BillCleanVo.java

@@ -0,0 +1,9 @@
+package com.huimv.receive.entity.vo;
+
+import com.huimv.receive.entity.BillClean;
+import lombok.Data;
+
+@Data
+public class BillCleanVo extends BillClean {
+    private String type;
+}

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

@@ -0,0 +1,10 @@
+package com.huimv.receive.entity.vo;
+
+import com.huimv.receive.entity.BillClean;
+import com.huimv.receive.entity.BillDry;
+import lombok.Data;
+
+@Data
+public class BillDryVo extends BillDry {
+    private String type;
+}

+ 9 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/vo/GoodsVo.java

@@ -0,0 +1,9 @@
+package com.huimv.receive.entity.vo;
+
+import com.huimv.receive.entity.BillGoodsInventory;
+import lombok.Data;
+
+@Data
+public class GoodsVo extends BillGoodsInventory {
+    private String type;
+}

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

@@ -22,6 +22,7 @@ import java.util.Map;
 public interface IBillCleanService extends IService<BillClean> {
 public interface IBillCleanService extends IService<BillClean> {
     Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
     Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
 
+    Result listPersonCleanAndDryAndGoods(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
     Result listById(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
     Result listById(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
 
     Result listByIdDry(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
     Result listByIdDry(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);

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

@@ -3,8 +3,12 @@ package com.huimv.receive.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.entity.BillGoodsInventory;
 import com.huimv.receive.entity.BillGoodsInventory;
+import com.huimv.receive.entity.vo.GoodsVo;
+import org.springframework.web.multipart.MultipartFile;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 /**
 /**
@@ -18,7 +22,7 @@ import java.util.Map;
 public interface IBillGoodsInventoryService extends IService<BillGoodsInventory> {
 public interface IBillGoodsInventoryService extends IService<BillGoodsInventory> {
     Result listAll(HttpServletRequest httpServletRequest, Map<String,String> paramsMap);
     Result listAll(HttpServletRequest httpServletRequest, Map<String,String> paramsMap);
 
 
-    Result edit(HttpServletRequest httpServletRequest, Map<String,String> paramsMap);
+    Result edit(HttpServletRequest httpServletRequest,String id, String goods, MultipartFile imgUrl) throws IOException;
 
 
     Result list(HttpServletRequest httpServletRequest, Map<String,String> paramsMap);
     Result list(HttpServletRequest httpServletRequest, Map<String,String> paramsMap);
 }
 }

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

@@ -105,8 +105,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     .eq("test_location_id", baseLocation.getId()).eq("bill_status", 0);
                     .eq("test_location_id", baseLocation.getId()).eq("bill_status", 0);
 
 
             return new Result(ResultCode.SUCCESS, cleanMapper.selectPage(page, queryWrapper), cleanMapper.selectCount(queryWrapper2));
             return new Result(ResultCode.SUCCESS, cleanMapper.selectPage(page, queryWrapper), cleanMapper.selectCount(queryWrapper2));
-        }
-        else if ("5".equals(type)) {
+        } else if ("5".equals(type)) {
             Page<CleanDryGoodsVo> cleanDryGoodPage = null;
             Page<CleanDryGoodsVo> cleanDryGoodPage = null;
             Page<CleanDryGoodsVo> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
             Page<CleanDryGoodsVo> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
             QueryWrapper<BillClean> queryWrapper = new QueryWrapper<>();
             QueryWrapper<BillClean> queryWrapper = new QueryWrapper<>();
@@ -145,11 +144,11 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
             }
             }
             queryWrapper.eq("img_status", 0);
             queryWrapper.eq("img_status", 0);
             queryWrapper2.eq("img_status", 0);
             queryWrapper2.eq("img_status", 0);
-            queryWrapper3.eq("status", 0);
+            queryWrapper3.eq("bill_status", 0);
             Integer integer = cleanMapper.selectCount(queryWrapper);
             Integer integer = cleanMapper.selectCount(queryWrapper);
             Integer integer1 = dryMapper.selectCount(queryWrapper2);
             Integer integer1 = dryMapper.selectCount(queryWrapper2);
             Integer integer2 = inventoryMapper.selectCount(queryWrapper3);
             Integer integer2 = inventoryMapper.selectCount(queryWrapper3);
-            return new Result(ResultCode.SUCCESS, cleanDryGoodPage, integer+ integer1+ integer2);
+            return new Result(ResultCode.SUCCESS, cleanDryGoodPage, integer + integer1 + integer2);
         } else {
         } else {
             Page<CleanAndDryVo2> cleanAndDryVo2Page = null;
             Page<CleanAndDryVo2> cleanAndDryVo2Page = null;
             Page<CleanAndDryVo2> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
             Page<CleanAndDryVo2> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
@@ -192,6 +191,36 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
     }
     }
 
 
     @Override
     @Override
+    public Result listPersonCleanAndDryAndGoods(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
+        String farmId = paramsMap.get("farmId");
+        String pageNum = paramsMap.get("pageNum");
+        String pageSize = paramsMap.get("pageSize");
+        Page<CleanDryGoodsVo> cleanDryGoodPage = null;
+        Page<CleanDryGoodsVo> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+        QueryWrapper<BillClean> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("farm_id", farmId).eq("vistit_type", 5);
+        QueryWrapper<BillDry> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.eq("farm_id", farmId).eq("vistit_type", 5);
+        QueryWrapper<BillGoodsInventory> queryWrapper3 = new QueryWrapper<>();
+        queryWrapper3.eq("farm_id", farmId);
+
+        String[] s = {TokenSign.getWorkIdByJwtToken(httpServletRequest)};
+        System.out.println("传入自定义sql的位置参数形式:" + s);
+        cleanDryGoodPage = cleanMapper.listCleanDryGoods(page, farmId, "5", "0,1".split(","), s);
+//        queryWrapper.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
+//        queryWrapper2.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
+//        queryWrapper3.in("current_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
+
+        queryWrapper.eq("img_status", 0);
+        queryWrapper2.eq("img_status", 0);
+        queryWrapper3.eq("bill_status", 0);
+        Integer integer = cleanMapper.selectCount(queryWrapper);
+        Integer integer1 = dryMapper.selectCount(queryWrapper2);
+        Integer integer2 = inventoryMapper.selectCount(queryWrapper3);
+        return new Result(ResultCode.SUCCESS, cleanDryGoodPage, integer + integer1 + integer2);
+    }
+
+    @Override
     public Result listById(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
     public Result listById(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
         String id = paramsMap.get("id");
         String id = paramsMap.get("id");
         BillClean billClean = cleanMapper.selectById(id);
         BillClean billClean = cleanMapper.selectById(id);
@@ -989,7 +1018,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                                 before.setCleanId(billClean.getCleanId());
                                 before.setCleanId(billClean.getCleanId());
                             }
                             }
                             beforeMapper.insert(before);
                             beforeMapper.insert(before);
-                        }else if (Integer.parseInt(splits[1]) == 7) {
+                        } else if (Integer.parseInt(splits[1]) == 7) {
                             //新增洗澡前拍照
                             //新增洗澡前拍照
                             BillGoodsInventory before = (BillGoodsInventory) entity;
                             BillGoodsInventory before = (BillGoodsInventory) entity;
                             if (billClean.getVistitType() != 0) {
                             if (billClean.getVistitType() != 0) {
@@ -1015,7 +1044,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                             baseProcess.setAllLocationStatus("2,2,2,1,0");
                             baseProcess.setAllLocationStatus("2,2,2,1,0");
                         }
                         }
                     }
                     }
-                }else if (nextId == 1) {
+                } else if (nextId == 1) {
                     //新增采样
                     //新增采样
                     BillSampling billSampling = (BillSampling) newObject;
                     BillSampling billSampling = (BillSampling) newObject;
                     if (billClean.getVistitType() != 0) {
                     if (billClean.getVistitType() != 0) {
@@ -1030,7 +1059,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     }
                     }
                     samplingMapper.insert(billSampling);
                     samplingMapper.insert(billSampling);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                }else if (nextId == 2) {
+                } else if (nextId == 2) {
                     //新增pcr
                     //新增pcr
                     BillPcr billClean1 = (BillPcr) newObject;
                     BillPcr billClean1 = (BillPcr) newObject;
                     if (billClean.getVistitType() != 0) {
                     if (billClean.getVistitType() != 0) {
@@ -1045,7 +1074,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     }
                     }
                     pcrMapper.insert(billClean1);
                     pcrMapper.insert(billClean1);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                }else if (nextId == 3) {
+                } else if (nextId == 3) {
                     //新增洗澡
                     //新增洗澡
                     BillClean billClean2 = (BillClean) newObject;
                     BillClean billClean2 = (BillClean) newObject;
                     if (billClean.getVistitType() != 0) {
                     if (billClean.getVistitType() != 0) {
@@ -1060,7 +1089,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     }
                     }
                     cleanMapper.insert(billClean2);
                     cleanMapper.insert(billClean2);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                }else if (nextId == 4) {
+                } else if (nextId == 4) {
                     //新增隔离
                     //新增隔离
                     BillIsolate pcr = (BillIsolate) newObject;
                     BillIsolate pcr = (BillIsolate) newObject;
                     if (billClean.getVistitType() != 0) {
                     if (billClean.getVistitType() != 0) {
@@ -1075,7 +1104,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     }
                     }
                     isolateMapper.insert(pcr);
                     isolateMapper.insert(pcr);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                }else if (nextId == 5) {
+                } else if (nextId == 5) {
                     BillDry billClean2 = (BillDry) newObject;
                     BillDry billClean2 = (BillDry) newObject;
                     if (billClean.getVistitType() != 0) {
                     if (billClean.getVistitType() != 0) {
                         billClean2.setCarNum(billClean.getCarNum());
                         billClean2.setCarNum(billClean.getCarNum());
@@ -1090,7 +1119,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     dryMapper.insert(billClean2);
                     dryMapper.insert(billClean2);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                     //新增烘干
                     //新增烘干
-                }else if (nextId == 6) {
+                } else if (nextId == 6) {
                     //新增洗澡前拍照
                     //新增洗澡前拍照
                     BillCleanBefore before = (BillCleanBefore) newObject;
                     BillCleanBefore before = (BillCleanBefore) newObject;
                     if (billClean.getVistitType() != 0) {
                     if (billClean.getVistitType() != 0) {
@@ -1105,7 +1134,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                     }
                     }
                     beforeMapper.insert(before);
                     beforeMapper.insert(before);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                     baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                }else if (nextId == 7) {
+                } else if (nextId == 7) {
                     //新增洗澡前拍照
                     //新增洗澡前拍照
                     BillGoodsInventory before = (BillGoodsInventory) newObject;
                     BillGoodsInventory before = (BillGoodsInventory) newObject;
                     if (billClean.getVistitType() != 0) {
                     if (billClean.getVistitType() != 0) {
@@ -1306,7 +1335,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                                     before.setCleanId(billClean.getCleanId());
                                     before.setCleanId(billClean.getCleanId());
                                 }
                                 }
                                 beforeMapper.insert(before);
                                 beforeMapper.insert(before);
-                            }else if (Integer.parseInt(splits[1]) == 7) {
+                            } else if (Integer.parseInt(splits[1]) == 7) {
                                 //新增洗澡前拍照
                                 //新增洗澡前拍照
                                 BillGoodsInventory before = (BillGoodsInventory) entity;
                                 BillGoodsInventory before = (BillGoodsInventory) entity;
                                 if (billClean.getVistitType() != 0) {
                                 if (billClean.getVistitType() != 0) {
@@ -1347,7 +1376,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                         }
                         }
                         samplingMapper.insert(billSampling);
                         samplingMapper.insert(billSampling);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                    }else if (nextId == 2) {
+                    } else if (nextId == 2) {
                         //新增pcr
                         //新增pcr
                         BillPcr billClean1 = (BillPcr) newObject;
                         BillPcr billClean1 = (BillPcr) newObject;
                         if (billClean.getVistitType() != 0) {
                         if (billClean.getVistitType() != 0) {
@@ -1362,7 +1391,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                         }
                         }
                         pcrMapper.insert(billClean1);
                         pcrMapper.insert(billClean1);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                    }else if (nextId == 3) {
+                    } else if (nextId == 3) {
                         //新增洗澡
                         //新增洗澡
                         BillClean billClean2 = (BillClean) newObject;
                         BillClean billClean2 = (BillClean) newObject;
                         if (billClean.getVistitType() != 0) {
                         if (billClean.getVistitType() != 0) {
@@ -1377,7 +1406,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                         }
                         }
                         cleanMapper.insert(billClean2);
                         cleanMapper.insert(billClean2);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                    }else if (nextId == 4) {
+                    } else if (nextId == 4) {
                         //新增隔离
                         //新增隔离
                         BillIsolate pcr = (BillIsolate) newObject;
                         BillIsolate pcr = (BillIsolate) newObject;
                         if (billClean.getVistitType() != 0) {
                         if (billClean.getVistitType() != 0) {
@@ -1392,7 +1421,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                         }
                         }
                         isolateMapper.insert(pcr);
                         isolateMapper.insert(pcr);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                    }else if (nextId == 5) {
+                    } else if (nextId == 5) {
                         BillDry billClean2 = (BillDry) newObject;
                         BillDry billClean2 = (BillDry) newObject;
                         if (billClean.getVistitType() != 0) {
                         if (billClean.getVistitType() != 0) {
                             billClean2.setCarNum(billClean.getCarNum());
                             billClean2.setCarNum(billClean.getCarNum());
@@ -1407,7 +1436,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                         dryMapper.insert(billClean2);
                         dryMapper.insert(billClean2);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                         //新增烘干
                         //新增烘干
-                    }else if (nextId == 6) {
+                    } else if (nextId == 6) {
                         //新增洗澡前拍照
                         //新增洗澡前拍照
                         BillCleanBefore before = (BillCleanBefore) newObject;
                         BillCleanBefore before = (BillCleanBefore) newObject;
                         if (billClean.getVistitType() != 0) {
                         if (billClean.getVistitType() != 0) {
@@ -1422,7 +1451,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
                         }
                         }
                         beforeMapper.insert(before);
                         beforeMapper.insert(before);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
                         baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
-                    }else if (nextId == 7) {
+                    } else if (nextId == 7) {
                         //新增洗澡前拍照
                         //新增洗澡前拍照
                         BillGoodsInventory before = (BillGoodsInventory) newObject;
                         BillGoodsInventory before = (BillGoodsInventory) newObject;
                         if (billClean.getVistitType() != 0) {
                         if (billClean.getVistitType() != 0) {

+ 26 - 8
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillGoodsInventoryServiceImpl.java

@@ -1,5 +1,6 @@
 package com.huimv.receive.service.impl;
 package com.huimv.receive.service.impl;
 
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -8,14 +9,19 @@ import com.huimv.receive.common.token.TokenSign;
 import com.huimv.receive.common.utils.FlowUtil;
 import com.huimv.receive.common.utils.FlowUtil;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.ResultCode;
 import com.huimv.receive.common.utils.ResultCode;
+import com.huimv.receive.common.utils.UploadImage;
 import com.huimv.receive.entity.*;
 import com.huimv.receive.entity.*;
 import com.huimv.receive.entity.vo.BillGoodsInventoryVo;
 import com.huimv.receive.entity.vo.BillGoodsInventoryVo;
+import com.huimv.receive.entity.vo.GoodsVo;
 import com.huimv.receive.mapper.*;
 import com.huimv.receive.mapper.*;
 import com.huimv.receive.service.IBillGoodsInventoryService;
 import com.huimv.receive.service.IBillGoodsInventoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+import org.springframework.web.multipart.MultipartFile;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatter;
 import java.util.Calendar;
 import java.util.Calendar;
@@ -51,6 +57,8 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
     private BillCleanBeforeMapper billCleanBeforeMapper;
     private BillCleanBeforeMapper billCleanBeforeMapper;
     @Autowired
     @Autowired
     private BillSamplingMapper billSamplingMapper;
     private BillSamplingMapper billSamplingMapper;
+    @Autowired
+    private UploadImage uploadImage;
 
 
     @Override
     @Override
     public Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
     public Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
@@ -64,23 +72,33 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
     }
     }
 
 
     @Override
     @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");
+    public Result edit(HttpServletRequest httpServletRequest, String id,String goods, MultipartFile imgUrl) throws IOException {
+
         DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
         DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
         BillGoodsInventory goodsInventory = inventoryMapper.selectById(id);
         BillGoodsInventory goodsInventory = inventoryMapper.selectById(id);
+        String goodsName = "";
+        String goodsType = "";
+        String goodsNum = "";
+        String goodsTypeName = "";
+        String goodsUnit = "";
+
+
         goodsInventory.setGoodsName(goodsName);
         goodsInventory.setGoodsName(goodsName);
-        goodsInventory.setGoodsType(goodsType);
+        goodsInventory.setGoodsType(goods);
         goodsInventory.setGoodsNums(goodsNum);
         goodsInventory.setGoodsNums(goodsNum);
         goodsInventory.setGoodsTypeName(goodsTypeName);
         goodsInventory.setGoodsTypeName(goodsTypeName);
         goodsInventory.setUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
         goodsInventory.setUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
         goodsInventory.setUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
         goodsInventory.setUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
         goodsInventory.setGoodsUnit(goodsUnit);
         goodsInventory.setGoodsUnit(goodsUnit);
+        goodsInventory.setBillStatus(1);
         goodsInventory.setSubDate(LocalDateTime.now());
         goodsInventory.setSubDate(LocalDateTime.now());
+        if (ObjectUtil.isNotEmpty(imgUrl)) {
+            if (uploadImage.getImageCom(imgUrl).equals("上传失败")) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return new Result(10001, "图片1上传失败", false);
+            }
+        }
+        goodsInventory.setImgUrl(uploadImage.getImageCom(imgUrl));
 
 
         QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
         QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
         processQueryWrapper.eq("farm_id", goodsInventory.getFarmId()).eq("id", goodsInventory.getBillAdmission());
         processQueryWrapper.eq("farm_id", goodsInventory.getFarmId()).eq("id", goodsInventory.getBillAdmission());

+ 15 - 15
huimv-receive/src/main/resources/com/huimv/receive/mapper/BillCleanMapper.xml

@@ -122,34 +122,34 @@ ORDER BY
     </select>
     </select>
     <select id="listCleanDryGoods" resultType="com.huimv.receive.entity.vo.CleanDryGoodsVo">
     <select id="listCleanDryGoods" resultType="com.huimv.receive.entity.vo.CleanDryGoodsVo">
         select id,vistit_Type,test_location,admission_user_name,car_num,clean_time,null as 'dryTime',check_date,sub_date,bill_status,img_status,1 AS 'type' from bill_clean where farm_id=#{farmId} and vistit_type=#{type}
         select id,vistit_Type,test_location,admission_user_name,car_num,clean_time,null as 'dryTime',check_date,sub_date,bill_status,img_status,1 AS 'type' from bill_clean where farm_id=#{farmId} and vistit_type=#{type}
-        and test_location_id in
-        <foreach collection="locations" item="location" separator="," open="(" close=")">
-            #{location}
-        </foreach>
+<!--        and test_location_id in-->
+<!--        <foreach collection="locations" item="location" separator="," open="(" close=")">-->
+<!--            #{location}-->
+<!--        </foreach>-->
         and img_status in
         and img_status in
         <foreach collection="status" item="statu" separator="," open="(" close=")">
         <foreach collection="status" item="statu" separator="," open="(" close=")">
             #{statu}
             #{statu}
         </foreach>
         </foreach>
         union all
         union all
         select id,vistit_Type,test_location,admission_user_name,car_num,null as 'cleanTime',dry_time,check_date,sub_date,bill_status,img_status,2 AS 'type' from bill_dry where farm_id=#{farmId} and vistit_type=#{type}
         select id,vistit_Type,test_location,admission_user_name,car_num,null as 'cleanTime',dry_time,check_date,sub_date,bill_status,img_status,2 AS 'type' from bill_dry where farm_id=#{farmId} and vistit_type=#{type}
-        and test_location_id in
-        <foreach collection="locations" item="location" separator="," open="(" close=")">
-            #{location}
-        </foreach>
+<!--        and test_location_id in-->
+<!--        <foreach collection="locations" item="location" separator="," open="(" close=")">-->
+<!--            #{location}-->
+<!--        </foreach>-->
         and img_status in
         and img_status in
         <foreach collection="status" item="statu" separator="," open="(" close=")">
         <foreach collection="status" item="statu" separator="," open="(" close=")">
             #{statu}
             #{statu}
         </foreach>
         </foreach>
         union all
         union all
-        select id,'5' as 'vistitType',current_location as 'testLocation',admission_user_name,car_num,null as 'cleanTime',null as 'dryTime',null as 'checkDate' ,sub_date,status as 'billStatus' ,null,3 AS 'type' from bill_goods_inventory where farm_id=#{farmId}
-        and current_location_id in
-        <foreach collection="locations" item="location" separator="," open="(" close=")">
-            #{location}
-        </foreach>
-        and status in
+        select id,'5' as 'vistitType',current_location as 'testLocation',admission_user_name,car_num,null as 'cleanTime',null as 'dryTime',null as 'checkDate' ,sub_date,bill_status as 'billStatus' ,null,3 AS 'type' from bill_goods_inventory where farm_id=#{farmId}
+<!--        and current_location_id in-->
+<!--        <foreach collection="locations" item="location" separator="," open="(" close=")">-->
+<!--            #{location}-->
+<!--        </foreach>-->
+        and bill_status in
         <foreach collection="status" item="statu" separator="," open="(" close=")">
         <foreach collection="status" item="statu" separator="," open="(" close=")">
             #{statu}
             #{statu}
         </foreach>
         </foreach>
-
+        ORDER BY sub_date DESC
     </select>
     </select>
 </mapper>
 </mapper>