From b4a87d0905f9bae68f43a0b83c25df22f9138250 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 20 Mar 2025 16:16:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E8=A1=8Cdao=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../u8/base/identity/dao/IUAIdentityDao.java | 2 + .../identity/dao/impl/UAIdentityDaoImpl.java | 7 ++++ .../service/impl/UAIdentityServiceImpl.java | 2 +- .../base/inventory/entity/BasPartEntity.xml | 4 +- .../base/inventory/entity/InventoryEntity.xml | 38 +++++++++---------- .../inventory/entity/InventorySubEntity.xml | 6 +-- .../service/impl/InventoryService.java | 6 +-- 7 files changed, 35 insertions(+), 30 deletions(-) diff --git a/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/dao/IUAIdentityDao.java b/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/dao/IUAIdentityDao.java index d10c8e73..f8ce26f8 100644 --- a/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/dao/IUAIdentityDao.java +++ b/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/dao/IUAIdentityDao.java @@ -9,4 +9,6 @@ import com.hzya.frame.u8.base.identity.entity.UAIdentityEntity; * @Date 2025/3/13 17:01 **/ public interface IUAIdentityDao extends IBaseDao { + + void updateIdentity(UAIdentityEntity entity); } diff --git a/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/dao/impl/UAIdentityDaoImpl.java b/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/dao/impl/UAIdentityDaoImpl.java index 2318cbfd..45d71152 100644 --- a/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/dao/impl/UAIdentityDaoImpl.java +++ b/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/dao/impl/UAIdentityDaoImpl.java @@ -1,5 +1,6 @@ package com.hzya.frame.u8.base.identity.dao.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.basedao.dao.MybatisGenericDao; import com.hzya.frame.u8.base.identity.dao.IUAIdentityDao; import com.hzya.frame.u8.base.identity.entity.UAIdentityEntity; @@ -12,4 +13,10 @@ import org.springframework.stereotype.Repository; **/ @Repository public class UAIdentityDaoImpl extends MybatisGenericDao implements IUAIdentityDao { + + @Override + @DS("#entity.dataSourceCode") + public void updateIdentity(UAIdentityEntity entity) { + super.update(getSqlIdPrifx()+"UAIdentityEntity_update_iFatherId",entity); + } } diff --git a/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/service/impl/UAIdentityServiceImpl.java b/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/service/impl/UAIdentityServiceImpl.java index 86bccdd2..3309486d 100644 --- a/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/service/impl/UAIdentityServiceImpl.java +++ b/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/service/impl/UAIdentityServiceImpl.java @@ -44,7 +44,7 @@ public class UAIdentityServiceImpl extends BaseService UAIdentityEntity uaIdentityEntity = new UAIdentityEntity(); uaIdentityEntity.setCacc_id(acc_id); uaIdentityEntity.setcVouchType(type); - List list = uaIdentityDao.queryList(uaIdentityEntity,"com.hzya.frame.u8.base.identity.entity.UAIdentityEntity.UAIdentityEntity_list_base_cvouchtype"); + List list = (List) uaIdentityDao.query(uaIdentityEntity,"com.hzya.frame.u8.base.identity.entity.UAIdentityEntity.UAIdentityEntity_list_base_cvouchtype"); if (CollectionUtils.isNotEmpty(list)){ return list.get(0); } diff --git a/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/BasPartEntity.xml b/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/BasPartEntity.xml index 57c1212c..b684f2e1 100644 --- a/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/BasPartEntity.xml +++ b/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/BasPartEntity.xml @@ -13,7 +13,7 @@ - select from ${acc_name}bas_part @@ -23,7 +23,7 @@ - + insert into ${acc_name}bas_part (PartId,InvCode )values (#{partId},#{invCode}) diff --git a/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/InventoryEntity.xml b/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/InventoryEntity.xml index 9dab5a08..e1d4a2e9 100644 --- a/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/InventoryEntity.xml +++ b/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/InventoryEntity.xml @@ -776,17 +776,17 @@ - select - from Inventory where id = #{ id } and sts='Y' + from ${acc_name}Inventory where id = #{ id } and sts='Y' - select - from Inventory + from ${acc_name}Inventory cInvCode = #{cInvCode} and cInvAddCode = #{cInvAddCode} @@ -1048,8 +1048,8 @@ - + select count(1) from ${acc_name}Inventory cInvCode = #{cInvCode} and cInvAddCode = #{cInvAddCode} @@ -1314,10 +1314,10 @@ - select - from Inventory + from ${acc_name}Inventory cInvCode like concat('%',#{cInvCode},'%') and cInvAddCode like concat('%',#{cInvAddCode},'%') @@ -1575,17 +1575,16 @@ and bCheckBatch like concat('%',#{bCheckBatch},'%') and bMngOldpart like concat('%',#{bMngOldpart},'%') and iOldpartMngRule like concat('%',#{iOldpartMngRule},'%') - and sts='Y' + - order by id desc - order by ${sort} ${order} + - select - from Inventory + from ${acc_name}Inventory cInvCode = #{cInvCode} or cInvAddCode = #{cInvAddCode} @@ -1843,14 +1842,13 @@ or bCheckBatch = #{bCheckBatch} or bMngOldpart = #{bMngOldpart} or iOldpartMngRule = #{iOldpartMngRule} - and sts='Y' + - order by id desc - order by ${sort} ${order} + - - insert into Inventory( + + insert into ${acc_name}Inventory( cInvCode, cInvAddCode, @@ -2374,8 +2372,8 @@ - - update Inventory set + + update ${acc_name}Inventory set cInvCode = #{cInvCode}, cInvAddCode = #{cInvAddCode}, diff --git a/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/InventorySubEntity.xml b/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/InventorySubEntity.xml index 6de55f92..7f6ecbdd 100644 --- a/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/InventorySubEntity.xml +++ b/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/entity/InventorySubEntity.xml @@ -15,7 +15,7 @@ - select from ${acc_name}Inventory_Sub @@ -25,7 +25,7 @@ - + insert into ${acc_name}Inventory_Sub( cInvSubCode, @@ -47,7 +47,7 @@ - + update ${acc_name}Inventory_Sub set cInvSubCode = #{cInvSubCode}, diff --git a/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/service/impl/InventoryService.java b/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/service/impl/InventoryService.java index a50e042d..f6a20aaa 100644 --- a/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/service/impl/InventoryService.java +++ b/fw-u8/src/main/java/com/hzya/frame/u8/base/inventory/service/impl/InventoryService.java @@ -21,9 +21,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - import java.util.List; -import java.util.function.Supplier; /** * @Description @@ -97,7 +95,7 @@ public class InventoryService extends BaseService implem List partList = basPartService.query(part); if (CollectionUtils.isEmpty(partList)){ UAIdentityEntity uaIdentityEntity = new UAIdentityEntity(); - uaIdentityEntity.setCacc_id("002"); + uaIdentityEntity.setCacc_id(entity.getCacc_id()); uaIdentityEntity.setcVouchType("bas_part"); List identityList = uaIdentityService.query(uaIdentityEntity); if (CollectionUtils.isNotEmpty(identityList)){ @@ -108,7 +106,7 @@ public class InventoryService extends BaseService implem Integer id_num_add = uaIdentity.getiFatherId()+1;// +1 long max_id = 1000000000 + id_num_add;//前面拼接上1000000000 //更新最大编号 - uaIdentity.setCacc_id("002"); + uaIdentity.setCacc_id(entity.getCacc_id()); uaIdentity.setcVouchType("bas_part"); //最大号+1 UAIdentityEntity identity = new UAIdentityEntity();