Merge remote-tracking branch 'origin/dev_长治_健齿齿科器材' into dev_长治_健齿齿科器材
| | |
| | | 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; |
| | |
| | | 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)) { |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.Collections; |
| | | |
| | | @Component |
| | |
| | | * @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) { |
| | |
| | | stockInventoryDto.setProductModelId(productModelId); |
| | | stockInventoryDto.setBatchNo(batchNo); |
| | | stockInventoryDto.setCustomer(customer); |
| | | if (stockInventoryDto.getProductionDate() == null) { |
| | | stockInventoryDto.setProductionDate(LocalDate.now()); |
| | | }else { |
| | | stockInventoryDto.setProductionDate(productionDate); |
| | | } |
| | | stockInventoryService.addstockInventory(stockInventoryDto); |
| | | } |
| | | |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @ApiModel("颿åDTO") |
| | |
| | | |
| | | @ApiModelProperty("ä¾åºååç§°") |
| | | private String customer; |
| | | |
| | | @ApiModelProperty("æææ") |
| | | private LocalDate productionDate; |
| | | } |
| | |
| | | } |
| | | // å¦æææ°æ®å
å åºå |
| | | 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() |
| | | ); |
| | | } |
| | | } |
| | |
| | | throw new RuntimeException("ç产订åä¸åå¨"); |
| | | } |
| | | |
| | | |
| | | Product product = productMapper.selectById(productModel.getProductId()); |
| | | QualityInspect qualityInspect = new QualityInspect(); |
| | | qualityInspect.setProductId(product.getId()); |
| | |
| | | //ç´æ¥å
¥åº |
| | | 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 |
| | | ); |
| | | } |
| | | /*æ´æ°å·¥ååç产订å*/ |
| | |
| | | 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; |
| | |
| | | private String purchaseContractNumber; |
| | | |
| | | /** |
| | | * é¢è¦æ°é |
| | | */ |
| | | @Excel(name = "åºåé¢è¦æ°é") |
| | | private BigDecimal warnNum; |
| | | |
| | | @Excel(name = "éå®åå·") |
| | | private String salesContractNo; |
| | | |
| | | |
| | | /** |
| | | * 产å大类 |
| | | */ |
| | | @Excel(name = "产å大类") |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * ç¨ç |
| | |
| | | private BigDecimal taxInclusiveUnitPrice; |
| | | |
| | | /** |
| | | * æ°é |
| | | */ |
| | | @Excel(name = "æ°é") |
| | | private BigDecimal quantity; |
| | | |
| | | /** |
| | | * å«ç¨æ»ä»· |
| | | */ |
| | | @Excel(name = "å«ç¨æ»ä»·") |
| | |
| | | private String invoiceType; |
| | | |
| | | /** |
| | | * é¢è¦æ°é |
| | | */ |
| | | @Excel(name = "åºåé¢è¦æ°é") |
| | | private BigDecimal warnNum; |
| | | |
| | | /** |
| | | * æ¯å¦è´¨æ£ |
| | | */ |
| | | @Excel(name = "æ¯å¦è´¨æ£", readConverterExp = "0=å¦,1=æ¯") |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | private PurchaseLedgerTemplateMapper purchaseLedgerTemplateMapper; |
| | | @Autowired |
| | | private SalesLedgerProductTemplateMapper salesLedgerProductTemplateMapper; |
| | | @Autowired |
| | | private StockUtils stockUtils; |
| | | @Value("${file.upload-dir}") |
| | | private String uploadDir; |
| | | |
| | |
| | | } |
| | | 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); |
| | | } |
| | | //æ°å¢åæææ£éª 审æ¹ä¹åæçææ£éª |
| | | // 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()); |
| | |
| | | qualityInspect.setQuantity(saleProduct.getQuantity()); |
| | | qualityInspectMapper.insert(qualityInspect); |
| | | List<QualityTestStandard> qualityTestStandard = qualityTestStandardMapper.getQualityTestStandardByProductId(saleProduct.getProductId(), 0,null); |
| | | if (qualityTestStandard.size()>0){ |
| | | if (!qualityTestStandard.isEmpty()) { |
| | | qualityInspect.setTestStandardId(qualityTestStandard.get(0).getId()); |
| | | qualityInspectMapper.updateById(qualityInspect); |
| | | qualityTestStandardParamMapper.selectList(Wrappers.<QualityTestStandardParam>lambdaQuery() |
| | |
| | | |
| | | 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); |
| | |
| | | salesLedgerProduct.setApproveStatus(0); |
| | | salesLedgerProduct.setPendingTicketsTotal(salesLedgerProductImportDto.getTaxInclusiveTotalPrice()); |
| | | // æ¯å¦è´¨æ£å¤æ |
| | | if (salesLedgerProductImportDto.getIsChecked() == null) { |
| | | throw new RuntimeException("è¯·å¡«åæ¯å¦è´¨æ£ï¼"); |
| | | } |
| | | salesLedgerProduct.setIsChecked(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 |
| | |
| | | @TableField(exist = false) |
| | | private String purchaseContractNo; |
| | | |
| | | private String BatchNo; |
| | | private String batchNo; |
| | | private String manufacturingTeam; |
| | | |
| | | /** |
| | |
| | | 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; |
| | | |
| | |
| | | @ApiModelProperty("æ¯å¦ä¸åæ ¼å¤çèªå·±æ°å¢") |
| | | @TableField(exist = false) |
| | | private Boolean method; |
| | | |
| | | @ApiModelProperty("çäº§æ¥æ") |
| | | private LocalDate productionDate; |
| | | |
| | | @ApiModelProperty("æ¹å·") |
| | | private String batchNo; |
| | | } |
| | |
| | | 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()) { |
| | |
| | | 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);//å·²æäº¤ |
| | |
| | | //è°ç¨æäº¤åæ ¼çæ¥å£ |
| | | String customer = "é¿æ²»å¸è½´æ¿å¶é æéå
¬å¸"; |
| | | stockUtils.addStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), StockInQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(), unqualified.getId(), |
| | | orders.getBatchNo(), customer |
| | | orders.getBatchNo(), customer,null |
| | | ); |
| | | break; |
| | | case "è¿å·¥": |
| | |
| | | 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; |
| | |
| | | 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"); |
| | |
| | | |
| | | 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; |
| | |
| | | |
| | | |
| | | //åºåº |
| | | 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(); |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | @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(); |
| | | } |
| | |
| | | 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 |
| | |
| | | private String specificationModel; |
| | | |
| | | /** |
| | | * æ¹å· |
| | | */ |
| | | @Excel(name = "æ¹å·") |
| | | private String batchNo; |
| | | |
| | | /** |
| | | * UIDç |
| | | */ |
| | | @Excel(name = "UIDç ") |
| | | private String uniNo; |
| | | |
| | | /** |
| | | * åä½ |
| | | */ |
| | | @Excel(name = "åä½") |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | private final ProductionProductInputMapper productionProductInputMapper; |
| | | |
| | | private final QualityInspectMapper qualityInspectMapper; |
| | | |
| | | private final StockInventoryMapper stockInventoryMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | |
| | | |
| | | 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); |
| | |
| | | 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 |
| | |
| | | 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<>(); |
| | |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | |
| | | @Override |
| | | public boolean add(SalesQuotationDto salesQuotationDto) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | SalesQuotation salesQuotation = new SalesQuotation(); |
| | | BeanUtils.copyProperties(salesQuotationDto, salesQuotation); |
| | | String quotationNo = OrderUtils.countTodayByCreateTime(salesQuotationMapper, "QT"); |
| | |
| | | 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 |
| | |
| | | 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()); |
| | |
| | | private Long productId; // 产åID |
| | | private Long parentId; // ç¶çº§äº§åID |
| | | private Long productModelId; // 产ååå·ID |
| | | private String productScope; //产åç±»å |
| | | } |
| | |
| | | package com.ruoyi.stock.execl; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | |
| | | @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; |
| | | |
| | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | |
| | | @ApiModelProperty("ä¾åºååç§°") |
| | | private String customer; |
| | | |
| | | @ApiModelProperty("çäº§æ¥æ") |
| | | private LocalDate productionDate; |
| | | |
| | | } |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | private ProductMapper productMapper; |
| | | @Autowired |
| | | private ProductModelMapper productModelMapper; |
| | | private static final DateTimeFormatter YYYYMMDD_FORMAT = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| | | |
| | | |
| | | @Override |
| | |
| | | newStockInventory.setWarnNum(stockInventoryDto.getWarnNum()); |
| | | newStockInventory.setBatchNo(stockInventoryDto.getBatchNo()); |
| | | newStockInventory.setCustomer(stockInventoryDto.getCustomer()); |
| | | newStockInventory.setProductionDate(stockInventoryDto.getProductionDate()); |
| | | stockInventoryMapper.insert(newStockInventory); |
| | | }else { |
| | | stockInventoryMapper.updateAddStockInventory(stockInventoryDto); |
| | |
| | | // æ¥è¯¢ææç产å |
| | | 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()); |
| | | |
| | | // è®°å½æªæ¾å°å¹é
é¡¹çæ°æ® |
| | |
| | | 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()); |
| | |
| | | } |
| | | 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; // æ¾å°å¹é
项åè·³åºå¾ªç¯ |
| | |
| | | } |
| | | 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); |
| | | } |
| | | }); |
| | |
| | | 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> |
| | |
| | | qu.deal_result, |
| | | qu.deal_name, |
| | | qu.deal_time, |
| | | qu.production_date, |
| | | pm.uid_no, |
| | | CASE |
| | | WHEN qu.model = pm.id THEN pm.model |
| | |
| | | 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 |
| | |
| | | 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"> |
| | |
| | | <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} |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | 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 |
| | | 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},'%') |
| | | 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, |
| | |
| | | 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 = 'åææ'; |
| | | <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"> |