Browse Source
# Conflicts: # epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.javamaster
474 changed files with 32715 additions and 185 deletions
@ -0,0 +1,162 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.epmet.commons.tools.constant.AppClientConstant; |
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
||||
|
import com.epmet.commons.tools.exception.RenException; |
||||
|
import com.epmet.commons.tools.feign.ResultDataResolver; |
||||
|
import com.epmet.commons.tools.redis.RedisKeys; |
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import com.epmet.commons.tools.security.password.PasswordUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.dto.CustomerStaffDTO; |
||||
|
import com.epmet.dto.form.LoginByPassWordFormDTO; |
||||
|
import com.epmet.dto.form.RootOrgListByStaffIdFormDTO; |
||||
|
import com.epmet.dto.result.StaffOrgsResultDTO; |
||||
|
import com.epmet.dto.result.UserTokenResultDTO; |
||||
|
import com.epmet.feign.EpmetUserFeignClient; |
||||
|
import com.epmet.feign.GovOrgOpenFeignClient; |
||||
|
import com.epmet.redis.CaptchaRedis; |
||||
|
import com.epmet.redis.IcLoginTicketCacheBean; |
||||
|
import com.epmet.service.IcLoginService; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.*; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("ic") |
||||
|
public class IcLoinController implements ResultDataResolver { |
||||
|
|
||||
|
public static final long IC_LOGIN_TICKET_EXPIRE_SECONDS = 2 * 60l; |
||||
|
|
||||
|
@Autowired |
||||
|
private EpmetUserFeignClient epmetUserFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
private CaptchaRedis captchaRedis; |
||||
|
|
||||
|
@Autowired |
||||
|
private IcLoginService icLoginService; |
||||
|
|
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
/** |
||||
|
* @description 基层治理赋能平台-根据手机号密码获取组织列表 |
||||
|
* |
||||
|
* @param input |
||||
|
* @return |
||||
|
* @author wxz |
||||
|
* @date 2021.10.25 09:56:33 |
||||
|
*/ |
||||
|
@PostMapping("getmyorgsbypassword") |
||||
|
public Result<HashMap<String, Object>> getMyOrgsByPassword(@RequestBody LoginByPassWordFormDTO input) { |
||||
|
ValidatorUtils.validateEntity(input, LoginByPassWordFormDTO.IcGetOrgsByPwdGroup.class); |
||||
|
String captcha = input.getCaptcha(); |
||||
|
String mobile = input.getMobile(); |
||||
|
String password = input.getPassword(); |
||||
|
String uuid = input.getUuid(); |
||||
|
|
||||
|
// 图片验证码
|
||||
|
String captchaInCache = captchaRedis.getIcLoginCaptcha(uuid); |
||||
|
if (StringUtils.isBlank(captchaInCache) || !captcha.equals(captchaInCache)) { |
||||
|
throw new RenException(EpmetErrorCode.ERR10019.getCode()); |
||||
|
} |
||||
|
|
||||
|
// 获取用户信息
|
||||
|
Result<List<CustomerStaffDTO>> staffResult = epmetUserFeignClient.checkCustomerStaff(mobile); |
||||
|
List<CustomerStaffDTO> staffList = getResultDataOrThrowsException(staffResult, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】获取用户信息失败"); |
||||
|
if (CollectionUtils.isEmpty(staffList)) { |
||||
|
throw new RenException(EpmetErrorCode.ERR10003.getCode()); |
||||
|
} |
||||
|
|
||||
|
CustomerStaffDTO staffInfo = staffList.get(0); |
||||
|
|
||||
|
if (!PasswordUtils.matches(password, staffInfo.getPassword())) { |
||||
|
throw new RenException(EpmetErrorCode.ERR10004.getCode()); |
||||
|
} |
||||
|
|
||||
|
String staffId = staffInfo.getUserId(); |
||||
|
|
||||
|
// 查询跟组织列表
|
||||
|
RootOrgListByStaffIdFormDTO orgListForm = new RootOrgListByStaffIdFormDTO(); |
||||
|
orgListForm.setStaffId(staffId); |
||||
|
Result<List<StaffOrgsResultDTO>> orgListResult = govOrgOpenFeignClient.getStaffOrgListByStaffId(orgListForm); |
||||
|
List<StaffOrgsResultDTO> orgs = getResultDataOrThrowsException(orgListResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】根据staffId查询所属客户跟组织列表失败"); |
||||
|
|
||||
|
// 生成登录票据
|
||||
|
String ticket = UUID.randomUUID().toString().replace("-", ""); |
||||
|
IcLoginTicketCacheBean ticketCacheBean = new IcLoginTicketCacheBean(); |
||||
|
ticketCacheBean.setMobile(mobile); |
||||
|
ticketCacheBean.setStaffId(staffId); |
||||
|
cacheTicket(ticket, ticketCacheBean); |
||||
|
|
||||
|
HashMap<String, Object> resultMap = new HashMap<>(); |
||||
|
resultMap.put("staffId", staffId); |
||||
|
resultMap.put("ticket", ticket); |
||||
|
resultMap.put("orgs", orgs); |
||||
|
|
||||
|
return new Result<HashMap<String, Object>>().ok(resultMap); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description IC登录 |
||||
|
* |
||||
|
* @param input |
||||
|
* @return |
||||
|
* @author wxz |
||||
|
* @date 2021.10.25 21:14:22 |
||||
|
*/ |
||||
|
@PostMapping("login") |
||||
|
public Result<UserTokenResultDTO> login(@RequestBody LoginByPassWordFormDTO input) { |
||||
|
ValidatorUtils.validateEntity(input, LoginByPassWordFormDTO.IcLoginGroup.class); |
||||
|
String ticket = input.getTicket(); |
||||
|
String orgId = input.getRootAgencyId(); |
||||
|
String staffId = input.getStaffId(); |
||||
|
|
||||
|
// ticket校验
|
||||
|
IcLoginTicketCacheBean ticketCache = getTicketCache(ticket); |
||||
|
if (ticketCache == null || !ticketCache.getStaffId().equals(staffId)) { |
||||
|
// ticket&userId不对应
|
||||
|
throw new RenException(EpmetErrorCode.ERR10008.getCode()); |
||||
|
} |
||||
|
|
||||
|
UserTokenResultDTO tokenInfo = icLoginService.login(staffId, orgId); |
||||
|
return new Result<UserTokenResultDTO>().ok(tokenInfo); |
||||
|
} |
||||
|
|
||||
|
private void cacheTicket(String ticket, IcLoginTicketCacheBean cacheBean) { |
||||
|
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(cacheBean, false, true); |
||||
|
redisUtils.hMSet(RedisKeys.loginTicket(AppClientConstant.APP_IC, ticket), stringObjectMap, IC_LOGIN_TICKET_EXPIRE_SECONDS); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description 从缓存中取出ticket,并删除 |
||||
|
* |
||||
|
* @param ticket |
||||
|
* @return |
||||
|
* @author wxz |
||||
|
* @date 2021.10.26 08:58:27 |
||||
|
*/ |
||||
|
private IcLoginTicketCacheBean getTicketCache(String ticket) { |
||||
|
String key = RedisKeys.loginTicket(AppClientConstant.APP_IC, ticket); |
||||
|
Map<String, Object> map = redisUtils.hGetAll(key); |
||||
|
if (CollectionUtils.sizeIsEmpty(map)) { |
||||
|
return null; |
||||
|
} |
||||
|
redisUtils.expire(key, 0); |
||||
|
return BeanUtil.mapToBean(map, IcLoginTicketCacheBean.class, false); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class IcLoginTicketCacheBean { |
||||
|
private String staffId; |
||||
|
private String mobile; |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.dto.result.UserTokenResultDTO; |
||||
|
|
||||
|
public interface IcLoginService { |
||||
|
|
||||
|
|
||||
|
UserTokenResultDTO login(String staffId, String orgId); |
||||
|
} |
||||
@ -0,0 +1,177 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.epmet.auth.constants.AuthOperationConstants; |
||||
|
import com.epmet.commons.rocketmq.messages.LoginMQMsg; |
||||
|
import com.epmet.commons.tools.constant.AppClientConstant; |
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
||||
|
import com.epmet.commons.tools.exception.RenException; |
||||
|
import com.epmet.commons.tools.feign.ResultDataResolver; |
||||
|
import com.epmet.commons.tools.redis.RedisKeys; |
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import com.epmet.commons.tools.security.dto.IcTokenDto; |
||||
|
import com.epmet.commons.tools.utils.CpUserDetailRedis; |
||||
|
import com.epmet.commons.tools.utils.IpUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.CustomerAgencyDTO; |
||||
|
import com.epmet.dto.form.SystemMsgFormDTO; |
||||
|
import com.epmet.dto.result.UserTokenResultDTO; |
||||
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
||||
|
import com.epmet.feign.GovOrgOpenFeignClient; |
||||
|
import com.epmet.jwt.JwtTokenProperties; |
||||
|
import com.epmet.jwt.JwtTokenUtils; |
||||
|
import com.epmet.service.IcLoginService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import java.util.*; |
||||
|
|
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver { |
||||
|
|
||||
|
@Autowired |
||||
|
private JwtTokenUtils jwtTokenUtils; |
||||
|
|
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
@Autowired |
||||
|
private CpUserDetailRedis cpUserDetailRedis; |
||||
|
|
||||
|
@Autowired |
||||
|
private JwtTokenProperties jwtTokenProperties; |
||||
|
|
||||
|
@Autowired |
||||
|
private EpmetMessageOpenFeignClient messageOpenFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
private ThirdLoginServiceImpl thirdLoginService; |
||||
|
|
||||
|
@Override |
||||
|
public UserTokenResultDTO login(String staffId, String orgId) { |
||||
|
String app = AppClientConstant.APP_IC; |
||||
|
String client = AppClientConstant.CLIENT_WEB; |
||||
|
|
||||
|
// 1.获取用户token
|
||||
|
String token = this.generateIcToken(staffId, app, client); |
||||
|
|
||||
|
Result<CustomerAgencyDTO> agencyResult = govOrgOpenFeignClient.getAgencyById(orgId); |
||||
|
CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(agencyResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【IC平台登录】获取组织信息失败"); |
||||
|
|
||||
|
// 2.缓存token
|
||||
|
cacheToken(app, client, staffId, token, orgId, agencyInfo.getCustomerId()); |
||||
|
|
||||
|
UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); |
||||
|
userTokenResultDTO.setToken(token); |
||||
|
userTokenResultDTO.setCustomerId(agencyInfo.getCustomerId()); |
||||
|
|
||||
|
//7.发送登录事件
|
||||
|
try { |
||||
|
sendLoginEvent(staffId, app, client); |
||||
|
} catch (RenException e) { |
||||
|
log.error(e.getInternalMsg()); |
||||
|
} catch (Exception e) { |
||||
|
log.error("【工作端workLogin登录】发送登录事件失败,程序继续执行。"); |
||||
|
} |
||||
|
|
||||
|
return userTokenResultDTO; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param staffId |
||||
|
* @return |
||||
|
* @description 生成Ic平台的Token |
||||
|
* @author wxz |
||||
|
* @date 2021.10.26 13:42:36 |
||||
|
*/ |
||||
|
private String generateIcToken(String staffId, String app, String client) { |
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
map.put("app", app); |
||||
|
map.put("client", client); |
||||
|
map.put("userId", staffId); |
||||
|
String token = jwtTokenUtils.createToken(map); |
||||
|
return token; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param userId |
||||
|
* @param fromApp |
||||
|
* @param fromClient |
||||
|
* @return |
||||
|
* @description 发布登录时间 |
||||
|
* @author wxz |
||||
|
* @date 2021.10.26 13:45:59 |
||||
|
*/ |
||||
|
private void sendLoginEvent(String userId, String fromApp, String fromClient) { |
||||
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
||||
|
|
||||
|
LoginMQMsg loginMQMsg = new LoginMQMsg(); |
||||
|
loginMQMsg.setUserId(userId); |
||||
|
loginMQMsg.setLoginTime(new Date()); |
||||
|
loginMQMsg.setIp(IpUtils.getIpAddr(request)); |
||||
|
loginMQMsg.setFromApp(fromApp); |
||||
|
loginMQMsg.setFromClient(fromClient); |
||||
|
|
||||
|
SystemMsgFormDTO form = new SystemMsgFormDTO(); |
||||
|
form.setMessageType(AuthOperationConstants.LOGIN); |
||||
|
form.setContent(loginMQMsg); |
||||
|
messageOpenFeignClient.sendSystemMsgByMQ(form); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description 缓存token到redis |
||||
|
* |
||||
|
* @param app |
||||
|
* @param client |
||||
|
* @param userId |
||||
|
* @param token |
||||
|
* @param rootAgencyId |
||||
|
* @return |
||||
|
* @author wxz |
||||
|
* @date 2021.10.26 14:19:07 |
||||
|
*/ |
||||
|
private void cacheToken(String app, |
||||
|
String client, |
||||
|
String userId, |
||||
|
String token, |
||||
|
String rootAgencyId, |
||||
|
String customerId) { |
||||
|
|
||||
|
IcTokenDto tokenDto = new IcTokenDto(); |
||||
|
int expire = jwtTokenProperties.getExpire(); |
||||
|
long expireTime = jwtTokenUtils.getExpiration(token).getTime(); |
||||
|
|
||||
|
tokenDto.setApp(app); |
||||
|
tokenDto.setClient(client); |
||||
|
tokenDto.setUserId(userId); |
||||
|
tokenDto.setToken(token); |
||||
|
tokenDto.setExpireTime(expireTime); |
||||
|
tokenDto.setRootAgencyId(rootAgencyId); |
||||
|
tokenDto.setCustomerId(customerId); |
||||
|
|
||||
|
//设置部门,网格,角色列表
|
||||
|
tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId)); |
||||
|
tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId)); |
||||
|
CustomerAgencyDTO agency = thirdLoginService.getAgencyByStaffId(userId); |
||||
|
if (agency != null) { |
||||
|
tokenDto.setAgencyId(agency.getId()); |
||||
|
tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, agency.getId())); |
||||
|
} |
||||
|
tokenDto.setOrgIdPath(thirdLoginService.getOrgIdPath(userId)); |
||||
|
|
||||
|
String key = RedisKeys.getCpUserKey(app, client, userId); |
||||
|
Map<String, Object> map = BeanUtil.beanToMap(tokenDto, false, true); |
||||
|
redisUtils.hMSet(key, map, expire); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.epmet.commons.rocketmq.constants; |
||||
|
|
||||
|
/** |
||||
|
* @Description MQ用户自定义属性 |
||||
|
* @author wxz |
||||
|
* @date 2021.10.14 15:47:03 |
||||
|
*/ |
||||
|
public interface MQUserPropertys { |
||||
|
|
||||
|
//阻塞消息label
|
||||
|
String BLOCKED_MSG_LABEL = "blockedMsgLabel"; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.epmet.commons.rocketmq.messages; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/10/18 16:24 |
||||
|
*/ |
||||
|
@Data |
||||
|
@AllArgsConstructor |
||||
|
public class DisputeProcessMQMsg implements Serializable { |
||||
|
private String customerId; |
||||
|
private String projectId; |
||||
|
/** |
||||
|
* 操作类型【新增:add 修改删除:edit】 |
||||
|
*/ |
||||
|
private String type; |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
package com.epmet.commons.rocketmq.messages; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 组织、网格、人员中间库数据上报MQ |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OrgOrStaffMQMsg implements Serializable { |
||||
|
|
||||
|
//客户Id
|
||||
|
private String customerId; |
||||
|
//组织、网格、人员Id
|
||||
|
private String orgId; |
||||
|
//数据类型【组织:agency 网格:grid 人员:staff】
|
||||
|
private String orgType; |
||||
|
//操作类型【组织新增:agency_create 组织变更:agency_change 网格新增:grid_create 网格变更:grid_change 人员新增:staff_create 人员变更:staff_change】
|
||||
|
private String type; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.commons.rocketmq.messages; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 用户巡查消息体 |
||||
|
* @author liujianjun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class StaffPatrolMQMsg { |
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 巡查记录id |
||||
|
*/ |
||||
|
private String patrolId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.commons.tools.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/10/26 13:53 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OptionResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 8618231166600518980L; |
||||
|
private String label; |
||||
|
private String value; |
||||
|
private List<OptionResultDTO> children; |
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.epmet.commons.tools.enums; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
||||
|
|
||||
|
public enum GenderEnum { |
||||
|
MAN("1", "男"), |
||||
|
WOMAN("2", "女"), |
||||
|
UN_KNOWN("0", "未知"); |
||||
|
|
||||
|
private String code; |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
GenderEnum(String code, String name) { |
||||
|
this.code = code; |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public static String getName(String code) { |
||||
|
GenderEnum[] genderEnums = values(); |
||||
|
for (GenderEnum genderEnum : genderEnums) { |
||||
|
if (genderEnum.getCode() == code) { |
||||
|
return genderEnum.getName(); |
||||
|
} |
||||
|
} |
||||
|
return EpmetErrorCode.SERVER_ERROR.getMsg(); |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
package com.epmet.commons.tools.enums; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
||||
|
|
||||
|
public enum HouseTypeEnum { |
||||
|
//房屋类型,1楼房,2平房,3别墅
|
||||
|
LOUFANG("1", "楼房"), |
||||
|
PINGFANG("2", "平房"), |
||||
|
BIESHU("3", "别墅"); |
||||
|
|
||||
|
private String code; |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
HouseTypeEnum(String code, String name) { |
||||
|
this.code = code; |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public static String getName(String code) { |
||||
|
HouseTypeEnum[] houseTypeEnums = values(); |
||||
|
for (HouseTypeEnum houseTypeEnum : houseTypeEnums) { |
||||
|
if (houseTypeEnum.getCode() == code) { |
||||
|
return houseTypeEnum.getName(); |
||||
|
} |
||||
|
} |
||||
|
return EpmetErrorCode.SERVER_ERROR.getMsg(); |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.epmet.commons.tools.feign; |
||||
|
|
||||
|
import feign.RequestInterceptor; |
||||
|
import feign.RequestTemplate; |
||||
|
import org.springframework.web.context.request.RequestAttributes; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import java.util.Enumeration; |
||||
|
|
||||
|
|
||||
|
public class EpmetBaseRequestInterceptor implements RequestInterceptor { |
||||
|
|
||||
|
@Override |
||||
|
public void apply(RequestTemplate template) { |
||||
|
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
||||
|
if (requestAttributes == null) { |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest(); |
||||
|
Enumeration<String> headerNames = request.getHeaderNames(); |
||||
|
if (headerNames != null) { |
||||
|
while (headerNames.hasMoreElements()) { |
||||
|
String name = headerNames.nextElement(); |
||||
|
Enumeration<String> values = request.getHeaders(name); |
||||
|
while (values.hasMoreElements()) { |
||||
|
String value = values.nextElement(); |
||||
|
template.header(name, value); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,81 @@ |
|||||
|
package com.epmet.commons.tools.security.dto; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* @Description ic平台token |
||||
|
* @author wxz |
||||
|
* @date 2021.10.26 13:58:03 |
||||
|
*/ |
||||
|
@Data |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
public class IcTokenDto extends BaseTokenDto { |
||||
|
|
||||
|
/** |
||||
|
* 当前登录的组织id(顶级) |
||||
|
*/ |
||||
|
private String rootAgencyId; |
||||
|
|
||||
|
/** |
||||
|
* 当前用户所属的机关单位id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 当前网格对应的组织结构id的全路径用:隔开 |
||||
|
*/ |
||||
|
private String orgIdPath; |
||||
|
|
||||
|
/** |
||||
|
* 当前所在网格id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/*** |
||||
|
* 所在网格列表 |
||||
|
*/ |
||||
|
private Set<String> gridIdList; |
||||
|
|
||||
|
/** |
||||
|
* 部门id列表 |
||||
|
*/ |
||||
|
private Set<String> deptIdList; |
||||
|
|
||||
|
/** |
||||
|
* 功能权限列表,实际上是gov_staff => staff_role => role_operation查询到的operationKey |
||||
|
*/ |
||||
|
private Set<String> permissions; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID列表 |
||||
|
*/ |
||||
|
private List<GovTokenDto.Role> roleList; |
||||
|
|
||||
|
/** |
||||
|
* 过期时间戳 |
||||
|
*/ |
||||
|
private Long expireTime; |
||||
|
|
||||
|
@Data |
||||
|
public static class Role { |
||||
|
|
||||
|
private String id; |
||||
|
private String roleKey; |
||||
|
private String roleName; |
||||
|
|
||||
|
public Role() { |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return JSON.toJSONString(this); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Description TODO |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/10/27 4:26 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcFormResColumnDTO { |
||||
|
private String tableName; |
||||
|
private String columnName; |
||||
|
private String label; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 查看详情,回显表单 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/10/27 10:22 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiDetailFormDTO implements Serializable { |
||||
|
public interface AddUserInternalGroup { |
||||
|
} |
||||
|
@NotBlank(message = "icResiUserId不能为空",groups = AddUserInternalGroup.class) |
||||
|
private String icResiUserId; |
||||
|
|
||||
|
@NotBlank(message = "formCode不能为空", groups = AddUserInternalGroup.class) |
||||
|
private String formCode; |
||||
|
|
||||
|
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,38 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 居民信息,分页查询入参 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/10/27 2:06 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiUserPageFormDTO implements Serializable { |
||||
|
public interface AddUserInternalGroup { |
||||
|
} |
||||
|
|
||||
|
@NotNull(message = "pageNo不能为空", groups = AddUserInternalGroup.class) |
||||
|
private Integer pageNo; |
||||
|
|
||||
|
@NotNull(message = "pageSize不能为空", groups = AddUserInternalGroup.class) |
||||
|
private Integer pageSize; |
||||
|
|
||||
|
@NotBlank(message = "formCode不能为空", groups = AddUserInternalGroup.class) |
||||
|
private String formCode; |
||||
|
|
||||
|
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 表对应的字段及值 |
||||
|
*/ |
||||
|
private List<ResiUserQueryValueDTO> conditions; |
||||
|
private Boolean pageFlag; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description TODO |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/10/27 6:02 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ResiUserQueryValueDTO implements Serializable { |
||||
|
private String queryType; |
||||
|
private List<String> columnValue; |
||||
|
private String columnName; |
||||
|
private String tableName; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,173 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 居民信息分页查询表单返参 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/10/27 2:07 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiUserPageResultDTO implements Serializable { |
||||
|
private String icResiUserId; |
||||
|
private String gridId; |
||||
|
private String gridName; |
||||
|
/** |
||||
|
* 所属小区ID |
||||
|
*/ |
||||
|
private String villageId; |
||||
|
private String vallageName; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 所属楼宇Id |
||||
|
*/ |
||||
|
private String buildId; |
||||
|
private String buildName; |
||||
|
|
||||
|
/** |
||||
|
* 单元id |
||||
|
*/ |
||||
|
private String unitId; |
||||
|
private String unitName; |
||||
|
|
||||
|
/** |
||||
|
* 所属家庭Id |
||||
|
*/ |
||||
|
private String homeId; |
||||
|
private String homeName; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 性别 |
||||
|
*/ |
||||
|
private String gender; |
||||
|
|
||||
|
/** |
||||
|
* 身份证号 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期 |
||||
|
*/ |
||||
|
private String birthday; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remarks; |
||||
|
|
||||
|
/** |
||||
|
* 是否党员 |
||||
|
*/ |
||||
|
private Boolean isParty; |
||||
|
|
||||
|
/** |
||||
|
* 是否低保户 |
||||
|
*/ |
||||
|
private Boolean isDbh; |
||||
|
|
||||
|
/** |
||||
|
* 是否保障房 |
||||
|
*/ |
||||
|
private Boolean isEnsureHouse; |
||||
|
|
||||
|
/** |
||||
|
* 是否失业 |
||||
|
*/ |
||||
|
private Boolean isUnemployed; |
||||
|
|
||||
|
/** |
||||
|
* 是否育龄妇女 |
||||
|
*/ |
||||
|
private Boolean isYlfn; |
||||
|
|
||||
|
/** |
||||
|
* 是否退役军人 |
||||
|
*/ |
||||
|
private Boolean isVeterans; |
||||
|
|
||||
|
/** |
||||
|
* 是否统战人员 |
||||
|
*/ |
||||
|
private Boolean isUnitedFront; |
||||
|
|
||||
|
/** |
||||
|
* 是否信访人员 |
||||
|
*/ |
||||
|
private Boolean isXfry; |
||||
|
|
||||
|
/** |
||||
|
* 是否志愿者 |
||||
|
*/ |
||||
|
private Boolean isVolunteer; |
||||
|
|
||||
|
/** |
||||
|
* 是否老年人 |
||||
|
*/ |
||||
|
private Boolean isOldPeople; |
||||
|
|
||||
|
/** |
||||
|
* 是否空巢 |
||||
|
*/ |
||||
|
private Boolean isKc; |
||||
|
|
||||
|
/** |
||||
|
* 是否失独 |
||||
|
*/ |
||||
|
private Boolean isSd; |
||||
|
|
||||
|
/** |
||||
|
* 是否失能 |
||||
|
*/ |
||||
|
private Boolean isSn; |
||||
|
|
||||
|
/** |
||||
|
* 是否失智 |
||||
|
*/ |
||||
|
private Boolean isSz; |
||||
|
|
||||
|
/** |
||||
|
* 是否残疾 |
||||
|
*/ |
||||
|
private Boolean isCj; |
||||
|
|
||||
|
/** |
||||
|
* 是否大病 |
||||
|
*/ |
||||
|
private Boolean isDb; |
||||
|
|
||||
|
/** |
||||
|
* 是否慢病 |
||||
|
*/ |
||||
|
private Boolean isMb; |
||||
|
|
||||
|
/** |
||||
|
* 是否特殊人群 |
||||
|
*/ |
||||
|
private Boolean isSpecial; |
||||
|
|
||||
|
|
||||
|
// 以下属性都需要单独处理,不是直接取数据库的字段
|
||||
|
private String demandCategoryIds; |
||||
|
|
||||
|
private String demandName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋类型,1楼房,2平房,3别墅 |
||||
|
*/ |
||||
|
private String houseType; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,61 @@ |
|||||
|
package com.epmet.dataaggre.dto.govorg.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description TODO |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/10/28 2:05 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class HouseInfoDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -5204197079709062825L; |
||||
|
/** |
||||
|
* 所属家庭Id |
||||
|
*/ |
||||
|
private String homeId; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 小区id |
||||
|
*/ |
||||
|
private String neighborHoodId; |
||||
|
/** |
||||
|
* 小区名称 |
||||
|
*/ |
||||
|
private String neighborHoodName; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 所属楼栋id |
||||
|
*/ |
||||
|
private String buildingId; |
||||
|
/** |
||||
|
* 楼栋名称 |
||||
|
*/ |
||||
|
private String buildingName; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 所属单元id |
||||
|
*/ |
||||
|
private String buildingUnitId; |
||||
|
/** |
||||
|
* 单元名 |
||||
|
*/ |
||||
|
private String unitName; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 门牌号 |
||||
|
*/ |
||||
|
private String doorName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋类型,1楼房,2平房,3别墅 |
||||
|
*/ |
||||
|
private String houseType; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,72 @@ |
|||||
|
package com.epmet.dataaggre.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.annotation.LoginUser; |
||||
|
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.ValidatorUtils; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; |
||||
|
import com.epmet.dataaggre.service.epmetuser.IcResiUserService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Description TODO |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/10/27 2:03 下午 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icresiuser") |
||||
|
public class IcResiUserController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiUserService icResiUserService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 分页查询居民信息列表 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param pageFormDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData<com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO>> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/10/28 10:29 上午 |
||||
|
*/ |
||||
|
//@PostMapping("listresi1")
|
||||
|
public Result<PageData<IcResiUserPageResultDTO>> queryListResi(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO){ |
||||
|
//pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
|
||||
|
pageFormDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
ValidatorUtils.validateEntity(pageFormDTO,IcResiUserPageFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<PageData<IcResiUserPageResultDTO>>().ok(icResiUserService.pageResi(pageFormDTO)); |
||||
|
} |
||||
|
|
||||
|
//@PostMapping("listresi")
|
||||
|
public Result<PageData<Map<String,Object>>> queryListResi1(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO){ |
||||
|
//pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
|
||||
|
pageFormDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
ValidatorUtils.validateEntity(pageFormDTO,IcResiUserPageFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<PageData<Map<String,Object>>>().ok(icResiUserService.pageResiMap(pageFormDTO)); |
||||
|
} |
||||
|
/** |
||||
|
* 编辑页面,显示居民信息详情 |
||||
|
* |
||||
|
* @param pageFormDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/10/28 10:29 上午 |
||||
|
*/ |
||||
|
//@PostMapping("detail")
|
||||
|
public Result queryIcResiDetail(@LoginUser TokenDto tokenDto,@RequestBody IcResiDetailFormDTO pageFormDTO){ |
||||
|
//pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
|
||||
|
pageFormDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
ValidatorUtils.validateEntity(pageFormDTO,IcResiDetailFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result().ok(icResiUserService.queryIcResiDetail(pageFormDTO)); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,45 @@ |
|||||
|
package com.epmet.dataaggre.dao.epmetuser; |
||||
|
|
||||
|
import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.form.ResiUserQueryValueDTO; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface IcResiUserDao { |
||||
|
List<IcResiUserPageResultDTO> selectListResi(@Param("customerId") String customerId, |
||||
|
@Param("formCode") String formCode, |
||||
|
@Param("conditions") List<ResiUserQueryValueDTO> conditions, |
||||
|
@Param("resultColumns") List<IcFormResColumnDTO> resultColumns, |
||||
|
@Param("subTables") List<String> subTables); |
||||
|
List<Map<String,Object>> selectListResiMap(@Param("customerId") String customerId, |
||||
|
@Param("formCode") String formCode, |
||||
|
@Param("conditions") List<ResiUserQueryValueDTO> conditions, |
||||
|
@Param("resultColumns") List<IcFormResColumnDTO> resultColumns, |
||||
|
@Param("subTables") List<String> subTables); |
||||
|
/** |
||||
|
* 查询主表 |
||||
|
* |
||||
|
* @param icResiUserId |
||||
|
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/10/28 11:20 上午 |
||||
|
*/ |
||||
|
List<Map<String, Object>> selectById(String icResiUserId); |
||||
|
|
||||
|
/** |
||||
|
* 根据ic_resi_user.id去查询各个子表记录,动态传入表名 |
||||
|
* |
||||
|
* @param icResiUserId |
||||
|
* @param tableName |
||||
|
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/10/28 11:19 上午 |
||||
|
*/ |
||||
|
List<Map<String, Object>> selectSubTableRecords(@Param("icResiUserId") String icResiUserId,@Param("tableName") String tableName); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
package com.epmet.dataaggre.service.epmetuser; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
public interface IcResiUserService { |
||||
|
/** |
||||
|
* 分页查询居民信息列表 |
||||
|
* |
||||
|
* @param pageFormDTO |
||||
|
* @return com.epmet.commons.tools.page.PageData<com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/10/28 10:30 上午 |
||||
|
*/ |
||||
|
@Deprecated |
||||
|
PageData<IcResiUserPageResultDTO> pageResi(IcResiUserPageFormDTO pageFormDTO); |
||||
|
|
||||
|
PageData<Map<String,Object>> pageResiMap(IcResiUserPageFormDTO formDTO); |
||||
|
/** |
||||
|
* 编辑页面,显示居民信息详情 |
||||
|
* |
||||
|
* @param pageFormDTO |
||||
|
* @return java.util.Map |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/10/28 10:29 上午 |
||||
|
*/ |
||||
|
Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO); |
||||
|
} |
||||
@ -0,0 +1,255 @@ |
|||||
|
package com.epmet.dataaggre.service.epmetuser.impl; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.constant.StrConstant; |
||||
|
import com.epmet.commons.tools.enums.GenderEnum; |
||||
|
import com.epmet.commons.tools.enums.HouseTypeEnum; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
||||
|
import com.epmet.dataaggre.constant.OrgConstant; |
||||
|
import com.epmet.dataaggre.dao.epmetuser.IcResiUserDao; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; |
||||
|
import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; |
||||
|
import com.epmet.dataaggre.dto.govorg.result.HouseInfoDTO; |
||||
|
import com.epmet.dataaggre.service.epmetuser.IcResiUserService; |
||||
|
import com.epmet.dataaggre.service.govorg.GovOrgService; |
||||
|
import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import com.github.pagehelper.PageInfo; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import java.util.*; |
||||
|
import java.util.function.Function; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @Description TODO |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/10/27 2:04 下午 |
||||
|
*/ |
||||
|
@Service |
||||
|
@DataSource(DataSourceConstant.EPMET_USER) |
||||
|
@Slf4j |
||||
|
public class IcResiUserServiceImpl implements IcResiUserService { |
||||
|
@Autowired |
||||
|
private IcResiUserDao icResiUserDao; |
||||
|
@Autowired |
||||
|
private CustomerFootBarService customerFootBarService; |
||||
|
@Autowired |
||||
|
private GovOrgService govOrgService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 分页查询居民信息列表 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.page.PageData<com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/10/28 10:30 上午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public PageData<IcResiUserPageResultDTO> pageResi(IcResiUserPageFormDTO formDTO) { |
||||
|
// 查询列表展示项,如果没有,直接返回
|
||||
|
List<IcFormResColumnDTO> resultColumns = customerFootBarService.queryConditions(formDTO.getCustomerId(), formDTO.getFormCode()); |
||||
|
if (CollectionUtils.isEmpty(resultColumns)) { |
||||
|
log.warn("没有配置列表展示列"); |
||||
|
return new PageData(new ArrayList(), NumConstant.ZERO); |
||||
|
} |
||||
|
log.warn("列表展示项:" + JSON.toJSONString(resultColumns)); |
||||
|
// 查询列表展示项需要用到哪些子表
|
||||
|
// 拼接好的left join table_name on (ic_resi_user.ID=table_name.IC_RESI_USER AND table_name.del_flag='0')
|
||||
|
List<String> subTables = customerFootBarService.querySubTables(formDTO.getCustomerId(), formDTO.getFormCode()); |
||||
|
log.warn("子表:" + JSON.toJSONString(subTables)); |
||||
|
/* Set<String> subTableList=resultColumns.stream().filter(item->!item.getTableName().equals("ic_resi_user") |
||||
|
&& StringUtils.isNotBlank(item.getLink())) |
||||
|
.map(IcFormResColumnDTO :: getTableName).collect(Collectors.toSet()); |
||||
|
List<String> subTables=new ArrayList<>(); |
||||
|
subTableList.forEach(tableName->{ |
||||
|
//'left join ',temp.TABLE_NAME, ' on ( ic_resi_user.ID=',temp.TABLE_NAME,'.IC_RESI_USER and ',temp.TABLE_NAME,'.del_flag="0" )'
|
||||
|
String joinSql=String.format("% join %s on ( ic_resi_user.ID=%s.IC_RESI_USER and %s.del_flag=\"0\" "); |
||||
|
subTables.add(joinSql); |
||||
|
});*/ |
||||
|
PageInfo<IcResiUserPageResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), |
||||
|
formDTO.getPageSize()).doSelectPageInfo(() -> icResiUserDao.selectListResi(formDTO.getCustomerId(), |
||||
|
formDTO.getFormCode(), |
||||
|
formDTO.getConditions(), |
||||
|
resultColumns, |
||||
|
subTables)); |
||||
|
List<IcResiUserPageResultDTO> list = pageInfo.getList(); |
||||
|
//查询网格名称
|
||||
|
List<String> gridIds = list.stream().map(IcResiUserPageResultDTO::getGridId).collect(Collectors.toList()); |
||||
|
log.warn("gridIds:" + JSON.toJSONString(gridIds)); |
||||
|
|
||||
|
List<GridsInfoListResultDTO> gridInfoList = govOrgService.gridListByIds(gridIds); |
||||
|
log.warn(JSON.toJSONString(gridInfoList)); |
||||
|
|
||||
|
Map<String, GridsInfoListResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(GridsInfoListResultDTO::getGridId, Function.identity())); |
||||
|
|
||||
|
//查询房子名称
|
||||
|
Set<String> houseIds = list.stream().map(IcResiUserPageResultDTO::getHomeId).collect(Collectors.toSet()); |
||||
|
List<HouseInfoDTO> houseInfoDTOList = govOrgService.queryHouseInfo(houseIds); |
||||
|
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); |
||||
|
for (IcResiUserPageResultDTO resultDTO : list) { |
||||
|
if (null != gridInfoMap && gridInfoMap.containsKey(resultDTO.getGridId())) { |
||||
|
resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId()).getGridName()); |
||||
|
} |
||||
|
if (null != houseInfoMap && houseInfoMap.containsKey(resultDTO.getHomeId())) { |
||||
|
resultDTO.setBuildName(houseInfoMap.get(resultDTO.getHomeId()).getBuildingName()); |
||||
|
resultDTO.setVallageName(houseInfoMap.get(resultDTO.getHomeId()).getNeighborHoodName()); |
||||
|
resultDTO.setUnitName(houseInfoMap.get(resultDTO.getHomeId()).getUnitName()); |
||||
|
resultDTO.setHomeName(houseInfoMap.get(resultDTO.getHomeId()).getDoorName()); |
||||
|
resultDTO.setHouseType(houseInfoMap.get(resultDTO.getHomeId()).getHouseType()); |
||||
|
} |
||||
|
} |
||||
|
pageInfo.setList(list); |
||||
|
return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public PageData<Map<String, Object>> pageResiMap(IcResiUserPageFormDTO formDTO) { |
||||
|
// 查询列表展示项,如果没有,直接返回
|
||||
|
List<IcFormResColumnDTO> resultColumns = customerFootBarService.queryConditions(formDTO.getCustomerId(), formDTO.getFormCode()); |
||||
|
if (CollectionUtils.isEmpty(resultColumns)) { |
||||
|
log.warn("没有配置列表展示列"); |
||||
|
return new PageData(new ArrayList(), NumConstant.ZERO); |
||||
|
} |
||||
|
// 查询列表展示项需要用到哪些子表
|
||||
|
// 拼接好的left join table_name on (ic_resi_user.ID=table_name.IC_RESI_USER AND table_name.del_flag='0')
|
||||
|
List<String> subTables = customerFootBarService.querySubTables(formDTO.getCustomerId(), formDTO.getFormCode()); |
||||
|
PageInfo<Map<String, Object>> pageInfo=new PageInfo<>(); |
||||
|
if (null == formDTO.getPageFlag()||formDTO.getPageFlag()) { |
||||
|
//分页
|
||||
|
pageInfo= PageHelper.startPage(formDTO.getPageNo(), |
||||
|
formDTO.getPageSize()).doSelectPageInfo(() -> icResiUserDao.selectListResiMap(formDTO.getCustomerId(), |
||||
|
formDTO.getFormCode(), |
||||
|
formDTO.getConditions(), |
||||
|
resultColumns, |
||||
|
subTables)); |
||||
|
}else{ |
||||
|
List<Map<String,Object>> list=icResiUserDao.selectListResiMap(formDTO.getCustomerId(), |
||||
|
formDTO.getFormCode(), |
||||
|
formDTO.getConditions(), |
||||
|
resultColumns, |
||||
|
subTables); |
||||
|
pageInfo.setTotal(CollectionUtils.isEmpty(list)?NumConstant.ZERO:list.size()); |
||||
|
pageInfo.setList(list); |
||||
|
} |
||||
|
|
||||
|
List<Map<String, Object>> list = pageInfo.getList(); |
||||
|
//查询网格名称
|
||||
|
List<String> gridIds = new ArrayList<>(); |
||||
|
Set<String> houseIds = new HashSet<>(); |
||||
|
for (Map<String, Object> map : list) { |
||||
|
log.warn(JSON.toJSONString(map)); |
||||
|
if (map.containsKey(OrgConstant.GRID_ID) && null != map.get(OrgConstant.GRID_ID) && StringUtils.isNotBlank(map.get(OrgConstant.GRID_ID).toString())) { |
||||
|
gridIds.add(map.get(OrgConstant.GRID_ID).toString()); |
||||
|
} |
||||
|
if (map.containsKey("HOME_ID") && null != map.get("HOME_ID") && StringUtils.isNotBlank(map.get("HOME_ID").toString())) { |
||||
|
houseIds.add(map.get("HOME_ID").toString()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
List<GridsInfoListResultDTO> gridInfoList = govOrgService.gridListByIds(gridIds); |
||||
|
|
||||
|
Map<String, GridsInfoListResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(GridsInfoListResultDTO::getGridId, Function.identity())); |
||||
|
|
||||
|
//查询房子名称
|
||||
|
List<HouseInfoDTO> houseInfoDTOList = govOrgService.queryHouseInfo(houseIds); |
||||
|
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); |
||||
|
for (Map<String, Object> resultMap : list) { |
||||
|
String gridIdValue = null != resultMap.get(OrgConstant.GRID_ID) ? resultMap.get(OrgConstant.GRID_ID).toString() : StrConstant.EPMETY_STR; |
||||
|
resultMap.put("GRID_ID_VALUE", gridIdValue); |
||||
|
if (null != gridInfoMap && gridInfoMap.containsKey(gridIdValue) && null != gridInfoMap.get(gridIdValue)) { |
||||
|
//GRID_NAME
|
||||
|
resultMap.put(OrgConstant.GRID_ID, gridInfoMap.get(gridIdValue).getGridName()); |
||||
|
} |
||||
|
|
||||
|
String homeId = null != resultMap.get("HOME_ID") ? resultMap.get("HOME_ID").toString() : StrConstant.EPMETY_STR; |
||||
|
resultMap.put("HOME_ID_VALUE", homeId); |
||||
|
if (null != houseInfoMap && houseInfoMap.containsKey(homeId) && null != houseInfoMap.get(homeId)) { |
||||
|
HouseInfoDTO houseInfoDTO = houseInfoMap.get(homeId); |
||||
|
String buildName = StringUtils.isNotBlank(houseInfoDTO.getBuildingName()) ? houseInfoDTO.getBuildingName() : StrConstant.EPMETY_STR; |
||||
|
resultMap.put("BUILD_NAME", buildName); |
||||
|
|
||||
|
String neighBorName = StringUtils.isNotBlank(houseInfoDTO.getNeighborHoodName()) ? houseInfoDTO.getNeighborHoodName() : StrConstant.EPMETY_STR; |
||||
|
resultMap.put("VILLAGE_NAME", neighBorName); |
||||
|
|
||||
|
String unitName = StringUtils.isNotBlank(houseInfoDTO.getUnitName()) ? houseInfoDTO.getUnitName() : StrConstant.EPMETY_STR; |
||||
|
resultMap.put("UNIT_NAME", unitName); |
||||
|
|
||||
|
String doorName = StringUtils.isNotBlank(houseInfoDTO.getDoorName()) ? houseInfoDTO.getDoorName() : StrConstant.EPMETY_STR; |
||||
|
resultMap.put("DOOR_NAME", doorName); |
||||
|
|
||||
|
String houseType = StringUtils.isNotBlank(houseInfoDTO.getHouseType()) ? houseInfoDTO.getHouseType() : StrConstant.EPMETY_STR; |
||||
|
//房屋类型,1楼房,2平房,3别墅
|
||||
|
resultMap.put(OrgConstant.HOUSE_TYPE_KEY, ""); |
||||
|
if (HouseTypeEnum.LOUFANG.getCode().equals(houseType)) { |
||||
|
resultMap.put(OrgConstant.HOUSE_TYPE_KEY, HouseTypeEnum.LOUFANG.getName()); |
||||
|
} else if (HouseTypeEnum.PINGFANG.getCode().equals(houseType)) { |
||||
|
resultMap.put(OrgConstant.HOUSE_TYPE_KEY, HouseTypeEnum.PINGFANG.getName()); |
||||
|
} else if (HouseTypeEnum.BIESHU.getCode().equals(houseType)) { |
||||
|
resultMap.put(OrgConstant.HOUSE_TYPE_KEY, HouseTypeEnum.BIESHU.getName()); |
||||
|
} |
||||
|
|
||||
|
resultMap.put("HOME_ID", neighBorName.concat(buildName).concat(unitName).concat(doorName)); |
||||
|
} |
||||
|
|
||||
|
if (resultMap.containsKey(OrgConstant.GENDER)) { |
||||
|
String genderValue = null != resultMap.get(OrgConstant.GENDER) ? resultMap.get(OrgConstant.GENDER).toString() : StrConstant.EPMETY_STR; |
||||
|
if (GenderEnum.MAN.getCode().equals(genderValue)) { |
||||
|
resultMap.put(OrgConstant.GENDER, GenderEnum.MAN.getName()); |
||||
|
} else if (GenderEnum.WOMAN.getCode().equals(genderValue)) { |
||||
|
resultMap.put(OrgConstant.GENDER, GenderEnum.WOMAN.getName()); |
||||
|
} else if (GenderEnum.UN_KNOWN.getCode().equals(genderValue)) { |
||||
|
resultMap.put(OrgConstant.GENDER, GenderEnum.UN_KNOWN.getName()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
pageInfo.setList(list); |
||||
|
return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 编辑页面,显示居民信息详情 |
||||
|
* |
||||
|
* @param pageFormDTO |
||||
|
* @return java.util.Map |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/10/28 10:29 上午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO) { |
||||
|
Map resultMap = new HashMap(); |
||||
|
// 先查询主表,主表没有记录,直接返回空
|
||||
|
List<Map<String, Object>> icResiUserMapList = icResiUserDao.selectById(pageFormDTO.getIcResiUserId()); |
||||
|
if (CollectionUtils.isEmpty(icResiUserMapList)) { |
||||
|
return new HashMap(); |
||||
|
} |
||||
|
resultMap.put("ic_resi_user", icResiUserMapList); |
||||
|
|
||||
|
//循环查询每个子表的记录
|
||||
|
Set<String> subTableList = customerFootBarService.queryIcResiSubTables(pageFormDTO.getCustomerId(), pageFormDTO.getFormCode()); |
||||
|
for (String subTalbeName : subTableList) { |
||||
|
List<Map<String, Object>> list = icResiUserDao.selectSubTableRecords(pageFormDTO.getIcResiUserId(), subTalbeName); |
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
resultMap.put(subTalbeName, list); |
||||
|
} |
||||
|
//else{
|
||||
|
// resultMap.put(subTalbeName,new ArrayList<>());
|
||||
|
//}
|
||||
|
} |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
@ -0,0 +1,129 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dataaggre.dao.epmetuser.IcResiUserDao"> |
||||
|
|
||||
|
<!-- <insert id="add">--> |
||||
|
<!-- insert into ${tableName}--> |
||||
|
<!-- (--> |
||||
|
<!-- <foreach collection="map.entrySet()" index="key" item="value" separator=",">--> |
||||
|
<!-- ${key}--> |
||||
|
<!-- </foreach>--> |
||||
|
<!-- ,DEL_FLAG--> |
||||
|
<!-- ,REVISION--> |
||||
|
<!-- ,CREATED_TIME--> |
||||
|
<!-- ,UPDATED_TIME--> |
||||
|
<!-- ) values--> |
||||
|
<!-- (--> |
||||
|
<!-- <foreach collection="map.entrySet()" index="key" item="value" separator=",">--> |
||||
|
<!-- #{value}--> |
||||
|
<!-- </foreach>--> |
||||
|
<!-- ,'0'--> |
||||
|
<!-- ,'0'--> |
||||
|
<!-- ,NOW()--> |
||||
|
<!-- ,NOW()--> |
||||
|
<!-- )--> |
||||
|
<!-- </insert>--> |
||||
|
|
||||
|
<select id="selectListResi" parameterType="map" resultType="com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO"> |
||||
|
select |
||||
|
ic_resi_user.id as icResiUserId, |
||||
|
<foreach item="column" collection="resultColumns" open="" separator="," close=""> |
||||
|
${column.columnName} |
||||
|
</foreach> |
||||
|
, |
||||
|
GROUP_CONCAT(ic_resi_demand.CATEGORY_CODE) as demandCategoryIds, |
||||
|
GROUP_CONCAT(ic_resi_demand_dict.CATEGORY_NAME) as demandName |
||||
|
FROM |
||||
|
ic_resi_user |
||||
|
<if test="null != subTables and subTables.size() > 0"> |
||||
|
<foreach item="subTableName" collection="subTables" open="" separator="" close=""> |
||||
|
${subTableName} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
|
||||
|
left join ic_resi_demand_dict |
||||
|
on(ic_resi_user.customer_id=ic_resi_demand_dict.CUSTOMER_ID |
||||
|
and ic_resi_demand.CATEGORY_CODE=ic_resi_demand_dict.CATEGORY_CODE ) |
||||
|
|
||||
|
WHERE |
||||
|
ic_resi_user.DEL_FLAG = '0' |
||||
|
and ic_resi_user.customer_id=#{customerId} |
||||
|
<if test="null != conditions and conditions.size() > 0"> |
||||
|
<foreach item="subCondition" collection="conditions" open="" separator="" close=""> |
||||
|
<if test="null != subCondition.columnValue and subCondition.columnValue.size() > 0"> |
||||
|
|
||||
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'equal' "> |
||||
|
and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]} |
||||
|
</if> |
||||
|
|
||||
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'like' "> |
||||
|
and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%') |
||||
|
</if> |
||||
|
|
||||
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'daterange' "> |
||||
|
and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} |
||||
|
</if> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</if> |
||||
|
group by IC_RESI_USER.id |
||||
|
order by ic_resi_user.CREATED_TIME desc |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
<select id="selectById" parameterType="java.lang.String" resultType="map"> |
||||
|
select * from ic_resi_user where del_flag='0' and id=#{icResiUserId} |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectSubTableRecords" parameterType="map" resultType="map"> |
||||
|
select * from ${tableName} where del_flag='0' and IC_RESI_USER=#{icResiUserId} |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
<select id="selectListResiMap" parameterType="map" resultType="map"> |
||||
|
select |
||||
|
ic_resi_user.id as icResiUserId, |
||||
|
<foreach item="column" collection="resultColumns" open="" separator="," close=""> |
||||
|
${column.columnName} |
||||
|
</foreach> |
||||
|
, |
||||
|
GROUP_CONCAT(ic_resi_demand.CATEGORY_CODE) as DEMAND_CATEGORY_IDS, |
||||
|
GROUP_CONCAT(ic_resi_demand_dict.CATEGORY_NAME) as DEMAND_NAME |
||||
|
FROM |
||||
|
ic_resi_user |
||||
|
<if test="null != subTables and subTables.size() > 0"> |
||||
|
<foreach item="subTableName" collection="subTables" open="" separator="" close=""> |
||||
|
${subTableName} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
|
||||
|
left join ic_resi_demand_dict |
||||
|
on(ic_resi_user.customer_id=ic_resi_demand_dict.CUSTOMER_ID |
||||
|
and ic_resi_demand.CATEGORY_CODE=ic_resi_demand_dict.CATEGORY_CODE ) |
||||
|
|
||||
|
WHERE |
||||
|
ic_resi_user.DEL_FLAG = '0' |
||||
|
and ic_resi_user.customer_id=#{customerId} |
||||
|
<if test="null != conditions and conditions.size() > 0"> |
||||
|
<foreach item="subCondition" collection="conditions" open="" separator="" close=""> |
||||
|
<if test="null != subCondition.columnValue and subCondition.columnValue.size() > 0"> |
||||
|
|
||||
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'equal' "> |
||||
|
and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]} |
||||
|
</if> |
||||
|
|
||||
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'like' "> |
||||
|
and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%') |
||||
|
</if> |
||||
|
|
||||
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'daterange' "> |
||||
|
and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} |
||||
|
</if> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</if> |
||||
|
group by IC_RESI_USER.id |
||||
|
order by ic_resi_user.CREATED_TIME desc |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.epmet.dto.basereport.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/10/15 10:55 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class EventInfoFormDTO extends PageFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 8479649048108914555L; |
||||
|
private String customerId; |
||||
|
private String projectId; |
||||
|
/** |
||||
|
* 操作类型【新增:add 修改删除:edit】 |
||||
|
*/ |
||||
|
private String type; |
||||
|
} |
||||
@ -0,0 +1,190 @@ |
|||||
|
package com.epmet.dto.basereport.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/10/15 10:57 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class EventInfoResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -6483163020737762044L; |
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
private Integer detpId; |
||||
|
|
||||
|
private String reporterId; |
||||
|
|
||||
|
/** |
||||
|
* 网格编码 |
||||
|
*/ |
||||
|
private String orgCode; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String orgName; |
||||
|
|
||||
|
/** |
||||
|
* 事件名称 |
||||
|
*/ |
||||
|
private String eventName; |
||||
|
|
||||
|
/** |
||||
|
* 事件类别 |
||||
|
*/ |
||||
|
private String eventCategory; |
||||
|
|
||||
|
/** |
||||
|
* 上报时间 YYYY-MM-DD HH:MM:SS |
||||
|
*/ |
||||
|
private Date reportTime; |
||||
|
|
||||
|
/** |
||||
|
* 发生时间 格式为“YYYY-MM-DD” |
||||
|
*/ |
||||
|
private Date happenDate; |
||||
|
|
||||
|
/** |
||||
|
* 发生地点 |
||||
|
*/ |
||||
|
private String happenPlace; |
||||
|
|
||||
|
/** |
||||
|
* 事件简述 |
||||
|
*/ |
||||
|
private String eventDescription; |
||||
|
|
||||
|
/** |
||||
|
* 办结方式 01自办;02上报 源于居民端的最终结案的项目为02;工作端立项的项目最终结案的01 |
||||
|
*/ |
||||
|
private String waysOfResolving; |
||||
|
|
||||
|
/** |
||||
|
* 是否办结 Y:是、N:否 |
||||
|
*/ |
||||
|
private String successfulOrNo; |
||||
|
|
||||
|
/** |
||||
|
* 办结层级 |
||||
|
01省、自治区、直辖市 |
||||
|
02地、市、州、盟 |
||||
|
03县、市、区、旗 |
||||
|
04乡镇、街道 |
||||
|
05片区 |
||||
|
06村、社区 |
||||
|
07网格 |
||||
|
|
||||
|
*/ |
||||
|
private String completeLevel; |
||||
|
|
||||
|
/** |
||||
|
* 基础信息主键 |
||||
|
*/ |
||||
|
private String baseInfoId; |
||||
|
|
||||
|
/** |
||||
|
* 办结时间 |
||||
|
*/ |
||||
|
private Date completeTime; |
||||
|
|
||||
|
/** |
||||
|
* 经度 |
||||
|
*/ |
||||
|
private BigDecimal lng; |
||||
|
|
||||
|
/** |
||||
|
* 纬度 |
||||
|
*/ |
||||
|
private BigDecimal lat; |
||||
|
|
||||
|
/** |
||||
|
* 主要当事人姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 涉及人数 |
||||
|
*/ |
||||
|
private Integer numberInvolved; |
||||
|
|
||||
|
/** |
||||
|
* 涉及单位 |
||||
|
*/ |
||||
|
private String relatedUnits; |
||||
|
|
||||
|
/** |
||||
|
* 重点场所类别 01九小场所, 02公共场所 |
||||
|
*/ |
||||
|
private String keyAreaType; |
||||
|
|
||||
|
/** |
||||
|
* 宗教活动规模 01 0-50人,02 51-200人,03 201人以上 |
||||
|
|
||||
|
*/ |
||||
|
private String religionScale; |
||||
|
|
||||
|
/** |
||||
|
* 宗教类别 01道教 02佛教 03基督教 04伊斯兰教 05其他 |
||||
|
|
||||
|
*/ |
||||
|
private String religionType; |
||||
|
|
||||
|
/** |
||||
|
* 重点场所是否变动 Y:是、N:否 |
||||
|
*/ |
||||
|
private String isKeyareaState; |
||||
|
|
||||
|
/** |
||||
|
* 重点人员是否在当地 Y:是、N:否 |
||||
|
*/ |
||||
|
private String isKeypeopleLocate; |
||||
|
|
||||
|
/** |
||||
|
* 重点人员现状 |
||||
|
*/ |
||||
|
private String keypeopleStatus; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Long delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
package com.epmet.dto.org.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @dscription 插叙客户网格基础信息--接口入参 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridBaseInfoFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -3634745091993094743L; |
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
@NotBlank(message = "事件标识不能为空", groups = {Grid.class}) |
||||
|
private String customerId = ""; |
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private List<String> orgIdList; |
||||
|
/** |
||||
|
* 操作类型【新增:add 修改删除:edit 初始化所有数据:all】 |
||||
|
*/ |
||||
|
private String type; |
||||
|
|
||||
|
public interface Grid extends CustomerClientShowGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,150 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.org.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 机关单位信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CustomerAgencyDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 上级组织机构ID |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级组织机构ID(以英文:隔开) |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级名称,以-连接 |
||||
|
*/ |
||||
|
private String allParentName; |
||||
|
|
||||
|
/** |
||||
|
* 组织名称 |
||||
|
*/ |
||||
|
private String organizationName; |
||||
|
|
||||
|
/** |
||||
|
* 机关级别(社区级:community, |
||||
|
乡(镇、街道)级:street, |
||||
|
区县级: district, |
||||
|
市级: city |
||||
|
省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) |
||||
|
*/ |
||||
|
private String level; |
||||
|
|
||||
|
/** |
||||
|
* 地区编码 |
||||
|
*/ |
||||
|
private String areaCode; |
||||
|
|
||||
|
/** |
||||
|
* 省组织编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 总人数 |
||||
|
*/ |
||||
|
private Integer totalUser; |
||||
|
|
||||
|
/** |
||||
|
* 省 |
||||
|
*/ |
||||
|
private String province; |
||||
|
|
||||
|
/** |
||||
|
* 市 |
||||
|
*/ |
||||
|
private String city; |
||||
|
|
||||
|
/** |
||||
|
* 区县 |
||||
|
*/ |
||||
|
private String district; |
||||
|
|
||||
|
/** |
||||
|
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 |
||||
|
*/ |
||||
|
private String parentAreaCode; |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
private String street; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String community; |
||||
|
} |
||||
@ -0,0 +1,134 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.org.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 客户网格表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-16 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CustomerGridDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID 唯一标识 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** 组织-网格 */ |
||||
|
private String gridNamePath; |
||||
|
|
||||
|
/** |
||||
|
* 中心位置经度 |
||||
|
*/ |
||||
|
private String longitude; |
||||
|
|
||||
|
/** |
||||
|
* 中心位置纬度 |
||||
|
*/ |
||||
|
private String latitude; |
||||
|
|
||||
|
/** |
||||
|
* 所属地区码(所属组织地区码) |
||||
|
*/ |
||||
|
private String areaCode; |
||||
|
|
||||
|
/** |
||||
|
* 省网格编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识:0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 管辖区域 |
||||
|
*/ |
||||
|
private String manageDistrict; |
||||
|
|
||||
|
/** |
||||
|
* 当前网格总人数 |
||||
|
*/ |
||||
|
private Integer totalUser; |
||||
|
|
||||
|
/** |
||||
|
* 所属组织机构ID(customer_organization.id) |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级组织ID |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 所属组织机构名 |
||||
|
*/ |
||||
|
private String agencyName; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级组织名 |
||||
|
*/ |
||||
|
private String allParentName; |
||||
|
} |
||||
@ -0,0 +1,103 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.org.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格员基础信息表 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridBaseInfoDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
/** |
||||
|
* 工作人员Id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 网格编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 网格员姓名 |
||||
|
*/ |
||||
|
private String GRID_LEVEL; |
||||
|
|
||||
|
/** |
||||
|
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; |
||||
|
*/ |
||||
|
private String GRID_TYPE; |
||||
|
|
||||
|
/** |
||||
|
* 网格内人口规模[01:500人以下(含500人); 02:500-1000人(含1000人); 03:1000-1500人(含1500人); 04:1500人以上] |
||||
|
*/ |
||||
|
private String POPULATION_SIZE; |
||||
|
|
||||
|
/** |
||||
|
* 是否成立网格党支部或网格党小组[Y:是、N:否] |
||||
|
*/ |
||||
|
private String IS_PARTY_BRANCH; |
||||
|
|
||||
|
/** |
||||
|
* 网格党组织类型[01:网格党支部; 02:网格党小组] |
||||
|
*/ |
||||
|
private String PARTY_BRANCH_TYPE; |
||||
|
|
||||
|
/** |
||||
|
* 中心点(质心)经度 |
||||
|
*/ |
||||
|
private String LNG; |
||||
|
|
||||
|
/** |
||||
|
* 中心点(质心)纬度 |
||||
|
*/ |
||||
|
private String LAT; |
||||
|
|
||||
|
/** |
||||
|
* 网格颜色 |
||||
|
*/ |
||||
|
private Date GRID_COLOR; |
||||
|
|
||||
|
/** |
||||
|
* 空间范围 |
||||
|
*/ |
||||
|
private String SHAPE; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
package com.epmet.dto.user.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @dscription 插叙客户网格人员基础信息--接口入参 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class StaffBaseInfoFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -3634745091993094743L; |
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
@NotBlank(message = "事件标识不能为空", groups = {Staff.class}) |
||||
|
private String customerId = ""; |
||||
|
/** |
||||
|
* 人员Id |
||||
|
*/ |
||||
|
private List<String> staffIdList; |
||||
|
/** |
||||
|
* 操作类型【新增:add 修改删除:edit】 |
||||
|
*/ |
||||
|
private String type; |
||||
|
public interface Staff extends CustomerClientShowGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.dto.user.param; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* desc:查询巡查 参数 |
||||
|
* |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:23 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class MidPatrolFormDTO extends PageFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 4411051728689886810L; |
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 巡查记录id 没有则查询全部 |
||||
|
*/ |
||||
|
private String patrolId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,182 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.user.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格员基础信息表 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridUserInfoDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
/** |
||||
|
* 工作人员Id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 网格编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 网格员姓名 |
||||
|
*/ |
||||
|
private String nickName; |
||||
|
|
||||
|
/** |
||||
|
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; |
||||
|
*/ |
||||
|
private String cardNum; |
||||
|
|
||||
|
/** |
||||
|
* 网格员类型[01:专职网格员; 02:兼职网格员; 03:网格长; 04:综治机构人员; 05:职能部门人员] |
||||
|
*/ |
||||
|
private String userType; |
||||
|
|
||||
|
/** |
||||
|
* 手机号码 |
||||
|
*/ |
||||
|
private String phonenumber; |
||||
|
|
||||
|
/** |
||||
|
* 性别[1:男性; 2:女性; 9:未说明的性别] |
||||
|
*/ |
||||
|
private String sex; |
||||
|
|
||||
|
/** |
||||
|
* 民族[字典表主键] |
||||
|
*/ |
||||
|
private String nation; |
||||
|
|
||||
|
/** |
||||
|
* 政治面貌[字典表主键] |
||||
|
*/ |
||||
|
private String paerty; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期[YYYY-MM-DD] |
||||
|
*/ |
||||
|
private Date birthday; |
||||
|
|
||||
|
/** |
||||
|
* 学历[字典表主键] |
||||
|
*/ |
||||
|
private String education; |
||||
|
|
||||
|
/** |
||||
|
* 入职时间 |
||||
|
*/ |
||||
|
private Date entryDate; |
||||
|
|
||||
|
/** |
||||
|
* 是否离职 |
||||
|
*/ |
||||
|
private String isLeave; |
||||
|
|
||||
|
/** |
||||
|
* 离职时间 |
||||
|
*/ |
||||
|
private Date leaveDate; |
||||
|
|
||||
|
/** |
||||
|
* 网格员年收入 |
||||
|
*/ |
||||
|
private String income; |
||||
|
|
||||
|
/** |
||||
|
* 是否社区(村)两委委员[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isCommittee; |
||||
|
|
||||
|
/** |
||||
|
* 是否社区工作者[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isCommunityWorkers; |
||||
|
|
||||
|
/** |
||||
|
* 是否社会工作者[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isSocialWorker; |
||||
|
|
||||
|
/** |
||||
|
* 是否村(居)民小组长[Y:是、N:否 |
||||
|
*/ |
||||
|
private String isVillageLeader; |
||||
|
|
||||
|
/** |
||||
|
* 是否警务助理[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isPoliceAssistant; |
||||
|
|
||||
|
/** |
||||
|
* 是否人民调解员[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isMediator; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.user.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 工作人员巡查明细记录 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-07 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MidPatrolDetailResult implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 维度 |
||||
|
*/ |
||||
|
private String latitude; |
||||
|
|
||||
|
/** |
||||
|
* 经度 |
||||
|
*/ |
||||
|
private String longitude; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,137 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.user.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 工作人员巡查主记录 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-07 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MidPatrolRecordResult implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 网格id |
||||
|
*/ |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 网格所有上级id |
||||
|
*/ |
||||
|
private String gridPids; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员用户id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员所属组织id=网格所属的组织id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 巡查开始时间 |
||||
|
*/ |
||||
|
private Date patrolStartTime; |
||||
|
|
||||
|
/** |
||||
|
* 巡查结束时间,前端传入 |
||||
|
*/ |
||||
|
private Date patrolEndTime; |
||||
|
|
||||
|
/** |
||||
|
* 实际结束时间=操作结束巡查的时间 |
||||
|
*/ |
||||
|
private Date actrualEndTime; |
||||
|
|
||||
|
/** |
||||
|
* 本次巡查总耗时,单位秒;结束巡查时写入 |
||||
|
*/ |
||||
|
private Integer totalTime; |
||||
|
|
||||
|
/** |
||||
|
* 正在巡查中:patrolling;结束:end |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 维度 |
||||
|
*/ |
||||
|
private String latitude; |
||||
|
|
||||
|
/** |
||||
|
* 精度 |
||||
|
*/ |
||||
|
private String longitude; |
||||
|
|
||||
|
/** |
||||
|
* 经纬度组合成的路线 经度,维度; |
||||
|
*/ |
||||
|
private String route; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,106 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.dto.basereport.form.EventInfoFormDTO; |
||||
|
import com.epmet.dto.basereport.result.EventInfoResultDTO; |
||||
|
import com.epmet.dto.org.form.GridBaseInfoFormDTO; |
||||
|
import com.epmet.dto.org.result.CustomerAgencyDTO; |
||||
|
import com.epmet.dto.org.result.CustomerGridDTO; |
||||
|
import com.epmet.dto.user.form.StaffBaseInfoFormDTO; |
||||
|
import com.epmet.dto.user.param.MidPatrolFormDTO; |
||||
|
import com.epmet.dto.user.result.GridUserInfoDTO; |
||||
|
import com.epmet.dto.user.result.MidPatrolDetailResult; |
||||
|
import com.epmet.dto.user.result.MidPatrolRecordResult; |
||||
|
import com.epmet.opendata.dto.BaseDisputeProcessDTO; |
||||
|
import com.epmet.service.DataReportingService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @dscription 省网格化平台数据上报--数据查询 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@RequestMapping("datareporting") |
||||
|
@RestController |
||||
|
public class DataReportingController { |
||||
|
@Autowired |
||||
|
private DataReportingService dataReportingService; |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 批量查询客户组织基础信息 |
||||
|
**/ |
||||
|
@PostMapping("agencybaseinfo") |
||||
|
public Result<List<CustomerAgencyDTO>> getAgencyBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { |
||||
|
ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); |
||||
|
return new Result<List<CustomerAgencyDTO>>().ok(dataReportingService.getAgencyBaseInfo(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 批量查询客户网格基础信息 |
||||
|
**/ |
||||
|
@PostMapping("gridbaseinfo") |
||||
|
public Result<List<CustomerGridDTO>> getGridBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { |
||||
|
ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); |
||||
|
return new Result<List<CustomerGridDTO>>().ok(dataReportingService.getGridBaseInfo(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 批量查询客户网格员基础信息 |
||||
|
**/ |
||||
|
@PostMapping("staffbaseinfo") |
||||
|
public Result<List<GridUserInfoDTO>> getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) { |
||||
|
ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); |
||||
|
return new Result<List<GridUserInfoDTO>>().ok(dataReportingService.getStaffBaseInfo(formDTO)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* desc: 条件获取巡查主表信息 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.user.result.MidPatrolRecordResult>> |
||||
|
* @author LiuJanJun |
||||
|
* @date 2021/10/15 12:01 下午 |
||||
|
*/ |
||||
|
@PostMapping("getPatrolRecordList") |
||||
|
public Result<List<MidPatrolRecordResult>> getPatrolRecordList(@RequestBody(required = false) MidPatrolFormDTO formDTO) { |
||||
|
ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); |
||||
|
return new Result<List<MidPatrolRecordResult>>().ok(dataReportingService.getPatrolRecordList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 条件获取巡查明细信息 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.user.result.CustomerStaffDTO>> |
||||
|
* @author LiuJanJun |
||||
|
* @date 2021/10/15 12:01 下午 |
||||
|
*/ |
||||
|
@PostMapping("getPatrolDetailList") |
||||
|
public Result<List<MidPatrolDetailResult>> getPatrolDetailList(@RequestBody(required = false) MidPatrolFormDTO formDTO) { |
||||
|
ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); |
||||
|
return new Result<List<MidPatrolDetailResult>>().ok(dataReportingService.getPatrolDetailList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 事件上报 |
||||
|
* @Param formDTO |
||||
|
* @Return {@link Result<List<BaseDisputeProcessDTO>>} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/10/15 14:09 |
||||
|
*/ |
||||
|
@PostMapping("eventinfo") |
||||
|
public Result<List<EventInfoResultDTO>> getEventInfo(@RequestBody(required = false) EventInfoFormDTO formDTO) { |
||||
|
return new Result<List<EventInfoResultDTO>>().ok(dataReportingService.getEventInfo(formDTO)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,72 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.dto.basereport.form.EventInfoFormDTO; |
||||
|
import com.epmet.dto.basereport.result.EventInfoResultDTO; |
||||
|
import com.epmet.dto.org.form.GridBaseInfoFormDTO; |
||||
|
import com.epmet.dto.org.result.CustomerAgencyDTO; |
||||
|
import com.epmet.dto.org.result.CustomerGridDTO; |
||||
|
import com.epmet.dto.user.form.StaffBaseInfoFormDTO; |
||||
|
import com.epmet.dto.user.param.MidPatrolFormDTO; |
||||
|
import com.epmet.dto.user.result.GridUserInfoDTO; |
||||
|
import com.epmet.dto.user.result.MidPatrolDetailResult; |
||||
|
import com.epmet.dto.user.result.MidPatrolRecordResult; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @dscription 省网格化平台数据上报--数据查询 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
public interface DataReportingService { |
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 批量查询客户组织基础信息 |
||||
|
* |
||||
|
* @return*/ |
||||
|
List<CustomerAgencyDTO> getAgencyBaseInfo(GridBaseInfoFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 批量查询客户网格基础信息 |
||||
|
* |
||||
|
* @return*/ |
||||
|
List<CustomerGridDTO> getGridBaseInfo(GridBaseInfoFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 批量查询客户网格员基础信息 |
||||
|
* |
||||
|
* @return*/ |
||||
|
List<GridUserInfoDTO> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* desc: 获取巡查记录列表 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<com.epmet.dto.user.result.CustomerStaffDTO> |
||||
|
* @author LiuJanJun |
||||
|
* @date 2021/10/15 1:21 下午 |
||||
|
*/ |
||||
|
List<MidPatrolRecordResult> getPatrolRecordList(MidPatrolFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* desc: 获取巡查明细列表 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<com.epmet.dto.user.result.MidPatrolDetailResult> |
||||
|
* @author LiuJanJun |
||||
|
* @date 2021/10/15 1:22 下午 |
||||
|
*/ |
||||
|
List<MidPatrolDetailResult> getPatrolDetailList(MidPatrolFormDTO formDTO); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 事件上报 |
||||
|
* @Param formDTO |
||||
|
* @Return {@link List<EventInfoResultDTO>} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/10/15 14:10 |
||||
|
*/ |
||||
|
List<EventInfoResultDTO> getEventInfo(EventInfoFormDTO formDTO); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,281 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.StrConstant; |
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import com.epmet.constant.OrgTypeConstant; |
||||
|
import com.epmet.constant.ProjectConstant; |
||||
|
import com.epmet.dto.basereport.form.EventInfoFormDTO; |
||||
|
import com.epmet.dto.basereport.result.EventInfoResultDTO; |
||||
|
import com.epmet.dto.org.form.GridBaseInfoFormDTO; |
||||
|
import com.epmet.dto.org.result.CustomerAgencyDTO; |
||||
|
import com.epmet.dto.org.result.CustomerGridDTO; |
||||
|
import com.epmet.dto.screen.ScreenCustomerGridDTO; |
||||
|
import com.epmet.dto.screen.ScreenProjectDataDTO; |
||||
|
import com.epmet.dto.user.form.StaffBaseInfoFormDTO; |
||||
|
import com.epmet.dto.user.param.MidPatrolFormDTO; |
||||
|
import com.epmet.dto.user.result.CustomerStaffDTO; |
||||
|
import com.epmet.dto.user.result.GridUserInfoDTO; |
||||
|
import com.epmet.dto.user.result.MidPatrolDetailResult; |
||||
|
import com.epmet.dto.user.result.MidPatrolRecordResult; |
||||
|
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; |
||||
|
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; |
||||
|
import com.epmet.service.DataReportingService; |
||||
|
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; |
||||
|
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; |
||||
|
import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; |
||||
|
import com.epmet.service.org.CustomerAgencyService; |
||||
|
import com.epmet.service.org.CustomerGridService; |
||||
|
import com.epmet.service.stats.CustomerProjectCategoryDictService; |
||||
|
import com.epmet.service.user.StatsStaffPatrolService; |
||||
|
import com.epmet.service.user.UserService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.*; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @dscription 省网格化平台数据上报--数据查询 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class DataReportingServiceImpl implements DataReportingService { |
||||
|
@Autowired |
||||
|
private CustomerAgencyService customerAgencyService; |
||||
|
@Autowired |
||||
|
private CustomerGridService customerGridService; |
||||
|
@Autowired |
||||
|
private UserService userService; |
||||
|
@Resource |
||||
|
private ScreenProjectDataService screenProjectDataService; |
||||
|
@Resource |
||||
|
private ScreenCustomerAgencyService screenCustomerAgencyService; |
||||
|
@Resource |
||||
|
private ScreenCustomerGridService screenCustomerGridService; |
||||
|
@Autowired |
||||
|
private StatsStaffPatrolService statsStaffPatrolService; |
||||
|
@Resource |
||||
|
private CustomerProjectCategoryDictService customerProjectCategoryDictService; |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 批量查询客户组织基础信息 |
||||
|
**/ |
||||
|
@Override |
||||
|
public List<CustomerAgencyDTO> getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) { |
||||
|
//批量查询客户组织信息
|
||||
|
List<CustomerAgencyDTO> resultList = customerAgencyService.getAgencyBaseInfo(formDTO); |
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 批量查询客户网格基础信息 |
||||
|
**/ |
||||
|
@Override |
||||
|
public List<CustomerGridDTO> getGridBaseInfo(GridBaseInfoFormDTO formDTO) { |
||||
|
//批量查询客户网格信息
|
||||
|
List<CustomerGridDTO> resultList = customerGridService.getGridBaseInfo(formDTO); |
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 批量查询客户网格员基础信息 |
||||
|
**/ |
||||
|
@Override |
||||
|
public List<GridUserInfoDTO> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { |
||||
|
//1.查询工作人员所属网格信息
|
||||
|
List<GridUserInfoDTO> resultList = customerGridService.getStaffGrid(formDTO); |
||||
|
|
||||
|
//2.查询工作人员基础信息
|
||||
|
List<CustomerStaffDTO> staffDTOList = userService.getStaffBaseInfo(formDTO); |
||||
|
if (CollectionUtils.isEmpty(staffDTOList)) { |
||||
|
return new ArrayList<>(); |
||||
|
} |
||||
|
Map<String, CustomerStaffDTO> staffMap = new HashMap<>(); |
||||
|
staffDTOList.forEach(staff -> staffMap.put(staff.getUserId(), staff)); |
||||
|
|
||||
|
//3.封装数据
|
||||
|
resultList.forEach(st -> { |
||||
|
if (staffMap.containsKey(st.getStaffId())) { |
||||
|
CustomerStaffDTO dto = staffMap.get(st.getStaffId()); |
||||
|
st.setNickName(dto.getRealName()); |
||||
|
st.setCardNum("01"); |
||||
|
st.setUserType(dto.getWorkType().equals("fulltime") ? "01" : "02"); |
||||
|
st.setPhonenumber(dto.getMobile()); |
||||
|
st.setSex(0 == dto.getGender() ? "9" : dto.getGender().toString()); |
||||
|
st.setNation("01"); |
||||
|
st.setPaerty("13"); |
||||
|
st.setBirthday(new Date()); |
||||
|
st.setEducation("20"); |
||||
|
st.setEntryDate(new Date()); |
||||
|
st.setIsLeave("N"); |
||||
|
//st.setLeaveDate();
|
||||
|
st.setIncome("05"); |
||||
|
st.setIsCommittee("Y"); |
||||
|
st.setIsCommunityWorkers("Y"); |
||||
|
st.setIsSocialWorker("Y"); |
||||
|
st.setIsVillageLeader("Y"); |
||||
|
st.setIsPoliceAssistant("N"); |
||||
|
st.setIsMediator("Y"); |
||||
|
st.setDelFlag(dto.getDelFlag()); |
||||
|
st.setCreatedBy(dto.getCreatedBy()); |
||||
|
st.setCreatedTime(dto.getCreatedTime()); |
||||
|
st.setUpdatedBy(dto.getUpdatedBy()); |
||||
|
st.setUpdatedTime(dto.getUpdatedTime()); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 事件上报 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @Param formDTO |
||||
|
* @Return {@link List<EventInfoResultDTO>} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/10/15 14:10 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<EventInfoResultDTO> getEventInfo(EventInfoFormDTO formDTO) { |
||||
|
List<EventInfoResultDTO> list; |
||||
|
//根据入参,获取项目
|
||||
|
List<ScreenProjectDataDTO> projectList = screenProjectDataService.getProjectList(formDTO.getCustomerId(), formDTO.getProjectId(), formDTO.getPageNo(), formDTO.getPageSize()); |
||||
|
//项目列表为空,返回空数组
|
||||
|
if(CollectionUtils.isEmpty(projectList)) { |
||||
|
return Collections.emptyList(); |
||||
|
} |
||||
|
//项目ID不为空时,因为只有一条,可以直接处理
|
||||
|
if (StringUtils.isNotEmpty(formDTO.getProjectId())) { |
||||
|
list = projectList.stream().map(project -> { |
||||
|
EventInfoResultDTO dto = getEventInfoResultDTO(project); |
||||
|
if (OrgTypeConstant.AGENCY.equals(project.getOrgType())) { |
||||
|
ScreenCustomerAgencyEntity agency = screenCustomerAgencyService.getAgencyById(project.getOrgId()); |
||||
|
dto.setOrgCode(agency.getCode()); |
||||
|
dto.setOrgName(agency.getAgencyName()); |
||||
|
} else { |
||||
|
ScreenCustomerGridDTO grid = screenCustomerGridService.getGridById(project.getOrgId()); |
||||
|
dto.setOrgCode(grid.getCode()); |
||||
|
dto.setOrgName(grid.getGridName()); |
||||
|
} |
||||
|
return dto; |
||||
|
}).collect(Collectors.toList()); |
||||
|
} else { |
||||
|
//项目ID不为空时,提前取出客户下的组织和网格
|
||||
|
Map<String, ScreenCustomerAgencyEntity> agencyMap = screenCustomerAgencyService.getAgencyList(formDTO.getCustomerId()); |
||||
|
Map<String, ScreenCustomerGridDTO> gridMap = screenCustomerGridService.getGridList(formDTO.getCustomerId()); |
||||
|
list = projectList.stream().map(project -> { |
||||
|
EventInfoResultDTO dto = getEventInfoResultDTO(project); |
||||
|
if (OrgTypeConstant.AGENCY.equals(project.getOrgType())) { |
||||
|
ScreenCustomerAgencyEntity agency = agencyMap.get(project.getOrgId()); |
||||
|
dto.setOrgCode(agency.getCode()); |
||||
|
dto.setOrgName(agency.getAgencyName()); |
||||
|
} else { |
||||
|
ScreenCustomerGridDTO grid = gridMap.get(project.getOrgId()); |
||||
|
dto.setOrgCode(grid.getCode()); |
||||
|
dto.setOrgName(grid.getGridName()); |
||||
|
} |
||||
|
return dto; |
||||
|
}).collect(Collectors.toList()); |
||||
|
} |
||||
|
return list.stream().filter(item -> StringUtils.isNotBlank(item.getEventCategory())).collect(Collectors.toList()); |
||||
|
} |
||||
|
|
||||
|
private EventInfoResultDTO getEventInfoResultDTO(ScreenProjectDataDTO project) { |
||||
|
EventInfoResultDTO dto = new EventInfoResultDTO(); |
||||
|
dto.setId(project.getProjectId()); |
||||
|
dto.setCustomerId(project.getCustomerId()); |
||||
|
dto.setEventName(project.getProjectTitle()); |
||||
|
dto.setReporterId(project.getProjectCreator()); |
||||
|
String categoryCode = project.getCategoryCode().split(StrConstant.COMMA)[0]; |
||||
|
//如果是孔村、榆山、锦水的项目需要关联分类字典表
|
||||
|
if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId()) || |
||||
|
"44876154d10d7cb7affd92000f84f833".equals(project.getCustomerId()) || |
||||
|
"46c55cb862d6d5e6d05d2ab61a1cc07e".equals(project.getCustomerId())) { |
||||
|
CustomerProjectCategoryDictEntity categoryEntity = customerProjectCategoryDictService.getByCategoryCode(project.getCustomerId(), categoryCode); |
||||
|
if (null != categoryEntity) { |
||||
|
categoryCode = categoryEntity.getEpmetCategoryCode(); |
||||
|
} else { |
||||
|
categoryCode = null; |
||||
|
} |
||||
|
} |
||||
|
dto.setEventCategory(categoryCode); |
||||
|
dto.setReportTime(project.getProjectCreateTime()); |
||||
|
dto.setHappenDate(DateUtils.parseDate(DateUtils.format(project.getProjectCreateTime()), DateUtils.DATE_PATTERN)); |
||||
|
dto.setHappenPlace(project.getProjectAddress()); |
||||
|
dto.setEventDescription(project.getProjectContent()); |
||||
|
dto.setSuccessfulOrNo(ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())?"Y":"N"); |
||||
|
if (ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())) { |
||||
|
dto.setWaysOfResolving(project.getOrgId().equals(project.getFinishOrg())?ProjectConstant.PROJECT_SELF_CLOSED:ProjectConstant.PROJECT_REPORT); |
||||
|
//办结组织是机关时,办结层级为机关的层级
|
||||
|
if (OrgTypeConstant.AGENCY.equals(project.getFinishOrgType())) { |
||||
|
//如果是孔村的项目办结层级需要降一级
|
||||
|
if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId())) { |
||||
|
switch (project.getFinishOrgLevel()) { |
||||
|
case OrgTypeConstant.DISTRICT: |
||||
|
dto.setCompleteLevel("04"); |
||||
|
break; |
||||
|
case OrgTypeConstant.STREET: |
||||
|
case OrgTypeConstant.COMMUNITY: |
||||
|
dto.setCompleteLevel("06"); |
||||
|
break; |
||||
|
default: |
||||
|
break; |
||||
|
} |
||||
|
} else { |
||||
|
dto.setCompleteLevel(getCompleteLevel(project.getFinishOrgLevel())); |
||||
|
} |
||||
|
} else if (OrgTypeConstant.DEPARTMENT.equals(project.getFinishOrgType())) { |
||||
|
//办结组织是部门时,办结层级为部门所在组织的曾经
|
||||
|
String[] orgIds = project.getOrgIdPath().split(StrConstant.COLON); |
||||
|
int size = orgIds.length; |
||||
|
ScreenCustomerAgencyEntity agency = screenCustomerAgencyService.getAgencyById(orgIds[size - 1]); |
||||
|
dto.setCompleteLevel(getCompleteLevel(agency.getLevel())); |
||||
|
} else { |
||||
|
//办结组织是网格时,办结层级为网格
|
||||
|
dto.setCompleteLevel("07"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
dto.setCompleteTime(project.getCloseCaseTime()); |
||||
|
dto.setLat(project.getLatitude()); |
||||
|
dto.setLng(project.getLongitude()); |
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
private String getCompleteLevel(String level) { |
||||
|
switch (level) { |
||||
|
case OrgTypeConstant.PROVINCE: |
||||
|
return "01"; |
||||
|
case OrgTypeConstant.CITY: |
||||
|
return "02"; |
||||
|
case OrgTypeConstant.DISTRICT: |
||||
|
return "03"; |
||||
|
case OrgTypeConstant.STREET: |
||||
|
return "04"; |
||||
|
case OrgTypeConstant.COMMUNITY: |
||||
|
return "06"; |
||||
|
default: |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<MidPatrolRecordResult> getPatrolRecordList(MidPatrolFormDTO formDTO) { |
||||
|
return userService.getPatrolRecordList(formDTO); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<MidPatrolDetailResult> getPatrolDetailList(MidPatrolFormDTO formDTO) { |
||||
|
return userService.getPatrolDetailList(formDTO); |
||||
|
} |
||||
|
|
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue