Commit 750c8576 authored by 单奇雲's avatar 单奇雲

Merge branch 'dev_upgrade' of http://172.16.10.76/station/YeeAmosFireAutoSysRoot into dev_upgrade

parents 7eae0b3f 6a7da135
...@@ -6,14 +6,9 @@ import java.text.ParsePosition; ...@@ -6,14 +6,9 @@ import java.text.ParsePosition;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.*;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import com.google.gson.JsonObject;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
/** /**
...@@ -1338,5 +1333,22 @@ public class DateUtil { ...@@ -1338,5 +1333,22 @@ public class DateUtil {
// long sec = diff % nd % nh % nm / ns; // long sec = diff % nd % nh % nm / ns;
return day + "天" + hour + "小时" + min + "分钟"+ sen + "秒"; return day + "天" + hour + "小时" + min + "分钟"+ sen + "秒";
} }
public static Map<String,Object> dayComparePrecise(Date fromDate, Date toDate){
Map<String,Object> param = new LinkedHashMap<>();
Calendar from = Calendar.getInstance();
from.setTime(fromDate);
Calendar to = Calendar.getInstance();
to.setTime(toDate);
int fromYear = from.get(Calendar.YEAR);
int fromDay = from.get(Calendar.DAY_OF_YEAR);
int toYear = to.get(Calendar.YEAR);
int toDay = to.get(Calendar.DAY_OF_YEAR);
int year = toYear - fromYear;
int day = toDay - fromDay;
param.put("year", year);
param.put("day", day);
return param;
}
} }
\ No newline at end of file
...@@ -111,4 +111,14 @@ public class View3dController extends BaseController { ...@@ -111,4 +111,14 @@ public class View3dController extends BaseController {
String orgCode = this.getOrgCode(reginParams); String orgCode = this.getOrgCode(reginParams);
return CommonResponseUtil.success(view3dService.getSafetyIndexDetail(type,orgCode)); return CommonResponseUtil.success(view3dService.getSafetyIndexDetail(type,orgCode));
} }
@ApiOperation(value = "查询上线的年日",notes = "查询上线年日:10年101")
@GetMapping(value = "/online/date")
public CommonResponse getSystemOnlineDate(){
//TODO: 多机构暂时不支持
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
return CommonResponseUtil.success(view3dService.getSystemOnlineDate(orgCode));
}
} }
...@@ -8,6 +8,7 @@ import java.util.HashMap; ...@@ -8,6 +8,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType; import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
...@@ -36,6 +37,7 @@ import org.slf4j.Logger; ...@@ -36,6 +37,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -72,6 +74,8 @@ public class View3dServiceImpl implements IView3dService { ...@@ -72,6 +74,8 @@ public class View3dServiceImpl implements IView3dService {
private PatrolMapper patrolMapper; private PatrolMapper patrolMapper;
@Autowired @Autowired
private IRiskLevelDao iRiskLevelDao; private IRiskLevelDao iRiskLevelDao;
@Value("${param.system.online.date}")
private String onLineDate;
...@@ -327,4 +331,11 @@ public class View3dServiceImpl implements IView3dService { ...@@ -327,4 +331,11 @@ public class View3dServiceImpl implements IView3dService {
public List<HashMap<String, Object>> getSafetyIndexWeek(String orgCode) { public List<HashMap<String, Object>> getSafetyIndexWeek(String orgCode) {
return view3dMapper.getSafetyIndexWeek(orgCode); return view3dMapper.getSafetyIndexWeek(orgCode);
} }
@Override
public Map<String, Object> getSystemOnlineDate(String orgCode) {
Date beginDate = DateUtil.formatDate(onLineDate,DateUtil.DATE_DEFAULT_FORMAT);
Date now = DateUtil.getNow();
return DateUtil.dayComparePrecise(beginDate,now);
}
} }
package com.yeejoin.amos.fas.business.service.intfc; package com.yeejoin.amos.fas.business.service.intfc;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.fas.business.bo.BindPointBo; import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo; import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo;
import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo; import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo;
...@@ -67,4 +68,14 @@ public interface IView3dService { ...@@ -67,4 +68,14 @@ public interface IView3dService {
*/ */
List<HashMap<String, Object>> getSafetyIndexWeek(String orgCode); List<HashMap<String, Object>> getSafetyIndexWeek(String orgCode);
/**
* 查询上线日期时间
* @return eg:10年3月2天
*/
/**
* 查询上线日期时间
* @param orgCode :登录机构
* @return eg:10年3月2天
*/
Map<String, Object> getSystemOnlineDate(String orgCode);
} }
...@@ -36,7 +36,8 @@ logging.level.com.yeejoin.amos.fas.business.dao.mapper=debug ...@@ -36,7 +36,8 @@ logging.level.com.yeejoin.amos.fas.business.dao.mapper=debug
#liquibase #liquibase
spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled= false spring.liquibase.enabled= true
param.system.online.date = 2020-02-12
visual.fegin.name=maas-visual visual.fegin.name=maas-visual
spring.http.multipart.maxFileSize = 10480000 spring.http.multipart.maxFileSize = 10480000
......
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