日期格式修改

This commit is contained in:
纪寒 2024-03-18 16:36:19 +08:00
parent 968d3547e0
commit 2da3f2d6d8
55 changed files with 1255 additions and 1074 deletions

View File

@ -61,9 +61,9 @@ spring:
servlet: servlet:
multipart: multipart:
# 单个文件大小 # 单个文件大小
max-file-size: 10MB max-file-size: 100MB
# 设置总上传的文件大小 # 设置总上传的文件大小
max-request-size: 20MB max-request-size: 500MB
# 服务模块 # 服务模块
devtools: devtools:
restart: restart:

View File

@ -3,7 +3,7 @@ package com.xinelu.common.core.domain;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.time.LocalDateTime;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -29,7 +29,7 @@ public class BaseEntity implements Serializable {
* 创建时间 * 创建时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private LocalDateTime createTime;
/** /**
* 更新者 * 更新者
@ -40,7 +40,7 @@ public class BaseEntity implements Serializable {
* 更新时间 * 更新时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime; private LocalDateTime updateTime;
/** /**
* 备注 * 备注
@ -68,11 +68,11 @@ public class BaseEntity implements Serializable {
this.createBy = createBy; this.createBy = createBy;
} }
public Date getCreateTime() { public LocalDateTime getCreateTime() {
return createTime; return createTime;
} }
public void setCreateTime(Date createTime) { public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
@ -84,11 +84,11 @@ public class BaseEntity implements Serializable {
this.updateBy = updateBy; this.updateBy = updateBy;
} }
public Date getUpdateTime() { public LocalDateTime getUpdateTime() {
return updateTime; return updateTime;
} }
public void setUpdateTime(Date updateTime) { public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime; this.updateTime = updateTime;
} }

View File

@ -4,7 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import javax.annotation.Resource; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@ -13,15 +13,15 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.xinelu.common.annotation.Log; import com.xinyilu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController; import com.xinyilu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult; import com.xinyilu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.BusinessType; import com.xinyilu.common.enums.BusinessType;
import ${packageName}.domain.${ClassName}; import ${packageName}.domain.${ClassName};
import ${packageName}.service.I${ClassName}Service; import ${packageName}.service.I${ClassName}Service;
import com.xinelu.common.utils.poi.ExcelUtil; import com.xinyilu.common.utils.poi.ExcelUtil;
#if($table.crud || $table.sub) #if($table.crud || $table.sub)
import com.xinelu.common.core.page.TableDataInfo; import com.xinyilu.common.core.page.TableDataInfo;
#elseif($table.tree) #elseif($table.tree)
#end #end
@ -63,7 +63,7 @@ public class ${ClassName}Controller extends BaseController {
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, ${ClassName} ${className}) { public void export(HttpServletResponse response, ${ClassName} ${className}) {
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}. class); ExcelUtil<${ClassName}> util = new ExcelUtil<>(${ClassName}. class);
util.exportExcel(response, list, "${functionName}数据"); util.exportExcel(response, list, "${functionName}数据");
} }

View File

@ -11,9 +11,13 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.xinelu.common.annotation.Excel; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.xinyilu.common.annotation.Excel;
#if($table.crud) #if($table.crud)
import com.xinyilu.common.core.domain.BaseEntity;
#elseif($table.tree) #elseif($table.tree)
import com.xinyilu.common.core.domain.TreeEntity;
#end #end
/** /**
@ -28,7 +32,7 @@ import com.xinelu.common.annotation.Excel;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "${functionName}对象", description = "${tableName}") @ApiModel(value = "${functionName}对象", description = "${tableName}")
#if($table.crud) #if($table.crud)
#set($Entity="BaseEntity") #set($Entity="BaseDomain")
#elseif($table.tree) #elseif($table.tree)
#set($Entity="TreeEntity") #set($Entity="TreeEntity")
#end #end

View File

@ -28,7 +28,7 @@ public interface ${ClassName}Mapper {
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return ${functionName}集合 * @return ${functionName}集合
*/ */
public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); List<${ClassName}> select${ClassName}List(${ClassName} ${className});
/** /**
* 新增${functionName} * 新增${functionName}
@ -36,7 +36,7 @@ public interface ${ClassName}Mapper {
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return 结果 * @return 结果
*/ */
public int insert${ClassName}(${ClassName} ${className}); int insert${ClassName}(${ClassName} ${className});
/** /**
* 修改${functionName} * 修改${functionName}
@ -44,7 +44,7 @@ public interface ${ClassName}Mapper {
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return 结果 * @return 结果
*/ */
public int update${ClassName}(${ClassName} ${className}); int update${ClassName}(${ClassName} ${className});
/** /**
* 删除${functionName} * 删除${functionName}
@ -52,7 +52,7 @@ public interface ${ClassName}Mapper {
* @param ${pkColumn.javaField} ${functionName}主键 * @param ${pkColumn.javaField} ${functionName}主键
* @return 结果 * @return 结果
*/ */
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
/** /**
* 批量删除${functionName} * 批量删除${functionName}
@ -60,7 +60,7 @@ public interface ${ClassName}Mapper {
* @param ${pkColumn.javaField}s 需要删除的数据主键集合 * @param ${pkColumn.javaField}s 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
#if($table.sub) #if($table.sub)
/** /**
@ -69,7 +69,7 @@ public interface ${ClassName}Mapper {
* @param ${pkColumn.javaField}s 需要删除的数据主键集合 * @param ${pkColumn.javaField}s 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
/** /**
* 批量新增${subTable.functionName} * 批量新增${subTable.functionName}
@ -77,7 +77,7 @@ public interface ${ClassName}Mapper {
* @param ${subclassName}List ${subTable.functionName}列表 * @param ${subclassName}List ${subTable.functionName}列表
* @return 结果 * @return 结果
*/ */
public int batch${subClassName}(List<${subClassName}> ${subclassName}List); int batch${subClassName}(List<${subClassName}> ${subclassName}List);
/** /**
@ -86,6 +86,6 @@ public interface ${ClassName}Mapper {
* @param ${pkColumn.javaField} ${functionName}ID * @param ${pkColumn.javaField} ${functionName}ID
* @return 结果 * @return 结果
*/ */
public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField}); int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField});
#end #end
} }

View File

@ -25,7 +25,7 @@ public interface I${ClassName}Service {
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return ${functionName}集合 * @return ${functionName}集合
*/ */
public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); List<${ClassName}> select${ClassName}List(${ClassName} ${className});
/** /**
* 新增${functionName} * 新增${functionName}
@ -33,7 +33,7 @@ public interface I${ClassName}Service {
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return 结果 * @return 结果
*/ */
public int insert${ClassName}(${ClassName} ${className}); int insert${ClassName}(${ClassName} ${className});
/** /**
* 修改${functionName} * 修改${functionName}
@ -41,7 +41,7 @@ public interface I${ClassName}Service {
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return 结果 * @return 结果
*/ */
public int update${ClassName}(${ClassName} ${className}); int update${ClassName}(${ClassName} ${className});
/** /**
* 批量删除${functionName} * 批量删除${functionName}
@ -49,7 +49,7 @@ public interface I${ClassName}Service {
* @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合 * @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合
* @return 结果 * @return 结果
*/ */
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
/** /**
* 删除${functionName}信息 * 删除${functionName}信息
@ -57,5 +57,5 @@ public interface I${ClassName}Service {
* @param ${pkColumn.javaField} ${functionName}主键 * @param ${pkColumn.javaField} ${functionName}主键
* @return 结果 * @return 结果
*/ */
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
} }

View File

@ -1,18 +1,19 @@
package ${packageName}.service.impl; package ${packageName}.service.impl;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
#foreach ($column in $columns) #foreach ($column in $columns)
#if($column.javaField == 'createTime' || $column.javaField == 'updateTime') #if($column.javaField == 'createTime' || $column.javaField == 'updateTime')
import com.xinelu.common.utils.DateUtils; import com.xinyilu.common.utils.DateUtils;
#break #break
#end #end
#end #end
import javax.annotation.Resource; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
#if($table.sub) #if($table.sub)
import java.util.ArrayList; import java.util.ArrayList;
import com.xinelu.common.utils.StringUtils; import com.xinyilu.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import ${packageName}.domain.${subClassName}; import ${packageName}.domain.${subClassName};
#end #end
@ -66,7 +67,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service {
public int insert${ClassName}(${ClassName} ${className}) { public int insert${ClassName}(${ClassName} ${className}) {
#foreach ($column in $columns) #foreach ($column in $columns)
#if($column.javaField == 'createTime') #if($column.javaField == 'createTime')
${className}.setCreateTime(DateUtils.getNowDate()); ${className}.setCreateTime(LocalDateTime.now());
#end #end
#end #end
#if($table.sub) #if($table.sub)
@ -91,7 +92,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service {
public int update${ClassName}(${ClassName} ${className}) { public int update${ClassName}(${ClassName} ${className}) {
#foreach ($column in $columns) #foreach ($column in $columns)
#if($column.javaField == 'updateTime') #if($column.javaField == 'updateTime')
${className}.setUpdateTime(DateUtils.getNowDate()); ${className}.setUpdateTime(LocalDateTime.now());
#end #end
#end #end
#if($table.sub) #if($table.sub)

View File

@ -3,7 +3,7 @@ package ${packageName}.domain;
#foreach ($import in $subImportList) #foreach ($import in $subImportList)
import ${import}; import ${import};
#end #end
import com.xinelu.common.annotation.Excel; import com.xinyilu.common.annotation.Excel;
/** /**
* ${subTable.functionName}对象 ${subTableName} * ${subTable.functionName}对象 ${subTableName}

View File

@ -5,6 +5,8 @@ import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity; import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@ -86,7 +88,7 @@ public class PatientInfo extends BaseEntity {
@ApiModelProperty(value = "签约时间格式yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "签约时间格式yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "签约时间格式yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "签约时间格式yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd")
private Date signTime; private LocalDateTime signTime;
/** 开证医生(预住院患者) */ /** 开证医生(预住院患者) */
@ApiModelProperty(value = "开证医生") @ApiModelProperty(value = "开证医生")

View File

@ -4,81 +4,85 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.core.domain.BaseEntity; import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/** /**
* 检测项目设备表 * 检测项目设备表
* @TableName project_device *
*/ * @TableName project_device
*/
@EqualsAndHashCode(callSuper = true)
@ApiModel("检测项目设备表") @ApiModel("检测项目设备表")
@Data @Data
public class ProjectDevice extends BaseEntity { public class ProjectDevice extends BaseEntity {
/** /**
* 主键id * 主键id
*/ */
@ApiModelProperty("主键id") @ApiModelProperty("主键id")
private Long id; private Long id;
/** /**
* 患者id * 患者id
*/ */
@ApiModelProperty("患者id") @ApiModelProperty("患者id")
private Long patientId; private Long patientId;
/** /**
* 患者姓名 * 患者姓名
*/ */
@ApiModelProperty("患者姓名") @ApiModelProperty("患者姓名")
private String patientName; private String patientName;
/** /**
* 身份证号 * 身份证号
*/ */
@ApiModelProperty("身份证号") @ApiModelProperty("身份证号")
private String cardNo; private String cardNo;
/** /**
* 设备类型血糖仪GLUCOSE_METER血压计BLOOD_PRESSURE_DEVICE * 设备类型血糖仪GLUCOSE_METER血压计BLOOD_PRESSURE_DEVICE
*/ */
@ApiModelProperty("设备类型血糖仪GLUCOSE_METER血压计BLOOD_PRESSURE_DEVICE") @ApiModelProperty("设备类型血糖仪GLUCOSE_METER血压计BLOOD_PRESSURE_DEVICE")
private String deviceType; private String deviceType;
/** /**
* 设备名称 * 设备名称
*/ */
@ApiModelProperty("设备名称") @ApiModelProperty("设备名称")
private String deviceName; private String deviceName;
/** /**
* 设备编码 * 设备编码
*/ */
@ApiModelProperty("设备编码") @ApiModelProperty("设备编码")
private String deviceCode; private String deviceCode;
/** /**
* 设备状态,绑定BIND,解绑UN_BIND * 设备状态,绑定BIND,解绑UN_BIND
*/ */
@ApiModelProperty("设备状态,绑定BIND,解绑UN_BIND") @ApiModelProperty("设备状态,绑定BIND,解绑UN_BIND")
private String deviceStatus; private String deviceStatus;
/** /**
* 备注信息 * 备注信息
*/ */
@ApiModelProperty("备注信息") @ApiModelProperty("备注信息")
private String deviceRemark; private String deviceRemark;
/** /**
* 设备绑定时间 * 设备绑定时间
*/ */
@ApiModelProperty("设备绑定时间") @ApiModelProperty("设备绑定时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date deviceBindTime; private LocalDateTime deviceBindTime;
/** /**
* 设备解绑时间 * 设备解绑时间
*/ */
@ApiModelProperty("设备解绑时间") @ApiModelProperty("设备解绑时间")
private Date deviceUnbindTime; private LocalDateTime deviceUnbindTime;
/** /**
* 设备IP地址 * 设备IP地址
*/ */
@ApiModelProperty("设备IP地址") @ApiModelProperty("设备IP地址")
private String deviceIp; private String deviceIp;
/** /**
* 设备端口 * 设备端口
*/ */
@ApiModelProperty("设备端口") @ApiModelProperty("设备端口")
private Integer devicePort; private Integer devicePort;

View File

@ -4,15 +4,18 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.core.domain.BaseEntity; import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/** /**
* 患者签约记录表 * 患者签约记录表
*
* @TableName sign_patient_record * @TableName sign_patient_record
*/ */
@Data @Data
@ -22,7 +25,7 @@ import lombok.NoArgsConstructor;
@ApiModel(value = "患者签约记录表", description = "sign_patient_record") @ApiModel(value = "患者签约记录表", description = "sign_patient_record")
public class SignPatientRecord extends BaseEntity { public class SignPatientRecord extends BaseEntity {
private static final long serialVersionUID=1L; private static final long serialVersionUID = 1L;
/** /**
* 主键id * 主键id
*/ */
@ -35,37 +38,43 @@ public class SignPatientRecord extends BaseEntity {
@ApiModelProperty(value = "患者信息表id") @ApiModelProperty(value = "患者信息表id")
private Long patientId; private Long patientId;
/** /**
* 患者姓名 * 患者姓名
*/ */
@ApiModelProperty(value = "患者姓名") @ApiModelProperty(value = "患者姓名")
private String patientName; private String patientName;
/** /**
* 患者电话 * 患者电话
*/ */
@ApiModelProperty(value = "患者电话") @ApiModelProperty(value = "患者电话")
private String patientPhone; private String patientPhone;
/** 身份证号 */ /**
@ApiModelProperty(value = "身份证号") * 身份证号
private String cardNo; */
@ApiModelProperty(value = "身份证号")
private String cardNo;
/** 性别 */ /**
@ApiModelProperty(value = "性别") * 性别
private String sex; */
@ApiModelProperty(value = "性别")
private String sex;
/** 出生日期格式yyyy-MM-dd */ /**
@ApiModelProperty(value = "出生日期格式yyyy-MM-dd") * 出生日期格式yyyy-MM-dd
@JsonFormat(pattern = "yyyy-MM-dd") */
private Date birthDate; @ApiModelProperty(value = "出生日期格式yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date birthDate;
/** /**
* 签约时间格式yyyy-MM-dd HH:mm:ss * 签约时间格式yyyy-MM-dd HH:mm:ss
*/ */
@ApiModelProperty(value = "签约时间格式yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "签约时间格式yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date signTime; private LocalDateTime signTime;
/** /**
* 签约时所属医院id * 签约时所属医院id
@ -127,8 +136,8 @@ public class SignPatientRecord extends BaseEntity {
@ApiModelProperty(value = "就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL") @ApiModelProperty(value = "就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL")
private String visitMethod; private String visitMethod;
@ApiModelProperty(value = "住院/门诊号") @ApiModelProperty(value = "住院/门诊号")
private String inHospitalNumber; private String inHospitalNumber;
/** /**
* 签约时诊断 * 签约时诊断
@ -178,11 +187,11 @@ public class SignPatientRecord extends BaseEntity {
@ApiModelProperty(value = "开单医生姓名(意向签约)") @ApiModelProperty(value = "开单医生姓名(意向签约)")
private String billingDoctorName; private String billingDoctorName;
/** /**
* 提交时间待续签 * 提交时间待续签
*/ */
@ApiModelProperty(value = "提交时间(待续签)") @ApiModelProperty(value = "提交时间(待续签)")
private Date submissionTime; private Date submissionTime;
/** /**
* 金额 * 金额
*/ */
@ -195,25 +204,25 @@ public class SignPatientRecord extends BaseEntity {
@ApiModelProperty(value = "缴费状态已缴费PAID未交费UNPAID_FEES") @ApiModelProperty(value = "缴费状态已缴费PAID未交费UNPAID_FEES")
private String paymentStatus; private String paymentStatus;
/** /**
* 解约原因 * 解约原因
*/ */
@ApiModelProperty(value = "解约原因") @ApiModelProperty(value = "解约原因")
private String separateReason; private String separateReason;
/** /**
* 健康管理师id * 健康管理师id
*/ */
@ApiModelProperty(value = "健康管理师id") @ApiModelProperty(value = "健康管理师id")
private Long healthManageId; private Long healthManageId;
/** /**
* 健康管理师姓名 * 健康管理师姓名
*/ */
@ApiModelProperty(value = "健康管理师姓名") @ApiModelProperty(value = "健康管理师姓名")
private String healthManageName; private String healthManageName;
/** /**
* 删除标识0未删除1已删除 * 删除标识0未删除1已删除
*/ */
@ApiModelProperty(value = "删除标识0未删除1已删除") @ApiModelProperty(value = "删除标识0未删除1已删除")

View File

@ -0,0 +1,128 @@
package com.xinelu.manage.domain.subscribemessagerecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 微信小程序订阅消息记录对象 subscribe_message_record
*
* @author xinelu
* @date 2024-03-18
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "微信小程序订阅消息记录对象", description = "subscribe_message_record")
public class SubscribeMessageRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private Long id;
/**
* 会员id
*/
@ApiModelProperty(value = "会员id")
@Excel(name = "会员id")
private Long patientId;
/**
* 签约患者管理任务节点表id
*/
@ApiModelProperty(value = "签约患者管理任务节点表id")
@Excel(name = "签约患者管理任务节点表id")
private Long manageRouteNodeId;
/**
* 微信unionid标识
*/
@ApiModelProperty(value = "微信unionid标识")
@Excel(name = "微信unionid标识")
private String unionid;
/**
* 微信小程序的openid
*/
@ApiModelProperty(value = "微信小程序的openid")
@Excel(name = "微信小程序的openid")
private String openid;
/**
* 微信小程序账户id
*/
@ApiModelProperty(value = "微信小程序账户id")
@Excel(name = "微信小程序账户id")
private String appletId;
/**
* 消息模板id
*/
@ApiModelProperty(value = "消息模板id")
@Excel(name = "消息模板id")
private String templateId;
/**
* 订阅任务消息类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE宣教文章PROPAGANDA_ARTICLE文字提醒TEXT_REMIND人工随访ARTIFICIAL_FOLLOW_UP
*/
@ApiModelProperty(value = "订阅任务消息类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE宣教文章PROPAGANDA_ARTICLE文字提醒TEXT_REMIND人工随访ARTIFICIAL_FOLLOW_UP")
@Excel(name = "订阅任务消息类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE宣教文章PROPAGANDA_ARTICLE文字提醒TEXT_REMIND人工随访ARTIFICIAL_FOLLOW_UP")
private String messageType;
/**
* 用于订阅消息次数
*/
@ApiModelProperty(value = "用于订阅消息次数")
@Excel(name = "用于订阅消息次数")
private Long subscribeCount;
/**
* 订阅时间
*/
@ApiModelProperty(value = "订阅时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "订阅时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date subscribeTime;
/**
* 订阅状态accept接受reject拒绝
*/
@ApiModelProperty(value = "订阅状态accept接受reject拒绝")
@Excel(name = "订阅状态accept接受reject拒绝")
private String subscribeStatus;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("patientId", getPatientId())
.append("manageRouteNodeId", getManageRouteNodeId())
.append("unionid", getUnionid())
.append("openid", getOpenid())
.append("appletId", getAppletId())
.append("templateId", getTemplateId())
.append("messageType", getMessageType())
.append("subscribeCount", getSubscribeCount())
.append("subscribeTime", getSubscribeTime())
.append("subscribeStatus", getSubscribeStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -2,7 +2,6 @@ package com.xinelu.manage.service.agency.impl;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.regex.RegexUtil; import com.xinelu.common.utils.regex.RegexUtil;
@ -20,7 +19,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -111,7 +114,7 @@ public class AgencyServiceImpl implements IAgencyService {
if (i > 0) { if (i > 0) {
return AjaxResult.error("该名称" + agency.getAgencyName() + "以重复!"); return AjaxResult.error("该名称" + agency.getAgencyName() + "以重复!");
} }
agency.setCreateTime(DateUtils.getNowDate()); agency.setCreateTime(LocalDateTime.now());
agency.setCreateBy(SecurityUtils.getUsername()); agency.setCreateBy(SecurityUtils.getUsername());
return AjaxResult.success(agencyMapper.insertAgency(agency)); return AjaxResult.success(agencyMapper.insertAgency(agency));
} }
@ -134,7 +137,7 @@ public class AgencyServiceImpl implements IAgencyService {
throw new ServiceException("该名称" + agency.getAgencyName() + "以重复!"); throw new ServiceException("该名称" + agency.getAgencyName() + "以重复!");
} }
} }
agency.setUpdateTime(DateUtils.getNowDate()); agency.setUpdateTime(LocalDateTime.now());
agency.setUpdateBy(SecurityUtils.getUsername()); agency.setUpdateBy(SecurityUtils.getUsername());
return AjaxResult.success(agencyMapper.updateAgencyById(agency)); return AjaxResult.success(agencyMapper.updateAgencyById(agency));
} }
@ -211,7 +214,7 @@ public class AgencyServiceImpl implements IAgencyService {
List<Agency> saveAgencyList = new ArrayList<>(); List<Agency> saveAgencyList = new ArrayList<>();
for (Agency item : subtractList) { for (Agency item : subtractList) {
item.setCreateBy(SecurityUtils.getUsername()); item.setCreateBy(SecurityUtils.getUsername());
item.setCreateTime(new Date()); item.setCreateTime(LocalDateTime.now());
Agency newAgency = new Agency(); Agency newAgency = new Agency();
BeanUtils.copyProperties(item, newAgency); BeanUtils.copyProperties(item, newAgency);
saveAgencyList.add(newAgency); saveAgencyList.add(newAgency);

View File

@ -12,6 +12,7 @@ import com.xinelu.manage.vo.agencycategory.AgencyCategoryVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -63,7 +64,7 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
if (Objects.isNull(agencyCategory.getCategoryLevel()) || agencyCategory.getCategoryLevel().equals(1)) { if (Objects.isNull(agencyCategory.getCategoryLevel()) || agencyCategory.getCategoryLevel().equals(1)) {
agencyCategory.setParentCategoryId(null); agencyCategory.setParentCategoryId(null);
} }
agencyCategory.setCreateTime(DateUtils.getNowDate()); agencyCategory.setCreateTime(LocalDateTime.now());
agencyCategory.setCreateBy(SecurityUtils.getUsername()); agencyCategory.setCreateBy(SecurityUtils.getUsername());
return agencyCategoryMapper.insertAgencyCategory(agencyCategory); return agencyCategoryMapper.insertAgencyCategory(agencyCategory);
} }
@ -76,7 +77,7 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
*/ */
@Override @Override
public int updateAgencyCategory(AgencyCategory agencyCategory) { public int updateAgencyCategory(AgencyCategory agencyCategory) {
agencyCategory.setUpdateTime(DateUtils.getNowDate()); agencyCategory.setUpdateTime(LocalDateTime.now());
agencyCategory.setUpdateBy(SecurityUtils.getUsername()); agencyCategory.setUpdateBy(SecurityUtils.getUsername());
return agencyCategoryMapper.updateAgencyCategory(agencyCategory); return agencyCategoryMapper.updateAgencyCategory(agencyCategory);
} }

View File

@ -1,14 +1,15 @@
package com.xinelu.manage.service.crowdinfo.impl; package com.xinelu.manage.service.crowdinfo.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.manage.domain.crowdinfo.CrowdInfo; import com.xinelu.manage.domain.crowdinfo.CrowdInfo;
import com.xinelu.manage.mapper.crowdinfo.CrowdInfoMapper; import com.xinelu.manage.mapper.crowdinfo.CrowdInfoMapper;
import com.xinelu.manage.service.crowdinfo.ICrowdInfoService; import com.xinelu.manage.service.crowdinfo.ICrowdInfoService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 人群信息Service业务层处理 * 人群信息Service业务层处理
* *
@ -50,8 +51,8 @@ public class CrowdInfoServiceImpl implements ICrowdInfoService {
*/ */
@Override @Override
public int insertCrowdInfo(CrowdInfo crowdInfo) { public int insertCrowdInfo(CrowdInfo crowdInfo) {
crowdInfo.setCreateTime(DateUtils.getNowDate()); crowdInfo.setCreateTime(LocalDateTime.now());
crowdInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); crowdInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
return crowdInfoMapper.insertCrowdInfo(crowdInfo); return crowdInfoMapper.insertCrowdInfo(crowdInfo);
} }
@ -63,8 +64,8 @@ public class CrowdInfoServiceImpl implements ICrowdInfoService {
*/ */
@Override @Override
public int updateCrowdInfo(CrowdInfo crowdInfo) { public int updateCrowdInfo(CrowdInfo crowdInfo) {
crowdInfo.setUpdateTime(DateUtils.getNowDate()); crowdInfo.setUpdateTime(LocalDateTime.now());
crowdInfo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); crowdInfo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
return crowdInfoMapper.updateCrowdInfo(crowdInfo); return crowdInfoMapper.updateCrowdInfo(crowdInfo);
} }

View File

@ -3,7 +3,6 @@ package com.xinelu.manage.service.department.impl;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.entity.SysUser; import com.xinelu.common.core.domain.entity.SysUser;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
@ -21,8 +20,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -107,7 +106,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
if (Objects.isNull(department.getParentDepartmentId())) { if (Objects.isNull(department.getParentDepartmentId())) {
department.setParentDepartmentId(0L); department.setParentDepartmentId(0L);
} }
department.setCreateTime(DateUtils.getNowDate()); department.setCreateTime(LocalDateTime.now());
department.setCreateBy(SecurityUtils.getUsername()); department.setCreateBy(SecurityUtils.getUsername());
return departmentMapper.insertDepartment(department); return departmentMapper.insertDepartment(department);
} }
@ -121,7 +120,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
@Override @Override
public int updateDepartment(Department department) { public int updateDepartment(Department department) {
department.setUpdateBy(SecurityUtils.getUsername()); department.setUpdateBy(SecurityUtils.getUsername());
department.setUpdateTime(DateUtils.getNowDate()); department.setUpdateTime(LocalDateTime.now());
return departmentMapper.updateDepartmentById(department); return departmentMapper.updateDepartmentById(department);
} }
@ -230,7 +229,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
item.setParentDepartmentId(0L); item.setParentDepartmentId(0L);
} }
item.setCreateBy(SecurityUtils.getUsername()); item.setCreateBy(SecurityUtils.getUsername());
item.setCreateTime(new Date()); item.setCreateTime(LocalDateTime.now());
Department newDepartment = new Department(); Department newDepartment = new Department();
BeanUtils.copyProperties(item, newDepartment); BeanUtils.copyProperties(item, newDepartment);
saveDepartmentList.add(newDepartment); saveDepartmentList.add(newDepartment);

View File

@ -1,7 +1,6 @@
package com.xinelu.manage.service.departmentdiseasetype.impl; package com.xinelu.manage.service.departmentdiseasetype.impl;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.departmentdiseasetype.DepartmentDiseaseType; import com.xinelu.manage.domain.departmentdiseasetype.DepartmentDiseaseType;
import com.xinelu.manage.mapper.departmentdiseasetype.DepartmentDiseaseTypeMapper; import com.xinelu.manage.mapper.departmentdiseasetype.DepartmentDiseaseTypeMapper;
import com.xinelu.manage.service.departmentdiseasetype.IDepartmentDiseaseTypeService; import com.xinelu.manage.service.departmentdiseasetype.IDepartmentDiseaseTypeService;
@ -10,9 +9,9 @@ import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
@ -56,7 +55,7 @@ public class DepartmentDiseaseTypeServiceImpl implements IDepartmentDiseaseTypeS
*/ */
@Override @Override
public int insertDepartmentDiseaseType(DepartmentDiseaseType departmentDiseaseType) { public int insertDepartmentDiseaseType(DepartmentDiseaseType departmentDiseaseType) {
departmentDiseaseType.setCreateTime(DateUtils.getNowDate()); departmentDiseaseType.setCreateTime(LocalDateTime.now());
return departmentDiseaseTypeMapper.insertDepartmentDiseaseType(departmentDiseaseType); return departmentDiseaseTypeMapper.insertDepartmentDiseaseType(departmentDiseaseType);
} }
@ -68,7 +67,7 @@ public class DepartmentDiseaseTypeServiceImpl implements IDepartmentDiseaseTypeS
*/ */
@Override @Override
public int updateDepartmentDiseaseType(DepartmentDiseaseType departmentDiseaseType) { public int updateDepartmentDiseaseType(DepartmentDiseaseType departmentDiseaseType) {
departmentDiseaseType.setUpdateTime(DateUtils.getNowDate()); departmentDiseaseType.setUpdateTime(LocalDateTime.now());
return departmentDiseaseTypeMapper.updateDepartmentDiseaseType(departmentDiseaseType); return departmentDiseaseTypeMapper.updateDepartmentDiseaseType(departmentDiseaseType);
} }

View File

@ -2,7 +2,6 @@ package com.xinelu.manage.service.labelfieldcontent.impl;
import com.xinelu.common.constant.LabelFieldInfoFieldTypeConstants; import com.xinelu.common.constant.LabelFieldInfoFieldTypeConstants;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
@ -15,6 +14,7 @@ import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
@ -61,7 +61,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
*/ */
@Override @Override
public int insertLabelFieldContent(LabelFieldContent labelFieldContent) { public int insertLabelFieldContent(LabelFieldContent labelFieldContent) {
labelFieldContent.setCreateTime(DateUtils.getNowDate()); labelFieldContent.setCreateTime(LocalDateTime.now());
return labelFieldContentMapper.insertLabelFieldContent(labelFieldContent); return labelFieldContentMapper.insertLabelFieldContent(labelFieldContent);
} }
@ -82,7 +82,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
throw new ServiceException("当前标签字段类型下字段内容名称已存在"); throw new ServiceException("当前标签字段类型下字段内容名称已存在");
} }
labelFieldContent.setUpdateBy(SecurityUtils.getUsername()); labelFieldContent.setUpdateBy(SecurityUtils.getUsername());
labelFieldContent.setUpdateTime(DateUtils.getNowDate()); labelFieldContent.setUpdateTime(LocalDateTime.now());
return labelFieldContentMapper.updateLabelFieldContent(labelFieldContent); return labelFieldContentMapper.updateLabelFieldContent(labelFieldContent);
} }
@ -133,7 +133,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
labelFieldContent.setFieldName(labelFieldContentAddDTO.getFieldName()); labelFieldContent.setFieldName(labelFieldContentAddDTO.getFieldName());
labelFieldContent.setContentCode(LabelFieldInfoFieldTypeConstants.CONTENT_ENCODING + systemCodeUtil.generateDepartCode(LabelFieldInfoFieldTypeConstants.CONTENT_ENCODING)); labelFieldContent.setContentCode(LabelFieldInfoFieldTypeConstants.CONTENT_ENCODING + systemCodeUtil.generateDepartCode(LabelFieldInfoFieldTypeConstants.CONTENT_ENCODING));
labelFieldContent.setCreateBy(SecurityUtils.getUsername()); labelFieldContent.setCreateBy(SecurityUtils.getUsername());
labelFieldContent.setCreateTime(DateUtils.getNowDate()); labelFieldContent.setCreateTime(LocalDateTime.now());
if (labelFieldContentMapper.insertLabelFieldContent(labelFieldContent) <= 0) { if (labelFieldContentMapper.insertLabelFieldContent(labelFieldContent) <= 0) {
throw new ServiceException("新增标签字段内容信息失败"); throw new ServiceException("新增标签字段内容信息失败");
} }

View File

@ -2,7 +2,6 @@ package com.xinelu.manage.service.labelfieldinfo.impl;
import com.xinelu.common.constant.LabelFieldInfoFieldTypeConstants; import com.xinelu.common.constant.LabelFieldInfoFieldTypeConstants;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo; import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo;
@ -15,6 +14,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -63,7 +63,7 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
*/ */
@Override @Override
public int insertLabelFieldInfo(LabelFieldInfo labelFieldInfo) { public int insertLabelFieldInfo(LabelFieldInfo labelFieldInfo) {
labelFieldInfo.setCreateTime(DateUtils.getNowDate()); labelFieldInfo.setCreateTime(LocalDateTime.now());
return labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo); return labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo);
} }
@ -87,7 +87,7 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
} }
// 执行修改操作 // 执行修改操作
labelFieldInfo.setUpdateBy(SecurityUtils.getUsername()); labelFieldInfo.setUpdateBy(SecurityUtils.getUsername());
labelFieldInfo.setUpdateTime(DateUtils.getNowDate()); labelFieldInfo.setUpdateTime(LocalDateTime.now());
return labelFieldInfoMapper.updateLabelFieldInfo(labelFieldInfo); return labelFieldInfoMapper.updateLabelFieldInfo(labelFieldInfo);
} }
@ -147,7 +147,7 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
for (LabelFieldInfo labelFieldInfo : fieldInfoList) { for (LabelFieldInfo labelFieldInfo : fieldInfoList) {
labelFieldInfo.setFieldCode(LabelFieldInfoFieldTypeConstants.FIELD_ENCODING + systemCodeUtil.generateDepartCode(LabelFieldInfoFieldTypeConstants.FIELD_ENCODING)); labelFieldInfo.setFieldCode(LabelFieldInfoFieldTypeConstants.FIELD_ENCODING + systemCodeUtil.generateDepartCode(LabelFieldInfoFieldTypeConstants.FIELD_ENCODING));
labelFieldInfo.setCreateBy(SecurityUtils.getUsername()); labelFieldInfo.setCreateBy(SecurityUtils.getUsername());
labelFieldInfo.setCreateTime(DateUtils.getNowDate()); labelFieldInfo.setCreateTime(LocalDateTime.now());
if (labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo) <= 0) { if (labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo) <= 0) {
throw new ServiceException("新增标签字段信息失败"); throw new ServiceException("新增标签字段信息失败");
} }

