Parcourir la Source

修改日期工具类

konghl 4 ans auparavant
Parent
commit
52a85f945f

+ 54 - 44
ebc-sea-platform/src/main/java/com/ai/ipu/server/controller/ReceiveSubscribeController.java

@ -41,27 +41,32 @@ public class ReceiveSubscribeController {
41 41
		logger.info("已接收定位消息,消息为:" + msg);
42 42
43 43
		// 解析数据
44
		JSONObject msgMap=(JSONObject) JSONObject.parse(msg);
45
		
46
			String msgJson = (String) msgMap.get("dataPointValue");
47
			JSONObject detailInfo = JSONObject.parseObject(msgJson);
48
			JMap detailInfoMap = new JsonMap();
49
			detailInfoMap.put("deviceId", String.valueOf(msgMap.get("resourceId")));// 设备ID
50
			detailInfoMap.put("deviceNo", String.valueOf(msgMap.get("resourceId")));// 设备编码
51
			detailInfoMap.put("newDate", detailInfo.getJSONObject("msgDate").getString("value"));// 最新定位时间
52
53
			// 经度
54
			BigDecimal longitudeBigDecimal = detailInfo.getJSONObject("longitude").getBigDecimal("value");
55
			detailInfoMap.put("longitude",
56
					longitudeBigDecimal.setScale(EbcConstant.coord_scale, BigDecimal.ROUND_HALF_UP).toString());
57
58
			// 
59
			BigDecimal latitudeBigDecimal = detailInfo.getJSONObject("latitude").getBigDecimal("value");
60
			detailInfoMap.put("latitude",
61
					latitudeBigDecimal.setScale(EbcConstant.coord_scale, BigDecimal.ROUND_HALF_UP).toString());
62
63
			// 解析并推送定位数据
64
			receiveSubscribeService.receiveIotLocationData(detailInfoMap);
44
		JSONObject msgMap = (JSONObject) JSONObject.parse(msg);
45
46
		if (msgMap == null || msgMap.isEmpty() || msgMap.get("dataPointValue") == null) {
47
			logger.info("定位消息的解析数据为空");
48
			return "dataPointValue is null";
49
		}
50
51
		String msgJson = String.valueOf(msgMap.get("dataPointValue"));
52
		JSONObject detailInfo = JSONObject.parseObject(msgJson);
53
		JMap detailInfoMap = new JsonMap();
54
		detailInfoMap.put("deviceId", String.valueOf(msgMap.get("resourceId")));// 设备ID
55
		detailInfoMap.put("deviceNo", String.valueOf(msgMap.get("resourceId")));// 设备编码
56
		detailInfoMap.put("newDate", detailInfo.getJSONObject("msgDate").getString("value"));// 最新定位时间
57
58
		// 
59
		BigDecimal longitudeBigDecimal = detailInfo.getJSONObject("longitude").getBigDecimal("value");
60
		detailInfoMap.put("longitude",
61
				longitudeBigDecimal.setScale(EbcConstant.coord_scale, BigDecimal.ROUND_HALF_UP).toString());
62
63
		// 纬度
64
		BigDecimal latitudeBigDecimal = detailInfo.getJSONObject("latitude").getBigDecimal("value");
65
		detailInfoMap.put("latitude",
66
				latitudeBigDecimal.setScale(EbcConstant.coord_scale, BigDecimal.ROUND_HALF_UP).toString());
67
68
		// 解析并推送定位数据
69
		receiveSubscribeService.receiveIotLocationData(detailInfoMap);
65 70
66 71
		return msg;
67 72
	}
