| | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.erp.params.*; |
| | | import com.vincent.rsf.server.api.controller.erp.params.dto.CheckDiffDto; |
| | | import com.vincent.rsf.server.api.controller.erp.params.dto.TransferInfoDto; |
| | | import com.vincent.rsf.server.api.controller.erp.params.dto.WkOrderDto; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.controller.dto.LocStockDto; |
| | |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.MatnrServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.impl.TransferItemServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.entity.Fields; |
| | | import com.vincent.rsf.server.system.service.FieldsItemService; |
| | |
| | | @Autowired |
| | | private FieldsService fieldsService; |
| | | @Autowired |
| | | private FieldsItemService fieldsItemService; |
| | | @Autowired |
| | | private MatnrGroupService matnrGroupService; |
| | | @Autowired |
| | | private MatnrServiceImpl matnrService; |
| | |
| | | private DeliveryItemService deliveryItemService; |
| | | @Autowired |
| | | private LocService locService; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | @Autowired |
| | | private WarehouseAreasService warehouseAreasService; |
| | | @Autowired |
| | |
| | | private ReviseLogService reviseLogService; |
| | | @Autowired |
| | | private ReviseLogItemService reviseLogItemService; |
| | | @Autowired |
| | | private CheckDiffService checkDiffService; |
| | | @Autowired |
| | | private CheckDiffItemService checkDiffItemService; |
| | | |
| | | |
| | | /** |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Transactional(timeout = 60, rollbackFor = Exception.class) |
| | | public boolean syncPurchasee(List<OrderParams> orders) { |
| | | if (orders.isEmpty()) { |
| | | throw new CoolException("单据内容不能为空!!"); |
| | |
| | | * @param matnrs |
| | | */ |
| | | @Override |
| | | @Transactional(timeout = 60, rollbackFor = Exception.class) |
| | | public void syncMatnrs(List<BaseMatParms> matnrs) { |
| | | List<Matnr> syncMatnrs = new ArrayList<>(); |
| | | if (!matnrs.isEmpty()) { |
| | |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/8/21 |
| | | * @description: 调拔单明细查询 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | public R queryTransfer(QueryOrderParam queryParams) { |
| | | Transfer transfer = transferService.getOne(new LambdaQueryWrapper<Transfer>() |
| | | .in(Transfer::getCode, queryParams.getOrderNo())); |
| | | if (Objects.isNull(transfer)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | List<TransferItem> orderItems = transferItemService.list(new LambdaQueryWrapper<TransferItem>() |
| | | .eq(TransferItem::getTransferId, transfer.getId())); |
| | | TransferInfoDto wkorderDto = new TransferInfoDto(); |
| | | wkorderDto.setTransfer(transfer).setItems(orderItems); |
| | | return R.ok().add(wkorderDto); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/8/22 |
| | | * @description: 盘点差异单同步 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(timeout = 60, rollbackFor = Exception.class) |
| | | public R syncCheckDiffs(SyncCheckDiffParams syncParams) { |
| | | List<CheckDiff> diffs = checkDiffService.list(new LambdaQueryWrapper<CheckDiff>() |
| | | .eq(CheckDiff::getExceStatus, CheckExceStatus.CHECK_ORDER_STATUS_EXCE_DONE.val) |
| | | .in(CheckDiff::getOrderCode, syncParams.getDiffCode())); |
| | | if (diffs.isEmpty()) { |
| | | return R.ok(); |
| | | } |
| | | List<CheckDiffDto> dtos = new ArrayList<>(); |
| | | diffs.forEach(check -> { |
| | | CheckDiffDto dto = new CheckDiffDto(); |
| | | BeanUtils.copyProperties(check, dto); |
| | | List<CheckDiffItem> items = checkDiffItemService.list(new LambdaQueryWrapper<CheckDiffItem>().eq(CheckDiffItem::getCheckId, check.getId())); |
| | | dto.setItems(items); |
| | | dtos.add(dto); |
| | | }); |
| | | |
| | | return R.ok().add(dtos); |
| | | } |
| | | } |