src/main/java/com/ruoyi/approve/service/impl/ApproveNodeServiceImpl.java
@@ -12,7 +12,6 @@ import com.ruoyi.approve.pojo.ApproveProcess; import com.ruoyi.approve.service.IApproveNodeService; import com.ruoyi.common.enums.FileNameType; import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.device.mapper.DeviceRepairMapper; import com.ruoyi.device.pojo.DeviceRepair; @@ -206,8 +205,8 @@ purchaseLedgerServiceImpl.addQualityInspect(purchaseLedger, salesLedgerProduct); }else { //ç´æ¥å ¥åº stockUtils.addStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockInQualifiedRecordTypeEnum.PURCHASE_STOCK_IN.getCode(), purchaseLedger.getId(),salesLedgerProduct.getBatchNo(),salesLedgerProduct.getCustomer()); // stockUtils.addStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockInQualifiedRecordTypeEnum.PURCHASE_STOCK_IN.getCode(), // purchaseLedger.getId(),salesLedgerProduct.getBatchNo(),salesLedgerProduct.getCustomer()); } } } else if (status.equals(3)) { src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
@@ -16,6 +16,7 @@ import org.springframework.stereotype.Component; import java.math.BigDecimal; import java.time.LocalDate; import java.util.Collections; @Component @@ -67,7 +68,7 @@ * @param recordType * @param recordId */ public void addStock(Long productModelId, BigDecimal quantity, String recordType, Long recordId,String batchNo,String customer) { public void addStock(Long productModelId, BigDecimal quantity, String recordType, Long recordId, String batchNo, String customer, LocalDate productionDate) { StockInventoryDto stockInventoryDto = new StockInventoryDto(); stockInventoryDto.setRecordId(recordId); if (recordType != null) { @@ -77,6 +78,11 @@ stockInventoryDto.setProductModelId(productModelId); stockInventoryDto.setBatchNo(batchNo); stockInventoryDto.setCustomer(customer); if (stockInventoryDto.getProductionDate() == null) { stockInventoryDto.setProductionDate(LocalDate.now()); }else { stockInventoryDto.setProductionDate(productionDate); } stockInventoryService.addstockInventory(stockInventoryDto); } src/main/java/com/ruoyi/production/dto/DrawMaterialDto.java
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.time.LocalDate; @Data @ApiModel("颿åDTO") @@ -41,4 +42,7 @@ @ApiModelProperty("ä¾åºååç§°") private String customer; @ApiModelProperty("æææ") private LocalDate productionDate; } src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
@@ -277,11 +277,11 @@ } // å¦æææ°æ®å å åºå ProductOrder productOrder = productOrderMapper.selectById(productOrderDto.getId()); if (productOrder != null) { if (productOrder.getDrawMaterials() != null) { List<DrawMaterialDto> materialDtoList = JSON.parseArray(productOrder.getDrawMaterials(), DrawMaterialDto.class); for (DrawMaterialDto drawMaterialDto : materialDtoList) { stockUtils.addStock(drawMaterialDto.getProductModelId(), drawMaterialDto.getRequisitionQty(), null, productOrderDto.getId(), drawMaterialDto.getBatchNo(), drawMaterialDto.getCustomer() drawMaterialDto.getBatchNo(), drawMaterialDto.getCustomer(),drawMaterialDto.getProductionDate() ); } } src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -246,7 +246,6 @@ throw new RuntimeException("ç产订åä¸åå¨"); } Product product = productMapper.selectById(productModel.getProductId()); QualityInspect qualityInspect = new QualityInspect(); qualityInspect.setProductId(product.getId()); @@ -280,7 +279,7 @@ //ç´æ¥å ¥åº String customer = "é¿æ²»å¸è½´æ¿å¶é æéå ¬å¸"; stockUtils.addStock(productProcessRouteItem.getProductModelId(), productionProductOutput.getQuantity().subtract(productionProductOutput.getScrapQty()), StockInQualifiedRecordTypeEnum.PRODUCTION_REPORT_STOCK_IN.getCode(), productionProductMain.getId(),order.getBatchNo(),customer StockInQualifiedRecordTypeEnum.PRODUCTION_REPORT_STOCK_IN.getCode(), productionProductMain.getId(),order.getBatchNo(),customer,null ); } /*æ´æ°å·¥ååç产订å*/ src/main/java/com/ruoyi/purchase/dto/PurchaseLedgerProductImportDto.java
@@ -1,7 +1,6 @@ package com.ruoyi.purchase.dto; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import com.ruoyi.sales.dto.SalesLedgerProductImportDto; import lombok.Data; import java.math.BigDecimal; @@ -17,16 +16,6 @@ private String purchaseContractNumber; /** * é¢è¦æ°é */ @Excel(name = "åºåé¢è¦æ°é") private BigDecimal warnNum; @Excel(name = "éå®åå·") private String salesContractNo; /** * 产å大类 */ @Excel(name = "产å大类") @@ -39,16 +28,22 @@ private String specificationModel; /** * UIDç */ @Excel(name = "UIDç ") private String uidNo; /** * æ¹æ¬¡å· */ @Excel(name = "æ¹æ¬¡å·") private String batchNo; /** * åä½ */ @Excel(name = "åä½") private String unit; /** * æ°é */ @Excel(name = "æ°é") private BigDecimal quantity; /** * ç¨ç @@ -63,6 +58,12 @@ private BigDecimal taxInclusiveUnitPrice; /** * æ°é */ @Excel(name = "æ°é") private BigDecimal quantity; /** * å«ç¨æ»ä»· */ @Excel(name = "å«ç¨æ»ä»·") @@ -75,6 +76,12 @@ private String invoiceType; /** * é¢è¦æ°é */ @Excel(name = "åºåé¢è¦æ°é") private BigDecimal warnNum; /** * æ¯å¦è´¨æ£ */ @Excel(name = "æ¯å¦è´¨æ£", readConverterExp = "0=å¦,1=æ¯") src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
@@ -17,6 +17,7 @@ import com.ruoyi.basic.pojo.ProductModel; import com.ruoyi.basic.pojo.SupplierManage; import com.ruoyi.common.enums.FileNameType; import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; @@ -27,6 +28,7 @@ import com.ruoyi.other.pojo.TempFile; import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; import com.ruoyi.procurementrecord.utils.StockUtils; import com.ruoyi.project.system.domain.SysUser; import com.ruoyi.project.system.mapper.SysUserMapper; import com.ruoyi.purchase.dto.PurchaseLedgerDto; @@ -88,68 +90,70 @@ @Slf4j public class PurchaseLedgerServiceImpl extends ServiceImpl<PurchaseLedgerMapper, PurchaseLedger> implements IPurchaseLedgerService { @Autowired private AccountExpenseService accountExpenseService; private AccountExpenseService accountExpenseService; @Autowired private PurchaseLedgerMapper purchaseLedgerMapper; private PurchaseLedgerMapper purchaseLedgerMapper; @Autowired private SalesLedgerMapper salesLedgerMapper; private SalesLedgerMapper salesLedgerMapper; @Autowired private SalesLedgerProductMapper salesLedgerProductMapper; private SalesLedgerProductMapper salesLedgerProductMapper; @Autowired private SysUserMapper userMapper; private SysUserMapper userMapper; @Autowired private TempFileMapper tempFileMapper; private TempFileMapper tempFileMapper; @Autowired private CommonFileMapper commonFileMapper; private CommonFileMapper commonFileMapper; @Autowired private SupplierManageMapper supplierManageMapper; private SupplierManageMapper supplierManageMapper; @Autowired private ProductMapper productMapper; private ProductMapper productMapper; @Autowired private ProductModelMapper productModelMapper; private ProductModelMapper productModelMapper; @Autowired private SysUserMapper sysUserMapper; private SysUserMapper sysUserMapper; @Autowired private TicketRegistrationMapper ticketRegistrationMapper; private TicketRegistrationMapper ticketRegistrationMapper; @Autowired private ProductRecordMapper productRecordMapper; private ProductRecordMapper productRecordMapper; @Autowired private PaymentRegistrationMapper paymentRegistrationMapper; private PaymentRegistrationMapper paymentRegistrationMapper; @Autowired private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; @Autowired private StringRedisTemplate redisTemplate; private StringRedisTemplate redisTemplate; @Autowired private QualityInspectMapper qualityInspectMapper; private QualityInspectMapper qualityInspectMapper; @Autowired private CommonFileServiceImpl commonFileService; private CommonFileServiceImpl commonFileService; @Autowired private QualityTestStandardBindingMapper qualityTestStandardBindingMapper; private QualityTestStandardBindingMapper qualityTestStandardBindingMapper; @Autowired private QualityTestStandardParamMapper qualityTestStandardParamMapper; private QualityTestStandardParamMapper qualityTestStandardParamMapper; @Autowired private QualityTestStandardMapper qualityTestStandardMapper; private QualityTestStandardMapper qualityTestStandardMapper; @Autowired private QualityInspectParamMapper qualityInspectParamMapper; private QualityInspectParamMapper qualityInspectParamMapper; @Autowired private ApproveProcessServiceImpl approveProcessService; private ApproveProcessServiceImpl approveProcessService; @Autowired private ProcurementRecordMapper procurementRecordStorageMapper; private ProcurementRecordMapper procurementRecordStorageMapper; @Autowired private PurchaseLedgerTemplateMapper purchaseLedgerTemplateMapper; private PurchaseLedgerTemplateMapper purchaseLedgerTemplateMapper; @Autowired private SalesLedgerProductTemplateMapper salesLedgerProductTemplateMapper; private SalesLedgerProductTemplateMapper salesLedgerProductTemplateMapper; @Autowired private StockUtils stockUtils; @Value("${file.upload-dir}") private String uploadDir; @@ -201,23 +205,25 @@ } purchaseLedgerMapper.updateById(purchaseLedger); } // 6.éè´å®¡æ ¸æ°å¢ addApproveByPurchase(loginUser, purchaseLedger); // 4. å¤çåè¡¨æ°æ® List<SalesLedgerProduct> productList = purchaseLedgerDto.getProductData(); if (productList != null && !productList.isEmpty()) { handleSalesLedgerProducts(purchaseLedger.getId(), productList, purchaseLedgerDto.getType(),supplierManage); handleSalesLedgerProducts(purchaseLedger.getId(), productList, purchaseLedgerDto.getType(), supplierManage); } //æ°å¢åæææ£éª 审æ¹ä¹åæçææ£éª // if (productList != null) { // for (SalesLedgerProduct saleProduct : productList) { // //æ¯å¦æ¨éè´¨æ£ï¼å¦ætrue就添å // if (saleProduct.getIsChecked()) { // addQualityInspect(purchaseLedger, saleProduct); // } // } // } //ä¸å®¡æ¹ if (productList != null) { for (SalesLedgerProduct saleProduct : productList) { //æ¯å¦æ¨éè´¨æ£ï¼å¦ætrue就添å if (saleProduct.getIsChecked()) { addQualityInspect(purchaseLedger, saleProduct); } else { //ç´æ¥å ¥åº stockUtils.addStock(saleProduct.getProductModelId(), saleProduct.getQuantity(), StockInQualifiedRecordTypeEnum.PURCHASE_STOCK_IN.getCode(), purchaseLedger.getId(), saleProduct.getBatchNo(), saleProduct.getCustomer(), null); } } } // 5. è¿ç§»ä¸´æ¶æä»¶å°æ£å¼ç®å½ if (purchaseLedgerDto.getTempFileIds() != null && !purchaseLedgerDto.getTempFileIds().isEmpty()) { migrateTempFilesToFormal(purchaseLedger.getId(), purchaseLedgerDto.getTempFileIds()); @@ -239,12 +245,12 @@ qualityInspect.setUnit(saleProduct.getUnit()); qualityInspect.setQuantity(saleProduct.getQuantity()); qualityInspectMapper.insert(qualityInspect); List<QualityTestStandard> qualityTestStandard = qualityTestStandardMapper.getQualityTestStandardByProductId(saleProduct.getProductId(), 0,null); if (qualityTestStandard.size()>0){ List<QualityTestStandard> qualityTestStandard = qualityTestStandardMapper.getQualityTestStandardByProductId(saleProduct.getProductId(), 0, null); if (!qualityTestStandard.isEmpty()) { qualityInspect.setTestStandardId(qualityTestStandard.get(0).getId()); qualityInspectMapper.updateById(qualityInspect); qualityTestStandardParamMapper.selectList(Wrappers.<QualityTestStandardParam>lambdaQuery() .eq(QualityTestStandardParam::getTestStandardId,qualityTestStandard.get(0).getId())) .eq(QualityTestStandardParam::getTestStandardId, qualityTestStandard.get(0).getId())) .forEach(qualityTestStandardParam -> { QualityInspectParam param = new QualityInspectParam(); com.ruoyi.common.utils.bean.BeanUtils.copyProperties(qualityTestStandardParam, param); @@ -255,7 +261,7 @@ } } private void handleSalesLedgerProducts(Long salesLedgerId, List<SalesLedgerProduct> products, Integer type,SupplierManage supplierManage) { private void handleSalesLedgerProducts(Long salesLedgerId, List<SalesLedgerProduct> products, Integer type, SupplierManage supplierManage) { if (products == null || products.isEmpty()) { throw new BaseException("产åä¿¡æ¯ä¸åå¨"); } @@ -422,12 +428,12 @@ @Transactional(rollbackFor = Exception.class) public int deletePurchaseLedgerByIds(Long[] ids) { if (ids == null || ids.length == 0) { throw new BaseException("请éä¸è³å°ä¸æ¡æ°æ®"); throw new BaseException("请éä¸è³å°ä¸æ¡æ°æ®"); } for (Long id : ids) { PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(id); if (purchaseLedger.getApprovalStatus().equals(3)) { throw new BaseException(purchaseLedger.getPurchaseContractNumber()+"å·²ç»å®¡æ¹éè¿ï¼ä¸å 许å é¤"); throw new BaseException(purchaseLedger.getPurchaseContractNumber() + "å·²ç»å®¡æ¹éè¿ï¼ä¸å 许å é¤"); } } // æ¹éå é¤å ³èçéè´å ¥åºè®°å½ @@ -450,11 +456,11 @@ salesLedgerProductMapper.delete(queryWrapper); // æ¹éå é¤å ³èçéè´å°è´¦çæ¥ç¥¨ç»è®° LambdaQueryWrapper<TicketRegistration> ticketRegistrationLambdaQueryWrapper = new LambdaQueryWrapper<>(); ticketRegistrationLambdaQueryWrapper.in(TicketRegistration::getPurchaseLedgerId,ids); ticketRegistrationLambdaQueryWrapper.in(TicketRegistration::getPurchaseLedgerId, ids); ticketRegistrationMapper.delete(ticketRegistrationLambdaQueryWrapper); // æ¹éå é¤å ³èçéè´å°è´¦çæ¥ç¥¨ç»è®°è®°å½ LambdaQueryWrapper<ProductRecord> productRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); productRecordLambdaQueryWrapper.in(ProductRecord::getPurchaseLedgerId,ids); productRecordLambdaQueryWrapper.in(ProductRecord::getPurchaseLedgerId, ids); productRecordMapper.delete(productRecordLambdaQueryWrapper); // æ¹éå é¤ä»æ¬¾ç»è®° LambdaQueryWrapper<PaymentRegistration> paymentRegistrationLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -466,7 +472,7 @@ List<QualityInspect> qualityInspects = qualityInspectMapper.selectList(materialInspectLambdaQueryWrapper); qualityInspects.stream().forEach(qualityInspect -> { if (ObjectUtils.isNotEmpty(qualityInspect.getInspectState())&&qualityInspect.getInspectState().equals(1)) { if (ObjectUtils.isNotEmpty(qualityInspect.getInspectState()) && qualityInspect.getInspectState().equals(1)) { throw new BaseException("å·²æäº¤çæ£éªåä¸è½å é¤"); } }); @@ -482,7 +488,7 @@ // å é¤éè´å®¡æ¹è®°å½ for (Long id : ids) { PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(id); if(purchaseLedger != null){ if (purchaseLedger != null) { ApproveProcess one = approveProcessService.getOne(new LambdaQueryWrapper<ApproveProcess>() .eq(ApproveProcess::getApproveType, 5) .eq(ApproveProcess::getApproveDelete, 0) @@ -527,7 +533,7 @@ // 3.æ¥è¯¢ä¸ä¼ æä»¶ LambdaQueryWrapper<CommonFile> salesLedgerFileWrapper = new LambdaQueryWrapper<>(); salesLedgerFileWrapper.eq(CommonFile::getCommonId, purchaseLedger.getId()) .eq(CommonFile::getType,FileNameType.PURCHASE.getValue()); .eq(CommonFile::getType, FileNameType.PURCHASE.getValue()); List<CommonFile> salesLedgerFiles = commonFileMapper.selectList(salesLedgerFileWrapper); // 4. è½¬æ¢ DTO @@ -678,7 +684,7 @@ // ä¾åºåæ°æ® List<SupplierManage> customers = supplierManageMapper.selectList(new LambdaQueryWrapper<SupplierManage>().in(SupplierManage::getSupplierName, salesLedgerImportDtoList.stream().map(PurchaseLedgerImportDto::getSupplierName).collect(Collectors.toList()))); List<Map<String,Object>> list = productModelMapper.getProductAndModelList(); List<Map<String, Object>> list = productModelMapper.getProductAndModelList(); // å½å ¥äººæ°æ® List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().in(SysUser::getNickName, salesLedgerImportDtoList.stream().map(PurchaseLedgerImportDto::getRecorderName).collect(Collectors.toList()))); @@ -686,7 +692,7 @@ PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectOne(new LambdaQueryWrapper<PurchaseLedger>() .eq(PurchaseLedger::getPurchaseContractNumber, salesLedgerImportDto.getPurchaseContractNumber()) .last("limit 1")); if(purchaseLedger != null){ if (purchaseLedger != null) { continue; } PurchaseLedger salesLedger = new PurchaseLedger(); @@ -713,12 +719,12 @@ throw new RuntimeException("éè´åå·:" + salesLedgerImportDto.getPurchaseContractNumber() + ",æ 对åºäº§åæ°æ®ï¼"); salesLedger.setContractAmount(salesLedgerProductImportDtos.stream() .map(PurchaseLedgerProductImportDto::getTaxInclusiveTotalPrice) .reduce(BigDecimal.ZERO,BigDecimal::add)); .reduce(BigDecimal.ZERO, BigDecimal::add)); // éè¿éå®åå·ç»å®éå® SalesLedger salesLedger1 = salesLedgerMapper.selectOne(new LambdaQueryWrapper<SalesLedger>() .eq(SalesLedger::getSalesContractNo, salesLedger.getSalesContractNo()) .last("LIMIT 1")); if(salesLedger1 != null){ if (salesLedger1 != null) { salesLedger.setSalesLedgerId(salesLedger1.getId()); } // éè´å®¡æ ¸ @@ -739,6 +745,24 @@ for (PurchaseLedgerProductImportDto salesLedgerProductImportDto : salesLedgerProductImportDtos) { SalesLedgerProduct salesLedgerProduct = new SalesLedgerProduct(); // æ¥è¯¢äº§å Product product = productMapper.selectOne(new LambdaQueryWrapper<Product>() .eq(Product::getProductName, salesLedgerProductImportDto.getProductCategory())); if (product == null) { throw new RuntimeException("请维æ¤äº§åï¼" + salesLedgerProductImportDto.getProductCategory()); } // æ¥è¯¢äº§ååå· ProductModel productModel = productModelMapper.selectOne(new LambdaQueryWrapper<ProductModel>() .eq(ProductModel::getProductId, product.getId()) .eq(ProductModel::getModel, salesLedgerProductImportDto.getSpecificationModel()) .eq(ProductModel::getUidNo, salesLedgerProductImportDto.getUidNo())); if (productModel == null) { throw new RuntimeException("请维æ¤äº§åã" + salesLedgerProductImportDto.getProductCategory() + "ãçåå·ã" + salesLedgerProductImportDto.getSpecificationModel() + "ãåUIDç ã" + salesLedgerProductImportDto.getUidNo() + "ã"); } salesLedgerProduct.setProductModelId(productModel.getId()); salesLedgerProduct.setProductId(product.getId()); BeanUtils.copyProperties(salesLedgerProductImportDto, salesLedgerProduct); salesLedgerProduct.setSalesLedgerId(salesLedger.getId()); salesLedgerProduct.setType(2); @@ -758,21 +782,25 @@ salesLedgerProduct.setApproveStatus(0); salesLedgerProduct.setPendingTicketsTotal(salesLedgerProductImportDto.getTaxInclusiveTotalPrice()); // æ¯å¦è´¨æ£å¤æ if (salesLedgerProductImportDto.getIsChecked() == null) { throw new RuntimeException("è¯·å¡«åæ¯å¦è´¨æ£ï¼"); } salesLedgerProduct.setIsChecked(salesLedgerProductImportDto.getIsChecked() == 1); if(salesLedgerProductImportDto.getIsChecked() == 1){ if (salesLedgerProductImportDto.getIsChecked() == 1) { addQualityInspect(salesLedger, salesLedgerProduct); } else { //ç´æ¥å ¥åº stockUtils.addStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockInQualifiedRecordTypeEnum.PURCHASE_STOCK_IN.getCode(), salesLedger.getId(), salesLedgerProduct.getBatchNo(), salesLedger.getSupplierName(), LocalDate.now()); } salesLedgerProductMapper.insert(salesLedgerProduct); } // éè´å®¡æ ¸ addApproveByPurchase(loginUser,salesLedger); } return AjaxResult.success("å¯¼å ¥æå"); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } return AjaxResult.success("å¯¼å ¥å¤±è´¥"); } @Override @@ -801,7 +829,7 @@ return resultDto; } public void addApproveByPurchase(LoginUser loginUser,PurchaseLedger purchaseLedger) throws Exception { public void addApproveByPurchase(LoginUser loginUser, PurchaseLedger purchaseLedger) throws Exception { ApproveProcessVO approveProcessVO = new ApproveProcessVO(); approveProcessVO.setApproveType(5); approveProcessVO.setApproveDeptId(loginUser.getCurrentDeptId()); src/main/java/com/ruoyi/quality/pojo/QualityInspect.java
@@ -214,7 +214,7 @@ @TableField(exist = false) private String purchaseContractNo; private String BatchNo; private String batchNo; private String manufacturingTeam; /** src/main/java/com/ruoyi/quality/pojo/QualityUnqualified.java
@@ -10,6 +10,7 @@ import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Date; @@ -144,4 +145,10 @@ @ApiModelProperty("æ¯å¦ä¸åæ ¼å¤çèªå·±æ°å¢") @TableField(exist = false) private Boolean method; @ApiModelProperty("çäº§æ¥æ") private LocalDate productionDate; @ApiModelProperty("æ¹å·") private String batchNo; } src/main/java/com/ruoyi/quality/service/impl/QualityInspectServiceImpl.java
@@ -78,6 +78,9 @@ public int add(QualityInspectDto qualityInspectDto) { QualityInspect qualityInspect = new QualityInspect(); BeanUtils.copyProperties(qualityInspectDto, qualityInspect); if (qualityInspectDto.getInspectType() != 0) { qualityInspectDto.setCustomer("é¿æ²»å¸è½´æ¿å¶é æéå ¬å¸"); } qualityInspect.setInspectState(0);//é»è®¤æªæäº¤ qualityInspectMapper.insert(qualityInspect); for (QualityInspectParam qualityInspectParam : qualityInspectDto.getQualityInspectParams()) { @@ -128,11 +131,13 @@ String text = inspectParams.stream().map(QualityInspectParam::getParameterItem).collect(Collectors.joining(",")); qualityUnqualified.setDefectivePhenomena(text + "è¿äºææ ä¸åå¨ä¸åæ ¼");//ä¸åæ ¼ç°è±¡ qualityUnqualified.setInspectId(qualityInspect.getId()); qualityUnqualified.setProductionDate(inspect.getProductionDate()); qualityUnqualified.setBatchNo(inspect.getBatchNo()); qualityUnqualifiedMapper.insert(qualityUnqualified); } else { //åæ ¼ç´æ¥å ¥åº stockUtils.addStock(qualityInspect.getProductModelId(), qualityInspect.getQuantity(), StockInQualifiedRecordTypeEnum.QUALITYINSPECT_STOCK_IN.getCode(), qualityInspect.getId(), batchNo, customer qualityInspect.getId(), batchNo, customer,inspect.getProductionDate() ); } qualityInspect.setInspectState(1);//å·²æäº¤ src/main/java/com/ruoyi/quality/service/impl/QualityUnqualifiedServiceImpl.java
@@ -137,7 +137,7 @@ //è°ç¨æäº¤åæ ¼çæ¥å£ String customer = "é¿æ²»å¸è½´æ¿å¶é æéå ¬å¸"; stockUtils.addStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), StockInQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(), unqualified.getId(), orders.getBatchNo(), customer orders.getBatchNo(), customer,null ); break; case "è¿å·¥": @@ -155,7 +155,7 @@ case "è®©æ¥æ¾è¡": //è°ç¨æäº¤åæ ¼çæ¥å£ String customer = "é¿æ²»å¸è½´æ¿å¶é æéå ¬å¸"; stockUtils.addStock(modelId, unqualified.getQuantity(), StockInQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(), unqualified.getId(), orders.getBatchNo(), customer); stockUtils.addStock(modelId, unqualified.getQuantity(), StockInQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(), unqualified.getId(), orders.getBatchNo(), customer,null); break; default: break; @@ -182,6 +182,10 @@ Map<String, Object> data = new HashMap<>(); data.put("productName", info.getProductName()); data.put("model", info.getModel()); data.put("batchNo", info.getBatchNo()); data.put("productionDate", info.getProductionDate()); data.put("defectivePhenomena", info.getDefectivePhenomena()); data.put("quantity", info.getQuantity()); // å è½½æ¨¡æ¿ inputStream = getClass().getResourceAsStream("/static/return-record.docx"); src/main/java/com/ruoyi/sales/controller/ShipmentApprovalController.java
@@ -2,7 +2,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.web.controller.BaseController; @@ -87,7 +86,7 @@ //åºåº stockUtils.addStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), req.getId(),null,null); // stockUtils.addStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), req.getId(),null,null); } return AjaxResult.success(); src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
@@ -1,43 +1,28 @@ package com.ruoyi.sales.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.approve.mapper.ApproveProcessMapper; import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; import com.ruoyi.approve.vo.ApproveProcessVO; import com.ruoyi.common.enums.FileNameType; import com.ruoyi.common.utils.OrderUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.security.LoginUser; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.other.service.impl.TempFileServiceImpl; import com.ruoyi.procurementrecord.utils.StockUtils; import com.ruoyi.sales.dto.ShippingInfoDto; import com.ruoyi.sales.mapper.ShipmentApprovalMapper; import com.ruoyi.sales.mapper.ShippingInfoMapper; import com.ruoyi.sales.pojo.SalesLedger; import com.ruoyi.sales.pojo.SalesLedgerProduct; import com.ruoyi.sales.pojo.ShipmentApproval; import com.ruoyi.sales.pojo.ShippingInfo; import com.ruoyi.sales.service.ISalesLedgerProductService; import com.ruoyi.sales.service.ISalesLedgerService; import com.ruoyi.sales.service.ShippingInfoService; import com.ruoyi.sales.service.impl.CommonFileServiceImpl; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.time.LocalDate; import java.util.List; /** @@ -73,20 +58,10 @@ @Transactional(rollbackFor = Exception.class) @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.INSERT) public AjaxResult add(@RequestBody ShippingInfoDto req) throws Exception { LoginUser loginUser = SecurityUtils.getLoginUser(); String sh = OrderUtils.countTodayByCreateTime(shippingInfoMapper, "SH"); // åè´§å®¡æ¹ ApproveProcessVO approveProcessVO = new ApproveProcessVO(); approveProcessVO.setApproveType(7); approveProcessVO.setApproveDeptId(loginUser.getCurrentDeptId()); approveProcessVO.setApproveReason(req.getType() + ":" +sh); approveProcessVO.setApproveUserIds(req.getApproveUserIds()); approveProcessVO.setApproveUser(loginUser.getUserId()); approveProcessVO.setApproveTime(LocalDate.now().toString()); approveProcessService.addApprove(approveProcessVO); // æ·»å åè´§æ¶æ¯ req.setShippingNo(sh); req.setStatus("å¾ å®¡æ ¸"); req.setStatus("å¾ åè´§"); boolean save = shippingInfoService.save(req); return save ? AjaxResult.success() : AjaxResult.error(); } src/main/java/com/ruoyi/sales/dto/SalesLedgerProductImportDto.java
@@ -1,12 +1,9 @@ package com.ruoyi.sales.dto; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import lombok.Data; import java.math.BigDecimal; import java.util.Date; /** * @author :yys @@ -32,6 +29,18 @@ private String specificationModel; /** * æ¹å· */ @Excel(name = "æ¹å·") private String batchNo; /** * UIDç */ @Excel(name = "UIDç ") private String uniNo; /** * åä½ */ @Excel(name = "åä½") src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -285,7 +285,7 @@ List<ProcessRoute> processRoutes = processRouteMapper.selectList(new QueryWrapper<ProcessRoute>().lambda() .eq(ProcessRoute::getProductModelId, salesLedgerProduct.getProductModelId()) .orderByDesc(ProcessRoute::getCreateTime)); if (processRoutes.size()>0){ if (!processRoutes.isEmpty()){ ProcessRoute processRoute = processRoutes.get(0); //æ°å¢ç产订åå·¥èºè·¯çº¿ä¸»è¡¨ ProductProcessRoute productProcessRoute = new ProductProcessRoute(); src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -31,10 +31,6 @@ import com.ruoyi.other.mapper.TempFileMapper; import com.ruoyi.other.pojo.TempFile; import com.ruoyi.production.mapper.*; import com.ruoyi.production.pojo.ProductOrder; import com.ruoyi.production.pojo.ProductProcessRouteItem; import com.ruoyi.production.pojo.ProductWorkOrder; import com.ruoyi.production.pojo.ProductionProductMain; import com.ruoyi.production.service.ProductionProductMainService; import com.ruoyi.project.system.domain.SysDept; import com.ruoyi.project.system.domain.SysUser; @@ -45,6 +41,8 @@ import com.ruoyi.sales.mapper.*; import com.ruoyi.sales.pojo.*; import com.ruoyi.sales.service.ISalesLedgerService; import com.ruoyi.stock.mapper.StockInventoryMapper; import com.ruoyi.stock.pojo.StockInventory; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FilenameUtils; @@ -140,6 +138,8 @@ private final QualityInspectMapper qualityInspectMapper; private final StockInventoryMapper stockInventoryMapper; @Autowired private SysDeptMapper sysDeptMapper; @@ -168,7 +168,7 @@ } public List<SalesLedgerProduct> getSalesLedgerProductListByRelateId(Long relateId, SaleEnum type){ public List<SalesLedgerProduct> getSalesLedgerProductListByRelateId(Long relateId, SaleEnum type) { LambdaQueryWrapper<SalesLedgerProduct> productWrapper = new LambdaQueryWrapper<>(); productWrapper.eq(SalesLedgerProduct::getSalesLedgerId, relateId); productWrapper.eq(SalesLedgerProduct::getType, type.getCode()); @@ -429,6 +429,10 @@ for (SalesLedgerProductImportDto salesLedgerProductImportDto : salesLedgerProductImportDtos) { SalesLedgerProduct salesLedgerProduct = new SalesLedgerProduct(); List<StockInventory> stockInventories = stockInventoryMapper.selectList(new LambdaQueryWrapper<StockInventory>().in(StockInventory::getBatchNo, salesLedgerProductImportDto.getBatchNo())); if (CollectionUtils.isEmpty(stockInventories)) { throw new RuntimeException("äº§åæ¹å·:" + salesLedgerProductImportDto.getBatchNo() + ",åºåæ 对åºäº§åæ°æ®ï¼"); } BeanUtils.copyProperties(salesLedgerProductImportDto, salesLedgerProduct); salesLedgerProduct.setSalesLedgerId(salesLedger.getId()); salesLedgerProduct.setType(1); @@ -458,16 +462,13 @@ salesLedgerProduct.setApproveStatus(0); salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProductImportDto.getTaxInclusiveTotalPrice()); salesLedgerProductMapper.insert(salesLedgerProduct); // æ·»å çäº§æ°æ® salesLedgerProductServiceImpl.addProductionData(salesLedgerProduct); } } return AjaxResult.success("å¯¼å ¥æå"); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } return AjaxResult.success("å¯¼å ¥å¤±è´¥"); } @Override @@ -663,7 +664,7 @@ // 4. å¤çåè¡¨æ°æ® List<SalesLedgerProduct> productList = salesLedgerDto.getProductData(); if (productList != null && !productList.isEmpty()) { handleSalesLedgerProducts(salesLedger.getId(), productList, EnumUtil.fromCode(SaleEnum.class,salesLedgerDto.getType())); handleSalesLedgerProducts(salesLedger.getId(), productList, EnumUtil.fromCode(SaleEnum.class, salesLedgerDto.getType())); updateMainContractAmount( salesLedger.getId(), productList, @@ -928,32 +929,20 @@ map.put("filingCertificateNo", productModel.getFilingCertificateNo()); } amount = amount.add(product.getTaxInclusiveTotalPrice()); List<ProductOrder> productOrders = productOrderMapper.selectList(new LambdaQueryWrapper<ProductOrder>() .eq(ProductOrder::getBatchNo, product.getBatchNo())); if (CollectionUtils.isEmpty(productOrders)) { List<StockInventory> stockInventoryList = stockInventoryMapper.selectList(new LambdaQueryWrapper<StockInventory>().eq(StockInventory::getProductModelId, product.getProductModelId()) .eq(StockInventory::getBatchNo, product.getBatchNo()) .eq(StockInventory::getCustomer, product.getCustomer())); if (CollectionUtils.isEmpty(stockInventoryList)) { throw new RuntimeException("æ¹å·ä¸åå¨"); } List<ProductWorkOrder> productWorkOrders = productWorkOrderMapper.selectList(new LambdaQueryWrapper<ProductWorkOrder>() .eq(ProductWorkOrder::getProductOrderId, productOrders.get(0).getId())); List<Long> ids = productWorkOrders.stream().map(ProductWorkOrder::getId).collect(Collectors.toList()); List<ProductionProductMain> productionProductMains = productionProductMainMapper.selectList(new LambdaQueryWrapper<ProductionProductMain>() .in(ProductionProductMain::getWorkOrderId, ids) .orderByDesc(ProductionProductMain::getCreateTime)); List<ProductProcessRouteItem> productProcessRouteItems = productProcessRouteItemMapper.selectList(new LambdaQueryWrapper<ProductProcessRouteItem>() .in(ProductProcessRouteItem::getId, productionProductMains.stream() .map(ProductionProductMain::getProductProcessRouteItemId).collect(Collectors.toList())) .eq(ProductProcessRouteItem::getProductModelId, product.getProductModelId()) .orderByDesc(ProductProcessRouteItem::getCreateTime)); if (CollectionUtils.isEmpty(productProcessRouteItems)) { throw new RuntimeException("çäº§æ°æ®ä¸åå¨"); } String productionDate = productProcessRouteItems.get(0).getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); if (productModel.getValidityPeriod() == null) { throw new RuntimeException("æææä¸è½ä¸ºç©º"); } String expiryDate = productProcessRouteItems.get(0).getCreateTime().plusYears(productModel.getValidityPeriod().longValue()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String productionDate = stockInventoryList.get(0).getProductionDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); map.put("productionDate", productionDate); map.put("expiryDate", expiryDate); List<ProductModel> productModelList = productModelMapper.selectList(new LambdaQueryWrapper<ProductModel>().eq(ProductModel::getId, product.getProductModelId())); BigDecimal validityPeriod = productModelList.get(0).getValidityPeriod(); LocalDate expiryDate = stockInventoryList.get(0).getProductionDate() .plusYears(validityPeriod.longValue()); String expiryDateStr = expiryDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); map.put("expiryDate", expiryDateStr); products.add(map); } Map<String, Object> data = new HashMap<>(); @@ -993,6 +982,5 @@ e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); } } } src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
@@ -4,18 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.approve.pojo.ApproveProcess; import com.ruoyi.approve.service.IApproveProcessService; import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; import com.ruoyi.approve.vo.ApproveGetAndUpdateVo; import com.ruoyi.approve.vo.ApproveProcessVO; import com.ruoyi.common.utils.OrderUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.framework.security.LoginUser; import com.ruoyi.sales.dto.SalesQuotationDto; import com.ruoyi.sales.mapper.SalesQuotationMapper; import com.ruoyi.sales.mapper.SalesQuotationProductMapper; @@ -24,11 +19,9 @@ import com.ruoyi.sales.service.SalesQuotationProductService; import com.ruoyi.sales.service.SalesQuotationService; import org.springframework.beans.factory.annotation.Autowired; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDate; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -60,7 +53,6 @@ @Override public boolean add(SalesQuotationDto salesQuotationDto) { LoginUser loginUser = SecurityUtils.getLoginUser(); SalesQuotation salesQuotation = new SalesQuotation(); BeanUtils.copyProperties(salesQuotationDto, salesQuotation); String quotationNo = OrderUtils.countTodayByCreateTime(salesQuotationMapper, "QT"); @@ -77,21 +69,6 @@ return salesQuotationProduct; }).collect(Collectors.toList()); salesQuotationProductService.saveBatch(products); // æ¥ä»·å®¡æ¹ ApproveProcessVO approveProcessVO = new ApproveProcessVO(); approveProcessVO.setApproveType(6); approveProcessVO.setApproveDeptId(loginUser.getCurrentDeptId()); approveProcessVO.setApproveReason(quotationNo); approveProcessVO.setApproveUserIds(salesQuotationDto.getApproveUserIds()); approveProcessVO.setApproveUser(loginUser.getUserId()); approveProcessVO.setApproveTime(LocalDate.now().toString()); approveProcessVO.setPrice(salesQuotationDto.getTotalAmount()); try { approveProcessService.addApprove(approveProcessVO); }catch (Exception e){ log.error("SalesQuotationServiceImpl error:{}", e); throw new RuntimeException("审æ¹å¤±è´¥"); } return true; } @Override src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java
@@ -68,7 +68,7 @@ if(!"å·²åè´§".equals(byId.getStatus())){ SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(byId.getSalesLedgerProductId()); stockUtils.substractStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), req.getId(),null,null StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), req.getId(),salesLedgerProduct.getBatchNo(),salesLedgerProduct.getCustomer() ); } byId.setExpressNumber(req.getExpressNumber()); src/main/java/com/ruoyi/stock/dto/StockInventoryDto.java
@@ -45,4 +45,5 @@ private Long productId; // 产åID private Long parentId; // ç¶çº§äº§åID private Long productModelId; // 产ååå·ID private String productScope; //产åç±»å } src/main/java/com/ruoyi/stock/execl/StockInventoryExportData.java
@@ -1,5 +1,6 @@ package com.ruoyi.stock.execl; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import lombok.Data; @@ -16,6 +17,19 @@ @Excel(name = "è§æ ¼") private String model; @Excel(name = "UIDç ") private String uidNo; @Excel(name = "æ¹å·") private String batchNo; @Excel(name = "çäº§æ¥æ") @JsonFormat(pattern = "yyyyMMdd") private String productionDate; @Excel(name = "ä¾åºå") private String customer; @Excel(name = "åä½") private String unit; src/main/java/com/ruoyi/stock/pojo/StockInventory.java
@@ -13,6 +13,7 @@ import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; /** @@ -69,4 +70,8 @@ @ApiModelProperty("ä¾åºååç§°") private String customer; @ApiModelProperty("çäº§æ¥æ") private LocalDate productionDate; } src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java
@@ -34,6 +34,8 @@ import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.*; /** @@ -59,6 +61,7 @@ private ProductMapper productMapper; @Autowired private ProductModelMapper productModelMapper; private static final DateTimeFormatter YYYYMMDD_FORMAT = DateTimeFormatter.ofPattern("yyyyMMdd"); @Override @@ -99,6 +102,7 @@ newStockInventory.setWarnNum(stockInventoryDto.getWarnNum()); newStockInventory.setBatchNo(stockInventoryDto.getBatchNo()); newStockInventory.setCustomer(stockInventoryDto.getCustomer()); newStockInventory.setProductionDate(stockInventoryDto.getProductionDate()); stockInventoryMapper.insert(newStockInventory); }else { stockInventoryMapper.updateAddStockInventory(stockInventoryDto); @@ -148,7 +152,7 @@ // æ¥è¯¢ææç产å List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductMapper.selectProduct(); ExcelUtil<StockInventoryExportData> util = new ExcelUtil<StockInventoryExportData>(StockInventoryExportData.class); ExcelUtil<StockInventoryExportData> util = new ExcelUtil<>(StockInventoryExportData.class); List<StockInventoryExportData> list = util.importExcel(file.getInputStream()); // è®°å½æªæ¾å°å¹é é¡¹çæ°æ® @@ -158,7 +162,8 @@ boolean matched = false; for (SalesLedgerProduct item : salesLedgerProducts) { if (item.getProductCategory().equals(dto.getProductName()) && item.getSpecificationModel().equals(dto.getModel())) { item.getSpecificationModel().equals(dto.getModel()) && item.getUidNo().equals(dto.getUidNo())) { StockInventoryDto stockInventoryDto = new StockInventoryDto(); stockInventoryDto.setRecordId(0L); stockInventoryDto.setRecordType(StockInQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_IN.getCode()); @@ -170,6 +175,14 @@ } stockInventoryDto.setLockedQuantity(dto.getLockedQuantity()); stockInventoryDto.setProductModelId(item.getProductModelId()); stockInventoryDto.setBatchNo(dto.getBatchNo()); stockInventoryDto.setCustomer(dto.getCustomer()); String productionDate = dto.getProductionDate(); if (productionDate != null && productionDate.length() == 8) { stockInventoryDto.setProductionDate(LocalDate.parse(productionDate, YYYYMMDD_FORMAT)); } else { stockInventoryDto.setProductionDate(null); } this.addstockInventory(stockInventoryDto); matched = true; break; // æ¾å°å¹é 项åè·³åºå¾ªç¯ @@ -177,8 +190,8 @@ } if (!matched) { // è®°å½æªå¹é çæ°æ® String unmatchedInfo = String.format("产ååç§°ï¼%sï¼è§æ ¼åå·ï¼%s", dto.getProductName(), dto.getModel()); String unmatchedInfo = String.format("产ååç§°ï¼%sï¼è§æ ¼åå·ï¼%sï¼UIDç ï¼%s", dto.getProductName(), dto.getModel(),dto.getUidNo()); unmatchedRecords.add(unmatchedInfo); } }); src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
@@ -206,7 +206,7 @@ T1.supplier_name, SUM(contract_amount) AS invoiceAmount, IFNULL( SUM(T2.current_payment_amount) , 0 ) AS paymentAmount, IFNULL((IFNULL(SUM(contract_amount),0) - IFNULL(SUM(T2.current_payment_amount),0)),0) AS payableAmount, IFNULL((IFNULL(SUM(contract_amount),0) - IFNULL(SUM(T2.current_payment_amount),0)),0) AS payableAmount, T1.purchase_contract_number, T2.payment_date FROM purchase_ledger T1 @@ -217,7 +217,11 @@ T1.supplier_name LIKE CONCAT ('%',#{req.supplierName},'%') </if> </where> GROUP BY T1.purchase_contract_number,T2.payment_date GROUP BY T1.supplier_id, T1.supplier_name, T1.purchase_contract_number, T2.payment_date </select> </mapper> src/main/resources/mapper/quality/QualityUnqualifiedMapper.xml
@@ -16,6 +16,7 @@ qu.deal_result, qu.deal_name, qu.deal_time, qu.production_date, pm.uid_no, CASE WHEN qu.model = pm.id THEN pm.model @@ -78,6 +79,8 @@ qu.deal_result, qu.deal_name, qu.deal_time, qu.production_date, qu.batch_no, CASE WHEN qu.model = pm.id THEN pm.model ELSE qu.model src/main/resources/mapper/sales/InvoiceLedgerMapper.xml
@@ -115,7 +115,7 @@ T1.customer_name, SUM(contract_amount) AS invoice_total, IFNULL( SUM(T2.receipt_payment_amount) , 0 ) AS receipt_payment_amount, IFNULL((IFNULL(SUM(contract_amount),0) - IFNULL(SUM(T2.receipt_payment_amount),0)),0) AS unReceipt_payment_amount IFNULL((IFNULL(SUM(contract_amount),0) - IFNULL(SUM(T2.receipt_payment_amount),0)),0) AS unReceipt_payment_amount FROM sales_ledger T1 LEFT JOIN receipt_payment T2 ON T1.id = T2.sales_ledger_id <where> @@ -123,7 +123,7 @@ T1.customer_name LIKE CONCAT ('%',#{invoiceLedgerDto.searchText},'%') </if> </where> GROUP BY T1.customer_name GROUP BY T1.customer_id, T1.customer_name </select> <select id="invoiceLedgerProductInfo" resultType="com.ruoyi.sales.dto.InvoiceRegistrationProductDto"> src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -5,15 +5,22 @@ <mapper namespace="com.ruoyi.sales.mapper.SalesLedgerProductMapper"> <select id="selectSalesLedgerProductList" resultType="com.ruoyi.sales.pojo.SalesLedgerProduct"> WITH stock_summary AS ( SELECT product_model_id, SUM(qualitity) AS total_quantity, SUM(locked_quantity) AS total_locked FROM stock_inventory GROUP BY product_model_id ) SELECT T1.*, CASE WHEN (IFNULL(t2.qualitity, 0) - IFNULL(t2.locked_quantity, 0)) >= IFNULL(T1.quantity, 0) THEN 1 WHEN (IFNULL(s.total_quantity, 0) - IFNULL(s.total_locked, 0)) >= IFNULL(T1.quantity, 0) THEN 1 ELSE 0 END as has_sufficient_stock FROM sales_ledger_product T1 LEFT JOIN stock_inventory t2 ON T1.product_model_id = t2.product_model_id FROM sales_ledger_product T1 LEFT JOIN stock_summary s ON T1.product_model_id = s.product_model_id <where> <if test="salesLedgerProduct.salesLedgerId != null"> AND T1.sales_ledger_id = #{salesLedgerProduct.salesLedgerId} @@ -127,8 +134,10 @@ <if test="req.productCategory != null and req.productCategory != ''"> AND slp.product_category = #{req.productCategory} </if> <!-- æäº§å大类åç»èå --> GROUP BY slp.product_category GROUP BY slp.product_category, slp.specification_model, sl.supplier_name <!-- æäº§å大类æåº --> ORDER BY slp.product_category </select> src/main/resources/mapper/sales/SalesQuotationMapper.xml
@@ -15,8 +15,5 @@ <if test="salesQuotationDto.customer != null and salesQuotationDto.customer != '' "> AND t1.customer = #{salesQuotationDto.customer} </if> <if test="salesQuotationDto.status != null and salesQuotationDto.status != '' "> AND t1.status = #{salesQuotationDto.status} </if> </select> </mapper> src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -52,34 +52,79 @@ where product_model_id = #{ew.productModelId} and qualitity >= #{ew.qualitity} </update> <select id="pagestockInventory" resultType="com.ruoyi.stock.dto.StockInventoryDto"> select si.id, WITH RECURSIVE get_root AS ( SELECT id, parent_id, id AS root_id FROM product WHERE parent_id IS NULL -- æ ¹èç¹ UNION ALL SELECT p.id, p.parent_id, gr.root_id FROM product p INNER JOIN get_root gr ON p.parent_id = gr.id ) SELECT si.id, si.qualitity, COALESCE(si.locked_quantity, 0) as locked_quantity, COALESCE(si.locked_quantity, 0) AS locked_quantity, si.product_model_id, si.create_time, si.update_time, COALESCE(si.warn_num, 0) as warn_num, COALESCE(si.warn_num, 0) AS warn_num, si.version, (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity, (si.qualitity - COALESCE(si.locked_quantity, 0)) AS un_locked_quantity, pm.model, si.remark, pm.unit, pm.uid_no as uidNo, pm.uid_no AS uidNo, p.product_name, si.batch_no, si.customer from stock_inventory si left join product_model pm on si.product_model_id = pm.id left join product p on pm.product_id = p.id where 1 = 1 <if test="ew.productName != null and ew.productName !=''"> and p.product_name like concat('%',#{ew.productName},'%') </if> si.customer, rp.product_name AS root_product_name, si.production_date FROM stock_inventory si LEFT JOIN product_model pm ON si.product_model_id = pm.id LEFT JOIN product p ON pm.product_id = p.id LEFT JOIN get_root gr ON gr.id = p.id LEFT JOIN product rp ON rp.id = gr.root_id <where> <if test="ew.productName != null and ew.productName != ''"> AND p.product_name LIKE CONCAT('%', #{ew.productName}, '%') </if> <if test="ew.model != null and ew.model != ''"> AND pm.model LIKE CONCAT('%', #{ew.model}, '%') </if> <if test="ew.uidNo != null and ew.uidNo != ''"> AND pm.uid_no LIKE CONCAT('%', #{ew.uidNo}, '%') </if> <if test="ew.batchNo != null and ew.batchNo != ''"> AND si.batch_no LIKE CONCAT('%', #{ew.batchNo}, '%') </if> <if test="ew.productScope != null and ew.productScope != ''"> <choose> <when test="ew.productScope == 'æå'"> AND rp.product_name = 'æå' </when> <otherwise> AND rp.product_name != 'æå' </otherwise> </choose> </if> </where> </select> <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData"> select si.qualitity, pm.model, pm.unit, si.batchNo, pm.uid_no, si.production_date, si.customer, p.product_name, coalesce(si.warn_num, 0) as warn_num, coalesce(si.locked_quantity, 0) as locked_quantity, @@ -283,14 +328,14 @@ LEFT JOIN product_model pm ON si.product_model_id = pm.id LEFT JOIN product p ON pm.product_id = p.id LEFT JOIN product p1 ON p1.id = p.parent_id WHERE p1.product_name = 'åææ'; <if test="ew.batchNo != null and ew.batchNo !=''"> and si.batch_no like concat('%',#{ew.batchNo},'%') </if> <if test="ew.customer != null and ew.customer !=''"> and si.customer like concat('%',#{ew.customer},'%') </if> <where> <if test="ew.batchNo != null and ew.batchNo !=''"> and si.batch_no like concat('%',#{ew.batchNo},'%') </if> <if test="ew.customer != null and ew.customer !=''"> and si.customer like concat('%',#{ew.customer},'%') </if> </where> </select> <select id="getStockInventoryAll" resultType="com.ruoyi.stock.dto.StockInventoryDto"> src/main/resources/static/return-record.docxBinary files differ
src/main/resources/static/²É¹ºÌ¨Õ˵¼ÈëÄ£°å.xlsxBinary files differ
src/main/resources/static/ÏúÊŲ̂Õ˵¼ÈëÄ£°å.xlsxBinary files differ