diff --git a/src/main/java/org/springblade/common/cache/DeptCache.java b/src/main/java/org/springblade/common/cache/DeptCache.java new file mode 100644 index 0000000..bc4eae4 --- /dev/null +++ b/src/main/java/org/springblade/common/cache/DeptCache.java @@ -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); + } + +} diff --git a/src/main/java/org/springblade/modules/business/controller/ApmRecordController.java b/src/main/java/org/springblade/modules/business/controller/ApmRecordController.java index 9d44793..32d5a49 100644 --- a/src/main/java/org/springblade/modules/business/controller/ApmRecordController.java +++ b/src/main/java/org/springblade/modules/business/controller/ApmRecordController.java @@ -19,6 +19,7 @@ import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springblade.modules.business.entity.ApmRecord; import org.springblade.modules.business.service.IApmRecordService; +import org.springblade.modules.business.vo.ApmRecordListVO; import org.springblade.modules.business.vo.ApmRecordVO; import org.springblade.modules.business.wrapper.ApmRecordWrapper; import org.springframework.web.bind.annotation.*; @@ -70,7 +71,7 @@ public class ApmRecordController extends BladeController { ApmRecord record = recordService.getById(id); if (Func.isNotEmpty(record)) { record.setApmStatus(BusinessConstant.RECORD_STATUS_REGISTER); - recordService.save(record); + recordService.updateById(record); } else { return R.fail("报到失败, 未找到对应预约记录"); } @@ -109,12 +110,12 @@ public class ApmRecordController extends BladeController { @ApiImplicitParam(name = "startTime", value = "查询开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "查询结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "cupCardNo", value = "体检人证件号", paramType = "query", dataType = "String"), - @ApiImplicitParam(name = "project", value = "体检项目", paramType = "query", dataType = "String") + @ApiImplicitParam(name = "project", value = "项目名称", paramType = "query", dataType = "String") }) @ApiOperationSupport(order = 4) - @ApiOperation(value = "分页", notes = "传入notice") - public R> selectPage(Query query, Long createDept, String startTime, String endTime, String cupCardNo, String project) { - IPage page = recordService.selectPage(Condition.getPage(query), createDept, startTime, endTime, cupCardNo, project); + @ApiOperation(value = "分页", notes = "分页") + public R> selectPage(Query query, Long createDept, String startTime, String endTime, String cupCardNo, String project) { + IPage page = recordService.selectRecordPage(Condition.getPage(query), createDept, startTime, endTime, cupCardNo, project); return R.data(page); } diff --git a/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.java b/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.java index 4e7297d..c673eaf 100644 --- a/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.java +++ b/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.Param; import org.springblade.modules.business.dto.ApmRecordCountDTO; +import org.springblade.modules.business.entity.ApmConfig; import org.springblade.modules.business.entity.ApmRecord; import java.util.List; @@ -26,10 +27,13 @@ public interface ApmRecordMapper extends BaseMapper { * @param cupCardNo * @return */ - List selectPage(IPage page, @Param("createDept") Long createDept, @Param("startTime") String startTime, @Param("endTime") String endTime, - @Param("cupCardNo") String cupCardNo, @Param("project") String project); + IPage selectRecordPage(IPage page, @Param("createDept") Long createDept, @Param("startTime") String startTime, @Param("endTime") String endTime, + @Param("cupCardNo") String cupCardNo, @Param("project") String project); + List selectRecordList(@Param("createDept") Long createDept, @Param("startTime") String startTime, @Param("endTime") String endTime, + @Param("cupCardNo") String cupCardNo, @Param("project") String project); + List countAmpNum(@Param("createDept") Long createDept, @Param("apmDay") String apmDay); List countAmpNumWithDays(@Param("createDept") Long createDept, @Param("apmDayList") List apmDayList); diff --git a/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.xml b/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.xml index cbb950e..054c5d3 100644 --- a/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.xml +++ b/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.xml @@ -32,8 +32,29 @@ - + SELECT distinct ar.create_dept, ar.cup_card_no, ar.apm_day + FROM ca_apm_record ar + WHERE ar.is_deleted = 0 + + and ar.create_dept = #{createDept} + + + and ar.apm_day >= #{startTime} + + + and ar.apm_day <= #{endTime} + + + and ar.cup_card_no like concat(concat('%', #{cupCardNo}), '%') + + + and ar.project like concat(concat('%', #{project}), '%') + + + +