Commit a6067438238c7b40bf8ff7c03bd70bd318637b7d

Authored by 娄高锋
1 parent 30fb7355

大间隔统计接口,添加备注字段;挂牌线路接口;

src/main/java/com/bsth/server_rs/bigdata/BigdataService.java
@@ -25,7 +25,6 @@ import javax.ws.rs.core.MediaType; @@ -25,7 +25,6 @@ import javax.ws.rs.core.MediaType;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
27 import org.springframework.beans.factory.annotation.Autowired; 27 import org.springframework.beans.factory.annotation.Autowired;
28 -import org.springframework.data.redis.support.collections.RedisMap;  
29 import org.springframework.jdbc.core.JdbcTemplate; 28 import org.springframework.jdbc.core.JdbcTemplate;
30 import org.springframework.jdbc.core.RowMapper; 29 import org.springframework.jdbc.core.RowMapper;
31 import org.springframework.stereotype.Component; 30 import org.springframework.stereotype.Component;
@@ -38,7 +37,6 @@ import com.bsth.repository.DestroySituationRepository; @@ -38,7 +37,6 @@ import com.bsth.repository.DestroySituationRepository;
38 import com.bsth.repository.ScheduleRealInfoRepository; 37 import com.bsth.repository.ScheduleRealInfoRepository;
39 import com.bsth.server_rs.base_info.car.buffer.CarBufferData; 38 import com.bsth.server_rs.base_info.car.buffer.CarBufferData;
40 import com.bsth.util.Arith; 39 import com.bsth.util.Arith;
41 -import com.mysql.fabric.xmlrpc.base.Array;  
42 40
43 @Component 41 @Component
44 @Path("/bigdata") 42 @Path("/bigdata")
@@ -1482,4 +1480,30 @@ public class BigdataService { @@ -1482,4 +1480,30 @@ public class BigdataService {
1482 return resList; 1480 return resList;
1483 } 1481 }
1484 1482
  1483 + //全部挂牌线路
  1484 + @GET
  1485 + @Path("/findLinePlate/all")
  1486 + public List<Map<String, Object>> findLinePlate() {
  1487 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  1488 + String gpLineSql = "select * from bsth_c_line_plate";
  1489 + List<Map<String, Object>> gpLineList=jdbcTemplate.query(gpLineSql,
  1490 + new RowMapper<Map<String, Object>>(){
  1491 + @Override
  1492 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  1493 + Map<String, Object> m=new HashMap<String,Object>();
  1494 + m.put("lineName", rs.getString("line_name"));
  1495 + m.put("lineCode", rs.getString("line_code"));
  1496 + return m;
  1497 + }
  1498 + });
  1499 +
  1500 + for(Map<String, Object> t : gpLineList){
  1501 + if(t.get("lineCode") == null || t.get("lineCode").toString().trim().length() == 0){
  1502 + t.put("lineCode", "");
  1503 + }
  1504 + resList.add(t);
  1505 + }
  1506 + return resList;
  1507 + }
  1508 +
1485 } 1509 }
src/main/java/com/bsth/server_rs/bigdata/BigscreenService.java
@@ -26,6 +26,7 @@ import javax.ws.rs.Produces; @@ -26,6 +26,7 @@ import javax.ws.rs.Produces;
26 import javax.ws.rs.core.MediaType; 26 import javax.ws.rs.core.MediaType;
27 27
28 import org.apache.commons.lang.StringUtils; 28 import org.apache.commons.lang.StringUtils;
  29 +import org.codehaus.stax2.evt.DTD2;
29 import org.slf4j.Logger; 30 import org.slf4j.Logger;
30 import org.slf4j.LoggerFactory; 31 import org.slf4j.LoggerFactory;
31 import org.springframework.beans.factory.annotation.Autowired; 32 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,6 +40,7 @@ import com.bsth.entity.ChildTaskPlan; @@ -39,6 +40,7 @@ import com.bsth.entity.ChildTaskPlan;
39 import com.bsth.entity.ScheduleRealInfo; 40 import com.bsth.entity.ScheduleRealInfo;
40 import com.bsth.repository.ScheduleRealInfoRepository; 41 import com.bsth.repository.ScheduleRealInfoRepository;
41 import com.bsth.util.Arith; 42 import com.bsth.util.Arith;
  43 +import com.mysql.fabric.xmlrpc.base.Array;
