| | |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.config.WechatProperty; |
| | | import com.ruoyi.common.enums.OrderType; |
| | | import com.ruoyi.common.utils.LimsDateUtil; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | |
| | | import com.ruoyi.inspect.mapper.InsOrderMapper; |
| | | import com.ruoyi.inspect.mapper.InsProductMapper; |
| | | import com.ruoyi.inspect.mapper.InsSampleMapper; |
| | | import com.ruoyi.inspect.mapper.InsUnqualifiedHandlerMapper; |
| | | import com.ruoyi.inspect.pojo.IfsSplitOrderRecord; |
| | | import com.ruoyi.inspect.pojo.InsOrder; |
| | | import com.ruoyi.inspect.pojo.InsReport; |
| | | import com.ruoyi.inspect.pojo.InsUnqualifiedHandler; |
| | | import com.ruoyi.inspect.service.IfsSplitOrderRecordService; |
| | | import com.ruoyi.inspect.service.InsOrderService; |
| | | import com.ruoyi.inspect.service.InsReportService; |
| | |
| | | |
| | | private IfsSplitOrderRecordService ifsSplitOrderRecordService; |
| | | |
| | | private InsUnqualifiedHandlerMapper insUnqualifiedHandlerMapper; |
| | | |
| | | |
| | | @Override |
| | | public Result selectStandardTreeListByPartNo(String partNo) { |
| | |
| | | |
| | | @Override |
| | | public IPage<IfsInventoryQuantity> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) { |
| | | if(ifsInventoryQuantity.getIsInspect().equals(1)){ |
| | | ifsInventoryQuantity.setOrderType(OrderType.RAW.getValue()); |
| | | } |
| | | return standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity)); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto) { |
| | | ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue()); |
| | | return standardTreeMapper.getIfsByStateOne(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto)); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int inspectionReport(List<Long> ids) { |
| | | public int inspectionReport(List<Long> ids,String orderType) { |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() |
| | | .in(IfsInventoryQuantity::getId, ids) |
| | | .set(IfsInventoryQuantity::getDeclareUser, userMapper.selectById(userId).getName()) |
| | | .set(IfsInventoryQuantity::getDeclareUserId, userId) |
| | | .set(IfsInventoryQuantity::getIsInspect, 1) |
| | | .set(IfsInventoryQuantity::getOrderType,orderType) |
| | | .set(IfsInventoryQuantity::getDeclareDate, LocalDateTime.now()) |
| | | ); |
| | | threadPoolTaskExecutor.execute(() -> { |
| | |
| | | @Override |
| | | public int inspectionReportOne(IfsInventoryQuantity ifsInventoryQuantity) { |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | boolean validateValue = OrderType.validateValue(ifsInventoryQuantity.getOrderType()); |
| | | if(!validateValue){ |
| | | throw new ErrorException("报检失败,非法的销售订单分类枚举"); |
| | | } |
| | | ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() |
| | | .eq(IfsInventoryQuantity::getId, ifsInventoryQuantity.getId()) |
| | | .set(IfsInventoryQuantity::getDeclareUser, userMapper.selectById(userId).getName()) |
| | |
| | | .set(IfsInventoryQuantity::getIsInspect, 1) |
| | | .set(IfsInventoryQuantity::getDeclareDate, LocalDateTime.now()) |
| | | .set(IfsInventoryQuantity::getUpdateBatchNo, ifsInventoryQuantity.getUpdateBatchNo()) |
| | | .set(IfsInventoryQuantity::getOrderType,ifsInventoryQuantity.getOrderType()) |
| | | ); |
| | | |
| | | threadPoolTaskExecutor.execute(() -> { |
| | |
| | | String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate(); |
| | | ifsInventoryQuantityDto.setBeginDeclareDate(null); |
| | | ifsInventoryQuantityDto.setEndDeclareDate(null); |
| | | |
| | | ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue()); |
| | | IPage<IfsInventoryQuantitySupplierDto> ifsByOver = standardTreeMapper.getIfsByOver(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate); |
| | | ifsByOver.getRecords().forEach(r->r.setOrderTypeName(OrderType.getLabelByValue(r.getOrderType()))); |
| | | return ifsByOver; |
| | | } |
| | | |
| | |
| | | ifsInventoryQuantity.setIsSource(0); |
| | | ifsInventoryQuantity.setState(0); |
| | | ifsInventoryQuantity.setIsFinish(0); |
| | | if(!OrderType.validateValue(ifsInventoryQuantity.getOrderType())){ |
| | | throw new ErrorException("新增报检信息失败,非法的销售订单分类枚举"); |
| | | } |
| | | ifsInventoryQuantityMapper.insert(ifsInventoryQuantity); |
| | | } |
| | | |
| | |
| | | if (!ifsInventoryQuantity.getInspectStatus().equals(2)) { |
| | | throw new ErrorException("不合格的原材料才能让步放行"); |
| | | } |
| | | |
| | | // todo:需要判断oa流程是否是让步放行 |
| | | String toLocation = insOrderService.moveRawMaterial(ifsInventoryQuantity); |
| | | |
| | | ifsInventoryQuantityMapper.update(null, new LambdaUpdateWrapper<IfsInventoryQuantity>() |
| | | return ifsInventoryQuantityMapper.update(null, new LambdaUpdateWrapper<IfsInventoryQuantity>() |
| | | .set(IfsInventoryQuantity::getInspectStatus, 4) |
| | | .set(IfsInventoryQuantity::getToLocation, toLocation) |
| | | .eq(IfsInventoryQuantity::getId, ifsInventoryId)); |
| | | |
| | | return true; |
| | | .eq(IfsInventoryQuantity::getId, ifsInventoryId))>0; |
| | | } |
| | | |
| | | /** |
| | |
| | | String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate(); |
| | | ifsInventoryQuantityDto.setBeginDeclareDate(null); |
| | | ifsInventoryQuantityDto.setEndDeclareDate(null); |
| | | |
| | | ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue()); |
| | | return standardTreeMapper.getIfsByQuarter(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate); |
| | | } |
| | | |
| | |
| | | if(Objects.nonNull(splitOrderList) && !splitOrderList.isEmpty()){ |
| | | List<Long> ids = splitOrderList.stream().map(IfsInventoryQuantity::getId).collect(Collectors.toList()); |
| | | ids.add(ifsInventoryQuantity.getId()); |
| | | this.inspectionReport(ids); |
| | | this.inspectionReport(ids,OrderType.RAW.getValue()); |
| | | } |
| | | //勾选同步到MES,保存订单拆分记录 |
| | | if(orderSplitDTO.getPushToMes()){ |