|
@@ -5,7 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
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;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
+import lombok.Data;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
+import org.jsoup.Jsoup;
|
|
|
|
+import org.jsoup.nodes.Document;
|
|
|
|
+import org.jsoup.nodes.Element;
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
@@ -17,13 +21,14 @@ import org.springblade.core.tool.utils.ResourceUtil;
|
|
import org.springblade.land.dto.SettlementIntervalDTO;
|
|
import org.springblade.land.dto.SettlementIntervalDTO;
|
|
import org.springblade.land.entity.*;
|
|
import org.springblade.land.entity.*;
|
|
import org.springblade.land.mapper.ClearingAgreementInfoMapper;
|
|
import org.springblade.land.mapper.ClearingAgreementInfoMapper;
|
|
|
|
+import org.springblade.land.mapper.CompensationInfoMapper;
|
|
import org.springblade.land.mapper.SettlementIntervalMapper;
|
|
import org.springblade.land.mapper.SettlementIntervalMapper;
|
|
-import org.springblade.land.service.IAgreementLinkTableService;
|
|
|
|
-import org.springblade.land.service.IClearingAgreementInfoService;
|
|
|
|
-import org.springblade.land.service.ICompensationInfoService;
|
|
|
|
-import org.springblade.land.service.ISettlementIntervalService;
|
|
|
|
|
|
+import org.springblade.land.service.*;
|
|
import org.springblade.land.utils.FileUtils;
|
|
import org.springblade.land.utils.FileUtils;
|
|
import org.springblade.land.vo.AreaPictureVO;
|
|
import org.springblade.land.vo.AreaPictureVO;
|
|
|
|
+import org.springblade.land.vo.ClearingAgreementInfoVO;
|
|
|
|
+import org.springblade.land.vo.TableDataVO;
|
|
|
|
+import org.springblade.manager.entity.WbsFormElement;
|
|
import org.springblade.manager.entity.WbsTreePrivate;
|
|
import org.springblade.manager.entity.WbsTreePrivate;
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -32,8 +37,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -41,11 +46,14 @@ import java.util.stream.Collectors;
|
|
public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAgreementInfoMapper, ClearingAgreementInfo> implements IClearingAgreementInfoService {
|
|
public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAgreementInfoMapper, ClearingAgreementInfo> implements IClearingAgreementInfoService {
|
|
|
|
|
|
private final ICompensationInfoService compensationInfoService;
|
|
private final ICompensationInfoService compensationInfoService;
|
|
|
|
+ private final CompensationInfoMapper compensationInfoMapper;
|
|
private final IAgreementLinkTableService linkTableService;
|
|
private final IAgreementLinkTableService linkTableService;
|
|
private final NewIOSSClient newIOSSClient;
|
|
private final NewIOSSClient newIOSSClient;
|
|
|
|
+ private final IRegionTreeInfoService treeInfoService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 新增或修改结算协议
|
|
* 新增或修改结算协议
|
|
|
|
+ *
|
|
* @param info
|
|
* @param info
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
@@ -53,7 +61,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
public void add(ClearingAgreementInfo info) throws Exception {
|
|
public void add(ClearingAgreementInfo info) throws Exception {
|
|
//修改选择的补偿协议的引用状态
|
|
//修改选择的补偿协议的引用状态
|
|
String agreementIds = info.getAgreementIds();
|
|
String agreementIds = info.getAgreementIds();
|
|
- if (StringUtils.isBlank(agreementIds)){
|
|
|
|
|
|
+ if (StringUtils.isBlank(agreementIds)) {
|
|
throw new ServiceException("请选择补偿协议");
|
|
throw new ServiceException("请选择补偿协议");
|
|
}
|
|
}
|
|
//是新增还是修改
|
|
//是新增还是修改
|
|
@@ -82,14 +90,15 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
linkTableService.saveBatch(linkTables);
|
|
linkTableService.saveBatch(linkTables);
|
|
info.setId(agreeId);
|
|
info.setId(agreeId);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
|
|
+ //存在则直接获取所有结算表单
|
|
linkTables = linkTableService.getByAgreementId(info.getId());
|
|
linkTables = linkTableService.getByAgreementId(info.getId());
|
|
//修改则先还原之前补偿协议的状态
|
|
//修改则先还原之前补偿协议的状态
|
|
ClearingAgreementInfo agreementInfo = this.getById(info.getId());
|
|
ClearingAgreementInfo agreementInfo = this.getById(info.getId());
|
|
- compensationInfoService.batchUpdateStatus(Func.toLongList(agreementInfo.getAgreementIds()),0);
|
|
|
|
|
|
+ compensationInfoService.batchUpdateStatus(Func.toLongList(agreementInfo.getAgreementIds()), 0);
|
|
}
|
|
}
|
|
//批量修改选中的状态
|
|
//批量修改选中的状态
|
|
- compensationInfoService.batchUpdateStatus(ids,1);
|
|
|
|
|
|
+ compensationInfoService.batchUpdateStatus(ids, 1);
|
|
//获取所有选中的补偿协议
|
|
//获取所有选中的补偿协议
|
|
List<CompensationInfo> compensationInfos = compensationInfoService.listByIds(ids);
|
|
List<CompensationInfo> compensationInfos = compensationInfoService.listByIds(ids);
|
|
//统计补偿协议的统计字段
|
|
//统计补偿协议的统计字段
|
|
@@ -103,45 +112,264 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
allCount = allCount.add(fo.getAllMoney());
|
|
allCount = allCount.add(fo.getAllMoney());
|
|
}
|
|
}
|
|
//名称拼接
|
|
//名称拼接
|
|
- str.append(fo.getName()+"、");
|
|
|
|
|
|
+ str.append(fo.getName() + "、");
|
|
}
|
|
}
|
|
info.setAgreementMoney(allCount);
|
|
info.setAgreementMoney(allCount);
|
|
String names = str.toString();
|
|
String names = str.toString();
|
|
- if (StringUtils.isNotBlank(names)){
|
|
|
|
- info.setName(names.substring(0, names.length() - 1)+"结算");
|
|
|
|
- }else {
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(names)) {
|
|
|
|
+ info.setName(names.substring(0, names.length() - 1) + "结算");
|
|
|
|
+ } else {
|
|
info.setName("未找到用户名称");
|
|
info.setName("未找到用户名称");
|
|
}
|
|
}
|
|
if (isAdd) {
|
|
if (isAdd) {
|
|
this.save(info);
|
|
this.save(info);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
this.updateById(info);
|
|
this.updateById(info);
|
|
}
|
|
}
|
|
//循环结算协议的统计字段,把补偿协议统计出来的字段设置到结算协议
|
|
//循环结算协议的统计字段,把补偿协议统计出来的字段设置到结算协议
|
|
//生成封面
|
|
//生成封面
|
|
|
|
+ buildPdf1(linkTables.get(0), info.getStage());
|
|
//生成补偿结算表
|
|
//生成补偿结算表
|
|
|
|
+ buildPdf2(linkTables.get(1),info.getAreaId());
|
|
//生成补偿费发放统计表
|
|
//生成补偿费发放统计表
|
|
|
|
+ buildPdf3(linkTables.get(2),ids);
|
|
//生成补偿费明细表
|
|
//生成补偿费明细表
|
|
//生成补偿资金数量分配表
|
|
//生成补偿资金数量分配表
|
|
//生成面积统计明细表
|
|
//生成面积统计明细表
|
|
//合并PDF
|
|
//合并PDF
|
|
// try {
|
|
// try {
|
|
- this.mergePdfs(info.getId());
|
|
|
|
|
|
+ this.mergePdfs(info.getId());
|
|
// }catch (Exception e){
|
|
// }catch (Exception e){
|
|
// throw new ServiceException("合并PDF失败");
|
|
// throw new ServiceException("合并PDF失败");
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void buildPdf3(AgreementLinkTable linkTable,List<Long> ids) {
|
|
|
|
+ try {
|
|
|
|
+ List<WbsFormElement> list = baseMapper.getTableElement(linkTable.getTableId());
|
|
|
|
+ Map<String, Object> DataInfo = new HashMap<>();
|
|
|
|
+ //获取所有的补偿协议映射表中的发放表
|
|
|
|
+ List<AgreementLinkTable> assignTable = baseMapper.getAllAssignTable(ids, "发放表");
|
|
|
|
+ List<Long> longs = assignTable.stream().map(l -> l.getTableDataId()).collect(Collectors.toList());
|
|
|
|
+ //获取发放表的配置
|
|
|
|
+ List<WbsFormElement> dataElements = baseMapper.getTableElement(assignTable.get(0).getTableId());
|
|
|
|
+ if (dataElements == null || dataElements.size() == 0){
|
|
|
|
+ compensationInfoService.getBussPdfInfo(linkTable.getId(), DataInfo);
|
|
|
|
+ }
|
|
|
|
+ Map<String, Integer> dataMap = dataElements.stream().collect(Collectors.toMap(WbsFormElement::getEKey, WbsFormElement::getDynamicDict));
|
|
|
|
+ //获取所有补偿费发放表中的数据
|
|
|
|
+ List<TableDataVO> dataVOS = compensationInfoMapper.getBussDataInfoByDataIds(longs);
|
|
|
|
+ dataVOS = dataVOS.stream().filter(l -> dataMap.get(l.getDictKey()) != null).collect(Collectors.toList());
|
|
|
|
+ if (dataVOS.size() == 0){
|
|
|
|
+ compensationInfoService.getBussPdfInfo(linkTable.getId(), DataInfo);
|
|
|
|
+ }
|
|
|
|
+ dataVOS.stream().forEach(l->l.setDictValue(dataMap.get(l.getDictKey())));
|
|
|
|
+ Map<Integer, List<TableDataVO>> listMap = dataVOS.stream().collect(Collectors.groupingBy(TableDataVO::getDictValue));
|
|
|
|
+
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
+ //字典为key,位置为value
|
|
|
|
+ Map<Integer, String> elementMap = list.stream().collect(Collectors.toMap(WbsFormElement::getDynamicDict, WbsFormElement::getEKey));
|
|
|
|
+ //位置为key,字典为value
|
|
|
|
+ Map<String, Integer> overMap = list.stream().collect(Collectors.toMap(WbsFormElement::getEKey, WbsFormElement::getDynamicDict));
|
|
|
|
+ //解析html获取所以实际的key
|
|
|
|
+ Document doc = Jsoup.parse(new File(linkTable.getHtmlUrl()), "utf-8");
|
|
|
|
+// Document doc = Jsoup.parse(new File("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1704076712393834496.html"), "utf-8");
|
|
|
|
+ Element table = doc.select("table").first();
|
|
|
|
+ //此表key重复,直接获取所有
|
|
|
|
+ List<TableDataVO> allKey = table.getElementsByAttribute("id").stream().map(l -> {
|
|
|
|
+ TableDataVO vo = new TableDataVO();
|
|
|
|
+ String s = l.attr("id");
|
|
|
|
+ vo.setTabKey(s);
|
|
|
|
+ if (s.contains("__")) {
|
|
|
|
+ String[] s1 = s.split("__");
|
|
|
|
+ vo.setDictKey(s1[0]);
|
|
|
|
+ String[] s2 = s1[1].split("_");
|
|
|
|
+ vo.setDictRow(Integer.parseInt(s2[0]));
|
|
|
|
+ }
|
|
|
|
+ return vo;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ allKey = allKey.stream().filter(l -> overMap.get(l.getDictKey()) != null).collect(Collectors.toList());
|
|
|
|
+ if (allKey.size() == 0){
|
|
|
|
+ compensationInfoService.getBussPdfInfo(linkTable.getId(), DataInfo);
|
|
|
|
+ }
|
|
|
|
+ allKey.stream().forEach(l->l.setDictValue(overMap.get(l.getDictKey())));
|
|
|
|
+ Map<Integer, List<TableDataVO>> listMap2 = allKey.stream().collect(Collectors.groupingBy(TableDataVO::getDictValue));
|
|
|
|
+ //重复key的字典
|
|
|
|
+ List<Integer> batchKey = Arrays.asList(4, 5, 10, 11);
|
|
|
|
+ //统计补偿总和
|
|
|
|
+ BigDecimal big = new BigDecimal(0);
|
|
|
|
+ for (Integer dict : elementMap.keySet()) {
|
|
|
|
+ if (batchKey.contains(dict)) {
|
|
|
|
+ //取出数据集合
|
|
|
|
+ List<TableDataVO> voList = listMap.get(dict);
|
|
|
|
+ //重置数据顺序,先按表单分组,再按照行顺序重新装入集合
|
|
|
|
+ Map<Long, List<TableDataVO>> map = voList.stream().collect(Collectors.groupingBy(TableDataVO::getPKeyId));
|
|
|
|
+ List<Long> collect = map.keySet().stream().sorted().collect(Collectors.toList());
|
|
|
|
+ List<Object> data = new ArrayList<>();
|
|
|
|
+ for (Long aLong : collect) {
|
|
|
|
+ List<TableDataVO> vos = map.get(aLong);
|
|
|
|
+ data.addAll(vos.stream().sorted(Comparator.comparing(TableDataVO::getDictRow)).map(l -> l.getTabVal()).collect(Collectors.toList()));
|
|
|
|
+ }
|
|
|
|
+ //取出位置集合
|
|
|
|
+ List<TableDataVO> voList2 = listMap2.get(dict);
|
|
|
|
+ List<String> keys = new ArrayList<>();
|
|
|
|
+ keys.addAll(voList2.stream().sorted(Comparator.comparing(TableDataVO::getDictRow)).map(l -> l.getTabKey()).collect(Collectors.toList()));
|
|
|
|
+ //重置key位置,按照行从小到大
|
|
|
|
+ //!!暂时没判断多页,到时候要分隔集合
|
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
|
+ DataInfo.put(keys.get(i), data.get(i));
|
|
|
|
+ if (dict == 5) {
|
|
|
|
+ big = big.add(new BigDecimal(data.get(i) + ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (Integer dict : elementMap.keySet()) {
|
|
|
|
+ if (!batchKey.contains(dict)) {
|
|
|
|
+ TableDataVO vo = listMap2.get(dict).get(0);
|
|
|
|
+ switch (dict) {
|
|
|
|
+ case 20:
|
|
|
|
+ //合计补偿总计
|
|
|
|
+ DataInfo.put(vo.getTabKey(), big);
|
|
|
|
+ break;
|
|
|
|
+ case 300:
|
|
|
|
+ //统计员
|
|
|
|
+ DataInfo.put(vo.getTabKey(), "王文");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ compensationInfoService.getBussPdfInfo(linkTable.getId(), DataInfo);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ServiceException("补偿费发放统计表生成失败");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void buildPdf2(AgreementLinkTable linkTable,Long areaId) {
|
|
|
|
+ List<WbsFormElement> list = baseMapper.getTableElement(linkTable.getTableId());
|
|
|
|
+ Map<String, Object> DataInfo = new HashMap<>();
|
|
|
|
+ try {
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
+ //字典为key,位置为value
|
|
|
|
+ Map<Integer, String> elementMap = list.stream().collect(Collectors.toMap(WbsFormElement::getDynamicDict, WbsFormElement::getEKey));
|
|
|
|
+ //解析html获取所以实际的key
|
|
|
|
+ Document doc = Jsoup.parse(new File(linkTable.getHtmlUrl()), "utf-8");
|
|
|
|
+// Document doc = Jsoup.parse(new File("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1711593963032412160.html"), "utf-8");
|
|
|
|
+ Element table = doc.select("table").first();
|
|
|
|
+ //因为此表的key不会重复,所以直接转map
|
|
|
|
+ Map<String,String> tableKeys = new HashMap<>();
|
|
|
|
+ table.getElementsByAttribute("id").stream().forEach(l -> {
|
|
|
|
+ String s = l.attr("id");
|
|
|
|
+ if (s.contains("__")) {
|
|
|
|
+ String[] s1 = s.split("__");
|
|
|
|
+ tableKeys.put(s1[0], s);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ for (Integer dict : elementMap.keySet()) {
|
|
|
|
+ String s1 = tableKeys.get(elementMap.get(dict));
|
|
|
|
+ switch (dict){
|
|
|
|
+ case 99:
|
|
|
|
+ //当天日期
|
|
|
|
+ DataInfo.put(s1,LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日")));
|
|
|
|
+ break;
|
|
|
|
+ case 200:
|
|
|
|
+ //申请单位
|
|
|
|
+ DataInfo.put(s1,"重庆申请单位");
|
|
|
|
+ break;
|
|
|
|
+ case 201:
|
|
|
|
+ //申请次数
|
|
|
|
+ DataInfo.put(s1,5);
|
|
|
|
+ break;
|
|
|
|
+ case 202:
|
|
|
|
+ //被征收土地桩号
|
|
|
|
+ RegionTreeInfo treeInfo = treeInfoService.getById(areaId);
|
|
|
|
+ if (StringUtils.isBlank(treeInfo.getStakeMark())){
|
|
|
|
+ DataInfo.put(s1,"当前区域未配置桩号");
|
|
|
|
+ }else {
|
|
|
|
+ DataInfo.put(s1, treeInfo.getStakeMark());
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 203:
|
|
|
|
+ //被征收土地单位
|
|
|
|
+ DataInfo.put(s1,"重庆被征收单位");
|
|
|
|
+ break;
|
|
|
|
+ case 204:
|
|
|
|
+ //本期补偿金额
|
|
|
|
+ DataInfo.put(s1,"9000");
|
|
|
|
+ break;
|
|
|
|
+ case 205:
|
|
|
|
+ //累计补偿金额
|
|
|
|
+ DataInfo.put(s1,"15000");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ compensationInfoService.getBussPdfInfo(linkTable.getId(), DataInfo);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ServiceException("补偿结算表生成失败");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 生成封面
|
|
|
|
+ *
|
|
|
|
+ * @param linkTable 表单信息
|
|
|
|
+ * @param stage 第几期
|
|
|
|
+ */
|
|
|
|
+ private void buildPdf1(AgreementLinkTable linkTable, String stage) {
|
|
|
|
+ List<WbsFormElement> list = baseMapper.getTableElement(linkTable.getTableId());
|
|
|
|
+ Map<String, Object> DataInfo = new HashMap<>();
|
|
|
|
+ try {
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
+ //字典为key,位置为value
|
|
|
|
+ Map<Integer, String> elementMap = list.stream().collect(Collectors.toMap(WbsFormElement::getDynamicDict, WbsFormElement::getEKey));
|
|
|
|
+ //解析html获取所以实际的key
|
|
|
|
+ Document doc = Jsoup.parse(new File(linkTable.getHtmlUrl()), "utf-8");
|
|
|
|
+// Document doc = Jsoup.parse(new File("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1711593963032412160.html"), "utf-8");
|
|
|
|
+ Element table = doc.select("table").first();
|
|
|
|
+ //因为此表的key不会重复,所以直接转map
|
|
|
|
+ Map<String,String> tableKeys = new HashMap<>();
|
|
|
|
+ table.getElementsByAttribute("id").stream().forEach(l -> {
|
|
|
|
+ String s = l.attr("id");
|
|
|
|
+ if (s.contains("__")) {
|
|
|
|
+ String[] s1 = s.split("__");
|
|
|
|
+ tableKeys.put(s1[0], s);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ for (Integer dict : elementMap.keySet()) {
|
|
|
|
+ String s1 = tableKeys.get(elementMap.get(dict));
|
|
|
|
+ switch (dict){
|
|
|
|
+ case 99:
|
|
|
|
+ //当天日期
|
|
|
|
+ DataInfo.put(s1,LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日")));
|
|
|
|
+ break;
|
|
|
|
+ case 100:
|
|
|
|
+ //周期
|
|
|
|
+ DataInfo.put(s1,stage);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ compensationInfoService.getBussPdfInfo(linkTable.getId(), DataInfo);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ServiceException("生成封面失败");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 分页查询结算周期
|
|
* 分页查询结算周期
|
|
|
|
+ *
|
|
* @param query
|
|
* @param query
|
|
* @param info
|
|
* @param info
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public IPage<ClearingAgreementInfo> page(Query query, ClearingAgreementInfo info) {
|
|
|
|
- IPage<ClearingAgreementInfo> iPage = new Page<>(query.getCurrent(),query.getSize());
|
|
|
|
- return baseMapper.page(iPage,info);
|
|
|
|
|
|
+ public IPage<ClearingAgreementInfoVO> page(Query query, ClearingAgreementInfo info) {
|
|
|
|
+ IPage<ClearingAgreementInfo> iPage = new Page<>(query.getCurrent(), query.getSize());
|
|
|
|
+ return baseMapper.page(iPage, info);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -154,6 +382,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
|
|
|
|
/**
|
|
/**
|
|
* 结算统计面积
|
|
* 结算统计面积
|
|
|
|
+ *
|
|
* @param projectId
|
|
* @param projectId
|
|
* @param areaId
|
|
* @param areaId
|
|
* @return
|
|
* @return
|
|
@@ -163,17 +392,17 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
//获取当前项目下,当前节点下所有补偿协议
|
|
//获取当前项目下,当前节点下所有补偿协议
|
|
List<CompensationInfo> infoList = compensationInfoService.getAllAgreementList(projectId, areaId);
|
|
List<CompensationInfo> infoList = compensationInfoService.getAllAgreementList(projectId, areaId);
|
|
- if (infoList == null || infoList.size() == 0){
|
|
|
|
|
|
+ if (infoList == null || infoList.size() == 0) {
|
|
return R.data(list);
|
|
return R.data(list);
|
|
}
|
|
}
|
|
//已签协议面积
|
|
//已签协议面积
|
|
BigDecimal all = infoList.stream().map(l -> l.getAreaAll()).reduce(BigDecimal.valueOf(0), BigDecimal::add);
|
|
BigDecimal all = infoList.stream().map(l -> l.getAreaAll()).reduce(BigDecimal.valueOf(0), BigDecimal::add);
|
|
- list.add(all+"");
|
|
|
|
|
|
+ list.add(all + "");
|
|
//已签协议比例
|
|
//已签协议比例
|
|
list.add("0%");
|
|
list.add("0%");
|
|
//已结算面积
|
|
//已结算面积
|
|
- BigDecimal endAll = infoList.stream().filter(l->l.getIsQuote().equals(1)).map(l -> l.getAreaAll()).reduce(BigDecimal.valueOf(0), BigDecimal::add);
|
|
|
|
- list.add(endAll+"");
|
|
|
|
|
|
+ BigDecimal endAll = infoList.stream().filter(l -> l.getIsQuote().equals(1)).map(l -> l.getAreaAll()).reduce(BigDecimal.valueOf(0), BigDecimal::add);
|
|
|
|
+ list.add(endAll + "");
|
|
//已结算比例
|
|
//已结算比例
|
|
list.add("0%");
|
|
list.add("0%");
|
|
return R.data(list);
|
|
return R.data(list);
|
|
@@ -181,6 +410,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
|
|
|
|
/**
|
|
/**
|
|
* 结算统计面积柱状图
|
|
* 结算统计面积柱状图
|
|
|
|
+ *
|
|
* @param projectId
|
|
* @param projectId
|
|
* @param areaId
|
|
* @param areaId
|
|
* @return
|
|
* @return
|
|
@@ -190,7 +420,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
List<AreaPictureVO> vo = new ArrayList<>();
|
|
List<AreaPictureVO> vo = new ArrayList<>();
|
|
//获取当前项目下,当前节点下所有补偿协议
|
|
//获取当前项目下,当前节点下所有补偿协议
|
|
List<CompensationInfo> infoList = compensationInfoService.getAllAgreementList(projectId, areaId);
|
|
List<CompensationInfo> infoList = compensationInfoService.getAllAgreementList(projectId, areaId);
|
|
- if (infoList == null || infoList.size() == 0){
|
|
|
|
|
|
+ if (infoList == null || infoList.size() == 0) {
|
|
return R.data(vo);
|
|
return R.data(vo);
|
|
}
|
|
}
|
|
//已签面积
|
|
//已签面积
|
|
@@ -220,6 +450,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
|
|
|
|
/**
|
|
/**
|
|
* 结算统计-金额进度
|
|
* 结算统计-金额进度
|
|
|
|
+ *
|
|
* @param projectId
|
|
* @param projectId
|
|
* @param areaId
|
|
* @param areaId
|
|
* @return
|
|
* @return
|
|
@@ -229,7 +460,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
List<AreaPictureVO> vo = new ArrayList<>();
|
|
List<AreaPictureVO> vo = new ArrayList<>();
|
|
//获取当前项目下,当前节点下所有补偿协议
|
|
//获取当前项目下,当前节点下所有补偿协议
|
|
List<CompensationInfo> infoList = compensationInfoService.getAllAgreementList(projectId, areaId);
|
|
List<CompensationInfo> infoList = compensationInfoService.getAllAgreementList(projectId, areaId);
|
|
- if (infoList == null || infoList.size() == 0){
|
|
|
|
|
|
+ if (infoList == null || infoList.size() == 0) {
|
|
return R.data(vo);
|
|
return R.data(vo);
|
|
}
|
|
}
|
|
BigDecimal zero = new BigDecimal(0);
|
|
BigDecimal zero = new BigDecimal(0);
|
|
@@ -241,7 +472,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
AreaPictureVO vo1 = new AreaPictureVO();
|
|
AreaPictureVO vo1 = new AreaPictureVO();
|
|
vo1.setName("实际补助总金额");
|
|
vo1.setName("实际补助总金额");
|
|
List<BigDecimal> ll = new ArrayList<>();
|
|
List<BigDecimal> ll = new ArrayList<>();
|
|
- BigDecimal a1 = infoList.stream().filter(l->l.getType().equals(1)).map(l -> l.getAllMoney()).reduce(BigDecimal.valueOf(0), BigDecimal::add);
|
|
|
|
|
|
+ BigDecimal a1 = infoList.stream().filter(l -> l.getType().equals(1)).map(l -> l.getAllMoney()).reduce(BigDecimal.valueOf(0), BigDecimal::add);
|
|
ll.add(a1);
|
|
ll.add(a1);
|
|
ll.add(zero);
|
|
ll.add(zero);
|
|
ll.add(zero);
|
|
ll.add(zero);
|
|
@@ -262,7 +493,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
AreaPictureVO vo3 = new AreaPictureVO();
|
|
AreaPictureVO vo3 = new AreaPictureVO();
|
|
vo3.setName("已结算总金额");
|
|
vo3.setName("已结算总金额");
|
|
List<BigDecimal> lbl = new ArrayList<>();
|
|
List<BigDecimal> lbl = new ArrayList<>();
|
|
- BigDecimal c1 = l2.stream().filter(l->l.getType().equals(1)).map(l -> l.getAllMoney()).reduce(BigDecimal.valueOf(0), BigDecimal::add);
|
|
|
|
|
|
+ BigDecimal c1 = l2.stream().filter(l -> l.getType().equals(1)).map(l -> l.getAllMoney()).reduce(BigDecimal.valueOf(0), BigDecimal::add);
|
|
lbl.add(c1);
|
|
lbl.add(c1);
|
|
lbl.add(zero);
|
|
lbl.add(zero);
|
|
lbl.add(zero);
|
|
lbl.add(zero);
|
|
@@ -278,6 +509,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
|
|
|
|
/**
|
|
/**
|
|
* 批量删除
|
|
* 批量删除
|
|
|
|
+ *
|
|
* @param ids
|
|
* @param ids
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
@@ -292,9 +524,9 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
List<Long> li = new ArrayList<>();
|
|
List<Long> li = new ArrayList<>();
|
|
List<ClearingAgreementInfo> list = this.listByIds(id);
|
|
List<ClearingAgreementInfo> list = this.listByIds(id);
|
|
for (ClearingAgreementInfo info : list) {
|
|
for (ClearingAgreementInfo info : list) {
|
|
- li.addAll( Func.toLongList(info.getAgreementIds()));
|
|
|
|
|
|
+ li.addAll(Func.toLongList(info.getAgreementIds()));
|
|
}
|
|
}
|
|
- compensationInfoService.batchUpdateStatus(li,0);
|
|
|
|
|
|
+ compensationInfoService.batchUpdateStatus(li, 0);
|
|
//最后删除结算协议
|
|
//最后删除结算协议
|
|
this.deleteLogic(id);
|
|
this.deleteLogic(id);
|
|
|
|
|
|
@@ -311,7 +543,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
if (StringUtils.isNotEmpty(table.getPdfUrl())) {
|
|
if (StringUtils.isNotEmpty(table.getPdfUrl())) {
|
|
data.add(table.getPdfUrl());
|
|
data.add(table.getPdfUrl());
|
|
} else {
|
|
} else {
|
|
- R bussPdfInfo = compensationInfoService.getBussPdfInfo(table.getId());
|
|
|
|
|
|
+ R bussPdfInfo = compensationInfoService.getBussPdfInfo(table.getId(), null);
|
|
if (bussPdfInfo.getCode() == 200) {
|
|
if (bussPdfInfo.getCode() == 200) {
|
|
if (StringUtils.isNotBlank(bussPdfInfo.getData() + "")) {
|
|
if (StringUtils.isNotBlank(bussPdfInfo.getData() + "")) {
|
|
data.add(bussPdfInfo.getData() + "");
|
|
data.add(bussPdfInfo.getData() + "");
|