076baf821f6ff0296826ecebac31b45ecce346a3..f8143fe8addccd8ef25613c3fbea4cd2b2ad3ab8
8 天以前 “djh”
修改
f8143f 对比 | 目录
8 天以前 heheng
部分功能调整
dfdc3c 对比 | 目录
8 天以前 “djh”
修改
9f3e19 对比 | 目录
8 天以前 heheng
部分功能调整
e81044 对比 | 目录
8 天以前 “djh”
修改
f84f28 对比 | 目录
8 天以前 heheng
部分功能调整
bd605a 对比 | 目录
8 天以前 heheng
部分功能调整
9a6468 对比 | 目录
已修改28个文件
已添加5个文件
704 ■■■■ 文件已修改
multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysRoleController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-admin/src/main/java/com/gkhy/exam/admin/controller/web/CompanyBasicController.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-common/src/main/java/com/gkhy/exam/common/utils/SecurityUtils.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-framework/src/main/java/com/gkhy/exam/framework/web/service/SysPermissionService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/domain/CompanyIndustryTemplate.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/domain/CompanyRoster.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/mapper/CompanyIndustryTemplateMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/mapper/QualityDecomposeMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/CompanyIndustryTemplateService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanyBasicServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanyCertificateServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanyIndustryTemplateServiceImpl.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanyQualityPolicyServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanyRosterServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanySummaryServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/InformationPlatformServiceImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/QualityAccomplishServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/QualityDecomposeServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/QualityServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysClauseManagementServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysDeptServiceImpl.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysMenuServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysRoleServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysUserServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/CompanyBasicMapper.xml 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/CompanyCertificateMapper.xml 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/CompanyIndustryTemplateMapper.xml 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/CompanyQualityPolicyMapper.xml 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/CompanyRosterMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/CompanySummaryMapper.xml 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/QualityAccomplishMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/QualityDecomposeMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/QualityMapper.xml 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysRoleController.java
@@ -129,7 +129,7 @@
            // 更新缓存用户权限
            LoginUserDetails loginUser = getLoginUser();
            if (ObjectUtil.isNotNull(loginUser.getUser()) && !SecurityUtils.isAdmin(loginUser.getUser().getId()))
            if (ObjectUtil.isNotNull(loginUser.getUser()) && !SecurityUtils.adminUser())
            {
                loginUser.setUser(userService.selectUserByUsername(loginUser.getUser().getName()));
                loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
multi-admin/src/main/java/com/gkhy/exam/admin/controller/web/CompanyBasicController.java
@@ -8,6 +8,7 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@Api(tags = "企业基础信息管理")
@@ -26,6 +27,9 @@
    @Autowired
    private CompanyRosterService companyRosterService;
    @Autowired
    private CompanyIndustryTemplateService companyIndustryTemplateService;
    /**
@@ -274,6 +278,53 @@
    }
    /**
     * 行业模版
     * @param companyId
     * @return
     */
    @ApiOperation(value = "行业模版(分页)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
    })
    @GetMapping("/industryTemplate/list")
    public CommonResult selectCompanyIndustryTemplateList(Integer companyId){
        return CommonResult.success(companyIndustryTemplateService.selectCompanyIndustryTemplateList(companyId));
    }
    /**
     * 行业模版新增
     * @param companyRoster
     * @return
     */
    @ApiOperation(value = "行业模版新增")
    @PostMapping("/industryTemplate/insert")
    public CommonResult insertCompanyIndustryTemplate(@Validated @RequestBody CompanyIndustryTemplate companyRoster){
        return companyIndustryTemplateService.insertCompanyIndustryTemplate(companyRoster);
    }
    /**
     * 企业花名册修改
     * @param companyIndustryTemplate
     * @return
     */
    @ApiOperation(value = "行业模版修改")
    @PostMapping("/industryTemplate/update")
    public CommonResult updateCompanyIndustryTemplate(@Validated @RequestBody CompanyIndustryTemplate companyIndustryTemplate){
        return companyIndustryTemplateService.updateCompanyIndustryTemplate(companyIndustryTemplate);
    }
    /**
     * 行业模版删除
     * @param industryTemplateId
     * @return
     */
    @ApiOperation(value = "行业模版删除")
    @GetMapping("/industryTemplate/deleted")
    public CommonResult deletedCompanyIndustryTemplate(@RequestParam("companyRosterId") Integer industryTemplateId){
        return companyIndustryTemplateService.deletedCompanyIndustryTemplate(industryTemplateId);
    }
