From 2513430e71ca502abac0531117090dfb40044452 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Tue, 25 Mar 2025 13:39:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/SltAgreementInfoMapper.java | 4 ++-- .../service/impl/BackApplyServiceImpl.java | 7 ++++++ .../impl/SltAgreementInfoServiceImpl.java | 8 +++---- .../material/SltAgreementInfoMapper.xml | 22 ++++++++----------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java index a20bef9..c3e1e98 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java @@ -80,7 +80,7 @@ public interface SltAgreementInfoMapper { List checkEndTime(SltAgreementApply apply); - List getProjectListByUnitIds(@Param("unitIds") int[] unitIds); + List getProjectListByUnitIds(Long unitId); - List getUnitListByProjetctIds(Long projectId); + List getUnitListByProjetctIds(@Param("projectIds") Long[] projectIds); } 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 5ee2350..37ab7ef 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 @@ -711,6 +711,7 @@ public class BackApplyServiceImpl implements BackApplyService { * @return */ @Override + @Transactional(rollbackFor = Exception.class) public AjaxResult submitBackApply(BackApplyInfo bean) { if (bean == null || bean.getBackApplyInfo() == null || CollectionUtils.isEmpty(bean.getBackApplyDetails())) { return AjaxResult.error("退料申请数据不能为空"); @@ -798,6 +799,12 @@ public class BackApplyServiceImpl implements BackApplyService { leaseApplyDetails.setCreateBy(SecurityUtils.getUserId().toString()); // 根据任务详情往back_check_details插入数据 // 退料合格数据处理 + if(leaseApplyDetails.getPassNum()==null){ + leaseApplyDetails.setPassNum(0); + } + if(leaseApplyDetails.getMaintenanceNum()==null){ + leaseApplyDetails.setMaintenanceNum(0); + } if ("1".equals(leaseApplyDetails.getManageType()) && leaseApplyDetails.getPassNum() > 0) { AjaxResult error = getHgAjaxResult(bean, taskId, leaseApplyDetails); if (error != null) { diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java index baf57d0..1637151 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java @@ -640,8 +640,8 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { public AjaxResult getProjectListByUnitIds(AgreementInfo agreementInfo) { List list = new ArrayList<>(); try { - if(agreementInfo.getUnitIds()!=null){ - list = sltAgreementInfoMapper.getProjectListByUnitIds(agreementInfo.getUnitIds()); + if(agreementInfo.getUnitId()!=null){ + list = sltAgreementInfoMapper.getProjectListByUnitIds(agreementInfo.getUnitId()); } } catch (Exception e) { @@ -659,8 +659,8 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { public AjaxResult getUnitListByProjetctIds(AgreementInfo agreementInfo) { List list = new ArrayList<>(); try { - if(agreementInfo.getProjectId()!=null){ - list = sltAgreementInfoMapper.getUnitListByProjetctIds(agreementInfo.getProjectId()); + if(agreementInfo.getProjectIds()!=null){ + list = sltAgreementInfoMapper.getUnitListByProjetctIds(agreementInfo.getProjectIds()); } } catch (Exception e) { diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml index 1e5ae5a..65c4095 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml @@ -133,11 +133,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id left join slt_agreement_relation sar on bai.agreement_id = sar.agreement_id where bai.status = '1' - - and bui.unit_id in - - #{unitId} - + + and bui.unit_id = #{unitId} AND bp.lot_id IN @@ -632,13 +629,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join bm_unit_info bui on bui.unit_id = bai.unit_id left join bm_project_lot bpl ON bpl.lot_id = bai.project_id where bai.status = '1' - - and bui.unit_id in - - #{unitId} - + + and bui.unit_id = #{unitId} - ORDER BY bai.agreement_id desc @@ -649,8 +642,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join bm_unit_info bui on bui.unit_id = bai.unit_id left join bm_project_lot bpl ON bpl.lot_id = bai.project_id where bai.status = '1' - - and bai.project_id = #{projectId} + + and bai.project_id in + + #{projectId} + GROUP BY bai.unit_id ORDER BY bai.agreement_id desc