View File

@ -1,14 +1,15 @@
package com.xinelu.manage.service.materialsinfo.impl; package com.xinelu.manage.service.materialsinfo.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.materialsinfo.MaterialsInfo; import com.xinelu.manage.domain.materialsinfo.MaterialsInfo;
import com.xinelu.manage.dto.materialsinfo.MaterialsInfoDto; import com.xinelu.manage.dto.materialsinfo.MaterialsInfoDto;
import com.xinelu.manage.mapper.materialsinfo.MaterialsInfoMapper; import com.xinelu.manage.mapper.materialsinfo.MaterialsInfoMapper;
import com.xinelu.manage.service.materialsinfo.IMaterialsInfoService; import com.xinelu.manage.service.materialsinfo.IMaterialsInfoService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 素材信息Service业务层处理 * 素材信息Service业务层处理
* *
@ -50,8 +51,8 @@ public class MaterialsInfoServiceImpl implements IMaterialsInfoService {
*/ */
@Override @Override
public int insertMaterialsInfo(MaterialsInfo materialsInfo) { public int insertMaterialsInfo(MaterialsInfo materialsInfo) {
materialsInfo.setCreateTime(DateUtils.getNowDate()); materialsInfo.setCreateTime(LocalDateTime.now());
return materialsInfoMapper.insertMaterialsInfo(materialsInfo); return materialsInfoMapper.insertMaterialsInfo(materialsInfo);
} }
/** /**
@ -62,7 +63,7 @@ public class MaterialsInfoServiceImpl implements IMaterialsInfoService {
*/ */
@Override @Override
public int updateMaterialsInfo(MaterialsInfo materialsInfo) { public int updateMaterialsInfo(MaterialsInfo materialsInfo) {
materialsInfo.setUpdateTime(DateUtils.getNowDate()); materialsInfo.setUpdateTime(LocalDateTime.now());
return materialsInfoMapper.updateMaterialsInfo(materialsInfo); return materialsInfoMapper.updateMaterialsInfo(materialsInfo);
} }

View File

@ -1,12 +1,12 @@
package com.xinelu.manage.service.normdepartmentcompare.impl; package com.xinelu.manage.service.normdepartmentcompare.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.normdepartmentcompare.NormDepartmentCompare; import com.xinelu.manage.domain.normdepartmentcompare.NormDepartmentCompare;
import com.xinelu.manage.mapper.normdepartmentcompare.NormDepartmentCompareMapper; import com.xinelu.manage.mapper.normdepartmentcompare.NormDepartmentCompareMapper;
import com.xinelu.manage.service.normdepartmentcompare.INormDepartmentCompareService; import com.xinelu.manage.service.normdepartmentcompare.INormDepartmentCompareService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -51,7 +51,7 @@ public class NormDepartmentCompareServiceImpl implements INormDepartmentCompareS
*/ */
@Override @Override
public int insertNormDepartmentCompare(NormDepartmentCompare normDepartmentCompare) { public int insertNormDepartmentCompare(NormDepartmentCompare normDepartmentCompare) {
normDepartmentCompare.setCreateTime(DateUtils.getNowDate()); normDepartmentCompare.setCreateTime(LocalDateTime.now());
return normDepartmentCompareMapper.insertNormDepartmentCompare(normDepartmentCompare); return normDepartmentCompareMapper.insertNormDepartmentCompare(normDepartmentCompare);
} }
@ -63,7 +63,7 @@ public class NormDepartmentCompareServiceImpl implements INormDepartmentCompareS
*/ */
@Override @Override
public int updateNormDepartmentCompare(NormDepartmentCompare normDepartmentCompare) { public int updateNormDepartmentCompare(NormDepartmentCompare normDepartmentCompare) {
normDepartmentCompare.setUpdateTime(DateUtils.getNowDate()); normDepartmentCompare.setUpdateTime(LocalDateTime.now());
return normDepartmentCompareMapper.updateNormDepartmentCompare(normDepartmentCompare); return normDepartmentCompareMapper.updateNormDepartmentCompare(normDepartmentCompare);
} }

View File

@ -2,7 +2,6 @@ package com.xinelu.manage.service.operationInfo.impl;
import com.xinelu.common.constant.Constants; import com.xinelu.common.constant.Constants;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
import com.xinelu.manage.domain.operationInfo.OperationInfo; import com.xinelu.manage.domain.operationInfo.OperationInfo;
@ -12,6 +11,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
@ -67,7 +67,7 @@ public class OperationInfoServiceImpl implements IOperationInfoService {
// 设置创建人创建时间 // 设置创建人创建时间
operationInfo.setOperationCode(Constants.SURGERY_ENCODING + systemCodeUtil.generateDepartCode(Constants.SURGERY_ENCODING)); operationInfo.setOperationCode(Constants.SURGERY_ENCODING + systemCodeUtil.generateDepartCode(Constants.SURGERY_ENCODING));
operationInfo.setCreateBy(SecurityUtils.getUsername()); operationInfo.setCreateBy(SecurityUtils.getUsername());
operationInfo.setCreateTime(DateUtils.getNowDate()); operationInfo.setCreateTime(LocalDateTime.now());
return operationInfoMapper.insertOperationInfo(operationInfo); return operationInfoMapper.insertOperationInfo(operationInfo);
} }
@ -86,7 +86,7 @@ public class OperationInfoServiceImpl implements IOperationInfoService {
} }
// 设置修改人修改时间 // 设置修改人修改时间
operationInfo.setUpdateBy(SecurityUtils.getUsername()); operationInfo.setUpdateBy(SecurityUtils.getUsername());
operationInfo.setUpdateTime(DateUtils.getNowDate()); operationInfo.setUpdateTime(LocalDateTime.now());
return operationInfoMapper.updateOperationInfo(operationInfo); return operationInfoMapper.updateOperationInfo(operationInfo);
} }

View File

@ -12,12 +12,14 @@ import com.xinelu.manage.mapper.patientblacklist.PatientBlacklistMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.service.patientblacklist.IPatientBlacklistService; import com.xinelu.manage.service.patientblacklist.IPatientBlacklistService;
import com.xinelu.manage.vo.patientblacklist.PatientBlacklistVo; import com.xinelu.manage.vo.patientblacklist.PatientBlacklistVo;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
/** /**
* 患者-黑明单关系Service业务层处理 * 患者-黑明单关系Service业务层处理
* *
@ -29,8 +31,8 @@ public class PatientBlacklistServiceImpl implements IPatientBlacklistService {
@Resource @Resource
private PatientBlacklistMapper patientBlacklistMapper; private PatientBlacklistMapper patientBlacklistMapper;
@Resource @Resource
private PatientInfoMapper patientInfoMapper; private PatientInfoMapper patientInfoMapper;
/** /**
* 查询患者-黑明单关系 * 查询患者-黑明单关系
@ -62,23 +64,23 @@ public class PatientBlacklistServiceImpl implements IPatientBlacklistService {
*/ */
@Override @Override
public int insertPatientBlacklist(PatientBlacklistSaveDto blacklistSaveDto) { public int insertPatientBlacklist(PatientBlacklistSaveDto blacklistSaveDto) {
// 根据患者姓名身份证号查询患者 // 根据患者姓名身份证号查询患者
PatientInfoDto patientInfoDto = new PatientInfoDto(); PatientInfoDto patientInfoDto = new PatientInfoDto();
patientInfoDto.setPatientName(blacklistSaveDto.getPatientName()); patientInfoDto.setPatientName(blacklistSaveDto.getPatientName());
patientInfoDto.setPatientPhone(blacklistSaveDto.getPatientPhone()); patientInfoDto.setPatientPhone(blacklistSaveDto.getPatientPhone());
patientInfoDto.setCardNo(blacklistSaveDto.getCardNo()); patientInfoDto.setCardNo(blacklistSaveDto.getCardNo());
List<PatientInfo> patientList = patientInfoMapper.selectPatientInfoList(patientInfoDto); List<PatientInfo> patientList = patientInfoMapper.selectPatientInfoList(patientInfoDto);
if (CollectionUtils.isEmpty(patientList)) { if (CollectionUtils.isEmpty(patientList)) {
throw new ServiceException("未找到该患者,请确认姓名身份证号手机号是否正确"); throw new ServiceException("未找到该患者,请确认姓名身份证号手机号是否正确");
} }
if (patientList.size() > 1) { if (patientList.size() > 1) {
throw new ServiceException("找到多名患者信息,请确认姓名身份证号手机号是否正确"); throw new ServiceException("找到多名患者信息,请确认姓名身份证号手机号是否正确");
} }
PatientBlacklist patientBlacklist = new PatientBlacklist(); PatientBlacklist patientBlacklist = new PatientBlacklist();
BeanUtils.copyBeanProp(patientBlacklist, blacklistSaveDto); BeanUtils.copyBeanProp(patientBlacklist, blacklistSaveDto);
patientBlacklist.setPatientId(patientList.get(0).getId()); patientBlacklist.setPatientId(patientList.get(0).getId());
patientBlacklist.setDelFlag(0); patientBlacklist.setDelFlag(0);
patientBlacklist.setCreateTime(DateUtils.getNowDate()); patientBlacklist.setCreateTime(LocalDateTime.now());
return patientBlacklistMapper.insertPatientBlacklist(patientBlacklist); return patientBlacklistMapper.insertPatientBlacklist(patientBlacklist);
} }
@ -90,7 +92,7 @@ public class PatientBlacklistServiceImpl implements IPatientBlacklistService {
*/ */
@Override @Override
public int updatePatientBlacklist(PatientBlacklist patientBlacklist) { public int updatePatientBlacklist(PatientBlacklist patientBlacklist) {
patientBlacklist.setUpdateTime(DateUtils.getNowDate()); patientBlacklist.setUpdateTime(LocalDateTime.now());
return patientBlacklistMapper.updatePatientBlacklist(patientBlacklist); return patientBlacklistMapper.updatePatientBlacklist(patientBlacklist);
} }
@ -113,10 +115,10 @@ public class PatientBlacklistServiceImpl implements IPatientBlacklistService {
*/ */
@Override @Override
public int deletePatientBlacklistById(Long id) { public int deletePatientBlacklistById(Long id) {
PatientBlacklist patientBlacklist = new PatientBlacklist(); PatientBlacklist patientBlacklist = new PatientBlacklist();
patientBlacklist.setId(id); patientBlacklist.setId(id);
patientBlacklist.setDelFlag(1); patientBlacklist.setDelFlag(1);
patientBlacklist.setUpdateTime(new Date()); patientBlacklist.setUpdateTime(LocalDateTime.now());
return patientBlacklistMapper.updatePatientBlacklist(patientBlacklist); return patientBlacklistMapper.updatePatientBlacklist(patientBlacklist);
} }
} }

View File

