任务进度甘特图部分
This commit is contained in:
parent
c1ddd69352
commit
ea16c9ae10
@ -67,26 +67,28 @@
|
||||
</if>
|
||||
</select>
|
||||
<select id="exportExcelWorkerEducation" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT a.id,a.study_time,
|
||||
SELECT a.id,a.study_time,
|
||||
a.score,
|
||||
(case when a.is_qualified=1 then '合格' when a.is_qualified=2 then '不合格' else '' end) is_qualified,
|
||||
w.worker_name,b.edu_content,b.edu_course_name,
|
||||
(case when b.edu_type=1 then '入场三级教育' when b.edu_type=2 then '定期安全教育' when b.edu_type=3 then '安全技术交底' when b.edu_type=4 then 'VR安全教育' else '' end) edu_type
|
||||
from worker_safe_education_worker a
|
||||
INNER JOIN worker_info w ON a.worker_id=w.id
|
||||
INNER JOIN worker_safe_education b ON a.edu_id=b.id
|
||||
where 1=1
|
||||
<if test="param.projectSn!=null and param.projectSn!=''">
|
||||
and w.project_sn=#{param.projectSn}
|
||||
</if>
|
||||
<if test="param.eduCourseName!=null and param.eduCourseName!=''">
|
||||
and b.edu_course_name like CONCAT(CONCAT('%',#{param.eduCourseName}),'%')
|
||||
</if>
|
||||
<if test="param.workerName!=null and param.workerName!=''">
|
||||
and w.worker_name like CONCAT(CONCAT('%',#{param.workerName}),'%')
|
||||
</if>
|
||||
<if test="param.eduType!=null and param.eduType!=''">
|
||||
and b.edu_type=#{param.eduType}
|
||||
(case when a.is_qualified=1 then '合格' when a.is_qualified=2 then '不合格' else '' end) is_qualified,
|
||||
w.worker_name,b.edu_content,b.edu_course_name,
|
||||
(case when b.edu_type=1 then '入场三级教育' when b.edu_type=2 then '定期安全教育' when b.edu_type=3 then '安全技术交底' when
|
||||
b.edu_type=4 then 'VR安全教育' else '' end) edu_type
|
||||
from worker_safe_education_worker a
|
||||
INNER JOIN worker_info w ON a.worker_id=w.id
|
||||
INNER JOIN worker_safe_education b ON a.edu_id=b.id
|
||||
where 1=1
|
||||
and b.video_type = 1
|
||||
<if test="param.projectSn != null and param.projectSn != ''">
|
||||
and w.project_sn=#{param.projectSn}
|
||||
</if>
|
||||
<if test="param.eduCourseName != null and param.eduCourseName != ''">
|
||||
and b.edu_course_name like CONCAT(CONCAT('%',#{param.eduCourseName}),'%')
|
||||
</if>
|
||||
<if test="param.workerName != null and param.workerName != ''">
|
||||
and w.worker_name like CONCAT(CONCAT('%',#{param.workerName}),'%')
|
||||
</if>
|
||||
<if test="param.eduType != null and param.eduType != ''">
|
||||
and b.edu_type=#{param.eduType}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,38 +1,35 @@
|
||||
package com.zhgd.xmgl.modules.taskprogress.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressAlarm;
|
||||
import com.zhgd.xmgl.modules.taskprogress.service.ITaskProgressAlarmService;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressAlarm;
|
||||
import com.zhgd.xmgl.modules.taskprogress.service.ITaskProgressAlarmService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
@ -46,151 +43,158 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
@Slf4j
|
||||
@Api(tags = "任务进度甘特图-报警信息相关Api")
|
||||
public class TaskProgressAlarmController {
|
||||
@Autowired
|
||||
private ITaskProgressAlarmService taskProgressAlarmService;
|
||||
@Autowired
|
||||
private ITaskProgressAlarmService taskProgressAlarmService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param taskProgressAlarm
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询任务进度甘特图-报警信息信息", notes = "分页列表查询任务进度甘特图-报警信息信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<TaskProgressAlarm>> queryPageList(TaskProgressAlarm taskProgressAlarm,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<TaskProgressAlarm>> result = new Result<IPage<TaskProgressAlarm>>();
|
||||
QueryWrapper<TaskProgressAlarm> queryWrapper = QueryGenerator.initQueryWrapper(taskProgressAlarm, req.getParameterMap());
|
||||
Page<TaskProgressAlarm> page = new Page<TaskProgressAlarm>(pageNo, pageSize);
|
||||
IPage<TaskProgressAlarm> pageList = taskProgressAlarmService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param taskProgressAlarm
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询任务进度甘特图-报警信息信息", notes = "分页列表查询任务进度甘特图-报警信息信息", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "taskName", value = "任务名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "createDate_begin", value = "报警时间开始", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "createDate_end", value = "报警时间结束", paramType = "query", dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<TaskProgressAlarm>> queryPageList(TaskProgressAlarm taskProgressAlarm,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<TaskProgressAlarm>> result = new Result<IPage<TaskProgressAlarm>>();
|
||||
QueryWrapper<TaskProgressAlarm> queryWrapper = QueryGenerator.initQueryWrapper(taskProgressAlarm, req.getParameterMap());
|
||||
queryWrapper.lambda().orderByDesc(TaskProgressAlarm::getCreateDate);
|
||||
Page<TaskProgressAlarm> page = new Page<TaskProgressAlarm>(pageNo, pageSize);
|
||||
IPage<TaskProgressAlarm> pageList = taskProgressAlarmService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param taskProgressAlarm
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询任务进度甘特图-报警信息信息", notes = "列表查询任务进度甘特图-报警信息信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<TaskProgressAlarm>> queryList(TaskProgressAlarm taskProgressAlarm,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<TaskProgressAlarm> queryWrapper = QueryGenerator.initQueryWrapper(taskProgressAlarm, req.getParameterMap());
|
||||
return Result.success(taskProgressAlarmService.list(queryWrapper));
|
||||
}
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param taskProgressAlarm
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询任务进度甘特图-报警信息信息", notes = "列表查询任务进度甘特图-报警信息信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<TaskProgressAlarm>> queryList(TaskProgressAlarm taskProgressAlarm,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<TaskProgressAlarm> queryWrapper = QueryGenerator.initQueryWrapper(taskProgressAlarm, req.getParameterMap());
|
||||
return Result.success(taskProgressAlarmService.list(queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param taskProgressAlarm
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加任务进度甘特图-报警信息信息", notes = "添加任务进度甘特图-报警信息信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<TaskProgressAlarm> add(@RequestBody TaskProgressAlarm taskProgressAlarm) {
|
||||
taskProgressAlarmService.save(taskProgressAlarm);
|
||||
return Result.ok();
|
||||
}
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param taskProgressAlarm
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加任务进度甘特图-报警信息信息", notes = "添加任务进度甘特图-报警信息信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<TaskProgressAlarm> add(@RequestBody TaskProgressAlarm taskProgressAlarm) {
|
||||
taskProgressAlarmService.save(taskProgressAlarm);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param taskProgressAlarm
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑任务进度甘特图-报警信息信息", notes = "编辑任务进度甘特图-报警信息信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<TaskProgressAlarm> edit(@RequestBody TaskProgressAlarm taskProgressAlarm) {
|
||||
taskProgressAlarmService.updateById(taskProgressAlarm);
|
||||
return Result.ok();
|
||||
}
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param taskProgressAlarm
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑任务进度甘特图-报警信息信息", notes = "编辑任务进度甘特图-报警信息信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<TaskProgressAlarm> edit(@RequestBody TaskProgressAlarm taskProgressAlarm) {
|
||||
taskProgressAlarmService.updateById(taskProgressAlarm);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除任务进度甘特图-报警信息信息", notes = "删除任务进度甘特图-报警信息信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "任务进度甘特图-报警信息ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<TaskProgressAlarm> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||
String id = MapUtils.getString(map, "id");
|
||||
Result<TaskProgressAlarm> result = new Result<TaskProgressAlarm>();
|
||||
TaskProgressAlarm taskProgressAlarm = taskProgressAlarmService.getById(id);
|
||||
if (taskProgressAlarm == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = taskProgressAlarmService.removeById(id);
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除任务进度甘特图-报警信息信息", notes = "删除任务进度甘特图-报警信息信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "任务进度甘特图-报警信息ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<TaskProgressAlarm> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||
String id = MapUtils.getString(map, "id");
|
||||
Result<TaskProgressAlarm> result = new Result<TaskProgressAlarm>();
|
||||
TaskProgressAlarm taskProgressAlarm = taskProgressAlarmService.getById(id);
|
||||
if (taskProgressAlarm == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = taskProgressAlarmService.removeById(id);
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询任务进度甘特图-报警信息信息", notes = "通过id查询任务进度甘特图-报警信息信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "任务进度甘特图-报警信息ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<TaskProgressAlarm> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<TaskProgressAlarm> result = new Result<TaskProgressAlarm>();
|
||||
TaskProgressAlarm taskProgressAlarm = taskProgressAlarmService.getById(id);
|
||||
if (taskProgressAlarm == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(taskProgressAlarm);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询任务进度甘特图-报警信息信息", notes = "通过id查询任务进度甘特图-报警信息信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "任务进度甘特图-报警信息ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<TaskProgressAlarm> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<TaskProgressAlarm> result = new Result<TaskProgressAlarm>();
|
||||
TaskProgressAlarm taskProgressAlarm = taskProgressAlarmService.getById(id);
|
||||
if (taskProgressAlarm == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(taskProgressAlarm);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel任务进度甘特图-报警信息信息", notes = "导出excel任务进度甘特图-报警信息信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<TaskProgressAlarm> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
TaskProgressAlarm taskProgressAlarm = JSON.parseObject(deString, TaskProgressAlarm.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(taskProgressAlarm, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel任务进度甘特图-报警信息信息", notes = "导出excel任务进度甘特图-报警信息信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<TaskProgressAlarm> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
TaskProgressAlarm taskProgressAlarm = JSON.parseObject(deString, TaskProgressAlarm.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(taskProgressAlarm, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<TaskProgressAlarm> pageList = taskProgressAlarmService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "任务进度甘特图-报警信息列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, TaskProgressAlarm.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("任务进度甘特图-报警信息列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<TaskProgressAlarm> pageList = taskProgressAlarmService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "任务进度甘特图-报警信息列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, TaskProgressAlarm.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("任务进度甘特图-报警信息列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
package com.zhgd.xmgl.modules.taskprogress.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgress;
|
||||
import com.zhgd.xmgl.modules.taskprogress.service.ITaskProgressService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -14,19 +12,19 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@ -166,36 +164,39 @@ public class TaskProgressController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* 下载mpp文件模板
|
||||
*/
|
||||
@ApiOperation(value = "导出excel任务进度甘特图信息", notes = "导出excel任务进度甘特图信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<TaskProgress> queryWrapper = null;
|
||||
@GetMapping(value = "/downloadTemplate")
|
||||
@ApiOperation(value = "下载mpp文件模板")
|
||||
public void downloadTemplate(HttpServletResponse response) {
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
TaskProgress taskProgress = JSON.parseObject(deString, TaskProgress.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(taskProgress, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
OutputStream out = response.getOutputStream();
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("application/vnd.ms-project");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode("任务进度甘特图上传模板.mpp.mpp", "UTF-8"));
|
||||
InputStream fis = new ClassPathResource("template/任务进度甘特图上传模板.mpp.mpp").getInputStream();
|
||||
IOUtils.copy(fis, out);
|
||||
out.flush();
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<TaskProgress> pageList = taskProgressService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "任务进度甘特图列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, TaskProgress.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("任务进度甘特图列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入mpp文件解析对应的数据(增量覆盖)
|
||||
*
|
||||
* @param mppFile
|
||||
* @return 删除结果
|
||||
*/
|
||||
@PostMapping(value = "/importData")
|
||||
@ApiOperation(value = "导入mpp文件解析对应的数据(增量覆盖)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "mppUrl", value = "mpp甘特图文件路径", dataType = "string", dataTypeClass = String.class, required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", dataType = "string", dataTypeClass = String.class, required = true, paramType = "query"),
|
||||
})
|
||||
public Result importData(@RequestParam(value = "mppFile") MultipartFile mppFile, String projectSn, Long createUserId) {
|
||||
taskProgressService.importData(mppFile, projectSn, createUserId);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,39 +1,36 @@
|
||||
package com.zhgd.xmgl.modules.taskprogress.controller;
|
||||
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel;
|
||||
import com.zhgd.xmgl.modules.taskprogress.service.ITaskProgressMaterialRelService;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgress;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel;
|
||||
import com.zhgd.xmgl.modules.taskprogress.service.ITaskProgressMaterialRelService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
@ -47,151 +44,154 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
@Slf4j
|
||||
@Api(tags = "任务进度甘特图-材料类型-关联相关Api")
|
||||
public class TaskProgressMaterialRelController {
|
||||
@Autowired
|
||||
private ITaskProgressMaterialRelService taskProgressMaterialRelService;
|
||||
@Autowired
|
||||
private ITaskProgressMaterialRelService taskProgressMaterialRelService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param taskProgressMaterialRel
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询任务进度甘特图-材料类型-关联信息", notes = "分页列表查询任务进度甘特图-材料类型-关联信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<TaskProgressMaterialRel>> queryPageList(TaskProgressMaterialRel taskProgressMaterialRel,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<TaskProgressMaterialRel>> result = new Result<IPage<TaskProgressMaterialRel>>();
|
||||
QueryWrapper<TaskProgressMaterialRel> queryWrapper = QueryGenerator.initQueryWrapper(taskProgressMaterialRel, req.getParameterMap());
|
||||
Page<TaskProgressMaterialRel> page = new Page<TaskProgressMaterialRel>(pageNo, pageSize);
|
||||
IPage<TaskProgressMaterialRel> pageList = taskProgressMaterialRelService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param taskProgressMaterialRel
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询任务进度甘特图-计划材料工程列表", notes = "分页列表查询任务进度甘特图-计划材料工程列表", httpMethod = "GET")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<TaskProgressMaterialRel>> queryPageList(TaskProgressMaterialRel taskProgressMaterialRel,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<TaskProgressMaterialRel>> result = new Result<IPage<TaskProgressMaterialRel>>();
|
||||
QueryWrapper<TaskProgressMaterialRel> queryWrapper = QueryGenerator.initQueryWrapper(taskProgressMaterialRel, req.getParameterMap());
|
||||
Page<TaskProgressMaterialRel> page = new Page<>(pageNo, pageSize);
|
||||
IPage<TaskProgressMaterialRel> pageList = taskProgressMaterialRelService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param taskProgressMaterialRel
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询任务进度甘特图-材料类型-关联信息", notes = "列表查询任务进度甘特图-材料类型-关联信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<TaskProgressMaterialRel>> queryList(TaskProgressMaterialRel taskProgressMaterialRel,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<TaskProgressMaterialRel> queryWrapper = QueryGenerator.initQueryWrapper(taskProgressMaterialRel, req.getParameterMap());
|
||||
return Result.success(taskProgressMaterialRelService.list(queryWrapper));
|
||||
}
|
||||
@ApiOperation(value = "树形列表查询任务进度甘特图-计划材料工程列表", notes = "树形列表查询任务进度甘特图-计划材料工程列表", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/tree/list")
|
||||
public Result<List<TaskProgress>> queryTreeList(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(taskProgressMaterialRelService.queryTreeList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param taskProgressMaterialRel
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加任务进度甘特图-材料类型-关联信息", notes = "添加任务进度甘特图-材料类型-关联信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<TaskProgressMaterialRel> add(@RequestBody TaskProgressMaterialRel taskProgressMaterialRel) {
|
||||
taskProgressMaterialRelService.save(taskProgressMaterialRel);
|
||||
return Result.ok();
|
||||
}
|
||||
@ApiOperation(value = "查询任务进度甘特图-最新的材料用量", notes = "查询任务进度甘特图-最新的材料用量", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "taskProgressId", value = "任务进度甘特图id", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/detailList")
|
||||
public Result<List<TaskProgressMaterialRel>> queryDetailList(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(taskProgressMaterialRelService.queryDetailList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param taskProgressMaterialRel
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑任务进度甘特图-材料类型-关联信息", notes = "编辑任务进度甘特图-材料类型-关联信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<TaskProgressMaterialRel> edit(@RequestBody TaskProgressMaterialRel taskProgressMaterialRel) {
|
||||
taskProgressMaterialRelService.updateById(taskProgressMaterialRel);
|
||||
return Result.ok();
|
||||
}
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param taskProgressMaterialRel
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加任务进度甘特图-材料类型-关联信息", notes = "添加任务进度甘特图-材料类型-关联信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<TaskProgressMaterialRel> add(@RequestBody TaskProgressMaterialRel taskProgressMaterialRel) {
|
||||
taskProgressMaterialRelService.save(taskProgressMaterialRel);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除任务进度甘特图-材料类型-关联信息", notes = "删除任务进度甘特图-材料类型-关联信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "任务进度甘特图-材料类型-关联ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<TaskProgressMaterialRel> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||
String id = MapUtils.getString(map, "id");
|
||||
Result<TaskProgressMaterialRel> result = new Result<TaskProgressMaterialRel>();
|
||||
TaskProgressMaterialRel taskProgressMaterialRel = taskProgressMaterialRelService.getById(id);
|
||||
if (taskProgressMaterialRel == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = taskProgressMaterialRelService.removeById(id);
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param taskProgressMaterialRel
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑任务进度甘特图-材料类型-关联信息", notes = "编辑任务进度甘特图-材料类型-关联信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<TaskProgressMaterialRel> edit(@RequestBody TaskProgressMaterialRel taskProgressMaterialRel) {
|
||||
taskProgressMaterialRelService.updateById(taskProgressMaterialRel);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除任务进度甘特图-材料类型-关联信息", notes = "删除任务进度甘特图-材料类型-关联信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "任务进度甘特图-材料类型-关联ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<TaskProgressMaterialRel> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||
String id = MapUtils.getString(map, "id");
|
||||
Result<TaskProgressMaterialRel> result = new Result<TaskProgressMaterialRel>();
|
||||
TaskProgressMaterialRel taskProgressMaterialRel = taskProgressMaterialRelService.getById(id);
|
||||
if (taskProgressMaterialRel == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = taskProgressMaterialRelService.removeById(id);
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询任务进度甘特图-材料类型-关联信息", notes = "通过id查询任务进度甘特图-材料类型-关联信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "任务进度甘特图-材料类型-关联ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<TaskProgressMaterialRel> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<TaskProgressMaterialRel> result = new Result<TaskProgressMaterialRel>();
|
||||
TaskProgressMaterialRel taskProgressMaterialRel = taskProgressMaterialRelService.getById(id);
|
||||
if (taskProgressMaterialRel == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(taskProgressMaterialRel);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel任务进度甘特图-材料类型-关联信息", notes = "导出excel任务进度甘特图-材料类型-关联信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<TaskProgressMaterialRel> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
TaskProgressMaterialRel taskProgressMaterialRel = JSON.parseObject(deString, TaskProgressMaterialRel.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(taskProgressMaterialRel, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询任务进度甘特图-材料类型-关联信息", notes = "通过id查询任务进度甘特图-材料类型-关联信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "任务进度甘特图-材料类型-关联ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<TaskProgressMaterialRel> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<TaskProgressMaterialRel> result = new Result<TaskProgressMaterialRel>();
|
||||
TaskProgressMaterialRel taskProgressMaterialRel = taskProgressMaterialRelService.getById(id);
|
||||
if (taskProgressMaterialRel == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(taskProgressMaterialRel);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<TaskProgressMaterialRel> pageList = taskProgressMaterialRelService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "任务进度甘特图-材料类型-关联列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, TaskProgressMaterialRel.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("任务进度甘特图-材料类型-关联列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel任务进度甘特图-材料类型-关联信息", notes = "导出excel任务进度甘特图-材料类型-关联信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<TaskProgressMaterialRel> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
TaskProgressMaterialRel taskProgressMaterialRel = JSON.parseObject(deString, TaskProgressMaterialRel.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(taskProgressMaterialRel, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<TaskProgressMaterialRel> pageList = taskProgressMaterialRelService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "任务进度甘特图-材料类型-关联列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, TaskProgressMaterialRel.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("任务进度甘特图-材料类型-关联列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.taskprogress.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -135,12 +132,21 @@ public class TaskProgress implements Serializable {
|
||||
@TableField(value = "remark")
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 负责人名称
|
||||
*/
|
||||
@TableField(value = "duty_user_name", updateStrategy = FieldStrategy.IGNORED)
|
||||
@ApiModelProperty(value = "负责人名称")
|
||||
private String dutyUserName;
|
||||
/**
|
||||
* 子节点列表
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "子节点列表")
|
||||
private List<TaskProgress> children;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "任务进度甘特图-材料类型数量")
|
||||
private List<TaskProgressMaterialRel> relList;
|
||||
|
||||
/**
|
||||
* 开始预警:1提前2正常3逾期
|
||||
|
||||
@ -1,16 +1,17 @@
|
||||
package com.zhgd.xmgl.modules.taskprogress.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 任务进度甘特图-报警信息
|
||||
@ -22,52 +23,55 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
@TableName("task_progress_alarm")
|
||||
@ApiModel(value = "TaskProgressAlarm实体类", description = "TaskProgressAlarm")
|
||||
public class TaskProgressAlarm implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 所属项目SN
|
||||
*/
|
||||
@Excel(name = "所属项目SN", width = 15)
|
||||
@ApiModelProperty(value = "所属项目SN")
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* 任务进度甘特图id
|
||||
*/
|
||||
@Excel(name = "任务进度甘特图id", width = 15)
|
||||
@ApiModelProperty(value = "任务进度甘特图id")
|
||||
private java.lang.Long taskProgressId;
|
||||
/**
|
||||
* 报警详情
|
||||
*/
|
||||
@Excel(name = "报警详情", width = 15)
|
||||
@ApiModelProperty(value = "报警详情")
|
||||
private java.lang.String alarmDetails;
|
||||
/**
|
||||
* 报警类型 1:逾期未开始 2:逾期未完成
|
||||
*/
|
||||
@Excel(name = "报警类型 1:逾期未开始 2:逾期未完成", width = 15)
|
||||
@ApiModelProperty(value = "报警类型 1:逾期未开始 2:逾期未完成")
|
||||
private java.lang.Integer alarmType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 20, format = "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")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.util.Date createDate;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Excel(name = "更新时间", width = 20, format = "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")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private java.util.Date updateDate;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 所属项目SN
|
||||
*/
|
||||
@Excel(name = "所属项目SN", width = 15)
|
||||
@ApiModelProperty(value = "所属项目SN")
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* 任务进度甘特图id
|
||||
*/
|
||||
@Excel(name = "任务进度甘特图id", width = 15)
|
||||
@ApiModelProperty(value = "任务进度甘特图id")
|
||||
private java.lang.Long taskProgressId;
|
||||
/**
|
||||
* 报警详情
|
||||
*/
|
||||
@Excel(name = "报警详情", width = 15)
|
||||
@ApiModelProperty(value = "报警详情")
|
||||
private java.lang.String alarmDetails;
|
||||
/**
|
||||
* 报警类型 1:逾期未开始 2:逾期未完成
|
||||
*/
|
||||
@Excel(name = "报警类型 1:逾期未开始 2:逾期未完成", width = 15)
|
||||
@ApiModelProperty(value = "报警类型 1:逾期未开始 2:逾期未完成")
|
||||
private java.lang.Integer alarmType;
|
||||
/**
|
||||
* 报警时间
|
||||
*/
|
||||
@Excel(name = "报警时间", width = 20, format = "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")
|
||||
@ApiModelProperty(value = "报警时间")
|
||||
private java.util.Date createDate;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Excel(name = "更新时间", width = 20, format = "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")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private java.util.Date updateDate;
|
||||
|
||||
@ApiModelProperty(value = "任务名称")
|
||||
private java.lang.String taskName;
|
||||
}
|
||||
|
||||
@ -32,10 +32,9 @@ public class TaskProgressMaterialRel implements Serializable {
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* taskProgressId
|
||||
* 任务进度甘特图id
|
||||
*/
|
||||
@Excel(name = "taskProgressId", width = 15)
|
||||
@ApiModelProperty(value = "taskProgressId")
|
||||
@ApiModelProperty(value = "任务进度甘特图id")
|
||||
private java.lang.Long taskProgressId;
|
||||
/**
|
||||
* taskProgressMaterialTypeId
|
||||
@ -81,4 +80,8 @@ public class TaskProgressMaterialRel implements Serializable {
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "名称(如工种、材料、设备名称等)")
|
||||
private java.lang.String name;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "类型:1工种2材料3设备")
|
||||
private java.lang.Integer type;
|
||||
}
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
package com.zhgd.xmgl.modules.taskprogress.mapper;
|
||||
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgress;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -17,4 +19,8 @@ import java.util.List;
|
||||
public interface TaskProgressMaterialRelMapper extends BaseMapper<TaskProgressMaterialRel> {
|
||||
|
||||
List<TaskProgressMaterialRel> queryDetailListByContentIds(List<Long> ids);
|
||||
|
||||
List<TaskProgressMaterialRel> queryDetailList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<TaskProgressMaterialRel> queryList(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.zhgd.xmgl.modules.taskprogress.mapper.TaskProgressMaterialRelMapper">
|
||||
<select id="queryDetailListByContentIds"
|
||||
resultType="com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel">
|
||||
select *
|
||||
select tpmr.*, tpmt.type, tpmt.name
|
||||
from task_progress_material_rel tpmr
|
||||
join task_progress_material_type tpmt on tpmt.id = tpmr.task_progress_material_type_id
|
||||
WHERE tpmr.task_progress_content_id in
|
||||
@ -11,4 +11,38 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="queryDetailList" resultType="com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel">
|
||||
select tpmr.*, tpmt.type, tpmt.name
|
||||
from task_progress_material_rel tpmr
|
||||
join task_progress_material_type tpmt on tpmt.id = tpmr.task_progress_material_type_id
|
||||
where tpmr.create_date = (
|
||||
select max(tpmr.create_date)
|
||||
from task_progress_material_rel tpmr
|
||||
join task_progress_material_type tpmt on tpmt.id = tpmr.task_progress_material_type_id
|
||||
where tpmr.task_progress_id = #{taskProgressId}
|
||||
order by tpmr.create_date desc) and tpmr.task_progress_id = #{taskProgressId}
|
||||
</select>
|
||||
|
||||
<select id="queryList" resultType="com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel">
|
||||
select tpmr.*, tpmt.type, tpmt.name
|
||||
from task_progress_material_rel tpmr
|
||||
join task_progress_material_type tpmt on tpmt.id = tpmr.task_progress_material_type_id
|
||||
where tpmr.create_date in (
|
||||
select max(tpmr.create_date)
|
||||
from task_progress_material_rel tpmr
|
||||
join task_progress_material_type tpmt on tpmt.id = tpmr.task_progress_material_type_id
|
||||
where tpmr.task_progress_content_id in
|
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and tpmt.project_sn=#{projectSn}
|
||||
group by tpmr.task_progress_id
|
||||
) and
|
||||
tpmr.task_progress_content_id in
|
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and tpmt.project_sn=#{projectSn}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
package com.zhgd.xmgl.modules.taskprogress.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgress;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 任务进度甘特图-材料类型-关联
|
||||
* @author: pds
|
||||
@ -11,4 +16,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface ITaskProgressMaterialRelService extends IService<TaskProgressMaterialRel> {
|
||||
|
||||
List<TaskProgressMaterialRel> queryDetailList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<TaskProgress> queryTreeList(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.taskprogress.service;
|
||||
import com.zhgd.xmgl.modules.project.entity.ProgressTask;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgress;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -20,4 +21,6 @@ public interface ITaskProgressService extends IService<TaskProgress> {
|
||||
void add(TaskProgress taskProgress);
|
||||
|
||||
void delete(HashMap<String, Object> map);
|
||||
|
||||
void importData(MultipartFile mppFile, String projectSn, Long createUserId);
|
||||
}
|
||||
|
||||
@ -1,11 +1,22 @@
|
||||
package com.zhgd.xmgl.modules.taskprogress.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgress;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel;
|
||||
import com.zhgd.xmgl.modules.taskprogress.mapper.TaskProgressMapper;
|
||||
import com.zhgd.xmgl.modules.taskprogress.mapper.TaskProgressMaterialRelMapper;
|
||||
import com.zhgd.xmgl.modules.taskprogress.service.ITaskProgressMaterialRelService;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 任务进度甘特图-材料类型-关联
|
||||
@ -16,4 +27,32 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@Service
|
||||
public class TaskProgressMaterialRelServiceImpl extends ServiceImpl<TaskProgressMaterialRelMapper, TaskProgressMaterialRel> implements ITaskProgressMaterialRelService {
|
||||
|
||||
@Autowired
|
||||
TaskProgressMaterialRelMapper taskProgressMaterialRelMapper;
|
||||
@Autowired
|
||||
TaskProgressMapper taskProgressMapper;
|
||||
@Autowired
|
||||
TaskProgressServiceImpl taskProgressService;
|
||||
|
||||
@Override
|
||||
public List<TaskProgressMaterialRel> queryDetailList(HashMap<String, Object> paramMap) {
|
||||
return taskProgressMaterialRelMapper.queryDetailList(paramMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskProgress> queryTreeList(HashMap<String, Object> paramMap) {
|
||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||
List<TaskProgress> progressTaskList = taskProgressMapper.selectList(Wrappers.lambdaQuery(TaskProgress.class).eq(TaskProgress::getProjectSn, projectSn));
|
||||
List<Long> ids = progressTaskList.stream().map(TaskProgress::getId).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
paramMap.put("list", ids);
|
||||
List<TaskProgressMaterialRel> taskProgresses = taskProgressMaterialRelMapper.queryList(paramMap);
|
||||
Map<Long, List<TaskProgressMaterialRel>> taskProgressIdMap = taskProgresses.stream().collect(Collectors.groupingBy(TaskProgressMaterialRel::getTaskProgressId));
|
||||
for (TaskProgress taskProgress : progressTaskList) {
|
||||
taskProgress.setRelList(taskProgressIdMap.get(taskProgress.getId()));
|
||||
}
|
||||
}
|
||||
Map<Long, List<TaskProgress>> parentIdTaskListMap = progressTaskList.stream().collect(Collectors.groupingBy(TaskProgress::getParentId));
|
||||
return taskProgressService.getChild(parentIdTaskListMap, 0L);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,9 +9,12 @@ import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgress;
|
||||
import com.zhgd.xmgl.modules.taskprogress.mapper.TaskProgressMapper;
|
||||
import com.zhgd.xmgl.modules.taskprogress.service.ITaskProgressService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -23,6 +26,8 @@ import java.util.stream.Collectors;
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Slf4j
|
||||
public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, TaskProgress> implements ITaskProgressService {
|
||||
@Autowired
|
||||
TaskProgressMapper taskProgressMapper;
|
||||
@ -35,6 +40,7 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
|
||||
@Override
|
||||
public List<TaskProgress> getParentChildList(HashMap<String, Object> paramMap) {
|
||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||
//to do 人名
|
||||
// 查询项目下的节点集合,通过父节点分组
|
||||
List<TaskProgress> progressTaskList = baseMapper.selectList(Wrappers.lambdaQuery(TaskProgress.class).eq(TaskProgress::getProjectSn, projectSn));
|
||||
for (TaskProgress taskProgress : progressTaskList) {
|
||||
@ -107,6 +113,82 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
|
||||
baseMapper.deleteChild(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void importData(MultipartFile mppFile, String projectSn, Long createUserId) {
|
||||
//log.info("用户id:{},执行上传mpp文件操作", createUserId);
|
||||
//List<TaskProgress> progressTasks = taskProgressMapper.selectList(Wrappers.lambdaQuery(TaskProgress.class).eq(TaskProgress::getProjectSn, projectSn));
|
||||
//log.info("原progressTasks:{}", JSON.toJSONString(progressTasks));
|
||||
//
|
||||
//Collection<TaskProgress> progressTaskList = analysisMpp(mppFile, projectSn, createUserId);
|
||||
//log.info("importData的新增数据:{}", progressTaskList);
|
||||
//
|
||||
//if (CollUtil.isNotEmpty(progressTaskList)) {
|
||||
// insertBatch(progressTaskList);
|
||||
//}
|
||||
}
|
||||
|
||||
///**
|
||||
// * 解析mpp文件
|
||||
// *
|
||||
// * @param mppFile 文件
|
||||
// * @param projectSn 项目sn
|
||||
// * @param createUserId 上传用户
|
||||
// * @return
|
||||
// */
|
||||
//private Collection<TaskProgress> analysisMpp(MultipartFile mppFile, String projectSn, Long createUserId) {
|
||||
// List<TaskProgress> projectTaskList = new LinkedList<>();
|
||||
// Set<String> userNameSet = new LinkedHashSet<>();
|
||||
// // <mpp唯一id, 甘特图任务节点>
|
||||
// Map<Long, TaskProgress> uniqueIdTaskProgressMap = new LinkedHashMap<>();
|
||||
// // 前置任务列表
|
||||
// List<TaskProgressPredecessorDTO> progressTaskPredecessorList = new LinkedList<>();
|
||||
// try {
|
||||
// // 读取文件
|
||||
// MPPReader mppRead = new MPPReader();
|
||||
// String fileName = ((HashMap<?, ?>) ((ArrayList<?>) uploadFileService.uploadImage(new MultipartFile[]{mppFile}).get("data")).get(0)).get("filename").toString();
|
||||
// ProjectFile pf = mppRead.read(new File(basePath + fileName));
|
||||
// // 递归拿到对应的数据, 跳过第0级无用数据
|
||||
// List<Task> childTasks = pf.getChildTasks();
|
||||
// if (CollUtil.isNotEmpty(childTasks)) {
|
||||
// structureTaskDataList(projectTaskList, userNameSet, childTasks.get(0).getChildTasks(), uniqueIdTaskProgressMap, progressTaskPredecessorList, 0L, projectSn, createUserId);
|
||||
// // 判断是否具有负责人
|
||||
// if (CollUtil.isNotEmpty(userNameSet)) {
|
||||
// List<SystemUser> dutyUserList = systemUserMapper.selectBySnAndNumberOneList(projectSn, userNameSet);
|
||||
//
|
||||
// // 用户不为空时,进行负责人id赋值
|
||||
// if (CollUtil.isNotEmpty(dutyUserList)) {
|
||||
// Map<String, Long> userMap = dutyUserList.stream().collect(Collectors.toMap(SystemUser::getRealName, SystemUser::getUserId));
|
||||
// for (TaskProgress progressTask : projectTaskList) {
|
||||
// progressTask.setDutyUserId(userMap.get(progressTask.getDutyUserName()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Map<Long, TaskProgress> progressTaskMap = projectTaskList.stream().collect(Collectors.toMap(TaskProgress::getId, Function.identity()));
|
||||
// // 赋值前置任务
|
||||
// if (CollUtil.isNotEmpty(progressTaskPredecessorList)) {
|
||||
// for (TaskProgressPredecessorDTO progressTaskPredecessor : progressTaskPredecessorList) {
|
||||
// TaskProgress progressTask = progressTaskMap.get(progressTaskPredecessor.getTaskId());
|
||||
// String predecessorIds = progressTask.getPredecessorIds();
|
||||
// if (CharSequenceUtil.isBlank(predecessorIds)) {
|
||||
// progressTask.setPredecessorIds(uniqueIdTaskProgressMap.get(progressTaskPredecessor.getPredecessorId()).getId() + "");
|
||||
// } else {
|
||||
// progressTask.setPredecessorIds(predecessorIds + "," + uniqueIdTaskProgressMap.get(progressTaskPredecessor.getPredecessorId()).getId());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return progressTaskMap.values();
|
||||
// }
|
||||
// throw new RuntimeException("mpp文件数据为空!");
|
||||
//
|
||||
// } catch (MPXJException e) {
|
||||
// throw new OpenAlertException("上传甘特图失败,请上传.mpp文件");
|
||||
// } catch (Exception e) {
|
||||
// log.error("解析文件错误!", e);
|
||||
// throw new RuntimeException("上传甘特图失败,失败原因为:" + e.getMessage());
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
/**
|
||||
* 递归设置子节点列表
|
||||
@ -115,7 +197,7 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
|
||||
* @param parentId 父节点id
|
||||
* @return
|
||||
*/
|
||||
private List<TaskProgress> getChild(Map<Long, List<TaskProgress>> parentIdTaskListMap, Long parentId) {
|
||||
public List<TaskProgress> getChild(Map<Long, List<TaskProgress>> parentIdTaskListMap, Long parentId) {
|
||||
List<TaskProgress> parentList = parentIdTaskListMap.getOrDefault(parentId, Collections.emptyList());
|
||||
if (CollUtil.isNotEmpty(parentList)) {
|
||||
for (TaskProgress progressTask : parentList) {
|
||||
|
||||
BIN
src/main/resources/template/任务进度甘特图上传模板.mpp
Normal file
BIN
src/main/resources/template/任务进度甘特图上传模板.mpp
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user