42 44
43 @Component 45 @Component
44 @Path("/bigscreen") 46 @Path("/bigscreen")
@@ -2212,8 +2214,27 @@ public class BigscreenService { @@ -2212,8 +2214,27 @@ public class BigscreenService {
2212 2214
2213 /** 报备登记查询接口 */ 2215 /** 报备登记查询接口 */
2214 @GET 2216 @GET
2215 - @Path("/selectData/getReport")  
2216 - public List<Map<String, Object>> getReport(){ 2217 + @Path("/selectData/getReport/startDate/{startDate}/endDate/{endDate}")
  2218 + public List<Map<String, Object>> getReport(@PathParam("startDate") String starDate,
  2219 + @PathParam("endDate") String endDate){
  2220 + Date d1 = new Date(), d2 = new Date();
  2221 + try{
  2222 + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
  2223 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  2224 + d1 = sd.parse(starDate);
  2225 + d2 = sd.parse(endDate);
  2226 + d2.setTime(d2.getTime() + (1l*1000*60*60*24 - 1));
  2227 + starDate = sdf.format(d1);
  2228 + endDate = sdf.format(d2);
  2229 + }catch(ParseException e){
  2230 + // TODO Auto-generated catch block
  2231 + e.printStackTrace();
  2232 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  2233 + Map<String, Object> result = new HashMap<String, Object>();
  2234 + result.put("msg", "参数日期格式错误");
  2235 + list.add(result);
  2236 + return list;
  2237 + }
2217 String sql="SELECT ID,REPORT_TYPE,REPORT_GS,REPORT_FGS,REPORT_GSNAME,REPORT_FGSNAME," 2238 String sql="SELECT ID,REPORT_TYPE,REPORT_GS,REPORT_FGS,REPORT_GSNAME,REPORT_FGSNAME,"
2218 + " REPORT_DATE,REPORT_BBR,REPORT_XL,REPORT_XLNAME,REPORT_STATION,REPORT_DWSBBM," 2239 + " REPORT_DATE,REPORT_BBR,REPORT_XL,REPORT_XLNAME,REPORT_STATION,REPORT_DWSBBM,"
2219 + " REPORT_DWSBSJ,REPORT_YWSJ,REPORT_SMBWD,REPORT_DJGSJ,REPORT_DJGYY,REPORT_TFSJ," 2240 + " REPORT_DWSBSJ,REPORT_YWSJ,REPORT_SMBWD,REPORT_DJGSJ,REPORT_DJGYY,REPORT_TFSJ,"
@@ -2221,8 +2242,9 @@ public class BigscreenService { @@ -2221,8 +2242,9 @@ public class BigscreenService {
2221 + " REPORT_SGSJ,REPORT_SGDD,REPORT_XSFX,REPORT_SGDX,REPORT_DXPZH,REPORT_SGGK," 2242 + " REPORT_SGSJ,REPORT_SGDD,REPORT_XSFX,REPORT_SGDX,REPORT_DXPZH,REPORT_SGGK,"
2222 + " REPORT_SSRS,REPORT_SWRS,REPORT_BGR,REPORT_BGRDH,REPORT_BZ,REPORT_ROAD,STATUS," 2243 + " REPORT_SSRS,REPORT_SWRS,REPORT_BGR,REPORT_BGRDH,REPORT_BZ,REPORT_ROAD,STATUS,"
2223 + " CREATE_BY,CREATE_DATE,UPDATE_BY,UPDATE_DATE" 2244 + " CREATE_BY,CREATE_DATE,UPDATE_BY,UPDATE_DATE"
2224 - + " from bsth_t_report ";  
2225 - List<Map<String, Object>> list=jdbcTemplate.query(sql, 2245 + + " from bsth_t_report "
  2246 + + " where REPORT_DATE >= ? and REPORT_DATE <= ?";
  2247 + List<Map<String, Object>> list=jdbcTemplate.query(sql, new Object[]{starDate, endDate},
2226 new RowMapper<Map<String, Object>>(){ 2248 new RowMapper<Map<String, Object>>(){
2227 @Override 2249 @Override
2228 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { 2250 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
@@ -2340,6 +2362,7 @@ public class BigscreenService { @@ -2340,6 +2362,7 @@ public class BigscreenService {
2340 m.put("jhfc2", rs.getString("jhfc2")); 2362 m.put("jhfc2", rs.getString("jhfc2"));
2341 m.put("sjfc2", rs.getString("sjfc2")); 2363 m.put("sjfc2", rs.getString("sjfc2"));
2342 m.put("subTime", rs.getString("sub_time")); 2364 m.put("subTime", rs.getString("sub_time"));
  2365 + m.put("remark", rs.getString("remark"));
2343 return m; 2366 return m;
2344 } 2367 }
2345 }); 2368 });