|
|
@@ -20,19 +20,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
20
|
20
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
21
|
21
|
import org.springframework.web.bind.annotation.RestController;
|
|
22
|
22
|
|
|
23
|
|
-import com.alibaba.fastjson.JSON;
|
|
24
|
23
|
import com.alibaba.fastjson.JSONArray;
|
|
25
|
24
|
import com.chinaitop.depot.storage.model.StorageFoodbasicinfo;
|
|
26
|
25
|
import com.chinaitop.depot.storage.model.StorageQualitycheck;
|
|
27
|
|
-import com.chinaitop.depot.storage.model.StorageQualitycheckExample;
|
|
28
|
|
-import com.chinaitop.depot.storage.model.StorageQualitycheckExample.Criteria;
|
|
29
|
26
|
import com.chinaitop.depot.storage.model.StorageQualitycheckInspectionExample;
|
|
30
|
27
|
import com.chinaitop.depot.storage.model.StorageQualitycheckSonExample;
|
|
31
|
28
|
import com.chinaitop.depot.storage.service.StorageQualitycheckService;
|
|
32
|
29
|
import com.chinaitop.depot.storage.service.StorageQualitycheckSonService;
|
|
33
|
30
|
import com.chinaitop.depot.storage.utils.DataSynchronization;
|
|
34
|
31
|
import com.chinaitop.depot.storage.utils.ParameterUtil;
|
|
35
|
|
-import com.chinaitop.depot.utils.HttpUtil;
|
|
36
|
32
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
37
|
33
|
import com.github.pagehelper.PageHelper;
|
|
38
|
34
|
import com.github.pagehelper.PageInfo;
|
|
|
@@ -634,43 +630,19 @@ public class StorageQualitycheckController {
|
|
634
|
630
|
})
|
|
635
|
631
|
public PageInfo<StorageQualitycheck> newListPage(Integer pageNum, Integer pageSize, Integer houseId, Integer wareId,
|
|
636
|
632
|
String checkType, String checkResult, Integer historyStatus, Integer orgId) {
|
|
637
|
|
- StorageQualitycheckExample example = new StorageQualitycheckExample();
|
|
638
|
|
- Criteria criteria = example.createCriteria();
|
|
639
|
633
|
|
|
640
|
|
- //根据后台传来的参数进行查找相应类型的类别0:初检 1:验收 2:质量普查 3:出库
|
|
641
|
|
- if (StringUtils.isNotBlank(checkType)){
|
|
642
|
|
- //criteria.andTypeEqualTo(checkType);
|
|
643
|
|
- criteria.andCheckTypeEqualTo(checkType);
|
|
644
|
|
- }
|
|
645
|
|
- // 仓房id.
|
|
646
|
|
- if (houseId != null) {
|
|
647
|
|
- criteria.andHouseIdEqualTo(houseId);
|
|
648
|
|
- }
|
|
649
|
|
- // 货位id.
|
|
650
|
|
- if (wareId != null) {
|
|
651
|
|
- criteria.andWarehouseIdEqualTo(wareId);
|
|
652
|
|
- }
|
|
653
|
|
- // 粮库id.
|
|
654
|
|
- if (orgId != null) {
|
|
655
|
|
- criteria.andOrgIdEqualTo(orgId);
|
|
656
|
|
- }
|
|
657
|
|
-
|
|
658
|
|
- //检验结果(0:合格 , 1 :不合格)
|
|
659
|
|
- if (StringUtils.isNotBlank(checkResult)) {
|
|
660
|
|
- criteria.andCheckResultEqualTo(checkResult);
|
|
661
|
|
- }
|
|
662
|
|
- //数据状态
|
|
663
|
|
- if (null != historyStatus) {
|
|
664
|
|
- //0:最新数据 1:历史数据
|
|
665
|
|
- criteria.andHistoryStatusEqualTo(historyStatus);
|
|
666
|
|
- }
|
|
667
|
|
-
|
|
668
|
|
- if (pageNum!=null && pageSize!=null) {
|
|
669
|
|
- PageHelper.startPage(pageNum, pageSize);
|
|
670
|
|
- }
|
|
671
|
|
- List<StorageQualitycheck> list = storageQualitycheckService.findByCondition(example);
|
|
|
634
|
+ List<StorageQualitycheck> list = null;
|
|
|
635
|
+ PageInfo<StorageQualitycheck> pageInfo = null;
|
|
|
636
|
+ try {
|
|
|
637
|
+ if (pageNum!=null && pageSize!=null) {
|
|
|
638
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
|
639
|
+ }
|
|
|
640
|
+ list = storageQualitycheckService.getList(houseId, wareId, checkType, checkResult, historyStatus, orgId);
|
|
|
641
|
+ pageInfo = new PageInfo<StorageQualitycheck>(list);
|
|
|
642
|
+ } catch (Exception e) {
|
|
|
643
|
+ e.printStackTrace();
|
|
|
644
|
+ }
|
|
672
|
645
|
|
|
673
|
|
- PageInfo<StorageQualitycheck> pageInfo = new PageInfo<StorageQualitycheck>(list);
|
|
674
|
646
|
return pageInfo;
|
|
675
|
647
|
}
|
|
676
|
648
|
|
|
|
@@ -832,6 +804,26 @@ public class StorageQualitycheckController {
|
|
832
|
804
|
}
|
|
833
|
805
|
return modelMap;
|
|
834
|
806
|
}
|
|
835
|
|
-
|
|
836
|
807
|
|
|
|
808
|
+ @RequestMapping(value="/queryCheckDataDetail", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
|
|
|
809
|
+ @ApiOperation(value="根据条件查找一条质检数据详情", notes = "")
|
|
|
810
|
+ @ApiImplicitParams({
|
|
|
811
|
+ @ApiImplicitParam(name = "houseId", value = "仓房ID", paramType = "query"),
|
|
|
812
|
+ @ApiImplicitParam(name = "wareId", value = "货位ID", paramType = "query"),
|
|
|
813
|
+ @ApiImplicitParam(name = "checkType", value = "检验类型(0:自检,3:出库检验,4:春秋普查,5:第三方检查)", paramType = "query"),
|
|
|
814
|
+ @ApiImplicitParam(name = "historyStatus", value = "数据状态(0:新数据,1:已归档数据)", paramType = "query"),
|
|
|
815
|
+ @ApiImplicitParam(name = "orgId", value = "组织机构ID", paramType = "query")
|
|
|
816
|
+ })
|
|
|
817
|
+ public Map<String, Object> queryCheckDataDetail(Integer houseId, Integer wareId, String checkType,
|
|
|
818
|
+ Integer historyStatus, Integer orgId){
|
|
|
819
|
+
|
|
|
820
|
+ Map<String, Object> retMap = null;
|
|
|
821
|
+ try {
|
|
|
822
|
+ retMap = storageQualitycheckService.queryCheckDataDetail(houseId, wareId, checkType, historyStatus, orgId);
|
|
|
823
|
+ } catch (Exception e) {
|
|
|
824
|
+ e.printStackTrace();
|
|
|
825
|
+ }
|
|
|
826
|
+
|
|
|
827
|
+ return retMap;
|
|
|
828
|
+ }
|
|
837
|
829
|
}
|