Commit aa615ddf by liuyang

2024/03/20 生产任务关联通过厂区查询产品库存

parent 7a68f07b
......@@ -116,7 +116,7 @@ public class ServiceHPKC003 extends ServiceBase {
HPSCTools.HpSc005a.updateCompleteNum(newKc003.getProdTaskNo(), newKc003.getAmount());
// 修改库存
HPKCTools.updateProdStock(newKc003.getWhCode(), newKc003.getProdOrderNo(),
newKc003.getAmount(), newKc003.getWeight());
newKc003.getAmount(), newKc003.getWeight(),newKc003.getFactoryCode());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
......
......@@ -151,7 +151,7 @@ public class ServiceHPKC003A extends ServiceEPBase {
HPSCTools.HpSc005a.updateCompleteNum(fSc005b.getProdTaskNo(), applyNum);
// 修改库存
HPKCTools.updateProdStock(newKc003.getWhCode(), newKc003.getProdOrderNo(),
newKc003.getAmount(), newKc003.getWeight());
newKc003.getAmount(), newKc003.getWeight(),fSc005b.getFactoryCode());
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成入库单失败");
......
......@@ -121,7 +121,7 @@ public class ServiceHPKC004 extends ServiceBase {
dbKc004.getAmount(), dbKc004.getWeight().multiply(new BigDecimal(1000)));
else
HPKCTools.updateProdStock(dbKc004.getWhCode(), dbKc004.getProdNo(),
dbKc004.getAmount(), dbKc004.getWeight());
dbKc004.getAmount(), dbKc004.getWeight(),hpkc010.getFactoryCode());
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
......@@ -115,7 +115,7 @@ public class ServiceHPKC004A extends ServiceEPBase {
DaoUtils.insert(HPKC004.INSERT, newKc004);
// 修改库存数量
HPKCTools.updateProdStock(newKc004.getWhCode(), newKc004.getProdNo(),
newKc004.getAmount().negate(), newKc004.getWeight().negate());
newKc004.getAmount().negate(), newKc004.getWeight().negate(),dbKc011.getFactoryCode());
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成出库单失败");
......
......@@ -99,6 +99,7 @@ public class ServiceHPKC011 extends ServiceBase {
public EiInfo updateStock(EiInfo inInfo){
String whCode = inInfo.getString("whCode");
String prodNo = inInfo.getString("prodNo");
String factoryCode = inInfo.getString("factoryCode");
BigDecimal amount = new BigDecimal(inInfo.getString("amount"));
BigDecimal weight = new BigDecimal(inInfo.getString("weight"));
String companyCode = UserSessionUtils.getCompanyCode();
......@@ -116,6 +117,7 @@ public class ServiceHPKC011 extends ServiceBase {
||weight.compareTo(BigDecimal.ZERO)<0){
throw new PlatException("当前库存为空,库存变更数量与重量不能小于等于0!");
}
newObj.setFactoryCode(factoryCode);
generatorBaseInfo(newObj);
DaoUtils.insert("HPKC011.insert",newObj);
}else{
......
......@@ -668,7 +668,7 @@ public class HPKCTools {
* @param amount
* @param weight
*/
public static void updateProdStock(String whCode, String prodNo, BigDecimal amount, BigDecimal weight) {
public static void updateProdStock(String whCode, String prodNo, BigDecimal amount, BigDecimal weight,String factoryCode) {
if (amount.compareTo(BigDecimal.ZERO) == 0 && weight.compareTo(BigDecimal.ZERO) == 0) {
return;
}
......@@ -677,6 +677,7 @@ public class HPKCTools {
inInfo.set("prodNo", prodNo);
inInfo.set("amount", amount);
inInfo.set("weight", weight);
inInfo.set("factoryCode", factoryCode);
inInfo.set(EiConstant.serviceName, "HPKC011");
inInfo.set(EiConstant.methodName, "updateStock");
EiInfo outInfo = XLocalManager.call(inInfo);
......
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