wangb 2 anni fa
parent
commit
66be224ca9
14 ha cambiato i file con 415 aggiunte e 8 eliminazioni
  1. 0 3
      web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/config/CacheContext.java
  2. 2 2
      web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/SttreeControllel.java
  3. 31 2
      web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/service/auto/SttreeService.java
  4. 54 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/EquipmentmodelController.java
  5. 96 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/ManufacturerController.java
  6. 1 1
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/MeterpointController.java
  7. 16 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/mapper/auto/EquipmentmodelMapper.java
  8. 16 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/mapper/auto/ManufacturerMapper.java
  9. 49 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/model/auto/Equipmentmodel.java
  10. 32 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/model/auto/Manufacturer.java
  11. 18 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/IEquipmentmodelService.java
  12. 18 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/IManufacturerService.java
  13. 41 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/impl/EquipmentmodelServiceImpl.java
  14. 41 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/impl/ManufacturerServiceImpl.java

+ 0 - 3
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/config/CacheContext.java

@@ -3,12 +3,9 @@ package com.gyee.backconfig.config;
 
 import com.gyee.backconfig.model.auto.*;
 import com.gyee.backconfig.service.auto.*;
-import com.gyee.common.model.auto.Windturbine;
-import com.gyee.common.service.IWindturbineService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.stereotype.Component;
-
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.HashMap;

+ 2 - 2
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/SttreeControllel.java

