From 2da3f2d6d8074ce5b5732231db538469d1d02781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=AA=E5=AF=92?= <2533659732@qq.com> Date: Mon, 18 Mar 2024 16:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 4 +- .../xinelu/common/core/domain/BaseEntity.java | 14 +- .../main/resources/vm/java/controller.java.vm | 16 +- .../src/main/resources/vm/java/domain.java.vm | 8 +- .../src/main/resources/vm/java/mapper.java.vm | 16 +- .../main/resources/vm/java/service.java.vm | 10 +- .../resources/vm/java/serviceImpl.java.vm | 11 +- .../main/resources/vm/java/sub-domain.java.vm | 2 +- .../domain/patientinfo/PatientInfo.java | 4 +- .../domain/projectdevice/ProjectDevice.java | 68 ++-- .../signpatientrecord/SignPatientRecord.java | 103 ++--- .../SubscribeMessageRecord.java | 128 +++++++ .../agency/impl/AgencyServiceImpl.java | 13 +- .../impl/AgencyCategoryServiceImpl.java | 5 +- .../crowdinfo/impl/CrowdInfoServiceImpl.java | 15 +- .../impl/DepartmentServiceImpl.java | 9 +- .../DepartmentDiseaseTypeServiceImpl.java | 7 +- .../impl/LabelFieldContentServiceImpl.java | 8 +- .../impl/LabelFieldInfoServiceImpl.java | 8 +- .../impl/MaterialsInfoServiceImpl.java | 13 +- .../NormDepartmentCompareServiceImpl.java | 6 +- .../impl/OperationInfoServiceImpl.java | 6 +- .../impl/PatientBlacklistServiceImpl.java | 56 +-- ...ientBlacklistAbnormalCauseServiceImpl.java | 13 +- .../impl/PatientInfoServiceImpl.java | 13 +- .../PatientPreHospitalizationServiceImpl.java | 361 +++++++++--------- .../impl/PatientPropagandaServiceImpl.java | 17 +- .../PatientVisitInHospitalServiceImpl.java | 38 +- .../PatientVisitOperationServiceImpl.java | 38 +- .../PatientVisitOutHospitalServiceImpl.java | 39 +- .../impl/PatientVisitRecordServiceImpl.java | 348 ++++++++--------- .../project/impl/ProjectServiceImpl.java | 51 +-- .../impl/ProjectDeviceServiceImpl.java | 8 +- .../impl/ProjectGroupServiceImpl.java | 98 ++--- .../impl/ProjectResultServiceImpl.java | 233 +++++------ .../impl/PropagandaInfoServiceImpl.java | 58 +-- .../impl/PropagandaMaterialsServiceImpl.java | 17 +- .../impl/QuestionInfoServiceImpl.java | 14 +- .../impl/QuestionSubjectServiceImpl.java | 6 +- .../QuestionSubjectOptionServiceImpl.java | 6 +- .../impl/ScriptInfoServiceImpl.java | 6 +- .../impl/ServicePackageServiceImpl.java | 16 +- .../ServicePackageContentServiceImpl.java | 6 +- .../impl/ServiceWayContentServiceImpl.java | 18 +- .../impl/SignPatientInformedServiceImpl.java | 13 +- .../impl/SignPatientPackageServiceImpl.java | 15 +- ...SignPatientPackageHardwareServiceImpl.java | 17 +- .../impl/SignPatientRecordServiceImpl.java | 302 +++++++-------- .../impl/SpecialDiseaseNodeServiceImpl.java | 6 +- .../impl/SubdivisionCategoryServiceImpl.java | 6 +- .../impl/TaskPartitionDictServiceImpl.java | 6 +- .../impl/TaskStatusDictServiceImpl.java | 6 +- .../impl/TaskTypeDictServiceImpl.java | 6 +- .../impl/TextMessageServiceImpl.java | 9 +- .../impl/WechatTemplateServiceImpl.java | 9 +- 55 files changed, 1255 insertions(+), 1074 deletions(-) create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/domain/subscribemessagerecord/SubscribeMessageRecord.java diff --git a/postdischarge-admin/src/main/resources/application.yml b/postdischarge-admin/src/main/resources/application.yml index 72726498..ad357f09 100644 --- a/postdischarge-admin/src/main/resources/application.yml +++ b/postdischarge-admin/src/main/resources/application.yml @@ -61,9 +61,9 @@ spring: servlet: multipart: # 单个文件大小 - max-file-size: 10MB + max-file-size: 100MB # 设置总上传的文件大小 - max-request-size: 20MB + max-request-size: 500MB # 服务模块 devtools: restart: diff --git a/postdischarge-common/src/main/java/com/xinelu/common/core/domain/BaseEntity.java b/postdischarge-common/src/main/java/com/xinelu/common/core/domain/BaseEntity.java index 233f18ca..b20c5caa 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/core/domain/BaseEntity.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/core/domain/BaseEntity.java @@ -3,7 +3,7 @@ package com.xinelu.common.core.domain; import com.fasterxml.jackson.annotation.JsonFormat; import java.io.Serializable; -import java.util.Date; +import java.time.LocalDateTime; import java.util.HashMap; import java.util.Map; @@ -29,7 +29,7 @@ public class BaseEntity implements Serializable { * 创建时间 */ @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") - private Date updateTime; + private LocalDateTime updateTime; /** * 备注 @@ -68,11 +68,11 @@ public class BaseEntity implements Serializable { this.createBy = createBy; } - public Date getCreateTime() { + public LocalDateTime getCreateTime() { return createTime; } - public void setCreateTime(Date createTime) { + public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; } @@ -84,11 +84,11 @@ public class BaseEntity implements Serializable { this.updateBy = updateBy; } - public Date getUpdateTime() { + public LocalDateTime getUpdateTime() { return updateTime; } - public void setUpdateTime(Date updateTime) { + public void setUpdateTime(LocalDateTime updateTime) { this.updateTime = updateTime; } diff --git a/postdischarge-generator/src/main/resources/vm/java/controller.java.vm b/postdischarge-generator/src/main/resources/vm/java/controller.java.vm index 1945472a..61e42e16 100644 --- a/postdischarge-generator/src/main/resources/vm/java/controller.java.vm +++ b/postdischarge-generator/src/main/resources/vm/java/controller.java.vm @@ -4,7 +4,7 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; 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.PostMapping; 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.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.xinelu.common.annotation.Log; -import com.xinelu.common.core.controller.BaseController; -import com.xinelu.common.core.domain.AjaxResult; -import com.xinelu.common.enums.BusinessType; +import com.xinyilu.common.annotation.Log; +import com.xinyilu.common.core.controller.BaseController; +import com.xinyilu.common.core.domain.AjaxResult; +import com.xinyilu.common.enums.BusinessType; import ${packageName}.domain.${ClassName}; 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) -import com.xinelu.common.core.page.TableDataInfo; +import com.xinyilu.common.core.page.TableDataInfo; #elseif($table.tree) #end @@ -63,7 +63,7 @@ public class ${ClassName}Controller extends BaseController { @PostMapping("/export") public void export(HttpServletResponse response, ${ClassName} ${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}数据"); } diff --git a/postdischarge-generator/src/main/resources/vm/java/domain.java.vm b/postdischarge-generator/src/main/resources/vm/java/domain.java.vm index 8e3b9498..ea4fe7cb 100644 --- a/postdischarge-generator/src/main/resources/vm/java/domain.java.vm +++ b/postdischarge-generator/src/main/resources/vm/java/domain.java.vm @@ -11,9 +11,13 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; 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) +import com.xinyilu.common.core.domain.BaseEntity; #elseif($table.tree) +import com.xinyilu.common.core.domain.TreeEntity; #end /** @@ -28,7 +32,7 @@ import com.xinelu.common.annotation.Excel; @EqualsAndHashCode(callSuper = true) @ApiModel(value = "${functionName}对象", description = "${tableName}") #if($table.crud) - #set($Entity="BaseEntity") + #set($Entity="BaseDomain") #elseif($table.tree) #set($Entity="TreeEntity") #end diff --git a/postdischarge-generator/src/main/resources/vm/java/mapper.java.vm b/postdischarge-generator/src/main/resources/vm/java/mapper.java.vm index 6dac1392..53dad760 100644 --- a/postdischarge-generator/src/main/resources/vm/java/mapper.java.vm +++ b/postdischarge-generator/src/main/resources/vm/java/mapper.java.vm @@ -28,7 +28,7 @@ public interface ${ClassName}Mapper { * @param ${className} ${functionName} * @return ${functionName}集合 */ - public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); + List<${ClassName}> select${ClassName}List(${ClassName} ${className}); /** * 新增${functionName} @@ -36,7 +36,7 @@ public interface ${ClassName}Mapper { * @param ${className} ${functionName} * @return 结果 */ - public int insert${ClassName}(${ClassName} ${className}); + int insert${ClassName}(${ClassName} ${className}); /** * 修改${functionName} @@ -44,7 +44,7 @@ public interface ${ClassName}Mapper { * @param ${className} ${functionName} * @return 结果 */ - public int update${ClassName}(${ClassName} ${className}); + int update${ClassName}(${ClassName} ${className}); /** * 删除${functionName} @@ -52,7 +52,7 @@ public interface ${ClassName}Mapper { * @param ${pkColumn.javaField} ${functionName}主键 * @return 结果 */ - public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); /** * 批量删除${functionName} @@ -60,7 +60,7 @@ public interface ${ClassName}Mapper { * @param ${pkColumn.javaField}s 需要删除的数据主键集合 * @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) /** @@ -69,7 +69,7 @@ public interface ${ClassName}Mapper { * @param ${pkColumn.javaField}s 需要删除的数据主键集合 * @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} @@ -77,7 +77,7 @@ public interface ${ClassName}Mapper { * @param ${subclassName}List ${subTable.functionName}列表 * @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 * @return 结果 */ - public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField}); + int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField}); #end } diff --git a/postdischarge-generator/src/main/resources/vm/java/service.java.vm b/postdischarge-generator/src/main/resources/vm/java/service.java.vm index f6df34d2..3c78d9eb 100644 --- a/postdischarge-generator/src/main/resources/vm/java/service.java.vm +++ b/postdischarge-generator/src/main/resources/vm/java/service.java.vm @@ -25,7 +25,7 @@ public interface I${ClassName}Service { * @param ${className} ${functionName} * @return ${functionName}集合 */ - public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); + List<${ClassName}> select${ClassName}List(${ClassName} ${className}); /** * 新增${functionName} @@ -33,7 +33,7 @@ public interface I${ClassName}Service { * @param ${className} ${functionName} * @return 结果 */ - public int insert${ClassName}(${ClassName} ${className}); + int insert${ClassName}(${ClassName} ${className}); /** * 修改${functionName} @@ -41,7 +41,7 @@ public interface I${ClassName}Service { * @param ${className} ${functionName} * @return 结果 */ - public int update${ClassName}(${ClassName} ${className}); + int update${ClassName}(${ClassName} ${className}); /** * 批量删除${functionName} @@ -49,7 +49,7 @@ public interface I${ClassName}Service { * @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合 * @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}信息 @@ -57,5 +57,5 @@ public interface I${ClassName}Service { * @param ${pkColumn.javaField} ${functionName}主键 * @return 结果 */ - public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); } diff --git a/postdischarge-generator/src/main/resources/vm/java/serviceImpl.java.vm b/postdischarge-generator/src/main/resources/vm/java/serviceImpl.java.vm index 6f86055d..d3c6ef7c 100644 --- a/postdischarge-generator/src/main/resources/vm/java/serviceImpl.java.vm +++ b/postdischarge-generator/src/main/resources/vm/java/serviceImpl.java.vm @@ -1,18 +1,19 @@ package ${packageName}.service.impl; +import java.time.LocalDateTime; import java.util.List; #foreach ($column in $columns) #if($column.javaField == 'createTime' || $column.javaField == 'updateTime') - import com.xinelu.common.utils.DateUtils; + import com.xinyilu.common.utils.DateUtils; #break #end #end -import javax.annotation.Resource; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; #if($table.sub) import java.util.ArrayList; - import com.xinelu.common.utils.StringUtils; + import com.xinyilu.common.utils.StringUtils; import org.springframework.transaction.annotation.Transactional; import ${packageName}.domain.${subClassName}; #end @@ -66,7 +67,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service { public int insert${ClassName}(${ClassName} ${className}) { #foreach ($column in $columns) #if($column.javaField == 'createTime') - ${className}.setCreateTime(DateUtils.getNowDate()); + ${className}.setCreateTime(LocalDateTime.now()); #end #end #if($table.sub) @@ -91,7 +92,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service { public int update${ClassName}(${ClassName} ${className}) { #foreach ($column in $columns) #if($column.javaField == 'updateTime') - ${className}.setUpdateTime(DateUtils.getNowDate()); + ${className}.setUpdateTime(LocalDateTime.now()); #end #end #if($table.sub) diff --git a/postdischarge-generator/src/main/resources/vm/java/sub-domain.java.vm b/postdischarge-generator/src/main/resources/vm/java/sub-domain.java.vm index c753cf0d..f69d2548 100644 --- a/postdischarge-generator/src/main/resources/vm/java/sub-domain.java.vm +++ b/postdischarge-generator/src/main/resources/vm/java/sub-domain.java.vm @@ -3,7 +3,7 @@ package ${packageName}.domain; #foreach ($import in $subImportList) import ${import}; #end -import com.xinelu.common.annotation.Excel; +import com.xinyilu.common.annotation.Excel; /** * ${subTable.functionName}对象 ${subTableName} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientInfo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientInfo.java index c34f68ae..163a4b43 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientInfo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientInfo.java @@ -5,6 +5,8 @@ import com.xinelu.common.annotation.Excel; import com.xinelu.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + +import java.time.LocalDateTime; import java.util.Date; import lombok.AllArgsConstructor; import lombok.Data; @@ -86,7 +88,7 @@ public class PatientInfo extends BaseEntity { @ApiModelProperty(value = "签约时间,格式:yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "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 = "开证医生") diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/projectdevice/ProjectDevice.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/projectdevice/ProjectDevice.java index 8a35d1a5..56ea8456 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/projectdevice/ProjectDevice.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/projectdevice/ProjectDevice.java @@ -4,81 +4,85 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.xinelu.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Date; import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.LocalDateTime; /** -* 检测项目设备表 -* @TableName project_device -*/ + * 检测项目设备表 + * + * @TableName project_device + */ +@EqualsAndHashCode(callSuper = true) @ApiModel("检测项目设备表") @Data public class ProjectDevice extends BaseEntity { /** - * 主键id - */ + * 主键id + */ @ApiModelProperty("主键id") private Long id; /** - * 患者id - */ + * 患者id + */ @ApiModelProperty("患者id") private Long patientId; /** - * 患者姓名 - */ + * 患者姓名 + */ @ApiModelProperty("患者姓名") private String patientName; /** - * 身份证号 - */ + * 身份证号 + */ @ApiModelProperty("身份证号") private String cardNo; /** - * 设备类型,血糖仪:GLUCOSE_METER,血压计:BLOOD_PRESSURE_DEVICE - */ + * 设备类型,血糖仪:GLUCOSE_METER,血压计:BLOOD_PRESSURE_DEVICE + */ @ApiModelProperty("设备类型,血糖仪:GLUCOSE_METER,血压计:BLOOD_PRESSURE_DEVICE") private String deviceType; /** - * 设备名称 - */ + * 设备名称 + */ @ApiModelProperty("设备名称") private String deviceName; /** - * 设备编码 - */ + * 设备编码 + */ @ApiModelProperty("设备编码") private String deviceCode; /** - * 设备状态,绑定:BIND,解绑:UN_BIND - */ + * 设备状态,绑定:BIND,解绑:UN_BIND + */ @ApiModelProperty("设备状态,绑定:BIND,解绑:UN_BIND") private String deviceStatus; /** - * 备注信息 - */ + * 备注信息 + */ @ApiModelProperty("备注信息") private String deviceRemark; /** - * 设备绑定时间 - */ + * 设备绑定时间 + */ @ApiModelProperty("设备绑定时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date deviceBindTime; + private LocalDateTime deviceBindTime; /** - * 设备解绑时间 - */ + * 设备解绑时间 + */ @ApiModelProperty("设备解绑时间") - private Date deviceUnbindTime; + private LocalDateTime deviceUnbindTime; /** - * 设备IP地址 - */ + * 设备IP地址 + */ @ApiModelProperty("设备IP地址") private String deviceIp; /** - * 设备端口 - */ + * 设备端口 + */ @ApiModelProperty("设备端口") private Integer devicePort; diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientrecord/SignPatientRecord.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientrecord/SignPatientRecord.java index ade18bd6..4f77fa36 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientrecord/SignPatientRecord.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientrecord/SignPatientRecord.java @@ -4,15 +4,18 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.xinelu.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.Date; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + /** * 患者签约记录表 + * * @TableName sign_patient_record */ @Data @@ -22,7 +25,7 @@ import lombok.NoArgsConstructor; @ApiModel(value = "患者签约记录表", description = "sign_patient_record") public class SignPatientRecord extends BaseEntity { - private static final long serialVersionUID=1L; + private static final long serialVersionUID = 1L; /** * 主键id */ @@ -35,37 +38,43 @@ public class SignPatientRecord extends BaseEntity { @ApiModelProperty(value = "患者信息表id") private Long patientId; - /** - * 患者姓名 - */ - @ApiModelProperty(value = "患者姓名") - private String patientName; + /** + * 患者姓名 + */ + @ApiModelProperty(value = "患者姓名") + private String patientName; - /** - * 患者电话 - */ - @ApiModelProperty(value = "患者电话") - private String patientPhone; + /** + * 患者电话 + */ + @ApiModelProperty(value = "患者电话") + 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") - @JsonFormat(pattern = "yyyy-MM-dd") - private Date birthDate; + /** + * 出生日期,格式:yyyy-MM-dd + */ + @ApiModelProperty(value = "出生日期,格式:yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date birthDate; /** * 签约时间,格式:yyyy-MM-dd HH:mm:ss */ @ApiModelProperty(value = "签约时间,格式:yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date signTime; + private LocalDateTime signTime; /** * 签约时所属医院id @@ -127,8 +136,8 @@ public class SignPatientRecord extends BaseEntity { @ApiModelProperty(value = "就诊方式,门诊:OUTPATIENT_SERVICE,住院:BE_IN_HOSPITAL") private String visitMethod; - @ApiModelProperty(value = "住院/门诊号") - private String inHospitalNumber; + @ApiModelProperty(value = "住院/门诊号") + private String inHospitalNumber; /** * 签约时诊断 @@ -178,11 +187,11 @@ public class SignPatientRecord extends BaseEntity { @ApiModelProperty(value = "开单医生姓名(意向签约)") private String billingDoctorName; - /** - * 提交时间(待续签) - */ - @ApiModelProperty(value = "提交时间(待续签)") - private Date submissionTime; + /** + * 提交时间(待续签) + */ + @ApiModelProperty(value = "提交时间(待续签)") + private Date submissionTime; /** * 金额 */ @@ -195,25 +204,25 @@ public class SignPatientRecord extends BaseEntity { @ApiModelProperty(value = "缴费状态,已缴费:PAID,未交费:UNPAID_FEES") private String paymentStatus; - /** - * 解约原因 - */ - @ApiModelProperty(value = "解约原因") - private String separateReason; + /** + * 解约原因 + */ + @ApiModelProperty(value = "解约原因") + private String separateReason; - /** - * 健康管理师id - */ - @ApiModelProperty(value = "健康管理师id") - private Long healthManageId; + /** + * 健康管理师id + */ + @ApiModelProperty(value = "健康管理师id") + private Long healthManageId; - /** - * 健康管理师姓名 - */ - @ApiModelProperty(value = "健康管理师姓名") - private String healthManageName; + /** + * 健康管理师姓名 + */ + @ApiModelProperty(value = "健康管理师姓名") + private String healthManageName; - /** + /** * 删除标识,0:未删除,1:已删除 */ @ApiModelProperty(value = "删除标识,0:未删除,1:已删除") diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/subscribemessagerecord/SubscribeMessageRecord.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/subscribemessagerecord/SubscribeMessageRecord.java new file mode 100644 index 00000000..5eff7800 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/subscribemessagerecord/SubscribeMessageRecord.java @@ -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(); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/impl/AgencyServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/impl/AgencyServiceImpl.java index f77bd166..f5e69a78 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/impl/AgencyServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/agency/impl/AgencyServiceImpl.java @@ -2,7 +2,6 @@ package com.xinelu.manage.service.agency.impl; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.regex.RegexUtil; @@ -20,7 +19,11 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; 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; @@ -111,7 +114,7 @@ public class AgencyServiceImpl implements IAgencyService { if (i > 0) { return AjaxResult.error("该名称" + agency.getAgencyName() + "以重复!"); } - agency.setCreateTime(DateUtils.getNowDate()); + agency.setCreateTime(LocalDateTime.now()); agency.setCreateBy(SecurityUtils.getUsername()); return AjaxResult.success(agencyMapper.insertAgency(agency)); } @@ -134,7 +137,7 @@ public class AgencyServiceImpl implements IAgencyService { throw new ServiceException("该名称" + agency.getAgencyName() + "以重复!"); } } - agency.setUpdateTime(DateUtils.getNowDate()); + agency.setUpdateTime(LocalDateTime.now()); agency.setUpdateBy(SecurityUtils.getUsername()); return AjaxResult.success(agencyMapper.updateAgencyById(agency)); } @@ -211,7 +214,7 @@ public class AgencyServiceImpl implements IAgencyService { List saveAgencyList = new ArrayList<>(); for (Agency item : subtractList) { item.setCreateBy(SecurityUtils.getUsername()); - item.setCreateTime(new Date()); + item.setCreateTime(LocalDateTime.now()); Agency newAgency = new Agency(); BeanUtils.copyProperties(item, newAgency); saveAgencyList.add(newAgency); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/agencycategory/impl/AgencyCategoryServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/agencycategory/impl/AgencyCategoryServiceImpl.java index c3af7a13..e3ba6fa7 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/agencycategory/impl/AgencyCategoryServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/agencycategory/impl/AgencyCategoryServiceImpl.java @@ -12,6 +12,7 @@ import com.xinelu.manage.vo.agencycategory.AgencyCategoryVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -63,7 +64,7 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService { if (Objects.isNull(agencyCategory.getCategoryLevel()) || agencyCategory.getCategoryLevel().equals(1)) { agencyCategory.setParentCategoryId(null); } - agencyCategory.setCreateTime(DateUtils.getNowDate()); + agencyCategory.setCreateTime(LocalDateTime.now()); agencyCategory.setCreateBy(SecurityUtils.getUsername()); return agencyCategoryMapper.insertAgencyCategory(agencyCategory); } @@ -76,7 +77,7 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService { */ @Override public int updateAgencyCategory(AgencyCategory agencyCategory) { - agencyCategory.setUpdateTime(DateUtils.getNowDate()); + agencyCategory.setUpdateTime(LocalDateTime.now()); agencyCategory.setUpdateBy(SecurityUtils.getUsername()); return agencyCategoryMapper.updateAgencyCategory(agencyCategory); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/crowdinfo/impl/CrowdInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/crowdinfo/impl/CrowdInfoServiceImpl.java index 0ad4a235..1b34d1f7 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/crowdinfo/impl/CrowdInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/crowdinfo/impl/CrowdInfoServiceImpl.java @@ -1,14 +1,15 @@ package com.xinelu.manage.service.crowdinfo.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.manage.domain.crowdinfo.CrowdInfo; import com.xinelu.manage.mapper.crowdinfo.CrowdInfoMapper; import com.xinelu.manage.service.crowdinfo.ICrowdInfoService; -import java.util.List; -import javax.annotation.Resource; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 人群信息Service业务层处理 * @@ -50,8 +51,8 @@ public class CrowdInfoServiceImpl implements ICrowdInfoService { */ @Override public int insertCrowdInfo(CrowdInfo crowdInfo) { - crowdInfo.setCreateTime(DateUtils.getNowDate()); - crowdInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + crowdInfo.setCreateTime(LocalDateTime.now()); + crowdInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); return crowdInfoMapper.insertCrowdInfo(crowdInfo); } @@ -63,8 +64,8 @@ public class CrowdInfoServiceImpl implements ICrowdInfoService { */ @Override public int updateCrowdInfo(CrowdInfo crowdInfo) { - crowdInfo.setUpdateTime(DateUtils.getNowDate()); - crowdInfo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + crowdInfo.setUpdateTime(LocalDateTime.now()); + crowdInfo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); return crowdInfoMapper.updateCrowdInfo(crowdInfo); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/department/impl/DepartmentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/department/impl/DepartmentServiceImpl.java index 636602d1..efb7fe44 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/department/impl/DepartmentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/department/impl/DepartmentServiceImpl.java @@ -3,7 +3,6 @@ package com.xinelu.manage.service.department.impl; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.entity.SysUser; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.bean.BeanUtils; @@ -21,8 +20,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -107,7 +106,7 @@ public class DepartmentServiceImpl implements IDepartmentService { if (Objects.isNull(department.getParentDepartmentId())) { department.setParentDepartmentId(0L); } - department.setCreateTime(DateUtils.getNowDate()); + department.setCreateTime(LocalDateTime.now()); department.setCreateBy(SecurityUtils.getUsername()); return departmentMapper.insertDepartment(department); } @@ -121,7 +120,7 @@ public class DepartmentServiceImpl implements IDepartmentService { @Override public int updateDepartment(Department department) { department.setUpdateBy(SecurityUtils.getUsername()); - department.setUpdateTime(DateUtils.getNowDate()); + department.setUpdateTime(LocalDateTime.now()); return departmentMapper.updateDepartmentById(department); } @@ -230,7 +229,7 @@ public class DepartmentServiceImpl implements IDepartmentService { item.setParentDepartmentId(0L); } item.setCreateBy(SecurityUtils.getUsername()); - item.setCreateTime(new Date()); + item.setCreateTime(LocalDateTime.now()); Department newDepartment = new Department(); BeanUtils.copyProperties(item, newDepartment); saveDepartmentList.add(newDepartment); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/impl/DepartmentDiseaseTypeServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/impl/DepartmentDiseaseTypeServiceImpl.java index 42950914..3eb2f036 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/impl/DepartmentDiseaseTypeServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/impl/DepartmentDiseaseTypeServiceImpl.java @@ -1,7 +1,6 @@ package com.xinelu.manage.service.departmentdiseasetype.impl; import com.xinelu.common.core.domain.AjaxResult; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.departmentdiseasetype.DepartmentDiseaseType; import com.xinelu.manage.mapper.departmentdiseasetype.DepartmentDiseaseTypeMapper; import com.xinelu.manage.service.departmentdiseasetype.IDepartmentDiseaseTypeService; @@ -10,9 +9,9 @@ import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -import java.util.Objects; /** @@ -56,7 +55,7 @@ public class DepartmentDiseaseTypeServiceImpl implements IDepartmentDiseaseTypeS */ @Override public int insertDepartmentDiseaseType(DepartmentDiseaseType departmentDiseaseType) { - departmentDiseaseType.setCreateTime(DateUtils.getNowDate()); + departmentDiseaseType.setCreateTime(LocalDateTime.now()); return departmentDiseaseTypeMapper.insertDepartmentDiseaseType(departmentDiseaseType); } @@ -68,7 +67,7 @@ public class DepartmentDiseaseTypeServiceImpl implements IDepartmentDiseaseTypeS */ @Override public int updateDepartmentDiseaseType(DepartmentDiseaseType departmentDiseaseType) { - departmentDiseaseType.setUpdateTime(DateUtils.getNowDate()); + departmentDiseaseType.setUpdateTime(LocalDateTime.now()); return departmentDiseaseTypeMapper.updateDepartmentDiseaseType(departmentDiseaseType); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java index ab447cb5..c7adfb8b 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java @@ -2,7 +2,6 @@ package com.xinelu.manage.service.labelfieldcontent.impl; import com.xinelu.common.constant.LabelFieldInfoFieldTypeConstants; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; @@ -15,6 +14,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; /** @@ -61,7 +61,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { */ @Override public int insertLabelFieldContent(LabelFieldContent labelFieldContent) { - labelFieldContent.setCreateTime(DateUtils.getNowDate()); + labelFieldContent.setCreateTime(LocalDateTime.now()); return labelFieldContentMapper.insertLabelFieldContent(labelFieldContent); } @@ -82,7 +82,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { throw new ServiceException("当前标签字段类型下字段内容名称已存在"); } labelFieldContent.setUpdateBy(SecurityUtils.getUsername()); - labelFieldContent.setUpdateTime(DateUtils.getNowDate()); + labelFieldContent.setUpdateTime(LocalDateTime.now()); return labelFieldContentMapper.updateLabelFieldContent(labelFieldContent); } @@ -133,7 +133,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { labelFieldContent.setFieldName(labelFieldContentAddDTO.getFieldName()); labelFieldContent.setContentCode(LabelFieldInfoFieldTypeConstants.CONTENT_ENCODING + systemCodeUtil.generateDepartCode(LabelFieldInfoFieldTypeConstants.CONTENT_ENCODING)); labelFieldContent.setCreateBy(SecurityUtils.getUsername()); - labelFieldContent.setCreateTime(DateUtils.getNowDate()); + labelFieldContent.setCreateTime(LocalDateTime.now()); if (labelFieldContentMapper.insertLabelFieldContent(labelFieldContent) <= 0) { throw new ServiceException("新增标签字段内容信息失败"); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java index 0bdc1cc4..6cc2cc85 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java @@ -2,7 +2,6 @@ package com.xinelu.manage.service.labelfieldinfo.impl; import com.xinelu.common.constant.LabelFieldInfoFieldTypeConstants; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo; @@ -15,6 +14,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -63,7 +63,7 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService { */ @Override public int insertLabelFieldInfo(LabelFieldInfo labelFieldInfo) { - labelFieldInfo.setCreateTime(DateUtils.getNowDate()); + labelFieldInfo.setCreateTime(LocalDateTime.now()); return labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo); } @@ -87,7 +87,7 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService { } // 执行修改操作 labelFieldInfo.setUpdateBy(SecurityUtils.getUsername()); - labelFieldInfo.setUpdateTime(DateUtils.getNowDate()); + labelFieldInfo.setUpdateTime(LocalDateTime.now()); return labelFieldInfoMapper.updateLabelFieldInfo(labelFieldInfo); } @@ -147,7 +147,7 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService { for (LabelFieldInfo labelFieldInfo : fieldInfoList) { labelFieldInfo.setFieldCode(LabelFieldInfoFieldTypeConstants.FIELD_ENCODING + systemCodeUtil.generateDepartCode(LabelFieldInfoFieldTypeConstants.FIELD_ENCODING)); labelFieldInfo.setCreateBy(SecurityUtils.getUsername()); - labelFieldInfo.setCreateTime(DateUtils.getNowDate()); + labelFieldInfo.setCreateTime(LocalDateTime.now()); if (labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo) <= 0) { throw new ServiceException("新增标签字段信息失败"); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/materialsinfo/impl/MaterialsInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/materialsinfo/impl/MaterialsInfoServiceImpl.java index cd0b6512..b1876df7 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/materialsinfo/impl/MaterialsInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/materialsinfo/impl/MaterialsInfoServiceImpl.java @@ -1,14 +1,15 @@ package com.xinelu.manage.service.materialsinfo.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.materialsinfo.MaterialsInfo; import com.xinelu.manage.dto.materialsinfo.MaterialsInfoDto; import com.xinelu.manage.mapper.materialsinfo.MaterialsInfoMapper; import com.xinelu.manage.service.materialsinfo.IMaterialsInfoService; -import java.util.List; -import javax.annotation.Resource; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 素材信息Service业务层处理 * @@ -50,8 +51,8 @@ public class MaterialsInfoServiceImpl implements IMaterialsInfoService { */ @Override public int insertMaterialsInfo(MaterialsInfo materialsInfo) { - materialsInfo.setCreateTime(DateUtils.getNowDate()); - return materialsInfoMapper.insertMaterialsInfo(materialsInfo); + materialsInfo.setCreateTime(LocalDateTime.now()); + return materialsInfoMapper.insertMaterialsInfo(materialsInfo); } /** @@ -62,7 +63,7 @@ public class MaterialsInfoServiceImpl implements IMaterialsInfoService { */ @Override public int updateMaterialsInfo(MaterialsInfo materialsInfo) { - materialsInfo.setUpdateTime(DateUtils.getNowDate()); + materialsInfo.setUpdateTime(LocalDateTime.now()); return materialsInfoMapper.updateMaterialsInfo(materialsInfo); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/normdepartmentcompare/impl/NormDepartmentCompareServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/normdepartmentcompare/impl/NormDepartmentCompareServiceImpl.java index 98d2d7a8..c4e04e4e 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/normdepartmentcompare/impl/NormDepartmentCompareServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/normdepartmentcompare/impl/NormDepartmentCompareServiceImpl.java @@ -1,12 +1,12 @@ package com.xinelu.manage.service.normdepartmentcompare.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.normdepartmentcompare.NormDepartmentCompare; import com.xinelu.manage.mapper.normdepartmentcompare.NormDepartmentCompareMapper; import com.xinelu.manage.service.normdepartmentcompare.INormDepartmentCompareService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; @@ -51,7 +51,7 @@ public class NormDepartmentCompareServiceImpl implements INormDepartmentCompareS */ @Override public int insertNormDepartmentCompare(NormDepartmentCompare normDepartmentCompare) { - normDepartmentCompare.setCreateTime(DateUtils.getNowDate()); + normDepartmentCompare.setCreateTime(LocalDateTime.now()); return normDepartmentCompareMapper.insertNormDepartmentCompare(normDepartmentCompare); } @@ -63,7 +63,7 @@ public class NormDepartmentCompareServiceImpl implements INormDepartmentCompareS */ @Override public int updateNormDepartmentCompare(NormDepartmentCompare normDepartmentCompare) { - normDepartmentCompare.setUpdateTime(DateUtils.getNowDate()); + normDepartmentCompare.setUpdateTime(LocalDateTime.now()); return normDepartmentCompareMapper.updateNormDepartmentCompare(normDepartmentCompare); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java index adfa3c6b..6e0ee4bc 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java @@ -2,7 +2,6 @@ package com.xinelu.manage.service.operationInfo.impl; import com.xinelu.common.constant.Constants; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.manage.domain.operationInfo.OperationInfo; @@ -12,6 +11,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; /** @@ -67,7 +67,7 @@ public class OperationInfoServiceImpl implements IOperationInfoService { // 设置创建人、创建时间 operationInfo.setOperationCode(Constants.SURGERY_ENCODING + systemCodeUtil.generateDepartCode(Constants.SURGERY_ENCODING)); operationInfo.setCreateBy(SecurityUtils.getUsername()); - operationInfo.setCreateTime(DateUtils.getNowDate()); + operationInfo.setCreateTime(LocalDateTime.now()); return operationInfoMapper.insertOperationInfo(operationInfo); } @@ -86,7 +86,7 @@ public class OperationInfoServiceImpl implements IOperationInfoService { } // 设置修改人,修改时间 operationInfo.setUpdateBy(SecurityUtils.getUsername()); - operationInfo.setUpdateTime(DateUtils.getNowDate()); + operationInfo.setUpdateTime(LocalDateTime.now()); return operationInfoMapper.updateOperationInfo(operationInfo); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientblacklist/impl/PatientBlacklistServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientblacklist/impl/PatientBlacklistServiceImpl.java index 675c0f9f..c0dc67f6 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientblacklist/impl/PatientBlacklistServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientblacklist/impl/PatientBlacklistServiceImpl.java @@ -12,12 +12,14 @@ import com.xinelu.manage.mapper.patientblacklist.PatientBlacklistMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; import com.xinelu.manage.service.patientblacklist.IPatientBlacklistService; 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.util.CollectionUtils; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + /** * 患者-黑明单关系Service业务层处理 * @@ -29,8 +31,8 @@ public class PatientBlacklistServiceImpl implements IPatientBlacklistService { @Resource private PatientBlacklistMapper patientBlacklistMapper; - @Resource - private PatientInfoMapper patientInfoMapper; + @Resource + private PatientInfoMapper patientInfoMapper; /** * 查询患者-黑明单关系 @@ -62,23 +64,23 @@ public class PatientBlacklistServiceImpl implements IPatientBlacklistService { */ @Override public int insertPatientBlacklist(PatientBlacklistSaveDto blacklistSaveDto) { - // 根据患者姓名、身份证号查询患者 - PatientInfoDto patientInfoDto = new PatientInfoDto(); - patientInfoDto.setPatientName(blacklistSaveDto.getPatientName()); - patientInfoDto.setPatientPhone(blacklistSaveDto.getPatientPhone()); - patientInfoDto.setCardNo(blacklistSaveDto.getCardNo()); - List patientList = patientInfoMapper.selectPatientInfoList(patientInfoDto); - if (CollectionUtils.isEmpty(patientList)) { - throw new ServiceException("未找到该患者,请确认姓名身份证号手机号是否正确"); - } - if (patientList.size() > 1) { - throw new ServiceException("找到多名患者信息,请确认姓名身份证号手机号是否正确"); - } - PatientBlacklist patientBlacklist = new PatientBlacklist(); - BeanUtils.copyBeanProp(patientBlacklist, blacklistSaveDto); - patientBlacklist.setPatientId(patientList.get(0).getId()); - patientBlacklist.setDelFlag(0); - patientBlacklist.setCreateTime(DateUtils.getNowDate()); + // 根据患者姓名、身份证号查询患者 + PatientInfoDto patientInfoDto = new PatientInfoDto(); + patientInfoDto.setPatientName(blacklistSaveDto.getPatientName()); + patientInfoDto.setPatientPhone(blacklistSaveDto.getPatientPhone()); + patientInfoDto.setCardNo(blacklistSaveDto.getCardNo()); + List patientList = patientInfoMapper.selectPatientInfoList(patientInfoDto); + if (CollectionUtils.isEmpty(patientList)) { + throw new ServiceException("未找到该患者,请确认姓名身份证号手机号是否正确"); + } + if (patientList.size() > 1) { + throw new ServiceException("找到多名患者信息,请确认姓名身份证号手机号是否正确"); + } + PatientBlacklist patientBlacklist = new PatientBlacklist(); + BeanUtils.copyBeanProp(patientBlacklist, blacklistSaveDto); + patientBlacklist.setPatientId(patientList.get(0).getId()); + patientBlacklist.setDelFlag(0); + patientBlacklist.setCreateTime(LocalDateTime.now()); return patientBlacklistMapper.insertPatientBlacklist(patientBlacklist); } @@ -90,7 +92,7 @@ public class PatientBlacklistServiceImpl implements IPatientBlacklistService { */ @Override public int updatePatientBlacklist(PatientBlacklist patientBlacklist) { - patientBlacklist.setUpdateTime(DateUtils.getNowDate()); + patientBlacklist.setUpdateTime(LocalDateTime.now()); return patientBlacklistMapper.updatePatientBlacklist(patientBlacklist); } @@ -113,10 +115,10 @@ public class PatientBlacklistServiceImpl implements IPatientBlacklistService { */ @Override public int deletePatientBlacklistById(Long id) { - PatientBlacklist patientBlacklist = new PatientBlacklist(); - patientBlacklist.setId(id); - patientBlacklist.setDelFlag(1); - patientBlacklist.setUpdateTime(new Date()); + PatientBlacklist patientBlacklist = new PatientBlacklist(); + patientBlacklist.setId(id); + patientBlacklist.setDelFlag(1); + patientBlacklist.setUpdateTime(LocalDateTime.now()); return patientBlacklistMapper.updatePatientBlacklist(patientBlacklist); } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientblacklistabnormalcause/impl/PatientBlacklistAbnormalCauseServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientblacklistabnormalcause/impl/PatientBlacklistAbnormalCauseServiceImpl.java index 01491851..7a208a9e 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientblacklistabnormalcause/impl/PatientBlacklistAbnormalCauseServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientblacklistabnormalcause/impl/PatientBlacklistAbnormalCauseServiceImpl.java @@ -1,13 +1,14 @@ package com.xinelu.manage.service.patientblacklistabnormalcause.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.patientblacklistabnormalcause.PatientBlacklistAbnormalCause; import com.xinelu.manage.mapper.patientblacklistabnormalcause.PatientBlacklistAbnormalCauseMapper; import com.xinelu.manage.service.patientblacklistabnormalcause.IPatientBlacklistAbnormalCauseService; -import java.util.List; -import javax.annotation.Resource; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 患者黑名单异常原因Service业务层处理 * @@ -49,8 +50,8 @@ public class PatientBlacklistAbnormalCauseServiceImpl implements IPatientBlackli */ @Override public int insertPatientBlacklistAbnormalCause(PatientBlacklistAbnormalCause patientBlacklistAbnormalCause) { - patientBlacklistAbnormalCause.setCreateTime(DateUtils.getNowDate()); - return patientBlacklistAbnormalCauseMapper.insertPatientBlacklistAbnormalCause(patientBlacklistAbnormalCause); + patientBlacklistAbnormalCause.setCreateTime(LocalDateTime.now()); + return patientBlacklistAbnormalCauseMapper.insertPatientBlacklistAbnormalCause(patientBlacklistAbnormalCause); } /** @@ -61,7 +62,7 @@ public class PatientBlacklistAbnormalCauseServiceImpl implements IPatientBlackli */ @Override public int updatePatientBlacklistAbnormalCause(PatientBlacklistAbnormalCause patientBlacklistAbnormalCause) { - patientBlacklistAbnormalCause.setUpdateTime(DateUtils.getNowDate()); + patientBlacklistAbnormalCause.setUpdateTime(LocalDateTime.now()); return patientBlacklistAbnormalCauseMapper.updatePatientBlacklistAbnormalCause(patientBlacklistAbnormalCause); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java index b0430ac5..7323e88f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java @@ -1,14 +1,15 @@ package com.xinelu.manage.service.patientinfo.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.patientinfo.PatientInfo; import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; import com.xinelu.manage.service.patientinfo.IPatientInfoService; -import java.util.List; -import javax.annotation.Resource; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 患者信息Service业务层处理 * @@ -51,8 +52,8 @@ public class PatientInfoServiceImpl implements IPatientInfoService { */ @Override public int insertPatientInfo(PatientInfo patientInfo) { - patientInfo.setCreateTime(DateUtils.getNowDate()); - patientInfo.setDelFlag(0); + patientInfo.setCreateTime(LocalDateTime.now()); + patientInfo.setDelFlag(0); return patientInfoMapper.insertPatientInfo(patientInfo); } @@ -64,7 +65,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService { */ @Override public int updatePatientInfo(PatientInfo patientInfo) { - patientInfo.setUpdateTime(DateUtils.getNowDate()); + patientInfo.setUpdateTime(LocalDateTime.now()); return patientInfoMapper.updatePatientInfo(patientInfo); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientprehospitalization/impl/PatientPreHospitalizationServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientprehospitalization/impl/PatientPreHospitalizationServiceImpl.java index 89c7fdb8..951d9b17 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientprehospitalization/impl/PatientPreHospitalizationServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientprehospitalization/impl/PatientPreHospitalizationServiceImpl.java @@ -4,7 +4,6 @@ import com.xinelu.common.constant.NodeTypeConstants; import com.xinelu.common.constant.PatientTypeConstants; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; 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.patientprehospitalization.PatientPreHospitalizationMapper; 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.lang3.BooleanUtils; import org.apache.commons.lang3.ObjectUtils; 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 -* @description 针对表【patient_pre_hospitalization(预住院患者表)】的数据库操作Service实现 -* @createDate 2024-03-08 10:25:39 -*/ + * @author haown + * @description 针对表【patient_pre_hospitalization(预住院患者表)】的数据库操作Service实现 + * @createDate 2024-03-08 10:25:39 + */ @Service public class PatientPreHospitalizationServiceImpl implements IPatientPreHospitalizationService { - @Resource - private PatientPreHospitalizationMapper preHospitalizationMapper; + @Resource + private PatientPreHospitalizationMapper preHospitalizationMapper; - @Resource - private PatientInfoMapper patientInfoMapper; + @Resource + private PatientInfoMapper patientInfoMapper; - @Resource - private AgencyMapper agencyMapper; + @Resource + private AgencyMapper agencyMapper; - @Resource - private DepartmentMapper departmentMapper; + @Resource + private DepartmentMapper departmentMapper; - @Resource - private RegexUtil regexUtil; + @Resource + private RegexUtil regexUtil; - @Override public int insert(PatientPreHospitalization preHospitalization) { - // 根据身份证号查询是否有患者信息 - PatientInfoDto patientInfoDto = new PatientInfoDto(); - patientInfoDto.setCardNo(preHospitalization.getCardNo()); - List patientList = patientInfoMapper.selectPatientInfoList(patientInfoDto); - if (CollectionUtils.isEmpty(patientList)) { - // 保存患者信息 - PatientInfo patientInfo = new PatientInfo(); - BeanUtils.copyBeanProp(patientInfo, preHospitalization); - patientInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - patientInfo.setCreateTime(DateUtils.getNowDate()); - patientInfo.setDelFlag(0); - patientInfo.setPatientType(PatientTypeConstants.PRE_HOSPITALIZED_PATIENT); - patientInfoMapper.insertPatientInfo(patientInfo); - preHospitalization.setPatientId(patientInfo.getId()); - } else { - // 修改患者信息 - PatientInfo patientInfo = patientList.get(0); - BeanUtils.copyBeanProp(patientInfo, preHospitalization); - patientInfo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - patientInfo.setUpdateTime(DateUtils.getNowDate()); - patientInfo.setDelFlag(0); - patientInfo.setPatientType(PatientTypeConstants.PRE_HOSPITALIZED_PATIENT); - patientInfoMapper.updatePatientInfo(patientInfo); - preHospitalization.setPatientId(patientList.get(0).getId()); - } - // 保存预住院信息 - preHospitalization.setDelFlag(0); - preHospitalization.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - preHospitalization.setCreateTime(DateUtils.getNowDate()); - return preHospitalizationMapper.insertSelective(preHospitalization); - } + @Override + public int insert(PatientPreHospitalization preHospitalization) { + // 根据身份证号查询是否有患者信息 + PatientInfoDto patientInfoDto = new PatientInfoDto(); + patientInfoDto.setCardNo(preHospitalization.getCardNo()); + List patientList = patientInfoMapper.selectPatientInfoList(patientInfoDto); + if (CollectionUtils.isEmpty(patientList)) { + // 保存患者信息 + PatientInfo patientInfo = new PatientInfo(); + BeanUtils.copyBeanProp(patientInfo, preHospitalization); + patientInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + patientInfo.setCreateTime(LocalDateTime.now()); + patientInfo.setDelFlag(0); + patientInfo.setPatientType(PatientTypeConstants.PRE_HOSPITALIZED_PATIENT); + patientInfoMapper.insertPatientInfo(patientInfo); + preHospitalization.setPatientId(patientInfo.getId()); + } else { + // 修改患者信息 + PatientInfo patientInfo = patientList.get(0); + BeanUtils.copyBeanProp(patientInfo, preHospitalization); + patientInfo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + patientInfo.setUpdateTime(LocalDateTime.now()); + patientInfo.setDelFlag(0); + patientInfo.setPatientType(PatientTypeConstants.PRE_HOSPITALIZED_PATIENT); + patientInfoMapper.updatePatientInfo(patientInfo); + preHospitalization.setPatientId(patientList.get(0).getId()); + } + // 保存预住院信息 + preHospitalization.setDelFlag(0); + preHospitalization.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + preHospitalization.setCreateTime(LocalDateTime.now()); + return preHospitalizationMapper.insertSelective(preHospitalization); + } - @Override public List selectList(PatientInfoDto patientInfo) { - return preHospitalizationMapper.selectList(patientInfo); - } + @Override + public List selectList(PatientInfoDto patientInfo) { + return preHospitalizationMapper.selectList(patientInfo); + } - @Override public int update(PatientPreHospitalization preHospitalization) { - // 修改患者信息 - PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(preHospitalization.getPatientId()); - Long patientId = patientInfo.getId(); - BeanUtils.copyBeanProp(patientInfo, preHospitalization); - patientInfo.setId(patientId); - int flag = patientInfoMapper.updatePatientInfo(patientInfo); - if (flag >= 0) { - return preHospitalizationMapper.updateByPrimaryKeySelective(preHospitalization); - } - return -1; - } + @Override + public int update(PatientPreHospitalization preHospitalization) { + // 修改患者信息 + PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(preHospitalization.getPatientId()); + Long patientId = patientInfo.getId(); + BeanUtils.copyBeanProp(patientInfo, preHospitalization); + patientInfo.setId(patientId); + int flag = patientInfoMapper.updatePatientInfo(patientInfo); + if (flag >= 0) { + return preHospitalizationMapper.updateByPrimaryKeySelective(preHospitalization); + } + return -1; + } - @Override public int deleteByIds(Long[] ids) { - return preHospitalizationMapper.deleteByIds(ids); - } + @Override + public int deleteByIds(Long[] ids) { + return preHospitalizationMapper.deleteByIds(ids); + } - @Override public PatientPreHospitalization getById(Long id) { - return preHospitalizationMapper.selectByPrimaryKey(id); - } + @Override + public PatientPreHospitalization getById(Long id) { + return preHospitalizationMapper.selectByPrimaryKey(id); + } - @Override public AjaxResult importList(List patientList) { - //判断添加的数据是否为空 - if (CollectionUtils.isEmpty(patientList)) { - return AjaxResult.error("请添加预住院患者导入信息!"); - } - // 根据患者身份证号做去重处理 - List 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())) { - return AjaxResult.error("当前患者联系电话:" + patient.getPatientPhone() + " 格式不正确,请重新录入!"); - } - List saveList = new ArrayList<>(); - for (PatientPreHospitalization item : importDataList) { - PatientPreHospitalization preHospitalization = new PatientPreHospitalization(); - BeanUtils.copyProperties(item, preHospitalization); - // 根据医院名称查询医院id - Agency agency = new Agency(); - if (StringUtils.isNotBlank(item.getHospitalAgencyName())) { - agency.setAgencyName(item.getHospitalAgencyName()); - agency.setNodeType(NodeTypeConstants.HOSPITAL); - List agencyList = agencyMapper.selectAgencyList(agency); - if (CollectionUtils.isNotEmpty(agencyList)) { - preHospitalization.setHospitalAgencyId(agencyList.get(0).getId()); - } - } else { - preHospitalization.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getAgencyId()); - Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getAgencyId()); - if (ObjectUtils.isNotEmpty(agencyData)) { - preHospitalization.setHospitalAgencyName(agencyData.getAgencyName()); - } - } - // 查询院区id - if (StringUtils.isNotBlank(item.getCampusAgencyName())) { - agency.setAgencyName(item.getWardName()); - agency.setNodeType(NodeTypeConstants.CAMPUS); - List campusList = agencyMapper.selectAgencyList(agency); - if (CollectionUtils.isNotEmpty(campusList)) { - preHospitalization.setCampusAgencyId(campusList.get(0).getId()); - } - } + @Override + public AjaxResult importList(List patientList) { + //判断添加的数据是否为空 + if (CollectionUtils.isEmpty(patientList)) { + return AjaxResult.error("请添加预住院患者导入信息!"); + } + // 根据患者身份证号做去重处理 + List 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())) { + return AjaxResult.error("当前患者联系电话:" + patient.getPatientPhone() + " 格式不正确,请重新录入!"); + } + List saveList = new ArrayList<>(); + for (PatientPreHospitalization item : importDataList) { + PatientPreHospitalization preHospitalization = new PatientPreHospitalization(); + BeanUtils.copyProperties(item, preHospitalization); + // 根据医院名称查询医院id + Agency agency = new Agency(); + if (StringUtils.isNotBlank(item.getHospitalAgencyName())) { + agency.setAgencyName(item.getHospitalAgencyName()); + agency.setNodeType(NodeTypeConstants.HOSPITAL); + List agencyList = agencyMapper.selectAgencyList(agency); + if (CollectionUtils.isNotEmpty(agencyList)) { + preHospitalization.setHospitalAgencyId(agencyList.get(0).getId()); + } + } else { + preHospitalization.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getAgencyId()); + Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getAgencyId()); + if (ObjectUtils.isNotEmpty(agencyData)) { + preHospitalization.setHospitalAgencyName(agencyData.getAgencyName()); + } + } + // 查询院区id + if (StringUtils.isNotBlank(item.getCampusAgencyName())) { + agency.setAgencyName(item.getWardName()); + agency.setNodeType(NodeTypeConstants.CAMPUS); + List campusList = agencyMapper.selectAgencyList(agency); + if (CollectionUtils.isNotEmpty(campusList)) { + preHospitalization.setCampusAgencyId(campusList.get(0).getId()); + } + } - // 查询科室id - Department department = new Department(); - if (StringUtils.isNotBlank(item.getDepartmentName())) { - department.setAgencyName(item.getHospitalAgencyName()); - department.setDepartmentName(item.getDepartmentName()); - department.setNodeType(NodeTypeConstants.DEPARTMENT); - List deptList = departmentMapper.selectDepartmentList(department); - if (CollectionUtils.isNotEmpty(deptList)) { - preHospitalization.setDepartmentId(deptList.get(0).getId()); - } - } else { - preHospitalization.setDepartmentId(SecurityUtils.getLoginUser().getUser().getDepartmentId()); - Department department1 = departmentMapper.selectDepartmentById(SecurityUtils.getLoginUser().getUser().getDepartmentId()); - if (ObjectUtils.isNotEmpty(department1)) { - preHospitalization.setDepartmentName(department1.getDepartmentName()); - } - } - // 查询病区 - if (StringUtils.isNotBlank(item.getWardName())) { - department.setAgencyName(item.getHospitalAgencyName()); - department.setDepartmentName(item.getWardName()); - department.setNodeType(NodeTypeConstants.WARD); - List deptList = departmentMapper.selectDepartmentList(department); - if (CollectionUtils.isNotEmpty(deptList)) { - preHospitalization.setWardId(deptList.get(0).getId()); - } - } + // 查询科室id + Department department = new Department(); + if (StringUtils.isNotBlank(item.getDepartmentName())) { + department.setAgencyName(item.getHospitalAgencyName()); + department.setDepartmentName(item.getDepartmentName()); + department.setNodeType(NodeTypeConstants.DEPARTMENT); + List deptList = departmentMapper.selectDepartmentList(department); + if (CollectionUtils.isNotEmpty(deptList)) { + preHospitalization.setDepartmentId(deptList.get(0).getId()); + } + } else { + preHospitalization.setDepartmentId(SecurityUtils.getLoginUser().getUser().getDepartmentId()); + Department department1 = departmentMapper.selectDepartmentById(SecurityUtils.getLoginUser().getUser().getDepartmentId()); + if (ObjectUtils.isNotEmpty(department1)) { + preHospitalization.setDepartmentName(department1.getDepartmentName()); + } + } + // 查询病区 + if (StringUtils.isNotBlank(item.getWardName())) { + department.setAgencyName(item.getHospitalAgencyName()); + department.setDepartmentName(item.getWardName()); + department.setNodeType(NodeTypeConstants.WARD); + List deptList = departmentMapper.selectDepartmentList(department); + if (CollectionUtils.isNotEmpty(deptList)) { + preHospitalization.setWardId(deptList.get(0).getId()); + } + } - preHospitalization.setCreateTime(DateUtils.getNowDate()); - preHospitalization.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + preHospitalization.setCreateTime(LocalDateTime.now()); + preHospitalization.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - // 根据身份证号查询患者信息 - PatientInfoDto patientQuery = new PatientInfoDto(); - patientQuery.setCardNo(item.getCardNo()); - List patientInfoList = patientInfoMapper.selectPatientInfoList(patientQuery); - if (CollectionUtils.isNotEmpty(patientInfoList)) { - // 修改居民信息 - PatientInfo updInfo = patientInfoList.get(0); - BeanUtils.copyBeanProp(updInfo, item); - patientInfoMapper.updatePatientInfo(updInfo); - preHospitalization.setPatientId(patientInfoList.get(0).getId()); - } else { - PatientInfo saveInfo = new PatientInfo(); - // 添加居民 - BeanUtils.copyBeanProp(saveInfo, item); - patientInfoMapper.insertPatientInfo(saveInfo); - preHospitalization.setPatientId(saveInfo.getId()); - } - // 根据患者身份证号和预约时间查询是否有记录 - PatientPreHospitalization preHospitalizationQuery = new PatientPreHospitalization(); - preHospitalizationQuery.setCardNo(item.getCardNo()); - preHospitalizationQuery.setAppointmentDate(item.getAppointmentDate()); - List list = preHospitalizationMapper.selectApplyList(preHospitalizationQuery); - if (CollectionUtils.isEmpty(list)) { - // 新增 - saveList.add(preHospitalization); - } else { - // 有预约信息暂时不导入 - } - } - int insertCount = preHospitalizationMapper.insertBatch(saveList); - if (insertCount <= 0) { - throw new ServiceException("导入预住院信息失败,请联系管理员!"); - } - return AjaxResult.success(); - } + // 根据身份证号查询患者信息 + PatientInfoDto patientQuery = new PatientInfoDto(); + patientQuery.setCardNo(item.getCardNo()); + List patientInfoList = patientInfoMapper.selectPatientInfoList(patientQuery); + if (CollectionUtils.isNotEmpty(patientInfoList)) { + // 修改居民信息 + PatientInfo updInfo = patientInfoList.get(0); + BeanUtils.copyBeanProp(updInfo, item); + patientInfoMapper.updatePatientInfo(updInfo); + preHospitalization.setPatientId(patientInfoList.get(0).getId()); + } else { + PatientInfo saveInfo = new PatientInfo(); + // 添加居民 + BeanUtils.copyBeanProp(saveInfo, item); + patientInfoMapper.insertPatientInfo(saveInfo); + preHospitalization.setPatientId(saveInfo.getId()); + } + // 根据患者身份证号和预约时间查询是否有记录 + PatientPreHospitalization preHospitalizationQuery = new PatientPreHospitalization(); + preHospitalizationQuery.setCardNo(item.getCardNo()); + preHospitalizationQuery.setAppointmentDate(item.getAppointmentDate()); + List list = preHospitalizationMapper.selectApplyList(preHospitalizationQuery); + if (CollectionUtils.isEmpty(list)) { + // 新增 + saveList.add(preHospitalization); + } else { + // 有预约信息暂时不导入 + } + } + int insertCount = preHospitalizationMapper.insertBatch(saveList); + if (insertCount <= 0) { + throw new ServiceException("导入预住院信息失败,请联系管理员!"); + } + return AjaxResult.success(); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientpropaganda/impl/PatientPropagandaServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientpropaganda/impl/PatientPropagandaServiceImpl.java index 0fde1f51..eea5194e 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientpropaganda/impl/PatientPropagandaServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientpropaganda/impl/PatientPropagandaServiceImpl.java @@ -1,12 +1,13 @@ 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.mapper.patientpropaganda.PatientPropagandaMapper; 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业务层处理 @@ -49,8 +50,8 @@ public class PatientPropagandaServiceImpl implements IPatientPropagandaService { */ @Override public int insertPatientPropaganda(PatientPropaganda patientPropaganda) { - patientPropaganda.setCreateTime(DateUtils.getNowDate()); - return patientPropagandaMapper.insertPatientPropaganda(patientPropaganda); + patientPropaganda.setCreateTime(LocalDateTime.now()); + return patientPropagandaMapper.insertPatientPropaganda(patientPropaganda); } /** @@ -61,7 +62,7 @@ public class PatientPropagandaServiceImpl implements IPatientPropagandaService { */ @Override public int updatePatientPropaganda(PatientPropaganda patientPropaganda) { - patientPropaganda.setUpdateTime(DateUtils.getNowDate()); + patientPropaganda.setUpdateTime(LocalDateTime.now()); return patientPropagandaMapper.updatePatientPropaganda(patientPropaganda); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitinhospital/impl/PatientVisitInHospitalServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitinhospital/impl/PatientVisitInHospitalServiceImpl.java index 53d52e62..6fbd2882 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitinhospital/impl/PatientVisitInHospitalServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitinhospital/impl/PatientVisitInHospitalServiceImpl.java @@ -1,14 +1,15 @@ 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.mapper.patientvisitinhospital.PatientVisitInHospitalMapper; import com.xinelu.manage.service.patientvisitinhospital.IPatientVisitInHospitalService; +import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 患者就诊入院记录信息Service业务层处理 * @@ -31,17 +32,18 @@ public class PatientVisitInHospitalServiceImpl implements IPatientVisitInHospita return patientVisitInHospitalMapper.selectPatientVisitInHospitalById(id); } - @Override public PatientVisitInHospital getByVisitRecord(Long patientVisitRecordId) { - PatientVisitInHospital patientVisitInHospital = new PatientVisitInHospital(); - patientVisitInHospital.setPatientVisitRecordId(patientVisitRecordId); - List list = patientVisitInHospitalMapper.selectPatientVisitInHospitalList(patientVisitInHospital); - if (CollectionUtils.isEmpty(list)) { - return null; - } - return list.get(0); - } + @Override + public PatientVisitInHospital getByVisitRecord(Long patientVisitRecordId) { + PatientVisitInHospital patientVisitInHospital = new PatientVisitInHospital(); + patientVisitInHospital.setPatientVisitRecordId(patientVisitRecordId); + List list = patientVisitInHospitalMapper.selectPatientVisitInHospitalList(patientVisitInHospital); + if (CollectionUtils.isEmpty(list)) { + return null; + } + return list.get(0); + } - /** + /** * 查询患者就诊入院记录信息列表 * * @param patientVisitInHospital 患者就诊入院记录信息 @@ -60,8 +62,8 @@ public class PatientVisitInHospitalServiceImpl implements IPatientVisitInHospita */ @Override public int insertPatientVisitInHospital(PatientVisitInHospital patientVisitInHospital) { - patientVisitInHospital.setCreateTime(DateUtils.getNowDate()); - return patientVisitInHospitalMapper.insertPatientVisitInHospital(patientVisitInHospital); + patientVisitInHospital.setCreateTime(LocalDateTime.now()); + return patientVisitInHospitalMapper.insertPatientVisitInHospital(patientVisitInHospital); } /** @@ -72,7 +74,7 @@ public class PatientVisitInHospitalServiceImpl implements IPatientVisitInHospita */ @Override public int updatePatientVisitInHospital(PatientVisitInHospital patientVisitInHospital) { - patientVisitInHospital.setUpdateTime(DateUtils.getNowDate()); + patientVisitInHospital.setUpdateTime(LocalDateTime.now()); return patientVisitInHospitalMapper.updatePatientVisitInHospital(patientVisitInHospital); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitoperation/impl/PatientVisitOperationServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitoperation/impl/PatientVisitOperationServiceImpl.java index 02b2c44f..43802a24 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitoperation/impl/PatientVisitOperationServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitoperation/impl/PatientVisitOperationServiceImpl.java @@ -1,14 +1,15 @@ 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.mapper.patientvisitoperation.PatientVisitOperationMapper; import com.xinelu.manage.service.patientvisitoperation.IPatientVisitOperationService; +import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 患者就诊手术记录信息Service业务层处理 * @@ -42,17 +43,18 @@ public class PatientVisitOperationServiceImpl implements IPatientVisitOperationS return patientVisitOperationMapper.selectPatientVisitOperationList(patientVisitOperation); } - @Override public PatientVisitOperation getByVisitRecord(Long patientVisitRecordId) { - PatientVisitOperation patientVisitOperation = new PatientVisitOperation(); - patientVisitOperation.setPatientVisitRecordId(patientVisitRecordId); - List operations = patientVisitOperationMapper.selectPatientVisitOperationList(patientVisitOperation); - if (CollectionUtils.isEmpty(operations)) { - return null; - } - return operations.get(0); - } + @Override + public PatientVisitOperation getByVisitRecord(Long patientVisitRecordId) { + PatientVisitOperation patientVisitOperation = new PatientVisitOperation(); + patientVisitOperation.setPatientVisitRecordId(patientVisitRecordId); + List operations = patientVisitOperationMapper.selectPatientVisitOperationList(patientVisitOperation); + if (CollectionUtils.isEmpty(operations)) { + return null; + } + return operations.get(0); + } - /** + /** * 新增患者就诊手术记录信息 * * @param patientVisitOperation 患者就诊手术记录信息 @@ -60,8 +62,8 @@ public class PatientVisitOperationServiceImpl implements IPatientVisitOperationS */ @Override public int insertPatientVisitOperation(PatientVisitOperation patientVisitOperation) { - patientVisitOperation.setCreateTime(DateUtils.getNowDate()); - return patientVisitOperationMapper.insertPatientVisitOperation(patientVisitOperation); + patientVisitOperation.setCreateTime(LocalDateTime.now()); + return patientVisitOperationMapper.insertPatientVisitOperation(patientVisitOperation); } /** @@ -72,7 +74,7 @@ public class PatientVisitOperationServiceImpl implements IPatientVisitOperationS */ @Override public int updatePatientVisitOperation(PatientVisitOperation patientVisitOperation) { - patientVisitOperation.setUpdateTime(DateUtils.getNowDate()); + patientVisitOperation.setUpdateTime(LocalDateTime.now()); return patientVisitOperationMapper.updatePatientVisitOperation(patientVisitOperation); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitouthospital/impl/PatientVisitOutHospitalServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitouthospital/impl/PatientVisitOutHospitalServiceImpl.java index d71a742e..64148411 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitouthospital/impl/PatientVisitOutHospitalServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitouthospital/impl/PatientVisitOutHospitalServiceImpl.java @@ -1,14 +1,16 @@ package com.xinelu.manage.service.patientvisitouthospital.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.patientvisitouthospital.PatientVisitOutHospitalMapper; +import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.patientvisitouthospital.PatientVisitOutHospital; +import com.xinelu.manage.mapper.patientvisitouthospital.PatientVisitOutHospitalMapper; import com.xinelu.manage.service.patientvisitouthospital.IPatientVisitOutHospitalService; +import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 患者就诊出院记录信息Service业务层处理 * @@ -42,17 +44,18 @@ public class PatientVisitOutHospitalServiceImpl implements IPatientVisitOutHospi return patientVisitOutHospitalMapper.selectPatientVisitOutHospitalList(patientVisitOutHospital); } - @Override public PatientVisitOutHospital getByVisitRecord(Long patientVisitRecordId) { - PatientVisitOutHospital patientVisitOutHospital = new PatientVisitOutHospital(); - patientVisitOutHospital.setPatientVisitRecordId(patientVisitRecordId); - List list = patientVisitOutHospitalMapper.selectPatientVisitOutHospitalList(patientVisitOutHospital); - if (CollectionUtils.isEmpty(list)) { - return null; - } - return list.get(0); - } + @Override + public PatientVisitOutHospital getByVisitRecord(Long patientVisitRecordId) { + PatientVisitOutHospital patientVisitOutHospital = new PatientVisitOutHospital(); + patientVisitOutHospital.setPatientVisitRecordId(patientVisitRecordId); + List list = patientVisitOutHospitalMapper.selectPatientVisitOutHospitalList(patientVisitOutHospital); + if (CollectionUtils.isEmpty(list)) { + return null; + } + return list.get(0); + } - /** + /** * 新增患者就诊出院记录信息 * * @param patientVisitOutHospital 患者就诊出院记录信息 @@ -60,8 +63,8 @@ public class PatientVisitOutHospitalServiceImpl implements IPatientVisitOutHospi */ @Override public int insertPatientVisitOutHospital(PatientVisitOutHospital patientVisitOutHospital) { - patientVisitOutHospital.setCreateTime(DateUtils.getNowDate()); - return patientVisitOutHospitalMapper.insertPatientVisitOutHospital(patientVisitOutHospital); + patientVisitOutHospital.setCreateTime(LocalDateTime.now()); + return patientVisitOutHospitalMapper.insertPatientVisitOutHospital(patientVisitOutHospital); } /** @@ -72,7 +75,7 @@ public class PatientVisitOutHospitalServiceImpl implements IPatientVisitOutHospi */ @Override public int updatePatientVisitOutHospital(PatientVisitOutHospital patientVisitOutHospital) { - patientVisitOutHospital.setUpdateTime(DateUtils.getNowDate()); + patientVisitOutHospital.setUpdateTime(LocalDateTime.now()); return patientVisitOutHospitalMapper.updatePatientVisitOutHospital(patientVisitOutHospital); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitrecord/impl/PatientVisitRecordServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitrecord/impl/PatientVisitRecordServiceImpl.java index 0bee65c1..c71cb61f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitrecord/impl/PatientVisitRecordServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitrecord/impl/PatientVisitRecordServiceImpl.java @@ -5,7 +5,6 @@ import com.xinelu.common.constant.NodeTypeConstants; import com.xinelu.common.constant.VisitTypeConstants; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; 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.patientvisitrecord.PatientVisitRecordMapper; 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.LocalDateTime; import java.time.ZoneId; import java.time.temporal.ChronoUnit; 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.lang3.BooleanUtils; -import org.apache.commons.lang3.ObjectUtils; -import org.springframework.stereotype.Service; /** * 患者就诊记录基本信息Service业务层处理 @@ -45,14 +46,14 @@ import org.springframework.stereotype.Service; public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService { @Resource private PatientVisitRecordMapper patientVisitRecordMapper; - @Resource - private RegexUtil regexUtil; - @Resource - private PatientInfoMapper patientMapper; - @Resource - private AgencyMapper agencyMapper; - @Resource - private DepartmentMapper departmentMapper; + @Resource + private RegexUtil regexUtil; + @Resource + private PatientInfoMapper patientMapper; + @Resource + private AgencyMapper agencyMapper; + @Resource + private DepartmentMapper departmentMapper; /** * 查询患者就诊记录基本信息 @@ -84,29 +85,30 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService */ @Override public int insertPatientVisitRecord(PatientVisitRecord patientVisitRecord) { - patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - patientVisitRecord.setCreateTime(DateUtils.getNowDate()); - return patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord); + patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + patientVisitRecord.setCreateTime(LocalDateTime.now()); + return patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord); } - @Override public int saveRecord(PatientVisitRecordSaveDto saveDto) { - PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); - // 查询患者信息 - PatientInfo patientInfo = patientMapper.selectPatientInfoById(saveDto.getPatientId()); - BeanUtils.copyBeanProp(patientVisitRecord, patientInfo); - BeanUtils.copyBeanProp(patientVisitRecord, saveDto); - patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - patientVisitRecord.setCreateTime(DateUtils.getNowDate()); - // 住院时间,出院时间-入院时间 - LocalDate admissionTime = saveDto.getAdmissionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - LocalDate dischargeTime = saveDto.getDischargeTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - long daysBetween = ChronoUnit.DAYS.between(admissionTime, dischargeTime); - patientVisitRecord.setHospitalizationDays((int) daysBetween + 1); - patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord); - return 0; - } + @Override + public int saveRecord(PatientVisitRecordSaveDto saveDto) { + PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); + // 查询患者信息 + PatientInfo patientInfo = patientMapper.selectPatientInfoById(saveDto.getPatientId()); + BeanUtils.copyBeanProp(patientVisitRecord, patientInfo); + BeanUtils.copyBeanProp(patientVisitRecord, saveDto); + 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(); + long daysBetween = ChronoUnit.DAYS.between(admissionTime, dischargeTime); + patientVisitRecord.setHospitalizationDays((int) daysBetween + 1); + patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord); + return 0; + } - /** + /** * 修改患者就诊记录基本信息 * * @param updDto 患者就诊记录基本信息 @@ -114,16 +116,16 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService */ @Override public int updatePatientVisitRecord(PatientVisitRecordSaveDto updDto) { - PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); - BeanUtils.copyBeanProp(patientVisitRecord, updDto); - patientVisitRecord.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - patientVisitRecord.setUpdateTime(DateUtils.getNowDate()); - // 住院时间,出院时间-入院时间 - LocalDate admissionTime = updDto.getAdmissionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - LocalDate dischargeTime = updDto.getDischargeTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - long daysBetween = ChronoUnit.DAYS.between(admissionTime, dischargeTime); - patientVisitRecord.setHospitalizationDays((int) daysBetween + 1); - patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord); + PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); + BeanUtils.copyBeanProp(patientVisitRecord, updDto); + patientVisitRecord.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + patientVisitRecord.setUpdateTime(LocalDateTime.now()); + // 住院时间,出院时间-入院时间 + LocalDate admissionTime = updDto.getAdmissionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate dischargeTime = updDto.getDischargeTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + long daysBetween = ChronoUnit.DAYS.between(admissionTime, dischargeTime); + patientVisitRecord.setHospitalizationDays((int) daysBetween + 1); + patientVisitRecordMapper.insertPatientVisitRecord(patientVisitRecord); return patientVisitRecordMapper.updatePatientVisitRecord(patientVisitRecord); } @@ -149,137 +151,137 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService return patientVisitRecordMapper.deletePatientVisitRecordById(id); } - @Override - public AjaxResult importPatientList(List patientList, String patientType) { - //判断添加的数据是否为空 - if (CollectionUtils.isEmpty(patientList)) { - return AjaxResult.error("请添加就诊信息导入信息!"); - } - // 根据患者身份证号做去除处理 - List 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()); - if (StringUtils.isNotBlank(patient.getPatientPhone())) { - return AjaxResult.error("当前患者联系电话:" + patient.getPatientPhone() + " 格式不正确,请重新录入!"); - } + @Override + public AjaxResult importPatientList(List patientList, String patientType) { + //判断添加的数据是否为空 + if (CollectionUtils.isEmpty(patientList)) { + return AjaxResult.error("请添加就诊信息导入信息!"); + } + // 根据患者身份证号做去除处理 + List 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()); + if (StringUtils.isNotBlank(patient.getPatientPhone())) { + return AjaxResult.error("当前患者联系电话:" + patient.getPatientPhone() + " 格式不正确,请重新录入!"); + } - List saveList = new ArrayList<>(); - for (PatientVisitRecordImportDto item : importDataList) { - PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); - BeanUtils.copyProperties(item, patientVisitRecord); - patientVisitRecord.setCreateTime(DateUtils.getNowDate()); - patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - switch (patientType) { - // 在院患者 - case Constants.IN_HOSPITAL: - case Constants.DISCHARGED: - patientVisitRecord.setVisitType(VisitTypeConstants.BE_HOSPITALIZED); - break; - // 门诊患者 - case Constants.OUTPATIENT: - patientVisitRecord.setVisitType(VisitTypeConstants.OUTPATIENT_SERVICE); - patientVisitRecord.setInHospitalNumber(item.getOutpatientNumber());// 门诊、住院号共用一个字段 - break; - } - // 根据身份证号查询患者信息 - PatientInfoDto patientQuery = new PatientInfoDto(); - patientQuery.setCardNo(item.getCardNo()); - List patientInfoList = patientMapper.selectPatientInfoList(patientQuery); - if (CollectionUtils.isNotEmpty(patientInfoList)) { - // 修改居民信息 - PatientInfo updInfo = patientInfoList.get(0); - BeanUtils.copyBeanProp(updInfo, item); - patientMapper.updatePatientInfo(updInfo); - patientVisitRecord.setPatientId(patientInfoList.get(0).getId()); - } else { - PatientInfo saveInfo = new PatientInfo(); - // 添加居民 - BeanUtils.copyBeanProp(saveInfo, item); - patientMapper.insertPatientInfo(saveInfo); - patientVisitRecord.setPatientId(saveInfo.getId()); - } - // 根据医院名称查询医院id - Agency agency = new Agency(); - if (StringUtils.isNotBlank(item.getHospitalAgencyName())) { - agency.setAgencyName(item.getHospitalAgencyName()); - agency.setNodeType(NodeTypeConstants.HOSPITAL); - List agencyList = agencyMapper.selectAgencyList(agency); - if (CollectionUtils.isNotEmpty(agencyList)) { - patientVisitRecord.setHospitalAgencyId(agencyList.get(0).getId()); - } - } else { - patientVisitRecord.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getAgencyId()); - Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getAgencyId()); - if (ObjectUtils.isNotEmpty(agencyData)) { - patientVisitRecord.setHospitalAgencyName(agencyData.getAgencyName()); - } - } - // 查询院区id - if (StringUtils.isNotBlank(item.getCampusAgencyName())) { - agency.setAgencyName(item.getWardName()); - agency.setNodeType(NodeTypeConstants.CAMPUS); - List campusList = agencyMapper.selectAgencyList(agency); - if (CollectionUtils.isNotEmpty(campusList)) { - patientVisitRecord.setCampusAgencyId(campusList.get(0).getId()); - } - } + List saveList = new ArrayList<>(); + for (PatientVisitRecordImportDto item : importDataList) { + PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); + BeanUtils.copyProperties(item, patientVisitRecord); + patientVisitRecord.setCreateTime(LocalDateTime.now()); + patientVisitRecord.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + switch (patientType) { + // 在院患者 + case Constants.IN_HOSPITAL: + case Constants.DISCHARGED: + patientVisitRecord.setVisitType(VisitTypeConstants.BE_HOSPITALIZED); + break; + // 门诊患者 + case Constants.OUTPATIENT: + patientVisitRecord.setVisitType(VisitTypeConstants.OUTPATIENT_SERVICE); + patientVisitRecord.setInHospitalNumber(item.getOutpatientNumber());// 门诊、住院号共用一个字段 + break; + } + // 根据身份证号查询患者信息 + PatientInfoDto patientQuery = new PatientInfoDto(); + patientQuery.setCardNo(item.getCardNo()); + List patientInfoList = patientMapper.selectPatientInfoList(patientQuery); + if (CollectionUtils.isNotEmpty(patientInfoList)) { + // 修改居民信息 + PatientInfo updInfo = patientInfoList.get(0); + BeanUtils.copyBeanProp(updInfo, item); + patientMapper.updatePatientInfo(updInfo); + patientVisitRecord.setPatientId(patientInfoList.get(0).getId()); + } else { + PatientInfo saveInfo = new PatientInfo(); + // 添加居民 + BeanUtils.copyBeanProp(saveInfo, item); + patientMapper.insertPatientInfo(saveInfo); + patientVisitRecord.setPatientId(saveInfo.getId()); + } + // 根据医院名称查询医院id + Agency agency = new Agency(); + if (StringUtils.isNotBlank(item.getHospitalAgencyName())) { + agency.setAgencyName(item.getHospitalAgencyName()); + agency.setNodeType(NodeTypeConstants.HOSPITAL); + List agencyList = agencyMapper.selectAgencyList(agency); + if (CollectionUtils.isNotEmpty(agencyList)) { + patientVisitRecord.setHospitalAgencyId(agencyList.get(0).getId()); + } + } else { + patientVisitRecord.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getAgencyId()); + Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getAgencyId()); + if (ObjectUtils.isNotEmpty(agencyData)) { + patientVisitRecord.setHospitalAgencyName(agencyData.getAgencyName()); + } + } + // 查询院区id + if (StringUtils.isNotBlank(item.getCampusAgencyName())) { + agency.setAgencyName(item.getWardName()); + agency.setNodeType(NodeTypeConstants.CAMPUS); + List campusList = agencyMapper.selectAgencyList(agency); + if (CollectionUtils.isNotEmpty(campusList)) { + patientVisitRecord.setCampusAgencyId(campusList.get(0).getId()); + } + } - // 查询科室id - Department department = new Department(); - if (StringUtils.isNotBlank(item.getDepartmentName())) { - department.setAgencyName(item.getHospitalAgencyName()); - department.setDepartmentName(item.getDepartmentName()); - department.setNodeType(NodeTypeConstants.DEPARTMENT); - List deptList = departmentMapper.selectDepartmentList(department); - if (CollectionUtils.isNotEmpty(deptList)) { - patientVisitRecord.setDepartmentId(deptList.get(0).getId()); - } - } else { - patientVisitRecord.setDepartmentId(SecurityUtils.getLoginUser().getUser().getDepartmentId()); - Department department1 = departmentMapper.selectDepartmentById(SecurityUtils.getLoginUser().getUser().getDepartmentId()); - if (ObjectUtils.isNotEmpty(department1)) { - patientVisitRecord.setDepartmentName(department1.getDepartmentName()); - } - } - // 查询病区 - if (StringUtils.isNotBlank(item.getWardName())) { - department.setAgencyName(item.getHospitalAgencyName()); - department.setDepartmentName(item.getWardName()); - department.setNodeType(NodeTypeConstants.WARD); - List deptList = departmentMapper.selectDepartmentList(department); - if (CollectionUtils.isNotEmpty(deptList)) { - patientVisitRecord.setWardId(deptList.get(0).getId()); - } - } - // 根据门诊/住院编号查询是否有记录 - PatientVisitRecordDto recordQuery = new PatientVisitRecordDto(); - recordQuery.setVisitType(patientType); - recordQuery.setInHospitalNumber(patientVisitRecord.getInHospitalInfo()); - List patientVisitRecordList = patientVisitRecordMapper.selectPatientVisitRecordList(recordQuery); - if (CollectionUtils.isEmpty(patientVisitRecordList)) { - // 新增 - saveList.add(patientVisitRecord); - } else { - // 修改 - patientVisitRecord.setId(patientVisitRecordList.get(0).getId()); - int flag = patientVisitRecordMapper.updatePatientVisitRecord(patientVisitRecord); - if (flag < 0) { - throw new ServiceException("导入患者就诊信息失败,请联系管理员!"); - } - } - } - int insertCount = patientVisitRecordMapper.insertBatch(saveList); - if (insertCount <= 0) { - throw new ServiceException("导入患者就诊信息失败,请联系管理员!"); - } - return AjaxResult.success(); - } + // 查询科室id + Department department = new Department(); + if (StringUtils.isNotBlank(item.getDepartmentName())) { + department.setAgencyName(item.getHospitalAgencyName()); + department.setDepartmentName(item.getDepartmentName()); + department.setNodeType(NodeTypeConstants.DEPARTMENT); + List deptList = departmentMapper.selectDepartmentList(department); + if (CollectionUtils.isNotEmpty(deptList)) { + patientVisitRecord.setDepartmentId(deptList.get(0).getId()); + } + } else { + patientVisitRecord.setDepartmentId(SecurityUtils.getLoginUser().getUser().getDepartmentId()); + Department department1 = departmentMapper.selectDepartmentById(SecurityUtils.getLoginUser().getUser().getDepartmentId()); + if (ObjectUtils.isNotEmpty(department1)) { + patientVisitRecord.setDepartmentName(department1.getDepartmentName()); + } + } + // 查询病区 + if (StringUtils.isNotBlank(item.getWardName())) { + department.setAgencyName(item.getHospitalAgencyName()); + department.setDepartmentName(item.getWardName()); + department.setNodeType(NodeTypeConstants.WARD); + List deptList = departmentMapper.selectDepartmentList(department); + if (CollectionUtils.isNotEmpty(deptList)) { + patientVisitRecord.setWardId(deptList.get(0).getId()); + } + } + // 根据门诊/住院编号查询是否有记录 + PatientVisitRecordDto recordQuery = new PatientVisitRecordDto(); + recordQuery.setVisitType(patientType); + recordQuery.setInHospitalNumber(patientVisitRecord.getInHospitalInfo()); + List patientVisitRecordList = patientVisitRecordMapper.selectPatientVisitRecordList(recordQuery); + if (CollectionUtils.isEmpty(patientVisitRecordList)) { + // 新增 + saveList.add(patientVisitRecord); + } else { + // 修改 + patientVisitRecord.setId(patientVisitRecordList.get(0).getId()); + int flag = patientVisitRecordMapper.updatePatientVisitRecord(patientVisitRecord); + if (flag < 0) { + throw new ServiceException("导入患者就诊信息失败,请联系管理员!"); + } + } + } + int insertCount = patientVisitRecordMapper.insertBatch(saveList); + if (insertCount <= 0) { + throw new ServiceException("导入患者就诊信息失败,请联系管理员!"); + } + return AjaxResult.success(); + } - public static void main(String[] args) { - LocalDate date1 = LocalDate.of(2020, 1, 1); - LocalDate date2 = LocalDate.of(2020, 1, 2); + public static void main(String[] args) { + LocalDate date1 = LocalDate.of(2020, 1, 1); + LocalDate date2 = LocalDate.of(2020, 1, 2); - long daysBetween = ChronoUnit.DAYS.between(date1, date2); - System.out.println("Days between: " + daysBetween); - } + long daysBetween = ChronoUnit.DAYS.between(date1, date2); + System.out.println("Days between: " + daysBetween); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/project/impl/ProjectServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/project/impl/ProjectServiceImpl.java index 436b1708..b20cb859 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/project/impl/ProjectServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/project/impl/ProjectServiceImpl.java @@ -1,17 +1,18 @@ package com.xinelu.manage.service.project.impl; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; import com.xinelu.manage.domain.project.Project; import com.xinelu.manage.mapper.project.ProjectMapper; import com.xinelu.manage.service.project.IProjectService; -import java.util.List; -import javax.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 检测项目Service业务层处理 * @@ -53,21 +54,21 @@ public class ProjectServiceImpl implements IProjectService { */ @Override public int insertProject(Project project) { - if (StringUtils.isBlank(project.getProjectName())) { - throw new ServiceException("请输入检测项目名称"); - } - if (StringUtils.isBlank(project.getProjectCode())) { - throw new ServiceException("请输入检测项目编码"); - } - // 查询是否有相同code的检测项目 - List projects = projectMapper.hasSameCodeProject(null, project.getGroupId(), project.getProjectCode()); - if (CollectionUtils.isNotEmpty(projects)) { - throw new ServiceException("已存在编码为【"+project.getProjectCode() +"】的检测项目"); - } - project.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - project.setCreateTime(DateUtils.getNowDate()); - project.setDelFlag(0); - return projectMapper.insertProject(project); + if (StringUtils.isBlank(project.getProjectName())) { + throw new ServiceException("请输入检测项目名称"); + } + if (StringUtils.isBlank(project.getProjectCode())) { + throw new ServiceException("请输入检测项目编码"); + } + // 查询是否有相同code的检测项目 + List projects = projectMapper.hasSameCodeProject(null, project.getGroupId(), project.getProjectCode()); + if (CollectionUtils.isNotEmpty(projects)) { + throw new ServiceException("已存在编码为【" + project.getProjectCode() + "】的检测项目"); + } + project.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + project.setCreateTime(LocalDateTime.now()); + project.setDelFlag(0); + return projectMapper.insertProject(project); } /** @@ -78,13 +79,13 @@ public class ProjectServiceImpl implements IProjectService { */ @Override public int updateProject(Project project) { - // 查询是否有相同code的检测项目 - List projects = projectMapper.hasSameCodeProject(project.getId(), project.getGroupId(), project.getProjectCode()); - if (CollectionUtils.isNotEmpty(projects)) { - throw new ServiceException("已存在编码为【"+project.getProjectCode() +"】的检测项目"); - } - project.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - project.setUpdateTime(DateUtils.getNowDate()); + // 查询是否有相同code的检测项目 + List projects = projectMapper.hasSameCodeProject(project.getId(), project.getGroupId(), project.getProjectCode()); + if (CollectionUtils.isNotEmpty(projects)) { + throw new ServiceException("已存在编码为【" + project.getProjectCode() + "】的检测项目"); + } + project.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + project.setUpdateTime(LocalDateTime.now()); return projectMapper.updateProject(project); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectdevice/impl/ProjectDeviceServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectdevice/impl/ProjectDeviceServiceImpl.java index 300377a4..6f0ae5a1 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectdevice/impl/ProjectDeviceServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectdevice/impl/ProjectDeviceServiceImpl.java @@ -8,6 +8,8 @@ import com.xinelu.common.utils.StringUtils; import com.xinelu.manage.domain.projectdevice.ProjectDevice; import com.xinelu.manage.mapper.projectdevice.ProjectDeviceMapper; import com.xinelu.manage.service.projectdevice.IProjectDeviceService; + +import java.time.LocalDateTime; import java.util.List; import javax.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; @@ -74,9 +76,9 @@ public class ProjectDeviceServiceImpl implements IProjectDeviceService { throw new ServiceException("该设备已被绑定,请解绑后重新绑定"); } projectDevice.setDeviceStatus(DeviceStatusConstants.BIND); - projectDevice.setDeviceBindTime(DateUtils.getNowDate()); + projectDevice.setDeviceBindTime(LocalDateTime.now()); projectDevice.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - projectDevice.setCreateTime(DateUtils.getNowDate()); + projectDevice.setCreateTime(LocalDateTime.now()); return projectDeviceMapper.insertProjectDevice(projectDevice); } @@ -89,7 +91,7 @@ public class ProjectDeviceServiceImpl implements IProjectDeviceService { @Override public int updateProjectDevice(ProjectDevice projectDevice) { projectDevice.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - projectDevice.setUpdateTime(DateUtils.getNowDate()); + projectDevice.setUpdateTime(LocalDateTime.now()); return projectDeviceMapper.updateProjectDevice(projectDevice); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectgroup/impl/ProjectGroupServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectgroup/impl/ProjectGroupServiceImpl.java index d6bb22af..67bd2f8a 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectgroup/impl/ProjectGroupServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectgroup/impl/ProjectGroupServiceImpl.java @@ -1,19 +1,20 @@ package com.xinelu.manage.service.projectgroup.impl; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; import com.xinelu.manage.domain.projectgroup.ProjectGroup; import com.xinelu.manage.dto.projectgroup.ProjectGroupSaveListDto; import com.xinelu.manage.mapper.projectgroup.ProjectGroupMapper; 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.lang3.ObjectUtils; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 检测项目分组Service业务层处理 * @@ -47,7 +48,7 @@ public class ProjectGroupServiceImpl implements IProjectGroupService { return projectGroupMapper.selectProjectGroupList(projectGroup); } - /** + /** * 新增检测项目分组 * * @param projectGroup 检测项目分组 @@ -55,47 +56,48 @@ public class ProjectGroupServiceImpl implements IProjectGroupService { */ @Override public int insertProjectGroup(ProjectGroup projectGroup) { - if (StringUtils.isBlank(projectGroup.getGroupName())) { - throw new ServiceException("请输入检测项目分组名称"); - } - if (StringUtils.isBlank(projectGroup.getGroupCode())) { - throw new ServiceException("请输入检测项目分组编码"); - } - // 查询是否有相同编码的项目组 - List list = projectGroupMapper.hasSameCodeGroup(null, projectGroup.getGroupCode()); - if (CollectionUtils.isNotEmpty(list)) { - throw new ServiceException("已存在编码为【"+projectGroup.getGroupCode() +"】的分组"); - } - projectGroup.setCreateTime(DateUtils.getNowDate()); - projectGroup.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - projectGroup.setDelFlag(0); + if (StringUtils.isBlank(projectGroup.getGroupName())) { + throw new ServiceException("请输入检测项目分组名称"); + } + if (StringUtils.isBlank(projectGroup.getGroupCode())) { + throw new ServiceException("请输入检测项目分组编码"); + } + // 查询是否有相同编码的项目组 + List list = projectGroupMapper.hasSameCodeGroup(null, projectGroup.getGroupCode()); + if (CollectionUtils.isNotEmpty(list)) { + throw new ServiceException("已存在编码为【" + projectGroup.getGroupCode() + "】的分组"); + } + projectGroup.setCreateTime(LocalDateTime.now()); + projectGroup.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + projectGroup.setDelFlag(0); return projectGroupMapper.insertProjectGroup(projectGroup); } - @Override public int insertList(ProjectGroupSaveListDto saveDto) { - if (ObjectUtils.isNotEmpty(saveDto)) { - List list = saveDto.getList(); - if (CollectionUtils.isNotEmpty(list)) { - for (ProjectGroup projectGroup : list) { - // 查询是否有相同编码的项目组 - List groupList = projectGroupMapper.hasSameCodeGroup(null, projectGroup.getGroupCode()); - if (CollectionUtils.isNotEmpty(groupList)) { - throw new ServiceException("已存在编码为【"+projectGroup.getGroupCode() +"】的分组"); - } - projectGroup.setCreateTime(DateUtils.getNowDate()); - projectGroup.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - projectGroup.setDelFlag(0); - } - return projectGroupMapper.insertBatch(list); - } else { - throw new ServiceException("传输数据错误"); - } - } else { - throw new ServiceException("传输数据错误"); - } - } + @Override + public int insertList(ProjectGroupSaveListDto saveDto) { + if (ObjectUtils.isNotEmpty(saveDto)) { + List list = saveDto.getList(); + if (CollectionUtils.isNotEmpty(list)) { + for (ProjectGroup projectGroup : list) { + // 查询是否有相同编码的项目组 + List groupList = projectGroupMapper.hasSameCodeGroup(null, projectGroup.getGroupCode()); + if (CollectionUtils.isNotEmpty(groupList)) { + throw new ServiceException("已存在编码为【" + projectGroup.getGroupCode() + "】的分组"); + } + projectGroup.setCreateTime(LocalDateTime.now()); + projectGroup.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + projectGroup.setDelFlag(0); + } + return projectGroupMapper.insertBatch(list); + } else { + throw new ServiceException("传输数据错误"); + } + } else { + throw new ServiceException("传输数据错误"); + } + } - /** + /** * 修改检测项目分组 * * @param projectGroup 检测项目分组 @@ -103,13 +105,13 @@ public class ProjectGroupServiceImpl implements IProjectGroupService { */ @Override public int updateProjectGroup(ProjectGroup projectGroup) { - // 查询是否有相同编码的项目组 - List groupList = projectGroupMapper.hasSameCodeGroup(projectGroup.getId(), projectGroup.getGroupCode()); - if (CollectionUtils.isNotEmpty(groupList)) { - throw new ServiceException("已存在编码为【"+projectGroup.getGroupCode() +"】的分组"); - } - projectGroup.setUpdateTime(DateUtils.getNowDate()); - projectGroup.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + // 查询是否有相同编码的项目组 + List groupList = projectGroupMapper.hasSameCodeGroup(projectGroup.getId(), projectGroup.getGroupCode()); + if (CollectionUtils.isNotEmpty(groupList)) { + throw new ServiceException("已存在编码为【" + projectGroup.getGroupCode() + "】的分组"); + } + projectGroup.setUpdateTime(LocalDateTime.now()); + projectGroup.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); return projectGroupMapper.updateProjectGroup(projectGroup); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectresult/impl/ProjectResultServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectresult/impl/ProjectResultServiceImpl.java index 7cb99d0e..11362df8 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectresult/impl/ProjectResultServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/projectresult/impl/ProjectResultServiceImpl.java @@ -1,7 +1,6 @@ package com.xinelu.manage.service.projectresult.impl; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.StringUtils; import com.xinelu.manage.domain.project.Project; 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.vo.projectresult.ProjectResultStatisticVo; 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.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import javax.annotation.Resource; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; /** -* @author haown -* @description 针对表【project_result(检测项目结果表)】的数据库操作Service实现 -* @createDate 2024-03-06 10:40:56 -*/ + * @author haown + * @description 针对表【project_result(检测项目结果表)】的数据库操作Service实现 + * @createDate 2024-03-06 10:40:56 + */ @Service public class ProjectResultServiceImpl implements IProjectResultService { - @Resource - private ProjectGroupMapper projectGroupMapper; - @Resource - private ProjectMapper projectMapper; - @Resource - private ProjectResultMapper projectResultMapper; + @Resource + private ProjectGroupMapper projectGroupMapper; + @Resource + private ProjectMapper projectMapper; + @Resource + private ProjectResultMapper projectResultMapper; - /** - * 查询检测项目结果 - * - * @param id 检测项目结果主键 - * @return 检测项目结果 - */ - @Override - public ProjectResult selectProjectResultById(Long id) { - return projectResultMapper.selectProjectResultById(id); - } + /** + * 查询检测项目结果 + * + * @param id 检测项目结果主键 + * @return 检测项目结果 + */ + @Override + public ProjectResult selectProjectResultById(Long id) { + return projectResultMapper.selectProjectResultById(id); + } - /** - * 查询检测项目结果列表 - * - * @param projectResult 检测项目结果 - * @return 检测项目结果 - */ - @Override - public List selectProjectResultList(ProjectResult projectResult) { - return projectResultMapper.selectProjectResultList(projectResult); - } + /** + * 查询检测项目结果列表 + * + * @param projectResult 检测项目结果 + * @return 检测项目结果 + */ + @Override + public List selectProjectResultList(ProjectResult projectResult) { + return projectResultMapper.selectProjectResultList(projectResult); + } - /** - * 新增检测项目结果 - * - * @param projectResult 检测项目结果 - * @return 结果 - */ - @Override - public int insertProjectResult(ProjectResult projectResult) { - projectResult.setCreateTime(DateUtils.getNowDate()); - return projectResultMapper.insertProjectResult(projectResult); - } + /** + * 新增检测项目结果 + * + * @param projectResult 检测项目结果 + * @return 结果 + */ + @Override + public int insertProjectResult(ProjectResult projectResult) { + projectResult.setCreateTime(LocalDateTime.now()); + return projectResultMapper.insertProjectResult(projectResult); + } - /** - * 修改检测项目结果 - * - * @param projectResult 检测项目结果 - * @return 结果 - */ - @Override - public int updateProjectResult(ProjectResult projectResult) { - projectResult.setUpdateTime(DateUtils.getNowDate()); - return projectResultMapper.updateProjectResult(projectResult); - } + /** + * 修改检测项目结果 + * + * @param projectResult 检测项目结果 + * @return 结果 + */ + @Override + public int updateProjectResult(ProjectResult projectResult) { + projectResult.setUpdateTime(LocalDateTime.now()); + return projectResultMapper.updateProjectResult(projectResult); + } - /** - * 批量删除检测项目结果 - * - * @param ids 需要删除的检测项目结果主键 - * @return 结果 - */ - @Override - public int deleteProjectResultByIds(Long[] ids) { - return projectResultMapper.deleteProjectResultByIds(ids); - } + /** + * 批量删除检测项目结果 + * + * @param ids 需要删除的检测项目结果主键 + * @return 结果 + */ + @Override + public int deleteProjectResultByIds(Long[] ids) { + return projectResultMapper.deleteProjectResultByIds(ids); + } - /** - * 删除检测项目结果信息 - * - * @param id 检测项目结果主键 - * @return 结果 - */ - @Override - public int deleteProjectResultById(Long id) { - return projectResultMapper.deleteProjectResultById(id); - } + /** + * 删除检测项目结果信息 + * + * @param id 检测项目结果主键 + * @return 结果 + */ + @Override + public int deleteProjectResultById(Long id) { + return projectResultMapper.deleteProjectResultById(id); + } - @Override - public ProjectResultStatisticVo curveStatistics(ProjectResultStatisticDto projectResultStatisticDto) { - // 根据groupCode查询groupId - if (StringUtils.isNotBlank(projectResultStatisticDto.getGroupCode())) { - ProjectGroup projectGroup = new ProjectGroup(); - projectGroup.setGroupCode(projectResultStatisticDto.getGroupCode()); - List groupList = projectGroupMapper.selectProjectGroupList(projectGroup); - if (CollectionUtils.isEmpty(groupList)) { - throw new ServiceException("未找到该检测项目"); - } - projectResultStatisticDto.setGroupId(groupList.get(0).getId()); - } - // 根据projectCode查询projectId - if (StringUtils.isNotBlank(projectResultStatisticDto.getProjectCode())) { - Project projectQuery = new Project(); - projectQuery.setProjectCode(projectResultStatisticDto.getProjectCode()); - List projectList = projectMapper.selectProjectList(projectQuery); - if (CollectionUtils.isEmpty(projectList)) { - throw new ServiceException("未找到该检测项目"); - } - projectResultStatisticDto.setProjectId(projectList.get(0).getId()); - } - if (projectResultStatisticDto.getPatientId() == null) { - throw new ServiceException("数据格式错误"); - } - List measureTimeList = new ArrayList<>(); - Map> valueMap = new HashMap<>(); - List resultList = projectResultMapper.selectList(projectResultStatisticDto); - if (!CollectionUtils.isEmpty(resultList)) { - // 根据projectId进行分组 - Map> groupByProject = resultList.stream().collect(Collectors.groupingBy(ProjectResultVo::getProjectName)); - for (String projectName : groupByProject.keySet()) { - List projectResultList = groupByProject.get(projectName); - List valueList = projectResultList.stream().map(ProjectResultVo::getMeasureResult).collect(Collectors.toList()); - measureTimeList = projectResultList.stream().map(ProjectResultVo::getMeasureTimeStr).collect(Collectors.toList()); - valueMap.put(projectName, valueList); - } - } - return ProjectResultStatisticVo.builder().xList(measureTimeList).yList(valueMap).build(); - } + @Override + public ProjectResultStatisticVo curveStatistics(ProjectResultStatisticDto projectResultStatisticDto) { + // 根据groupCode查询groupId + if (StringUtils.isNotBlank(projectResultStatisticDto.getGroupCode())) { + ProjectGroup projectGroup = new ProjectGroup(); + projectGroup.setGroupCode(projectResultStatisticDto.getGroupCode()); + List groupList = projectGroupMapper.selectProjectGroupList(projectGroup); + if (CollectionUtils.isEmpty(groupList)) { + throw new ServiceException("未找到该检测项目"); + } + projectResultStatisticDto.setGroupId(groupList.get(0).getId()); + } + // 根据projectCode查询projectId + if (StringUtils.isNotBlank(projectResultStatisticDto.getProjectCode())) { + Project projectQuery = new Project(); + projectQuery.setProjectCode(projectResultStatisticDto.getProjectCode()); + List projectList = projectMapper.selectProjectList(projectQuery); + if (CollectionUtils.isEmpty(projectList)) { + throw new ServiceException("未找到该检测项目"); + } + projectResultStatisticDto.setProjectId(projectList.get(0).getId()); + } + if (projectResultStatisticDto.getPatientId() == null) { + throw new ServiceException("数据格式错误"); + } + List measureTimeList = new ArrayList<>(); + Map> valueMap = new HashMap<>(); + List resultList = projectResultMapper.selectList(projectResultStatisticDto); + if (!CollectionUtils.isEmpty(resultList)) { + // 根据projectId进行分组 + Map> groupByProject = resultList.stream().collect(Collectors.groupingBy(ProjectResultVo::getProjectName)); + for (String projectName : groupByProject.keySet()) { + List projectResultList = groupByProject.get(projectName); + List valueList = projectResultList.stream().map(ProjectResultVo::getMeasureResult).collect(Collectors.toList()); + measureTimeList = projectResultList.stream().map(ProjectResultVo::getMeasureTimeStr).collect(Collectors.toList()); + valueMap.put(projectName, valueList); + } + } + return ProjectResultStatisticVo.builder().xList(measureTimeList).yList(valueMap).build(); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandainfo/impl/PropagandaInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandainfo/impl/PropagandaInfoServiceImpl.java index c6058075..c909d409 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandainfo/impl/PropagandaInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandainfo/impl/PropagandaInfoServiceImpl.java @@ -1,6 +1,5 @@ package com.xinelu.manage.service.propagandainfo.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.manage.domain.propagandainfo.PropagandaInfo; 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.service.propagandainfo.IPropagandaInfoService; import com.xinelu.manage.vo.department.DepartmentVO; -import java.util.List; -import javax.annotation.Resource; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 宣教库管理Service业务层处理 * @@ -54,8 +55,8 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService { */ @Override public int insertPropagandaInfo(PropagandaInfo propagandaInfo) { - propagandaInfo.setCreateTime(DateUtils.getNowDate()); - return propagandaInfoMapper.insertPropagandaInfo(propagandaInfo); + propagandaInfo.setCreateTime(LocalDateTime.now()); + return propagandaInfoMapper.insertPropagandaInfo(propagandaInfo); } /** @@ -66,30 +67,32 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService { */ @Override public int updatePropagandaInfo(PropagandaInfo propagandaInfo) { - propagandaInfo.setUpdateTime(DateUtils.getNowDate()); + propagandaInfo.setUpdateTime(LocalDateTime.now()); return propagandaInfoMapper.updatePropagandaInfo(propagandaInfo); } - @Override public int copyPropagandaInfo(Long id) { - PropagandaInfo propagandaInfo = propagandaInfoMapper.selectPropagandaInfoById(id); - propagandaInfo.setId(null); - propagandaInfo.setCreateTime(DateUtils.getNowDate()); - propagandaInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); - propagandaInfo.setUpdateTime(null); - propagandaInfo.setUpdateBy(null); - propagandaInfo.setPropagandaCode(propagandaInfo.getPropagandaCode() + "-COPY"); - propagandaInfo.setPropagandaStatus("CREATE_COMPLETE"); - return propagandaInfoMapper.insertPropagandaInfo(propagandaInfo); - } + @Override + public int copyPropagandaInfo(Long id) { + PropagandaInfo propagandaInfo = propagandaInfoMapper.selectPropagandaInfoById(id); + propagandaInfo.setId(null); + propagandaInfo.setCreateTime(LocalDateTime.now()); + propagandaInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + propagandaInfo.setUpdateTime(null); + propagandaInfo.setUpdateBy(null); + propagandaInfo.setPropagandaCode(propagandaInfo.getPropagandaCode() + "-COPY"); + propagandaInfo.setPropagandaStatus("CREATE_COMPLETE"); + return propagandaInfoMapper.insertPropagandaInfo(propagandaInfo); + } - @Override public int updateStatus(PropagandaUpdateDto propagandaInfo) { - PropagandaInfo body = new PropagandaInfo(); - body.setId(propagandaInfo.getId()); - body.setPropagandaStatus(propagandaInfo.getPropagandaStatus()); - return propagandaInfoMapper.updatePropagandaInfo(body); - } + @Override + public int updateStatus(PropagandaUpdateDto propagandaInfo) { + PropagandaInfo body = new PropagandaInfo(); + body.setId(propagandaInfo.getId()); + body.setPropagandaStatus(propagandaInfo.getPropagandaStatus()); + return propagandaInfoMapper.updatePropagandaInfo(body); + } - /** + /** * 批量删除宣教库管理 * * @param ids 需要删除的宣教库管理主键 @@ -111,7 +114,8 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService { return propagandaInfoMapper.deletePropagandaInfoById(id); } - @Override public List selectNumByDept(DepartmentDTO departmentDto) { - return propagandaInfoMapper.selectNumByDept(departmentDto); - } + @Override + public List selectNumByDept(DepartmentDTO departmentDto) { + return propagandaInfoMapper.selectNumByDept(departmentDto); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandamaterials/impl/PropagandaMaterialsServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandamaterials/impl/PropagandaMaterialsServiceImpl.java index a1c661cf..93bd58b6 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandamaterials/impl/PropagandaMaterialsServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/propagandamaterials/impl/PropagandaMaterialsServiceImpl.java @@ -1,12 +1,13 @@ 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.mapper.propagandamaterials.PropagandaMaterialsMapper; 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业务层处理 @@ -49,8 +50,8 @@ public class PropagandaMaterialsServiceImpl implements IPropagandaMaterialsServi */ @Override public int insertPropagandaMaterials(PropagandaMaterials propagandaMaterials) { - propagandaMaterials.setCreateTime(DateUtils.getNowDate()); - return propagandaMaterialsMapper.insertPropagandaMaterials(propagandaMaterials); + propagandaMaterials.setCreateTime(LocalDateTime.now()); + return propagandaMaterialsMapper.insertPropagandaMaterials(propagandaMaterials); } /** @@ -61,7 +62,7 @@ public class PropagandaMaterialsServiceImpl implements IPropagandaMaterialsServi */ @Override public int updatePropagandaMaterials(PropagandaMaterials propagandaMaterials) { - propagandaMaterials.setUpdateTime(DateUtils.getNowDate()); + propagandaMaterials.setUpdateTime(LocalDateTime.now()); return propagandaMaterialsMapper.updatePropagandaMaterials(propagandaMaterials); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java index f25856f2..6463ba2a 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java @@ -1,7 +1,6 @@ package com.xinelu.manage.service.questioninfo.impl; import com.xinelu.common.core.domain.AjaxResult; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.manage.domain.questioninfo.QuestionInfo; @@ -20,6 +19,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -91,7 +91,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService { //新增问卷表 QuestionInfo questionInfo = new QuestionInfo(); BeanUtils.copyBeanProp(questionInfo, question); - questionInfo.setCreateTime(DateUtils.getNowDate()); + questionInfo.setCreateTime(LocalDateTime.now()); questionInfo.setCreateBy(SecurityUtils.getUsername()); int questionCount = questionInfoMapper.insertQuestionInfo(questionInfo); if (questionCount <= 0) { @@ -106,7 +106,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService { QuestionSubject saveQuestionSubject = new QuestionSubject(); BeanUtils.copyBeanProp(saveQuestionSubject, questionSubject); saveQuestionSubject.setQuestionInfoId(questionInfo.getId()); - saveQuestionSubject.setCreateTime(DateUtils.getNowDate()); + saveQuestionSubject.setCreateTime(LocalDateTime.now()); saveQuestionSubject.setCreateBy(SecurityUtils.getUsername()); questionSubjects.add(saveQuestionSubject); questionSubjectOptions.addAll(questionSubject.getQuestionSubjectOptionList()); @@ -123,7 +123,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService { 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()); saveQuestionSubjectOption.setQuestionnaireSubjectId(questionSubject.getId()); - saveQuestionSubjectOption.setCreateTime(DateUtils.getNowDate()); + saveQuestionSubjectOption.setCreateTime(LocalDateTime.now()); saveQuestionSubjectOption.setCreateBy(SecurityUtils.getUsername()); saveQuestionSubjectOptions.add(saveQuestionSubjectOption); } @@ -147,7 +147,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService { //新增问卷表 QuestionInfo questionInfo = new QuestionInfo(); BeanUtils.copyBeanProp(questionInfo, question); - questionInfo.setUpdateTime(DateUtils.getNowDate()); + questionInfo.setUpdateTime(LocalDateTime.now()); questionInfo.setUpdateBy(SecurityUtils.getUsername()); int questionCount = questionInfoMapper.updateQuestionInfo(questionInfo); if (questionCount <= 0) { @@ -177,7 +177,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService { QuestionSubject saveQuestionSubject = new QuestionSubject(); BeanUtils.copyBeanProp(saveQuestionSubject, questionSubject); saveQuestionSubject.setQuestionInfoId(questionInfo.getId()); - saveQuestionSubject.setCreateTime(DateUtils.getNowDate()); + saveQuestionSubject.setCreateTime(LocalDateTime.now()); saveQuestionSubject.setCreateBy(SecurityUtils.getUsername()); questionSubjects.add(saveQuestionSubject); questionSubjectOptions.addAll(questionSubject.getQuestionSubjectOptionList()); @@ -193,7 +193,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService { 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()); saveQuestionSubjectOption.setQuestionnaireSubjectId(questionSubject.getId()); - saveQuestionSubjectOption.setCreateTime(DateUtils.getNowDate()); + saveQuestionSubjectOption.setCreateTime(LocalDateTime.now()); saveQuestionSubjectOption.setCreateBy(SecurityUtils.getUsername()); saveQuestionSubjectOptions.add(saveQuestionSubjectOption); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questionsubject/impl/QuestionSubjectServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questionsubject/impl/QuestionSubjectServiceImpl.java index 6329ffd7..c8ef42d1 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questionsubject/impl/QuestionSubjectServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questionsubject/impl/QuestionSubjectServiceImpl.java @@ -1,12 +1,12 @@ package com.xinelu.manage.service.questionsubject.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.questionsubject.QuestionSubject; import com.xinelu.manage.mapper.questionsubject.QuestionSubjectMapper; import com.xinelu.manage.service.questionsubject.IQuestionSubjectService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; @@ -51,7 +51,7 @@ public class QuestionSubjectServiceImpl implements IQuestionSubjectService { */ @Override public int insertQuestionSubject(QuestionSubject questionSubject) { - questionSubject.setCreateTime(DateUtils.getNowDate()); + questionSubject.setCreateTime(LocalDateTime.now()); return questionSubjectMapper.insertQuestionSubject(questionSubject); } @@ -63,7 +63,7 @@ public class QuestionSubjectServiceImpl implements IQuestionSubjectService { */ @Override public int updateQuestionSubject(QuestionSubject questionSubject) { - questionSubject.setUpdateTime(DateUtils.getNowDate()); + questionSubject.setUpdateTime(LocalDateTime.now()); return questionSubjectMapper.updateQuestionSubject(questionSubject); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questionsubjectoption/impl/QuestionSubjectOptionServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questionsubjectoption/impl/QuestionSubjectOptionServiceImpl.java index 88637b21..a52b972b 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questionsubjectoption/impl/QuestionSubjectOptionServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questionsubjectoption/impl/QuestionSubjectOptionServiceImpl.java @@ -1,12 +1,12 @@ package com.xinelu.manage.service.questionsubjectoption.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.questionsubjectoption.QuestionSubjectOption; import com.xinelu.manage.mapper.questionsubjectoption.QuestionSubjectOptionMapper; import com.xinelu.manage.service.questionsubjectoption.IQuestionSubjectOptionService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; @@ -51,7 +51,7 @@ public class QuestionSubjectOptionServiceImpl implements IQuestionSubjectOptionS */ @Override public int insertQuestionSubjectOption(QuestionSubjectOption questionSubjectOption) { - questionSubjectOption.setCreateTime(DateUtils.getNowDate()); + questionSubjectOption.setCreateTime(LocalDateTime.now()); return questionSubjectOptionMapper.insertQuestionSubjectOption(questionSubjectOption); } @@ -63,7 +63,7 @@ public class QuestionSubjectOptionServiceImpl implements IQuestionSubjectOptionS */ @Override public int updateQuestionSubjectOption(QuestionSubjectOption questionSubjectOption) { - questionSubjectOption.setUpdateTime(DateUtils.getNowDate()); + questionSubjectOption.setUpdateTime(LocalDateTime.now()); return questionSubjectOptionMapper.updateQuestionSubjectOption(questionSubjectOption); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/scriptInfo/impl/ScriptInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/scriptInfo/impl/ScriptInfoServiceImpl.java index 2c7be0e8..3118ca60 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/scriptInfo/impl/ScriptInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/scriptInfo/impl/ScriptInfoServiceImpl.java @@ -3,7 +3,6 @@ package com.xinelu.manage.service.scriptInfo.impl; import com.xinelu.common.config.SystemBusinessConfig; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.file.FileUploadUtils; import com.xinelu.common.utils.file.MimeTypeUtils; @@ -16,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; /** @@ -70,7 +70,7 @@ public class ScriptInfoServiceImpl implements IScriptInfoService { } // 设置创建人与创建时间 scriptInfo.setCreateBy(SecurityUtils.getUsername()); - scriptInfo.setCreateTime(DateUtils.getNowDate()); + scriptInfo.setCreateTime(LocalDateTime.now()); return scriptInfoMapper.insertScriptInfo(scriptInfo); } @@ -90,7 +90,7 @@ public class ScriptInfoServiceImpl implements IScriptInfoService { } // 不存在同名的话术名称或者名称未改变,设置修改人和修改时间 scriptInfo.setUpdateBy(SecurityUtils.getUsername()); - scriptInfo.setUpdateTime(DateUtils.getNowDate()); + scriptInfo.setUpdateTime(LocalDateTime.now()); // 进行更新操作 return scriptInfoMapper.updateScriptInfo(scriptInfo); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java index 6aa47a66..dd858463 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java @@ -3,7 +3,6 @@ package com.xinelu.manage.service.servicepackage.impl; import com.xinelu.common.constant.Constants; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.PageServiceUtil; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; @@ -21,7 +20,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.Date; +import java.time.LocalDateTime; import java.util.List; import java.util.stream.Collectors; @@ -72,11 +71,10 @@ public class ServicePackageServiceImpl implements IServicePackageService { public TableDataInfo selectServicePackageList(ServicePackage servicePackage) { pageServiceUtil.startPage(); List voList = servicePackageMapper.selectServicePackageLists(servicePackage); - voList.stream().map(vo -> { + voList.stream().peek(vo -> { // 拼接服务包期限+服务包单位 String packageTermAndUnit = vo.getPackageTerm() + vo.getPackageTermUnit(); vo.setPackageTermAndUnit(packageTermAndUnit); - return vo; }).collect(Collectors.toList()); return pageServiceUtil.getDataTable(voList); } @@ -96,7 +94,7 @@ public class ServicePackageServiceImpl implements IServicePackageService { throw new ServiceException("当前科室下服务包名称已存在"); } String username = SecurityUtils.getUsername(); - Date nowDate = DateUtils.getNowDate(); + LocalDateTime nowDate = LocalDateTime.now(); // 初始化ServicePackage,将servicePackageAddDTO赋值给ServicePackage,新增服务包 ServicePackage servicePackage = new ServicePackage(); BeanUtils.copyProperties(servicePackageAddDTO, servicePackage); @@ -128,7 +126,7 @@ public class ServicePackageServiceImpl implements IServicePackageService { throw new ServiceException("当前科室下服务包名称已存在"); } String username = SecurityUtils.getUsername(); - Date nowDate = DateUtils.getNowDate(); + LocalDateTime nowDate = LocalDateTime.now(); // 初始化ServicePackage,将servicePackageAddDTO赋值给ServicePackage,更新服务包 ServicePackage servicePackage = new 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()); if (serviceWayId == null) { 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()); if (serviceContentId == null) { 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) { throw new ServiceException("不能重复添加服务包内容"); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackagecontent/impl/ServicePackageContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackagecontent/impl/ServicePackageContentServiceImpl.java index 5fb820c9..d15c4fc3 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackagecontent/impl/ServicePackageContentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackagecontent/impl/ServicePackageContentServiceImpl.java @@ -1,12 +1,12 @@ package com.xinelu.manage.service.servicepackagecontent.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.servicepackagecontent.ServicePackageContent; import com.xinelu.manage.mapper.servicepackagecontent.ServicePackageContentMapper; import com.xinelu.manage.service.servicepackagecontent.IServicePackageContentService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; /** @@ -50,7 +50,7 @@ public class ServicePackageContentServiceImpl implements IServicePackageContentS */ @Override public int insertServicePackageContent(ServicePackageContent servicePackageContent) { - servicePackageContent.setCreateTime(DateUtils.getNowDate()); + servicePackageContent.setCreateTime(LocalDateTime.now()); return servicePackageContentMapper.insertServicePackageContent(servicePackageContent); } @@ -62,7 +62,7 @@ public class ServicePackageContentServiceImpl implements IServicePackageContentS */ @Override public int updateServicePackageContent(ServicePackageContent servicePackageContent) { - servicePackageContent.setUpdateTime(DateUtils.getNowDate()); + servicePackageContent.setUpdateTime(LocalDateTime.now()); return servicePackageContentMapper.updateServicePackageContent(servicePackageContent); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java index bd05f245..15808cfd 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java @@ -17,12 +17,12 @@ import com.xinelu.manage.service.servicewaycontent.IServiceWayContentService; import com.xinelu.manage.vo.servicewaycontent.ServiceWayContentAndFrequencyVO; import com.xinelu.manage.vo.servicewaycontent.ServiceWayContentAndNumVO; import com.xinelu.manage.vo.servicewaycontent.ServiceWayContentVO; -import com.xinelu.system.mapper.SysDictDataMapper; import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.Date; import java.util.List; import java.util.Objects; @@ -75,7 +75,6 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { // 判断服务内容在服务内容表中是否存在 ServiceWayContentVO serviceWayContentVO = serviceWayContentMapper.countByWayIdAndContent(serviceWayContentAddDTO.getServiceWayId(), serviceWayContentAddDTO.getServiceContent()); String username = SecurityUtils.getUsername(); - Date date = DateUtils.getNowDate(); ServiceWayContent serviceFrequency = new ServiceWayContent(); // 如果服务内容在服务内容表中存在 if (ObjectUtils.isNotEmpty(serviceWayContentVO)) { @@ -95,7 +94,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { serviceFrequency.setServiceFrequencyStart(serviceWayContentAddDTO.getServiceFrequencyStart()); serviceFrequency.setServiceFrequencyEnd(serviceWayContentAddDTO.getServiceFrequencyEnd()); serviceFrequency.setCreateBy(username); - serviceFrequency.setCreateTime(date); + serviceFrequency.setCreateTime(LocalDateTime.now()); if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) { throw new ServiceException("新增服务频次失败"); } @@ -107,7 +106,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { serviceContent.setServiceWayId(serviceWayContentAddDTO.getServiceWayId()); serviceContent.setServiceContent(serviceWayContentAddDTO.getServiceContent()); serviceContent.setCreateBy(username); - serviceContent.setCreateTime(date); + serviceContent.setCreateTime(LocalDateTime.now()); if (serviceWayContentMapper.insertServiceWayContent(serviceContent) <= 0) { throw new ServiceException("新增服务内容失败"); } @@ -119,7 +118,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { serviceFrequency.setServiceFrequencyStart(serviceWayContentAddDTO.getServiceFrequencyStart()); serviceFrequency.setServiceFrequencyEnd(serviceWayContentAddDTO.getServiceFrequencyEnd()); serviceFrequency.setCreateBy(username); - serviceFrequency.setCreateTime(date); + serviceFrequency.setCreateTime(LocalDateTime.now()); serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort()); if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) { throw new ServiceException("新增服务频次失败"); @@ -138,7 +137,6 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { @Transactional(rollbackFor = Exception.class) public int updateServiceWayContent(ServiceWayContentEditDTO serviceWayContentEditDTO) { String username = SecurityUtils.getUsername(); - Date date = DateUtils.getNowDate(); // 获取当前的服务频次记录 ServiceWayContent currentFrequency = serviceWayContentMapper.selectServiceWayContentById(serviceWayContentEditDTO.getId()); if (currentFrequency == null) { @@ -165,7 +163,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { newServiceContent.setServiceContent(serviceWayContentEditDTO.getServiceContent()); newServiceContent.setServiceType(ServiceWayContentServiceType.SERVICE_CONTENT.toString()); newServiceContent.setCreateBy(username); - newServiceContent.setCreateTime(date); + newServiceContent.setCreateTime(LocalDateTime.now()); serviceWayContentMapper.insertServiceWayContent(newServiceContent); // 更新当前频次记录的ServiceContentId为新创建的服务内容ID currentFrequency.setServiceContentId(newServiceContent.getId()); @@ -196,7 +194,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { currentFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart()); currentFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd()); currentFrequency.setUpdateBy(username); - currentFrequency.setUpdateTime(date); + currentFrequency.setUpdateTime(LocalDateTime.now()); // 执行更新操作 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.setServiceType(ServiceWayContentServiceType.SERVICE_WRY.toString()); serviceWayContent.setCreateBy(SecurityUtils.getUsername()); - serviceWayContent.setCreateTime(DateUtils.getNowDate()); + serviceWayContent.setCreateTime(LocalDateTime.now()); return serviceWayContentMapper.insertServiceWayContent(serviceWayContent); } @@ -280,7 +278,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { } // 如果不存在,执行修改功能 serviceWayContent.setUpdateBy(SecurityUtils.getUsername()); - serviceWayContent.setUpdateTime(DateUtils.getNowDate()); + serviceWayContent.setUpdateTime(LocalDateTime.now()); return serviceWayContentMapper.updateServiceWay(serviceWayContent); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientinformed/impl/SignPatientInformedServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientinformed/impl/SignPatientInformedServiceImpl.java index 02194ac4..9d4c58e0 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientinformed/impl/SignPatientInformedServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientinformed/impl/SignPatientInformedServiceImpl.java @@ -1,13 +1,14 @@ package com.xinelu.manage.service.signpatientinformed.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.signpatientinformed.SignPatientInformed; import com.xinelu.manage.mapper.signpatientinformed.SignPatientInformedMapper; import com.xinelu.manage.service.signpatientinformed.ISignPatientInformedService; -import java.util.List; -import javax.annotation.Resource; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + /** * 签约知情同意书信息Service业务层处理 * @@ -49,8 +50,8 @@ public class SignPatientInformedServiceImpl implements ISignPatientInformedServi */ @Override public int insertSignPatientInformed(SignPatientInformed signPatientInformed) { - signPatientInformed.setCreateTime(DateUtils.getNowDate()); - return signPatientInformedMapper.insertSignPatientInformed(signPatientInformed); + signPatientInformed.setCreateTime(LocalDateTime.now()); + return signPatientInformedMapper.insertSignPatientInformed(signPatientInformed); } /** @@ -61,7 +62,7 @@ public class SignPatientInformedServiceImpl implements ISignPatientInformedServi */ @Override public int updateSignPatientInformed(SignPatientInformed signPatientInformed) { - signPatientInformed.setUpdateTime(DateUtils.getNowDate()); + signPatientInformed.setUpdateTime(LocalDateTime.now()); return signPatientInformedMapper.updateSignPatientInformed(signPatientInformed); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientpackage/impl/SignPatientPackageServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientpackage/impl/SignPatientPackageServiceImpl.java index 182a8a75..a371aa08 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientpackage/impl/SignPatientPackageServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientpackage/impl/SignPatientPackageServiceImpl.java @@ -1,12 +1,13 @@ 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.mapper.signpatientpackage.SignPatientPackageMapper; 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业务层处理 @@ -49,7 +50,7 @@ public class SignPatientPackageServiceImpl implements ISignPatientPackageService */ @Override public int insertSignPatientPackage(SignPatientPackage signPatientPackage) { - signPatientPackage.setCreateTime(DateUtils.getNowDate()); + signPatientPackage.setCreateTime(LocalDateTime.now()); return signPatientPackageMapper.insertSignPatientPackage(signPatientPackage); } @@ -61,7 +62,7 @@ public class SignPatientPackageServiceImpl implements ISignPatientPackageService */ @Override public int updateSignPatientPackage(SignPatientPackage signPatientPackage) { - signPatientPackage.setUpdateTime(DateUtils.getNowDate()); + signPatientPackage.setUpdateTime(LocalDateTime.now()); return signPatientPackageMapper.updateSignPatientPackage(signPatientPackage); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientpackagehardware/impl/SignPatientPackageHardwareServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientpackagehardware/impl/SignPatientPackageHardwareServiceImpl.java index 2619c534..a42686e2 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientpackagehardware/impl/SignPatientPackageHardwareServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientpackagehardware/impl/SignPatientPackageHardwareServiceImpl.java @@ -1,12 +1,13 @@ 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.mapper.signpatientpackagehardware.SignPatientPackageHardwareMapper; 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业务层处理 @@ -49,8 +50,8 @@ public class SignPatientPackageHardwareServiceImpl implements ISignPatientPackag */ @Override public int insertSignPatientPackageHardware(SignPatientPackageHardware signPatientPackageHardware) { - signPatientPackageHardware.setCreateTime(DateUtils.getNowDate()); - return signPatientPackageHardwareMapper.insertSignPatientPackageHardware(signPatientPackageHardware); + signPatientPackageHardware.setCreateTime(LocalDateTime.now()); + return signPatientPackageHardwareMapper.insertSignPatientPackageHardware(signPatientPackageHardware); } /** @@ -61,7 +62,7 @@ public class SignPatientPackageHardwareServiceImpl implements ISignPatientPackag */ @Override public int updateSignPatientPackageHardware(SignPatientPackageHardware signPatientPackageHardware) { - signPatientPackageHardware.setUpdateTime(DateUtils.getNowDate()); + signPatientPackageHardware.setUpdateTime(LocalDateTime.now()); return signPatientPackageHardwareMapper.updateSignPatientPackageHardware(signPatientPackageHardware); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java index c71e99b1..5b2bbb69 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java @@ -23,174 +23,174 @@ import com.xinelu.manage.service.signpatientrecord.ISignPatientRecordService; import com.xinelu.manage.vo.signpatientrecord.SignPatientInfoVo; import com.xinelu.manage.vo.signpatientrecord.SignPatientListVo; 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.time.DateFormatUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.Calendar; +import java.util.List; + /** -* @author haown -* @description 针对表【sign_patient_record(签约记录表)】的数据库操作Service实现 -* @createDate 2024-02-28 15:05:02 -*/ + * @author haown + * @description 针对表【sign_patient_record(签约记录表)】的数据库操作Service实现 + * @createDate 2024-02-28 15:05:02 + */ @Service public class SignPatientRecordServiceImpl implements ISignPatientRecordService { - @Resource - private SignPatientRecordMapper signPatientRecordMapper; + @Resource + private SignPatientRecordMapper signPatientRecordMapper; - @Resource - private SignPatientPackageMapper signPatientPackageMapper; - @Resource - private SignPatientPackageHardwareMapper hardwareMapper; - @Resource - private SignPatientInformedMapper informedMapper; - @Resource - private PatientInfoMapper patientInfoMapper; - @Resource - private SignPatientPackageHardwareMapper signPatientPackageHardwareMapper; - @Resource - private SignPatientInformedMapper signPatientInformedMapper; + @Resource + private SignPatientPackageMapper signPatientPackageMapper; + @Resource + private SignPatientPackageHardwareMapper hardwareMapper; + @Resource + private SignPatientInformedMapper informedMapper; + @Resource + private PatientInfoMapper patientInfoMapper; + @Resource + private SignPatientPackageHardwareMapper signPatientPackageHardwareMapper; + @Resource + private SignPatientInformedMapper signPatientInformedMapper; - @Override public List selectList(SignPatientListDto signPatientRecord) { - return signPatientRecordMapper.selectList(signPatientRecord); - } + @Override + public List selectList(SignPatientListDto signPatientRecord) { + return signPatientRecordMapper.selectList(signPatientRecord); + } - @Override public SignPatientInfoVo getByRecordId(Long id) { - SignPatientInfoVo signPatientInfoVo = signPatientRecordMapper.getByRecordId(id); - // 根据签约记录主键查询设备列表 - SignPatientPackageHardware queryDevice = new SignPatientPackageHardware(); - queryDevice.setSignPatientRecordId(id); - List devices = signPatientPackageHardwareMapper.selectSignPatientPackageHardwareList(queryDevice); - signPatientInfoVo.setSignDevices(devices); + @Override + public SignPatientInfoVo getByRecordId(Long id) { + SignPatientInfoVo signPatientInfoVo = signPatientRecordMapper.getByRecordId(id); + // 根据签约记录主键查询设备列表 + SignPatientPackageHardware queryDevice = new SignPatientPackageHardware(); + queryDevice.setSignPatientRecordId(id); + List devices = signPatientPackageHardwareMapper.selectSignPatientPackageHardwareList(queryDevice); + signPatientInfoVo.setSignDevices(devices); - SignPatientInformed signPatientInformed = new SignPatientInformed(); - signPatientInformed.setSignPatientRecordId(id); - List informeds = signPatientInformedMapper.selectSignPatientInformedList(signPatientInformed); - signPatientInfoVo.setSignPatientInformeds(informeds); - return signPatientInfoVo; - } + SignPatientInformed signPatientInformed = new SignPatientInformed(); + signPatientInformed.setSignPatientRecordId(id); + List informeds = signPatientInformedMapper.selectSignPatientInformedList(signPatientInformed); + signPatientInfoVo.setSignPatientInformeds(informeds); + return signPatientInfoVo; + } - @Override public List getByPatient(Long patientId) { - return signPatientRecordMapper.getByPatient(patientId); - } + @Override + public List getByPatient(Long patientId) { + return signPatientRecordMapper.getByPatient(patientId); + } - @Override - @Transactional(rollbackFor = Exception.class) - public int add(SignPatientAddDto body) { - SignPatientPackage signPatientPackage = body.getSignPackage(); - if (ObjectUtils.isNotEmpty(body.getRecord())) { - SignPatientRecord signPatientRecord = body.getRecord(); - signPatientRecord.setId(null); - if (signPatientRecord.getPatientId() == null) { - throw new ServiceException("数据错误"); - } - PatientInfo patient = patientInfoMapper.selectPatientInfoById(signPatientRecord.getPatientId()); - if (ObjectUtils.isEmpty(patient)) { - throw new ServiceException("请选择签约居民"); - } - signPatientRecord.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_CENTER); - signPatientRecord.setDelFlag(0); - signPatientRecord.setPaymentStatus(PaymentStatusConstants.UNPAID_FEES); - signPatientRecord.setSignTime(DateUtils.getNowDate()); - signPatientRecord.setSignStatus(SignRecordServiceStatusConstants.IN_SIGN); + @Override + @Transactional(rollbackFor = Exception.class) + public int add(SignPatientAddDto body) { + SignPatientPackage signPatientPackage = body.getSignPackage(); + if (ObjectUtils.isNotEmpty(body.getRecord())) { + SignPatientRecord signPatientRecord = body.getRecord(); + signPatientRecord.setId(null); + if (signPatientRecord.getPatientId() == null) { + throw new ServiceException("数据错误"); + } + PatientInfo patient = patientInfoMapper.selectPatientInfoById(signPatientRecord.getPatientId()); + if (ObjectUtils.isEmpty(patient)) { + throw new ServiceException("请选择签约居民"); + } + signPatientRecord.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_CENTER); + signPatientRecord.setDelFlag(0); + signPatientRecord.setPaymentStatus(PaymentStatusConstants.UNPAID_FEES); + signPatientRecord.setSignTime(LocalDateTime.now()); + 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) { - signPatientRecord.setPrice(signPatientPackage.getPackagePrice()); - } else { - throw new ServiceException("请选择服务包"); - } - // 签约信息保存到患者表 - patient.setSignPatientRecordId(signPatientRecord.getId()); - patient.setSignStatus(SignRecordServiceStatusConstants.IN_SIGN); - patient.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_CENTER); - patient.setSignTime(DateUtils.getNowDate()); - patientInfoMapper.updatePatientInfo(patient); - // 保存签约记录 - int flag = signPatientRecordMapper.insert(signPatientRecord); - if (flag > 0) { - // 保存签约服务包信息 - 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); - } - } + @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(LocalDateTime.now()); + signRecord.setSeparateReason(patientCancelSignDto.getSeparateReason()); + if (StringUtils.equals(SignRecordServiceStatusConstants.SEPARATE_SIGN, patientCancelSignDto.getSignStatus())) { - // 保存告知书 - 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; - } - - @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; - } + PatientInfo patient = patientInfoMapper.selectPatientInfoById(patientCancelSignDto.getPatientId()); + // 签约信息保存到患者表 + patient.setSignStatus(patientCancelSignDto.getSignStatus()); + patient.setServiceStatus(patientCancelSignDto.getServiceStatus()); + patientInfoMapper.updatePatientInfo(patient); + } + return signPatientRecordMapper.updateByPrimaryKeySelective(signRecord); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java index 1f33b3f2..57be9bcd 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java @@ -1,12 +1,12 @@ package com.xinelu.manage.service.specialdiseasenode.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode; import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper; import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; @@ -51,7 +51,7 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService */ @Override public int insertSpecialDiseaseNode(SpecialDiseaseNode specialDiseaseNode) { - specialDiseaseNode.setCreateTime(DateUtils.getNowDate()); + specialDiseaseNode.setCreateTime(LocalDateTime.now()); return specialDiseaseNodeMapper.insertSpecialDiseaseNode(specialDiseaseNode); } @@ -63,7 +63,7 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService */ @Override public int updateSpecialDiseaseNode(SpecialDiseaseNode specialDiseaseNode) { - specialDiseaseNode.setUpdateTime(DateUtils.getNowDate()); + specialDiseaseNode.setUpdateTime(LocalDateTime.now()); return specialDiseaseNodeMapper.updateSpecialDiseaseNode(specialDiseaseNode); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/subdivisioncategory/impl/SubdivisionCategoryServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/subdivisioncategory/impl/SubdivisionCategoryServiceImpl.java index 51c7043c..259f21b1 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/subdivisioncategory/impl/SubdivisionCategoryServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/subdivisioncategory/impl/SubdivisionCategoryServiceImpl.java @@ -1,12 +1,12 @@ package com.xinelu.manage.service.subdivisioncategory.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.subdivisioncategory.SubdivisionCategory; import com.xinelu.manage.mapper.subdivisioncategory.SubdivisionCategoryMapper; import com.xinelu.manage.service.subdivisioncategory.ISubdivisionCategoryService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; @@ -51,7 +51,7 @@ public class SubdivisionCategoryServiceImpl implements ISubdivisionCategoryServi */ @Override public int insertSubdivisionCategory(SubdivisionCategory subdivisionCategory) { - subdivisionCategory.setCreateTime(DateUtils.getNowDate()); + subdivisionCategory.setCreateTime(LocalDateTime.now()); return subdivisionCategoryMapper.insertSubdivisionCategory(subdivisionCategory); } @@ -63,7 +63,7 @@ public class SubdivisionCategoryServiceImpl implements ISubdivisionCategoryServi */ @Override public int updateSubdivisionCategory(SubdivisionCategory subdivisionCategory) { - subdivisionCategory.setUpdateTime(DateUtils.getNowDate()); + subdivisionCategory.setUpdateTime(LocalDateTime.now()); return subdivisionCategoryMapper.updateSubdivisionCategory(subdivisionCategory); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskpartitiondict/impl/TaskPartitionDictServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskpartitiondict/impl/TaskPartitionDictServiceImpl.java index f3ce189b..eb9ec580 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskpartitiondict/impl/TaskPartitionDictServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskpartitiondict/impl/TaskPartitionDictServiceImpl.java @@ -1,7 +1,6 @@ package com.xinelu.manage.service.taskpartitiondict.impl; import com.xinelu.common.constant.Constants; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.manage.domain.taskpartitiondict.TaskPartitionDict; @@ -10,6 +9,7 @@ import com.xinelu.manage.service.taskpartitiondict.ITaskPartitionDictService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; @@ -57,7 +57,7 @@ public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService { @Override public int insertTaskPartitionDict(TaskPartitionDict taskPartitionDict) { taskPartitionDict.setTaskPartitionCode(Constants.TASK_PARTITION_CODE + generateSystemCodeUtil.generateSystemCode(Constants.TASK_PARTITION_CODE)); - taskPartitionDict.setCreateTime(DateUtils.getNowDate()); + taskPartitionDict.setCreateTime(LocalDateTime.now()); taskPartitionDict.setCreateBy(SecurityUtils.getUsername()); return taskPartitionDictMapper.insertTaskPartitionDict(taskPartitionDict); } @@ -70,7 +70,7 @@ public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService { */ @Override public int updateTaskPartitionDict(TaskPartitionDict taskPartitionDict) { - taskPartitionDict.setUpdateTime(DateUtils.getNowDate()); + taskPartitionDict.setUpdateTime(LocalDateTime.now()); taskPartitionDict.setUpdateBy(SecurityUtils.getUsername()); return taskPartitionDictMapper.updateTaskPartitionDict(taskPartitionDict); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskstatusdict/impl/TaskStatusDictServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskstatusdict/impl/TaskStatusDictServiceImpl.java index 4dccabcc..90acbc96 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskstatusdict/impl/TaskStatusDictServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskstatusdict/impl/TaskStatusDictServiceImpl.java @@ -1,12 +1,12 @@ package com.xinelu.manage.service.taskstatusdict.impl; -import com.xinelu.common.utils.DateUtils; import com.xinelu.manage.domain.taskstatusdict.TaskStatusDict; import com.xinelu.manage.mapper.taskstatusdict.TaskStatusDictMapper; import com.xinelu.manage.service.taskstatusdict.ITaskStatusDictService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; @@ -51,7 +51,7 @@ public class TaskStatusDictServiceImpl implements ITaskStatusDictService { */ @Override public int insertTaskStatusDict(TaskStatusDict taskStatusDict) { - taskStatusDict.setCreateTime(DateUtils.getNowDate()); + taskStatusDict.setCreateTime(LocalDateTime.now()); return taskStatusDictMapper.insertTaskStatusDict(taskStatusDict); } @@ -63,7 +63,7 @@ public class TaskStatusDictServiceImpl implements ITaskStatusDictService { */ @Override public int updateTaskStatusDict(TaskStatusDict taskStatusDict) { - taskStatusDict.setUpdateTime(DateUtils.getNowDate()); + taskStatusDict.setUpdateTime(LocalDateTime.now()); return taskStatusDictMapper.updateTaskStatusDict(taskStatusDict); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/impl/TaskTypeDictServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/impl/TaskTypeDictServiceImpl.java index d530578e..01ac6960 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/impl/TaskTypeDictServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/impl/TaskTypeDictServiceImpl.java @@ -1,7 +1,6 @@ package com.xinelu.manage.service.tasktypedict.impl; import com.xinelu.common.constant.Constants; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.manage.domain.tasktypedict.TaskTypeDict; @@ -10,6 +9,7 @@ import com.xinelu.manage.service.tasktypedict.ITaskTypeDictService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.List; @@ -57,7 +57,7 @@ public class TaskTypeDictServiceImpl implements ITaskTypeDictService { @Override public int insertTaskTypeDict(TaskTypeDict taskTypeDict) { taskTypeDict.setTaskTypeCode(Constants.TASK_TYPE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.TASK_TYPE_CODE)); - taskTypeDict.setCreateTime(DateUtils.getNowDate()); + taskTypeDict.setCreateTime(LocalDateTime.now()); taskTypeDict.setCreateBy(SecurityUtils.getUsername()); return taskTypeDictMapper.insertTaskTypeDict(taskTypeDict); } @@ -70,7 +70,7 @@ public class TaskTypeDictServiceImpl implements ITaskTypeDictService { */ @Override public int updateTaskTypeDict(TaskTypeDict taskTypeDict) { - taskTypeDict.setUpdateTime(DateUtils.getNowDate()); + taskTypeDict.setUpdateTime(LocalDateTime.now()); taskTypeDict.setUpdateBy(SecurityUtils.getUsername()); return taskTypeDictMapper.updateTaskTypeDict(taskTypeDict); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/textmessage/impl/TextMessageServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/textmessage/impl/TextMessageServiceImpl.java index 401f4b1c..c7ac6581 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/textmessage/impl/TextMessageServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/textmessage/impl/TextMessageServiceImpl.java @@ -2,7 +2,6 @@ package com.xinelu.manage.service.textmessage.impl; import com.xinelu.common.core.domain.entity.SysDictData; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.manage.domain.textmessage.TextMessage; @@ -18,8 +17,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -110,7 +109,7 @@ public class TextMessageServiceImpl implements ITextMessageService { // 设置创建者和创建时间 String currentUsername = SecurityUtils.getUsername(); - Date currentTime = DateUtils.getNowDate(); + LocalDateTime currentTime = LocalDateTime.now(); textMessageTaskDTO.setCreateBy(currentUsername); textMessageTaskDTO.setCreateTime(currentTime); @@ -139,7 +138,7 @@ public class TextMessageServiceImpl implements ITextMessageService { 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); TextMessageSuitTask task = new TextMessageSuitTask(); task.setMessageId(textMessageId); @@ -166,7 +165,7 @@ public class TextMessageServiceImpl implements ITextMessageService { // 设置修改者和修改时间 String editUsername = SecurityUtils.getUsername(); - Date editTime = DateUtils.getNowDate(); + LocalDateTime editTime = LocalDateTime.now(); textMessageTaskDTO.setUpdateBy(editUsername); textMessageTaskDTO.setUpdateTime(editTime); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java index ab9708fa..72289ef6 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java @@ -2,7 +2,6 @@ package com.xinelu.manage.service.wechattemplate.impl; import com.xinelu.common.core.domain.entity.SysDictData; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.PageServiceUtil; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; @@ -19,8 +18,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -102,7 +101,7 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService { // 设置创建者和创建时间 String currentUsername = SecurityUtils.getUsername(); - Date currentTime = DateUtils.getNowDate(); + LocalDateTime currentTime = LocalDateTime.now(); wechatTemplateTaskDTO.setCreateBy(currentUsername); wechatTemplateTaskDTO.setCreateTime(currentTime); @@ -131,7 +130,7 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService { 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); WechatTemplateSuitTask task = new WechatTemplateSuitTask(); task.setWechatTemplateId(wechatTempId); @@ -157,7 +156,7 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService { } // 设置修改者和修改时间 String editUsername = SecurityUtils.getUsername(); - Date editTime = DateUtils.getNowDate(); + LocalDateTime editTime = LocalDateTime.now(); wechatTemplateTaskDTO.setUpdateBy(editUsername); wechatTemplateTaskDTO.setUpdateTime(editTime);