提交 d3370854 authored 作者: kxjia's avatar kxjia

完善首页配置和问题整改

上级 20ab448d
package org.jeecg.modules.stm.api;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.common.api.vo.Result;
import org.jeecg.config.shiro.IgnoreAuth;
import org.jeecg.modules.stm.metric.entity.MetricMonitorSet;
import org.jeecg.modules.stm.metric.entity.MetricReport;
import org.jeecg.modules.stm.metric.service.IMetricMonitorSetService;
import org.jeecg.modules.stm.metric.service.IMetricReportService;
import org.jeecg.modules.stm.my.entity.MyTask;
import org.jeecg.modules.stm.my.service.IMyTaskService;
import org.jeecg.modules.stm.page.entity.PageMonitorchart;
import org.jeecg.modules.stm.page.entity.PageTitleconfig;
import org.jeecg.modules.stm.page.service.IPageMonitorchartService;
import org.jeecg.modules.stm.page.service.IPageTitleconfigService;
import org.jeecg.modules.stm.rectify.approve.entity.StRectifyApprove;
import org.jeecg.modules.stm.rectify.approve.service.IStRectifyApproveService;
import org.jeecg.modules.stm.rectify.assin.entity.StProblemTaskAssin;
import org.jeecg.modules.stm.rectify.assin.service.IStProblemTaskAssinService;
import org.jeecg.modules.stm.rectify.exec.service.IStRectifyExecService;
import org.jeecg.modules.stm.rectify.plan.entity.StRectifyPlan;
import org.jeecg.modules.stm.rectify.plan.service.IStRectifyPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/api/bigscreen/")
public class BigScreenAPIController {
@Autowired
private IPageTitleconfigService pageTitleconfigService;
@Autowired
private IMyTaskService myTaskService;
@Autowired
private IStProblemTaskAssinService stProblemTaskAssinService;
@Autowired
private IStRectifyApproveService stRectifyApproveService;
@Autowired
private IStRectifyExecService stRectifyExecService;
@Autowired
private IStRectifyPlanService iStRectifyPlanService;
@Autowired
private IPageMonitorchartService pageMonitorchartService;
@Autowired
private IMetricReportService metricReportService;
@Autowired
private IMetricMonitorSetService metricMonitorSetService;
@IgnoreAuth
@GetMapping(value = "/getBaseInfoList")
public Result<Map<Integer,List<PageTitleconfig>>> getBaseInfoList() {
QueryWrapper<PageTitleconfig> queryWrapperCfg = new QueryWrapper<>();
queryWrapperCfg.orderByAsc("show_sort");
List<PageTitleconfig> pageList = pageTitleconfigService.list(queryWrapperCfg);
Map<Integer,List<PageTitleconfig>> retMap = new HashMap<>();
List<PageTitleconfig> orgList = new ArrayList<>();
List<PageTitleconfig> techList = new ArrayList<>();
List<Map<String, String>> retList = new ArrayList<>();
if(pageList!=null && pageList.size()!=0) {
List<Map<String,Object>> listData =pageTitleconfigService.getFirstPageFxcStat();
Map<Integer,String> tmpMap = new HashMap<>();
for (Map<String,Object> cnt : listData) {
Integer dtId = Integer.valueOf(cnt.get("itemid").toString());
if (tmpMap.get(dtId) != null) {
continue;
}
if(cnt.get("content")!=null){
tmpMap.put(dtId, cnt.get("content").toString());
}
}
}
retMap.put(1,orgList);
retMap.put(2,techList);
return Result.OK(retMap);
}
@GetMapping(value = "/getMyTask")
public Result<List> getMyTask() {
//获取待办事项列表,待审批和待填报
QueryWrapper<MyTask> queryWrapper = new QueryWrapper();
queryWrapper.eq("sta",0).orderByDesc("priority");
queryWrapper.last("limit 4");
List<MyTask> list = myTaskService.list(queryWrapper);
return Result.OK(list);
}
@RequestMapping(value = "/getPageStatProblemLevel")
public Result<?> getPageStatProblemLevel() {
List<Map<String,Object>> list = stProblemTaskAssinService.statProblemLevel();
return Result.ok(list);
}
@RequestMapping(value = "/problemStat")
public Result<?> problemStat(HttpServletResponse response) {
//@ApiModelProperty(value = "审核标志;0 未开始 1 待审核、2 已完成、3 已驳回")
long total = stProblemTaskAssinService.count();
//接收即确认的问题数
QueryWrapper<StProblemTaskAssin> queryWrapper = new QueryWrapper<>();
queryWrapper.ne("receive_status","1").or().eq("assin_status","0").or().isNull("receive_status");
//未分配的
long noAssignNm = stProblemTaskAssinService.count(queryWrapper); //已经分配,但未接收
QueryWrapper<StRectifyApprove> queryApproveWrapper = new QueryWrapper<>();
queryApproveWrapper.eq("approve_flag","3");
long finishNm = stRectifyApproveService.count(queryApproveWrapper);
long execNm = stRectifyExecService.count();
QueryWrapper<StRectifyPlan> queryPlanWrapper = new QueryWrapper<>();
queryPlanWrapper.ne("edit_flag","1");
long planNm = iStRectifyPlanService.count(queryPlanWrapper);
Map<String,Object> retMap = new LinkedHashMap<>();
retMap.put("total",total);
retMap.put("execNm",(execNm-finishNm));
retMap.put("finishNm",finishNm);
retMap.put("planNm",planNm);
retMap.put("noAssignNm",noAssignNm);
return Result.OK(retMap);
}
@RequestMapping(value = "/getPageChartData")
public Result<?> getPageCharData(HttpServletRequest request, HttpServletResponse response) {
List<PageMonitorchart> listData = pageMonitorchartService.list();
return Result.OK(listData);
}
@GetMapping(value = "/getMtricDataByMtrcNo")
public Result<?> getMtricDataByMtrcNo(String mtrcNo) {
QueryWrapper<MetricReport> queryWrapper = new QueryWrapper();
queryWrapper.eq("mtrc_no",mtrcNo);
//queryWrapper.ge("fill_time",mc.getYear());
queryWrapper.orderByAsc("fill_time");
List<MetricReport> metrcList = metricReportService.list(queryWrapper);
Map<String,Object> retMap = new HashMap<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
List<Float> retList = new ArrayList<>();
List<Object> retWarnList = new ArrayList<>();
List<Object> retIntvList = new ArrayList<>();
List<Object> retTolList = new ArrayList<>();
List<String> category = new ArrayList<>();
MetricMonitorSet metrcSet = getMetricMonitorSet(mtrcNo);
Float warnVal = metrcSet.getWarnVal();
Float intvVal = metrcSet.getIntvVal();
if(warnVal!=null){
for(MetricReport mr:metrcList){
retWarnList.add(warnVal);
}
retMap.put("warn",retWarnList);
}
if(intvVal!=null){
for(MetricReport mr:metrcList){
retIntvList.add(intvVal);
}
retMap.put("intv",retIntvList);
}
for(MetricReport mr:metrcList){
if(mr.getFillVals()==null)continue;
category.add(sdf.format(mr.getFillTime()));
retList.add(Float.parseFloat(mr.getFillVals()));
retTolList.add(metrcSet.getTolVal());
}
retMap.put("mtrc",retList);
retMap.put("tol",retTolList);
retMap.put("category",category);
retMap.put("unit",metrcSet.getUnit());
if(retList.size()>0) {
float max = Collections.max(retList);
float min = Collections.min(retList);
List<Float> tmpList = new ArrayList<>();
tmpList.add(max);
tmpList.add(min);
if(warnVal!=null) {
tmpList.add(warnVal);
}
if(intvVal!=null) {
tmpList.add(intvVal);
}
max = Collections.max(tmpList);
min = Collections.min(tmpList);
retMap.put("min",min);
retMap.put("max",max);
}
retMap.put("interval",metrcSet.getUnit());
return Result.OK(retMap);
}
private MetricMonitorSet getMetricMonitorSet(String mtricNo) {
QueryWrapper<MetricMonitorSet> queryWrapper = new QueryWrapper();
queryWrapper.eq("mtrc_no",mtricNo);
MetricMonitorSet metrcSet =metricMonitorSetService.getOne(queryWrapper);
return metrcSet;
}
@GetMapping(value = "/getMtricDataMultMtrc")
public Result<?> getMtricDataMultMtrc() {
Map<String,List<Map<String,Object>>> retMap = new HashMap<>();
List<Map<String,Object>> listData = pageMonitorchartService.queryMulMetrcSta();
Map<String, List<Map<String, Object>>> groupedByMtrcNo = listData.stream()
.collect(Collectors.groupingBy(record -> (String) record.get("mtrcNo")));
return Result.OK(groupedByMtrcNo);
}
@GetMapping(value = "/getBaosongJggm")
public Map<String,String> getBaosongJggm() {
Map<String,String> retMap = new HashMap<>();
retMap.put("C23A001","888");
retMap.put("C23A002","999");
return retMap;
}
@GetMapping(value = "/getBaosongDsh")
public List<Map<String,String>> getBaosongDsh() {
List<Map<String,String>> retList = new ArrayList<>();
Map<String,String> map1 = new HashMap<>();
map1.put("code","C20A001");
map1.put("type","number");
map1.put("unit","次");
map1.put("val","10");
map1.put("name","本年度董事会召开涉及信息科技议题的会议数量");
retList.add(map1);
Map<String,String> map2 = new HashMap<>();
map2.put("code","C20A003");
map2.put("type","boolean");
map2.put("val","是");
map2.put("unit","");
map2.put("name","本年度董事会(含授权的风险管理委员会)审阅信息科技风险管理报告");
retList.add(map2);
return retList;
}
}
package org.jeecg.modules.stm.page.controller; package org.jeecg.modules.stm.page.controller;
import com.aliyun.oss.common.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -9,6 +10,8 @@ import lombok.extern.slf4j.Slf4j; ...@@ -9,6 +10,8 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.stm.baosong.entity.BaosongTaskRecord;
import org.jeecg.modules.stm.baosong.service.IBaosongTaskRecordService;
import org.jeecg.modules.stm.page.entity.PageTitleconfig; import org.jeecg.modules.stm.page.entity.PageTitleconfig;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -25,7 +28,7 @@ import java.util.ArrayList; ...@@ -25,7 +28,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
@RestController @RestController
...@@ -40,6 +43,10 @@ public class PageTitleconfigController extends JeecgController<PageTitleconfig, ...@@ -40,6 +43,10 @@ public class PageTitleconfigController extends JeecgController<PageTitleconfig,
private IMyTaskService myTaskService; private IMyTaskService myTaskService;
@Autowired @Autowired
private IStProblemTaskAssinService stProblemTaskAssinService; private IStProblemTaskAssinService stProblemTaskAssinService;
@Autowired
private IBaosongTaskRecordService baosongTaskRecordService;
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<IPage<PageTitleconfig>> queryPageList(PageTitleconfig pageTitleconfig, public Result<IPage<PageTitleconfig>> queryPageList(PageTitleconfig pageTitleconfig,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
...@@ -94,33 +101,49 @@ public class PageTitleconfigController extends JeecgController<PageTitleconfig, ...@@ -94,33 +101,49 @@ public class PageTitleconfigController extends JeecgController<PageTitleconfig,
QueryWrapper<PageTitleconfig> queryWrapperCfg = new QueryWrapper<>(); QueryWrapper<PageTitleconfig> queryWrapperCfg = new QueryWrapper<>();
queryWrapperCfg.orderByAsc("show_sort"); queryWrapperCfg.orderByAsc("show_sort");
List<PageTitleconfig> pageList = pageTitleconfigService.list(queryWrapperCfg); List<PageTitleconfig> pageList = pageTitleconfigService.list(queryWrapperCfg);
Map<Integer,List<PageTitleconfig>> retMap = new HashMap<>();
List<PageTitleconfig> orgList = new ArrayList<>();
List<PageTitleconfig> techList = new ArrayList<>();
List<Map<String, String>> retList = new ArrayList<>(); Map<Integer, List<PageTitleconfig>> retMap = pageList.stream()
if(pageList!=null && pageList.size()!=0) { .collect(Collectors.groupingBy(PageTitleconfig::getTp));
List<Map<String,Object>> listData =pageTitleconfigService.getFirstPageFxcStat();
Map<Integer,String> tmpMap = new HashMap<>(); // 如果确保只有 tp=1 和 tp=2 的数据,直接返回即可
for (Map<String,Object> cnt : listData) { // 如果还有其他 tp 值需要过滤,可以再加处理
Integer dtId = Integer.valueOf(cnt.get("itemid").toString()); // 只保留 tp=1 和 tp=2 的数据
if (tmpMap.get(dtId) != null) { Map<Integer, List<PageTitleconfig>> filteredMap = new HashMap<>();
continue; filteredMap.put(1, retMap.getOrDefault(1, new ArrayList<>()));
filteredMap.put(2, retMap.getOrDefault(2, new ArrayList<>()));
return Result.OK(filteredMap);
} }
if(cnt.get("content")!=null){
tmpMap.put(dtId, cnt.get("content").toString()); @GetMapping(value = "/updateAllNewValue")
public Result<String> updateAllNewValue() {
List<PageTitleconfig> listPageTitleconfig = pageTitleconfigService.list();
List<Integer> tplItemIdList = new ArrayList<>();
if (listPageTitleconfig != null && listPageTitleconfig.size() > 0) {
for(PageTitleconfig cfg : listPageTitleconfig) {
tplItemIdList.add(cfg.getTplItemId());
} }
} }
for(PageTitleconfig cfg:pageList) {
List<BaosongTaskRecord> latestRecords = baosongTaskRecordService.lambdaQuery()
.in(BaosongTaskRecord::getItemid, tplItemIdList)
.last("GROUP BY itemid HAVING create_time = MAX(create_time)")
.list();
for(PageTitleconfig cfg: listPageTitleconfig) {
for(BaosongTaskRecord taskRecord : latestRecords) {
if(cfg.getTplItemId()==null)continue;
if(taskRecord.getItemid()==null)continue;
if(cfg.getTplItemId().intValue()==taskRecord.getItemid()) {
cfg.setDefaultVal(taskRecord.getContent());
break;
} }
} }
retMap.put(1,orgList);
retMap.put(2,techList);
return Result.OK(retMap);
} }
pageTitleconfigService.saveOrUpdateBatch(listPageTitleconfig);
return Result.OK("更新成功");
}
private String queryExist(Integer dtId,Integer id,boolean isAdd) { private String queryExist(Integer dtId,Integer id,boolean isAdd) {
List<PageTitleconfig> list = pageTitleconfigService.list(); List<PageTitleconfig> list = pageTitleconfigService.list();
......
...@@ -19,6 +19,6 @@ public interface PageTitleconfigMapper extends BaseMapper<PageTitleconfig> { ...@@ -19,6 +19,6 @@ public interface PageTitleconfigMapper extends BaseMapper<PageTitleconfig> {
Integer getTjByFxjcListZs(); Integer getTjByFxjcListZs();
List<PageMetricMoniVo> getMetricReportList(MetricReport metricReport); List<PageMetricMoniVo> getMetricReportList(MetricReport metricReport);
List<Map<String,Object>> getFirstPageFxcStat();
} }
...@@ -13,5 +13,5 @@ import java.util.Map; ...@@ -13,5 +13,5 @@ import java.util.Map;
* @Version: V1.0 * @Version: V1.0
*/ */
public interface IPageTitleconfigService extends IService<PageTitleconfig> { public interface IPageTitleconfigService extends IService<PageTitleconfig> {
List<Map<String,Object>> getFirstPageFxcStat();
} }
...@@ -18,9 +18,5 @@ import java.util.Map; ...@@ -18,9 +18,5 @@ import java.util.Map;
@Service @Service
public class PageTitleconfigServiceImpl extends ServiceImpl<PageTitleconfigMapper, PageTitleconfig> implements IPageTitleconfigService { public class PageTitleconfigServiceImpl extends ServiceImpl<PageTitleconfigMapper, PageTitleconfig> implements IPageTitleconfigService {
@Override
public List<Map<String,Object>> getFirstPageFxcStat() {
List<Map<String,Object>> list = this.baseMapper.getFirstPageFxcStat();
return list;
}
} }
...@@ -33,80 +33,84 @@ public class StProblemCheck implements Serializable { ...@@ -33,80 +33,84 @@ public class StProblemCheck implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**ID*/ /**ID*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.AUTO)
private java.lang.Integer id; private java.lang.Integer id;
/**问题编号*/
@Excel(name = "问题编号", width = 15)
private java.lang.String problemNo;
/**类别*/ /**类别*/
@Excel(name = "类别", width = 15) @Excel(name = "类别", width = 15)
private java.lang.String projectItem;
/**项目分类*/
@Excel(name = "类别", width = 15)
private java.lang.String projectCategory;
private java.lang.String problemItem;
/**问题描述*/ /**问题描述*/
@Excel(name = "问题描述", width = 15) @Excel(name = "问题描述", width = 15)
private java.lang.String problemDes; private java.lang.String problemDes;
/**问题来源*/ /**问题来源*/
@Excel(name = "问题来源", width = 15) @Excel(name = "问题来源", width = 15)
private java.lang.String problemSource; private java.lang.String problemSource;
/**是否整改*/ /**是否整改*/
@Excel(name = "是否整改", width = 15, dicCode = "yn") @Excel(name = "是否整改", width = 15, dicCode = "yn")
@Dict(dicCode = "yn") @Dict(dicCode = "yn")
private java.lang.String isReceive; private java.lang.String isReceive;
/**整改计划*/ /**整改计划*/
@Excel(name = "整改计划", width = 15) @Excel(name = "整改计划", width = 15)
private java.lang.String programme; private java.lang.String programme;
/**整改落实情况*/ /**整改落实情况*/
@Excel(name = "整改落实情况", width = 15) @Excel(name = "整改落实情况", width = 15)
private java.lang.String strategy; private java.lang.String strategy;
/**创建人*/ /**创建人*/
@Excel(name = "创建人", width = 15) @Excel(name = "创建人", width = 15)
private java.lang.String createdUser; private java.lang.String createdUser;
/**创建时间*/ /**创建时间*/
@Excel(name = "创建时间", width = 15, format = "yyyy-MM-dd") @Excel(name = "创建时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date createdTime; private java.util.Date createdTime;
/**更新人*/ /**更新人*/
@Excel(name = "更新人", width = 15) @Excel(name = "更新人", width = 15)
private java.lang.String updatedUser; private java.lang.String updatedUser;
/**更新时间*/ /**更新时间*/
@Excel(name = "更新时间", width = 15, format = "yyyy-MM-dd") @Excel(name = "更新时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date updatedTime; private java.util.Date updatedTime;
/**编号*/ /**编号*/
@Excel(name = "编号", width = 15) @Excel(name = "编号", width = 15)
private java.lang.String caNo; private java.lang.String caNo;
/**严重程度;0001 不严重 0002 一般 0003 严重 004 非常严重*/ /**严重程度;0001 不严重 0002 一般 0003 严重 004 非常严重*/
@Excel(name = "严重程度", width = 15, dicCode = "severity") @Excel(name = "严重程度", width = 15, dicCode = "severity")
@Dict(dicCode = "severity") @Dict(dicCode = "severity")
private java.lang.String severity; private java.lang.String severity;
/**负责部门*/ /**负责部门*/
@Excel(name = "负责部门", width = 15) @Excel(name = "负责部门", width = 15)
private java.lang.String headDepCode; private java.lang.String headDepCode;
/**负责人*/ /**负责人*/
//@Excel(name = "负责人", width = 15) //@Excel(name = "负责人", width = 15)
private java.lang.String headUserCode; private java.lang.String headUserCode;
@Excel(name = "领域", width = 15, dicCode = "rate_domain") @Excel(name = "领域", width = 15, dicCode = "rate_domain")
@Dict(dicCode = "rate_domain") @Dict(dicCode = "rate_domain")
private java.lang.String domain; private java.lang.String domain;
@Excel(name = "整改状态", width = 15) @Excel(name = "整改状态", width = 15)
private java.lang.String receivestatus; private java.lang.String receivestatus;
/**整改开始时间*/ /**整改开始时间*/
...@@ -120,15 +124,15 @@ public class StProblemCheck implements Serializable { ...@@ -120,15 +124,15 @@ public class StProblemCheck implements Serializable {
@Excel(name = "整改结束时间", width = 15, format = "yyyy-MM-dd") @Excel(name = "整改结束时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date planEndDate; private java.util.Date planEndDate;
/**发现人*/
private java.lang.String findUser;
/**流程状态*/ /**流程状态*/
private String bpmStatus; private java.lang.String bpmStatus;
/**部署ID*/ /**部署ID*/
private java.lang.String deployId; private java.lang.String deployId;
/**风险等级*/
private java.lang.Integer riskLevel;
......
...@@ -41,9 +41,5 @@ ...@@ -41,9 +41,5 @@
and t.risk_level is not null and t.risk_level is not null
)tj )tj
</select> </select>
<select id="getFirstPageFxcStat" resultType="java.util.Map">
SELECT B.itemid,B.content FROM page_titleconfig A
INNER JOIN baosong_task_record B ON A.tpl_item_dt_id=B.itemid
ORDER BY A.show_sort
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论