ccsens_zhengzhichuan 3 weeks ago
parent
commit
f066c414fc
  1. 17
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/system/SysUserController.java
  2. 13
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminDmsUserController.java
  3. 10
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsTreatmentController.java
  4. 4
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/DmsLoginController.java
  5. 11
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java
  6. 6
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/FmsFollowupController.java
  7. 16
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ScreeningController.java
  8. 346
      acupuncture-admin/src/main/java/com/acupuncture/web/task/TaskController.java
  9. 3
      acupuncture-common/src/main/java/com/acupuncture/common/core/domain/entity/SysUser.java
  10. 10
      acupuncture-framework/src/main/java/com/acupuncture/framework/aspectj/AdminGlobalDataSourceAspect.java
  11. 4
      acupuncture-framework/src/main/java/com/acupuncture/framework/config/SecurityConfig.java
  12. 3
      acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/SysLoginService.java
  13. 6
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantUserDto.java
  14. 78
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java
  15. 4
      acupuncture-system/src/main/resources/mapper/dao/PmsTreatmentDao.xml
  16. 24
      acupuncture-system/src/main/resources/mapper/system/SysUserMapper.xml

17
acupuncture-admin/src/main/java/com/acupuncture/web/controller/system/SysUserController.java

@ -185,23 +185,6 @@ public class SysUserController extends BaseController
return toAjax(userService.updateUser(user)); return toAjax(userService.updateUser(user));
} }
<<<<<<< HEAD
private void changeDataSource(Long tenantId) {
DmsTenant dmsTenant = dmsTenantMapper.selectByPrimaryKey(tenantId);
if (dmsTenant != null) {
UmsDataSource umsDataSource = umsDataSourceMapper.selectByPrimaryKey(dmsTenant.getDataSourceId());
if (umsDataSource != null) {
try {
DynamicDataSourceContextHolder.setDataSourceType(umsDataSource.getDataSourceKey());
}finally {
DynamicDataSourceContextHolder.clearDataSourceType();
}
}
}
}
=======
>>>>>>> new
/** /**
* 删除用户 * 删除用户
*/ */

13
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminDmsUserController.java

