forked from rongchao/epmet-cloud-rizhao
163 changed files with 6215 additions and 315 deletions
@ -0,0 +1,120 @@ |
|||
package com.epmet.mq.listener.listener; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.auth.constants.AuthOperationEnum; |
|||
import com.epmet.commons.rocketmq.constants.MQUserPropertys; |
|||
import com.epmet.commons.rocketmq.messages.CheckMQMsg; |
|||
import com.epmet.commons.rocketmq.messages.LoginMQMsg; |
|||
import com.epmet.commons.tools.distributedlock.DistributedLock; |
|||
import com.epmet.commons.tools.exception.ExceptionUtils; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.redis.RedisKeys; |
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import com.epmet.commons.tools.utils.SpringContextUtils; |
|||
import com.epmet.entity.LogOperationEntity; |
|||
import com.epmet.mq.listener.bean.log.LogOperationHelper; |
|||
import com.epmet.mq.listener.bean.log.OperatorInfo; |
|||
import com.epmet.service.LogOperationService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; |
|||
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; |
|||
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; |
|||
import org.apache.rocketmq.common.message.MessageExt; |
|||
import org.redisson.api.RLock; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
|
|||
import java.util.List; |
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
/** |
|||
* @author zxc |
|||
* @Description 查询明文或者导出操作日志监听器 |
|||
*/ |
|||
public class CheckAndExportOperationLogListener implements MessageListenerConcurrently { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
private RedisUtils redisUtils; |
|||
|
|||
@Override |
|||
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) { |
|||
|
|||
if (redisUtils == null) { |
|||
redisUtils = SpringContextUtils.getBean(RedisUtils.class); |
|||
} |
|||
|
|||
try { |
|||
msgs.forEach(msg -> consumeMessage(msg)); |
|||
} catch (Exception e) { |
|||
logger.error(ExceptionUtils.getErrorStackTrace(e)); |
|||
return ConsumeConcurrentlyStatus.RECONSUME_LATER; |
|||
} |
|||
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; |
|||
} |
|||
|
|||
private void consumeMessage(MessageExt messageExt) { |
|||
String tags = messageExt.getTags(); |
|||
String msg = new String(messageExt.getBody()); |
|||
String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); |
|||
logger.info("查询明文或者导出操作日志监听器-收到消息内容:{}", msg); |
|||
CheckMQMsg msgObj = JSON.parseObject(msg, CheckMQMsg.class); |
|||
|
|||
//获取操作人信息
|
|||
OperatorInfo operatorInfo = LogOperationHelper.getInstance().getOperatorInfo(msgObj.getUserId()); |
|||
LogOperationEntity logEntity = new LogOperationEntity(); |
|||
logEntity.setCategory("data_tm"); |
|||
logEntity.setType(msgObj.getType()); |
|||
logEntity.setTypeDisplay(msgObj.getTypeDisplay()); |
|||
logEntity.setIp(msgObj.getIp()); |
|||
logEntity.setFromApp(msgObj.getFromApp()); |
|||
logEntity.setFromClient(msgObj.getFromClient()); |
|||
logEntity.setTargetId(""); |
|||
logEntity.setCustomerId(operatorInfo.getCustomerId()); |
|||
logEntity.setOperatorId(msgObj.getUserId()); |
|||
logEntity.setOperatorName(operatorInfo.getName()); |
|||
logEntity.setOperatorMobile(operatorInfo.getMobile()); |
|||
logEntity.setOperatingTime(msgObj.getOperateTime()); |
|||
logEntity.setContent(msgObj.getContent()); |
|||
|
|||
DistributedLock distributedLock = null; |
|||
RLock lock = null; |
|||
try { |
|||
distributedLock = SpringContextUtils.getBean(DistributedLock.class); |
|||
lock = distributedLock.getLock(String.format("lock:auth_operation_log:%s:%s", logEntity.getType(), logEntity.getOperatorId()), |
|||
30L, 30L, TimeUnit.SECONDS); |
|||
SpringContextUtils.getBean(LogOperationService.class).log(logEntity); |
|||
} catch (RenException e) { |
|||
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
|
|||
logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); |
|||
} catch (Exception e) { |
|||
// 不是我们自己抛出的异常,可以让MQ重试
|
|||
logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); |
|||
throw e; |
|||
} finally { |
|||
distributedLock.unLock(lock); |
|||
} |
|||
|
|||
if (StringUtils.isNotBlank(pendingMsgLabel)) { |
|||
try { |
|||
removePendingMqMsgCache(pendingMsgLabel); |
|||
} catch (Exception e) { |
|||
logger.error("【查询明文或者导出操作日志监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @description |
|||
* |
|||
* @param pendingMsgLabel |
|||
* @return |
|||
* @author wxz |
|||
* @date 2021.10.14 16:32:32 |
|||
*/ |
|||
private void removePendingMqMsgCache(String pendingMsgLabel) { |
|||
String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); |
|||
redisUtils.delete(key); |
|||
//logger.info("【登录操作事件监听器】删除pendingMsgLabel成功:{}", pendingMsgLabel);
|
|||
} |
|||
} |
@ -0,0 +1,2 @@ |
|||
|
|||
ALTER TABLE log_operation MODIFY COLUMN CATEGORY varchar(64) not null COMMENT '操作类型大类。例如login和logout都属于login大类。项目立项,项目流转,项目结案都属于项目大类;data_tm:数据脱敏;'; |
@ -0,0 +1,79 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.dingtalk.api.DefaultDingTalkClient; |
|||
import com.dingtalk.api.DingTalkClient; |
|||
import com.dingtalk.api.request.OapiGettokenRequest; |
|||
import com.dingtalk.api.request.OapiSnsGetuserinfoBycodeRequest; |
|||
import com.dingtalk.api.request.OapiUserGetbyunionidRequest; |
|||
import com.dingtalk.api.request.OapiV2UserGetRequest; |
|||
import com.dingtalk.api.response.OapiGettokenResponse; |
|||
import com.dingtalk.api.response.OapiSnsGetuserinfoBycodeResponse; |
|||
import com.dingtalk.api.response.OapiUserGetbyunionidResponse; |
|||
import com.dingtalk.api.response.OapiV2UserGetResponse; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.taobao.api.ApiException; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* 免登第三方网站 |
|||
* |
|||
* @author openapi@dingtalk |
|||
*/ |
|||
@RestController("dingtalk") |
|||
public class DingdingLoginController { |
|||
|
|||
/** |
|||
* 获取授权用户的个人信息 openapi@dingtalk |
|||
* |
|||
* @return |
|||
* @throws Exception ServiceResult<Map<String,Object>> 2020-11-4 |
|||
*/ |
|||
@RequestMapping(value = "/auth", method = RequestMethod.GET) |
|||
public Result<String> getDdScan(@RequestParam("code") String code) throws Exception { |
|||
// 获取access_token,注意正式代码要有异常流处理
|
|||
String access_token = this.getToken(); |
|||
|
|||
// 通过临时授权码获取授权用户的个人信息
|
|||
DefaultDingTalkClient client2 = new DefaultDingTalkClient("https://oapi.dingtalk.com/sns/getuserinfo_bycode"); |
|||
OapiSnsGetuserinfoBycodeRequest reqBycodeRequest = new OapiSnsGetuserinfoBycodeRequest(); |
|||
|
|||
reqBycodeRequest.setTmpAuthCode(code); |
|||
OapiSnsGetuserinfoBycodeResponse bycodeResponse = client2.execute(reqBycodeRequest, "yourAppId", "yourAppSecret"); |
|||
|
|||
// 根据unionid获取userid
|
|||
String unionid = bycodeResponse.getUserInfo().getUnionid(); |
|||
DingTalkClient clientDingTalkClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/user/getbyunionid"); |
|||
OapiUserGetbyunionidRequest reqGetbyunionidRequest = new OapiUserGetbyunionidRequest(); |
|||
reqGetbyunionidRequest.setUnionid(unionid); |
|||
OapiUserGetbyunionidResponse oapiUserGetbyunionidResponse = clientDingTalkClient.execute(reqGetbyunionidRequest, access_token); |
|||
|
|||
// 根据userId获取用户信息
|
|||
String userid = oapiUserGetbyunionidResponse.getResult().getUserid(); |
|||
DingTalkClient clientDingTalkClient2 = new DefaultDingTalkClient( |
|||
"https://oapi.dingtalk.com/topapi/v2/user/get"); |
|||
OapiV2UserGetRequest reqGetRequest = new OapiV2UserGetRequest(); |
|||
reqGetRequest.setUserid(userid); |
|||
//reqGetRequest.setLang("zh_CN");
|
|||
OapiV2UserGetResponse rspGetResponse = clientDingTalkClient2.execute(reqGetRequest, access_token); |
|||
System.out.println(rspGetResponse.getBody()); |
|||
return new Result<String>().ok(rspGetResponse.getBody()); |
|||
} |
|||
private String getToken() throws RuntimeException { |
|||
try { |
|||
DefaultDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken"); |
|||
OapiGettokenRequest request = new OapiGettokenRequest(); |
|||
|
|||
request.setAppkey("dingiopfbtn8mktfoaf0"); |
|||
request.setAppsecret("RcmHIoP5KFLZSM5wzpYhvCKMMKEzLoWPtqu3OqOEBD6myg4IT8oVw4AwvRkKYKJz"); |
|||
request.setHttpMethod("GET"); |
|||
OapiGettokenResponse response = client.execute(request); |
|||
return response.getAccessToken(); |
|||
} catch (ApiException e) { |
|||
throw new RuntimeException(); |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.epmet.commons.rocketmq.messages; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class CheckMQMsg { |
|||
|
|||
/** |
|||
* 谁登录 |
|||
*/ |
|||
private String userId; |
|||
|
|||
private String content; |
|||
|
|||
private String typeDisplay; |
|||
private String type; |
|||
|
|||
/** |
|||
* 操作时间 |
|||
*/ |
|||
private Date operateTime; |
|||
|
|||
private String ip; |
|||
|
|||
private String fromApp; |
|||
|
|||
private String fromClient; |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.commons.tools.dto.result; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2022/9/26 17:04 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class YtDataSyncResDTO { |
|||
private int code = 200; |
|||
private String msg = "请求成功"; |
|||
/** |
|||
* 响应数据 |
|||
*/ |
|||
private String data; |
|||
private int total; |
|||
|
|||
public YtDataSyncResDTO(int code, String msg, String data) { |
|||
this.code = code; |
|||
this.msg = msg; |
|||
this.data = data; |
|||
} |
|||
} |
@ -0,0 +1,80 @@ |
|||
package com.epmet.commons.tools.dto.result; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* @Description 核算采样结果 |
|||
* @Author yzm |
|||
* @Date 2022/9/26 17:04 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class YtHscyResDTO { |
|||
private int code = 200; |
|||
private String msg = "请求成功"; |
|||
/** |
|||
* 响应数据 |
|||
*/ |
|||
private List<YtHscyResDetail> data; |
|||
private int total; |
|||
|
|||
@Data |
|||
public static class YtHscyResDetail { |
|||
private String id; |
|||
private String name; |
|||
private String card_type; |
|||
private String card_no; |
|||
private String create_by; |
|||
/** |
|||
* 采样时间 |
|||
*/ |
|||
private String create_time; |
|||
private String sys_org_code; |
|||
private String sample_tube; |
|||
private String package_id; |
|||
private String city; |
|||
private String uuid; |
|||
private String county; |
|||
private String depart_ids; |
|||
private Object depart_name; |
|||
/** |
|||
* 采样点名称 |
|||
*/ |
|||
private String realname; |
|||
private String upload_time; |
|||
private Object sd_id; |
|||
private Object sd_batch; |
|||
private Object sd_operation; |
|||
private Object sd_time; |
|||
private String inserttime; |
|||
} |
|||
|
|||
/*{ |
|||
"id":"1570924677539635484", |
|||
"name":"杨XX",//姓名
|
|||
"card_type":"1",//证件类型
|
|||
"card_no":"37************0813",//证件号码
|
|||
"create_by":"370613594",//采样点账号
|
|||
"create_time":"2022-09-17 07:15:22",//采样时间
|
|||
"sys_org_code":"370613",//部门代码
|
|||
"sample_tube":"GCJ-0825-0441",//采样管号
|
|||
"package_id":"bcj00208083952",//采样包号
|
|||
"city":"烟台市",//城市
|
|||
"uuid":"6225684525062602095",//
|
|||
"county":"莱山区",//区县
|
|||
"depart_ids":"未填写",//街道
|
|||
"depart_name":null,//部门名称
|
|||
"realname":"采样点327",//采样点名称
|
|||
"upload_time":"2022-09-17 07:56:45",//自增时间戳
|
|||
"sd_id":null, |
|||
"sd_batch":null, |
|||
"sd_operation":null, |
|||
"sd_time":null, |
|||
"inserttime":"2022-09-17 09:36:20"//省大数据局返还烟台入库时间
|
|||
}*/ |
|||
|
|||
} |
@ -0,0 +1,539 @@ |
|||
package com.epmet.commons.tools.redis.common.bean; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2022/10/17 15:40 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class IcResiUserInfoCache implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3644143706074015380L; |
|||
|
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id customer.id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 所属小区ID |
|||
*/ |
|||
private String villageId; |
|||
|
|||
/** |
|||
* 所属楼宇Id |
|||
*/ |
|||
private String buildId; |
|||
|
|||
/** |
|||
* 单元id |
|||
*/ |
|||
private String unitId; |
|||
|
|||
/** |
|||
* 所属家庭Id |
|||
*/ |
|||
private String homeId; |
|||
|
|||
/** |
|||
* 是否本地户籍 |
|||
*/ |
|||
private String isBdhj; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 性别 |
|||
*/ |
|||
private String gender; |
|||
|
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 出生日期 |
|||
*/ |
|||
private String birthday; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remarks; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contacts; |
|||
|
|||
/** |
|||
* 联系人电话 |
|||
*/ |
|||
private String contactsMobile; |
|||
|
|||
/** |
|||
* 九小场所url |
|||
*/ |
|||
private String ninePlace; |
|||
|
|||
/** |
|||
* 是否党员 |
|||
*/ |
|||
private String isParty; |
|||
|
|||
/** |
|||
* 是否低保户 |
|||
*/ |
|||
private String isDbh; |
|||
|
|||
/** |
|||
* 是否保障房 |
|||
*/ |
|||
private String isEnsureHouse; |
|||
|
|||
/** |
|||
* 是否失业 |
|||
*/ |
|||
private String isUnemployed; |
|||
|
|||
/** |
|||
* 是否育龄妇女 |
|||
*/ |
|||
private String isYlfn; |
|||
|
|||
/** |
|||
* 是否退役军人 |
|||
*/ |
|||
private String isVeterans; |
|||
|
|||
/** |
|||
* 是否统战人员 |
|||
*/ |
|||
private String isUnitedFront; |
|||
|
|||
/** |
|||
* 是否信访人员 |
|||
*/ |
|||
private String isXfry; |
|||
|
|||
/** |
|||
* 是否志愿者 |
|||
*/ |
|||
private String isVolunteer; |
|||
|
|||
/** |
|||
* 是否老年人 |
|||
*/ |
|||
private String isOldPeople; |
|||
|
|||
/** |
|||
* 是否空巢 |
|||
*/ |
|||
private String isKc; |
|||
|
|||
/** |
|||
* 是否失独 |
|||
*/ |
|||
private String isSd; |
|||
|
|||
/** |
|||
* 是否失能 |
|||
*/ |
|||
private String isSn; |
|||
|
|||
/** |
|||
* 是否失智 |
|||
*/ |
|||
private String isSz; |
|||
|
|||
/** |
|||
* 是否残疾 |
|||
*/ |
|||
private String isCj; |
|||
|
|||
/** |
|||
* 是否大病 |
|||
*/ |
|||
private String isDb; |
|||
|
|||
/** |
|||
* 是否慢病 |
|||
*/ |
|||
private String isMb; |
|||
|
|||
/** |
|||
* 是否特殊人群 |
|||
*/ |
|||
private String isSpecial; |
|||
|
|||
/** |
|||
* 是否租户【是:1 否:0】 |
|||
*/ |
|||
private String isTenant; |
|||
|
|||
/** |
|||
* 是否是流动人口【是:1 否:0】 |
|||
*/ |
|||
private String isFloating; |
|||
|
|||
/** |
|||
* 是否新阶层人士【是:1 否:0】 |
|||
*/ |
|||
private String isXjc; |
|||
|
|||
/** |
|||
* 文化程度【字典表】 |
|||
*/ |
|||
private String culture; |
|||
|
|||
/** |
|||
* 文化程度备注 |
|||
*/ |
|||
private String cultureRemakes; |
|||
|
|||
/** |
|||
* 特长【字典表】 |
|||
*/ |
|||
private String specialSkill; |
|||
|
|||
/** |
|||
* 兴趣爱好 |
|||
*/ |
|||
private String hobby; |
|||
|
|||
/** |
|||
* 兴趣爱好备注 |
|||
*/ |
|||
private String hobbyRemakes; |
|||
|
|||
/** |
|||
* 宗教信仰 |
|||
*/ |
|||
private String faith; |
|||
|
|||
/** |
|||
* 宗教信仰备注 |
|||
*/ |
|||
private String faithRemakes; |
|||
|
|||
/** |
|||
* 残疾类别【字典表】 |
|||
*/ |
|||
private String cjlb; |
|||
|
|||
/** |
|||
* 残疾登记(状况)【字典表】 |
|||
*/ |
|||
private String cjzk; |
|||
|
|||
/** |
|||
* 残疾证号 |
|||
*/ |
|||
private String cjzh; |
|||
|
|||
/** |
|||
* 残疾说明 |
|||
*/ |
|||
private String cjsm; |
|||
|
|||
/** |
|||
* 有无监护人【yes no】 |
|||
*/ |
|||
private String ynJdr; |
|||
|
|||
/** |
|||
* 有无技能特长【yes no】 |
|||
*/ |
|||
private String ynJntc; |
|||
|
|||
/** |
|||
* 有无劳动能力 |
|||
*/ |
|||
private String ynLdnl; |
|||
|
|||
/** |
|||
* 有无非义务教育阶段助学【yes no】 |
|||
*/ |
|||
private String ynFywjyjdzx; |
|||
|
|||
/** |
|||
* 所患大病 |
|||
*/ |
|||
private String shdb; |
|||
|
|||
/** |
|||
* 患大病时间 |
|||
*/ |
|||
private String dbsj; |
|||
|
|||
/** |
|||
* 所患慢性病 |
|||
*/ |
|||
private String shmxb; |
|||
|
|||
/** |
|||
* 患慢性病时间 |
|||
*/ |
|||
private String mxbsj; |
|||
|
|||
/** |
|||
* 是否参保 |
|||
*/ |
|||
private String isCb; |
|||
|
|||
/** |
|||
* 自付金额 |
|||
*/ |
|||
private String zfje; |
|||
|
|||
/** |
|||
* 救助金额 |
|||
*/ |
|||
private String jzje; |
|||
|
|||
/** |
|||
* 救助时间[yyyy-MM-dd] |
|||
*/ |
|||
private String jzsj; |
|||
|
|||
/** |
|||
* 享受救助明细序号 |
|||
*/ |
|||
private String jzmxxh; |
|||
|
|||
/** |
|||
* 健康信息备注 |
|||
*/ |
|||
private String healthRemakes; |
|||
|
|||
/** |
|||
* 工作单位 |
|||
*/ |
|||
private String gzdw; |
|||
|
|||
/** |
|||
* 职业 |
|||
*/ |
|||
private String zy; |
|||
|
|||
/** |
|||
* 离退休时间 |
|||
*/ |
|||
private String ltxsj; |
|||
|
|||
/** |
|||
* 工作信息备注 |
|||
*/ |
|||
private String workRemake; |
|||
|
|||
/** |
|||
* 退休金额 |
|||
*/ |
|||
private String txje; |
|||
|
|||
/** |
|||
* 月收入 |
|||
*/ |
|||
private String ysr; |
|||
|
|||
/** |
|||
* 是否经济低保 |
|||
*/ |
|||
private String isJjdb; |
|||
|
|||
/** |
|||
* 籍贯 |
|||
*/ |
|||
private String jg; |
|||
|
|||
/** |
|||
* 户籍所在地 |
|||
*/ |
|||
private String hjszd; |
|||
|
|||
/** |
|||
* 现居住地 |
|||
*/ |
|||
private String xjzd; |
|||
|
|||
/** |
|||
* 人户情况 |
|||
*/ |
|||
private String rhzk; |
|||
|
|||
/** |
|||
* 居住信息备注 |
|||
*/ |
|||
private String jzxxRemakes; |
|||
|
|||
/** |
|||
* 民族【字典表】 |
|||
*/ |
|||
private String mz; |
|||
|
|||
/** |
|||
* 与户主关系【字典表】 |
|||
*/ |
|||
private String yhzgx; |
|||
|
|||
/** |
|||
* 居住情况【字典表】 |
|||
*/ |
|||
private String jzqk; |
|||
|
|||
/** |
|||
* 婚姻状况【字典表】 |
|||
*/ |
|||
private String hyzk; |
|||
|
|||
/** |
|||
* 配偶情况【字典表】 |
|||
*/ |
|||
private String poqk; |
|||
|
|||
/** |
|||
* 有无赡养人 |
|||
*/ |
|||
private String ynSyr; |
|||
|
|||
/** |
|||
* 与赡养人关系【字典表】 |
|||
*/ |
|||
private String ysyrgx; |
|||
|
|||
/** |
|||
* 赡养人电话 |
|||
*/ |
|||
private String syrMobile; |
|||
|
|||
/** |
|||
* 家庭信息备注 |
|||
*/ |
|||
private String jtxxRemakes; |
|||
|
|||
/** |
|||
* 用户状态【0:正常;1:迁出;2:注销】 |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 用户详细状态:01:新增、02:导入、03:迁入、04:新生、11:迁出、21死亡 |
|||
*/ |
|||
private String subStatus; |
|||
|
|||
|
|||
/** |
|||
* 删除标识 0.未删除 1.已删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 预留字段1 |
|||
*/ |
|||
private String field1; |
|||
|
|||
/** |
|||
* 预留字段2 |
|||
*/ |
|||
private String field2; |
|||
|
|||
/** |
|||
* 预留字段3 |
|||
*/ |
|||
private String field3; |
|||
|
|||
/** |
|||
* 预留字段4 |
|||
*/ |
|||
private String field4; |
|||
|
|||
/** |
|||
* 预留字段5 |
|||
*/ |
|||
private String field5; |
|||
|
|||
/** |
|||
* 预留字段6 |
|||
*/ |
|||
private String field6; |
|||
|
|||
/** |
|||
* 预留字段7 |
|||
*/ |
|||
private String field7; |
|||
|
|||
/** |
|||
* 预留字段8 |
|||
*/ |
|||
private String field8; |
|||
|
|||
/** |
|||
* 预留字段9 |
|||
*/ |
|||
private String field9; |
|||
|
|||
/** |
|||
* 预留字段10 |
|||
*/ |
|||
private String field10; |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.epmet.dto.form.stats; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 人房信息查询dto |
|||
*/ |
|||
@Data |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class UserHouseStatsQueryFormDTO { |
|||
|
|||
private String orgId; |
|||
private String orgType; |
|||
|
|||
@NotBlank(message = "dateId不能为空") |
|||
private String dateId; |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.epmet.stats; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 人房信息统计 |
|||
*/ |
|||
@Data |
|||
public class UserHouseStatsResultDTO { |
|||
private Integer houseTotal = 0; |
|||
private Integer zzHouseTotal = 0; |
|||
private Integer czHouseTotal = 0; |
|||
private Integer xzHouseTotal = 0; |
|||
private Integer userTotal = 0; |
|||
private Integer czUserTotal = 0; |
|||
private Integer ldUserTotal = 0; |
|||
private Integer usingCommunityNum = 0; |
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.epmet.datareport.controller.stats; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.datareport.service.stats.UserHouseStatsService; |
|||
import com.epmet.dto.form.stats.UserHouseStatsQueryFormDTO; |
|||
import com.epmet.stats.UserHouseStatsResultDTO; |
|||
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; |
|||
|
|||
@RestController |
|||
@RequestMapping("userHouse") |
|||
public class UserHouseController { |
|||
|
|||
@Autowired |
|||
private UserHouseStatsService userHouseStatsService; |
|||
|
|||
/** |
|||
* 通过dateId查询人房统计信息 |
|||
* @param input |
|||
* @return |
|||
*/ |
|||
@PostMapping("getUserHouseDailyStatsByDateId") |
|||
public Result<UserHouseStatsResultDTO> getUserHouseDailyStatsByDateId(@RequestBody UserHouseStatsQueryFormDTO input) { |
|||
ValidatorUtils.validateEntity(input); |
|||
String orgId = input.getOrgId(); |
|||
String orgType = input.getOrgType(); |
|||
String dateId = input.getDateId(); |
|||
|
|||
UserHouseStatsResultDTO r = userHouseStatsService.getUserHouseDailyStats(orgId, orgType, dateId); |
|||
return new Result<UserHouseStatsResultDTO>().ok(r); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.epmet.datareport.dao.stats; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.datareport.entity.stats.FactAgencyUserHouseDailyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
|
|||
/** |
|||
* 人房信息统计数,按天统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-27 |
|||
*/ |
|||
@Mapper |
|||
public interface FactAgencyUserHouseDailyDao extends BaseDao<FactAgencyUserHouseDailyEntity> { |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.epmet.datareport.dao.stats; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.datareport.entity.stats.FactGridUserHouseDailyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
|
|||
/** |
|||
* 网格的人房信息统计数,按天统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-27 |
|||
*/ |
|||
@Mapper |
|||
public interface FactGridUserHouseDailyDao extends BaseDao<FactGridUserHouseDailyEntity> { |
|||
|
|||
} |
@ -0,0 +1,115 @@ |
|||
package com.epmet.datareport.entity.stats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 人房信息统计数,按天统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-27 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_agency_user_house_daily") |
|||
public class FactAgencyUserHouseDailyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 数据更新至:yyyyMMdd; |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 组织id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* agency_id所属的机关级别(社区级:community, |
|||
乡(镇、街道)级:street, |
|||
区县级: district, |
|||
市级: city |
|||
省级:province) |
|||
*/ |
|||
private String level; |
|||
|
|||
/** |
|||
* 组织i所属的组织id |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 组织i所有上级id |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 小区总数 |
|||
*/ |
|||
private Integer neighbourhoodsCount; |
|||
|
|||
/** |
|||
* 房屋总数 |
|||
*/ |
|||
private Integer houseCount; |
|||
|
|||
/** |
|||
* 自住房屋总数 |
|||
*/ |
|||
private Integer houseSelfCount; |
|||
|
|||
/** |
|||
* 出租房屋总数 |
|||
*/ |
|||
private Integer houseLeaseCount; |
|||
|
|||
/** |
|||
* 闲置房屋总数 |
|||
*/ |
|||
private Integer houseIdleCount; |
|||
|
|||
/** |
|||
* 居民总数 |
|||
*/ |
|||
private Integer userCount; |
|||
|
|||
/** |
|||
* 常住居民总数 |
|||
*/ |
|||
private Integer userResiCount; |
|||
|
|||
/** |
|||
* 流动居民总数 |
|||
*/ |
|||
private Integer userFloatCount; |
|||
|
|||
/** |
|||
* 当日新增房屋数 |
|||
*/ |
|||
private Integer houseIncr; |
|||
|
|||
/** |
|||
* 当日修改房屋数 |
|||
*/ |
|||
private Integer houseModify; |
|||
|
|||
/** |
|||
* 当日新增居民数 |
|||
*/ |
|||
private Integer userIncr; |
|||
|
|||
/** |
|||
* 当日修改居民数 |
|||
*/ |
|||
private Integer userModify; |
|||
|
|||
} |
@ -0,0 +1,106 @@ |
|||
package com.epmet.datareport.entity.stats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 网格的人房信息统计数,按天统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-27 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_grid_user_house_daily") |
|||
public class FactGridUserHouseDailyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 数据更新至:yyyyMMdd; |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 网格所属的组织id |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 网格所有上级id |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 小区总数 |
|||
*/ |
|||
private Integer neighbourhoodsCount; |
|||
|
|||
/** |
|||
* 房屋总数 |
|||
*/ |
|||
private Integer houseCount; |
|||
|
|||
/** |
|||
* 自住房屋总数 |
|||
*/ |
|||
private Integer houseSelfCount; |
|||
|
|||
/** |
|||
* 出租房屋总数 |
|||
*/ |
|||
private Integer houseLeaseCount; |
|||
|
|||
/** |
|||
* 闲置房屋总数 |
|||
*/ |
|||
private Integer houseIdleCount; |
|||
|
|||
/** |
|||
* 居民总数 |
|||
*/ |
|||
private Integer userCount; |
|||
|
|||
/** |
|||
* 常住居民总数 |
|||
*/ |
|||
private Integer userResiCount; |
|||
|
|||
/** |
|||
* 流动居民总数 |
|||
*/ |
|||
private Integer userFloatCount; |
|||
|
|||
/** |
|||
* 当日新增房屋数 |
|||
*/ |
|||
private Integer houseIncr; |
|||
|
|||
/** |
|||
* 当日修改房屋数 |
|||
*/ |
|||
private Integer houseModify; |
|||
|
|||
/** |
|||
* 当日新增居民数 |
|||
*/ |
|||
private Integer userIncr; |
|||
|
|||
/** |
|||
* 当日修改居民数 |
|||
*/ |
|||
private Integer userModify; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.epmet.datareport.service.stats; |
|||
|
|||
import com.epmet.stats.UserHouseStatsResultDTO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
/** |
|||
* 人房统计service |
|||
*/ |
|||
public interface UserHouseStatsService { |
|||
|
|||
/** |
|||
* 查询指定dateId的人房统计信息 |
|||
* @param orgId |
|||
* @param orgType |
|||
* @param dateId |
|||
* @return |
|||
*/ |
|||
UserHouseStatsResultDTO getUserHouseDailyStats(String orgId, String orgType, String dateId); |
|||
} |
@ -0,0 +1,87 @@ |
|||
package com.epmet.datareport.service.stats.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|||
import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.datareport.dao.stats.FactAgencyUserHouseDailyDao; |
|||
import com.epmet.datareport.dao.stats.FactGridUserHouseDailyDao; |
|||
import com.epmet.datareport.entity.stats.FactAgencyUserHouseDailyEntity; |
|||
import com.epmet.datareport.entity.stats.FactGridUserHouseDailyEntity; |
|||
import com.epmet.datareport.service.stats.UserHouseStatsService; |
|||
import com.epmet.stats.UserHouseStatsResultDTO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
@DataSource(DataSourceConstant.STATS) |
|||
public class UserHouseStatsServiceImpl implements UserHouseStatsService { |
|||
|
|||
@Autowired |
|||
private FactGridUserHouseDailyDao factGridUserHouseDailyDao; |
|||
|
|||
@Autowired |
|||
private FactAgencyUserHouseDailyDao factAgencyUserHouseDailyDao; |
|||
|
|||
@Override |
|||
public UserHouseStatsResultDTO getUserHouseDailyStats(String orgId, String orgType, String dateId) { |
|||
// 没有传参,使用当前登录人的
|
|||
if (StringUtils.isEmpty(orgId) || StringUtils.isEmpty(orgType)) { |
|||
String userId = EpmetRequestHolder.getLoginUserId(); |
|||
String customerId = EpmetRequestHolder.getLoginUserCustomerId(); |
|||
|
|||
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); |
|||
if (null == staffInfo) { |
|||
throw new EpmetException(String.format("查询工作人员%s缓存信息失败:%s", userId)); |
|||
} |
|||
|
|||
orgId = staffInfo.getAgencyId(); |
|||
orgType = "agency"; |
|||
} |
|||
|
|||
// 结果对象初始化
|
|||
UserHouseStatsResultDTO result = new UserHouseStatsResultDTO(); |
|||
|
|||
if ("agency".equals(orgType)) { |
|||
// 查询的目标是组织
|
|||
LambdaQueryWrapper<FactAgencyUserHouseDailyEntity> query = new LambdaQueryWrapper<>(); |
|||
query.eq(FactAgencyUserHouseDailyEntity::getDateId, dateId); |
|||
query.eq(FactAgencyUserHouseDailyEntity::getAgencyId, orgId); |
|||
FactAgencyUserHouseDailyEntity agencyDailyStats = factAgencyUserHouseDailyDao.selectOne(query); |
|||
if (agencyDailyStats != null) { |
|||
result.setHouseTotal(agencyDailyStats.getHouseCount()); |
|||
result.setCzHouseTotal(agencyDailyStats.getHouseLeaseCount()); |
|||
result.setXzHouseTotal(agencyDailyStats.getHouseIdleCount()); |
|||
result.setZzHouseTotal(agencyDailyStats.getHouseSelfCount()); |
|||
result.setUserTotal(agencyDailyStats.getUserCount()); |
|||
result.setCzUserTotal(agencyDailyStats.getUserResiCount()); |
|||
result.setLdUserTotal(agencyDailyStats.getUserFloatCount()); |
|||
} |
|||
} else { |
|||
// 查询的目标是网格
|
|||
LambdaQueryWrapper<FactGridUserHouseDailyEntity> query = new LambdaQueryWrapper<>(); |
|||
query.eq(FactGridUserHouseDailyEntity::getDateId, dateId); |
|||
query.eq(FactGridUserHouseDailyEntity::getGridId, orgId); |
|||
FactGridUserHouseDailyEntity gridDailyStats = factGridUserHouseDailyDao.selectOne(query); |
|||
if (gridDailyStats != null) { |
|||
result.setHouseTotal(gridDailyStats.getHouseCount()); |
|||
result.setCzHouseTotal(gridDailyStats.getHouseLeaseCount()); |
|||
result.setXzHouseTotal(gridDailyStats.getHouseIdleCount()); |
|||
result.setZzHouseTotal(gridDailyStats.getHouseSelfCount()); |
|||
result.setUserTotal(gridDailyStats.getUserCount()); |
|||
result.setCzUserTotal(gridDailyStats.getUserResiCount()); |
|||
result.setLdUserTotal(gridDailyStats.getUserFloatCount()); |
|||
} |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
<?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.datareport.dao.stats.FactAgencyUserHouseDailyDao"> |
|||
|
|||
<resultMap type="com.epmet.datareport.entity.stats.FactAgencyUserHouseDailyEntity" id="factAgencyUserHouseDailyMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="dateId" column="DATE_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="level" column="LEVEL"/> |
|||
<result property="pid" column="PID"/> |
|||
<result property="pids" column="PIDS"/> |
|||
<result property="neighbourhoodsCount" column="NEIGHBOURHOODS_COUNT"/> |
|||
<result property="houseCount" column="HOUSE_COUNT"/> |
|||
<result property="houseSelfCount" column="HOUSE_SELF_COUNT"/> |
|||
<result property="houseLeaseCount" column="HOUSE_LEASE_COUNT"/> |
|||
<result property="houseIdleCount" column="HOUSE_IDLE_COUNT"/> |
|||
<result property="userCount" column="USER_COUNT"/> |
|||
<result property="userResiCount" column="USER_RESI_COUNT"/> |
|||
<result property="userFloatCount" column="USER_FLOAT_COUNT"/> |
|||
<result property="houseIncr" column="HOUSE_INCR"/> |
|||
<result property="houseModify" column="HOUSE_MODIFY"/> |
|||
<result property="userIncr" column="USER_INCR"/> |
|||
<result property="userModify" column="USER_MODIFY"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
</mapper> |
@ -0,0 +1,32 @@ |
|||
<?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.datareport.dao.stats.FactGridUserHouseDailyDao"> |
|||
|
|||
<resultMap type="com.epmet.datareport.entity.stats.FactGridUserHouseDailyEntity" id="factGridUserHouseDailyMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="dateId" column="DATE_ID"/> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="pid" column="PID"/> |
|||
<result property="pids" column="PIDS"/> |
|||
<result property="neighbourhoodsCount" column="NEIGHBOURHOODS_COUNT"/> |
|||
<result property="houseCount" column="HOUSE_COUNT"/> |
|||
<result property="houseSelfCount" column="HOUSE_SELF_COUNT"/> |
|||
<result property="houseLeaseCount" column="HOUSE_LEASE_COUNT"/> |
|||
<result property="houseIdleCount" column="HOUSE_IDLE_COUNT"/> |
|||
<result property="userCount" column="USER_COUNT"/> |
|||
<result property="userResiCount" column="USER_RESI_COUNT"/> |
|||
<result property="userFloatCount" column="USER_FLOAT_COUNT"/> |
|||
<result property="houseIncr" column="HOUSE_INCR"/> |
|||
<result property="houseModify" column="HOUSE_MODIFY"/> |
|||
<result property="userIncr" column="USER_INCR"/> |
|||
<result property="userModify" column="USER_MODIFY"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
</mapper> |
@ -0,0 +1,71 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.dto.DingMiniInfoDTO; |
|||
import com.epmet.service.DingMiniInfoService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 钉钉小程序信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-09-14 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("dingMiniInfo") |
|||
public class DingMiniInfoController { |
|||
|
|||
@Autowired |
|||
private DingMiniInfoService dingMiniInfoService; |
|||
|
|||
@RequestMapping("page") |
|||
public Result<PageData<DingMiniInfoDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<DingMiniInfoDTO> page = dingMiniInfoService.page(params); |
|||
return new Result<PageData<DingMiniInfoDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<DingMiniInfoDTO> get(@PathVariable("id") String id){ |
|||
DingMiniInfoDTO data = dingMiniInfoService.get(id); |
|||
return new Result<DingMiniInfoDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody DingMiniInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
dingMiniInfoService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("update") |
|||
public Result update(@RequestBody DingMiniInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
dingMiniInfoService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("delete") |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
dingMiniInfoService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.DingMiniInfoEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 钉钉小程序信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-09-14 |
|||
*/ |
|||
@Mapper |
|||
public interface DingMiniInfoDao extends BaseDao<DingMiniInfoEntity> { |
|||
|
|||
} |
@ -0,0 +1,55 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 钉钉小程序信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-09-14 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("ding_mini_info") |
|||
public class DingMiniInfoEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String suiteId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String appId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String miniAppId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String suiteName; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String suiteKey; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String suiteSecret; |
|||
|
|||
private String token; |
|||
|
|||
private String aesKey; |
|||
|
|||
} |
@ -0,0 +1,78 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.DingMiniInfoDTO; |
|||
import com.epmet.entity.DingMiniInfoEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 钉钉小程序信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-09-14 |
|||
*/ |
|||
public interface DingMiniInfoService extends BaseService<DingMiniInfoEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<DingMiniInfoDTO> |
|||
* @author generator |
|||
* @date 2022-09-14 |
|||
*/ |
|||
PageData<DingMiniInfoDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<DingMiniInfoDTO> |
|||
* @author generator |
|||
* @date 2022-09-14 |
|||
*/ |
|||
List<DingMiniInfoDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return DingMiniInfoDTO |
|||
* @author generator |
|||
* @date 2022-09-14 |
|||
*/ |
|||
DingMiniInfoDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-09-14 |
|||
*/ |
|||
void save(DingMiniInfoDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-09-14 |
|||
*/ |
|||
void update(DingMiniInfoDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-09-14 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
@ -0,0 +1,82 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.dao.DingMiniInfoDao; |
|||
import com.epmet.dto.DingMiniInfoDTO; |
|||
import com.epmet.entity.DingMiniInfoEntity; |
|||
import com.epmet.service.DingMiniInfoService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 钉钉小程序信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-09-14 |
|||
*/ |
|||
@Service |
|||
public class DingMiniInfoServiceImpl extends BaseServiceImpl<DingMiniInfoDao, DingMiniInfoEntity> implements DingMiniInfoService { |
|||
|
|||
@Override |
|||
public PageData<DingMiniInfoDTO> page(Map<String, Object> params) { |
|||
IPage<DingMiniInfoEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, DingMiniInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<DingMiniInfoDTO> list(Map<String, Object> params) { |
|||
List<DingMiniInfoEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, DingMiniInfoDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<DingMiniInfoEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<DingMiniInfoEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public DingMiniInfoDTO get(String id) { |
|||
DingMiniInfoEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, DingMiniInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(DingMiniInfoDTO dto) { |
|||
DingMiniInfoEntity entity = ConvertUtils.sourceToTarget(dto, DingMiniInfoEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(DingMiniInfoDTO dto) { |
|||
DingMiniInfoEntity entity = ConvertUtils.sourceToTarget(dto, DingMiniInfoEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,23 @@ |
|||
<?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.dao.DingMiniInfoDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.DingMiniInfoEntity" id="dingMiniInfoMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="suiteId" column="SUITE_ID"/> |
|||
<result property="appId" column="APP_ID"/> |
|||
<result property="miniAppId" column="MINI_APP_ID"/> |
|||
<result property="suiteName" column="SUITE_NAME"/> |
|||
<result property="suiteKey" column="SUITE_KEY"/> |
|||
<result property="suiteSecret" column="SUITE_SECRET"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,15 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class CommunityUserHouseStatsFormDTO { |
|||
private String orgId; |
|||
private String orgType; |
|||
private Integer pageNo = 1; |
|||
private Integer pageSize = 10; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2022/10/17 13:42 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class DetailByTypeFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8190270734257503603L; |
|||
|
|||
public interface DetailByTypeForm{} |
|||
|
|||
@NotBlank(message = "type不能为空",groups = DetailByTypeForm.class) |
|||
private String type; |
|||
|
|||
@NotBlank(message = "id不能为空",groups = DetailByTypeForm.class) |
|||
private String id; |
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class UsingCommunityStatsFormDTO { |
|||
|
|||
private String orgId; |
|||
private String orgType; |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2022/10/17 13:41 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class DetailByTypeResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -8067849365791132347L; |
|||
|
|||
private String idCard; |
|||
|
|||
private String mobile; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class UsingCommunityStatsResultDTO { |
|||
|
|||
/** |
|||
* 开通平台社区数 |
|||
*/ |
|||
private Integer usingCommunityNum; |
|||
/** |
|||
* 开通平台社区数-较上月 |
|||
*/ |
|||
private Integer usingCommunityNumJSY; |
|||
|
|||
} |
@ -0,0 +1,177 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelIgnore; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 数据同步记录-居民死亡信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
@Data |
|||
public class DataSyncRecordDeathDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ColumnWidth(50) |
|||
@ExcelProperty("所属网格") |
|||
private String gridName; |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
@ExcelIgnore |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
@ExcelIgnore |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 组织的pids 含agencyId本身 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String pids; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
@ExcelIgnore |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
@ColumnWidth(15) |
|||
@ExcelProperty("姓名") |
|||
private String name; |
|||
|
|||
/** |
|||
* 身份证 |
|||
*/ |
|||
@ColumnWidth(20) |
|||
@ExcelProperty("证件号") |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 居民Id,ic_resi_user.id |
|||
*/ |
|||
@ExcelIgnore |
|||
private String icResiUserId; |
|||
|
|||
/** |
|||
* 年龄(享年) |
|||
*/ |
|||
@ColumnWidth(10) |
|||
@ExcelProperty("年龄") |
|||
private String age; |
|||
|
|||
/** |
|||
* 家庭住址 |
|||
*/ |
|||
@ColumnWidth(40) |
|||
@ExcelProperty("家庭住址") |
|||
private String address; |
|||
|
|||
/** |
|||
* 死亡时间 |
|||
*/ |
|||
@ColumnWidth(20) |
|||
@ExcelProperty("死亡日期") |
|||
private String deathDate; |
|||
|
|||
/** |
|||
* 火化时间 |
|||
*/ |
|||
@ColumnWidth(20) |
|||
@ExcelProperty("火化时间") |
|||
private String cremationTime; |
|||
|
|||
/** |
|||
* 民族 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String mz; |
|||
|
|||
/** |
|||
* 登记单位名称 |
|||
*/ |
|||
@ColumnWidth(40) |
|||
@ExcelProperty("登记单位名称") |
|||
private String organName; |
|||
|
|||
/** |
|||
* 国籍 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String nation; |
|||
|
|||
/** |
|||
* 第三方记录唯一标识 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String thirdRecordId; |
|||
|
|||
/** |
|||
* 处理状态(更新至居民信息) 0:未处理;1:处理成功;2处理失败 |
|||
*/ |
|||
@ExcelIgnore |
|||
private Integer dealStatus; |
|||
|
|||
/** |
|||
* 处理结果 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String dealResult; |
|||
|
|||
/** |
|||
* 删除标识:0.未删除 1.已删除 |
|||
*/ |
|||
@ExcelIgnore |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
@ExcelIgnore |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@ExcelIgnore |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
@ExcelIgnore |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,171 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import com.epmet.dto.form.dataSync.ResiInfoDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 数据同步记录-居民残疾信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
@Data |
|||
public class DataSyncRecordDisabilityDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 组织的pids 含agencyId本身 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 身份证 |
|||
*/ |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 居民Id,ic_resi_user.id |
|||
*/ |
|||
private String icResiUserId; |
|||
|
|||
/** |
|||
* 残疾证号 |
|||
*/ |
|||
private String cardNum; |
|||
|
|||
/** |
|||
* 残疾等级(状况) |
|||
*/ |
|||
private String cjzkCn; |
|||
|
|||
/** |
|||
* 残疾类别 |
|||
*/ |
|||
private String cjlbCn; |
|||
|
|||
/** |
|||
* 文化程度 |
|||
*/ |
|||
private String eduLevel; |
|||
|
|||
/** |
|||
* 婚姻状况 中文 |
|||
*/ |
|||
private String maritalStatusName; |
|||
|
|||
/** |
|||
* 民族 中文 |
|||
*/ |
|||
private String mzCn; |
|||
|
|||
/** |
|||
* 性别1男2女 |
|||
*/ |
|||
private Integer gender; |
|||
private String genderCn; |
|||
|
|||
/** |
|||
* 户籍地址 |
|||
*/ |
|||
private String residentAdd; |
|||
|
|||
/** |
|||
* 现居住地址 |
|||
*/ |
|||
private String nowAdd; |
|||
private String address; |
|||
|
|||
/** |
|||
* 监护人 |
|||
*/ |
|||
private String guardian; |
|||
|
|||
/** |
|||
* 监护人联系方式 |
|||
*/ |
|||
private String guardianPhone; |
|||
|
|||
/** |
|||
* 处理状态(更新至居民信息) 0:未处理;1:处理成功;2处理失败 |
|||
*/ |
|||
private Integer dealStatus; |
|||
private String dealStatusName; |
|||
|
|||
/** |
|||
* 残疾状态 0:非残疾;1:残疾 |
|||
*/ |
|||
private Integer disabilityStatus; |
|||
|
|||
/** |
|||
* 处理结果 |
|||
*/ |
|||
private String dealResult; |
|||
|
|||
/** |
|||
* 删除标识:0.未删除 1.已删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
private ResiInfoDTO resiInfo; |
|||
|
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue