| | |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.params.CheckObjParams; |
| | | import com.vincent.rsf.server.api.controller.params.OtherReceiptParams; |
| | | import com.vincent.rsf.server.api.controller.params.ReceiptParams; |
| | | import com.vincent.rsf.server.api.entity.dto.CheckObjDto; |
| | | import com.vincent.rsf.server.api.entity.dto.InspectDetlDto; |
| | | import com.vincent.rsf.server.api.entity.dto.InspectItemDto; |
| | | import com.vincent.rsf.server.api.entity.dto.ReceiptDetlsDto; |
| | |
| | | import com.vincent.rsf.server.common.security.JwtSubject; |
| | | import com.vincent.rsf.server.common.utils.CommonUtil; |
| | | 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.mapper.*; |
| | |
| | | private MatnrMapper matnrMapper; |
| | | @Resource |
| | | private QlyInspectMapper qlyInspectMapper; |
| | | @Autowired |
| | | private QlyIsptItemService qlyIsptItemService; |
| | | @Resource |
| | | private StockItemMapper stockItemMapper; |
| | | @Resource |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过物料,质检单获取需要质检单据 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R checkObjs(CheckObjParams params) { |
| | | if (Objects.isNull(params.getIsptCode())) { |
| | | throw new CoolException("质检单不能为空"); |
| | | } |
| | | if (Objects.isNull(params.getMatnrCode())) { |
| | | throw new CoolException("物料编码不能为空!"); |
| | | } |
| | | QlyInspect inspect = qlyInspectMapper.selectOne(new LambdaQueryWrapper<QlyInspect>().eq(QlyInspect::getCode, params.getIsptCode())); |
| | | if (Objects.isNull(inspect)) { |
| | | throw new CoolException("质检单据不存在!!"); |
| | | } |
| | | QlyIsptItem isptItem = qlyIsptItemService.getOne(new LambdaQueryWrapper<QlyIsptItem>() |
| | | .eq(QlyIsptItem::getMatnrCode, params.getMatnrCode()) |
| | | .eq(QlyIsptItem::getIspectId, inspect.getId())); |
| | | if (Objects.isNull(isptItem)) { |
| | | throw new CoolException("质检单明细不存在!!"); |
| | | } |
| | | |
| | | CheckObjDto objDto = new CheckObjDto(); |
| | | objDto.setIsptCode(inspect.getCode()) |
| | | .setAsnCode(inspect.getAsnCode()) |
| | | .setMatnrCode(isptItem.getMatnrCode()) |
| | | .setMaktx(isptItem.getMaktx()) |
| | | .setDisQty(isptItem.getDisQty()) |
| | | .setRcptQty(isptItem.getRcptQty()) |
| | | .setSplrBatch(isptItem.getSplrBatch()) |
| | | .setSplrName(isptItem.getSplrName()) |
| | | .setPicPath(isptItem.getPicPath()) |
| | | .setMemo(isptItem.getMemo()) |
| | | .setSafeQty(isptItem.getSafeQty()); |
| | | return R.ok(objDto); |
| | | } |
| | | |
| | | /** |
| | | * 快速质检 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R checkUpdate(QlyIsptItem params) { |
| | | if (Objects.isNull(params.getId()) || Objects.isNull(params.getIspectId())) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | IsptItemsParams itemsParams = new IsptItemsParams(); |
| | | List<QlyIsptItem> items = new ArrayList<>(); |
| | | items.add(params); |
| | | itemsParams.setIsptItem(items).setType("0"); |
| | | if (qlyIsptItemService.batchUpdate(itemsParams)) { |
| | | return R.ok(); |
| | | } else { |
| | | return R.error("保存失败!!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取ReceiptDetlsDtos |
| | | */ |
| | | private R getAsnOrderItem(List<AsnOrderItem> items) { |