包头进度和bug修改

This commit is contained in:
guoshengxiong 2024-12-07 17:47:46 +08:00
parent 4499cbbb70
commit ac66c540eb
18 changed files with 319 additions and 230 deletions

View File

@ -78,18 +78,6 @@ public class PlanChooseCategoryController {
return Result.ok();
}
@OperLog(operModul = "进度选择分类码管理", operType = "添加", operDesc = "添加多个进度选择分类码信息")
@ApiOperation(value = "添加多个进度选择分类码信息", notes = "添加多个进度选择分类码信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "categoryIdList", value = "分类码id", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "recordId", value = "计划编制id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/addMany")
public Result<PlanChooseCategory> addMany(@RequestBody @Validate Map<String, Object> param) {
planChooseCategoryService.addMany(param);
return Result.ok();
}
/**
* 编辑
*
@ -132,4 +120,17 @@ public class PlanChooseCategoryController {
return Result.success(planChooseCategoryService.queryById(id));
}
@OperLog(operModul = "进度选择分类码管理", operType = "添加", operDesc = "添加多个进度选择分类码信息")
@ApiOperation(value = "添加多个进度选择分类码信息", notes = "添加多个进度选择分类码信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "categoryIdList", value = "分类码id", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "recordId", value = "计划编制id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/addMany")
public Result<PlanChooseCategory> addMany(@RequestBody @Validate Map<String, Object> param) {
planChooseCategoryService.addMany(param);
return Result.ok();
}
}

View File

@ -85,21 +85,6 @@ public class PlanFeedbackApprovalController {
return Result.ok();
}
@OperLog(operModul = "进度反馈审批管理", operType = "", operDesc = "保存进度反馈审批信息")
@ApiOperation(value = "保存进度反馈审批信息", notes = "保存进度反馈审批信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "recordIdList", value = "recordIdList", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/save")
public Result saveInfo(@RequestBody @Validate Map<String, Object> param) {
try {
planFeedbackApprovalService.saveInfo(param);
} catch (OpenAlertException e) {
return Result.success(e.getMessage());
}
return Result.ok();
}
/**
* 编辑
@ -146,7 +131,6 @@ public class PlanFeedbackApprovalController {
@OperLog(operModul = "进度反馈审批管理", operType = "", operDesc = "提交审批")
@ApiOperation(value = "提交审批", notes = "提交审批", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "recordIdList", value = "计划编制id的list", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "approval", value = "反馈审批对象", paramType = "body", required = true, dataType = "String"),
})
@ -171,7 +155,6 @@ public class PlanFeedbackApprovalController {
@OperLog(operModul = "进度反馈审批管理", operType = "", operDesc = "查询责任人自己的进度反馈审批信息")
@ApiOperation(value = "查询责任人自己的进度反馈审批信息", notes = "查询责任人自己的进度反馈审批信息", httpMethod = "GET")
// @ApiImplicitParam(name = "id", value = "进度反馈审批ID", paramType = "query", required = true, dataType = "Integer")
@GetMapping(value = "/queryMyApproval")
public Result<PlanFeedbackApproval> queryMyApproval() {
return Result.success(planFeedbackApprovalService.queryMyApproval());
@ -209,4 +192,14 @@ public class PlanFeedbackApprovalController {
return Result.success(p);
}
@OperLog(operModul = "进度反馈审批管理", operType = "", operDesc = "保存勾选批量反馈的信息")
@ApiOperation(value = "保存勾选批量反馈的信息", notes = "保存勾选批量反馈的信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "recordIdList", value = "recordIdList", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/save")
public Result saveInfo(@RequestBody @Validate Map<String, Object> param) {
return planFeedbackApprovalService.saveInfo(param);
}
}

View File

@ -96,14 +96,6 @@ public class PlanFeedbackController {
return Result.ok();
}
@OperLog(operModul = "进度反馈记录管理", operType = "", operDesc = "保存进度反馈记录信息")
@ApiOperation(value = "保存进度反馈记录信息", notes = "保存进度反馈记录信息", httpMethod = "POST")
@PostMapping(value = "/save")
public Result<PlanFeedback> saveInfo(@RequestBody PlanFeedback planFeedback) {
planFeedbackService.saveInfo(planFeedback);
return Result.ok();
}
/**
* 通过id删除
*
@ -180,4 +172,13 @@ public class PlanFeedbackController {
return Result.success(planFeedbackService.getPeriodMilestones(param));
}
@OperLog(operModul = "进度反馈记录管理", operType = "", operDesc = "保存进度反馈记录信息")
@ApiOperation(value = "保存进度反馈记录信息", notes = "保存进度反馈记录信息", httpMethod = "POST")
@PostMapping(value = "/save")
public Result<PlanFeedback> saveInfo(@RequestBody PlanFeedback planFeedback) {
planFeedbackService.saveInfo(planFeedback);
return Result.ok();
}
}

View File

@ -65,31 +65,6 @@ public class PlanMilestoneController {
return Result.success(planMilestoneService.queryList(param));
}
@OperLog(operModul = "进度里程碑管理", operType = "分页查询", operDesc = "分页列表查询最近上级的wps进度里程碑信息")
@ApiOperation(value = "分页列表查询最近上级的wps进度里程碑信息", notes = "分页列表查询最近上级的wps进度里程碑信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})
@GetMapping(value = "/getWpsMilestonePage")
public Result<IPage<PlanMilestone>> getWpsMilestonePage(@ApiIgnore @RequestParam HashMap<String, Object> param) {
String recordId = MapUtils.getString(param, "recordId");
List<PlanMilestone> periodMilestones = planMilestoneService.getParentMilestones(recordId);
int pageNo = Integer.parseInt(param.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(param.getOrDefault("pageSize", 10).toString());
if (pageSize < 0) {
pageSize = Integer.MAX_VALUE;
}
int i = cn.hutool.core.util.PageUtil.getStart(pageNo - 1, pageSize);
List<PlanMilestone> records = CollUtil.sub(periodMilestones, i, i + pageSize);
IPage<PlanMilestone> p = new Page<>();
p.setTotal(periodMilestones.size());
p.setRecords(records);
p.setCurrent(pageNo);
p.setSize(pageSize);
return Result.success(p);
}
/**
* 添加
*
@ -146,4 +121,30 @@ public class PlanMilestoneController {
return Result.success(planMilestoneService.queryById(id));
}
@OperLog(operModul = "进度里程碑管理", operType = "分页查询", operDesc = "分页列表查询最近上级的wps进度里程碑信息")
@ApiOperation(value = "分页列表查询最近上级的wps进度里程碑信息", notes = "分页列表查询最近上级的wps进度里程碑信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})
@GetMapping(value = "/getWpsMilestonePage")
public Result<IPage<PlanMilestone>> getWpsMilestonePage(@ApiIgnore @RequestParam HashMap<String, Object> param) {
String recordId = MapUtils.getString(param, "recordId");
List<PlanMilestone> periodMilestones = planMilestoneService.getParentMilestones(recordId);
int pageNo = Integer.parseInt(param.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(param.getOrDefault("pageSize", 10).toString());
if (pageSize < 0) {
pageSize = Integer.MAX_VALUE;
}
int i = cn.hutool.core.util.PageUtil.getStart(pageNo - 1, pageSize);
List<PlanMilestone> records = CollUtil.sub(periodMilestones, i, i + pageSize);
IPage<PlanMilestone> p = new Page<>();
p.setTotal(periodMilestones.size());
p.setRecords(records);
p.setCurrent(pageNo);
p.setSize(pageSize);
return Result.success(p);
}
}

View File

@ -51,16 +51,6 @@ public class PlanPbsController {
return Result.success(planPbsService.queryPageList(param));
}
@OperLog(operModul = "进度PBS管理", operType = "", operDesc = "树形分页列表查询进度PBS信息")
@ApiOperation(value = "树形分页列表查询进度PBS信息", notes = "树形分页列表查询进度PBS信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})
@GetMapping(value = "/tree/page")
public Result<IPage<PlanPbs>> queryTreePage(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(planPbsService.queryTreePage(param));
}
/**
* 列表查询
@ -130,4 +120,15 @@ public class PlanPbsController {
return Result.success(planPbsService.queryById(id));
}
@OperLog(operModul = "进度PBS管理", operType = "", operDesc = "树形分页列表查询进度PBS信息")
@ApiOperation(value = "树形分页列表查询进度PBS信息", notes = "树形分页列表查询进度PBS信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})
@GetMapping(value = "/tree/page")
public Result<IPage<PlanPbs>> queryTreePage(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(planPbsService.queryTreePage(param));
}
}

View File

@ -95,14 +95,6 @@ public class PlanPeriodController {
return Result.ok();
}
@OperLog(operModul = "进度监测周期管理", operType = "保存", operDesc = "保存进度监测周期信息")
@ApiOperation(value = "保存进度监测周期信息", notes = "保存进度监测周期信息", httpMethod = "POST")
@PostMapping(value = "/save")
public Result<PlanPeriod> saveInfo(@RequestBody PlanPeriod planPeriod) {
planPeriodService.saveInfo(planPeriod);
return Result.ok();
}
/**
* 通过id删除
*
@ -161,4 +153,14 @@ public class PlanPeriodController {
}
@OperLog(operModul = "进度监测周期管理", operType = "保存", operDesc = "保存进度监测周期信息")
@ApiOperation(value = "保存进度监测周期信息", notes = "保存进度监测周期信息", httpMethod = "POST")
@PostMapping(value = "/save")
public Result<PlanPeriod> saveInfo(@RequestBody PlanPeriod planPeriod) {
planPeriodService.saveInfo(planPeriod);
return Result.ok();
}
}

View File

@ -57,16 +57,6 @@ public class PlanRecordController {
return Result.success(planRecordService.queryPageList(param));
}
@OperLog(operModul = "进度计划编制管理", operType = "", operDesc = "树形分页列表查询进度计划编制信息")
@ApiOperation(value = "树形分页列表查询进度计划编制信息", notes = "树形分页列表查询进度计划编制信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})
@GetMapping(value = "/tree/page")
public Result<IPage<PlanRecord>> queryTreePage(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(planRecordService.queryTreePage(param));
}
/**
* 列表查询
@ -137,8 +127,8 @@ public class PlanRecordController {
@ApiOperation(value = "分页查询计划分摊列表", notes = "分页查询计划分摊列表", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "recordId", value = "计划编制id", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "beginDate", value = "开始日期", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束日期", paramType = "query", required = false, dataType = "String")
@ApiImplicitParam(name = "periodStart", value = "开始日期", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "periodEnd", value = "结束日期", paramType = "query", required = false, dataType = "String")
})
@GetMapping(value = "/getPlanSharePage")
public Result<IPage<PlanFeedbackPeriod>> getPlanSharePage(@RequestParam Map<String, Object> param) {
@ -198,4 +188,16 @@ public class PlanRecordController {
return Result.success(planRecordService.getProjectMilestone(param));
}
@OperLog(operModul = "进度计划编制管理", operType = "", operDesc = "树形分页列表查询进度计划编制信息")
@ApiOperation(value = "树形分页列表查询进度计划编制信息", notes = "树形分页列表查询进度计划编制信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})
@GetMapping(value = "/tree/page")
public Result<IPage<PlanRecord>> queryTreePage(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(planRecordService.queryTreePage(param));
}
}

View File

@ -74,16 +74,7 @@ public class PlanWorkCategoryController {
public Result<IPage<PlanWorkCategory>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(planWorkCategoryService.queryPageList(param));
}
@OperLog(operModul = "进度作业分类码管理", operType = "", operDesc = "树形分页列表查询进度作业分类码信息")
@ApiOperation(value = "树形分页列表查询进度作业分类码信息", notes = "树形分页列表查询进度作业分类码信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})
@GetMapping(value = "/tree/page")
public Result<IPage<PlanWorkCategory>> queryTreePage(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(planWorkCategoryService.queryTreePage(param));
}
/**
* 列表查询
* @return
@ -147,4 +138,14 @@ public class PlanWorkCategoryController {
return Result.success(planWorkCategoryService.queryById(id));
}
@OperLog(operModul = "进度作业分类码管理", operType = "", operDesc = "树形分页列表查询进度作业分类码信息")
@ApiOperation(value = "树形分页列表查询进度作业分类码信息", notes = "树形分页列表查询进度作业分类码信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})
@GetMapping(value = "/tree/page")
public Result<IPage<PlanWorkCategory>> queryTreePage(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(planWorkCategoryService.queryTreePage(param));
}
}

View File

@ -54,12 +54,12 @@ public class PlanFeedbackPeriod implements Serializable {
private java.util.Date updateTime ;
@TableField(exist = false)
private List<PlanMilestoneVal> milestoneVals;
@ApiModelProperty(value = "实际进度完成%(未算权重)")
@TableField(exist = false)
private BigDecimal actualOriginPer;
@ApiModelProperty(value = "计划进度完成%(未算权重)")
@TableField(exist = false)
private BigDecimal planOriginPer;
// @ApiModelProperty(value = "实际进度完成%(未算权重)")
// @TableField(exist = false)
// private BigDecimal actualOriginPer;
// @ApiModelProperty(value = "计划进度完成%(未算权重)")
// @TableField(exist = false)
// private BigDecimal planOriginPer;
@ApiModelProperty(value = "实际进度完成%")
@TableField(exist = false)
private BigDecimal actualPer;

View File

@ -162,7 +162,7 @@ public class PlanRecord implements Serializable {
*/
@ApiModelProperty(value = "后置作业")
private java.lang.String postDecessorJob;
@ApiModelProperty(value = "最新的feedBackId")
@ApiModelProperty(value = "审批通过的最新的feedBackId")
private Long newestFeedBackId;
/**
* 节点状态1:关键控制点;2:重要事件的控制;3:作业项目的节点;

View File

@ -1,8 +1,10 @@
package com.zhgd.xmgl.modules.baotou.plan.service;
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanFeedbackApproval;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanFeedbackApproval;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -10,42 +12,53 @@ import java.util.Map;
/**
* @Description: 进度反馈审批
* @author pds
* @date 2024-12-04
* @date 2024-12-04
* @version V1.0
*/
public interface IPlanFeedbackApprovalService extends IService<PlanFeedbackApproval> {
/**
* 分页列表查询进度反馈审批信息
*
* @param param 参数map
* @return
*/
IPage<PlanFeedbackApproval> queryPageList(HashMap<String, Object> param);
/**
* 列表查询进度反馈审批信息
*
* @param param 参数map
* @return
*/
List<PlanFeedbackApproval> queryList(HashMap<String, Object> param);
/**
* 添加进度反馈审批信息
*
* @param planFeedbackApproval 进度反馈审批
* @return
*/
void add(PlanFeedbackApproval planFeedbackApproval);
/**
* 编辑进度反馈审批信息
*
* @param planFeedbackApproval 进度反馈审批
* @return
*/
void edit(PlanFeedbackApproval planFeedbackApproval);
/**
* 根据id删除进度反馈审批信息
*
* @param id 进度反馈审批的id
* @return
*/
void delete(String id);
/**
* 根据id查询进度反馈审批信息
*
* @param id 进度反馈审批的id
* @return
*/
@ -55,7 +68,14 @@ public interface IPlanFeedbackApprovalService extends IService<PlanFeedbackAppro
void approval(HashMap<String, Object> map);
void saveInfo(Map<String, Object> param);
Result saveInfo(Map<String, Object> param);
PlanFeedbackApproval queryMyApproval();
/**
* 查询最新的一条审批
*
* @return
*/
PlanFeedbackApproval queryNewestApproval();
}

View File

@ -10,9 +10,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gexin.fastjson.JSON;
import com.gexin.fastjson.TypeReference;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.modules.baotou.plan.entity.*;
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanFeedback;
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanFeedbackApproval;
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanFeedbackApprovalWork;
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanRecord;
import com.zhgd.xmgl.modules.baotou.plan.mapper.PlanFeedbackApprovalMapper;
import com.zhgd.xmgl.modules.baotou.plan.service.IPlanFeedbackApprovalService;
import com.zhgd.xmgl.modules.baotou.plan.service.IPlanFeedbackApprovalWorkService;
@ -22,7 +26,6 @@ import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
import com.zhgd.xmgl.security.entity.UserInfo;
import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.util.MapBuilder;
import com.zhgd.xmgl.util.PageUtil;
import com.zhgd.xmgl.util.RefUtil;
import org.apache.commons.collections.MapUtils;
@ -79,7 +82,7 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl<PlanFeedbackApp
QueryWrapper<PlanFeedbackApproval> queryWrapper = QueryGenerator.initPageQueryWrapper(PlanFeedbackApproval.class, param, true);
Integer isApproval = MapUtils.getInteger(param, "isApproval");
if (Objects.equals(isApproval, 1)) {
queryWrapper.ne(RefUtil.fieldNameUlc(PlanFeedbackApproval::getApprovalStatus), -1);
queryWrapper.ne(RefUtil.fieldNameUlc(PlanFeedbackApproval::getApprovalStatus), 1);
}
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(PlanFeedbackApproval::getId));
return queryWrapper;
@ -126,6 +129,11 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl<PlanFeedbackApp
if (planFeedbackApproval == null) {
throw new OpenAlertException("未找到对应实体");
}
int count = planFeedbackApprovalWorkService.count(new LambdaQueryWrapper<PlanFeedbackApprovalWork>()
.eq(PlanFeedbackApprovalWork::getApprovalId, id));
if (count > 0) {
throw new OpenAlertException("请先删除反馈记录");
}
baseMapper.deleteById(id);
}
@ -156,38 +164,31 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl<PlanFeedbackApp
}
@Override
// @DistributedLock(keyPrefix = "PlanFeedbackApprovalServiceImplSubmit:", key = "#map.projectSn", tryLok = true, lockTime = 0)
public void submit(HashMap<String, Object> map) {
String projectSn = MapUtils.getString(map, "projectSn");
PlanFeedbackApproval approval = JSON.parseObject(JSON.toJSONString(map.get("approval")), new TypeReference<PlanFeedbackApproval>() {
});
if (StrUtil.isBlank(approval.getApprovalIds())) {
throw new OpenAlertException("审批人为空");
}
approval.setApprovalStatus(2);
this.edit(approval);
List<Long> recordIdList = JSON.parseObject(JSON.toJSONString(map.get("recordIdList")), new TypeReference<List<Long>>() {
});
if (CollUtil.isNotEmpty(recordIdList)) {
Map<Long, PlanRecord> fbidMap = planRecordService.list(new LambdaQueryWrapper<PlanRecord>()
.in(PlanRecord::getId, recordIdList)).stream().filter(o -> o.getNewestFeedBackId() != null).collect(Collectors.toMap(PlanRecord::getNewestFeedBackId, Function.identity(), (record, record2) -> record));
if (CollUtil.isNotEmpty(fbidMap)) {
for (Map.Entry<Long, PlanRecord> entry : fbidMap.entrySet()) {
PlanFeedbackApprovalWork fbaw = new PlanFeedbackApprovalWork();
fbaw.setApprovalId(approval.getId());
fbaw.setRecordId(entry.getValue().getId());
fbaw.setFeedbackId(entry.getKey());
planFeedbackApprovalWorkService.add(fbaw);
}
}
}
}
@Override
public void approval(HashMap<String, Object> map) {
String approvalId = MapUtils.getString(map, "approvalId");
Integer isPass = MapUtils.getInteger(map, "isPass");
this.update(new LambdaUpdateWrapper<PlanFeedbackApproval>()
.set(PlanFeedbackApproval::getApprovalStatus, 3)
.eq(PlanFeedbackApproval::getId, approvalId)
);
if (isPass == 1) {
this.update(new LambdaUpdateWrapper<PlanFeedbackApproval>()
.set(PlanFeedbackApproval::getApprovalStatus, 3)
.eq(PlanFeedbackApproval::getId, approvalId)
);
} else {
this.update(new LambdaUpdateWrapper<PlanFeedbackApproval>()
.set(PlanFeedbackApproval::getApprovalStatus, 4)
.eq(PlanFeedbackApproval::getId, approvalId)
);
}
List<PlanFeedbackApprovalWork> feedbackApprovalWorks = planFeedbackApprovalWorkService.list(new LambdaQueryWrapper<PlanFeedbackApprovalWork>()
.eq(PlanFeedbackApprovalWork::getApprovalId, approvalId));
List<Long> fbids = feedbackApprovalWorks.stream().map(PlanFeedbackApprovalWork::getFeedbackId).collect(Collectors.toList());
@ -200,13 +201,14 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl<PlanFeedbackApp
.eq(PlanFeedback::getId, fbid)
);
//通过就更改计划编制
if (Objects.equals(isPass, 1)) {
if (isPass == 1) {
PlanFeedback feedback = fbIdMap.get(fbid);
if (feedback != null) {
planRecordService.update(new LambdaUpdateWrapper<PlanRecord>()
.set(PlanRecord::getActualStart, feedback.getActualStart())
.set(PlanRecord::getActualFinish, feedback.getActualFinish())
.set(PlanRecord::getExpectedFinish, feedback.getExpectFinish())
.set(PlanRecord::getNewestFeedBackId, feedback.getId())
.eq(PlanRecord::getId, feedback.getRecordId())
);
}
@ -216,42 +218,56 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl<PlanFeedbackApp
}
@Override
public void saveInfo(Map<String, Object> param) {
public Result saveInfo(Map<String, Object> param) {
String projectSn = MapUtils.getString(param, "projectSn");
List<Long> recordIdList = JSON.parseObject(JSON.toJSONString(param.get("recordIdList")), new TypeReference<List<Long>>() {
});
}).stream().filter(Objects::nonNull).collect(Collectors.toList());
UserInfo user = SecurityUtils.getUser();
Long userId = user.getUserId();
PlanFeedbackApproval approval = planFeedbackApprovalMapper.selectOne(new LambdaQueryWrapper<PlanFeedbackApproval>()
.eq(PlanFeedbackApproval::getInputWorkerId, userId)
.eq(PlanFeedbackApproval::getApprovalStatus, 1)
);
Map<Long, PlanFeedback> ridFeedBackMap = planFeedbackService.getNewestOneByRecordIdList(recordIdList).stream().collect(Collectors.toMap(PlanFeedback::getRecordId, Function.identity(), (planFeedback, planFeedback2) -> planFeedback));
if (approval == null) {
PlanFeedbackApproval approval = this.queryNewestApproval();
Map<Long, PlanFeedback> ridFeedBackMap = new HashMap<>();
if (CollUtil.isNotEmpty(recordIdList)) {
ridFeedBackMap = planFeedbackService.getNewestOneByRecordIdList(recordIdList).stream().collect(Collectors.toMap(PlanFeedback::getRecordId, Function.identity(), (planFeedback, planFeedback2) -> planFeedback));
}
List<String> failNames = new ArrayList<>();
if (approval == null || approval.getApprovalStatus() != 1) {
approval = new PlanFeedbackApproval();
approval.setProjectSn(approval.getProjectSn());
approval.setProjectSn(projectSn);
approval.setInputWorkerId(userId);
approval.setInputWorkerName(user.getRealName());
approval.setApprovalStatus(1);
approval.setInputDate(new Date());
this.add(approval);
addFeedbackAndWork(recordIdList, approval, ridFeedBackMap);
if (CollUtil.isNotEmpty(recordIdList)) {
this.addFeedbackAndWork(recordIdList, approval, ridFeedBackMap);
}
} else {
this.updateById(approval);
List<PlanFeedbackApprovalWork> works = planFeedbackApprovalWorkService.list(new LambdaQueryWrapper<PlanFeedbackApprovalWork>()
.eq(PlanFeedbackApprovalWork::getApprovalId, approval.getId()));
if (CollUtil.isNotEmpty(works)) {
Map<Long, PlanRecord> ridMap = planRecordService.list(new LambdaQueryWrapper<PlanRecord>()
.in(PlanRecord::getId, works.stream().map(PlanFeedbackApprovalWork::getRecordId).collect(Collectors.toList()))).stream().collect(Collectors.toMap(PlanRecord::getId, Function.identity()));
for (Long rid : recordIdList) {
PlanRecord record = ridMap.get(rid);
if (record != null) {
throw new OpenAlertException(record.getJobName() + "已经提交,请勿重复提交");
if (CollUtil.isNotEmpty(recordIdList)) {
List<PlanFeedbackApprovalWork> works = planFeedbackApprovalWorkService.list(new LambdaQueryWrapper<PlanFeedbackApprovalWork>()
.eq(PlanFeedbackApprovalWork::getApprovalId, approval.getId()));
if (CollUtil.isNotEmpty(works)) {
Map<Long, PlanRecord> ridMap = planRecordService.list(new LambdaQueryWrapper<PlanRecord>()
.in(PlanRecord::getId, works.stream().map(PlanFeedbackApprovalWork::getRecordId).collect(Collectors.toList()))).stream().collect(Collectors.toMap(PlanRecord::getId, Function.identity()));
Iterator<Long> iterator = recordIdList.iterator();
while (iterator.hasNext()) {
Long rid = iterator.next();
PlanRecord record = ridMap.get(rid);
if (record != null) {
failNames.add(record.getJobName());
iterator.remove();
}
}
}
if (CollUtil.isNotEmpty(recordIdList)) {
this.addFeedbackAndWork(recordIdList, approval, ridFeedBackMap);
}
}
addFeedbackAndWork(recordIdList, approval, ridFeedBackMap);
}
if (CollUtil.isNotEmpty(failNames)) {
return Result.ok(StrUtil.join(",", failNames) + "正在处理中,请勿重复提交");
}
return Result.ok();
}
@Override
@ -259,6 +275,7 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl<PlanFeedbackApp
return planFeedbackApprovalMapper.selectOne(new LambdaQueryWrapper<PlanFeedbackApproval>()
.eq(PlanFeedbackApproval::getInputWorkerId, SecurityUtils.getUser().getUserId())
.eq(PlanFeedbackApproval::getApprovalStatus, 1)
.last("limit 1")
);
}
@ -268,19 +285,23 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl<PlanFeedbackApp
faw.setApprovalId(approval.getId());
faw.setRecordId(rid);
PlanFeedback feedback = ridFeedBackMap.get(rid);
if (feedback != null && feedback.getApprovalStatus() == 1) {
faw.setFeedbackId(feedback.getId());
} else {
//新增一个feedback
PlanFeedback newest = planFeedbackService.getNewest(String.valueOf(rid));
planFeedbackService.add(newest);
//新增period和val
// List<PlanFeedbackPeriod> periodList = planFeedbackService.getPeriodMilestones(new MapBuilder<String, Object>().put("recordId", newest.getRecordId()).build());
// newest.setPeriods(periodList);
// planFeedbackService.saveInfo(newest);
faw.setFeedbackId(newest.getId());
if (feedback == null || feedback.getApprovalStatus() != 1) {
feedback = planFeedbackService.getNewest(String.valueOf(rid));
feedback.setRecordId(rid);
}
feedback.setProjectSn(approval.getProjectSn());
planFeedbackService.saveInfo(feedback);
faw.setFeedbackId(feedback.getId());
planFeedbackApprovalWorkService.add(faw);
}
}
@Override
public PlanFeedbackApproval queryNewestApproval() {
Long userId = SecurityUtils.getUser().getUserId();
return planFeedbackApprovalMapper.selectOne(new LambdaQueryWrapper<PlanFeedbackApproval>()
.eq(PlanFeedbackApproval::getInputWorkerId, userId)
.last("order by input_date desc limit 1")
);
}
}

View File

@ -60,6 +60,8 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
private ISystemUserService systemUserService;
@Autowired
private IPlanPbsService planPbsService;
@Autowired
private IPlanFeedbackApprovalWorkService planFeedbackApprovalWorkService;
@Override
public IPage<PlanFeedback> queryPageList(HashMap<String, Object> param) {
@ -104,7 +106,7 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
.set(PlanRecord::getNewestFeedBackId, feedback.getId())
.eq(PlanRecord::getId, feedback.getRecordId())
);
addFeedbackPeriodAndVal(feedback);
this.addFeedbackPeriodAndVal(feedback);
}
@Override
@ -122,6 +124,9 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
if (planFeedback == null) {
throw new OpenAlertException("未找到对应实体");
}
if (planFeedback.getApprovalStatus() == 3) {
throw new OpenAlertException("已通过的反馈记录不能删除");
}
baseMapper.deleteById(id);
List<Long> fbpids = planFeedbackPeriodService.list(new LambdaQueryWrapper<PlanFeedbackPeriod>()
@ -132,6 +137,8 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
planMilestoneValService.remove(new LambdaQueryWrapper<PlanMilestoneVal>()
.in(PlanMilestoneVal::getFeedbackPeriodId, fbpids));
}
planFeedbackApprovalWorkService.remove(new LambdaQueryWrapper<PlanFeedbackApprovalWork>()
.eq(PlanFeedbackApprovalWork::getFeedbackId, id));
}
@ -147,7 +154,7 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
@Override
public PlanFeedback getNewest(String recordId) {
PlanRecord record = planRecordService.queryById(recordId);
PlanFeedback feedback = planFeedbackMapper.queryById(String.valueOf(record.getNewestFeedBackId()));
PlanFeedback feedback = this.queryNewestFeedback(Long.valueOf(recordId));
if (feedback == null) {
PlanPbs pbs = planPbsService.queryById(record.getPbsId() + "");
feedback = new PlanFeedback();
@ -209,12 +216,13 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
}
PlanRecord record = planRecordService.queryById(recordId);
if (StrUtil.isBlank(feedbackId)) {
if (record.getNewestFeedBackId() == null) {
PlanFeedback newestFeedback = this.queryNewestFeedback(Long.valueOf(recordId));
if (newestFeedback == null) {
feedbackPeriods = getFeedbackPeriodWithoutSave(record);
} else {
//新增反馈的回显查询最新的数据
//新增反馈的回显
List<PlanFeedbackPeriod> fbPeriods = planFeedbackPeriodService.list(new LambdaQueryWrapper<PlanFeedbackPeriod>()
.eq(PlanFeedbackPeriod::getFeedbackId, record.getNewestFeedBackId()));
.eq(PlanFeedbackPeriod::getFeedbackId, newestFeedback.getId()));
List<Long> fpIds = fbPeriods.stream().map(PlanFeedbackPeriod::getId).collect(Collectors.toList());
Map<Long, PlanMilestone> milestoneMap = planMilestoneService.getParentMilestones(recordId).stream().collect(Collectors.toMap(PlanMilestone::getId, Function.identity(), (planMilestone, planMilestone2) -> planMilestone));
if (CollUtil.isNotEmpty(fpIds)) {
@ -229,9 +237,10 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
feedbackPeriod.setMilestoneVals(valList.stream().filter(o -> Objects.equals(o.getFeedbackPeriodId(), feedbackPeriod.getId())).collect(Collectors.toList()));
}
}
feedbackPeriods = fbPeriods;
}
} else {
feedbackPeriods = this.getExistFeedbackPeriods(Long.valueOf(feedbackId),record);
feedbackPeriods = this.getExistFeedbackPeriods(Long.valueOf(feedbackId), record);
}
if (CollUtil.isNotEmpty(feedbackPeriods)) {
if (StrUtil.isNotBlank(beginDate)) {
@ -290,29 +299,6 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
}
return fbPeriods;
}
//
// @Override
// public void submit(HashMap<String, Object> map) {
// String projectSn = MapUtils.getString(map, "projectSn");
// List<Long> feedbackIdList = JSON.parseObject(JSON.toJSONString(map.get("feedbackIdList")), new TypeReference<List<Long>>() {
// });
// if (CollUtil.isNotEmpty(feedbackIdList)) {
// for (Long id : feedbackIdList) {
// baseMapper.update(null, new LambdaUpdateWrapper<PlanFeedback>().set(PlanFeedback::getApprovalStatus, 2).eq(PlanFeedback::getId, id));
// }
// List<PlanFeedback> feedbackList = planFeedbackMapper.selectList(new LambdaQueryWrapper<PlanFeedback>()
// .in(PlanFeedback::getId, feedbackIdList));
// PlanRecord record = planRecordService.getOne(new LambdaQueryWrapper<PlanRecord>()
// .eq(PlanRecord::getId, feedbackList.get(0).getRecordId()));
// SystemUser user = systemUserService.getOne(new LambdaQueryWrapper<SystemUser>()
// .eq(SystemUser::getUserId, record.getChargerId()));
// PlanFeedbackApproval approval = new PlanFeedbackApproval();
// approval.setProjectSn(projectSn);
// approval.setChargerName(user.getRealName());
// approval.setApprovalStatus(2);
// planFeedbackApprovalService.save(approval);
// }
// }
@Override
public void approval(HashMap<String, Object> map) {
@ -347,11 +333,9 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
@Override
public void saveInfo(PlanFeedback feedback) {
//最新一条是新增状态的就更新
PlanFeedback feedback1 = planFeedbackMapper.selectOne(new LambdaQueryWrapper<PlanFeedback>()
.eq(PlanFeedback::getRecordId, feedback.getRecordId())
.last("order by input_date desc limit 1")
);
PlanRecord record = planRecordService.getById(feedback.getRecordId());
Long recordId = feedback.getRecordId();
PlanFeedback feedback1 = queryNewestFeedback(recordId);
PlanRecord record = planRecordService.getById(recordId);
if (record.getWorkType() != 1) {
throw new OpenAlertException("只有作业可以新增反馈内容");
}
@ -360,23 +344,38 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
feedback.setApprovalStatus(1);
baseMapper.updateById(feedback);
//更新
List<Long> fbpids = planFeedbackPeriodService.list(new LambdaQueryWrapper<PlanFeedbackPeriod>()
.eq(PlanFeedbackPeriod::getFeedbackId, feedback1.getId())).stream().map(PlanFeedbackPeriod::getId).collect(Collectors.toList());
planFeedbackPeriodService.remove(new LambdaQueryWrapper<PlanFeedbackPeriod>()
.eq(PlanFeedbackPeriod::getFeedbackId, feedback1.getId()));
if (CollUtil.isNotEmpty(fbpids)) {
planMilestoneValService.remove(new LambdaQueryWrapper<PlanMilestoneVal>()
.in(PlanMilestoneVal::getFeedbackPeriodId, fbpids));
}
addFeedbackPeriodAndVal(feedback);
this.updateFeedbackPeriodAndVal(feedback);
} else {
feedback.setId(null);
feedback.setApprovalStatus(1);
//由于分页这里需要添加没有的传过来的
List<PlanFeedbackPeriod> periods = feedback.getPeriods();
if (CollUtil.isEmpty(periods)) {
periods = new ArrayList<>();
feedback.setPeriods(periods);
}
HashMap<String, Object> param = new HashMap<>();
param.put("recordId", recordId);
List<PlanFeedbackPeriod> alls = this.getPeriodMilestones(param);
for (PlanFeedbackPeriod all : alls) {
Optional<PlanFeedbackPeriod> op = periods.stream().filter(o -> Objects.equals(all.getPeriodStart(), o.getPeriodStart())).findAny();
if (!op.isPresent()) {
periods.add(all);
}
}
baseMapper.insert(feedback);
addFeedbackPeriodAndVal(feedback);
this.addFeedbackPeriodAndVal(feedback);
}
}
private PlanFeedback queryNewestFeedback(Long recordId) {
PlanFeedback feedback1 = planFeedbackMapper.selectOne(new LambdaQueryWrapper<PlanFeedback>()
.eq(PlanFeedback::getRecordId, recordId)
.last("order by input_date desc limit 1")
);
return feedback1;
}
@Override
public List<PlanFeedback> getNewestOneByRecordIdList(List<Long> recordIdList) {
return baseMapper.getNewestOneByRecordIdList(recordIdList);
@ -389,10 +388,6 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
*/
private void addFeedbackPeriodAndVal(PlanFeedback feedback) {
List<PlanFeedbackPeriod> periods = feedback.getPeriods();
addFeedbackPeriodAndVal(feedback, periods);
}
private void addFeedbackPeriodAndVal(PlanFeedback feedback, List<PlanFeedbackPeriod> periods) {
if (CollUtil.isNotEmpty(periods)) {
for (PlanFeedbackPeriod period : periods) {
period.setId(null);
@ -410,4 +405,25 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
}
}
/**
* 更新periods和val
*
* @param feedback
*/
private void updateFeedbackPeriodAndVal(PlanFeedback feedback) {
List<PlanFeedbackPeriod> periods = feedback.getPeriods();
if (CollUtil.isNotEmpty(periods)) {
for (PlanFeedbackPeriod period : periods) {
period.setFeedbackId(feedback.getId());
planFeedbackPeriodService.updateById(period);
List<PlanMilestoneVal> milestoneVals = period.getMilestoneVals();
if (CollUtil.isNotEmpty(milestoneVals)) {
for (PlanMilestoneVal val : milestoneVals) {
val.setFeedbackPeriodId(period.getId());
planMilestoneValService.updateById(val);
}
}
}
}
}
}

View File

@ -53,6 +53,7 @@ public class PlanPeriodServiceImpl extends ServiceImpl<PlanPeriodMapper, PlanPer
}
private List<PlanPeriod> dealList(List<PlanPeriod> list) {
return list;
}

