fix:sap强制校验提示,计划内投料
This commit is contained in:
@@ -147,8 +147,8 @@ public class SapDealLLDBBillPmDeamndCallBack implements CallbackStrategy {
|
||||
record.put("response", sapResult);
|
||||
stockReturn.setRequest_data(record.toJSONString());
|
||||
} catch (Exception e) {
|
||||
String error = String.format("需求单%s库存调拨回传SAP失败", one.getWork_order());
|
||||
log.error(error, e);
|
||||
String error = String.format("需求单%s库存调拨回传SAP失败[%s]", one.getWork_order(),e.getMessage());
|
||||
log.error(error);
|
||||
Param forceReturn = sysParamService.findByCode(SysParamConstant.FORCE_RETURN);
|
||||
if (ObjectUtils.isNotEmpty(forceReturn) && "1".equals(forceReturn.getValue())){
|
||||
throw new BadRequestException(error);
|
||||
@@ -256,8 +256,8 @@ public class SapDealLLDBBillPmDeamndCallBack implements CallbackStrategy {
|
||||
record.put("response", sapResult);
|
||||
stockReturn.setRequest_data(record.toJSONString());
|
||||
} catch (Exception e) {
|
||||
String error = String.format("需求单%s库存调拨回传SAP失败", demand.getWork_order());
|
||||
log.error(error, e);
|
||||
String error = String.format("需求单%s库存调拨回传SAP失败[%s]", demand.getWork_order(),e.getMessage());
|
||||
log.error(error);
|
||||
Param forceReturn = sysParamService.findByCode(SysParamConstant.FORCE_RETURN);
|
||||
if (ObjectUtils.isNotEmpty(forceReturn) && "1".equals(forceReturn.getValue())){
|
||||
throw new BadRequestException(error);
|
||||
|
||||
@@ -168,7 +168,7 @@ public class SapProductionOutboundDelivery implements CallbackStrategy {
|
||||
//待分配数量
|
||||
BigDecimal unAssertQty = feedbackQty;
|
||||
for (WorkOrderDao workOrder : workOrderList) {
|
||||
boolean withReserve = StrUtil.startWith(StrUtil.trim(workOrder.getOrder_code()), "G");
|
||||
boolean withReserve = StrUtil.startWith(StrUtil.trim(demand.getWork_order()), "G");
|
||||
String rsnum = "";
|
||||
String rspos = "";
|
||||
BigDecimal sapQty = new BigDecimal(feedbackQty.intValue());
|
||||
@@ -182,6 +182,8 @@ public class SapProductionOutboundDelivery implements CallbackStrategy {
|
||||
log.error(msg);
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
rspos = bom.getRspos();
|
||||
rsnum = bom.getRsnum();
|
||||
BigDecimal usedQty = nvl(bom.getUse_bom_qty());
|
||||
// bom剩余过账数量 = BOM数量 - 已用BOM数量
|
||||
// 当前数量:feedbackQty
|
||||
@@ -224,8 +226,8 @@ public class SapProductionOutboundDelivery implements CallbackStrategy {
|
||||
record.put("response", sapResult);
|
||||
stockReturn.setRequest_data(record.toJSONString());
|
||||
} catch (Exception e) {
|
||||
String error = String.format("需求单%s工单%s生产投料回传SAP失败", demand.getId(), workOrder.getOrder_code());
|
||||
log.error(error, e);
|
||||
String error = String.format("需求单%s工单%s生产投料回传SAP失败[%s]", demand.getId(), workOrder.getOrder_code(),e.getMessage());
|
||||
log.error(error);
|
||||
Param forceReturn = sysParamService.findByCode(SysParamConstant.FORCE_RETURN);
|
||||
if (ObjectUtils.isNotEmpty(forceReturn) && "1".equals(forceReturn.getValue())){
|
||||
throw new BadRequestException(error);
|
||||
@@ -318,6 +320,7 @@ public class SapProductionOutboundDelivery implements CallbackStrategy {
|
||||
private ProductionOutboundRequest buildRequest(String docno, String today, WorkOrderDao workOrder,
|
||||
String materialCode, String lgort,String rsnum,String rspos,
|
||||
BigDecimal postQty) {
|
||||
String workOrderCode = workOrder.getOrder_code().split("-")[0];
|
||||
ProductionOutboundRequest request = new ProductionOutboundRequest();
|
||||
ProductionOutboundHeader header = new ProductionOutboundHeader();
|
||||
header.setIntfId(SapConstant.INTF_PP055);
|
||||
@@ -334,7 +337,7 @@ public class SapProductionOutboundDelivery implements CallbackStrategy {
|
||||
body.setMatnr(materialCode);
|
||||
body.setWerks(SapConstant.WERKS);
|
||||
body.setLgort(lgort);
|
||||
body.setAufnr(workOrder.getOrder_code());
|
||||
body.setAufnr(workOrderCode);
|
||||
body.setErfmg(postQty.doubleValue());
|
||||
body.setRsnum(rsnum);
|
||||
body.setRspos(rspos);
|
||||
|
||||
Reference in New Issue
Block a user