heheng
2025-11-28 03a3edee9ff27fa9bb4b32dcda08e279c7c094c8
功能修改
已修改6个文件
78 ■■■■ 文件已修改
multi-admin/src/main/java/com/gkhy/exam/admin/controller/web/TemplateController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/domain/StandardizedTemplate.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/mapper/StandardizedTemplateMapper.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/StandardizedTemplateService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/StandardizedTemplateServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-admin/src/main/java/com/gkhy/exam/admin/controller/web/TemplateController.java
@@ -27,7 +27,6 @@
    /**
     * 行业模版
     * @param companyId
     * @return
     */
    @ApiOperation(value = "标准化模版(分页)")
@@ -35,11 +34,13 @@
            @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司iD"),
            @ApiImplicitParam(paramType = "query", name = "templateType", dataType = "int", required = true, value = "类型1体系标准2技术标准3应用标准4程序文件5作业指导书6记录及表单7技术类8生产类9其他知识产权"),
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = true, value = "页码"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = true, value = "每页数量")
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = true, value = "每页数量"),
            @ApiImplicitParam(paramType = "query", name = "sort", dataType = "int", required = true, value = "排序类型1正序2倒序"),
            @ApiImplicitParam(paramType = "query", name = "templateName", dataType = "string", required = false, value = "模板名称")
    })
    @GetMapping("/standardizedTemplate/list")
    public CommonResult selectStandardizedTemplateList(Integer companyId, @RequestParam("templateType") Integer templateType){
        return CommonResult.success(standardizedTemplateService.selectStandardizedTemplateList(companyId, templateType));
    public CommonResult selectStandardizedTemplateList(StandardizedTemplate standardizedTemplate){
        return CommonResult.success(standardizedTemplateService.selectStandardizedTemplateList(standardizedTemplate));
    }
    /**
multi-system/src/main/java/com/gkhy/exam/system/domain/StandardizedTemplate.java
@@ -93,5 +93,8 @@
    @TableField("update_time")
    private LocalDateTime updateTime;
    @ApiModelProperty("排序1正序2倒序")
    @TableField(exist = false)
    private Integer sort;
}
multi-system/src/main/java/com/gkhy/exam/system/mapper/StandardizedTemplateMapper.java
@@ -3,15 +3,22 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.exam.system.domain.CompanyIndustryTemplate;
import com.gkhy.exam.system.domain.StandardizedTemplate;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper
public interface StandardizedTemplateMapper extends BaseMapper<StandardizedTemplate> {
    List<StandardizedTemplate> selectStandardizedTemplateList(Integer companyId, Integer templateType);
//    List<StandardizedTemplate> selectStandardizedTemplateList(@Param("companyId") Integer companyId, @Param("templateType") Integer templateType ,@Param("sort") Integer sort);
//
//    List<StandardizedTemplate> selectStandardizedTemplateListV2(@Param("companyId")Integer companyId, @Param("templateType")Integer templateType,
//                                                                @Param("industryTypeId")Integer industryTypeId,@Param("sort") Integer sort);
    List<StandardizedTemplate> selectStandardizedTemplateListV2(Integer companyId, Integer templateType, Integer industryTypeId);
    List<StandardizedTemplate> selectStandardizedTemplateList(StandardizedTemplate  template);
    List<StandardizedTemplate> selectStandardizedTemplateListV2(StandardizedTemplate  template);
    int updateStandardizedTemplateById(StandardizedTemplate template);
}
multi-system/src/main/java/com/gkhy/exam/system/service/StandardizedTemplateService.java
@@ -8,7 +8,7 @@
import com.gkhy.exam.system.domain.StandardizedTemplate;
public interface StandardizedTemplateService extends IService<StandardizedTemplate> {
    CommonPage selectStandardizedTemplateList(Integer companyId,Integer templateType);
    CommonPage selectStandardizedTemplateList(StandardizedTemplate standardizedTemplate);
    CommonResult insertStandardizedTemplate(StandardizedTemplate standardizedTemplate);
multi-system/src/main/java/com/gkhy/exam/system/service/impl/StandardizedTemplateServiceImpl.java
@@ -49,8 +49,10 @@
    @Autowired
    private CustomerService customerService;
    @Override
    public CommonPage selectStandardizedTemplateList(Integer companyId, Integer templateType) {
    public CommonPage selectStandardizedTemplateList(StandardizedTemplate standardizedTemplate) {
        boolean admin = SecurityUtils.adminUser();
        Integer companyId = standardizedTemplate.getCompanyId();
        Integer templateType = standardizedTemplate.getTemplateType();
        if (!admin){
            if (companyId==null){
                companyId = SecurityUtils.getCompanyId().intValue();
@@ -58,10 +60,11 @@
        }
        PageUtils.startPage();
        List<StandardizedTemplate> standardizedTemplates =new ArrayList<>();
        if (templateType==2 || templateType==10 || templateType == 3){
            standardizedTemplates = standardizedTemplateMapper.selectStandardizedTemplateListV2(companyId, templateType, null);
        //templateType==2 || templateType==10 ||
        if ( templateType == 3){
            standardizedTemplates = standardizedTemplateMapper.selectStandardizedTemplateListV2(standardizedTemplate);
        }else {
            standardizedTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(companyId, templateType);
            standardizedTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(standardizedTemplate);
        }
        return CommonPage.restPage(standardizedTemplates);
@@ -183,7 +186,11 @@
    public CommonResult getStandardizedQualityByCompanyId(Integer companyId) {
        Map<String, Object> map = new HashMap<>();
        //程序文件
        List<StandardizedTemplate> companyIndustryTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(companyId, 4);
        StandardizedTemplate programFile = new StandardizedTemplate();
        programFile.setTemplateType(4);
        programFile.setCompanyId(companyId);
        programFile.setSort(1);
        List<StandardizedTemplate> companyIndustryTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(programFile);
        //职能分配
        List<SysFunctionalDistribution> sysFunctionalDistributions = sysFunctionalDistributionMapper.selectListVo(companyId.longValue());
        //部门
multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
@@ -56,7 +56,7 @@
        where id = #{id}
    </update>
    <select id="selectStandardizedTemplateList" resultType="com.gkhy.exam.system.domain.StandardizedTemplate">
    <select id="selectStandardizedTemplateList" resultType="com.gkhy.exam.system.domain.StandardizedTemplate" parameterType="com.gkhy.exam.system.domain.StandardizedTemplate">
        SELECT
            st.`id`,
            st.`company_id`,
@@ -83,12 +83,27 @@
        <if test="companyId!=null and companyId!=''">
            and st.company_id = #{companyId}
        </if>
        <if test="templateName!=null and templateName!=''">
            and st.template_name like concat('%',#{templateName},'%')
        </if>
        <if test="sort!=null and sort==1">
        ORDER BY
            st.create_time DESC
            st.template_name asc
        </if>
        <if test="sort!=null and sort==2">
            ORDER BY
            st.template_name desc
        </if>
        <if test="sort ==null or sort== '' or sort == 0">
            ORDER BY
            st.create_time desc
        </if>
    </select>
    <select id="selectStandardizedTemplateListV2" resultType="com.gkhy.exam.system.domain.StandardizedTemplate">
    <select id="selectStandardizedTemplateListV2" resultType="com.gkhy.exam.system.domain.StandardizedTemplate" parameterType="com.gkhy.exam.system.domain.StandardizedTemplate">
        SELECT
        st.`id`,
        st.`company_id`,
@@ -122,8 +137,21 @@
        <if test="industryTypeId!=null ">
            and st.industry_type_id = #{industryTypeId}
        </if>
        <if test="templateName!=null and templateName!=''">
            and st.template_name like concat('%',#{templateName},'%')
        </if>
        <if test="sort!=null and sort==1">
        ORDER BY
        st.create_time DESC
            st.template_name asc
        </if>
        <if test="sort!=null and sort==2">
            ORDER BY
            st.template_name desc
        </if>
        <if test="sort ==null or sort== '' or sort == 0">
            ORDER BY
            st.create_time desc
        </if>
    </select>
</mapper>