Commit 4cdbd23e authored by 廖旭伟's avatar 廖旭伟

设备管理导入模板

parent 736ebc59
......@@ -76,6 +76,9 @@ public interface IDeviceFeign extends IFeign {
*/
@PostMapping(value = "/notify/downMsg")
Rest<String> downMsg(@RequestBody DeviceNotifyPdu deviceNotifyPdu);
@PostMapping(value = "/device/downloadTemplate")
void downloadTemplate();
}
......@@ -117,6 +120,11 @@ class DeviceFeignFallbackFactory implements FallbackFactory<IDeviceFeign> {
public Rest<String> downMsg(DeviceNotifyPdu deviceNotifyPdu) {
return Rest.fail("暂时无法接收第三方平台下发设备消息,请稍后再试!");
}
@Override
public void downloadTemplate() {
}
};
}
}
......
......@@ -30,6 +30,9 @@
<profiles.kafka.brokers>192.168.0.251:9092</profiles.kafka.brokers>
<profiles.rabbitmq.host>192.168.0.98</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
......
......@@ -20,10 +20,12 @@ public class DeviceEntity extends DeviceVo {
/**
* 设备名称
*/
@Excel(name = "设备名称")
private String deviceName;
/**
* 设备编码,SN码等,默认为MAC地址
*/
@Excel(name = "设备编码")
private String deviceCode;
/**
* 设备的MAC地址
......@@ -40,6 +42,7 @@ public class DeviceEntity extends DeviceVo {
/**
* 站点名称
*/
@Excel(name = "站点名称")
private String siteName;
/**
* 平台系统Id
......@@ -48,6 +51,7 @@ public class DeviceEntity extends DeviceVo {
/**
* 平台系统名称
*/
@Excel(name = "平台系统名称")
private String platformName;
/**
* 产品Id
......@@ -56,6 +60,7 @@ public class DeviceEntity extends DeviceVo {
/**
* 产品名称
*/
@Excel(name = "产品名称")
private String productName;
/**
* 皮肤id
......@@ -76,6 +81,7 @@ public class DeviceEntity extends DeviceVo {
/**
* 设备生产厂商名称
*/
@Excel(name = "设备生产厂商名称")
private String deviceFirmname;
/**
* 设备来源(0.子设备,1.网关设备,2.直连设备)
......@@ -96,10 +102,12 @@ public class DeviceEntity extends DeviceVo {
/**
* 所属楼栋
*/
@Excel(name = "所属楼栋")
private Integer deviceInBuilding;
/**
* 所属楼层
*/
@Excel(name = "所属楼层")
private Integer deviceInFloor;
/**
* 保修期至
......@@ -108,10 +116,12 @@ public class DeviceEntity extends DeviceVo {
/**
* 负责人
*/
@Excel(name = "负责人")
private String leadingOfficial;
/**
* 联系电话
*/
@Excel(name = "联系电话")
private String leadingOfficialTelephone;
/**
* 是否接收异常短(0.否,1.是)
......@@ -168,6 +178,7 @@ public class DeviceEntity extends DeviceVo {
/**
* 设备来源(0.旧设备,1.新设备)
*/
@Excel(name = "设备来源", readConverterExp = "0=旧设备,1=新设备")
private Integer source;
/**
* 设备SN码
......@@ -180,6 +191,7 @@ public class DeviceEntity extends DeviceVo {
/**
* 产品编码
*/
@Excel(name = "产品类型")
private String productCode;
/**
* 大厅Id
......@@ -188,6 +200,7 @@ public class DeviceEntity extends DeviceVo {
/**
* 大厅名称
*/
@Excel(name = "大厅名称")
private String hallName;
/**
* 是否显示短信(0.否,1.是)
......@@ -312,4 +325,4 @@ public class DeviceEntity extends DeviceVo {
this.showWechatQrCode = 1;
}
}
\ No newline at end of file
}
......@@ -15,46 +15,5 @@ import java.util.List;
*/
@Data
public class DeviceVo extends BaseEntityLong {
/**
* 唯一标识
*/
private String token;
/**
* 平台编码
*/
private String platformCode;
/**
* 产品编码
*/
@Excel(name = "产品类型",cacheDict = "productDict" ,type = Excel.Type.IMPORT)
private String productCode;
/**
* 是否通知第三方
*/
private Boolean switchSend=true;
/**
* 设备图片附件
*/
@Excel(name = "设备图片", type = Excel.Type.IMPORT, cellType = Excel.ColumnType.IMAGE)
@JSONField(deserialize = false,serialize = false)
@JsonIgnore
private PictureData picObj;
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
/**
* 产品列表
*/
private List <Long> productIdList;
private List <Integer> deviceStatusList;
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.IUser;
import com.mortals.framework.utils.ReflectUtils;
import com.mortals.framework.utils.poi.ExcelUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.RespData;
......@@ -396,4 +397,26 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
}
@PostMapping({"m/downloadTemplate"})
public void mdownloadTemplate() {
try {
deviceFeign.downloadTemplate();
} catch (Exception var4) {
this.doException(this.request, "导出模板异常", new HashMap(), var4);
}
}
// @PostMapping({"downloadTemplate"})
// public void downloadTemplate() {
// try {
// Class<DeviceEntity> tClass = ReflectUtils.getClassGenricType(this.getClass(), 1);
// ExcelUtil<DeviceEntity, Long> util = new ExcelUtil(tClass);
// byte[] data = util.importTemplateExcel("模板数据");
// this.responseStream(this.response, data, "template.xlsx");
// } catch (Exception var4) {
// this.doException(this.request, "导出模板异常", new HashMap(), var4);
// }
//
// }
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment