47 changed files with 1567 additions and 150 deletions
@ -0,0 +1,28 @@ |
|||
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 |
|||
@AllArgsConstructor |
|||
public class OrgOrStaffMQMsg implements Serializable { |
|||
|
|||
//客户Id
|
|||
private String customerId; |
|||
//组织、网格、人员Id
|
|||
private String orgId; |
|||
//数据类型【组织:agency 网格:grid 人员:staff】
|
|||
private String orgType; |
|||
//操作类型【新增:add 修改删除:edit】
|
|||
private String type; |
|||
|
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.basereport.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2021/10/15 10:55 |
|||
*/ |
|||
@Data |
|||
public class EventInfoFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 8479649048108914555L; |
|||
private String customerId; |
|||
private String projectId; |
|||
/** |
|||
* 操作类型【新增:add 修改删除:edit】 |
|||
*/ |
|||
private String type; |
|||
} |
@ -0,0 +1,143 @@ |
|||
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; |
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格编码 |
|||
*/ |
|||
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,0 +1,207 @@ |
|||
/** |
|||
* 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.opendata.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 事件信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-10-15 |
|||
*/ |
|||
@Data |
|||
public class BaseDisputeProcessDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格编码 |
|||
*/ |
|||
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,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.opendata.controller; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.basereport.form.EventInfoFormDTO; |
|||
import com.epmet.opendata.service.BaseDisputeProcessService; |
|||
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; |
|||
|
|||
|
|||
/** |
|||
* 事件信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-10-15 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("basedisputeprocess") |
|||
public class BaseDisputeProcessController { |
|||
|
|||
@Autowired |
|||
private BaseDisputeProcessService baseDisputeProcessService; |
|||
|
|||
/** |
|||
* 获取上报事件 |
|||
* @Param formDTO |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2021/10/15 16:59 |
|||
*/ |
|||
@PostMapping("eventinfo") |
|||
public Result getEventinfo(@RequestBody(required = false) EventInfoFormDTO formDTO) { |
|||
baseDisputeProcessService.getEventinfo(formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
/** |
|||
* 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.opendata.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.opendata.entity.BaseDisputeProcessEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 事件信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-10-15 |
|||
*/ |
|||
@Mapper |
|||
public interface BaseDisputeProcessDao extends BaseDao<BaseDisputeProcessEntity> { |
|||
|
|||
} |
@ -0,0 +1,177 @@ |
|||
/** |
|||
* 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.opendata.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 事件信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-10-15 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("base_dispute_process") |
|||
public class BaseDisputeProcessEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格编码 |
|||
*/ |
|||
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,0 +1,108 @@ |
|||
package com.epmet.opendata.mq.listener; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.rocketmq.constants.MQUserPropertys; |
|||
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.dto.basereport.form.EventInfoFormDTO; |
|||
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|||
import com.epmet.opendata.service.BaseDisputeProcessService; |
|||
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 wxz |
|||
* @Description 系统对接中间库,项目信息变更监听器 |
|||
* @date 2021.10.13 15:21:48 |
|||
*/ |
|||
public class OpenDataProjectChangeEventListener implements MessageListenerConcurrently { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
private EpmetMessageOpenFeignClient messageOpenFeignClient; |
|||
|
|||
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) { |
|||
// msg即为消息体
|
|||
// tags为SystemMessageType.java中的项,为具体的操作,此处拿到tags,判断是创建还是变更,来做响应的后续操作即可
|
|||
String msg = new String(messageExt.getBody()); |
|||
String topic = messageExt.getTopic(); |
|||
String tags = messageExt.getTags(); |
|||
String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.PENDING_MSG_LABEL); |
|||
|
|||
//messageExt.propert
|
|||
|
|||
logger.info("【开放数据事件监听器】-项目信息变更-收到消息内容:{}, 操作:{}, pendingMsgLabel:{}", msg, tags, pendingMsgLabel); |
|||
EventInfoFormDTO obj = JSON.parseObject(msg, EventInfoFormDTO.class); |
|||
|
|||
DistributedLock distributedLock = null; |
|||
RLock lock = null; |
|||
try { |
|||
distributedLock = SpringContextUtils.getBean(DistributedLock.class); |
|||
lock = distributedLock.getLock(String.format("lock:open_data_project:%s", obj.getProjectId()), |
|||
30L, 30L, TimeUnit.SECONDS); |
|||
SpringContextUtils.getBean(BaseDisputeProcessService.class).getEventinfo(obj); |
|||
} catch (RenException e) { |
|||
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
|
|||
logger.error("【开放数据事件监听器】-项目信息变更-上报项目信息失败:".concat(ExceptionUtils.getErrorStackTrace(e))); |
|||
} catch (Exception e) { |
|||
// 不是我们自己抛出的异常,可以让MQ重试
|
|||
logger.error("【开放数据事件监听器】-项目信息变更-上报项目信息失败:".concat(ExceptionUtils.getErrorStackTrace(e))); |
|||
throw e; |
|||
} finally { |
|||
distributedLock.unLock(lock); |
|||
} |
|||
|
|||
if (StringUtils.isNotBlank(pendingMsgLabel)) { |
|||
try { |
|||
removePendingMqMsgCache(pendingMsgLabel); |
|||
} catch (Exception e) { |
|||
logger.error("【开放数据事件监听器】-project-删除mq滞留消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @description |
|||
* |
|||
* @param pendingMsgLabel |
|||
* @return |
|||
* @description 应答mq消息 |
|||
* @author wxz |
|||
* @date 2021.10.14 16:32:32 |
|||
*/ |
|||
private void removePendingMqMsgCache(String pendingMsgLabel) { |
|||
String key = RedisKeys.pendingMqMsgKey(pendingMsgLabel); |
|||
redisUtils.delete(key); |
|||
} |
|||
} |
@ -0,0 +1,40 @@ |
|||
/** |
|||
* 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.opendata.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.dto.basereport.form.EventInfoFormDTO; |
|||
import com.epmet.opendata.entity.BaseDisputeProcessEntity; |
|||
|
|||
/** |
|||
* 事件信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-10-15 |
|||
*/ |
|||
public interface BaseDisputeProcessService extends BaseService<BaseDisputeProcessEntity> { |
|||
|
|||
/** |
|||
* 获取上报事件 |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2021/10/15 16:59 |
|||
*/ |
|||
void getEventinfo(EventInfoFormDTO formDTO); |
|||
} |
@ -0,0 +1,74 @@ |
|||
/** |
|||
* 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.opendata.service.impl; |
|||
|
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.basereport.form.EventInfoFormDTO; |
|||
import com.epmet.feign.DataStatisticalOpenFeignClient; |
|||
import com.epmet.opendata.dao.BaseDisputeProcessDao; |
|||
import com.epmet.opendata.dto.BaseDisputeProcessDTO; |
|||
import com.epmet.opendata.entity.BaseDisputeProcessEntity; |
|||
import com.epmet.opendata.service.BaseDisputeProcessService; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 事件信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-10-15 |
|||
*/ |
|||
@Service |
|||
public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputeProcessDao, BaseDisputeProcessEntity> implements BaseDisputeProcessService { |
|||
@Resource |
|||
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; |
|||
|
|||
/** |
|||
* 获取上报事件 |
|||
* |
|||
* @param formDTO |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2021/10/15 16:59 |
|||
*/ |
|||
@Override |
|||
public void getEventinfo(EventInfoFormDTO formDTO) { |
|||
Result<List<BaseDisputeProcessDTO>> result = dataStatisticalOpenFeignClient.getEventInfo(formDTO); |
|||
if (!result.success()) { |
|||
throw new RenException(result.getInternalMsg()); |
|||
} |
|||
List<BaseDisputeProcessDTO> list = result.getData(); |
|||
if (CollectionUtils.isNotEmpty(list)) { |
|||
List<BaseDisputeProcessEntity> entityList = ConvertUtils.sourceToTarget(list, BaseDisputeProcessEntity.class); |
|||
if("add".equals(formDTO.getType())){ |
|||
insertBatch(entityList); |
|||
}else { |
|||
updateBatchById(entityList); |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
<?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.opendata.dao.BaseDisputeProcessDao"> |
|||
|
|||
<resultMap type="com.epmet.opendata.entity.BaseDisputeProcessEntity" id="baseDisputeProcessMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgCode" column="ORG_CODE"/> |
|||
<result property="orgName" column="ORG_NAME"/> |
|||
<result property="eventName" column="EVENT_NAME"/> |
|||
<result property="eventCategory" column="EVENT_CATEGORY"/> |
|||
<result property="reportTime" column="REPORT_TIME"/> |
|||
<result property="happenDate" column="HAPPEN_DATE"/> |
|||
<result property="happenPlace" column="HAPPEN_PLACE"/> |
|||
<result property="eventDescription" column="EVENT_DESCRIPTION"/> |
|||
<result property="waysOfResolving" column="WAYS_OF_RESOLVING"/> |
|||
<result property="successfulOrNo" column="SUCCESSFUL_OR_NO"/> |
|||
<result property="completeLevel" column="COMPLETE_LEVEL"/> |
|||
<result property="baseInfoId" column="BASE_INFO_ID"/> |
|||
<result property="completeTime" column="COMPLETE_TIME"/> |
|||
<result property="lng" column="LNG"/> |
|||
<result property="lat" column="LAT"/> |
|||
<result property="name" column="NAME"/> |
|||
<result property="numberInvolved" column="NUMBER_INVOLVED"/> |
|||
<result property="relatedUnits" column="RELATED_UNITS"/> |
|||
<result property="keyAreaType" column="KEY_AREA_TYPE"/> |
|||
<result property="religionScale" column="RELIGION_SCALE"/> |
|||
<result property="religionType" column="RELIGION_TYPE"/> |
|||
<result property="isKeyareaState" column="IS_KEYAREA_STATE"/> |
|||
<result property="isKeypeopleLocate" column="IS_KEYPEOPLE_LOCATE"/> |
|||
<result property="keypeopleStatus" column="KEYPEOPLE_STATUS"/> |
|||
<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> |
Loading…
Reference in new issue