@ -94,14 +94,8 @@ public class AdminDmsUserController {
adminTenantUserService.insert(dto); adminTenantUserService.insert(dto);
//切换至从库 //切换至从库
<<<<<<< HEAD
changeDataSource(umsDataSource.getDataSourceKey());
DynamicDataSourceContextHolder.setDataSourceType(umsDataSource.getDataSourceKey());
=======
DynamicDataSourceContextHolder.setDataSourceType(umsDataSource.getDataSourceKey()); DynamicDataSourceContextHolder.setDataSourceType(umsDataSource.getDataSourceKey());
>>>>>>> new
//新增从库数据 //新增从库数据
SysUser user = BeanUtil.copyProperties(dto, SysUser.class); SysUser user = BeanUtil.copyProperties(dto, SysUser.class);
if (!userService.checkUserNameUnique(user)) { if (!userService.checkUserNameUnique(user)) {
@ -121,10 +115,6 @@ public class AdminDmsUserController {
int insert = userService.insertUser(user); int insert = userService.insertUser(user);
//销毁切换数据源 //销毁切换数据源
<<<<<<< HEAD
removeDataSource();
=======
>>>>>>> new
DynamicDataSourceContextHolder.clearDataSourceType(); DynamicDataSourceContextHolder.clearDataSourceType();
return JsonResponse.ok(insert); return JsonResponse.ok(insert);
@ -200,12 +190,9 @@ public class AdminDmsUserController {
return JsonResponse.ok(new PageInfo<>(adminTenantUserService.query(dto.getParam()))); return JsonResponse.ok(new PageInfo<>(adminTenantUserService.query(dto.getParam())));
} }
<<<<<<< HEAD
private static void changeDataSource(String key) { private static void changeDataSource(String key) {
DynamicDataSourceContextHolder.setDataSourceType(key); DynamicDataSourceContextHolder.setDataSourceType(key);
} }
=======
>>>>>>> new
/** /**
* 重置密码 * 重置密码

10
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsTreatmentController.java

@ -95,17 +95,7 @@ public class AdminPmsTreatmentController {
// } // }
// //
<<<<<<< HEAD
private static void changeDataSource(String dataSourceKey) {
try {
DynamicDataSourceContextHolder.setDataSourceType(dataSourceKey);
}finally {
DynamicDataSourceContextHolder.clearDataSourceType();
}
}
=======
>>>>>>> new
// @ApiOperation("导出诊疗档案评估报告") // @ApiOperation("导出诊疗档案评估报告")
// @PostMapping("/exportTreatmentPg") // @PostMapping("/exportTreatmentPg")
// public JsonResponse<String> exportTreatmentPg(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.ExportVO dto){ // public JsonResponse<String> exportTreatmentPg(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.ExportVO dto){

4
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/DmsLoginController.java

@ -66,7 +66,6 @@ public class DmsLoginController {
* @param loginBody 登录信息 * @param loginBody 登录信息
* @return 结果 * @return 结果
*/ */
@DataSource(DataSourceType.MASTER)
@PostMapping("/login") @PostMapping("/login")
@DataSource(DataSourceType.MASTER) @DataSource(DataSourceType.MASTER)
public AjaxResult login(@RequestBody LoginBody loginBody) { public AjaxResult login(@RequestBody LoginBody loginBody) {
@ -79,7 +78,6 @@ public class DmsLoginController {
} }
/** /**
<<<<<<< HEAD
* 登录方法 * 登录方法
* *
* @param loginBody 登录信息 * @param loginBody 登录信息
@ -100,7 +98,6 @@ public class DmsLoginController {
/** /**
* 获取用户信息 * 获取用户信息
* *
=======
* 重置密码 * 重置密码
*/ */
@Log(title = "个人信息", businessType = BusinessType.UPDATE) @Log(title = "个人信息", businessType = BusinessType.UPDATE)
@ -145,7 +142,6 @@ public class DmsLoginController {
/** /**
* 获取用户信息暂时先从主库获取 * 获取用户信息暂时先从主库获取
>>>>>>> new
* @return 用户信息 * @return 用户信息
*/ */
@ApiOperation("用户信息") @ApiOperation("用户信息")

11
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java

@ -97,17 +97,6 @@ public class ExternalController {
} }
<<<<<<< HEAD
private static void changeDataSource(String key) {
try {
DynamicDataSourceContextHolder.setDataSourceType(key);
}finally {
DynamicDataSourceContextHolder.clearDataSourceType();
}
}
=======
>>>>>>> new
// @Anonymous // @Anonymous
// @ApiOperation("上传数据") // @ApiOperation("上传数据")
// @PostMapping("/http/uploadMemberInfo") // @PostMapping("/http/uploadMemberInfo")

6
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/FmsFollowupController.java

@ -51,8 +51,8 @@ import java.util.List;
public class FmsFollowupController { public class FmsFollowupController {
@Resource @Resource
private FmsFollowupService fmsFollowupService; private FmsFollowupService fmsFollowupService;
@Resource
<<<<<<< HEAD private FmsFollowupQueueService fmsFollowupQueueService;
@ApiOperation("查询公共队列") @ApiOperation("查询公共队列")
@PostMapping("/commonQueue") @PostMapping("/commonQueue")
@ -65,8 +65,6 @@ public class FmsFollowupController {
return JsonResponse.ok(new PageInfo<>(fmsFollowupQueueService.queryCommonQueue(dto.getParam().getName()))); return JsonResponse.ok(new PageInfo<>(fmsFollowupQueueService.queryCommonQueue(dto.getParam().getName())));
} }
=======
>>>>>>> new
@ApiOperation("查询随访队列") @ApiOperation("查询随访队列")
@PostMapping("/query") @PostMapping("/query")
public JsonResponse<PageInfo<FmsFollowupVo.FollowupQueueVO>> queryQueue(@RequestBody @Validated BaseDto<FmsFollowupDto.FollowupQueueQueryDTO> dto) { public JsonResponse<PageInfo<FmsFollowupVo.FollowupQueueVO>> queryQueue(@RequestBody @Validated BaseDto<FmsFollowupDto.FollowupQueueQueryDTO> dto) {

16
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ScreeningController.java

@ -93,23 +93,7 @@ public class ScreeningController {
return JsonResponse.ok(detailInfo); return JsonResponse.ok(detailInfo);
} }
<<<<<<< HEAD
private void changeDataSource(Long tenantId) {
DmsTenant dmsTenant = dmsTenantMapper.selectByPrimaryKey(tenantId);
if (dmsTenant != null) {
UmsDataSource umsDataSource = umsDataSourceMapper.selectByPrimaryKey(dmsTenant.getDataSourceId());
if (umsDataSource != null) {
try {
DynamicDataSourceContextHolder.setDataSourceType(umsDataSource.getDataSourceKey());
}finally {
DynamicDataSourceContextHolder.clearDataSourceType();
}
}
}
}
=======
>>>>>>> new
@ApiOperation(value = "提交筛查", notes = "") @ApiOperation(value = "提交筛查", notes = "")
@RequestMapping(value = "/submit", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @RequestMapping(value = "/submit", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse submitQuestionnaire(@ApiParam @Validated @RequestBody BaseDto<ScreeningDto.SubmitScreeningQuestionnaire> params) throws Exception { public JsonResponse submitQuestionnaire(@ApiParam @Validated @RequestBody BaseDto<ScreeningDto.SubmitScreeningQuestionnaire> params) throws Exception {

346
acupuncture-admin/src/main/java/com/acupuncture/web/task/TaskController.java

@ -1,349 +1,3 @@
<<<<<<< HEAD
//package com.acupuncture.web.controller.web;
//
//import cn.hutool.core.bean.BeanUtil;
//import cn.hutool.core.collection.CollectionUtil;
//import cn.hutool.core.date.DateUtil;
//import cn.hutool.core.util.IdUtil;
//import com.acupuncture.common.annotation.Anonymous;
//import com.acupuncture.common.core.redis.RedisCache;
//import com.acupuncture.framework.datasource.DynamicDataSourceContextHolder;
//import com.acupuncture.system.domain.dto.FmsFollowupDto;
//import com.acupuncture.system.domain.po.FmsFollowupTask;
//import com.acupuncture.system.domain.po.FmsFollowupTaskExample;
//import com.acupuncture.system.domain.po.FmsPatientQueueRelation;
//import com.acupuncture.system.domain.vo.FmsFollowupVo;
//import com.acupuncture.system.domain.vo.UmsDataSourceVo;
//import com.acupuncture.system.persist.dao.FmsFollowupDao;
//import com.acupuncture.system.persist.dao.UmsDataSourceDao;
//import com.acupuncture.system.persist.mapper.FmsFollowupTaskMapper;
//import com.acupuncture.system.persist.mapper.FmsPatientQueueRelationMapper;
//import com.acupuncture.system.service.FmsFollowupQueueService;
//import com.acupuncture.system.service.FmsFollowupService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.Data;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.catalina.connector.Response;
//import org.quartz.TriggerUtils;
//import org.quartz.impl.triggers.CronTriggerImpl;
//import org.quartz.spi.OperableTrigger;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.transaction.annotation.Propagation;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.util.*;
//import java.util.regex.Matcher;
//import java.util.regex.Pattern;
//
///**
// * @Author zzc
// * @Package com.acupuncture.web.controller.web
// * @Date 2025/2/13 8:50
// * @description:
// */
//@Slf4j
//@Api(tags = "定时任务相关")
//@RestController
//@RequestMapping("/task")
//@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
//public class TaskController {
//
// @Resource
// private FmsFollowupDao fmsFollowupDao;
// @Resource
// private FmsFollowupService fmsFollowupService;
// @Resource
// private FmsFollowupTaskMapper fmsFollowupTaskMapper;
// @Resource
// private UmsDataSourceDao umsDataSourceDao;
// @Resource
// private RedisCache redisCache;
// @Resource
// private FmsFollowupQueueService fmsFollowupQueueService;
//
// @ApiOperation("定时任务添加随访工单")
// @PostMapping("/task")
// @Scheduled(fixedDelay = 10000)
// @Anonymous
// public void task() {
// // TODO 生成工单第一次生成之后2周的,往后只生成之后一周。第一次随访时间: ( 患者的出院时间 - 7 + 轮次时间) 到 (患者的出院时间 + 7 + 轮次时间 )
// //查询租户,根据租户循环切换数据源,定时处理所有医院的随访工单
//// UmsDataSourceVo.Result result1 = new UmsDataSourceVo.Result();
//// result1.setDataSourceKey("MASTER");
//// changeDataSource(result1);
//// List<UmsDataSourceVo.Result> query = umsDataSourceDao.query(null);
//// if (CollectionUtil.isEmpty(query)) {
//// return;
//// }
// //查询公共队列
// List<Object> queueResults = redisCache.getCacheList("common_followup_queue");
// List<FmsFollowupVo.FollowupQueueVO> followupQueueVOS = new ArrayList<>();
// if (CollectionUtil.isEmpty(queueResults)) {
//
// followupQueueVOS = fmsFollowupQueueService.queryCommonQueue(null);
// }
//// List<FmsFollowupVo.FollowupQueueVO> queueResults = fmsFollowupDao.queryCommonQueue(null);
// //切换数据源
//// for (UmsDataSourceVo.Result result : query) {
//// if ("MASTER".equals(result.getDataSourceKey()) || "PROD_YY".equals(result.getDataSourceKey())) {
//// continue;
//// }
//// changeDataSource(result);
// {
// //获取随访患者列表,根据患者出院日时间和队列添加工单
// //1. 查询队列
// List<FmsFollowupVo.FollowupQueueVO> queueList = fmsFollowupDao.selectQueueList(null, null, null, null);
//
// if (CollectionUtil.isEmpty(queueList)) {
// if (CollectionUtil.isEmpty(queueResults)) {
// queueList = followupQueueVOS;
// }
// } else {
// if (CollectionUtil.isEmpty(queueResults)) {
// queueList.addAll(followupQueueVOS);
// }
// }
// for (FmsFollowupVo.FollowupQueueVO followupQueueVO : queueList) {
// Integer followWindowAdys = followupQueueVO.getFollowWindowAdys();
//
// //2. 查询队列随访患者列表
//// changeDataSource(result);
// FmsFollowupDto.FollowupPatientQueryDTO followupPatientQueryDTO = new FmsFollowupDto.FollowupPatientQueryDTO();
// followupPatientQueryDTO.setQueueId(followupQueueVO.getId());
// followupPatientQueryDTO.setTenantId(followupQueueVO.getTenantId());
//// changeDataSource(result);
// List<FmsFollowupVo.FollowupPatient> patientList = fmsFollowupService.queryTaskPatient(followupPatientQueryDTO);
//// List<FmsFollowupVo.FollowupPatient> patientList = fmsFollowupDao.queryPatient(followupQueueVO.getId(), null, null);
// if (CollectionUtil.isEmpty(patientList)) {
// continue;
// }
// //随访总月数
// Integer followupMonth = followupQueueVO.getFollowupMonth();
// for (FmsFollowupVo.FollowupPatient followupPatient : patientList) {
// //获取随访到期时间 出院时间+随访总月数 = 到期时间
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(followupPatient.getDischargeTime());
// calendar.set(Calendar.MONTH, followupMonth);
// Date time = calendar.getTime();
//
// //获取队列信息
// String frequency = followupQueueVO.getFrequency();
// List<Date> dateList = new ArrayList<>();
// try {
// CronTriggerImpl cronTrigger = new CronTriggerImpl();
// cronTrigger.setCronExpression(frequency);
// //TriggerUtils.computeFireTimesBetween(要计算触发时间的触发器对象, 用于计算触发时间的日历对象, 计算触发时间的起始时间点, 计算触发时间的结束时间点);
// dateList = TriggerUtils.computeFireTimesBetween(cronTrigger, null, followupPatient.getDischargeTime(), time);
// if (CollectionUtil.isEmpty(dateList)) {
// continue;
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// //3. 判断随访类型
// if (followupQueueVO.getFollowupType() == 0) {
// //单次
// //判断是否已有该次随访
// FmsFollowupTaskExample fmsFollowupTaskExample = new FmsFollowupTaskExample();
// fmsFollowupTaskExample.createCriteria().andTimesEqualTo(1).andPatientIdEqualTo(followupPatient.getPatientId()).andQueueIdEqualTo(followupQueueVO.getId());
// List<FmsFollowupTask> fmsFollowupTasks = fmsFollowupTaskMapper.selectByExample(fmsFollowupTaskExample);
// if (CollectionUtil.isNotEmpty(fmsFollowupTasks)) {
// continue;
// }
// FmsFollowupTask fmsFollowupTask = new FmsFollowupTask();
// BeanUtil.copyProperties(followupQueueVO, fmsFollowupTask);
// fmsFollowupTask.setId(IdUtil.getSnowflakeNextId());
// fmsFollowupTask.setName(followupPatient.getName());
// fmsFollowupTask.setPinyinFull(followupPatient.getPinyinFull());
// fmsFollowupTask.setPinyinSimple(followupPatient.getPinyinSimple());
// fmsFollowupTask.setGender(followupPatient.getGender());
// if (followupPatient.getBirthDate() != null) {
// fmsFollowupTask.setAge(DateUtil.age(followupPatient.getBirthDate(), new Date()));
// }
// fmsFollowupTask.setEthnicity(followupPatient.getEthnicity());
// fmsFollowupTask.setEducationYears(followupPatient.getEducationYears());
// fmsFollowupTask.setPhone(followupPatient.getPhone());
// fmsFollowupTask.setTenantId(followupPatient.getTenantId());
// fmsFollowupTask.setIdCardType(followupPatient.getIdCardType());
// fmsFollowupTask.setIdCard(followupPatient.getIdCard());
// fmsFollowupTask.setTimes(1);
// fmsFollowupTask.setQueueId(followupQueueVO.getId());
// fmsFollowupTask.setPatientId(followupPatient.getId());
// fmsFollowupTask.setEducationYears(followupPatient.getEducationYears());
// fmsFollowupTask.setDelFlag((byte) 0);
// fmsFollowupTask.setCreateTime(new Date());
// fmsFollowupTask.setStatus((byte) 0);
//
// //计算第一次随访的时间
// DateComparator dateComparator = getDate(dateList);
// if (dateComparator.getDate() != null) {
// fmsFollowupTask.setStartTime(dateComparator.getDate());
// } else {
// Calendar instance = Calendar.getInstance();
// instance.setTime(dateList.get(0));
// instance.add(Calendar.DATE, -followWindowAdys / 2);
// fmsFollowupTask.setStartTime(instance.getTime());
// }
// Calendar instance1 = Calendar.getInstance();
// instance1.setTime(dateList.get(0));
// instance1.add(Calendar.DATE, followWindowAdys / 2);
// fmsFollowupTask.setEndTime(instance1.getTime());
// fmsFollowupTask.setFollowuper(followupQueueVO.getPersonInCharge());
// fmsFollowupTask.setFollowupTime(dateList.get(0));
//// changeDataSource(result);
// fmsFollowupTaskMapper.insertSelective(fmsFollowupTask);
//
// } else {
// //周期
// //4. 根据频次和总月数添加
// DateComparator dateComparator = getDate(dateList);
// if (dateComparator.getDate() == null || dateComparator.getIndex() == null) {
// continue;
// }
// Date date = dateComparator.getDate();
// Integer index = dateComparator.getIndex();
//
// //判断是否已有该次随访
// FmsFollowupTaskExample fmsFollowupTaskExample = new FmsFollowupTaskExample();
// fmsFollowupTaskExample.createCriteria().andTimesEqualTo(index).andPatientIdEqualTo(followupPatient.getPatientId()).andQueueIdEqualTo(followupQueueVO.getId());
// List<FmsFollowupTask> fmsFollowupTasks = fmsFollowupTaskMapper.selectByExample(fmsFollowupTaskExample);
// if (CollectionUtil.isNotEmpty(fmsFollowupTasks)) {
// continue;
// }
//
// FmsFollowupTask fmsFollowupTask = new FmsFollowupTask();
// BeanUtil.copyProperties(followupQueueVO, fmsFollowupTask);
// fmsFollowupTask.setId(IdUtil.getSnowflakeNextId());
// fmsFollowupTask.setName(followupPatient.getName());
// fmsFollowupTask.setPinyinFull(followupPatient.getPinyinFull());
// fmsFollowupTask.setPinyinSimple(followupPatient.getPinyinSimple());
// fmsFollowupTask.setGender(followupPatient.getGender());
// if (followupPatient.getBirthDate() != null) {
// fmsFollowupTask.setAge(DateUtil.age(followupPatient.getBirthDate(), new Date()));
// }
// fmsFollowupTask.setEthnicity(followupPatient.getEthnicity());
// fmsFollowupTask.setEducationYears(followupPatient.getEducationYears());
// fmsFollowupTask.setTimes(index);
// fmsFollowupTask.setPhone(followupPatient.getPhone());
// fmsFollowupTask.setTenantId(followupPatient.getTenantId());
// fmsFollowupTask.setIdCardType(followupPatient.getIdCardType());
// fmsFollowupTask.setIdCard(followupPatient.getIdCard());
// fmsFollowupTask.setId(IdUtil.getSnowflakeNextId());
// fmsFollowupTask.setQueueId(followupQueueVO.getId());
// fmsFollowupTask.setDelFlag((byte) 0);
// fmsFollowupTask.setCreateTime(new Date());
// fmsFollowupTask.setEducationYears(followupPatient.getEducationYears());
// fmsFollowupTask.setStatus((byte) 0);
//
// fmsFollowupTask.setStartTime(date);
// Calendar instance = Calendar.getInstance();
// instance.setTime(date);
// instance.add(Calendar.DATE, followWindowAdys / 2);
//
// fmsFollowupTask.setEndTime(instance.getTime());
//// changeDataSource(result);
// fmsFollowupTask.setPatientId(followupPatient.getId());
// fmsFollowupTaskMapper.insertSelective(fmsFollowupTask);
// }
// }
// }
// }
// }
//
// private static void changeDataSource(UmsDataSourceVo.Result result) {
// try {
// DynamicDataSourceContextHolder.setDataSourceType(result.getDataSourceKey());
// } finally {
// DynamicDataSourceContextHolder.clearDataSourceType();
// }
// }
//
// public String getName(String url) {
// Pattern pattern = Pattern.compile("jdbc:mysql://[^/]+/([^?]+)");
// Matcher matcher = pattern.matcher(url);
// if (matcher.find()) {
// String dbName = matcher.group(1); // 输出 acupuncture_yfyy
// System.out.println("数据库名称: " + dbName);
// return dbName;
// }
// return "";
// }
//
// /**
// * 法用于计算在指定时间范围内触发器的触发时间点。具体步骤如下:
// * 初始化一个空列表 lst 存储触发时间点。
// * 克隆传入的触发器 trigg,并检查其下一个触发时间是否为空。如果为空,则设置开始时间和结束时间,并计算首次触发时间。
// * 使用 while 循环遍历触发器的触发时间点,直到没有更多触发时间或超出指定范围。
// * 如果触发时间在指定范围内,则将其添加到列表中,并更新触发器状态。
// *
// * @param trigg cron表达式
// * @param from 患者出院时间
// * @param to 患者出院时间 + 随访总月数
// * @return
// */
// public static List<Date> computeFireTimesBetween(OperableTrigger trigg, org.quartz.Calendar cal, Date from, Date to) {
// LinkedList<Date> lst = new LinkedList();
// OperableTrigger t = (OperableTrigger) trigg.clone();
// if (t.getNextFireTime() == null) {
// t.setStartTime(from);
// t.setEndTime(to);
// t.computeFirstFireTime(cal);
// }
//
// while (true) {
// Date d = t.getNextFireTime();
// if (d == null) {
// break;
// }
//
// if (d.before(from)) {
// t.triggered(cal);
// } else {
// if (d.after(to)) {
// break;
// }
// lst.add(d);
// t.triggered(cal);
// }
// }
// return Collections.unmodifiableList(lst);
// }
//
// /**
// * 返回当前时间之后的第一个date及对应顺序
// *
// * @param dateList key 为顺序,value 为时间
// * @return
// */
// public static DateComparator getDate(List<Date> dateList) {
// Date today = new Date();
// DateComparator dateComparator = new DateComparator();
// for (int i = 0; i < dateList.size(); i++) {
// Date date = dateList.get(i);
// if (date.after(today)) {
// dateComparator.setDate(date);
// dateComparator.setIndex(i + 1);
// return dateComparator;
// }
// }
// return dateComparator;
// }
//
// @Data
// public static class DateComparator {
// private Date date;
// private Integer index;
// }
//}
=======
>>>>>>> new
package com.acupuncture.web.task; package com.acupuncture.web.task;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;

3
acupuncture-common/src/main/java/com/acupuncture/common/core/domain/entity/SysUser.java

@ -100,10 +100,7 @@ public class SysUser extends BaseEntity
@ApiModelProperty("是否具有审核权限(0不具有; 1具有)") @ApiModelProperty("是否具有审核权限(0不具有; 1具有)")
private Byte slaverAdmin; private Byte slaverAdmin;
<<<<<<< HEAD
=======
>>>>>>> new
public SysUser() public SysUser()
{ {

10
acupuncture-framework/src/main/java/com/acupuncture/framework/aspectj/AdminGlobalDataSourceAspect.java

@ -72,7 +72,6 @@ public class AdminGlobalDataSourceAspect {
*/ */
public String getDataSource(ProceedingJoinPoint point) { public String getDataSource(ProceedingJoinPoint point) {
// 获取请求携带的令牌 // 获取请求携带的令牌
<<<<<<< HEAD
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) ServletRequestAttributes requestAttributes = (ServletRequestAttributes)
RequestContextHolder.getRequestAttributes(); RequestContextHolder.getRequestAttributes();
HttpServletRequest request; HttpServletRequest request;
@ -82,12 +81,7 @@ public class AdminGlobalDataSourceAspect {
} }
request = requestAttributes.getRequest(); request = requestAttributes.getRequest();
//token为空 //token为空
Long tenantId;
=======
HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest();
Long tenantId = null; Long tenantId = null;
>>>>>>> new
String header = request.getHeader(UserConstants.DEPT); String header = request.getHeader(UserConstants.DEPT);
if(StrUtil.isNotEmpty(header)){ if(StrUtil.isNotEmpty(header)){
tenantId = Long.parseLong(header); tenantId = Long.parseLong(header);
@ -96,15 +90,11 @@ public class AdminGlobalDataSourceAspect {
tenantId = SecurityUtils.getTenantId(); tenantId = SecurityUtils.getTenantId();
} }
} }
<<<<<<< HEAD
//设置所属医院和数据源l //设置所属医院和数据源l
// LoginUser loginUser = SecurityUtils.getLoginUser(); // LoginUser loginUser = SecurityUtils.getLoginUser();
// if(ObjectUtil.isNull(loginUser) || loginUser.getUser().isAdmin()){ // if(ObjectUtil.isNull(loginUser) || loginUser.getUser().isAdmin()){
// return null; // return null;
// } // }
=======
>>>>>>> new
//根据组织ID查询数据源 //根据组织ID查询数据源
if(tenantId !=null) { if(tenantId !=null) {
UmsDataSource dataSource = dmsLoginService.getDataSourceByTenantId(tenantId); UmsDataSource dataSource = dmsLoginService.getDataSourceByTenantId(tenantId);

4
acupuncture-framework/src/main/java/com/acupuncture/framework/config/SecurityConfig.java

@ -114,11 +114,7 @@ public class SecurityConfig
.authorizeHttpRequests((requests) -> { .authorizeHttpRequests((requests) -> {
permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll()); permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
// 对于登录login 注册register 验证码captchaImage 允许匿名访问 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
<<<<<<< HEAD
requests.antMatchers("/login", "/register", "/captchaImage", "/web/login", "/web/queryTenantById", "/api/http/getUserInfo", "/api/http/addReportImage", "/api/http/uploadMemberInfo", "/task/task", "/loginSimple").permitAll()
=======
requests.antMatchers("/login", "/register", "/captchaImage", "/web/login", "/web/queryTenantById", "/api/http/getUserInfo", "/api/http/addReportImage", "/api/http/uploadMemberInfo", "/task/task", "/loginSimple", "/screening/queryDetailNoToken").permitAll() requests.antMatchers("/login", "/register", "/captchaImage", "/web/login", "/web/queryTenantById", "/api/http/getUserInfo", "/api/http/addReportImage", "/api/http/uploadMemberInfo", "/task/task", "/loginSimple", "/screening/queryDetailNoToken").permitAll()
>>>>>>> new
// 静态资源,可匿名访问 // 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**", "/static/**").permitAll() .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**", "/static/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

3
acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/SysLoginService.java

@ -147,10 +147,7 @@ public class SysLoginService
// 生成token // 生成token
return tokenService.createToken(loginUser); return tokenService.createToken(loginUser);
} }
<<<<<<< HEAD
=======
>>>>>>> new
/** /**
* 登录验证 * 登录验证
* *

6
acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantUserDto.java

@ -40,10 +40,7 @@ public class AdminTenantUserDto {
private String status; private String status;
private String contactPhone; private String contactPhone;
<<<<<<< HEAD
=======
>>>>>>> new
@ApiModelProperty("是否具有审核权限(0不具有; 1具有)") @ApiModelProperty("是否具有审核权限(0不具有; 1具有)")
private Byte slaverAdmin = 0; private Byte slaverAdmin = 0;
} }
@ -67,10 +64,7 @@ public class AdminTenantUserDto {
private String status; private String status;
private String contactPhone; private String contactPhone;
<<<<<<< HEAD
=======
>>>>>>> new
@ApiModelProperty("是否具有审核权限(0不具有; 1具有)") @ApiModelProperty("是否具有审核权限(0不具有; 1具有)")
private Byte slaverAdmin; private Byte slaverAdmin;
} }

78
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java

@ -26,11 +26,10 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* @Author zzc * @Author zzc
@ -309,7 +308,51 @@ public class ExternalServiceImpl implements ExternalService {
header.add("姓名"); header.add("姓名");
header.add("编号"); header.add("编号");
List<UplRtcfInfo> uplRtcfInfos1 = uplRtcfInfoMapper.selectByExample(new UplRtcfInfoExample());
Map<String, List<UplRtcfInfo>> map = new HashMap<>();
if (CollectionUtil.isNotEmpty(uplRtcfInfos1)) {
map = uplRtcfInfos1.stream().collect(Collectors.groupingBy(UplRtcfInfo::getMemberid));
}
int b = 0; int b = 0;
if (CollectionUtil.isNotEmpty(pmsTreatments)) {
int row = 0;
for (int i = 0; i < pmsTreatments.size(); i++) {
if (pmsTreatments.get(i).getMemberId() == null) {
continue;
}
UplRtcfInfoExample uplRtcfInfoExample = new UplRtcfInfoExample();
uplRtcfInfoExample.createCriteria().andMemberidEqualTo(pmsTreatments.get(i).getMemberId() + "");
List<UplRtcfInfo> uplRtcfInfos = map.get(pmsTreatments.get(i).getMemberId() + "");
if (CollectionUtil.isNotEmpty(uplRtcfInfos) && b < uplRtcfInfos.size()) {
b = uplRtcfInfos.size();
}
}
}
for (int i = 0; i <= b; i++) {
header.add("创建时间");
header.add("身高");
header.add("体重");
header.add("脂肪");
header.add("骨质");
header.add("蛋白质");
header.add("水分");
header.add("肌肉");
header.add("骨骼肌");
header.add("体脂百分比");
header.add("体质指数");
header.add("腰臀比");
header.add("内脏脂肪指数");
header.add("身体年龄");
header.add("健康评分");
header.add("体型判定");
header.add("瘦体重");
header.add("诊断结论");
header.add("");
}
writer.writeHeadRow(header);
if (CollectionUtil.isNotEmpty(pmsTreatments)) { if (CollectionUtil.isNotEmpty(pmsTreatments)) {
int row = 0; int row = 0;
for (int i = 0; i < pmsTreatments.size(); i++) { for (int i = 0; i < pmsTreatments.size(); i++) {
@ -318,13 +361,10 @@ public class ExternalServiceImpl implements ExternalService {
} }
row += 1; row += 1;
// writer.writeCellValue(0, row, DateUtil.format(pmsTreatments.get(i).getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
writer.writeCellValue(0, row, pmsTreatments.get(i).getName()); writer.writeCellValue(0, row, pmsTreatments.get(i).getName());
writer.writeCellValue(1, row, pmsTreatments.get(i).getMemberId()); writer.writeCellValue(1, row, pmsTreatments.get(i).getMemberId());
UplRtcfInfoExample uplRtcfInfoExample = new UplRtcfInfoExample(); List<UplRtcfInfo> uplRtcfInfos = map.get(pmsTreatments.get(i).getMemberId() + "");
uplRtcfInfoExample.createCriteria().andMemberidEqualTo(pmsTreatments.get(i).getMemberId() + "");
List<UplRtcfInfo> uplRtcfInfos = uplRtcfInfoMapper.selectByExample(uplRtcfInfoExample);
if (CollectionUtil.isNotEmpty(uplRtcfInfos)) { if (CollectionUtil.isNotEmpty(uplRtcfInfos)) {
int n = 1; int n = 1;
for (int j = 0; j < uplRtcfInfos.size(); j++) { for (int j = 0; j < uplRtcfInfos.size(); j++) {
@ -355,29 +395,7 @@ public class ExternalServiceImpl implements ExternalService {
} }
} }
for (int i = 0; i <= b; i++) {
header.add("创建时间");
header.add("身高");
header.add("体重");
header.add("脂肪");
header.add("骨质");
header.add("蛋白质");
header.add("水分");
header.add("肌肉");
header.add("骨骼肌");
header.add("体脂百分比");
header.add("体质指数");
header.add("腰臀比");
header.add("内脏脂肪指数");
header.add("身体年龄");
header.add("健康评分");
header.add("体型判定");
header.add("瘦体重");
// header.add("细胞
header.add("诊断结论");
header.add("");
}
writer.writeHeadRow(header);
String filename = StrUtil.format("患者身高体重信息-{}.xlsx", DateUtil.date().toString("yyyyMMdd")); String filename = StrUtil.format("患者身高体重信息-{}.xlsx", DateUtil.date().toString("yyyyMMdd"));
//response为HttpServletResponse对象 //response为HttpServletResponse对象

4
acupuncture-system/src/main/resources/mapper/dao/PmsTreatmentDao.xml

@ -77,10 +77,10 @@
</foreach> </foreach>
</if> </if>
<if test="query.startTime != null and query.startTime != ''"> <if test="query.startTime != null and query.startTime != ''">
and visit_time &gt;= #{query.startTime} and create_time &gt;= #{query.startTime}
</if> </if>
<if test="query.endTime != null and query.endTime != ''"> <if test="query.endTime != null and query.endTime != ''">
and visit_time &lt;= #{query.endTime} and create_time &lt;= #{query.endTime}
</if> </if>
order by t.update_time desc order by t.update_time desc
</select> </select>

24
acupuncture-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -25,11 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="slaverAdmin" column="slaver_admin" /> <result property="slaverAdmin" column="slaver_admin" />
<<<<<<< HEAD
=======
<result property="tenantName" column="tenant_name" /> <result property="tenantName" column="tenant_name" />
<result property="tenantPhone" column="tenant_phone" /> <result property="tenantPhone" column="tenant_phone" />
>>>>>>> 93181b5fbb436385d1d312300e8dcc61b43d1666
<association property="dept" javaType="SysDept" resultMap="deptResult" /> <association property="dept" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> <collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap> </resultMap>
@ -54,11 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectUserVo"> <sql id="selectUserVo">
<<<<<<< HEAD
select u.user_id, u.tenant_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.slaver_admin,
=======
select u.user_id, u.tenant_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.slaver_admin, u.tenant_name, u.tenant_phone, select u.user_id, u.tenant_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.slaver_admin, u.tenant_name, u.tenant_phone,
>>>>>>> 93181b5fbb436385d1d312300e8dcc61b43d1666
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u
@ -177,17 +170,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">status,</if> <if test="status != null and status != ''">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<<<<<<< HEAD
<<<<<<< HEAD
<if test="slaverAdmin != null ">slaver_admin,</if>
=======
<if test="slaverAdmin != null">slaver_admin,</if>
<if test="tenantName != null and tenantName != ''">tenant_name,</if> <if test="tenantName != null and tenantName != ''">tenant_name,</if>
<if test="tenantPhone != null and tenantPhone != ''">tenant_phone,</if> <if test="tenantPhone != null and tenantPhone != ''">tenant_phone,</if>
>>>>>>> 93181b5fbb436385d1d312300e8dcc61b43d1666
=======
<if test="slaverAdmin != null">slaver_admin,</if> <if test="slaverAdmin != null">slaver_admin,</if>
>>>>>>> new
create_time create_time
)values( )values(
<if test="userId != null and userId != ''">#{userId},</if> <if test="userId != null and userId != ''">#{userId},</if>
@ -203,17 +188,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if> <if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<<<<<<< HEAD
<<<<<<< HEAD
<if test="slaverAdmin != null ">#{slaverAdmin},</if>
=======
<if test="slaverAdmin != null">#{slaverAdmin},</if>
<if test="tenantName != null and tenantName != ''">#{tenantName},</if> <if test="tenantName != null and tenantName != ''">#{tenantName},</if>
<if test="tenantPhone != null and tenantPhone != ''">#{tenantPhone},</if> <if test="tenantPhone != null and tenantPhone != ''">#{tenantPhone},</if>
>>>>>>> 93181b5fbb436385d1d312300e8dcc61b43d1666
=======
<if test="slaverAdmin != null">#{slaverAdmin},</if> <if test="slaverAdmin != null">#{slaverAdmin},</if>
>>>>>>> new
sysdate() sysdate()
) )
</insert> </insert>
@ -236,7 +213,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="loginDate != null">login_date = #{loginDate},</if> <if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="slaverAdmin != null">slaver_admin = #{slaverAdmin},</if>
update_time = sysdate() update_time = sysdate()
</set> </set>
where user_id = #{userId} where user_id = #{userId}

Loading…
Cancel
Save