|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.glxp.sale.admin.thread;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.glxp.sale.admin.config.WebSocketServer;
|
|
|
|
|
import com.glxp.sale.admin.constant.Constant;
|
|
|
|
|
import com.glxp.sale.admin.constant.ConstantStatus;
|
|
|
|
@ -265,6 +266,7 @@ public class IoTransInoutService {
|
|
|
|
|
basicUnitMaintainService.insertBasicUnitMaintain(basicUnitMaintainEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (!Constant.SYSTEM_CUSTOMER_ID.equals(orderEntity.getFromCorpId())) {
|
|
|
|
|
// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(orderEntity.getFromCorpId());
|
|
|
|
|
// if (basicUnitMaintainEntity == null) {
|
|
|
|
@ -279,22 +281,17 @@ public class IoTransInoutService {
|
|
|
|
|
List<WarehouseEntity> filterList = codesTempService.findByOrderId(warehouseQueryRequest);
|
|
|
|
|
List<WarehouseEntity> insertList = new ArrayList<>();
|
|
|
|
|
orderEntity.setInvStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
|
orderService.updateOrder(orderEntity);
|
|
|
|
|
|
|
|
|
|
if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_INNOR) {
|
|
|
|
|
if (orderEntity.getInvStorageCode() == null) {
|
|
|
|
|
if (orderEntity.getInvStorageCode() == null) {
|
|
|
|
|
if (!StrUtil.isEmpty(bussinessTypeEntity.getStorageCode())) {
|
|
|
|
|
orderEntity.setInvStorageCode(bussinessTypeEntity.getStorageCode());
|
|
|
|
|
} else {
|
|
|
|
|
orderEntity.setRemark("未选择当前仓库信息");
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL);
|
|
|
|
|
orderService.updateOrder(orderEntity);
|
|
|
|
|
}
|
|
|
|
|
} else if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) {
|
|
|
|
|
if (orderEntity.getInvStorageCode() == null) {
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(bussinessTypeEntity.isAdvanceType(), true);
|
|
|
|
|
orderEntity.setInvStorageCode(invWarehouseEntity.getCode());
|
|
|
|
|
orderService.updateOrder(orderEntity);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
orderService.updateOrder(orderEntity);
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < filterList.size(); j++) {
|
|
|
|
|
WarehouseEntity warehouseEntity = filterList.get(j);
|
|
|
|
@ -319,6 +316,14 @@ public class IoTransInoutService {
|
|
|
|
|
orderService.updateRemark(orderEntity.getId(), "udi码:" + warehouseEntity.getCode() + "该产品不允许以使用单元入库!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) {
|
|
|
|
|
CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findByUdiRlIdUnitFk(udiRelevanceResponse.getId() + "", warehouseEntity.getFromCorpId());
|
|
|
|
|
if (companyProductRelevanceEntity == null) {
|
|
|
|
|
orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL);
|
|
|
|
|
orderService.updateRemark(orderEntity.getId(), udiRelevanceResponse.getCpmctymc() + "该产品非此供应商配送");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (insertList.size() > 0) {
|
|
|
|
@ -513,33 +518,25 @@ public class IoTransInoutService {
|
|
|
|
|
|
|
|
|
|
erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_DI_MUTI);
|
|
|
|
|
myErpOrderService.updateErpOrder(erpOrderEntity);
|
|
|
|
|
orderEntity.setRemark("该产品DI绑定多个产品ID,请在扫码单据详情绑定对应产品ID");
|
|
|
|
|
orderEntity.setRemark("该产品维护多个产品信息,请在扫码单据详情绑定对应产品产品信息");
|
|
|
|
|
checkStatus = ConstantStatus.ORDER_CHECK_FAIL;
|
|
|
|
|
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
|
|
|
|
|
orderService.updateOrder(orderEntity);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT && (erpOrderEntity.getSupId() == null || erpOrderEntity.getSupId().equals("MUTI"))) {
|
|
|
|
|
if (erpOrderEntity.getSupId() == null) {
|
|
|
|
|
erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_SUP_NONE);
|
|
|
|
|
orderEntity.setRemark("该产品未绑定供应商");
|
|
|
|
|
orderEntity.setRemark("该产品未指定供应商");
|
|
|
|
|
} else {
|
|
|
|
|
erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_SUP_MUTI);
|
|
|
|
|
orderEntity.setRemark("该产品绑定多个供应商");
|
|
|
|
|
orderEntity.setRemark("该产品指定多个供应商");
|
|
|
|
|
}
|
|
|
|
|
checkStatus = ConstantStatus.ORDER_CHECK_FAIL;
|
|
|
|
|
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
|
|
|
|
|
orderService.updateOrder(orderEntity);
|
|
|
|
|
} else {
|
|
|
|
|
if (bussinessTypeEntity.getCorpType() != ConstantStatus.CORP_TYPE_INNOR) {
|
|
|
|
|
CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findByUdiRlIdUnitFk(erpOrderEntity.getBindRlFk(), erpOrderEntity.getSupId());
|
|
|
|
|
if (companyProductRelevanceEntity == null) {
|
|
|
|
|
orderEntity.setRemark(erpOrderEntity.getCoName() + "该产品非此供应商配送");
|
|
|
|
|
checkStatus = ConstantStatus.ORDER_CHECK_FAIL;
|
|
|
|
|
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
|
|
|
|
|
orderService.updateOrder(orderEntity);
|
|
|
|
|
} else {
|
|
|
|
|
orderEntity.setContrastStatus(checkStatus);
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
|
|
|
|
@ -561,6 +558,10 @@ public class IoTransInoutService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
orderEntity.setContrastStatus(checkStatus);
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
|
|
|
|
|
orderService.updateOrder(orderEntity);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|