ms上传调整

dev
wj 2 years ago
parent 170c39a53e
commit 97628c8015

@ -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());
}
}
}
}
}

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

Loading…
Cancel
Save