Bladeren bron

登统表功能新需求开发

fanxw 5 jaren geleden
bovenliggende
commit
82df379784

+ 38 - 0
src/main/java/com/chinaitop/depot/registrationTable/controller/RegistrationTableController.java

@@ -2,6 +2,7 @@ package com.chinaitop.depot.registrationTable.controller;
2 2
 
3 3
 import java.util.ArrayList;
4 4
 import java.util.List;
5
+import java.util.Map;
5 6
 
6 7
 import javax.annotation.Resource;
7 8
 import javax.servlet.http.HttpServletRequest;
@@ -14,6 +15,7 @@ import org.springframework.web.multipart.MultipartFile;
14 15
 
15 16
 import com.chinaitop.depot.registrationTable.service.RegistrationTableService;
16 17
 import com.chinaitop.depot.registrationTable.service.impl.ImportFileServiceImpl;
18
+import com.github.pagehelper.PageInfo;
17 19
 
18 20
 import io.swagger.annotations.Api;
19 21
 import io.swagger.annotations.ApiImplicitParam;
@@ -226,4 +228,40 @@ public class RegistrationTableController {
226 228
 		return errormsg;
227 229
 	}
228 230
 
231
+	@RequestMapping(value="/queryImportPzCount", method=RequestMethod.GET)
232
+	@ApiOperation(value="查询大豆原油导入总数量", notes = "")
233
+	@ApiImplicitParams({
234
+		@ApiImplicitParam(name = "json", value = "条件对象", paramType = "query"),
235
+		@ApiImplicitParam(name = "pzlx", value = "类型(1小麦,2玉米,3大豆,4稻谷,5大豆原油)", paramType = "query")
236
+	})
237
+	public String queryImportPzCount(HttpServletRequest request, String json, String pzlx){
238
+
239
+		String drzsl = "";
240
+		try {
241
+			drzsl = registrationTableService.queryImportPzCount(request, json, pzlx);
242
+		} catch (Exception e) {
243
+			e.printStackTrace();
244
+		}
245
+		return drzsl;
246
+	}
247
+	
248
+	@RequestMapping(value="/view", method=RequestMethod.GET)
249
+	@ApiOperation(value="查询单位下登统表导入数量跟期初库存数量 ", notes = "")
250
+	@ApiImplicitParams({
251
+		@ApiImplicitParam(name = "pageNum", value = "页数", paramType = "query"),
252
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
253
+		@ApiImplicitParam(name = "json", value = "条件对象", paramType = "query"),
254
+		@ApiImplicitParam(name = "pzlx", value = "类型(1小麦,2玉米,3大豆,4稻谷,5大豆原油)", paramType = "query")
255
+	})
256
+	public PageInfo<Map<String, Object>> view(HttpServletRequest request, Integer pageNum, Integer pageSize, String json, String pzlx){
257
+
258
+		PageInfo<Map<String, Object>> pageInfo = null;
259
+		try {
260
+			pageInfo = registrationTableService.view(request, pageNum, pageSize, json, pzlx);
261
+		} catch (Exception e) {
262
+			e.printStackTrace();
263
+		}
264
+		return pageInfo;
265
+	}
266
+
229 267
 }

+ 18 - 0
src/main/java/com/chinaitop/depot/registrationTable/mapper/RecordCornInfoMapper.java

@@ -1,6 +1,8 @@
1 1
 package com.chinaitop.depot.registrationTable.mapper;
2 2
 
3 3
 import java.util.List;
4
+import java.util.Map;
5
+
4 6
 import org.apache.ibatis.annotations.Param;
5 7
 
6 8
 import com.chinaitop.depot.registrationTable.model.RecordCornInfo;
@@ -28,4 +30,20 @@ public interface RecordCornInfoMapper {
28 30
     int updateByPrimaryKeySelective(RecordCornInfo record);
29 31
 
30 32
     int updateByPrimaryKey(RecordCornInfo record);
33
+
34
+    /**
35
+     * 查询玉米登统信息导入总数量
36
+     * 
37
+     * @param param
38
+     * @return
39
+     */
40
+	String countByConditions(Map<String, Object> param);
41
+
42
+	/**
43
+	 * 按仓房、货位、品种分组,查询登统表导入总数量
44
+	 * 
45
+	 * @param param
46
+	 * @return
47
+	 */
48
+	List<Map<String, Object>> queryGroupSumRksl(Map<String, Object> param);
31 49
 }

+ 51 - 0
src/main/java/com/chinaitop/depot/registrationTable/mapper/RecordCornInfoMapper.xml

