|
@@ -1,26 +1,19 @@
|
|
|
package com.rtrh.projects.web.controller.subject;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-import java.io.InputStream;
|
|
|
-import java.io.OutputStream;
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.math.RoundingMode;
|
|
|
-import java.net.URLEncoder;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.*;
|
|
|
-import java.util.function.Function;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import javax.servlet.ServletOutputStream;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
+import cn.afterturn.easypoi.entity.BaseTypeConstants;
|
|
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
|
|
+import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
|
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
|
|
+import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
|
|
+import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
|
|
import cn.afterturn.easypoi.word.WordExportUtil;
|
|
|
import cn.afterturn.easypoi.word.entity.MyXWPFDocument;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.date.DateField;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.io.IoUtil;
|
|
|
+import cn.hutool.core.net.URLEncodeUtil;
|
|
|
import cn.hutool.poi.excel.ExcelUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.EasyExcelFactory;
|
|
@@ -28,23 +21,26 @@ import com.alibaba.excel.ExcelWriter;
|
|
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
|
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.rtrh.common.util.CollectionUtil;
|
|
|
import com.rtrh.common.util.StringUtil;
|
|
|
+import com.rtrh.core.repository.Page;
|
|
|
import com.rtrh.projects.modules.projects.dao.SubSourceDao;
|
|
|
import com.rtrh.projects.modules.projects.enums.ProjectStatusEnum;
|
|
|
import com.rtrh.projects.modules.projects.enums.SubInfoStatusEnum;
|
|
|
import com.rtrh.projects.modules.projects.po.*;
|
|
|
import com.rtrh.projects.modules.projects.service.*;
|
|
|
-import com.rtrh.projects.modules.projects.vo.LogOperateVO;
|
|
|
-import com.rtrh.projects.modules.projects.vo.StatusChangeCountersVO;
|
|
|
-import com.rtrh.projects.modules.projects.vo.SubInfoTotalExcel;
|
|
|
+import com.rtrh.projects.modules.projects.vo.*;
|
|
|
import com.rtrh.projects.modules.projects.vo.export.*;
|
|
|
+import com.rtrh.projects.modules.system.enums.SysTableKind;
|
|
|
+import com.rtrh.projects.modules.system.po.TSystable;
|
|
|
import com.rtrh.projects.modules.system.service.ISubInduService;
|
|
|
+import com.rtrh.projects.modules.system.service.TSysTableService;
|
|
|
import com.rtrh.projects.modules.utils.CustomCellWriteWidthStrategy;
|
|
|
import com.rtrh.projects.modules.utils.DateUtils;
|
|
|
import com.rtrh.projects.modules.utils.MyStringUtils;
|
|
|
import com.rtrh.projects.modules.utils.QualificationsDeclareCellWriteHandler;
|
|
|
-//import com.rtrh.projects.modules.utils.StringUtils;
|
|
|
import com.rtrh.projects.outapi.result.JsonResult;
|
|
|
+import com.rtrh.projects.web.controller.BaseController;
|
|
|
import com.rtrh.projects.web.log.Log;
|
|
|
import com.rtrh.projects.web.log.WebLogAspect;
|
|
|
import com.rtrh.projects.web.util.ExcelStyleUtil;
|
|
@@ -63,23 +59,25 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
-import com.rtrh.common.util.CollectionUtil;
|
|
|
-import com.rtrh.core.repository.Page;
|
|
|
-import com.rtrh.projects.modules.projects.vo.SubInfoQueryTzVO;
|
|
|
-import com.rtrh.projects.modules.system.enums.SysTableKind;
|
|
|
-import com.rtrh.projects.modules.system.po.TSystable;
|
|
|
-import com.rtrh.projects.modules.system.service.TSysTableService;
|
|
|
-import com.rtrh.projects.web.controller.BaseController;
|
|
|
-
|
|
|
-import cn.afterturn.easypoi.entity.BaseTypeConstants;
|
|
|
-import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
|
-import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
|
|
-import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
|
|
-import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
|
|
-import cn.hutool.core.net.URLEncodeUtil;
|
|
|
+import javax.servlet.ServletOutputStream;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.InputStream;
|
|
|
+import java.io.OutputStream;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
+import java.net.URLEncoder;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
+import java.util.concurrent.atomic.AtomicReference;
|
|
|
+import java.util.function.Function;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 项目信息导出功能
|
|
@@ -110,6 +108,8 @@ public class SubInfoExportController extends BaseController {
|
|
|
private SubPreNewService subPreNewService;
|
|
|
@Autowired
|
|
|
private SubRptContService subRptContService;
|
|
|
+ @Autowired
|
|
|
+ private ISubHisService subHisService;
|
|
|
|
|
|
/**
|
|
|
* 导出汇总表
|
|
@@ -1345,45 +1345,48 @@ public class SubInfoExportController extends BaseController {
|
|
|
data.put("hyStr", hyStr);
|
|
|
|
|
|
// 一、项目转化情况
|
|
|
+ // 查询上月和当前所有项目的状态 用于计算开工率,增长百分点等
|
|
|
+ List<SubHisVO> subHisList = subHisService.queryByMonth(DateUtil.format(DateUtil.offset(new Date(), DateField.MONTH, -1), "yyyyMM"));
|
|
|
+ List<SubInfoGxj> currSubInfoList = subInfoService.queryStatistics(vo);
|
|
|
+
|
|
|
List<LogOperateVO> logList = logOperateService.queryByYear(year);
|
|
|
- StatusChangeCountersVO totalCounterVo = new StatusChangeCountersVO();
|
|
|
- addNum(logList, totalCounterVo);
|
|
|
- data.put("cbToXjNum", totalCounterVo.cbToXjNum);
|
|
|
- data.put("xjToZjNum", totalCounterVo.xjToZjNum);
|
|
|
- data.put("zjToTcNum", totalCounterVo.zjToTcNum);
|
|
|
- data.put("tcToRgNum", totalCounterVo.tcToRgNum);
|
|
|
- data.put("xjToCbNum", totalCounterVo.xjToCbNum);
|
|
|
- data.put("rgToZjNum", totalCounterVo.rgToZjNum);
|
|
|
-
|
|
|
- List<LogOperateVO> lastLogList = logList.stream().filter(logOperate -> DateUtil.month(logOperate.getCreateTime()) < DateUtil.month(new Date())).collect(Collectors.toList());
|
|
|
- StatusChangeCountersVO lastCounterVo = new StatusChangeCountersVO();
|
|
|
- addNum(lastLogList, lastCounterVo);
|
|
|
- data.put("lastCbToXjNum", lastCounterVo.cbToXjNum);
|
|
|
- data.put("lastXjToZjNum", lastCounterVo.xjToZjNum);
|
|
|
- data.put("lastZjToTcNum", lastCounterVo.zjToTcNum);
|
|
|
- data.put("lastTcToRgNum", lastCounterVo.tcToRgNum);
|
|
|
- data.put("lastXjToCbNum", lastCounterVo.xjToCbNum);
|
|
|
- data.put("lastRgToZjNum", lastCounterVo.rgToZjNum);
|
|
|
-
|
|
|
-
|
|
|
- String text = "%s年1-%s月,%s储备项目转新建%s个、新建项目转在建%s个、在建项目转投产%s个、投产项目转入规%s个,新建项目降级为储备%s个、入规项目转为在建%s个。" +
|
|
|
- "其中,%s月当月,储备项目转新建%s个、新建项目转在建%s个、在建项目转投产%s个、投产项目转入规%s个,新建项目降级为储备%s个、入规项目转为在建%s个。" +
|
|
|
- "1-%s月,项目开工率%s、投产率%s、入规率%s,较1-(%s)月,分别增长%s、%s、%s个百分点。";
|
|
|
+ String preText = String.format("%s年1-%s月,", year, month);
|
|
|
+ StringBuilder s = buildZhParagraph(preText, logList, month,lastMonth,subHisList,currSubInfoList);
|
|
|
+ data.put("mainZhStr", s);
|
|
|
+
|
|
|
// 分属地看
|
|
|
+ Map<String, List<SubHisVO>> hisSubjectGroups = subHisList.stream().collect(Collectors.groupingBy(SubHisVO::getSubjectId));
|
|
|
+ Map<String, List<SubInfoGxj>> currSubjectGroups = currSubInfoList.stream().collect(Collectors.groupingBy(SubInfoGxj::getSubjectId));
|
|
|
Map<String, List<LogOperateVO>> subjectZhGroups = logList.stream().collect(Collectors.groupingBy(LogOperateVO::getSubjectId));
|
|
|
StringBuilder subjectZhStr = new StringBuilder();
|
|
|
subjectZhGroups.forEach((key, value) -> {
|
|
|
- StatusChangeCountersVO tempVo = new StatusChangeCountersVO();
|
|
|
- addNum(value, tempVo);
|
|
|
- subjectZhStr.append(String.format(text,
|
|
|
- year, month, jsddMap.get(key), tempVo.cbToXjNum, tempVo.xjToZjNum, tempVo.zjToTcNum, tempVo.tcToRgNum, tempVo.xjToCbNum, tempVo.rgToZjNum,
|
|
|
- month, tempVo.cbToXjNum, tempVo.xjToZjNum, tempVo.zjToTcNum, tempVo.tcToRgNum, tempVo.xjToCbNum, tempVo.rgToZjNum,
|
|
|
- month, "0%", "0%", "0%", lastMonth, "0", "0", "0"));
|
|
|
- subjectZhStr.append("\n").append("\t");
|
|
|
+ String tempPreText = String.format("%s年1-%s月,%s", year, month, jsddMap.get(key));
|
|
|
+ StringBuilder s1 = buildZhParagraph(tempPreText, value, month, lastMonth, hisSubjectGroups.getOrDefault(key,new ArrayList<>()), currSubjectGroups.getOrDefault(key,new ArrayList<>()));
|
|
|
+ subjectZhStr.append(s1);
|
|
|
});
|
|
|
data.put("subjectZhStr", subjectZhStr);
|
|
|
|
|
|
// 分规模看
|
|
|
+ Map<String, List<SubHisVO>> hisScaleGroups = subHisList.stream()
|
|
|
+ .collect(Collectors.groupingBy(transaction -> {
|
|
|
+ for (Map.Entry<String, BigDecimal> entry : groupBoundaries.entrySet()) {
|
|
|
+ if (transaction.getAmtTotal().compareTo(entry.getValue()) < 0) {
|
|
|
+ return entry.getKey();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "100亿元以上";
|
|
|
+ })
|
|
|
+ );
|
|
|
+ Map<String, List<SubInfoGxj>> currScaleGroups = currSubInfoList.stream()
|
|
|
+ .collect(Collectors.groupingBy(transaction -> {
|
|
|
+ for (Map.Entry<String, BigDecimal> entry : groupBoundaries.entrySet()) {
|
|
|
+ if (transaction.getAmtTotal().compareTo(entry.getValue()) < 0) {
|
|
|
+ return entry.getKey();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "100亿元以上";
|
|
|
+ })
|
|
|
+ );
|
|
|
Map<String, List<LogOperateVO>> scaleZhGroups = logList.stream().collect(Collectors.groupingBy(transaction -> {
|
|
|
for (Map.Entry<String, BigDecimal> entry : groupBoundaries.entrySet()) {
|
|
|
if (transaction.getAmtTotal().compareTo(entry.getValue()) < 0) {
|
|
@@ -1394,18 +1397,31 @@ public class SubInfoExportController extends BaseController {
|
|
|
}));
|
|
|
StringBuilder scaleZhStr = new StringBuilder();
|
|
|
scaleZhGroups.forEach((key, value) -> {
|
|
|
- StatusChangeCountersVO tempVo = new StatusChangeCountersVO();
|
|
|
- addNum(value, tempVo);
|
|
|
- scaleZhStr.append(String.format(text,
|
|
|
- year, month, "计划总投资" + key, tempVo.cbToXjNum, tempVo.xjToZjNum, tempVo.zjToTcNum, tempVo.tcToRgNum, tempVo.xjToCbNum, tempVo.rgToZjNum,
|
|
|
- month, tempVo.cbToXjNum, tempVo.xjToZjNum, tempVo.zjToTcNum, tempVo.tcToRgNum, tempVo.xjToCbNum, tempVo.rgToZjNum,
|
|
|
- month, "0%", "0%", "0%", lastMonth, "0", "0", "0"
|
|
|
- ));
|
|
|
- scaleZhStr.append("\n").append("\t");
|
|
|
+ String tempPreText = String.format("%s年1-%s月,%s", year, month, "计划总投资" + key);
|
|
|
+ StringBuilder s1 = buildZhParagraph(tempPreText, value, month, lastMonth, hisScaleGroups.getOrDefault(key,CollUtil.newArrayList()), currScaleGroups.getOrDefault(key,CollUtil.newArrayList()));
|
|
|
+ scaleZhStr.append(s1);
|
|
|
});
|
|
|
data.put("scaleZhStr", scaleZhStr);
|
|
|
|
|
|
// 分行业看
|
|
|
+ Map<String, List<SubHisVO>> hisHyGroups = subHisList.stream()
|
|
|
+ .collect(Collectors.groupingBy(transaction -> {
|
|
|
+ String code = transaction.getIndusKind();
|
|
|
+ // 确保code不为空且长度至少为2
|
|
|
+ if (code == null || code.length() < 2) {
|
|
|
+ return "未知行业"; // 默认未知行业
|
|
|
+ }
|
|
|
+ return code.substring(0, 2);
|
|
|
+ }));
|
|
|
+ Map<String, List<SubInfoGxj>> currHyGroups = currSubInfoList.stream()
|
|
|
+ .collect(Collectors.groupingBy(transaction -> {
|
|
|
+ String code = transaction.getIndusKind();
|
|
|
+ // 确保code不为空且长度至少为2
|
|
|
+ if (code == null || code.length() < 2) {
|
|
|
+ return "未知行业"; // 默认未知行业
|
|
|
+ }
|
|
|
+ return code.substring(0, 2);
|
|
|
+ }));
|
|
|
Map<String, List<LogOperateVO>> hyZhGroups = logList.stream()
|
|
|
.collect(Collectors.groupingBy(transaction -> {
|
|
|
String code = transaction.getIndusKind();
|
|
@@ -1417,16 +1433,12 @@ public class SubInfoExportController extends BaseController {
|
|
|
}));
|
|
|
StringBuilder hyZhStr = new StringBuilder();
|
|
|
hyZhGroups.forEach((key, value) -> {
|
|
|
- StatusChangeCountersVO tempVo = new StatusChangeCountersVO();
|
|
|
- addNum(value, tempVo);
|
|
|
- hyZhStr.append(String.format(text,
|
|
|
- year, month, hyflMap.get(key), tempVo.cbToXjNum, tempVo.xjToZjNum, tempVo.zjToTcNum, tempVo.tcToRgNum, tempVo.xjToCbNum, tempVo.rgToZjNum,
|
|
|
- month, tempVo.cbToXjNum, tempVo.xjToZjNum, tempVo.zjToTcNum, tempVo.tcToRgNum, tempVo.xjToCbNum, tempVo.rgToZjNum,
|
|
|
- month, "0%", "0%", "0%", lastMonth, "0", "0", "0"
|
|
|
- ));
|
|
|
- hyZhStr.append("\n").append("\t");
|
|
|
+ String tempPreText = String.format("%s年1-%s月,%s", year, month, hyflMap.get(key));
|
|
|
+ StringBuilder s1 = buildZhParagraph(tempPreText, value, month,lastMonth, hisHyGroups.getOrDefault(key,CollUtil.newArrayList()), currHyGroups.getOrDefault(key,CollUtil.newArrayList()));
|
|
|
+ scaleZhStr.append(s1);
|
|
|
});
|
|
|
data.put("hyZhStr", hyZhStr);
|
|
|
+
|
|
|
// 二、存在问题
|
|
|
// (一)项目落地方面
|
|
|
data.put("xmldSubNameStr", "、、");
|
|
@@ -1451,16 +1463,6 @@ public class SubInfoExportController extends BaseController {
|
|
|
data.put("sgrtCqNum", 0);
|
|
|
data.put("sgrtZlzhNames", "、、");
|
|
|
data.put("sgrtZlzhNum", 0);
|
|
|
-
|
|
|
- // Map<String, List<LogOperate>> collect = logList.stream().collect(Collectors.groupingBy(LogOperate::getTitle));
|
|
|
- // String currentYearZhStr = buildZhData(collect);
|
|
|
- // data.put("currentYearZhStr", currentYearZhStr);
|
|
|
- // Map<String, List<LogOperate>> collect1 = logList.stream().filter(item -> DateUtil.month(item.getZhDate()) == DateUtil.month(new Date())).collect(Collectors.groupingBy(LogOperate::getTitle));
|
|
|
- // String currentMonthZhStr = buildZhData(collect1);
|
|
|
- // data.put("currentMonthZhStr", currentMonthZhStr);
|
|
|
- // 开工率 = (在建+投产)/(在建+投产+新建)
|
|
|
- // 投产率 = (投产)/(在建+投产+新建)
|
|
|
- // 入规率 = 入规/(在建+投产+新建)
|
|
|
}
|
|
|
|
|
|
WordExportUtil.exportWord07(word, data);
|
|
@@ -1470,6 +1472,64 @@ public class SubInfoExportController extends BaseController {
|
|
|
word.write(response.getOutputStream());
|
|
|
}
|
|
|
|
|
|
+ private StringBuilder buildZhParagraph(String preText, List<LogOperateVO> value, int month,int lastMonth, List<SubHisVO> subHisVOList, List<SubInfoGxj> subInfoGxjList) {
|
|
|
+ StringBuilder zhStrBuilder = new StringBuilder().append("\t");
|
|
|
+ StatusChangeCountersVO tempVo = new StatusChangeCountersVO();
|
|
|
+ addNum(value, tempVo);
|
|
|
+ List<LogOperateVO> currList = value.stream().filter(logOperate -> DateUtil.month(logOperate.getCreateTime()) == DateUtil.month(new Date())).collect(Collectors.toList());
|
|
|
+ StatusChangeCountersVO currTempVo = new StatusChangeCountersVO();
|
|
|
+ addNum(currList, currTempVo);
|
|
|
+
|
|
|
+ String mainText = String.format("储备项目转新建%s个、新建项目转在建%s个、在建项目转投产%s个、投产项目转入规%s个,新建项目降级为储备%s个、入规项目转为在建%s个。" +
|
|
|
+ "其中,%s月当月,储备项目转新建%s个、新建项目转在建%s个、在建项目转投产%s个、投产项目转入规%s个,新建项目降级为储备%s个、入规项目转为在建%s个。 "
|
|
|
+ , tempVo.cbToXjNum, tempVo.xjToZjNum, tempVo.zjToTcNum, tempVo.tcToRgNum, tempVo.xjToCbNum, tempVo.rgToZjNum,
|
|
|
+ month, currTempVo.cbToXjNum, currTempVo.xjToZjNum, currTempVo.zjToTcNum, currTempVo.tcToRgNum, currTempVo.xjToCbNum, currTempVo.rgToZjNum
|
|
|
+ );
|
|
|
+ // 开工率 = (在建+投产)/(在建+投产+新建)
|
|
|
+ // 投产率 = (投产)/(在建+投产+新建)
|
|
|
+ // 入规率 = 入规/(在建+投产+新建)
|
|
|
+ AtomicReference<Long> rgNum = new AtomicReference<>(0L);
|
|
|
+ Map<String, Long> collect = subInfoGxjList.stream()
|
|
|
+ .peek(subInfoGxj -> {
|
|
|
+ if (subInfoGxj.getBoolRg()){
|
|
|
+ rgNum.set(rgNum.get() + 1);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .collect(Collectors.groupingBy(SubInfoGxj::getStatus, Collectors.counting()));
|
|
|
+ Long xjNum = collect.getOrDefault(SubInfoStatusEnum.XJ.getCode(), 0L);
|
|
|
+ Long zjNum = collect.getOrDefault(SubInfoStatusEnum.ZJ.getCode(), 0L);
|
|
|
+ Long tcNum = collect.getOrDefault(SubInfoStatusEnum.TC.getCode(), 0L);
|
|
|
+ BigDecimal fm = new BigDecimal(xjNum + zjNum + tcNum);
|
|
|
+ BigDecimal kgl = BigDecimal.ZERO;
|
|
|
+ BigDecimal tcl = BigDecimal.ZERO;
|
|
|
+ BigDecimal rgl = BigDecimal.ZERO;
|
|
|
+ if (fm.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ kgl = new BigDecimal((zjNum + tcNum) * 100).divide(fm, 2, RoundingMode.HALF_UP);
|
|
|
+ tcl = new BigDecimal(tcNum * 100).divide(fm, 2, RoundingMode.HALF_UP);
|
|
|
+ rgl = new BigDecimal(rgNum.get() * 100).divide(fm, 2, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Long> statusNumMap = subHisVOList.stream().collect(Collectors.groupingBy(SubHisVO::getStatus, Collectors.counting()));
|
|
|
+ Long lastXjNum = statusNumMap.getOrDefault(SubInfoStatusEnum.XJ.getCode(), 0L);
|
|
|
+ Long lastZjNum = statusNumMap.getOrDefault(SubInfoStatusEnum.ZJ.getCode(), 0L);
|
|
|
+ Long lastTcNum = statusNumMap.getOrDefault(SubInfoStatusEnum.TC.getCode(), 0L);
|
|
|
+ Long lastRgNum = statusNumMap.getOrDefault("r", 0L);
|
|
|
+ BigDecimal lastFm = new BigDecimal(lastXjNum + lastZjNum + lastTcNum);
|
|
|
+ BigDecimal lastKgl = BigDecimal.ZERO;
|
|
|
+ BigDecimal lastTcl = BigDecimal.ZERO;
|
|
|
+ BigDecimal lastRgl = BigDecimal.ZERO;
|
|
|
+ if (lastFm.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ lastKgl = new BigDecimal((lastZjNum + lastTcNum) * 100).divide(lastFm, 2, RoundingMode.HALF_UP);
|
|
|
+ lastTcl = new BigDecimal(lastTcNum * 100).divide(lastFm, 2, RoundingMode.HALF_UP);
|
|
|
+ lastRgl = new BigDecimal(lastRgNum * 100).divide(lastFm, 2, RoundingMode.HALF_UP);
|
|
|
+
|
|
|
+ }
|
|
|
+ String postText = String.format("1-%s月,项目开工率%s、投产率%s、入规率%s,较1-(%s)月,分别增长%s、%s、%s个百分点。",
|
|
|
+ month, kgl + "%", tcl + "%", rgl + "%", lastMonth, kgl.subtract(lastKgl), tcl.subtract(lastTcl), rgl.subtract(lastRgl));
|
|
|
+
|
|
|
+ return zhStrBuilder.append(preText).append(mainText).append(postText).append("\n");
|
|
|
+ }
|
|
|
+
|
|
|
private void addNum(List<LogOperateVO> lastLogList, StatusChangeCountersVO vo) {
|
|
|
for (LogOperate logOperate : lastLogList) {
|
|
|
if (SubInfoStatusEnum.CB.getCode().equals(logOperate.getStatusFirst()) && SubInfoStatusEnum.XJ.getCode().equals(logOperate.getStatusAfter())) {
|