Browse Source

Merge branch 'master' into hnsdlyy

# Conflicts:
#	ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/PmsController.java
#	ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml
#	ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/PmsPatientDao.xml
hnsdlyy
zhangye 16 hours ago
parent
commit
b0ab830663
  1. 2
      ruisi_java/ruisi-cc-framework/src/main/java/com/ccsens/framework/web/service/SysLoginService.java
  2. 7
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/PmsPatientVo.java
  3. 62
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java
  4. 30
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/StatisticsService.java
  5. 70
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java
  6. 137
      ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml
  7. 88
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/PmsController.java
  8. 14
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/RmsController.java
  9. 185
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/StatisticsController.java
  10. 308
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/TjfxController.java
  11. 16
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/PmsPatientDao.java
  12. 2
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/RmsDao.java
  13. 8
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java
  14. 14
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java
  15. 23
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/RmsServiceImpl.java
  16. 250
      ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml
  17. 66
      ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/RmsDao.xml
  18. 19
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/PmsController.java
  19. 3
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/PmsPatientDao.java
  20. 3
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IPmsPatientService.java
  21. 4
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/PmsPatientServiceImpl.java
  22. 205
      ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/PmsPatientDao.xml
  23. 2
      web_admin/src/views/report/view copy.vue
  24. 3
      web_admin/vue.config.js
  25. 18
      web_client/src/views/Patient/chooseSetMeal/index.vue
  26. 2
      web_client/src/views/evaluation/index.vue

2
ruisi_java/ruisi-cc-framework/src/main/java/com/ccsens/framework/web/service/SysLoginService.java

@ -95,7 +95,7 @@ public class SysLoginService {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"), null)); AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"), null));
LoginUser loginUser = (LoginUser) authentication.getPrincipal(); LoginUser loginUser = (LoginUser) authentication.getPrincipal();
//非总测评师不能登录 //非总测评师不能登录
if (!loginUser.getUser().isAdmin() || CollectionUtil.isEmpty(loginUser.getUser().getRoles()) || !loginUser.getUser().getRoles().stream().map(e -> e.getRoleKey()).collect(Collectors.toList()).contains("yy_zcps")) { if (!loginUser.getUser().isAdmin() && (CollectionUtil.isEmpty(loginUser.getUser().getRoles()) || !loginUser.getUser().getRoles().stream().map(e -> e.getRoleKey()).collect(Collectors.toList()).contains("yy_zcps"))) {
throw new BaseException(ErrorConstant.USER_NO_PERMISSION); throw new BaseException(ErrorConstant.USER_NO_PERMISSION);
} }
recordLoginInfo(loginUser.getUserId()); recordLoginInfo(loginUser.getUserId());

7
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/PmsPatientVo.java

