diff --git a/ggpx/pom.xml b/ggpx/pom.xml index 78b1a70c..80fabd87 100644 --- a/ggpx/pom.xml +++ b/ggpx/pom.xml @@ -8,13 +8,18 @@ ruoyi 3.8.8 - ggpx - - 17 - 17 - UTF-8 - + + + com.ruoyi + ruoyi-common + + + + org.projectlombok + lombok + + \ No newline at end of file diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskBaseController.java b/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskBaseController.java new file mode 100644 index 00000000..b25f3eb5 --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskBaseController.java @@ -0,0 +1,116 @@ +package com.ruoyi.ggpx.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.ggpx.service.ITaskDataService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.ggpx.domain.TaskBase; +import com.ruoyi.ggpx.service.ITaskBaseService; +import com.ruoyi.common.utils.poi.ExcelUtil; + +/** + * 任务基准Controller + * + * @author Jian + * @date 2024-08-11 + */ +@RestController +@RequestMapping("/ggpx/TaskBase") +public class TaskBaseController extends BaseController { + @Autowired + private ITaskBaseService taskBaseService; + + /** + * 查询任务基准列表 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskBase:list')") + @GetMapping("/list") + public AjaxResult list(TaskBase taskBase) { + List list = taskBaseService.selectTaskBaseList(taskBase); + return success(list); + } + + /** + * 查询任务基准列表 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskBase:list')") + @GetMapping("/listPage") + public TableDataInfo listPage(TaskBase taskBase) { + startPage(); + List list = taskBaseService.selectTaskBaseList(taskBase); + return getDataTable(list); + } + + /** + * 导出任务基准列表 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskBase:export')") + @Log(title = "任务基准", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TaskBase taskBase) { + List list = taskBaseService.selectTaskBaseList(taskBase); + ExcelUtil util = new ExcelUtil(TaskBase.class); + util.exportExcel(response, list, "任务基准数据"); + } + + /** + * 获取任务基准详细信息 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskBase:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(taskBaseService.selectTaskBaseById(id)); + } + + /** + * 新增任务基准 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskBase:add')") + @Log(title = "任务基准", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TaskBase taskBase) { + return toAjax(taskBaseService.insertTaskBase(taskBase)); + } + + @PreAuthorize("@ss.hasPermi('ggpx:TaskBase:add')") + @Log(title = "任务基准", businessType = BusinessType.INSERT) + @PostMapping("/batch") + public AjaxResult addBatch(@RequestBody List taskBaseList) { + return toAjax(taskBaseService.insertTaskBaseBatch(taskBaseList)); + } + + /** + * 修改任务基准 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskBase:edit')") + @Log(title = "任务基准", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TaskBase taskBase) { + return toAjax(taskBaseService.updateTaskBase(taskBase)); + } + + /** + * 删除任务基准 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskBase:remove')") + @Log(title = "任务基准", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(taskBaseService.deleteTaskBaseByIds(ids)); + } +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskController.java b/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskController.java deleted file mode 100644 index d1e62c21..00000000 --- a/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskController.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.ruoyi.ggpx.controller; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.ggpx.domain.Task; -import com.ruoyi.ggpx.service.ITaskService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; - -/** - * 任务列表Controller - * - * @author Jian - * @date 2024-08-11 - */ -@RestController -@RequestMapping("/ggpx/task") -public class TaskController extends BaseController -{ - @Autowired - private ITaskService taskService; - - /** - * 查询任务列表列表 - */ - @PreAuthorize("@ss.hasPermi('ggpx:task:list')") - @GetMapping("/list") - public TableDataInfo list(Task task) - { - startPage(); - List list = taskService.selectTaskList(task); - return getDataTable(list); - } - - /** - * 导出任务列表列表 - */ - @PreAuthorize("@ss.hasPermi('ggpx:task:export')") - @Log(title = "任务列表", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, Task task) - { - List list = taskService.selectTaskList(task); - ExcelUtil util = new ExcelUtil(Task.class); - util.exportExcel(response, list, "任务列表数据"); - } - - /** - * 获取任务列表详细信息 - */ - @PreAuthorize("@ss.hasPermi('ggpx:task:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(taskService.selectTaskById(id)); - } - - /** - * 新增任务列表 - */ - @PreAuthorize("@ss.hasPermi('ggpx:task:add')") - @Log(title = "任务列表", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody Task task) - { - return toAjax(taskService.insertTask(task)); - } - - /** - * 修改任务列表 - */ - @PreAuthorize("@ss.hasPermi('ggpx:task:edit')") - @Log(title = "任务列表", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody Task task) - { - return toAjax(taskService.updateTask(task)); - } - - /** - * 删除任务列表 - */ - @PreAuthorize("@ss.hasPermi('ggpx:task:remove')") - @Log(title = "任务列表", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(taskService.deleteTaskByIds(ids)); - } -} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskDataController.java b/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskDataController.java new file mode 100644 index 00000000..00297157 --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskDataController.java @@ -0,0 +1,230 @@ +package com.ruoyi.ggpx.controller; + +import java.io.IOException; +import java.util.*; +import javax.annotation.security.PermitAll; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.common.annotation.Anonymous; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.utils.poi.ExcelExporter; +import com.ruoyi.ggpx.domain.TaskDataQuery; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.ggpx.domain.TaskData; +import com.ruoyi.ggpx.service.ITaskDataService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 任务数据Controller + * + * @author Jian + * @date 2024-08-11 + */ +@RestController +@RequestMapping("/ggpx/TaskData") +public class TaskDataController extends BaseController { + @Autowired + private ITaskDataService taskDataService; + + /** + * 查询任务数据列表 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskData:list')") + @GetMapping("/list") + public TableDataInfo list(TaskData taskData) { + startPage(); + List list = taskDataService.selectTaskDataList(taskData); + return getDataTable(list); + } + + @PreAuthorize("@ss.hasPermi('ggpx:TaskData:list')") + @GetMapping("/count") + public AjaxResult count(TaskData taskData) { + return success(taskDataService.selectTaskDataCount(taskData)); + } + + /** + * 导出所有填写的数据 + * + * @param taskData + * @param response + * @throws IOException + */ + @PostMapping("/toEXCEL") + public void taskDataToCSV(TaskDataQuery taskData, HttpServletResponse response) throws IOException { + List list = new ArrayList<>(); + Long[] ids = taskData.getIds(); + if (ids == null || ids.length == 0) { + list = taskDataService.selectTaskDataList(taskData); + } else { + list = taskDataService.selectTaskDataListByIds(taskData, ids); + } + List> csvList = new ArrayList<>(); + list.forEach(item -> { + Map csvMap = new LinkedHashMap<>(); + csvMap.put("样品名称", item.getSampleName()); + csvMap.put("组长", item.getGroupLeader()); + csvMap.put("总分", item.getTotalVal()); + List fields = JSONObject.parseObject(item.getData(), List.class); + fields.forEach(field -> { + Map fieldMap = JSONObject.parseObject(field.toString(), Map.class); + Object children = fieldMap.get("children"); + if (children != null) { + List childrenList = JSONObject.parseObject(children.toString(), List.class); + childrenList.forEach(childrenField -> { + Map childrenFieldMap = JSONObject.parseObject(childrenField.toString(), Map.class); + if (childrenFieldMap.get("fieldType").toString().equals("number")) { + csvMap.put(childrenFieldMap.get("fieldName").toString(), childrenFieldMap.getOrDefault("value", 0)); + } else { + csvMap.put(childrenFieldMap.get("fieldName").toString(), childrenFieldMap.getOrDefault("value", "")); + } + }); + } else { + if (fieldMap.get("fieldType").toString().equals("number")) { + csvMap.put(fieldMap.get("fieldName").toString(), fieldMap.getOrDefault("value", 0)); + } else { + csvMap.put(fieldMap.get("fieldName").toString(), fieldMap.getOrDefault("value", "")); + } + } + }); + csvList.add(csvMap); + }); + if (csvList.size() == 0) { + return; + } + Set columns = csvList.get(0).keySet(); + // columns转数组 + String[] columnsArray = columns.toArray(new String[columns.size()]); + ExcelExporter.exportExcel(csvList, columnsArray, "任务数据", response); + } + + /** + * 导出二级指标&&计入总分的数据--用于进一步统计 + * + * @param taskData + * @param response + * @throws IOException + */ + @PostMapping("/toEXCEL2") + public void taskDataToCSV2(TaskDataQuery taskData, HttpServletResponse response) throws IOException { + List list = new ArrayList<>(); + Long[] ids = taskData.getIds(); + if (ids == null || ids.length == 0) { + list = taskDataService.selectTaskDataList(taskData); + } else { + list = taskDataService.selectTaskDataListByIds(taskData, ids); + } + List> csvList = new ArrayList<>(); + list.forEach(item -> { + Map csvMap = new LinkedHashMap<>(); + csvMap.put("样品名称", item.getSampleName()); + List fields = JSONObject.parseObject(item.getData(), List.class); + fields.forEach(field -> { + Map fieldMap = JSONObject.parseObject(field.toString(), Map.class); + Object children = fieldMap.get("children"); + if (children != null) { + List childrenList = JSONObject.parseObject(children.toString(), List.class); + childrenList.forEach(childrenField -> { + Map childrenFieldMap = JSONObject.parseObject(childrenField.toString(), Map.class); + if ((int) childrenFieldMap.getOrDefault("status", 1) == 0) { + csvMap.put(childrenFieldMap.get("fieldName").toString(), childrenFieldMap.getOrDefault("value", 0)); + } + }); + } + }); + csvList.add(csvMap); + }); + if (csvList.size() == 0) { + return; + } + Set columns = csvList.get(0).keySet(); + // columns转数组 + String[] columnsArray = columns.toArray(new String[columns.size()]); + ExcelExporter.exportExcel(csvList, columnsArray, "任务数据", response); + } + + @GetMapping("/radar") + public AjaxResult radarData(TaskDataQuery taskData) { + List list = new ArrayList<>(); + Long[] ids = taskData.getIds(); + if (ids == null || ids.length == 0) { + list = taskDataService.selectTaskDataList(taskData); + } else { + list = taskDataService.selectTaskDataListByIds(taskData, ids); + } + return success(list); + } + + + /** + * 导出任务数据列表 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskData:export')") + @Log(title = "任务数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TaskData taskData) { + List list = taskDataService.selectTaskDataList(taskData); + ExcelUtil util = new ExcelUtil(TaskData.class); + util.exportExcel(response, list, "任务数据数据"); + } + + /** + * 获取任务数据详细信息 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskData:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(taskDataService.selectTaskDataById(id)); + } + + /** + * 新增任务数据 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskData:add')") + @Log(title = "任务数据", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TaskData taskData) { + List roles = this.getLoginUser().getUser().getRoles(); + roles.forEach(role -> { + if (role.getRoleKey().equals("pxry-leader")) { + taskData.setGroupLeader("是"); + } + }); + return toAjax(taskDataService.insertTaskData(taskData)); + } + + /** + * 修改任务数据 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskData:edit')") + @Log(title = "任务数据", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TaskData taskData) { + List roles = this.getLoginUser().getUser().getRoles(); + roles.forEach(role -> { + if (role.getRoleKey().equals("pxry-leader")) { + taskData.setGroupLeader("是"); + } + }); + return toAjax(taskDataService.updateTaskData(taskData)); + } + + /** + * 删除任务数据 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskData:remove')") + @Log(title = "任务数据", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(taskDataService.deleteTaskDataByIds(ids)); + } +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskListController.java b/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskListController.java new file mode 100644 index 00000000..eebc2839 --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/controller/TaskListController.java @@ -0,0 +1,125 @@ +package com.ruoyi.ggpx.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.ggpx.domain.TaskData; +import com.ruoyi.ggpx.service.ITaskBaseService; +import com.ruoyi.ggpx.service.ITaskDataService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.ggpx.domain.TaskList; +import com.ruoyi.ggpx.service.ITaskListService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 任务列表Controller + * + * @author Jian + * @date 2024-08-11 + */ +@RestController +@RequestMapping("/ggpx/TaskList") +public class TaskListController extends BaseController { + @Autowired + private ITaskListService taskListService; + + @Autowired + private ITaskDataService taskDataService; + + /** + * 查询任务列表列表 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskList:list')") + @GetMapping("/list") + public TableDataInfo list(TaskList taskList) { + startPage(); + List list = taskListService.selectTaskListList(taskList); + list.forEach(item -> { + TaskData taskData = new TaskData(); + taskData.setTaskId(item.getId()); + item.setSampleCount((taskDataService.selectTaskDataCount(taskData))); + }); + return getDataTable(list); + } + + /** + * 导出任务列表列表 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskList:export')") + @Log(title = "任务列表", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TaskList taskList) { + List list = taskListService.selectTaskListList(taskList); + ExcelUtil util = new ExcelUtil(TaskList.class); + util.exportExcel(response, list, "任务列表数据"); + } + + /** + * 获取任务列表详细信息 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskList:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(taskListService.selectTaskListById(id)); + } + + @PreAuthorize("@ss.hasPermi('ggpx:TaskList:query')") + @GetMapping(value = "/statistics/{id}") + public AjaxResult getStatistics(@PathVariable("id") Long id) { + TaskList taskList = taskListService.selectTaskListById(id); + if (taskList.getIsTemplate() == 1) { + return AjaxResult.success("操作成功", taskList.getStatistics()); + } else { + TaskList taskListQuery = new TaskList(); + taskListQuery.setId(taskList.getParentId()); + taskListQuery.setIsTemplate(1); + List taskLists = taskListService.selectTaskListList(taskListQuery); + if (taskLists.size() > 0) { + return AjaxResult.success("操作成功", taskLists.get(0).getStatistics()); + } + } + return AjaxResult.success("操作成功", ""); + } + + @PreAuthorize("@ss.hasPermi('ggpx:TaskList:add')") + @Log(title = "任务列表", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult addBatch(@RequestBody TaskList taskList) { + taskListService.insertTaskList(taskList); + return success(taskList.getId()); + } + + /** + * 修改任务列表 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskList:edit')") + @Log(title = "任务列表", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TaskList taskList) { + return toAjax(taskListService.updateTaskList(taskList)); + } + + /** + * 删除任务列表 + */ + @PreAuthorize("@ss.hasPermi('ggpx:TaskList:remove')") + @Log(title = "任务列表", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(taskListService.deleteTaskListByIds(ids)); + } +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/domain/Task.java b/ggpx/src/main/java/com/ruoyi/ggpx/domain/Task.java deleted file mode 100644 index 40319c93..00000000 --- a/ggpx/src/main/java/com/ruoyi/ggpx/domain/Task.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.ruoyi.ggpx.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 任务列表对象 ggpx_task - * - * @author Jian - * @date 2024-08-11 - */ -public class Task extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** id */ - private Long id; - - /** 任务名称 */ - @Excel(name = "任务名称") - private String name; - - /** 任务类型 */ - @Excel(name = "任务类型") - private Integer type; - - /** 填报标准 */ - @Excel(name = "填报标准") - private String base; - - /** 状态 */ - @Excel(name = "状态") - private Integer status; - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - public void setName(String name) - { - this.name = name; - } - - public String getName() - { - return name; - } - public void setType(Integer type) - { - this.type = type; - } - - public Integer getType() - { - return type; - } - public void setBase(String base) - { - this.base = base; - } - - public String getBase() - { - return base; - } - public void setStatus(Integer status) - { - this.status = status; - } - - public Integer getStatus() - { - return status; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("type", getType()) - .append("base", getBase()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); - } -} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskBase.java b/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskBase.java new file mode 100644 index 00000000..17a28b70 --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskBase.java @@ -0,0 +1,142 @@ +package com.ruoyi.ggpx.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.TreeEntity; + +/** + * 任务基准对象 ggpx_task_base + * + * @author Jian + * @date 2024-08-11 + */ +public class TaskBase extends TreeEntity +{ + private static final long serialVersionUID = 1L; + + /** ID */ + private Long id; + + /** 任务ID */ + @Excel(name = "任务ID") + private Long taskId; + + /** 字段名称 */ + @Excel(name = "字段名称") + private String fieldName; + + /** 字段类型 */ + @Excel(name = "字段类型") + private String fieldType; + + /** 字段标签 */ + @Excel(name = "字段标签") + private String fieldLabel; + + /** 默认值 */ + @Excel(name = "默认值") + private String defaultVal; + + /** 最大值 */ + @Excel(name = "最大值") + private Long maxVal; + + /** 状态 */ + @Excel(name = "状态") + private Integer status; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTaskId(Long taskId) + { + this.taskId = taskId; + } + + public Long getTaskId() + { + return taskId; + } + public void setFieldName(String fieldName) + { + this.fieldName = fieldName; + } + + public String getFieldName() + { + return fieldName; + } + public void setFieldType(String fieldType) + { + this.fieldType = fieldType; + } + + public String getFieldType() + { + return fieldType; + } + public void setFieldLabel(String fieldLabel) + { + this.fieldLabel = fieldLabel; + } + + public String getFieldLabel() + { + return fieldLabel; + } + public void setDefaultVal(String defaultVal) + { + this.defaultVal = defaultVal; + } + + public String getDefaultVal() + { + return defaultVal; + } + public void setMaxVal(Long maxVal) + { + this.maxVal = maxVal; + } + + public Long getMaxVal() + { + return maxVal; + } + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("taskId", getTaskId()) + .append("fieldName", getFieldName()) + .append("parentId", getParentId()) + .append("orderNum", getOrderNum()) + .append("fieldType", getFieldType()) + .append("fieldLabel", getFieldLabel()) + .append("defaultVal", getDefaultVal()) + .append("maxVal", getMaxVal()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskData.java b/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskData.java new file mode 100644 index 00000000..17d0f3ed --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskData.java @@ -0,0 +1,176 @@ +package com.ruoyi.ggpx.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 任务数据对象 ggpx_task_data + * + * @author Jian + * @date 2024-08-11 + */ +public class TaskData extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private Long id; + + /** + * 任务ID + */ + @Excel(name = "任务ID") + private Long taskId; + + /** + * 样品名称 + */ + @Excel(name = "样品名称") + private String sampleName; + + /** + * 任务数据 + */ + @Excel(name = "任务数据") + private String data; + + /** + * 组长 + */ + @Excel(name = "组长") + private String groupLeader; + + /** + * 状态 + */ + @Excel(name = "状态") + private Integer status; + + /** + * 是否有质量 + */ + @Excel(name = "是否有质量") + private Integer hasQuality; + + /** + * 质量 + */ + @Excel(name = "质量") + private String quality; + + /** + * 是否有总分 + */ + @Excel(name = "是否有总分") + private Integer hasTotal; + + /** + * 总分 + */ + @Excel(name = "总分") + private Double totalVal; + + public Integer getHasQuality() { + return hasQuality; + } + + public void setHasQuality(Integer hasQuality) { + this.hasQuality = hasQuality; + } + + public String getQuality() { + return quality; + } + + public void setQuality(String quality) { + this.quality = quality; + } + + public Integer getHasTotal() { + return hasTotal; + } + + public void setHasTotal(Integer hasTotal) { + this.hasTotal = hasTotal; + } + + public Double getTotalVal() { + return totalVal; + } + + public void setTotalVal(Double totalVal) { + this.totalVal = totalVal; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + public Long getTaskId() { + return taskId; + } + + public void setSampleName(String sampleName) { + this.sampleName = sampleName; + } + + public String getSampleName() { + return sampleName; + } + + public void setData(String data) { + this.data = data; + } + + public String getData() { + return data; + } + + public void setGroupLeader(String groupLeader) { + this.groupLeader = groupLeader; + } + + public String getGroupLeader() { + return groupLeader; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getStatus() { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("taskId", getTaskId()) + .append("sampleName", getSampleName()) + .append("data", getData()) + .append("groupLeader", getGroupLeader()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("hasQuality", getHasQuality()) + .append("quality", getQuality()) + .append("hasTotal", getHasTotal()) + .append("totalVal", getTotalVal()) + .toString(); + } +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskDataQuery.java b/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskDataQuery.java new file mode 100644 index 00000000..d83684e6 --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskDataQuery.java @@ -0,0 +1,13 @@ +package com.ruoyi.ggpx.domain; + +public class TaskDataQuery extends TaskData { + private Long[] ids; + + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskList.java b/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskList.java new file mode 100644 index 00000000..aaec5b9c --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/domain/TaskList.java @@ -0,0 +1,141 @@ +package com.ruoyi.ggpx.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 任务列表对象 ggpx_task_list + * + * @author Jian + * @date 2024-08-11 + */ +public class TaskList extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private Long id; + + /** + * 任务名称 + */ + @Excel(name = "任务名称") + private String taskName; + + /** + * 状态 + */ + @Excel(name = "状态") + private Integer status; + + /** + * 类型 + */ + @Excel(name = "类型") + private Integer type; + + /** + * 是否模板 + */ + @Excel(name = "是否模板") + private Integer isTemplate; + + /** + * 统计 + */ + @Excel(name = "统计") + private String statistics; + + /** + * 父ID + */ + @Excel(name = "父ID") + private Long parentId; + + private Integer sampleCount; + + public Integer getSampleCount() { + return sampleCount; + } + + public void setSampleCount(Integer sampleCount) { + this.sampleCount = sampleCount; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setTaskName(String taskName) { + this.taskName = taskName; + } + + public String getTaskName() { + return taskName; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getStatus() { + return status; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Integer getIsTemplate() { + return isTemplate; + } + + public void setIsTemplate(Integer isTemplate) { + this.isTemplate = isTemplate; + } + + public String getStatistics() { + return statistics; + } + + public void setStatistics(String statistics) { + this.statistics = statistics; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("taskName", getTaskName()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("type", getType()) + .append("isTemplate", getIsTemplate()) + .append("statistics", getStatistics()) + .append("parentId", getParentId()) + .toString(); + } +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskBaseMapper.java b/ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskBaseMapper.java new file mode 100644 index 00000000..8734dc68 --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskBaseMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.ggpx.mapper; + +import java.util.List; +import com.ruoyi.ggpx.domain.TaskBase; + +/** + * 任务基准Mapper接口 + * + * @author Jian + * @date 2024-08-11 + */ +public interface TaskBaseMapper +{ + /** + * 查询任务基准 + * + * @param id 任务基准主键 + * @return 任务基准 + */ + public TaskBase selectTaskBaseById(Long id); + + /** + * 查询任务基准列表 + * + * @param taskBase 任务基准 + * @return 任务基准集合 + */ + public List selectTaskBaseList(TaskBase taskBase); + + /** + * 新增任务基准 + * + * @param taskBase 任务基准 + * @return 结果 + */ + public int insertTaskBase(TaskBase taskBase); + + /** + * 修改任务基准 + * + * @param taskBase 任务基准 + * @return 结果 + */ + public int updateTaskBase(TaskBase taskBase); + + /** + * 删除任务基准 + * + * @param id 任务基准主键 + * @return 结果 + */ + public int deleteTaskBaseById(Long id); + + /** + * 批量删除任务基准 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTaskBaseByIds(Long[] ids); +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskDataMapper.java b/ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskDataMapper.java new file mode 100644 index 00000000..a1a40d01 --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskDataMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.ggpx.mapper; + +import java.util.List; + +import com.ruoyi.ggpx.domain.TaskData; +import org.apache.ibatis.annotations.Param; + +/** + * 任务数据Mapper接口 + * + * @author Jian + * @date 2024-08-11 + */ +public interface TaskDataMapper { + /** + * 查询任务数据 + * + * @param id 任务数据主键 + * @return 任务数据 + */ + public TaskData selectTaskDataById(Long id); + + /** + * 查询任务数据列表 + * + * @param taskData 任务数据 + * @return 任务数据集合 + */ + public List selectTaskDataList(TaskData taskData); + + /** + * 新增任务数据 + * + * @param taskData 任务数据 + * @return 结果 + */ + public int insertTaskData(TaskData taskData); + + /** + * 修改任务数据 + * + * @param taskData 任务数据 + * @return 结果 + */ + public int updateTaskData(TaskData taskData); + + /** + * 删除任务数据 + * + * @param id 任务数据主键 + * @return 结果 + */ + public int deleteTaskDataById(Long id); + + /** + * 批量删除任务数据 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTaskDataByIds(Long[] ids); + + int selectTaskDataCount(TaskData taskData); + + List selectTaskDataListByIds(@Param("taskData") TaskData taskData, @Param("ids") Long[] ids); +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskMapper.java b/ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskListMapper.java similarity index 59% rename from ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskMapper.java rename to ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskListMapper.java index 663c60c3..87ee1ec3 100644 --- a/ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskMapper.java +++ b/ggpx/src/main/java/com/ruoyi/ggpx/mapper/TaskListMapper.java @@ -1,7 +1,7 @@ package com.ruoyi.ggpx.mapper; import java.util.List; -import com.ruoyi.ggpx.domain.Task; +import com.ruoyi.ggpx.domain.TaskList; /** * 任务列表Mapper接口 @@ -9,7 +9,7 @@ import com.ruoyi.ggpx.domain.Task; * @author Jian * @date 2024-08-11 */ -public interface TaskMapper +public interface TaskListMapper { /** * 查询任务列表 @@ -17,31 +17,31 @@ public interface TaskMapper * @param id 任务列表主键 * @return 任务列表 */ - public Task selectTaskById(Long id); + public TaskList selectTaskListById(Long id); /** * 查询任务列表列表 * - * @param task 任务列表 + * @param taskList 任务列表 * @return 任务列表集合 */ - public List selectTaskList(Task task); + public List selectTaskListList(TaskList taskList); /** * 新增任务列表 * - * @param task 任务列表 + * @param taskList 任务列表 * @return 结果 */ - public int insertTask(Task task); + public int insertTaskList(TaskList taskList); /** * 修改任务列表 * - * @param task 任务列表 + * @param taskList 任务列表 * @return 结果 */ - public int updateTask(Task task); + public int updateTaskList(TaskList taskList); /** * 删除任务列表 @@ -49,7 +49,7 @@ public interface TaskMapper * @param id 任务列表主键 * @return 结果 */ - public int deleteTaskById(Long id); + public int deleteTaskListById(Long id); /** * 批量删除任务列表 @@ -57,5 +57,5 @@ public interface TaskMapper * @param ids 需要删除的数据主键集合 * @return 结果 */ - public int deleteTaskByIds(Long[] ids); + public int deleteTaskListByIds(Long[] ids); } diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskBaseService.java b/ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskBaseService.java new file mode 100644 index 00000000..2bc258bf --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskBaseService.java @@ -0,0 +1,65 @@ +package com.ruoyi.ggpx.service; + +import java.util.List; + +import com.ruoyi.ggpx.domain.TaskBase; + +/** + * 任务基准Service接口 + * + * @author Jian + * @date 2024-08-11 + */ +public interface ITaskBaseService { + /** + * 查询任务基准 + * + * @param id 任务基准主键 + * @return 任务基准 + */ + public TaskBase selectTaskBaseById(Long id); + + /** + * 查询任务基准列表 + * + * @param taskBase 任务基准 + * @return 任务基准集合 + */ + public List selectTaskBaseList(TaskBase taskBase); + + /** + * 新增任务基准 + * + * @param taskBase 任务基准 + * @return 结果 + */ + public int insertTaskBase(TaskBase taskBase); + + public int insertTaskBaseBatch(List taskBaseList); + + public int insertTaskBaseBatch(List taskBaseList, Long newTaskId); + + /** + * 修改任务基准 + * + * @param taskBase 任务基准 + * @return 结果 + */ + public int updateTaskBase(TaskBase taskBase); + + /** + * 批量删除任务基准 + * + * @param ids 需要删除的任务基准主键集合 + * @return 结果 + */ + public int deleteTaskBaseByIds(Long[] ids); + + /** + * 删除任务基准信息 + * + * @param id 任务基准主键 + * @return 结果 + */ + public int deleteTaskBaseById(Long id); +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskDataService.java b/ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskDataService.java new file mode 100644 index 00000000..d0f7e383 --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskDataService.java @@ -0,0 +1,66 @@ +package com.ruoyi.ggpx.service; + +import java.util.List; + +import com.ruoyi.ggpx.domain.TaskData; + +/** + * 任务数据Service接口 + * + * @author Jian + * @date 2024-08-11 + */ +public interface ITaskDataService { + /** + * 查询任务数据 + * + * @param id 任务数据主键 + * @return 任务数据 + */ + public TaskData selectTaskDataById(Long id); + + /** + * 查询任务数据列表 + * + * @param taskData 任务数据 + * @return 任务数据集合 + */ + public List selectTaskDataList(TaskData taskData); + + public List selectTaskDataListByIds(TaskData taskData, Long[] ids); + + /** + * 新增任务数据 + * + * @param taskData 任务数据 + * @return 结果 + */ + public int insertTaskData(TaskData taskData); + + /** + * 修改任务数据 + * + * @param taskData 任务数据 + * @return 结果 + */ + public int updateTaskData(TaskData taskData); + + /** + * 批量删除任务数据 + * + * @param ids 需要删除的任务数据主键集合 + * @return 结果 + */ + public int deleteTaskDataByIds(Long[] ids); + + /** + * 删除任务数据信息 + * + * @param id 任务数据主键 + * @return 结果 + */ + public int deleteTaskDataById(Long id); + + int selectTaskDataCount(TaskData taskData); + +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskService.java b/ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskListService.java similarity index 60% rename from ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskService.java rename to ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskListService.java index adb1b286..96b7e1d5 100644 --- a/ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskService.java +++ b/ggpx/src/main/java/com/ruoyi/ggpx/service/ITaskListService.java @@ -1,7 +1,7 @@ package com.ruoyi.ggpx.service; import java.util.List; -import com.ruoyi.ggpx.domain.Task; +import com.ruoyi.ggpx.domain.TaskList; /** * 任务列表Service接口 @@ -9,7 +9,7 @@ import com.ruoyi.ggpx.domain.Task; * @author Jian * @date 2024-08-11 */ -public interface ITaskService +public interface ITaskListService { /** * 查询任务列表 @@ -17,31 +17,31 @@ public interface ITaskService * @param id 任务列表主键 * @return 任务列表 */ - public Task selectTaskById(Long id); + public TaskList selectTaskListById(Long id); /** * 查询任务列表列表 * - * @param task 任务列表 + * @param taskList 任务列表 * @return 任务列表集合 */ - public List selectTaskList(Task task); + public List selectTaskListList(TaskList taskList); /** * 新增任务列表 * - * @param task 任务列表 + * @param taskList 任务列表 * @return 结果 */ - public int insertTask(Task task); + public int insertTaskList(TaskList taskList); /** * 修改任务列表 * - * @param task 任务列表 + * @param taskList 任务列表 * @return 结果 */ - public int updateTask(Task task); + public int updateTaskList(TaskList taskList); /** * 批量删除任务列表 @@ -49,7 +49,7 @@ public interface ITaskService * @param ids 需要删除的任务列表主键集合 * @return 结果 */ - public int deleteTaskByIds(Long[] ids); + public int deleteTaskListByIds(Long[] ids); /** * 删除任务列表信息 @@ -57,5 +57,5 @@ public interface ITaskService * @param id 任务列表主键 * @return 结果 */ - public int deleteTaskById(Long id); + public int deleteTaskListById(Long id); } diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskBaseServiceImpl.java b/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskBaseServiceImpl.java new file mode 100644 index 00000000..46c1f232 --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskBaseServiceImpl.java @@ -0,0 +1,160 @@ +package com.ruoyi.ggpx.service.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.ggpx.mapper.TaskBaseMapper; +import com.ruoyi.ggpx.domain.TaskBase; +import com.ruoyi.ggpx.service.ITaskBaseService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 任务基准Service业务层处理 + * + * @author Jian + * @date 2024-08-11 + */ +@Service +public class TaskBaseServiceImpl implements ITaskBaseService { + @Autowired + private TaskBaseMapper taskBaseMapper; + + /** + * 查询任务基准 + * + * @param id 任务基准主键 + * @return 任务基准 + */ + @Override + public TaskBase selectTaskBaseById(Long id) { + return taskBaseMapper.selectTaskBaseById(id); + } + + /** + * 查询任务基准列表 + * + * @param taskBase 任务基准 + * @return 任务基准 + */ + @Override + public List selectTaskBaseList(TaskBase taskBase) { + return taskBaseMapper.selectTaskBaseList(taskBase); + } + + /** + * 新增任务基准 + * + * @param taskBase 任务基准 + * @return 结果 + */ + @Override + public int insertTaskBase(TaskBase taskBase) { + taskBase.setCreateTime(DateUtils.getNowDate()); + return taskBaseMapper.insertTaskBase(taskBase); + } + + @Override + @Transactional + public int insertTaskBaseBatch(List taskBaseList) { + AtomicInteger count = new AtomicInteger(); + List parentList = taskBaseList.stream().filter(taskBase -> taskBase.getParentId() == 0).collect(Collectors.toList()); + HashMap> childMap = new HashMap<>(); + for (TaskBase taskBase : taskBaseList) { + if (taskBase.getParentId() == 0) { + List collect = taskBaseList.stream().filter(f -> f.getParentId().equals(taskBase.getId())).collect(Collectors.toList()); + childMap.put(taskBase.getId(), collect); + } + } + + for (TaskBase taskBase : parentList) { + List childList = childMap.get(taskBase.getId()); + taskBase.setId(null); + taskBase.setCreateTime(DateUtils.getNowDate()); + count.addAndGet(taskBaseMapper.insertTaskBase(taskBase)); + long newParentId = taskBase.getId(); + if (childList != null) { + childList.forEach(child -> { + child.setParentId(taskBase.getId()); + child.setId(null); + child.setParentId(newParentId); + child.setCreateTime(DateUtils.getNowDate()); + count.addAndGet(taskBaseMapper.insertTaskBase(child)); + }); + } + } + return count.get(); + } + + @Override + @Transactional + public int insertTaskBaseBatch(List taskBaseList, Long newTaskId) { + AtomicInteger count = new AtomicInteger(); + List parentList = taskBaseList.stream().filter(taskBase -> taskBase.getParentId() == 0).collect(Collectors.toList()); + HashMap> childMap = new HashMap<>(); + for (TaskBase taskBase : taskBaseList) { + if (taskBase.getParentId() == 0) { + List collect = taskBaseList.stream().filter(f -> f.getParentId().equals(taskBase.getId())).collect(Collectors.toList()); + childMap.put(taskBase.getId(), collect); + } + } + + for (TaskBase taskBase : parentList) { + List childList = childMap.get(taskBase.getId()); + taskBase.setId(null); + taskBase.setCreateTime(DateUtils.getNowDate()); + taskBase.setTaskId(newTaskId); + count.addAndGet(taskBaseMapper.insertTaskBase(taskBase)); + long newParentId = taskBase.getId(); + if (childList != null) { + childList.forEach(child -> { + child.setId(null); + child.setTaskId(newTaskId); + child.setParentId(newParentId); + child.setCreateTime(DateUtils.getNowDate()); + count.addAndGet(taskBaseMapper.insertTaskBase(child)); + }); + } + } + return count.get(); + } + + /** + * 修改任务基准 + * + * @param taskBase 任务基准 + * @return 结果 + */ + @Override + public int updateTaskBase(TaskBase taskBase) { + taskBase.setUpdateTime(DateUtils.getNowDate()); + return taskBaseMapper.updateTaskBase(taskBase); + } + + /** + * 批量删除任务基准 + * + * @param ids 需要删除的任务基准主键 + * @return 结果 + */ + @Override + public int deleteTaskBaseByIds(Long[] ids) { + return taskBaseMapper.deleteTaskBaseByIds(ids); + } + + /** + * 删除任务基准信息 + * + * @param id 任务基准主键 + * @return 结果 + */ + @Override + public int deleteTaskBaseById(Long id) { + return taskBaseMapper.deleteTaskBaseById(id); + } +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskDataServiceImpl.java b/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskDataServiceImpl.java new file mode 100644 index 00000000..3d50799f --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskDataServiceImpl.java @@ -0,0 +1,106 @@ +package com.ruoyi.ggpx.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.ggpx.mapper.TaskDataMapper; +import com.ruoyi.ggpx.domain.TaskData; +import com.ruoyi.ggpx.service.ITaskDataService; + +/** + * 任务数据Service业务层处理 + * + * @author Jian + * @date 2024-08-11 + */ +@Service +public class TaskDataServiceImpl implements ITaskDataService +{ + @Autowired + private TaskDataMapper taskDataMapper; + + /** + * 查询任务数据 + * + * @param id 任务数据主键 + * @return 任务数据 + */ + @Override + public TaskData selectTaskDataById(Long id) + { + return taskDataMapper.selectTaskDataById(id); + } + + /** + * 查询任务数据列表 + * + * @param taskData 任务数据 + * @return 任务数据 + */ + @Override + public List selectTaskDataList(TaskData taskData) + { + return taskDataMapper.selectTaskDataList(taskData); + } + + @Override + public List selectTaskDataListByIds(TaskData taskData,Long[] ids) + { + return taskDataMapper.selectTaskDataListByIds(taskData,ids); + } + + public int selectTaskDataCount(TaskData taskData){return taskDataMapper.selectTaskDataCount(taskData);} + + + + /** + * 新增任务数据 + * + * @param taskData 任务数据 + * @return 结果 + */ + @Override + public int insertTaskData(TaskData taskData) + { + taskData.setCreateTime(DateUtils.getNowDate()); + return taskDataMapper.insertTaskData(taskData); + } + + /** + * 修改任务数据 + * + * @param taskData 任务数据 + * @return 结果 + */ + @Override + public int updateTaskData(TaskData taskData) + { + taskData.setUpdateTime(DateUtils.getNowDate()); + return taskDataMapper.updateTaskData(taskData); + } + + /** + * 批量删除任务数据 + * + * @param ids 需要删除的任务数据主键 + * @return 结果 + */ + @Override + public int deleteTaskDataByIds(Long[] ids) + { + return taskDataMapper.deleteTaskDataByIds(ids); + } + + /** + * 删除任务数据信息 + * + * @param id 任务数据主键 + * @return 结果 + */ + @Override + public int deleteTaskDataById(Long id) + { + return taskDataMapper.deleteTaskDataById(id); + } +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskListServiceImpl.java b/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskListServiceImpl.java new file mode 100644 index 00000000..a310c5a6 --- /dev/null +++ b/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskListServiceImpl.java @@ -0,0 +1,106 @@ +package com.ruoyi.ggpx.service.impl; + +import java.util.List; + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.ggpx.domain.TaskBase; +import com.ruoyi.ggpx.service.ITaskBaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.ggpx.mapper.TaskListMapper; +import com.ruoyi.ggpx.domain.TaskList; +import com.ruoyi.ggpx.service.ITaskListService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 任务列表Service业务层处理 + * + * @author Jian + * @date 2024-08-11 + */ +@Service +public class TaskListServiceImpl implements ITaskListService { + @Autowired + private TaskListMapper taskListMapper; + + + @Autowired + private ITaskBaseService taskBaseService; + + /** + * 查询任务列表 + * + * @param id 任务列表主键 + * @return 任务列表 + */ + @Override + public TaskList selectTaskListById(Long id) { + return taskListMapper.selectTaskListById(id); + } + + /** + * 查询任务列表列表 + * + * @param taskList 任务列表 + * @return 任务列表 + */ + @Override + public List selectTaskListList(TaskList taskList) { + return taskListMapper.selectTaskListList(taskList); + } + + /** + * 新增任务列表 + * + * @param taskList 任务列表 + * @return 结果 + */ + @Override + @Transactional + public int insertTaskList(TaskList taskList) { + taskList.setCreateTime(DateUtils.getNowDate()); + taskListMapper.insertTaskList(taskList); + + TaskBase taskBase = new TaskBase(); + taskBase.setTaskId(taskList.getParentId()); + List taskBaseList = taskBaseService.selectTaskBaseList(taskBase); + + taskBaseService.insertTaskBaseBatch(taskBaseList, taskList.getId()); + + return taskList.getId().intValue(); + } + + /** + * 修改任务列表 + * + * @param taskList 任务列表 + * @return 结果 + */ + @Override + public int updateTaskList(TaskList taskList) { + taskList.setUpdateTime(DateUtils.getNowDate()); + return taskListMapper.updateTaskList(taskList); + } + + /** + * 批量删除任务列表 + * + * @param ids 需要删除的任务列表主键 + * @return 结果 + */ + @Override + public int deleteTaskListByIds(Long[] ids) { + return taskListMapper.deleteTaskListByIds(ids); + } + + /** + * 删除任务列表信息 + * + * @param id 任务列表主键 + * @return 结果 + */ + @Override + public int deleteTaskListById(Long id) { + return taskListMapper.deleteTaskListById(id); + } +} diff --git a/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskServiceImpl.java b/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskServiceImpl.java deleted file mode 100644 index 4ad8619e..00000000 --- a/ggpx/src/main/java/com/ruoyi/ggpx/service/impl/TaskServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.ruoyi.ggpx.service.impl; - -import java.util.List; -import com.ruoyi.common.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.ggpx.mapper.TaskMapper; -import com.ruoyi.ggpx.domain.Task; -import com.ruoyi.ggpx.service.ITaskService; - -/** - * 任务列表Service业务层处理 - * - * @author Jian - * @date 2024-08-11 - */ -@Service -public class TaskServiceImpl implements ITaskService -{ - @Autowired - private TaskMapper taskMapper; - - /** - * 查询任务列表 - * - * @param id 任务列表主键 - * @return 任务列表 - */ - @Override - public Task selectTaskById(Long id) - { - return taskMapper.selectTaskById(id); - } - - /** - * 查询任务列表列表 - * - * @param task 任务列表 - * @return 任务列表 - */ - @Override - public List selectTaskList(Task task) - { - return taskMapper.selectTaskList(task); - } - - /** - * 新增任务列表 - * - * @param task 任务列表 - * @return 结果 - */ - @Override - public int insertTask(Task task) - { - task.setCreateTime(DateUtils.getNowDate()); - return taskMapper.insertTask(task); - } - - /** - * 修改任务列表 - * - * @param task 任务列表 - * @return 结果 - */ - @Override - public int updateTask(Task task) - { - task.setUpdateTime(DateUtils.getNowDate()); - return taskMapper.updateTask(task); - } - - /** - * 批量删除任务列表 - * - * @param ids 需要删除的任务列表主键 - * @return 结果 - */ - @Override - public int deleteTaskByIds(Long[] ids) - { - return taskMapper.deleteTaskByIds(ids); - } - - /** - * 删除任务列表信息 - * - * @param id 任务列表主键 - * @return 结果 - */ - @Override - public int deleteTaskById(Long id) - { - return taskMapper.deleteTaskById(id); - } -} diff --git a/ggpx/src/main/resources/mapper/ggpx/TaskBaseMapper.xml b/ggpx/src/main/resources/mapper/ggpx/TaskBaseMapper.xml new file mode 100644 index 00000000..4435565b --- /dev/null +++ b/ggpx/src/main/resources/mapper/ggpx/TaskBaseMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, task_id, field_name, parent_id, order_num, field_type, field_label, default_val, max_val, status, create_by, create_time, update_by, update_time, remark from ggpx_task_base + + + + + + + + insert into ggpx_task_base + + task_id, + field_name, + parent_id, + order_num, + field_type, + field_label, + default_val, + max_val, + status, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{taskId}, + #{fieldName}, + #{parentId}, + #{orderNum}, + #{fieldType}, + #{fieldLabel}, + #{defaultVal}, + #{maxVal}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update ggpx_task_base + + task_id = #{taskId}, + field_name = #{fieldName}, + parent_id = #{parentId}, + order_num = #{orderNum}, + field_type = #{fieldType}, + field_label = #{fieldLabel}, + default_val = #{defaultVal}, + max_val = #{maxVal}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from ggpx_task_base where id = #{id} + + + + delete from ggpx_task_base where id in + + #{id} + + + \ No newline at end of file diff --git a/ggpx/src/main/resources/mapper/ggpx/TaskDataMapper.xml b/ggpx/src/main/resources/mapper/ggpx/TaskDataMapper.xml new file mode 100644 index 00000000..d2aec139 --- /dev/null +++ b/ggpx/src/main/resources/mapper/ggpx/TaskDataMapper.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, + task_id, + sample_name, + data, + group_leader, + status, + create_by, + create_time, + update_by, + update_time, + remark, + hasQuality, + quality, + hasTotal, + totalVal + from ggpx_task_data + + + + + + + + + + + + insert into ggpx_task_data + + task_id, + sample_name, + data, + group_leader, + status, + create_by, + create_time, + update_by, + update_time, + remark, + hasQuality, + quality, + hasTotal, + totalVal, + + + #{taskId}, + #{sampleName}, + #{data}, + #{groupLeader}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{hasQuality}, + #{quality}, + #{hasTotal}, + #{totalVal}, + + + + + update ggpx_task_data + + task_id = #{taskId}, + sample_name = #{sampleName}, + data = #{data}, + group_leader = #{groupLeader}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + hasQuality = #{hasQuality}, + quality = #{quality}, + hasTotal = #{hasTotal}, + totalVal = #{totalVal}, + + where id = #{id} + + + + delete + from ggpx_task_data + where id = #{id} + + + + delete from ggpx_task_data where id in + + #{id} + + + \ No newline at end of file diff --git a/ggpx/src/main/resources/mapper/ggpx/TaskListMapper.xml b/ggpx/src/main/resources/mapper/ggpx/TaskListMapper.xml new file mode 100644 index 00000000..0e0eaf2a --- /dev/null +++ b/ggpx/src/main/resources/mapper/ggpx/TaskListMapper.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + select id, task_name, status, create_by, create_time, update_by, update_time, remark, type, isTemplate, statistics, parent_id from ggpx_task_list + + + + + + + + insert into ggpx_task_list + + task_name, + status, + create_by, + create_time, + update_by, + update_time, + remark, + type, + isTemplate, + statistics, + parent_id, + + + #{taskName}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{type}, + #{isTemplate}, + #{statistics}, + #{parentId}, + + + + + update ggpx_task_list + + task_name = #{taskName}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + type = #{type}, + isTemplate = #{isTemplate}, + statistics = #{statistics}, + parent_id = #{parentId}, + + where id = #{id} + + + + delete from ggpx_task_list where id = #{id} + + + + delete from ggpx_task_list where id in + + #{id} + + + \ No newline at end of file diff --git a/ggpx/src/main/resources/mapper/ggpx/TaskMapper.xml b/ggpx/src/main/resources/mapper/ggpx/TaskMapper.xml deleted file mode 100644 index 4c40946f..00000000 --- a/ggpx/src/main/resources/mapper/ggpx/TaskMapper.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - select id, name, type, base, status, create_by, create_time, update_by, update_time from ggpx_task - - - - - - - - insert into ggpx_task - - name, - type, - base, - status, - create_by, - create_time, - update_by, - update_time, - - - #{name}, - #{type}, - #{base}, - #{status}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update ggpx_task - - name = #{name}, - type = #{type}, - base = #{base}, - status = #{status}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from ggpx_task where id = #{id} - - - - delete from ggpx_task where id in - - #{id} - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 05478cd6..85c98391 100644 --- a/pom.xml +++ b/pom.xml @@ -182,6 +182,12 @@ ${ruoyi.version} + + com.ruoyi + ggpx + ${ruoyi.version} + + @@ -192,6 +198,7 @@ ruoyi-quartz ruoyi-generator ruoyi-common + ggpx pom diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index ce384b46..0032cc59 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -61,6 +61,11 @@ ruoyi-generator + + com.ruoyi + ggpx + + diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index bcfad3ea..321474d9 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,9 +6,9 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: password + url: jdbc:mysql://ruoyi-mysql:3306/ggpx?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: ggpx + password: 7ZH2jxM1 # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index c777ac14..1c4c99ff 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -7,7 +7,7 @@ ruoyi: # 版权年份 copyrightYear: 2024 # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - profile: D:/ruoyi/uploadPath + profile: /home/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数字计算 char 字符验证 @@ -68,13 +68,13 @@ spring: # redis 配置 redis: # 地址 - host: localhost + host: ruoyi-redis # 端口,默认为6379 port: 6379 # 数据库索引 database: 0 # 密码 - password: + password: 7ZH2jxM1 # 连接超时时间 timeout: 10s lettuce: @@ -95,7 +95,7 @@ token: # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) - expireTime: 30 + expireTime: 4320 # MyBatis配置 mybatis: diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelExporter.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelExporter.java new file mode 100644 index 00000000..ee89bc97 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelExporter.java @@ -0,0 +1,45 @@ +package com.ruoyi.common.utils.poi; + +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.stream.Stream; + +public class ExcelExporter { + public static void exportExcel(List> dataList, String[] headers, String fileName, HttpServletResponse response) throws IOException { + Workbook workbook = new XSSFWorkbook(); + Sheet sheet = workbook.createSheet("Sheet1"); + + // 创建表头 + Row headerRow = sheet.createRow(0); + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + } + + // 填充数据 + int rowNum = 1; + for (Map data : dataList) { + Row row = sheet.createRow(rowNum++); + for (int i = 0; i < headers.length; i++) { + row.createCell(i).setCellValue(data.get(headers[i]) == null ? "" : data.get(headers[i]).toString()); + } + } + // 返回到客户端 + try { + workbook.write(response.getOutputStream()); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader("Content-Disposition", "attachment; filename=" + fileName); + }catch (IOException e) { + e.printStackTrace(); + }finally { + workbook.close(); + } + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index b04beffb..29cfc039 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -23,7 +23,7 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; /** * spring security配置 - * + * * @author ruoyi */ @EnableMethodSecurity(prePostEnabled = true, securedEnabled = true) @@ -35,7 +35,7 @@ public class SecurityConfig */ @Autowired private UserDetailsService userDetailsService; - + /** * 认证失败处理类 */ @@ -53,7 +53,7 @@ public class SecurityConfig */ @Autowired private JwtAuthenticationTokenFilter authenticationTokenFilter; - + /** * 跨域过滤器 */ @@ -115,6 +115,7 @@ public class SecurityConfig // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() + .antMatchers("/ggpx/TaskData/to**").permitAll() // 除上面外的所有请求全部需要鉴权认证 .anyRequest().authenticated(); }) diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development index 18b2a3ed..3b207adc 100644 --- a/ruoyi-ui/.env.development +++ b/ruoyi-ui/.env.development @@ -1,5 +1,5 @@ # 页面标题 -VUE_APP_TITLE = 若依管理系统 +VUE_APP_TITLE = 任务管理系统 # 开发环境配置 ENV = 'development' diff --git a/ruoyi-ui/.env.production b/ruoyi-ui/.env.production index cb064ec8..905eaea0 100644 --- a/ruoyi-ui/.env.production +++ b/ruoyi-ui/.env.production @@ -1,5 +1,5 @@ # 页面标题 -VUE_APP_TITLE = 若依管理系统 +VUE_APP_TITLE = 任务管理系统 # 生产环境配置 ENV = 'production' diff --git a/ruoyi-ui/.env.staging b/ruoyi-ui/.env.staging index a47af9a2..f2cf6347 100644 --- a/ruoyi-ui/.env.staging +++ b/ruoyi-ui/.env.staging @@ -1,5 +1,5 @@ # 页面标题 -VUE_APP_TITLE = 若依管理系统 +VUE_APP_TITLE = 任务管理系统 NODE_ENV = production diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 7e438cc2..b847ac7c 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -40,7 +40,7 @@ "axios": "0.28.1", "clipboard": "2.0.8", "core-js": "3.37.1", - "echarts": "5.4.0", + "echarts": "^4.9.0", "element-ui": "2.15.14", "file-saver": "2.0.5", "fuse.js": "6.4.3", @@ -52,6 +52,8 @@ "quill": "1.3.7", "screenfull": "5.0.2", "sortablejs": "1.10.2", + "v-charts": "^1.19.0", + "v-echarts": "^1.0.2", "vue": "2.6.12", "vue-count-to": "1.0.13", "vue-cropper": "0.5.5", diff --git a/ruoyi-ui/src/api/ggpx/TaskBase.js b/ruoyi-ui/src/api/ggpx/TaskBase.js new file mode 100644 index 00000000..5d7ac773 --- /dev/null +++ b/ruoyi-ui/src/api/ggpx/TaskBase.js @@ -0,0 +1,61 @@ +import request from '@/utils/request' + +// 查询任务基准列表 +export function listTaskBase(query) { + return request({ + url: '/ggpx/TaskBase/list', + method: 'get', + params: query + }) +} + +// 查询任务基准列表 +export function listTaskBasePage(query) { + return request({ + url: '/ggpx/TaskBase/listPage', + method: 'get', + params: query + }) +} + +// 查询任务基准详细 +export function getTaskBase(id) { + return request({ + url: '/ggpx/TaskBase/' + id, + method: 'get' + }) +} + +// 新增任务基准 +export function addTaskBase(data) { + return request({ + url: '/ggpx/TaskBase', + method: 'post', + data: data + }) +} + +export function addTaskBaseBatch(data) { + return request({ + url: '/ggpx/TaskBase/batch', + method: 'post', + data: data + }) +} + +// 修改任务基准 +export function updateTaskBase(data) { + return request({ + url: '/ggpx/TaskBase', + method: 'put', + data: data + }) +} + +// 删除任务基准 +export function delTaskBase(id) { + return request({ + url: '/ggpx/TaskBase/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/ggpx/TaskData.js b/ruoyi-ui/src/api/ggpx/TaskData.js new file mode 100644 index 00000000..7ad1d8de --- /dev/null +++ b/ruoyi-ui/src/api/ggpx/TaskData.js @@ -0,0 +1,68 @@ +import request from '@/utils/request' + +// 查询任务数据列表 +export function listTaskData(query) { + return request({ + url: '/ggpx/TaskData/list', + method: 'get', + params: query + }) +} + +export function listTaskDataCount(query) { + return request({ + url: '/ggpx/TaskData/count', + method: 'get', + params: query + }) +} + +export function taskDataToRadar(query) { + return request({ + url: '/ggpx/TaskData/radar', + method: 'get', + params: query + }) +} + +export function taskDataToCSV(query) { + return request({ + url: '/ggpx/TaskData/toCSV', + method: 'get', + params: query + }) +} + +// 查询任务数据详细 +export function getTaskData(id) { + return request({ + url: '/ggpx/TaskData/' + id, + method: 'get' + }) +} + +// 新增任务数据 +export function addTaskData(data) { + return request({ + url: '/ggpx/TaskData', + method: 'post', + data: data + }) +} + +// 修改任务数据 +export function updateTaskData(data) { + return request({ + url: '/ggpx/TaskData', + method: 'put', + data: data + }) +} + +// 删除任务数据 +export function delTaskData(id) { + return request({ + url: '/ggpx/TaskData/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/ggpx/TaskList.js b/ruoyi-ui/src/api/ggpx/TaskList.js new file mode 100644 index 00000000..ede4bc36 --- /dev/null +++ b/ruoyi-ui/src/api/ggpx/TaskList.js @@ -0,0 +1,51 @@ +import request from '@/utils/request' + +// 查询任务列表列表 +export function listTaskList(query) { + return request({ + url: '/ggpx/TaskList/list', + method: 'get', + params: query + }) +} + +// 查询任务列表详细 +export function getTaskList(id) { + return request({ + url: '/ggpx/TaskList/' + id, + method: 'get' + }) +} + +export function getTaskListStatistics(id) { + return request({ + url: '/ggpx/TaskList/statistics/' + id, + method: 'get' + }) +} + +// 新增任务列表 +export function addTaskList(data) { + return request({ + url: '/ggpx/TaskList', + method: 'post', + data: data + }) +} + +// 修改任务列表 +export function updateTaskList(data) { + return request({ + url: '/ggpx/TaskList', + method: 'put', + data: data + }) +} + +// 删除任务列表 +export function delTaskList(id) { + return request({ + url: '/ggpx/TaskList/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/ggpx/submit.js b/ruoyi-ui/src/api/ggpx/submit.js deleted file mode 100644 index 8e2e4577..00000000 --- a/ruoyi-ui/src/api/ggpx/submit.js +++ /dev/null @@ -1,44 +0,0 @@ -import request from '@/utils/request' - -// 查询任务填报列表 -export function listSubmit(query) { - return request({ - url: '/ggpx/submit/list', - method: 'get', - params: query - }) -} - -// 查询任务填报详细 -export function getSubmit(id) { - return request({ - url: '/ggpx/submit/' + id, - method: 'get' - }) -} - -// 新增任务填报 -export function addSubmit(data) { - return request({ - url: '/ggpx/submit', - method: 'post', - data: data - }) -} - -// 修改任务填报 -export function updateSubmit(data) { - return request({ - url: '/ggpx/submit', - method: 'put', - data: data - }) -} - -// 删除任务填报 -export function delSubmit(id) { - return request({ - url: '/ggpx/submit/' + id, - method: 'delete' - }) -} diff --git a/ruoyi-ui/src/api/ggpx/task.js b/ruoyi-ui/src/api/ggpx/task.js deleted file mode 100644 index c23712e7..00000000 --- a/ruoyi-ui/src/api/ggpx/task.js +++ /dev/null @@ -1,44 +0,0 @@ -import request from '@/utils/request' - -// 查询任务列表列表 -export function listTask(query) { - return request({ - url: '/ggpx/task/list', - method: 'get', - params: query - }) -} - -// 查询任务列表详细 -export function getTask(id) { - return request({ - url: '/ggpx/task/' + id, - method: 'get' - }) -} - -// 新增任务列表 -export function addTask(data) { - return request({ - url: '/ggpx/task', - method: 'post', - data: data - }) -} - -// 修改任务列表 -export function updateTask(data) { - return request({ - url: '/ggpx/task', - method: 'put', - data: data - }) -} - -// 删除任务列表 -export function delTask(id) { - return request({ - url: '/ggpx/task/' + id, - method: 'delete' - }) -} diff --git a/ruoyi-ui/src/components/Breadcrumb/index.vue b/ruoyi-ui/src/components/Breadcrumb/index.vue index 1696f547..76316284 100644 --- a/ruoyi-ui/src/components/Breadcrumb/index.vue +++ b/ruoyi-ui/src/components/Breadcrumb/index.vue @@ -35,7 +35,7 @@ export default { const first = matched[0] if (!this.isDashboard(first)) { - matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched) + matched = [{ path: '/TaskList', meta: { title: '首页' }}].concat(matched) } this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index 5c5a2489..57cabde5 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -9,13 +9,13 @@