From 881b8b80dfc1a56da0a14183da0bbdbc1d01dc64 Mon Sep 17 00:00:00 2001 From: dingjie Date: Thu, 21 Dec 2023 20:28:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=B4=AD=E9=AA=8C=E6=94=B6=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/base/mapper/MaTypeMapper.java | 6 + .../base/service/impl/MaTypeServiceImpl.java | 10 +- .../mapper/base/MaHouseSetMapper.xml | 58 ++++--- .../mapper/base/MaMachineTypeMapper.xml | 11 +- .../PurchaseCheckInfoController.java | 16 +- .../PurchaseMacodeInfoController.java | 31 ++-- .../material/domain/PurchaseCheckDetails.java | 23 +++ .../material/domain/PurchaseCheckInfo.java | 26 +++ .../material/domain/PurchaseMacodeInfo.java | 108 ++++++++++++ .../mapper/PurchaseMacodeInfoMapper.java | 7 + .../service/IPurchaseCheckInfoService.java | 2 +- .../service/IPurchaseMacodeInfoService.java | 11 +- .../impl/PurchaseCheckDetailsServiceImpl.java | 17 +- .../impl/PurchaseCheckInfoServiceImpl.java | 4 +- .../impl/PurchaseMacodeInfoServiceImpl.java | 157 +++++++++++++----- .../impl/RepairAuditDetailsServiceImpl.java | 10 +- .../material/PurchaseCheckDetailsMapper.xml | 5 +- .../material/PurchaseCheckInfoMapper.xml | 8 +- .../material/PurchaseMacodeInfoMapper.xml | 51 ++++-- .../src/main/resources/bootstrap.yml | 4 +- 20 files changed, 426 insertions(+), 139 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java index b659a772..da9f8617 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java @@ -75,4 +75,10 @@ public interface MaTypeMapper { List selectMaTypeListByLevelNotFour(String parentId); List getMaTypeSelect(String parentId); + + int deleteTypeByTypeId(Long typeId); + + int deleteKeeperByTypeId(Long typeId); + + int deletePropSetByTypeId(Long typeId); } \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java index 10491c97..5d3eb09f 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java @@ -125,25 +125,28 @@ public class MaTypeServiceImpl implements ITypeService { } // 库管员配置 if (maType.getKeeperUserId() >= 0L) { + maTypeMapper.deleteKeeperByTypeId(typeId); MaTypeKeeper typeKeeper = new MaTypeKeeper(); typeKeeper.setUserId(maType.getKeeperUserId()); typeKeeper.setTypeId(typeId); - maTypeMapper.updateKeeperByTypeId(typeKeeper); + maTypeMapper.insertKeeper(typeKeeper); } // 维修员配置 if (maType.getRepairUserId() >= 0L) { + maTypeMapper.deleteTypeByTypeId(typeId); MaTypeRepair typeRepair = new MaTypeRepair(); typeRepair.setUserId(maType.getRepairUserId()); typeRepair.setTypeId(typeId); - maTypeMapper.updateRepairByTypeId(typeRepair); + maTypeMapper.insertRepair(typeRepair); } // 资产属性配置 if (maType.getPropId() >= 0L) { + maTypeMapper.deletePropSetByTypeId(typeId); MaPropSet propSet = new MaPropSet(); propSet.setTypeId(typeId); propSet.setPropId(maType.getPropId()); - maTypeMapper.updatePropSetByTypeId(propSet); + maTypeMapper.insertMaPropSet(propSet); } return i; } @@ -353,7 +356,6 @@ public class MaTypeServiceImpl implements ITypeService { childList.add(maType); } } - System.out.println(childList); return childList; } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml index 5d30ac44..df14eb13 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml @@ -89,38 +89,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml index a35b1d4f..c542e19e 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml @@ -159,9 +159,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update ma_type set del_flag = '2' where type_id = #{typeId} + + delete from ma_type_repair where type_id = #{typeId} + + + delete from ma_type_keeper where type_id = #{typeId} + + + delete from ma_prop_set where type_id = #{typeId} + 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 + pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,su.user_name purchaserName,tk.task_status taskStatus from purchase_check_info pci left join tm_task tk on pci.task_id = tk.task_id left join (select id,name from sys_dic where p_id = 23) dict on tk.task_status = dict.id - where task_type = 23 and tk.task_status in (select id from sys_dic where p_id = 23) + left join sys_user su on pci.purchaser = su.user_id + where task_type = 23 and tk.task_status in (24,25,26,27) and tk.code = #{code} and pci.purchase_time = #{purchaseTime} and pci.arrival_time = #{arrivalTime} and pci.purchaser = #{purchaser} and pci.company_id = #{companyId} + order by pci.create_time desc - select pmi.task_id, pmi.type_id, pmi.ma_code, pmi.qr_code, pmi.fix_code, pmi.code_type, pmi.status, pmi.create_by, - pmi.create_time, pmi.update_by, pmi.update_time, pmi.remark, pmi.company_id, mt.type_name specificationType, - mt1.type_name typeName, mma.ma_id maId - from purchase_macode_info pmi - left join ma_type mt on pmi.type_id = mt.type_id + select distinct pcd.task_id, pcd.type_id, pmi.qr_code, pmi.fix_code, pmi.code_type, pmi.status, + pmi.remark, pmi.company_id, mt.type_name specificationType, + mt1.type_name typeName, pcd.check_num checkNum, pcd.purchase_num purchaseNum , + IFNULL(pcd.bind_num,0) bindNum, mt.code typeCode,mt.model_code specsCode,pt.purchase_time purchaseTime + from purchase_check_details pcd + left join ma_type mt on pcd.type_id = mt.type_id left join ma_type mt1 on mt.parent_id = mt1.type_id - left join ma_machine mma on pmi.ma_code = mma.ma_code - where pmi.task_id = #{taskId} + left join purchase_macode_info pmi on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id + left join purchase_check_info pt on pcd.task_id = pt.task_id + where pcd.task_id = #{taskId} and pmi.type_id = #{typeId} - and pmi.fix_code = #{fixCode} + (mt.type_name like concat('%',#{keyWord},'%') or mt1.type_name like concat('%',#{keyWord}) and mt1.type_name = #{typeName} and mt.type_name = #{specificationType} and pmi.code_type = #{codeType} @@ -110,10 +112,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select ma_id, type_id, ma_code, pre_code, ma_status, qr_code, buy_price, ma_vender, out_fac_time, out_fac_code, @@ -165,7 +171,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" in_out_num, buy_task, own_house, - company_id + company_id, + create_time )values( #{typeId}, #{maCode}, @@ -187,7 +194,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{inOutNum}, #{buyTask}, #{ownHouse}, - #{companyId} + #{companyId}, + #{createTime} ) @@ -233,6 +241,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, remark, company_id from ma_type where type_id = #{typeId} + + update ma_type set num = #{num} where type_id = #{typeId} diff --git a/sgzb-modules/sgzb-system/src/main/resources/bootstrap.yml b/sgzb-modules/sgzb-system/src/main/resources/bootstrap.yml index 19776a8b..2cd1cc77 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/bootstrap.yml +++ b/sgzb-modules/sgzb-system/src/main/resources/bootstrap.yml @@ -18,11 +18,11 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 192.168.0.14:8848 + server-addr: 127.0.0.1:8848 namespace: sgzb_cloud_dev config: # 配置中心地址 - server-addr: 192.168.0.14:8848 + server-addr: 127.0.0.1:8848 namespace: sgzb_cloud_dev # 配置文件格式 file-extension: yml