@ -1,13 +1,14 @@
package com.xinelu.manage.service.patientblacklistabnormalcause.impl; package com.xinelu.manage.service.patientblacklistabnormalcause.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.patientblacklistabnormalcause.PatientBlacklistAbnormalCause; import com.xinelu.manage.domain.patientblacklistabnormalcause.PatientBlacklistAbnormalCause;
import com.xinelu.manage.mapper.patientblacklistabnormalcause.PatientBlacklistAbnormalCauseMapper; import com.xinelu.manage.mapper.patientblacklistabnormalcause.PatientBlacklistAbnormalCauseMapper;
import com.xinelu.manage.service.patientblacklistabnormalcause.IPatientBlacklistAbnormalCauseService; import com.xinelu.manage.service.patientblacklistabnormalcause.IPatientBlacklistAbnormalCauseService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 患者黑名单异常原因Service业务层处理 * 患者黑名单异常原因Service业务层处理
* *
@ -49,8 +50,8 @@ public class PatientBlacklistAbnormalCauseServiceImpl implements IPatientBlackli
*/ */
@Override @Override
public int insertPatientBlacklistAbnormalCause(PatientBlacklistAbnormalCause patientBlacklistAbnormalCause) { public int insertPatientBlacklistAbnormalCause(PatientBlacklistAbnormalCause patientBlacklistAbnormalCause) {
patientBlacklistAbnormalCause.setCreateTime(DateUtils.getNowDate()); patientBlacklistAbnormalCause.setCreateTime(LocalDateTime.now());
return patientBlacklistAbnormalCauseMapper.insertPatientBlacklistAbnormalCause(patientBlacklistAbnormalCause); return patientBlacklistAbnormalCauseMapper.insertPatientBlacklistAbnormalCause(patientBlacklistAbnormalCause);
} }
/** /**
@ -61,7 +62,7 @@ public class PatientBlacklistAbnormalCauseServiceImpl implements IPatientBlackli
*/ */
@Override @Override
public int updatePatientBlacklistAbnormalCause(PatientBlacklistAbnormalCause patientBlacklistAbnormalCause) { public int updatePatientBlacklistAbnormalCause(PatientBlacklistAbnormalCause patientBlacklistAbnormalCause) {
patientBlacklistAbnormalCause.setUpdateTime(DateUtils.getNowDate()); patientBlacklistAbnormalCause.setUpdateTime(LocalDateTime.now());
return patientBlacklistAbnormalCauseMapper.updatePatientBlacklistAbnormalCause(patientBlacklistAbnormalCause); return patientBlacklistAbnormalCauseMapper.updatePatientBlacklistAbnormalCause(patientBlacklistAbnormalCause);
} }

View File

@ -1,14 +1,15 @@
package com.xinelu.manage.service.patientinfo.impl; package com.xinelu.manage.service.patientinfo.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.patientinfo.PatientInfo; import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.service.patientinfo.IPatientInfoService; import com.xinelu.manage.service.patientinfo.IPatientInfoService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 患者信息Service业务层处理 * 患者信息Service业务层处理
* *
@ -51,8 +52,8 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
*/ */
@Override @Override
public int insertPatientInfo(PatientInfo patientInfo) { public int insertPatientInfo(PatientInfo patientInfo) {
patientInfo.setCreateTime(DateUtils.getNowDate()); patientInfo.setCreateTime(LocalDateTime.now());
patientInfo.setDelFlag(0); patientInfo.setDelFlag(0);
return patientInfoMapper.insertPatientInfo(patientInfo); return patientInfoMapper.insertPatientInfo(patientInfo);
} }
@ -64,7 +65,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
*/ */
@Override @Override
public int updatePatientInfo(PatientInfo patientInfo) { public int updatePatientInfo(PatientInfo patientInfo) {
patientInfo.setUpdateTime(DateUtils.getNowDate()); patientInfo.setUpdateTime(LocalDateTime.now());
return patientInfoMapper.updatePatientInfo(patientInfo); return patientInfoMapper.updatePatientInfo(patientInfo);
} }

View File

@ -4,7 +4,6 @@ import com.xinelu.common.constant.NodeTypeConstants;
import com.xinelu.common.constant.PatientTypeConstants; import com.xinelu.common.constant.PatientTypeConstants;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
@ -19,203 +18,211 @@ import com.xinelu.manage.mapper.department.DepartmentMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.mapper.patientprehospitalization.PatientPreHospitalizationMapper; import com.xinelu.manage.mapper.patientprehospitalization.PatientPreHospitalizationMapper;
import com.xinelu.manage.service.patientprehospitalization.IPatientPreHospitalizationService; import com.xinelu.manage.service.patientprehospitalization.IPatientPreHospitalizationService;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author haown * @author haown
* @description 针对表patient_pre_hospitalization(预住院患者表)的数据库操作Service实现 * @description 针对表patient_pre_hospitalization(预住院患者表)的数据库操作Service实现
* @createDate 2024-03-08 10:25:39 * @createDate 2024-03-08 10:25:39
*/ */
@Service @Service
public class PatientPreHospitalizationServiceImpl implements IPatientPreHospitalizationService { public class PatientPreHospitalizationServiceImpl implements IPatientPreHospitalizationService {
@Resource @Resource
private PatientPreHospitalizationMapper preHospitalizationMapper; private PatientPreHospitalizationMapper preHospitalizationMapper;
@Resource @Resource
private PatientInfoMapper patientInfoMapper; private PatientInfoMapper patientInfoMapper;
@Resource @Resource
private AgencyMapper agencyMapper; private AgencyMapper agencyMapper;
@Resource @Resource
private DepartmentMapper departmentMapper; private DepartmentMapper departmentMapper;
@Resource @Resource
private RegexUtil regexUtil; private RegexUtil regexUtil;
@Override public int insert(PatientPreHospitalization preHospitalization) { @Override
// 根据身份证号查询是否有患者信息 public int insert(PatientPreHospitalization preHospitalization) {
PatientInfoDto patientInfoDto = new PatientInfoDto(); // 根据身份证号查询是否有患者信息
patientInfoDto.setCardNo(preHospitalization.getCardNo()); PatientInfoDto patientInfoDto = new PatientInfoDto();
List<PatientInfo> patientList = patientInfoMapper.selectPatientInfoList(patientInfoDto); patientInfoDto.setCardNo(preHospitalization.getCardNo());
if (CollectionUtils.isEmpty(patientList)) { List<PatientInfo> patientList = patientInfoMapper.selectPatientInfoList(patientInfoDto);
// 保存患者信息 if (CollectionUtils.isEmpty(patientList)) {
PatientInfo patientInfo = new PatientInfo(); // 保存患者信息
BeanUtils.copyBeanProp(patientInfo, preHospitalization); PatientInfo patientInfo = new PatientInfo();
patientInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); BeanUtils.copyBeanProp(patientInfo, preHospitalization);
patientInfo.setCreateTime(DateUtils.getNowDate()); patientInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
patientInfo.setDelFlag(0); patientInfo.setCreateTime(LocalDateTime.now());
patientInfo.setPatientType(PatientTypeConstants.PRE_HOSPITALIZED_PATIENT); patientInfo.setDelFlag(0);
patientInfoMapper.insertPatientInfo(patientInfo); patientInfo.setPatientType(PatientTypeConstants.PRE_HOSPITALIZED_PATIENT);
preHospitalization.setPatientId(patientInfo.getId()); patientInfoMapper.insertPatientInfo(patientInfo);
} else { preHospitalization.setPatientId(patientInfo.getId());
// 修改患者信息 } else {
PatientInfo patientInfo = patientList.get(0); // 修改患者信息
BeanUtils.copyBeanProp(patientInfo, preHospitalization); PatientInfo patientInfo = patientList.get(0);
patientInfo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); BeanUtils.copyBeanProp(patientInfo, preHospitalization);
patientInfo.setUpdateTime(DateUtils.getNowDate()); patientInfo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
patientInfo.setDelFlag(0); patientInfo.setUpdateTime(LocalDateTime.now());
patientInfo.setPatientType(PatientTypeConstants.PRE_HOSPITALIZED_PATIENT); patientInfo.setDelFlag(0);
patientInfoMapper.updatePatientInfo(patientInfo); patientInfo.setPatientType(PatientTypeConstants.PRE_HOSPITALIZED_PATIENT);
preHospitalization.setPatientId(patientList.get(0).getId()); patientInfoMapper.updatePatientInfo(patientInfo);
} preHospitalization.setPatientId(patientList.get(0).getId());
// 保存预住院信息 }
preHospitalization.setDelFlag(0); // 保存预住院信息
preHospitalization.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); preHospitalization.setDelFlag(0);
preHospitalization.setCreateTime(DateUtils.getNowDate()); preHospitalization.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
return preHospitalizationMapper.insertSelective(preHospitalization); preHospitalization.setCreateTime(LocalDateTime.now());
} return preHospitalizationMapper.insertSelective(preHospitalization);
}
@Override public List<PatientPreHospitalization> selectList(PatientInfoDto patientInfo) { @Override
return preHospitalizationMapper.selectList(patientInfo); public List<PatientPreHospitalization> selectList(PatientInfoDto patientInfo) {
} return preHospitalizationMapper.selectList(patientInfo);
}
@Override public int update(PatientPreHospitalization preHospitalization) { @Override
// 修改患者信息 public int update(PatientPreHospitalization preHospitalization) {
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(preHospitalization.getPatientId()); // 修改患者信息
Long patientId = patientInfo.getId(); PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(preHospitalization.getPatientId());
BeanUtils.copyBeanProp(patientInfo, preHospitalization); Long patientId = patientInfo.getId();
patientInfo.setId(patientId); BeanUtils.copyBeanProp(patientInfo, preHospitalization);
int flag = patientInfoMapper.updatePatientInfo(patientInfo); patientInfo.setId(patientId);
if (flag >= 0) { int flag = patientInfoMapper.updatePatientInfo(patientInfo);
return preHospitalizationMapper.updateByPrimaryKeySelective(preHospitalization); if (flag >= 0) {
} return preHospitalizationMapper.updateByPrimaryKeySelective(preHospitalization);
return -1; }
} return -1;
}
@Override public int deleteByIds(Long[] ids) { @Override
return preHospitalizationMapper.deleteByIds(ids); public int deleteByIds(Long[] ids) {
} return preHospitalizationMapper.deleteByIds(ids);
}
@Override public PatientPreHospitalization getById(Long id) { @Override
return preHospitalizationMapper.selectByPrimaryKey(id); public PatientPreHospitalization getById(Long id) {
} return preHospitalizationMapper.selectByPrimaryKey(id);
}
@Override public AjaxResult importList(List<PatientPreHospitalization> patientList) { @Override
//判断添加的数据是否为空 public AjaxResult importList(List<PatientPreHospitalization> patientList) {
if (CollectionUtils.isEmpty(patientList)) { //判断添加的数据是否为空
return AjaxResult.error("请添加预住院患者导入信息!"); if (CollectionUtils.isEmpty(patientList)) {
} return AjaxResult.error("请添加预住院患者导入信息!");
// 根据患者身份证号做去重处理 }
List<PatientPreHospitalization> importDataList = patientList.stream().filter(item -> StringUtils.isNotBlank(item.getCardNo())).distinct().collect(Collectors.toList()); // 根据患者身份证号做去重处理
// 校验联系电话格式是否正确 List<PatientPreHospitalization> importDataList = patientList.stream().filter(item -> StringUtils.isNotBlank(item.getCardNo())).distinct().collect(Collectors.toList());
PatientPreHospitalization patient = importDataList.stream().filter(item -> StringUtils.isNotBlank(item.getPatientPhone())).filter(item -> BooleanUtils.isFalse(regexUtil.regexPhone(item.getPatientPhone()))).findFirst().orElse(new PatientPreHospitalization()); // 校验联系电话格式是否正确
if (StringUtils.isNotBlank(patient.getPatientPhone())) { PatientPreHospitalization patient = importDataList.stream().filter(item -> StringUtils.isNotBlank(item.getPatientPhone())).filter(item -> BooleanUtils.isFalse(regexUtil.regexPhone(item.getPatientPhone()))).findFirst().orElse(new PatientPreHospitalization());
return AjaxResult.error("当前患者联系电话:" + patient.getPatientPhone() + " 格式不正确,请重新录入!"); if (StringUtils.isNotBlank(patient.getPatientPhone())) {
} return AjaxResult.error("当前患者联系电话:" + patient.getPatientPhone() + " 格式不正确,请重新录入!");
List<PatientPreHospitalization> saveList = new ArrayList<>(); }
for (PatientPreHospitalization item : importDataList) { List<PatientPreHospitalization> saveList = new ArrayList<>();
PatientPreHospitalization preHospitalization = new PatientPreHospitalization(); for (PatientPreHospitalization item : importDataList) {
BeanUtils.copyProperties(item, preHospitalization); PatientPreHospitalization preHospitalization = new PatientPreHospitalization();
// 根据医院名称查询医院id BeanUtils.copyProperties(item, preHospitalization);
Agency agency = new Agency(); // 根据医院名称查询医院id
if (StringUtils.isNotBlank(item.getHospitalAgencyName())) { Agency agency = new Agency();
agency.setAgencyName(item.getHospitalAgencyName()); if (StringUtils.isNotBlank(item.getHospitalAgencyName())) {
agency.setNodeType(NodeTypeConstants.HOSPITAL); agency.setAgencyName(item.getHospitalAgencyName());
List<Agency> agencyList = agencyMapper.selectAgencyList(agency); agency.setNodeType(NodeTypeConstants.HOSPITAL);
if (CollectionUtils.isNotEmpty(agencyList)) { List<Agency> agencyList = agencyMapper.selectAgencyList(agency);
preHospitalization.setHospitalAgencyId(agencyList.get(0).getId()); if (CollectionUtils.isNotEmpty(agencyList)) {
} preHospitalization.setHospitalAgencyId(agencyList.get(0).getId());
} else { }
preHospitalization.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getAgencyId()); } else {
Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getAgencyId()); preHospitalization.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getAgencyId());
if (ObjectUtils.isNotEmpty(agencyData)) { Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getAgencyId());
preHospitalization.setHospitalAgencyName(agencyData.getAgencyName()); if (ObjectUtils.isNotEmpty(agencyData)) {
} preHospitalization.setHospitalAgencyName(agencyData.getAgencyName());
} }
// 查询院区id }
if (StringUtils.isNotBlank(item.getCampusAgencyName())) { // 查询院区id
agency.setAgencyName(item.getWardName()); if (StringUtils.isNotBlank(item.getCampusAgencyName())) {
agency.setNodeType(NodeTypeConstants.CAMPUS); agency.setAgencyName(item.getWardName());
List<Agency> campusList = agencyMapper.selectAgencyList(agency); agency.setNodeType(NodeTypeConstants.CAMPUS);
if (CollectionUtils.isNotEmpty(campusList)) { List<Agency> campusList = agencyMapper.selectAgencyList(agency);
preHospitalization.setCampusAgencyId(campusList.get(0).getId()); if (CollectionUtils.isNotEmpty(campusList)) {
} preHospitalization.setCampusAgencyId(campusList.get(0).getId());
} }
}
// 查询科室id // 查询科室id
Department department = new Department(); Department department = new Department();
if (StringUtils.isNotBlank(item.getDepartmentName())) { if (StringUtils.isNotBlank(item.getDepartmentName())) {
department.setAgencyName(item.getHospitalAgencyName()); department.setAgencyName(item.getHospitalAgencyName());
department.setDepartmentName(item.getDepartmentName()); department.setDepartmentName(item.getDepartmentName());
department.setNodeType(NodeTypeConstants.DEPARTMENT); department.setNodeType(NodeTypeConstants.DEPARTMENT);
List<Department> deptList = departmentMapper.selectDepartmentList(department); List<Department> deptList = departmentMapper.selectDepartmentList(department);
if (CollectionUtils.isNotEmpty(deptList)) { if (CollectionUtils.isNotEmpty(deptList)) {
preHospitalization.setDepartmentId(deptList.get(0).getId()); preHospitalization.setDepartmentId(deptList.get(0).getId());
} }
} else { } else {
preHospitalization.setDepartmentId(SecurityUtils.getLoginUser().getUser().getDepartmentId()); preHospitalization.setDepartmentId(SecurityUtils.getLoginUser().getUser().getDepartmentId());
Department department1 = departmentMapper.selectDepartmentById(SecurityUtils.getLoginUser().getUser().getDepartmentId()); Department department1 = departmentMapper.selectDepartmentById(SecurityUtils.getLoginUser().getUser().getDepartmentId());
if (ObjectUtils.isNotEmpty(department1)) { if (ObjectUtils.isNotEmpty(department1)) {
preHospitalization.setDepartmentName(department1.getDepartmentName()); preHospitalization.setDepartmentName(department1.getDepartmentName());
} }
} }
// 查询病区 // 查询病区
if (StringUtils.isNotBlank(item.getWardName())) { if (StringUtils.isNotBlank(item.getWardName())) {
department.setAgencyName(item.getHospitalAgencyName()); department.setAgencyName(item.getHospitalAgencyName());
department.setDepartmentName(item.getWardName()); department.setDepartmentName(item.getWardName());
department.setNodeType(NodeTypeConstants.WARD); department.setNodeType(NodeTypeConstants.WARD);
List<Department> deptList = departmentMapper.selectDepartmentList(department); List<Department> deptList = departmentMapper.selectDepartmentList(department);
if (CollectionUtils.isNotEmpty(deptList)) { if (CollectionUtils.isNotEmpty(deptList)) {
preHospitalization.setWardId(deptList.get(0).getId()); preHospitalization.setWardId(deptList.get(0).getId());
} }
} }
preHospitalization.setCreateTime(DateUtils.getNowDate()); preHospitalization.setCreateTime(LocalDateTime.now());
preHospitalization.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); preHospitalization.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
// 根据身份证号查询患者信息 // 根据身份证号查询患者信息
PatientInfoDto patientQuery = new PatientInfoDto(); PatientInfoDto patientQuery = new PatientInfoDto();
patientQuery.setCardNo(item.getCardNo()); patientQuery.setCardNo(item.getCardNo());
List<PatientInfo> patientInfoList = patientInfoMapper.selectPatientInfoList(patientQuery); List<PatientInfo> patientInfoList = patientInfoMapper.selectPatientInfoList(patientQuery);
if (CollectionUtils.isNotEmpty(patientInfoList)) { if (CollectionUtils.isNotEmpty(patientInfoList)) {
// 修改居民信息 // 修改居民信息
PatientInfo updInfo = patientInfoList.get(0); PatientInfo updInfo = patientInfoList.get(0);
BeanUtils.copyBeanProp(updInfo, item); BeanUtils.copyBeanProp(updInfo, item);
patientInfoMapper.updatePatientInfo(updInfo); patientInfoMapper.updatePatientInfo(updInfo);
preHospitalization.setPatientId(patientInfoList.get(0).getId()); preHospitalization.setPatientId(patientInfoList.get(0).getId());
} else { } else {
PatientInfo saveInfo = new PatientInfo(); PatientInfo saveInfo = new PatientInfo();
// 添加居民 // 添加居民
BeanUtils.copyBeanProp(saveInfo, item); BeanUtils.copyBeanProp(saveInfo, item);
patientInfoMapper.insertPatientInfo(saveInfo); patientInfoMapper.insertPatientInfo(saveInfo);
preHospitalization.setPatientId(saveInfo.getId()); preHospitalization.setPatientId(saveInfo.getId());
} }
// 根据患者身份证号和预约时间查询是否有记录 // 根据患者身份证号和预约时间查询是否有记录
PatientPreHospitalization preHospitalizationQuery = new PatientPreHospitalization(); PatientPreHospitalization preHospitalizationQuery = new PatientPreHospitalization();
preHospitalizationQuery.setCardNo(item.getCardNo()); preHospitalizationQuery.setCardNo(item.getCardNo());
preHospitalizationQuery.setAppointmentDate(item.getAppointmentDate()); preHospitalizationQuery.setAppointmentDate(item.getAppointmentDate());
List<PatientPreHospitalization> list = preHospitalizationMapper.selectApplyList(preHospitalizationQuery); List<PatientPreHospitalization> list = preHospitalizationMapper.selectApplyList(preHospitalizationQuery);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
// 新增 // 新增
saveList.add(preHospitalization); saveList.add(preHospitalization);
} else { } else {
// 有预约信息暂时不导入 // 有预约信息暂时不导入
} }
} }
int insertCount = preHospitalizationMapper.insertBatch(saveList); int insertCount = preHospitalizationMapper.insertBatch(saveList);
if (insertCount <= 0) { if (insertCount <= 0) {
throw new ServiceException("导入预住院信息失败,请联系管理员!"); throw new ServiceException("导入预住院信息失败,请联系管理员!");
} }
return AjaxResult.success(); return AjaxResult.success();
} }
} }

View File

@ -1,12 +1,13 @@
package com.xinelu.manage.service.patientpropaganda.impl; package com.xinelu.manage.service.patientpropaganda.impl;
import java.util.List;
import com.xinelu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xinelu.manage.mapper.patientpropaganda.PatientPropagandaMapper;
import com.xinelu.manage.domain.patientpropaganda.PatientPropaganda; import com.xinelu.manage.domain.patientpropaganda.PatientPropaganda;
import com.xinelu.manage.mapper.patientpropaganda.PatientPropagandaMapper;
import com.xinelu.manage.service.patientpropaganda.IPatientPropagandaService; import com.xinelu.manage.service.patientpropaganda.IPatientPropagandaService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 患者宣教信息Service业务层处理 * 患者宣教信息Service业务层处理
@ -49,8 +50,8 @@ public class PatientPropagandaServiceImpl implements IPatientPropagandaService {
*/ */
@Override @Override
public int insertPatientPropaganda(PatientPropaganda patientPropaganda) { public int insertPatientPropaganda(PatientPropaganda patientPropaganda) {
patientPropaganda.setCreateTime(DateUtils.getNowDate()); patientPropaganda.setCreateTime(LocalDateTime.now());
return patientPropagandaMapper.insertPatientPropaganda(patientPropaganda); return patientPropagandaMapper.insertPatientPropaganda(patientPropaganda);
} }
/** /**
@ -61,7 +62,7 @@ public class PatientPropagandaServiceImpl implements IPatientPropagandaService {
*/ */
@Override @Override
public int updatePatientPropaganda(PatientPropaganda patientPropaganda) { public int updatePatientPropaganda(PatientPropaganda patientPropaganda) {
patientPropaganda.setUpdateTime(DateUtils.getNowDate()); patientPropaganda.setUpdateTime(LocalDateTime.now());
return patientPropagandaMapper.updatePatientPropaganda(patientPropaganda); return patientPropagandaMapper.updatePatientPropaganda(patientPropaganda);
} }

View File

@ -1,14 +1,15 @@
package com.xinelu.manage.service.patientvisitinhospital.impl; package com.xinelu.manage.service.patientvisitinhospital.impl;
import java.util.List;
import com.xinelu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xinelu.manage.mapper.patientvisitinhospital.PatientVisitInHospitalMapper;
import com.xinelu.manage.domain.patientvisitinhospital.PatientVisitInHospital; import com.xinelu.manage.domain.patientvisitinhospital.PatientVisitInHospital;
import com.xinelu.manage.mapper.patientvisitinhospital.PatientVisitInHospitalMapper;
import com.xinelu.manage.service.patientvisitinhospital.IPatientVisitInHospitalService; import com.xinelu.manage.service.patientvisitinhospital.IPatientVisitInHospitalService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 患者就诊入院记录信息Service业务层处理 * 患者就诊入院记录信息Service业务层处理
* *
@ -31,17 +32,18 @@ public class PatientVisitInHospitalServiceImpl implements IPatientVisitInHospita
return patientVisitInHospitalMapper.selectPatientVisitInHospitalById(id); return patientVisitInHospitalMapper.selectPatientVisitInHospitalById(id);
} }
@Override public PatientVisitInHospital getByVisitRecord(Long patientVisitRecordId) { @Override
PatientVisitInHospital patientVisitInHospital = new PatientVisitInHospital(); public PatientVisitInHospital getByVisitRecord(Long patientVisitRecordId) {
patientVisitInHospital.setPatientVisitRecordId(patientVisitRecordId); PatientVisitInHospital patientVisitInHospital = new PatientVisitInHospital();
List<PatientVisitInHospital> list = patientVisitInHospitalMapper.selectPatientVisitInHospitalList(patientVisitInHospital); patientVisitInHospital.setPatientVisitRecordId(patientVisitRecordId);
if (CollectionUtils.isEmpty(list)) { List<PatientVisitInHospital> list = patientVisitInHospitalMapper.selectPatientVisitInHospitalList(patientVisitInHospital);
return null; if (CollectionUtils.isEmpty(list)) {
} return null;
return list.get(0); }
} return list.get(0);
}
/** /**
* 查询患者就诊入院记录信息列表 * 查询患者就诊入院记录信息列表
* *
* @param patientVisitInHospital 患者就诊入院记录信息 * @param patientVisitInHospital 患者就诊入院记录信息
@ -60,8 +62,8 @@ public class PatientVisitInHospitalServiceImpl implements IPatientVisitInHospita
*/ */
@Override @Override
public int insertPatientVisitInHospital(PatientVisitInHospital patientVisitInHospital) { public int insertPatientVisitInHospital(PatientVisitInHospital patientVisitInHospital) {
patientVisitInHospital.setCreateTime(DateUtils.getNowDate()); patientVisitInHospital.setCreateTime(LocalDateTime.now());
return patientVisitInHospitalMapper.insertPatientVisitInHospital(patientVisitInHospital); return patientVisitInHospitalMapper.insertPatientVisitInHospital(patientVisitInHospital);
} }
/** /**
@ -72,7 +74,7 @@ public class PatientVisitInHospitalServiceImpl implements IPatientVisitInHospita
*/ */
@Override @Override
public int updatePatientVisitInHospital(PatientVisitInHospital patientVisitInHospital) { public int updatePatientVisitInHospital(PatientVisitInHospital patientVisitInHospital) {
patientVisitInHospital.setUpdateTime(DateUtils.getNowDate()); patientVisitInHospital.setUpdateTime(LocalDateTime.now());
return patientVisitInHospitalMapper.updatePatientVisitInHospital(patientVisitInHospital); return patientVisitInHospitalMapper.updatePatientVisitInHospital(patientVisitInHospital);
} }

View File

@ -1,14 +1,15 @@
package com.xinelu.manage.service.patientvisitoperation.impl; package com.xinelu.manage.service.patientvisitoperation.impl;
import java.util.List;
import com.xinelu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xinelu.manage.mapper.patientvisitoperation.PatientVisitOperationMapper;
import com.xinelu.manage.domain.patientvisitoperation.PatientVisitOperation; import com.xinelu.manage.domain.patientvisitoperation.PatientVisitOperation;
import com.xinelu.manage.mapper.patientvisitoperation.PatientVisitOperationMapper;
import com.xinelu.manage.service.patientvisitoperation.IPatientVisitOperationService; import com.xinelu.manage.service.patientvisitoperation.IPatientVisitOperationService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 患者就诊手术记录信息Service业务层处理 * 患者就诊手术记录信息Service业务层处理
* *
@ -42,17 +43,18 @@ public class PatientVisitOperationServiceImpl implements IPatientVisitOperationS
return patientVisitOperationMapper.selectPatientVisitOperationList(patientVisitOperation); return patientVisitOperationMapper.selectPatientVisitOperationList(patientVisitOperation);
} }
@Override public PatientVisitOperation getByVisitRecord(Long patientVisitRecordId) { @Override
PatientVisitOperation patientVisitOperation = new PatientVisitOperation(); public PatientVisitOperation getByVisitRecord(Long patientVisitRecordId) {
patientVisitOperation.setPatientVisitRecordId(patientVisitRecordId); PatientVisitOperation patientVisitOperation = new PatientVisitOperation();
List<PatientVisitOperation> operations = patientVisitOperationMapper.selectPatientVisitOperationList(patientVisitOperation); patientVisitOperation.setPatientVisitRecordId(patientVisitRecordId);
if (CollectionUtils.isEmpty(operations)) { List<PatientVisitOperation> operations = patientVisitOperationMapper.selectPatientVisitOperationList(patientVisitOperation);
return null; if (CollectionUtils.isEmpty(operations)) {
} return null;
return operations.get(0); }
} return operations.get(0);
}
/** /**
* 新增患者就诊手术记录信息 * 新增患者就诊手术记录信息
* *
* @param patientVisitOperation 患者就诊手术记录信息 * @param patientVisitOperation 患者就诊手术记录信息
@ -60,8 +62,8 @@ public class PatientVisitOperationServiceImpl implements IPatientVisitOperationS
*/ */
@Override @Override
public int insertPatientVisitOperation(PatientVisitOperation patientVisitOperation) { public int insertPatientVisitOperation(PatientVisitOperation patientVisitOperation) {
patientVisitOperation.setCreateTime(DateUtils.getNowDate()); patientVisitOperation.setCreateTime(LocalDateTime.now());
return patientVisitOperationMapper.insertPatientVisitOperation(patientVisitOperation); return patientVisitOperationMapper.insertPatientVisitOperation(patientVisitOperation);
} }
/** /**
@ -72,7 +74,7 @@ public class PatientVisitOperationServiceImpl implements IPatientVisitOperationS
*/ */
@Override @Override
public int updatePatientVisitOperation(PatientVisitOperation patientVisitOperation) { public int updatePatientVisitOperation(PatientVisitOperation patientVisitOperation) {
patientVisitOperation.setUpdateTime(DateUtils.getNowDate()); patientVisitOperation.setUpdateTime(LocalDateTime.now());
return patientVisitOperationMapper.updatePatientVisitOperation(patientVisitOperation); return patientVisitOperationMapper.updatePatientVisitOperation(patientVisitOperation);
} }

View File

@ -1,14 +1,16 @@
package com.xinelu.manage.service.patientvisitouthospital.impl; package com.xinelu.manage.service.patientvisitouthospital.impl;
import java.util.List; import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xinelu.manage.mapper.patientvisitouthospital.PatientVisitOutHospitalMapper;
import com.xinelu.manage.domain.patientvisitouthospital.PatientVisitOutHospital; import com.xinelu.manage.domain.patientvisitouthospital.PatientVisitOutHospital;
import com.xinelu.manage.mapper.patientvisitouthospital.PatientVisitOutHospitalMapper;
import com.xinelu.manage.service.patientvisitouthospital.IPatientVisitOutHospitalService; import com.xinelu.manage.service.patientvisitouthospital.IPatientVisitOutHospitalService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 患者就诊出院记录信息Service业务层处理 * 患者就诊出院记录信息Service业务层处理
* *
@ -42,17 +44,18 @@ public class PatientVisitOutHospitalServiceImpl implements IPatientVisitOutHospi
return patientVisitOutHospitalMapper.selectPatientVisitOutHospitalList(patientVisitOutHospital); return patientVisitOutHospitalMapper.selectPatientVisitOutHospitalList(patientVisitOutHospital);
} }
@Override public PatientVisitOutHospital getByVisitRecord(Long patientVisitRecordId) { @Override
PatientVisitOutHospital patientVisitOutHospital = new PatientVisitOutHospital(); public PatientVisitOutHospital getByVisitRecord(Long patientVisitRecordId) {
patientVisitOutHospital.setPatientVisitRecordId(patientVisitRecordId); PatientVisitOutHospital patientVisitOutHospital = new PatientVisitOutHospital();
List<PatientVisitOutHospital> list = patientVisitOutHospitalMapper.selectPatientVisitOutHospitalList(patientVisitOutHospital); patientVisitOutHospital.setPatientVisitRecordId(patientVisitRecordId);
if (CollectionUtils.isEmpty(list)) { List<PatientVisitOutHospital> list = patientVisitOutHospitalMapper.selectPatientVisitOutHospitalList(patientVisitOutHospital);
return null; if (CollectionUtils.isEmpty(list)) {
} return null;
return list.get(0); }
} return list.get(0);
}
/** /**
* 新增患者就诊出院记录信息 * 新增患者就诊出院记录信息
* *
* @param patientVisitOutHospital 患者就诊出院记录信息 * @param patientVisitOutHospital 患者就诊出院记录信息
@ -60,8 +63,8 @@ public class PatientVisitOutHospitalServiceImpl implements IPatientVisitOutHospi
*/ */
@Override @Override
public int insertPatientVisitOutHospital(PatientVisitOutHospital patientVisitOutHospital) { public int insertPatientVisitOutHospital(PatientVisitOutHospital patientVisitOutHospital) {
patientVisitOutHospital.setCreateTime(DateUtils.getNowDate()); patientVisitOutHospital.setCreateTime(LocalDateTime.now());
return patientVisitOutHospitalMapper.insertPatientVisitOutHospital(patientVisitOutHospital); return patientVisitOutHospitalMapper.insertPatientVisitOutHospital(patientVisitOutHospital);
} }
/** /**
@ -72,7 +75,7 @@ public class PatientVisitOutHospitalServiceImpl implements IPatientVisitOutHospi
*/ */
@Override @Override
public int updatePatientVisitOutHospital(PatientVisitOutHospital patientVisitOutHospital) { public int updatePatientVisitOutHospital(PatientVisitOutHospital patientVisitOutHospital) {
patientVisitOutHospital.setUpdateTime(DateUtils.getNowDate()); patientVisitOutHospital.setUpdateTime(LocalDateTime.now());
return patientVisitOutHospitalMapper.updatePatientVisitOutHospital(patientVisitOutHospital); return patientVisitOutHospitalMapper.updatePatientVisitOutHospital(patientVisitOutHospital);
} }

View File

@ -5,7 +5,6 @@ import com.xinelu.common.constant.NodeTypeConstants;
import com.xinelu.common.constant.VisitTypeConstants; import com.xinelu.common.constant.VisitTypeConstants;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
@ -23,17 +22,19 @@ import com.xinelu.manage.mapper.department.DepartmentMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.mapper.patientvisitrecord.PatientVisitRecordMapper; import com.xinelu.manage.mapper.patientvisitrecord.PatientVisitRecordMapper;
import com.xinelu.manage.service.patientvisitrecord.IPatientVisitRecordService; import com.xinelu.manage.service.patientvisitrecord.IPatientVisitRecordService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
/** /**
* 患者就诊记录基本信息Service业务层处理 * 患者就诊记录基本信息Service业务层处理
@ -45,14 +46,14 @@ import org.springframework.stereotype.Service;
public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService { public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService {
@Resource @Resource
private PatientVisitRecordMapper patientVisitRecordMapper; private PatientVisitRecordMapper patientVisitRecordMapper;
@Resource @Resource
private RegexUtil regexUtil; private RegexUtil regexUtil;
@Resource @Resource
private PatientInfoMapper patientMapper; private PatientInfoMapper patientMapper;
@Resource @Resource
private AgencyMapper agencyMapper; private AgencyMapper agencyMapper;
@Resource @Resource
private DepartmentMapper departmentMapper; private DepartmentMapper departmentMapper;
/** /**
* 查询患者就诊记录基本信息 * 查询患者就诊记录基本信息
@ -84,29 +85,30 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
*/ */
@Override @Override
public int insertPatientVisitRecord(PatientVisitRecord patientVisitRecord) { public int insertPatientVisitRecord(PatientVisitRecord patientVisitRecord) {
patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
patientVisitRecord.setCreateTime(DateUtils.getNowDate()); patientVisitRecord.setCreateTime(LocalDateTime.now());
return patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord); return patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord);
} }
@Override public int saveRecord(PatientVisitRecordSaveDto saveDto) { @Override
PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); public int saveRecord(PatientVisitRecordSaveDto saveDto) {
// 查询患者信息 PatientVisitRecord patientVisitRecord = new PatientVisitRecord();
PatientInfo patientInfo = patientMapper.selectPatientInfoById(saveDto.getPatientId()); // 查询患者信息
BeanUtils.copyBeanProp(patientVisitRecord, patientInfo); PatientInfo patientInfo = patientMapper.selectPatientInfoById(saveDto.getPatientId());
BeanUtils.copyBeanProp(patientVisitRecord, saveDto); BeanUtils.copyBeanProp(patientVisitRecord, patientInfo);
patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); BeanUtils.copyBeanProp(patientVisitRecord, saveDto);
patientVisitRecord.setCreateTime(DateUtils.getNowDate()); patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
// 住院时间出院时间-入院时间 patientVisitRecord.setCreateTime(LocalDateTime.now());
LocalDate admissionTime = saveDto.getAdmissionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); // 住院时间出院时间-入院时间
LocalDate dischargeTime = saveDto.getDischargeTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); LocalDate admissionTime = saveDto.getAdmissionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
long daysBetween = ChronoUnit.DAYS.between(admissionTime, dischargeTime); LocalDate dischargeTime = saveDto.getDischargeTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
patientVisitRecord.setHospitalizationDays((int) daysBetween + 1); long daysBetween = ChronoUnit.DAYS.between(admissionTime, dischargeTime);
patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord); patientVisitRecord.setHospitalizationDays((int) daysBetween + 1);
return 0; patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord);
} return 0;
}
/** /**
* 修改患者就诊记录基本信息 * 修改患者就诊记录基本信息
* *
* @param updDto 患者就诊记录基本信息 * @param updDto 患者就诊记录基本信息
@ -114,16 +116,16 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
*/ */
@Override @Override
public int updatePatientVisitRecord(PatientVisitRecordSaveDto updDto) { public int updatePatientVisitRecord(PatientVisitRecordSaveDto updDto) {
PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); PatientVisitRecord patientVisitRecord = new PatientVisitRecord();
BeanUtils.copyBeanProp(patientVisitRecord, updDto); BeanUtils.copyBeanProp(patientVisitRecord, updDto);
patientVisitRecord.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); patientVisitRecord.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
patientVisitRecord.setUpdateTime(DateUtils.getNowDate()); patientVisitRecord.setUpdateTime(LocalDateTime.now());
// 住院时间出院时间-入院时间 // 住院时间出院时间-入院时间
LocalDate admissionTime = updDto.getAdmissionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); LocalDate admissionTime = updDto.getAdmissionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate dischargeTime = updDto.getDischargeTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); LocalDate dischargeTime = updDto.getDischargeTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
long daysBetween = ChronoUnit.DAYS.between(admissionTime, dischargeTime); long daysBetween = ChronoUnit.DAYS.between(admissionTime, dischargeTime);
patientVisitRecord.setHospitalizationDays((int) daysBetween + 1); patientVisitRecord.setHospitalizationDays((int) daysBetween + 1);
patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord); patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord);
return patientVisitRecordMapper.updatePatientVisitRecord(patientVisitRecord); return patientVisitRecordMapper.updatePatientVisitRecord(patientVisitRecord);
} }
@ -149,137 +151,137 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
return patientVisitRecordMapper.deletePatientVisitRecordById(id); return patientVisitRecordMapper.deletePatientVisitRecordById(id);
} }
@Override @Override
public AjaxResult importPatientList(List<PatientVisitRecordImportDto> patientList, String patientType) { public AjaxResult importPatientList(List<PatientVisitRecordImportDto> patientList, String patientType) {
//判断添加的数据是否为空 //判断添加的数据是否为空
if (CollectionUtils.isEmpty(patientList)) { if (CollectionUtils.isEmpty(patientList)) {
return AjaxResult.error("请添加就诊信息导入信息!"); return AjaxResult.error("请添加就诊信息导入信息!");
} }
// 根据患者身份证号做去除处理 // 根据患者身份证号做去除处理
List<PatientVisitRecordImportDto> importDataList = patientList.stream().filter(item -> StringUtils.isNotBlank(item.getCardNo())).distinct().collect(Collectors.toList()); List<PatientVisitRecordImportDto> importDataList = patientList.stream().filter(item -> StringUtils.isNotBlank(item.getCardNo())).distinct().collect(Collectors.toList());
// 校验联系电话格式是否正确 // 校验联系电话格式是否正确
PatientVisitRecordImportDto patient = importDataList.stream().filter(item -> StringUtils.isNotBlank(item.getPatientPhone())).filter(item -> BooleanUtils.isFalse(regexUtil.regexPhone(item.getPatientPhone()))).findFirst().orElse(new PatientVisitRecordImportDto()); PatientVisitRecordImportDto patient = importDataList.stream().filter(item -> StringUtils.isNotBlank(item.getPatientPhone())).filter(item -> BooleanUtils.isFalse(regexUtil.regexPhone(item.getPatientPhone()))).findFirst().orElse(new PatientVisitRecordImportDto());
if (StringUtils.isNotBlank(patient.getPatientPhone())) { if (StringUtils.isNotBlank(patient.getPatientPhone())) {
return AjaxResult.error("当前患者联系电话:" + patient.getPatientPhone() + " 格式不正确,请重新录入!"); return AjaxResult.error("当前患者联系电话:" + patient.getPatientPhone() + " 格式不正确,请重新录入!");
} }
List<PatientVisitRecord> saveList = new ArrayList<>(); List<PatientVisitRecord> saveList = new ArrayList<>();
for (PatientVisitRecordImportDto item : importDataList) { for (PatientVisitRecordImportDto item : importDataList) {
PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); PatientVisitRecord patientVisitRecord = new PatientVisitRecord();
BeanUtils.copyProperties(item, patientVisitRecord); BeanUtils.copyProperties(item, patientVisitRecord);
patientVisitRecord.setCreateTime(DateUtils.getNowDate()); patientVisitRecord.setCreateTime(LocalDateTime.now());
patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
switch (patientType) { switch (patientType) {
// 在院患者 // 在院患者
case Constants.IN_HOSPITAL: case Constants.IN_HOSPITAL:
case Constants.DISCHARGED: case Constants.DISCHARGED:
patientVisitRecord.setVisitType(VisitTypeConstants.BE_HOSPITALIZED); patientVisitRecord.setVisitType(VisitTypeConstants.BE_HOSPITALIZED);
break; break;
// 门诊患者 // 门诊患者
case Constants.OUTPATIENT: case Constants.OUTPATIENT:
patientVisitRecord.setVisitType(VisitTypeConstants.OUTPATIENT_SERVICE); patientVisitRecord.setVisitType(VisitTypeConstants.OUTPATIENT_SERVICE);
patientVisitRecord.setInHospitalNumber(item.getOutpatientNumber());// 门诊住院号共用一个字段 patientVisitRecord.setInHospitalNumber(item.getOutpatientNumber());// 门诊住院号共用一个字段
break; break;
} }
// 根据身份证号查询患者信息 // 根据身份证号查询患者信息
PatientInfoDto patientQuery = new PatientInfoDto(); PatientInfoDto patientQuery = new PatientInfoDto();
patientQuery.setCardNo(item.getCardNo()); patientQuery.setCardNo(item.getCardNo());
List<PatientInfo> patientInfoList = patientMapper.selectPatientInfoList(patientQuery); List<PatientInfo> patientInfoList = patientMapper.selectPatientInfoList(patientQuery);
if (CollectionUtils.isNotEmpty(patientInfoList)) { if (CollectionUtils.isNotEmpty(patientInfoList)) {
// 修改居民信息 // 修改居民信息
PatientInfo updInfo = patientInfoList.get(0); PatientInfo updInfo = patientInfoList.get(0);
BeanUtils.copyBeanProp(updInfo, item); BeanUtils.copyBeanProp(updInfo, item);
patientMapper.updatePatientInfo(updInfo); patientMapper.updatePatientInfo(updInfo);
patientVisitRecord.setPatientId(patientInfoList.get(0).getId()); patientVisitRecord.setPatientId(patientInfoList.get(0).getId());
} else { } else {
PatientInfo saveInfo = new PatientInfo(); PatientInfo saveInfo = new PatientInfo();
// 添加居民 // 添加居民
BeanUtils.copyBeanProp(saveInfo, item); BeanUtils.copyBeanProp(saveInfo, item);
patientMapper.insertPatientInfo(saveInfo); patientMapper.insertPatientInfo(saveInfo);
patientVisitRecord.setPatientId(saveInfo.getId()); patientVisitRecord.setPatientId(saveInfo.getId());
} }
// 根据医院名称查询医院id // 根据医院名称查询医院id
Agency agency = new Agency(); Agency agency = new Agency();
if (StringUtils.isNotBlank(item.getHospitalAgencyName())) { if (StringUtils.isNotBlank(item.getHospitalAgencyName())) {
agency.setAgencyName(item.getHospitalAgencyName()); agency.setAgencyName(item.getHospitalAgencyName());
agency.setNodeType(NodeTypeConstants.HOSPITAL); agency.setNodeType(NodeTypeConstants.HOSPITAL);
List<Agency> agencyList = agencyMapper.selectAgencyList(agency); List<Agency> agencyList = agencyMapper.selectAgencyList(agency);
if (CollectionUtils.isNotEmpty(agencyList)) { if (CollectionUtils.isNotEmpty(agencyList)) {
patientVisitRecord.setHospitalAgencyId(agencyList.get(0).getId()); patientVisitRecord.setHospitalAgencyId(agencyList.get(0).getId());
} }
} else { } else {
patientVisitRecord.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getAgencyId()); patientVisitRecord.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getAgencyId());
Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getAgencyId()); Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getAgencyId());
if (ObjectUtils.isNotEmpty(agencyData)) { if (ObjectUtils.isNotEmpty(agencyData)) {
patientVisitRecord.setHospitalAgencyName(agencyData.getAgencyName()); patientVisitRecord.setHospitalAgencyName(agencyData.getAgencyName());
} }
} }
// 查询院区id // 查询院区id
if (StringUtils.isNotBlank(item.getCampusAgencyName())) { if (StringUtils.isNotBlank(item.getCampusAgencyName())) {
agency.setAgencyName(item.getWardName()); agency.setAgencyName(item.getWardName());
agency.setNodeType(NodeTypeConstants.CAMPUS); agency.setNodeType(NodeTypeConstants.CAMPUS);
List<Agency> campusList = agencyMapper.selectAgencyList(agency); List<Agency> campusList = agencyMapper.selectAgencyList(agency);
if (CollectionUtils.isNotEmpty(campusList)) { if (CollectionUtils.isNotEmpty(campusList)) {
patientVisitRecord.setCampusAgencyId(campusList.get(0).getId()); patientVisitRecord.setCampusAgencyId(campusList.get(0).getId());
} }
} }
// 查询科室id // 查询科室id
Department department = new Department(); Department department = new Department();
if (StringUtils.isNotBlank(item.getDepartmentName())) { if (StringUtils.isNotBlank(item.getDepartmentName())) {
department.setAgencyName(item.getHospitalAgencyName()); department.setAgencyName(item.getHospitalAgencyName());
department.setDepartmentName(item.getDepartmentName()); department.setDepartmentName(item.getDepartmentName());
department.setNodeType(NodeTypeConstants.DEPARTMENT); department.setNodeType(NodeTypeConstants.DEPARTMENT);
List<Department> deptList = departmentMapper.selectDepartmentList(department); List<Department> deptList = departmentMapper.selectDepartmentList(department);
if (CollectionUtils.isNotEmpty(deptList)) { if (CollectionUtils.isNotEmpty(deptList)) {
patientVisitRecord.setDepartmentId(deptList.get(0).getId()); patientVisitRecord.setDepartmentId(deptList.get(0).getId());
} }
} else { } else {
patientVisitRecord.setDepartmentId(SecurityUtils.getLoginUser().getUser().getDepartmentId()); patientVisitRecord.setDepartmentId(SecurityUtils.getLoginUser().getUser().getDepartmentId());
Department department1 = departmentMapper.selectDepartmentById(SecurityUtils.getLoginUser().getUser().getDepartmentId()); Department department1 = departmentMapper.selectDepartmentById(SecurityUtils.getLoginUser().getUser().getDepartmentId());
if (ObjectUtils.isNotEmpty(department1)) { if (ObjectUtils.isNotEmpty(department1)) {
patientVisitRecord.setDepartmentName(department1.getDepartmentName()); patientVisitRecord.setDepartmentName(department1.getDepartmentName());
} }
} }
// 查询病区 // 查询病区
if (StringUtils.isNotBlank(item.getWardName())) { if (StringUtils.isNotBlank(item.getWardName())) {
department.setAgencyName(item.getHospitalAgencyName()); department.setAgencyName(item.getHospitalAgencyName());
department.setDepartmentName(item.getWardName()); department.setDepartmentName(item.getWardName());
department.setNodeType(NodeTypeConstants.WARD); department.setNodeType(NodeTypeConstants.WARD);
List<Department> deptList = departmentMapper.selectDepartmentList(department); List<Department> deptList = departmentMapper.selectDepartmentList(department);
if (CollectionUtils.isNotEmpty(deptList)) { if (CollectionUtils.isNotEmpty(deptList)) {
patientVisitRecord.setWardId(deptList.get(0).getId()); patientVisitRecord.setWardId(deptList.get(0).getId());
} }
} }
// 根据门诊/住院编号查询是否有记录 // 根据门诊/住院编号查询是否有记录
PatientVisitRecordDto recordQuery = new PatientVisitRecordDto(); PatientVisitRecordDto recordQuery = new PatientVisitRecordDto();
recordQuery.setVisitType(patientType); recordQuery.setVisitType(patientType);
recordQuery.setInHospitalNumber(patientVisitRecord.getInHospitalInfo()); recordQuery.setInHospitalNumber(patientVisitRecord.getInHospitalInfo());
List<PatientVisitRecord> patientVisitRecordList = patientVisitRecordMapper.selectPatientVisitRecordList(recordQuery); List<PatientVisitRecord> patientVisitRecordList = patientVisitRecordMapper.selectPatientVisitRecordList(recordQuery);
if (CollectionUtils.isEmpty(patientVisitRecordList)) { if (CollectionUtils.isEmpty(patientVisitRecordList)) {
// 新增 // 新增
saveList.add(patientVisitRecord); saveList.add(patientVisitRecord);
} else { } else {
// 修改 // 修改
patientVisitRecord.setId(patientVisitRecordList.get(0).getId()); patientVisitRecord.setId(patientVisitRecordList.get(0).getId());
int flag = patientVisitRecordMapper.updatePatientVisitRecord(patientVisitRecord); int flag = patientVisitRecordMapper.updatePatientVisitRecord(patientVisitRecord);
if (flag < 0) { if (flag < 0) {
throw new ServiceException("导入患者就诊信息失败,请联系管理员!"); throw new ServiceException("导入患者就诊信息失败,请联系管理员!");
} }
} }
} }
int insertCount = patientVisitRecordMapper.insertBatch(saveList); int insertCount = patientVisitRecordMapper.insertBatch(saveList);
if (insertCount <= 0) { if (insertCount <= 0) {
throw new ServiceException("导入患者就诊信息失败,请联系管理员!"); throw new ServiceException("导入患者就诊信息失败,请联系管理员!");
} }
return AjaxResult.success(); return AjaxResult.success();
} }
public static void main(String[] args) { public static void main(String[] args) {
LocalDate date1 = LocalDate.of(2020, 1, 1); LocalDate date1 = LocalDate.of(2020, 1, 1);
LocalDate date2 = LocalDate.of(2020, 1, 2); LocalDate date2 = LocalDate.of(2020, 1, 2);
long daysBetween = ChronoUnit.DAYS.between(date1, date2); long daysBetween = ChronoUnit.DAYS.between(date1, date2);
System.out.println("Days between: " + daysBetween); System.out.println("Days between: " + daysBetween);
} }
} }

