设置帐套号、数据源编码

This commit is contained in:
xiang2lin 2025-03-26 15:51:59 +08:00
parent fa16abe4fb
commit e19c941b44
1 changed files with 9 additions and 0 deletions

View File

@ -81,6 +81,7 @@ public class InventoryService extends BaseService<InventoryEntity,String> implem
subEntity.setPlanCheckDay("0");//计划检验天数
subEntity.setdInvCreateDatetime(DateUtil.now());//建档日期
subEntity.setiDrawType("0");//领料方式 0是直接领用1是申请领用
subEntity.setAcc_name(entity.getAcc_name());
//检查子表有没有保存过
List<InventorySubEntity> subEntityList = subService.query(subEntity);
if (CollectionUtils.isEmpty(subEntityList)){
@ -92,11 +93,15 @@ public class InventoryService extends BaseService<InventoryEntity,String> implem
//先查一下bas_part有没有
BasPartEntity part = new BasPartEntity();
part.setInvCode(entity.getcInvCode());
part.setDataSourceCode(entity.getDataSourceCode());
part.setAcc_name(entity.getAcc_name());
List<BasPartEntity> partList = basPartService.query(part);
if (CollectionUtils.isEmpty(partList)){
UAIdentityEntity uaIdentityEntity = new UAIdentityEntity();
uaIdentityEntity.setCacc_id(entity.getCacc_id());
uaIdentityEntity.setcVouchType("bas_part");
uaIdentityEntity.setDataSourceCode(entity.getDataSourceCode());
uaIdentityEntity.setAcc_name(entity.getAcc_name());
List<UAIdentityEntity> identityList = uaIdentityService.query(uaIdentityEntity);
if (CollectionUtils.isNotEmpty(identityList)){
UAIdentityEntity uaIdentity = identityList.get(0);
@ -114,10 +119,14 @@ public class InventoryService extends BaseService<InventoryEntity,String> implem
identity.setcVouchType(uaIdentity.getcVouchType());
identity.setiFatherId(uaIdentity.getiFatherId());
identity.setiChildId(uaIdentity.getiChildId());
identity.setDataSourceCode(entity.getDataSourceCode());
identity.setAcc_name(entity.getAcc_name());
uaIdentityService.updateMaxSaleOrderId(identity);
basPartEntity.setPartId(String.valueOf(max_id));
basPartEntity.setInvCode(entity.getcInvCode());
basPartEntity.setDataSourceCode(entity.getDataSourceCode());
logger.info("======物料编码"+entity.getcInvCode()+"生成的bas_part最大id"+max_id);
basPartEntity.setAcc_name(entity.getAcc_name());
basPartService.save(basPartEntity);
}
}