Commit 87e75f69f20cb1b5b1a5a6df2d6c3fde183eda0f

Authored by 娄高锋
1 parent 9eb97567

以临港的组织架构修改接口

src/main/java/com/bsth/common/BusinessCodeData.java
... ... @@ -14,7 +14,7 @@ import java.util.Set;
14 14 @Component
15 15 public class BusinessCodeData {
16 16  
17   - private static String str = "{\"22\": {\"name\": \"金高公司\",\"fgs\": {\"1\": \"四分公司\",\"2\": \"二分公司\",\"3\": \"三分公司\",\"5\": \"一分公司\"}},\"26\": {\"name\": \"南汇公司\",\"fgs\": {\"1\": \"南汇一分\",\"2\": \"南汇二分\",\"3\": \"南汇三分\",\"4\": \"南汇维修公司\",\"5\": \"南汇公司\"}},\"55\": {\"name\": \"上南公司\",\"fgs\": {\"1\": \"上南二分公司\",\"2\": \"上南三分公司\",\"3\": \"上南六分公司\",\"4\": \"上南一分公司\"}},\"05\": {\"name\": \"杨高公司\",\"fgs\": {\"1\": \"川沙分公司\",\"2\": \"金桥分公司\",\"3\": \"芦潮港分公司\",\"5\": \"杨高分公司\",\"6\": \"周浦分公司\"}},\"24\":{\"name\": \"嘉定公交\",\"fgs\": {\"1\": \"一车队\",\"2\": \"二车队\",\"3\": \"三车队\"}},\"77\": {\"name\": \"闵行公司\",\"fgs\": {\"78\": \"闵行公司\"}},\"99\": {\"name\": \"青浦公交\",\"fgs\": {\"100\": \"青浦公交\"}}}";
  17 + private static String str = "{\"77\": {\"name\": \"临港公交\",\"fgs\": {\"1\": \"一车队\",\"2\": \"二车队\",\"3\": \"三车队\",\"5\": \"五车队\",\"6\": \"六车队\"}}}";
18 18 static JSONObject data;
19 19  
20 20 /**
... ...
src/main/java/com/bsth/server_rs/bigdata/BigdataService.java
... ... @@ -99,6 +99,8 @@ public class BigdataService {
99 99 name="南汇公司";
100 100 }else if("55".equals(gs)){
101 101 name="上南公司";
  102 + }else if("77".equals(gs)){
  103 + name="临港公交";
102 104 }else{
103 105 name="";
104 106 }
... ...
src/main/java/com/bsth/server_rs/bigdata/BigscreenService.java
... ... @@ -99,6 +99,8 @@ public class BigscreenService {
99 99 name="南汇公司";
100 100 }else if("55".equals(gs)){
101 101 name="上南公司";
  102 + }else if("77".equals(gs)){
  103 + name="临港公交";
102 104 }else{
103 105 name="";
104 106 }
... ... @@ -139,8 +141,8 @@ public class BigscreenService {
139 141 public Map<String, Long> getEndtime(String date){
140 142 Map<String, Long> map=new HashMap<String,Long>();
141 143 String sql="select xl,endtime from bsth_c_calc_count "
142   - + " where date='"+date+"' ";
143   - List<Map<String, Object>> list=jdbcTemplate.query(sql,
  144 + + " where date = ? ";
  145 + List<Map<String, Object>> list=jdbcTemplate.query(sql, new Object[]{date},
144 146 new RowMapper<Map<String, Object>>(){
145 147 @Override
146 148 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
... ... @@ -1345,57 +1347,61 @@ public class BigscreenService {
1345 1347 attList.add(att);
1346 1348 }
1347 1349  
1348   - String gpLineSql = "select p.company_code, count(1) jsy"
  1350 + String gpLineSql = "select p.company_code, branche_company_code, count(1) jsy"
1349 1351 + " from (select e.jsy from bsth_c_s_ecinfo e"
1350 1352 + " where e.is_cancel = 0 group by e.jsy) a"
1351 1353 + " left join bsth_c_personnel p on a.jsy = p.id"
1352   - + " group by p.company_code";
  1354 + + " group by p.company_code, branche_company_code";
1353 1355 List<Map<String, Object>> ecList=jdbcTemplate.query(gpLineSql,
1354 1356 new RowMapper<Map<String, Object>>(){
1355 1357 @Override
1356 1358 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
1357 1359 Map<String, Object> m=new HashMap<String,Object>();
1358 1360 m.put("company", rs.getString("company_code"));
  1361 + m.put("brancheCompany", rs.getString("branche_company_code"));
1359 1362 m.put("jsy", rs.getString("jsy"));
1360 1363 return m;
1361 1364 }
1362 1365 });
1363 1366  
1364 1367 List<Map<String, Object>> jsyList = new ArrayList<Map<String, Object>>();
1365   - Map<String, Object> ygMap = new HashMap<String, Object>();
1366   - ygMap.put("company", "杨高");
1367   - ygMap.put("jsy", "0");
1368   - Map<String, Object> snMap = new HashMap<String, Object>();
1369   - snMap.put("company", "上南");
1370   - snMap.put("jsy", "0");
1371   - Map<String, Object> jgMap = new HashMap<String, Object>();
1372   - jgMap.put("company", "金高");
1373   - jgMap.put("jsy", "0");
1374   - Map<String, Object> nhMap = new HashMap<String, Object>();
1375   - nhMap.put("company", "南汇");
1376   - nhMap.put("jsy", "0");
1377   - for(Map<String, Object> m : ecList){ //顺序:杨高,上南,金高,南汇
1378   - if("05".equals(m.get("company").toString())){
1379   -// m.put("company", "杨高");
1380   - ygMap.put("jsy", m.get("jsy").toString());
  1368 + Map<String, Object> Map1 = new HashMap<String, Object>();
  1369 + Map1.put("company", "一车队");
  1370 + Map1.put("jsy", "0");
  1371 + Map<String, Object> Map2 = new HashMap<String, Object>();
  1372 + Map2.put("company", "二车队");
  1373 + Map2.put("jsy", "0");
  1374 + Map<String, Object> Map3 = new HashMap<String, Object>();
  1375 + Map3.put("company", "三车队");
  1376 + Map3.put("jsy", "0");
  1377 + Map<String, Object> Map5 = new HashMap<String, Object>();
  1378 + Map5.put("company", "五车队");
  1379 + Map5.put("jsy", "0");
  1380 + Map<String, Object> Map6 = new HashMap<String, Object>();
  1381 + Map6.put("company", "六车队");
  1382 + Map6.put("jsy", "0");
  1383 + for(Map<String, Object> m : ecList){ //顺序:一车队-->六车队
  1384 + if("77".equals(m.get("company").toString()) && "1".equals(m.get("brancheCompany").toString())){
  1385 + Map1.put("jsy", m.get("jsy").toString());
1381 1386 }
1382   - if("55".equals(m.get("company").toString())){
1383   -// m.put("company", "上南");
1384   - snMap.put("jsy", m.get("jsy").toString());
  1387 + if("77".equals(m.get("company").toString()) && "2".equals(m.get("brancheCompany").toString())){
  1388 + Map2.put("jsy", m.get("jsy").toString());
1385 1389 }
1386   - if("22".equals(m.get("company").toString())){
1387   -// m.put("company", "金高");
1388   - jgMap.put("jsy", m.get("jsy").toString());
  1390 + if("77".equals(m.get("company").toString()) && "3".equals(m.get("brancheCompany").toString())){
  1391 + Map3.put("jsy", m.get("jsy").toString());
1389 1392 }
1390   - if("26".equals(m.get("company").toString())){
1391   -// m.put("company", "南汇");
1392   - nhMap.put("jsy", m.get("jsy").toString());
  1393 + if("77".equals(m.get("company").toString()) && "5".equals(m.get("brancheCompany").toString())){
  1394 + Map5.put("jsy", m.get("jsy").toString());
  1395 + }
  1396 + if("77".equals(m.get("company").toString()) && "6".equals(m.get("brancheCompany").toString())){
  1397 + Map6.put("jsy", m.get("jsy").toString());
1393 1398 }
1394 1399 }
1395   - jsyList.add(ygMap);
1396   - jsyList.add(snMap);
1397   - jsyList.add(jgMap);
1398   - jsyList.add(nhMap);
  1400 + jsyList.add(Map1);
  1401 + jsyList.add(Map2);
  1402 + jsyList.add(Map3);
  1403 + jsyList.add(Map5);
  1404 + jsyList.add(Map6);
1399 1405  
1400 1406 String xlSql = "select a.jsy, b.spy, c.cl from"
1401 1407 + " (select count(1) jsy from (select a.jsy from bsth_c_s_ecinfo a where a.is_cancel = 0 and a.spy is not null and a.jsy is not null group by jsy) a) a"
... ... @@ -1494,7 +1500,7 @@ public class BigscreenService {
1494 1500 List<ScheduleRealInfo> findAll = scheduleRealInfoRepository.findAll(dates[i]);
1495 1501 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
1496 1502 for(ScheduleRealInfo s : findAll){
1497   - if(s.getGsBm() != null && s.getGsBm().equals(gsdm)){//直属公司
  1503 + if(s.getFgsBm() != null && s.getFgsBm().equals(gsdm)){//直属公司
1498 1504 if(s.getXlBm() != null && yyLine.contains(s.getXlBm())){//营运线路
1499 1505 if(!isInOut(s)){
1500 1506 Set<ChildTaskPlan> cts = s.getcTasks();
... ... @@ -1522,7 +1528,7 @@ public class BigscreenService {
1522 1528  
1523 1529 for(ScheduleRealInfo s : findAll){
1524 1530 try {
1525   - if(s.getGsBm() != null && s.getGsBm().equals(gsdm)){//直属公司
  1531 + if(s.getFgsBm() != null && s.getFgsBm().equals(gsdm)){//直属公司
1526 1532 if(s.getXlBm() != null && yyLine.contains(s.getXlBm())){//营运线路
1527 1533 if (s.isSflj() || isInOut(s)){
1528 1534 continue;
... ... @@ -1565,6 +1571,7 @@ public class BigscreenService {
1565 1571 else if(s.getStatus() == -1 && s.getAdjustExps().equals("缺人")){
1566 1572 Map<String, Object> m = new HashMap<String, Object>();
1567 1573 m.put("gsName", s.getGsName());
  1574 + m.put("fgsName",s.getFgsName());
1568 1575 m.put("lineName", s.getXlName());
1569 1576 m.put("driverName", s.getjName());
1570 1577 m.put("date", s.getRealExecDate());
... ... @@ -1596,7 +1603,8 @@ public class BigscreenService {
1596 1603 + " left join bsth_c_personnel p on a.jsy = p.id"
1597 1604 + " left join bsth_c_business b on p.company_code = b.up_code"
1598 1605 + " and p.branche_company_code = b.business_code"
1599   - + " where p.company_code = ?"
  1606 + + " where p.company_code = '77'"
  1607 + + " where p.branche_company_code = ?"
1600 1608 + " group by p.branche_company_code, b.business_name"
1601 1609 + " order by p.branche_company_code";
1602 1610 List<Map<String, Object>> ecList=jdbcTemplate.query(gpLineSql, new Object[]{gsdm},
... ... @@ -1632,18 +1640,20 @@ public class BigscreenService {
1632 1640 + " (select count(1) jsy from (select a.jsy from bsth_c_s_ecinfo a"
1633 1641 + " left join bsth_c_personnel p on a.jsy=p.id where a.is_cancel = 0"
1634 1642 + " and a.spy is not null and a.jsy is not null"
1635   - + " and p.company_code = ?"
  1643 + + " and p.company_code = '77' and p.branche_company_code = ?"
1636 1644 + " group by jsy) a) a"
1637 1645 + " LEFT JOIN"
1638 1646 + " (select count(1) spy from (select b.spy from bsth_c_s_ecinfo b"
1639 1647 + " left join bsth_c_personnel p on b.spy=p.id where b.is_cancel = 0"
1640   - + " and b.spy is not null and p.company_code = ?"
  1648 + + " and b.spy is not null"
  1649 + + " and p.company_code = '77' and p.branche_company_code = ?"
1641 1650 + " group by spy) b) b"
1642 1651 + " on 1=1"
1643 1652 + " LEFT JOIN"
1644 1653 + " (select count(1) cl from (select c.cl from bsth_c_s_ccinfo c"
1645 1654 + " left join bsth_c_cars car on c.cl=car.id where c.is_cancel = 0"
1646   - + " and c.cl is not null and car.business_code = ?"
  1655 + + " and c.cl is not null"
  1656 + + " and car.business_code = '77' and car.branche_company_code = ?"
1647 1657 + " and c.xl in(select e.xl from bsth_c_s_ecinfo e"
1648 1658 + " where e.is_cancel = 0 and e.spy is not null) group by c.cl) c) c"
1649 1659 + " on 1=1";
... ... @@ -1846,7 +1856,7 @@ public class BigscreenService {
1846 1856 return JSON.parseObject(JSON.toJSONString(resMap));
1847 1857 }
1848 1858  
1849   - /** 按月份查询直属公司统计指标 */
  1859 + /** 按月份查询车队统计指标 */
1850 1860 @GET
1851 1861 @Path("/selectData/getMonthly/{gsdm}/{month}")
1852 1862 public JSONObject getMonthly(@PathParam("gsdm") String gsdm, @PathParam("month") String month){
... ... @@ -1897,9 +1907,10 @@ public class BigscreenService {
1897 1907 + " jhsmbcs,sjsmbczds,smbczdl,jhsmbcsz,sjsmbczdsz,smbczdlz,"
1898 1908 + " jhszfcs,sjszfczds,szfczdl,jhzgl,sjzgl,create_date"
1899 1909 + " from bsth_c_calc_count "
1900   - + " where gsdm = '"+gsdm+"' and date like '%"+month+"%'";
  1910 + + " where gsdm = '77' and fgsdm = ?"
  1911 + + " and date like ?";
1901 1912  
1902   - List<Map<String, Object>> list=jdbcTemplate.query(sql,
  1913 + List<Map<String, Object>> list=jdbcTemplate.query(sql, new Object[]{gsdm, "%" + month + "%"},
1903 1914 new RowMapper<Map<String, Object>>(){
1904 1915 @Override
1905 1916 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
... ... @@ -2011,7 +2022,7 @@ public class BigscreenService {
2011 2022 return JSON.parseObject(JSON.toJSONString(resMap));
2012 2023 }
2013 2024  
2014   - /** 按日期查询四家直属公司统计指标 */
  2025 + /** 按日期查询所有车队统计指标 */
2015 2026 @GET
2016 2027 @Path("/selectData/getCompanyData/{date}")
2017 2028 public List<Map<String, Object>> getCompanyData(@PathParam("date") String date){
... ... @@ -2072,25 +2083,27 @@ public class BigscreenService {
2072 2083 final Map<String, String> gsMap = new HashMap<String, String>();
2073 2084 for(Map<String, Object> t : gsList){
2074 2085 if(t.get("code") != null && t.get("name") != null){
2075   - gsMap.put(t.get("code").toString(), t.get("name").toString().substring(0, 2));
  2086 + gsMap.put(t.get("code").toString(), t.get("name").toString());
2076 2087 }
2077 2088 }
2078 2089  
2079 2090  
2080   - String sql="select gsdm,xl,xl_name,date,jhbc,bczxl,jhbcz,sjbc,jhcc,sjcc,ccl,jhccz,"
2081   - + " jhyylc,sjyylc,jhyylcz,jhkslc,sjkslc,jhkslcz,"
  2091 + String sql="select gsdm,fgsdm,xl,xl_name,date,jhbc,bczxl,jhbcz,sjbc,"
  2092 + + " jhcc,sjcc,ccl,jhccz,jhyylc,sjyylc,jhyylcz,jhkslc,sjkslc,jhkslcz,"
2082 2093 + " jhssgfbcs,sjgfbcs,jhgfbcsz,jhssdgbcs,sjdgbcs,jhdgbcsz,"
2083 2094 + " jhsmbcs,sjsmbczds,smbczdl,jhsmbcsz,sjsmbczdsz,smbczdlz,"
2084 2095 + " jhszfcs,sjszfczds,szfczdl,jhzgl,sjzgl,create_date"
2085 2096 + " from bsth_c_calc_count "
2086   - + " where date = '"+date+"'";
  2097 + + " where date = ?";
2087 2098  
2088   - List<Map<String, Object>> list=jdbcTemplate.query(sql,
  2099 + List<Map<String, Object>> list=jdbcTemplate.query(sql, new Object[]{date},
2089 2100 new RowMapper<Map<String, Object>>(){
2090 2101 @Override
2091 2102 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
2092 2103 Map<String, Object> m=new HashMap<String,Object>();
  2104 + m.put("gsdm",rs.getString("gsdm")!=null?rs.getString("gsdm"):"");
2093 2105 m.put("gs",rs.getString("gsdm")!=null?gsMap.get(rs.getString("gsdm")):"");
  2106 + m.put("fgs",rs.getString("fgsdm")!=null?gsMap.get(rs.getString("fgsdm")):"");
2094 2107 m.put("lineCode",rs.getString("xl"));
2095 2108 m.put("lineName", rs.getString("xl_name"));
2096 2109 m.put("date", rs.getString("date"));
... ... @@ -2142,32 +2155,54 @@ public class BigscreenService {
2142 2155  
2143 2156  
2144 2157 Map<String, Integer> sortMap = new HashMap<String, Integer>();
2145   - sortMap.put("杨高", 0);
2146   - sortMap.put("上南", 1);
2147   - sortMap.put("金高", 2);
2148   - sortMap.put("南汇", 3);
2149   - sortMap.put("浦交", 4);
2150   - Map<String, Object> ygMap = new HashMap<String, Object>();
2151   - ygMap.put("gs", "杨高");
2152   - resList.add(ygMap);
2153   - Map<String, Object> snMap = new HashMap<String, Object>();
2154   - snMap.put("gs", "上南");
2155   - resList.add(snMap);
2156   - Map<String, Object> jgMap = new HashMap<String, Object>();
2157   - jgMap.put("gs", "金高");
2158   - resList.add(jgMap);
2159   - Map<String, Object> nhMap = new HashMap<String, Object>();
2160   - nhMap.put("gs", "南汇");
2161   - resList.add(nhMap);
2162   - Map<String, Object> pjMap = new HashMap<String, Object>();
2163   - pjMap.put("gs", "浦交");
2164   - resList.add(pjMap);
  2158 + sortMap.put("一车队", 0);
  2159 + sortMap.put("二车队", 1);
  2160 + sortMap.put("三车队", 2);
  2161 + sortMap.put("五车队", 3);
  2162 + sortMap.put("六车队", 4);
  2163 + sortMap.put("临港公交", 5);
  2164 + Map<String, Object> Map1 = new HashMap<String, Object>();
  2165 + Map1.put("gs", "一车队");
  2166 + resList.add(Map1);
  2167 + Map<String, Object> Map2 = new HashMap<String, Object>();
  2168 + Map2.put("gs", "二车队");
  2169 + resList.add(Map2);
  2170 + Map<String, Object> Map3 = new HashMap<String, Object>();
  2171 + Map3.put("gs", "三车队");
  2172 + resList.add(Map3);
  2173 + Map<String, Object> Map5 = new HashMap<String, Object>();
  2174 + Map5.put("gs", "五车队");
  2175 + resList.add(Map5);
  2176 + Map<String, Object> Map6 = new HashMap<String, Object>();
  2177 + Map6.put("gs", "六车队");
  2178 + resList.add(Map6);
  2179 + Map<String, Object> lgMap = new HashMap<String, Object>();
  2180 + lgMap.put("gs", "临港公交");
  2181 + resList.add(lgMap);
  2182 +
  2183 + for(Map<String, Object> m : resList){
  2184 + mapPut(m, "jhcc", 0);
  2185 + mapPut(m, "sjcc", 0);
  2186 + mapPut(m, "jhbc", 0);
  2187 + mapPut(m, "sjbc", 0);
  2188 + mapPut(m, "jhsmbc", 0);
  2189 + mapPut(m, "sjsmbc", 0);
  2190 + mapPut(m, "jhqqbc", 0);
  2191 + mapPut(m, "sjqqzd", 0);
  2192 + mapPut(m, "jhgpqqbc", 0);
  2193 + mapPut(m, "sjgpqqzd", 0);
  2194 + mapPut(m, "jhzgl", 0);
  2195 + mapPut(m, "sjzgl", 0);
  2196 + mapPut(m, "bcs", 0);
  2197 + mapPut(m, "qks", 0);
  2198 + }
2165 2199  
2166 2200  
2167 2201 for(Map<String, Object> t : list){
2168   - if(yyLine.contains(t.get("lineCode").toString())){
2169   - if(sortMap.get(t.get("gs")) != null){
2170   - Map<String, Object> m = resList.get(sortMap.get(t.get("gs")));
  2202 + if(yyLine.contains(t.get("lineCode").toString())
  2203 + && "77".equals(t.get("gsdm").toString())){
  2204 + if(sortMap.get(t.get("fgs")) != null){
  2205 + Map<String, Object> m = resList.get(sortMap.get(t.get("fgs")));
2171 2206 mapPut(m, "jhcc", t.get("jhccz").toString());
2172 2207 mapPut(m, "sjcc", t.get("sjcc").toString());
2173 2208 mapPut(m, "jhbc", t.get("jhbc").toString());
... ... @@ -2184,20 +2219,20 @@ public class BigscreenService {
2184 2219 mapPut(m, "sjzgl", t.get("sjzgl").toString());
2185 2220 }
2186 2221  
2187   - mapPut(pjMap, "jhcc", t.get("jhccz").toString());
2188   - mapPut(pjMap, "sjcc", t.get("sjcc").toString());
2189   - mapPut(pjMap, "jhbc", t.get("jhbc").toString());
2190   - mapPut(pjMap, "sjbc", t.get("sjbc").toString());
2191   - mapPut(pjMap, "jhsmbc", t.get("jhsmbcs").toString());
2192   - mapPut(pjMap, "sjsmbc", t.get("sjsmbczds").toString());
2193   - mapPut(pjMap, "jhqqbc", t.get("jhszfcs").toString());
2194   - mapPut(pjMap, "sjqqzd", t.get("sjszfczds").toString());
  2222 + mapPut(lgMap, "jhcc", t.get("jhccz").toString());
  2223 + mapPut(lgMap, "sjcc", t.get("sjcc").toString());
  2224 + mapPut(lgMap, "jhbc", t.get("jhbc").toString());
  2225 + mapPut(lgMap, "sjbc", t.get("sjbc").toString());
  2226 + mapPut(lgMap, "jhsmbc", t.get("jhsmbcs").toString());
  2227 + mapPut(lgMap, "sjsmbc", t.get("sjsmbczds").toString());
  2228 + mapPut(lgMap, "jhqqbc", t.get("jhszfcs").toString());
  2229 + mapPut(lgMap, "sjqqzd", t.get("sjszfczds").toString());
2195 2230 if(gpSet.contains(t.get("lineCode").toString())){
2196   - mapPut(pjMap, "jhgpqqbc", t.get("jhszfcs").toString());
2197   - mapPut(pjMap, "sjgpqqzd", t.get("sjszfczds").toString());
  2231 + mapPut(lgMap, "jhgpqqbc", t.get("jhszfcs").toString());
  2232 + mapPut(lgMap, "sjgpqqzd", t.get("sjszfczds").toString());
2198 2233 }
2199   - mapPut(pjMap, "jhzgl", t.get("jhzgl").toString());
2200   - mapPut(pjMap, "sjzgl", t.get("sjzgl").toString());
  2234 + mapPut(lgMap, "jhzgl", t.get("jhzgl").toString());
  2235 + mapPut(lgMap, "sjzgl", t.get("sjzgl").toString());
2201 2236 }
2202 2237 }
2203 2238  
... ... @@ -2206,10 +2241,11 @@ public class BigscreenService {
2206 2241 List<ScheduleRealInfo> findAll = scheduleRealInfoRepository.findAll(date);
2207 2242 long jh = 0, sj = 0;
2208 2243 for(ScheduleRealInfo s : findAll){
2209   - if(s.getXlBm() != null && yyLine.contains(s.getXlBm())){//营运线路
  2244 + if(s.getXlBm() != null && yyLine.contains(s.getXlBm())//营运线路
  2245 + && "77".equals(s.getGsBm())){
2210 2246 if(!isInOut(s) && !s.isCcService() && s.getStatus() != -1 && s.getStatus() != 0){
2211   - if(s.getGsBm()!=null && sortMap.get(gsMap.get(s.getGsBm()!=null?s.getGsBm():"")) != null){
2212   - Map<String, Object> m = resList.get(sortMap.get(gsMap.get(s.getGsBm())));
  2247 + if(s.getFgsBm()!=null && sortMap.get(gsMap.get(s.getFgsBm()!=null?s.getFgsBm():"")) != null){
  2248 + Map<String, Object> m = resList.get(sortMap.get(gsMap.get(s.getFgsBm())));
2213 2249 ++jh;
2214 2250 mapPut(m, "bcs", 1);
2215 2251 String sty = decimalToBinary(s.getRfidState());
... ... @@ -2222,8 +2258,8 @@ public class BigscreenService {
2222 2258 }
2223 2259 }
2224 2260 }
2225   - mapPut(pjMap, "bcs", jh);
2226   - mapPut(pjMap, "qks", sj);
  2261 + mapPut(lgMap, "bcs", jh);
  2262 + mapPut(lgMap, "qks", sj);
2227 2263  
2228 2264  
2229 2265 for(Map<String, Object> m : resList){
... ... @@ -2373,8 +2409,8 @@ public class BigscreenService {
2373 2409 }
2374 2410 }
2375 2411  
2376   - String calcIntervalSql = "select * from bsth_c_calc_interval where date = '"+date+"' and sfyy = 1";
2377   - List<Map<String, Object>> calcIntervalList=jdbcTemplate.query(calcIntervalSql,
  2412 + String calcIntervalSql = "select * from bsth_c_calc_interval where date = ? and sfyy = 1";
  2413 + List<Map<String, Object>> calcIntervalList=jdbcTemplate.query(calcIntervalSql, new Object[]{date},
2378 2414 new RowMapper<Map<String, Object>>(){
2379 2415 @Override
2380 2416 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
... ... @@ -2389,8 +2425,8 @@ public class BigscreenService {
2389 2425 }
2390 2426 });
2391 2427  
2392   - String calcIntervalDetailSql = "select * from bsth_c_calc_interval_detail where date = '"+date+"'";
2393   - List<Map<String, Object>> calcIntervalDetailList=jdbcTemplate.query(calcIntervalDetailSql,
  2428 + String calcIntervalDetailSql = "select * from bsth_c_calc_interval_detail where date = ?";
  2429 + List<Map<String, Object>> calcIntervalDetailList=jdbcTemplate.query(calcIntervalDetailSql, new Object[]{date},
2394 2430 new RowMapper<Map<String, Object>>(){
2395 2431 @Override
2396 2432 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
... ... @@ -2451,13 +2487,13 @@ public class BigscreenService {
2451 2487 for(Map<String, Object> m : gsList){
2452 2488 if(m.get("upCode") != null && m.get("upCode").toString().trim().length() > 0
2453 2489 && !("0".equals(m.get("upCode").toString().trim()))){
2454   - if("88".equals(m.get("upCode").toString().trim())){
  2490 + if("77".equals(m.get("upCode").toString().trim())){
2455 2491 gsMap.put(m.get("code").toString(), m.get("name").toString());
2456 2492 }
2457 2493 }
2458 2494 }
2459 2495  
2460   - String[] gsS = {gsMap.get("05").toString(), gsMap.get("55").toString(), gsMap.get("22").toString(), gsMap.get("26").toString()};
  2496 + String[] gsS = {gsMap.get("1").toString(), gsMap.get("2").toString(), gsMap.get("3").toString(), gsMap.get("5").toString(), gsMap.get("6").toString()};
2461 2497 String[] levelS = {"A1", "A2", "A3", "B1", "B2", "B3", "C1", "C2", "D", "E"};
2462 2498 List<String> keyList = new ArrayList<String>();
2463 2499 for(String gs : gsS){
... ... @@ -2472,8 +2508,8 @@ public class BigscreenService {
2472 2508 d.setTime(d.getTime() - l*1000*60*60*24);
2473 2509 String date1 = sdf.format(d);
2474 2510  
2475   - String calcIntervalSql = "select * from bsth_c_calc_interval where date = '"+date1+"' and sfyy = 1";
2476   - List<Map<String, Object>> calcIntervalList=jdbcTemplate.query(calcIntervalSql,
  2511 + String calcIntervalSql = "select * from bsth_c_calc_interval where date = ? and sfyy = 1";
  2512 + List<Map<String, Object>> calcIntervalList=jdbcTemplate.query(calcIntervalSql, new Object[]{date1},
2477 2513 new RowMapper<Map<String, Object>>(){
2478 2514 @Override
2479 2515 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
... ... @@ -2492,13 +2528,15 @@ public class BigscreenService {
2492 2528  
2493 2529 Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>();
2494 2530 for(Map<String, Object> m : calcIntervalList){
2495   - String gsName = gsMap.get(m.get("gsbm").toString()).toString();
  2531 + String gsName = "临港公交";
  2532 + String fgsName = gsMap.get(m.get("fgsbm").toString()).toString();
2496 2533 String level = m.get("level").toString();
2497   - String key = gsName + "_" + level;
  2534 + String key = fgsName + "_" + level;
2498 2535 if(!(keyMap.containsKey(key))){
2499 2536 Map<String, Object> map = new HashMap<String, Object>();
2500 2537 map.put("date", date1);
2501 2538 map.put("gs", gsName);
  2539 + map.put("fgs", fgsName);
2502 2540 map.put("level", level);
2503 2541 map.put("djgAll", 0);
2504 2542 map.put("djgZgf", 0);
... ... @@ -2559,9 +2597,9 @@ public class BigscreenService {
2559 2597 String minfcsj="02:00";
2560 2598 String sqlMinYysj="select start_opt from bsth_c_line_config where "
2561 2599 + " id = ("
2562   - + "select max(id) from bsth_c_line_config where line ='"+ lineCode +"'"
  2600 + + "select max(id) from bsth_c_line_config where line = ?"
2563 2601 + ")";
2564   - List<String> list= jdbcTemplate.query(sqlMinYysj,
  2602 + List<String> list= jdbcTemplate.query(sqlMinYysj, new Object[]{lineCode},
2565 2603 new RowMapper<String>(){
2566 2604 @Override
2567 2605 public String mapRow(ResultSet rs, int rowNum) throws SQLException {
... ... @@ -2873,58 +2911,68 @@ public class BigscreenService {
2873 2911 List<ScheduleRealInfo> notYetList = new ArrayList<ScheduleRealInfo>();
2874 2912  
2875 2913 long sum = scheduleMap.keySet().size(), zwd = 0;//早未到数
2876   - long yg_z = 0, sn_z = 0, jg_z = 0, nh_z = 0;
2877   - long yg_zwd = 0, sn_zwd = 0, jg_zwd = 0, nh_zwd = 0;
  2914 +// long yg_z = 0, sn_z = 0, jg_z = 0, nh_z = 0;
  2915 + long cd_1 = 0, cd_2 = 0, cd_3 = 0, cd_5 = 0, cd_6 = 0;
  2916 +// long yg_zwd = 0, sn_zwd = 0, jg_zwd = 0, nh_zwd = 0;
  2917 + long cd_1_zwd = 0, cd_2_zwd = 0, cd_3_zwd = 0, cd_5_zwd = 0, cd_6_zwd = 0;
2878 2918 for(String key : scheduleMap.keySet()){
2879 2919 ScheduleRealInfo s = scheduleMap.get(key);
2880   - if("05".equals(s.getGsBm())){
2881   - yg_z += 1;
2882   - } else if("55".equals(s.getGsBm())){
2883   - sn_z += 1;
2884   - } else if("22".equals(s.getGsBm())){
2885   - jg_z += 1;
2886   - } else if("26".equals(s.getGsBm())){
2887   - nh_z += 1;
2888   - }
2889   - if("缺人".equals(s.getAdjustExps())){
2890   - List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
2891   - list.add(s);
2892   - BigDecimal sjgl = new BigDecimal(culateSjgl(list));
2893   - BigDecimal ljgl = new BigDecimal(culateLjgl(list));
2894   - BigDecimal zero = new BigDecimal(0.0);
2895   - if(sjgl.compareTo(zero) == 0 && ljgl.compareTo(zero) == 0){
2896   - zwd += 1;
2897   - if("05".equals(s.getGsBm())){
2898   - yg_zwd += 1;
2899   - } else if("55".equals(s.getGsBm())){
2900   - sn_zwd += 1;
2901   - } else if("22".equals(s.getGsBm())){
2902   - jg_zwd += 1;
2903   - } else if("26".equals(s.getGsBm())){
2904   - nh_zwd += 1;
2905   - }
2906   - notYetList.add(s);
  2920 + if("77".equals(s.getGsBm())){
  2921 + if("1".equals(s.getFgsBm())){
  2922 + cd_1 += 1;
  2923 + } else if("2".equals(s.getFgsBm())){
  2924 + cd_2 += 1;
  2925 + } else if("3".equals(s.getFgsBm())){
  2926 + cd_3 += 1;
  2927 + } else if("5".equals(s.getFgsBm())){
  2928 + cd_5 += 1;
  2929 + } else if("6".equals(s.getFgsBm())){
  2930 + cd_6 += 1;
2907 2931 }
2908   - }
  2932 + if("缺人".equals(s.getAdjustExps())){
  2933 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  2934 + list.add(s);
  2935 + BigDecimal sjgl = new BigDecimal(culateSjgl(list));
  2936 + BigDecimal ljgl = new BigDecimal(culateLjgl(list));
  2937 + BigDecimal zero = new BigDecimal(0.0);
  2938 + if(sjgl.compareTo(zero) == 0 && ljgl.compareTo(zero) == 0){
  2939 + zwd += 1;
  2940 + if("1".equals(s.getFgsBm())){
  2941 + cd_1_zwd += 1;
  2942 + } else if("2".equals(s.getFgsBm())){
  2943 + cd_2_zwd += 1;
  2944 + } else if("3".equals(s.getFgsBm())){
  2945 + cd_3_zwd += 1;
  2946 + } else if("5".equals(s.getFgsBm())){
  2947 + cd_5_zwd += 1;
  2948 + } else if("6".equals(s.getFgsBm())){
  2949 + cd_6_zwd += 1;
  2950 + }
  2951 + notYetList.add(s);
  2952 + }
  2953 + }
  2954 + }
2909 2955 }
2910 2956  
2911 2957 resMap.put("sum", sum);
2912 2958 resMap.put("notYet", zwd);
2913   - resMap.put("sum_05", yg_z);
2914   - resMap.put("notYet_05", yg_zwd);
2915   - resMap.put("sum_55", sn_z);
2916   - resMap.put("notYet_55", sn_zwd);
2917   - resMap.put("sum_22", jg_z);
2918   - resMap.put("notYet_22", jg_zwd);
2919   - resMap.put("sum_26", nh_z);
2920   - resMap.put("notYet_26", nh_zwd);
  2959 + resMap.put("sum_1", cd_1);
  2960 + resMap.put("notYet_1", cd_1_zwd);
  2961 + resMap.put("sum_2", cd_2);
  2962 + resMap.put("notYet_2", cd_2_zwd);
  2963 + resMap.put("sum_3", cd_3);
  2964 + resMap.put("notYet_3", cd_3_zwd);
  2965 + resMap.put("sum_5", cd_5);
  2966 + resMap.put("notYet_5", cd_5_zwd);
  2967 + resMap.put("sum_6", cd_6);
  2968 + resMap.put("notYet_6", cd_6_zwd);
2921 2969 resMap.put("notYetList", notYetList);
2922 2970 return resMap;
2923 2971 }
2924 2972  
2925   - public static void main(String[] args){
2926   -
2927   - }
  2973 +// public static void main(String[] args){
  2974 +//
  2975 +// }
2928 2976  
2929 2977 public List<Map<String, Object>> createMap(String type, String[] dates){
2930 2978 List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
... ...
src/main/resources/application-prod.properties
1   -server.port=9089
2   -management.port= 9001
3   -management.address= 127.0.0.1
4   -
5   -spring.jpa.hibernate.ddl-auto= none
6   -spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
7   -#DATABASE
8   -spring.jpa.database= MYSQL
9   -spring.jpa.show-sql= false
10   -spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11   -spring.datasource.url= jdbc:mysql://10.10.150.103/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12   -spring.datasource.username= root
13   -spring.datasource.password= Aa123456
14   -#DATASOURCE
15   -spring.datasource.max-active=100
16   -spring.datasource.max-idle=8
17   -spring.datasource.min-idle=8
18   -spring.datasource.initial-size=3
19   -
20   -spring.datasource.test-on-borrow=true
21   -spring.datasource.test-on-connect=true
22   -spring.datasource.test-on-return=true
23   -spring.datasource.test-while-idle=true
24   -spring.datasource.validation-query=select 1
25   -
26   -#REDIS
27   -spring.redis.database=0
28   -spring.redis.host=10.10.150.103
29   -spring.redis.password=bsth_control_001
30   -spring.redis.port=28008
31   -
32   -http.control.service_data_url= http://10.10.150.103:9088/companyService
33   -http.control.secret.key= dVPHJkWUt5FhMT7jrM2dLV7QvlHAmZFd42rs1P0usBx8A7HZki
34   -
  1 +server.port=9089
  2 +management.port= 9001
  3 +management.address= 127.0.0.1
  4 +
  5 +spring.jpa.hibernate.ddl-auto= none
  6 +spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
  7 +#DATABASE
  8 +spring.jpa.database= MYSQL
  9 +spring.jpa.show-sql= false
  10 +spring.datasource.driver-class-name= com.mysql.jdbc.Driver
  11 +spring.datasource.url= jdbc:mysql://10.10.150.103:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  12 +spring.datasource.username= root
  13 +spring.datasource.password= Aa123456
  14 +#DATASOURCE
  15 +spring.datasource.max-active=100
  16 +spring.datasource.max-idle=8
  17 +spring.datasource.min-idle=8
  18 +spring.datasource.initial-size=3
  19 +
  20 +spring.datasource.test-on-borrow=true
  21 +spring.datasource.test-on-connect=true
  22 +spring.datasource.test-on-return=true
  23 +spring.datasource.test-while-idle=true
  24 +spring.datasource.validation-query=select 1
  25 +
  26 +#REDIS
  27 +spring.redis.database=0
  28 +spring.redis.host=10.10.150.103
  29 +spring.redis.password=bsth_control_001
  30 +spring.redis.port=28008
  31 +
  32 +http.control.service_data_url= http://10.10.150.103:9088/companyService
  33 +http.control.secret.key= dVPHJkWUt5FhMT7jrM2dLV7QvlHAmZFd42rs1P0usBx8A7HZki
  34 +
35 35 http.gps.real.url= http://10.10.150.103:8080/transport_server/rtgps/
36 36 \ No newline at end of file
... ...