Browse Source

进度管理修改

dev_kxc
zhuyulei 1 year ago
parent
commit
191b5c144b
  1. 59
      jwtech-quartz/src/main/java/com/jwtech/quartz/task/progressTask.java
  2. 30
      jwtech-system/src/main/java/com/kms/build/controller/BsSgcJsjdBuiProgressController.java
  3. 6
      jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiProgress.java

59
jwtech-quartz/src/main/java/com/jwtech/quartz/task/progressTask.java

@ -52,16 +52,61 @@ public class progressTask {
Date date1 = new Date();
String formatted = format.format(date1);
Date parse = format.parse(formatted);
int year = parse.getYear();
int month = parse.getMonth();
bsSgcJsjdBuiProgress.setMonthly(parse);
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
String string = sdf.format(cal.getTime());
bsSgcJsjdBuiProgress.setEndingTime(calendar.getTime());
bsSgcJsjdBuiProgress.setFillingStatus("0");
bsSgcJsjdBuiProgressMapper.insert(bsSgcJsjdBuiProgress);
Date lastMonth = format.parse(string);
if (lastMonth.getMonth() == 12) {
QueryWrapper<BsSgcJsjdBuiProgress> wrapper = new QueryWrapper<>();
wrapper.eq("pro_no", proNo);
wrapper.eq("pro_code", proCode);
wrapper.eq("monthly", lastMonth);
BsSgcJsjdBuiProgress buiProgress = bsSgcJsjdBuiProgressMapper.selectOne(wrapper);
if (buiProgress != null) {
bsSgcJsjdBuiProgress.setYearlyCumulativeWorkload((double) 0);
bsSgcJsjdBuiProgress.setProjectOverallWorkload(buiProgress.getProjectOverallWorkload());
}
}else {
bsSgcJsjdBuiProgress.setYearlyCumulativeWorkload((double) 0);
bsSgcJsjdBuiProgress.setProjectOverallWorkload((double) 0);
}
}else {
QueryWrapper<BsSgcJsjdBuiProgress> wrapper = new QueryWrapper<>();
wrapper.eq("pro_no", proNo);
wrapper.eq("pro_code", proCode);
wrapper.eq("monthly", lastMonth);
BsSgcJsjdBuiProgress buiProgress = bsSgcJsjdBuiProgressMapper.selectOne(wrapper);
if (buiProgress != null) {
bsSgcJsjdBuiProgress.setYearlyCumulativeWorkload(buiProgress.getYearlyCumulativeWorkload());
bsSgcJsjdBuiProgress.setProjectOverallWorkload(buiProgress.getProjectOverallWorkload());
}else {
bsSgcJsjdBuiProgress.setYearlyCumulativeWorkload((double) 0);
bsSgcJsjdBuiProgress.setProjectOverallWorkload((double) 0);
}
}
bsSgcJsjdBuiProgress.setCreateTime(new Date());
bsSgcJsjdBuiProgress.setMonthly(parse);
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
bsSgcJsjdBuiProgress.setEndingTime(calendar.getTime());
bsSgcJsjdBuiProgress.setFillingStatus("0");
bsSgcJsjdBuiProgressMapper.insert(bsSgcJsjdBuiProgress);
}
}
}

30
jwtech-system/src/main/java/com/kms/build/controller/BsSgcJsjdBuiProgressController.java

@ -1,8 +1,10 @@
package com.kms.build.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jianwei.common.core.controller.BaseController;
import com.jianwei.common.core.domain.SearchParam;
import com.jianwei.common.utils.poi.ExcelUtil;
@ -99,6 +101,34 @@ public class BsSgcJsjdBuiProgressController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody BsSgcJsjdBuiProgress bsSgcJsjdBuiProgress)
{
//获取月度
Date monthly = bsSgcJsjdBuiProgress.getMonthly();
//获取年度
int year = monthly.getYear();
String proCode = bsSgcJsjdBuiProgress.getProCode();
String proNo = bsSgcJsjdBuiProgress.getProNo();
//获取未修改的记录
String id = bsSgcJsjdBuiProgress.getId();
BsSgcJsjdBuiProgress byId = bsSgcJsjdBuiProgressService.getById(id);
//未修改前的月度完成量
Double monthlyWorkload = byId.getMonthlyWorkload();
QueryWrapper<BsSgcJsjdBuiProgress> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("pro_code", proCode);
queryWrapper.eq("pro_no", proNo);
List<BsSgcJsjdBuiProgress> list = bsSgcJsjdBuiProgressService.list(queryWrapper);
for (BsSgcJsjdBuiProgress sgcJsjdBuiProgress : list) {
if (monthly.after(sgcJsjdBuiProgress.getMonthly())) {
if (sgcJsjdBuiProgress.getMonthly().getYear() == year) {
sgcJsjdBuiProgress.setYearlyCumulativeWorkload(sgcJsjdBuiProgress.getYearlyCumulativeWorkload() -monthlyWorkload+bsSgcJsjdBuiProgress.getMonthlyWorkload());
}
sgcJsjdBuiProgress.setProjectOverallWorkload(sgcJsjdBuiProgress.getProjectOverallWorkload() - monthlyWorkload + bsSgcJsjdBuiProgress.getMonthlyWorkload());
bsSgcJsjdBuiProgressService.updateById(sgcJsjdBuiProgress);
}
}
return toAjax(bsSgcJsjdBuiProgressService.updateById(bsSgcJsjdBuiProgress));
}

6
jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiProgress.java

@ -37,7 +37,7 @@ public class BsSgcJsjdBuiProgress extends BaseEntity
/** 月度完成工作量 */
@Excel(name = "月度完成工作量")
@ApiModelProperty("月度完成工作量")
private String monthlyWorkload;
private Double monthlyWorkload;
/** 月度目标工作完成量 */
@Excel(name = "月度目标工作完成量")
@ -59,7 +59,7 @@ public class BsSgcJsjdBuiProgress extends BaseEntity
*/
@Excel(name = "年度累计完成工作量")
@ApiModelProperty("年度累计完成工作量")
private String yearlyCumulativeWorkload;
private Double yearlyCumulativeWorkload;
/** 年度累计投资完成率 */
@Excel(name = "年度累计投资完成率")
@ -74,7 +74,7 @@ public class BsSgcJsjdBuiProgress extends BaseEntity
/** 项目总体完成工作量 */
@Excel(name = "项目总体完成工作量")
@ApiModelProperty("项目总体完成工作量")
private String projectOverallWorkload;
private Double projectOverallWorkload;
/** 项目总体投资效益 */
@Excel(name = "项目总体投资效益")

Loading…
Cancel
Save