Merge remote-tracking branch 'origin/huacheng_zts' into huacheng_zZ
# Conflicts:
# springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActAcidRecordApi.java
# springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/IndexApi.java
| | |
| | | package com.panzhihua.common.model.dtos.community.acid; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | private String checkStatus; |
| | | @ApiModelProperty("id数组") |
| | | private String ids; |
| | | @ApiModelProperty("登录的账号名") |
| | | private String loginAccount; |
| | | private Integer type; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/comActAcidRecord/fiveCountPlus") |
| | | R comActAcidRecordFiveCountPlus(@RequestParam("date")String date,@RequestParam("localCity")String localCity); |
| | | R comActAcidRecordFiveCountPlus(@RequestParam("date")String date,@RequestParam("localCity")String localCity,@RequestParam("loginAccount")String loginAccount); |
| | | |
| | | @GetMapping("/comActAcidRecord/statics") |
| | | R comActAcidRecordStatics(@RequestParam("date")String date); |
| | |
| | | R uuPush(@RequestParam("washPhone")String washPhone,@RequestParam("phone")String phone,@RequestParam("washName")String washName,@RequestParam("orderStatus")Integer orderStatus); |
| | | |
| | | @GetMapping("/communityList") |
| | | R communityList(@RequestParam("type") Integer type); |
| | | R communityList(@RequestParam("name") String name, @RequestParam("id") Long id); |
| | | } |
| | |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.dtos.community.acid.ComActAcidRecordDTO; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.acid.ComAcidStaticVO; |
| | | import com.panzhihua.common.model.vos.community.acid.ComActAcidRecordExcelReturn; |
| | |
| | | * @param comActAcidRecordDTO 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | //@OperLog(operModul = "查询防疫登记信息列表",operType = 1) |
| | | @OperLog(operModul = "查询防疫登记信息列表",operType = 1) |
| | | @ApiOperation(value = "分页查询",response = ComActAcidRecordVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody ComActAcidRecordDTO comActAcidRecordDTO) { |
| | |
| | | } |
| | | |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | comActAcidRecordDTO.setLoginAccount(loginUserInfo.getAccount()); |
| | | return this.communityService.selectAllComActAcidRecord(comActAcidRecordDTO); |
| | | } |
| | | |
| | |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | //@OperLog(operModul = "查询单条防疫信息",operType = 1) |
| | | @OperLog(operModul = "查询单条防疫信息",operType = 1) |
| | | @ApiOperation(value = "通过主键查询单条数据",response = ComActAcidRecordVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | |
| | | * @param comActAcidRecordVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | //@OperLog(operModul = "新增防疫信息数据",operType = 1) |
| | | @OperLog(operModul = "新增防疫信息数据",operType = 1) |
| | | @ApiOperation(value = "新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActAcidRecordVO comActAcidRecordVO) { |
| | |
| | | * @param comActAcidRecordVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | //@OperLog(operModul = "修改防疫信息数据",operType = 1,businessType = Constants.UPDATE) |
| | | @OperLog(operModul = "修改防疫信息数据",operType = 1,businessType = Constants.UPDATE) |
| | | @ApiOperation(value = "修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActAcidRecordVO comActAcidRecordVO) { |
| | |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | //@OperLog(operModul = "删除防疫信息数据",operType = 1) |
| | | @OperLog(operModul = "删除防疫信息数据",operType = 1) |
| | | @ApiOperation(value = "删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.communityService.deleteComActAcidRecord(id); |
| | | } |
| | | |
| | | //@OperLog(operModul = "导出防疫信息",operType = 1) |
| | | @OperLog(operModul = "导出防疫信息",operType = 1) |
| | | @ApiOperation(value = "导出") |
| | | @PostMapping("/export") |
| | | public R export(@RequestBody ComActAcidRecordDTO comActAcidRecordDTO) { |
| | |
| | | * 5项常规统计 |
| | | * @return |
| | | */ |
| | | //@OperLog(operModul = "防疫信息五项常规统计",operType = 1) |
| | | @OperLog(operModul = "防疫信息五项常规统计",operType = 1) |
| | | @ApiOperation(value = "5项常规统计",response = FiveCount.class) |
| | | @GetMapping("fiveCount") |
| | | public R fiveCount(@RequestParam("localCity")String localCity){ |
| | |
| | | * 5项常规统计 |
| | | * @return |
| | | */ |
| | | //@OperLog(operModul = "防疫信息7项常规统计",operType = 1) |
| | | @OperLog(operModul = "防疫信息7项常规统计",operType = 1) |
| | | @ApiOperation(value = "7项常规统计",response = FiveCount.class) |
| | | @GetMapping("fiveCountPlus") |
| | | public R fiveCountPlus(@RequestParam("date")String date,@RequestParam(value = "localCity",required = false)String localCity){ |
| | | if(StringUtils.isNotEmpty(localCity)){ |
| | | return this.communityService.comActAcidRecordFiveCountPlus(date,localCity); |
| | | return this.communityService.comActAcidRecordFiveCountPlus(date,localCity,this.getLoginUserInfo().getAccount()); |
| | | } |
| | | return this.communityService.comActAcidRecordFiveCountPlus(date,this.getLoginUserInfo().getName()); |
| | | return this.communityService.comActAcidRecordFiveCountPlus(date,this.getLoginUserInfo().getName(),this.getLoginUserInfo().getAccount()); |
| | | } |
| | | |
| | | |
| | | //@OperLog(operModul = "防疫信息报表统计",operType = 1) |
| | | @OperLog(operModul = "防疫信息报表统计",operType = 1) |
| | | @ApiOperation(value = "报表统计",response = ComAcidStaticVO.class) |
| | | @GetMapping("/statics") |
| | | public R statics(@RequestParam("date")String date){ |
| | |
| | | @GetMapping("/communityList") |
| | | @ApiOperation(value = "获取当前账号下的社区/村落列表",response = StreetVO.class) |
| | | public R communityList(){ |
| | | //获取当前登录用户的信息 |
| | | RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
| | | // 从获取RequestAttributes中获取HttpServletRequest的信息 |
| | | HttpServletRequest request = |
| | | (HttpServletRequest)requestAttributes.resolveReference(RequestAttributes.REFERENCE_REQUEST); |
| | | // 登录对象信息 |
| | | String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO); |
| | | boolean empty = ObjectUtils.isEmpty(userInfo); |
| | | if (empty) { |
| | | log.error("获取登录用户信息失败【{}】"); |
| | | } |
| | | byte[] bytes = AES.parseHexStr2Byte(userInfo); |
| | | byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); |
| | | userInfo = new String(decrypt); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class); |
| | | //截取社区名 |
| | | // if (StringUtils.isEmpty(loginUserInfoVO.getCommunityName())) { |
| | | // R<LoginUserInfoVO> userInfoByUserId = userService.getUserInfoByUserId(loginUserInfoVO.getUserId().toString()); |
| | | // loginUserInfoVO = userInfoByUserId.getData(); |
| | | // } |
| | | Integer type=3; |
| | | // if (loginUserInfoVO.getAccount().equals("pannongyenongcunju")){ |
| | | // type=2; |
| | | // }else if (loginUserInfoVO.getAccount().equals("pandashujuzhongxin")){ |
| | | // type=1; |
| | | // }else if (loginUserInfoVO.getAccount().equals("fangyipingtai")){ |
| | | // type=3; |
| | | // } |
| | | return userService.communityList(type); |
| | | return userService.communityList(this.getLoginUserInfo().getAccount(),this.getUserId()); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("fiveCountPlus") |
| | | public R fiveCountPlus(@RequestParam("date")String date,@RequestParam("localCity")String localCity){ |
| | | return this.comActAcidRecordService.fiveCountPlus(date,localCity); |
| | | public R fiveCountPlus(@RequestParam("date")String date,@RequestParam("localCity")String localCity,@RequestParam("loginAccount")String loginAccount){ |
| | | return this.comActAcidRecordService.fiveCountPlus(date,localCity,loginAccount); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param localCity |
| | | * @return |
| | | */ |
| | | FiveCount fiveCountPlus(@Param("date") String date,@Param("localCity") String localCity); |
| | | FiveCount fiveCountPlus(@Param("date") String date,@Param("localCity") String localCity,@Param("type") Integer type); |
| | | |
| | | /** |
| | | * 统计查询 |
| | |
| | | * 5项统计 |
| | | * @return |
| | | */ |
| | | R fiveCountPlus(String date,String localCity); |
| | | R fiveCountPlus(String date,String localCity,String loginAccount); |
| | | |
| | | /** |
| | | * 图标统计 |
| | |
| | | |
| | | @Override |
| | | public R pageList(ComActAcidRecordDTO comActAcidRecordDTO) { |
| | | //是否需要筛选 |
| | | comActAcidRecordDTO.setType(isVilliage(comActAcidRecordDTO.getLoginAccount())); |
| | | log.info("搜索条件=========="+comActAcidRecordDTO); |
| | | //获取当前登录账号的社区名 |
| | | return R.ok(this.baseMapper.pageList(new Page<>(comActAcidRecordDTO.getPage(), comActAcidRecordDTO.getSize()),comActAcidRecordDTO)); |
| | | } |
| | | |
| | |
| | | return R.ok(this.baseMapper.fiveCount(localCity)); |
| | | } |
| | | @Override |
| | | public R fiveCountPlus(String date,String localCity) { |
| | | return R.ok(this.baseMapper.fiveCountPlus(date,localCity)); |
| | | public R fiveCountPlus(String date,String localCity,String loginAccount) { |
| | | Integer type = isVilliage(loginAccount); |
| | | log.info("type===="+type); |
| | | return R.ok(this.baseMapper.fiveCountPlus(date,localCity,type)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | case "盐边县": comStreetDO.setAreaCode(510422); break; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 是否需要区分村落/社区 |
| | | * */ |
| | | private Integer isVilliage(String name){ |
| | | if ("fangyipingtai".equals(name)){ |
| | | return 3; |
| | | }else if ("pandashujuzhongxin".equals(name)){ |
| | | return 1; |
| | | }else if ("pannongyenongcunju".equals(name)){ |
| | | return 2; |
| | | } |
| | | return 3; |
| | | } |
| | | } |
| | |
| | | <if test="commonPage.travelCard !=null and commonPage.travelCard !=''"> |
| | | and travel_card like concat('%',#{commonPage.travelCard},'%') |
| | | </if> |
| | | <if test="commonPage.type == 1"> |
| | | and local_city like concat('%','社区') |
| | | </if> |
| | | <if test="commonPage.type == 2"> |
| | | and local_city like concat('%','村') |
| | | </if> |
| | | </where> |
| | | order by check_status asc,create_time desc |
| | | </select> |
| | |
| | | |
| | | <select id="fiveCountPlus" resultType="com.panzhihua.common.model.vos.community.reserve.FiveCount"> |
| | | select (select count(*) from com_act_acid_record where 1=1 and is_del=0 |
| | | <if test="type == 1"> |
| | | and local_city like |
| | | concat('%','社区') |
| | | </if> |
| | | <if test="type == 2"> |
| | | and local_city like |
| | | concat('%','村') |
| | | </if> |
| | | <if test="date!=null and date!=''">and |
| | | create_time between concat(#{date},' 00:00:00') and concat(#{date},' 23:23:59') |
| | | </if> |
| | | <if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like |
| | | concat('%',#{localCity},'%')</if>) allCount, |
| | | concat('%',#{localCity},'%') |
| | | <if test="type == 1"> |
| | | and local_city like |
| | | concat('%','社区') |
| | | </if> |
| | | <if test="type == 2"> |
| | | and local_city like |
| | | concat('%','村') |
| | | </if></if>) allCount, |
| | | (select count(*) from com_act_acid_record where danger_area = '是' and is_del=0 |
| | | <if |
| | | test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | <if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | 23:23:59') |
| | | </if> |
| | | <if test="type == 1"> |
| | | and local_city like |
| | | concat('%','社区') |
| | | </if> |
| | | <if test="type == 2"> |
| | | and local_city like |
| | | concat('%','村') |
| | | </if> |
| | | <if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like |
| | | concat('%',#{localCity},'%')</if>) dangerCount, |
| | | concat('%',#{localCity},'%') |
| | | </if>) dangerCount, |
| | | (select count(*) from com_act_acid_record where color_mark = '绿码' and is_del=0 |
| | | <if |
| | | test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | <if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | 23:23:59') |
| | | </if> |
| | | <if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like |
| | | concat('%',#{localCity},'%')</if>) greenMark, |
| | | concat('%',#{localCity},'%')</if> |
| | | <if test="type == 1"> |
| | | and local_city like |
| | | concat('%','社区') |
| | | </if> |
| | | <if test="type == 2"> |
| | | and local_city like |
| | | concat('%','村') |
| | | </if>) greenMark, |
| | | (select count(*) from com_act_acid_record where color_mark = '红码' and is_del=0 |
| | | <if |
| | | test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | <if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | 23:23:59') |
| | | </if> |
| | | <if test="type == 1"> |
| | | and local_city like |
| | | concat('%','社区') |
| | | </if> |
| | | <if test="type == 2"> |
| | | and local_city like |
| | | concat('%','村') |
| | | </if> |
| | | <if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like |
| | | concat('%',#{localCity},'%')</if>) redMark, |
| | | concat('%',#{localCity},'%') |
| | | </if>) redMark, |
| | | (select count(*) from com_act_acid_record where color_mark = '黄码' and is_del=0 |
| | | <if |
| | | test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | <if test="type == 1"> |
| | | and local_city like |
| | | concat('%','社区') |
| | | </if> |
| | | <if test="type == 2"> |
| | | and local_city like |
| | | concat('%','村') |
| | | </if> |
| | | <if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | 23:23:59') |
| | | </if> |
| | | <if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like |
| | | concat('%',#{localCity},'%')</if>) yellowMark, |
| | | concat('%',#{localCity},'%') |
| | | </if>) yellowMark, |
| | | (select count(*) from com_act_acid_record where travel_card = '是' and is_del=0 |
| | | <if |
| | | test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | <if test="type == 1"> |
| | | and local_city like |
| | | concat('%','社区') |
| | | </if> |
| | | <if test="type == 2"> |
| | | and local_city like |
| | | concat('%','村') |
| | | </if> |
| | | <if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | 23:23:59') |
| | | </if> |
| | | <if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like |
| | | concat('%',#{localCity},'%')</if>) travelCount, |
| | | concat('%',#{localCity},'%') |
| | | </if>) travelCount, |
| | | (select count(*) from com_act_acid_record where outside_city = '是' and is_del=0 |
| | | <if |
| | | test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | <if test="type == 1"> |
| | | and local_city like |
| | | concat('%','社区') |
| | | </if> |
| | | <if test="type == 2"> |
| | | and local_city like |
| | | concat('%','村') |
| | | </if> |
| | | <if test="date!=null and date!=''">and create_time between concat(#{date},' 00:00:00') and concat(#{date},' |
| | | 23:23:59') |
| | | </if> |
| | | <if test="localCity!=null and localCity!='' and localCity !='panzhihua'">and local_city like |
| | | concat('%',#{localCity},'%')</if>) outsideCount |
| | | concat('%',#{localCity},'%') |
| | | </if>) outsideCount |
| | | </select> |
| | | |
| | | <select id="pushStatics" resultType="com.panzhihua.common.model.vos.community.reserve.FiveCount"> |
| | |
| | | } |
| | | |
| | | @GetMapping("/communityList") |
| | | public R getCommunityList(@RequestParam(value = "type") Integer type){ |
| | | return userService.getCommunityList(type); |
| | | public R getCommunityList(@RequestParam("name") String name, @RequestParam(value = "id",required = false) Long id){ |
| | | return userService.getCommunityList(name,id); |
| | | } |
| | | |
| | | } |
| | |
| | | Map<String,Long> getDailyAddAndActive(@Param("date") Date date,@Param("id") Long streetId,@Param("areaCode") Long areaCode); |
| | | |
| | | |
| | | List<StreetVO> selectStreetByAreaCode(Integer code); |
| | | List<StreetVOS> selectStreetByAreaCode(Integer code); |
| | | |
| | | List<StreetVO> selectStreetsByAreaCode(Integer code); |
| | | |
| | | ComActAcidCheckRecordVO selectComActAcidCheckRecordById(Long id); |
| | | |
| | |
| | | * */ |
| | | List<CommunityVO> selectCommunityByStreetId(@Param("id") Integer streetId,@Param("type") Integer type); |
| | | |
| | | /** |
| | | * 获取账户id |
| | | * */ |
| | | List<Integer> selectIdsByAccount(@Param("array") String[] streetList); |
| | | |
| | | List<CommunityVO> selectCommunityByStreetName(String name); |
| | | |
| | | StreetVOS selectStreetByName(String name); |
| | | } |
| | |
| | | /** |
| | | * 获取城镇或村落列表 |
| | | * */ |
| | | R getCommunityList(Integer type); |
| | | R getCommunityList(String name,Long id); |
| | | } |
| | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUnit; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | return R.ok(); |
| | | } |
| | | @Override |
| | | public R getCommunityList(Integer type) { |
| | | List<Integer> areaList = areaCodeList(); |
| | | List<AreaVOS> areaVOList=new ArrayList<>(); |
| | | for (Integer code : areaList) { |
| | | AreaVOS areaVO=new AreaVOS(); |
| | | areaVO.setId(code); |
| | | areaVO.setName(areaCodeToName(code.longValue())); |
| | | List<StreetVO> streetVOS = userDao.selectStreetByAreaCode(code); |
| | | Iterator<StreetVO> iterator = streetVOS.listIterator(); |
| | | while (iterator.hasNext()){ |
| | | StreetVO vo = iterator.next(); |
| | | List<CommunityVO> communityVOS = userDao.selectCommunityByStreetId(vo.getId(), type); |
| | | vo.setCommunityList(communityVOS); |
| | | if (type!=3){ |
| | | if (communityVOS==null || communityVOS.size()==0){ |
| | | iterator.remove(); |
| | | public R getCommunityList(String name,Long id) { |
| | | //区级账号名 |
| | | String[] streetList={"bingcaogangjiedao","donghuajiedao","nongnongpingjiedao","dadukoujiedaojiedao","guazipingjiedao", |
| | | "yinjiangzhen","qingxiangpingjiedao","yuquanjiedao","hemenkoujiedao","dabaodingjiedao","taojiadujiedao","gelipinzhen","dahezhonglujiedao", |
| | | "jingjiangzhen","renhezhen","pingdizhen","datianzhen","tongdezhen","futianzhen","qianjinzhen","panlianzhen","binguzhen","baimazhen", |
| | | "salianzhen","puweizhen","deshizhen","wanqiuyizuxiang","caochangzhen","xinshanlisuzuxiang","tongzilinzhen","yongxingzhen","yumenzhen", |
| | | "honggezhen","hongguoyizuxiang"}; |
| | | List<Integer> ids = userDao.selectIdsByAccount(streetList); |
| | | //村或社区账号 |
| | | Integer type=isVilliage(name); |
| | | //是否为市级账号 |
| | | Boolean cityAccount = isCityAccount(name); |
| | | if (cityAccount){ |
| | | List<Integer> areaList=areaCodeList(); |
| | | List<AreaVOS> areaVOList=new ArrayList<>(); |
| | | for (Integer code : areaList) { |
| | | AreaVOS areaVO=new AreaVOS(); |
| | | areaVO.setId(code); |
| | | areaVO.setName(areaCodeToName(code.longValue())); |
| | | List<StreetVOS> streetVOS = userDao.selectStreetByAreaCode(code); |
| | | Iterator<StreetVOS> iterator = streetVOS.listIterator(); |
| | | while (iterator.hasNext()){ |
| | | StreetVOS vo = iterator.next(); |
| | | List<CommunityVO> communityVOS = userDao.selectCommunityByStreetId(vo.getId(), type); |
| | | vo.setChildList(communityVOS); |
| | | if (type!=3){ |
| | | if (communityVOS==null || communityVOS.size()==0){ |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | } |
| | | areaVO.setChildList(streetVOS); |
| | | areaVOList.add(areaVO); |
| | | } |
| | | List<StreetVOS> list=new ArrayList<>(); |
| | | for (StreetVO streetVO : streetVOS) { |
| | | StreetVOS vo=new StreetVOS(); |
| | | vo.setId(streetVO.getId()); |
| | | vo.setName(streetVO.getName()); |
| | | vo.setChildList(streetVO.getCommunityList()); |
| | | list.add(vo); |
| | | return R.ok(areaVOList); |
| | | }else{ |
| | | Boolean areaAccount = isAreaAccount(name); |
| | | if (areaAccount){ |
| | | Integer areaCode = accountToCode(name); |
| | | List<Integer> areaList=new ArrayList<>(); |
| | | areaList.add(areaCode); |
| | | List<AreaVOS> areaVOList=new ArrayList<>(); |
| | | for (Integer code : areaList) { |
| | | AreaVOS areaVO=new AreaVOS(); |
| | | areaVO.setId(code); |
| | | areaVO.setName(areaCodeToName(code.longValue())); |
| | | List<StreetVOS> streetVOS = userDao.selectStreetByAreaCode(code); |
| | | Iterator<StreetVOS> iterator = streetVOS.listIterator(); |
| | | while (iterator.hasNext()){ |
| | | StreetVOS vo = iterator.next(); |
| | | List<CommunityVO> communityVOS = userDao.selectCommunityByStreetId(vo.getId(), type); |
| | | vo.setChildList(communityVOS); |
| | | } |
| | | areaVO.setChildList(streetVOS); |
| | | areaVOList.add(areaVO); |
| | | } |
| | | return R.ok(areaVOList); |
| | | }else{ |
| | | //非区县账号,只看街道下属社区 |
| | | if (ArrayUtil.contains(streetList, name)){ |
| | | List<StreetVOS> list=new ArrayList<>(); |
| | | //只看当前街道下属社区 |
| | | StreetVOS streetVOS = userDao.selectStreetByName(name); |
| | | List<CommunityVO> communityVOS = userDao.selectCommunityByStreetName(name); |
| | | if (org.apache.commons.lang3.ObjectUtils.isNotEmpty(streetVOS)) { |
| | | streetVOS.setChildList(communityVOS); |
| | | } |
| | | list.add(streetVOS); |
| | | return R.ok(list); |
| | | } |
| | | } |
| | | areaVO.setChildList(list); |
| | | areaVOList.add(areaVO); |
| | | } |
| | | return R.ok(areaVOList); |
| | | return R.ok(null); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R getAreaAndStreet() { |
| | |
| | | AreaVO vo=new AreaVO(); |
| | | vo.setId(code); |
| | | vo.setName(areaCodeToName(code.longValue())); |
| | | vo.setStreetList(userDao.selectStreetByAreaCode(code)); |
| | | vo.setStreetList(userDao.selectStreetsByAreaCode(code)); |
| | | areaVOList.add(vo); |
| | | } |
| | | return R.ok(areaVOList); |
| | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 是否需要区分村落/社区 |
| | | * */ |
| | | private Integer isVilliage(String name){ |
| | | if ("fangyipingtai".equals(name)){ |
| | | return 3; |
| | | }else if ("pandashujuzhongxin".equals(name)){ |
| | | return 1; |
| | | }else if ("pannongyenongcunju".equals(name)){ |
| | | return 2; |
| | | } |
| | | return 3; |
| | | } |
| | | |
| | | /** |
| | | * 是否为市级账号 |
| | | * */ |
| | | private Boolean isCityAccount(String name){ |
| | | if(("fangyipingtai").equals(name) || ("pandashujuzhongxin").equals(name) || ("pannongyenongcunju").equals(name)){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 是否为区级账号 |
| | | * */ |
| | | private Boolean isAreaAccount(String name){ |
| | | Boolean flag=false; |
| | | switch (name){ |
| | | case "dongqu": |
| | | case "xiqu": |
| | | case "renhequ": |
| | | case "miyixian": |
| | | case "yanbianxian": |
| | | flag=true; |
| | | break; |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * account转区areaCode |
| | | * */ |
| | | private Integer accountToCode(String code){ |
| | | String name="100000"; |
| | | switch (code){ |
| | | case "xiqu" : |
| | | name= "510423"; |
| | | break; |
| | | case "dongqu": |
| | | name="510402"; |
| | | break; |
| | | case "renhequ": |
| | | name="510411"; |
| | | break; |
| | | case "miyixian": |
| | | name="510421"; |
| | | break; |
| | | case "yanbianxian": |
| | | name="510422"; |
| | | break; |
| | | case "fantaixinqu": |
| | | name="510424"; |
| | | break; |
| | | } |
| | | return Integer.parseInt(name); |
| | | } |
| | | |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectStreetByAreaCode" resultType="com.panzhihua.common.model.vos.user.StreetVO"> |
| | | <select id="selectStreetByAreaCode" resultType="com.panzhihua.common.model.vos.user.StreetVOS"> |
| | | select street_id as id,name as name from com_street where area_code=#{code} |
| | | </select> |
| | | <select id="selectStreetsByAreaCode" resultType="com.panzhihua.common.model.vos.user.StreetVO"> |
| | | select street_id as id,name as name from com_street where area_code=#{code} |
| | | </select> |
| | | <select id="selectComActAcidCheckRecordById" |
| | |
| | | and name like concat('%','村') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectIdsByAccount" resultType="java.lang.Integer"> |
| | | select user_id from sys_user where account in |
| | | <foreach collection="array" item="name" separator="," open="(" close=")" > |
| | | #{name} |
| | | </foreach> |
| | | </select> |
| | | <select id="selectCommunityByStreetName" resultType="com.panzhihua.common.model.vos.user.CommunityVO"> |
| | | select ca.community_id as id,ca.name as name |
| | | from sys_user as su |
| | | left join com_street as cs on cs.name=su.name |
| | | left join com_act as ca on ca.street_id=cs.street_id |
| | | where su.account=#{name} |
| | | </select> |
| | | <select id="selectStreetByName" resultType="com.panzhihua.common.model.vos.user.StreetVOS"> |
| | | select cs.street_id as id,cs.name as name |
| | | from sys_user as su |
| | | left join com_street as cs on su.name=cs.name |
| | | where su.account=#{name} |
| | | limit 1 |
| | | </select> |
| | | </mapper> |