Newspaper 1 rok temu
rodzic
commit
242433e66b

+ 12 - 2
huimv-admin/src/main/java/com/huimv/admin/controller/BillCleanController.java

@@ -4,6 +4,8 @@ package com.huimv.admin.controller;
 import cn.hutool.core.util.ObjectUtil;
 import com.huimv.admin.common.utils.Result;
 import com.huimv.admin.common.utils.ResultCode;
+import com.huimv.admin.entity.BillClean;
+import com.huimv.admin.entity.BillDry;
 import com.huimv.admin.service.IBillCleanService;
 import com.huimv.admin.service.IBillDryService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -65,9 +67,17 @@ public class BillCleanController {
     public Result getCleanAndDryDetail(@RequestBody Map<String, String> paramsMap){
         String type = paramsMap.get("type");
         if (type.equals("1")){
-            return new Result(ResultCode.SUCCESS,billCleanService.getById(paramsMap.get("id")));
+            BillClean billClean = billCleanService.getById(paramsMap.get("id"));
+            if (ObjectUtil.isEmpty(billClean.getImgUrl())){
+                billClean.setImgUrl("");
+            }
+            return new Result(ResultCode.SUCCESS, billClean);
         }else {
-            return new Result(ResultCode.SUCCESS,billDryService.getById(paramsMap.get("id")));
+            BillDry billDry = billDryService.getById(paramsMap.get("id"));
+            if (ObjectUtil.isEmpty(billDry.getImgUrl())){
+                billDry.setImgUrl("");
+            }
+            return new Result(ResultCode.SUCCESS, billDry);
         }
 
     }

+ 6 - 2
huimv-admin/src/main/java/com/huimv/admin/controller/BillLuggageController.java

@@ -34,8 +34,12 @@ public class BillLuggageController {
                              @RequestParam("luggageLocation") String luggageLocation,
                              @RequestParam("luggageLocationId") String luggageLocationId,
                              @RequestParam("luggageNum") Integer luggageNum,
-                             @RequestParam("img") MultipartFile img) throws IOException {
-        return billLuggageService.addLuggage(httpServletRequest,userName,phone,luggageDate,luggageLocation,luggageLocationId,luggageNum,img);
+                             @RequestParam("img1") MultipartFile img,
+                             @RequestParam("img2") MultipartFile img2,
+                             @RequestParam("img3") MultipartFile img3,
+                             @RequestParam("img4") MultipartFile img4,
+                             @RequestParam("img5") MultipartFile img5) throws IOException {
+        return billLuggageService.addLuggage(httpServletRequest,userName,phone,luggageDate,luggageLocation,luggageLocationId,luggageNum,img,img2,img3,img4,img5);
     }
 
     @PostMapping("/listPersonalLuggage")

+ 5 - 0
huimv-admin/src/main/java/com/huimv/admin/controller/CameraHKVSSync.java

@@ -74,6 +74,9 @@ public class CameraHKVSSync {
                 case 24:
                     region = DY_REGION;
                     break;
+                case 27:
+                    region = TT_REGION;
+                    break;
                 default:
                     return new Result(10001,"该牧场无服务",false);
             }
@@ -536,6 +539,8 @@ public class CameraHKVSSync {
     private static final String PW_REGION = "66096289-bd19-4390-a5d5-71a31e970b0b";
 
     private static final String DY_REGION = "a09ba2d8-8236-4de6-8e53-9008912d7b72";
+
+    private static final String TT_REGION = "d64e2029-75bb-4214-8cc4-e93deace9ea4";
     /**
      * 调用POST请求类型接口,这里以分页获取区域列表为例
      * 接口实际url:https://ip:port/artemis/api/api/resource/v1/regions

+ 1 - 1
huimv-admin/src/main/java/com/huimv/admin/service/IBillLuggageService.java

@@ -19,7 +19,7 @@ import java.util.Map;
  */
 public interface IBillLuggageService extends IService<BillLuggage> {
 
-    Result addLuggage(HttpServletRequest httpServletRequest, String userName, String phone, String luggageDate, String luggageLocation, String luggageLocationId,Integer luggageNum, MultipartFile img) throws IOException;
+    Result addLuggage(HttpServletRequest httpServletRequest, String userName, String phone, String luggageDate, String luggageLocation, String luggageLocationId,Integer luggageNum, MultipartFile img,MultipartFile img2,MultipartFile img3,MultipartFile img4,MultipartFile img5) throws IOException;
 
     Result listPersonalLuggage(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 }

+ 2 - 1
huimv-admin/src/main/java/com/huimv/admin/service/impl/BillCleanServiceImpl.java

@@ -280,8 +280,9 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
     public Result listPersonalClean(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
         String pageNo = paramsMap.get("pageNum");
         String pageSize = paramsMap.get("pageSize");
+        String vistitType = paramsMap.get("vistitType");
         Page<BillClean> page = new Page<>(Integer.parseInt(pageNo), Integer.parseInt(pageSize));
-        return new Result(ResultCode.SUCCESS, billCleanMapper.selectPage(page, new QueryWrapper<BillClean>().eq("admission_user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).eq("img_status", 1).orderByDesc("sub_date")));
+        return new Result(ResultCode.SUCCESS, billCleanMapper.selectPage(page, new QueryWrapper<BillClean>().eq(StringUtils.isNotBlank(vistitType),"vistit_type",vistitType).eq("admission_user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).orderByDesc("sub_date")));
     }
 
     @Override

+ 20 - 6
huimv-admin/src/main/java/com/huimv/admin/service/impl/BillLuggageServiceImpl.java

@@ -1,5 +1,6 @@
 package com.huimv.admin.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.huimv.admin.common.token.TokenSign;
@@ -39,7 +40,7 @@ public class BillLuggageServiceImpl extends ServiceImpl<BillLuggageMapper, BillL
     private BillLuggageMapper billLuggageMapper;
 
     @Override
-    public Result addLuggage(HttpServletRequest httpServletRequest, String userName, String phone, String luggageDate, String luggageLocation, String luggageLocationId,Integer luggageNum, MultipartFile img) throws IOException {
+    public Result addLuggage(HttpServletRequest httpServletRequest, String userName, String phone, String luggageDate, String luggageLocation, String luggageLocationId,Integer luggageNum, MultipartFile img,MultipartFile img2,MultipartFile img3,MultipartFile img4,MultipartFile img5) throws IOException {
         DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
         BillLuggage billLuggage = new BillLuggage();
         billLuggage.setUserName(userName);
@@ -49,11 +50,13 @@ public class BillLuggageServiceImpl extends ServiceImpl<BillLuggageMapper, BillL
         billLuggage.setLuggageNum(luggageNum);
         billLuggage.setLuggageLocation(luggageLocation);
         billLuggage.setLuggageLocationId(Integer.parseInt(luggageLocationId));
-        if (uploadImage.getImageCom(img).equals("上传失败")) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            return new Result(10001,"图片上传失败",false);
-        }
-        billLuggage.setArticlePicUrl(uploadImage.getImageCom(img));
+        String content ="";
+        content = getUrl(content,img);
+        content = getUrl(content,img2);
+        content = getUrl(content,img3);
+        content = getUrl(content,img4);
+        content = getUrl(content,img5);
+        billLuggage.setArticlePicUrl(content);
         billLuggageMapper.insert(billLuggage);
         return Result.SUCCESS();
     }
@@ -66,4 +69,15 @@ public class BillLuggageServiceImpl extends ServiceImpl<BillLuggageMapper, BillL
         Page<BillLuggage> billLuggagePage = billLuggageMapper.selectPage(page, new QueryWrapper<BillLuggage>().eq("user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).orderByDesc("luggage_date"));
         return new Result(ResultCode.SUCCESS,billLuggagePage);
     }
+
+    public String getUrl(String content, MultipartFile image) throws IOException {
+        if (ObjectUtil.isNotEmpty(image)){
+            if ( !"".equals(content)){
+                content = content +","+uploadImage.getImageCom(image);
+            }else {
+                content = content +uploadImage.getImageCom(image);
+            }
+        }
+        return content;
+    }
 }

+ 16 - 12
huimv-admin/src/main/java/com/huimv/admin/service/impl/BillPersonnelAdmissionServiceImpl.java

@@ -138,12 +138,16 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         baseProcess.setCurrentStatus("0");
         //获取位置
         BaseLocation baseLocation;
-        if (Integer.parseInt(destId) <= 47){
-            baseLocation = baseLocationMapper.selectOne(new QueryWrapper<BaseLocation>().eq("farm_id", farmId).eq("vistit_type", vistitType).eq("parent_id", 0));
-        }else if (Integer.parseInt(destId) <= 50){
-            baseLocation = baseLocationMapper.selectOne(new QueryWrapper<BaseLocation>().eq("farm_id", farmId).eq("vistit_type", vistitType).eq("location_type", 2).eq("parent_id",1));
+        if (vistitType.equals("5")){
+            if (Integer.parseInt(destId) <= 47){
+                baseLocation = baseLocationMapper.selectOne(new QueryWrapper<BaseLocation>().eq("farm_id", farmId).eq("vistit_type", vistitType).eq("parent_id", 0));
+            }else if (Integer.parseInt(destId) <= 50){
+                baseLocation = baseLocationMapper.selectOne(new QueryWrapper<BaseLocation>().eq("farm_id", farmId).eq("vistit_type", vistitType).eq("location_type", 2).eq("parent_id",1));
+            }else {
+                baseLocation = baseLocationMapper.selectOne(new QueryWrapper<BaseLocation>().eq("farm_id", farmId).eq("vistit_type", vistitType).eq("location_type", 3).eq("parent_id",1));
+            }
         }else {
-            baseLocation = baseLocationMapper.selectOne(new QueryWrapper<BaseLocation>().eq("farm_id", farmId).eq("vistit_type", vistitType).eq("location_type", 3).eq("parent_id",1));
+            baseLocation = baseLocationMapper.selectOne(new QueryWrapper<BaseLocation>().eq("farm_id", farmId).eq("vistit_type", vistitType).eq("parent_id", 0));
         }
         if (ObjectUtil.isEmpty(baseLocation)) {
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -156,12 +160,11 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         billPersonnelAdmission.setProcessId(baseProcess.getId());
         billPersonnelAdmissionMapper.insert(billPersonnelAdmission);
         ArrayList<String> phoneList = new ArrayList<>();
-        List<SysAccountMultilevel> factory = sysAccountMultilevelMapper.selectList(new QueryWrapper<SysAccountMultilevel>().eq("farm_ids", farmId).eq("type", 1));
-        for (SysAccountMultilevel sysAccountMultilevel : factory) {
+        List<SysAccountMultilevel> safe = sysAccountMultilevelMapper.selectList(new QueryWrapper<SysAccountMultilevel>().eq("farm_ids", farmId).eq("type", 3));
+        for (SysAccountMultilevel sysAccountMultilevel : safe) {
             phoneList.add(sysAccountMultilevel.getPhone());
         }
-//        SendSMS.sendSMS(phoneList,TokenSign.getUserNameByJwtToken(httpServletRequest)+"入场申请测试");
-        SendSMS.sendSMS(phoneList,"污渍正在进场!");
+        SendSMS.sendSMS(phoneList,TokenSign.getUserNameByJwtToken(httpServletRequest)+"入场申请测试");
         if (ObjectUtil.isNotEmpty(goods)){
             ObjectMapper objectMapper = new ObjectMapper();
             List<BillGoodsInventory> admissionAndGoods = objectMapper.readValue(goods, new TypeReference<List<BillGoodsInventory>>() {});
@@ -266,8 +269,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
             billPersonnelAdmission.setBillStatus(2);
             baseProcess.setProcessType(2);
             baseProcess.setCurrentStatus(String.join(",",split));
-//            SendSMS.sendSMS(phoneList,"拒绝入场申请测试");
-            SendSMS.sendSMS(phoneList,"污渍倒了");
+            SendSMS.sendSMS(phoneList,"拒绝入场申请测试");
+//            SendSMS.sendSMS(phoneList,"污渍倒了");
         } else {
             //通过
             billPersonnelAdmission.setBillStatus(1);
@@ -310,7 +313,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                     billPcr.setTestLocation(baseLocation.getLocationName());
                     billPcr.setTestLocationId(baseLocation.getId());
                     billPcrMapper.insert(billPcr);
-                    SendSMS.sendSMS(phoneList,"污渍,永远滴神!");
+                    SendSMS.sendSMS(phoneList,"通过入场申请测试");
+//                    SendSMS.sendSMS(phoneList,"污渍,永远滴神!");
                 }
             } else {
                 baseProcess.setCurrentStatus("1");