Browse Source

协议时间处理

missMyLove 3 years ago
parent
commit
a9b76a0fa5

+ 2 - 0
src/main/java/com/comtika/safe/common/utils/DateTimeUtils.java

@@ -14,6 +14,7 @@ public class DateTimeUtils {
 	private static final ConcurrentHashMap<String,SimpleDateFormat> SDF = new ConcurrentHashMap<>();
 	/**默认时间格式*/
 	public static final String FORMAT = "yyyy-MM-dd HH:mm:ss";
+	public static final String FORMAT_NETTY = "yyyy-MM-dd HH:mm:ss.SSS";
 	// public static final String SIGN_FORMAT = "HH:mm:ss";
 	public static final String FORMAT_M = "yyyy-MM-dd HH:mm";
 	public static final String FORMAT_YMD = "yyyy-MM-dd";
@@ -30,6 +31,7 @@ public class DateTimeUtils {
     public static final long ONE_HOUR   = 60 * 60 * 1000;
     /** 一天的时间(毫秒) */
     public static final long ONE_DAY    = 24 * 60 * 60 * 1000;
+
 	public static String currDateFormat(String format){
 		return formatDate(new Date(),format);
 	}

+ 3 - 3
src/main/java/com/comtika/safe/controller/protocol/ProtocolController.java

@@ -95,9 +95,9 @@ public class ProtocolController {
     }
 
 
-	@ApiOperation(value = "辅助继电器操作00: 关闭辅助继电器\n" +
-			"     * 01:打开辅助继电器\n" +
-			"     * 02:查看辅助继电器状态" +
+	@ApiOperation(value = "辅助继电器操作0: 关闭辅助继电器\n" +
+			"     * 1:打开辅助继电器\n" +
+			"     * 2:查看辅助继电器状态" +
 			"bitList 数组true代表开,false代表关")
 	@PostMapping("fadAuxHandle")
 	public RespWrapper<Object> fadAuxHandle(@RequestBody AuxHandleHelp auxHandleHelp){

+ 1 - 1
src/main/java/com/comtika/safe/core/protocol/cache/SafeCache.java

@@ -192,7 +192,7 @@ public class SafeCache {
     private static final String REQ_MAG = "接收";
     private static final String SIXTEEN_TAG = "H";
     private static String formatData(OrderEntity oe,boolean isSend,String allData){
-		String dateTime = DateTimeUtils.formatDate(DateTimeUtils.FORMAT);
+		String dateTime = DateTimeUtils.formatDate(DateTimeUtils.FORMAT_NETTY);
 		String direction = isSend?SEND_MAG:REQ_MAG;
 		String data = HexUtil.bytes2HexStr(oe.getData());
 		String controllerCode = HexUtil.byte2HexStr((byte) oe.getOrderCode());//控制码