@@ -534,4 +534,55 @@
534 534
       ccfs = #{ccfs,jdbcType=VARCHAR}
535 535
     where id = #{id,jdbcType=VARCHAR}
536 536
   </update>
537
+  <!-- 查询玉米登统信息导入总数量 -->
538
+  <select id="countByConditions" resultType="java.lang.String" parameterType="java.util.Map">
539
+  	select nvl(sum(to_number(wheat.rksl)),0) drzsl
540
+	from record_corn_info wheat
541
+	left join basic_storehouse storehouse on storehouse.org_id = wheat.org_id and storehouse.del_flag = 1
542
+		 and storehouse.library_type = 0 and storehouse.storehouse_name = wheat.cfmc
543
+	left join basic_warehouse warehouse on warehouse.org_id = wheat.org_id and warehouse.del_flag = 1
544
+		 and warehouse.library_type = 0 and warehouse.warehouse_name = wheat.hwmc
545
+	WHERE 1=1
546
+	<if test="orgId != null">
547
+       	and wheat.org_id = #{orgId} 
548
+	</if>
549
+	<if test="houseId != null">
550
+       	and storehouse.storehouse_id = #{houseId} 
551
+	</if>  
552
+	<if test="warehouseId != null">
553
+       	and warehouse.warehouse_id = #{warehouseId} 
554
+	</if>  
555
+	<if test="startDate != null">
556
+       	and to_char(wheat.rkrq,'yyyy-mm-dd') >= #{startDate} 
557
+	</if>  
558
+	<if test="endDate != null">
559
+       	and #{endDate} >= to_char(wheat.rkrq,'yyyy-mm-dd') 
560
+	</if>
561
+  </select>
562
+  <!-- 按仓房、货位、品种分组,查询登统表导入总数量 -->
563
+  <select id="queryGroupSumRksl" resultType="java.util.Map" parameterType="java.util.Map">
564
+  	select 
565
+		b.storehouse_id ch,c.warehouse_id hwh,d.enumid enumid,sum(to_number(a.rksl)) rkzsl 
566
+	from record_corn_info a 
567
+	left join basic_storehouse b on b.storehouse_name=a.cfmc and a.org_id=b.org_id and b.library_type = 0
568
+	left join basic_warehouse c on c.warehouse_name=a.hwmc and c.org_id=a.org_id and c.library_type = 0
569
+	left join basic_enum d on d.enumname=a.pzmc and d.parentid=1061
570
+	where 1=1 
571
+	<if test="orgId != null">
572
+	and a.org_id=#{orgId}
573
+	</if>
574
+	<if test="houseId != null">
575
+	and b.storehouse_id=#{houseId}
576
+	</if>  
577
+	<if test="warehouseId != null">
578
+	and c.warehouse_id=#{warehouseId}
579
+	</if>  
580
+	<if test="startDate != null">
581
+	and to_char(a.rkrq,'yyyy-mm-dd') >= #{startDate} 
582
+	</if>  
583
+	<if test="endDate != null">
584
+	and #{endDate} >= to_char(a.rkrq,'yyyy-mm-dd') 
585
+	</if>
586
+	group by b.storehouse_id,c.warehouse_id,d.enumid
587
+  </select>
537 588
 </mapper>

+ 17 - 0
src/main/java/com/chinaitop/depot/registrationTable/mapper/RecordCrudeoilInfoMapper.java

@@ -1,6 +1,8 @@
1 1
 package com.chinaitop.depot.registrationTable.mapper;
2 2
 
3 3
 import java.util.List;
4
+import java.util.Map;
5
+
4 6
 import org.apache.ibatis.annotations.Param;
5 7
 
6 8
 import com.chinaitop.depot.registrationTable.model.RecordCrudeoilInfo;
@@ -28,4 +30,19 @@ public interface RecordCrudeoilInfoMapper {
28 30
     int updateByPrimaryKeySelective(RecordCrudeoilInfo record);
29 31
 
30 32
     int updateByPrimaryKey(RecordCrudeoilInfo record);
33
+
34
+    /**
35
+     * 查询大豆原油登统信息导入总数量
36
+     * @param param
37
+     * @return
38
+     */
39
+	String countByConditions(Map<String, Object> param);
40
+
41
+	/**
42
+	 * 按仓房、货位、品种分组,查询登统表导入总数量
43
+	 * 
44
+	 * @param param
45
+	 * @return
46
+	 */
47
+	List<Map<String, Object>> queryGroupSumRksl(Map<String, Object> param);
31 48
 }

+ 45 - 0
src/main/java/com/chinaitop/depot/registrationTable/mapper/RecordCrudeoilInfoMapper.xml

