Browse Source

【网格党建平面图】地图

master
HAHA 3 years ago
parent
commit
d712b8f349
  1. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyMapDataFormDTO.java
  2. 65
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyMapDataResultDTO.java
  3. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java
  4. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java
  5. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java
  6. 37
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java
  7. 21
      epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyMapDataFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VolunteerPolyMapDataFormDTO implements Serializable {
private static final long serialVersionUID = 341371496246696462L;
/**
* 志愿者分类code
*/
@NotBlank(message = "分类不能为空")
private String code;
private String customerId;
}

65
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyMapDataResultDTO.java

@ -0,0 +1,65 @@
package com.epmet.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VolunteerPolyMapDataResultDTO implements Serializable {
private static final long serialVersionUID = -6310126790215323874L;
/**
* 主键
*/
private String id;
/**
* 名字
*/
private String name;
/**
* 所属网格
*/
private String gridName;
/**
* 网格id
*/
private String gridId;
/**
* 所属房屋
*/
private String houseName;
/**
* 房屋id
*/
private String homeId;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 工作单位
*/
private String gzdw;
/**
* 人户状况
*/
private String rhzk;
}

20
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java

@ -1,7 +1,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -9,10 +11,13 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcVolunteerPolyDTO;
import com.epmet.dto.form.VolunteerPolyMapDataFormDTO;
import com.epmet.dto.result.VolunteerPolyMapDataResultDTO;
import com.epmet.service.IcVolunteerPolyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@ -67,5 +72,20 @@ public class IcVolunteerPolyController {
return new Result();
}
/**
* 网格党建平面图地图
*
* @param form
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.VolunteerPolyMapDataResultDTO>>
* @author LZN
* @date 2022/5/19 13:54
*/
@PostMapping("/mapData")
public Result<List<VolunteerPolyMapDataResultDTO>> getMapData(@RequestBody VolunteerPolyMapDataFormDTO form, @LoginUser TokenDto tokenDto){
form.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(form);
List<VolunteerPolyMapDataResultDTO> dto = icVolunteerPolyService.getMapData(form);
return new Result<List<VolunteerPolyMapDataResultDTO>>().ok(dto);
}
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java

@ -1,8 +1,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.VolunteerPolyMapDataResultDTO;
import com.epmet.entity.IcVolunteerPolyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 志愿者信息聚合
@ -12,5 +16,11 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcVolunteerPolyDao extends BaseDao<IcVolunteerPolyEntity> {
/**
* 网格党建平面图地图
* @param code
*/
List<VolunteerPolyMapDataResultDTO> getMapData(@Param("code") String code,
@Param("customerId") String customerId);
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java

@ -3,6 +3,8 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcVolunteerPolyDTO;
import com.epmet.dto.form.VolunteerPolyMapDataFormDTO;
import com.epmet.dto.result.VolunteerPolyMapDataResultDTO;
import com.epmet.entity.IcVolunteerPolyEntity;
import java.util.List;
@ -75,4 +77,14 @@ public interface IcVolunteerPolyService extends BaseService<IcVolunteerPolyEntit
* @date 2022-05-19
*/
void delete(String[] ids);
/**
* 网格党建平面图地图
*
* @param form
* @return java.util.List<com.epmet.dto.result.VolunteerPolyMapDataResultDTO>
* @author LZN
* @date 2022/5/19 13:55
*/
List<VolunteerPolyMapDataResultDTO> getMapData(VolunteerPolyMapDataFormDTO form);
}

37
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java

@ -4,10 +4,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.IcVolunteerPolyDao;
import com.epmet.dto.IcVolunteerPolyDTO;
import com.epmet.dto.form.VolunteerPolyMapDataFormDTO;
import com.epmet.dto.result.PartyUnitListbrieResultDTO;
import com.epmet.dto.result.VolunteerPolyMapDataResultDTO;
import com.epmet.entity.IcVolunteerPolyEntity;
import com.epmet.service.IcVolunteerPolyService;
import org.apache.commons.lang3.StringUtils;
@ -81,4 +88,34 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl<IcVolunteerPolyD
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 网格党建平面图地图
*
* @param form
* @return java.util.List<com.epmet.dto.result.VolunteerPolyMapDataResultDTO>
* @author LZN
* @date 2022/5/19 13:55
*/
@Override
public List<VolunteerPolyMapDataResultDTO> getMapData(VolunteerPolyMapDataFormDTO form) {
List<VolunteerPolyMapDataResultDTO> dto = baseDao.getMapData(form.getCode(),form.getCustomerId());
// 获取gridName
for (VolunteerPolyMapDataResultDTO item : dto) {
if (StringUtils.isNotEmpty(item.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId());
if (null != gridInfo) {
item.setGridName(gridInfo.getGridName());
}
}
// 获取houseName
if(StringUtils.isNotEmpty(item.getHomeId())) {
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(form.getCustomerId(), item.getHomeId());
if(null != houseInfo) {
item.setHouseName(houseInfo.getHouseName());
}
}
}
return dto;
}
}

21
epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml

@ -21,6 +21,27 @@
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
</resultMap>
<select id="getMapData" resultType="com.epmet.dto.result.VolunteerPolyMapDataResultDTO">
SELECT
u.id,
u.NAME,
u.mobile,
u.ID_CARD,
u.gzdw,
u.rhzk,
u.GRID_ID,
u.HOME_ID
FROM
ic_volunteer p
LEFT JOIN ic_resi_user u ON p.IC_RESI_USER = u.id and u.del_flag = '0'
<where>
p.del_flag = '0'
AND CUSTOMER_ID = #{customerId}
<if test="code != null and code != ''">
AND p.VOLUNTEER_CATEGORY = #{code}
</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save