|
@@ -12,6 +12,7 @@ import com.gyee.backconfig.vo.Windpowerstationvo;
|
|
|
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;
|
|
|
|
|
@@ -34,7 +35,6 @@ public class WindpowerstationController {
|
|
|
private IWindpowerstationService windpowerstationService;
|
|
|
|
|
|
|
|
|
-
|
|
|
@GetMapping("/listByPage")
|
|
|
@ResponseBody
|
|
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
|
@@ -121,9 +121,9 @@ public class WindpowerstationController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 查询
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @param name
|
|
|
* @param pageNum
|
|
@@ -131,34 +131,34 @@ public class WindpowerstationController {
|
|
|
* @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 = "companyid",required = false) String companyid,
|
|
|
- @RequestParam(value = "pageNum",required = true) String pageNum,
|
|
|
- @RequestParam(value = "pageSize",required = true) String pageSize){
|
|
|
- IPage<Windpowerstation> list = windpowerstationService.getList(id,name,code,companyid,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 = "companyid", required = false) String companyid,
|
|
|
+ @RequestParam(value = "pageNum", required = true) String pageNum,
|
|
|
+ @RequestParam(value = "pageSize", required = true) String pageSize) {
|
|
|
+ IPage<Windpowerstation> list = windpowerstationService.getList(id, name, code, companyid, 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) {
|
|
|
|
|
|
Windpowerstation windpowerstation = windpowerstationService.getOne(id);
|
|
|
- if (StringUtils.isNotNull(windpowerstation)){
|
|
|
+ if (StringUtils.isNotNull(windpowerstation)) {
|
|
|
return R.ok().data(windpowerstation);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return R.error().data("查询失败!");
|
|
|
}
|
|
|
|
|
@@ -167,49 +167,51 @@ public class WindpowerstationController {
|
|
|
|
|
|
/**
|
|
|
* 插入(批量)
|
|
|
+ *
|
|
|
* @param windpowerstation
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping(value = "/add")
|
|
|
- public R addAll(@RequestBody Windpowerstation windpowerstation){
|
|
|
+ public R addAll(@RequestBody Windpowerstation windpowerstation) {
|
|
|
|
|
|
boolean b = windpowerstationService.addOrUpdate(windpowerstation);
|
|
|
- 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 = windpowerstationService.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<Windpowerstation> list){
|
|
|
+ public R update(@RequestBody List<Windpowerstation> list) {
|
|
|
boolean b = windpowerstationService.updateBatchById(list);
|
|
|
- if (b){
|
|
|
+ if (b) {
|
|
|
return R.ok().data(b);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return R.error().data("更新失败!");
|
|
|
}
|
|
|
|
|
@@ -218,19 +220,20 @@ public class WindpowerstationController {
|
|
|
|
|
|
/**
|
|
|
* 查询
|
|
|
+ *
|
|
|
* @param regionid
|
|
|
* @param companyid
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping(value = "/getList")
|
|
|
public R getList(
|
|
|
- @RequestParam(value = "regionid",required = false) String regionid,
|
|
|
- @RequestParam(value = "companyid",required = false) String companyid){
|
|
|
+ @RequestParam(value = "regionid", required = false) String regionid,
|
|
|
+ @RequestParam(value = "companyid", required = false) String companyid) {
|
|
|
try {
|
|
|
- List<WindpowerstationAdmVo> list = windpowerstationService.getList(regionid,companyid);
|
|
|
- if (null != list){
|
|
|
+ List<WindpowerstationAdmVo> list = windpowerstationService.getList(regionid, companyid);
|
|
|
+ if (null != list) {
|
|
|
return R.ok().data(list);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return R.error().data("查询失败!");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -240,5 +243,4 @@ public class WindpowerstationController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|