1.单位列表查询排序修改
2.保安员证生成同时插入证件编号记录
5 files modified
7 files added
| | |
| | | import org.springblade.modules.exam.util.SecurityPaperUtil; |
| | | import org.springblade.modules.exam.vo.ExamScoreVO; |
| | | import org.springblade.modules.exam.vo.UpdateParamVo; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.securitypaper.service.SecurityPaperService; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IRoleService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | |
| | | |
| | | private final ExamPaperService examPaperService; |
| | | |
| | | private final IRoleService roleService; |
| | | private final SecurityPaperService securityPaperService; |
| | | |
| | | /** |
| | | * 自定义分页 |
| | |
| | | result = pre + (decimalFormat.format(max)); |
| | | } |
| | | user1.setSecuritynumber(result); |
| | | //发证日期 |
| | | // user1.setPaperTime(new Date()); |
| | | |
| | | //生成保安证的同时向保安证管理表中插入一条数据 |
| | | SecurityPaper securityPaper = new SecurityPaper(); |
| | | securityPaper.setUserId(user1.getId()); |
| | | securityPaper.setNumber(result); |
| | | securityPaper.setCreateTime(new Date()); |
| | | securityPaper.setIdCardNo(user.getCardid()); |
| | | securityPaper.setPeopleName(user1.getRealName()); |
| | | securityPaper.setExamId(Long.parseLong(examScore1.getExamId())); |
| | | securityPaper.setApplyId(examScore1.getApplyId()); |
| | | //新增保安员证信息 |
| | | securityPaperService.save(securityPaper); |
| | | //修改为持证保安 |
| | | user1.setHold("1"); |
| | | //分配保安角色 |
| | | // Role role = new Role(); |
| | | // role.setRoleAlias("保安"); |
| | | // Role oneRole = roleService.getOne(Condition.getQueryWrapper(role)); |
| | | // user.setRoleId(oneRole.getId().toString()); |
| | | //更新保安数据 |
| | | userService.updateById(user1); |
| | | |
| | | //数据同步 |
| | | String s1 = |
| | | "update blade_user set hold = " + "'" + user1.getHold() + "'" + |
| | | ",securitynumber = " + "'" + user1.getSecuritynumber() + "'" + |
| | | ",user_type = " + "'" + user1.getUserType() + "'" + |
| | | " " + "where id = " + "'" + user1.getId() + "'"; |
| | | |
| | | // String s1 = |
| | | // "insert into sys_security_paper(id,number,create_time,people_name,id_card_no,user_id,apply_id,exam_id) " + |
| | | // "values(" + "'" + securityPaper.getId() + "'" |
| | | // + "," + "'" + securityPaper.getNumber() +"'" |
| | | // + "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(securityPaper.getCreateTime()) +"'" |
| | | // + "," + "'" + securityPaper.getPeopleName() + "'" |
| | | // + "," + "'" + securityPaper.getIdCardNo() + "'" |
| | | // + "," + "'" + securityPaper.getUserId() + "'" |
| | | // + "," + "'" + securityPaper.getApplyId() + "'" |
| | | // + "," +"'" + securityPaper.getExamId() + "'" + ");" + |
| | | // "update blade_user set hold = " + "'" + user1.getHold() + "'" + |
| | | // ",securitynumber = " + "'" + user1.getSecuritynumber() + "'" + |
| | | // ",user_type = " + "'" + user1.getUserType() + "'" + |
| | | // " " + "where id = " + "'" + user1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | } else { |
| | |
| | | import org.springblade.modules.exam.vo.ExamResultVO; |
| | | import org.springblade.modules.exam.vo.ExamScoreVO; |
| | | import org.springblade.modules.exam.vo.UpdateParamVo; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.securitypaper.service.SecurityPaperService; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IRoleService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | |
| | | private TrainingRegistrationService trainingRegistrationService; |
| | | |
| | | @Autowired |
| | | private IRoleService roleService; |
| | | |
| | | private SecurityPaperService securityPaperService; |
| | | |
| | | @Autowired |
| | | private ExamAnswerRecordService examAnswerRecordService; |
| | |
| | | //更新保安数据 |
| | | userService.updateById(user); |
| | | |
| | | //生成保安证的同时向保安证管理表中插入一条数据 |
| | | SecurityPaper securityPaper = new SecurityPaper(); |
| | | securityPaper.setUserId(user.getId()); |
| | | securityPaper.setNumber(result); |
| | | securityPaper.setCreateTime(new Date()); |
| | | securityPaper.setIdCardNo(user.getCardid()); |
| | | securityPaper.setPeopleName(user.getRealName()); |
| | | securityPaper.setExamId(Long.parseLong(examScore.getExamId())); |
| | | securityPaper.setApplyId(examScore.getApplyId()); |
| | | //新增保安员证信息 |
| | | securityPaperService.save(securityPaper); |
| | | |
| | | String s1 = |
| | | "update blade_user set hold = " + "'" + user.getHold() + "'" + |
| | | ",securitynumber = " + "'" + user.getSecuritynumber() + "'" + |
| | | ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" + |
| | | ",user_type = " + "'" + user.getUserType() + "'" + |
| | | " " + "where id = " + "'" + user.getId() + "'"; |
| | | |
| | | // String s1 = |
| | | // "insert into sys_security_paper(id,number,create_time,people_name,id_card_no,user_id,apply_id,exam_id) " + |
| | | // "values(" + "'" + securityPaper.getId() + "'" |
| | | // + "," + "'" + securityPaper.getNumber() +"'" |
| | | // + "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(securityPaper.getCreateTime()) +"'" |
| | | // + "," + "'" + securityPaper.getPeopleName() + "'" |
| | | // + "," + "'" + securityPaper.getIdCardNo() + "'" |
| | | // + "," + "'" + securityPaper.getUserId() + "'" |
| | | // + "," + "'" + securityPaper.getApplyId() + "'" |
| | | // + "," +"'" + securityPaper.getExamId() + "'" + ");" + |
| | | // "update blade_user set hold = " + "'" + user.getHold() + "'" + |
| | | // ",securitynumber = " + "'" + user.getSecuritynumber() + "'" + |
| | | // ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" + |
| | | // ",user_type = " + "'" + user.getUserType() + "'" + |
| | | // " " + "where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | } |
| | |
| | | import org.springblade.modules.exam.service.ScoreAuditRecordsService; |
| | | import org.springblade.modules.exam.util.SecurityPaperUtil; |
| | | import org.springblade.modules.exam.vo.ScoreAuditRecordsVO; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.securitypaper.service.SecurityPaperService; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | |
| | | |
| | | @Autowired |
| | | private TrainingRegistrationService trainingRegistrationService; |
| | | |
| | | @Autowired |
| | | private SecurityPaperService securityPaperService; |
| | | |
| | | /** |
| | | * 自定义分页 |
| | |
| | | result = pre + (decimalFormat.format(count)); |
| | | } |
| | | user.setSecuritynumber(result); |
| | | //发证日期 |
| | | // user.setPaperTime(new Date()); |
| | | //修改为持证保安 |
| | | user.setHold("1"); |
| | | //更新保安数据 |
| | | userService.updateById(user); |
| | | |
| | | // String s1 = |
| | | // "update blade_user set hold = " + "'" + user.getHold() + "'" + |
| | | // ",securitynumber = " + "'" + user.getSecuritynumber() + "'" + |
| | | // ",is_train = " + "'" + user.getIsTrain() + "'" + |
| | | // " " + "where id = " + "'" + user.getId() + "'"; |
| | | // FtpUtil.sqlFileUpload(s1); |
| | | //生成保安证的同时向保安证管理表中插入一条数据 |
| | | SecurityPaper securityPaper = new SecurityPaper(); |
| | | securityPaper.setUserId(user.getId()); |
| | | securityPaper.setNumber(result); |
| | | securityPaper.setCreateTime(new Date()); |
| | | securityPaper.setIdCardNo(user.getCardid()); |
| | | securityPaper.setPeopleName(user.getRealName()); |
| | | securityPaper.setExamId(Long.parseLong(examScore.getExamId())); |
| | | securityPaper.setApplyId(examScore.getApplyId()); |
| | | //新增保安员证信息 |
| | | securityPaperService.save(securityPaper); |
| | | |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_security_paper(id,number,create_time,people_name,id_card_no,user_id,apply_id,exam_id) " + |
| | | "values(" + "'" + securityPaper.getId() + "'" |
| | | + "," + "'" + securityPaper.getNumber() +"'" |
| | | + "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(securityPaper.getCreateTime()) +"'" |
| | | + "," + "'" + securityPaper.getPeopleName() + "'" |
| | | + "," + "'" + securityPaper.getIdCardNo() + "'" |
| | | + "," + "'" + securityPaper.getUserId() + "'" |
| | | + "," + "'" + securityPaper.getApplyId() + "'" |
| | | + "," +"'" + securityPaper.getExamId() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | } else { |
| | | //不合格 |
| | |
| | | <if test="information.createDeptId!=null and information.createDeptId!=''"> |
| | | and bu.dept_id =#{information.createDeptId} |
| | | </if> |
| | | order by i.id desc |
| | | order by i.establishTime asc |
| | | </select> |
| | | |
| | | <delete id="deleteIn"> |
| New file |
| | |
| | | package org.springblade.modules.securitypaper.controller; |
| | | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.securitypaper.service.SecurityPaperService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @time 2021-12-25 |
| | | * @desc 保安员证管理控制层 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/securityPaper") |
| | | public class SecurityPaperController { |
| | | |
| | | private final SecurityPaperService securityPaperService; |
| | | |
| | | |
| | | // /** |
| | | // * 自定义分页 |
| | | // * @param query page,size |
| | | // * @param securityPaper 保安员证管理信息对象 |
| | | // */ |
| | | // @GetMapping("/page") |
| | | // public R<IPage<SecurityPaperVo>> page(SecurityPaperVo securityPaper, Query query) { |
| | | // IPage<SecurityPaperVo> pages = securityPaperService.selectSecurityPaperPage(Condition.getPage(query), securityPaper); |
| | | // return R.data(pages); |
| | | // } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param securityPaper 保安员证管理信息对象 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "新增", notes = "传入securityPaper") |
| | | public R save(@RequestBody SecurityPaper securityPaper){ |
| | | return R.data(securityPaperService.save(securityPaper)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param securityPaper 保安员证管理信息对象 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody SecurityPaper securityPaper){ |
| | | return R.status(securityPaperService.updateById(securityPaper)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | * @param securityPaper 保安员证管理信息对象 |
| | | */ |
| | | @PostMapping("/submit") |
| | | public R submit(@RequestBody SecurityPaper securityPaper){ |
| | | return R.data(securityPaperService.saveOrUpdate(securityPaper)); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param ids 保安员证管理信息ids 数组 |
| | | */ |
| | | @PostMapping("/remove") |
| | | public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
| | | return R.status(securityPaperService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param securityPaper 保安员证管理信息对象 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "详情", notes = "传入securityPaper") |
| | | public R<SecurityPaper> detail(SecurityPaper securityPaper) { |
| | | SecurityPaper detail = securityPaperService.getOne(Condition.getQueryWrapper(securityPaper)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.securitypaper.entity; |
| | | |
| | | 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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 保安员证管理实体类 |
| | | * @author zhongrj |
| | | * @time 2021-12-25 |
| | | */ |
| | | @Data |
| | | @TableName("sys_security_paper") |
| | | public class SecurityPaper implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 制证记录主键id,非自增 |
| | | */ |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | |
| | | /** |
| | | * 保安证编号 |
| | | */ |
| | | private String number; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField("create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 人员姓名 |
| | | */ |
| | | @TableField("people_name") |
| | | private String peopleName; |
| | | |
| | | /** |
| | | * 人员身份证号码 |
| | | */ |
| | | @TableField("id_card_no") |
| | | private String idCardNo; |
| | | |
| | | |
| | | /** |
| | | * user_id |
| | | */ |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 报名id |
| | | */ |
| | | @TableField("apply_id") |
| | | private Long applyId; |
| | | |
| | | /** |
| | | * 考试id |
| | | */ |
| | | @TableField("exam_id") |
| | | private Long examId; |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.securitypaper.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | |
| | | |
| | | /** |
| | | * 保安员证管理Mapper 接口 |
| | | * @author zhongrj |
| | | */ |
| | | public interface SecurityPaperMapper extends BaseMapper<SecurityPaper> { |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.securitypaper.mapper.SecurityPaperMapper"> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.securitypaper.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | |
| | | /** |
| | | * 保安员证管理服务类 |
| | | * @author zhongrj |
| | | */ |
| | | public interface SecurityPaperService extends IService<SecurityPaper> { |
| | | |
| | | } |
| New file |
| | |
| | | |
| | | package org.springblade.modules.securitypaper.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.securitypaper.mapper.SecurityPaperMapper; |
| | | import org.springblade.modules.securitypaper.service.SecurityPaperService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 保安员证管理服务实现类 |
| | | * @author zhongrj |
| | | * @since 2021-12-25 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class SecurityPaperServiceImpl extends ServiceImpl<SecurityPaperMapper, SecurityPaper> implements SecurityPaperService { |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.securitypaper.vo; |
| | | |
| | | import lombok.Data; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 保安员证管理vo |
| | | * @author zhongrj |
| | | * @since 2021-12-25 |
| | | */ |
| | | @Data |
| | | public class SecurityPaperVo extends SecurityPaper implements Serializable { |
| | | |
| | | } |
| | |
| | | |
| | | <!--计算保安人员年龄--> |
| | | <select id="getUserAgeById" resultType="org.springblade.modules.system.vo.UserVO"> |
| | | select id,ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING(cardid,7,4),0) age,securitynumber,cardid |
| | | select id,real_name realName,ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING(cardid,7,4),0) age,securitynumber,cardid |
| | | from |
| | | blade_user |
| | | where |