| | |
| | | User user = userMapper.selectById(c.getCreateBy()); |
| | | dto.setCreateName(user.getNickName()); |
| | | |
| | | dto.setPictureList(parseArray(c.getPictures(), String.class)); |
| | | |
| | | if(Constants.CHECK_TYPE.lack.name().equals(c.getType()) && isSupplier){ |
| | | OrderItem oi = orderItemMapper.selectById(itemId); |
| | | BigDecimal lackFeeSupplier = oi.getSupplierPrice().multiply(new BigDecimal(c.getNum())); |
| | |
| | | |
| | | public void doReduceCheck(OrderItemCheckCommitReduceDTO dto){ |
| | | dto.setType(Constants.CHECK_TYPE.reduce.name()); |
| | | doCheck(dto, dto.getPictureList(), dto.getTargetLevel(), dto.getDeductAmount()); |
| | | doCheck(dto, dto.getTargetLevel(), dto.getDeductAmount()); |
| | | } |
| | | |
| | | public void doCheck(OrderItemCheckCommitDTO dto |
| | | , List<String> pictureList, String targetLevel, BigDecimal deductAmount) { |
| | | public void doCheck(OrderItemCheckCommitDTO dto, String targetLevel, BigDecimal deductAmount) { |
| | | if(dto.getNum() == null || dto.getNum() == 0){ |
| | | throw new ValidationException("处理数量不能为0"); |
| | | } |
| | | |
| | | List<String> pictureList = dto.getPictureList(); |
| | | if(pictureList == null || pictureList.size() == 0){ |
| | | throw new ValidationException("质检图片不能为空"); |
| | | } |
| | | |
| | | OrderItem oi = orderItemMapper.selectById(dto.getOrderItemId()); |
| | | if(dto.getNum() > oi.getNum()){ |
| | | throw new ValidationException("处理数量不能大于商品数量"); |