|
|
|
@ -27,6 +27,7 @@ import com.glxp.api.entity.basic.BasicCorpEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.*;
|
|
|
|
|
import com.glxp.api.entity.inv.*;
|
|
|
|
|
import com.glxp.api.entity.system.SyncDataBustypeEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SyncUploadDataSetEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrOrderUploadBustypesEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrSystemBusApiEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
|
|
|
|
@ -42,6 +43,7 @@ import com.glxp.api.service.basic.IBasicBussinessTypeService;
|
|
|
|
|
import com.glxp.api.service.inout.*;
|
|
|
|
|
import com.glxp.api.service.inv.*;
|
|
|
|
|
import com.glxp.api.service.system.SyncUploadDataBustypeService;
|
|
|
|
|
import com.glxp.api.service.system.SyncUploadDataSetService;
|
|
|
|
|
import com.glxp.api.service.thrsys.ThrOrderUploadBustypesService;
|
|
|
|
|
import com.glxp.api.util.MsDateUtil;
|
|
|
|
|
import com.glxp.api.util.IntUtil;
|
|
|
|
@ -844,14 +846,14 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
|
udiwmsOrderRequest.setBillType(billType);
|
|
|
|
|
String response = httpOkClient.uCloudPost(thrSystemEntity.getThridUrl() + "/udiwms/erp/submitOrders", udiwmsOrderRequest);
|
|
|
|
|
if (StrUtil.isBlank(response)) {
|
|
|
|
|
log.info("单据提交失败,无返回信息");
|
|
|
|
|
log.error("----单据上传----" + billNo + "单据提交失败,无返回信息");
|
|
|
|
|
return ResultVOUtils.error(500, "提交失败");
|
|
|
|
|
} else {
|
|
|
|
|
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
|
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
|
return ResultVOUtils.success("提交成功");
|
|
|
|
|
} else {
|
|
|
|
|
log.error("单据提交失败,错误信息:{}", baseResponse.getMessage());
|
|
|
|
|
log.error("----单据上传----" + billNo + baseResponse.getMessage());
|
|
|
|
|
return ResultVOUtils.error(500, "提交失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -865,11 +867,14 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
ThrOrderUploadBustypesService thrOrderUploadBustypesService;
|
|
|
|
|
@Resource
|
|
|
|
|
SyncUploadDataSetService syncUploadDataSetService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse submitOrderToThrSys(ThrSystemDetailEntity thrSystemDetailEntity) {
|
|
|
|
|
//查询可以提交到第三方系统的单据
|
|
|
|
|
List<String> billNos = orderDao.selectWaitSubmitOrder(thrSystemDetailEntity.getThirdSysFk());
|
|
|
|
|
SyncUploadDataSetEntity syncUploadDataSetEntity = syncUploadDataSetService.selectSet();
|
|
|
|
|
List<String> billNos = orderDao.selectWaitSubmitOrder(thrSystemDetailEntity.getThirdSysFk(),syncUploadDataSetEntity.getOrderStartTime());
|
|
|
|
|
if (CollUtil.isNotEmpty(billNos)) {
|
|
|
|
|
log.info("开始提交单据到第三方系统,本次提交单据数量:{}", billNos.size());
|
|
|
|
|
for (String billNo : billNos) {
|
|
|
|
@ -879,25 +884,25 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
|
log.error(billNo + ":" + orderEntity.getAction() + "单据类型未设置自动上传");
|
|
|
|
|
return ResultVOUtils.error(500, billNo + ":" + orderEntity.getAction() + "单据类型未设置自动上传");
|
|
|
|
|
}
|
|
|
|
|
if (thrOrderUploadBustypesEntity.getOrderSource().contains(orderEntity.getFromType() + "")) {
|
|
|
|
|
if (!thrOrderUploadBustypesEntity.getOrderSource().contains(orderEntity.getFromType() + "")) {
|
|
|
|
|
log.error(billNo + ":" + "单据来源不允许自动提交");
|
|
|
|
|
return ResultVOUtils.error(500, billNo + ":" + "单据来源不允许自动提交");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (IntUtil.value(thrOrderUploadBustypesEntity.getOrderStatus()) == 1) {
|
|
|
|
|
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_REW) {
|
|
|
|
|
log.error(billNo + ":" + "非待审核单据");
|
|
|
|
|
return ResultVOUtils.error(500, billNo + ":" + "非待审核单据");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
} else if (IntUtil.value(thrOrderUploadBustypesEntity.getOrderStatus()) == 2) {
|
|
|
|
|
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_AUDITED) {
|
|
|
|
|
log.error(billNo + ":" + "非已审核单据");
|
|
|
|
|
return ResultVOUtils.error(500, billNo + ":" + "非已审核单据");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (IntUtil.value(thrOrderUploadBustypesEntity.getOrderStatus()) == 3) {
|
|
|
|
|
if (IntUtil.value(orderEntity.getCheckStatus()) != 1) {
|
|
|
|
|
log.error(billNo + ":" + "非已确认单据");
|
|
|
|
|
return ResultVOUtils.error(500, billNo + ":" + "非已确认单据");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return submitToThrSys(billNo);
|
|
|
|
|