|
|
|
@ -274,16 +274,32 @@ public class WmsApiController extends BaseController {
|
|
|
|
|
@PostMapping(("/synchronizeRawMaterialDeliveryInformationToERP"))
|
|
|
|
|
// @Log(title = "同步原材料出库信息", businessType = BusinessType.INSERT)
|
|
|
|
|
public R<AjaxResult> synchronizeRawMaterialDeliveryInformationToERP() {
|
|
|
|
|
Map<Long, List<WmsRawOutstockDetail>> otherMaterialIdMap = wmsErpScheduledTaskService.synchronizeOtherMaterialDeliveryInformationToERP();
|
|
|
|
|
for (Long materialId : otherMaterialIdMap.keySet()) {
|
|
|
|
|
wmsErpScheduledTaskService.syncOutstockInformation(otherMaterialIdMap, materialId, "");
|
|
|
|
|
int result = 0;
|
|
|
|
|
StringBuilder errorBuffer = new StringBuilder();
|
|
|
|
|
//定时同步原材料出库信息给ERP
|
|
|
|
|
Map<String, List<WmsRawOutstockDetail>> otherMaterialIdMap = wmsErpScheduledTaskService.synchronizeOtherMaterialDeliveryInformationToERP();
|
|
|
|
|
for (String materialId : otherMaterialIdMap.keySet()) {
|
|
|
|
|
try {
|
|
|
|
|
wmsErpScheduledTaskService.syncOutstockInformation(otherMaterialIdMap, materialId, "");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result++;
|
|
|
|
|
errorBuffer.append(result).append(e.getMessage()).append("|出库ERP异常|");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<Long, List<WmsRawOutstockDetail>> returnMaterialIdMap = wmsErpScheduledTaskService.synchronizeReturnMaterialDeliveryInformationToERP();
|
|
|
|
|
for (Long materialId : returnMaterialIdMap.keySet()) {
|
|
|
|
|
wmsErpScheduledTaskService.syncOutstockInformation(returnMaterialIdMap, materialId, WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK);
|
|
|
|
|
//定时同步原材料退货出库信息给ERP
|
|
|
|
|
Map<String, List<WmsRawOutstockDetail>> returnMaterialIdMap = wmsErpScheduledTaskService.synchronizeReturnMaterialDeliveryInformationToERP();
|
|
|
|
|
for (String materialId : returnMaterialIdMap.keySet()) {
|
|
|
|
|
try {
|
|
|
|
|
wmsErpScheduledTaskService.syncOutstockInformation(returnMaterialIdMap, materialId, WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result++;
|
|
|
|
|
errorBuffer.append(result).append(e.getMessage()).append("|退库ERP异常|");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (errorBuffer.length() > 0) {
|
|
|
|
|
return R.fail(errorBuffer.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return R.ok();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|