@ -77,30 +82,35 @@ public class ReceiveSubscribeController {
77 82
		logger.info("已接收告警消息,消息为:" + msg);
78 83
79 84
		// 解析数据
80
		JSONObject msgMap=(JSONObject) JSONObject.parse(msg);
85
		JSONObject msgMap = (JSONObject) JSONObject.parse(msg);
86
87
		if (msgMap == null || msgMap.isEmpty() || msgMap.get("dataPointValue") == null) {
88
			logger.info("定位消息的解析数据为空");
89
			return "dataPointValue is null";
90
		}
81 91
		
82
			String msgJson = (String) msgMap.get("dataPointValue");
83
			JSONObject detailInfo = JSONObject.parseObject(msgJson);
84
			JMap detailInfoMap = new JsonMap();
85
			detailInfoMap.put("deviceId", String.valueOf(msgMap.get("resourceId")));// 设备ID
86
			detailInfoMap.put("deviceNo", String.valueOf(msgMap.get("resourceId")));// 设备编码
87
			detailInfoMap.put("newDate", detailInfo.getJSONObject("msgDate").getString("value"));// 最新定位时间
88
89
			// 经度
90
			BigDecimal longitudeBigDecimal = detailInfo.getJSONObject("longitude").getBigDecimal("value");
91
			detailInfoMap.put("longitude",
92
					longitudeBigDecimal.setScale(EbcConstant.coord_scale, BigDecimal.ROUND_HALF_UP).toString());
93
94
			// 纬度
95
			BigDecimal latitudeBigDecimal = detailInfo.getJSONObject("latitude").getBigDecimal("value");
96
			detailInfoMap.put("latitude",
97
					latitudeBigDecimal.setScale(EbcConstant.coord_scale, BigDecimal.ROUND_HALF_UP).toString());
98
99
			//报警类型
100
			detailInfoMap.put("alarmType",detailInfo.getJSONObject("alarmType").getIntValue("value"));
101
			
102
			// 分析并推送报警数据
103
			receiveSubscribeService.receiveIotAlarmData(detailInfoMap);
92
		String msgJson = String.valueOf(msgMap.get("dataPointValue"));
93
		JSONObject detailInfo = JSONObject.parseObject(msgJson);
94
		JMap detailInfoMap = new JsonMap();
95
		detailInfoMap.put("deviceId", String.valueOf(msgMap.get("resourceId")));// 设备ID
96
		detailInfoMap.put("deviceNo", String.valueOf(msgMap.get("resourceId")));// 设备编码
97
		detailInfoMap.put("newDate", detailInfo.getJSONObject("msgDate").getString("value"));// 最新定位时间
98
99
		// 经度
100
		BigDecimal longitudeBigDecimal = detailInfo.getJSONObject("longitude").getBigDecimal("value");
101
		detailInfoMap.put("longitude",
102
				longitudeBigDecimal.setScale(EbcConstant.coord_scale, BigDecimal.ROUND_HALF_UP).toString());
103
104
		// 纬度
105
		BigDecimal latitudeBigDecimal = detailInfo.getJSONObject("latitude").getBigDecimal("value");
106
		detailInfoMap.put("latitude",
107
				latitudeBigDecimal.setScale(EbcConstant.coord_scale, BigDecimal.ROUND_HALF_UP).toString());
108
109
		// 报警类型
110
		detailInfoMap.put("alarmType", detailInfo.getJSONObject("alarmType").getIntValue("value"));
111
112
		// 分析并推送报警数据
113
		receiveSubscribeService.receiveIotAlarmData(detailInfoMap);
104 114
105 115
		return msg;
106 116

+ 17 - 7
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/impl/DeviceManageDaoImpl.java

@ -284,7 +284,7 @@ public class DeviceManageDaoImpl extends AbstractBizDao implements DeviceManageD
284 284
		String url = NorthboundInterfaceConstant.queryOneDeviceIncident;
285 285
		Map<String, String> map = northboundInterfaceUtil.iotPostCallUtil(url, dataMap);
286 286
		
287
		if (map==null) {
287
		if (map==null||map.isEmpty()) {
288 288
			logger.error("调用北向接口失败: return null,method="+NorthboundInterfaceConstant.queryOneDeviceIncident+",param="+JSONObject.toJSONString(dataMap));
289 289
			resultJMap.put("result", false);
290 290
			resultJMap.put("errMsg", "查询失败");
@ -298,7 +298,7 @@ public class DeviceManageDaoImpl extends AbstractBizDao implements DeviceManageD
298 298
		
299 299
		List<Map> resultList = JSON.parseArray(JSONObject.toJSONString(map.get("result")), Map.class);
300 300
		
301
		if (resultList==null) {
301
		if (resultList==null||resultList.isEmpty()) {
302 302
			logger.info("queryOneDeviceLocationInfo 北向接口无返回数据  -->  "+paramsMap.get("resourceId")+"无轨迹数据");
303 303
			resultJMap.put("result", true);
304 304
			resultJMap.put("dataNum",0); //总条数
@ -309,9 +309,9 @@ public class DeviceManageDaoImpl extends AbstractBizDao implements DeviceManageD
309 309
		resultJMap.put("dataNum",map.get("totalResultNumber")); //总条数
310 310
		resultJMap.put("deviceId",paramsMap.get("resourceId")); //设备id
311 311
		
312
		List<String> coordList=new ArrayList<String>();
313
		for (Map resultMap : resultList) {
314
			String msgJson = (String) resultMap.get("dataPointValue");
312
		String[][] resultArray=new String[resultList.size()][3];
313
		for (int i = 0; i < resultList.size(); i++) {
314
			String msgJson = (String) resultList.get(i).get("dataPointValue");
315 315
			JSONObject detailInfo = JSONObject.parseObject(msgJson);
316 316
			
317 317
			// 经度
@ -320,10 +320,20 @@ public class DeviceManageDaoImpl extends AbstractBizDao implements DeviceManageD
320 320
			// 纬度
321 321
			BigDecimal latitudeBigDecimal= detailInfo.getJSONObject("latitude").getBigDecimal("value").setScale(EbcConstant.coord_scale, BigDecimal.ROUND_HALF_UP);
322 322
			
323
			String coord=longitudeBigDecimal.toString()+","+latitudeBigDecimal.toString();
324
			coordList.add(coord);
323
			//时间
324
			String msgDate=detailInfo.getJSONObject("msgDate").getString("value");// 定位时间
325
326
			String[] coordArray=new String[3];
327
			coordArray[0]=longitudeBigDecimal.toString();
328
			coordArray[1]=latitudeBigDecimal.toString();
329
			coordArray[2]=msgDate;
330
			
331
			resultArray[i]=coordArray;
325 332
		}
326 333
		
334
		resultJMap.put("coordArray", resultArray);
335
		resultJMap.put("result", true);
336
		
327 337
		return resultJMap;
328 338
	}
329 339
}

+ 1 - 1
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/impl/MapTagManageDaoImpl.java

@ -48,7 +48,7 @@ public class MapTagManageDaoImpl extends AbstractBizDao implements MapTagManageD
48 48
49 49
		// 获取数据列表
50 50
		List<Map<String, Object>> data = dao.executeSelect(sql.toString(), dataMap, pageNum, pageSize);
51
51
		
52 52
		// 获取总条数
53 53
		sql.insert(0, "select count(1) dataNum from ( ");
54 54
		sql.append(" ) a ");

+ 2 - 1
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/impl/AreaInOutRecordServiceImpl.java

@ -1,6 +1,7 @@
1 1
package com.ai.ipu.server.service.impl;
2 2
3 3
import com.ai.ipu.server.enums.UserEnums;
4
import com.ai.ipu.server.util.DateUtil;
4 5
import com.ai.ipu.server.util.EbcConstant;
5 6
import com.github.pagehelper.PageInfo;
6 7
import org.springframework.beans.factory.annotation.Autowired;
@ -60,7 +61,7 @@ public class AreaInOutRecordServiceImpl implements AreaInOutRecordService {
60 61
		List<Map<String,Object>> pageInfoList = pageInfo.getList();
61 62
		for(Map<String,Object> areaInOutRecord:pageInfoList ){
62 63
			Date in_date = (Date)areaInOutRecord.get("IN_DATE");
63
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
64
			SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.NORM_DATETIME_PATTERN);
64 65
			String inDateStr = sdf.format(in_date);       //将Date类型转换成String类型
65 66
			String [] arr2 = inDateStr.split(" ");
66 67
			areaInOutRecord.put("date",arr2[0]);

+ 18 - 9
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/impl/DeviceManageServiceImpl.java

@ -21,7 +21,6 @@ import com.ai.ipu.server.enums.UserEnums;
21 21
import com.ai.ipu.server.service.interfaces.DeviceManageService;
22 22
import com.ai.ipu.server.util.DateUtil;
23 23
import com.ai.ipu.server.util.EbcConstant;
24
import com.ai.ipu.server.util.JingPingSendDateUtil;
25 24
import com.alibaba.fastjson.JSON;
26 25
27 26
@Service
@ -53,8 +52,8 @@ public class DeviceManageServiceImpl implements DeviceManageService {
53 52
		paramsMap.put("specId", EbcConstant.beidouDevice_product_id); // 所属产品
54 53
		paramsMap.put("terminalSN", params.getString("deviceNo")); // 终端序列号
55 54
55
		// 包含或不包含终端ID(用逗号隔开)
56 56
		if (bindDeviceBoolean || unBindDeviceBoolean) {
57
			// 获取已绑定的终端ids(用逗号隔开)
58 57
			StringBuilder deviceIds = new StringBuilder();
59 58
			for (int i = 0; i < allBindInfoList.size(); i++) {
60 59
				deviceIds.append(allBindInfoList.get(i).get("DEVICE_ID"));
@ -63,9 +62,11 @@ public class DeviceManageServiceImpl implements DeviceManageService {
63 62
				}
64 63
			}
65 64
66
			if (unBindDeviceBoolean) {
65
			if (bindDeviceBoolean) {
66
				//只查询绑定的终端:包含
67 67
				paramsMap.put("resourceIdList", deviceIds.toString());
68 68
			} else if (unBindDeviceBoolean) {
69
				//只查询不绑定的终端:不包含
69 70
				paramsMap.put("notIn", deviceIds.toString());
70 71
			}
71 72
		}
@ -216,7 +217,7 @@ public class DeviceManageServiceImpl implements DeviceManageService {
216 217
		mapTagTypeList.add(EbcConstant.area_type_temporariness);
217 218
		List<Map<String, Object>> areaViolationMapList = areaInOutRecordDao.getBeforeInAreaInfo(null, mapTagTypeList);
218 219
219
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
220
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtil.NORM_DATETIME_PATTERN);
220 221
221 222
		// 拼接返回数据
222 223
		for (Map<String, String> map : list) {
@ -345,31 +346,39 @@ public class DeviceManageServiceImpl implements DeviceManageService {
345 346
		String beginTime=null;//开始时间
346 347
		String endTime=null;//结束时间
347 348
		
349
		//时间段类型
348 350
		switch (params.getString("timeType")) {
349 351
		case EbcConstant.locus_time_interval_tenMinute:
350 352
			//10分钟
351
			beginTime="";
352 353
			endTime=TimeUtil.getSysTime();
354
			beginTime=DateUtil.dateAddMinute(endTime, -10);
353 355
			break;
354 356
		case EbcConstant.locus_time_interval_oneHour:
355 357
			//1小时
356
			beginTime="";
357 358
			endTime=TimeUtil.getSysTime();
359
			beginTime=DateUtil.dateAddHour(endTime, -1);
358 360
			break;
359 361
		case EbcConstant.locus_time_interval_oneDay:
360 362
			//1天
361
			beginTime="";
362 363
			endTime=TimeUtil.getSysTime();
364
			beginTime=DateUtil.dateAddDay(endTime, -1);
363 365
			break;
364 366
		case EbcConstant.locus_time_interval_custom:
365 367
			//自定义
366 368
			beginTime=params.getString("beginTime");
367 369
			endTime=params.getString("endTime");
370
			if (beginTime==null||"".equals(beginTime)||endTime==null||"".equals(endTime)) {
371
				resultJMap.put("result", false);
372
				resultJMap.put("errMsg", "日期不能为空");
373
				return resultJMap;
374
			}
368 375
			break;
369 376
		default:
370
			
371
			break;
377
			resultJMap.put("result", false);
378
			resultJMap.put("errMsg", "时间段无效");
379
			return resultJMap;
372 380
		}
381
		
373 382
		Map<String, String> paramsMap = new HashMap<String, String>();
374 383
		paramsMap.put("resourceId", params.getString("deviceId"));//终端ID
375 384
		paramsMap.put("startTime", beginTime);

+ 4 - 1
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/impl/GisTokenServiceImpl.java

@ -9,9 +9,11 @@ import org.slf4j.LoggerFactory;
9 9
import org.springframework.beans.factory.annotation.Value;
10 10
import org.springframework.stereotype.Service;
11 11
12
import com.ai.ipu.common.http.UnirestUtil;
12 13
import com.ai.ipu.server.service.interfaces.GisTokenService;
13 14
import com.ai.ipu.server.util.HttpServiceUtil;
14 15
import com.alibaba.fastjson.JSON;
16
import com.mashape.unirest.http.Unirest;
15 17
16 18
@Service
17 19
public class GisTokenServiceImpl implements GisTokenService {
@ -45,7 +47,8 @@ public class GisTokenServiceImpl implements GisTokenService {
45 47
46 48
		Charset charset = Charset.forName("utf-8");
47 49
		String resultJson = HttpServiceUtil.sendPost(tokenUrl, mapParams, charset);
48
50
		
51
		//UnirestUtil.requestByPost(url, param)
49 52
		logger.debug("已获取gisToken:" + resultJson);
50 53
51 54
		Map<String, Object> resultMap = JSON.parseObject(resultJson, Map.class);

+ 1 - 1
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/impl/TrackAnalysisServiceImpl.java

@ -31,7 +31,7 @@ public class TrackAnalysisServiceImpl implements TrackAnalysisService {
31 31
        PageInfo pageInfo = trackAnalysisDao.queryTrackAnalysisInfo(params, pageNum, pageSize);
32 32
        List<Map<String,Object>> pageInfoList = pageInfo.getList();
33 33
34
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
34
        SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.NORM_DATETIME_PATTERN);
35 35
36 36
        for(Map<String,Object> areaInOutRecord:pageInfoList ){
37 37
            for(Map<String,Object> userMap: userList){

+ 1 - 1
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/iotData/ManageIotInAreaData.java

@ -86,7 +86,7 @@ public class ManageIotInAreaData {
86 86
		long minInAreaLong = System.currentTimeMillis();// 进入围栏最早的时间戳
87 87
		Map<String, Object> sendDataAreaInfo = null;// 用于推送镜屏的围栏信息
88 88
89
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
89
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtil.NORM_DATETIME_PATTERN);
90 90
91 91
		for (int i = 0; i < currentAreaInfoList.size(); i++) {
92 92
			// 比较优先级

+ 133 - 2
ebc-sea-platform/src/main/java/com/ai/ipu/server/util/DateUtil.java

@ -3,6 +3,7 @@ package com.ai.ipu.server.util;
3 3
import java.math.BigDecimal;
4 4
import java.text.ParseException;
5 5
import java.text.SimpleDateFormat;
6
import java.util.Calendar;
6 7
import java.util.Date;
7 8
8 9
import com.ai.ipu.common.date.TimeUtil;
@ -14,6 +15,136 @@ import com.ai.ipu.common.date.TimeUtil;
14 15
 */
15 16
public class DateUtil {
16 17
18
	public static final String NORM_DATETIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
19
	public static final String NORM_DATETIME_MS_PATTERN = "yyyy-MM-dd HH:mm:ss.SSS";
20
	public static final String NORM_DATE_PATTERN = "yyyy-MM-dd";
21
	public static final String NORM_TIME_PATTERN = "HH:mm:ss";
22
23
	public static final String PURE_DATETIME_PATTERN = "yyyyMMddHHmmss";
24
	public static final String PURE_DATETIME_MS_PATTERN = "yyyyMMddHHmmssSSS";
25
	public static final String PURE_DATE_PATTERN = "yyyyMMdd";
26
	public static final String PURE_TIME_PATTERN = "HHmmss";
27
28
	public static final String EN_DATE_PATTERN = "yyyy/MM/dd";
29
	public static final String EN_DATETIME_PATTERN = "yyyy/MM/dd HH:mm:ss";
30
31
	public static final String CN_DATE_PATTERN = "yyyy年MM月dd日";
32
	public static final String CN_DATETIME_MINUTE_PATTERN = "yyyy年MM月dd日 HH:mm";
33
	public static final String CN_DATETIME_PATTERN = "yyyy年MM月dd日 HH:mm:ss";
34
35
	/**
36
	 * 在原日期加年数
37
	 * @param dateStr
38
	 * @param amount
39
	 * @return yyyy-MM-dd HH:mm:ss
40
	 */
41
	public static String dateAddYear(String dateStr, int amount) {
42
		return dateAdd(dateStr, Calendar.YEAR, amount, NORM_DATETIME_PATTERN);
43
	}
44
	
45
	/**
46
	 * 在原日期加月数
47
	 * @param dateStr
48
	 * @param amount
49
	 * @return yyyy-MM-dd HH:mm:ss
50
	 */
51
	public static String dateAddMonth(String dateStr, int amount) {
52
		return dateAdd(dateStr, Calendar.MONTH, amount, NORM_DATETIME_PATTERN);
53
	}
54
	
55
	/**
56
	 * 在原日期加天数
57
	 * @param dateStr
58
	 * @param amount
59
	 * @return yyyy-MM-dd HH:mm:ss
60
	 */
61
	public static String dateAddDay(String dateStr, int amount) {
62
		return dateAdd(dateStr, Calendar.DATE, amount, NORM_DATETIME_PATTERN);
63
	}
64
	
65
	/**
66
	 * 在原日期加小时数
67
	 * @param dateStr
68
	 * @param amount
69
	 * @return yyyy-MM-dd HH:mm:ss
70
	 */
71
	public static String dateAddHour(String dateStr, int amount) {
72
		return dateAdd(dateStr, Calendar.HOUR, amount, NORM_DATETIME_PATTERN);
73
	}
74
	
75
	/**
76
	 * 在原日期加分钟数
77
	 * @param dateStr
78
	 * @param amount
79
	 * @return yyyy-MM-dd HH:mm:ss
80
	 */
81
	public static String dateAddMinute(String dateStr, int amount) {
82
		return dateAdd(dateStr, Calendar.MINUTE, amount, NORM_DATETIME_PATTERN);
83
	}
84
	
85
	/**
86
	 * 在原日期加秒数
87
	 * @param dateStr
88
	 * @param amount
89
	 * @return yyyy-MM-dd HH:mm:ss
90
	 */
91
	public static String dateAddSecond(String dateStr, int amount) {
92
		return dateAdd(dateStr, Calendar.SECOND, amount, NORM_DATETIME_PATTERN);
93
	}
94
95
	/**
96
	 * 在原日期加一段时间间隔
97
	 * @param date 原日期
98
	 * @param field Calendar中的时间类型
99
	 * @param amount 间隔长度
100
	 * @param pattern 返回日期格式
101
	 * @return
102
	 */
103
	public static String dateAdd(String dateStr, int field, int amount, String pattern) {
104
		Date date = convertDate(dateStr);
105
		Date newDate = dateAdd(date, field, amount);
106
		return formatDate(newDate, pattern);
107
	}
108
109
	/**
110
	 * 在原日期加一段时间间隔
111
	 * @param date 原日期
112
	 * @param field Calendar中的时间类型
113
	 * @param amount 间隔长度
114
	 * @param pattern 返回日期格式
115
	 * @return
116
	 */
117
	public static String dateAdd(Date date, int field, int amount, String pattern) {
118
		Date newDate = dateAdd(date, field, amount);
119
		return formatDate(newDate, pattern);
120
	}
121
122
	/**
123
	 * 在原日期加一段时间间隔
124
	 * @param date 原日期
125
	 * @param field Calendar中的时间类型
126
	 * @param amount 间隔长度
127
	 * @return
128
	 */
129
	public static Date dateAdd(String dateStr, int field, int amount) {
130
		Date date = convertDate(dateStr);
131
		return dateAdd(date, field, amount);
132
	}
133
134
	/**
135
	 * 在原日期加一段时间间隔
136
	 * @param date 原日期
137
	 * @param field Calendar中的时间类型
138
	 * @param amount 间隔长度
139
	 * @return
140
	 */
141
	public static Date dateAdd(Date date, int field, int amount) {
142
		Calendar calendar = Calendar.getInstance();
143
		calendar.setTime(date);
144
		calendar.add(field, amount);
145
		return calendar.getTime();
146
	}
147
17 148
	/**
18 149
	 * 比较日期大小
19 150
	 * @param dateStr0
@ -34,7 +165,7 @@ public class DateUtil {
34 165
	 */
35 166
	public static String formatStrDate(String dateStr) {
36 167
		Date date = convertDate(dateStr);
37
		return formatDate(date, "yyyy-MM-dd HH:mm:ss");
168
		return formatDate(date, DateUtil.NORM_DATETIME_PATTERN);
38 169
	}
39 170
40 171
	/**
@ -43,7 +174,7 @@ public class DateUtil {
43 174
	 * @return yyyy-MM-dd HH:mm:ss
44 175
	 */
45 176
	public static String formatDate(Date date) {
46
		return formatDate(date, "yyyy-MM-dd HH:mm:ss");
177
		return formatDate(date, DateUtil.NORM_DATETIME_PATTERN);
47 178
	}
48 179
49 180
	/**

+ 1 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/util/HttpServiceUtil.java

@ -236,6 +236,7 @@ public class HttpServiceUtil {
236 236
237 237
		httpPost.addHeader(HTTP.CONTENT_TYPE, HTTP_CONTENT_TYPE_JSON);
238 238
		if (paramsMap != null && paramsMap.size() > 0) {
239
			log.debug("调用北向接口:url= "+url+",参数= "+JSONObject.toJSONString(paramsMap));
239 240
			StringEntity se = new StringEntity(JSONObject.toJSONString(paramsMap), encoding);
240 241
			httpPost.setEntity(se);
241 242
		}

+ 1 - 1
ebc-sea-platform/src/main/resources/dev/application.properties

@ -38,7 +38,7 @@ url.gis.token=http://192.168.74.189:9999/gisIntf/account/gettoken
38 38
#iot\u7684\u5317\u5411\u63a5\u53e3\u6ce8\u518c\u5730\u5740
39 39
url.iot.login=http://60.205.219.67:8300/sso/login
40 40
#iot\u7684\u5317\u5411\u63a5\u53e3\u7edf\u4e00\u5730\u5740
41
url.iot.service=http://60.205.219.67:8081/dmp/terminalNorthApi/
41
url.iot.service=http://60.205.219.67:8300/dmp/terminalNorthApi/
42 42
43 43
#\u6d77\u56fe\u4e2d\u5fc3\u5750\u6807
44 44
seaMap.centre.longitude=123.396036