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

完善首页配置和问题整改

上级 20ab448d
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,9 +28,9 @@ import java.util.ArrayList; ...@@ -25,9 +28,9 @@ 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
@RequestMapping("/page/pageTitleconfig") @RequestMapping("/page/pageTitleconfig")
@Slf4j @Slf4j
...@@ -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<>();
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());
}
}
for(PageTitleconfig cfg:pageList) {
Map<Integer, List<PageTitleconfig>> retMap = pageList.stream()
.collect(Collectors.groupingBy(PageTitleconfig::getTp));
// 如果确保只有 tp=1 和 tp=2 的数据,直接返回即可
// 如果还有其他 tp 值需要过滤,可以再加处理
// 只保留 tp=1 和 tp=2 的数据
Map<Integer, List<PageTitleconfig>> filteredMap = new HashMap<>();
filteredMap.put(1, retMap.getOrDefault(1, new ArrayList<>()));
filteredMap.put(2, retMap.getOrDefault(2, new ArrayList<>()));
return Result.OK(filteredMap);
}
@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());
} }
} }
retMap.put(1,orgList);
retMap.put(2,techList);
return Result.OK(retMap);
}
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;
}
}
}
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) /**问题编号*/
@Excel(name = "问题编号", width = 15)
private java.lang.String problemItem; private java.lang.String problemNo;
/**问题描述*/
/**类别*/
@Excel(name = "类别", width = 15)
private java.lang.String projectItem;
/**项目分类*/
@Excel(name = "类别", width = 15)
private java.lang.String projectCategory;
/**问题描述*/
@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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论