|
|
|
@ -306,10 +306,66 @@ public class IoAddInoutService {
|
|
|
|
|
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
|
|
|
|
|
orderEntity.setUpdateTime(new Date());
|
|
|
|
|
orderService.update(orderEntity);
|
|
|
|
|
//业务单直接生成扫码单
|
|
|
|
|
if (bussinessTypeEntity.getCheckWebNew() == 4) {
|
|
|
|
|
boolean exit = codeTempService.isExit(orderEntity.getBillNo());
|
|
|
|
|
if (!exit)
|
|
|
|
|
stockGenScan(orderEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 业务单生成扫码单
|
|
|
|
|
*/
|
|
|
|
|
public void stockGenScan(IoOrderEntity orderEntity) {
|
|
|
|
|
|
|
|
|
|
List<IoOrderDetailBizEntity> bizEntities = orderDetailBizService.findByOrderId(orderEntity.getBillNo());
|
|
|
|
|
List<IoCodeTempEntity> codeTempEntities = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (IoOrderDetailBizEntity bizEntity : bizEntities) {
|
|
|
|
|
IoCodeTempEntity codeTempEntity = new IoCodeTempEntity();
|
|
|
|
|
String udiCode = "#" + bizEntity.getNameCode() + "#" + bizEntity.getProductDate() + "#" + bizEntity.getExpireDate() +
|
|
|
|
|
"#" + bizEntity.getBatchNo() + "#" + "#" + "#";
|
|
|
|
|
codeTempEntity.setCode(udiCode);
|
|
|
|
|
codeTempEntity.setMainAction(orderEntity.getMainAction());
|
|
|
|
|
codeTempEntity.setAction(orderEntity.getAction());
|
|
|
|
|
codeTempEntity.setOrderId(orderEntity.getBillNo());
|
|
|
|
|
codeTempEntity.setCorpOrderId(orderEntity.getCorpOrderId());
|
|
|
|
|
codeTempEntity.setBatchNo(bizEntity.getBatchNo());
|
|
|
|
|
codeTempEntity.setProduceDate(bizEntity.getProductDate());
|
|
|
|
|
codeTempEntity.setExpireDate(bizEntity.getExpireDate());
|
|
|
|
|
codeTempEntity.setSupId(bizEntity.getSupId());
|
|
|
|
|
codeTempEntity.setRelId(bizEntity.getBindRlFk());
|
|
|
|
|
codeTempEntity.setCount(bizEntity.getCount());
|
|
|
|
|
codeTempEntity.setReCount(bizEntity.getCount());
|
|
|
|
|
codeTempEntity.setDeptCode(orderEntity.getDeptCode());
|
|
|
|
|
codeTempEntity.setInvCode(orderEntity.getDeptCode());
|
|
|
|
|
codeTempEntity.setUpdateTime(new Date());
|
|
|
|
|
codeTempEntity.setCreateTime(new Date());
|
|
|
|
|
codeTempEntity.setPrice(bizEntity.getPrice());
|
|
|
|
|
if (orderEntity.getBillNo() != null && orderEntity.getBillNo().length() >= 12) {
|
|
|
|
|
|
|
|
|
|
codeTempEntity.setInBatchNo(orderEntity.getBillNo().substring(orderEntity.getBillNo().length() - 12));
|
|
|
|
|
}
|
|
|
|
|
codeTempEntities.add(codeTempEntity);
|
|
|
|
|
}
|
|
|
|
|
codeTempService.insertBatch(codeTempEntities);
|
|
|
|
|
bizEntities.forEach(orderDetailBizEntity -> {
|
|
|
|
|
IoOrderDetailCodeEntity orderDetailCodeEntity = new IoOrderDetailCodeEntity();
|
|
|
|
|
BeanUtils.copyProperties(orderDetailBizEntity, orderDetailCodeEntity);
|
|
|
|
|
orderDetailCodeEntity.setId(null);
|
|
|
|
|
orderDetailCodeEntity.setReCount(orderDetailBizEntity.getCount());
|
|
|
|
|
orderDetailCodeEntity.setCount(orderDetailBizEntity.getCount());
|
|
|
|
|
orderDetailCodeService.insert(orderDetailCodeEntity);
|
|
|
|
|
});
|
|
|
|
|
ioCheckInoutService.check(orderEntity.getBillNo());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//生成扫码单据详情
|
|
|
|
|
public List<IoOrderDetailCodeEntity> genOrderDetailCode(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity) {
|
|
|
|
|