| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | |
| | | // OrderPakout orderPakout = orderPakOutService.selectByNo(orderNo); |
| | | CheckOrder checkOrder = checkOrderService.selectOne(new EntityWrapper<CheckOrder>().eq("order_no", orderNo)); |
| | | int ioType = checkOrder.getDocType() == 8 ? 107 : (taskDto.isAll() ? 101 : 103); |
| | | if(ioType == 101){ |
| | | boolean DiffQty = taskDto.getLocDtos().stream().allMatch(locDto -> |
| | | locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locDto.getLocNo()) |
| | | .eq("matnr", locDto.getMatnr()) |
| | | .eq("batch", locDto.getBatch()) |
| | | .eq("standby1",locDto.getStandby2()) |
| | | ).getDiffQty().compareTo(BigDecimal.ZERO) == 0 |
| | | ); |
| | | if (!DiffQty){ |
| | | ioType = 103; |
| | | } |
| | | } |
| | | StaDesc staDesc = staDescService.queryCrnStnAuto(ioType, locMast.getCrnNo(), staNo.getDevNo()); |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType)); |