1.自定义报表,模板选择修改
2.自定义报告调度,更具部门绑定来选择监测点 3.技术监督附件代码更新
This commit is contained in:
@@ -51,7 +51,6 @@ public class CustomReportController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.ADD)
|
||||
@PostMapping("/addTemplate")
|
||||
@ApiOperation("新增自定义报表模板")
|
||||
// @ApiImplicitParam(name = "reportTemplateParam", value = "实体参数", required = true)
|
||||
public HttpResult<Boolean> addCustomReportTemplate(@Validated ReportTemplateParam reportTemplateParam){
|
||||
String methodDescribe = getMethodDescribe("addCustomReportTemplate");
|
||||
boolean res = customReportService.addCustomReportTemplate(reportTemplateParam);
|
||||
@@ -147,7 +146,6 @@ public class CustomReportController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.UPDATE)
|
||||
@PostMapping("/updateTemplate")
|
||||
@ApiOperation("修改自定义报表模板")
|
||||
// @ApiImplicitParam(name = "reportTemplateParam", value = "实体参数", required = true)
|
||||
public HttpResult<Boolean> updateCustomReportTemplate(@Validated ReportTemplateParam.UpdateReportTemplateParam reportTemplateParam){
|
||||
String methodDescribe = getMethodDescribe("updateCustomReportTemplate");
|
||||
boolean res = customReportService.updateCustomReportTemplate(reportTemplateParam);
|
||||
|
||||
@@ -23,5 +23,5 @@ public interface ExcelRptTempMapper extends BaseMapper<ExcelRptTemp> {
|
||||
|
||||
List<ReportTemplateVO> getReportTemplateList(@Param("reportSearchParam")ReportSearchParam reportSearchParam);
|
||||
|
||||
List<ReportTemplateVO> getReportTemplateByDept(@Param("list") List<DeptDTO> list);
|
||||
List<ReportTemplateVO> getReportTemplateByDept(@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
WHERE
|
||||
b.activation = 1
|
||||
and b.dept_id in
|
||||
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
||||
#{item.id}
|
||||
<foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -106,14 +106,4 @@ public interface CustomReportService {
|
||||
List<ReportTemplateVO> getTemplateByDept(String id);
|
||||
|
||||
void viewCustomReportTemplateById(String id, HttpServletResponse response);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 获取数据单位树
|
||||
* @param
|
||||
* @return: java.util.List<com.njcn.harmonic.pojo.vo.ReportTreeVO>
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/28 10:58
|
||||
*/
|
||||
List<ReportTreeVO> deviceUnitTree();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.FileUtil;
|
||||
import com.njcn.device.pq.api.DeptLineFeignClient;
|
||||
import com.njcn.device.pq.api.DeviceUnitClient;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
||||
import com.njcn.harmonic.mapper.DeptTempMapper;
|
||||
@@ -38,9 +40,6 @@ import com.njcn.harmonic.pojo.vo.SysDeptTempVO;
|
||||
import com.njcn.harmonic.service.CustomReportService;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -71,8 +70,6 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
|
||||
private final ExcelRptMapper excelRptMapper;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final EleEpdMapper eleEpdMapper;
|
||||
|
||||
private final DeptTempMapper deptTempMapper;
|
||||
@@ -84,7 +81,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
private final DeviceUnitClient deviceUnitClient;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final DeptLineFeignClient deptLineFeignClient;
|
||||
@Override
|
||||
public boolean addCustomReportTemplate(ReportTemplateParam reportTemplateParam) {
|
||||
checkName(reportTemplateParam, false);
|
||||
@@ -167,8 +164,8 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
@Override
|
||||
public List<ReportTemplateVO> getTemplateByDept(String id) {
|
||||
//获取子孙部门,去重
|
||||
List<DeptDTO> depts = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData().stream().distinct().collect(Collectors.toList());
|
||||
return excelRptTempMapper.getReportTemplateByDept(depts);
|
||||
DeptLine data = deptLineFeignClient.getLineByLineIds(id).getData();
|
||||
return excelRptTempMapper.getReportTemplateByDept(Arrays.asList(data.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,73 +185,6 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportTreeVO> deviceUnitTree() {
|
||||
List<DictData> dictData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEVICE_UNIT.getCode()).getData();
|
||||
Map<String, String> unit = new HashMap<>();
|
||||
List<String> list = dictData.stream().map(DictData::getCode).collect(Collectors.toList());
|
||||
List<ReportTreeVO> info = new ArrayList<>();
|
||||
List<ReportTreeVO> treeVOS = new ArrayList<>();
|
||||
ReportTreeVO reportTreeVO;
|
||||
for (String s : list) {
|
||||
treeVOS = new ArrayList<>();
|
||||
//有效值
|
||||
if (s.equals(DicDataEnum.EFFECTIVE.getCode())) {
|
||||
reportTreeVO = new ReportTreeVO();
|
||||
reportTreeVO.setName("$" + s + "#i$");
|
||||
reportTreeVO.setShowName(DicDataEnum.EFFECTIVE.getName());
|
||||
treeVOS.add(reportTreeVO);
|
||||
reportTreeVO = new ReportTreeVO();
|
||||
reportTreeVO.setName("$" + s + "#v$");
|
||||
reportTreeVO.setShowName(DicDataEnum.EFFECTIVE.getName());
|
||||
treeVOS.add(reportTreeVO);
|
||||
|
||||
reportTreeVO = new ReportTreeVO();
|
||||
reportTreeVO.setName(s);
|
||||
reportTreeVO.setShowName(DicDataEnum.EFFECTIVE.getName());
|
||||
reportTreeVO.setChildren(treeVOS);
|
||||
info.add(reportTreeVO);
|
||||
}
|
||||
//功率
|
||||
// if(s.equals(DicDataEnum.POWER.getCode())){
|
||||
// unit.put(s+"#p",deviceUnit.getTotalActiveP());
|
||||
// unit.put(s+"#q",deviceUnit.getTotalNoP());
|
||||
// unit.put(s+"#s",deviceUnit.getTotalViewP());
|
||||
// }
|
||||
// //畸变率
|
||||
// if(s.equals(DicDataEnum.DISTORTION.getCode())){
|
||||
// unit.put(s+"#v",deviceUnit.getVdistortion());
|
||||
// }
|
||||
// //电压偏差
|
||||
// if(s.equals(DicDataEnum.VOLTAGE.getCode())){
|
||||
// unit.put(s+"#v",deviceUnit.getVoltageDev());
|
||||
// }
|
||||
// //频率
|
||||
// if(s.equals(DicDataEnum.UNIT_FREQUENCY.getCode())){
|
||||
// unit.put(s+"#freq",deviceUnit.getUnitFrequency());
|
||||
// unit.put(s+"#freqDev",deviceUnit.getUnitFrequencyDev());
|
||||
// }
|
||||
// //三项不平衡度
|
||||
// if(s.equals(DicDataEnum.UNBALANCE.getCode())){
|
||||
// unit.put(s+"#v","%");
|
||||
// unit.put(s+"#vPos",deviceUnit.getPositiveV());
|
||||
// unit.put(s+"#vNeg",deviceUnit.getNoPositiveV());
|
||||
// unit.put(s+"#vZero",deviceUnit.getNoPositiveV());
|
||||
// unit.put(s+"#i","%");
|
||||
// unit.put(s+"#iPos","A");
|
||||
// unit.put(s+"#iNeg","A");
|
||||
// unit.put(s+"#iZero","A");
|
||||
// }
|
||||
// //基波
|
||||
// if(s.equals(DicDataEnum.FUND.getCode())){
|
||||
// unit.put(s+"#i",deviceUnit.getIfund());
|
||||
// unit.put(s+"#v",deviceUnit.getVfundEffective());
|
||||
//
|
||||
// }
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportTemplateVO> getTemplateList(ReportSearchParam reportSearchParam) {
|
||||
return excelRptTempMapper.getReportTemplateList(reportSearchParam);
|
||||
@@ -491,7 +421,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
});
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(endList)) {
|
||||
if (CollUtil.isEmpty(endList)) {
|
||||
//数据单位信息
|
||||
Map<String, String> unit = unitMap(reportSearchParam.getLineId());
|
||||
//进行反向赋值到模板
|
||||
@@ -501,6 +431,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
jsonArray.forEach(item -> {
|
||||
JSONObject jsonObject = (JSONObject) item;
|
||||
JSONArray itemArr = (JSONArray) jsonObject.get("celldata");
|
||||
String celldata = jsonObject.get("celldata").toString();
|
||||
itemArr.forEach((it) -> {
|
||||
if (Objects.nonNull(it) && !"null".equals(it.toString())) {
|
||||
//获取到1列
|
||||
|
||||
Reference in New Issue
Block a user