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