杨雷 3 лет назад
Родитель
Сommit
f737bbaebc
3 измененных файлов: 32 добавлений и 35 удалений
  1. +1
    -4
      src/main/java/com/ssjl/zhaobiao/guizhou/controller/IotController.java
  2. +19
    -19
      src/main/java/com/ssjl/zhaobiao/guizhou/entity/GZMessage/GZUpCall.java
  3. +12
    -12
      src/main/java/com/ssjl/zhaobiao/guizhou/entity/IOT/IOTCall.java

+ 1
- 4
src/main/java/com/ssjl/zhaobiao/guizhou/controller/IotController.java Просмотреть файл

@@ -310,10 +310,7 @@ public class IotController {
return "not in device"; return "not in device";
} }
DianxinGzDeviceConfig gzDeviceConfig = dianxinGzDeviceConfigMapper.selectByImei(imei); DianxinGzDeviceConfig gzDeviceConfig = dianxinGzDeviceConfigMapper.selectByImei(imei);
if(!isAtLocationTime(gzDeviceConfig.getLocationInterval())){
log.info(imei + ",wifi not in time");
return "not in time";
}

log.info(imei + ",call ,v=" + JSON.toJSONString(call)); log.info(imei + ",call ,v=" + JSON.toJSONString(call));
GZUpCall calls=new GZUpCall(); GZUpCall calls=new GZUpCall();
calls.setPhoneNumber(call.getPhoneNumber()); calls.setPhoneNumber(call.getPhoneNumber());


+ 19
- 19
src/main/java/com/ssjl/zhaobiao/guizhou/entity/GZMessage/GZUpCall.java Просмотреть файл

@@ -10,51 +10,51 @@ public class GZUpCall implements IMessageContent {
/** /**
* 手机号 * 手机号
*/ */
private String PhoneNumber;
private String phoneNumber;
/** /**
* 通话类型 1 CallOut 0 CallIn * 通话类型 1 CallOut 0 CallIn
*/ */
private int CallFlag;//
private int callFlag;//
/** /**
* 通话时间 * 通话时间
*/ */
private String DateTime ;
private String dateTime;
/** /**
* 通话时长 * 通话时长
*/ */
private int Duration;
private int duration;




public String getPhoneNumber() { public String getPhoneNumber() {
return PhoneNumber;
return phoneNumber;
} }


public void setPhoneNumber(String phoneNumber) { public void setPhoneNumber(String phoneNumber) {
PhoneNumber = phoneNumber;
this.phoneNumber = phoneNumber;
} }


public int getCallFlag() { public int getCallFlag() {
return CallFlag;
return callFlag;
} }


public void setCallFlag(int callFlag) { public void setCallFlag(int callFlag) {
CallFlag = callFlag;
this.callFlag = callFlag;
} }


public String getDateTime() { public String getDateTime() {
return DateTime;
return dateTime;
} }


public void setDateTime(String dateTime) { public void setDateTime(String dateTime) {
DateTime = dateTime;
this.dateTime = dateTime;
} }


public int getDuration() { public int getDuration() {
return Duration;
return duration;
} }


public void setDuration(int duration) { public void setDuration(int duration) {
Duration = duration;
this.duration = duration;
} }


@Override @Override
@@ -77,28 +77,28 @@ public class GZUpCall implements IMessageContent {
byte[] list = new byte[18]; byte[] list = new byte[18];
int i=0; int i=0;
list[i++] = (byte)getTag(); list[i++] = (byte)getTag();
byte[] phone=GZUtil.phoneToByte(PhoneNumber);
byte[] phone=GZUtil.phoneToByte(phoneNumber);
System.arraycopy(phone, 0, list, i, phone.length); System.arraycopy(phone, 0, list, i, phone.length);
i+=phone.length; i+=phone.length;
if(CallFlag==1&&Duration>0){
if(callFlag ==1&& duration >0){
list[i++] = (byte)0x00; list[i++] = (byte)0x00;
} }
else if(CallFlag==1&&Duration==0){
else if(callFlag ==1&& duration ==0){
list[i++] = (byte)0x01; list[i++] = (byte)0x01;
} }
else if(CallFlag==0&&Duration>0){
else if(callFlag ==0&& duration >0){
list[i++] = (byte)0x02; list[i++] = (byte)0x02;
} }
else if(CallFlag==0&&Duration==0){
else if(callFlag ==0&& duration ==0){
list[i++] = (byte)0x03; list[i++] = (byte)0x03;
} }
else { else {
list[i++] = (byte)0x04; list[i++] = (byte)0x04;
} }
byte[] duration= ByteUtil.toByte(Duration, 2);
byte[] duration= ByteUtil.toByte(this.duration, 2);
System.arraycopy(duration, 0, list, i, duration.length); System.arraycopy(duration, 0, list, i, duration.length);
i+=duration.length; i+=duration.length;
byte[] time=ByteUtil.hexToByteArray(DateTime);
byte[] time=ByteUtil.hexToByteArray(dateTime);
System.arraycopy(time, 0, list, i, time.length); System.arraycopy(time, 0, list, i, time.length);
return list; return list;
} }


+ 12
- 12
src/main/java/com/ssjl/zhaobiao/guizhou/entity/IOT/IOTCall.java Просмотреть файл

@@ -1,40 +1,40 @@
package com.ssjl.zhaobiao.guizhou.entity.IOT; package com.ssjl.zhaobiao.guizhou.entity.IOT;


public class IOTCall { public class IOTCall {
private String PhoneNumber;
private int CallFlag;//1 CallOut 0 CallIn
private String DateTime ;
private int Duration;
private String phoneNumber;
private int callFlag;//1 CallOut 0 CallIn
private String dateTime;
private int duration;


public String getPhoneNumber() { public String getPhoneNumber() {
return PhoneNumber;
return phoneNumber;
} }


public void setPhoneNumber(String phoneNumber) { public void setPhoneNumber(String phoneNumber) {
PhoneNumber = phoneNumber;
this.phoneNumber = phoneNumber;
} }


public int getCallFlag() { public int getCallFlag() {
return CallFlag;
return callFlag;
} }


public void setCallFlag(int callFlag) { public void setCallFlag(int callFlag) {
CallFlag = callFlag;
this.callFlag = callFlag;
} }


public String getDateTime() { public String getDateTime() {
return DateTime;
return dateTime;
} }


public void setDateTime(String dateTime) { public void setDateTime(String dateTime) {
DateTime = dateTime;
this.dateTime = dateTime;
} }


public int getDuration() { public int getDuration() {
return Duration;
return duration;
} }


public void setDuration(int duration) { public void setDuration(int duration) {
Duration = duration;
this.duration = duration;
} }
} }

Загрузка…
Отмена
Сохранить