1.把时间格式封装到工具类里,不在直接使用字符串,使用常量代替
master
陈江保 4 days ago
parent 862808752f
commit 5378210b8e
  1. 23
      src/main/java/digital/laboratory/platform/imr/component/DateUtils.java
  2. 13
      src/main/java/digital/laboratory/platform/imr/controller/DrugUsageRecordController.java
  3. 5
      src/main/java/digital/laboratory/platform/imr/dto/DestructionPublicityDTO.java
  4. 3
      src/main/java/digital/laboratory/platform/imr/dto/DrugDepotsDTO.java
  5. 39
      src/main/java/digital/laboratory/platform/imr/dto/DrugUsageRecordDTO.java
  6. 5
      src/main/java/digital/laboratory/platform/imr/dto/OutWarehouseApplyDTO.java
  7. 9
      src/main/java/digital/laboratory/platform/imr/dto/PrintTableDTO.java
  8. 9
      src/main/java/digital/laboratory/platform/imr/dto/PublicityDTO.java
  9. 9
      src/main/java/digital/laboratory/platform/imr/dto/QueryApplyDTO.java
  10. 9
      src/main/java/digital/laboratory/platform/imr/dto/QueryDTO.java
  11. 9
      src/main/java/digital/laboratory/platform/imr/dto/QuerySampleDTO.java
  12. 5
      src/main/java/digital/laboratory/platform/imr/dto/UpdateStorageDateDTO.java
  13. 59
      src/main/java/digital/laboratory/platform/imr/entity/DrugUsageRecord.java
  14. 5
      src/main/java/digital/laboratory/platform/imr/entity/SampleOutWarehouseApply.java
  15. 2
      src/main/java/digital/laboratory/platform/imr/mapper/DrugCaseInfoMapper.java
  16. 2
      src/main/java/digital/laboratory/platform/imr/mapper/DrugMaterialInfoMapper.java
  17. 20
      src/main/java/digital/laboratory/platform/imr/mapper/DrugUsageRecordMapper.java
  18. 5
      src/main/java/digital/laboratory/platform/imr/query/DrugDepotsQuery.java
  19. 13
      src/main/java/digital/laboratory/platform/imr/service/DrugUsageRecordService.java
  20. 22
      src/main/java/digital/laboratory/platform/imr/service/impl/DrugUsageRecordServiceImpl.java
  21. 3
      src/main/java/digital/laboratory/platform/imr/vo/DrugCaseInfoVO.java
  22. 3
      src/main/java/digital/laboratory/platform/imr/vo/DrugMaterialInfoVO.java
  23. 5
      src/main/java/digital/laboratory/platform/imr/vo/ToBeReturnVO.java

