Selaa lähdekoodia

异常粮情列表

hanqingsong 3 vuotta sitten
vanhempi
commit
e716c6ef00

+ 7 - 0
src/main/java/com/unissoft/grainManage/controller/GrainConditionRecordController.java

@@ -94,4 +94,11 @@ public class GrainConditionRecordController {
94 94
         return ResultView.success(page);
95 95
     }
96 96
 
97
+    @ApiOperation(value = "本机构异常粮情列表分页查询", notes = "提交参数: depotId 非空")
98
+    @PostMapping("/authority/getGrainErrorHouseList")
99
+    public ResultView getGrainErrorHouseList(@RequestBody PageParam pageParam) {
100
+        IPage<GrainError> page = grainConditionRecordService.getGrainErrorHouseList(pageParam);
101
+        return ResultView.success(page);
102
+    }
103
+
97 104
 }

+ 2 - 0
src/main/java/com/unissoft/grainManage/service/GrainConditionRecordService.java

@@ -34,4 +34,6 @@ public interface GrainConditionRecordService extends IService<GrainConditionReco
34 34
     IPage<GrainError> getGrainErrorCount(PageParam pageParam);
35 35
 
36 36
     List<GrainErrorEChars> getGrainErrorEChars(Integer depotId);
37
+
38
+    IPage<GrainError> getGrainErrorHouseList(PageParam pageParam);
37 39
 }

+ 22 - 0
src/main/java/com/unissoft/grainManage/service/impl/GrainConditionRecordServiceImpl.java

@@ -219,4 +219,26 @@ public class GrainConditionRecordServiceImpl extends ServiceImpl<GrainConditionR
219 219
         return iPage;
220 220
     }
221 221
 
222
+    @Override
223
+    public IPage<GrainError> getGrainErrorHouseList(PageParam pageParam) {
224
+        // 分页
225
+        int pageIndex = pageParam.getPageIndex();
226
+        int pageSize = pageParam.getPageSize();
227
+        // 分页对象
228
+        IPage<GrainError> iPage = new Page<>();
229
+        // 查询条件
230
+        if (!StringUtils.isEmpty(pageParam.getCondition())) {
231
+            if (pageIndex != MyConstant.ZERO && pageSize != MyConstant.ZERO) {
232
+                iPage.setCurrent(pageIndex);
233
+                iPage.setSize(pageSize);
234
+            }
235
+            // 查询map对象
236
+            Map<String, Object> map = JSON.parseObject(pageParam.getCondition(), Map.class);
237
+            // 获取分页查询数据
238
+            IPage<GrainError> res = grainConditionRecordMapper.getGrainErrorHouseList(iPage, map);
239
+            return res;
240
+        }
241
+        return iPage;
242
+    }
243
+
222 244
 }

+ 2 - 0
src/main/java/com/unissoft/mapper/GrainConditionRecordMapper.java

@@ -28,6 +28,8 @@ public interface GrainConditionRecordMapper extends BaseMapper<GrainConditionRec
28 28
 
29 29
     List<GrainErrorEChars> getGrainErrorEChars(@Param("depotIds") List<Integer> depotIds);
30 30
 
31
+    IPage<GrainError> getGrainErrorHouseList(IPage<GrainError> iPage, @Param("params") Map<String, Object> map);
32
+
31 33
     // List<GrainConditionRecord> getByPersonAndTime();
32 34
 //    int getSelectRecordId();
33 35
 

+ 27 - 0
src/main/java/com/unissoft/mapper/GrainConditionRecordMapper.xml

@@ -108,6 +108,33 @@
108 108
         GROUP BY
109 109
           depot_id
110 110
     </select>
111
+    <select id="getGrainErrorHouseList" resultType="com.unissoft.model.GrainError">
112
+        SELECT
113
+            CONCAT(
114
+                check_year,
115
+                '年',
116
+                check_year_week,
117
+                '周'
118
+            ) yearJoinWeek,
119
+            house_id houseId,
120
+            depot_id depotId,
121
+            grain_error grainError,
122
+            operation_time operationTime
123
+        FROM
124
+            grain_condition_record
125
+        <where>
126
+            <if test="params.depotId != null">
127
+                AND depot_id = #{params.depotId}
128
+            </if>
129
+            <if test="params.checkYear != null">
130
+                AND check_year = #{params.checkYear}
131
+            </if>
132
+            <if test="params.checkYearWeek != null">
133
+                AND check_year_week = #{params.checkYearWeek}
134
+            </if>
135
+        </where>
136
+        ORDER BY operation_time DESC
137
+    </select>
111 138
 
112 139
   <!--  <select id="getByPersonAndTime"  resultType="com.unissoft.model.GrainConditionRecord">
113 140
         SELECT

+ 4 - 0
src/main/java/com/unissoft/model/GrainError.java

@@ -28,10 +28,14 @@ public class GrainError implements Serializable {
28 28
     private String yearJoinWeek;
29 29
     @ApiModelProperty(value = "库id")
30 30
     private Integer depotId;
31
+    @ApiModelProperty(value = "仓房id")
32
+    private Integer houseId;
31 33
     @ApiModelProperty(value = "仓房个数")
32 34
     private Integer houseCount;
33 35
     @ApiModelProperty(value = "异常粮情个数")
34 36
     private Integer grainErrorCount;
37
+    @ApiModelProperty(value = "本机构异常粮情 grainError != null && grainError == 191 的为黄色")
38
+    private Integer grainError;
35 39
     @ApiModelProperty(value = "检查(操作)时间(子表)")
36 40
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
37 41
     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")