소스 검색

清洗录入

wangb@gyee-china.com 1 년 전
부모
커밋
c1b5236d56

+ 94 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/ProEconCleaningInputController.java

@@ -0,0 +1,94 @@
+package com.gyee.runeconomy.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.common.config.R;
+import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.auto.ProEconCleaningInput;
+import com.gyee.runeconomy.service.auto.IProEconCleaningInputService;
+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-cleaning-input")
+public class ProEconCleaningInputController {
+
+    @Resource
+    private IProEconCleaningInputService proEconCleaningInputService;
+
+    /**
+     * 查询
+     * @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<ProEconCleaningInput> list = proEconCleaningInputService.getList(windpowerstationId, windpowerstationName, begindate, planEnddate, pageNum, pageSize);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+
+    /**
+     *
+     * @param ProEconCleaningInput
+     * @return
+     */
+    @PostMapping(value = "/add")
+    @ApiOperation(value = "清洗录入-新增or修改", notes = "清洗录入-新增or修改")
+    public R addAll(@RequestBody ProEconCleaningInput ProEconCleaningInput) {
+
+        boolean b = proEconCleaningInputService.saveOrUpdate(ProEconCleaningInput);
+        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 = proEconCleaningInputService.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/ProEconCleaningInputMapper.java

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

+ 80 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/model/auto/ProEconCleaningInput.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 ProEconCleaningInput extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 场站编号
+     */
+    @TableId(value = "windpowerstation_id")
+    private String windpowerstationId;
+
+    /**
+     * 场站名称
+     */
+    private String windpowerstationName;
+
+    /**
+     * 阵区编号
+     */
+    private String squareId;
+
+    /**
+     * 阵区名称
+     */
+    private String squareName;
+
+    /**
+     * 开始时间
+     */
+    @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 toolMaterials;
+
+    /**
+     * 清洗步骤
+     */
+    private String cleaningSteps;
+
+    /**
+     * 备注
+     */
+    private String spare1;
+
+
+}

+ 21 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/auto/IProEconCleaningInputService.java

@@ -0,0 +1,21 @@
+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.ProEconCleaningInput;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 清洗录入表 服务类
+ * </p>
+ *
+ * @author wang
+ * @since 2023-07-05
+ */
+public interface IProEconCleaningInputService extends IService<ProEconCleaningInput> {
+
+    IPage<ProEconCleaningInput> 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/ProEconCleaningInputServiceImpl.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.ProEconCleaningInputMapper;
+import com.gyee.runeconomy.model.auto.ProEconCleaningInput;
+import com.gyee.runeconomy.service.auto.IProEconCleaningInputService;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 清洗录入表 服务实现类
+ * </p>
+ *
+ * @author wang
+ * @since 2023-07-05
+ */
+@Service
+public class ProEconCleaningInputServiceImpl extends ServiceImpl<ProEconCleaningInputMapper, ProEconCleaningInput> implements IProEconCleaningInputService {
+
+    @Override
+    public IPage<ProEconCleaningInput> getList(String windpowerstationId, String windpowerstationName, Date begindate, Date planEnddate, String pageNum, String pageSize) {
+        QueryWrapper<ProEconCleaningInput> 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<ProEconCleaningInput> page = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
+        IPage<ProEconCleaningInput> InputPage = getBaseMapper().selectPage(page, qw);
+//        List<Windpowerstation> list = companysPage.getRecords();
+        return InputPage;
+    }
+}