From 1115686d36c5ec1d24f34ad0ee4a41ad8e5c93fd Mon Sep 17 00:00:00 2001 From: "1539530615@qq.com" <1539530615@qq.com> Date: Fri, 12 Jan 2024 17:11:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E4=BF=AE=E8=AF=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/mapper/LeaseApplyDetailsMapper.java | 2 + .../app/mapper/LeaseOutDetailsMapper.java | 3 ++ .../impl/LeaseOutDetailsServiceImpl.java | 21 ++++++++- .../mapper/app/LeaseApplyDetailsMapper.xml | 9 +++- .../mapper/app/LeaseOutDetailsMapper.xml | 10 ++++ .../impl/RepairAuditDetailsServiceImpl.java | 4 +- .../material/ScrapApplyDetailsMapper.xml | 47 ++++++++++++++----- .../mapper/material/TmTaskAgreementMapper.xml | 2 + 8 files changed, 80 insertions(+), 18 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseApplyDetailsMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseApplyDetailsMapper.java index a6de5e4b..574a7e6b 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseApplyDetailsMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseApplyDetailsMapper.java @@ -43,4 +43,6 @@ public interface LeaseApplyDetailsMapper { int updateBatchSelective(List list); int batchInsert(@Param("list") List list); + + List getByParentId(Integer parentId); } \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseOutDetailsMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseOutDetailsMapper.java index 4275c650..ab830e3e 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseOutDetailsMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseOutDetailsMapper.java @@ -46,4 +46,7 @@ public interface LeaseOutDetailsMapper { */ int insertAgreementInfo(@Param("record") LeaseOutDetails leaseOutDetails); + String getTaskId(Integer parentId); + + int updateTaskStatus(@Param("taskId") String taskId,@Param("status")int status); } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java index bcaf3967..973b37c2 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java @@ -1,7 +1,9 @@ package com.bonus.sgzb.app.service.impl; +import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper; import com.bonus.sgzb.app.mapper.LeaseOutDetailsMapper; import com.bonus.sgzb.app.service.LeaseOutDetailsService; +import com.bonus.sgzb.base.api.domain.LeaseApplyDetails; import com.bonus.sgzb.base.api.domain.LeaseOutDetails; import com.bonus.sgzb.base.api.domain.MaMachine; import com.bonus.sgzb.base.mapper.MaMachineMapper; @@ -11,6 +13,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; +import java.util.Objects; /** * Description: 领料出库详情接口实现类 @@ -25,7 +28,8 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService { @Resource private LeaseOutDetailsMapper leaseOutDetailsMapper; - + @Resource + private LeaseApplyDetailsMapper leaseApplyDetailsMapper; @Resource private MaMachineMapper maMachineMapper; @@ -69,7 +73,20 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService { if (updateMaTypeStockNum > 0) { // if (updateMaMachineStatus > 0) { // if (insertAgreementInfo > 0) { - return AjaxResult.success("领料出库成功!"); + List leaseApplyDetailsList = leaseApplyDetailsMapper.getByParentId(record.getParentId()); + int i = 0; + for (LeaseApplyDetails bean : leaseApplyDetailsList){ + if (Objects.equals(bean.getPreNum(), bean.getAlNum())){ + i++; + } + } + String taskId = leaseOutDetailsMapper.getTaskId(record.getParentId()); + if (i == leaseApplyDetailsList.size()){ + leaseOutDetailsMapper.updateTaskStatus(taskId,35); + }else { + leaseOutDetailsMapper.updateTaskStatus(taskId,34); + } + return AjaxResult.success("领料出库成功!"); // } // return AjaxResult.error("领料出库失败,插入任务协议信息错误!"); // } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml index da070ef8..59dab457 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml @@ -29,8 +29,15 @@ from lease_apply_details where id = #{id,jdbcType=INTEGER} + - + delete from lease_apply_details where id = #{id,jdbcType=INTEGER} diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml index 021189d2..78463002 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml @@ -14,6 +14,11 @@ + UPDATE @@ -121,6 +126,11 @@ + + update tm_task + set task_status = #{status} + where task_id = #{taskId} + insert into tm_task_agreement diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java index a8e2b792..7addac16 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java @@ -174,7 +174,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService for (RepairAuditDetails repairAuditDetails : repairAuditDetailsList) { Long typeId = repairAuditDetails.getTypeId(); Long maId = repairAuditDetails.getMaId(); - BigDecimal repairNum = repairAuditDetails.getRepairNum(); + BigDecimal repairNum = repairAuditDetails.getRepairedNum(); BigDecimal b = new BigDecimal(0); // 创建修饰后入库任务 if (repairNum.compareTo(b) > 0) { @@ -202,7 +202,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService repairInputDetails.setTaskId(task.getTaskId()); repairInputDetails.setAuditId(repairAuditDetails.getId()); repairInputDetails.setRepairId(repairAuditDetails.getRepairId()); - repairInputDetails.setRepairNum(repairAuditDetails.getRepairNum()); + repairInputDetails.setRepairNum(repairAuditDetails.getRepairedNum()); repairInputDetails.setTypeId(repairAuditDetails.getTypeId()); repairInputDetails.setMaId(repairAuditDetails.getMaId()); repairInputDetails.setStatus("0"); diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml index b8f74a36..a5847fe6 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml @@ -32,19 +32,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TmTaskAgreementMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TmTaskAgreementMapper.xml index f30b49f2..e8b5e410 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TmTaskAgreementMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TmTaskAgreementMapper.xml @@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into tm_task_agreement + task_id, agreement_id, create_by, create_time, @@ -44,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" company_id, + #{taskId}, #{agreementId}, #{createBy}, now(),