From 763746b314a150f2eea683c29a7ab1c6c247a915 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Mon, 1 Jul 2024 14:20:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E8=BF=90=E8=A1=8C=E9=97=AE=E9=A2=98?= =?UTF-8?q?=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 --- .../impl/LeaseOutDetailsServiceImpl.java | 44 +++++++++---------- .../bonus/sgzb/base/domain/BmProjectInfo.java | 10 +++++ .../bonus/sgzb/base/domain/BmProjectLot.java | 16 +++++++ .../resources/mapper/app/TmTaskMapper.xml | 6 +-- .../mapper/base/BmProjectInfoMapper.xml | 10 +++-- .../mapper/base/BmProjectLotMapper.xml | 8 +++- .../InventoryAndWarehousingMapper.xml | 2 +- .../mapper/material/LeaseRecordMapper.xml | 1 + .../material/PurchaseAccessoryMapper.xml | 2 +- .../material/PurchaseCheckInfoMapper.xml | 6 +-- .../material/ReturnOfMaterialsInfoMapper.xml | 2 +- 11 files changed, 72 insertions(+), 35 deletions(-) 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 950db6b3..ece9bbc4 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 @@ -203,33 +203,33 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService { // 首先更新领料任务详情表的领料数及状态(lease_apply_details) res = leaseOutDetailsMapper.updateLeaseApplyDetailsOutNum(record); LeaseApplyDetails leaseApplyDetails = leaseOutDetailsMapper.getLeaseApplyDetails(record); - if (leaseApplyDetails.getPreNum().equals(leaseApplyDetails.getAlNum()) || leaseApplyDetails.getAuditNum().equals(leaseApplyDetails.getAlNum())){ + if (leaseApplyDetails.getPreNum().equals(leaseApplyDetails.getAlNum()) || leaseApplyDetails.getAuditNum().equals(leaseApplyDetails.getAlNum())) { leaseOutDetailsMapper.updateLeaseApplyDetails(record); } + if (res > 0) { + // 插入领料出库明细表(lease_out_details) + res = leaseOutDetailsMapper.insertSelective(record); if (res > 0) { - // 插入领料出库明细表(lease_out_details) - res = leaseOutDetailsMapper.insertSelective(record); - if (res > 0) { - if (record.getManageType() == 2) { - // 成套机具减少 (ma_type 设备规格表)的库存数量 - res = leaseOutDetailsMapper.updateMaTypeStockNum(record); - // 成套机具减少 (ma_type 设备规格表)配件的库存数量 - List typeIds = leaseOutDetailsMapper.getMaTypeDetails(record); - typeIds.removeIf(item -> item == null); - for (TmTask typeId : typeIds) { - MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId); - machinePart.setPartNum((typeId.getPartNum() * record.getOutNum())); - typeId.setNum(machinePart.getNum() - machinePart.getPartNum()); - res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId); - } - } else { - // 普通机具减少 (ma_type 设备规格表)的库存数量 - res = leaseOutDetailsMapper.updateMaTypeStockNum(record); + if (record.getManageType() == 2) { + // 成套机具减少 (ma_type 设备规格表)的库存数量 + res = leaseOutDetailsMapper.updateMaTypeStockNum(record); + // 成套机具减少 (ma_type 设备规格表)配件的库存数量 + List typeIds = leaseOutDetailsMapper.getMaTypeDetails(record); + typeIds.removeIf(item -> item == null); + for (TmTask typeId : typeIds) { + MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId); + machinePart.setPartNum((typeId.getPartNum() * record.getOutNum())); + typeId.setNum(machinePart.getNum() - machinePart.getPartNum()); + res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId); } - // 更新 (ma_machine 设备表)的状态 - leaseOutDetailsMapper.updateMaMachineStatus(record); + } else { + // 普通机具减少 (ma_type 设备规格表)的库存数量 + res = leaseOutDetailsMapper.updateMaTypeStockNum(record); } + // 更新 (ma_machine 设备表)的状态 + leaseOutDetailsMapper.updateMaMachineStatus(record); } + } return res; } @@ -239,7 +239,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService { List leaseApplyDetailsList = leaseApplyDetailsMapper.getByParentId(record.getParentId()); int i = 0; for (LeaseApplyDetails bean : leaseApplyDetailsList) { - if (Objects.equals(bean.getPreNum(), bean.getAlNum())) { + if (Objects.equals(bean.getPreNum(), bean.getAlNum()) || "2".equals(bean.getStatus())) { i++; } } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/BmProjectInfo.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/BmProjectInfo.java index 9dd1eb17..e3eb3fb8 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/BmProjectInfo.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/BmProjectInfo.java @@ -2,10 +2,12 @@ package com.bonus.sgzb.base.domain; import com.bonus.sgzb.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.sql.Timestamp; +import java.util.Date; import java.util.List; @Data @@ -59,6 +61,14 @@ public class BmProjectInfo { /**数据所属组织*/ @ApiModelProperty(value = "数据所属组织") private String companyId; + /**开工日期*/ + @ApiModelProperty(value = "开工日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private String startDate; + /**竣工日期*/ + @ApiModelProperty(value = "竣工日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private String completionDate; /**数据所属组织*/ @Excel(name = "所属上级") diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/BmProjectLot.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/BmProjectLot.java index f9381511..8a5e2ffc 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/BmProjectLot.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/BmProjectLot.java @@ -2,10 +2,12 @@ package com.bonus.sgzb.base.domain; import com.bonus.sgzb.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.sql.Timestamp; +import java.util.Date; import java.util.List; @Data @@ -112,6 +114,20 @@ public class BmProjectLot { */ @ApiModelProperty(value = "数据所属组织") private String companyId; + /** + /** + * 开工日期 + */ + @ApiModelProperty(value = "开工日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private String startDate; + /** + /** + * 竣工日期 + */ + @ApiModelProperty(value = "竣工日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private String completionDate; /** * 数据所属组织 */ diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml index 043e85ea..7ce2b91e 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml @@ -671,15 +671,15 @@ bui.unit_id as unitId,bui.unit_name as unitName, su.nick_name as applyFor,d.`name` as taskName, - su2.user_name as companyAuditBy, + su2.nick_name as companyAuditBy, lai.company_audit_time as companyAuditTime, lai.company_audit_remark as companyAuditRemark, - su3.user_name as deptAuditBy, + su3.nick_name as deptAuditBy, lai.dept_audit_time as deptAuditTime, lai.dept_audit_remark as deptAuditRemark, - su4.user_name as directAuditBy, + su4.nick_name as directAuditBy, lai.direct_audit_time as directAuditTime, lai.direct_audit_remark as directAuditRemark, lai.lease_type as leaseType, diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/BmProjectInfoMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/BmProjectInfoMapper.xml index b510be9a..023ab8ff 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/BmProjectInfoMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/BmProjectInfoMapper.xml @@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select a.lot_id, a.pro_id, a.lot_name, a.status, a.type_id, a.link_man, a.telphone, a.own_pro, a.dept_id, a.is_share, - a.lon, a.lat, a.del_flag, a.create_by, a.create_time,a.remark,a.company_id ,b.dept_name, c.name + a.lon, a.lat, a.del_flag, a.create_by, a.create_time,a.remark,a.company_id ,b.dept_name, c.name,a.start_date,a.completion_date from bm_project_lot a left join sys_dept b on a.dept_id = b.dept_id left join sys_dic c on a.type_id = c.id @@ -115,6 +115,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time, remark, company_id, + start_date, + completion_date, create_time )values( #{lotName}, @@ -130,6 +132,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{remark}, #{companyId}, + #{startDate}, + #{completionDate}, sysdate() ) @@ -149,6 +153,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by =#{updateBy}, remark = #{remark}, company_id = #{companyId}, + start_date = #{startDate}, + completion_date = #{completionDate}, update_time = sysdate() where lot_id = #{lotId} diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/InventoryAndWarehousingMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/InventoryAndWarehousingMapper.xml index 5c760549..868598d2 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/InventoryAndWarehousingMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/InventoryAndWarehousingMapper.xml @@ -196,7 +196,7 @@ bui.unit_name AS unitName, pisi.`CODE` AS kindName, mt2.type_name AS typeName, - su.user_name AS modelName, + su.nick_name AS modelName, pisi.CREATE_DATE AS createDate, pisi.REMARKS AS remark, ROW_NUMBER() OVER (PARTITION BY pisi.`CODE` ORDER BY pisi.CREATE_DATE DESC) AS row_num diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml index 78afe2a5..a5420003 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml @@ -61,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') + order by lod.create_time desc SELECT - pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, us.user_name as create_by, pci.create_time, + pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, us.nick_name as create_by, pci.create_time, pci.update_by, pci.update_time, pci.remark, pci.company_id ,tk.code,tk.task_status taskStatus,GROUP_CONCAT(distinct mpt1.pa_name) purchasingTypeName, CASE diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml index fd3dc9dc..6fae32a5 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml @@ -178,7 +178,7 @@ WHERE ma_machine.ma_code = select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time, pci.update_by, pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status - taskStatus,su.user_name purchaserName, + taskStatus,su.nick_name purchaserName, tk.create_by, CASE tk.task_status WHEN 28 THEN @@ -190,9 +190,9 @@ WHERE ma_machine.ma_code = END as inputTime, CASE tk.task_status WHEN 28 THEN - us.user_name + us.nick_name WHEN 123 THEN - us.user_name + us.nick_name ELSE '' END as inputUser diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml index cad47a19..ec548ac1 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml @@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" iad.input_num as inputNum,mm.ma_code as maCode, tt.create_time as returnTime, iad.create_time as submitStorageTime, - us.user_name as submitToStoragePersonnel,iad.remark as remark + us.nick_name as submitToStoragePersonnel,iad.remark as remark FROM input_apply_details iad LEFT JOIN tm_task tt ON iad.task_id = tt.task_id LEFT JOIN tm_task_agreement tta on tta.task_id = tt.task_id