|
@@ -13,8 +13,6 @@ import com.huimv.acquisition.service.MovePigpenService;
|
|
import com.huimv.acquisition.socket.eartagrecive.util.DateUtil;
|
|
import com.huimv.acquisition.socket.eartagrecive.util.DateUtil;
|
|
import com.huimv.acquisition.socket.eartagrecive.util.DateUtilsPublic;
|
|
import com.huimv.acquisition.socket.eartagrecive.util.DateUtilsPublic;
|
|
import com.huimv.acquisition.socket.eartagrecive.util.StringUtilsWork;
|
|
import com.huimv.acquisition.socket.eartagrecive.util.StringUtilsWork;
|
|
-import com.huimv.acquisition.utils.PageUtils;
|
|
|
|
-import com.huimv.acquisition.utils.Query;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
@@ -47,7 +45,6 @@ public class ReceivePackageSerivce {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private MovePigpenService movePigpenService;
|
|
private MovePigpenService movePigpenService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private EartagRegisterDao eartagRegisterDao ;
|
|
private EartagRegisterDao eartagRegisterDao ;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -72,10 +69,6 @@ public class ReceivePackageSerivce {
|
|
String prepare_field= clientMessageArray[9]; //耳标温度
|
|
String prepare_field= clientMessageArray[9]; //耳标温度
|
|
|
|
|
|
String[] split = prepare_field.split("#");//1.0#1.0#9314 --耳标版本--网关版本--电阻值(用来计算环境温度)
|
|
String[] split = prepare_field.split("#");//1.0#1.0#9314 --耳标版本--网关版本--电阻值(用来计算环境温度)
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
String check = clientMessageArray[10]; //校验码
|
|
String check = clientMessageArray[10]; //校验码
|
|
String tail = clientMessageArray[11]; //命令尾
|
|
String tail = clientMessageArray[11]; //命令尾
|
|
EartagDataEntity eartagDataEntity = new EartagDataEntity();
|
|
EartagDataEntity eartagDataEntity = new EartagDataEntity();
|
|
@@ -219,8 +212,7 @@ public class ReceivePackageSerivce {
|
|
public static double getTwoDecimal(double num) {
|
|
public static double getTwoDecimal(double num) {
|
|
DecimalFormat dFormat = new DecimalFormat("#.00");
|
|
DecimalFormat dFormat = new DecimalFormat("#.00");
|
|
String yearString = dFormat.format(num);
|
|
String yearString = dFormat.format(num);
|
|
- Double temp = Double.valueOf(yearString);
|
|
|
|
- return temp;
|
|
|
|
|
|
+ return Double.parseDouble(yearString);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -228,19 +220,18 @@ public class ReceivePackageSerivce {
|
|
|
|
|
|
public static double m1(double num ) {
|
|
public static double m1(double num ) {
|
|
BigDecimal bg = new BigDecimal(num);
|
|
BigDecimal bg = new BigDecimal(num);
|
|
- double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
- return f1;
|
|
|
|
|
|
+ return bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static String swapHex(String src) {
|
|
public static String swapHex(String src) {
|
|
- String target = "";
|
|
|
|
|
|
+ StringBuilder target = new StringBuilder();
|
|
for (int i = src.length() - 1; i > 0; i -= 2) {
|
|
for (int i = src.length() - 1; i > 0; i -= 2) {
|
|
- target += src.substring(i - 1, i + 1);
|
|
|
|
|
|
+ target.append(src.substring(i - 1, i + 1));
|
|
}
|
|
}
|
|
- return target;
|
|
|
|
|
|
+ return target.toString();
|
|
}
|
|
}
|
|
public static String numberFormater(double d) {
|
|
public static String numberFormater(double d) {
|
|
DecimalFormat nf = new DecimalFormat();
|
|
DecimalFormat nf = new DecimalFormat();
|