|
@@ -3,11 +3,13 @@ package com.zjugis.business.controller;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.zjugis.business.bean.dto.ProjectCostDto;
|
|
|
import com.zjugis.business.bean.entity.ProjectCost;
|
|
|
+import com.zjugis.business.bean.response.ProjectCostResponse;
|
|
|
import com.zjugis.business.service.ProjectCostService;
|
|
|
import com.zjugis.framework.common.pojo.CommonResult;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -22,27 +24,32 @@ public class ProjectCostController {
|
|
|
@Autowired
|
|
|
private ProjectCostService projectCostService;
|
|
|
|
|
|
- @GetMapping("/projectCost/page")
|
|
|
- public CommonResult<Page<ProjectCost>> page(@RequestBody ProjectCostDto projectCostDto ) {
|
|
|
+ @GetMapping("/project-cost/page")
|
|
|
+ public CommonResult<Page<ProjectCost>> page(@Valid ProjectCostDto projectCostDto ) {
|
|
|
return CommonResult.success(projectCostService.page(projectCostDto));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/projectCost")
|
|
|
+ @PostMapping("/project-cost/calculate")
|
|
|
+ public CommonResult<ProjectCostResponse> calculate(@Valid @RequestBody ProjectCostDto projectCostDto) {
|
|
|
+ return CommonResult.success(projectCostService.calculate(projectCostDto));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/project-cost")
|
|
|
public CommonResult<ProjectCost> get(@RequestParam("id") String id) {
|
|
|
return CommonResult.success(projectCostService.queryById(id));
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/projectCost")
|
|
|
+ @PostMapping("/project-cost")
|
|
|
public CommonResult<String> create(@RequestBody ProjectCost projectCost) {
|
|
|
return CommonResult.success(projectCostService.insert(projectCost));
|
|
|
}
|
|
|
|
|
|
- @DeleteMapping("/projectCost")
|
|
|
+ @DeleteMapping("/project-cost")
|
|
|
public CommonResult delete(@RequestBody List<String> idList) {
|
|
|
return CommonResult.success(projectCostService.deleteByIdList(idList));
|
|
|
}
|
|
|
|
|
|
- @PutMapping("/projectCost")
|
|
|
+ @PutMapping("/project-cost")
|
|
|
public CommonResult update(@RequestBody ProjectCost projectCost) {
|
|
|
return CommonResult.success(projectCostService.update(projectCost));
|
|
|
}
|