View File

@ -1,17 +1,18 @@
package com.xinelu.manage.service.project.impl; package com.xinelu.manage.service.project.impl;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.StringUtils;
import com.xinelu.manage.domain.project.Project; import com.xinelu.manage.domain.project.Project;
import com.xinelu.manage.mapper.project.ProjectMapper; import com.xinelu.manage.mapper.project.ProjectMapper;
import com.xinelu.manage.service.project.IProjectService; import com.xinelu.manage.service.project.IProjectService;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 检测项目Service业务层处理 * 检测项目Service业务层处理
* *
@ -53,21 +54,21 @@ public class ProjectServiceImpl implements IProjectService {
*/ */
@Override @Override
public int insertProject(Project project) { public int insertProject(Project project) {
if (StringUtils.isBlank(project.getProjectName())) { if (StringUtils.isBlank(project.getProjectName())) {
throw new ServiceException("请输入检测项目名称"); throw new ServiceException("请输入检测项目名称");
} }
if (StringUtils.isBlank(project.getProjectCode())) { if (StringUtils.isBlank(project.getProjectCode())) {
throw new ServiceException("请输入检测项目编码"); throw new ServiceException("请输入检测项目编码");
} }
// 查询是否有相同code的检测项目 // 查询是否有相同code的检测项目
List<Project> projects = projectMapper.hasSameCodeProject(null, project.getGroupId(), project.getProjectCode()); List<Project> projects = projectMapper.hasSameCodeProject(null, project.getGroupId(), project.getProjectCode());
if (CollectionUtils.isNotEmpty(projects)) { if (CollectionUtils.isNotEmpty(projects)) {
throw new ServiceException("已存在编码为【"+project.getProjectCode() +"】的检测项目"); throw new ServiceException("已存在编码为【" + project.getProjectCode() + "】的检测项目");
} }
project.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); project.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
project.setCreateTime(DateUtils.getNowDate()); project.setCreateTime(LocalDateTime.now());
project.setDelFlag(0); project.setDelFlag(0);
return projectMapper.insertProject(project); return projectMapper.insertProject(project);
} }
/** /**
@ -78,13 +79,13 @@ public class ProjectServiceImpl implements IProjectService {
*/ */
@Override @Override
public int updateProject(Project project) { public int updateProject(Project project) {
// 查询是否有相同code的检测项目 // 查询是否有相同code的检测项目
List<Project> projects = projectMapper.hasSameCodeProject(project.getId(), project.getGroupId(), project.getProjectCode()); List<Project> projects = projectMapper.hasSameCodeProject(project.getId(), project.getGroupId(), project.getProjectCode());
if (CollectionUtils.isNotEmpty(projects)) { if (CollectionUtils.isNotEmpty(projects)) {
throw new ServiceException("已存在编码为【"+project.getProjectCode() +"】的检测项目"); throw new ServiceException("已存在编码为【" + project.getProjectCode() + "】的检测项目");
} }
project.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); project.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
project.setUpdateTime(DateUtils.getNowDate()); project.setUpdateTime(LocalDateTime.now());
return projectMapper.updateProject(project); return projectMapper.updateProject(project);
} }

View File

@ -8,6 +8,8 @@ import com.xinelu.common.utils.StringUtils;
import com.xinelu.manage.domain.projectdevice.ProjectDevice; import com.xinelu.manage.domain.projectdevice.ProjectDevice;
import com.xinelu.manage.mapper.projectdevice.ProjectDeviceMapper; import com.xinelu.manage.mapper.projectdevice.ProjectDeviceMapper;
import com.xinelu.manage.service.projectdevice.IProjectDeviceService; import com.xinelu.manage.service.projectdevice.IProjectDeviceService;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -74,9 +76,9 @@ public class ProjectDeviceServiceImpl implements IProjectDeviceService {
throw new ServiceException("该设备已被绑定,请解绑后重新绑定"); throw new ServiceException("该设备已被绑定,请解绑后重新绑定");
} }
projectDevice.setDeviceStatus(DeviceStatusConstants.BIND); projectDevice.setDeviceStatus(DeviceStatusConstants.BIND);
projectDevice.setDeviceBindTime(DateUtils.getNowDate()); projectDevice.setDeviceBindTime(LocalDateTime.now());
projectDevice.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); projectDevice.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
projectDevice.setCreateTime(DateUtils.getNowDate()); projectDevice.setCreateTime(LocalDateTime.now());
return projectDeviceMapper.insertProjectDevice(projectDevice); return projectDeviceMapper.insertProjectDevice(projectDevice);
} }
@ -89,7 +91,7 @@ public class ProjectDeviceServiceImpl implements IProjectDeviceService {
@Override @Override
public int updateProjectDevice(ProjectDevice projectDevice) { public int updateProjectDevice(ProjectDevice projectDevice) {
projectDevice.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); projectDevice.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
projectDevice.setUpdateTime(DateUtils.getNowDate()); projectDevice.setUpdateTime(LocalDateTime.now());
return projectDeviceMapper.updateProjectDevice(projectDevice); return projectDeviceMapper.updateProjectDevice(projectDevice);
} }

View File

@ -1,19 +1,20 @@
package com.xinelu.manage.service.projectgroup.impl; package com.xinelu.manage.service.projectgroup.impl;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.StringUtils;
import com.xinelu.manage.domain.projectgroup.ProjectGroup; import com.xinelu.manage.domain.projectgroup.ProjectGroup;
import com.xinelu.manage.dto.projectgroup.ProjectGroupSaveListDto; import com.xinelu.manage.dto.projectgroup.ProjectGroupSaveListDto;
import com.xinelu.manage.mapper.projectgroup.ProjectGroupMapper; import com.xinelu.manage.mapper.projectgroup.ProjectGroupMapper;
import com.xinelu.manage.service.projectgroup.IProjectGroupService; import com.xinelu.manage.service.projectgroup.IProjectGroupService;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 检测项目分组Service业务层处理 * 检测项目分组Service业务层处理
* *
@ -47,7 +48,7 @@ public class ProjectGroupServiceImpl implements IProjectGroupService {
return projectGroupMapper.selectProjectGroupList(projectGroup); return projectGroupMapper.selectProjectGroupList(projectGroup);
} }
/** /**
* 新增检测项目分组 * 新增检测项目分组
* *
* @param projectGroup 检测项目分组 * @param projectGroup 检测项目分组
@ -55,47 +56,48 @@ public class ProjectGroupServiceImpl implements IProjectGroupService {
*/ */
@Override @Override
public int insertProjectGroup(ProjectGroup projectGroup) { public int insertProjectGroup(ProjectGroup projectGroup) {
if (StringUtils.isBlank(projectGroup.getGroupName())) { if (StringUtils.isBlank(projectGroup.getGroupName())) {
throw new ServiceException("请输入检测项目分组名称"); throw new ServiceException("请输入检测项目分组名称");
} }
if (StringUtils.isBlank(projectGroup.getGroupCode())) { if (StringUtils.isBlank(projectGroup.getGroupCode())) {
throw new ServiceException("请输入检测项目分组编码"); throw new ServiceException("请输入检测项目分组编码");
} }
// 查询是否有相同编码的项目组 // 查询是否有相同编码的项目组
List<ProjectGroup> list = projectGroupMapper.hasSameCodeGroup(null, projectGroup.getGroupCode()); List<ProjectGroup> list = projectGroupMapper.hasSameCodeGroup(null, projectGroup.getGroupCode());
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
throw new ServiceException("已存在编码为【"+projectGroup.getGroupCode() +"】的分组"); throw new ServiceException("已存在编码为【" + projectGroup.getGroupCode() + "】的分组");
} }
projectGroup.setCreateTime(DateUtils.getNowDate()); projectGroup.setCreateTime(LocalDateTime.now());
projectGroup.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); projectGroup.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
projectGroup.setDelFlag(0); projectGroup.setDelFlag(0);
return projectGroupMapper.insertProjectGroup(projectGroup); return projectGroupMapper.insertProjectGroup(projectGroup);
} }
@Override public int insertList(ProjectGroupSaveListDto saveDto) { @Override
if (ObjectUtils.isNotEmpty(saveDto)) { public int insertList(ProjectGroupSaveListDto saveDto) {
List<ProjectGroup> list = saveDto.getList(); if (ObjectUtils.isNotEmpty(saveDto)) {
if (CollectionUtils.isNotEmpty(list)) { List<ProjectGroup> list = saveDto.getList();
for (ProjectGroup projectGroup : list) { if (CollectionUtils.isNotEmpty(list)) {
// 查询是否有相同编码的项目组 for (ProjectGroup projectGroup : list) {
List<ProjectGroup> groupList = projectGroupMapper.hasSameCodeGroup(null, projectGroup.getGroupCode()); // 查询是否有相同编码的项目组
if (CollectionUtils.isNotEmpty(groupList)) { List<ProjectGroup> groupList = projectGroupMapper.hasSameCodeGroup(null, projectGroup.getGroupCode());
throw new ServiceException("已存在编码为【"+projectGroup.getGroupCode() +"】的分组"); if (CollectionUtils.isNotEmpty(groupList)) {
} throw new ServiceException("已存在编码为【" + projectGroup.getGroupCode() + "】的分组");
projectGroup.setCreateTime(DateUtils.getNowDate()); }
projectGroup.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); projectGroup.setCreateTime(LocalDateTime.now());
projectGroup.setDelFlag(0); projectGroup.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
} projectGroup.setDelFlag(0);
return projectGroupMapper.insertBatch(list); }
} else { return projectGroupMapper.insertBatch(list);
throw new ServiceException("传输数据错误"); } else {
} throw new ServiceException("传输数据错误");
} else { }
throw new ServiceException("传输数据错误"); } else {
} throw new ServiceException("传输数据错误");
} }
}
/** /**
* 修改检测项目分组 * 修改检测项目分组
* *
* @param projectGroup 检测项目分组 * @param projectGroup 检测项目分组
@ -103,13 +105,13 @@ public class ProjectGroupServiceImpl implements IProjectGroupService {
*/ */
@Override @Override
public int updateProjectGroup(ProjectGroup projectGroup) { public int updateProjectGroup(ProjectGroup projectGroup) {
// 查询是否有相同编码的项目组 // 查询是否有相同编码的项目组
List<ProjectGroup> groupList = projectGroupMapper.hasSameCodeGroup(projectGroup.getId(), projectGroup.getGroupCode()); List<ProjectGroup> groupList = projectGroupMapper.hasSameCodeGroup(projectGroup.getId(), projectGroup.getGroupCode());
if (CollectionUtils.isNotEmpty(groupList)) { if (CollectionUtils.isNotEmpty(groupList)) {
throw new ServiceException("已存在编码为【"+projectGroup.getGroupCode() +"】的分组"); throw new ServiceException("已存在编码为【" + projectGroup.getGroupCode() + "】的分组");
} }
projectGroup.setUpdateTime(DateUtils.getNowDate()); projectGroup.setUpdateTime(LocalDateTime.now());
projectGroup.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); projectGroup.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
return projectGroupMapper.updateProjectGroup(projectGroup); return projectGroupMapper.updateProjectGroup(projectGroup);
} }

View File

@ -1,7 +1,6 @@
package com.xinelu.manage.service.projectresult.impl; package com.xinelu.manage.service.projectresult.impl;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.StringUtils;
import com.xinelu.manage.domain.project.Project; import com.xinelu.manage.domain.project.Project;
import com.xinelu.manage.domain.projectgroup.ProjectGroup; import com.xinelu.manage.domain.projectgroup.ProjectGroup;
@ -13,136 +12,138 @@ import com.xinelu.manage.mapper.projectresult.ProjectResultMapper;
import com.xinelu.manage.service.projectresult.IProjectResultService; import com.xinelu.manage.service.projectresult.IProjectResultService;
import com.xinelu.manage.vo.projectresult.ProjectResultStatisticVo; import com.xinelu.manage.vo.projectresult.ProjectResultStatisticVo;
import com.xinelu.manage.vo.projectresult.ProjectResultVo; import com.xinelu.manage.vo.projectresult.ProjectResultVo;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
/** /**
* @author haown * @author haown
* @description 针对表project_result(检测项目结果表)的数据库操作Service实现 * @description 针对表project_result(检测项目结果表)的数据库操作Service实现
* @createDate 2024-03-06 10:40:56 * @createDate 2024-03-06 10:40:56
*/ */
@Service @Service
public class ProjectResultServiceImpl implements IProjectResultService { public class ProjectResultServiceImpl implements IProjectResultService {
@Resource @Resource
private ProjectGroupMapper projectGroupMapper; private ProjectGroupMapper projectGroupMapper;
@Resource @Resource
private ProjectMapper projectMapper; private ProjectMapper projectMapper;
@Resource @Resource
private ProjectResultMapper projectResultMapper; private ProjectResultMapper projectResultMapper;
/** /**
* 查询检测项目结果 * 查询检测项目结果
* *
* @param id 检测项目结果主键 * @param id 检测项目结果主键
* @return 检测项目结果 * @return 检测项目结果
*/ */
@Override @Override
public ProjectResult selectProjectResultById(Long id) { public ProjectResult selectProjectResultById(Long id) {
return projectResultMapper.selectProjectResultById(id); return projectResultMapper.selectProjectResultById(id);
} }
/** /**
* 查询检测项目结果列表 * 查询检测项目结果列表
* *
* @param projectResult 检测项目结果 * @param projectResult 检测项目结果
* @return 检测项目结果 * @return 检测项目结果
*/ */
@Override @Override
public List<ProjectResult> selectProjectResultList(ProjectResult projectResult) { public List<ProjectResult> selectProjectResultList(ProjectResult projectResult) {
return projectResultMapper.selectProjectResultList(projectResult); return projectResultMapper.selectProjectResultList(projectResult);
} }
/** /**
* 新增检测项目结果 * 新增检测项目结果
* *
* @param projectResult 检测项目结果 * @param projectResult 检测项目结果
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertProjectResult(ProjectResult projectResult) { public int insertProjectResult(ProjectResult projectResult) {
projectResult.setCreateTime(DateUtils.getNowDate()); projectResult.setCreateTime(LocalDateTime.now());
return projectResultMapper.insertProjectResult(projectResult); return projectResultMapper.insertProjectResult(projectResult);
} }
/** /**
* 修改检测项目结果 * 修改检测项目结果
* *
* @param projectResult 检测项目结果 * @param projectResult 检测项目结果
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateProjectResult(ProjectResult projectResult) { public int updateProjectResult(ProjectResult projectResult) {
projectResult.setUpdateTime(DateUtils.getNowDate()); projectResult.setUpdateTime(LocalDateTime.now());
return projectResultMapper.updateProjectResult(projectResult); return projectResultMapper.updateProjectResult(projectResult);
} }
/** /**
* 批量删除检测项目结果 * 批量删除检测项目结果
* *
* @param ids 需要删除的检测项目结果主键 * @param ids 需要删除的检测项目结果主键
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteProjectResultByIds(Long[] ids) { public int deleteProjectResultByIds(Long[] ids) {
return projectResultMapper.deleteProjectResultByIds(ids); return projectResultMapper.deleteProjectResultByIds(ids);
} }
/** /**
* 删除检测项目结果信息 * 删除检测项目结果信息
* *
* @param id 检测项目结果主键 * @param id 检测项目结果主键
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteProjectResultById(Long id) { public int deleteProjectResultById(Long id) {
return projectResultMapper.deleteProjectResultById(id); return projectResultMapper.deleteProjectResultById(id);
} }
@Override @Override
public ProjectResultStatisticVo curveStatistics(ProjectResultStatisticDto projectResultStatisticDto) { public ProjectResultStatisticVo curveStatistics(ProjectResultStatisticDto projectResultStatisticDto) {
// 根据groupCode查询groupId // 根据groupCode查询groupId
if (StringUtils.isNotBlank(projectResultStatisticDto.getGroupCode())) { if (StringUtils.isNotBlank(projectResultStatisticDto.getGroupCode())) {
ProjectGroup projectGroup = new ProjectGroup(); ProjectGroup projectGroup = new ProjectGroup();
projectGroup.setGroupCode(projectResultStatisticDto.getGroupCode()); projectGroup.setGroupCode(projectResultStatisticDto.getGroupCode());
List<ProjectGroup> groupList = projectGroupMapper.selectProjectGroupList(projectGroup); List<ProjectGroup> groupList = projectGroupMapper.selectProjectGroupList(projectGroup);
if (CollectionUtils.isEmpty(groupList)) { if (CollectionUtils.isEmpty(groupList)) {
throw new ServiceException("未找到该检测项目"); throw new ServiceException("未找到该检测项目");
} }
projectResultStatisticDto.setGroupId(groupList.get(0).getId()); projectResultStatisticDto.setGroupId(groupList.get(0).getId());
} }
// 根据projectCode查询projectId // 根据projectCode查询projectId
if (StringUtils.isNotBlank(projectResultStatisticDto.getProjectCode())) { if (StringUtils.isNotBlank(projectResultStatisticDto.getProjectCode())) {
Project projectQuery = new Project(); Project projectQuery = new Project();
projectQuery.setProjectCode(projectResultStatisticDto.getProjectCode()); projectQuery.setProjectCode(projectResultStatisticDto.getProjectCode());
List<Project> projectList = projectMapper.selectProjectList(projectQuery); List<Project> projectList = projectMapper.selectProjectList(projectQuery);
if (CollectionUtils.isEmpty(projectList)) { if (CollectionUtils.isEmpty(projectList)) {
throw new ServiceException("未找到该检测项目"); throw new ServiceException("未找到该检测项目");
} }
projectResultStatisticDto.setProjectId(projectList.get(0).getId()); projectResultStatisticDto.setProjectId(projectList.get(0).getId());
} }
if (projectResultStatisticDto.getPatientId() == null) { if (projectResultStatisticDto.getPatientId() == null) {
throw new ServiceException("数据格式错误"); throw new ServiceException("数据格式错误");
} }
List<String> measureTimeList = new ArrayList<>(); List<String> measureTimeList = new ArrayList<>();
Map<String, List<String>> valueMap = new HashMap<>(); Map<String, List<String>> valueMap = new HashMap<>();
List<ProjectResultVo> resultList = projectResultMapper.selectList(projectResultStatisticDto); List<ProjectResultVo> resultList = projectResultMapper.selectList(projectResultStatisticDto);
if (!CollectionUtils.isEmpty(resultList)) { if (!CollectionUtils.isEmpty(resultList)) {
// 根据projectId进行分组 // 根据projectId进行分组
Map<String, List<ProjectResultVo>> groupByProject = resultList.stream().collect(Collectors.groupingBy(ProjectResultVo::getProjectName)); Map<String, List<ProjectResultVo>> groupByProject = resultList.stream().collect(Collectors.groupingBy(ProjectResultVo::getProjectName));
for (String projectName : groupByProject.keySet()) { for (String projectName : groupByProject.keySet()) {
List<ProjectResultVo> projectResultList = groupByProject.get(projectName); List<ProjectResultVo> projectResultList = groupByProject.get(projectName);
List<String> valueList = projectResultList.stream().map(ProjectResultVo::getMeasureResult).collect(Collectors.toList()); List<String> valueList = projectResultList.stream().map(ProjectResultVo::getMeasureResult).collect(Collectors.toList());
measureTimeList = projectResultList.stream().map(ProjectResultVo::getMeasureTimeStr).collect(Collectors.toList()); measureTimeList = projectResultList.stream().map(ProjectResultVo::getMeasureTimeStr).collect(Collectors.toList());
valueMap.put(projectName, valueList); valueMap.put(projectName, valueList);
} }
} }
return ProjectResultStatisticVo.builder().xList(measureTimeList).yList(valueMap).build(); return ProjectResultStatisticVo.builder().xList(measureTimeList).yList(valueMap).build();
} }
} }

View File

@ -1,6 +1,5 @@
package com.xinelu.manage.service.propagandainfo.impl; package com.xinelu.manage.service.propagandainfo.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.manage.domain.propagandainfo.PropagandaInfo; import com.xinelu.manage.domain.propagandainfo.PropagandaInfo;
import com.xinelu.manage.dto.department.DepartmentDTO; import com.xinelu.manage.dto.department.DepartmentDTO;
@ -9,10 +8,12 @@ import com.xinelu.manage.dto.propagandainfo.PropagandaUpdateDto;
import com.xinelu.manage.mapper.propagandainfo.PropagandaInfoMapper; import com.xinelu.manage.mapper.propagandainfo.PropagandaInfoMapper;
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService; import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
import com.xinelu.manage.vo.department.DepartmentVO; import com.xinelu.manage.vo.department.DepartmentVO;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 宣教库管理Service业务层处理 * 宣教库管理Service业务层处理
* *
@ -54,8 +55,8 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
*/ */
@Override @Override
public int insertPropagandaInfo(PropagandaInfo propagandaInfo) { public int insertPropagandaInfo(PropagandaInfo propagandaInfo) {
propagandaInfo.setCreateTime(DateUtils.getNowDate()); propagandaInfo.setCreateTime(LocalDateTime.now());
return propagandaInfoMapper.insertPropagandaInfo(propagandaInfo); return propagandaInfoMapper.insertPropagandaInfo(propagandaInfo);
} }
/** /**
@ -66,30 +67,32 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
*/ */
@Override @Override
public int updatePropagandaInfo(PropagandaInfo propagandaInfo) { public int updatePropagandaInfo(PropagandaInfo propagandaInfo) {
propagandaInfo.setUpdateTime(DateUtils.getNowDate()); propagandaInfo.setUpdateTime(LocalDateTime.now());
return propagandaInfoMapper.updatePropagandaInfo(propagandaInfo); return propagandaInfoMapper.updatePropagandaInfo(propagandaInfo);
} }
@Override public int copyPropagandaInfo(Long id) { @Override
PropagandaInfo propagandaInfo = propagandaInfoMapper.selectPropagandaInfoById(id); public int copyPropagandaInfo(Long id) {
propagandaInfo.setId(null); PropagandaInfo propagandaInfo = propagandaInfoMapper.selectPropagandaInfoById(id);
propagandaInfo.setCreateTime(DateUtils.getNowDate()); propagandaInfo.setId(null);
propagandaInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); propagandaInfo.setCreateTime(LocalDateTime.now());
propagandaInfo.setUpdateTime(null); propagandaInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
propagandaInfo.setUpdateBy(null); propagandaInfo.setUpdateTime(null);
propagandaInfo.setPropagandaCode(propagandaInfo.getPropagandaCode() + "-COPY"); propagandaInfo.setUpdateBy(null);
propagandaInfo.setPropagandaStatus("CREATE_COMPLETE"); propagandaInfo.setPropagandaCode(propagandaInfo.getPropagandaCode() + "-COPY");
return propagandaInfoMapper.insertPropagandaInfo(propagandaInfo); propagandaInfo.setPropagandaStatus("CREATE_COMPLETE");
} return propagandaInfoMapper.insertPropagandaInfo(propagandaInfo);
}
@Override public int updateStatus(PropagandaUpdateDto propagandaInfo) { @Override
PropagandaInfo body = new PropagandaInfo(); public int updateStatus(PropagandaUpdateDto propagandaInfo) {
body.setId(propagandaInfo.getId()); PropagandaInfo body = new PropagandaInfo();
body.setPropagandaStatus(propagandaInfo.getPropagandaStatus()); body.setId(propagandaInfo.getId());
return propagandaInfoMapper.updatePropagandaInfo(body); body.setPropagandaStatus(propagandaInfo.getPropagandaStatus());
} return propagandaInfoMapper.updatePropagandaInfo(body);
}
/** /**
* 批量删除宣教库管理 * 批量删除宣教库管理
* *
* @param ids 需要删除的宣教库管理主键 * @param ids 需要删除的宣教库管理主键
@ -111,7 +114,8 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
return propagandaInfoMapper.deletePropagandaInfoById(id); return propagandaInfoMapper.deletePropagandaInfoById(id);
} }
@Override public List<DepartmentVO> selectNumByDept(DepartmentDTO departmentDto) { @Override
return propagandaInfoMapper.selectNumByDept(departmentDto); public List<DepartmentVO> selectNumByDept(DepartmentDTO departmentDto) {
} return propagandaInfoMapper.selectNumByDept(departmentDto);
}
} }

View File

@ -1,12 +1,13 @@
package com.xinelu.manage.service.propagandamaterials.impl; package com.xinelu.manage.service.propagandamaterials.impl;
import java.util.List;
import com.xinelu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xinelu.manage.mapper.propagandamaterials.PropagandaMaterialsMapper;
import com.xinelu.manage.domain.propagandamaterials.PropagandaMaterials; import com.xinelu.manage.domain.propagandamaterials.PropagandaMaterials;
import com.xinelu.manage.mapper.propagandamaterials.PropagandaMaterialsMapper;
import com.xinelu.manage.service.propagandamaterials.IPropagandaMaterialsService; import com.xinelu.manage.service.propagandamaterials.IPropagandaMaterialsService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 宣教素材关系Service业务层处理 * 宣教素材关系Service业务层处理
@ -49,8 +50,8 @@ public class PropagandaMaterialsServiceImpl implements IPropagandaMaterialsServi
*/ */
@Override @Override
public int insertPropagandaMaterials(PropagandaMaterials propagandaMaterials) { public int insertPropagandaMaterials(PropagandaMaterials propagandaMaterials) {
propagandaMaterials.setCreateTime(DateUtils.getNowDate()); propagandaMaterials.setCreateTime(LocalDateTime.now());
return propagandaMaterialsMapper.insertPropagandaMaterials(propagandaMaterials); return propagandaMaterialsMapper.insertPropagandaMaterials(propagandaMaterials);
} }
/** /**
@ -61,7 +62,7 @@ public class PropagandaMaterialsServiceImpl implements IPropagandaMaterialsServi
*/ */
@Override @Override
public int updatePropagandaMaterials(PropagandaMaterials propagandaMaterials) { public int updatePropagandaMaterials(PropagandaMaterials propagandaMaterials) {
propagandaMaterials.setUpdateTime(DateUtils.getNowDate()); propagandaMaterials.setUpdateTime(LocalDateTime.now());
return propagandaMaterialsMapper.updatePropagandaMaterials(propagandaMaterials); return propagandaMaterialsMapper.updatePropagandaMaterials(propagandaMaterials);
} }

View File

@ -1,7 +1,6 @@
package com.xinelu.manage.service.questioninfo.impl; package com.xinelu.manage.service.questioninfo.impl;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.manage.domain.questioninfo.QuestionInfo; import com.xinelu.manage.domain.questioninfo.QuestionInfo;
@ -20,6 +19,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -91,7 +91,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
//新增问卷表 //新增问卷表
QuestionInfo questionInfo = new QuestionInfo(); QuestionInfo questionInfo = new QuestionInfo();
BeanUtils.copyBeanProp(questionInfo, question); BeanUtils.copyBeanProp(questionInfo, question);
questionInfo.setCreateTime(DateUtils.getNowDate()); questionInfo.setCreateTime(LocalDateTime.now());
questionInfo.setCreateBy(SecurityUtils.getUsername()); questionInfo.setCreateBy(SecurityUtils.getUsername());
int questionCount = questionInfoMapper.insertQuestionInfo(questionInfo); int questionCount = questionInfoMapper.insertQuestionInfo(questionInfo);
if (questionCount <= 0) { if (questionCount <= 0) {
@ -106,7 +106,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
QuestionSubject saveQuestionSubject = new QuestionSubject(); QuestionSubject saveQuestionSubject = new QuestionSubject();
BeanUtils.copyBeanProp(saveQuestionSubject, questionSubject); BeanUtils.copyBeanProp(saveQuestionSubject, questionSubject);
saveQuestionSubject.setQuestionInfoId(questionInfo.getId()); saveQuestionSubject.setQuestionInfoId(questionInfo.getId());
saveQuestionSubject.setCreateTime(DateUtils.getNowDate()); saveQuestionSubject.setCreateTime(LocalDateTime.now());
saveQuestionSubject.setCreateBy(SecurityUtils.getUsername()); saveQuestionSubject.setCreateBy(SecurityUtils.getUsername());
questionSubjects.add(saveQuestionSubject); questionSubjects.add(saveQuestionSubject);
questionSubjectOptions.addAll(questionSubject.getQuestionSubjectOptionList()); questionSubjectOptions.addAll(questionSubject.getQuestionSubjectOptionList());
@ -123,7 +123,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
BeanUtils.copyBeanProp(saveQuestionSubjectOption, questionSubjectOption); BeanUtils.copyBeanProp(saveQuestionSubjectOption, questionSubjectOption);
QuestionSubject questionSubject = questionSubjects.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getQuestionNumber()) && questionSubjectOption.getQuestionNumber().compareTo(item.getQuestionNumber()) == 0).findFirst().orElse(new QuestionSubject()); QuestionSubject questionSubject = questionSubjects.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getQuestionNumber()) && questionSubjectOption.getQuestionNumber().compareTo(item.getQuestionNumber()) == 0).findFirst().orElse(new QuestionSubject());
saveQuestionSubjectOption.setQuestionnaireSubjectId(questionSubject.getId()); saveQuestionSubjectOption.setQuestionnaireSubjectId(questionSubject.getId());
saveQuestionSubjectOption.setCreateTime(DateUtils.getNowDate()); saveQuestionSubjectOption.setCreateTime(LocalDateTime.now());
saveQuestionSubjectOption.setCreateBy(SecurityUtils.getUsername()); saveQuestionSubjectOption.setCreateBy(SecurityUtils.getUsername());
saveQuestionSubjectOptions.add(saveQuestionSubjectOption); saveQuestionSubjectOptions.add(saveQuestionSubjectOption);
} }
@ -147,7 +147,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
//新增问卷表 //新增问卷表
QuestionInfo questionInfo = new QuestionInfo(); QuestionInfo questionInfo = new QuestionInfo();
BeanUtils.copyBeanProp(questionInfo, question); BeanUtils.copyBeanProp(questionInfo, question);
questionInfo.setUpdateTime(DateUtils.getNowDate()); questionInfo.setUpdateTime(LocalDateTime.now());
questionInfo.setUpdateBy(SecurityUtils.getUsername()); questionInfo.setUpdateBy(SecurityUtils.getUsername());
int questionCount = questionInfoMapper.updateQuestionInfo(questionInfo); int questionCount = questionInfoMapper.updateQuestionInfo(questionInfo);
if (questionCount <= 0) { if (questionCount <= 0) {
@ -177,7 +177,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
QuestionSubject saveQuestionSubject = new QuestionSubject(); QuestionSubject saveQuestionSubject = new QuestionSubject();
BeanUtils.copyBeanProp(saveQuestionSubject, questionSubject); BeanUtils.copyBeanProp(saveQuestionSubject, questionSubject);
saveQuestionSubject.setQuestionInfoId(questionInfo.getId()); saveQuestionSubject.setQuestionInfoId(questionInfo.getId());
saveQuestionSubject.setCreateTime(DateUtils.getNowDate()); saveQuestionSubject.setCreateTime(LocalDateTime.now());
saveQuestionSubject.setCreateBy(SecurityUtils.getUsername()); saveQuestionSubject.setCreateBy(SecurityUtils.getUsername());
questionSubjects.add(saveQuestionSubject); questionSubjects.add(saveQuestionSubject);
questionSubjectOptions.addAll(questionSubject.getQuestionSubjectOptionList()); questionSubjectOptions.addAll(questionSubject.getQuestionSubjectOptionList());
@ -193,7 +193,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
BeanUtils.copyBeanProp(saveQuestionSubjectOption, questionSubjectOption); BeanUtils.copyBeanProp(saveQuestionSubjectOption, questionSubjectOption);
QuestionSubject questionSubject = questionSubjects.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getQuestionNumber()) && questionSubjectOption.getQuestionNumber().compareTo(item.getQuestionNumber()) == 0).findFirst().orElse(new QuestionSubject()); QuestionSubject questionSubject = questionSubjects.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getQuestionNumber()) && questionSubjectOption.getQuestionNumber().compareTo(item.getQuestionNumber()) == 0).findFirst().orElse(new QuestionSubject());
saveQuestionSubjectOption.setQuestionnaireSubjectId(questionSubject.getId()); saveQuestionSubjectOption.setQuestionnaireSubjectId(questionSubject.getId());
saveQuestionSubjectOption.setCreateTime(DateUtils.getNowDate()); saveQuestionSubjectOption.setCreateTime(LocalDateTime.now());
saveQuestionSubjectOption.setCreateBy(SecurityUtils.getUsername()); saveQuestionSubjectOption.setCreateBy(SecurityUtils.getUsername());
saveQuestionSubjectOptions.add(saveQuestionSubjectOption); saveQuestionSubjectOptions.add(saveQuestionSubjectOption);
} }

View File

@ -1,12 +1,12 @@
package com.xinelu.manage.service.questionsubject.impl; package com.xinelu.manage.service.questionsubject.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.questionsubject.QuestionSubject; import com.xinelu.manage.domain.questionsubject.QuestionSubject;
import com.xinelu.manage.mapper.questionsubject.QuestionSubjectMapper; import com.xinelu.manage.mapper.questionsubject.QuestionSubjectMapper;
import com.xinelu.manage.service.questionsubject.IQuestionSubjectService; import com.xinelu.manage.service.questionsubject.IQuestionSubjectService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -51,7 +51,7 @@ public class QuestionSubjectServiceImpl implements IQuestionSubjectService {
*/ */
@Override @Override
public int insertQuestionSubject(QuestionSubject questionSubject) { public int insertQuestionSubject(QuestionSubject questionSubject) {
questionSubject.setCreateTime(DateUtils.getNowDate()); questionSubject.setCreateTime(LocalDateTime.now());
return questionSubjectMapper.insertQuestionSubject(questionSubject); return questionSubjectMapper.insertQuestionSubject(questionSubject);
} }
@ -63,7 +63,7 @@ public class QuestionSubjectServiceImpl implements IQuestionSubjectService {
*/ */
@Override @Override
public int updateQuestionSubject(QuestionSubject questionSubject) { public int updateQuestionSubject(QuestionSubject questionSubject) {
questionSubject.setUpdateTime(DateUtils.getNowDate()); questionSubject.setUpdateTime(LocalDateTime.now());
return questionSubjectMapper.updateQuestionSubject(questionSubject); return questionSubjectMapper.updateQuestionSubject(questionSubject);
} }

View File

@ -1,12 +1,12 @@
package com.xinelu.manage.service.questionsubjectoption.impl; package com.xinelu.manage.service.questionsubjectoption.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.questionsubjectoption.QuestionSubjectOption; import com.xinelu.manage.domain.questionsubjectoption.QuestionSubjectOption;
import com.xinelu.manage.mapper.questionsubjectoption.QuestionSubjectOptionMapper; import com.xinelu.manage.mapper.questionsubjectoption.QuestionSubjectOptionMapper;
import com.xinelu.manage.service.questionsubjectoption.IQuestionSubjectOptionService; import com.xinelu.manage.service.questionsubjectoption.IQuestionSubjectOptionService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -51,7 +51,7 @@ public class QuestionSubjectOptionServiceImpl implements IQuestionSubjectOptionS
*/ */
@Override @Override
public int insertQuestionSubjectOption(QuestionSubjectOption questionSubjectOption) { public int insertQuestionSubjectOption(QuestionSubjectOption questionSubjectOption) {
questionSubjectOption.setCreateTime(DateUtils.getNowDate()); questionSubjectOption.setCreateTime(LocalDateTime.now());
return questionSubjectOptionMapper.insertQuestionSubjectOption(questionSubjectOption); return questionSubjectOptionMapper.insertQuestionSubjectOption(questionSubjectOption);
} }
@ -63,7 +63,7 @@ public class QuestionSubjectOptionServiceImpl implements IQuestionSubjectOptionS
*/ */
@Override @Override
public int updateQuestionSubjectOption(QuestionSubjectOption questionSubjectOption) { public int updateQuestionSubjectOption(QuestionSubjectOption questionSubjectOption) {
questionSubjectOption.setUpdateTime(DateUtils.getNowDate()); questionSubjectOption.setUpdateTime(LocalDateTime.now());
return questionSubjectOptionMapper.updateQuestionSubjectOption(questionSubjectOption); return questionSubjectOptionMapper.updateQuestionSubjectOption(questionSubjectOption);
} }

View File

@ -3,7 +3,6 @@ package com.xinelu.manage.service.scriptInfo.impl;
import com.xinelu.common.config.SystemBusinessConfig; import com.xinelu.common.config.SystemBusinessConfig;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.file.FileUploadUtils; import com.xinelu.common.utils.file.FileUploadUtils;
import com.xinelu.common.utils.file.MimeTypeUtils; import com.xinelu.common.utils.file.MimeTypeUtils;
@ -16,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
@ -70,7 +70,7 @@ public class ScriptInfoServiceImpl implements IScriptInfoService {
} }
// 设置创建人与创建时间 // 设置创建人与创建时间
scriptInfo.setCreateBy(SecurityUtils.getUsername()); scriptInfo.setCreateBy(SecurityUtils.getUsername());
scriptInfo.setCreateTime(DateUtils.getNowDate()); scriptInfo.setCreateTime(LocalDateTime.now());
return scriptInfoMapper.insertScriptInfo(scriptInfo); return scriptInfoMapper.insertScriptInfo(scriptInfo);
} }
@ -90,7 +90,7 @@ public class ScriptInfoServiceImpl implements IScriptInfoService {
} }
// 不存在同名的话术名称或者名称未改变设置修改人和修改时间 // 不存在同名的话术名称或者名称未改变设置修改人和修改时间
scriptInfo.setUpdateBy(SecurityUtils.getUsername()); scriptInfo.setUpdateBy(SecurityUtils.getUsername());
scriptInfo.setUpdateTime(DateUtils.getNowDate()); scriptInfo.setUpdateTime(LocalDateTime.now());
// 进行更新操作 // 进行更新操作
return scriptInfoMapper.updateScriptInfo(scriptInfo); return scriptInfoMapper.updateScriptInfo(scriptInfo);
} }

View File

