1.保安单位树接口修改
2.现场保安员,单位检查字段修改,接口修改
3.缴费记录接口修改
4.出资人,管理人员字段调整,接口修改,导出新增示例
5.考试中题目返回去除答案
| | |
| | | import java.net.URL; |
| | | import java.util.HashMap; |
| | | |
| | | import static com.google.zxing.client.j2se.MatrixToImageConfig.BLACK; |
| | | import static com.google.zxing.client.j2se.MatrixToImageConfig.WHITE; |
| | | import static org.bouncycastle.asn1.x500.style.RFC4519Style.cn; |
| | | |
| | | /** |
| | |
| | | hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); |
| | | |
| | | BitMatrix bitMatrix =qrCodeWriter.encode(text,BarcodeFormat.QR_CODE, width, height,hints); |
| | | //删除白边 |
| | | // BufferedImage bufferedImage = deleteWhite(bitMatrix); |
| | | |
| | | //BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height); |
| | | |
| | | ByteArrayOutputStream pngOutputStream = new ByteArrayOutputStream(); |
| | |
| | | return pngOutputStream.toByteArray(); |
| | | } |
| | | |
| | | /** |
| | | * 去白边的话,调用这个方法 |
| | | * @param matrix |
| | | * @return |
| | | */ |
| | | private static BufferedImage deleteWhite(BitMatrix matrix) { |
| | | int[] rec = matrix.getEnclosingRectangle(); |
| | | int resWidth = rec[2] + 1; |
| | | int resHeight = rec[3] + 1; |
| | | |
| | | BitMatrix resMatrix = new BitMatrix(resWidth, resHeight); |
| | | resMatrix.clear(); |
| | | for (int i = 0; i < resWidth; i++) { |
| | | for (int j = 0; j < resHeight; j++) { |
| | | if (matrix.get(i + rec[0], j + rec[1])) |
| | | resMatrix.set(i, j); |
| | | } |
| | | } |
| | | |
| | | int width = resMatrix.getWidth(); |
| | | int height = resMatrix.getHeight(); |
| | | BufferedImage image = new BufferedImage(width, height, |
| | | BufferedImage.TYPE_INT_RGB); |
| | | for (int x = 0; x < width; x++) { |
| | | for (int y = 0; y < height; y++) { |
| | | image.setRGB(x, y, resMatrix.get(x, y) ? BLACK |
| | | : WHITE); |
| | | } |
| | | } |
| | | return image; |
| | | } |
| | | |
| | | |
| | | // private static BitMatrix deleteWhite(BitMatrix matrix) { |
| | | // int[] rec = matrix.getEnclosingRectangle(); |
| | | // int resWidth = rec[2] + 1; |
| | | // int resHeight = rec[3] + 1; |
| | | // |
| | | // BitMatrix resMatrix = new BitMatrix(resWidth, resHeight); |
| | | // resMatrix.clear(); |
| | | // for (int i = 0; i < resWidth; i++) { |
| | | // for (int j = 0; j < resHeight; j++) { |
| | | // if (matrix.get(i + rec[0], j + rec[1])) |
| | | // resMatrix.set(i, j); |
| | | // } |
| | | // } |
| | | // return resMatrix; |
| | | // } |
| | | |
| | | } |
| | |
| | | <if test="examPayment.workerId!=null and examPayment.workerId!=''"> |
| | | and se.worker_id like concat('%', #{examPayment.workerId},'%') |
| | | </if> |
| | | <if test="examPayment.deptId!=null and examPayment.deptId!=''"> |
| | | and bd.id = #{examPayment.deptId} |
| | | </if> |
| | | <if test="examPayment.deptName!=null and examPayment.deptName!=''"> |
| | | and bd.dept_name like concat('%', #{examPayment.deptName},'%') |
| | | </if> |
| | |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 部门id |
| | | */ |
| | | private String deptId; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入coinspect") |
| | | public R save(@Valid @RequestBody Coinspect coinspect) throws Exception { |
| | | coinspect.setReviewtime(new Date()); |
| | | coinspectService.save(coinspect); |
| | | String url = ""; |
| | | if (coinspect.getUrl()!=null && !"".equals(coinspect.getUrl())){ |
| | |
| | | } |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_coinspect(id,name,sName,deptName,reviewTime,insid,results,url) " + |
| | | "insert into sys_coinspect(id,examiner_id,reviewed_dept_id,examiner_dept_id,reviewTime,insid,results,url) " + |
| | | "values(" + "'" + coinspect.getId() + "'" + "," + |
| | | "'" + coinspect.getName() + "'" + "," + |
| | | "'" + coinspect.getSname() + "'" + "," + |
| | | "'" + coinspect.getSname() + "'" + "," + |
| | | "'" + coinspect.getDeptname() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(coinspect.getReviewtime()) + "'" + "," + |
| | | "'" + coinspect.getExaminerId() + "'" + "," + |
| | | "'" + coinspect.getReviewedDeptId() + "'" + "," + |
| | | "'" + coinspect.getExaminerDeptId() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," + |
| | | "'" + coinspect.getInsid() + "'" + "," + |
| | | "'" + coinspect.getResults() + "'" + "," + |
| | | "'" + coinspect.getUrl() + "'" + ")"; |
| | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 实体类 |
| | | * 单位检查记录实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-08-03 |
| | |
| | | /** |
| | | * 检查人姓名 |
| | | */ |
| | | @ApiModelProperty(value = "检查人姓名") |
| | | private String name; |
| | | @ApiModelProperty(value = "检查人id") |
| | | @TableField("examiner_id") |
| | | private String examinerId; |
| | | /** |
| | | * 被检查单位名称 |
| | | */ |
| | | @ApiModelProperty(value = "被检查单位名称") |
| | | @TableField("sName") |
| | | private String sname; |
| | | @ApiModelProperty(value = "被检查单位名称ID") |
| | | @TableField("reviewed_dept_id") |
| | | private String reviewedDeptId; |
| | | /** |
| | | * 检查人单位 |
| | | */ |
| | | @ApiModelProperty(value = "检查人单位") |
| | | @TableField("deptName") |
| | | private String deptname; |
| | | @ApiModelProperty(value = "检查人单位ID") |
| | | @TableField("examiner_dept_id") |
| | | private String examinerDeptId; |
| | | |
| | | |
| | | /** |
| | | * 检查日期 |
| | | */ |
| | | @ApiModelProperty(value = "检查日期") |
| | | @TableField("reviewTime") |
| | | private String reviewtime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date reviewtime; |
| | | |
| | | /** |
| | | * 检查内容 |
| | | */ |
| | | @ApiModelProperty(value = "检查内容") |
| | | private String insid; |
| | | |
| | | /** |
| | | * 检查结果 |
| | | */ |
| | | @ApiModelProperty(value = "检查结果") |
| | | private String results; |
| | | |
| | | |
| | | |
| | | private String url; |
| | | |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.coinspect.entity.Coinspect; |
| | | import org.springblade.modules.coinspect.vo.CoinspectVO; |
| | | |
| | |
| | | * @param coinspect |
| | | * @return |
| | | */ |
| | | List<CoinspectVO> selectCoinspectPage(IPage page, CoinspectVO coinspect); |
| | | List<CoinspectVO> selectCoinspectPage(IPage page, @Param("coinspect") CoinspectVO coinspect); |
| | | |
| | | } |
| | |
| | | <mapper namespace="org.springblade.modules.coinspect.mapper.CoinspectMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="coinspectResultMap" type="org.springblade.modules.coinspect.entity.Coinspect"> |
| | | <resultMap id="coinspectResultMap" type="org.springblade.modules.coinspect.vo.CoinspectVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="sName" property="sname"/> |
| | | <result column="deptName" property="deptname"/> |
| | | <result column="examiner_id" property="examinerId"/> |
| | | <result column="reviewed_dept_id" property="reviewedDeptId"/> |
| | | <result column="examiner_dept_id" property="examinerDeptId"/> |
| | | <result column="reviewTime" property="reviewtime"/> |
| | | <result column="insid" property="insid"/> |
| | | <result column="results" property="results"/> |
| | |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectCoinspectPage" resultMap="coinspectResultMap"> |
| | | select * from sys_coinspect where is_deleted = 0 |
| | | <select id="selectCoinspectPage" resultType="org.springblade.modules.coinspect.vo.CoinspectVO"> |
| | | select |
| | | sc.*, |
| | | bu.real_name realName, |
| | | bd.dept_name examinerDeptName, |
| | | bd1.dept_name reviewedDeptName |
| | | from |
| | | sys_coinspect sc |
| | | left join |
| | | blade_user bu |
| | | on |
| | | bu.id = sc.examiner_id |
| | | left join |
| | | blade_dept bd |
| | | on |
| | | bd.id = sc.examiner_dept_id |
| | | left join |
| | | blade_dept bd1 |
| | | on |
| | | bd1.id = sc.reviewed_dept_id |
| | | where 1 = 1 |
| | | <if test="coinspect.realName!=null and coinspect.realName!=''"> |
| | | bu.real_name like concat('%',#{coinspect.realName},'%') |
| | | </if> |
| | | <if test="coinspect.examinerDeptName!=null and coinspect.examinerDeptName!=''"> |
| | | bd.dept_name like concat('%',#{coinspect.examinerDeptName},'%') |
| | | </if> |
| | | <if test="coinspect.reviewedDeptName!=null and coinspect.reviewedDeptName!=''"> |
| | | bd1.dept_name like concat('%',#{coinspect.reviewedDeptName},'%') |
| | | </if> |
| | | <if test="coinspect.results!=null and coinspect.results!=''"> |
| | | sc.results like concat('%',#{coinspect.results},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | public class CoinspectVO extends Coinspect { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 检查人名称 |
| | | */ |
| | | private String realName; |
| | | |
| | | /** |
| | | * 检查人单位名称 |
| | | */ |
| | | private String examinerDeptName; |
| | | |
| | | /** |
| | | * 被检查单位名称 |
| | | */ |
| | | private String reviewedDeptName; |
| | | |
| | | } |
| | |
| | | package org.springblade.modules.exam.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.codec.Charsets; |
| | | import org.springblade.common.excel.RowWriteHandler; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.sql.Array; |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | examScore.setQualified(0); |
| | | //正式考试通过生成保安证编号 |
| | | ExamPaper paper = examPaperService.getById(examScore.getExamId()); |
| | | if (paper.getExamType() == 1) { |
| | | // if (paper.getExamType() == 1) { |
| | | //去生成保安证编号 |
| | | String pre = SecurityPaperUtil.getSecurityPaper(); |
| | | //查询当前年份已有的保安证编号 |
| | |
| | | ",paper_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime()) + "'" + |
| | | " " + "where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | // } |
| | | } else { |
| | | //不合格 |
| | | examScore.setQualified(1); |
| | |
| | | */ |
| | | @GetMapping("export-template") |
| | | @ApiOperation(value = "导出模板") |
| | | public void exportUser(HttpServletResponse response) { |
| | | public void exportExamScore(HttpServletResponse response)throws IOException { |
| | | List<ExamScoreExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "实操成绩数据模板", "实操成绩数据表", list, ExamScoreExcel.class); |
| | | ExamScoreExcel examScoreExcel = new ExamScoreExcel(); |
| | | examScoreExcel.setExamName("2021年10月**日保安员证培训考试"); |
| | | examScoreExcel.setName("张三"); |
| | | examScoreExcel.setIdCardNo("360XXX19XXXXXX****"); |
| | | examScoreExcel.setCandidateNo("2110**m0001"); |
| | | examScoreExcel.setLearnGrade(80); |
| | | list.add(examScoreExcel); |
| | | |
| | | ExamScoreExcel examScoreExcel1 = new ExamScoreExcel(); |
| | | examScoreExcel1.setExamName("2021年10月**日保安员证培训考试"); |
| | | examScoreExcel1.setName("李四"); |
| | | examScoreExcel1.setIdCardNo("360XXX19XXXXXX****"); |
| | | examScoreExcel1.setCandidateNo("2110**m0002"); |
| | | examScoreExcel1.setLearnGrade(88); |
| | | list.add(examScoreExcel1); |
| | | // ExcelUtil.export(response, "实操成绩数据模板", "实操成绩数据表", list, ExamScoreExcel.class); |
| | | String fileName = null; |
| | | try { |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name()); |
| | | fileName = URLEncoder.encode("实操成绩数据模板", Charsets.UTF_8.name()); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | //修改单元格格式为文本格式 |
| | | EasyExcel.write(response.getOutputStream(), ExamScoreExcel.class).sheet("实操成绩数据表").registerWriteHandler(new RowWriteHandler()).doWrite(list); |
| | | } catch (Throwable var6) { |
| | | throw var6; |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "导出成绩") |
| | | public void exportExamScore(HttpServletResponse response,ExamScoreVO examScoreVO) { |
| | | System.out.println("examScoreVO = " + examScoreVO); |
| | | //按条件查询成绩数据 |
| | | List<ExportExamScoreExcel> examScoreExcels = examScoreService.exportExamScoreList(examScoreVO); |
| | | //导出成绩集合数据 |
| | |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class ExamScoreExcel implements Serializable { |
| | | public class ExamScoreExcel implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @ColumnWidth(25) |
| | | @ExcelProperty("考试名称") |
| | | @ExcelProperty("考试名称*") |
| | | private String examName; |
| | | |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("姓名") |
| | | @ExcelProperty("姓名*") |
| | | private String name; |
| | | |
| | | |
| | | @ColumnWidth(25) |
| | | @ExcelProperty("身份证号码") |
| | | @ExcelProperty("身份证号码*") |
| | | private String idCardNo; |
| | | |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("准考证号*") |
| | | private String candidateNo; |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("实操得分") |
| | | @ExcelProperty("实操得分*") |
| | | private Integer learnGrade; |
| | | |
| | | |
| | |
| | | |
| | | <!--查询当前人员当前考试的考试题目信息--> |
| | | <select id="getExaminationSubjectList" resultType="org.springblade.modules.exam.vo.ExamSubjectChoicesVO"> |
| | | SELECT esc.* FROM exam_subject_choices esc |
| | | SELECT |
| | | esc.id,esc.category_id,esc.subject_name,esc.choices_type,esc.score,esc.level |
| | | FROM |
| | | exam_subject_choices esc |
| | | left join |
| | | exam_examination_subject ees |
| | | on |
| | |
| | | <id property="subjectName" column="subject_name"/> |
| | | <id property="choicesType" column="choices_type"/> |
| | | <id property="score" column="score"/> |
| | | <id property="analysis" column="analysis"/> |
| | | <id property="answer" column="answer"/> |
| | | <id property="level" column="level"/> |
| | | <id property="creator" column="creator"/> |
| | | <id property="createDate" column="create_date"/> |
| | | <id property="modifier" column="modifier"/> |
| | | <id property="modifyDate" column="modify_date"/> |
| | | <id property="delFlag" column="del_flag"/> |
| | | <id property="applicationCode" column="application_code"/> |
| | | <id property="tenantCode" column="tenant_code"/> |
| | | <id property="tktype" column="tktype"/> |
| | | <result column="id" property="id"/> |
| | | <collection property="examSubjectOptions" javaType="java.util.List" ofType="org.springblade.modules.exam.entity.ExamSubjectOption" autoMapping="true"> |
| | | <id property="id" column="eso_id"/> |
| | |
| | | </resultMap> |
| | | |
| | | |
| | | <!--选择题详情信息--> |
| | | <!--题目详情信息--> |
| | | <select id="selectExamSubjectChoicesInfo" resultMap="ExamSubjectChoicesInfoMap"> |
| | | SELECT |
| | | esc.*, |
| | | esc.id,esc.category_id,esc.subject_name,esc.choices_type,esc.score,esc.level, |
| | | eso.id eso_id,eso.subject_choices_id,eso.option_name,eso.option_content,eso.creator, |
| | | eso.create_date,eso.modifier,eso.modify_date,eso.del_flag,eso.application_code,eso.tenant_code |
| | | FROM |
| | |
| | | //新增 |
| | | // examExaminationSubjectService.save(ksxtSginup); |
| | | list.add(ksxtSginup); |
| | | //将题目答案设置为空字符串,不让前端看到 |
| | | examSubjectChoicesVO.setAnswer(""); |
| | | }); |
| | | //批量新增 |
| | | baseMapper.insertBatch(list); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.apply.entity.Apply; |
| | |
| | | examScoreExcelList.forEach(examScoreExcel -> { |
| | | if (null!=examScoreExcel.getLearnGrade() && null!=examScoreExcel.getIdCardNo() && examScoreExcel.getIdCardNo()!=""){ |
| | | //使用考试名称匹配考试信息 |
| | | ExamPaper examPaper = examPaperService.getExamInfoByExamName(examScoreExcel.getExamName()); |
| | | // ExamPaper examPaper = examPaperService.getExamInfoByExamName(examScoreExcel.getExamName()); |
| | | //查询出成绩数据 |
| | | ExamScore examScore = baseMapper.getExamScoreInfoByIdCardNo(examScoreExcel.getIdCardNo(),examPaper.getId()); |
| | | // ExamScore examScore = baseMapper.getExamScoreInfoByIdCardNo(examScoreExcel.getIdCardNo(),examPaper.getId()); |
| | | //根据身份证号查询用户 |
| | | User user0 = userService.getUserInfoByIdCardNo(examScoreExcel.getIdCardNo()); |
| | | if (null==user0){ |
| | | throw new ServiceException("用户:["+examScoreExcel.getIdCardNo()+"]不存在"); |
| | | } |
| | | ExamScore examScore1 = new ExamScore(); |
| | | examScore1.setCandidateNo(examScoreExcel.getCandidateNo()); |
| | | examScore1.setUserId(user0.getId().toString()); |
| | | //根据准考证号和用户id查询考试成绩 |
| | | ExamScore examScore = this.getOne(Condition.getQueryWrapper(examScore1)); |
| | | if (null!=examScore) { |
| | | //查询当前保安信息 |
| | | UserVO user = userService.getUserAgeById(Long.parseLong(examScore.getUserId())); |
| | |
| | | //合格 |
| | | examScore.setQualified(0); |
| | | //正式考试通过生成保安证编号 |
| | | if (examPaper.getExamType()==1) { |
| | | // if (examPaper.getExamType()==1) { |
| | | //去生成保安证编号 |
| | | String pre = SecurityPaperUtil.getSecurityPaper(); |
| | | //查询当前年份已有的保安证编号 |
| | |
| | | ",paper_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime()) + "'" + |
| | | " " +"where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | // } |
| | | } else { |
| | | //不合格 |
| | | examScore.setQualified(1); |
| | |
| | | public R save(@Valid @RequestBody Member member) throws Exception { |
| | | boolean save = memberService.save(member); |
| | | String s1 = |
| | | "insert into sys_member(id,name,post,cardid,cell,creditCode) " + |
| | | "insert into sys_member(id,name,post,cardid,cell,creditCode,dept_id) " + |
| | | "values(" + "'" + member.getId() + "'" + "," + |
| | | "'" + member.getName() + "'" + "," + |
| | | "'" + member.getPost() + "'" + "," + |
| | | "'" + member.getCardid() + "'" + "," + |
| | | "'" + member.getCell() + "'"+"," + |
| | | "'" + member.getCreditcode() + "'"+")"; |
| | | "'" + member.getCreditcode() + "'"+"," + |
| | | "'" + member.getDeptId() + "'"+")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.status(save); |
| | | } |
| | |
| | | ",cell = " + "'" + member.getCell() + "'" + |
| | | ",cardid = " + "'" + member.getCardid() + "'" + |
| | | ",creditCode = " + "'" + member.getCreditcode() + "'" + |
| | | ",dept_id = " + "'" + member.getDeptId() + "'" + |
| | | " " + "where id = " + "'" + member.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.status(b); |
| | |
| | | public void exportMember(HttpServletResponse response) { |
| | | List<memberExcel> list = new ArrayList<>(); |
| | | memberExcel member = new memberExcel(); |
| | | member.setCreditcode("xx12351214112"); |
| | | member.setDeptId("xxx保安服务有限公司"); |
| | | member.setName("张三"); |
| | | member.setPost("经理"); |
| | | member.setCardid("360***********0001"); |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date rtime; |
| | | |
| | | /** |
| | | * 公司id |
| | | */ |
| | | @ApiModelProperty(value = "公司id") |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | } |
| | |
| | | public class memberExcel implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("统一社会信用代码") |
| | | private String creditcode; |
| | | @ColumnWidth(30) |
| | | @ExcelProperty("保安公司名称") |
| | | private String deptId; |
| | | |
| | | @ExcelProperty("姓名") |
| | | private String name; |
| | |
| | | <result column="shareholdingratio" property="shareholdingratio"/> |
| | | <result column="creditCode" property="creditcode"/> |
| | | <result column="rtime" property="rtime"/> |
| | | <result column="dept_id" property="deptId"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | <if test="member.creditcode!=null and member.creditcode!=''" > |
| | | and creditCode=#{member.creditcode} |
| | | </if> |
| | | <if test="member.deptId!=null and member.deptId!=''" > |
| | | and dept_id=#{member.deptId} |
| | | </if> |
| | | <if test="member.name!=null and member.name!=''" > |
| | | and name like concat ('%',#{member.name},'%') |
| | | </if> |
| | | <if test="member.post!=null and member.post!=''" > |
| | | and post like concat ('%',#{member.post},'%') |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.member.entity.Member; |
| | | import org.springblade.modules.member.excel.memberExcel; |
| | |
| | | import org.springblade.modules.member.service.IMemberService; |
| | | import org.springblade.modules.member.vo.MemberVO; |
| | | import org.springblade.modules.shareholder.entity.Shareholder; |
| | | import org.springblade.modules.system.service.IUserDeptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | |
| | | @Service |
| | | public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements IMemberService { |
| | | |
| | | @Autowired |
| | | private IUserDeptService userDeptService; |
| | | |
| | | @Override |
| | | public IPage<MemberVO> selectMemberPage(IPage<MemberVO> page, MemberVO member) { |
| | | return page.setRecords(baseMapper.selectMemberPage(page, member)); |
| | |
| | | public void importmember(List<memberExcel> data, Boolean isCovered) { |
| | | data.forEach(memberExcel -> { |
| | | Member member = Objects.requireNonNull(BeanUtil.copy(memberExcel, Member.class)); |
| | | String deptId = userDeptService.selectIn(memberExcel.getDeptId()); |
| | | if (null==deptId || deptId==""){ |
| | | throw new ServiceException("公司名:["+memberExcel.getDeptId()+"]不存在!"); |
| | | } |
| | | member.setDeptId(deptId); |
| | | try { |
| | | member.setRtime(new SimpleDateFormat("yyyy/MM/dd").parse(memberExcel.getRtime())); |
| | | } catch (ParseException e) { |
| | |
| | | import org.springblade.common.config.FtpConfig; |
| | | import org.springblade.common.utils.FileUtil; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.oss.model.BladeFile; |
| | | import org.springblade.core.oss.model.OssFile; |
| | | import org.springblade.core.secure.annotation.PreAuth; |
| | |
| | | String fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(Locale.US); |
| | | //判断文件是不是zip类型 |
| | | if(!fileType.equals("zip")){ |
| | | map.put("data","上传文件类型不符!"); |
| | | return R.data(map); |
| | | // map.put("data","上传文件类型不符!"); |
| | | // return R.data(map); |
| | | throw new ServiceException("上传文件类型不符!必须是 zip 压缩文件格式!"); |
| | | } |
| | | //FileConfig.localtion是配置文件和config类生产的,测试demo可以直接把FileConfig.localtion替换成D:/test |
| | | String uuid = UUID.randomUUID().toString(); |
| | |
| | | String fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(Locale.US); |
| | | //判断文件是不是zip类型 |
| | | if(!fileType.equals("zip")){ |
| | | map.put("data","上传文件类型不符!"); |
| | | return R.data(map); |
| | | // map.put("data","上传文件类型不符!"); |
| | | // return R.data(map); |
| | | throw new ServiceException("上传文件类型不符!必须是 zip 压缩文件格式!"); |
| | | } |
| | | //FileConfig.localtion是配置文件和config类生产的,测试demo可以直接把FileConfig.localtion替换成D:/test |
| | | String uuid = UUID.randomUUID().toString(); |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入seinspect") |
| | | public R save(@Valid @RequestBody Seinspect seinspect) throws Exception { |
| | | seinspect.setReviewtime(new Date()); |
| | | seinspectService.save(seinspect); |
| | | String url = ""; |
| | | if (seinspect.getUrl()!=null&& !"".equals(seinspect.getUrl())){ |
| | |
| | | } |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_seinspect(id,realName,carid,sName,inspectman,deptName,reviewTime,insid,examination_type,url,jid,deptid,jurisdiction) " + |
| | | "insert into sys_seinspect(id,reviewTime,content,result,url,examiner_dept_id,examiner_id,jurisdiction,security_id) " + |
| | | "values(" + "'" + seinspect.getId() + "'" + "," + |
| | | "'" + seinspect.getRealname() + "'" + "," + |
| | | "'" + seinspect.getCarid() + "'" + "," + |
| | | "'" + seinspect.getSname() + "'" + "," + |
| | | "'" + seinspect.getInspectman() + "'" + "," + |
| | | "'" + seinspect.getDeptname() + "'" + "," + |
| | | "'" + seinspect.getReviewtime() + "'" + "," + |
| | | "'" + seinspect.getInsid() + "'" + "," + |
| | | "'" + seinspect.getExaminationType() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," + |
| | | "'" + seinspect.getContent() + "'" + "," + |
| | | "'" + seinspect.getResult() + "'" + "," + |
| | | "'" + seinspect.getUrl() + "'" + "," + |
| | | "'" + seinspect.getJid() + "'" + "," + |
| | | "'" + seinspect.getDeptid() + "'" + "," + |
| | | "'" +seinspect.getJurisdiction() + "'" + ")"; |
| | | "'" + seinspect.getExaminerDeptId() + "'" + "," + |
| | | "'" + seinspect.getExaminerId() + "'" + "," + |
| | | "'" + seinspect.getJurisdiction() + "'" + "," + |
| | | "'" + seinspect.getSecurityId() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.success("成功"); |
| | | } |
| | |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 保安员姓名 |
| | | */ |
| | | @ApiModelProperty(value = "保安员姓名") |
| | | @TableField("realName") |
| | | private String realname; |
| | | /** |
| | | * 保安员身份证号 |
| | | */ |
| | | @ApiModelProperty(value = "保安员身份证号") |
| | | private String carid; |
| | | /** |
| | | * 保安员单位 |
| | | */ |
| | | @ApiModelProperty(value = "保安员单位") |
| | | @TableField("sName") |
| | | private String sname; |
| | | /** |
| | | * 检查人姓名 |
| | | */ |
| | | @ApiModelProperty(value = "检查人姓名") |
| | | private String inspectman; |
| | | /** |
| | | * 检查人单位 |
| | | */ |
| | | @ApiModelProperty(value = "检查人单位") |
| | | @TableField("deptName") |
| | | private String deptname; |
| | | |
| | | /** |
| | | * 检查日期 |
| | | */ |
| | | @ApiModelProperty(value = "检查日期") |
| | | @TableField("reviewTime") |
| | | private String reviewtime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date reviewtime; |
| | | |
| | | /** |
| | | * 检查内容 |
| | | */ |
| | | @ApiModelProperty(value = "检查内容") |
| | | private String insid; |
| | | private String content; |
| | | /** |
| | | * 检查结果 |
| | | */ |
| | | @ApiModelProperty(value = "检查结果") |
| | | private String examinationType; |
| | | private String result; |
| | | |
| | | private String url; |
| | | private String jid; |
| | | private String deptid; |
| | | |
| | | /** |
| | | * 检查人单位id |
| | | */ |
| | | @TableField("examiner_dept_id") |
| | | private String examinerDeptId; |
| | | |
| | | /** |
| | | * 检查人id |
| | | */ |
| | | @TableField("examiner_id") |
| | | private String examinerId; |
| | | |
| | | private String jurisdiction; |
| | | |
| | | /** |
| | | * 保安员姓名 |
| | | */ |
| | | @ApiModelProperty(value = "保安员姓名") |
| | | @TableField("security_id") |
| | | private String securityId; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.seinspect.entity.Seinspect; |
| | | import org.springblade.modules.seinspect.vo.SeinspectVO; |
| | | |
| | |
| | | * @param seinspect |
| | | * @return |
| | | */ |
| | | List<SeinspectVO> selectSeinspectPage(IPage page, SeinspectVO seinspect); |
| | | List<SeinspectVO> selectSeinspectPage(IPage page, @Param("seinspect") SeinspectVO seinspect); |
| | | |
| | | } |
| | |
| | | <mapper namespace="org.springblade.modules.seinspect.mapper.SeinspectMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="seinspectResultMap" type="org.springblade.modules.seinspect.entity.Seinspect"> |
| | | <id column="id" property="id"/> |
| | | <result column="realName" property="realname"/> |
| | | <result column="carid" property="carid"/> |
| | | <result column="sName" property="sname"/> |
| | | <result column="inspectman" property="inspectman"/> |
| | | <result column="deptName" property="deptname"/> |
| | | <result column="reviewTime" property="reviewtime"/> |
| | | <result column="insid" property="insid"/> |
| | | <result column="examination_type" property="examinationType"/> |
| | | <result column="url" property="url"/> |
| | | <result column="jid" property="jid"/> |
| | | <result column="deptid" property="deptid"/> |
| | | <result column="jurisdiction" property="jurisdiction"/> |
| | | <result column="url" property="url"/> |
| | | </resultMap> |
| | | <!-- <resultMap id="seinspectResultMap" type="org.springblade.modules.seinspect.entity.Seinspect">--> |
| | | <!-- <id column="id" property="id"/>--> |
| | | <!-- <result column="realName" property="realname"/>--> |
| | | <!-- <result column="carid" property="carid"/>--> |
| | | <!-- <result column="sName" property="sname"/>--> |
| | | <!-- <result column="inspectman" property="inspectman"/>--> |
| | | <!-- <result column="deptName" property="deptname"/>--> |
| | | <!-- <result column="reviewTime" property="reviewtime"/>--> |
| | | <!-- <result column="insid" property="insid"/>--> |
| | | <!-- <result column="examination_type" property="examinationType"/>--> |
| | | <!-- <result column="url" property="url"/>--> |
| | | <!-- <result column="jid" property="jid"/>--> |
| | | <!-- <result column="deptid" property="deptid"/>--> |
| | | <!-- <result column="jurisdiction" property="jurisdiction"/>--> |
| | | <!-- <result column="url" property="url"/>--> |
| | | <!-- </resultMap>--> |
| | | |
| | | |
| | | <select id="selectSeinspectPage" resultMap="seinspectResultMap"> |
| | | select * from sys_seinspect |
| | | <select id="selectSeinspectPage" resultType="org.springblade.modules.seinspect.vo.SeinspectVO"> |
| | | select |
| | | ss.*, |
| | | bu.real_name realName, |
| | | bd.dept_name examinerDeptName, |
| | | bu1.real_name securityName |
| | | from |
| | | sys_seinspect ss |
| | | left join |
| | | blade_user bu |
| | | on |
| | | bu.id = ss.examiner_id |
| | | left join |
| | | blade_dept bd |
| | | on |
| | | bd.id = ss.examiner_dept_id |
| | | left join |
| | | blade_user bu1 |
| | | on |
| | | bu1.id = ss.security_id |
| | | where 1 = 1 |
| | | <if test="seinspect.realName!=null and seinspect.realName!=''"> |
| | | bu.real_name like concat('%',#{seinspect.realName},'%') |
| | | </if> |
| | | <if test="seinspect.examinerDeptName!=null and seinspect.examinerDeptName!=''"> |
| | | bd.dept_name like concat('%',#{seinspect.examinerDeptName},'%') |
| | | </if> |
| | | <if test="seinspect.securityName!=null and seinspect.securityName!=''"> |
| | | bu1.real_name like concat('%',#{seinspect.securityName},'%') |
| | | </if> |
| | | <if test="seinspect.result!=null and seinspect.result!=''"> |
| | | ss.result like concat('%',#{seinspect.result},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | public class SeinspectVO extends Seinspect { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 检查人名称 |
| | | */ |
| | | private String realName; |
| | | |
| | | /** |
| | | * 检查人单位名称 |
| | | */ |
| | | private String examinerDeptName; |
| | | |
| | | /** |
| | | * 被检查人姓名 |
| | | */ |
| | | private String securityName; |
| | | |
| | | /** |
| | | * 被检查人单位名称 |
| | | */ |
| | | private String reviewedDeptName; |
| | | |
| | | } |
| | |
| | | public R save(@Valid @RequestBody Shareholder shareholder) throws Exception { |
| | | boolean save = shareholderService.save(shareholder); |
| | | String s1 = |
| | | "insert into sys_shareholder(id,shareholder,shareholdingratio,capital,capitalTime,cardid,cell,creditCode) " + |
| | | "insert into sys_shareholder(id,shareholder,shareholdingratio,capital,capitalTime,cardid,cell,creditCode,dept_id) " + |
| | | "values(" + "'" + shareholder.getId() + "'" + "," + |
| | | "'" + shareholder.getShareholder() + "'" + "," + |
| | | "'" + shareholder.getShareholdingratio() + "'" + "," + |
| | |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(shareholder.getCapitaltime()) + "'"+"," + |
| | | "'" + shareholder.getCardid() + "'"+"," + |
| | | "'" + shareholder.getCell() + "'"+"," + |
| | | "'" + shareholder.getCreditcode() + "'" + ")"; |
| | | "'" + shareholder.getCreditcode() + "'"+"," + |
| | | "'" + shareholder.getDeptId() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.status(save); |
| | | } |
| | |
| | | ",cardid = " + "'" + shareholder.getCardid() + "'" + |
| | | ",cell = " + "'" + shareholder.getCell() + "'" + |
| | | ",creditCode = " + "'" + shareholder.getCreditcode() + "'" + |
| | | ",dept_id = " + "'" + shareholder.getDeptId() + "'" + |
| | | " " + "where id = " + "'" + shareholder.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.status(b); |
| | |
| | | public void exportMember(HttpServletResponse response) { |
| | | List<shareExcel> list = new ArrayList<>(); |
| | | shareExcel share = new shareExcel(); |
| | | share.setCreditcode("xx12351214112"); |
| | | share.setDeptId("xxx保安服务有限公司"); |
| | | share.setShareholder("张三"); |
| | | share.setShareholdingratio("10"); |
| | | share.setCardid("360***********0001"); |
| | |
| | | @ApiModelProperty(value = "统一社会信用代码") |
| | | @TableField("creditCode") |
| | | private String creditcode; |
| | | |
| | | /** |
| | | * 公司id |
| | | */ |
| | | @ApiModelProperty(value = "公司id") |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | |
| | | |
| | | } |
| | |
| | | public class shareExcel implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("统一社会信用代码") |
| | | private String creditcode; |
| | | @ColumnWidth(30) |
| | | @ExcelProperty("保安公司名称") |
| | | private String deptId; |
| | | |
| | | @ExcelProperty("股东") |
| | | private String shareholder; |
| | |
| | | <result column="cardid" property="cardid"/> |
| | | <result column="cell" property="cell"/> |
| | | <result column="creditCode" property="creditcode"/> |
| | | <result column="dept_id" property="deptId"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | |
| | | |
| | | <select id="selectShareholderInfo" resultMap="shareholderResultMap"> |
| | | select * from sys_shareholder where creditCode = #{shareholder.creditcode} |
| | | select * from sys_shareholder where dept_id = #{shareholder.deptId} |
| | | <if test="shareholder.cardid!=null and shareholder.cardid!=''"> |
| | | and cardid like concat('%', #{shareholder.cardid},'%') |
| | | </if> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.information.entity.Information; |
| | | import org.springblade.modules.shareholder.entity.Shareholder; |
| | |
| | | import org.springblade.modules.shareholder.mapper.ShareholderMapper; |
| | | import org.springblade.modules.shareholder.service.IShareholderService; |
| | | import org.springblade.modules.shareholder.vo.ShareholderVO; |
| | | import org.springblade.modules.system.service.IUserDeptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | |
| | | @Service |
| | | public class ShareholderServiceImpl extends ServiceImpl<ShareholderMapper, Shareholder> implements IShareholderService { |
| | | |
| | | @Autowired |
| | | private IUserDeptService userDeptService; |
| | | |
| | | @Override |
| | | public IPage<ShareholderVO> selectShareholderPage(IPage<ShareholderVO> page, ShareholderVO shareholder) { |
| | | return page.setRecords(baseMapper.selectShareholderPage(page, shareholder)); |
| | |
| | | public void importshare(List<shareExcel> data, Boolean isCovered) { |
| | | data.forEach(shareExcel -> { |
| | | Shareholder shareholder = Objects.requireNonNull(BeanUtil.copy(shareExcel, Shareholder.class)); |
| | | String deptId = userDeptService.selectIn(shareExcel.getDeptId()); |
| | | if (null==deptId || deptId==""){ |
| | | throw new ServiceException("公司名:["+shareExcel.getDeptId()+"]不存在!"); |
| | | } |
| | | shareholder.setDeptId(deptId); |
| | | try { |
| | | shareholder.setCapitaltime(new SimpleDateFormat("yyyy/MM/dd").parse(shareExcel.getCapitaltime())); |
| | | } catch (ParseException e) { |
| | |
| | | /** |
| | | * 懒加载获取部门树形结构,不包含顶级管理员公安局 |
| | | */ |
| | | List<DeptVO> securityLazyTree(String jurisdiction, Long parentId); |
| | | List<DeptVO> securityLazyTree(@Param("jurisdiction") String jurisdiction, Long parentId); |
| | | List<DeptVO> selectInfo(); |
| | | |
| | | /** |
| | | * 查询所有的部门信息 |
| | | * @return |
| | |
| | | blade_dept |
| | | where is_deleted = 0 |
| | | and |
| | | (id = 1413470343230877697 or id = 1425366663452196865 or id = 1418458374477549569 or id = 1420222768149966850) |
| | | (id = 1413470343230877697 |
| | | or id = 1425366663452196865 |
| | | or id = 1418458374477549569 |
| | | or id = 1420222768149966850 |
| | | or id = 1426354978959691778) |
| | | ) |
| | | union |
| | | ( |
| | |
| | | sys_information si |
| | | on |
| | | si.departmentid = dept.id |
| | | left join |
| | | sys_jurisdiction sj |
| | | on |
| | | sj.id = si.jurisdiction |
| | | WHERE |
| | | 1=1 |
| | | and si.stats != 4 |
| | | AND dept.is_deleted = 0 |
| | | and dept.id !=1420222961377357825 |
| | | and dept.parent_id!=1420222961377357825 |
| | | and dept.parent_id!=1425365577303621633 |
| | | and dept.id != 1425365577303621633 |
| | | and dept.id != 1432625856013971457 |
| | | <if test="param1!=null and param1!='' and param1!='1372091709474910209'"> |
| | | and si.jurisdiction = #{param1} |
| | | <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> |
| | | and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction}) |
| | | </if> |
| | | ) |
| | | </select> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.modules.system.mapper.UserDeptMapper"> |
| | | <select id="selectIn" resultType="java.lang.String"> |
| | | SELECT id FROM blade_dept WHERE dept_name=#{deptname} |
| | | SELECT id FROM blade_dept WHERE dept_name=#{deptname} and is_deleted =0 |
| | | </select> |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | User getUserInfo(@Param("account") String username); |
| | | |
| | | /** |
| | | * 现场检查获取保安员 |
| | | * @param jurisdiction |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getSecurityInfo(@Param("jurisdiction")String jurisdiction); |
| | | } |
| | |
| | | <select id="getUserInfoByIdCardNo" resultType="org.springblade.modules.system.entity.User"> |
| | | SELECT id, name, real_name RealName |
| | | FROM blade_user |
| | | where cardid = #{param1} |
| | | where 1=1 |
| | | and is_deleted = 0 |
| | | and status = 1 |
| | | and cardid = #{param1} |
| | | </select> |
| | | |
| | | |
| | |
| | | and is_deleted = 0 |
| | | and status = 1 |
| | | </select> |
| | | |
| | | |
| | | <!--现场检查获取保安员--> |
| | | <select id="getSecurityInfo" resultType="java.util.HashMap"> |
| | | select bu.*,si.jurisdiction from blade_user bu |
| | | left join |
| | | blade_dept bd |
| | | on |
| | | bd.id = bu.dept_id |
| | | left join |
| | | sys_information si |
| | | on |
| | | bd.id = si.departmentid |
| | | left join |
| | | sys_jurisdiction sj |
| | | on |
| | | sj.id = si.jurisdiction |
| | | left join |
| | | blade_role br |
| | | on |
| | | br.id = bu.role_id |
| | | where |
| | | 1=1 |
| | | <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> |
| | | and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction}) |
| | | </if> |
| | | and bu.status = 1 |
| | | and bu.is_deleted = 0 |
| | | and br.role_alias = "保安" |
| | | </select> |
| | | </mapper> |
| | |
| | | } |
| | | |
| | | @Override |
| | | // @Transactional(rollbackFor = Exception.class) |
| | | // @Transactional(rollbackFor = Exception.class) 去除事务回滚 |
| | | public void importUser(List<UserExcel> data, Boolean isCovered,String deptId) { |
| | | //将不能导入的保安员账号存起来 |
| | | List<String> errorList = new ArrayList<>(); |
| | | //将需要新增的保安员信息存入集合 |
| | | List<User> insertList = new ArrayList<>(); |
| | | //将需要更新的保安员信息存入集合 |
| | | List<User> updateList = new ArrayList<>(); |
| | | //导入状态,默认为true ,如果有一个出现问题则为 false |
| | | AtomicBoolean status = new AtomicBoolean(true); |
| | | data.forEach(userExcel -> { |
| | |
| | | //判断当前用户是否已在本单位,如果是的更新数据 |
| | | User user1 = new User(); |
| | | user1.setAccount(user.getCardid()); |
| | | // System.out.println("user.getCardid() = " + user.getCardid()); |
| | | user1.setIsDeleted(0); |
| | | user1.setStatus(1); |
| | | User user2 = this.getOne(Condition.getQueryWrapper(user1)); |
| | |
| | | if (Integer.parseInt(type) == 4) { |
| | | list = baseMapper.getWorkReportInfo(type, deptid, jurisdiction); |
| | | } |
| | | //现场检查获取保安员 |
| | | if (Integer.parseInt(type) == 5) { |
| | | list = baseMapper.getSecurityInfo(jurisdiction); |
| | | } |
| | | return list; |
| | | } |
| | | |