家属端注册到绑定家属流程
This commit is contained in:
parent
9b2b099e2e
commit
c63a676219
|
|
@ -0,0 +1,16 @@
|
|||
package com.nu.modules.wechat.elder.api;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 长者信息接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/elderInfo")
|
||||
@Slf4j
|
||||
public class ElderInfoApi {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.nu.modules.wechat.nu.api;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 护理单元信息
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/nuInfo")
|
||||
@Slf4j
|
||||
public class NuInfoApi {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
package com.nu.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 客户信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class ElderInfoMQDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 护理单元
|
||||
*/
|
||||
private String nuId;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
private String idCard;
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy年MM月dd日")
|
||||
@DateTimeFormat(pattern = "yyyy年MM月dd日")
|
||||
private Date dateOfBirth;
|
||||
/**
|
||||
* 民族
|
||||
*/
|
||||
private String national;
|
||||
/**
|
||||
* 住址
|
||||
*/
|
||||
private String houseAddress;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatarPath;
|
||||
/**
|
||||
* 医保类型
|
||||
*/
|
||||
private String medicalType;
|
||||
/**
|
||||
* 报销类型
|
||||
*/
|
||||
private String reimbType;
|
||||
/**
|
||||
* 医保卡号
|
||||
*/
|
||||
private String medicalCard;
|
||||
/**
|
||||
* 文化程度
|
||||
*/
|
||||
private String educationLevel;
|
||||
/**
|
||||
* 婚姻状况
|
||||
*/
|
||||
private String maritalStatus;
|
||||
/**
|
||||
* 宗教信仰
|
||||
*/
|
||||
private String religiousBeliefs;
|
||||
/**
|
||||
* 身份证正面
|
||||
*/
|
||||
private String idCardPositive;
|
||||
/**
|
||||
* 身份证反面
|
||||
*/
|
||||
private String idCardNegative;
|
||||
/**
|
||||
* 户口本本人页
|
||||
*/
|
||||
private String accountBookHimself;
|
||||
/**
|
||||
* 医保卡正面
|
||||
*/
|
||||
private String frontMedical;
|
||||
/**
|
||||
* 医保卡反面
|
||||
*/
|
||||
private String negaticeMedical;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 当前状态 0咨询 1入住 2留床 3退住
|
||||
*/
|
||||
private String currentState;
|
||||
/**
|
||||
* 监护人openId
|
||||
*/
|
||||
private String guardianOpenId;
|
||||
/**
|
||||
* 监护人姓名
|
||||
*/
|
||||
private String guardianName;
|
||||
/**
|
||||
* 监护人与老人关系
|
||||
*/
|
||||
private String relationship;
|
||||
/**
|
||||
* 监护人身份证号
|
||||
*/
|
||||
private String guardianIdCard;
|
||||
/**
|
||||
* 监护人联系电话
|
||||
*/
|
||||
private String guardianPhone;
|
||||
/**
|
||||
* 监护人出生日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy年MM月dd日")
|
||||
@DateTimeFormat(pattern = "yyyy年MM月dd日")
|
||||
private Date guardianDateOfBirth;
|
||||
/**
|
||||
* 监护人家庭住址
|
||||
*/
|
||||
private String guardianHomeAddress;
|
||||
/**
|
||||
* 监护人工作单位
|
||||
*/
|
||||
private String guardianWorkUnit;
|
||||
/**
|
||||
* 家庭住址
|
||||
*/
|
||||
private String homeAddress;
|
||||
/**
|
||||
* 是否删除 0未删除 1删除
|
||||
*/
|
||||
private String delFlag;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
private String sysOrgCode;
|
||||
|
||||
/**
|
||||
* 签发机关
|
||||
*/
|
||||
private String issuingAuthority;
|
||||
/**
|
||||
* 有效开始日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy.MM.dd")
|
||||
@DateTimeFormat(pattern = "yyyy.MM.dd")
|
||||
private Date startTime;
|
||||
/**
|
||||
* 有效结束日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy.MM.dd")
|
||||
@DateTimeFormat(pattern = "yyyy.MM.dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 发卡日期
|
||||
*/
|
||||
private Date cardIssuing;
|
||||
/**
|
||||
* 血型
|
||||
*/
|
||||
private String bloodType;
|
||||
/**
|
||||
* 兵役状况
|
||||
*/
|
||||
private String militaryType;
|
||||
|
||||
/**
|
||||
* 机构编码
|
||||
*/
|
||||
private String orgCode;
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
private String departName;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.nu.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-家属+长者关联表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class NuBaseElderMQDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**编码 机构编码-序号*/
|
||||
private String nuId;
|
||||
/**open_id*/
|
||||
private String openId;
|
||||
/**长者id nu_biz_elder_info.id*/
|
||||
private String elderId;
|
||||
/**机构编码*/
|
||||
private String orgCode;
|
||||
/**使用状态 0未使用 1占用 2入住 3退住 4留床*/
|
||||
private String status;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>Class:易维联-温湿度计Entity
|
||||
* <p>功能描述:功能描述
|
||||
*/
|
||||
@Data
|
||||
public class HumidDeviceEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
private String sn;
|
||||
private String deviceName;
|
||||
private String deviceTypes;//一共16位,第几位为1代表设备有该功能. 1位温度 2位湿度 15位电量
|
||||
private String reportingInterval; //实时数据上报时间间隔 单位分钟
|
||||
private String recordInterval; //记录时间间隔 单位分钟
|
||||
private String historyReportTime; //历史数据上报时刻 00:00
|
||||
private String historyInterval; //历史数据上报间隔 单位小时
|
||||
private String temperatureHigh ; //温度预警范围-上限值
|
||||
private String temperatureLow; //温度预警范围-下限值
|
||||
private String temperatureBuffer; //温度缓冲值
|
||||
private String humidityHigh; //湿度预警范围-上限值
|
||||
private String humidityLow; //湿度预警范围-下限值
|
||||
private String humidityBuffer; //湿度缓冲值
|
||||
private String timeCode; //设备所在时区 01北京时间 02纽约时间
|
||||
private String izOutages; //断电报警 0开启 1关闭
|
||||
private String izLowBattery; //低电报警 0开启 1关闭
|
||||
private String izOnline; //上下线通知 0开启 1关闭
|
||||
private String temperature; //温度
|
||||
private String humidity; //湿度
|
||||
private String status; //在线状态,0在线 1离线
|
||||
private String reportingTime; //最新上报时间
|
||||
private String electricity; //电量 0~4
|
||||
|
||||
private String optType; //操作类型
|
||||
private String optTime; //操作时间
|
||||
private String optBy; //操作人
|
||||
|
||||
private Integer alarmCn; //告警数量
|
||||
|
||||
private String nuId;//护理单元ID
|
||||
private String nuName;//护理单元
|
||||
private String departId;//机构ID
|
||||
private String departName;//机构名称
|
||||
private String departServerUrl;//机构服务地址
|
||||
private String oldServerUrl;//原机构服务地址
|
||||
private String syncType;//是否同步 0 未同步 1已同步
|
||||
private String oldDepartId;//原机构id
|
||||
private String oldDepartName;//原机构名称
|
||||
/**维修状态*/
|
||||
private String maintainStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元入住退住日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class NuLogEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private Integer id;
|
||||
/**护理单元编号*/
|
||||
private String nuId;
|
||||
/**老人ID*/
|
||||
private Integer elderId;
|
||||
/**家属 open_id*/
|
||||
private String openId;
|
||||
/**状态:1-入住,2-退住*/
|
||||
private Integer status;
|
||||
/**入住时间*/
|
||||
private Date startedTime;
|
||||
/**退住时间(未退住则为空)*/
|
||||
private Date endedTime;
|
||||
/**日志创建时间*/
|
||||
private Date createTime;
|
||||
/**日志更新时间*/
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.nu.modules.mq.elderinfo.exceptionhandler;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.AmqpRejectAndDontRequeueException;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.listener.api.RabbitListenerErrorHandler;
|
||||
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component("elderInfoMQErrorHandler")
|
||||
public class ElderInfoMQExceptionHandler implements RabbitListenerErrorHandler {
|
||||
|
||||
@Override
|
||||
public Object handleError(Message message, org.springframework.messaging.Message<?> message1, ListenerExecutionFailedException e) {
|
||||
log.error("MQ消息处理失败 | 消息体: {} | 异常原因: {}", new String(message.getBody()), e.getCause().getMessage());
|
||||
|
||||
// 根据异常类型选择处理策略
|
||||
// if (isRetryable(e)) {
|
||||
// // 可重试异常:抛出异常触发重试
|
||||
// throw e;
|
||||
// } else {
|
||||
// 不可恢复异常:拒绝消息且不重新入队
|
||||
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.nu.modules.mq.elderinfo.listener;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("elderInfoAsyncDQNP")
|
||||
public class DynamicQueueNameProvider {
|
||||
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
public String getAddElderInfoQueueName() {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
if (StringUtils.isNotBlank(orgCode)) {
|
||||
return orgCode + ".elder.addelder";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getAddElderInfoKeyName() {
|
||||
return getAddElderInfoQueueName();
|
||||
}
|
||||
|
||||
public String getUpdateElderInfoQueueName() {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
if (StringUtils.isNotBlank(orgCode)) {
|
||||
return orgCode + ".elder.updateelder";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getUpdateElderInfoKeyName() {
|
||||
return getUpdateElderInfoQueueName();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,194 @@
|
|||
package com.nu.modules.mq.elderinfo.listener;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.nu.dto.ElderInfoMQDto;
|
||||
import com.nu.modules.elderinfo.entity.ElderInfo;
|
||||
import com.nu.modules.elderinfo.service.IElderInfoService;
|
||||
import com.nu.modules.mediaasyncerrorlog.entity.MediaAsyncErrorLog;
|
||||
import com.nu.modules.mediaasyncerrorlog.service.IMediaAsyncErrorLogService;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.FileDownloader;
|
||||
import com.nu.utils.SafetyUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.amqp.core.ExchangeTypes;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ElderInfoMQListener {
|
||||
|
||||
@Value("${jeecg.path.upload}")
|
||||
private String upLoadPath;
|
||||
@Autowired
|
||||
private IElderInfoService elderInfoService;
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
@Autowired
|
||||
private IMediaAsyncErrorLogService mediaAsyncErrorLogService;
|
||||
|
||||
/**
|
||||
* 新增长者信息
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(bindings = @QueueBinding(value = @Queue(name = "#{elderInfoAsyncDQNP.getAddElderInfoQueueName()}"), exchange = @Exchange(name = "hldy.elder", type = ExchangeTypes.DIRECT), key = "#{elderInfoAsyncDQNP.getAddElderInfoKeyName()}"), errorHandler = "elderInfoMQErrorHandler")
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public void handleAddElderInfo(ElderInfoMQDto dto) {
|
||||
ElderInfo elderInfo = new ElderInfo();
|
||||
BeanUtils.copyProperties(dto, elderInfo);
|
||||
elderInfoService.save(elderInfo);
|
||||
|
||||
new Thread(() -> {
|
||||
//去管理平台拉取资源
|
||||
{
|
||||
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url");
|
||||
String baseUrl = opeOpenUrl.getString("configValue");
|
||||
if (baseUrl.endsWith("/")) {
|
||||
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
|
||||
}
|
||||
//身份证正面
|
||||
String idCardPositive = dto.getIdCardPositive();
|
||||
{
|
||||
if (StringUtils.isNotBlank(idCardPositive)) {
|
||||
if (StringUtils.isNotBlank(idCardPositive)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/"));
|
||||
String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(idCardPositive);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
log.error("家属添加老人信息-身份证正面文件拉取错误,老人id" + elderInfo.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//身份证反面
|
||||
String idCardNegative = dto.getIdCardNegative();
|
||||
{
|
||||
if (StringUtils.isNotBlank(idCardNegative)) {
|
||||
if (StringUtils.isNotBlank(idCardNegative)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/"));
|
||||
String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(idCardNegative);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
log.error("家属添加老人信息-身份证反面文件拉取错误,老人id" + elderInfo.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新长者信息
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(bindings = @QueueBinding(value = @Queue(name = "#{elderInfoAsyncDQNP.getUpdateElderInfoQueueName()}"), exchange = @Exchange(name = "hldy.elder", type = ExchangeTypes.DIRECT), key = "#{elderInfoAsyncDQNP.getUpdateElderInfoKeyName()}"), errorHandler = "elderInfoMQErrorHandler")
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public void handleUpdateElderInfo(ElderInfoMQDto dto) {
|
||||
ElderInfo elderInfo = new ElderInfo();
|
||||
BeanUtils.copyProperties(dto, elderInfo);
|
||||
elderInfoService.updateById(elderInfo);
|
||||
|
||||
//去管理平台拉取资源
|
||||
{
|
||||
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url");
|
||||
String baseUrl = opeOpenUrl.getString("configValue");
|
||||
if (baseUrl.endsWith("/")) {
|
||||
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
|
||||
}
|
||||
//身份证正面
|
||||
String idCardPositive = dto.getIdCardPositive();
|
||||
{
|
||||
if (StringUtils.isNotBlank(idCardPositive)) {
|
||||
if (StringUtils.isNotBlank(idCardPositive)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/"));
|
||||
String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(idCardPositive);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
log.error("修改老人信息-身份证正面文件拉取错误,老人id" + elderInfo.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//身份证反面
|
||||
String idCardNegative = dto.getIdCardNegative();
|
||||
{
|
||||
if (StringUtils.isNotBlank(idCardNegative)) {
|
||||
if (StringUtils.isNotBlank(idCardNegative)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/"));
|
||||
String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(idCardNegative);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
log.error("修改老人信息-身份证反面文件拉取错误,老人id" + elderInfo.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.nu.modules.nulog.api;
|
||||
|
||||
import com.nu.entity.NuLogEntity;
|
||||
|
||||
public interface INuLogApi {
|
||||
void addLog(NuLogEntity nuLogEntity);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
package com.nu.modules.nulog.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.nulog.entity.NuLog;
|
||||
import com.nu.modules.nulog.service.INuLogService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元入住退住日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="护理单元入住退住日志")
|
||||
@RestController
|
||||
@RequestMapping("/nulog/nuLog")
|
||||
@Slf4j
|
||||
public class NuLogController extends JeecgController<NuLog, INuLogService> {
|
||||
@Autowired
|
||||
private INuLogService nuLogService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuLog
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "护理单元入住退住日志-分页列表查询")
|
||||
@ApiOperation(value="护理单元入住退住日志-分页列表查询", notes="护理单元入住退住日志-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuLog>> queryPageList(NuLog nuLog,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<NuLog> queryWrapper = QueryGenerator.initQueryWrapper(nuLog, req.getParameterMap());
|
||||
Page<NuLog> page = new Page<NuLog>(pageNo, pageSize);
|
||||
IPage<NuLog> pageList = nuLogService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuLog
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元入住退住日志-添加")
|
||||
@ApiOperation(value="护理单元入住退住日志-添加", notes="护理单元入住退住日志-添加")
|
||||
@RequiresPermissions("nulog:nu_nu_log:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuLog nuLog) {
|
||||
nuLogService.save(nuLog);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuLog
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元入住退住日志-编辑")
|
||||
@ApiOperation(value="护理单元入住退住日志-编辑", notes="护理单元入住退住日志-编辑")
|
||||
@RequiresPermissions("nulog:nu_nu_log:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuLog nuLog) {
|
||||
nuLogService.updateById(nuLog);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元入住退住日志-通过id删除")
|
||||
@ApiOperation(value="护理单元入住退住日志-通过id删除", notes="护理单元入住退住日志-通过id删除")
|
||||
@RequiresPermissions("nulog:nu_nu_log:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuLogService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元入住退住日志-批量删除")
|
||||
@ApiOperation(value="护理单元入住退住日志-批量删除", notes="护理单元入住退住日志-批量删除")
|
||||
@RequiresPermissions("nulog:nu_nu_log:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.nuLogService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "护理单元入住退住日志-通过id查询")
|
||||
@ApiOperation(value="护理单元入住退住日志-通过id查询", notes="护理单元入住退住日志-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuLog> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
NuLog nuLog = nuLogService.getById(id);
|
||||
if(nuLog==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuLog
|
||||
*/
|
||||
@RequiresPermissions("nulog:nu_nu_log:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, NuLog nuLog) {
|
||||
return super.exportXls(request, nuLog, NuLog.class, "护理单元入住退住日志");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("nulog:nu_nu_log:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, NuLog.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.nu.modules.nulog.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元入住退住日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_nu_log")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_nu_log对象", description="护理单元入住退住日志")
|
||||
public class NuLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Integer id;
|
||||
/**护理单元编号*/
|
||||
@Excel(name = "护理单元编号", width = 15)
|
||||
@ApiModelProperty(value = "护理单元编号")
|
||||
private java.lang.String nuId;
|
||||
/**老人ID*/
|
||||
@Excel(name = "老人ID", width = 15)
|
||||
@ApiModelProperty(value = "老人ID")
|
||||
private java.lang.Integer elderId;
|
||||
/**家属 open_id*/
|
||||
@Excel(name = "家属 open_id", width = 15)
|
||||
@ApiModelProperty(value = "家属 open_id")
|
||||
private java.lang.String openId;
|
||||
/**状态:1-入住,2-退住*/
|
||||
@Excel(name = "状态:1-入住,2-退住", width = 15)
|
||||
@ApiModelProperty(value = "状态:1-入住,2-退住")
|
||||
private java.lang.Integer status;
|
||||
/**入住时间*/
|
||||
@Excel(name = "入住时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "入住时间")
|
||||
private java.util.Date startedTime;
|
||||
/**退住时间(未退住则为空)*/
|
||||
@Excel(name = "退住时间(未退住则为空)", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "退住时间(未退住则为空)")
|
||||
private java.util.Date endedTime;
|
||||
/**日志创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "日志创建时间")
|
||||
private java.util.Date createTime;
|
||||
/**日志更新时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "日志更新时间")
|
||||
private java.util.Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.nulog.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.nulog.entity.NuLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元入住退住日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface NuLogMapper extends BaseMapper<NuLog> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.nu.modules.nulog.mapper.NuLogMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.nulog.service;
|
||||
|
||||
import com.nu.modules.nulog.entity.NuLog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元入住退住日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface INuLogService extends IService<NuLog> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.nu.modules.nulog.service.impl;
|
||||
|
||||
import com.nu.entity.NuLogEntity;
|
||||
import com.nu.modules.nulog.api.INuLogApi;
|
||||
import com.nu.modules.nulog.entity.NuLog;
|
||||
import com.nu.modules.nulog.mapper.NuLogMapper;
|
||||
import com.nu.modules.nulog.service.INuLogService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元入住退住日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuLogServiceImpl extends ServiceImpl<NuLogMapper, NuLog> implements INuLogService, INuLogApi {
|
||||
|
||||
@Override
|
||||
public void addLog(NuLogEntity nuLogEntity) {
|
||||
NuLog nuLog = new NuLog();
|
||||
BeanUtils.copyProperties(nuLogEntity,nuLog);
|
||||
baseMapper.insert(nuLog);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue