|
|
@@ -1,17 +1,16 @@
|
|
|
package com.gyee.backconfig.controller.test;
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.gyee.backconfig.common.requst.vo.ProjectPlanQueryVo;
|
|
|
import com.gyee.backconfig.config.R;
|
|
|
import com.gyee.backconfig.model.auto.XrpProjectplan;
|
|
|
import com.gyee.backconfig.service.BackConfigService;
|
|
|
-import com.gyee.backconfig.service.auto.impl.XrpProjectplanServiceImpl;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
@@ -56,7 +55,6 @@ public class XrpProjectplanServiceController {
|
|
|
|
|
|
//新增
|
|
|
@PostMapping("/saveXPP")
|
|
|
- @ResponseBody
|
|
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
public R saveXPP(@RequestBody XrpProjectplan xrpProjectplan){
|
|
|
Boolean saveSingle = backConfigService.saveSingle(xrpProjectplan);
|
|
|
@@ -67,6 +65,137 @@ public class XrpProjectplanServiceController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /*//根据条件进行删除
|
|
|
+ @GetMapping("/remove-projectplan")
|
|
|
+ @CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
+ public R removeProjectplan(
|
|
|
+ @PathVariable(value = "id", required = true) String id,
|
|
|
+ @RequestParam(value = "projectid", required = false) String projectid,
|
|
|
+ @RequestParam(value = "generatingcapacity", required = false) String generatingcapacity,
|
|
|
+ @RequestParam(value = "outagehours", required = false) Double outagehours,
|
|
|
+ @RequestParam(value = "year", required = false) String year,
|
|
|
+ @RequestParam(value = "month", required = false) String month,
|
|
|
+ @RequestParam(value = "windpower", required = false) String windpower,
|
|
|
+ @RequestParam(value = "version", required = false) Integer version
|
|
|
+ ){
|
|
|
+ XrpProjectplan xrpProjectplan=new XrpProjectplan();
|
|
|
+ setDeleteVo(id, projectid, generatingcapacity, outagehours, year, month, windpower, version, xrpProjectplan);
|
|
|
+ boolean removePP = backConfigService.removeWapper(xrpProjectplan);
|
|
|
+ if (removePP){
|
|
|
+ return R.ok().data(removePP);
|
|
|
+ }else {
|
|
|
+ return R.error().data("更新失败!");
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ /*private void setDeleteVo(@RequestParam(value = "id", required = false) String id, @RequestParam(value = "projectid", required = false) String projectid, @RequestParam(value = "generatingcapacity", required = false) String generatingcapacity, @RequestParam(value = "outagehours", required = false) Double outagehours, @RequestParam(value = "year", required = false) String year, @RequestParam(value = "month", required = false) String month, @RequestParam(value = "windpower", required = false) String windpower, @RequestParam(value = "version", required = false) Integer version, XrpProjectplan xrpProjectplan) {
|
|
|
+ xrpProjectplan.setId(id);
|
|
|
+ xrpProjectplan.setProjectid(projectid);
|
|
|
+ xrpProjectplan.setGeneratingcapacity(generatingcapacity);
|
|
|
+ xrpProjectplan.setOutagehours(outagehours);
|
|
|
+ xrpProjectplan.setYear(year);
|
|
|
+ xrpProjectplan.setMonth(month);
|
|
|
+ xrpProjectplan.setWindpower(windpower);
|
|
|
+ xrpProjectplan.setVersion(version);
|
|
|
+ }*/
|
|
|
+ /*//根据条件进行删除
|
|
|
+ @DeleteMapping("/remove-projectplan/{id}")
|
|
|
+ @CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
+ public R deleteProjectplan(
|
|
|
+ @PathVariable(value = "id", required = true) String id,
|
|
|
+ @RequestBody XrpProjectplan xrpProjectplan
|
|
|
+ ){
|
|
|
+ System.out.println(id);
|
|
|
+ System.out.println("--------"+xrpProjectplan);
|
|
|
+ xrpProjectplan.setId(id);
|
|
|
+ boolean removePP = backConfigService.removeWapper(xrpProjectplan);
|
|
|
+ if (removePP){
|
|
|
+ return R.ok().data(removePP);
|
|
|
+ }else {
|
|
|
+ return R.error().data("更新失败!");
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ //删除
|
|
|
+ @DeleteMapping("/remove-projectplan/{id}")
|
|
|
+ @CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
+ public R deleteProjectplan(
|
|
|
+ @PathVariable(value = "id", required = true) String id
|
|
|
+ ){
|
|
|
+ boolean removePP = backConfigService.removeWapperById(id);
|
|
|
+ if (removePP){
|
|
|
+ return R.ok().data(removePP);
|
|
|
+ }else {
|
|
|
+ return R.error().data("更新失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //新增或者更新
|
|
|
+ @PostMapping("/add-modify-projectplan")
|
|
|
+ @CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
+ public R addModifyProjectPlan(@RequestBody XrpProjectplan xrpProjectplan){
|
|
|
+ boolean saveOrUpdate = backConfigService.saveOrUpdate(xrpProjectplan);
|
|
|
+ if (saveOrUpdate) {
|
|
|
+ return R.ok().data("保存或更新成功");
|
|
|
+ }else{
|
|
|
+ return R.error().message("保存失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //分页查询
|
|
|
+ /* @PostMapping("/listByPage")
|
|
|
+ @ResponseBody
|
|
|
+ @CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
+ public R ListByPage(int current,int pageSize){
|
|
|
+ Page<XrpProjectplan> xrpProjectplanPage = backConfigService.listBypage(current, pageSize);
|
|
|
+ if (StringUtils.isNotNull(xrpProjectplanPage)) {
|
|
|
+ return R.ok().data(xrpProjectplanPage);
|
|
|
+ }else{
|
|
|
+ return R.error().message("访问失败");
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ //正式接口
|
|
|
+ @GetMapping("/listByPage")
|
|
|
+ @ResponseBody
|
|
|
+ @CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
+ public R ListByPage(
|
|
|
+ @RequestParam(value = "pagenum",required = true) Integer pageNum,
|
|
|
+ @RequestParam(value = "pagesize",required = true) Integer pageSize,
|
|
|
+ @RequestParam(value = "id", required = false) String id,
|
|
|
+ @RequestParam(value = "projectid", required = false) String projectid,
|
|
|
+ @RequestParam(value = "generatingcapacity", required = false) String generatingcapacity,
|
|
|
+ @RequestParam(value = "outagehours", required = false) Double outagehours,
|
|
|
+ @RequestParam(value = "year", required = false) String year,
|
|
|
+ @RequestParam(value = "month", required = false) String month,
|
|
|
+ @RequestParam(value = "windpower", required = false) String windpower,
|
|
|
+ @RequestParam(value = "version", required = false) Integer version){
|
|
|
+
|
|
|
+ ProjectPlanQueryVo vo=new ProjectPlanQueryVo();
|
|
|
+ setVOTemplate(pageNum, pageSize, id, projectid, generatingcapacity, outagehours, year, month, windpower, version, vo);
|
|
|
+
|
|
|
+ Page<XrpProjectplan> xrpProjectplanPage = backConfigService.listBypage(vo);
|
|
|
+ if (StringUtils.isNotNull(xrpProjectplanPage)) {
|
|
|
+ return R.ok().data(xrpProjectplanPage);
|
|
|
+ }else{
|
|
|
+ return R.error().message("访问失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setVOTemplate(@RequestParam(value = "pagenum", required = true) Integer pageNum, @RequestParam(value = "pagesize", required = true) Integer pageSize, @RequestParam(value = "id", required = false) String id, @RequestParam(value = "projectid", required = false) String projectid, @RequestParam(value = "generatingcapacity", required = false) String generatingcapacity, @RequestParam(value = "outagehours", required = false) Double outagehours, @RequestParam(value = "year", required = false) String year, @RequestParam(value = "month", required = false) String month, @RequestParam(value = "windpower", required = false) String windpower, @RequestParam(value = "version", required = false) Integer version, ProjectPlanQueryVo vo) {
|
|
|
+ vo.setId(id);
|
|
|
+ vo.setProjectid(projectid);
|
|
|
+ vo.setGeneratingcapacity(generatingcapacity);
|
|
|
+ vo.setOutagehours(outagehours);
|
|
|
+ vo.setYear(year);
|
|
|
+ vo.setMonth(month);
|
|
|
+ vo.setWindpower(windpower);
|
|
|
+ vo.setVersion(version);
|
|
|
+ vo.setCurrent(pageNum);
|
|
|
+ vo.setPageSize(pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//更新
|
|
|
/*public void xppUpdate(@RequestBody XrpProjectplan xpp){
|
|
|
if(StringUtils.isNotEmpty(xpp))
|