|
|
|
@ -25,6 +25,7 @@ import com.glxp.udi.admin.service.auth.CustomerService;
|
|
|
|
|
import com.glxp.udi.admin.service.basic.BussinessTypeService;
|
|
|
|
|
import com.glxp.udi.admin.service.inout.*;
|
|
|
|
|
import com.glxp.udi.admin.service.param.SystemParamCustomerConfigService;
|
|
|
|
|
import com.glxp.udi.admin.service.product.StackOrderService;
|
|
|
|
|
import com.glxp.udi.admin.thread.TransInoutService;
|
|
|
|
|
import com.glxp.udi.admin.util.*;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
@ -65,6 +66,8 @@ public class WareHouseController {
|
|
|
|
|
private GennerOrderUtils gennerOrderUtils;
|
|
|
|
|
@Resource
|
|
|
|
|
private CustomerService customerService;
|
|
|
|
|
@Resource
|
|
|
|
|
private StackOrderService stackOrderService;
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("warehouse/inout/postOrders")
|
|
|
|
@ -320,6 +323,57 @@ public class WareHouseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (code.contains("DH")) {
|
|
|
|
|
//扫描的是垛号,直接添加到临时码表,校验等操作后置到处理单据的流程中做
|
|
|
|
|
String orderId = addOrderRequest.getOrderId();
|
|
|
|
|
|
|
|
|
|
//先生成扫码单据
|
|
|
|
|
OrderEntity orderEntity = orderService.findById(orderId);
|
|
|
|
|
if (StringUtils.isBlank(orderId) || orderEntity == null) {
|
|
|
|
|
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trim(bussinessType.getPrefix()), "yyyyMMdd"));
|
|
|
|
|
orderId = orderNo;
|
|
|
|
|
|
|
|
|
|
OrderEntity orderSaveRequest = new OrderEntity();
|
|
|
|
|
orderSaveRequest.setOrderId(orderId);
|
|
|
|
|
if (addOrderRequest.getActDate() != null) {
|
|
|
|
|
orderSaveRequest.setActDate(addOrderRequest.getActDate());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
long customerId = customerService.getCustomerId();
|
|
|
|
|
orderSaveRequest.setMainAction(bussinessType.getMainAction());
|
|
|
|
|
orderSaveRequest.setAction(bussinessType.getAction());
|
|
|
|
|
orderSaveRequest.setActor(addOrderRequest.getActor());
|
|
|
|
|
orderSaveRequest.setCorpOrderId(addOrderRequest.getCorpOrderId());
|
|
|
|
|
orderSaveRequest.setLocStorageCode(addOrderRequest.getLocStorageCode());
|
|
|
|
|
orderSaveRequest.setFromCorpId(addOrderRequest.getFromCorpId());
|
|
|
|
|
orderSaveRequest.setFromCorp(addOrderRequest.getFromCorp());
|
|
|
|
|
orderSaveRequest.setFromType("网页新增");
|
|
|
|
|
orderSaveRequest.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE);
|
|
|
|
|
orderSaveRequest.setExportStatus("未上传");
|
|
|
|
|
orderSaveRequest.setReceiveStatus(ConstantStatus.RECEIVE_UN);
|
|
|
|
|
orderSaveRequest.setCustomerId(customerId);
|
|
|
|
|
orderService.insertOrder(orderSaveRequest);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//将垛号插入临时码表
|
|
|
|
|
WarehousetempEntity warehousetemp = new WarehousetempEntity();
|
|
|
|
|
warehousetemp.setOrderId(orderId);
|
|
|
|
|
warehousetemp.setCode(code);
|
|
|
|
|
warehousetemp.setLocStorageCode(addOrderRequest.getLocStorageCode());
|
|
|
|
|
warehousetemp.setActor(addOrderRequest.getActor());
|
|
|
|
|
warehousetemp.setFromCorp(addOrderRequest.getFromCorp());
|
|
|
|
|
warehousetemp.setFromCorpId(addOrderRequest.getFromCorpId());
|
|
|
|
|
warehousetemp.setMainAction(bussinessType.getMainAction());
|
|
|
|
|
warehousetemp.setAction(bussinessType.getAction());
|
|
|
|
|
warehousetemp.setCorpOrderId(addOrderRequest.getCorpOrderId());
|
|
|
|
|
warehousetemp.setCustomerId(Long.valueOf(addOrderRequest.getCustomerId()));
|
|
|
|
|
warehouseTempService.insertTempWarehouses(Arrays.asList(warehousetemp));
|
|
|
|
|
|
|
|
|
|
addCodeResult.setOrderId(orderId);
|
|
|
|
|
return ResultVOUtils.success(addCodeResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
|
|
|
|
|
if (udiEntity == null) {
|
|
|
|
|
return ResultVOUtils.error(500, "无效条码!");
|
|
|
|
@ -422,7 +476,6 @@ public class WareHouseController {
|
|
|
|
|
warehousetempEntity.setFromCorp(addOrderRequest.getFromCorp());
|
|
|
|
|
warehousetempEntity.setBatchNo(udiEntity.getBatchNo());
|
|
|
|
|
warehousetempEntity.setProduceDate(udiEntity.getProduceDate());
|
|
|
|
|
warehousetempEntity.setLocStorageCode(addOrderRequest.getInvWarehouseCode());
|
|
|
|
|
warehousetempEntity.setNameCode(udiEntity.getNameCode());
|
|
|
|
|
warehousetempEntity.setExpireDate(udiEntity.getExpireDate());
|
|
|
|
|
warehousetempEntity.setSerialNo(udiEntity.getSerialNo());
|
|
|
|
|