Commit 6040ea55490c67aaae0ac97f3d225a33ebb5ef98
1 parent
8c0029d6
日报表,月报表
Showing
4 changed files
with
56 additions
and
18 deletions
src/main/java/com/bsth/entity/mcy_forms/Shiftuehiclemanth.java
| @@ -22,6 +22,17 @@ public class Shiftuehiclemanth { | @@ -22,6 +22,17 @@ public class Shiftuehiclemanth { | ||
| 22 | 22 | ||
| 23 | private String jgh; | 23 | private String jgh; |
| 24 | private String zbh; | 24 | private String zbh; |
| 25 | + public String getSgh() { | ||
| 26 | + return sgh; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + public void setSgh(String sgh) { | ||
| 30 | + this.sgh = sgh; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + private String sgh; | ||
| 34 | + | ||
| 35 | + | ||
| 25 | public String getJgh() { | 36 | public String getJgh() { |
| 26 | return jgh; | 37 | return jgh; |
| 27 | } | 38 | } |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -156,7 +156,10 @@ public class FormsServiceImpl implements FormsService { | @@ -156,7 +156,10 @@ public class FormsServiceImpl implements FormsService { | ||
| 156 | if(map.containsKey("fgsdmManth")){ | 156 | if(map.containsKey("fgsdmManth")){ |
| 157 | fgsdmManth=map.get("fgsdmManth").toString(); | 157 | fgsdmManth=map.get("fgsdmManth").toString(); |
| 158 | } | 158 | } |
| 159 | - String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type,r.s_name,r.lp_name " | 159 | + String sql = "select" |
| 160 | + + " r.j_name, r.cl_zbh,r.j_gh,r.s_gh,r.s_name " | ||
| 161 | +// + "r.gs_bm,r.gs_name," | ||
| 162 | +// + " r.fgs_bm,r.fgs_name,r.bc_type,r.lp_name " | ||
| 160 | + " from bsth_c_s_sp_info_real r " | 163 | + " from bsth_c_s_sp_info_real r " |
| 161 | + " where 1=1 "; | 164 | + " where 1=1 "; |
| 162 | if(map.get("startDate")!=null&&!map.get("startDate").equals("")){ | 165 | if(map.get("startDate")!=null&&!map.get("startDate").equals("")){ |
| @@ -169,19 +172,23 @@ public class FormsServiceImpl implements FormsService { | @@ -169,19 +172,23 @@ public class FormsServiceImpl implements FormsService { | ||
| 169 | if(map.get("line")!=null&&!map.get("line").equals("")){ | 172 | if(map.get("line")!=null&&!map.get("line").equals("")){ |
| 170 | sql+=" and r.xl_bm='"+ map.get("line").toString() + "' "; | 173 | sql+=" and r.xl_bm='"+ map.get("line").toString() + "' "; |
| 171 | } | 174 | } |
| 172 | - sql+= " AND r.gs_bm is not null and r.bc_type not in('in','out')"; | ||
| 173 | - if(map.get("gsdmManth")!=null&&!map.get("gsdmManth").equals("")){ | ||
| 174 | - sql+=" and r.gs_bm='"+map.get("gsdmManth").toString()+"' "; | ||
| 175 | - } | 175 | +// sql+= " AND r.gs_bm is not null and r.bc_type not in('in','out')"; |
| 176 | +// if(map.get("gsdmManth")!=null&&!map.get("gsdmManth").equals("")){ | ||
| 177 | + sql+=" and r.gs_bm like'%"+gsdmManth+"%' "; | ||
| 178 | +// } | ||
| 176 | if(map.get("fgsdmManth")!=null&&!map.get("fgsdmManth").equals("")){ | 179 | if(map.get("fgsdmManth")!=null&&!map.get("fgsdmManth").equals("")){ |
| 177 | - sql+=" and r.fgs_bm='"+map.get("fgsdmManth").toString()+"' "; | 180 | + sql+=" and r.fgs_bm like'%"+fgsdmManth+"%' "; |
| 178 | } | 181 | } |
| 179 | if(empnames.equals("售票员")){ | 182 | if(empnames.equals("售票员")){ |
| 180 | sql+="and r.s_name is not null AND r.s_name !=''"; | 183 | sql+="and r.s_name is not null AND r.s_name !=''"; |
| 181 | } | 184 | } |
| 182 | - sql += " GROUP BY r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "; | 185 | + sql += " GROUP BY " |
| 186 | + + "r.j_name, r.cl_zbh,r.j_gh,r.s_gh,r.s_name "; | ||
| 187 | +// + ",r.gs_bm,r.gs_name," | ||
| 188 | +// + "r.fgs_bm,r.fgs_name,r.bc_type "; | ||
| 183 | 189 | ||
| 184 | - | 190 | +// r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name," |
| 191 | +// + " r.fgs_bm,r.fgs_name,r.bc_type,r.s_name,r.lp_name | ||
| 185 | List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { | 192 | List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { |
| 186 | 193 | ||
| 187 | @Override | 194 | @Override |
| @@ -191,12 +198,13 @@ public class FormsServiceImpl implements FormsService { | @@ -191,12 +198,13 @@ public class FormsServiceImpl implements FormsService { | ||
| 191 | shif.setjName(arg0.getString("j_name")); | 198 | shif.setjName(arg0.getString("j_name")); |
| 192 | }else if(empnames.equals("售票员")){ | 199 | }else if(empnames.equals("售票员")){ |
| 193 | shif.setjName(arg0.getString("s_name")==null ? "":arg0.getString("s_name")); | 200 | shif.setjName(arg0.getString("s_name")==null ? "":arg0.getString("s_name")); |
| 201 | + shif.setSgh(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); | ||
| 194 | }else if(empnames.equals("车辆自编号")){ | 202 | }else if(empnames.equals("车辆自编号")){ |
| 195 | shif.setjName(arg0.getString("cl_zbh")); | 203 | shif.setjName(arg0.getString("cl_zbh")); |
| 196 | } | 204 | } |
| 197 | - | ||
| 198 | shif.setJgh(arg0.getString("j_gh")); | 205 | shif.setJgh(arg0.getString("j_gh")); |
| 199 | shif.setZbh(arg0.getString("cl_zbh")); | 206 | shif.setZbh(arg0.getString("cl_zbh")); |
| 207 | +// shif.setjName(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); | ||
| 200 | return shif; | 208 | return shif; |
| 201 | } | 209 | } |
| 202 | }); | 210 | }); |
| @@ -208,9 +216,26 @@ public class FormsServiceImpl implements FormsService { | @@ -208,9 +216,26 @@ public class FormsServiceImpl implements FormsService { | ||
| 208 | Shiftuehiclemanth d=list.get(i); | 216 | Shiftuehiclemanth d=list.get(i); |
| 209 | for (int j = 0; j < lists.size(); j++) { | 217 | for (int j = 0; j < lists.size(); j++) { |
| 210 | ScheduleRealInfo s=lists.get(j); | 218 | ScheduleRealInfo s=lists.get(j); |
| 211 | - if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ | ||
| 212 | - sList.add(s); | 219 | +// if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ |
| 220 | +// sList.add(s); | ||
| 221 | +// } | ||
| 222 | + | ||
| 223 | + if(empnames.equals("驾驶员")){ | ||
| 224 | + if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ | ||
| 225 | + sList.add(s); | ||
| 226 | + } | ||
| 227 | + }else if(empnames.equals("售票员")){ | ||
| 228 | +// shif.setjName(arg0.getString("s_name")==null ? "":arg0.getString("s_name")); | ||
| 229 | + String sgh=s.getsGh()==null?"":s.getsGh(); | ||
| 230 | + if(d.getSgh().equals(sgh) && d.getZbh().equals(s.getClZbh())){ | ||
| 231 | + sList.add(s); | ||
| 232 | + } | ||
| 233 | + }else if(empnames.equals("车辆自编号")){ | ||
| 234 | + if(d.getZbh().equals(s.getClZbh())){ | ||
| 235 | + sList.add(s); | ||
| 236 | + } | ||
| 213 | } | 237 | } |
| 238 | + | ||
| 214 | } | 239 | } |
| 215 | 240 | ||
| 216 | double ksgl=culateMileageService.culateKsgl(sList); | 241 | double ksgl=culateMileageService.culateKsgl(sList); |
| @@ -258,13 +283,16 @@ public class FormsServiceImpl implements FormsService { | @@ -258,13 +283,16 @@ public class FormsServiceImpl implements FormsService { | ||
| 258 | if(map.get("fgsdmShif")!=null&&!map.get("fgsdmShif").equals("")){ | 283 | if(map.get("fgsdmShif")!=null&&!map.get("fgsdmShif").equals("")){ |
| 259 | fgsdmShif =map.get("fgsdmShif").toString(); | 284 | fgsdmShif =map.get("fgsdmShif").toString(); |
| 260 | } | 285 | } |
| 261 | - String sql ="select t.* from (select r.schedule_date,r.j_name,IFNULL(r.s_name,'')as s_name," | ||
| 262 | - + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name FROM bsth_c_s_sp_info_real r where 1=1 " | 286 | + String sql ="select t.* from (select r.schedule_date,r.j_name," |
| 287 | + + "IFNULL(r.s_name,'')as s_name," | ||
| 288 | + + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name " | ||
| 289 | + + "FROM bsth_c_s_sp_info_real r where 1=1 " | ||
| 263 | + " and to_days(r.schedule_date)=to_days('"+date + "') " | 290 | + " and to_days(r.schedule_date)=to_days('"+date + "') " |
| 264 | + " and r.xl_bm like '%"+line+"%' " | 291 | + " and r.xl_bm like '%"+line+"%' " |
| 265 | + " and r.gs_bm like '%"+gsdmShif+"%' " | 292 | + " and r.gs_bm like '%"+gsdmShif+"%' " |
| 266 | + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t" | 293 | + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t" |
| 267 | - + " GROUP BY t.schedule_date,t.j_name,t.s_name, t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm "; | 294 | + + " GROUP BY t.schedule_date,t.j_name,t.s_name, " |
| 295 | + + "t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm,t.lp_name "; | ||
| 268 | 296 | ||
| 269 | 297 | ||
| 270 | List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { | 298 | List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { |
| @@ -806,7 +834,7 @@ public class FormsServiceImpl implements FormsService { | @@ -806,7 +834,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 806 | + " and y.ssgsdm like '%"+gsbm+"%' " | 834 | + " and y.ssgsdm like '%"+gsbm+"%' " |
| 807 | + " and y.fgsdm like '%"+fgsbm+"%'" | 835 | + " and y.fgsdm like '%"+fgsbm+"%'" |
| 808 | + " ) x" | 836 | + " ) x" |
| 809 | - + " on t.cl_zbh = x.nbbm "; | 837 | + + " on t.cl_zbh = x.nbbm and t.j_gh=x.jsy"; |
| 810 | 838 | ||
| 811 | List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { | 839 | List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { |
| 812 | @Override | 840 | @Override |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -1400,14 +1400,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1400,14 +1400,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1400 | double ljgl=culateService.culateLjgl(lists); | 1400 | double ljgl=culateService.culateLjgl(lists); |
| 1401 | 1401 | ||
| 1402 | map.put("jhlc", culateService.culateJhgl(list)); //计划里程 | 1402 | map.put("jhlc", culateService.culateJhgl(list)); //计划里程 |
| 1403 | - map.put("remMileage", culateService.culateLbgl(lists)); //烂班公里 | 1403 | + map.put("remMileage", culateService.culateLbgl(list)); //烂班公里 |
| 1404 | map.put("addMileage", ljgl); //临加公里 | 1404 | map.put("addMileage", ljgl); //临加公里 |
| 1405 | map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里 | 1405 | map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里 |
| 1406 | map.put("ksgl", ksgl);//空驶公里 | 1406 | map.put("ksgl", ksgl);//空驶公里 |
| 1407 | map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl))); | 1407 | map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl))); |
| 1408 | // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage)); | 1408 | // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage)); |
| 1409 | map.put("jhbc", culateService.culateJhbc(list,"")); | 1409 | map.put("jhbc", culateService.culateJhbc(list,"")); |
| 1410 | - map.put("cjbc", culateService.culateLbbc(lists)); | 1410 | + map.put("cjbc", culateService.culateLbbc(list)); |
| 1411 | map.put("ljbc", culateService.culateLjbc(lists,"")); | 1411 | map.put("ljbc", culateService.culateLjbc(lists,"")); |
| 1412 | map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,"")); | 1412 | map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,"")); |
| 1413 | map.put("jcclc", jccgl); | 1413 | map.put("jcclc", jccgl); |
src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
| @@ -239,5 +239,4 @@ | @@ -239,5 +239,4 @@ | ||
| 239 | <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> | 239 | <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> |
| 240 | </tr> | 240 | </tr> |
| 241 | {{/if}} | 241 | {{/if}} |
| 242 | -</script> | ||
| 243 | </script> | 242 | </script> |
| 244 | \ No newline at end of file | 243 | \ No newline at end of file |