11/12 上货时对取货槽,产品判断

dev_unify
wangwei 8 months ago
parent 4c0140e05a
commit c814146f6c

@ -123,6 +123,9 @@ public class IoCodeTempController extends BaseController {
@Resource
IoSplitFifoInvService ioSplitFifoInvService;
@Resource
SysWorkplaceQueueService sysWorkplaceQueueService;
@Resource
IoCollectOrderBackupService ioCollectOrderBackupService;
@ -1666,25 +1669,32 @@ public class IoCodeTempController extends BaseController {
orderService.insertOrder(orderEntity);
}
//todo 不关联查了直接查queue表
if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_OUT)) {
// 判断货位里面是否有相同产品
if (orderEntity != null && StrUtil.isNotEmpty(orderEntity.getWorkPlaceQueueCode())) {
IoSplitFifoCodeEntity splitFifoCodeEntity = splitFifoCodeService.findByQueueCode(orderEntity.getWorkPlaceQueueCode());
if (splitFifoCodeEntity != null) {
if (!udiRelevanceResponse.getId().equals(splitFifoCodeEntity.getRelId())) {
orderService.deleteByBillNo(orderId);
return ResultVOUtils.error(507, "上货产品不符!" + "当前取货槽已被"+ udiRelevanceResponse.getCpmctymc() + "使用" );
}
} else {
//todo 判断货位里面是否有相同产品
UdiRelevanceResponse udiRelevanceResponse1 = udiRelevanceResponses.get(0);
List<IoSplitFifoCodeEntity> byRelId = fifoCodeService.findByRelId(addOrderRequest.getWorkPlaceCode(), udiRelevanceResponse1.getId());
if (byRelId != null && byRelId.size() > 0) {
orderService.deleteByBillNo(orderId);
IoSplitFifoCodeEntity ioSplitFifoCodeEntity = byRelId.get(0);
return ResultVOUtils.error(507, "当前产品已绑定在" + ioSplitFifoCodeEntity.getWorkPlaceQueueCode() + "取货槽");
SysWorkplaceQueue workplaceQueue = sysWorkplaceQueueService.getOne(new LambdaQueryWrapper<SysWorkplaceQueue>()
.eq(SysWorkplaceQueue::getCode,orderEntity.getWorkPlaceQueueCode()));
if (workplaceQueue != null) {
//判断槽位产品是否一样
if (StrUtil.isNotBlank(workplaceQueue.getRelId())){
if (!udiRelevanceResponse.getId().equals(Long.parseLong(workplaceQueue.getRelId()))) {
// orderService.deleteByBillNo(orderId);
UdiRelevanceResponse udiRelevanceResponse1 = udiRelevanceService.selectByRelId(workplaceQueue.getRelId());
return ResultVOUtils.error(507, "上货产品不符!" + "当前取货槽已被"+ udiRelevanceResponse1.getCpmctymc() + "使用" );
}
} else {
//判断产品是否已经绑定其他槽位
SysWorkplaceQueue workplaceQueue1 = sysWorkplaceQueueService.getOne(new LambdaQueryWrapper<SysWorkplaceQueue>().eq(SysWorkplaceQueue::getRelId, udiRelevanceResponse.getId()));
if (workplaceQueue1 != null ) {
if (!orderEntity.getWorkPlaceQueueCode().equals(workplaceQueue1.getCode())) {
// orderService.deleteByBillNo(orderId);
return ResultVOUtils.error(507, "当前产品已绑定在" + workplaceQueue1.getCode() + "取货槽");
}
}
}
}else {
return ResultVOUtils.error(500, "取货槽位不存在!");
}
if (orderEntity != null && CollUtil.isNotEmpty(codeEnttitys)) {
boolean isSame = false;
@ -1697,11 +1707,19 @@ public class IoCodeTempController extends BaseController {
// orderService.deleteByBillNo(orderId);
return ResultVOUtils.error(507, "上货产品不符!");
}
//校验完成 获取当前槽位 绑定产品
SysWorkplaceQueue sysWorkplaceQueue = sysWorkplaceQueueService.getOne(new LambdaQueryWrapper<SysWorkplaceQueue>()
.eq(SysWorkplaceQueue::getCode, orderEntity.getWorkPlaceQueueCode()));
if (sysWorkplaceQueue.getRelId() == null){
sysWorkplaceQueue.setRelId(udiRelevanceResponse.getId() + "");
sysWorkplaceQueueService.updateById(sysWorkplaceQueue);
}
}
}
if (IntUtil.value(addOrderRequest.getOrderType()) == ConstantStatus.ORDER_TYPE_NORMAL && bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.getCheckWebNew() != 0) {
boolean isBillExit = orderDetailBizService.isExit(orderEntity.getBillNo());

@ -70,6 +70,7 @@
</foreach>
</if>
</where>
GROUP BY swq.code
</select>
<select id="filterList" resultType="com.glxp.api.res.basic.SysWorkplaceQueueResponse">

Loading…
Cancel
Save