From 30cf876baed7d389462c06e995ec28f0ce7e27de Mon Sep 17 00:00:00 2001 From: mashuai Date: Wed, 26 Feb 2025 12:54:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/controller/BackReceiveController.java | 2 +- .../service/impl/BackReceiveServiceImpl.java | 22 +++++++++++++++++-- .../mapper/app/BackReceiveMapper.xml | 6 +++-- .../mapper/app/LeaseApplyDetailsMapper.xml | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java index c334c68..c9d54e4 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java @@ -64,7 +64,7 @@ public class BackReceiveController extends BaseController { * @return */ @Log(title = "退料接收明细", businessType = BusinessType.QUERY) - @GetMapping("getDetailsReceiveList") + @GetMapping("/getDetailsReceiveList") public AjaxResult getDetailsReceiveList(BackApplyInfo record) { return backReceiveService.getDetailsReceiveList(record); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java index bc94cbb..34f7ae9 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java @@ -17,9 +17,10 @@ import com.bonus.sgzb.common.core.enums.TaskTypeEnum; import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.core.utils.HttpHelper; import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.material.domain.TypeTreeNode; +import com.bonus.sgzb.material.mapper.BackApplyMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -50,6 +51,9 @@ public class BackReceiveServiceImpl implements BackReceiveService { @Resource private TmTaskMapper tmTaskMapper; + @Autowired + private BackApplyMapper backApplyMapper; + @Override @@ -506,12 +510,26 @@ public class BackReceiveServiceImpl implements BackReceiveService { public AjaxResult getDetailsReceiveList(BackApplyInfo record) { BackApplyInfo backApplyInfo = new BackApplyInfo(); List backApplyInfos = backReceiveMapper.getbackReceiveList(record); + List useTypeTree = new ArrayList<>(); if (!CollectionUtils.isEmpty(backApplyInfos)) { + backApplyInfos.get(0).setProjectId(Long.valueOf(backApplyInfos.get(0).getLotId())); backApplyInfo.setBackApplyInfo(backApplyInfos.get(0)); record.setId(backApplyInfos.get(0).getId()); + record.setAgreementId(backApplyInfos.get(0).getAgreementId()); + useTypeTree = backApplyMapper.getUseTypeTreeL4(record); + } List backApplyInfoList = receiveView(record); - if (!CollectionUtils.isEmpty(backApplyInfoList)) { + if (!CollectionUtils.isEmpty(backApplyInfoList) && !CollectionUtils.isEmpty(useTypeTree)) { + for (TypeTreeNode typeTreeNode : useTypeTree) { + for (BackApplyInfo applyInfo : backApplyInfoList) { + if (String.valueOf(typeTreeNode.getTypeId()).equals(applyInfo.getModelId())) { + applyInfo.setUnitNames(typeTreeNode.getUnitNames()); + applyInfo.setTypeId(String.valueOf(typeTreeNode.getTypeId())); + applyInfo.setUseNum(typeTreeNode.getNum()); + } + } + } backApplyInfo.setBackApplyDetails(backApplyInfoList); } return AjaxResult.success(backApplyInfo); diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml index 62c2be7..c88e1c3 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml @@ -615,7 +615,8 @@ tta.agreement_id AS agreementId, GROUP_CONCAT( DISTINCT mt2.type_id ) AS typeId, GROUP_CONCAT(bad.id) as badId, - GROUP_CONCAT( mt2.type_name, '' ) AS typeName + GROUP_CONCAT( mt2.type_name, '' ) AS typeName, + bai.remark AS remark FROM back_apply_info bai LEFT JOIN back_apply_details bad ON bad.parent_id = bai.id @@ -693,7 +694,8 @@ IFNULL(bb.finished_back_num, 0) as finished_back_num, mt.manage_type as manageType, mtk.user_id, - CONCAT('NSJJ',mt.`code`,mt.model_code) as `code` + CONCAT('NSJJ',mt.`code`,mt.model_code) as `code`, + bad.remark as remark FROM back_apply_details bad LEFT JOIN back_apply_info bai on bai.id=bad.parent_id diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml index 4efbb2a..7207223 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml @@ -592,7 +592,7 @@ LEFT join lease_apply_info lai on lai.id = lad.parennt_id LEFT join tm_task tt on lai.task_id = tt.task_id LEFT join tm_task_agreement tta on tta.task_id = tt.task_id - where tta.agreement_id = #{agreementId} + where tta.agreement_id = #{agreementId} and lad.`status` = '2' group by lad.type_id \ No newline at end of file