Commit 7711035708d7f1995ec38d1cd82d9895152f40df
1 parent
86469c3a
去掉驾驶员名字和售票员名字的分组项
Showing
2 changed files
with
125 additions
and
94 deletions
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| ... | ... | @@ -89,12 +89,12 @@ public class FormsServiceImpl implements FormsService { |
| 89 | 89 | String date=map.get("date").toString(); |
| 90 | 90 | |
| 91 | 91 | String sql="select " |
| 92 | - + " r.cl_zbh,r.j_gh,r.j_name" | |
| 92 | + + " r.cl_zbh,r.j_gh" | |
| 93 | 93 | + " from bsth_c_s_sp_info_real r where " |
| 94 | 94 | + " r.schedule_date_str = '"+date+"'" |
| 95 | 95 | + " and r.xl_bm = '"+line+"' " |
| 96 | - + " group by " | |
| 97 | - + " r.cl_zbh,r.j_gh,r.j_name"; | |
| 96 | + + " group by " | |
| 97 | + + " r.cl_zbh,r.j_gh"; | |
| 98 | 98 | |
| 99 | 99 | List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() { |
| 100 | 100 | |
| ... | ... | @@ -102,7 +102,7 @@ public class FormsServiceImpl implements FormsService { |
| 102 | 102 | public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 103 | 103 | Waybillday w=new Waybillday(); |
| 104 | 104 | w.setJgh(arg0.getString("j_gh")); |
| 105 | - w.setjName(arg0.getString("j_name")); | |
| 105 | +// w.setjName(arg0.getString("j_name")); | |
| 106 | 106 | w.setNbbm(arg0.getString("cl_zbh")); |
| 107 | 107 | return w; |
| 108 | 108 | |
| ... | ... | @@ -118,14 +118,19 @@ public class FormsServiceImpl implements FormsService { |
| 118 | 118 | for (int j = 0; j < realList.size(); j++) { |
| 119 | 119 | ScheduleRealInfo s=realList.get(j); |
| 120 | 120 | if(w.getNbbm().equals(s.getClZbh()) && w.getJgh().equals(s.getjGh())){ |
| 121 | - Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 122 | - if(cts != null && cts.size() > 0){ | |
| 121 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 122 | + if(cts != null && cts.size() > 0){ | |
| 123 | + listInfo.add(s); | |
| 124 | + }else{ | |
| 125 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 123 | 126 | listInfo.add(s); |
| 124 | - }else{ | |
| 125 | - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 126 | - listInfo.add(s); | |
| 127 | - } | |
| 128 | 127 | } |
| 128 | + } | |
| 129 | + | |
| 130 | + if((w.getjName() == null || w.getjName().trim().length() == 0) | |
| 131 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 132 | + w.setjName(s.getjName()); | |
| 133 | + } | |
| 129 | 134 | } |
| 130 | 135 | } |
| 131 | 136 | |
| ... | ... | @@ -255,11 +260,11 @@ public class FormsServiceImpl implements FormsService { |
| 255 | 260 | } |
| 256 | 261 | String sql ="select "; |
| 257 | 262 | if(empnames.equals("驾驶员")){ |
| 258 | - sql += " r.j_name,r.j_gh "; | |
| 263 | + sql += " r.j_gh "; | |
| 259 | 264 | }else if(empnames.equals("售票员")){ |
| 260 | - sql += " r.s_gh,r.s_name"; | |
| 265 | + sql += " r.s_gh "; | |
| 261 | 266 | }else{ |
| 262 | - sql += " r.cl_zbh"; | |
| 267 | + sql += " r.cl_zbh "; | |
| 263 | 268 | } |
| 264 | 269 | sql += " from bsth_c_s_sp_info_real r where " |
| 265 | 270 | + " r.schedule_date_str >= '" + map.get("startDate").toString() + "' " |
| ... | ... | @@ -271,9 +276,9 @@ public class FormsServiceImpl implements FormsService { |
| 271 | 276 | |
| 272 | 277 | if(empnames.equals("驾驶员")){ |
| 273 | 278 | sql += " GROUP BY " |
| 274 | - + "r.j_name,r.j_gh"; | |
| 279 | + + " r.j_gh "; | |
| 275 | 280 | }else if(empnames.equals("售票员")){ |
| 276 | - sql+="and r.s_name is not null AND r.s_name !='' GROUP BY r.s_gh,r.s_name"; | |
| 281 | + sql+="and r.s_gh is not null AND r.s_gh !='' GROUP BY r.s_gh"; | |
| 277 | 282 | }else{ |
| 278 | 283 | sql += " GROUP BY r.cl_zbh"; |
| 279 | 284 | } |
| ... | ... | @@ -284,17 +289,14 @@ public class FormsServiceImpl implements FormsService { |
| 284 | 289 | public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 285 | 290 | Shiftuehiclemanth shif = new Shiftuehiclemanth(); |
| 286 | 291 | if(empnames.equals("驾驶员")){ |
| 287 | - shif.setjName(arg0.getString("j_name")+"/"+arg0.getString("j_gh")); | |
| 292 | +// shif.setjName(arg0.getString("j_name")+"/"+arg0.getString("j_gh")); | |
| 288 | 293 | shif.setJgh(arg0.getString("j_gh")); |
| 289 | 294 | }else if(empnames.equals("售票员")){ |
| 290 | - shif.setjName(arg0.getString("s_name")+"/"+arg0.getString("s_gh")); | |
| 295 | +// shif.setjName(arg0.getString("s_name")+"/"+arg0.getString("s_gh")); | |
| 291 | 296 | shif.setSgh(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); |
| 292 | 297 | }else if(empnames.equals("车辆自编号")){ |
| 293 | 298 | shif.setjName(arg0.getString("cl_zbh")); |
| 294 | 299 | } |
| 295 | -// shif.setJgh(arg0.getString("j_gh")); | |
| 296 | -// shif.setZbh(arg0.getString("cl_zbh")); | |
| 297 | -// shif.setjName(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); | |
| 298 | 300 | return shif; |
| 299 | 301 | } |
| 300 | 302 | }); |
| ... | ... | @@ -322,7 +324,11 @@ public class FormsServiceImpl implements FormsService { |
| 322 | 324 | list_s.add(s); |
| 323 | 325 | } |
| 324 | 326 | } |
| 325 | - | |
| 327 | + | |
| 328 | + if((d.getjName() == null || d.getjName().trim().length() == 0) | |
| 329 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 330 | + d.setjName(s.getjName() + "/" + d.getJgh()); | |
| 331 | + } | |
| 326 | 332 | } |
| 327 | 333 | }else if(empnames.equals("售票员")){ |
| 328 | 334 | String sgh=s.getsGh()==null?"":s.getsGh(); |
| ... | ... | @@ -336,6 +342,11 @@ public class FormsServiceImpl implements FormsService { |
| 336 | 342 | list_s.add(s); |
| 337 | 343 | } |
| 338 | 344 | } |
| 345 | + | |
| 346 | + if((d.getjName() == null || d.getjName().trim().length() == 0) | |
| 347 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 348 | + d.setjName(s.getsName() + "/" + d.getSgh()); | |
| 349 | + } | |
| 339 | 350 | } |
| 340 | 351 | }else if(empnames.equals("车辆自编号")){ |
| 341 | 352 | if(d.getjName().equals(s.getClZbh())){ |
| ... | ... | @@ -413,19 +424,19 @@ public class FormsServiceImpl implements FormsService { |
| 413 | 424 | final String empnames=map.get("empnames").toString(); |
| 414 | 425 | String gsdmManth=""; |
| 415 | 426 | String fgsdmManth=""; |
| 416 | - if(map.get("gsdmManth")!=null){ | |
| 427 | + if(map.get("gsdmManth") != null){ | |
| 417 | 428 | gsdmManth=map.get("gsdmManth").toString(); |
| 418 | 429 | } |
| 419 | - if(map.get("fgsdmManth")!=null){ | |
| 430 | + if(map.get("fgsdmManth") != null){ | |
| 420 | 431 | fgsdmManth=map.get("fgsdmManth").toString(); |
| 421 | 432 | } |
| 422 | 433 | String sql ="select "; |
| 423 | 434 | if(empnames.equals("驾驶员")){ |
| 424 | - sql += " r.j_name,r.j_gh "; | |
| 435 | + sql += " r.j_gh "; | |
| 425 | 436 | }else if(empnames.equals("售票员")){ |
| 426 | - sql += " r.s_gh,r.s_name"; | |
| 437 | + sql += " r.s_gh "; | |
| 427 | 438 | }else{ |
| 428 | - sql += " r.cl_zbh"; | |
| 439 | + sql += " r.cl_zbh "; | |
| 429 | 440 | } |
| 430 | 441 | sql += " from bsth_c_s_sp_info_real r where " |
| 431 | 442 | + " r.schedule_date_str >= '" + map.get("startDate").toString() + "' " |
| ... | ... | @@ -437,9 +448,9 @@ public class FormsServiceImpl implements FormsService { |
| 437 | 448 | |
| 438 | 449 | if(empnames.equals("驾驶员")){ |
| 439 | 450 | sql += " GROUP BY " |
| 440 | - + "r.j_name,r.j_gh"; | |
| 451 | + + " r.j_gh "; | |
| 441 | 452 | }else if(empnames.equals("售票员")){ |
| 442 | - sql+="and r.s_name is not null AND r.s_name !='' GROUP BY r.s_gh,r.s_name"; | |
| 453 | + sql+="and r.s_gh is not null AND r.s_gh !='' GROUP BY r.s_gh"; | |
| 443 | 454 | }else{ |
| 444 | 455 | sql += " GROUP BY r.cl_zbh"; |
| 445 | 456 | } |
| ... | ... | @@ -450,17 +461,14 @@ public class FormsServiceImpl implements FormsService { |
| 450 | 461 | public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 451 | 462 | Shiftuehiclemanth shif = new Shiftuehiclemanth(); |
| 452 | 463 | if(empnames.equals("驾驶员")){ |
| 453 | - shif.setjName(arg0.getString("j_name")+"/"+arg0.getString("j_gh")); | |
| 464 | +// shif.setjName(arg0.getString("j_name")+"/"+arg0.getString("j_gh")); | |
| 454 | 465 | shif.setJgh(arg0.getString("j_gh")); |
| 455 | 466 | }else if(empnames.equals("售票员")){ |
| 456 | - shif.setjName(arg0.getString("s_name")+"/"+arg0.getString("s_gh")); | |
| 467 | +// shif.setjName(arg0.getString("s_name")+"/"+arg0.getString("s_gh")); | |
| 457 | 468 | shif.setSgh(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); |
| 458 | 469 | }else if(empnames.equals("车辆自编号")){ |
| 459 | 470 | shif.setjName(arg0.getString("cl_zbh")); |
| 460 | 471 | } |
| 461 | -// shif.setJgh(arg0.getString("j_gh")); | |
| 462 | -// shif.setZbh(arg0.getString("cl_zbh")); | |
| 463 | -// shif.setjName(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); | |
| 464 | 472 | return shif; |
| 465 | 473 | } |
| 466 | 474 | }); |
| ... | ... | @@ -488,7 +496,11 @@ public class FormsServiceImpl implements FormsService { |
| 488 | 496 | list_s.add(s); |
| 489 | 497 | } |
| 490 | 498 | } |
| 491 | - | |
| 499 | + | |
| 500 | + if((d.getjName() == null || d.getjName().trim().length() == 0) | |
| 501 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 502 | + d.setjName(s.getjName() + "/" + d.getJgh()); | |
| 503 | + } | |
| 492 | 504 | } |
| 493 | 505 | }else if(empnames.equals("售票员")){ |
| 494 | 506 | String sgh=s.getsGh()==null?"":s.getsGh(); |
| ... | ... | @@ -502,6 +514,11 @@ public class FormsServiceImpl implements FormsService { |
| 502 | 514 | list_s.add(s); |
| 503 | 515 | } |
| 504 | 516 | } |
| 517 | + | |
| 518 | + if((d.getjName() == null || d.getjName().trim().length() == 0) | |
| 519 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 520 | + d.setjName(s.getsName() + "/" + d.getSgh()); | |
| 521 | + } | |
| 505 | 522 | } |
| 506 | 523 | }else if(empnames.equals("车辆自编号")){ |
| 507 | 524 | if(d.getjName().equals(s.getClZbh())){ |
| ... | ... | @@ -885,7 +902,7 @@ public class FormsServiceImpl implements FormsService { |
| 885 | 902 | List<Singledata> list_=new ArrayList<Singledata>(); |
| 886 | 903 | if(tjtype.equals("jsy")){ |
| 887 | 904 | //油统计 |
| 888 | - String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.j_name,r.fgs_bm" | |
| 905 | + String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.fgs_bm" | |
| 889 | 906 | + " from bsth_c_s_sp_info_real r where " |
| 890 | 907 | + " r.schedule_date_str = '"+startDate+"'"; |
| 891 | 908 | if(xlbm.length() != 0){ |
| ... | ... | @@ -897,7 +914,7 @@ public class FormsServiceImpl implements FormsService { |
| 897 | 914 | if(fgsdm.length() != 0){ |
| 898 | 915 | sql += " and r.fgs_bm ='"+fgsdm+"'"; |
| 899 | 916 | } |
| 900 | - sql += " group by r.fgs_bm,r.j_gh,r.xl_bm,r.cl_zbh,r.j_name " + | |
| 917 | + sql += " group by r.fgs_bm,r.j_gh,r.xl_bm,r.cl_zbh " + | |
| 901 | 918 | "order by r.xl_bm,r.cl_zbh"; |
| 902 | 919 | |
| 903 | 920 | |
| ... | ... | @@ -907,7 +924,7 @@ public class FormsServiceImpl implements FormsService { |
| 907 | 924 | Singledata sin = new Singledata(); |
| 908 | 925 | sin.setxL(arg0.getString("xl_bm")); |
| 909 | 926 | sin.setJsy(arg0.getString("j_gh")); |
| 910 | - sin.setjName(arg0.getString("j_name")); | |
| 927 | +// sin.setjName(arg0.getString("j_name")); | |
| 911 | 928 | sin.setClzbh(arg0.getString("cl_zbh")); |
| 912 | 929 | sin.setgS(arg0.getString("fgs_bm")); |
| 913 | 930 | return sin; |
| ... | ... | @@ -968,7 +985,7 @@ public class FormsServiceImpl implements FormsService { |
| 968 | 985 | if(fages){ |
| 969 | 986 | Singledata s=new Singledata(); |
| 970 | 987 | s.setJsy(jsy); |
| 971 | - s.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 988 | +// s.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 972 | 989 | s.setClzbh(clzbh); |
| 973 | 990 | s.setSgh(""); |
| 974 | 991 | s.setsName(""); |
| ... | ... | @@ -1023,6 +1040,11 @@ public class FormsServiceImpl implements FormsService { |
| 1023 | 1040 | newList_.add(s); |
| 1024 | 1041 | } |
| 1025 | 1042 | } |
| 1043 | + | |
| 1044 | + if((sin.getjName() == null || sin.getjName().trim().length() == 0) | |
| 1045 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 1046 | + sin.setjName(s.getjName()); | |
| 1047 | + } | |
| 1026 | 1048 | } |
| 1027 | 1049 | } |
| 1028 | 1050 | double jhgl=culateMileageService.culateJhgl(newList); |
| ... | ... | @@ -1034,12 +1056,15 @@ public class FormsServiceImpl implements FormsService { |
| 1034 | 1056 | |
| 1035 | 1057 | double zyygl=Arith.add(yygl, ljgl); |
| 1036 | 1058 | double zksgl=Arith.add(ksgl, jcgl); |
| 1059 | + | |
| 1060 | + if(sin.getjName() == null || sin.getjName().trim().length() == 0){ | |
| 1061 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1062 | + } | |
| 1037 | 1063 | sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); |
| 1038 | 1064 | sin.setEmptMileage(String.valueOf(zksgl)); |
| 1039 | 1065 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); |
| 1040 | 1066 | sin.setXlmc(BasicData.lineCode2NameMap.get(line)); |
| 1041 | 1067 | sin.setrQ(startDate); |
| 1042 | -// sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1043 | 1068 | sin.setSgh(""); |
| 1044 | 1069 | sin.setsName(""); |
| 1045 | 1070 | sin.setgS(BasicData.businessFgsCodeNameMap.get(sin.getgS()+"_"+gsdm)); |
| ... | ... | @@ -1180,7 +1205,7 @@ public class FormsServiceImpl implements FormsService { |
| 1180 | 1205 | List<Singledata> list_=new ArrayList<Singledata>(); |
| 1181 | 1206 | if(tjtype.equals("jsy")){ |
| 1182 | 1207 | //油统计 |
| 1183 | - String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.j_name" | |
| 1208 | + String sql="select r.j_gh, r.xl_bm,r.cl_zbh" | |
| 1184 | 1209 | + " from bsth_c_s_sp_info_real r where " |
| 1185 | 1210 | + " r.schedule_date_str = '"+startDate+"'"; |
| 1186 | 1211 | if(!xlbm.equals("")){ |
| ... | ... | @@ -1192,14 +1217,14 @@ public class FormsServiceImpl implements FormsService { |
| 1192 | 1217 | if(!fgsdm.equals("")){ |
| 1193 | 1218 | sql += " and r.fgs_bm='"+fgsdm+"'"; |
| 1194 | 1219 | } |
| 1195 | - sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh"; | |
| 1220 | + sql += " group by r.j_gh,r.xl_bm,r.cl_zbh order by r.xl_bm,r.cl_zbh"; | |
| 1196 | 1221 | list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 1197 | 1222 | @Override |
| 1198 | 1223 | public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 1199 | 1224 | Singledata sin = new Singledata(); |
| 1200 | 1225 | sin.setxL(arg0.getString("xl_bm")); |
| 1201 | 1226 | sin.setJsy(arg0.getString("j_gh")); |
| 1202 | - sin.setjName(arg0.getString("j_name")); | |
| 1227 | +// sin.setjName(arg0.getString("j_name")); | |
| 1203 | 1228 | sin.setClzbh(arg0.getString("cl_zbh")); |
| 1204 | 1229 | return sin; |
| 1205 | 1230 | } |
| ... | ... | @@ -1310,6 +1335,11 @@ public class FormsServiceImpl implements FormsService { |
| 1310 | 1335 | newList_.add(s); |
| 1311 | 1336 | } |
| 1312 | 1337 | } |
| 1338 | + | |
| 1339 | + if((sin.getjName() == null || sin.getjName().trim().length() == 0) | |
| 1340 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 1341 | + sin.setjName(s.getjName()); | |
| 1342 | + } | |
| 1313 | 1343 | } |
| 1314 | 1344 | } |
| 1315 | 1345 | double jhgl=culateMileageService.culateJhgl(newList); |
| ... | ... | @@ -1319,6 +1349,9 @@ public class FormsServiceImpl implements FormsService { |
| 1319 | 1349 | double ksgl=culateMileageService.culateKsgl(newList_); |
| 1320 | 1350 | double jcgl=culateMileageService.culateJccgl(newList_); |
| 1321 | 1351 | |
| 1352 | + if(sin.getjName() == null || sin.getjName().trim().length() == 0){ | |
| 1353 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1354 | + } | |
| 1322 | 1355 | double zyygl=Arith.add(yygl, ljgl); |
| 1323 | 1356 | double zksgl=Arith.add(ksgl, jcgl); |
| 1324 | 1357 | sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); |
| ... | ... | @@ -1326,7 +1359,6 @@ public class FormsServiceImpl implements FormsService { |
| 1326 | 1359 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); |
| 1327 | 1360 | sin.setXlmc(BasicData.lineCode2NameMap.get(line)); |
| 1328 | 1361 | sin.setrQ(startDate); |
| 1329 | -// sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1330 | 1362 | sin.setSgh(""); |
| 1331 | 1363 | sin.setsName(""); |
| 1332 | 1364 | sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); |
| ... | ... | @@ -1335,7 +1367,7 @@ public class FormsServiceImpl implements FormsService { |
| 1335 | 1367 | } |
| 1336 | 1368 | Collections.sort(list_,new SingledataByXlbm()); |
| 1337 | 1369 | }else{ |
| 1338 | - String sql="select r.s_gh,r.s_name, " | |
| 1370 | + String sql="select r.s_gh, " | |
| 1339 | 1371 | + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" |
| 1340 | 1372 | + " from bsth_c_s_sp_info_real r where " |
| 1341 | 1373 | + " r.schedule_date_str = '"+startDate+"'" |
| ... | ... | @@ -1349,7 +1381,7 @@ public class FormsServiceImpl implements FormsService { |
| 1349 | 1381 | if(!fgsdm.equals("")){ |
| 1350 | 1382 | sql += " and r.fgs_bm='"+fgsdm+"'"; |
| 1351 | 1383 | } |
| 1352 | - sql += " group by r.s_gh,r.s_name," | |
| 1384 | + sql += " group by r.s_gh," | |
| 1353 | 1385 | + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; |
| 1354 | 1386 | |
| 1355 | 1387 | list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| ... | ... | @@ -1361,7 +1393,7 @@ public class FormsServiceImpl implements FormsService { |
| 1361 | 1393 | sin.setxL(arg0.getString("xl_bm")); |
| 1362 | 1394 | sin.setClzbh(arg0.getString("cl_zbh")); |
| 1363 | 1395 | sin.setSgh(arg0.getString("s_gh")); |
| 1364 | - sin.setsName(arg0.getString("s_name")); | |
| 1396 | +// sin.setsName(arg0.getString("s_name")); | |
| 1365 | 1397 | return sin; |
| 1366 | 1398 | } |
| 1367 | 1399 | }); |
| ... | ... | @@ -1387,6 +1419,11 @@ public class FormsServiceImpl implements FormsService { |
| 1387 | 1419 | newList_.add(s); |
| 1388 | 1420 | } |
| 1389 | 1421 | } |
| 1422 | + | |
| 1423 | + if((sin.getsName() == null || sin.getsName().trim().length() == 0) | |
| 1424 | + && s.getsName() != null && s.getsName().length() > 0){ | |
| 1425 | + sin.setsName(s.getsName()); | |
| 1426 | + } | |
| 1390 | 1427 | } |
| 1391 | 1428 | } |
| 1392 | 1429 | double jhgl=culateMileageService.culateJhgl(newList); |
| ... | ... | @@ -1404,6 +1441,9 @@ public class FormsServiceImpl implements FormsService { |
| 1404 | 1441 | double zksgl=culateMileageService.culateSjfyylc_spy(newList_); |
| 1405 | 1442 | sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); |
| 1406 | 1443 | |
| 1444 | + if(sin.getsName() == null || sin.getsName().trim().length() == 0){ | |
| 1445 | + sin.setsName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1446 | + } | |
| 1407 | 1447 | sin.setEmptMileage(String.valueOf(zksgl)); |
| 1408 | 1448 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); |
| 1409 | 1449 | sin.setXlmc(BasicData.lineCode2NameMap.get(line)); |
| ... | ... | @@ -1730,7 +1770,7 @@ public class FormsServiceImpl implements FormsService { |
| 1730 | 1770 | startDate = map.get("startDate").toString(); |
| 1731 | 1771 | |
| 1732 | 1772 | String sql="select r.s_gh,r.s_name, " |
| 1733 | - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm,xl_name" | |
| 1773 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm,xl_name" | |
| 1734 | 1774 | + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'"; |
| 1735 | 1775 | if(!xlbm.equals("")){ |
| 1736 | 1776 | sql += " and r.xl_bm = '"+xlbm+"'"; |
| ... | ... | @@ -1742,7 +1782,7 @@ public class FormsServiceImpl implements FormsService { |
| 1742 | 1782 | sql += " and r.fgs_bm='"+fgsdm+"'"; |
| 1743 | 1783 | } |
| 1744 | 1784 | sql += " group by r.s_gh,r.s_name," |
| 1745 | - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm,xl_name order by r.xl_bm,r.cl_zbh"; | |
| 1785 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm,xl_name order by r.xl_bm,r.cl_zbh"; | |
| 1746 | 1786 | |
| 1747 | 1787 | List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 1748 | 1788 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| ... | ... | @@ -1753,7 +1793,7 @@ public class FormsServiceImpl implements FormsService { |
| 1753 | 1793 | sin.setxL(arg0.getString("xl_bm")); |
| 1754 | 1794 | sin.setClzbh(arg0.getString("cl_zbh")); |
| 1755 | 1795 | sin.setJsy(arg0.getString("j_gh")); |
| 1756 | - sin.setjName(arg0.getString("j_name")); | |
| 1796 | +// sin.setjName(arg0.getString("j_name")); | |
| 1757 | 1797 | sin.setSgh(arg0.getString("s_gh")); |
| 1758 | 1798 | sin.setsName(arg0.getString("s_name")); |
| 1759 | 1799 | sin.setXlmc(arg0.getString("xl_name")); |
| ... | ... | @@ -1780,6 +1820,11 @@ public class FormsServiceImpl implements FormsService { |
| 1780 | 1820 | if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) |
| 1781 | 1821 | &&s.getXlBm().equals(xl)&&s.getsGh().equals(spy)){ |
| 1782 | 1822 | newList.add(s); |
| 1823 | + | |
| 1824 | + if((sin.getjName() == null || sin.getjName().trim().length() == 0) | |
| 1825 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 1826 | + sin.setjName(s.getjName()); | |
| 1827 | + } | |
| 1783 | 1828 | } |
| 1784 | 1829 | } |
| 1785 | 1830 | |
| ... | ... | @@ -2442,8 +2487,6 @@ public class FormsServiceImpl implements FormsService { |
| 2442 | 2487 | sql += " group by r.gs_bm, r.fgs_bm, r.xl_bm " + |
| 2443 | 2488 | "order by r.gs_bm, r.fgs_bm, r.xl_bm"; |
| 2444 | 2489 | |
| 2445 | - System.out.println(sql); | |
| 2446 | - | |
| 2447 | 2490 | List<Operationservice> query = jdbcTemplate.query(sql, new RowMapper<Operationservice>() { |
| 2448 | 2491 | @Override |
| 2449 | 2492 | public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException { |
| ... | ... | @@ -2605,10 +2648,10 @@ public class FormsServiceImpl implements FormsService { |
| 2605 | 2648 | public List<Vehicleloading> vehicleloading(String line, String date) { |
| 2606 | 2649 | |
| 2607 | 2650 | String sql="select r.s_gh,r.s_name, " |
| 2608 | - + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" | |
| 2651 | + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm" | |
| 2609 | 2652 | + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+date+"' " |
| 2610 | 2653 | + " and r.xl_bm = '"+line+"' group by r.s_gh,r.s_name," |
| 2611 | - + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"; | |
| 2654 | + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm"; | |
| 2612 | 2655 | |
| 2613 | 2656 | List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() { |
| 2614 | 2657 | @Override |
| ... | ... | @@ -3089,7 +3132,7 @@ public class FormsServiceImpl implements FormsService { |
| 3089 | 3132 | + " on t.cl_zbh = x.nbbm and t.j_gh=x.jsy";*/ |
| 3090 | 3133 | |
| 3091 | 3134 | String sql="select r.schedule_date_str, " |
| 3092 | - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" | |
| 3135 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm" | |
| 3093 | 3136 | + " from bsth_c_s_sp_info_real r where " |
| 3094 | 3137 | + "r.schedule_date_str = '"+map.get("date").toString()+"'"; |
| 3095 | 3138 | if(!xlbm.equals("")){ |
| ... | ... | @@ -3101,8 +3144,8 @@ public class FormsServiceImpl implements FormsService { |
| 3101 | 3144 | if(!fgsbm.equals("")){ |
| 3102 | 3145 | sql += " and r.fgs_bm='"+fgsbm+"'"; |
| 3103 | 3146 | } |
| 3104 | - sql += " group by r.schedule_date_str," | |
| 3105 | - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | |
| 3147 | + sql += " group by r.schedule_date_str," | |
| 3148 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | |
| 3106 | 3149 | |
| 3107 | 3150 | List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { |
| 3108 | 3151 | @Override |
| ... | ... | @@ -3111,7 +3154,7 @@ public class FormsServiceImpl implements FormsService { |
| 3111 | 3154 | daily.setRq(arg0.getString("schedule_date_str")); |
| 3112 | 3155 | daily.setZbh(arg0.getString("cl_zbh")); |
| 3113 | 3156 | daily.setJgh(arg0.getString("j_gh")); |
| 3114 | - daily.setjName(arg0.getString("j_name")); | |
| 3157 | +// daily.setjName(arg0.getString("j_name")); | |
| 3115 | 3158 | return daily; |
| 3116 | 3159 | } |
| 3117 | 3160 | }); |
| ... | ... | @@ -3140,15 +3183,19 @@ public class FormsServiceImpl implements FormsService { |
| 3140 | 3183 | for (int j = 0; j < lists.size(); j++) { |
| 3141 | 3184 | ScheduleRealInfo s=lists.get(j); |
| 3142 | 3185 | if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ |
| 3143 | - Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 3144 | - if(cts != null && cts.size() > 0){ | |
| 3186 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 3187 | + if(cts != null && cts.size() > 0){ | |
| 3188 | + sList.add(s); | |
| 3189 | + }else{ | |
| 3190 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 3145 | 3191 | sList.add(s); |
| 3146 | - }else{ | |
| 3147 | - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 3148 | - sList.add(s); | |
| 3149 | - } | |
| 3150 | 3192 | } |
| 3151 | - | |
| 3193 | + } | |
| 3194 | + | |
| 3195 | + if((d.getjName() == null || d.getjName().trim().length() == 0) | |
| 3196 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 3197 | + d.setjName(s.getjName()); | |
| 3198 | + } | |
| 3152 | 3199 | } |
| 3153 | 3200 | } |
| 3154 | 3201 | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -2824,7 +2824,7 @@ public class ReportServiceImpl implements ReportService{ |
| 2824 | 2824 | } |
| 2825 | 2825 | }); |
| 2826 | 2826 | }else{ |
| 2827 | - sql+="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh,r.j_name,r.s_name" | |
| 2827 | + sql+="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh" | |
| 2828 | 2828 | + " from bsth_c_s_sp_info_real r where" |
| 2829 | 2829 | + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; |
| 2830 | 2830 | if(line.equals("")){ |
| ... | ... | @@ -2833,7 +2833,7 @@ public class ReportServiceImpl implements ReportService{ |
| 2833 | 2833 | }else{ |
| 2834 | 2834 | sql += " and r.xl_bm = '"+line+"'"; |
| 2835 | 2835 | } |
| 2836 | - sql += " group by r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh,r.j_name,r.s_name"; | |
| 2836 | + sql += " group by r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh"; | |
| 2837 | 2837 | listGroupBy=jdbcTemplate.query(sql, new RowMapper<Map<String, Object>>() { |
| 2838 | 2838 | @Override |
| 2839 | 2839 | public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException { |
| ... | ... | @@ -2842,8 +2842,8 @@ public class ReportServiceImpl implements ReportService{ |
| 2842 | 2842 | map.put("nbbm", arg0.getString("cl_zbh")); |
| 2843 | 2843 | map.put("jGh", arg0.getString("j_gh")); |
| 2844 | 2844 | map.put("sGh", arg0.getString("s_gh")); |
| 2845 | - map.put("jName", arg0.getString("j_name")); | |
| 2846 | - map.put("sName", arg0.getString("s_name")); | |
| 2845 | +// map.put("jName", arg0.getString("j_name")); | |
| 2846 | +// map.put("sName", arg0.getString("s_name")); | |
| 2847 | 2847 | return map; |
| 2848 | 2848 | } |
| 2849 | 2849 | }); |
| ... | ... | @@ -2870,6 +2870,15 @@ public class ReportServiceImpl implements ReportService{ |
| 2870 | 2870 | if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh()) |
| 2871 | 2871 | && jGh.equals(s.getjGh()) && sGh.equals(s.getsGh())){ |
| 2872 | 2872 | lists.add(s); |
| 2873 | + | |
| 2874 | + if((m.get("jName") == null || m.get("jName").toString().length() == 0) | |
| 2875 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 2876 | + m.put("jName", s.getjName()); | |
| 2877 | + } | |
| 2878 | + if((m.get("sName") == null || m.get("sName").toString().length() == 0) | |
| 2879 | + && s.getsName() != null && s.getsName().length() > 0){ | |
| 2880 | + m.put("sName", s.getsName()); | |
| 2881 | + } | |
| 2873 | 2882 | } |
| 2874 | 2883 | } |
| 2875 | 2884 | } |
| ... | ... | @@ -2952,32 +2961,7 @@ public class ReportServiceImpl implements ReportService{ |
| 2952 | 2961 | |
| 2953 | 2962 | } |
| 2954 | 2963 | if(!zt.equals("zbh")){ |
| 2955 | - String sqls="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh,r.s_name,r.j_name" | |
| 2956 | - + " from bsth_c_s_sp_info_real r where" | |
| 2957 | - + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; | |
| 2958 | - if(line.equals("")){ | |
| 2959 | - sqls +="and r.gs_bm='"+gsdm+"' " | |
| 2960 | - + " and r.fgs_bm='"+fgsdm+"'"; | |
| 2961 | - }else{ | |
| 2962 | - sqls += " and r.xl_bm = '"+line+"'"; | |
| 2963 | - } | |
| 2964 | - sqls += " group by r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh,r.s_name,r.j_name"; | |
| 2965 | - | |
| 2966 | - List<Map<String, Object>> listGroupBys=jdbcTemplate.query(sqls, new RowMapper<Map<String, Object>>() { | |
| 2967 | - @Override | |
| 2968 | - public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 2969 | - Map<String, Object> map=new HashMap<String,Object>(); | |
| 2970 | - map.put("line",arg0.getString("xl_bm")); | |
| 2971 | - map.put("nbbm", arg0.getString("cl_zbh")); | |
| 2972 | - map.put("jGh", arg0.getString("j_gh")); | |
| 2973 | - map.put("sGh", arg0.getString("s_gh")); | |
| 2974 | - map.put("jName", arg0.getString("j_name")); | |
| 2975 | - map.put("sName", arg0.getString("s_name")); | |
| 2976 | - return map; | |
| 2977 | - } | |
| 2978 | - }); | |
| 2979 | - lMap=lists(listGroupBys, lMaps, gsdm, fgsdm, date, date2); | |
| 2980 | - | |
| 2964 | + lMap=lists(listGroupBy, lMaps, gsdm, fgsdm, date, date2); | |
| 2981 | 2965 | } |
| 2982 | 2966 | if(type.equals("export")){ |
| 2983 | 2967 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ... | ... |