Commit 73c4e8c0 by 叶立庆

svn to git

0 parents
Showing 175 changed files with 19643 additions and 0 deletions
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-rpc-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>cn.com.glsx.scrm</groupId>
<artifactId>rpc-scrm-clue-api</artifactId>
<version>5.3.0-SNAPSHOT</version>
<name>rpc-scrm-clue-api</name>
<properties>
<deploy.scanPackage>cn.com.glsx.clue.remote</deploy.scanPackage>
</properties>
<dependencies>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.2</version>
<exclusions>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>rpc-api-deploy-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>cn.com.glsx.scrm</groupId>
<artifactId>rpc-scrm-clue-api</artifactId>
<version>5.3.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package cn.com.glsx.scrm.clue.constants;
/**
* 公共常亮
* @author yangwei
* @version 1.0
* @since 2025/10/17 16:24
*/
public interface BurialPointConstants {
/** 展业助手 */
String SYSTEM_ID_PAD = "business_development_assistant";
}
package cn.com.glsx.scrm.clue.constants;
/**
* 符号常量接口
* @author yangwei
* @version 1.0
* @since 2025/10/15 18:54
*/
public interface SymbolConstants {
String MINUS = "-";
}
package cn.com.glsx.scrm.clue.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
@Data
public class BurialPointRecordDTO implements Serializable {
/**
* 登录账号名称
*/
@ApiModelProperty(name = "loginAccount", notes = "登录账号名称")
private String loginAccount;
@ApiModelProperty(name = "phoneNumber", notes = "手机号码,车生活助手-C端传递")
private String phoneNumber;
/**
* 账号类型
*/
@ApiModelProperty(name = "userType", notes = "账号类型")
private Integer userType;
/**
* 账号uuid
*/
@ApiModelProperty(name = "uuid", notes = "账号uuid")
private String uuid;
/**
* 系统来源
,0-小程序,1-pc端
*/
@NotNull(message = "系统来源不能为空")
@ApiModelProperty(name = "systemSource", notes = "系统来源,0-生意助手小程序,1-嘀加智享车生活(pc端),2-车生活助手C端-小程序,3-展业助手")
private Integer systemSource;
@ApiModelProperty(name = "scene", notes = "业务场景,0 会员权益升级 1 精品升级 3 售后众筹 ,2次新车转化")
private Integer scene;
/**
* 游客ID
,预留字段
*/
@ApiModelProperty(name = "visitorId", notes = "游客ID")
private String visitorId;
/**
* 触发时间
*/
@NotNull(message = "触发时间不能为空")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(name = "eventTime", notes = "触发时间")
private Date eventTime;
/**
* 动作类型
,0-点击,1-滚动,2-浏览
*/
@NotNull(message = "动作类型不能为空")
@ApiModelProperty(name = "eventType", notes = "动作类型,0-点击,1-滚动,2-浏览")
private Integer eventType;
/**
* 上一级页面路径
*/
@ApiModelProperty(name = "prePagePath", notes = "上一级页面路径")
private String prePagePath;
/**
* 当前页面路径
*/
@NotEmpty(message = "当前页面路径不能为空")
@ApiModelProperty(name = "pagePath", notes = "当前页面路径")
private String pagePath;
/**
* 事件别名
*/
@NotEmpty(message = "事件别名不能为空")
@ApiModelProperty(name = "eventCode", notes = "事件别名")
private String eventCode;
/**
* 浏览批次id
*/
@ApiModelProperty(name = "batchId", notes = "浏览批次id")
private String batchId;
/**
* 业务参数
*/
@ApiModelProperty(name = "businessParam", notes = "业务参数")
private String businessParam;
@ApiModelProperty(name = "businessId", notes = "业务id")
private String businessId;
}
package cn.com.glsx.scrm.clue.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class BurialPointSummaryDTO implements Serializable {
@ExcelIgnore
private Integer scene;
@ExcelProperty(value = "场景")
private String sceneName;
@ExcelIgnore
private String eventCode;
@ExcelProperty(value = "模块名称")
private String eventName;
/**
* 点击次数
*/
@ExcelProperty(value = "点击次数")
private Integer clickCount;
/**
* 使用人数
*/
@ExcelProperty(value = "使用人数")
private Integer usersCount;
}
package cn.com.glsx.scrm.clue.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class BurialPointSummaryExcel implements Serializable {
@ExcelProperty(value = "场景")
private String scene;
@ExcelProperty(value = "模块名称")
private String eventName;
/**
* 点击次数
*/
@ExcelProperty(value = "点击次数")
private Integer clickCount;
/**
* 使用人数
*/
@ExcelProperty(value = "使用人数")
private Integer usersCount;
}
package cn.com.glsx.scrm.clue.dto;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class BurialPointSummaryParam implements Serializable {
/**
* 开始时间
*/
@ApiModelProperty(notes = "开始时间,yyyy-MM-dd HH:mm:ss")
private String startTime;
/**
* 结束时间
*/
@ApiModelProperty(notes = "结束时间,yyyy-MM-dd HH:mm:ss")
private String endTime;
/**
* 事件别名列表
*/
@ApiModelProperty(notes = "事件别名列表")
private List<String> codeList;
/**
* 业务场景,0 会员权益升级 1 精品升级 3 售后众筹 ,2次新车转化
*/
@ApiModelProperty(notes = "业务场景,0 会员权益升级 1 精品升级 3 售后众筹 ,2次新车转化")
private Integer scene;
/**
* 0-生意助手小程
* 序,1-嘀加智享
* 车生活(pC
* 端),2-车生活
* 助手C端-小程序,3-展业助手
*/
@ApiModelProperty(notes = "系统来源,0-生意助手小程序,1-嘀加智享车生活(pC端),2-车生活助手C端-小程序,3-展业助手")
private Integer systemSource;
@ApiModelProperty(notes = "动作类型,0-点击,1-滚动,2-浏览")
private Integer eventType = 0;
@ApiModelProperty(notes = "动作类型,0-点击,1-滚动,2-浏览")
private List<Integer> eventTypes = Lists.newArrayList(0);
}
package cn.com.glsx.scrm.clue.dto;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import cn.com.glsx.scrm.clue.model.ClueOrderFollow;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
@Data
@ToString
public class ClueOrderDTO extends ClueOrder {
@ApiModelProperty(name = "keyword", notes = "关键字", dataType = "String")
private String keyword;
@ApiModelProperty(name = "followTime", notes = "跟进时长", dataType = "String")
private String followTime;
@ApiModelProperty(name = "followList", notes = "跟进记录列表", dataType = "list")
private List<ClueOrderFollow> followList;
@ApiModelProperty(name = "carName", notes = "车辆名称", dataType = "String")
private String carName;
@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(name = "appointDate", notes = "预约日期", dataType = "Date")
private Date appointDate;
@JsonFormat(pattern="HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "HH:mm:ss")
@ApiModelProperty(name = "appointTime", notes = "预约时间", dataType = "Date")
private Date appointTime;
}
package cn.com.glsx.scrm.clue.dto;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import cn.com.glsx.scrm.clue.model.ClueVehicle;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import javax.persistence.Column;
@Data
@ToString
public class ClueVehicleDTO extends ClueVehicle {
/**
* 最低指导价
*/
@ApiModelProperty(name = "guidePriceMin", notes = "最低指导价", dataType = "string")
private String guidePriceMin;
/**
* 最高指导价
*/
@ApiModelProperty(name = "guidePriceMax", notes = "最高指导价", dataType = "string")
private String guidePriceMax;
/**
* 品牌图片
*/
@ApiModelProperty(name = "logoUrl", notes = "品牌图片", dataType = "string")
private String logoUrl;
/**
* 首字母
*/
@ApiModelProperty(name = "letter", notes = "首字母", dataType = "string")
private String letter;
}
package cn.com.glsx.scrm.clue.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class SceneMarketBurialPointExcel implements Serializable {
@ExcelIgnore
private Integer scene;
@ExcelProperty(value = "场景")
private String sceneName;
@ExcelProperty(value = "业务")
private String levelOneName;
@ExcelProperty(value = "子业务")
private String levelTwoName;
@ExcelProperty(value = "内容名称")
private String title;
@ExcelProperty(value = "内容ID")
private String businessId;
/**
* 点击次数
*/
@ExcelProperty(value = "点击次数")
private Integer clickCount;
@ExcelProperty(value = "AI对话对话轮次")
private Integer dialogueCount;
/**
* 使用人数
*/
@ExcelProperty(value = "使用人数")
private Integer usersCount;
}
package cn.com.glsx.scrm.clue.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
/**
* 智享车生活埋点统计DTO
* @author yangwei
* @version 1.0
* @since 2025/10/30 15:20
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class SmartCarLifeBurialPointStatisticsDTO {
@ExcelProperty(value = "一级模块", index = 0)
private String firstModule;
@ExcelProperty(value = "二级模块", index = 1)
private String secondModule;
@ExcelProperty(value = "模块名称", index = 2)
private String eventName;
@ExcelProperty(value = "点击次数", index = 3)
private Integer clickCount;
@ExcelProperty(value = "使用人数", index = 4)
private Integer usersCount;
}
package cn.com.glsx.scrm.clue.dto.collision;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class CollisionAddressDTO implements Serializable {
/**
* 经纬度
*/
@ApiModelProperty(notes = "经纬度")
private Double[] lnglat;
/**
* 姓名
*/
@ApiModelProperty(notes = "name")
private String name;
/**
* 经度
*/
@ApiModelProperty(notes = "经度")
private Double x;
/**
* 纬度
*/
@ApiModelProperty(notes = "纬度")
private Double y;
/**
* 角度
*/
@ApiModelProperty(notes = "角度")
private Integer ag;
/**
* 时间
*/
@ApiModelProperty(notes = "时间")
private Long tm;
/**
* 速度
*/
@ApiModelProperty(notes = "速度")
private Integer sp;
/**
* 时间
*/
@ApiModelProperty(notes = "时间,HH:mm:ss")
private String time;
}
package cn.com.glsx.scrm.clue.dto.collision;
import cn.com.glsx.scrm.clue.enums.collision.DeviceTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.io.Serializable;
import java.util.Date;
@Data
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CollisionSnInfoDTO implements Serializable {
@ApiModelProperty(notes = "id")
private Integer id;
/**
* 设备号
*/
@ApiModelProperty(notes = "设备号")
private String sn;
/**
* 批次id
*/
@ApiModelProperty(notes = "批次id")
private Integer batchId;
/**
* 商户号
*/
@ApiModelProperty(notes = "商户号")
private Integer merchantId;
/**
* 商户名称
*/
@ApiModelProperty(notes = "商户名称")
private String merchantName;
/**
* 设备类型
* @see DeviceTypeEnum
*/
@ApiModelProperty(notes = "设备类型",example = "1:OBD\n" +
",2: DVD,\n" +
"3: 电子狗\n" +
",5 :TBOX(2G),\n" +
"6 行车记录仪\n" +
",7 :BBOX\n" +
",8: 追踪器\n" +
",9 :车载wifi\n" +
",12134 : 智能云镜\n" +
", 12499: AIBox\n" +
",12500: 小镜SOS记录仪,\n" +
"12501 : 智能定位车充\n" +
",12503: 数字车钥匙\n" +
",12514 :后视镜B300")
private Integer snType;
/**
* iccid
*/
@ApiModelProperty(notes = "iccid")
private String iccid;
/**
* 客户名称
*/
@ApiModelProperty(notes = "客户名称")
private String customerName;
/**
* 客户手机号
*/
@ApiModelProperty(notes = "客户手机号")
private String customerPhone;
/**
* 客户性别,0-男,1-女
*/
@ApiModelProperty(notes = "客户性别,0-男,1-女")
private Integer customerSex;
/**
* 车牌号
*/
@ApiModelProperty(notes = "车牌号")
private String licensePlate;
/**
* 车架号
*/
@ApiModelProperty(notes = "车架号")
private String standNo;
/**
* 设备安装时的初始里程
*/
@ApiModelProperty(notes = "设备安装时的初始里程")
private Long initialMileage;
/**
* 上次保养里程
*/
@ApiModelProperty(notes = "上次保养里程")
private Long lastMileage;
/**
* 上次保养时间
*/
@ApiModelProperty(notes = "上次保养时间")
private Date lastTime;
/**
* 下次保养里程
*/
@ApiModelProperty(notes = "下次保养里程")
private Long lowerMileage;
/**
* 下次保养时间
*/
@ApiModelProperty(notes = "下次保养时间")
private Date lowerTime;
/**
* 是否更换设备,0-保修更换-免费,1-维修更换,2-购买
* @see cn.com.glsx.scrm.clue.enums.collision.DeviceReplaceEnum
*/
@ApiModelProperty(notes = "是否更换设备,0-保修更换-免费,1-维修更换,2-购买")
private Integer replaceFlag;
/**
* 汽车品牌ID
*/
@ApiModelProperty(notes = "汽车品牌ID")
private Integer vehicleBrandId;
/**
* 汽车品牌
*/
@ApiModelProperty(notes = "汽车品牌")
private String vehicleBrandName;
/**
* 子品牌ID
*/
@ApiModelProperty(notes = "子品牌ID")
private Integer vehicleSubBrandId;
/**
* 子品牌名称
*/
@ApiModelProperty(notes = "子品牌名称")
private String vehicleSubBrandName;
/**
* 车系ID
*/
@ApiModelProperty(notes = "车系ID")
private Integer vehicleSeriesId;
/**
* 车系名称
*/
@ApiModelProperty(notes = "车系名称")
private String vehicleSeriesName;
/**
* 车型ID
*/
@ApiModelProperty(notes = "车型ID")
private Integer vehicleShapeId;
/**
* 车型名称
*/
@ApiModelProperty(notes = "车型名称")
private String vehicleShapeName;
/**
* 是否删除(0=正常,-1=删除)
*/
@ApiModelProperty(notes = "是否删除(0=正常,-1=删除)")
private Integer delFlag;
/**
* 创建人
*/
@ApiModelProperty(notes = "创建人")
private String createdBy;
/**
* 创建时间
*/
@ApiModelProperty(notes = "创建时间")
private Date createdTime;
/**
* 更新人
*/
@ApiModelProperty(notes = "更新人")
private String updatedBy;
/**
* 更新时间
*/
@ApiModelProperty(notes = "更新时间")
private Date updatedTime;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.dto.collision;
import cn.com.glsx.scrm.clue.enums.collision.DeviceTypeEnum;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.io.Serializable;
@Data
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CollisionSnInfoExportDTO implements Serializable {
/**
* 商户名称
*/
@ExcelProperty(value = "商户名称")
@ApiModelProperty(notes = "商户名称")
private String merchantName;
/**
* 商户号
*/
@ExcelProperty(value = "商户号")
@ApiModelProperty(notes = "商户号")
private Integer merchantId;
/**
* 设备类型
* @see DeviceTypeEnum
*/
@ExcelProperty(value = "设备类型")
@ApiModelProperty(notes = "设备类型",example = "1:OBD\n" +
",2: DVD,\n" +
"3: 电子狗\n" +
",5 :TBOX(2G),\n" +
"6 行车记录仪\n" +
",7 :BBOX\n" +
",8: 追踪器\n" +
",9 :车载wifi\n" +
",12134 : 智能云镜\n" +
", 12499: AIBox\n" +
",12500: 小镜SOS记录仪,\n" +
"12501 : 智能定位车充\n" +
",12503: 数字车钥匙\n" +
",12514 :后视镜B300")
private String snType;
/**
* 设备号
*/
@ExcelProperty(value = "IMEI/SN")
@ApiModelProperty(notes = "设备号")
private String sn;
/**
* iccid
*/
@ExcelProperty(value = "ICCID")
@ApiModelProperty(notes = "iccid")
private String iccid;
/**
* 客户手机号
*/
@ExcelProperty(value = "客户电话")
@ApiModelProperty(notes = "客户手机号")
private String customerPhone;
/**
* 客户名称
*/
@ExcelProperty(value = "客户姓名")
@ApiModelProperty(notes = "客户名称")
private String customerName;
/**
* 客户性别,0-男,1-女
*/
@ExcelProperty(value = "性别")
@ApiModelProperty(notes = "客户性别,0-男,1-女")
private String customerSex;
/**
* 车牌号
*/
@ExcelProperty(value = "车牌号")
@ApiModelProperty(notes = "车牌号")
private String licensePlate;
/**
* 车架号
*/
@ExcelProperty(value = "车架号")
@ApiModelProperty(notes = "车架号")
private String standNo;
@ExcelProperty(value = "车型")
@ApiModelProperty(notes = "车型名称")
private String vehicleShapeName;
/**
* 设备安装时的初始里程
*/
@ExcelProperty(value = "设备安装时的初始里程")
@ApiModelProperty(notes = "设备安装时的初始里程")
private Long initialMileage;
/**
* 上次保养里程
*/
@ExcelProperty(value = "上次保养里程")
@ApiModelProperty(notes = "上次保养里程")
private Long lastMileage;
/**
* 上次保养时间
*/
@ExcelProperty(value = "上次保养时间")
@ApiModelProperty(notes = "上次保养时间")
private String lastTime;
/**
* 下次保养里程
*/
@ExcelProperty(value = "下次保养里程")
@ApiModelProperty(notes = "下次保养里程")
private Long lowerMileage;
/**
* 下次保养时间
*/
@ExcelProperty(value = "下次保养时间")
@ApiModelProperty(notes = "下次保养时间")
private String lowerTime;
/**
* 是否更换设备,0-保修更换-免费,1-维修更换,2-购买
* @see cn.com.glsx.scrm.clue.enums.collision.DeviceReplaceEnum
*/
@ExcelProperty(value = "是否更换设备")
@ApiModelProperty(notes = "是否更换设备,0-保修更换-免费,1-维修更换,2-购买")
private String replaceFlag;
/**
* 更新时间
*/
@ExcelProperty(value = "操作时间")
@ApiModelProperty(notes = "更新时间")
private String updatedTime;
/**
* 更新人
*/
@ExcelProperty(value = "操作人")
@ApiModelProperty(notes = "更新人")
private String updatedBy;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.enums;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.List;
/**
* 埋点事件编码
* @author yangwei
* @version 1.0
* @since 2025/10/30 13:48
*/
@Getter
@AllArgsConstructor
public enum BurialPointEventCode {
ACTIVITY_MANAGEMENT_IMPORT("activity_management_export", "内容管理-活动管理-获奖名单导出", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
ACTIVITY_MANAGEMENT_DETAIL("activity_management_detail", "内容管理-活动管理-查看", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
ACTIVITY_MANAGEMENT_DEL("activity_management_del", "内容管理-活动管理-删除", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
ACTIVITY_MANAGEMENT_EDIT("activity_management_edit", "内容管理-活动管理-编辑", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
ACTIVITY_MANAGEMENT("activity_management", "内容管理-活动管理-页面浏览", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
FAILURE_TO_REPORT_RECEPTION("failure_to_report_reception", "预警管理-接待缺失报审核-页面浏览", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
FAILURE_TO_REPORT_RECEPTION_AUDIT("failure_to_report_reception_audit", "预警管理-接待缺失报审核-审核", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
FAILURE_TO_REPORT_RECEPTION_REJECT("failure_to_report_reception_reject", "预警管理-接待缺失报审核-重新审核", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
FAILURE_TO_REPORT_RECEPTION_PASS("failure_to_report_reception_pass", "预警管理-接待缺失报审核-批量通过", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
FAILURE_TO_REPORT_RECEPTION_ALL_REJECT("failure_to_report_reception_all_reject", "预警管理-接待缺失报审核-批量驳回", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
FAILURE_TO_REPORT_RECEPTION_ALL_EXPORT("failure_to_report_reception_export", "预警管理-接待缺失报审核-导出", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1), true),
MINI_PAD_MISSING_RECEPTION("mini_pad_missing_reception", "小程序-平板接待缺失报备", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_2), true),
MINI_ADD_PAD_MISSING_RECEPTION("mini_add_pad_missing_reception", "小程序-提交平板接待缺失报备", Lists.newArrayList(BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_2), true),
;
/** 埋点事件编码 */
private final String code;
/** 简单描述 */
private final String desc;
/** 埋点事件分组,用于判断那些代码需要进行查询 */
private final List<BurialPointEventCodeGroup> burialPointEventCodeGroups;
/** 是否启用 */
private final Boolean enable;
}
package cn.com.glsx.scrm.clue.enums;
/**
* 同一个服务,可能会生成多个文件,为后期维护性给 EventCode 设置分组
* @see BurialPointEventCode
* @author yangwei
* @version 1.0
* @since 2025/10/30 14:36
*/
public enum BurialPointEventCodeGroup {
DJ_SMART_CAR_LIFE_1, DJ_SMART_CAR_LIFE_2;
}
package cn.com.glsx.scrm.clue.enums;
import cn.com.glsx.framework.core.enums.BaseEnum;
/**
* 埋点动作类型枚举
*/
public enum BurialPointEventTypeEnum implements BaseEnum<BurialPointEventTypeEnum, Integer> {
CLICK(0, "点击"),
ROLL(1, "滚动"),
BROWSE(2, "浏览")
;
private final String text;
private final Integer value;
BurialPointEventTypeEnum(Integer value, String text) {
this.value = value;
this.text = text;
}
@Override
public Integer getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.text;
}
}
package cn.com.glsx.scrm.clue.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 埋点统计周期
* @author yangwei
* @version 1.0
* @since 2025/10/30 14:22
*/
@Getter
@AllArgsConstructor
public enum BurialPointStatisticsCycle {
LAST_WEEK,
LAST_MONTH,
LAST_QUARTER,
LAST_HALF_YEAR,
LAST_YEAR
}
package cn.com.glsx.scrm.clue.enums;
import cn.com.glsx.scrm.clue.dto.BurialPointSummaryDTO;
import cn.com.glsx.scrm.clue.dto.BurialPointSummaryParam;
import java.util.List;
import java.util.Map;
/**
* 埋点统计接口
* @author yangwei
* @version 1.0
* @since 2025/10/30 16:18
*/
public interface BurialPointStatisticsInter {
/**
* 获取埋点统计数据
* @param param 参数
* @return 数据
*/
List<? extends BurialPointSummaryDTO> fetch(BurialPointSummaryParam param);
/**
* 转换数据
* @param sourceList 数据源
* @param eventCodeMap 事件代码
* @return 转换后的数据
*/
List<?> convert(List<? extends BurialPointSummaryDTO> sourceList, Map<String, String> eventCodeMap);
}
package cn.com.glsx.scrm.clue.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 埋点系统来源
* @author yangwei
* @version 1.0
* @since 2025/10/30 14:02
*/
@Getter
@AllArgsConstructor
public enum BurialPointSystemSource {
BUSINESS_ASSISTANT("生意助手小程序", 0),
CAR_LIFE("嘀加智享车生活(pc端)", 1),
CAR_LIFE_APP("车生活助手C端-小程序", 2),
EXHIBITION_ASSISTANT("展业助手", 3),
MODEL("大模型", 4),
;
private final String source;
private final Integer code;
}
package cn.com.glsx.scrm.clue.enums;
import cn.com.glsx.framework.core.enums.BaseEnum;
public enum ClueChannelTypeEnum implements BaseEnum<ClueChannelTypeEnum, String> {
DJ("DJ","嘀加"),
GH("GH","广汇")
;
private final String text;
private final String value;
ClueChannelTypeEnum(String value, String text){
this.value = value;
this.text = text;
}
@Override
public String getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.text;
}
}
package cn.com.glsx.scrm.clue.enums;
import cn.com.glsx.framework.core.enums.BaseEnum;
public enum ClueFollowTypeEnum implements BaseEnum<ClueFollowTypeEnum, String> {
FOLLOW_RECORD("0","新增跟进记录"),
FOLLOW_SUCCESS("1","跟进完成")
;
private final String text;
private final String value;
ClueFollowTypeEnum(String value, String text){
this.value = value;
this.text = text;
}
@Override
public String getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.text;
}
}
package cn.com.glsx.scrm.clue.enums;
import cn.com.glsx.framework.core.enums.BaseEnum;
public enum ClueStaffTypeEnum implements BaseEnum<ClueStaffTypeEnum, String> {
BEFORE("1","售前专员"),
AFTER("2","售后专员"),
;
private final String text;
private final String value;
ClueStaffTypeEnum(String value, String text){
this.value = value;
this.text = text;
}
@Override
public String getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.text;
}
}
package cn.com.glsx.scrm.clue.enums;
import cn.com.glsx.framework.core.enums.BaseEnum;
public enum ClueStatusEnum implements BaseEnum<ClueStatusEnum, String> {
WAIT_DEALING("0","待跟进"),
DEALING("1","跟进中"),
SUCCESS("2","已完成")
;
private final String text;
private final String value;
ClueStatusEnum(String value, String text){
this.value = value;
this.text = text;
}
@Override
public String getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.text;
}
}
package cn.com.glsx.scrm.clue.enums;
import cn.com.glsx.framework.core.enums.BaseEnum;
public enum ClueTypeEnum implements BaseEnum<ClueTypeEnum, String> {
COMPLAINT("1","客户意见"),
USER_CAR("2","卖车询价"),
RESCUE("3","救援服务"),
NEW_CAR("4","新车询价"),
DRIVE("5","试驾预约"),
MAINTAIN("6","维保预约")
;
private final String text;
private final String value;
ClueTypeEnum(String value, String text){
this.value = value;
this.text = text;
}
@Override
public String getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.text;
}
}
package cn.com.glsx.scrm.clue.enums;
import cn.com.glsx.framework.core.enums.BaseEnum;
public enum ClueVehicleStatusEnum implements BaseEnum<ClueVehicleStatusEnum, String> {
OFFLINE("0","下架"),
ONLINE("1","上家")
;
private final String text;
private final String value;
ClueVehicleStatusEnum(String value, String text){
this.value = value;
this.text = text;
}
@Override
public String getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.text;
}
}
package cn.com.glsx.scrm.clue.enums.collision;
import cn.com.glsx.framework.core.enums.BaseEnum;
public enum CollisionEventTypeEnum implements BaseEnum<CollisionEventTypeEnum, String> {
/**
* 紧急求助
*/
SOS("SOS", "紧急求助"),
/**
* 碰撞
*/
COLLIDE("COLLIDE", "碰撞"),
/**
* 震动
*/
VIBRATION("VIBRATION", "震动"),
// 客户自提
CUSTOMER_SUBMIT("CUSTOMER_SUBMIT", "客户自提");
private String value;
private String displayName;
private CollisionEventTypeEnum(String value, String displayName){
this.value = value;
this.displayName = displayName;
}
@Override
public String getValue() {
return value;
}
@Override
public String getDisplayName() {
return displayName;
}
public static CollisionEventTypeEnum getByValue(String value){
if(null == value){
return null;
}
for(CollisionEventTypeEnum e: CollisionEventTypeEnum.values()){
if(e.getValue().equals(value)){
return e;
}
}
return null;
}
@Override
public String toString() {
return this.name().concat("[value:").concat(getValue()).concat(", displayName:").concat(getDisplayName()).concat("]");
}
}
package cn.com.glsx.scrm.clue.enums.collision;
import cn.com.glsx.framework.core.enums.BaseEnum;
import java.util.HashMap;
import java.util.Map;
/**
* 碰撞线索-媒体消息类型枚举
*/
public enum CollisionMediaTypeEnum implements BaseEnum<CollisionMediaTypeEnum, String> {
/**
* 图片
*/
IMAGE("IMAGE", "图片", 1),
/**
* 视频
*/
VIDEO("VIDEO", "视频", 2);
private String value;
private String displayName;
private Integer code;
private static Map<Integer, String> codeMap = new HashMap<Integer, String>(2);
static{
for(CollisionMediaTypeEnum e:CollisionMediaTypeEnum.values()){
codeMap.put(e.getCode(), e.getValue());
}
}
private CollisionMediaTypeEnum(String value, String displayName, Integer code){
this.value = value;
this.displayName = displayName;
this.code = code;
}
@Override
public String getValue() {
return value;
}
@Override
public String getDisplayName() {
return displayName;
}
public Integer getCode(){
return code;
}
public static String getValueByCode(Integer code){
return codeMap.get(code);
}
@Override
public String toString() {
return this.name().concat("[value:").concat(getValue()).concat(", displayName:").concat(getDisplayName()).concat("]");
}
}
package cn.com.glsx.scrm.clue.enums.collision;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Optional;
/**
* @Author yelq
* @Version 1.0
* @Description: 是否更换设备:支持填写“保修更换-免费”、“维修更换”、“购买”
* @Date 2023/10/11 18:12
*/
@Getter
@AllArgsConstructor
public enum DeviceReplaceEnum implements Serializable {
REPLACE_FREE(0, "保修更换-免费"),
MAINTENANCE_REPLACE(1, "维修更换"),
BUY(2, "购买");
private final Integer code;
private final String displayName;
public static Integer getCodeByDisplayName(String displayName) {
if (StringUtils.isEmpty(displayName)) return null;
Optional<DeviceReplaceEnum> first = Arrays.stream(DeviceReplaceEnum.values()).filter(s -> s.displayName.equals(displayName)).findFirst();
return first.map(deviceReplaceEnum -> deviceReplaceEnum.code).orElse(null);
}
public static String getDisplayNameByCode(Integer code) {
if (StringUtils.isEmpty(code)) return null;
Optional<DeviceReplaceEnum> first = Arrays.stream(DeviceReplaceEnum.values()).filter(s -> s.code.equals(code)).findFirst();
return first.map(deviceReplaceEnum -> deviceReplaceEnum.displayName).orElse(null);
}
}
package cn.com.glsx.scrm.clue.enums.collision;
import cn.com.glsx.framework.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Objects;
/**
* @Author yelq
* @Version 1.0
* @Description: 设备类型
* @Date 2023/10/11 17:04
*/
@Getter
@AllArgsConstructor
public enum DeviceTypeEnum implements BaseEnum<DeviceTypeEnum,Integer> {
OBD(1, "OBD"),
DVD(2, "DVD"),
ELECTRONIC_DOG(3, "电子狗"),
TBOX_2G(5, "TBOX(2G)"),
DRIVING_RECORDER(6, "行车记录仪"),
BBOX(7, "BBOX"),
TRACKER(8, "追踪器"),
CAR_WIFI(9, "车载WiFi"),
SMART_MIRROR(12134, "智能云镜"),
AIBOX(12499, "AIBox"),
SMALL_MIRROR_SOS_RECORDER(12500, "小镜SOS记录仪"),
SMART_POSITION_CAR_CHARGER(12501, "智能定位车充"),
DIGITAL_CAR_KEY(12503, "数字车钥匙"),
REARVIEW_MIRROR_B300(12514, "后视镜B300");
private final int value;
private final String displayName;
@Override
public Integer getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.displayName;
}
public static DeviceTypeEnum getEnumByValue(Integer value) {
DeviceTypeEnum[] var1 = values();
int var2 = var1.length;
for(int var3 = 0; var3 < var2; ++var3) {
DeviceTypeEnum activityParameterTypeEnum = var1[var3];
if (Objects.equals(value, activityParameterTypeEnum.getValue())) {
return activityParameterTypeEnum;
}
}
return null;
}
public static String getEnumDisplayByValue(Integer value) {
DeviceTypeEnum[] var1 = values();
int var2 = var1.length;
for(int var3 = 0; var3 < var2; ++var3) {
DeviceTypeEnum activityParameterTypeEnum = var1[var3];
if (Objects.equals(value, activityParameterTypeEnum.getValue())) {
return activityParameterTypeEnum.getDisplayName();
}
}
return null;
}
}
package cn.com.glsx.scrm.clue.enums.collision;
import cn.com.glsx.framework.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Objects;
/**
* 碰撞线索-回访结果
*/
@AllArgsConstructor
@Getter
public enum FollowResultEnum implements BaseEnum<FollowResultEnum,Integer> {
REAL_ACCIDENT(0, "真实事故"),
UNREAL_ACCIDENT(1, "非真实事故"),
UNABLE_TO_HANDLE(2, "无法处理");
private final int value;
private final String displayName;
@Override
public Integer getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.displayName;
}
public static String getEnumDisplayByValue(Integer value) {
FollowResultEnum[] var1 = values();
int var2 = var1.length;
for(int var3 = 0; var3 < var2; ++var3) {
FollowResultEnum activityParameterTypeEnum = var1[var3];
if (Objects.equals(value, activityParameterTypeEnum.getValue())) {
return activityParameterTypeEnum.getDisplayName();
}
}
return null;
}
}
package cn.com.glsx.scrm.clue.enums.collision;
import cn.com.glsx.framework.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Objects;
/**
* 碰撞线索-回访状态枚举
*/
@AllArgsConstructor
@Getter
public enum FollowStatusEnum implements BaseEnum<FollowStatusEnum,Integer> {
NO_FOLLOW(0, "未回访"),
ALREADY_FOLLOW(1, "已回访");
private final int value;
private final String displayName;
@Override
public Integer getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.displayName;
}
public static String getEnumDisplayByValue(Integer value) {
FollowStatusEnum[] var1 = values();
int var2 = var1.length;
for(int var3 = 0; var3 < var2; ++var3) {
FollowStatusEnum activityParameterTypeEnum = var1[var3];
if (Objects.equals(value, activityParameterTypeEnum.getValue())) {
return activityParameterTypeEnum.getDisplayName();
}
}
return null;
}
}
package cn.com.glsx.scrm.clue.enums.collision;
import cn.com.glsx.framework.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Objects;
/**
* 碰撞线索-推送配置类型枚举
*/
@AllArgsConstructor
@Getter
public enum PushConfigTypeEnum implements BaseEnum<PushConfigTypeEnum,Integer> {
MERCHANT(0, "门店提醒"),
CUSTOMER(1, "车主提醒");
private final int value;
private final String displayName;
@Override
public Integer getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.displayName;
}
public static String getEnumDisplayByValue(Integer value) {
PushConfigTypeEnum[] var1 = values();
int var2 = var1.length;
for(int var3 = 0; var3 < var2; ++var3) {
PushConfigTypeEnum activityParameterTypeEnum = var1[var3];
if (Objects.equals(value, activityParameterTypeEnum.getValue())) {
return activityParameterTypeEnum.getDisplayName();
}
}
return null;
}
}
package cn.com.glsx.scrm.clue.enums.collision;
import cn.com.glsx.framework.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Objects;
/**
* 碰撞线索-推送提醒开关枚举
*/
@AllArgsConstructor
@Getter
public enum PushFlagEnum implements BaseEnum<PushFlagEnum,Integer> {
OFF(0, "关"),
ON(1, "开");
private final int value;
private final String displayName;
@Override
public Integer getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.displayName;
}
public static String getEnumDisplayByValue(Integer value) {
PushFlagEnum[] var1 = values();
int var2 = var1.length;
for(int var3 = 0; var3 < var2; ++var3) {
PushFlagEnum activityParameterTypeEnum = var1[var3];
if (Objects.equals(value, activityParameterTypeEnum.getValue())) {
return activityParameterTypeEnum.getDisplayName();
}
}
return null;
}
}
package cn.com.glsx.scrm.clue.enums.exception;
import cn.com.glsx.framework.core.enums.ErrorEnum;
public enum ClueExceptionEnum implements ErrorEnum{
IMPORT_FILE_HEAD_ERR("21100001","导入的格式错误,请检查后重试!"),
FIND_MERCHANT_EXCEPTION("21100002", "查询商户异常!"),
URL_NULL_ERR("2110003","上传文件为空!"),
FILE_SERVER_LOAD_ERR("2110004","文件服务器返回数据为空!"),
UPLOAD_EXCEL_ERR("2110005","模板类型不匹配,请上传.xls/.xlsx文件。"),
QUERY_MERCHANT_NAME_ERR("211006","门店名称查询失败!"),
;
public String getDescrible() {
return describle;
}
public void setDescrible(String describle) {
this.describle = describle;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
private String describle;
private String code;
private ClueExceptionEnum(String code, String describle){
this.describle = describle;
this.code = code;
}
@Override
public String getValue() {
return code;
}
@Override
public String getDisplayName() {
return describle;
}
}
package cn.com.glsx.scrm.clue.model;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
@Data
@Table(name = "clue_burial_point_event_info")
public class BurialPointEventInfo implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 事件编码
*/
@Column(name = "event_code")
private String eventCode;
/**
* 事件名称
*/
@Column(name = "event_name")
private String eventName;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import javax.persistence.*;
@Data
@Table(name = "clue_burial_point_record")
public class BurialPointRecord {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 登录账号名称
*/
@Column(name = "login_account")
private String loginAccount;
/**
* 账号类型
*/
@Column(name = "user_type")
private Integer userType;
/**
* 账号uuid
*/
@Column(name = "uuid")
private String uuid;
/**
* 系统来源
,0-小程序,1-pc端
*/
@Column(name = "system_source")
private Integer systemSource;
@Column(name = "scene")
private Integer scene;
@Column(name = "phone_number")
private String phoneNumber;
/**
* 游客ID
,预留字段
*/
@Column(name = "visitor_id")
private String visitorId;
/**
* 触发时间
*/
@Column(name = "event_time")
private Date eventTime;
/**
* 动作类型
,0-点击,1-滚动,2-浏览
*/
@Column(name = "event_type")
private Integer eventType;
/**
* 上一级页面路径
*/
@Column(name = "pre_page_path")
private String prePagePath;
/**
* 当前页面路径
*/
@Column(name = "page_path")
private String pagePath;
/**
* 事件别名
*/
@Column(name = "event_code")
private String eventCode;
/**
* 浏览批次id
*/
@Column(name = "batch_id")
private String batchId;
/**
* 创建时间
*/
@Column(name = "created_time")
private Date createdTime;
/**
* 删除标示:D 已删除;N 未删除
*/
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 业务参数
*/
@Column(name = "business_param")
private String businessParam;
@Column(name = "business_id")
private String businessId;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
@Table(name = "clue_order")
@Data
@ToString
public class ClueOrder implements Serializable {
private static final long serialVersionUID = -8778857964427278664L;
/**
* ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(name = "keyword", notes = "关键字", dataType = "String")
private Integer id;
/**
* 线索类型(1:客户意见,2:卖车询价,3:救援服务,4:新车询价,5:试驾预约,6:维保)
*/
@ApiModelProperty(name = "type", notes = "线索类型(1:客户意见,2:卖车询价,3:救援服务,4:新车询价,5:试驾预约,6:维保)", dataType = "String")
private String type;
/**
* 预约类型(1:保养,2:维修,3:快喷)
*/
@Column(name = "appointment_type")
@ApiModelProperty(name = "appointmentType", notes = "预约类型(1:保养,2:维修,3:快喷)", dataType = "String")
private String appointmentType;
/**
* 渠道(GH:广汇,DJ:嘀加)
*/
@Column(name = "channel_type")
@ApiModelProperty(name = "channelType", notes = "渠道(GH:广汇,DJ:嘀加)", dataType = "String")
private String channelType;
/**
* 单号
*/
@Column(name = "order_no")
@ApiModelProperty(name = "orderNo", notes = "单号", dataType = "String")
private String orderNo;
/**
* 门店ID
*/
@Column(name = "merchant_id")
@ApiModelProperty(name = "merchantId", notes = "门店ID", dataType = "String")
private Integer merchantId;
/**
* 门店名称
*/
@Column(name = "merchant_name")
@ApiModelProperty(name = "merchantName", notes = "门店名称", dataType = "String")
private String merchantName;
/**
* 门店联系方式
*/
@Column(name = "merchant_phone")
@ApiModelProperty(name = "merchantPhone", notes = "门店联系方式", dataType = "String")
private String merchantPhone;
/**
* 车牌号
*/
@Column(name = "plate_num")
@ApiModelProperty(name = "plateNum", notes = "车牌号", dataType = "String")
private String plateNum;
/**
* 内容
*/
@ApiModelProperty(name = "comment", notes = "内容", dataType = "String")
private String comment;
/**
* 反馈图片
*/
@Column(name = "feedback_img_url")
@ApiModelProperty(name = "feedbackImgUrl", notes = "反馈图片", dataType = "String")
private String feedbackImgUrl;
/**
* 客户名称
*/
@ApiModelProperty(name = "name", notes = "客户名称", dataType = "String")
private String name;
/**
* 客户联系方式
*/
@ApiModelProperty(name = "phone", notes = "客户联系方式", dataType = "String")
private String phone;
/**
* 上牌日期
*/
@Column(name = "plate_date")
@ApiModelProperty(name = "plateDate", notes = "上牌日期", dataType = "String")
private Date plateDate;
/**
* 公里数
*/
@ApiModelProperty(name = "mileage", notes = "公里数", dataType = "String")
private String mileage;
/**
* 救援时间
*/
@Column(name = "rescue_date")
@ApiModelProperty(name = "rescueDate", notes = "救援时间", dataType = "String")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date rescueDate;
/**
* 救援地点
*/
@Column(name = "rescue_address")
@ApiModelProperty(name = "rescueAddress", notes = "救援地点", dataType = "String")
private String rescueAddress;
/**
* 预约时间
*/
@Column(name = "appointment_date")
@ApiModelProperty(name = "appointmentDate", notes = "预约时间", dataType = "date")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date appointmentDate;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updatedDate;
/**
* 删除标示:D 已删除;N 未删除[默认]
*/
@Column(name = "deleted_flag")
private String deletedFlag;
@Column(name = "account_id")
@ApiModelProperty(name = "accountId", notes = "用户编号", dataType = "String")
private Integer accountId;
@Column(name = "user_id")
@ApiModelProperty(name = "userId", notes = "跟进员工ID", dataType = "String")
private String userId;
/**
* 跟进员工姓名
*/
@Column(name = "user_name")
@ApiModelProperty(name = "userName", notes = "跟进员工姓名", dataType = "String")
private String userName;
/**
* 跟进状态(1:跟进中,2:已完成)
*/
@ApiModelProperty(name = "status", notes = "跟进状态(0:待跟进,1:跟进中,2:已完成/0,1:受理中,2:已完成)", dataType = "String")
private String status;
/**
* 汽车品牌ID
*/
@Column(name = "vehicle_brand_id")
@ApiModelProperty(name = "vehicleBrandId", notes = "汽车品牌ID", dataType = "String")
private Integer vehicleBrandId;
/**
* 汽车品牌
*/
@Column(name = "vehicle_brand_name")
@ApiModelProperty(name = "vehicleBrandName", notes = "汽车品牌", dataType = "String")
private String vehicleBrandName;
/**
* 子品牌ID
*/
@Column(name = "vehicle_sub_brand_id")
@ApiModelProperty(name = "vehicleSubBrandId", notes = "子品牌ID", dataType = "int")
private Integer vehicleSubBrandId;
/**
* 子品牌名称
*/
@Column(name = "vehicle_sub_brand_name")
@ApiModelProperty(name = "vehicleSubBrandName", notes = "子品牌名称", dataType = "String")
private String vehicleSubBrandName;
/**
* 车系ID
*/
@Column(name = "vehicle_series_id")
@ApiModelProperty(name = "vehicleSeriesId", notes = "车系ID", dataType = "int")
private Integer vehicleSeriesId;
/**
* 车系名称
*/
@Column(name = "vehicle_series_name")
@ApiModelProperty(name = "vehicleSeriesName", notes = "车系名称", dataType = "String")
private String vehicleSeriesName;
/**
* 车型ID
*/
@Column(name = "vehicle_shape_id")
@ApiModelProperty(name = "vehicleShapeId", notes = "车型ID", dataType = "int")
private Integer vehicleShapeId;
/**
* 车型名称
*/
@Column(name = "vehicle_shape_name")
@ApiModelProperty(name = "vehicleShapeName", notes = "车型名称", dataType = "String")
private String vehicleShapeName;
/**
* 车型名称
*/
@Column(name = "rescue_type")
@ApiModelProperty(name = "rescueType", notes = "救援类型(0:紧急脱困,1:拖车,2:换胎,3:送油,4:搭电,5:事故救援)", dataType = "String")
private String rescueType;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
@Table(name = "clue_order_follow")
@Data
@ToString
public class ClueOrderFollow implements Serializable {
private static final long serialVersionUID = -8778857964427278664L;
/**
* 主键ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 门店ID
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 线索订单id
*/
@Column(name = "order_id")
private Integer orderId;
/**
* 跟进内容
*/
private String remark;
/**
* 跟进员工id
*/
@Column(name = "user_id")
private String userId;
/**
* 跟进员工姓名
*/
@Column(name = "user_name")
private String userName;
/**
* 提交时间
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Column(name = "follow_date")
private Date followDate;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标示:D 已删除;N 未删除[默认]
*/
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 跟进内容
*/
private String type;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
@Data
@ToString
@Table(name = "clue_staff")
public class ClueStaff implements Serializable {
private static final long serialVersionUID = 4553654578595876723L;
/**
* 优惠券ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 门店ID
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 专员类型(1:售前,2:售后)
*/
private String type;
/**
* 跟进员工id
*/
@Column(name = "user_id")
private String userId;
/**
* 跟进员工uuid
*/
@Column(name = "user_uuid")
private String userUuid;
/**
* 跟进员工姓名
*/
@Column(name = "user_name")
private String userName;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标示:D 已删除;N 未删除[默认]
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
@Table(name = "clue_vehicle")
@Data
@ToString
public class ClueVehicle implements Serializable {
private static final long serialVersionUID = -8778857964427278664L;
/**
* ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 门店ID
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 汽车品牌ID
*/
@Column(name = "vehicle_brand_id")
private Integer vehicleBrandId;
/**
* 汽车品牌
*/
@Column(name = "vehicle_brand_name")
private String vehicleBrandName;
/**
* 子品牌ID
*/
@Column(name = "vehicle_sub_brand_id")
private Integer vehicleSubBrandId;
/**
* 子品牌名称
*/
@Column(name = "vehicle_sub_brand_name")
private String vehicleSubBrandName;
/**
* 车系ID
*/
@Column(name = "vehicle_series_id")
private Integer vehicleSeriesId;
/**
* 车系名称
*/
@Column(name = "vehicle_series_name")
private String vehicleSeriesName;
/**
* 车型ID
*/
@Column(name = "vehicle_shape_id")
private Integer vehicleShapeId;
/**
* 车型名称
*/
@Column(name = "vehicle_shape_name")
private String vehicleShapeName;
/**
* 指导价
*/
@Column(name = "guide_price")
private String guidePrice;
/**
* 车辆图片
*/
@Column(name = "show_image_url")
private String showImageUrl;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标示:D 已删除;N 未删除[默认]
*/
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 状态(0:下架,1:上架)
*/
@Column(name = "status")
private String status;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author zhouhaibao
* @version 1.0
* @description: 登录信息
* @date 2021/7/16 16:50
*/
@Data
public class DefaultRequest implements Serializable {
/**
* 创建者
*/
private Integer createdBy;
/**
* 创建人
*/
private String createdAccount;
/**
* 系统来源
*/
private String source;
/**
* 商户号
*/
private Integer merchantId;
/**
* 当前账号数据权限
*/
private List<Integer> datalist;
/**
* ip
*/
private String ip;
private String entmicroId;
private String uuid;
/**
* 登录用户类型
*/
private Integer userType;
}
package cn.com.glsx.scrm.clue.model.request.collision;
import cn.com.glsx.scrm.clue.model.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 碰撞线索-查询条件
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class CollisionInfoSearchRpcRequest extends DefaultRequest {
@ApiModelProperty(notes = "运营版调用:true,非运营版: false", name = "operate")
private boolean operate;
@NotNull
@ApiModelProperty(notes = "分页数", name = "pageSize", required = true)
private Integer pageSize;
@NotNull
@ApiModelProperty(notes = "当前页", name = "pageNum", required = true)
private Integer pageNum;
private Integer id;
@ApiModelProperty(notes = "设备号",name = "sn")
private String sn;
@ApiModelProperty(notes = "商户名称",name = "merchantName")
private String merchantName;
@ApiModelProperty(notes = "商户号",name = "merchantNo")
private Integer merchantNo;
@ApiModelProperty(notes = "设备类型,1:OBD\n" +
",2: DVD,\n" +
"3: 电子狗\n" +
",5 :TBOX(2G),\n" +
"6 行车记录仪\n" +
",7 :BBOX\n" +
",8: 追踪器\n" +
",9 :车载wifi\n" +
",12134 : 智能云镜\n" +
", 12499: AIBox\n" +
",12500: 小镜SOS记录仪,\n" +
"12501 : 智能定位车充\n" +
",12503: 数字车钥匙\n" +
",12514 :后视镜B300",name = "snType")
private Integer snType;
@ApiModelProperty(notes = "回访状态,0-未回访,1-已回访",name = "followStatus")
private Integer followStatus;
@ApiModelProperty(notes = "跟进起始时间",name = "beginFollowTime")
private Date beginFollowTime;
@ApiModelProperty(notes = "跟进结束时间",name = "endFollowTime")
private Date endFollowTime;
@ApiModelProperty(notes = "碰撞开始时间",name = "beginFollowTime")
private Date beginCollisionTime;
@ApiModelProperty(notes = "碰撞结束时间",name = "endFollowTime")
private Date endCollisionTime;
@ApiModelProperty(notes = "跟进结果,0-真实事故,1-非真实事故,2-无法处理",name = "followResult")
private Integer followResult;
@ApiModelProperty(notes = "客户手机号",name = "customerPhone")
private String customerPhone;
@ApiModelProperty(notes = "客户名称",name = "customerName")
private String customerName;
@ApiModelProperty(notes = "车牌号",name = "licensePlate")
private String licensePlate;
@ApiModelProperty(notes = "车架号",name = "standNo")
private String standNo;
}
package cn.com.glsx.scrm.clue.model.request.collision;
import cn.com.glsx.scrm.clue.model.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class CollisionPushConfigRpcRequest extends DefaultRequest {
@ApiModelProperty(notes = "推送开关,0-关,1-开", name = "pushFlag", required = true)
private Integer pushFlag;
@ApiModelProperty(notes = "推送开始时间,格式:HH:mm", name = "startTime", required = true)
private String startTime;
@ApiModelProperty(notes = "推送结束时间, 格式:HH:mm", name = "endTime", required = true)
private String endTime;
@ApiModelProperty(notes = " 配置类型,0-门店提醒,1-车主提醒", name = "configType", required = true)
private Integer configType;
@ApiModelProperty(notes = "顾问电话,多个用逗号分割", name = "pushPhones", required = true)
private String pushPhones;
@ApiModelProperty(notes = "营销卖点", name = "pushContent")
private String pushContent;
}
package cn.com.glsx.scrm.clue.model.request.collision;
import cn.com.glsx.scrm.clue.model.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
@Data
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CollisionSnInfoEditRpcRequest extends DefaultRequest {
@ApiModelProperty(notes = "id")
private Integer id;
// /**
// * 设备号
// */
// @ApiModelProperty(notes = "设备号")
// private String sn;
// /**
// * 批次id
// */
// @ApiModelProperty(notes = "批次id")
// private Integer batchId;
// /**
// * 商户号
// */
// @ApiModelProperty(notes = "商户号")
// private Integer merchantId;
// /**
// * 商户名称
// */
// @ApiModelProperty(notes = "商户名称")
// private String merchantName;
/**
* 设备类型
* @see DeviceTypeEnum
*/
// @ApiModelProperty(notes = "设备类型",example = "1:OBD\n" +
// ",2: DVD,\n" +
// "3: 电子狗\n" +
// ",5 :TBOX(2G),\n" +
// "6 行车记录仪\n" +
// ",7 :BBOX\n" +
// ",8: 追踪器\n" +
// ",9 :车载wifi\n" +
// ",12134 : 智能云镜\n" +
// ", 12499: AIBox\n" +
// ",12500: 小镜SOS记录仪,\n" +
// "12501 : 智能定位车充\n" +
// ",12503: 数字车钥匙\n" +
// ",12514 :后视镜B300")
// private Integer snType;
// /**
// * iccid
// */
// @ApiModelProperty(notes = "iccid")
// private String iccid;
/**
* 客户名称
*/
@ApiModelProperty(notes = "客户名称")
private String customerName;
/**
* 客户手机号
*/
@ApiModelProperty(notes = "客户手机号")
private String customerPhone;
/**
* 客户性别,0-男,1-女
*/
@ApiModelProperty(notes = "客户性别,0-男,1-女")
private Integer customerSex;
/**
* 车牌号
*/
@ApiModelProperty(notes = "车牌号")
private String licensePlate;
/**
* 车架号
*/
@ApiModelProperty(notes = "车架号")
private String standNo;
// /**
// * 设备安装时的初始里程
// */
// @ApiModelProperty(notes = "设备安装时的初始里程")
// private Long initialMileage;
//
// /**
// * 上次保养里程
// */
// @ApiModelProperty(notes = "上次保养里程")
// private Long lastMileage;
//
// /**
// * 上次保养时间
// */
// @ApiModelProperty(notes = "上次保养时间")
// private Date lastTime;
//
// /**
// * 下次保养里程
// */
// @ApiModelProperty(notes = "下次保养里程")
// private Long lowerMileage;
//
// /**
// * 下次保养时间
// */
// @ApiModelProperty(notes = "下次保养时间")
// private Date lowerTime;
/**
* 是否更换设备,0-保修更换-免费,1-维修更换,2-购买
* @see cn.com.glsx.scrm.clue.enums.collision.DeviceReplaceEnum
*/
@ApiModelProperty(notes = "是否更换设备,0-保修更换-免费,1-维修更换,2-购买")
private Integer replaceFlag;
/**
* 汽车品牌ID
*/
@ApiModelProperty(notes = "汽车品牌ID")
private Integer vehicleBrandId;
/**
* 汽车品牌
*/
@ApiModelProperty(notes = "汽车品牌")
private String vehicleBrandName;
/**
* 子品牌ID
*/
@ApiModelProperty(notes = "子品牌ID")
private Integer vehicleSubBrandId;
/**
* 子品牌名称
*/
@ApiModelProperty(notes = "子品牌名称")
private String vehicleSubBrandName;
/**
* 车系ID
*/
@ApiModelProperty(notes = "车系ID")
private Integer vehicleSeriesId;
/**
* 车系名称
*/
@ApiModelProperty(notes = "车系名称")
private String vehicleSeriesName;
/**
* 车型ID
*/
@ApiModelProperty(notes = "车型ID")
private Integer vehicleShapeId;
/**
* 车型名称
*/
@ApiModelProperty(notes = "车型名称")
private String vehicleShapeName;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model.request.collision;
import cn.com.glsx.scrm.clue.model.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class CollisionSnInfoSearchRpcRequest extends DefaultRequest {
@ApiModelProperty(notes = "运营版调用:true",name = "operate")
private boolean operate;
@ApiModelProperty(notes = "分页数", name = "pageSize", required = true)
private Integer pageSize;
@ApiModelProperty(notes = "当前页", name = "pageNum", required = true)
private Integer pageNum;
@ApiModelProperty(notes = "id,详情专用",name = "id")
private Integer id;
@ApiModelProperty(notes = "设备号",name = "sn")
private String sn;
@ApiModelProperty(notes = "商户名称",name = "merchantName")
private String merchantName;
@ApiModelProperty(notes = "商户号",name = "merchantNo")
private Integer merchantNo;
@ApiModelProperty(notes = "设备类型,1:OBD\n" +
",2: DVD,\n" +
"3: 电子狗\n" +
",5 :TBOX(2G),\n" +
"6 行车记录仪\n" +
",7 :BBOX\n" +
",8: 追踪器\n" +
",9 :车载wifi\n" +
",12134 : 智能云镜\n" +
", 12499: AIBox\n" +
",12500: 小镜SOS记录仪,\n" +
"12501 : 智能定位车充\n" +
",12503: 数字车钥匙\n" +
",12514 :后视镜B300",name = "snType")
private Integer snType;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(notes = "起始时间",name = "beginTime")
private Date beginTime;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(notes = "结束时间",name = "endTime")
private Date endTime;
@ApiModelProperty(notes = "操作人",name = "account")
private String account;
@ApiModelProperty(notes = "客户手机号")
private String customerPhone;
@ApiModelProperty(notes = "客户名称")
private String customerName;
@ApiModelProperty(notes = "车牌号")
private String licensePlate;
@ApiModelProperty(notes = "车架号")
private String standNo;
/**
* 是否更换设备,0-保修更换-免费,1-维修更换,2-购买
* @see cn.com.glsx.scrm.clue.enums.collision.DeviceReplaceEnum
*/
@ApiModelProperty(notes = "是否更换设备,0-保修更换-免费,1-维修更换,2-购买")
private Integer replaceFlag;
}
package cn.com.glsx.scrm.clue.model.request.collision;
import cn.com.glsx.scrm.clue.model.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author yelq
* @Version 1.0
* @Description: 客户设备导入
* @Date 2023/10/11 17:32
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class CustomerDeviceImportRpcRequest extends DefaultRequest {
@ApiModelProperty(notes = "客户设备excel表url(xls/xlsx格式)")
private String url;
}
package cn.com.glsx.scrm.clue.model.request.collision;
import cn.com.glsx.scrm.clue.model.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class FollowInfoRpcRequest extends DefaultRequest {
@ApiModelProperty(notes = "碰撞线索id", name = "id", required = true)
private Integer id;
@ApiModelProperty(notes = "跟进结果,0-真实事故,1-非真实事故,2-无法处理", name = "followResult", required = true)
private Integer followResult;
@ApiModelProperty(notes = "跟进备注", name = "followRemark")
private String followRemark;
}
package cn.com.glsx.scrm.clue.model.response.collision;
import cn.com.glsx.scrm.clue.dto.collision.CollisionAddressDTO;
import cn.com.glsx.scrm.clue.enums.collision.DeviceTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class CollisionDetailInfoRpcResponse implements Serializable {
@ApiModelProperty(notes = "id",name = "id")
private Integer id;
/**
* 设备号
*/
@ApiModelProperty(notes = "设备号",name = "sn")
private String sn;
/**
* 商户号
*/
@ApiModelProperty(notes = "商户号",name = "merchantId")
private Integer merchantId;
/**
* 商户名称
*/
@ApiModelProperty(notes = "商户名称",name = "merchantName")
private String merchantName;
/**
* 设备类型,1:OBD
,2: DVD,
3: 电子狗
,5 :TBOX(2G),
6 行车记录仪
,7 :BBOX
,8: 追踪器
,9 :车载wifi
,12134 : 智能云镜
, 12499: AIBox
,12500: 小镜SOS记录仪,
12501 : 智能定位车充
,12503: 数字车钥匙
,12514 :后视镜B300
*/
/**
* @see DeviceTypeEnum
*/
@ApiModelProperty(notes = "设备类型,1:OBD\n" +
",2: DVD,\n" +
"3: 电子狗\n" +
",5 :TBOX(2G),\n" +
"6 行车记录仪\n" +
",7 :BBOX\n" +
",8: 追踪器\n" +
",9 :车载wifi\n" +
",12134 : 智能云镜\n" +
", 12499: AIBox\n" +
",12500: 小镜SOS记录仪,\n" +
"12501 : 智能定位车充\n" +
",12503: 数字车钥匙\n" +
",12514 :后视镜B300",name = "snType")
private Integer snType;
/**
* 客户名称
*/
@ApiModelProperty(notes = "客户名称",name = "customerName")
private String customerName;
/**
* 客户手机号
*/
@ApiModelProperty(notes = "客户手机号",name = "customerPhone")
private String customerPhone;
/**
* 车牌号
*/
@ApiModelProperty(notes = "车牌号",name = "licensePlate")
private String licensePlate;
/**
* 车架号
*/
@ApiModelProperty(notes = "车架号",name = "standNo")
private String standNo;
@ApiModelProperty(notes = "车型",name = "vehicleShapeName")
private String vehicleShapeName;
@ApiModelProperty(notes = "子品牌名称",name = "vehicleSubBrandName")
private String vehicleSubBrandName;
@ApiModelProperty(notes = "车系名称",name = "vehicleSeriesName")
private String vehicleSeriesName;
/**
* 碰撞时间
*/
@ApiModelProperty(notes = "碰撞时间",name = "collisionTime")
private Date collisionTime;
@ApiModelProperty(notes = "经度",name = "longitude")
private String longitude;
@ApiModelProperty(notes = "纬度",name = "latitude")
private String latitude;
/**
* 碰撞地点
*/
@ApiModelProperty(notes = "碰撞地点",name = "address")
private String address;
@ApiModelProperty(notes = "回访状态,0-未回访,1-已回访",name = "followStatus")
private Integer followStatus;
/**
* 跟进结果,0-真实事故,1-非真实事故,2-无法处理
*/
@ApiModelProperty(notes = "跟进结果,0-真实事故,1-非真实事故,2-无法处理",name = "followResult")
private Integer followResult;
/**
* 回访时间
*/
@ApiModelProperty(notes = "回访时间",name = "followTime")
private Date followTime;
@ApiModelProperty(notes = "回访备注",name = "followRemark")
private String followRemark;
@ApiModelProperty(notes = "回访人员",name = "updatedBy")
private String updatedBy;
private String taskId;
@ApiModelProperty(notes = "媒体信息列表",name = "mediaDetailList")
private List<CollisionMediaDetail> mediaDetailList;
@ApiModelProperty(notes = "碰撞时间是否超过3分钟,0-否,1-是",name = "collisionTimeOutFlag")
private int collisionTimeOutFlag;
@ApiModelProperty(notes = "车辆行车轨迹列表",name = "carAddressList")
List<CollisionAddressDTO> carAddressList;
}
package cn.com.glsx.scrm.clue.model.response.collision;
import cn.com.glsx.scrm.clue.enums.collision.DeviceTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class CollisionInfoRpcResponse implements Serializable {
@ApiModelProperty(notes = "id",name = "id")
private Integer id;
/**
* 设备号
*/
@ApiModelProperty(notes = "设备号",name = "sn")
private String sn;
/**
* 商户号
*/
@ApiModelProperty(notes = "商户号",name = "merchantId")
private Integer merchantId;
/**
* 商户名称
*/
@ApiModelProperty(notes = "商户名称",name = "merchantName")
private String merchantName;
/**
* 设备类型,1:OBD
,2: DVD,
3: 电子狗
,5 :TBOX(2G),
6 行车记录仪
,7 :BBOX
,8: 追踪器
,9 :车载wifi
,12134 : 智能云镜
, 12499: AIBox
,12500: 小镜SOS记录仪,
12501 : 智能定位车充
,12503: 数字车钥匙
,12514 :后视镜B300
*/
/**
* @see DeviceTypeEnum
*/
@ApiModelProperty(notes = "设备类型,1:OBD\n" +
",2: DVD,\n" +
"3: 电子狗\n" +
",5 :TBOX(2G),\n" +
"6 行车记录仪\n" +
",7 :BBOX\n" +
",8: 追踪器\n" +
",9 :车载wifi\n" +
",12134 : 智能云镜\n" +
", 12499: AIBox\n" +
",12500: 小镜SOS记录仪,\n" +
"12501 : 智能定位车充\n" +
",12503: 数字车钥匙\n" +
",12514 :后视镜B300",name = "snType")
private Integer snType;
/**
* 客户名称
*/
@ApiModelProperty(notes = "客户名称",name = "customerName")
private String customerName;
/**
* 客户手机号
*/
@ApiModelProperty(notes = "客户手机号",name = "customerPhone")
private String customerPhone;
/**
* 车牌号
*/
@ApiModelProperty(notes = "车牌号",name = "licensePlate")
private String licensePlate;
/**
* 车架号
*/
@ApiModelProperty(notes = "车架号",name = "standNo")
private String standNo;
@ApiModelProperty(notes = "车型",name = "vehicleShapeName")
private String vehicleShapeName;
/**
* 碰撞时间
*/
@ApiModelProperty(notes = "碰撞时间",name = "collisionTime")
private Date collisionTime;
/**
* 碰撞地点
*/
@ApiModelProperty(notes = "碰撞地点",name = "address")
private String address;
/**
* @see cn.com.glsx.scrm.clue.enums.collision.FollowStatusEnum
*/
@ApiModelProperty(notes = "回访状态,0-未回访,1-已回访",name = "followStatus")
private Integer followStatus;
/**
* 跟进结果,0-真实事故,1-非真实事故,2-无法处理
*/
@ApiModelProperty(notes = "跟进结果,0-真实事故,1-非真实事故,2-无法处理",name = "followResult")
private Integer followResult;
@ApiModelProperty(notes = "回访备注",name = "followRemark")
private String followRemark;
/**
* 回访时间
*/
@ApiModelProperty(notes = "回访时间",name = "followTime")
private Date followTime;
@ApiModelProperty(notes = "回访人员",name = "updatedBy")
private String updatedBy;
}
package cn.com.glsx.scrm.clue.model.response.collision;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class CollisionMediaDetail implements Serializable {
@ApiModelProperty(notes = "媒体类型(IMAGE:图片;VIDEO:视频)",name = "mediaType")
private String mediaType;
@ApiModelProperty(notes = "媒体地址链接",name = "fileUrl")
private String fileUrl;
}
package cn.com.glsx.scrm.clue.model.response.collision;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class CollisionPushConfigRpcResponse implements Serializable {
private Integer id;
@ApiModelProperty(notes = "商户号", name = "merchantId")
private Integer merchantId;
@ApiModelProperty(notes = "推送开关,0-关,1-开", name = "pushFlag")
private Integer pushFlag;
@ApiModelProperty(notes = "推送开始时间,格式:HH:mm", name = "startTime")
private String startTime;
@ApiModelProperty(notes = "推送结束时间, 格式:HH:mm", name = "endTime")
private String endTime;
@ApiModelProperty(notes = " 配置类型,0-门店提醒,1-车主提醒", name = "configType")
private Integer configType;
@ApiModelProperty(notes = "顾问电话,多个用逗号分割", name = "pushPhones")
private String pushPhones;
@ApiModelProperty(notes = "营销卖点", name = "pushContent")
private String pushContent;
}
package cn.com.glsx.scrm.clue.model.response.collision;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 客户设备信息导入返回
*/
@Data
public class CustomerDeviceImportRpcResponse implements Serializable {
@ApiModelProperty(notes = "校验标记,通过:true,不通过:false")
private Boolean checkFlag;
@ApiModelProperty(notes = "导入总数量")
private Integer count;
@ApiModelProperty(notes = "校验通过数量")
private Integer success;
@ApiModelProperty(notes = "校验不通过数量")
private Integer error;
@ApiModelProperty(notes = "校验不通过手机号excel表url地址")
private String errUrl;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model.response.collision;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class FollowInfoRpcResponse implements Serializable {
@ApiModelProperty(notes = "碰撞线索id", name = "id")
private Integer id;
@ApiModelProperty(notes = "跟进结果,0-真实事故,1-非真实事故,2-无法处理", name = "followResult", required = true)
private Integer followResult;
@ApiModelProperty(notes = "跟进备注", name = "followRemark")
private String followRemark;
@ApiModelProperty(notes = "跟进时间", name = "followTime")
private Date followTime;
}
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.scrm.clue.dto.BurialPointRecordDTO;
import javax.validation.constraints.NotNull;
import java.util.List;
@ApiService(value = "埋点记录", version = "1.0.0", protocol = ApiService.ProtocolEnum.dubbo, type = ApiService.ApiTypeEnum.DUBBO, alias = "BurialPointRecordRemote", owner = "fanfr")
public interface BurialPointRecordRemote {
@ApiMethod("批量上报埋点记录")
@ApiResponse("上报结果")
@ApiParams({@ApiParam(name = "list", notes = "埋点记录列表", dataType = ApiParam.DataTypeEnum.LIST, required = true)})
RpcResponse<Boolean> batchInsert(@NotNull List<BurialPointRecordDTO> list);
}
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.scrm.clue.dto.ClueOrderDTO;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import cn.com.glsx.scrm.clue.model.ClueOrderFollow;
import javax.validation.constraints.NotNull;
import java.util.List;
@ApiService(value = "线索-跟进记录", owner = "hexy")
public interface ClueFollowRemote {
@ApiMethod("新增或更新线索跟进记录")
@ApiParam(name = "record", notes = "线索", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("返回结果")
RpcResponse<ClueOrderFollow> insertOrUpdate(ClueOrderFollow info);
@ApiMethod("查询线索跟进记录列表")
@ApiParam(name = "orderId", notes = "线索单id", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
@ApiResponse("返回线索跟进记录列表")
RpcResponse<List<ClueOrderFollow>> listWithOrderId(Integer orderId);
}
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.scrm.clue.dto.ClueOrderDTO;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import com.github.pagehelper.Page;
import javax.validation.constraints.NotNull;
@ApiService(value = "线索-金刚区线索接口", owner = "hexy")
public interface ClueOrderRemote {
@ApiMethod("新增或更新金刚区线索")
@ApiParam(name = "record", notes = "线索", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("返回金刚区线索")
RpcResponse<ClueOrder> insertAndDeal(@NotNull ClueOrderDTO record);
@ApiMethod("查询金刚区线索列表")
@ApiParam(name = "pagination", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("返回金刚区线索列表")
RpcResponse<RpcPagination<ClueOrderDTO>> listWithPage(RpcPagination<ClueOrderDTO> pagination);
@ApiMethod("根据ID查询金刚区线索")
@ApiParam(name = "id", notes = "线索编号", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
@ApiResponse("返回金刚区线索")
RpcResponse<ClueOrder> getById(Integer id);
@ApiMethod("根据ID查询金刚区线索和跟进记录")
@ApiParam(name = "id", notes = "线索编号", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
@ApiResponse("返回金刚区线索和跟进记录")
RpcResponse<ClueOrderDTO> getDetailById(Integer id);
@ApiMethod("根据ID查询金刚区线索和跟进记录并将状态更新为处理中")
@ApiParam(name = "id", notes = "线索编号", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
@ApiResponse("返回金刚区线索和跟进记录")
RpcResponse<ClueOrderDTO> updateTaskStatus(Integer id);
}
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.scrm.clue.model.ClueStaff;
import com.github.pagehelper.Page;
import java.util.List;
@ApiService(value = "线索-金刚区线索接口", owner = "hexy")
public interface ClueStaffRemote {
@ApiMethod("新增或修改专员")
@ApiParam(name = "staffList", notes = "专员列表", dataType = ApiParam.DataTypeEnum.LIST, required = true)
@ApiResponse("新增或修改专员")
RpcResponse<Boolean> insertOrUpdateBatch(List<ClueStaff> staffList);
@ApiMethod("新增或修改专员")
@ApiParam(name = "staffList", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("新增或修改专员")
RpcResponse<Page<ClueStaff>> listWithPage(RpcPagination<ClueStaff> pagination);
}
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.scrm.clue.dto.ClueOrderDTO;
import cn.com.glsx.scrm.clue.dto.ClueVehicleDTO;
import cn.com.glsx.scrm.clue.model.ClueStaff;
import cn.com.glsx.scrm.clue.model.ClueVehicle;
import com.github.pagehelper.Page;
import java.util.List;
@ApiService(value = "线索-金刚区车辆信息接口", owner = "hexy")
public interface ClueVehicleRemote {
@ApiMethod("获取品牌列表")
@ApiParam(name = "pagination", notes = "分页信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("品牌列表")
RpcResponse<RpcPagination<ClueVehicle>> getMerchantBrandList(RpcPagination<ClueVehicle> pagination);
@ApiMethod("获取子品牌列表")
@ApiParam(name = "pagination", notes = "分页信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("子品牌列表")
RpcResponse<RpcPagination<ClueVehicle>> getMerchantSubBrandList(RpcPagination<ClueVehicle> pagination);
@ApiMethod("获取车系列表")
@ApiParam(name = "pagination", notes = "分页信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("车系列表")
RpcResponse<RpcPagination<ClueVehicleDTO>> getMerchantSeriesList(RpcPagination<ClueVehicleDTO> pagination);
@ApiMethod("获取车型列表")
@ApiParam(name = "pagination", notes = "分页信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("车型列表")
RpcResponse<RpcPagination<ClueVehicleDTO>> getMerchantShapeList(RpcPagination<ClueVehicleDTO> pagination);
@ApiMethod("上下架车型")
@ApiParam(name = "info", notes = "车型信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("上下架车型")
RpcResponse<Integer> updateStatus(ClueVehicle info);
@ApiMethod("获取车型列表")
@ApiParam(name = "pagination", notes = "分页信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("获取车型列表")
RpcResponse<RpcPagination<ClueVehicleDTO>> listWithPage(RpcPagination<ClueVehicleDTO> pagination);
@ApiMethod("新增或更新车型")
@ApiParam(name = "info", notes = "车型信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("车型信息")
RpcResponse<ClueVehicle> insertOrUpdate(ClueVehicle info);
@ApiMethod("删除车型信息")
@ApiParam(name = "info", notes = "车型信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("删除结果")
RpcResponse<Boolean> delete(ClueVehicle info);
@ApiMethod("根据id获取车型信息")
@ApiParam(name = "id", notes = "id", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
@ApiResponse("车型信息")
RpcResponse<ClueVehicle> getById(Integer id);
}
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.scrm.clue.dto.collision.CollisionSnInfoDTO;
import cn.com.glsx.scrm.clue.model.request.collision.*;
import cn.com.glsx.scrm.clue.model.response.collision.*;
import java.util.List;
@ApiService(value = "碰撞-碰撞线索信息", version = "1.0.0", protocol = ApiService.ProtocolEnum.dubbo, type = ApiService.ApiTypeEnum.DUBBO, alias = "CollisionInfoRemote", owner = "fanfr")
public interface CollisionInfoRemote {
@ApiMethod("客户设备信息导入")
@ApiResponse("导入结果")
@ApiParams({@ApiParam(name = "requestDTO", notes = "客户设备excel表url(xls/xlsx格式)", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<CustomerDeviceImportRpcResponse> customerDeviceImportRemote(CustomerDeviceImportRpcRequest requestDTO);
@ApiMethod("碰撞线索-分页查询")
@ApiResponse("分页线索信息结果")
@ApiParams({@ApiParam(name = "requestDTO", notes = "碰撞线索-分页查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<RpcPagination<CollisionInfoRpcResponse>> listCollisionInfoByPage(CollisionInfoSearchRpcRequest requestDTO);
@ApiMethod("碰撞线索-导出")
@ApiResponse("线索文件url")
@ApiParams({@ApiParam(name = "requestDTO", notes = "碰撞线索-导出查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<String> exportCollisionInfo(CollisionInfoSearchRpcRequest requestDTO);
@ApiMethod("碰撞线索-查询详情")
@ApiResponse("碰撞线索详情")
@ApiParams({@ApiParam(name = "requestDTO", notes = "碰撞线索-导出查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<CollisionDetailInfoRpcResponse> getCollisionDetail(CollisionInfoSearchRpcRequest requestDTO);
@ApiMethod("碰撞线索-门店回访")
@ApiResponse("回访详情")
@ApiParams({@ApiParam(name = "requestDTO", notes = "碰撞线索-回访信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<FollowInfoRpcResponse> followCollisionInfoByMerchant(FollowInfoRpcRequest requestDTO);
@ApiMethod("碰撞线索-员工回访")
@ApiResponse("回访详情")
@ApiParams({@ApiParam(name = "requestDTO", notes = "碰撞线索-回访信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<FollowInfoRpcResponse> followCollisionInfoByStaff(FollowInfoRpcRequest requestDTO);
@ApiMethod("碰撞线索-推送配置添加/修改")
@ApiResponse("推送配置信息")
@ApiParams({@ApiParam(name = "requestDTO", notes = "推送配置信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<CollisionPushConfigRpcResponse> addOrUpdatePushConfig(CollisionPushConfigRpcRequest requestDTO);
@ApiMethod("碰撞线索-查询推送配置详情")
@ApiResponse("推送配置详情")
@ApiParams({@ApiParam(name = "requestDTO", notes = "推送配置信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<List<CollisionPushConfigRpcResponse>> getPushConfigDetail(CollisionPushConfigRpcRequest requestDTO);
@ApiMethod("设备管理-客户设备信息详情查询")
@ApiResponse("客户设备信息详情")
@ApiParams({@ApiParam(name = "requestDTO", notes = "设备管理-客户设备信息详情查询", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<CollisionSnInfoDTO> getCustomerDeviceDetailRemote(CollisionSnInfoSearchRpcRequest requestDTO);
@ApiMethod("设备管理-编辑")
@ApiResponse("编辑结果")
@ApiParams({@ApiParam(name = "requestDTO", notes = "编辑", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<Boolean> customerDeviceEditRemote(CollisionSnInfoEditRpcRequest requestDTO);
@ApiMethod("设备管理-列表查询")
@ApiResponse("设备管理-列表查询结果")
@ApiParams({@ApiParam(name = "requestDTO", notes = "设备管理-列表查询", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<RpcPagination<CollisionSnInfoDTO>> getCustomerDeviceListRemote(RpcPagination<CollisionSnInfoSearchRpcRequest> requestDTO);
@ApiMethod("设备管理-列表查询导出")
@ApiResponse("设备管理-列表查询导出结果")
@ApiParams({@ApiParam(name = "requestDTO", notes = "设备管理-列表查询导出", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
RpcResponse<String> exportCustomerDeviceListRemote(RpcPagination<CollisionSnInfoSearchRpcRequest> requestDTO);
}
# framework-archetype-rpc-api
RPC-API项目骨架
一、项目结构说明:
└─src
├─main
├─java
├─cn.com.glsx.shopmall.dto 数据传输模型层
├─cn.com.glsx.shopmall.enums 枚举定义
├─cn.com.glsx.shopmall.model 数据模型层
└─cn.com.glsx.shopmall.remote RPC暴露服务层
└─resources 资源文件目录
└─rpc
└─dubbo.xml dubbo接口配置
└─pom.xml pom文件
二、使用说明:
1、API改动后,请及时deploy到Maven仓库
三、注意事项:
1、rpc-api-deploy-maven-plugin api上报插件需配置当前api的jar包的引用。
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-rpc</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>cn.com.glsx.scrm.clue</groupId>
<artifactId>rpc-scrm-clue</artifactId>
<version>5.2.0-SNAPSHOT</version>
<name>rpc-scrm-clue</name>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>cn.com.glsx.scrm</groupId>
<artifactId>rpc-scrm-clue-api</artifactId>
<version>5.3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-distribute-lock</artifactId>
</dependency>
<dependency>
<groupId>cn.com.glsx</groupId>
<artifactId>rpc-scrm-wechat-api</artifactId>
<version>0.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx</groupId>
<artifactId>rpc-scrm-system-api</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.scrm</groupId>
<artifactId>rpc-scrm-proxy-api</artifactId>
<version>0.0.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-elasticjob</artifactId>
</dependency>
<dependency>
<groupId>cn.com.glsx.entmicro</groupId>
<artifactId>rpc-scrm-entmicro-api</artifactId>
<version>3.21.0-SNAPSHOT</version>
</dependency>
<!--alibabaExcel导入导出-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.2</version>
<exclusions>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.glsx</groupId>
<artifactId>rest-admin-common</artifactId>
<version>2.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.oreframework</groupId>
<artifactId>ore-jms</artifactId>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>4.55.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-alioss</artifactId>
<version>2.2.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package cn.com.glsx.scrm.clue;
import org.oreframework.boot.main.AbsOreBootStarter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
/**
* @Title: Main.java
* @Description:
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@SpringBootApplication
@ServletComponentScan
public class Main extends AbsOreBootStarter {
@Override
public void run(String[] args)
{
SpringApplication.run(Main.class, args);
}
public static void main(String[] args)
{
Main main = new Main();
main.run(args);
}
}
package cn.com.glsx.scrm.clue.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* @Title: AmapProperty.java
* @Description:
* @author zengqi
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Configuration
@ConfigurationProperties("amap")
public class AmapProperty {
/**
* 地图秘钥
*/
private String key;
/**
* 逆地址解析接口地址
*/
private String geocodeUrl;
/**
* 距离计算接口地址
*/
private String distanceUrl;
/**
* 百度地图秘钥
*/
private String baiduKey;
/**
* 百度坐标转换
*/
private String geoconvUrl;
/**
* 百度逆地址解析接口地址
*/
private String baiduGeocodeUrl;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getGeocodeUrl() {
return geocodeUrl;
}
public void setGeocodeUrl(String geocodeUrl) {
this.geocodeUrl = geocodeUrl;
}
public String getDistanceUrl() {
return distanceUrl;
}
public void setDistanceUrl(String distanceUrl) {
this.distanceUrl = distanceUrl;
}
public String getBaiduKey() {
return baiduKey;
}
public void setBaiduKey(String baiduKey) {
this.baiduKey = baiduKey;
}
public String getGeoconvUrl() {
return geoconvUrl;
}
public void setGeoconvUrl(String geoconvUrl) {
this.geoconvUrl = geoconvUrl;
}
public String getBaiduGeocodeUrl() {
return baiduGeocodeUrl;
}
public void setBaiduGeocodeUrl(String baiduGeocodeUrl) {
this.baiduGeocodeUrl = baiduGeocodeUrl;
}
}
package cn.com.glsx.scrm.clue.config;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* 埋点细节
* @author yangwei
* @version 1.0
* @since 2025/10/17 14:07
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BurialPointDetail implements Serializable {
/** id 唯一即可,一个系统一个 */
private String id;
/** 事件名称 */
private String name;
/** 事件代码列表,这些列表就是默认统计的事件,如果数据量过大,可以搭配数据库 */
private List<String> eventCodes;
/** 触发的bean
* 如果没有调用默认的 handler
* @see cn.com.glsx.scrm.clue.service.BurialPointHandler
*/
private String bean;
/** 发送的方法,如果没有默认发送场景助手 */
private String invoke;
/** 是否启用 */
private boolean enable = false;
}
package cn.com.glsx.scrm.clue.config;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.List;
/**
* @author yangwei
* @version 1.0
* @since 2025/10/17 14:00
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Configuration
@ConfigurationProperties(prefix = "burial-point.summary")
public class BurialPointSummaryConfig {
/** 埋点详情 */
private List<BurialPointDetail> burialPointDetails;
}
package cn.com.glsx.scrm.clue.config;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* SpringContextHolder
* @author yangwei
* @since 2025/10/30 16:16
*/
@Component
public class SpringContextHolder implements ApplicationContextAware {
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
SpringContextHolder.applicationContext = applicationContext;
}
public static <T> T getBean(Class<T> clazz) {
return applicationContext.getBean(clazz);
}
public static <T> T getBean(String name, Class<T> clazz) {
return applicationContext.getBean(name, clazz);
}
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* @Title: SystemProperty.java
* @Description:
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Configuration
@ConfigurationProperties("system")
public class SystemProperty {
// 对应配置项:system.name
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package cn.com.glsx.scrm.clue.config.dubbo;
import cn.com.glsx.dj.gop.remote.GopGpsLocationRemote;
import cn.com.glsx.dj.smartcarlife.remote.SceneMarketRemote;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class DubboConfig {
@Autowired
protected ReferenceBuilderFactory factory;
protected final boolean check = false;
protected final int timeout = 30000;
@Bean
public GopGpsLocationRemote gopGpsLocationRemote() {
return factory.builder(GopGpsLocationRemote.class).check(false).timeout(30000).build();
}
@Bean
public SceneMarketRemote sceneMarketRemote() {
return factory.builder(SceneMarketRemote.class).check(false).version("1.0.0").timeout(30000).build();
}
}
package cn.com.glsx.scrm.clue.config.dubbo;
import cn.com.glsx.entmicro.remote.EntmicroDepartmentRemote;
import cn.com.glsx.scrm.wechat.remote.WorkWechatMessageRemote;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class EntmicroDubboConfig extends DubboConfig{
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public EntmicroDepartmentRemote EntmicroDepartmentRemote(){
return factory.builder(EntmicroDepartmentRemote.class).version("1.0.0").check(check).timeout(timeout).build();
}
}
package cn.com.glsx.scrm.clue.config.dubbo;
import cn.com.glsx.scrm.proxy.remote.cgacar.CgacarCommonRemote;
import cn.com.glsx.scrm.proxy.remote.merchant.MerchantRemote;
import cn.com.glsx.scrm.wechat.remote.WorkWechatMessageRemote;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class ProxyDubboConfig extends DubboConfig{
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public MerchantRemote MerchantRemote(){
return factory.builder(MerchantRemote.class).check(check).timeout(timeout).build();
}
@Bean
public CgacarCommonRemote CgacarCommonRemote(){
return factory.builder(CgacarCommonRemote.class).version("1.0.0").check(check).timeout(timeout).build();
}
}
package cn.com.glsx.scrm.clue.config.dubbo;
import cn.com.glsx.scrm.system.remote.SystemUserTaskRemote;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class SystemDubboConfig extends DubboConfig{
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public SystemUserTaskRemote SystemUserTaskRemote(){
return factory.builder(SystemUserTaskRemote.class).check(check).timeout(timeout).build();
}
}
package cn.com.glsx.scrm.clue.config.dubbo;
import cn.com.glsx.scrm.wechat.remote.WorkWechatMessageRemote;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class WechatDubboConfig extends DubboConfig{
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public WorkWechatMessageRemote WorkWechatMessageRemote(){
return factory.builder(WorkWechatMessageRemote.class).version("1.0.0").check(check).timeout(timeout).build();
}
}
package cn.com.glsx.scrm.clue.constants;
public class Constants {
/**
* 数据标记 删除
*/
public static final Byte DEL_FLAG = -1;
/**
* 数据标记 正常
*/
public static final Byte NORMAL_FLAG = 0;
/**
* 碰撞-经纬度长度限制
*/
public static final Integer MAX_LONGITUDE_LENGTH = 16;
}
package cn.com.glsx.scrm.clue.constants;
/**
* @Author yelq
* @Version 1.0
* @Description: redis缓存键前缀
* @Date 2022/7/5 18:00
*/
public class RedisCacheKeyPreConstants {
private static final String projectPre = "rpc-scrm-clue:";
// 门店号查询商户详情
public static final String merchantDetailKey = projectPre+"merchant_detail_";
public static final long merchantDetailKeyTimeout = 60*60*24L;
}
package cn.com.glsx.scrm.clue.converter;
import cn.com.glsx.scrm.clue.dto.collision.CollisionSnInfoDTO;
import cn.com.glsx.scrm.clue.dto.collision.CollisionSnInfoExportDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* @Author yelq
* @Version 1.0
* @Description:
* @Date 2023/10/13 17:11
*/
@Mapper
public interface CollisionSnInfoConvert {
CollisionSnInfoConvert INSTANCE = Mappers.getMapper(CollisionSnInfoConvert.class);
@Mappings({
@Mapping(target ="snType",expression = "java(cn.com.glsx.scrm.clue.enums.collision.DeviceTypeEnum.getEnumDisplayByValue(source.getSnType()))"),
@Mapping(target ="customerSex",expression = "java(source.getCustomerSex()==null?null:source.getCustomerSex()==1?\"男\":\"女\")"),
@Mapping(target ="lastTime",expression = "java(cn.com.glsx.scrm.clue.converter.CollisionSnInfoConvert.parseDate(source.getLastTime()))"),
@Mapping(target ="lowerTime",expression = "java(cn.com.glsx.scrm.clue.converter.CollisionSnInfoConvert.parseDate(source.getLowerTime()))"),
@Mapping(target ="updatedTime",expression = "java(cn.com.glsx.scrm.clue.converter.CollisionSnInfoConvert.parseDate(source.getUpdatedTime()))"),
@Mapping(target ="replaceFlag",expression = "java(cn.com.glsx.scrm.clue.enums.collision.DeviceReplaceEnum.getDisplayNameByCode(source.getReplaceFlag()))")
})
CollisionSnInfoExportDTO toCollisionSnInfoExportDTO(CollisionSnInfoDTO source);
List<CollisionSnInfoExportDTO> toCollisionSnInfoExportDTOList(List<CollisionSnInfoDTO> sourceList);
public static String parseDate(Date data){
if (data==null)return null;
return new SimpleDateFormat("yyyy/MM/dd").format(data);
}
}
package cn.com.glsx.scrm.clue.entity.collision;
import lombok.Data;
import lombok.ToString;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Data
@ToString
@Table(name = "scrm_collision_info")
public class CollisionInfo implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 设备号
*/
private String sn;
/**
* 碰撞时间
*/
@Column(name = "collision_time")
private Date collisionTime;
/**
* SOS : 紧急求助, COLLIDE : 碰撞, VIBRATION:震动,
CUSTOMER_SUBMIT:客户自提
*/
@Column(name = "collision_type")
private String collisionType;
/**
* 碰撞地点
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 回访状态,0-未回访,1-已回访
* @see cn.com.glsx.scrm.clue.enums.collision.FollowStatusEnum
*/
@Column(name = "follow_status")
private Integer followStatus;
/**
* 跟进结果,0-真实事故,1-非真实事故,2-无法处理
* @see cn.com.glsx.scrm.clue.enums.collision.FollowResultEnum
*/
@Column(name = "follow_result")
private Integer followResult;
/**
* 回访时间
*/
@Column(name = "follow_time")
private Date followTime;
/**
* 回访备注
*/
@Column(name = "follow_remark")
private String followRemark;
/**
* 任务id,关联碰撞线索-媒体信息
*/
@Column(name = "task_id")
private String taskId;
/**
* 是否删除(0=正常,-1=删除)
*/
@Column(name = "del_flag")
private Integer delFlag;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_time")
private Date createdTime;
/**
* 更新人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 更新时间
*/
@Column(name = "updated_time")
private Date updatedTime;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.entity.collision;
import lombok.Data;
import lombok.ToString;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Data
@ToString
@Table(name = "scrm_collision_media_info")
public class CollisionMediaInfo implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 任务id,关联碰撞线索-媒体信息
*/
@Column(name = "task_id")
private String taskId;
/**
* 媒体地址链接
*/
@Column(name = "file_url")
private String fileUrl;
/**
* 媒体类型(IMAGE:图片;VIDEO:视频)
* @see cn.com.glsx.entmicro.enums.collision.CollisionMediaTypeEnum
*/
@Column(name = "media_type")
private String mediaType;
/**
* 是否删除(0=正常,-1=删除)
*/
@Column(name = "del_flag")
private Integer delFlag;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_time")
private Date createdTime;
/**
* 更新人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 更新时间
*/
@Column(name = "updated_time")
private Date updatedTime;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.entity.collision;
import lombok.Data;
import lombok.ToString;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Data
@ToString
@Table(name = "scrm_collision_push_config")
public class CollisionPushConfig implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 商户号
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 商户名称
*/
@Column(name = "merchant_name")
private String merchantName;
/**
* 推送开关,0-关,1-开
*/
@Column(name = "push_flag")
private Integer pushFlag;
/**
* 推送开始时间,格式:HH:mm
*/
@Column(name = "start_time")
private String startTime;
/**
* 推送结束时间, 格式:HH:mm
*/
@Column(name = "end_time")
private String endTime;
/**
* 配置类型,0-门店提醒,1-车主提醒
*/
@Column(name = "config_type")
private Integer configType;
/**
* config_type为0时使用,顾问电话,多个用逗号分割
*/
@Column(name = "push_phones")
private String pushPhones;
/**
* config_type为1时使用,营销卖点
*/
@Column(name = "push_content")
private String pushContent;
/**
* 是否删除(0=正常,-1=删除)
*/
@Column(name = "del_flag")
private Integer delFlag;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_time")
private Date createdTime;
/**
* 更新人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 更新时间
*/
@Column(name = "updated_time")
private Date updatedTime;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.entity.collision;
import cn.com.glsx.scrm.clue.enums.collision.DeviceTypeEnum;
import lombok.Data;
import lombok.ToString;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Data
@ToString
@Table(name = "scrm_collision_sn_info")
public class CollisionSnInfo implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 设备号
*/
private String sn;
/**
* 批次id
*/
@Column(name = "batch_id")
private Integer batchId;
/**
* 商户号
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 商户名称
*/
@Column(name = "merchant_name")
private String merchantName;
/**
* 设备类型,1:OBD
,2: DVD,
3: 电子狗
,5 :TBOX(2G),
6 行车记录仪
,7 :BBOX
,8: 追踪器
,9 :车载wifi
,12134 : 智能云镜
, 12499: AIBox
,12500: 小镜SOS记录仪,
12501 : 智能定位车充
,12503: 数字车钥匙
,12514 :后视镜B300
*/
/**
* @see DeviceTypeEnum
*/
@Column(name = "sn_type")
private Integer snType;
/**
* iccid
*/
private String iccid;
/**
* 客户名称
*/
@Column(name = "customer_name")
private String customerName;
/**
* 客户手机号
*/
@Column(name = "customer_phone")
private String customerPhone;
/**
* 客户性别,0-男,1-女
*/
@Column(name = "customer_sex")
private Integer customerSex;
/**
* 车牌号
*/
@Column(name = "license_plate")
private String licensePlate;
/**
* 车架号
*/
@Column(name = "stand_no")
private String standNo;
/**
* 设备安装时的初始里程
*/
@Column(name = "initial_mileage")
private Long initialMileage;
/**
* 上次保养里程
*/
@Column(name = "last_mileage")
private Long lastMileage;
/**
* 上次保养时间
*/
@Column(name = "last_time")
private Date lastTime;
/**
* 下次保养里程
*/
@Column(name = "lower_mileage")
private Long lowerMileage;
/**
* 下次保养时间
*/
@Column(name = "lower_time")
private Date lowerTime;
/**
* 是否更换设备,0-保修更换-免费,1-维修更换,2-购买
*/
@Column(name = "replace_flag")
private Integer replaceFlag;
/**
* 汽车品牌ID
*/
@Column(name = "vehicle_brand_id")
private Integer vehicleBrandId;
/**
* 汽车品牌
*/
@Column(name = "vehicle_brand_name")
private String vehicleBrandName;
/**
* 子品牌ID
*/
@Column(name = "vehicle_sub_brand_id")
private Integer vehicleSubBrandId;
/**
* 子品牌名称
*/
@Column(name = "vehicle_sub_brand_name")
private String vehicleSubBrandName;
/**
* 车系ID
*/
@Column(name = "vehicle_series_id")
private Integer vehicleSeriesId;
/**
* 车系名称
*/
@Column(name = "vehicle_series_name")
private String vehicleSeriesName;
/**
* 车型ID
*/
@Column(name = "vehicle_shape_id")
private Integer vehicleShapeId;
/**
* 车型名称
*/
@Column(name = "vehicle_shape_name")
private String vehicleShapeName;
/**
* 是否删除(0=正常,-1=删除)
*/
@Column(name = "del_flag")
private Integer delFlag;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_time")
private Date createdTime;
/**
* 更新人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 更新时间
*/
@Column(name = "updated_time")
private Date updatedTime;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.enums;
import cn.com.glsx.scrm.clue.config.SpringContextHolder;
import cn.com.glsx.scrm.clue.constants.SymbolConstants;
import cn.com.glsx.scrm.clue.dto.BurialPointSummaryDTO;
import cn.com.glsx.scrm.clue.dto.BurialPointSummaryParam;
import cn.com.glsx.scrm.clue.dto.SmartCarLifeBurialPointStatisticsDTO;
import cn.com.glsx.scrm.clue.mapper.BurialPointRecordMapper;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 埋点统计分组,一个分组生成一个文件发送
* @see BurialPointEventCode 埋点事件枚举
* @author yangwei
* @version 1.0
* @since 2025/10/30 13:52
*/
@Getter
@AllArgsConstructor
public enum BurialPointStatisticsGroup implements BurialPointStatisticsInter {
/**
* 滴加智享车生活pc端埋点推送
*
*/
DJ_SMART_CAR_LIFE_PC_BURIAL_POINT1(
"智享车生活平台-埋点数据",
BurialPointSystemSource.CAR_LIFE,
Lists.newArrayList(BurialPointEventTypeEnum.CLICK),
BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_1,
BurialPointStatisticsCycle.LAST_WEEK,
SmartCarLifeBurialPointStatisticsDTO.class,
true),
/**
* 小程序埋点推送
*
*/
DJ_SMART_CAR_LIFE_MINI_APP_BURIAL_POINT1(
"生意助手小程-埋点数据",
BurialPointSystemSource.BUSINESS_ASSISTANT,
Lists.newArrayList(BurialPointEventTypeEnum.CLICK),
BurialPointEventCodeGroup.DJ_SMART_CAR_LIFE_2,
BurialPointStatisticsCycle.LAST_WEEK,
SmartCarLifeBurialPointStatisticsDTO.class,
true)
;
/** 文件名 */
private final String fileName;
/** 埋点系统来源 */
private final BurialPointSystemSource burialPointSystemSource;
/** 埋点事件类型 */
private final List<BurialPointEventTypeEnum> burialPointEventTypeEnums;
/** 埋点事件分组,用于确定发送那些 EventCode */
private final BurialPointEventCodeGroup burialPointEventCodeGroup;
/** 埋点统计周期 */
private final BurialPointStatisticsCycle burialPointStatisticsCycle;
/** excel导出的类 */
private final Class<?> excelExport;
/** 是否启用 */
private final Boolean enable;
@Override
public List<? extends BurialPointSummaryDTO> fetch(BurialPointSummaryParam param) {
BurialPointRecordMapper mapper = SpringContextHolder.getBean(BurialPointRecordMapper.class);
return mapper.summaryBurialPoint(param);
}
@Override
public List<Object> convert(List<? extends BurialPointSummaryDTO> sourceList, Map<String, String> eventCodeMap) {
return sourceList.stream().map(element -> {
SmartCarLifeBurialPointStatisticsDTO smartCarLifeBurialPointStatisticsDTO = BeanUtil.copyProperties(element, SmartCarLifeBurialPointStatisticsDTO.class);
String eventName = eventCodeMap.get(element.getEventCode());
List<String> eventNameList = StrUtil.split(eventName, SymbolConstants.MINUS);
if (CollUtil.isNotEmpty(eventNameList)) {
smartCarLifeBurialPointStatisticsDTO.setFirstModule(eventNameList.get(0));
}
if (eventNameList.size() >= 2) {
smartCarLifeBurialPointStatisticsDTO.setSecondModule(eventNameList.get(1));
}
if (eventNameList.size() >= 3) {
smartCarLifeBurialPointStatisticsDTO.setEventName(eventNameList.get(2));
}
return smartCarLifeBurialPointStatisticsDTO;
}).collect(Collectors.toList());
}
}
package cn.com.glsx.scrm.clue.job;
import cn.com.glsx.scrm.clue.service.BurialPointRecordService;
import cn.com.glsx.scrm.clue.util.LocalDateUtils;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
import java.time.LocalDate;
@Slf4j
@ElasticJobConf(name = "BurialPointSummaryJob", cron = "0 0 8 ? * MON", description="埋点统计任务", overwrite = true)
public class BurialPointSummaryJob implements SimpleJob {
@Autowired
private BurialPointRecordService burialPointRecordService;
@Override
public void execute(ShardingContext shardingContext) {
try {
String jobParameter = shardingContext.getJobParameter();
log.info("埋点统计任务开始执行, 参数[{}]", jobParameter);
//获取当前时间,上一周日期范围
LocalDate currentDate = LocalDate.now();
String weekStartDate = LocalDateUtils.getLastWeekStartDate(currentDate);
String weekEndDate = LocalDateUtils.getLastWeekEndDate(currentDate);
String commonStartDate = null;
String commonEndDate = null;
if (StringUtils.isNotBlank(jobParameter)) {
String[] split = jobParameter.split(",");
weekStartDate = split[0];
weekEndDate = split[1];
commonStartDate = weekStartDate;
commonEndDate = weekEndDate;
}
burialPointRecordService.summaryBurialPointRecord(weekStartDate, weekEndDate);
burialPointRecordService.commonStatisticsBurialPointRecord(commonStartDate, commonEndDate);
log.info("埋点统计任务结束");
} catch (Exception e) {
log.error("埋点统计任务异常", e);
}
}
}
package cn.com.glsx.scrm.clue.job;
import cn.com.glsx.scrm.clue.enums.ClueStatusEnum;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import cn.com.glsx.scrm.clue.model.ClueStaff;
import cn.com.glsx.scrm.clue.service.ClueOrderService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import java.util.List;
/**
* 将未分配的线索进行分配
* @author hexy
* @description
*/
@Slf4j
@ElasticJobConf(name = "ClueAddFollowUserStatus", cron = "0 0/5 * * * ?", description="刷新券的状态", overwrite = true)
public class ClueAddFollowUserStatus implements SimpleJob {
@Autowired
private ClueOrderService couponInfoService;
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Override
public void execute(ShardingContext shardingContext) {
try{
//获取所有未分配的线索
ClueOrder condition = new ClueOrder();
condition.setStatus(ClueStatusEnum.WAIT_DEALING.getValue());
List<ClueOrder> clueOrderList = couponInfoService.list(condition);
for(ClueOrder clueOrder:clueOrderList) {
logger.info("开始分配线索" + clueOrder);
ClueStaff clueStaff = couponInfoService.getUser(clueOrder);
//如果存在跟进员工进行分配
if (!ObjectUtils.isEmpty(clueStaff)) {
//有跟进员工,状态为跟进中
clueOrder.setStatus(ClueStatusEnum.DEALING.getValue());
//更新数据
couponInfoService.insertOrUpdate(clueOrder, clueStaff);
//推送消息
couponInfoService.pushToUser(clueOrder, clueStaff);
//新建待办
couponInfoService.addUserTask(clueOrder, clueStaff);
}
}
logger.info("线索分配定时任务完成");
}catch (Exception e){
logger.error("定时任务<ClueAddFollowUserStatus>error:{}", e);
}
}
}
package cn.com.glsx.scrm.clue.kafka.consumer.collision;
import cn.com.glsx.scrm.clue.entity.collision.CollisionInfo;
import cn.com.glsx.scrm.clue.enums.collision.CollisionEventTypeEnum;
import cn.com.glsx.scrm.clue.kafka.protobuf.collision.AlarmProto;
import cn.com.glsx.scrm.clue.service.collision.CollisionInfoService;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.oreframework.jms.kafka.consumer.ConsumerProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.oreframework.jms.kafka.consumer.KafkaConsumer;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.Properties;
/**
* 碰撞线索-消费者
*/
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.kafka.consumer.zookeeper.connect")
public class CollisionEventConsumer extends KafkaConsumer {
@Autowired
private CollisionInfoService collisionInfoService;
@Autowired
private Environment env;
protected CollisionEventConsumer() {
super("gps_alarm_collision", false);
}
@Override
public ConsumerProperty getConsumerProperty() {
return new ConsumerProperty() {
@Override
public Properties extend(Properties properties) {
String connect = env.getProperty("spring.kafka.consumer.gps_alarm_collision.zookeeper.connect");
if(StringUtils.isNotEmpty(connect)){
properties.setProperty("zookeeper.connect", connect);
}
return properties;
}
};
}
@Override
public void processMessage(Object o) {
log.info("碰撞线索,收到碰撞消息, topic[{}]", topic);
try {
//解析消息
AlarmProto.AlarmNotifyReq alarmNotifyReq = AlarmProto.AlarmNotifyReq.parseFrom(getMessage());
log.info("碰撞线索,线索消息入参[{}]", alarmNotifyReq);
if (alarmNotifyReq == null) {
log.info("碰撞线索,线索消息入参解析后为空");
return;
}
//封装参数
CollisionInfo collisionInfo = new CollisionInfo();
collisionInfo.setSn(alarmNotifyReq.getDevicesn());
collisionInfo.setLongitude(String.valueOf(Double.valueOf(alarmNotifyReq.getLongitude()) / 1000000));
collisionInfo.setLatitude(String.valueOf(Double.valueOf(alarmNotifyReq.getLatitude()) / 1000000));
collisionInfo.setCollisionTime(new Date(alarmNotifyReq.getGpstime() * 1000L));
collisionInfo.setCollisionType(CollisionEventTypeEnum.COLLIDE.getValue());
collisionInfo.setTaskId(alarmNotifyReq.getTaskId());
log.info("碰撞线索,线索消息封装结束[{}]", JSON.toJSONString(collisionInfo));
//处理线索消息
collisionInfoService.handleCollisionEvent(collisionInfo);
log.info("碰撞线索,线索消息处理结束");
} catch (Exception e) {
log.info("碰撞线索,处理碰撞消息异常[{}]", e);
e.printStackTrace();
}
}
}
package cn.com.glsx.scrm.clue.kafka.consumer.collision;
import cn.com.glsx.scrm.clue.entity.collision.CollisionMediaInfo;
import cn.com.glsx.scrm.clue.enums.collision.CollisionMediaTypeEnum;
import cn.com.glsx.scrm.clue.kafka.protobuf.collision.KafkaRec;
import cn.com.glsx.scrm.clue.service.collision.CollisionMediaService;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.oreframework.jms.kafka.consumer.ConsumerProperty;
import org.oreframework.jms.kafka.consumer.KafkaConsumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import java.util.Properties;
/**
* 碰撞媒体消息-消费者
*/
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.kafka.consumer.zookeeper.connect")
public class CollisionMediaEventConsumer extends KafkaConsumer {
@Autowired
private CollisionMediaService collisionMediaService;
@Autowired
private Environment env;
protected CollisionMediaEventConsumer() {
super("3rd_device_onekeyhelpres", false);
}
@Override
public ConsumerProperty getConsumerProperty() {
return new ConsumerProperty() {
@Override
public Properties extend(Properties properties) {
String connect = env.getProperty("spring.kafka.consumer.3rd_device_onekeyhelpres.zookeeper.connect");
if(StringUtils.isNotEmpty(connect)){
properties.setProperty("zookeeper.connect", connect);
}
return properties;
}
};
}
@Override
public void processMessage(Object o) {
log.info("碰撞线索,收到媒体消息, topic[{}]", topic);
try {
//解析消息体
KafkaRec.OneKeyHelpRes onekeyHelpRes = KafkaRec.OneKeyHelpRes.parseFrom(getMessage());
log.info("碰撞线索,媒体消息入参[{}]", onekeyHelpRes);
if (onekeyHelpRes == null) {
log.info("碰撞线索,媒体消息解析为空");
return;
}
//封装参数
CollisionMediaInfo mediaInfo = new CollisionMediaInfo();
mediaInfo.setTaskId(onekeyHelpRes.getTaskId());
String fileUrl = null;
if (StringUtils.isNotEmpty(onekeyHelpRes.getYoloPath())) {
fileUrl = onekeyHelpRes.getYoloPath();
} else if (StringUtils.isNotEmpty(onekeyHelpRes.getUrl())) {
fileUrl = onekeyHelpRes.getUrl();
}
mediaInfo.setFileUrl(fileUrl);
mediaInfo.setMediaType(CollisionMediaTypeEnum.getValueByCode(onekeyHelpRes.getMtype()));
log.info("碰撞线索,媒体消息封装结束[{}]", JSON.toJSONString(mediaInfo));
//入库
collisionMediaService.insertMediaInfo(mediaInfo);
log.info("碰撞线索,媒体消息处理结束");
} catch (Exception e) {
log.info("碰撞线索,处理媒体消息异常[{}]", e);
e.printStackTrace();
}
}
}
package cn.com.glsx.scrm.clue.kafka.consumer.collision;
import cn.com.glsx.scrm.clue.entity.collision.CollisionInfo;
import cn.com.glsx.scrm.clue.enums.collision.CollisionEventTypeEnum;
import cn.com.glsx.scrm.clue.kafka.protobuf.collision.AlarmProto;
import cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto;
import cn.com.glsx.scrm.clue.service.collision.CollisionInfoService;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.oreframework.jms.kafka.consumer.ConsumerProperty;
import org.oreframework.jms.kafka.consumer.KafkaConsumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.Properties;
/**
* sos救援线索-消费者
*/
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.kafka.consumer.zookeeper.connect")
public class CollisionSosEventConsumer extends KafkaConsumer {
@Autowired
private CollisionInfoService collisionInfoService;
@Autowired
private Environment env;
protected CollisionSosEventConsumer() {
super("3rd_device_onekeyhelp", false);
}
@Override
public ConsumerProperty getConsumerProperty() {
return new ConsumerProperty() {
@Override
public Properties extend(Properties properties) {
String connect = env.getProperty("spring.kafka.consumer.3rd_device_onekeyhelp.zookeeper.connect");
if(StringUtils.isNotEmpty(connect)){
properties.setProperty("zookeeper.connect", connect);
}
return properties;
}
};
}
@Override
public void processMessage(Object o) {
log.info("碰撞线索,收到sos消息, topic[{}]", topic);
try {
//解析消息
OneKeyHelpProto.OnekeyHelp onekeyHelp = OneKeyHelpProto.OnekeyHelp.parseFrom(getMessage());
log.info("碰撞线索,sos线索消息入参[{}]", onekeyHelp);
if (onekeyHelp == null) {
log.info("碰撞线索,sos线索消息入参解析后为空");
return;
}
//封装参数
CollisionInfo collisionInfo = new CollisionInfo();
collisionInfo.setSn(onekeyHelp.getImei());
collisionInfo.setLongitude(String.valueOf(Double.valueOf(onekeyHelp.getLongitude()) / 1000000));
collisionInfo.setLatitude(String.valueOf(Double.valueOf(onekeyHelp.getLatitude()) / 1000000));
collisionInfo.setCollisionTime(new Date(onekeyHelp.getTroubletime() * 1000L));
collisionInfo.setCollisionType(CollisionEventTypeEnum.SOS.getValue());
collisionInfo.setTaskId(onekeyHelp.getTaskId());
log.info("碰撞线索,sos线索消息封装结束[{}]", JSON.toJSONString(collisionInfo));
//处理线索消息
collisionInfoService.handleCollisionEvent(collisionInfo);
log.info("碰撞线索,sos线索消息处理结束");
} catch (Exception e) {
log.info("碰撞线索,处理sos消息异常[{}]", e);
e.printStackTrace();
}
}
}
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: kafkaGpsInfo.proto
package cn.com.glsx.scrm.clue.kafka.protobuf.collision;
public final class KafkaGpsInfo {
private KafkaGpsInfo() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface GpsInfoReqOrBuilder extends
// @@protoc_insertion_point(interface_extends:GpsInfoReq)
com.google.protobuf.MessageOrBuilder {
/**
* <code>required uint64 devicesn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
boolean hasDevicesn();
/**
* <code>required uint64 devicesn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
long getDevicesn();
/**
* <code>required int32 deviceType = 2;</code>
*
* <pre>
*设备类型
* </pre>
*/
boolean hasDeviceType();
/**
* <code>required int32 deviceType = 2;</code>
*
* <pre>
*设备类型
* </pre>
*/
int getDeviceType();
/**
* <code>required uint32 gpstime = 3;</code>
*
* <pre>
*时间
* </pre>
*/
boolean hasGpstime();
/**
* <code>required uint32 gpstime = 3;</code>
*
* <pre>
*时间
* </pre>
*/
int getGpstime();
/**
* <code>required int32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
boolean hasLongitude();
/**
* <code>required int32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
int getLongitude();
/**
* <code>required int32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
boolean hasLatitude();
/**
* <code>required int32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
int getLatitude();
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
boolean hasDevaddress();
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
java.lang.String getDevaddress();
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
com.google.protobuf.ByteString
getDevaddressBytes();
/**
* <code>required int32 gaodelongitude = 7;</code>
*
* <pre>
*高德经度
* </pre>
*/
boolean hasGaodelongitude();
/**
* <code>required int32 gaodelongitude = 7;</code>
*
* <pre>
*高德经度
* </pre>
*/
int getGaodelongitude();
/**
* <code>required int32 gaodelatitude = 8;</code>
*
* <pre>
*高德纬度
* </pre>
*/
boolean hasGaodelatitude();
/**
* <code>required int32 gaodelatitude = 8;</code>
*
* <pre>
*高德纬度
* </pre>
*/
int getGaodelatitude();
/**
* <code>required int32 baidulongitude = 9;</code>
*
* <pre>
*百度经度
* </pre>
*/
boolean hasBaidulongitude();
/**
* <code>required int32 baidulongitude = 9;</code>
*
* <pre>
*百度经度
* </pre>
*/
int getBaidulongitude();
/**
* <code>required int32 baidulatitude = 10;</code>
*
* <pre>
*百度纬度
* </pre>
*/
boolean hasBaidulatitude();
/**
* <code>required int32 baidulatitude = 10;</code>
*
* <pre>
*百度纬度
* </pre>
*/
int getBaidulatitude();
}
/**
* Protobuf type {@code GpsInfoReq}
*
* <pre>
*gps_info
* </pre>
*/
public static final class GpsInfoReq extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:GpsInfoReq)
GpsInfoReqOrBuilder {
// Use GpsInfoReq.newBuilder() to construct.
private GpsInfoReq(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private GpsInfoReq(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final GpsInfoReq defaultInstance;
public static GpsInfoReq getDefaultInstance() {
return defaultInstance;
}
public GpsInfoReq getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private GpsInfoReq(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
devicesn_ = input.readUInt64();
break;
}
case 16: {
bitField0_ |= 0x00000002;
deviceType_ = input.readInt32();
break;
}
case 24: {
bitField0_ |= 0x00000004;
gpstime_ = input.readUInt32();
break;
}
case 32: {
bitField0_ |= 0x00000008;
longitude_ = input.readInt32();
break;
}
case 40: {
bitField0_ |= 0x00000010;
latitude_ = input.readInt32();
break;
}
case 50: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000020;
devaddress_ = bs;
break;
}
case 56: {
bitField0_ |= 0x00000040;
gaodelongitude_ = input.readInt32();
break;
}
case 64: {
bitField0_ |= 0x00000080;
gaodelatitude_ = input.readInt32();
break;
}
case 72: {
bitField0_ |= 0x00000100;
baidulongitude_ = input.readInt32();
break;
}
case 80: {
bitField0_ |= 0x00000200;
baidulatitude_ = input.readInt32();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return KafkaGpsInfo.internal_static_GpsInfoReq_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return KafkaGpsInfo.internal_static_GpsInfoReq_fieldAccessorTable
.ensureFieldAccessorsInitialized(
KafkaGpsInfo.GpsInfoReq.class, KafkaGpsInfo.GpsInfoReq.Builder.class);
}
public static com.google.protobuf.Parser<GpsInfoReq> PARSER =
new com.google.protobuf.AbstractParser<GpsInfoReq>() {
public GpsInfoReq parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new GpsInfoReq(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<GpsInfoReq> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int DEVICESN_FIELD_NUMBER = 1;
private long devicesn_;
/**
* <code>required uint64 devicesn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public boolean hasDevicesn() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint64 devicesn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public long getDevicesn() {
return devicesn_;
}
public static final int DEVICETYPE_FIELD_NUMBER = 2;
private int deviceType_;
/**
* <code>required int32 deviceType = 2;</code>
*
* <pre>
*设备类型
* </pre>
*/
public boolean hasDeviceType() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required int32 deviceType = 2;</code>
*
* <pre>
*设备类型
* </pre>
*/
public int getDeviceType() {
return deviceType_;
}
public static final int GPSTIME_FIELD_NUMBER = 3;
private int gpstime_;
/**
* <code>required uint32 gpstime = 3;</code>
*
* <pre>
*时间
* </pre>
*/
public boolean hasGpstime() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required uint32 gpstime = 3;</code>
*
* <pre>
*时间
* </pre>
*/
public int getGpstime() {
return gpstime_;
}
public static final int LONGITUDE_FIELD_NUMBER = 4;
private int longitude_;
/**
* <code>required int32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public boolean hasLongitude() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>required int32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public int getLongitude() {
return longitude_;
}
public static final int LATITUDE_FIELD_NUMBER = 5;
private int latitude_;
/**
* <code>required int32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public boolean hasLatitude() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>required int32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public int getLatitude() {
return latitude_;
}
public static final int DEVADDRESS_FIELD_NUMBER = 6;
private java.lang.Object devaddress_;
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
public boolean hasDevaddress() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
public java.lang.String getDevaddress() {
java.lang.Object ref = devaddress_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
devaddress_ = s;
}
return s;
}
}
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
public com.google.protobuf.ByteString
getDevaddressBytes() {
java.lang.Object ref = devaddress_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
devaddress_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int GAODELONGITUDE_FIELD_NUMBER = 7;
private int gaodelongitude_;
/**
* <code>required int32 gaodelongitude = 7;</code>
*
* <pre>
*高德经度
* </pre>
*/
public boolean hasGaodelongitude() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>required int32 gaodelongitude = 7;</code>
*
* <pre>
*高德经度
* </pre>
*/
public int getGaodelongitude() {
return gaodelongitude_;
}
public static final int GAODELATITUDE_FIELD_NUMBER = 8;
private int gaodelatitude_;
/**
* <code>required int32 gaodelatitude = 8;</code>
*
* <pre>
*高德纬度
* </pre>
*/
public boolean hasGaodelatitude() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>required int32 gaodelatitude = 8;</code>
*
* <pre>
*高德纬度
* </pre>
*/
public int getGaodelatitude() {
return gaodelatitude_;
}
public static final int BAIDULONGITUDE_FIELD_NUMBER = 9;
private int baidulongitude_;
/**
* <code>required int32 baidulongitude = 9;</code>
*
* <pre>
*百度经度
* </pre>
*/
public boolean hasBaidulongitude() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>required int32 baidulongitude = 9;</code>
*
* <pre>
*百度经度
* </pre>
*/
public int getBaidulongitude() {
return baidulongitude_;
}
public static final int BAIDULATITUDE_FIELD_NUMBER = 10;
private int baidulatitude_;
/**
* <code>required int32 baidulatitude = 10;</code>
*
* <pre>
*百度纬度
* </pre>
*/
public boolean hasBaidulatitude() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>required int32 baidulatitude = 10;</code>
*
* <pre>
*百度纬度
* </pre>
*/
public int getBaidulatitude() {
return baidulatitude_;
}
private void initFields() {
devicesn_ = 0L;
deviceType_ = 0;
gpstime_ = 0;
longitude_ = 0;
latitude_ = 0;
devaddress_ = "";
gaodelongitude_ = 0;
gaodelatitude_ = 0;
baidulongitude_ = 0;
baidulatitude_ = 0;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasDevicesn()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasDeviceType()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasGpstime()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasLongitude()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasLatitude()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasDevaddress()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasGaodelongitude()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasGaodelatitude()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasBaidulongitude()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasBaidulatitude()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeUInt64(1, devicesn_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt32(2, deviceType_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeUInt32(3, gpstime_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeInt32(4, longitude_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeInt32(5, latitude_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeBytes(6, getDevaddressBytes());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeInt32(7, gaodelongitude_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeInt32(8, gaodelatitude_);
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
output.writeInt32(9, baidulongitude_);
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
output.writeInt32(10, baidulatitude_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(1, devicesn_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, deviceType_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, gpstime_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, longitude_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(5, latitude_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(6, getDevaddressBytes());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(7, gaodelongitude_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(8, gaodelatitude_);
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(9, baidulongitude_);
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(10, baidulatitude_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static KafkaGpsInfo.GpsInfoReq parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static KafkaGpsInfo.GpsInfoReq parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static KafkaGpsInfo.GpsInfoReq parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static KafkaGpsInfo.GpsInfoReq parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static KafkaGpsInfo.GpsInfoReq parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static KafkaGpsInfo.GpsInfoReq parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static KafkaGpsInfo.GpsInfoReq parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static KafkaGpsInfo.GpsInfoReq parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static KafkaGpsInfo.GpsInfoReq parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static KafkaGpsInfo.GpsInfoReq parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(KafkaGpsInfo.GpsInfoReq prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code GpsInfoReq}
*
* <pre>
*gps_info
* </pre>
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:GpsInfoReq)
KafkaGpsInfo.GpsInfoReqOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return KafkaGpsInfo.internal_static_GpsInfoReq_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return KafkaGpsInfo.internal_static_GpsInfoReq_fieldAccessorTable
.ensureFieldAccessorsInitialized(
KafkaGpsInfo.GpsInfoReq.class, KafkaGpsInfo.GpsInfoReq.Builder.class);
}
// Construct using KafkaGpsInfo.GpsInfoReq.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
devicesn_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
deviceType_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
gpstime_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
longitude_ = 0;
bitField0_ = (bitField0_ & ~0x00000008);
latitude_ = 0;
bitField0_ = (bitField0_ & ~0x00000010);
devaddress_ = "";
bitField0_ = (bitField0_ & ~0x00000020);
gaodelongitude_ = 0;
bitField0_ = (bitField0_ & ~0x00000040);
gaodelatitude_ = 0;
bitField0_ = (bitField0_ & ~0x00000080);
baidulongitude_ = 0;
bitField0_ = (bitField0_ & ~0x00000100);
baidulatitude_ = 0;
bitField0_ = (bitField0_ & ~0x00000200);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return KafkaGpsInfo.internal_static_GpsInfoReq_descriptor;
}
public KafkaGpsInfo.GpsInfoReq getDefaultInstanceForType() {
return KafkaGpsInfo.GpsInfoReq.getDefaultInstance();
}
public KafkaGpsInfo.GpsInfoReq build() {
KafkaGpsInfo.GpsInfoReq result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public KafkaGpsInfo.GpsInfoReq buildPartial() {
KafkaGpsInfo.GpsInfoReq result = new KafkaGpsInfo.GpsInfoReq(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.devicesn_ = devicesn_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.deviceType_ = deviceType_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.gpstime_ = gpstime_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.longitude_ = longitude_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.latitude_ = latitude_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.devaddress_ = devaddress_;
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
to_bitField0_ |= 0x00000040;
}
result.gaodelongitude_ = gaodelongitude_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000080;
}
result.gaodelatitude_ = gaodelatitude_;
if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
to_bitField0_ |= 0x00000100;
}
result.baidulongitude_ = baidulongitude_;
if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
to_bitField0_ |= 0x00000200;
}
result.baidulatitude_ = baidulatitude_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof KafkaGpsInfo.GpsInfoReq) {
return mergeFrom((KafkaGpsInfo.GpsInfoReq)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(KafkaGpsInfo.GpsInfoReq other) {
if (other == KafkaGpsInfo.GpsInfoReq.getDefaultInstance()) return this;
if (other.hasDevicesn()) {
setDevicesn(other.getDevicesn());
}
if (other.hasDeviceType()) {
setDeviceType(other.getDeviceType());
}
if (other.hasGpstime()) {
setGpstime(other.getGpstime());
}
if (other.hasLongitude()) {
setLongitude(other.getLongitude());
}
if (other.hasLatitude()) {
setLatitude(other.getLatitude());
}
if (other.hasDevaddress()) {
bitField0_ |= 0x00000020;
devaddress_ = other.devaddress_;
onChanged();
}
if (other.hasGaodelongitude()) {
setGaodelongitude(other.getGaodelongitude());
}
if (other.hasGaodelatitude()) {
setGaodelatitude(other.getGaodelatitude());
}
if (other.hasBaidulongitude()) {
setBaidulongitude(other.getBaidulongitude());
}
if (other.hasBaidulatitude()) {
setBaidulatitude(other.getBaidulatitude());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasDevicesn()) {
return false;
}
if (!hasDeviceType()) {
return false;
}
if (!hasGpstime()) {
return false;
}
if (!hasLongitude()) {
return false;
}
if (!hasLatitude()) {
return false;
}
if (!hasDevaddress()) {
return false;
}
if (!hasGaodelongitude()) {
return false;
}
if (!hasGaodelatitude()) {
return false;
}
if (!hasBaidulongitude()) {
return false;
}
if (!hasBaidulatitude()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
KafkaGpsInfo.GpsInfoReq parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (KafkaGpsInfo.GpsInfoReq) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private long devicesn_ ;
/**
* <code>required uint64 devicesn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public boolean hasDevicesn() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint64 devicesn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public long getDevicesn() {
return devicesn_;
}
/**
* <code>required uint64 devicesn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public Builder setDevicesn(long value) {
bitField0_ |= 0x00000001;
devicesn_ = value;
onChanged();
return this;
}
/**
* <code>required uint64 devicesn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public Builder clearDevicesn() {
bitField0_ = (bitField0_ & ~0x00000001);
devicesn_ = 0L;
onChanged();
return this;
}
private int deviceType_ ;
/**
* <code>required int32 deviceType = 2;</code>
*
* <pre>
*设备类型
* </pre>
*/
public boolean hasDeviceType() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required int32 deviceType = 2;</code>
*
* <pre>
*设备类型
* </pre>
*/
public int getDeviceType() {
return deviceType_;
}
/**
* <code>required int32 deviceType = 2;</code>
*
* <pre>
*设备类型
* </pre>
*/
public Builder setDeviceType(int value) {
bitField0_ |= 0x00000002;
deviceType_ = value;
onChanged();
return this;
}
/**
* <code>required int32 deviceType = 2;</code>
*
* <pre>
*设备类型
* </pre>
*/
public Builder clearDeviceType() {
bitField0_ = (bitField0_ & ~0x00000002);
deviceType_ = 0;
onChanged();
return this;
}
private int gpstime_ ;
/**
* <code>required uint32 gpstime = 3;</code>
*
* <pre>
*时间
* </pre>
*/
public boolean hasGpstime() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required uint32 gpstime = 3;</code>
*
* <pre>
*时间
* </pre>
*/
public int getGpstime() {
return gpstime_;
}
/**
* <code>required uint32 gpstime = 3;</code>
*
* <pre>
*时间
* </pre>
*/
public Builder setGpstime(int value) {
bitField0_ |= 0x00000004;
gpstime_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 gpstime = 3;</code>
*
* <pre>
*时间
* </pre>
*/
public Builder clearGpstime() {
bitField0_ = (bitField0_ & ~0x00000004);
gpstime_ = 0;
onChanged();
return this;
}
private int longitude_ ;
/**
* <code>required int32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public boolean hasLongitude() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>required int32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public int getLongitude() {
return longitude_;
}
/**
* <code>required int32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public Builder setLongitude(int value) {
bitField0_ |= 0x00000008;
longitude_ = value;
onChanged();
return this;
}
/**
* <code>required int32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public Builder clearLongitude() {
bitField0_ = (bitField0_ & ~0x00000008);
longitude_ = 0;
onChanged();
return this;
}
private int latitude_ ;
/**
* <code>required int32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public boolean hasLatitude() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>required int32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public int getLatitude() {
return latitude_;
}
/**
* <code>required int32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public Builder setLatitude(int value) {
bitField0_ |= 0x00000010;
latitude_ = value;
onChanged();
return this;
}
/**
* <code>required int32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public Builder clearLatitude() {
bitField0_ = (bitField0_ & ~0x00000010);
latitude_ = 0;
onChanged();
return this;
}
private java.lang.Object devaddress_ = "";
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
public boolean hasDevaddress() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
public java.lang.String getDevaddress() {
java.lang.Object ref = devaddress_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
devaddress_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
public com.google.protobuf.ByteString
getDevaddressBytes() {
java.lang.Object ref = devaddress_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
devaddress_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
public Builder setDevaddress(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
devaddress_ = value;
onChanged();
return this;
}
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
public Builder clearDevaddress() {
bitField0_ = (bitField0_ & ~0x00000020);
devaddress_ = getDefaultInstance().getDevaddress();
onChanged();
return this;
}
/**
* <code>required string devaddress = 6;</code>
*
* <pre>
*地址
* </pre>
*/
public Builder setDevaddressBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
devaddress_ = value;
onChanged();
return this;
}
private int gaodelongitude_ ;
/**
* <code>required int32 gaodelongitude = 7;</code>
*
* <pre>
*高德经度
* </pre>
*/
public boolean hasGaodelongitude() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>required int32 gaodelongitude = 7;</code>
*
* <pre>
*高德经度
* </pre>
*/
public int getGaodelongitude() {
return gaodelongitude_;
}
/**
* <code>required int32 gaodelongitude = 7;</code>
*
* <pre>
*高德经度
* </pre>
*/
public Builder setGaodelongitude(int value) {
bitField0_ |= 0x00000040;
gaodelongitude_ = value;
onChanged();
return this;
}
/**
* <code>required int32 gaodelongitude = 7;</code>
*
* <pre>
*高德经度
* </pre>
*/
public Builder clearGaodelongitude() {
bitField0_ = (bitField0_ & ~0x00000040);
gaodelongitude_ = 0;
onChanged();
return this;
}
private int gaodelatitude_ ;
/**
* <code>required int32 gaodelatitude = 8;</code>
*
* <pre>
*高德纬度
* </pre>
*/
public boolean hasGaodelatitude() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>required int32 gaodelatitude = 8;</code>
*
* <pre>
*高德纬度
* </pre>
*/
public int getGaodelatitude() {
return gaodelatitude_;
}
/**
* <code>required int32 gaodelatitude = 8;</code>
*
* <pre>
*高德纬度
* </pre>
*/
public Builder setGaodelatitude(int value) {
bitField0_ |= 0x00000080;
gaodelatitude_ = value;
onChanged();
return this;
}
/**
* <code>required int32 gaodelatitude = 8;</code>
*
* <pre>
*高德纬度
* </pre>
*/
public Builder clearGaodelatitude() {
bitField0_ = (bitField0_ & ~0x00000080);
gaodelatitude_ = 0;
onChanged();
return this;
}
private int baidulongitude_ ;
/**
* <code>required int32 baidulongitude = 9;</code>
*
* <pre>
*百度经度
* </pre>
*/
public boolean hasBaidulongitude() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>required int32 baidulongitude = 9;</code>
*
* <pre>
*百度经度
* </pre>
*/
public int getBaidulongitude() {
return baidulongitude_;
}
/**
* <code>required int32 baidulongitude = 9;</code>
*
* <pre>
*百度经度
* </pre>
*/
public Builder setBaidulongitude(int value) {
bitField0_ |= 0x00000100;
baidulongitude_ = value;
onChanged();
return this;
}
/**
* <code>required int32 baidulongitude = 9;</code>
*
* <pre>
*百度经度
* </pre>
*/
public Builder clearBaidulongitude() {
bitField0_ = (bitField0_ & ~0x00000100);
baidulongitude_ = 0;
onChanged();
return this;
}
private int baidulatitude_ ;
/**
* <code>required int32 baidulatitude = 10;</code>
*
* <pre>
*百度纬度
* </pre>
*/
public boolean hasBaidulatitude() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>required int32 baidulatitude = 10;</code>
*
* <pre>
*百度纬度
* </pre>
*/
public int getBaidulatitude() {
return baidulatitude_;
}
/**
* <code>required int32 baidulatitude = 10;</code>
*
* <pre>
*百度纬度
* </pre>
*/
public Builder setBaidulatitude(int value) {
bitField0_ |= 0x00000200;
baidulatitude_ = value;
onChanged();
return this;
}
/**
* <code>required int32 baidulatitude = 10;</code>
*
* <pre>
*百度纬度
* </pre>
*/
public Builder clearBaidulatitude() {
bitField0_ = (bitField0_ & ~0x00000200);
baidulatitude_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:GpsInfoReq)
}
static {
defaultInstance = new GpsInfoReq(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:GpsInfoReq)
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_GpsInfoReq_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_GpsInfoReq_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\022kafkaGpsInfo.proto\"\332\001\n\nGpsInfoReq\022\020\n\010d" +
"evicesn\030\001 \002(\004\022\022\n\ndeviceType\030\002 \002(\005\022\017\n\007gps" +
"time\030\003 \002(\r\022\021\n\tlongitude\030\004 \002(\005\022\020\n\010latitud" +
"e\030\005 \002(\005\022\022\n\ndevaddress\030\006 \002(\t\022\026\n\016gaodelong" +
"itude\030\007 \002(\005\022\025\n\rgaodelatitude\030\010 \002(\005\022\026\n\016ba" +
"idulongitude\030\t \002(\005\022\025\n\rbaidulatitude\030\n \002(" +
"\005"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
internal_static_GpsInfoReq_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_GpsInfoReq_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_GpsInfoReq_descriptor,
new java.lang.String[] { "Devicesn", "DeviceType", "Gpstime", "Longitude", "Latitude", "Devaddress", "Gaodelongitude", "Gaodelatitude", "Baidulongitude", "Baidulatitude", });
}
// @@protoc_insertion_point(outer_class_scope)
}
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: kafka_device.proto
package cn.com.glsx.scrm.clue.kafka.protobuf.collision;
public final class OneKeyHelpProto {
private OneKeyHelpProto() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface OnekeyHelpOrBuilder extends
// @@protoc_insertion_point(interface_extends:protos_devicesvr.OnekeyHelp)
com.google.protobuf.MessageOrBuilder {
/**
* <code>required string imei = 1;</code>
*/
boolean hasImei();
/**
* <code>required string imei = 1;</code>
*/
java.lang.String getImei();
/**
* <code>required string imei = 1;</code>
*/
com.google.protobuf.ByteString
getImeiBytes();
/**
* <code>required string troubletype = 2;</code>
*/
boolean hasTroubletype();
/**
* <code>required string troubletype = 2;</code>
*/
java.lang.String getTroubletype();
/**
* <code>required string troubletype = 2;</code>
*/
com.google.protobuf.ByteString
getTroubletypeBytes();
/**
* <code>required uint32 troubletime = 3;</code>
*/
boolean hasTroubletime();
/**
* <code>required uint32 troubletime = 3;</code>
*/
int getTroubletime();
/**
* <code>required uint32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
boolean hasLongitude();
/**
* <code>required uint32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
int getLongitude();
/**
* <code>required uint32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
boolean hasLatitude();
/**
* <code>required uint32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
int getLatitude();
/**
* <code>required string task_id = 6;</code>
*/
boolean hasTaskId();
/**
* <code>required string task_id = 6;</code>
*/
java.lang.String getTaskId();
/**
* <code>required string task_id = 6;</code>
*/
com.google.protobuf.ByteString
getTaskIdBytes();
}
/**
* Protobuf type {@code protos_devicesvr.OnekeyHelp}
*/
public static final class OnekeyHelp extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:protos_devicesvr.OnekeyHelp)
OnekeyHelpOrBuilder {
// Use OnekeyHelp.newBuilder() to construct.
private OnekeyHelp(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private OnekeyHelp(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final OnekeyHelp defaultInstance;
public static OnekeyHelp getDefaultInstance() {
return defaultInstance;
}
public OnekeyHelp getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private OnekeyHelp(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000001;
imei_ = bs;
break;
}
case 18: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000002;
troubletype_ = bs;
break;
}
case 24: {
bitField0_ |= 0x00000004;
troubletime_ = input.readUInt32();
break;
}
case 32: {
bitField0_ |= 0x00000008;
longitude_ = input.readUInt32();
break;
}
case 40: {
bitField0_ |= 0x00000010;
latitude_ = input.readUInt32();
break;
}
case 50: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000020;
taskId_ = bs;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.internal_static_protos_devicesvr_OnekeyHelp_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.internal_static_protos_devicesvr_OnekeyHelp_fieldAccessorTable
.ensureFieldAccessorsInitialized(
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp.class, cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp.Builder.class);
}
public static com.google.protobuf.Parser<OnekeyHelp> PARSER =
new com.google.protobuf.AbstractParser<OnekeyHelp>() {
public OnekeyHelp parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new OnekeyHelp(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<OnekeyHelp> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int IMEI_FIELD_NUMBER = 1;
private java.lang.Object imei_;
/**
* <code>required string imei = 1;</code>
*/
public boolean hasImei() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string imei = 1;</code>
*/
public java.lang.String getImei() {
java.lang.Object ref = imei_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
imei_ = s;
}
return s;
}
}
/**
* <code>required string imei = 1;</code>
*/
public com.google.protobuf.ByteString
getImeiBytes() {
java.lang.Object ref = imei_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
imei_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TROUBLETYPE_FIELD_NUMBER = 2;
private java.lang.Object troubletype_;
/**
* <code>required string troubletype = 2;</code>
*/
public boolean hasTroubletype() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string troubletype = 2;</code>
*/
public java.lang.String getTroubletype() {
java.lang.Object ref = troubletype_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
troubletype_ = s;
}
return s;
}
}
/**
* <code>required string troubletype = 2;</code>
*/
public com.google.protobuf.ByteString
getTroubletypeBytes() {
java.lang.Object ref = troubletype_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
troubletype_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TROUBLETIME_FIELD_NUMBER = 3;
private int troubletime_;
/**
* <code>required uint32 troubletime = 3;</code>
*/
public boolean hasTroubletime() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required uint32 troubletime = 3;</code>
*/
public int getTroubletime() {
return troubletime_;
}
public static final int LONGITUDE_FIELD_NUMBER = 4;
private int longitude_;
/**
* <code>required uint32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public boolean hasLongitude() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>required uint32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public int getLongitude() {
return longitude_;
}
public static final int LATITUDE_FIELD_NUMBER = 5;
private int latitude_;
/**
* <code>required uint32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public boolean hasLatitude() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>required uint32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public int getLatitude() {
return latitude_;
}
public static final int TASK_ID_FIELD_NUMBER = 6;
private java.lang.Object taskId_;
/**
* <code>required string task_id = 6;</code>
*/
public boolean hasTaskId() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>required string task_id = 6;</code>
*/
public java.lang.String getTaskId() {
java.lang.Object ref = taskId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
taskId_ = s;
}
return s;
}
}
/**
* <code>required string task_id = 6;</code>
*/
public com.google.protobuf.ByteString
getTaskIdBytes() {
java.lang.Object ref = taskId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
taskId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private void initFields() {
imei_ = "";
troubletype_ = "";
troubletime_ = 0;
longitude_ = 0;
latitude_ = 0;
taskId_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasImei()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasTroubletype()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasTroubletime()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasLongitude()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasLatitude()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasTaskId()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getImeiBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getTroubletypeBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeUInt32(3, troubletime_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeUInt32(4, longitude_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeUInt32(5, latitude_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeBytes(6, getTaskIdBytes());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getImeiBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getTroubletypeBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, troubletime_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(4, longitude_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(5, latitude_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(6, getTaskIdBytes());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code protos_devicesvr.OnekeyHelp}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:protos_devicesvr.OnekeyHelp)
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelpOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.internal_static_protos_devicesvr_OnekeyHelp_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.internal_static_protos_devicesvr_OnekeyHelp_fieldAccessorTable
.ensureFieldAccessorsInitialized(
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp.class, cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp.Builder.class);
}
// Construct using cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
imei_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
troubletype_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
troubletime_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
longitude_ = 0;
bitField0_ = (bitField0_ & ~0x00000008);
latitude_ = 0;
bitField0_ = (bitField0_ & ~0x00000010);
taskId_ = "";
bitField0_ = (bitField0_ & ~0x00000020);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.internal_static_protos_devicesvr_OnekeyHelp_descriptor;
}
public cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp getDefaultInstanceForType() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp.getDefaultInstance();
}
public cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp build() {
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp buildPartial() {
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp result = new cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.imei_ = imei_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.troubletype_ = troubletype_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.troubletime_ = troubletime_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.longitude_ = longitude_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.latitude_ = latitude_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.taskId_ = taskId_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp) {
return mergeFrom((cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp other) {
if (other == cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp.getDefaultInstance()) return this;
if (other.hasImei()) {
bitField0_ |= 0x00000001;
imei_ = other.imei_;
onChanged();
}
if (other.hasTroubletype()) {
bitField0_ |= 0x00000002;
troubletype_ = other.troubletype_;
onChanged();
}
if (other.hasTroubletime()) {
setTroubletime(other.getTroubletime());
}
if (other.hasLongitude()) {
setLongitude(other.getLongitude());
}
if (other.hasLatitude()) {
setLatitude(other.getLatitude());
}
if (other.hasTaskId()) {
bitField0_ |= 0x00000020;
taskId_ = other.taskId_;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasImei()) {
return false;
}
if (!hasTroubletype()) {
return false;
}
if (!hasTroubletime()) {
return false;
}
if (!hasLongitude()) {
return false;
}
if (!hasLatitude()) {
return false;
}
if (!hasTaskId()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OnekeyHelp) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object imei_ = "";
/**
* <code>required string imei = 1;</code>
*/
public boolean hasImei() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string imei = 1;</code>
*/
public java.lang.String getImei() {
java.lang.Object ref = imei_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
imei_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string imei = 1;</code>
*/
public com.google.protobuf.ByteString
getImeiBytes() {
java.lang.Object ref = imei_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
imei_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string imei = 1;</code>
*/
public Builder setImei(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
imei_ = value;
onChanged();
return this;
}
/**
* <code>required string imei = 1;</code>
*/
public Builder clearImei() {
bitField0_ = (bitField0_ & ~0x00000001);
imei_ = getDefaultInstance().getImei();
onChanged();
return this;
}
/**
* <code>required string imei = 1;</code>
*/
public Builder setImeiBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
imei_ = value;
onChanged();
return this;
}
private java.lang.Object troubletype_ = "";
/**
* <code>required string troubletype = 2;</code>
*/
public boolean hasTroubletype() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string troubletype = 2;</code>
*/
public java.lang.String getTroubletype() {
java.lang.Object ref = troubletype_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
troubletype_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string troubletype = 2;</code>
*/
public com.google.protobuf.ByteString
getTroubletypeBytes() {
java.lang.Object ref = troubletype_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
troubletype_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string troubletype = 2;</code>
*/
public Builder setTroubletype(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
troubletype_ = value;
onChanged();
return this;
}
/**
* <code>required string troubletype = 2;</code>
*/
public Builder clearTroubletype() {
bitField0_ = (bitField0_ & ~0x00000002);
troubletype_ = getDefaultInstance().getTroubletype();
onChanged();
return this;
}
/**
* <code>required string troubletype = 2;</code>
*/
public Builder setTroubletypeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
troubletype_ = value;
onChanged();
return this;
}
private int troubletime_ ;
/**
* <code>required uint32 troubletime = 3;</code>
*/
public boolean hasTroubletime() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required uint32 troubletime = 3;</code>
*/
public int getTroubletime() {
return troubletime_;
}
/**
* <code>required uint32 troubletime = 3;</code>
*/
public Builder setTroubletime(int value) {
bitField0_ |= 0x00000004;
troubletime_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 troubletime = 3;</code>
*/
public Builder clearTroubletime() {
bitField0_ = (bitField0_ & ~0x00000004);
troubletime_ = 0;
onChanged();
return this;
}
private int longitude_ ;
/**
* <code>required uint32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public boolean hasLongitude() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>required uint32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public int getLongitude() {
return longitude_;
}
/**
* <code>required uint32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public Builder setLongitude(int value) {
bitField0_ |= 0x00000008;
longitude_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 longitude = 4;</code>
*
* <pre>
*经度
* </pre>
*/
public Builder clearLongitude() {
bitField0_ = (bitField0_ & ~0x00000008);
longitude_ = 0;
onChanged();
return this;
}
private int latitude_ ;
/**
* <code>required uint32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public boolean hasLatitude() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>required uint32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public int getLatitude() {
return latitude_;
}
/**
* <code>required uint32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public Builder setLatitude(int value) {
bitField0_ |= 0x00000010;
latitude_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 latitude = 5;</code>
*
* <pre>
*纬度
* </pre>
*/
public Builder clearLatitude() {
bitField0_ = (bitField0_ & ~0x00000010);
latitude_ = 0;
onChanged();
return this;
}
private java.lang.Object taskId_ = "";
/**
* <code>required string task_id = 6;</code>
*/
public boolean hasTaskId() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>required string task_id = 6;</code>
*/
public java.lang.String getTaskId() {
java.lang.Object ref = taskId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
taskId_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string task_id = 6;</code>
*/
public com.google.protobuf.ByteString
getTaskIdBytes() {
java.lang.Object ref = taskId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
taskId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string task_id = 6;</code>
*/
public Builder setTaskId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
taskId_ = value;
onChanged();
return this;
}
/**
* <code>required string task_id = 6;</code>
*/
public Builder clearTaskId() {
bitField0_ = (bitField0_ & ~0x00000020);
taskId_ = getDefaultInstance().getTaskId();
onChanged();
return this;
}
/**
* <code>required string task_id = 6;</code>
*/
public Builder setTaskIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
taskId_ = value;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:protos_devicesvr.OnekeyHelp)
}
static {
defaultInstance = new OnekeyHelp(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:protos_devicesvr.OnekeyHelp)
}
public interface OneKeyHelpResOrBuilder extends
// @@protoc_insertion_point(interface_extends:protos_devicesvr.OneKeyHelpRes)
com.google.protobuf.MessageOrBuilder {
/**
* <code>required uint32 mtype = 1;</code>
*/
boolean hasMtype();
/**
* <code>required uint32 mtype = 1;</code>
*/
int getMtype();
/**
* <code>required string url = 2;</code>
*/
boolean hasUrl();
/**
* <code>required string url = 2;</code>
*/
java.lang.String getUrl();
/**
* <code>required string url = 2;</code>
*/
com.google.protobuf.ByteString
getUrlBytes();
/**
* <code>required string task_id = 3;</code>
*/
boolean hasTaskId();
/**
* <code>required string task_id = 3;</code>
*/
java.lang.String getTaskId();
/**
* <code>required string task_id = 3;</code>
*/
com.google.protobuf.ByteString
getTaskIdBytes();
}
/**
* Protobuf type {@code protos_devicesvr.OneKeyHelpRes}
*/
public static final class OneKeyHelpRes extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:protos_devicesvr.OneKeyHelpRes)
OneKeyHelpResOrBuilder {
// Use OneKeyHelpRes.newBuilder() to construct.
private OneKeyHelpRes(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private OneKeyHelpRes(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final OneKeyHelpRes defaultInstance;
public static OneKeyHelpRes getDefaultInstance() {
return defaultInstance;
}
public OneKeyHelpRes getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private OneKeyHelpRes(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
mtype_ = input.readUInt32();
break;
}
case 18: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000002;
url_ = bs;
break;
}
case 26: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000004;
taskId_ = bs;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.internal_static_protos_devicesvr_OneKeyHelpRes_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.internal_static_protos_devicesvr_OneKeyHelpRes_fieldAccessorTable
.ensureFieldAccessorsInitialized(
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes.class, cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes.Builder.class);
}
public static com.google.protobuf.Parser<OneKeyHelpRes> PARSER =
new com.google.protobuf.AbstractParser<OneKeyHelpRes>() {
public OneKeyHelpRes parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new OneKeyHelpRes(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<OneKeyHelpRes> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int MTYPE_FIELD_NUMBER = 1;
private int mtype_;
/**
* <code>required uint32 mtype = 1;</code>
*/
public boolean hasMtype() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint32 mtype = 1;</code>
*/
public int getMtype() {
return mtype_;
}
public static final int URL_FIELD_NUMBER = 2;
private java.lang.Object url_;
/**
* <code>required string url = 2;</code>
*/
public boolean hasUrl() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string url = 2;</code>
*/
public java.lang.String getUrl() {
java.lang.Object ref = url_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
url_ = s;
}
return s;
}
}
/**
* <code>required string url = 2;</code>
*/
public com.google.protobuf.ByteString
getUrlBytes() {
java.lang.Object ref = url_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
url_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TASK_ID_FIELD_NUMBER = 3;
private java.lang.Object taskId_;
/**
* <code>required string task_id = 3;</code>
*/
public boolean hasTaskId() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required string task_id = 3;</code>
*/
public java.lang.String getTaskId() {
java.lang.Object ref = taskId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
taskId_ = s;
}
return s;
}
}
/**
* <code>required string task_id = 3;</code>
*/
public com.google.protobuf.ByteString
getTaskIdBytes() {
java.lang.Object ref = taskId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
taskId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private void initFields() {
mtype_ = 0;
url_ = "";
taskId_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasMtype()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasUrl()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasTaskId()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeUInt32(1, mtype_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getUrlBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, getTaskIdBytes());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, mtype_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getUrlBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, getTaskIdBytes());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code protos_devicesvr.OneKeyHelpRes}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:protos_devicesvr.OneKeyHelpRes)
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpResOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.internal_static_protos_devicesvr_OneKeyHelpRes_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.internal_static_protos_devicesvr_OneKeyHelpRes_fieldAccessorTable
.ensureFieldAccessorsInitialized(
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes.class, cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes.Builder.class);
}
// Construct using cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
mtype_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
url_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
taskId_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.internal_static_protos_devicesvr_OneKeyHelpRes_descriptor;
}
public cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes getDefaultInstanceForType() {
return cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes.getDefaultInstance();
}
public cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes build() {
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes buildPartial() {
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes result = new cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.mtype_ = mtype_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.url_ = url_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.taskId_ = taskId_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes) {
return mergeFrom((cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes other) {
if (other == cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes.getDefaultInstance()) return this;
if (other.hasMtype()) {
setMtype(other.getMtype());
}
if (other.hasUrl()) {
bitField0_ |= 0x00000002;
url_ = other.url_;
onChanged();
}
if (other.hasTaskId()) {
bitField0_ |= 0x00000004;
taskId_ = other.taskId_;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasMtype()) {
return false;
}
if (!hasUrl()) {
return false;
}
if (!hasTaskId()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (cn.com.glsx.scrm.clue.kafka.protobuf.collision.OneKeyHelpProto.OneKeyHelpRes) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private int mtype_ ;
/**
* <code>required uint32 mtype = 1;</code>
*/
public boolean hasMtype() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint32 mtype = 1;</code>
*/
public int getMtype() {
return mtype_;
}
/**
* <code>required uint32 mtype = 1;</code>
*/
public Builder setMtype(int value) {
bitField0_ |= 0x00000001;
mtype_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 mtype = 1;</code>
*/
public Builder clearMtype() {
bitField0_ = (bitField0_ & ~0x00000001);
mtype_ = 0;
onChanged();
return this;
}
private java.lang.Object url_ = "";
/**
* <code>required string url = 2;</code>
*/
public boolean hasUrl() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string url = 2;</code>
*/
public java.lang.String getUrl() {
java.lang.Object ref = url_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
url_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string url = 2;</code>
*/
public com.google.protobuf.ByteString
getUrlBytes() {
java.lang.Object ref = url_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
url_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string url = 2;</code>
*/
public Builder setUrl(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
url_ = value;
onChanged();
return this;
}
/**
* <code>required string url = 2;</code>
*/
public Builder clearUrl() {
bitField0_ = (bitField0_ & ~0x00000002);
url_ = getDefaultInstance().getUrl();
onChanged();
return this;
}
/**
* <code>required string url = 2;</code>
*/
public Builder setUrlBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
url_ = value;
onChanged();
return this;
}
private java.lang.Object taskId_ = "";
/**
* <code>required string task_id = 3;</code>
*/
public boolean hasTaskId() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required string task_id = 3;</code>
*/
public java.lang.String getTaskId() {
java.lang.Object ref = taskId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
taskId_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string task_id = 3;</code>
*/
public com.google.protobuf.ByteString
getTaskIdBytes() {
java.lang.Object ref = taskId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
taskId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string task_id = 3;</code>
*/
public Builder setTaskId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
taskId_ = value;
onChanged();
return this;
}
/**
* <code>required string task_id = 3;</code>
*/
public Builder clearTaskId() {
bitField0_ = (bitField0_ & ~0x00000004);
taskId_ = getDefaultInstance().getTaskId();
onChanged();
return this;
}
/**
* <code>required string task_id = 3;</code>
*/
public Builder setTaskIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
taskId_ = value;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:protos_devicesvr.OneKeyHelpRes)
}
static {
defaultInstance = new OneKeyHelpRes(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:protos_devicesvr.OneKeyHelpRes)
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_protos_devicesvr_OnekeyHelp_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_protos_devicesvr_OnekeyHelp_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_protos_devicesvr_OneKeyHelpRes_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_protos_devicesvr_OneKeyHelpRes_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\022kafka_device.proto\022\020protos_devicesvr\"z" +
"\n\nOnekeyHelp\022\014\n\004imei\030\001 \002(\t\022\023\n\013troubletyp" +
"e\030\002 \002(\t\022\023\n\013troubletime\030\003 \002(\r\022\021\n\tlongitud" +
"e\030\004 \002(\r\022\020\n\010latitude\030\005 \002(\r\022\017\n\007task_id\030\006 \002" +
"(\t\"<\n\rOneKeyHelpRes\022\r\n\005mtype\030\001 \002(\r\022\013\n\003ur" +
"l\030\002 \002(\t\022\017\n\007task_id\030\003 \002(\tB7\n$cn.com.glsx." +
"ddh.smartcar.queue.protoB\017OneKeyHelpProt" +
"o"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
internal_static_protos_devicesvr_OnekeyHelp_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_protos_devicesvr_OnekeyHelp_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_protos_devicesvr_OnekeyHelp_descriptor,
new java.lang.String[] { "Imei", "Troubletype", "Troubletime", "Longitude", "Latitude", "TaskId", });
internal_static_protos_devicesvr_OneKeyHelpRes_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_protos_devicesvr_OneKeyHelpRes_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_protos_devicesvr_OneKeyHelpRes_descriptor,
new java.lang.String[] { "Mtype", "Url", "TaskId", });
}
// @@protoc_insertion_point(outer_class_scope)
}
package cn.com.glsx.scrm.clue.listener;
import cn.com.glsx.scrm.clue.entity.collision.CollisionSnInfo;
import cn.com.glsx.scrm.clue.enums.collision.DeviceReplaceEnum;
import cn.com.glsx.scrm.clue.enums.exception.ClueExceptionEnum;
import cn.com.glsx.scrm.clue.model.collision.CollisionSnInfoImportErrorModel;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.util.ConverterUtils;
import com.alibaba.excel.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.util.TextUtils;
import org.springframework.beans.BeanUtils;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @Author yeliqing
* @Version 1.0
* @Description: 碰撞线索导入客户设备信息(不支持spring)
* @Date 2023/10/11 15:34
*/
@Slf4j
public class CollisionInfoCustomerDeviceInfoImportListener extends AnalysisEventListener<CollisionSnInfoImportErrorModel> {
/**
* 校验通过的列表
*/
List<CollisionSnInfoImportErrorModel> list = new ArrayList<>();
/**
* 校验失败的列表
*/
List<CollisionSnInfoImportErrorModel> errorList = new ArrayList<>();
/**
* 需要入库的列表
*/
List<CollisionSnInfo> collisionSnInfoList = new ArrayList<>();
// 去重IMEI/SN号
Set<String> snSet = new HashSet<>();
/**
* 限制条数
*/
private Integer limit = 2000;
// 总条数
private int count = 0;
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
private SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy/MM/dd");
/**
* 表头校验
*
* @param headMap
* @param context
*/
@Override
public void invokeHead(Map<Integer, ReadCellData<?>> headMap, AnalysisContext context) {
Map<Integer, String> headerMap = ConverterUtils.convertToStringMap(headMap, context);
if (headerMap.size() < 12) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name0 = headerMap.get(0);
if (!"IMEI/SN号(必填)".equals(name0)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name1 = headerMap.get(1);
if (!"客户姓名(必填)".equals(name1)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name2 = headerMap.get(2);
if (!"性别".equals(name2)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name3 = headerMap.get(3);
if (!"客户手机号(必填)".equals(name3)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name4 = headerMap.get(4);
if (!"车牌号".equals(name4)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name5 = headerMap.get(5);
if (!"车架号(必填)".equals(name5)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name6 = headerMap.get(6);
if (!"是否更换设备".equals(name6)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name7 = headerMap.get(7);
if (!"设备安装时车辆里程(KM)".equals(name7)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name8 = headerMap.get(8);
if (!"下次保养时间".equals(name8)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name9 = headerMap.get(9);
if (!"下次保养里程(KM)".equals(name9)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name10 = headerMap.get(10);
if (!"上次保养时间".equals(name10)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
String name11 = headerMap.get(11);
if (!"上次保养里程(KM)".equals(name11)) {
throw new RpcServiceException(ClueExceptionEnum.IMPORT_FILE_HEAD_ERR);
}
super.invokeHead(headMap, context);
}
//数据解析
@Override
public void invoke(CollisionSnInfoImportErrorModel collisionSnInfoImportErrorModel, AnalysisContext analysisContext) {
if (checkCollisionSnInfoImportErrorModelIsNull(collisionSnInfoImportErrorModel)) return;
count++;
if (count > limit) {
throw new RpcServiceException("单次导入上限" + limit + ",请分批导入");
}
//1、字段校验、格式处理
checkFileValue(collisionSnInfoImportErrorModel);
}
/**
* 判断是否为空行
*
* @param collisionSnInfoImportErrorModel
* @return
*/
private boolean checkCollisionSnInfoImportErrorModelIsNull(CollisionSnInfoImportErrorModel collisionSnInfoImportErrorModel) {
collisionSnInfoImportErrorModel.setErrMsg(null);//清除最后一行数据
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(collisionSnInfoImportErrorModel));
Field[] fields = collisionSnInfoImportErrorModel.getClass().getDeclaredFields();
for (Field field : fields) {
String o = (String) jsonObject.get(field.getName());
if (o != null && !o.isEmpty()) {
return false;
}
}
return true;
}
//校验解析字段
private boolean checkFileValue(CollisionSnInfoImportErrorModel collisionSnInfoImportErrorModel) {
//备份
CollisionSnInfoImportErrorModel source = new CollisionSnInfoImportErrorModel();
BeanUtils.copyProperties(collisionSnInfoImportErrorModel, source);
//备用
CollisionSnInfo collisionSnInfo = new CollisionSnInfo();
String sn = trimString(collisionSnInfoImportErrorModel.getSn());
if (StringUtils.isEmpty(sn)) {
collisionSnInfoImportErrorModel.setErrMsg("【IMEI/SN号】未填写!");
return false;
} else if (!snSet.add(sn)) {
collisionSnInfoImportErrorModel.setErrMsg("【该设备号在本批次中已重复出现,以首个设备信息为主。】");
source.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg());
errorList.add(source);
return false;
} else {
collisionSnInfoImportErrorModel.setSn(sn);
collisionSnInfo.setSn(sn);
}
String customerName = trimString(collisionSnInfoImportErrorModel.getCustomerName());
if (StringUtils.isEmpty(customerName)) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【客户姓名】未填写!");
} else if (customerName.length() > 20) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【客户姓名】长度超过20位!");
} else {
collisionSnInfoImportErrorModel.setCustomerName(customerName);
collisionSnInfo.setCustomerName(customerName);
}
String customerPhone = trimString(collisionSnInfoImportErrorModel.getCustomerPhone());
if (StringUtils.isEmpty(customerPhone)) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【客户手机号】未填写!");
} else if (!isMobileNO(customerPhone)) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【客户手机号】需要填写11位数字!");
} else {
collisionSnInfoImportErrorModel.setCustomerPhone(customerPhone);
collisionSnInfo.setCustomerPhone(customerPhone);
}
String customerSex = trimString(collisionSnInfoImportErrorModel.getCustomerSex());
if (!StringUtils.isEmpty(customerSex)) {
if ("男".equals(customerSex)) {
collisionSnInfoImportErrorModel.setCustomerSex("0");
collisionSnInfo.setCustomerSex(0);
} else if ("女".equals(customerSex)) {
collisionSnInfoImportErrorModel.setCustomerSex("1");
collisionSnInfo.setCustomerSex(1);
} else {
collisionSnInfoImportErrorModel.setCustomerSex(null);
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【性别】需要填写:男或女!");
}
}
String licensePlate = trimString(collisionSnInfoImportErrorModel.getLicensePlate());
if (StringUtils.isEmpty(licensePlate)) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【车牌号】未填写!");
} else if (!isLicensePlate(licensePlate)) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【车牌号】需要填写文字+数字+字母,长度10位!");
} else {
collisionSnInfoImportErrorModel.setLicensePlate(licensePlate);
collisionSnInfo.setLicensePlate(licensePlate);
}
String standNo = trimString(collisionSnInfoImportErrorModel.getStandNo());
if (StringUtils.isEmpty(standNo)) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【车架号】未填写!");
} else if (!isStandNo(standNo)) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【车架号】需要填写数字+字母,长度17位!");
} else {
collisionSnInfoImportErrorModel.setStandNo(standNo);
collisionSnInfo.setStandNo(standNo);
}
String replaceFlag = trimString(collisionSnInfoImportErrorModel.getReplaceFlag());
if (StringUtils.isNotBlank(replaceFlag)) {
Integer code = DeviceReplaceEnum.getCodeByDisplayName(replaceFlag);
if (code == null) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【是否更换设备】支持填写“保修更换-免费”、“维修更换”、“购买”!");
} else {
collisionSnInfoImportErrorModel.setReplaceFlag(code.toString());
collisionSnInfo.setReplaceFlag(code);
}
}
String initialMileage = trimString(collisionSnInfoImportErrorModel.getInitialMileage());
String lowerTime = trimString(collisionSnInfoImportErrorModel.getLowerTime());
String lowerMileage = trimString(collisionSnInfoImportErrorModel.getLowerMileage());
String lastTime = trimString(collisionSnInfoImportErrorModel.getLastTime());
String lastMileage = trimString(collisionSnInfoImportErrorModel.getLastMileage());
// 全空
if (StringUtils.isEmpty(initialMileage)
&& StringUtils.isEmpty(lowerTime)
&& StringUtils.isEmpty(lowerMileage)
&& StringUtils.isEmpty(lastTime)
&& StringUtils.isEmpty(lastMileage)
) {
//不处理
} else if (StringUtils.isNotBlank(initialMileage)
&& StringUtils.isNotBlank(lowerTime)
&& StringUtils.isNotBlank(lowerMileage)
&& StringUtils.isNotBlank(lastTime)
&& StringUtils.isNotBlank(lastMileage)) {
//全不空
if (parseLong(initialMileage) == null) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【设备安装时车辆里程】支持正整数,不支持小数点!");
} else {
collisionSnInfo.setInitialMileage(parseLong(initialMileage));
}
Date lowerTimeDate = isDate(lowerTime);
if (lowerTimeDate == null) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【下次保养时间】支持”2020-02-12“或”2020/02/12“");
} else {
collisionSnInfo.setLowerTime(lowerTimeDate);
}
if (parseLong(lowerMileage) == null) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【下次保养里程】支持正整数,不支持小数点!");
} else {
collisionSnInfo.setLowerMileage(parseLong(lowerMileage));
}
Date lastTimeDate = isDate(lastTime);
if (lastTimeDate == null) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【上次保养时间】支持”2020-02-12“或”2020/02/12“");
} else {
collisionSnInfo.setLastTime(lastTimeDate);
}
if (parseLong(lastMileage) == null) {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【上次保养里程】支持正整数,不支持小数点!");
} else {
collisionSnInfo.setLastMileage(parseLong(lastMileage));
}
} else {
collisionSnInfoImportErrorModel.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg() + "【里程和时间项】填写不规范!");
}
if (StringUtils.isNotBlank(collisionSnInfoImportErrorModel.getErrMsg())) {
String replace = collisionSnInfoImportErrorModel.getErrMsg().replace("null", "");
collisionSnInfoImportErrorModel.setErrMsg(replace);
source.setErrMsg(collisionSnInfoImportErrorModel.getErrMsg());
errorList.add(source);
return false;
} else {
list.add(source);
collisionSnInfoList.add(collisionSnInfo);
return true;
}
}
/**
* 去除前后空格
*
* @param str
* @return
*/
private String trimString(String str) {
if (str == null) return null;
return str.trim();
}
//数据读取之后
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
public CollisionInfoCustomerDeviceInfoImportListener(Integer limit) {
this.limit = limit;
}
public List<CollisionSnInfoImportErrorModel> getList() {
return list;
}
public List<CollisionSnInfoImportErrorModel> getErrorList() {
return errorList;
}
public List<CollisionSnInfo> getCollisionSnInfoList() {
return collisionSnInfoList;
}
public int getCount() {
return count;
}
public void subCount() {
this.count--;
}
/**
* 判断手机号
*
* @param mobiles
* @return
*/
private boolean isMobileNO(String mobiles) {
if (TextUtils.isEmpty(mobiles)) {
return false;
} else {
String telRegex = "[1]\\d{10}";
return mobiles.matches(telRegex);
}
}
/**
* 校验车牌
*
* @param str
* @return
*/
public static boolean isLicensePlate(String str) {
if (TextUtils.isEmpty(str)) {
return false;
} else {
String telRegex = "[\\u4e00-\\u9fa50-9a-zA-Z]{7,10}";
return str.matches(telRegex);
}
}
/**
* 校验车架号
*
* @param str
* @return
*/
public static boolean isStandNo(String str) {
if (TextUtils.isEmpty(str)) {
return false;
} else {
String telRegex = "[0-9a-zA-Z]{17}";
return str.matches(telRegex);
}
}
/**
* 转换日期
*
* @return
*/
public Date isDate(String str) {
try {
return simpleDateFormat.parse(str);
} catch (ParseException e) {
try {
return simpleDateFormat1.parse(str);
} catch (ParseException ex) {
return null;
}
}
}
public Long parseLong(String str) {
try {
return Long.valueOf(str);
} catch (NumberFormatException e) {
return null;
}
}
}
package cn.com.glsx.scrm.clue.manager;
import cn.com.glsx.scrm.clue.config.AmapProperty;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.log4j.Logger;
import org.oreframework.util.http.HttpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* @author Alvin
* @version V1.0
* @Title: AmapManager.java
* @Description: 高德地图接口管理
* @date 2019年9月5日 下午3:11:02
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Slf4j
@Component
public class AmapManager {
Logger logger = Logger.getLogger(getClass());
@Autowired
private AmapProperty property;
static final String STATUSTYPE = "1";
static final String BAIDU_STATUSTYPE = "0";
static final String RESULTE_INFO = "OK";
static final String OUTPUT = "JSON";
static final String BAIDU_OUTPUT = "json";
static final String EXTENSIONS_ALL = "all";
static final String COORDTYPE = "bd09ll";
static final String FROM = "3";
static final String TO = "5";
public String getAddrFromLngLat(String lng, String lat) {
String[] strings = convertCoordinates(lng, lat);
if (strings == null || strings.length == 0) {
log.info("百度坐标转换失败");
return "";
}
Map<String, String> params = new HashMap<>(10);
params.put("location", strings[0] + "," + strings[1]);
params.put("coordtype", COORDTYPE);
params.put("ak", property.getBaiduKey());
params.put("output", BAIDU_OUTPUT);
params.put("extensions_poi", "1");
String response = null;
try {
response = HttpUtil.post(property.getBaiduGeocodeUrl(), params);
} catch (IOException e) {
log.error("通过经纬度获取详细地址异常:" + e.getMessage() + e);
}
if (response == null) {
log.info("返回地址为空");
return "";
}
log.info("通过经纬度获取详细地址:" + response);
JSONObject json = JSONObject.fromObject(response);
String status = json.getString("status");
log.info("解析地址的状态为:" + status);
String address = null;
if (BAIDU_STATUSTYPE.equals(status)) {
try {
JSONObject result = JSONObject.fromObject(json.get("result"));
address = result.getString("formatted_address_poi");
} catch (Exception e) {
log.info("解析地址数据异常:{}", json);
return null;
}
}
log.info("原始坐标:{},百度坐标:{},address:{}", lng + "," + lat, strings[0] + "," + strings[1], address);
return address;
}
public String[] convertCoordinates(String lat, String lng) {
Map<String, String> params = new HashMap<>(10);
params.put("coords", lng + "," + lat);
params.put("ak", property.getBaiduKey());
params.put("from", FROM);
params.put("to", TO);
String response = null;
try {
response = HttpUtil.post(property.getGeoconvUrl(), params);
} catch (IOException e) {
log.error("百度坐标转换异常:" + e.getMessage() + e);
}
if (response == null) {
log.info("百度坐标返回为空");
return null;
}
JSONObject json = JSONObject.fromObject(response);
String status = json.getString("status");
log.info("解析百度坐标的状态为:" + status);
String[] coordinates = new String[2];
if (BAIDU_STATUSTYPE.equals(status)) {
try {
JSONObject result = json.getJSONArray("result").getJSONObject(0);
coordinates[0] = result.getString("x");
coordinates[1] = result.getString("y");
} catch (Exception e) {
log.info("百度坐标数据异常:{}", json);
return null;
}
}
return coordinates;
}
/**
* @param lng:经度,lat:纬度
* @return 地址
* @description 根据经纬度查地址
* @author leiyj
* @date 2019年1月14日
*/
public String getAddrFromLngLatFromGaode(String lng, String lat) {
Map<String, String> params = new HashMap<String, String>(10);
params.put("location", lng + "," + lat);
params.put("output", OUTPUT);
params.put("key", property.getKey());
params.put("extensions", EXTENSIONS_ALL);
String result = null;
try {
result = HttpUtil.post(property.getGeocodeUrl(), params);
} catch (IOException e) {
logger.error("通过经纬度获取详细地址异常:" + e.getMessage() + e);
}
if (result == null) {
logger.info("返回地址为空");
return "";
}
JSONObject json = JSONObject.fromObject(result);
String status = json.getString("status");
logger.info("解析地址的状态为:" + status);
String address = null;
if (STATUSTYPE.equals(status)) {
JSONObject regeocode = JSONObject.fromObject(json.get("regeocode"));
address = regeocode.getString("formatted_address");
}
return address;
}
/**
* @param origins:起点经纬度,destination:终点经纬度
* @return 地址
* @description 根据起点和终点经纬度查询距离
* @author leiyj
* @date 2019年1月14日
*/
public Double getDistance(String origins, String destination) {
Map<String, String> params = new HashMap<String, String>(10);
params.put("origins", origins);
params.put("destination", destination);
params.put("output", OUTPUT);
params.put("key", property.getKey());
params.put("type", "0");
String result = null;
try {
result = HttpUtil.post(property.getDistanceUrl(), params);
} catch (IOException e) {
logger.error("经纬度计算距离异常:" + e.getMessage() + e);
}
if (result == null) {
logger.info("返回计算距离为空");
return 0D;
}
Double distance = 0D;
logger.info(result);
JSONObject json = JSONObject.fromObject(result);
String status = json.getString("status");
String info = json.getString("info");
// logger.info("据起点和终点经纬度查询返回状态:" + status);
if (STATUSTYPE.equals(status)) {
JSONArray results = JSONArray.fromObject(json.get("results"));
String r = results.getString(0);
JSONObject json1 = JSONObject.fromObject(r);
distance = Double.parseDouble(json1.getString("distance"));
logger.info("俩地相隔的距离:" + distance + "米");
}
return distance / 1000;
}
}
package cn.com.glsx.scrm.clue.manager;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.DateUtils;
import cn.com.glsx.scrm.clue.model.collision.GopBaseResponse;
import cn.com.glsx.scrm.clue.model.collision.GpsRecordsResponse;
import cn.com.glsx.scrm.clue.util.GopUtils;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.http.Consts;
import org.oreframework.util.http.HttpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import java.net.URLEncoder;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
/**
* gps 定位服务
*/
@Slf4j
@Component
public class GpsManager {
@Autowired
private Environment environment;
private final static String APPKEY = "48e5e13229b82c1b4e6e8c96151f0637";
private static final String VERSION = "1.0.0";
private static final String FORMAT = "json";
private static final String SECRET = "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b";
public final static String GPS_RECORDES = "glsx.accounts.biz.location.gps.records";
public List<GpsRecordsResponse> getGpsRecords(String sn, Date collisionTime) {
try {
Calendar beforeTime=Calendar.getInstance();
beforeTime.setTime(collisionTime);
beforeTime.add(Calendar.MINUTE, -3);
Calendar afterTime=Calendar.getInstance();
afterTime.setTime(collisionTime);
afterTime.add(Calendar.MINUTE, 3);
MultiValueMap<String, String> form = new LinkedMultiValueMap<String, String>();
form.add("sn", sn);
form.add("startTime", DateUtils.formatDate(beforeTime.getTime(), DateUtils.DATE_FORMAT_DATE_TIME));
form.add("endTime", DateUtils.formatDate(afterTime.getTime(), DateUtils.DATE_FORMAT_DATE_TIME));
form.add("method", GPS_RECORDES);
form.add("app_key", APPKEY);
form.add("v", VERSION);
form.add("format", FORMAT);
form.add("source", "scrm-ent");
form.add("timestamp", String.valueOf(System.currentTimeMillis()));
String sign = GopUtils.sign(form.toSingleValueMap(), SECRET);
form.add("sign", sign);
String url = environment.getProperty("gop.open.url.prefix");
url = url + gainJointGetParams(form);
log.info("请求gps服务参数[{}]", url);
String result = HttpUtil.get(url,null);
if(result != null) {
log.info("请求gps服务,返回信息[{}]", result);
result = result.replaceAll(":null", ":\"\"");
//去掉商户名称尾缀
String merchantNameAffix = environment.getProperty("replace.merchant.name.affix");
if(StringUtils.isNotBlank(merchantNameAffix)) {
String[] affixs = merchantNameAffix.split(",");
for(String affix:affixs){
String reg = "(\"merchantName\":\"([^\"]*?))" + affix + "(\")";
result = result.replaceAll(reg, "$1$3");
}
}
GopBaseResponse response = JSONObject.parseObject(result, GopBaseResponse.class);
if(response != null && response.isSuccess()) {
return response.getList(GpsRecordsResponse.class);
} else {
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "获取设备轨迹数据失败");
}
} else {
log.info("请求gps返回数据为空!");
return null;
}
} catch (Exception e) {
log.error("请求gps服务异常", e);
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
private static String gainJointGetParams (MultiValueMap<String, String> form) {
Iterator<String> iter = form.keySet().iterator();
StringBuilder param = new StringBuilder("");
while (iter.hasNext()) {
Object key = iter.next();
String val = form.get(key).toString();
val = val.substring(1, val.length() - 1);
try {
param.append(key).append("=").append(URLEncoder.encode(val, Consts.UTF_8.name())).append("&");
} catch (Exception e) {
log.info(e.getMessage(), e);
}
}
return param.substring(0, param.length() - 1);
}
}
package cn.com.glsx.scrm.clue.manager;
import cn.com.glsx.scrm.clue.model.collision.CollisionDeviceInfoModel;
import cn.com.glsx.scrm.clue.util.GopUtils;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
/**
* @Author yelq
* @Version 1.0
* @Description:
* @Date 2023/10/16 16:10
*/
@Slf4j
@Component
public class PhysicalDeviceManager {
@Autowired
private Environment environment;
public CollisionDeviceInfoModel getPhysicalDeviceBySn(String sn) {
// String SERVER_URL = "http://didicb.glsx.com.cn/router?method=glsx.accounts.biz.physical.mix"; //生产
// String SERVER_URL = "http://qcdidicb.glsx.com.cn/router?method=glsx.accounts.biz.physical.mix"; // 测试
// String SERVER_URL = "http://qcdidicb.glsx.com.cn:7060/router?method=glsx.accounts.biz.physical.mix"; // 测试
// String SERVER_URL = "http://192.168.3.102:8232/router?method=glsx.accounts.biz.physical.mix"; // 开发
String baseUrl = environment.getProperty("collision.physical.device.service", String.class);
if (StringUtils.isEmpty(baseUrl)) {
throw new RpcServiceException("配置不存在:" + "collision.physical.device.service");
}
String serverUrl = baseUrl + "?method=glsx.accounts.biz.physical.mix";
String method = "glsx.accounts.biz.physical.mix";
String appKey = "48e5e13229b82c1b4e6e8c96151f0637";
String secret = "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b";
RestTemplate restTemplate;
MultiValueMap<String, String> form;
restTemplate = new RestTemplate();
form = new LinkedMultiValueMap<String, String>();
form.add("app_key", appKey);
form.add("v", "1.0.0");
form.add("timestamp", String.valueOf(System.currentTimeMillis()));
form.add("format", "json");
form.add("source", "scrm-collection");
form.add("method", method);
form.add("sn", sn);
String sign = GopUtils.sign(form.toSingleValueMap(), secret);
form.add("sign", sign);
// ③调用服务
String response = restTemplate.postForObject(serverUrl, form, String.class);
JSONObject jsonObject = JSON.parseObject(response);
if ("0".equals(jsonObject.get("code"))) {
String data = jsonObject.getString("data");
if (!StringUtils.isEmpty(data)) {
return JSON.parseObject(data, CollisionDeviceInfoModel.class);
}
log.info("返回的数据为空!message:{}", jsonObject.get("message"));
} else if ("1110".equals(jsonObject.get("code")) && "无数据".equals(jsonObject.get("message"))) {
return null;
} else {
log.error("查询设备信息异常:{}", response);
}
return null;
}
}
package cn.com.glsx.scrm.clue.mapper;
import cn.com.glsx.scrm.clue.model.BurialPointEventInfo;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface BurialPointEventInfoMapper extends OreMapper<BurialPointEventInfo> {
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.mapper;
import cn.com.glsx.scrm.clue.dto.BurialPointSummaryDTO;
import cn.com.glsx.scrm.clue.dto.BurialPointSummaryParam;
import cn.com.glsx.scrm.clue.dto.SceneMarketBurialPointExcel;
import cn.com.glsx.scrm.clue.model.BurialPointRecord;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface BurialPointRecordMapper extends OreMapper<BurialPointRecord> {
List<BurialPointSummaryDTO> summaryBurialPointWithScene(BurialPointSummaryParam param);
List<BurialPointSummaryDTO> summaryBurialPointGroupByScene(BurialPointSummaryParam param);
List<SceneMarketBurialPointExcel> summaryBurialPointWithBusinessId(BurialPointSummaryParam param);
/**
* 查询埋点,根据时间代码,即统计通用的
* @author yangwei
* @since 2025/10/30 15:41
* @param param 查询参数
* @return java.util.List<cn.com.glsx.scrm.clue.dto.BurialPointSummaryDTO>
*/
List<BurialPointSummaryDTO> summaryBurialPoint(BurialPointSummaryParam param);
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.mapper;
import cn.com.glsx.scrm.clue.model.ClueOrderFollow;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface ClueOrderFollowMapper extends OreMapper<ClueOrderFollow> {
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.mapper;
import cn.com.glsx.scrm.clue.dto.ClueOrderDTO;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface ClueOrderMapper extends OreMapper<ClueOrder> {
List<ClueOrderDTO> list(ClueOrderDTO record);
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.mapper;
import cn.com.glsx.scrm.clue.model.ClueStaff;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface ClueStaffMapper extends OreMapper<ClueStaff> {
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.mapper;
import cn.com.glsx.scrm.clue.dto.ClueOrderDTO;
import cn.com.glsx.scrm.clue.dto.ClueVehicleDTO;
import cn.com.glsx.scrm.clue.model.ClueVehicle;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface ClueVehicleMapper extends OreMapper<ClueVehicle> {
List<ClueVehicle> getBrandList(ClueVehicle record);
List<ClueVehicle> getSubBrandList(ClueVehicle record);
List<ClueVehicleDTO> getSeriesList(ClueVehicleDTO record);
List<ClueVehicleDTO> getShapeList(ClueVehicleDTO record);
List<ClueVehicleDTO> list(ClueVehicleDTO record);
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.mapper;
import cn.com.glsx.scrm.clue.entity.collision.CollisionInfo;
import cn.com.glsx.scrm.clue.model.request.collision.CollisionInfoSearchRpcRequest;
import cn.com.glsx.scrm.clue.model.response.collision.CollisionDetailInfoRpcResponse;
import cn.com.glsx.scrm.clue.model.response.collision.CollisionInfoRpcResponse;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface CollisionInfoMapper extends OreMapper<CollisionInfo> {
/**
* 碰撞线索-列表查询
* @param requestDTO
* @return
*/
Page<CollisionInfoRpcResponse> listCollisionInfo(CollisionInfoSearchRpcRequest requestDTO);
/**
* 查询碰撞信息详情
* @param id
* @return
*/
CollisionDetailInfoRpcResponse getDetailById(@Param("id") Integer id);
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.mapper;
import cn.com.glsx.scrm.clue.entity.collision.CollisionMediaInfo;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface CollisionMediaInfoMapper extends OreMapper<CollisionMediaInfo> {
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.mapper;
import cn.com.glsx.scrm.clue.entity.collision.CollisionPushConfig;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface CollisionPushConfigMapper extends OreMapper<CollisionPushConfig> {
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.mapper;
import cn.com.glsx.scrm.clue.dto.collision.CollisionSnInfoDTO;
import cn.com.glsx.scrm.clue.entity.collision.CollisionSnInfo;
import cn.com.glsx.scrm.clue.model.request.collision.CollisionSnInfoSearchRpcRequest;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface CollisionSnInfoMapper extends OreMapper<CollisionSnInfo> {
/**
* 查询除了目标门店号外是否有其他门店已经存在sn记录
*
* @param snList 设备号
* @param merchantId 排除的门店号
* @return
*/
List<String> selectSnAndBindingInfo(@Param("snList") List<String> snList, @Param("merchantId") Integer merchantId);
/**
* 查询目标门店号是否有已经存在sn记录
*
* @param snList 设备号
* @param merchantId 目标门店
* @return
*/
List<String> selectSnBindingForMerchantId(@Param("snList") List<String> snList, @Param("merchantId") Integer merchantId);
/**
* 设备管理-列表查询
* @param requestDTO
* @return
*/
Page<CollisionSnInfoDTO> getCustomerDeviceList(CollisionSnInfoSearchRpcRequest requestDTO);
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model;
import lombok.Data;
import java.util.List;
/**
* @author zhouhaibao
* @date 2021/9/27
*/
@Data
public class RopResponse<T> {
private String code;
private Integer errId;
private String message;
private T t;
private List<T> tList;
private Object data;
}
package cn.com.glsx.scrm.clue.model.collision;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.io.Serializable;
/**
* @Author yelq
* @Version 1.0
* @Description: 查询设备信息返回
* @Date 2023/10/16 15:47
*/
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class CollisionDeviceInfoModel implements Serializable {
private String softVersion;
private String reportSn;
@ApiModelProperty(notes = "套餐编号")
private String packageId;
private String imsi;
@ApiModelProperty(notes = "广联设备编号")
private int deviceId;
private String checkCode;
private String iccid;
private String androidPackageId;
private String simPhone;
@ApiModelProperty(notes = "类型id")
private int typeId;
private long id;
@ApiModelProperty(notes = "sn")
private String sn;
@ApiModelProperty(notes = "状态 { 1:新增 2:已销售(已使用) -9:删除 }")
private int status;
}
package cn.com.glsx.scrm.clue.model.collision;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class CollisionInfoExportModel implements Serializable {
/**
* 设备号
*/
@ExcelProperty(value = "设备号")
private String sn;
/**
* 商户号
*/
@ExcelProperty(value = "商户号")
private Integer merchantId;
/**
* 商户名称
*/
@ExcelProperty(value = "商户名称")
private String merchantName;
@ExcelProperty(value = "设备类型")
private String strSnType;
/**
* 客户名称
*/
@ExcelProperty(value = "客户名称")
private String customerName;
/**
* 客户手机号
*/
@ExcelProperty(value = "客户手机号")
private String customerPhone;
/**
* 车牌号
*/
@ExcelProperty(value = "车牌号")
private String licensePlate;
/**
* 车架号
*/
@ExcelProperty(value = "车架号")
private String standNo;
@ExcelProperty(value = "车型")
private String vehicleShapeName;
/**
* 碰撞时间
*/
@ExcelProperty(value = "碰撞时间", converter = DateConverter.class)
private Date collisionTime;
/**
* 碰撞地点
*/
@ExcelProperty(value = "碰撞地点")
private String address;
@ExcelProperty(value = "回访状态")
private String strFollowStatus;
@ExcelProperty(value = "回访结果")
private String strFollowResult;
@ExcelProperty(value = "回访备注")
private String followRemark;
/**
* 回访时间
*/
@ExcelProperty(value = "回访时间", converter = DateConverter.class)
private Date followTime;
@ExcelProperty(value = "回访人员")
private String updatedBy;
}
package cn.com.glsx.scrm.clue.model.collision;
import cn.com.glsx.scrm.clue.enums.collision.DeviceReplaceEnum;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*;
import java.io.Serializable;
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
@Builder
public class CollisionSnInfoImportErrorModel implements Serializable {
/**
* 设备号
*/
@ExcelProperty(value = "IMEI/SN号(必填)")
private String sn;
/**
* 客户名称
*/
@ExcelProperty(value = "客户姓名(必填)")
private String customerName;
/**
* 客户性别,0-男,1-女
*/
@ExcelProperty(value = "性别")
private String customerSex;
/**
* 客户手机号
*/
@ExcelProperty(value = "客户手机号(必填)")
private String customerPhone;
/**
* 车牌号
*/
@ExcelProperty(value = "车牌号")
private String licensePlate;
/**
* 车架号
*/
@ExcelProperty(value = "车架号(必填)")
private String standNo;
/**
* 是否更换设备,0-保修更换-免费,1-维修更换,2-购买
* @see DeviceReplaceEnum
*/
@ExcelProperty(value = "是否更换设备")
private String replaceFlag;
/**
* 设备安装时的初始里程
*/
@ExcelProperty(value = "设备安装时车辆里程(KM)")
private String initialMileage;
/**
* 下次保养时间
*/
@ExcelProperty(value = "下次保养时间")
private String lowerTime;
/**
* 下次保养里程
*/
@ExcelProperty(value = "下次保养里程(KM)")
private String lowerMileage;
/**
* 上次保养时间
*/
@ExcelProperty(value = "上次保养时间")
private String lastTime;
/**
* 上次保养里程
*/
@ExcelProperty(value = "上次保养里程(KM)")
private String lastMileage;
/**
* 错误提示
*/
@ExcelProperty(value = "错误提示")
private String errMsg;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model.collision;
import cn.com.glsx.scrm.clue.enums.collision.DeviceTypeEnum;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*;
import java.io.Serializable;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
@Builder
public class CollisionSnInfoImportModel implements Serializable {
/**
* 设备号
*/
@ExcelProperty(value = "姓名")
private String sn;
/**
* 批次id
*/
@ExcelProperty(value = "姓名")
private Integer batchId;
/**
* 商户号
*/
@ExcelProperty(value = "姓名")
private Integer merchantId;
/**
* 商户名称
*/
@ExcelProperty(value = "姓名")
private String merchantName;
/**
* 设备类型
* @see DeviceTypeEnum
*/
@ExcelProperty(value = "姓名")
private Integer snType;
/**
* iccid
*/
@ExcelProperty(value = "姓名")
private String iccid;
/**
* 客户名称
*/
@ExcelProperty(value = "姓名")
private String customerName;
/**
* 客户手机号
*/
@ExcelProperty(value = "姓名")
private String customerPhone;
/**
* 客户性别,0-男,1-女
*/
@ExcelProperty(value = "姓名")
private Integer customerSex;
/**
* 车牌号
*/
@ExcelProperty(value = "姓名")
private String licensePlate;
/**
* 车架号
*/
@ExcelProperty(value = "姓名")
private String standNo;
/**
* 设备安装时的初始里程
*/
@ExcelProperty(value = "姓名")
private Long initialMileage;
/**
* 上次保养里程
*/
@ExcelProperty(value = "姓名")
private Long lastMileage;
/**
* 上次保养时间
*/
@ExcelProperty(value = "姓名")
private Date lastTime;
/**
* 下次保养里程
*/
@ExcelProperty(value = "姓名")
private Long lowerMileage;
/**
* 下次保养时间
*/
@ExcelProperty(value = "姓名")
private Date lowerTime;
/**
* 是否更换设备,0-保修更换-免费,1-维修更换,2-购买
*/
@ExcelProperty(value = "姓名")
private Integer replaceFlag;
/**
* 汽车品牌ID
*/
@ExcelProperty(value = "姓名")
private Integer vehicleBrandId;
/**
* 汽车品牌
*/
@ExcelProperty(value = "姓名")
private String vehicleBrandName;
/**
* 子品牌ID
*/
@ExcelProperty(value = "姓名")
private Integer vehicleSubBrandId;
/**
* 子品牌名称
*/
@ExcelProperty(value = "姓名")
private String vehicleSubBrandName;
/**
* 车系ID
*/
@ExcelProperty(value = "姓名")
private Integer vehicleSeriesId;
/**
* 车系名称
*/
@ExcelProperty(value = "姓名")
private String vehicleSeriesName;
/**
* 车型ID
*/
@ExcelProperty(value = "姓名")
private Integer vehicleShapeId;
/**
* 车型名称
*/
@ExcelProperty(value = "姓名")
private String vehicleShapeName;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.model.collision;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @Description excel导出日期转换
* @author chizw
* @create 2023/2/21 16:09
* @version ver.1.0.0
*/
public class DateConverter implements Converter<Date> {
private static final String PATTERN_YYYY_MM_DD = "yyyy-MM-dd hh:mm:hh";
@Override
public Class<?> supportJavaTypeKey() {
return Converter.super.supportJavaTypeKey();
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return Converter.super.supportExcelTypeKey();
}
@Override
public WriteCellData<?> convertToExcelData(Date value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat(PATTERN_YYYY_MM_DD);
String dateValue = sdf.format(value);
return new WriteCellData<>(dateValue);
}
}
package cn.com.glsx.scrm.clue.model.collision;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.List;
/**
*
* @Title: GopBaseResponse.java
* @Description:
* @author zhoulm
* @date 2019年6月6日 上午11:24:25
* @version V1.0
* @Company: glsx.com.cn
* @Copyright Copyright (c) 2019
*/
public class GopBaseResponse implements Serializable{
/**
*
*/
private static final long serialVersionUID = -7540670832064596483L;
private static final String SUCCESS_CODE = "0";
private final String MESSAAGE_FORMAT = "{0}-{1}";
private String code;
private String message;
private String data;
public boolean isSuccess(){
if(null != code && SUCCESS_CODE.equals(code)){
return true;
}
return false;
}
public RpcServiceException getException(){
return new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR,MessageFormat.format(MESSAAGE_FORMAT, code,message));
}
public <T> T getProperties(Class<T> clazz,String key){
if(this.isSuccess()){
JSONObject json = JSONObject.parseObject(this.getData());
return json.getObject(key, clazz);
}
throw getException();
}
public <T> T getBean(Class<T> clazz){
if(this.isSuccess()){
return JSONObject.parseObject(this.getData(),clazz);
}
throw getException();
}
public <T> List<T> getList(Class<T> clazz){
return getList(clazz, null);
}
public <T> List<T> getList(Class<T> clazz,String key){
if(this.isSuccess()){
if(key == null){
return JSONArray.parseArray(this.getData(), clazz);
}else{
JSONObject obj = JSONObject.parseObject(this.getData());
return JSONArray.parseArray(obj.getString(key),clazz);
}
}
throw getException();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
@Override
public String toString() {
return "GopBaseResponse [code=" + code + ", message=" + message + ", data=" + data + "]";
}
}
package cn.com.glsx.scrm.clue.model.collision;
import java.io.Serializable;
/**
* gps 设备轨迹返回类
*/
public class GpsRecordsResponse implements Serializable{
private static final long serialVersionUID = -7962812934494385608L;
private String gpsTime;// 终端gps时间
private String lng;// 经度
private String lat;// 纬度
private String alt;// 高度(米)
private String speed;// 速度
private String dir;// 方向(度º)
private String gLng;// 谷歌经度
private String gLat;// 谷歌纬度
private String bLng;// 百度经度
private String bLat;// 百度纬度
private String storeTime;// 存储时间
// yyyy-MM-dd HH:mm:ss
private String gpsDate;
private String storeDate;
public String getGpsDate() {
return gpsDate;
}
public void setGpsDate(String gpsDate) {
this.gpsDate = gpsDate;
}
public String getStoreDate() {
return storeDate;
}
public void setStoreDate(String storeDate) {
this.storeDate = storeDate;
}
public String getGpsTime() {
return gpsTime;
}
public void setGpsTime(String gpsTime) {
this.gpsTime = gpsTime;
}
public String getLng() {
return lng;
}
public void setLng(String lng) {
this.lng = lng;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getAlt() {
return alt;
}
public void setAlt(String alt) {
this.alt = alt;
}
public String getSpeed() {
return speed;
}
public void setSpeed(String speed) {
this.speed = speed;
}
public String getDir() {
return dir;
}
public void setDir(String dir) {
this.dir = dir;
}
public String getgLng() {
return gLng;
}
public void setgLng(String gLng) {
this.gLng = gLng;
}
public String getgLat() {
return gLat;
}
public void setgLat(String gLat) {
this.gLat = gLat;
}
public String getbLng() {
return bLng;
}
public void setbLng(String bLng) {
this.bLng = bLng;
}
public String getbLat() {
return bLat;
}
public void setbLat(String bLat) {
this.bLat = bLat;
}
public String getStoreTime() {
return storeTime;
}
public void setStoreTime(String storeTime) {
this.storeTime = storeTime;
}
@Override
public String toString() {
return "GpsRecordsResponse{" +
"gpsTime='" + gpsTime + '\'' +
", lng='" + lng + '\'' +
", lat='" + lat + '\'' +
", alt='" + alt + '\'' +
", speed='" + speed + '\'' +
", dir='" + dir + '\'' +
", gLng='" + gLng + '\'' +
", gLat='" + gLat + '\'' +
", bLng='" + bLng + '\'' +
", bLat='" + bLat + '\'' +
", storeTime='" + storeTime + '\'' +
", gpsDate='" + gpsDate + '\'' +
", storeDate='" + storeDate + '\'' +
'}';
}
}
package cn.com.glsx.scrm.clue.model.merchant;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 商户门店
*/
@Data
public class MerchantRopResponse implements Serializable {
/**
* 商户名称
*/
private String merchantName;
/**
* 商户号
*/
private Integer merchantNo;
/**
* 商户模式
*/
private Integer merchantModel;
/**
* 渠道id
*/
private Integer channelId;
/**
* 企微号
*/
private String entmicroName;
/**
* 企微号
*/
private Date createdTime;
/**
* 手机号
*/
private String merchantLegalPersonPhone;
/**
* 业务类型id
*/
private String businessTypeId;
/**
* 业务类型名称
*/
private String businessTypeName;
/**
* 商户地址
*/
private String merchantAddress;
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.scrm.clue.dto.BurialPointRecordDTO;
import cn.com.glsx.scrm.clue.service.BurialPointRecordService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@DubboService(validation = "true", version = "1.0.0", protocol = "dubbo")
public class BurialPointRecordRemoteImpl implements BurialPointRecordRemote {
@Autowired
private BurialPointRecordService burialPointRecordService;
@Override
public RpcResponse<Boolean> batchInsert(List<BurialPointRecordDTO> list) {
try {
return RpcResponse.success(burialPointRecordService.batchInsert(list));
} catch (RpcServiceException e) {
log.info(e.getMessage(), e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("批量上报埋点系统异常:", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
}
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.scrm.clue.dto.ClueOrderDTO;
import cn.com.glsx.scrm.clue.enums.ClueFollowTypeEnum;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import cn.com.glsx.scrm.clue.model.ClueOrderFollow;
import cn.com.glsx.scrm.clue.service.ClueOrderFollowService;
import cn.com.glsx.scrm.clue.service.ClueOrderService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import javax.validation.constraints.NotNull;
import java.util.List;
@Slf4j
@DubboService(validation = "true")
public class ClueFollowRemoteImpl implements ClueFollowRemote {
@Autowired
private ClueOrderFollowService clueOrderFollowService;
@Override
public RpcResponse<ClueOrderFollow> insertOrUpdate(ClueOrderFollow info) {
try{
return RpcResponse.success(clueOrderFollowService.insertOrUpdate(info));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<ClueOrderFollow>> listWithOrderId(Integer orderId) {
try{
return RpcResponse.success(clueOrderFollowService.listWithOrderId(orderId));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.scrm.clue.dto.ClueOrderDTO;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import cn.com.glsx.scrm.clue.service.ClueOrderService;
import com.github.pagehelper.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import javax.validation.constraints.NotNull;
@Slf4j
@DubboService(validation = "true")
public class ClueOrderRemoteImpl implements ClueOrderRemote {
@Autowired
private ClueOrderService clueOrderService;
@Override
public RpcResponse<ClueOrder> insertAndDeal(@NotNull ClueOrderDTO record) {
try{
return RpcResponse.success(clueOrderService.insertAndDeal(record));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<RpcPagination<ClueOrderDTO>> listWithPage(RpcPagination<ClueOrderDTO> pagination) {
try{
return RpcResponse.success(clueOrderService.listWithPage(pagination));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<ClueOrder> getById(Integer id) {
try{
return RpcResponse.success(clueOrderService.getById(id));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<ClueOrderDTO> getDetailById(Integer id) {
try{
return RpcResponse.success(clueOrderService.getDetailById(id));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<ClueOrderDTO> updateTaskStatus(Integer id) {
try{
return RpcResponse.success(clueOrderService.updateTaskStatus(id));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.scrm.clue.model.ClueStaff;
import cn.com.glsx.scrm.clue.service.ClueStaffService;
import com.github.pagehelper.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@DubboService(validation = "true")
public class ClueStaffRemoteImpl implements ClueStaffRemote {
@Autowired
private ClueStaffService clueStaffService;
@Override
public RpcResponse<Boolean> insertOrUpdateBatch(List<ClueStaff> staffList) {
try{
return RpcResponse.success(clueStaffService.insertOrUpdateBatch(staffList));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Page<ClueStaff>> listWithPage(RpcPagination<ClueStaff> pagination) {
try{
return RpcResponse.success(clueStaffService.listWithPage(pagination));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.scrm.clue.remote;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.scrm.clue.dto.ClueOrderDTO;
import cn.com.glsx.scrm.clue.dto.ClueVehicleDTO;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import cn.com.glsx.scrm.clue.model.ClueVehicle;
import cn.com.glsx.scrm.clue.service.ClueOrderService;
import cn.com.glsx.scrm.clue.service.ClueVehicleService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import javax.validation.constraints.NotNull;
@Slf4j
@DubboService(validation = "true")
public class ClueVehicleRemoteImpl implements ClueVehicleRemote {
@Autowired
private ClueVehicleService clueVehicleService;
@Override
public RpcResponse<RpcPagination<ClueVehicle>> getMerchantBrandList(RpcPagination<ClueVehicle> pagination) {
try{
return RpcResponse.success(clueVehicleService.getMerchantBrandList(pagination));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<RpcPagination<ClueVehicle>> getMerchantSubBrandList(RpcPagination<ClueVehicle> pagination) {
try{
return RpcResponse.success(clueVehicleService.getMerchantSubBrandList(pagination));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<RpcPagination<ClueVehicleDTO>> getMerchantSeriesList(RpcPagination<ClueVehicleDTO> pagination) {
try{
return RpcResponse.success(clueVehicleService.getMerchantSeriesList(pagination));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<RpcPagination<ClueVehicleDTO>> getMerchantShapeList(RpcPagination<ClueVehicleDTO> pagination) {
try{
return RpcResponse.success(clueVehicleService.getMerchantShapeList(pagination));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Integer> updateStatus(ClueVehicle info) {
try{
return RpcResponse.success(clueVehicleService.updateStatus(info));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<RpcPagination<ClueVehicleDTO>> listWithPage(RpcPagination<ClueVehicleDTO> pagination) {
try{
return RpcResponse.success(clueVehicleService.listWithPage(pagination));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<ClueVehicle> insertOrUpdate(ClueVehicle info) {
try{
return RpcResponse.success(clueVehicleService.insertOrUpdate(info));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> delete(ClueVehicle info) {
try{
return RpcResponse.success(clueVehicleService.delete(info));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<ClueVehicle> getById(Integer id) {
try{
return RpcResponse.success(clueVehicleService.getById(id));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.scrm.clue.remote.collision;
import cn.com.glsx.scrm.clue.dto.collision.CollisionSnInfoDTO;
import cn.com.glsx.scrm.clue.model.response.collision.*;
import cn.com.glsx.scrm.clue.model.request.collision.*;
import cn.com.glsx.scrm.clue.remote.CollisionInfoRemote;
import cn.com.glsx.scrm.clue.service.collision.CollisionInfoService;
import cn.com.glsx.scrm.clue.service.collision.CollisionPushConfigService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.alibaba.dubbo.config.annotation.Service;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j
@Component
@Service(version = "1.0.0", protocol = "dubbo", timeout = 10000)
public class CollisionInfoRemoteImpl implements CollisionInfoRemote {
@Autowired
private CollisionInfoService collisionInfoService;
@Autowired
private CollisionPushConfigService collisionPushConfigService;
/**
* 客户设备信息导入
* @param requestDTO
* @return
*/
@Override
public RpcResponse<CustomerDeviceImportRpcResponse> customerDeviceImportRemote(CustomerDeviceImportRpcRequest requestDTO) {
try {
CustomerDeviceImportRpcResponse response = collisionInfoService.customerDeviceImport(requestDTO);
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("客户设备信息导入异常:", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
/**
* 碰撞线索-分页查询
* @param requestDTO
* @return
*/
@Override
public RpcResponse<RpcPagination<CollisionInfoRpcResponse>> listCollisionInfoByPage(CollisionInfoSearchRpcRequest requestDTO) {
try {
Page<CollisionInfoRpcResponse> responses = collisionInfoService.listCollisionInfoByPage(requestDTO);
return RpcResponse.success(RpcPagination.copyPage(responses));
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("碰撞线索-分页查询异常:{}", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
/**
* 碰撞线索-导出
* @param requestDTO
* @return
*/
@Override
public RpcResponse<String> exportCollisionInfo(CollisionInfoSearchRpcRequest requestDTO) {
try {
String response = collisionInfoService.exportCollisionInfo(requestDTO);
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("碰撞线索-导出异常:{}", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
@Override
public RpcResponse<CollisionDetailInfoRpcResponse> getCollisionDetail(CollisionInfoSearchRpcRequest requestDTO) {
try {
CollisionDetailInfoRpcResponse response = collisionInfoService.getDetailById(requestDTO.getId());
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("碰撞线索-查询详情异常:{}", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
/**
* 碰撞线索-门店回访
* @param requestDTO
* @return
*/
@Override
public RpcResponse<FollowInfoRpcResponse> followCollisionInfoByMerchant(FollowInfoRpcRequest requestDTO) {
try {
FollowInfoRpcResponse response = collisionInfoService.followCollisionInfoByMerchant(requestDTO);
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("碰撞线索-门店回访异常:{}", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
/**
* 碰撞线索-员工回访
* @param requestDTO
* @return
*/
@Override
public RpcResponse<FollowInfoRpcResponse> followCollisionInfoByStaff(FollowInfoRpcRequest requestDTO) {
try {
FollowInfoRpcResponse response = collisionInfoService.followCollisionInfoByStaff(requestDTO);
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("碰撞线索-员工回访异常:{}", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
/**
* 碰撞线索-推送配置新增/修改
* @param requestDTO
* @return
*/
@Override
public RpcResponse<CollisionPushConfigRpcResponse> addOrUpdatePushConfig(CollisionPushConfigRpcRequest requestDTO) {
try {
CollisionPushConfigRpcResponse response = collisionPushConfigService.addOrUpdatePushConfig(requestDTO);
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("碰撞线索-推送配置新增/修改异常:{}", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
/**
* 碰撞线索-查询推送配置详情
* @param requestDTO
* @return
*/
@Override
public RpcResponse<List<CollisionPushConfigRpcResponse>> getPushConfigDetail(CollisionPushConfigRpcRequest requestDTO) {
try {
log.info("碰撞线索-查询推送配置详情:{}", JSON.toJSONString(requestDTO));
List<CollisionPushConfigRpcResponse> response = collisionPushConfigService.getPushConfigByMerchantId(requestDTO.getMerchantId());
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("碰撞线索-查询推送配置详情异常:{}", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
/**
* 设备管理-客户设备信息详情查询
* @param requestDTO
* @return
*/
@Override
public RpcResponse<CollisionSnInfoDTO> getCustomerDeviceDetailRemote(CollisionSnInfoSearchRpcRequest requestDTO) {
try {
CollisionSnInfoDTO response = collisionInfoService.getCustomerDeviceDetail(requestDTO);
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("设备管理-客户设备信息详情查询异常:", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
/**
* 设备管理-编辑
* @param requestDTO
* @return
*/
@Override
public RpcResponse<Boolean> customerDeviceEditRemote(CollisionSnInfoEditRpcRequest requestDTO) {
try {
Boolean response = collisionInfoService.customerDeviceEdit(requestDTO);
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("设备管理-编辑异常:", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
/**
* 设备管理-列表查询
* @param requestDTO
* @return
*/
@Override
public RpcResponse<RpcPagination<CollisionSnInfoDTO>> getCustomerDeviceListRemote(RpcPagination<CollisionSnInfoSearchRpcRequest> requestDTO) {
try {
log.info("设备管理-列表查询参数:{}", JSON.toJSONString(requestDTO));
RpcPagination<CollisionSnInfoDTO> response = collisionInfoService.getCustomerDeviceList(requestDTO);
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("设备管理-编辑异常:", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
/**
* 设备管理-列表查询导出
* @param requestDTO
* @return
*/
@Override
public RpcResponse<String> exportCustomerDeviceListRemote(RpcPagination<CollisionSnInfoSearchRpcRequest> requestDTO) {
try {
log.info("设备管理-列表查询导出:{}", JSON.toJSONString(requestDTO));
String response = collisionInfoService.exportCustomerDeviceList(requestDTO);
return RpcResponse.success(response);
} catch (RpcServiceException e) {
log.info(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.info("设备管理-编辑异常:", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
}
}
package cn.com.glsx.scrm.clue.service;
import cn.com.glsx.scrm.clue.config.BurialPointSummaryConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Method;
/**
* @author yangwei
* @version 1.0
* @since 2025/10/17 14:15
*/
@Slf4j
@Service
public class BurialPointHandler {
public static void invoke(String method) {
try {
Class<?> clazz = BurialPointHandler.class;
Object instance = clazz.getDeclaredConstructor().newInstance();
Method privateMethod = clazz.getDeclaredMethod(method);
privateMethod.setAccessible(true);
privateMethod.invoke(instance);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
package cn.com.glsx.scrm.clue.service;
import cn.com.glsx.dj.smartcarlife.remote.SceneMarketRemote;
import cn.com.glsx.dj.smartcarlife.response.MaterialInfoResponse;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.scrm.clue.config.BurialPointDetail;
import cn.com.glsx.scrm.clue.config.BurialPointSummaryConfig;
import cn.com.glsx.scrm.clue.constants.BurialPointConstants;
import cn.com.glsx.scrm.clue.dto.BurialPointRecordDTO;
import cn.com.glsx.scrm.clue.dto.BurialPointSummaryDTO;
import cn.com.glsx.scrm.clue.dto.BurialPointSummaryParam;
import cn.com.glsx.scrm.clue.dto.SceneMarketBurialPointExcel;
import cn.com.glsx.scrm.clue.enums.BurialPointEventTypeEnum;
import cn.com.glsx.scrm.clue.dto.*;
import cn.com.glsx.scrm.clue.enums.*;
import cn.com.glsx.scrm.clue.mapper.BurialPointEventInfoMapper;
import cn.com.glsx.scrm.clue.mapper.BurialPointRecordMapper;
import cn.com.glsx.scrm.clue.model.BurialPointEventInfo;
import cn.com.glsx.scrm.clue.model.BurialPointRecord;
import cn.com.glsx.scrm.clue.util.ExcelExportUtils;
import cn.com.glsx.scrm.clue.util.LocalDateUtils;
import cn.com.glsx.scrm.equity.enums.DeleteFlagEnum;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.oreframework.boot.autoconfigure.alioss.entity.AliOssUploadClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
public class BurialPointRecordService {
@Autowired
private BurialPointRecordMapper burialPointRecordMapper;
@Autowired
private SceneMarketRemote sceneMarketRemote;
@Autowired
private Environment environment;
@Autowired
private BurialPointEventInfoMapper burialPointEventInfoMapper;
@Autowired
private AliOssUploadClient aliOssUploadClient;
@Resource
private BurialPointSummaryConfig burialPointSummaryConfig;
/**
* 批量插入埋点记录
* @param list
* @return
*/
public Boolean batchInsert(List<BurialPointRecordDTO> list) {
Date createTime = new Date();
List<BurialPointRecord> insertList = new ArrayList<>();
for (BurialPointRecordDTO x : list) {
//浏览事件,必须传批次id
if(BurialPointEventTypeEnum.BROWSE.getValue().equals(x.getEventType())) {
RpcAssert.assertNotEmpty(x.getBatchId(), DefaultErrorEnum.PARAMETER_NULL, "浏览事件必须传批次id");
RpcAssert.assertNotEmpty(x.getPrePagePath(), DefaultErrorEnum.PARAMETER_NULL, "浏览事件必须传上一级页面路径");
}
BurialPointRecord record = new BurialPointRecord();
BeanUtils.copyProperties(x, record);
record.setCreatedTime(createTime);
record.setDeletedFlag(DeleteFlagEnum.N.getValue());
insertList.add(record);
}
burialPointRecordMapper.insertList(insertList);
return true;
}
public void summaryBurialPointWithScene(BurialPointSummaryParam param) {
//1.统计展业助手-首页整体指标
List<String> eventCodeList = Lists.newArrayList("app_reception_begins", "app_personal_center", "app_scene_change", "app_product_Introduction", "app_service_center",
"app_study_center", "app_scene_market", "app_reception_defeat", "app_reception_deal", "app_reception_center","app_activity_tabChange","app_activeity_center");
// 在原基础上新增
List<String> appendCodes = Optional.ofNullable(burialPointSummaryConfig.getBurialPointDetails())
.orElseGet(ArrayList::new)
.stream()
.filter(item -> Objects.equals(BurialPointConstants.SYSTEM_ID_PAD, item.getId()))
.flatMap(item -> item.getEventCodes().stream())
.collect(Collectors.toList());
eventCodeList.addAll(appendCodes);
param.setCodeList(eventCodeList);
List<BurialPointSummaryDTO> summaryList = burialPointRecordMapper.summaryBurialPointWithScene(param);
if (CollectionUtils.isNotEmpty(summaryList)) {
//查询app 累计复盘
eventCodeList = Arrays.asList("app_reception_defeat", "app_reception_deal");
param.setCodeList(eventCodeList);
List<BurialPointSummaryDTO> receptionSummaryList = burialPointRecordMapper.summaryBurialPointGroupByScene(param);
if (CollectionUtils.isNotEmpty(receptionSummaryList)) {
receptionSummaryList.stream().forEach(x -> x.setEventCode("app_reception_total"));
summaryList.addAll(receptionSummaryList);
}
//查询事件名称
List<String> codeList = summaryList.stream().map(BurialPointSummaryDTO::getEventCode).collect(Collectors.toList());
Map<String, String> eventCodeMap = getEventCodeMap(codeList);
//开始导出表格数据
summaryList.stream().forEach(x -> {
if (Objects.equals(1, x.getScene())) {
x.setSceneName("轻改升级");
} else {
x.setSceneName("权益升级");
}
if (eventCodeMap.containsKey(x.getEventCode())) {
x.setEventName(eventCodeMap.get(x.getEventCode()));
} else {
x.setEventName(x.getEventCode());
}
});
//排序
summaryList.sort(Comparator.comparing(BurialPointSummaryDTO::getScene).thenComparing(BurialPointSummaryDTO::getEventCode));
String fileName = "展业助手埋点数据";
//导出excel
exportBurialPointRecord(fileName, summaryList, BurialPointSummaryDTO.class);
} else {
log.info("日期范围[{}]~[{}]未查询到展业助手埋点数据", param.getStartTime(), param.getEndTime());
}
}
public void summaryBurialPointWithBusinessId(BurialPointSummaryParam param, String startTime, String endTime) {
param.setCodeList(Collections.singletonList("scene_market"));
List<SceneMarketBurialPointExcel> sceneMarketList = burialPointRecordMapper.summaryBurialPointWithBusinessId(param);
if (CollectionUtils.isNotEmpty(sceneMarketList)) {
//查询场景集市业务信息
List<Integer> idList = sceneMarketList.stream().map(x -> Integer.valueOf(x.getBusinessId())).collect(Collectors.toList());
RpcResponse<List<MaterialInfoResponse>> sceneMarketListRes = sceneMarketRemote.listSceneMarketLevelInfo(idList);
List<MaterialInfoResponse> sceneInfoList = sceneMarketListRes.getResult();
if (CollectionUtils.isNotEmpty(sceneInfoList)) {
//匹配业务信息
Map<Integer, MaterialInfoResponse> sceneMap = sceneInfoList.stream().collect(Collectors.toMap(MaterialInfoResponse::getId, x -> x, (x, y) -> x));
sceneMarketList.stream().forEach(x -> {
if (Objects.equals(1, x.getScene())) {
x.setSceneName("轻改升级");
} else {
x.setSceneName("权益升级");
}
MaterialInfoResponse sceneInfo = sceneMap.get(Integer.valueOf(x.getBusinessId()));
if (sceneInfo != null) {
x.setTitle(sceneInfo.getTitle());
x.setLevelOneName(sceneInfo.getMainSceneMarketName());
x.setLevelTwoName(sceneInfo.getSceneMarketName());
}
});
} else {
log.info("根据素材id列表[{}]查询场景集市列表数据为空!", JSON.toJSONString(idList));
}
//查询智能体对话轮次
Map<String, Integer> dialogueCountMap = getDialogueCount(startTime, endTime, idList);
sceneMarketList.stream().forEach(x -> {
x.setDialogueCount(dialogueCountMap.get(x.getBusinessId()));
});
//导出
String fileName = "展业助手-场景集市埋点数据";
//导出excel
exportBurialPointRecord(fileName, sceneMarketList, SceneMarketBurialPointExcel.class);
} else {
log.info("日期范围[{}]~[{}]未查询到展业助手场景集市埋点数据", startTime, endTime);
}
}
/**
* 统计埋点数据
* @param startTime
* @param endTime
*/
public void summaryBurialPointRecord(String startTime, String endTime) {
BurialPointSummaryParam param = new BurialPointSummaryParam();
param.setStartTime(startTime + " 00:00:00");
param.setEndTime(endTime + " 23:59:59");
param.setEventType(BurialPointEventTypeEnum.CLICK.getValue());
param.setSystemSource(3);
//1.统计展业助手-首页整体指标
summaryBurialPointWithScene(param);
//2.统计展业助手-场景集市埋点
summaryBurialPointWithBusinessId(param, startTime, endTime);
}
/**
* 通用统计埋点数据
* @author yangwei
* @since 2025/10/30 18:36
* @param startTime 开始时间
* @param endTime 结束时间
*/
public void commonStatisticsBurialPointRecord(String startTime, String endTime) {
List<BurialPointStatisticsGroup> needStatisticsGroup = Arrays.stream(BurialPointStatisticsGroup.values())
.filter(BurialPointStatisticsGroup::getEnable).collect(Collectors.toList());
if (CollectionUtils.isEmpty(needStatisticsGroup)) {
return;
}
Set<BurialPointEventCodeGroup> groups = needStatisticsGroup.stream().map(BurialPointStatisticsGroup::getBurialPointEventCodeGroup).collect(Collectors.toSet());
List<BurialPointEventCode> burialPointEventCodes = Arrays.stream(BurialPointEventCode.values()).filter(bpe -> bpe.getEnable()
&& groups.stream().anyMatch(group -> bpe.getBurialPointEventCodeGroups().contains(group)))
.collect(Collectors.toList());
// 遍历需要统计的分组枚举
for (BurialPointStatisticsGroup burialPointStatisticsGroup : needStatisticsGroup) {
BurialPointSummaryParam param = burialPointQueryParamBuilder(burialPointStatisticsGroup, burialPointEventCodes, startTime, endTime);
if (ObjectUtil.isNull(param)) {
continue;
}
// 查询统计
List<? extends BurialPointSummaryDTO> summaryList = burialPointStatisticsGroup.fetch(param);
if (CollUtil.isEmpty(summaryList)) {
continue;
}
Map<String, String> eventCodeMap = this.getEventCodeMap(summaryList.stream().map(BurialPointSummaryDTO::getEventCode).collect(Collectors.toList()));
List<Object> excelList = burialPointStatisticsGroup.convert(summaryList, eventCodeMap);
// 导出 excel
exportBurialPointRecord(burialPointStatisticsGroup.getFileName(), excelList, burialPointStatisticsGroup.getExcelExport());
}
}
/**
* 构建统计查询参数
* @author yangwei
* @since 2025/10/30 15:24
* @param statisticsGroup 统计分组
* @param burialPointEventCodes 业务类型代码
* @param startTime 开始时间
* @param endTime 结束时间
* @return cn.com.glsx.scrm.clue.dto.BurialPointSummaryParam
*/
public BurialPointSummaryParam burialPointQueryParamBuilder(BurialPointStatisticsGroup statisticsGroup,
List<BurialPointEventCode> burialPointEventCodes,
String startTime,
String endTime) {
if (StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime)) {
startTime = calDateStr(statisticsGroup.getBurialPointStatisticsCycle(), true);
endTime = calDateStr(statisticsGroup.getBurialPointStatisticsCycle(), false);
}
if (StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime)) {
return null;
}
BurialPointSummaryParam param = new BurialPointSummaryParam();
param.setStartTime(startTime + LocalDateUtils.TIME_START);
param.setEndTime(endTime + LocalDateUtils.TIME_END);
param.setEventTypes(statisticsGroup.getBurialPointEventTypeEnums().stream().map(BurialPointEventTypeEnum::getValue).collect(Collectors.toList()));
param.setEventType(null);
param.setSystemSource(statisticsGroup.getBurialPointSystemSource().getCode());
BurialPointEventCodeGroup burialPointEventCodeGroup = statisticsGroup.getBurialPointEventCodeGroup();
List<String> eventCodes = burialPointEventCodes.stream().filter(x -> x.getBurialPointEventCodeGroups().contains(burialPointEventCodeGroup))
.map(BurialPointEventCode::getCode).collect(Collectors.toList());
if (CollectionUtils.isEmpty(eventCodes)) {
return null;
}
param.setCodeList(eventCodes);
return param;
}
/**
* 计算日期
* @author yangwei
* @since 2025/10/30 14:57
* @param statisticsCycle 统计周期
* @param start 是否是开始
* @return java.lang.String 返回统计日期
*/
public String calDateStr(BurialPointStatisticsCycle statisticsCycle, boolean start) {
String date;
LocalDate currentDate = LocalDate.now();
switch (statisticsCycle) {
case LAST_WEEK:
date = start ? LocalDateUtils.getLastWeekStartDate(currentDate) : LocalDateUtils.getLastWeekEndDate(currentDate);
break;
case LAST_MONTH:
date = start ? LocalDateUtils.getLastMonthStartDate(currentDate) : LocalDateUtils.getLastMonthEndDate(currentDate);
break;
default:
date = StringUtils.EMPTY;
}
return date;
}
public Map<String, Integer> getDialogueCount(String startTime, String endTime, List<Integer> idList) {
try {
String url = environment.getProperty("ai.agent.dialogue.count.url", "http://192.168.5.30:8008/api/getConversationById?");
String enterIds = StringUtils.join(idList, ",");
url = url + "startDate=" + startTime + "&endDate=" + endTime + "&enterIds=" + enterIds;
log.info("请求智能体对话轮次参数[{}]", url);
String result = HttpUtil.get(url);
log.info("请求智能体对话轮次结果[{}]", result);
if (StringUtils.isBlank(result)) return new HashMap<>();
Map<String, Integer> resultMap = JSON.parseObject(result, Map.class);
return resultMap;
} catch (Exception e) {
log.error("请求智能体对话轮次异常[{}]", e);
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
/**
* 导出表格数据,并发送机器人
* @param fileName
* @param list
* @param classType
*/
public void exportBurialPointRecord(String fileName, List<? extends Object> list, Class classType) {
// String fileUrl = ExcelExportUtils.excelExport(fileName + new Date().getTime(), list, classType, null);
// log.info(ExcelExportUtils.exportExcelTest(list, fileName, classType));
byte[] bytes = ExcelExportUtils.excelExportWithoutUpload(fileName + new Date().getTime(), list, classType, null);
InputStream inputStream = new ByteArrayInputStream(bytes);
String bucketName = environment.getProperty("ore.alioss.bucketName");
String fileUrl = aliOssUploadClient.uploadFileSimple4InputStream(bucketName, fileName + ".xlsx", inputStream, null);
log.info("埋点文件[{}]返回地址[{}]", fileName, fileUrl);
// if (fileUrl != null && fileUrl.startsWith("http://")) {
// fileUrl = fileUrl.replace("http://", "https://");
// }
//发送机器人
String content = fileName + "文件下载地址: " + fileUrl;
String key = environment.getProperty("burial.point.excel.qw.robot.key");
if (StringUtils.isEmpty(key)) {
log.info("推送企微机器人消息通知失败,机器人key配置为空");
return;
}
Map<String, Object> body = new HashMap<>();
body.put("msgtype", "markdown");
Map<String, String> markdown = new HashMap<>();
markdown.put("content", content);
body.put("markdown", markdown);
String textMessageUrl = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=" + key;
String post = HttpUtil.post(textMessageUrl, JSON.toJSONString(body));
log.info("推送企微机器人埋点消息通知结果[{}]", post);
}
public Map<String, String> getEventCodeMap(List<String> codeList) {
if (CollectionUtils.isEmpty(codeList)) return new HashMap<>();
Example example = new Example(BurialPointEventInfo.class);
example.createCriteria().andIn("eventCode", codeList);
List<BurialPointEventInfo> list = burialPointEventInfoMapper.selectByExample(example);
if (CollectionUtils.isEmpty(list)) return new HashMap<>();
return list.stream().collect(Collectors.toMap(BurialPointEventInfo::getEventCode, BurialPointEventInfo::getEventName, (x, y) -> x));
}
}
package cn.com.glsx.scrm.clue.service;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.scrm.clue.dto.ClueVehicleDTO;
import cn.com.glsx.scrm.clue.enums.ClueFollowTypeEnum;
import cn.com.glsx.scrm.clue.enums.ClueStatusEnum;
import cn.com.glsx.scrm.clue.mapper.ClueOrderFollowMapper;
import cn.com.glsx.scrm.clue.mapper.ClueVehicleMapper;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import cn.com.glsx.scrm.clue.model.ClueOrderFollow;
import cn.com.glsx.scrm.clue.model.ClueVehicle;
import cn.com.glsx.scrm.system.dto.request.UserTaskRequestDTO;
import cn.com.glsx.scrm.system.dto.response.UserTaskResponseDTO;
import cn.com.glsx.scrm.system.enums.UserTaskEnum;
import cn.com.glsx.scrm.system.enums.UserTaskStatusEnum;
import cn.com.glsx.scrm.system.model.SystemUserTask;
import cn.com.glsx.scrm.system.remote.SystemUserTaskRemote;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@Transactional(propagation=Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public class ClueOrderFollowService {
@Autowired
private ClueOrderFollowMapper clueOrderFollowMapper;
@Autowired
private SystemUserTaskRemote systemUserTaskRemote;
@Autowired
private ClueOrderService clueOrderService;
public ClueOrderFollow insertOrUpdate(ClueOrderFollow info){
RpcAssert.assertNotNull(info.getOrderId(),DefaultErrorEnum.DATA_NULL,"orderId must not be null");
RpcAssert.assertNotNull(info.getType(),DefaultErrorEnum.DATA_NULL,"type must not be null");
try{
ClueOrder clueOrder = clueOrderService.getById(info.getOrderId());
if(ObjectUtils.isEmpty(clueOrder)){
throw new RpcServiceException("线索编号不存在");
}
ClueOrderFollow old = null;
if(info.getId() != null){
old = getById(info.getId());
}
Date now = new Date();
info.setUpdatedDate(now);
info.setDeletedFlag(DeletedFlagEnum.N.name());
if(old == null){
info.setCreatedBy(info.getUpdatedBy());
info.setCreatedDate(now);
info.setFollowDate(now);
clueOrderFollowMapper.insertUseGeneratedKeys(info);
}else{
info.setId(old.getId());
info.setCreatedBy(old.getCreatedBy());
info.setCreatedDate(old.getCreatedDate());
clueOrderFollowMapper.updateByPrimaryKey(info);
}
//如果跟进记录类型是线索完成,修改线索状态
if (ClueFollowTypeEnum.FOLLOW_SUCCESS.getValue().equals(info.getType())){
clueOrder.setStatus(ClueStatusEnum.SUCCESS.getValue());
clueOrderService.insertOrUpdate(clueOrder);
}
//更新待办任务状态
if(StringUtils.isNotEmpty(info.getType())) {
UserTaskRequestDTO requestDTO = new UserTaskRequestDTO();
requestDTO.setTaskId(String.valueOf(clueOrder.getId()));
requestDTO.setTaskType(UserTaskEnum.CLUE_DEAL.getValue());
List<UserTaskResponseDTO> list = systemUserTaskRemote.getUserTask(requestDTO).getResult();
if(CollectionUtils.isNotEmpty(list)) {
UserTaskResponseDTO userTaskResponseDTO = list.get(0);
if (ClueFollowTypeEnum.FOLLOW_RECORD.getValue().equals(info.getType()) && UserTaskStatusEnum.UN_DEAL.getValue().equals(userTaskResponseDTO.getStatus())) {
requestDTO.setStatus(UserTaskStatusEnum.DEALING.getValue());
systemUserTaskRemote.updateUserTaskStatus(requestDTO);
}else if (ClueFollowTypeEnum.FOLLOW_SUCCESS.getValue().equals(info.getType())) {
requestDTO.setStatus(UserTaskStatusEnum.DEALED.getValue());
systemUserTaskRemote.updateUserTaskStatus(requestDTO);
}
}
}
return info;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public Page<ClueOrderFollow> listWithPage(RpcPagination<ClueOrderFollow> pagination) {
try{
Page<ClueOrderFollow> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
pagination.getCondition().setDeletedFlag(DeletedFlagEnum.N.name());
clueOrderFollowMapper.select(pagination.getCondition());
return page;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
public boolean delete(ClueOrderFollow info){
try{
ClueOrderFollow old = getById(info.getId());
if(old == null){
return true;
}
info.setUpdatedDate(new Date());
info.setDeletedFlag(DeletedFlagEnum.D.name());
clueOrderFollowMapper.updateByPrimaryKeySelective(info);
return true;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public ClueOrderFollow getById(Integer id){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL,"Id must not be null");
try{
ClueOrderFollow condition = new ClueOrderFollow();
condition.setId(id);
return clueOrderFollowMapper.selectByPrimaryKey(condition);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public List<ClueOrderFollow> listWithOrderId(Integer orderId) {
try{
Example example = new Example(ClueOrderFollow.class);
example.setOrderByClause("follow_date desc");
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("deletedFlag",DeletedFlagEnum.N.name()).andEqualTo("orderId",orderId);
return clueOrderFollowMapper.selectByExample(example);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.service;
import cn.com.glsx.entmicro.remote.EntmicroDepartmentRemote;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.DateUtils;
import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.scrm.clue.dto.ClueOrderDTO;
import cn.com.glsx.scrm.clue.enums.*;
import cn.com.glsx.scrm.clue.mapper.ClueOrderMapper;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import cn.com.glsx.scrm.clue.model.ClueOrderFollow;
import cn.com.glsx.scrm.clue.model.ClueStaff;
import cn.com.glsx.scrm.proxy.dto.cgacar.response.CgacarResponseDTO;
import cn.com.glsx.scrm.proxy.model.MerchantCarInfoResponse;
import cn.com.glsx.scrm.proxy.model.merchant.MerchantRopResponse;
import cn.com.glsx.scrm.proxy.remote.cgacar.CgacarCommonRemote;
import cn.com.glsx.scrm.proxy.remote.merchant.MerchantRemote;
import cn.com.glsx.scrm.system.dto.request.UserTaskRequestDTO;
import cn.com.glsx.scrm.system.dto.response.UserTaskResponseDTO;
import cn.com.glsx.scrm.system.enums.UserTaskEnum;
import cn.com.glsx.scrm.system.enums.UserTaskStatusEnum;
import cn.com.glsx.scrm.system.remote.SystemUserTaskRemote;
import cn.com.glsx.scrm.wechat.dto.workwechat.message.WorkWechatTextCardMessageDTO;
import cn.com.glsx.scrm.wechat.dto.workwechat.message.request.SendWorkWechatMessageRequestDTO;
import cn.com.glsx.scrm.wechat.dto.workwechat.message.response.SendWorkWechatMessageResponseDTO;
import cn.com.glsx.scrm.wechat.enums.WorkWechatAppMessageTypeEnum;
import cn.com.glsx.scrm.wechat.remote.WorkWechatMessageRemote;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@Transactional(propagation=Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public class ClueOrderService {
@Autowired
private ClueOrderMapper clueOrderMapper;
@Autowired
private ClueStaffService clueStaffService;
@Autowired
private WorkWechatMessageRemote workWechatMessageRemote;
@Autowired
private SystemUserTaskRemote systemUserTaskRemote;
@Autowired
private Environment env;
@Autowired
private MerchantRemote merchantRemote;
@Autowired
private ClueOrderFollowService clueOrderFollowService;
@Autowired
private EntmicroDepartmentRemote entmicroDepartmentRemote;
/**
* 新增线索并且分配给对应员工
* @param info
* @return
*/
public ClueOrder insertAndDeal(ClueOrderDTO info){
try{
RpcResponse<MerchantRopResponse> merchantRopResponse = merchantRemote.getByMerchantId(info.getMerchantId());
if(!merchantRopResponse.hasResult()){
throw new RpcServiceException("商户不存在");
}
//校验车型是否还在主营品牌
if(ClueTypeEnum.NEW_CAR.getValue().equals(info.getType()) || ClueTypeEnum.DRIVE.getValue().equals(info.getType())) {
List<Integer> subBrandList = new ArrayList<>();
List<MerchantCarInfoResponse> brandTree = merchantRopResponse.getResult().getBrandTreeList();
if(CollectionUtils.isNotEmpty(brandTree)){
for(MerchantCarInfoResponse brand:brandTree){
if(CollectionUtils.isNotEmpty(brand.getSubList())){
for(MerchantCarInfoResponse subBrand:brand.getSubList()){
subBrandList.add(subBrand.getId());
}
}
}
}
if (!subBrandList.contains(info.getVehicleSubBrandId())) {
throw new RpcServiceException("该车型已下架");
}
}
//完善商户信息
info.setMerchantName(merchantRopResponse.getResult().getMerchantName());
if(StringUtils.isNotEmpty(merchantRopResponse.getResult().getResidentContact())){
info.setMerchantPhone(merchantRopResponse.getResult().getResidentPhone());
}else{
info.setMerchantPhone(merchantRopResponse.getResult().getMerchantLegalPersonPhone());
}
//获取对应跟进员工
ClueStaff clueStaff = getUser(info);
//如果没有跟进员工,状态为待跟进,后续再通过定时任务进行分配
if(ObjectUtils.isEmpty(clueStaff) || StringUtils.isEmpty(clueStaff.getUserUuid())){
info.setStatus(ClueStatusEnum.WAIT_DEALING.getValue());
//新增数据
insertOrUpdate(info, clueStaff);
}else{
//有跟进员工,状态为跟进中
info.setStatus(ClueStatusEnum.DEALING.getValue());
//新增数据
insertOrUpdate(info, clueStaff);
//推送消息
pushToUser(info, clueStaff);
//新建待办
addUserTask(info, clueStaff);
}
return info;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public ClueOrder insertOrUpdate(ClueOrder info){
try{
ClueOrder old = null;
if(info.getId() != null){
old = getById(info.getId());
}
Date now = new Date();
info.setUpdatedDate(now);
info.setDeletedFlag(DeletedFlagEnum.N.name());
if(old == null){
info.setOrderNo(createOrderCode());
info.setCreatedBy(info.getUpdatedBy());
info.setCreatedDate(now);
clueOrderMapper.insertUseGeneratedKeys(info);
}else{
info.setId(old.getId());
info.setOrderNo(old.getOrderNo());
info.setCreatedBy(old.getCreatedBy());
info.setCreatedDate(old.getCreatedDate());
clueOrderMapper.updateByPrimaryKey(info);
}
return info;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public ClueOrder insertOrUpdate(ClueOrder info, ClueStaff clueStaff){
try{
ClueOrder old = null;
if(info.getId() != null){
old = getById(info.getId());
}
Date now = new Date();
info.setUpdatedDate(now);
info.setDeletedFlag(DeletedFlagEnum.N.name());
if(!ObjectUtils.isEmpty(clueStaff)){
info.setUserId(clueStaff.getUserId());
info.setUserName(clueStaff.getUserName());
}
if(old == null){
info.setOrderNo(createOrderCode());
info.setCreatedBy(info.getUpdatedBy());
info.setCreatedDate(now);
clueOrderMapper.insertUseGeneratedKeys(info);
}else{
info.setId(old.getId());
info.setOrderNo(old.getOrderNo());
info.setCreatedBy(old.getCreatedBy());
info.setCreatedDate(old.getCreatedDate());
clueOrderMapper.updateByPrimaryKey(info);
}
return info;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public RpcPagination<ClueOrderDTO> listWithPage(RpcPagination<ClueOrderDTO> pagination) {
try{
Page<ClueOrderDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
clueOrderMapper.list(pagination.getCondition());
return RpcPagination.copyPage(page);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
public List<ClueOrder> list(ClueOrder condition) {
try{
condition.setDeletedFlag(DeletedFlagEnum.N.name());
return clueOrderMapper.select(condition);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
public boolean delete(ClueOrder info){
try{
ClueOrder old = getById(info.getId());
if(old == null){
return true;
}
info.setUpdatedDate(new Date());
info.setDeletedFlag(DeletedFlagEnum.D.name());
clueOrderMapper.updateByPrimaryKeySelective(info);
return true;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public ClueOrder getById(Integer id){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL,"Id must not be null");
try{
ClueOrder condition = new ClueOrder();
condition.setId(id);
ClueOrder clueOrder = clueOrderMapper.selectByPrimaryKey(condition);
return clueOrder;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
/**
* 获取新的订单号
* @return 订单号
*/
private String createOrderCode(){
return DateUtils.formatDate(new Date(), "yyMMddHHmmss") + RandomUtils.nextInt(1000, 10000);
}
public void pushToUser(ClueOrder order, ClueStaff clueStaff){
try{
if(!ObjectUtils.isEmpty(clueStaff) && StringUtils.isNotEmpty(clueStaff.getUserId())){
// 返回授权企微的商户号
RpcResponse<Integer> response = entmicroDepartmentRemote.findSupMerchantNo(order.getMerchantId());
//进行消息推送
SendWorkWechatMessageRequestDTO messageRequestDTO = new SendWorkWechatMessageRequestDTO();
messageRequestDTO.setToUser(clueStaff.getUserId());
messageRequestDTO.setMsgType(WorkWechatAppMessageTypeEnum.TEXTCARD.getValue());
messageRequestDTO.setMerchantId(response.getResult());
WorkWechatTextCardMessageDTO textCardMessageDTO = new WorkWechatTextCardMessageDTO();
textCardMessageDTO.setBtnTxt("立即查看");
textCardMessageDTO.setDescription(MessageFormat.format(env.getProperty("clue.message.description"),order.getName(),order.getPhone()));
textCardMessageDTO.setTitle("线索跟进提醒");
messageRequestDTO.setTextCard(textCardMessageDTO);
MerchantRopResponse merchantRopResponse = merchantRemote.getByMerchantId(response.getResult()).getResult();
String url = MessageFormat.format(env.getProperty("clue.wework.detail.url"),String.valueOf(order.getId()),merchantRopResponse.getEntmicroId());
textCardMessageDTO.setUrl(url);
log.info("金刚区线索消息推送请求" + JSONObject.toJSONString(messageRequestDTO));
RpcResponse<SendWorkWechatMessageResponseDTO> res = (workWechatMessageRemote.sendMessage(messageRequestDTO));
log.info("金刚区线索消息推送返回" + JSONObject.toJSONString(res));
}
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public void addUserTask(ClueOrder order, ClueStaff clueStaff){
try{
if(!ObjectUtils.isEmpty(clueStaff) && StringUtils.isNotEmpty(clueStaff.getUserId())) {
List<UserTaskRequestDTO> requestList = new ArrayList<>();
UserTaskRequestDTO requestDTO = new UserTaskRequestDTO();
requestDTO.setTaskId(String.valueOf(order.getId()));
requestDTO.setContent(MessageFormat.format(env.getProperty("clue.message.description"), order.getName(), order.getPhone()));
requestDTO.setUserUuid(clueStaff.getUserUuid());
requestDTO.setTaskType(UserTaskEnum.CLUE_DEAL.getValue());
requestDTO.setCreatedBy(order.getCreatedBy());
requestList.add(requestDTO);
log.info("金刚区线索新建待办请求" + JSONObject.toJSONString(requestList));
RpcResponse<List<UserTaskResponseDTO>> res = systemUserTaskRemote.createUserTask(requestList);
log.info("金刚区线索新建待办返回" + JSONObject.toJSONString(res));
}
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public ClueStaff getUser(ClueOrder order){
try{
ClueStaff clueStaff = new ClueStaff();
clueStaff.setMerchantId(order.getMerchantId());
if(ClueTypeEnum.NEW_CAR.getValue().equals(order.getType()) || ClueTypeEnum.DRIVE.getValue().equals(order.getType())){
clueStaff.setType(ClueStaffTypeEnum.BEFORE.getValue());
}else if(ClueTypeEnum.MAINTAIN.getValue().equals(order.getType()) || ClueTypeEnum.RESCUE.getValue().equals(order.getType())){
clueStaff.setType(ClueStaffTypeEnum.AFTER.getValue());
}
return clueStaffService.selectOneByExample(clueStaff);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public ClueOrderDTO updateTaskStatus(Integer id){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL,"Id must not be null");
try{
ClueOrderDTO clueOrderDTO = getDetailById(id);
//工作台查看后,状态更新为处理中
UserTaskRequestDTO requestDTO = new UserTaskRequestDTO();
requestDTO.setTaskId(String.valueOf(clueOrderDTO.getId()));
requestDTO.setTaskType(UserTaskEnum.CLUE_DEAL.getValue());
List<UserTaskResponseDTO> list = systemUserTaskRemote.getUserTask(requestDTO).getResult();
if(CollectionUtils.isNotEmpty(list) && UserTaskStatusEnum.UN_DEAL.getValue().equals(list.get(0).getStatus())) {
requestDTO.setStatus(UserTaskStatusEnum.DEALING.getValue());
systemUserTaskRemote.updateUserTaskStatus(requestDTO);
}
return clueOrderDTO;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public ClueOrderDTO getDetailById(Integer id){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL,"Id must not be null");
try{
ClueOrder condition = new ClueOrder();
condition.setId(id);
ClueOrder clueOrder = clueOrderMapper.selectByPrimaryKey(condition);
if(ObjectUtils.isEmpty(clueOrder)){
throw new RpcServiceException("线索编号不存在");
}
ClueOrderDTO clueOrderDTO = new ClueOrderDTO();
BeanUtils.copyProperties(clueOrder, clueOrderDTO);
clueOrderDTO.setFollowList(clueOrderFollowService.listWithOrderId(clueOrder.getId()));
clueOrderDTO.setFollowTime(getDiffDate(new Date(),clueOrder.getCreatedDate()));
StringBuilder carName = new StringBuilder();
if(StringUtils.isNotEmpty(clueOrderDTO.getVehicleBrandName())){
carName.append(clueOrderDTO.getVehicleBrandName()).append(" ");
}
if(StringUtils.isNotEmpty(clueOrderDTO.getVehicleSubBrandName())){
carName.append(clueOrderDTO.getVehicleSubBrandName()).append(" ");
}
if(StringUtils.isNotEmpty(clueOrderDTO.getVehicleSeriesName())){
carName.append(clueOrderDTO.getVehicleSeriesName()).append(" ");
}
if(StringUtils.isNotEmpty(clueOrderDTO.getVehicleShapeName())){
carName.append(clueOrderDTO.getVehicleShapeName());
}
clueOrderDTO.setCarName(carName.toString());
//前端反馈企微工作台框架无法把yyyy-MM-dd HH:mm:ss形式的时间拆分为年月日和时分秒两个字段,所以后台rop返回的时候进行拆分
if(!ObjectUtils.isEmpty(clueOrderDTO.getAppointmentDate())) {
clueOrderDTO.setAppointDate(clueOrderDTO.getAppointmentDate());
clueOrderDTO.setAppointTime(clueOrderDTO.getAppointmentDate());
}
return clueOrderDTO;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
private String getDiffDate(Date date1,Date date2) {
Long milliseconds = date1.getTime() - date2.getTime();
if(milliseconds<0){
milliseconds = -milliseconds;
}
long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
long nh = 1000 * 60 * 60;// 一小时的毫秒数
long nm = 1000 * 60;// 一分钟的毫秒数
long day = milliseconds / nd; // 计算相差多少天
long hour = milliseconds % nd / nh; // 计算相差剩余多少小时
long min = milliseconds % nd % nh / nm; // 计算相差剩余多少分钟
return (day + "天" + hour + "小时" + min + "分钟");
}
}
package cn.com.glsx.scrm.clue.service;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.scrm.clue.mapper.ClueStaffMapper;
import cn.com.glsx.scrm.clue.model.ClueOrder;
import cn.com.glsx.scrm.clue.model.ClueStaff;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@Transactional(propagation=Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public class ClueStaffService {
@Autowired
private ClueStaffMapper clueStaffMapper;
public ClueStaff insertOrUpdate(ClueStaff info){
try{
ClueStaff old = null;
if(info.getId() != null){
old = getById(info.getId());
}
Date now = new Date();
info.setUpdatedDate(now);
info.setDeletedFlag(DeletedFlagEnum.N.name());
if(old == null){
info.setCreatedBy(info.getUpdatedBy());
info.setCreatedDate(now);
clueStaffMapper.insertUseGeneratedKeys(info);
}else{
info.setId(old.getId());
info.setCreatedBy(old.getCreatedBy());
info.setCreatedDate(old.getCreatedDate());
clueStaffMapper.updateByPrimaryKey(info);
}
return info;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public Page<ClueStaff> listWithPage(RpcPagination<ClueStaff> pagination) {
try{
Page<ClueStaff> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
pagination.getCondition().setDeletedFlag(DeletedFlagEnum.N.name());
clueStaffMapper.select(pagination.getCondition());
return page;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
public boolean delete(ClueStaff info){
try{
ClueStaff old = getById(info.getId());
if(old == null){
return true;
}
info.setUpdatedDate(new Date());
info.setDeletedFlag(DeletedFlagEnum.D.name());
clueStaffMapper.updateByPrimaryKeySelective(info);
return true;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public ClueStaff getById(Integer id){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL,"Id must not be null");
try{
ClueStaff condition = new ClueStaff();
condition.setId(id);
return clueStaffMapper.selectByPrimaryKey(condition);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public ClueStaff selectOneByExample(ClueStaff example){
try{
example.setDeletedFlag(DeletedFlagEnum.N.name());
return clueStaffMapper.selectOne(example);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
/**
* 更新售前和售后专员
* @param staffList
* @return
*/
public Boolean insertOrUpdateBatch(List<ClueStaff> staffList){
try{
for(ClueStaff staff:staffList) {
ClueStaff condition = new ClueStaff();
condition.setMerchantId(staff.getMerchantId());
condition.setType(staff.getType());
condition.setDeletedFlag(DeletedFlagEnum.N.name());
ClueStaff old = clueStaffMapper.selectOne(condition);
Date now = new Date();
staff.setUpdatedDate(now);
staff.setDeletedFlag(DeletedFlagEnum.N.name());
if(old == null){
staff.setCreatedBy(staff.getUpdatedBy());
staff.setCreatedDate(now);
clueStaffMapper.insertUseGeneratedKeys(staff);
}else{
staff.setId(old.getId());
staff.setCreatedBy(old.getCreatedBy());
staff.setCreatedDate(old.getCreatedDate());
clueStaffMapper.updateByPrimaryKey(staff);
}
}
return true;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
}
package cn.com.glsx.scrm.clue.service;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.scrm.clue.dto.ClueOrderDTO;
import cn.com.glsx.scrm.clue.dto.ClueVehicleDTO;
import cn.com.glsx.scrm.clue.enums.ClueVehicleStatusEnum;
import cn.com.glsx.scrm.clue.mapper.ClueVehicleMapper;
import cn.com.glsx.scrm.clue.model.ClueVehicle;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@Transactional(propagation=Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public class ClueVehicleService {
@Autowired
private ClueVehicleMapper clueVehicleMapper;
public ClueVehicle insertOrUpdate(ClueVehicle info){
try{
ClueVehicle old = null;
if(info.getId() != null){
old = getById(info.getId());
}
Date now = new Date();
info.setUpdatedDate(now);
info.setDeletedFlag(DeletedFlagEnum.N.name());
if(old == null){
info.setCreatedBy(info.getUpdatedBy());
info.setCreatedDate(now);
info.setStatus(ClueVehicleStatusEnum.ONLINE.getValue());
clueVehicleMapper.insertUseGeneratedKeys(info);
}else{
info.setId(old.getId());
info.setCreatedBy(old.getCreatedBy());
info.setCreatedDate(old.getCreatedDate());
clueVehicleMapper.updateByPrimaryKey(info);
}
return info;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public RpcPagination<ClueVehicleDTO> listWithPage(RpcPagination<ClueVehicleDTO> pagination) {
try{
Page<ClueVehicleDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
pagination.getCondition().setDeletedFlag(DeletedFlagEnum.N.name());
clueVehicleMapper.list(pagination.getCondition());
return RpcPagination.copyPage(page);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
public Boolean delete(ClueVehicle info){
try{
ClueVehicle old = getById(info.getId());
if(old == null){
return true;
}
info.setUpdatedDate(new Date());
info.setDeletedFlag(DeletedFlagEnum.D.name());
clueVehicleMapper.updateByPrimaryKeySelective(info);
return true;
}catch(RpcServiceException e){
throw e;
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public ClueVehicle getById(Integer id){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL,"Id must not be null");
try{
ClueVehicle condition = new ClueVehicle();
condition.setId(id);
return clueVehicleMapper.selectByPrimaryKey(condition);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
/**
* 获取商户车辆品牌列表
* @param pagination
* @return
*/
public RpcPagination<ClueVehicle> getMerchantBrandList(RpcPagination<ClueVehicle> pagination) {
try{
Page<ClueVehicle> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
clueVehicleMapper.getBrandList(pagination.getCondition());
return RpcPagination.copyPage(page);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* 获取商户车辆子品牌列表
* @param pagination
* @return
*/
public RpcPagination<ClueVehicle> getMerchantSubBrandList(RpcPagination<ClueVehicle> pagination) {
try{
Page<ClueVehicle> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
clueVehicleMapper.getSubBrandList(pagination.getCondition());
return RpcPagination.copyPage(page);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* 获取商户车系列表
* @param pagination
* @return
*/
public RpcPagination<ClueVehicleDTO> getMerchantSeriesList(RpcPagination<ClueVehicleDTO> pagination) {
try{
Page<ClueVehicleDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
clueVehicleMapper.getSeriesList(pagination.getCondition());
return RpcPagination.copyPage(page);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* 获取商户车型列表
* @param pagination
* @return
*/
public RpcPagination<ClueVehicleDTO> getMerchantShapeList(RpcPagination<ClueVehicleDTO> pagination) {
try{
Page<ClueVehicleDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
clueVehicleMapper.getShapeList(pagination.getCondition());
return RpcPagination.copyPage(page);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* 上下架车辆
* @param info
* @return
*/
public Integer updateStatus(ClueVehicle info) {
try{
info.setUpdatedDate(new Date());
return clueVehicleMapper.updateByPrimaryKeySelective(info);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
}
\ No newline at end of file
package cn.com.glsx.scrm.clue.service.cache;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.concurrent.TimeUnit;
/**
* @Author yelq
* @Version 1.0
* @Description: redis缓存服务
* @Date 2022/7/5 17:03
*/
@Slf4j
@Service
public class RedisCacheService {
@Autowired
private RedisTemplate redisTemplate;
public Object getCache(String key){
if (key==null||key.length()==0){
return null;
}
try {
return redisTemplate.opsForValue().get(key);
} catch (Exception e) {
log.info("获取缓存异常:{}",e);
return null;
}
}
public boolean setCache(String key,Object val){
if (key==null||key.length()==0){
return false;
}
try {
redisTemplate.opsForValue().set(key,val);
} catch (Exception e) {
log.info("缓存异常:{}",e);
return false;
}
return true;
}
public boolean setCache(String key,Object val,Long timeout){
if (key==null||key.length()==0){
return false;
}
try {
redisTemplate.opsForValue().set(key,val,timeout, TimeUnit.SECONDS);
} catch (Exception e) {
log.info("缓存异常:{}",e);
return false;
}
return true;
}
public boolean deleteCache(String key){
if (key==null||key.length()==0){
return false;
}
try {
redisTemplate.delete(key);
return true;
} catch (Exception e) {
log.info("删除缓存异常:{}",e);
return false;
}
}
}
package cn.com.glsx.scrm.clue.service.collision;
import cn.com.glsx.scrm.clue.constants.Constants;
import cn.com.glsx.scrm.clue.converter.CollisionSnInfoConvert;
import cn.com.glsx.scrm.clue.dto.collision.CollisionAddressDTO;
import cn.com.glsx.scrm.clue.dto.collision.CollisionSnInfoDTO;
import cn.com.glsx.scrm.clue.dto.collision.CollisionSnInfoExportDTO;
import cn.com.glsx.scrm.clue.entity.collision.CollisionInfo;
import cn.com.glsx.scrm.clue.entity.collision.CollisionSnInfo;
import cn.com.glsx.scrm.clue.enums.collision.DeviceTypeEnum;
import cn.com.glsx.scrm.clue.enums.collision.FollowResultEnum;
import cn.com.glsx.scrm.clue.enums.collision.FollowStatusEnum;
import cn.com.glsx.scrm.clue.enums.exception.ClueExceptionEnum;
import cn.com.glsx.scrm.clue.listener.CollisionInfoCustomerDeviceInfoImportListener;
import cn.com.glsx.scrm.clue.manager.AmapManager;
import cn.com.glsx.scrm.clue.manager.GpsManager;
import cn.com.glsx.scrm.clue.manager.PhysicalDeviceManager;
import cn.com.glsx.scrm.clue.mapper.CollisionInfoMapper;
import cn.com.glsx.scrm.clue.mapper.CollisionSnInfoMapper;
import cn.com.glsx.scrm.clue.model.collision.GpsRecordsResponse;
import cn.com.glsx.scrm.clue.model.merchant.MerchantRopResponse;
import cn.com.glsx.scrm.clue.model.collision.CollisionDeviceInfoModel;
import cn.com.glsx.scrm.clue.model.collision.CollisionInfoExportModel;
import cn.com.glsx.scrm.clue.model.collision.CollisionSnInfoImportErrorModel;
import cn.com.glsx.scrm.clue.model.request.collision.*;
import cn.com.glsx.scrm.clue.model.response.collision.*;
import cn.com.glsx.scrm.clue.model.response.collision.CollisionInfoRpcResponse;
import cn.com.glsx.scrm.clue.model.response.collision.CustomerDeviceImportRpcResponse;
import cn.com.glsx.scrm.clue.model.response.collision.FollowInfoRpcResponse;
import cn.com.glsx.scrm.clue.service.merchant.MerchantService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.scrm.clue.util.*;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import tk.mybatis.mapper.entity.Example;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.*;
import java.util.stream.Collectors;
/**
* 碰撞-碰撞线索服务接口
*/
@Slf4j
@Service
public class CollisionInfoService {
@Autowired
private CollisionSnInfoMapper collisionSnInfoMapper;
@Autowired
private MerchantService merchantService;
@Autowired
private Environment environment;
@Autowired
private PhysicalDeviceManager physicalDeviceManager;
@Autowired
private CollisionInfoMapper collisionInfoMapper;
@Autowired
private CollisionPushConfigService collisionPushConfigService;
@Autowired
private AmapManager amapManager;
@Autowired
private GpsManager gpsManager;
/**
* 客户设备信息导入
*
* @param requestDTO
* @return
*/
public CustomerDeviceImportRpcResponse customerDeviceImport(CustomerDeviceImportRpcRequest requestDTO) {
if (requestDTO.getUrl() == null) {
throw new RpcServiceException(ClueExceptionEnum.URL_NULL_ERR);
}
if (requestDTO.getUrl().endsWith(".xls") || requestDTO.getUrl().endsWith(".xlsx")) {
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.add("Accept", MediaType.ALL_VALUE);
log.info("请求文件服务器url:{}", requestDTO.getUrl());
ResponseEntity<byte[]> response = new RestTemplate().exchange(requestDTO.getUrl(), HttpMethod.GET, new HttpEntity<Byte>(requestHeaders), byte[].class);
if (response.getBody() == null) {
throw new RpcServiceException(ClueExceptionEnum.FILE_SERVER_LOAD_ERR);
}
try (
InputStream inputStream = new ByteArrayInputStream(response.getBody());
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
) {
// 限制导入条数
String limit = environment.getProperty("collision.customer.device.import.limit");
CollisionInfoCustomerDeviceInfoImportListener customerDeviceInfoImportListener = new CollisionInfoCustomerDeviceInfoImportListener(limit == null ? 2000 : Integer.valueOf(limit));
EasyExcel.read(inputStream, CollisionSnInfoImportErrorModel.class, customerDeviceInfoImportListener).sheet().doRead();
// 数据关联查询处理
dealData(customerDeviceInfoImportListener, requestDTO);
// 数据入库
saveCustomerDeviceInfo(requestDTO, customerDeviceInfoImportListener);
int count = customerDeviceInfoImportListener.getCount();
if (count == 0 || (customerDeviceInfoImportListener.getList().isEmpty() && customerDeviceInfoImportListener.getErrorList().isEmpty())) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NULL);
}
CustomerDeviceImportRpcResponse resp = new CustomerDeviceImportRpcResponse();
List<CollisionSnInfoImportErrorModel> errList = customerDeviceInfoImportListener.getErrorList();
if (!errList.isEmpty()) {
EasyExcel.write(outputStream, CollisionSnInfoImportErrorModel.class).sheet("校验不通过").doWrite(errList);
FileUploadServerData fileUploadServerData = FileUploadUtil.uploadToFileSystem("客户设备信息导入校验不通过信息" + System.currentTimeMillis(), outputStream.toByteArray(), "xlsx");
resp.setCheckFlag(false);
resp.setCount(count);
resp.setError(errList.size());
resp.setSuccess(customerDeviceInfoImportListener.getList().size());
if (fileUploadServerData.getUrl() != null) {
resp.setErrUrl(fileUploadServerData.getUrl().replace("http://", "https://"));
}
return resp;
}
resp.setCheckFlag(true);
resp.setCount(count);
resp.setError(0);
resp.setSuccess(customerDeviceInfoImportListener.getList().size());
return resp;
} catch (RpcServiceException e) {
log.error("导入数据校验失败!err_msg:{}", e.getMessage(), e);
throw e;
} catch (Exception e) {
log.error("导入数据校验失败!err_msg:{}", e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR);
}
} else {
throw new RpcServiceException(ClueExceptionEnum.UPLOAD_EXCEL_ERR);
}
}
/**
* 校验sn是否存在,是否被其他门店绑定
* @param customerDeviceInfoImportListener
* @param requestDTO
*/
private void dealData(CollisionInfoCustomerDeviceInfoImportListener customerDeviceInfoImportListener, CustomerDeviceImportRpcRequest requestDTO) {
List<CollisionSnInfoImportErrorModel> errorList = customerDeviceInfoImportListener.getErrorList();
if (!errorList.isEmpty()) {
List<String> snList = errorList.stream().map(CollisionSnInfoImportErrorModel::getSn).filter(Objects::nonNull).collect(Collectors.toList());
if (!snList.isEmpty()) {
// 查询已经被其他门店绑定的sn
List<String> snBindedList = collisionSnInfoMapper.selectSnAndBindingInfo(snList, requestDTO.getMerchantId());
if (!snBindedList.isEmpty()) {
Set<String> set = new HashSet<>(snBindedList);
for (CollisionSnInfoImportErrorModel errorModel : errorList) {
String sn = errorModel.getSn();
if (sn != null && set.contains(sn)) {
errorModel.setErrMsg("【IMEI/SN号】该设备已被其他商户绑定!" + errorModel.getErrMsg());
}
}
}
}
}
List<CollisionSnInfoImportErrorModel> collisionSnInfoList = customerDeviceInfoImportListener.getList();
if (!collisionSnInfoList.isEmpty()) {
List<String> snList = collisionSnInfoList.stream().map(CollisionSnInfoImportErrorModel::getSn).filter(Objects::nonNull).map(String::trim).collect(Collectors.toList());
if (!snList.isEmpty()) {
// 查询已经被其他门店绑定的sn
List<String> snBindedList = collisionSnInfoMapper.selectSnAndBindingInfo(snList, requestDTO.getMerchantId());
if (!snBindedList.isEmpty()) {
Set<String> set = new HashSet<>(snBindedList);
for (int i = collisionSnInfoList.size() - 1; i >= 0; i--) {
CollisionSnInfoImportErrorModel model = collisionSnInfoList.get(i);
if (set.contains(model.getSn())) {
// 从入库的列表删除,增加到错误列表
collisionSnInfoList.remove(i);
customerDeviceInfoImportListener.getCollisionSnInfoList().remove(i);
model.setErrMsg("【IMEI/SN号】该设备已被其他商户绑定!");
customerDeviceInfoImportListener.getErrorList().add(model);
}
}
}
}
for (int i = collisionSnInfoList.size() - 1; i >= 0; i--) {
CollisionSnInfoImportErrorModel model = collisionSnInfoList.get(i);
CollisionDeviceInfoModel device = physicalDeviceManager.getPhysicalDeviceBySn(model.getSn());
if (device == null) {
// 从入库的列表删除,增加到错误列表
collisionSnInfoList.remove(i);
customerDeviceInfoImportListener.getCollisionSnInfoList().remove(i);
model.setErrMsg("【IMEI/SN号】未查询到设备信息!");
customerDeviceInfoImportListener.getErrorList().add(model);
} else {
customerDeviceInfoImportListener.getCollisionSnInfoList().get(i).setSnType(device.getTypeId());
customerDeviceInfoImportListener.getCollisionSnInfoList().get(i).setIccid(device.getIccid());
}
}
}
}
/**
* 保存导入信息
*
* @param requestDTO 请求信息
* @param customerDeviceInfoImportListener 解析的信息
*/
private void saveCustomerDeviceInfo(CustomerDeviceImportRpcRequest requestDTO, CollisionInfoCustomerDeviceInfoImportListener customerDeviceInfoImportListener) {
List<CollisionSnInfo> collisionSnInfoList = customerDeviceInfoImportListener.getCollisionSnInfoList();
if (CollectionUtils.isEmpty(collisionSnInfoList)) return;
int batchId = (int) (System.currentTimeMillis() / 1000);// 批次号
Date now = new Date();
String merchantName = getMerchantName(requestDTO.getMerchantId());
collisionSnInfoList.forEach(s -> {
s.setBatchId(batchId);
s.setCreatedBy(requestDTO.getCreatedAccount());
s.setCreatedTime(now);
s.setUpdatedBy(requestDTO.getCreatedAccount());
s.setUpdatedTime(now);
s.setDelFlag(Constants.NORMAL_FLAG.intValue());
s.setMerchantId(requestDTO.getMerchantId());
s.setMerchantName(merchantName);
});
List<String> snList = collisionSnInfoList.stream().map(CollisionSnInfo::getSn).collect(Collectors.toList());
List<String> snBindingList = collisionSnInfoMapper.selectSnBindingForMerchantId(snList, requestDTO.getMerchantId());
if (snBindingList.isEmpty()) {
collisionSnInfoMapper.insertList(collisionSnInfoList);
} else {
Set<String> set = new HashSet<>(snBindingList);
List<CollisionSnInfo> update = new ArrayList<>(snBindingList.size());
List<CollisionSnInfo> save = new ArrayList<>(collisionSnInfoList.size() - snBindingList.size() + 1);
for (CollisionSnInfo collisionSnInfo : collisionSnInfoList) {
if (set.contains(collisionSnInfo.getSn())) {
update.add(collisionSnInfo);
} else {
save.add(collisionSnInfo);
}
}
if (!update.isEmpty()) {
update.forEach(s -> {
Example example = new Example(CollisionSnInfo.class);
example.createCriteria().andEqualTo("sn", s.getSn())
.andEqualTo("delFlag", Constants.NORMAL_FLAG.intValue())
.andEqualTo("merchantId", s.getMerchantId());
collisionSnInfoMapper.updateByExampleSelective(s, example);
});
}
if (!save.isEmpty()) {
collisionSnInfoMapper.insertList(save);
}
}
}
public String getMerchantName(Integer merchantId) {
MerchantRopResponse merchant = merchantService.findMerchantByMerchantNo(merchantId);
if (merchant != null) {
return merchant.getMerchantName();
}
throw new RpcServiceException(ClueExceptionEnum.QUERY_MERCHANT_NAME_ERR);
}
/**
* 碰撞线索-分页查询
*
* @param requestDTO
* @return
*/
public Page<CollisionInfoRpcResponse> listCollisionInfoByPage(CollisionInfoSearchRpcRequest requestDTO) {
PageHelper.startPage(requestDTO.getPageNum(), requestDTO.getPageSize());
Page<CollisionInfoRpcResponse> collisionInfoRpcResponses = collisionInfoMapper.listCollisionInfo(requestDTO);
return collisionInfoRpcResponses;
}
/**
* 碰撞线索-导出
*
* @param requestDTO
* @return
*/
public String exportCollisionInfo(CollisionInfoSearchRpcRequest requestDTO) {
//1.查询数据
PageHelper.startPage(requestDTO.getPageNum(), requestDTO.getPageSize());
Page<CollisionInfoRpcResponse> collisionInfoRpcResponses = collisionInfoMapper.listCollisionInfo(requestDTO);
long total = collisionInfoRpcResponses.getTotal();
int limit = environment.getProperty("collision.export.limit", Integer.class, 5000);
//限制导出条数
if (total > limit) {
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "当前导出数据超过5000条的上限,请分批导出");
}
List<CollisionInfoRpcResponse> result = collisionInfoRpcResponses.getResult();
if (CollectionUtils.isEmpty(result)) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NULL, "未找到符合条件的数据,无法导出");
}
//数据处理
List<CollisionInfoExportModel> list = new ArrayList<>();
for (CollisionInfoRpcResponse collision : result) {
CollisionInfoExportModel exportModel = new CollisionInfoExportModel();
BeanUtils.copyProperties(collision, exportModel);
//设备类型转化
exportModel.setStrSnType(DeviceTypeEnum.getEnumDisplayByValue(collision.getSnType()));
//回访状态
exportModel.setStrFollowStatus(FollowStatusEnum.getEnumDisplayByValue(collision.getFollowStatus()));
//回访结果
exportModel.setStrFollowResult(FollowResultEnum.getEnumDisplayByValue(collision.getFollowResult()));
list.add(exportModel);
}
//保存文件到到服务器
String fileName = "碰撞线索列表" + new Date().getTime();
String fileUrl = ExcelExportUtils.excelExport(fileName, list, CollisionInfoExportModel.class, null);
log.info("碰撞线索列表导出结束,地址[{}]", fileUrl);
if (fileUrl != null && fileUrl.startsWith("http://")) {
return fileUrl.replace("http://", "https://");
}
return fileUrl;
}
/**
* 碰撞线索-查询碰撞信息详情
*
* @param id
* @return
*/
public CollisionDetailInfoRpcResponse getDetailById(Integer id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.PARAMETER_NULL, "id must not be null!");
CollisionDetailInfoRpcResponse detail = collisionInfoMapper.getDetailById(id);
if (detail == null) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST, "未找到碰撞线索信息!");
}
//计算当前时间 当前时间距离碰撞时间是否超过3分钟
Date collisionTime = detail.getCollisionTime();
long diff = DateUtil.diffMinute(collisionTime, new Date());
int limit = environment.getProperty("collision.time.limit", Integer.class, 3);
if (diff > limit) {//碰撞停留超过3分钟
detail.setCollisionTimeOutFlag(1);
}
//查询车辆轨迹信息
List<CollisionAddressDTO> carAddressList = getCarAddress(detail);
detail.setCarAddressList(carAddressList);
return detail;
}
/**
* 获取车辆行车轨迹
* @param detail
* @return
*/
private List<CollisionAddressDTO> getCarAddress(CollisionDetailInfoRpcResponse detail) {
List<GpsRecordsResponse> response = gpsManager.getGpsRecords(detail.getSn(), detail.getCollisionTime());
log.info("gps行车轨迹返回消息[{}]", JSON.toJSONString(response));
List<CollisionAddressDTO> collisionVoList = new ArrayList<CollisionAddressDTO>();
if(CollectionUtils.isNotEmpty(response)) {
long testDate = 0L;
int i = 0;
for(GpsRecordsResponse gpsRecord: response) {
CollisionAddressDTO vo = new CollisionAddressDTO();
vo.setX(Double.valueOf(gpsRecord.getgLng()));
vo.setY(Double.valueOf(gpsRecord.getgLat()));
vo.setLnglat(new Double[]{vo.getX(), vo.getY()});
vo.setName(gpsRecord.getSpeed());
vo.setAg(30);
vo.setSp(Integer.valueOf(gpsRecord.getSpeed()));
String t = DateUtil.timeStampSecToDateStr(gpsRecord.getGpsTime());
vo.setTime(t.substring(11,19));
Long date = Long.valueOf(gpsRecord.getGpsTime());
if(i ++ == 0) {
vo.setTm(date);
testDate = date;
} else {
long t1 = date - testDate;
testDate = date;
vo.setTm(t1);
}
collisionVoList.add(vo);
}
}
return collisionVoList;
}
/**
* 跟进线索-门店专用接口
*
* @param requestDTO
* @return
*/
public FollowInfoRpcResponse followCollisionInfoByMerchant(FollowInfoRpcRequest requestDTO) {
Integer id = requestDTO.getId();
RpcAssert.assertNotNull(id, DefaultErrorEnum.PARAMETER_NULL, "id must not be null!");
CollisionInfo dbInfo = getCollisionInfoById(id);
if (dbInfo == null) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST, "未找到对应的线索数据!");
}
CollisionInfo update = new CollisionInfo();
BeanUtils.copyProperties(requestDTO, update);
update.setUpdatedBy(requestDTO.getCreatedAccount());
Date date = new Date();
update.setUpdatedTime(date);
update.setFollowTime(date);
update.setFollowStatus(FollowStatusEnum.ALREADY_FOLLOW.getValue());
collisionInfoMapper.updateByPrimaryKeySelective(update);
FollowInfoRpcResponse response = new FollowInfoRpcResponse();
BeanUtils.copyProperties(update, response);
return response;
}
/**
* 员工-跟进线索
* @param requestDTO
* @return
*/
public FollowInfoRpcResponse followCollisionInfoByStaff(FollowInfoRpcRequest requestDTO) {
Integer id = requestDTO.getId();
RpcAssert.assertNotNull(id, DefaultErrorEnum.PARAMETER_NULL, "id must not be null!");
CollisionInfo dbInfo = getCollisionInfoById(id);
if (dbInfo == null) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST, "未找到对应的线索数据!");
}
//员工回访,判断线索是否已跟进
if (FollowStatusEnum.ALREADY_FOLLOW.getValue().equals(dbInfo.getFollowStatus())) {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "该线索已被跟进,请刷新列表查看跟进记录");
}
CollisionInfo update = new CollisionInfo();
BeanUtils.copyProperties(requestDTO, update);
update.setUpdatedBy(requestDTO.getCreatedAccount());
Date date = new Date();
update.setUpdatedTime(date);
update.setFollowTime(date);
update.setFollowStatus(FollowStatusEnum.ALREADY_FOLLOW.getValue());
Example example = new Example(CollisionInfo.class);
example.createCriteria().andEqualTo("id", id)
.andEqualTo("followStatus", dbInfo.getFollowStatus());
int count = collisionInfoMapper.updateByExampleSelective(update, example);
if (count < 1) {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "该线索已被跟进,请刷新列表查看跟进记录");
}
FollowInfoRpcResponse response = new FollowInfoRpcResponse();
BeanUtils.copyProperties(update, response);
return response;
}
/**
* 查询跟进记录
*
* @param id
* @return
*/
public CollisionInfo getCollisionInfoById(Integer id) {
Example example = new Example(CollisionInfo.class);
example.createCriteria().andEqualTo("delFlag", Constants.NORMAL_FLAG.intValue())
.andEqualTo("id", id);
return collisionInfoMapper.selectOneByExample(example);
}
/**
* 设备管理-客户设备信息详情查询
*
* @param requestDTO
* @return
*/
public CollisionSnInfoDTO getCustomerDeviceDetail(CollisionSnInfoSearchRpcRequest requestDTO) {
CollisionSnInfoDTO resp = new CollisionSnInfoDTO();
CollisionSnInfo collisionSnInfo = collisionSnInfoMapper.selectByPrimaryKey(requestDTO.getId());
if (collisionSnInfo == null) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST);
}
BeanUtils.copyProperties(collisionSnInfo, resp);
return resp;
}
/**
* 设备管理-编辑
*
* @param requestDTO
* @return
*/
public Boolean customerDeviceEdit(CollisionSnInfoEditRpcRequest requestDTO) {
CollisionSnInfo update = new CollisionSnInfo();
BeanUtils.copyProperties(requestDTO, update);
update.setUpdatedTime(new Date());
update.setUpdatedBy(requestDTO.getCreatedAccount());
update.setCreatedTime(null);
update.setCreatedBy(null);
collisionSnInfoMapper.updateByPrimaryKeySelective(update);
return true;
}
/**
* 设备管理-列表查询
*
* @param requestDTO
* @return
*/
public RpcPagination<CollisionSnInfoDTO> getCustomerDeviceList(RpcPagination<CollisionSnInfoSearchRpcRequest> requestDTO) {
PageHelper.startPage(requestDTO.getPageNum(), requestDTO.getPageSize());
Page<CollisionSnInfoDTO> list = collisionSnInfoMapper.getCustomerDeviceList(requestDTO.getCondition());
return RpcPagination.copyPage(list);
}
/**
* 处理kafka碰撞消息
* @param collisionInfo
*/
public void handleCollisionEvent(CollisionInfo collisionInfo) {
//检查 sn是否已经入库
String sn = collisionInfo.getSn();
Example example = new Example(CollisionSnInfo.class);
example.createCriteria().andEqualTo("delFlag", (int)Constants.NORMAL_FLAG)
.andEqualTo("sn", sn);
List<CollisionSnInfo> collisionSnInfoList = collisionSnInfoMapper.selectByExample(example);
if (CollectionUtils.isEmpty(collisionSnInfoList)) {
log.info("根据设备号[{}]未查询到绑定客户设备信息", sn);
return;
}
collisionInfo.setDelFlag((int)Constants.NORMAL_FLAG);
collisionInfo.setCreatedBy("system");
collisionInfo.setCreatedTime(new Date());
collisionInfo.setFollowStatus(FollowStatusEnum.NO_FOLLOW.getValue());
//解析地址
//将gps坐标转换为谷歌坐标
// BaseGeoConv.LngLatObj gLngLat = BaseGeoConv.transform(collisionInfo.getLongitude() + "," + collisionInfo.getLatitude());
String address = amapManager.getAddrFromLngLat(String.valueOf(collisionInfo.getLongitude()), String.valueOf(collisionInfo.getLatitude()));
//保存碰撞信息
collisionInfo.setAddress(address);
// 长度太长进行截取
if (collisionInfo.getLongitude().length() > Constants.MAX_LONGITUDE_LENGTH) {
collisionInfo.setLongitude(collisionInfo.getLongitude().substring(0, Constants.MAX_LONGITUDE_LENGTH));
}
// 长度太长进行截取
if (collisionInfo.getLatitude().length() > Constants.MAX_LONGITUDE_LENGTH) {
collisionInfo.setLatitude(collisionInfo.getLatitude().substring(0, Constants.MAX_LONGITUDE_LENGTH));
}
log.info("开始保存碰撞信息[{}]", JSON.toJSONString(collisionInfo));
collisionInfoMapper.insertUseGeneratedKeys(collisionInfo);
//发送门店提醒短信
collisionPushConfigService.pushCollisionMsg(collisionSnInfoList.get(0), collisionInfo);
}
/**
* 设备管理-列表查询导出
*
* @param requestDTO
* @return
*/
public String exportCustomerDeviceList(RpcPagination<CollisionSnInfoSearchRpcRequest> requestDTO) {
Page<CollisionSnInfoDTO> page = collisionSnInfoMapper.getCustomerDeviceList(requestDTO.getCondition());
long total = page.getTotal();
int limit = environment.getProperty("collision.export.limit", Integer.class, 5000);
//限制导出条数
if (total > limit) {
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "当前导出数据超过5000条的上限,请分批导出");
}
List<CollisionSnInfoDTO> result = page.getResult();
if (CollectionUtils.isEmpty(result)) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NULL, "未找到符合条件的数据,无法导出");
}
List<CollisionSnInfoExportDTO> list = CollisionSnInfoConvert.INSTANCE.toCollisionSnInfoExportDTOList(result);
//保存文件到到服务器
String fileName = "设备列表-" + DateFormatUtil.nowString(DateFormatUtil.pattern20);
String fileUrl = ExcelExportUtils.excelExport(fileName, list, CollisionSnInfoExportDTO.class, null);
log.info("设备管理-列表查询导出,地址[{}]", fileUrl);
if (fileUrl != null && fileUrl.startsWith("http://")) {
return fileUrl.replace("http://", "https://");
}
return fileUrl;
}
}
package cn.com.glsx.scrm.clue.service.collision;
import cn.com.glsx.scrm.clue.constants.Constants;
import cn.com.glsx.scrm.clue.entity.collision.CollisionMediaInfo;
import cn.com.glsx.scrm.clue.mapper.CollisionMediaInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* 碰撞-碰撞媒体信息服务接口
*/
@Slf4j
@Service
public class CollisionMediaService {
@Autowired
private CollisionMediaInfoMapper collisionMediaInfoMapper;
/**
* 插入碰撞-媒体信息
* @param collisionMediaInfo
* @return
*/
public int insertMediaInfo(CollisionMediaInfo collisionMediaInfo) {
collisionMediaInfo.setCreatedBy("system");
collisionMediaInfo.setCreatedTime(new Date());
collisionMediaInfo.setDelFlag((int)Constants.NORMAL_FLAG);
return collisionMediaInfoMapper.insertUseGeneratedKeys(collisionMediaInfo);
}
}
package cn.com.glsx.scrm.clue.service.collision;
import cn.com.glsx.scrm.clue.constants.Constants;
import cn.com.glsx.scrm.clue.entity.collision.CollisionInfo;
import cn.com.glsx.scrm.clue.entity.collision.CollisionPushConfig;
import cn.com.glsx.scrm.clue.entity.collision.CollisionSnInfo;
import cn.com.glsx.scrm.clue.enums.collision.PushConfigTypeEnum;
import cn.com.glsx.scrm.clue.enums.collision.PushFlagEnum;
import cn.com.glsx.scrm.clue.mapper.CollisionPushConfigMapper;
import cn.com.glsx.scrm.clue.model.merchant.MerchantRopResponse;
import cn.com.glsx.scrm.clue.model.request.collision.CollisionPushConfigRpcRequest;
import cn.com.glsx.scrm.clue.model.response.collision.CollisionPushConfigRpcResponse;
import cn.com.glsx.scrm.clue.service.merchant.MerchantService;
import cn.com.glsx.scrm.clue.service.common.MessageService;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.util.DateUtils;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 碰撞-线索推送配置服务接口
*/
@Slf4j
@Service
public class CollisionPushConfigService {
@Autowired
private CollisionPushConfigMapper collisionPushConfigMapper;
@Autowired
private MerchantService merchantService;
@Autowired
private Environment environment;
@Autowired
private MessageService messageService;
/**
* 碰撞线索-推送配置新增/修改
* @param requestDTO
* @return
*/
public CollisionPushConfigRpcResponse addOrUpdatePushConfig(CollisionPushConfigRpcRequest requestDTO) {
Integer merchantId = requestDTO.getMerchantId();
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.PARAMETER_NULL, "merchantId must not be null!");
//判断新增/还是修改
List<CollisionPushConfig> collisionPushConfigs = listPushConfig(merchantId, requestDTO.getConfigType());
Date now = new Date();
CollisionPushConfig config;
if(CollectionUtils.isEmpty(collisionPushConfigs)) {
//说明是新增
config = new CollisionPushConfig();
BeanUtils.copyProperties(requestDTO, config);
//查询商户名称
MerchantRopResponse merchant = merchantService.findMerchantByMerchantNo(merchantId);
if (merchant != null) {
config.setMerchantName(merchant.getMerchantName());
}
config.setCreatedBy(requestDTO.getCreatedAccount());
config.setDelFlag(Constants.NORMAL_FLAG.intValue());
config.setCreatedTime(now);
collisionPushConfigMapper.insertUseGeneratedKeys(config);
} else {
//更新操作
config = collisionPushConfigs.get(0);
BeanUtils.copyProperties(requestDTO, config);
config.setUpdatedBy(requestDTO.getCreatedAccount());
config.setUpdatedTime(now);
collisionPushConfigMapper.updateByPrimaryKeySelective(config);
}
CollisionPushConfigRpcResponse response = new CollisionPushConfigRpcResponse();
BeanUtils.copyProperties(config, response);
return response;
}
public List<CollisionPushConfig> listPushConfig(Integer merchantId, Integer configType) {
Example example = new Example(CollisionPushConfig.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("delFlag", Constants.NORMAL_FLAG.intValue())
.andEqualTo("merchantId", merchantId);
if (configType != null) {
criteria.andEqualTo("configType", configType);
}
List<CollisionPushConfig> collisionPushConfigs = collisionPushConfigMapper.selectByExample(example);
return collisionPushConfigs;
}
/**
* 查询碰撞线索-推送配置详情
* @param merchantId
* @return
*/
public List<CollisionPushConfigRpcResponse> getPushConfigByMerchantId(Integer merchantId) {
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.PARAMETER_NULL, "merchantId must not be null!");
List<CollisionPushConfig> collisionPushConfigs = listPushConfig(merchantId, null);
if (CollectionUtils.isEmpty(collisionPushConfigs)) {
return null;
} else {
List<CollisionPushConfigRpcResponse> collect = collisionPushConfigs.stream().map(item -> {
CollisionPushConfigRpcResponse response = new CollisionPushConfigRpcResponse();
BeanUtils.copyProperties(item, response);
return response;
}).collect(Collectors.toList());
return collect;
}
}
/**
* 推送碰撞消息给门店
* @param collisionSnInfo
* @param collisionInfo
*/
public void pushCollisionMsg(CollisionSnInfo collisionSnInfo, CollisionInfo collisionInfo) {
Integer merchantId = collisionSnInfo.getMerchantId();
log.info("开始查询商户[{}]提醒推送配置", merchantId);
//根据商户号查询推送配置
List<CollisionPushConfig> collisionPushConfigs = listPushConfig(merchantId, PushConfigTypeEnum.MERCHANT.getValue());
if (CollectionUtils.isEmpty(collisionPushConfigs)) {
log.info("该商户[{}]未配置推送配置", merchantId);
return;
}
CollisionPushConfig merchantConfig = collisionPushConfigs.get(0);
log.info("该商户[{}]-门店提醒推送配置如下[{}]", merchantId, JSONObject.toJSONString(merchantConfig));
//校验是否推送短息消息
if (!checkConfig(merchantConfig)) {
log.info("该商户[{}]推送配置校验不通过", merchantConfig);
return;
}
log.info("该商户[{}]推送配置校验通过,开始发送短信", merchantId);
//校验通过,开始构建短信内容
String merchantTemplate = environment.getProperty("collision.sms.merchant.template");
String messageSource = environment.getProperty("message.source");
String messageType = environment.getProperty("message.type", "2");
List<String> phoneList = Arrays.asList(merchantConfig.getPushPhones().split(","));
for (String phone : phoneList) {
String content = MessageFormat.format(merchantTemplate, collisionSnInfo.getCustomerName(), collisionInfo.getAddress(), collisionSnInfo.getCustomerPhone());
messageService.sendMessage(phone, messageSource, messageType, content);
}
}
/**
* 校验推送配置,是否生效
* @param config
* @return
*/
public boolean checkConfig(CollisionPushConfig config) {
Integer merchantId = config.getMerchantId();
//校验开关
if (!PushFlagEnum.ON.getValue().equals(config.getPushFlag())) {
log.info("该商户[{}]未开启推送配置", merchantId);
return false;
}
//校验推送时间
Date now = new Date();
String hourMinute = DateUtils.date2String(now, DateUtils.DATE_FORMAT_HOUR_MINUTE2);
String beginHours = config.getStartTime();
String endHours = config.getEndTime();
if(hourMinute.compareTo(beginHours) < 0 || hourMinute.compareTo(endHours) > 0) {
log.info("该商户[{}]推送配置不在当前时间段内,无法推送", merchantId);
return false;
}
if (PushConfigTypeEnum.MERCHANT.getValue().equals(config.getConfigType())) {
if (StringUtils.isEmpty(config.getPushPhones())) {
log.info("该商户[{}]未配置顾问手机号,无法推送", merchantId);
return false;
}
}
return true;
}
}
package cn.com.glsx.scrm.clue.service.collision;
import cn.com.glsx.scrm.clue.constants.Constants;
import cn.com.glsx.scrm.clue.entity.collision.CollisionSnInfo;
import cn.com.glsx.scrm.clue.mapper.CollisionSnInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
/**
* 碰撞-碰撞设备信息服务接口
*/
@Slf4j
@Service
public class CollisionSnInfoService {
@Autowired
private CollisionSnInfoMapper collisionSnInfoMapper;
public List<CollisionSnInfo> getSnInfoBySn(String sn) {
Example example = new Example(CollisionSnInfo.class);
example.createCriteria().andEqualTo("delFlag", (int) Constants.NORMAL_FLAG)
.andEqualTo("sn", sn);
return collisionSnInfoMapper.selectByExample(example);
}
}
package cn.com.glsx.scrm.clue.service.common;
import cn.com.glsx.scrm.clue.util.RopHttpUtil;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
/**
* @author zhouhaibao
* @version 1.0
* @description: 短信发送服务
* @date 2021/11/14 14:23
*/
@Service
@Slf4j
public class MessageService {
@Value("${sendMessageUrl}")
private String sendMessageUrl;
@Value("${sendMessageMethod}")
private String sendMessageMethod;
/**
* 发送短信
*
* @param phone 电话号码,批量用逗号隔开
* @param source 来源
* @param type 类型
* @param context 发送内容
*/
public void sendMessage(String phone, String source, String type, String context) {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4);
try {
params.add("phone", phone);
params.add("source", source);
params.add("messageSource", source);
params.add("type", type);
params.add("context", context);
log.info("短信发送参数:{}", JSON.toJSONString(params));
String post = RopHttpUtil.postE(params, String.class, sendMessageUrl + "?method=" + sendMessageMethod, sendMessageMethod);
log.info("发送短信结果{}",post);
} catch (Exception e) {
e.printStackTrace();
log.info("发送短信异常,", e);
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR);
}
}
}
package cn.com.glsx.scrm.clue.service.merchant;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.scrm.clue.constants.RedisCacheKeyPreConstants;
import cn.com.glsx.scrm.clue.enums.exception.ClueExceptionEnum;
import cn.com.glsx.scrm.clue.model.RopResponse;
import cn.com.glsx.scrm.clue.model.merchant.MerchantRopResponse;
import cn.com.glsx.scrm.clue.service.cache.RedisCacheService;
import cn.com.glsx.scrm.clue.util.RopHttpUtil;
import com.glsx.plat.common.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import java.util.Map;
/**
* @author zhouhaibao
* @version 1.0
* @description: 商户服务
* @date 2021/9/24 14:34
*/
@Service
@Slf4j
public class MerchantService {
@Value("${merchant.baseurl}")
private String baseurl;
@Autowired
private RedisCacheService redisCacheService;
/**
* 根据商户号查询商户
*
* @param merchantNo 商户号
*/
public MerchantRopResponse findMerchantByMerchantNo(Integer merchantNo) {
try {
Object cache = redisCacheService.getCache(RedisCacheKeyPreConstants.merchantDetailKey + merchantNo);
if (cache != null) {
MerchantRopResponse rep = (MerchantRopResponse) cache;
return rep;
}
} catch (Exception e) {
try {
//转换异常证明旧的数据已经无效了
redisCacheService.deleteCache(RedisCacheKeyPreConstants.merchantDetailKey + merchantNo);
} catch (Exception e1) {
}
}
MerchantRopResponse merchantRopResponse = new MerchantRopResponse();
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4);
params.set("merchantId", merchantNo + "");
try {
String findMerchantDetailByMerchantNoMethod = "merchants.api.open.findMerchantDetailByMerchantNo";
RopResponse ropResponse = RopHttpUtil.get(params, RopResponse.class, baseurl, findMerchantDetailByMerchantNoMethod);
// log.info("查询授权商户信息,{}",ropResponse);
if (("0").equals(ropResponse.getCode())) {
Map baseData = (Map) ropResponse.getData();
if (baseData == null) {
return null;
}
BeanUtils.copyProperties(baseData, merchantRopResponse);
merchantRopResponse.setMerchantModel((Integer) baseData.get("merchantModel"));
merchantRopResponse.setChannelId((Integer) baseData.get("channelId"));
merchantRopResponse.setMerchantName((String) baseData.get("merchantName"));
merchantRopResponse.setMerchantLegalPersonPhone((String) baseData.get("merchantLegalPersonPhone"));
merchantRopResponse.setCreatedTime(DateUtils.parse(baseData.get("createdTime") + ""));
merchantRopResponse.setBusinessTypeId((String) baseData.get("businessType"));
merchantRopResponse.setBusinessTypeName((String) baseData.get("businessTypeName"));
merchantRopResponse.setMerchantAddress((String) baseData.get("merchantAddress"));
redisCacheService.setCache(RedisCacheKeyPreConstants.merchantDetailKey + merchantNo, merchantRopResponse, RedisCacheKeyPreConstants.merchantDetailKeyTimeout);
}else {
log.info("根据商户号查询商户异常:{}",ropResponse);
throw new RpcServiceException(ClueExceptionEnum.FIND_MERCHANT_EXCEPTION.getValue(), ClueExceptionEnum.FIND_MERCHANT_EXCEPTION.getDisplayName());
}
} catch (Exception e) {
log.info("根据商户号查询商户异常:", e);
throw new RpcServiceException(ClueExceptionEnum.FIND_MERCHANT_EXCEPTION.getValue(), ClueExceptionEnum.FIND_MERCHANT_EXCEPTION.getDisplayName());
}
return merchantRopResponse;
}
}
package cn.com.glsx.scrm.clue.util;
import static java.lang.Math.*;
/**
* @Title: GeoConv工具类
* @Description:GeoConv工具类
* @author huanggl
* @version V1.0
* @Company: Didihu.com.cn
* @history 2019-04-28 11:02:04
*/
public abstract class BaseGeoConv {
/**
* <p> 圆周率
*/
private static final double PI = 3.14159265358979324;
/**
* <p> WGS 长轴半径
*/
private static final double RADIUS = 6378245.0;
/**
* <p> WGS 偏心率的平方
*/
private static final double EE = 0.00669342162296594323;
private static final double X_PI = 3.14159265358979324 * 3000.0 / 180.0;
static private double transformLat(double x, double y){
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * sqrt(abs(x));
ret += (20.0 * sin(6.0 * x * PI) + 20.0 * sin(2.0 * x * PI)) * 2.0 / 3.0;
ret += (20.0 * sin(y * PI) + 40.0 * sin(y / 3.0 * PI)) * 2.0 / 3.0;
ret += (160.0 * sin(y / 12.0 * PI) + 320 * sin(y * PI / 30.0)) * 2.0 / 3.0;
return ret;
}
static private double transformLng(double x, double y){
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * sqrt(abs(x));
ret += (20.0 * sin(6.0 * x * PI) + 20.0 * sin(2.0 * x * PI)) * 2.0 / 3.0;
ret += (20.0 * sin(x * PI) + 40.0 * sin(x / 3.0 * PI)) * 2.0 / 3.0;
ret += (150.0 * sin(x / 12.0 * PI) + 300.0 * sin(x / 30.0 * PI)) * 2.0 / 3.0;
return ret;
}
static public LngLatObj transform(String lngLat){
double wgLng = Double.parseDouble(lngLat.split(",")[0]);
double wgLat = Double.parseDouble(lngLat.split(",")[1]);
double dLat = transformLat(wgLng - 105.0, wgLat - 35.0);
double dLon = transformLng(wgLng - 105.0, wgLat - 35.0);
double radLat = wgLat/180.0 * PI;
double magic = sin(radLat);
magic = 1 - EE * magic * magic;
double sqrtMagic = sqrt(magic);
dLat = (dLat * 180.0) / ((RADIUS * (1 - EE)) / (magic * sqrtMagic) * PI);
dLon = (dLon * 180.0) / (RADIUS / sqrtMagic * cos(radLat) * PI);
return new LngLatObj(wgLng + dLon, wgLat + dLat);
}
public static double transformGGLat(double wgLng, double wgLat){
double dLat = transformLat(wgLng - 105.0, wgLat - 35.0);
double radLat = wgLat/180.0 * PI;
double magic = sin(radLat);
magic = 1 - EE * magic * magic;
double sqrtMagic = sqrt(magic);
dLat = (dLat * 180.0) / ((RADIUS * (1 - EE)) / (magic * sqrtMagic) * PI);
return wgLat + dLat;
}
public static double transformGGLng(double wgLng, double wgLat){
double dLon = transformLng(wgLng - 105.0, wgLat - 35.0);
double radLat = wgLat/180.0 * PI;
double magic = sin(radLat);
magic = 1 - EE * magic * magic;
double sqrtMagic = sqrt(magic);
dLon = (dLon * 180.0) / (RADIUS / sqrtMagic * cos(radLat) * PI);
return wgLng + dLon;
}
public static void main(String[] args) {
System.out.println(BaseGeoConv.transformGGLng(119.63177,32.291477) + "," + BaseGeoConv.transformGGLat(119.63177,32.291477));
System.out.println(BaseGeoConv.transform("119.63177,32.291477"));
//System.out.println(GeoConv.transform("113.874829,22.569914").getLng() + ", " + GeoConv.transform("113.874829,22.569914").getLat());
//System.out.println(GeoConv.transform("114.398416,38.058380").getLngLat());
String kk = BaseGeoConv.transform("103.992372,30.63103").getLngLat();
double lat0 = Double.parseDouble(kk.split(",")[1]);
double lon0 = Double.parseDouble(kk.split(",")[0]);
//104.14635851597282,31.086821202789974
//103.992372 30.63103
//String aa = GeoConv.transform("103.992372,30.63103").getLngLat();
double lat1 = 31.086821202789974;
double lon1 = 104.14635851597282;
double[] bearings = new double[3];
BearingToUtils.computeDistanceAndBearing(lat0,lon0,lat1,lon1,bearings);
System.out.println(bearings[1]);
System.out.println(bearings[2]);
double bearing = 0;
if(bearings[1] < 0) {
bearing = 360 - Math.abs(bearings[1]);
} else {
bearing = bearings[1];
}
/*
String azimuthDesc = "";
if(bearing > 0.0 && bearing <= 10.0) {
azimuthDesc="北方";
} else if(bearing > 10.0 && bearing <= 80.0) {
azimuthDesc="东北";
} else if(bearing > 80.0 && bearing <= 100.0) {
azimuthDesc="东方";
} else if(bearing > 100.0 && bearing <= 170.0) {
azimuthDesc="东南";
} else if(bearing > 170.0 && bearing <= 190.0) {
azimuthDesc="南方";
} else if(bearing > 190.0 && bearing <= 260.0) {
azimuthDesc="西南";
} else if(bearing > 260.0 && bearing <= 280.0) {
azimuthDesc="西方";
} else if(bearing > 280.0 && bearing <= 350.0) {
azimuthDesc="西北";
} else if(bearing > 350.0 && bearing <= 360.0) {
azimuthDesc="北方";
}
*/
System.out.println(bearing);
//System.out.println(azimuthDesc);
//System.out.println(GeoConv.transformGGLng(113.938671,22.551195) + "," + GeoConv.transformGGLat(113.938671,22.551195));
}
static public class LngLatObj {
private double lng;
private double lat;
LngLatObj(double lng, double lat) {
this.lng = lng;
this.lat = lat;
}
public double getLng() {
return lng;
}
public double getLat() {
return lat;
}
public String getLngLat(){
return lng + "," + lat;
}
@Override
public String toString() {
return "LngLatObj [lng=" + lng + ", lat=" + lat + "]";
}
}
}
package cn.com.glsx.scrm.clue.util;
/**
* @Title: 计算方位角工具类
* @Description:计算方位角工具类
* @author huanggl
* @version V1.0
* @Company: Didihu.com.cn
* @history 2019-5-1
*/
public class BearingToUtils {
private static int COUNT2 = 2;
public static void computeDistanceAndBearing(double lat1, double lon1,double lat2, double lon2, double[] results) {
int maxIters = 20;
lat1 *= Math.PI / 180.0;
lat2 *= Math.PI / 180.0;
lon1 *= Math.PI / 180.0;
lon2 *= Math.PI / 180.0;
double a = 6378137.0;
double b = 6356752.3142;
double f = (a - b) / a;
double aSqMinusBSqOverBSq = (a * a - b * b) / (b * b);
double l = lon2 - lon1;
double zheOne = 0.0;
double u1 = Math.atan((1.0 - f) * Math.tan(lat1));
double u2 = Math.atan((1.0 - f) * Math.tan(lat2));
double cosU1 = Math.cos(u1);
double cosU2 = Math.cos(u2);
double sinU1 = Math.sin(u1);
double sinU2 = Math.sin(u2);
double cosU1cosU2 = cosU1 * cosU2;
double sinU1sinU2 = sinU1 * sinU2;
double sigma = 0.0;
double deltaSigma = 0.0;
double cosSqAlpha = 0.0;
double cos2SM = 0.0;
double cosSigma = 0.0;
double sinSigma = 0.0;
double cosLambda = 0.0;
double sinLambda = 0.0;
double lambda = l;
for (int iter = 0; iter < maxIters; iter++) {
double lambdaOrig = lambda;
cosLambda = Math.cos(lambda);
sinLambda = Math.sin(lambda);
double t1 = cosU2 * sinLambda;
double t2 = cosU1 * sinU2 - sinU1 * cosU2 * cosLambda;
double sinSqSigma = t1 * t1 + t2 * t2;
sinSigma = Math.sqrt(sinSqSigma);
cosSigma = sinU1sinU2 + cosU1cosU2 * cosLambda;
sigma = Math.atan2(sinSigma, cosSigma);
double sinAlpha = (sinSigma == 0) ? 0.0 : cosU1cosU2 * sinLambda / sinSigma;
cosSqAlpha = 1.0 - sinAlpha * sinAlpha;
cos2SM = (cosSqAlpha == 0) ? 0.0 : cosSigma - 2.0 * sinU1sinU2 / cosSqAlpha;
double uSquared = cosSqAlpha * aSqMinusBSqOverBSq;
zheOne = 1 + (uSquared / 16384.0) * (4096.0 + uSquared * (-768 + uSquared * (320.0 - 175.0 * uSquared)));
double theTwo = (uSquared / 1024.0) * (256.0 + uSquared * (-128.0 + uSquared * (74.0 - 47.0 * uSquared)));
double theThree = (f / 16.0) * cosSqAlpha * (4.0 + f * (4.0 - 3.0 * cosSqAlpha));
double cos2SMSq = cos2SM * cos2SM;
deltaSigma = theTwo * sinSigma * (cos2SM + (theTwo / 4.0) * (cosSigma * (-1.0 + 2.0 * cos2SMSq) - (theTwo / 6.0) * cos2SM * (-3.0 + 4.0 * sinSigma * sinSigma) * (-3.0 + 4.0 * cos2SMSq)));
lambda = l + (1.0 - theThree) * f * sinAlpha * (sigma + theThree * sinSigma * (cos2SM + theThree * cosSigma * (-1.0 + 2.0 * cos2SM * cos2SM)));
double delta = (lambda - lambdaOrig) / lambda;
if (Math.abs(delta) < 1.0e-12) {
break;
}
}
double distance = (b * zheOne * (sigma - deltaSigma));
results[0] = distance;
if (results.length > 1) {
double initialBearing = (float) Math.atan2(cosU2 * sinLambda,cosU1 * sinU2 - sinU1 * cosU2 * cosLambda);
initialBearing *= 180.0 / Math.PI;
results[1] = initialBearing;
if (results.length > COUNT2) {
double finalBearing = (float) Math.atan2(cosU1 * sinLambda, -sinU1 * cosU2 + cosU1 * sinU2 * cosLambda);
finalBearing *= 180.0 / Math.PI;
results[2] = finalBearing;
}
}
}
}
package cn.com.glsx.scrm.clue.util;
import org.apache.log4j.Logger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* @author wangxw
* @version 1.0.0
* @ClassName DateFormatUtil.java
* @description: ${description}
* @createTime 2021年11月04日 16:00:00
*/
public class DateFormatUtil {
protected final static Logger logger = Logger.getLogger(DateFormatUtil.class);
public static String pattern20 = "yyyyMMddHHmmssSSS";
public static String pattern19 = "yyyy-MM-dd HH:mm:ss";
public static String pattern14 = "yyyyMMddHHmmss";
public static String pattern10 = "yyyy-MM-dd";
public static String pattern8 = "yyyyMMdd";
public static String pattern6 = "HHmmss";
private static final Map<String, ThreadLocal<SimpleDateFormat>> pool
= new HashMap<String, ThreadLocal<SimpleDateFormat>>();
private static final Object lock = new Object();
public static SimpleDateFormat getDateFormat(String pattern) {
ThreadLocal<SimpleDateFormat> tl = pool.get(pattern);
if (tl == null) {
synchronized (lock) {
tl = pool.get(pattern);
if (tl == null) {
final String p = pattern;
tl = new ThreadLocal<SimpleDateFormat>() {
protected synchronized SimpleDateFormat initialValue() {
return new SimpleDateFormat(p);
}
};
pool.put(p, tl);
}
}
}
return tl.get();
}
public static Date toDate(String dateStr, String pattern) {
try {
return getDateFormat(pattern).parse(dateStr);
} catch (ParseException e) {
logger.error(e);
}
return null;
}
public static String toString(Date date, String pattern) {
return getDateFormat(pattern).format(date);
}
public static String nowString(String pattern) {
return getDateFormat(pattern).format(new Date());
}
}
package cn.com.glsx.scrm.clue.util;
import com.glsx.plat.common.utils.DateUtils;
import com.glsx.plat.common.utils.StringUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
public class DateUtil extends org.apache.commons.lang.time.DateUtils {
public static final String NORMAL_DATE_PATTERN;
public static final String reg = "(\\d{4}[/-]?\\d{1,2}[/-]?\\d{1,2})?";
public static final String reg1 = "(\\d{4}[/-]?\\d{1,2}[/-]?\\d{1,2} \\d{1,2}:\\d{1,2}[:]?\\d{1,2})?";
public static final String reg2 = "(\\d{14})?";
public static final String reg3 = "(\\d{4}[/-]?\\d{1,2}[/-]?\\d{1,2} \\d{1,2}:\\d{1,2}[:]?\\d{1,2})?";
public static final String reg4 = "(\\d{14})?";
static {
NORMAL_DATE_PATTERN = DateFormatUtils.ISO_DATE_FORMAT.getPattern();
}
//日期比较方法
public static int compareDate(Date first, Date second) {
return first.compareTo(second);
}
//获取近datNum天日期,从今日
public static List<String> getDates(int datNum, boolean fromNow) {
int index = 1;
int end = datNum + 1;
if (fromNow) {
index = 0;
end = datNum;
}
List<String> dateList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
for (int i = index; i < end; i++) {
Date date = DateUtils.addDays(new Date(), -i);
String formatDate = sdf.format(date);
dateList.add(formatDate);
}
return dateList;
}
//获取近datNum天日期,从今日
public static List<String> getDates(Date dateEnd, int datNum) {
List<String> dateList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
for (int i = 0; i < datNum; i++) {
Date date = DateUtils.addDays(dateEnd, -i);
String formatDate = sdf.format(date);
dateList.add(formatDate);
}
return dateList;
}
public static Date parse(String strDate) {
Date date = null;
try {
if (StringUtils.isNotEmpty(strDate)) {
if (strDate.matches(reg3)) {
date = parseDate(strDate, new String[]{NORMAL_DATE_PATTERN, "yyyy-MM-dd HH:mm:ss"});
} else {
date = parseDate(strDate, new String[]{NORMAL_DATE_PATTERN, "yyyy/MM/dd"});
}
}
} catch (ParseException var3) {
var3.printStackTrace();
}
return date;
}
public static Set<String> getMonths(int datNum) {
Set<String> dateList = new HashSet<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM");
for (int i = 0; i < datNum; i++) {
Date date = DateUtils.addDays(new Date(), -i);
String formatDate = sdf.format(date);
dateList.add(formatDate);
}
return dateList;
}
public static Integer getMonthDays(String date) {
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM");
try {
cal.setTime(sdf.parse(date));
} catch (ParseException e) {
e.printStackTrace();
return 0;
}
/* cal.set(Calendar.YEAR, 2002 );
cal.set(Calendar.MONTH, 6 ); // 7月*/
int maxDate = cal.getActualMaximum(Calendar.DATE);
return maxDate;
}
public static List<String> getAllDates(String minDay) {
List<String> dateList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
int i = 0;
while (true) {
Date date = DateUtils.addDays(new Date(), -i);
String formatDate = sdf.format(date);
System.out.println("最小日期" + minDay);
System.out.println("当前日期" + formatDate);
dateList.add(formatDate);
if (formatDate.equals(minDay)) {
break;
}
i++;
}
return dateList;
}
/**
* 合并日期
*
* @return
*/
public static Date mergeDate(Date date, String datetime) {
SimpleDateFormat ds = new SimpleDateFormat("yyyy/MM/dd HH:mm");
SimpleDateFormat dsp = new SimpleDateFormat("yyyy/MM/dd");
try {
String format = dsp.format(date.getTime());
Date endTime = ds.parse(format + " " + datetime);
return endTime;
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
public static List<String> getDateTimeList() {
List<String> timelist = new ArrayList<>();
for (int i = 0; i < 25; i++) {
if (i < 10) {
timelist.add("0" + i + ":00");
} else {
timelist.add(i + ":00");
}
}
return timelist;
}
/**
* 获取时间段内的时间集合
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return
*/
public static List<String> getDateList(String startTime, String endTime) {
List<String> dateList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date startDate = DateUtils.stringToDate(startTime, "yyyy-MM-dd");
int i = 0;
while (true) {
Date date = DateUtils.addDays(startDate, +i);
String formatDate = sdf.format(date);
dateList.add(formatDate);
if (formatDate.equals(endTime)) {
break;
}
i++;
}
return dateList;
}
/**
* 获取时间段内的时间集合
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return
*/
public static List<String> getDateList(Date startTime, Date endTime) {
List<String> dateList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String endDate = sdf.format(endTime);
int i = 0;
while (true) {
Date date = DateUtils.addDays(startTime, +i);
String formatDate = sdf.format(date);
dateList.add(formatDate);
if (formatDate.equals(endDate)) {
break;
}
i++;
}
return dateList;
}
public static boolean isDate(String str) {
String reg = "(\\d{4}[/-]?\\d{1,2}[/-]?\\d{1,2})?";
String reg1 = "(\\d{4}[/-]?\\d{1,2}[/-]?\\d{1,2} \\d{1,2}:\\d{1,2}[:]?\\d{1,2})?";
String reg2 = "(\\d{14})?";
boolean matches = str.matches(reg);
if (matches) {
return true;
}
boolean matches1 = str.matches(reg1);
if (matches1) {
return true;
}
return str.matches(reg2);
}
/**
* 计算日期相差分钟数
* @param start
* @param end
* @return
*/
public static long diffMinute(Date start, Date end) {
if (start == null || end == null) {
return 0;
}
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
c1.setTime(start);
c2.setTime(end);
if (c1.after(c2)) {
return 0;
} else {
long diff = c2.getTimeInMillis() - c1.getTimeInMillis();
return diff / (60 * 1000);
}
}
public static String timeStampSecToDateStr(String timestampString) {
try {
long parseLong = Long.parseLong(timestampString);
long timestamp = parseLong * 1000L;
return DateFormatUtils.format(timestamp, "yyyy-MM-dd HH:mm:ss");
} catch (Exception var6) {
var6.printStackTrace();
return "";
}
}
}
package cn.com.glsx.scrm.clue.util;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import org.apache.commons.io.IOUtils;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import javax.servlet.http.HttpServletResponse;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.Arrays;
import java.util.List;
import static cn.com.glsx.scrm.clue.util.ScrmServiceProviderTypeEnum.PROVIDER_GUANG_HUI;
public class EasyExcelUtils {
/**
* 导出
*
* @param response
* @param data
* @param fileName
* @param sheetName
* @param clazz
* @throws Exception
*/
public static void writeExcel(HttpServletResponse response, List<? extends Object> data, String fileName, String sheetName, Class clazz) throws Exception {
//表头样式
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
//设置表头居中对齐
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
WriteFont writeFont = new WriteFont();
writeFont.setFontHeightInPoints((short) 12);
headWriteCellStyle.setWriteFont(writeFont);
//内容样式
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
//设置内容靠左对齐
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.LEFT);
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
EasyExcel.write(getOutputStream(fileName, response), clazz).excelType(ExcelTypeEnum.XLSX).sheet(sheetName).registerWriteHandler(horizontalCellStyleStrategy).doWrite(data);
response.getOutputStream().flush();
IOUtils.closeQuietly(response.getOutputStream());
}
/**
* 导出
*
* @param os
* @param data
* @param sheetName
* @param clazz
*/
public static void writeExcel(OutputStream os, List<? extends Object> data, String sheetName, Class clazz, String serviceProviderType) {
//表头样式
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
//设置表头居中对齐
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
WriteFont writeFont = new WriteFont();
writeFont.setFontHeightInPoints((short) 12);
headWriteCellStyle.setWriteFont(writeFont);
//内容样式
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
//设置内容靠左对齐
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.LEFT);
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
ExcelWriterBuilder head = EasyExcel.write(os).head(clazz);
// 针对广汇
if ("CustomerListExportModel".equals(clazz.getSimpleName()) && !PROVIDER_GUANG_HUI.getValue().equals(serviceProviderType)){
List<Integer> excludeColumnIndexes = Arrays.asList(23,24,25,26,27);
head = head.excludeColumnIndexes(excludeColumnIndexes);
}
head.excelType(ExcelTypeEnum.XLSX).sheet(sheetName).registerWriteHandler(horizontalCellStyleStrategy).doWrite(data);
}
/**
* 导出
*
* @param response
* @param data
* @param fileName
* @param sheetName
* @param head
* @throws Exception
*/
public static void writeExcel(HttpServletResponse response, List<? extends Object> data, String fileName, String sheetName, List<List<String>> head) throws Exception {
//表头样式
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
//设置表头居中对齐
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
WriteFont writeFont = new WriteFont();
writeFont.setFontHeightInPoints((short) 12);
headWriteCellStyle.setWriteFont(writeFont);
//内容样式
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
//设置内容靠左对齐
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.LEFT);
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
EasyExcel.write(getOutputStream(fileName, response)).head(head).excelType(ExcelTypeEnum.XLSX).sheet(sheetName).registerWriteHandler(horizontalCellStyleStrategy).doWrite(data);
response.getOutputStream().flush();
IOUtils.closeQuietly(response.getOutputStream());
}
/**
* 导出
*
* @param os
* @param data
* @param sheetName
* @param head
*/
public static void writeExcel(OutputStream os, List<? extends Object> data, String sheetName, List<List<String>> head) {
//表头样式
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
//设置表头居中对齐
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
WriteFont writeFont = new WriteFont();
writeFont.setFontHeightInPoints((short) 12);
headWriteCellStyle.setWriteFont(writeFont);
//内容样式
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
//设置内容靠左对齐
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.LEFT);
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
EasyExcel.write(os).head(head).excelType(ExcelTypeEnum.XLSX).sheet(sheetName).registerWriteHandler(horizontalCellStyleStrategy).doWrite(data);
}
private static OutputStream getOutputStream(String fileName, HttpServletResponse response) throws Exception {
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ExcelTypeEnum.XLSX.getValue());
response.setContentType("application/msexcel;charset=UTF-8");//设置类型
response.setHeader("Pragma", "No-cache");//设置头
response.setHeader("Cache-Control", "no-cache");//设置头
response.setDateHeader("Expires", 0);//设置日期头
return response.getOutputStream();
}
public void ExportFieldDelete(FileInputStream fileInputStream) throws IOException {
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(fileInputStream);
}
/**
* 删除列
* @param sheet
* @param columnToDelete
*/
private void deleteColumn(Sheet sheet, int columnToDelete) {
System.out.println(sheet.getLastRowNum());
for (int r = 0; r <= sheet.getLastRowNum(); r++) {
Row row = sheet.getRow(r);
for (int c = columnToDelete; c <= row.getLastCellNum(); c++) {
Cell cOld = row.getCell(c);
if (cOld != null) {
row.removeCell(cOld);
}
Cell cNext = row.getCell(c + 1);
if (cNext != null) {
Cell cNew = row.createCell(c, cNext.getCellType());
cloneCell(cNew, cNext);
if (r == 0) {
sheet.setColumnWidth(c, sheet.getColumnWidth(c + 1));
}
}
}
}
}
/**
* 右边列左移,样式值设置
* @param cNew
* @param cOld
*/
private void cloneCell(Cell cNew, Cell cOld) {
cNew.setCellComment(cOld.getCellComment());
cNew.setCellStyle(cOld.getCellStyle());
if (CellType.BOOLEAN == cNew.getCellType()) {
cNew.setCellValue(cOld.getBooleanCellValue());
} else if (CellType.NUMERIC == cNew.getCellType()) {
cNew.setCellValue(cOld.getNumericCellValue());
} else if (CellType.STRING == cNew.getCellType()) {
cNew.setCellValue(cOld.getStringCellValue());
} else if (CellType.ERROR == cNew.getCellType()) {
cNew.setCellValue(cOld.getErrorCellValue());
} else if (CellType.FORMULA == cNew.getCellType()) {
cNew.setCellValue(cOld.getCellFormula());
}
}
}
package cn.com.glsx.scrm.clue.util;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import org.apache.commons.io.output.ByteArrayOutputStream;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhouhaibao
* @version 1.0
* @description: 导出
* @date 2022/1/4 20:32
*/
public class ExcelExportUtils {
/**
* excel导出工具类
*
* @param filename excel名字
* @param list 导出数据
* @return
*/
public static String excelExport(String filename, List<? extends Object> list, Class clazz, String serviceProviderType) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
EasyExcelUtils.writeExcel(outputStream, list, filename, clazz, serviceProviderType);
byte[] bytes = outputStream.toByteArray();
FileUploadServerData fileUploadServerData = FileUploadUtil.uploadToFileSystem(filename, bytes, "xlsx");
return fileUploadServerData.getSecureUrl();
}
public static byte[] excelExportWithoutUpload(String filename, List<? extends Object> list, Class clazz, String serviceProviderType) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
EasyExcelUtils.writeExcel(outputStream, list, filename, clazz, serviceProviderType);
byte[] bytes = outputStream.toByteArray();
return bytes;
}
public static <T> String exportExcelTest(List<T> list,String fileName,Class<T> titleClass){
File savePath = new File("D:\\work\\mix\\download");
File outfile = new File(savePath, fileName);
EasyExcel.write(outfile, titleClass).sheet("sheet1").doWrite(list);
return outfile.getAbsolutePath();
}
}
package cn.com.glsx.scrm.clue.util;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
@SuppressWarnings("serial")
public class FileUploadServerData implements Serializable {
public static final int UPLOAD_SUCCSSS = 0; // "上传文件成功!",
public static final int UPLOAD_FAILURE = 1; // "上传文件失败!"),
//private static final int UPLOAD_TYPE_ERROR = 2; // "上传文件类型错误!"),
//private static final int UPLOAD_OVERSIZE = 3; // "上传文件过大!"),
//private static final int UPLOAD_ZEROSIZE = 4; // "上传文件为空!"),
//private static final int UPLOAD_NOTFOUND = 5; // "上传文件路径错误!")
private Integer status = 0;
private String message = "";
private String url = "";
private String systemSign;
private String filePath;
private String param1;
private String param2;
private String param3;
private String secureUrl;
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getSystemSign() {
return systemSign;
}
public void setSystemSign(String systemSign) {
this.systemSign = systemSign;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getParam1() {
return param1;
}
public void setParam1(String param1) {
this.param1 = param1;
}
public String getParam2() {
return param2;
}
public void setParam2(String param2) {
this.param2 = param2;
}
public String getParam3() {
return param3;
}
public void setParam3(String param3) {
this.param3 = param3;
}
public String getSecureUrl() {
return secureUrl;
}
public void setSecureUrl(String secureUrl) {
this.secureUrl = secureUrl;
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("{");
sb.append("status:" + this.status + ",");
sb.append("message:'" + this.message + "',");
sb.append("url:'" + this.url + "',");
sb.append("systemSign:'" + this.systemSign + "',");
sb.append("filePath:'" + this.filePath + "',");
sb.append("param1:'" + this.param1 + "',");
sb.append("param2:'" + this.param2 + "',");
sb.append("param3:'" + this.param3 + "'");
sb.append("secureUrl:'" + this.secureUrl + "'");
sb.append("}");
return sb.toString();
}
public FileUploadServerData() {
}
public FileUploadServerData(HttpServletRequest request) {
this.systemSign = request.getParameter("systemSign");
this.filePath = request.getParameter("filePath");
this.param1 = request.getParameter("param1");
this.param2 = request.getParameter("param2");
this.param3 = request.getParameter("param3");
}
}
package cn.com.glsx.scrm.clue.util;
import net.sf.json.JSONArray;
import org.apache.commons.codec.binary.Base64;
import org.oreframework.boot.env.OrePropertyConfigurer;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.List;
/**
* @author wangxw
* @version 1.0.0
* @ClassName FileUploadUtil.java
* @description: 文件上传操作类
* @createTime 2019年11月24日 14:29:00
*/
public class FileUploadUtil {
public static final String FILE_UPLOAD_URL = OrePropertyConfigurer.getString("file.system.upload.url") != null
? OrePropertyConfigurer.getString("file.system.upload.url") : "http://gfs.glsx.com.cn/file/upstring";
private static final String FILE_ZIP_URL = OrePropertyConfigurer.getString("file.system.upload.zip.url") != null
? OrePropertyConfigurer.getString("file.system.upload.zip.url") : "http://gfs.glsx.com.cn/file/zip";
private static final String FILE_UPLOAD_TEST_URL = "http://gfs.test.glsx.com.cn/file/upstring";
// blib 供应链
// biz 业务
private static final String dir_content = "biz";
/**
* 将文件上传至文件服务器
* @param uploadData
* @param fileType
* @return
*/
public static FileUploadServerData uploadToFileSystem(String fileName, byte[] uploadData, String fileType) {
RestTemplate restTemplate = new RestTemplate();
MultiValueMap<String, String> form = new LinkedMultiValueMap<String, String>();
form.add("systemSign", dir_content);
form.add("param1", fileName);
form.add("files", fileType + "@" + Base64.encodeBase64String(uploadData));
// return restTemplate.postForObject(FILE_UPLOAD_URL, form, FileUploadServerData.class);
return restTemplate.postForObject(FILE_UPLOAD_URL, form, FileUploadServerData.class);
}
/**
* 将文件压缩至文件服务器
* @param filePathList
* @param
* @return
*/
public static FileUploadServerData zipToFileSystem(List filePathList) {
RestTemplate restTemplate = new RestTemplate();
MultiValueMap<String, String> form = new LinkedMultiValueMap<String, String>();
form.add("systemSign", dir_content + "zip");
form.add("filePath", "");
form.add("param1", "");
form.add("param2", "");
form.add("param3", "");
form.add("zipfiles", JSONArray.fromObject(filePathList).toString());
return restTemplate.postForObject(FILE_ZIP_URL, form, FileUploadServerData.class);
}
}
package cn.com.glsx.scrm.clue.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/11/23 21:38
*/
public class GopUtils {
/**
* 使用<code>secret</code>对paramValues按以下算法进行签名: <br/>
* uppercase(hex(sha1(secretkey1value1key2value2...secret))
*
* 需要签名的参数名
* @param paramValues
* 参数列表
* @param secret
* @return
*/
public static String sign(Map<String, String> paramValues, String secret) {
return sign(paramValues, null, secret);
}
/**
* 对paramValues进行签名,其中ignoreParamNames这些参数不参与签名
*
* @param paramValues
* @param ignoreParamNames
* @param secret
* @return
*/
public static String sign(Map<String, String> paramValues, List<String> ignoreParamNames, String secret) {
//try {
StringBuilder sb = new StringBuilder();
List<String> paramNames = new ArrayList<String>(paramValues.size());
paramNames.addAll(paramValues.keySet());
if (ignoreParamNames != null && ignoreParamNames.size() > 0) {
for (String ignoreParamName : ignoreParamNames) {
paramNames.remove(ignoreParamName);
}
}
Collections.sort(paramNames);
sb.append(secret);
for (String paramName : paramNames) {
sb.append(paramName).append(paramValues.get(paramName));
}
sb.append(secret);
/*byte[] sha1Digest = getSHA1Digest(sb.toString());
return byte2hex(sha1Digest);*/
return MD5.convert32(sb.toString());
/*} catch (IOException e) {
throw new GopException(e);
}*/
}
}
package cn.com.glsx.scrm.clue.util;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.Date;
public class LocalDateUtils {
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
public static final String TIME_START = " 00:00:00";
public static final String TIME_END = " 23:59:59";
/**
* 获取上周开始日期
* @param currentDate
* @return yyyy-MM-dd
*/
public static String getLastWeekStartDate(LocalDate currentDate) {
LocalDate startOfLastWeek = currentDate.minusWeeks(1).with(DayOfWeek.MONDAY);
return startOfLastWeek.format(formatter);
}
/**
* 获取上周结束日期
* @param currentDate
* @return yyyy-MM-dd
*/
public static String getLastWeekEndDate(LocalDate currentDate) {
LocalDate endOfLastWeek = currentDate.minusWeeks(1).with(DayOfWeek.SUNDAY);
return endOfLastWeek.format(formatter);
}
/**
* 获取上月结束日期
* @param currentDate
* @return yyyy-MM-dd
*/
public static String getLastMonthEndDate(LocalDate currentDate) {
YearMonth lastMonth = YearMonth.from(currentDate.minusMonths(1));
LocalDate lastDayOfLastMonth = lastMonth.atEndOfMonth();
return lastDayOfLastMonth.format(formatter);
}
/**
* 获取上月结束日期
* @param currentDate
* @return yyyy-MM-dd
*/
public static String getLastMonthStartDate(LocalDate currentDate) {
YearMonth lastMonth = YearMonth.from(currentDate.minusMonths(1));
LocalDate firstDayOfLastMonth = lastMonth.atDay(1);
return firstDayOfLastMonth.format(formatter);
}
/**
* 将LocalDate转换为java.util.Date
*/
public static Date convertToDate(LocalDate localDate) {
return Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
}
/**
* 将java.util.Date转换为LocalDate
* @param date
* @return
*/
public static LocalDate convertToLocalDate(Date date) {
return Instant.ofEpochMilli(date.getTime())
.atZone(ZoneId.systemDefault())
.toLocalDate();
}
}
package cn.com.glsx.scrm.clue.util;
import java.security.MessageDigest;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/11/23 21:39
*/
public class MD5 {
/**
* 32位MD5加密算法
* @param s
* @return
*/
public static String convert32(String s){
char hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
try {
byte[] bytes = s.getBytes();
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(bytes);
bytes = md.digest();
int j = bytes.length;
char[] chars = new char[j * 2];
int k = 0;
for (int i = 0; i < bytes.length; i++) {
byte b = bytes[i];
chars[k++] = hexChars[b >>> 4 & 0xf];
chars[k++] = hexChars[b & 0xf];
}
return new String(chars);
}
catch (Exception e){
return null;
}
}
/**
* 16位MD5加密算法
* @param s
* @return
*/
public static String convert16(String s){
char hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
try {
byte[] bytes = s.getBytes();
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(bytes);
bytes = md.digest();
int j = bytes.length;
char[] chars = new char[j * 2];
int k = 0;
for (int i = 0; i < bytes.length; i++) {
byte b = bytes[i];
chars[k++] = hexChars[b >>> 4 & 0xf];
chars[k++] = hexChars[b & 0xf];
}
return new String(chars).substring(8, 24);
}
catch (Exception e){
return null;
}
}
}
package cn.com.glsx.scrm.clue.util;
import org.apache.commons.lang.StringUtils;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.DefaultUriBuilderFactory;
import org.springframework.web.util.UriBuilder;
import java.net.URI;
import java.util.Map;
import java.util.Map.Entry;
/**
* @author zhouhaibao
* @version 1.0
* @description: http调用rop端服务
* @date 2021/7/30 11:26
*/
public class RopHttpUtil {
private final static String appKey = "48e5e13229b82c1b4e6e8c96151f0637";
private final static String secret = "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b";
private static void addBaseParam(MultiValueMap<String, String> paramsMap, String method) {
paramsMap.add("v", "1.0.0");
paramsMap.add("method", method);
paramsMap.add("name", "zhouhb");
}
private static void addBaseParamE(MultiValueMap<String, String> paramsMap, String method) {
paramsMap.add("v", "1.0.0");
paramsMap.add("method", method);
}
public static <T> T get(MultiValueMap<String, String> paramsMap, Class<T> responseType, String baseurl, String method) throws Exception {
addBaseParam(paramsMap, method);
MultiValueMap<String, String> params = getSysParams();
params.putAll(paramsMap);
for (Entry<String, String> entry : params.toSingleValueMap().entrySet()) {
if (StringUtils.isEmpty(entry.getValue())) {
params.remove(entry.getKey());
}
}
String sign = RopUtils.sign(params.toSingleValueMap(), secret);
params.add("sign", sign);
RestTemplate rest = new RestTemplate();
RopUriTemplateHandler uriTemplateHandler = new RopUriTemplateHandler(baseurl);
uriTemplateHandler.setDefaultUriVariables(params.toSingleValueMap());
rest.setUriTemplateHandler(uriTemplateHandler);
T forObject = rest.getForObject(baseurl, responseType, params.toSingleValueMap());
return forObject;
}
public static <T> T post(MultiValueMap<String, String> paramsMap, Class<T> responseType, String baseurl, String method) throws Exception {
addBaseParam(paramsMap, method);
MultiValueMap<String, String> params = getSysParams();
params.putAll(paramsMap);
for (Entry<String, String> entry : params.toSingleValueMap().entrySet()) {
if (StringUtils.isEmpty(entry.getValue())) {
params.remove(entry.getKey());
}
}
String sign = RopUtils.sign(params.toSingleValueMap(), secret);
params.add("sign", sign);
return new RestTemplate().postForObject(baseurl, params, responseType);
}
public static <T> T postE(MultiValueMap<String, String> paramsMap, Class<T> responseType, String baseurl, String method) throws Exception {
addBaseParamE(paramsMap, method);
MultiValueMap<String, String> params = getSysParamsE();
params.putAll(paramsMap);
for (Entry<String, String> entry : params.toSingleValueMap().entrySet()) {
if (StringUtils.isEmpty(entry.getValue())) {
params.remove(entry.getKey());
}
}
String sign = GopUtils.sign(params.toSingleValueMap(), secret);
params.add("sign", sign);
return new RestTemplate().postForObject(baseurl, params, responseType);
}
public static MultiValueMap<String, String> getSysParams() {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(16);
params.add("appKey", appKey);
params.add("format", "json");
return params;
}
public static MultiValueMap<String, String> getSysParamsE() {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(16);
params.add("app_key", appKey);
params.add("format", "json");
params.add("timestamp", System.currentTimeMillis() + "");
return params;
}
static class RopUriTemplateHandler extends DefaultUriBuilderFactory {
public RopUriTemplateHandler(String baseUriTemplate) {
super(baseUriTemplate);
}
@Override
public URI expand(String uriTemplate, Map<String, ?> uriVars) {
UriBuilder builder = uriString(uriTemplate);
if (uriVars != null && !uriVars.isEmpty()) {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
for (Entry<String, ?> entry : uriVars.entrySet()) {
params.add(entry.getKey(), entry.getValue().toString());
}
builder.queryParams(params);
}
return builder.build(uriVars);
}
}
}
package cn.com.glsx.scrm.clue.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.util.*;
public class RopUtils {
private static final Logger logger = LoggerFactory.getLogger(RopUtils.class);
public RopUtils() {
}
public static String sign(Map<String, String> paramValues, String secret) {
return sign(paramValues, (List) null, secret);
}
public static String sign(Map<String, String> paramValues, List<String> ignoreParamNames, String secret) {
try {
StringBuilder sb = new StringBuilder();
List<String> paramNames = new ArrayList(paramValues.size());
paramNames.addAll(paramValues.keySet());
Iterator var5;
String paramName;
if (ignoreParamNames != null && ignoreParamNames.size() > 0) {
var5 = ignoreParamNames.iterator();
while (var5.hasNext()) {
paramName = (String) var5.next();
paramNames.remove(paramName);
}
}
Collections.sort(paramNames);
sb.append(secret);
var5 = paramNames.iterator();
while (var5.hasNext()) {
paramName = (String) var5.next();
sb.append(paramName).append((String) paramValues.get(paramName));
}
sb.append(secret);
byte[] sha1Digest = getSHA1Digest(sb.toString());
return byte2hex(sha1Digest);
} catch (IOException var7) {
logger.info("异常信息", var7);
return null;
}
}
public static String utf8Encoding(String value, String sourceCharsetName) {
try {
return new String(value.getBytes(sourceCharsetName), "UTF-8");
} catch (UnsupportedEncodingException var3) {
throw new IllegalArgumentException(var3);
}
}
private static byte[] getSHA1Digest(String data) throws IOException {
Object var1 = null;
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
byte[] bytes = md.digest(data.getBytes("UTF-8"));
return bytes;
} catch (GeneralSecurityException var3) {
throw new IOException(var3);
}
}
private static byte[] getMD5Digest(String data) throws IOException {
Object var1 = null;
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] bytes = md.digest(data.getBytes("UTF-8"));
return bytes;
} catch (GeneralSecurityException var3) {
throw new IOException(var3);
}
}
private static String byte2hex(byte[] bytes) {
StringBuilder sign = new StringBuilder();
for (int i = 0; i < bytes.length; ++i) {
String hex = Integer.toHexString(bytes[i] & 255);
if (hex.length() == 1) {
sign.append("0");
}
sign.append(hex.toUpperCase());
}
return sign.toString();
}
public static String getUUID() {
UUID uuid = UUID.randomUUID();
return uuid.toString().toUpperCase();
}
}
package cn.com.glsx.scrm.clue.util;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @Description 服务商类型枚举
* @author chizw
* @create 2022/5/30 10:40
* @version ver.1.0.0
*/
@AllArgsConstructor
@Getter
public enum ScrmServiceProviderTypeEnum {
PROVIDER_GUANG_LIAN("广联服务商","GL"),
PROVIDER_GUANG_HUI("广汇服务商","GH");
private final String ServiceProviderName;
private final String value;
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.scrm.clue.mapper.BurialPointEventInfoMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.scrm.clue.model.BurialPointEventInfo" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="event_code" property="eventCode" jdbcType="VARCHAR" />
<result column="event_name" property="eventName" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, event_code, event_name
</sql>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.scrm.clue.mapper.BurialPointRecordMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.scrm.clue.model.BurialPointRecord" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="login_account" property="loginAccount" jdbcType="VARCHAR" />
<result column="user_type" property="userType" jdbcType="INTEGER" />
<result column="uuid" property="uuid" jdbcType="VARCHAR" />
<result column="system_source" property="systemSource" jdbcType="INTEGER" />
<result column="visitor_id" property="visitorId" jdbcType="VARCHAR" />
<result column="event_time" property="eventTime" jdbcType="TIMESTAMP" />
<result column="event_type" property="eventType" jdbcType="INTEGER" />
<result column="pre_page_path" property="prePagePath" jdbcType="VARCHAR" />
<result column="page_path" property="pagePath" jdbcType="VARCHAR" />
<result column="event_code" property="eventCode" jdbcType="VARCHAR" />
<result column="batch_id" property="batchId" jdbcType="VARCHAR" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="cn.com.glsx.scrm.clue.model.BurialPointRecord" extends="BaseResultMap" >
<!--
WARNING - @mbg.generated
-->
<result column="business_param" property="businessParam" jdbcType="LONGVARCHAR" />
</resultMap>
<resultMap id="SummaryMap" type="cn.com.glsx.scrm.clue.dto.BurialPointSummaryDTO" >
<result column="event_code" property="eventCode"/>
<result column="scene" property="scene" />
<result column="clickCount" property="clickCount" />
<result column="usersCount" property="usersCount"/>
</resultMap>
<resultMap id="SummaryWithBusinessIdMap" type="cn.com.glsx.scrm.clue.dto.SceneMarketBurialPointExcel" >
<result column="scene" property="scene" />
<result column="business_id" property="businessId"/>
<result column="clickCount" property="clickCount" />
<result column="usersCount" property="usersCount"/>
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, login_account, user_type, uuid, system_source, visitor_id, event_time, event_type,
pre_page_path, page_path, event_code, batch_id, created_time, deleted_flag
</sql>
<sql id="Blob_Column_List" >
<!--
WARNING - @mbg.generated
-->
business_param
</sql>
<select id="summaryBurialPointWithScene" parameterType="cn.com.glsx.scrm.clue.dto.BurialPointSummaryParam" resultMap="SummaryMap">
select scene,event_code, count(*) as clickCount, count(distinct uuid) as usersCount
from clue_burial_point_record
<include refid="summaryCondition"></include>
group by scene, event_code
</select>
<select id="summaryBurialPointGroupByScene" parameterType="cn.com.glsx.scrm.clue.dto.BurialPointSummaryParam" resultMap="SummaryMap">
select scene, count(*) as clickCount, count(distinct uuid) as usersCount
from clue_burial_point_record
<include refid="summaryCondition"></include>
group by scene
</select>
<select id="summaryBurialPointWithBusinessId" parameterType="cn.com.glsx.scrm.clue.dto.BurialPointSummaryParam" resultMap="SummaryWithBusinessIdMap">
select scene, business_id,count(*) as clickCount, count(distinct uuid) as usersCount
from clue_burial_point_record
<include refid="summaryCondition"></include>
group by scene, business_id
order by scene
</select>
<select id="summaryBurialPointGroupByBusinessId" parameterType="cn.com.glsx.scrm.clue.dto.BurialPointSummaryParam" resultMap="SummaryWithBusinessIdMap">
select scene, business_id,count(*) as clickCount, count(distinct uuid) as usersCount
from clue_burial_point_record
<include refid="summaryCondition"></include>
group by scene, business_id
order by scene
</select>
<select id="summaryBurialPoint" resultMap="SummaryMap">
select event_code, count(*) as clickCount, count(distinct uuid) as usersCount from clue_burial_point_record
<include refid="summaryCondition"></include>
group by event_code
</select>
<sql id="summaryCondition">
<where>
deleted_flag = 'N'
<if test="codeList != null">
and event_code in
<foreach collection="codeList" item="code" index="index" open="(" close=")">
<if test="index != 0">
<choose>
<when test="(index % 999) == 998">
) or event_code in (
</when>
<otherwise>
,
</otherwise>
</choose>
</if>
#{code}
</foreach>
</if>
<if test="eventTypes != null and eventTypes.size() > 0">
and event_type in
<foreach item="item" collection="eventTypes" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="scene != null">
and scene = #{scene}
</if>
<if test="systemSource != null">
and system_source = #{systemSource}
</if>
<if test="startTime != null">
and event_time &gt;= #{startTime}
</if>
<if test="endTime != null">
and event_time &lt;= #{endTime}
</if>
<if test="eventType != null">
and event_type = #{eventType}
</if>
</where>
</sql>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.scrm.clue.mapper.ClueOrderFollowMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.scrm.clue.model.ClueOrderFollow" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="order_id" property="orderId" jdbcType="INTEGER" />
<result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="user_id" property="userId" jdbcType="VARCHAR" />
<result column="user_name" property="userName" jdbcType="VARCHAR" />
<result column="follow_date" property="followDate" jdbcType="TIMESTAMP" />
<result column="type" property="type" jdbcType="VARCHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, merchant_id, order_id, remark, user_id, user_name, follow_date, created_by, created_date,
updated_by, updated_date, deleted_flag, type
</sql>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.scrm.clue.mapper.ClueOrderMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.scrm.clue.model.ClueOrder" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="VARCHAR" />
<result column="appointment_type" property="appointmentType" jdbcType="VARCHAR" />
<result column="channel_type" property="channelType" jdbcType="VARCHAR" />
<result column="order_no" property="orderNo" jdbcType="VARCHAR" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
<result column="merchant_phone" property="merchantPhone" jdbcType="VARCHAR" />
<result column="plate_num" property="plateNum" jdbcType="VARCHAR" />
<result column="comment" property="comment" jdbcType="VARCHAR" />
<result column="feedback_img_url" property="feedbackImgUrl" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<result column="plate_date" property="plateDate" jdbcType="TIMESTAMP" />
<result column="mileage" property="mileage" jdbcType="VARCHAR" />
<result column="rescue_date" property="rescueDate" jdbcType="TIMESTAMP" />
<result column="rescue_address" property="rescueAddress" jdbcType="VARCHAR" />
<result column="rescue_type" property="rescueType" jdbcType="VARCHAR" />
<result column="appointment_date" property="appointmentDate" jdbcType="TIMESTAMP" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
<result column="account_id" property="accountId" jdbcType="INTEGER" />
<result column="user_id" property="userId" jdbcType="VARCHAR" />
<result column="user_name" property="userName" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="VARCHAR" />
<result column="vehicle_brand_id" property="vehicleBrandId" jdbcType="INTEGER" />
<result column="vehicle_brand_name" property="vehicleBrandName" jdbcType="VARCHAR" />
<result column="vehicle_sub_brand_id" property="vehicleSubBrandId" jdbcType="INTEGER" />
<result column="vehicle_sub_brand_name" property="vehicleSubBrandName" jdbcType="VARCHAR" />
<result column="vehicle_series_id" property="vehicleSeriesId" jdbcType="INTEGER" />
<result column="vehicle_series_name" property="vehicleSeriesName" jdbcType="VARCHAR" />
<result column="vehicle_shape_id" property="vehicleShapeId" jdbcType="INTEGER" />
<result column="vehicle_shape_name" property="vehicleShapeName" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.scrm.clue.dto.ClueOrderDTO" extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, type, appointment_type, channel_type, order_no, merchant_id, merchant_name, merchant_phone,
plate_num, comment, feedback_img_url, name, phone, plate_date, mileage, rescue_date,
rescue_address, appointment_date, created_by, created_date,
updated_by, updated_date, deleted_flag, account_id, user_id, user_name, status, vehicle_brand_id, vehicle_brand_name,
vehicle_sub_brand_id, vehicle_sub_brand_name, vehicle_series_id, vehicle_series_name,
vehicle_shape_id, vehicle_shape_name, rescue_type
</sql>
<select id="list" parameterType="cn.com.glsx.scrm.clue.dto.ClueOrderDTO" resultMap="DTOResultMap">
select <include refid="Base_Column_List"></include>
from clue_order
<where>
deleted_flag = 'N'
<if test="id != null">
and id = #{id}
</if>
<if test="keyword != null and keyword != ''">
and (name like CONCAT('%', #{keyword},'%') or phone = #{keyword})
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="userName != null and userName != ''">
and user_name like CONCAT('%', #{userName},'%')
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
<if test="accountId != null and accountId != ''">
and account_id = #{accountId}
</if>
<if test="channelType != null and channelType != ''">
and channel_type = #{channelType}
</if>
<if test="userId != null and userId != ''">
and user_id = #{userId}
</if>
</where>
order by created_date desc
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.scrm.clue.mapper.ClueStaffMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.scrm.clue.model.ClueStaff" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="VARCHAR" />
<result column="user_id" property="userId" jdbcType="VARCHAR" />
<result column="user_uuid" property="userUuid" jdbcType="VARCHAR" />
<result column="user_name" property="userName" jdbcType="VARCHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, merchant_id, type, user_id, user_uuid, user_name, created_by, created_date, updated_by,
updated_date, deleted_flag
</sql>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.scrm.clue.mapper.ClueVehicleMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.scrm.clue.model.ClueVehicle" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="vehicle_brand_id" property="vehicleBrandId" jdbcType="INTEGER" />
<result column="vehicle_brand_name" property="vehicleBrandName" jdbcType="VARCHAR" />
<result column="vehicle_sub_brand_id" property="vehicleSubBrandId" jdbcType="INTEGER" />
<result column="vehicle_sub_brand_name" property="vehicleSubBrandName" jdbcType="VARCHAR" />
<result column="vehicle_series_id" property="vehicleSeriesId" jdbcType="INTEGER" />
<result column="vehicle_series_name" property="vehicleSeriesName" jdbcType="VARCHAR" />
<result column="vehicle_shape_id" property="vehicleShapeId" jdbcType="INTEGER" />
<result column="vehicle_shape_name" property="vehicleShapeName" jdbcType="VARCHAR" />
<result column="guide_price" property="guidePrice" jdbcType="VARCHAR" />
<result column="show_image_url" property="showImageUrl" jdbcType="VARCHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
<result column="status" property="status" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.scrm.clue.dto.ClueVehicleDTO" extends="BaseResultMap">
<result column="guide_price_min" property="guidePriceMin" jdbcType="VARCHAR" />
<result column="guide_price_max" property="guidePriceMax" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, merchant_id, vehicle_brand_id, vehicle_brand_name, vehicle_sub_brand_id, vehicle_sub_brand_name,
vehicle_series_id, vehicle_series_name, vehicle_shape_id, vehicle_shape_name, guide_price,
show_image_url, created_by, created_date, updated_by, updated_date, deleted_flag, status
</sql>
<select id="getBrandList" parameterType="cn.com.glsx.scrm.clue.model.ClueVehicle" resultMap="BaseResultMap">
select vehicle_brand_id, vehicle_brand_name
from clue_vehicle
<where>
deleted_flag = 'N' and status = '1'
<if test="vehicleBrandName != null and vehicleBrandName != ''">
and vehicle_brand_name like CONCAT('%', #{vehicleBrandName},'%')
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</where>
group by vehicle_brand_id
</select>
<select id="getSubBrandList" parameterType="cn.com.glsx.scrm.clue.model.ClueVehicle" resultMap="BaseResultMap">
select vehicle_brand_id, vehicle_brand_name, vehicle_sub_brand_id, vehicle_sub_brand_name
from clue_vehicle
<where>
deleted_flag = 'N' and status = '1'
<if test="vehicleBrandId != null and vehicleBrandId != ''">
and vehicle_brand_id = #{vehicleBrandId}
</if>
<if test="vehicleSubBrandName != null and vehicleSubBrandName != ''">
and (vehicle_sub_brand_name like CONCAT('%', #{vehicleSubBrandName},'%'))
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</where>
group by vehicle_sub_brand_id
</select>
<select id="getSeriesList" parameterType="cn.com.glsx.scrm.clue.dto.ClueVehicleDTO" resultMap="DTOResultMap">
select vehicle_brand_id, vehicle_brand_name, vehicle_sub_brand_id, vehicle_sub_brand_name, vehicle_series_id, vehicle_series_name,
max(guide_price) as guide_price_max, min(guide_price) as guide_price_min, show_image_url
from clue_vehicle
<where>
deleted_flag = 'N' and status = '1'
<if test="vehicleBrandId != null and vehicleBrandId != ''">
and vehicle_brand_id = #{vehicleBrandId}
</if>
<if test="vehicleSubBrandId != null and vehicleSubBrandId != ''">
and vehicle_sub_brand_id = #{vehicleSubBrandId}
</if>
<if test="vehicleSeriesName != null and vehicleSeriesName != ''">
and vehicle_series_name like CONCAT('%', #{vehicleSeriesName},'%')
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</where>
group by vehicle_series_id
</select>
<select id="getShapeList" parameterType="cn.com.glsx.scrm.clue.dto.ClueVehicleDTO" resultMap="DTOResultMap">
select <include refid="Base_Column_List"></include>
from clue_vehicle
<where>
deleted_flag = 'N' and status = '1'
<if test="vehicleBrandId != null and vehicleBrandId != ''">
and vehicle_brand_id = #{vehicleBrandId}
</if>
<if test="vehicleSubBrandId != null and vehicleSubBrandId != ''">
and vehicle_sub_brand_id = #{vehicleSubBrandId}
</if>
<if test="vehicleSeriesId != null and vehicleSeriesId != ''">
and vehicle_series_id = #{vehicleSeriesId}
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</where>
</select>
<select id="list" parameterType="cn.com.glsx.scrm.clue.dto.ClueVehicleDTO" resultMap="DTOResultMap">
select <include refid="Base_Column_List"></include>
from clue_vehicle
<where>
deleted_flag = 'N'
<if test="id != null">
and id = #{id}
</if>
<if test="vehicleSeriesName != null and vehicleSeriesName != ''">
and vehicle_series_name like CONCAT('%', #{vehicleSeriesName},'%')
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.scrm.clue.mapper.CollisionInfoMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.scrm.clue.entity.collision.CollisionInfo" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="sn" property="sn" jdbcType="VARCHAR" />
<result column="collision_time" property="collisionTime" jdbcType="TIMESTAMP" />
<result column="collision_type" property="collisionType" jdbcType="VARCHAR" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="longitude" property="longitude" jdbcType="VARCHAR" />
<result column="latitude" property="latitude" jdbcType="VARCHAR" />
<result column="follow_status" property="followStatus" jdbcType="INTEGER" />
<result column="follow_result" property="followResult" jdbcType="INTEGER" />
<result column="follow_time" property="followTime" jdbcType="TIMESTAMP" />
<result column="follow_remark" property="followRemark" jdbcType="VARCHAR" />
<result column="task_id" property="taskId" jdbcType="VARCHAR" />
<result column="del_flag" property="delFlag" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP" />
</resultMap>
<resultMap id="CollisionInfoMap" type="cn.com.glsx.scrm.clue.model.response.collision.CollisionInfoRpcResponse">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="sn" property="sn" jdbcType="VARCHAR" />
<result column="collision_time" property="collisionTime" jdbcType="TIMESTAMP" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="follow_status" property="followStatus" jdbcType="INTEGER" />
<result column="follow_result" property="followResult" jdbcType="INTEGER" />
<result column="follow_time" property="followTime" jdbcType="TIMESTAMP" />
<result column="follow_remark" property="followRemark" jdbcType="VARCHAR" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
<result column="sn_type" property="snType" jdbcType="INTEGER" />
<result column="customer_name" property="customerName" jdbcType="VARCHAR" />
<result column="customer_phone" property="customerPhone" jdbcType="VARCHAR" />
<result column="license_plate" property="licensePlate" jdbcType="VARCHAR" />
<result column="stand_no" property="standNo" jdbcType="VARCHAR" />
<result column="vehicle_shape_name" property="vehicleShapeName" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="CollisionDetailInfoMap" type="cn.com.glsx.scrm.clue.model.response.collision.CollisionDetailInfoRpcResponse">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="sn" property="sn" jdbcType="VARCHAR" />
<result column="collision_time" property="collisionTime" jdbcType="TIMESTAMP" />
<result column="longitude" property="longitude" jdbcType="VARCHAR" />
<result column="latitude" property="latitude" jdbcType="VARCHAR" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="follow_status" property="followStatus" jdbcType="INTEGER" />
<result column="follow_result" property="followResult" jdbcType="INTEGER" />
<result column="follow_time" property="followTime" jdbcType="TIMESTAMP" />
<result column="follow_remark" property="followRemark" jdbcType="VARCHAR" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
<result column="sn_type" property="snType" jdbcType="INTEGER" />
<result column="customer_name" property="customerName" jdbcType="VARCHAR" />
<result column="customer_phone" property="customerPhone" jdbcType="VARCHAR" />
<result column="license_plate" property="licensePlate" jdbcType="VARCHAR" />
<result column="stand_no" property="standNo" jdbcType="VARCHAR" />
<result column="vehicle_sub_brand_name" property="vehicleSubBrandName" jdbcType="VARCHAR" />
<result column="vehicle_series_name" property="vehicleSeriesName" jdbcType="VARCHAR" />
<result column="task_id" property="taskId" jdbcType="VARCHAR" />
<result column="vehicle_shape_name" property="vehicleShapeName" jdbcType="VARCHAR" />
<collection property="mediaDetailList" ofType="cn.com.glsx.scrm.clue.model.response.collision.CollisionMediaDetail">
<result column="media_type" property="mediaType" jdbcType="VARCHAR" />
<result column="file_url" property="fileUrl" jdbcType="VARCHAR" />
</collection>
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, sn, collision_time, collision_type, address, longitude, latitude, follow_status,
follow_result, follow_time, follow_remark, task_id, del_flag, created_by, created_time,
updated_by, updated_time
</sql>
<select id="listCollisionInfo" parameterType="cn.com.glsx.scrm.clue.model.request.collision.CollisionInfoSearchRpcRequest" resultMap="CollisionInfoMap">
select sci.id ,sci.sn,sci.collision_time ,sci.address ,sci.follow_status ,sci.follow_result ,sci.follow_time ,sci.follow_remark, sci.updated_by,
scsi.merchant_id ,scsi.merchant_name ,scsi.customer_name ,scsi.customer_phone ,scsi.sn_type ,scsi.license_plate ,scsi.stand_no,scsi.vehicle_shape_name
from scrm_collision_info sci
left join scrm_collision_sn_info scsi on sci.sn = scsi.sn and scsi.del_flag = 0
<where>
sci.del_flag = 0
<if test="sn != null and sn != ''">
and sci.sn like '%${sn}%'
</if>
<if test="merchantName != null and merchantName != ''">
and scsi.merchant_name like '%${merchantName}%'
</if>
<if test="merchantNo != null and operate==true">
and scsi.merchant_id = #{merchantNo}
</if>
<if test="merchantId!=null and operate==false">
AND scsi.merchant_id = #{merchantId}
</if>
<if test="snType != null">
and scsi.sn_type =#{snType}
</if>
<if test="customerPhone != null and customerPhone != ''">
and scsi.customer_phone like '%${customerPhone}%'
</if>
<if test="customerName != null and customerName != ''">
and scsi.customer_name like '%${customerName}%'
</if>
<if test="licensePlate != null and licensePlate != ''">
and scsi.license_plate like '%${licensePlate}%'
</if>
<if test="standNo != null and standNo != ''">
and scsi.stand_no like '%${standNo}%'
</if>
<if test="followStatus != null">
and sci.follow_status = #{followStatus}
</if>
<if test="followResult != null">
and sci.follow_result = #{followResult}
</if>
<if test="beginFollowTime != null">
and sci.follow_time &gt;= #{beginFollowTime}
</if>
<if test="endFollowTime != null">
and sci.follow_time &lt;= #{endFollowTime}
</if>
<if test="beginCollisionTime != null">
and sci.collision_time &gt;= #{beginCollisionTime}
</if>
<if test="endCollisionTime != null">
and sci.collision_time &lt;= #{endCollisionTime}
</if>
</where>
order by sci.collision_time desc
</select>
<select id="getDetailById" resultMap="CollisionDetailInfoMap">
select sci.id ,sci.sn,sci.collision_time ,sci.address ,sci.follow_status ,sci.follow_result ,sci.follow_time ,sci.follow_remark, sci.updated_by,sci.task_id,
scsi.merchant_id ,scsi.merchant_name ,scsi.customer_name ,scsi.customer_phone ,scsi.sn_type ,scsi.license_plate ,scsi.stand_no,scsi.vehicle_sub_brand_name,
scsi.vehicle_series_name,scmi.file_url,scmi.media_type,scsi.vehicle_shape_name,sci.longitude,sci.latitude
from scrm_collision_info sci
left join scrm_collision_sn_info scsi on sci.sn = scsi.sn and scsi.del_flag = 0
left join scrm_collision_media_info scmi on sci.task_id = scmi.task_id and scmi.del_flag = 0
<where>
sci.del_flag = 0 and sci.id = #{id}
</where>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.scrm.clue.mapper.CollisionMediaInfoMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.scrm.clue.entity.collision.CollisionMediaInfo" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="task_id" property="taskId" jdbcType="VARCHAR" />
<result column="file_url" property="fileUrl" jdbcType="VARCHAR" />
<result column="media_type" property="mediaType" jdbcType="VARCHAR" />
<result column="del_flag" property="delFlag" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, task_id, file_url, media_type, del_flag, created_by, created_time, updated_by,
updated_time
</sql>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.scrm.clue.mapper.CollisionPushConfigMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.scrm.clue.entity.collision.CollisionPushConfig" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
<result column="push_flag" property="pushFlag" jdbcType="INTEGER" />
<result column="start_time" property="startTime" jdbcType="VARCHAR" />
<result column="end_time" property="endTime" jdbcType="VARCHAR" />
<result column="config_type" property="configType" jdbcType="INTEGER" />
<result column="push_phones" property="pushPhones" jdbcType="VARCHAR" />
<result column="push_content" property="pushContent" jdbcType="VARCHAR" />
<result column="del_flag" property="delFlag" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, merchant_id,merchant_name, push_flag, start_time, end_time, config_type, push_phones, push_content,
del_flag, created_by, created_time, updated_by, updated_time
</sql>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.scrm.clue.mapper.CollisionSnInfoMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.scrm.clue.entity.collision.CollisionSnInfo" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="sn" property="sn" jdbcType="VARCHAR" />
<result column="batch_id" property="batchId" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
<result column="sn_type" property="snType" jdbcType="INTEGER" />
<result column="iccid" property="iccid" jdbcType="VARCHAR" />
<result column="customer_name" property="customerName" jdbcType="VARCHAR" />
<result column="customer_phone" property="customerPhone" jdbcType="VARCHAR" />
<result column="customer_sex" property="customerSex" jdbcType="INTEGER" />
<result column="license_plate" property="licensePlate" jdbcType="VARCHAR" />
<result column="stand_no" property="standNo" jdbcType="VARCHAR" />
<result column="initial_mileage" property="initialMileage" jdbcType="BIGINT" />
<result column="last_mileage" property="lastMileage" jdbcType="BIGINT" />
<result column="last_time" property="lastTime" jdbcType="TIMESTAMP" />
<result column="lower_mileage" property="lowerMileage" jdbcType="BIGINT" />
<result column="lower_time" property="lowerTime" jdbcType="TIMESTAMP" />
<result column="replace_flag" property="replaceFlag" jdbcType="INTEGER" />
<result column="vehicle_brand_id" property="vehicleBrandId" jdbcType="INTEGER" />
<result column="vehicle_brand_name" property="vehicleBrandName" jdbcType="VARCHAR" />
<result column="vehicle_sub_brand_id" property="vehicleSubBrandId" jdbcType="INTEGER" />
<result column="vehicle_sub_brand_name" property="vehicleSubBrandName" jdbcType="VARCHAR" />
<result column="vehicle_series_id" property="vehicleSeriesId" jdbcType="INTEGER" />
<result column="vehicle_series_name" property="vehicleSeriesName" jdbcType="VARCHAR" />
<result column="vehicle_shape_id" property="vehicleShapeId" jdbcType="INTEGER" />
<result column="vehicle_shape_name" property="vehicleShapeName" jdbcType="VARCHAR" />
<result column="del_flag" property="delFlag" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP" />
</resultMap>
<resultMap id="BaseResultMap1" type="cn.com.glsx.scrm.clue.dto.collision.CollisionSnInfoDTO" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="sn" property="sn" jdbcType="VARCHAR" />
<result column="batch_id" property="batchId" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
<result column="sn_type" property="snType" jdbcType="INTEGER" />
<result column="iccid" property="iccid" jdbcType="VARCHAR" />
<result column="customer_name" property="customerName" jdbcType="VARCHAR" />
<result column="customer_phone" property="customerPhone" jdbcType="VARCHAR" />
<result column="customer_sex" property="customerSex" jdbcType="INTEGER" />
<result column="license_plate" property="licensePlate" jdbcType="VARCHAR" />
<result column="stand_no" property="standNo" jdbcType="VARCHAR" />
<result column="initial_mileage" property="initialMileage" jdbcType="BIGINT" />
<result column="last_mileage" property="lastMileage" jdbcType="BIGINT" />
<result column="last_time" property="lastTime" jdbcType="TIMESTAMP" />
<result column="lower_mileage" property="lowerMileage" jdbcType="BIGINT" />
<result column="lower_time" property="lowerTime" jdbcType="TIMESTAMP" />
<result column="replace_flag" property="replaceFlag" jdbcType="INTEGER" />
<result column="vehicle_brand_id" property="vehicleBrandId" jdbcType="INTEGER" />
<result column="vehicle_brand_name" property="vehicleBrandName" jdbcType="VARCHAR" />
<result column="vehicle_sub_brand_id" property="vehicleSubBrandId" jdbcType="INTEGER" />
<result column="vehicle_sub_brand_name" property="vehicleSubBrandName" jdbcType="VARCHAR" />
<result column="vehicle_series_id" property="vehicleSeriesId" jdbcType="INTEGER" />
<result column="vehicle_series_name" property="vehicleSeriesName" jdbcType="VARCHAR" />
<result column="vehicle_shape_id" property="vehicleShapeId" jdbcType="INTEGER" />
<result column="vehicle_shape_name" property="vehicleShapeName" jdbcType="VARCHAR" />
<result column="del_flag" property="delFlag" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, sn, batch_id, merchant_id, merchant_name, sn_type, iccid, customer_name, customer_phone,
customer_sex, license_plate, stand_no, initial_mileage, last_mileage, last_time,
lower_mileage, lower_time, replace_flag, vehicle_brand_id, vehicle_brand_name, vehicle_sub_brand_id,
vehicle_sub_brand_name, vehicle_series_id, vehicle_series_name, vehicle_shape_id,
vehicle_shape_name, del_flag, created_by, created_time, updated_by, updated_time
</sql>
<select id="selectSnAndBindingInfo" resultType="java.lang.String">
SELECT t.`sn` FROM `scrm_collision_sn_info` t WHERE t.`sn` IN
<foreach collection="snList" open="(" close=")" item="snId" separator=",">
#{snId}
</foreach>
AND t.`del_flag`=0
AND t.`merchant_id` != #{merchantId}
</select>
<select id="selectSnBindingForMerchantId" resultType="java.lang.String">
SELECT t.`sn` FROM `scrm_collision_sn_info` t WHERE t.`sn` IN
<foreach collection="snList" open="(" close=")" item="snId" separator=",">
#{snId}
</foreach>
AND t.`del_flag`=0
AND t.`merchant_id` = #{merchantId}
</select>
<select id="getCustomerDeviceList" resultMap="BaseResultMap1">
SELECT
<include refid="Base_Column_List"/>
FROM `scrm_collision_sn_info` t
WHERE t.`del_flag`=0
<if test="sn!=null and sn!='' ">
AND t.`sn` LIKE CONCAT('%',#{sn},'%')
</if>
<if test="merchantNo!=null and operate==true">
AND t.`merchant_id` LIKE CONCAT('%',#{merchantNo},'%')
</if>
<if test="merchantId!=null and operate==false">
AND t.`merchant_id` LIKE CONCAT('%',#{merchantId},'%')
</if>
<if test="merchantName!=null and merchantName!='' ">
AND t.`merchant_name` LIKE CONCAT('%',#{merchantName},'%')
</if>
<if test="account!=null and account!='' ">
AND t.`updated_by` LIKE CONCAT('%',#{account},'%')
</if>
<if test="snType!=null ">
AND t.`sn_type` = #{snType}
</if>
<if test="customerPhone!=null and customerPhone!='' ">
AND t.`customer_phone` LIKE CONCAT('%',#{customerPhone},'%')
</if>
<if test="customerName!=null and customerName!='' ">
AND t.`customer_name` LIKE CONCAT('%',#{customerName},'%')
</if>
<if test="licensePlate!=null and licensePlate!='' ">
AND t.`license_plate` LIKE CONCAT('%',#{licensePlate},'%')
</if>
<if test="standNo!=null and standNo!='' ">
AND t.`stand_no` LIKE CONCAT('%',#{standNo},'%')
</if>
<if test="replaceFlag!=null ">
AND t.`replace_flag` = #{replaceFlag}
</if>
<if test="beginTime != null">
AND t.`created_time` <![CDATA[>=]]> #{beginTime}
</if>
<if test="endTime != null">
AND t.`created_time` <![CDATA[<=]]> #{endTime}
</if>
ORDER BY t.`updated_time` DESC
</select>
</mapper>
\ No newline at end of file
# framework-archetype-rpc
RPC服务项目骨架
一、项目结构说明:
└─src
├─main
├─java
├─cn.com.glsx.scrm.clue.config 配置层
├─cn.com.glsx.scrm.clue.manager 通用处理层
├─cn.com.glsx.scrm.clue.mapper Dao映射层
├─cn.com.glsx.scrm.clue.remote RPC接口实现层
├─cn.com.glsx.scrm.clue.service 业务层
├─cn.com.glsx.scrm.clue.util 工具包
└─cn.com.glsx.scrm.clue.Main.java 程序入口
├─resources 资源文件目录
├─config
├─application.properties 应用配置文件
├─META-INF
└─orm SQL配置文件
├─templates 模板目录
└─*.flt freemarker模板,(可用于邮件模板)
└─logback.xml 日志配置文件
└─webapp web前端文件目录
└─WEB-INF
└─bin shell脚本文件(包含启动、停止、重启等)
└─test 测试目录
├─java
└─cn.com.glsx.scrm.clue/service 测试代码
└─resources 测试资源目录
└─pom.xml pom文件
二、使用说明:
1、运行项目前需在配置中心创建配置信息,配置内容参考三配置说明:
1.1> dataId : application.properties --> ore.diamond.dataId + ore.diamond.env
1.2> group : application.properties --> ore.diamond.group
1.3> content : 参考三配置说明
2、生成mybatis文件的插件,使用说明:
1.1> 生成之后可以删掉插件
1.2> IDEA内:点击右侧Maven Projects > 项目 plugins > mybatis-generator 运行
1.3> ECLIPSE内:右键点击项目,选择RUN AS maven build > 输入maven命令:
mybatis-generator:generate -e > 运行
3、Bean转换器mapstruct使用说明:
1.1> 在converter包内建立Bean转换对应的转换器,传入source和target的类型。
1.2> 在remote内使用spring的方式引入bean。
1.3> Bean的属性名一样的情况下,不需要重写方法。
4、自定义过滤器加入方式:
1.1> 在src.main.resources.META-INF.dubbo文件夹下新建文件com.alibaba.dubbo.rpc.Filter
1.2> 在该文件内写入自定义过滤器类的完整地址,以键值对的形式加入,左边为key名称,例如:
dubboAuthorizeFilter=cn.com.glsx.payment.roof.filter.DubboAuthorizeFilter
1.3> 在钻石配置中加入dubbo过滤器的配置,名字为key,例如:
ore.dubbo.provider.enabled=true
ore.dubbo.provider.filter=dubboAuthorizeFilter
三、配置说明:
#----------------------------------------------------------------------------------------------------------
# dubbo配置
# dubbo应用名称
ore.dubbo.application.name=rpc-scrm-clue
# dubbo应用所有者
ore.dubbo.application.owner=deployer name
# dubbo服务注册地址
ore.dubbo.registry.address=zookeeper://192.168.3.206:2181
# dubbo服务注册超时时间
ore.dubbo.registry.timeout=30000
# 默认协议:dubbo
ore.dubbo.protocol.name=dubbo
# dubbo服务扫描包路径
ore.dubbo.scan=cn.com.glsx.scrm.clue.remote
# dubbo服务监控
ore.dubbo.monitor.protocol=registry
# dubbo服务统计
ore.dubbo.provider.filter=metrics
# dubbo配置中心
ore.dubbo.config-center.address=zookeeper://192.168.3.206:2181
# dubbo元数据中心
ore.dubbo.metadata-report.address=zookeeper://192.168.3.206:2181
┌------------------------------------------------------------┐
注:如需在RPC服务里面支持REST风格的服务
1、需在pom中添加如下依赖:
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-dubbo-rest</artifactId>
</dependency>
2、修改钻石配置
# dubbo协议配置(二选一)
#ore.dubbo.protocol.name=dubbo
#ore.dubbo.protocol.port=20880
# dubbo协议配置(二选一)
ore.dubbo.protocols.dubbo.name=dubbo
ore.dubbo.protocols.dubbo.port=20880
# REST协议配置
ore.dubbo.protocols.rest.name=rest
# 应用服务器(默认jetty)
ore.dubbo.protocols.rest.server=jetty
# 服务端口
ore.dubbo.protocols.rest.port=8080
# 最大连接数
ore.dubbo.protocols.rest.accepts=500
# 线程池大小
ore.dubbo.protocols.rest.threads=100
# 基础相对路径
ore.dubbo.protocols.rest.contextpath=rest-api
3、Java示例代码:
@Service //dubbo注解,注册服务
@Path("users") //JAX-RS注解
public class UserServiceRemoteImpl implements UserServiceRemote {
@POST //JAX-RS注解
@Path("register") //JAX-RS注解
@Consumes({MediaType.APPLICATION_JSON}) //JAX-RS注解
public void registerUser(User user) {
// save the user...
}
}
4、访问示例:
http://localhost:8080/rest-api/users/register
5、参考资料
resteasy框架使用介绍,参阅官方文档,地址:http://docs.jboss.org/resteasy/docs/3.6.0.Final/userguide/html/index.html
dubbo rest协议说明,参阅官方文档,地址:http://dubbo.apache.org/zh-cn/docs/user/references/protocol/rest.html
└------------------------------------------------------------┘
#----------------------------------------------------------------------------------------------------------
# druid连接池及数据源配置
ore.druid.url=jdbc:mysql://host:port/数据库名?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
ore.druid.driver-class=com.mysql.jdbc.Driver
ore.druid.username=用户名
ore.druid.password=密码
ore.druid.initial-size=1
ore.druid.min-idle=1
ore.druid.max-active=20
ore.druid.test-on-borrow=true
# druid连接池监控配置
# 是否开启监控
ore.druid.monitor.enabled=true
# 监控后台用户名,默认:admin
ore.druid.monitor.login-username=admin
# 监控后台密码,默认:admin123
ore.druid.monitor.login-password=admin123
# 监控访问路径匹配规则,默认:/druid/*
ore.druid.monitor.url-mappings=/druid/*
# 监控访问IP白名单,多个以英文逗号“,”隔开,默认:127.0.0.1
ore.druid.monitor.allow=127.0.0.1
# 监控访问IP黑名单(存在共同时,deny优先于allow),多个以英文逗号“,”隔开
ore.druid.monitor.deny=192.168.0.1
# 是否能够重置数据,默认:false,则隐藏页面重置按钮
ore.druid.monitor.reset-enable=false
# 开启SQL监控
ore.druid.filter.stat.enabled=true
# 数据库类型
ore.druid.filter.stat.db-type=mysql
# 是否合并sql
ore.druid.filter.stat.merge-sql=true
# 是否记录慢查询
ore.druid.filter.stat.log-slow-sql=true
# 慢查询时间:200毫秒(默认3000毫秒)
ore.druid.filter.stat.slow-sql-millis=200
# 开启日志监控
ore.druid.filter.slf4j.enabled=true
ore.druid.filter.slf4j.data-source-log-enabled=true
ore.druid.filter.slf4j.statement-executable-sql-log-enable=true
# 开启Spring监控
ore.druid.monitor.spring.enabled=true
# 扫描的包路径,可配置多个,以逗号‘,’隔开
ore.druid.monitor.scanPackages=cn.com.glsx.scrm.clue.mapper.*,cn.com.glsx.scrm.clue.service.*
┌------------------------------------------------------------┐
注:如需使用SQL监控需在pom中添加如下依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
└------------------------------------------------------------┘
#----------------------------------------------------------------------------------------------------------
# mybatis配置
# 实体模型包
mybatis.type-aliases-package=cn.com.glsx.scrm.clue.model
# SQL脚本文件路径
mybatis.mapper-locations=classpath:/META-INF/orm/*Mapper.xml
# 开启mybatis sql打印
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
mapper.mappers=org.oreframework.datasource.mybatis.mapper.OreMapper
mapper.not-empty=false
mapper.identity=MYSQL
# 多数据源配置(主库/读写)
#----------------------------------------------------------------------------------------------------------
# druid连接池及数据源配置
ore.primary.druid.url=jdbc:mysql://主库host:主库port/数据库名?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
ore.primary.druid.driver-class=com.mysql.jdbc.Driver
ore.primary.druid.username=用户名
ore.primary.druid.password=密码
ore.primary.druid.initial-size=1
ore.primary.druid.min-idle=1
ore.primary.druid.max-active=20
ore.primary.druid.test-on-borrow=true
# mybatis配置
# 实体模型包
ore.primary.mybatis.type-aliases-package=cn.com.glsx.scrm.clue.model
# SQL脚本文件路径
ore.primary.mybatis.mapper-locations=classpath:/META-INF/orm/*Mapper.xml
ore.primary.mapper.mappers=org.oreframework.datasource.mybatis.mapper.OreMapper
ore.primary.mapper.not-empty=false
ore.primary.mapper.identity=MYSQL
┌------------------------------------------------------------┐
使用说明:
方式一:
1、引入SqlSessionTemplate
@Resource(name = "primarySqlSessionTemplate")
private SqlSessionTemplate primarySqlSessionTemplate;
2、获取XxMapper
XxMapper mapper = primarySqlSessionTemplate.getMapper(XxMapper.class);
3、调用
mapper.insert(record);
mapper.delete(record);
......
方式二:
1、XxMapper类上添加注解@PrimaryMapper
2、普通方式调用
└------------------------------------------------------------┘
# 多数据源配置(从库/只读)
#----------------------------------------------------------------------------------------------------------
# druid连接池及数据源配置
ore.secondary.druid.url=jdbc:mysql://从库host:从库port/数据库名?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
ore.secondary.druid.driver-class=com.mysql.jdbc.Driver
ore.secondary.druid.username=用户名
ore.secondary.druid.password=密码
ore.secondary.druid.initial-size=1
ore.secondary.druid.min-idle=1
ore.secondary.druid.max-active=20
ore.secondary.druid.test-on-borrow=true
# mybatis配置
# 实体模型包
ore.secondary.mybatis.type-aliases-package=cn.com.glsx.scrm.clue.model
# SQL脚本文件路径
ore.secondary.mybatis.mapper-locations=classpath:/META-INF/orm/*Mapper.xml
ore.secondary.mapper.mappers=org.oreframework.datasource.mybatis.mapper.OreMapper
ore.secondary.mapper.not-empty=false
ore.secondary.mapper.identity=MYSQL
┌------------------------------------------------------------┐
使用说明:
方式一:
1、引入SqlSessionTemplate
@Resource(name = "secondarySqlSessionTemplate")
private SqlSessionTemplate secondarySqlSessionTemplate;
2、获取XxMapper
XxMapper mapper = secondarySqlSessionTemplate.getMapper(XxMapper.class);
3、调用
mapper.insert(record);
mapper.delete(record);
......
方式二:
1、XxMapper类上添加注解@SecondaryMapper
2、普通方式调用
└------------------------------------------------------------┘
#----------------------------------------------------------------------------------------------------------
# 分页配置
pagehelper.helperDialect=mysql
pagehelper.reasonable=true
pagehelper.supportMethodsArguments=true
pagehelper.params=count=countSql
#----------------------------------------------------------------------------------------------------------
# Dubbo Swagger配置
# 是否启用swagger-dubbo,默认为true
swagger.dubbo.enable=true
# http请求地址,默认为http://ip:port/h/com.XXX.XxService/method
#swagger.dubbo.http=h
# rpc zk调用 or 本地调用,默认为rpc
#swagger.dubbo.cluster=rpc
# dubbo 服务版本号,可不配置
swagger.dubbo.application.version=1.0-SNAPSHOT
# dubbo服务groupId,可不配置
swagger.dubbo.application.groupId=cn.com.glsx.scrm.clue
# dubbo服务artifactId,可不配置
swagger.dubbo.application.artifactId=rpc-scrm-clue
┌------------------------------------------------------------┐
使用说明:
1、接口或实现类的方法上添加Swagger注解@ApiOperation(nickname = "queryBy**", value = "查询**", notes = "根据**查询**", httpMethod="GET")[非必须]
2、接口参数添加Swagger注解@ApiParam(value = "参数名称", required=true)[非必须]
3、对象属性添加Swagger注解@ApiModelProperty(value = "属性名称")[非必须]
注意事项:
1、对于服务接口方法重载,为了在http请求中唯一确认一个方法,需要使用注解@ApiOperation(nickname = "byId"),通过nickname标记唯一路径(如果不填写,将只显示一个方法)。
此时,rest的请求地址为:http://ip:port/h/com.XXX.XxService/method/byId
2、Object对象作为http请求参数为json string格式
3、swagger注解既可以写在接口上,也可以写在实现类上
4、原生类型作为http请求参数为必填
└------------------------------------------------------------┘
#----------------------------------------------------------------------------------------------------------
# Freemarker模板配置
# 模板存放路径
spring.freemarker.template-loader-path=classpath:/templates/
# 是否开启模板缓存,默认是开启,开发时请关闭
spring.freemarker.cache=false
# 模板的编码设置,默认UTF-8
spring.freemarker.charset=UTF-8
# 是否检测模板已存在本地
spring.freemarker.check-template-location=true
# 模板的媒体类型设置,默认为text/html
spring.freemarker.content-type=text/html
spring.freemarker.expose-request-attributes=true
spring.freemarker.expose-session-attributes=true
spring.freemarker.request-context-attribute=request
# 后缀设置,默认为.ftl
spring.freemarker.suffix=.ftl
┌------------------------------------------------------------┐
注:如需使用freemarker需在pom中添加如下依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
└------------------------------------------------------------┘
#----------------------------------------------------------------------------------------------------------
# kafka生产者配置
spring.kafka.producer.metadata.broker.list=192.168.3.207:9092
spring.kafka.producer.topic=消息主题
spring.kafka.producer.serializer.class=kafka.serializer.DefaultEncoder
spring.kafka.producer.type=async
spring.kafka.producer.request.required.acks=1
┌------------------------------------------------------------┐
注:如需使用kafka发送消息需在pom中添加如下依赖
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-jms</artifactId>
</dependency>
└------------------------------------------------------------┘
#----------------------------------------------------------------------------------------------------------
# kafka消费者配置
spring.kafka.consumer.group.id=rpc-scrm-clue-consumer
spring.kafka.consumer.zookeeper.connect=192.168.3.207:2181
spring.kafka.consumer.zookeeper.connection.timeout.ms=15000
spring.kafka.consumer.zookeeper.session.timeout.ms=15000
spring.kafka.consumer.auto.commit.interval.ms=1000
spring.kafka.consumer.auto.offset.reset=largest
spring.kafka.consumer.topic=消息主题
# 默认分区消费线程数
spring.kafka.consumer.partitionsNum=6
# 指定主题分区消费线程数
spring.kafka.consumer.消息主题.partitionsNum=2
┌------------------------------------------------------------┐
注:如需使用kafka接收消息需在pom中添加如下依赖
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-jms</artifactId>
</dependency>
└------------------------------------------------------------┘
#----------------------------------------------------------------------------------------------------------
# redis配置
ore.redis.hostName=192.168.3.207
ore.redis.port=6379
ore.redis.password=
ore.redis.pool.maxActive=600
ore.redis.pool.maxWait=10000
ore.redis.pool.maxTotal=300
ore.redis.pool.maxIdle=300
ore.redis.pool.minIdle=0
ore.redis.timeout=30000
┌------------------------------------------------------------┐
注:如需使用redis,需在pom中添加如下依赖
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-redis</artifactId>
</dependency>
└------------------------------------------------------------┘
#----------------------------------------------------------------------------------------------------------
# 雪花算法
# 开启雪花算法
ore.snowflake.enabled=true
# 数据中心ID(0~31)
ore.snowflake.data-center-id=1
# 工作节点ID(0~31)
ore.snowflake.worker-id=1
┌------------------------------------------------------------┐
使用说明:
1、注入SnowflakeWorker
@Autowired
private SnowflakeWorker snowflakeWorker;
2、调用本地方法
long randomId = snowflakeWorker.nextId();
└------------------------------------------------------------┘
server.port=8615
server.display-name=rpc-scrm-clue
server.servlet.context-path=/rpc-scrm-clue
server.servlet.application-display-name=rpc-scrm-clue
logging.config=classpath:logback.xml
logging.path=/data/java_log/jetty/rpc-scrm-clue/rpc-scrm-clue.log
logging.level.root=INFO
ore.starter.class-name=Main
# diamond config
ore.diamond.group=scrm
ore.diamond.dataId=rpc-scrm-clue
ore.diamond.env=release
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<property resource="config/application.properties" />
<property name="APP_NAME" value="${server.display-name}" />
<property name="LOG_PATH" value="${logging.path}" />
<property name="LOG_LEVEL" value="${logging.level}" />
<contextName>${APP_NAME}</contextName>
<turboFilter class="org.oreframework.boot.logging.logback.OreBootTurboFilter">
<Marker>oreframework</Marker>
</turboFilter>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="org.oreframework.commons.log.OrePatternLayout">
<pattern>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${APP_NAME}] [%traceid] [%thread] %-5level [%logger{36}.%method %line] - %msg%n</pattern>
</pattern>
</layout>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- <Encoding> Label Old version of this label can not be used -->
<!-- <Encoding>UTF-8</Encoding> -->
<File>${LOG_PATH}</File>
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<FileNamePattern>${LOG_PATH}.%d{yyyy-MM-dd}.%i</FileNamePattern>
<MaxHistory>15</MaxHistory>
<maxFileSize>200MB</maxFileSize>
</rollingPolicy>
<layout class="org.oreframework.commons.log.OrePatternLayout">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${APP_NAME}] [%traceid] [%thread] %-5level [%logger{36}.%method %line] - %msg%n</pattern>
</layout>
<!-- 根据文件大小滚动,不支持 SizeBasedTriggeringPolicy 这种配置-->
<!-- <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>200MB</MaxFileSize>
</triggeringPolicy> -->
</appender>
<!-- druid连接池慢查询日志记录 -->
<appender name="DruidFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}.druid_slow_sql</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,例如今天是2020-01-01日志,当前写的日志文件路径为file节点指定,可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
而2020-01-01的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}.druid_slow_sql-%d{yyyy-MM-dd}.%i</fileNamePattern>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,命名日志文件,例如log-error-2020-01-01.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>200MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 此日志文件只记录级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<root level="${LOG_LEVEL}">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
<appender-ref ref="DruidFILE" />
</root>
</configuration>
\ No newline at end of file
#!/bin/bash
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/classes
SERVER_NAME=`sed '/application.name/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
#LOGS_FILE=`sed '/log4j.appender.logToFile.File/!d;s/.*=//' classes/log4j.properties | tr -d '\r'`
LOGS_FILE=`sed '/name="LOG_PATH"/!d;s/.*value="\(.*\)".*/\1/g' classes/logback.xml`
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$CONF_DIR" |awk '{print $2}'`
if [ -z "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME does not started!"
exit 1
fi
LOGS_DIR=""
if [ -n "$LOGS_FILE" ]; then
LOGS_DIR=`dirname $LOGS_FILE`
else
LOGS_DIR=$DEPLOY_DIR/logs
fi
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
DUMP_DIR=$LOGS_DIR/dump
if [ ! -d $DUMP_DIR ]; then
mkdir $DUMP_DIR
fi
DUMP_DATE=`date +%Y%m%d%H%M%S`
DATE_DIR=$DUMP_DIR/$DUMP_DATE
if [ ! -d $DATE_DIR ]; then
mkdir $DATE_DIR
fi
echo -e "Dumping the $SERVER_NAME ...\c"
for PID in $PIDS ; do
jstack $PID > $DATE_DIR/jstack-$PID.dump 2>&1
echo -e ".\c"
jinfo $PID > $DATE_DIR/jinfo-$PID.dump 2>&1
echo -e ".\c"
jstat -gcutil $PID > $DATE_DIR/jstat-gcutil-$PID.dump 2>&1
echo -e ".\c"
jstat -gccapacity $PID > $DATE_DIR/jstat-gccapacity-$PID.dump 2>&1
echo -e ".\c"
jmap $PID > $DATE_DIR/jmap-$PID.dump 2>&1
echo -e ".\c"
jmap -heap $PID > $DATE_DIR/jmap-heap-$PID.dump 2>&1
echo -e ".\c"
jmap -histo $PID > $DATE_DIR/jmap-histo-$PID.dump 2>&1
echo -e ".\c"
if [ -r /usr/sbin/lsof ]; then
/usr/sbin/lsof -p $PID > $DATE_DIR/lsof-$PID.dump
echo -e ".\c"
fi
done
if [ -r /bin/netstat ]; then
/bin/netstat -an > $DATE_DIR/netstat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/iostat ]; then
/usr/bin/iostat > $DATE_DIR/iostat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/mpstat ]; then
/usr/bin/mpstat > $DATE_DIR/mpstat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/vmstat ]; then
/usr/bin/vmstat > $DATE_DIR/vmstat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/free ]; then
/usr/bin/free -t > $DATE_DIR/free.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/sar ]; then
/usr/bin/sar > $DATE_DIR/sar.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/uptime ]; then
/usr/bin/uptime > $DATE_DIR/uptime.dump 2>&1
echo -e ".\c"
fi
echo "OK!"
echo "DUMP: $DATE_DIR"
#!/bin/bash
ENV=$1
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
cd `dirname $0`
./stop.sh
./start.sh $ENV
\ No newline at end of file
#!/bin/bash
cd `dirname $0`
if [ "$1" = "start" ]; then
ENV=$2
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
./start.sh $ENV
else
if [ "$1" = "stop" ]; then
./stop.sh
else
if [ "$1" = "debug" ]; then
ENV=$2
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
./start.sh $ENV debug
else
if [ "$1" = "restart" ]; then
ENV=$2
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
./restart.sh $ENV
else
if [ "$1" = "dump" ]; then
./dump.sh
else
echo "ERROR: Please input argument: start or stop or debug or restart or dump"
exit 1
fi
fi
fi
fi
fi
#!/bin/bash
JAVA_HOME="/app/soft/jdk1.8.0_20"
ENV=$1
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/classes
SERVER_NAME=`sed '/server.display-name/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
SERVER_PORT=`sed '/server.port/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
#LOGS_FILE=`sed '/log4j.appender.logToFile.File/!d;s/.*=//' classes/log4j.properties | tr -d '\r'`
LOGS_FILE=`sed '/logging.path/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
echo "server name is $SERVER_NAME"
echo "server port is $SERVER_PORT"
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$CONF_DIR" |awk '{print $2}'`
if [ -n "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME already started!"
echo "PID: $PIDS"
exit 1
fi
if [ -n "$SERVER_PORT" ]; then
SERVER_PORT_COUNT=`netstat -tln | grep $SERVER_PORT | wc -l`
if [ $SERVER_PORT_COUNT -gt 0 ]; then
echo "ERROR: The $SERVER_NAME port $SERVER_PORT already used!"
exit 1
fi
fi
LOGS_DIR=""
if [ -n "$LOGS_FILE" ]; then
LOGS_DIR=`dirname $LOGS_FILE`
else
LOGS_DIR=$DEPLOY_DIR/logs
fi
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
STDOUT_FILE=$LOGS_DIR/stdout.log
LIB_DIR=$DEPLOY_DIR/lib
LIB_JARS=`ls $LIB_DIR|grep .jar|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"`
JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
JAVA_DEBUG_OPTS=""
if [ "$2" = "debug" ]; then
JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n "
fi
JAVA_JMX_OPTS=""
if [ "$2" = "jmx" ]; then
JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
fi
JAVA_MEM_OPTS=""
BITS=`file $JAVA_HOME/bin/java | grep 64-bit`
if [ -n "$BITS" ]; then
JAVA_MEM_OPTS=" -server -Xmx1g -Xms1g -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
else
JAVA_MEM_OPTS=" -server -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
fi
echo -e "Starting the $SERVER_NAME ...\c"
nohup $JAVA_HOME/bin/java $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -classpath $CONF_DIR:$LIB_JARS org.oreframework.boot.bootstrap.OreBootApplication env=$ENV > $STDOUT_FILE 2>&1 &
COUNT=0
while [ $COUNT -lt 1 ]; do
echo -e ".\c"
sleep 1
if [ -n "$SERVER_PORT" ]; then
COUNT=`netstat -an | grep $SERVER_PORT | wc -l`
else
COUNT=`ps --no-heading -C java -f --width 1000 | grep "$DEPLOY_DIR" | awk '{print $2}' | wc -l`
fi
if [ $COUNT -gt 0 ]; then
break
fi
done
echo "OK!"
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$DEPLOY_DIR" | awk '{print $2}'`
echo "PID: $PIDS"
echo "STDOUT: $STDOUT_FILE"
#!/bin/bash
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/classes
SERVER_NAME=`sed '/application.name/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$CONF_DIR" |awk '{print $2}'`
if [ -z "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME does not started!"
exit 1
fi
#if [ "$1" != "skip" ]; then
#$BIN_DIR/dump.sh
#fi
echo -e "Stopping the $SERVER_NAME ...\c"
for PID in $PIDS ; do
kill $PID > /dev/null 2>&1
done
COUNT=0
while [ $COUNT -lt 1 ]; do
echo -e ".\c"
sleep 1
COUNT=1
for PID in $PIDS ; do
PID_EXIST=`ps --no-heading -p $PID`
if [ -n "$PID_EXIST" ]; then
COUNT=0
break
fi
done
done
echo "OK!"
echo "PID: $PIDS"
package cn.com.glsx.scrm.clue.manager;
import cn.com.glsx.framework.core.util.DateUtils;
import cn.com.glsx.scrm.clue.model.collision.GpsRecordsResponse;
import cn.com.glsx.scrm.clue.service.BaseServiceTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
import java.util.List;
public class GpsManagerTest extends BaseServiceTest {
@Autowired
private GpsManager gpsManager;
@Test
public void testGetGpsRecords() {
String date = "2023-10-14 19:40:00";
Date collisionTime = DateUtils.parseDate(date, DateUtils.DEFAULT_DATE_FORMAT4);
List<GpsRecordsResponse> gpsRecords = gpsManager.getGpsRecords("64305250033", collisionTime);
System.out.println(gpsRecords);
}
}
package cn.com.glsx.scrm.clue.remote;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.com.glsx.scrm.clue.Main;
/**
* @Title: BaseRemoteTest.java
* @Description:
* @author deployer name
* @date 2018年1月6日 下午3:58:33
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class)
public class BaseRemoteTest {
}
package cn.com.glsx.scrm.clue.service;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.com.glsx.scrm.clue.Main;
/**
* @Title: BaseServiceTest.java
* @Description:
* @author deployer name
* @date 2018年1月6日 下午1:23:03
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class)
public class BaseServiceTest {
}
package cn.com.glsx.scrm.clue.service;
import cn.com.glsx.scrm.clue.job.BurialPointSummaryJob;
import cn.com.glsx.scrm.clue.util.LocalDateUtils;
import com.dangdang.ddframe.job.api.ShardingContext;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
public class BurialPointRecordServiceTest extends BaseServiceTest {
@Autowired
private BurialPointRecordService burialPointRecordService;
@Autowired
private BurialPointSummaryJob burialPointSummaryJob;
@Test
public void summaryBurialPointRecordTest() {
// public void pointRecordTest() {
// LocalDate currentDate = LocalDate.now();
String weekStartDate = "2025-07-05";
String weekEndDate = "2025-07-22";
// burialPointRecordService.summaryBurialPointRecord(weekStartDate, weekEndDate);
burialPointRecordService.commonStatisticsBurialPointRecord(null, null);
}
@Test
public void getDialogueCountTest() {
String weekStartDate = "2025-07-16";
String weekEndDate = "2025-07-22";
List<Integer> list = Arrays.asList(113);
Map<String, Integer> dialogueCount = burialPointRecordService.getDialogueCount(weekStartDate, weekEndDate, list);
System.out.println(dialogueCount);
}
}
package cn.com.glsx.scrm.clue.service.collision;
import cn.com.glsx.scrm.clue.converter.CollisionSnInfoConvert;
import cn.com.glsx.scrm.clue.dto.collision.CollisionSnInfoDTO;
import cn.com.glsx.scrm.clue.dto.collision.CollisionSnInfoExportDTO;
import cn.com.glsx.scrm.clue.entity.collision.CollisionInfo;
import cn.com.glsx.scrm.clue.enums.collision.CollisionEventTypeEnum;
import cn.com.glsx.scrm.clue.manager.PhysicalDeviceManager;
import cn.com.glsx.scrm.clue.model.merchant.MerchantRopResponse;
import cn.com.glsx.scrm.clue.model.request.collision.*;
import cn.com.glsx.scrm.clue.model.response.collision.*;
import cn.com.glsx.scrm.clue.model.response.collision.CollisionInfoRpcResponse;
import cn.com.glsx.scrm.clue.model.response.collision.CustomerDeviceImportRpcResponse;
import cn.com.glsx.scrm.clue.service.BaseServiceTest;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.scrm.clue.service.merchant.MerchantService;
import com.github.pagehelper.Page;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
/**
* @Author yelq
* @Version 1.0
* @Description:
* @Date 2023/10/12 16:39
*/
public class CollisionInfoServiceTest extends BaseServiceTest {
@Autowired
private CollisionInfoService collisionInfoService;
@Autowired
private PhysicalDeviceManager physicalDeviceManager;
@Autowired
private MerchantService merchantService;
@Test
public void findMerchantByMerchantNoTest() throws Exception {
MerchantRopResponse response = merchantService.findMerchantByMerchantNo(10001001);
System.out.println(response);
}
@Test
public void exportCustomerDeviceListTest01() throws Exception{
RpcPagination<CollisionSnInfoSearchRpcRequest> requestDTO = new RpcPagination<>();
CollisionSnInfoSearchRpcRequest request = new CollisionSnInfoSearchRpcRequest();
request.setOperate(false);
request.setMerchantNo(10001002);
request.setMerchantId(10001001);
requestDTO.setPageSize(10);
requestDTO.setPageNum(1);
requestDTO.setCondition(request);
String s = collisionInfoService.exportCustomerDeviceList(requestDTO);
System.out.println(s);
}
@Test
public void customerDeviceEditTest01() throws Exception{
CollisionSnInfoEditRpcRequest requestDTO = new CollisionSnInfoEditRpcRequest();
requestDTO.setId(2);
requestDTO.setVehicleBrandId(10);
requestDTO.setVehicleBrandName("宝马");
requestDTO.setVehicleSeriesId(120);
requestDTO.setVehicleSeriesName("X7");
requestDTO.setVehicleShapeId(122);
requestDTO.setVehicleShapeName("SUV");
requestDTO.setReplaceFlag(2);
Boolean edit = collisionInfoService.customerDeviceEdit(requestDTO);
System.out.println(edit);
}
@Test
public void getCustomerDeviceDetailTest01() throws Exception{
CollisionSnInfoSearchRpcRequest requestDTO = new CollisionSnInfoSearchRpcRequest();
requestDTO.setId(2);
CollisionSnInfoDTO detail = collisionInfoService.getCustomerDeviceDetail(requestDTO);
System.out.println(detail);
}
@Test
public void physicalDeviceManagerTest01() throws Exception{
System.out.println(physicalDeviceManager.getPhysicalDeviceBySn("12345661561561561789").toString());
}
@Test
public void toCollisionSnInfoExportDTOTest01() throws Exception{
CollisionSnInfoDTO source = new CollisionSnInfoDTO();
source.setSn("abc");
source.setReplaceFlag(0);
source.setLowerTime(new Date());
source.setLowerMileage(1000L);
source.setLastTime(new Date());
source.setCustomerSex(1);
source.setSnType(7);
source.setMerchantId(10001001);
CollisionSnInfoExportDTO exportDTO = CollisionSnInfoConvert.INSTANCE.toCollisionSnInfoExportDTO(source);
System.out.println(exportDTO);
}
@Test
public void getCustomerDeviceListTest01() throws Exception{
RpcPagination<CollisionSnInfoSearchRpcRequest> requestDTO = new RpcPagination<>();
CollisionSnInfoSearchRpcRequest request = new CollisionSnInfoSearchRpcRequest();
// request.setAccount("abc");
// request.setSn("abc");
// request.setBeginTime(new Date());
// request.setEndTime(new Date());
// request.setMerchantName("abc");
// request.setSnType(DeviceTypeEnum.DVD.getValue());
request.setOperate(true);
// request.setMerchantNo(10001002);
// request.setMerchantId(10001001);
// request.setReplaceFlag(0);
requestDTO.setPageSize(10);
requestDTO.setPageNum(1);
requestDTO.setCondition(request);
RpcPagination<CollisionSnInfoDTO> list = collisionInfoService.getCustomerDeviceList(requestDTO);
System.out.println(list);
}
@Test
public void customerDeviceImportTest01() throws Exception{
CustomerDeviceImportRpcRequest requestDTO = new CustomerDeviceImportRpcRequest();
requestDTO.setUrl("https://wx.glsx.com.cn/upload/biz/dad9b259-2a55-4aa4-b145-32261fdc15f5.xlsx");
requestDTO.setMerchantId(10001001);
requestDTO.setCreatedAccount("weiruizhifu");
CustomerDeviceImportRpcResponse response = collisionInfoService.customerDeviceImport(requestDTO);
System.out.println(response);
}
@Test
public void handleCollisionEventTest() {
CollisionInfo collisionInfo = new CollisionInfo();
collisionInfo.setSn("12345661561561561789");
collisionInfo.setLongitude("114.06455");
collisionInfo.setLatitude("22.54846");
collisionInfo.setCollisionTime(new Date());
collisionInfo.setCollisionType(CollisionEventTypeEnum.COLLIDE.getValue());
collisionInfo.setTaskId("111");
collisionInfoService.handleCollisionEvent(collisionInfo);
}
@Test
public void listCollisionInfoByPageTest() {
CollisionInfoSearchRpcRequest requestDTO = new CollisionInfoSearchRpcRequest();
requestDTO.setOperate(false);
requestDTO.setPageNum(1);
requestDTO.setPageSize(10);
requestDTO.setSn("1");
requestDTO.setMerchantId(10001001);
requestDTO.setMerchantName("冒烟商户ABC");
requestDTO.setFollowStatus(0);
Page<CollisionInfoRpcResponse> collisionInfoRpcResponses = collisionInfoService.listCollisionInfoByPage(requestDTO);
System.out.println(collisionInfoRpcResponses);
String url = collisionInfoService.exportCollisionInfo(requestDTO);
System.out.println(url);
}
@Test
public void getDetailByIdTest() {
CollisionDetailInfoRpcResponse detail = collisionInfoService.getDetailById(1);
System.out.println(detail);
}
public void followCollisionInfoByMerchantTest() {
FollowInfoRpcRequest requestDTO = new FollowInfoRpcRequest();
requestDTO.setId(1);
requestDTO.setFollowRemark("测试一下");
requestDTO.setFollowResult(0);
}
}
package cn.com.glsx.scrm.clue.service.collision;
import cn.com.glsx.scrm.clue.entity.collision.CollisionMediaInfo;
import cn.com.glsx.scrm.clue.enums.collision.CollisionMediaTypeEnum;
import cn.com.glsx.scrm.clue.service.BaseServiceTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
public class CollisionMediaServiceTest extends BaseServiceTest {
@Autowired
private CollisionMediaService collisionMediaService;
@Test
public void insertMediaInfoTest() {
CollisionMediaInfo collisionMediaInfo = new CollisionMediaInfo();
collisionMediaInfo.setTaskId("111");
collisionMediaInfo.setFileUrl("http://localhost:8293");
collisionMediaInfo.setMediaType(CollisionMediaTypeEnum.IMAGE.getValue());
int i = collisionMediaService.insertMediaInfo(collisionMediaInfo);
System.out.println(i);
}
}
package cn.com.glsx.scrm.clue.service.collision;
import cn.com.glsx.scrm.clue.entity.collision.CollisionInfo;
import cn.com.glsx.scrm.clue.entity.collision.CollisionSnInfo;
import cn.com.glsx.scrm.clue.model.request.collision.CollisionPushConfigRpcRequest;
import cn.com.glsx.scrm.clue.model.response.collision.CollisionPushConfigRpcResponse;
import cn.com.glsx.scrm.clue.service.BaseServiceTest;
import com.alibaba.fastjson.JSON;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class CollisionPushConfigServiceTest extends BaseServiceTest {
@Autowired
private CollisionPushConfigService collisionPushConfigService;
@Autowired
private CollisionSnInfoService collisionSnInfoService;
@Autowired
private CollisionInfoService collisionInfoService;
@Test
public void addOrUpdatePushConfigTest() {
CollisionPushConfigRpcRequest request = new CollisionPushConfigRpcRequest();
request.setMerchantId(10001001);
request.setCreatedAccount("weiruizhifu");
request.setConfigType(0);
request.setStartTime("08:00");
request.setEndTime("22:00");
request.setPushFlag(1);
request.setPushPhones("18750768529");
CollisionPushConfigRpcResponse response = collisionPushConfigService.addOrUpdatePushConfig(request);
System.out.println(response);
List<CollisionPushConfigRpcResponse> configs = collisionPushConfigService.getPushConfigByMerchantId(10001001);
System.out.println(JSON.toJSONString(configs));
}
@Test
public void pushCollisionMsgTest() {
CollisionSnInfo collisionSnInfo = collisionSnInfoService.getSnInfoBySn("12345661561561561789").get(0);
CollisionInfo collisionInfo = collisionInfoService.getCollisionInfoById(1);
collisionPushConfigService.pushCollisionMsg(collisionSnInfo, collisionInfo);
}
}
package cn.com.glsx.scrm.clue.service.common;
import cn.com.glsx.scrm.clue.service.BaseServiceTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
public class MessageServiceTest extends BaseServiceTest {
@Autowired
private MessageService messageService;
@Test
public void sendMessageTest() {
String phone = "18750768529";
String source = "scrm-drac-normal";
String type = "2";
String context = "【广联赛讯】您的客户王大权在北京市大兴区西红门镇金业大街道路停车位似发生事故,客户手机号为:18750768529,请及时联系客户。";
messageService.sendMessage(phone, source, type, context);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<!-- 确保已安装mybatis generator eclipse插件 -->
<generatorConfiguration>
<context id="DB2Tables" targetRuntime="MyBatis3">
<property name="javaFileEncoding" value="UTF-8"/>
<plugin type="tk.mybatis.mapper.generator.MapperPlugin">
<property name="mappers" value="org.oreframework.datasource.mybatis.mapper.OreMapper"/>
<property name="caseSensitive" value="true"/>
<property name="useActualColumnNames" value="true" />
<!--<property name="beginningDelimiter" value="`"/>-->
<!--<property name="endingDelimiter" value="`"/>-->
</plugin>
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.3.227:3306/scrm_clue?characterEncoding=utf8" userId="dev_admin" password="1f7e1ed2" />
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<javaModelGenerator targetPackage="cn.com.glsx.scrm.clue.model" targetProject="../rpc-scrm-clue-api/src/main/java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="META-INF/orm" targetProject="src/main/resources">
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<javaClientGenerator targetPackage="cn.com.glsx.scrm.clue.mapper" targetProject="MAVEN" type="XMLMAPPER">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!-- 可配置多个 -->
<!--<table tableName="clue_order" domainObjectName="ClueOrder1" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>-->
<!--<table tableName="clue_staff" domainObjectName="ClueStaff" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>-->
<!--<table tableName="clue_vehicle" domainObjectName="ClueVehicle" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>-->
<table tableName="clue_burial_point_record" domainObjectName="BurialPointRecord" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
</context>
</generatorConfiguration>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!