09-06-修复bug,完善功能

This commit is contained in:
2025-09-06 15:16:41 +08:00
parent b738bb821d
commit ff9f49b1d9
13 changed files with 392 additions and 0 deletions

View File

@ -129,4 +129,9 @@ public class DesVolumeCatalogVo implements Serializable {
*/ */
private String opinion; private String opinion;
/**
* 文件数量
*/
private Long fileCount;
} }

View File

@ -362,6 +362,20 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
return volumeCatalogVoPage; return volumeCatalogVoPage;
} }
List<DesVolumeCatalogVo> volumeCatalogVoList = volumeCatalogList.stream().map(vo-> getVo(vo,null)).toList(); List<DesVolumeCatalogVo> volumeCatalogVoList = volumeCatalogList.stream().map(vo-> getVo(vo,null)).toList();
// 查询文件数量
LambdaQueryWrapper<DesVolumeFile> fileQueryWrapper = new LambdaQueryWrapper<>();
for (DesVolumeCatalogVo desVolumeCatalogVo : volumeCatalogVoList) {
fileQueryWrapper.clear();
fileQueryWrapper.eq(DesVolumeFile::getVolumeCatalogId, desVolumeCatalogVo.getDesign());
List<DesVolumeFile> list = volumeFileService.list(fileQueryWrapper);
if (list != null && !list.isEmpty()){
desVolumeCatalogVo.setFileCount((long) list.size());
}else{
desVolumeCatalogVo.setFileCount(0L);
}
}
return volumeCatalogVoPage.setRecords(volumeCatalogVoList); return volumeCatalogVoPage.setRecords(volumeCatalogVoList);
} }

View File

@ -114,6 +114,11 @@ public class BusFormalitiesAreConsolidatedVo implements Serializable {
*/ */
private Date createPTime; private Date createPTime;
/**
* 文件数量
*/
private Long fileCount;
private List<BusFormalitiesAreConsolidatedVo> children = new ArrayList<>(); private List<BusFormalitiesAreConsolidatedVo> children = new ArrayList<>();

View File

@ -90,6 +90,18 @@ public class BusFormalitiesAreConsolidatedServiceImpl extends ServiceImpl<BusFor
@Override @Override
public List<BusFormalitiesAreConsolidatedVo> getTree(BusFormalitiesAreConsolidatedBo bo) { public List<BusFormalitiesAreConsolidatedVo> getTree(BusFormalitiesAreConsolidatedBo bo) {
List<BusFormalitiesAreConsolidatedVo> voList = queryList(bo); List<BusFormalitiesAreConsolidatedVo> voList = queryList(bo);
//寻找对应文件数量
LambdaQueryWrapper<BusFormalitiesAnnex> lqw = new LambdaQueryWrapper<>();
for (BusFormalitiesAreConsolidatedVo busFormalitiesAreConsolidatedVo : voList) {
lqw.clear();
lqw.eq(BusFormalitiesAnnex::getFormalitiesId, busFormalitiesAreConsolidatedVo.getId());
List<BusFormalitiesAnnex> list = busFormalitiesAnnexService.list(lqw);
if (list != null && !list.isEmpty()){
busFormalitiesAreConsolidatedVo.setFileCount((long) list.size());
}else {
busFormalitiesAreConsolidatedVo.setFileCount(0L);
}
}
return TreeUtil.buildTree1(voList); return TreeUtil.buildTree1(voList);
} }

View File

@ -1,6 +1,7 @@
package org.dromara.land.controller; package org.dromara.land.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
@ -15,14 +16,21 @@ import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController; import org.dromara.common.web.core.BaseController;
import org.dromara.land.domain.BusLandTransferLedger;
import org.dromara.land.domain.BusLandTransferLedgerSon;
import org.dromara.land.domain.bo.BusLandTransferLedgerBo; import org.dromara.land.domain.bo.BusLandTransferLedgerBo;
import org.dromara.land.domain.vo.BusLandTransferLedgerCountVo; import org.dromara.land.domain.vo.BusLandTransferLedgerCountVo;
import org.dromara.land.domain.vo.BusLandTransferLedgerVo; import org.dromara.land.domain.vo.BusLandTransferLedgerVo;
import org.dromara.land.service.IBusLandTransferLedgerService; import org.dromara.land.service.IBusLandTransferLedgerService;
import org.dromara.land.service.impl.BusLandTransferLedgerSonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 项目土地流转台账 * 项目土地流转台账
@ -37,6 +45,8 @@ import java.util.List;
public class BusLandTransferLedgerController extends BaseController { public class BusLandTransferLedgerController extends BaseController {
private final IBusLandTransferLedgerService busLandTransferLedgerService; private final IBusLandTransferLedgerService busLandTransferLedgerService;
@Autowired
private BusLandTransferLedgerSonServiceImpl busLandTransferLedgerSonService;
/** /**
* 查询项目土地流转台账列表 * 查询项目土地流转台账列表
@ -121,4 +131,44 @@ public class BusLandTransferLedgerController extends BaseController {
@PathVariable Long projectId) { @PathVariable Long projectId) {
return R.ok(busLandTransferLedgerService.countByProjectId(projectId)); return R.ok(busLandTransferLedgerService.countByProjectId(projectId));
} }
/**
* 获取主页面三项主数据
*/
@SaCheckPermission("land:landTransferLedger:allCountValue")
@GetMapping("/allCountValue/{projectId}")
R<Map<String,Object> > allCountValue(@PathVariable Long projectId){
LambdaQueryWrapper<BusLandTransferLedger> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(BusLandTransferLedger::getProjectId,projectId);
List<BusLandTransferLedger> list = busLandTransferLedgerService.list(lambdaQueryWrapper);
//设计亩积
BigDecimal areaSum = BigDecimal.ZERO;
//流转面积
BigDecimal transferAreaSum = BigDecimal.ZERO;
//租金
BigDecimal rentSum = BigDecimal.ZERO;
Map<String,Object> map = new HashMap<>();
for (BusLandTransferLedger busLandTransferLedger : list) {
LambdaQueryWrapper<BusLandTransferLedgerSon> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BusLandTransferLedgerSon::getParentId, busLandTransferLedger.getId());
List<BusLandTransferLedgerSon> sonList = busLandTransferLedgerSonService.list(queryWrapper);
if (sonList != null && !sonList.isEmpty()){
//设计亩积 流转面积 租金
for (BusLandTransferLedgerSon ledgerSon : sonList) {
//1已流转2是不流转
if (ledgerSon.getTransferStatus().equals("1")){
transferAreaSum = transferAreaSum.add(ledgerSon.getAreaValue());
rentSum = rentSum.add(ledgerSon.getLandRent());
}
}
}
areaSum = areaSum.add(busLandTransferLedger.getDesignArea());
}
map.put("areaSum",areaSum);
map.put("transferAreaSum",transferAreaSum);
map.put("rentSum",rentSum);
return R.ok(map);
}
} }

View File

@ -0,0 +1,57 @@
package org.dromara.land.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.dromara.common.core.domain.R;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.land.domain.BusLandTransferLedgerSon;
import org.dromara.land.domain.bo.BusLandTransferLedgerSonBo;
import org.dromara.land.domain.vo.BusLandTransferLedgerSonVo;
import org.dromara.land.service.impl.BusLandTransferLedgerSonServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping("/land/landTransferLedger/children")
public class BusLandTransferLedgerSonController {
@Autowired
private BusLandTransferLedgerSonServiceImpl busLandTransferLedgerSonService;
/**
* 添加子级
*/
@SaCheckPermission("land:landTransferLedger:childrenAdd")
@Log(title = "项目土地流转台账子级数据", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping("/add")
public R<BusLandTransferLedgerSon> add(@RequestBody BusLandTransferLedgerSonBo busLandTransferLedgerSon){
BusLandTransferLedgerSon son = new BusLandTransferLedgerSon();
BeanUtils.copyProperties(busLandTransferLedgerSon, son);
boolean save = busLandTransferLedgerSonService.save(son);
if (save){
return R.ok(son);
}else {
return R.fail("添加子级失败");
}
}
/**
* 子级列表
*/
@SaCheckPermission("land:landTransferLedger:childrenList")
@GetMapping("/list")
public R<List<BusLandTransferLedgerSon>> getList(@RequestParam Long parentId){
LambdaQueryWrapper<BusLandTransferLedgerSon> lqw = new LambdaQueryWrapper<>();
lqw.eq(BusLandTransferLedgerSon::getParentId, parentId);
List<BusLandTransferLedgerSon> list = busLandTransferLedgerSonService.list(lqw);
return R.ok(list);
}
}

View File

@ -0,0 +1,34 @@
package org.dromara.land.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.dromara.land.domain.bo.BusLandTransferLedgerSonBo;
import java.math.BigDecimal;
@TableName("bus_land_transfer_ledger_son")
@Data
public class BusLandTransferLedgerSon extends BusLandTransferLedger {
// @TableId(value = "id")
// private Long id;
private Long parentId;
private BigDecimal areaValue;
// private Long landBlockId;
//
// private Long enterRoadId;
//
// private BigDecimal transferAea;
//
// private BigDecimal transferRatio;
//
// //1流转 2不流转
// private String transferStatus;
}

View File

@ -0,0 +1,47 @@
package org.dromara.land.domain.bo;
import com.baomidou.mybatisplus.annotation.TableId;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.land.domain.BusLandTransferLedger;
import org.dromara.land.domain.BusLandTransferLedgerSon;
import org.dromara.land.domain.BusNonTransferLedger;
import java.math.BigDecimal;
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BusLandTransferLedgerSon.class, reverseConvertGenerate = false)
public class BusLandTransferLedgerSonBo extends BusLandTransferLedgerBo {
// @NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
// private Long id;
@NotBlank(message = "父ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long parentId;
@NotBlank(message = "面积数据不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal areaValue;
// @NotBlank(message = "土地块ID不能为空", groups = { AddGroup.class, EditGroup.class })
// private Long landBlockId;
//
// @NotBlank(message = "进入路线ID不能为空", groups = { AddGroup.class, EditGroup.class })
// private Long enterRoadId;
//
// @NotBlank(message = "流转面积不能为空", groups = { AddGroup.class, EditGroup.class })
// private BigDecimal transferAea;
//
// @NotBlank(message = "流转比例不能为空", groups = { AddGroup.class, EditGroup.class })
// private BigDecimal transferRatio;
//
// //1流转 2不流转
// @NotBlank(message = "流转状态不能为空", groups = { AddGroup.class, EditGroup.class })
// private String transferStatus;
}

View File

@ -0,0 +1,58 @@
package org.dromara.land.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.land.domain.BusLandTransferLedger;
import org.dromara.land.domain.BusLandTransferLedgerSon;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = BusLandTransferLedgerSon.class)
public class BusLandTransferLedgerSonVo extends BusLandTransferLedgerVo {
// @Serial
// private static final long serialVersionUID = 1L;
// @ExcelProperty(value = "主键ID")
// private Long id;
@ExcelProperty(value = "父ID")
private Long parentId;
@ExcelProperty(value = "面积数据")
private BigDecimal areaValue;
// @ExcelProperty(value = "地块ID")
// private Long landBlockId;
//
// @ExcelProperty(value = "进场道路ID")
// private Long enterRoadId;
//
// @ExcelProperty(value = "土地类型")
// private String landType;
//
// @ExcelProperty(value = "土地类型")
// @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "landType",other = "land_type")
// private String landTypeName;
//
// @ExcelProperty(value = "流转面积")
// private BigDecimal transferAea;
//
// @ExcelProperty(value = "流转比例")
// @ExcelDictFormat(readConverterExp = "百分比")
// private BigDecimal transferRatio;
//
// //1流转 2不流转
// @ExcelProperty(value = "流转状态")
// private String transferStatus;
}

View File

@ -177,4 +177,23 @@ public class BusLandTransferLedgerVo implements Serializable {
private String landName; private String landName;
List<UnitBo> unitBoList; List<UnitBo> unitBoList;
//不流转面积
private BigDecimal noTrans;
//已流转面积
private BigDecimal transferArea;
//未流转面积
private BigDecimal noTransferAea;
//土地租金(元)
private BigDecimal landRentAll;
//青苗赔偿(元)
private BigDecimal seedlingCompensationAll;
//总金额(元)
private BigDecimal totalAmountAll;
} }

