| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.accreditation.excel.ExportSecurityPaperExcel; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.accreditation.entity.AccreditationRecords; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 审核 |
| | | * @param accreditationRecords 制证记录信息对象 |
| | | */ |
| | | @PostMapping("/audit") |
| | | public R audit(@RequestBody AccreditationRecords accreditationRecords){ |
| | | accreditationRecords.setAuditTime(new Date()); |
| | | boolean b = accreditationRecordsService.updateById(accreditationRecords); |
| | | //内网同步 |
| | | 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); |
| | | //返回 |
| | | return R.status(b); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 批量审核 |
| | | * @param accreditationRecords 制证记录信息对象 |
| | | */ |
| | | @PostMapping("/batchAudit") |
| | | public R batchAudit(@RequestBody AccreditationRecordsVo accreditationRecords){ |
| | | //取出申请id |
| | | String ids = accreditationRecords.getIds(); |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | //批量审核 |
| | | list.forEach(id->{ |
| | | accreditationRecords.setId(Long.parseLong(id)); |
| | | accreditationRecords.setAuditTime(new Date()); |
| | | accreditationRecordsService.updateById(accreditationRecords); |
| | | //内网同步 |
| | | 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); |
| | | }); |
| | | //返回 |
| | | return R.status(true); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date accreditationTime; |
| | | |
| | | /** |
| | | * 状态 1:上岗证 2:证书 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 审核状态 1:待审核 2:审核通过 3:审核不通过 |
| | | */ |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | |
| | | /** |
| | | * 审核时间 |
| | | */ |
| | | @TableField("audit_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date auditTime; |
| | | |
| | | /** |
| | | * 审核详情 |
| | | */ |
| | | @TableField("audit_detail") |
| | | private String auditDetail; |
| | | |
| | | /** |
| | | * 审核人员id |
| | | */ |
| | | @TableField("audit_user") |
| | | private Long auditUser; |
| | | } |
| | |
| | | bu.sex,bu.cardid idCardNo, |
| | | bu.securitynumber securityNumber, |
| | | bu.avatar, |
| | | ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age |
| | | ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age, |
| | | bu1.real_name applyName, |
| | | bt1.dept_name applyUnit, |
| | | bu.registered, |
| | | bu.user_type userType |
| | | FROM |
| | | sys_accreditation_records sar |
| | | left join |
| | |
| | | blade_dept bt |
| | | ON |
| | | bu.dept_id = bt.id |
| | | left join |
| | | blade_user bu1 |
| | | on |
| | | sar.create_user = bu1.id |
| | | LEFT JOIN |
| | | blade_dept bt1 |
| | | ON |
| | | bu1.dept_id = bt1.id |
| | | WHERE |
| | | 1=1 |
| | | and bu.status = 1 |
| | |
| | | <if test="accreditationRecords.idCardNo!=null and accreditationRecords.idCardNo!=''"> |
| | | and bu.cardid like concat('%', #{accreditationRecords.idCardNo},'%') |
| | | </if> |
| | | <if test="accreditationRecords.applyUnit!=null and accreditationRecords.applyUnit!=''"> |
| | | and bt1.dept_name like concat('%', #{accreditationRecords.applyUnit},'%') |
| | | </if> |
| | | <if test="accreditationRecords.securityNumber!=null and accreditationRecords.securityNumber!=''"> |
| | | and bu.securitynumber like concat('%', #{accreditationRecords.securityNumber},'%') |
| | | </if> |
| | | <if test="accreditationRecords.status!=null"> |
| | | and sar.status = #{accreditationRecords.status} |
| | | </if> |
| | | <if test="accreditationRecords.type!=null"> |
| | | and sar.type = #{accreditationRecords.type} |
| | | </if> |
| | | <if test="accreditationRecords.auditStatus!=null"> |
| | | and sar.audit_status = #{accreditationRecords.auditStatus} |
| | | </if> |
| | | <if test="accreditationRecords.isAvatar==1"> |
| | | and bu.avatar is not null and bu.avatar!="" |
| | | </if> |
| | |
| | | records.setCreateTime(new Date()); |
| | | records.setCreateUser(accreditationRecords.getCreateUser()); |
| | | records.setStatus(1); |
| | | records.setAuditStatus(1); |
| | | records.setType(accreditationRecords.getType()); |
| | | records.setUserId(Long.parseLong(id)); |
| | | //新增 |
| | | this.save(records); |
| | | |
| | | //内网新增 |
| | | String s = "insert into sys_apply(id,user_id,create_time,create_user,status) " + |
| | | String s = "insert into sys_accreditation_records(id,user_id,create_time,create_user,status,type,audit_status) " + |
| | | "values(" + "'" + records.getId() + "'" + "," |
| | | + "'" + records.getUserId() + "'" + "," |
| | | + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(records.getCreateTime()) + "'" + "," |
| | | + "'" + records.getCreateUser() +"'" + "," |
| | | +"'" + records.getStatus() + "'" + ")"; |
| | | + "'" + records.getStatus() +"'" + "," |
| | | + "'" + records.getType() +"'" + "," |
| | | +"'" + records.getAuditStatus() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | }); |
| | | return true; |
| | |
| | | * 是否有头像 1:有 2:没有上传 |
| | | */ |
| | | private Integer isAvatar; |
| | | |
| | | /** |
| | | * 申请人姓名 |
| | | */ |
| | | private String applyName; |
| | | |
| | | /** |
| | | * 申请人单位 |
| | | */ |
| | | private String applyUnit; |
| | | |
| | | /** |
| | | * 身份证地址 |
| | | */ |
| | | private String registered; |
| | | |
| | | |
| | | /** |
| | | * 是否制证 6:是 7:否 |
| | | */ |
| | | private Integer userType; |
| | | } |
| | |
| | | @ColumnWidth(10) |
| | | private String nation; |
| | | |
| | | @ExcelProperty("住址*") |
| | | @ExcelProperty("身份证住址*") |
| | | private String registered; |
| | | |
| | | @ExcelProperty("是否持证*") |