进度计划,施工产值
This commit is contained in:
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
@ -114,7 +115,15 @@ public class DroProjectDroneServiceImpl extends ServiceImpl<DroProjectDroneMappe
|
|||||||
* 保存前的数据校验
|
* 保存前的数据校验
|
||||||
*/
|
*/
|
||||||
private void validEntityBeforeSave(DroProjectDrone entity) {
|
private void validEntityBeforeSave(DroProjectDrone entity) {
|
||||||
//TODO 做一些数据校验,如唯一约束
|
// 判断无人机是否已被其他项目使用
|
||||||
|
Long count = this.lambdaQuery()
|
||||||
|
.eq(DroProjectDrone::getDroneSn, entity.getDroneSn())
|
||||||
|
.ne(entity.getProjectId() != null, DroProjectDrone::getProjectId, entity.getProjectId())
|
||||||
|
.ne(entity.getId() != null, DroProjectDrone::getId, entity.getId())
|
||||||
|
.count();
|
||||||
|
if (count > 0) {
|
||||||
|
throw new ServiceException("无人机已存在于其他项目");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -16,6 +16,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.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.out.domain.bo.OutConstructionValueBo;
|
import org.dromara.out.domain.bo.OutConstructionValueBo;
|
||||||
|
import org.dromara.out.domain.bo.OutConstructionValueFacilityReq;
|
||||||
import org.dromara.out.domain.vo.OutConstructionAllValueVo;
|
import org.dromara.out.domain.vo.OutConstructionAllValueVo;
|
||||||
import org.dromara.out.domain.vo.OutConstructionValueVo;
|
import org.dromara.out.domain.vo.OutConstructionValueVo;
|
||||||
import org.dromara.out.service.IOutConstructionValueService;
|
import org.dromara.out.service.IOutConstructionValueService;
|
||||||
@ -113,4 +114,24 @@ public class OutConstructionValueController extends BaseController {
|
|||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(outConstructionValueService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(outConstructionValueService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增进度计划详情
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("out:constructionValue:edit")
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/insert/facility")
|
||||||
|
public R<Void> insertFinishedDetail(@Validated @RequestBody OutConstructionValueFacilityReq req) {
|
||||||
|
return toAjax(outConstructionValueService.insertFacilityDetail(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除进度计划详情
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("out:constructionValue:edit")
|
||||||
|
@RepeatSubmit()
|
||||||
|
@DeleteMapping("/remove/facility")
|
||||||
|
public R<Void> removeDetail(@Validated OutConstructionValueFacilityReq req) {
|
||||||
|
return toAjax(outConstructionValueService.removeFacilityDetail(req));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,42 @@
|
|||||||
|
package org.dromara.out.domain.bo;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-10-12 17:51
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OutConstructionValueFacilityReq implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -5491058421687762904L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键ID不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上报日期
|
||||||
|
*/
|
||||||
|
private LocalDate reportDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情主键id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "详情主键id不能为空")
|
||||||
|
private Long detailId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情id列表
|
||||||
|
*/
|
||||||
|
private List<Long> detailIdList;
|
||||||
|
}
|
||||||
@ -166,4 +166,9 @@ public class OutConstructionValueVo implements Serializable {
|
|||||||
* 对甲产值
|
* 对甲产值
|
||||||
*/
|
*/
|
||||||
private BigDecimal ownerValue;
|
private BigDecimal ownerValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作类型
|
||||||
|
*/
|
||||||
|
private String workType;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,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.out.domain.OutConstructionValue;
|
import org.dromara.out.domain.OutConstructionValue;
|
||||||
import org.dromara.out.domain.bo.OutConstructionValueBo;
|
import org.dromara.out.domain.bo.OutConstructionValueBo;
|
||||||
|
import org.dromara.out.domain.bo.OutConstructionValueFacilityReq;
|
||||||
import org.dromara.out.domain.vo.OutConstructionAllValueVo;
|
import org.dromara.out.domain.vo.OutConstructionAllValueVo;
|
||||||
import org.dromara.out.domain.vo.OutConstructionValueVo;
|
import org.dromara.out.domain.vo.OutConstructionValueVo;
|
||||||
|
|
||||||
@ -86,4 +87,20 @@ public interface IOutConstructionValueService extends IService<OutConstructionVa
|
|||||||
* @return 施工所有产值
|
* @return 施工所有产值
|
||||||
*/
|
*/
|
||||||
OutConstructionAllValueVo getAllValue(OutConstructionValueBo bo);
|
OutConstructionAllValueVo getAllValue(OutConstructionValueBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设施设施详情
|
||||||
|
*
|
||||||
|
* @param req 新增设施设施详情
|
||||||
|
* @return 新增设施设施详情
|
||||||
|
*/
|
||||||
|
Boolean insertFacilityDetail(OutConstructionValueFacilityReq req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设施设施详情
|
||||||
|
*
|
||||||
|
* @param req 删除设施设施详情
|
||||||
|
* @return 删除设施设施详情
|
||||||
|
*/
|
||||||
|
Boolean removeFacilityDetail(OutConstructionValueFacilityReq req);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,13 +18,17 @@ import org.dromara.facility.service.IFacMatrixService;
|
|||||||
import org.dromara.out.domain.OutConstructionValue;
|
import org.dromara.out.domain.OutConstructionValue;
|
||||||
import org.dromara.out.domain.OutConstructionValueRange;
|
import org.dromara.out.domain.OutConstructionValueRange;
|
||||||
import org.dromara.out.domain.bo.OutConstructionValueBo;
|
import org.dromara.out.domain.bo.OutConstructionValueBo;
|
||||||
|
import org.dromara.out.domain.bo.OutConstructionValueFacilityReq;
|
||||||
import org.dromara.out.domain.vo.OutConstructionAllValueVo;
|
import org.dromara.out.domain.vo.OutConstructionAllValueVo;
|
||||||
import org.dromara.out.domain.vo.OutConstructionValueVo;
|
import org.dromara.out.domain.vo.OutConstructionValueVo;
|
||||||
import org.dromara.out.mapper.OutConstructionValueMapper;
|
import org.dromara.out.mapper.OutConstructionValueMapper;
|
||||||
import org.dromara.out.service.IOutConstructionValueRangeService;
|
import org.dromara.out.service.IOutConstructionValueRangeService;
|
||||||
import org.dromara.out.service.IOutConstructionValueService;
|
import org.dromara.out.service.IOutConstructionValueService;
|
||||||
import org.dromara.progress.domain.PgsProgressCategory;
|
import org.dromara.progress.domain.PgsProgressCategory;
|
||||||
|
import org.dromara.progress.domain.PgsProgressPlanDetail;
|
||||||
import org.dromara.progress.domain.dto.progressplandetail.PgsProgressPlanDetailCreateReq;
|
import org.dromara.progress.domain.dto.progressplandetail.PgsProgressPlanDetailCreateReq;
|
||||||
|
import org.dromara.progress.domain.dto.progressplandetail.PgsProgressPlanDetailFinishedCreateReq;
|
||||||
|
import org.dromara.progress.domain.dto.progressplandetail.PgsProgressPlanDetailRemoveReq;
|
||||||
import org.dromara.progress.domain.vo.progresscategory.PgsProgressCategoryVo;
|
import org.dromara.progress.domain.vo.progresscategory.PgsProgressCategoryVo;
|
||||||
import org.dromara.progress.service.IPgsProgressCategoryService;
|
import org.dromara.progress.service.IPgsProgressCategoryService;
|
||||||
import org.dromara.progress.service.IPgsProgressPlanDetailService;
|
import org.dromara.progress.service.IPgsProgressPlanDetailService;
|
||||||
@ -188,7 +192,7 @@ public class OutConstructionValueServiceImpl extends ServiceImpl<OutConstruction
|
|||||||
}
|
}
|
||||||
OutConstructionValue update = MapstructUtils.convert(bo, OutConstructionValue.class);
|
OutConstructionValue update = MapstructUtils.convert(bo, OutConstructionValue.class);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
PgsProgressCategory progressCategory = pgsProgressCategoryService.getById(bo.getProgressCategoryId());
|
PgsProgressCategory progressCategory = pgsProgressCategoryService.getById(old.getProgressCategoryId());
|
||||||
// 同步确认数量
|
// 同步确认数量
|
||||||
BigDecimal confirmNum = BigDecimal.valueOf(bo.getConfirmNum());
|
BigDecimal confirmNum = BigDecimal.valueOf(bo.getConfirmNum());
|
||||||
if (StringUtils.isBlank(progressCategory.getWorkType())) {
|
if (StringUtils.isBlank(progressCategory.getWorkType())) {
|
||||||
@ -274,6 +278,48 @@ public class OutConstructionValueServiceImpl extends ServiceImpl<OutConstruction
|
|||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设施设施详情
|
||||||
|
*
|
||||||
|
* @param req 新增设施设施详情
|
||||||
|
* @return 新增设施设施详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertFacilityDetail(OutConstructionValueFacilityReq req) {
|
||||||
|
PgsProgressPlanDetailFinishedCreateReq dto = new PgsProgressPlanDetailFinishedCreateReq();
|
||||||
|
dto.setId(req.getDetailId());
|
||||||
|
dto.setFinishedDetailIdList(req.getDetailIdList());
|
||||||
|
pgsProgressPlanDetailService.insertFinishedDetail(dto, false);
|
||||||
|
PgsProgressPlanDetail detail = pgsProgressPlanDetailService.getById(req.getDetailId());
|
||||||
|
OutConstructionValueBo bo = new OutConstructionValueBo();
|
||||||
|
bo.setId(req.getId());
|
||||||
|
bo.setConfirmNum(detail.getFinishedNumber().intValue());
|
||||||
|
bo.setReportDate(req.getReportDate());
|
||||||
|
this.updateByBo(bo);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设施设施详情
|
||||||
|
*
|
||||||
|
* @param req 删除设施设施详情
|
||||||
|
* @return 删除设施设施详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean removeFacilityDetail(OutConstructionValueFacilityReq req) {
|
||||||
|
PgsProgressPlanDetailRemoveReq dto = new PgsProgressPlanDetailRemoveReq();
|
||||||
|
dto.setId(req.getDetailId());
|
||||||
|
dto.setDetailIdList(req.getDetailIdList());
|
||||||
|
pgsProgressPlanDetailService.removeDetail(dto, false);
|
||||||
|
PgsProgressPlanDetail detail = pgsProgressPlanDetailService.getById(req.getDetailId());
|
||||||
|
OutConstructionValueBo bo = new OutConstructionValueBo();
|
||||||
|
bo.setId(req.getId());
|
||||||
|
bo.setConfirmNum(detail.getFinishedNumber().intValue());
|
||||||
|
bo.setReportDate(req.getReportDate());
|
||||||
|
this.updateByBo(bo);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 补充数据
|
* 补充数据
|
||||||
*/
|
*/
|
||||||
@ -288,7 +334,7 @@ public class OutConstructionValueServiceImpl extends ServiceImpl<OutConstruction
|
|||||||
//查询分部工程以及分项工程
|
//查询分部工程以及分项工程
|
||||||
PgsProgressCategoryVo pgsProgressCategoryVo = pgsProgressCategoryService.queryById(vo.getProgressCategoryId());
|
PgsProgressCategoryVo pgsProgressCategoryVo = pgsProgressCategoryService.queryById(vo.getProgressCategoryId());
|
||||||
vo.setProgressCategoryName(pgsProgressCategoryVo.getName());
|
vo.setProgressCategoryName(pgsProgressCategoryVo.getName());
|
||||||
|
vo.setWorkType(pgsProgressCategoryVo.getWorkType());
|
||||||
PgsProgressCategoryVo pgsProgressCategoryVo1 = pgsProgressCategoryService.queryById(pgsProgressCategoryVo.getParentId());
|
PgsProgressCategoryVo pgsProgressCategoryVo1 = pgsProgressCategoryService.queryById(pgsProgressCategoryVo.getParentId());
|
||||||
vo.setCategoryId(pgsProgressCategoryVo1.getId());
|
vo.setCategoryId(pgsProgressCategoryVo1.getId());
|
||||||
vo.setCategoryName(pgsProgressCategoryVo1.getName());
|
vo.setCategoryName(pgsProgressCategoryVo1.getName());
|
||||||
|
|||||||
@ -345,6 +345,18 @@ public class PgsProgressCategoryController extends BaseController {
|
|||||||
return R.ok(pgsProgressCategoryService.queryLastTimeById(id));
|
return R.ok(pgsProgressCategoryService.queryLastTimeById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取进度类别甘特图结构
|
||||||
|
*
|
||||||
|
* @param projectId 项目主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("progress:progressCategory:query")
|
||||||
|
@GetMapping("/gantt/{projectId}")
|
||||||
|
public R<List<PgsProgressCategoryGanttVo>> listGantt(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
return R.ok(pgsProgressCategoryService.listGanttByProject(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增分项工程单价
|
* 新增分项工程单价
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -46,7 +46,7 @@ public class PgsProgressPlanDetailController extends BaseController {
|
|||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/insert/detail")
|
@PostMapping("/insert/detail")
|
||||||
public R<Void> insertFinishedDetail(@Validated @RequestBody PgsProgressPlanDetailFinishedCreateReq req) {
|
public R<Void> insertFinishedDetail(@Validated @RequestBody PgsProgressPlanDetailFinishedCreateReq req) {
|
||||||
return toAjax(pgsProgressPlanDetailService.insertFinishedDetail(req));
|
return toAjax(pgsProgressPlanDetailService.insertFinishedDetail(req, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,7 +100,7 @@ public class PgsProgressPlanDetailController extends BaseController {
|
|||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@DeleteMapping("/remove/detail")
|
@DeleteMapping("/remove/detail")
|
||||||
public R<Void> removeDetail(@Validated PgsProgressPlanDetailRemoveReq req) {
|
public R<Void> removeDetail(@Validated PgsProgressPlanDetailRemoveReq req) {
|
||||||
return toAjax(pgsProgressPlanDetailService.removeDetail(req));
|
return toAjax(pgsProgressPlanDetailService.removeDetail(req, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ public class PgsProgressPlanDetailAppController extends BaseController {
|
|||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/insert/detail")
|
@PostMapping("/insert/detail")
|
||||||
public R<Void> insertFinishedDetail(@Validated @RequestBody PgsProgressPlanDetailFinishedCreateReq req) {
|
public R<Void> insertFinishedDetail(@Validated @RequestBody PgsProgressPlanDetailFinishedCreateReq req) {
|
||||||
return toAjax(progressPlanDetailService.insertFinishedDetail(req));
|
return toAjax(progressPlanDetailService.insertFinishedDetail(req, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,7 +90,7 @@ public class PgsProgressPlanDetailAppController extends BaseController {
|
|||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@DeleteMapping("/remove/detail")
|
@DeleteMapping("/remove/detail")
|
||||||
public R<Void> removeDetail(@Validated PgsProgressPlanDetailRemoveReq req) {
|
public R<Void> removeDetail(@Validated PgsProgressPlanDetailRemoveReq req) {
|
||||||
return toAjax(progressPlanDetailService.removeDetail(req));
|
return toAjax(progressPlanDetailService.removeDetail(req, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,49 @@
|
|||||||
|
package org.dromara.progress.domain.vo.progresscategory;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-10-12 15:15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PgsProgressCategoryGanttVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1759675635511567284L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父级id
|
||||||
|
*/
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String text;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private LocalDate startDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private LocalDate endDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进度
|
||||||
|
*/
|
||||||
|
private BigDecimal progress;
|
||||||
|
}
|
||||||
@ -165,6 +165,15 @@ public interface IPgsProgressCategoryService extends IService<PgsProgressCategor
|
|||||||
*/
|
*/
|
||||||
List<PgsProgressCategory> getLeafNodesByTopId(Long topId);
|
List<PgsProgressCategory> getLeafNodesByTopId(Long topId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取最底层的叶子节点
|
||||||
|
*
|
||||||
|
* @param topId 顶级节点id
|
||||||
|
* @param allCategory 所有节点
|
||||||
|
* @return 最底层的叶子节点
|
||||||
|
*/
|
||||||
|
List<PgsProgressCategory> getLeafNodesByTopId(Long topId, List<PgsProgressCategory> allCategory);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取最底层的叶子节点(支持多个顶级id)
|
* 获取最底层的叶子节点(支持多个顶级id)
|
||||||
*
|
*
|
||||||
@ -212,4 +221,12 @@ public interface IPgsProgressCategoryService extends IService<PgsProgressCategor
|
|||||||
* @return 是否新增成功
|
* @return 是否新增成功
|
||||||
*/
|
*/
|
||||||
Boolean insertBatchFacility(PgsProgressCategoryCreateBatchFacilityReq req);
|
Boolean insertBatchFacility(PgsProgressCategoryCreateBatchFacilityReq req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取进度类别甘特图结构
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 进度类别甘特图结构
|
||||||
|
*/
|
||||||
|
List<PgsProgressCategoryGanttVo> listGanttByProject(Long projectId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ public interface IPgsProgressPlanDetailService extends IService<PgsProgressPlanD
|
|||||||
* @param req 插入进度计划详情设施参数
|
* @param req 插入进度计划详情设施参数
|
||||||
* @return 是否插入成功
|
* @return 是否插入成功
|
||||||
*/
|
*/
|
||||||
Boolean insertFinishedDetail(PgsProgressPlanDetailFinishedCreateReq req);
|
Boolean insertFinishedDetail(PgsProgressPlanDetailFinishedCreateReq req, Boolean isCheckout);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 插入进度计划详情设施
|
* 插入进度计划详情设施
|
||||||
@ -80,7 +80,7 @@ public interface IPgsProgressPlanDetailService extends IService<PgsProgressPlanD
|
|||||||
* @param req 删除进度计划详情参数
|
* @param req 删除进度计划详情参数
|
||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean removeDetail(PgsProgressPlanDetailRemoveReq req);
|
Boolean removeDetail(PgsProgressPlanDetailRemoveReq req, Boolean isCheckout);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取进度计划详情视图对象
|
* 获取进度计划详情视图对象
|
||||||
|
|||||||
@ -1400,6 +1400,43 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
|
|||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取最底层的叶子节点
|
||||||
|
*
|
||||||
|
* @param topId 顶级节点id
|
||||||
|
* @param allCategory 所有节点
|
||||||
|
* @return 最底层的叶子节点
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PgsProgressCategory> getLeafNodesByTopId(Long topId, List<PgsProgressCategory> allCategory) {
|
||||||
|
if (allCategory == null || allCategory.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 找出所有属于该顶级节点的子孙节点(Ancestors 字段包含 ,topId,)
|
||||||
|
List<PgsProgressCategory> allChildren = allCategory.stream()
|
||||||
|
.filter(item -> {
|
||||||
|
String ancestors = item.getAncestors();
|
||||||
|
return ancestors != null && ancestors.contains("," + topId + ",");
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
if (allChildren.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 找出所有的 parentId(即有孩子的节点)
|
||||||
|
Set<Long> parentIds = allChildren.stream()
|
||||||
|
.map(PgsProgressCategory::getParentId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
|
// 3. 过滤出没有作为别人 parentId 出现的节点 → 叶子节点
|
||||||
|
return allChildren.stream()
|
||||||
|
.filter(item -> !parentIds.contains(item.getId()))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取最底层的叶子节点(支持多个顶级id)
|
* 获取最底层的叶子节点(支持多个顶级id)
|
||||||
*
|
*
|
||||||
@ -1823,4 +1860,69 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取进度类别甘特图结构
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 进度类别甘特图结构
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PgsProgressCategoryGanttVo> listGanttByProject(Long projectId) {
|
||||||
|
List<PgsProgressCategoryGanttVo> ganttList = new ArrayList<>();
|
||||||
|
// 获取项目
|
||||||
|
BusProject project = projectService.getById(projectId);
|
||||||
|
if (project == null) {
|
||||||
|
throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
// 获取当前项目的所有子项目
|
||||||
|
List<BusProject> projectList = projectService.lambdaQuery()
|
||||||
|
.eq(BusProject::getPId, projectId)
|
||||||
|
.list();
|
||||||
|
projectList.add(project);
|
||||||
|
if (CollUtil.isEmpty(projectList)) {
|
||||||
|
return ganttList;
|
||||||
|
}
|
||||||
|
List<Long> projectIds = projectList.stream().map(BusProject::getId).toList();
|
||||||
|
// 获取当前项目所有进度类别
|
||||||
|
List<PgsProgressCategory> progressCategoryList = this.lambdaQuery()
|
||||||
|
.in(PgsProgressCategory::getProjectId, projectIds)
|
||||||
|
.eq(PgsProgressCategory::getMatrixId, 0)
|
||||||
|
.list();
|
||||||
|
if (CollUtil.isEmpty(progressCategoryList)) {
|
||||||
|
return ganttList;
|
||||||
|
}
|
||||||
|
// 封装进度类别数据
|
||||||
|
List<PgsProgressCategoryGanttVo> list = progressCategoryList.stream().map(p -> {
|
||||||
|
// 获取所有子节点
|
||||||
|
List<PgsProgressCategory> children = this.getLeafNodesByTopId(p.getId(), progressCategoryList);
|
||||||
|
PgsProgressCategoryGanttVo vo = new PgsProgressCategoryGanttVo();
|
||||||
|
vo.setId(p.getId());
|
||||||
|
vo.setParentId(p.getParentId());
|
||||||
|
vo.setText(p.getName());
|
||||||
|
vo.setStartDate(null);
|
||||||
|
vo.setEndDate(null);
|
||||||
|
vo.setProgress(this.getCompletedPercentage(children)
|
||||||
|
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP));
|
||||||
|
return vo;
|
||||||
|
}).toList();
|
||||||
|
ganttList.addAll(list);
|
||||||
|
// 获取当前项目所有计划
|
||||||
|
List<PgsProgressPlan> planList = progressPlanService.lambdaQuery()
|
||||||
|
.eq(PgsProgressPlan::getProjectId, projectId)
|
||||||
|
.list();
|
||||||
|
List<PgsProgressCategoryGanttVo> list1 = planList.stream().map(p -> {
|
||||||
|
PgsProgressCategoryGanttVo vo = new PgsProgressCategoryGanttVo();
|
||||||
|
vo.setId(p.getId());
|
||||||
|
vo.setParentId(p.getProgressCategoryId());
|
||||||
|
vo.setText(p.getProgressCategoryName() + "-" + "计划");
|
||||||
|
vo.setStartDate(p.getStartDate());
|
||||||
|
vo.setEndDate(p.getEndDate());
|
||||||
|
vo.setProgress(BigDecimalUtil.toPercentage(p.getFinishedNumber(), p.getPlanNumber())
|
||||||
|
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP));
|
||||||
|
return vo;
|
||||||
|
}).toList();
|
||||||
|
ganttList.addAll(list1);
|
||||||
|
return ganttList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -156,7 +156,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean insertFinishedDetail(PgsProgressPlanDetailFinishedCreateReq req) {
|
public Boolean insertFinishedDetail(PgsProgressPlanDetailFinishedCreateReq req, Boolean isCheckout) {
|
||||||
List<Long> finishedDetailIdList = req.getFinishedDetailIdList();
|
List<Long> finishedDetailIdList = req.getFinishedDetailIdList();
|
||||||
if (CollUtil.isEmpty(finishedDetailIdList)) {
|
if (CollUtil.isEmpty(finishedDetailIdList)) {
|
||||||
return true;
|
return true;
|
||||||
@ -168,7 +168,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
|
|||||||
throw new ServiceException("进度计划详情信息不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("进度计划详情信息不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
// 判断当前详情是否已提交
|
// 判断当前详情是否已提交
|
||||||
if (!progressPlanDetail.getStatus().equals("1")) {
|
if (isCheckout && !progressPlanDetail.getStatus().equals("1")) {
|
||||||
throw new ServiceException("当前详情已提交至施工产值,无法进行修改", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("当前详情已提交至施工产值,无法进行修改", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
Long progressPlanId = progressPlanDetail.getProgressPlanId();
|
Long progressPlanId = progressPlanDetail.getProgressPlanId();
|
||||||
@ -627,7 +627,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean removeDetail(PgsProgressPlanDetailRemoveReq req) {
|
public Boolean removeDetail(PgsProgressPlanDetailRemoveReq req, Boolean isCheckout) {
|
||||||
Long id = req.getId();
|
Long id = req.getId();
|
||||||
List<Long> detailIdList = req.getDetailIdList();
|
List<Long> detailIdList = req.getDetailIdList();
|
||||||
if (CollUtil.isEmpty(detailIdList)) {
|
if (CollUtil.isEmpty(detailIdList)) {
|
||||||
@ -637,6 +637,10 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
|
|||||||
if (progressPlanDetail == null) {
|
if (progressPlanDetail == null) {
|
||||||
throw new ServiceException("进度计划详情数据不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("进度计划详情数据不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
// 判断当前详情是否已提交
|
||||||
|
if (isCheckout && !progressPlanDetail.getStatus().equals("1")) {
|
||||||
|
throw new ServiceException("当前详情已提交至施工产值,无法进行修改", HttpStatus.BAD_REQUEST);
|
||||||
|
}
|
||||||
String finishedDetail = progressPlanDetail.getFinishedDetail();
|
String finishedDetail = progressPlanDetail.getFinishedDetail();
|
||||||
int removeTotal = detailIdList.size();
|
int removeTotal = detailIdList.size();
|
||||||
List<PgsProgressPlanDetailFinishedVo> finishedVoList = JSONUtil.toList(finishedDetail, PgsProgressPlanDetailFinishedVo.class);
|
List<PgsProgressPlanDetailFinishedVo> finishedVoList = JSONUtil.toList(finishedDetail, PgsProgressPlanDetailFinishedVo.class);
|
||||||
@ -977,6 +981,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
|
|||||||
value.setArtificialNum(finishedNumber.subtract(aiFill).intValue());
|
value.setArtificialNum(finishedNumber.subtract(aiFill).intValue());
|
||||||
value.setUavNum(aiFill.intValue());
|
value.setUavNum(aiFill.intValue());
|
||||||
value.setPlanNum(planDetail.getPlanNumber().intValue());
|
value.setPlanNum(planDetail.getPlanNumber().intValue());
|
||||||
|
value.setConfirmNum(finishedNumber.intValue());
|
||||||
value.setReportDate(planDetail.getDate());
|
value.setReportDate(planDetail.getDate());
|
||||||
value.setPlanDate(planDetail.getDate());
|
value.setPlanDate(planDetail.getDate());
|
||||||
// 计算产值
|
// 计算产值
|
||||||
@ -1054,6 +1059,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
|
|||||||
value.setArtificialNum(finishedNumber.subtract(aiFill).intValue());
|
value.setArtificialNum(finishedNumber.subtract(aiFill).intValue());
|
||||||
value.setUavNum(aiFill.intValue());
|
value.setUavNum(aiFill.intValue());
|
||||||
value.setPlanNum(planDetail.getPlanNumber().intValue());
|
value.setPlanNum(planDetail.getPlanNumber().intValue());
|
||||||
|
value.setConfirmNum(finishedNumber.intValue());
|
||||||
value.setReportDate(planDetail.getDate());
|
value.setReportDate(planDetail.getDate());
|
||||||
value.setPlanDate(planDetail.getDate());
|
value.setPlanDate(planDetail.getDate());
|
||||||
// 计算产值
|
// 计算产值
|
||||||
|
|||||||
@ -31,7 +31,6 @@ import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionGisR
|
|||||||
import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionQueryReq;
|
import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionQueryReq;
|
||||||
import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionUpdateReq;
|
import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionUpdateReq;
|
||||||
import org.dromara.quality.domain.enums.QltQualityInspectionStatusEnum;
|
import org.dromara.quality.domain.enums.QltQualityInspectionStatusEnum;
|
||||||
import org.dromara.quality.domain.enums.QltQualityInspectionVerificationTypeEnum;
|
|
||||||
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionGis;
|
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionGis;
|
||||||
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionListGisVo;
|
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionListGisVo;
|
||||||
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionVo;
|
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionVo;
|
||||||
@ -170,17 +169,17 @@ public class QltQualityInspectionServiceImpl extends ServiceImpl<QltQualityInspe
|
|||||||
// 获取整改情况
|
// 获取整改情况
|
||||||
long passCount = 0L;
|
long passCount = 0L;
|
||||||
for (QltQualityInspection qualityInspection : qualityInspectionList) {
|
for (QltQualityInspection qualityInspection : qualityInspectionList) {
|
||||||
if ("1".equals(qualityInspection.getIsReply())
|
if ("1".equals(qualityInspection.getIsReply())) {
|
||||||
&& QltQualityInspectionStatusEnum.VERIFICATION.getValue().equals(qualityInspection.getInspectionStatus())
|
if (!qualityInspection.getInspectionStatus().equals(QltQualityInspectionStatusEnum.INFORM.getValue())) {
|
||||||
&& QltQualityInspectionVerificationTypeEnum.PASS.getValue().equals(qualityInspection.getVerificationType())) {
|
|
||||||
passCount++;
|
|
||||||
} else if ("2".equals(qualityInspection.getIsReply())
|
|
||||||
&& QltQualityInspectionStatusEnum.RECTIFICATION.getValue().equals(qualityInspection.getInspectionStatus())) {
|
|
||||||
passCount++;
|
passCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
gisVo.setList(gisList);
|
gisVo.setList(gisList);
|
||||||
gisVo.setCount((long) qualityInspectionList.size());
|
gisVo.setCount((long) qualityInspectionList.stream()
|
||||||
|
.filter(q -> "2".equals(q.getIsReply()))
|
||||||
|
.toList()
|
||||||
|
.size());
|
||||||
gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / qualityInspectionList.size()));
|
gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / qualityInspectionList.size()));
|
||||||
return gisVo;
|
return gisVo;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,12 +30,10 @@ import org.dromara.project.domain.BusProjectTeam;
|
|||||||
import org.dromara.project.service.IBusProjectService;
|
import org.dromara.project.service.IBusProjectService;
|
||||||
import org.dromara.project.service.IBusProjectTeamMemberService;
|
import org.dromara.project.service.IBusProjectTeamMemberService;
|
||||||
import org.dromara.project.service.IBusProjectTeamService;
|
import org.dromara.project.service.IBusProjectTeamService;
|
||||||
import org.dromara.quality.domain.enums.QltQualityInspectionStatusEnum;
|
|
||||||
import org.dromara.safety.constant.HseSafetyConstant;
|
import org.dromara.safety.constant.HseSafetyConstant;
|
||||||
import org.dromara.safety.domain.HseSafetyInspection;
|
import org.dromara.safety.domain.HseSafetyInspection;
|
||||||
import org.dromara.safety.domain.HseTeamMeeting;
|
import org.dromara.safety.domain.HseTeamMeeting;
|
||||||
import org.dromara.safety.domain.dto.safetyinspection.*;
|
import org.dromara.safety.domain.dto.safetyinspection.*;
|
||||||
import org.dromara.safety.domain.enums.HseSafetyInspectionReviewTypeEnum;
|
|
||||||
import org.dromara.safety.domain.enums.HseSafetyInspectionStatusEnum;
|
import org.dromara.safety.domain.enums.HseSafetyInspectionStatusEnum;
|
||||||
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionListGisVo;
|
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionListGisVo;
|
||||||
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo;
|
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo;
|
||||||
@ -225,18 +223,16 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
|
|||||||
.list();
|
.list();
|
||||||
long passCount = 0L;
|
long passCount = 0L;
|
||||||
for (HseSafetyInspection safetyInspection : safetyInspectionList) {
|
for (HseSafetyInspection safetyInspection : safetyInspectionList) {
|
||||||
if ("1".equals(safetyInspection.getIsReply())
|
if ("1".equals(safetyInspection.getIsReply())) {
|
||||||
&& HseSafetyInspectionStatusEnum.REVIEW.getValue().equals(safetyInspection.getStatus())
|
if (!safetyInspection.getStatus().equals(HseSafetyInspectionStatusEnum.INFORM.getValue())) {
|
||||||
&& HseSafetyInspectionReviewTypeEnum.PASS.getValue().equals(safetyInspection.getReviewType())) {
|
|
||||||
passCount++;
|
|
||||||
} else if ("2".equals(safetyInspection.getIsReply())
|
|
||||||
&& QltQualityInspectionStatusEnum.RECTIFICATION.getValue().equals(safetyInspection.getStatus())
|
|
||||||
) {
|
|
||||||
passCount++;
|
passCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
gisVo.setTeamMeetingCount((long) teamMeetings.size());
|
gisVo.setTeamMeetingCount((long) teamMeetings.size());
|
||||||
gisVo.setSafetyInspectionCount((long) safetyInspectionList.size());
|
gisVo.setSafetyInspectionCount((long) safetyInspectionList.stream()
|
||||||
|
.filter(q -> "2".equals(q.getIsReply()))
|
||||||
|
.toList().size());
|
||||||
gisVo.setCorrectSituationCount(passCount);
|
gisVo.setCorrectSituationCount(passCount);
|
||||||
gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / safetyInspectionList.size()));
|
gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / safetyInspectionList.size()));
|
||||||
return gisVo;
|
return gisVo;
|
||||||
|
|||||||
Reference in New Issue
Block a user