同步
This commit is contained in:
@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectImageProgressVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectLandVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectPeopleVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectSafetyInspectionVo;
|
||||
import org.dromara.bigscreen.service.ProjectBigScreenService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.land.domain.BusLandBlock;
|
||||
@ -124,4 +127,44 @@ public class ProjectBigScreenController {
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(projectBigScreenService.getProjectNews(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目AI安全巡检
|
||||
*/
|
||||
@SaCheckPermission("project:bigScreen:safetyInspection")
|
||||
@GetMapping("/safetyInspection/{projectId}")
|
||||
public R<List<ProjectSafetyInspectionVo>> getProjectSafetyInspection(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(projectBigScreenService.getProjectSafetyInspection(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目人员情况
|
||||
*/
|
||||
@SaCheckPermission("project:bigScreen:people")
|
||||
@GetMapping("/people/{projectId}")
|
||||
public R<ProjectPeopleVo> getProjectPeople(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(projectBigScreenService.getProjectPeople(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目形象进度
|
||||
*/
|
||||
@SaCheckPermission("project:bigScreen:imageProgress")
|
||||
@GetMapping("/imageProgress/{projectId}")
|
||||
public R<ProjectImageProgressVo> getProjectImageProgress(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(projectBigScreenService.getProjectImageProgress(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目概括
|
||||
*/
|
||||
@SaCheckPermission("project:bigScreen:generalize")
|
||||
@GetMapping("/generalize/{projectId}")
|
||||
public R<String> getProjectGeneralize(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(projectBigScreenService.getProjectGeneralize(projectId));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-08-22 20:05
|
||||
*/
|
||||
@Data
|
||||
public class ProjectImageProgressVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 7963637133004484891L;
|
||||
|
||||
/**
|
||||
* 场区百分比
|
||||
*/
|
||||
private BigDecimal areaPercentage;
|
||||
|
||||
/**
|
||||
* 道路百分比
|
||||
*/
|
||||
private BigDecimal roadPercentage;
|
||||
|
||||
/**
|
||||
* 集电线路百分比
|
||||
*/
|
||||
private BigDecimal collectorLinePercentage;
|
||||
|
||||
/**
|
||||
* 送出线路百分比
|
||||
*/
|
||||
private BigDecimal exportLinePercentage;
|
||||
|
||||
/**
|
||||
* 升压站百分比
|
||||
*/
|
||||
private BigDecimal substationPercentage;
|
||||
|
||||
/**
|
||||
* 箱变百分比
|
||||
*/
|
||||
private BigDecimal boxTransformerPercentage;
|
||||
|
||||
/**
|
||||
* 总百分比
|
||||
*/
|
||||
private BigDecimal totalPercentage;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-08-22 20:03
|
||||
*/
|
||||
@Data
|
||||
public class ProjectPeopleVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -3169574372374491372L;
|
||||
|
||||
/**
|
||||
* 施工人员数量
|
||||
*/
|
||||
private BigDecimal peopleCount;
|
||||
|
||||
/**
|
||||
* 出勤人员数量
|
||||
*/
|
||||
private BigDecimal attendanceCount;
|
||||
|
||||
/**
|
||||
* 出勤率
|
||||
*/
|
||||
private BigDecimal attendanceRate;
|
||||
|
||||
/**
|
||||
* 班组出勤信息
|
||||
*/
|
||||
private List<ProjectTeamAttendanceVo> teamAttendanceList;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-08-22 19:58
|
||||
*/
|
||||
@Data
|
||||
public class ProjectSafetyInspectionVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 5077897258656815177L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 违章类型(多个逗号分隔)
|
||||
*/
|
||||
private String violationType;
|
||||
|
||||
/**
|
||||
* 图片路径
|
||||
*/
|
||||
private String picture;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-08-22 20:29
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectTeamAttendanceVo {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 出勤人数
|
||||
*/
|
||||
private BigDecimal attendanceNumber;
|
||||
|
||||
/**
|
||||
* 总人数
|
||||
*/
|
||||
private BigDecimal allNumber;
|
||||
|
||||
/**
|
||||
* 出勤率
|
||||
*/
|
||||
private BigDecimal attendanceRate;
|
||||
|
||||
/**
|
||||
* 考勤时间
|
||||
*/
|
||||
private String attendanceTime;
|
||||
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
import org.dromara.bigscreen.domain.vo.ProjectImageProgressVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectPeopleVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectSafetyInspectionVo;
|
||||
import org.dromara.project.domain.vo.project.BusProjectSafetyDayVo;
|
||||
import org.dromara.project.domain.vo.project.BusProjectWeatherVo;
|
||||
import org.dromara.project.domain.vo.projectnews.BusProjectNewsVo;
|
||||
@ -35,4 +38,36 @@ public interface ProjectBigScreenService {
|
||||
* @return 项目新闻
|
||||
*/
|
||||
List<BusProjectNewsVo> getProjectNews(Long projectId);
|
||||
|
||||
/**
|
||||
* 获取项目安全检查
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 项目安全检查
|
||||
*/
|
||||
List<ProjectSafetyInspectionVo> getProjectSafetyInspection(Long projectId);
|
||||
|
||||
/**
|
||||
* 获取项目人员
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 项目人员
|
||||
*/
|
||||
ProjectPeopleVo getProjectPeople(Long projectId);
|
||||
|
||||
/**
|
||||
* 获取项目形象进度
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 项目形象进度
|
||||
*/
|
||||
ProjectImageProgressVo getProjectImageProgress(Long projectId);
|
||||
|
||||
/**
|
||||
* 获取项目概括
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 项目概括
|
||||
*/
|
||||
String getProjectGeneralize(Long projectId);
|
||||
}
|
||||
|
@ -1,18 +1,38 @@
|
||||
package org.dromara.bigscreen.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectImageProgressVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectPeopleVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectSafetyInspectionVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectTeamAttendanceVo;
|
||||
import org.dromara.bigscreen.service.ProjectBigScreenService;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.utils.BigDecimalUtil;
|
||||
import org.dromara.contractor.domain.SubConstructionUser;
|
||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.project.domain.BusProjectTeam;
|
||||
import org.dromara.project.domain.BusProjectTeamMember;
|
||||
import org.dromara.project.domain.vo.project.BusProjectSafetyDayVo;
|
||||
import org.dromara.project.domain.vo.project.BusProjectWeatherVo;
|
||||
import org.dromara.project.domain.vo.projectnews.BusProjectNewsVo;
|
||||
import org.dromara.project.service.IBusProjectNewsService;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.project.service.*;
|
||||
import org.dromara.safety.domain.HseRecognizeRecord;
|
||||
import org.dromara.safety.service.IHseRecognizeRecordService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
@ -27,6 +47,21 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
@Resource
|
||||
private IBusProjectNewsService projectNewsService;
|
||||
|
||||
@Resource
|
||||
private IHseRecognizeRecordService recognizeRecordService;
|
||||
|
||||
@Resource
|
||||
private ISubConstructionUserService constructionUserService;
|
||||
|
||||
@Resource
|
||||
private IBusAttendanceService attendanceService;
|
||||
|
||||
@Resource
|
||||
private IBusProjectTeamService projectTeamService;
|
||||
|
||||
@Resource
|
||||
private IBusProjectTeamMemberService projectTeamMemberService;
|
||||
|
||||
/**
|
||||
* 获取项目天气
|
||||
*
|
||||
@ -63,6 +98,173 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
return projectNewsService.queryListByProject(projectId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目安全检查
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 项目安全检查
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectSafetyInspectionVo> getProjectSafetyInspection(Long projectId) {
|
||||
checkProject(projectId);
|
||||
List<HseRecognizeRecord> recordList = recognizeRecordService.lambdaQuery()
|
||||
.eq(HseRecognizeRecord::getProjectId, projectId)
|
||||
.orderByDesc(HseRecognizeRecord::getCreateTime) // 按创建时间倒序
|
||||
.last("limit 10") // 只取前10条
|
||||
.list();
|
||||
return recordList.stream().map(record -> {
|
||||
ProjectSafetyInspectionVo vo = new ProjectSafetyInspectionVo();
|
||||
BeanUtils.copyProperties(record, vo);
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目人员
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 项目人员
|
||||
*/
|
||||
@Override
|
||||
public ProjectPeopleVo getProjectPeople(Long projectId) {
|
||||
// 参数校验
|
||||
BusProject project = projectService.getById(projectId);
|
||||
if (project == null) {
|
||||
throw new ServiceException("项目信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
// 获取大屏数据
|
||||
ProjectPeopleVo vo = new ProjectPeopleVo();
|
||||
// 获取施工人员总数
|
||||
Long count = constructionUserService.lambdaQuery()
|
||||
.eq(SubConstructionUser::getProjectId, projectId).count();
|
||||
BigDecimal countDec = BigDecimal.valueOf(count);
|
||||
vo.setPeopleCount(countDec);
|
||||
// 获取考勤数据
|
||||
List<Long> attendancePeopleList = attendanceService.listAttendancePeopleByProjectId(projectId);
|
||||
BigDecimal attendanceSize = BigDecimal.valueOf(attendancePeopleList.size());
|
||||
vo.setAttendanceCount(attendanceSize);
|
||||
// 计算考勤率
|
||||
vo.setAttendanceRate(BigDecimalUtil.toPercentage(attendanceSize, countDec));
|
||||
if (count != 0) {
|
||||
// 统计班组人数
|
||||
List<BusProjectTeamMember> memberList = projectTeamMemberService.lambdaQuery()
|
||||
.select(BusProjectTeamMember::getId, BusProjectTeamMember::getTeamId)
|
||||
.eq(BusProjectTeamMember::getProjectId, projectId)
|
||||
.list();
|
||||
Map<Long, List<BusProjectTeamMember>> memberMap = memberList.stream()
|
||||
.collect(Collectors.groupingBy(BusProjectTeamMember::getTeamId));
|
||||
// 统计班组考勤数据
|
||||
Map<Long, List<SubConstructionUser>> userTeamMap = new HashMap<>();
|
||||
if (CollUtil.isNotEmpty(attendancePeopleList)) {
|
||||
List<SubConstructionUser> users = constructionUserService.listByIds(attendancePeopleList);
|
||||
userTeamMap = users.stream()
|
||||
.collect(Collectors.groupingBy(SubConstructionUser::getTeamId));
|
||||
}
|
||||
List<BusProjectTeam> teamList = projectTeamService.lambdaQuery()
|
||||
.eq(BusProjectTeam::getProjectId, projectId)
|
||||
.list();
|
||||
String punchRange = project.getPunchRange();
|
||||
String punchTime = "";
|
||||
if (punchRange != null) {
|
||||
String start = punchRange.split(",")[0];
|
||||
punchTime = LocalDate.now() + " " + start;
|
||||
}
|
||||
List<ProjectTeamAttendanceVo> listVo = new ArrayList<>();
|
||||
for (BusProjectTeam projectTeam : teamList) {
|
||||
ProjectTeamAttendanceVo teamAttendanceVo = new ProjectTeamAttendanceVo();
|
||||
Long id = projectTeam.getId();
|
||||
teamAttendanceVo.setId(id);
|
||||
teamAttendanceVo.setTeamName(projectTeam.getTeamName());
|
||||
teamAttendanceVo.setAttendanceTime(punchTime);
|
||||
BigDecimal allNumber = BigDecimal.ZERO;
|
||||
if (memberMap.containsKey(id)) {
|
||||
allNumber = BigDecimal.valueOf(memberMap.get(id).size());
|
||||
}
|
||||
BigDecimal attendanceNumber = BigDecimal.ZERO;
|
||||
if (CollUtil.isNotEmpty(userTeamMap) && userTeamMap.containsKey(id)) {
|
||||
attendanceNumber = BigDecimal.valueOf(userTeamMap.get(id).size());
|
||||
}
|
||||
teamAttendanceVo.setAttendanceNumber(attendanceNumber);
|
||||
teamAttendanceVo.setAllNumber(allNumber);
|
||||
teamAttendanceVo.setAttendanceRate(BigDecimalUtil.toPercentage(attendanceNumber, allNumber));
|
||||
listVo.add(teamAttendanceVo);
|
||||
}
|
||||
vo.setTeamAttendanceList(listVo);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目形象进度
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 项目形象进度
|
||||
*/
|
||||
@Override
|
||||
public ProjectImageProgressVo getProjectImageProgress(Long projectId) {
|
||||
checkProject(projectId);
|
||||
// 生成 0 ~ 100 的随机 double
|
||||
double random = RandomUtil.randomDouble(0, 100);
|
||||
|
||||
// 保留两位小数(四舍五入)
|
||||
double result = NumberUtil.round(random, 2).doubleValue();
|
||||
ProjectImageProgressVo vo = new ProjectImageProgressVo();
|
||||
vo.setAreaPercentage(BigDecimal.valueOf(result));
|
||||
// 生成 0 ~ 100 的随机 double
|
||||
double random1 = RandomUtil.randomDouble(0, 100);
|
||||
|
||||
// 保留两位小数(四舍五入)
|
||||
double result1 = NumberUtil.round(random1, 2).doubleValue();
|
||||
vo.setRoadPercentage(BigDecimal.valueOf(result1));
|
||||
// 生成 0 ~ 100 的随机 double
|
||||
double random2 = RandomUtil.randomDouble(0, 100);
|
||||
|
||||
// 保留两位小数(四舍五入)
|
||||
double result2 = NumberUtil.round(random2, 2).doubleValue();
|
||||
vo.setCollectorLinePercentage(BigDecimal.valueOf(result2));
|
||||
// 生成 0 ~ 100 的随机 double
|
||||
double random3 = RandomUtil.randomDouble(0, 100);
|
||||
|
||||
// 保留两位小数(四舍五入)
|
||||
double result3 = NumberUtil.round(random3, 2).doubleValue();
|
||||
vo.setExportLinePercentage(BigDecimal.valueOf(result3));
|
||||
// 生成 0 ~ 100 的随机 double
|
||||
double random4 = RandomUtil.randomDouble(0, 100);
|
||||
|
||||
// 保留两位小数(四舍五入)
|
||||
double result4 = NumberUtil.round(random4, 2).doubleValue();
|
||||
vo.setSubstationPercentage(BigDecimal.valueOf(result4));
|
||||
// 生成 0 ~ 100 的随机 double
|
||||
double random5 = RandomUtil.randomDouble(0, 100);
|
||||
|
||||
// 保留两位小数(四舍五入)
|
||||
double result5 = NumberUtil.round(random5, 2).doubleValue();
|
||||
vo.setBoxTransformerPercentage(BigDecimal.valueOf(result5));
|
||||
|
||||
// 生成 0 ~ 100 的随机 double
|
||||
double random6 = RandomUtil.randomDouble(0, 100);
|
||||
|
||||
// 保留两位小数(四舍五入)
|
||||
double result6 = NumberUtil.round(random6, 2).doubleValue();
|
||||
vo.setTotalPercentage(BigDecimal.valueOf(result6));
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目概括
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 项目概括
|
||||
*/
|
||||
@Override
|
||||
public String getProjectGeneralize(Long projectId) {
|
||||
BusProject project = projectService.getById(projectId);
|
||||
if (project == null) {
|
||||
throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
return project.getProjectGeneralize();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查项目是否存在
|
||||
*
|
||||
|
@ -239,7 +239,8 @@ public class FacBoxTransformerServiceImpl extends ServiceImpl<FacBoxTransformerM
|
||||
.stream().collect(Collectors.groupingBy(FacBoxTransformer::getProgressCategoryId));
|
||||
for (PgsProgressCategory progressCategory : progressCategoryList) {
|
||||
Long progressCategoryId = progressCategory.getId();
|
||||
BigDecimal unitPrice = progressCategory.getUnitPrice();
|
||||
BigDecimal unitPrice = progressCategory.getOwnerPrice();
|
||||
// todo BigDecimal unitPrice = progressCategory.getUnitPrice();
|
||||
int total = 0;
|
||||
if (countMap.containsKey(progressCategoryId)) {
|
||||
total = countMap.get(progressCategoryId).size();
|
||||
@ -302,9 +303,13 @@ public class FacBoxTransformerServiceImpl extends ServiceImpl<FacBoxTransformerM
|
||||
}
|
||||
BigDecimal total = BigDecimal.valueOf(newBoxTransformerList.size());
|
||||
progressCategory.setTotal(total);
|
||||
progressCategory.setOutputValue(total.multiply(
|
||||
/* todo progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getUnitPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));*/
|
||||
progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getOwnerPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));
|
||||
boolean result = progressCategoryService.updateById(progressCategory);
|
||||
if (!result) {
|
||||
|
@ -239,7 +239,8 @@ public class FacInverterServiceImpl extends ServiceImpl<FacInverterMapper, FacIn
|
||||
.stream().collect(Collectors.groupingBy(FacInverter::getProgressCategoryId));
|
||||
for (PgsProgressCategory progressCategory : progressCategoryList) {
|
||||
Long progressCategoryId = progressCategory.getId();
|
||||
BigDecimal unitPrice = progressCategory.getUnitPrice();
|
||||
// todo BigDecimal unitPrice = progressCategory.getUnitPrice();
|
||||
BigDecimal unitPrice = progressCategory.getOwnerPrice();
|
||||
int total = 0;
|
||||
if (countMap.containsKey(progressCategoryId)) {
|
||||
total = countMap.get(progressCategoryId).size();
|
||||
@ -303,9 +304,13 @@ public class FacInverterServiceImpl extends ServiceImpl<FacInverterMapper, FacIn
|
||||
BigDecimal total = BigDecimal.valueOf(newInverterList.size());
|
||||
progressCategory.setTotal(total);
|
||||
progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getUnitPrice())
|
||||
Optional.ofNullable(progressCategory.getOwnerPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));
|
||||
/* todo progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getUnitPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));*/
|
||||
boolean result = progressCategoryService.updateById(progressCategory);
|
||||
if (!result) {
|
||||
throw new ServiceException("更新进度失败,数据库异常", HttpStatus.ERROR);
|
||||
|
@ -176,9 +176,13 @@ public class FacPhotovoltaicPanelColumnServiceImpl extends ServiceImpl<FacPhotov
|
||||
BigDecimal total = BigDecimal.valueOf(newColumnList.size());
|
||||
progressCategory.setTotal(total);
|
||||
progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getUnitPrice())
|
||||
Optional.ofNullable(progressCategory.getOwnerPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));
|
||||
/* todo progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getUnitPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));*/
|
||||
boolean result = progressCategoryService.updateById(progressCategory);
|
||||
if (!result) {
|
||||
throw new ServiceException("更新进度失败,数据库异常", HttpStatus.ERROR);
|
||||
|
@ -469,7 +469,8 @@ public class FacPhotovoltaicPanelPartsServiceImpl implements IFacPhotovoltaicPan
|
||||
.stream().collect(Collectors.groupingBy(FacPhotovoltaicPanelSupport::getProgressCategoryId));
|
||||
for (PgsProgressCategory progressCategory : progressCategoryList) {
|
||||
Long progressCategoryId = progressCategory.getId();
|
||||
BigDecimal unitPrice = progressCategory.getUnitPrice();
|
||||
// todo BigDecimal unitPrice = progressCategory.getUnitPrice();
|
||||
BigDecimal unitPrice = progressCategory.getOwnerPrice();
|
||||
int total = 0;
|
||||
if (pointCountMap.containsKey(progressCategoryId)) {
|
||||
total = pointCountMap.get(progressCategoryId).size();
|
||||
|
@ -176,9 +176,13 @@ public class FacPhotovoltaicPanelPointServiceImpl extends ServiceImpl<FacPhotovo
|
||||
BigDecimal total = BigDecimal.valueOf(newPointList.size());
|
||||
progressCategory.setTotal(total);
|
||||
progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getUnitPrice())
|
||||
Optional.ofNullable(progressCategory.getOwnerPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));
|
||||
/* todo progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getUnitPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));*/
|
||||
boolean result = progressCategoryService.updateById(progressCategory);
|
||||
if (!result) {
|
||||
throw new ServiceException("更新进度失败,数据库异常", HttpStatus.ERROR);
|
||||
|
@ -369,7 +369,8 @@ public class FacPhotovoltaicPanelServiceImpl extends ServiceImpl<FacPhotovoltaic
|
||||
.stream().collect(Collectors.groupingBy(FacPhotovoltaicPanel::getProgressCategoryId));
|
||||
for (PgsProgressCategory progressCategory : progressCategoryList) {
|
||||
Long progressCategoryId = progressCategory.getId();
|
||||
BigDecimal unitPrice = progressCategory.getUnitPrice();
|
||||
// todo BigDecimal unitPrice = progressCategory.getUnitPrice();
|
||||
BigDecimal unitPrice = progressCategory.getOwnerPrice();
|
||||
int total = 0;
|
||||
if (countMap.containsKey(progressCategoryId)) {
|
||||
total = countMap.get(progressCategoryId).size();
|
||||
@ -507,9 +508,13 @@ public class FacPhotovoltaicPanelServiceImpl extends ServiceImpl<FacPhotovoltaic
|
||||
}
|
||||
BigDecimal total = BigDecimal.valueOf(newPanelList.size());
|
||||
progressCategory.setTotal(total);
|
||||
progressCategory.setOutputValue(total.multiply(
|
||||
/* todo progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getUnitPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
)); */
|
||||
progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getOwnerPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));
|
||||
boolean result = progressCategoryService.updateById(progressCategory);
|
||||
if (!result) {
|
||||
|
@ -176,9 +176,13 @@ public class FacPhotovoltaicPanelSupportServiceImpl extends ServiceImpl<FacPhoto
|
||||
BigDecimal total = BigDecimal.valueOf(newSupportList.size());
|
||||
progressCategory.setTotal(total);
|
||||
progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getUnitPrice())
|
||||
Optional.ofNullable(progressCategory.getOwnerPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));
|
||||
/* todo progressCategory.setOutputValue(total.multiply(
|
||||
Optional.ofNullable(progressCategory.getUnitPrice())
|
||||
.orElse(BigDecimal.ZERO)
|
||||
));*/
|
||||
boolean result = progressCategoryService.updateById(progressCategory);
|
||||
if (!result) {
|
||||
throw new ServiceException("更新进度失败,数据库异常", HttpStatus.ERROR);
|
||||
|
@ -127,9 +127,11 @@ public class OutConstructionValueServiceImpl extends ServiceImpl<OutConstruction
|
||||
PgsProgressCategory progressCategory = pgsProgressCategoryService.getById(bo.getProgressCategoryId());
|
||||
if (progressCategory != null) {
|
||||
if ("1".equals(progressCategory.getUnitType())) {
|
||||
add.setOutValue(progressCategory.getUnitPrice().multiply(BigDecimal.valueOf(bo.getArtificialNum())));
|
||||
// todo add.setOutValue(progressCategory.getUnitPrice().multiply(BigDecimal.valueOf(bo.getArtificialNum())));
|
||||
add.setOutValue(progressCategory.getOwnerPrice().multiply(BigDecimal.valueOf(bo.getArtificialNum())));
|
||||
} else if ("2".equals(progressCategory.getUnitType())) {
|
||||
add.setOutValue(progressCategory.getUnitPrice().multiply(BigDecimal.valueOf(bo.getUavNum()).divide(new BigDecimal("100"))));
|
||||
// todo add.setOutValue(progressCategory.getUnitPrice().multiply(BigDecimal.valueOf(bo.getUavNum()).divide(new BigDecimal("100"))));
|
||||
add.setOutValue(progressCategory.getOwnerPrice().multiply(BigDecimal.valueOf(bo.getUavNum()).divide(new BigDecimal("100"))));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,9 +65,14 @@ public class PgsProgressCategory extends BaseEntity {
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 综合单价
|
||||
* 综合单价(业主)
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
private BigDecimal ownerPrice;
|
||||
|
||||
/**
|
||||
* 综合单价(分包)
|
||||
*/
|
||||
private BigDecimal constructionPrice;
|
||||
|
||||
/**
|
||||
* 产值金额
|
||||
|
@ -24,9 +24,14 @@ public class PgsProgressCategoryCreatePriceReq {
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 综合单价
|
||||
* 综合单价(业主)
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
private BigDecimal ownerPrice;
|
||||
|
||||
/**
|
||||
* 综合单价(分包)
|
||||
*/
|
||||
private BigDecimal constructionPrice;
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
|
@ -49,10 +49,16 @@ public class PgsProgressCategoryCreateReq implements Serializable {
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 综合单价
|
||||
* 综合单价(业主)
|
||||
*/
|
||||
@NotNull(message = "综合单价不能为空")
|
||||
private BigDecimal unitPrice;
|
||||
@NotNull(message = "综合单价(业主)不能为空")
|
||||
private BigDecimal ownerPrice;
|
||||
|
||||
/**
|
||||
* 综合单价(分包)
|
||||
*/
|
||||
@NotNull(message = "综合单价(分包)不能为空")
|
||||
private BigDecimal constructionPrice;
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
|
@ -125,10 +125,16 @@ public class PgsProgressCategoryVo implements Serializable {
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 综合单价
|
||||
* 综合单价(业主)
|
||||
*/
|
||||
@ExcelProperty(value = "综合单价")
|
||||
private BigDecimal unitPrice;
|
||||
@ExcelProperty(value = "综合单价(业主)")
|
||||
private BigDecimal ownerPrice;
|
||||
|
||||
/**
|
||||
* 综合单价(分包)
|
||||
*/
|
||||
@ExcelProperty(value = "综合单价(分包)")
|
||||
private BigDecimal constructionPrice;
|
||||
|
||||
/**
|
||||
* 产值金额
|
||||
|
@ -181,7 +181,8 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByReq(PgsProgressCategoryCreateReq req) {
|
||||
BigDecimal unitPrice = req.getUnitPrice();
|
||||
// todo BigDecimal unitPrice = req.getUnitPrice();
|
||||
BigDecimal unitPrice = req.getOwnerPrice();
|
||||
BigDecimal total = req.getTotal();
|
||||
String workType = req.getWorkType();
|
||||
PgsProgressCategory progressCategory = new PgsProgressCategory();
|
||||
@ -259,7 +260,8 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
|
||||
throw new ServiceException("该分项工程不存在", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
// 计算产值
|
||||
BigDecimal unitPrice = req.getUnitPrice();
|
||||
// todo BigDecimal unitPrice = req.getUnitPrice();
|
||||
BigDecimal unitPrice = req.getOwnerPrice();
|
||||
BigDecimal outputValue = BigDecimal.ZERO;
|
||||
if (progressCategory.getUnitType().equals(PgsProgressUnitTypeEnum.PERCENTAGE.getValue())) {
|
||||
progressCategory.setTotal(req.getTotal());
|
||||
@ -282,7 +284,8 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
|
||||
}
|
||||
// 填入数据
|
||||
progressCategory.setUnit(req.getUnit());
|
||||
progressCategory.setUnitPrice(unitPrice);
|
||||
progressCategory.setOwnerPrice(unitPrice);
|
||||
// todo progressCategory.setUnitPrice(unitPrice);
|
||||
progressCategory.setOutputValue(outputValue);
|
||||
// 写入数据库
|
||||
return this.updateById(progressCategory);
|
||||
|
@ -140,6 +140,11 @@ public class BusProject extends BaseEntity {
|
||||
*/
|
||||
private String tenderFiles;
|
||||
|
||||
/**
|
||||
* 项目概括
|
||||
*/
|
||||
private String projectGeneralize;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
|
@ -110,6 +110,11 @@ public class BusProjectCreateReq implements Serializable {
|
||||
*/
|
||||
private String tenderFiles;
|
||||
|
||||
/**
|
||||
* 项目概括
|
||||
*/
|
||||
private String projectGeneralize;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
|
@ -127,6 +127,11 @@ public class BusProjectUpdateReq implements Serializable {
|
||||
*/
|
||||
private String tenderFiles;
|
||||
|
||||
/**
|
||||
* 项目概括
|
||||
*/
|
||||
private String projectGeneralize;
|
||||
|
||||
/**
|
||||
* 显示隐藏(0显示 1隐藏)
|
||||
*/
|
||||
|
Reference in New Issue
Block a user