智慧保安后台管理-外网项目备份
Administrator
2021-12-17 048ac3dc5e9959821bf2d9a4f0435d7858556bdc
1. 保安证打印修改
2. 保安证查询修改
3. 考试成绩查询修改
6 files modified
117 ■■■■■ changed files
src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java 30 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml 23 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml 20 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/vo/ExamScoreVO.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 36 ●●●●● patch | view | raw | blame | history
src/main/resources/log/logback-test.xml 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java
@@ -70,13 +70,39 @@
    }
    /**
     * 新增
     * 新增(补证)
     * @param accreditationRecords 制证记录信息对象
     */
    @PostMapping("/save")
    @ApiOperation(value = "新增", notes = "传入accreditationRecords")
    public R save(@RequestBody AccreditationRecords accreditationRecords){
        return R.data(accreditationRecordsService.save(accreditationRecords));
        accreditationRecords.setCreateTime(new Date());
        accreditationRecords.setStatus(1);
        accreditationRecords.setAuditStatus(1);
        boolean save = accreditationRecordsService.save(accreditationRecords);
        //修改用户信息
        User user = new User();
        user.setId(accreditationRecords.getUserId());
        user.setUpdateTime(new Date());
        //修改为未制证状态
        user.setUserType(7);
        userService.updateById(user);
        //内网同步
        //内网新增
        String s = "insert into sys_accreditation_records(id,user_id,create_time,create_user,status,type,audit_status) " +
            "values(" + "'" + accreditationRecords.getId() + "'" + ","
            + "'" + accreditationRecords.getUserId() + "'" + ","
            + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getCreateTime()) + "'" + ","
            + "'" + accreditationRecords.getCreateUser() +"'" + ","
            + "'" + accreditationRecords.getStatus() +"'" + ","
            + "'" + accreditationRecords.getType() +"'" + ","
            +"'" + accreditationRecords.getAuditStatus() + "'" + ");" +
        "update blade_user set user_type = " + "'" + user.getUserType() + "'" +
            ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
            " " + "where id = " + "'" + user.getId() + "'";
        FtpUtil.sqlFileUpload(s);
        return R.data(save);
    }