@@ -365,4 +365,49 @@
365 365
       ccfs = #{ccfs,jdbcType=VARCHAR}
366 366
     where id = #{id,jdbcType=VARCHAR}
367 367
   </update>
368
+  <!-- 查询大豆原油登统信息导入总数量 -->
369
+  <select id="countByConditions" resultType="java.lang.String" parameterType="java.util.Map">
370
+  	select nvl(sum(to_number(crudeoil.rksl)),0) drzsl
371
+	from record_crudeoil_info crudeoil
372
+	left join basic_tank tank on tank.org_id = crudeoil.org_id and tank.del_flag = 1
373
+			and tank.storagetank_name = crudeoil.ygmc
374
+	WHERE 1=1
375
+	<if test="orgId != null">
376
+       	and crudeoil.org_id = #{orgId} 
377
+	</if>
378
+	<if test="tankId != null">
379
+       	and tank.id = #{tankId} 
380
+	</if>  
381
+	<if test="startDate != null">
382
+       	and to_char(crudeoil.rkrq,'yyyy-mm-dd') >= #{startDate} 
383
+	</if>  
384
+	<if test="endDate != null">
385
+       	and #{endDate} >= to_char(crudeoil.rkrq,'yyyy-mm-dd') 
386
+	</if>
387
+  </select>
388
+  <!-- 按仓房、货位、品种分组,查询登统表导入总数量 -->
389
+  <select id="queryGroupSumRksl" resultType="java.util.Map" parameterType="java.util.Map">
390
+  	select 
391
+		b.id ch,b.id hwh,d.enumid enumid,sum(to_number(a.rksl)) rkzsl 
392
+	from record_rice_info a 
393
+	left join basic_tank b on b.storagetank_name=a.ygmc and a.org_id=b.org_id and b.library_type = 0
394
+	left join basic_enum d on d.enumname=a.pzmc and d.parentid=1061
395
+	where 1=1 
396
+	<if test="orgId != null">
397
+	and a.org_id=#{orgId}
398
+	</if>
399
+	<if test="houseId != null">
400
+	and b.storehouse_id=#{houseId}
401
+	</if>
402
+	<if test="warehouseId != null">
403
+	and c.warehouse_id=#{warehouseId}
404
+	</if>
405
+	<if test="startDate != null">
406
+	and to_char(a.rkrq,'yyyy-mm-dd') >= #{startDate} 
407
+	</if>
408
+	<if test="endDate != null">
409
+	and #{endDate} >= to_char(a.rkrq,'yyyy-mm-dd') 
410
+	</if>
411
+	group by b.id,d.enumid
412
+  </select>
368 413
 </mapper>

+ 18 - 0
src/main/java/com/chinaitop/depot/registrationTable/mapper/RecordRiceInfoMapper.java

@@ -3,6 +3,8 @@ package com.chinaitop.depot.registrationTable.mapper;
3 3
 import com.chinaitop.depot.registrationTable.model.RecordRiceInfo;
4 4
 import com.chinaitop.depot.registrationTable.model.RecordRiceInfoExample;
5 5
 import java.util.List;
6
+import java.util.Map;
7
+
6 8
 import org.apache.ibatis.annotations.Param;
7 9
 
