浏览代码

可研电量配置方法添加

wangchangsheng 2 年之前
父节点
当前提交
62b67d8367

+ 91 - 0
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicProjectStudyController.java

@@ -0,0 +1,91 @@
+package com.gyee.backconfig.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.R;
+import com.gyee.backconfig.model.auto.ProBasicProjectStudy;
+import com.gyee.backconfig.service.auto.IProBasicProjectStudyService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+
+/**
+ * <p>
+ * 可研电量 前端控制器
+ * </p>
+ *
+ * @author wang
+ * @since 2022-11-29
+ */
+@RestController
+@RequestMapping("//pro-basic-project-study")
+@Api(value = "工程期次可研电量配置" ,tags =  "工程期次可研电量配置")
+public class ProBasicProjectStudyController {
+    @Resource
+    private IProBasicProjectStudyService proBasicProjectStudyService;
+
+    /**
+     * 查询
+     * @param id
+     * @param projectId
+     * @param windpowerstationId
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping(value = "/List")
+    @ApiOperation(value = "工程可研电量-列表", notes = "工程可研电量-列表")
+    public R findList(@RequestParam(value = "id", required = false) String id,
+                      @RequestParam(value = "projectId", required = false) String projectId,
+                      @RequestParam(value = "windpowerstationId", required = false) String windpowerstationId,
+                      @RequestParam(value = "year", required = false) String year,
+                      @RequestParam(value = "month", required = false) String month,
+                      @RequestParam(value = "pageNum", required = true) String pageNum,
+                      @RequestParam(value = "pageSize", required = true) String pageSize) {
+        IPage<ProBasicProjectStudy> list = proBasicProjectStudyService.List(id, projectId, windpowerstationId, year, month, pageNum, pageSize);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+
+    /**
+     * 新增
+     * @param proBasicProjectStudy
+     * @return
+     */
+    @PostMapping(value = "/add")
+    @ApiOperation(value = "工程可研电量-新增or修改", notes = "工程可研电量-新增or修改")
+    public R addAll(@RequestBody ProBasicProjectStudy proBasicProjectStudy){
+
+        boolean b = proBasicProjectStudyService.saveOrUpdate(proBasicProjectStudy);
+        if (b){
+            return R.ok().data(b);
+        }else {
+            return R.error().data("保存失败!");
+        }
+    }
+
+    /**
+     * 删除
+     * @param ids
+     * @return
+     */
+    @DeleteMapping(value = "/remove-project-study/{ids}")
+    @ApiOperation(value = "工程可研电量-删除", notes = "工程可研电量-删除")
+    public  R deleteAll(@PathVariable("ids") String ids) {
+        String[] strings = ids.split(",");
+
+        boolean  b = proBasicProjectStudyService.removeByIds(Arrays.asList(strings));
+
+        if (b) {
+            return R.ok().data(b);
+        } else {
+            return R.error().data("删除失败!");
+        }
+    }
+}

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

@@ -0,0 +1,16 @@
+package com.gyee.backconfig.mapper.auto;
+
+import com.gyee.backconfig.model.auto.ProBasicProjectStudy;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 可研电量 Mapper 接口
+ * </p>
+ *
+ * @author wang
+ * @since 2022-11-29
+ */
+public interface ProBasicProjectStudyMapper extends BaseMapper<ProBasicProjectStudy> {
+
+}

+ 47 - 0
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/model/auto/ProBasicProjectStudy.java

@@ -0,0 +1,47 @@
+package com.gyee.backconfig.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 可研电量
+ * </p>
+ *
+ * @author wang
+ * @since 2022-11-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value="ProBasicProjectStudy对象", description="可研电量")
+public class ProBasicProjectStudy extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "编号")
+    private String id;
+
+    @ApiModelProperty(value = "工程编号")
+    private String projectId;
+
+    @ApiModelProperty(value = "计划发电量")
+    private BigDecimal generatingCapacity;
+
+    @ApiModelProperty(value = "计划停运小时")
+    private BigDecimal outageHours;
+
+    @ApiModelProperty(value = "年")
+    private String year;
+
+    @ApiModelProperty(value = "月")
+    private String month;
+
+    @ApiModelProperty(value = "场站编号(冗余)")
+    private String windpowerstationId;
+
+
+}

+ 20 - 0
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/service/auto/IProBasicProjectStudyService.java

@@ -0,0 +1,20 @@
+package com.gyee.backconfig.service.auto;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.model.auto.ProBasicProjectStudy;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 可研电量 服务类
+ * </p>
+ *
+ * @author wang
+ * @since 2022-11-29
+ */
+public interface IProBasicProjectStudyService extends IService<ProBasicProjectStudy> {
+
+    IPage<ProBasicProjectStudy> List(String id, String projectId, String windpowerstationId, String  year, String month, String pageNum, String pageSize);
+
+
+}

+ 51 - 0
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/service/auto/impl/ProBasicProjectStudyServiceImpl.java

@@ -0,0 +1,51 @@
+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.ProBasicProjectStudy;
+import com.gyee.backconfig.mapper.auto.ProBasicProjectStudyMapper;
+import com.gyee.backconfig.service.auto.IProBasicProjectStudyService;
+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-11-29
+ */
+@Service
+public class ProBasicProjectStudyServiceImpl extends ServiceImpl<ProBasicProjectStudyMapper, ProBasicProjectStudy> implements IProBasicProjectStudyService {
+
+    @Override
+    public IPage<ProBasicProjectStudy> List(String id, String projectId, String windpowerstationId, String year, String month, String pageNum, String pageSize) {
+        QueryWrapper<ProBasicProjectStudy> qw = new QueryWrapper<>();
+
+        if (StringUtils.isNotEmpty(id)){
+            qw.eq("id",id);
+        }
+
+        if (StringUtils.isNotEmpty(projectId)){
+            qw.eq("project_id",projectId);
+        }
+
+        if (StringUtils.isNotEmpty(windpowerstationId)){
+            qw.eq("windpowerstation_id",windpowerstationId);
+        }
+
+        if (StringUtils.isNotEmpty(year)){
+            qw.eq("year",year);
+        }
+
+        if (StringUtils.isNotEmpty(month)){
+            qw.eq("month",month);
+        }
+        Page<ProBasicProjectStudy> page = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
+        IPage<ProBasicProjectStudy> list = getBaseMapper().selectPage(page, qw);
+        return list;
+    }
+}