Commit 6c08f365 authored by 赵啸非's avatar 赵啸非

添加设备大厅分配

parent a9fc228e
package com.mortals.xhx.common.pdu.site;
import java.util.Date;
import java.util.List;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
/**
* 站点大厅信息Pdu对象
*
* @author zxfei
* @date 2023-04-26
*/
@Data
public class SiteHallPdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 站点ID
*/
private Long siteId;
/**
* 站点名称
*/
private String siteName;
/**
* 大厅名称
*/
private String hallName;
/**
* 地址
*/
private String address;
/**
* 楼层
*/
private Integer floor;
/**
* 楼栋
*/
private Integer build;
/**
* 备注
*/
private String remark;
public void initAttrValue(){
this.siteId = null;
this.siteName = "";
this.hallName = "";
this.address = "";
this.floor = 1;
this.build = 1;
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.feign.site;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.site.SiteHallPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 站点大厅信息 Feign接口
*
* @author zxfei
* @date 2023-04-26
*/
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = SiteHallFeignFallbackFactory.class)
public interface ISiteHallFeign extends IFeign {
/**
* 查看站点大厅信息列表
*
* @param siteHallPdu
* @return
*/
@PostMapping(value = "/site/hall/list")
Rest<RespData<List<SiteHallPdu>>> list(@RequestBody SiteHallPdu siteHallPdu);
/**
* 查看站点大厅信息
*
* @param id
* @return
*/
@GetMapping(value = "/site/hall/info")
Rest<SiteHallPdu> info(@RequestParam(value = "id") Long id);
/**
* 删除站点大厅信息
*
* @param ids
* @return
*/
@GetMapping(value = "/site/hall/delete")
Rest<Void> delete(Long[] ids, @RequestHeader("Authorization") String authorization);
/**
* 站点大厅信息保存更新
*
* @param siteHallPdu
* @return
*/
@PostMapping(value = "/site/hall/save")
Rest<RespData<SiteHallPdu>> save(@RequestBody SiteHallPdu siteHallPdu, @RequestHeader("Authorization") String authorization);
}
@Slf4j
@Component
class SiteHallFeignFallbackFactory implements FallbackFactory<ISiteHallFeign> {
@Override
public ISiteHallFeign create(Throwable t) {
return new ISiteHallFeign() {
@Override
public Rest<RespData<List<SiteHallPdu>>> list(SiteHallPdu siteHallPdu) {
return Rest.fail("暂时无法获取站点大厅信息列表,请稍后再试!");
}
@Override
public Rest<SiteHallPdu> info(Long id) {
return Rest.fail("暂时无法获取站点大厅信息详细,请稍后再试!");
}
@Override
public Rest<Void> delete(Long[] ids, String authorization) {
return Rest.fail("暂时无法删除站点大厅信息,请稍后再试!");
}
@Override
public Rest<RespData<SiteHallPdu>> save(SiteHallPdu siteHallPdu, String authorization) {
return Rest.fail("暂时无法保存站点大厅信息,请稍后再试!");
}
};
}
}
<template>
<template>
<div class="page">
<div class="page-header">
<div>
......@@ -14,11 +14,13 @@
type="primary"
@click="switchMap"
:underline="false"
>地图模式</el-link
>地图模式
</el-link
>
</div>
<el-button style="margin-right: 10px" @click="$router.back()" size="small"
>返回上一级</el-button
>返回上一级
</el-button
>
</div>
<el-divider></el-divider>
......@@ -29,7 +31,8 @@
icon="el-icon-tickets"
size="mini"
@click="handleImport"
>导入</el-button
>导入
</el-button
>
<el-button
slot="table-head-left2"
......@@ -38,7 +41,8 @@
size="mini"
@click="doExport"
:disabled="isExport"
>导出</el-button
>导出
</el-button
>
<el-button
......@@ -47,22 +51,37 @@
icon="el-icon-tickets"
size="mini"
@click="batchActiveDevice"
>批量激活</el-button
>批量激活
</el-button
>
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="batchUpdateHall"
>更新大厅
</el-button
>
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="batchRestartApp"
>批量重启</el-button
>批量重启
</el-button
>
<el-tag
slot="table-body-head"
size="mini"
class="cursord"
@click="changeStatAll()"
>设备总数:{{ tableData.totalCount }}</el-tag
>设备总数:{{ tableData.totalCount }}
</el-tag
>
<el-tag
......@@ -72,7 +91,8 @@
type="success"
class="cursord"
@click="changeStat(2)"
>在线:{{ tableData.onlineCount }}</el-tag
>在线:{{ tableData.onlineCount }}
</el-tag
>
<el-tag
......@@ -82,7 +102,8 @@
type="danger"
class="cursord"
@click="changeStat(1)"
>离线:{{ tableData.offlineCount }}</el-tag
>离线:{{ tableData.offlineCount }}
</el-tag
>
<el-tag
......@@ -92,7 +113,8 @@
type="danger"
class="cursord"
@click="changeStatEnabled( 0)"
>停用:{{ tableData.stopCount }}</el-tag
>停用:{{ tableData.stopCount }}
</el-tag
>
<el-tag
......@@ -102,7 +124,8 @@
type="danger"
class="cursord"
@click="changeStat(0)"
>未激活:{{ tableData.unActiveCount }}</el-tag
>未激活:{{ tableData.unActiveCount }}
</el-tag
>
</LayoutTable>
......@@ -131,12 +154,14 @@
<em>点击上传</em>
</div>
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据
<el-checkbox v-model="upload.updateSupport"/>
是否更新已经存在的数据
<el-link
type="primary"
style="font-size: 14px"
@click="downloadTemplate"
>下载模板</el-link
>下载模板
</el-link
>
</div>
<div class="el-upload__tip" style="color: red" slot="tip">
......@@ -190,20 +215,43 @@
</div>
</el-dialog>
<!-- 大厅修改对话框 -->
<el-dialog
:title="hallDialog.title"
:visible.sync="hallDialog.open"
width="40%"
append-to-body
>
<Field
label="站点大厅"
v-model="hallId"
type="select"
:enumData="tableData.dict.hallId"
placeholder="请选择所属大厅"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateBatchHallConform">确 定</el-button>
<el-button @click="tree.open = false">取 消</el-button>
</div>
</el-dialog>
<!-- 查看二维码弹窗 -->
<el-dialog
title="设备二维码"
:visible.sync="qrCodeDialog.visible"
width="350px"
>
<img :src="qrCodeDialog.qrCode" />
<img :src="qrCodeDialog.qrCode"/>
<p style="word-wrap: break-word">{{ qrCodeDialog.qrCodeUrl }}</p>
</el-dialog>
<!-- <dialog-show ref="dialogform" @ok="getData" /> -->
<drawer-show ref="drawerform" @ok="getData" />
<drawer-show ref="drawerform" @ok="getData"/>
<drawer-view ref="drawerViewform" @ok="getData" />
<drawer-view ref="drawerViewform" @ok="getData"/>
</div>
</template>
......@@ -213,14 +261,15 @@ import drawerView from "./drawerview";
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
import tree from "@/assets/mixins/tree";
export default {
name: "Device",
components: { drawerShow, drawerView },
components: {drawerShow, drawerView},
mixins: [table, tree],
created() {
this.siteId = this.$route.query.siteId;
this.info = this.$route.query;
this.query = { siteId: this.siteId };
this.query = {siteId: this.siteId};
this.$get("/sitestat/siteInfo", {
siteId: this.siteId,
......@@ -250,13 +299,16 @@ export default {
this.upload.title = "设备导入";
this.upload.open = true;
},
/** 下载模板操作 */
downloadTemplate() {
this.isExport = true;
this.$download(
"/device/downloadTemplate",
{},
{ type: "excel", fileName: "设备导入模板" }
{type: "excel", fileName: "设备导入模板"}
)
.then(() => (this.isExport = false))
.catch((error) => {
......@@ -273,7 +325,7 @@ export default {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
this.getData();
},
/** 提交上传文件 */
......@@ -290,7 +342,7 @@ export default {
deviceName: this.$route.query["deviceName"],
siteId: this.$route.query["siteId"],
},
{ type: "excel", fileName: "设备表" }
{type: "excel", fileName: "设备表"}
)
.then(() => (this.isExport = false))
.catch((error) => {
......@@ -324,7 +376,7 @@ export default {
delete this.query["deviceCode"]
delete this.query["deviceStatus"]
this.query["page"]=1
this.query["page"] = 1
this.query = Object.assign(this.query, {
deviceStatusList: [1, 2],
enabled: 1,
......@@ -333,23 +385,15 @@ export default {
this.getData();
},
changeStatEnabled( enabled) {
changeStatEnabled(enabled) {
//去除其它条件
// delete this.query["productId"]
//delete this.query["deviceName"]
//delete this.query["deviceCode"]
this.query["page"]=1
this.query["page"] = 1
this.query = Object.assign(this.query, {
deviceStatusList: [1, 2],
enabled: enabled,
});
this.getData();
// delete this.query.deviceStatus
// delete this.query.deviceStatusList
},
changeStat(val) {
......@@ -357,9 +401,8 @@ export default {
// delete this.query["productId"]
//delete this.query["deviceName"]
// delete this.query["deviceCode"]
this.query = Object.assign(this.query, { deviceStatus: val });
this.query["page"]=1
this.query = Object.assign(this.query, {deviceStatus: val});
this.query["page"] = 1
this.getData();
},
......@@ -394,6 +437,34 @@ export default {
});
},
batchUpdateHall() {
this.hallId=null;
this.hallName=""
this.hallDialog.title = "设备所属大厅设置";
this.hallDialog.open = true;
},
updateBatchHallConform(row) {
this.hallName=this.tableData.dict.hallId[this.hallId];
this.$post("/device/batchUpdateHall", {
idList: this.selection,
hallId: this.hallId,
hallName: this.hallName
})
.then((res) => {
if (res.code == 1) {
this.$message.success("批量更新大厅设备成功!");
this.getData();
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
batchRestartApp(row) {
this.$post("/device/batchRestartApp", {
idList: this.selection,
......@@ -425,7 +496,7 @@ export default {
},
updateSite(row) {
this.$get("/sitestat/siteTree", {}).then(({ data }) => {
this.$get("/sitestat/siteTree", {}).then(({data}) => {
this.areaData = data.siteTree;
this.tree.open = true;
this.tree.id = row.id;
......@@ -479,7 +550,7 @@ export default {
},
async viewQrCode(id) {
try {
const { qrCode, qrCodeUrl } = await this.$post("/device/viewQrCode", {
const {qrCode, qrCodeUrl} = await this.$post("/device/viewQrCode", {
id: id,
});
this.qrCodeDialog.qrCode = qrCode;
......@@ -511,6 +582,14 @@ export default {
// 上传的地址
url: "/m/device/importData",
},
hallDialog: {
// 是否显示弹出层(设备导入)
open: false,
// 弹出层标题(设备导入)
title: "所属大厅选择",
},
info: {},
// 站点树
tree: {
......@@ -528,6 +607,9 @@ export default {
updateSiteName: "",
updateSiteCode: "",
hallId: null,
hallName: "",
config: {
getsocketData: null,
search: [
......@@ -556,9 +638,9 @@ export default {
reserveSelection: true,
width: 60,
},
{ type: "index", label: "序号", align: "center", width: 50 },
{type: "index", label: "序号", align: "center", width: 50},
{ label: "设备名称", align: "center", prop: "deviceName" },
{label: "设备名称", align: "center", prop: "deviceName"},
{
label: "设备类型",
......@@ -567,9 +649,9 @@ export default {
formatter: this.formatter,
},
{ label: "设备编码", align: "center", prop: "deviceCode" },
{label: "设备编码", align: "center", prop: "deviceCode"},
// { label: "mac地址", prop: "deviceMac" },
{ label: "所属大厅", prop: "hallName"},
{
label: "设备生产商",
......@@ -578,7 +660,7 @@ export default {
formatter: this.formatter,
width: 250,
},
{ label: "负责人", align: "center", prop: "leadingOfficial" },
{label: "负责人", align: "center", prop: "leadingOfficial"},
{
label: "联系电话",
align: "center",
......@@ -675,6 +757,7 @@ export default {
justify-content: space-between;
align-items: center;
}
.el-divider--horizontal {
margin: 2px 0;
background: 0 0;
......
......@@ -119,6 +119,14 @@ export default {
// toView(row) {
// this.$refs.dialogform.view(row);
// },
handAdd(row){
this.$router.push({
path: this.pageInfo.add,
query: {},
})
}
},
data() {
return {
......
......@@ -20,3 +20,11 @@ ALTER TABLE mortals_xhx_device ADD COLUMN `deviceVersion` varchar (64) COMME
2023-02-2
-- ----------------------------
ALTER TABLE mortals_xhx_device ADD COLUMN `productCode` varchar (64) default '' COMMENT '产品编码' AFTER productId;
-- ----------------------------
2023-04-26
-- ----------------------------
ALTER TABLE mortals_xhx_device ADD COLUMN `hallId` bigint(20) COMMENT '大厅Id' AFTER skinName;
ALTER TABLE mortals_xhx_device ADD COLUMN `hallName` varchar(256) default '' COMMENT '大厅名称' AFTER hallId;
......@@ -24,7 +24,7 @@
<profiles.active>develop</profiles.active>
<profiles.server.port>18222</profiles.server.port>
<!-- <profiles.platform.type>standalone</profiles.platform.type>-->
<profiles.platform.type>cloud</profiles.platform.type>
<profiles.platform.type>standalone</profiles.platform.type>
<profiles.datasource.uri>
<![CDATA[jdbc:mysql://192.168.0.98:3306/device-new-platform?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]></profiles.datasource.uri>
<profiles.datasource.username>root</profiles.datasource.username>
......
......@@ -603,7 +603,7 @@ public class DeviceApiController {
@PostMapping("callbackByProduct")
@UnAuth
public String callbackByProduct(@RequestBody DeviceMsgReq deviceMsgReq) {
log.info("【设备数据消息接收】【请求体】--> " + JSONObject.toJSONString(deviceMsgReq));
log.info("【设备产品数据消息接收】【请求体】--> " + JSONObject.toJSONString(deviceMsgReq));
ApiResp<String> rsp = new ApiResp<>();
rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel());
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
......
......@@ -85,37 +85,6 @@ public class DownMsgTask implements Runnable {
TimeUnit.SECONDS.sleep(1);
}
/*
list.stream().sorted(Comparator.comparing(DeviceMsgReq::getTimestamp)).forEach(item -> {
//根据设备编码查询设备
DeviceEntity deviceEntity = deviceService.getExtCache(item.getDeviceCode());
if (!ObjectUtils.isEmpty(deviceEntity)) {
TbQueueMsgHeaders header = new DefaultTbQueueMsgHeaders();
header.put(MessageHeader.MESSAGETYPE, item.getMessageType());
header.put(MessageHeader.DEVICECODE, item.getDeviceCode());
header.put(MessageHeader.TIMESTAMP, item.getTimestamp().toString());
TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastUUID(), item.getData(), header);
messageProducer.sendMsg(QueueKey.DEFAULT_EXCHANGE,Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(),JSON.toJSONString(queueMsg));
DeviceLogEntity deviceLogEntity = new DeviceLogEntity();
deviceLogEntity.initAttrValue();
deviceLogEntity.setTraceID(IdUtil.fastSimpleUUID());
deviceLogEntity.setSiteId(deviceEntity.getSiteId());
deviceLogEntity.setDeviceId(deviceEntity.getId());
deviceLogEntity.setDeviceName(deviceEntity.getDeviceName());
deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode());
deviceLogEntity.setMessageHead(item.getMessageType());
deviceLogEntity.setContent(item.getData());
deviceLogEntity.setLogType(LogTypeEnum.下发服务.getValue());
deviceLogEntity.setCreateUserId(1L);
deviceLogEntity.setCreateTime(new Date());
deviceLogService.save(deviceLogEntity,null);
} else {
log.info("未找到设备,deviceCode:{}", item.getDeviceCode());
}
});*/
} catch (Exception e) {
log.error("异常:", e);
}
......
package com.mortals.xhx.module.device.model;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.mortals.framework.annotation.Excel;
import com.mortals.xhx.base.framework.CustomJsonDateDeserializer;
import com.mortals.xhx.module.device.model.vo.DeviceVo;
import lombok.Data;
import java.util.Date;
/**
* 设备实体对象
*
* @author zxfei
* @date 2022-07-11
* @date 2023-04-26
*/
@Data
public class DeviceEntity extends DeviceVo {
private static final long serialVersionUID = 1L;
/**
* 设备名称
*/
@Excel(name = "设备名称")
private String deviceName;
/**
* 设备SN码
*/
@Excel(name = "设备SN码")
private String deviceSN;
/**
* 设备编码,默认为MAC地址
* 设备编码,SN码等,默认为MAC地址
*/
@Excel(name = "设备编码")
private String deviceCode;
/**
* 设备的MAC地址
*/
@Excel(name = "Mac地址",type = Excel.Type.EXPORT)
private String deviceMac;
/**
* 站点Id,来源基础服务平台
......@@ -62,15 +50,22 @@ public class DeviceEntity extends DeviceVo {
* 产品Id
*/
private Long productId;
/**
* 产品编码
*/
@Excel(name = "产品类型",cacheDict = "productDict" ,type = Excel.Type.IMPORT)
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* 皮肤id
*/
private Long skinId;
/**
* 皮肤名称
*/
private String skinName;
/**
* 首页地址
*/
private String homeUrl;
/**
* 设备生产厂商ID
*/
......@@ -106,7 +101,6 @@ public class DeviceEntity extends DeviceVo {
/**
* 保修期至
*/
@JsonDeserialize(using = CustomJsonDateDeserializer.class)
private Date defectsLiabilityPeriod;
/**
* 负责人
......@@ -123,7 +117,6 @@ public class DeviceEntity extends DeviceVo {
/**
* 设备图片
*/
@Excel(name = "设备图片",height = 90, type = Excel.Type.EXPORT, cellType = Excel.ColumnType.IMAGE)
private String devicePhotoPath;
/**
* 设备访问ip
......@@ -173,574 +166,26 @@ public class DeviceEntity extends DeviceVo {
* 设备来源(0.旧设备,1.新设备)
*/
private Integer source;
/**
* 皮肤id
*/
private Long skinId;
/**
* 皮肤名称
*/
private String skinName;
/**
* 首页地址
* 设备SN码
*/
private String homeUrl;
private String deviceSN;
/**
* 设备版本
*/
private String deviceVersion;
public DeviceEntity(){}
/**
* 获取 设备名称
* @return String
*/
public String getDeviceName(){
return deviceName;
}
/**
* 设置 设备名称
* @param deviceName
*/
public void setDeviceName(String deviceName){
this.deviceName = deviceName;
}
/**
* 获取 设备编码,SN码等,默认为MAC地址
* @return String
*/
public String getDeviceCode(){
return deviceCode;
}
/**
* 设置 设备编码,SN码等,默认为MAC地址
* @param deviceCode
*/
public void setDeviceCode(String deviceCode){
this.deviceCode = deviceCode;
}
/**
* 获取 设备的MAC地址
* @return String
*/
public String getDeviceMac(){
return deviceMac;
}
/**
* 设置 设备的MAC地址
* @param deviceMac
*/
public void setDeviceMac(String deviceMac){
this.deviceMac = deviceMac;
}
/**
* 获取 站点Id,来源基础服务平台
* @return Long
*/
public Long getSiteId(){
return siteId;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteId
*/
public void setSiteId(Long siteId){
this.siteId = siteId;
}
/**
* 获取 站点编号,来源基础服务平台
* @return String
*/
public String getSiteCode(){
return siteCode;
}
/**
* 设置 站点编号,来源基础服务平台
* @param siteCode
*/
public void setSiteCode(String siteCode){
this.siteCode = siteCode;
}
/**
* 获取 站点名称
* @return String
*/
public String getSiteName(){
return siteName;
}
/**
* 设置 站点名称
* @param siteName
*/
public void setSiteName(String siteName){
this.siteName = siteName;
}
/**
* 获取 平台系统Id
* @return Long
*/
public Long getPlatformId(){
return platformId;
}
/**
* 设置 平台系统Id
* @param platformId
*/
public void setPlatformId(Long platformId){
this.platformId = platformId;
}
/**
* 获取 平台系统名称
* @return String
*/
public String getPlatformName(){
return platformName;
}
/**
* 设置 平台系统名称
* @param platformName
*/
public void setPlatformName(String platformName){
this.platformName = platformName;
}
/**
* 获取 产品Id
* @return Long
*/
public Long getProductId(){
return productId;
}
/**
* 设置 产品Id
* @param productId
*/
public void setProductId(Long productId){
this.productId = productId;
}
/**
* 获取 产品编码
* @return String
*/
public String getProductCode(){
return productCode;
}
/**
* 设置 产品编码
* @param productCode
*/
public void setProductCode(String productCode) {
this.productCode = productCode;
}
/**
* 获取 产品名称
* @return String
*/
public String getProductName(){
return productName;
}
/**
* 设置 产品名称
* @param productName
*/
public void setProductName(String productName){
this.productName = productName;
}
/**
* 获取 设备生产厂商ID
* @return Long
*/
public Long getDeviceFirmId(){
return deviceFirmId;
}
/**
* 设置 设备生产厂商ID
* @param deviceFirmId
*/
public void setDeviceFirmId(Long deviceFirmId){
this.deviceFirmId = deviceFirmId;
}
/**
* 获取 设备生产厂商名称
* @return String
*/
public String getDeviceFirmname(){
return deviceFirmname;
}
/**
* 设置 设备生产厂商名称
* @param deviceFirmname
*/
public void setDeviceFirmname(String deviceFirmname){
this.deviceFirmname = deviceFirmname;
}
/**
* 获取 设备来源(0.子设备,1.网关设备,2.直连设备)
* @return Integer
*/
public Integer getDeviceSrc(){
return deviceSrc;
}
/**
* 设置 设备来源(0.子设备,1.网关设备,2.直连设备)
* @param deviceSrc
*/
public void setDeviceSrc(Integer deviceSrc){
this.deviceSrc = deviceSrc;
}
/**
* 获取 数据获取方式(0.主动上报,1.被动拉取)
* @return Integer
*/
public Integer getDeviceDataSourceWay(){
return deviceDataSourceWay;
}
/**
* 设置 数据获取方式(0.主动上报,1.被动拉取)
* @param deviceDataSourceWay
*/
public void setDeviceDataSourceWay(Integer deviceDataSourceWay){
this.deviceDataSourceWay = deviceDataSourceWay;
}
/**
* 获取 经度
* @return String
*/
public String getLon(){
return lon;
}
/**
* 设置 经度
* @param lon
*/
public void setLon(String lon){
this.lon = lon;
}
/**
* 获取 经度
* @return String
*/
public String getLati(){
return lati;
}
/**
* 设置 经度
* @param lati
*/
public void setLati(String lati){
this.lati = lati;
}
/**
* 获取 所属楼栋
* @return Integer
*/
public Integer getDeviceInBuilding(){
return deviceInBuilding;
}
/**
* 设置 所属楼栋
* @param deviceInBuilding
*/
public void setDeviceInBuilding(Integer deviceInBuilding){
this.deviceInBuilding = deviceInBuilding;
}
/**
* 获取 所属楼层
* @return Integer
*/
public Integer getDeviceInFloor(){
return deviceInFloor;
}
/**
* 设置 所属楼层
* @param deviceInFloor
*/
public void setDeviceInFloor(Integer deviceInFloor){
this.deviceInFloor = deviceInFloor;
}
/**
* 获取 保修期至
* @return Date
*/
public Date getDefectsLiabilityPeriod(){
return defectsLiabilityPeriod;
}
/**
* 设置 保修期至
* @param defectsLiabilityPeriod
*/
public void setDefectsLiabilityPeriod(Date defectsLiabilityPeriod){
this.defectsLiabilityPeriod = defectsLiabilityPeriod;
}
/**
* 获取 负责人
* @return String
*/
public String getLeadingOfficial(){
return leadingOfficial;
}
/**
* 设置 负责人
* @param leadingOfficial
*/
public void setLeadingOfficial(String leadingOfficial){
this.leadingOfficial = leadingOfficial;
}
/**
* 获取 联系电话
* @return String
*/
public String getLeadingOfficialTelephone(){
return leadingOfficialTelephone;
}
/**
* 设置 联系电话
* @param leadingOfficialTelephone
*/
public void setLeadingOfficialTelephone(String leadingOfficialTelephone){
this.leadingOfficialTelephone = leadingOfficialTelephone;
}
/**
* 获取 是否接收异常短(0.否,1.是)
* @return Integer
*/
public Integer getIsReceiveMess(){
return isReceiveMess;
}
/**
* 设置 是否接收异常短(0.否,1.是)
* @param isReceiveMess
*/
public void setIsReceiveMess(Integer isReceiveMess){
this.isReceiveMess = isReceiveMess;
}
/**
* 获取 设备图片
* @return String
*/
public String getDevicePhotoPath(){
return devicePhotoPath;
}
/**
* 设置 设备图片
* @param devicePhotoPath
*/
public void setDevicePhotoPath(String devicePhotoPath){
this.devicePhotoPath = devicePhotoPath;
}
/**
* 获取 设备访问ip
* @return String
*/
public String getIp(){
return ip;
}
/**
* 设置 设备访问ip
* @param ip
*/
public void setIp(String ip){
this.ip = ip;
}
/**
* 获取 中心设备编码
* @return String
*/
public String getCenternum(){
return centernum;
}
/**
* 设置 中心设备编码
* @param centernum
*/
public void setCenternum(String centernum){
this.centernum = centernum;
}
/**
* 获取 端口
* @return String
*/
public String getPort(){
return port;
}
/**
* 设置 端口
* @param port
*/
public void setPort(String port){
this.port = port;
}
/**
* 获取 设备topic信息
* @return String
*/
public String getDeviceTopic(){
return deviceTopic;
}
/**
* 设置 设备topic信息
* @param deviceTopic
*/
public void setDeviceTopic(String deviceTopic){
this.deviceTopic = deviceTopic;
}
/**
* 获取 设备状态 (0.未激活,1.离线,2.在线)
* @return Integer
*/
public Integer getDeviceStatus(){
return deviceStatus;
}
/**
* 设置 设备状态 (0.未激活,1.离线,2.在线)
* @param deviceStatus
*/
public void setDeviceStatus(Integer deviceStatus){
this.deviceStatus = deviceStatus;
}
/**
* 获取 启用状态 (0.停止,1.启用)
* @return Integer
*/
public Integer getEnabled(){
return enabled;
}
/**
* 设置 启用状态 (0.停止,1.启用)
* @param enabled
*/
public void setEnabled(Integer enabled){
this.enabled = enabled;
}
/**
* 获取 设备授权码
* @return String
*/
public String getDeviceAuthCode(){
return deviceAuthCode;
}
/**
* 设置 设备授权码
* @param deviceAuthCode
*/
public void setDeviceAuthCode(String deviceAuthCode){
this.deviceAuthCode = deviceAuthCode;
}
/**
* 获取 备注
* @return String
*/
public String getDeviceRemark(){
return deviceRemark;
}
/**
* 设置 备注
* @param deviceRemark
*/
public void setDeviceRemark(String deviceRemark){
this.deviceRemark = deviceRemark;
}
/**
* 获取 最近上线时间
* @return Date
*/
public Date getOnlineTime(){
return onlineTime;
}
/**
* 设置 最近上线时间
* @param onlineTime
*/
public void setOnlineTime(Date onlineTime){
this.onlineTime = onlineTime;
}
/**
* 获取 最近离线时间
* @return Date
*/
public Date getOfflineTime(){
return offlineTime;
}
/**
* 设置 最近离线时间
* @param offlineTime
*/
public void setOfflineTime(Date offlineTime){
this.offlineTime = offlineTime;
}
/**
* 获取 是否删除(0.否,1.是)
* @return Integer
*/
public Integer getDeleted(){
return deleted;
}
/**
* 设置 是否删除(0.否,1.是)
* @param deleted
* 产品编码
*/
public void setDeleted(Integer deleted){
this.deleted = deleted;
}
private String productCode;
/**
* 获取 收不来源(0.旧设备,1.新设备)
* @return Integer
* 大厅Id
*/
public Integer getSource(){
return source;
}
private Long hallId;
/**
* 设置 收不来源(0.旧设备,1.新设备)
* @param source
* 大厅名称
*/
public void setSource(Integer source){
this.source = source;
}
public Long getSkinId() {
return skinId;
}
public void setSkinId(Long skinId) {
this.skinId = skinId;
}
public String getSkinName() {
return skinName;
}
public void setSkinName(String skinName) {
this.skinName = skinName;
}
public String getHomeUrl() {
return homeUrl;
}
public void setHomeUrl(String homeUrl) {
this.homeUrl = homeUrl;
}
public String getDeviceSN() {
return deviceSN;
}
public void setDeviceSN(String deviceSN) {
this.deviceSN = deviceSN;
}
public String getDeviceVersion() {
return deviceVersion;
}
public void setDeviceVersion(String deviceVersion) {
this.deviceVersion = deviceVersion;
}
private String hallName;
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -757,54 +202,12 @@ public class DeviceEntity extends DeviceVo {
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",deviceName:").append(getDeviceName());
sb.append(",deviceCode:").append(getDeviceCode());
sb.append(",deviceMac:").append(getDeviceMac());
sb.append(",siteId:").append(getSiteId());
sb.append(",siteCode:").append(getSiteCode());
sb.append(",siteName:").append(getSiteName());
sb.append(",platformId:").append(getPlatformId());
sb.append(",platformName:").append(getPlatformName());
sb.append(",productId:").append(getProductId());
sb.append(",productName:").append(getProductName());
sb.append(",deviceFirmId:").append(getDeviceFirmId());
sb.append(",deviceFirmname:").append(getDeviceFirmname());
sb.append(",deviceSrc:").append(getDeviceSrc());
sb.append(",deviceDataSourceWay:").append(getDeviceDataSourceWay());
sb.append(",lon:").append(getLon());
sb.append(",lati:").append(getLati());
sb.append(",deviceInBuilding:").append(getDeviceInBuilding());
sb.append(",deviceInFloor:").append(getDeviceInFloor());
sb.append(",defectsLiabilityPeriod:").append(getDefectsLiabilityPeriod());
sb.append(",leadingOfficial:").append(getLeadingOfficial());
sb.append(",leadingOfficialTelephone:").append(getLeadingOfficialTelephone());
sb.append(",isReceiveMess:").append(getIsReceiveMess());
sb.append(",devicePhotoPath:").append(getDevicePhotoPath());
sb.append(",ip:").append(getIp());
sb.append(",centernum:").append(getCenternum());
sb.append(",port:").append(getPort());
sb.append(",deviceTopic:").append(getDeviceTopic());
sb.append(",deviceStatus:").append(getDeviceStatus());
sb.append(",enabled:").append(getEnabled());
sb.append(",deviceAuthCode:").append(getDeviceAuthCode());
sb.append(",deviceRemark:").append(getDeviceRemark());
sb.append(",onlineTime:").append(getOnlineTime());
sb.append(",offlineTime:").append(getOfflineTime());
sb.append(",deleted:").append(getDeleted());
sb.append(",source:").append(getSource());
return sb.toString();
}
public void initAttrValue(){
this.deviceName = "";
this.deviceCode = "";
this.deviceSN = "";
this.deviceMac = "";
this.siteId = null;
......@@ -819,10 +222,14 @@ public class DeviceEntity extends DeviceVo {
this.productId = null;
this.productCode = "";
this.productName = "";
this.skinId = null;
this.skinName = "";
this.homeUrl = "";
this.deviceFirmId = null;
this.deviceFirmname = "";
......@@ -873,12 +280,14 @@ public class DeviceEntity extends DeviceVo {
this.source = 1;
this.skinId = null;
this.skinName = "";
this.deviceSN = "";
this.deviceVersion = "";
this.homeUrl = "";
this.productCode = "";
this.hallId = null;
this.hallName = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.device.model;
import java.util.Date;
import java.util.List;
import com.mortals.xhx.module.device.model.DeviceEntity;
/**
* 设备查询对象
*
* @author zxfei
* @date 2023-02-25
* @date 2023-04-26
*/
public class DeviceQuery extends DeviceEntity {
/** 开始 主键ID,主键,自增长 */
......@@ -413,6 +415,26 @@ public class DeviceQuery extends DeviceEntity {
/** 产品编码排除列表 */
private List <String> productCodeNotList;
/** 开始 大厅Id */
private Long hallIdStart;
/** 结束 大厅Id */
private Long hallIdEnd;
/** 增加 大厅Id */
private Long hallIdIncrement;
/** 大厅Id列表 */
private List <Long> hallIdList;
/** 大厅Id排除列表 */
private List <Long> hallIdNotList;
/** 大厅名称 */
private List<String> hallNameList;
/** 大厅名称排除列表 */
private List <String> hallNameNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DeviceQuery> orConditionList;
......@@ -2726,6 +2748,119 @@ public class DeviceQuery extends DeviceEntity {
this.productCodeNotList = productCodeNotList;
}
/**
* 获取 开始 大厅Id
* @return hallIdStart
*/
public Long getHallIdStart(){
return this.hallIdStart;
}
/**
* 设置 开始 大厅Id
* @param hallIdStart
*/
public void setHallIdStart(Long hallIdStart){
this.hallIdStart = hallIdStart;
}
/**
* 获取 结束 大厅Id
* @return $hallIdEnd
*/
public Long getHallIdEnd(){
return this.hallIdEnd;
}
/**
* 设置 结束 大厅Id
* @param hallIdEnd
*/
public void setHallIdEnd(Long hallIdEnd){
this.hallIdEnd = hallIdEnd;
}
/**
* 获取 增加 大厅Id
* @return hallIdIncrement
*/
public Long getHallIdIncrement(){
return this.hallIdIncrement;
}
/**
* 设置 增加 大厅Id
* @param hallIdIncrement
*/
public void setHallIdIncrement(Long hallIdIncrement){
this.hallIdIncrement = hallIdIncrement;
}
/**
* 获取 大厅Id
* @return hallIdList
*/
public List<Long> getHallIdList(){
return this.hallIdList;
}
/**
* 设置 大厅Id
* @param hallIdList
*/
public void setHallIdList(List<Long> hallIdList){
this.hallIdList = hallIdList;
}
/**
* 获取 大厅Id
* @return hallIdNotList
*/
public List<Long> getHallIdNotList(){
return this.hallIdNotList;
}
/**
* 设置 大厅Id
* @param hallIdNotList
*/
public void setHallIdNotList(List<Long> hallIdNotList){
this.hallIdNotList = hallIdNotList;
}
/**
* 获取 大厅名称
* @return hallNameList
*/
public List<String> getHallNameList(){
return this.hallNameList;
}
/**
* 设置 大厅名称
* @param hallNameList
*/
public void setHallNameList(List<String> hallNameList){
this.hallNameList = hallNameList;
}
/**
* 获取 大厅名称
* @return hallNameNotList
*/
public List<String> getHallNameNotList(){
return this.hallNameNotList;
}
/**
* 设置 大厅名称
* @param hallNameNotList
*/
public void setHallNameNotList(List<String> hallNameNotList){
this.hallNameNotList = hallNameNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
......@@ -4105,6 +4240,79 @@ public class DeviceQuery extends DeviceEntity {
return this;
}
/**
* 设置 大厅Id
* @param hallId
*/
public DeviceQuery hallId(Long hallId){
setHallId(hallId);
return this;
}
/**
* 设置 开始 大厅Id
* @param hallIdStart
*/
public DeviceQuery hallIdStart(Long hallIdStart){
this.hallIdStart = hallIdStart;
return this;
}
/**
* 设置 结束 大厅Id
* @param hallIdEnd
*/
public DeviceQuery hallIdEnd(Long hallIdEnd){
this.hallIdEnd = hallIdEnd;
return this;
}
/**
* 设置 增加 大厅Id
* @param hallIdIncrement
*/
public DeviceQuery hallIdIncrement(Long hallIdIncrement){
this.hallIdIncrement = hallIdIncrement;
return this;
}
/**
* 设置 大厅Id
* @param hallIdList
*/
public DeviceQuery hallIdList(List<Long> hallIdList){
this.hallIdList = hallIdList;
return this;
}
/**
* 设置 大厅Id
* @param hallIdNotList
*/
public DeviceQuery hallIdNotList(List<Long> hallIdNotList){
this.hallIdNotList = hallIdNotList;
return this;
}
/**
* 设置 大厅名称
* @param hallName
*/
public DeviceQuery hallName(String hallName){
setHallName(hallName);
return this;
}
/**
* 设置 大厅名称
* @param hallNameList
*/
public DeviceQuery hallNameList(List<String> hallNameList){
this.hallNameList = hallNameList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
......@@ -48,6 +48,9 @@ public interface DeviceService extends ICRUDCacheService<DeviceEntity,Long>{
*/
void restartApp(DeviceEntity deviceEntity,Context context);
void batchUpdateHall(DeviceEntity deviceEntity,Context context);
/**
* 设备启用停用
* @param id
......
......@@ -73,7 +73,7 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D
//RuntimeUtil
//部署路径是否存在 如果不存在 创建目录,
String path = GlobalSysInfo.getParamValue(Constant.DISTRIBUTE_PATH, "/home/publish/device-manager-ui/homeDeviceUrl");
String path = GlobalSysInfo.getParamValue(Constant.DISTRIBUTE_PATH, "/home/publish/app/homeDeviceUrl");
String code = distributeEntity.getProductCode();
String imageRe = distributeEntity.getImageResolutionValue();
String disPath = "/" + path + "/" + code + "/" + imageRe;
......
......@@ -261,6 +261,27 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
}
@Override
public void batchUpdateHall(DeviceEntity deviceEntity, Context context) {
if (ObjectUtils.isEmpty(deviceEntity.getIdList())) {
throw new AppException("请选择需要更新大厅的设备!");
}
if(ObjectUtils.isEmpty(deviceEntity.getHallId())){
throw new AppException("设备所属大厅不能为空!");
}
DeviceQuery condition = new DeviceQuery();
condition.setIdList(deviceEntity.getIdList());
DeviceQuery deviceQuery = new DeviceQuery();
deviceQuery.setHallId(deviceEntity.getHallId());
deviceQuery.setHallName(deviceEntity.getHallName());
deviceQuery.setUpdateTime(new Date());
this.getDeviceDao().update(deviceQuery, condition);
}
@Override
public void deviceEnabled(Long id, Integer enabled, Context context) {
DeviceEntity deviceEntity = this.get(id, context);
......
......@@ -14,10 +14,12 @@ import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.site.SiteHallPdu;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.common.pdu.skin.SkinBasePdu;
import com.mortals.xhx.common.utils.QRCodeUtil;
import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.feign.site.ISiteHallFeign;
import com.mortals.xhx.feign.skin.ISkinBaseFeign;
import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceMapEntity;
......@@ -73,6 +75,8 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
private String platFormType;//版本,默认云服务版本
@Autowired
private SiteService siteService;
@Autowired
public ISiteHallFeign siteHallFeign;
public DeviceController() {
......@@ -100,6 +104,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
this.addDict(model, "skinProductCodeMap", skinProductCodeMap);
}
}
//siteHallFeign.list(new SiteHallPdu().setSiteId(context.g);)
super.init(model, context);
}
......@@ -108,6 +113,14 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("createTime", OrderCol.DESCENDING));
query.setOrderColList(orderColList);
SiteHallPdu siteHallPdu = new SiteHallPdu();
siteHallPdu.setSiteId(query.getSiteId());
Rest<RespData<List<SiteHallPdu>>> rest = siteHallFeign.list(siteHallPdu);
if(rest.getCode()==YesNoEnum.YES.getValue()){
Map<String, String> hallMap = rest.getData().getData().stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getHallName(), (o, n) -> n));
this.addDict(model, "hallId", hallMap);
}
super.doListBefore(query, model, context);
}
......@@ -328,6 +341,25 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
return Rest.ok(model);
}
/**
* 设备批量更新设备所属大厅
*/
@PostMapping(value = "batchUpdateHall")
public Rest<Void> batchUpdateHall(@RequestBody DeviceEntity deviceEntity) {
log.info("批量设备重启", deviceEntity.getDeviceCode());
String busiDesc = this.getModuleDesc() + "批量更新所属大厅";
Rest<Void> rest = Rest.ok(busiDesc + " 【成功】");
try {
this.service.batchUpdateHall(deviceEntity,getContext());
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error("批量更新所属大厅", e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
@Override
public void doImportDataBefore(List<DeviceEntity> list, boolean updateSupport, Context context) throws AppException {
......
......@@ -51,6 +51,8 @@
<result property="deviceSN" column="deviceSN" />
<result property="deviceVersion" column="deviceVersion" />
<result property="productCode" column="productCode" />
<result property="hallId" column="hallId" />
<result property="hallName" column="hallName" />
</resultMap>
......@@ -196,23 +198,29 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productCode') or colPickMode == 1 and data.containsKey('productCode')))">
a.productCode,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('hallId') or colPickMode == 1 and data.containsKey('hallId')))">
a.hallId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('hallName') or colPickMode == 1 and data.containsKey('hallName')))">
a.hallName,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DeviceEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_device
(deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime,deviceSN,deviceVersion,productCode)
(deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime,deviceSN,deviceVersion,productCode,hallId,hallName)
VALUES
(#{deviceName},#{deviceCode},#{deviceMac},#{siteId},#{siteCode},#{siteName},#{platformId},#{platformName},#{productId},#{productName},#{skinId},#{skinName},#{homeUrl},#{deviceFirmId},#{deviceFirmname},#{deviceSrc},#{deviceDataSourceWay},#{lon},#{lati},#{deviceInBuilding},#{deviceInFloor},#{defectsLiabilityPeriod},#{leadingOfficial},#{leadingOfficialTelephone},#{isReceiveMess},#{devicePhotoPath},#{ip},#{centernum},#{port},#{deviceTopic},#{deviceStatus},#{enabled},#{deviceAuthCode},#{deviceRemark},#{onlineTime},#{offlineTime},#{deleted},#{source},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{deviceSN},#{deviceVersion},#{productCode})
(#{deviceName},#{deviceCode},#{deviceMac},#{siteId},#{siteCode},#{siteName},#{platformId},#{platformName},#{productId},#{productName},#{skinId},#{skinName},#{homeUrl},#{deviceFirmId},#{deviceFirmname},#{deviceSrc},#{deviceDataSourceWay},#{lon},#{lati},#{deviceInBuilding},#{deviceInFloor},#{defectsLiabilityPeriod},#{leadingOfficial},#{leadingOfficialTelephone},#{isReceiveMess},#{devicePhotoPath},#{ip},#{centernum},#{port},#{deviceTopic},#{deviceStatus},#{enabled},#{deviceAuthCode},#{deviceRemark},#{onlineTime},#{offlineTime},#{deleted},#{source},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{deviceSN},#{deviceVersion},#{productCode},#{hallId},#{hallName})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_device
(deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime,deviceSN,deviceVersion,productCode)
(deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime,deviceSN,deviceVersion,productCode,hallId,hallName)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.deviceName},#{item.deviceCode},#{item.deviceMac},#{item.siteId},#{item.siteCode},#{item.siteName},#{item.platformId},#{item.platformName},#{item.productId},#{item.productName},#{item.skinId},#{item.skinName},#{item.homeUrl},#{item.deviceFirmId},#{item.deviceFirmname},#{item.deviceSrc},#{item.deviceDataSourceWay},#{item.lon},#{item.lati},#{item.deviceInBuilding},#{item.deviceInFloor},#{item.defectsLiabilityPeriod},#{item.leadingOfficial},#{item.leadingOfficialTelephone},#{item.isReceiveMess},#{item.devicePhotoPath},#{item.ip},#{item.centernum},#{item.port},#{item.deviceTopic},#{item.deviceStatus},#{item.enabled},#{item.deviceAuthCode},#{item.deviceRemark},#{item.onlineTime},#{item.offlineTime},#{item.deleted},#{item.source},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.deviceSN},#{item.deviceVersion},#{item.productCode})
(#{item.deviceName},#{item.deviceCode},#{item.deviceMac},#{item.siteId},#{item.siteCode},#{item.siteName},#{item.platformId},#{item.platformName},#{item.productId},#{item.productName},#{item.skinId},#{item.skinName},#{item.homeUrl},#{item.deviceFirmId},#{item.deviceFirmname},#{item.deviceSrc},#{item.deviceDataSourceWay},#{item.lon},#{item.lati},#{item.deviceInBuilding},#{item.deviceInFloor},#{item.defectsLiabilityPeriod},#{item.leadingOfficial},#{item.leadingOfficialTelephone},#{item.isReceiveMess},#{item.devicePhotoPath},#{item.ip},#{item.centernum},#{item.port},#{item.deviceTopic},#{item.deviceStatus},#{item.enabled},#{item.deviceAuthCode},#{item.deviceRemark},#{item.onlineTime},#{item.offlineTime},#{item.deleted},#{item.source},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.deviceSN},#{item.deviceVersion},#{item.productCode},#{item.hallId},#{item.hallName})
</foreach>
</insert>
......@@ -405,6 +413,15 @@
<if test="(colPickMode==0 and data.containsKey('productCode')) or (colPickMode==1 and !data.containsKey('productCode'))">
a.productCode=#{data.productCode},
</if>
<if test="(colPickMode==0 and data.containsKey('hallId')) or (colPickMode==1 and !data.containsKey('hallId'))">
a.hallId=#{data.hallId},
</if>
<if test="(colPickMode==0 and data.containsKey('hallIdIncrement')) or (colPickMode==1 and !data.containsKey('hallIdIncrement'))">
a.hallId=ifnull(a.hallId,0) + #{data.hallIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('hallName')) or (colPickMode==1 and !data.containsKey('hallName'))">
a.hallName=#{data.hallName},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -812,6 +829,25 @@
</if>
</foreach>
</trim>
<trim prefix="hallId=(case" suffix="ELSE hallId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('hallId')) or (colPickMode==1 and !item.containsKey('hallId'))">
when a.id=#{item.id} then #{item.hallId}
</when>
<when test="(colPickMode==0 and item.containsKey('hallIdIncrement')) or (colPickMode==1 and !item.containsKey('hallIdIncrement'))">
when a.id=#{item.id} then ifnull(a.hallId,0) + #{item.hallIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="hallName=(case" suffix="ELSE hallName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('hallName')) or (colPickMode==1 and !item.containsKey('hallName'))">
when a.id=#{item.id} then #{item.hallName}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -1966,6 +2002,54 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('hallId')">
<if test="conditionParamRef.hallId != null ">
${_conditionType_} a.hallId = #{${_conditionParam_}.hallId}
</if>
<if test="conditionParamRef.hallId == null">
${_conditionType_} a.hallId is null
</if>
</if>
<if test="conditionParamRef.containsKey('hallIdList') and conditionParamRef.hallIdList.size() > 0">
${_conditionType_} a.hallId in
<foreach collection="conditionParamRef.hallIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('hallIdNotList') and conditionParamRef.hallIdNotList.size() > 0">
${_conditionType_} a.hallId not in
<foreach collection="conditionParamRef.hallIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('hallIdStart') and conditionParamRef.hallIdStart != null">
${_conditionType_} a.hallId <![CDATA[ >= ]]> #{${_conditionParam_}.hallIdStart}
</if>
<if test="conditionParamRef.containsKey('hallIdEnd') and conditionParamRef.hallIdEnd != null">
${_conditionType_} a.hallId <![CDATA[ <= ]]> #{${_conditionParam_}.hallIdEnd}
</if>
<if test="conditionParamRef.containsKey('hallName')">
<if test="conditionParamRef.hallName != null and conditionParamRef.hallName != ''">
${_conditionType_} a.hallName like #{${_conditionParam_}.hallName}
</if>
<if test="conditionParamRef.hallName == null">
${_conditionType_} a.hallName is null
</if>
</if>
<if test="conditionParamRef.containsKey('hallNameList') and conditionParamRef.hallNameList.size() > 0">
${_conditionType_} a.hallName in
<foreach collection="conditionParamRef.hallNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('hallNameNotList') and conditionParamRef.hallNameNotList.size() > 0">
${_conditionType_} a.hallName not in
<foreach collection="conditionParamRef.hallNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -2209,6 +2293,16 @@
<if test='orderCol.productCode != null and "DESC".equalsIgnoreCase(orderCol.productCode)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('hallId')">
a.hallId
<if test='orderCol.hallId != null and "DESC".equalsIgnoreCase(orderCol.hallId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('hallName')">
a.hallName
<if test='orderCol.hallName != null and "DESC".equalsIgnoreCase(orderCol.hallName)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
......
......@@ -666,6 +666,9 @@ key|String|消息唯一标识|是|-
}
```
## 码表
### 响应结果码表
......
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