diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml index 812d8174..bb6bacf6 100644 --- a/base-buildpackage/pom.xml +++ b/base-buildpackage/pom.xml @@ -49,7 +49,12 @@ zqtlocal - + + xel + + xel + + kangarooDataCenterV3 diff --git a/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/entity/UAIdentityEntity.xml b/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/entity/UAIdentityEntity.xml index 559b0034..6851c9b8 100644 --- a/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/entity/UAIdentityEntity.xml +++ b/fw-u8/src/main/java/com/hzya/frame/u8/base/identity/entity/UAIdentityEntity.xml @@ -23,7 +23,7 @@ from UFSystem.UA_Identity where id = #{ id } - + + - + 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 7028910a..9dab5a08 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 @@ -1,7 +1,7 @@ - - + + @@ -783,7 +783,7 @@ - select from Inventory @@ -1044,14 +1044,11 @@ and bCheckBatch = #{bCheckBatch} and bMngOldpart = #{bMngOldpart} and iOldpartMngRule = #{iOldpartMngRule} - and sts='Y' - order by id desc - order by ${sort} ${order} - select count(1) from Inventory cInvCode = #{cInvCode} @@ -1317,7 +1314,7 @@ - select from Inventory @@ -1585,7 +1582,7 @@ - select from Inventory @@ -1852,7 +1849,7 @@ order by ${sort} ${order} - + insert into Inventory( cInvCode, @@ -2110,10 +2107,7 @@ iAllocatePrintDgt, bCheckBatch, bMngOldpart, - iOldpartMngRule, - create_time, - modify_time, - sts + iOldpartMngRule )values ( @@ -2373,21 +2367,14 @@ #{iAllocatePrintDgt}, #{bCheckBatch}, #{bMngOldpart}, - #{iOldpartMngRule}, - #{create_time} , - now(), - #{modify_time}, - now(), - 'Y' + #{iOldpartMngRule} ) - - SELECT REPLACE(UUID(),'-','') as id - + - + update Inventory set cInvCode = #{cInvCode}, @@ -2645,286 +2632,9 @@ iAllocatePrintDgt = #{iAllocatePrintDgt}, bCheckBatch = #{bCheckBatch}, bMngOldpart = #{bMngOldpart}, - iOldpartMngRule = #{iOldpartMngRule}, - modify_time =#{modify_time} - modify_time = now() + iOldpartMngRule = #{iOldpartMngRule} - where id = #{id} + where cInvCode = #{cInvCode} - - - update Inventory set - sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where - id = #{id} - - - - - update Inventory set - sts='N',modify_time = now(),modify_user_id = #{modify_user_id} - - cInvCode = #{cInvCode} - and cInvAddCode = #{cInvAddCode} - and cInvName = #{cInvName} - and cInvStd = #{cInvStd} - and cInvCCode = #{cInvCCode} - and cVenCode = #{cVenCode} - and cReplaceItem = #{cReplaceItem} - and cPosition = #{cPosition} - and bSale = #{bSale} - and bPurchase = #{bPurchase} - and bSelf = #{bSelf} - and bComsume = #{bComsume} - and bProducing = #{bProducing} - and bService = #{bService} - and bAccessary = #{bAccessary} - and iTaxRate = #{iTaxRate} - and iInvWeight = #{iInvWeight} - and iVolume = #{iVolume} - and iInvRCost = #{iInvRCost} - and iInvSPrice = #{iInvSPrice} - and iInvSCost = #{iInvSCost} - and iInvLSCost = #{iInvLSCost} - and iInvNCost = #{iInvNCost} - and iInvAdvance = #{iInvAdvance} - and iInvBatch = #{iInvBatch} - and iSafeNum = #{iSafeNum} - and iTopSum = #{iTopSum} - and iLowSum = #{iLowSum} - and iOverStock = #{iOverStock} - and cInvABC = #{cInvABC} - and bInvQuality = #{bInvQuality} - and bInvBatch = #{bInvBatch} - and bInvEntrust = #{bInvEntrust} - and bInvOverStock = #{bInvOverStock} - and dSDate = #{dSDate} - and dEDate = #{dEDate} - and bFree1 = #{bFree1} - and bFree2 = #{bFree2} - and cInvDefine1 = #{cInvDefine1} - and cInvDefine2 = #{cInvDefine2} - and cInvDefine3 = #{cInvDefine3} - and I_id = #{I_id} - and bInvType = #{bInvType} - and iInvMPCost = #{iInvMPCost} - and cQuality = #{cQuality} - and iInvSaleCost = #{iInvSaleCost} - and iInvSCost1 = #{iInvSCost1} - and iInvSCost2 = #{iInvSCost2} - and iInvSCost3 = #{iInvSCost3} - and bFree3 = #{bFree3} - and bFree4 = #{bFree4} - and bFree5 = #{bFree5} - and bFree6 = #{bFree6} - and bFree7 = #{bFree7} - and bFree8 = #{bFree8} - and bFree9 = #{bFree9} - and bFree10 = #{bFree10} - and cCreatePerson = #{cCreatePerson} - and cModifyPerson = #{cModifyPerson} - and dModifyDate = #{dModifyDate} - and fSubscribePoint = #{fSubscribePoint} - and fVagQuantity = #{fVagQuantity} - and cValueType = #{cValueType} - and bFixExch = #{bFixExch} - and fOutExcess = #{fOutExcess} - and fInExcess = #{fInExcess} - and iMassDate = #{iMassDate} - and iWarnDays = #{iWarnDays} - and fExpensesExch = #{fExpensesExch} - and bTrack = #{bTrack} - and bSerial = #{bSerial} - and bBarCode = #{bBarCode} - and iId = #{iId} - and cBarCode = #{cBarCode} - and cInvDefine4 = #{cInvDefine4} - and cInvDefine5 = #{cInvDefine5} - and cInvDefine6 = #{cInvDefine6} - and cInvDefine7 = #{cInvDefine7} - and cInvDefine8 = #{cInvDefine8} - and cInvDefine9 = #{cInvDefine9} - and cInvDefine10 = #{cInvDefine10} - and cInvDefine11 = #{cInvDefine11} - and cInvDefine12 = #{cInvDefine12} - and cInvDefine13 = #{cInvDefine13} - and cInvDefine14 = #{cInvDefine14} - and cInvDefine15 = #{cInvDefine15} - and cInvDefine16 = #{cInvDefine16} - and iGroupType = #{iGroupType} - and cGroupCode = #{cGroupCode} - and cComUnitCode = #{cComUnitCode} - and cAssComUnitCode = #{cAssComUnitCode} - and cSAComUnitCode = #{cSAComUnitCode} - and cPUComUnitCode = #{cPUComUnitCode} - and cSTComUnitCode = #{cSTComUnitCode} - and cCAComUnitCode = #{cCAComUnitCode} - and cFrequency = #{cFrequency} - and iFrequency = #{iFrequency} - and iDays = #{iDays} - and dLastDate = #{dLastDate} - and iWastage = #{iWastage} - and bSolitude = #{bSolitude} - and cEnterprise = #{cEnterprise} - and cAddress = #{cAddress} - and cFile = #{cFile} - and cLabel = #{cLabel} - and cCheckOut = #{cCheckOut} - and cLicence = #{cLicence} - and bSpecialties = #{bSpecialties} - and cDefWareHouse = #{cDefWareHouse} - and iHighPrice = #{iHighPrice} - and iExpSaleRate = #{iExpSaleRate} - and cPriceGroup = #{cPriceGroup} - and cOfferGrade = #{cOfferGrade} - and iOfferRate = #{iOfferRate} - and cMonth = #{cMonth} - and iAdvanceDate = #{iAdvanceDate} - and cCurrencyName = #{cCurrencyName} - and cProduceAddress = #{cProduceAddress} - and cProduceNation = #{cProduceNation} - and cRegisterNo = #{cRegisterNo} - and cEnterNo = #{cEnterNo} - and cPackingType = #{cPackingType} - and cEnglishName = #{cEnglishName} - and bPropertyCheck = #{bPropertyCheck} - and cPreparationType = #{cPreparationType} - and cCommodity = #{cCommodity} - and iRecipeBatch = #{iRecipeBatch} - and cNotPatentName = #{cNotPatentName} - and pubufts = #{pubufts} - and bPromotSales = #{bPromotSales} - and iPlanPolicy = #{iPlanPolicy} - and iROPMethod = #{iROPMethod} - and iBatchRule = #{iBatchRule} - and fBatchIncrement = #{fBatchIncrement} - and iAssureProvideDays = #{iAssureProvideDays} - and iTestStyle = #{iTestStyle} - and iDTMethod = #{iDTMethod} - and fDTRate = #{fDTRate} - and fDTNum = #{fDTNum} - and cDTUnit = #{cDTUnit} - and iDTStyle = #{iDTStyle} - and iQTMethod = #{iQTMethod} - and PictureGUID = #{PictureGUID} - and bPlanInv = #{bPlanInv} - and bProxyForeign = #{bProxyForeign} - and bATOModel = #{bATOModel} - and bCheckItem = #{bCheckItem} - and bPTOModel = #{bPTOModel} - and bEquipment = #{bEquipment} - and cProductUnit = #{cProductUnit} - and fOrderUpLimit = #{fOrderUpLimit} - and cMassUnit = #{cMassUnit} - and fRetailPrice = #{fRetailPrice} - and cInvDepCode = #{cInvDepCode} - and iAlterAdvance = #{iAlterAdvance} - and fAlterBaseNum = #{fAlterBaseNum} - and cPlanMethod = #{cPlanMethod} - and bMPS = #{bMPS} - and bROP = #{bROP} - and bRePlan = #{bRePlan} - and cSRPolicy = #{cSRPolicy} - and bBillUnite = #{bBillUnite} - and iSupplyDay = #{iSupplyDay} - and fSupplyMulti = #{fSupplyMulti} - and fMinSupply = #{fMinSupply} - and bCutMantissa = #{bCutMantissa} - and cInvPersonCode = #{cInvPersonCode} - and iInvTfId = #{iInvTfId} - and cEngineerFigNo = #{cEngineerFigNo} - and bInTotalCost = #{bInTotalCost} - and iSupplyType = #{iSupplyType} - and bConfigFree1 = #{bConfigFree1} - and bConfigFree2 = #{bConfigFree2} - and bConfigFree3 = #{bConfigFree3} - and bConfigFree4 = #{bConfigFree4} - and bConfigFree5 = #{bConfigFree5} - and bConfigFree6 = #{bConfigFree6} - and bConfigFree7 = #{bConfigFree7} - and bConfigFree8 = #{bConfigFree8} - and bConfigFree9 = #{bConfigFree9} - and bConfigFree10 = #{bConfigFree10} - and iDTLevel = #{iDTLevel} - and cDTAQL = #{cDTAQL} - and bPeriodDT = #{bPeriodDT} - and cDTPeriod = #{cDTPeriod} - and iBigMonth = #{iBigMonth} - and iBigDay = #{iBigDay} - and iSmallMonth = #{iSmallMonth} - and iSmallDay = #{iSmallDay} - and bOutInvDT = #{bOutInvDT} - and bBackInvDT = #{bBackInvDT} - and iEndDTStyle = #{iEndDTStyle} - and bDTWarnInv = #{bDTWarnInv} - and fBackTaxRate = #{fBackTaxRate} - and cCIQCode = #{cCIQCode} - and cWGroupCode = #{cWGroupCode} - and cWUnit = #{cWUnit} - and fGrossW = #{fGrossW} - and cVGroupCode = #{cVGroupCode} - and cVUnit = #{cVUnit} - and fLength = #{fLength} - and fWidth = #{fWidth} - and fHeight = #{fHeight} - and iDTUCounter = #{iDTUCounter} - and iDTDCounter = #{iDTDCounter} - and iBatchCounter = #{iBatchCounter} - and cShopUnit = #{cShopUnit} - and cPurPersonCode = #{cPurPersonCode} - and bImportMedicine = #{bImportMedicine} - and bFirstBusiMedicine = #{bFirstBusiMedicine} - and bForeExpland = #{bForeExpland} - and cInvPlanCode = #{cInvPlanCode} - and fConvertRate = #{fConvertRate} - and dReplaceDate = #{dReplaceDate} - and bInvModel = #{bInvModel} - and bKCCutMantissa = #{bKCCutMantissa} - and bReceiptByDT = #{bReceiptByDT} - and iImpTaxRate = #{iImpTaxRate} - and iExpTaxRate = #{iExpTaxRate} - and bExpSale = #{bExpSale} - and iDrawBatch = #{iDrawBatch} - and bCheckBSATP = #{bCheckBSATP} - and cInvProjectCode = #{cInvProjectCode} - and iTestRule = #{iTestRule} - and cRuleCode = #{cRuleCode} - and bCheckFree1 = #{bCheckFree1} - and bCheckFree2 = #{bCheckFree2} - and bCheckFree3 = #{bCheckFree3} - and bCheckFree4 = #{bCheckFree4} - and bCheckFree5 = #{bCheckFree5} - and bCheckFree6 = #{bCheckFree6} - and bCheckFree7 = #{bCheckFree7} - and bCheckFree8 = #{bCheckFree8} - and bCheckFree9 = #{bCheckFree9} - and bCheckFree10 = #{bCheckFree10} - and bBomMain = #{bBomMain} - and bBomSub = #{bBomSub} - and bProductBill = #{bProductBill} - and iCheckATP = #{iCheckATP} - and iInvATPId = #{iInvATPId} - and iPlanTfDay = #{iPlanTfDay} - and iOverlapDay = #{iOverlapDay} - and bPiece = #{bPiece} - and bSrvItem = #{bSrvItem} - and bSrvFittings = #{bSrvFittings} - and fMaxSupply = #{fMaxSupply} - and fMinSplit = #{fMinSplit} - and bSpecialOrder = #{bSpecialOrder} - and bTrackSaleBill = #{bTrackSaleBill} - and cInvMnemCode = #{cInvMnemCode} - and iPlanDefault = #{iPlanDefault} - and iPFBatchQty = #{iPFBatchQty} - and iAllocatePrintDgt = #{iAllocatePrintDgt} - and bCheckBatch = #{bCheckBatch} - and bMngOldpart = #{bMngOldpart} - and iOldpartMngRule = #{iOldpartMngRule} - - - - - - delete from Inventory where id =#{id} - 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 5da1ee2d..a50e042d 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 @@ -1,6 +1,8 @@ package com.hzya.frame.u8.base.inventory.service.impl; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.basedao.service.impl.BaseService; import com.hzya.frame.serviceUtil.ServiceUtil; @@ -13,6 +15,7 @@ import com.hzya.frame.u8.base.inventory.entity.InventorySubEntity; import com.hzya.frame.u8.base.inventory.service.IBasPartService; import com.hzya.frame.u8.base.inventory.service.IInventoryService; import com.hzya.frame.u8.base.inventory.service.IInventorySubService; +import com.hzya.frame.web.exception.BaseSystemException; import org.apache.commons.collections.CollectionUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -20,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; +import java.util.function.Supplier; /** * @Description @@ -67,6 +71,7 @@ public class InventoryService extends BaseService implem @DS("#entity.dataSourceCode") @Override public void saveInventory(InventoryEntity entity) throws Exception { + checkInventory("save",entity); //保存存货信息 inventoryDao.save(entity); //保存子表数据 @@ -86,22 +91,37 @@ public class InventoryService extends BaseService implem subService.update(subEntity); } //保存自定义表 + //先查一下bas_part有没有 BasPartEntity part = new BasPartEntity(); part.setInvCode(entity.getcInvCode()); - //先查一下有没有保存过 List partList = basPartService.query(part); if (CollectionUtils.isEmpty(partList)){ - //查最大流水号 - UAIdentityEntity uaidenIdentity = uaIdentityService.queryMaxSaleOrderId("", "bas_part"); - if (null != uaidenIdentity){ - BasPartEntity basPartEntity = new BasPartEntity(); - basPartEntity.setInvCode(entity.getcInvCode()); - Integer id_num_add = uaidenIdentity.getiFatherId()+1;// +1 - long max_id = 1000000000 + id_num_add;//前面拼接上1000000000 - //更新最大编号 - uaidenIdentity.setCacc_id("002"); - uaidenIdentity.setcVouchType("bas_part"); - uaIdentityService.updateMaxSaleOrderId(uaidenIdentity); + UAIdentityEntity uaIdentityEntity = new UAIdentityEntity(); + uaIdentityEntity.setCacc_id("002"); + uaIdentityEntity.setcVouchType("bas_part"); + List identityList = uaIdentityService.query(uaIdentityEntity); + if (CollectionUtils.isNotEmpty(identityList)){ + UAIdentityEntity uaIdentity = identityList.get(0); + if (null != uaIdentity){ + BasPartEntity basPartEntity = new BasPartEntity(); + basPartEntity.setInvCode(entity.getcInvCode()); + Integer id_num_add = uaIdentity.getiFatherId()+1;// +1 + long max_id = 1000000000 + id_num_add;//前面拼接上1000000000 + //更新最大编号 + uaIdentity.setCacc_id("002"); + uaIdentity.setcVouchType("bas_part"); + //最大号+1 + UAIdentityEntity identity = new UAIdentityEntity(); + identity.setCacc_id(uaIdentity.getCacc_id()); + identity.setcVouchType(uaIdentity.getcVouchType()); + identity.setiFatherId(uaIdentity.getiFatherId()); + identity.setiChildId(uaIdentity.getiChildId()); + uaIdentityService.updateMaxSaleOrderId(identity); + basPartEntity.setPartId(String.valueOf(max_id)); + basPartEntity.setInvCode(entity.getcInvCode()); + logger.info("======物料编码"+entity.getcInvCode()+",生成的bas_part最大id"+max_id); + basPartService.save(basPartEntity); + } } } } @@ -115,6 +135,25 @@ public class InventoryService extends BaseService implem @DS("#entity.dataSourceCode") @Override public void updateInventory(InventoryEntity entity) throws Exception { + checkInventory("update",entity); + inventoryDao.update(entity); + } + /** + * 必填校验 + * @param type + * @param entity + */ + private void checkInventory(String type,InventoryEntity entity){ + Assert.notNull(entity,()-> new BaseSystemException("参数不能为空")); + Assert.notEmpty(entity.getcInvCode(),()-> new BaseSystemException("存货编码不能为空")); + Assert.notEmpty(entity.getDataSourceCode(),()-> new BaseSystemException("数据源编码不能为空")); + Assert.notEmpty(entity.getAcc_name(),()-> new BaseSystemException("账套号不能为空")); + switch (type) { + case "save": + break; + case "update": + break; + } } }