| | |
| | | import com.vincent.rsf.server.common.security.JwtSubject; |
| | | import com.vincent.rsf.server.common.utils.CommonUtil; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.common.utils.JSONUtil; |
| | | import com.vincent.rsf.server.common.utils.JwtUtil; |
| | | import com.vincent.rsf.server.manager.controller.params.IsptItemsParams; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptStatus; |
| | | import com.vincent.rsf.server.manager.mapper.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.system.constant.CodeRes; |
| | |
| | | import com.vincent.rsf.server.system.entity.*; |
| | | import com.vincent.rsf.server.system.mapper.FieldsMapper; |
| | | import com.vincent.rsf.server.system.mapper.TenantMapper; |
| | | import com.vincent.rsf.server.system.mapper.UserMapper; |
| | | import com.vincent.rsf.server.system.service.FieldsItemService; |
| | | import com.vincent.rsf.server.system.service.UserLoginService; |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.utils.ExtendFieldsUtils; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import net.sf.jsqlparser.statement.select.Wait; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | Double receiptQty = receipts.stream().mapToDouble(ReceiptDetlsDto::getReceiptQty).sum(); |
| | | |
| | | if (Objects.isNull(receiptQty) || receiptQty.compareTo(0.00) <= 0) { |
| | | throw new CoolException("收货数量不能小于或等于零!!"); |
| | | } |
| | | |
| | | String asnCode = receipts.stream().findFirst().get().getAsnCode(); |
| | | |
| | | AsnOrder asnOrder = asnOrderMapper.getOne(new LambdaQueryWrapper<AsnOrder>() |
| | |
| | | */ |
| | | @Override |
| | | public R getReceiptAreas() { |
| | | return R.ok(warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>().eq(WarehouseAreas::getType, WarehouseAreaType.WAREHOUSE_AREA_RECEIPT.type))); |
| | | List<WarehouseAreas> areas = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>().eq(WarehouseAreas::getType, WarehouseAreaType.WAREHOUSE_AREA_RECEIPT.type)); |
| | | return R.ok(areas); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * @param |
| | | * @param userId |
| | | * @return |
| | | * @author Ryan |
| | | * @description PDA组拖 |
| | | * @param |
| | | * @return |
| | | * @time 2025/3/29 14:26 |
| | | */ |
| | | @Override |
| | | public WaitPakin mergeItems(WaitPakinParam waitPakin) { |
| | | return waitPakinService.mergeItems(waitPakin); |
| | | public WaitPakin mergeItems(WaitPakinParam waitPakin, Long userId) { |
| | | return waitPakinService.mergeItems(waitPakin, userId); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (Objects.isNull(params.getIsptCode())) { |
| | | throw new CoolException("质检单不能为空"); |
| | | } |
| | | QlyInspect inspect = qlyInspectMapper.selectOne(new LambdaQueryWrapper<QlyInspect>().eq(QlyInspect::getCode, params.getIsptCode())); |
| | | List<Short> asList = Arrays.asList(QlyIsptStatus.QLY_ISPT_STAS_DONE.val, QlyIsptStatus.QLY_ISPT_STAS_CLOSE.val); |
| | | QlyInspect inspect = qlyInspectMapper.selectOne(new LambdaQueryWrapper<QlyInspect>() |
| | | .notIn(QlyInspect::getIsptStatus, asList) |
| | | .eq(QlyInspect::getCode, params.getIsptCode())); |
| | | if (Objects.isNull(inspect)) { |
| | | throw new CoolException("质检单据不存在!!"); |
| | | } |
| | |
| | | public R getItemByContainer(Map<String, Object> params) { |
| | | //获取组拖未生成任务的组拖档 |
| | | List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | Short flagDefect = 0; |
| | | if (!Objects.isNull(params.get("type")) && params.get("type").equals("defective")) { |
| | | flagDefect = 1; |
| | | } |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, params.get("barcode").toString()) |
| | | .eq(WaitPakin::getFlagDefect, flagDefect) |
| | | .in(WaitPakin::getIoStatus, asList)); |
| | | if (Objects.isNull(waitPakin)) { |
| | | return R.ok(new ArrayList<>()); |
| | |
| | | if (pakinItems.isEmpty()) { |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | List<String> list = pakinItems.stream().map(WaitPakinItem::getTrackCode).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new QueryWrapper<WarehouseAreasItem>() |
| | | .select("SUM(anfme) as anfme, track_code, asn_code, id, splr_batch, ispt_result, plat_item_id, batch, qty, work_qty, matnr_code, matnr_id, maktx") |
| | | .lambda() |
| | | .in(WarehouseAreasItem::getTrackCode, list) |
| | | .groupBy(WarehouseAreasItem::getSplrBatch, |
| | | WarehouseAreasItem::getTrackCode); |
| | | List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.list(queryWrapper); |
| | | for (int i = 0; i < warehouseAreasItems.size(); i++) { |
| | | for (WaitPakinItem pakinItem : pakinItems) { |
| | | if (warehouseAreasItems.get(i).getTrackCode().equals(pakinItem.getTrackCode())) { |
| | | warehouseAreasItems.get(i).setAnfme(pakinItem.getAnfme()); |
| | | if (!Objects.isNull(params.get("type")) && params.get("type").equals("defective")) { |
| | | return R.ok(pakinItems); |
| | | } else { |
| | | List<String> list = pakinItems.stream().map(WaitPakinItem::getTrackCode).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new QueryWrapper<WarehouseAreasItem>() |
| | | .select("SUM(anfme) as anfme, track_code, asn_code, id, splr_batch, ispt_result, plat_item_id, batch, qty, work_qty, matnr_code, matnr_id, maktx") |
| | | .lambda() |
| | | .in(WarehouseAreasItem::getTrackCode, list) |
| | | .groupBy(WarehouseAreasItem::getSplrBatch, |
| | | WarehouseAreasItem::getTrackCode); |
| | | List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.list(queryWrapper); |
| | | for (int i = 0; i < warehouseAreasItems.size(); i++) { |
| | | for (WaitPakinItem pakinItem : pakinItems) { |
| | | if (warehouseAreasItems.get(i).getTrackCode().equals(pakinItem.getTrackCode())) { |
| | | warehouseAreasItems.get(i).setAnfme(pakinItem.getAnfme()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(warehouseAreasItems); |
| | | } |
| | | return R.ok(warehouseAreasItems); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 不良标签 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/12 08:12 |
| | | */ |
| | | @Override |
| | | public R defectProducts(String trackCode) { |
| | | AsnOrderItem orderItem = asnOrderItemMapper.selectOne(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getTrackCode, trackCode)); |
| | | return R.ok(orderItem); |
| | | } |
| | | |
| | | /** |