View File

@ -0,0 +1,9 @@
package org.dromara.land.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.dromara.land.domain.BusLandTransferLedgerSon;
@Mapper
public interface BusLandTransferLedgerSonMapper extends BaseMapper<BusLandTransferLedgerSon> {
}

View File

@ -13,6 +13,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.land.domain.BusLandBlockUnitProject; import org.dromara.land.domain.BusLandBlockUnitProject;
import org.dromara.land.domain.BusLandTransferLedger; import org.dromara.land.domain.BusLandTransferLedger;
import org.dromara.land.domain.BusLandTransferLedgerSon;
import org.dromara.land.domain.bo.BusLandTransferLedgerBo; import org.dromara.land.domain.bo.BusLandTransferLedgerBo;
import org.dromara.land.domain.bo.UnitBo; import org.dromara.land.domain.bo.UnitBo;
import org.dromara.land.domain.vo.BusEnterRoadVo; import org.dromara.land.domain.vo.BusEnterRoadVo;
@ -24,6 +25,7 @@ import org.dromara.land.service.IBusEnterRoadService;
import org.dromara.land.service.IBusLandBlockService; import org.dromara.land.service.IBusLandBlockService;
import org.dromara.land.service.IBusLandBlockUnitProjectService; import org.dromara.land.service.IBusLandBlockUnitProjectService;
import org.dromara.land.service.IBusLandTransferLedgerService; import org.dromara.land.service.IBusLandTransferLedgerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -48,6 +50,9 @@ public class BusLandTransferLedgerServiceImpl extends ServiceImpl<BusLandTransfe
private final IBusLandBlockUnitProjectService iBusLandBlockUnitProjectService; private final IBusLandBlockUnitProjectService iBusLandBlockUnitProjectService;
@Autowired
private BusLandTransferLedgerSonServiceImpl busLandTransferLedgerSonService;
/** /**
* 查询项目土地流转台账 * 查询项目土地流转台账
* *
@ -85,6 +90,7 @@ public class BusLandTransferLedgerServiceImpl extends ServiceImpl<BusLandTransfe
roadList = iBusEnterRoadService.queryListByIds(roadIds); roadList = iBusEnterRoadService.queryListByIds(roadIds);
} }
for (BusLandTransferLedgerVo vo : records){ for (BusLandTransferLedgerVo vo : records){
BusLandBlockVo landBlock = landBlockList.stream().filter(item -> item.getId().equals(vo.getLandBlockId())).findFirst().orElse(null); BusLandBlockVo landBlock = landBlockList.stream().filter(item -> item.getId().equals(vo.getLandBlockId())).findFirst().orElse(null);
if(landBlock != null){ if(landBlock != null){
@ -96,6 +102,71 @@ public class BusLandTransferLedgerServiceImpl extends ServiceImpl<BusLandTransfe
vo.setRoadCode(enterRoad.getRoadCode()); vo.setRoadCode(enterRoad.getRoadCode());
vo.setRoadName(enterRoad.getRoadName()); vo.setRoadName(enterRoad.getRoadName());
} }
//处理完后 开始拼接 未流转 已流转 不流转 未流转=总面积-(已流转+不流转)
LambdaQueryWrapper<BusLandTransferLedgerSon> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(BusLandTransferLedgerSon::getParentId,vo.getId());
List<BusLandTransferLedgerSon> sonList = busLandTransferLedgerSonService.list(lambdaQueryWrapper);
//不流转面积
BigDecimal noTrans = new BigDecimal(0);
//已流转面积
BigDecimal transferArea = new BigDecimal(0);
//未流转面积
BigDecimal noTransferAea = new BigDecimal(0);
//土地租金
BigDecimal landRentAll = new BigDecimal(0);
//青苗赔偿
BigDecimal seedlingCompensationAll = new BigDecimal(0);
//总金额
BigDecimal totalAmountAll = new BigDecimal(0);
if (sonList != null && !sonList.isEmpty()) {
for (BusLandTransferLedgerSon son : sonList) {
String transferStatus = son.getTransferStatus();
//0是未流转1已流转2是不流转
switch (transferStatus) {
case "1":
if (son.getAreaValue() != null) {
transferArea = transferArea.add(son.getAreaValue());
}
break;
case "2":
if (son.getAreaValue() != null) {
noTrans = noTrans.add(son.getAreaValue());
}
break;
default:
break;
}
//土地租金(元)
if (son.getLandRent() != null) {
landRentAll = landRentAll.add(son.getLandRent());
}
//青苗赔偿(元)
if (son.getSeedlingCompensation()!=null) {
seedlingCompensationAll = seedlingCompensationAll.add(son.getSeedlingCompensation());
}
//总金额(元)
if (son.getTotalAmount()!=null) {
totalAmountAll = totalAmountAll.add(son.getTotalAmount());
}
}
}
//统计完流转和不流转后 计算剩余未流转面积
noTransferAea = vo.getDesignArea().subtract((noTrans.add(transferArea)));
vo.setNoTransferAea(noTransferAea);
vo.setTransferArea(transferArea);
vo.setNoTrans(noTrans);
//土地租金(元)
vo.setLandRentAll(landRentAll);
//青苗赔偿(元)
vo.setSeedlingCompensationAll(seedlingCompensationAll);
//总金额(元)
vo.setTotalAmountAll(totalAmountAll);
} }
return TableDataInfo.build(result); return TableDataInfo.build(result);

View File

@ -0,0 +1,11 @@
package org.dromara.land.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.dromara.land.domain.BusLandTransferLedgerSon;
import org.dromara.land.mapper.BusLandTransferLedgerSonMapper;
import org.springframework.stereotype.Service;
@Service
public class BusLandTransferLedgerSonServiceImpl extends ServiceImpl<BusLandTransferLedgerSonMapper, BusLandTransferLedgerSon> {
}