fix:委外过账
This commit is contained in:
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.ext_manage.sap.api.SapApi;
|
||||
import org.nl.wms.ext_manage.sap.api.dto.SubcontractConfirmBody;
|
||||
@@ -21,7 +22,9 @@ import org.nl.wms.pm_manage.sap.outBoundDelivery.service.dao.OutboundDelivery;
|
||||
import org.nl.wms.pm_manage.sap.outBoundDelivery.service.dao.OutboundDeliveryItem;
|
||||
import org.nl.wms.pm_manage.sap.outBoundDelivery.service.dao.mapper.OutboundDeliveryItemMapper;
|
||||
import org.nl.wms.pm_manage.sap.outBoundDelivery.service.dao.mapper.OutboundDeliveryMapper;
|
||||
import org.nl.wms.system_manage.enums.SysParamConstant;
|
||||
import org.nl.wms.system_manage.service.param.ISysParamService;
|
||||
import org.nl.wms.system_manage.service.param.dao.Param;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDtl;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDtlMapper;
|
||||
@@ -119,7 +122,13 @@ public class SapOutboundDelivery implements CallbackStrategy {
|
||||
} catch (Exception e) {
|
||||
String error = String.format("委外交货单%s回传SAP失败%s",vbeln, e);
|
||||
log.error(error);
|
||||
throw new BadRequestException(error);
|
||||
Param forceReturn = sysParamService.findByCode(SysParamConstant.FORCE_RETURN);
|
||||
if (ObjectUtils.isNotEmpty(forceReturn) && "1".equals(forceReturn.getValue())){
|
||||
throw new BadRequestException(error);
|
||||
}
|
||||
stockReturn.setError_msg(e.getMessage());
|
||||
stockReturn.setStatus(StockReturnStatusEnum.FAIL.getCode());
|
||||
stockReturn.setProcess_time(DateUtil.now());
|
||||
}
|
||||
iPmStockReturnService.save(stockReturn);
|
||||
delivery.setStatus(OutboundDeliveryStatus.COMPLETED.getCode());
|
||||
|
||||
Reference in New Issue
Block a user