@ -939,7 +939,12 @@ public class PmsPatientVo {
private Byte dwellingState; private Byte dwellingState;
private String birthday; private String birthday;
private String contactName; private String contactName;
@ApiModelProperty("上次测评时间")
private Date lastEvaluationTime;
@ApiModelProperty("测评师名称")
private String lastTesterName;
@ApiModelProperty("总测评次数")
private Integer evaluationCount;
@ApiModelProperty("其他病史信息") @ApiModelProperty("其他病史信息")
private Map<String,List<Map<String, Object>>> otherMsg; private Map<String,List<Map<String, Object>>> otherMsg;

62
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java

@ -16,78 +16,104 @@ public interface StatisticsDao {
/** /**
* 综合数据 * 综合数据
*
* @param dto * @param dto
* @return * @return
*/ */
HomeDpVo.Zhsjgl nntotal(@Param("dto") StatisticsDto.Query dto); HomeDpVo.Zhsjgl nntotal(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
Integer getPatientNum(@Param("dto") StatisticsDto.Query dto, Integer getPatientNum(@Param("dto") StatisticsDto.Query dto,
@Param("sex") Byte sex); @Param("sex") Byte sex,
@Param("deptIdLIst") List<Long> deptIdLIst);
/** /**
* BMI * BMI
*
* @param dto * @param dto
* @return * @return
*/ */
HomeDpVo.Bmi nnbmihjxy(@Param("dto") StatisticsDto.Query dto); HomeDpVo.Bmi nnbmihjxy(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
/** /**
* 最新评估情况 * 最新评估情况
*
* @param dto * @param dto
* @return * @return
*/ */
List<HomeDpVo.Pgqk> nnlast(@Param("dto") StatisticsDto.Query dto); List<HomeDpVo.Pgqk> nnlast(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
/** /**
* 年龄分布 * 年龄分布
*
* @param dto * @param dto
* @return * @return
*/ */
HomeDpVo.Nlfb nnage(@Param("dto") StatisticsDto.Query dto); HomeDpVo.Nlfb nnage(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
/** /**
* T值分析 * T值分析
*
* @param dto * @param dto
* @return * @return
*/ */
HomeDpVo.Tz nntgb(@Param("dto") StatisticsDto.Query dto); HomeDpVo.Tz nntgb(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
HomeDpVo.Ypzb nnYpzb(@Param("dto") StatisticsDto.Query dto); HomeDpVo.Ypzb nnYpzb(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
/** /**
* 疾病排行 * 疾病排行
*
* @param dto * @param dto
* @return * @return
*/ */
List<HomeDpVo.Jbph> nnicd(@Param("dto") StatisticsDto.Query dto); List<HomeDpVo.Jbph> nnicd(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
/** /**
* 地图 * 地图
*
* @param dto * @param dto
* @return * @return
*/ */
List<HomeDpVo.Dt> nnmap(@Param("dto") StatisticsDto.Query dto); List<HomeDpVo.Dt> nnmap(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
/** /**
* 评估结果 * 评估结果
*
* @param dto * @param dto
* @return * @return
*/ */
List<HomeDpVo.Pgjg> nnscale(@Param("dto") StatisticsDto.Query dto); List<HomeDpVo.Pgjg> nnscale(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
List<HomeDpVo.QualificationStatistics> qualificationStatistics(@Param("dto") StatisticsDto.Query dto); List<HomeDpVo.QualificationStatistics> qualificationStatistics(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
HomeDpVo.JzStatistics JzStatistics(@Param("param") StatisticsDto.Query dto); HomeDpVo.JzStatistics JzStatistics(@Param("param") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
HomeDpVo.JzStatistics JzStatisticsNum(@Param("dto") StatisticsDto.Query dto); HomeDpVo.JzStatistics JzStatisticsNum(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
List<HomeDpVo.ScaleStatistics> scaleStatistics(@Param("dto") StatisticsDto.Query dto); List<HomeDpVo.ScaleStatistics> scaleStatistics(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
List<HomeDpVo.VersionStatistics> versionStatistics(@Param("dto") StatisticsDto.Query dto); List<HomeDpVo.VersionStatistics> versionStatistics(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
List<HomeDpVo.UserStatistics> userStatistics(@Param("dto") StatisticsDto.Query dto); List<HomeDpVo.UserStatistics> userStatistics(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
HomeDpVo.SexStatistics sexStatistics(@Param("dto") StatisticsDto.Query dto); HomeDpVo.SexStatistics sexStatistics(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
HomeDpVo.XyYjStatistics xyYjStatistics(@Param("dto") StatisticsDto.Query dto); HomeDpVo.XyYjStatistics xyYjStatistics(@Param("dto") StatisticsDto.Query dto,
@Param("deptIdLIst") List<Long> deptIdLIst);
} }

30
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/StatisticsService.java

@ -14,32 +14,32 @@ import java.util.List;
*/ */
public interface StatisticsService { public interface StatisticsService {
HomeDpVo.Zhsjgl nntotal(StatisticsDto.Query dto); HomeDpVo.Zhsjgl nntotal(StatisticsDto.Query dto, List<Long> deptIdLIst);
HomeDpVo.Bmi nnbmihjxy(StatisticsDto.Query dto); HomeDpVo.Bmi nnbmihjxy(StatisticsDto.Query dto, List<Long> deptIdLIst);
List<HomeDpVo.Pgqk> nnlast(StatisticsDto.Query dto); List<HomeDpVo.Pgqk> nnlast(StatisticsDto.Query dto, List<Long> deptIdLIst);
HomeDpVo.Nlfb nnage(StatisticsDto.Query dto); HomeDpVo.Nlfb nnage(StatisticsDto.Query dto, List<Long> deptIdLIst);
HomeDpVo.Tz nntgb(StatisticsDto.Query dto); HomeDpVo.Tz nntgb(StatisticsDto.Query dto, List<Long> deptIdLIst);
List<HomeDpVo.Jbph> nnicd(StatisticsDto.Query dto); List<HomeDpVo.Jbph> nnicd(StatisticsDto.Query dto, List<Long> deptIdLIst);
List<HomeDpVo.Dt> nnmap(StatisticsDto.Query dto); List<HomeDpVo.Dt> nnmap(StatisticsDto.Query dto, List<Long> deptIdLIst);
List<HomeDpVo.Pgjg> nnscale(StatisticsDto.Query dto); List<HomeDpVo.Pgjg> nnscale(StatisticsDto.Query dto, List<Long> deptIdLIst);
/** /**
* 学历统计 * 学历统计
* @param dto * @param dto
* @return * @return
*/ */
List<HomeDpVo.QualificationStatistics> qualificationStatistics(StatisticsDto.Query dto); List<HomeDpVo.QualificationStatistics> qualificationStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst);
HomeDpVo.JzStatistics jzStatistics(StatisticsDto.Query dto); HomeDpVo.JzStatistics jzStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst);
List<HomeDpVo.ScaleStatistics> scaleStatistics(StatisticsDto.Query dto); List<HomeDpVo.ScaleStatistics> scaleStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst);
List<HomeDpVo.VersionStatistics> versionStatistics(StatisticsDto.Query dto); List<HomeDpVo.VersionStatistics> versionStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst);
List<HomeDpVo.UserStatistics> userStatistics(StatisticsDto.Query dto); List<HomeDpVo.UserStatistics> userStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst);
HomeDpVo.SexStatistics sexStatistics(StatisticsDto.Query dto); HomeDpVo.SexStatistics sexStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst);
HomeDpVo.XyYjStatistics xyYjStatistics(StatisticsDto.Query dto); HomeDpVo.XyYjStatistics xyYjStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst);
} }

70
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java

@ -26,112 +26,112 @@ public class StatisticsServiceImpl implements StatisticsService {
private StatisticsDao statisticsDao; private StatisticsDao statisticsDao;
@Override @Override
public HomeDpVo.Zhsjgl nntotal(StatisticsDto.Query dto) { public HomeDpVo.Zhsjgl nntotal(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
HomeDpVo.Zhsjgl nntotal = statisticsDao.nntotal(dto); HomeDpVo.Zhsjgl nntotal = statisticsDao.nntotal(dto, deptIdLIst);
if (nntotal == null) { if (nntotal == null) {
nntotal = new HomeDpVo.Zhsjgl(); nntotal = new HomeDpVo.Zhsjgl();
} }
nntotal.setPtotal(statisticsDao.getPatientNum(dto, null)); nntotal.setPtotal(statisticsDao.getPatientNum(dto, null, deptIdLIst));
nntotal.setMtotal(statisticsDao.getPatientNum(dto, (byte) 0)); nntotal.setMtotal(statisticsDao.getPatientNum(dto, (byte) 0, deptIdLIst));
nntotal.setFtotal(statisticsDao.getPatientNum(dto, (byte) 1)); nntotal.setFtotal(statisticsDao.getPatientNum(dto, (byte) 1, deptIdLIst));
return nntotal; return nntotal;
} }
@Override @Override
public HomeDpVo.Bmi nnbmihjxy(StatisticsDto.Query dto) { public HomeDpVo.Bmi nnbmihjxy(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.nnbmihjxy(dto); return statisticsDao.nnbmihjxy(dto, deptIdLIst);
} }
@Override @Override
public List<HomeDpVo.Pgqk> nnlast(StatisticsDto.Query dto) { public List<HomeDpVo.Pgqk> nnlast(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.nnlast(dto); return statisticsDao.nnlast(dto, deptIdLIst);
} }
@Override @Override
public HomeDpVo.Nlfb nnage(StatisticsDto.Query dto) { public HomeDpVo.Nlfb nnage(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.nnage(dto); return statisticsDao.nnage(dto, deptIdLIst);
} }
@Override @Override
public HomeDpVo.Tz nntgb(StatisticsDto.Query dto) { public HomeDpVo.Tz nntgb(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.nntgb(dto); return statisticsDao.nntgb(dto, deptIdLIst);
} }
@Override @Override
public List<HomeDpVo.Jbph> nnicd(StatisticsDto.Query dto) { public List<HomeDpVo.Jbph> nnicd(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.nnicd(dto); return statisticsDao.nnicd(dto, deptIdLIst);
} }
@Override @Override
public List<HomeDpVo.Dt> nnmap(StatisticsDto.Query dto) { public List<HomeDpVo.Dt> nnmap(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.nnmap(dto); return statisticsDao.nnmap(dto, deptIdLIst);
} }
@Override @Override
public List<HomeDpVo.Pgjg> nnscale(StatisticsDto.Query dto) { public List<HomeDpVo.Pgjg> nnscale(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.nnscale(dto); return statisticsDao.nnscale(dto, deptIdLIst);
} }
@Override @Override
public List<HomeDpVo.QualificationStatistics> qualificationStatistics(StatisticsDto.Query dto) { public List<HomeDpVo.QualificationStatistics> qualificationStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.qualificationStatistics(dto); return statisticsDao.qualificationStatistics(dto, deptIdLIst);
} }
@Override @Override
public HomeDpVo.JzStatistics jzStatistics(StatisticsDto.Query dto) { public HomeDpVo.JzStatistics jzStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
// HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatisticsNum(dto); // HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatisticsNum(dto, deptIdLIst);
// if (jzStatistics!= null) { // if (jzStatistics!= null) {
HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatistics(dto); HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatistics(dto, deptIdLIst);
// jzStatistics.setZyNum(jzStatistics1.getZyNum()); // jzStatistics.setZyNum(jzStatistics1.getZyNum());
// jzStatistics.setMzNum(jzStatistics1.getMzNum()); // jzStatistics.setMzNum(jzStatistics1.getMzNum());
// } // }
@ -139,37 +139,37 @@ public class StatisticsServiceImpl implements StatisticsService {
} }
@Override @Override
public List<HomeDpVo.ScaleStatistics> scaleStatistics(StatisticsDto.Query dto) { public List<HomeDpVo.ScaleStatistics> scaleStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.scaleStatistics(dto); return statisticsDao.scaleStatistics(dto, deptIdLIst);
} }
@Override @Override
public List<HomeDpVo.VersionStatistics> versionStatistics(StatisticsDto.Query dto) { public List<HomeDpVo.VersionStatistics> versionStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.versionStatistics(dto); return statisticsDao.versionStatistics(dto, deptIdLIst);
} }
@Override @Override
public List<HomeDpVo.UserStatistics> userStatistics(StatisticsDto.Query dto) { public List<HomeDpVo.UserStatistics> userStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1)); dto.setEndTime(dateByType.get(1));
} }
return statisticsDao.userStatistics(dto); return statisticsDao.userStatistics(dto, deptIdLIst);
} }
@Override @Override
public HomeDpVo.SexStatistics sexStatistics(StatisticsDto.Query dto) { public HomeDpVo.SexStatistics sexStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst) {
if (dto.getTimeType() != null) { if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0)); dto.setBeginTime(dateByType.get(0));
@ -177,15 +177,15 @@ public class StatisticsServiceImpl implements StatisticsService {
} }
HomeDpVo.SexStatistics sexStatistics = new HomeDpVo.SexStatistics(); HomeDpVo.SexStatistics sexStatistics = new HomeDpVo.SexStatistics();
sexStatistics.setBoy(statisticsDao.getPatientNum(dto, (byte) 0)); sexStatistics.setBoy(statisticsDao.getPatientNum(dto, (byte) 0, deptIdLIst));
sexStatistics.setGirl(statisticsDao.getPatientNum(dto, (byte) 1)); sexStatistics.setGirl(statisticsDao.getPatientNum(dto, (byte) 1, deptIdLIst));
return sexStatistics; return sexStatistics;
} }
@Override @Override
public HomeDpVo.XyYjStatistics xyYjStatistics(StatisticsDto.Query dto) { public HomeDpVo.XyYjStatistics xyYjStatistics(StatisticsDto.Query dto, List<Long> deptIdLIst) {
return statisticsDao.xyYjStatistics(dto); return statisticsDao.xyYjStatistics(dto, deptIdLIst);
} }
/** /**

137
ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml

@ -14,15 +14,18 @@
ems_evaluation e ems_evaluation e
LEFT JOIN ums_user u ON e.create_by = u.user_name LEFT JOIN ums_user u ON e.create_by = u.user_name
where e.del_flag = 0 and e.complete_status != 0 where e.del_flag = 0 and e.complete_status != 0
<if test="dto.deptId != null">
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND e.create_time >= #{dto.beginTime} AND e.create_time >= #{dto.beginTime}
</if> </if>
<if test="dto.endTime != null"> <if test="dto.endTime != null">
AND e.create_time &lt;= #{dto.endTime} AND e.create_time &lt;= #{dto.endTime}
</if> </if>
<if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if>
</select> </select>
<select id="getPatientNum" resultType="java.lang.Integer"> <select id="getPatientNum" resultType="java.lang.Integer">
@ -30,9 +33,13 @@
COUNT(DISTINCT p.id) AS total COUNT(DISTINCT p.id) AS total
FROM FROM
pms_patient p pms_patient p
LEFT JOIN ums_user u ON p.create_by = u.user_name
where p.del_flag = 0 where p.del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND p.hospital_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime} AND p.create_time >= #{dto.beginTime}
@ -57,8 +64,11 @@
left JOIN pms_patient_body pb ON p.id = pb.patient_id left JOIN pms_patient_body pb ON p.id = pb.patient_id
LEFT JOIN ums_user u ON p.create_by = u.user_name LEFT JOIN ums_user u ON p.create_by = u.user_name
where p.del_flag = 0 where p.del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime} AND p.create_time >= #{dto.beginTime}
@ -81,8 +91,11 @@
LEFT JOIN ums_user u ON e.create_by = u.user_name LEFT JOIN ums_user u ON e.create_by = u.user_name
where e.del_flag = 0 where e.del_flag = 0
and e.patient_id != 0 and e.patient_id != 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND e.create_time >= #{dto.beginTime} AND e.create_time >= #{dto.beginTime}
@ -101,8 +114,11 @@
pms_patient p pms_patient p
LEFT JOIN ums_user u ON p.create_by = u.user_name LEFT JOIN ums_user u ON p.create_by = u.user_name
where p.del_flag = 0 where p.del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime} AND p.create_time >= #{dto.beginTime}
@ -122,8 +138,11 @@
LEFT JOIN ums_user u ON b.create_by = u.user_name LEFT JOIN ums_user u ON b.create_by = u.user_name
WHERE WHERE
drug_name IS NOT NULL and del_flag = 0 drug_name IS NOT NULL and del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND b.create_time >= #{dto.beginTime} AND b.create_time >= #{dto.beginTime}
@ -145,12 +164,16 @@
FROM FROM
pms_patient_diagnosis b pms_patient_diagnosis b
LEFT JOIN pms_patient p ON b.patient_id = p.id LEFT JOIN pms_patient p ON b.patient_id = p.id
left JOIN ums_user u ON b.create_by = u.user_name
WHERE WHERE
b.diagnosis_name IS NOT NULL b.diagnosis_name IS NOT NULL
and diagnosis_name != '' and diagnosis_name != ''
and b.del_flag = 0 and b.del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND p.hospital_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND b.create_time >= #{dto.beginTime} AND b.create_time >= #{dto.beginTime}
@ -175,10 +198,14 @@
SELECT SELECT
TIMESTAMPDIFF(YEAR, birthday, CURDATE()) - TIMESTAMPDIFF(YEAR, birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(birthday, '%m%d')) AS age (DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(birthday, '%m%d')) AS age
FROM pms_patient FROM pms_patient p
WHERE del_flag = 0 LEFT JOIN ums_user u ON p.create_by = u.user_name
<if test="dto.deptId != null"> WHERE p.del_flag = 0
AND hospital_id = #{dto.deptId} <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND create_time >= #{dto.beginTime} AND create_time >= #{dto.beginTime}
@ -196,8 +223,11 @@
from ums_dept from ums_dept
where del_flag = 0 where del_flag = 0
and parent_id = 0 and parent_id = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND dept_id = #{dto.deptId} AND dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND create_time >= #{dto.beginTime} AND create_time >= #{dto.beginTime}
@ -235,8 +265,11 @@
"PSQI", "PSQI",
"CAM" "CAM"
) )
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND p.hospital_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND r.create_time >= #{dto.beginTime} AND r.create_time >= #{dto.beginTime}
@ -253,10 +286,14 @@
COUNT( p.id ) AS num COUNT( p.id ) AS num
FROM FROM
pms_patient p pms_patient p
LEFT JOIN ums_user u ON p.create_by = u.user_name
where where
p.del_flag = 0 p.del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND p.hospital_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime} AND p.create_time >= #{dto.beginTime}
@ -286,14 +323,18 @@
pms_patient_body b pms_patient_body b
left join pms_patient p on b.patient_id = p.id left join pms_patient p on b.patient_id = p.id
left join ems_evaluation e on e.visit_no = b.outpatient_no left join ems_evaluation e on e.visit_no = b.outpatient_no
left join ums_user u on b.create_by = u.user_name
<where> <where>
b.del_flag = 0 and p.del_flag = 0 b.del_flag = 0 and p.del_flag = 0
<if test="param.beginTime != null and param.endTime != null"> <if test="param.beginTime != null and param.endTime != null">
and b.diagnosis_date between #{param.beginTime} and #{param.endTime} and b.diagnosis_date between #{param.beginTime} and #{param.endTime}
</if> </if>
<if test="param.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
and p.hospital_id = #{param.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
</where> </where>
@ -336,8 +377,11 @@
WHERE e.del_flag = 0 WHERE e.del_flag = 0
AND e.visit_no != '0' AND e.visit_no != '0'
AND e.visit_no IS NOT NULL AND e.visit_no IS NOT NULL
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND e.create_time >= #{dto.beginTime} AND e.create_time >= #{dto.beginTime}
@ -362,8 +406,11 @@
LEFT JOIN pms_patient p ON e.patient_id = p.id LEFT JOIN pms_patient p ON e.patient_id = p.id
WHERE WHERE
e.del_flag = 0 e.del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND p.hospital_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND ees.create_time >= #{dto.beginTime} AND ees.create_time >= #{dto.beginTime}
@ -385,8 +432,11 @@
LEFT JOIN rms_report r on r.evaluation_id = ee.id LEFT JOIN rms_report r on r.evaluation_id = ee.id
LEFT JOIN ums_user u ON ee.create_by = u.user_name AND u.del_flag = 0 LEFT JOIN ums_user u ON ee.create_by = u.user_name AND u.del_flag = 0
WHERE hv.del_flag = 0 WHERE hv.del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND ee.create_time >= #{dto.beginTime} AND ee.create_time >= #{dto.beginTime}
@ -410,8 +460,11 @@
LEFT JOIN rms_report r on r.evaluation_id = ee.id LEFT JOIN rms_report r on r.evaluation_id = ee.id
WHERE WHERE
u.del_flag = 0 u.del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND ee.create_time >= #{dto.beginTime} AND ee.create_time >= #{dto.beginTime}
@ -432,8 +485,11 @@
LEFT JOIN ums_user u ON p.create_by = u.user_name AND u.del_flag = 0 LEFT JOIN ums_user u ON p.create_by = u.user_name AND u.del_flag = 0
WHERE WHERE
p.del_flag = 0 p.del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime} AND p.create_time >= #{dto.beginTime}
@ -463,8 +519,11 @@
WHERE WHERE
p.del_flag = 0 p.del_flag = 0
AND pp.del_flag = 0 AND pp.del_flag = 0
<if test="dto.deptId != null"> <if test="deptIdLIst != null and deptIdLIst.size() >0">
AND u.dept_id = #{dto.deptId} AND u.dept_id IN
<foreach item="item" collection="deptIdLIst" separator="," close=")" index="index" open="(">
#{item}
</foreach>
</if> </if>
<if test="dto.beginTime != null"> <if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime} AND p.create_time >= #{dto.beginTime}

88
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/PmsController.java

@ -7,6 +7,7 @@ import cn.hutool.core.util.PhoneUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.ccsens.admin.service.IPmsPatientService; import com.ccsens.admin.service.IPmsPatientService;
import com.ccsens.common.constant.ErrorConstant; import com.ccsens.common.constant.ErrorConstant;
import com.ccsens.common.constant.WebConstant;
import com.ccsens.common.core.controller.BaseController; import com.ccsens.common.core.controller.BaseController;
import com.ccsens.common.core.domain.BaseDto; import com.ccsens.common.core.domain.BaseDto;
import com.ccsens.common.core.domain.JsonResponse; import com.ccsens.common.core.domain.JsonResponse;
@ -19,6 +20,7 @@ import com.ccsens.common.utils.file.MimeTypeUtils;
import com.ccsens.common.utils.sign.Md5Utils; import com.ccsens.common.utils.sign.Md5Utils;
import com.ccsens.system.domain.dto.PmsPatientDto; import com.ccsens.system.domain.dto.PmsPatientDto;
import com.ccsens.system.domain.vo.PmsPatientVo; import com.ccsens.system.domain.vo.PmsPatientVo;
import com.ccsens.system.service.SysPowerService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -28,11 +30,15 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -46,20 +52,32 @@ import java.util.List;
public class PmsController extends BaseController { public class PmsController extends BaseController {
@Resource @Resource
private IPmsPatientService patientService; private IPmsPatientService patientService;
@Resource
private SysPowerService sysPowerService;
@ApiOperation("获取患者信息列表") @ApiOperation("获取患者信息列表")
@PostMapping("/queryList") @PostMapping("/queryList")
public JsonResponse<PageInfo<PmsPatientVo.PatientList>> queryPatientList(@RequestBody @Validated BaseDto<PmsPatientDto.QueryPatient> dto) { public JsonResponse<PageInfo<PmsPatientVo.PatientList>> queryPatientList(@RequestBody @Validated BaseDto<PmsPatientDto.QueryPatient> dto) {
//获取用户的权限 List<Long> deptIdList = new ArrayList<>();
LoginUser loginUser = SecurityUtils.getLoginUser(); if (dto.getParam().getDeptId() == null) {
//当前默认一个用户只有一个角色 try {
String dataScope = "5"; deptIdList.addAll(sysPowerService.queryPowerDept());
if(CollUtil.isNotEmpty(loginUser.getUser().getRoles())){ } catch (Exception e) {
dataScope = loginUser.getUser().getRoles().get(0).getDataScope(); log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) {
deptIdList.add(Long.parseLong(deptId));
}
}
}else {
deptIdList.add(dto.getParam().getDeptId());
} }
startPage(dto); startPage(dto);
List<PmsPatientVo.PatientList> list = patientService.queryPatientList(dto.getParam(),dataScope,loginUser.getUserId(),loginUser.getUsername()); List<PmsPatientVo.PatientList> list = patientService.queryPatientList(dto.getParam(),null,SecurityUtils.getUserId(),SecurityUtils.getUsername(), deptIdList);
return JsonResponse.ok(new PageInfo<>(list)); return JsonResponse.ok(new PageInfo<>(list));
} }
@ -211,14 +229,24 @@ public class PmsController extends BaseController {
@ApiOperation("导出患者列表") @ApiOperation("导出患者列表")
@PostMapping("/exportPatient") @PostMapping("/exportPatient")
public void exportPatient(HttpServletResponse response, @RequestBody @Validated BaseDto<PmsPatientDto.QueryPatient> dto) throws IOException{ public void exportPatient(HttpServletResponse response, @RequestBody @Validated BaseDto<PmsPatientDto.QueryPatient> dto) throws IOException{
//获取用户的权限 List<Long> deptIdList = new ArrayList<>();
LoginUser loginUser = SecurityUtils.getLoginUser(); if (dto.getParam().getDeptId() == null) {
//当前默认一个用户只有一个角色 try {
String dataScope = "5"; deptIdList.addAll(sysPowerService.queryPowerDept());
if(CollUtil.isNotEmpty(loginUser.getUser().getRoles())){ } catch (Exception e) {
dataScope = loginUser.getUser().getRoles().get(0).getDataScope(); log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) {
deptIdList.add(Long.parseLong(deptId));
}
}
}else {
deptIdList.add(dto.getParam().getDeptId());
} }
patientService.exportPatient(response, dto.getParam(), dataScope, loginUser.getUserId(),loginUser.getUsername()); patientService.exportPatient(response, dto.getParam(), null, SecurityUtils.getUserId(),SecurityUtils.getUsername(), deptIdList);
} }
@ApiOperation("查询就诊列表") @ApiOperation("查询就诊列表")
@ -226,14 +254,34 @@ public class PmsController extends BaseController {
public JsonResponse<PageInfo<PmsPatientVo.QueryPatientJz>> queryPatientJzList(@RequestBody @Validated BaseDto<PmsPatientDto.QueryPatientJz> dto){ public JsonResponse<PageInfo<PmsPatientVo.QueryPatientJz>> queryPatientJzList(@RequestBody @Validated BaseDto<PmsPatientDto.QueryPatientJz> dto){
//获取用户的权限 //获取用户的权限
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
//当前默认一个用户只有一个角色 // //当前默认一个用户只有一个角色
String dataScope = "5"; // String dataScope = "5";
if(CollUtil.isNotEmpty(loginUser.getUser().getRoles())){ // if(CollUtil.isNotEmpty(loginUser.getUser().getRoles())){
dataScope = loginUser.getUser().getRoles().get(0).getDataScope(); // dataScope = loginUser.getUser().getRoles().get(0).getDataScope();
// }
// dto.getParam().setDeptId(loginUser.getDeptId());
//
List<Long> deptIdList = new ArrayList<>();
if (dto.getParam().getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) {
deptIdList.add(Long.parseLong(deptId));
}
} }
dto.getParam().setDeptId(loginUser.getDeptId()); }else {
deptIdList.add(dto.getParam().getDeptId());
}
startPage(dto); startPage(dto);
return JsonResponse.ok(new PageInfo<>(patientService.queryPatientJzList(dto.getParam(), dataScope, loginUser.getUserId(),loginUser.getUsername()))); return JsonResponse.ok(new PageInfo<>(patientService.queryPatientJzList(dto.getParam(), null, loginUser.getUserId(),loginUser.getUsername(), deptIdList)));
} }
@ApiOperation("导出患者就诊列表") @ApiOperation("导出患者就诊列表")

14
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/RmsController.java

@ -3,6 +3,7 @@ package com.ccsens.admin.controller;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.CharsetUtil; import cn.hutool.core.util.CharsetUtil;
import com.ccsens.admin.service.IRmsService; import com.ccsens.admin.service.IRmsService;
import com.ccsens.common.annotation.Anonymous;
import com.ccsens.common.core.controller.BaseController; import com.ccsens.common.core.controller.BaseController;
import com.ccsens.common.core.domain.BaseDto; import com.ccsens.common.core.domain.BaseDto;
import com.ccsens.common.core.domain.JsonResponse; import com.ccsens.common.core.domain.JsonResponse;
@ -163,8 +164,8 @@ public class RmsController extends BaseController {
} }
@ApiOperation(value = "查询测评列表", notes = "管理员查询测评列表") @ApiOperation(value = "查询测评列表", notes = "管理员查询测评列表")
@PostMapping("/queryReport") @PostMapping("/queryEvaluation")
public JsonResponse<PageInfo<RmsVo.Report>> queryReport(@RequestBody @ApiParam @Valid BaseDto<RmsDto.ReportQuery> param) { public JsonResponse<PageInfo<RmsVo.Report>> queryEvaluation(@RequestBody @ApiParam @Valid BaseDto<RmsDto.ReportQuery> param) {
if (param.getPageNum() > 0) { if (param.getPageNum() > 0) {
PageHelper.startPage(param.getPageNum(), param.getPageSize()); PageHelper.startPage(param.getPageNum(), param.getPageSize());
} }
@ -177,4 +178,13 @@ public class RmsController extends BaseController {
rmsService.exportEvaluation(dto.getParam(), response); rmsService.exportEvaluation(dto.getParam(), response);
} }
@Anonymous
@ApiOperation(value = "查询报告单详情",notes = "根据测评ID查询报告单详情")
@PostMapping(value="/queryReport")
public JsonResponse<RmsVo.ReportDetail> queryReport(@RequestBody @ApiParam @Valid RmsDto.QueryDetail dto){
log.info("生成报告单请求参数:{}", dto);
RmsVo.ReportDetail detail = rmsService.queryReport(dto);
return JsonResponse.ok(detail);
}
} }

185
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/StatisticsController.java

@ -4,9 +4,11 @@ import cn.hutool.core.util.StrUtil;
import com.ccsens.common.annotation.Anonymous; import com.ccsens.common.annotation.Anonymous;
import com.ccsens.common.constant.WebConstant; import com.ccsens.common.constant.WebConstant;
import com.ccsens.common.core.domain.JsonResponse; import com.ccsens.common.core.domain.JsonResponse;
import com.ccsens.common.utils.SecurityUtils;
import com.ccsens.system.domain.dto.StatisticsDto; import com.ccsens.system.domain.dto.StatisticsDto;
import com.ccsens.system.domain.vo.HomeDpVo; import com.ccsens.system.domain.vo.HomeDpVo;
import com.ccsens.system.service.StatisticsService; import com.ccsens.system.service.StatisticsService;
import com.ccsens.system.service.SysPowerService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -20,6 +22,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -36,245 +39,367 @@ public class StatisticsController {
@Resource @Resource
private StatisticsService statisticsService; private StatisticsService statisticsService;
@Resource
private SysPowerService sysPowerService;
@Anonymous @Anonymous
@ApiOperation("获取疾病统计信息") @ApiOperation("获取疾病统计信息")
@PostMapping("/nntotal") @PostMapping("/nntotal")
public JsonResponse<HomeDpVo.Zhsjgl> nntotal(@RequestBody StatisticsDto.Query dto) { public JsonResponse<HomeDpVo.Zhsjgl> nntotal(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
}
} }
}else {
deptIdList.add(dto.getDeptId());
} }
return JsonResponse.ok(statisticsService.nntotal(dto)); return JsonResponse.ok(statisticsService.nntotal(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("BMI") @ApiOperation("BMI")
@PostMapping("/nnbmihjxy") @PostMapping("/nnbmihjxy")
public JsonResponse<HomeDpVo.Bmi> nnbmihjxy(@RequestBody StatisticsDto.Query dto) { public JsonResponse<HomeDpVo.Bmi> nnbmihjxy(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
} }
} }
return JsonResponse.ok(statisticsService.nnbmihjxy(dto)); }else {
deptIdList.add(dto.getDeptId());
}
return JsonResponse.ok(statisticsService.nnbmihjxy(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("评估情况") @ApiOperation("评估情况")
@PostMapping("/nnlast") @PostMapping("/nnlast")
public JsonResponse<List<HomeDpVo.Pgqk>> nnlast(@RequestBody StatisticsDto.Query dto) { public JsonResponse<List<HomeDpVo.Pgqk>> nnlast(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
}
} }
}else {
deptIdList.add(dto.getDeptId());
} }
return JsonResponse.ok(statisticsService.nnlast(dto)); return JsonResponse.ok(statisticsService.nnlast(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("年龄") @ApiOperation("年龄")
@PostMapping("/nnage") @PostMapping("/nnage")
public JsonResponse<HomeDpVo.Nlfb> nnage(@RequestBody StatisticsDto.Query dto) { public JsonResponse<HomeDpVo.Nlfb> nnage(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
} }
} }
return JsonResponse.ok(statisticsService.nnage(dto)); }else {
deptIdList.add(dto.getDeptId());
}
return JsonResponse.ok(statisticsService.nnage(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("T值") @ApiOperation("T值")
@PostMapping("/nntgb") @PostMapping("/nntgb")
public JsonResponse<HomeDpVo.Tz> nntgb(@RequestBody StatisticsDto.Query dto) { public JsonResponse<HomeDpVo.Tz> nntgb(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
}
} }
}else {
deptIdList.add(dto.getDeptId());
} }
return JsonResponse.ok(statisticsService.nntgb(dto)); return JsonResponse.ok(statisticsService.nntgb(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("疾病排行") @ApiOperation("疾病排行")
@PostMapping("/nnicd") @PostMapping("/nnicd")
public JsonResponse<List<HomeDpVo.Jbph>> nnicd(@RequestBody StatisticsDto.Query dto) { public JsonResponse<List<HomeDpVo.Jbph>> nnicd(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
} }
} }
return JsonResponse.ok(statisticsService.nnicd(dto)); }else {
deptIdList.add(dto.getDeptId());
}
return JsonResponse.ok(statisticsService.nnicd(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("地图") @ApiOperation("地图")
@PostMapping("/nnmap") @PostMapping("/nnmap")
public JsonResponse<List<HomeDpVo.Dt>> nnmap(@RequestBody StatisticsDto.Query dto) { public JsonResponse<List<HomeDpVo.Dt>> nnmap(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
}
} }
}else {
deptIdList.add(dto.getDeptId());
} }
return JsonResponse.ok(statisticsService.nnmap(dto)); return JsonResponse.ok(statisticsService.nnmap(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("评估结果") @ApiOperation("评估结果")
@PostMapping("/nnscale") @PostMapping("/nnscale")
public JsonResponse<List<HomeDpVo.Pgjg>> nnscale(@RequestBody StatisticsDto.Query dto) { public JsonResponse<List<HomeDpVo.Pgjg>> nnscale(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
} }
} }
return JsonResponse.ok(statisticsService.nnscale(dto)); }else {
deptIdList.add(dto.getDeptId());
}
return JsonResponse.ok(statisticsService.nnscale(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("学历统计") @ApiOperation("学历统计")
@PostMapping("/qualificationStatistics") @PostMapping("/qualificationStatistics")
public JsonResponse<List<HomeDpVo.QualificationStatistics>> qualificationStatistics(@RequestBody StatisticsDto.Query dto) { public JsonResponse<List<HomeDpVo.QualificationStatistics>> qualificationStatistics(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
}
} }
}else {
deptIdList.add(dto.getDeptId());
} }
return JsonResponse.ok(statisticsService.qualificationStatistics(dto)); return JsonResponse.ok(statisticsService.qualificationStatistics(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("就诊数量统计") @ApiOperation("就诊数量统计")
@PostMapping("/jzStatistics") @PostMapping("/jzStatistics")
public JsonResponse<HomeDpVo.JzStatistics> jzStatistics(@RequestBody StatisticsDto.Query dto) { public JsonResponse<HomeDpVo.JzStatistics> jzStatistics(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
} }
} }
return JsonResponse.ok(statisticsService.jzStatistics(dto)); }else {
deptIdList.add(dto.getDeptId());
}
return JsonResponse.ok(statisticsService.jzStatistics(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("测评量表统计") @ApiOperation("测评量表统计")
@PostMapping("/scaleStatistics") @PostMapping("/scaleStatistics")
public JsonResponse<List<HomeDpVo.ScaleStatistics>> scaleStatistics(@RequestBody StatisticsDto.Query dto) { public JsonResponse<List<HomeDpVo.ScaleStatistics>> scaleStatistics(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
}
} }
}else {
deptIdList.add(dto.getDeptId());
} }
return JsonResponse.ok(statisticsService.scaleStatistics(dto)); return JsonResponse.ok(statisticsService.scaleStatistics(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("测评版本统计") @ApiOperation("测评版本统计")
@PostMapping("/versionStatistics") @PostMapping("/versionStatistics")
public JsonResponse<List<HomeDpVo.VersionStatistics>> versionStatistics(@RequestBody StatisticsDto.Query dto) { public JsonResponse<List<HomeDpVo.VersionStatistics>> versionStatistics(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
} }
} }
return JsonResponse.ok(statisticsService.versionStatistics(dto)); }else {
deptIdList.add(dto.getDeptId());
}
return JsonResponse.ok(statisticsService.versionStatistics(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("测评师测评统计") @ApiOperation("测评师测评统计")
@PostMapping("/userStatistics") @PostMapping("/userStatistics")
public JsonResponse<List<HomeDpVo.UserStatistics>> userStatistics(@RequestBody StatisticsDto.Query dto) { public JsonResponse<List<HomeDpVo.UserStatistics>> userStatistics(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
}
} }
}else {
deptIdList.add(dto.getDeptId());
} }
return JsonResponse.ok(statisticsService.userStatistics(dto)); return JsonResponse.ok(statisticsService.userStatistics(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("性别统计") @ApiOperation("性别统计")
@PostMapping("/sexStatistics") @PostMapping("/sexStatistics")
public JsonResponse<HomeDpVo.SexStatistics> sexStatistics(@RequestBody StatisticsDto.Query dto) { public JsonResponse<HomeDpVo.SexStatistics> sexStatistics(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
} }
} }
return JsonResponse.ok(statisticsService.sexStatistics(dto)); }else {
deptIdList.add(dto.getDeptId());
}
return JsonResponse.ok(statisticsService.sexStatistics(dto, deptIdList));
} }
@Anonymous @Anonymous
@ApiOperation("吸烟饮酒统计") @ApiOperation("吸烟饮酒统计")
@PostMapping("/xyYjStatistics") @PostMapping("/xyYjStatistics")
public JsonResponse<HomeDpVo.XyYjStatistics> xyYjStatistics(@RequestBody StatisticsDto.Query dto) { public JsonResponse<HomeDpVo.XyYjStatistics> xyYjStatistics(@RequestBody StatisticsDto.Query dto) {
List<Long> deptIdList = new ArrayList<>();
if (dto.getDeptId() == null) { if (dto.getDeptId() == null) {
try {
deptIdList.addAll(sysPowerService.queryPowerDept());
} catch (Exception e) {
log.info("获取当前登录用户部门错误");
// 获取请求携带的令牌 // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); deptIdList.add(Long.parseLong(deptId));
}
} }
}else {
deptIdList.add(dto.getDeptId());
} }
return JsonResponse.ok(statisticsService.xyYjStatistics(dto)); return JsonResponse.ok(statisticsService.xyYjStatistics(dto, deptIdList));
} }
} }

308
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/TjfxController.java

@ -1,154 +1,154 @@
package com.ccsens.admin.controller; //package com.ccsens.admin.controller;
//
import cn.hutool.core.util.StrUtil; //import cn.hutool.core.util.StrUtil;
import com.ccsens.common.annotation.Anonymous; //import com.ccsens.common.annotation.Anonymous;
import com.ccsens.common.constant.WebConstant; //import com.ccsens.common.constant.WebConstant;
import com.ccsens.common.core.domain.JsonResponse; //import com.ccsens.common.core.domain.JsonResponse;
import com.ccsens.system.domain.dto.StatisticsDto; //import com.ccsens.system.domain.dto.StatisticsDto;
import com.ccsens.system.domain.vo.HomeDpVo; //import com.ccsens.system.domain.vo.HomeDpVo;
import com.ccsens.system.service.StatisticsService; //import com.ccsens.system.service.StatisticsService;
import io.swagger.annotations.Api; //import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; //import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.springframework.web.HttpRequestHandler; //import org.springframework.web.HttpRequestHandler;
import org.springframework.web.bind.annotation.PostMapping; //import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; //import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; //import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder; //import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; //import org.springframework.web.context.request.ServletRequestAttributes;
//
import javax.annotation.Resource; //import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; //import javax.servlet.http.HttpServletRequest;
import java.util.List; //import java.util.List;
//
/** ///**
* @Author zzc // * @Author zzc
* @Package com.ccsens.admin.controller // * @Package com.ccsens.admin.controller
* @Date 2025/9/6 9:47 // * @Date 2025/9/6 9:47
* @description: // * @description:
*/ // */
@Slf4j //@Slf4j
@Api(tags = "统计分析") //@Api(tags = "统计分析")
@RestController //@RestController
@RequestMapping("/tjfx") //@RequestMapping("/tjfx")
public class TjfxController { //public class TjfxController {
//
@Resource // @Resource
private StatisticsService statisticsService; // private StatisticsService statisticsService;
//
//
@Anonymous // @Anonymous
@ApiOperation("获取疾病统计信息") // @ApiOperation("获取疾病统计信息")
@PostMapping("/nntotal") // @PostMapping("/nntotal")
public JsonResponse<HomeDpVo.Zhsjgl> nntotal(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<HomeDpVo.Zhsjgl> nntotal(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.nntotal(dto)); // return JsonResponse.ok(statisticsService.nntotal(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("BMI") // @ApiOperation("BMI")
@PostMapping("/nnbmihjxy") // @PostMapping("/nnbmihjxy")
public JsonResponse<HomeDpVo.Bmi> nnbmihjxy(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<HomeDpVo.Bmi> nnbmihjxy(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.nnbmihjxy(dto)); // return JsonResponse.ok(statisticsService.nnbmihjxy(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("评估情况") // @ApiOperation("评估情况")
@PostMapping("/nnlast") // @PostMapping("/nnlast")
public JsonResponse<List<HomeDpVo.Pgqk>> nnlast(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<List<HomeDpVo.Pgqk>> nnlast(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.nnlast(dto)); // return JsonResponse.ok(statisticsService.nnlast(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("年龄") // @ApiOperation("年龄")
@PostMapping("/nnage") // @PostMapping("/nnage")
public JsonResponse<HomeDpVo.Nlfb> nnage(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<HomeDpVo.Nlfb> nnage(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.nnage(dto)); // return JsonResponse.ok(statisticsService.nnage(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("T值") // @ApiOperation("T值")
@PostMapping("/nntgb") // @PostMapping("/nntgb")
public JsonResponse<HomeDpVo.Tz> nntgb(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<HomeDpVo.Tz> nntgb(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.nntgb(dto)); // return JsonResponse.ok(statisticsService.nntgb(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("疾病排行") // @ApiOperation("疾病排行")
@PostMapping("/nnicd") // @PostMapping("/nnicd")
public JsonResponse<List<HomeDpVo.Jbph>> nnicd(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<List<HomeDpVo.Jbph>> nnicd(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.nnicd(dto)); // return JsonResponse.ok(statisticsService.nnicd(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("地图") // @ApiOperation("地图")
@PostMapping("/nnmap") // @PostMapping("/nnmap")
public JsonResponse<List<HomeDpVo.Dt>> nnmap(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<List<HomeDpVo.Dt>> nnmap(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.nnmap(dto)); // return JsonResponse.ok(statisticsService.nnmap(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("评估结果") // @ApiOperation("评估结果")
@PostMapping("/nnscale") // @PostMapping("/nnscale")
public JsonResponse<List<HomeDpVo.Pgjg>> nnscale(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<List<HomeDpVo.Pgjg>> nnscale(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.nnscale(dto)); // return JsonResponse.ok(statisticsService.nnscale(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("学历统计") // @ApiOperation("学历统计")
@PostMapping("/qualificationStatistics") // @PostMapping("/qualificationStatistics")
public JsonResponse<List<HomeDpVo.QualificationStatistics>> qualificationStatistics(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<List<HomeDpVo.QualificationStatistics>> qualificationStatistics(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.qualificationStatistics(dto)); // return JsonResponse.ok(statisticsService.qualificationStatistics(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("就诊数量统计") // @ApiOperation("就诊数量统计")
@PostMapping("/jzStatistics") // @PostMapping("/jzStatistics")
public JsonResponse<HomeDpVo.JzStatistics> jzStatistics(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<HomeDpVo.JzStatistics> jzStatistics(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.jzStatistics(dto)); // return JsonResponse.ok(statisticsService.jzStatistics(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("测评量表统计") // @ApiOperation("测评量表统计")
@PostMapping("/scaleStatistics") // @PostMapping("/scaleStatistics")
public JsonResponse<List<HomeDpVo.ScaleStatistics>> scaleStatistics(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<List<HomeDpVo.ScaleStatistics>> scaleStatistics(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.scaleStatistics(dto)); // return JsonResponse.ok(statisticsService.scaleStatistics(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("测评版本统计") // @ApiOperation("测评版本统计")
@PostMapping("/versionStatistics") // @PostMapping("/versionStatistics")
public JsonResponse<List<HomeDpVo.VersionStatistics>> versionStatistics(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<List<HomeDpVo.VersionStatistics>> versionStatistics(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.versionStatistics(dto)); // return JsonResponse.ok(statisticsService.versionStatistics(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("测评师测评统计") // @ApiOperation("测评师测评统计")
@PostMapping("/userStatistics") // @PostMapping("/userStatistics")
public JsonResponse<List<HomeDpVo.UserStatistics>> userStatistics(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<List<HomeDpVo.UserStatistics>> userStatistics(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.userStatistics(dto)); // return JsonResponse.ok(statisticsService.userStatistics(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("性别统计统计") // @ApiOperation("性别统计统计")
@PostMapping("/sexStatistics") // @PostMapping("/sexStatistics")
public JsonResponse<HomeDpVo.SexStatistics> sexStatistics(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<HomeDpVo.SexStatistics> sexStatistics(@RequestBody StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.sexStatistics(dto)); // return JsonResponse.ok(statisticsService.sexStatistics(dto));
} // }
//
@Anonymous // @Anonymous
@ApiOperation("吸烟饮酒统计") // @ApiOperation("吸烟饮酒统计")
@PostMapping("/xyYjStatistics") // @PostMapping("/xyYjStatistics")
public JsonResponse<HomeDpVo.XyYjStatistics> xyYjStatistics(@RequestBody StatisticsDto.Query dto) { // public JsonResponse<HomeDpVo.XyYjStatistics> xyYjStatistics(@RequestBody StatisticsDto.Query dto) {
if (dto.getDeptId() == null) { // if (dto.getDeptId() == null) {
// 获取请求携带的令牌 // // 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes) // HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest(); // RequestContextHolder.getRequestAttributes()).getRequest();
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); // String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
if (StrUtil.isNotEmpty(deptId)) { // if (StrUtil.isNotEmpty(deptId)) {
dto.setDeptId(Long.parseLong(deptId)); // dto.setDeptId(Long.parseLong(deptId));
} // }
} // }
return JsonResponse.ok(statisticsService.xyYjStatistics(dto)); // return JsonResponse.ok(statisticsService.xyYjStatistics(dto));
} // }
} //}

16
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/PmsPatientDao.java

@ -6,6 +6,7 @@ import com.ccsens.system.domain.po.PmsPatient;
import com.ccsens.system.domain.vo.PmsPatientVo; import com.ccsens.system.domain.vo.PmsPatientVo;
import com.ccsens.system.persist.mapper.PmsPatientMapper; import com.ccsens.system.persist.mapper.PmsPatientMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;
import java.util.List; import java.util.List;
@ -13,24 +14,35 @@ public interface PmsPatientDao extends PmsPatientMapper {
List<PmsPatientVo.PatientList> queryPatientList(@Param("param") PmsPatientDto.QueryPatient param, List<PmsPatientVo.PatientList> queryPatientList(@Param("param") PmsPatientDto.QueryPatient param,
@Param("dataScope") String dataScope, @Param("dataScope") String dataScope,
@Param("userId") Long userId, @Param("userId") Long userId,
@Param("userName")String userName); @Param("userName") String userName,
@Param("deptIdList") List<Long> deptIdList);
PmsPatientVo.PatientInfo queryPatientEvaluationById(@Param("id") Long id); PmsPatientVo.PatientInfo queryPatientEvaluationById(@Param("id") Long id);
void deleteById(Long id); void deleteById(Long id);
void deletePatientAcpByPatientId(Long patientId); void deletePatientAcpByPatientId(Long patientId);
void deletePatientBodyByPatientId(Long patientId); void deletePatientBodyByPatientId(Long patientId);
void deletePatientFamilyIllnessByPatientId(Long patientId); void deletePatientFamilyIllnessByPatientId(Long patientId);
void deletePatientIllnessHistoryByPatientId(Long patientId); void deletePatientIllnessHistoryByPatientId(Long patientId);
void deletePatientParentIllnessByPatientId(Long patientId); void deletePatientParentIllnessByPatientId(Long patientId);
void deletePatientPersonalByPatientId(Long patientId); void deletePatientPersonalByPatientId(Long patientId);
void batchDeleteByIdCard(@Param("pmsPatientList") List<PmsPatient> pmsPatientList); void batchDeleteByIdCard(@Param("pmsPatientList") List<PmsPatient> pmsPatientList);
void batchInsert(@Param("pmsPatientList") List<PmsPatient> pmsPatientList); void batchInsert(@Param("pmsPatientList") List<PmsPatient> pmsPatientList);
void batchInsertTjbg(@Param("list") List<LdPatientRecord> list); void batchInsertTjbg(@Param("list") List<LdPatientRecord> list);
List<PmsPatientVo.QueryPatientJz> queryPatientJzList(@Param("param") PmsPatientDto.QueryPatientJz param, List<PmsPatientVo.QueryPatientJz> queryPatientJzList(@Param("param") PmsPatientDto.QueryPatientJz param,
@Param("dataScope") String dataScope, @Param("dataScope") String dataScope,
@Param("userId") Long userId, @Param("userId") Long userId,
@Param("userName")String userName); @Param("userName") String userName,
@Param("deptIdList") List<Long> deptIdList);
} }

2
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/RmsDao.java

@ -138,7 +138,7 @@ public interface RmsDao {
List<RmsVo.Report> queryReport(@Param("dto") RmsDto.ReportQuery dto, List<RmsVo.Report> queryReport(@Param("dto") RmsDto.ReportQuery dto,
@Param("userId") Long userId); @Param("userId") Long userId);
List<RmsVo.ReportScore> queryEmsScaleScore(@Param("evaId") Long evaId, List<RmsVo.ReportScore> queryEmsScaleScore(@Param("evaluationId") Long evaluationId,
@Param("scaleCodeList") List<String> scaleCodeList); @Param("scaleCodeList") List<String> scaleCodeList);
List<RmsVo.ReportPDF> viewReportPdfByVisitNo(@Param("visitNo")String visitNo); List<RmsVo.ReportPDF> viewReportPdfByVisitNo(@Param("visitNo")String visitNo);

8
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java

@ -18,7 +18,8 @@ public interface IPmsPatientService {
List<PmsPatientVo.PatientList> queryPatientList(PmsPatientDto.QueryPatient dto, List<PmsPatientVo.PatientList> queryPatientList(PmsPatientDto.QueryPatient dto,
String dataScope, String dataScope,
Long userId, Long userId,
String userName); String userName,
List<Long> deptIdList);
PmsPatientVo.PatientInfo queryPatientByIdCard(PmsPatientDto.QueryPatient param); PmsPatientVo.PatientInfo queryPatientByIdCard(PmsPatientDto.QueryPatient param);
@ -48,7 +49,7 @@ public interface IPmsPatientService {
Integer batchSaveTjbg(List<LdPatientRecord> pmsPatientList); Integer batchSaveTjbg(List<LdPatientRecord> pmsPatientList);
void exportPatient(HttpServletResponse response, PmsPatientDto.QueryPatient param, String dataScope, Long userId, String userName) throws IOException; void exportPatient(HttpServletResponse response, PmsPatientDto.QueryPatient param, String dataScope, Long userId, String userName, List<Long> deptIdList) throws IOException;
// //
// Long insertPatientIllnessHistory(AmsPatientReportDto.EditPatientIllnessHistory param,Long patientId); // Long insertPatientIllnessHistory(AmsPatientReportDto.EditPatientIllnessHistory param,Long patientId);
// //
@ -63,7 +64,8 @@ public interface IPmsPatientService {
List<PmsPatientVo.QueryPatientJz> queryPatientJzList(PmsPatientDto.QueryPatientJz param, List<PmsPatientVo.QueryPatientJz> queryPatientJzList(PmsPatientDto.QueryPatientJz param,
String dataScope, String dataScope,
Long userId, Long userId,
String userName); String userName,
List<Long> deptIdList);
void exportPatientJz(HttpServletResponse response, PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) throws IOException; void exportPatientJz(HttpServletResponse response, PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) throws IOException;

14
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java

@ -101,13 +101,13 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
private String ldTjbgDir; private String ldTjbgDir;
@Override @Override
public List<PmsPatientVo.PatientList> queryPatientList(PmsPatientDto.QueryPatient param, String dataScope, Long userId, String userName) { public List<PmsPatientVo.PatientList> queryPatientList(PmsPatientDto.QueryPatient param, String dataScope, Long userId, String userName,List<Long> deptIdList) {
//处理身份证信息 //处理身份证信息
if (StrUtil.isNotEmpty(param.getIdCard()) && IdcardUtil.isValidCard(param.getIdCard())) { if (StrUtil.isNotEmpty(param.getIdCard()) && IdcardUtil.isValidCard(param.getIdCard())) {
String hash = Md5Utils.hash(param.getIdCard().substring(2, 14)); String hash = Md5Utils.hash(param.getIdCard().substring(2, 14));
param.setIdCard(param.getIdCard().substring(0, 2) + hash + param.getIdCard().substring(14, 18)); param.setIdCard(param.getIdCard().substring(0, 2) + hash + param.getIdCard().substring(14, 18));
} }
return patientDao.queryPatientList(param, dataScope, SecurityUtils.isAdmin(userId) ? null : userId, userName); return patientDao.queryPatientList(param, dataScope, SecurityUtils.isAdmin(userId) ? null : userId, userName, deptIdList);
} }
@Override @Override
@ -2145,8 +2145,8 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
} }
@Override @Override
public void exportPatient(HttpServletResponse response, PmsPatientDto.QueryPatient param, String dataScope, Long userId, String userName) throws IOException { public void exportPatient(HttpServletResponse response, PmsPatientDto.QueryPatient param, String dataScope, Long userId, String userName,List<Long> deptIdList) throws IOException {
List<PmsPatientVo.PatientList> patientLists = queryPatientList(param, dataScope, userId, userName); List<PmsPatientVo.PatientList> patientLists = queryPatientList(param, dataScope, userId, userName, deptIdList);
if (CollUtil.isEmpty(patientLists)) { if (CollUtil.isEmpty(patientLists)) {
throw new BaseException("没有数据"); throw new BaseException("没有数据");
} }
@ -2217,8 +2217,8 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
} }
@Override @Override
public List<PmsPatientVo.QueryPatientJz> queryPatientJzList(PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) { public List<PmsPatientVo.QueryPatientJz> queryPatientJzList(PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName, List<Long> deptIdList) {
List<PmsPatientVo.QueryPatientJz> queryPatientJzs = patientDao.queryPatientJzList(param, dataScope, SecurityUtils.isAdmin(userId) ? null : userId, userName); List<PmsPatientVo.QueryPatientJz> queryPatientJzs = patientDao.queryPatientJzList(param, dataScope, SecurityUtils.isAdmin(userId) ? null : userId, userName, deptIdList);
if (CollUtil.isNotEmpty(queryPatientJzs)) { if (CollUtil.isNotEmpty(queryPatientJzs)) {
for (PmsPatientVo.QueryPatientJz queryPatientJz : queryPatientJzs) { for (PmsPatientVo.QueryPatientJz queryPatientJz : queryPatientJzs) {
//查询就诊 //查询就诊
@ -2273,7 +2273,7 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
@Override @Override
public void exportPatientJz(HttpServletResponse response, PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) throws IOException { public void exportPatientJz(HttpServletResponse response, PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) throws IOException {
List<PmsPatientVo.QueryPatientJz> queryPatientJzs = queryPatientJzList(param, dataScope, userId, userName); List<PmsPatientVo.QueryPatientJz> queryPatientJzs = queryPatientJzList(param, dataScope, userId, userName, null);
if (CollUtil.isEmpty(queryPatientJzs)) { if (CollUtil.isEmpty(queryPatientJzs)) {
throw new BaseException("没有数据"); throw new BaseException("没有数据");
} }

23
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/RmsServiceImpl.java

@ -2942,11 +2942,32 @@ public class RmsServiceImpl implements IRmsService {
} }
} }
//查询测评量表 //查询测评量表
List<RmsVo.ReportScore> scores = rmsDao.queryEmsScaleScore(dto.getEvaluationId(), CollectionUtil.newArrayList()); List<RmsVo.ReportScore> scores = rmsDao.queryEmsScaleScore(report.getEvaluationId(), CollectionUtil.newArrayList());
if (CollUtil.isNotEmpty(scores)) { if (CollUtil.isNotEmpty(scores)) {
//组装成父子级关系 //组装成父子级关系
scores = buildReportScoreTree(scores, 0L); scores = buildReportScoreTree(scores, 0L);
for (RmsVo.ReportScore score : scores) {
//查询量表的总分趋势信息
List<RmsVo.ScoreTrend> scoreTrend = rmsDao.getScoreTrend(reportPatient.getPatientId(), score.getCode(), time.getMinTime(), time.getMaxTime());
//折线图上只显示近5条记录
if (CollectionUtil.isNotEmpty(scoreTrend) && scoreTrend.size() > 5) {
scoreTrend = scoreTrend.subList(scoreTrend.size() - 5, scoreTrend.size());
}
score.setScoreTrend(scoreTrend);
//给moca添加雷达图信息
if (GenConstants.Ht.Report.MOCA.equals(score.getCode())) {
List<RmsVo.EvaluationScoreDistribution> scoreDistributions = rmsDao.getScoreDistributions(reportPatient.getPatientId());
if (CollUtil.isNotEmpty(scoreDistributions)) {
//处理认知域
List<RmsVo.EvaluationScoreDistribution> distributions = disposeDistribution(scoreDistributions);
//根据日期倒序排序
distributions.sort(Comparator.comparing(RmsVo.EvaluationScoreDistribution::getDay).reversed());
score.setScoreDistributions(distributions);
}
}
} }
}
detail.setPatient(reportPatient); detail.setPatient(reportPatient);
detail.setScores(scores); detail.setScores(scores);
return detail; return detail;

250
ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml

@ -77,47 +77,83 @@
</delete> </delete>
<select id="queryPatientList" resultType="com.ccsens.system.domain.vo.PmsPatientVo$PatientList"> <select id="queryPatientList" resultType="com.ccsens.system.domain.vo.PmsPatientVo$PatientList">
SELECT SELECT DISTINCT
DISTINCT a.patientId,
pp.id as patientId, a.patientName,
pp.`name` as patientName, a.sex,
a.idcard,
a.phone, -- 核心修复:将 a.mobile 改为 a.phone(与内层别名一致)
a.educationalStatus,
a.independentLivingSkills,
a.birthNumber,
a.dwellingState,
a.lastEvaluationTime,
a.lastTesterName, -- 修正之前的笔误(原 astTesterName)
a.evaluationCount,
a.createBy,
a.createTime,
a.hospitalName,
a.birthday,
a.career,
a.maritalStatus,
a.domicile,
a.nation,
a.nativePlace,
a.contactName,
a.contactRelation,
a.contactMobile,
a.address,
a.belief,
a.hobby,
a.aboBloodType,
a.rhBloodType
FROM
(
SELECT DISTINCT
pp.id AS patientId,
pp.`name` AS patientName,
pp.sex, pp.sex,
-- pp.age,
pp.idcard, pp.idcard,
pp.mobile as phone, pp.mobile AS phone, -- 内层别名是 phone
pp.educational_status as educationalStatus, pp.educational_status AS educationalStatus,
pp.independent_living_skills as independentLivingSkills, pp.independent_living_skills AS independentLivingSkills,
pp.birth_number as birthNumber, pp.birth_number AS birthNumber,
pp.dwelling_state as dwellingState, pp.dwelling_state AS dwellingState,
MAX(ee.create_time) as lastEvaluationTime, MAX(ee.create_time) AS lastEvaluationTime,
uu.nick_name as lastTesterName, uu.nick_name AS lastTesterName,
COUNT(ee.id) as evaluationCount, COUNT(ee.id) AS evaluationCount,
(select nick_name from ums_user where user_name = pp.create_by and del_flag = 0) as createBy, (SELECT nick_name FROM ums_user WHERE user_name = pp.create_by AND del_flag = 0) AS createBy,
pp.create_time as createTime, pp.create_time AS createTime,
ud.dept_name as hospitalName, ud.dept_name AS hospitalName,
pp.birthday, pp.birthday,
pp.career, pp.career,
pp.marital_status as maritalStatus, pp.marital_status AS maritalStatus,
pp.domicile, pp.domicile,
pp.nation, pp.nation,
pp.native_place as nativePlace, pp.native_place AS nativePlace,
pp.contact_name as contactName, pp.contact_name AS contactName,
pp.contact_relation as contactRelation, pp.contact_relation AS contactRelation,
pp.contact_mobile as contactMobile, pp.contact_mobile AS contactMobile,
pp.address, pp.address,
pp.belief, pp.belief,
pp.hobby, pp.hobby,
pp.abo_blood_type as aboBloodType, pp.abo_blood_type AS aboBloodType,
pp.rh_blood_type as rhBloodType pp.rh_blood_type AS rhBloodType
FROM FROM
pms_patient pp pms_patient pp
LEFT JOIN ems_evaluation ee ON pp.id = ee.patient_id and ee.del_flag = 0 LEFT JOIN ems_evaluation ee ON pp.id = ee.patient_id AND ee.del_flag = 0
LEFT JOIN ums_user uu ON ee.tester_id = uu.user_id LEFT JOIN ums_user uu ON ee.tester_id = uu.user_id
LEFT JOIN ums_dept ud ON pp.hospital_id = ud.dept_id LEFT JOIN ums_dept ud ON pp.hospital_id = ud.dept_id
left join pms_patient_body pb on pp.id = pb.patient_id
LEFT JOIN ums_user uu1 ON pp.create_by = uu1.user_name
WHERE WHERE
pp.del_flag = 0 pp.del_flag = 0
<if test="deptIdList != null and deptIdList.size()>0">
<if test="deptIdList != null and deptIdList.size()>0">
and pp.hospital_id IN
<foreach item="item" collection="deptIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
<if test="param.searchValue != null and param.searchValue != ''"> <if test="param.searchValue != null and param.searchValue != ''">
and ( and (
pp.name like CONCAT('%',#{param.searchValue},'%') pp.name like CONCAT('%',#{param.searchValue},'%')
@ -171,43 +207,112 @@
</when> </when>
</choose> </choose>
</if> </if>
<if test="userId != null"> GROUP BY
<!-- 权限 总测评师和测评师都是本部门及以下 --> pp.id
UNION ALL
SELECT DISTINCT
pp.id AS patientId,
pp.`name` AS patientName,
pp.sex,
pp.idcard,
pp.mobile AS phone, -- 内层别名统一为 phone
pp.educational_status AS educationalStatus,
pp.independent_living_skills AS independentLivingSkills,
pp.birth_number AS birthNumber,
pp.dwelling_state AS dwellingState,
MAX(ee.create_time) AS lastEvaluationTime,
uu.nick_name AS lastTesterName,
COUNT(ee.id) AS evaluationCount,
(SELECT nick_name FROM ums_user WHERE user_name = pp.create_by AND del_flag = 0) AS createBy,
pp.create_time AS createTime,
ud.dept_name AS hospitalName,
pp.birthday,
pp.career,
pp.marital_status AS maritalStatus,
pp.domicile,
pp.nation,
pp.native_place AS nativePlace,
pp.contact_name AS contactName,
pp.contact_relation AS contactRelation,
pp.contact_mobile AS contactMobile,
pp.address,
pp.belief,
pp.hobby,
pp.abo_blood_type AS aboBloodType,
pp.rh_blood_type AS rhBloodType
FROM
pms_patient pp
LEFT JOIN pms_patient_body pb ON pb.patient_id = pp.id AND pb.del_flag = 0
LEFT JOIN ems_evaluation ee ON pp.id = ee.patient_id AND ee.del_flag = 0
LEFT JOIN ums_user uu ON ee.tester_id = uu.user_id
LEFT JOIN ums_dept ud ON pp.hospital_id = ud.dept_id
WHERE
pp.del_flag = 0
<if test="param.searchValue != null and param.searchValue != ''">
and ( and (
uu.dept_id IN ( pp.name like CONCAT('%',#{param.searchValue},'%')
SELECT d.dept_id FROM ums_user u LEFT JOIN ums_dept d on (d.dept_id = u.dept_id or
FIND_IN_SET(u.dept_id,ancestors))
WHERE user_id = #{userId}
)
or or
uu1.dept_id IN ( pp.name_initial like CONCAT('%',LOWER(#{param.searchValue}),'%')
SELECT d.dept_id FROM ums_user u LEFT JOIN ums_dept d on (d.dept_id = u.dept_id or or
FIND_IN_SET(u.dept_id,ancestors)) pp.name_full like CONCAT('%',LOWER(#{param.searchValue}),'%')
WHERE user_id = #{userId} or
) pp.idcard like CONCAT('%',#{param.searchValue},'%')
) )
</if> </if>
<!-- <choose>--> <if test="param.beginTime != null and param.beginTime != ''"><!-- 开始时间检索 -->
<!-- <when test="dataScope == 5">--> and date_format(pp.create_time,'%y%m%d') &gt;= date_format(#{param.beginTime},'%y%m%d')
<!-- and (pp.create_by = #{userName} or ae.tester_id = #{userId})--> </if>
<!-- </when>--> <if test="param.endTime != null and param.endTime != ''"><!-- 结束时间检索 -->
<!-- &lt;!&ndash; 当前医院不区分多级,所以本部门及以下权限和本部门数据权限使用相同的查询语句 &ndash;&gt;--> and date_format(pp.create_time,'%y%m%d') &lt;= date_format(#{param.endTime},'%y%m%d')
<!-- <when test="dataScope == 3 or dataScope == 4">--> </if>
<!-- and uu.dept_id = (SELECT dept_id FROM ums_user WHERE user_id = #{userId})--> <if test="param.hospitalId != null">
<!-- </when>--> and pp.hospital_id = #{param.hospitalId}
<!-- <when test="dataScope == 2">--> </if>
<!-- and uu.dept_id in (--> <if test="param.sex != null">
<!-- SELECT pud.dept_id FROM ums_user u--> and pp.sex = #{param.sex}
<!-- LEFT JOIN ums_dept ud ON ud.dept_id = u.dept_id--> </if>
<!-- LEFT JOIN ums_dept pud ON pud.dept_id = ud.parent_id--> <if test="param.deptId != null">
<!-- WHERE u.user_id = #{userId}--> and pp.hospital_id = #{param.deptId}
<!-- UNION ALL--> </if>
<!-- SELECT u.dept_id FROM ums_user u WHERE u.user_id = #{userId}--> <if test="param.educationalStatus != null">
<!-- )--> and pp.educational_status = #{param.educationalStatus}
<!-- </when>--> </if>
<!-- </choose>--> <if test="param.ageStatus != null">
GROUP BY pp.id <choose>
order by pp.create_time desc <when test="param.ageStatus == 0">
and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(pp.birthday, '%m%d'))) &lt; 60
</when>
<when test="param.ageStatus == 1">
and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 60 AND 69
</when>
<when test="param.ageStatus == 2">
and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 70 AND 79
</when>
<when test="param.ageStatus == 3">
and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 80 AND 89
</when>
<when test="param.ageStatus == 4">
and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(pp.birthday, '%m%d'))) >= 90
</when>
</choose>
</if>
<if test="deptIdList != null and deptIdList.size()>0">
<if test="deptIdList != null and deptIdList.size()>0">
and pp.hospital_id IN
<foreach item="item" collection="deptIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
GROUP BY
pp.id
) a
ORDER BY a.createTime DESC
</select> </select>
<select id="queryPatientByIdCard" resultType="com.ccsens.system.domain.vo.PmsPatientVo$PatientInfo"> <select id="queryPatientByIdCard" resultType="com.ccsens.system.domain.vo.PmsPatientVo$PatientInfo">
SELECT SELECT
@ -297,7 +402,6 @@
p.hospital_id as hospitalId, p.hospital_id as hospitalId,
p.hospital_number as hospitalNumber, p.hospital_number as hospitalNumber,
p.patient_number as patientNumber, p.patient_number as patientNumber,
p.native_place as nativePlace,
p.nation, p.nation,
p.phone, p.phone,
p.mobile, p.mobile,
@ -312,12 +416,14 @@
p.career, p.career,
p.address, p.address,
p.native_place as nativePlace, p.native_place as nativePlace,
p.contact_name as contactName p.contact_name as contactName,
MAX(ee.create_time) AS lastEvaluationTime,
COUNT(ee.id) AS evaluationCount
from from
pms_patient_body b pms_patient_body b
left join pms_patient p on b.patient_id = p.id left join pms_patient p on b.patient_id = p.id
left join ums_user uu on b.create_by = uu.user_name left join ums_user uu on b.create_by = uu.user_name
left join ems_evaluation ee on b.patient_id = ee.patient_id
<where> <where>
b.del_flag = 0 and p.del_flag = 0 b.del_flag = 0 and p.del_flag = 0
<if test="param.visitType != null"> <if test="param.visitType != null">
@ -335,18 +441,22 @@
<if test="param.diagnosisCode != null and param.diagnosisCode != ''"> <if test="param.diagnosisCode != null and param.diagnosisCode != ''">
and b.diagnosis_code like concat('%',#{param.diagnosisCode},'%') and b.diagnosis_code like concat('%',#{param.diagnosisCode},'%')
</if> </if>
<if test="userId != null"> <if test="deptIdList != null and deptIdList.size()>0">
<!-- 权限 总测评师和测评师都是本部门及以下 --> <!-- 权限 总测评师和测评师都是本部门及以下 -->
and uu.dept_id IN ( and (uu.dept_id IN
SELECT d.dept_id FROM ums_user u LEFT JOIN ums_dept d on (d.dept_id = u.dept_id or <foreach item="item" collection="deptIdList" open="(" separator="," close=")">
FIND_IN_SET(u.dept_id,ancestors)) #{item}
WHERE user_id = #{userId} </foreach>
or
b.dept_id IN
<foreach item="item" collection="deptIdList" open="(" separator="," close=")">
#{item}
</foreach>
) )
</if> </if>
</where> </where>
group by b.id
order by b.id desc order by b.id desc
</select> </select>
</mapper> </mapper>

66
ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/RmsDao.xml

@ -1010,7 +1010,8 @@ d.dept_name as hospitalName
<select id="queryReportListCopyClient" resultType="com.ccsens.system.domain.vo.RmsVo$QueryReportHistoryPatient"> <select id="queryReportListCopyClient" resultType="com.ccsens.system.domain.vo.RmsVo$QueryReportHistoryPatient">
SELECT SELECT
rr.id as evaluationId, rr.id as reportId,
ee.id as evaluationId,
pp.name, pp.name,
pp.sex, pp.sex,
pb.outpatient_no as outpatientNo, pb.outpatient_no as outpatientNo,
@ -1024,8 +1025,8 @@ d.dept_name as hospitalName
FROM FROM
rms_report rr rms_report rr
Left Join pms_patient_body pb on rr.visit_no = pb.outpatient_no and pb.del_flag = 0 Left Join pms_patient_body pb on rr.visit_no = pb.outpatient_no and pb.del_flag = 0
LEFT JOIN pms_patient pp on pb.patient_id = pp.id
left join ems_evaluation ee on rr.evaluation_id = ee.id left join ems_evaluation ee on rr.evaluation_id = ee.id
LEFT JOIN pms_patient pp on ee.patient_id = pp.id
LEFT JOIN hms_version hv on ee.version = hv.id LEFT JOIN hms_version hv on ee.version = hv.id
LEFT JOIN ums_user uu on ee.tester_id = uu.user_id LEFT JOIN ums_user uu on ee.tester_id = uu.user_id
LEFT JOIN ems_evaluation_scale_relevance e on e.evaluation_id = ee.id and e.del_flag = 0 LEFT JOIN ems_evaluation_scale_relevance e on e.evaluation_id = ee.id and e.del_flag = 0
@ -1500,46 +1501,59 @@ d.dept_name as hospitalName
<select id="queryEmsScaleScore" resultType="com.ccsens.system.domain.vo.RmsVo$ReportScore"> <select id="queryEmsScaleScore" resultType="com.ccsens.system.domain.vo.RmsVo$ReportScore">
WITH RECURSIVE cognitive_relevance_tree AS ( WITH RECURSIVE cognitive_relevance_tree AS (
SELECT SELECT
id AS node_id, r.id AS scale_id,
evaluation_id, r.evaluation_id,
scale_code AS scale_code, r.scale_code AS scale_code,
'' AS second_level_cognitive_code, q.name as name,
cognitive_code AS current_cognitive_code, q.description,
score AS level_score, r.score AS level_score,
total_score AS level_total_score, q.total_score AS total_score,
parent_id, r.parent_id,
sort, r.sort,
1 AS level 1 AS level
FROM ems_evaluation_scale_cognitive_relevance FROM ems_evaluation_scale_cognitive_relevance r
WHERE parent_id IS NULL LEFT JOIN qms_scale q on r.scale_code = q.code
AND del_flag = 0 WHERE r.parent_id = 0 and r.del_flag = 0 and r.evaluation_id = #{evaluationId}
<if test="scaleCodeList != null and scaleCodeList.size()>0">
and scale_code in (
<foreach item="item" collection="scaleCodeList" index="index" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
UNION ALL UNION ALL
SELECT SELECT
child.id AS node_id, child.id AS scale_id,
child.evaluation_id, child.evaluation_id,
parent.scale_code, child.cognitive_code AS scale_code,
child.cognitive_code AS second_level_cognitive_code, c.name,
child.cognitive_code AS current_cognitive_code, c.description,
child.score AS level_score, child.score AS level_score,
child.total_score AS level_total_score, child.total_score AS total_score,
child.parent_id, child.parent_id,
child.sort, child.sort,
2 AS level 2 AS level
FROM ems_evaluation_scale_cognitive_relevance child FROM ems_evaluation_scale_cognitive_relevance child
INNER JOIN cognitive_relevance_tree parent INNER JOIN cognitive_relevance_tree parent
ON child.parent_id = parent.node_id ON child.parent_id = parent.scale_id
left join qms_cognitive_domain c on c.code = child.cognitive_code and c.parent_code = parent.scale_code
WHERE child.del_flag = 0 WHERE child.del_flag = 0
) )
SELECT SELECT
rt.scale_id as scaleId,
rt.parent_id as parentId,
rt.name AS name,
rt.evaluation_id AS evaluationId, rt.evaluation_id AS evaluationId,
rt.scale_code AS scaleCode, rt.scale_code AS code,
rt.second_level_cognitive_code AS cognitiveCode,
rt.level_score AS score, rt.level_score AS score,
IF(rt.level_total_score = null , q.total_score, rt.level_total_score) AS totalScale, rt.sort as sort,
rt.sort rt.total_score as totalScore,
r.combo_id as comboId
FROM cognitive_relevance_tree rt FROM cognitive_relevance_tree rt
LEFT JOIN qms_scale q on rt.scale_code = q.code left join ems_evaluation_scale_relevance r on r.evaluation_id = rt.evaluation_id and r.scale_code = rt.scale_code
ORDER BY evaluation_id, level, sort group by rt.scale_code
ORDER BY rt.evaluation_id, rt.level, rt.sort
</select> </select>
<select id="viewReportPdfByVisitNo" resultType="com.ccsens.system.domain.vo.RmsVo$ReportPDF"> <select id="viewReportPdfByVisitNo" resultType="com.ccsens.system.domain.vo.RmsVo$ReportPDF">

19
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/PmsController.java

@ -11,6 +11,7 @@ import com.ccsens.client.service.ILtHisConnectionService;
import com.ccsens.client.service.IPmsPatientService; import com.ccsens.client.service.IPmsPatientService;
import com.ccsens.common.annotation.Anonymous; import com.ccsens.common.annotation.Anonymous;
import com.ccsens.common.constant.ErrorConstant; import com.ccsens.common.constant.ErrorConstant;
import com.ccsens.common.constant.WebConstant;
import com.ccsens.common.core.controller.BaseController; import com.ccsens.common.core.controller.BaseController;
import com.ccsens.common.core.domain.BaseDto; import com.ccsens.common.core.domain.BaseDto;
import com.ccsens.common.core.domain.JsonResponse; import com.ccsens.common.core.domain.JsonResponse;
@ -23,6 +24,7 @@ import com.ccsens.system.domain.dto.PmsPatientDto;
import com.ccsens.system.domain.po.HmsHospitalConfig; import com.ccsens.system.domain.po.HmsHospitalConfig;
import com.ccsens.system.domain.vo.LdPatientVo; import com.ccsens.system.domain.vo.LdPatientVo;
import com.ccsens.system.domain.vo.PmsPatientVo; import com.ccsens.system.domain.vo.PmsPatientVo;
import com.ccsens.system.service.SysPowerService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -33,8 +35,11 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function; import java.util.function.Function;
@ -54,25 +59,15 @@ public class PmsController extends BaseController {
private IPmsPatientService patientService; private IPmsPatientService patientService;
@Resource @Resource
private IHmsService hmsService; private IHmsService hmsService;
// @Resource
// private ILtHisConnectionService ltHisConnectionService;
private final String hospitalConfKey = "patient_encryption"; private final String hospitalConfKey = "patient_encryption";
@Resource
private SysPowerService sysPowerService;
@ApiOperation("获取患者信息列表") @ApiOperation("获取患者信息列表")
@PostMapping("/queryList") @PostMapping("/queryList")
public JsonResponse<PageInfo<PmsPatientVo.PatientList>> queryPatientList(@RequestBody @Validated BaseDto<PmsPatientDto.QueryPatient> dto) { public JsonResponse<PageInfo<PmsPatientVo.PatientList>> queryPatientList(@RequestBody @Validated BaseDto<PmsPatientDto.QueryPatient> dto) {
//获取用户的权限
LoginUser loginUser = SecurityUtils.getLoginUser();
//当前默认一个用户只有一个角色
String dataScope = "5";
if (CollUtil.isNotEmpty(loginUser.getUser().getRoles())) {
dataScope = loginUser.getUser().getRoles().get(0).getDataScope();
}
if (IdcardUtil.isValidCard(dto.getParam().getSearchValue())) {
dataScope = "2";
}
startPageOvertop(dto); startPageOvertop(dto);
List<PmsPatientVo.PatientList> serverList = patientService.queryPatientList(dto.getParam(), dataScope, loginUser.getUserId(), loginUser.getUsername()); List<PmsPatientVo.PatientList> serverList = patientService.queryPatientList(dto.getParam(), dataScope, loginUser.getUserId(), loginUser.getUsername());

3
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/PmsPatientDao.java

@ -13,7 +13,8 @@ public interface PmsPatientDao extends PmsPatientMapper {
@Param("userId") Long userId, @Param("userId") Long userId,
@Param("userName")String userName, @Param("userName")String userName,
@Param("idcard")String idcard, @Param("idcard")String idcard,
@Param("idcardEncrypt")String idcardEncrypt); @Param("idcardEncrypt")String idcardEncrypt,
@Param("deptIdList")List<Long> deptIdList);
PmsPatientVo.PatientInfo queryPatientEvaluationById(@Param("id")Long id); PmsPatientVo.PatientInfo queryPatientEvaluationById(@Param("id")Long id);

3
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IPmsPatientService.java

@ -12,7 +12,8 @@ public interface IPmsPatientService {
List<PmsPatientVo.PatientList> queryPatientList(PmsPatientDto.QueryPatient dto, List<PmsPatientVo.PatientList> queryPatientList(PmsPatientDto.QueryPatient dto,
String dataScope, String dataScope,
Long userId, Long userId,
String userName); String userName,
List<Long> deptIdList);
PmsPatientVo.PatientInfo queryPatientByIdCard(PmsPatientDto.QueryPatient param); PmsPatientVo.PatientInfo queryPatientByIdCard(PmsPatientDto.QueryPatient param);

4
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/PmsPatientServiceImpl.java

@ -64,7 +64,7 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
private PmsPatientDiagnosisMapper pmsPatientDiagnosisMapper; private PmsPatientDiagnosisMapper pmsPatientDiagnosisMapper;
@Override @Override
public List<PmsPatientVo.PatientList> queryPatientList(PmsPatientDto.QueryPatient param, String dataScope, Long userId, String userName) { public List<PmsPatientVo.PatientList> queryPatientList(PmsPatientDto.QueryPatient param, String dataScope, Long userId, String userName,List<Long> deptIdList) {
if (StrUtil.isNotEmpty(param.getSearchValue()) if (StrUtil.isNotEmpty(param.getSearchValue())
&& IdcardUtil.isValidCard(param.getSearchValue()) && IdcardUtil.isValidCard(param.getSearchValue())
&& StrUtil.isEmpty(param.getIdCard())) { && StrUtil.isEmpty(param.getIdCard())) {
@ -77,7 +77,7 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
String hash = Md5Utils.hash(param.getIdCard().substring(2, 14)); String hash = Md5Utils.hash(param.getIdCard().substring(2, 14));
param.setIdCard(param.getIdCard().substring(0, 2) + hash + param.getIdCard().substring(14, 18)); param.setIdCard(param.getIdCard().substring(0, 2) + hash + param.getIdCard().substring(14, 18));
} }
return patientDao.queryPatientList(param.getSearchValue(), dataScope, userId, userName, param.getIdCard(), param.getIdcardEncrypt()); return patientDao.queryPatientList(param.getSearchValue(), dataScope, userId, userName, param.getIdCard(), param.getIdcardEncrypt(), deptIdList);
} }
@Override @Override

205
ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/PmsPatientDao.xml

@ -23,35 +23,85 @@
update pms_patient_personal set del_flag = 1 where patient_id = #{patientId}; update pms_patient_personal set del_flag = 1 where patient_id = #{patientId};
</delete> </delete>
<select id="queryPatientList" resultType="com.ccsens.system.domain.vo.PmsPatientVo$PatientList"> <select id="queryPatientList" resultType="com.ccsens.system.domain.vo.PmsPatientVo$PatientList">
SELECT SELECT DISTINCT
DISTINCT a.patientId,
pp.id as patientId, a.patientName,
pp.`name` as patientName, a.sex,
a.idcard,
a.phone, -- 核心修复:将 a.mobile 改为 a.phone(与内层别名一致)
a.educationalStatus,
a.independentLivingSkills,
a.birthNumber,
a.dwellingState,
a.lastEvaluationTime,
a.lastTesterName, -- 修正之前的笔误(原 astTesterName)
a.evaluationCount,
a.createBy,
a.createTime,
a.hospitalName,
a.birthday,
a.career,
a.maritalStatus,
a.domicile,
a.nation,
a.nativePlace,
a.contactName,
a.contactRelation,
a.contactMobile,
a.address,
a.belief,
a.hobby,
a.aboBloodType,
a.rhBloodType
FROM
(
SELECT DISTINCT
pp.id AS patientId,
pp.`name` AS patientName,
pp.sex, pp.sex,
pp.idcard, pp.idcard,
pp.mobile as phone, pp.mobile AS phone, -- 内层别名是 phone
pp.birth_year as birthYear, pp.educational_status AS educationalStatus,
pp.independent_living_skills AS independentLivingSkills,
pp.birth_number AS birthNumber,
pp.dwelling_state AS dwellingState,
MAX(ee.create_time) AS lastEvaluationTime,
uu.nick_name AS lastTesterName,
COUNT(ee.id) AS evaluationCount,
(SELECT nick_name FROM ums_user WHERE user_name = pp.create_by AND del_flag = 0) AS createBy,
pp.create_time AS createTime,
ud.dept_name AS hospitalName,
pp.birthday, pp.birthday,
pp.career,
pp.marital_status AS maritalStatus,
pp.domicile,
pp.nation,
pp.native_place AS nativePlace,
pp.contact_name AS contactName,
pp.contact_relation AS contactRelation,
pp.contact_mobile AS contactMobile,
pp.address,
pp.belief, pp.belief,
pp.hobby, pp.hobby,
pp.contact_name as contactName, pp.abo_blood_type AS aboBloodType,
pp.contact_relation as contactRelation, pp.rh_blood_type AS rhBloodType
pp.contact_mobile as contactMobile,
pp.contact_other as contactOther,
pp.id_card_type as idCardType,
pp.id_card_type_other as idCardTypeOther,
pp.abo_blood_type as aboBloodType,
pp.rh_blood_type as rhBloodType,
COUNT(ae.id) as evaluationCount,
pp.create_time as createTime
FROM FROM
pms_patient pp pms_patient pp
LEFT JOIN ems_evaluation ae on pp.id = ae.patient_id LEFT JOIN ems_evaluation ee ON pp.id = ee.patient_id AND ee.del_flag = 0
left join pms_patient_body pb on pp.id = pb.patient_id LEFT JOIN ums_user uu ON ee.tester_id = uu.user_id
left join ums_dept ud on pb.department = ud.dept_name LEFT JOIN ums_dept ud ON pp.hospital_id = ud.dept_id
WHERE WHERE
pp.del_flag = 0 pp.del_flag = 0
<if test="deptIdList != null and deptIdList.size()>0">
<if test="deptIdList != null and deptIdList.size()>0">
and pp.hospital_id IN
<foreach item="item" collection="deptIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
<if test="searchValue != null and searchValue != ''"> <if test="searchValue != null and searchValue != ''">
and ( and (
pp.name like CONCAT('%',#{searchValue},'%') pp.name like CONCAT('%',#{searchValue},'%')
@ -62,64 +112,85 @@
or or
pp.idcard like CONCAT('%',#{searchValue},'%') pp.idcard like CONCAT('%',#{searchValue},'%')
or or
pp.id = #{searchValue}
or
pb.outpatient_no like CONCAT('%',#{searchValue},'%') pb.outpatient_no like CONCAT('%',#{searchValue},'%')
) )
</if> </if>
<if test="idcard != null and idcard != ''"> <if test="idcard != null and idcard != ''">
and (pp.idcard = #{idcard} or pp.idcard = #{idcardEncrypt}) and (pp.idcard = #{idcard} or pp.idcard = #{idcardEncrypt})
</if> </if>
<!-- &lt;!&ndash; 权限 总测评师和测评师都是本部门及以下 &ndash;&gt;--> GROUP BY
<!-- and uu.dept_id IN ( SELECT d.dept_id FROM ums_user u LEFT JOIN ums_dept d on (d.dept_id = u.dept_id or FIND_IN_SET(u.dept_id,ancestors))--> pp.id
<!-- WHERE user_id = #{userId}--> UNION ALL
<!-- )--> SELECT DISTINCT
<!--电力医院查看自己关联的部门信息--> pp.id AS patientId,
AND ( pp.`name` AS patientName,
EXISTS ( pp.sex,
SELECT 1 FROM ums_user WHERE user_id = #{userId} AND data_power = 'ALL' pp.idcard,
) pp.mobile AS phone, -- 内层别名统一为 phone
OR pp.educational_status AS educationalStatus,
( pp.independent_living_skills AS independentLivingSkills,
FIND_IN_SET(ud.dept_code, pp.birth_number AS birthNumber,
(SELECT pp.dwelling_state AS dwellingState,
CONCAT( d.dept_code, ',', u.data_power ) MAX(ee.create_time) AS lastEvaluationTime,
uu.nick_name AS lastTesterName,
COUNT(ee.id) AS evaluationCount,
(SELECT nick_name FROM ums_user WHERE user_name = pp.create_by AND del_flag = 0) AS createBy,
pp.create_time AS createTime,
ud.dept_name AS hospitalName,
pp.birthday,
pp.career,
pp.marital_status AS maritalStatus,
pp.domicile,
pp.nation,
pp.native_place AS nativePlace,
pp.contact_name AS contactName,
pp.contact_relation AS contactRelation,
pp.contact_mobile AS contactMobile,
pp.address,
pp.belief,
pp.hobby,
pp.abo_blood_type AS aboBloodType,
pp.rh_blood_type AS rhBloodType
FROM FROM
ums_user u LEFT JOIN ums_dept d on u.dept_id = d.dept_id and d.del_flag = 0 pms_patient pp
LEFT JOIN pms_patient_body pb ON pb.patient_id = pp.id AND pb.del_flag = 0
LEFT JOIN ems_evaluation ee ON pp.id = ee.patient_id AND ee.del_flag = 0
LEFT JOIN ums_user uu ON ee.tester_id = uu.user_id
LEFT JOIN ums_dept ud ON pp.hospital_id = ud.dept_id
WHERE WHERE
u.user_id = #{userId}) pp.del_flag = 0
) <if test="searchValue != null and searchValue != ''">
) and (
pp.name like CONCAT('%',#{searchValue},'%')
or
pp.name_initial like CONCAT('%',LOWER(#{searchValue}),'%')
or
pp.name_full like CONCAT('%',LOWER(#{searchValue}),'%')
or
pp.idcard like CONCAT('%',#{searchValue},'%')
or
pb.outpatient_no like CONCAT('%',#{searchValue},'%')
) )
</if>
<!-- <choose>--> <if test="idcard != null and idcard != ''">
<!-- &lt;!&ndash; 测评师查看自己的患者 &ndash;&gt;--> and (pp.idcard = #{idcard} or pp.idcard = #{idcardEncrypt})
<!-- <when test="dataScope == 5">--> </if>
<!-- and (pp.create_by = #{userName} or ae.tester_id = #{userId})--> <if test="deptIdList != null and deptIdList.size()>0">
<!-- </when>--> <if test="deptIdList != null and deptIdList.size()>0">
<!-- &lt;!&ndash; 总测评师查看自己部门的患者 &ndash;&gt;--> and pp.hospital_id IN
<!-- <when test="dataScope == 3 or dataScope == 4">--> <foreach item="item" collection="deptIdList" open="(" separator="," close=")">
<!-- and(--> #{item}
<!-- (EXISTS ( SELECT 1 FROM ums_user WHERE user_id = #{userId} AND data_power = 'ALL' ))--> </foreach>
<!-- OR--> </if>
<!-- (uu.dept_id IN ( SELECT CONCAT(dept_id, ',', data_power) FROM ums_user WHERE user_id = #{userId} ))--> </if>
<!-- )--> GROUP BY
<!-- </when>--> pp.id
<!-- &lt;!&ndash; 目前没有2的权限 &ndash;&gt;--> ) a
<!-- <when test="dataScope == 2">--> group by a.patientId
<!-- and uu.dept_id in (--> ORDER BY a.createTime DESC
<!-- SELECT pud.dept_id FROM ums_user u-->
<!-- LEFT JOIN ums_dept ud ON ud.dept_id = u.dept_id-->
<!-- LEFT JOIN ums_dept pud ON pud.dept_id = ud.parent_id-->
<!-- WHERE u.user_id = #{userId}-->
<!-- UNION ALL-->
<!-- SELECT u.dept_id FROM ums_user u WHERE u.user_id = #{userId}-->
<!-- )-->
<!-- </when>-->
<!-- </choose>-->
GROUP BY pp.id
order by pp.create_time desc
</select> </select>
<select id="queryPatientByIdCard" resultType="com.ccsens.system.domain.vo.PmsPatientVo$PatientInfo"> <select id="queryPatientByIdCard" resultType="com.ccsens.system.domain.vo.PmsPatientVo$PatientInfo">
SELECT SELECT
DISTINCT DISTINCT

2
web_admin/src/views/report/view copy.vue

@ -9,7 +9,7 @@
<script> <script>
import { exportPdf } from "@/api/report.js"; import { exportPdf } from "@/api/report.js";
import pdf from "./pdf.vue"; import pdf from "./components/pdf.vue";
export default { export default {
components: { components: {
pdf, pdf,

3
web_admin/vue.config.js

@ -39,7 +39,8 @@ module.exports = {
// target: `http://localhost:8080`, // target: `http://localhost:8080`,
// target: "https://nnzjpt.ylinno.com/ruisiCgaAdmin/", // target: "https://nnzjpt.ylinno.com/ruisiCgaAdmin/",
// target: "https://www.ylinno.com/cga/v2/api/admin/", // target: "https://www.ylinno.com/cga/v2/api/admin/",
target: "http://113.45.159.249:59001/cga/v2/api/admin/", // target: "http://113.45.159.249:59001/cga/v2/api/admin/",
target: "http://192.168.1.136:19330",
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "", ["^" + process.env.VUE_APP_BASE_API]: "",

18
web_client/src/views/Patient/chooseSetMeal/index.vue

@ -102,11 +102,10 @@
class="checkbox-group2-item" class="checkbox-group2-item"
> >
<el-checkbox :label="item2.scaleCode" border> <el-checkbox :label="item2.scaleCode" border>
<h2 <h3
@click.stop=" @click="handleCheckAll1(item1, item2, false)"
handleCheckAll1(item1, item2, false) ></h3>
" <h2>
>
{{ item2.scaleName }}{{ {{ item2.scaleName }}{{
item2.questionNum || 0 item2.questionNum || 0
}} }}
@ -427,7 +426,7 @@ export default {
if (row1.scaleList) { if (row1.scaleList) {
// console.log(row1.scaleList); // console.log(row1.scaleList);
let scaleCodeList = row1.scaleList.map( let scaleCodeList = row1.scaleList.map(
(item) => item.scaleCode (item) => item.scaleCode,
); );
this.checkboxGroup2 = [ this.checkboxGroup2 = [
...this.checkboxGroup2, ...this.checkboxGroup2,
@ -525,6 +524,8 @@ export default {
evaluationId: this.createId, evaluationId: this.createId,
scaleList, scaleList,
}; };
console.log("param", param);
let res = await bindScale(param); let res = await bindScale(param);
const { code, msg, data } = res; const { code, msg, data } = res;
if (code === 200) { if (code === 200) {
@ -947,7 +948,7 @@ export default {
right: 0; right: 0;
margin: 0 auto; margin: 0 auto;
bottom: 20px; bottom: 20px;
z-index: 9999; z-index: 66;
} }
.divul { .divul {
display: flex; display: flex;
@ -1047,6 +1048,7 @@ export default {
border: 2px solid #5cc0be; border: 2px solid #5cc0be;
margin: 5px; margin: 5px;
height: 58px; height: 58px;
position: relative;
} }
.checkbox-group2 h2 { .checkbox-group2 h2 {
font-size: 22px; font-size: 22px;
@ -1060,7 +1062,7 @@ export default {
left: 0px; left: 0px;
right: 0px; right: 0px;
height: 58px; height: 58px;
z-index: 8888; z-index: 9999;
} }
.div-scale-box { .div-scale-box {
// border-top: 1px solid #e1e9f1; // border-top: 1px solid #e1e9f1;

2
web_client/src/views/evaluation/index.vue

@ -26,7 +26,7 @@
</div> </div>
<div class="div-li" style="text-align: left"> <div class="div-li" style="text-align: left">
<span>就诊号</span> <span>就诊号</span>
<a-input v-model="people.outpatientNo" type="number" /> <a-input v-model="people.outpatientNo" />
<span class="required" style="color: red">*</span> <span class="required" style="color: red">*</span>
</div> </div>
<div class="div-li" style="text-align: left"> <div class="div-li" style="text-align: left">

Loading…
Cancel
Save