diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java index 90c37a07..d0594701 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java @@ -81,9 +81,9 @@ public class BackReceiveServiceImpl implements BackReceiveService { } } } - List resultList = new ArrayList<>(); if (CollectionUtils.isNotEmpty(backApplyInfos)) { for (BackApplyInfo backApplyInfo : backApplyInfos) { + List resultList = new ArrayList<>(); BackApplyInfo info = new BackApplyInfo(); info.setId(backApplyInfo.getId()); List allApplyInfos = backReceiveMapper.receiveView(info); diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/StorageStatusController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/StorageStatusController.java index 21e4dd0b..c3f3e8c4 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/StorageStatusController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/StorageStatusController.java @@ -84,13 +84,13 @@ public class StorageStatusController extends BaseController { Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); // 首先根据typeId查询managerType,区分编码和数量设备 - List list = new ArrayList<>(); - String managerType = storageStatusMapper.getMaType(bean.getTypeId()); + List list = storageStatusMapper.getUserRecords(bean); + /*String managerType = storageStatusMapper.getMaType(bean.getTypeId()); if ("0".equals(managerType)) { list = storageStatusMapper.getUserRecords(bean); } else { list = storageStatusMapper.getUserRecordsNum(bean); - } + }*/ // 针对于预报废驳回数据,进行数据追加,待定 return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/StorageStatusMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/StorageStatusMapper.xml index d23cb814..ec7cb44a 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/StorageStatusMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/StorageStatusMapper.xml @@ -50,64 +50,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) AS subquery0 ON subquery0.type_id = mt.type_id LEFT JOIN ( SELECT - subquery1.type_id, - subquery1.typeName, - subquery1.typeModelName, - IFNULL( subquery1.outNum, 0 ) AS outNum, - IFNULL( subquery2.backNum, 0 ) AS backNum, - CASE - - WHEN IFNULL( subquery1.outNum, 0 ) - IFNULL( subquery2.backNum, 0 ) > 0 THEN - IFNULL( subquery1.outNum, 0 ) - IFNULL( subquery2.backNum, 0 ) ELSE 0 - END AS usNum - FROM - ( - SELECT mt.type_id, mt2.type_name AS typeName, mt.type_name AS typeModelName, - SUM( - IFNULL( lod.out_num, 0 )) AS outNum + SUM(IFNULL( sai.num, 0 )) AS usNum FROM - lease_out_details lod - LEFT JOIN ma_type mt ON mt.type_id = lod.type_id + slt_agreement_info sai + LEFT JOIN ma_type mt ON mt.type_id = sai.type_id LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id - GROUP BY - mt.type_id - ) AS subquery1 - LEFT JOIN ( - SELECT - mt.type_id, - mt2.type_name AS typeName, - mt.type_name AS typeModelName, - SUM( - IFNULL( bcd.back_num, 0 )) backNum - FROM - back_check_details bcd - LEFT JOIN ma_type mt ON mt.type_id = bcd.type_id - LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id - LEFT JOIN ma_machine mm ON mm.ma_id = bcd.ma_id - LEFT JOIN back_apply_info ba ON bcd.parent_id = ba.id - -- WHERE bcd.is_finished IS NOT NULL and bcd.is_finished = '1' - GROUP BY - mt.type_id - ) AS subquery2 ON subquery1.type_id = subquery2.type_id - /*LEFT JOIN ( - SELECT - mt.type_id, - mt2.type_name AS typeName, - mt.type_name AS typeModelName, - SUM( - IFNULL( bcd.pre_num, 0 )) backNum - FROM - back_apply_details bcd - LEFT JOIN ma_type mt ON mt.type_id = bcd.type_id - LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id - LEFT JOIN back_apply_info ba ON bcd.parent_id = ba.id - WHERE ba.back_source = '1' - GROUP BY - mt.type_id - ) AS subquery3 ON subquery3.type_id = subquery2.type_id*/ + LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id + LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id + WHERE + sai.`status` = '0' + AND sai.end_time IS NULL + AND sai.back_id IS NULL + GROUP BY mt.type_id ) AS subquery1 ON mt.type_id = subquery1.type_id LEFT JOIN ( SELECT @@ -205,58 +162,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"