8 10
 public interface RecordRiceInfoMapper {
@@ -27,4 +29,20 @@ public interface RecordRiceInfoMapper {
27 29
     int updateByPrimaryKeySelective(RecordRiceInfo record);
28 30
 
29 31
     int updateByPrimaryKey(RecordRiceInfo record);
32
+
33
+    /**
34
+     * 查询稻谷登统信息导入总数量
35
+     * 
36
+     * @param param
37
+     * @return
38
+     */
39
+	String countByConditions(Map<String, Object> param);
40
+
41
+	/**
42
+	 * 按仓房、货位、品种分组,查询登统表导入总数量
43
+	 * 
44
+	 * @param param
45
+	 * @return
46
+	 */
47
+	List<Map<String, Object>> queryGroupSumRksl(Map<String, Object> param);
30 48
 }

+ 51 - 0
src/main/java/com/chinaitop/depot/registrationTable/mapper/RecordRiceInfoMapper.xml

@@ -551,4 +551,55 @@
551 551
       ccfs = #{ccfs,jdbcType=VARCHAR}
552 552
     where id = #{id,jdbcType=VARCHAR}
553 553
   </update>
554
+  <!-- 查询稻谷登统信息导入总数量 -->
555
+  <select id="countByConditions" resultType="java.lang.String" parameterType="java.util.Map">
556
+  	select nvl(sum(to_number(wheat.rksl)),0) drzsl
557
+	from record_rice_info wheat
558
+	left join basic_storehouse storehouse on storehouse.org_id = wheat.org_id and storehouse.del_flag = 1
559
+		 and storehouse.library_type = 0 and storehouse.storehouse_name = wheat.cfmc
560
+	left join basic_warehouse warehouse on warehouse.org_id = wheat.org_id and warehouse.del_flag = 1
561
+		 and warehouse.library_type = 0 and warehouse.warehouse_name = wheat.hwmc
562
+	WHERE 1=1
563
+	<if test="orgId != null">
564
+       	and wheat.org_id = #{orgId} 
565
+	</if>
566
+	<if test="houseId != null">
567
+       	and storehouse.storehouse_id = #{houseId} 
568
+	</if>  
569
+	<if test="warehouseId != null">
570
+       	and warehouse.warehouse_id = #{warehouseId} 
571
+	</if>  
572
+	<if test="startDate != null">
573
+       	and to_char(wheat.rkrq,'yyyy-mm-dd') >= #{startDate} 
574
+	</if>  
575
+	<if test="endDate != null">
576
+       	and #{endDate} >= to_char(wheat.rkrq,'yyyy-mm-dd') 
577
+	</if>
578
+  </select>
579
+  <!-- 按仓房、货位、品种分组,查询登统表导入总数量 -->
580
+  <select id="queryGroupSumRksl" resultType="java.util.Map" parameterType="java.util.Map">
581
+  	select 
582
+		b.storehouse_id ch,c.warehouse_id hwh,d.enumid enumid,sum(to_number(a.rksl)) rkzsl 
583
+	from record_rice_info a 
584
+	left join basic_storehouse b on b.storehouse_name=a.cfmc and a.org_id=b.org_id and b.library_type = 0
585
+	left join basic_warehouse c on c.warehouse_name=a.hwmc and c.org_id=a.org_id and c.library_type = 0
586
+	left join basic_enum d on d.enumname=a.pzmc and d.parentid=1061
587
+	where 1=1 
588
+	<if test="orgId != null">
589
+	and a.org_id=#{orgId}
590
+	</if>
591
+	<if test="houseId != null">
592
+	and b.storehouse_id=#{houseId}
593
+	</if>
594
+	<if test="warehouseId != null">
595
+	and c.warehouse_id=#{warehouseId}
596
+	</if>
597
+	<if test="startDate != null">
598
+	and to_char(a.rkrq,'yyyy-mm-dd') >= #{startDate} 
599
+	</if>
600
+	<if test="endDate != null">
601
+	and #{endDate} >= to_char(a.rkrq,'yyyy-mm-dd') 
602
+	</if>
603
+	group by b.storehouse_id,c.warehouse_id,d.enumid
604
+  </select>
554 605
 </mapper>

+ 18 - 0
src/main/java/com/chinaitop/depot/registrationTable/mapper/RecordSoybeanInfoMapper.java

@@ -1,6 +1,8 @@
1 1
 package com.chinaitop.depot.registrationTable.mapper;
2 2
 
3 3
 import java.util.List;
4
+import java.util.Map;
5
+
4 6
 import org.apache.ibatis.annotations.Param;
5 7
 
6 8
 import com.chinaitop.depot.registrationTable.model.RecordSoybeanInfo;
@@ -28,4 +30,20 @@ public interface RecordSoybeanInfoMapper {
28 30
     int updateByPrimaryKeySelective(RecordSoybeanInfo record);
29 31
 
30 32
     int updateByPrimaryKey(RecordSoybeanInfo record);
33
+
34
+    /**
35
+     * 查询大豆登统信息导入总数量
36
+     * 
37
+     * @param param
38
+     * @return
39
+     */
40
+	String countByConditions(Map<String, Object> param);
41
+
42
+	/**
43
+	 * 按仓房、货位、品种分组,查询登统表导入总数量
44
+	 * 
45
+	 * @param param
46
+	 * @return
47
+	 */
48
+	List<Map<String, Object>> queryGroupSumRksl(Map<String, Object> param);
31 49
 }

+ 51 - 0
src/main/java/com/chinaitop/depot/registrationTable/mapper/RecordSoybeanInfoMapper.xml

@@ -551,4 +551,55 @@
551 551
       ccfs = #{ccfs,jdbcType=VARCHAR}
552 552
     where id = #{id,jdbcType=VARCHAR}
553 553
   </update>
554
+  <!-- 查询大豆登统信息导入总数量 -->
555
+  <select id="countByConditions" resultType="java.lang.String" parameterType="java.util.Map">
556
+  	select nvl(sum(to_number(wheat.rksl)),0) drzsl
557
+	from record_soybean_info wheat
558
+	left join basic_storehouse storehouse on storehouse.org_id = wheat.org_id and storehouse.del_flag = 1
559
+		 and storehouse.library_type = 0 and storehouse.storehouse_name = wheat.cfmc
560
+	left join basic_warehouse warehouse on warehouse.org_id = wheat.org_id and warehouse.del_flag = 1
561
+		 and warehouse.library_type = 0 and warehouse.warehouse_name = wheat.hwmc
562
+	WHERE 1=1
563
+	<if test="orgId != null">
564
+       	and wheat.org_id = #{orgId} 
565
+	</if>
566
+	<if test="houseId != null">
567
+       	and storehouse.storehouse_id = #{houseId} 
568
+	</if>  
569
+	<if test="warehouseId != null">
570
+       	and warehouse.warehouse_id = #{warehouseId} 
571
+	</if>  
572
+	<if test="startDate != null">
573
+       	and to_char(wheat.rkrq,'yyyy-mm-dd') >= #{startDate} 
574
+	</if>  
575
+	<if test="endDate != null">
576
+       	and #{endDate} >= to_char(wheat.rkrq,'yyyy-mm-dd') 
577
+	</if>
578
+  </select>
579
+  <!-- 按仓房、货位、品种分组,查询登统表导入总数量 -->
580
+  <select id="queryGroupSumRksl" resultType="java.util.Map" parameterType="java.util.Map">
581
+  	select 
582
+		b.storehouse_id ch,c.warehouse_id hwh,d.enumid enumid,sum(to_number(a.rksl)) rkzsl 
583
+	from record_soybean_info a 
584
+	left join basic_storehouse b on b.storehouse_name=a.cfmc and a.org_id=b.org_id and b.library_type = 0
585
+	left join basic_warehouse c on c.warehouse_name=a.hwmc and c.org_id=a.org_id and c.library_type = 0
586
+	left join basic_enum d on d.enumname=a.pzmc and d.parentid=1061
587
+	where 1=1 
588
+	<if test="orgId != null">
589
+	and a.org_id=#{orgId}
590
+	</if>
591
+	<if test="houseId != null">
592
+	and b.storehouse_id=#{houseId}
593
+	</if>
594
+	<if test="warehouseId != null">
595
+	and c.warehouse_id=#{warehouseId}
596
+	</if>
597
+	<if test="startDate != null">
598
+	and to_char(a.rkrq,'yyyy-mm-dd') >= #{startDate} 
599
+	</if>
600
+	<if test="endDate != null">
601
+	and #{endDate} >= to_char(a.rkrq,'yyyy-mm-dd') 
602
+	</if>
603
+	group by b.storehouse_id,c.warehouse_id,d.enumid
604
+  </select>
554 605
 </mapper>

+ 27 - 0
src/main/java/com/chinaitop/depot/registrationTable/mapper/RecordWheatInfoMapper.java

@@ -1,6 +1,8 @@
1 1
 package com.chinaitop.depot.registrationTable.mapper;
2 2
 
3 3
 import java.util.List;
4
+import java.util.Map;
5
+
4 6
 import org.apache.ibatis.annotations.Param;
5 7
 
6 8
 import com.chinaitop.depot.registrationTable.model.RecordWheatInfo;
@@ -20,4 +22,29 @@ public interface RecordWheatInfoMapper {
20 22
     int updateByExampleSelective(@Param("record") RecordWheatInfo record, @Param("example") RecordWheatInfoExample example);
21 23
 
22 24
     int updateByExample(@Param("record") RecordWheatInfo record, @Param("example") RecordWheatInfoExample example);
25
+
26
+    /**
27
+     * 查询小麦登统信息导入总数量
28
+     * 
29
+     * @param param
30
+     * @return
31
+     */
32
+	String countByConditions(Map<String, Object> param);
33
+
34
+	/**
35
+	 * 按仓房、货位、品种分组,查询登统表导入总数量
36
+	 * 
37
+	 * @param param
38
+	 * @return
39
+	 * @throws Exception
40
+	 */
41
+	List<Map<String, Object>> queryGroupSumRksl(Map<String, Object> param) throws Exception;
42
+	
43
+	/**
44
+     * 按单位、仓房、货位、品种,查询出入库期初库存数量
45
+     * 
46
+     * @param param
47
+     * @return
48
+     */
49
+	String queryCrkQckcSum(Map<String, Object> param)  throws Exception;
23 50
 }

+ 71 - 0
src/main/java/com/chinaitop/depot/registrationTable/mapper/RecordWheatInfoMapper.xml

@@ -428,4 +428,75 @@
428 428
       <include refid="Update_By_Example_Where_Clause" />
429 429
     </if>
430 430
   </update>
431
+  
432
+  <!-- 查询小麦登统信息导入总数量 -->
433
+  <select id="countByConditions" resultType="java.lang.String" parameterType="java.util.Map">
434
+  	select nvl(sum(to_number(wheat.rksl)),0) drzsl
435
+	from record_wheat_info wheat
436
+	left join basic_storehouse storehouse on storehouse.org_id = wheat.org_id and storehouse.del_flag = 1
437
+		 and storehouse.library_type = 0 and storehouse.storehouse_name = wheat.cfmc
438
+	left join basic_warehouse warehouse on warehouse.org_id = wheat.org_id and warehouse.del_flag = 1
439
+		 and warehouse.library_type = 0 and warehouse.warehouse_name = wheat.hwmc
440
+	WHERE 1=1
441
+	<if test="orgId != null">
442
+       	and wheat.org_id = #{orgId} 
443
+	</if>
444
+	<if test="houseId != null">
445
+       	and storehouse.storehouse_id = #{houseId} 
446
+	</if>  
447
+	<if test="warehouseId != null">
448
+       	and warehouse.warehouse_id = #{warehouseId} 
449
+	</if>  
450
+	<if test="startDate != null">
451
+       	and to_char(wheat.rkrq,'yyyy-mm-dd') >= #{startDate} 
452
+	</if>  
453
+	<if test="endDate != null">
454
+       	and #{endDate} >= to_char(wheat.rkrq,'yyyy-mm-dd') 
455
+	</if>
456
+  </select>
457
+  <!-- 按仓房、货位、品种分组,查询登统表导入总数量 -->
458
+  <select id="queryGroupSumRksl" resultType="java.util.Map" parameterType="java.util.Map">
459
+  	select 
460
+		b.storehouse_id ch,c.warehouse_id hwh,d.enumid enumid,sum(to_number(a.rksl)) rkzsl 
461
+	from record_wheat_info a 
462
+	left join basic_storehouse b on b.storehouse_name=a.cfmc and a.org_id=b.org_id and b.library_type = 0
463
+	left join basic_warehouse c on c.warehouse_name=a.hwmc and c.org_id=a.org_id and c.library_type = 0
464
+	left join basic_enum d on d.enumname=a.pzmc and d.parentid=1061
465
+	where 1=1 
466
+	<if test="orgId != null">
467
+	and a.org_id=#{orgId}
468
+	</if>
469
+	<if test="houseId != null">
470
+	and b.storehouse_id=#{houseId}
471
+	</if>  
472
+	<if test="warehouseId != null">
473
+	and c.warehouse_id=#{warehouseId}
474
+	</if>  
475
+	<if test="startDate != null">
476
+	and to_char(a.rkrq,'yyyy-mm-dd') >= #{startDate} 
477
+	</if>  
478
+	<if test="endDate != null">
479
+	and #{endDate} >= to_char(a.rkrq,'yyyy-mm-dd') 
480
+	</if>
481
+	group by b.storehouse_id,c.warehouse_id,d.enumid
482
+  </select>
483
+  <!-- 按单位、仓房、货位、品种,查询出入库期初库存数量 -->
484
+  <select id="queryCrkQckcSum" resultType="java.lang.String" parameterType="java.util.Map">
485
+  	select 
486
+		nvl(sum(kcsl),0) kcsl 
487
+	from lsreport_ts:data_kcgl_qckc_default 
488
+	where 1=1 
489
+	<if test="orgId != null">
490
+	and unitid=#{orgId}
491
+	</if>
492
+	<if test="houseId != null">
493
+	and ch=#{houseId}
494
+	</if>  
495
+	<if test="warehouseId != null">
496
+	and hwh=#{warehouseId}
497
+	</if>  
498
+	<if test="pz != null">
499
+	and pz=#{pz}
500
+	</if>  
501
+  </select>
431 502
 </mapper>

+ 27 - 0
src/main/java/com/chinaitop/depot/registrationTable/service/RegistrationTableService.java

@@ -1,6 +1,11 @@
1 1
 package com.chinaitop.depot.registrationTable.service;
2 2
 
3 3
 import java.util.List;
4
+import java.util.Map;
5
+
6
+import javax.servlet.http.HttpServletRequest;
7
+
8
+import com.github.pagehelper.PageInfo;
4 9
 
5 10
 public interface RegistrationTableService {
6 11
 
@@ -54,4 +59,26 @@ public interface RegistrationTableService {
54 59
 	 */
55 60
 	public String importDataCrudeOil(List<List<String>> list, String orgId, Integer beginRow);
56 61
 
62
+	/**
63
+	 * 查询登统表导入总数量
64
+	 * 
65
+	 * @param request
66
+	 * @param map 大豆原油对象
67
+	 * @param pzlx 品种类型
68
+	 * @return
69
+	 */
70
+	public String queryImportPzCount(HttpServletRequest request, String json, String pzlx);
71
+
72
+	/**
73
+	 * 查询单位下登统表导入数量跟期初库存数量 
74
+	 * 
75
+	 * @param request
76
+	 * @param pageSize 
77
+	 * @param pageNum 
78
+	 * @param json
79
+	 * @param pzlx
80
+	 * @return
81
+	 */
82
+	public PageInfo<Map<String, Object>> view(HttpServletRequest request, Integer pageNum, Integer pageSize, String json, String pzlx);
83
+
57 84
 }

+ 116 - 0
src/main/java/com/chinaitop/depot/registrationTable/service/impl/RegistrationTableServiceImpl.java

@@ -8,6 +8,7 @@ import java.util.Map;
8 8
 import java.util.UUID;
9 9
 
10 10
 import javax.annotation.Resource;
11
+import javax.servlet.http.HttpServletRequest;
11 12
 
12 13
 import org.apache.commons.lang.ObjectUtils;
13 14
 import org.springframework.stereotype.Service;
@@ -24,8 +25,11 @@ import com.chinaitop.depot.registrationTable.model.RecordRiceInfo;
24 25
 import com.chinaitop.depot.registrationTable.model.RecordSoybeanInfo;
25 26
 import com.chinaitop.depot.registrationTable.model.RecordWheatInfo;
26 27
 import com.chinaitop.depot.registrationTable.service.RegistrationTableService;
28
+import com.chinaitop.depot.registrationTable.util.RecordUtils;
27 29
 import com.chinaitop.depot.statisticalReport.mapper.StatisticalReportMapper;
28 30
 import com.chinaitop.depot.utils.ParameterUtil;
31
+import com.github.pagehelper.PageHelper;
32
+import com.github.pagehelper.PageInfo;
29 33
 
30 34
 @Service
31 35
 @SuppressWarnings("all")
@@ -1107,4 +1111,116 @@ public class RegistrationTableServiceImpl implements RegistrationTableService {
1107 1111
 		return msg;
1108 1112
 	}
1109 1113
 
1114
+	@Override
1115
+	public String queryImportPzCount(HttpServletRequest request, String json, String pzlx) {
1116
+
1117
+		Map<String, Object> param = objectToMap(request, json);
1118
+
1119
+		String drzsl = "0";
1120
+		if (RecordUtils.TYPE_ONE.equalsIgnoreCase(pzlx)) {
1121
+			drzsl = recordWheatInfoMapper.countByConditions(param);
1122
+		} else if (RecordUtils.TYPE_TWO.equalsIgnoreCase(pzlx)) {
1123
+			drzsl = recordCornInfoMapper.countByConditions(param);
1124
+		} else if (RecordUtils.TYPE_THREE.equalsIgnoreCase(pzlx)) {
1125
+			drzsl = recordSoybeanInfoMapper.countByConditions(param);
1126
+		} else if (RecordUtils.TYPE_FOUR.equalsIgnoreCase(pzlx)) {
1127
+			drzsl = recordRiceInfoMapper.countByConditions(param);
1128
+		} else if (RecordUtils.TYPE_FIVE.equalsIgnoreCase(pzlx)) {
1129
+			drzsl = recordCrudeoilInfoMapper.countByConditions(param);
1130
+		}
1131
+
1132
+		return drzsl;
1133
+	}
1134
+
1135
+	/**
1136
+	 * json解析封装
1137
+	 * 
1138
+	 * @param request
1139
+	 * @param json
1140
+	 * @return
1141
+	 */
1142
+	private Map<String, Object> objectToMap(HttpServletRequest request, String json) {
1143
+		JSONObject json_object = JSONObject.parseObject(json);
1144
+
1145
+		//参数对象
1146
+		Map<String, Object> param = new HashMap<String, Object>();
1147
+
1148
+		//仓房ID
1149
+		String houseId = ObjectUtils.toString(json_object.get("houseId"), "");
1150
+		if (!"".equals(houseId)) {
1151
+			param.put("houseId", Integer.parseInt(houseId));
1152
+		}
1153
+
1154
+		//货位ID
1155
+		String warehouseId = ObjectUtils.toString(json_object.get("warehouseId"), "");
1156
+		if (!"".equals(warehouseId)) {
1157
+			param.put("warehouseId", Integer.parseInt(warehouseId));
1158
+		}
1159
+
1160
+		//油罐ID
1161
+		String tankId = ObjectUtils.toString(json_object.get("tankId"), "");
1162
+		if (!"".equals(tankId)) {
1163
+			param.put("tankId", Integer.parseInt(tankId));
1164
+		}
1165
+
1166
+		//开始时间
1167
+		String startDate = ObjectUtils.toString(json_object.get("startDate"), "");
1168
+		if (!"".equals(startDate)) {
1169
+			param.put("startDate", startDate+" 00:00:00");
1170
+		}
1171
+
1172
+		//结束时间
1173
+		String endDate = ObjectUtils.toString(json_object.get("endDate"), "");
1174
+		if (!"".equals(endDate)) {
1175
+			param.put("endDate", endDate+" 23:59:59");
1176
+		}
1177
+
1178
+		//单位ID
1179
+		param.put("orgId", request.getSession().getAttribute("orgId"));
1180
+		return param;
1181
+	}
1182
+
1183
+	@Override
1184
+	public PageInfo<Map<String, Object>> view(HttpServletRequest request, Integer pageNum, Integer pageSize, String json, String pzlx) {
1185
+		Map<String, Object> param = objectToMap(request, json);
1186
+
1187
+		PageInfo<Map<String, Object>> pageInfo = null;
1188
+		List<Map<String, Object>> list = null;
1189
+		Map<String, Object> params = null;
1190
+		Map<String, Object> resultobj = null;
1191
+		try {
1192
+			if(null != pageNum && null != pageSize){
1193
+				PageHelper.startPage(pageNum, pageSize);
1194
+			}
1195
+			if (RecordUtils.TYPE_ONE.equals(pzlx)) {
1196
+				list = recordWheatInfoMapper.queryGroupSumRksl(param);
1197
+			} else if (RecordUtils.TYPE_TWO.equals(pzlx)) {
1198
+				list = recordCornInfoMapper.queryGroupSumRksl(param);
1199
+			} else if (RecordUtils.TYPE_THREE.equals(pzlx)) {
1200
+				list = recordSoybeanInfoMapper.queryGroupSumRksl(param);
1201
+			} else if (RecordUtils.TYPE_FOUR.equals(pzlx)) {
1202
+				list = recordRiceInfoMapper.queryGroupSumRksl(param);
1203
+			} else if (RecordUtils.TYPE_FIVE.equals(pzlx)) {
1204
+				list = recordCrudeoilInfoMapper.queryGroupSumRksl(param);
1205
+			}
1206
+			pageInfo = new PageInfo<Map<String, Object>>(list);
1207
+			if (null != pageInfo && pageInfo.getList().size() > 0) {
1208
+				String kcsl = "0";
1209
+				for (int i = 0; i < pageInfo.getList().size(); i++) {
1210
+					resultobj = pageInfo.getList().get(i);
1211
+					params = new HashMap<String, Object>();
1212
+					params.put("houseId", ObjectUtils.toString(resultobj.get("ch"), ""));
1213
+					params.put("warehouseId", ObjectUtils.toString(resultobj.get("hwh"), ""));
1214
+					params.put("pz", ObjectUtils.toString(resultobj.get("enumid"), ""));
1215
+					params.put("orgId", ObjectUtils.toString(param.get("orgId"), ""));
1216
+					kcsl = recordWheatInfoMapper.queryCrkQckcSum(params);
1217
+					resultobj.put("kcsl", kcsl);
1218
+				}
1219
+			}
1220
+		} catch (Exception e) {
1221
+			e.printStackTrace();
1222
+		}
1223
+		return pageInfo;
1224
+	}
1225
+
1110 1226
 }

+ 19 - 0
src/main/java/com/chinaitop/depot/registrationTable/util/RecordUtils.java

@@ -0,0 +1,19 @@
1
+package com.chinaitop.depot.registrationTable.util;
2
+
3
+public class RecordUtils {
4
+
5
+	//小麦
6
+	public final static String TYPE_ONE = "1";
7
+
8
+	//玉米
9
+	public final static String TYPE_TWO = "2";
10
+
11
+	//大豆
12
+	public final static String TYPE_THREE = "3";
13
+
14
+	//稻谷
15
+	public final static String TYPE_FOUR = "4";
16
+
17
+	//大豆原油
18
+	public final static String TYPE_FIVE = "5";
19
+}