Commit 0fc4bdad984a306970fd3d979c64c92dd666f44a
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
# Conflicts: # src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java # src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
Showing
4 changed files
with
59 additions
and
45 deletions
Too many changes to show.
To preserve performance only 4 of 10 files are displayed.
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -139,19 +139,19 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 139 | 139 | |
| 140 | 140 | //去掉了 xlBm is not null |
| 141 | 141 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 142 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlDir,s.realExecDate,s.dfsj, (s.lpName+1)") | |
| 142 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlDir,s.realExecDate,s.fcsj, lpName") | |
| 143 | 143 | List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date); |
| 144 | 144 | |
| 145 | 145 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 146 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.dfsj") | |
| 146 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.lpName, s.realExecDate,s.fcsj") | |
| 147 | 147 | List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date); |
| 148 | 148 | |
| 149 | 149 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 150 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where gsBm like %?1% and fgsBm like %?2% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?3 and s.bcType not in ('in','out','ldks') order by s.xlDir,s.realExecDate,s.dfsj, (s.lpName+1)") | |
| 150 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where gsBm like %?1% and fgsBm like %?2% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?3 and s.bcType not in ('in','out','ldks') order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") | |
| 151 | 151 | List<ScheduleRealInfo> scheduleByDateAndLineByGs(String gsdm,String fgsdm,String date); |
| 152 | 152 | |
| 153 | 153 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 154 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlDir,s.realExecDate,s.dfsj, (s.lpName+1)") | |
| 154 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") | |
| 155 | 155 | List<ScheduleRealInfo> scheduleByDateAndLineQp2(String line,String date); |
| 156 | 156 | |
| 157 | 157 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
| 1 | 1 | package com.bsth.service.oil.impl; |
| 2 | 2 | |
| 3 | +import java.sql.ResultSet; | |
| 4 | +import java.sql.SQLException; | |
| 5 | +import java.text.ParseException; | |
| 6 | +import java.text.SimpleDateFormat; | |
| 7 | +import java.util.ArrayList; | |
| 8 | +import java.util.HashMap; | |
| 9 | +import java.util.List; | |
| 10 | +import java.util.Map; | |
| 11 | + | |
| 12 | +import javax.transaction.Transactional; | |
| 13 | + | |
| 14 | +import org.apache.commons.lang3.StringEscapeUtils; | |
| 15 | +import org.slf4j.Logger; | |
| 16 | +import org.slf4j.LoggerFactory; | |
| 17 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 18 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 19 | +import org.springframework.jdbc.core.RowMapper; | |
| 20 | +import org.springframework.stereotype.Service; | |
| 21 | + | |
| 3 | 22 | import com.alibaba.fastjson.JSONArray; |
| 4 | 23 | import com.alibaba.fastjson.JSONObject; |
| 5 | 24 | import com.bsth.common.ResponseCode; |
| 25 | +import com.bsth.entity.excep.Offline; | |
| 6 | 26 | import com.bsth.entity.oil.Ylb; |
| 7 | 27 | import com.bsth.entity.oil.Ylxxb; |
| 28 | +import com.bsth.entity.search.CustomerSpecs; | |
| 8 | 29 | import com.bsth.repository.oil.YlbRepository; |
| 9 | 30 | import com.bsth.repository.oil.YlxxbRepository; |
| 10 | 31 | import com.bsth.service.impl.BaseServiceImpl; |
| 11 | 32 | import com.bsth.service.oil.YlxxbService; |
| 12 | 33 | import com.bsth.util.PageHelper; |
| 13 | 34 | import com.bsth.util.PageObject; |
| 14 | -import org.apache.commons.lang3.StringEscapeUtils; | |
| 15 | -import org.slf4j.Logger; | |
| 16 | -import org.slf4j.LoggerFactory; | |
| 17 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 18 | -import org.springframework.jdbc.core.JdbcTemplate; | |
| 19 | -import org.springframework.jdbc.core.RowMapper; | |
| 20 | -import org.springframework.stereotype.Service; | |
| 21 | - | |
| 22 | -import javax.transaction.Transactional; | |
| 23 | -import java.sql.ResultSet; | |
| 24 | -import java.sql.SQLException; | |
| 25 | -import java.util.HashMap; | |
| 26 | -import java.util.List; | |
| 27 | -import java.util.Map; | |
| 28 | 35 | |
| 29 | 36 | @Service |
| 30 | 37 | public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements YlxxbService |
| ... | ... | @@ -185,4 +192,4 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 185 | 192 | return newMap; |
| 186 | 193 | } |
| 187 | 194 | |
| 188 | -} | |
| 195 | +} | |
| 189 | 196 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -4077,7 +4077,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4077 | 4077 | Long zdsjActual_=Long.parseLong(zdsjActual_s[0])*60+Long.parseLong(zdsjActual_s[1]); |
| 4078 | 4078 | if((zdsj_-zdsjActual_)>0){ |
| 4079 | 4079 | zdsjk =String.valueOf(zdsj_-zdsjActual_); |
| 4080 | - }else{ | |
| 4080 | + } | |
| 4081 | + if(((zdsj_-zdsjActual_)<0)){ | |
| 4081 | 4082 | zdsjm =String.valueOf(zdsjActual_-zdsj_); |
| 4082 | 4083 | } |
| 4083 | 4084 | } |
| ... | ... | @@ -4104,7 +4105,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4104 | 4105 | Long fcsjActural_=Long.parseLong(fcsjActural_s[0])*60+Long.parseLong(fcsjActural_s[1]); |
| 4105 | 4106 | if((zdsj_-fcsjActural_)>0){ |
| 4106 | 4107 | fcsjk =String.valueOf(zdsj_-fcsjActural_); |
| 4107 | - }else{ | |
| 4108 | + } | |
| 4109 | + if((zdsj_-fcsjActural_)<0){ | |
| 4108 | 4110 | fcsjm =String.valueOf(fcsjActural_-zdsj_); |
| 4109 | 4111 | } |
| 4110 | 4112 | } | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -4,6 +4,7 @@ import com.bsth.entity.Line; |
| 4 | 4 | import com.bsth.entity.Personnel; |
| 5 | 5 | import com.bsth.entity.StationRoute; |
| 6 | 6 | import com.bsth.entity.excep.ArrivalInfo; |
| 7 | +import com.bsth.entity.mcy_forms.Daily; | |
| 7 | 8 | import com.bsth.entity.oil.Dlb; |
| 8 | 9 | import com.bsth.entity.oil.Ylb; |
| 9 | 10 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| ... | ... | @@ -19,6 +20,8 @@ import com.bsth.util.ComparableChild; |
| 19 | 20 | import com.bsth.util.ComparableJob; |
| 20 | 21 | import com.bsth.util.ReportUtils; |
| 21 | 22 | import com.bsth.util.db.DBUtils_MS; |
| 23 | +import com.google.protobuf.StringValue; | |
| 24 | + | |
| 22 | 25 | import org.apache.commons.lang.StringUtils; |
| 23 | 26 | import org.slf4j.Logger; |
| 24 | 27 | import org.slf4j.LoggerFactory; |
| ... | ... | @@ -36,6 +39,8 @@ import java.text.ParseException; |
| 36 | 39 | import java.text.SimpleDateFormat; |
| 37 | 40 | import java.util.*; |
| 38 | 41 | |
| 42 | +import javax.persistence.criteria.CriteriaBuilder.In; | |
| 43 | + | |
| 39 | 44 | @Service |
| 40 | 45 | public class ReportServiceImpl implements ReportService{ |
| 41 | 46 | |
| ... | ... | @@ -66,16 +71,16 @@ public class ReportServiceImpl implements ReportService{ |
| 66 | 71 | List<ScheduleRealInfo> list=scheduleRealInfoRepository.findByDate2(line,date,clzbh); |
| 67 | 72 | |
| 68 | 73 | // jdbcTemplate.query("select * from bsth_c_s_sp_info_real where line=?1 " |
| 69 | -// + "and DATE_FORMAT(schedule_date,'%Y-%m-%d')=?2 and cl_zbl=?3", | |
| 70 | -// new Object[]{line,date,clzbh}, | |
| 71 | -// new RowMapper(){ | |
| 72 | -// @Override | |
| 73 | -// public Object mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 74 | -// ScheduleRealInfo s = new ScheduleRealInfo(); | |
| 74 | +// + "and DATE_FORMAT(schedule_date,'%Y-%m-%d')=?2 and cl_zbl=?3", | |
| 75 | +// new Object[]{line,date,clzbh}, | |
| 76 | +// new RowMapper(){ | |
| 77 | +// @Override | |
| 78 | +// public Object mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 79 | +// ScheduleRealInfo s = new ScheduleRealInfo(); | |
| 75 | 80 | //// s. |
| 76 | -// return s; | |
| 77 | -// } | |
| 78 | -// }); | |
| 81 | +// return s; | |
| 82 | +// } | |
| 83 | +// }); | |
| 79 | 84 | |
| 80 | 85 | return list; |
| 81 | 86 | } |
| ... | ... | @@ -283,11 +288,11 @@ public class ReportServiceImpl implements ReportService{ |
| 283 | 288 | + " group by equipment_code ) "; |
| 284 | 289 | |
| 285 | 290 | Map<String, Object> map=new HashMap<String,Object>(); |
| 286 | - | |
| 291 | + | |
| 287 | 292 | /*List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc, |
| 288 | 293 | new RowMapper<Map<String, Object>>(){ |
| 289 | 294 | @Override |
| 290 | - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 295 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 291 | 296 | Map<String, Object> m=new HashMap<String,Object>(); |
| 292 | 297 | m.put("zbh", rs.getString("cl_zbh")); |
| 293 | 298 | return m; |
| ... | ... | @@ -1453,7 +1458,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1453 | 1458 | keyMap.get("18:01——(末)").add(ttMap); |
| 1454 | 1459 | } |
| 1455 | 1460 | } |
| 1456 | - | |
| 1461 | + | |
| 1457 | 1462 | for(String key : keyMap.keySet()){ |
| 1458 | 1463 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 1459 | 1464 | List<Map<String, Object>> list2 = keyMap.get(key); |
| ... | ... | @@ -1472,7 +1477,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1472 | 1477 | }else{ |
| 1473 | 1478 | String[] split = m.get("fcsj").toString().split(":"); |
| 1474 | 1479 | int fcsj = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); |
| 1475 | - | |
| 1480 | + | |
| 1476 | 1481 | int xlDir = Integer.valueOf(m.get("dir").toString()); |
| 1477 | 1482 | int bcsj = Integer.valueOf(m.get("bcsj").toString()); |
| 1478 | 1483 | if(temp >= fcsj){ |
| ... | ... | @@ -1493,17 +1498,17 @@ public class ReportServiceImpl implements ReportService{ |
| 1493 | 1498 | } |
| 1494 | 1499 | } |
| 1495 | 1500 | lpname=m.get("lp").toString(); |
| 1496 | - | |
| 1501 | + | |
| 1497 | 1502 | } |
| 1498 | 1503 | sxtsbc++; |
| 1499 | 1504 | } |
| 1500 | - | |
| 1505 | + | |
| 1501 | 1506 | } else { |
| 1502 | - | |
| 1507 | + | |
| 1503 | 1508 | fcsj_x.add(fcsj); |
| 1504 | 1509 | xxsj += bcsj; |
| 1505 | 1510 | xxbc ++; |
| 1506 | - | |
| 1511 | + | |
| 1507 | 1512 | if(!ists){ |
| 1508 | 1513 | if(lpname.equals("")){ |
| 1509 | 1514 | lpname=m.get("lp").toString(); |
| ... | ... | @@ -1517,7 +1522,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1517 | 1522 | } |
| 1518 | 1523 | xxtsbc++; |
| 1519 | 1524 | } |
| 1520 | - | |
| 1525 | + | |
| 1521 | 1526 | } |
| 1522 | 1527 | if(temp < fcsj){ |
| 1523 | 1528 | cjs.add(fcsj - temp); |
| ... | ... | @@ -1539,7 +1544,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1539 | 1544 | cjs.add(fcsj_s.get(i)-fcsjs); |
| 1540 | 1545 | fcsjs=fcsj_s.get(i); |
| 1541 | 1546 | } |
| 1542 | - | |
| 1547 | + | |
| 1543 | 1548 | } |
| 1544 | 1549 | Collections.sort(fcsj_x); |
| 1545 | 1550 | int fcsjx=0; |
| ... | ... | @@ -1550,7 +1555,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1550 | 1555 | cjs.add(fcsj_x.get(i)-fcsjx); |
| 1551 | 1556 | fcsjx =fcsj_x.get(i); |
| 1552 | 1557 | } |
| 1553 | - | |
| 1558 | + | |
| 1554 | 1559 | } |
| 1555 | 1560 | Collections.sort(cjs); |
| 1556 | 1561 | for(int i : cjs){ |
| ... | ... | @@ -1849,7 +1854,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1849 | 1854 | // while (it.hasNext()) { |
| 1850 | 1855 | // ChildTaskPlan childTaskPlan = it.next(); |
| 1851 | 1856 | // if (childTaskPlan.isDestroy()) { |
| 1852 | -// } | |
| 1857 | +// } | |
| 1853 | 1858 | // } |
| 1854 | 1859 | // } |
| 1855 | 1860 | } |
| ... | ... | @@ -2218,7 +2223,7 @@ public class ReportServiceImpl implements ReportService{ |
| 2218 | 2223 | , (i+1)); |
| 2219 | 2224 | } |
| 2220 | 2225 | inoutList.add(map1); |
| 2221 | - | |
| 2226 | + | |
| 2222 | 2227 | /*for (int j = 0; j < listStation.size(); j++) { |
| 2223 | 2228 | map2=new HashMap<String,Object>(); |
| 2224 | 2229 | StationRoute s=listStation.get(j); |
| ... | ... | @@ -2230,7 +2235,7 @@ public class ReportServiceImpl implements ReportService{ |
| 2230 | 2235 | } |
| 2231 | 2236 | } |
| 2232 | 2237 | Map<String, String> m=this.strInOut(arrivalList,lzsj); |
| 2233 | - | |
| 2238 | + | |
| 2234 | 2239 | map2.put(s.getStationCode()+"in", m.get("in")); |
| 2235 | 2240 | map2.put(s.getStationCode()+"out", m.get("out")); |
| 2236 | 2241 | map2.put(s.getStationCode(), m.get("type")); |
| ... | ... | @@ -3233,4 +3238,4 @@ class ComparableAcuals implements Comparator<ScheduleRealInfo>{ |
| 3233 | 3238 | return o1.getFcsjActualTime().compareTo(o2.getFcsjActualTime()); |
| 3234 | 3239 | } |
| 3235 | 3240 | |
| 3236 | -} | |
| 3241 | +} | |
| 3237 | 3242 | \ No newline at end of file | ... | ... |