From 9d2373cb9c0bac32aad9f9dd52e6362101ddaa22 Mon Sep 17 00:00:00 2001 From: wenjy Date: Thu, 9 Jun 2022 13:33:52 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E7=AE=B1=E5=A3=B3=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=8F=AF=E8=A7=86=E5=8C=96=E7=9C=8B=E6=9D=BF=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TankShellDeviceController.java | 12 +++++++ .../TankShellDevicePrameterValue.java | 34 ++++++++++++++++++ .../TankShellDevicePrameterValueMapper.java | 13 +++++++ .../service/ITankShellDeviceInfoService.java | 8 +++++ .../impl/TankShellDeviceInfoServiceImpl.java | 19 ++++++++++ .../TankShellDeviceController.class | Bin 1782 -> 1935 bytes .../service/ITankShellDeviceInfoService.class | Bin 312 -> 346 bytes .../impl/TankShellDeviceInfoServiceImpl.class | Bin 7444 -> 8717 bytes 8 files changed, 86 insertions(+) create mode 100644 productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java create mode 100644 productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java diff --git a/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java b/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java index 7bf4250..4d9bb41 100644 --- a/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java +++ b/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java @@ -57,6 +57,18 @@ public class TankShellDeviceController { return iTankShellDeviceInfoService.getRunParameters(); } + /** + * 获取设备参数值 + * @author WenJY + * @date 2022-06-09 10:52 + * @return java.lang.String + */ + @GetMapping("/getDeviceParameterValue") + @ResponseBody + public String getDeviceParameterValue(){ + return iTankShellDeviceInfoService.getDeviceParameterValue(); + } + /** * 获取OEE统计数据 * @author WenJY diff --git a/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java new file mode 100644 index 0000000..99cac2b --- /dev/null +++ b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java @@ -0,0 +1,34 @@ +package com.productionboard.entity.TankShellDevice; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 设备参数信息 + * @author WenJY + * @date 2022年06月09日 10:37 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("SCADA_PRAMERTER_VALUE") +public class TankShellDevicePrameterValue implements Serializable { + + @TableField("deviceid") + private String deviceId; + + @TableField("prametername") + private String prameterName; + + @TableField("value") + private String prameterValue; + + @TableField("createtime") + private Date createTime; +} diff --git a/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java b/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java new file mode 100644 index 0000000..dd84cca --- /dev/null +++ b/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java @@ -0,0 +1,13 @@ +package com.productionboard.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.productionboard.entity.TankShellDevice.TankShellDevicePrameterValue; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author WenJY + * @date 2022年06月09日 10:40 + */ +@Mapper +public interface TankShellDevicePrameterValueMapper extends BaseMapper { +} diff --git a/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java b/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java index 64cd68e..d2e1a04 100644 --- a/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java +++ b/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java @@ -23,6 +23,14 @@ public interface ITankShellDeviceInfoService { */ public String getRunParameters(); + /** + * 获取设备参数值 + * @author WenJY + * @date 2022-06-09 10:41 + * @return java.lang.String + */ + public String getDeviceParameterValue(); + /** * 获取能耗产量对比JSON * @author WenJY diff --git a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java index abe5dce..8a2ccec 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java @@ -16,6 +16,7 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; /** * @author WenJY @@ -27,6 +28,9 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi @Autowired private TankShellDeviceDataInformationMapper tankShellDeviceDataInformationMapper; + @Autowired + private TankShellDevicePrameterValueMapper tankShellDevicePrameterValueMapper; + @Autowired private TankShellThisMonthEnergyMapper tankShellThisMonthEnergyMapper; @@ -87,6 +91,21 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi return JSONArray.toJSONString(result); } + @Override + public String getDeviceParameterValue() { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.MINUTE,-1); + QueryWrapper wrapper = new QueryWrapper(); + wrapper.eq("deviceId","XKCX001") + .between("createTime",calendar.getTime(),new Date()) + .and(x-> + x.like("prameterName","伺服").or().like("prameterName","伺服") + ); + List tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.selectList(wrapper); + return JSONArray.toJSONString(tankShellDevicePrameterValues); + } + @Override public String getEnergyConsumptionJson() { List tankShellEnergyConsumptions = tankShellEnergyConsumptionMapper.selectList(null); diff --git a/productionboard/target/classes/com/productionboard/controller/TankShellDeviceController.class b/productionboard/target/classes/com/productionboard/controller/TankShellDeviceController.class index e2c424cb7b39812bd3117618d27c5972955c838b..18b6ef0fa26507597f66ec95fe92ef54da6748fb 100644 GIT binary patch literal 1935 zcma)6>rWFw5T7lNLR+Pjr=SQvd9M!y3TT3W22({T;ftTP*QG49w{>p|@?UA9G5Wzj zz(2}3b5~1Su1Ryr-0eJmGryVH`}6nLZva?=7cqzf?}10X5QE1gp2XoPERlFdVwuDW ziPb2iqp-$cTpbAaG8v#L$snC^bcvUZ&Q~0(w42ky)Mo~%%!xP?yeQlP&sstv>xOcbeZin(dghQp=a$YRjlPU><-1BL zC(VJtS}0gMqIf8bqH|T*X^#~aw-!p;(XKVRSd@l0(cY?Auz)V*<|S4)I6V_q-%=>? zbD85g46Nt;TH3dwTn=cZ3es*1D`+^TvG$f_N7appZClG(?d49SV;QW3p|$ZVU@%NGZrt8rV54ZbvN~jfDg1fG@uwES z2YCX6>v-zMcb~7t2H-o2XKWG5K|H0=m*G1;`vcf)D)JpVzWUBXC}U^@4C;hod;mdx zR~Ug&JmKF8#?XUcIG)JXHTw-ZzTig$2!L_}I$Z{LRfGRmHjZ`%H)}vkRiGFGb^e4d z2F+-bb!f3Vv=rtX$LL!hfq5_iw|(Tv8uB*Uh)yCv?q-mgyTlHt&LiaoAAdOTt>Tk) z3L6o0v@z42Y9`zx^rB`oafn{!kZy~^y(%&;XE<`tRpgzvkRMc$apSAVP2K4Y>&^%4 h&VGyTOtBb5Qg79I6jU;;7||{#cw@8{6G-xj9O`BWvq;nXe2foTN3|(#r+XUG)4>U z{U=r?7M8|$?@o>w$tANlv$N04JG-~BuW0S<`}qYx73&%_ltL(n5ypZvl?WEGB+ark zE7DYhSPi1q*|<@xPvyOyfFTgSI=VRDKW(;Jm6PW6*>O`x3~?P1=t0zVtRbVLA=(YLK$#-z*OjY$SO++r;`X5A4S64)(zlASBqX16>4b-T%<(|y{V Wu}dkKC0xOr{TQU6dHQB|OvNAI&NOiV diff --git a/productionboard/target/classes/com/productionboard/service/ITankShellDeviceInfoService.class b/productionboard/target/classes/com/productionboard/service/ITankShellDeviceInfoService.class index 7851bc0619e4bfa57f9a6225748d2914701b00c5..eb287a7e56617ed8d6cdb19f8e746b27cc86127b 100644 GIT binary patch delta 77 zcmdnNbc;#g)W2Q(7#J8#7k%5DO1*ngaffGnFF>nC@WbhI% delta 44 zcmcb`w1Y|D)W2Q(7#J8#7j;GWTWXK_-(06G)iQERadeM52~J2xNf(nJfkaRH_Wg0D;M3GT_!a zP(VSYw0+RkR;#sQZLKtRB;eMKT5T(Kx4W&iwN+cYsninxJ2NEIG=Aor@80{)Irl%y z{qMOsRCAy)`ox*zj{vBab|)^u5rumUe8CAD?oC4nzG&b}dcM!Vm-T$V9*(;36^uCX z0KTda(~<{WIHo087*#m#LG@%WN1Vt>2p`qpk2x_7U!yFFuN(M=R(@0A zTTT?+ooj4yq z(!-DS@Dn}!RN-f7cm_W=@CzsA*3}puPUtg}-1# z;YBBw=*Ua)k^xJ9ylmi*fy3J9uP*!zBOVC;p+ozp6aT_Xdib}2R}H+T(O%cXX@&nN zyrJ-4K~W^wzpZmiC>(AKS*;Q)opX+0M{jqieJI!$iiC!`g5m9uGg|yl6#?d!@?qrX4BvhJ$?@dxAw%#8TuJESXDp zwYGU(*2%ODjvj;rd6qvVFDgh41S)!ZO!Q#P#0CTfw&rFN8}%yl8va$p4ZO|GHGO?G z!^0-J5j3$HmnwlNA~q!{rr0G_;NBYC5v&Xc`!`p1MuvL(H=B45E>q$#MTsGp9@lS= z^oA=NgOQLa>(j(3@Jxssg5gkqPjJW-mzb>YTLJ60_lA2yR8N!XrlgD8lnn8hk||k& zG_T)Z6aSf#jj&bdYAKW)nPJL#l51i;-m4^!XK2bynPp186bPEEU5;vNk;)+4Y=i~k zH^s}%&$h92Bq<5fSNwFy_3b&lksnU(lnc^3k zULf;Lti?Jd)q>ephcP=~%7r@ri{xSxm*Wa0?@m{;z>VAVmKswQ$|5DTrYx2^9@1cv znysY1!13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