Commit 229f8acb authored by 赵啸非's avatar 赵啸非

修改平台编码

parent 12e00717
...@@ -55,8 +55,10 @@ CREATE TABLE mortals_xhx_platform( ...@@ -55,8 +55,10 @@ CREATE TABLE mortals_xhx_platform(
`platformName` varchar(20) NOT NULL COMMENT '平台名称,名称唯一', `platformName` varchar(20) NOT NULL COMMENT '平台名称,名称唯一',
`platformSn` varchar(256) NOT NULL COMMENT '平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码)', `platformSn` varchar(256) NOT NULL COMMENT '平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码)',
`sendMsgType` tinyint(2) NOT NULL COMMENT '发送第三方平台消息类型(0.http,1.jms)', `sendMsgType` tinyint(2) NOT NULL COMMENT '发送第三方平台消息类型(0.http,1.jms)',
`sendConfig` varchar(2048) COMMENT '发送参数配置,如发送消息地址等,xml结构,根据消息类型变化', `sendUrl` varchar(512) COMMENT '发送参数请求地址',
`callbackUrl` varchar(512) COMMENT '回调参数地址',
`sendSwitch` tinyint(2) NOT NULL COMMENT '是否启用发送消息(0.停用,1.启用)', `sendSwitch` tinyint(2) NOT NULL COMMENT '是否启用发送消息(0.停用,1.启用)',
`homeUrl` varchar(512) COMMENT '首页地址',
`platformRemark` varchar(256) COMMENT '备注', `platformRemark` varchar(256) COMMENT '备注',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户', `createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间', `createTime` datetime NOT NULL COMMENT '创建时间',
...@@ -64,6 +66,7 @@ CREATE TABLE mortals_xhx_platform( ...@@ -64,6 +66,7 @@ CREATE TABLE mortals_xhx_platform(
`updateTime` datetime COMMENT '更新时间', `updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='平台系统'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='平台系统';
-- ---------------------------- -- ----------------------------
-- 产品表 -- 产品表
-- ---------------------------- -- ----------------------------
......
package com.mortals.xhx.base.system.message; package com.mortals.xhx.base.system.message;
import com.mortals.xhx.busiz.req.DeviceReq;
import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.queue.TbQueueCallback; import com.mortals.xhx.queue.TbQueueCallback;
import com.mortals.xhx.queue.TbQueueMsgHeaders; import com.mortals.xhx.queue.TbQueueMsgHeaders;
import com.mortals.xhx.queue.TopicPartitionInfo; import com.mortals.xhx.queue.TopicPartitionInfo;
...@@ -45,4 +47,8 @@ public interface MessageService { ...@@ -45,4 +47,8 @@ public interface MessageService {
String siteTree(); String siteTree();
ApiResp<String> sendThirdParty(String sendUrl,Integer messageType, DeviceReq deviceReq);
} }
\ No newline at end of file
...@@ -10,6 +10,9 @@ import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; ...@@ -10,6 +10,9 @@ import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.HttpUtil; import com.mortals.framework.util.HttpUtil;
import com.mortals.xhx.base.system.message.MessageService; import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.busiz.req.ApiReq;
import com.mortals.xhx.busiz.req.ApiThirdPartyReq;
import com.mortals.xhx.busiz.req.DeviceReq;
import com.mortals.xhx.busiz.rsp.ApiResp; import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.common.code.ApiRespCodeEnum; import com.mortals.xhx.common.code.ApiRespCodeEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
...@@ -143,4 +146,21 @@ public class MessageServiceImpl implements MessageService { ...@@ -143,4 +146,21 @@ public class MessageServiceImpl implements MessageService {
return resp; return resp;
} }
@Override
public ApiResp<String> sendThirdParty(String sendUrl,Integer messageType, DeviceReq deviceReq) {
ApiThirdPartyReq<DeviceReq> deviceReqApiReq = new ApiThirdPartyReq<>();
deviceReqApiReq.setCode(YesNoEnum.YES.getValue());
deviceReqApiReq.setType(messageType);
String resp = null;
try {
Map<String, String> header = new HashMap<>();
header.put(HEADER_CONTENT_TYPE, "application/json");
resp = HttpUtil.doPost(sendUrl, header, JSON.toJSONString(deviceReqApiReq));
return JSON.parseObject(resp,ApiResp.class);
} catch (Exception e) {
log.error("异常:", e);
}
return null;
}
} }
\ No newline at end of file
...@@ -342,6 +342,12 @@ public class UserEntity extends UserEntityExt implements IUser { ...@@ -342,6 +342,12 @@ public class UserEntity extends UserEntityExt implements IUser {
public Long getSiteId() { public Long getSiteId() {
return this.siteId; return this.siteId;
} }
@Override
public String getSiteIds() {
return null;
}
/** /**
* 设置 站点id * 设置 站点id
* @param siteId * @param siteId
......
package com.mortals.xhx.busiz.req;
import lombok.Data;
@Data
public class ApiThirdPartyReq<T> {
/**
* 结果编码
*/
private int code;
/**
* 结果描述
*/
private String msg;
/**
* 0:设备增删改查,data数据域封装具体设备消息,1:设备消息类,数据域透传设备上行消息体。
*/
private Integer type;
/**
* 响应数据
*/
private T data;
}
...@@ -9,19 +9,27 @@ import java.io.Serializable; ...@@ -9,19 +9,27 @@ import java.io.Serializable;
@Data @Data
public class DeviceReq implements Serializable { public class DeviceReq implements Serializable {
/**
* 状态,0:新增,1:修改,2:删除,3:激活,4:上线,5:下线
*/
private Integer deviceStatus;
/**
* 平台系统编码
*/
private String platformCode;
/**
* 产品编码
*/
private String productCode;
/** /**
* 设备名称 * 设备名称
*/ */
private String deviceName; private String deviceName;
/** /**
* 设备编码(暂定mac地址) * 设备编码(暂定mac地址)
*/ */
private String deviceCode; private String deviceCode;
/**
* mac地址
*/
private String deviceMac;
/** /**
* 所属站点编码 * 所属站点编码
*/ */
...@@ -30,33 +38,10 @@ public class DeviceReq implements Serializable { ...@@ -30,33 +38,10 @@ public class DeviceReq implements Serializable {
* 所属站点名称 * 所属站点名称
*/ */
private String siteName; private String siteName;
/**
* 设备ip
*/
private String ip;
/**
* 设备端口
*/
private String port;
/**
* 平台id
*/
private Long platformId;
/**
* 产品Id
*/
private Long productId;
/** /**
* 设备备注信息 * 设备备注信息
*/ */
private String deviceRemark; private String deviceRemark;
public static void main(String[] args) {
// DeviceReq deviceReq = new DeviceReq();
// deviceReq.setIsAdmin();
// deviceReq.seti
}
} }
...@@ -53,7 +53,6 @@ import java.util.stream.Collectors; ...@@ -53,7 +53,6 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
@RequestMapping("/api") @RequestMapping("/api")
public class DeviceApiController { public class DeviceApiController {
@Autowired @Autowired
private DeviceService deviceService; private DeviceService deviceService;
@Autowired @Autowired
...@@ -64,7 +63,6 @@ public class DeviceApiController { ...@@ -64,7 +63,6 @@ public class DeviceApiController {
private IAuthTokenService authTokenService; private IAuthTokenService authTokenService;
@Autowired @Autowired
private PlatformService platformService; private PlatformService platformService;
@Value("${queue.rabbitmq.virtual_host:}") @Value("${queue.rabbitmq.virtual_host:}")
private String virtualHost; private String virtualHost;
@Value("${queue.rabbitmq.password:}") @Value("${queue.rabbitmq.password:}")
......
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 设备状态,1:新增,2:修改,3:删除,4:激活,5:上线,6:下线
*
* @author zxfei
*/
public enum DeviceStatusEnum {
ADD(1, "新增"),
UPDATE(2, "修改"),
DEL(3, "删除"),
ACTIVE(4, "激活"),
ONLINE(5, "上线"),
OFFLINE(6, "下线");
private Integer value;
private String desc;
DeviceStatusEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static DeviceStatusEnum getByValue(Integer value) {
for (DeviceStatusEnum deviceTypeEnum : DeviceStatusEnum.values()) {
if (deviceTypeEnum.getValue() == value) {
return deviceTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (DeviceStatusEnum item : DeviceStatusEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
public enum MessageTypeEnum {
CRUD(0, "设备增删改查"),
TRANSACTION(1, "设备消息类,数据域透传设备上行消息体");
private Integer value;
private String desc;
MessageTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static MessageTypeEnum getByValue(Integer value) {
for (MessageTypeEnum sendMsgTypeEnum : MessageTypeEnum.values()) {
if (sendMsgTypeEnum.getValue() == value) {
return sendMsgTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (MessageTypeEnum item : MessageTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.key;
/**
* 错误码
*
* @author: zxfei
* @date: 2022/5/12 14:56
*/
public interface ErrorCode {
public static final int STATUS_MS_EXCEPTION = 500;
public static final int STATUS_VALIDATE_EXCEPTION = 420;
public static final int STATUS_UNCHECKED_EXCEPTION = 605;
public static final int STATUS_TOKEN_NULL_EXCEPTION = 604;
public static final int STATUS_CODE_SUCCESS = 0;
public static final int STATUS_CODE_WARN = 1;
public static final int STATUS_CODE_ERROR = 2;
public static final int STATUS_CODE_INFO = 3;
public static final int STATUS_CODE_TOKEN_EXPIRED = 4;
public static final int STATUS_CODE_FATAL = 5;
public static final int STATUS_CODE_TRADE_PWD_NOT_SET = 6;
public static final int STATUS_ACCOUNT_LOCKED = 7;
public static final int STATUS_TRADE_PWD_OVER_THREE_TIME = 8;
public static final int STATUS_TRADE_PWD_ERROR = 9;
public static final int STATUS_EMPTY_PWD_ERROR = 10;
public static final int STATUS_TEL_NOT_RGI_ERROR = 11;
public static final int STATUS_TEL_ALREADY_REGI = 12;
public static final int STATUS_SAFETY_RISK = 13;
public static final int STATUS_LOGIN_CODE = 15;
public static final int BOOK_FAKUAN_CODE = 16;//还有未付款的订单code
public static final String ERROR_TOKEN_EXPIRED = "登陆过期,请重新登录";
public static final String ERROR_TRADE_PWD_OVER_THREE_TIME = "支付密码错误,请15分钟后再试";
public static final String ERROR_TRADE_PWD_ERROR = "支付密码错误,请重试";
public static final String ERROR_EMPTY_PWD_ERROR = "请设置登录密码";
public static final String ERROR_TEL_NOT_RGI = "该号码未注册";
public static final String ERROR_USERNAME_OR_PASSWORD = "用户名或者密码错误";
public static final String ERROR_TRADE_PWD = "交易密码错误";
public static final String ERROR_FORBIDDEN_OPER = "非法操作";
public static final String ERROR_TRADE_PWD_NOT_SET = "非法操作";
public static final String ERROR_NOT_REAL_NAME_AUTH = "您未实名认证,禁止该操作";
public static final String ERROR_INTERNAL_SERVER_ERROR = "服务器内部错误";
public static final String ERROR_UNAUTHORIZED = "token不正确或已过期";
public static final String ERROR_TOKEN_IS_NULL = "token不能为空";
public static final String ERROR_MISS_SERVLET = "服务不存在";
public static final String ERROR_CAPTCHA_OFTEN = "验证码已发送";
public static final String ERROR_CAPTCHA_WRONG = "验证码错误";
public static final String ERROR_TEL_ALREADY_REGI = "该手机号已被注册";
public static final String ERROR_CODE_DUPLICATE_KEY = "重复添加信息(含部分)";
public static final String ERROR_NOT_EXITS = "对应记录不存在";
public static final String ERROR_STATUS_CATEGORY = "状态错误";
public static final String ERROR_FRIEND_SHIP_ALREADY = "已经是你好友";
public static final String ERROR_FRIEND_SHIP_WAIT = "已向改好友发出邀请,等待接受";
public static final String ERROR_CODE_ACCOUNT_LOCKED = "账号被锁定,请联系客服";
public static final String WARN_ARGUMENT = "参数错误";
public static final String ERROR_USERNAME_EXIST = "该号码已被注册";
public static final String ERROR_SAFETY_RISK = "不在常用设备上登录";
public static final String INFO_TEL_BIND = "手机号码已经被绑定";
public static final String INFO_TEL_FORMAT_WRONG = "手机号码格式不正确";
public static final String ERROR_NOT_FOUND = "404 not found";
public static final String DISABLED="该账号已被封禁,如有疑问请联系平台";
public static final String DATENULL="缺少参数";
public static final String ERRDATE="无效参数";
public static final String ERRSTAE="状态异常";
public static final String EXTDATE="参数异常";
public static final String NUMEXE="账号异常";
public static final String CAPDON="资产已被冻结,如有疑问请联系平台";
public static final String CONOTS="操作失败";
public static final String OK="成功!";
public static final String TOKENX="身份验证失败,请重新登录";
public static final String CAPNOT="充值余额不足请充值";
public static final String SYSNOT="系统繁忙,请稍后再试...";
public static final String NOWER="没有权限";
public static final String PAGEDATA="分页参数不能为空";
public static final String CARADD_MEMBERS="该司机已有绑定车辆,不能绑定多个";
}
package com.mortals.xhx.common.key;
/**
*
*
* @author: zxfei
* @date: 2022/5/12 14:57
*/
public class HttpStatus {
/**
* 操作成功
*/
public static final int SUCCESS = 200;
/**
* 对象创建成功
*/
public static final int CREATED = 201;
/**
* 请求已经被接受
*/
public static final int ACCEPTED = 202;
/**
* 操作已经执行成功,但是没有返回数据
*/
public static final int NO_CONTENT = 204;
/**
* 资源已被移除
*/
public static final int MOVED_PERM = 301;
/**
* 重定向
*/
public static final int SEE_OTHER = 303;
/**
* 资源没有被修改
*/
public static final int NOT_MODIFIED = 304;
/**
* 参数列表错误(缺少,格式不匹配)
*/
public static final int BAD_REQUEST = 400;
/**
* 未授权
*/
public static final int UNAUTHORIZED = 401;
/**
* 访问受限,授权过期
*/
public static final int FORBIDDEN = 403;
/**
* 资源,服务未找到
*/
public static final int NOT_FOUND = 404;
/**
* 不允许的http方法
*/
public static final int BAD_METHOD = 405;
/**
* 资源冲突,或者资源被锁
*/
public static final int CONFLICT = 409;
/**
* 不支持的数据,媒体类型
*/
public static final int UNSUPPORTED_TYPE = 415;
/**
* 系统内部错误
*/
public static final int ERROR = 500;
/**
* 接口未实现
*/
public static final int NOT_IMPLEMENTED = 501;
}
...@@ -24,7 +24,12 @@ public interface DeviceService extends ICRUDCacheService<DeviceEntity,Long>{ ...@@ -24,7 +24,12 @@ public interface DeviceService extends ICRUDCacheService<DeviceEntity,Long>{
ApiResp<String> sendDeviceMessage(List<Long> deviceIds, TopicPartitionInfo info,TbQueueMsgHeaders header, String message , Context context); ApiResp<String> sendDeviceMessage(List<Long> deviceIds, TopicPartitionInfo info,TbQueueMsgHeaders header, String message , Context context);
/**
* 设备激活
* @param deviceCode
* @param context
*/
void active(String deviceCode,Context context);
} }
\ No newline at end of file
package com.mortals.xhx.module.device.service.impl; package com.mortals.xhx.module.device.service.impl;
import cn.hutool.core.lang.PatternPool;
import cn.hutool.http.HttpUtil;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.base.system.message.MessageService; import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.busiz.req.DeviceReq;
import com.mortals.xhx.busiz.rsp.ApiResp; import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.common.code.ApiRespCodeEnum; import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.key.Constant; import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.device.dao.DeviceDao; import com.mortals.xhx.module.device.dao.DeviceDao;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceQuery; import com.mortals.xhx.module.device.model.DeviceQuery;
...@@ -17,6 +21,7 @@ import com.mortals.xhx.module.product.model.ProductEntity; ...@@ -17,6 +21,7 @@ import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.product.service.ProductService; import com.mortals.xhx.module.product.service.ProductService;
import com.mortals.xhx.queue.*; import com.mortals.xhx.queue.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -55,10 +60,10 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -55,10 +60,10 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Override @Override
protected void validData(DeviceEntity entity, Context context) throws AppException { protected void validData(DeviceEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getPlatformId())){ if (!ObjectUtils.isEmpty(entity.getPlatformId())) {
throw new AppException("所属平台不能为空!"); throw new AppException("所属平台不能为空!");
} }
if(!ObjectUtils.isEmpty(entity.getProductId())){ if (!ObjectUtils.isEmpty(entity.getProductId())) {
throw new AppException("所属产品不能为空!"); throw new AppException("所属产品不能为空!");
} }
...@@ -75,11 +80,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -75,11 +80,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
public void onSuccess(TbQueueMsgMetadata metadata) { public void onSuccess(TbQueueMsgMetadata metadata) {
log.info("消息投递成功,设备通道编码:" + deviceEntity.getDeviceMac()); log.info("消息投递成功,设备通道编码:" + deviceEntity.getDeviceMac());
} }
@Override @Override
public void onFailure(Throwable t) { public void onFailure(Throwable t) {
log.error("消息投递成功,设备通道编码:" + deviceEntity.getDeviceMac(), t); log.error("消息投递成功,设备通道编码:" + deviceEntity.getDeviceMac(), t);
} }
}; };
messageService.send(info, header, message, callback); messageService.send(info, header, message, callback);
...@@ -98,6 +101,33 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -98,6 +101,33 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
return resp; return resp;
} }
@Override
public void active(String deviceCode, Context context) {
DeviceEntity deviceEntity = this.selectOne(new DeviceQuery().deviceCode(deviceCode));
if (!ObjectUtils.isEmpty(deviceEntity)) throw new AppException("当前设备不存在!");
if (deviceEntity.getActive() == ActiveEnum.已激活.getValue()) throw new AppException("当前设备已激活!");
deviceEntity.setActive(ActiveEnum.已激活.getValue());
this.update(deviceEntity, context);
PlatformEntity platformEntity = platformService.get(deviceEntity.getPlatformId());
ProductEntity productEntity = productService.get(deviceEntity.getProductId());
if (!ObjectUtils.isEmpty(platformEntity) && !ObjectUtils.isEmpty(productEntity)) {
//新增设备通知第三方平台
DeviceReq deviceReq = new DeviceReq();
BeanUtils.copyProperties(deviceEntity, deviceReq, BeanUtil.getNullPropertyNames(deviceEntity));
deviceReq.setDeviceStatus(DeviceStatusEnum.ACTIVE.getValue());
deviceReq.setProductCode(productEntity.getProductCode());
deviceReq.setPlatformCode(platformEntity.getPlatformSn());
if (!ObjectUtils.isEmpty(platformEntity.getSendUrl()) && platformEntity.getSendSwitch() == SendSwitchEnum.启用.getValue()) {
if (PatternPool.URL_HTTP.matcher(platformEntity.getSendUrl()).find()) {
ApiResp<String> resp = messageService.sendThirdParty(platformEntity.getSendUrl(), MessageTypeEnum.CRUD.getValue(), deviceReq);
} else {
throw new AppException("http send url 不合法!" + platformEntity.getSendUrl());
}
}
}
}
@Override @Override
protected void saveAfter(DeviceEntity entity, Context context) throws AppException { protected void saveAfter(DeviceEntity entity, Context context) throws AppException {
...@@ -128,15 +158,50 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -128,15 +158,50 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
//创建下行队列 //创建下行队列
info = TopicPartitionInfo.builder().exchangeName(exchangeName).topic(Constant.DOWN_TOPIC + entity.getDeviceCode()).build(); info = TopicPartitionInfo.builder().exchangeName(exchangeName).topic(Constant.DOWN_TOPIC + entity.getDeviceCode()).build();
messageService.queueDeclare(info, callback); messageService.queueDeclare(info, callback);
//新增设备通知第三方平台
DeviceReq deviceReq = new DeviceReq();
BeanUtils.copyProperties(entity, deviceReq, BeanUtil.getNullPropertyNames(entity));
deviceReq.setDeviceStatus(DeviceStatusEnum.ADD.getValue());
deviceReq.setProductCode(productEntity.getProductCode());
deviceReq.setPlatformCode(platformEntity.getPlatformSn());
if (!ObjectUtils.isEmpty(platformEntity.getSendUrl()) && platformEntity.getSendSwitch() == SendSwitchEnum.启用.getValue()) {
if (PatternPool.URL_HTTP.matcher(platformEntity.getSendUrl()).find()) {
ApiResp<String> resp = messageService.sendThirdParty(platformEntity.getSendUrl(), MessageTypeEnum.CRUD.getValue(), deviceReq);
} else {
throw new AppException("http send url 不合法!" + platformEntity.getSendUrl());
}
}
} else { } else {
throw new AppException("产品或平台不存在!"); throw new AppException("产品或平台不存在!");
} }
super.saveAfter(entity, context); super.saveAfter(entity, context);
} }
@Override
protected void updateAfter(DeviceEntity entity, Context context) throws AppException {
PlatformEntity platformEntity = platformService.get(entity.getPlatformId());
ProductEntity productEntity = productService.get(entity.getProductId());
if (!ObjectUtils.isEmpty(platformEntity) && !ObjectUtils.isEmpty(productEntity)) {
//新增设备通知第三方平台
DeviceReq deviceReq = new DeviceReq();
BeanUtils.copyProperties(entity, deviceReq, BeanUtil.getNullPropertyNames(entity));
deviceReq.setDeviceStatus(DeviceStatusEnum.UPDATE.getValue());
deviceReq.setProductCode(productEntity.getProductCode());
deviceReq.setPlatformCode(platformEntity.getPlatformSn());
if (!ObjectUtils.isEmpty(platformEntity.getSendUrl()) && platformEntity.getSendSwitch() == SendSwitchEnum.启用.getValue()) {
if (PatternPool.URL_HTTP.matcher(platformEntity.getSendUrl()).find()) {
ApiResp<String> resp = messageService.sendThirdParty(platformEntity.getSendUrl(), MessageTypeEnum.CRUD.getValue(), deviceReq);
} else {
throw new AppException("http send url 不合法!" + platformEntity.getSendUrl());
}
}
}
super.updateAfter(entity, context);
}
@Override @Override
protected void removeBefore(Long[] ids, Context context) throws AppException { protected void removeBefore(Long[] ids, Context context) throws AppException {
Arrays.asList(ids).stream().forEach(id -> { Arrays.asList(ids).stream().forEach(id -> {
...@@ -146,14 +211,35 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -146,14 +211,35 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
public void onSuccess(TbQueueMsgMetadata metadata) { public void onSuccess(TbQueueMsgMetadata metadata) {
log.info("队列删除成功"); log.info("队列删除成功");
} }
@Override @Override
public void onFailure(Throwable t) { public void onFailure(Throwable t) {
log.error("队列删除失败", t); log.error("队列删除失败", t);
} }
}; };
messageService.delQueue(Constant.UPLOAD_TOPIC + deviceEntity.getDeviceCode(),callback); messageService.delQueue(Constant.UPLOAD_TOPIC + deviceEntity.getDeviceCode(), callback);
messageService.delQueue(Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(),callback); messageService.delQueue(Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(), callback);
PlatformEntity platformEntity = platformService.get(deviceEntity.getPlatformId());
ProductEntity productEntity = productService.get(deviceEntity.getProductId());
if (!ObjectUtils.isEmpty(platformEntity) && !ObjectUtils.isEmpty(productEntity)) {
//新增设备通知第三方平台
DeviceReq deviceReq = new DeviceReq();
BeanUtils.copyProperties(deviceEntity, deviceReq, BeanUtil.getNullPropertyNames(deviceEntity));
deviceReq.setDeviceStatus(DeviceStatusEnum.DEL.getValue());
deviceReq.setProductCode(productEntity.getProductCode());
deviceReq.setPlatformCode(platformEntity.getPlatformSn());
if (!ObjectUtils.isEmpty(platformEntity.getSendUrl()) && platformEntity.getSendSwitch() == SendSwitchEnum.启用.getValue()) {
if (PatternPool.URL_HTTP.matcher(platformEntity.getSendUrl()).find()) {
ApiResp<String> resp = messageService.sendThirdParty(platformEntity.getSendUrl(), MessageTypeEnum.CRUD.getValue(), deviceReq);
} else {
throw new AppException("http send url 不合法!" + platformEntity.getSendUrl());
}
}
}
}); });
super.removeBefore(ids, context); super.removeBefore(ids, context);
......
...@@ -7,125 +7,161 @@ import com.mortals.framework.annotation.Excel; ...@@ -7,125 +7,161 @@ import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.platform.model.vo.PlatformVo; import com.mortals.xhx.module.platform.model.vo.PlatformVo;
/** /**
* 平台系统实体对象 * 平台系统实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-04-25 * @date 2022-05-30
*/ */
public class PlatformEntity extends PlatformVo { public class PlatformEntity extends PlatformVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 平台名称,名称唯一 * 平台名称,名称唯一
*/ */
@Excel(name = "平台名称,名称唯一") @Excel(name = "平台名称,名称唯一")
private String platformName; private String platformName;
/** /**
* 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码) * 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码)
*/ */
private String platformSn; private String platformSn;
/** /**
* 发送第三方平台消息类型(0.http,1.jms) * 发送第三方平台消息类型(0.http,1.jms)
*/ */
private Integer sendMsgType; private Integer sendMsgType;
/** /**
* 发送参数配置,如发送消息地址等,xml结构,根据消息类型变化 * 发送参数请求地址
*/ */
private String sendConfig; private String sendUrl;
/** /**
* 是否启用发送消息(0.停用,1.启用) * 回调参数地址
*/ */
private String callbackUrl;
/**
* 是否启用发送消息(0.停用,1.启用)
*/
private Integer sendSwitch; private Integer sendSwitch;
/** /**
* 备注 * 首页地址
*/ */
private String homeUrl;
/**
* 备注
*/
private String platformRemark; private String platformRemark;
public PlatformEntity(){} public PlatformEntity(){}
/** /**
* 获取 平台名称,名称唯一 * 获取 平台名称,名称唯一
* @return String * @return String
*/ */
public String getPlatformName(){ public String getPlatformName(){
return platformName; return platformName;
} }
/** /**
* 设置 平台名称,名称唯一 * 设置 平台名称,名称唯一
* @param platformName * @param platformName
*/ */
public void setPlatformName(String platformName){ public void setPlatformName(String platformName){
this.platformName = platformName; this.platformName = platformName;
} }
/** /**
* 获取 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码) * 获取 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码)
* @return String * @return String
*/ */
public String getPlatformSn(){ public String getPlatformSn(){
return platformSn; return platformSn;
} }
/** /**
* 设置 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码) * 设置 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码)
* @param platformSn * @param platformSn
*/ */
public void setPlatformSn(String platformSn){ public void setPlatformSn(String platformSn){
this.platformSn = platformSn; this.platformSn = platformSn;
} }
/** /**
* 获取 发送第三方平台消息类型(0.http,1.jms) * 获取 发送第三方平台消息类型(0.http,1.jms)
* @return Integer * @return Integer
*/ */
public Integer getSendMsgType(){ public Integer getSendMsgType(){
return sendMsgType; return sendMsgType;
} }
/** /**
* 设置 发送第三方平台消息类型(0.http,1.jms) * 设置 发送第三方平台消息类型(0.http,1.jms)
* @param sendMsgType * @param sendMsgType
*/ */
public void setSendMsgType(Integer sendMsgType){ public void setSendMsgType(Integer sendMsgType){
this.sendMsgType = sendMsgType; this.sendMsgType = sendMsgType;
} }
/** /**
* 获取 发送参数配置,如发送消息地址等,xml结构,根据消息类型变化 * 获取 发送参数请求地址
* @return String * @return String
*/ */
public String getSendConfig(){ public String getSendUrl(){
return sendConfig; return sendUrl;
}
/**
* 设置 发送参数请求地址
* @param sendUrl
*/
public void setSendUrl(String sendUrl){
this.sendUrl = sendUrl;
}
/**
* 获取 回调参数地址
* @return String
*/
public String getCallbackUrl(){
return callbackUrl;
} }
/** /**
* 设置 发送参数配置,如发送消息地址等,xml结构,根据消息类型变化 * 设置 回调参数地址
* @param sendConfig * @param callbackUrl
*/ */
public void setSendConfig(String sendConfig){ public void setCallbackUrl(String callbackUrl){
this.sendConfig = sendConfig; this.callbackUrl = callbackUrl;
} }
/** /**
* 获取 是否启用发送消息(0.停用,1.启用) * 获取 是否启用发送消息(0.停用,1.启用)
* @return Integer * @return Integer
*/ */
public Integer getSendSwitch(){ public Integer getSendSwitch(){
return sendSwitch; return sendSwitch;
} }
/** /**
* 设置 是否启用发送消息(0.停用,1.启用) * 设置 是否启用发送消息(0.停用,1.启用)
* @param sendSwitch * @param sendSwitch
*/ */
public void setSendSwitch(Integer sendSwitch){ public void setSendSwitch(Integer sendSwitch){
this.sendSwitch = sendSwitch; this.sendSwitch = sendSwitch;
} }
/** /**
* 获取 备注 * 获取 首页地址
* @return String * @return String
*/ */
public String getHomeUrl(){
return homeUrl;
}
/**
* 设置 首页地址
* @param homeUrl
*/
public void setHomeUrl(String homeUrl){
this.homeUrl = homeUrl;
}
/**
* 获取 备注
* @return String
*/
public String getPlatformRemark(){ public String getPlatformRemark(){
return platformRemark; return platformRemark;
} }
/** /**
* 设置 备注 * 设置 备注
* @param platformRemark * @param platformRemark
*/ */
public void setPlatformRemark(String platformRemark){ public void setPlatformRemark(String platformRemark){
this.platformRemark = platformRemark; this.platformRemark = platformRemark;
} }
...@@ -135,7 +171,7 @@ public class PlatformEntity extends PlatformVo { ...@@ -135,7 +171,7 @@ public class PlatformEntity extends PlatformVo {
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
...@@ -143,7 +179,7 @@ public class PlatformEntity extends PlatformVo { ...@@ -143,7 +179,7 @@ public class PlatformEntity extends PlatformVo {
if (obj instanceof PlatformEntity) { if (obj instanceof PlatformEntity) {
PlatformEntity tmp = (PlatformEntity) obj; PlatformEntity tmp = (PlatformEntity) obj;
if (this.getId() == tmp.getId()) { if (this.getId() == tmp.getId()) {
return true; return true;
} }
} }
return false; return false;
...@@ -154,24 +190,30 @@ public class PlatformEntity extends PlatformVo { ...@@ -154,24 +190,30 @@ public class PlatformEntity extends PlatformVo {
sb.append(",platformName:").append(getPlatformName()); sb.append(",platformName:").append(getPlatformName());
sb.append(",platformSn:").append(getPlatformSn()); sb.append(",platformSn:").append(getPlatformSn());
sb.append(",sendMsgType:").append(getSendMsgType()); sb.append(",sendMsgType:").append(getSendMsgType());
sb.append(",sendConfig:").append(getSendConfig()); sb.append(",sendUrl:").append(getSendUrl());
sb.append(",callbackUrl:").append(getCallbackUrl());
sb.append(",sendSwitch:").append(getSendSwitch()); sb.append(",sendSwitch:").append(getSendSwitch());
sb.append(",homeUrl:").append(getHomeUrl());
sb.append(",platformRemark:").append(getPlatformRemark()); sb.append(",platformRemark:").append(getPlatformRemark());
return sb.toString(); return sb.toString();
} }
public void initAttrValue(){ public void initAttrValue(){
this.platformName = ""; this.platformName = "";
this.platformSn = "";
this.sendMsgType = 0;
this.platformSn = ""; this.sendUrl = "";
this.sendMsgType = 0; this.callbackUrl = "";
this.sendConfig = ""; this.sendSwitch = 0;
this.sendSwitch = 0; this.homeUrl = "";
this.platformRemark = ""; this.platformRemark = "";
} }
} }
\ No newline at end of file
...@@ -3,11 +3,11 @@ package com.mortals.xhx.module.platform.model; ...@@ -3,11 +3,11 @@ package com.mortals.xhx.module.platform.model;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.platform.model.PlatformEntity; import com.mortals.xhx.module.platform.model.PlatformEntity;
/** /**
* 平台系统查询对象 * 平台系统查询对象
* *
* @author zxfei * @author zxfei
* @date 2022-04-25 * @date 2022-05-30
*/ */
public class PlatformQuery extends PlatformEntity { public class PlatformQuery extends PlatformEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -39,8 +39,11 @@ public class PlatformQuery extends PlatformEntity { ...@@ -39,8 +39,11 @@ public class PlatformQuery extends PlatformEntity {
/** 发送第三方平台消息类型(0.http,1.jms)列表 */ /** 发送第三方平台消息类型(0.http,1.jms)列表 */
private List <Integer> sendMsgTypeList; private List <Integer> sendMsgTypeList;
/** 发送参数配置,如发送消息地址等,xml结构,根据消息类型变化 */ /** 发送参数请求地址 */
private List<String> sendConfigList; private List<String> sendUrlList;
/** 回调参数地址 */
private List<String> callbackUrlList;
/** 开始 是否启用发送消息(0.停用,1.启用) */ /** 开始 是否启用发送消息(0.停用,1.启用) */
private Integer sendSwitchStart; private Integer sendSwitchStart;
...@@ -54,6 +57,9 @@ public class PlatformQuery extends PlatformEntity { ...@@ -54,6 +57,9 @@ public class PlatformQuery extends PlatformEntity {
/** 是否启用发送消息(0.停用,1.启用)列表 */ /** 是否启用发送消息(0.停用,1.启用)列表 */
private List <Integer> sendSwitchList; private List <Integer> sendSwitchList;
/** 首页地址 */
private List<String> homeUrlList;
/** 备注 */ /** 备注 */
private List<String> platformRemarkList; private List<String> platformRemarkList;
...@@ -102,780 +108,848 @@ public class PlatformQuery extends PlatformEntity { ...@@ -102,780 +108,848 @@ public class PlatformQuery extends PlatformEntity {
public PlatformQuery(){} public PlatformQuery(){}
/** /**
* 获取 开始 主键ID,主键,自增长 * 获取 开始 主键ID,主键,自增长
* @return idStart * @return idStart
*/ */
public Long getIdStart(){ public Long getIdStart(){
return this.idStart; return this.idStart;
} }
/** /**
* 设置 开始 主键ID,主键,自增长 * 设置 开始 主键ID,主键,自增长
* @param idStart * @param idStart
*/ */
public void setIdStart(Long idStart){ public void setIdStart(Long idStart){
this.idStart = idStart; this.idStart = idStart;
} }
/** /**
* 获取 结束 主键ID,主键,自增长 * 获取 结束 主键ID,主键,自增长
* @return $idEnd * @return $idEnd
*/ */
public Long getIdEnd(){ public Long getIdEnd(){
return this.idEnd; return this.idEnd;
} }
/** /**
* 设置 结束 主键ID,主键,自增长 * 设置 结束 主键ID,主键,自增长
* @param idEnd * @param idEnd
*/ */
public void setIdEnd(Long idEnd){ public void setIdEnd(Long idEnd){
this.idEnd = idEnd; this.idEnd = idEnd;
} }
/** /**
* 获取 增加 主键ID,主键,自增长 * 获取 增加 主键ID,主键,自增长
* @return idIncrement * @return idIncrement
*/ */
public Long getIdIncrement(){ public Long getIdIncrement(){
return this.idIncrement; return this.idIncrement;
} }
/** /**
* 设置 增加 主键ID,主键,自增长 * 设置 增加 主键ID,主键,自增长
* @param idIncrement * @param idIncrement
*/ */
public void setIdIncrement(Long idIncrement){ public void setIdIncrement(Long idIncrement){
this.idIncrement = idIncrement; this.idIncrement = idIncrement;
} }
/** /**
* 获取 主键ID,主键,自增长 * 获取 主键ID,主键,自增长
* @return idList * @return idList
*/ */
public List<Long> getIdList(){ public List<Long> getIdList(){
return this.idList; return this.idList;
} }
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param idList * @param idList
*/ */
public void setIdList(List<Long> idList){ public void setIdList(List<Long> idList){
this.idList = idList; this.idList = idList;
} }
/** /**
* 获取 平台名称,名称唯一 * 获取 平台名称,名称唯一
* @return platformNameList * @return platformNameList
*/ */
public List<String> getPlatformNameList(){ public List<String> getPlatformNameList(){
return this.platformNameList; return this.platformNameList;
} }
/** /**
* 设置 平台名称,名称唯一 * 设置 平台名称,名称唯一
* @param platformNameList * @param platformNameList
*/ */
public void setPlatformNameList(List<String> platformNameList){ public void setPlatformNameList(List<String> platformNameList){
this.platformNameList = platformNameList; this.platformNameList = platformNameList;
} }
/** /**
* 获取 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码) * 获取 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码)
* @return platformSnList * @return platformSnList
*/ */
public List<String> getPlatformSnList(){ public List<String> getPlatformSnList(){
return this.platformSnList; return this.platformSnList;
} }
/** /**
* 设置 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码) * 设置 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码)
* @param platformSnList * @param platformSnList
*/ */
public void setPlatformSnList(List<String> platformSnList){ public void setPlatformSnList(List<String> platformSnList){
this.platformSnList = platformSnList; this.platformSnList = platformSnList;
} }
/** /**
* 获取 开始 发送第三方平台消息类型(0.http,1.jms) * 获取 开始 发送第三方平台消息类型(0.http,1.jms)
* @return sendMsgTypeStart * @return sendMsgTypeStart
*/ */
public Integer getSendMsgTypeStart(){ public Integer getSendMsgTypeStart(){
return this.sendMsgTypeStart; return this.sendMsgTypeStart;
} }
/** /**
* 设置 开始 发送第三方平台消息类型(0.http,1.jms) * 设置 开始 发送第三方平台消息类型(0.http,1.jms)
* @param sendMsgTypeStart * @param sendMsgTypeStart
*/ */
public void setSendMsgTypeStart(Integer sendMsgTypeStart){ public void setSendMsgTypeStart(Integer sendMsgTypeStart){
this.sendMsgTypeStart = sendMsgTypeStart; this.sendMsgTypeStart = sendMsgTypeStart;
} }
/** /**
* 获取 结束 发送第三方平台消息类型(0.http,1.jms) * 获取 结束 发送第三方平台消息类型(0.http,1.jms)
* @return $sendMsgTypeEnd * @return $sendMsgTypeEnd
*/ */
public Integer getSendMsgTypeEnd(){ public Integer getSendMsgTypeEnd(){
return this.sendMsgTypeEnd; return this.sendMsgTypeEnd;
} }
/** /**
* 设置 结束 发送第三方平台消息类型(0.http,1.jms) * 设置 结束 发送第三方平台消息类型(0.http,1.jms)
* @param sendMsgTypeEnd * @param sendMsgTypeEnd
*/ */
public void setSendMsgTypeEnd(Integer sendMsgTypeEnd){ public void setSendMsgTypeEnd(Integer sendMsgTypeEnd){
this.sendMsgTypeEnd = sendMsgTypeEnd; this.sendMsgTypeEnd = sendMsgTypeEnd;
} }
/** /**
* 获取 增加 发送第三方平台消息类型(0.http,1.jms) * 获取 增加 发送第三方平台消息类型(0.http,1.jms)
* @return sendMsgTypeIncrement * @return sendMsgTypeIncrement
*/ */
public Integer getSendMsgTypeIncrement(){ public Integer getSendMsgTypeIncrement(){
return this.sendMsgTypeIncrement; return this.sendMsgTypeIncrement;
} }
/** /**
* 设置 增加 发送第三方平台消息类型(0.http,1.jms) * 设置 增加 发送第三方平台消息类型(0.http,1.jms)
* @param sendMsgTypeIncrement * @param sendMsgTypeIncrement
*/ */
public void setSendMsgTypeIncrement(Integer sendMsgTypeIncrement){ public void setSendMsgTypeIncrement(Integer sendMsgTypeIncrement){
this.sendMsgTypeIncrement = sendMsgTypeIncrement; this.sendMsgTypeIncrement = sendMsgTypeIncrement;
} }
/** /**
* 获取 发送第三方平台消息类型(0.http,1.jms) * 获取 发送第三方平台消息类型(0.http,1.jms)
* @return sendMsgTypeList * @return sendMsgTypeList
*/ */
public List<Integer> getSendMsgTypeList(){ public List<Integer> getSendMsgTypeList(){
return this.sendMsgTypeList; return this.sendMsgTypeList;
} }
/** /**
* 设置 发送第三方平台消息类型(0.http,1.jms) * 设置 发送第三方平台消息类型(0.http,1.jms)
* @param sendMsgTypeList * @param sendMsgTypeList
*/ */
public void setSendMsgTypeList(List<Integer> sendMsgTypeList){ public void setSendMsgTypeList(List<Integer> sendMsgTypeList){
this.sendMsgTypeList = sendMsgTypeList; this.sendMsgTypeList = sendMsgTypeList;
} }
/** /**
* 获取 发送参数配置,如发送消息地址等,xml结构,根据消息类型变化 * 获取 发送参数请求地址
* @return sendConfigList * @return sendUrlList
*/ */
public List<String> getSendConfigList(){ public List<String> getSendUrlList(){
return this.sendConfigList; return this.sendUrlList;
} }
/** /**
* 设置 发送参数配置,如发送消息地址等,xml结构,根据消息类型变化 * 设置 发送参数请求地址
* @param sendConfigList * @param sendUrlList
*/ */
public void setSendConfigList(List<String> sendConfigList){ public void setSendUrlList(List<String> sendUrlList){
this.sendConfigList = sendConfigList; this.sendUrlList = sendUrlList;
} }
/** /**
* 获取 开始 是否启用发送消息(0.停用,1.启用) * 获取 回调参数地址
* @return sendSwitchStart * @return callbackUrlList
*/ */
public List<String> getCallbackUrlList(){
return this.callbackUrlList;
}
/**
* 设置 回调参数地址
* @param callbackUrlList
*/
public void setCallbackUrlList(List<String> callbackUrlList){
this.callbackUrlList = callbackUrlList;
}
/**
* 获取 开始 是否启用发送消息(0.停用,1.启用)
* @return sendSwitchStart
*/
public Integer getSendSwitchStart(){ public Integer getSendSwitchStart(){
return this.sendSwitchStart; return this.sendSwitchStart;
} }
/** /**
* 设置 开始 是否启用发送消息(0.停用,1.启用) * 设置 开始 是否启用发送消息(0.停用,1.启用)
* @param sendSwitchStart * @param sendSwitchStart
*/ */
public void setSendSwitchStart(Integer sendSwitchStart){ public void setSendSwitchStart(Integer sendSwitchStart){
this.sendSwitchStart = sendSwitchStart; this.sendSwitchStart = sendSwitchStart;
} }
/** /**
* 获取 结束 是否启用发送消息(0.停用,1.启用) * 获取 结束 是否启用发送消息(0.停用,1.启用)
* @return $sendSwitchEnd * @return $sendSwitchEnd
*/ */
public Integer getSendSwitchEnd(){ public Integer getSendSwitchEnd(){
return this.sendSwitchEnd; return this.sendSwitchEnd;
} }
/** /**
* 设置 结束 是否启用发送消息(0.停用,1.启用) * 设置 结束 是否启用发送消息(0.停用,1.启用)
* @param sendSwitchEnd * @param sendSwitchEnd
*/ */
public void setSendSwitchEnd(Integer sendSwitchEnd){ public void setSendSwitchEnd(Integer sendSwitchEnd){
this.sendSwitchEnd = sendSwitchEnd; this.sendSwitchEnd = sendSwitchEnd;
} }
/** /**
* 获取 增加 是否启用发送消息(0.停用,1.启用) * 获取 增加 是否启用发送消息(0.停用,1.启用)
* @return sendSwitchIncrement * @return sendSwitchIncrement
*/ */
public Integer getSendSwitchIncrement(){ public Integer getSendSwitchIncrement(){
return this.sendSwitchIncrement; return this.sendSwitchIncrement;
} }
/** /**
* 设置 增加 是否启用发送消息(0.停用,1.启用) * 设置 增加 是否启用发送消息(0.停用,1.启用)
* @param sendSwitchIncrement * @param sendSwitchIncrement
*/ */
public void setSendSwitchIncrement(Integer sendSwitchIncrement){ public void setSendSwitchIncrement(Integer sendSwitchIncrement){
this.sendSwitchIncrement = sendSwitchIncrement; this.sendSwitchIncrement = sendSwitchIncrement;
} }
/** /**
* 获取 是否启用发送消息(0.停用,1.启用) * 获取 是否启用发送消息(0.停用,1.启用)
* @return sendSwitchList * @return sendSwitchList
*/ */
public List<Integer> getSendSwitchList(){ public List<Integer> getSendSwitchList(){
return this.sendSwitchList; return this.sendSwitchList;
} }
/** /**
* 设置 是否启用发送消息(0.停用,1.启用) * 设置 是否启用发送消息(0.停用,1.启用)
* @param sendSwitchList * @param sendSwitchList
*/ */
public void setSendSwitchList(List<Integer> sendSwitchList){ public void setSendSwitchList(List<Integer> sendSwitchList){
this.sendSwitchList = sendSwitchList; this.sendSwitchList = sendSwitchList;
} }
/** /**
* 获取 备注 * 获取 首页地址
* @return platformRemarkList * @return homeUrlList
*/ */
public List<String> getHomeUrlList(){
return this.homeUrlList;
}
/**
* 设置 首页地址
* @param homeUrlList
*/
public void setHomeUrlList(List<String> homeUrlList){
this.homeUrlList = homeUrlList;
}
/**
* 获取 备注
* @return platformRemarkList
*/
public List<String> getPlatformRemarkList(){ public List<String> getPlatformRemarkList(){
return this.platformRemarkList; return this.platformRemarkList;
} }
/** /**
* 设置 备注 * 设置 备注
* @param platformRemarkList * @param platformRemarkList
*/ */
public void setPlatformRemarkList(List<String> platformRemarkList){ public void setPlatformRemarkList(List<String> platformRemarkList){
this.platformRemarkList = platformRemarkList; this.platformRemarkList = platformRemarkList;
} }
/** /**
* 获取 开始 创建用户 * 获取 开始 创建用户
* @return createUserIdStart * @return createUserIdStart
*/ */
public Long getCreateUserIdStart(){ public Long getCreateUserIdStart(){
return this.createUserIdStart; return this.createUserIdStart;
} }
/** /**
* 设置 开始 创建用户 * 设置 开始 创建用户
* @param createUserIdStart * @param createUserIdStart
*/ */
public void setCreateUserIdStart(Long createUserIdStart){ public void setCreateUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart; this.createUserIdStart = createUserIdStart;
} }
/** /**
* 获取 结束 创建用户 * 获取 结束 创建用户
* @return $createUserIdEnd * @return $createUserIdEnd
*/ */
public Long getCreateUserIdEnd(){ public Long getCreateUserIdEnd(){
return this.createUserIdEnd; return this.createUserIdEnd;
} }
/** /**
* 设置 结束 创建用户 * 设置 结束 创建用户
* @param createUserIdEnd * @param createUserIdEnd
*/ */
public void setCreateUserIdEnd(Long createUserIdEnd){ public void setCreateUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd; this.createUserIdEnd = createUserIdEnd;
} }
/** /**
* 获取 增加 创建用户 * 获取 增加 创建用户
* @return createUserIdIncrement * @return createUserIdIncrement
*/ */
public Long getCreateUserIdIncrement(){ public Long getCreateUserIdIncrement(){
return this.createUserIdIncrement; return this.createUserIdIncrement;
} }
/** /**
* 设置 增加 创建用户 * 设置 增加 创建用户
* @param createUserIdIncrement * @param createUserIdIncrement
*/ */
public void setCreateUserIdIncrement(Long createUserIdIncrement){ public void setCreateUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement; this.createUserIdIncrement = createUserIdIncrement;
} }
/** /**
* 获取 创建用户 * 获取 创建用户
* @return createUserIdList * @return createUserIdList
*/ */
public List<Long> getCreateUserIdList(){ public List<Long> getCreateUserIdList(){
return this.createUserIdList; return this.createUserIdList;
} }
/** /**
* 设置 创建用户 * 设置 创建用户
* @param createUserIdList * @param createUserIdList
*/ */
public void setCreateUserIdList(List<Long> createUserIdList){ public void setCreateUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList; this.createUserIdList = createUserIdList;
} }
/** /**
* 获取 开始 创建时间 * 获取 开始 创建时间
* @return createTimeStart * @return createTimeStart
*/ */
public String getCreateTimeStart(){ public String getCreateTimeStart(){
return this.createTimeStart; return this.createTimeStart;
} }
/** /**
* 设置 开始 创建时间 * 设置 开始 创建时间
* @param createTimeStart * @param createTimeStart
*/ */
public void setCreateTimeStart(String createTimeStart){ public void setCreateTimeStart(String createTimeStart){
this.createTimeStart = createTimeStart; this.createTimeStart = createTimeStart;
} }
/** /**
* 获取 结束 创建时间 * 获取 结束 创建时间
* @return createTimeEnd * @return createTimeEnd
*/ */
public String getCreateTimeEnd(){ public String getCreateTimeEnd(){
return this.createTimeEnd; return this.createTimeEnd;
} }
/** /**
* 设置 结束 创建时间 * 设置 结束 创建时间
* @param createTimeEnd * @param createTimeEnd
*/ */
public void setCreateTimeEnd(String createTimeEnd){ public void setCreateTimeEnd(String createTimeEnd){
this.createTimeEnd = createTimeEnd; this.createTimeEnd = createTimeEnd;
} }
/** /**
* 获取 开始 更新用户 * 获取 开始 更新用户
* @return updateUserIdStart * @return updateUserIdStart
*/ */
public Long getUpdateUserIdStart(){ public Long getUpdateUserIdStart(){
return this.updateUserIdStart; return this.updateUserIdStart;
} }
/** /**
* 设置 开始 更新用户 * 设置 开始 更新用户
* @param updateUserIdStart * @param updateUserIdStart
*/ */
public void setUpdateUserIdStart(Long updateUserIdStart){ public void setUpdateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart; this.updateUserIdStart = updateUserIdStart;
} }
/** /**
* 获取 结束 更新用户 * 获取 结束 更新用户
* @return $updateUserIdEnd * @return $updateUserIdEnd
*/ */
public Long getUpdateUserIdEnd(){ public Long getUpdateUserIdEnd(){
return this.updateUserIdEnd; return this.updateUserIdEnd;
} }
/** /**
* 设置 结束 更新用户 * 设置 结束 更新用户
* @param updateUserIdEnd * @param updateUserIdEnd
*/ */
public void setUpdateUserIdEnd(Long updateUserIdEnd){ public void setUpdateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd; this.updateUserIdEnd = updateUserIdEnd;
} }
/** /**
* 获取 增加 更新用户 * 获取 增加 更新用户
* @return updateUserIdIncrement * @return updateUserIdIncrement
*/ */
public Long getUpdateUserIdIncrement(){ public Long getUpdateUserIdIncrement(){
return this.updateUserIdIncrement; return this.updateUserIdIncrement;
} }
/** /**
* 设置 增加 更新用户 * 设置 增加 更新用户
* @param updateUserIdIncrement * @param updateUserIdIncrement
*/ */
public void setUpdateUserIdIncrement(Long updateUserIdIncrement){ public void setUpdateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement; this.updateUserIdIncrement = updateUserIdIncrement;
} }
/** /**
* 获取 更新用户 * 获取 更新用户
* @return updateUserIdList * @return updateUserIdList
*/ */
public List<Long> getUpdateUserIdList(){ public List<Long> getUpdateUserIdList(){
return this.updateUserIdList; return this.updateUserIdList;
} }
/** /**
* 设置 更新用户 * 设置 更新用户
* @param updateUserIdList * @param updateUserIdList
*/ */
public void setUpdateUserIdList(List<Long> updateUserIdList){ public void setUpdateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList; this.updateUserIdList = updateUserIdList;
} }
/** /**
* 获取 开始 更新时间 * 获取 开始 更新时间
* @return updateTimeStart * @return updateTimeStart
*/ */
public String getUpdateTimeStart(){ public String getUpdateTimeStart(){
return this.updateTimeStart; return this.updateTimeStart;
} }
/** /**
* 设置 开始 更新时间 * 设置 开始 更新时间
* @param updateTimeStart * @param updateTimeStart
*/ */
public void setUpdateTimeStart(String updateTimeStart){ public void setUpdateTimeStart(String updateTimeStart){
this.updateTimeStart = updateTimeStart; this.updateTimeStart = updateTimeStart;
} }
/** /**
* 获取 结束 更新时间 * 获取 结束 更新时间
* @return updateTimeEnd * @return updateTimeEnd
*/ */
public String getUpdateTimeEnd(){ public String getUpdateTimeEnd(){
return this.updateTimeEnd; return this.updateTimeEnd;
} }
/** /**
* 设置 结束 更新时间 * 设置 结束 更新时间
* @param updateTimeEnd * @param updateTimeEnd
*/ */
public void setUpdateTimeEnd(String updateTimeEnd){ public void setUpdateTimeEnd(String updateTimeEnd){
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param id * @param id
*/ */
public PlatformQuery id(Long id){ public PlatformQuery id(Long id){
setId(id); setId(id);
return this; return this;
} }
/** /**
* 设置 开始 主键ID,主键,自增长 * 设置 开始 主键ID,主键,自增长
* @param idStart * @param idStart
*/ */
public PlatformQuery idStart(Long idStart){ public PlatformQuery idStart(Long idStart){
this.idStart = idStart; this.idStart = idStart;
return this; return this;
} }
/** /**
* 设置 结束 主键ID,主键,自增长 * 设置 结束 主键ID,主键,自增长
* @param idEnd * @param idEnd
*/ */
public PlatformQuery idEnd(Long idEnd){ public PlatformQuery idEnd(Long idEnd){
this.idEnd = idEnd; this.idEnd = idEnd;
return this; return this;
} }
/** /**
* 设置 增加 主键ID,主键,自增长 * 设置 增加 主键ID,主键,自增长
* @param idIncrement * @param idIncrement
*/ */
public PlatformQuery idIncrement(Long idIncrement){ public PlatformQuery idIncrement(Long idIncrement){
this.idIncrement = idIncrement; this.idIncrement = idIncrement;
return this; return this;
} }
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param idList * @param idList
*/ */
public PlatformQuery idList(List<Long> idList){ public PlatformQuery idList(List<Long> idList){
this.idList = idList; this.idList = idList;
return this; return this;
} }
/** /**
* 设置 平台名称,名称唯一 * 设置 平台名称,名称唯一
* @param platformName * @param platformName
*/ */
public PlatformQuery platformName(String platformName){ public PlatformQuery platformName(String platformName){
setPlatformName(platformName); setPlatformName(platformName);
return this; return this;
} }
/** /**
* 设置 平台名称,名称唯一 * 设置 平台名称,名称唯一
* @param platformNameList * @param platformNameList
*/ */
public PlatformQuery platformNameList(List<String> platformNameList){ public PlatformQuery platformNameList(List<String> platformNameList){
this.platformNameList = platformNameList; this.platformNameList = platformNameList;
return this; return this;
} }
/** /**
* 设置 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码) * 设置 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码)
* @param platformSn * @param platformSn
*/ */
public PlatformQuery platformSn(String platformSn){ public PlatformQuery platformSn(String platformSn){
setPlatformSn(platformSn); setPlatformSn(platformSn);
return this; return this;
} }
/** /**
* 设置 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码) * 设置 平台编码,编码唯一(编码加上站点编码,如phxt-51010251-1做Vhost虚拟机编码)
* @param platformSnList * @param platformSnList
*/ */
public PlatformQuery platformSnList(List<String> platformSnList){ public PlatformQuery platformSnList(List<String> platformSnList){
this.platformSnList = platformSnList; this.platformSnList = platformSnList;
return this; return this;
} }
/** /**
* 设置 发送第三方平台消息类型(0.http,1.jms) * 设置 发送第三方平台消息类型(0.http,1.jms)
* @param sendMsgType * @param sendMsgType
*/ */
public PlatformQuery sendMsgType(Integer sendMsgType){ public PlatformQuery sendMsgType(Integer sendMsgType){
setSendMsgType(sendMsgType); setSendMsgType(sendMsgType);
return this; return this;
} }
/** /**
* 设置 开始 发送第三方平台消息类型(0.http,1.jms) * 设置 开始 发送第三方平台消息类型(0.http,1.jms)
* @param sendMsgTypeStart * @param sendMsgTypeStart
*/ */
public PlatformQuery sendMsgTypeStart(Integer sendMsgTypeStart){ public PlatformQuery sendMsgTypeStart(Integer sendMsgTypeStart){
this.sendMsgTypeStart = sendMsgTypeStart; this.sendMsgTypeStart = sendMsgTypeStart;
return this; return this;
} }
/** /**
* 设置 结束 发送第三方平台消息类型(0.http,1.jms) * 设置 结束 发送第三方平台消息类型(0.http,1.jms)
* @param sendMsgTypeEnd * @param sendMsgTypeEnd
*/ */
public PlatformQuery sendMsgTypeEnd(Integer sendMsgTypeEnd){ public PlatformQuery sendMsgTypeEnd(Integer sendMsgTypeEnd){
this.sendMsgTypeEnd = sendMsgTypeEnd; this.sendMsgTypeEnd = sendMsgTypeEnd;
return this; return this;
} }
/** /**
* 设置 增加 发送第三方平台消息类型(0.http,1.jms) * 设置 增加 发送第三方平台消息类型(0.http,1.jms)
* @param sendMsgTypeIncrement * @param sendMsgTypeIncrement
*/ */
public PlatformQuery sendMsgTypeIncrement(Integer sendMsgTypeIncrement){ public PlatformQuery sendMsgTypeIncrement(Integer sendMsgTypeIncrement){
this.sendMsgTypeIncrement = sendMsgTypeIncrement; this.sendMsgTypeIncrement = sendMsgTypeIncrement;
return this; return this;
} }
/** /**
* 设置 发送第三方平台消息类型(0.http,1.jms) * 设置 发送第三方平台消息类型(0.http,1.jms)
* @param sendMsgTypeList * @param sendMsgTypeList
*/ */
public PlatformQuery sendMsgTypeList(List<Integer> sendMsgTypeList){ public PlatformQuery sendMsgTypeList(List<Integer> sendMsgTypeList){
this.sendMsgTypeList = sendMsgTypeList; this.sendMsgTypeList = sendMsgTypeList;
return this; return this;
} }
/**
* 设置 发送参数请求地址
* @param sendUrl
*/
public PlatformQuery sendUrl(String sendUrl){
setSendUrl(sendUrl);
return this;
}
/** /**
* 设置 发送参数配置,如发送消息地址等,xml结构,根据消息类型变化 * 设置 发送参数请求地址
* @param sendConfig * @param sendUrlList
*/ */
public PlatformQuery sendConfig(String sendConfig){ public PlatformQuery sendUrlList(List<String> sendUrlList){
setSendConfig(sendConfig); this.sendUrlList = sendUrlList;
return this; return this;
} }
/** /**
* 设置 发送参数配置,如发送消息地址等,xml结构,根据消息类型变化 * 设置 回调参数地址
* @param sendConfigList * @param callbackUrl
*/ */
public PlatformQuery sendConfigList(List<String> sendConfigList){ public PlatformQuery callbackUrl(String callbackUrl){
this.sendConfigList = sendConfigList; setCallbackUrl(callbackUrl);
return this; return this;
} }
/** /**
* 设置 是否启用发送消息(0.停用,1.启用) * 设置 回调参数地址
* @param sendSwitch * @param callbackUrlList
*/ */
public PlatformQuery callbackUrlList(List<String> callbackUrlList){
this.callbackUrlList = callbackUrlList;
return this;
}
/**
* 设置 是否启用发送消息(0.停用,1.启用)
* @param sendSwitch
*/
public PlatformQuery sendSwitch(Integer sendSwitch){ public PlatformQuery sendSwitch(Integer sendSwitch){
setSendSwitch(sendSwitch); setSendSwitch(sendSwitch);
return this; return this;
} }
/** /**
* 设置 开始 是否启用发送消息(0.停用,1.启用) * 设置 开始 是否启用发送消息(0.停用,1.启用)
* @param sendSwitchStart * @param sendSwitchStart
*/ */
public PlatformQuery sendSwitchStart(Integer sendSwitchStart){ public PlatformQuery sendSwitchStart(Integer sendSwitchStart){
this.sendSwitchStart = sendSwitchStart; this.sendSwitchStart = sendSwitchStart;
return this; return this;
} }
/** /**
* 设置 结束 是否启用发送消息(0.停用,1.启用) * 设置 结束 是否启用发送消息(0.停用,1.启用)
* @param sendSwitchEnd * @param sendSwitchEnd
*/ */
public PlatformQuery sendSwitchEnd(Integer sendSwitchEnd){ public PlatformQuery sendSwitchEnd(Integer sendSwitchEnd){
this.sendSwitchEnd = sendSwitchEnd; this.sendSwitchEnd = sendSwitchEnd;
return this; return this;
} }
/** /**
* 设置 增加 是否启用发送消息(0.停用,1.启用) * 设置 增加 是否启用发送消息(0.停用,1.启用)
* @param sendSwitchIncrement * @param sendSwitchIncrement
*/ */
public PlatformQuery sendSwitchIncrement(Integer sendSwitchIncrement){ public PlatformQuery sendSwitchIncrement(Integer sendSwitchIncrement){
this.sendSwitchIncrement = sendSwitchIncrement; this.sendSwitchIncrement = sendSwitchIncrement;
return this; return this;
} }
/** /**
* 设置 是否启用发送消息(0.停用,1.启用) * 设置 是否启用发送消息(0.停用,1.启用)
* @param sendSwitchList * @param sendSwitchList
*/ */
public PlatformQuery sendSwitchList(List<Integer> sendSwitchList){ public PlatformQuery sendSwitchList(List<Integer> sendSwitchList){
this.sendSwitchList = sendSwitchList; this.sendSwitchList = sendSwitchList;
return this; return this;
} }
/**
* 设置 首页地址
* @param homeUrl
*/
public PlatformQuery homeUrl(String homeUrl){
setHomeUrl(homeUrl);
return this;
}
/**
* 设置 首页地址
* @param homeUrlList
*/
public PlatformQuery homeUrlList(List<String> homeUrlList){
this.homeUrlList = homeUrlList;
return this;
}
/** /**
* 设置 备注 * 设置 备注
* @param platformRemark * @param platformRemark
*/ */
public PlatformQuery platformRemark(String platformRemark){ public PlatformQuery platformRemark(String platformRemark){
setPlatformRemark(platformRemark); setPlatformRemark(platformRemark);
return this; return this;
} }
/** /**
* 设置 备注 * 设置 备注
* @param platformRemarkList * @param platformRemarkList
*/ */
public PlatformQuery platformRemarkList(List<String> platformRemarkList){ public PlatformQuery platformRemarkList(List<String> platformRemarkList){
this.platformRemarkList = platformRemarkList; this.platformRemarkList = platformRemarkList;
return this; return this;
} }
/** /**
* 设置 创建用户 * 设置 创建用户
* @param createUserId * @param createUserId
*/ */
public PlatformQuery createUserId(Long createUserId){ public PlatformQuery createUserId(Long createUserId){
setCreateUserId(createUserId); setCreateUserId(createUserId);
return this; return this;
} }
/** /**
* 设置 开始 创建用户 * 设置 开始 创建用户
* @param createUserIdStart * @param createUserIdStart
*/ */
public PlatformQuery createUserIdStart(Long createUserIdStart){ public PlatformQuery createUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart; this.createUserIdStart = createUserIdStart;
return this; return this;
} }
/** /**
* 设置 结束 创建用户 * 设置 结束 创建用户
* @param createUserIdEnd * @param createUserIdEnd
*/ */
public PlatformQuery createUserIdEnd(Long createUserIdEnd){ public PlatformQuery createUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd; this.createUserIdEnd = createUserIdEnd;
return this; return this;
} }
/** /**
* 设置 增加 创建用户 * 设置 增加 创建用户
* @param createUserIdIncrement * @param createUserIdIncrement
*/ */
public PlatformQuery createUserIdIncrement(Long createUserIdIncrement){ public PlatformQuery createUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement; this.createUserIdIncrement = createUserIdIncrement;
return this; return this;
} }
/** /**
* 设置 创建用户 * 设置 创建用户
* @param createUserIdList * @param createUserIdList
*/ */
public PlatformQuery createUserIdList(List<Long> createUserIdList){ public PlatformQuery createUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList; this.createUserIdList = createUserIdList;
return this; return this;
} }
/** /**
* 设置 更新用户 * 设置 更新用户
* @param updateUserId * @param updateUserId
*/ */
public PlatformQuery updateUserId(Long updateUserId){ public PlatformQuery updateUserId(Long updateUserId){
setUpdateUserId(updateUserId); setUpdateUserId(updateUserId);
return this; return this;
} }
/** /**
* 设置 开始 更新用户 * 设置 开始 更新用户
* @param updateUserIdStart * @param updateUserIdStart
*/ */
public PlatformQuery updateUserIdStart(Long updateUserIdStart){ public PlatformQuery updateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart; this.updateUserIdStart = updateUserIdStart;
return this; return this;
} }
/** /**
* 设置 结束 更新用户 * 设置 结束 更新用户
* @param updateUserIdEnd * @param updateUserIdEnd
*/ */
public PlatformQuery updateUserIdEnd(Long updateUserIdEnd){ public PlatformQuery updateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd; this.updateUserIdEnd = updateUserIdEnd;
return this; return this;
} }
/** /**
* 设置 增加 更新用户 * 设置 增加 更新用户
* @param updateUserIdIncrement * @param updateUserIdIncrement
*/ */
public PlatformQuery updateUserIdIncrement(Long updateUserIdIncrement){ public PlatformQuery updateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement; this.updateUserIdIncrement = updateUserIdIncrement;
return this; return this;
} }
/** /**
* 设置 更新用户 * 设置 更新用户
* @param updateUserIdList * @param updateUserIdList
*/ */
public PlatformQuery updateUserIdList(List<Long> updateUserIdList){ public PlatformQuery updateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList; this.updateUserIdList = updateUserIdList;
return this; return this;
} }
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
*/ */
public List<PlatformQuery> getOrConditionList(){ public List<PlatformQuery> getOrConditionList(){
return this.orConditionList; return this.orConditionList;
} }
/** /**
* 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @param orConditionList * @param orConditionList
*/ */
public void setOrConditionList(List<PlatformQuery> orConditionList){ public void setOrConditionList(List<PlatformQuery> orConditionList){
this.orConditionList = orConditionList; this.orConditionList = orConditionList;
} }
/** /**
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) * 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @return andConditionList * @return andConditionList
*/ */
public List<PlatformQuery> getAndConditionList(){ public List<PlatformQuery> getAndConditionList(){
return this.andConditionList; return this.andConditionList;
} }
/** /**
* 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) * 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @param andConditionList * @param andConditionList
*/ */
public void setAndConditionList(List<PlatformQuery> andConditionList){ public void setAndConditionList(List<PlatformQuery> andConditionList){
this.andConditionList = andConditionList; this.andConditionList = andConditionList;
} }
......
...@@ -49,10 +49,6 @@ public class PlatformController extends BaseCRUDJsonMappingController<PlatformSe ...@@ -49,10 +49,6 @@ public class PlatformController extends BaseCRUDJsonMappingController<PlatformSe
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
private ICacheService cacheService = LocalCacheServiceImpl.getInstance();
private final String KEY = "base-platform:admin,admin";//基础服务平台获取token
public PlatformController() { public PlatformController() {
super.setFormClass(PlatformForm.class); super.setFormClass(PlatformForm.class);
super.setModuleDesc("平台系统"); super.setModuleDesc("平台系统");
...@@ -64,133 +60,4 @@ public class PlatformController extends BaseCRUDJsonMappingController<PlatformSe ...@@ -64,133 +60,4 @@ public class PlatformController extends BaseCRUDJsonMappingController<PlatformSe
this.addDict(model, "sendSwitch", paramService.getParamBySecondOrganize("Platform", "sendSwitch")); this.addDict(model, "sendSwitch", paramService.getParamBySecondOrganize("Platform", "sendSwitch"));
super.init(request, response, form, model, context); super.init(request, response, form, model, context);
} }
@GetMapping("getSite")
public String getSite(@RequestParam("parentId") String parentId) {
log.info("【获取站点】【请求体】-->parentId " + parentId);
String res = null;
try {
String token = cacheService.get(KEY);
if(token == null){
token = getToken();
if(token == null){
throw new AppException("未获取到token");
}
}
res = getSiteList(parentId, token);
if(JSONObject.parseObject(res).get("code").equals(-1)){
token = getToken();
res = getSiteList(parentId, token);
}
} catch (Exception e) {
log.error("接收数据失败", e);
return res;
}
log.info("响应【获取站点】【响应体】--> " + res);
return res;
}
//获取基础服务平台站点信息
private String getSiteList(String parentId, String token){
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
String result = "";
try {
// 通过址默认配置创建一个httpClient实例
httpClient = HttpClients.createDefault();
// 创建httpGet远程连接实例
HttpGet httpGet = new HttpGet("http://192.168.0.98:11071/zwfw/area/getListByParentId?parentId=" + parentId);
// 设置请求头信息,鉴权
httpGet.setHeader("Authorization", token);
// 执行get请求得到返回对象
response = httpClient.execute(httpGet);
// 通过返回对象获取返回数据
HttpEntity entity = response.getEntity();
// 通过EntityUtils中的toString方法将结果转换为字符串
result = EntityUtils.toString(entity);
} catch (Exception e) {
log.error("接收数据失败", e);
return JSON.toJSONString(result);
} finally {
if (response != null) {
try {
response.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (httpClient != null) {
try {
httpClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
JSONObject object = JSONObject.parseObject(result);
if(object == null || object.get("code") == null){
throw new AppException("基础服务平台获取站点信息失败,响应值: " + response);
}
return result;
}
//获取基础服务平台token
private String getToken() {
CloseableHttpResponse httpResponse = null;
String response = "";
Object token = null;
// 创建httpClient实例
CloseableHttpClient httpClient = HttpClients.createDefault();
// 创建httpPost远程连接实例
HttpPost httpPost = new HttpPost("http://192.168.0.98:11071/zwfw/login/login");
JSONObject request = null;
try {
request = new JSONObject();
request.put("loginName", "admin");
request.put("password", "admin");
request.put("securityCode", 8888);
log.info("登录基础服务平台,参数-->" + request);
StringEntity entity = new StringEntity(request.toString());
entity.setContentType("application/json;charset=UTF-8");
httpPost.setEntity(entity);
// httpClient对象执行post请求,并返回响应参数对象
httpResponse = httpClient.execute(httpPost);
// 从响应对象中获取响应内容
HttpEntity httpEntity = httpResponse.getEntity();
response = EntityUtils.toString(httpEntity);
} catch (IOException e) {
e.printStackTrace();
log.error("基础服务平台登录失败,响应体:" + httpResponse);
} finally {
// 关闭资源
if (null != httpResponse) {
try {
httpResponse.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (null != httpClient) {
try {
httpClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
JSONObject object = JSONObject.parseObject(response);
if(object == null || object.get("code") == null || object.get("code").equals(-1)){
throw new AppException("基础服务平台登录获取token失败,响应值: " + response);
}
if(object.get("code").equals(1)){
token = JSONObject.parseObject(object.get("data").toString()).get("token");
cacheService.sadd(KEY,token);
return token.toString();
}
return null;
}
} }
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.platform.dao.ibatis.PlatformDaoImpl"> <mapper namespace="com.mortals.xhx.module.platform.dao.ibatis.PlatformDaoImpl">
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
<resultMap type="PlatformEntity" id="PlatformEntity-Map"> <resultMap type="PlatformEntity" id="PlatformEntity-Map">
<id property="id" column="id" /> <id property="id" column="id" />
<result property="platformName" column="platformName" /> <result property="platformName" column="platformName" />
<result property="platformSn" column="platformSn" /> <result property="platformSn" column="platformSn" />
<result property="sendMsgType" column="sendMsgType" /> <result property="sendMsgType" column="sendMsgType" />
<result property="sendConfig" column="sendConfig" /> <result property="sendUrl" column="sendUrl" />
<result property="sendSwitch" column="sendSwitch" /> <result property="callbackUrl" column="callbackUrl" />
<result property="platformRemark" column="platformRemark" /> <result property="sendSwitch" column="sendSwitch" />
<result property="createUserId" column="createUserId" /> <result property="homeUrl" column="homeUrl" />
<result property="createTime" column="createTime" /> <result property="platformRemark" column="platformRemark" />
<result property="updateUserId" column="updateUserId" /> <result property="createUserId" column="createUserId" />
<result property="updateTime" column="updateTime" /> <result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" />
</resultMap> </resultMap>
<!-- 表所有列 --> <!-- 表所有列 -->
<sql id="_columns"> <sql id="_columns">
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
a.id, a.id,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('platformName') or colPickMode == 1 and data.containsKey('platformName')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('platformName') or colPickMode == 1 and data.containsKey('platformName')))">
a.platformName, a.platformName,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('platformSn') or colPickMode == 1 and data.containsKey('platformSn')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('platformSn') or colPickMode == 1 and data.containsKey('platformSn')))">
a.platformSn, a.platformSn,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sendMsgType') or colPickMode == 1 and data.containsKey('sendMsgType')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sendMsgType') or colPickMode == 1 and data.containsKey('sendMsgType')))">
a.sendMsgType, a.sendMsgType,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sendConfig') or colPickMode == 1 and data.containsKey('sendConfig')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sendUrl') or colPickMode == 1 and data.containsKey('sendUrl')))">
a.sendConfig, a.sendUrl,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sendSwitch') or colPickMode == 1 and data.containsKey('sendSwitch')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('callbackUrl') or colPickMode == 1 and data.containsKey('callbackUrl')))">
a.sendSwitch, a.callbackUrl,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('platformRemark') or colPickMode == 1 and data.containsKey('platformRemark')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sendSwitch') or colPickMode == 1 and data.containsKey('sendSwitch')))">
a.platformRemark, a.sendSwitch,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('homeUrl') or colPickMode == 1 and data.containsKey('homeUrl')))">
a.createUserId, a.homeUrl,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('platformRemark') or colPickMode == 1 and data.containsKey('platformRemark')))">
a.createTime, a.platformRemark,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
a.updateUserId, a.createUserId,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.updateTime, a.createTime,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))">
a.updateUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="PlatformEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="PlatformEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_platform insert into mortals_xhx_platform
(platformName,platformSn,sendMsgType,sendConfig,sendSwitch,platformRemark,createUserId,createTime,updateUserId,updateTime) (platformName,platformSn,sendMsgType,sendUrl,callbackUrl,sendSwitch,homeUrl,platformRemark,createUserId,createTime,updateUserId,updateTime)
VALUES VALUES
(#{platformName},#{platformSn},#{sendMsgType},#{sendConfig},#{sendSwitch},#{platformRemark},#{createUserId},#{createTime},#{updateUserId},#{updateTime}) (#{platformName},#{platformSn},#{sendMsgType},#{sendUrl},#{callbackUrl},#{sendSwitch},#{homeUrl},#{platformRemark},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_platform insert into mortals_xhx_platform
(platformName,platformSn,sendMsgType,sendConfig,sendSwitch,platformRemark,createUserId,createTime,updateUserId,updateTime) (platformName,platformSn,sendMsgType,sendUrl,callbackUrl,sendSwitch,homeUrl,platformRemark,createUserId,createTime,updateUserId,updateTime)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.platformName},#{item.platformSn},#{item.sendMsgType},#{item.sendConfig},#{item.sendSwitch},#{item.platformRemark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime}) (#{item.platformName},#{item.platformSn},#{item.sendMsgType},#{item.sendUrl},#{item.callbackUrl},#{item.sendSwitch},#{item.homeUrl},#{item.platformRemark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
</foreach> </foreach>
</insert> </insert>
...@@ -94,8 +102,11 @@ ...@@ -94,8 +102,11 @@
<if test="(colPickMode==0 and data.containsKey('sendMsgTypeIncrement')) or (colPickMode==1 and !data.containsKey('sendMsgTypeIncrement'))"> <if test="(colPickMode==0 and data.containsKey('sendMsgTypeIncrement')) or (colPickMode==1 and !data.containsKey('sendMsgTypeIncrement'))">
a.sendMsgType=ifnull(a.sendMsgType,0) + #{data.sendMsgTypeIncrement}, a.sendMsgType=ifnull(a.sendMsgType,0) + #{data.sendMsgTypeIncrement},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('sendConfig')) or (colPickMode==1 and !data.containsKey('sendConfig'))"> <if test="(colPickMode==0 and data.containsKey('sendUrl')) or (colPickMode==1 and !data.containsKey('sendUrl'))">
a.sendConfig=#{data.sendConfig}, a.sendUrl=#{data.sendUrl},
</if>
<if test="(colPickMode==0 and data.containsKey('callbackUrl')) or (colPickMode==1 and !data.containsKey('callbackUrl'))">
a.callbackUrl=#{data.callbackUrl},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('sendSwitch')) or (colPickMode==1 and !data.containsKey('sendSwitch'))"> <if test="(colPickMode==0 and data.containsKey('sendSwitch')) or (colPickMode==1 and !data.containsKey('sendSwitch'))">
a.sendSwitch=#{data.sendSwitch}, a.sendSwitch=#{data.sendSwitch},
...@@ -103,6 +114,9 @@ ...@@ -103,6 +114,9 @@
<if test="(colPickMode==0 and data.containsKey('sendSwitchIncrement')) or (colPickMode==1 and !data.containsKey('sendSwitchIncrement'))"> <if test="(colPickMode==0 and data.containsKey('sendSwitchIncrement')) or (colPickMode==1 and !data.containsKey('sendSwitchIncrement'))">
a.sendSwitch=ifnull(a.sendSwitch,0) + #{data.sendSwitchIncrement}, a.sendSwitch=ifnull(a.sendSwitch,0) + #{data.sendSwitchIncrement},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('homeUrl')) or (colPickMode==1 and !data.containsKey('homeUrl'))">
a.homeUrl=#{data.homeUrl},
</if>
<if test="(colPickMode==0 and data.containsKey('platformRemark')) or (colPickMode==1 and !data.containsKey('platformRemark'))"> <if test="(colPickMode==0 and data.containsKey('platformRemark')) or (colPickMode==1 and !data.containsKey('platformRemark'))">
a.platformRemark=#{data.platformRemark}, a.platformRemark=#{data.platformRemark},
</if> </if>
...@@ -136,96 +150,110 @@ ...@@ -136,96 +150,110 @@
<update id="updateBatch" parameterType="paramDto"> <update id="updateBatch" parameterType="paramDto">
update mortals_xhx_platform as a update mortals_xhx_platform as a
<trim prefix="set" suffixOverrides=","> <trim prefix="set" suffixOverrides=",">
<trim prefix="platformName=(case" suffix="ELSE platformName end),"> <trim prefix="platformName=(case" suffix="ELSE platformName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('platformName')) or (colPickMode==1 and !item.containsKey('platformName'))"> <if test="(colPickMode==0 and item.containsKey('platformName')) or (colPickMode==1 and !item.containsKey('platformName'))">
when a.id=#{item.id} then #{item.platformName} when a.id=#{item.id} then #{item.platformName}
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="platformSn=(case" suffix="ELSE platformSn end),"> <trim prefix="platformSn=(case" suffix="ELSE platformSn end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('platformSn')) or (colPickMode==1 and !item.containsKey('platformSn'))"> <if test="(colPickMode==0 and item.containsKey('platformSn')) or (colPickMode==1 and !item.containsKey('platformSn'))">
when a.id=#{item.id} then #{item.platformSn} when a.id=#{item.id} then #{item.platformSn}
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="sendMsgType=(case" suffix="ELSE sendMsgType end),"> <trim prefix="sendMsgType=(case" suffix="ELSE sendMsgType end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <choose>
<when test="(colPickMode==0 and item.containsKey('sendMsgType')) or (colPickMode==1 and !item.containsKey('sendMsgType'))"> <when test="(colPickMode==0 and item.containsKey('sendMsgType')) or (colPickMode==1 and !item.containsKey('sendMsgType'))">
when a.id=#{item.id} then #{item.sendMsgType} when a.id=#{item.id} then #{item.sendMsgType}
</when> </when>
<when test="(colPickMode==0 and item.containsKey('sendMsgTypeIncrement')) or (colPickMode==1 and !item.containsKey('sendMsgTypeIncrement'))"> <when test="(colPickMode==0 and item.containsKey('sendMsgTypeIncrement')) or (colPickMode==1 and !item.containsKey('sendMsgTypeIncrement'))">
when a.id=#{item.id} then ifnull(a.sendMsgType,0) + #{item.sendMsgTypeIncrement} when a.id=#{item.id} then ifnull(a.sendMsgType,0) + #{item.sendMsgTypeIncrement}
</when> </when>
</choose> </choose>
</foreach> </foreach>
</trim> </trim>
<trim prefix="sendConfig=(case" suffix="ELSE sendConfig end),"> <trim prefix="sendUrl=(case" suffix="ELSE sendUrl end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('sendConfig')) or (colPickMode==1 and !item.containsKey('sendConfig'))"> <if test="(colPickMode==0 and item.containsKey('sendUrl')) or (colPickMode==1 and !item.containsKey('sendUrl'))">
when a.id=#{item.id} then #{item.sendConfig} when a.id=#{item.id} then #{item.sendUrl}
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="sendSwitch=(case" suffix="ELSE sendSwitch end),"> <trim prefix="callbackUrl=(case" suffix="ELSE callbackUrl end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <if test="(colPickMode==0 and item.containsKey('callbackUrl')) or (colPickMode==1 and !item.containsKey('callbackUrl'))">
<when test="(colPickMode==0 and item.containsKey('sendSwitch')) or (colPickMode==1 and !item.containsKey('sendSwitch'))"> when a.id=#{item.id} then #{item.callbackUrl}
when a.id=#{item.id} then #{item.sendSwitch} </if>
</when> </foreach>
<when test="(colPickMode==0 and item.containsKey('sendSwitchIncrement')) or (colPickMode==1 and !item.containsKey('sendSwitchIncrement'))"> </trim>
when a.id=#{item.id} then ifnull(a.sendSwitch,0) + #{item.sendSwitchIncrement} <trim prefix="sendSwitch=(case" suffix="ELSE sendSwitch end),">
</when> <foreach collection="data.dataList" item="item" index="index" separator="" >
</choose> <choose>
</foreach> <when test="(colPickMode==0 and item.containsKey('sendSwitch')) or (colPickMode==1 and !item.containsKey('sendSwitch'))">
</trim> when a.id=#{item.id} then #{item.sendSwitch}
<trim prefix="platformRemark=(case" suffix="ELSE platformRemark end),"> </when>
<foreach collection="data.dataList" item="item" index="index" separator="" > <when test="(colPickMode==0 and item.containsKey('sendSwitchIncrement')) or (colPickMode==1 and !item.containsKey('sendSwitchIncrement'))">
<if test="(colPickMode==0 and item.containsKey('platformRemark')) or (colPickMode==1 and !item.containsKey('platformRemark'))"> when a.id=#{item.id} then ifnull(a.sendSwitch,0) + #{item.sendSwitchIncrement}
when a.id=#{item.id} then #{item.platformRemark} </when>
</if> </choose>
</foreach> </foreach>
</trim> </trim>
<trim prefix="createUserId=(case" suffix="ELSE createUserId end),"> <trim prefix="homeUrl=(case" suffix="ELSE homeUrl end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <if test="(colPickMode==0 and item.containsKey('homeUrl')) or (colPickMode==1 and !item.containsKey('homeUrl'))">
<when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))"> when a.id=#{item.id} then #{item.homeUrl}
when a.id=#{item.id} then #{item.createUserId} </if>
</when> </foreach>
<when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))"> </trim>
when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement} <trim prefix="platformRemark=(case" suffix="ELSE platformRemark end),">
</when> <foreach collection="data.dataList" item="item" index="index" separator="" >
</choose> <if test="(colPickMode==0 and item.containsKey('platformRemark')) or (colPickMode==1 and !item.containsKey('platformRemark'))">
</foreach> when a.id=#{item.id} then #{item.platformRemark}
</trim> </if>
<trim prefix="createTime=(case" suffix="ELSE createTime end),"> </foreach>
<foreach collection="data.dataList" item="item" index="index" separator="" > </trim>
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))"> <trim prefix="createUserId=(case" suffix="ELSE createUserId end),">
when a.id=#{item.id} then #{item.createTime} <foreach collection="data.dataList" item="item" index="index" separator="" >
</if> <choose>
</foreach> <when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
</trim> when a.id=#{item.id} then #{item.createUserId}
<trim prefix="updateUserId=(case" suffix="ELSE updateUserId end),"> </when>
<foreach collection="data.dataList" item="item" index="index" separator="" > <when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
<choose> when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
<when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))"> </when>
when a.id=#{item.id} then #{item.updateUserId} </choose>
</when> </foreach>
<when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))"> </trim>
when a.id=#{item.id} then ifnull(a.updateUserId,0) + #{item.updateUserIdIncrement} <trim prefix="createTime=(case" suffix="ELSE createTime end),">
</when> <foreach collection="data.dataList" item="item" index="index" separator="" >
</choose> <if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
</foreach> when a.id=#{item.id} then #{item.createTime}
</trim> </if>
<trim prefix="updateTime=(case" suffix="ELSE updateTime end),"> </foreach>
<foreach collection="data.dataList" item="item" index="index" separator="" > </trim>
<if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))"> <trim prefix="updateUserId=(case" suffix="ELSE updateUserId end),">
when a.id=#{item.id} then #{item.updateTime} <foreach collection="data.dataList" item="item" index="index" separator="" >
</if> <choose>
</foreach> <when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))">
</trim> when a.id=#{item.id} then #{item.updateUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.updateUserId,0) + #{item.updateUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
when a.id=#{item.id} then #{item.updateTime}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -327,269 +355,309 @@ ...@@ -327,269 +355,309 @@
${_conditionType_} a.id=#{${_conditionParam_}.id} ${_conditionType_} a.id=#{${_conditionParam_}.id}
</if> </if>
</if> </if>
<if test="conditionParamRef.containsKey('id')"> <if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null "> <if test="conditionParamRef.id != null ">
${_conditionType_} a.id = #{${_conditionParam_}.id} ${_conditionType_} a.id = #{${_conditionParam_}.id}
</if>
<if test="conditionParamRef.id == null">
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList')">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if> </if>
<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null"> <if test="conditionParamRef.id == null">
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd} ${_conditionType_} a.id is null
</if> </if>
</if>
<if test="conditionParamRef.containsKey('idList')">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
</if>
<if test="conditionParamRef.containsKey('platformName')"> <if test="conditionParamRef.containsKey('platformName')">
<if test="conditionParamRef.platformName != null and conditionParamRef.platformName != ''"> <if test="conditionParamRef.platformName != null and conditionParamRef.platformName != ''">
${_conditionType_} a.platformName like #{${_conditionParam_}.platformName} ${_conditionType_} a.platformName like #{${_conditionParam_}.platformName}
</if>
<if test="conditionParamRef.platformName == null">
${_conditionType_} a.platformName is null
</if>
</if> </if>
<if test="conditionParamRef.containsKey('platformNameList')"> <if test="conditionParamRef.platformName == null">
${_conditionType_} a.platformName in ${_conditionType_} a.platformName is null
<foreach collection="conditionParamRef.platformNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if> </if>
</if>
<if test="conditionParamRef.containsKey('platformNameList')">
${_conditionType_} a.platformName in
<foreach collection="conditionParamRef.platformNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('platformSn')"> <if test="conditionParamRef.containsKey('platformSn')">
<if test="conditionParamRef.platformSn != null and conditionParamRef.platformSn != ''"> <if test="conditionParamRef.platformSn != null and conditionParamRef.platformSn != ''">
${_conditionType_} a.platformSn like #{${_conditionParam_}.platformSn} ${_conditionType_} a.platformSn like #{${_conditionParam_}.platformSn}
</if>
<if test="conditionParamRef.platformSn == null">
${_conditionType_} a.platformSn is null
</if>
</if> </if>
<if test="conditionParamRef.containsKey('platformSnList')"> <if test="conditionParamRef.platformSn == null">
${_conditionType_} a.platformSn in ${_conditionType_} a.platformSn is null
<foreach collection="conditionParamRef.platformSnList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sendMsgType')">
<if test="conditionParamRef.sendMsgType != null ">
${_conditionType_} a.sendMsgType = #{${_conditionParam_}.sendMsgType}
</if>
<if test="conditionParamRef.sendMsgType == null">
${_conditionType_} a.sendMsgType is null
</if>
</if>
<if test="conditionParamRef.containsKey('sendMsgTypeList')">
${_conditionType_} a.sendMsgType in
<foreach collection="conditionParamRef.sendMsgTypeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if> </if>
<if test="conditionParamRef.containsKey('sendMsgTypeStart') and conditionParamRef.sendMsgTypeStart != null"> </if>
${_conditionType_} a.sendMsgType <![CDATA[ >= ]]> #{${_conditionParam_}.sendMsgTypeStart} <if test="conditionParamRef.containsKey('platformSnList')">
${_conditionType_} a.platformSn in
<foreach collection="conditionParamRef.platformSnList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sendMsgType')">
<if test="conditionParamRef.sendMsgType != null ">
${_conditionType_} a.sendMsgType = #{${_conditionParam_}.sendMsgType}
</if> </if>
<if test="conditionParamRef.containsKey('sendMsgTypeEnd') and conditionParamRef.sendMsgTypeEnd != null"> <if test="conditionParamRef.sendMsgType == null">
${_conditionType_} a.sendMsgType <![CDATA[ <= ]]> #{${_conditionParam_}.sendMsgTypeEnd} ${_conditionType_} a.sendMsgType is null
</if> </if>
</if>
<if test="conditionParamRef.containsKey('sendMsgTypeList')">
${_conditionType_} a.sendMsgType in
<foreach collection="conditionParamRef.sendMsgTypeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sendMsgTypeStart') and conditionParamRef.sendMsgTypeStart != null">
${_conditionType_} a.sendMsgType <![CDATA[ >= ]]> #{${_conditionParam_}.sendMsgTypeStart}
</if>
<if test="conditionParamRef.containsKey('sendMsgTypeEnd') and conditionParamRef.sendMsgTypeEnd != null">
${_conditionType_} a.sendMsgType <![CDATA[ <= ]]> #{${_conditionParam_}.sendMsgTypeEnd}
</if>
<if test="conditionParamRef.containsKey('sendConfig')"> <if test="conditionParamRef.containsKey('sendUrl')">
<if test="conditionParamRef.sendConfig != null and conditionParamRef.sendConfig != ''"> <if test="conditionParamRef.sendUrl != null and conditionParamRef.sendUrl != ''">
${_conditionType_} a.sendConfig like #{${_conditionParam_}.sendConfig} ${_conditionType_} a.sendUrl like #{${_conditionParam_}.sendUrl}
</if>
<if test="conditionParamRef.sendConfig == null">
${_conditionType_} a.sendConfig is null
</if>
</if> </if>
<if test="conditionParamRef.containsKey('sendConfigList')"> <if test="conditionParamRef.sendUrl == null">
${_conditionType_} a.sendConfig in ${_conditionType_} a.sendUrl is null
<foreach collection="conditionParamRef.sendConfigList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if> </if>
<if test="conditionParamRef.containsKey('sendSwitch')"> </if>
<if test="conditionParamRef.sendSwitch != null "> <if test="conditionParamRef.containsKey('sendUrlList')">
${_conditionType_} a.sendSwitch = #{${_conditionParam_}.sendSwitch} ${_conditionType_} a.sendUrl in
</if> <foreach collection="conditionParamRef.sendUrlList" open="(" close=")" index="index" item="item" separator=",">
<if test="conditionParamRef.sendSwitch == null"> #{item}
${_conditionType_} a.sendSwitch is null </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('callbackUrl')">
<if test="conditionParamRef.callbackUrl != null and conditionParamRef.callbackUrl != ''">
${_conditionType_} a.callbackUrl like #{${_conditionParam_}.callbackUrl}
</if> </if>
<if test="conditionParamRef.containsKey('sendSwitchList')"> <if test="conditionParamRef.callbackUrl == null">
${_conditionType_} a.sendSwitch in ${_conditionType_} a.callbackUrl is null
<foreach collection="conditionParamRef.sendSwitchList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if> </if>
<if test="conditionParamRef.containsKey('sendSwitchStart') and conditionParamRef.sendSwitchStart != null"> </if>
${_conditionType_} a.sendSwitch <![CDATA[ >= ]]> #{${_conditionParam_}.sendSwitchStart} <if test="conditionParamRef.containsKey('callbackUrlList')">
${_conditionType_} a.callbackUrl in
<foreach collection="conditionParamRef.callbackUrlList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sendSwitch')">
<if test="conditionParamRef.sendSwitch != null ">
${_conditionType_} a.sendSwitch = #{${_conditionParam_}.sendSwitch}
</if> </if>
<if test="conditionParamRef.containsKey('sendSwitchEnd') and conditionParamRef.sendSwitchEnd != null"> <if test="conditionParamRef.sendSwitch == null">
${_conditionType_} a.sendSwitch <![CDATA[ <= ]]> #{${_conditionParam_}.sendSwitchEnd} ${_conditionType_} a.sendSwitch is null
</if> </if>
</if>
<if test="conditionParamRef.containsKey('sendSwitchList')">
${_conditionType_} a.sendSwitch in
<foreach collection="conditionParamRef.sendSwitchList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sendSwitchStart') and conditionParamRef.sendSwitchStart != null">
${_conditionType_} a.sendSwitch <![CDATA[ >= ]]> #{${_conditionParam_}.sendSwitchStart}
</if>
<if test="conditionParamRef.containsKey('sendSwitchEnd') and conditionParamRef.sendSwitchEnd != null">
${_conditionType_} a.sendSwitch <![CDATA[ <= ]]> #{${_conditionParam_}.sendSwitchEnd}
</if>
<if test="conditionParamRef.containsKey('platformRemark')"> <if test="conditionParamRef.containsKey('homeUrl')">
<if test="conditionParamRef.platformRemark != null and conditionParamRef.platformRemark != ''"> <if test="conditionParamRef.homeUrl != null and conditionParamRef.homeUrl != ''">
${_conditionType_} a.platformRemark like #{${_conditionParam_}.platformRemark} ${_conditionType_} a.homeUrl like #{${_conditionParam_}.homeUrl}
</if>
<if test="conditionParamRef.platformRemark == null">
${_conditionType_} a.platformRemark is null
</if>
</if> </if>
<if test="conditionParamRef.containsKey('platformRemarkList')"> <if test="conditionParamRef.homeUrl == null">
${_conditionType_} a.platformRemark in ${_conditionType_} a.homeUrl is null
<foreach collection="conditionParamRef.platformRemarkList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if> </if>
<if test="conditionParamRef.containsKey('createUserId')"> </if>
<if test="conditionParamRef.createUserId != null "> <if test="conditionParamRef.containsKey('homeUrlList')">
${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId} ${_conditionType_} a.homeUrl in
</if> <foreach collection="conditionParamRef.homeUrlList" open="(" close=")" index="index" item="item" separator=",">
<if test="conditionParamRef.createUserId == null"> #{item}
${_conditionType_} a.createUserId is null </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('platformRemark')">
<if test="conditionParamRef.platformRemark != null and conditionParamRef.platformRemark != ''">
${_conditionType_} a.platformRemark like #{${_conditionParam_}.platformRemark}
</if> </if>
<if test="conditionParamRef.containsKey('createUserIdList')"> <if test="conditionParamRef.platformRemark == null">
${_conditionType_} a.createUserId in ${_conditionType_} a.platformRemark is null
<foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if> </if>
<if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null"> </if>
${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart} <if test="conditionParamRef.containsKey('platformRemarkList')">
${_conditionType_} a.platformRemark in
<foreach collection="conditionParamRef.platformRemarkList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserId')">
<if test="conditionParamRef.createUserId != null ">
${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId}
</if> </if>
<if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null"> <if test="conditionParamRef.createUserId == null">
${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd} ${_conditionType_} a.createUserId is null
</if> </if>
</if>
<if test="conditionParamRef.containsKey('createUserIdList')">
${_conditionType_} a.createUserId in
<foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null">
${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
</if>
<if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('createTime')"> <if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null "> <if test="conditionParamRef.createTime != null ">
${_conditionType_} a.createTime = #{${_conditionParam_}.createTime} ${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
</if>
<if test="conditionParamRef.createTime == null">
${_conditionType_} a.createTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if> </if>
<if test="conditionParamRef.containsKey('updateUserId')"> <if test="conditionParamRef.createTime == null">
<if test="conditionParamRef.updateUserId != null "> ${_conditionType_} a.createTime is null
${_conditionType_} a.updateUserId = #{${_conditionParam_}.updateUserId}
</if>
<if test="conditionParamRef.updateUserId == null">
${_conditionType_} a.updateUserId is null
</if>
</if> </if>
<if test="conditionParamRef.containsKey('updateUserIdList')"> </if>
${_conditionType_} a.updateUserId in <if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
<foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=","> ${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
#{item} </if>
</foreach> <if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
</if> ${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
<if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null"> </if>
${_conditionType_} a.updateUserId <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart} <if test="conditionParamRef.containsKey('updateUserId')">
<if test="conditionParamRef.updateUserId != null ">
${_conditionType_} a.updateUserId = #{${_conditionParam_}.updateUserId}
</if> </if>
<if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null"> <if test="conditionParamRef.updateUserId == null">
${_conditionType_} a.updateUserId <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd} ${_conditionType_} a.updateUserId is null
</if> </if>
</if>
<if test="conditionParamRef.containsKey('updateUserIdList')">
${_conditionType_} a.updateUserId in
<foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null">
${_conditionType_} a.updateUserId <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart}
</if>
<if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null">
${_conditionType_} a.updateUserId <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateTime')"> <if test="conditionParamRef.containsKey('updateTime')">
<if test="conditionParamRef.updateTime != null "> <if test="conditionParamRef.updateTime != null ">
${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime} ${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
</if>
<if test="conditionParamRef.updateTime == null">
${_conditionType_} a.updateTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if> </if>
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''"> <if test="conditionParamRef.updateTime == null">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') ${_conditionType_} a.updateTime is null
</if> </if>
</if>
<if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
order by order by
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=","> <foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
${item.colName} ${item.sortKind} ${item.colName} ${item.sortKind}
</foreach> </foreach>
</trim> </trim>
</if> </if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()"> <if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by order by
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')"> <if test="orderCol.containsKey('id')">
a.id a.id
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if> <if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('platformName')"> <if test="orderCol.containsKey('platformName')">
a.platformName a.platformName
<if test='orderCol.platformName != null and "DESC".equalsIgnoreCase(orderCol.platformName)'>DESC</if> <if test='orderCol.platformName != null and "DESC".equalsIgnoreCase(orderCol.platformName)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('platformSn')"> <if test="orderCol.containsKey('platformSn')">
a.platformSn a.platformSn
<if test='orderCol.platformSn != null and "DESC".equalsIgnoreCase(orderCol.platformSn)'>DESC</if> <if test='orderCol.platformSn != null and "DESC".equalsIgnoreCase(orderCol.platformSn)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('sendMsgType')"> <if test="orderCol.containsKey('sendMsgType')">
a.sendMsgType a.sendMsgType
<if test='orderCol.sendMsgType != null and "DESC".equalsIgnoreCase(orderCol.sendMsgType)'>DESC</if> <if test='orderCol.sendMsgType != null and "DESC".equalsIgnoreCase(orderCol.sendMsgType)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('sendConfig')"> <if test="orderCol.containsKey('sendUrl')">
a.sendConfig a.sendUrl
<if test='orderCol.sendConfig != null and "DESC".equalsIgnoreCase(orderCol.sendConfig)'>DESC</if> <if test='orderCol.sendUrl != null and "DESC".equalsIgnoreCase(orderCol.sendUrl)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('sendSwitch')"> <if test="orderCol.containsKey('callbackUrl')">
a.sendSwitch a.callbackUrl
<if test='orderCol.sendSwitch != null and "DESC".equalsIgnoreCase(orderCol.sendSwitch)'>DESC</if> <if test='orderCol.callbackUrl != null and "DESC".equalsIgnoreCase(orderCol.callbackUrl)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('platformRemark')"> <if test="orderCol.containsKey('sendSwitch')">
a.platformRemark a.sendSwitch
<if test='orderCol.platformRemark != null and "DESC".equalsIgnoreCase(orderCol.platformRemark)'>DESC</if> <if test='orderCol.sendSwitch != null and "DESC".equalsIgnoreCase(orderCol.sendSwitch)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('createUserId')"> <if test="orderCol.containsKey('homeUrl')">
a.createUserId a.homeUrl
<if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if> <if test='orderCol.homeUrl != null and "DESC".equalsIgnoreCase(orderCol.homeUrl)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('createTime')"> <if test="orderCol.containsKey('platformRemark')">
a.createTime a.platformRemark
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if> <if test='orderCol.platformRemark != null and "DESC".equalsIgnoreCase(orderCol.platformRemark)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('updateUserId')"> <if test="orderCol.containsKey('createUserId')">
a.updateUserId a.createUserId
<if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if> <if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('updateTime')"> <if test="orderCol.containsKey('createTime')">
a.updateTime a.createTime
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if> <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('updateUserId')">
a.updateUserId
<if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateTime')">
a.updateTime
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
......
...@@ -165,24 +165,38 @@ data|object|数据对象|- ...@@ -165,24 +165,38 @@ data|object|数据对象|-
``` ```
### 获取平台产品列表
**请求URL:** m/api/getPlatformAndProduct
**请求方式:** GET ### 新增或更新设备
**请求URL:** m/api/saveOrUpdate
**请求方式:** POST
**鉴权头信息:** Authorization: {{token}}
**内容类型:** application/json;charset=utf-8 **内容类型:** application/json;charset=utf-8
**简要描述:** 查询平台产品列表数据,用于设备新增提交 **简要描述:** 保存或更新设备,设备deviceCode存在更新,不存在新增,
请求需添加接口鉴权token信息,来源getToken接口
**请求参数:** **请求参数:**
参数名称|类型|备注|必填|其它 参数名称|类型|备注|必填|其它
---|---|---|---|--- ---|---|---|---|---
deviceName|String|设备名称|否|-
deviceCode|String|设备编码,如MAC地址|是|-
platformCode|String|平台系统编码|是|见平台编码附录
productCode|String|产品编码|是|见产品编码附录
siteCode|String|站点编号,来源基础服务平台|是|-
siteName|String|站点名称|是|-
homeUrl|String|首页地址|否|-
deviceRemark|String|备注|是|-
**请求样例:** **请求样例:**
``` ```
{
}
``` ```
**响应参数:** **响应参数:**
...@@ -192,25 +206,16 @@ data|object|数据对象|- ...@@ -192,25 +206,16 @@ data|object|数据对象|-
code|Integer|结果码(-1.失败,1.成功)|- code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|- msg|String|消息|-
data|object|数据对象|- data|object|数据对象|-
&emsp;platformList|array|平台列表|数组
&emsp;&emsp;id|Long|ID|-
&emsp;&emsp;platformName|String|平台名称,名称唯一|-
&emsp;&emsp;platformSn|String|平台编码,编码唯一|-
&emsp;productList|array|产品列表|数组
&emsp;&emsp;id|Long|ID|-
&emsp;&emsp;productName|String|产品名称,名称唯一|-
&emsp;&emsp;productCode|String|产品编码,编码唯一|-
**响应消息样例:** **响应消息样例:**
``` ```
```
```
### 新增或更新设备 ### 激活设备
**请求URL:** m/api/saveOrUpdate **请求URL:** m/api/active
**请求方式:** POST **请求方式:** POST
...@@ -218,37 +223,20 @@ data|object|数据对象|- ...@@ -218,37 +223,20 @@ data|object|数据对象|-
**内容类型:** application/json;charset=utf-8 **内容类型:** application/json;charset=utf-8
**简要描述:** 保存或更新设备,设备deviceCode存在更新,不存在新增, **简要描述:** 激活设备
请求需添加接口鉴权token信息,来源getToken接口 请求需添加接口鉴权token信息,来源getToken接口
**请求参数:** **请求参数:**
参数名称|类型|备注|必填|其它 参数名称|类型|备注|必填|其它
---|---|---|---|--- ---|---|---|---|---
deviceName|String|设备名称|否|-
deviceCode|String|设备编码|是|- deviceCode|String|设备编码|是|-
deviceMac|String|设备的MAC地址|否|-
platformId|Long|平台系统Id|是|来源接口获取平台产品列表
platformName|String|平台系统名称|是|-
productId|Long|产品Id|是|来源接口获取平台产品列表
productName|String|产品名称|是|-
siteCode|String|站点编号,来源基础服务平台|是|-
siteName|String|站点名称|是|-
deviceRemark|String|备注|是|-
**请求样例:** **请求样例:**
``` ```
{ {
"deviceName":"lmfrs8",
"deviceCode":"yte9s3", "deviceCode":"yte9s3",
"siteCode":"nmyc5u",
"siteName":"a4vxhg",
"deviceMac":"y9tuaw",
"platformId":3125,
"productId":362,
"deviceRemark":"ah98cp",
} }
``` ```
...@@ -266,9 +254,9 @@ data|object|数据对象|- ...@@ -266,9 +254,9 @@ data|object|数据对象|-
``` ```
### 激活设备 ### 删除设备
**请求URL:** m/api/active **请求URL:** m/api/deviceDel
**请求方式:** POST **请求方式:** POST
...@@ -276,7 +264,7 @@ data|object|数据对象|- ...@@ -276,7 +264,7 @@ data|object|数据对象|-
**内容类型:** application/json;charset=utf-8 **内容类型:** application/json;charset=utf-8
**简要描述:** 激活设备 **简要描述:** 删除设备
请求需添加接口鉴权token信息,来源getToken接口 请求需添加接口鉴权token信息,来源getToken接口
**请求参数:** **请求参数:**
...@@ -307,7 +295,52 @@ data|object|数据对象|- ...@@ -307,7 +295,52 @@ data|object|数据对象|-
``` ```
### 回调各个平台通知消息
**请求URL:** 各平台通知地址
**请求方式:** POST
**内容类型:** application/json;charset=utf-8
**简要描述:** 设备新增激活下线等消息通知各个平台,当配置了地址时候
**请求参数:**
参数名称|类型|备注|必填|其它
:---|:---|:---|:---|:---
code|Integer|结果码(-1.失败,1.成功)|是|-
msg|String|消息|否|-
type|Integer|消息类型|是|0:设备增删改查,data数据域封装具体设备消息,1:设备消息类,数据域透传设备上行消息体。|-
data|object|数据对象|是|-
&emsp;deviceStatus|Integer|状态,1:新增,2:修改,3:删除,4:激活,5:上线,6:下线|是|-
&emsp;deviceName|String|设备名称|否|-
&emsp;deviceCode|String|设备编码,如MAC地址|是|-
&emsp;platformCode|String|平台系统编码|是|见平台编码附录
&emsp;productCode|String|产品编码|是|见产品编码附录
&emsp;siteCode|String|站点编号,来源基础服务平台|是|-
&emsp;siteName|String|站点名称|是|-
&emsp;deviceRemark|String|备注|是|-
**请求样例:**
```
{
}
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|-
data|object|数据对象|-
**响应消息样例:**
```
```
## 设备消息 ## 设备消息
......
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