|
@@ -55,7 +55,7 @@ public class ProjectController {
|
|
|
@RequestParam(value = "ordernum", required = false) Integer ordernum,
|
|
|
@RequestParam(value = "version", required = false) Integer version) {
|
|
|
Projectvo vo = new Projectvo();
|
|
|
- setVOTemplate(pageNum,pageNum,id,code,name,aname,windpowerstationid,capacity,capacityunit,quantity,model,commissiondate,masterphone,shiftforeman,shiftforemanphone,ordernum,version,vo);
|
|
|
+ setVOTemplate(pageNum, pageNum, id, code, name, aname, windpowerstationid, capacity, capacityunit, quantity, model, commissiondate, masterphone, shiftforeman, shiftforemanphone, ordernum, version, vo);
|
|
|
Page<Project> ProjectPage = backConfigService.ProjectBypage(vo);
|
|
|
if (StringUtils.isNotNull(ProjectPage)) {
|
|
|
return R.ok().data(ProjectPage);
|
|
@@ -102,14 +102,9 @@ public class ProjectController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 查询
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @param name
|
|
|
* @param pageNum
|
|
@@ -117,34 +112,34 @@ public class ProjectController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping(value = "/List")
|
|
|
- public R findList(@RequestParam(value = "id",required = false) String id,
|
|
|
- @RequestParam(value = "name",required = false) String name,
|
|
|
- @RequestParam(value = "code",required = false) String code,
|
|
|
- @RequestParam(value = "windpowerstationid",required = false) String windpowerstationid,
|
|
|
- @RequestParam(value = "pageNum",required = true) String pageNum,
|
|
|
- @RequestParam(value = "pageSize",required = true) String pageSize){
|
|
|
- IPage<Project> list = projectService.getList(id,name,code,windpowerstationid,pageNum,pageSize);
|
|
|
- if (null != list){
|
|
|
+ public R findList(@RequestParam(value = "id", required = false) String id,
|
|
|
+ @RequestParam(value = "name", required = false) String name,
|
|
|
+ @RequestParam(value = "code", required = false) String code,
|
|
|
+ @RequestParam(value = "windpowerstationid", required = false) String windpowerstationid,
|
|
|
+ @RequestParam(value = "pageNum", required = true) String pageNum,
|
|
|
+ @RequestParam(value = "pageSize", required = true) String pageSize) {
|
|
|
+ IPage<Project> list = projectService.getList(id, name, code, windpowerstationid, pageNum, pageSize);
|
|
|
+ if (null != list) {
|
|
|
return R.ok().data(list);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return R.error().data("查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 根据id查询
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public R findOne(@PathVariable("id") String id){
|
|
|
+ public R findOne(@PathVariable("id") String id) {
|
|
|
|
|
|
Project project = projectService.getOne(id);
|
|
|
- if (StringUtils.isNotNull(project)){
|
|
|
+ if (StringUtils.isNotNull(project)) {
|
|
|
return R.ok().data(project);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return R.error().data("查询失败!");
|
|
|
}
|
|
|
|
|
@@ -153,49 +148,51 @@ public class ProjectController {
|
|
|
|
|
|
/**
|
|
|
* 插入(批量)
|
|
|
+ *
|
|
|
* @param project
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping(value = "/add")
|
|
|
- public R addAll(@RequestBody Project project){
|
|
|
+ public R addAll(@RequestBody Project project) {
|
|
|
|
|
|
boolean b = projectService.addOrUpdate(project);
|
|
|
- if (b){
|
|
|
+ if (b) {
|
|
|
return R.ok().data(b);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return R.error().data("保存失败!");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 批量删除
|
|
|
+ *
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@DeleteMapping(value = "/{ids}")
|
|
|
- public R deleteAll(@PathVariable("ids") String ids){
|
|
|
+ public R deleteAll(@PathVariable("ids") String ids) {
|
|
|
boolean b = projectService.removeByIds(ids);
|
|
|
- if (b){
|
|
|
+ if (b) {
|
|
|
return R.ok().data(b);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return R.error().data("删除失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 批量修改
|
|
|
+ *
|
|
|
* @param list
|
|
|
* @return
|
|
|
*/
|
|
|
@PutMapping(value = "/editRegions")
|
|
|
- public R update(@RequestBody List<Project> list){
|
|
|
+ public R update(@RequestBody List<Project> list) {
|
|
|
boolean b = projectService.updateBatchById(list);
|
|
|
- if (b){
|
|
|
+ if (b) {
|
|
|
return R.ok().data(b);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return R.error().data("更新失败!");
|
|
|
}
|
|
|
}
|