正在显示
9 个修改的文件
包含
38 行增加
和
3 行删除
| @@ -123,6 +123,7 @@ public class IotThingsModelController extends BaseController | @@ -123,6 +123,7 @@ public class IotThingsModelController extends BaseController | ||
| 123 | { | 123 | { |
| 124 | return AjaxResult.error("请输入数模型"); | 124 | return AjaxResult.error("请输入数模型"); |
| 125 | } | 125 | } |
| 126 | + iotThingsModel.setSpecs(JSONObject.toJSONString(thingsModelItemBase)); | ||
| 126 | return toAjax(iotThingsModelService.insertIotThingsModel(iotThingsModel)); | 127 | return toAjax(iotThingsModelService.insertIotThingsModel(iotThingsModel)); |
| 127 | } | 128 | } |
| 128 | 129 |
| @@ -6,6 +6,7 @@ spring: | @@ -6,6 +6,7 @@ spring: | ||
| 6 | druid: | 6 | druid: |
| 7 | # 主库数据源 | 7 | # 主库数据源 |
| 8 | master: | 8 | master: |
| 9 | +# url: jdbc:mysql://114.215.126.2:3306/ju_he_liao_tiao?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | ||
| 9 | url: jdbc:mysql://rm-wz9740un21f09iokuao.mysql.rds.aliyuncs.com:3306/mqtt_broker?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | 10 | url: jdbc:mysql://rm-wz9740un21f09iokuao.mysql.rds.aliyuncs.com:3306/mqtt_broker?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| 10 | username: luhui | 11 | username: luhui |
| 11 | password: Luhui586 | 12 | password: Luhui586 |
| @@ -17,15 +17,20 @@ public class ArrayModelOutput extends ThingsModelItemBase<JSONArray> | @@ -17,15 +17,20 @@ public class ArrayModelOutput extends ThingsModelItemBase<JSONArray> | ||
| 17 | 17 | ||
| 18 | @Override | 18 | @Override |
| 19 | public String getView() { | 19 | public String getView() { |
| 20 | + | ||
| 20 | if(null != getValue()) | 21 | if(null != getValue()) |
| 21 | { | 22 | { |
| 22 | return JSONArray.toJSONString(getValue()); | 23 | return JSONArray.toJSONString(getValue()); |
| 23 | } | 24 | } |
| 24 | - return ""; | 25 | + return null; |
| 25 | } | 26 | } |
| 26 | 27 | ||
| 27 | @Override | 28 | @Override |
| 28 | public String getSaveView() { | 29 | public String getSaveView() { |
| 30 | + if(null == getValue()) | ||
| 31 | + { | ||
| 32 | + return null; | ||
| 33 | + } | ||
| 29 | return JSONArray.toJSONString(getValue()); | 34 | return JSONArray.toJSONString(getValue()); |
| 30 | } | 35 | } |
| 31 | } | 36 | } |
| @@ -16,6 +16,10 @@ public class BoolModelOutput extends ThingsModelItemBase<Boolean> | @@ -16,6 +16,10 @@ public class BoolModelOutput extends ThingsModelItemBase<Boolean> | ||
| 16 | 16 | ||
| 17 | @Override | 17 | @Override |
| 18 | public String getView() { | 18 | public String getView() { |
| 19 | + if(null == getValue()) | ||
| 20 | + { | ||
| 21 | + return null; | ||
| 22 | + } | ||
| 19 | if(getValue()) | 23 | if(getValue()) |
| 20 | { | 24 | { |
| 21 | return trueText; | 25 | return trueText; |
| @@ -27,6 +31,10 @@ public class BoolModelOutput extends ThingsModelItemBase<Boolean> | @@ -27,6 +31,10 @@ public class BoolModelOutput extends ThingsModelItemBase<Boolean> | ||
| 27 | 31 | ||
| 28 | @Override | 32 | @Override |
| 29 | public String getSaveView() { | 33 | public String getSaveView() { |
| 34 | + if(null == getValue()) | ||
| 35 | + { | ||
| 36 | + return null; | ||
| 37 | + } | ||
| 30 | return getValue().toString(); | 38 | return getValue().toString(); |
| 31 | } | 39 | } |
| 32 | } | 40 | } |
| @@ -20,11 +20,19 @@ public class DecimalModelOutput extends ThingsModelItemBase<BigDecimal> | @@ -20,11 +20,19 @@ public class DecimalModelOutput extends ThingsModelItemBase<BigDecimal> | ||
| 20 | 20 | ||
| 21 | @Override | 21 | @Override |
| 22 | public String getView() { | 22 | public String getView() { |
| 23 | + if(null == getValue()) | ||
| 24 | + { | ||
| 25 | + return null; | ||
| 26 | + } | ||
| 23 | return getValue().doubleValue()+unit; | 27 | return getValue().doubleValue()+unit; |
| 24 | } | 28 | } |
| 25 | 29 | ||
| 26 | @Override | 30 | @Override |
| 27 | public String getSaveView() { | 31 | public String getSaveView() { |
| 32 | + if(null == getValue()) | ||
| 33 | + { | ||
| 34 | + return null; | ||
| 35 | + } | ||
| 28 | return getValue().toString(); | 36 | return getValue().toString(); |
| 29 | } | 37 | } |
| 30 | } | 38 | } |
| @@ -18,6 +18,10 @@ public class EnumModelOutput extends ThingsModelItemBase<String> | @@ -18,6 +18,10 @@ public class EnumModelOutput extends ThingsModelItemBase<String> | ||
| 18 | 18 | ||
| 19 | @Override | 19 | @Override |
| 20 | public String getView() { | 20 | public String getView() { |
| 21 | + if(null == enumList || enumList.size()==0) | ||
| 22 | + { | ||
| 23 | + return null; | ||
| 24 | + } | ||
| 21 | for(EnumItemOutput enumItemOutput:enumList) | 25 | for(EnumItemOutput enumItemOutput:enumList) |
| 22 | { | 26 | { |
| 23 | if(enumItemOutput.getValue().equals(getValue())) | 27 | if(enumItemOutput.getValue().equals(getValue())) |
| @@ -23,11 +23,19 @@ public class IntegerModelOutput extends ThingsModelItemBase<Integer> | @@ -23,11 +23,19 @@ public class IntegerModelOutput extends ThingsModelItemBase<Integer> | ||
| 23 | 23 | ||
| 24 | @Override | 24 | @Override |
| 25 | public String getView() { | 25 | public String getView() { |
| 26 | + if(null == getValue()) | ||
| 27 | + { | ||
| 28 | + return null; | ||
| 29 | + } | ||
| 26 | return getSaveView()+unit; | 30 | return getSaveView()+unit; |
| 27 | } | 31 | } |
| 28 | 32 | ||
| 29 | @Override | 33 | @Override |
| 30 | public String getSaveView() { | 34 | public String getSaveView() { |
| 35 | + if(null == getValue()) | ||
| 36 | + { | ||
| 37 | + return null; | ||
| 38 | + } | ||
| 31 | BigDecimal bigDecimal = new BigDecimal(getValue().toString()); | 39 | BigDecimal bigDecimal = new BigDecimal(getValue().toString()); |
| 32 | return bigDecimal.divide(new BigDecimal(acy),acy.toString().length()-1, RoundingMode.HALF_UP).toString(); | 40 | return bigDecimal.divide(new BigDecimal(acy),acy.toString().length()-1, RoundingMode.HALF_UP).toString(); |
| 33 | } | 41 | } |
| @@ -112,7 +112,7 @@ public class DataModeAnalysisService { | @@ -112,7 +112,7 @@ public class DataModeAnalysisService { | ||
| 112 | operateHisList.add(dviceLogService.newLogDeviceOperation(id,thingsModelBase.getSaveView(),null,controlModel+thingsModelItemBase.getName()+"为"+thingsModelBase.getView(),jsData.toString())); | 112 | operateHisList.add(dviceLogService.newLogDeviceOperation(id,thingsModelBase.getSaveView(),null,controlModel+thingsModelItemBase.getName()+"为"+thingsModelBase.getView(),jsData.toString())); |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | - rObjec.put(key,JSONObject.toJSONString(thingsModelBase)); | 115 | + rObjec.put(key,thingsModelBase); |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | return rObjec; | 118 | return rObjec; |
| @@ -42,7 +42,7 @@ mqtt: | @@ -42,7 +42,7 @@ mqtt: | ||
| 42 | #链接地址 | 42 | #链接地址 |
| 43 | broker: tcp://175.24.61.68:1883 | 43 | broker: tcp://175.24.61.68:1883 |
| 44 | #唯一标识 | 44 | #唯一标识 |
| 45 | - clientId: lh-mqtt-service-001 | 45 | + clientId: lh-mqtt-service-002 |
| 46 | #订阅的topic | 46 | #订阅的topic |
| 47 | topics: "/2/+/+/+/ADD_POST,/2/+/+/+/ALL_POST,/2/+/+/+/DB_TOPIC_DISTRIBUTE,/2/+/+/+/GET,/2/+/+/+/online,/2/+/+/+/PUT_REQ" | 47 | topics: "/2/+/+/+/ADD_POST,/2/+/+/+/ALL_POST,/2/+/+/+/DB_TOPIC_DISTRIBUTE,/2/+/+/+/GET,/2/+/+/+/online,/2/+/+/+/PUT_REQ" |
| 48 | topicconfig: "/{{roleid}}/{{username}}/{{clientid}}/{{payloadtype}}/{{topicType}}" | 48 | topicconfig: "/{{roleid}}/{{username}}/{{clientid}}/{{payloadtype}}/{{topicType}}" |
-
请 注册 或 登录 后发表评论