|
@@ -9,6 +9,8 @@ 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.ZbReportCycleDao;
|
|
|
+import thyyxxk.webserver.dao.his.targetmanagement.ZbReportCycleScoreDao;
|
|
|
import thyyxxk.webserver.dao.his.targetmanagement.ZbZdBaseInfoDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.highreport.HighReportDto;
|
|
@@ -16,6 +18,8 @@ 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.ZbReportCycle;
|
|
|
+import thyyxxk.webserver.entity.highreport.ZbReportCycleScore;
|
|
|
import thyyxxk.webserver.entity.highreport.ZbReportResult;
|
|
|
import thyyxxk.webserver.entity.highreport.ZdReportType;
|
|
|
import thyyxxk.webserver.entity.login.UserInfo;
|
|
@@ -61,15 +65,22 @@ public class TargetManagementService {
|
|
|
|
|
|
private final TableDisplayInfoDao displayDao;
|
|
|
|
|
|
+ private final ZbReportCycleDao cycleDao;
|
|
|
+
|
|
|
+ private final ZbReportCycleScoreDao scoreDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
public TargetManagementService(TargetManagementDao dao, ZbZdBaseInfoDao zbZdDao, HighReportDao reportDao,
|
|
|
- RedisLikeService redis, TableGroupInfoDao tableDao, TableDisplayInfoDao displayDao) {
|
|
|
+ RedisLikeService redis, TableGroupInfoDao tableDao, TableDisplayInfoDao displayDao,
|
|
|
+ ZbReportCycleDao cycleDao, ZbReportCycleScoreDao scoreDao) {
|
|
|
this.dao = dao;
|
|
|
this.zbZdDao = zbZdDao;
|
|
|
this.reportDao = reportDao;
|
|
|
this.redis = redis;
|
|
|
this.tableDao = tableDao;
|
|
|
this.displayDao = displayDao;
|
|
|
+ this.cycleDao = cycleDao;
|
|
|
+ this.scoreDao = scoreDao;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -890,4 +901,88 @@ public class TargetManagementService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Description 查询指标年度周期明细
|
|
|
+ * @Author hsh
|
|
|
+ * @return list 指标年度周期明细
|
|
|
+ * @Date 2024/8/15 9:41
|
|
|
+ */
|
|
|
+ public ResultVo<List<ZbReportCycle>> selectScoreCycle(){
|
|
|
+ List<ZbReportCycle> list = cycleDao.selectScoreCycle();
|
|
|
+ return ResultVoUtil.success(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 更新指标周期得分
|
|
|
+ * @Author hsh
|
|
|
+ * @param score 指标周期得分详情
|
|
|
+ * @return map
|
|
|
+ * @Date 2024/8/15 10:19
|
|
|
+ */
|
|
|
+ public ResultVo<Map<String, Object>> updateTargetReportScore(ZbReportCycleScore score){
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ String id = score.getId();
|
|
|
+ String reportCycle = score.getReportCycle();
|
|
|
+ if(StringUtil.isBlank(id) || StringUtil.isBlank(reportCycle)){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标id或年度周期信息不全,请检查!");
|
|
|
+ }
|
|
|
+ ZbReportCycleScore s = scoreDao.selectZbReportCycleScoreByReportCycle(id, reportCycle);
|
|
|
+ UserInfo user = redis.getUserInfoByCode(TokenUtil.getInstance().getTokenUserId());
|
|
|
+ score.setAuthorId(user.getCode().trim());
|
|
|
+ score.setAuthorName(user.getName().trim());
|
|
|
+ int num;
|
|
|
+ if(null != s){
|
|
|
+ num = scoreDao.updateTargetReportScoreById(score);
|
|
|
+ } else {
|
|
|
+ num = scoreDao.insert(score);
|
|
|
+ }
|
|
|
+ if(num > 0){
|
|
|
+ resultMap.put("cg", "更新指标周期得分成功!");
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 查询指标周期得分
|
|
|
+ * @Author hsh
|
|
|
+ * @param score 指标周期得分参数
|
|
|
+ * @return score 指标周期得分
|
|
|
+ * @Date 2024/8/15 15:47
|
|
|
+ */
|
|
|
+ public ResultVo<ZbReportCycleScore> selectTargetReportScore(ZbReportCycleScore score){
|
|
|
+ String id = score.getId();
|
|
|
+ String reportCycle = score.getReportCycle();
|
|
|
+ if(StringUtil.isBlank(id) || StringUtil.isBlank(reportCycle)){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标id或年度周期信息不全,请检查!");
|
|
|
+ }
|
|
|
+ ZbReportCycleScore zbScore = scoreDao.selectZbReportCycleScoreByReportCycle(id, reportCycle);
|
|
|
+ return ResultVoUtil.success(zbScore);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 查询计算指标得分的权限
|
|
|
+ * @Author hsh
|
|
|
+ * @return map
|
|
|
+ * @Date 2024/8/15 16:54
|
|
|
+ */
|
|
|
+ public ResultVo<Map<String, Object>> selectScoreCyclePermissions(){
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ String permissions = scoreDao.selectScoreCyclePermissions();
|
|
|
+ if("N".equals(permissions)){
|
|
|
+ // 不做计算指标得分的权限限制
|
|
|
+ resultMap.put("permissions", 0);
|
|
|
+ } else {
|
|
|
+ UserInfo user = redis.getUserInfoByCode(TokenUtil.getInstance().getTokenUserId());
|
|
|
+ String code = user.getCode().trim();
|
|
|
+ if(permissions.contains(code)){
|
|
|
+ // 有权限计算指标得分
|
|
|
+ resultMap.put("permissions", 1);
|
|
|
+ } else {
|
|
|
+ // 没有权限计算指标得分
|
|
|
+ resultMap.put("permissions", 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ }
|
|
|
+
|
|
|
}
|