@ -1,20 +1,11 @@
package digital.laboratory.platform.imr.component;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoField;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import java.util.Date;
/**
* @Description:
@ -23,6 +14,12 @@ import java.util.*;
*/
public class DateUtils {
public static final String yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";
public static final String yyyy_MM_dd = "yyyy-MM-dd";
public static final String TIME_ZONE = "GMT+8";
/**
* 获取当前的分钟
*
@ -30,7 +27,7 @@ public class DateUtils {
*/
public static String getTime() {
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat formatter = new SimpleDateFormat(yyyy_MM_dd_HH_mm_ss);
String dateString = formatter.format(currentTime);
String min = dateString.substring(14, 16);
return min;
@ -67,7 +64,7 @@ public class DateUtils {
public static String localDateTimeToStr(LocalDateTime localDateTime){
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
DateTimeFormatter fmt = DateTimeFormatter.ofPattern(yyyy_MM_dd_HH_mm_ss);
String dateStr = localDateTime.format(fmt);

@ -0,0 +1,13 @@
package digital.laboratory.platform.imr.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/drugUsageRecord")
@Api(value = "DrugUsageRecordController", tags = "毒品检材的领用归还记录表相关接口")
public class DrugUsageRecordController {
}

@ -3,6 +3,7 @@ package digital.laboratory.platform.imr.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDate;
@ -35,8 +36,8 @@ public class DestructionPublicityDTO {
* 销毁时间
*/
@ApiModelProperty(value="销毁时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate destroyDate;
/**

@ -1,6 +1,7 @@
package digital.laboratory.platform.imr.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import digital.laboratory.platform.imr.entity.DrugMaterialInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -50,7 +51,7 @@ public class DrugDepotsDTO {
*/
@ApiModelProperty("送缴日期")
@NotNull(message = "送缴日期不能为空!")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = "")
private LocalDate handingOverDate;
@ApiModelProperty("关联的检材列表")

@ -0,0 +1,39 @@
package digital.laboratory.platform.imr.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* 毒品检材的领用归还记录表 保存DTO类
* @TableName b_drug_usage_record
*/
@Data
@ApiModel(value = "DrugUsageRecordDTO", description = "毒品检材的领用归还记录表 保存DTO类")
public class DrugUsageRecordDTO {
/**
* 关联领用的毒品id
*/
@ApiModelProperty("关联领用的毒品id")
@NotBlank(message = "请选择领用的检材!")
private String drugId;
/**
* 领用时间
*/
@ApiModelProperty("领用时间")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd_HH_mm_ss, timezone = DateUtils.TIME_ZONE)
private LocalDateTime usageDate;
/**
* 领用目的
*/
@ApiModelProperty("领用目的")
private String usagePurpose;
}

@ -2,6 +2,7 @@ package digital.laboratory.platform.imr.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -29,8 +30,8 @@ public class OutWarehouseApplyDTO implements Serializable {
* 归还日期
*/
@ApiModelProperty(value="归还日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate returnDate;
/**

@ -3,6 +3,7 @@ package digital.laboratory.platform.imr.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -28,12 +29,12 @@ public class PrintTableDTO {
private String EventName;
@ApiModelProperty(value = "开始时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate beginDate;
@ApiModelProperty(value = "结束时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate finishDate;

@ -2,6 +2,7 @@ package digital.laboratory.platform.imr.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -13,12 +14,12 @@ public class PublicityDTO {
@ApiModelProperty(value = "开始时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate beginDate;
@ApiModelProperty(value = "结束时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate finishDate;
@ApiModelProperty(value = "当前申请的状态")

@ -3,6 +3,7 @@ package digital.laboratory.platform.imr.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -16,12 +17,12 @@ public class QueryApplyDTO {
private Integer applyType;//名称
@ApiModelProperty(value = "开始时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate beginDate;
@ApiModelProperty(value = "结束时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate finishDate;
@ApiModelProperty(value = "当前申请的状态")

@ -3,6 +3,7 @@ package digital.laboratory.platform.imr.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -24,12 +25,12 @@ public class QueryDTO {
private String sampleIds;//名称
@ApiModelProperty(value = "开始时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate beginDate;
@ApiModelProperty(value = "结束时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate finishDate;
@ApiModelProperty(value = "状态--必带参数")

@ -2,6 +2,7 @@ package digital.laboratory.platform.imr.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -25,12 +26,12 @@ public class QuerySampleDTO {
// private String sampleNo;//编号
@ApiModelProperty(value = "入库开始时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate beginDate;
@ApiModelProperty(value = "入库结束时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate finishDate;
@ApiModelProperty(value = "状态--必带参数")
private Integer status;//状态

@ -2,6 +2,7 @@ package digital.laboratory.platform.imr.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -19,7 +20,7 @@ public class UpdateStorageDateDTO {
private String id;
@ApiModelProperty(value = "存放期限")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate storageDate;
}

@ -0,0 +1,59 @@
package digital.laboratory.platform.imr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import digital.laboratory.platform.common.mybatis.base.BaseEntity;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;
/**
* 毒品检材的领用归还记录表
* @TableName b_drug_usage_record
*/
@Data
@TableName(value ="b_drug_usage_record")
public class DrugUsageRecord extends BaseEntity {
/**
* 主键标识
*/
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
* 关联领用的毒品id
*/
private String drugId;
/**
* 领用申请人
*/
private String applicant;
/**
* 领用时间
*/
private LocalDateTime usageDate;
/**
* 领用目的
*/
private String usagePurpose;
/**
* 归还时间
*/
private LocalDateTime returnDate;
/**
* 领用状态1 领用中 | 5 已归还
*/
private Integer status;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.mybatis.base.BaseEntity;
import digital.laboratory.platform.imr.component.DateUtils;
import digital.laboratory.platform.imr.enums.OutApplyStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -57,8 +58,8 @@ public class SampleOutWarehouseApply extends BaseEntity {
* 归还日期
*/
@ApiModelProperty(value="归还日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
private LocalDate returnDate;
/**

@ -14,7 +14,7 @@ import org.apache.ibatis.annotations.Param;
* @author ChenJiangBao
* @description 针对表b_drug_case_info(毒品库中关联的案事件信息)的数据库操作Mapper
* @createDate 2024-11-07 12:04:42
* @Entity generator.entity.DrugCaseInfo
* @Entity digital.laboratory.platform.imr.entity.DrugCaseInfo
*/
@Mapper
public interface DrugCaseInfoMapper extends BaseMapper<DrugCaseInfo> {

@ -16,7 +16,7 @@ import java.util.List;
* @author ChenJiangBao
* @description 针对表b_drug_material_info(毒品库中的毒品检材信息)的数据库操作Mapper
* @createDate 2024-11-07 12:04:42
* @Entity generator.entity.DrugMaterialInfo
* @Entity digital.laboratory.platform.imr.entity.DrugMaterialInfo
*/
@Mapper
public interface DrugMaterialInfoMapper extends BaseMapper<DrugMaterialInfo> {

@ -0,0 +1,20 @@
package digital.laboratory.platform.imr.mapper;
import digital.laboratory.platform.imr.entity.DrugUsageRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @author ChenJiangBao
* @description 针对表b_drug_usage_record(毒品检材的领用归还记录表)的数据库操作Mapper
* @createDate 2024-11-11 11:40:42
* @Entity digital.laboratory.platform.imr.entity.DrugUsageRecord
*/
@Mapper
public interface DrugUsageRecordMapper extends BaseMapper<DrugUsageRecord> {
}

@ -1,6 +1,7 @@
package digital.laboratory.platform.imr.query;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -30,10 +31,10 @@ public class DrugDepotsQuery {
private String caseId;
@ApiModelProperty(value = "开始日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd)
private LocalDate startDate;
@ApiModelProperty(value = "结束日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd)
private LocalDate endDate;
}

@ -0,0 +1,13 @@
package digital.laboratory.platform.imr.service;
import digital.laboratory.platform.imr.entity.DrugUsageRecord;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author ChenJiangBao
* @description 针对表b_drug_usage_record(毒品检材的领用归还记录表)的数据库操作Service
* @createDate 2024-11-11 11:40:42
*/
public interface DrugUsageRecordService extends IService<DrugUsageRecord> {
}

@ -0,0 +1,22 @@
package digital.laboratory.platform.imr.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import digital.laboratory.platform.imr.entity.DrugUsageRecord;
import digital.laboratory.platform.imr.mapper.DrugUsageRecordMapper;
import digital.laboratory.platform.imr.service.DrugUsageRecordService;
import org.springframework.stereotype.Service;
/**
* @author ChenJiangBao
* @description 针对表b_drug_usage_record(毒品检材的领用归还记录表)的数据库操作Service实现
* @createDate 2024-11-11 11:40:42
*/
@Service
public class DrugUsageRecordServiceImpl extends ServiceImpl<DrugUsageRecordMapper, DrugUsageRecord>
implements DrugUsageRecordService{
}

@ -1,6 +1,7 @@
package digital.laboratory.platform.imr.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -49,7 +50,7 @@ public class DrugCaseInfoVO{
* 送缴日期
*/
@ApiModelProperty("送缴日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd)
private LocalDate handingOverDate;
@ApiModelProperty("送缴检材数量")

@ -1,6 +1,7 @@
package digital.laboratory.platform.imr.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -106,7 +107,7 @@ public class DrugMaterialInfoVO {
* 送缴日期
*/
@ApiModelProperty("送缴日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd)
private LocalDate handingOverDate;
}

@ -2,6 +2,7 @@ package digital.laboratory.platform.imr.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.imr.component.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -40,8 +41,8 @@ public class ToBeReturnVO {
@ApiModelProperty(value = "样本类别")
private String sampleType;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtils.yyyy_MM_dd, timezone = DateUtils.TIME_ZONE)
@JSONField(format = DateUtils.yyyy_MM_dd)
@ApiModelProperty(value = "归还时间")
private LocalDate returnTime;

Loading…
Cancel
Save