mengy 5 anni fa
parent
commit
13d52f4a1d

+ 12 - 9
src/main/java/com/chinaitop/depot/storage/controller/StorageQualitycheckController.java

@@ -57,13 +57,13 @@ public class StorageQualitycheckController {
57 57
             @ApiImplicitParam(name = "checkResult", value = "检查结果", paramType = "query"),
58 58
             @ApiImplicitParam(name = "quality", value = "储粮性质", paramType = "query"),
59 59
             @ApiImplicitParam(name = "subType", value = "粮食品种", paramType = "query"),
60
-            @ApiImplicitParam(name = "checkTime", value = "检查日期", paramType = "query"),
61
-            @ApiImplicitParam(name = "flagType", value = "判断是否已验收", paramType = "query"),
60
+            @ApiImplicitParam(name = "searchStartDate", value = "开始日期", paramType = "query"),
61
+            @ApiImplicitParam(name = "searchEndDate", value = "结束日期", paramType = "query"),
62 62
             @ApiImplicitParam(name = "orgId", value = "单位ID", paramType = "query")
63 63
     })
64 64
     public PageInfo<StorageQualitycheck> listPage(Integer pageNum, Integer pageSize,
65
-                                                  StorageQualitycheck qualitycheck, String checktype, String checkResult, Integer flagType,
66
-                                                  String quality, Integer subType, String checkTime, Integer orgId) {
65
+                                                  StorageQualitycheck qualitycheck, String checktype, String checkResult,
66
+                                                  String quality, Integer subType, String searchStartDate, String searchEndDate, Integer orgId) {
67 67
     	StorageQualitycheck qualityCheck = new StorageQualitycheck();
68 68
         //根据后台传来的参数进行查找相应类型的类别0:初检 1:验收 2:质量普查 3:出库
69 69
         if (StringUtils.isNotBlank(checktype)){
@@ -75,9 +75,12 @@ public class StorageQualitycheckController {
75 75
         if (subType!= null){
76 76
             qualityCheck.setSubType(subType);
77 77
         }
78
-        if (checkTime!= null){
79
-            qualityCheck.setCheckTime(ParameterUtil.string2datetime(checkTime));
78
+
79
+        if(ParameterUtil.isnotnull(searchStartDate) && ParameterUtil.isnotnull(searchEndDate)){
80
+            qualityCheck.setSearchStartDate(searchStartDate);
81
+            qualityCheck.setSearchEndDate(searchEndDate);
80 82
         }
83
+
81 84
         // 仓房id.
82 85
         if (qualitycheck.getHouseId() != null) {
83 86
             qualityCheck.setHouseId(qualitycheck.getHouseId());
@@ -108,9 +111,9 @@ public class StorageQualitycheckController {
108 111
         }
109 112
 
110 113
         //验收结果
111
-        if (qualitycheck.getFlagType() != null) {
112
-            qualityCheck.setFlagType(flagType);
113
-        }
114
+//        if (qualitycheck.getFlagType() != null) {
115
+//            qualityCheck.setFlagType(flagType);
116
+//        }
114 117
 
115 118
         qualityCheck.setHistoryStatus(0);//0:最新数据  1:历史数据
116 119
         //查询出未封仓的质量管理信息 封仓状态:0:未封仓,1:已封仓

+ 5 - 2
src/main/java/com/chinaitop/depot/storage/mapper/StorageQualitycheckMapper.xml

@@ -1978,8 +1978,11 @@
1978 1978
       <if test="subType !=null">
1979 1979
         and sqk.sub_type = #{subType}
1980 1980
       </if>
1981
-      <if test="checkTime !=null">
1982
-        and sqk.check_time = #{checkTime}
1981
+      <if test="searchStartDate !=null">
1982
+        and STR_TO_DATE(sqk.check_time, '%Y-%m-%d')  <![CDATA[ >= ]]> #{searchStartDate}
1983
+      </if>
1984
+      <if test="searchEndDate !=null">
1985
+        and STR_TO_DATE(sqk.check_time, '%Y-%m-%d')  &lt;= #{searchEndDate}
1983 1986
       </if>
1984 1987
     </where>
1985 1988
     order by sqk.id desc

+ 21 - 0
src/main/java/com/chinaitop/depot/storage/model/StorageQualitycheck.java

@@ -5,6 +5,27 @@ import java.math.BigDecimal;
5 5
 
6 6
 
7 7
 public class StorageQualitycheck {
8
+
9
+    //开始日期和结束日期
10
+    private String searchStartDate;
11
+
12
+    public String getSearchStartDate() {
13
+        return searchStartDate;
14
+    }
15
+
16
+    public void setSearchStartDate(String searchStartDate) {
17
+        this.searchStartDate = searchStartDate;
18
+    }
19
+
20
+    public String getSearchEndDate() {
21
+        return searchEndDate;
22
+    }
23
+
24
+    public void setSearchEndDate(String searchEndDate) {
25
+        this.searchEndDate = searchEndDate;
26
+    }
27
+
28
+    private String searchEndDate;
8 29
     /**
9 30
      * This field was generated by MyBatis Generator.
10 31
      * This field corresponds to the database column storage_qualitycheck.id