ms上传调整

dev
wj 2 years ago
parent 170c39a53e
commit 97628c8015

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

@ -78,7 +78,11 @@ public class IoCheckInoutService {
@Resource @Resource
IoAddInoutService addInoutService; IoAddInoutService addInoutService;
//判断是否需要手动校验 /**
*
* @param billNo
* @return
*/
public boolean checkManual(String billNo) { public boolean checkManual(String billNo) {
IoOrderEntity orderEntity = orderService.findByBillNo(billNo); IoOrderEntity orderEntity = orderService.findByBillNo(billNo);
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
@ -126,7 +130,10 @@ public class IoCheckInoutService {
} }
} }
//校验流程 //一次校验 /**
* |
* @param orderId
*/
public void check(String orderId) { public void check(String orderId) {
IoOrderEntity orderEntity = orderService.findByBillNo(orderId); IoOrderEntity orderEntity = orderService.findByBillNo(orderId);
//过滤非未校验或校验异常 //过滤非未校验或校验异常

Loading…
Cancel
Save