|
|
|
@ -420,18 +420,23 @@ public class IoAddInoutService {
|
|
|
|
|
if (tempEntity != null) {
|
|
|
|
|
return ResultVOUtils.error(500, "单据已存在,请勿重复提交");
|
|
|
|
|
}
|
|
|
|
|
tempEntity = orderService.findByCorpOrderId(orderEntity.getBillNo());
|
|
|
|
|
tempEntity = orderService.findByCorpOrderId(orderEntity.getCorpOrderId());
|
|
|
|
|
if (tempEntity != null) {
|
|
|
|
|
return ResultVOUtils.error(500, "单据已存在,请勿重复提交");
|
|
|
|
|
}
|
|
|
|
|
if (CollUtil.isNotEmpty(pdaPostOrderRequest.getCodeTempEntities())) {
|
|
|
|
|
codeTempService.insertBatch(pdaPostOrderRequest.getCodeTempEntities());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
|
|
|
|
|
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
|
|
|
|
|
orderEntity.setBillNo(orderNo);
|
|
|
|
|
orderService.insertOrder(orderEntity);
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(pdaPostOrderRequest.getCodeTempEntities())) {
|
|
|
|
|
for (IoCodeTempEntity codeTempEntity : pdaPostOrderRequest.getCodeTempEntities()) {
|
|
|
|
|
codeTempEntity.setOrderId(orderNo);
|
|
|
|
|
}
|
|
|
|
|
codeTempService.insertBatch(pdaPostOrderRequest.getCodeTempEntities());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dealProcess(orderEntity);
|
|
|
|
|
if (!ioCheckInoutService.checkManual(orderEntity.getBillNo())) {
|
|
|
|
|
ioCheckInoutService.check(orderEntity.getBillNo());
|
|
|
|
@ -447,12 +452,12 @@ public class IoAddInoutService {
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public BaseResponse waitOrderByPda(PdaPostOrderRequest pdaPostOrderRequest) {
|
|
|
|
|
if (CollUtil.isEmpty(pdaPostOrderRequest.getOrderDetailCodeEntities())) {
|
|
|
|
|
return ResultVOUtils.error(500, "提交失败,单据还未扫码或和扫码校验存在异常!");
|
|
|
|
|
}
|
|
|
|
|
// if (CollUtil.isEmpty(pdaPostOrderRequest.getOrderDetailCodeEntities())) {
|
|
|
|
|
// return ResultVOUtils.error(500, "提交失败,单据还未扫码或和扫码校验存在异常!");
|
|
|
|
|
// }
|
|
|
|
|
IoOrderEntity orderEntity = pdaPostOrderRequest.getOrderEntity();
|
|
|
|
|
List<IoOrderDetailBizEntity> orderDetailBizEntities = pdaPostOrderRequest.getOrderDetailBizEntities();
|
|
|
|
|
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = pdaPostOrderRequest.getOrderDetailCodeEntities();
|
|
|
|
|
|
|
|
|
|
List<IoCodeTempEntity> codeTempEntities = pdaPostOrderRequest.getCodeTempEntities();
|
|
|
|
|
|
|
|
|
|
orderDetailBizService.deleteByOrderId(orderEntity.getBillNo());
|
|
|
|
@ -461,10 +466,10 @@ public class IoAddInoutService {
|
|
|
|
|
if (CollUtil.isNotEmpty(orderDetailBizEntities)) {
|
|
|
|
|
orderDetailBizEntities.forEach(orderDetailBizEntity -> {
|
|
|
|
|
orderDetailBizService.insert(orderDetailBizEntity);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (CollUtil.isNotEmpty(orderDetailCodeEntities)) {
|
|
|
|
|
orderDetailCodeEntities.forEach(orderDetailCodeEntity -> {
|
|
|
|
|
IoOrderDetailCodeEntity orderDetailCodeEntity = new IoOrderDetailCodeEntity();
|
|
|
|
|
BeanUtil.copyProperties(orderDetailBizEntity, orderDetailCodeEntity);
|
|
|
|
|
orderDetailCodeEntity.setReCount(orderDetailBizEntity.getScanCount());
|
|
|
|
|
orderDetailCodeEntity.setCount(orderDetailBizEntity.getCodeCount());
|
|
|
|
|
orderDetailCodeService.insert(orderDetailCodeEntity);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -473,9 +478,9 @@ public class IoAddInoutService {
|
|
|
|
|
codeTempService.insert(codeTempEntity);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
|
|
|
|
|
if (ioCheckInoutService.checkManual(orderEntity.getBillNo())) {
|
|
|
|
|
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderEntity.getBillNo());
|
|
|
|
|
if (CollUtil.isNotEmpty(orderDetailBizEntities)) {
|
|
|
|
|
if (bussinessTypeEntity.getCheckWebNew() == 1) {
|
|
|
|
|
String errMsg = ioCheckInoutService.bizOrderCheck(orderDetailBizEntities, orderDetailCodeEntities);
|
|
|
|
|