Merge remote-tracking branch 'origin/master'
| | |
| | | import okhttp3.Request; |
| | | import okhttp3.Response; |
| | | |
| | | import java.util.function.BiConsumer; |
| | | import java.util.function.Consumer; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @date 2021-08-12 |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | // 工具方法 |
| | | public static <T> Consumer<T> consumerWithIndex(BiConsumer<T, Integer> consumer) { |
| | | class Obj { |
| | | int i; |
| | | } |
| | | Obj obj = new Obj(); |
| | | return t -> { |
| | | int index = obj.i++; |
| | | consumer.accept(t, index); |
| | | }; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 审核状态 |
| | | */ |
| | | @TableField("examination_type") |
| | | private String examinationType; |
| | | |
| | | /** |
| | | * 审核明细 |
| | | */ |
| | | @TableField("examination_mx") |
| | | private String examinationMx; |
| | | |
| | | /** |
| | |
| | | <!--考试报名分页信息--> |
| | | <select id="selectApplyPage" resultType="org.springblade.modules.apply.vo.ApplyVO"> |
| | | 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 realName,sa.examination_type,sa.examination_mx, |
| | | bd.dept_name deptName |
| | | sa.id,sa.apply_status applyStatus,sa.user_id userId,sa.candidate_no candidateNo,apply_time,exam_id examId, |
| | | sa.examination_type examinationType,sa.examination_mx examinationMx, |
| | | ke.total_score paperScore,ke.exam_type examType,ke.start_time examTime,ke.exam_name examName, |
| | | bu.real_name realName,bu.is_apply isApply, |
| | | bd.dept_name deptName,bu.cardid idCardNo,"保安证" applyCard |
| | | FROM |
| | | sys_apply sa |
| | | sys_apply sa |
| | | left join |
| | | ksxt_exam ke |
| | | ksxt_exam ke |
| | | on |
| | | sa.exam_id = ke.id |
| | | sa.exam_id = ke.id |
| | | left join |
| | | blade_user bu |
| | | blade_user bu |
| | | on |
| | | sa.user_id = bu.id |
| | | sa.user_id = bu.id |
| | | left join |
| | | blade_dept bd |
| | | blade_dept bd |
| | | on |
| | | bd.id = bu.dept_id |
| | | bd.id = bu.dept_id |
| | | WHERE |
| | | 1=1 |
| | | <if test="apply.name!=null and apply.name!=''"> |
| | | and sa.name like concat('%', #{apply.name},'%') |
| | | 1=1 |
| | | and is_exam = 1 |
| | | and sa.apply_status = 2 |
| | | and bu.is_apply = 1 |
| | | <if test="apply.realName!=null and apply.realName!=''"> |
| | | and bu.real_name like concat('%', #{apply.realName},'%') |
| | | </if> |
| | | <if test="apply.deptName!=null and apply.deptName!=''"> |
| | | and bd.dept_name like concat('%', #{apply.deptName},'%') |
| | | </if> |
| | | <if test="apply.userId!=null and apply.userId!=''"> |
| | | and sa.user_id like concat('%', #{apply.userId},'%') |
| | | </if> |
| | | <if test="apply.examinationType!=null and apply.examinationType!=''"> |
| | | and sa.examination_type = #{apply.examinationType} |
| | | </if> |
| | | <if test="apply.applyStatus!=null"> |
| | | and apply_status = #{apply.applyStatus} |
| | |
| | | private String idCardNo; |
| | | |
| | | /** |
| | | * 报考的证件 |
| | | */ |
| | | private String applyCard; |
| | | |
| | | /** |
| | | * 用户ids |
| | | */ |
| | | private String userIds; |
| | | |
| | | /** |
| | | * 报名状态 |
| | | */ |
| | | private Integer isApply; |
| | | |
| | | /** |
| | | * 保安姓名 |
| | | */ |
| | | private String realName; |
| | | |
| | | |
| | | /** |
| | | * 性别 1:男 2:女 |
| | | */ |
| | | private Integer sex; |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 统计保安员资格异常的数量 |
| | | * @param jurisdiction |
| | | * @param deptid |
| | | * @param type 1:当天 2:当月 3:全部 |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectExtype") |
| | | public R selectExtype(String jurisdiction,String deptid) { |
| | | public R selectExtype(String jurisdiction,String deptid,String type) { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Integer count=0; |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | List<Map<Object, Object>> maps = informationService.selectExtype(jurisdiction, deptid); |
| | | List<Map<Object, Object>> maps = informationService.selectExtype(jurisdiction, deptid,type); |
| | | for (int i=0;i<maps.size();i++){ |
| | | String num = maps.get(i).get("num").toString(); |
| | | count+= Integer.valueOf(num); |
| | |
| | | return R.data(lists); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 统计保安员表现差的数量 |
| | | * @param jurisdiction |
| | | * @param deptid |
| | | * @param type 1:当天 2:当月 3:全部 |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectBx") |
| | | public R selectBx(String jurisdiction,String deptid) { |
| | | public R selectBx(String jurisdiction,String deptid,String type) { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Integer count=0; |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | List<Map<Object, Object>> maps = informationService.selectBx(jurisdiction, deptid); |
| | | List<Map<Object, Object>> maps = informationService.selectBx(jurisdiction, deptid,type); |
| | | for (int i=0;i<maps.size();i++){ |
| | | String num = maps.get(i).get("num").toString(); |
| | | count+= Integer.valueOf(num); |
| | |
| | | //辖区名称 |
| | | String jurname = list.get(i).get("dept_name").toString(); |
| | | //保安员表现差预警数量 |
| | | List<Map<Object, Object>> mapbx = informationService.selectBx(jurisdiction, ""); |
| | | List<Map<Object, Object>> mapbx = informationService.selectBx(jurisdiction, "",""); |
| | | for (int ibx=0;ibx<mapbx.size();ibx++){ |
| | | String num = mapbx.get(ibx).get("num").toString(); |
| | | count+= Integer.valueOf(num); |
| | | } |
| | | //保安员资格异常的数量 |
| | | List<Map<Object, Object>> mapEx = informationService.selectExtype(jurisdiction, ""); |
| | | List<Map<Object, Object>> mapEx = informationService.selectExtype(jurisdiction, "",""); |
| | | for (int iex=0;iex<mapEx.size();iex++){ |
| | | String num = mapEx.get(iex).get("num").toString(); |
| | | count+= Integer.valueOf(num); |
| | |
| | | List<Map<Object,Object>> queryCountKh(String jurisdiction,String deptid); |
| | | List<Map<Object,Object>> queryCountPq(String jurisdiction,String deptid); |
| | | List<Map<Object,Object>> selectJur(); |
| | | List<Map<Object,Object>> selectExtype(String jurisdiction,String deptid); |
| | | List<Map<Object,Object>> selectBx(String jurisdiction,String deptid); |
| | | List<Map<Object,Object>> selectExtype(String jurisdiction,String deptid,String type); |
| | | List<Map<Object,Object>> selectBx(String jurisdiction,String deptid,String type); |
| | | List<Map<Object,Object>> seCountI(String jurisdiction,String deptid); |
| | | String seCountUm(String jurisdiction,String deptid); |
| | | String seCountUg(String jurisdiction,String deptid); |
| | |
| | | SELECT IFNULL(B.confess, 0) AS confess, |
| | | IFNULL(C.staff, 0) AS staff, |
| | | IFNULL(D.security, 0) AS security, |
| | | IFNULL(E.armed, 0) AS armed |
| | | IFNULL(E.armed, 0) AS armed, |
| | | IFNULL(F.region, 0) AS region |
| | | FROM (SELECT jurisdiction FROM sys_information GROUP BY jurisdiction) A |
| | | LEFT JOIN (SELECT COUNT(stats) AS confess, jurisdiction |
| | | FROM sys_information |
| | |
| | | FROM sys_information |
| | | WHERE stats = 3 |
| | | GROUP BY jurisdiction) E ON A.jurisdiction = E.jurisdiction |
| | | LEFT JOIN (SELECT COUNT(stats) AS region, jurisdiction |
| | | FROM sys_information |
| | | WHERE stats = 4 |
| | | GROUP BY jurisdiction) F ON A.jurisdiction = E.jurisdiction |
| | | WHERE A.jurisdiction = #{departmentid} |
| | | </select> |
| | | |
| | |
| | | <if test="deptid!=null and deptid!=''"> |
| | | and u.dept_id =#{deptid} |
| | | </if> |
| | | <if test="type=1"> |
| | | and to_days(u.update_time) = to_days(now()); |
| | | </if> |
| | | <if test="type=2"> |
| | | and DATE_FORMAT(u.update_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) |
| | | </if> |
| | | GROUP BY d.dept_name, |
| | | j.dept_name |
| | | </select> |
| | |
| | | <if test="deptid!=null and deptid!=''"> |
| | | and u.departmentid =#{deptid} |
| | | </if> |
| | | <if test="type=1"> |
| | | and to_days(u.time) = to_days(now()); |
| | | </if> |
| | | <if test="type=2"> |
| | | and DATE_FORMAT(u.time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) |
| | | </if> |
| | | GROUP BY d.dept_name, |
| | | j.dept_name |
| | | </select> |
| | |
| | | Map<String, String> queryYearCz(String year,String jurisdiction,String deptid); |
| | | Map<String, String> queryYearKh(String year,String jurisdiction,String deptid); |
| | | Map<String, String> queryYearBanan(String year,String jurisdiction,String deptid); |
| | | List<Map<Object,Object>> selectExtype(String jurisdiction,String deptid); |
| | | List<Map<Object,Object>> selectExtype(String jurisdiction,String deptid,String type); |
| | | List<Map<Object,Object>> selectJur(); |
| | | List<Map<Object,Object>> selectBx(String jurisdiction,String deptid); |
| | | List<Map<Object,Object>> selectBx(String jurisdiction,String deptid,String type); |
| | | Map<String, String> queryYearDe(String year,String jurisdiction,String deptid); |
| | | Map selectPcount(String jurisdiction,String deptid); |
| | | Map selectWPcount(String jurisdiction,String deptid); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<Object, Object>> selectExtype(String jurisdiction, String deptid) { |
| | | return baseMapper.selectExtype(jurisdiction, deptid); |
| | | public List<Map<Object, Object>> selectExtype(String jurisdiction, String deptid,String type) { |
| | | return baseMapper.selectExtype(jurisdiction, deptid,type); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<Object, Object>> selectBx(String jurisdiction, String deptid) { |
| | | return baseMapper.selectBx(jurisdiction, deptid); |
| | | public List<Map<Object, Object>> selectBx(String jurisdiction, String deptid,String type) { |
| | | return baseMapper.selectBx(jurisdiction, deptid,type); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | import org.springblade.common.utils.InvestigateUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.retry.backoff.Sleeper; |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | import java.util.function.BiConsumer; |
| | | import java.util.function.Consumer; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class Investigate { |
| | | |
| | | private final IUserService userService; |
| | | |
| | | /** |
| | | * |
| | |
| | | return InvestigateUtil.httpGet(idCardNo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @param idCardNo 身份证号码 |
| | | * @return |
| | | */ |
| | | @GetMapping("/investigate/byUser") |
| | | public R investigateByUser(){ |
| | | //查询用户数据,未删除的 |
| | | List<User> users = userService.getAllUserList(); |
| | | //遍历 |
| | | users.forEach(InvestigateUtil.consumerWithIndex((user,index) ->{ |
| | | if (index==99){ |
| | | try { |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | String body = InvestigateUtil.httpGet(user.getCardid()); |
| | | JSONObject jsonObject = new JSONObject(body); |
| | | Object data = jsonObject.get("data"); |
| | | JSONObject jsonData = new JSONObject(data.toString()); |
| | | JSONArray res = jsonData.getJSONArray("res"); |
| | | if (res.length()==0){ |
| | | //没有数据正常 |
| | | user.setExaminationType("0"); |
| | | }else { |
| | | user.setExaminationType("1"); |
| | | user.setExaminationMx(res.getJSONObject(0).get("zdxsfzqkry").toString()); |
| | | } |
| | | //更新用户数据 |
| | | userService.updateById(user); |
| | | })); |
| | | return R.data(users.size()); |
| | | } |
| | | |
| | | /** |
| | | * 数据反向测试 |
| | | * @param body 数据反向测试 |
| | |
| | | */ |
| | | @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; |
| | |
| | | * 自定义用户列表(只有保安员) |
| | | */ |
| | | List<User> selectUserPageSecurity(IPage<User> page, @Param("user") User user, @Param("deptIdList") List<Long> deptIdList, @Param("tenantId") String tenantId); |
| | | |
| | | /** |
| | | * 查询所有未注销用户 |
| | | * @return |
| | | */ |
| | | List<User> getAllUserList(); |
| | | } |
| | |
| | | update blade_user set hold=#{hold} where cardid=#{cardid} |
| | | </update> |
| | | |
| | | <!--查询所有未注销用户--> |
| | | <select id="getAllUserList" resultType="org.springblade.modules.system.entity.User"> |
| | | select id,cardid from blade_user where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * 自定义用户列表(只有保安员) |
| | | */ |
| | | IPage<User> selectUserPageSecurity(IPage<User> page, User user, Long deptId, String s); |
| | | |
| | | /** |
| | | * 查询所有未注销用户 |
| | | * @return |
| | | */ |
| | | List<User> getAllUserList(); |
| | | } |
| | |
| | | List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | | return page.setRecords(baseMapper.selectUserPageSecurity(page, user, deptIdList, tenantId)); |
| | | } |
| | | |
| | | /** |
| | | * 查询所有未注销用户 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<User> getAllUserList() { |
| | | return baseMapper.getAllUserList(); |
| | | } |
| | | } |