@@ -28,8 +28,8 @@ public class SttreeControllel {
     @GetMapping(value = "/treels")
     @ResponseBody
     @CrossOrigin(origins = "*", maxAge = 3600)
-    public R wtls() {
-        List<ProBasicEnergyGroup> resultList = sttreeService.energytree();
+    public R wtls(String tag) {
+        List<ProBasicEnergyGroup> resultList = sttreeService.energytree(tag);
         if (StringUtils.isNotNull(resultList)) {
             return com.gyee.backconfig.config.R.ok((int) resultList.size()).data(resultList);
         } else {

+ 31 - 2
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/service/auto/SttreeService.java

@@ -11,7 +11,8 @@ import java.util.stream.Collectors;
 
 @Service
 public class SttreeService {
-    public List<ProBasicEnergyGroup>  energytree() {
+    public List<ProBasicEnergyGroup>  energytree(String tag) {
+
         List<ProBasicEnergyGroup> energyls = CacheContext.energy;//集团
         List<ProBasicRegion> regionsls = CacheContext.regions;//区域
         List<ProBasicCompany> cpls = CacheContext.cpls;//公司
@@ -19,31 +20,59 @@ public class SttreeService {
         List<ProBasicProject> prols = CacheContext.prols;//期次
         List<ProBasicLine> list = CacheContext.lines;//期次
 
-        if (energyls.get(0).getChildren().size() > 0) return energyls;
+//        if (energyls.get(0).getChildren().size() > 0) return energyls;
 
         //集团-区域
         energyls.forEach(regls -> {
             List<ProBasicRegion> collect = regionsls.stream().filter(r -> r.getGroupId().equals(regls.getId())).collect(Collectors.toList());
+            if (null != regls.getChildren()) {
+                regls.getChildren().clear();
+            }
+            collect.stream().forEach(c->{
+                c.getChildren().clear();
+            });
             regls.getChildren().addAll(collect);
         });
 
+        if("1".equals(tag)){
+            return energyls;
+        }
+
         //区域-公司
         regionsls.forEach(cp -> {
             List<ProBasicCompany> region = cpls.stream().filter(c -> null != c.getRegionId() && c.getRegionId().equals(cp.getId())).collect(Collectors.toList());
+            region.stream().forEach(r->{
+                r.getChildren().clear();
+            });
             cp.getChildren().addAll(region);
         });
+        if("2".equals(tag)){
+            return energyls;
+        }
 
         //公司-场站
         cpls.forEach(wp -> {
             List<ProBasicWindpowerstation> co = wpls.stream().filter(w -> null != w.getCompanyId() && w.getCompanyId().equals(wp.getId())).collect(Collectors.toList());
+            co.stream().forEach(c->{
+                c.getChildren().clear();
+            });
             wp.getChildren().addAll(co);
         });
+        if("3".equals(tag)){
+            return energyls;
+        }
 
         //场站-期次
         wpls.forEach(pl -> {
             List<ProBasicProject> cz = prols.stream().filter(p -> null != p.getWindpowerstationId() && p.getWindpowerstationId().equals(pl.getId())).collect(Collectors.toList());
+            cz.stream().forEach(c->{
+                c.getChildren().clear();
+            });
             pl.getChildren().addAll(cz);
         });
+        if("4".equals(tag)){
+            return energyls;
+        }
 
         //期次-线路
         prols.forEach(ll -> {

+ 54 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/EquipmentmodelController.java

@@ -0,0 +1,54 @@
+package com.gyee.backconfig.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.R;
+import com.gyee.backconfig.model.auto.Equipmentmodel;
+import com.gyee.backconfig.model.auto.Manufacturer;
+import com.gyee.backconfig.service.auto.IEquipmentmodelService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-19
+ */
+@RestController
+@RequestMapping("//equipmentmodel")
+public class EquipmentmodelController {
+    @Resource
+    private IEquipmentmodelService equipmentmodelService;
+
+    /**
+     * 查询
+     * @param id
+     * @param code
+     * @param name
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping(value = "/listByPage")
+    public R findList(@RequestParam(value = "id", required = false) String id,
+                      @RequestParam(value = "code", required = false) String code,
+                      @RequestParam(value = "name", required = false) String name,
+                      @RequestParam(value = "pageNum", required = true) String pageNum,
+                      @RequestParam(value = "pageSize", required = true) String pageSize) {
+        IPage<Equipmentmodel> list = equipmentmodelService.list(id, code, name, pageNum, pageSize);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+
+}

+ 96 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/ManufacturerController.java

@@ -0,0 +1,96 @@
+package com.gyee.backconfig.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.R;
+import com.gyee.backconfig.model.auto.Manufacturer;
+import com.gyee.backconfig.model.auto.Meterpoint;
+import com.gyee.backconfig.service.auto.IManufacturerService;
+import com.gyee.common.model.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+
+/**设备厂商
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-19
+ */
+@RestController
+@RequestMapping("//manufacturer")
+public class ManufacturerController {
+    @Resource
+    private IManufacturerService manufacturerService;
+
+    /**
+     * 查询
+     * @param id
+     * @param name
+     * @param country
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping(value = "/listByPage")
+    public R findList(@RequestParam(value = "id", required = false) String id,
+                      @RequestParam(value = "name", required = false) String name,
+                      @RequestParam(value = "country", required = false) String country,
+                      @RequestParam(value = "pageNum", required = true) String pageNum,
+                      @RequestParam(value = "pageSize", required = true) String pageSize) {
+        IPage<Manufacturer> list = manufacturerService.list(id, name, country, pageNum, pageSize);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+    @GetMapping(value = "/meterpoint/{id}")
+    public R findOne(@PathVariable("id") String id) {
+        QueryWrapper<Manufacturer> qw = new QueryWrapper<>();
+        qw.eq("id", id);
+        Manufacturer Square = manufacturerService.getOne(qw);
+        if (StringUtils.isNotNull(Square)) {
+            return R.ok().data(Square);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+
+    /**
+     * 批量插入
+     *
+     * @param manufacturer
+     * @return
+     */
+    @PostMapping(value = "/save")
+    public R addAll(@RequestBody Manufacturer manufacturer) {
+        boolean b = manufacturerService.saveOrUpdate(manufacturer);
+        if (b) {
+            return R.ok().data(b);
+        } else {
+            return R.error().data("保存失败!");
+        }
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @DeleteMapping(value = "/remove-manufacturer/{ids}")
+    public R deleteAll(@PathVariable("ids") String ids) {
+        String[] strings = ids.split(",");
+        boolean b = manufacturerService.removeByIds(Arrays.asList(strings));
+        if (b) {
+            return R.ok().data(b);
+        } else {
+            return R.error().data("删除失败!");
+        }
+    }
+}

+ 1 - 1
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/MeterpointController.java

@@ -91,7 +91,7 @@ public class MeterpointController {
      * @param ids
      * @return
      */
-    @DeleteMapping(value = "/remove-Squares/{ids}")
+    @DeleteMapping(value = "/remove-meterpoint/{ids}")
     public R deleteAll(@PathVariable("ids") String ids) {
         String[] strings = ids.split(",");
         boolean b = meterpointService.removeByIds(Arrays.asList(strings));

+ 16 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/mapper/auto/EquipmentmodelMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.backconfig.mapper.auto;
+
+import com.gyee.backconfig.model.auto.Equipmentmodel;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-19
+ */
+public interface EquipmentmodelMapper extends BaseMapper<Equipmentmodel> {
+
+}

+ 16 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/mapper/auto/ManufacturerMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.backconfig.mapper.auto;
+
+import com.gyee.backconfig.model.auto.Manufacturer;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-19
+ */
+public interface ManufacturerMapper extends BaseMapper<Manufacturer> {
+
+}

+ 49 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/model/auto/Equipmentmodel.java

@@ -0,0 +1,49 @@
+package com.gyee.backconfig.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Equipmentmodel extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String code;
+
+    private String name;
+
+    private String description;
+
+    private BigDecimal powerproduction;
+
+    private BigDecimal cutinwindspeed;
+
+    private BigDecimal ratedwindspeed;
+
+    private String cutoutwindspeed;
+
+    private String windturbinemanufacturerid;
+
+    private String photo;
+
+    private String unit;
+
+    private BigDecimal sweptarea;
+
+    private BigDecimal equipmentcategory;
+
+
+}

+ 32 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/model/auto/Manufacturer.java

@@ -0,0 +1,32 @@
+package com.gyee.backconfig.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Manufacturer extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String name;
+
+    private String country;
+
+    private String address;
+
+    private String telephone;
+
+
+}

+ 18 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/IEquipmentmodelService.java

@@ -0,0 +1,18 @@
+package com.gyee.backconfig.service.auto;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.model.auto.Equipmentmodel;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.backconfig.model.auto.Manufacturer;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-19
+ */
+public interface IEquipmentmodelService extends IService<Equipmentmodel> {
+    IPage<Equipmentmodel> list(String id, String code, String name, String pageNum, String pageSize);
+}

+ 18 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/IManufacturerService.java

@@ -0,0 +1,18 @@
+package com.gyee.backconfig.service.auto;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.model.auto.Manufacturer;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.backconfig.model.auto.Meterpoint;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-19
+ */
+public interface IManufacturerService extends IService<Manufacturer> {
+    IPage<Manufacturer> list(String id, String name, String country, String pageNum, String pageSize);
+}

+ 41 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/impl/EquipmentmodelServiceImpl.java

@@ -0,0 +1,41 @@
+package com.gyee.backconfig.service.auto.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.backconfig.model.auto.Equipmentmodel;
+import com.gyee.backconfig.mapper.auto.EquipmentmodelMapper;
+import com.gyee.backconfig.model.auto.Manufacturer;
+import com.gyee.backconfig.service.auto.IEquipmentmodelService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.common.model.StringUtils;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-19
+ */
+@Service
+public class EquipmentmodelServiceImpl extends ServiceImpl<EquipmentmodelMapper, Equipmentmodel> implements IEquipmentmodelService {
+
+    @Override
+    public IPage<Equipmentmodel> list(String id, String code, String name, String pageNum, String pageSize) {
+        QueryWrapper<Equipmentmodel> qw = new QueryWrapper<>();
+        if (StringUtils.isNotEmpty(id)) {
+            qw.like("id", id);
+        }
+        if (StringUtils.isNotEmpty(code)) {
+            qw.like("code", code);
+        }
+        if (StringUtils.isNotEmpty(name)) {
+            qw.like("name", name);
+        }
+        Page<Equipmentmodel> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+        IPage<Equipmentmodel> MeterPage =getBaseMapper().selectPage(page, qw);
+        return MeterPage;
+    }
+}

+ 41 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/impl/ManufacturerServiceImpl.java

@@ -0,0 +1,41 @@
+package com.gyee.backconfig.service.auto.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.backconfig.model.auto.Manufacturer;
+import com.gyee.backconfig.mapper.auto.ManufacturerMapper;
+import com.gyee.backconfig.model.auto.Meterpoint;
+import com.gyee.backconfig.service.auto.IManufacturerService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.common.model.StringUtils;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-19
+ */
+@Service
+public class ManufacturerServiceImpl extends ServiceImpl<ManufacturerMapper, Manufacturer> implements IManufacturerService {
+
+    @Override
+    public IPage<Manufacturer> list(String id, String name, String country, String pageNum, String pageSize) {
+        QueryWrapper<Manufacturer> qw = new QueryWrapper<>();
+        if (StringUtils.isNotEmpty(id)) {
+            qw.like("id", id);
+        }
+        if (StringUtils.isNotEmpty(name)) {
+            qw.like("name", name);
+        }
+        if (StringUtils.isNotEmpty(country)) {
+            qw.like("country", country);
+        }
+        Page<Manufacturer> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+        IPage<Manufacturer> MeterPage =getBaseMapper().selectPage(page, qw);
+        return MeterPage;
+    }
+}