Commit 3d47ca38 by 江和松

入实时库存不需要规格id,改为使用物料编号。

parent 566e9512
...@@ -27,7 +27,7 @@ import java.util.Map; ...@@ -27,7 +27,7 @@ import java.util.Map;
* @date:2024/5/9,11:04 * @date:2024/5/9,11:04
*/ */
public class ServiceHGKC001 extends ServiceBase { public class ServiceHGKC001 extends ServiceBase {
/** /**
* 画面初始化 * 画面初始化
* *
...@@ -49,7 +49,7 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -49,7 +49,7 @@ public class ServiceHGKC001 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 查询操作 * 查询操作
* *
...@@ -68,7 +68,7 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -68,7 +68,7 @@ public class ServiceHGKC001 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 保存操作. * 保存操作.
* *
...@@ -93,7 +93,7 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -93,7 +93,7 @@ public class ServiceHGKC001 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 数据校验 * 数据校验
* *
...@@ -107,7 +107,7 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -107,7 +107,7 @@ public class ServiceHGKC001 extends ServiceBase {
AssertUtils.isNull(dbCg004, String.format("入库单[%s]不存在", depositNo)); AssertUtils.isNull(dbCg004, String.format("入库单[%s]不存在", depositNo));
} }
} }
/** /**
* 数据保存 * 数据保存
* *
...@@ -119,7 +119,7 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -119,7 +119,7 @@ public class ServiceHGKC001 extends ServiceBase {
String depositNo = fCg004.getDepositNo(); String depositNo = fCg004.getDepositNo();
} }
} }
/** /**
* 删除操作. * 删除操作.
* *
...@@ -144,7 +144,7 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -144,7 +144,7 @@ public class ServiceHGKC001 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 数据校验 * 数据校验
* *
...@@ -158,7 +158,7 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -158,7 +158,7 @@ public class ServiceHGKC001 extends ServiceBase {
AssertUtils.isNull(dbCg004, String.format("入库单[%s]不存在", depositNo)); AssertUtils.isNull(dbCg004, String.format("入库单[%s]不存在", depositNo));
} }
} }
/** /**
* 数据保存 * 数据保存
* *
...@@ -172,11 +172,11 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -172,11 +172,11 @@ public class ServiceHGKC001 extends ServiceBase {
dbKc001.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode()); dbKc001.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGKC001.DELETE, dbKc001); DaoUtils.update(HGKC001.DELETE, dbKc001);
// 扣减库存 // 扣减库存
HGKCUtils.HgKc010.updateInv(dbKc001.getCompanyCode(), dbKc001.getWhCode(), dbKc001.getSpecId(), HGKCUtils.HgKc010.updateInv(dbKc001.getCompanyCode(), dbKc001.getWhCode(), dbKc001.getInventCode(),
dbKc001.getDepositQty().negate(), dbKc001.getDepositWeight().negate()); dbKc001.getDepositQty().negate(), dbKc001.getDepositWeight().negate());
// 更新收货单状态 // 更新收货单状态
HGCGTools.HgCg003.updateStatus(dbKc001.getReceiveNo(), HGConstant.CgReceiveStatus.S_2); HGCGTools.HgCg003.updateStatus(dbKc001.getReceiveNo(), HGConstant.CgReceiveStatus.S_2);
} }
} }
} }
...@@ -33,7 +33,7 @@ import java.util.Map; ...@@ -33,7 +33,7 @@ import java.util.Map;
* @date:2024/5/9,11:04 * @date:2024/5/9,11:04
*/ */
public class ServiceHGKC001A extends ServiceBase { public class ServiceHGKC001A extends ServiceBase {
/** /**
* 画面初始化 * 画面初始化
* *
...@@ -55,7 +55,7 @@ public class ServiceHGKC001A extends ServiceBase { ...@@ -55,7 +55,7 @@ public class ServiceHGKC001A extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 查询操作 * 查询操作
* *
...@@ -76,7 +76,7 @@ public class ServiceHGKC001A extends ServiceBase { ...@@ -76,7 +76,7 @@ public class ServiceHGKC001A extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 确认操作. * 确认操作.
* *
...@@ -101,7 +101,7 @@ public class ServiceHGKC001A extends ServiceBase { ...@@ -101,7 +101,7 @@ public class ServiceHGKC001A extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 数据校验 * 数据校验
* *
...@@ -118,7 +118,7 @@ public class ServiceHGKC001A extends ServiceBase { ...@@ -118,7 +118,7 @@ public class ServiceHGKC001A extends ServiceBase {
AssertUtils.isEmpty(fCg003A.getWhCode(), String.format("收货单号[%s]的仓库名称不能为空", dbCg003.getReceiveNo())); AssertUtils.isEmpty(fCg003A.getWhCode(), String.format("收货单号[%s]的仓库名称不能为空", dbCg003.getReceiveNo()));
} }
} }
/** /**
* 数据保存 * 数据保存
* *
...@@ -138,13 +138,14 @@ public class ServiceHGKC001A extends ServiceBase { ...@@ -138,13 +138,14 @@ public class ServiceHGKC001A extends ServiceBase {
newKc001.setDepositUnitWeight(dbCg003.getReceiveUnitWeight()); newKc001.setDepositUnitWeight(dbCg003.getReceiveUnitWeight());
newKc001.setDepositWeight(dbCg003.getDepositQty().multiply(dbCg003.getReceiveUnitWeight())); newKc001.setDepositWeight(dbCg003.getDepositQty().multiply(dbCg003.getReceiveUnitWeight()));
newKc001.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode()); newKc001.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
newKc001.setSpecId(dbCg003.getSpecId());
DaoUtils.insert(HGKC001.INSERT, newKc001); DaoUtils.insert(HGKC001.INSERT, newKc001);
// 更新库存数量 // 更新库存数量
HGKCUtils.HgKc010.updateInv(newKc001.getCompanyCode(), newKc001.getWhCode(), newKc001.getSpecId(), HGKCUtils.HgKc010.updateInv(newKc001.getCompanyCode(), newKc001.getWhCode(), newKc001.getInventCode(),
newKc001.getDepositQty(), newKc001.getDepositUnitWeight(), newKc001.getDepositWeight()); newKc001.getDepositQty(), newKc001.getDepositUnitWeight(), newKc001.getDepositWeight());
// 更新收货单状态 // 更新收货单状态
HGCGTools.HgCg003.updateStatus(receiveNo, HGConstant.CgReceiveStatus.S_5); HGCGTools.HgCg003.updateStatus(receiveNo, HGConstant.CgReceiveStatus.S_5);
} }
} }
} }
...@@ -29,7 +29,7 @@ import java.util.Map; ...@@ -29,7 +29,7 @@ import java.util.Map;
* @date:2024/1/25,23:19 * @date:2024/1/25,23:19
*/ */
public class ServiceHGKC002 extends ServiceBase { public class ServiceHGKC002 extends ServiceBase {
/** /**
* 画面初始化. * 画面初始化.
* *
...@@ -52,7 +52,7 @@ public class ServiceHGKC002 extends ServiceBase { ...@@ -52,7 +52,7 @@ public class ServiceHGKC002 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 查询操作 * 查询操作
* *
...@@ -71,7 +71,7 @@ public class ServiceHGKC002 extends ServiceBase { ...@@ -71,7 +71,7 @@ public class ServiceHGKC002 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 删除操作 * 删除操作
* *
...@@ -96,7 +96,7 @@ public class ServiceHGKC002 extends ServiceBase { ...@@ -96,7 +96,7 @@ public class ServiceHGKC002 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 删除检查 * 删除检查
* *
...@@ -111,7 +111,7 @@ public class ServiceHGKC002 extends ServiceBase { ...@@ -111,7 +111,7 @@ public class ServiceHGKC002 extends ServiceBase {
String.format("领用单【%s】已删除,请勿重复操作", reqNo)); String.format("领用单【%s】已删除,请勿重复操作", reqNo));
} }
} }
/** /**
* 删除数据 * 删除数据
* *
...@@ -132,9 +132,9 @@ public class ServiceHGKC002 extends ServiceBase { ...@@ -132,9 +132,9 @@ public class ServiceHGKC002 extends ServiceBase {
newKc002.setDeleteFlag(CommonConstant.YesNo.YES_1); newKc002.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.insert(HGKC002.INSERT, newKc002); DaoUtils.insert(HGKC002.INSERT, newKc002);
// 修改库存 // 修改库存
HGKCUtils.HgKc010.updateInv(dbKc002.getCompanyCode(), dbKc002.getWhCode(), dbKc002.getSpecId(), HGKCUtils.HgKc010.updateInv(dbKc002.getCompanyCode(), dbKc002.getWhCode(), dbKc002.getInventCode(),
dbKc002.getApplyQty(), dbKc002.getApplyWeight()); dbKc002.getApplyQty(), dbKc002.getApplyWeight());
} }
} }
} }
...@@ -137,7 +137,7 @@ public class ServiceHGKC002A extends ServiceEPBase { ...@@ -137,7 +137,7 @@ public class ServiceHGKC002A extends ServiceEPBase {
newKc002.setDeleteFlag(CommonConstant.YesNo.NO_0); newKc002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGKC002.INSERT, newKc002); DaoUtils.insert(HGKC002.INSERT, newKc002);
// 修改库存数量 // 修改库存数量
HGKCUtils.HgKc010.updateInv(dbKc010.getCompanyCode(), dbKc010.getWhCode(), dbKc010.getSpecId(), HGKCUtils.HgKc010.updateInv(dbKc010.getCompanyCode(), dbKc010.getWhCode(), dbKc010.getInventCode(),
applyQty.negate(), dbKc010.getInvUnitWeight(), newKc002.getApplyWeight().negate()); applyQty.negate(), dbKc010.getInvUnitWeight(), newKc002.getApplyWeight().negate());
} }
} }
......
...@@ -160,7 +160,7 @@ public class ServiceHGKC003 extends ServiceBase { ...@@ -160,7 +160,7 @@ public class ServiceHGKC003 extends ServiceBase {
//修改计划生产任务完工数量 //修改计划生产任务完工数量
HGSCTools.complete(hgkc003.getQualityId(),hgkc003.getInvQty().intValue(),hgkc003.getRectificationId()); HGSCTools.complete(hgkc003.getQualityId(),hgkc003.getInvQty().intValue(),hgkc003.getRectificationId());
// 修改库存 // 修改库存
HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPartSpecId(), HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPartCode(),
hgkc003.getInvQty(), hgkc003.getInvWeight()); hgkc003.getInvQty(), hgkc003.getInvWeight());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
...@@ -246,7 +246,7 @@ public class ServiceHGKC003 extends ServiceBase { ...@@ -246,7 +246,7 @@ public class ServiceHGKC003 extends ServiceBase {
//修改计划生产任务完工数量 //修改计划生产任务完工数量
HGSCTools.complete(fKc003.getQualityId(),newKc003.getInvQty().intValue(),fKc003.getRectificationId()); HGSCTools.complete(fKc003.getQualityId(),newKc003.getInvQty().intValue(),fKc003.getRectificationId());
// 修改库存 // 修改库存
HGKCUtils.HgKc010.updateInv(newKc003.getCompanyCode(), newKc003.getWhCode(), newKc003.getPartSpecId(), HGKCUtils.HgKc010.updateInv(newKc003.getCompanyCode(), newKc003.getWhCode(), newKc003.getPartCode(),
newKc003.getInvQty(), newKc003.getInvWeight()); newKc003.getInvQty(), newKc003.getInvWeight());
} }
......
...@@ -166,7 +166,7 @@ public class ServiceHGKC004 extends ServiceEPBase { ...@@ -166,7 +166,7 @@ public class ServiceHGKC004 extends ServiceEPBase {
if (hgkc004A.getPrice().compareTo(BigDecimal.ZERO)<=0 || hgkc004A.getAmount().compareTo(BigDecimal.ZERO)<=0){ if (hgkc004A.getPrice().compareTo(BigDecimal.ZERO)<=0 || hgkc004A.getAmount().compareTo(BigDecimal.ZERO)<=0){
throw new PlatException("单价和金额不能小于0!"); throw new PlatException("单价和金额不能小于0!");
} }
HGKC010 hgkc010 = HGKCTools.HgKc010.get(kc004.getCompanyCode(), kc004.getWhCode(), hgkc004A.getInventRecordId()); HGKC010 hgkc010 = HGKCTools.HgKc010.get(kc004.getCompanyCode(), kc004.getWhCode(), hgkc004A.getInventCode());
if (hgkc010 == null) { if (hgkc010 == null) {
throw new PlatException("库存不足!"); throw new PlatException("库存不足!");
} }
......
...@@ -178,7 +178,7 @@ public class ServiceHGKC005 extends ServiceEPBase { ...@@ -178,7 +178,7 @@ public class ServiceHGKC005 extends ServiceEPBase {
// 存货名称 // 存货名称
fKc005.setInventName(HGPZTools.HgPz005.getByCode(fKc005.getInventCode()).getInventName()); fKc005.setInventName(HGPZTools.HgPz005.getByCode(fKc005.getInventCode()).getInventName());
// 根据规格计算账面单重 // 根据规格计算账面单重
BigDecimal unitWeight = HGPZTools.HgPz005.calcUnitWeight(fKc005.getInventRecordId()); BigDecimal unitWeight = HGPZTools.HgPz005.calcUnitWeight(fKc005.getInventCode());
fKc005.setBookUnitWeight(unitWeight); fKc005.setBookUnitWeight(unitWeight);
fKc005.setEntityUnitWeight(unitWeight); fKc005.setEntityUnitWeight(unitWeight);
// 计算总重 // 计算总重
......
...@@ -176,7 +176,7 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -176,7 +176,7 @@ public class ServiceHGKC006 extends ServiceBase {
for(HGKC006A hgkc006A : hgkc006AList){ for(HGKC006A hgkc006A : hgkc006AList){
//增加库存 //增加库存
HGKCUtils.HgKc010.updateInv(hgkc006A.getCompanyCode(),hgkc006A.getWhCode(), HGKCUtils.HgKc010.updateInv(hgkc006A.getCompanyCode(),hgkc006A.getWhCode(),
hgkc006A.getPartSpecId(),hgkc006A.getInvQty(), hgkc006A.getPartCode(),hgkc006A.getInvQty(),
hgkc006A.getInvUnitWeight(),hgkc006A.getInvWeight()); hgkc006A.getInvUnitWeight(),hgkc006A.getInvWeight());
} }
} }
......
...@@ -176,7 +176,7 @@ public class ServiceHGKC007 extends ServiceBase { ...@@ -176,7 +176,7 @@ public class ServiceHGKC007 extends ServiceBase {
BigDecimal invWeight = hgkc007A.getInvWeight().multiply(new BigDecimal(-1)); BigDecimal invWeight = hgkc007A.getInvWeight().multiply(new BigDecimal(-1));
//减少库存 //减少库存
HGKCUtils.HgKc010.updateInv(hgkc007A.getCompanyCode(),hgkc007A.getWhCode(), HGKCUtils.HgKc010.updateInv(hgkc007A.getCompanyCode(),hgkc007A.getWhCode(),
hgkc007A.getPartSpecId(),qty, hgkc007A.getPartCode(),qty,
invUnitWeight,invWeight); invUnitWeight,invWeight);
} }
} }
......
...@@ -135,7 +135,7 @@ public class ServiceHGKC007A extends ServiceBase { ...@@ -135,7 +135,7 @@ public class ServiceHGKC007A extends ServiceBase {
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isNull(hgkc007a.getPrimaryId(), "未获取到其他出库单ID信息"); AssertUtils.isNull(hgkc007a.getPrimaryId(), "未获取到其他出库单ID信息");
HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgkc007a.getCompanyCode(),hgkc007a.getWhCode(),hgkc007a.getPartSpecId()); HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgkc007a.getCompanyCode(),hgkc007a.getWhCode(),hgkc007a.getPartCode());
if (hgkc010==null){ if (hgkc010==null){
throw new PlatException("实时库存不存在!"); throw new PlatException("实时库存不存在!");
} }
......
...@@ -136,7 +136,7 @@ public class ServiceHGKC008 extends ServiceBase { ...@@ -136,7 +136,7 @@ public class ServiceHGKC008 extends ServiceBase {
BigDecimal invWeight = hgkc008A.getInvWeight().multiply(new BigDecimal(-1)); BigDecimal invWeight = hgkc008A.getInvWeight().multiply(new BigDecimal(-1));
//增加库存 //增加库存
HGKCUtils.HgKc010.updateInv(hgkc008A.getCompanyCode(),hgkc008A.getWhCode(), HGKCUtils.HgKc010.updateInv(hgkc008A.getCompanyCode(),hgkc008A.getWhCode(),
hgkc008A.getInvSpecId(),qty, hgkc008A.getInventCode(),qty,
invUnitWeight,invWeight); invUnitWeight,invWeight);
} }
} }
......
...@@ -99,7 +99,7 @@ public class ServiceHGKC013A extends ServiceEPBase { ...@@ -99,7 +99,7 @@ public class ServiceHGKC013A extends ServiceEPBase {
Object object = this.dao.get(HGKC013.QUERY,HGKC010.FIELD_ID,parentId); Object object = this.dao.get(HGKC013.QUERY,HGKC010.FIELD_ID,parentId);
if (object!=null){ if (object!=null){
Map map1 = MapUtils.toMap(object); Map map1 = MapUtils.toMap(object);
HGKC010 hgkc010 = HGKCTools.HgKc010.get(map1.get(HGKC013.FIELD_COMPANY_CODE).toString(),map1.get(HGKC013.FIELD_CALLOUT_WH_CODE).toString(),hgkc013a.getInventRecordId()); HGKC010 hgkc010 = HGKCTools.HgKc010.get(map1.get(HGKC013.FIELD_COMPANY_CODE).toString(),map1.get(HGKC013.FIELD_CALLOUT_WH_CODE).toString(),hgkc013a.getInventCode());
if (hgkc010==null){ if (hgkc010==null){
throw new PlatException("实时库存不存在!"); throw new PlatException("实时库存不存在!");
} }
......
...@@ -703,30 +703,30 @@ public class HGKCTools { ...@@ -703,30 +703,30 @@ public class HGKCTools {
* @param specId * @param specId
* @return * @return
*/ */
public static void lock(String companyCode, String whCode, Long specId) { public static void lock(String companyCode, String whCode, String inventCode) {
if (StringUtils.isBlank(companyCode) || StringUtils.isBlank(whCode) || specId == null) { if (StringUtils.isBlank(companyCode) || StringUtils.isBlank(whCode) || StringUtils.isBlank(inventCode)) {
return; return;
} }
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("companyCode", companyCode); paramMap.put("companyCode", companyCode);
paramMap.put("whCode", whCode); paramMap.put("whCode", whCode);
paramMap.put("specId", specId); paramMap.put("inventCode", inventCode);
DaoBase.getInstance().update(HGSqlConstant.HgKc010.LOCK, paramMap); DaoBase.getInstance().update(HGSqlConstant.HgKc010.LOCK, paramMap);
} }
/** /**
* @param companyCode * @param companyCode
* @param whCode * @param whCode
* @param specId * @param inventCode
*/ */
public static HGKC010 get(String companyCode, String whCode, Long specId) { public static HGKC010 get(String companyCode, String whCode, String inventCode) {
AssertUtils.isEmpty(companyCode, "公司编码不能为空"); AssertUtils.isEmpty(companyCode, "公司编码不能为空");
AssertUtils.isEmpty(whCode, "仓库编码不能为空"); AssertUtils.isEmpty(whCode, "仓库编码不能为空");
AssertUtils.isTrue(specId == null || specId == 0, "规格ID不能为空"); AssertUtils.isEmpty(inventCode, "物料编码不能为空");
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("companyCode", companyCode); paramMap.put("companyCode", companyCode);
paramMap.put("whCode", whCode); paramMap.put("whCode", whCode);
paramMap.put("specId", specId); paramMap.put("inventCode", inventCode);
List<HGKC010> results = DaoBase.getInstance().query(HGKC010.QUERY, paramMap); List<HGKC010> results = DaoBase.getInstance().query(HGKC010.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
......
...@@ -218,13 +218,13 @@ public class HGKCUtils { ...@@ -218,13 +218,13 @@ public class HGKCUtils {
* *
* @param companyCode * @param companyCode
* @param whCode * @param whCode
* @param specId * @param inventCode
* @param qty * @param qty
* @param weight * @param weight
*/ */
public static void updateInv(String companyCode, String whCode, Long specId, BigDecimal qty, public static void updateInv(String companyCode, String whCode, String inventCode, BigDecimal qty,
BigDecimal weight) { BigDecimal weight) {
updateInv(companyCode, whCode, specId, qty, null, weight); updateInv(companyCode, whCode, inventCode, qty, null, weight);
} }
/** /**
...@@ -232,20 +232,20 @@ public class HGKCUtils { ...@@ -232,20 +232,20 @@ public class HGKCUtils {
* *
* @param companyCode * @param companyCode
* @param whCode * @param whCode
* @param specId * @param inventCode
* @param qty * @param qty
* @param unitWeight * @param unitWeight
* @param weight * @param weight
*/ */
public static void updateInv(String companyCode, String whCode, Long specId, BigDecimal qty, public static void updateInv(String companyCode, String whCode, String inventCode, BigDecimal qty,
BigDecimal unitWeight, BigDecimal weight) { BigDecimal unitWeight, BigDecimal weight) {
HGKC010 newKc010 = buildBean(companyCode, whCode, specId, qty, unitWeight, weight); HGKC010 newKc010 = buildBean(companyCode, whCode, inventCode, qty, unitWeight, weight);
// 参数校验 // 参数校验
checkUpdateInv(companyCode, whCode, specId, qty, weight); checkUpdateInv(companyCode, whCode, inventCode, qty, weight);
// 锁库存 // 锁库存
HGKCTools.HgKc010.lock(companyCode, whCode, specId); HGKCTools.HgKc010.lock(companyCode, whCode, inventCode);
// 获取DB数据 // 获取DB数据
HGKC010 dbKc010 = HGKCTools.HgKc010.get(companyCode, whCode, specId); HGKC010 dbKc010 = HGKCTools.HgKc010.get(companyCode, whCode, inventCode);
if (dbKc010 == null) { if (dbKc010 == null) {
addInvData(newKc010); addInvData(newKc010);
} else { } else {
...@@ -258,18 +258,18 @@ public class HGKCUtils { ...@@ -258,18 +258,18 @@ public class HGKCUtils {
* *
* @param companyCode * @param companyCode
* @param whCode * @param whCode
* @param specId * @param inventCode
* @param qty * @param qty
* @param unitWeight * @param unitWeight
* @param weight * @param weight
* @return * @return
*/ */
private static HGKC010 buildBean(String companyCode, String whCode, Long specId, BigDecimal qty, private static HGKC010 buildBean(String companyCode, String whCode, String inventCode, BigDecimal qty,
BigDecimal unitWeight, BigDecimal weight) { BigDecimal unitWeight, BigDecimal weight) {
HGKC010 newKc010 = new HGKC010(); HGKC010 newKc010 = new HGKC010();
newKc010.setCompanyCode(companyCode); newKc010.setCompanyCode(companyCode);
newKc010.setWhCode(whCode); newKc010.setWhCode(whCode);
newKc010.setSpecId(specId); newKc010.setInventCode(inventCode);
newKc010.setInvQty(qty); newKc010.setInvQty(qty);
newKc010.setInvUnitWeight(unitWeight); newKc010.setInvUnitWeight(unitWeight);
newKc010.setInvWeight(weight); newKc010.setInvWeight(weight);
...@@ -281,15 +281,15 @@ public class HGKCUtils { ...@@ -281,15 +281,15 @@ public class HGKCUtils {
* *
* @param companyCode * @param companyCode
* @param whCode * @param whCode
* @param specId * @param inventCode
* @param qty * @param qty
* @param weight * @param weight
*/ */
private static void checkUpdateInv(String companyCode, String whCode, Long specId, BigDecimal qty, private static void checkUpdateInv(String companyCode, String whCode, String inventCode, BigDecimal qty,
BigDecimal weight) { BigDecimal weight) {
AssertUtils.isEmpty(companyCode, "公司编码不能为空"); AssertUtils.isEmpty(companyCode, "公司编码不能为空");
AssertUtils.isEmpty(whCode, "仓库编码不能为空"); AssertUtils.isEmpty(whCode, "仓库编码不能为空");
AssertUtils.isTrue(specId == null || specId == 0, "规格ID不能为空"); AssertUtils.isEmpty(inventCode, "物料编码不能为空");
AssertUtils.isNull(qty, "库存变更数量不能为空"); AssertUtils.isNull(qty, "库存变更数量不能为空");
AssertUtils.isNull(weight, "库存变更重量不能为空"); AssertUtils.isNull(weight, "库存变更重量不能为空");
AssertUtils.isTrue(qty.compareTo(BigDecimal.ZERO) == 0 AssertUtils.isTrue(qty.compareTo(BigDecimal.ZERO) == 0
...@@ -307,7 +307,7 @@ public class HGKCUtils { ...@@ -307,7 +307,7 @@ public class HGKCUtils {
// 仓库 // 仓库
newKc010.setWhName(HGPZTools.HgPz007.get(newKc010.getWhCode()).getWhName()); newKc010.setWhName(HGPZTools.HgPz007.get(newKc010.getWhCode()).getWhName());
// 规格 // 规格
HGPZ005 dbPz005 = HGPZTools.HgPz005.get(newKc010.getSpecId()); HGPZ005 dbPz005 = HGPZTools.HgPz005.get(newKc010.getInventCode());
newKc010.setInventType(dbPz005.getInventType()); newKc010.setInventType(dbPz005.getInventType());
newKc010.setInventCode(dbPz005.getInventCode()); newKc010.setInventCode(dbPz005.getInventCode());
newKc010.setInventName(dbPz005.getInventName()); newKc010.setInventName(dbPz005.getInventName());
......
...@@ -235,12 +235,12 @@ public class HGPZTools { ...@@ -235,12 +235,12 @@ public class HGPZTools {
*/ */
public static class HgPz005 { public static class HgPz005 {
public static HGPZ005 get(Long id) { public static HGPZ005 get(String inventCode) {
AssertUtils.isNull(id, "规格ID不能为空"); AssertUtils.isNull(inventCode, "物料编码不能为空");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("id", id); queryMap.put("inventCode", inventCode);
List<HGPZ005> results = DaoBase.getInstance().query(HGPZ005.QUERY, queryMap); List<HGPZ005> results = DaoBase.getInstance().query(HGPZ005.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("规格[%s]不存在", id)); AssertUtils.isEmpty(results, String.format("物料编码[%s]不存在", inventCode));
return results.get(0); return results.get(0);
} }
...@@ -391,11 +391,11 @@ public class HGPZTools { ...@@ -391,11 +391,11 @@ public class HGPZTools {
/** /**
* 计算单重 * 计算单重
* *
* @param id * @param inventCode
* @return * @return
*/ */
public static BigDecimal calcUnitWeight(Long id) { public static BigDecimal calcUnitWeight(String inventCode) {
HGPZ005 hgpz005 = get(id); HGPZ005 hgpz005 = get(inventCode);
return calcUnitWeight(hgpz005); return calcUnitWeight(hgpz005);
} }
...@@ -567,11 +567,11 @@ public class HGPZTools { ...@@ -567,11 +567,11 @@ public class HGPZTools {
*/ */
public static void setSpecInfo(DaoEPBase bean, String keyName) { public static void setSpecInfo(DaoEPBase bean, String keyName) {
try { try {
String inventRecordId = BeanUtils.getProperty(bean, keyName); String inventCode = BeanUtils.getProperty(bean, keyName);
if (StringUtils.isBlank(inventRecordId)) { if (StringUtils.isBlank(inventCode)) {
return; return;
} }
HGPZ005 dbPz06 = get(Long.parseLong(inventRecordId)); HGPZ005 dbPz06 = get(inventCode);
BeanUtils.setProperty(bean, HGPZ005.FIELD_SPEC, dbPz06.getSpec()); BeanUtils.setProperty(bean, HGPZ005.FIELD_SPEC, dbPz06.getSpec());
BeanUtils.setProperty(bean, HGPZ005.FIELD_LENGTH, dbPz06.getLength()); BeanUtils.setProperty(bean, HGPZ005.FIELD_LENGTH, dbPz06.getLength());
BeanUtils.setProperty(bean, HGPZ005.FIELD_WIDTH, dbPz06.getWidth()); BeanUtils.setProperty(bean, HGPZ005.FIELD_WIDTH, dbPz06.getWidth());
......
...@@ -110,7 +110,7 @@ public class ServiceHGYX001 extends ServiceEPBase { ...@@ -110,7 +110,7 @@ public class ServiceHGYX001 extends ServiceEPBase {
HGYX001A hgyx001A = new HGYX001A(); HGYX001A hgyx001A = new HGYX001A();
hgyx001A.fromMap(resultRow); hgyx001A.fromMap(resultRow);
hgyx001A.setParentId(hgyx001.getId()); hgyx001A.setParentId(hgyx001.getId());
HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgyx001.getCompanyCode(), hgyx001.getConsWhCode(), hgyx001A.getInventRecordId()); HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgyx001.getCompanyCode(), hgyx001.getConsWhCode(), hgyx001A.getInventCode());
if (hgkc010 == null) { if (hgkc010 == null) {
throw new PlatException("库存不足!"); throw new PlatException("库存不足!");
} }
...@@ -127,7 +127,7 @@ public class ServiceHGYX001 extends ServiceEPBase { ...@@ -127,7 +127,7 @@ public class ServiceHGYX001 extends ServiceEPBase {
HGYX001A hgyx001A = new HGYX001A(); HGYX001A hgyx001A = new HGYX001A();
hgyx001A.fromMap(resultRow); hgyx001A.fromMap(resultRow);
hgyx001A.setParentId(hgyx001.getId()); hgyx001A.setParentId(hgyx001.getId());
HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgyx001.getCompanyCode(), hgyx001.getConsWhCode(), hgyx001A.getInventRecordId()); HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgyx001.getCompanyCode(), hgyx001.getConsWhCode(), hgyx001A.getInventCode());
if (hgkc010 == null) { if (hgkc010 == null) {
throw new PlatException("库存不足!"); throw new PlatException("库存不足!");
} }
...@@ -254,7 +254,7 @@ public class ServiceHGYX001 extends ServiceEPBase { ...@@ -254,7 +254,7 @@ public class ServiceHGYX001 extends ServiceEPBase {
*/ */
public void addHGKC004A(List<HGYX001A> hgyx001As, HGKC004 hgkc004) { public void addHGKC004A(List<HGYX001A> hgyx001As, HGKC004 hgkc004) {
for (HGYX001A hgyx001A : hgyx001As) { for (HGYX001A hgyx001A : hgyx001As) {
HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgkc004.getCompanyCode(), hgkc004.getWhCode(), hgyx001A.getInventRecordId()); HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgkc004.getCompanyCode(), hgkc004.getWhCode(), hgyx001A.getInventCode());
if (hgkc010 == null) { if (hgkc010 == null) {
throw new PlatException("库存不足!"); throw new PlatException("库存不足!");
} }
...@@ -300,7 +300,7 @@ public class ServiceHGYX001 extends ServiceEPBase { ...@@ -300,7 +300,7 @@ public class ServiceHGYX001 extends ServiceEPBase {
HGYX001A hgyx001A = new HGYX001A(); HGYX001A hgyx001A = new HGYX001A();
hgyx001A.fromMap(resultRow); hgyx001A.fromMap(resultRow);
hgyx001A.setParentId(hgyx001.getId()); hgyx001A.setParentId(hgyx001.getId());
HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgyx001.getCompanyCode(), hgyx001.getConsWhCode(), hgyx001A.getInventRecordId()); HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgyx001.getCompanyCode(), hgyx001.getConsWhCode(), hgyx001A.getInventCode());
if (hgkc010 == null) { if (hgkc010 == null) {
throw new PlatException("库存不足!"); throw new PlatException("库存不足!");
} }
...@@ -319,7 +319,7 @@ public class ServiceHGYX001 extends ServiceEPBase { ...@@ -319,7 +319,7 @@ public class ServiceHGYX001 extends ServiceEPBase {
HGYX001A hgyx001A = new HGYX001A(); HGYX001A hgyx001A = new HGYX001A();
hgyx001A.fromMap(resultRow); hgyx001A.fromMap(resultRow);
hgyx001A.setParentId(hgyx001.getId()); hgyx001A.setParentId(hgyx001.getId());
HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgyx001.getCompanyCode(), hgyx001.getConsWhCode(), hgyx001A.getInventRecordId()); HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgyx001.getCompanyCode(), hgyx001.getConsWhCode(), hgyx001A.getInventCode());
if (hgkc010 == null) { if (hgkc010 == null) {
throw new PlatException("库存不足!"); throw new PlatException("库存不足!");
} }
......
...@@ -32,7 +32,7 @@ import java.util.Map; ...@@ -32,7 +32,7 @@ import java.util.Map;
* @date:2022/7/11,11:08 * @date:2022/7/11,11:08
*/ */
public class ServiceHGZL001B extends ServiceEPBase { public class ServiceHGZL001B extends ServiceEPBase {
/** /**
* 初始化 * 初始化
* *
...@@ -53,7 +53,7 @@ public class ServiceHGZL001B extends ServiceEPBase { ...@@ -53,7 +53,7 @@ public class ServiceHGZL001B extends ServiceEPBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 查询数据列表 * 查询数据列表
* *
...@@ -65,14 +65,14 @@ public class ServiceHGZL001B extends ServiceEPBase { ...@@ -65,14 +65,14 @@ public class ServiceHGZL001B extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGCG003.FIELD_STATUS, HGConstant.CgReceiveStatus.S_2); queryMap.put(HGCG003.FIELD_STATUS, HGConstant.CgReceiveStatus.S_0);
inInfo = super.query(inInfo, HGCG003.QUERY, new HGCG003()); inInfo = super.query(inInfo, HGCG003.QUERY, new HGCG003());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
return inInfo; return inInfo;
} }
/** /**
* 生成巡检单 * 生成巡检单
* *
...@@ -93,7 +93,7 @@ public class ServiceHGZL001B extends ServiceEPBase { ...@@ -93,7 +93,7 @@ public class ServiceHGZL001B extends ServiceEPBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 校验数据 * 校验数据
* *
...@@ -104,11 +104,11 @@ public class ServiceHGZL001B extends ServiceEPBase { ...@@ -104,11 +104,11 @@ public class ServiceHGZL001B extends ServiceEPBase {
for (HGCG003 fCg003 : fCg003s) { for (HGCG003 fCg003 : fCg003s) {
String receiveNo = fCg003.getReceiveNo(); String receiveNo = fCg003.getReceiveNo();
HGCG003 dbSc003 = dbCg003Map.get(fCg003.getReceiveNo()); HGCG003 dbSc003 = dbCg003Map.get(fCg003.getReceiveNo());
AssertUtils.isNotEquals(HGConstant.CgReceiveStatus.S_2, dbSc003.getStatus(), AssertUtils.isNotEquals(HGConstant.CgReceiveStatus.S_0, dbSc003.getStatus(),
String.format("采购收货单[%s]状态不是\"已收货\",不允许操作", receiveNo)); String.format("采购收货单[%s]状态不是\"待确认\",不允许操作", receiveNo));
} }
} }
/** /**
* 保存数据 * 保存数据
* *
...@@ -130,5 +130,5 @@ public class ServiceHGZL001B extends ServiceEPBase { ...@@ -130,5 +130,5 @@ public class ServiceHGZL001B extends ServiceEPBase {
HGCGTools.HgCg003.updateStatus(receiveNo, HGConstant.CgReceiveStatus.S_3); HGCGTools.HgCg003.updateStatus(receiveNo, HGConstant.CgReceiveStatus.S_3);
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment