已添加26个文件
已修改47个文件
1903 ■■■■ 文件已修改
src/main/java/com/ruoyi/CodeGenerator.java 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/basic/controller/ProductController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/controller/NoticeController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/controller/NoticeTypeController.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/controller/RulesRegulationsManagementController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/controller/RulesRegulationsManagementFileController.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/controller/SealApplicationManagementController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/dto/SealApplicationManagementDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/mapper/NoticeTypeMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/mapper/RulesRegulationsManagementFileMapper.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/pojo/Notice.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/pojo/NoticeType.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/pojo/RulesRegulationsManagementFile.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/pojo/SealApplicationManagement.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/service/NoticeTypeService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/service/RulesRegulationsManagementFileService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/service/impl/NoticeTypeServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/service/impl/RulesRegulationsManagementFileServiceImpl.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/dto/ProcurementPageDtoCopy.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/mapper/ProcurementRecordMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/project/system/domain/SysUser.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/project/system/mapper/SysUserMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/pojo/PaymentRegistration.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/controller/QualityTestStandardBindingController.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/controller/QualityTestStandardController.java 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/controller/QualityTestStandardParamController.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/controller/QualityUnqualifiedController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/dto/QualityTestStandardBindingDto.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/mapper/QualityTestStandardBindingMapper.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/mapper/QualityTestStandardMapper.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/mapper/QualityTestStandardParamMapper.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/pojo/QualityTestStandard.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/pojo/QualityTestStandardBinding.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/pojo/QualityTestStandardParam.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/service/IQualityTestStandardService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/service/QualityTestStandardBindingService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/service/QualityTestStandardParamService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/service/impl/QualityTestStandardBindingServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/service/impl/QualityTestStandardParamServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/service/impl/QualityTestStandardServiceImpl.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/controller/SalesLedgerProductController.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/dto/ReceiptPaymentDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/dto/SalesLedgerProductDto.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/mapper/SalesLedgerProductMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/pojo/ReceiptPayment.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/pojo/SalesLedgerProduct.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/ISalesLedgerProductService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/ReceiptPaymentService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/collaborativeApproval/NoticeMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/collaborativeApproval/NoticeTypeMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/collaborativeApproval/RulesRegulationsManagementFileMapper.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/collaborativeApproval/SealApplicationManagementMapper.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/quality/QualityTestStandardBindingMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/quality/QualityTestStandardMapper.xml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/quality/QualityTestStandardParamMapper.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/system/SysUserMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/CodeGenerator.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,130 @@
package com.ruoyi;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert;
import com.baomidou.mybatisplus.generator.config.po.TableField;
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import com.baomidou.mybatisplus.generator.fill.Column;
import java.util.Collections;
import java.util.Scanner;
// æ¼”示例子,执行 main æ–¹æ³•控制台输入模块表名回车自动生成对应项目目录中
public class CodeGenerator {
    public static String database_url = "jdbc:mysql://127.0.0.1:3306/product-inventory-management";
    public static String database_username = "root";
    public static String database_password= "123456";
    public static String author = "芯导软件(江苏)有限公司";
    public static String model = "quality"; // æ¨¡å—
    public static String setParent = "com.ruoyi."+ model; // åŒ…路径
    public static String tablePrefix = ""; // è®¾ç½®è¿‡æ»¤è¡¨å‰ç¼€
    public static void main(String[] args) {
        String projectPath = System.getProperty("user.dir");
        FastAutoGenerator.create(database_url, database_username, database_password)
                // å…¨å±€é…ç½®
                .globalConfig(builder -> {
                    builder.author(author) // è®¾ç½®ä½œè€…
                            .commentDate("yyyy-MM-dd hh:mm:ss")   //注释日期
                            .outputDir(projectPath  + "/src/main/java") // æŒ‡å®šè¾“出目录
                            .disableOpenDir() //禁止打开输出目录,默认打开
                            .enableSwagger() // å¼€å¯swagger
                    ;
                })
                // æ•°æ®æºé…ç½®ï¼ˆæ ¸å¿ƒï¼šè‡ªå®šä¹‰ç±»åž‹è½¬æ¢ï¼Œå¼ºåˆ¶tenant_id为Long)
                .dataSourceConfig(builder -> {
                    builder.typeConvert(new MySqlTypeConvert() {
                        /**
                         * è‡ªå®šä¹‰å­—段类型转换
                         * @param globalConfig å…¨å±€é…ç½®
                         * @param tableField è¡¨å­—段信息
                         * @return è½¬æ¢åŽçš„字段类型
                         */
                        @Override
                        public DbColumnType processTypeConvert(GlobalConfig globalConfig, TableField tableField) {
                            // å¼ºåˆ¶tenant_id字段类型为Long
                            if ("tenant_id".equalsIgnoreCase(tableField.getName())) {
                                return DbColumnType.LONG;
                            }
                            // å…¶ä»–字段使用默认转换规则
                            return (DbColumnType) super.processTypeConvert(globalConfig, tableField);
                        }
                    });
                })
                // åŒ…配置
                .packageConfig(builder -> {
                    builder.entity("pojo");
                    builder.parent(setParent) // è®¾ç½®çˆ¶åŒ…名
                            .pathInfo(Collections.singletonMap(OutputFile.xml, projectPath  +  "/src/main/resources/mapper/"+model)); // è®¾ç½®mapperXml生成路径
                })
                // ç­–略配置
                .strategyConfig(builder -> {
                    builder.addInclude(scanner("表名,多个空格分割").split(" ")) // è®¾ç½®éœ€è¦ç”Ÿæˆçš„表名
                            .addTablePrefix(tablePrefix) // è®¾ç½®è¿‡æ»¤è¡¨å‰ç¼€
                            // Entity ç­–略配置
                            .entityBuilder()
                            .enableLombok() //开启 Lombok
                            .naming(NamingStrategy.underline_to_camel)  //数据库表映射到实体的命名策略:下划线转驼峰命
                            .columnNaming(NamingStrategy.underline_to_camel)    //数据库表字段映射到实体的命名策略:下划线转驼峰命
                            .enableFileOverride() // è¦†ç›–已经生成的Entity文件
                            .logicDeleteColumnName("state")
                            .addTableFills(
                                    new Column("create_time", FieldFill.INSERT),
                                    new Column("update_time", FieldFill.INSERT_UPDATE),
                                    new Column("create_user", FieldFill.INSERT),
                                    new Column("update_user", FieldFill.INSERT_UPDATE),
                                    new Column("tenant_id", FieldFill.INSERT)
                            )
                            .idType(IdType.AUTO) // è‡ªå¢žä¸»é”®
                            // Mapper ç­–略配置
                            .mapperBuilder()
                            .enableFileOverride() // è¦†ç›–已生成Mapper文件
                            .enableBaseResultMap() // è‡ªåŠ¨ç”ŸæˆresultMap
                            .mapperAnnotation(org.apache.ibatis.annotations.Mapper.class)
                            // Service ç­–略配置
                            .serviceBuilder()
                            .formatServiceFileName("%sService") //格式化 service æŽ¥å£æ–‡ä»¶åç§°ï¼Œ%s进行匹配表名,如 UserService
                            .formatServiceImplFileName("%sServiceImpl") //格式化 service å®žçŽ°ç±»æ–‡ä»¶åç§°ï¼Œ%s进行匹配表名,如 UserServiceImpl
                            .enableFileOverride() // è¦†ç›–已生成文件
                            // Controller ç­–略配置
                            .controllerBuilder()
                            .enableFileOverride() // è¦†ç›–已生成文件
                            .enableRestStyle() // å¼€å¯ç”Ÿæˆ@RestController æŽ§åˆ¶å™¨
                    ;
                })
                //5、模板引擎
                .templateEngine(new FreemarkerTemplateEngine())    //默认
                .execute();
    }
    /**
     * <p>
     * è¯»å–控制台内容
     * </p>
     */
    public static String scanner(String tip) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder help = new StringBuilder();
        help.append("请输入" + tip + ":");
        System.out.println(help.toString());
        if (scanner.hasNext()) {
            String ipt = scanner.next();
            if (StringUtils.isNotBlank(ipt)) {
                return ipt;
            }
        }
        throw new MybatisPlusException("请输入正确的" + tip + "!");
    }
}
src/main/java/com/ruoyi/basic/controller/ProductController.java
@@ -1,5 +1,6 @@
package com.ruoyi.basic.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.basic.dto.ProductDto;
@@ -12,9 +13,13 @@
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import com.ruoyi.sales.service.ISalesLedgerProductService;
import com.ruoyi.sales.service.ISalesLedgerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -28,8 +33,8 @@
    private IProductService productService;
    private IProductModelService productModelService;
    @Autowired
    private ISalesLedgerProductService salesLedgerProductService;
    /**
     * æŸ¥è¯¢äº§å“
     */
@@ -73,6 +78,13 @@
        if (ids == null || ids.length == 0) {
            return AjaxResult.error("请传入要删除的ID");
        }
        // æ£€æŸ¥æ˜¯å¦æœ‰é”€å”®å•†å“è®°å½•关联该产品
        LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(SalesLedgerProduct::getProductId, ids);
        List<SalesLedgerProduct> salesLedgerProductList = salesLedgerProductService.list(queryWrapper);
        if (salesLedgerProductList.size() > 0) {
            return AjaxResult.error("该产品存在销售/采购记录,不能删除");
        }
        return toAjax(productService.delProductByIds(ids));
    }
@@ -85,6 +97,13 @@
        if (ids == null || ids.length == 0) {
            return AjaxResult.error("请传入要删除的ID");
        }
        // æ£€æŸ¥æ˜¯å¦æœ‰é”€å”®å•†å“è®°å½•关联该产品规格型号
        LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(SalesLedgerProduct::getProductModelId, ids);
        List<SalesLedgerProduct> salesLedgerProductList = salesLedgerProductService.list(queryWrapper);
        if (salesLedgerProductList.size() > 0) {
            return AjaxResult.error("该产品规格型号存在销售/采购记录,不能删除");
        }
        return toAjax(productModelService.delProductModel(ids));
    }
src/main/java/com/ruoyi/collaborativeApproval/controller/NoticeController.java
@@ -1,12 +1,15 @@
package com.ruoyi.collaborativeApproval.controller;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.collaborativeApproval.dto.NoticeDTO;
import com.ruoyi.collaborativeApproval.pojo.Notice;
import com.ruoyi.collaborativeApproval.service.NoticeService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.service.ISysNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@@ -22,6 +25,7 @@
public class NoticeController extends BaseController {
    private final NoticeService noticeService;
    private final ISysNoticeService sysNoticeService;
    @GetMapping("/page")
    @Log(title = "分页查询", businessType = BusinessType.OTHER)
@@ -34,6 +38,13 @@
    @Log(title = "新增", businessType = BusinessType.INSERT)
    @ApiOperation("新增")
    public AjaxResult add(@RequestBody NoticeDTO noticeDTO){
        if (noticeDTO.getStatus()==1){
            //正式发布通知所有人的消息通知
            sysNoticeService.simpleNoticeAll("通知公告",
                    noticeDTO.getTitle(),
                    noticeDTO.getTenantId(),
                    "/collaborativeApproval/noticeManagement?type="+noticeDTO.getType());
        }
        return AjaxResult.success(noticeService.save(noticeDTO));
    }
@@ -41,6 +52,14 @@
    @Log(title = "修改", businessType = BusinessType.UPDATE)
    @ApiOperation("修改")
    public AjaxResult update(@RequestBody NoticeDTO noticeDTO){
        if (ObjectUtils.isNotNull(noticeDTO.getStatus()) && noticeDTO.getStatus()==1){
            Notice notice = noticeService.getById(noticeDTO.getId());
            //正式发布通知所有人的消息通知
            sysNoticeService.simpleNoticeAll("通知公告",
                    notice.getTitle(),
                    notice.getTenantId(),
                    "/collaborativeApproval/noticeManagement?type="+notice.getType());
        }
        return AjaxResult.success(noticeService.updateById(noticeDTO));
    }
src/main/java/com/ruoyi/collaborativeApproval/controller/NoticeTypeController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.ruoyi.collaborativeApproval.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.dto.SupplierManageDto;
import com.ruoyi.basic.pojo.SupplierManage;
import com.ruoyi.collaborativeApproval.pojo.NoticeType;
import com.ruoyi.collaborativeApproval.service.NoticeTypeService;
import com.ruoyi.framework.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * <p>
 * é€šçŸ¥å…¬å‘Šçš„公告类型维护 å‰ç«¯æŽ§åˆ¶å™¨
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 09:57:56
 */
@RestController
@RequestMapping("/noticeType")
public class NoticeTypeController {
    @Autowired
    private NoticeTypeService noticeTypeService;
    /**
     * é€šçŸ¥å…¬å‘Šçš„公告类型维护新增
     * @param noticeType
     * @return
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody NoticeType noticeType) {
        return AjaxResult.success(noticeTypeService.save(noticeType));
    }
    /**
     * é€šçŸ¥å…¬å‘Šçš„公告类型维护删除
     * @param ids
     * @return
     */
    @DeleteMapping("/del")
    public AjaxResult delNoticeType(@RequestBody List<Integer> ids) {
        if(CollectionUtils.isEmpty(ids)){
            return AjaxResult.error("请选择至少一条数据");
        }
        return AjaxResult.success(noticeTypeService.removeBatchByIds(ids));
    }
    /**
     * é€šçŸ¥å…¬å‘Šçš„公告类型维护查询
     * @return
     */
    @GetMapping("/list")
    public AjaxResult noticeTypeList() {
        return AjaxResult.success(noticeTypeService.list());
    }
}
src/main/java/com/ruoyi/collaborativeApproval/controller/RulesRegulationsManagementController.java
@@ -38,7 +38,8 @@
    @PostMapping("/add")
    @ApiOperation("新增")
    public AjaxResult add(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){
        return AjaxResult.success(rulesRegulationsManagementService.save(rulesRegulationsManagement));
        rulesRegulationsManagementService.save(rulesRegulationsManagement);
        return AjaxResult.success(rulesRegulationsManagement.getId());
    }
    @PostMapping("/update")
src/main/java/com/ruoyi/collaborativeApproval/controller/RulesRegulationsManagementFileController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
package com.ruoyi.collaborativeApproval.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagementFile;
import com.ruoyi.collaborativeApproval.service.RulesRegulationsManagementFileService;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.quality.pojo.QualityInspectFile;
import com.ruoyi.quality.service.IQualityInspectFileService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
 * <p>
 * è§„章制度管理--附件 å‰ç«¯æŽ§åˆ¶å™¨
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 01:06:41
 */
@RestController
@RequestMapping("/rulesRegulationsManagementFile")
public class RulesRegulationsManagementFileController {
    @Resource
    private RulesRegulationsManagementFileService rulesRegulationsManagementFileService;
    /**
     * æ–°å¢ž
     * @param rulesRegulationsManagementFile
     * @return
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody RulesRegulationsManagementFile rulesRegulationsManagementFile) {
        return AjaxResult.success(rulesRegulationsManagementFileService.save(rulesRegulationsManagementFile));
    }
    /**
     * åˆ é™¤
     * @param ids
     * @return
     */
    @DeleteMapping("/del")
    public AjaxResult delQualityUnqualified(@RequestBody List<Integer> ids) {
        if(CollectionUtils.isEmpty(ids)){
            return AjaxResult.error("请选择至少一条数据");
        }
        //删除检验附件
        return AjaxResult.success(rulesRegulationsManagementFileService.removeBatchByIds(ids));
    }
    /**
     *分页查询
     * @param page
     * @param rulesRegulationsManagementFile
     * @return
     */
    @GetMapping("/listPage")
    public AjaxResult listPage(Page page, RulesRegulationsManagementFile rulesRegulationsManagementFile) {
        return AjaxResult.success(rulesRegulationsManagementFileService.listPage(page, rulesRegulationsManagementFile));
    }
}
src/main/java/com/ruoyi/collaborativeApproval/controller/SealApplicationManagementController.java
@@ -7,6 +7,7 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.service.ISysNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@@ -15,6 +16,7 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
@AllArgsConstructor
@@ -25,6 +27,9 @@
    @Autowired
    private SealApplicationManagementService sealApplicationManagementService;
    @Autowired
    private ISysNoticeService sysNoticeService;
    @GetMapping("/getList")
    @ApiOperation("分页查询")
    public AjaxResult listPage(Page page, SealApplicationManagement sealApplicationManagement){
@@ -34,7 +39,15 @@
    @PostMapping("/add")
    @ApiOperation("新增")
    public AjaxResult add(@RequestBody SealApplicationManagement sealApplicationManagement){
        return AjaxResult.success(sealApplicationManagementService.save(sealApplicationManagement));
        sealApplicationManagementService.save(sealApplicationManagement);
        //消息通知
        sysNoticeService.simpleNoticeByUser("用印审批",
                "申请编号:"+sealApplicationManagement.getApplicationNum()+"\n"
                +"申请标题:"+sealApplicationManagement.getTitle(),
                Arrays.asList(sealApplicationManagement.getApproveUserId()),
                sealApplicationManagement.getTenantId(),
                "/collaborativeApproval/sealManagement?applicationNum="+sealApplicationManagement.getApplicationNum());
        return AjaxResult.success();
    }
    @PostMapping("/update")
src/main/java/com/ruoyi/collaborativeApproval/dto/SealApplicationManagementDTO.java
@@ -8,4 +8,7 @@
    private String createUserName;
    //所属部门
    private String department;
    //审批人
    private String approveUserName;
}
src/main/java/com/ruoyi/collaborativeApproval/mapper/NoticeTypeMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
package com.ruoyi.collaborativeApproval.mapper;
import com.ruoyi.collaborativeApproval.pojo.NoticeType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * <p>
 * é€šçŸ¥å…¬å‘Šçš„公告类型维护 Mapper æŽ¥å£
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 09:57:56
 */
public interface NoticeTypeMapper extends BaseMapper<NoticeType> {
}
src/main/java/com/ruoyi/collaborativeApproval/mapper/RulesRegulationsManagementFileMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
package com.ruoyi.collaborativeApproval.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagementFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * <p>
 * è§„章制度管理--附件 Mapper æŽ¥å£
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 01:06:41
 */
@Mapper
public interface RulesRegulationsManagementFileMapper extends BaseMapper<RulesRegulationsManagementFile> {
    IPage<RulesRegulationsManagementFile> listPage(Page page, @Param("c") RulesRegulationsManagementFile rulesRegulationsManagementFile);
}
src/main/java/com/ruoyi/collaborativeApproval/pojo/Notice.java
@@ -30,9 +30,9 @@
    private String title;
    /**
     * å…¬å‘Šç±»åž‹ï¼ˆ1放假通知 2设备维修通知)
     * å…¬å‘Šç±»åž‹
     */
    @ApiModelProperty("公告类型(1放假通知 2设备维修通知)")
    @ApiModelProperty("公告类型")
    private String type;
    /**
src/main/java/com/ruoyi/collaborativeApproval/pojo/NoticeType.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
package com.ruoyi.collaborativeApproval.pojo;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
 * <p>
 * é€šçŸ¥å…¬å‘Šçš„公告类型维护
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 09:57:56
 */
@Getter
@Setter
@TableName("notice_type")
@ApiModel(value = "NoticeType对象", description = "通知公告的公告类型维护")
public class NoticeType implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty("通知公告的公告类型")
    private String noticeType;
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
}
src/main/java/com/ruoyi/collaborativeApproval/pojo/RulesRegulationsManagementFile.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
package com.ruoyi.collaborativeApproval.pojo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
 * <p>
 * è§„章制度管理--附件
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 01:06:41
 */
@Getter
@Setter
@TableName("rules_regulations_management_file")
@ApiModel(value = "RulesRegulationsManagementFile对象", description = "规章制度管理--附件")
public class RulesRegulationsManagementFile implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty("文件名称")
    private String name;
    @ApiModelProperty("文件路径")
    private String url;
    @ApiModelProperty("文件大小")
    private Integer fileSize;
    @ApiModelProperty("规章制度ID")
    private Integer rulesRegulationsManagementId;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @ApiModelProperty("创建用户")
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    @ApiModelProperty("修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    @ApiModelProperty("修改用户")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    @ApiModelProperty("租户ID")
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
}
src/main/java/com/ruoyi/collaborativeApproval/pojo/SealApplicationManagement.java
@@ -32,7 +32,7 @@
     * ç”¨å°ç±»åž‹
     */
    @ApiModelProperty("用印类型")
    @Excel(name = "用印类型", readConverterExp = "official=公章,contract=合同专用章,finance=财务专用章,legal=未知")
    @Excel(name = "用印类型", readConverterExp = "official=公章,contract=合同专用章,finance=财务专用章,legal=法人章")
    private String sealType;
    /**
     * ç”³è¯·ç”¨å°åŽŸå› 
@@ -51,6 +51,11 @@
    @ApiModelProperty("状态")
    @Excel(name = "状态", readConverterExp = "pending=待审批,approved=已通过,rejected=已拒绝")
    private String status;
    /**
     * å®¡æ‰¹äºº
     */
    private Long approveUserId;
    /**
     * åˆ›å»ºè€…
     */
src/main/java/com/ruoyi/collaborativeApproval/service/NoticeTypeService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
package com.ruoyi.collaborativeApproval.service;
import com.ruoyi.collaborativeApproval.pojo.NoticeType;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * <p>
 * é€šçŸ¥å…¬å‘Šçš„公告类型维护 æœåŠ¡ç±»
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 09:57:56
 */
public interface NoticeTypeService extends IService<NoticeType> {
}
src/main/java/com/ruoyi/collaborativeApproval/service/RulesRegulationsManagementFileService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
package com.ruoyi.collaborativeApproval.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagementFile;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * <p>
 * è§„章制度管理--附件 æœåŠ¡ç±»
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 01:06:41
 */
public interface RulesRegulationsManagementFileService extends IService<RulesRegulationsManagementFile> {
    IPage<RulesRegulationsManagementFile> listPage(Page page, RulesRegulationsManagementFile rulesRegulationsManagementFile);
}
src/main/java/com/ruoyi/collaborativeApproval/service/impl/NoticeTypeServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package com.ruoyi.collaborativeApproval.service.impl;
import com.ruoyi.collaborativeApproval.pojo.NoticeType;
import com.ruoyi.collaborativeApproval.mapper.NoticeTypeMapper;
import com.ruoyi.collaborativeApproval.service.NoticeTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
 * <p>
 * é€šçŸ¥å…¬å‘Šçš„公告类型维护 æœåŠ¡å®žçŽ°ç±»
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 09:57:56
 */
@Service
public class NoticeTypeServiceImpl extends ServiceImpl<NoticeTypeMapper, NoticeType> implements NoticeTypeService {
}
src/main/java/com/ruoyi/collaborativeApproval/service/impl/RulesRegulationsManagementFileServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package com.ruoyi.collaborativeApproval.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagementFile;
import com.ruoyi.collaborativeApproval.mapper.RulesRegulationsManagementFileMapper;
import com.ruoyi.collaborativeApproval.service.RulesRegulationsManagementFileService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.management.Query;
/**
 * <p>
 * è§„章制度管理--附件 æœåŠ¡å®žçŽ°ç±»
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 01:06:41
 */
@Service
public class RulesRegulationsManagementFileServiceImpl extends ServiceImpl<RulesRegulationsManagementFileMapper, RulesRegulationsManagementFile> implements RulesRegulationsManagementFileService {
    @Autowired
    private RulesRegulationsManagementFileMapper rulesRegulationsManagementFileMapper;
    @Override
    public IPage<RulesRegulationsManagementFile> listPage(Page page, RulesRegulationsManagementFile rulesRegulationsManagementFile) {
        return rulesRegulationsManagementFileMapper.listPage(page, rulesRegulationsManagementFile);
    }
}
src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java
@@ -4,13 +4,15 @@
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
/**
 * Entity基类
 *
 *
 * @author ruoyi
 */
public class BaseEntity implements Serializable
@@ -19,6 +21,7 @@
    /** æœç´¢å€¼ */
    @JsonIgnore
    @TableField(exist = false)
    private String searchValue;
    /** åˆ›å»ºè€… */
@@ -40,6 +43,7 @@
    /** è¯·æ±‚参数 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @TableField(exist = false)
    private Map<String, Object> params;
    public String getSearchValue()
src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java
@@ -77,7 +77,7 @@
        // æ‰¹é‡æŸ¥è¯¢ç™»è®°äºº
        Map<Long, SysUser> sysUserMap;
        if (!registrantIds.isEmpty()) {
            List<SysUser> sysUsers = sysUserMapper.selectList(registrantIds);
            List<SysUser> sysUsers = sysUserMapper.selectRegistrantIds(registrantIds);
            sysUserMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getUserId, Function.identity()));
        } else {
            sysUserMap = new HashMap<>();
src/main/java/com/ruoyi/procurementrecord/dto/ProcurementPageDtoCopy.java
@@ -49,7 +49,7 @@
     */
    private String customerName;
    private String salesLedgerProductId;
    private Long salesLedgerProductId;
    /**
     * å‡ºå…¥åº“数量
src/main/java/com/ruoyi/procurementrecord/mapper/ProcurementRecordMapper.java
@@ -39,4 +39,6 @@
    IPage<ProcurementPageDto> listPageByProduction(Page page, @Param("req") ProcurementPageDto procurementDto);
    IPage<ProcurementPageDtoCopy> listPageCopyByProduction(Page page, @Param("req") ProcurementPageDto procurementDto);
    IPage<ProcurementPageDtoCopy> listPagePRS(Page page, @Param("req") ProcurementPageDto procurementDto);
}
src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
@@ -593,7 +593,7 @@
    @Override
    public IPage<ProcurementPageDtoCopy> listPageCopyByProduction(Page page, ProcurementPageDto procurementDto) {
        IPage<ProcurementPageDtoCopy> procurementPageDtoCopyIPage = procurementRecordMapper.listPageCopyByProduction(page, procurementDto);
        IPage<ProcurementPageDtoCopy> procurementPageDtoCopyIPage = procurementRecordMapper.listPagePRS(page, procurementDto);
        List<ProcurementPageDtoCopy> procurementPageDtoCopyList = procurementPageDtoCopyIPage.getRecords();
        // è®¡ç®—待入库数量
        // æŸ¥è¯¢é‡‡è´­è®°å½•已入库数量
@@ -601,38 +601,48 @@
        if(CollectionUtils.isEmpty( collect)){
            return procurementPageDtoCopyIPage;
        }
        LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
        procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect);
        procurementRecordLambdaQueryWrapper.eq(ProcurementRecordOut::getType, 2);
        List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper);
        if(CollectionUtils.isEmpty( procurementRecords)){
            return procurementPageDtoCopyIPage;
        }
        // 1. æŸ¥è¯¢é‡‡è´­è®°å½•已入库的出库记录(按storageId分组)
        LambdaQueryWrapper<ProcurementRecordOut> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect);
        List<ProcurementRecordOut> recordOutList = procurementRecordOutMapper.selectList(queryWrapper);
        // 2. æŒ‰SalesLedgerProductId分组,统计每个id对应的已出库数量总和-已出库数量
        Map<Integer, BigDecimal> storageIdToTotalOutNumMap = recordOutList.stream()
                .collect(Collectors.groupingBy(
                        ProcurementRecordOut::getSalesLedgerProductId,
                        Collectors.reducing(
                                BigDecimal.ZERO,
                                ProcurementRecordOut::getInboundNum,
                                (a, b) -> a.add(b == null ? BigDecimal.ZERO : b)
                        )
                ));
        // 2. procurementPageDtoCopyList按SalesLedgerProductId分组,统计每个id对应的已出库数量总和-入库库数量
        Map<Long, BigDecimal> storageIdToTotalintNumMap = procurementPageDtoCopyList.stream()
                .collect(Collectors.groupingBy(
                        ProcurementPageDtoCopy::getSalesLedgerProductId,
                        Collectors.reducing(
                                BigDecimal.ZERO,
                                ProcurementPageDtoCopy::getInboundNum,
                                (a, b) -> a.add(b == null ? BigDecimal.ZERO : b)
                        )
                ));
        // 3. å¾ªçŽ¯ç»™dto赋值
        for (ProcurementPageDtoCopy dto : procurementPageDtoCopyList) {
            // æ ¹æ®é‡‡è´­å°è´¦ID筛选对应的出库记录
            List<ProcurementRecordOut> collect1 = procurementRecords.stream()
                    .filter(ProcurementRecordOut -> ProcurementRecordOut.getProcurementRecordStorageId().equals(dto.getId()))
                    .collect(Collectors.toList());
            // å¦‚果没有相关的出库记录,跳过该条数据
            if(CollectionUtils.isEmpty(collect1)){
                dto.setInboundNum0(dto.getInboundNum());
                dto.setTotalInboundNum(BigDecimal.ZERO);
                continue;
            }
            // è®¡ç®—已出库数量总和,并设置待出库数量
            BigDecimal totalInboundNum = collect1.stream()
                    .map(ProcurementRecordOut::getInboundNum)
                    .reduce(BigDecimal.ZERO, BigDecimal::add);
            // å‡ºåº“数量 = æ€»æ•°é‡ - å¾…出库数量
            Integer storageId = dto.getId();
            Integer salesLedgerProductId = Integer.valueOf(Math.toIntExact(dto.getSalesLedgerProductId()));
            // èŽ·å–å½“å‰salesLedgerProductId对应的已出库总数(默认0)
            BigDecimal totalInboundNum = storageIdToTotalOutNumMap.getOrDefault(salesLedgerProductId, BigDecimal.ZERO);
            // å·²å‡ºåº“数量
            dto.setTotalInboundNum(totalInboundNum);
            // å¾…出库数量 = æ€»æ•°é‡ - å·²å‡ºåº“数量
            dto.setInboundNum0(dto.getInboundNum().subtract(totalInboundNum));
            // åº“存价值
            if(dto.getUnitPrice() != null){
                dto.setTotalPrice(dto.getTotalInboundNum().multiply(dto.getUnitPrice()));
            }
            // å¾…出库数量 = æ€»æ•°é‡ - å·²å‡ºåº“数量(总数量空值则默认0)
//            BigDecimal totalNum = dto.getInboundNum() == null ? BigDecimal.ZERO : dto.getInboundNum();
            BigDecimal totalNum = storageIdToTotalintNumMap.getOrDefault(salesLedgerProductId, BigDecimal.ZERO);
            dto.setInboundNum(totalNum);
            dto.setInboundNum0(totalNum.subtract(totalInboundNum));
            // åº“存价值 = å·²å‡ºåº“数量 * å•价(单价空值则默认0)
            BigDecimal unitPrice = dto.getUnitPrice() == null ? BigDecimal.ZERO : dto.getUnitPrice();
            dto.setTotalPrice(totalInboundNum.multiply(unitPrice));
        }
        return procurementPageDtoCopyIPage;
    }
src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -23,9 +23,11 @@
import com.ruoyi.quality.mapper.QualityInspectMapper;
import com.ruoyi.quality.mapper.QualityInspectParamMapper;
import com.ruoyi.quality.mapper.QualityTestStandardMapper;
import com.ruoyi.quality.mapper.QualityTestStandardParamMapper;
import com.ruoyi.quality.pojo.QualityInspect;
import com.ruoyi.quality.pojo.QualityInspectParam;
import com.ruoyi.quality.pojo.QualityTestStandard;
import com.ruoyi.quality.pojo.QualityTestStandardParam;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -63,6 +65,7 @@
    private ProductMapper productMapper;
    private QualityTestStandardMapper qualityTestStandardMapper;
    private QualityTestStandardParamMapper qualityTestStandardParamMapper;
    private QualityInspectParamMapper qualityInspectParamMapper;
@@ -168,16 +171,16 @@
            qualityInspect.setProductMainId(productionProductMain.getId());
            qualityInspectMapper.insert(qualityInspect);
            qualityTestStandardMapper.selectList(
                    new LambdaQueryWrapper<QualityTestStandard>()
                            .eq(QualityTestStandard::getProductId, product.getId())
            ).forEach(standard -> {
                QualityInspectParam param = new QualityInspectParam();
                BeanUtils.copyProperties(standard, param);
                param.setId(null);
                param.setInspectId(qualityInspect.getId());
                qualityInspectParamMapper.insert(param);
            });
            List<QualityTestStandardParam> qualityTestStandardParams = qualityTestStandardParamMapper.selectListByProductId(product.getId());
            if (qualityTestStandardParams.size()>0) {
                qualityTestStandardParams.forEach(standard -> {
                    QualityInspectParam param = new QualityInspectParam();
                    BeanUtils.copyProperties(standard, param);
                    param.setId(null);
                    param.setInspectId(qualityInspect.getId());
                    qualityInspectParamMapper.insert(param);
                });
            }
        }
        // æ·»åŠ æŠ•å…¥
        if (productModel != null) {
src/main/java/com/ruoyi/project/system/domain/SysUser.java
@@ -16,7 +16,7 @@
/**
 * ç”¨æˆ·å¯¹è±¡ sys_user
 *
 *
 * @author ruoyi
 */
public class SysUser extends BaseEntity
@@ -73,31 +73,39 @@
        @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
        @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
    })
    @TableField(exist = false)
    private SysDept dept;
    /** è§’色对象 */
    @TableField(exist = false)
    private List<SysRole> roles;
    /** è§’色组 */
    @TableField(exist = false)
    private Long[] roleIds;
    /** å²—位组 */
    @TableField(exist = false)
    private Long[] postIds;
    /** è§’色ID */
    @TableField(exist = false)
    private Long roleId;
    /** ç§Ÿæˆ·ID */
    private Long tenantId;
    @TableField(exist = false)
    private Long[] deptIds;
    @TableField(exist = false)
    private Long deptId;
    @TableField(exist = false)
    private Long currentDeptId;
    /** å½“前登录公司 */
    @TableField(exist = false)
    private String currentFactoryName;
    public String getCurrentFactoryName() {
@@ -111,6 +119,7 @@
    /**
     * éƒ¨é—¨åç§°
     */
    @TableField(exist = false)
    private String deptNames;
    public Long getCurrentDeptId() {
@@ -371,7 +380,6 @@
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("dept", getDept())
            .toString();
    }
}
src/main/java/com/ruoyi/project/system/mapper/SysUserMapper.java
@@ -149,7 +149,7 @@
     */
    public SysUser checkEmailUnique(String email);
    List<SysUser> selectList(List<Long> registrantIds);
    List<SysUser> selectRegistrantIds(List<Long> registrantIds);
    List<SysUser> selectUsersByIds(@Param("userIds") List<Long> userIds);
src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java
@@ -67,26 +67,6 @@
    int readAll();
    /**
     * é€šè¿‡è§’色 å‘送提醒
     * @param title æ ‡é¢˜
     * @param message å†…容
     * @param needPushRoles å‘送的角色
     * @param jumpPath è·³è½¬åœ°å€
     */
    void simpleNoticeByRoles(final String title, final String message, final Long tenantId,final List<String> needPushRoles,
                                      final String jumpPath);
    /**
     * é€šè¿‡æƒé™ å‘送提醒
     * @param title æ ‡é¢˜
     * @param message æ¶ˆæ¯
     * @param needPerms å‘送的权限者 å·²åŒ…含上级
     * @param jumpPath è·³è½¬åœ°å€
     */
    void simpleNoticeByPerms(final String title, final String message, final Long tenantId,final List<String> needPerms,
                                      final String jumpPath);
    /**
     * é€šè¿‡æŒ‡å®šäººå‘送提醒
     * @param title æ ‡é¢˜
     * @param message æ¶ˆæ¯
@@ -103,5 +83,4 @@
     */
    void simpleNoticeAll(final String title, final String message,final Long tenantId,final String jumpPath);
    void insertBatch(final List<SysNotice> notices);
}
src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java
@@ -5,6 +5,8 @@
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -12,6 +14,7 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.xiaoymin.knife4j.core.util.StrUtil;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
@@ -126,33 +129,6 @@
    }
    @Override
    public void simpleNoticeByRoles(final String title, String message, Long tenantId, List<String> needPushRoles,
                                             final String jumpPath) {
        Long userId = SecurityUtils.getUserId();
        if (StrUtil.isBlank(message) || CollectionUtils.isEmpty(needPushRoles)) {
            return;
        }
        List<String> rolesWithAdmin = new ArrayList<>(needPushRoles);
        rolesWithAdmin.add("管理员");
        List<SysNotice> collect = rolesWithAdmin.stream()
                .flatMap(it -> userMapper.getUserByRole(it).stream())
                .map(it -> convertSysNotice(title, message, it,tenantId, jumpPath, userId))
                .collect(Collectors.toList());
        sysNoticeService.insertBatch(collect);
    }
    @Override
    public void simpleNoticeByPerms(String title, String message, Long tenantId, List<String> needPerms,
                                             String jumpPath) {
        Long userId = SecurityUtils.getLoginUser().getUserId();
        if (StrUtil.isBlank(message) || CollectionUtils.isEmpty(needPerms)) {
            return;
        }
        List<SysNotice> collect = userMapper.getUserByPerms(needPerms).stream().map(it -> convertSysNotice(title, message, it,tenantId, jumpPath,  userId)).collect(Collectors.toList());
        sysNoticeService.insertBatch(collect);
    }
    @Override
    public void simpleNoticeByUser(String title, String message,  List<Long> consigneeId, Long tenantId,
                                    String jumpPath) {
        Long userId = SecurityUtils.getLoginUser().getUserId();
@@ -163,21 +139,13 @@
    @Override
    public void simpleNoticeAll(String title, String message,  Long tenantId,String jumpPath) {
        Long userId = SecurityUtils.getLoginUser().getUserId();
        List<SysNotice> collect = userMapper.selectList(null).stream().map(it -> convertSysNotice(title, message, it.getUserId(),tenantId, jumpPath,  userId)).collect(Collectors.toList());
        List<SysUser> sysUsers = userMapper.selectList(Wrappers.<SysUser>lambdaQuery()
                .eq(SysUser::getStatus, "0")
                .eq(SysUser::getTenantId, tenantId));
        List<SysNotice> collect = sysUsers.stream().map(it -> convertSysNotice(title, message, it.getUserId(),tenantId, jumpPath,  userId)).collect(Collectors.toList());
        sysNoticeService.saveBatch(collect);
    }
    @Override
    public void insertBatch(List<SysNotice> noticesList) {
        if(CollectionUtils.isEmpty(noticesList)){
            return;
        }
        // æŽ’除掉自己
        Long userId = SecurityUtils.getUserId();
        List<SysNotice> noticesListNew = noticesList.stream().filter(Objects::nonNull).filter(it -> !Objects.equals(it.getConsigneeId(), userId)).collect(Collectors.toList());
        sysNoticeService.saveBatch(noticesListNew);
    }
    private SysNotice convertSysNotice(String title,String message,Long consigneeId, Long tenantId,String jumpPath,Long currentUserId) {
        SysNotice sysNotice = new SysNotice();
src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
@@ -69,7 +69,7 @@
     */
    @Log(title = "付款登记", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody PaymentRegistration paymentRegistration) {
    public AjaxResult add(@RequestBody List<PaymentRegistration>  paymentRegistration) {
        return toAjax(paymentRegistrationService.insertPaymentRegistration(paymentRegistration));
    }
src/main/java/com/ruoyi/purchase/pojo/PaymentRegistration.java
@@ -37,6 +37,11 @@
    private Long purchaseLedgerId;
    /**
     * é‡‡è´­è®¢å•产品id
     */
    private Long saleLedgerProductId;
    /**
     * ä¾›åº”商id
     */
    private Long supplierId;
@@ -66,9 +71,11 @@
    /**
     * ç™»è®°äºº
     */
    @TableField(fill = FieldFill.INSERT)
    private Long registrantId;
    // ç§Ÿæˆ·id
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
    /**
src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java
@@ -41,7 +41,7 @@
     * @param paymentRegistration ä»˜æ¬¾ç™»è®°
     * @return ç»“æžœ
     */
    public int insertPaymentRegistration(PaymentRegistration paymentRegistration);
    public int insertPaymentRegistration(List<PaymentRegistration>  paymentRegistration);
    /**
     * ä¿®æ”¹ä»˜æ¬¾ç™»è®°
src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
@@ -22,10 +22,12 @@
import com.ruoyi.purchase.service.IPaymentRegistrationService;
import com.ruoyi.sales.mapper.SalesLedgerMapper;
import com.ruoyi.sales.mapper.SalesLedgerProductMapper;
import com.ruoyi.sales.pojo.ReceiptPayment;
import com.ruoyi.sales.pojo.SalesLedger;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
@@ -91,43 +93,33 @@
    /**
     * æ–°å¢žä»˜æ¬¾ç™»è®°
     *
     * @param paymentRegistration ä»˜æ¬¾ç™»è®°
     * @param paymentRegistrationList ä»˜æ¬¾ç™»è®°
     * @return ç»“æžœ
     */
    @Override
    public int insertPaymentRegistration(PaymentRegistration paymentRegistration) {
        PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(paymentRegistration.getPurchaseLedgerId());
        SalesLedger salesLedger = salesLedgerMapper.selectOne(new QueryWrapper<SalesLedger>().
                eq("sales_contract_no", purchaseLedger.getSalesContractNo()));
//        if (salesLedger == null) {
//            throw new RuntimeException("关联销售合同号不存在");
//        }
        if (salesLedger != null) {
            paymentRegistration.setSaleLedgerId(salesLedger.getId());
    public int insertPaymentRegistration(List<PaymentRegistration> paymentRegistrationList) {
        for (PaymentRegistration paymentRegistration : paymentRegistrationList) {
            PaymentRegistration byId = paymentRegistration;
            if (!ObjectUtils.isEmpty(paymentRegistration.getId())){
                paymentRegistration = this.getById(paymentRegistration.getId());
            }
            PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(paymentRegistration.getPurchaseLedgerId());
            if(null==purchaseLedger) throw new RuntimeException("未找到采购单");
            // å·²å›žæ¬¾é‡‘额
            SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(paymentRegistration.getSaleLedgerProductId());
            if(null==salesLedgerProduct) throw new RuntimeException("未找到采购单产品");
            if (salesLedgerProduct.getPendingInvoiceTotal().compareTo(paymentRegistration.getCurrentPaymentAmount())<0){
                throw new RuntimeException("本次回款金额不能大于待回款金额");
            }
            paymentRegistration.setCreateTime(DateUtils.getNowDate());
            paymentRegistration.setUpdateTime(DateUtils.getNowDate());
            salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getInvoiceTotal().add(paymentRegistration.getCurrentPaymentAmount()));
            salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getInvoiceTotal()));
            paymentRegistrationMapper.insert(paymentRegistration);
            salesLedgerProductMapper.updateById(salesLedgerProduct);
        }
        paymentRegistration.setSupplierId(purchaseLedger.getSupplierId());
        return 1;
        TicketRegistration tr = ticketRegistrationMapper.selectOne(new LambdaQueryWrapper<TicketRegistration>().eq(TicketRegistration::getId, paymentRegistration.getTicketRegistrationId()));
        if (tr == null) {
            throw new RuntimeException("关联发票不存在");
        }
        List<PaymentRegistration> paymentRegistrations = paymentRegistrationMapper.selectList(new QueryWrapper<PaymentRegistration>()
                .eq("ticket_registration_id", tr.getId()));
        BigDecimal total = paymentRegistrations.stream().map(PaymentRegistration::getCurrentPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
        if (total.add(paymentRegistration.getCurrentPaymentAmount()).compareTo(tr.getInvoiceAmount()) > 0) {
            throw new RuntimeException("付款金额超出发票金额");
        }
        LoginUser loginUser = SecurityUtils.getLoginUser();
        Long tenantId = loginUser.getTenantId();
        paymentRegistration.setTenantId(tenantId);
        paymentRegistration.setRegistrantId(loginUser.getUserId());
        paymentRegistration.setCreateTime(DateUtils.getNowDate());
        paymentRegistration.setUpdateTime(DateUtils.getNowDate());
        return paymentRegistrationMapper.insert(paymentRegistration);
    }
    /**
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
@@ -39,9 +39,11 @@
import com.ruoyi.quality.mapper.QualityInspectMapper;
import com.ruoyi.quality.mapper.QualityInspectParamMapper;
import com.ruoyi.quality.mapper.QualityTestStandardMapper;
import com.ruoyi.quality.mapper.QualityTestStandardParamMapper;
import com.ruoyi.quality.pojo.QualityInspect;
import com.ruoyi.quality.pojo.QualityInspectParam;
import com.ruoyi.quality.pojo.QualityTestStandard;
import com.ruoyi.quality.pojo.QualityTestStandardParam;
import com.ruoyi.sales.mapper.*;
import com.ruoyi.sales.pojo.CommonFile;
import com.ruoyi.sales.pojo.InvoiceRegistrationProduct;
@@ -109,6 +111,7 @@
    private final StringRedisTemplate redisTemplate;
    private final QualityInspectMapper qualityInspectMapper;
    private final QualityTestStandardMapper qualityTestStandardMapper;
    private final QualityTestStandardParamMapper qualityTestStandardParamMapper;
    private final QualityInspectParamMapper qualityInspectParamMapper;
    @Value("${file.upload-dir}")
@@ -242,17 +245,16 @@
            qualityInspect.setUnit(saleProduct.getUnit());
            qualityInspect.setQuantity(saleProduct.getQuantity());
            qualityInspectMapper.insert(qualityInspect);
            QualityTestStandard qualityTestStandard = new QualityTestStandard();
            qualityTestStandard.setProductId(saleProduct.getProductId());
            List<QualityTestStandard> qualityTestStandards = qualityTestStandardMapper.qualityTestStandardList(qualityTestStandard);
            for (QualityTestStandard qualityTestStandardDB : qualityTestStandards) {
                QualityInspectParam qualityInspectParam = new QualityInspectParam();
                qualityInspectParam.setInspectId(qualityInspect.getId());
                qualityInspectParam.setParameterItem(qualityTestStandardDB.getParameterItem());
                qualityInspectParam.setUnit(qualityTestStandardDB.getUnit());
                qualityInspectParam.setStandardValue(qualityTestStandardDB.getStandardValue());
                qualityInspectParam.setControlValue(qualityTestStandardDB.getControlValue());
                qualityInspectParamMapper.insert(qualityInspectParam);
            List<QualityTestStandardParam> qualityTestStandardParams = qualityTestStandardParamMapper.selectListByProductId(saleProduct.getProductId());
            if (qualityTestStandardParams.size()>0) {
                qualityTestStandardParams.forEach(standard -> {
                    QualityInspectParam param = new QualityInspectParam();
                    com.ruoyi.common.utils.bean.BeanUtils.copyProperties(standard, param);
                    param.setId(null);
                    param.setInspectId(qualityInspect.getId());
                    qualityInspectParamMapper.insert(param);
                });
            }
        }
@@ -331,6 +333,7 @@
                LocalDateTime localDateTime = entryDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
                salesLedgerProduct.setRegisterDate(localDateTime);
                salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice());
                salesLedgerProductMapper.insert(salesLedgerProduct);
            }
        }
src/main/java/com/ruoyi/quality/controller/QualityTestStandardBindingController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.ruoyi.quality.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.quality.pojo.QualityTestStandardBinding;
import com.ruoyi.quality.pojo.QualityTestStandardParam;
import com.ruoyi.quality.service.QualityTestStandardBindingService;
import com.ruoyi.quality.service.QualityTestStandardParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†ä¸»è¡¨ä¸Žäº§å“å…³è”表 å‰ç«¯æŽ§åˆ¶å™¨
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:39:40
 */
@RestController
@RequestMapping("/qualityTestStandardBinding")
public class QualityTestStandardBindingController {
    @Autowired
    private QualityTestStandardBindingService qualityTestStandardBindingService;
    /**
     * æ–°å¢žæ£€æµ‹æ ‡å‡†ä¸»è¡¨ä¸Žäº§å“å…³è”表
     * @param qualityTestStandardBindings
     * @return
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody List<QualityTestStandardBinding> qualityTestStandardBindings) {
        return AjaxResult.success(qualityTestStandardBindingService.saveBatch(qualityTestStandardBindings));
    }
    /**
     * åˆ é™¤æ£€æµ‹æ ‡å‡†ä¸»è¡¨ä¸Žäº§å“å…³è”表
     * @param ids
     * @return
     */
    @DeleteMapping("/del")
    public AjaxResult delQualityTestStandard(@RequestBody List<Integer> ids) {
        if(CollectionUtils.isEmpty(ids)){
            return AjaxResult.error("请选择至少一条数据");
        }
        return AjaxResult.success(qualityTestStandardBindingService.removeBatchByIds(ids));
    }
    /**
     *检测指标维护查询
     * @return
     */
    @GetMapping("/list")
    public AjaxResult listBinding(Long testStandardId) {
        return AjaxResult.success(qualityTestStandardBindingService.listBinding(testStandardId));
    }
}
src/main/java/com/ruoyi/quality/controller/QualityTestStandardController.java
@@ -1,25 +1,25 @@
package com.ruoyi.quality.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.quality.pojo.QualityTestStandard;
import com.ruoyi.quality.service.IQualityTestStandardService;
import com.ruoyi.staff.pojo.StaffJoinLeaveRecord;
import com.ruoyi.staff.pojo.StaffOnJob;
import com.ruoyi.staff.service.IStaffOnJobService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * æ£€æµ‹æŒ‡æ ‡ç»´æŠ¤
 * <p>
 * æ£€æµ‹æ ‡å‡†ä¸»è¡¨ å‰ç«¯æŽ§åˆ¶å™¨
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:40:24
 */
@RestController
@RequestMapping("/quality/qualityTestStandard")
@RequestMapping("/qualityTestStandard")
public class QualityTestStandardController {
    @Resource
@@ -27,7 +27,7 @@
    /**
     * æ–°å¢žæ£€æµ‹æŒ‡æ ‡ç»´æŠ¤
     * æ–°å¢žæ£€æµ‹æ ‡å‡†ä¸»è¡¨
     * @param qualityTestStandard
     * @return
     */
@@ -37,7 +37,7 @@
    }
    /**
     * åˆ é™¤æ£€æµ‹æŒ‡æ ‡ç»´æŠ¤
     * åˆ é™¤æ£€æµ‹æ ‡å‡†ä¸»è¡¨
     * @param ids
     * @return
     */
@@ -50,17 +50,7 @@
    }
    /**
     * æ£€æµ‹æŒ‡æ ‡ç»´æŠ¤è¯¦æƒ…
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public AjaxResult QualityTestStandardDetail(@PathVariable("id") Integer id) {
        return AjaxResult.success(qualityTestStandardService.getById(id));
    }
    /**
     * æ£€æµ‹æŒ‡æ ‡ç»´æŠ¤ä¿®æ”¹
     * æ£€æµ‹æ ‡å‡†ä¸»è¡¨ä¿®æ”¹
     * @param qualityTestStandard
     * @return
     */
@@ -70,7 +60,7 @@
    }
    /**
     *检测指标维护分页查询
     *检测标准主表分页查询
     * @param page
     * @param qualityTestStandard
     * @return
@@ -81,24 +71,13 @@
    }
    /**
     * æ£€æµ‹æŒ‡æ ‡ç»´æŠ¤å¯¼å‡º
     * @param response
     * æ£€æµ‹æ ‡å‡†å¤åˆ¶å‚æ•°
     * @param qualityTestStandard
     */
    @PostMapping("/export")
    public void qualityTestStandardListPageExport(HttpServletResponse response,QualityTestStandard qualityTestStandard) {
        qualityTestStandardService.qualityTestStandardListPageExport(response, qualityTestStandard);
    }
    /**
     * è¯¦æƒ…
     * @param productId
     * @return
     */
    @GetMapping("/product/{productId}")
    public AjaxResult QualityInspectDetail(@PathVariable("productId") Long productId) {
        return AjaxResult.success(qualityTestStandardService.list(Wrappers.<QualityTestStandard>lambdaQuery().eq(QualityTestStandard::getProductId,productId)));
    @PostMapping("/copyParam")
    public AjaxResult copyParam(@RequestBody QualityTestStandard qualityTestStandard) {
        return AjaxResult.success(qualityTestStandardService.copyParam(qualityTestStandard));
    }
}
src/main/java/com/ruoyi/quality/controller/QualityTestStandardParamController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,72 @@
package com.ruoyi.quality.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.quality.pojo.QualityTestStandard;
import com.ruoyi.quality.pojo.QualityTestStandardParam;
import com.ruoyi.quality.service.QualityTestStandardParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†å‚æ•° å‰ç«¯æŽ§åˆ¶å™¨
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:39:49
 */
@RestController
@RequestMapping("/qualityTestStandardParam")
public class QualityTestStandardParamController {
    @Autowired
    private QualityTestStandardParamService qualityTestStandardParamService;
    /**
     * æ–°å¢žæ£€æµ‹æ ‡å‡†å‚æ•°
     * @param qualityTestStandardParam
     * @return
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody QualityTestStandardParam qualityTestStandardParam) {
        return AjaxResult.success(qualityTestStandardParamService.save(qualityTestStandardParam));
    }
    /**
     * åˆ é™¤æ£€æµ‹æŒ‡æ ‡ç»´æŠ¤
     * @param ids
     * @return
     */
    @DeleteMapping("/del")
    public AjaxResult delQualityTestStandard(@RequestBody List<Integer> ids) {
        if(CollectionUtils.isEmpty(ids)){
            return AjaxResult.error("请选择至少一条数据");
        }
        return AjaxResult.success(qualityTestStandardParamService.removeBatchByIds(ids));
    }
    /**
     * æ£€æµ‹æŒ‡æ ‡ç»´æŠ¤ä¿®æ”¹
     * @param qualityTestStandardParam
     * @return
     */
    @PostMapping("/update")
    public AjaxResult update(@RequestBody QualityTestStandardParam qualityTestStandardParam) {
        return AjaxResult.success(qualityTestStandardParamService.updateById(qualityTestStandardParam));
    }
    /**
     *检测指标维护查询
     * @return
     */
    @GetMapping("/list")
    public AjaxResult list(Long testStandardId) {
        return AjaxResult.success(qualityTestStandardParamService.list(Wrappers.<QualityTestStandardParam>lambdaQuery().eq(QualityTestStandardParam::getTestStandardId,testStandardId)));
    }
}
src/main/java/com/ruoyi/quality/controller/QualityUnqualifiedController.java
@@ -2,9 +2,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.quality.pojo.QualityTestStandard;
import com.ruoyi.quality.pojo.QualityUnqualified;
import com.ruoyi.quality.service.IQualityTestStandardService;
import com.ruoyi.quality.service.IQualityUnqualifiedService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
src/main/java/com/ruoyi/quality/dto/QualityTestStandardBindingDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
package com.ruoyi.quality.dto;
import lombok.Data;
@Data
//分页回显展示字段
public class QualityTestStandardBindingDto {
    private String productName;
}
src/main/java/com/ruoyi/quality/mapper/QualityTestStandardBindingMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
package com.ruoyi.quality.mapper;
import com.ruoyi.quality.dto.QualityTestStandardBindingDto;
import com.ruoyi.quality.pojo.QualityTestStandardBinding;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†ä¸»è¡¨ä¸Žäº§å“å…³è”表 Mapper æŽ¥å£
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:39:40
 */
@Mapper
public interface QualityTestStandardBindingMapper extends BaseMapper<QualityTestStandardBinding> {
    List<QualityTestStandardBindingDto> listBinding(@Param("testStandardId") Long testStandardId);
}
src/main/java/com/ruoyi/quality/mapper/QualityTestStandardMapper.java
@@ -1,21 +1,22 @@
package com.ruoyi.quality.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.quality.pojo.QualityTestStandard;
import com.ruoyi.staff.pojo.StaffOnJob;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†ä¸»è¡¨ Mapper æŽ¥å£
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:40:24
 */
@Mapper
public interface QualityTestStandardMapper extends BaseMapper<QualityTestStandard> {
    IPage<QualityTestStandard> qualityTestStandardListPage(@Param("page") Page page, @Param("qualityTestStandard") QualityTestStandard qualityTestStandard);
    List<QualityTestStandard> qualityTestStandardList(@Param("qualityTestStandard") QualityTestStandard qualityTestStandard);
    IPage<QualityTestStandard> qualityTestStandardListPage(Page page, @Param("c") QualityTestStandard qualityTestStandard);
}
src/main/java/com/ruoyi/quality/mapper/QualityTestStandardParamMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
package com.ruoyi.quality.mapper;
import com.ruoyi.quality.pojo.QualityTestStandardParam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†å‚æ•° Mapper æŽ¥å£
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:39:49
 */
@Mapper
public interface QualityTestStandardParamMapper extends BaseMapper<QualityTestStandardParam> {
    List<QualityTestStandardParam> selectListByProductId(@Param("productId") Long productId);
}
src/main/java/com/ruoyi/quality/pojo/QualityTestStandard.java
@@ -1,84 +1,72 @@
package com.ruoyi.quality.pojo;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
 * è´¨é‡ç®¡ç†--检测指标维护
 * quality_test_standard
 * <p>
 * æ£€æµ‹æ ‡å‡†ä¸»è¡¨
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:40:24
 */
@TableName(value = "quality_test_standard")
@Data
@Getter
@Setter
@TableName("quality_test_standard")
@ApiModel(value = "QualityTestStandard对象", description = "检测标准主表")
public class QualityTestStandard implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * åºå·
     */
    @TableId(type = IdType.AUTO)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty("标准编号")
    private String standardNo;
    /**
     * æŒ‡æ ‡
     */
    @Excel(name = "指标")
    private String parameterItem;
    @ApiModelProperty("标准名称")
    private String standardName;
    /**
     * å•位
     */
    @Excel(name = "单位")
    private String unit;
    @ApiModelProperty("备注")
    private String remark;
    /**
     * æ ‡å‡†å€¼
     */
    @Excel(name = "标准值")
    private String standardValue;
    /**
     * å†…控值
     */
    @Excel(name = "内控值")
    private String controlValue;
    /**
     * å…³è”产品id
     */
    @NotBlank(message = "产品id不能为空!")
    @Excel(name = "关联产品id")
    private Long productId;
    @ApiModelProperty(value = "创建时间")
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @ApiModelProperty(value = "创建用户")
    @ApiModelProperty("创建用户")
    @TableField(fill = FieldFill.INSERT)
    private Integer createUser;
    private Long createUser;
    @ApiModelProperty(value = "修改时间")
    @ApiModelProperty("修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    @ApiModelProperty(value = "修改用户")
    @ApiModelProperty("修改用户")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
    private Long updateUser;
    @ApiModelProperty(value = "租户ID")
    @ApiModelProperty("租户ID")
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
    @ApiModelProperty("状态")
    private String state;
    @ApiModelProperty("类别(0:原材料检验;1:过程检验;2:出厂检验)")
    private Integer inspectType;
    @ApiModelProperty("工序id")
    private Integer processId;
}
src/main/java/com/ruoyi/quality/pojo/QualityTestStandardBinding.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
package com.ruoyi.quality.pojo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†ä¸»è¡¨ä¸Žäº§å“å…³è”表
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:39:40
 */
@Getter
@Setter
@TableName("quality_test_standard_binding")
@ApiModel(value = "QualityTestStandardBinding对象", description = "检测标准主表与产品关联表")
public class QualityTestStandardBinding implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty("产品ID")
    private Long productId;
    @ApiModelProperty("关联检测标准主表id")
    private Integer testStandardId;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @ApiModelProperty("创建用户")
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    @ApiModelProperty("修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    @ApiModelProperty("修改用户")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    @ApiModelProperty("租户ID")
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
}
src/main/java/com/ruoyi/quality/pojo/QualityTestStandardParam.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
package com.ruoyi.quality.pojo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†å‚æ•°
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:39:49
 */
@Getter
@Setter
@TableName("quality_test_standard_param")
@ApiModel(value = "QualityTestStandardParam对象", description = "检测标准参数")
public class QualityTestStandardParam implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty("参数项")
    private String parameterItem;
    @ApiModelProperty("单位")
    private String unit;
    @ApiModelProperty("标准值")
    private String standardValue;
    @ApiModelProperty("内控值")
    private String controlValue;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @ApiModelProperty("创建用户")
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    @ApiModelProperty("修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    @ApiModelProperty("修改用户")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    @ApiModelProperty("租户ID")
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
    @ApiModelProperty("关联检测标准主表id")
    private Long testStandardId;
    @ApiModelProperty("默认值")
    private String defaultValue;
}
src/main/java/com/ruoyi/quality/service/IQualityTestStandardService.java
@@ -3,15 +3,20 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.quality.pojo.QualityInspect;
import com.ruoyi.quality.pojo.QualityTestStandard;
import javax.servlet.http.HttpServletResponse;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†ä¸»è¡¨ æœåŠ¡ç±»
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:40:24
 */
public interface IQualityTestStandardService extends IService<QualityTestStandard> {
    IPage<QualityTestStandard> qualityTestStandardListPage(Page page, QualityTestStandard qualityTestStandard);
    void qualityTestStandardListPageExport(HttpServletResponse response, QualityTestStandard qualityTestStandard);
    int copyParam(QualityTestStandard qualityTestStandard);
}
src/main/java/com/ruoyi/quality/service/QualityTestStandardBindingService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
package com.ruoyi.quality.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.quality.dto.QualityTestStandardBindingDto;
import com.ruoyi.quality.pojo.QualityTestStandardBinding;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†ä¸»è¡¨ä¸Žäº§å“å…³è”表 æœåŠ¡ç±»
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:39:40
 */
public interface QualityTestStandardBindingService extends IService<QualityTestStandardBinding> {
    List<QualityTestStandardBindingDto> listBinding(Long testStandardId);
}
src/main/java/com/ruoyi/quality/service/QualityTestStandardParamService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
package com.ruoyi.quality.service;
import com.ruoyi.quality.pojo.QualityTestStandardParam;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†å‚æ•° æœåŠ¡ç±»
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:39:49
 */
public interface QualityTestStandardParamService extends IService<QualityTestStandardParam> {
}
src/main/java/com/ruoyi/quality/service/impl/QualityTestStandardBindingServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.ruoyi.quality.service.impl;
import com.ruoyi.quality.dto.QualityTestStandardBindingDto;
import com.ruoyi.quality.pojo.QualityTestStandardBinding;
import com.ruoyi.quality.mapper.QualityTestStandardBindingMapper;
import com.ruoyi.quality.service.QualityTestStandardBindingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†ä¸»è¡¨ä¸Žäº§å“å…³è”表 æœåŠ¡å®žçŽ°ç±»
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:39:40
 */
@Service
public class QualityTestStandardBindingServiceImpl extends ServiceImpl<QualityTestStandardBindingMapper, QualityTestStandardBinding> implements QualityTestStandardBindingService {
    @Autowired
    private QualityTestStandardBindingMapper qualityTestStandardBindingMapper;
    @Override
    public List<QualityTestStandardBindingDto> listBinding(Long testStandardId) {
        return qualityTestStandardBindingMapper.listBinding(testStandardId);
    }
}
src/main/java/com/ruoyi/quality/service/impl/QualityTestStandardParamServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package com.ruoyi.quality.service.impl;
import com.ruoyi.quality.pojo.QualityTestStandardParam;
import com.ruoyi.quality.mapper.QualityTestStandardParamMapper;
import com.ruoyi.quality.service.QualityTestStandardParamService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†å‚æ•° æœåŠ¡å®žçŽ°ç±»
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:39:49
 */
@Service
public class QualityTestStandardParamServiceImpl extends ServiceImpl<QualityTestStandardParamMapper, QualityTestStandardParam> implements QualityTestStandardParamService {
}
src/main/java/com/ruoyi/quality/service/impl/QualityTestStandardServiceImpl.java
@@ -1,30 +1,41 @@
package com.ruoyi.quality.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.quality.mapper.QualityInspectMapper;
import com.ruoyi.quality.mapper.QualityTestStandardMapper;
import com.ruoyi.quality.pojo.QualityInspect;
import com.ruoyi.quality.mapper.QualityTestStandardParamMapper;
import com.ruoyi.quality.pojo.QualityTestStandard;
import com.ruoyi.quality.service.IQualityInspectService;
import com.ruoyi.quality.mapper.QualityTestStandardMapper;
import com.ruoyi.quality.pojo.QualityTestStandardParam;
import com.ruoyi.quality.service.IQualityTestStandardService;
import com.ruoyi.staff.pojo.StaffJoinLeaveRecord;
import lombok.AllArgsConstructor;
import org.springframework.security.core.parameters.P;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.quality.service.QualityTestStandardParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.stream.Collectors;
@AllArgsConstructor
/**
 * <p>
 * æ£€æµ‹æ ‡å‡†ä¸»è¡¨ æœåŠ¡å®žçŽ°ç±»
 * </p>
 *
 * @author èŠ¯å¯¼è½¯ä»¶ï¼ˆæ±Ÿè‹ï¼‰æœ‰é™å…¬å¸
 * @since 2026-01-13 03:40:24
 */
@Service
public class QualityTestStandardServiceImpl extends ServiceImpl<QualityTestStandardMapper, QualityTestStandard>  implements IQualityTestStandardService {
public class QualityTestStandardServiceImpl extends ServiceImpl<QualityTestStandardMapper, QualityTestStandard> implements IQualityTestStandardService {
    @Autowired
    private QualityTestStandardMapper qualityTestStandardMapper;
    @Autowired
    private QualityTestStandardParamMapper qualityTestStandardParamMapper;
    @Autowired
    private QualityTestStandardParamService qualityTestStandardParamService;
    @Override
    public IPage<QualityTestStandard> qualityTestStandardListPage(Page page, QualityTestStandard qualityTestStandard) {
@@ -32,9 +43,20 @@
    }
    @Override
    public void qualityTestStandardListPageExport(HttpServletResponse response, QualityTestStandard qualityTestStandard) {
        List<QualityTestStandard> qualityTestStandards =qualityTestStandardMapper.qualityTestStandardList(qualityTestStandard);
        ExcelUtil<QualityTestStandard> util = new ExcelUtil<QualityTestStandard>(QualityTestStandard.class);
        util.exportExcel(response, qualityTestStandards, "检测指标导出");
    public int copyParam(QualityTestStandard qualityTestStandard) {
        //先查询被复制的检测标准的详情参数
        List<QualityTestStandardParam> oldQualityTestStandardParams = qualityTestStandardParamMapper.selectList(Wrappers.<QualityTestStandardParam>lambdaQuery().eq(QualityTestStandardParam::getTestStandardId, qualityTestStandard.getId()));
        QualityTestStandard testStandard = qualityTestStandardMapper.selectById(qualityTestStandard.getId());
        testStandard.setId(null);
        testStandard.setStandardNo(null);
        qualityTestStandardMapper.insert(testStandard);
        List<QualityTestStandardParam> newQualityTestStandardParams = oldQualityTestStandardParams.stream().map(oldQualityTestStandardParam -> {
            oldQualityTestStandardParam.setTestStandardId(testStandard.getId());
            return oldQualityTestStandardParam;
        }).collect(Collectors.toList());
        qualityTestStandardParamService.saveBatch(newQualityTestStandardParams);
        return 0;
    }
}
src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
@@ -40,7 +40,7 @@
     * @return
     */
    @PostMapping("/saveOrUpdate")
    public AjaxResult receiptPaymentSaveOrUpdate (@RequestBody ReceiptPayment receiptPayment) {
    public AjaxResult receiptPaymentSaveOrUpdate (@RequestBody List<ReceiptPayment> receiptPayment) {
        receiptPaymentService.receiptPaymentSaveOrUpdate(receiptPayment);
        return AjaxResult.success();
    }
src/main/java/com/ruoyi/sales/controller/SalesLedgerProductController.java
@@ -8,6 +8,7 @@
import com.ruoyi.procurementrecord.dto.ProcurementPageDto;
import com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy;
import com.ruoyi.procurementrecord.service.ProcurementRecordService;
import com.ruoyi.sales.dto.SalesLedgerProductDto;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import com.ruoyi.sales.service.ISalesLedgerProductService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -40,6 +41,28 @@
    private ISalesLedgerProductService salesLedgerProductService;
    @Autowired
    private ProcurementRecordService procurementRecordService;
    /**
     * å›žæ¬¾ç™»è®°åˆ†é¡µæŸ¥è¯¢
     */
    @GetMapping("/listPageSalesLedger")
    public AjaxResult listPage(Page page, SalesLedgerProductDto salesLedgerProduct) {
        IPage<SalesLedgerProductDto> list = salesLedgerProductService.listPage(page,salesLedgerProduct);
        return AjaxResult.success(list);
    }
    /**
     * ä»˜æ¬¾ç™»è®°åˆ†é¡µæŸ¥è¯¢
     */
    @GetMapping("/listPagePurchaseLedger")
    public AjaxResult listPagePurchaseLedger(Page page, SalesLedgerProductDto salesLedgerProduct) {
        IPage<SalesLedgerProductDto> list = salesLedgerProductService.listPagePurchaseLedger(page,salesLedgerProduct);
        return AjaxResult.success(list);
    }
    /**
     * æŸ¥è¯¢äº§å“ä¿¡æ¯åˆ—表
     */
@@ -52,10 +75,12 @@
            procurementDto.setSalesLedgerProductId(item.getId());
            procurementDto.setProductCategory(item.getProductCategory());
            IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopyByProduction(new Page<>(1,-1), procurementDto);
            ProcurementPageDtoCopy procurementDtoCopy = result.getRecords().get(0);
            if(item.getQuantity().compareTo(procurementDtoCopy.getInboundNum0())>=0){
                item.setApproveStatus(1);
                salesLedgerProductService.addOrUpdateSalesLedgerProduct(item);
            if(result.getRecords().size()>0) {
                ProcurementPageDtoCopy procurementDtoCopy = result.getRecords().get(0);
                if (item.getQuantity().compareTo(procurementDtoCopy.getInboundNum0()) >= 0) {
                    item.setApproveStatus(1);
                    salesLedgerProductService.addOrUpdateSalesLedgerProduct(item);
                }
            }
        });
        return AjaxResult.success(list);
src/main/java/com/ruoyi/sales/dto/ReceiptPaymentDto.java
@@ -44,7 +44,7 @@
    @ApiModelProperty(value = "销售台账sales_ledger")
    @Excel(isExport = false)
    private Integer salesLedgerId;
    private Long salesLedgerId;
    @ApiModelProperty(value = "销售合同号")
    @Excel(name = "销售合同号")
src/main/java/com/ruoyi/sales/dto/SalesLedgerProductDto.java
@@ -1,4 +1,47 @@
package com.ruoyi.sales.dto;
public class SalesLedgerProductDto {
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import lombok.Data;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import java.math.BigDecimal;
import java.time.LocalDate;
@Data
public class SalesLedgerProductDto extends SalesLedgerProduct {
    /**
     * é‡‡è´­åˆåŒå·
     */
    @Excel(name = "采购合同号")
    private String purchaseContractNumber;
    /**
     * é”€å”®åˆåŒå·
     */
    private String salesContractNo;
    /**
     * å®¢æˆ·åˆåŒå·
     */
    private String customerContractNo;
    /**
     * é¡¹ç›®åç§°
     */
    private String projectName;
    /**
     * å®¢æˆ·åç§°
     */
    private String customerName;
    /**
     * çŠ¶æ€
     */
    private String statusName;
    /**
     * true:不显示待付款,回款为0的数据
     */
    private Boolean status;
}
src/main/java/com/ruoyi/sales/mapper/SalesLedgerProductMapper.java
@@ -1,6 +1,9 @@
package com.ruoyi.sales.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.config.MyBaseMapper;
import com.ruoyi.sales.dto.SalesLedgerProductDto;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import org.apache.ibatis.annotations.Param;
@@ -17,4 +20,7 @@
    SalesLedgerProduct selectSalesLedgerProductByMainId(@Param("productMainId") Long productMainId);
    IPage<SalesLedgerProductDto> listPage(Page page, @Param("req") SalesLedgerProductDto salesLedgerProduct);
    IPage<SalesLedgerProductDto> listPagePurchaseLedger(Page page,@Param("req") SalesLedgerProductDto salesLedgerProduct);
}
src/main/java/com/ruoyi/sales/pojo/ReceiptPayment.java
@@ -12,6 +12,7 @@
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class ReceiptPayment {
@@ -34,6 +35,12 @@
    @ApiModelProperty(value = "invoice_ledger开票台账主键ID")
    private Integer invoiceLedgerId;
    @ApiModelProperty(value = "sales_ledger销售台账主键ID")
    private Long salesLedgerId;
    @ApiModelProperty(value = "sales_ledger_product销售台账产品主键ID")
    private Long salesLedgerProductId;
    @ApiModelProperty(value = "来款日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
src/main/java/com/ruoyi/sales/pojo/SalesLedgerProduct.java
@@ -209,4 +209,16 @@
//    @TableField(exist = false)
    @ApiModelProperty(value = "审批状态:0未生产,1已生产,2待审核(审核中),3审核完成,4审核失败")
    private Integer approveStatus;
    @ApiModelProperty(value = "待回款总金额")
    private BigDecimal pendingInvoiceTotal;
    @ApiModelProperty(value = "回款总金额")
    private BigDecimal invoiceTotal;
    @ApiModelProperty(value = "待付款总金额")
    private BigDecimal pendingTicketsTotal;
    @ApiModelProperty(value = "付款总金额")
    private BigDecimal ticketsTotal;
}
src/main/java/com/ruoyi/sales/service/ISalesLedgerProductService.java
@@ -1,6 +1,9 @@
package com.ruoyi.sales.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.sales.dto.SalesLedgerProductDto;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import java.util.List;
@@ -20,4 +23,8 @@
    int deleteSalesLedgerProductByIds(Long[] ids);
    int addOrUpdateSalesLedgerProduct(SalesLedgerProduct salesLedgerProduct);
    IPage<SalesLedgerProductDto> listPage(Page page, SalesLedgerProductDto salesLedgerProduct);
    IPage<SalesLedgerProductDto> listPagePurchaseLedger(Page page, SalesLedgerProductDto salesLedgerProduct);
}
src/main/java/com/ruoyi/sales/service/ReceiptPaymentService.java
@@ -19,7 +19,7 @@
     * @param receiptPayment
     * @return
     */
    int receiptPaymentSaveOrUpdate(ReceiptPayment receiptPayment);
    int receiptPaymentSaveOrUpdate(List<ReceiptPayment> receiptPayment);
    /**
     * å›žæ¬¾ç™»è®°ä¿®æ”¹
src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
@@ -13,12 +13,15 @@
import com.ruoyi.sales.mapper.InvoiceLedgerMapper;
import com.ruoyi.sales.mapper.ReceiptPaymentMapper;
import com.ruoyi.sales.mapper.SalesLedgerMapper;
import com.ruoyi.sales.mapper.SalesLedgerProductMapper;
import com.ruoyi.sales.pojo.InvoiceLedger;
import com.ruoyi.sales.pojo.ReceiptPayment;
import com.ruoyi.sales.pojo.SalesLedger;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import com.ruoyi.sales.service.ReceiptPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
@@ -37,39 +40,47 @@
    @Autowired
    private SalesLedgerMapper salesLedgerMapper;
    @Autowired
    private SalesLedgerProductMapper salesLedgerProductMapper;
    @Autowired
    private InvoiceLedgerMapper invoiceLedgerMapper;
    /**
     * å›žæ¬¾ç™»è®°æ–°å¢ž
     * @param receiptPayment
     * @param receiptPaymentList
     * @return
     */
    @Override
    public int receiptPaymentSaveOrUpdate(ReceiptPayment receiptPayment) {
        ReceiptPayment byId = receiptPayment;
        if (!ObjectUtils.isEmpty(receiptPayment.getId())){
             byId = this.getById(receiptPayment.getId());
    @Transactional(rollbackFor = Exception.class)
    public int receiptPaymentSaveOrUpdate(List<ReceiptPayment> receiptPaymentList) {
        for (ReceiptPayment receiptPayment : receiptPaymentList) {
            ReceiptPayment byId = receiptPayment;
            if (!ObjectUtils.isEmpty(receiptPayment.getId())){
                receiptPayment = this.getById(receiptPayment.getId());
            }
//        InvoiceLedger invoiceLedger = invoiceLedgerMapper.selectById(byId.getInvoiceLedgerId());
            SalesLedger salesLedger = salesLedgerMapper.selectById(receiptPayment.getSalesLedgerId());
            if(null==salesLedger) throw new RuntimeException("未找到销售单");
            // å·²å›žæ¬¾é‡‘额
            SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(receiptPayment.getSalesLedgerProductId());
            if(null==salesLedgerProduct) throw new RuntimeException("未找到销售单产品");
            if (salesLedgerProduct.getPendingInvoiceTotal().compareTo(receiptPayment.getReceiptPaymentAmount())<0){
                throw new RuntimeException("本次回款金额不能大于待回款金额");
            }
            if(null==receiptPayment.getId()){
                salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getInvoiceTotal().add(receiptPayment.getReceiptPaymentAmount()));
                salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getInvoiceTotal()));
                receiptPaymentMapper.insert(receiptPayment);
            }else {
                BigDecimal subtract = receiptPayment.getReceiptPaymentAmount().subtract(byId.getReceiptPaymentAmount());
                salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getInvoiceTotal().add(subtract));
                salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getInvoiceTotal()));
                receiptPaymentMapper.updateById(receiptPayment);
            }
            salesLedgerProductMapper.updateById(salesLedgerProduct);
        }
        InvoiceLedger invoiceLedger = invoiceLedgerMapper.selectById(byId.getInvoiceLedgerId());
        Page<ReceiptPaymentDto> objectPage = new Page<>();
        ReceiptPaymentDto receiptPaymentDto = new ReceiptPaymentDto();
        receiptPaymentDto.setInvoiceLedgerId(invoiceLedger.getId());
        IPage<ReceiptPaymentDto> receiptPaymentDtoIPage = receiptPaymentMapper.bindInvoiceNoRegPage(objectPage, receiptPaymentDto);
        ReceiptPaymentDto receiptPaymentDto1 = receiptPaymentDtoIPage.getRecords().get(0);
        if (!ObjectUtils.isEmpty(byId.getId())){
            receiptPaymentDto1.setNoReceiptAmount(receiptPaymentDto1.getNoReceiptAmount().add(byId.getReceiptPaymentAmount()));
        }
        if (receiptPaymentDto1.getNoReceiptAmount().compareTo(receiptPayment.getReceiptPaymentAmount())<0){
            throw new RuntimeException("本次回款金额不能大于待回款金额");
        }
        if(null==receiptPayment.getId()){
            return receiptPaymentMapper.insert(receiptPayment);
        }else {
            return receiptPaymentMapper.updateById(receiptPayment);
        }
        return 1;
    }
    /**
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -3,12 +3,16 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.production.mapper.*;
import com.ruoyi.production.pojo.*;
import com.ruoyi.purchase.mapper.PurchaseLedgerMapper;
import com.ruoyi.purchase.pojo.PurchaseLedger;
import com.ruoyi.sales.dto.InvoiceRegistrationProductDto;
import com.ruoyi.sales.dto.SalesLedgerProductDto;
import com.ruoyi.sales.mapper.InvoiceRegistrationProductMapper;
import com.ruoyi.sales.mapper.SalesLedgerMapper;
import com.ruoyi.sales.mapper.SalesLedgerProductMapper;
@@ -270,6 +274,34 @@
        return result;
    }
    @Override
    public IPage<SalesLedgerProductDto> listPage(Page page, SalesLedgerProductDto salesLedgerProduct) {
        IPage<SalesLedgerProductDto> salesLedgerProductDtoIPage = salesLedgerProductMapper.listPage(page, salesLedgerProduct);
        salesLedgerProductDtoIPage.getRecords().forEach(item -> {
            // åˆ¤æ–­çŠ¶æ€
            if(item.getTaxInclusiveTotalPrice().compareTo(item.getInvoiceTotal()) == 0){
                item.setStatusName("已完成付款");
            }else{
                item.setStatusName("未完成付款");
            }
        });
        return salesLedgerProductDtoIPage;
    }
    @Override
    public IPage<SalesLedgerProductDto> listPagePurchaseLedger(Page page, SalesLedgerProductDto salesLedgerProduct) {
        IPage<SalesLedgerProductDto> salesLedgerProductDtoIPage = salesLedgerProductMapper.listPagePurchaseLedger(page, salesLedgerProduct);
        salesLedgerProductDtoIPage.getRecords().forEach(item -> {
            // åˆ¤æ–­çŠ¶æ€
            if(item.getTaxInclusiveTotalPrice().compareTo(item.getInvoiceTotal()) == 0){
                item.setStatusName("已完成付款");
            }else{
                item.setStatusName("未完成付款");
            }
        });
        return salesLedgerProductDtoIPage;
    }
    /**
     * é€šç”¨æ–¹æ³•:根据主表ID和子表列表,更新主表的合同金额
     */
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -680,6 +680,7 @@
                salesLedgerProduct.setType(type);
                salesLedgerProduct.setNoInvoiceNum(salesLedgerProduct.getQuantity());
                salesLedgerProduct.setNoInvoiceAmount(salesLedgerProduct.getTaxInclusiveTotalPrice());
                salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice());
                salesLedgerProductMapper.insert(salesLedgerProduct);
                ProductOrder productOrder = new ProductOrder();
src/main/resources/application-dev.yml
@@ -63,7 +63,7 @@
    druid:
      # ä¸»åº“数据源
      master:
        url: jdbc:mysql://localhost:3306/product-inventory-management-hckx?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        url: jdbc:mysql://localhost:3306/product-inventory-management-new?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        username: root
        password: 123456
      # ä»Žåº“数据源
src/main/resources/mapper/collaborativeApproval/NoticeMapper.xml
@@ -11,11 +11,11 @@
                and n.title like concat('%',#{ew.title},'%')
            </if>
            <if test="ew.type != null">
                and n.type = #{ew.type}
                and n.type  = #{ew.type}
            </if>
            <if test="ew.status != null">
                and n.status = #{ew.status}
            </if>
        </where>
    </select>
</mapper>
</mapper>
src/main/resources/mapper/collaborativeApproval/NoticeTypeMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.collaborativeApproval.mapper.NoticeTypeMapper">
    <!-- é€šç”¨æŸ¥è¯¢æ˜ å°„结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.collaborativeApproval.pojo.NoticeType">
        <id column="id" property="id" />
        <result column="notice_type" property="noticeType" />
        <result column="tenant_id" property="tenantId" />
    </resultMap>
</mapper>
src/main/resources/mapper/collaborativeApproval/RulesRegulationsManagementFileMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.collaborativeApproval.mapper.RulesRegulationsManagementFileMapper">
    <!-- é€šç”¨æŸ¥è¯¢æ˜ å°„结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagementFile">
        <id column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="url" property="url"/>
        <result column="file_size" property="fileSize"/>
        <result column="rules_regulations_management_id" property="rulesRegulationsManagementId"/>
        <result column="create_time" property="createTime"/>
        <result column="create_user" property="createUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="tenant_id" property="tenantId"/>
    </resultMap>
    <select id="listPage" resultType="com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagementFile">
        select *
        from rules_regulations_management_file
        where
        1=1
        <if test="c.rulesRegulationsManagementId !=null">
            and rules_regulations_management_id = #{c.rulesRegulationsManagementId}
        </if>
    </select>
</mapper>
src/main/resources/mapper/collaborativeApproval/SealApplicationManagementMapper.xml
@@ -4,12 +4,17 @@
    <select id="listPage" resultType="com.ruoyi.collaborativeApproval.dto.SealApplicationManagementDTO">
        select sam.*, su.user_name as create_user_name, d.dept_name as department
        select sam.*, su.user_name as create_user_name, d.dept_name as department,
        su1.nick_name as approveUserName
        from seal_application_management sam
        left join sys_user su on sam.create_user = su.user_id
        left join sys_user su1 on sam.approve_user_id = su1.user_id
        left join sys_user_dept sud on su.user_id = sud.user_id
        left join sys_dept d on sud.dept_id = d.dept_id
        <where>
            <if test="ew.applicationNum != null and ew.applicationNum != ''">
                and sam.application_num like concat('%',#{ew.applicationNum},'%')
            </if>
            <if test="ew.title != null and ew.title != ''">
                and sam.title like concat('%',#{ew.title},'%')
            </if>
@@ -18,4 +23,4 @@
            </if>
        </where>
    </select>
</mapper>
</mapper>
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
@@ -336,4 +336,21 @@
        group by t2.product_category,t2.specification_model,t1.unit_price
        order by t1.create_time desc
    </select>
    <select id="listPagePRS" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy">
        select *
        from  procurement_record_storage t1
        left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id
          <where>
              1=1
              <if test="req.productCategory != null and req.productCategory != ''">
                  and t2.product_category like  concat('%',#{req.productCategory},'%')
              </if>
              <if test="req.timeStr != null and req.timeStr != ''">
                  and t1.create_time like  concat('%',#{req.timeStr},'%')
              </if>
              <if test="req.salesLedgerProductId != null and req.salesLedgerProductId != ''">
                  and t1.sales_ledger_product_id = #{req.salesLedgerProductId}
              </if>
          </where>
    </select>
</mapper>
src/main/resources/mapper/quality/QualityTestStandardBindingMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.quality.mapper.QualityTestStandardBindingMapper">
    <!-- é€šç”¨æŸ¥è¯¢æ˜ å°„结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.quality.pojo.QualityTestStandardBinding">
        <id column="id" property="id"/>
        <result column="product_id" property="productId"/>
        <result column="test_standard_id" property="testStandardId"/>
        <result column="create_time" property="createTime"/>
        <result column="create_user" property="createUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="tenant_id" property="tenantId"/>
    </resultMap>
    <select id="listBinding" resultType="com.ruoyi.quality.dto.QualityTestStandardBindingDto">
        select *
        from quality_test_standard_binding t1
                 left join product t2 on t1.product_id = t2.id
        where t1.test_standard_id = #{testStandardId}
    </select>
</mapper>
src/main/resources/mapper/quality/QualityTestStandardMapper.xml
@@ -7,18 +7,17 @@
        FROM quality_test_standard
        where
        1=1
        <if test="qualityTestStandard.productId != null and qualityTestStandard.productId != '' ">
            AND product_id = #{qualityTestStandard.productId}
        <if test="qualityTestStandard.standardNo != null and qualityTestStandard.standardNo != '' ">
            AND standard_no like concat('%',#{qualityTestStandard.standardNo},'%')
        </if>
    </select>
    <select id="qualityTestStandardList" resultType="com.ruoyi.quality.pojo.QualityTestStandard">
        SELECT
        *
        FROM quality_test_standard
        where
        1=1
        <if test="qualityTestStandard.productId != null and qualityTestStandard.productId != '' ">
            AND product_id = #{qualityTestStandard.productId}
        <if test="qualityTestStandard.standardName != null and qualityTestStandard.standardName != '' ">
            AND standard_name like concat('%',#{qualityTestStandard.standardName},'%')
        </if>
        <if test="qualityTestStandard.state != null and qualityTestStandard.state != '' ">
            AND state = #{qualityTestStandard.state}
        </if>
        <if test="qualityTestStandard.inspectType != null and qualityTestStandard.inspectType != '' ">
            AND inspect_type = #{qualityTestStandard.inspectType}
        </if>
    </select>
</mapper>
src/main/resources/mapper/quality/QualityTestStandardParamMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.quality.mapper.QualityTestStandardParamMapper">
    <!-- é€šç”¨æŸ¥è¯¢æ˜ å°„结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.quality.pojo.QualityTestStandardParam">
        <id column="id" property="id" />
        <result column="parameter_item" property="parameterItem" />
        <result column="unit" property="unit" />
        <result column="standard_value" property="standardValue" />
        <result column="control_value" property="controlValue" />
        <result column="create_time" property="createTime" />
        <result column="create_user" property="createUser" />
        <result column="update_time" property="updateTime" />
        <result column="update_user" property="updateUser" />
        <result column="tenant_id" property="tenantId" />
        <result column="test_standard_id" property="testStandardId" />
        <result column="default_value" property="defaultValue" />
    </resultMap>
    <select id="selectListByProductId" resultType="com.ruoyi.quality.pojo.QualityTestStandardParam">
        select t1.* from quality_test_standard_param t1
        left join quality_test_standard t2 on t1.test_standard_id = t2.id
        left join quality_test_standard_binding t3 on t2.id = t3.test_standard_id
        where product_id = #{productId}
    </select>
</mapper>
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -33,4 +33,66 @@
    </select>
    <select id="listPage" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto">
        select slp.*,
        sl.project_name,
        sl.customer_name,
        sl.sales_contract_no,
        sl.customer_contract_no
        from sales_ledger_product slp
        left join sales_ledger sl on slp.sales_ledger_id = sl.id
        <where>
            slp.type = 1
            <if test="req.salesContractNo != null and req.salesContractNo != '' ">
                AND  sl.sales_contract_no like concat('%',#{req.salesContractNo},'%')
            </if>
            <if test="req.customerContractNo != null and req.customerContractNo != '' ">
                AND  sl.customer_contract_no like concat('%',#{req.customerContractNo},'%')
            </if>
            <if test="req.projectName != null and req.projectName != '' ">
                AND  sl.project_name like concat('%',#{req.projectName},'%')
            </if>
            <if test="req.customerName != null and req.customerName != '' ">
                AND  sl.customer_name like concat('%',#{req.customerName},'%')
            </if>
            <if test="req.productCategory != null and req.productCategory != '' ">
                AND  slp.product_category like concat('%',#{req.productCategory},'%')
            </if>
            <if test="req.status != null and req.status ">
                AND  slp.pending_invoice_total &gt; 0
            </if>
        </where>
        order by slp.register_date desc
    </select>
    <select id="listPagePurchaseLedger" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto">
        select slp.*,
        sl.project_name,
        sl.customer_name,
        sl.sales_contract_no,
        sl.customer_contract_no
        from sales_ledger_product slp
        left join purchase_ledger sl on slp.sales_ledger_id = sl.id
        <where>
            slp.type = 2
            <if test="req.purchaseContractNumber != null and req.purchaseContractNumber != '' ">
                AND  sl.purchase_contract_number like concat('%',#{req.purchaseContractNumber},'%')
            </if>
            <if test="req.customerContractNo != null and req.customerContractNo != '' ">
                AND  sl.customer_contract_no like concat('%',#{req.customerContractNo},'%')
            </if>
            <if test="req.projectName != null and req.projectName != '' ">
                AND  sl.project_name like concat('%',#{req.projectName},'%')
            </if>
            <if test="req.customerName != null and req.customerName != '' ">
                AND  sl.customer_name like concat('%',#{req.customerName},'%')
            </if>
            <if test="req.productCategory != null and req.productCategory != '' ">
                AND  slp.product_category like concat('%',#{req.productCategory},'%')
            </if>
            <if test="req.status != null and req.status ">
                AND  slp.pending_invoice_total &gt; 0
            </if>
        </where>
        order by slp.register_date desc
    </select>
</mapper>
src/main/resources/mapper/system/SysUserMapper.xml
@@ -158,7 +158,7 @@
             #{item}
        </foreach>
    </select>
    <select id="selectList" resultType="com.ruoyi.project.system.domain.SysUser">
    <select id="selectRegistrantIds" resultType="com.ruoyi.project.system.domain.SysUser">
        SELECT user_id, nick_name FROM sys_user
        <where>
            <if test="list != null and list.size() > 0">