parent
2404ae533d
commit
2dd831d8f8
9 changed files with 266 additions and 22 deletions
@ -0,0 +1,53 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*/ |
||||||
|
package org.springblade.common.cache; |
||||||
|
|
||||||
|
import org.springblade.core.cache.utils.CacheUtil; |
||||||
|
import org.springblade.core.tool.utils.SpringUtil; |
||||||
|
import org.springblade.modules.system.entity.Dept; |
||||||
|
import org.springblade.modules.system.entity.User; |
||||||
|
import org.springblade.modules.system.service.IDeptService; |
||||||
|
import org.springblade.modules.system.service.IUserService; |
||||||
|
|
||||||
|
import static org.springblade.core.cache.constant.CacheConstant.USER_CACHE; |
||||||
|
|
||||||
|
/** |
||||||
|
* 部门缓存 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
public class DeptCache { |
||||||
|
private static final String DEPT_CACHE = "blade:dept"; |
||||||
|
private static final String DEPT_CACHE_ID = "dept:id:"; |
||||||
|
|
||||||
|
private static final IDeptService deptService; |
||||||
|
|
||||||
|
static { |
||||||
|
deptService = SpringUtil.getBean(IDeptService.class); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取部门 |
||||||
|
* |
||||||
|
* @param id 部门id |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public static Dept getDept(Long id) { |
||||||
|
return CacheUtil.get(DEPT_CACHE, DEPT_CACHE_ID, id, () -> deptService.getById(id), Boolean.FALSE); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,44 @@ |
|||||||
|
package org.springblade.modules.business.vo; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* 预约记录视图类 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class ApmRecordDetailVO implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "id") |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 体检项目 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "体检项目") |
||||||
|
private String project; |
||||||
|
|
||||||
|
/** |
||||||
|
* 体检地址 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "体检地址") |
||||||
|
private String cuAddr; |
||||||
|
|
||||||
|
/** |
||||||
|
* 时段(上午,下午) |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "时段(上午,下午)") |
||||||
|
private String period; |
||||||
|
|
||||||
|
/** |
||||||
|
* 时段范围, 格式(HH:mm-HH:mm) |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "时段范围, 格式(HH:mm-HH:mm)") |
||||||
|
private String timeFrame; |
||||||
|
} |
||||||
@ -0,0 +1,62 @@ |
|||||||
|
package org.springblade.modules.business.vo; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.core.tool.utils.DateUtil; |
||||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 预约记录视图类 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class ApmRecordListVO implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建部门 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "创建部门") |
||||||
|
private Long createDept; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建部门名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "创建部门名称") |
||||||
|
private String createDeptName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 放号天 |
||||||
|
*/ |
||||||
|
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) |
||||||
|
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME) |
||||||
|
@ApiModelProperty(value = "放号天") |
||||||
|
private Date apmDay; |
||||||
|
|
||||||
|
/** |
||||||
|
* 体检人用户名 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "体检人用户名") |
||||||
|
private String cupName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 体检人证件号 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "体检人证件号") |
||||||
|
private String cupCardNo; |
||||||
|
|
||||||
|
/** |
||||||
|
* 体检人联系方式 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "体检人联系方式") |
||||||
|
private String cupPhone; |
||||||
|
|
||||||
|
private List<ApmRecordDetailVO> details; |
||||||
|
} |
||||||
@ -0,0 +1,31 @@ |
|||||||
|
package org.springblade.modules.business.wrapper; |
||||||
|
|
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||||
|
import org.springblade.core.tool.utils.BeanUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.modules.business.entity.ApmRecord; |
||||||
|
import org.springblade.modules.business.vo.ApmRecordListVO; |
||||||
|
|
||||||
|
import java.util.Objects; |
||||||
|
|
||||||
|
/** |
||||||
|
* ApmConfigListVO包装类,返回视图层所需的字段 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
public class ApmRecordListWrapper extends BaseEntityWrapper<ApmRecord, ApmRecordListVO> { |
||||||
|
|
||||||
|
public static ApmRecordListWrapper build() { |
||||||
|
return new ApmRecordListWrapper(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public ApmRecordListVO entityVO(ApmRecord entity) { |
||||||
|
if (Func.isEmpty(entity)) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
ApmRecordListVO vo = Objects.requireNonNull(BeanUtil.copy(entity, ApmRecordListVO.class)); |
||||||
|
return vo; |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue