Commit 1c4d56230b7b3ad8537eadc91a0cad542ad78dfa
1 parent
c6cdf717
加油模块
Showing
5 changed files
with
50 additions
and
22 deletions
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -28,14 +28,8 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 28 | 28 | @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)") |
| 29 | 29 | List<ScheduleRealInfo> queryUserInfo(String line,String date); |
| 30 | 30 | |
| 31 | - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by (lpName+1)") | |
| 31 | + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)") | |
| 32 | 32 | List<ScheduleRealInfo> queryUserInfo2(String line,String date); |
| 33 | - | |
| 34 | - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by ?3 desc") | |
| 35 | - List<ScheduleRealInfo> queryUserInfoPxDesc(String line,String date,String state); | |
| 36 | - | |
| 37 | - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by ?3 asc") | |
| 38 | - List<ScheduleRealInfo> queryUserInfoPxAsc(String line,String date,String state); | |
| 39 | 33 | |
| 40 | 34 | @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.clZbh ") |
| 41 | 35 | List<ScheduleRealInfo> queryUserInfo3(String line,String date); | ... | ... |
src/main/java/com/bsth/service/impl/PersonnelServiceImpl.java
| ... | ... | @@ -34,8 +34,9 @@ public class PersonnelServiceImpl extends BaseServiceImpl<Personnel, Integer> im |
| 34 | 34 | per=perIterator.next(); |
| 35 | 35 | if(per.getJobCode().indexOf(jobCode)!=-1){ |
| 36 | 36 | Map<String, String> jobCodeMap= new HashMap<>(); |
| 37 | - jobCodeMap.put("id",per.getJobCode()); | |
| 38 | - jobCodeMap.put("text", per.getJobCode()+"/"+per.getPersonnelName()); | |
| 37 | + String jboCode=per.getJobCode().substring(per.getJobCode().indexOf("-")+1); | |
| 38 | + jobCodeMap.put("id",jboCode); | |
| 39 | + jobCodeMap.put("text", jboCode+"/"+per.getPersonnelName()); | |
| 39 | 40 | jobCodeMap.put("gs", per.getCompanyCode()); |
| 40 | 41 | list.add(jobCodeMap); |
| 41 | 42 | } | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -36,6 +36,7 @@ import com.bsth.repository.oil.YlxxbRepository; |
| 36 | 36 | import com.bsth.service.impl.BaseServiceImpl; |
| 37 | 37 | import com.bsth.service.oil.YlbService; |
| 38 | 38 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 39 | +import com.bsth.util.BatchSaveUtils; | |
| 39 | 40 | import com.github.abel533.echarts.code.Y; |
| 40 | 41 | |
| 41 | 42 | @Service |
| ... | ... | @@ -183,9 +184,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 183 | 184 | List<Cyl> clyList=cylRepository.obtainCyl(); |
| 184 | 185 | //从排班表中计算出行驶的总里程 |
| 185 | 186 | List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq); |
| 186 | - | |
| 187 | + List<Ylb> addList=new ArrayList<Ylb>(); | |
| 188 | + List<Ylb> updateList=new ArrayList<Ylb>(); | |
| 187 | 189 | for(int x=0;x<listpb.size();x++){ |
| 188 | - | |
| 190 | + String type="add"; | |
| 189 | 191 | Map<String, Object> map=listpb.get(x); |
| 190 | 192 | |
| 191 | 193 | //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) |
| ... | ... | @@ -197,6 +199,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 197 | 199 | &&t1.getXlbm().equals(map.get("xlBm").toString())) |
| 198 | 200 | { |
| 199 | 201 | t=t1; |
| 202 | + type="update"; | |
| 200 | 203 | } |
| 201 | 204 | } |
| 202 | 205 | try { |
| ... | ... | @@ -238,6 +241,11 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 238 | 241 | t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); |
| 239 | 242 | t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); |
| 240 | 243 | t.setRq(sdf.parse(rq)); |
| 244 | + /*if(type.equals("add")){ | |
| 245 | + addList.add(t); | |
| 246 | + }else{ | |
| 247 | + updateList.add(t); | |
| 248 | + }*/ | |
| 241 | 249 | repository.save(t); |
| 242 | 250 | newMap.put("status", ResponseCode.SUCCESS); |
| 243 | 251 | } catch (ParseException e) { |
| ... | ... | @@ -246,7 +254,20 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 246 | 254 | e.printStackTrace(); |
| 247 | 255 | } |
| 248 | 256 | } |
| 249 | - | |
| 257 | + /* try { | |
| 258 | + if(addList.size()>0){ | |
| 259 | + new BatchSaveUtils<Ylb>().saveList(addList, Ylb.class); | |
| 260 | + } | |
| 261 | + | |
| 262 | + if(updateList.size()>0){ | |
| 263 | + | |
| 264 | + } | |
| 265 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 266 | + } | |
| 267 | + catch (Exception e) { | |
| 268 | + // TODO: handle exception | |
| 269 | + newMap.put("status", ResponseCode.ERROR); | |
| 270 | + }*/ | |
| 250 | 271 | return newMap; |
| 251 | 272 | } |
| 252 | 273 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -476,11 +476,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 476 | 476 | type = "asc"; |
| 477 | 477 | } |
| 478 | 478 | String sqlPlan = "select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh," |
| 479 | - + " s.lp_Name as lpName,s.j_Name as jName,s.s_Gh as sGh,s.s_Name as sName" | |
| 479 | + + " s.lp_Name as lpName,s.j_Name as jName" | |
| 480 | 480 | + " from bsth_c_s_sp_info_real s " |
| 481 | 481 | + " where s.xl_Bm = '" + line + "' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='" + date + "' " |
| 482 | - + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name,s.s_Gh," | |
| 483 | - + " s.s_Name order by (" + state + ") " + type; | |
| 482 | + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name" | |
| 483 | + + " order by (" + state + ") " + type; | |
| 484 | 484 | List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan, |
| 485 | 485 | new RowMapper<ScheduleRealInfo>() { |
| 486 | 486 | @Override |
| ... | ... | @@ -491,8 +491,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 491 | 491 | t.setClZbh(rs.getString("clZbh")); |
| 492 | 492 | t.setLpName(rs.getString("lpName")); |
| 493 | 493 | t.setjName(rs.getString("jName")); |
| 494 | - t.setsGh(rs.getString("sGh")); | |
| 495 | - t.setsName(rs.getString("sName")); | |
| 496 | 494 | return t; |
| 497 | 495 | } |
| 498 | 496 | }); |
| ... | ... | @@ -3173,6 +3171,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3173 | 3171 | map.put("fcsjActual", s.getFcsjActual()); |
| 3174 | 3172 | map.put("zdzName", s.getZdzName()); |
| 3175 | 3173 | map.put("scheduleDate", s.getScheduleDateStr()); |
| 3174 | + map.put("lpName", s.getLpName()); | |
| 3176 | 3175 | String zdp = "", zwdp = "", wdp = ""; |
| 3177 | 3176 | String zdpT = "", zwdpT = "", wdpT = ""; |
| 3178 | 3177 | ... | ... |
src/main/resources/static/pages/oil/list_ph.html
| ... | ... | @@ -82,7 +82,8 @@ |
| 82 | 82 | 线路: |
| 83 | 83 | </td> |
| 84 | 84 | <td colspan="3"> |
| 85 | - <select class="form-control" name="xlbm_like" id="xlbm" style="width: 120px;"></select> | |
| 85 | + <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select> | |
| 86 | + <input type="hidden" name="xlbm_like" value=""/> | |
| 86 | 87 | |
| 87 | 88 | </td> |
| 88 | 89 | <td > |
| ... | ... | @@ -234,7 +235,7 @@ |
| 234 | 235 | var i = layer.load(2); |
| 235 | 236 | $get('/ylb/checkYl', params, function () { |
| 236 | 237 | layer.close(i); |
| 237 | - jsDoQuery(null, true); | |
| 238 | + jsDoQuery(params, true); | |
| 238 | 239 | }); |
| 239 | 240 | } else { |
| 240 | 241 | layer.msg('请选择日期.'); |
| ... | ... | @@ -260,7 +261,7 @@ |
| 260 | 261 | var i = layer.load(2); |
| 261 | 262 | $get('/ylb/outAndIn', params, function () { |
| 262 | 263 | layer.close(i); |
| 263 | - jsDoQuery(null, true); | |
| 264 | + jsDoQuery(params, true); | |
| 264 | 265 | }); |
| 265 | 266 | } else { |
| 266 | 267 | layer.msg('请选择日期.'); |
| ... | ... | @@ -283,7 +284,19 @@ |
| 283 | 284 | var i = layer.load(2); |
| 284 | 285 | $get('/ylb/sort', params, function () { |
| 285 | 286 | layer.close(i); |
| 286 | - jsDoQuery(null, true); | |
| 287 | + var cells = $('tr.filter')[0].cells | |
| 288 | + , params1 = {} | |
| 289 | + , name; | |
| 290 | + $.each(cells, function (i, cell) { | |
| 291 | + var items = $('input,select', cell); | |
| 292 | + for (var j = 0, item; item = items[j++];) { | |
| 293 | + name = $(item).attr('name'); | |
| 294 | + if (name) { | |
| 295 | + params1[name] = $(item).val(); | |
| 296 | + } | |
| 297 | + } | |
| 298 | + }); | |
| 299 | + jsDoQuery(params1, true); | |
| 287 | 300 | }); |
| 288 | 301 | |
| 289 | 302 | } |
| ... | ... | @@ -537,7 +550,7 @@ |
| 537 | 550 | //搜索线路 |
| 538 | 551 | $.get('/basic/lineCode2Name',function(result){ |
| 539 | 552 | var data=[]; |
| 540 | - data.push({id: " ", text: "全部线路"}); | |
| 553 | +// data.push({id: " ", text: "全部线路"}); | |
| 541 | 554 | for(var code in result){ |
| 542 | 555 | data.push({id: code, text: result[code]}); |
| 543 | 556 | } | ... | ... |