Forráskód Böngészése

物资车入场申请

Newspaper 1 éve
szülő
commit
1964e5d8c8

+ 18 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/vo/CleanAndDryVo2.java

@@ -93,7 +93,25 @@ public class CleanAndDryVo2 {
 
     private Integer imgStatus;
     private Integer type;
+
+
     private String cleanTime;
     private String dryTime;
     private String dryTem;
+
+    private Integer goodsType;
+
+    private String goodsTypeName;
+
+    private String goodsNums;
+
+    private String goodsName;
+
+    private String goodsUnit;
+
+    private Integer billAdmission;
+
+    private String currentLocation;
+
+    private Integer currentLocationId;
 }

+ 33 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/vo/CleanDryGoodsVo.java

@@ -0,0 +1,33 @@
+package com.huimv.receive.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+@Data
+public class CleanDryGoodsVo {
+    private Integer id;
+
+    private Integer vistitType;
+
+    private String testLocation;
+
+    private String admissionUserName;
+
+    private String carNum;
+
+    private String cleanTime;
+
+    private String dryTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private Date checkDate;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private LocalDateTime subDate;
+
+    private Integer type;
+
+}

+ 3 - 4
huimv-receive/src/main/java/com/huimv/receive/mapper/BillCleanMapper.java

@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.huimv.receive.entity.BillClean;
 import com.huimv.receive.entity.BillPcr;
-import com.huimv.receive.entity.vo.CleanAndDryVo;
-import com.huimv.receive.entity.vo.CleanAndDryVo2;
-import com.huimv.receive.entity.vo.CleanVo;
-import com.huimv.receive.entity.vo.PcrVo1;
+import com.huimv.receive.entity.vo.*;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -37,4 +34,6 @@ public interface BillCleanMapper extends BaseMapper<BillClean> {
     Page<CleanAndDryVo2> CleanList(Page<CleanAndDryVo2> page, String farmId, String[] status, String location);
 
     List<CleanVo> listAll(@Param(Constants.WRAPPER) QueryWrapper<BillClean> queryWrapper);
+
+    Page<CleanDryGoodsVo> listCleanDryGoods(Page<CleanDryGoodsVo> page, String farmId, String type, String[] status, String[] locations);
 }

+ 38 - 15
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillCleanServiceImpl.java

@@ -9,10 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.huimv.receive.common.token.TokenSign;
 import com.huimv.receive.common.utils.*;
 import com.huimv.receive.entity.*;
-import com.huimv.receive.entity.vo.CleanAndDryVo;
-import com.huimv.receive.entity.vo.CleanAndDryVo2;
-import com.huimv.receive.entity.vo.CleanVo;
-import com.huimv.receive.entity.vo.PcrVo1;
+import com.huimv.receive.entity.vo.*;
 import com.huimv.receive.mapper.*;
 import com.huimv.receive.service.IBillCleanService;
 import com.huimv.receive.service.IBillPcrService;
@@ -110,23 +107,49 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
             return new Result(ResultCode.SUCCESS, cleanMapper.selectPage(page, queryWrapper), cleanMapper.selectCount(queryWrapper2));
         }
         else if ("5".equals(type)) {
-            Page<BillGoodsInventory> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
-            QueryWrapper<BillGoodsInventory> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("farm_id", farmId).orderByDesc("sub_date");
-
+            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", type);
+            QueryWrapper<BillDry> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("farm_id", farmId).eq("vistit_type", type);
+            QueryWrapper<BillGoodsInventory> queryWrapper3 = new QueryWrapper<>();
+            queryWrapper3.eq("farm_id", farmId);
             if ("0".equals(data)) {
-                queryWrapper.in("status", 0, 1);
+                String[] s = {TokenSign.getWorkIdByJwtToken(httpServletRequest)};
+                System.out.println("传入自定义sql的位置参数形式:" + s);
+                cleanDryGoodPage = cleanMapper.listCleanDryGoods(page, farmId, type, "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));
             }
             if ("1".equals(data)) {
-                queryWrapper.eq("status", 0);
+                String[] ids = {TokenSign.getWorkIdByJwtToken(httpServletRequest)};
+                ArrayList<String> arrayList = new ArrayList<>();
+                arrayList.add("0");
+                String[] s = arrayList.toArray(new String[arrayList.size()]);
+                cleanDryGoodPage = cleanMapper.listCleanDryGoods(page, farmId, type, s, ids);
+                queryWrapper.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
+                queryWrapper2.in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
+                queryWrapper3.in("current_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
             }
             if ("2".equals(data)) {
-                queryWrapper.eq("status", 1);
+                String[] ids = {TokenSign.getWorkIdByJwtToken(httpServletRequest)};
+                ArrayList<String> arrayList = new ArrayList<>();
+                arrayList.add("1");
+                String[] s = arrayList.toArray(new String[arrayList.size()]);
+                cleanDryGoodPage = cleanMapper.listCleanDryGoods(page, farmId, type, s, ids);
+                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<BillGoodsInventory> queryWrapper2 = new QueryWrapper<>();
-            queryWrapper2.eq("farm_id", farmId).orderByDesc("sub_date").eq("status", 0);
-            Page<BillGoodsInventory> inventoryPage = inventoryMapper.selectPage(page, queryWrapper);
-            return new Result(ResultCode.SUCCESS, inventoryPage, inventoryMapper.selectCount(queryWrapper2));
+            queryWrapper.eq("img_status", 0);
+            queryWrapper2.eq("img_status", 0);
+            queryWrapper3.eq("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);
         } else {
             Page<CleanAndDryVo2> cleanAndDryVo2Page = null;
             Page<CleanAndDryVo2> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));

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

@@ -51,7 +51,7 @@
     </select>
 
     <select id="CleanAndDry" resultType="com.huimv.receive.entity.vo.CleanAndDryVo2">
-        select *,null,1 AS 'type' from bill_clean where farm_id=#{farmId} and vistit_type=#{type}
+        select *,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}
@@ -70,12 +70,6 @@
         <foreach collection="status" item="statu" separator="," open="(" close=")">
             #{statu}
         </foreach>
-        union all
-        select *,3 AS 'type' from bill_goods_inventory where farm_id=#{farmId}
-        and status in
-        <foreach collection="status" item="statu" separator="," open="(" close=")">
-            #{statu}
-        </foreach>
         ORDER BY sub_date DESC
     </select>
 
@@ -126,4 +120,36 @@ GROUP BY
 ORDER BY
     DATE(sub_date)
     </select>
+    <select id="listCleanDryGoods" resultType="com.huimv.receive.entity.vo.CleanDryGoodsVo">
+        select id,vistitType,test_location,admission_user_name,carNum,cleanTime,null as 'dryTime',check_date,subDate,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 img_status in
+        <foreach collection="status" item="statu" separator="," open="(" close=")">
+            #{statu}
+        </foreach>
+        union all
+        select id,vistitType,test_location,admission_user_name,carNum,null as 'cleanTime',dryTime,check_date,subDate,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 img_status in
+        <foreach collection="status" item="statu" separator="," open="(" close=")">
+            #{statu}
+        </foreach>
+        union all
+        select id,'5' as 'vistitType',current_location as 'testLocation',admission_user_name,carNum,null as 'cleanTime',null as 'dryTime',null as 'checkDate' ,subDate,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
+        <foreach collection="status" item="statu" separator="," open="(" close=")">
+            #{statu}
+        </foreach>
+
+    </select>
 </mapper>