修改提交

This commit is contained in:
pengjie 2024-07-05 14:35:03 +08:00
parent 4ea93fdacb
commit 503c6f3aa2
5 changed files with 48 additions and 21 deletions

View File

@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.project.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.project.entity.ProgressPanoramaNodePlan;
import com.zhgd.xmgl.modules.project.entity.dto.ProgressPanoramaNodePlanDto;
@ -38,23 +39,6 @@ public class ProgressPanoramaNodePlanController {
@Autowired
private IProgressPanoramaNodePlanService progressPanoramaNodePlanService;
/**
* 分页列表查询
* @return
*/
@ApiOperation(value = "分页列表查询进度-全景节点计划信息", notes = "分页列表查询进度-全景节点计划信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "nodeName", value = "节点名称", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "bidSectionId", value = "标段ID", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = "/tree")
public Result<IPage<ProgressPanoramaNodePlanDto>> queryTreeList(@RequestBody Map<String,Object> map) {
return Result.success(progressPanoramaNodePlanService.selectProgressPanoramaNodePlanPageList(map));
}
/**
* 分页列表查询
* @return
@ -106,7 +90,13 @@ public class ProgressPanoramaNodePlanController {
if(progressPanoramaNodePlanEntity==null) {
result.error500(MessageUtil.get("notFindErr"));
}else {
if (progressPanoramaNodePlan.getId().toString().equals(progressPanoramaNodePlan.getParentId().toString())) {
throw new OpenAlertException("请选择正确的父节点");
}
ProgressPanoramaNodePlan parent = progressPanoramaNodePlanService.getById(progressPanoramaNodePlan.getParentId());
if (!progressPanoramaNodePlan.getParentId().toString().equals("0") && parent == null) {
throw new OpenAlertException("该节点数据不存在,请刷新页面");
}
if (parent != null) {
progressPanoramaNodePlan.setAncestors(parent.getAncestors() + "," + parent.getId().toString());
} else {

View File

@ -22,7 +22,7 @@ import java.util.Map;
@Mapper
public interface ProgressPanoramaNodePlanMapper extends BaseMapper<ProgressPanoramaNodePlan> {
List<ProgressPanoramaNodePlanDto> selectProgressPanoramaNodePlanPageList(Page page, @Param("param") Map<String, Object> map);
Page<ProgressPanoramaNodePlanDto> selectProgressPanoramaNodePlanPageList(Page page, @Param("param") Map<String, Object> map);
List<EntityMap> selectPanoramaNodePlanList(Map<String, Object> map);

View File

@ -14,6 +14,18 @@
<if test="param.bidSectionId != null and param.bidSectionId != ''">
and a.bid_section_id = #{param.bidSectionId}
</if>
<if test="param.bidSectionId != null and param.bidSectionId != ''">
and a.bid_section_id = #{param.bidSectionId}
</if>
<if test="param.parentId != null and param.parentId != ''">
and a.parent_id = #{param.parentId}
</if>
<if test="param.list != null">
and a.id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by a.planned_finish_date
</select>
<select id="selectPanoramaNodePlanList"

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.cost.entity.CostSubject;
import com.zhgd.xmgl.modules.project.entity.ProgressPanoramaNodePlan;
@ -19,6 +20,7 @@ import com.zhgd.xmgl.modules.project.mapper.ProjectMapper;
import com.zhgd.xmgl.modules.project.service.IProgressPanoramaNodePlanService;
import com.zhgd.xmgl.security.entity.UserInfo;
import com.zhgd.xmgl.security.util.SecurityUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -26,8 +28,10 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Description: 进度-全景节点计划
@ -50,8 +54,26 @@ public class ProgressPanoramaNodePlanServiceImpl extends ServiceImpl<ProgressPan
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
Page page = new Page<>(pageNo, pageSize);
List<ProgressPanoramaNodePlanDto> list = progressPanoramaNodePlanMapper.selectProgressPanoramaNodePlanPageList(page, map);
return page.setRecords(list);
String bidSectionId = MapUtils.getString(map, "bidSectionId");
String nodeName = MapUtils.getString(map, "nodeName");
Page<ProgressPanoramaNodePlanDto> pageList = new Page<>();
if (StringUtils.isNotBlank(bidSectionId) || StringUtils.isNotBlank(nodeName)) {
pageList = progressPanoramaNodePlanMapper.selectProgressPanoramaNodePlanPageList(page, map);
} else {
List<ProgressPanoramaNodePlanDto> allList = progressPanoramaNodePlanMapper.selectProgressPanoramaNodePlanPageList(new Page(-1, -1), map).getRecords();
map.put("parentId", "0");
pageList = progressPanoramaNodePlanMapper.selectProgressPanoramaNodePlanPageList(page, map);
getChildren(pageList.getRecords(), allList);
}
return pageList;
}
private void getChildren(List<ProgressPanoramaNodePlanDto> list, List<ProgressPanoramaNodePlanDto> allList) {
for (ProgressPanoramaNodePlanDto planDto : list) {
List<ProgressPanoramaNodePlanDto> childrenList = allList.stream().filter(a -> String.valueOf(a.getParentId()).equals(String.valueOf(planDto.getId()))).collect(Collectors.toList());
getChildren(childrenList, allList);
planDto.setChildren(childrenList);
}
}
@Override
@ -64,6 +86,9 @@ public class ProgressPanoramaNodePlanServiceImpl extends ServiceImpl<ProgressPan
// throw new OpenAlertException(MessageUtil.get("uniqueExistErr"));
// }
ProgressPanoramaNodePlan parent = this.getById(progressPanoramaNodePlan.getParentId());
if (!progressPanoramaNodePlan.getParentId().toString().equals("0") && parent == null) {
throw new OpenAlertException("该节点数据不存在,请刷新页面");
}
if (parent != null) {
progressPanoramaNodePlan.setAncestors(parent.getAncestors() + "," + parent.getId().toString());
} else {

View File

@ -1,6 +1,6 @@
#http.port=30250
http.port=23912
spring.datasource.db1.jdbc-url=jdbc:mysql://192.168.34.221:3306/wisdomsite_other_env_show?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
spring.datasource.db1.jdbc-url=jdbc:mysql://192.168.34.155:3306/wisdomsite_jiuzhu?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
spring.datasource.db1.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.db1.username=ENC(XR4C/hvTYCUqudS49Wh/jA==)
spring.datasource.db1.password=ENC(LsKaVL2ycDu+uUNoPndYLA==)