Просмотр исходного кода

[电表][优化]:电表协议存储字段

release_toaliyun_real
hupeng 6 лет назад
Родитель
Сommit
f422beab1d
4 измененных файлов: 19 добавлений и 15 удалений
  1. +8
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterController.java
  2. +10
    -8
      mallinkService/src/main/java/com/iformall/domain/po/KwMeter.java
  3. +0
    -2
      mallinkService/src/main/resources/mapper/KwMerchantMeterMapper.xml
  4. +1
    -3
      mallinkService/src/main/resources/mapper/KwMeterMapper.xml

+ 8
- 2
mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterController.java Просмотреть файл

@@ -1,5 +1,6 @@
package com.iformall.controller.device; package com.iformall.controller.device;


import com.alibaba.fastjson.JSONObject;
import com.iformall.annotation.SystemControllerLog; import com.iformall.annotation.SystemControllerLog;
import com.iformall.common.ErrorCode; import com.iformall.common.ErrorCode;
import com.iformall.common.Result; import com.iformall.common.Result;
@@ -203,13 +204,18 @@ public class KwMeterController extends BaseController {
if (c != null) {kwMeter.setBrand(c.getStringCellValue());} if (c != null) {kwMeter.setBrand(c.getStringCellValue());}
c = row.getCell(3,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); c = row.getCell(3,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
if (c != null) {kwMeter.setModel(c.getStringCellValue());} if (c != null) {kwMeter.setModel(c.getStringCellValue());}

c = row.getCell(4,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); c = row.getCell(4,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
if (c != null) {kwMeter.setProtocol(Integer.parseInt(c.getStringCellValue()));} if (c != null) {kwMeter.setProtocol(Integer.parseInt(c.getStringCellValue()));}
else kwMeter.setProtocol(0);
c = row.getCell(5,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); c = row.getCell(5,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
if (c != null) {kwMeter.setBandrate(Integer.parseInt(c.getStringCellValue()));} if (c != null) {kwMeter.setBandrate(Integer.parseInt(c.getStringCellValue()));}
else kwMeter.setBandrate(1200);


if (kwMeter.getProtocol() != null || kwMeter.getBandrate() != null) {
JSONObject jsonObject = new JSONObject();
if (kwMeter.getProtocol() != null) jsonObject.put("protocol",kwMeter.getProtocol());
if (kwMeter.getBandrate() != null) jsonObject.put("bandrate",kwMeter.getBandrate());
kwMeter.setConfig(jsonObject.toJSONString());
}


c = row.getCell(6,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); c = row.getCell(6,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
if (c != null) { if (c != null) {


+ 10
- 8
mallinkService/src/main/java/com/iformall/domain/po/KwMeter.java Просмотреть файл

@@ -45,14 +45,6 @@ public class KwMeter extends BaseEntity {
@io.swagger.annotations.ApiModelProperty(value = "型号", name = "model") @io.swagger.annotations.ApiModelProperty(value = "型号", name = "model")
private String model; private String model;


@Excel(name = "协议(0,1,2-AUTO,97,07协议)", width =30, orderNum = "5")
@io.swagger.annotations.ApiModelProperty(value = "协议(0,1,2-AUTO,97,07协议)", name = "protocol")
private Integer protocol;

@Excel(name = "波特率(1200,2400,9600)", width = 30, orderNum = "6")
@io.swagger.annotations.ApiModelProperty(value = "波特率(1200,2400,9600)", name = "bandrate")
private Integer bandrate;

@io.swagger.annotations.ApiModelProperty(value = "在线状态1在线0离线", name = "onlineStatus") @io.swagger.annotations.ApiModelProperty(value = "在线状态1在线0离线", name = "onlineStatus")
private Integer onlineStatus; private Integer onlineStatus;


@@ -84,6 +76,16 @@ public class KwMeter extends BaseEntity {
@Transient @Transient
private String boxImei; private String boxImei;


@Excel(name = "协议(0,1,2-AUTO,97,07协议)", width =30, orderNum = "5")
@Transient
@io.swagger.annotations.ApiModelProperty(value = "协议(0,1,2-AUTO,97,07协议)", name = "protocol")
private Integer protocol;

@Excel(name = "波特率(1200,2400,9600)", width = 30, orderNum = "6")
@Transient
@io.swagger.annotations.ApiModelProperty(value = "波特率(1200,2400,9600)", name = "bandrate")
private Integer bandrate;

@Excel(name = "商户", width = 20, orderNum = "8") @Excel(name = "商户", width = 20, orderNum = "8")
@Transient @Transient
private String merchantName; private String merchantName;


+ 0
- 2
mallinkService/src/main/resources/mapper/KwMerchantMeterMapper.xml Просмотреть файл

@@ -62,8 +62,6 @@
<result column="brand" jdbcType="VARCHAR" property="brand"/> <result column="brand" jdbcType="VARCHAR" property="brand"/>
<result column="place" jdbcType="VARCHAR" property="place"/> <result column="place" jdbcType="VARCHAR" property="place"/>
<result column="model" jdbcType="VARCHAR" property="model"/> <result column="model" jdbcType="VARCHAR" property="model"/>
<result column="protocol" jdbcType="INTEGER" property="protocol"/>
<result column="bandrate" jdbcType="INTEGER" property="bandrate"/>
<result column="last_online_time" jdbcType="TIMESTAMP" property="lastOnlineTime"/> <result column="last_online_time" jdbcType="TIMESTAMP" property="lastOnlineTime"/>
<result column="total_power" jdbcType="INTEGER" property="totalPower"/> <result column="total_power" jdbcType="INTEGER" property="totalPower"/>
<result column="online_status" jdbcType="INTEGER" property="onlineStatus"/> <result column="online_status" jdbcType="INTEGER" property="onlineStatus"/>


+ 1
- 3
mallinkService/src/main/resources/mapper/KwMeterMapper.xml Просмотреть файл

@@ -8,8 +8,6 @@
<result column="brand" jdbcType="VARCHAR" property="brand"/> <result column="brand" jdbcType="VARCHAR" property="brand"/>
<result column="place" jdbcType="VARCHAR" property="place"/> <result column="place" jdbcType="VARCHAR" property="place"/>
<result column="model" jdbcType="VARCHAR" property="model"/> <result column="model" jdbcType="VARCHAR" property="model"/>
<result column="protocol" jdbcType="INTEGER" property="protocol"/>
<result column="bandrate" jdbcType="INTEGER" property="bandrate"/>
<result column="last_online_time" jdbcType="TIMESTAMP" property="lastOnlineTime"/> <result column="last_online_time" jdbcType="TIMESTAMP" property="lastOnlineTime"/>
<result column="total_power" jdbcType="INTEGER" property="totalPower"/> <result column="total_power" jdbcType="INTEGER" property="totalPower"/>
<result column="online_status" jdbcType="INTEGER" property="onlineStatus"/> <result column="online_status" jdbcType="INTEGER" property="onlineStatus"/>
@@ -22,7 +20,7 @@
</resultMap> </resultMap>
<sql id="allColumns"> <sql id="allColumns">
`id`,`tenant_id`,`address`,`brand`,`model`,`place`,`protocol`,`bandrate`,`last_online_time`,`last_total_power`,`online_status`,`config`,`create_time`,`update_time`,`box_id`,`status`,`bind_status`
`id`,`tenant_id`,`address`,`brand`,`model`,`place`,`last_online_time`,`last_total_power`,`online_status`,`config`,`create_time`,`update_time`,`box_id`,`status`,`bind_status`
</sql> </sql>
<sql id="dynamicWhereConditions"> <sql id="dynamicWhereConditions">


Загрузка…
Отмена
Сохранить