11 changed files with 501 additions and 16 deletions
			
			
		| @ -1 +1 @@ | |||
| Subproject commit d81d0d313a4556e4c6317e7924f98a8b0f6ce2ff | |||
| Subproject commit 492ca0bd1716eca3439b0604c60ebda5910f62f2 | |||
| @ -1 +1 @@ | |||
| Subproject commit 128c6a4bfb8087999b492a6febfdde984623fe3a | |||
| Subproject commit 31d32c81a8018a5c93745bcca1a538cc0bf59e13 | |||
| @ -0,0 +1,37 @@ | |||
| package com.elink.esua.epdc.rocketmq.dto; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  * | |||
|  * 组织机构信息修改-接收MQ消息DTO | |||
|  * | |||
|  * @Author:liuchuang | |||
|  * @Date:2020/3/6 22:34 | |||
|  */ | |||
| @Data | |||
| public class OrganizationModifyDTO implements Serializable { | |||
|     private static final long serialVersionUID = 6288521726874495827L; | |||
| 
 | |||
|     /** | |||
|      * 部门ID | |||
|      */ | |||
|     private Long deptId; | |||
| 
 | |||
|     /** | |||
|      * 旧部门名称 | |||
|      */ | |||
|     private String oldDeptName; | |||
| 
 | |||
|     /** | |||
|      * 新部门名称 | |||
|      */ | |||
|     private String newDeptName; | |||
| 
 | |||
|     /** | |||
|      * 部门类型 | |||
|      */ | |||
|     private String typeKey; | |||
| } | |||
| @ -0,0 +1,146 @@ | |||
| /** | |||
|  * 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.elink.esua.epdc.rocketmq.dto; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.NotNull; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| 
 | |||
| 
 | |||
| /** | |||
|  * 核酸检测记录 | |||
|  * | |||
|  * @author qu qu@elink-cn.com | |||
|  * @since v1.0.0 2021-08-20 | |||
|  */ | |||
| @Data | |||
| public class PersonTestingModifyDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 1L; | |||
| 
 | |||
|     /** | |||
|      * ID | |||
|      */ | |||
| 	private String id; | |||
| 
 | |||
|     /** | |||
|      * 姓名 | |||
|      */ | |||
|     @NotNull(message = "姓名不能为空") | |||
| 	private String name; | |||
| 
 | |||
|     /** | |||
|      * 性别 | |||
|      */ | |||
|     @NotNull(message = "性别不能为空") | |||
| 	private String sex; | |||
| 
 | |||
|     /** | |||
|      * 民族 | |||
|      */ | |||
| 	private String nation; | |||
| 
 | |||
|     /** | |||
|      * 出生日期 | |||
|      */ | |||
| 	private Date birthday; | |||
| 
 | |||
|     /** | |||
|      * 手机号 | |||
|      */ | |||
|     private String mobile; | |||
| 
 | |||
|     /** | |||
|      * 住址 | |||
|      */ | |||
| 	private String address; | |||
| 
 | |||
|     /** | |||
|      * 身份证号码 | |||
|      */ | |||
|     @NotNull(message = "身份证号码不能为空") | |||
| 	private String idcard; | |||
| 
 | |||
|     /** | |||
|      * 签发机关 | |||
|      */ | |||
| 	private String organ; | |||
| 
 | |||
|     /** | |||
|      * 照片base64编码 | |||
|      */ | |||
| 	private String imgCode; | |||
| 
 | |||
|     /** | |||
|      * 照片地址 | |||
|      */ | |||
| 	private String imgUrl; | |||
| 
 | |||
|     /** | |||
|      * 核酸接测结果 | |||
|      */ | |||
| 	private String testingResult; | |||
| 
 | |||
|     /** | |||
|      * 核酸检测时间 | |||
|      */ | |||
|     @NotNull(message = "核酸检测时间不能为空") | |||
| 	private Date testingTime; | |||
| 
 | |||
|     /** | |||
|      * 乐观锁 | |||
|      */ | |||
| 	private Integer revision; | |||
| 
 | |||
|     /** | |||
|      * 创建人 | |||
|      */ | |||
| 	private String createdBy; | |||
| 
 | |||
|     /** | |||
|      * 创建时间 | |||
|      */ | |||
| 	private Date createdTime; | |||
| 
 | |||
|     /** | |||
|      * 更新人 | |||
|      */ | |||
| 	private String updatedBy; | |||
| 
 | |||
|     /** | |||
|      * 更新时间 | |||
|      */ | |||
| 	private Date updatedTime; | |||
| 
 | |||
|     /** | |||
|      * 逻辑删除标识 | |||
|      */ | |||
| 	private String delFlag; | |||
| 
 | |||
|     /** | |||
|      * 核酸检测点表,主键 | |||
|      */ | |||
|     private String testingPointId; | |||
| 
 | |||
|     /** | |||
|      * 核酸检测点,名称 | |||
|      */ | |||
|     private String testingPointName; | |||
| } | |||
| @ -0,0 +1,41 @@ | |||
| package com.elink.esua.epdc.rocketmq.producer; | |||
| 
 | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.rocketmq.client.producer.SendResult; | |||
| import org.apache.rocketmq.common.message.Message; | |||
| import org.apache.rocketmq.spring.core.RocketMQTemplate; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Component; | |||
| 
 | |||
| /** | |||
|  * 接种信息-发送MQ消息 | |||
|  * | |||
|  * @author zhy | |||
|  * @date 2022/4/8 10:20 | |||
|  */ | |||
| @Slf4j | |||
| @Component | |||
| public class PersonTestingModifyProducer { | |||
| 
 | |||
|     @Autowired | |||
|     private RocketMQTemplate rocketMQTemplate; | |||
| 
 | |||
|     /** | |||
|      * 发送消息 | |||
|      * | |||
|      * @return void | |||
|      * @params [topic, tag, keys, body] | |||
|      * @author liuchuang | |||
|      * @since 2020/3/6 21:09 | |||
|      */ | |||
|     public void sendMessage(String topic, String tag, String keys, String body) { | |||
|         Message message = new Message(topic, tag, keys, body.getBytes()); | |||
|         try { | |||
|             SendResult sendResult = rocketMQTemplate.getProducer().send(message); | |||
|             log.info("EPDC-CUSTOM-SERVER发送消息结果:{sendStatus:{}, topic:{}, msgId:{}}", sendResult.getSendStatus(), topic, sendResult.getMsgId()); | |||
|         } catch (Exception e) { | |||
|             log.error("EPDC-CUSTOM-SERVER发送消息异常:{topic:{}, tag:{}, keys:{}, body:{}}", topic, tag, keys, body); | |||
|             e.printStackTrace(); | |||
|         } | |||
|     } | |||
| } | |||
| @ -0,0 +1,75 @@ | |||
| package com.elink.esua.epdc.rocketmq.consumer; | |||
| 
 | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant; | |||
| import com.elink.esua.epdc.commons.tools.exception.RenException; | |||
| import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; | |||
| import com.elink.esua.epdc.rocketmq.dto.PersonTestingModifyDTO; | |||
| import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoDao; | |||
| import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.rocketmq.common.message.MessageExt; | |||
| import org.apache.rocketmq.spring.annotation.MessageModel; | |||
| import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; | |||
| import org.apache.rocketmq.spring.core.RocketMQListener; | |||
| import org.springframework.stereotype.Component; | |||
| 
 | |||
| import javax.annotation.Resource; | |||
| 
 | |||
