|
@@ -75,6 +75,8 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
|
|
|
|
private final IRegionTreeInfoService treeInfoService;
|
|
private final IRegionTreeInfoService treeInfoService;
|
|
|
|
|
|
|
|
+ private final IAgreementFileService fileService;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取补偿表单
|
|
* 获取补偿表单
|
|
@@ -91,30 +93,14 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
* 协议表单 获取html接口
|
|
* 协议表单 获取html接口
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public R getExcelHtmlByBuss(Long pkeyId,Integer type) throws Exception {
|
|
|
|
|
|
+ public R getExcelHtmlByBuss(Long id) throws Exception {
|
|
//获取表单信息
|
|
//获取表单信息
|
|
- String fileUrl = "";
|
|
|
|
- Long projectId = null;
|
|
|
|
- if (type == 1) {
|
|
|
|
- WbsTreePrivate wbsTreePrivate = baseMapper.getWbsPrivateTable(pkeyId);
|
|
|
|
- if (wbsTreePrivate == null) {
|
|
|
|
- return R.fail("该数据下无此节点!");
|
|
|
|
- }
|
|
|
|
- if (wbsTreePrivate.getHtmlUrl() == null) {
|
|
|
|
- return R.fail("暂无表单!");
|
|
|
|
- }
|
|
|
|
- fileUrl = wbsTreePrivate.getHtmlUrl();
|
|
|
|
- projectId = Long.parseLong(wbsTreePrivate.getProjectId());
|
|
|
|
- }else if (type == 2){
|
|
|
|
- AgreementLinkTable table = linkTableService.getById(pkeyId);
|
|
|
|
- fileUrl = table.getHtmlUrl();
|
|
|
|
- projectId = table.getProjectId();
|
|
|
|
- }
|
|
|
|
|
|
+ AgreementLinkTable linkTable = linkTableService.getById(id);
|
|
// fileUrl = "C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1704045947043971072.html";
|
|
// fileUrl = "C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1704045947043971072.html";
|
|
- if (StringUtils.isBlank(fileUrl)){
|
|
|
|
|
|
+ if (StringUtils.isBlank(linkTable.getHtmlUrl())){
|
|
return R.fail("没有获取到表单!");
|
|
return R.fail("没有获取到表单!");
|
|
}
|
|
}
|
|
- InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
|
|
|
|
|
|
+ InputStream fileInputStream = FileUtils.getInputStreamByUrl(linkTable.getHtmlUrl());
|
|
|
|
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
@@ -124,7 +110,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
Document doc = Jsoup.parse(htmlString);
|
|
Document doc = Jsoup.parse(htmlString);
|
|
Element table = doc.select("table").first();
|
|
Element table = doc.select("table").first();
|
|
// 添加标题显示
|
|
// 添加标题显示
|
|
- ProjectInfo projectInfo = baseMapper.getProjectInfo(projectId);
|
|
|
|
|
|
+ ProjectInfo projectInfo = baseMapper.getProjectInfo(linkTable.getProjectId());
|
|
Elements trs = table.select("tr");
|
|
Elements trs = table.select("tr");
|
|
for (int i = 1; i < 6; i++) {
|
|
for (int i = 1; i < 6; i++) {
|
|
Element tr = trs.get(i);
|
|
Element tr = trs.get(i);
|
|
@@ -149,24 +135,12 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
* 协议表单 获取坐标位置
|
|
* 协议表单 获取坐标位置
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public R getHtmlBussCols(Long pkeyId,Integer type) throws Exception {
|
|
|
|
|
|
+ public R getHtmlBussCols(Long id) throws Exception {
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
//获取表单信息
|
|
//获取表单信息
|
|
- String fileUrl = "";
|
|
|
|
- if (type == 1) {
|
|
|
|
- WbsTreePrivate wbsTreePrivate = baseMapper.getWbsPrivateTable(pkeyId);
|
|
|
|
- if (wbsTreePrivate == null) {
|
|
|
|
- return R.fail("该数据下无此节点!");
|
|
|
|
- }
|
|
|
|
- if (wbsTreePrivate.getHtmlUrl() == null) {
|
|
|
|
- return R.fail("暂无表单!");
|
|
|
|
- }
|
|
|
|
- fileUrl = wbsTreePrivate.getHtmlUrl();
|
|
|
|
- }else if (type == 2){
|
|
|
|
- AgreementLinkTable table = linkTableService.getById(pkeyId);
|
|
|
|
- fileUrl = table.getHtmlUrl();
|
|
|
|
- }
|
|
|
|
|
|
+ AgreementLinkTable linkTable = linkTableService.getById(id);
|
|
|
|
+ String fileUrl = linkTable.getHtmlUrl();
|
|
if (StringUtils.isBlank(fileUrl)){
|
|
if (StringUtils.isBlank(fileUrl)){
|
|
return R.fail("没有获取到表单!");
|
|
return R.fail("没有获取到表单!");
|
|
}
|
|
}
|
|
@@ -221,10 +195,6 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public R getBussDataInfo(Long linkId) {
|
|
public R getBussDataInfo(Long linkId) {
|
|
- //当前是新增没有数据
|
|
|
|
- if (linkId == null){
|
|
|
|
- return R.data(null);
|
|
|
|
- }
|
|
|
|
Map<String, Object> reData = new HashMap<>();
|
|
Map<String, Object> reData = new HashMap<>();
|
|
//获取表单数据
|
|
//获取表单数据
|
|
List<Map<String, Object>> mapList = baseMapper.getBussDataInfo(linkId);
|
|
List<Map<String, Object>> mapList = baseMapper.getBussDataInfo(linkId);
|
|
@@ -253,52 +223,20 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
}
|
|
}
|
|
JSONObject tableInfo1 = dataArray.getJSONObject(0);
|
|
JSONObject tableInfo1 = dataArray.getJSONObject(0);
|
|
Long id = tableInfo1.getLong("agreementId");
|
|
Long id = tableInfo1.getLong("agreementId");
|
|
- Long projectId = tableInfo1.getLong("projectId");
|
|
|
|
Long areaId = tableInfo1.getLong("areaId");
|
|
Long areaId = tableInfo1.getLong("areaId");
|
|
- Integer nodeType = tableInfo1.getInteger("nodeType");
|
|
|
|
- Boolean isUpdate = true;
|
|
|
|
- List<AgreementLinkTable> linkTables = new ArrayList<>();
|
|
|
|
//中间表tableId与dataId的映射
|
|
//中间表tableId与dataId的映射
|
|
Map<Long,Long> map = new HashMap<>();
|
|
Map<Long,Long> map = new HashMap<>();
|
|
- //中间表tableId与linkId的映射
|
|
|
|
- Map<Long,Long> map2 = new HashMap<>();
|
|
|
|
- if (id == null){
|
|
|
|
- Long agreeId = SnowFlakeUtil.getId();
|
|
|
|
- isUpdate = false;
|
|
|
|
- //新增建立协议与表单映射,新增复制时会直接在复制接口创建
|
|
|
|
- List<WbsTreePrivate> tables = baseMapper.getTables(projectId, nodeType);
|
|
|
|
- linkTables = tables.stream().map(l -> {
|
|
|
|
- AgreementLinkTable table = new AgreementLinkTable();
|
|
|
|
- table.setTableId(Long.parseLong(l.getInitTableId()));
|
|
|
|
- table.setProjectId(projectId);
|
|
|
|
- table.setTableDataId(SnowFlakeUtil.getId());
|
|
|
|
- table.setId(SnowFlakeUtil.getId());
|
|
|
|
- table.setAgreementId(agreeId);
|
|
|
|
- table.setPrivateId(l.getId());
|
|
|
|
- table.setSort(l.getSort());
|
|
|
|
- table.setExcelId(l.getExcelId());
|
|
|
|
- table.setHtmlUrl(l.getHtmlUrl());
|
|
|
|
- table.setTableName(l.getNodeName());
|
|
|
|
- map.put(table.getTableId(),table.getTableDataId());
|
|
|
|
- map2.put(table.getTableId(),table.getId());
|
|
|
|
- return table;
|
|
|
|
- }).collect(Collectors.toList());
|
|
|
|
- linkTableService.saveBatch(linkTables);
|
|
|
|
- id = agreeId;
|
|
|
|
- }else {
|
|
|
|
- //获取表单id与数据id的映射
|
|
|
|
- linkTables = linkTableService.getByAgreementId(id);
|
|
|
|
- linkTables.stream().forEach(l->map.put(l.getTableId(),l.getTableDataId()));
|
|
|
|
|
|
+ //获取表单id与数据id的映射
|
|
|
|
+ List<AgreementLinkTable> linkTables = linkTableService.getByAgreementId(id);
|
|
|
|
+ if (linkTables == null || linkTables.size() == 0){
|
|
|
|
+ throw new ServiceException("暂无表单");
|
|
}
|
|
}
|
|
|
|
+ linkTables.stream().forEach(l->map.put(l.getTableId(),l.getTableDataId()));
|
|
|
|
+
|
|
for (int i=0; i<dataArray.size();i++) {
|
|
for (int i=0; i<dataArray.size();i++) {
|
|
JSONObject jsonObject = dataArray.getJSONObject(i);
|
|
JSONObject jsonObject = dataArray.getJSONObject(i);
|
|
- if (isUpdate){
|
|
|
|
- //是修改,就先去删除原来保存的数据
|
|
|
|
- baseMapper.deleteOldData(jsonObject.getLong("linkId"));
|
|
|
|
- }else {
|
|
|
|
- //新增时没有linkId,需要手动设置
|
|
|
|
- jsonObject.put("linkId",map2.get(jsonObject.getLong("tableId")));
|
|
|
|
- }
|
|
|
|
|
|
+ //删除原来保存的数据
|
|
|
|
+ baseMapper.deleteOldData(jsonObject.getLong("linkId"));
|
|
this.SaveOneTabInfo(jsonObject);
|
|
this.SaveOneTabInfo(jsonObject);
|
|
}
|
|
}
|
|
//合并PDF
|
|
//合并PDF
|
|
@@ -309,6 +247,8 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
BigDecimal b2 = new BigDecimal(0);
|
|
BigDecimal b2 = new BigDecimal(0);
|
|
//地面附着物
|
|
//地面附着物
|
|
BigDecimal b3 = new BigDecimal(0);
|
|
BigDecimal b3 = new BigDecimal(0);
|
|
|
|
+ //户主姓名(协议名称)
|
|
|
|
+ StringBuilder str = new StringBuilder("");
|
|
//计算统计值
|
|
//计算统计值
|
|
List<WbsFormElement> elementList = baseMapper.getTableElement(linkTables.stream().map(l -> l.getTableId()).collect(Collectors.toList()));
|
|
List<WbsFormElement> elementList = baseMapper.getTableElement(linkTables.stream().map(l -> l.getTableId()).collect(Collectors.toList()));
|
|
CompensationInfo info = new CompensationInfo();
|
|
CompensationInfo info = new CompensationInfo();
|
|
@@ -316,9 +256,6 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
//获取当前节点名称
|
|
//获取当前节点名称
|
|
RegionTreeInfo treeInfo = treeInfoService.getById(areaId);
|
|
RegionTreeInfo treeInfo = treeInfoService.getById(areaId);
|
|
info.setNumber(treeInfo.getAreaName()+"默认编号");
|
|
info.setNumber(treeInfo.getAreaName()+"默认编号");
|
|
- info.setAreaId(areaId);
|
|
|
|
- info.setProjectId(projectId);
|
|
|
|
- info.setType(nodeType);
|
|
|
|
if (elementList == null || elementList.size() == 0){
|
|
if (elementList == null || elementList.size() == 0){
|
|
info.setName("未找到用户名称");
|
|
info.setName("未找到用户名称");
|
|
info.setLandMoney(b1);
|
|
info.setLandMoney(b1);
|
|
@@ -350,6 +287,8 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
b2 = b2.add(new BigDecimal(dataVO.getTabVal()));
|
|
b2 = b2.add(new BigDecimal(dataVO.getTabVal()));
|
|
}else if (dict.equals(3)){
|
|
}else if (dict.equals(3)){
|
|
b3 = b3.add(new BigDecimal(dataVO.getTabVal()));
|
|
b3 = b3.add(new BigDecimal(dataVO.getTabVal()));
|
|
|
|
+ }else if (dict.equals(4)){
|
|
|
|
+ str.append(dataVO.getTabVal()+"、");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -358,27 +297,25 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- info.setName("默认值");
|
|
|
|
|
|
+ String names = str.toString();
|
|
|
|
+ if (StringUtils.isNotBlank(names)){
|
|
|
|
+ info.setName(names.substring(0, names.length() - 1));
|
|
|
|
+ }else {
|
|
|
|
+ info.setName("未找到用户名称");
|
|
|
|
+ }
|
|
info.setLandMoney(b1);
|
|
info.setLandMoney(b1);
|
|
info.setCropsMoney(b2.add(b3));
|
|
info.setCropsMoney(b2.add(b3));
|
|
info.setAllMoney(info.getLandMoney().add(info.getCropsMoney()));
|
|
info.setAllMoney(info.getLandMoney().add(info.getCropsMoney()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//保存协议信息
|
|
//保存协议信息
|
|
- if (isUpdate){
|
|
|
|
- this.updateById(info);
|
|
|
|
- }else {
|
|
|
|
- this.save(info);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return R.data(200,id,"保存成功");
|
|
|
|
|
|
+ this.updateById(info);
|
|
|
|
+ return R.success("保存成功");
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public R getBussPdfDataInfo(Long agreementId, Long tableId) {
|
|
|
|
- AgreementLinkTable one = linkTableService.getOne(new LambdaQueryWrapper<AgreementLinkTable>()
|
|
|
|
- .eq(AgreementLinkTable::getAgreementId, agreementId)
|
|
|
|
- .eq(AgreementLinkTable::getTableDataId, tableId));
|
|
|
|
|
|
+ public R getBussPdfDataInfo(Long id) {
|
|
|
|
+ AgreementLinkTable one = linkTableService.getById(id);
|
|
if (one == null){
|
|
if (one == null){
|
|
throw new ServiceException("未查询到表单,请联系管理员");
|
|
throw new ServiceException("未查询到表单,请联系管理员");
|
|
}
|
|
}
|
|
@@ -405,9 +342,6 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public R getPdfS(Long agreementId) {
|
|
public R getPdfS(Long agreementId) {
|
|
- if (agreementId == null){
|
|
|
|
- throw new ServiceException("当前节点还未保存过");
|
|
|
|
- }
|
|
|
|
CompensationInfo info = this.getById(agreementId);
|
|
CompensationInfo info = this.getById(agreementId);
|
|
if (info == null || StringUtils.isBlank(info.getMergePdfUrl())){
|
|
if (info == null || StringUtils.isBlank(info.getMergePdfUrl())){
|
|
throw new ServiceException("当前节点还未保存过");
|
|
throw new ServiceException("当前节点还未保存过");
|
|
@@ -415,18 +349,86 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
return R.data(info.getMergePdfUrl());
|
|
return R.data(info.getMergePdfUrl());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// @Override
|
|
|
|
+// @Transactional
|
|
|
|
+// public R addCopeTab(TableCopyVO vo) {
|
|
|
|
+// //新增复制
|
|
|
|
+// Long agreeId = SnowFlakeUtil.getId();
|
|
|
|
+// //先新增协议,再复制
|
|
|
|
+// List<WbsTreePrivate> tables = baseMapper.getTables(vo.getProjectId(), vo.getNodeType());
|
|
|
|
+// Map<Long,Long> map = new HashMap<>();
|
|
|
|
+// List<AgreementLinkTable> linkTables = tables.stream().map(l -> {
|
|
|
|
+// AgreementLinkTable table = new AgreementLinkTable();
|
|
|
|
+// table.setTableId(Long.parseLong(l.getInitTableId()));
|
|
|
|
+// table.setProjectId(vo.getProjectId());
|
|
|
|
+// table.setTableDataId(SnowFlakeUtil.getId());
|
|
|
|
+// table.setId(SnowFlakeUtil.getId());
|
|
|
|
+// table.setAgreementId(agreeId);
|
|
|
|
+// table.setPrivateId(l.getId());
|
|
|
|
+// table.setSort(l.getSort());
|
|
|
|
+// table.setExcelId(l.getExcelId());
|
|
|
|
+// table.setHtmlUrl(l.getHtmlUrl());
|
|
|
|
+// table.setTableName(l.getNodeName());
|
|
|
|
+// map.put(Long.parseLong(l.getInitTableId()),table.getId());
|
|
|
|
+// return table;
|
|
|
|
+// }).collect(Collectors.toList());
|
|
|
|
+// linkTableService.saveBatch(linkTables);
|
|
|
|
+// vo.setLinkId(map.get(vo.getTableId()));
|
|
|
|
+// this.updateCopeTab(vo);
|
|
|
|
+// //保存协议
|
|
|
|
+// CompensationInfo info = new CompensationInfo();
|
|
|
|
+// info.setId(agreeId);
|
|
|
|
+// info.setName("默认名称");
|
|
|
|
+// //获取当前节点名称
|
|
|
|
+// RegionTreeInfo treeInfo = treeInfoService.getById(vo.getAreaId());
|
|
|
|
+// info.setNumber(treeInfo.getAreaName()+"默认编号");
|
|
|
|
+// info.setAreaId(vo.getAreaId());
|
|
|
|
+// info.setProjectId(vo.getProjectId());
|
|
|
|
+// info.setType(vo.getNodeType());
|
|
|
|
+// info.setLandMoney(new BigDecimal(0));
|
|
|
|
+// info.setCropsMoney(new BigDecimal(0));
|
|
|
|
+// info.setAllMoney(new BigDecimal(0));
|
|
|
|
+// this.save(info);
|
|
|
|
+// return R.data(200,agreeId,"复制成功");
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改复制表单
|
|
|
|
+ * @param id
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
- @Transactional
|
|
|
|
- public R addCopeTab(TableCopyVO vo) {
|
|
|
|
|
|
+ public R updateCopeTab(Long id) {
|
|
|
|
+ AgreementLinkTable linkTable = linkTableService.getById(id);
|
|
|
|
+ AgreementLinkTable table = new AgreementLinkTable();
|
|
|
|
+ BeanUtils.copyProperties(linkTable,table);
|
|
|
|
+ table.setId(null);
|
|
|
|
+ table.setTableDataId(SnowFlakeUtil.getId());
|
|
|
|
+ table.setPdfUrl(null);
|
|
|
|
+ //获取复制表单存在的数量
|
|
|
|
+ Integer count = baseMapper.getTableCount(table.getAgreementId(), table.getTableId());
|
|
|
|
+ String[] s = table.getTableName().split("__");
|
|
|
|
+ table.setTableName(s[0]+"__"+ count);
|
|
|
|
+ linkTableService.save(table);
|
|
|
|
+ return R.data(200,linkTable.getAgreementId(),"复制成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public IPage<CompensationInfo> page(Query query, CompensationInfo info) {
|
|
|
|
+ IPage<CompensationInfo> iPage = new Page<>(query.getCurrent(),query.getSize());
|
|
|
|
+ return baseMapper.page(iPage,info);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Long add(Long projectId, Long areaId, Integer type) {
|
|
//新增复制
|
|
//新增复制
|
|
Long agreeId = SnowFlakeUtil.getId();
|
|
Long agreeId = SnowFlakeUtil.getId();
|
|
- //先新增协议,再复制
|
|
|
|
- List<WbsTreePrivate> tables = baseMapper.getTables(vo.getProjectId(), vo.getNodeType());
|
|
|
|
- Map<Long,Long> map = new HashMap<>();
|
|
|
|
|
|
+ //先新增中间表,再复制
|
|
|
|
+ List<WbsTreePrivate> tables = baseMapper.getTables(projectId, type);
|
|
List<AgreementLinkTable> linkTables = tables.stream().map(l -> {
|
|
List<AgreementLinkTable> linkTables = tables.stream().map(l -> {
|
|
AgreementLinkTable table = new AgreementLinkTable();
|
|
AgreementLinkTable table = new AgreementLinkTable();
|
|
table.setTableId(Long.parseLong(l.getInitTableId()));
|
|
table.setTableId(Long.parseLong(l.getInitTableId()));
|
|
- table.setProjectId(vo.getProjectId());
|
|
|
|
|
|
+ table.setProjectId(projectId);
|
|
table.setTableDataId(SnowFlakeUtil.getId());
|
|
table.setTableDataId(SnowFlakeUtil.getId());
|
|
table.setId(SnowFlakeUtil.getId());
|
|
table.setId(SnowFlakeUtil.getId());
|
|
table.setAgreementId(agreeId);
|
|
table.setAgreementId(agreeId);
|
|
@@ -435,54 +437,52 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
table.setExcelId(l.getExcelId());
|
|
table.setExcelId(l.getExcelId());
|
|
table.setHtmlUrl(l.getHtmlUrl());
|
|
table.setHtmlUrl(l.getHtmlUrl());
|
|
table.setTableName(l.getNodeName());
|
|
table.setTableName(l.getNodeName());
|
|
- map.put(Long.parseLong(l.getInitTableId()),table.getId());
|
|
|
|
return table;
|
|
return table;
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
linkTableService.saveBatch(linkTables);
|
|
linkTableService.saveBatch(linkTables);
|
|
- vo.setLinkId(map.get(vo.getTableId()));
|
|
|
|
- this.updateCopeTab(vo);
|
|
|
|
- //保存协议
|
|
|
|
|
|
+ //再保存协议
|
|
CompensationInfo info = new CompensationInfo();
|
|
CompensationInfo info = new CompensationInfo();
|
|
info.setId(agreeId);
|
|
info.setId(agreeId);
|
|
info.setName("默认名称");
|
|
info.setName("默认名称");
|
|
//获取当前节点名称
|
|
//获取当前节点名称
|
|
- RegionTreeInfo treeInfo = treeInfoService.getById(vo.getAreaId());
|
|
|
|
- info.setNumber(treeInfo.getAreaName()+"默认编号");
|
|
|
|
- info.setAreaId(vo.getAreaId());
|
|
|
|
- info.setProjectId(vo.getProjectId());
|
|
|
|
- info.setType(vo.getNodeType());
|
|
|
|
|
|
+ RegionTreeInfo treeInfo = treeInfoService.getById(areaId);
|
|
|
|
+ //获取编号
|
|
|
|
+ String num = getNumber(areaId);
|
|
|
|
+ info.setNumber(treeInfo.getAreaName()+num);
|
|
|
|
+ info.setAreaId(areaId);
|
|
|
|
+ info.setProjectId(projectId);
|
|
|
|
+ info.setType(type);
|
|
info.setLandMoney(new BigDecimal(0));
|
|
info.setLandMoney(new BigDecimal(0));
|
|
info.setCropsMoney(new BigDecimal(0));
|
|
info.setCropsMoney(new BigDecimal(0));
|
|
info.setAllMoney(new BigDecimal(0));
|
|
info.setAllMoney(new BigDecimal(0));
|
|
this.save(info);
|
|
this.save(info);
|
|
- return R.data(200,agreeId,"复制成功");
|
|
|
|
|
|
+ return agreeId;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 修改复制表单
|
|
|
|
- * @param vo
|
|
|
|
- * @return
|
|
|
|
|
|
+ * 批量删除
|
|
|
|
+ * @param ids
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public R updateCopeTab(TableCopyVO vo) {
|
|
|
|
- AgreementLinkTable linkTable = linkTableService.getById(vo.getLinkId());
|
|
|
|
- AgreementLinkTable table = new AgreementLinkTable();
|
|
|
|
- BeanUtils.copyProperties(linkTable,table);
|
|
|
|
- table.setId(null);
|
|
|
|
- table.setTableDataId(SnowFlakeUtil.getId());
|
|
|
|
- table.setPdfUrl(null);
|
|
|
|
- //获取复制表单存在的数量
|
|
|
|
- Integer count = baseMapper.getTableCount(table.getAgreementId(), table.getTableId());
|
|
|
|
- String[] s = table.getTableName().split("__");
|
|
|
|
- table.setTableName(s[0]+"__"+ count);
|
|
|
|
- linkTableService.save(table);
|
|
|
|
- return R.data(200,linkTable.getAgreementId(),"复制成功");
|
|
|
|
|
|
+ @Transactional
|
|
|
|
+ public void remove(List<Long> ids) {
|
|
|
|
+ //先删除表单数据
|
|
|
|
+ linkTableService.deleteTableData(ids);
|
|
|
|
+ //再删除中间表数据
|
|
|
|
+ linkTableService.deleteByAgreementIds(ids);
|
|
|
|
+ //最后删除补偿协议
|
|
|
|
+ this.deleteLogic(ids);
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public IPage<CompensationInfo> page(Query query, CompensationInfo info) {
|
|
|
|
- IPage<CompensationInfo> iPage = new Page<>(query.getCurrent(),query.getSize());
|
|
|
|
- return baseMapper.page(iPage,info);
|
|
|
|
|
|
+ //获取当前节点的补偿编号
|
|
|
|
+ private String getNumber(Long areaId) {
|
|
|
|
+ Integer number = baseMapper.getNumber(areaId);
|
|
|
|
+ number++;
|
|
|
|
+ if (number < 10){
|
|
|
|
+ return "0"+number;
|
|
|
|
+ }else {
|
|
|
|
+ return number + "";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// 保存单表
|
|
// 保存单表
|
|
@@ -743,6 +743,15 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //附件如果有也要一起合并
|
|
|
|
+ List<AgreementFile> fileList = fileService.list(new LambdaQueryWrapper<AgreementFile>().eq(AgreementFile::getAgreementId, agreementId));
|
|
|
|
+ if (fileList != null && fileList.size() != 0){
|
|
|
|
+ for (AgreementFile file : fileList) {
|
|
|
|
+ if (StringUtils.isNotBlank(file.getDomainPdfUrl())){
|
|
|
|
+ data.add(file.getDomainPdfUrl());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
String listPdf = file_path + "/pdf/" + agreementId + ".pdf";
|
|
String listPdf = file_path + "/pdf/" + agreementId + ".pdf";
|
|
File tabpdf2 = ResourceUtil.getFile(listPdf);
|
|
File tabpdf2 = ResourceUtil.getFile(listPdf);
|
|
if (tabpdf2.exists()) {
|
|
if (tabpdf2.exists()) {
|