包头bug修改
This commit is contained in:
parent
d6c01ae888
commit
c868efeb1f
@ -93,16 +93,26 @@ public class ContractorMonthlyApprove implements Serializable {
|
|||||||
/**年份*/
|
/**年份*/
|
||||||
@ApiModelProperty(value="年份")
|
@ApiModelProperty(value="年份")
|
||||||
private java.lang.Integer year;
|
private java.lang.Integer year;
|
||||||
/**月份*/
|
/**
|
||||||
|
* 月份
|
||||||
|
*/
|
||||||
@ApiModelProperty(value = "月份")
|
@ApiModelProperty(value = "月份")
|
||||||
private java.lang.Integer month;
|
private java.lang.Integer month;
|
||||||
/**1是第一周类推*/
|
/**
|
||||||
|
* 1是第一周类推
|
||||||
|
*/
|
||||||
@ApiModelProperty(value = "1是第一周类推")
|
@ApiModelProperty(value = "1是第一周类推")
|
||||||
private java.lang.Integer whichWeek;
|
private java.lang.Integer whichWeek;
|
||||||
/**1月报周报;2三周(月)滚动计划**/
|
/**
|
||||||
|
* 1月报周报;2三周(月)滚动计划
|
||||||
|
**/
|
||||||
@ApiModelProperty(value = "1月报周报;2三周(月)滚动计划")
|
@ApiModelProperty(value = "1月报周报;2三周(月)滚动计划")
|
||||||
private java.lang.Integer menuType;
|
private java.lang.Integer menuType;
|
||||||
|
/**
|
||||||
|
* 周报月报附件
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "周报月报附件")
|
||||||
|
private java.lang.String weekToMonthFileList;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "发起人名称")
|
@ApiModelProperty(value = "发起人名称")
|
||||||
private java.lang.String initiatorName;
|
private java.lang.String initiatorName;
|
||||||
|
|||||||
@ -47,7 +47,9 @@ public class ContractorMonthlyDetail implements Serializable {
|
|||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value="创建时间 yyyy-MM-dd HH:mm:ss")
|
@ApiModelProperty(value="创建时间 yyyy-MM-dd HH:mm:ss")
|
||||||
private java.util.Date createDate;
|
private java.util.Date createDate;
|
||||||
/**更新时间 yyyy-MM-dd HH:mm:ss*/
|
/**
|
||||||
|
* 更新时间 yyyy-MM-dd HH:mm:ss
|
||||||
|
*/
|
||||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
|
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
|
||||||
@ -56,4 +58,9 @@ public class ContractorMonthlyDetail implements Serializable {
|
|||||||
private java.lang.Long approveDeviceId;
|
private java.lang.Long approveDeviceId;
|
||||||
@ApiModelProperty(value = "承包商项自组审批id")
|
@ApiModelProperty(value = "承包商项自组审批id")
|
||||||
private java.lang.Long approveId;
|
private java.lang.Long approveId;
|
||||||
|
/**
|
||||||
|
* 周报月报附件
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "周报月报附件")
|
||||||
|
private java.lang.String weekToMonthFileList;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -116,6 +116,9 @@
|
|||||||
<if test="supplyStation != null and supplyStation != ''">
|
<if test="supplyStation != null and supplyStation != ''">
|
||||||
and t.supply_station = #{supplyStation}
|
and t.supply_station = #{supplyStation}
|
||||||
</if>
|
</if>
|
||||||
|
<!-- <if test="year != null and year != ''">-->
|
||||||
|
<!-- and t. = #{year}-->
|
||||||
|
<!-- </if>-->
|
||||||
<if test="groupby != null and groupby != ''">
|
<if test="groupby != null and groupby != ''">
|
||||||
${groupby}
|
${groupby}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@ -92,9 +92,10 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
and not exists(
|
and not exists(
|
||||||
select * from exam_train_record where application_id=t.id and worker_card=wad.id_card and application_type = 1
|
select * from exam_train_record where application_id=t.id and worker_id=wad.id and application_type = 1
|
||||||
and submit = 1
|
and submit = 1
|
||||||
)
|
)
|
||||||
|
and wad.is_certificate_qualified = 1
|
||||||
group by t.id
|
group by t.id
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package com.zhgd.xmgl.modules.baotou.plan.controller;
|
package com.zhgd.xmgl.modules.baotou.plan.controller;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@ -13,6 +12,8 @@ import com.zhgd.xmgl.modules.baotou.plan.entity.*;
|
|||||||
import com.zhgd.xmgl.modules.baotou.plan.entity.vo.PlanRecordCurve;
|
import com.zhgd.xmgl.modules.baotou.plan.entity.vo.PlanRecordCurve;
|
||||||
import com.zhgd.xmgl.modules.baotou.plan.mapper.PlanRecordMapper;
|
import com.zhgd.xmgl.modules.baotou.plan.mapper.PlanRecordMapper;
|
||||||
import com.zhgd.xmgl.modules.baotou.plan.service.*;
|
import com.zhgd.xmgl.modules.baotou.plan.service.*;
|
||||||
|
import com.zhgd.xmgl.modules.baotou.plan.service.impl.PlanRecordServiceImpl;
|
||||||
|
import com.zhgd.xmgl.util.MapBuilder;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
@ -27,6 +28,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -198,7 +200,7 @@ public class PlanRecordController {
|
|||||||
@ApiImplicitParam(name = "year", value = "年份", paramType = "query", required = false, dataType = "String")
|
@ApiImplicitParam(name = "year", value = "年份", paramType = "query", required = false, dataType = "String")
|
||||||
})
|
})
|
||||||
@GetMapping(value = "/getPlanCurve")
|
@GetMapping(value = "/getPlanCurve")
|
||||||
public Result<List<Map<String, Object>>> getPlanCurve(@RequestParam Map<String, Object> param) {
|
public Result<List<PlanRecordCurve>> getPlanCurve(@RequestParam Map<String, Object> param) {
|
||||||
String year = MapUtils.getString(param, "year");
|
String year = MapUtils.getString(param, "year");
|
||||||
if (StrUtil.isNotBlank(year)) {
|
if (StrUtil.isNotBlank(year)) {
|
||||||
param.put("beginDate", year + "-01" + "-01");
|
param.put("beginDate", year + "-01" + "-01");
|
||||||
@ -215,23 +217,74 @@ public class PlanRecordController {
|
|||||||
Long pbsId = MapUtils.getLong(param, "pbsId");
|
Long pbsId = MapUtils.getLong(param, "pbsId");
|
||||||
PlanPbs topPbs = planPbsService.getById(pbsId);
|
PlanPbs topPbs = planPbsService.getById(pbsId);
|
||||||
List<PlanPbs> planPbs = planPbsService.getChildren(pbsId);
|
List<PlanPbs> planPbs = planPbsService.getChildren(pbsId);
|
||||||
// planPbs.add(topPbs);
|
planPbs.add(topPbs);
|
||||||
// calByRecursionPbs(topPbs, planPbs);
|
|
||||||
|
|
||||||
PlanPeriod planPeriod = planPeriodService.getOne(new LambdaQueryWrapper<PlanPeriod>().eq(PlanPeriod::getProjectSn, projectSn));
|
|
||||||
List<Long> pbsIds = planPbs.stream().map(PlanPbs::getId).collect(Collectors.toList());
|
|
||||||
pbsIds.add(pbsId);
|
|
||||||
List<Map<String, Object>> rtList = new ArrayList<>();
|
|
||||||
List<PlanRecord> topRecords = planRecordService.list(new LambdaQueryWrapper<PlanRecord>()
|
|
||||||
.in(PlanRecord::getPbsId, pbsIds)
|
|
||||||
.eq(PlanRecord::getParentId, 0)
|
|
||||||
);
|
|
||||||
Map<Date, List<PlanFeedbackPeriod>> dateMap = new HashMap<>();
|
|
||||||
List<PlanMilestone> milestones = planMilestoneService.list(new LambdaQueryWrapper<PlanMilestone>().eq(PlanMilestone::getProjectSn, projectSn));
|
List<PlanMilestone> milestones = planMilestoneService.list(new LambdaQueryWrapper<PlanMilestone>().eq(PlanMilestone::getProjectSn, projectSn));
|
||||||
List<PlanRecord> allPlanRecords = planRecordMapper.selectList(new LambdaQueryWrapper<PlanRecord>().eq(PlanRecord::getProjectSn, projectSn));
|
List<PlanRecord> allPlanRecords = planRecordMapper.selectList(new LambdaQueryWrapper<PlanRecord>().eq(PlanRecord::getProjectSn, projectSn));
|
||||||
|
PlanPeriod period = planPeriodService.getOne(new LambdaQueryWrapper<PlanPeriod>().eq(PlanPeriod::getProjectSn, projectSn));
|
||||||
|
Map<String, PlanFeedback> recordIdMap = planFeedbackService.queryManyNewestFeedbackMap(new MapBuilder<String, Object>()
|
||||||
|
.put("projectSn", projectSn)
|
||||||
|
.put("approvalStatus", 3)
|
||||||
|
.build());
|
||||||
|
Map<String, PlanRecordCurve> curveMap = this.calByRecursionPbs(topPbs, planPbs, param, period, milestones, allPlanRecords, recordIdMap);
|
||||||
|
BigDecimal weightValue = topPbs.getWeightValue() != null ? NumberUtil.mul(topPbs.getWeightValue(), new BigDecimal("0.01")) : null;
|
||||||
|
for (Map.Entry<String, PlanRecordCurve> entry : curveMap.entrySet()) {
|
||||||
|
PlanRecordCurve curve = entry.getValue();
|
||||||
|
curve.setPlan(NumberUtil.round(NumberUtil.mul(curve.getPlan(), weightValue), 10));
|
||||||
|
curve.setPlanTotal(NumberUtil.round(NumberUtil.mul(curve.getPlanTotal(), weightValue), 10));
|
||||||
|
curve.setActual(NumberUtil.round(NumberUtil.mul(curve.getActual(), weightValue), 10));
|
||||||
|
curve.setActualTotal(NumberUtil.round(NumberUtil.mul(curve.getActualTotal(), weightValue), 10));
|
||||||
|
}
|
||||||
|
return Result.success(new ArrayList<>(curveMap.values()));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("", e);
|
||||||
|
return Result.success(new ArrayList<>(), e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归pbs计算曲线
|
||||||
|
*
|
||||||
|
* @param topPbs
|
||||||
|
* @param planPbs
|
||||||
|
* @param param
|
||||||
|
* @param planPeriod
|
||||||
|
* @param milestones
|
||||||
|
* @param allPlanRecords
|
||||||
|
* @param recordIdMap
|
||||||
|
*/
|
||||||
|
private Map<String, PlanRecordCurve> calByRecursionPbs(PlanPbs topPbs, List<PlanPbs> planPbs, Map<String, Object> param, PlanPeriod planPeriod, List<PlanMilestone> milestones, List<PlanRecord> allPlanRecords, Map<String, PlanFeedback> recordIdMap) {
|
||||||
|
List<PlanPbs> children = planPbs.stream()
|
||||||
|
.filter(m -> Objects.equals(m.getParentId(), topPbs.getId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(children)) {
|
||||||
|
//不是最底级累计计算pbs的权重
|
||||||
|
Map<String, PlanRecordCurve> totoalMap = new HashMap<>();
|
||||||
|
for (PlanPbs child : children) {
|
||||||
|
Map<String, PlanRecordCurve> map = calByRecursionPbs(child, planPbs, param, planPeriod, milestones, allPlanRecords, recordIdMap);
|
||||||
|
for (Map.Entry<String, PlanRecordCurve> entry : map.entrySet()) {
|
||||||
|
PlanRecordCurve curve = totoalMap.get(entry.getKey());
|
||||||
|
PlanRecordCurve value = entry.getValue();
|
||||||
|
if (curve != null) {
|
||||||
|
//累计pbs权重
|
||||||
|
BigDecimal weightValue = child.getWeightValue() != null ? NumberUtil.mul(child.getWeightValue(), new BigDecimal("0.01")) : null;
|
||||||
|
curve.setPlan(NumberUtil.add(curve.getPlan(), NumberUtil.mul(value.getPlan(), weightValue)));
|
||||||
|
curve.setPlanTotal(NumberUtil.add(curve.getPlanTotal(), NumberUtil.mul(value.getPlanTotal(), weightValue)));
|
||||||
|
curve.setActual(NumberUtil.add(curve.getActual(), NumberUtil.mul(value.getActual(), weightValue)));
|
||||||
|
curve.setActualTotal(NumberUtil.add(curve.getActualTotal(), NumberUtil.mul(value.getActualTotal(), weightValue)));
|
||||||
|
value = curve;
|
||||||
|
}
|
||||||
|
totoalMap.put(entry.getKey(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return totoalMap;
|
||||||
|
} else {
|
||||||
|
//最底级计算计划编制
|
||||||
|
Map<Date, List<PlanFeedbackPeriod>> dateMap = new HashMap<>();
|
||||||
|
List<PlanRecord> topRecords = allPlanRecords.stream().filter(o -> topPbs.getId().equals(o.getPbsId()) && o.getParentId() == 0L).collect(Collectors.toList());
|
||||||
for (PlanRecord topRecord : topRecords) {
|
for (PlanRecord topRecord : topRecords) {
|
||||||
topRecord.setChildren(planRecordService.getPlanRecordChildren(topRecord, allPlanRecords));
|
topRecord.setChildren(PlanRecordServiceImpl.getPlanRecordChildren(topRecord, allPlanRecords));
|
||||||
List<PlanFeedbackPeriod> periods = planRecordService.getPlanSharesForCurve(param, topRecord, milestones, planPeriod, allPlanRecords, planPeriod);
|
List<PlanFeedbackPeriod> periods = planRecordService.getPlanSharesForCurve(param, topRecord, milestones, planPeriod, allPlanRecords, recordIdMap);
|
||||||
for (PlanFeedbackPeriod period : periods) {
|
for (PlanFeedbackPeriod period : periods) {
|
||||||
List<PlanFeedbackPeriod> periodList = dateMap.get(period.getPeriodStart());
|
List<PlanFeedbackPeriod> periodList = dateMap.get(period.getPeriodStart());
|
||||||
if (periodList == null) {
|
if (periodList == null) {
|
||||||
@ -255,48 +308,10 @@ public class PlanRecordController {
|
|||||||
feedbackPeriod.setPeriodStart(o.getKey());
|
feedbackPeriod.setPeriodStart(o.getKey());
|
||||||
return feedbackPeriod;
|
return feedbackPeriod;
|
||||||
}).sorted((o1, o2) -> o1.getPeriodStart().compareTo(o2.getPeriodStart())).collect(Collectors.toList());
|
}).sorted((o1, o2) -> o1.getPeriodStart().compareTo(o2.getPeriodStart())).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(planShares)) {
|
List<PlanRecordCurve> curves = PlanRecordServiceImpl.buildCurveResult(planShares);
|
||||||
BigDecimal p = new BigDecimal("0");
|
return curves.stream().collect(Collectors.toMap(PlanRecordCurve::getTime, Function.identity(), (o1, o2) -> o1));
|
||||||
BigDecimal a = new BigDecimal("0");
|
|
||||||
for (PlanFeedbackPeriod feedbackPeriod : planShares) {
|
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
|
||||||
map.put("time", DateUtil.formatDate(feedbackPeriod.getPeriodStart()));
|
|
||||||
map.put("plan", feedbackPeriod.getPlanYdz());
|
|
||||||
map.put("actual", feedbackPeriod.getActualYdz());
|
|
||||||
p = NumberUtil.add(p, feedbackPeriod.getPlanYdz());
|
|
||||||
a = NumberUtil.add(a, feedbackPeriod.getActualYdz());
|
|
||||||
map.put("planTotal", p);
|
|
||||||
map.put("actualTotal", a);
|
|
||||||
rtList.add(map);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Result.success(rtList);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("", e);
|
|
||||||
return Result.success(new ArrayList<>(), e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 递归pbs计算曲线
|
|
||||||
*
|
|
||||||
* @param topPbs
|
|
||||||
* @param planPbs
|
|
||||||
*/
|
|
||||||
private Map<String, PlanRecordCurve> calByRecursionPbs(PlanPbs topPbs, List<PlanPbs> planPbs) {
|
|
||||||
List<PlanPbs> children = planPbs.stream()
|
|
||||||
.filter(m -> Objects.equals(m.getParentId(), topPbs.getId()))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
if (CollUtil.isNotEmpty(children)) {
|
|
||||||
for (PlanPbs child : children) {
|
|
||||||
calByRecursionPbs(child, planPbs);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperLog(operModul = "进度计划编制管理", operType = "", operDesc = "查询项目里程碑")
|
@OperLog(operModul = "进度计划编制管理", operType = "", operDesc = "查询项目里程碑")
|
||||||
@ApiOperation(value = "查询项目里程碑", notes = "查询项目里程碑", httpMethod = "GET")
|
@ApiOperation(value = "查询项目里程碑", notes = "查询项目里程碑", httpMethod = "GET")
|
||||||
|
|||||||
@ -2,14 +2,16 @@ package com.zhgd.xmgl.modules.baotou.plan.entity.vo;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划编制的曲线
|
* 计划编制的曲线
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class PlanRecordCurve {
|
public class PlanRecordCurve {
|
||||||
private String time;
|
private String time;
|
||||||
private String plan;
|
private BigDecimal plan;
|
||||||
private String actual;
|
private BigDecimal actual;
|
||||||
private String planTotal;
|
private BigDecimal planTotal;
|
||||||
private String actualTotal;
|
private BigDecimal actualTotal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,10 +2,8 @@ package com.zhgd.xmgl.modules.baotou.plan.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanFeedbackPeriod;
|
import com.zhgd.xmgl.modules.baotou.plan.entity.*;
|
||||||
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanMilestone;
|
import com.zhgd.xmgl.modules.baotou.plan.entity.vo.PlanRecordCurve;
|
||||||
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanPeriod;
|
|
||||||
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanRecord;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -74,19 +72,11 @@ public interface IPlanRecordService extends IService<PlanRecord> {
|
|||||||
|
|
||||||
List<PlanFeedbackPeriod> getPlanShares(Map<String, Object> param);
|
List<PlanFeedbackPeriod> getPlanShares(Map<String, Object> param);
|
||||||
|
|
||||||
List<PlanFeedbackPeriod> getPlanSharesForCurve(Map<String, Object> param, PlanRecord record, List<PlanMilestone> milestones, PlanPeriod planPeriod, List<PlanRecord> planRecords, PlanPeriod period);
|
List<PlanFeedbackPeriod> getPlanSharesForCurve(Map<String, Object> param, PlanRecord record, List<PlanMilestone> milestones, PlanPeriod planPeriod, List<PlanRecord> planRecords, Map<String, PlanFeedback> recordIdMap);
|
||||||
|
|
||||||
List<Map<String, Object>> getPlanCurve(Map<String, Object> param);
|
List<PlanRecordCurve> getPlanCurve(Map<String, Object> param);
|
||||||
|
|
||||||
HashMap<String, Object> getProjectMilestone(HashMap<String, Object> param);
|
HashMap<String, Object> getProjectMilestone(HashMap<String, Object> param);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取children的计划编制
|
|
||||||
*
|
|
||||||
* @param topRecord
|
|
||||||
* @param allPlanRecords
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<PlanRecord> getPlanRecordChildren(PlanRecord topRecord, List<PlanRecord> allPlanRecords);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import com.zhgd.jeecg.common.execption.OpenAlertException;
|
|||||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
import com.zhgd.xmgl.constant.Cts;
|
import com.zhgd.xmgl.constant.Cts;
|
||||||
import com.zhgd.xmgl.modules.baotou.plan.entity.*;
|
import com.zhgd.xmgl.modules.baotou.plan.entity.*;
|
||||||
|
import com.zhgd.xmgl.modules.baotou.plan.entity.vo.PlanRecordCurve;
|
||||||
import com.zhgd.xmgl.modules.baotou.plan.mapper.PlanRecordMapper;
|
import com.zhgd.xmgl.modules.baotou.plan.mapper.PlanRecordMapper;
|
||||||
import com.zhgd.xmgl.modules.baotou.plan.service.*;
|
import com.zhgd.xmgl.modules.baotou.plan.service.*;
|
||||||
import com.zhgd.xmgl.util.ListUtils;
|
import com.zhgd.xmgl.util.ListUtils;
|
||||||
@ -81,6 +82,32 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPlanFeedbackApprovalWorkService planFeedbackApprovalWorkService;
|
private IPlanFeedbackApprovalWorkService planFeedbackApprovalWorkService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建曲线结果list
|
||||||
|
*
|
||||||
|
* @param planShares
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<PlanRecordCurve> buildCurveResult(List<PlanFeedbackPeriod> planShares) {
|
||||||
|
List<PlanRecordCurve> rtList = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(planShares)) {
|
||||||
|
BigDecimal p = new BigDecimal("0");
|
||||||
|
BigDecimal a = new BigDecimal("0");
|
||||||
|
for (PlanFeedbackPeriod feedbackPeriod : planShares) {
|
||||||
|
PlanRecordCurve curve = new PlanRecordCurve();
|
||||||
|
curve.setTime(DateUtil.formatDate(feedbackPeriod.getPeriodStart()));
|
||||||
|
curve.setPlan(feedbackPeriod.getPlanYdz());
|
||||||
|
curve.setActual(feedbackPeriod.getActualYdz());
|
||||||
|
p = NumberUtil.add(p, feedbackPeriod.getPlanYdz());
|
||||||
|
a = NumberUtil.add(a, feedbackPeriod.getActualYdz());
|
||||||
|
curve.setPlanTotal(p);
|
||||||
|
curve.setActualTotal(a);
|
||||||
|
rtList.add(curve);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rtList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<PlanRecord> queryPageList(HashMap<String, Object> param) {
|
public IPage<PlanRecord> queryPageList(HashMap<String, Object> param) {
|
||||||
QueryWrapper<PlanRecord> queryWrapper = this.getQueryWrapper(param);
|
QueryWrapper<PlanRecord> queryWrapper = this.getQueryWrapper(param);
|
||||||
@ -371,14 +398,9 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PlanFeedbackPeriod> getPlanSharesForCurve(Map<String, Object> param, PlanRecord record, List<PlanMilestone> milestones, PlanPeriod planPeriod, List<PlanRecord> planRecords, PlanPeriod period) {
|
public List<PlanFeedbackPeriod> getPlanSharesForCurve(Map<String, Object> param, PlanRecord record, List<PlanMilestone> milestones, PlanPeriod planPeriod, List<PlanRecord> planRecords, Map<String, PlanFeedback> recordIdMap) {
|
||||||
String beginDate = MapUtils.getString(param, "periodStart");
|
String beginDate = MapUtils.getString(param, "periodStart");
|
||||||
String endDate = MapUtils.getString(param, "periodEnd");
|
String endDate = MapUtils.getString(param, "periodEnd");
|
||||||
String projectSn = MapUtils.getString(param, "projectSn");
|
|
||||||
Map<String, PlanFeedback> recordIdMap = planFeedbackService.queryManyNewestFeedbackMap(new MapBuilder<String, Object>()
|
|
||||||
.put("projectSn", projectSn)
|
|
||||||
.put("approvalStatus", 3)
|
|
||||||
.build());
|
|
||||||
List<Long> fbIds = recordIdMap.values().stream().map(PlanFeedback::getId).collect(Collectors.toList());
|
List<Long> fbIds = recordIdMap.values().stream().map(PlanFeedback::getId).collect(Collectors.toList());
|
||||||
List<PlanFeedbackPeriod> fbPeriods = new ArrayList<>();
|
List<PlanFeedbackPeriod> fbPeriods = new ArrayList<>();
|
||||||
List<PlanMilestoneVal> allVals = new ArrayList();
|
List<PlanMilestoneVal> allVals = new ArrayList();
|
||||||
@ -600,25 +622,9 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getPlanCurve(Map<String, Object> param) {
|
public List<PlanRecordCurve> getPlanCurve(Map<String, Object> param) {
|
||||||
List<Map<String, Object>> rtList = new ArrayList<>();
|
|
||||||
List<PlanFeedbackPeriod> planShares = this.getPlanShares(param);
|
List<PlanFeedbackPeriod> planShares = this.getPlanShares(param);
|
||||||
if (CollUtil.isNotEmpty(planShares)) {
|
return buildCurveResult(planShares);
|
||||||
BigDecimal p = new BigDecimal("0");
|
|
||||||
BigDecimal a = new BigDecimal("0");
|
|
||||||
for (PlanFeedbackPeriod feedbackPeriod : planShares) {
|
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
|
||||||
map.put("time", DateUtil.formatDate(feedbackPeriod.getPeriodStart()));
|
|
||||||
map.put("plan", feedbackPeriod.getPlanYdz());
|
|
||||||
map.put("actual", feedbackPeriod.getActualYdz());
|
|
||||||
p = NumberUtil.add(p, feedbackPeriod.getPlanYdz());
|
|
||||||
a = NumberUtil.add(a, feedbackPeriod.getActualYdz());
|
|
||||||
map.put("planTotal", p);
|
|
||||||
map.put("actualTotal", a);
|
|
||||||
rtList.add(map);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return rtList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -677,8 +683,14 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
|
|||||||
return rtMap;
|
return rtMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public List<PlanRecord> getPlanRecordChildren(PlanRecord topRecord, List<PlanRecord> allPlanRecords) {
|
* 获取children的计划编制
|
||||||
|
*
|
||||||
|
* @param topRecord
|
||||||
|
* @param allPlanRecords
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<PlanRecord> getPlanRecordChildren(PlanRecord topRecord, List<PlanRecord> allPlanRecords) {
|
||||||
return allPlanRecords.stream()
|
return allPlanRecords.stream()
|
||||||
.filter(m -> Objects.equals(m.getParentId(), topRecord.getId()))
|
.filter(m -> Objects.equals(m.getParentId(), topRecord.getId()))
|
||||||
.peek(m -> m.setChildren(getPlanRecordChildren(m, allPlanRecords)))
|
.peek(m -> m.setChildren(getPlanRecordChildren(m, allPlanRecords)))
|
||||||
|
|||||||
@ -195,6 +195,12 @@ public class ContractorMonthlyApproveServiceImpl extends ServiceImpl<ContractorM
|
|||||||
boolean copyToGroup = approveType == 1;
|
boolean copyToGroup = approveType == 1;
|
||||||
//承包商统计到项目组,项目组复制统计到项目部
|
//承包商统计到项目组,项目组复制统计到项目部
|
||||||
for (ContractorMonthlyDetail detail : detailList) {
|
for (ContractorMonthlyDetail detail : detailList) {
|
||||||
|
//保存周报月报附件
|
||||||
|
if (detail.getContentType() == 7) {
|
||||||
|
detail.setWeekToMonthFileList(approve.getWeekToMonthFileList());
|
||||||
|
contractorMonthlyDetailService.updateById(detail);
|
||||||
|
}
|
||||||
|
|
||||||
String periodId = String.valueOf(detail.getPeriodId());
|
String periodId = String.valueOf(detail.getPeriodId());
|
||||||
ContractorMonthlyPeriod fromPeriod = contractorMonthlyPeriodService.getById(periodId);
|
ContractorMonthlyPeriod fromPeriod = contractorMonthlyPeriodService.getById(periodId);
|
||||||
ProjectGroup group = projectGroupService.getById(fromPeriod.getGroupId());
|
ProjectGroup group = projectGroupService.getById(fromPeriod.getGroupId());
|
||||||
|
|||||||
@ -183,7 +183,12 @@ public class PouringOrderLedgerServiceImpl extends ServiceImpl<PouringOrderLedge
|
|||||||
addCondition(epcContractor, groupby, "epc_contractor");
|
addCondition(epcContractor, groupby, "epc_contractor");
|
||||||
addCondition(constructionContractor, groupby, "construction_contractor");
|
addCondition(constructionContractor, groupby, "construction_contractor");
|
||||||
addCondition(supplyStation, groupby, "supply_station");
|
addCondition(supplyStation, groupby, "supply_station");
|
||||||
|
if (allBlank) {
|
||||||
|
//全空就查全部
|
||||||
|
|
||||||
|
} else {
|
||||||
param.put("groupby", "group by " + (StrUtil.isNotBlank(groupby.toString()) ? groupby.toString() : "1=1"));
|
param.put("groupby", "group by " + (StrUtil.isNotBlank(groupby.toString()) ? groupby.toString() : "1=1"));
|
||||||
|
}
|
||||||
List<EntityMap> periodMilestones = baseMapper.getCountSupplyStationDetail(param);
|
List<EntityMap> periodMilestones = baseMapper.getCountSupplyStationDetail(param);
|
||||||
int pageNo = Integer.parseInt(param.getOrDefault("pageNo", 1).toString());
|
int pageNo = Integer.parseInt(param.getOrDefault("pageNo", 1).toString());
|
||||||
int pageSize = Integer.parseInt(param.getOrDefault("pageSize", 10).toString());
|
int pageSize = Integer.parseInt(param.getOrDefault("pageSize", 10).toString());
|
||||||
@ -191,7 +196,7 @@ public class PouringOrderLedgerServiceImpl extends ServiceImpl<PouringOrderLedge
|
|||||||
pageSize = Integer.MAX_VALUE;
|
pageSize = Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
int i = cn.hutool.core.util.PageUtil.getStart(pageNo - 1, pageSize);
|
int i = cn.hutool.core.util.PageUtil.getStart(pageNo - 1, pageSize);
|
||||||
List<EntityMap> records = CollUtil.sub(periodMilestones, i, i + pageSize);
|
List<EntityMap> records = CollUtil.sub(pouringOrderLedgers, i, i + pageSize);
|
||||||
List<PouringOrderLedger> ledgerList = this.queryList(param);
|
List<PouringOrderLedger> ledgerList = this.queryList(param);
|
||||||
Integer levelType = MapUtils.getInteger(param, "levelType");
|
Integer levelType = MapUtils.getInteger(param, "levelType");
|
||||||
String year = MapUtils.getString(param, "year");
|
String year = MapUtils.getString(param, "year");
|
||||||
@ -263,7 +268,7 @@ public class PouringOrderLedgerServiceImpl extends ServiceImpl<PouringOrderLedge
|
|||||||
totalMap.put("total", total1);
|
totalMap.put("total", total1);
|
||||||
totalMap.put("data", totalTimeMap);
|
totalMap.put("data", totalTimeMap);
|
||||||
IPage<EntityMap> p = new Page<>();
|
IPage<EntityMap> p = new Page<>();
|
||||||
p.setTotal(periodMilestones.size());
|
p.setTotal(pouringOrderLedgers.size());
|
||||||
p.setRecords(records);
|
p.setRecords(records);
|
||||||
p.setCurrent(pageNo);
|
p.setCurrent(pageNo);
|
||||||
p.setSize(pageSize);
|
p.setSize(pageSize);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user