c2945bf7 sonin

运营季报 重点工作情况 修改

1 个父辈 1a4fc839
package com.skua.common.constant;
/**
* <pre>
* 常量
* </pre>
*
* @author sonin
* @version 1.0 2023/3/9 10:12
*/
public interface BusinessConstant {
String dateFormat = "yyyy-MM-dd HH:mm:ss";
String startTimeSuffix = " 00:00:00";
String endTimeSuffix = " 23:59:59";
String countSuffix = "Count";
String sumSuffix = "Sum";
}
package com.skua.modules.biz;
import java.util.Collection;
import java.util.Map;
/**
* @Author:sonin
* @Date:2025/2/18 15:35
*/
public interface IBusinessService {
Map<String, String> dictMap(String dictCode, Collection<?> inCol);
}
package com.skua.modules.biz.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.skua.modules.base.service.IBaseService;
import com.skua.modules.biz.IBusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author:sonin
* @Date:2025/2/18 15:35
*/
@Service
public class BusinessServiceImpl implements IBusinessService {
@Autowired
private IBaseService baseService;
@Override
public Map<String, String> dictMap(String dictCode, Collection<?> inCol) {
String key0, value0, table0;
QueryWrapper<?> queryWrapper0 = new QueryWrapper<>();
if ("equipment_info".equals(dictCode)) {
key0 = "id";
value0 = "equipment_name";
table0 = dictCode;
} else if ("sys_user".equals(dictCode)) {
key0 = "id";
value0 = "realname";
table0 = dictCode;
} else if ("sys_struct_dict".equals(dictCode)) {
key0 = "id";
value0 = "struct_name";
table0 = dictCode;
} else if ("equipment_category".equals(dictCode)) {
key0 = "id";
value0 = "des";
table0 = dictCode;
} else if ("evaluate_score_desc".equals(dictCode)) {
key0 = "id";
value0 = "score_desc";
table0 = dictCode;
} else if ("carbon_qualitative_desc".equals(dictCode)) {
key0 = "id";
value0 = "qualitative_desc";
table0 = dictCode;
} else if ("sys_depart".equals(dictCode)) {
key0 = "id";
value0 = "depart_name";
table0 = dictCode;
} else {
// 数据字典查询
queryWrapper0.eq("sys_dict.dict_code", dictCode);
key0 = "sys_dict_item.item_value";
value0 = "sys_dict_item.item_text";
table0 = "sys_dict inner join sys_dict_item on sys_dict.id = sys_dict_item.dict_id";
}
String sqlSelect = "select " + key0 + " as key0, " + value0 + " as value0 from " + table0;
if (inCol != null && !inCol.isEmpty()) {
queryWrapper0.in(key0, inCol);
}
List<Map<String, Object>> queryMapList0 = baseService.queryForList(sqlSelect, queryWrapper0);
Map<String, String> dictMap = new HashMap<>(10);
for (Map<String, Object> item : queryMapList0) {
dictMap.put(String.valueOf(item.get("key0")), String.valueOf(item.get("value0")));
}
return dictMap;
}
}
package com.skua.modules.report.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.skua.common.constant.BusinessConstant;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.base.service.IBaseService;
import com.skua.modules.biz.IBusinessService;
import com.skua.modules.report.mapper.OperationReportMapper;
import com.skua.modules.report.service.IOperationReportService;
import com.skua.modules.report.vo.*;
......@@ -22,8 +26,11 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/***
* 运营周报
......@@ -33,6 +40,10 @@ public class OperationReportServiceImpl implements IOperationReportService {
@Resource
private OperationReportMapper operationReportMapper;
@Resource
private IBaseService baseService;
@Resource
private IBusinessService businessService;
private JdbcTemplate getJdbcTemplate(){
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
......@@ -154,7 +165,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
productDataVO.setDrugDeptartList(yyhMonthDataList);
//隐患排查完成情况
// 隐患排查完成情况
List<String> deptNameList = operationReportMapper.queryDepatNameList();
productDataVO.setDangerDeptCount( 0 );
if(deptNameList != null && !deptNameList.isEmpty()){
......@@ -162,6 +173,36 @@ public class OperationReportServiceImpl implements IOperationReportService {
productDataVO.setDangerDeptNames(String.join(",",deptNameList));
}
// 翻译
Map<String, String> sysDepartDictMap = businessService.dictMap("sys_depart", null);
// 1. 重点工作事项:取重点事项推进情况里面,当月完成的重点事项记录
QueryWrapper<?> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("status", "2")
.ge("end_time", startDate)
.le("end_time", endDate);
List<Map<String, Object>> queryMapList1 = baseService.queryForList("select * from f_major_issues_process", queryWrapper1);
for (Map<String, Object> item: queryMapList1) {
List<Map<String, Object>> priorityWorkItemList = new ArrayList<>();
priorityWorkItemList.add(new HashMap<String, Object>(){{
put("key0", item.get("depart_id"));
put("value0", sysDepartDictMap.get(item.get("depart_id")));
}});
productDataVO.setPriorityWorkItemList(priorityWorkItemList);
}
// 2: 隐患排查巡检:取风险点巡检记录里面巡检类型是生产巡检的数据
QueryWrapper<?> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("inspection_type", "1")
.ge("end_date", startDate + BusinessConstant.startTimeSuffix)
.le("end_date", endDate + BusinessConstant.endTimeSuffix);
List<Map<String, Object>> queryMapList2 = baseService.queryForList("select * from danger_inspection_record", queryWrapper2);
for (Map<String, Object> item: queryMapList2) {
List<Map<String, Object>> hiddenDangerInspectionList = new ArrayList<>();
hiddenDangerInspectionList.add(new HashMap<String, Object>(){{
put("key0", item.get("depart_id"));
put("value0", sysDepartDictMap.get(item.get("depart_id")));
}});
productDataVO.setHiddenDangerInspectionList(hiddenDangerInspectionList);
}
return productDataVO;
}
......
......@@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 月度生产数据报表
......@@ -60,6 +61,15 @@ public class ProductDataVO {
@ApiModelProperty(value = "药剂实际费用")
private Double drugCost;//实际发生为0.219元/吨水
// 重点工作事项
private List<Map<String, Object>> priorityWorkItemList = new ArrayList<>();
// 隐患排查巡检
private List<Map<String, Object>> hiddenDangerInspectionList = new ArrayList<>();
// 运营管理抽查情况
private List<Map<String, Object>> managementSpotCheckList = new ArrayList<>();
@ApiModelProperty(value = "实际水量同比下降--水务公司列表")
private List<FReportWaterMonthDataVO> waterDeptartList = new ArrayList<>();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!