|
|
|
@ -200,12 +200,20 @@ public class StWmsRequestServiceImpl extends BaseServiceImpl<StWmsRequestMapper, |
|
|
|
/* 发送 ERP(原逻辑) */ |
|
|
|
/* 发送 ERP(原逻辑) */ |
|
|
|
if (status == StWmsRequest.APPROVAL_STATUS_CHECKED) { |
|
|
|
if (status == StWmsRequest.APPROVAL_STATUS_CHECKED) { |
|
|
|
StBuyOrder stBuyOrder = stBuyOrderService.getById(request.getBoId()); |
|
|
|
StBuyOrder stBuyOrder = stBuyOrderService.getById(request.getBoId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Double reqQty = request.getRequestQty(); |
|
|
|
|
|
|
|
StGoods goods = stGoodsMapper.selectById(stBuyOrder.getGoodsId()); |
|
|
|
|
|
|
|
Double ratio = goods.getConversionRatio(); |
|
|
|
|
|
|
|
if (reqQty != null && ratio != null && ratio != 0) { |
|
|
|
|
|
|
|
reqQty = reqQty * ratio; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
R<User> ruser = userClient.userInfoById(request.getCreateUser()); |
|
|
|
R<User> ruser = userClient.userInfoById(request.getCreateUser()); |
|
|
|
User user = ruser.getData(); |
|
|
|
User user = ruser.getData(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
erpDataWmsClient.sendErpBuyRequest( |
|
|
|
erpDataWmsClient.sendErpBuyRequest( |
|
|
|
stBuyOrder.getExtraBill(), |
|
|
|
stBuyOrder.getExtraBill(), |
|
|
|
request.getRequestQty(), |
|
|
|
reqQty, |
|
|
|
user.getAccount()); |
|
|
|
user.getAccount()); |
|
|
|
} catch (BusinessException e) { |
|
|
|
} catch (BusinessException e) { |
|
|
|
throw new RuntimeException("仓库提请发送ERP失败:" + e.getMessage()); |
|
|
|
throw new RuntimeException("仓库提请发送ERP失败:" + e.getMessage()); |
|
|
|
@ -230,13 +238,21 @@ public class StWmsRequestServiceImpl extends BaseServiceImpl<StWmsRequestMapper, |
|
|
|
StBuyOrder stBuyOrder = stBuyOrderService.getById(stWmsRequest.getBoId()); |
|
|
|
StBuyOrder stBuyOrder = stBuyOrderService.getById(stWmsRequest.getBoId()); |
|
|
|
StGoods goods = stGoodsMapper.selectById(stBuyOrder.getGoodsId()); |
|
|
|
StGoods goods = stGoodsMapper.selectById(stBuyOrder.getGoodsId()); |
|
|
|
StWmsRequest oldRequest = this.getById(stWmsRequest); |
|
|
|
StWmsRequest oldRequest = this.getById(stWmsRequest); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Double oldQty = oldRequest.getRequestQty(); |
|
|
|
|
|
|
|
Double newQty = stWmsRequest.getRequestQty(); |
|
|
|
|
|
|
|
Double ratio = goods.getConversionRatio(); |
|
|
|
|
|
|
|
if (ratio != null && ratio != 0) { |
|
|
|
|
|
|
|
oldQty = oldQty * ratio; |
|
|
|
|
|
|
|
newQty = newQty * ratio; |
|
|
|
|
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|
erpDataWmsClient.createOrReplace( |
|
|
|
erpDataWmsClient.createOrReplace( |
|
|
|
stBuyOrder.getExtraBill(), |
|
|
|
stBuyOrder.getExtraBill(), |
|
|
|
goods.getGoodsCode(), |
|
|
|
goods.getGoodsCode(), |
|
|
|
"0", |
|
|
|
"0", |
|
|
|
oldRequest.getRequestQty(), |
|
|
|
oldQty, |
|
|
|
stWmsRequest.getRequestQty()); |
|
|
|
newQty); |
|
|
|
} catch (BusinessException e) { |
|
|
|
} catch (BusinessException e) { |
|
|
|
throw new RuntimeException("仓库提请修改ERP失败:" + e.getMessage()); |
|
|
|
throw new RuntimeException("仓库提请修改ERP失败:" + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -258,13 +274,19 @@ public class StWmsRequestServiceImpl extends BaseServiceImpl<StWmsRequestMapper, |
|
|
|
StWmsRequest stWmsRequest = this.getById(id); |
|
|
|
StWmsRequest stWmsRequest = this.getById(id); |
|
|
|
StBuyOrder stBuyOrder = stBuyOrderService.getById(stWmsRequest.getBoId()); |
|
|
|
StBuyOrder stBuyOrder = stBuyOrderService.getById(stWmsRequest.getBoId()); |
|
|
|
StGoods goods = stGoodsMapper.selectById(stBuyOrder.getGoodsId()); |
|
|
|
StGoods goods = stGoodsMapper.selectById(stBuyOrder.getGoodsId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Double reqQty = stWmsRequest.getRequestQty(); |
|
|
|
|
|
|
|
Double ratio = goods.getConversionRatio(); |
|
|
|
|
|
|
|
if (reqQty != null && ratio != null && ratio != 0) { |
|
|
|
|
|
|
|
reqQty = reqQty * ratio; |
|
|
|
|
|
|
|
} |
|
|
|
if (stWmsRequest == null) continue; |
|
|
|
if (stWmsRequest == null) continue; |
|
|
|
try { |
|
|
|
try { |
|
|
|
erpDataWmsClient.createOrReplace( |
|
|
|
erpDataWmsClient.createOrReplace( |
|
|
|
stBuyOrder.getExtraBill(), |
|
|
|
stBuyOrder.getExtraBill(), |
|
|
|
goods.getGoodsCode(), |
|
|
|
goods.getGoodsCode(), |
|
|
|
"1", |
|
|
|
"1", |
|
|
|
stWmsRequest.getRequestQty(), |
|
|
|
reqQty, |
|
|
|
0.0); |
|
|
|
0.0); |
|
|
|
} catch (BusinessException e) { |
|
|
|
} catch (BusinessException e) { |
|
|
|
throw new RuntimeException("删除模具计划失败:" + e.getMessage()); |
|
|
|
throw new RuntimeException("删除模具计划失败:" + e.getMessage()); |
|
|
|
|