View File

@ -27,7 +27,6 @@ import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.xhtmlrenderer.css.parser.property.PrimitivePropertyBuilders;
import java.math.BigDecimal;
import java.util.*;
@ -181,6 +180,11 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
if (planRecord == null) {
throw new OpenAlertException("未找到对应实体");
}
int count = planFeedbackService.count(new LambdaQueryWrapper<PlanFeedback>()
.eq(PlanFeedback::getRecordId, id));
if (count > 0) {
throw new OpenAlertException("请先删除反馈数据");
}
baseMapper.deleteById(id);
}
@ -229,8 +233,8 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
@Override
public List<PlanFeedbackPeriod> getPlanShares(Map<String, Object> param) {
String recordId = MapUtils.getString(param, "recordId");
String beginDate = MapUtils.getString(param, "beginDate");
String endDate = MapUtils.getString(param, "endDate");
String beginDate = MapUtils.getString(param, "periodStart");
String endDate = MapUtils.getString(param, "periodEnd");
List<PlanFeedbackPeriod> feedbackPeriods = new ArrayList<>();
PlanRecord record = this.getById(recordId);
if (record == null) {
@ -366,10 +370,10 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
pp = NumberUtil.add(pp, NumberUtil.mul(val.getPlanVal(), weight));
ap = NumberUtil.add(ap, NumberUtil.mul(val.getActualVal(), weight));
}
period.setPlanOriginPer(pp);
period.setActualOriginPer(ap);
period.setPlanYdz(NumberUtil.mul(period.getPlanPer(), record.getWeight(), 2));
period.setActualYdz(NumberUtil.mul(period.getActualPer(), record.getWeight(), 2));
period.setPlanPer(pp);
period.setActualPer(ap);
period.setPlanYdz(NumberUtil.mul(period.getPlanPer(), record.getWeight(), new BigDecimal("0.01")));
period.setActualYdz(NumberUtil.mul(period.getActualPer(), record.getWeight(), new BigDecimal("0.01")));
}
return feedbackPeriods;
}
@ -396,17 +400,34 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
List<PlanRecord> children = record.getChildren();
Map<Date, PlanFeedbackPeriod> startMap = new HashMap<>();
for (PlanRecord child : children) {
Map<Date, PlanFeedbackPeriod> startMap1;
if (Objects.equals(child.getWorkType(), 1)) {
Map<String, Object> param = new HashMap<>();
PlanRecord planRecord = planRecords.stream().filter(o -> Objects.equals(o.getId(), child.getId())).findFirst().get();
List<PlanFeedbackPeriod> feedbackPeriods1 = this.getPeriodMilestonesForWork(planRecord, planPeriod, milestones);
startMap = feedbackPeriods1.stream().collect(Collectors.toMap(PlanFeedbackPeriod::getPeriodStart, Function.identity(), (planFeedbackPeriod, planFeedbackPeriod2) -> planFeedbackPeriod));
startMap1 = feedbackPeriods1.stream().collect(Collectors.toMap(PlanFeedbackPeriod::getPeriodStart, Function.identity(), (planFeedbackPeriod, planFeedbackPeriod2) -> planFeedbackPeriod));
if (CollUtil.isEmpty(startMap)) {
startMap = startMap1;
} else {
//按权重求和
for (Map.Entry<Date, PlanFeedbackPeriod> entry : startMap1.entrySet()) {
PlanFeedbackPeriod fp = entry.getValue();
BigDecimal pydz = NumberUtil.mul(fp.getPlanYdz(), child.getWeight());
BigDecimal aydz = NumberUtil.mul(fp.getActualYdz(), child.getWeight());
PlanFeedbackPeriod p = startMap.get(fp.getPeriodStart());
if (p == null) {
p = ObjectUtil.cloneByStream(fp);
startMap.put(fp.getPeriodStart(), p);
}
p.setPlanYdz(NumberUtil.add(p.getPlanYdz(), pydz));
p.setActualYdz(NumberUtil.add(p.getActualYdz(), aydz));
}
}
} else {
startMap = this.getChildFeedbackPeriodMap(child, planRecords, milestones, planPeriod);
for (Map.Entry<Date, PlanFeedbackPeriod> entry : startMap.entrySet()) {
startMap1 = this.getChildFeedbackPeriodMap(child, planRecords, milestones, planPeriod);
for (Map.Entry<Date, PlanFeedbackPeriod> entry : startMap1.entrySet()) {
PlanFeedbackPeriod fp = entry.getValue();
BigDecimal pydz = NumberUtil.mul(fp.getPlanYdz(), child.getWeight(), 2);
BigDecimal aydz = NumberUtil.mul(fp.getActualYdz(), child.getWeight(), 2);
BigDecimal pydz = NumberUtil.mul(fp.getPlanYdz(), child.getWeight());
BigDecimal aydz = NumberUtil.mul(fp.getActualYdz(), child.getWeight());
PlanFeedbackPeriod p = startMap.get(fp.getPeriodStart());
if (p == null) {
p = ObjectUtil.cloneByStream(fp);
@ -416,6 +437,14 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
p.setActualYdz(NumberUtil.add(p.getActualYdz(), aydz));
}
}
//计算百分比
for (Map.Entry<Date, PlanFeedbackPeriod> entry : startMap.entrySet()) {
PlanFeedbackPeriod period = entry.getValue();
if (BigDecimal.ZERO.compareTo(child.getWeight()) != 0) {
period.setPlanPer(NumberUtil.mul(new BigDecimal("100"), NumberUtil.div(period.getPlanYdz(), child.getWeight(), 2)));
period.setActualPer(NumberUtil.mul(new BigDecimal("100"), NumberUtil.div(period.getActualYdz(), child.getWeight(), 2)));
}
}
}
return startMap;
}