| | |
| | | import com.ruoyi.inspect.service.RawMaterialOrderService; |
| | | import com.ruoyi.common.numgen.NumberGenerator; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.basic.vo.IfsInventoryQuantityVO; |
| | | import com.ruoyi.performance.mapper.AuxiliaryOutputWorkingHoursMapper; |
| | | import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | |
| | | |
| | | private IfsSplitOrderRecordService ifsSplitOrderRecordService; |
| | | |
| | | |
| | | private final NumberGenerator<IfsSplitOrderRecord> splitOrderRecordNumberGenerator; |
| | | |
| | | @Override |
| | | public Result selectStandardTreeListByPartNo(String partNo) { |
| | |
| | | for (FactoryDto factoryDto : factoryDtos) { |
| | | for (LaboratoryDto laboratoryDto : factoryDto.getChildren()) { |
| | | for (SampleTypeDto sampleTypeDto : laboratoryDto.getChildren()) { |
| | | if (sampleTypeDto.getChildren().size() == 0) { |
| | | if (sampleTypeDto.getChildren().isEmpty()) { |
| | | sampleTypeDto.setChildren(standardTreeMapper.getStandardTree3(sampleTypeDto.getValue())); |
| | | } |
| | | // 判断绑定的是否是当前零件号 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<IfsInventoryQuantity> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) { |
| | | return standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity)); |
| | | public IPage<IfsInventoryQuantityVO> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) { |
| | | IPage<IfsInventoryQuantityVO> ifsInventoryQuantityIPage = standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity)); |
| | | ifsInventoryQuantityIPage.getRecords().forEach(f->{ |
| | | Long count = ifsInventoryQuantityMapper.selectCount(Wrappers.<IfsInventoryQuantity>lambdaQuery() |
| | | .ne(IfsInventoryQuantity::getId,f.getId()) |
| | | .eq(IfsInventoryQuantity::getUpdateBatchNo, f.getUpdateBatchNo())); |
| | | f.setLotBatchNoHasRepeat(count>0); |
| | | }); |
| | | return ifsInventoryQuantityIPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | threadPoolTaskExecutor.execute(() -> { |
| | | IfsInventoryQuantity inventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryQuantity.getId()); |
| | | // 企业微信通知 |
| | | String message = ""; |
| | | message += "新增报检通知"; |
| | | message += "\n批次号: " + inventoryQuantity.getUpdateBatchNo(); |
| | | message += "\n零件描述: " + inventoryQuantity.getPartDesc(); |
| | | message += "\n抵达数量: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas(); |
| | | WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); |
| | | //查询相同批号的历史ifs订单 |
| | | List<IfsInventoryQuantity> historyRecords = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery() |
| | | .ne(IfsInventoryQuantity::getId, ifsInventoryQuantity.getId()) |
| | | .eq(IfsInventoryQuantity::getIsInspect, 1) |
| | | .eq(IfsInventoryQuantity::getUpdateBatchNo, ifsInventoryQuantity.getUpdateBatchNo()) |
| | | ); |
| | | if(CollUtil.isEmpty(historyRecords)){ |
| | | // 企业微信通知 |
| | | String message = ""; |
| | | message += "新增报检通知"; |
| | | message += "\n批次号: " + inventoryQuantity.getUpdateBatchNo(); |
| | | message += "\n零件描述: " + inventoryQuantity.getPartDesc(); |
| | | message += "\n抵达数量: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas(); |
| | | WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); |
| | | }else{ |
| | | //获取历史抵达数量 |
| | | double sum = historyRecords.stream().map(IfsInventoryQuantity::getQtyArrived).mapToDouble(BigDecimal::doubleValue).sum(); |
| | | String historyQuantity = sum + inventoryQuantity.getBuyUnitMeas(); |
| | | String messageMarkdown = ""; |
| | | messageMarkdown += "新增报检通知"; |
| | | messageMarkdown += "\n批次号: <font color='warning'>" + inventoryQuantity.getUpdateBatchNo() + "</font>"; |
| | | messageMarkdown += "\n零件描述: "+ inventoryQuantity.getPartDesc(); |
| | | messageMarkdown += "\n抵达数量: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas(); |
| | | messageMarkdown += "\n历史抵达数量: " + historyQuantity; |
| | | WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), messageMarkdown,"markdown"); |
| | | } |
| | | }); |
| | | return 1; |
| | | } |
| | |
| | | } |
| | | //勾选同步到MES,保存订单拆分记录 |
| | | if(orderSplitDTO.getPushToMes()){ |
| | | List<IfsSplitOrderRecord> collect = orderSplitDTO.getSplitDetailList().stream().map(m -> { |
| | | orderSplitDTO.getSplitDetailList().forEach(m -> { |
| | | IfsSplitOrderRecord record = new IfsSplitOrderRecord(); |
| | | BeanUtil.copyProperties(m, record); |
| | | record.setSystemNo(splitOrderRecordNumberGenerator.generateNumberWithPrefix(IfsSplitOrderRecord.DIGIT, IfsSplitOrderRecord.PREFIX, IfsSplitOrderRecord::getSystemNo)); |
| | | record.setOrderNo(ifsInventoryQuantity.getOrderNo()); |
| | | record.setLineNo(ifsInventoryQuantity.getLineNo()); |
| | | record.setReleaseNo(ifsInventoryQuantity.getReleaseNo()); |
| | | record.setReceiptNo(ifsInventoryQuantity.getReceiptNo()); |
| | | return record; |
| | | }).collect(Collectors.toList()); |
| | | return ifsSplitOrderRecordService.saveBatch(collect); |
| | | ifsSplitOrderRecordService.save(record); |
| | | }); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |