heheng
2025-11-28 03a3edee9ff27fa9bb4b32dcda08e279c7c094c8
multi-system/src/main/java/com/gkhy/exam/system/service/impl/StandardizedTemplateServiceImpl.java
@@ -14,14 +14,12 @@
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.system.domain.*;
import com.gkhy.exam.system.mapper.*;
import com.gkhy.exam.system.service.CompanyIndustryTemplateService;
import com.gkhy.exam.system.service.ISysDeptService;
import com.gkhy.exam.system.service.StandardizedTemplateService;
import com.gkhy.exam.system.service.SysCompanyService;
import com.gkhy.exam.system.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -47,17 +45,29 @@
    private CompanySummaryMapper companySummaryMapper;
    @Autowired
    private CompanyQualityPolicyMapper companyQualityPolicyMapper;
    @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();
            }
        }
        PageUtils.startPage();
        List<StandardizedTemplate> companyIndustryTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(companyId, templateType);
        return CommonPage.restPage(companyIndustryTemplates);
        List<StandardizedTemplate> standardizedTemplates =new ArrayList<>();
        //templateType==2 || templateType==10 ||
        if ( templateType == 3){
            standardizedTemplates = standardizedTemplateMapper.selectStandardizedTemplateListV2(standardizedTemplate);
        }else {
            standardizedTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(standardizedTemplate);
        }
        return CommonPage.restPage(standardizedTemplates);
    }
    @Override
@@ -69,6 +79,15 @@
        standardizedTemplate.setCreateBy(loginUser.getUsername());
        standardizedTemplate.setCreateTime(LocalDateTime.now());
        int insert = standardizedTemplateMapper.insert(standardizedTemplate);
        if (standardizedTemplate.getTemplateType().equals(4)&&standardizedTemplate.getTemplateName().contains("满意度")){
            Customer customer = new Customer();
            customer.setCompanyId(standardizedTemplate.getCompanyId());
            customer.setFileName(standardizedTemplate.getTemplateName());
            customer.setFilePath(standardizedTemplate.getFilePath());
            customerService.insertCustomer(customer);
        }
        if (insert>0){
            return CommonResult.success();
        }
@@ -167,12 +186,17 @@
    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());
        //部门
        SysDept sysDept = new SysDept();
        sysDept.setCompanyId(companyId.longValue());
        sysDept.setResponsType("1");
        List<TreeSelect> treeSelects = iSysDeptService.selectDeptTreeList(sysDept);
        //公司概况