src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
@@ -65,7 +65,10 @@
        <if test="accreditationRecords.jurisdiction!=null and accreditationRecords.jurisdiction!='' and accreditationRecords.jurisdiction!='1372091709474910209'">
            and (sj.id = #{accreditationRecords.jurisdiction} or sj.parent_id = #{accreditationRecords.jurisdiction})
        </if>
        <if test="accreditationRecords.status!=null">
        <if test="accreditationRecords.status==1">
            and sar.status = #{accreditationRecords.status}
        </if>
        <if test="accreditationRecords.status==2">
            and sar.status = #{accreditationRecords.status}
        </if>
        <if test="accreditationRecords.createUser!=null">
@@ -175,6 +178,12 @@
        <if test="accreditationRecords.idCardNo!=null and  accreditationRecords.idCardNo!=''">
            and bu.cardid like concat('%', #{accreditationRecords.idCardNo},'%')
        </if>
        <if test="accreditationRecords.status==1">
            and sar.status = #{accreditationRecords.status}
        </if>
        <if test="accreditationRecords.status==2">
            and sar.status = #{accreditationRecords.status}
        </if>
        <if test="accreditationRecords.securityNumber!=null and  accreditationRecords.securityNumber!=''">
            and bu.securitynumber like concat('%', #{accreditationRecords.securityNumber},'%')
        </if>
@@ -274,6 +283,12 @@
        </if>
        <if test="accreditationRecords.securityNumber!=null and  accreditationRecords.securityNumber!=''">
            and bu.securitynumber like concat('%', #{accreditationRecords.securityNumber},'%')
        </if>
        <if test="accreditationRecords.status==1">
            and sar.status = #{accreditationRecords.status}
        </if>
        <if test="accreditationRecords.status==2">
            and sar.status = #{accreditationRecords.status}
        </if>
        <if test="accreditationRecords.jurisdiction!=null and accreditationRecords.jurisdiction!='' and accreditationRecords.jurisdiction!='1372091709474910209'">
            and (sj.id = #{accreditationRecords.jurisdiction} or sj.parent_id = #{accreditationRecords.jurisdiction})
@@ -378,6 +393,12 @@
        <if test="accreditationRecords.status!=null">
            and sar.status = #{accreditationRecords.status}
        </if>
        <if test="accreditationRecords.status==1">
            and sar.status = #{accreditationRecords.status}
        </if>
        <if test="accreditationRecords.status==2">
            and sar.status = #{accreditationRecords.status}
        </if>
        <if test="accreditationRecords.createUser!=null">
            and sar.create_user = #{accreditationRecords.createUser}
        </if>
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
@@ -64,7 +64,7 @@
    </select>
    <!--考试成绩分页信息-模拟考试-->
    <!--考试成绩分页信息-培训考试-->
    <select id="selectTrainExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO">
        SELECT
            es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId,
@@ -72,7 +72,8 @@
            ke.exam_name examName,
            str.is_exam isExam,
            bu.real_name securityName,company,bu.account,bu.sex,bu.paper_time paperTime,bu.securitynumber securityNumber,bu.avatar,
            bd.dept_name companyName from
            bd.dept_name companyName,bu.user_type isPaper
        from
            exam_score es
        left join
        ksxt_exam ke
@@ -119,6 +120,15 @@
        </if>
        <if test="examScore.examType!=null and  examScore.examType!=''">
            and ke.exam_type = #{examScore.examType}
        </if>
        <if test="examScore.examType!=null and  examScore.examType!=''">
            and ke.exam_type = #{examScore.examType}
        </if>
        <if test="examScore.isPaper==6">
            and bu.user_type = #{examScore.isPaper}
        </if>
        <if test="examScore.isPaper==7">
            and (bu.user_type = #{examScore.isPaper} or bu.user_type is null)
        </if>
        <if test="examScore.isAvatar==1">
            and bu.avatar is not null and bu.avatar!=""
@@ -368,6 +378,12 @@
        <if test="examScore.securityName!=null and  examScore.securityName!=''">
            and bu.real_name like concat('%', #{examScore.securityName},'%')
        </if>
        <if test="examScore.isPaper==6">
            and bu.user_type = #{examScore.isPaper}
        </if>
        <if test="examScore.isPaper==7">
            and (bu.user_type = #{examScore.isPaper} or bu.user_type is null)
        </if>
        <if test="examScore.account!=null and  examScore.account!=''">
            and bu.account like concat('%', #{examScore.account},'%')
        </if>
src/main/java/org/springblade/modules/exam/vo/ExamScoreVO.java
@@ -91,4 +91,9 @@
     */
    private Integer isAvatar;
    /**
     * 是否制证  6:是  7:否
     */
    private Integer isPaper;
}
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -55,6 +55,8 @@
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.*;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.accreditation.entity.AccreditationRecords;
import org.springblade.modules.accreditation.service.AccreditationRecordsService;
import org.springblade.modules.dispatcher.entity.Dispatcher;
import org.springblade.modules.dispatcher.service.IDispatcherService;
import org.springblade.modules.exam.excel.ExportExamScoreExcel;
@@ -94,6 +96,7 @@
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import static org.springblade.common.config.FtpConfig.*;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
@@ -124,6 +127,8 @@
    private final TrainingRegistrationService trainingRegistrationService;
    private final AccreditationRecordsService accreditationRecordsService;
    /**
     * 查询单条
@@ -613,6 +618,37 @@
        } else {
            paperTime = new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime());
        }
        //更新制证记录制证状态
        AccreditationRecords accreditationRecords = new AccreditationRecords();
        accreditationRecords.setUserId(user.getId());
        //审核通过的
        accreditationRecords.setAuditStatus(2);
        //未制证的记录
        accreditationRecords.setStatus(1);
        //查询
        List<AccreditationRecords> list = accreditationRecordsService.list(Condition.getQueryWrapper(accreditationRecords));
        if (list.size()>0) {
            //排序
            List<AccreditationRecords> collect = list.stream().sorted(Comparator.comparing(AccreditationRecords::getId).reversed()).collect(Collectors.toList());
            //取出第一个
            AccreditationRecords accreditationRecords1 = collect.get(0);
            //修改为已制证状态
            accreditationRecords1.setStatus(2);
            //更新
            accreditationRecordsService.updateById(accreditationRecords1);
            //同步
            String s1 =
                "update blade_user set paper_time = " + "'" + paperTime + "'"
                    + ",user_type = " + "'" + user.getUserType() + "'"
                    + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                    + " " + "where id = " + "'" + user.getId() + "';" +
                "update sys_accreditation_records set status = " + "'" + accreditationRecords1.getStatus() + "'" +
                    " " + "where id = " + "'" + accreditationRecords1.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //返回
            return R.success("修改成功");
        }
        String s1 =
            "update blade_user set paper_time = " + "'" + paperTime + "'"
                + ",user_type = " + "'" + user.getUserType() + "'"
src/main/resources/log/logback-test.xml
@@ -21,6 +21,7 @@
        </encoder>
    </appender>
    <!-- 生成日志文件 -->
    <appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
@@ -42,7 +43,7 @@
    <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- 日志文件输出的文件名 -->
            <FileNamePattern>target/blade/log/error-%d{yyyy-MM-dd}.log</FileNamePattern>
            <FileNamePattern>D:/log/error-%d{yyyy-MM-dd}.log</FileNamePattern>
        </rollingPolicy>
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>%n%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%logger{50}] %n%-5level: %msg%n</pattern>