fanxw 2 년 전
부모
커밋
9996b74105

+ 8 - 6
src/main/java/com/chinaitop/depot/storage/controller/StorageQualitycheckController.java

@@ -626,10 +626,11 @@ public class StorageQualitycheckController {
626 626
             @ApiImplicitParam(name = "checktype", value = "检查的类型", paramType = "query"),
627 627
             @ApiImplicitParam(name = "checkResult", value = "检查结果", paramType = "query"),
628 628
             @ApiImplicitParam(name = "historyStatus", value = "数据状态", paramType = "query"),
629
-            @ApiImplicitParam(name = "orgId", value = "单位ID", paramType = "query")
629
+            @ApiImplicitParam(name = "orgId", value = "单位ID", paramType = "query"),
630
+            @ApiImplicitParam(name = "processState", value = "1扦样化验待处理 2化验已处理", paramType = "query")
630 631
     })
631 632
     public PageInfo<StorageQualitycheck> newListPage(Integer pageNum, Integer pageSize, Integer houseId, Integer wareId,
632
-                                                  String checkType, String checkResult, Integer historyStatus, Integer orgId) {
633
+                                                  String checkType, String checkResult, Integer historyStatus, Integer orgId, Integer processState) {
633 634
 
634 635
         List<StorageQualitycheck> list = null;
635 636
         PageInfo<StorageQualitycheck> pageInfo = null;
@@ -637,7 +638,7 @@ public class StorageQualitycheckController {
637 638
         	if (pageNum!=null && pageSize!=null) {
638 639
         		PageHelper.startPage(pageNum, pageSize);
639 640
         	}
640
-			list = storageQualitycheckService.getList(houseId, wareId, checkType, checkResult, historyStatus, orgId);
641
+			list = storageQualitycheckService.getList(houseId, wareId, checkType, checkResult, historyStatus, orgId, processState);
641 642
 			pageInfo = new PageInfo<StorageQualitycheck>(list);
642 643
 		} catch (Exception e) {
643 644
 			e.printStackTrace();
@@ -812,14 +813,15 @@ public class StorageQualitycheckController {
812 813
             @ApiImplicitParam(name = "wareId", value = "货位ID", paramType = "query"),
813 814
             @ApiImplicitParam(name = "checkType", value = "检验类型(0:自检,3:出库检验,4:春秋普查,5:第三方检查)", paramType = "query"),
814 815
             @ApiImplicitParam(name = "historyStatus", value = "数据状态(0:新数据,1:已归档数据)", paramType = "query"),
815
-            @ApiImplicitParam(name = "orgId", value = "组织机构ID", paramType = "query")
816
+            @ApiImplicitParam(name = "orgId", value = "组织机构ID", paramType = "query"),
817
+            @ApiImplicitParam(name = "processState", value = "1扦样化验待处理 2化验已处理", paramType = "query")
816 818
     })
817 819
     public  Map<String, Object> queryCheckDataDetail(Integer houseId, Integer wareId, String checkType, 
818
-			Integer historyStatus, Integer orgId){
820
+			Integer historyStatus, Integer orgId, Integer processState){
819 821
 
820 822
     	Map<String, Object> retMap = null;
821 823
     	try {
822
-			retMap = storageQualitycheckService.queryCheckDataDetail(houseId, wareId, checkType, historyStatus, orgId);
824
+			retMap = storageQualitycheckService.queryCheckDataDetail(houseId, wareId, checkType, historyStatus, orgId, processState);
823 825
 		} catch (Exception e) {
824 826
 			e.printStackTrace();
825 827
 		}

+ 8 - 9
src/main/java/com/chinaitop/depot/storage/mapper/StorageQualitycheckMapper.xml

@@ -1873,15 +1873,14 @@
1873 1873
 
1874 1874
   <select id="queryByExample" parameterType="com.chinaitop.depot.storage.model.StorageQualitycheck" resultMap="BaseResultMap">
1875 1875
     select * from(
1876
-    select
1877
-    row_number() over(partition by sqk.id order by sqk.id desc) rn,
1878
-    <include refid="ExtBase_Column_List" />,
1879
-    bs.storeHouse_name storehouseName,
1880
-    bw.warehouse_name wareHouseName
1881
-    from
1882
-    storage_qualitycheck sqk
1883
-    left join basic_storehouse bs on bs.storehouse_id = sqk.house_id
1884
-    left join basic_warehouse bw on bw.warehouse_id = sqk.warehouse_id
1876
+      select
1877
+        row_number() over(partition by sqk.id order by sqk.id desc) rn,
1878
+        <include refid="ExtBase_Column_List" />,
1879
+        bs.storeHouse_name storehouseName,
1880
+        bw.warehouse_name wareHouseName
1881
+      from storage_qualitycheck sqk
1882
+      left join basic_storehouse bs on bs.storehouse_id = sqk.house_id
1883
+      left join basic_warehouse bw on bw.warehouse_id = sqk.warehouse_id
1885 1884
     ) sq
1886 1885
     <where>
1887 1886
       <if test="houseId !=null">

+ 10 - 0
src/main/java/com/chinaitop/depot/storage/model/StorageQualitycheckExample.java

@@ -3037,6 +3037,16 @@ public class StorageQualitycheckExample {
3037 3037
             return (Criteria) this;
3038 3038
         }
3039 3039
 
3040
+        public Criteria andTypeUpdateEqualTo(String value) {
3041
+        	addCriterion("type_update =", value, "typeUpdate");
3042
+            return (Criteria) this;
3043
+        }
3044
+
3045
+        public Criteria andProcessStateEqualTo(Integer value) {
3046
+        	addCriterion("process_state =", value, "processState");
3047
+            return (Criteria) this;
3048
+        }
3049
+
3040 3050
         public Criteria andCheckTypeIsNull() {
3041 3051
             addCriterion("check_type is null");
3042 3052
             return (Criteria) this;

+ 4 - 2
src/main/java/com/chinaitop/depot/storage/service/StorageQualitycheckService.java

@@ -152,11 +152,12 @@ public interface StorageQualitycheckService {
152 152
 	 * @param checkType 检验类型(0:自检,3:出库检验,4:春秋普查,5:第三方检查)
153 153
 	 * @param historyStatus 数据状态(0:新数据,1:已归档数据)
154 154
 	 * @param orgId 组织机构ID
155
+	 * @param processState 1扦样化验待处理 2化验已处理
155 156
 	 * @return
156 157
 	 * @throws Exception
157 158
 	 */
158 159
 	List<StorageQualitycheck> getList(Integer houseId, Integer wareId, String checkType, String checkResult,
159
-			Integer historyStatus, Integer orgId) throws Exception;
160
+			Integer historyStatus, Integer orgId, Integer processState) throws Exception;
160 161
 
161 162
 	/**
162 163
 	 * 按条件查询质检数据详情
@@ -165,9 +166,10 @@ public interface StorageQualitycheckService {
165 166
 	 * @param checkType 检验类型(0:自检,3:出库检验,4:春秋普查,5:第三方检查)
166 167
 	 * @param historyStatus 数据状态(0:新数据,1:已归档数据)
167 168
 	 * @param orgId 组织机构ID
169
+	 * @param processState 1扦样化验待处理 2化验已处理
168 170
 	 * @return
169 171
 	 * @throws Exception 
170 172
 	 */
171 173
 	Map<String, Object> queryCheckDataDetail(Integer houseId, Integer wareId, String checkType, 
172
-			Integer historyStatus, Integer orgId) throws Exception;
174
+			Integer historyStatus, Integer orgId, Integer processState) throws Exception;
173 175
 }

+ 14 - 8
src/main/java/com/chinaitop/depot/storage/service/impl/StorageQualitycheckServiceImpl.java

@@ -429,14 +429,13 @@ public class StorageQualitycheckServiceImpl implements StorageQualitycheckServic
429 429
 
430 430
 	@Override
431 431
 	public List<StorageQualitycheck> getList(Integer houseId, Integer wareId, String checkType, String checkResult,
432
-			Integer historyStatus, Integer orgId) throws Exception {
432
+			Integer historyStatus, Integer orgId, Integer processState) throws Exception {
433 433
 		StorageQualitycheckExample example = new StorageQualitycheckExample();
434 434
     	Criteria criteria = example.createCriteria();
435 435
 
436
-        //根据后台传来的参数进行查找相应类型的类别0:初检 1:验收 2:质量普查 3:出库
436
+    	//0:初检 1:验收 2:质量普查 3:出库,5:第三方检验
437 437
         if (StringUtils.isNotBlank(checkType)){
438
-        	//criteria.andTypeEqualTo(checkType);
439
-        	criteria.andCheckTypeEqualTo(checkType);
438
+        	criteria.andTypeUpdateEqualTo(checkType);
440 439
         }
441 440
         // 仓房id.
442 441
         if (houseId != null) {
@@ -451,15 +450,22 @@ public class StorageQualitycheckServiceImpl implements StorageQualitycheckServic
451 450
         	criteria.andOrgIdEqualTo(orgId);
452 451
         }
453 452
 
453
+        //1扦样化验待处理 2化验已处理
454
+        if (null != processState) {
455
+        	criteria.andProcessStateEqualTo(processState);
456
+        }
457
+
454 458
         //检验结果(0:合格 , 1 :不合格)
455 459
         if (StringUtils.isNotBlank(checkResult)) {
456 460
         	criteria.andCheckResultEqualTo(checkResult);
457 461
         }
458
-        //数据状态
462
+        //数据状态(0:最新数据  1:历史数据)
459 463
         if (null != historyStatus) {
460
-        	//0:最新数据  1:历史数据
461 464
         	criteria.andHistoryStatusEqualTo(historyStatus);
462 465
         }
466
+        //查询从质量管理功能里面添加到数据库的数据
467
+        criteria.andFlagTypeIsNull();
468
+
463 469
         List<StorageQualitycheck> list = qualitycheckMapper.selectByExample(example);
464 470
 
465 471
 		return list;
@@ -467,8 +473,8 @@ public class StorageQualitycheckServiceImpl implements StorageQualitycheckServic
467 473
 
468 474
 	@Override
469 475
 	public Map<String, Object> queryCheckDataDetail(Integer houseId, Integer wareId, String checkType,
470
-			Integer historyStatus, Integer orgId) throws Exception {
471
-		List<StorageQualitycheck> list = getList(houseId, wareId, checkType, null, historyStatus, orgId);
476
+			Integer historyStatus, Integer orgId, Integer processState) throws Exception {
477
+		List<StorageQualitycheck> list = getList(houseId, wareId, checkType, null, historyStatus, orgId, processState);
472 478
 		Map<String, Object> retMap = null;
473 479
 		if (null != list && list.size() > 0) {
474 480
 			Integer id = list.get(0).getId();