xieshengjie 2 vuotta sitten
vanhempi
commit
eb5871c160

+ 65 - 0
common/src/main/java/com/gyee/common/model/Evaluationdatasource.java

@@ -0,0 +1,65 @@
+package com.gyee.common.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("EVALUATIONDATASOURCE")
+public class Evaluationdatasource extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "TARGETID",type = IdType.INPUT)
+    private String targetid;
+
+    @TableField("TARGETNAME")
+    private String targetname;
+
+    @TableField("DATASOURCETABLE")
+    private String datasourcetable;
+
+    @TableField("DATASOURCEFIELD")
+    private String datasourcefield;
+
+    @TableField("STATISTICALMETHOD")
+    private String statisticalmethod;
+
+    @TableField("CONDITION")
+    private String condition;
+
+    @TableField("SORT")
+    private String sort;
+
+    @TableField("GROUPBYFIELDS")
+    private String groupbyfields;
+
+    @TableField("CYCLE")
+    private String cycle;
+
+    @TableField("FIELDTYPE")
+    private BigDecimal fieldtype;
+
+    @TableField("TYPE")
+    private String type;
+
+    @TableField("GENERALFORMULA")
+    private String generalformula;
+
+
+}

+ 35 - 0
web/consumer/src/main/java/com/gyee/consumer/api/knowleage/KnowledgeApi.java

@@ -206,4 +206,39 @@ public interface KnowledgeApi {
                            @RequestParam(value = "pageNum",required = true) String pageNum,
                            @RequestParam(value = "pageSize",required = true) String pageSize
     );
+
+
+    /**
+     * 等级评估配置
+     * @param type
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/rating")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R rating(@RequestParam(value = "type",required = true) String type,
+                    @RequestParam(value = "pageNum",required = true) String pageNum,
+                    @RequestParam(value = "pageSize",required = true) String pageSize
+    );
+
+
+    /**
+     * 等级评估编辑
+     * @return
+     */
+    @PostMapping("/ratingedit")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R ratingedit(@RequestBody Evaluationdatasource evaluationdatasource);
+
+    /**
+     * 等级评估删除
+     * @return
+     */
+    @DeleteMapping("/ratingremove")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R ratingremove(@RequestBody Evaluationdatasource evaluationdatasource);
 }

+ 40 - 0
web/consumer/src/main/java/com/gyee/consumer/controller/knowleage/KnowleageController.java

@@ -287,4 +287,44 @@ public class KnowleageController {
 
 
     }
+
+    /**
+     * 等级评估配置
+     * @param type
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/rating")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R rating(@RequestParam(value = "type",required = true) String type,
+                    @RequestParam(value = "pageNum",required = true) String pageNum,
+                    @RequestParam(value = "pageSize",required = true) String pageSize
+    ){
+        return knowledgeApi.rating(type,pageNum,pageSize);
+    }
+
+
+    /**
+     * 等级评估编辑
+     * @return
+     */
+    @PostMapping("/ratingedit")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R ratingedit(@RequestBody Evaluationdatasource evaluationdatasource){
+        return knowledgeApi.ratingedit(evaluationdatasource);
+    }
+
+    /**
+     * 等级评估删除
+     * @return
+     */
+    @DeleteMapping("/ratingremove")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R ratingremove(@RequestBody Evaluationdatasource evaluationdatasource){
+        return knowledgeApi.ratingremove(evaluationdatasource);
+    }
 }

+ 58 - 0
web/knowledge-hb/src/main/java/com/gyee/knowledge/controller/knowledge/KnowledgeController.java

@@ -448,5 +448,63 @@ public class KnowledgeController {
 
     }
 