@ -3,7 +3,6 @@ package com.xinelu.manage.service.servicepackage.impl;
import com.xinelu.common.constant.Constants; import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.PageServiceUtil; import com.xinelu.common.utils.PageServiceUtil;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
@ -21,7 +20,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -72,11 +71,10 @@ public class ServicePackageServiceImpl implements IServicePackageService {
public TableDataInfo selectServicePackageList(ServicePackage servicePackage) { public TableDataInfo selectServicePackageList(ServicePackage servicePackage) {
pageServiceUtil.startPage(); pageServiceUtil.startPage();
List<ServicePackageVO> voList = servicePackageMapper.selectServicePackageLists(servicePackage); List<ServicePackageVO> voList = servicePackageMapper.selectServicePackageLists(servicePackage);
voList.stream().map(vo -> { voList.stream().peek(vo -> {
// 拼接服务包期限+服务包单位 // 拼接服务包期限+服务包单位
String packageTermAndUnit = vo.getPackageTerm() + vo.getPackageTermUnit(); String packageTermAndUnit = vo.getPackageTerm() + vo.getPackageTermUnit();
vo.setPackageTermAndUnit(packageTermAndUnit); vo.setPackageTermAndUnit(packageTermAndUnit);
return vo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return pageServiceUtil.getDataTable(voList); return pageServiceUtil.getDataTable(voList);
} }
@ -96,7 +94,7 @@ public class ServicePackageServiceImpl implements IServicePackageService {
throw new ServiceException("当前科室下服务包名称已存在"); throw new ServiceException("当前科室下服务包名称已存在");
} }
String username = SecurityUtils.getUsername(); String username = SecurityUtils.getUsername();
Date nowDate = DateUtils.getNowDate(); LocalDateTime nowDate = LocalDateTime.now();
// 初始化ServicePackage将servicePackageAddDTO赋值给ServicePackage新增服务包 // 初始化ServicePackage将servicePackageAddDTO赋值给ServicePackage新增服务包
ServicePackage servicePackage = new ServicePackage(); ServicePackage servicePackage = new ServicePackage();
BeanUtils.copyProperties(servicePackageAddDTO, servicePackage); BeanUtils.copyProperties(servicePackageAddDTO, servicePackage);
@ -128,7 +126,7 @@ public class ServicePackageServiceImpl implements IServicePackageService {
throw new ServiceException("当前科室下服务包名称已存在"); throw new ServiceException("当前科室下服务包名称已存在");
} }
String username = SecurityUtils.getUsername(); String username = SecurityUtils.getUsername();
Date nowDate = DateUtils.getNowDate(); LocalDateTime nowDate = LocalDateTime.now();
// 初始化ServicePackage将servicePackageAddDTO赋值给ServicePackage更新服务包 // 初始化ServicePackage将servicePackageAddDTO赋值给ServicePackage更新服务包
ServicePackage servicePackage = new ServicePackage(); ServicePackage servicePackage = new ServicePackage();
BeanUtils.copyProperties(servicePackageAddDTO, servicePackage); BeanUtils.copyProperties(servicePackageAddDTO, servicePackage);
@ -153,7 +151,7 @@ public class ServicePackageServiceImpl implements IServicePackageService {
/** /**
* 新增服务包方式 * 新增服务包方式
*/ */
private Long createServiceWay(ServicePackage servicePackage, ServicePackageContentVO vo, String username, Date nowDate) { private Long createServiceWay(ServicePackage servicePackage, ServicePackageContentVO vo, String username, LocalDateTime nowDate) {
Long serviceWayId = servicePackageContentMapper.countByPackageIdAndServiceWayName(servicePackage.getId(), vo.getServiceWayName()); Long serviceWayId = servicePackageContentMapper.countByPackageIdAndServiceWayName(servicePackage.getId(), vo.getServiceWayName());
if (serviceWayId == null) { if (serviceWayId == null) {
ServicePackageContent serviceWay = new ServicePackageContent(); ServicePackageContent serviceWay = new ServicePackageContent();
@ -173,7 +171,7 @@ public class ServicePackageServiceImpl implements IServicePackageService {
/** /**
* 新增服务包内容 * 新增服务包内容
*/ */
private Long createServiceContent(ServicePackage servicePackage, ServicePackageContentVO vo, Long serviceWayId, String username, Date nowDate) { private Long createServiceContent(ServicePackage servicePackage, ServicePackageContentVO vo, Long serviceWayId, String username, LocalDateTime nowDate) {
Long serviceContentId = servicePackageContentMapper.countByServiceWayIdAndServiceContent(serviceWayId, vo.getServiceContent()); Long serviceContentId = servicePackageContentMapper.countByServiceWayIdAndServiceContent(serviceWayId, vo.getServiceContent());
if (serviceContentId == null) { if (serviceContentId == null) {
ServicePackageContent serviceContent = new ServicePackageContent(); ServicePackageContent serviceContent = new ServicePackageContent();
@ -193,7 +191,7 @@ public class ServicePackageServiceImpl implements IServicePackageService {
/** /**
* 新增服务包频次 * 新增服务包频次
*/ */
private void createServiceFrequency(ServicePackage servicePackage, ServicePackageContentVO vo, Long serviceContentId, String username, Date nowDate) { private void createServiceFrequency(ServicePackage servicePackage, ServicePackageContentVO vo, Long serviceContentId, String username, LocalDateTime nowDate) {
if (servicePackageContentMapper.countByServiceContentIdAndServiceFrequency(serviceContentId, vo) > 0) { if (servicePackageContentMapper.countByServiceContentIdAndServiceFrequency(serviceContentId, vo) > 0) {
throw new ServiceException("不能重复添加服务包内容"); throw new ServiceException("不能重复添加服务包内容");
} }

View File

@ -1,12 +1,12 @@
package com.xinelu.manage.service.servicepackagecontent.impl; package com.xinelu.manage.service.servicepackagecontent.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent; import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent;
import com.xinelu.manage.mapper.servicepackagecontent.ServicePackageContentMapper; import com.xinelu.manage.mapper.servicepackagecontent.ServicePackageContentMapper;
import com.xinelu.manage.service.servicepackagecontent.IServicePackageContentService; import com.xinelu.manage.service.servicepackagecontent.IServicePackageContentService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
@ -50,7 +50,7 @@ public class ServicePackageContentServiceImpl implements IServicePackageContentS
*/ */
@Override @Override
public int insertServicePackageContent(ServicePackageContent servicePackageContent) { public int insertServicePackageContent(ServicePackageContent servicePackageContent) {
servicePackageContent.setCreateTime(DateUtils.getNowDate()); servicePackageContent.setCreateTime(LocalDateTime.now());
return servicePackageContentMapper.insertServicePackageContent(servicePackageContent); return servicePackageContentMapper.insertServicePackageContent(servicePackageContent);
} }
@ -62,7 +62,7 @@ public class ServicePackageContentServiceImpl implements IServicePackageContentS
*/ */
@Override @Override
public int updateServicePackageContent(ServicePackageContent servicePackageContent) { public int updateServicePackageContent(ServicePackageContent servicePackageContent) {
servicePackageContent.setUpdateTime(DateUtils.getNowDate()); servicePackageContent.setUpdateTime(LocalDateTime.now());
return servicePackageContentMapper.updateServicePackageContent(servicePackageContent); return servicePackageContentMapper.updateServicePackageContent(servicePackageContent);
} }

View File

@ -17,12 +17,12 @@ import com.xinelu.manage.service.servicewaycontent.IServiceWayContentService;
import com.xinelu.manage.vo.servicewaycontent.ServiceWayContentAndFrequencyVO; import com.xinelu.manage.vo.servicewaycontent.ServiceWayContentAndFrequencyVO;
import com.xinelu.manage.vo.servicewaycontent.ServiceWayContentAndNumVO; import com.xinelu.manage.vo.servicewaycontent.ServiceWayContentAndNumVO;
import com.xinelu.manage.vo.servicewaycontent.ServiceWayContentVO; import com.xinelu.manage.vo.servicewaycontent.ServiceWayContentVO;
import com.xinelu.system.mapper.SysDictDataMapper;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -75,7 +75,6 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
// 判断服务内容在服务内容表中是否存在 // 判断服务内容在服务内容表中是否存在
ServiceWayContentVO serviceWayContentVO = serviceWayContentMapper.countByWayIdAndContent(serviceWayContentAddDTO.getServiceWayId(), serviceWayContentAddDTO.getServiceContent()); ServiceWayContentVO serviceWayContentVO = serviceWayContentMapper.countByWayIdAndContent(serviceWayContentAddDTO.getServiceWayId(), serviceWayContentAddDTO.getServiceContent());
String username = SecurityUtils.getUsername(); String username = SecurityUtils.getUsername();
Date date = DateUtils.getNowDate();
ServiceWayContent serviceFrequency = new ServiceWayContent(); ServiceWayContent serviceFrequency = new ServiceWayContent();
// 如果服务内容在服务内容表中存在 // 如果服务内容在服务内容表中存在
if (ObjectUtils.isNotEmpty(serviceWayContentVO)) { if (ObjectUtils.isNotEmpty(serviceWayContentVO)) {
@ -95,7 +94,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
serviceFrequency.setServiceFrequencyStart(serviceWayContentAddDTO.getServiceFrequencyStart()); serviceFrequency.setServiceFrequencyStart(serviceWayContentAddDTO.getServiceFrequencyStart());
serviceFrequency.setServiceFrequencyEnd(serviceWayContentAddDTO.getServiceFrequencyEnd()); serviceFrequency.setServiceFrequencyEnd(serviceWayContentAddDTO.getServiceFrequencyEnd());
serviceFrequency.setCreateBy(username); serviceFrequency.setCreateBy(username);
serviceFrequency.setCreateTime(date); serviceFrequency.setCreateTime(LocalDateTime.now());
if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) { if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) {
throw new ServiceException("新增服务频次失败"); throw new ServiceException("新增服务频次失败");
} }
@ -107,7 +106,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
serviceContent.setServiceWayId(serviceWayContentAddDTO.getServiceWayId()); serviceContent.setServiceWayId(serviceWayContentAddDTO.getServiceWayId());
serviceContent.setServiceContent(serviceWayContentAddDTO.getServiceContent()); serviceContent.setServiceContent(serviceWayContentAddDTO.getServiceContent());
serviceContent.setCreateBy(username); serviceContent.setCreateBy(username);
serviceContent.setCreateTime(date); serviceContent.setCreateTime(LocalDateTime.now());
if (serviceWayContentMapper.insertServiceWayContent(serviceContent) <= 0) { if (serviceWayContentMapper.insertServiceWayContent(serviceContent) <= 0) {
throw new ServiceException("新增服务内容失败"); throw new ServiceException("新增服务内容失败");
} }
@ -119,7 +118,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
serviceFrequency.setServiceFrequencyStart(serviceWayContentAddDTO.getServiceFrequencyStart()); serviceFrequency.setServiceFrequencyStart(serviceWayContentAddDTO.getServiceFrequencyStart());
serviceFrequency.setServiceFrequencyEnd(serviceWayContentAddDTO.getServiceFrequencyEnd()); serviceFrequency.setServiceFrequencyEnd(serviceWayContentAddDTO.getServiceFrequencyEnd());
serviceFrequency.setCreateBy(username); serviceFrequency.setCreateBy(username);
serviceFrequency.setCreateTime(date); serviceFrequency.setCreateTime(LocalDateTime.now());
serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort()); serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort());
if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) { if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) {
throw new ServiceException("新增服务频次失败"); throw new ServiceException("新增服务频次失败");
@ -138,7 +137,6 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int updateServiceWayContent(ServiceWayContentEditDTO serviceWayContentEditDTO) { public int updateServiceWayContent(ServiceWayContentEditDTO serviceWayContentEditDTO) {
String username = SecurityUtils.getUsername(); String username = SecurityUtils.getUsername();
Date date = DateUtils.getNowDate();
// 获取当前的服务频次记录 // 获取当前的服务频次记录
ServiceWayContent currentFrequency = serviceWayContentMapper.selectServiceWayContentById(serviceWayContentEditDTO.getId()); ServiceWayContent currentFrequency = serviceWayContentMapper.selectServiceWayContentById(serviceWayContentEditDTO.getId());
if (currentFrequency == null) { if (currentFrequency == null) {
@ -165,7 +163,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
newServiceContent.setServiceContent(serviceWayContentEditDTO.getServiceContent()); newServiceContent.setServiceContent(serviceWayContentEditDTO.getServiceContent());
newServiceContent.setServiceType(ServiceWayContentServiceType.SERVICE_CONTENT.toString()); newServiceContent.setServiceType(ServiceWayContentServiceType.SERVICE_CONTENT.toString());
newServiceContent.setCreateBy(username); newServiceContent.setCreateBy(username);
newServiceContent.setCreateTime(date); newServiceContent.setCreateTime(LocalDateTime.now());
serviceWayContentMapper.insertServiceWayContent(newServiceContent); serviceWayContentMapper.insertServiceWayContent(newServiceContent);
// 更新当前频次记录的ServiceContentId为新创建的服务内容ID // 更新当前频次记录的ServiceContentId为新创建的服务内容ID
currentFrequency.setServiceContentId(newServiceContent.getId()); currentFrequency.setServiceContentId(newServiceContent.getId());
@ -196,7 +194,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
currentFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart()); currentFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart());
currentFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd()); currentFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd());
currentFrequency.setUpdateBy(username); currentFrequency.setUpdateBy(username);
currentFrequency.setUpdateTime(date); currentFrequency.setUpdateTime(LocalDateTime.now());
// 执行更新操作 // 执行更新操作
if (serviceWayContentMapper.updateServiceFrequency(currentFrequency) <= 0) { if (serviceWayContentMapper.updateServiceFrequency(currentFrequency) <= 0) {
@ -259,7 +257,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
serviceWayContent.setServiceWayCode(Constants.SERVICE_MODE_ENCODING + systemCodeUtil.generateDepartCode(Constants.SERVICE_MODE_ENCODING)); serviceWayContent.setServiceWayCode(Constants.SERVICE_MODE_ENCODING + systemCodeUtil.generateDepartCode(Constants.SERVICE_MODE_ENCODING));
serviceWayContent.setServiceType(ServiceWayContentServiceType.SERVICE_WRY.toString()); serviceWayContent.setServiceType(ServiceWayContentServiceType.SERVICE_WRY.toString());
serviceWayContent.setCreateBy(SecurityUtils.getUsername()); serviceWayContent.setCreateBy(SecurityUtils.getUsername());
serviceWayContent.setCreateTime(DateUtils.getNowDate()); serviceWayContent.setCreateTime(LocalDateTime.now());
return serviceWayContentMapper.insertServiceWayContent(serviceWayContent); return serviceWayContentMapper.insertServiceWayContent(serviceWayContent);
} }
@ -280,7 +278,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
} }
// 如果不存在执行修改功能 // 如果不存在执行修改功能
serviceWayContent.setUpdateBy(SecurityUtils.getUsername()); serviceWayContent.setUpdateBy(SecurityUtils.getUsername());
serviceWayContent.setUpdateTime(DateUtils.getNowDate()); serviceWayContent.setUpdateTime(LocalDateTime.now());
return serviceWayContentMapper.updateServiceWay(serviceWayContent); return serviceWayContentMapper.updateServiceWay(serviceWayContent);
} }

View File

@ -1,13 +1,14 @@
package com.xinelu.manage.service.signpatientinformed.impl; package com.xinelu.manage.service.signpatientinformed.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.signpatientinformed.SignPatientInformed; import com.xinelu.manage.domain.signpatientinformed.SignPatientInformed;
import com.xinelu.manage.mapper.signpatientinformed.SignPatientInformedMapper; import com.xinelu.manage.mapper.signpatientinformed.SignPatientInformedMapper;
import com.xinelu.manage.service.signpatientinformed.ISignPatientInformedService; import com.xinelu.manage.service.signpatientinformed.ISignPatientInformedService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 签约知情同意书信息Service业务层处理 * 签约知情同意书信息Service业务层处理
* *
@ -49,8 +50,8 @@ public class SignPatientInformedServiceImpl implements ISignPatientInformedServi
*/ */
@Override @Override
public int insertSignPatientInformed(SignPatientInformed signPatientInformed) { public int insertSignPatientInformed(SignPatientInformed signPatientInformed) {
signPatientInformed.setCreateTime(DateUtils.getNowDate()); signPatientInformed.setCreateTime(LocalDateTime.now());
return signPatientInformedMapper.insertSignPatientInformed(signPatientInformed); return signPatientInformedMapper.insertSignPatientInformed(signPatientInformed);
} }
/** /**
@ -61,7 +62,7 @@ public class SignPatientInformedServiceImpl implements ISignPatientInformedServi
*/ */
@Override @Override
public int updateSignPatientInformed(SignPatientInformed signPatientInformed) { public int updateSignPatientInformed(SignPatientInformed signPatientInformed) {
signPatientInformed.setUpdateTime(DateUtils.getNowDate()); signPatientInformed.setUpdateTime(LocalDateTime.now());
return signPatientInformedMapper.updateSignPatientInformed(signPatientInformed); return signPatientInformedMapper.updateSignPatientInformed(signPatientInformed);
} }

View File

@ -1,12 +1,13 @@
package com.xinelu.manage.service.signpatientpackage.impl; package com.xinelu.manage.service.signpatientpackage.impl;
import java.util.List;
import com.xinelu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xinelu.manage.mapper.signpatientpackage.SignPatientPackageMapper;
import com.xinelu.manage.domain.signpatientpackage.SignPatientPackage; import com.xinelu.manage.domain.signpatientpackage.SignPatientPackage;
import com.xinelu.manage.mapper.signpatientpackage.SignPatientPackageMapper;
import com.xinelu.manage.service.signpatientpackage.ISignPatientPackageService; import com.xinelu.manage.service.signpatientpackage.ISignPatientPackageService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 签约患者服务包信息Service业务层处理 * 签约患者服务包信息Service业务层处理
@ -49,7 +50,7 @@ public class SignPatientPackageServiceImpl implements ISignPatientPackageService
*/ */
@Override @Override
public int insertSignPatientPackage(SignPatientPackage signPatientPackage) { public int insertSignPatientPackage(SignPatientPackage signPatientPackage) {
signPatientPackage.setCreateTime(DateUtils.getNowDate()); signPatientPackage.setCreateTime(LocalDateTime.now());
return signPatientPackageMapper.insertSignPatientPackage(signPatientPackage); return signPatientPackageMapper.insertSignPatientPackage(signPatientPackage);
} }
@ -61,7 +62,7 @@ public class SignPatientPackageServiceImpl implements ISignPatientPackageService
*/ */
@Override @Override
public int updateSignPatientPackage(SignPatientPackage signPatientPackage) { public int updateSignPatientPackage(SignPatientPackage signPatientPackage) {
signPatientPackage.setUpdateTime(DateUtils.getNowDate()); signPatientPackage.setUpdateTime(LocalDateTime.now());
return signPatientPackageMapper.updateSignPatientPackage(signPatientPackage); return signPatientPackageMapper.updateSignPatientPackage(signPatientPackage);
} }

View File

@ -1,12 +1,13 @@
package com.xinelu.manage.service.signpatientpackagehardware.impl; package com.xinelu.manage.service.signpatientpackagehardware.impl;
import java.util.List;
import com.xinelu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xinelu.manage.mapper.signpatientpackagehardware.SignPatientPackageHardwareMapper;
import com.xinelu.manage.domain.signpatientpackagehardware.SignPatientPackageHardware; import com.xinelu.manage.domain.signpatientpackagehardware.SignPatientPackageHardware;
import com.xinelu.manage.mapper.signpatientpackagehardware.SignPatientPackageHardwareMapper;
import com.xinelu.manage.service.signpatientpackagehardware.ISignPatientPackageHardwareService; import com.xinelu.manage.service.signpatientpackagehardware.ISignPatientPackageHardwareService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* 签约患者服务包硬件信息Service业务层处理 * 签约患者服务包硬件信息Service业务层处理
@ -49,8 +50,8 @@ public class SignPatientPackageHardwareServiceImpl implements ISignPatientPackag
*/ */
@Override @Override
public int insertSignPatientPackageHardware(SignPatientPackageHardware signPatientPackageHardware) { public int insertSignPatientPackageHardware(SignPatientPackageHardware signPatientPackageHardware) {
signPatientPackageHardware.setCreateTime(DateUtils.getNowDate()); signPatientPackageHardware.setCreateTime(LocalDateTime.now());
return signPatientPackageHardwareMapper.insertSignPatientPackageHardware(signPatientPackageHardware); return signPatientPackageHardwareMapper.insertSignPatientPackageHardware(signPatientPackageHardware);
} }
/** /**
@ -61,7 +62,7 @@ public class SignPatientPackageHardwareServiceImpl implements ISignPatientPackag
*/ */
@Override @Override
public int updateSignPatientPackageHardware(SignPatientPackageHardware signPatientPackageHardware) { public int updateSignPatientPackageHardware(SignPatientPackageHardware signPatientPackageHardware) {
signPatientPackageHardware.setUpdateTime(DateUtils.getNowDate()); signPatientPackageHardware.setUpdateTime(LocalDateTime.now());
return signPatientPackageHardwareMapper.updateSignPatientPackageHardware(signPatientPackageHardware); return signPatientPackageHardwareMapper.updateSignPatientPackageHardware(signPatientPackageHardware);
} }

View File

@ -23,174 +23,174 @@ import com.xinelu.manage.service.signpatientrecord.ISignPatientRecordService;
import com.xinelu.manage.vo.signpatientrecord.SignPatientInfoVo; import com.xinelu.manage.vo.signpatientrecord.SignPatientInfoVo;
import com.xinelu.manage.vo.signpatientrecord.SignPatientListVo; import com.xinelu.manage.vo.signpatientrecord.SignPatientListVo;
import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo; import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo;
import java.util.Calendar;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Calendar;
import java.util.List;
/** /**
* @author haown * @author haown
* @description 针对表sign_patient_record(签约记录表)的数据库操作Service实现 * @description 针对表sign_patient_record(签约记录表)的数据库操作Service实现
* @createDate 2024-02-28 15:05:02 * @createDate 2024-02-28 15:05:02
*/ */
@Service @Service
public class SignPatientRecordServiceImpl implements ISignPatientRecordService { public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
@Resource @Resource
private SignPatientRecordMapper signPatientRecordMapper; private SignPatientRecordMapper signPatientRecordMapper;
@Resource @Resource
private SignPatientPackageMapper signPatientPackageMapper; private SignPatientPackageMapper signPatientPackageMapper;
@Resource @Resource
private SignPatientPackageHardwareMapper hardwareMapper; private SignPatientPackageHardwareMapper hardwareMapper;
@Resource @Resource
private SignPatientInformedMapper informedMapper; private SignPatientInformedMapper informedMapper;
@Resource @Resource
private PatientInfoMapper patientInfoMapper; private PatientInfoMapper patientInfoMapper;
@Resource @Resource
private SignPatientPackageHardwareMapper signPatientPackageHardwareMapper; private SignPatientPackageHardwareMapper signPatientPackageHardwareMapper;
@Resource @Resource
private SignPatientInformedMapper signPatientInformedMapper; private SignPatientInformedMapper signPatientInformedMapper;
@Override public List<SignPatientListVo> selectList(SignPatientListDto signPatientRecord) { @Override
return signPatientRecordMapper.selectList(signPatientRecord); public List<SignPatientListVo> selectList(SignPatientListDto signPatientRecord) {
} return signPatientRecordMapper.selectList(signPatientRecord);
}
@Override public SignPatientInfoVo getByRecordId(Long id) { @Override
SignPatientInfoVo signPatientInfoVo = signPatientRecordMapper.getByRecordId(id); public SignPatientInfoVo getByRecordId(Long id) {
// 根据签约记录主键查询设备列表 SignPatientInfoVo signPatientInfoVo = signPatientRecordMapper.getByRecordId(id);
SignPatientPackageHardware queryDevice = new SignPatientPackageHardware(); // 根据签约记录主键查询设备列表
queryDevice.setSignPatientRecordId(id); SignPatientPackageHardware queryDevice = new SignPatientPackageHardware();
List<SignPatientPackageHardware> devices = signPatientPackageHardwareMapper.selectSignPatientPackageHardwareList(queryDevice); queryDevice.setSignPatientRecordId(id);
signPatientInfoVo.setSignDevices(devices); List<SignPatientPackageHardware> devices = signPatientPackageHardwareMapper.selectSignPatientPackageHardwareList(queryDevice);
signPatientInfoVo.setSignDevices(devices);
SignPatientInformed signPatientInformed = new SignPatientInformed(); SignPatientInformed signPatientInformed = new SignPatientInformed();
signPatientInformed.setSignPatientRecordId(id); signPatientInformed.setSignPatientRecordId(id);
List<SignPatientInformed> informeds = signPatientInformedMapper.selectSignPatientInformedList(signPatientInformed); List<SignPatientInformed> informeds = signPatientInformedMapper.selectSignPatientInformedList(signPatientInformed);
signPatientInfoVo.setSignPatientInformeds(informeds); signPatientInfoVo.setSignPatientInformeds(informeds);
return signPatientInfoVo; return signPatientInfoVo;
} }
@Override public List<SignPatientRecordVo> getByPatient(Long patientId) { @Override
return signPatientRecordMapper.getByPatient(patientId); public List<SignPatientRecordVo> getByPatient(Long patientId) {
} return signPatientRecordMapper.getByPatient(patientId);
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int add(SignPatientAddDto body) { public int add(SignPatientAddDto body) {
SignPatientPackage signPatientPackage = body.getSignPackage(); SignPatientPackage signPatientPackage = body.getSignPackage();
if (ObjectUtils.isNotEmpty(body.getRecord())) { if (ObjectUtils.isNotEmpty(body.getRecord())) {
SignPatientRecord signPatientRecord = body.getRecord(); SignPatientRecord signPatientRecord = body.getRecord();
signPatientRecord.setId(null); signPatientRecord.setId(null);
if (signPatientRecord.getPatientId() == null) { if (signPatientRecord.getPatientId() == null) {
throw new ServiceException("数据错误"); throw new ServiceException("数据错误");
} }
PatientInfo patient = patientInfoMapper.selectPatientInfoById(signPatientRecord.getPatientId()); PatientInfo patient = patientInfoMapper.selectPatientInfoById(signPatientRecord.getPatientId());
if (ObjectUtils.isEmpty(patient)) { if (ObjectUtils.isEmpty(patient)) {
throw new ServiceException("请选择签约居民"); throw new ServiceException("请选择签约居民");
} }
signPatientRecord.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_CENTER); signPatientRecord.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_CENTER);
signPatientRecord.setDelFlag(0); signPatientRecord.setDelFlag(0);
signPatientRecord.setPaymentStatus(PaymentStatusConstants.UNPAID_FEES); signPatientRecord.setPaymentStatus(PaymentStatusConstants.UNPAID_FEES);
signPatientRecord.setSignTime(DateUtils.getNowDate()); signPatientRecord.setSignTime(LocalDateTime.now());
signPatientRecord.setSignStatus(SignRecordServiceStatusConstants.IN_SIGN); signPatientRecord.setSignStatus(SignRecordServiceStatusConstants.IN_SIGN);
if (signPatientPackage != null) {
signPatientRecord.setPrice(signPatientPackage.getPackagePrice());
} else {
throw new ServiceException("请选择服务包");
}
// 签约信息保存到患者表
patient.setSignPatientRecordId(signPatientRecord.getId());
patient.setSignStatus(SignRecordServiceStatusConstants.IN_SIGN);
patient.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_CENTER);
patient.setSignTime(LocalDateTime.now());
patientInfoMapper.updatePatientInfo(patient);
// 保存签约记录
int flag = signPatientRecordMapper.insert(signPatientRecord);
if (flag > 0) {
// 保存签约服务包信息
signPatientPackage.setSignPatientRecordId(signPatientRecord.getId());
signPatientPackage.setPatientId(signPatientRecord.getPatientId());
signPatientPackage.setPackagePaymentStatus(PaymentStatusConstants.UNPAID_FEES);
if (signPatientPackage.getServiceStartTime() == null) {
signPatientPackage.setServiceStartTime(DateUtils.parseDate(DateFormatUtils.format(DateUtils.getNowDate(), "yyyy-MM-dd") + " 00:00:00"));
Calendar calendar = Calendar.getInstance();
// 将日期设置为1号每次计算都从第一天开始
calendar.setTime(DateUtils.getNowDate());
// 添加一个月
calendar.add(Calendar.MONTH, signPatientPackage.getServiceCycle());
// 再减去一天
calendar.add(Calendar.DATE, -1);
signPatientPackage.setServiceEndTime(DateUtils.parseDate(DateFormatUtils.format(calendar.getTime(), "yyyy-MM-dd") + " 23:59:59"));
} else {
signPatientPackage.setServiceStartTime(DateUtils.parseDate(DateFormatUtils.format(signPatientPackage.getServiceStartTime(), "yyyy-MM-dd") + " 00:00:00"));
if (signPatientPackage.getServiceStartTime() == null) {
Calendar calendar = Calendar.getInstance();
// 将日期设置为1号每次计算都从第一天开始
calendar.setTime(signPatientPackage.getServiceStartTime());
// 添加一个月
calendar.add(Calendar.MONTH, signPatientPackage.getServiceCycle());
// 再减去一天
calendar.add(Calendar.DATE, -1);
signPatientPackage.setServiceEndTime(DateUtils.parseDate(DateFormatUtils.format(calendar.getTime(), "yyyy-MM-dd") + " 23:59:59"));
} else {
signPatientPackage.setServiceEndTime(DateUtils.parseDate(DateFormatUtils.format(signPatientPackage.getServiceEndTime(), "yyyy-MM-dd") + " 23:59:59"));
}
}
signPatientPackageMapper.insertSignPatientPackage(signPatientPackage);
// 保存硬件
if (!CollectionUtils.isEmpty(body.getDevices())) {
for (SignPatientPackageHardware hardware : body.getDevices()) {
hardware.setSignPatientRecordId(signPatientRecord.getId());
hardwareMapper.insertSignPatientPackageHardware(hardware);
}
}
// 保存告知书
if (!CollectionUtils.isEmpty(body.getInformeds())) {
for (SignPatientInformed informed : body.getInformeds()) {
informed.setSignPatientRecordId(signPatientRecord.getId());
informed.setPatientId(signPatientRecord.getPatientId());
informedMapper.insertSignPatientInformed(informed);
}
}
}
return flag;
}
return 0;
}
if (signPatientPackage != null) { @Override
signPatientRecord.setPrice(signPatientPackage.getPackagePrice()); @Transactional(rollbackFor = Exception.class)
} else { public int updateSignStatus(SignPatientStatusDto patientCancelSignDto) {
throw new ServiceException("请选择服务包"); if (patientCancelSignDto.getPatientId() == null) {
} throw new ServiceException("居民主键不能为空");
// 签约信息保存到患者表 }
patient.setSignPatientRecordId(signPatientRecord.getId()); // 修改签约记录状态
patient.setSignStatus(SignRecordServiceStatusConstants.IN_SIGN); SignPatientRecord signRecord = new SignPatientRecord();
patient.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_CENTER); signRecord.setId(patientCancelSignDto.getId());
patient.setSignTime(DateUtils.getNowDate()); signRecord.setSignStatus(patientCancelSignDto.getSignStatus());
patientInfoMapper.updatePatientInfo(patient); signRecord.setServiceStatus(patientCancelSignDto.getServiceStatus());
// 保存签约记录 signRecord.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
int flag = signPatientRecordMapper.insert(signPatientRecord); signRecord.setUpdateTime(LocalDateTime.now());
if (flag > 0) { signRecord.setSeparateReason(patientCancelSignDto.getSeparateReason());
// 保存签约服务包信息 if (StringUtils.equals(SignRecordServiceStatusConstants.SEPARATE_SIGN, patientCancelSignDto.getSignStatus())) {
if (signPatientPackage != null) {
signPatientPackage.setSignPatientRecordId(signPatientRecord.getId());
signPatientPackage.setPatientId(signPatientRecord.getPatientId());
signPatientPackage.setPackagePaymentStatus(PaymentStatusConstants.UNPAID_FEES);
if (signPatientPackage.getServiceStartTime() == null) {
signPatientPackage.setServiceStartTime(DateUtils.parseDate(DateFormatUtils.format(DateUtils.getNowDate(), "yyyy-MM-dd") + " 00:00:00"));
Calendar calendar = Calendar.getInstance();
// 将日期设置为1号每次计算都从第一天开始
calendar.setTime(DateUtils.getNowDate());
// 添加一个月
calendar.add(Calendar.MONTH, signPatientPackage.getServiceCycle());
// 再减去一天
calendar.add(Calendar.DATE, -1);
signPatientPackage.setServiceEndTime(DateUtils.parseDate(DateFormatUtils.format(calendar.getTime(), "yyyy-MM-dd") + " 23:59:59"));
} else {
signPatientPackage.setServiceStartTime(DateUtils.parseDate(DateFormatUtils.format(signPatientPackage.getServiceStartTime(), "yyyy-MM-dd") + " 00:00:00"));
if (signPatientPackage.getServiceStartTime() == null) {
Calendar calendar = Calendar.getInstance();
// 将日期设置为1号每次计算都从第一天开始
calendar.setTime(signPatientPackage.getServiceStartTime());
// 添加一个月
calendar.add(Calendar.MONTH, signPatientPackage.getServiceCycle());
// 再减去一天
calendar.add(Calendar.DATE, -1);
signPatientPackage.setServiceEndTime(DateUtils.parseDate(DateFormatUtils.format(calendar.getTime(), "yyyy-MM-dd") + " 23:59:59"));
} else {
signPatientPackage.setServiceEndTime(DateUtils.parseDate(DateFormatUtils.format(signPatientPackage.getServiceEndTime(), "yyyy-MM-dd") + " 23:59:59"));
}
}
signPatientPackageMapper.insertSignPatientPackage(signPatientPackage);
}
// 保存硬件
if (!CollectionUtils.isEmpty(body.getDevices())) {
for(SignPatientPackageHardware hardware : body.getDevices()) {
hardware.setSignPatientRecordId(signPatientRecord.getId());
hardwareMapper.insertSignPatientPackageHardware(hardware);
}
}
// 保存告知书 PatientInfo patient = patientInfoMapper.selectPatientInfoById(patientCancelSignDto.getPatientId());
if (!CollectionUtils.isEmpty(body.getInformeds())) { // 签约信息保存到患者表
for (SignPatientInformed informed : body.getInformeds()) { patient.setSignStatus(patientCancelSignDto.getSignStatus());
informed.setSignPatientRecordId(signPatientRecord.getId()); patient.setServiceStatus(patientCancelSignDto.getServiceStatus());
informed.setPatientId(signPatientRecord.getPatientId()); patientInfoMapper.updatePatientInfo(patient);
informedMapper.insertSignPatientInformed(informed); }
} return signPatientRecordMapper.updateByPrimaryKeySelective(signRecord);
} }
}
return flag;
}
return 0;
}
@Override
@Transactional(rollbackFor = Exception.class)
public int updateSignStatus(SignPatientStatusDto patientCancelSignDto) {
if (patientCancelSignDto.getPatientId() == null) {
throw new ServiceException("居民主键不能为空");
}
// 修改签约记录状态
SignPatientRecord signRecord = new SignPatientRecord();
signRecord.setId(patientCancelSignDto.getId());
signRecord.setSignStatus(patientCancelSignDto.getSignStatus());
signRecord.setServiceStatus(patientCancelSignDto.getServiceStatus());
signRecord.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
signRecord.setUpdateTime(DateUtils.getNowDate());
signRecord.setSeparateReason(patientCancelSignDto.getSeparateReason());
if (StringUtils.equals(SignRecordServiceStatusConstants.SEPARATE_SIGN, patientCancelSignDto.getSignStatus())) {
PatientInfo patient = patientInfoMapper.selectPatientInfoById(patientCancelSignDto.getPatientId());
// 签约信息保存到患者表
patient.setSignStatus(patientCancelSignDto.getSignStatus());
patient.setServiceStatus(patientCancelSignDto.getServiceStatus());
patientInfoMapper.updatePatientInfo(patient);
}
int flag = signPatientRecordMapper.updateByPrimaryKeySelective(signRecord);
return flag;
}
} }

View File

@ -1,12 +1,12 @@
package com.xinelu.manage.service.specialdiseasenode.impl; package com.xinelu.manage.service.specialdiseasenode.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode; import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode;
import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper; import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper;
import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService; import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -51,7 +51,7 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
*/ */
@Override @Override
public int insertSpecialDiseaseNode(SpecialDiseaseNode specialDiseaseNode) { public int insertSpecialDiseaseNode(SpecialDiseaseNode specialDiseaseNode) {
specialDiseaseNode.setCreateTime(DateUtils.getNowDate()); specialDiseaseNode.setCreateTime(LocalDateTime.now());
return specialDiseaseNodeMapper.insertSpecialDiseaseNode(specialDiseaseNode); return specialDiseaseNodeMapper.insertSpecialDiseaseNode(specialDiseaseNode);
} }
@ -63,7 +63,7 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
*/ */
@Override @Override
public int updateSpecialDiseaseNode(SpecialDiseaseNode specialDiseaseNode) { public int updateSpecialDiseaseNode(SpecialDiseaseNode specialDiseaseNode) {
specialDiseaseNode.setUpdateTime(DateUtils.getNowDate()); specialDiseaseNode.setUpdateTime(LocalDateTime.now());
return specialDiseaseNodeMapper.updateSpecialDiseaseNode(specialDiseaseNode); return specialDiseaseNodeMapper.updateSpecialDiseaseNode(specialDiseaseNode);
} }

View File

@ -1,12 +1,12 @@
package com.xinelu.manage.service.subdivisioncategory.impl; package com.xinelu.manage.service.subdivisioncategory.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.subdivisioncategory.SubdivisionCategory; import com.xinelu.manage.domain.subdivisioncategory.SubdivisionCategory;
import com.xinelu.manage.mapper.subdivisioncategory.SubdivisionCategoryMapper; import com.xinelu.manage.mapper.subdivisioncategory.SubdivisionCategoryMapper;
import com.xinelu.manage.service.subdivisioncategory.ISubdivisionCategoryService; import com.xinelu.manage.service.subdivisioncategory.ISubdivisionCategoryService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -51,7 +51,7 @@ public class SubdivisionCategoryServiceImpl implements ISubdivisionCategoryServi
*/ */
@Override @Override
public int insertSubdivisionCategory(SubdivisionCategory subdivisionCategory) { public int insertSubdivisionCategory(SubdivisionCategory subdivisionCategory) {
subdivisionCategory.setCreateTime(DateUtils.getNowDate()); subdivisionCategory.setCreateTime(LocalDateTime.now());
return subdivisionCategoryMapper.insertSubdivisionCategory(subdivisionCategory); return subdivisionCategoryMapper.insertSubdivisionCategory(subdivisionCategory);
} }
@ -63,7 +63,7 @@ public class SubdivisionCategoryServiceImpl implements ISubdivisionCategoryServi
*/ */
@Override @Override
public int updateSubdivisionCategory(SubdivisionCategory subdivisionCategory) { public int updateSubdivisionCategory(SubdivisionCategory subdivisionCategory) {
subdivisionCategory.setUpdateTime(DateUtils.getNowDate()); subdivisionCategory.setUpdateTime(LocalDateTime.now());
return subdivisionCategoryMapper.updateSubdivisionCategory(subdivisionCategory); return subdivisionCategoryMapper.updateSubdivisionCategory(subdivisionCategory);
} }

View File

@ -1,7 +1,6 @@
package com.xinelu.manage.service.taskpartitiondict.impl; package com.xinelu.manage.service.taskpartitiondict.impl;
import com.xinelu.common.constant.Constants; import com.xinelu.common.constant.Constants;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
import com.xinelu.manage.domain.taskpartitiondict.TaskPartitionDict; import com.xinelu.manage.domain.taskpartitiondict.TaskPartitionDict;
@ -10,6 +9,7 @@ import com.xinelu.manage.service.taskpartitiondict.ITaskPartitionDictService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -57,7 +57,7 @@ public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService {
@Override @Override
public int insertTaskPartitionDict(TaskPartitionDict taskPartitionDict) { public int insertTaskPartitionDict(TaskPartitionDict taskPartitionDict) {
taskPartitionDict.setTaskPartitionCode(Constants.TASK_PARTITION_CODE + generateSystemCodeUtil.generateSystemCode(Constants.TASK_PARTITION_CODE)); taskPartitionDict.setTaskPartitionCode(Constants.TASK_PARTITION_CODE + generateSystemCodeUtil.generateSystemCode(Constants.TASK_PARTITION_CODE));
taskPartitionDict.setCreateTime(DateUtils.getNowDate()); taskPartitionDict.setCreateTime(LocalDateTime.now());
taskPartitionDict.setCreateBy(SecurityUtils.getUsername()); taskPartitionDict.setCreateBy(SecurityUtils.getUsername());
return taskPartitionDictMapper.insertTaskPartitionDict(taskPartitionDict); return taskPartitionDictMapper.insertTaskPartitionDict(taskPartitionDict);
} }
@ -70,7 +70,7 @@ public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService {
*/ */
@Override @Override
public int updateTaskPartitionDict(TaskPartitionDict taskPartitionDict) { public int updateTaskPartitionDict(TaskPartitionDict taskPartitionDict) {
taskPartitionDict.setUpdateTime(DateUtils.getNowDate()); taskPartitionDict.setUpdateTime(LocalDateTime.now());
taskPartitionDict.setUpdateBy(SecurityUtils.getUsername()); taskPartitionDict.setUpdateBy(SecurityUtils.getUsername());
return taskPartitionDictMapper.updateTaskPartitionDict(taskPartitionDict); return taskPartitionDictMapper.updateTaskPartitionDict(taskPartitionDict);
} }

View File

@ -1,12 +1,12 @@
package com.xinelu.manage.service.taskstatusdict.impl; package com.xinelu.manage.service.taskstatusdict.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.taskstatusdict.TaskStatusDict; import com.xinelu.manage.domain.taskstatusdict.TaskStatusDict;
import com.xinelu.manage.mapper.taskstatusdict.TaskStatusDictMapper; import com.xinelu.manage.mapper.taskstatusdict.TaskStatusDictMapper;
import com.xinelu.manage.service.taskstatusdict.ITaskStatusDictService; import com.xinelu.manage.service.taskstatusdict.ITaskStatusDictService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -51,7 +51,7 @@ public class TaskStatusDictServiceImpl implements ITaskStatusDictService {
*/ */
@Override @Override
public int insertTaskStatusDict(TaskStatusDict taskStatusDict) { public int insertTaskStatusDict(TaskStatusDict taskStatusDict) {
taskStatusDict.setCreateTime(DateUtils.getNowDate()); taskStatusDict.setCreateTime(LocalDateTime.now());
return taskStatusDictMapper.insertTaskStatusDict(taskStatusDict); return taskStatusDictMapper.insertTaskStatusDict(taskStatusDict);
} }
@ -63,7 +63,7 @@ public class TaskStatusDictServiceImpl implements ITaskStatusDictService {
*/ */
@Override @Override
public int updateTaskStatusDict(TaskStatusDict taskStatusDict) { public int updateTaskStatusDict(TaskStatusDict taskStatusDict) {
taskStatusDict.setUpdateTime(DateUtils.getNowDate()); taskStatusDict.setUpdateTime(LocalDateTime.now());
return taskStatusDictMapper.updateTaskStatusDict(taskStatusDict); return taskStatusDictMapper.updateTaskStatusDict(taskStatusDict);
} }

View File

@ -1,7 +1,6 @@
package com.xinelu.manage.service.tasktypedict.impl; package com.xinelu.manage.service.tasktypedict.impl;
import com.xinelu.common.constant.Constants; import com.xinelu.common.constant.Constants;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
import com.xinelu.manage.domain.tasktypedict.TaskTypeDict; import com.xinelu.manage.domain.tasktypedict.TaskTypeDict;
@ -10,6 +9,7 @@ import com.xinelu.manage.service.tasktypedict.ITaskTypeDictService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -57,7 +57,7 @@ public class TaskTypeDictServiceImpl implements ITaskTypeDictService {
@Override @Override
public int insertTaskTypeDict(TaskTypeDict taskTypeDict) { public int insertTaskTypeDict(TaskTypeDict taskTypeDict) {
taskTypeDict.setTaskTypeCode(Constants.TASK_TYPE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.TASK_TYPE_CODE)); taskTypeDict.setTaskTypeCode(Constants.TASK_TYPE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.TASK_TYPE_CODE));
taskTypeDict.setCreateTime(DateUtils.getNowDate()); taskTypeDict.setCreateTime(LocalDateTime.now());
taskTypeDict.setCreateBy(SecurityUtils.getUsername()); taskTypeDict.setCreateBy(SecurityUtils.getUsername());
return taskTypeDictMapper.insertTaskTypeDict(taskTypeDict); return taskTypeDictMapper.insertTaskTypeDict(taskTypeDict);
} }
@ -70,7 +70,7 @@ public class TaskTypeDictServiceImpl implements ITaskTypeDictService {
*/ */
@Override @Override
public int updateTaskTypeDict(TaskTypeDict taskTypeDict) { public int updateTaskTypeDict(TaskTypeDict taskTypeDict) {
taskTypeDict.setUpdateTime(DateUtils.getNowDate()); taskTypeDict.setUpdateTime(LocalDateTime.now());
taskTypeDict.setUpdateBy(SecurityUtils.getUsername()); taskTypeDict.setUpdateBy(SecurityUtils.getUsername());
return taskTypeDictMapper.updateTaskTypeDict(taskTypeDict); return taskTypeDictMapper.updateTaskTypeDict(taskTypeDict);
} }

View File

@ -2,7 +2,6 @@ package com.xinelu.manage.service.textmessage.impl;
import com.xinelu.common.core.domain.entity.SysDictData; import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.manage.domain.textmessage.TextMessage; import com.xinelu.manage.domain.textmessage.TextMessage;
@ -18,8 +17,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -110,7 +109,7 @@ public class TextMessageServiceImpl implements ITextMessageService {
// 设置创建者和创建时间 // 设置创建者和创建时间
String currentUsername = SecurityUtils.getUsername(); String currentUsername = SecurityUtils.getUsername();
Date currentTime = DateUtils.getNowDate(); LocalDateTime currentTime = LocalDateTime.now();
textMessageTaskDTO.setCreateBy(currentUsername); textMessageTaskDTO.setCreateBy(currentUsername);
textMessageTaskDTO.setCreateTime(currentTime); textMessageTaskDTO.setCreateTime(currentTime);
@ -139,7 +138,7 @@ public class TextMessageServiceImpl implements ITextMessageService {
return 1; return 1;
} }
private TextMessageSuitTask createTextMessageSuitTask(Long suitTaskTypeId, Long textMessageId, String createdBy, Date createdAt) { private TextMessageSuitTask createTextMessageSuitTask(Long suitTaskTypeId, Long textMessageId, String createdBy, LocalDateTime createdAt) {
SysDictData sysDictData = sysDictDataMapper.selectDictDataById(suitTaskTypeId); SysDictData sysDictData = sysDictDataMapper.selectDictDataById(suitTaskTypeId);
TextMessageSuitTask task = new TextMessageSuitTask(); TextMessageSuitTask task = new TextMessageSuitTask();
task.setMessageId(textMessageId); task.setMessageId(textMessageId);
@ -166,7 +165,7 @@ public class TextMessageServiceImpl implements ITextMessageService {
// 设置修改者和修改时间 // 设置修改者和修改时间
String editUsername = SecurityUtils.getUsername(); String editUsername = SecurityUtils.getUsername();
Date editTime = DateUtils.getNowDate(); LocalDateTime editTime = LocalDateTime.now();
textMessageTaskDTO.setUpdateBy(editUsername); textMessageTaskDTO.setUpdateBy(editUsername);
textMessageTaskDTO.setUpdateTime(editTime); textMessageTaskDTO.setUpdateTime(editTime);

View File

@ -2,7 +2,6 @@ package com.xinelu.manage.service.wechattemplate.impl;
import com.xinelu.common.core.domain.entity.SysDictData; import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.PageServiceUtil; import com.xinelu.common.utils.PageServiceUtil;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
@ -19,8 +18,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -102,7 +101,7 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService {
// 设置创建者和创建时间 // 设置创建者和创建时间
String currentUsername = SecurityUtils.getUsername(); String currentUsername = SecurityUtils.getUsername();
Date currentTime = DateUtils.getNowDate(); LocalDateTime currentTime = LocalDateTime.now();
wechatTemplateTaskDTO.setCreateBy(currentUsername); wechatTemplateTaskDTO.setCreateBy(currentUsername);
wechatTemplateTaskDTO.setCreateTime(currentTime); wechatTemplateTaskDTO.setCreateTime(currentTime);
@ -131,7 +130,7 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService {
return 1; return 1;
} }
private WechatTemplateSuitTask createWechatTempSuitTask(Long suitTaskTypeId, Long wechatTempId, String createdBy, Date createdAt) { private WechatTemplateSuitTask createWechatTempSuitTask(Long suitTaskTypeId, Long wechatTempId, String createdBy, LocalDateTime createdAt) {
SysDictData sysDictData = sysDictDataMapper.selectDictDataById(suitTaskTypeId); SysDictData sysDictData = sysDictDataMapper.selectDictDataById(suitTaskTypeId);
WechatTemplateSuitTask task = new WechatTemplateSuitTask(); WechatTemplateSuitTask task = new WechatTemplateSuitTask();
task.setWechatTemplateId(wechatTempId); task.setWechatTemplateId(wechatTempId);
@ -157,7 +156,7 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService {
} }
// 设置修改者和修改时间 // 设置修改者和修改时间
String editUsername = SecurityUtils.getUsername(); String editUsername = SecurityUtils.getUsername();
Date editTime = DateUtils.getNowDate(); LocalDateTime editTime = LocalDateTime.now();
wechatTemplateTaskDTO.setUpdateBy(editUsername); wechatTemplateTaskDTO.setUpdateBy(editUsername);
wechatTemplateTaskDTO.setUpdateTime(editTime); wechatTemplateTaskDTO.setUpdateTime(editTime);