教育训练处考试制证系统后端
heheng
2025-01-21 5217bbc0a0278915e5c641316c20489d8f1868f1
特种作业非煤缴费版本
已修改8个文件
185 ■■■■ 文件已修改
exam-system/src/main/java/com/gkhy/exam/pay/controller/NonCoalPayController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalCategoryServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayStudentServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
exam-system/src/main/resources/mapper/pay/NonCoalCategoryMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml 97 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
exam-system/src/main/java/com/gkhy/exam/pay/controller/NonCoalPayController.java
@@ -179,7 +179,7 @@
    @GetMapping("/nonCoalSelectH5")
    @ApiOperation(value = "H5查询缴费信息")
    @ApiOperation(value = "非煤H5查询缴费信息")
    @Anonymous
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phone", dataTypeClass = String.class, value = "电话", required = true),
exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalCategoryServiceImpl.java
@@ -4,6 +4,7 @@
import com.gkhy.exam.pay.entity.NonCoalCategory;
import com.gkhy.exam.pay.mapper.NonCoalCategoryMapper;
import com.gkhy.exam.pay.service.NonCoalCategoryService;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.stereotype.Service;
@@ -43,7 +44,10 @@
    @Override
    public List<NonCoalCategory> selectNonCoalCategoryList(NonCoalCategory nonCoalCategory) {
        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
            if (!Constants.DIS_XINJIANG_CODE.equals(SecurityUtils.getDeptDistrictCode())) {
            nonCoalCategory.setDistrictCode(SecurityUtils.getDeptDistrictCode());
            }
        }
        return nonCoalCategoryMapper.selectNonCoalCategoryList(nonCoalCategory);
    }
@@ -56,6 +60,9 @@
     */
    @Override
    public int insertNonCoalCategory(NonCoalCategory nonCoalCategory) {
        if (!nonCoalCategory.getDistrictCode().startsWith(Constants.DIS_XINJIANG_CODE)) {
            throw new RuntimeException("地州信息错误");
        }
        checkSubjectName(nonCoalCategory);
        nonCoalCategory.setCreateBy(SecurityUtils.getUsername());
        return nonCoalCategoryMapper.insertNonCoalCategory(nonCoalCategory);
@@ -70,6 +77,7 @@
    @Override
    public int updateNonCoalCategory(NonCoalCategory nonCoalCategory) {
        checkSubjectName(nonCoalCategory);
        nonCoalCategory.setDistrictCode(null);
        nonCoalCategory.setUpdateBy(SecurityUtils.getUsername());
        return nonCoalCategoryMapper.updateNonCoalCategory(nonCoalCategory);
    }
exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayServiceImpl.java
@@ -18,6 +18,7 @@
import com.gkhy.exam.pay.service.NonCoalPayCategoryService;
import com.gkhy.exam.pay.service.NonCoalPayService;
import com.gkhy.exam.pay.service.NonCoalPayStudentService;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
@@ -73,7 +74,9 @@
    @Override
    public List<NonCoalPayPageRepDto> selectNonCoalPayList(NonCoalPay nonCoalPay) {
        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
            if (!Constants.DIS_XINJIANG_CODE.equals(SecurityUtils.getDeptDistrictCode())) {
            nonCoalPay.setDistrictCode(SecurityUtils.getDeptDistrictCode());
            }
        }
        return nonCoalPayMapper.getNonCoalPayList(nonCoalPay);
    }
@@ -122,6 +125,9 @@
    @Override
    @Transactional
    public int insertNonCoalPay(NonCoalPayReqDto nonCoalPay) {
        if (!nonCoalPay.getDistrictCode().startsWith(Constants.DIS_XINJIANG_CODE)) {
            throw new RuntimeException("地州信息错误");
        }
        checkData(nonCoalPay);
        NonCoalPay nonCoalPay1 = new NonCoalPay();
        BeanUtils.copyProperties(nonCoalPay, nonCoalPay1);
@@ -173,10 +179,12 @@
    @Override
    @Transactional
    public int updateNonCoalPay(NonCoalPayReqDto nonCoalPay) {
        checkData(nonCoalPay);
        checkHavePay(nonCoalPay.getId());
        NonCoalPay nonCoalPay1 = new NonCoalPay();
        BeanUtils.copyProperties(nonCoalPay, nonCoalPay1);
        nonCoalPay1.setDistrictCode(null);
        nonCoalPay1.setUpdateBy(SecurityUtils.getUsername());
        int i = nonCoalPayMapper.updateNonCoalPay(nonCoalPay1);
        if (i > 0) {
exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayStudentServiceImpl.java
@@ -186,8 +186,10 @@
        StringBuilder failureMsg = new StringBuilder();
        for (NonCoalPayStudent stu : nonCoalPayStudents) {
            try {
                if (idCardToNameMap.get(stu.getIdCard().trim()) != null) {
                if (StringUtils.isEmpty(stu.getIdCard()) || StringUtils.isEmpty(stu.getName()) || StringUtils.isEmpty(stu.getPhone()) || stu.getSex() == null) {
                    failureMsg.append("<br/>" + failureNum + "、身份证号: " + stu.getIdCard() + " 数据已存在");
                } else if (idCardToNameMap.get(stu.getIdCard().trim()) != null) {
                    failureMsg.append("<br/>" + failureNum + "、导入数据为空: " + stu.getIdCard() + " 数据错误");
                } else {
                    stu.setPayType(1L);
                    stu.setPayStatus(0L);
exam-system/src/main/resources/mapper/pay/NonCoalCategoryMapper.xml
@@ -82,7 +82,7 @@
            </if>
            <if test="operateTypeId != null ">and a.operate_type_id = #{operateTypeId}</if>
            <if test="amount != null ">and a.amount = #{amount}</if>
            <if test="bussinessCode != null  and bussinessCode != ''">and a.business_code = #{bussinessCode}</if>
            <if test="businessCode != null  and businessCode != ''">and a.business_code = #{businessCode}</if>
            <if test="companyCode != null  and companyCode != ''">and a.company_code = #{companyCode}</if>
            <if test="drawer != null  and drawer != ''">and a.drawer = #{drawer}</if>
            <if test="reviewer != null  and reviewer != ''">and a.reviewer = #{reviewer}</if>
@@ -131,7 +131,7 @@
            <if test="subjectName != null and subjectName != ''">subject_name,</if>
            <if test="operateTypeId != null">operate_type_id,</if>
            <if test="amount != null">amount,</if>
            <if test="bussinessCode != null and bussinessCode != ''">business_code,</if>
            <if test="businessCode != null and businessCode != ''">business_code,</if>
            <if test="companyCode != null and companyCode != ''">company_code,</if>
            <if test="drawer != null and drawer != ''">drawer,</if>
            <if test="reviewer != null and reviewer != ''">reviewer,</if>
@@ -149,7 +149,7 @@
            <if test="subjectName != null and subjectName != ''">#{subjectName},</if>
            <if test="operateTypeId != null">#{operateTypeId},</if>
            <if test="amount != null">#{amount},</if>
            <if test="bussinessCode != null and bussinessCode != ''">#{bussinessCode},</if>
            <if test="businessCode != null and businessCode != ''">#{businessCode},</if>
            <if test="companyCode != null and companyCode != ''">#{companyCode},</if>
            <if test="drawer != null and drawer != ''">#{drawer},</if>
            <if test="reviewer != null and reviewer != ''">#{reviewer},</if>
@@ -171,7 +171,7 @@
            <if test="subjectName != null and subjectName != ''">subject_name = #{subjectName},</if>
            <if test="operateTypeId != null">operate_type_id = #{operateTypeId},</if>
            <if test="amount != null">amount = #{amount},</if>
            <if test="bussinessCode != null and bussinessCode != ''">business_code = #{bussinessCode},</if>
            <if test="businessCode != null and businessCode != ''">business_code = #{businessCode},</if>
            <if test="companyCode != null and companyCode != ''">company_code = #{companyCode},</if>
            <if test="drawer != null and drawer != ''">drawer = #{drawer},</if>
            <if test="reviewer != null and reviewer != ''">reviewer = #{reviewer},</if>
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
@@ -7,8 +7,7 @@
 * 
 * @author ruoyi
 */
public class Constants
{
public class Constants {
    /**
     * UTF-8 字符集
     */
@@ -148,4 +147,6 @@
     */
    public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
            "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" };
    public static final String DIS_XINJIANG_CODE = "65";
}
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -24,7 +24,19 @@
    </resultMap>
    
    <sql id="selectDeptVo">
        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time,d.district_code
        select d.dept_id,
               d.parent_id,
               d.ancestors,
               d.dept_name,
               d.order_num,
               d.leader,
               d.phone,
               d.email,
               d.status,
               d.del_flag,
               d.create_by,
               d.create_time,
               d.district_code
        from sys_dept d
    </sql>
    
@@ -54,33 +66,54 @@
            left join sys_role_dept rd on d.dept_id = rd.dept_id
        where rd.role_id = #{roleId}
            <if test="deptCheckStrictly">
              and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
            and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id =
            rd.dept_id and rd.role_id = #{roleId})
            </if>
        order by d.parent_id, d.order_num
    </select>
    
    <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, ,d.district_code,d.status,
        select d.dept_id,
               d.parent_id,
               d.ancestors,
               d.dept_name,
               d.order_num,
               d.leader,
               d.phone,
               d.email,
               d.district_code,
               d.status,
            (select dept_name from sys_dept where dept_id = d.parent_id) parent_name
        from sys_dept d
        where d.dept_id = #{deptId}
    </select>
    
    <select id="checkDeptExistUser" parameterType="Long" resultType="int">
        select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
        select count(1)
        from sys_user
        where dept_id = #{deptId}
          and del_flag = '0'
    </select>
    
    <select id="hasChildByDeptId" parameterType="Long" resultType="int">
        select count(1) from sys_dept
        where del_flag = '0' and parent_id = #{deptId} limit 1
        select count(1)
        from sys_dept
        where del_flag = '0'
          and parent_id = #{deptId} limit 1
    </select>
    
    <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
        select * from sys_dept where find_in_set(#{deptId}, ancestors)
        select *
        from sys_dept
        where find_in_set(#{deptId}, ancestors)
    </select>
    
    <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
        select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
        select count(*)
        from sys_dept
        where status = 0
          and del_flag = '0'
          and find_in_set(#{deptId}, ancestors)
    </select>
    
    <select id="checkDeptNameUnique" resultMap="SysDeptResult">
@@ -157,7 +190,9 @@
    </update>
    
    <delete id="deleteDeptById" parameterType="Long">
        update sys_dept set del_flag = '2' where dept_id = #{deptId}
        update sys_dept
        set del_flag = '2'
        where dept_id = #{deptId}
    </delete>
</mapper> 
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -66,24 +66,58 @@
    </resultMap>
    
    <sql id="selectUserVo">
        select u.user_id, u.dept_id, u.district_id,u.unit,u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.id_card,
        d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,d.district_code,
        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,
        select u.user_id,
               u.dept_id,
               u.unit,
               u.user_name,
               u.nick_name,
               u.email,
               u.avatar,
               u.phonenumber,
               u.password,
               u.sex,
               u.status,
               u.del_flag,
               u.login_ip,
               u.login_date,
               u.create_by,
               u.create_time,
               u.remark,
               u.id_card,
               d.dept_id,
               d.parent_id,
               d.ancestors,
               d.dept_name,
               d.order_num,
               d.leader,
               d.status as dept_status,
               d.district_code,
               r.role_id,
               r.role_name,
               r.role_key,
               r.role_sort,
               r.data_scope,
               r.status as role_status,
        di.name as district_name,
        ti.institution_id, ti.institution_name
               ti.institution_id,
               ti.institution_name,
               di.id    as district_id
        from sys_user u
            left join sys_dept d on u.dept_id = d.dept_id
            left join sys_user_role ur on u.user_id = ur.user_id
            left join sys_role r on r.role_id = ur.role_id
            left join sys_district di on di.id = u.district_id
                 left join sys_district di on di.code = d.district_code
            left join sys_user_institution ui on u.user_id = ui.user_id
            left join training_institution ti on ui.institution_id = ti.institution_id
    </sql>
    
    <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
        select u.user_id, u.dept_id, u.district_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader, u.id_card, ti.institution_id, ti.institution_name, di.name as district_name from sys_user u
        select u.user_id, u.dept_id, di.id as district_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber,
        u.sex,
        u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,
        u.id_card, ti.institution_id, ti.institution_name, di.name as district_name,d.district_code from sys_user u
        left join sys_dept d on u.dept_id = d.dept_id
        left join sys_district di on di.id = u.district_id
        left join sys_district di on di.code = d.district_code
        left join sys_user_institution ui on u.user_id = ui.user_id
        left join training_institution ti on ui.institution_id = ti.institution_id
        where u.del_flag = '0'
@@ -106,19 +140,22 @@
            AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
        </if>
        <if test="deptId != null and deptId != 0">
            AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
            AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
            ancestors) ))
        </if>
        <!-- 数据范围过滤 -->
        ${params.dataScope}
    </select>
    
    <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
        select distinct u.user_id, u.dept_id, u.district_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time, u.id_card, di.name as district_name
        select distinct u.user_id, u.dept_id, di.id as district_id, u.user_name, u.nick_name, u.email, u.phonenumber,
        u.status,
        u.create_time, u.id_card, di.name as district_name,d.district_code
        from sys_user u
             left join sys_dept d on u.dept_id = d.dept_id
             left join sys_user_role ur on u.user_id = ur.user_id
             left join sys_role r on r.role_id = ur.role_id
             left join sys_district di on di.id = u.district_id
        left join sys_district di on di.code = d.district_code
        where u.del_flag = '0' and r.role_id = #{roleId}
        <if test="userName != null and userName != ''">
@@ -132,14 +169,17 @@
    </select>
    
    <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
        select distinct u.user_id, u.dept_id, u.district_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time, u.id_card, di.name as district_name
        select distinct u.user_id, u.dept_id, di.id as district_id, u.user_name, u.nick_name, u.email, u.phonenumber,
        u.status,
        u.create_time, u.id_card, di.name as district_name, d.district_code
        from sys_user u
             left join sys_dept d on u.dept_id = d.dept_id
             left join sys_user_role ur on u.user_id = ur.user_id
             left join sys_role r on r.role_id = ur.role_id
             left join sys_district di on di.id = u.district_id
        left join sys_district di on di.code = d.district_code
        where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
        and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
        and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and
        ur.role_id = #{roleId})
        <if test="userName != null and userName != ''">
            AND u.user_name like concat('%', #{userName}, '%')
        </if>
@@ -161,15 +201,24 @@
    </select>
    
    <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
        select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1
        select user_id, user_name
        from sys_user
        where user_name = #{userName}
          and del_flag = '0' limit 1
    </select>
    
    <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
        select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
        select user_id, phonenumber
        from sys_user
        where phonenumber = #{phonenumber}
          and del_flag = '0' limit 1
    </select>
    
    <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
        select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
        select user_id, email
        from sys_user
        where email = #{email}
          and del_flag = '0' limit 1
    </select>
    
    <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
@@ -232,19 +281,27 @@
    </update>
    
    <update id="updateUserStatus" parameterType="SysUser">
         update sys_user set status = #{status} where user_id = #{userId}
        update sys_user
        set status = #{status}
        where user_id = #{userId}
    </update>
    
    <update id="updateUserAvatar" parameterType="SysUser">
         update sys_user set avatar = #{avatar} where user_name = #{userName}
        update sys_user
        set avatar = #{avatar}
        where user_name = #{userName}
    </update>
    
    <update id="resetUserPwd" parameterType="SysUser">
         update sys_user set password = #{password} where user_name = #{userName}
        update sys_user
        set password = #{password}
        where user_name = #{userName}
    </update>
    
    <delete id="deleteUserById" parameterType="Long">
         update sys_user set del_flag = '2' where user_id = #{userId}
        update sys_user
        set del_flag = '2'
        where user_id = #{userId}
     </delete>
     
     <delete id="deleteUserByIds" parameterType="Long">