| /** | |||
|  * 疫苗接种-监听MQ消息 | |||
|  * | |||
|  * @author zhy | |||
|  * @date 2022/4/8 10:49 | |||
|  */ | |||
| @Slf4j | |||
| @Component | |||
| @RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_VACCINE, consumerGroup = "${rocketmq.consumer.vaccine-group}", messageModel = MessageModel.BROADCASTING) | |||
| public class PersonTestingModifyConsumer implements RocketMQListener<MessageExt> { | |||
| 
 | |||
|     @Resource | |||
|     private EpidemicUserInfoDao epidemicUserInfoDao; | |||
| 
 | |||
|     @Override | |||
|     public void onMessage(MessageExt messageExt) { | |||
|         log.info("EPDC-CUSTOM-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_VACCINE, messageExt.getMsgId()); | |||
|         try { | |||
|             String charset = "UTF-8"; | |||
|             String body = new String(messageExt.getBody(), charset); | |||
|             PersonTestingModifyDTO dto = JSONObject.parseObject(body, PersonTestingModifyDTO.class); | |||
| 
 | |||
|             EpidemicUserInfoEntity entity = epidemicUserInfoDao.selectInfoByIdCard(dto.getIdcard()); | |||
|             if (entity != null) { | |||
|                 entity.setCheckDate(dto.getTestingTime()); | |||
|                 entity.setCheckState("0"); | |||
|                 epidemicUserInfoDao.updateById(entity); | |||
|             } else { | |||
|                 entity = new EpidemicUserInfoEntity(); | |||
|                 personTestingDTO2EpidemicUserInfoEntityTransfor(dto, entity); | |||
|                 epidemicUserInfoDao.insert(entity); | |||
|             } | |||
| 
 | |||
| 
 | |||
|             log.info("EPDC-CUSTOM-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_VACCINE, messageExt.getMsgId(), body); | |||
|         } catch (Exception e) { | |||
|             log.info("EPDC-CUSTOM-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); | |||
|             e.printStackTrace(); | |||
|         } | |||
|     } | |||
| 
 | |||
|     private void personTestingDTO2EpidemicUserInfoEntityTransfor(PersonTestingModifyDTO sDto, EpidemicUserInfoEntity dDto) { | |||
|         dDto.setUserName(sDto.getName()); | |||
|         String result = IdentityNoUtils.IdentityNoVerification(sDto.getIdcard()); | |||
|         if (result != null) { | |||
|             throw new RenException(result); | |||
|         } else { | |||
|             dDto.setGender(IdentityNoUtils.getSex(sDto.getIdcard())); | |||
|             dDto.setBirthday(IdentityNoUtils.getBirthday(sDto.getIdcard())); | |||
|         } | |||
|         dDto.setNation(sDto.getNation()); | |||
|         dDto.setHouseholdRegisterDetail(sDto.getAddress()); | |||
|         dDto.setIdCard(sDto.getIdcard()); | |||
|         dDto.setCheckDate(sDto.getTestingTime()); | |||
|         dDto.setCheckState("0"); | |||
|     } | |||
| } | |||
| @ -0,0 +1,146 @@ | |||
| /** | |||
|  * 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.elink.esua.epdc.rocketmq.dto; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.NotNull; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| 
 | |||
| 
 | |||
| /** | |||
|  * 核酸检测记录 | |||
|  * | |||
|  * @author qu qu@elink-cn.com | |||
|  * @since v1.0.0 2021-08-20 | |||
|  */ | |||
| @Data | |||
| public class PersonTestingModifyDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 1L; | |||
| 
 | |||
|     /** | |||
|      * ID | |||
|      */ | |||
| 	private String id; | |||
| 
 | |||
|     /** | |||
|      * 姓名 | |||
|      */ | |||
|     @NotNull(message = "姓名不能为空") | |||
| 	private String name; | |||
| 
 | |||
|     /** | |||
|      * 性别 | |||
|      */ | |||
|     @NotNull(message = "性别不能为空") | |||
| 	private String sex; | |||
| 
 | |||
|     /** | |||
|      * 民族 | |||
|      */ | |||
| 	private String nation; | |||
| 
 | |||
|     /** | |||
|      * 出生日期 | |||
|      */ | |||
| 	private Date birthday; | |||
| 
 | |||
|     /** | |||
|      * 手机号 | |||
|      */ | |||
|     private String mobile; | |||
| 
 | |||
|     /** | |||
|      * 住址 | |||
|      */ | |||
| 	private String address; | |||
| 
 | |||
|     /** | |||
|      * 身份证号码 | |||
|      */ | |||
|     @NotNull(message = "身份证号码不能为空") | |||
| 	private String idcard; | |||
| 
 | |||
|     /** | |||
|      * 签发机关 | |||
|      */ | |||
| 	private String organ; | |||
| 
 | |||
|     /** | |||
|      * 照片base64编码 | |||
|      */ | |||
| 	private String imgCode; | |||
| 
 | |||
|     /** | |||
|      * 照片地址 | |||
|      */ | |||
| 	private String imgUrl; | |||
| 
 | |||
|     /** | |||
|      * 核酸接测结果 | |||
|      */ | |||
| 	private String testingResult; | |||
| 
 | |||
|     /** | |||
|      * 核酸检测时间 | |||
|      */ | |||
|     @NotNull(message = "核酸检测时间不能为空") | |||
| 	private Date testingTime; | |||
| 
 | |||
|     /** | |||
|      * 乐观锁 | |||
|      */ | |||
| 	private Integer revision; | |||
| 
 | |||
|     /** | |||
|      * 创建人 | |||
|      */ | |||
| 	private String createdBy; | |||
| 
 | |||
|     /** | |||
|      * 创建时间 | |||
|      */ | |||
| 	private Date createdTime; | |||
| 
 | |||
|     /** | |||
|      * 更新人 | |||
|      */ | |||
| 	private String updatedBy; | |||
| 
 | |||
|     /** | |||
|      * 更新时间 | |||
|      */ | |||
| 	private Date updatedTime; | |||
| 
 | |||
|     /** | |||
|      * 逻辑删除标识 | |||
|      */ | |||
| 	private String delFlag; | |||
| 
 | |||
|     /** | |||
|      * 核酸检测点表,主键 | |||
|      */ | |||
|     private String testingPointId; | |||
| 
 | |||
|     /** | |||
|      * 核酸检测点,名称 | |||
|      */ | |||
|     private String testingPointName; | |||
| } | |||
					Loading…
					
					
				
		Reference in new issue