+    /**
+     * 等级评估配置
+     * @param type
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/rating")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R rating(@RequestParam(value = "type",required = true) String type,
+                            @RequestParam(value = "pageNum",required = true) String pageNum,
+                            @RequestParam(value = "pageSize",required = true) String pageSize
+    )  {
+
+        List<Evaluationdatasource> resultlist = knowledgeService.rating(type,pageNum,pageSize);
+        if (StringUtils.isNotNull(resultlist)) {
+            return R.ok(resultlist.size()).data(resultlist);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+
+    /**
+     * 等级评估编辑
+     * @return
+     */
+    @PostMapping("/ratingedit")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R ratingedit(@RequestBody Evaluationdatasource evaluationdatasource)  {
+
+        Boolean result = knowledgeService.ratingedit(evaluationdatasource);
+        if (StringUtils.isNotNull(result)) {
+            return R.ok().data(result);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    /**
+     * 等级评估删除
+     * @return
+     */
+    @DeleteMapping("/ratingremove")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R ratingremove(@RequestBody Evaluationdatasource evaluationdatasource)  {
+
+        Boolean result = knowledgeService.ratingremove(evaluationdatasource);
+        if (StringUtils.isNotNull(result)) {
+            return R.ok().data(result);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
 
 }

+ 17 - 0
web/knowledge-hb/src/main/java/com/gyee/knowledge/mapper/auto/EvaluationdatasourceMapper.java

@@ -0,0 +1,17 @@
+package com.gyee.knowledge.mapper.auto;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.knowledge.model.auto.Evaluationdatasource;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-14
+ */
+public interface EvaluationdatasourceMapper extends BaseMapper<Evaluationdatasource> {
+
+}

+ 65 - 0
web/knowledge-hb/src/main/java/com/gyee/knowledge/model/auto/Evaluationdatasource.java

@@ -0,0 +1,65 @@
+package com.gyee.knowledge.model.auto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("EVALUATIONDATASOURCE")
+public class Evaluationdatasource extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "TARGETID",type = IdType.INPUT)
+    private String targetid;
+
+    @TableField("TARGETNAME")
+    private String targetname;
+
+    @TableField("DATASOURCETABLE")
+    private String datasourcetable;
+
+    @TableField("DATASOURCEFIELD")
+    private String datasourcefield;
+
+    @TableField("STATISTICALMETHOD")
+    private String statisticalmethod;
+
+    @TableField("CONDITION")
+    private String condition;
+
+    @TableField("SORT")
+    private String sort;
+
+    @TableField("GROUPBYFIELDS")
+    private String groupbyfields;
+
+    @TableField("CYCLE")
+    private String cycle;
+
+    @TableField("FIELDTYPE")
+    private BigDecimal fieldtype;
+
+    @TableField("TYPE")
+    private String type;
+
+    @TableField("GENERALFORMULA")
+    private String generalformula;
+
+
+}

+ 17 - 0
web/knowledge-hb/src/main/java/com/gyee/knowledge/service/auto/IEvaluationdatasourceService.java

@@ -0,0 +1,17 @@
+package com.gyee.knowledge.service.auto;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.knowledge.model.auto.Evaluationdatasource;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-14
+ */
+public interface IEvaluationdatasourceService extends IService<Evaluationdatasource> {
+
+}

+ 21 - 0
web/knowledge-hb/src/main/java/com/gyee/knowledge/service/auto/impl/EvaluationdatasourceServiceImpl.java

@@ -0,0 +1,21 @@
+package com.gyee.knowledge.service.auto.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.knowledge.mapper.auto.EvaluationdatasourceMapper;
+import com.gyee.knowledge.model.auto.Evaluationdatasource;
+import com.gyee.knowledge.service.auto.IEvaluationdatasourceService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-14
+ */
+@Service
+public class EvaluationdatasourceServiceImpl extends ServiceImpl<EvaluationdatasourceMapper, Evaluationdatasource> implements IEvaluationdatasourceService {
+
+}

+ 23 - 0
web/knowledge-hb/src/main/java/com/gyee/knowledge/service/knowledge/KnowledgeService.java

@@ -30,6 +30,8 @@ public class KnowledgeService {
     private ISafeprecService iSafeprecService;
     @Resource
     private IRiskprecService iRiskprecService;
+    @Resource
+    private IEvaluationdatasourceService evaluationdatasourceService;
 
 
     public List<P3DeviceFault> faultKnowledge(String gzjb, String tjlx, String cxnr, String pageNum, String pageSize) {
@@ -204,4 +206,25 @@ public class KnowledgeService {
         List<Riskprec> list = p3DeviceFaultPage.getRecords();
         return list;
     }
+
+    public List<Evaluationdatasource> rating(String type, String pageNum, String pageSize) {
+        QueryWrapper<Evaluationdatasource> qw = new QueryWrapper<>();
+        if (StringUtils.isNotEmpty(type)){
+            qw.like("type",type);
+        }
+        Page<Evaluationdatasource> page = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
+        Page<Evaluationdatasource> p3DeviceFaultPage = evaluationdatasourceService.getBaseMapper().selectPage(page, qw);
+        List<Evaluationdatasource> list = p3DeviceFaultPage.getRecords();
+        return list;
+    }
+
+    public Boolean ratingedit(Evaluationdatasource evaluationdatasource) {
+        boolean b = evaluationdatasourceService.saveOrUpdate(evaluationdatasource);
+        return b;
+    }
+
+    public Boolean ratingremove(Evaluationdatasource evaluationdatasource) {
+        boolean b = ip3DeviceFaultService.removeById(evaluationdatasource.getTargetid());
+        return b;
+    }
 }