| | |
| | | private final ExamPaperService examPaperService; |
| | | |
| | | /** |
| | | * 自定义分页,资格审查 |
| | | * @param query page,size |
| | | * @param apply 考试报名信息对象 |
| | | */ |
| | | @GetMapping("/page-investigate") |
| | | public R<IPage<ApplyVO>> pageInvestigate(ApplyVO apply, Query query) { |
| | | IPage<ApplyVO> pages = applyService.selectApplyPage(Condition.getPage(query), apply); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * @param query page,size |
| | | * @param apply 考试报名信息对象 |
| | |
| | | SELECT |
| | | sa.id,sa.user_id userId,sa.candidate_no candidateNo,apply_time,exam_id examId, |
| | | ke.total_score paperScore,ke.exam_type examType,ke.start_time examTime,ke.exam_name examName, |
| | | bu.real_name name,sa.examination_type,sa.examination_mx, |
| | | bu.real_name realName,sa.examination_type,sa.examination_mx, |
| | | bd.dept_name deptName |
| | | FROM |
| | | sys_apply sa |
| | |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; |
| | | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | import org.springblade.common.utils.InvestigateUtil; |
| | | import org.springblade.modules.apply.entity.Apply; |
| | | import org.springblade.modules.apply.excel.ApplyExcel; |
| | | import org.springblade.modules.apply.mapper.ApplyMapper; |
| | |
| | | */ |
| | | @Override |
| | | public IPage<ApplyVO> selectApplyPage(IPage<ApplyVO> page, ApplyVO apply) { |
| | | return page.setRecords(baseMapper.selectApplyPage(page, apply)); |
| | | List<ApplyVO> applyVOList = baseMapper.selectApplyPage(page, apply); |
| | | // applyVOList.forEach(applyVO -> { |
| | | // //资格审查 |
| | | // String body = InvestigateUtil.httpGet(applyVO.getIdCardNo()); |
| | | // JSONObject jsonObject = new JSONObject(body); |
| | | // String data = jsonObject.get("data").toString(); |
| | | // JSONObject jsonData = new JSONObject(data); |
| | | // JSONArray res = jsonData.getJSONArray("res"); |
| | | // if (res.length()==0){ |
| | | // //没有数据正常 |
| | | // applyVO.setExaminationType("0"); |
| | | // }else { |
| | | // applyVO.setExaminationType("1"); |
| | | // applyVO.setExaminationMx(res.getJSONObject(0).get("zdxsfzqkry").toString()); |
| | | // } |
| | | // }); |
| | | return page.setRecords(applyVOList); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String deptName; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | private String idCardNo; |
| | | |
| | | /** |
| | | * 保安姓名 |
| | | */ |
| | | private String realName; |
| | | |
| | | } |
| | |
| | | SELECT |
| | | es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade, |
| | | exam_name examName,bu.real_name securityName,company,exam_time examTime, |
| | | all_score allScore,exam_end_time examEndTime,qualified, |
| | | all_grade allGrade,exam_end_time examEndTime,qualified, |
| | | bd.dept_name companyName |
| | | FROM |
| | | exam_score es |
| | |
| | | package org.springblade.modules.investigate; |
| | | |
| | | import com.alibaba.druid.support.json.JSONUtils; |
| | | import lombok.AllArgsConstructor; |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | import org.springblade.common.utils.InvestigateUtil; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | |
| | | System.out.println("idCardNo = " + idCardNo); |
| | | return InvestigateUtil.httpGet(idCardNo); |
| | | } |
| | | |
| | | /** |
| | | * 数据反向测试 |
| | | * @param body 数据反向测试 |
| | | * @return |
| | | */ |
| | | @PostMapping("/investigate/testBody") |
| | | public String testBody(@RequestBody String body){ |
| | | System.out.println("body = " + body); |
| | | JSONObject jsonObject = new JSONObject(body); |
| | | Object data = jsonObject.get("data"); |
| | | System.out.println("data = " + data.toString()); |
| | | JSONObject jsonData = new JSONObject(data.toString()); |
| | | Object res = jsonData.get("res"); |
| | | System.out.println("res = " + res); |
| | | JSONArray jsonArray = jsonData.getJSONArray("res"); |
| | | System.out.println("jsonArray = " + jsonArray); |
| | | System.out.println("jsonArray.length() = " + jsonArray.length()); |
| | | if (jsonArray.length()>0){ |
| | | String zdxsfzqkry = jsonArray.getJSONObject(0).get("zdxsfzqkry").toString(); |
| | | return zdxsfzqkry; |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package org.springblade.modules.system.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | import org.springblade.common.utils.InvestigateUtil; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | |
| | | public R submit(@Valid @RequestBody User user) { |
| | | CacheUtil.clear(USER_CACHE); |
| | | //资格审查 |
| | | String data = InvestigateUtil.httpGet(user.getCardid()); |
| | | JSONObject jsonObject = JSONObject.parseObject(data); |
| | | Object data1 = jsonObject.get("data"); |
| | | JSONObject jsonObject1 = JSONObject.parseObject(data1.toString()); |
| | | List<Map<String,Object>> res = (List<Map<String,Object>>)jsonObject1.get("res"); |
| | | if(res.size()>0) { |
| | | int count = (int) res.stream().filter(map -> map.get("zdxsfzqkry") != null).count(); |
| | | res.forEach(map -> { |
| | | if (null != map.get("zdxsfzqkry")) { |
| | | user.setExaminationMx(map.get("zdxsfzqkry").toString()); |
| | | } |
| | | }); |
| | | if (count > 0) { |
| | | user.setExaminationType("1"); |
| | | } else { |
| | | user.setExaminationType("0"); |
| | | } |
| | | }else { |
| | | String body = InvestigateUtil.httpGet(user.getCardid()); |
| | | JSONObject jsonObject = new JSONObject(body); |
| | | String data = jsonObject.get("data").toString(); |
| | | JSONObject jsonData = new JSONObject(data); |
| | | JSONArray res = jsonData.getJSONArray("res"); |
| | | if (res.length()==0){ |
| | | //没有数据正常 |
| | | user.setExaminationType("0"); |
| | | }else { |
| | | user.setExaminationType("1"); |
| | | user.setExaminationMx(res.getJSONObject(0).get("zdxsfzqkry").toString()); |
| | | } |
| | | return R.status(userService.submit(user)); |
| | | } |
| | |
| | | <!--报名培训分页信息--> |
| | | <select id="selectTrainingRegistrationPage" resultType="org.springblade.modules.training.vo.TrainingRegistrationVo"> |
| | | SELECT |
| | | sr.*, |
| | | sr.id,sr.training_time TrainingTime,sr.cancel, |
| | | bt.dept_name AS deptName, |
| | | bt0.dept_name AS trainUnitName, |
| | | bu.real_name realName,bu.phone,bu.cardid idCardNo, |
| | | ste.start_time trainExamTime,ste.train_exam_name trainExamName |
| | | bu.real_name realName,bu.phone,bu.cardid idCardNo,bu.sex,bu.height,bu.education, |
| | | ke.start_time trainExamTime,if(ke.audit_status=1,ke.exam_name,"") trainExamName,ke.exam_type examType, |
| | | "保安证" applyCard |
| | | FROM |
| | | sys_training_registration sr |
| | | LEFT JOIN |
| | | blade_dept bt |
| | | ON |
| | | sr.dept_id = bt.id |
| | | LEFT JOIN |
| | | blade_dept bt0 |
| | | ON |
| | |
| | | blade_user bu |
| | | on |
| | | sr.user_id = bu.id |
| | | LEFT JOIN |
| | | blade_dept bt |
| | | ON |
| | | bu.dept_id = bt.id |
| | | left join |
| | | sys_train_exam ste |
| | | ksxt_exam ke |
| | | on |
| | | ste.id = sr.train_exam_id |
| | | ke.id = sr.train_exam_id |
| | | WHERE |
| | | 1=1 |
| | | and is_exam = 1 |
| | | and bu.is_train = 1 |
| | | and sr.cancel = 1 |
| | | <if test="trainingRegistration.trainingUnitId!=null and trainingRegistration.trainingUnitId!=''"> |
| | | and ste.dept_id = #{trainingRegistration.trainingUnitId} |
| | | and sr.training_unit_id = #{trainingRegistration.trainingUnitId} |
| | | </if> |
| | | <if test="trainingRegistration.examId!=null and trainingRegistration.examId!=''"> |
| | | and ke.id = #{trainingRegistration.examId} |
| | | </if> |
| | | <if test="trainingRegistration.userId!=null and trainingRegistration.userId!=''"> |
| | | and sr.user_id = #{trainingRegistration.userId} |
| | | </if> |
| | | <if test="trainingRegistration.deptName!=null and trainingRegistration.deptName!=''"> |
| | | and bt.dept_name like concat('%', #{trainingRegistration.deptName},'%') |
| | |
| | | @Override |
| | | public IPage<TrainingRegistrationVo> selectTrainingRegistrationPage(IPage<TrainingRegistrationVo> page, TrainingRegistrationVo trainingRegistration) { |
| | | List<TrainingRegistrationVo> trainingRegistrationVos = baseMapper.selectTrainingRegistrationPage(page, trainingRegistration); |
| | | if (trainingRegistrationVos.size()>0) { |
| | | trainingRegistrationVos.forEach(trainingRegistrationVo -> { |
| | | if (null!=trainingRegistrationVo.getTrainExamTime()) { |
| | | trainingRegistrationVo.setRemainingTime(LongTimeUtil.getDistanceTime(trainingRegistrationVo.getTrainExamTime().getTime(), System.currentTimeMillis())); |
| | | } |
| | | }); |
| | | } |
| | | // if (trainingRegistrationVos.size()>0) { |
| | | // trainingRegistrationVos.forEach(trainingRegistrationVo -> { |
| | | // if (null!=trainingRegistrationVo.getTrainExamTime()) { |
| | | // trainingRegistrationVo.setRemainingTime(LongTimeUtil.getDistanceTime(trainingRegistrationVo.getTrainExamTime().getTime(), System.currentTimeMillis())); |
| | | // } |
| | | // }); |
| | | // } |
| | | return page.setRecords(trainingRegistrationVos); |
| | | } |
| | | |
| | |
| | | * 考试名称 |
| | | */ |
| | | private String trainExamName; |
| | | |
| | | /** |
| | | * 考试id |
| | | */ |
| | | private String examId; |
| | | |
| | | /** |
| | | * 考的证 |
| | | */ |
| | | private String applyCard; |
| | | |
| | | |
| | | /** |
| | | * 考试类型 |
| | | */ |
| | | private Integer examType; |
| | | |
| | | /** |
| | | * 多人报名 |
| | | */ |
| | | private String userIds; |
| | | |
| | | /** |
| | | * 学历 |
| | | */ |
| | | private String education; |
| | | } |
| | |
| | | */ |
| | | private String getReplyDeptName(WorkReportVo detail) { |
| | | List<String> replyDeptIds = Arrays.asList(detail.getReplyDeptIds().split(",")); |
| | | StringBuilder replyDeptNameInfo = new StringBuilder(); |
| | | for (String deptId : replyDeptIds) { |
| | | //查询接收人单位信息 |
| | | Dept deptDetail = deptService.getById(Long.parseLong(deptId)); |
| | | replyDeptNameInfo = replyDeptNameInfo.append(deptDetail.getDeptName()).append(","); |
| | | if (replyDeptIds.size()>0) { |
| | | StringBuilder replyDeptNameInfo = new StringBuilder(); |
| | | for (String deptId : replyDeptIds) { |
| | | //查询接收人单位信息 |
| | | Dept deptDetail = deptService.getById(Long.parseLong(deptId)); |
| | | replyDeptNameInfo = replyDeptNameInfo.append(deptDetail.getDeptName()).append(","); |
| | | } |
| | | //截取 |
| | | return replyDeptNameInfo.substring(0, replyDeptNameInfo.length() - 1); |
| | | } |
| | | //截取 |
| | | return replyDeptNameInfo.substring(0, replyDeptNameInfo.length() - 1); |
| | | return null; |
| | | } |
| | | |
| | | /** |