| | |
| | | @ApiOperation(value = "列表查询",response = ComAreaCounty.class) |
| | | @GetMapping("/areaTownCommunity") |
| | | public R test(){ |
| | | return communityService.areaTownCommunity("panzhihua"); |
| | | return communityService.areaTownCommunity("panzhihua",this.getUserId()); |
| | | } |
| | | } |
| | |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("照片路径") |
| | | @NotBlank(groups = {AddGroup.class}, message = "照片不能为空") |
| | | private String photoPath; |
| | | |
| | | @ApiModelProperty("政治面貌:1 - 党员;2- 团员;3 - 群众") |
| | |
| | | |
| | | private Long releaseId; |
| | | |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | R updateBatchComActReserveDangerArea(@RequestBody EditDangerBatchDTO editDangerBatchDTO); |
| | | |
| | | @GetMapping("/comAreaTownCommunity/areaTownCommunity") |
| | | R areaTownCommunity(@RequestParam("name")String name); |
| | | R areaTownCommunity(@RequestParam("name")String name,@RequestParam("userId")Long userId); |
| | | |
| | | /** |
| | | * 物业公司详情 |
| | |
| | | @ApiOperation(value = "列表查询",response = ComAreaCounty.class) |
| | | @GetMapping("/areaTownCommunity") |
| | | public R test(){ |
| | | return communityService.areaTownCommunity(this.getLoginUserInfo().getName()); |
| | | return communityService.areaTownCommunity(this.getLoginUserInfo().getName(),this.getUserId()); |
| | | } |
| | | @ApiOperation(value = "新列表查询",response = ComAreaCounty.class) |
| | | @GetMapping("/areaTownCommunityNew") |
| | | public R testNew(){ |
| | | return communityService.areaTownCommunity("panzhihua"); |
| | | return communityService.areaTownCommunity("panzhihua",this.getUserId()); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.service_community.dao.ComAreaTownCommunityDao; |
| | | import com.panzhihua.common.model.vos.community.acid.ComAreaCounty; |
| | | import com.panzhihua.service_community.entity.ComAreaTownCommunity; |
| | | import com.panzhihua.service_community.service.ComAreaTownCommunityService; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @GetMapping("/areaTownCommunity") |
| | | public R test(@RequestParam("name")String name){ |
| | | public R test(@RequestParam("name")String name,@RequestParam("userId")Long userId){ |
| | | Long[] idArray={4L,17959L,16522L,16196L,16214L,17949L}; |
| | | if("panzhihua".equals(name)){ |
| | | List<ComAreaCounty> list=comAreaTownCommunityDao.selectArea(); |
| | | list.forEach(lis->{ |
| | | List<ComAreaCounty> townList=comAreaTownCommunityDao.selectTown(lis.getValue()); |
| | | townList.forEach(tow->{ |
| | | tow.setChildren(comAreaTownCommunityDao.selectCommunity(tow.getValue())); |
| | | List<ComAreaCounty> list1=new ArrayList<>(); |
| | | if(ArrayUtil.contains(idArray,userId)){ |
| | | list1=comAreaTownCommunityDao.selectCommunity(tow.getValue(),"学园社区"); |
| | | } |
| | | else { |
| | | list1=comAreaTownCommunityDao.selectCommunity(tow.getValue(),""); |
| | | } |
| | | tow.setChildren(list1); |
| | | }); |
| | | lis.setChildren(townList); |
| | | }); |
| | |
| | | List<ComAreaCounty> townList=comAreaTownCommunityDao.selectTown(name); |
| | | if(!CollectionUtils.isEmpty(townList)){ |
| | | townList.forEach(tow->{ |
| | | tow.setChildren(comAreaTownCommunityDao.selectCommunity(tow.getValue())); |
| | | List<ComAreaCounty> list1=new ArrayList<>(); |
| | | if(ArrayUtil.contains(idArray,userId)){ |
| | | list1=comAreaTownCommunityDao.selectCommunity(tow.getValue(),"学园社区"); |
| | | } |
| | | else { |
| | | list1=comAreaTownCommunityDao.selectCommunity(tow.getValue(),""); |
| | | } |
| | | tow.setChildren(list1); |
| | | }); |
| | | return R.ok(townList); |
| | | } |
| | | else { |
| | | List<ComAreaCounty> list=comAreaTownCommunityDao.selectCommunity(name); |
| | | return R.ok(list); |
| | | List<ComAreaCounty> list1=new ArrayList<>(); |
| | | if(ArrayUtil.contains(idArray,userId)){ |
| | | list1=comAreaTownCommunityDao.selectCommunity(name,"学园社区"); |
| | | } |
| | | else { |
| | | list1=comAreaTownCommunityDao.selectCommunity(name,""); |
| | | } |
| | | return R.ok(list1); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Select("<script> " + "SELECT\n" + "c.community_id,\n" + "c.`name`,\n" |
| | | + "ST_Distance_Sphere ( Point ( #{lng}, #{lat} ), Point ( c.lng, c.lat ) ) AS distance \n" + "FROM\n" |
| | | + "com_act c \n" + " <where>" + "<if test='areaCode != null and areaCode.trim() != ""'>" |
| | | + "c.area_code = #{areaCode} \n" + " </if> " + " </where>" + "ORDER BY\n" + "distance ASC" |
| | | + "com_act c \n" + "ORDER BY\n" + "distance ASC" |
| | | + "<if test='lng != null and lng.trim() != ""'>" + " limit 100 " + " </if> " + "</script>") |
| | | List<ComActVO> listCommunity(ComActVO comActVO); |
| | | |
| | |
| | | @Select("<script> " + "SELECT\n" + "a.* \n" + "FROM\n" + "com_act a \n" + " <where>" |
| | | + "<if test='pageComActDTO.name != null and pageComActDTO.name.trim() != ""'>" |
| | | + "and a.name LIKE concat( #{pageComActDTO.name}, '%' ) \n" + " </if> " |
| | | + "<if test='pageComActDTO.areaCode != null and pageComActDTO.areaCode.trim() != ""'>" |
| | | + "AND a.area_code = #{pageComActDTO.areaCode} \n" + " </if> " |
| | | + "<if test='pageComActDTO.createAtBegin != null '>" + "AND a.create_at BETWEEN " |
| | | + "#{pageComActDTO.createAtBegin} \n" + "AND #{pageComActDTO.createAtEnd}" + " </if> " + " </where>" |
| | | + " order by a.create_at desc" + "</script>") |
| | |
| | | @Select("<script> select ca.`name`,ca.street_id,ca.community_id,cs.`name` as streetName " + |
| | | "from com_act as ca " + |
| | | "left join com_street as cs on cs.street_id = ca.street_id " + |
| | | "where ca.state = 0 and ca.name like concat('%',#{name},'%') <if test='areaCode !=null and areaCode !=""'> and cs.area_code = #{areaCode} </if> </script> ") |
| | | "where ca.state = 0 and ca.name like concat('%',#{name},'%') </script> ") |
| | | List<CommunitySwitchAllAppletsVO> getCommunityListByName(@Param("name") String name,@Param("areaCode") String areaCode); |
| | | |
| | | @Select("SELECT c.community_id, c.`name`, c.street_id, cs.`name` as streetName," + |
| | | "round( ST_Distance_Sphere ( Point ( #{communityDTO.longitude}, #{communityDTO.latitude} ), Point ( c.lng, c.lat ) )/ 1000, 2 ) AS distance " + |
| | | "FROM com_act c left join com_street as cs on cs.street_id = c.street_id " + |
| | | "where cs.area_code = #{communityDTO.areaCode} " + |
| | | "HAVING distance >= 0 and distance <= #{communityDTO.distance} ORDER BY distance ASC") |
| | | List<CommunitySwitchAllAppletsVO> getCommunityListByNearby(@Param("communityDTO") SearchCommunityDTO communityDTO); |
| | | |
| | | @Select("<script> select community_id,name,lng,lat from com_act where state = 0 <if test='areaCode !=null'> and area_code = #{areaCode} </if> </script>") |
| | | @Select("<script> select community_id,name,lng,lat from com_act where state = 0 </script>") |
| | | List<EventGridCommunityAdminVO> getWestCommunityLists(@Param("areaCode") String areCode); |
| | | |
| | | @Select("select account,plaintext_password as password from com_act where community_id = ${communityId}") |
| | |
| | | import com.panzhihua.common.model.vos.community.acid.ComAreaCounty; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.ComAreaTownCommunity; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface ComAreaTownCommunityDao extends BaseMapper<ComAreaTownCommunity> { |
| | | List<ComAreaCounty> selectArea(); |
| | | List<ComAreaCounty> selectTown(String area); |
| | | List<ComAreaCounty> selectCommunity(String town); |
| | | List<ComAreaCounty> selectCommunity(@Param("town") String town,@Param("area")String area); |
| | | } |
| | |
| | | dangerMember.setRecordId(recordId); |
| | | dangerMember.setIdCard(comActAcidRecordVO.getIdCard()); |
| | | dangerMember.setSource(1); |
| | | dangerMember.setStatus(6); |
| | | dangerMember.setType(type); |
| | | dangerMember.setRelationName(relationName); |
| | | dangerMember.setUpdateTime(new Date()); |
| | |
| | | return null; |
| | | } |
| | | |
| | | private Integer[] A={6,7,8,9,10,11}; |
| | | |
| | | private Integer[] B={12,13,14,15,16,17,18,19,20,21,22}; |
| | | |
| | | private Integer[] C={23,24,25,26,27,28,29,30,31,32,33}; |
| | | |
| | | private Integer[] D={10,11,12,13,14}; |
| | | |
| | | public void test(){ |
| | | Random random=new Random(); |
| | | Integer a=random.nextInt(A.length); |
| | | Integer a_f=A[a]; |
| | | Integer b=random.nextInt(B.length); |
| | | Integer b_f=B[b]; |
| | | Integer[] B1=ArrayUtils.remove(B,b); |
| | | Integer c=random.nextInt(B1.length); |
| | | Integer c_f=B1[c]; |
| | | Integer d=random.nextInt(C.length); |
| | | Integer d_f=C[d]; |
| | | Integer[] c1=ArrayUtils.remove(C,d); |
| | | Integer e=random.nextInt(c1.length); |
| | | Integer e_f=c1[e]; |
| | | Integer[] c2=ArrayUtils.remove(c1,e); |
| | | Integer f=random.nextInt(c2.length); |
| | | Integer f_f=c2[f]; |
| | | Integer g=random.nextInt(D.length); |
| | | Integer g_f=D[g]; |
| | | Integer[] fi={a_f,+b_f,c_f,d_f,+e_f,f_f}; |
| | | Arrays.sort(fi); |
| | | Integer[] ffi=ArrayUtils.add(fi,g_f); |
| | | System.out.println(Arrays.toString(ffi)); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println("今日开奖预测:"); |
| | | for (int i=0;i<5;i++){ |
| | | ComAreaTownCommunityServiceImpl communityService=new ComAreaTownCommunityServiceImpl(); |
| | | communityService.test(); |
| | | } |
| | | } |
| | | } |
| | |
| | | ComProperty comPropertyBase=this.comPropertyDao.selectById(comPropertyVO.getId()); |
| | | AdministratorsUserVO administratorsUserVO=new AdministratorsUserVO(); |
| | | administratorsUserVO.setUserId(comPropertyBase.getUserId()); |
| | | administratorsUserVO.setAccount(comPropertyVO.getAccount()); |
| | | administratorsUserVO.setPassword(comPropertyVO.getPassword()); |
| | | administratorsUserVO.setRoleId(comPropertyVO.getRoleId()); |
| | | administratorsUserVO.setLastLoginTime(DateUtil.date()); |
| | | administratorsUserVO.setAreaId(comPropertyVO.getAreaId()); |
| | |
| | | </select> |
| | | |
| | | <select id="selectCommunity" resultType="com.panzhihua.common.model.vos.community.acid.ComAreaCounty"> |
| | | select distinct community as value,community_id from com_area_town_community where town =#{town} |
| | | select distinct community as value,community_id from com_area_town_community where town =#{town} <if test="area!=null and area !=''"> and community !='学园社区'</if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="pageList" resultType="com.panzhihua.common.model.vos.community.ComPropertyVO"> |
| | | select t.*,t1.account,t1.password,t2.address as areaName,t3.role_id as roleId from com_property t |
| | | select t.*,t1.account,t1.password,t2.name as areaName,t3.role_id as roleId from com_property t |
| | | left join sys_user t1 on t.user_id = t1.user_id |
| | | left join com_mng_village t2 on t.area_id = t2.village_id |
| | | left join sys_user_role t3 on t.user_id = t3.user_id |