|
|
@@ -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.TableGroupInfoDao;
|
|
|
import thyyxxk.webserver.dao.his.targetmanagement.TargetManagementDao;
|
|
|
import thyyxxk.webserver.dao.his.targetmanagement.ZbZdBaseInfoDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
@@ -54,12 +55,15 @@ public class TargetManagementService {
|
|
|
|
|
|
private final RedisLikeService redis;
|
|
|
|
|
|
+ private final TableGroupInfoDao tableDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
- public TargetManagementService(TargetManagementDao dao, ZbZdBaseInfoDao zbZdDao, HighReportDao reportDao, RedisLikeService redis) {
|
|
|
+ public TargetManagementService(TargetManagementDao dao, ZbZdBaseInfoDao zbZdDao, HighReportDao reportDao, RedisLikeService redis, TableGroupInfoDao tableDao) {
|
|
|
this.dao = dao;
|
|
|
this.zbZdDao = zbZdDao;
|
|
|
this.reportDao = reportDao;
|
|
|
this.redis = redis;
|
|
|
+ this.tableDao = tableDao;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -658,7 +662,15 @@ public class TargetManagementService {
|
|
|
TableGroupInfo info = reportDao.selectTableGroupInfoByLevel(dto.getReportId(), dto.getLevel());
|
|
|
if(info == null){
|
|
|
// 查不到给他默认报表分组类型
|
|
|
- info = reportDao.selectTableGroupInfoByLevel(ReportType.GROUP_KS.getCode(), dto.getLevel());
|
|
|
+ if(ReportType.GROUP_KS.getCode().equals(dto.getLevel())) {
|
|
|
+ info = reportDao.selectTableGroupInfoByLevel(ReportType.GROUP_KS.getCode(), dto.getLevel());
|
|
|
+ } else if(ReportType.GROUP_ZB.getCode().equals(dto.getLevel())) {
|
|
|
+ info = reportDao.selectTableGroupInfoByLevel(ReportType.GROUP_ZB.getCode(), dto.getLevel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(null == info){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标分组配置不存在,请检查!");
|
|
|
}
|
|
|
|
|
|
return ResultVoUtil.success(info);
|
|
|
@@ -752,4 +764,40 @@ public class TargetManagementService {
|
|
|
return ResultVoUtil.success(resultMap);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @description: 保存/更新指标分组信息
|
|
|
+ * @author: hsh
|
|
|
+ * @date: 2023/9/26 16:19
|
|
|
+ * @param: [info]
|
|
|
+ * @return: ResultVo<Map<String,Object>>
|
|
|
+ **/
|
|
|
+ public ResultVo<Map<String, Object>> saveTableGroupInfo(TableGroupInfo info) {
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+
|
|
|
+ if(info == null || StringUtil.isBlank(info.getReportId())){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标分组信息为空,保存指标分组信息失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ReportType.GROUP_KS.getCode().equals(info.getReportId()) || ReportType.GROUP_ZB.getCode().equals(info.getReportId())){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标固定分组信息不允许修改/删除!");
|
|
|
+ }
|
|
|
+
|
|
|
+ TableGroupInfo table = reportDao.selectTableGroupInfo(info.getReportId(), null);
|
|
|
+ if (table != null) {
|
|
|
+ reportDao.deleteTableGroupInfoById(info.getReportId());
|
|
|
+ }
|
|
|
+
|
|
|
+ int n = tableDao.insert(info);
|
|
|
+ if (n <= 0) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "保存指标分组信息失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ resultMap.put("cg", "保存指标详情成功!");
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<List<Map<String, Object>>> selectReportLevelDict() {
|
|
|
+ List<Map<String, Object>> list = tableDao.selectReportLevelDict();
|
|
|
+ return ResultVoUtil.success(list);
|
|
|
+ }
|
|
|
}
|