| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.common.domain.PageResult; |
| | | import com.vincent.rsf.server.manager.controller.params.TransferItemParams; |
| | | import com.vincent.rsf.server.manager.entity.TransferItem; |
| | | import com.vincent.rsf.server.manager.entity.WkOrder; |
| | | import com.vincent.rsf.server.manager.entity.WkOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.CheckExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.OrderSourceType; |
| | | import com.vincent.rsf.server.manager.enums.OrderType; |
| | | import com.vincent.rsf.server.manager.mapper.TransferMapper; |
| | | import com.vincent.rsf.server.manager.entity.Transfer; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | | import com.vincent.rsf.server.manager.service.TransferItemService; |
| | | import com.vincent.rsf.server.manager.service.TransferService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.WarehouseAreasService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private TransferItemService transferItemService; |
| | | |
| | | @Autowired |
| | | private WarehouseAreasService warehouseAreasService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("编码规则错误:请检查「SYS_TRANSFER_ORDER_CODE」是否设置正确!!"); |
| | | } |
| | | |
| | | WarehouseAreas orgWarehosue = warehouseAreasService.getById(transfer.getOrgAreaId()); |
| | | if (Objects.isNull(orgWarehosue)) { |
| | | throw new CoolException("所选原库区不存在!!"); |
| | | } |
| | | |
| | | WarehouseAreas tarWarehouse = warehouseAreasService.getById(transfer.getTarAreaId()); |
| | | if (Objects.isNull(tarWarehouse)) { |
| | | throw new CoolException("所选目标库区不存在!!"); |
| | | } |
| | | |
| | | transfer.setCode(ruleCode) |
| | | .setExceStatus(CheckExceStatus.CHECK_ORDER_STATUS_UN_EXCE.val) |
| | | .setSource(OrderSourceType.ORDER_SOURCE_TYPE_SYSTEM.val) |
| | | .setOrgAreaId(orgWarehosue.getId()) |
| | | .setOrgAreaName(orgWarehosue.getName()) |
| | | .setOrgWareId(orgWarehosue.getWarehouseId()) |
| | | .setOrgWareName(orgWarehosue.getWarehouseId$()) |
| | | .setTarAreaId(tarWarehouse.getId()) |
| | | .setTarWareId(tarWarehouse.getWarehouseId()) |
| | | .setTarAreaName(tarWarehouse.getName()) |
| | | .setTarWareName(tarWarehouse.getWarehouseId$()) |
| | | .setUpdateTime(new Date()) |
| | | .setCreateTime(new Date()) |
| | | .setUpdateBy(loginUserId) |
| | | .setCreateBy(loginUserId); |
| | | if (!this.save(transfer)) { |
| | |
| | | return R.ok("修改完成!!"); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/7/28 |
| | | * @description: 获取调拔单关联订单 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | public IPage<WkOrder> transfersPage(PageParam<Transfer, BaseParam> pageParam, QueryWrapper<Transfer> transferQueryWrapper) { |
| | | Transfer one = this.getOne(transferQueryWrapper); |
| | | if (Objects.isNull(one)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | return this.baseMapper.transfersPage(pageParam, one.getId()); |
| | | } |
| | | } |