Commit 2fd8fc6a7d81fc79b718853e477acc764754cd5b
1 parent
c2a61e14
行车路单 导出格式
Showing
3 changed files
with
318 additions
and
108 deletions
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -868,30 +868,127 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 868 | 868 | Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId()); |
| 869 | 869 | |
| 870 | 870 | map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos))); |
| 871 | - map.put("remMileage",culateMieageService.culateLbgl(lists)); | |
| 871 | + map.put("remMileage",culateMieageService.culateLbgl(scheduleRealInfos)); | |
| 872 | 872 | map.put("addMileage", culateMieageService.culateLjgl(lists)); |
| 873 | 873 | double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists)); |
| 874 | 874 | map.put("yygl", yygl); |
| 875 | - double ksgl=Arith.add(culateMieageService.culateKsgl(lists),culateMieageService.culateJccgl(lists)); | |
| 875 | + double ksgl=Arith.add(culateMieageService.culateKsgl(scheduleRealInfos),culateMieageService.culateJccgl(lists)); | |
| 876 | 876 | map.put("ksgl",ksgl); |
| 877 | 877 | map.put("realMileage", Arith.add(yygl ,ksgl)); |
| 878 | 878 | map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,"")); |
| 879 | - map.put("cjbc", culateMieageService.culateLbbc(lists)); | |
| 879 | + map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos)); | |
| 880 | 880 | map.put("ljbc", culateMieageService.culateLjbc(lists, "")); |
| 881 | 881 | int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, ""); |
| 882 | 882 | map.put("sjbc", sjbc); |
| 883 | 883 | // map=new HashMap<String,Object>(); |
| 884 | + | |
| 885 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); | |
| 886 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 887 | + + " id = (" | |
| 888 | + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 889 | + + ")"; | |
| 890 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 891 | + String[] minSjs = minfcsj.split(":"); | |
| 892 | + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); | |
| 893 | + | |
| 894 | + | |
| 895 | + for (int i = 0; i < scheduleRealInfos.size(); i++) { | |
| 896 | + ScheduleRealInfo s=scheduleRealInfos.get(i); | |
| 897 | + String[] fcsj= s.getFcsj().split(":"); | |
| 898 | + Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]); | |
| 899 | + | |
| 900 | + Long fscjT=0L; | |
| 901 | + if(fcsjL<minSj){ | |
| 902 | + Calendar calendar = new GregorianCalendar(); | |
| 903 | + calendar.setTime(s.getScheduleDate()); | |
| 904 | + calendar.add(calendar.DATE,1); | |
| 905 | + s.setScheduleDate(calendar.getTime()); | |
| 906 | + try { | |
| 907 | + fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime(); | |
| 908 | + } catch (ParseException e) { | |
| 909 | + // TODO Auto-generated catch block | |
| 910 | + e.printStackTrace(); | |
| 911 | + } | |
| 912 | + | |
| 913 | + }else{ | |
| 914 | + try { | |
| 915 | + fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime(); | |
| 916 | + } catch (ParseException e) { | |
| 917 | + // TODO Auto-generated catch block | |
| 918 | + e.printStackTrace(); | |
| 919 | + }; | |
| 920 | + } | |
| 921 | + s.setFcsjT(fscjT); | |
| 922 | + } | |
| 923 | + List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>(); | |
| 924 | + Collections.sort(scheduleRealInfos, new ComparableReal()); | |
| 925 | + for (int i = 0; i < scheduleRealInfos.size(); i++) { | |
| 926 | + ScheduleRealInfo s = scheduleRealInfos.get(i); | |
| 927 | + s.setAdjustExps(i + 1 + ""); | |
| 928 | + String remarks = ""; | |
| 929 | + if (s.getRemarks() != null) { | |
| 930 | + remarks += s.getRemarks(); | |
| 931 | + } | |
| 932 | + | |
| 933 | + Set<ChildTaskPlan> childTaskPlans = s.getcTasks(); | |
| 934 | + if (!childTaskPlans.isEmpty()) { | |
| 935 | + s.setFcsjActual(""); | |
| 936 | + s.setZdsjActual(""); | |
| 937 | + s.setJhlc(0.0); | |
| 938 | + } | |
| 939 | + | |
| 940 | + if (s.isDestroy()) { | |
| 941 | + s.setFcsjActual(""); | |
| 942 | + s.setZdsjActual(""); | |
| 943 | + s.setJhlc(0.0); | |
| 944 | + remarks += "(烂班)"; | |
| 945 | + s.setRemarks(remarks); | |
| 946 | + } | |
| 947 | + | |
| 948 | + listSchedule.add(s); | |
| 949 | + //计算营运里程,空驶里程 | |
| 950 | + if (!childTaskPlans.isEmpty()) { | |
| 951 | +// Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 952 | + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans); | |
| 953 | + Collections.sort(listit, new ComparableChild()); | |
| 954 | + for (int j = 0; j < listit.size(); j++) { | |
| 955 | + ScheduleRealInfo t = new ScheduleRealInfo(); | |
| 956 | + ChildTaskPlan childTaskPlan = listit.get(j); | |
| 957 | + if (childTaskPlan.isDestroy()) { | |
| 958 | + t.setFcsjActual(""); | |
| 959 | + t.setZdsjActual(""); | |
| 960 | + t.setJhlc(0.0); | |
| 961 | + } else { | |
| 962 | + t.setFcsjActual(childTaskPlan.getStartDate()); | |
| 963 | + t.setZdsjActual(childTaskPlan.getEndDate()); | |
| 964 | + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage()))); | |
| 965 | + } | |
| 966 | + t.setQdzName(childTaskPlan.getStartStationName()); | |
| 967 | + t.setZdzName(childTaskPlan.getEndStationName()); | |
| 968 | + t.setRemarks(childTaskPlan.getRemarks()); | |
| 969 | + t.setAdjustExps("子"); | |
| 970 | + t.setjGh(""); | |
| 971 | + t.setjName(""); | |
| 972 | + t.setsGh(""); | |
| 973 | + t.setsName(""); | |
| 974 | + listSchedule.add(t); | |
| 975 | + } | |
| 976 | + } | |
| 977 | + } | |
| 884 | 978 | Map<String, Object> maps; |
| 885 | - for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { | |
| 979 | + for (ScheduleRealInfo scheduleRealInfo : listSchedule) { | |
| 886 | 980 | maps = new HashMap<String, Object>(); |
| 887 | 981 | try { |
| 888 | 982 | scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); |
| 889 | 983 | scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); |
| 890 | 984 | maps = rru.getMapValue(scheduleRealInfo); |
| 985 | + maps.put("bcs", scheduleRealInfo.getAdjustExps()); | |
| 891 | 986 | String zdsj = scheduleRealInfo.getZdsj(); |
| 892 | 987 | String zdsjActual = scheduleRealInfo.getZdsjActual(); |
| 893 | 988 | if (zdsj != null && zdsjActual != null && |
| 894 | - !zdsj.equals(zdsjActual)) { | |
| 989 | + !zdsj.equals(zdsjActual) && | |
| 990 | + !zdsj.equals("")&& | |
| 991 | + !zdsjActual.equals("")) { | |
| 895 | 992 | if (zdsj.compareTo(zdsjActual) > 0) { |
| 896 | 993 | maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); |
| 897 | 994 | maps.put("slow", ""); |
| ... | ... | @@ -908,6 +1005,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 908 | 1005 | e.printStackTrace(); |
| 909 | 1006 | } |
| 910 | 1007 | } |
| 1008 | + | |
| 911 | 1009 | String xls=""; |
| 912 | 1010 | if(map.get("type").toString().equals("0")){ |
| 913 | 1011 | xls="waybill_minhang.xls"; |
| ... | ... | @@ -4068,65 +4166,163 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4068 | 4166 | List<Iterator<?>> list = new ArrayList<Iterator<?>>(); |
| 4069 | 4167 | List<ScheduleRealInfo> scheduleRealInfos = listpl; |
| 4070 | 4168 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); |
| 4071 | -// List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); | |
| 4072 | - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 4073 | - for (int i = 0; i < scheduleRealInfos.size(); i++) { | |
| 4074 | - ScheduleRealInfo s=scheduleRealInfos.get(i); | |
| 4075 | - Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 4076 | - if(cts != null && cts.size() > 0){ | |
| 4077 | - lists.add(s); | |
| 4078 | - }else{ | |
| 4169 | +// List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); | |
| 4170 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 4171 | + for (int i = 0; i < scheduleRealInfos.size(); i++) { | |
| 4172 | + ScheduleRealInfo s=scheduleRealInfos.get(i); | |
| 4173 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 4174 | + if(cts != null && cts.size() > 0){ | |
| 4175 | + lists.add(s); | |
| 4176 | + }else{ | |
| 4079 | 4177 | if(s.getZdsjActual()!=null){ |
| 4080 | 4178 | lists.add(s); |
| 4081 | 4179 | } |
| 4082 | - } | |
| 4083 | - } | |
| 4084 | - DecimalFormat format = new DecimalFormat("0.00"); | |
| 4180 | + } | |
| 4181 | + } | |
| 4182 | + DecimalFormat format = new DecimalFormat("0.00"); | |
| 4085 | 4183 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 4086 | 4184 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); |
| 4087 | - Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId()); | |
| 4088 | - //计算里程和班次数,并放入Map里 | |
| 4089 | - map.put("jhlc", Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos))); | |
| 4090 | - map.put("remMileage",culateMieageService.culateLbgl(lists)); | |
| 4091 | - map.put("addMileage", culateMieageService.culateLjgl(lists)); | |
| 4092 | - double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists)); | |
| 4093 | - map.put("yygl", yygl); | |
| 4094 | - double ksgl=Arith.add(culateMieageService.culateKsgl(lists),culateMieageService.culateJccgl(lists)); | |
| 4095 | - map.put("ksgl",ksgl); | |
| 4096 | - map.put("realMileage", Arith.add(yygl ,ksgl)); | |
| 4097 | - map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,"")); | |
| 4098 | - map.put("cjbc", culateMieageService.culateLbbc(lists)); | |
| 4099 | - map.put("ljbc", culateMieageService.culateLjbc(lists, "")); | |
| 4100 | - int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, ""); | |
| 4101 | - map.put("sjbc", sjbc); | |
| 4102 | - | |
| 4103 | - Map<String, Object> maps; | |
| 4104 | - for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { | |
| 4105 | - maps = new HashMap<String, Object>(); | |
| 4106 | - try { | |
| 4107 | - scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); | |
| 4108 | - scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); | |
| 4109 | - maps = rru.getMapValue(scheduleRealInfo); | |
| 4110 | - String zdsj = scheduleRealInfo.getZdsj(); | |
| 4111 | - String zdsjActual = scheduleRealInfo.getZdsjActual(); | |
| 4112 | - if (zdsj != null && zdsjActual != null && | |
| 4113 | - !zdsj.equals(zdsjActual)) { | |
| 4114 | - if (zdsj.compareTo(zdsjActual) > 0) { | |
| 4115 | - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4116 | - maps.put("slow", ""); | |
| 4117 | - } else { | |
| 4118 | - maps.put("fast", ""); | |
| 4119 | - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4120 | - } | |
| 4121 | - } else { | |
| 4122 | - maps.put("fast", ""); | |
| 4123 | - maps.put("slow", ""); | |
| 4124 | - } | |
| 4125 | - listMap.add(maps); | |
| 4126 | - } catch (Exception e) { | |
| 4127 | - e.printStackTrace(); | |
| 4128 | - } | |
| 4129 | - } | |
| 4185 | + //计算里程和班次数,并放入Map里 | |
| 4186 | + Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId()); | |
| 4187 | + | |
| 4188 | + map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos))); | |
| 4189 | + map.put("remMileage",culateMieageService.culateLbgl(scheduleRealInfos)); | |
| 4190 | + map.put("addMileage", culateMieageService.culateLjgl(lists)); | |
| 4191 | + double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists)); | |
| 4192 | + map.put("yygl", yygl); | |
| 4193 | + double ksgl=Arith.add(culateMieageService.culateKsgl(scheduleRealInfos),culateMieageService.culateJccgl(lists)); | |
| 4194 | + map.put("ksgl",ksgl); | |
| 4195 | + map.put("realMileage", Arith.add(yygl ,ksgl)); | |
| 4196 | + map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,"")); | |
| 4197 | + map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos)); | |
| 4198 | + map.put("ljbc", culateMieageService.culateLjbc(lists, "")); | |
| 4199 | + int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, ""); | |
| 4200 | + map.put("sjbc", sjbc); | |
| 4201 | +// map=new HashMap<String,Object>(); | |
| 4202 | + | |
| 4203 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); | |
| 4204 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 4205 | + + " id = (" | |
| 4206 | + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(listpl.get(0).getXlBm()) +"'" | |
| 4207 | + + ")"; | |
| 4208 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 4209 | + String[] minSjs = minfcsj.split(":"); | |
| 4210 | + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); | |
| 4211 | + | |
| 4212 | + | |
| 4213 | + for (int i = 0; i < scheduleRealInfos.size(); i++) { | |
| 4214 | + ScheduleRealInfo s=scheduleRealInfos.get(i); | |
| 4215 | + String[] fcsj= s.getFcsj().split(":"); | |
| 4216 | + Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]); | |
| 4217 | + | |
| 4218 | + Long fscjT=0L; | |
| 4219 | + if(fcsjL<minSj){ | |
| 4220 | + Calendar calendar = new GregorianCalendar(); | |
| 4221 | + calendar.setTime(s.getScheduleDate()); | |
| 4222 | + calendar.add(calendar.DATE,1); | |
| 4223 | + s.setScheduleDate(calendar.getTime()); | |
| 4224 | + try { | |
| 4225 | + fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime(); | |
| 4226 | + } catch (ParseException e) { | |
| 4227 | + // TODO Auto-generated catch block | |
| 4228 | + e.printStackTrace(); | |
| 4229 | + } | |
| 4230 | + | |
| 4231 | + }else{ | |
| 4232 | + try { | |
| 4233 | + fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime(); | |
| 4234 | + } catch (ParseException e) { | |
| 4235 | + // TODO Auto-generated catch block | |
| 4236 | + e.printStackTrace(); | |
| 4237 | + }; | |
| 4238 | + } | |
| 4239 | + s.setFcsjT(fscjT); | |
| 4240 | + } | |
| 4241 | + List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>(); | |
| 4242 | + Collections.sort(scheduleRealInfos, new ComparableReal()); | |
| 4243 | + for (int i = 0; i < scheduleRealInfos.size(); i++) { | |
| 4244 | + ScheduleRealInfo s = scheduleRealInfos.get(i); | |
| 4245 | + s.setAdjustExps(i + 1 + ""); | |
| 4246 | + String remarks = ""; | |
| 4247 | + if (s.getRemarks() != null) { | |
| 4248 | + remarks += s.getRemarks(); | |
| 4249 | + } | |
| 4250 | + | |
| 4251 | + Set<ChildTaskPlan> childTaskPlans = s.getcTasks(); | |
| 4252 | + if (!childTaskPlans.isEmpty()) { | |
| 4253 | + s.setFcsjActual(""); | |
| 4254 | + s.setZdsjActual(""); | |
| 4255 | + s.setJhlc(0.0); | |
| 4256 | + } | |
| 4257 | + | |
| 4258 | + if (s.isDestroy()) { | |
| 4259 | + s.setFcsjActual(""); | |
| 4260 | + s.setZdsjActual(""); | |
| 4261 | + s.setJhlc(0.0); | |
| 4262 | + remarks += "(烂班)"; | |
| 4263 | + s.setRemarks(remarks); | |
| 4264 | + } | |
| 4265 | + | |
| 4266 | + listSchedule.add(s); | |
| 4267 | + //计算营运里程,空驶里程 | |
| 4268 | + if (!childTaskPlans.isEmpty()) { | |
| 4269 | +// Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 4270 | + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans); | |
| 4271 | + Collections.sort(listit, new ComparableChild()); | |
| 4272 | + for (int j = 0; j < listit.size(); j++) { | |
| 4273 | + ScheduleRealInfo t = new ScheduleRealInfo(); | |
| 4274 | + ChildTaskPlan childTaskPlan = listit.get(j); | |
| 4275 | + if (childTaskPlan.isDestroy()) { | |
| 4276 | + t.setFcsjActual(""); | |
| 4277 | + t.setZdsjActual(""); | |
| 4278 | + t.setJhlc(0.0); | |
| 4279 | + } else { | |
| 4280 | + t.setFcsjActual(childTaskPlan.getStartDate()); | |
| 4281 | + t.setZdsjActual(childTaskPlan.getEndDate()); | |
| 4282 | + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage()))); | |
| 4283 | + } | |
| 4284 | + t.setQdzName(childTaskPlan.getStartStationName()); | |
| 4285 | + t.setZdzName(childTaskPlan.getEndStationName()); | |
| 4286 | + t.setRemarks(childTaskPlan.getRemarks()); | |
| 4287 | + t.setAdjustExps("子"); | |
| 4288 | + t.setjGh(""); | |
| 4289 | + t.setjName(""); | |
| 4290 | + t.setsGh(""); | |
| 4291 | + t.setsName(""); | |
| 4292 | + listSchedule.add(t); | |
| 4293 | + } | |
| 4294 | + } | |
| 4295 | + } | |
| 4296 | + Map<String, Object> maps; | |
| 4297 | + for (ScheduleRealInfo scheduleRealInfo : listSchedule) { | |
| 4298 | + maps = new HashMap<String, Object>(); | |
| 4299 | + try { | |
| 4300 | + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); | |
| 4301 | + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); | |
| 4302 | + maps = rru.getMapValue(scheduleRealInfo); | |
| 4303 | + maps.put("bcs", scheduleRealInfo.getAdjustExps()); | |
| 4304 | + String zdsj = scheduleRealInfo.getZdsj(); | |
| 4305 | + String zdsjActual = scheduleRealInfo.getZdsjActual(); | |
| 4306 | + if (zdsj != null && zdsjActual != null && | |
| 4307 | + !zdsj.equals(zdsjActual) && | |
| 4308 | + !zdsj.equals("")&& | |
| 4309 | + !zdsjActual.equals("")) { | |
| 4310 | + if (zdsj.compareTo(zdsjActual) > 0) { | |
| 4311 | + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4312 | + maps.put("slow", ""); | |
| 4313 | + } else { | |
| 4314 | + maps.put("fast", ""); | |
| 4315 | + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4316 | + } | |
| 4317 | + } else { | |
| 4318 | + maps.put("fast", ""); | |
| 4319 | + maps.put("slow", ""); | |
| 4320 | + } | |
| 4321 | + listMap.add(maps); | |
| 4322 | + } catch (Exception e) { | |
| 4323 | + e.printStackTrace(); | |
| 4324 | + } | |
| 4325 | + } | |
| 4130 | 4326 | |
| 4131 | 4327 | |
| 4132 | 4328 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -864,12 +864,12 @@ public class ReportServiceImpl implements ReportService{ |
| 864 | 864 | //查询时间里程 |
| 865 | 865 | String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,2 as xh FROM " |
| 866 | 866 | + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and " |
| 867 | - + " fcsj <='"+minfcsj+"' and bc_type!='in' and bc_type!='out' and bc_type!='ldks'" | |
| 867 | + + " fcsj <='"+minfcsj+"' and bc_type!='ldks'" | |
| 868 | 868 | + " and bc_type !='region') " |
| 869 | 869 | + " union " |
| 870 | 870 | + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,1 as xh FROM " |
| 871 | 871 | + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and " |
| 872 | - + " fcsj > '"+minfcsj+"' and bc_type!='in' and bc_type!='out' and bc_type!='ldks' " | |
| 872 | + + " fcsj > '"+minfcsj+"' and bc_type!='ldks' " | |
| 873 | 873 | + " and bc_type !='region') " |
| 874 | 874 | + " order by xl_dir, xh, lp,fcsj"; |
| 875 | 875 | Map<String, Object> map=new HashMap<String,Object>(); |
| ... | ... | @@ -885,10 +885,9 @@ public class ReportServiceImpl implements ReportService{ |
| 885 | 885 | m.put("lp", rs.getString("lp")); |
| 886 | 886 | m.put("dir", rs.getString("xl_dir")); |
| 887 | 887 | m.put("ists", rs.getString("ists")!=null?rs.getString("ists"):""); |
| 888 | - | |
| 888 | + String[] split = m.get("fcsj").toString().split(":"); | |
| 889 | 889 | if(rs.getString("xh").equals("2")){ |
| 890 | - String[] split = m.get("fcsj").toString().split(":"); | |
| 891 | - m.put("fcsj", Integer.valueOf(split[0]) + 24 + ":"+split[1]); | |
| 890 | + m.put("fcsj", (Integer.valueOf(split[0]) + 24) + ":"+split[1]); | |
| 892 | 891 | } |
| 893 | 892 | |
| 894 | 893 | return m; |
| ... | ... | @@ -929,58 +928,72 @@ public class ReportServiceImpl implements ReportService{ |
| 929 | 928 | List<Integer> fcsj_x = new ArrayList<Integer>(); |
| 930 | 929 | int sxsj = 0, xxsj = 0, sxtssj = 0, xxtssj = 0; |
| 931 | 930 | int sxbc = 0, xxbc = 0, sxtsbc = 0, xxtsbc = 0; |
| 932 | - int temp = 24*60+1, zcj = 0; | |
| 931 | + int temp = 48*60+1, zcj = 0; | |
| 933 | 932 | boolean ists = false; |
| 934 | 933 | String lpname=""; |
| 935 | 934 | for(Map<String, Object> m : list2){ |
| 936 | - String[] split = m.get("fcsj").toString().split(":"); | |
| 937 | - int fcsj = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 938 | - | |
| 939 | - int xlDir = Integer.valueOf(m.get("dir").toString()); | |
| 940 | - int bcsj = Integer.valueOf(m.get("bcsj").toString()); | |
| 941 | - if(temp >= fcsj){ | |
| 942 | - temp = fcsj; | |
| 943 | - ists = false; | |
| 944 | - } | |
| 945 | - if(xlDir == 0){ | |
| 946 | - fcsj_s.add(fcsj); | |
| 947 | - sxsj += bcsj; | |
| 948 | - sxbc ++; | |
| 949 | - if(!ists){ | |
| 950 | - if(lpname.equals("")){ | |
| 951 | - lpname=m.get("lp").toString(); | |
| 952 | - }else{ | |
| 953 | - if(lpname.equals(m.get("lp").toString())){ | |
| 954 | - sxtssj += (fcsj+bcsj) - temp; | |
| 935 | + String bcType=m.get("bcType").toString(); | |
| 936 | + if(bcType.equals("in") || bcType.equals("out")){ | |
| 937 | + temp=24*60+1; | |
| 938 | + }else{ | |
| 939 | + String[] split = m.get("fcsj").toString().split(":"); | |
| 940 | + int fcsj = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 941 | + | |
| 942 | + int xlDir = Integer.valueOf(m.get("dir").toString()); | |
| 943 | + int bcsj = Integer.valueOf(m.get("bcsj").toString()); | |
| 944 | + if(temp >= fcsj){ | |
| 945 | + temp = fcsj+bcsj; | |
| 946 | + ists = false; | |
| 947 | + } | |
| 948 | + if(xlDir == 0){ | |
| 949 | + fcsj_s.add(fcsj); | |
| 950 | + sxsj += bcsj; | |
| 951 | + sxbc ++; | |
| 952 | + if(!ists){ | |
| 953 | + if(lpname.equals("")){ | |
| 954 | + lpname=m.get("lp").toString(); | |
| 955 | + }else{ | |
| 956 | + if(lpname.equals(m.get("lp").toString())){ | |
| 957 | + if(fcsj-temp<90){ | |
| 958 | + sxtssj += fcsj - temp; | |
| 959 | + } | |
| 960 | + } | |
| 961 | + lpname=m.get("lp").toString(); | |
| 962 | + | |
| 955 | 963 | } |
| 964 | + sxtsbc++; | |
| 956 | 965 | } |
| 957 | - sxtsbc++; | |
| 958 | - } | |
| 959 | - } else { | |
| 960 | - fcsj_x.add(fcsj); | |
| 961 | - xxsj += bcsj; | |
| 962 | - xxbc ++; | |
| 963 | - | |
| 964 | - if(!ists){ | |
| 965 | 966 | |
| 966 | - if(lpname.equals("")){ | |
| 967 | - lpname=m.get("lp").toString(); | |
| 968 | - }else{ | |
| 969 | - if(lpname.equals(m.get("lp").toString())){ | |
| 970 | - xxtssj += (fcsj+bcsj) - temp; | |
| 967 | + } else { | |
| 968 | + | |
| 969 | + fcsj_x.add(fcsj); | |
| 970 | + xxsj += bcsj; | |
| 971 | + xxbc ++; | |
| 972 | + | |
| 973 | + if(!ists){ | |
| 974 | + if(lpname.equals("")){ | |
| 975 | + lpname=m.get("lp").toString(); | |
| 976 | + }else{ | |
| 977 | + if(lpname.equals(m.get("lp").toString())){ | |
| 978 | + if(fcsj-temp<90){ | |
| 979 | + xxtssj += fcsj- temp; | |
| 980 | + } | |
| 981 | + } | |
| 982 | + lpname=m.get("lp").toString(); | |
| 971 | 983 | } |
| 984 | + xxtsbc++; | |
| 972 | 985 | } |
| 973 | - xxtsbc++; | |
| 986 | + | |
| 987 | + } | |
| 988 | + /*if(temp < fcsj){ | |
| 989 | + cjs.add(fcsj - temp); | |
| 990 | + temp = fcsj; | |
| 991 | + }*/ | |
| 992 | + if(m.get("ists").toString().trim().equals("1")){ | |
| 993 | + ists = true; | |
| 994 | + }else{ | |
| 995 | + ists=false; | |
| 974 | 996 | } |
| 975 | - } | |
| 976 | - /*if(temp < fcsj){ | |
| 977 | - cjs.add(fcsj - temp); | |
| 978 | - temp = fcsj; | |
| 979 | - }*/ | |
| 980 | - if(m.get("ists").toString().trim().equals("1")){ | |
| 981 | - ists = true; | |
| 982 | - }else{ | |
| 983 | - ists=false; | |
| 984 | 997 | } |
| 985 | 998 | } |
| 986 | 999 | Collections.sort(fcsj_s); | ... | ... |
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -333,7 +333,8 @@ |
| 333 | 333 | return; |
| 334 | 334 | } |
| 335 | 335 | $get('/realSchedule/exportWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){ |
| 336 | - window.open("/downloadFile/download?fileName="+date+"-"+jName+"-"+params[1]+"-"+params[2]+"-行车路单"); | |
| 336 | + var fileName=date+"-"+jName+"-"+params[1]+"-"+params[2]+"-行车路单"; | |
| 337 | + window.open("/downloadFile/download?fileName="+encodeURIComponent(fileName)); | |
| 337 | 338 | }); |
| 338 | 339 | }); |
| 339 | 340 | ... | ... |