diff --git a/pom.xml b/pom.xml
index 5bc7ddc..64c2140 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,6 @@
${spring-boot.version}
com.ipsplm.CoscoShippingHeavyApplication
- true
diff --git a/src/main/java/com/ipsplm/controller/simulation/SimulationAnalysisController.java b/src/main/java/com/ipsplm/controller/simulation/SimulationAnalysisController.java
index b7a0394..2945181 100644
--- a/src/main/java/com/ipsplm/controller/simulation/SimulationAnalysisController.java
+++ b/src/main/java/com/ipsplm/controller/simulation/SimulationAnalysisController.java
@@ -6,7 +6,7 @@ import com.ipsplm.service.simulation.ISimulationAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
-import java.math.BigInteger;
+
/**
* @Description 仿真分析Controller层
@@ -31,57 +31,13 @@ public class SimulationAnalysisController {
}
/**
- * 获取不锈钢OEE
- * @return
- */
- @GetMapping("/get-oee-bxg")
- public ResponseDTO getOeeBxg(){
- return ResponseDTO.ok(simulationAnalysisService.getOeeBxg());
- }
-
- /**
- * 获取大径线OEE
- * @return
- */
- @GetMapping("/get-oee-dj")
- public ResponseDTO getOeeDj(){
- return ResponseDTO.ok(simulationAnalysisService.getOeeDj());
- }
-
- /**
- * 获取小二线OEE
- * @return
- */
- @GetMapping("/get-oee-xe")
- public ResponseDTO getOeeXe(){
- return ResponseDTO.ok(simulationAnalysisService.getOeeXe());
- }
-
- /**
- * 获取小一线OEE
- * @return
- */
- @GetMapping("/get-oee-xy")
- public ResponseDTO getOeeXy(){
- return ResponseDTO.ok(simulationAnalysisService.getOeeXy());
- }
-
- /**
- * 获取中二线OEE
- * @return
- */
- @GetMapping("/get-oee-ze")
- public ResponseDTO getOeeZe(){
- return ResponseDTO.ok(simulationAnalysisService.getOeeZe());
- }
-
- /**
- * 获取中一线OEE
+ * 获取OEE数据
+ * @param tableCode
* @return
*/
- @GetMapping("/get-oee-zy")
- public ResponseDTO getOeeZy(){
- return ResponseDTO.ok(simulationAnalysisService.getOeeZy());
+ @GetMapping("/get-oee")
+ public ResponseDTO getOee(@RequestParam String tableCode){
+ return ResponseDTO.ok(simulationAnalysisService.getOee(tableCode));
}
/**
diff --git a/src/main/java/com/ipsplm/dao/simulation/SimulationAnalysisMapper.java b/src/main/java/com/ipsplm/dao/simulation/SimulationAnalysisMapper.java
index a0347a5..12b7ee6 100644
--- a/src/main/java/com/ipsplm/dao/simulation/SimulationAnalysisMapper.java
+++ b/src/main/java/com/ipsplm/dao/simulation/SimulationAnalysisMapper.java
@@ -4,6 +4,7 @@ import com.ipsplm.entity.simulation.*;
import com.ipsplm.entity.simulation.vo.BufferVO;
import com.ipsplm.entity.simulation.vo.PlantEquipmentUtilizationVO;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -20,7 +21,7 @@ public interface SimulationAnalysisMapper {
* @param flag
* @return
*/
- PlantEquipmentUtilizationVO getPlantEquipmentUtilization(Long flag);
+ List getPlantEquipmentUtilization(Long flag);
/**
* 获取不锈钢OEE
@@ -77,7 +78,7 @@ public interface SimulationAnalysisMapper {
* @param bufferNameList
* @return
*/
- List getBufferNumBxg(List bufferNameList);
+ List getBufferNumBxg(@Param("bufferNameList") List bufferNameList);
/**
* 获取大径线缓存数量
diff --git a/src/main/java/com/ipsplm/entity/simulation/OeeBxg.java b/src/main/java/com/ipsplm/entity/simulation/OeeBxg.java
index 63f1a1f..b0268f9 100644
--- a/src/main/java/com/ipsplm/entity/simulation/OeeBxg.java
+++ b/src/main/java/com/ipsplm/entity/simulation/OeeBxg.java
@@ -3,6 +3,8 @@ package com.ipsplm.entity.simulation;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -36,81 +38,81 @@ public class OeeBxg implements Serializable {
/**
* 状态
*/
- private String status;
+ private Integer status;
/**
* 不锈钢流水线坡口
*/
- private String bxgPkL;
+ private Double bxgPkL;
/**
* 不锈钢流水线装配
*/
- private String bxgZpL;
+ private Double bxgZpL;
/**
* 不锈钢流水线焊接
*/
- private String bxgHjL;
+ private Double bxgHjL;
/**
* 不锈钢线弯管机
*/
- private String bxgWgj;
+ private Double bxgWgj;
/**
* 不锈钢线支管切断
*/
- private String bxgZgqd;
+ private Double bxgZgqd;
/**
* 不锈钢线小组立平台
*/
- private String bxgXzl;
+ private Double bxgXzl;
/**
* 不锈钢线弯头焊接
*/
- private String bxgWthj;
+ private Double bxgWthj;
/**
* 不锈钢线装配平台1
*/
- private String bxgZppt1;
+ private Double bxgZppt1;
/**
* 不锈钢线装配平台2
*/
- private String bxgZppt2;
+ private Double bxgZppt2;
/**
* 不锈钢线焊接工位1
*/
- private String bxgHjgw1;
+ private Double bxgHjgw1;
/**
* 不锈钢线焊接工位2
*/
- private String bxgHjgw2;
+ private Double bxgHjgw2;
/**
* 不锈钢线焊接工位3
*/
- private String bxgHjgw3;
+ private Double bxgHjgw3;
/**
* 不锈钢线一次完检
*/
- private String bxgYcwj;
+ private Double bxgYcwj;
/**
* 不锈钢线水试
*/
- private String bxgSs;
+ private Double bxgSs;
/**
* 探伤
*/
- private String ts;
+ private Double ts;
}
diff --git a/src/main/java/com/ipsplm/entity/simulation/OeeDj.java b/src/main/java/com/ipsplm/entity/simulation/OeeDj.java
index fa99641..ef7fd7a 100644
--- a/src/main/java/com/ipsplm/entity/simulation/OeeDj.java
+++ b/src/main/java/com/ipsplm/entity/simulation/OeeDj.java
@@ -36,96 +36,96 @@ public class OeeDj implements Serializable {
/**
* 状态
*/
- private String status;
+ private Integer status;
/**
* 大径线流水线激光切割
*/
- private String djJgqgL;
+ private Double djJgqgL;
/**
* 大径线流水线装配
*/
- private String djZpL;
+ private Double djZpL;
/**
* 大径线流水线焊接
*/
- private String djHjL;
+ private Double djHjL;
/**
* 大径线流水线短管焊接
*/
- private String djDghjL;
+ private Double djDghjL;
/**
* 大径线线小组立平台
*/
- private String djXzl;
+ private Double djXzl;
/**
* 大径线线弯头焊接机
*/
- private String djWthjj;
+ private Double djWthjj;
/**
* 大径线支管切断
*/
- private String djZgqd;
+ private Double djZgqd;
/**
* 大径线装配平台1
*/
- private String djZppt1;
+ private Double djZppt1;
/**
* 大径线装配平台2
*/
- private String djZppt2;
+ private Double djZppt2;
/**
* 大径线装配平台3
*/
- private String djZppt3;
+ private Double djZppt3;
/**
* 大径线焊接工位1
*/
- private String djHjgw1;
+ private Double djHjgw1;
/**
* 大径线焊接工位2
*/
- private String djHjgw2;
+ private Double djHjgw2;
/**
* 大径线焊接工位3
*/
- private String djHjgw3;
+ private Double djHjgw3;
/**
* 大径线焊接工位4
*/
- private String djHjgw4;
+ private Double djHjgw4;
/**
* 大径线焊接工位5
*/
- private String djHjgw5;
+ private Double djHjgw5;
/**
* 大径线焊接工位6
*/
- private String djHjgw6;
+ private Double djHjgw6;
/**
* 大径线一次完检
*/
- private String djYcwj;
+ private Double djYcwj;
/**
* 大径线水试
*/
- private String djSs;
+ private Double djSs;
}
diff --git a/src/main/java/com/ipsplm/entity/simulation/OeeXe.java b/src/main/java/com/ipsplm/entity/simulation/OeeXe.java
index d166858..14be277 100644
--- a/src/main/java/com/ipsplm/entity/simulation/OeeXe.java
+++ b/src/main/java/com/ipsplm/entity/simulation/OeeXe.java
@@ -36,101 +36,101 @@ public class OeeXe implements Serializable {
/**
* 状态
*/
- private String status;
+ private Integer status;
/**
* 小二线流水线坡口
*/
- private String xePkL;
+ private Double xePkL;
/**
* 小二线流水线装配
*/
- private String xeZpL;
+ private Double xeZpL;
/**
* 小二线流水线焊接
*/
- private String xeHjL;
+ private Double xeHjL;
/**
* 小二线弯管机1
*/
- private String xeWgj1;
+ private Double xeWgj1;
/**
* 小二线弯管机2
*/
- private String xeWgj2;
+ private Double xeWgj2;
/**
* 小二线支管切断
*/
- private String xeZgqd;
+ private Double xeZgqd;
/**
* 小二线装配平台1
*/
- private String xeZppt1;
+ private Double xeZppt1;
/**
* 小二线装配平台2
*/
- private String xeZppt2;
+ private Double xeZppt2;
/**
* 小二线装配平台3
*/
- private String xeZppt3;
+ private Double xeZppt3;
/**
* 小二线装配平台4
*/
- private String xeZppt4;
+ private Double xeZppt4;
/**
* 小二线装配平台5
*/
- private String xeZppt5;
+ private Double xeZppt5;
/**
* 小二线焊接工位1
*/
- private String xeHjgw1;
+ private Double xeHjgw1;
/**
* 小二线焊接工位2
*/
- private String xeHjgw2;
+ private Double xeHjgw2;
/**
* 小二线焊接工位3
*/
- private String xeHjgw3;
+ private Double xeHjgw3;
/**
* 小二线焊接工位4
*/
- private String xeHjgw4;
+ private Double xeHjgw4;
/**
* 小二线焊接工位5
*/
- private String xeHjgw5;
+ private Double xeHjgw5;
/**
* 小二线一次完检
*/
- private String xeYcwj;
+ private Double xeYcwj;
/**
* 小二线水试
*/
- private String xeSs;
+ private Double xeSs;
/**
* 机加工
*/
- private String jjg;
+ private Double jjg;
}
diff --git a/src/main/java/com/ipsplm/entity/simulation/OeeXy.java b/src/main/java/com/ipsplm/entity/simulation/OeeXy.java
index 83988c7..b45315d 100644
--- a/src/main/java/com/ipsplm/entity/simulation/OeeXy.java
+++ b/src/main/java/com/ipsplm/entity/simulation/OeeXy.java
@@ -36,86 +36,86 @@ public class OeeXy implements Serializable {
/**
* 状态
*/
- private String status;
+ private Integer status;
/**
* 小一线流水线坡口
*/
- private String xyPkL;
+ private Double xyPkL;
/**
* 小一线流水线装配1
*/
- private String xyZp1L;
+ private Double xyZp1L;
/**
* 小一线流水线焊接1
*/
- private String xyHj1L;
+ private Double xyHj1L;
/**
* 小一线流水线焊接2
*/
- private String xyHj2L;
+ private Double xyHj2L;
/**
* 小一线弯管机
*/
- private String xyWgj;
+ private Double xyWgj;
/**
* 小一线支管切断
*/
- private String xyZgqd;
+ private Double xyZgqd;
/**
* 小一线装配平台1
*/
- private String xyZppt1;
+ private Double xyZppt1;
/**
* 小一线装配平台2
*/
- private String xyZppt2;
+ private Double xyZppt2;
/**
* 小一线装配平台3
*/
- private String xyZppt3;
+ private Double xyZppt3;
/**
* 小一线装配平台4
*/
- private String xyZppt4;
+ private Double xyZppt4;
/**
* 小一线焊接工位1
*/
- private String xyHjgw1;
+ private Double xyHjgw1;
/**
* 小一线焊接工位2
*/
- private String xyHjgw2;
+ private Double xyHjgw2;
/**
* 小一线焊接工位3
*/
- private String xyHjgw3;
+ private Double xyHjgw3;
/**
* 小一线焊接工位4
*/
- private String xyHjgw4;
+ private Double xyHjgw4;
/**
* 小一线一次完检
*/
- private String xyYcwj;
+ private Double xyYcwj;
/**
* 小一线水试
*/
- private String xySs;
+ private Double xySs;
}
diff --git a/src/main/java/com/ipsplm/entity/simulation/OeeZe.java b/src/main/java/com/ipsplm/entity/simulation/OeeZe.java
index 83116b9..d1d1b62 100644
--- a/src/main/java/com/ipsplm/entity/simulation/OeeZe.java
+++ b/src/main/java/com/ipsplm/entity/simulation/OeeZe.java
@@ -36,121 +36,121 @@ public class OeeZe implements Serializable {
/**
* 状态
*/
- private String status;
+ private Integer status;
/**
* 中二线流水线激光切割
*/
- private String zeJgqgL;
+ private Double zeJgqgL;
/**
* 中二线流水线装配
*/
- private String zeZpL;
+ private Double zeZpL;
/**
* 中二线流水线焊接
*/
- private String zeHjL;
+ private Double zeHjL;
/**
* 中二线流水线短管焊接
*/
- private String zeDghjL;
+ private Double zeDghjL;
/**
* 中二线线弯管机
*/
- private String zeWgj;
+ private Double zeWgj;
/**
* 中二线支管切断
*/
- private String zeZgqd;
+ private Double zeZgqd;
/**
* 中二线小组立平台1
*/
- private String zeXzl1;
+ private Double zeXzl1;
/**
* 中二线小组立平台2
*/
- private String zeXzl2;
+ private Double zeXzl2;
/**
* 中二线弯头焊接机
*/
- private String zeWthjj;
+ private Double zeWthjj;
/**
* 中二线装配平台1
*/
- private String zeZppt1;
+ private Double zeZppt1;
/**
* 中二线装配平台2
*/
- private String zeZppt2;
+ private Double zeZppt2;
/**
* 中二线装配平台3
*/
- private String zeZppt3;
+ private Double zeZppt3;
/**
* 中二线装配平台4
*/
- private String zeZppt4;
+ private Double zeZppt4;
/**
* 中二线焊接工位1
*/
- private String zeHjgw1;
+ private Double zeHjgw1;
/**
* 中二线焊接工位2
*/
- private String zeHjgw2;
+ private Double zeHjgw2;
/**
* 中二线焊接工位3
*/
- private String zeHjgw3;
+ private Double zeHjgw3;
/**
* 中二线焊接工位4
*/
- private String zeHjgw4;
+ private Double zeHjgw4;
/**
* 中二线焊接工位5
*/
- private String zeHjgw5;
+ private Double zeHjgw5;
/**
* 中二线焊接工位6
*/
- private String zeHjgw6;
+ private Double zeHjgw6;
/**
* 中二线焊接工位7
*/
- private String zeHjgw7;
+ private Double zeHjgw7;
/**
* 中二线焊接工位8
*/
- private String zeHjgw8;
+ private Double zeHjgw8;
/**
* 中二线一次完检
*/
- private String zeYcwj;
+ private Double zeYcwj;
/**
* 中二线水试
*/
- private String zeSs;
+ private Double zeSs;
}
diff --git a/src/main/java/com/ipsplm/entity/simulation/OeeZy.java b/src/main/java/com/ipsplm/entity/simulation/OeeZy.java
index bfbb989..ba65da8 100644
--- a/src/main/java/com/ipsplm/entity/simulation/OeeZy.java
+++ b/src/main/java/com/ipsplm/entity/simulation/OeeZy.java
@@ -36,116 +36,116 @@ public class OeeZy implements Serializable {
/**
* 状态
*/
- private String status;
+ private Integer status;
/**
* 中一线流水线坡口
*/
- private String zyPkL;
+ private Double zyPkL;
/**
* 中一线流水线装配
*/
- private String zyZpL;
+ private Double zyZpL;
/**
* 中一线流水线焊接
*/
- private String zyHjL;
+ private Double zyHjL;
/**
* 中一线流水线短管焊接
*/
- private String zyDghjL;
+ private Double zyDghjL;
/**
* 中一线弯管机1
*/
- private String zyWgj1;
+ private Double zyWgj1;
/**
* 中一线弯管机2
*/
- private String zyWgj2;
+ private Double zyWgj2;
/**
* 中一线小组立平台
*/
- private String zyXzl;
+ private Double zyXzl;
/**
* 中一线弯头焊接机
*/
- private String zyWthjj;
+ private Double zyWthjj;
/**
* 中一线装配平台1
*/
- private String zyZppt1;
+ private Double zyZppt1;
/**
* 中一线装配平台2
*/
- private String zyZppt2;
+ private Double zyZppt2;
/**
* 中一线装配平台3
*/
- private String zyZppt3;
+ private Double zyZppt3;
/**
* 中一线装配平台4
*/
- private String zyZppt4;
+ private Double zyZppt4;
/**
* 中一线装配平台5
*/
- private String zyZppt5;
+ private Double zyZppt5;
/**
* 中一线焊接工位1
*/
- private String zyHjgw1;
+ private Double zyHjgw1;
/**
* 中一线焊接工位2
*/
- private String zyHjgw2;
+ private Double zyHjgw2;
/**
* 中一线焊接工位3
*/
- private String zyHjgw3;
+ private Double zyHjgw3;
/**
* 中一线焊接工位4
*/
- private String zyHjgw4;
+ private Double zyHjgw4;
/**
* 中一线焊接工位5
*/
- private String zyHjgw5;
+ private Double zyHjgw5;
/**
* 中一线焊接工位6
*/
- private String zyHjgw6;
+ private Double zyHjgw6;
/**
* 中一线焊接工位7
*/
- private String zyHjgw7;
+ private Double zyHjgw7;
/**
* 中一线一次完检
*/
- private String zyYcwj;
+ private Double zyYcwj;
/**
* 中一线水试
*/
- private String zySs;
+ private Double zySs;
}
diff --git a/src/main/java/com/ipsplm/entity/simulation/vo/OeeVO.java b/src/main/java/com/ipsplm/entity/simulation/vo/OeeVO.java
new file mode 100644
index 0000000..6fd6c7e
--- /dev/null
+++ b/src/main/java/com/ipsplm/entity/simulation/vo/OeeVO.java
@@ -0,0 +1,13 @@
+package com.ipsplm.entity.simulation.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+public class OeeVO implements Serializable {
+ private String name;
+
+ private Object value;
+
+ private Object status;
+}
diff --git a/src/main/java/com/ipsplm/entity/simulation/vo/PlantEquipmentUtilizationVO.java b/src/main/java/com/ipsplm/entity/simulation/vo/PlantEquipmentUtilizationVO.java
index e1fd1c3..aca919c 100644
--- a/src/main/java/com/ipsplm/entity/simulation/vo/PlantEquipmentUtilizationVO.java
+++ b/src/main/java/com/ipsplm/entity/simulation/vo/PlantEquipmentUtilizationVO.java
@@ -13,83 +13,87 @@ import java.io.Serializable;
public class PlantEquipmentUtilizationVO implements Serializable {
private static final long serialVersionUID = 1L;
+ /**
+ * 状态
+ */
+ private Integer status;
/**
* 不锈钢流水线装配
*/
- private String bxgZpL;
+ private Double bxgZpL;
/**
* 不锈钢流水线焊接
*/
- private String bxgHjL;
+ private Double bxgHjL;
/**
* 小一线流水线装配1
*/
- private String xyZp1L;
+ private Double xyZp1L;
/**
* 小一线流水线焊接1
*/
- private String xyHj1L;
+ private Double xyHj1L;
/**
* 小一线流水线焊接2
*/
- private String xyHj2L;
+ private Double xyHj2L;
/**
* 小二线流水线装配
*/
- private String xeZpL;
+ private Double xeZpL;
/**
* 小二线流水线焊接
*/
- private String xeHjL;
+ private Double xeHjL;
/**
* 中一线流水线装配
*/
- private String zyZpL;
+ private Double zyZpL;
/**
* 中一线流水线焊接
*/
- private String zyHjL;
+ private Double zyHjL;
/**
* 中一线流水线短管焊接
*/
- private String zyDghjL;
+ private Double zyDghjL;
/**
* 中二线流水线装配
*/
- private String zeZpL;
+ private Double zeZpL;
/**
* 中二线流水线焊接
*/
- private String zeHjL;
+ private Double zeHjL;
/**
* 中二线流水线短管焊接
*/
- private String zeDghjL;
+ private Double zeDghjL;
/**
* 大径线流水线装配
*/
- private String djZpL;
+ private Double djZpL;
/**
* 大径线流水线焊接
*/
- private String djHjL;
+ private Double djHjL;
/**
* 大径线流水线短管焊接
*/
- private String djDghjL;
+ private Double djDghjL;
}
diff --git a/src/main/java/com/ipsplm/service/simulation/ISimulationAnalysisService.java b/src/main/java/com/ipsplm/service/simulation/ISimulationAnalysisService.java
index 6544627..b81942a 100644
--- a/src/main/java/com/ipsplm/service/simulation/ISimulationAnalysisService.java
+++ b/src/main/java/com/ipsplm/service/simulation/ISimulationAnalysisService.java
@@ -1,6 +1,7 @@
package com.ipsplm.service.simulation;
import com.ipsplm.entity.simulation.*;
+import com.ipsplm.entity.simulation.vo.OeeVO;
import com.ipsplm.entity.simulation.vo.PlantEquipmentUtilizationVO;
import java.util.List;
@@ -14,46 +15,11 @@ import java.util.List;
public interface ISimulationAnalysisService {
/**
* 获取厂房设备利用率信息
+ *
* @param flag
* @return
*/
- PlantEquipmentUtilizationVO getPlantEquipmentUtilization(Long flag);
-
- /**
- * 获取不锈钢OEE
- * @return
- */
- List getOeeBxg();
-
- /**
- * 获取大径线OEE
- * @return
- */
- List getOeeDj();
-
- /**
- * 获取小二线OEE
- * @return
- */
- List getOeeXe();
-
- /**
- * 获取小一线OEE
- * @return
- */
- List getOeeXy();
-
- /**
- * 获取中二线OEE
- * @return
- */
- List getOeeZe();
-
- /**
- * 获取中一线OEE
- * @return
- */
- List getOeeZy();
+ List getPlantEquipmentUtilization(Long flag);
/**
* 获取工序列表
@@ -68,4 +34,11 @@ public interface ISimulationAnalysisService {
* @return
*/
Object getBufferNum(String process);
+
+ /**
+ * 获取OEE数据
+ * @param tableCode
+ * @return
+ */
+ Object getOee(String tableCode);
}
diff --git a/src/main/java/com/ipsplm/service/simulation/impl/SimulationAnalysisServiceImpl.java b/src/main/java/com/ipsplm/service/simulation/impl/SimulationAnalysisServiceImpl.java
index d5068d9..e69a749 100644
--- a/src/main/java/com/ipsplm/service/simulation/impl/SimulationAnalysisServiceImpl.java
+++ b/src/main/java/com/ipsplm/service/simulation/impl/SimulationAnalysisServiceImpl.java
@@ -1,16 +1,19 @@
package com.ipsplm.service.simulation.impl;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
import com.ipsplm.dao.simulation.SimulationAnalysisMapper;
import com.ipsplm.entity.simulation.*;
-import com.ipsplm.entity.simulation.vo.BufferNumVO;
import com.ipsplm.entity.simulation.vo.BufferVO;
+import com.ipsplm.entity.simulation.vo.OeeVO;
import com.ipsplm.entity.simulation.vo.PlantEquipmentUtilizationVO;
import com.ipsplm.service.simulation.ISimulationAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import java.util.Collections;
+import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
/**
* @Description 仿真分析实现类
@@ -30,68 +33,10 @@ public class SimulationAnalysisServiceImpl implements ISimulationAnalysisService
* @return
*/
@Override
- public PlantEquipmentUtilizationVO getPlantEquipmentUtilization(Long flag) {
- return simulationAnalysisMapper.getPlantEquipmentUtilization(flag);
- }
-
- /**
- * 获取不锈钢OEE
- *
- * @return
- */
- @Override
- public List getOeeBxg() {
- return simulationAnalysisMapper.getOeeBxg();
- }
-
- /**
- * 获取大径线OEE
- *
- * @return
- */
- @Override
- public List getOeeDj() {
- return simulationAnalysisMapper.getOeeDj();
- }
-
- /**
- * 获取小二线OEE
- *
- * @return
- */
- @Override
- public List getOeeXe() {
- return simulationAnalysisMapper.getOeeXe();
- }
-
- /**
- * 获取小一线OEE
- *
- * @return
- */
- @Override
- public List getOeeXy() {
- return simulationAnalysisMapper.getOeeXy();
- }
-
- /**
- * 获取中二线OEE
- *
- * @return
- */
- @Override
- public List getOeeZe() {
- return simulationAnalysisMapper.getOeeZe();
- }
-
- /**
- * 获取中一线OEE
- *
- * @return
- */
- @Override
- public List getOeeZy() {
- return simulationAnalysisMapper.getOeeZy();
+ public List getPlantEquipmentUtilization(Long flag) {
+ List plantEquipmentUtilization = simulationAnalysisMapper.getPlantEquipmentUtilization(flag);
+ List oeeVOList = beanToKeyValue(plantEquipmentUtilization);
+ return oeeVOList;
}
/**
@@ -107,6 +52,7 @@ public class SimulationAnalysisServiceImpl implements ISimulationAnalysisService
/**
* 获取缓存数量时间
+ *
* @param process
* @return
*/
@@ -144,4 +90,75 @@ public class SimulationAnalysisServiceImpl implements ISimulationAnalysisService
}
return null;
}
+
+ /**
+ * 获取OEE数据
+ *
+ * @param tableCode
+ * @return
+ */
+ @Override
+ public Object getOee(String tableCode) {
+ switch (tableCode) {
+ case "oee_bxg": {
+ List oeeBxgList = simulationAnalysisMapper.getOeeBxg();
+ List oeeVOList = beanToKeyValue(oeeBxgList);
+ return oeeVOList;
+ }
+ case "oee_dj": {
+ List oeeDjList = simulationAnalysisMapper.getOeeDj();
+ List oeeVOList = beanToKeyValue(oeeDjList);
+ return oeeVOList;
+ }
+ case "oee_xe": {
+ List oeeXeList = simulationAnalysisMapper.getOeeXe();
+ List oeeVOList = beanToKeyValue(oeeXeList);
+ return oeeVOList;
+ }
+ case "oee_xy": {
+ List oeeXyList = simulationAnalysisMapper.getOeeXy();
+ List oeeVOList = beanToKeyValue(oeeXyList);
+ return oeeVOList;
+ }
+ case "oee_ze": {
+ List oeeZeList = simulationAnalysisMapper.getOeeZe();
+ List oeeVOList = beanToKeyValue(oeeZeList);
+ return oeeVOList;
+ }
+ case "oee_zy": {
+ List oeeZyList = simulationAnalysisMapper.getOeeZy();
+ List oeeVOList = beanToKeyValue(oeeZyList);
+ return oeeVOList;
+ }
+ default:
+ break;
+ }
+ return null;
+ }
+
+ /**
+ * 获取对象的属性名和属性值并存入OeeVO对象的集合
+ * @param oeeList
+ * @return
+ */
+ public List beanToKeyValue(List oeeList) {
+ List oeeVOList = new ArrayList<>();
+ for (Object object : oeeList) {
+ JSONObject jsonObject = (JSONObject) JSON.toJSON(object);
+ Object status = jsonObject.get("status");
+ for (Map.Entry entry : jsonObject.entrySet()) {
+ OeeVO oeeVO = new OeeVO();
+ Object value = entry.getValue();
+ String key = entry.getKey();
+ if ("flag".equals(key) || "id".equals(key) || "status".equals(key)) {
+ continue;
+ }
+ oeeVO.setName(key);
+ oeeVO.setValue(value);
+ oeeVO.setStatus(status);
+ oeeVOList.add(oeeVO);
+ }
+ }
+ return oeeVOList;
+ }
}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 427643e..5b943b3 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -24,4 +24,8 @@ spring:
plant:
socket:
ip:
- port:
\ No newline at end of file
+ port:
+
+mybatis-plus:
+ configuration:
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
diff --git a/src/main/resources/mapper/simulation/SimulationAnalysisMapper.xml b/src/main/resources/mapper/simulation/SimulationAnalysisMapper.xml
index 6c6b099..0fda5f8 100644
--- a/src/main/resources/mapper/simulation/SimulationAnalysisMapper.xml
+++ b/src/main/resources/mapper/simulation/SimulationAnalysisMapper.xml
@@ -6,7 +6,10 @@