Commit 00976702 by YANGYANG

公安部标注平台项目初始化提交

parent d65cc84b
package com.founder.commonutils.ZdryAndZdryApiVo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-06-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="UsersAndOnlineAndTasksVo对象", description="UsersAndOnlineAndTasksVo对象")
public class UsersAndOnlineAndTasksVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "姓名")
private String xm;
@ApiModelProperty(value = "性别 1男 2女 0未知")
private Integer xb;
@ApiModelProperty(value = "家庭住址")
private String jtZz;
@ApiModelProperty(value = "是否有前科 1是 0否")
private Integer sfyQk;
@ApiModelProperty(value = "现住址")
private String xzz;
@ApiModelProperty(value = "病史")
private String bs;
@ApiModelProperty(value = "病情等级 1低 2中 3高 4极高")
private Integer bqDj;
@ApiModelProperty(value = "监护人1姓名")
private String jhr1Xm;
@ApiModelProperty(value = "监护人1关系")
private String jhr1Gx;
@ApiModelProperty(value = "监护人1联系电话")
private String jhr1Lxdh;
@ApiModelProperty(value = "监护人1紧急电话")
private String jhr1Jjdh;
@ApiModelProperty(value = "监护人2姓名")
private String jhr2Xm;
@ApiModelProperty(value = "监护人2关系")
private String jhr2Gx;
@ApiModelProperty(value = "监护人2联系电话")
private String jhr2Lxdh;
@ApiModelProperty(value = "监护人2紧急电话")
private String jhr2Jjdh;
@ApiModelProperty(value = "设备IMEI")
private String sbImei;
@ApiModelProperty(value = "设备型号")
private String sbXh;
@ApiModelProperty(value = "身份证号码")
private String sfzhm;
@ApiModelProperty(value = "是否在线 1在线 0离线")
private String online;
@ApiModelProperty(value = "是否佩戴 1佩戴 0位佩戴")
private String WearFlag;
@ApiModelProperty(value = "最新发生时间")
private String locationUpdatedAt;
@ApiModelProperty(value = "最新位置经度")
private String lastLocationX;
@ApiModelProperty(value = "最新位置纬度")
private String lastLocationY;
@ApiModelProperty(value = "最新位置地址")
private String lastAddress;
@ApiModelProperty(value = "电子围栏名称")
@TableField(value = "name")
private String name;
@ApiModelProperty(value = "开始时间例早上八点:8")
@TableField(value = "time_begin")
private String timeBegin;
@ApiModelProperty(value = "结束时间例下午六点:18")
@TableField(value = "time_end")
private String timeEnd;
@ApiModelProperty(value = "A;B;C;D;A")
@TableField(value = "safe_area")
private String safeArea;
@ApiModelProperty(value = "任务类型")
@TableField(value = "task_type")
private String taskType;
@ApiModelProperty(value = "预警")
@TableField(value = "warn")
private int warn;
@ApiModelProperty(value = "1进入区域 2离开区域 3异常预警")
@TableField(value = "gklx")
private int gklx;
}
package com.founder.commonutils.ZdryAndZdryApiVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-06-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="UsersAndOnlineVo对象", description="UsersAndOnlineVo对象")
public class UsersAndOnlineVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "姓名")
private String xm;
@ApiModelProperty(value = "性别 1男 2女 0未知")
private Integer xb;
@ApiModelProperty(value = "家庭住址")
private String jtZz;
@ApiModelProperty(value = "是否有前科 1是 0否")
private Integer sfyQk;
@ApiModelProperty(value = "现住址")
private String xzz;
@ApiModelProperty(value = "病史")
private String bs;
@ApiModelProperty(value = "病情等级 1低 2中 3高 4极高")
private Integer bqDj;
@ApiModelProperty(value = "监护人1姓名")
private String jhr1Xm;
@ApiModelProperty(value = "监护人1关系")
private String jhr1Gx;
@ApiModelProperty(value = "监护人1联系电话")
private String jhr1Lxdh;
@ApiModelProperty(value = "监护人1紧急电话")
private String jhr1Jjdh;
@ApiModelProperty(value = "监护人2姓名")
private String jhr2Xm;
@ApiModelProperty(value = "监护人2关系")
private String jhr2Gx;
@ApiModelProperty(value = "监护人2联系电话")
private String jhr2Lxdh;
@ApiModelProperty(value = "监护人2紧急电话")
private String jhr2Jjdh;
@ApiModelProperty(value = "设备IMEI")
private String sbImei;
@ApiModelProperty(value = "设备型号")
private String sbXh;
@ApiModelProperty(value = "身份证号码")
private String sfzhm;
@ApiModelProperty(value = "是否在线 1在线 0离线")
private String online;
@ApiModelProperty(value = "是否佩戴 1佩戴 0位佩戴")
private String WearFlag;
@ApiModelProperty(value = "最新发生时间")
private String locationUpdatedAt;
@ApiModelProperty(value = "最新位置经度")
private String lastLocationX;
@ApiModelProperty(value = "最新位置纬度")
private String lastLocationY;
@ApiModelProperty(value = "最新位置地址")
private String lastAddress;
@ApiModelProperty(value = "1本人佩戴 0不是本人")
private Integer ismeWearFlag;
}
package com.founder.commonutils.ZdryApiEntity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-06-16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="BloodMessage对象", description="BloodMessage对象")
@TableName("gk_blood")
public class BloodMessage implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "信息主键编号自增长")
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "设备Imei")
@TableField(value = "sb_imei")
private String sbImei;
@ApiModelProperty(value = "发生时间YYYY-MM-DD HH:mm:SS")
@TableField(value = "time_begin")
private String timeBegin;
@ApiModelProperty(value = "血氧百分比")
@TableField(value = "bloodoxygen")
private int bloodoxygen;
@ApiModelProperty(value = "血氧报警上限")
@TableField(value = "bloodoxygen_h")
private int bloodoxygenH;
@ApiModelProperty(value = "血氧报警下限")
@TableField(value = "bloodoxygen_l")
private int bloodoxygenL;
@ApiModelProperty(value = "登记时间")
@TableField(fill = FieldFill.INSERT)
private Date djsj;
@ApiModelProperty(value = "改写时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gxsj;
}
package com.founder.commonutils.ZdryApiEntity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-06-13
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="DbpMessage对象", description="DbpMessage对象")
@TableName("gk_dbp")
public class DbpMessage implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "信息主键编号自增长")
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "设备Imei")
@TableField(value = "sb_imei")
private String sbImei;
@ApiModelProperty(value = "发生时间YYYY-MM-DD HH:mm:SS")
@TableField(value = "time_begin")
private String timeBegin;
@ApiModelProperty(value = "舒张压")
@TableField(value = "dbp")
private int dbp;
@ApiModelProperty(value = "舒张压报警下限")
@TableField(value = "dbp_l")
private int dbp_l;
@ApiModelProperty(value = "收缩压")
@TableField(value = "sbp")
private int sbp;
@ApiModelProperty(value = "收缩压报警上限")
@TableField(value = "sbp_h")
private int sbp_h;
@ApiModelProperty(value = "登记时间")
@TableField(fill = FieldFill.INSERT)
private Date djsj;
@ApiModelProperty(value = "改写时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gxsj;
}
package com.founder.commonutils.ZdryApiEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-05-31
*/
@Data
@ApiModel(value="device对象", description="device对象")
public class Device implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = " 计步数据开关")
int pedometer_enable ;
@ApiModelProperty(value = "睡眠数据开关")
int sleep_enable;
@ApiModelProperty(value = "轨迹开关")
int track_enable;
@ApiModelProperty(value = "心率、血氧、血压定时测量开关")
int heartrate_enable;
@ApiModelProperty(value = "IMEI")
String sbImei;
}
package com.founder.commonutils.ZdryApiEntity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-06-04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="fence对象", description="fence对象")
@TableName("gk_fencetask")
public class FenceTask implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "信息主键编号自增长")
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "设备Imei")
@TableField(value = "sb_imei")
private String sbImei;
@ApiModelProperty(value = "电子围栏名称")
@TableField(value = "name")
private String name;
@ApiModelProperty(value = "开始时间例早上八点:8")
@TableField(value = "time_begin")
private String timeBegin;
@ApiModelProperty(value = "结束时间例下午六点:18")
@TableField(value = "time_end")
private String timeEnd;
@ApiModelProperty(value = "A;B;C;D;A")
@TableField(value = "safe_area")
private String safeArea;
@ApiModelProperty(value = "登记时间")
@TableField(fill = FieldFill.INSERT)
private Date djsj;
@ApiModelProperty(value = "改写时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gxsj;
@ApiModelProperty(value = "信息删除判断标志")
@TableField(value = "xxsc_pdbz")
private int xxscPdbz;
@ApiModelProperty(value = "任务类型")
@TableField(value = "task_type")
private String taskType;
@ApiModelProperty(value = "预警")
@TableField(value = "warn")
private int warn;
@ApiModelProperty(value = "1进入区域 2离开区域 3异常预警")
@TableField(value = "gklx")
private int gklx;
@ApiModelProperty(value = "信息登记单位公安机关机构代码")
private String xxdjdwGajgjgdm;
@ApiModelProperty(value = "信息登记单位公安机关机构名称")
private String xxdjdwGajgjgmc;
}
package com.founder.commonutils.ZdryApiEntity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-06-13
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="HeartrateMessage对象", description="HeartrateMessage对象")
@TableName("gk_heartrate")
public class HeartrateMessage implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "信息主键编号自增长")
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "设备Imei")
@TableField(value = "sb_imei")
private String sbImei;
@ApiModelProperty(value = "发生时间YYYY-MM-DD HH:mm:SS")
@TableField(value = "time_begin")
private String timeBegin;
@ApiModelProperty(value = "心率")
@TableField(value = "heartrate")
private int heartrate;
@ApiModelProperty(value = "心率阈值上限")
@TableField(value = "theshold_heartrate_h")
private int theshold_heartrate_h;
@ApiModelProperty(value = "心率阈值下限")
@TableField(value = "theshold_heartrate_l")
private int theshold_heartrate_l;
@ApiModelProperty(value = "登记时间")
@TableField(fill = FieldFill.INSERT)
private Date djsj;
@ApiModelProperty(value = "改写时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gxsj;
}
package com.founder.commonutils.ZdryApiEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-05-31
*/
@Data
@ApiModel(value="locationData对象", description="locationData对象")
public class LocationData implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = " 设备")
private String device ;
@ApiModelProperty(value = "记录时间")
private String created_at;
@ApiModelProperty(value = "发生时间")
private String time_begin;
@ApiModelProperty(value = "0:Gps定位; 1:基站定位")
private String type;
@ApiModelProperty(value = "城市")
private String city;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "x经度")
private String x;
@ApiModelProperty(value = "y纬度")
private String y;
}
package com.founder.commonutils.ZdryApiEntity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-06-04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="LocationMessage对象", description="LocationMessage对象")
@TableName("gk_LocationMessage")
public class LocationMessage implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "信息主键编号自增长")
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "设备Imei")
@TableField(value = "sb_imei")
private String sbImei;
@ApiModelProperty(value = "类型 0:Gps定位; 1:基站定位(移动/联通版定位) 2:电信基站版定位")
@TableField(value = "type")
private int type;
@ApiModelProperty(value = "发生时间YYYY-MM-DD HH:mm:SS")
@TableField(value = "time_begin")
private String timeBegin;
@ApiModelProperty(value = "是否为响应")
@TableField(value = "is_reply")
private int isReply;
@ApiModelProperty(value = "是否轨迹")
@TableField(value = "is_track")
private int isTrack;
@ApiModelProperty(value = "城市")
@TableField(value = "city")
private String city;
@ApiModelProperty(value = "地址")
@TableField(value = "address")
private String address;
@ApiModelProperty(value = "经度")
@TableField(value = "x")
private String x;
@ApiModelProperty(value = "经度")
@TableField(value = "y")
private String y;
@ApiModelProperty(value = "登记时间")
@TableField(fill = FieldFill.INSERT)
private Date djsj;
@ApiModelProperty(value = "改写时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gxsj;
}
package com.founder.commonutils.ZdryApiEntity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-06-04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="message对象", description="message对象")
@TableName("gk_message")
public class Message implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "信息主键编号自增长")
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "设备Imei")
@TableField(value = "sb_imei")
private String sbImei;
@ApiModelProperty(value = "type=1 SOS,type=2 fall,type=3 new 新成员加入 ,type=4 电子围栏触发, type=5 设备低电,type=6 环境音")
@TableField(value = "type")
private int type;
@ApiModelProperty(value = "机构ID")
@TableField(value = "communityid")
private String communityId;
@ApiModelProperty(value = "只有环境音(type=6)为必填,其他type都为非必填")
@TableField(value = "url")
private String url;
@ApiModelProperty(value = "设备名称")
@TableField(value = "name")
private String name;
@ApiModelProperty(value = "登记时间")
@TableField(fill = FieldFill.INSERT)
private Date djsj;
@ApiModelProperty(value = "改写时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gxsj;
}
package com.founder.commonutils.ZdryApiEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-06-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="gk_online对象", description="gk_online对象")
@TableName("gk_online")
public class OnlineAndWear implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "信息主键编号")
@TableId(type = IdType.AUTO)
private String id;
@ApiModelProperty(value = "设备Imei")
@TableField(value = "sb_imei")
private String sbImei;
@ApiModelProperty(value = "是否在线 1在线 0离线")
@TableField(value = "online")
private String online;
@ApiModelProperty(value = "是否佩戴 1佩戴 0位佩戴")
@TableField(value = "wear_flag")
private String WearFlag;
@ApiModelProperty(value = "最新发生时间")
@TableField(value = "location_updated_at")
private String locationUpdatedAt;
@ApiModelProperty(value = "最新位置经度")
@TableField(value = "last_location_x")
private String lastLocationX;
@ApiModelProperty(value = "最新位置纬度")
@TableField(value = "last_location_y")
private String lastLocationY;
@ApiModelProperty(value = "最新位置地址")
@TableField(value = "last_address")
private String lastAddress;
@ApiModelProperty(value = "姓名")
@TableField(value = "xm")
private String xm;
}
package com.founder.commonutils.ZdryApiEntity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-06-16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="StepMessage对象", description="StepMessage对象")
@TableName("gk_stepNumber")
public class StepMessage implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "信息主键编号自增长")
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "设备Imei")
@TableField(value = "sb_imei")
private String sbImei;
@ApiModelProperty(value = "发生时间YYYY-MM-DD HH:mm:SS")
@TableField(value = "time_begin")
private String timeBegin;
@ApiModelProperty(value = "步数")
@TableField(value = "value")
private int value;
@ApiModelProperty(value = "登记时间")
@TableField(fill = FieldFill.INSERT)
private Date djsj;
@ApiModelProperty(value = "改写时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gxsj;
}
package com.founder.commonutils.zdryEntity;
import com.founder.commonutils.ZdryApiEntity.Device;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author yangyang
* @since 2021-05-31
*/
@Data
@ApiModel(value="UsersAndDevice对象", description="UsersAndDevice对象")
public class UsersAndDevice implements Serializable {
private Users users;
private Device device;
public Users getUsers() {
return users;
}
public void setUsers(Users users) {
this.users = users;
}
public Device getDevice() {
return device;
}
public void setDevice(Device device) {
this.device = device;
}
}
......@@ -15,38 +15,27 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration//配置类
@EnableSwagger2 //swagger注解
public class SwaggerConfig {
public static final String zdry = "com.founder.zdry";
public static final String zdryApi = "com.founder.zdryapi";
public static final String bz = "com.founder.bz";
@Bean
public Docket asjApi(){
return new Docket(DocumentationType.SWAGGER_2)
.groupName("zdry")
.groupName("bz")
.apiInfo(webApiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage(zdry))
.apis(RequestHandlerSelectors.basePackage(bz))
.paths(Predicates.not(PathSelectors.regex("/admin/.*")))
.paths(Predicates.not(PathSelectors.regex("/error.*")))
.build();
}
@Bean
public Docket esApi(){
return new Docket(DocumentationType.SWAGGER_2)
.groupName("zdryApi")
.apiInfo(webApiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage(zdryApi))
.paths(Predicates.not(PathSelectors.regex("/admin/.*")))
.paths(Predicates.not(PathSelectors.regex("/error.*")))
.build();
}
private ApiInfo webApiInfo(){
return new ApiInfoBuilder()
.title("重点人员API文档")
.description("本文档描述了时空大数据微服务接口定义")
.title("公安部标注平台API文档")
.description("本文档描述了公安部微服务接口定义")
.version("1.0")
.contact(new Contact("java", "http://atguigu.com", "chang_chao@founder.com"))
.contact(new Contact("java", "http://atguigu.com", "yang_yang5@founder.com"))
.build();
}
}
......@@ -9,9 +9,9 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>zdry</artifactId>
<artifactId>bz</artifactId>
<build>
<finalName>zdry</finalName>
<finalName>bz</finalName>
</build>
</project>
\ No newline at end of file
package com.founder.zdry;
package com.founder.bz;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......@@ -10,11 +10,11 @@ import org.springframework.context.annotation.ComponentScan;
@ComponentScan(basePackages = {"com.founder"})
@EnableDiscoveryClient
@EnableFeignClients
public class ZdryApplication {
public class BzApplication {
public static void main(String[] args) {
SpringApplication.run(ZdryApplication.class, args);
SpringApplication.run(BzApplication.class, args);
}
}
package com.founder.zdry.controller;
package com.founder.bz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -6,7 +6,7 @@ import com.founder.commonutils.constant.CommonCodeConstant;
import com.founder.commonutils.publicEntity.MapRestResult;
import com.founder.commonutils.publicEntity.ResultCode;
import com.founder.commonutils.zdryEntity.DlUsers;
import com.founder.zdry.service.DlUserService;
import com.founder.bz.service.DlUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......
package com.founder.zdry.mapper;
package com.founder.bz.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.zdryEntity.DlUsers;
......
<?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="com.founder.zdry.mapper.DlUserMapper">
<mapper namespace="com.founder.bz.mapper.DlUserMapper">
</mapper>
package com.founder.zdry.service;
package com.founder.bz.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.founder.commonutils.zdryEntity.DlUsers;
......
package com.founder.zdry.service.impl;
package com.founder.bz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.founder.commonutils.constant.CommonCodeConstant;
import com.founder.commonutils.zdryEntity.DlUsers;
import com.founder.zdry.mapper.DlUserMapper;
import com.founder.zdry.service.DlUserService;
import com.founder.bz.mapper.DlUserMapper;
import com.founder.bz.service.DlUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......
......@@ -8,13 +8,13 @@ spring.cloud.nacos.discovery.server-addr=47.92.48.137:9949
spring.profiles.active=dev
# 该配置影响统一配置中心中的dataId
spring.application.name=zdry
spring.application.name=bz
spring.cloud.nacos.config.namespace=f1160b5f-cef5-4e86-bddc-c55e28c2d8b0
#spring.cloud.nacos.config.ext-config[0].data-id=image.properties
# 开启动态刷新配置,否则配置文件修改,工程无法感知
#spring.cloud.nacos.config.ext-config[0].refresh=true
spring.cloud.nacos.config.shared-dataids=zdrypz.properties
spring.cloud.nacos.config.refreshable-dataids=zdrypz.properties
#spring.cloud.nacos.config.shared-dataids=bzpz.properties
#spring.cloud.nacos.config.refreshable-dataids=bzpz.properties
management.health.elasticsearch.enabled: false
\ No newline at end of file
......@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>zdry</module>
<module>bz</module>
</modules>
<artifactId>service</artifactId>
<dependencies>
......@@ -97,8 +97,7 @@
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
-->
<!-- <dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.4.3</version>
......@@ -107,8 +106,7 @@
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>6.4.3</version>
</dependency>-->
</dependency>
<!--spring切面aop依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
......
package com.founder.zdry.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineAndTasksVo;
import com.founder.commonutils.ZdryApiEntity.FenceTask;
import com.founder.commonutils.constant.CommonCodeConstant;
import com.founder.commonutils.publicEntity.MapRestResult;
import com.founder.commonutils.publicEntity.ResultCode;
import com.founder.commonutils.zdryEntity.DlUsers;
import com.founder.zdry.fegin.ServerZdryApi;
import com.founder.zdry.service.FenceTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
* 前端控制器
* </p>
*
* @author yangyang
* @since 2021-06-05
*/
@RestController
@Api(tags = "任务管理")
@RequestMapping("/fence")
public class FenceTaskController {
@Autowired
private FenceTaskService fenceTaskService;
@Autowired
private ServerZdryApi serverZdryApi;
@ApiOperation(value = "分页围栏任务列表")
@GetMapping("fenceTaskList/{page}/{limit}")
public MapRestResult fenceTaskList(
@ApiParam(name = "page", value = "当前页码", required = true)
@PathVariable Long page,
@ApiParam(name = "limit", value = "每页记录数", required = true)
@PathVariable Long limit,
@ApiParam(name = "gklx", value = "任务类型")
@RequestParam(required = false) String gklx,
@ApiParam(name = "sbimei", value = "设备IMEI")
@RequestParam(required = false) String sbimei,
@ApiParam(name = "name", value = "任务名称")
@RequestParam(required = false) String name,
HttpServletRequest httpServletRequest
){
// 登陆者信息
DlUsers user=(DlUsers)httpServletRequest.getSession().getAttribute(CommonCodeConstant.LOGIN_USER_KEY);
Page<FenceTask> pageParam = new Page<>(page, limit);
QueryWrapper<FenceTask> wrapper = new QueryWrapper<>();
if(null != user){// 市局 分局 派出所
String code = "";
if(user.getUnitCode().endsWith("00000000")){
code = user.getUnitCode().substring(0,4);
}else if(user.getUnitCode().endsWith("000000")){
code = user.getUnitCode().substring(0,6);
}else if(user.getUnitCode().endsWith("0000")){
code = user.getUnitCode().substring(0,8);
}else{
code = user.getUnitCode();
}
wrapper.like("xxdjdw_gajgjgdm", code);
}
if(StringUtils.isNotBlank(gklx)){
wrapper.eq("gklx", gklx);
}
if(StringUtils.isNotBlank(sbimei)){
wrapper.like("sb_imei", sbimei);
}
if(StringUtils.isNotBlank(name)){
wrapper.like("name", name);
}
wrapper.eq("xxsc_pdbz", "0");
wrapper.orderByAsc("djsj");
fenceTaskService.page(pageParam, wrapper);
List<FenceTask> records = pageParam.getRecords();
long total = pageParam.getTotal();
return MapRestResult.build(ResultCode.SUCCESS,"成功获取任务列表信息",total,records);
}
@ApiOperation(value = "分页任务关联人列表")
@GetMapping("fenceTaskPeopleList/{page}/{limit}")
public MapRestResult fenceTaskPeopleList(
@ApiParam(name = "page", value = "当前页码", required = true)
@PathVariable Long page,
@ApiParam(name = "limit", value = "每页记录数", required = true)
@PathVariable Long limit,
@ApiParam(name = "xm", value = "姓名")
@RequestParam(required = false) String xm,
@ApiParam(name = "bs", value = "病史")
@RequestParam(required = false) String bs,
@ApiParam(name = "sbimei", value = "设备IMEI")
@RequestParam(required = false) String sbimei,
@ApiParam(name = "bqdj", value = "病情等级")
@RequestParam(required = false) String bqdj,
@ApiParam(name = "sfzhm", value = "身份证号码")
@RequestParam(required = false) String sfzhm,
HttpServletRequest httpServletRequest
){
DlUsers user=(DlUsers)httpServletRequest.getSession().getAttribute(CommonCodeConstant.LOGIN_USER_KEY);
Map map = new HashMap();
map.put("page",page * limit);
map.put("limit",limit);
map.put("sbimei",sbimei);
map.put("xm",xm);
map.put("bs",bs);
map.put("bqdj",bqdj);
map.put("sfzhm",sfzhm);
if(null != user){// 市局 分局 派出所
String code = "";
if(user.getUnitCode().endsWith("00000000")){
code = user.getUnitCode().substring(0,4);
}else if(user.getUnitCode().endsWith("000000")){
code = user.getUnitCode().substring(0,6);
}else if(user.getUnitCode().endsWith("0000")){
code = user.getUnitCode().substring(0,8);
}else{
code = user.getUnitCode();
}
map.put("xxdjdwGajgjgdm",code);
}
List<UsersAndOnlineAndTasksVo> list = fenceTaskService.fenceTaskPeopleList(map);
Integer total = fenceTaskService.fenceTaskPeopleListCount(map);
return MapRestResult.build(ResultCode.SUCCESS,"分页任务关联人列表",total,list);
}
@ApiOperation(value = "设置电子围栏")
@PostMapping(value = "/deviceFenceTask")
public MapRestResult deviceFenceTask(@ApiParam(name = "sbImei", value = "设备IMEI", required = true)
@RequestParam(value = "sbImei") String sbImei,
@ApiParam(name = "name", value = "电子围栏名称", required = true)
@RequestParam(value = "name") String name,
@ApiParam(name = "time_begin", value = "开始时间例早上八点:08:00", required = true)
@RequestParam(value = "time_begin") String time_begin,
@ApiParam(name = "time_end", value = "结束时间例下午六点:18:00", required = true)
@RequestParam(value = "time_end") String time_end,
@ApiParam(name = "safe_area", value = "A;B;C;D;A", required = true)
@RequestParam(value = "safe_area") String safe_area,
@ApiParam(name = "gklx", value = "1进入区域 2离开区域 3异常预警", required = true)
@RequestParam(value = "gklx") int gklx,
HttpServletRequest httpServletRequest
) {
// 登陆者信息
DlUsers user=(DlUsers)httpServletRequest.getSession().getAttribute(CommonCodeConstant.LOGIN_USER_KEY);
return serverZdryApi.deviceFenceTask(sbImei,name,time_begin,time_end,safe_area,gklx,user.getUnitCode(),user.getTrueName());
}
}
package com.founder.zdry.fegin;
import com.founder.commonutils.ZdryApiEntity.Device;
import com.founder.commonutils.publicEntity.MapRestResult;
import com.founder.zdry.fegin.fallback.FallBackZdryApi;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
/**
* Created by yyon 2021/05/31
* 调用zdryapi子系统
**/
@FeignClient(value = "zdryapi", fallback = FallBackZdryApi.class)
public interface ServerZdryApi {
@PostMapping("/zdryapi/getDevice")
Device getDevice(@RequestParam(value = "deviceId") String deviceId);
@PostMapping("/zdryapi/updateDevice")
String updateDevice(@RequestBody Device deviceParam);
@PostMapping("/zdryapi/deviceFenceTask")
MapRestResult deviceFenceTask(
@RequestParam(value = "sbImei") String sbImei,
@RequestParam(value = "name") String name,
@RequestParam(value = "time_begin") String time_begin,
@RequestParam(value = "time_end") String time_end,
@RequestParam(value = "safe_area") String safe_area,
@RequestParam(value = "gklx") int gklx,
@RequestParam(value = "xxdjdw_gajgjgdm") String xxdjdw_gajgjgdm,
@RequestParam(value = "xxdjdw_gajgjgmc") String xxdjdw_gajgjgmc
);
}
package com.founder.zdry.fegin.fallback;
import com.founder.commonutils.ZdryApiEntity.Device;
import com.founder.commonutils.publicEntity.MapRestResult;
import com.founder.zdry.fegin.ServerZdryApi;
import io.swagger.annotations.ApiParam;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
/**
* Created by yangyang on 2021/05/31
* 调用ZdryApi子系统异常反馈
**/
@Component
public class FallBackZdryApi implements ServerZdryApi {
@Override
public Device getDevice(@RequestParam(value = "deviceId") String deviceId) {
return null;
}
@Override
public String updateDevice(@RequestBody Device deviceParam) {
return "zdryapi服务器发生异常,断路器进行反馈";
}
@Override
public MapRestResult deviceFenceTask(String sbImei, String name, String time_begin, String time_end, String safe_area, int gklx, String xxdjdw_gajgjgdm,
String xxdjdw_gajgjgmc) {
return MapRestResult.build(201,"zdryapi服务器发生异常,断路器进行反馈","1","1");
}
}
\ No newline at end of file
package com.founder.zdry.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineAndTasksVo;
import com.founder.commonutils.ZdryApiEntity.FenceTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-06-05
*/
@Mapper
@Component
public interface FenceTaskMapper extends BaseMapper<FenceTask> {
List<UsersAndOnlineAndTasksVo> fenceTaskPeopleList(Map map);
Integer fenceTaskPeopleListCount(Map map);
}
package com.founder.zdry.mapper;
import com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineVo;
import com.founder.commonutils.zdryEntity.Users;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-05-30
*/
@Mapper
@Component
public interface UsersMapper extends BaseMapper<Users> {
List<UsersAndOnlineVo> userPageOnlineList(Map map);
Integer userPageOnlineListCount(Map map);
List<Map<String,Object>> userDbpList(Map map);
Integer userDbpListCount(Map map);
List<Map<String,Object>> userHeartrateList(Map map);
Integer userHeartrateListCount(Map map);
List<Map<String,Object>> userStepList(Map map);
Integer userStepListCount(Map map);
}
<?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="com.founder.zdry.mapper.FenceTaskMapper">
<sql id="queryTlWhere">
<if test="xxdjdwGajgjgdm!= null and xxdjdwGajgjgdm!=''">
AND task.xxdjdw_gajgjgdm LIKE concat(#{xxdjdwGajgjgdm,jdbcType=VARCHAR}, '%')
</if>
<if test="xm!= null and xm!=''">
AND users.xm LIKE concat('%', #{xm,jdbcType=VARCHAR}, '%')
</if>
<if test="sbimei!= null and sbimei != ''">
AND users.sb_imei= #{ sbimei , jdbcType=INTEGER }
</if>
<if test="bs!= null and bs != ''">
AND users.bs LIKE concat('%', #{bs,jdbcType=VARCHAR}, '%')
</if>
<if test="sfzhm!= null and sfzhm != ''">
AND users.sfzhm LIKE concat('%', #{sfzhm,jdbcType=VARCHAR}, '%')
</if>
<if test="bq_dj!= null and bq_dj != ''">
AND users.bq_dj= #{ bq_dj , jdbcType=INTEGER }
</if>
<if test="online!= null and online != ''">
AND online.online= #{ online , jdbcType=INTEGER }
</if>
<if test="wearFlag!= null and wearFlag != ''">
AND online.wear_flag= #{ wearFlag , jdbcType=INTEGER }
</if>
</sql>
<select id="fenceTaskPeopleList" parameterType="java.util.Map" resultType="com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineAndTasksVo">
select
users.xm as xm,
users.xb as xb,
users. jt_zz as jtZz,
users.sfy_qk as sfyQk,
users.xzz as xzz,
users.bs as bs,
users.bq_dj as bqDj,
users.jhr1_xm as jhr1Xm,
users.jhr1_gx as jhr1Gx,
users.jhr1_lxdh as jhr1Lxdh,
users.jhr1_jjdh as jhr1Jjdh,
users.jhr2_xm as jhr2Xm,
users. jhr2_gx as jhr2Gx,
users.jhr2_lxdh as jhr2Lxdh,
users. jhr2_jjdh as jhr2Jjdh,
users. sb_imei as sbImei,
users. sb_xh as sbXh,
users.sfzhm as sfzhm,
online.online as online,
online.Wear_flag as WearFlag,
online.location_updated_at as locationUpdatedAt,
online.last_location_x as lastLocationX,
online.last_location_y as lastLocationY,
online.last_address as lastAddress,
task.name as name,
task.time_begin as timeBegin,
task.time_end as timeEnd,
task.safe_area as safeArea,
task.task_type as taskType,
task.warn as warn,
task.gklx as gklx
from gk_users users,gk_online online,gk_fencetask task
where users.sb_imei = online.sb_imei
and users.sb_imei = task.sb_imei
and users.xxsc_pdbz = 0
<include refid="queryTlWhere"/>
limit #{ page },#{ limit}
</select>
<select id="fenceTaskPeopleListCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select
count(*)
from gk_users users,gk_online online,gk_fencetask task
where users.sb_imei = online.sb_imei
and users.sb_imei = task.sb_imei
and users.xxsc_pdbz = 0
<include refid="queryTlWhere"/>
</select>
</mapper>
<?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="com.founder.zdry.mapper.UsersMapper">
<sql id="queryWhere">
<if test="xxdjdwGajgjgdm!= null and xxdjdwGajgjgdm!=''">
AND users.xxdjdw_gajgjgdm LIKE concat(#{xxdjdwGajgjgdm,jdbcType=VARCHAR}, '%')
</if>
<if test="xm!= null and xm!=''">
AND users.xm LIKE concat('%', #{xm,jdbcType=VARCHAR}, '%')
</if>
<if test="sbimei!= null and sbimei != ''">
AND users.sb_imei= #{ sbimei, jdbcType=INTEGER }
</if>
<if test="online!= null and online != ''">
AND online.online= #{ online, jdbcType=INTEGER }
</if>
<if test="wearFlag!= null and wearFlag != ''">
AND users.wear_flag= #{ wearFlag, jdbcType=INTEGER }
</if>
<if test="ismeWearFlag!= null and ismeWearFlag != ''">
AND users.isme_wear_flag= #{ ismeWearFlag, jdbcType=INTEGER }
</if>
</sql>
<select id="userPageOnlineList" parameterType="Map" resultType="com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineVo">
select
users.xm as xm,
users.xb as xb,
users. jt_zz as jtZz,
users.sfy_qk as sfyQk,
users.xzz as xzz,
users.bs as bs,
users.bq_dj as bqDj,
users.jhr1_xm as jhr1Xm,
users.jhr1_gx as jhr1Gx,
users.jhr1_lxdh as jhr1Lxdh,
users.jhr1_jjdh as jhr1Jjdh,
users.jhr2_xm as jhr2Xm,
users. jhr2_gx as jhr2Gx,
users.jhr2_lxdh as jhr2Lxdh,
users. jhr2_jjdh as jhr2Jjdh,
users. sb_imei as sbImei,
users. sb_xh as sbXh,
users.sfzhm as sfzhm,
online.online as online,
users.Wear_flag as WearFlag,
users.isme_wear_flag as ismeWearFlag,
online.location_updated_at as locationUpdatedAt,
online.last_location_x as lastLocationX,
online.last_location_y as lastLocationY,
online.last_address as lastAddress
from gk_users users,gk_online online
where users.sb_imei = online.sb_imei
and users.xxsc_pdbz = 0
<include refid="queryWhere"/>
limit #{ page },#{ limit}
</select>
<select id="userPageOnlineListCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select
count(*)
from gk_users users,gk_online online
where users.sb_imei = online.sb_imei
and users.xxsc_pdbz = 0
<include refid="queryWhere"/>
</select>
<select id="userDbpList" parameterType="Map" resultType="Map">
select
users.xm as xm,
users.xb as xb,
users. sb_imei as sbImei,
users.sfzhm as sfzhm,
dbp.time_begin as timeBegin,
dbp.dbp as dbp,
dbp.dbp_l as dbpL,
dbp.sbp as sbp,
dbp.sbp_h as sbpH
from gk_users users,gk_dbp dbp
where users.sb_imei = dbp.sb_imei
and users.xxsc_pdbz = 0
<if test="sbimei!= null and sbimei != ''">
AND users.sb_imei= #{ sbimei, jdbcType=INTEGER }
</if>
order by dbp.time_begin desc
limit #{ page },#{ limit}
</select>
<select id="userDbpListCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select
count(*)
from gk_users users,gk_dbp dbp
where users.sb_imei = dbp.sb_imei
and users.xxsc_pdbz = 0
<if test="sbimei!= null and sbimei != ''">
AND users.sb_imei= #{ sbimei, jdbcType=INTEGER }
</if>
</select>
<select id="userHeartrateList" parameterType="Map" resultType="Map">
select
users.xm as xm,
users.xb as xb,
users.sfzhm as sfzhm,
heart.time_begin as timeBegin,
heart.heartrate as heartrate,
heart.theshold_heartrate_h as thesholdHeartrateH,
heart.theshold_heartrate_l as thesholdHeartrateL
from gk_users users,gk_heartrate heart
where users.sb_imei = heart.sb_imei
and users.xxsc_pdbz = 0
<if test="sbimei!= null and sbimei != ''">
AND users.sb_imei= #{ sbimei, jdbcType=INTEGER }
</if>
order by heart.time_begin desc
limit #{ page },#{ limit}
</select>
<select id="userHeartrateListCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select
count(*)
from gk_users users,gk_heartrate heart
where users.sb_imei = heart.sb_imei
and users.xxsc_pdbz = 0
<if test="sbimei!= null and sbimei != ''">
AND users.sb_imei= #{ sbimei, jdbcType=INTEGER }
</if>
</select>
<select id="userStepList" parameterType="Map" resultType="Map">
select
users.xm as xm,
users.xb as xb,
users.sfzhm as sfzhm,
step.value as value,
step.time_begin as timeBegin
from gk_users users,gk_stepNumber step
where users.sb_imei = step.sb_imei
and users.xxsc_pdbz = 0
<if test="sbimei!= null and sbimei != ''">
AND users.sb_imei= #{ sbimei, jdbcType=INTEGER }
</if>
order by step.time_begin desc
limit #{ page },#{ limit}
</select>
<select id="userStepListCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select
count(*)
from gk_users users,gk_stepNumber step
where users.sb_imei = step.sb_imei
and users.xxsc_pdbz = 0
<if test="sbimei!= null and sbimei != ''">
AND users.sb_imei= #{ sbimei, jdbcType=INTEGER }
</if>
</select>
</mapper>
package com.founder.zdry.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineAndTasksVo;
import com.founder.commonutils.ZdryApiEntity.FenceTask;
import java.util.List;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author yangyang
* @since 2021-06-05
*/
public interface FenceTaskService extends IService<FenceTask> {
List<UsersAndOnlineAndTasksVo> fenceTaskPeopleList(Map map);
Integer fenceTaskPeopleListCount(Map map);
}
package com.founder.zdry.service;
import com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineVo;
import com.founder.commonutils.zdryEntity.Users;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author yangyang
* @since 2021-05-30
*/
public interface UsersService extends IService<Users> {
List<UsersAndOnlineVo> userPageOnlineList(Map map);
Integer userPageOnlineListCount(Map map);
List<Map<String,Object>> userDbpList(Map map);
Integer userDbpListCount(Map map);
List<Map<String,Object>> userHeartrateList(Map map);
Integer userHeartrateListCount(Map map);
List<Map<String,Object>> userStepList(Map map);
Integer userStepListCount(Map map);
}
package com.founder.zdry.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineAndTasksVo;
import com.founder.commonutils.ZdryApiEntity.FenceTask;
import com.founder.zdry.mapper.FenceTaskMapper;
import com.founder.zdry.service.FenceTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* <p>
* 服务实现类
* </p>
*
* @author yangyang
* @since 2021-06-05
*/
@Service
public class FenceTaskServiceImpl extends ServiceImpl<FenceTaskMapper, FenceTask> implements FenceTaskService {
@Autowired
private FenceTaskMapper fenceTaskMapper;
@Override
public List<UsersAndOnlineAndTasksVo> fenceTaskPeopleList(Map map) {
return fenceTaskMapper.fenceTaskPeopleList(map);
}
@Override
public Integer fenceTaskPeopleListCount(Map map) {
return fenceTaskMapper.fenceTaskPeopleListCount(map);
}
}
package com.founder.zdry.service.impl;
import com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineVo;
import com.founder.commonutils.zdryEntity.Users;
import com.founder.zdry.mapper.UsersMapper;
import com.founder.zdry.service.UsersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* <p>
* 服务实现类
* </p>
*
* @author yangyang
* @since 2021-05-30
*/
@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {
@Autowired
private UsersMapper usersMapper;
@Override
public List<UsersAndOnlineVo> userPageOnlineList(Map map) {
return usersMapper.userPageOnlineList(map);
}
@Override
public Integer userPageOnlineListCount(Map map) {
return usersMapper.userPageOnlineListCount(map);
}
@Override
public List<Map<String, Object>> userDbpList(Map map) {
return usersMapper.userDbpList(map);
}
@Override
public Integer userDbpListCount(Map map) {
return usersMapper.userDbpListCount(map);
}
@Override
public List<Map<String, Object>> userHeartrateList(Map map) {
return usersMapper.userHeartrateList(map);
}
@Override
public Integer userHeartrateListCount(Map map) {
return usersMapper.userHeartrateListCount(map);
}
@Override
public List<Map<String, Object>> userStepList(Map map) {
return usersMapper.userStepList(map);
}
@Override
public Integer userStepListCount(Map map) {
return usersMapper.userStepListCount(map);
}
}
......@@ -10,7 +10,6 @@
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>zdryapi</module>
</modules>
<artifactId>serviceapi</artifactId>
<dependencies>
......
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>serviceapi</artifactId>
<groupId>com.founder</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>zdryapi</artifactId>
<build>
<finalName>zdryapi</finalName>
</build>
</project>
\ No newline at end of file
package com.founder.zdryapi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
@ComponentScan(basePackages = {"com.founder"})
@EnableDiscoveryClient
@EnableScheduling
public class ZdryApiApplication {
@Autowired
private RestTemplateBuilder restTemplateBuilder;
public static void main(String[] args) {
SpringApplication.run(ZdryApiApplication.class, args);
}
@Bean
public RestTemplate restTemplate(){return restTemplateBuilder.build();}
}
package com.founder.zdryapi.controller;
import com.founder.commonutils.ZdryApiEntity.Device;
import com.founder.commonutils.publicEntity.MapRestResult;
import com.founder.zdryapi.service.ZdryApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
/**
* <p>
* 第三方爱牵挂接口管理 前端控制器
* </p>
*
* @author yangyang
* @since 2021-05-31
*/
@Api(description = "第三方接口管理-爱牵挂")
@RestController
@RequestMapping("/zdryapi")
@Component
public class ZdryApiController {
@Autowired
private ZdryApiService zdryApiService;
//获取token
@ApiOperation(value = "token获取")
@PostMapping("/token")
public MapRestResult getToken() {
String accessToken = zdryApiService.getToken();
return MapRestResult.build(202,"成功获取token信息",accessToken);
}
@ApiOperation(value = "查看指定设备接口")
@PostMapping(value = "/getDevice")
public Device getDevice(@ApiParam(name = "deviceId", value = "设备IMEI", required = true)
@RequestParam(value = "deviceId") String deviceId) {
long startTime=new Date().getTime();
Device result=zdryApiService.getDevice(deviceId);
long endTime=new Date().getTime();
long timeDiffer=endTime-startTime;
System.out.println("查看指定设备接口**请求时长**********"+timeDiffer+"毫秒");
return result;
}
@ApiOperation(value = "修改指定设备接口")
@PostMapping(value = "/updateDevice")
public String updateDevice(@RequestBody Device deviceParam) {
return zdryApiService.updateDevice(deviceParam);
}
@ApiOperation(value = "查看设备定位数据")
@PostMapping(value = "/locationdata")
public MapRestResult locationdata(@ApiParam(name = "deviceId", value = "设备IMEI", required = true)
@RequestParam(value = "deviceId") String deviceId,
@ApiParam(name = "time_begin", value = "YYYYMMDD,查询指定日期的数据")
@RequestParam(required = false) String time_begin
) {
return zdryApiService.locationdata(deviceId,time_begin);
}
@ApiOperation(value = "批量获取设备离线在线状态数据")
@GetMapping(value = "/onlineAndWeardata")
//每隔5秒执行一次:*/5 * * * * ?
//每隔5分执行一次:0 */5 * * * ?
//每个整点执行一次:0 0 0/1 * * ?
//每天凌晨2点执行一次:0 0 2 * * ?
@Scheduled(cron = "0 0 0/1 * * ?")
public MapRestResult onlineAndWeardata() {
return zdryApiService.onlineAndWeardata();
}
@ApiOperation(value = "设置电子围栏")
@PostMapping(value = "/deviceFenceTask")
public MapRestResult deviceFenceTask(@ApiParam(name = "sbImei", value = "设备IMEI", required = true)
@RequestParam(value = "sbImei") String sbImei,
@ApiParam(name = "name", value = "电子围栏名称", required = true)
@RequestParam(value = "name") String name,
@ApiParam(name = "time_begin", value = "开始时间例早上八点:08:00", required = true)
@RequestParam(value = "time_begin") String time_begin,
@ApiParam(name = "time_end", value = "结束时间例下午六点:18:00", required = true)
@RequestParam(value = "time_end") String time_end,
@ApiParam(name = "safe_area", value = "A;B;C;D;A", required = true)
@RequestParam(value = "safe_area") String safe_area,
@ApiParam(name = "gklx", value = "1进入区域 2离开区域 3异常预警", required = true)
@RequestParam(value = "gklx") int gklx,
@ApiParam(name = "xxdjdw_gajgjgdm", value = "信息登记单位公安机关机构代码", required = true)
@RequestParam(value = "xxdjdw_gajgjgdm") String xxdjdw_gajgjgdm,
@ApiParam(name = "xxdjdw_gajgjgmc", value = "信息登记单位公安机关名称", required = true)
@RequestParam(value = "xxdjdw_gajgjgmc") String xxdjdw_gajgjgmc
) {
return zdryApiService.deviceFenceTask(sbImei,name,time_begin,time_end,safe_area,gklx,xxdjdw_gajgjgdm,xxdjdw_gajgjgmc);
}
@ApiOperation(value = "电子围栏预警")
@GetMapping(value = "/FenceWarning")
//每隔5秒执行一次:*/5 * * * * ?
//每隔5分执行一次:0 */5 * * * ?
//每个整点执行一次:0 0 0/1 * * ?
//每天凌晨2点执行一次:0 0 2 * * ?
@Scheduled(cron = "0 */10 * * * ?")
public MapRestResult FenceWarning()
{
return zdryApiService.FenceWarning();
}
@ApiOperation(value = "是否佩戴是否本人佩戴定时")
@GetMapping(value = "/wearFlag")
//每隔5秒执行一次:*/5 * * * * ?
//每隔5分执行一次:0 */5 * * * ?
//每个整点执行一次:0 0 0/1 * * ?
//每天凌晨2点执行一次:0 0 2 * * ?
@Scheduled(cron = "0 */10 * * * ?")
public MapRestResult wearFlag()
{
return zdryApiService.wearFlag();
}
@ApiOperation(value = "批量获取设备最新位置")
@PostMapping("/newLocationdataList")
public MapRestResult newLocationdataList(@RequestBody String[] imeis) {
return zdryApiService.newLocationdataList(imeis);
}
}
package com.founder.zdryapi.controller;
import com.founder.zdryapi.service.ZdryPushDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 第三方爱牵挂接口管理 前端控制器
* </p>
*
* @author yangyang
* @since 2021-05-31
*/
@Api(description = "第三方接口管理-爱牵挂数据推送接口调用")
@RestController
@RequestMapping("/aqgPushData")
@Component
public class ZdryPushDataController {
@Autowired
private ZdryPushDataService zdryPushDataService;
@ApiOperation(value = "消息通知推送接口")
@GetMapping(value = "/message")
public void message(@ApiParam(name = "type", value = "type=1 SOS,type=2 fall,type=3 new 新成员加入 ,type=4 电子围栏触发, type=5 设备低电,type=6 环境音", required = true)
@RequestParam(value = "type") Integer type,
@ApiParam(name = "deviceid", value = "设备Imei", required = true)
@RequestParam(value = "deviceid") String deviceid,
@ApiParam(name = "communityid", value = "机构ID", required = true)
@RequestParam(value = "communityid") String communityid,
@ApiParam(name = "url", value = " url")
@RequestParam(value = "url", required = false) String url,
@ApiParam(name = "name", value = "设备名称", required = true)
@RequestParam(value = "name") String name
) {
zdryPushDataService.message(type,deviceid,communityid,url,name);
}
@ApiOperation(value = "位置数据发送接口")
@PostMapping(value = "/locationMessage")
public void locationMessage(@ApiParam(name = "imei", value = "设备IMEI", required = true)
@RequestParam(value = "imei") String imei,
@ApiParam(name = "time_begin", value = "发生时间YYYY-MM-DD HH:mm:SS", required = true)
@RequestParam(value = "time_begin") String time_begin,
@ApiParam(name = "is_reply", value = "是否为响应", required = true)
@RequestParam(value = "is_reply") boolean is_reply,
@ApiParam(name = "is_track", value = "是否轨迹", required = true)
@RequestParam(value = "is_track") boolean is_track,
@ApiParam(name = "city", value = "城市", required = true)
@RequestParam(value = "city") String city,
@ApiParam(name = "address", value = "地址", required = true)
@RequestParam(value = "address") String address,
@ApiParam(name = "lon", value = "经度", required = true)
@RequestParam(value = "lon") double lon,
@ApiParam(name = "lat", value = "经度", required = true)
@RequestParam(value = "lat") double lat,
@ApiParam(name = "type", value = "类型 0:Gps定位; 1:基站定位(移动/联通版定位) 2:电信基站版定位", required = true)
@RequestParam(value = "type") int type
) {
zdryPushDataService.locationMessage(imei,time_begin,is_reply,is_track,city,address,lon,lat,type);
}
@ApiOperation(value = "心率数据发送接口")
@PostMapping(value = "/heartrateMessage")
public void heartrateMessage(@ApiParam(name = "imei", value = "设备IMEI", required = true)
@RequestParam(value = "imei") String imei,
@ApiParam(name = "time_begin", value = "发生时间YYYY-MM-DD HH:mm:SS", required = true)
@RequestParam(value = "time_begin") String time_begin,
@ApiParam(name = "heartrate", value = "心率", required = true)
@RequestParam(value = "heartrate") int heartrate,
@ApiParam(name = "theshold_heartrate_h", value = "心率阈值上限")
@RequestParam(required = false) int theshold_heartrate_h,
@ApiParam(name = "theshold_heartrate_l", value = "心率阈值下限")
@RequestParam(required = false) int theshold_heartrate_l
) {
zdryPushDataService.heartrateMessage(imei,time_begin,heartrate,theshold_heartrate_h,theshold_heartrate_l);
}
@ApiOperation(value = "血压数据发送接口")
@PostMapping(value = "/dbpMessage")
public void dbpMessage(@ApiParam(name = "imei", value = "设备IMEI", required = true)
@RequestParam(value = "imei") String imei,
@ApiParam(name = "time_begin", value = "发生时间YYYY-MM-DD HH:mm:SS", required = true)
@RequestParam(value = "time_begin") String time_begin,
@ApiParam(name = "dbp", value = "舒张压", required = true)
@RequestParam(value = "dbp") int dbp,
@ApiParam(name = "dbp_l", value = "舒张压报警下限", required = true)
@RequestParam(value = "dbp_l") int dbp_l,
@ApiParam(name = "sbp", value = "收缩压", required = true)
@RequestParam(value = "sbp") int sbp,
@ApiParam(name = "sbp_h", value = "收缩压报警上限", required = true)
@RequestParam(value = "sbp_h") int sbp_h
) {
zdryPushDataService.dbpMessage(imei,time_begin,dbp,dbp_l,sbp,sbp_h);
}
@ApiOperation(value = "血氧数据发送接口")
@PostMapping(value = "/bloodMessage")
public void bloodMessage(@ApiParam(name = "imei", value = "设备IMEI", required = true)
@RequestParam(value = "imei") String imei,
@ApiParam(name = "time_begin", value = "发生时间YYYY-MM-DD HH:mm:SS", required = true)
@RequestParam(value = "time_begin") String time_begin,
@ApiParam(name = "bloodoxygen", value = "血氧百分比", required = true)
@RequestParam(value = "bloodoxygen") int bloodoxygen,
@ApiParam(name = "bloodoxygen_h", value = "血氧报警上限")
@RequestParam(required = false) int bloodoxygen_h,
@ApiParam(name = "bloodoxygen_l", value = "血氧报警下限")
@RequestParam(required = false) int bloodoxygen_l
) {
zdryPushDataService.bloodMessage(imei,time_begin,bloodoxygen,bloodoxygen_h,bloodoxygen_l);
}
@ApiOperation(value = "计步数据发送接口")
@PostMapping(value = "/stepMessage")
public void stepMessage(@ApiParam(name = "imei", value = "设备IMEI", required = true)
@RequestParam(value = "imei") String imei,
@ApiParam(name = "time_begin", value = "发生时间YYYY-MM-DD HH:mm:SS", required = true)
@RequestParam(value = "time_begin") String time_begin,
@ApiParam(name = "value", value = "步数", required = true)
@RequestParam(value = "value") int value){
zdryPushDataService.stepMessage(imei,time_begin,value);
}
}
package com.founder.zdryapi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineVo;
import com.founder.commonutils.zdryEntity.Users;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-06-14
*/
@Mapper
@Component
public interface UsersMapper extends BaseMapper<Users> {
}
package com.founder.zdryapi.mapper;
import com.founder.commonutils.ZdryApiEntity.OnlineAndWear;
import com.founder.commonutils.zdryEntity.Users;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-06-02
*/
@Mapper
@Component
public interface ZdryApiMapper extends BaseMapper<OnlineAndWear> {
}
package com.founder.zdryapi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.ZdryApiEntity.BloodMessage;
import com.founder.commonutils.ZdryApiEntity.StepMessage;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-06-16
*/
@Mapper
@Component
public interface ZdryBloodMessageMapper extends BaseMapper<BloodMessage> {
}
package com.founder.zdryapi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.ZdryApiEntity.DbpMessage;
import com.founder.commonutils.ZdryApiEntity.HeartrateMessage;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-06-13
*/
@Mapper
@Component
public interface ZdryDbpMessageMapper extends BaseMapper<DbpMessage> {
}
package com.founder.zdryapi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.ZdryApiEntity.FenceTask;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-06-04
*/
@Mapper
@Component
public interface ZdryFenceTaskMapper extends BaseMapper<FenceTask> {
}
package com.founder.zdryapi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.ZdryApiEntity.HeartrateMessage;
import com.founder.commonutils.ZdryApiEntity.LocationMessage;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-06-13
*/
@Mapper
@Component
public interface ZdryHeartrateMessageMapper extends BaseMapper<HeartrateMessage> {
}
package com.founder.zdryapi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.ZdryApiEntity.LocationMessage;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-06-04
*/
@Mapper
@Component
public interface ZdryLocationMessageMapper extends BaseMapper<LocationMessage> {
}
package com.founder.zdryapi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.ZdryApiEntity.FenceTask;
import com.founder.commonutils.ZdryApiEntity.Message;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-06-04
*/
@Mapper
@Component
public interface ZdryMessageMapper extends BaseMapper<Message> {
}
package com.founder.zdryapi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.ZdryApiEntity.BloodMessage;
import com.founder.commonutils.ZdryApiEntity.StepMessage;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yangyang
* @since 2021-06-16
*/
@Mapper
@Component
public interface ZdryStepMessageMapper extends BaseMapper<StepMessage> {
}
<?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="com.founder.zdryapi.mapper.UsersMapper">
</mapper>
<?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="com.founder.zdryapi.mapper.ZdryApiMapper">
</mapper>
<?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="com.founder.zdryapi.mapper.ZdryBloodMessageMapper">
</mapper>
<?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="com.founder.zdryapi.mapper.ZdryDbpMessageMapper">
</mapper>
<?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="com.founder.zdryapi.mapper.ZdryFenceTaskMapper">
</mapper>
<?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="com.founder.zdryapi.mapper.ZdryHeartrateMessageMapper">
</mapper>
<?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="com.founder.zdryapi.mapper.ZdryLocationMessageMapper">
</mapper>
<?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="com.founder.zdryapi.mapper.ZdryMessageMapper">
</mapper>
<?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="com.founder.zdryapi.mapper.ZdryStepMessageMapper">
</mapper>
package com.founder.zdryapi.service;
import com.founder.commonutils.ZdryApiEntity.Device;
import com.founder.commonutils.publicEntity.MapRestResult;
import javax.servlet.http.HttpServletRequest;
/**
* <p>
* 接口 服务类
* </p>
*
* @author yangyang
* @since 2021-05-31
*/
public interface ZdryApiService {
String getToken();
Device getDevice(String deviceId);
String updateDevice(Device deviceParam);
MapRestResult locationdata(String deviceId,String time_begin);
MapRestResult onlineAndWeardata();
MapRestResult deviceFenceTask(String sbImei,String name,String time_begin, String time_end, String safe_area,int gklx, String xxdjdw_gajgjgdm,String xxdjdw_gajgjgmc);
MapRestResult FenceWarning();
MapRestResult wearFlag();
MapRestResult newLocationdataList(String[] imeis);
}
package com.founder.zdryapi.service;
import java.util.Date;
/**
* <p>
* 接口 服务类
* </p>
*
* @author yangyang
* @since 2021-06-04
*/
public interface ZdryPushDataService {
void message(int type,String deviceid, String communityid, String url, String name);
void locationMessage(String imei, String time_begin,boolean is_reply,boolean is_track,String city,String address,double lon,double lat,int type);
void heartrateMessage(String imei, String time_begin, int heartrate, int theshold_heartrate_h, int theshold_heartrate_l);
void dbpMessage(String imei, String time_begin,int dbp,int dbp_l, int sbp,int sbp_h);
void bloodMessage(String imei,String time_begin,int bloodoxygen, int bloodoxygen_h,int bloodoxygen_l);
void stepMessage(String imei, String time_begin, int value);
}
package com.founder.zdryapi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.founder.commonutils.ZdryApiEntity.*;
import com.founder.zdryapi.mapper.*;
import com.founder.zdryapi.service.ZdryPushDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
/*
*
* <p>
* 爱牵挂接口 服务实现类
* </p>
*
* @author yangyang
* @since 2021-06-04
*/
@Service
public class ZdryPushDataServiceImpl implements ZdryPushDataService {
@Autowired
private ZdryMessageMapper zdryMessageMapper;
@Autowired
private ZdryLocationMessageMapper zdryLocationMessageMapper;
@Autowired
private ZdryHeartrateMessageMapper zdryHeartrateMessageMapper;
@Autowired
private ZdryDbpMessageMapper zdryDbpMessageMapper;
@Autowired
private ZdryBloodMessageMapper zdryBloodMessageMapper;
@Autowired
private ZdryStepMessageMapper zdryStepMessageMapper;
@Override
public void message(int type, String deviceid, String communityid, String url, String name) {
if(type == 4){
QueryWrapper<Message> wrapper = new QueryWrapper<>();
wrapper.eq("sb_imei",deviceid);
Message message = zdryMessageMapper.selectOne(wrapper);
if(null != message){
message.setName(name);
message.setType(type);
message.setSbImei(deviceid);
message.setCommunityId(communityid);
message.setUrl(url);
zdryMessageMapper.updateById(message);
}else{
Message message1 = new Message();
message1.setName(name);
message1.setType(type);
message1.setSbImei(deviceid);
message1.setCommunityId(communityid);
message1.setUrl(url);
zdryMessageMapper.insert(message1);
}
}
}
@Override
public void locationMessage(String imei, String time_begin, boolean is_reply, boolean is_track, String city, String address, double lon, double lat, int type) {
QueryWrapper<LocationMessage> wrapper = new QueryWrapper<>();
wrapper.eq("sb_imei",imei);
// 查询
LocationMessage locationMessage = zdryLocationMessageMapper.selectOne(wrapper);
if(null != locationMessage){
locationMessage.setSbImei(imei);
locationMessage.setTimeBegin(time_begin);
locationMessage.setCity(city);
locationMessage.setAddress(address);
locationMessage.setX(String.valueOf(lon));
locationMessage.setY(String.valueOf(lat));
locationMessage.setType(type);
if(is_reply){
locationMessage.setIsReply(1);
}else{
locationMessage.setIsReply(0);
}
if(is_track){
locationMessage.setIsTrack(1);
}else{
locationMessage.setIsTrack(0);
}
// 执行更新
zdryLocationMessageMapper.updateById(locationMessage);
}else{
LocationMessage locationMessage1 = new LocationMessage();
locationMessage1.setSbImei(imei);
locationMessage1.setTimeBegin(time_begin);
locationMessage1.setCity(city);
locationMessage1.setAddress(address);
locationMessage1.setX(String.valueOf(lon));
locationMessage1.setY(String.valueOf(lat));
locationMessage1.setType(type);
if(is_reply){
locationMessage1.setIsReply(1);
}else{
locationMessage1.setIsReply(0);
}
if(is_track){
locationMessage1.setIsTrack(1);
}else {
locationMessage1.setIsTrack(0);
}
// 插入数据
zdryLocationMessageMapper.insert(locationMessage1);
}
}
@Override
public void heartrateMessage(String imei, String time_begin, int heartrate, int theshold_heartrate_h, int theshold_heartrate_l) {
HeartrateMessage HeartrateMessage1 = new HeartrateMessage();
HeartrateMessage1.setSbImei(imei);
HeartrateMessage1.setTimeBegin(time_begin);
HeartrateMessage1.setHeartrate(heartrate);
HeartrateMessage1.setTheshold_heartrate_h(theshold_heartrate_h);
HeartrateMessage1.setTheshold_heartrate_l(theshold_heartrate_l);
zdryHeartrateMessageMapper.insert(HeartrateMessage1);
}
@Override
public void dbpMessage(String imei, String time_begin, int dbp, int dbp_l, int sbp, int sbp_h) {
DbpMessage dbpMessage = new DbpMessage();
dbpMessage.setSbImei(imei);
dbpMessage.setTimeBegin(time_begin);
dbpMessage.setDbp(dbp);
dbpMessage.setDbp_l(dbp_l);
dbpMessage.setSbp(sbp);
dbpMessage.setSbp_h(sbp_h);
zdryDbpMessageMapper.insert(dbpMessage);
}
@Override
public void bloodMessage(String imei, String time_begin, int bloodoxygen, int bloodoxygen_h, int bloodoxygen_l) {
BloodMessage bloodMessage = new BloodMessage();
bloodMessage.setSbImei(imei);
bloodMessage.setTimeBegin(time_begin);
bloodMessage.setBloodoxygen(bloodoxygen);
bloodMessage.setBloodoxygenH(bloodoxygen_h);
bloodMessage.setBloodoxygenL(bloodoxygen_l);
zdryBloodMessageMapper.insert(bloodMessage);
}
@Override
public void stepMessage(String imei, String time_begin, int value) {
QueryWrapper<StepMessage> wrapper = new QueryWrapper<>();
wrapper.eq("sb_imei",imei);
wrapper.apply("STR_TO_DATE(time_begin,'%Y-%m-%d') = STR_TO_DATE('"+time_begin+"','%Y-%m-%d')");
// 查询
StepMessage stepMessage = zdryStepMessageMapper.selectOne(wrapper);
if(null != stepMessage){
stepMessage.setValue(value);
stepMessage.setTimeBegin(time_begin);
zdryStepMessageMapper.updateById(stepMessage);
}else{
StepMessage stepMessage1 = new StepMessage();
stepMessage1.setSbImei(imei);
stepMessage1.setTimeBegin(time_begin);
stepMessage1.setValue(value);
zdryStepMessageMapper.insert(stepMessage1);
}
}
}
#配置中心地址
spring.cloud.nacos.config.server-addr=47.92.48.137:9949
spring.cloud.nacos.discovery.server-addr=47.92.48.137:9949
#spring.cloud.nacos.config.server-addr=26.3.13.184:8848
#spring.cloud.nacos.discovery.server-addr=26.3.13.184:8848
spring.profiles.active=dev
# 该配置影响统一配置中心中的dataId
spring.application.name=zdryapi
spring.cloud.nacos.config.namespace=f1160b5f-cef5-4e86-bddc-c55e28c2d8b0
#spring.cloud.nacos.config.ext-config[0].data-id=image.properties
# 开启动态刷新配置,否则配置文件修改,工程无法感知
#spring.cloud.nacos.config.ext-config[0].refresh=true
spring.cloud.nacos.config.shared-dataids=zdryapipz.properties
spring.cloud.nacos.config.refreshable-dataids=zdryapipz.properties
management.health.elasticsearch.enabled: false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment