|
|
|
@ -79,7 +79,11 @@ public class IoAddInoutService {
|
|
|
|
|
@Resource
|
|
|
|
|
private IoOrderDetailCodeDao orderDetailCodeDao;
|
|
|
|
|
|
|
|
|
|
//新增扫码单据处理
|
|
|
|
|
/**
|
|
|
|
|
* 新增扫码单据处理
|
|
|
|
|
*
|
|
|
|
|
* @param orderEntity
|
|
|
|
|
*/
|
|
|
|
|
public void dealProcess(IoOrderEntity orderEntity) {
|
|
|
|
|
|
|
|
|
|
orderEntity.setErrMsg("正在处理!");
|
|
|
|
@ -699,98 +703,68 @@ public class IoAddInoutService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//duims上传单据
|
|
|
|
|
/**
|
|
|
|
|
* udims上传单据
|
|
|
|
|
*
|
|
|
|
|
* @param postOrderRequest
|
|
|
|
|
*/
|
|
|
|
|
@Transactional
|
|
|
|
|
public void creatOrderByUdims(PostUdimsOrderRequest postOrderRequest) {
|
|
|
|
|
List<PostUdimsOrderRequest.OrderBean> postOrders = postOrderRequest.getOrderBeans();
|
|
|
|
|
if (postOrders != null && postOrders.size() > 0) {
|
|
|
|
|
for (int i = 0; i < postOrders.size(); i++) {
|
|
|
|
|
PostUdimsOrderRequest.OrderBean postOrder = postOrders.get(i);
|
|
|
|
|
//创建单据
|
|
|
|
|
IoOrderEntity orderEntity = orderService.findByBillNo(postOrder.getOrderId());
|
|
|
|
|
if (orderEntity != null) {
|
|
|
|
|
//已包含业务单据校验
|
|
|
|
|
// orderEntity.setUpdateUser(postOrderRequest.getUserId() + "");
|
|
|
|
|
orderEntity.setUpdateTime(new Date());
|
|
|
|
|
orderService.update(orderEntity);
|
|
|
|
|
List<PostUdimsOrderRequest.OrderBean.CodeBean> pdaCodeEntities = postOrder.getCodes();
|
|
|
|
|
if (pdaCodeEntities != null && pdaCodeEntities.size() > 0) {
|
|
|
|
|
PostUdimsOrderRequest.OrderBean.CodeBean pdaCodeEntity = pdaCodeEntities.get(0);
|
|
|
|
|
//写入条码
|
|
|
|
|
List<IoCodeTempEntity> ioCodeEnttities = new ArrayList<>();
|
|
|
|
|
for (int index = 0; index < pdaCodeEntities.size(); index++) {
|
|
|
|
|
IoCodeTempEntity codeEnttity = new IoCodeTempEntity();
|
|
|
|
|
BeanUtils.copyProperties(pdaCodeEntities.get(index), codeEnttity);
|
|
|
|
|
codeEnttity.setAction(orderEntity.getAction());
|
|
|
|
|
codeEnttity.setMainAction(orderEntity.getMainAction());
|
|
|
|
|
codeEnttity.setDeptCode(orderEntity.getDeptCode());
|
|
|
|
|
codeEnttity.setOrderId(orderEntity.getBillNo());
|
|
|
|
|
codeEnttity.setInvCode(orderEntity.getInvCode());
|
|
|
|
|
codeEnttity.setReCount(codeEnttity.getCount() * udiCalCountUtil.getActCount(codeEnttity.getNameCode()));
|
|
|
|
|
codeEnttity.setUpdateTime(new Date());
|
|
|
|
|
codeEnttity.setCreateTime(DateUtil.parseDate(pdaCodeEntity.getActDate()));
|
|
|
|
|
ioCodeEnttities.add(codeEnttity);
|
|
|
|
|
}
|
|
|
|
|
codeTempService.insertBatch(ioCodeEnttities);
|
|
|
|
|
dealProcess(orderEntity);
|
|
|
|
|
if (!ioCheckInoutService.checkManual(orderEntity.getBillNo())) {
|
|
|
|
|
ioCheckInoutService.check(orderEntity.getBillNo());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//创建新单据
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(postOrder.getAction());
|
|
|
|
|
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
|
|
|
|
|
IoOrderEntity orderSaveRequest = new IoOrderEntity();
|
|
|
|
|
orderSaveRequest.setBillNo(orderNo);
|
|
|
|
|
orderSaveRequest.setMainAction(postOrder.getMainAction());
|
|
|
|
|
orderSaveRequest.setAction(postOrder.getAction());
|
|
|
|
|
orderSaveRequest.setCorpOrderId(postOrder.getCorpOrderId());
|
|
|
|
|
orderSaveRequest.setFromCorp(postOrder.getFromCorp());
|
|
|
|
|
orderSaveRequest.setCustomerId(postOrderRequest.getCustomerId());
|
|
|
|
|
orderSaveRequest.setDeptCode(postOrder.getDeptCode());
|
|
|
|
|
orderSaveRequest.setInvCode(postOrder.getInvStorageCode());
|
|
|
|
|
orderSaveRequest.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
|
|
|
|
|
orderSaveRequest.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
|
|
|
|
|
//创建新单据
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(postOrder.getAction());
|
|
|
|
|
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
|
|
|
|
|
IoOrderEntity orderSaveRequest = new IoOrderEntity();
|
|
|
|
|
orderSaveRequest.setBillNo(orderNo);
|
|
|
|
|
orderSaveRequest.setMainAction(postOrder.getMainAction());
|
|
|
|
|
orderSaveRequest.setAction(postOrder.getAction());
|
|
|
|
|
orderSaveRequest.setCorpOrderId(postOrder.getOrderId());
|
|
|
|
|
orderSaveRequest.setFromCorp(postOrder.getFromCorp());
|
|
|
|
|
orderSaveRequest.setCustomerId(postOrderRequest.getCustomerId());
|
|
|
|
|
orderSaveRequest.setDeptCode(postOrder.getDeptCode());
|
|
|
|
|
orderSaveRequest.setInvCode(postOrder.getInvStorageCode());
|
|
|
|
|
orderSaveRequest.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
|
|
|
|
|
orderSaveRequest.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
|
|
|
|
|
// orderSaveRequest.setCreateUser(postOrderRequest.getUserId() + "");
|
|
|
|
|
// orderSaveRequest.setUpdateUser(postOrderRequest.getUserId() + "");
|
|
|
|
|
orderSaveRequest.setUpdateTime(new Date());
|
|
|
|
|
orderSaveRequest.setBusType(bussinessTypeEntity.getBusType());
|
|
|
|
|
orderSaveRequest.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);
|
|
|
|
|
orderSaveRequest.setFromType(ConstantStatus.FROM_UDIMS);
|
|
|
|
|
List<PostUdimsOrderRequest.OrderBean.CodeBean> pdaCodeEntities = postOrder.getCodes();
|
|
|
|
|
if (pdaCodeEntities != null && pdaCodeEntities.size() > 0) {
|
|
|
|
|
PostUdimsOrderRequest.OrderBean.CodeBean pdaCodeEntity = pdaCodeEntities.get(0);
|
|
|
|
|
if (pdaCodeEntity.getActDate() != null) {
|
|
|
|
|
orderSaveRequest.setCreateTime(DateUtil.parseDate(pdaCodeEntity.getActDate()));
|
|
|
|
|
}
|
|
|
|
|
//写入条码
|
|
|
|
|
List<IoCodeTempEntity> ioCodeEnttities = new ArrayList<>();
|
|
|
|
|
for (int index = 0; index < pdaCodeEntities.size(); index++) {
|
|
|
|
|
IoCodeTempEntity codeEnttity = new IoCodeTempEntity();
|
|
|
|
|
BeanUtil.copyProperties(pdaCodeEntities.get(index), codeEnttity);
|
|
|
|
|
codeEnttity.setAction(orderSaveRequest.getAction());
|
|
|
|
|
codeEnttity.setMainAction(orderSaveRequest.getMainAction());
|
|
|
|
|
codeEnttity.setDeptCode(orderSaveRequest.getDeptCode());
|
|
|
|
|
codeEnttity.setOrderId(orderSaveRequest.getBillNo());
|
|
|
|
|
codeEnttity.setInvCode(orderSaveRequest.getInvCode());
|
|
|
|
|
codeEnttity.setReCount(codeEnttity.getCount() * udiCalCountUtil.getActCount(codeEnttity.getNameCode()));
|
|
|
|
|
codeEnttity.setUpdateTime(new Date());
|
|
|
|
|
codeEnttity.setCreateTime(DateUtil.parseDate(pdaCodeEntity.getActDate()));
|
|
|
|
|
ioCodeEnttities.add(codeEnttity);
|
|
|
|
|
}
|
|
|
|
|
codeTempService.insertBatch(ioCodeEnttities);
|
|
|
|
|
orderSaveRequest.setUpdateTime(new Date());
|
|
|
|
|
orderSaveRequest.setBusType(bussinessTypeEntity.getBusType());
|
|
|
|
|
orderSaveRequest.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);
|
|
|
|
|
orderSaveRequest.setFromType(ConstantStatus.FROM_UDIMS);
|
|
|
|
|
List<PostUdimsOrderRequest.OrderBean.CodeBean> msCodeEntities = postOrder.getCodes();
|
|
|
|
|
if (msCodeEntities != null && msCodeEntities.size() > 0) {
|
|
|
|
|
PostUdimsOrderRequest.OrderBean.CodeBean msCodeEntity = msCodeEntities.get(0);
|
|
|
|
|
if (msCodeEntity.getActDate() != null) {
|
|
|
|
|
orderSaveRequest.setCreateTime(DateUtil.parseDate(msCodeEntity.getActDate()));
|
|
|
|
|
}
|
|
|
|
|
orderService.insertOrder(orderSaveRequest);
|
|
|
|
|
dealProcess(orderSaveRequest);
|
|
|
|
|
if (!ioCheckInoutService.checkManual(orderEntity.getBillNo())) {
|
|
|
|
|
ioCheckInoutService.check(orderEntity.getBillNo());
|
|
|
|
|
//写入条码
|
|
|
|
|
List<IoCodeTempEntity> ioCodeEnttities = new ArrayList<>();
|
|
|
|
|
for (int index = 0; index < msCodeEntities.size(); index++) {
|
|
|
|
|
IoCodeTempEntity codeEnttity = new IoCodeTempEntity();
|
|
|
|
|
BeanUtil.copyProperties(msCodeEntities.get(index), codeEnttity);
|
|
|
|
|
codeEnttity.setAction(orderSaveRequest.getAction());
|
|
|
|
|
codeEnttity.setMainAction(orderSaveRequest.getMainAction());
|
|
|
|
|
codeEnttity.setDeptCode(orderSaveRequest.getDeptCode());
|
|
|
|
|
codeEnttity.setOrderId(orderSaveRequest.getBillNo());
|
|
|
|
|
codeEnttity.setInvCode(orderSaveRequest.getInvCode());
|
|
|
|
|
codeEnttity.setReCount(codeEnttity.getCount() * udiCalCountUtil.getActCount(codeEnttity.getNameCode()));
|
|
|
|
|
codeEnttity.setUpdateTime(new Date());
|
|
|
|
|
codeEnttity.setCreateTime(DateUtil.parseDate(msCodeEntity.getActDate()));
|
|
|
|
|
ioCodeEnttities.add(codeEnttity);
|
|
|
|
|
}
|
|
|
|
|
codeTempService.insertBatch(ioCodeEnttities);
|
|
|
|
|
}
|
|
|
|
|
orderService.insertOrder(orderSaveRequest);
|
|
|
|
|
dealProcess(orderSaveRequest);
|
|
|
|
|
if (!ioCheckInoutService.checkManual(orderSaveRequest.getBillNo())) {
|
|
|
|
|
ioCheckInoutService.check(orderSaveRequest.getBillNo());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|