瀏覽代碼

故障录入

wangb@gyee-china.com 1 年之前
父節點
當前提交
1cacf312a5

+ 93 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/ProEconFaultFaultController.java

@@ -0,0 +1,93 @@
+package com.gyee.runeconomy.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.common.config.R;
+import com.gyee.runeconomy.model.auto.ProEconFaultFault;
+import com.gyee.runeconomy.service.auto.IProEconFaultFaultService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.Date;
+
+/**
+ * <p>
+ *  故障录入表 前端控制器
+ * </p>
+ *
+ * @author wang
+ * @since 2023-07-05
+ */
+@RestController
+@RequestMapping("//pro-econ-fault-fault")
+public class ProEconFaultFaultController {
+
+    @Resource
+    private IProEconFaultFaultService proEconFaultFaultService;
+    /**
+     * 查询
+     * @param windpowerstationId
+     * @param windpowerstationName
+     * @param begindate
+     * @param planEnddate
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping(value = "/list")
+    @ApiOperation(value = "清洗录入-列表", notes = "清洗录入-列表")
+    public R findList(@RequestParam(value = "windpowerstationId", required = false) String windpowerstationId,
+                      @RequestParam(value = "windpowerstationName", required = false) String windpowerstationName,
+                      @RequestParam(value = "begindate", required = false) Date begindate,
+                      @RequestParam(value = "planEnddate", required = false) Date planEnddate,
+                      @RequestParam(value = "pageNum", required = true) String pageNum,
+                      @RequestParam(value = "pageSize", required = true) String pageSize) {
+        IPage<ProEconFaultFault> list = proEconFaultFaultService.getList(windpowerstationId, windpowerstationName, begindate, planEnddate, pageNum, pageSize);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+
+    /**
+     *
+     * @param ProEconFaultFault
+     * @return
+     */
+    @PostMapping(value = "/add")
+    @ApiOperation(value = "清洗录入-新增or修改", notes = "清洗录入-新增or修改")
+    public R addAll(@RequestBody ProEconFaultFault ProEconFaultFault) {
+
+        boolean b = proEconFaultFaultService.saveOrUpdate(ProEconFaultFault);
+        if (b) {
+//            CacheContext.initPowerstationList();
+            return R.ok().data(b);
+        } else {
+            return R.error().data("保存失败!");
+        }
+
+    }
+
+    /**
+     * 删除
+     * @param ids
+     * @return
+     */
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "清洗录入-删除", notes = "清洗录入-删除")
+    public R deleteAll(@PathVariable("ids") String ids) {
+        String[] strings = ids.split(",");
+        boolean b = proEconFaultFaultService.removeByIds(Arrays.asList(strings));
+        if (b) {
+//            CacheContext.initPowerstationList();
+            return R.ok().data(b);
+        } else {
+            return R.error().data("删除失败!");
+        }
+    }
+
+}
+

+ 16 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/mapper/auto/ProEconFaultFaultMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.runeconomy.mapper.auto;
+
+import com.gyee.runeconomy.model.auto.ProEconFaultFault;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author wang
+ * @since 2023-07-05
+ */
+public interface ProEconFaultFaultMapper extends BaseMapper<ProEconFaultFault> {
+
+}

+ 80 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/model/auto/ProEconFaultFault.java

@@ -0,0 +1,80 @@
+package com.gyee.runeconomy.model.auto;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 故障录入表
+ * </p>
+ *
+ * @author wang
+ * @since 2023-07-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProEconFaultFault extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 场站编号
+     */
+    @TableId(value = "windpowerstation_id")
+    private String windpowerstationId;
+
+    /**
+     * 场站名称
+     */
+    private String windpowerstationName;
+
+    /**
+     * 设备编号
+     */
+    private String equipmentId;
+
+    /**
+     * 设备名称
+     */
+    private String equipmentName;
+
+    /**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date begindate;
+
+    /**
+     * 计划结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date planEnddate;
+
+    /**
+     * 实际结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date actualEnddate;
+
+    /**
+     * 故障描述
+     */
+    private String faultDescription;
+
+    /**
+     * 处理过程
+     */
+    private String processingProcess;
+
+    /**
+     * 备注
+     */
+    private String spare1;
+
+
+}

+ 20 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/auto/IProEconFaultFaultService.java

@@ -0,0 +1,20 @@
+package com.gyee.runeconomy.service.auto;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.runeconomy.model.auto.ProEconFaultFault;
+
+import java.util.Date;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author wang
+ * @since 2023-07-05
+ */
+public interface IProEconFaultFaultService extends IService<ProEconFaultFault> {
+    IPage<ProEconFaultFault> getList(String windpowerstationId, String windpowerstationName, Date begindate, Date planEnddate, String pageNum, String pageSize);
+
+}

+ 51 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconFaultFaultServiceImpl.java

@@ -0,0 +1,51 @@
+package com.gyee.runeconomy.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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.common.model.StringUtils;
+import com.gyee.runeconomy.mapper.auto.ProEconFaultFaultMapper;
+import com.gyee.runeconomy.model.auto.ProEconFaultFault;
+import com.gyee.runeconomy.service.auto.IProEconFaultFaultService;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author wang
+ * @since 2023-07-05
+ */
+@Service
+public class ProEconFaultFaultServiceImpl extends ServiceImpl<ProEconFaultFaultMapper, ProEconFaultFault> implements IProEconFaultFaultService {
+
+    @Override
+    public IPage<ProEconFaultFault> getList(String windpowerstationId, String windpowerstationName, Date begindate, Date planEnddate, String pageNum, String pageSize) {
+        QueryWrapper<ProEconFaultFault> qw = new QueryWrapper<>();
+
+        if (StringUtils.isNotEmpty(windpowerstationId)){
+            qw.eq("windpowerstation_id",windpowerstationId);
+        }
+
+        if (StringUtils.isNotEmpty(windpowerstationName)){
+            qw.like("windpowerstation_name",windpowerstationName);
+        }
+
+        if (begindate != null){
+            qw.like("begindate",begindate);
+        }
+
+        if (planEnddate != null){
+            qw.eq("plan_enddate",planEnddate);
+        }
+
+        Page<ProEconFaultFault> page = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
+        IPage<ProEconFaultFault> InputPage = getBaseMapper().selectPage(page, qw);
+//        List<Windpowerstation> list = companysPage.getRecords();
+        return InputPage;
+    }
+}