From 0d53867d46086a7cabc22a3d643d7a286b707039 Mon Sep 17 00:00:00 2001 From: mashuai Date: Thu, 6 Mar 2025 14:37:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E5=87=BA=E5=BA=93=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/LeaseApplyInfoServiceImpl.java | 13 +++++++++++-- .../service/impl/LeaseOutDetailsServiceImpl.java | 8 ++++++-- .../material/task/mapper/TmTaskAgreementMapper.java | 7 +++++++ .../mapper/material/back/BackApplyInfoMapper.xml | 5 ++--- .../material/lease/LeaseApplyDetailsMapper.xml | 3 ++- .../mapper/material/lease/LeaseApplyInfoMapper.xml | 4 ---- .../mapper/material/task/TmTaskAgreementMapper.xml | 8 ++++++++ 7 files changed, 36 insertions(+), 12 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java index e9cf8e72..6b69e5e9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java @@ -133,9 +133,9 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { if (!CollectionUtils.isEmpty(details)) { for (LeaseApplyDetails detail : details) { if (detail.getOutNum().compareTo(detail.getAlNum()) == 0) { - detail.setStatus("1"); + detail.setStatus("2"); } else { - detail.setStatus("0"); + detail.setStatus("1"); } } info.setLeaseApplyDetailsList(details); @@ -168,6 +168,15 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { // 查询领用出库数据 List leaseApplyOutList = leaseApplyInfoMapper.selectPublishList(leaseApplyInfo); if (!CollectionUtils.isEmpty(leaseApplyOutList)) { + for (LeaseApplyInfo applyInfo : leaseApplyOutList) { + if (applyInfo.getPreCountNum().compareTo(applyInfo.getAlNum()) == 0) { + applyInfo.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus()); + applyInfo.setTaskStatusName(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatusName()); + } else { + applyInfo.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus()); + applyInfo.setTaskStatusName(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatusName()); + } + } list.addAll(leaseApplyOutList); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java index 09ff3a82..eee7a1d8 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java @@ -354,7 +354,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService { List details = leaseApplyDetailsMapper.getDetailsPublish(record.getPublishTask()); if (!CollectionUtils.isEmpty(details)) { for (LeaseApplyDetails bean : details) { - if (bean.getAlNum().compareTo(bean.getNum()) != 0) { + if (bean.getAlNum().compareTo(bean.getPreNum()) != 0) { isFinished = false; break; } @@ -443,7 +443,11 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService { sltAgreementInfo.setNum(num.add(outNum)); res = sltAgreementInfoMapper.updSltInfo(sltAgreementInfo); } else { - String agreementId = tmTaskAgreementMapper.getAgreementId(taskId); + String agreementId = " "; + agreementId = tmTaskAgreementMapper.getAgreementId(taskId); + if (StringUtils.isBlank(agreementId)) { + agreementId = tmTaskAgreementMapper.selectAgreementId(record.getPublishTask()); + } String protocol = bmAgreementInfoMapper.getProtocol(agreementId); Type maType = typeMapper.getMaType(record.getTypeId()); if (StringUtils.isEmpty(protocol)) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java index 6158bbb5..c43ba6fc 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java @@ -71,4 +71,11 @@ public interface TmTaskAgreementMapper { * @return */ Long selectAgreementIdByTaskId(Long taskId); + + /** + * 根据发布任务ID获取协议ID + * @param publishTask + * @return + */ + String selectAgreementId(String publishTask); } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml index 5bbe05b2..0c758b71 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml @@ -113,9 +113,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND mt1.del_flag = '0' LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id AND mt2.del_flag = '0' - LEFT JOIN lease_apply_info lai ON lod.parent_id = lai.id - LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id - LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id + LEFT JOIN slt_agreement_info sai on lod.type_id = sai.type_id + LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id WHERE 1 = 1 and mm.ma_status = '2' and mm.type_id = #{typeId} AND ba.unit_id = #{unitId} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml index 6c477b35..9127dd77 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml @@ -422,7 +422,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mt.type_name AS typeName, mt.unit_name AS unitName, lpd.new_type AS typeId, - IFNULL( lpd.num, 0 ) AS outNum, + IFNULL( lpd.num, 0 ) AS preNum, + IFNULL( lpd.num, 0 ) - IFNULL( SUM( lod.out_num ), 0 ) AS outNum, IFNULL( SUM( lod.out_num ), 0 ) AS alNum, lpd.publish_task AS publishTask FROM diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml index b416c282..7699ca89 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml @@ -263,8 +263,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bu.unit_name AS leaseUnit, bp.pro_name AS leaseProject, bai.agreement_code AS agreementCode, - tt.task_status AS taskStatus, - sda.dict_label AS taskStatusName, IFNULL( sum( lpd.num ), 0 ) AS preCountNum, IFNULL( sum( lod.out_num ), 0 ) AS alNum, GROUP_CONCAT( mt1.type_name ) AS maTypeNames, @@ -278,8 +276,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_unit bu ON bu.unit_id = lpd.unit_id LEFT JOIN bm_project bp ON bp.pro_id = lpd.project_id LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit - LEFT JOIN sys_dict_data sda ON tt.task_status = sda.dict_value - AND sda.dict_type = 'lease_task_status' LEFT JOIN ma_type mt ON lpd.new_type = mt.type_id AND mt.del_flag = '0' LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskAgreementMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskAgreementMapper.xml index d5777b67..1357a930 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskAgreementMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskAgreementMapper.xml @@ -104,4 +104,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + \ No newline at end of file