Commit 646116d56371767b7a4b0960a2ccf7c22a710670

Authored by 潘钊
2 parents 913548da d2f2a2a8

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

src/main/java/com/bsth/controller/sys/IntervalController.java
@@ -9,12 +9,13 @@ import org.springframework.web.bind.annotation.RequestParam; @@ -9,12 +9,13 @@ import org.springframework.web.bind.annotation.RequestParam;
9 import org.springframework.web.bind.annotation.RestController; 9 import org.springframework.web.bind.annotation.RestController;
10 10
11 import com.alibaba.fastjson.JSON; 11 import com.alibaba.fastjson.JSON;
  12 +import com.bsth.controller.BaseController;
12 import com.bsth.entity.sys.Interval; 13 import com.bsth.entity.sys.Interval;
13 import com.bsth.service.sys.IntervalService; 14 import com.bsth.service.sys.IntervalService;
14 15
15 @RestController 16 @RestController
16 @RequestMapping("interval") 17 @RequestMapping("interval")
17 -public class IntervalController { 18 +public class IntervalController extends BaseController<Interval, Integer> {
18 19
19 @Autowired 20 @Autowired
20 IntervalService intervalService; 21 IntervalService intervalService;
src/main/java/com/bsth/entity/sys/Interval.java
@@ -39,11 +39,11 @@ public class Interval { @@ -39,11 +39,11 @@ public class Interval {
39 } 39 }
40 40
41 41
42 - public Integer getCreateBy() { 42 + public String getCreateBy() {
43 return createBy; 43 return createBy;
44 } 44 }
45 45
46 - public void setCreateBy(Integer createBy) { 46 + public void setCreateBy(String createBy) {
47 this.createBy = createBy; 47 this.createBy = createBy;
48 } 48 }
49 49
@@ -55,11 +55,11 @@ public class Interval { @@ -55,11 +55,11 @@ public class Interval {
55 this.createDate = createDate; 55 this.createDate = createDate;
56 } 56 }
57 57
58 - public Integer getUpdateBy() { 58 + public String getUpdateBy() {
59 return updateBy; 59 return updateBy;
60 } 60 }
61 61
62 - public void setUpdateBy(Integer updateBy) { 62 + public void setUpdateBy(String updateBy) {
63 this.updateBy = updateBy; 63 this.updateBy = updateBy;
64 } 64 }
65 65
@@ -75,13 +75,13 @@ public class Interval { @@ -75,13 +75,13 @@ public class Interval {
75 private Integer trough; 75 private Integer trough;
76 76
77 @Column(name = "create_by") 77 @Column(name = "create_by")
78 - private Integer createBy; 78 + private String createBy;
79 79
80 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") 80 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
81 private Date createDate; 81 private Date createDate;
82 82
83 @Column(name = "update_by") 83 @Column(name = "update_by")
84 - private Integer updateBy; 84 + private String updateBy;
85 85
86 @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") 86 @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
87 private Date updateDate; 87 private Date updateDate;
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -868,30 +868,127 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -868,30 +868,127 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
868 Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId()); 868 Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
869 869
870 map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos))); 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 map.put("addMileage", culateMieageService.culateLjgl(lists)); 872 map.put("addMileage", culateMieageService.culateLjgl(lists));
873 double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists)); 873 double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists));
874 map.put("yygl", yygl); 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 map.put("ksgl",ksgl); 876 map.put("ksgl",ksgl);
877 map.put("realMileage", Arith.add(yygl ,ksgl)); 877 map.put("realMileage", Arith.add(yygl ,ksgl));
878 map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,"")); 878 map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,""));
879 - map.put("cjbc", culateMieageService.culateLbbc(lists)); 879 + map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos));
880 map.put("ljbc", culateMieageService.culateLjbc(lists, "")); 880 map.put("ljbc", culateMieageService.culateLjbc(lists, ""));
881 int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, ""); 881 int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, "");
882 map.put("sjbc", sjbc); 882 map.put("sjbc", sjbc);
883 // map=new HashMap<String,Object>(); 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 Map<String, Object> maps; 978 Map<String, Object> maps;
885 - for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { 979 + for (ScheduleRealInfo scheduleRealInfo : listSchedule) {
886 maps = new HashMap<String, Object>(); 980 maps = new HashMap<String, Object>();
887 try { 981 try {
888 scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); 982 scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
889 scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); 983 scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
890 maps = rru.getMapValue(scheduleRealInfo); 984 maps = rru.getMapValue(scheduleRealInfo);
  985 + maps.put("bcs", scheduleRealInfo.getAdjustExps());
891 String zdsj = scheduleRealInfo.getZdsj(); 986 String zdsj = scheduleRealInfo.getZdsj();
892 String zdsjActual = scheduleRealInfo.getZdsjActual(); 987 String zdsjActual = scheduleRealInfo.getZdsjActual();
893 if (zdsj != null && zdsjActual != null && 988 if (zdsj != null && zdsjActual != null &&
894 - !zdsj.equals(zdsjActual)) { 989 + !zdsj.equals(zdsjActual) &&
  990 + !zdsj.equals("")&&
  991 + !zdsjActual.equals("")) {
895 if (zdsj.compareTo(zdsjActual) > 0) { 992 if (zdsj.compareTo(zdsjActual) > 0) {
896 maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); 993 maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
897 maps.put("slow", ""); 994 maps.put("slow", "");
@@ -908,6 +1005,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -908,6 +1005,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
908 e.printStackTrace(); 1005 e.printStackTrace();
909 } 1006 }
910 } 1007 }
  1008 +
911 String xls=""; 1009 String xls="";
912 if(map.get("type").toString().equals("0")){ 1010 if(map.get("type").toString().equals("0")){
913 xls="waybill_minhang.xls"; 1011 xls="waybill_minhang.xls";
@@ -4068,65 +4166,163 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4068,65 +4166,163 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4068 List<Iterator<?>> list = new ArrayList<Iterator<?>>(); 4166 List<Iterator<?>> list = new ArrayList<Iterator<?>>();
4069 List<ScheduleRealInfo> scheduleRealInfos = listpl; 4167 List<ScheduleRealInfo> scheduleRealInfos = listpl;
4070 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); 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 if(s.getZdsjActual()!=null){ 4177 if(s.getZdsjActual()!=null){
4080 lists.add(s); 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 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 4183 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
4086 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 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 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 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,12 +864,12 @@ public class ReportServiceImpl implements ReportService{
864 //查询时间里程 864 //查询时间里程
865 String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,2 as xh FROM " 865 String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,2 as xh FROM "
866 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and " 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 + " and bc_type !='region') " 868 + " and bc_type !='region') "
869 + " union " 869 + " union "
870 + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,1 as xh FROM " 870 + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,1 as xh FROM "
871 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and " 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 + " and bc_type !='region') " 873 + " and bc_type !='region') "
874 + " order by xl_dir, xh, lp,fcsj"; 874 + " order by xl_dir, xh, lp,fcsj";
875 Map<String, Object> map=new HashMap<String,Object>(); 875 Map<String, Object> map=new HashMap<String,Object>();
@@ -885,10 +885,9 @@ public class ReportServiceImpl implements ReportService{ @@ -885,10 +885,9 @@ public class ReportServiceImpl implements ReportService{
885 m.put("lp", rs.getString("lp")); 885 m.put("lp", rs.getString("lp"));
886 m.put("dir", rs.getString("xl_dir")); 886 m.put("dir", rs.getString("xl_dir"));
887 m.put("ists", rs.getString("ists")!=null?rs.getString("ists"):""); 887 m.put("ists", rs.getString("ists")!=null?rs.getString("ists"):"");
888 - 888 + String[] split = m.get("fcsj").toString().split(":");
889 if(rs.getString("xh").equals("2")){ 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 return m; 893 return m;
@@ -929,58 +928,72 @@ public class ReportServiceImpl implements ReportService{ @@ -929,58 +928,72 @@ public class ReportServiceImpl implements ReportService{
929 List<Integer> fcsj_x = new ArrayList<Integer>(); 928 List<Integer> fcsj_x = new ArrayList<Integer>();
930 int sxsj = 0, xxsj = 0, sxtssj = 0, xxtssj = 0; 929 int sxsj = 0, xxsj = 0, sxtssj = 0, xxtssj = 0;
931 int sxbc = 0, xxbc = 0, sxtsbc = 0, xxtsbc = 0; 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 boolean ists = false; 932 boolean ists = false;
934 String lpname=""; 933 String lpname="";
935 for(Map<String, Object> m : list2){ 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 Collections.sort(fcsj_s); 999 Collections.sort(fcsj_s);
src/main/resources/static/pages/base/interval/list.html
1 -<!-- <link href="/pages/base/line/css/animate.css" rel="stylesheet" type="text/css" />  
2 -<link href="/pages/base/line/css/tipso.css" rel="stylesheet" type="text/css" /> -->  
3 <!-- 片段标题 START --> 1 <!-- 片段标题 START -->
4 <div class="page-head"> 2 <div class="page-head">
5 <div class="page-title"> 3 <div class="page-title">
6 - <h1>间隔信息</h1> 4 + <h1>间隔信息</h1>
7 </div> 5 </div>
8 </div> 6 </div>
9 <!-- 片段标题 END --> 7 <!-- 片段标题 END -->
@@ -12,7 +10,7 @@ @@ -12,7 +10,7 @@
12 <ul class="page-breadcrumb breadcrumb"> 10 <ul class="page-breadcrumb breadcrumb">
13 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> 11 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
14 <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> 12 <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li>
15 - <li><span class="active">间隔信息</span></li> 13 + <li><span class="active">间隔信息</span></li>
16 </ul> 14 </ul>
17 <!-- 线路信息导航栏组件 END --> 15 <!-- 线路信息导航栏组件 END -->
18 16
@@ -24,29 +22,27 @@ @@ -24,29 +22,27 @@
24 </div> 22 </div>
25 <div class="caption"> 23 <div class="caption">
26 <i class="fa fa-info-circle font-dark"></i> 24 <i class="fa fa-info-circle font-dark"></i>
27 - <span class="caption-subject font-dark sbold uppercase">线路信息</span> 25 + <span class="caption-subject font-dark sbold uppercase">间隔信息</span>
28 </div> 26 </div>
29 <div class="actions"> 27 <div class="actions">
30 <div class="btn-group btn-group-devided" data-toggle="buttons"> 28 <div class="btn-group btn-group-devided" data-toggle="buttons">
31 - <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加线路</a> 29 + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加间隔信息</a>
32 </div> 30 </div>
33 </div> 31 </div>
34 </div> 32 </div>
35 <div class="portlet-body"> 33 <div class="portlet-body">
36 <div class="table-container" style="margin-top: 10px"> 34 <div class="table-container" style="margin-top: 10px">
37 - <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_line"> 35 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_interval">
38 <thead> 36 <thead>
39 <tr role="row" class="heading"> 37 <tr role="row" class="heading">
40 - <th >#</th>  
41 <th >序号</th> 38 <th >序号</th>
42 - <th >大间隔ID</th>  
43 - <th >大间隔等级</th> 39 + <th >间隔ID</th>
  40 + <th >间隔等级</th>
44 <th >高峰间隔时间</th> 41 <th >高峰间隔时间</th>
45 <th >低谷间隔时间</th> 42 <th >低谷间隔时间</th>
46 <th >操作</th> 43 <th >操作</th>
47 </tr> 44 </tr>
48 <tr role="row" class="filter"> 45 <tr role="row" class="filter">
49 - <td>#</td>  
50 <td></td> 46 <td></td>
51 <td></td> 47 <td></td>
52 <td></td> 48 <td></td>
@@ -73,72 +69,27 @@ @@ -73,72 +69,27 @@
73 </div> 69 </div>
74 </div> 70 </div>
75 </div> 71 </div>
76 -<script type="text/html" id="line_list_temp"> 72 +<script type="text/html" id="interval_list_temp">
77 {{each list as obj i }} 73 {{each list as obj i }}
78 <tr> 74 <tr>
79 - <td style="vertical-align: middle;">  
80 - <input type="checkbox" class="group-checkable icheck" value="{{obj.name}}" id="{{obj.id}}" data-id="{{obj.id}}" data-lineName="{{obj.name}}">  
81 - </td>  
82 - <td style="vertical-align: middle;">  
83 - {{(list.page*10)+(i+1)}}  
84 - </td>  
85 - <td>  
86 - {{obj.lineCode}}  
87 - </td>  
88 <td> 75 <td>
89 - {{obj.name}}  
90 - </td>  
91 - <td>  
92 - {{if obj.nature == 'lj'}}  
93 - 路救  
94 - {{else if obj.nature == 'bc'}}  
95 - 备车  
96 - {{else if obj.nature == 'dbc'}}  
97 - 定班车  
98 - {{else if obj.nature == 'yxl'}}  
99 - 夜宵路  
100 - {{else if obj.nature == 'cgxl'}}  
101 - 常规线路  
102 - {{else if obj.nature == 'gjxl'}}  
103 - 过江线路  
104 - {{else if obj.nature == 'csbs'}}  
105 - 穿梭巴士  
106 - {{else if obj.nature == 'tyxl'}}  
107 - 特约线路  
108 - {{else if obj.nature == 'qt'}}  
109 - 其他  
110 - {{else if obj.nature == 'cctxl'}}  
111 - 村村通线路  
112 - {{/if}}  
113 - </td>  
114 - <td>  
115 - {{if obj.level == '1'}}  
116 - 一级线路  
117 - {{else if obj.level == '2'}}  
118 - 二级线路  
119 - {{else if obj.level == '0'}}  
120 - 未知等级  
121 - {{/if}} 76 + {{(list.page*10)+(i+1)}}
122 </td> 77 </td>
123 <td> 78 <td>
124 - {{obj.shanghaiLinecode}} 79 + {{obj.id}}
125 </td> 80 </td>
126 <td> 81 <td>
127 - {{if obj.destroy == 1}}  
128 - <span style="font-weight: bold; color: red; padding: 5px; background-color: #FFE4E1; margin: 5px; font-size: 9px;border-radius: 4px;">撤销</span>  
129 - {{else if obj.destroy == 0}}  
130 - <span style="font-weight: bold; color: #07824e; padding: 5px; background-color: #FFE4E1; margin: 5px; font-size: 9px;border-radius: 4px;">运营</span>  
131 - {{/if}} 82 + {{obj.level}}
132 </td> 83 </td>
133 <td> 84 <td>
134 - <a href="/pages/base/lineinformation/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a> 85 + {{obj.peak}}
135 </td> 86 </td>
136 <td> 87 <td>
137 - <a href="/pages/base/stationroute/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a> 88 + {{obj.trough}}
138 </td> 89 </td>
139 <td> 90 <td>
140 - <a href="details.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a>  
141 - <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> 91 + <a href="edit.html?no={{obj.id}}" class="btn btn-info btn-sm" data-pjax> 修改 </a>
  92 + <a class="btn btn-danger btn-sm" onclick="del({{obj.id}})"> 删除</a>
142 </td> 93 </td>
143 </tr> 94 </tr>
144 {{/each}} 95 {{/each}}
@@ -150,4 +101,20 @@ @@ -150,4 +101,20 @@
150 </script> 101 </script>
151 <!-- <script src="/pages/base/line/js/tipso.js"></script> --> 102 <!-- <script src="/pages/base/line/js/tipso.js"></script> -->
152 <!-- 线路信息片段JS模块 --> 103 <!-- 线路信息片段JS模块 -->
153 -<script src="/pages/base/line/js/line-list-table.js"></script>  
154 \ No newline at end of file 104 \ No newline at end of file
  105 +<script src="/pages/base/interval/js/interval-list-table.js"></script>
  106 +<script>
  107 + function del(intervalId){
  108 + layer.confirm('确定要删除间隔信息吗?', {
  109 + btn: ['确定','取消'] //按钮
  110 + }, function(){
  111 + $.ajax({
  112 + url: '/interval/' + intervalId,
  113 + type: 'DELETE',
  114 + success: function(result) {
  115 + window.location.href = 'list.html';
  116 + }
  117 + });
  118 + }, function(){
  119 + });
  120 + }
  121 +</script>
155 \ No newline at end of file 122 \ No newline at end of file
src/main/resources/static/pages/excep/mhspeedingList.html
@@ -142,8 +142,6 @@ @@ -142,8 +142,6 @@
142 {{/if}} 142 {{/if}}
143 </script> 143 </script>
144 144
145 -<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>  
146 -  
147 <script> 145 <script>
148 $(function(){ 146 $(function(){
149 var page = 0, initPagination; 147 var page = 0, initPagination;
src/main/resources/static/pages/excep/pdspeedingList.html
@@ -142,8 +142,6 @@ @@ -142,8 +142,6 @@
142 {{/if}} 142 {{/if}}
143 </script> 143 </script>
144 144
145 -<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>  
146 -  
147 <script> 145 <script>
148 $(function(){ 146 $(function(){
149 var page = 0, initPagination; 147 var page = 0, initPagination;
src/main/resources/static/pages/forms/statement/waybill.html
@@ -333,7 +333,8 @@ @@ -333,7 +333,8 @@
333 return; 333 return;
334 } 334 }
335 $get('/realSchedule/exportWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){ 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