multi-common/src/main/java/com/gkhy/exam/common/utils/SecurityUtils.java
@@ -19,6 +19,19 @@
        return userId != null && 1L == userId;
    }
    public static boolean adminUser(){
        if(getLoginUser() == null){
            return false;
        }
        if(getLoginUser().getUser().getId() == 1L){
            return true;
        }
        if(getLoginUser().getUser().getUserType() == 0){
            return true;
        }
       return false;
    }
    /**
     * 判断密码是否相同
     * @param rawPasword   真实密码
multi-framework/src/main/java/com/gkhy/exam/framework/web/service/SysPermissionService.java
@@ -40,7 +40,7 @@
    {
        Set<String> roles = new HashSet<String>();
        // 管理员拥有所有权限
        if (SecurityUtils.isAdmin(user.getId()))
        if (SecurityUtils.adminUser() )
        {
            roles.add("admin");
        }
@@ -61,7 +61,7 @@
    {
        Set<String> perms = new HashSet<String>();
        // 管理员拥有所有权限
        if (SecurityUtils.isAdmin(user.getId()))
        if (SecurityUtils.adminUser())
        {
            perms.add("*:*:*");
        }
multi-system/src/main/java/com/gkhy/exam/system/domain/CompanyIndustryTemplate.java
对比新文件
@@ -0,0 +1,73 @@
package com.gkhy.exam.system.domain;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
@Getter
@Setter
@TableName("company_industry_template")
@ApiModel(value = "company_industry_template",description = "行业模板")
public class CompanyIndustryTemplate implements Serializable {
    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @NotNull(message = "企业Id不可为空")
    @ApiModelProperty(value = "企业ID")
    @TableField("company_id")
    private Integer companyId;
    @ApiModelProperty(value = "企业名称")
    @TableField("company_name")
    private String companyName;
    @ApiModelProperty(value = "模板名称")
    @TableField("template_name")
    @NotBlank(message = "模板名称不可为空")
    private String templateName;
    @ApiModelProperty(value = "行业类型1化工2安防")
    @TableField("industry_type")
    @NotNull(message = "行业类型不可为空")
    private Integer industryType;
    @ApiModelProperty(value = "文件路径")
    @TableField("file_path")
    @NotBlank(message = "文件路径不可为空")
    private String filePath;
    @ApiModelProperty(value = "文件格式")
    @TableField("format")
    @NotBlank(message = "文件格式不可为空")
    private String format;
    @ApiModelProperty(value = "是否删除")
    @TableField("del_flag")
    private Integer delFlag;
    @TableField("create_by")
    private String createBy;
    @TableField("create_time")
    private LocalDateTime createTime;
    @TableField("update_by")
    private String updateBy;
    @TableField("update_time")
    private LocalDateTime updateTime;
}
multi-system/src/main/java/com/gkhy/exam/system/domain/CompanyRoster.java
@@ -16,7 +16,7 @@
@Getter
@Setter
@TableName("company_roster")
@ApiModel(value = "company_roster",description = "员工花名册")
@ApiModel(value = "company_roster",description = "员工信息")
public class CompanyRoster implements Serializable {
    @ApiModelProperty("主键")
multi-system/src/main/java/com/gkhy/exam/system/mapper/CompanyIndustryTemplateMapper.java
对比新文件
@@ -0,0 +1,15 @@
package com.gkhy.exam.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.exam.system.domain.CompanyIndustryTemplate;
import com.gkhy.exam.system.domain.CompanyRoster;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper
public interface CompanyIndustryTemplateMapper extends BaseMapper<CompanyIndustryTemplate> {
    List<CompanyIndustryTemplate> selectCompanyIndustryTemplateList(Integer companyId);
    int updateCompanyIndustryTemplateById(CompanyIndustryTemplate template);
}
multi-system/src/main/java/com/gkhy/exam/system/mapper/QualityDecomposeMapper.java
@@ -1,6 +1,7 @@
package com.gkhy.exam.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.exam.system.domain.Quality;
import com.gkhy.exam.system.domain.QualityDecompose;
import com.gkhy.exam.system.domain.req.DecomposeTargetReq;
import com.gkhy.exam.system.domain.req.QualityReq;
@@ -17,4 +18,5 @@
    int insertDecompose(DecomposeTargetReq decomposeTargetReq);
    List<Integer> selectByDelFlag();
}
multi-system/src/main/java/com/gkhy/exam/system/service/CompanyIndustryTemplateService.java
对比新文件
@@ -0,0 +1,17 @@
package com.gkhy.exam.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.system.domain.CompanyIndustryTemplate;
import com.gkhy.exam.system.domain.CompanyRoster;
public interface CompanyIndustryTemplateService extends IService<CompanyIndustryTemplate> {
    CommonPage selectCompanyIndustryTemplateList(Integer companyId);
    CommonResult insertCompanyIndustryTemplate(CompanyIndustryTemplate companyIndustryTemplate);
    CommonResult updateCompanyIndustryTemplate(CompanyIndustryTemplate companyIndustryTemplate);
    CommonResult deletedCompanyIndustryTemplate(Integer companyIndustryTemplateId);
}
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanyBasicServiceImpl.java
@@ -31,8 +31,7 @@
    @Override
    public CommonPage selectCompanyBasicList(Integer companyId) {
        boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
        if (!admin){
        if (!SecurityUtils.adminUser()){
            if (companyId==null){
                throw new ApiException("非管理员操作,查询条件不可为空");
            }
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanyCertificateServiceImpl.java
@@ -28,8 +28,7 @@
    @Override
    public CommonPage selectCompanyCertificateList(Integer companyId) {
        boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
        if (!admin){
        if (!SecurityUtils.adminUser()){
            if (companyId==null){
                throw new ApiException("非管理员操作,查询条件不可为空");
            }
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanyIndustryTemplateServiceImpl.java
对比新文件
@@ -0,0 +1,89 @@
package com.gkhy.exam.system.service.impl;
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.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.CompanyIndustryTemplate;
import com.gkhy.exam.system.domain.CompanyRoster;
import com.gkhy.exam.system.domain.SysCompany;
import com.gkhy.exam.system.mapper.CompanyIndustryTemplateMapper;
import com.gkhy.exam.system.mapper.CompanyRosterMapper;
import com.gkhy.exam.system.service.CompanyIndustryTemplateService;
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.List;
@Service
public class CompanyIndustryTemplateServiceImpl extends ServiceImpl<CompanyIndustryTemplateMapper, CompanyIndustryTemplate> implements CompanyIndustryTemplateService {
    @Autowired
    private CompanyIndustryTemplateMapper companyIndustryTemplateMapper;
    @Autowired
    private SysCompanyService sysCompanyService;
    @Override
    public CommonPage selectCompanyIndustryTemplateList(Integer companyId) {
        boolean admin = SecurityUtils.adminUser();
        if (!admin){
            if (companyId==null){
                throw new ApiException("非管理员操作,查询条件不可为空");
            }
        }
        PageUtils.startPage();
        List<CompanyIndustryTemplate> companyIndustryTemplates = companyIndustryTemplateMapper.selectCompanyIndustryTemplateList(companyId);
        return CommonPage.restPage(companyIndustryTemplates);
    }
    @Override
    public CommonResult insertCompanyIndustryTemplate(CompanyIndustryTemplate companyIndustryTemplate) {
        LoginUserDetails loginUser = SecurityUtils.getLoginUser();
        SysCompany sysCompany = sysCompanyService.selectCompanyById(SecurityUtils.getCompanyId());
        companyIndustryTemplate.setCompanyName(sysCompany.getName());
        companyIndustryTemplate.setCreateBy(loginUser.getUsername());
        companyIndustryTemplate.setCreateTime(LocalDateTime.now());
        int insert = companyIndustryTemplateMapper.insert(companyIndustryTemplate);
        if (insert>0){
            return CommonResult.success();
        }
        return CommonResult.failed();
    }
    @Override
    public CommonResult updateCompanyIndustryTemplate(CompanyIndustryTemplate companyIndustryTemplate) {
        LoginUserDetails loginUser = SecurityUtils.getLoginUser();
        SysCompany sysCompany = sysCompanyService.selectCompanyById(SecurityUtils.getCompanyId());
        companyIndustryTemplate.setCompanyName(sysCompany.getName());
        companyIndustryTemplate.setUpdateBy(loginUser.getUsername());
        companyIndustryTemplate.setUpdateTime(LocalDateTime.now());
        int update = companyIndustryTemplateMapper.updateCompanyIndustryTemplateById(companyIndustryTemplate);
        if (update>0){
            return CommonResult.success();
        }
        return CommonResult.failed();
    }
    @Override
    public CommonResult deletedCompanyIndustryTemplate(Integer companyIndustryTemplateId) {
        CompanyIndustryTemplate industryTemplate = new CompanyIndustryTemplate();
        LoginUserDetails loginUser = SecurityUtils.getLoginUser();
        industryTemplate.setUpdateBy(loginUser.getUsername());
        industryTemplate.setUpdateTime(LocalDateTime.now());
        industryTemplate.setDelFlag(1);
        industryTemplate.setId(companyIndustryTemplateId);
        int i = companyIndustryTemplateMapper.updateById(industryTemplate);
        if (i>0){
            return CommonResult.success();
        }
        return CommonResult.failed();
    }
}
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanyQualityPolicyServiceImpl.java
@@ -27,10 +27,14 @@
    @Autowired
    private SysCompanyService sysCompanyService;
    /**
     * 质量方针列表
     * @param companyId
     * @return
     */
    @Override
    public CommonPage selectCompanyQualityPolicyList(Integer companyId) {
        boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
        if (!admin){
        if (!SecurityUtils.adminUser()){
            if (companyId==null){
                throw new ApiException("非管理员操作,查询条件不可为空");
            }
@@ -40,6 +44,11 @@
        return CommonPage.restPage(companyQualityPolicies);
    }
    /**
     * 质量方针新增
     * @param companyQualityPolicy
     * @return
     */
    @Override
    public CommonResult insertCompanyQualityPolicy(CompanyQualityPolicy companyQualityPolicy) {
        LoginUserDetails loginUser = SecurityUtils.getLoginUser();
@@ -58,6 +67,11 @@
        return CommonResult.failed();
    }
    /**
     * 质量方针修改
     * @param companyQualityPolicy
     * @return
     */
    @Override
    public CommonResult updateCompanyQualityPolicy(CompanyQualityPolicy companyQualityPolicy) {
        LoginUserDetails loginUser = SecurityUtils.getLoginUser();
@@ -72,9 +86,15 @@
        return CommonResult.failed();
    }
    /**
     * 质量方针删除
     * @param qualityPolicyId
     * @return
     */
    @Override
    public CommonResult deletedCompanyQualityPolicy(Integer qualityPolicyId) {
        LoginUserDetails loginUser = SecurityUtils.getLoginUser();
        //封装删除对象
        CompanyQualityPolicy companyQualityPolicy = new CompanyQualityPolicy();
        companyQualityPolicy.setId(qualityPolicyId);
        companyQualityPolicy.setUpdateBy(loginUser.getUsername());
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanyRosterServiceImpl.java
@@ -33,7 +33,7 @@
    @Override
    public CommonPage selectCompanyRosterList(Integer companyId) {
        boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
        boolean admin = SecurityUtils.adminUser();
        if (!admin){
            if (companyId==null){
                throw new ApiException("非管理员操作,查询条件不可为空");
@@ -82,7 +82,7 @@
        LoginUserDetails loginUser = SecurityUtils.getLoginUser();
        companyRoster.setUpdateBy(loginUser.getUsername());
        companyRoster.setUpdateTime(LocalDateTime.now());
        companyRoster.setDelFlag(2);
        companyRoster.setDelFlag(1);
        companyRoster.setId(companyRosterId);
        int i = companyRosterMapper.updateById(companyRoster);
        if (i>0){
multi-system/src/main/java/com/gkhy/exam/system/service/impl/CompanySummaryServiceImpl.java
@@ -30,8 +30,7 @@
    @Override
    public CommonPage selectCompanySummaryList(Integer companyId) {
        boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
        if (!admin){
        if (!SecurityUtils.adminUser()){
            if (companyId==null){
                throw new ApiException("非管理员操作,查询条件不可为空");
            }
multi-system/src/main/java/com/gkhy/exam/system/service/impl/InformationPlatformServiceImpl.java
@@ -25,11 +25,11 @@
    @Override
    public List<InformationPlatform> getInformationPlatforms(Long companyId) {
        if (companyId == null) {
            companyId = SecurityUtils.getCompanyId();
        }
        LambdaQueryWrapper<InformationPlatform> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(InformationPlatform::getCompanyId, companyId);
        if (companyId != null){
            queryWrapper.eq(InformationPlatform::getCompanyId, companyId);
        }
        queryWrapper.eq(InformationPlatform::getDelFlag, UserConstant.ENABLE);
        queryWrapper.orderByDesc(InformationPlatform::getCreateTime);
@@ -39,10 +39,10 @@
    @Override
    public int saveInformationPlatform(InformationPlatform informationPlatform) {
        Long companyId = informationPlatform.getCompanyId();
        if (!companyId.equals(SecurityUtils.getCompanyId())){
            throw new ApiException("无权操作!");
        }
//        Long companyId = informationPlatform.getCompanyId();
//        if (!companyId.equals(SecurityUtils.getCompanyId())){
//            throw new ApiException("无权操作!");
//        }
        if (informationPlatform.getId() != null){
            informationPlatform.setUpdateTime(LocalDateTime.now());
multi-system/src/main/java/com/gkhy/exam/system/service/impl/QualityAccomplishServiceImpl.java
@@ -37,8 +37,7 @@
    @Override
    public CommonPage selectQualityAccomplishList(QualityReq qualityReq) {
        boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
        if (!admin){
        if (!SecurityUtils.adminUser()){
            if (qualityReq.getCompanyId()==null){
                throw new ApiException("非管理员,查询条件不可为空");
            }
multi-system/src/main/java/com/gkhy/exam/system/service/impl/QualityDecomposeServiceImpl.java
@@ -42,7 +42,7 @@
    @Override
    public CommonPage selectQualityDecomposeList(QualityReq qualityReq) {
        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())){
        if (!SecurityUtils.adminUser()){
            if (qualityReq.getCompanyId()==null){
                throw new ApiException("非管理员,查询条件不可为空");
            }
multi-system/src/main/java/com/gkhy/exam/system/service/impl/QualityServiceImpl.java
@@ -1,5 +1,7 @@
package com.gkhy.exam.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
@@ -8,12 +10,10 @@
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.CompanyBasic;
import com.gkhy.exam.system.domain.Quality;
import com.gkhy.exam.system.domain.QualityTarget;
import com.gkhy.exam.system.domain.SysCompany;
import com.gkhy.exam.system.domain.*;
import com.gkhy.exam.system.domain.req.QualityTargetReq;
import com.gkhy.exam.system.domain.vo.QualityTargetVo;
import com.gkhy.exam.system.mapper.QualityDecomposeMapper;
import com.gkhy.exam.system.mapper.QualityMapper;
import com.gkhy.exam.system.mapper.QualityTargetMapper;
import com.gkhy.exam.system.mapper.SysDeptMapper;
@@ -23,8 +23,11 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Wrapper;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Service
@@ -35,6 +38,8 @@
    @Autowired
    private QualityTargetMapper qualityTargetMapper;
    @Autowired
    private QualityDecomposeMapper qualityDecomposeMapper;
    @Autowired
    private SysCompanyService sysCompanyService;
    @Autowired
    private SysDeptMapper sysDeptMapper;
@@ -42,7 +47,7 @@
    @Override
    public CommonPage selectQualityList(Quality quality) {
        boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
        if (!admin){
        if (!SecurityUtils.adminUser()){
            if (quality.getCompanyId()==null){
                throw new RuntimeException("非管理员操作,查询条件不可为空");
            }
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysClauseManagementServiceImpl.java
@@ -28,7 +28,7 @@
    @Override
    public int saveSysClauseManagement(SysClauseManagement sysClauseManagement) {
        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())){
        if (!SecurityUtils.adminUser()){
            throw new ApiException("没有权限访问!");
        }
        LambdaQueryWrapper<SysClauseManagement> lambdaQueryWrapper = Wrappers.<SysClauseManagement>lambdaQuery()
@@ -55,7 +55,7 @@
    @Override
    public int delSysClauseManagement(Long id) {
        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())){
        if (!SecurityUtils.adminUser()){
            throw new ApiException("没有权限访问!");
        }
        //todo 校验已使用的?
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysDeptServiceImpl.java
@@ -226,7 +226,7 @@
    @Override
    public void checkDeptDataScope(Long deptId)
    {
        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()) && ObjectUtil.isNotNull(deptId))
        if (!SecurityUtils.adminUser() && ObjectUtil.isNotNull(deptId))
        {
            SysDept dept = new SysDept();
            dept.setDeptId(deptId);
@@ -260,13 +260,12 @@
    @Override
    @Transactional
    public int saveDept(SysDeptSaveDTOReq dept) {
        Long companyId = SecurityUtils.getCompanyId();
        if (!companyId.equals(dept.getCompanyId())){
            throw new ApiException("无权操作!");
        }
//        Long companyId = SecurityUtils.getCompanyId();
//        if (!companyId.equals(dept.getCompanyId())){
//            throw new ApiException("无权操作!");
//        }
        SysDept sysDept = new SysDept();
        BeanUtils.copyProperties(dept, sysDept);
        sysDept.setCompanyId(companyId);
        boolean b = checkDeptNameUnique(sysDept);
        if (!b){
            throw new ApiException("部门名称已存在!");
@@ -287,7 +286,7 @@
                delCaluse(sysDept.getDeptId(), delCaluseIds);
            }
            //处理条款
            batchSaveCaluse(sysDept.getDeptId(), companyId, dept.getCaluseVO1List());
            batchSaveCaluse(sysDept.getDeptId(), dept.getCompanyId(), dept.getCaluseVO1List());
        }
@@ -297,15 +296,15 @@
    @Override
    @Transactional
    public int saveDeptResponsibility(SysDeptResponsibilityReqVo reqVo) {
        Long companyId = SecurityUtils.getCompanyId();
        if (!companyId.equals(reqVo.getCompanyId())){
            throw new ApiException("无权操作!");
        }
//        Long companyId = SecurityUtils.getCompanyId();
//        if (!companyId.equals(reqVo.getCompanyId())){
//            throw new ApiException("无权操作!");
//        }
        SysDept sysDept = deptMapper.selectDeptById(reqVo.getDeptId());
        if (null == sysDept){
            throw new ApiException("部门不存在!");
        }
        if (!companyId.equals(sysDept.getCompanyId())){
        if (!reqVo.getCompanyId().equals(sysDept.getCompanyId())){
            throw new ApiException("无权操作!");
        }
        SysDept dept = new SysDept();
@@ -336,9 +335,9 @@
    @Transactional
    public int initFunctionalDistribution(Long companyId) {
        if (!companyId.equals(SecurityUtils.getCompanyId())){
            throw new ApiException("无权操作!");
        }
//        if (!companyId.equals(SecurityUtils.getCompanyId())){
//            throw new ApiException("无权操作!");
//        }
        sysFunctionalDistributionMapper.delByCompanyId(companyId);
        SysDept sysDept = new SysDept();
@@ -370,15 +369,15 @@
    @Override
    public int saveFunctionalDistribution(FunctionalDistributionVo reqVo) {
        Long companyId = SecurityUtils.getCompanyId();
        if (!companyId.equals(reqVo.getCompanyId())){
            throw new ApiException("无权操作!");
        }
//        Long companyId = SecurityUtils.getCompanyId();
//        if (!companyId.equals(reqVo.getCompanyId())){
//            throw new ApiException("无权操作!");
//        }
        List<SysFunctionalDistribution> list = reqVo.getList();
        if (list != null && !list.isEmpty())
        {
            for (SysFunctionalDistribution sysFunctionalDistribution : list) {
                sysFunctionalDistribution.setCompanyId(companyId);
                sysFunctionalDistribution.setCompanyId(reqVo.getCompanyId());
                sysFunctionalDistribution.setUpdateBy(SecurityUtils.getUsername());
                sysFunctionalDistribution.setUpdateTime(LocalDateTime.now());
            }
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysMenuServiceImpl.java
@@ -64,7 +64,7 @@
    {
        List<SysMenu> menuList = null;
        // 管理员显示所有菜单信息
        if (SecurityUtils.isAdmin(userId))
        if (SecurityUtils.adminUser() )
        {
            menuList = menuMapper.selectMenuList(menu);
        }
@@ -128,7 +128,7 @@
    public List<SysMenu> selectMenuTreeByUserId(Long userId)
    {
        List<SysMenu> menus = null;
        if (SecurityUtils.isAdmin(userId))
        if (SecurityUtils.adminUser() )
        {
            menus = menuMapper.selectMenuTreeAll();
        }
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysRoleServiceImpl.java
@@ -197,7 +197,7 @@
    @Override
    public void checkRoleDataScope(Long... roleIds)
    {
        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()))
        if (!SecurityUtils.adminUser())
        {
            for (Long roleId : roleIds)
            {
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysUserServiceImpl.java
@@ -14,7 +14,9 @@
import com.gkhy.exam.common.utils.RedisUtils;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.common.utils.StringUtils;
import com.gkhy.exam.system.domain.SysUserRole;
import com.gkhy.exam.system.mapper.SysUserMapper;
import com.gkhy.exam.system.mapper.SysUserRoleMapper;
import com.gkhy.exam.system.service.SysConfigService;
import com.gkhy.exam.system.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -45,6 +47,8 @@
    private SysConfigService configService;
    @Autowired
    private Validator validator;
    @Autowired
    private SysUserRoleMapper userRoleMapper;
    @Override
    public CommonPage<SysUser> selectUserList(SysUser user) {
@@ -131,6 +135,13 @@
        user.setCreateBy(SecurityUtils.getUsername());
        user.setPassword(SecurityUtils.encryptPassword(Base64.decodeStr(user.getPassword())));
        int row=baseMapper.insert(user);
        List<SysUserRole> userRoleList = new ArrayList<>();
        SysUserRole sysUserRole = new SysUserRole();
        sysUserRole.setUserId(user.getId());
        sysUserRole.setRoleId(2L);
        userRoleList.add(sysUserRole);
        userRoleMapper.batchUserRole(userRoleList);
        if(row<1){
            throw new ApiException("新增用户失败");
        }
multi-system/src/main/resources/mapper/system/CompanyBasicMapper.xml
@@ -55,30 +55,31 @@
    <select id="selectCompanyBasicList" resultType="com.gkhy.exam.system.domain.CompanyBasic">
        SELECT
            `id`,
            `company_id`,
            `company_name`,
            `basic`,
            `introduce`,
            `target`,
            `quality`,
            `activity`,
            `audit`,
            `epiboly`,
            `resource`,
            `del_flag`,
            `create_by`,
            `create_time`,
            `update_by`,
            `update_time`
            cb.`id`,
            cb.`company_id`,
            sc.`name` as company_name,
            cb.`basic`,
            cb.`introduce`,
            cb.`target`,
            cb.`quality`,
            cb.`activity`,
            cb.`audit`,
            cb.`epiboly`,
            cb.`resource`,
            cb.`del_flag`,
            cb.`create_by`,
            cb.`create_time`,
            cb.`update_by`,
            cb.`update_time`
        FROM
            company_basic
            company_basic cb
        left join sys_company sc on cb.company_id = sc.id
        WHERE
            del_flag = 1
            cb.del_flag = 1
        <if test="companyId!=null and companyId != ''">
            and company_id = #{companyId}
            and cb.company_id = #{companyId}
        </if>
        ORDER BY
            create_time DESC
            cb.create_time DESC
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/CompanyCertificateMapper.xml
@@ -47,27 +47,28 @@
    <select id="selectCompanyCertificateList" resultType="com.gkhy.exam.system.domain.CompanyCertificate">
        SELECT
            `id`,
            `company_id`,
            `company_name`,
            `certificate_name`,
            `certificate_num`,
            `effective_time`,
            `file_name`,
            `file_path`,
            `del_flag`,
            `create_by`,
            `create_time`,
            `update_by`,
            `update_time`
            cc.`id`,
            cc.`company_id`,
            sc.`name` as company_name,
            cc.`certificate_name`,
            cc.`certificate_num`,
            cc.`effective_time`,
            cc.`file_name`,
            cc.`file_path`,
            cc.`del_flag`,
            cc.`create_by`,
            cc.`create_time`,
            cc.`update_by`,
            cc.`update_time`
        FROM
            company_certificate
            company_certificate cc
        left join sys_company sc on cc.company_id = sc.id
        WHERE
            del_flag = 1
            cc.del_flag = 1
        <if test="companyId!=null and companyId!=''">
            and company_id = #{companyId}
            and cc.company_id = #{companyId}
        </if>
        ORDER BY
            create_time DESC
            cc.create_time DESC
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/CompanyIndustryTemplateMapper.xml
对比新文件
@@ -0,0 +1,68 @@
<?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.gkhy.exam.system.mapper.CompanyIndustryTemplateMapper">
    <update id="updateCompanyIndustryTemplateById" parameterType="com.gkhy.exam.system.domain.CompanyIndustryTemplate">
        UPDATE company_industry_template
        <set>
            <if test="companyId != null and companyId != ''" >
                company_id = #{companyId},
            </if>
            <if test="companyName != null and companyName != ''" >
                company_name = #{companyName},
            </if>
            <if test="templateName != null and templateName !=''" >
                template_name = #{templateName},
            </if>
            <if test="industryType != null " >
                industry_type = #{industryType},
            </if>
            <if test="filePath != null and filePath !=''" >
                file_path = #{filePath},
            </if>
            <if test="format != null and format !=''" >
                format = #{format},
            </if>
            <if test="delFlag != null and delFlag != ''" >
                del_flag = #{delFlag},
            </if>
            <if test="createBy != null" >
                create_by = #{createBy},
            </if>
            <if test="createTime != null" >
                create_time = #{createTime},
            </if>
            <if test="updateBy != null" >
                update_by = #{updateBy},
            </if>
            <if test="updateTime != null" >
                update_time = #{updateTime}
            </if>
        </set>
        where id = #{id}
    </update>
    <select id="selectCompanyIndustryTemplateList" resultType="com.gkhy.exam.system.domain.CompanyIndustryTemplate">
        SELECT
            `id`,
            `company_id`,
            `company_name`,
            `template_name`,
            `industry_type`,
            `file_path`,
            `format`,
            `del_flag`,
            `create_by`,
            `create_time`,
            `update_by`,
            `update_time`
        FROM
        company_industry_template
        WHERE
            del_flag = 0
        <if test="companyId!=null and companyId!=''">
            and company_id = #{companyId}
        </if>
        ORDER BY
            create_time DESC
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/CompanyQualityPolicyMapper.xml
@@ -36,23 +36,24 @@
    <select id="selectCompanyQualityPolicyList" resultType="com.gkhy.exam.system.domain.CompanyQualityPolicy">
        SELECT
            `id`,
            `company_id`,
            company_name,
            `policy`,
            `del_flag`,
            `create_by`,
            `create_time`,
            `update_by`,
            `update_time`
            cqp.`id`,
            cqp.`company_id`,
            sc.`name` as company_name,
            cqp.`policy`,
            cqp.`del_flag`,
            cqp.`create_by`,
            cqp.`create_time`,
            cqp.`update_by`,
            cqp.`update_time`
        FROM
            company_quality_policy
            company_quality_policy cqp
        left join sys_company sc on cqp.company_id = sc.id
        WHERE
            del_flag = 1
            cqp.del_flag = 1
        <if test="companyId!=null and companyId!=''">
            and company_id = #{companyId}
            and cqp.company_id = #{companyId}
        </if>
        ORDER BY
            create_time DESC
            cqp.create_time DESC
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/CompanyRosterMapper.xml
@@ -46,7 +46,7 @@
        FROM
            company_roster
        WHERE
            del_flag = 1
            del_flag = 0
        <if test="companyId!=null and companyId!=''">
            and company_id = #{companyId}
        </if>
multi-system/src/main/resources/mapper/system/CompanySummaryMapper.xml
@@ -34,23 +34,24 @@
    <select id="selectCompanySummaryList" resultType="com.gkhy.exam.system.domain.CompanySummary">
        SELECT
            `id`,
            `company_id`,
            `company_name`,
            `company_summary`,
            `del_flag`,
            `create_by`,
            `create_time`,
            `update_by`,
            `update_time`
            cs.`id`,
            cs.`company_id`,
            sc.`name` as company_name,
            cs.`company_summary`,
            cs.`del_flag`,
            cs.`create_by`,
            cs.`create_time`,
            cs.`update_by`,
            cs.`update_time`
        FROM
            company_summary
            company_summary cs
        left join sys_company sc on cs.company_id = sc.id
        WHERE
            del_flag = 1
             cs.del_flag = 1
        <if test="companyId!=null and companyId!=''">
            and company_id = #{companyId}
            and cs.company_id = #{companyId}
        </if>
        ORDER BY
            create_time DESC
            cs.create_time DESC
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/QualityAccomplishMapper.xml
@@ -6,7 +6,7 @@
        SELECT
            qa.`id`,
            qa.`company_id`,
            q.company_name,
            sc.`name` as company_name,
            q.year,
            q.type,
            q.depart_name,
@@ -27,6 +27,7 @@
        FROM
            quality_accomplish qa
                LEFT JOIN quality q ON qa.quality_id = q.id
        left join sys_company sc on q.company_id = sc.id
        WHERE
            qa.del_flag = 1
        <if test="companyId!=null and companyId!=''">
multi-system/src/main/resources/mapper/system/QualityDecomposeMapper.xml
@@ -16,7 +16,7 @@
        SELECT
            qd.`id`,
            qd.`company_id`,
            q.company_name,
            sc.`name` as company_name,
            q.`year`,
            q.type,
            q.depart_name,
@@ -39,6 +39,7 @@
            qd.`update_time`
        FROM quality_decompose qd
                 LEFT JOIN quality q on qd.quality_id = q.id
                left join sys_company sc on q.company_id = sc.id
        WHERE qd.del_flag = 1
            <if test="companyId !=null and companyId!=''">
                and q.company_id =#{companyId}
@@ -75,5 +76,8 @@
        where del_flag = 1
        and quality_id=#{qualityId}
    </select>
    <select id="selectByDelFlag" resultType="java.lang.Integer">
        select quality_id from  quality_decompose where del_flag = 1
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/QualityMapper.xml
@@ -89,67 +89,69 @@
    <select id="selectQualityTarget" resultType="com.gkhy.exam.system.domain.vo.QualityTargetVo">
        SELECT
            `id`,
            `company_id`,
            `company_name`,
            `year`,
            `num`,
            `type`,
            `depart_id`,
            `depart_name`,
            `method`,
            `compilation_id`,
            `compilation_name`,
            `compilation_time`,
            `quality_id`,
            `quality_name`,
            `quality_time`,
            `lead_id`,
            `lead_name`,
            `lead_time`
        FROM quality
            q.`id`,
            q.`company_id`,
            sc.`name` as `company_name`,
            q.`year`,
            q.`num`,
            q.`type`,
            q.`depart_id`,
            q.`depart_name`,
            q.`method`,
            q.`compilation_id`,
            q.`compilation_name`,
            q.`compilation_time`,
            q.`quality_id`,
            q.`quality_name`,
            q.`quality_time`,
            q.`lead_id`,
            q.`lead_name`,
            q.`lead_time`
        FROM quality q
        left join  sys_company sc on q.company_id = sc.id
        WHERE
            del_flag=1
            q.del_flag=1
        <if test="companyId!=null and companyId!=''">
            and company_id = #{companyId}
            and q.company_id = #{companyId}
        </if>
        <if test="year!=null and year!=''">
            and `year` = #{year}
            and q.`year` = #{year}
        </if>
        <if test="type!=null and type!=''">
            and `type` = #{type}
            and q.`type` = #{type}
        </if>
        ORDER BY
            create_time DESC
            q.create_time DESC
    </select>
    <select id="selectQualityByType" resultType="com.gkhy.exam.system.domain.Quality">
        SELECT
            `id`,
            `company_id`,
            `company_name`,
            `year`,
            `num`,
            `type`,
            `depart_id`,
            `depart_name`,
            `method`,
            `compilation_id`,
            `compilation_name`,
            `compilation_time`,
            `quality_id`,
            `quality_name`,
            `quality_time`,
            `lead_id`,
            `lead_name`,
            `lead_time`
        FROM quality
            q.`id`,
            q.`company_id`,
            sc.`name` as company_name,
            q.`year`,
            q.`num`,
            q.`type`,
            q.`depart_id`,
            q.`depart_name`,
            q.`method`,
            q.`compilation_id`,
            q.`compilation_name`,
            q.`compilation_time`,
            q.`quality_id`,
            q.`quality_name`,
            q.`quality_time`,
            q.`lead_id`,
            q.`lead_name`,
            q.`lead_time`
        FROM quality q
        left join sys_company sc on q.company_id = sc.id
        WHERE
            del_flag=1 and `type` = #{type} and `year` = #{year}
            q.del_flag=1 and q.`type` = #{type} and q.`year` = #{year}
        <if test="type == 1">
            and company_id = #{companyId}
            and q.company_id = #{companyId}
        </if>
        <if test="type == 2">
            and depart_id = #{departId}
            and q.depart_id = #{departId}
        </if>
    </select>