|
@@ -26,6 +26,7 @@ import org.springblade.land.mapper.SettlementIntervalMapper;
|
|
|
import org.springblade.land.service.*;
|
|
|
import org.springblade.land.utils.FileUtils;
|
|
|
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;
|
|
@@ -92,7 +93,6 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
|
} else {
|
|
|
//存在则直接获取所有结算表单
|
|
|
linkTables = linkTableService.getByAgreementId(info.getId());
|
|
|
- //删除已经生成的单个pdf(待定)
|
|
|
//修改则先还原之前补偿协议的状态
|
|
|
ClearingAgreementInfo agreementInfo = this.getById(info.getId());
|
|
|
compensationInfoService.batchUpdateStatus(Func.toLongList(agreementInfo.getAgreementIds()), 0);
|
|
@@ -194,47 +194,52 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
|
}
|
|
|
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()) {
|
|
|
-// switch (dict){
|
|
|
-// case 99:
|
|
|
-// //当天日期
|
|
|
-// break;
|
|
|
-// case 4:
|
|
|
- //户主姓名
|
|
|
- //取出数据集合
|
|
|
- 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()));
|
|
|
+ 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) + ""));
|
|
|
}
|
|
|
- //取出位置集合
|
|
|
- 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));
|
|
|
- }
|
|
|
-// break;
|
|
|
-// case 10:
|
|
|
-// //身份证号
|
|
|
-//
|
|
|
-// break;
|
|
|
-// case 11:
|
|
|
-// //银行卡号
|
|
|
-//
|
|
|
-// break;
|
|
|
-// case 5:
|
|
|
-// //补偿总计
|
|
|
-//
|
|
|
-// break;
|
|
|
-// }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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) {
|
|
@@ -362,7 +367,7 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public IPage<ClearingAgreementInfo> page(Query query, ClearingAgreementInfo info) {
|
|
|
+ public IPage<ClearingAgreementInfoVO> page(Query query, ClearingAgreementInfo info) {
|
|
|
IPage<ClearingAgreementInfo> iPage = new Page<>(query.getCurrent(), query.getSize());
|
|
|
return baseMapper.page(iPage, info);
|
|
|
}
|