heheng
5 天以前 7cddd48bab10c8fc2480957b9bb42cd7061ac966
multi-system/src/main/java/com/gkhy/exam/system/service/impl/StandardizedTemplateServiceImpl.java
@@ -6,22 +6,25 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.common.domain.TreeSelect;
import com.gkhy.exam.common.domain.entity.SysDept;
import com.gkhy.exam.common.domain.model.LoginUserDetails;
import com.gkhy.exam.common.exception.ApiException;
import com.gkhy.exam.common.utils.PageUtils;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.system.domain.*;
import com.gkhy.exam.system.mapper.CompanyIndustryTemplateMapper;
import com.gkhy.exam.system.mapper.StandardizedQualityMapper;
import com.gkhy.exam.system.mapper.StandardizedTemplateMapper;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class StandardizedTemplateServiceImpl extends ServiceImpl<StandardizedTemplateMapper, StandardizedTemplate> implements StandardizedTemplateService {
@@ -34,8 +37,16 @@
    @Autowired
    private StandardizedQualityMapper standardizedQualityMapper;
    @Autowired
    private SysFunctionalDistributionMapper sysFunctionalDistributionMapper;
    @Autowired
    private ISysDeptService iSysDeptService;
    @Autowired
    private CompanySummaryMapper companySummaryMapper;
    @Autowired
    private CompanyQualityPolicyMapper companyQualityPolicyMapper;
    @Override
    public CommonPage selectStandardizedTemplateList(Integer companyId, Integer templateType) {
        boolean admin = SecurityUtils.adminUser();
@@ -149,4 +160,34 @@
        standardizedQualityMapper.update(standardizedQuality, lambdaQueryWrapper);
        return CommonResult.success();
    }
    @Override
    public CommonResult getStandardizedQualityByCompanyId(Integer companyId) {
        Map<String, Object> map = new HashMap<>();
        //程序文件
        List<StandardizedTemplate> companyIndustryTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(companyId, 4);
        //职能分配
        List<SysFunctionalDistribution> sysFunctionalDistributions = sysFunctionalDistributionMapper.selectListVo(companyId.longValue());
        //部门
        SysDept sysDept = new SysDept();
        sysDept.setCompanyId(companyId.longValue());
        List<TreeSelect> treeSelects = iSysDeptService.selectDeptTreeList(sysDept);
        //公司概况
        List<CompanySummary> companySummaries = companySummaryMapper.selectCompanySummaryList(companyId);
        //质量方针
        List<CompanyQualityPolicy> companyQualityPolicies = companyQualityPolicyMapper.selectCompanyQualityPolicyList(companyId);
        //质量方针
        map.put("companyQualityPolicies", companyQualityPolicies);
        //公司概况
        map.put("companySummaries", companySummaries);
        //部门
        map.put("treeSelects", treeSelects);
        //职能分配
        map.put("sysFunctionalDistributions", sysFunctionalDistributions);
        //程序文件
        map.put("companyIndustryTemplates", companyIndustryTemplates);
        return CommonResult.success(map);
    }
}