|
@@ -1,23 +1,13 @@
|
|
|
package com.wtkj.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
-import com.wtkj.entity.Task;
|
|
|
-import com.wtkj.entity.TaskContract;
|
|
|
-import com.wtkj.entity.TaskFile;
|
|
|
-import com.wtkj.entity.TaskLog;
|
|
|
-import com.wtkj.service.ITaskContractService;
|
|
|
-import com.wtkj.service.ITaskFileService;
|
|
|
-import com.wtkj.service.ITaskLogService;
|
|
|
-import com.wtkj.service.ITaskService;
|
|
|
-import com.wtkj.vo.TaskFileVO;
|
|
|
-import com.wtkj.vo.TaskLogVO;
|
|
|
-import com.wtkj.vo.TaskVO;
|
|
|
-import com.wtkj.wrapper.TaskContractWrapper;
|
|
|
-import com.wtkj.wrapper.TaskFileWrapper;
|
|
|
-import com.wtkj.wrapper.TaskLogWrapper;
|
|
|
-import com.wtkj.wrapper.TaskWrapper;
|
|
|
+import com.wtkj.entity.*;
|
|
|
+import com.wtkj.service.*;
|
|
|
+import com.wtkj.vo.*;
|
|
|
+import com.wtkj.wrapper.*;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -49,6 +39,8 @@ public class TaskController {
|
|
|
|
|
|
private final ITaskContractService taskContractService;
|
|
|
|
|
|
+ private final ITaskCostService taskCostService;
|
|
|
+
|
|
|
|
|
|
@GetMapping("/my-task-page")
|
|
|
@ApiOperationSupport(order = 1)
|
|
@@ -157,7 +149,7 @@ public class TaskController {
|
|
|
@PostMapping("/submit-task-contract")
|
|
|
@ApiOperationSupport(order = 11)
|
|
|
@ApiOperation(value = "新增或者修改任务合同", notes = "")
|
|
|
- public R<Boolean> savaContracts(@RequestBody @Valid TaskContract contract) {
|
|
|
+ public R<Boolean> submitContracts(@RequestBody @Valid TaskContract contract) {
|
|
|
return R.status(taskContractService.saveOrUpdate(contract));
|
|
|
|
|
|
}
|
|
@@ -178,11 +170,66 @@ public class TaskController {
|
|
|
@GetMapping("/task-contract-page")
|
|
|
@ApiOperationSupport(order = 13)
|
|
|
@ApiOperation(value = "任务合同分页", notes = "传入主键taskId,分页参数")
|
|
|
- public R contractPage(@RequestParam Long taskId, Query query) {
|
|
|
+ public R<IPage<TaskContractVO>> contractPage(@RequestParam Long taskId, Query query) {
|
|
|
IPage<TaskContract> page = taskContractService.pageByTaskId(taskId, Condition.getPage(query));
|
|
|
return R.data(TaskContractWrapper.build().pageVO(page));
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 任务成本核算
|
|
|
+ */
|
|
|
+ @PostMapping("/submit-task-cost")
|
|
|
+ @ApiOperationSupport(order = 14)
|
|
|
+ @ApiOperation(value = "新增或修改任务成本", notes = "")
|
|
|
+ public R<Boolean> submitCost(@RequestBody TaskCost cost) {
|
|
|
+ return R.data(taskCostService.saveOrUpdate(cost));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 任务成本详情
|
|
|
+ */
|
|
|
+ @GetMapping("/task-cost-detail")
|
|
|
+ @ApiOperationSupport(order = 15)
|
|
|
+ @ApiOperation(value = "成本详情", notes = "")
|
|
|
+ public R<TaskCostVO> costDetail(@RequestParam Long id) {
|
|
|
+ TaskCost detail = taskCostService.getById(id);
|
|
|
+ return R.data(TaskCostWrapper.build().entityVO(detail));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除成本记录
|
|
|
+ */
|
|
|
+ @GetMapping("/delete-task-cost")
|
|
|
+ @ApiOperationSupport(order = 16)
|
|
|
+ @ApiOperation(value = "删除成本记录", notes = "传入主键ids")
|
|
|
+ public R<Boolean> deleteCost(@RequestParam String ids) {
|
|
|
+ return R.status(taskCostService.removeByIds(Func.toLongList(ids)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 成本分页
|
|
|
+ */
|
|
|
+ @GetMapping("/task-cost-page")
|
|
|
+ @ApiOperationSupport(order = 17)
|
|
|
+ @ApiOperation(value = "成本分页", notes = "传入taskId,分页参数")
|
|
|
+ public R<IPage<TaskCostVO>> costPage(@RequestParam Long taskId, Query query) {
|
|
|
+ IPage<TaskCost> page = taskCostService.pageByTaskId(taskId, Condition.getPage(query));
|
|
|
+ return R.data(TaskCostWrapper.build().pageVO(page));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 成本统计
|
|
|
+ */
|
|
|
+ @GetMapping("/task-cost-statistics")
|
|
|
+ @ApiOperationSupport(order = 18)
|
|
|
+ @ApiOperation(value = "任务成本统计", notes = "传入taskId数")
|
|
|
+ public R<JSONObject> costStatistics(@RequestParam Long taskId) {
|
|
|
+ return R.data(taskCostService.costStatistics(taskId));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
+
|