智慧保安后台管理-外网项目备份
Administrator
2022-01-10 a2128bbba47602e6795f2667cf2948992f24bebe
1. 上岗证新增审核
2. 上岗证导出和证书打印记录时间
7 files modified
107 ■■■■■ changed files
src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java 88 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/accreditation/entity/AccreditationRecords.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml 5 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/accreditation/service/impl/AccreditationRecordsServiceImpl.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/fixed.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/jurisdiction/controller/JurisdictionController.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java
@@ -140,22 +140,33 @@
            //修改为未制证状态
            AccreditationRecords records = accreditationRecordsService.getById(accreditationRecords);
            User user = userService.getById(records.getUserId());
            user.setUserType(7);
            user.setUpdateTime(new Date());
            //更新
            userService.updateById(user);
            if(accreditationRecords.getType()==2) {
                user.setUserType(7);
                user.setUpdateTime(new Date());
                //更新
                userService.updateById(user);
            //内网同步
            String s =
                "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                    ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                    ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                    ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                    "where id = " + "'" + accreditationRecords.getId() + "';" +
                "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);
                //内网同步
                String s =
                    "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                        ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                        ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                        ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                        "where id = " + "'" + accreditationRecords.getId() + "';" +
                        "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);
            }else {
                //内网同步
                String s =
                    "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                        ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                        ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                        ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                        "where id = " + "'" + accreditationRecords.getId() + "'";
                FtpUtil.sqlFileUpload(s);
            }
        }else {
            //内网同步
            String s =
@@ -187,25 +198,36 @@
            accreditationRecordsService.updateById(accreditationRecords);
            //审核通过
            if (accreditationRecords.getAuditStatus()==2){
                //修改为未制证状态
                AccreditationRecords records = accreditationRecordsService.getById(id);
                User user = userService.getById(records.getUserId());
                user.setUserType(7);
                user.setUpdateTime(new Date());
                //更新
                userService.updateById(user);
                if (accreditationRecords.getType()==2) {
                    //修改为未制证状态
                    AccreditationRecords records = accreditationRecordsService.getById(id);
                    User user = userService.getById(records.getUserId());
                    user.setUserType(7);
                    user.setUpdateTime(new Date());
                    //更新
                    userService.updateById(user);
                //内网同步
                String s =
                    "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                        ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                        ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                        ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                        "where id = " + "'" + accreditationRecords.getId() + "';" +
                    "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);
                    //内网同步
                    String s =
                        "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                            ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                            ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                            ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                            "where id = " + "'" + accreditationRecords.getId() + "';" +
                            "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);
                }else {
                    //内网同步
                    String s =
                        "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                            ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                            ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                            ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                            "where id = " + "'" + accreditationRecords.getId() + "'";
                    FtpUtil.sqlFileUpload(s);
                }
            }else {
                //内网同步
                String s =
src/main/java/org/springblade/modules/accreditation/entity/AccreditationRecords.java
@@ -96,4 +96,11 @@
     */
    @TableField("audit_user")
    private Long auditUser;
    /**
     * 证书打印时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date paperTime;
}
src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
@@ -128,7 +128,7 @@
    </select>
    <!--导出保安员证信息-->
    <!--导出保安员证信息(上岗证)-->
    <select id="exportSecurityPaperList" resultType="org.springblade.modules.accreditation.vo.AccreditationRecordsVo">
        SELECT
        sar.*,
@@ -214,6 +214,9 @@
        <if test="accreditationRecords.isAvatar==2">
            and (bu.avatar is null or bu.avatar="")
        </if>
        <if test="accreditationRecords.auditStatus!=null">
            and sar.audit_status = #{accreditationRecords.auditStatus}
        </if>
        <if test="accreditationRecords.startTime!=null and accreditationRecords.startTime!='' and accreditationRecords.startTime!='undefined'">
            and sar.create_time &gt;= #{accreditationRecords.startTime}
        </if>
src/main/java/org/springblade/modules/accreditation/service/impl/AccreditationRecordsServiceImpl.java
@@ -134,6 +134,8 @@
                AccreditationRecords accreditationRecords1 = new AccreditationRecords();
                accreditationRecords1.setId(accreditationRecordsVo.getId());
                accreditationRecords1.setStatus(2);
                //记录导出时间为制证时间
                accreditationRecords1.setPaperTime(new Date());
                //修改
                this.updateById(accreditationRecords1);
src/main/java/org/springblade/modules/equipage/controller/fixed.java
@@ -61,6 +61,7 @@
            params.put("acc", equipmentCode);
            String res = null;
            res = HttpReqUtil.getInstance().doPost(url, params, null);
            System.out.println("res = " + res);
            JSONArray jsonArray = JSONArray.fromObject(res);
            JSONArray sortedJsonArray = new JSONArray();
            List<JSONObject> jsonValues = new ArrayList<JSONObject>();
src/main/java/org/springblade/modules/jurisdiction/controller/JurisdictionController.java
@@ -105,6 +105,7 @@
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "树形结构", notes = "树形结构")
    public R<List<JurisdictionVO>> tree(String tenantId, BladeUser bladeUser) {
        tenantId = "000000";
        List<JurisdictionVO> tree = jurisdictionService.tree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()));
        return R.data(tree);
    }
@@ -116,6 +117,7 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "懒加载树形结构", notes = "树形结构")
    public R<List<JurisdictionVO>> lazyTree(String tenantId, Long parentId, BladeUser bladeUser) {
        bladeUser.setTenantId("000000");
        List<JurisdictionVO> tree = jurisdictionService.lazyTree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), parentId);
        return R.data(tree);
    }
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -661,6 +661,8 @@
            AccreditationRecords accreditationRecords1 = collect.get(0);
            //修改为已制证状态
            accreditationRecords1.setStatus(2);
            //记录打印时间
            accreditationRecords1.setPaperTime(new Date());
            //更新
            accreditationRecordsService.updateById(accreditationRecords1);
            //同步