From e013adb90ec4df028321ff909004be69073af7ce Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Tue, 25 Mar 2025 16:41:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E7=AE=A1=E7=90=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/api/domain/SltAgreementInfo.java | 5 ++++ .../service/impl/BackApplyServiceImpl.java | 24 +++++++++++++++++++ .../mapper/app/BackReceiveMapper.xml | 4 ++-- .../mapper/app/LeaseOutDetailsMapper.xml | 2 +- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementInfo.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementInfo.java index a00b444..d97c6f5 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementInfo.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementInfo.java @@ -28,6 +28,11 @@ public class SltAgreementInfo { * 协议id */ private String agreementId; + + private List agreementIds; + /** + * 项目id + */ /** * 编码 */ diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java index 8c9b22b..93df114 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java @@ -570,6 +570,13 @@ public class BackApplyServiceImpl implements BackApplyService { return AjaxResult.error("退料数不能超过在用数"); } } + String backTime = null; + if(bean.getBackApplyInfo().getBackTime()!=null){ + backTime = bean.getBackApplyInfo().getBackTime(); + + } else { + backTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + } BackApplyInfo backApplyInfo = bean.getBackApplyInfo(); try { int result = 0; @@ -645,6 +652,7 @@ public class BackApplyServiceImpl implements BackApplyService { // 根据任务详情往back_check_details插入数据 // 退料合格数据处理 if ("1".equals(leaseApplyDetails.getManageType()) && leaseApplyDetails.getPassNum() > 0) { + leaseApplyDetails.setEndTime(backTime); AjaxResult error = getHgAjaxResult(bean, taskId, leaseApplyDetails); if (error != null) { return error; @@ -652,6 +660,7 @@ public class BackApplyServiceImpl implements BackApplyService { } // 维修数据处理 if ("1".equals(leaseApplyDetails.getManageType()) && leaseApplyDetails.getMaintenanceNum() > 0) { + leaseApplyDetails.setEndTime(backTime); AjaxResult error = getWxAjaxResult(bean, backApplyInfoId, leaseApplyDetails); if (error != null) { return error; @@ -659,6 +668,7 @@ public class BackApplyServiceImpl implements BackApplyService { } // 编码设备合格数据处理 if ("0".equals(leaseApplyDetails.getManageType()) && !CollectionUtils.isEmpty(leaseApplyDetails.getPassMaCodeDtoList())){ + leaseApplyDetails.setEndTime(backTime); AjaxResult error = getMaCodeHgAjaxResult(bean, taskId, leaseApplyDetails); if (error != null) { return error; @@ -666,6 +676,7 @@ public class BackApplyServiceImpl implements BackApplyService { } // 编码维修数据处理 if ("0".equals(leaseApplyDetails.getManageType()) && !CollectionUtils.isEmpty(leaseApplyDetails.getRepairMaCodeDtoList())){ + leaseApplyDetails.setEndTime(backTime); AjaxResult error = getMaCodeWxAjaxResult(bean, backApplyInfoId, leaseApplyDetails); if (error != null) { return error; @@ -675,6 +686,7 @@ public class BackApplyServiceImpl implements BackApplyService { bean.getIsFinishBack() != null && bean.getIsFinishBack() == 1) { //更新结算表 slt_agreement_info leaseApplyDetails.setAgreementId(bean.getAgreementId()); + leaseApplyDetails.setEndTime(backTime); int r = updateSlt4Bean(leaseApplyDetails); if (r == 0) { throw new RuntimeException("该机具未被领料使用"); @@ -725,6 +737,13 @@ public class BackApplyServiceImpl implements BackApplyService { return AjaxResult.error("退料数不能超过在用数"); } } + String backTime = null; + if(bean.getBackApplyInfo().getBackTime()!=null){ + backTime = bean.getBackApplyInfo().getBackTime(); + + } else { + backTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + } boolean addLeaseTaskResult = false; Long backApplyInfoId = 0L; try { @@ -808,6 +827,7 @@ public class BackApplyServiceImpl implements BackApplyService { leaseApplyDetails.setMaintenanceNum(0); } if ("1".equals(leaseApplyDetails.getManageType()) && leaseApplyDetails.getPassNum() > 0) { + leaseApplyDetails.setEndTime(backTime); AjaxResult error = getHgAjaxResult(bean, taskId, leaseApplyDetails); if (error != null) { return error; @@ -815,6 +835,7 @@ public class BackApplyServiceImpl implements BackApplyService { } // 维修数据处理 if ("1".equals(leaseApplyDetails.getManageType()) && leaseApplyDetails.getMaintenanceNum() > 0) { + leaseApplyDetails.setEndTime(backTime); AjaxResult error = getWxAjaxResult(bean, backApplyInfoId, leaseApplyDetails); if (error != null) { return error; @@ -822,6 +843,7 @@ public class BackApplyServiceImpl implements BackApplyService { } // 编码设备合格数据处理 if ("0".equals(leaseApplyDetails.getManageType()) && !CollectionUtils.isEmpty(leaseApplyDetails.getPassMaCodeDtoList())){ + leaseApplyDetails.setEndTime(backTime); AjaxResult error = getMaCodeHgAjaxResult(bean, taskId, leaseApplyDetails); if (error != null) { return error; @@ -829,6 +851,7 @@ public class BackApplyServiceImpl implements BackApplyService { } // 编码维修数据处理 if ("0".equals(leaseApplyDetails.getManageType()) && !CollectionUtils.isEmpty(leaseApplyDetails.getRepairMaCodeDtoList())){ + leaseApplyDetails.setEndTime(backTime); AjaxResult error = getMaCodeWxAjaxResult(bean, backApplyInfoId, leaseApplyDetails); if (error != null) { return error; @@ -839,6 +862,7 @@ public class BackApplyServiceImpl implements BackApplyService { bean.getIsFinishBack() != null && bean.getIsFinishBack() == 1) { //更新结算表 slt_agreement_info leaseApplyDetails.setAgreementId(bean.getAgreementId()); + leaseApplyDetails.setEndTime(backTime); int res = updateSlt4Bean(leaseApplyDetails); if (res == 0) { throw new RuntimeException("该机具未被领料使用"); 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 71fad48..007116d 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 @@ -622,7 +622,7 @@ update slt_agreement_info - set end_time = now(), + set end_time = #{record.endTime}, update_time = now(), back_id = #{record.parentId}, status = '1' @@ -631,7 +631,7 @@ update slt_agreement_info set num = #{backNum}, - end_time = now(), + end_time = #{record.endTime}, update_time = now(), back_id = #{record.parentId}, status = '1' diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml index 8859baa..4b1d9ea 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml @@ -415,7 +415,7 @@ insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,type_name,model_name,replace_type_id,is_slt,company_id,lease_type,create_time,ck_remark) - values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},now(),0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},#{ma.typeName},#{ma.modelName},#{ma.replaceTypeId},'0',#{record.companyId},#{record.leaseType},now(),#{record.remark}); + values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},#{record.createTime},0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},#{ma.typeName},#{ma.modelName},#{ma.replaceTypeId},'0',#{record.companyId},#{record.leaseType},now(),#{record.remark});