From 15ac3613cd384e6771f586c976cfb40465c3a6ab Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 29 Oct 2024 16:02:32 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=85=8D=E4=BB=B6=E9=87=8D=E5=90=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/sgzb/base/mapper/MaPartTypeMapper.java | 2 ++ .../sgzb/base/service/impl/MaPartTypeServiceImpl.java | 9 ++++++++- .../src/main/resources/mapper/base/MaPartTypeMapper.xml | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/mapper/MaPartTypeMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/mapper/MaPartTypeMapper.java index 812f831..21c8467 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/mapper/MaPartTypeMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/mapper/MaPartTypeMapper.java @@ -56,5 +56,7 @@ public interface MaPartTypeMapper { int checkPartName(String paName); List selectPartName(String paName); + + List selectPartNameByLevel(MaPartType maPartType); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaPartTypeServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaPartTypeServiceImpl.java index ab5867c..5291f2d 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaPartTypeServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaPartTypeServiceImpl.java @@ -42,6 +42,13 @@ public class MaPartTypeServiceImpl implements IPartTypeService { // if (StringUtils.isNotNull(info) && info.getPaId().longValue() != paId.longValue()) { // return UserConstants.NOT_UNIQUE; // } + // 查询具有相同paName的所有MaPartType对象 + if (maPartType.getLevel() != null && maPartType.getParentId() != null) { + List maPartTypes = maPartTypeMapper.selectPartNameByLevel(maPartType); + if (maPartTypes.size() > 0) { + return UserConstants.NOT_UNIQUE; + } + } // 查询具有相同paName的所有MaPartType对象 List maPartTypes = maPartTypeMapper.selectPartName(maPartType.getPaName()); @@ -142,7 +149,7 @@ public class MaPartTypeServiceImpl implements IPartTypeService { String templateName = "template.xlsx"; OutputStream out = null; - InputStream input =null; + InputStream input = null; try { // ApplicationHome h = new ApplicationHome(getClass()); // String dirPath = h.getSource().toString(); diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaPartTypeMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaPartTypeMapper.xml index 0e11fde..d63a0d1 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaPartTypeMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaPartTypeMapper.xml @@ -197,5 +197,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from ma_part_type where pa_name = #{paName} + From a9eb35b238fa53bbcc9f8792918481cfff060714 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 29 Oct 2024 16:34:11 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=9C=BA=E5=85=B7=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/service/impl/MaTypeServiceImpl.java | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java index f68e393..b151269 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java @@ -12,10 +12,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -94,24 +91,32 @@ public class MaTypeServiceImpl implements ITypeService { typeFileMapper.insertMaTypeFile(typeFile1); } // 库管员配置 - MaTypeKeeper typeKeeper = new MaTypeKeeper(); - typeKeeper.setUserId(maType.getKeeperUserId()); - typeKeeper.setTypeId(typeId); - typeKeeper.setCreateTime(DateUtils.getNowDate()); - maTypeMapper.insertKeeper(typeKeeper); + if (Objects.nonNull(maType.getKeeperUserId())) { + MaTypeKeeper typeKeeper = new MaTypeKeeper(); + typeKeeper.setUserId(maType.getKeeperUserId()); + typeKeeper.setTypeId(typeId); + typeKeeper.setCreateTime(DateUtils.getNowDate()); + maTypeMapper.insertKeeper(typeKeeper); + } // 维修员配置 - MaTypeRepair typeRepair = new MaTypeRepair(); - typeRepair.setUserId(maType.getRepairUserId()); - typeRepair.setTypeId(typeId); - typeRepair.setCreateTime(DateUtils.getNowDate()); - maTypeMapper.insertRepair(typeRepair); + if (Objects.nonNull(maType.getRepairUserId())) { + MaTypeRepair typeRepair = new MaTypeRepair(); + typeRepair.setUserId(maType.getRepairUserId()); + typeRepair.setTypeId(typeId); + typeRepair.setCreateTime(DateUtils.getNowDate()); + maTypeMapper.insertRepair(typeRepair); + } + // 资产属性配置 - MaPropSet propSet = new MaPropSet(); - propSet.setTypeId(typeId); - propSet.setPropId(maType.getPropId()); - propSet.setCreateTime(DateUtils.getNowDate()); - maTypeMapper.insertMaPropSet(propSet); + if (maType.getPropId() > 0) { + MaPropSet propSet = new MaPropSet(); + propSet.setTypeId(typeId); + propSet.setPropId(maType.getPropId()); + propSet.setCreateTime(DateUtils.getNowDate()); + maTypeMapper.insertMaPropSet(propSet); + } + return i; } From f2d8557588c7d9ab268eb1c49525afd0772e9219 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 30 Oct 2024 13:04:52 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E7=BB=91=E5=AE=9Asql=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/base/MaMachineMapper.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineMapper.xml index 0c546a9..3d1082f 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineMapper.xml @@ -311,7 +311,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where m.rfid_code = #{rfidCode} select * from data_receive_info where 1=1 @@ -38,12 +43,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" drd.*, mt.type_name modelName, mt1.type_name typeName, - mt2.type_name machineName + mt2.type_name machineName, + mm.ma_status FROM data_receive_detail drd LEFT JOIN ma_type mt ON drd.type_id = mt.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id + LEFT JOIN ma_machine mm ON drd.ma_id = mm.ma_id WHERE drd.receive_id = #{receiveId} @@ -85,4 +92,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + \ No newline at end of file From ae6804297ba2e17791be5a7890d47d1599429c91 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 31 Oct 2024 14:30:25 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=BB=91=E5=AE=9Asql=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/base/MaMachineMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineMapper.xml index 3d1082f..da529bd 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineMapper.xml @@ -314,7 +314,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select * from ma_machine where 1=1 - and ma_id = #{maId} + and ma_id = #{maId} and ma_code = #{maCode} select * from ma_machine where qr_code = #{qrCode} or ma_code = #{maCode} + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaReceiveMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaReceiveMapper.xml index 1b002df..f1272f9 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaReceiveMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaReceiveMapper.xml @@ -8,9 +8,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into data_receive_info(push_num,receive_date) values(#{pushNum},now()) - - insert into data_receive_detail(receive_id,check_code,check_unit,check_date,is_new,ma_id,ma_user_name,next_check_date,out_factory_time,rent_price,rent_time,supplier,type_id,unit_id) - values(#{receiveId},#{checkCode},#{checkUnit},#{checkDate},#{isNew},#{maId},#{maUserName},#{nextCheckDate},#{outFactoryTime},#{rentPrice},#{rentTime},#{supplier},#{typeId},#{unitId}) + + insert into data_receive_detail(receive_id,check_code,check_unit,check_date,is_new,ma_id, + ma_user_name,next_check_date,out_factory_time,rent_price,rent_time, + supplier,type_id,unit_id,order_over_time,ma_user_phone,ma_user_id_card, + ma_user_sex,ma_user_age) + values(#{receiveId},#{checkCode},#{checkUnit},#{checkDate},#{isNew},#{maId},#{maUserName}, + #{nextCheckDate},#{outFactoryTime},#{rentPrice},#{rentTime},#{supplier},#{typeId},#{unitId}, + #{orderOverTime},#{maUserPhone},#{maUserIdCard},#{maUserSex},#{maUserAge}) UPDATE data_receive_detail @@ -24,11 +29,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SET receive_status = 1 where id = #{id} - - UPDATE ma_machine mm LEFT JOIN data_receive_detail drd on mm.ma_id = drd.ma_id - SET mm.ma_status = 130 - where drd.item_id = #{itemId} - SELECT * FROM data_receive_detail WHERE receive_id = #{receiveId} - \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/base/enterpriseDriverFileMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/enterpriseDriverFileMapper.xml new file mode 100644 index 0000000..0ef3c0a --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/enterpriseDriverFileMapper.xml @@ -0,0 +1,15 @@ + + + + + + insert into base_enterprise_driver_file(receive_detail_id,file_name,file_url,file_type) + values(#{receiveDetailId},#{fileName},#{fileUrl},#{fileType}) + + + \ No newline at end of file