|
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.dao.his.highreport.HighReportDao;
|
|
|
+import thyyxxk.webserver.dao.his.targetmanagement.TableDisplayInfoDao;
|
|
|
import thyyxxk.webserver.dao.his.targetmanagement.TableGroupInfoDao;
|
|
|
import thyyxxk.webserver.dao.his.targetmanagement.TargetManagementDao;
|
|
|
import thyyxxk.webserver.dao.his.targetmanagement.ZbZdBaseInfoDao;
|
|
@@ -13,6 +14,7 @@ import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.highreport.HighReportDto;
|
|
|
import thyyxxk.webserver.entity.highreport.ReportBaseInfo;
|
|
|
import thyyxxk.webserver.entity.highreport.ReportType;
|
|
|
+import thyyxxk.webserver.entity.highreport.TableDisplayInfo;
|
|
|
import thyyxxk.webserver.entity.highreport.TableGroupInfo;
|
|
|
import thyyxxk.webserver.entity.highreport.ZbReportResult;
|
|
|
import thyyxxk.webserver.entity.highreport.ZdReportType;
|
|
@@ -57,13 +59,17 @@ public class TargetManagementService {
|
|
|
|
|
|
private final TableGroupInfoDao tableDao;
|
|
|
|
|
|
+ private final TableDisplayInfoDao displayDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
- public TargetManagementService(TargetManagementDao dao, ZbZdBaseInfoDao zbZdDao, HighReportDao reportDao, RedisLikeService redis, TableGroupInfoDao tableDao) {
|
|
|
+ public TargetManagementService(TargetManagementDao dao, ZbZdBaseInfoDao zbZdDao, HighReportDao reportDao,
|
|
|
+ RedisLikeService redis, TableGroupInfoDao tableDao, TableDisplayInfoDao displayDao) {
|
|
|
this.dao = dao;
|
|
|
this.zbZdDao = zbZdDao;
|
|
|
this.reportDao = reportDao;
|
|
|
this.redis = redis;
|
|
|
this.tableDao = tableDao;
|
|
|
+ this.displayDao = displayDao;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -800,4 +806,89 @@ public class TargetManagementService {
|
|
|
List<Map<String, Object>> list = tableDao.selectReportLevelDict();
|
|
|
return ResultVoUtil.success(list);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 查询指标报表的所有id以及名称
|
|
|
+ * @Author hsh
|
|
|
+ * @param reportType 指标报表类型
|
|
|
+ * @return list
|
|
|
+ * @Date 2024/4/8 10:15
|
|
|
+ */
|
|
|
+ public ResultVo<List<Map<String, Object>>> selectTargetZbReportId(String reportType) {
|
|
|
+ List<Map<String, Object>> list = dao.selectTargetZbReportId(reportType);
|
|
|
+ return ResultVoUtil.success(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 查询指标报表详情配置
|
|
|
+ * @Author hsh
|
|
|
+ * @param info 指标报表信息
|
|
|
+ * @return list
|
|
|
+ * @Date 2024/4/8 10:16
|
|
|
+ */
|
|
|
+ public ResultVo<List<TableDisplayInfo>> selectTableDisplay(ReportBaseInfo info) {
|
|
|
+ return ResultVoUtil.success(displayDao.selectTableDisplayByReportId(info.getReportId(), "patient"));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 更新指标报表详情配置信息
|
|
|
+ * @Author hsh
|
|
|
+ * @param info 指标报表详情配置信息
|
|
|
+ * @return map
|
|
|
+ * @Date 2024/4/8 10:16
|
|
|
+ */
|
|
|
+ public ResultVo<Map<String, Object>> saveTableDisplay(TableDisplayInfo info){
|
|
|
+
|
|
|
+ if(null == info || info.getReportId() == null || info.getLevelId() == null || info.getProp() == null){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标报表详情配置信息不存在,请检查!");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ String reportId = info.getReportId();
|
|
|
+ String levelId = info.getLevelId();
|
|
|
+ String prop = info.getProp();
|
|
|
+ TableDisplayInfo displayInfo = displayDao.selectTableDisplayByProp(reportId, levelId, prop);
|
|
|
+
|
|
|
+ int num;
|
|
|
+ try{
|
|
|
+ if(null != displayInfo){
|
|
|
+ num = displayDao.updateTableDisplayByProp(info);
|
|
|
+ } else {
|
|
|
+ num = displayDao.insert(info);
|
|
|
+ }
|
|
|
+ if(num == 0){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "保存指标报表详情配置失败!");
|
|
|
+ }
|
|
|
+ resultMap.put("cg", "保存指标报表详情配置成功!");
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ } catch(Exception e){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "保存指标报表详情配置失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 根据指标报表详情配置prop删除指标报表详情配置信息
|
|
|
+ * @Author hsh
|
|
|
+ * @param reportId,levelId,prop 报表id,报表等级id,报表配置prop属性
|
|
|
+ * @return map
|
|
|
+ * @Date 2024/4/8 10:17
|
|
|
+ */
|
|
|
+ public ResultVo<Map<String, Object>> delTableDisplayByProp(String reportId, String levelId, String prop) {
|
|
|
+ if(reportId == null || levelId == null || prop == null){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标报表详情配置信息不存在,请检查!");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ try{
|
|
|
+ int num = displayDao.delTableDisplayByProp(reportId, levelId, prop);
|
|
|
+ if(num == 0){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "删除指标报表详情配置信息失败!");
|
|
|
+ }
|
|
|
+ resultMap.put("cg", "删除指标报表详情配置信息成功!");
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ } catch(Exception e){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "删除指标报表详情配置信息失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|