Commit 16b2b3db8e709a23a6e7b77f0322dde7fb6153b3

Authored by 潘钊
2 parents 74dcd914 92a30e2c

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

Showing 29 changed files with 1546 additions and 725 deletions
src/main/java/com/bsth/controller/oil/YlbController.java
@@ -11,6 +11,8 @@ import java.util.Iterator; @@ -11,6 +11,8 @@ import java.util.Iterator;
11 import java.util.List; 11 import java.util.List;
12 import java.util.Map; 12 import java.util.Map;
13 13
  14 +import javax.servlet.http.HttpServletRequest;
  15 +
14 import org.springframework.beans.factory.annotation.Autowired; 16 import org.springframework.beans.factory.annotation.Autowired;
15 import org.springframework.data.domain.Page; 17 import org.springframework.data.domain.Page;
16 import org.springframework.data.domain.PageRequest; 18 import org.springframework.data.domain.PageRequest;
@@ -35,14 +37,19 @@ import com.google.common.base.Splitter; @@ -35,14 +37,19 @@ import com.google.common.base.Splitter;
35 @RequestMapping("ylb") 37 @RequestMapping("ylb")
36 public class YlbController extends BaseController<Ylb, Integer>{ 38 public class YlbController extends BaseController<Ylb, Integer>{
37 @Autowired 39 @Autowired
38 - YlbService yblService; 40 + YlbService ylbService;
39 41
40 @RequestMapping(value = "/saveYlb",method = RequestMethod.POST) 42 @RequestMapping(value = "/saveYlb",method = RequestMethod.POST)
41 public Map<String, Object> saveYlb(Ylb t){ 43 public Map<String, Object> saveYlb(Ylb t){
42 // SysUser user = SecurityUtils.getCurrentUser(); 44 // SysUser user = SecurityUtils.getCurrentUser();
43 t.setCreatetime(new Date()); 45 t.setCreatetime(new Date());
44 // Ylb t=new Ylb(); 46 // Ylb t=new Ylb();
45 - return yblService.saveYlb(t); 47 + return ylbService.saveYlb(t);
  48 + }
  49 +
  50 + @RequestMapping(value = "/updateJsy",method = RequestMethod.GET)
  51 + public Map<String, Object> updateJsy(@RequestParam Map<String, Object> map){
  52 + return ylbService.update(map);
46 } 53 }
47 54
48 55
@@ -55,7 +62,8 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -55,7 +62,8 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
55 public Map<String, Object> obtain(@RequestParam Map<String, Object> map) throws Exception{ 62 public Map<String, Object> obtain(@RequestParam Map<String, Object> map) throws Exception{
56 Map<String, Object> list =new HashMap<String, Object>(); 63 Map<String, Object> list =new HashMap<String, Object>();
57 try { 64 try {
58 - list = yblService.obtain(map); 65 +
  66 + list = ylbService.obtain(map);
59 } catch (Exception e) { 67 } catch (Exception e) {
60 // TODO Auto-generated catch block 68 // TODO Auto-generated catch block
61 throw e; 69 throw e;
@@ -69,7 +77,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -69,7 +77,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
69 public Map<String, Object> saveYlbList(@RequestParam Map<String, Object> map){ 77 public Map<String, Object> saveYlbList(@RequestParam Map<String, Object> map){
70 Map<String, Object> list=new HashMap<String, Object>(); 78 Map<String, Object> list=new HashMap<String, Object>();
71 try { 79 try {
72 - list = yblService.saveYlbList(map); 80 + list = ylbService.saveYlbList(map);
73 } catch (Exception e) { 81 } catch (Exception e) {
74 // TODO Auto-generated catch block 82 // TODO Auto-generated catch block
75 e.printStackTrace(); 83 e.printStackTrace();
@@ -85,7 +93,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -85,7 +93,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
85 public Map<String, Object> sort(@RequestParam Map<String, Object> map){ 93 public Map<String, Object> sort(@RequestParam Map<String, Object> map){
86 Map<String, Object> list=new HashMap<String, Object>(); 94 Map<String, Object> list=new HashMap<String, Object>();
87 try { 95 try {
88 - list=yblService.sort(map); 96 + list=ylbService.sort(map);
89 } catch (Exception e) { 97 } catch (Exception e) {
90 // TODO: handle exception 98 // TODO: handle exception
91 } 99 }
@@ -101,7 +109,8 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -101,7 +109,8 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
101 public Map<String, Object> outAndIn(@RequestParam Map<String, Object> map) throws Exception{ 109 public Map<String, Object> outAndIn(@RequestParam Map<String, Object> map) throws Exception{
102 Map<String, Object> list=new HashMap<String, Object>(); 110 Map<String, Object> list=new HashMap<String, Object>();
103 try { 111 try {
104 - list=yblService.outAndIn(map); 112 +
  113 + list=ylbService.outAndIn(map);
105 } catch (Exception e) { 114 } catch (Exception e) {
106 // TODO: handle exception 115 // TODO: handle exception
107 } 116 }
@@ -118,7 +127,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -118,7 +127,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
118 public Map<String, Object> checkYl(@RequestParam Map<String, Object> map){ 127 public Map<String, Object> checkYl(@RequestParam Map<String, Object> map){
119 Map<String, Object> list=new HashMap<String, Object>(); 128 Map<String, Object> list=new HashMap<String, Object>();
120 try { 129 try {
121 - list=yblService.checkYl(map); 130 + list=ylbService.checkYl(map);
122 } catch (Exception e) { 131 } catch (Exception e) {
123 // TODO: handle exception 132 // TODO: handle exception
124 } 133 }
@@ -146,7 +155,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -146,7 +155,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
146 String rq=map.get("rq").toString(); 155 String rq=map.get("rq").toString();
147 int lx=Integer.parseInt(map.get("sxtj").toString().trim()); 156 int lx=Integer.parseInt(map.get("sxtj").toString().trim());
148 if(lx>0){ 157 if(lx>0){
149 - map.put("nbbm_in", yblService.checkNbmmNum(rq, map.get("ssgsdm_like").toString(), 158 + map.put("nbbm_in", ylbService.checkNbmmNum(rq, map.get("ssgsdm_like").toString(),
150 map.get("fgsdm_like").toString(), map.get("xlbm_like").toString(), 159 map.get("fgsdm_like").toString(), map.get("xlbm_like").toString(),
151 map.get("nbbm_eq").toString(),lx)); 160 map.get("nbbm_eq").toString(),lx));
152 } 161 }
@@ -194,7 +203,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -194,7 +203,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
194 */ 203 */
195 @RequestMapping(value = "/ylbList",method = RequestMethod.GET) 204 @RequestMapping(value = "/ylbList",method = RequestMethod.GET)
196 public List<Ylb> ylbList(@RequestParam Map<String, Object> map){ 205 public List<Ylb> ylbList(@RequestParam Map<String, Object> map){
197 - List<Ylb> ylbList=yblService.listYlb(map); 206 + List<Ylb> ylbList=ylbService.listYlb(map);
198 return ylbList; 207 return ylbList;
199 } 208 }
200 209
@@ -202,7 +211,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -202,7 +211,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
202 public Map<String, Object> deleteIds(@RequestParam Map<String, Object> map) { 211 public Map<String, Object> deleteIds(@RequestParam Map<String, Object> map) {
203 Map<String, Object> maps=new HashMap<String, Object>(); 212 Map<String, Object> maps=new HashMap<String, Object>();
204 try { 213 try {
205 - maps= yblService.deleteIds(map); 214 + maps= ylbService.deleteIds(map);
206 } catch (Exception e) { 215 } catch (Exception e) {
207 // TODO Auto-generated catch block 216 // TODO Auto-generated catch block
208 e.printStackTrace(); 217 e.printStackTrace();
@@ -211,18 +220,18 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -211,18 +220,18 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
211 } 220 }
212 @RequestMapping(value="/oilListMonth") 221 @RequestMapping(value="/oilListMonth")
213 public List<Map<String, Object>> oilListMonth(@RequestParam Map<String, Object> map){ 222 public List<Map<String, Object>> oilListMonth(@RequestParam Map<String, Object> map){
214 - return yblService.oilListMonth(map); 223 + return ylbService.oilListMonth(map);
215 } 224 }
216 225
217 @RequestMapping(value = "/checkJsy",method = RequestMethod.GET) 226 @RequestMapping(value = "/checkJsy",method = RequestMethod.GET)
218 public String checkJsy(@RequestParam Map<String, Object> map){ 227 public String checkJsy(@RequestParam Map<String, Object> map){
219 - String list=yblService.checkJsy(map); 228 + String list=ylbService.checkJsy(map);
220 return list; 229 return list;
221 } 230 }
222 231
223 @RequestMapping(value = "/sumYlb",method = RequestMethod.GET) 232 @RequestMapping(value = "/sumYlb",method = RequestMethod.GET)
224 public Map<String, Object> sumYlb(@RequestParam Map<String, Object> map){ 233 public Map<String, Object> sumYlb(@RequestParam Map<String, Object> map){
225 - Map<String, Object> list=yblService.sumYlb(map); 234 + Map<String, Object> list=ylbService.sumYlb(map);
226 return list; 235 return list;
227 } 236 }
228 237
@@ -232,7 +241,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -232,7 +241,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
232 sdfSimple = new SimpleDateFormat("yyyyMMdd"); 241 sdfSimple = new SimpleDateFormat("yyyyMMdd");
233 List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); 242 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
234 ReportUtils ee = new ReportUtils(); 243 ReportUtils ee = new ReportUtils();
235 - List<Ylb> ylb= yblService.listYlb(map); 244 + List<Ylb> ylb= ylbService.listYlb(map);
236 // (new CustomerSpecs<Ylb>(map)).iterator(); 245 // (new CustomerSpecs<Ylb>(map)).iterator();
237 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 246 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
238 for (Ylb y : ylb) { 247 for (Ylb y : ylb) {
@@ -299,7 +308,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -299,7 +308,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
299 public Map<String, Object> updateHistory(@RequestParam Map<String, Object> map) throws Exception{ 308 public Map<String, Object> updateHistory(@RequestParam Map<String, Object> map) throws Exception{
300 Map<String, Object> list =new HashMap<String, Object>(); 309 Map<String, Object> list =new HashMap<String, Object>();
301 try { 310 try {
302 - list = yblService.updateHistory(map); 311 + list = ylbService.updateHistory(map);
303 } catch (Exception e) { 312 } catch (Exception e) {
304 // TODO Auto-generated catch block 313 // TODO Auto-generated catch block
305 throw e; 314 throw e;
src/main/java/com/bsth/controller/report/ReportController.java
@@ -278,6 +278,12 @@ public class ReportController { @@ -278,6 +278,12 @@ public class ReportController {
278 return service.countByList(map); 278 return service.countByList(map);
279 } 279 }
280 280
  281 + @RequestMapping(value="/countLineMileage2")
  282 + public List<Map<String,Object>> countLineMileage2(@RequestParam Map<String, Object> map){
  283 +
  284 + return service.countByList2(map);
  285 + }
  286 +
281 @RequestMapping(value="/countBusMileage") 287 @RequestMapping(value="/countBusMileage")
282 public List<Map<String,Object>> countBusMileage(@RequestParam Map<String, Object> map){ 288 public List<Map<String,Object>> countBusMileage(@RequestParam Map<String, Object> map){
283 return service.countByBusList(map); 289 return service.countByBusList(map);
src/main/java/com/bsth/entity/oil/Dlb.java
@@ -73,7 +73,7 @@ public class Dlb { @@ -73,7 +73,7 @@ public class Dlb {
73 private String fgsname; 73 private String fgsname;
74 74
75 75
76 - private String lp; 76 + private String lp="";
77 77
78 public Integer getId() { 78 public Integer getId() {
79 return id; 79 return id;
src/main/java/com/bsth/entity/oil/Nylog.java 0 → 100644
  1 +package com.bsth.entity.oil;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +@Entity
  11 +@Table(name = "bsth_c_nylog")
  12 +public class Nylog {
  13 + @Id
  14 + @GeneratedValue
  15 + private Integer id;
  16 +
  17 + private String nylx;
  18 +
  19 + private String czmc;
  20 +
  21 + private String userid;
  22 +
  23 + private String username;
  24 +
  25 + private Date createdate;
  26 +
  27 + private String cxtj;
  28 +
  29 + private String fwdz;
  30 +
  31 + public Integer getId() {
  32 + return id;
  33 + }
  34 +
  35 + public void setId(Integer id) {
  36 + this.id = id;
  37 + }
  38 +
  39 + public String getNylx() {
  40 + return nylx;
  41 + }
  42 +
  43 + public void setNylx(String nylx) {
  44 + this.nylx = nylx;
  45 + }
  46 +
  47 + public String getCzmc() {
  48 + return czmc;
  49 + }
  50 +
  51 + public void setCzmc(String czmc) {
  52 + this.czmc = czmc;
  53 + }
  54 +
  55 + public String getUserid() {
  56 + return userid;
  57 + }
  58 +
  59 + public void setUserid(String userid) {
  60 + this.userid = userid;
  61 + }
  62 +
  63 + public String getUsername() {
  64 + return username;
  65 + }
  66 +
  67 + public void setUsername(String username) {
  68 + this.username = username;
  69 + }
  70 +
  71 + public Date getCreatedate() {
  72 + return createdate;
  73 + }
  74 +
  75 + public void setCreatedate(Date createdate) {
  76 + this.createdate = createdate;
  77 + }
  78 +
  79 + public String getCxtj() {
  80 + return cxtj;
  81 + }
  82 +
  83 + public void setCxtj(String cxtj) {
  84 + this.cxtj = cxtj;
  85 + }
  86 +
  87 + public String getFwdz() {
  88 + return fwdz;
  89 + }
  90 +
  91 + public void setFwdz(String fwdz) {
  92 + this.fwdz = fwdz;
  93 + }
  94 +
  95 +
  96 +
  97 +}
src/main/java/com/bsth/entity/oil/Ylb.java
@@ -56,7 +56,7 @@ public class Ylb { @@ -56,7 +56,7 @@ public class Ylb {
56 //进场顺序(根据最先出场和最后进场来关联车辆的存油量) 56 //进场顺序(根据最先出场和最后进场来关联车辆的存油量)
57 private int jcsx; 57 private int jcsx;
58 58
59 - private String lp; 59 + private String lp="";
60 @Transient 60 @Transient
61 private String bglyh; 61 private String bglyh;
62 62
src/main/java/com/bsth/repository/oil/NylogRepository.java 0 → 100644
  1 +package com.bsth.repository.oil;
  2 +
  3 +
  4 +
  5 +import org.springframework.stereotype.Repository;
  6 +import com.bsth.entity.oil.Nylog;
  7 +import com.bsth.repository.BaseRepository;
  8 +
  9 +@Repository
  10 +public interface NylogRepository extends BaseRepository<Nylog, Integer>{
  11 +}
src/main/java/com/bsth/repository/oil/YlbRepository.java
@@ -157,4 +157,6 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -157,4 +157,6 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
157 " yhlx = ?9"+ 157 " yhlx = ?9"+
158 " WHERE id = ?1", nativeQuery=true) 158 " WHERE id = ?1", nativeQuery=true)
159 public void ylbUpdate(Integer id,double czyl,double jzyl,double yh, double sh,String shyy,double ns,String rylx,int yhlx); 159 public void ylbUpdate(Integer id,double czyl,double jzyl,double yh, double sh,String shyy,double ns,String rylx,int yhlx);
  160 +
  161 +
160 } 162 }
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
@@ -69,7 +69,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -69,7 +69,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
69 return newMap; 69 return newMap;
70 } 70 }
71 71
72 - String sql = "select c.id,c.out_config,c.start_opt,c.trust,t.line_code from bsth_c_line_config c LEFT JOIN bsth_c_line t on c.line=t.id"; 72 + String sql = "select c.id,c.out_config,c.start_opt,t.line_code from bsth_c_line_config c LEFT JOIN bsth_c_line t on c.line=t.id";
73 if(line.length() != 0){ 73 if(line.length() != 0){
74 sql += " where t.line_code = " + line; 74 sql += " where t.line_code = " + line;
75 } 75 }
@@ -82,7 +82,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -82,7 +82,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
82 m.put("id", rs.getLong("id")); 82 m.put("id", rs.getLong("id"));
83 m.put("out_config", rs.getString("out_config")); 83 m.put("out_config", rs.getString("out_config"));
84 m.put("start_opt", rs.getString("start_opt")); 84 m.put("start_opt", rs.getString("start_opt"));
85 - m.put("trust", rs.getString("trust"));  
86 m.put("line_code", rs.getString("line_code")); 85 m.put("line_code", rs.getString("line_code"));
87 return m; 86 return m;
88 }}); 87 }});
src/main/java/com/bsth/service/oil/YlbService.java
@@ -26,6 +26,9 @@ public interface YlbService extends BaseService&lt;Ylb, Integer&gt;{ @@ -26,6 +26,9 @@ public interface YlbService extends BaseService&lt;Ylb, Integer&gt;{
26 Map<String, Object> deleteIds(Map<String, Object> map) throws Exception; 26 Map<String, Object> deleteIds(Map<String, Object> map) throws Exception;
27 27
28 Map<String, Object> updateHistory(Map<String, Object> map) throws Exception; 28 Map<String, Object> updateHistory(Map<String, Object> map) throws Exception;
  29 +
  30 + Map<String, Object> update(Map<String, Object> map);
  31 +
29 32
30 33
31 } 34 }
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
@@ -39,16 +39,20 @@ import com.bsth.entity.oil.Cdl; @@ -39,16 +39,20 @@ import com.bsth.entity.oil.Cdl;
39 import com.bsth.entity.oil.Cyl; 39 import com.bsth.entity.oil.Cyl;
40 import com.bsth.entity.oil.Dlb; 40 import com.bsth.entity.oil.Dlb;
41 import com.bsth.entity.oil.Jdl; 41 import com.bsth.entity.oil.Jdl;
  42 +import com.bsth.entity.oil.Nylog;
42 import com.bsth.entity.oil.Ylb; 43 import com.bsth.entity.oil.Ylb;
43 import com.bsth.entity.oil.Ylxxb; 44 import com.bsth.entity.oil.Ylxxb;
44 import com.bsth.entity.search.CustomerSpecs; 45 import com.bsth.entity.search.CustomerSpecs;
  46 +import com.bsth.entity.sys.SysUser;
45 import com.bsth.repository.CarsRepository; 47 import com.bsth.repository.CarsRepository;
46 import com.bsth.repository.oil.CdlRepository; 48 import com.bsth.repository.oil.CdlRepository;
47 import com.bsth.repository.oil.CylRepository; 49 import com.bsth.repository.oil.CylRepository;
48 import com.bsth.repository.oil.DlbRepository; 50 import com.bsth.repository.oil.DlbRepository;
49 import com.bsth.repository.oil.JdlRepository; 51 import com.bsth.repository.oil.JdlRepository;
  52 +import com.bsth.repository.oil.NylogRepository;
50 import com.bsth.repository.oil.YlbRepository; 53 import com.bsth.repository.oil.YlbRepository;
51 import com.bsth.repository.oil.YlxxbRepository; 54 import com.bsth.repository.oil.YlxxbRepository;
  55 +import com.bsth.security.util.SecurityUtils;
52 import com.bsth.service.impl.BaseServiceImpl; 56 import com.bsth.service.impl.BaseServiceImpl;
53 import com.bsth.service.oil.DlbService; 57 import com.bsth.service.oil.DlbService;
54 import com.bsth.service.realcontrol.ScheduleRealInfoService; 58 import com.bsth.service.realcontrol.ScheduleRealInfoService;
@@ -59,7 +63,8 @@ import com.bsth.util.BatchSaveUtils; @@ -59,7 +63,8 @@ import com.bsth.util.BatchSaveUtils;
59 public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbService{ 63 public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbService{
60 @Autowired 64 @Autowired
61 DlbRepository repository; 65 DlbRepository repository;
62 - 66 + @Autowired
  67 + NylogRepository nylogRepository;
63 @Autowired 68 @Autowired
64 YlxxbRepository ylxxbRepository; 69 YlxxbRepository ylxxbRepository;
65 70
@@ -96,6 +101,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -96,6 +101,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
96 calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 101 calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天
97 dBefore = calendar.getTime(); //得到前一天的时间 102 dBefore = calendar.getTime(); //得到前一天的时间
98 String rq=sdf.format(dBefore); 103 String rq=sdf.format(dBefore);
  104 +// String rq="2017-11-02";
99 String line=""; 105 String line="";
100 //保留两位小数 106 //保留两位小数
101 DecimalFormat df = new DecimalFormat("#.00"); 107 DecimalFormat df = new DecimalFormat("#.00");
@@ -108,7 +114,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -108,7 +114,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
108 //当天加电信息表 114 //当天加电信息表
109 List<Jdl> jdlList=jdlRepository.JdlList(rq); 115 List<Jdl> jdlList=jdlRepository.JdlList(rq);
110 //前一天所有车辆最后进场班次信息 116 //前一天所有车辆最后进场班次信息
111 - List<Dlb> dlListBe=repository.obtainYlbefore(rq, "", "", "", ""); 117 +// List<Dlb> dlListBe=repository.obtainYlbefore(rq, "", "", "", "");
112 List<Cdl> cdyList=cdlRepository.obtainCdl(); 118 List<Cdl> cdyList=cdlRepository.obtainCdl();
113 //从排班表中计算出行驶的总里程 119 //从排班表中计算出行驶的总里程
114 List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq,"","","",""); 120 List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq,"","","","");
@@ -140,14 +146,14 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -140,14 +146,14 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
140 Double jzl=0.0; 146 Double jzl=0.0;
141 if(map.get("seqNumber").toString().equals("1")){ 147 if(map.get("seqNumber").toString().equals("1")){
142 boolean fage=true; 148 boolean fage=true;
143 - for (int i = 0; i < dlListBe.size(); i++) {  
144 - Dlb dlb=dlListBe.get(i);  
145 - if(map.get("clZbh").toString().equals(dlb.getNbbm())){  
146 - t.setCzcd(dlb.getJzcd());  
147 - fage=false;  
148 - break;  
149 - }  
150 - } 149 +// for (int i = 0; i < dlListBe.size(); i++) {
  150 +// Dlb dlb=dlListBe.get(i);
  151 +// if(map.get("clZbh").toString().equals(dlb.getNbbm())){
  152 +// t.setCzcd(dlb.getJzcd());
  153 +// fage=false;
  154 +// break;
  155 +// }
  156 +// }
151 if(fage){ 157 if(fage){
152 for (int y = 0; y < cdyList.size(); y++) { 158 for (int y = 0; y < cdyList.size(); y++) {
153 Cdl cdl=cdyList.get(y); 159 Cdl cdl=cdyList.get(y);
@@ -391,8 +397,6 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -391,8 +397,6 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
391 397
392 } 398 }
393 } 399 }
394 -  
395 -  
396 } 400 }
397 Double lc= Double.parseDouble(map.get("totalKilometers").toString()); 401 Double lc= Double.parseDouble(map.get("totalKilometers").toString());
398 if(map.get("seqNumber").toString().equals("1")){ 402 if(map.get("seqNumber").toString().equals("1")){
@@ -498,6 +502,15 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -498,6 +502,15 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
498 repository.save(updateList.get(i)); 502 repository.save(updateList.get(i));
499 } 503 }
500 } 504 }
  505 + SysUser user = SecurityUtils.getCurrentUser();
  506 + Nylog nylog=new Nylog();
  507 + nylog.setCreatedate(new Date());
  508 + nylog.setCzmc("获取");
  509 + nylog.setNylx("电");
  510 + nylog.setUserid(user.getUserName());
  511 + nylog.setUsername(user.getName());
  512 + nylog.setCxtj(line+"-"+ date+"-"+gsbm+"-"+fgsbm);
  513 + nylogRepository.save(nylog);
501 newMap.put("status", ResponseCode.SUCCESS); 514 newMap.put("status", ResponseCode.SUCCESS);
502 } catch (Exception e) { 515 } catch (Exception e) {
503 // TODO Auto-generated catch block 516 // TODO Auto-generated catch block
@@ -576,57 +589,56 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -576,57 +589,56 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
576 if(map.get("nbbm_eq")!=null){ 589 if(map.get("nbbm_eq")!=null){
577 nbbm=map.get("nbbm_eq").toString(); 590 nbbm=map.get("nbbm_eq").toString();
578 } 591 }
579 - List<Dlb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm);  
580 -// List<Cdl> cylList=cdlRepository.obtainCdl(nbbm, gsbm);  
581 - List<Dlb> ylbList=repository.obtainDl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm");  
582 - List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,1,gsbm);  
583 - for (int i = 0; i < ylxxbList.size(); i++) {  
584 - Boolean fage=true;  
585 - Ylxxb y1=ylxxbList.get(i);  
586 - for(int y=0;y<ylbList.size();y++){  
587 - Dlb y2=ylbList.get(y);  
588 - if(y1.getNbbm().equals(y2.getNbbm())){  
589 - fage=false;  
590 - break;  
591 - } 592 +
  593 + String sql="select * from bsth_c_jdl j where j.gs_bm ='"+gsbm+"' "
  594 + + " and j.fgs_bm ='"+fgsbm+"' and rq ='"+rq+"' "
  595 + + "and nbbm not in (select nbbm from bsth_c_dlb d"
  596 + + " where ssgsdm ='"+gsbm+"' and fgsdm ='"+fgsbm+"'"
  597 + + " and rq='"+rq+"')";
  598 + List<Jdl> listJdl=jdbcTemplate.query(sql,
  599 + new RowMapper<Jdl>(){
  600 + @Override
  601 + public Jdl mapRow(ResultSet rs, int rowNum) throws SQLException {
  602 + Jdl s = new Jdl();
  603 + s.setNbbm(rs.getString("nbbm"));
  604 + s.setGsBm(rs.getString("gs_bm"));
  605 + s.setFgsBm(rs.getString("fgs_bm"));
  606 + s.setJdl(rs.getDouble("jdl"));
  607 + s.setRq(rs.getDate("rq"));
  608 + return s;
592 } 609 }
593 -  
594 - if(fage){  
595 - Dlb t=new Dlb();  
596 - t.setNbbm(y1.getNbbm());  
597 - t.setRq(y1.getYyrq());  
598 - t.setJsy(y1.getJsy());  
599 - t.setCdl(y1.getJzl());  
600 - t.setSsgsdm(y1.getGsdm());  
601 - String fgsdm="";  
602 - if(null!=carsMap.get(y1.getNbbm())){  
603 - fgsdm=carsMap.get(y1.getNbbm());  
604 - }  
605 - t.setFgsdm(fgsdm); 610 + });
  611 + for (int i = 0; i < listJdl.size(); i++) {
  612 + Jdl j=listJdl.get(i);
  613 + Dlb t=new Dlb();
  614 + Line line= BasicData.nbbm2LineMap.get(j.getNbbm());
  615 + if(null !=line){
  616 + t.setCdl(j.getJdl());
  617 + t.setNbbm(j.getNbbm());
  618 + t.setRq(j.getRq());
  619 + t.setJsy("");
  620 + t.setCdl(j.getJdl());
  621 + t.setSsgsdm(j.getGsBm());
  622 + t.setFgsdm(j.getFgsBm());
  623 + t.setJzcd(100.0);
  624 + t.setCzcd(100.0);
  625 + t.setHd(0.0);
606 t.setJcsx(1); 626 t.setJcsx(1);
607 - Line line= BasicData.nbbm2LineMap.get(y1.getNbbm());  
608 - if(null !=line){  
609 - t.setXlbm(line.getLineCode());  
610 - boolean status=true;  
611 - for (int j = 0; j < ylListBe.size(); j++) {  
612 - Dlb b=ylListBe.get(j);  
613 - if(b.getNbbm().equals(y1.getNbbm())){  
614 - t.setCzcd(b.getJzcd());  
615 - status=false;  
616 - break;  
617 - }  
618 - }  
619 - if(status){  
620 - t.setCzcd(0.0);  
621 - }  
622 - t.setJzcd(100.0);  
623 - t.setHd(0.0);  
624 - if(fgsdm.equals(fgsbm)){  
625 - repository.save(t);  
626 - }  
627 - } 627 + t.setXlbm(line.getLineCode());
  628 + t.setLp("");
  629 + repository.save(t);
628 } 630 }
629 } 631 }
  632 +
  633 + SysUser user = SecurityUtils.getCurrentUser();
  634 + Nylog nylog=new Nylog();
  635 + nylog.setCreatedate(new Date());
  636 + nylog.setCzmc("核对");
  637 + nylog.setNylx("电");
  638 + nylog.setUserid(user.getUserName());
  639 + nylog.setUsername(user.getName());
  640 + nylog.setCxtj(xlbm+"-"+ rq+"-"+gsbm+"-"+fgsbm);
  641 + nylogRepository.save(nylog);
630 newMap.put("status", ResponseCode.SUCCESS); 642 newMap.put("status", ResponseCode.SUCCESS);
631 }catch(Exception e){ 643 }catch(Exception e){
632 newMap.put("status", ResponseCode.ERROR); 644 newMap.put("status", ResponseCode.ERROR);
@@ -840,6 +852,16 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -840,6 +852,16 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
840 repository.dlbUpdate(id, czcd, jzcd, hd, sh, shyy, yhlx); 852 repository.dlbUpdate(id, czcd, jzcd, hd, sh, shyy, yhlx);
841 853
842 } 854 }
  855 +
  856 + SysUser user = SecurityUtils.getCurrentUser();
  857 + Nylog nylog=new Nylog();
  858 + nylog.setCreatedate(new Date());
  859 + nylog.setCzmc("保存全部");
  860 + nylog.setNylx("电");
  861 + nylog.setUserid(user.getUserName());
  862 + nylog.setUsername(user.getName());
  863 + nylog.setCxtj("");
  864 + nylogRepository.save(nylog);
843 newMap.put("status", ResponseCode.SUCCESS); 865 newMap.put("status", ResponseCode.SUCCESS);
844 }catch(Exception e){ 866 }catch(Exception e){
845 newMap.put("status", ResponseCode.ERROR); 867 newMap.put("status", ResponseCode.ERROR);
@@ -940,6 +962,16 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -940,6 +962,16 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
940 } 962 }
941 t.setJcsx(jcsx); 963 t.setJcsx(jcsx);
942 repository.save(t); 964 repository.save(t);
  965 +
  966 + SysUser user = SecurityUtils.getCurrentUser();
  967 + Nylog nylog=new Nylog();
  968 + nylog.setCreatedate(new Date());
  969 + nylog.setCzmc("手动添加");
  970 + nylog.setNylx("电");
  971 + nylog.setUserid(user.getUserName());
  972 + nylog.setUsername(user.getName());
  973 + nylog.setCxtj("");
  974 + nylogRepository.save(nylog);
943 map.put("status", ResponseCode.SUCCESS); 975 map.put("status", ResponseCode.SUCCESS);
944 map.put("t", t); 976 map.put("t", t);
945 return map; 977 return map;
@@ -959,6 +991,16 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -959,6 +991,16 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
959 Integer id =jsonObject.getInteger("id"); 991 Integer id =jsonObject.getInteger("id");
960 repository.delete(id); 992 repository.delete(id);
961 } 993 }
  994 +
  995 + SysUser user = SecurityUtils.getCurrentUser();
  996 + Nylog nylog=new Nylog();
  997 + nylog.setCreatedate(new Date());
  998 + nylog.setCzmc("删除");
  999 + nylog.setNylx("电");
  1000 + nylog.setUserid(user.getUserName());
  1001 + nylog.setUsername(user.getName());
  1002 + nylog.setCxtj("");
  1003 + nylogRepository.save(nylog);
962 maps.put("status", ResponseCode.SUCCESS); 1004 maps.put("status", ResponseCode.SUCCESS);
963 } catch (Exception e) { 1005 } catch (Exception e) {
964 maps.put("status", ResponseCode.ERROR); 1006 maps.put("status", ResponseCode.ERROR);
@@ -983,17 +1025,22 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -983,17 +1025,22 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
983 for (int j = 0; j < dlbList.size(); j++) { 1025 for (int j = 0; j < dlbList.size(); j++) {
984 Dlb t=dlbList.get(j); 1026 Dlb t=dlbList.get(j);
985 boolean fage=true; 1027 boolean fage=true;
986 - for (int i = 0; i < listpbDc.size(); i++) {  
987 - Map<String, Object> m = listpbDc.get(i);  
988 - if(t.getNbbm().equals(m.get("clZbh").toString())  
989 - &&t.getJsy().equals(m.get("jGh").toString())  
990 - &&t.getXlbm().equals(m.get("xlBm").toString())  
991 - &&t.getLp().equals(m.get("lpName").toString())){  
992 - //该条记录不用删除  
993 - fage =false;  
994 - dlbList_upd.add(t); 1028 + if(t.getLp().isEmpty()){
  1029 + fage=false;
  1030 + }else{
  1031 + for (int i = 0; i < listpbDc.size(); i++) {
  1032 + Map<String, Object> m = listpbDc.get(i);
  1033 + if(t.getNbbm().equals(m.get("clZbh").toString())
  1034 + &&t.getJsy().equals(m.get("jGh").toString())
  1035 + &&t.getXlbm().equals(m.get("xlBm").toString())
  1036 + &&t.getLp().equals(m.get("lpName").toString())){
  1037 + //该条记录不用删除
  1038 + fage =false;
  1039 + dlbList_upd.add(t);
  1040 + }
995 } 1041 }
996 } 1042 }
  1043 +
997 if(fage){ 1044 if(fage){
998 dlbList_del.add(t); 1045 dlbList_del.add(t);
999 } 1046 }
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -34,15 +34,19 @@ import com.bsth.entity.Line; @@ -34,15 +34,19 @@ import com.bsth.entity.Line;
34 import com.bsth.entity.mcy_forms.Daily; 34 import com.bsth.entity.mcy_forms.Daily;
35 import com.bsth.entity.oil.Cyl; 35 import com.bsth.entity.oil.Cyl;
36 import com.bsth.entity.oil.Dlb; 36 import com.bsth.entity.oil.Dlb;
  37 +import com.bsth.entity.oil.Nylog;
37 import com.bsth.entity.oil.Ylb; 38 import com.bsth.entity.oil.Ylb;
38 import com.bsth.entity.oil.Ylxxb; 39 import com.bsth.entity.oil.Ylxxb;
39 import com.bsth.entity.search.CustomerSpecs; 40 import com.bsth.entity.search.CustomerSpecs;
  41 +import com.bsth.entity.sys.SysUser;
40 import com.bsth.repository.CarsRepository; 42 import com.bsth.repository.CarsRepository;
41 import com.bsth.repository.LineRepository; 43 import com.bsth.repository.LineRepository;
42 import com.bsth.repository.oil.CylRepository; 44 import com.bsth.repository.oil.CylRepository;
43 import com.bsth.repository.oil.DlbRepository; 45 import com.bsth.repository.oil.DlbRepository;
  46 +import com.bsth.repository.oil.NylogRepository;
44 import com.bsth.repository.oil.YlbRepository; 47 import com.bsth.repository.oil.YlbRepository;
45 import com.bsth.repository.oil.YlxxbRepository; 48 import com.bsth.repository.oil.YlxxbRepository;
  49 +import com.bsth.security.util.SecurityUtils;
46 import com.bsth.service.impl.BaseServiceImpl; 50 import com.bsth.service.impl.BaseServiceImpl;
47 import com.bsth.service.oil.DlbService; 51 import com.bsth.service.oil.DlbService;
48 import com.bsth.service.oil.YlbService; 52 import com.bsth.service.oil.YlbService;
@@ -58,7 +62,8 @@ import javassist.bytecode.stackmap.BasicBlock.Catch; @@ -58,7 +62,8 @@ import javassist.bytecode.stackmap.BasicBlock.Catch;
58 public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbService{ 62 public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbService{
59 @Autowired 63 @Autowired
60 YlbRepository repository; 64 YlbRepository repository;
61 - 65 + @Autowired
  66 + NylogRepository nylogRepository;
62 @Autowired 67 @Autowired
63 YlxxbRepository ylxxbRepository; 68 YlxxbRepository ylxxbRepository;
64 69
@@ -203,13 +208,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -203,13 +208,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
203 } 208 }
204 209
205 } 210 }
206 -  
207 -  
208 - } 211 + }
209 212
210 } 213 }
211 if(addList.size()>0){ 214 if(addList.size()>0){
212 try { 215 try {
  216 +
213 new BatchSaveUtils<Ylb>().saveList2(addList, Ylb.class); 217 new BatchSaveUtils<Ylb>().saveList2(addList, Ylb.class);
214 } catch (Exception e) { 218 } catch (Exception e) {
215 // TODO: handle exception 219 // TODO: handle exception
@@ -275,8 +279,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -275,8 +279,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
275 279
276 // 前一天所有车辆最后进场班次信息 280 // 前一天所有车辆最后进场班次信息
277 List<Ylb> ylListBe = this.listByRqJcsx(rq, gsbm, fgsbm, line, nbbm); 281 List<Ylb> ylListBe = this.listByRqJcsx(rq, gsbm, fgsbm, line, nbbm);
278 -// List<Ylb> ylListBe =repository.listMaxRqJcsx(rq, gsbm, fgsbm, line, nbbm);  
279 -  
280 List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm); 282 List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm);
281 283
282 // 从排班表中计算出行驶的总里程 284 // 从排班表中计算出行驶的总里程
@@ -484,6 +486,15 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -484,6 +486,15 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
484 repository.save(updateList.get(i)); 486 repository.save(updateList.get(i));
485 } 487 }
486 } 488 }
  489 + SysUser user = SecurityUtils.getCurrentUser();
  490 + Nylog nylog=new Nylog();
  491 + nylog.setCreatedate(new Date());
  492 + nylog.setCzmc("获取加存油");
  493 + nylog.setNylx("油");
  494 + nylog.setUserid(user.getUserName());
  495 + nylog.setUsername(user.getName());
  496 + nylog.setCxtj(rq+"-"+gsbm+"-"+fgsbm+"-"+line+"-"+nbbm+"-"+sxtj);
  497 + nylogRepository.save(nylog);
487 newMap.put("status", ResponseCode.SUCCESS); 498 newMap.put("status", ResponseCode.SUCCESS);
488 } catch (Exception e) { 499 } catch (Exception e) {
489 // TODO Auto-generated catch block 500 // TODO Auto-generated catch block
@@ -674,6 +685,17 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -674,6 +685,17 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
674 } 685 }
675 } 686 }
676 } 687 }
  688 +
  689 + SysUser user = SecurityUtils.getCurrentUser();
  690 + Nylog nylog=new Nylog();
  691 + nylog.setCreatedate(new Date());
  692 + nylog.setCzmc("进场等于出场");
  693 + nylog.setNylx("油");
  694 + nylog.setUserid(user.getUserName());
  695 + nylog.setUsername(user.getName());
  696 + nylog.setCxtj(rq+"-"+gsbm+"-"+fgsbm+"-"+xlbm+"-"+nbbm+"-"+sxtj);
  697 +
  698 + nylogRepository.save(nylog);
677 } catch (Exception e) { 699 } catch (Exception e) {
678 map2.put("status", ResponseCode.ERROR); 700 map2.put("status", ResponseCode.ERROR);
679 logger.error("save erro.", e); 701 logger.error("save erro.", e);
@@ -825,6 +847,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -825,6 +847,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
825 } 847 }
826 } 848 }
827 } 849 }
  850 +
  851 + SysUser user = SecurityUtils.getCurrentUser();
  852 + Nylog nylog=new Nylog();
  853 + nylog.setCreatedate(new Date());
  854 + nylog.setCzmc("核对加注量");
  855 + nylog.setNylx("油");
  856 + nylog.setUserid(user.getUserName());
  857 + nylog.setUsername(user.getName());
  858 + nylog.setCxtj(rq+"-"+gsbm+"-"+fgsbm+"-"+xlbm+"-"+nbbm+"-");
  859 + nylogRepository.save(nylog);
828 newMap.put("status", ResponseCode.SUCCESS); 860 newMap.put("status", ResponseCode.SUCCESS);
829 }catch(Exception e){ 861 }catch(Exception e){
830 newMap.put("status", ResponseCode.ERROR); 862 newMap.put("status", ResponseCode.ERROR);
@@ -1237,7 +1269,15 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1237,7 +1269,15 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1237 repository.ylbUpdate(id, czyl, jzyl, yh, sh, shyy, ns, rylx,yhlx); 1269 repository.ylbUpdate(id, czyl, jzyl, yh, sh, shyy, ns, rylx,yhlx);
1238 } 1270 }
1239 // List<Map<String, Object>> list=(List<Map<String, Object>>) map.get("ylbList"); 1271 // List<Map<String, Object>> list=(List<Map<String, Object>>) map.get("ylbList");
1240 - 1272 + SysUser user = SecurityUtils.getCurrentUser();
  1273 + Nylog nylog=new Nylog();
  1274 + nylog.setCreatedate(new Date());
  1275 + nylog.setCzmc("保存全部");
  1276 + nylog.setNylx("油");
  1277 + nylog.setUserid(user.getUserName());
  1278 + nylog.setUsername(user.getName());
  1279 + nylog.setCxtj("");
  1280 + nylogRepository.save(nylog);
1241 newMap.put("status", ResponseCode.SUCCESS); 1281 newMap.put("status", ResponseCode.SUCCESS);
1242 }catch(Exception e){ 1282 }catch(Exception e){
1243 newMap.put("status", ResponseCode.ERROR); 1283 newMap.put("status", ResponseCode.ERROR);
@@ -1368,6 +1408,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1368,6 +1408,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1368 } 1408 }
1369 newMap.put("status", ResponseCode.SUCCESS); 1409 newMap.put("status", ResponseCode.SUCCESS);
1370 } 1410 }
  1411 +
  1412 + SysUser user = SecurityUtils.getCurrentUser();
  1413 + Nylog nylog=new Nylog();
  1414 + nylog.setCreatedate(new Date());
  1415 + nylog.setCzmc("拆分");
  1416 + nylog.setNylx("油");
  1417 + nylog.setUserid(user.getUserName());
  1418 + nylog.setUsername(user.getName());
  1419 + nylog.setCxtj("");
  1420 + nylogRepository.save(nylog);
1371 } catch (Exception e) { 1421 } catch (Exception e) {
1372 newMap.put("status", ResponseCode.ERROR); 1422 newMap.put("status", ResponseCode.ERROR);
1373 logger.error("save erro.", e); 1423 logger.error("save erro.", e);
@@ -1426,6 +1476,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1426,6 +1476,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1426 } 1476 }
1427 t.setJcsx(jcsx); 1477 t.setJcsx(jcsx);
1428 repository.save(t); 1478 repository.save(t);
  1479 +
  1480 + SysUser user = SecurityUtils.getCurrentUser();
  1481 + Nylog nylog=new Nylog();
  1482 + nylog.setCreatedate(new Date());
  1483 + nylog.setCzmc("手动添加");
  1484 + nylog.setNylx("油");
  1485 + nylog.setUserid(user.getUserName());
  1486 + nylog.setUsername(user.getName());
  1487 + nylog.setCxtj("");
  1488 + nylogRepository.save(nylog);
1429 map.put("status", ResponseCode.SUCCESS); 1489 map.put("status", ResponseCode.SUCCESS);
1430 map.put("t", t); 1490 map.put("t", t);
1431 return map; 1491 return map;
@@ -1444,6 +1504,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1444,6 +1504,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1444 Integer id =jsonObject.getInteger("id"); 1504 Integer id =jsonObject.getInteger("id");
1445 repository.delete(id); 1505 repository.delete(id);
1446 } 1506 }
  1507 +
  1508 + SysUser user = SecurityUtils.getCurrentUser();
  1509 + Nylog nylog=new Nylog();
  1510 + nylog.setCreatedate(new Date());
  1511 + nylog.setCzmc("删除");
  1512 + nylog.setNylx("油");
  1513 + nylog.setUserid(user.getUserName());
  1514 + nylog.setUsername(user.getName());
  1515 + nylog.setCxtj("");
  1516 + nylogRepository.save(nylog);
1447 maps.put("status", ResponseCode.SUCCESS); 1517 maps.put("status", ResponseCode.SUCCESS);
1448 } catch (Exception e) { 1518 } catch (Exception e) {
1449 maps.put("status", ResponseCode.ERROR); 1519 maps.put("status", ResponseCode.ERROR);
@@ -1545,15 +1615,19 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1545,15 +1615,19 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1545 for (int j = 0; j < ylbList.size(); j++) { 1615 for (int j = 0; j < ylbList.size(); j++) {
1546 Ylb t=ylbList.get(j); 1616 Ylb t=ylbList.get(j);
1547 boolean fage=true; 1617 boolean fage=true;
1548 - for (int i = 0; i < listpbYc.size(); i++) {  
1549 - Map<String, Object> m = listpbYc.get(i);  
1550 - if(t.getNbbm().equals(m.get("clZbh").toString())  
1551 - &&t.getJsy().equals(m.get("jGh").toString())  
1552 - &&t.getXlbm().equals(m.get("xlBm").toString())  
1553 - &&t.getLp().equals(m.get("lpName").toString())){  
1554 - //该条记录不用删除  
1555 - fage =false;  
1556 - ylbList_upd.add(t); 1618 + if(t.getLp().isEmpty()){
  1619 + fage=false;
  1620 + }else{
  1621 + for (int i = 0; i < listpbYc.size(); i++) {
  1622 + Map<String, Object> m = listpbYc.get(i);
  1623 + if(t.getNbbm().equals(m.get("clZbh").toString())
  1624 + &&t.getJsy().equals(m.get("jGh").toString())
  1625 + &&t.getXlbm().equals(m.get("xlBm").toString())
  1626 + &&t.getLp().equals(m.get("lpName").toString())){
  1627 + //该条记录不用删除
  1628 + fage =false;
  1629 + ylbList_upd.add(t);
  1630 + }
1557 } 1631 }
1558 } 1632 }
1559 if(fage){ 1633 if(fage){
@@ -1582,43 +1656,45 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1582,43 +1656,45 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1582 type = "update"; 1656 type = "update";
1583 } 1657 }
1584 } 1658 }
1585 - // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量  
1586 - if (maps.get("seqNumber").toString().equals("1")) {  
1587 - boolean fage = true;  
1588 - for (int i = 0; i < ylListBe.size(); i++) {  
1589 - Ylb ylb = ylListBe.get(i);  
1590 - if (maps.get("clZbh").toString().equals(ylb.getNbbm())) {  
1591 - if(ylb.getJzyl()>0){  
1592 - t.setCzyl(ylb.getJzyl());  
1593 - fage = false;  
1594 - break; 1659 + if(type.equals("add")){
  1660 + // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
  1661 + if (maps.get("seqNumber").toString().equals("1")) {
  1662 + boolean fage = true;
  1663 + for (int i = 0; i < ylListBe.size(); i++) {
  1664 + Ylb ylb = ylListBe.get(i);
  1665 + if (maps.get("clZbh").toString().equals(ylb.getNbbm())) {
  1666 + if(ylb.getJzyl()>0){
  1667 + t.setCzyl(ylb.getJzyl());
  1668 + fage = false;
  1669 + break;
  1670 + }
1595 } 1671 }
1596 } 1672 }
1597 - }  
1598 - if (fage) {  
1599 - for (int y = 0; y < clyList.size(); y++) {  
1600 - Cyl cyl = clyList.get(y);  
1601 - if (maps.get("clZbh").toString().equals(cyl.getNbbm())) {  
1602 - if(cyl!=null){  
1603 - if(cyl.getCyl()>=0){  
1604 - t.setCzyl(cyl.getCyl());  
1605 - fage = false;  
1606 - break;  
1607 - }else {  
1608 - if(cyl.getCxrl()!=null){  
1609 - if(cyl.getCxrl()>0){  
1610 - t.setCzyl(cyl.getCxrl());  
1611 - fage = false;  
1612 - break; 1673 + if (fage) {
  1674 + for (int y = 0; y < clyList.size(); y++) {
  1675 + Cyl cyl = clyList.get(y);
  1676 + if (maps.get("clZbh").toString().equals(cyl.getNbbm())) {
  1677 + if(cyl!=null){
  1678 + if(cyl.getCyl()>=0){
  1679 + t.setCzyl(cyl.getCyl());
  1680 + fage = false;
  1681 + break;
  1682 + }else {
  1683 + if(cyl.getCxrl()!=null){
  1684 + if(cyl.getCxrl()>0){
  1685 + t.setCzyl(cyl.getCxrl());
  1686 + fage = false;
  1687 + break;
  1688 + }
1613 } 1689 }
1614 } 1690 }
1615 } 1691 }
1616 } 1692 }
1617 } 1693 }
1618 } 1694 }
1619 - }  
1620 - if (fage) {  
1621 - t.setCzyl(0.0); 1695 + if (fage) {
  1696 + t.setCzyl(0.0);
  1697 + }
1622 } 1698 }
1623 } 1699 }
1624 1700
@@ -1631,7 +1707,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1631,7 +1707,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1631 Ylxxb ylxxb = ylxxList.get(i); 1707 Ylxxb ylxxb = ylxxList.get(i);
1632 if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) 1708 if (maps.get("clZbh").toString().equals(ylxxb.getNbbm())
1633 && maps.get("jGh").toString().equals(ylxxb.getJsy()) 1709 && maps.get("jGh").toString().equals(ylxxb.getJsy())
1634 - && ylxxb.getJylx()>0) { 1710 + && ylxxb.getJylx()==1) {
1635 if(ylxxb.getJzl()>0){ 1711 if(ylxxb.getJzl()>0){
1636 fage2=true; 1712 fage2=true;
1637 } 1713 }
@@ -1644,7 +1720,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1644,7 +1720,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1644 Ylxxb ylxxb = ylxxList.get(j); 1720 Ylxxb ylxxb = ylxxList.get(j);
1645 if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) 1721 if (maps.get("clZbh").toString().equals(ylxxb.getNbbm())
1646 && maps.get("jGh").toString().equals(ylxxb.getJsy()) 1722 && maps.get("jGh").toString().equals(ylxxb.getJsy())
1647 - && ylxxb.getJylx()>0) { 1723 + && ylxxb.getJylx()==1) {
1648 jzl =Arith.add(jzl, ylxxb.getJzl()); 1724 jzl =Arith.add(jzl, ylxxb.getJzl());
1649 } 1725 }
1650 } 1726 }
@@ -1806,6 +1882,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1806,6 +1882,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1806 } 1882 }
1807 } 1883 }
1808 //重新获取电耗数据结束 1884 //重新获取电耗数据结束
  1885 +
  1886 + SysUser user = SecurityUtils.getCurrentUser();
  1887 + Nylog nylog=new Nylog();
  1888 + nylog.setCreatedate(new Date());
  1889 + nylog.setCzmc("重新统计");
  1890 + nylog.setNylx("油");
  1891 + nylog.setUserid(user.getUserName());
  1892 + nylog.setUsername(user.getName());
  1893 + nylog.setCxtj(line+"-"+ date+"-"+gsdm+"-"+fgsdm);
  1894 + nylogRepository.save(nylog);
1809 newMap.put("status", ResponseCode.SUCCESS); 1895 newMap.put("status", ResponseCode.SUCCESS);
1810 }catch(Exception e){ 1896 }catch(Exception e){
1811 // TODO Auto-generated catch block 1897 // TODO Auto-generated catch block
@@ -1830,4 +1916,19 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1830,4 +1916,19 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1830 } 1916 }
1831 return list_; 1917 return list_;
1832 } 1918 }
  1919 +
  1920 + @Override
  1921 + public Map<String, Object> update(Map<String, Object> map) {
  1922 + if(map.get("id")!=null){
  1923 + if(map.get("id").toString().length()>0){
  1924 + Integer id=Integer.parseInt(map.get("id").toString());
  1925 + String jsy=map.get("jsy").toString();
  1926 + Ylb t=repository.findOne(id);
  1927 + t.setJsy(jsy);
  1928 + repository.save(t);
  1929 + map.put("status", ResponseCode.SUCCESS);
  1930 + }
  1931 + }
  1932 + return map;
  1933 + }
1833 } 1934 }
src/main/java/com/bsth/service/report/ReportService.java
@@ -46,6 +46,8 @@ public interface ReportService { @@ -46,6 +46,8 @@ public interface ReportService {
46 List<Map<String, String>> userList(Map<String, Object> map); 46 List<Map<String, String>> userList(Map<String, Object> map);
47 47
48 List<Map<String, Object>> countByList(Map<String, Object> map); 48 List<Map<String, Object>> countByList(Map<String, Object> map);
  49 + List<Map<String, Object>> countByList2(Map<String, Object> map);
  50 +
49 51
50 List<Map<String, Object>> countByBusList(Map<String, Object> map); 52 List<Map<String, Object>> countByBusList(Map<String, Object> map);
51 53
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
@@ -1198,7 +1198,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -1198,7 +1198,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
1198 Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); 1198 Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
1199 while (it.hasNext()) { 1199 while (it.hasNext()) {
1200 ChildTaskPlan childTaskPlan = it.next(); 1200 ChildTaskPlan childTaskPlan = it.next();
1201 - if(item.equals("空放")){ 1201 +// if(item.equals("空放")){
1202 /*if(childTaskPlan.getType2().equals("1")){ 1202 /*if(childTaskPlan.getType2().equals("1")){
1203 if (!childTaskPlan.isDestroy()) { 1203 if (!childTaskPlan.isDestroy()) {
1204 if(childTaskPlan.getReason().equals(item)){ 1204 if(childTaskPlan.getReason().equals(item)){
@@ -1206,7 +1206,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -1206,7 +1206,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
1206 } 1206 }
1207 } 1207 }
1208 }*/ 1208 }*/
1209 - }else{ 1209 +// }else{
1210 if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){ 1210 if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){
1211 if (!childTaskPlan.isDestroy()) { 1211 if (!childTaskPlan.isDestroy()) {
1212 if(childTaskPlan.getReason().equals(item)){ 1212 if(childTaskPlan.getReason().equals(item)){
@@ -1214,7 +1214,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -1214,7 +1214,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
1214 } 1214 }
1215 } 1215 }
1216 } 1216 }
1217 - } 1217 +// }
1218 } 1218 }
1219 } 1219 }
1220 } 1220 }
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -2546,6 +2546,111 @@ public class ReportServiceImpl implements ReportService{ @@ -2546,6 +2546,111 @@ public class ReportServiceImpl implements ReportService{
2546 } 2546 }
2547 2547
2548 2548
  2549 + @Override
  2550 + public List<Map<String, Object>> countByList2(Map<String, Object> map) {
  2551 + // TODO Auto-generated method stub
  2552 +
  2553 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  2554 + String gsdm="";
  2555 + if(map.get("gsdm")!=null){
  2556 + gsdm=map.get("gsdm").toString();
  2557 + }
  2558 + String fgsdm="";
  2559 + if(map.get("fgsdm")!=null){
  2560 + fgsdm=map.get("fgsdm").toString();
  2561 + }
  2562 + String line="";
  2563 + if(map.get("line")!=null){
  2564 + line=map.get("line").toString();
  2565 + }
  2566 + String date="";
  2567 + if(map.get("date")!=null){
  2568 + date=map.get("date").toString();
  2569 + }
  2570 + String date2="";
  2571 + if(map.get("date2")!=null){
  2572 + date2=map.get("date2").toString();
  2573 + }
  2574 + String xlName="";
  2575 + if(map.get("xlName")!=null){
  2576 + xlName=map.get("xlName").toString();
  2577 + }
  2578 + String type="";
  2579 + if(map.get("type")!=null){
  2580 + type=map.get("type").toString();
  2581 + }
  2582 + //所有班次信息
  2583 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  2584 + line =line.trim();
  2585 + List<Line> lineList=lineRepository.findLineBygsBm(gsdm, fgsdm, "");
  2586 +// if(line.equals("")){
  2587 +// //查询所有线路
  2588 +// list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
  2589 +// }else{
  2590 + //查询单条线路
  2591 +// list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
  2592 +// }
  2593 +
  2594 +
  2595 + String sql="select r.xl_bm"
  2596 + + " from bsth_c_s_sp_info_real r where"
  2597 + + " r.schedule_date_str >= '"+date+"' and r.schedule_date_str >= '"+date2+"'";
  2598 +
  2599 +
  2600 + if(line.equals("")){
  2601 + sql +="and r.gs_bm='"+gsdm+"' "
  2602 + + " and r.fgs_bm='"+fgsdm+"'";
  2603 + }else{
  2604 + sql += " and r.xl_bm = '"+line+"'";
  2605 + }
  2606 + sql += " group by r.xl_bm";
  2607 +
  2608 + List<String> listLine=jdbcTemplate.query(sql, new RowMapper<String>() {
  2609 + @Override
  2610 + public String mapRow(ResultSet arg0, int arg1) throws SQLException {
  2611 + String ve = arg0.getString("xl_bm");
  2612 + return ve;
  2613 + }
  2614 + });
  2615 + for (int i = 0; i < listLine.size(); i++) {
  2616 + List<ScheduleRealInfo> lists =scheduleRealInfoRepository.scheduleByDateAndLineTj2(listLine.get(i), date,date2);
  2617 + list.addAll(lists);
  2618 + //计算线路的各项公里
  2619 + if(lists.size()>0){
  2620 + Map<String, Object> newMap=staticTj(lists,"z");
  2621 + lMap.add(newMap);
  2622 + }
  2623 + }
  2624 + if(list.size()>0){
  2625 + Map<String, Object> newMap=staticTj(list,"f");
  2626 + lMap.add(newMap);
  2627 + }
  2628 + if(type.equals("export")){
  2629 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  2630 + Map<String, Object> m = new HashMap<String, Object>();
  2631 + m.put("date", date);
  2632 + m.put("date1", date2);
  2633 + String by=map.get("by").toString();
  2634 + String xls="";
  2635 + if(by.equals("sj")){
  2636 + xls="countByLine.xls";
  2637 + }else{
  2638 + xls="countByLines.xls";
  2639 + }
  2640 + ReportUtils ee = new ReportUtils();
  2641 + try {
  2642 + listI.add(lMap.iterator());
  2643 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  2644 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  2645 + path + "export/线路公里统计表.xls");
  2646 + } catch (Exception e) {
  2647 + // TODO: handle exception
  2648 + e.printStackTrace();
  2649 + }
  2650 + }
  2651 + return lMap;
  2652 + }
  2653 +
2549 public final Map<String, Object> staticTj(List<ScheduleRealInfo> list,String status){ 2654 public final Map<String, Object> staticTj(List<ScheduleRealInfo> list,String status){
2550 2655
2551 List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); 2656 List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
src/main/java/com/bsth/service/schedule/impl/CarsServiceImpl.java
@@ -89,6 +89,7 @@ public class CarsServiceImpl extends BServiceImpl&lt;Cars, Integer&gt; implements Cars @@ -89,6 +89,7 @@ public class CarsServiceImpl extends BServiceImpl&lt;Cars, Integer&gt; implements Cars
89 if (cars.getId() != null) { 89 if (cars.getId() != null) {
90 param.put("id_ne", cars.getId()); 90 param.put("id_ne", cars.getId());
91 } 91 }
  92 + param.put("scrapState_eq", false);
92 param.put("equipmentCode_eq", cars.getEquipmentCode()); 93 param.put("equipmentCode_eq", cars.getEquipmentCode());
93 if (!CollectionUtils.isEmpty(list(param))) { 94 if (!CollectionUtils.isEmpty(list(param))) {
94 throw new ScheduleException("设备编号重复"); 95 throw new ScheduleException("设备编号重复");
src/main/resources/static/pages/base/timesmodel/js/v2/ParameterObj.js
@@ -895,7 +895,7 @@ var ParameterObj = function() { @@ -895,7 +895,7 @@ var ParameterObj = function() {
895 }, 895 },
896 896
897 /** 897 /**
898 - * 获取固定的停站时间(固定停站时间都是选的最大值 898 + * 获取固定的停站时间(固定停站时间都是选的最大值,非平均停站
899 * @param oTimeObj 时间对象 899 * @param oTimeObj 时间对象
900 * @param bIsUp 是否上行 900 * @param bIsUp 是否上行
901 * @param iXXTime 行驶时间 901 * @param iXXTime 行驶时间
@@ -1082,6 +1082,85 @@ var ParameterObj = function() { @@ -1082,6 +1082,85 @@ var ParameterObj = function() {
1082 }, 1082 },
1083 1083
1084 /** 1084 /**
  1085 + * 获取固定的停站时间(固定停站时间都是选的最小值,非平均停站)
  1086 + * @param oTimeObj 时间对象
  1087 + * @param bIsUp 是否上行
  1088 + * @returns int 停站时间
  1089 + */
  1090 + fnCalcuFixedMinStopNumber: function(oTimeObj, bIsUp) {
  1091 + _validInternal(); // 验证
  1092 + var oParam = this;
  1093 +
  1094 + // 双向停站
  1095 + if (oParam.isTwoWayStop()) {
  1096 + if (bIsUp) { // 上行
  1097 + if (this.isMPeakBc(oTimeObj)) { // 早高峰
  1098 + return 3;
  1099 + } else if (this.isEPeakBc(oTimeObj)) { // 晚高峰
  1100 + return 3;
  1101 + } else { // 低谷
  1102 + if (this.isTroughBeforMPeakStartBc(oTimeObj)) { // 早高峰开始前
  1103 + return 10;
  1104 + } else if (this.isTroughAfterEPeakEndBc(oTimeObj)) { // 晚高峰结束后
  1105 + return 10;
  1106 + } else { // 早高峰,晚高峰之间
  1107 + return 10;
  1108 + }
  1109 + }
  1110 +
  1111 + } else { // 下行
  1112 + if (this.isMPeakBc(oTimeObj)) { // 早高峰
  1113 + return 3;
  1114 + } else if (this.isEPeakBc(oTimeObj)) { // 晚高峰
  1115 + return 3;
  1116 + } else { // 低谷
  1117 + if (this.isTroughBeforMPeakStartBc(oTimeObj)) { // 早高峰开始前
  1118 + return 10;
  1119 + } else if (this.isTroughAfterEPeakEndBc(oTimeObj)) { // 晚高峰结束后
  1120 + return 10;
  1121 + } else { // 早高峰,晚高峰之间
  1122 + return 10;
  1123 + }
  1124 + }
  1125 + }
  1126 + } else { // 主站停站
  1127 + if (bIsUp == oParam.isUpOneWayStop()) {
  1128 + if (bIsUp) { // 上行
  1129 + if (this.isMPeakBc(oTimeObj)) { // 早高峰
  1130 + return 2;
  1131 + } else if (this.isEPeakBc(oTimeObj)) { // 晚高峰
  1132 + return 2;
  1133 + } else { // 低谷
  1134 + if (this.isTroughBeforMPeakStartBc(oTimeObj)) { // 早高峰开始前
  1135 + return 10;
  1136 + } else if (this.isTroughAfterEPeakEndBc(oTimeObj)) { // 晚高峰结束后
  1137 + return 10;
  1138 + } else { // 早高峰,晚高峰之间
  1139 + return 10;
  1140 + }
  1141 + }
  1142 + } else { // 下行
  1143 + if (this.isMPeakBc(oTimeObj)) { // 早高峰
  1144 + return 2;
  1145 + } else if (this.isEPeakBc(oTimeObj)) { // 晚高峰
  1146 + return 2;
  1147 + } else { // 低谷
  1148 + if (this.isTroughBeforMPeakStartBc(oTimeObj)) { // 早高峰开始前
  1149 + return 10;
  1150 + } else if (this.isTroughAfterEPeakEndBc(oTimeObj)) { // 晚高峰结束后
  1151 + return 10;
  1152 + } else { // 早高峰,晚高峰之间
  1153 + return 10;
  1154 + }
  1155 + }
  1156 + }
  1157 + } else { // 副站停战,2到3分钟
  1158 + return 2;
  1159 + }
  1160 + }
  1161 + },
  1162 +
  1163 + /**
1085 * 获取行驶时间。 1164 * 获取行驶时间。
1086 * @param timeObj 班次时间字符串 1165 * @param timeObj 班次时间字符串
1087 * @param isUp 是否上行 1166 * @param isUp 是否上行
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalBcObj.js
@@ -32,6 +32,7 @@ var InternalBcObj = function( @@ -32,6 +32,7 @@ var InternalBcObj = function(
32 this._$_bcsj = otherParamObj.bcsj; // 班次历时 32 this._$_bcsj = otherParamObj.bcsj; // 班次历时
33 this._$_arrtime = otherParamObj.arrtime; // 到达时间对象 33 this._$_arrtime = otherParamObj.arrtime; // 到达时间对象
34 this._$_stoptime = otherParamObj.stoptime; // 停站时间 34 this._$_stoptime = otherParamObj.stoptime; // 停站时间
  35 + this._$_iEatTime = 0; // 吃饭时间
35 this._$_tccid = otherParamObj.tccid; // 停车场id 36 this._$_tccid = otherParamObj.tccid; // 停车场id
36 this._$_ttinfoid = otherParamObj.ttinfoid; // 时刻表id 37 this._$_ttinfoid = otherParamObj.ttinfoid; // 时刻表id
37 this._$_xlid = otherParamObj.xl; // 线路id 38 this._$_xlid = otherParamObj.xl; // 线路id
@@ -45,6 +46,13 @@ var InternalBcObj = function( @@ -45,6 +46,13 @@ var InternalBcObj = function(
45 46
46 //------------------- get/set 方法 -------------------// 47 //------------------- get/set 方法 -------------------//
47 48
  49 +InternalBcObj.prototype.fnSetEatTime = function(iTime) {
  50 + this._$_iEatTime = iTime;
  51 +};
  52 +InternalBcObj.prototype.fnGetEatTime = function() {
  53 + return this._$_iEatTime;
  54 +};
  55 +
48 InternalBcObj.prototype.fnSetDelFlag = function(bFlag) { 56 InternalBcObj.prototype.fnSetDelFlag = function(bFlag) {
49 this._$_bDelFlag = bFlag; 57 this._$_bDelFlag = bFlag;
50 }; 58 };
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalLpObj.js
@@ -584,10 +584,10 @@ InternalLpObj.prototype.initDataFromTimeToTime = function( @@ -584,10 +584,10 @@ InternalLpObj.prototype.initDataFromTimeToTime = function(
584 //console.log("last;" + bcData[bcCount -1].getFcTimeObj().format("HH:mm")); 584 //console.log("last;" + bcData[bcCount -1].getFcTimeObj().format("HH:mm"));
585 //console.log("endtime: " + endTime.format("HH:mm")); 585 //console.log("endtime: " + endTime.format("HH:mm"));
586 586
587 - if (bcCount > 0 && bcData[bcCount - 1].getArrTimeObj().isAfter(endTime)) {  
588 - // 如果最后一个班次的到达时间超过结束时间,也要去除  
589 - bcData.splice(bcCount - 1, 1);  
590 - } 587 + //if (bcCount > 0 && bcData[bcCount - 1].getArrTimeObj().isAfter(endTime)) {
  588 + // // 如果最后一个班次的到达时间超过结束时间,也要去除
  589 + // bcData.splice(bcCount - 1, 1);
  590 + //}
591 591
592 this._initDataFromLbBcArray(bcData, fromQ); 592 this._initDataFromLbBcArray(bcData, fromQ);
593 593
@@ -738,7 +738,7 @@ InternalLpObj.prototype.fnAddEatBc = function(groupIndex, bcIndex, factory, para @@ -738,7 +738,7 @@ InternalLpObj.prototype.fnAddEatBc = function(groupIndex, bcIndex, factory, para
738 "cf", 738 "cf",
739 !oPreBc.isUp(), // 和上一个班次方向相反 739 !oPreBc.isUp(), // 和上一个班次方向相反
740 1, 740 1,
741 - oPreBc.getArrTimeObj(), // 使用上一个班次的到达时间作为开始时间 741 + paramObj.addMinute(oPreBc.getArrTimeObj(), oPreBc.getStopTime()), // 使用上一个班次的到达时间作为开始时间
742 paramObj 742 paramObj
743 ); 743 );
744 744
@@ -749,8 +749,10 @@ InternalLpObj.prototype.fnAddEatBc = function(groupIndex, bcIndex, factory, para @@ -749,8 +749,10 @@ InternalLpObj.prototype.fnAddEatBc = function(groupIndex, bcIndex, factory, para
749 iBcModifyTime = oEatBc.getArrTimeObj().diff(this.getBc(groupIndex, bcIndex).getFcTimeObj(), "m"); 749 iBcModifyTime = oEatBc.getArrTimeObj().diff(this.getBc(groupIndex, bcIndex).getFcTimeObj(), "m");
750 this.fnAddMinuteToBcFcsj(groupIndex, bcIndex, iBcModifyTime); 750 this.fnAddMinuteToBcFcsj(groupIndex, bcIndex, iBcModifyTime);
751 751
752 - oPreBc.setStopTime(0);  
753 - this._$_other_bc_array.push(oEatBc); 752 + oPreBc.setStopTime(0); // 不重置停站时间
  753 + oPreBc.fnSetEatTime(oEatBc.getBcTime());
  754 +
  755 + //this._$_other_bc_array.push(oEatBc);
754 756
755 return iBcModifyTime; 757 return iBcModifyTime;
756 } else { 758 } else {
@@ -759,6 +761,69 @@ InternalLpObj.prototype.fnAddEatBc = function(groupIndex, bcIndex, factory, para @@ -759,6 +761,69 @@ InternalLpObj.prototype.fnAddEatBc = function(groupIndex, bcIndex, factory, para
759 761
760 }; 762 };
761 763
  764 +/**
  765 + * 调整路牌的班次,通过调整停站时间,或者班次发车时间,不能让班次的到达时间和下一个班次的发车时间重叠。
  766 + * @param iPeakAverStopTime 高峰平均停站时间
  767 + * @param iTroughAverStopTime 低谷平均停站时间
  768 + * @param oParam 参数对象
  769 + */
  770 +InternalLpObj.prototype.fnAdjustBcInterval = function(iPeakAverStopTime, iTroughAverStopTime, oParam) {
  771 + // 获取车次链个数
  772 + var iBcChainCount = this.fnGetBcChainCount();
  773 +
  774 + var i;
  775 + var j;
  776 + var oBcIndex;
  777 + var iQIndex;
  778 + var iBcIndex;
  779 + var iBcCount;
  780 + var oBc;
  781 + var oNextBc;
  782 +
  783 + var iBcStopTime;
  784 +
  785 + for (i = 0; i < iBcChainCount; i++) {
  786 + oBcIndex = this.fnGetBcChainInfo(i);
  787 + iQIndex = oBcIndex["s_q"];
  788 + iBcIndex = oBcIndex["s_b"];
  789 + iBcCount = oBcIndex["bcount"];
  790 +
  791 + for (j = 0; j < iBcCount - 1; j++) {
  792 + oBc = this.getBc(iQIndex, iBcIndex);
  793 + oNextBc = this.getBc(
  794 + iBcIndex == 0 ? iQIndex : iQIndex + 1,
  795 + iBcIndex == 0 ? 1 : 0);
  796 +
  797 + // 不改变当前班次的行驶时间,修正停站时间和下一个班次的发车时间
  798 + iBcStopTime = oNextBc.getFcTimeObj().diff(oBc.getArrTimeObj(), "m");
  799 + if (iBcStopTime < 0) {
  800 + // 当前班次使用最小停站时间
  801 + oBc.setStopTime(oParam.fnCalcuFixedMinStopNumber(oBc.getArrTimeObj(), oBc.isUp()));
  802 + oNextBc.addMinuteToFcsj(oBc.getStopTime() + oBc.fnGetEatTime() - iBcStopTime);
  803 +
  804 + } else {
  805 + if (iBcStopTime == oBc.getStopTime() + oBc.fnGetEatTime()) {
  806 + // 停站时间一致,没有问题
  807 +
  808 +
  809 + } else {
  810 + // TODO:当前班次使用最小停站时间
  811 + oBc.setStopTime(oParam.fnCalcuFixedMinStopNumber(oBc.getArrTimeObj(), oBc.isUp()));
  812 + oNextBc.addMinuteToFcsj(oBc.getStopTime() + oBc.fnGetEatTime() - iBcStopTime);
  813 +
  814 + }
  815 + }
  816 +
  817 + iBcIndex = iBcIndex == 0 ? 1 : 0;
  818 + iQIndex = iBcIndex == 0 ? iQIndex + 1 : iQIndex;
  819 + }
  820 +
  821 + this.getBc(iQIndex, iBcIndex).setStopTime(0);
  822 + }
  823 +
  824 +
  825 +};
  826 +
762 827
763 // TODO 828 // TODO
764 829
@@ -771,3 +836,8 @@ InternalLpObj.prototype.calcuLpBx = function() { @@ -771,3 +836,8 @@ InternalLpObj.prototype.calcuLpBx = function() {
771 }; 836 };
772 837
773 838
  839 +
  840 +
  841 +
  842 +
  843 +
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalScheduleObj.js
@@ -73,12 +73,12 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -73,12 +73,12 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
73 isUp = !isUp; 73 isUp = !isUp;
74 } while(_kssj.isBefore(et)); 74 } while(_kssj.isBefore(et));
75 bcCount--; // 因为先做do,所以总的班次要减1 75 bcCount--; // 因为先做do,所以总的班次要减1
76 - if (bcCount > 0 && bcArsjArrays[bcCount - 1].isAfter(et)) {  
77 - // 如果最后一个班次的到达时间超过结束时间,也要去除  
78 - bcFcsjArrays.splice(bcCount - 1, 1);  
79 - bcArsjArrays.splice(bcCount - 1, 1);  
80 - bcCount--;  
81 - } 76 + //if (bcCount > 0 && bcArsjArrays[bcCount - 1].isAfter(et)) {
  77 + // // 如果最后一个班次的到达时间超过结束时间,也要去除
  78 + // bcFcsjArrays.splice(bcCount - 1, 1);
  79 + // bcArsjArrays.splice(bcCount - 1, 1);
  80 + // bcCount--;
  81 + //}
82 var _qCount_p1 = Math.floor(bcCount / 2); // 2个班次一圈 82 var _qCount_p1 = Math.floor(bcCount / 2); // 2个班次一圈
83 var _qCount_p2 = bcCount % 2; // 余下的1个班次也算一圈 83 var _qCount_p2 = bcCount % 2; // 余下的1个班次也算一圈
84 84
@@ -119,23 +119,42 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -119,23 +119,42 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
119 if (aBcArray.length % 2 != 0) { // 不能整除2,去除一个班次计算 119 if (aBcArray.length % 2 != 0) { // 不能整除2,去除一个班次计算
120 aBcArray.splice(aBcArray.length - 1, 1); 120 aBcArray.splice(aBcArray.length - 1, 1);
121 } 121 }
122 - var sum = 0;  
123 - // 加吃饭时间  
124 - sum += _paramObj.fnGetLunchTime();  
125 - sum += _paramObj.fnGetDinnerTime();  
126 - // 加进出场时间  
127 - sum += _qIsUp ? _paramObj.getUpOutTime() : _paramObj.getDownOutTime();  
128 - sum += _qIsUp ? _paramObj.getDownInTime() : _paramObj.getUpInTime(); 122 +
  123 + // 午饭吃饭时间
  124 + var iLTime = _paramObj.fnGetLunchTime();
  125 + // 晚饭吃饭时间
  126 + var iDTime = _paramObj.fnGetDinnerTime();
  127 + // 出场时间
  128 + var iOutTime = _qIsUp ? _paramObj.getUpOutTime() : _paramObj.getDownOutTime();
  129 + // 进场时间
  130 + var iInTime = _qIsUp ? _paramObj.getDownInTime() : _paramObj.getUpInTime();
129 // 例保时间 131 // 例保时间
130 - //sum += _paramObj.getLbTime() * 2; 132 + var iBTime = _paramObj.getLbTime();
  133 +
  134 + var sum = 0; // 总班次时间
131 for (i = 0; i < aBcArray.length; i++) { 135 for (i = 0; i < aBcArray.length; i++) {
132 sum += aBcArray[i].getBcTime() + aBcArray[i].getStopTime(); 136 sum += aBcArray[i].getBcTime() + aBcArray[i].getStopTime();
133 } 137 }
  138 + sum += iLTime; // 加午饭时间
  139 + sum += iDTime; // 加晚饭时间
134 for (i = 0; i < _aBxDesc.length; i++) { 140 for (i = 0; i < _aBxDesc.length; i++) {
135 - _aBxDesc[i].fAverTime = sum / (aBcArray.length / 2);  
136 - _aBxDesc[i].fBcCount = ((_aBxDesc[i].fHoursV * 60) / _aBxDesc[i].fAverTime) * 2; 141 + _aBxDesc[i].fAverTime = sum / (aBcArray.length / 2); // 平均周转时间不算进出场,例保时间
  142 +
  143 + // 计算5休2的班次数(双进出场,4个例保)
  144 + if (i == 6) {
  145 + _aBxDesc[i].fQCount =
  146 + (_aBxDesc[i].fHoursV * 60 - iOutTime * 2 - iInTime * 2 - iBTime * 4) /
  147 + _aBxDesc[i].fAverTime;
  148 + _aBxDesc[i].fBcCount = _aBxDesc[i].fQCount * 2;
  149 + } else { // 进出场,2个例保
  150 + _aBxDesc[i].fQCount =
  151 + (_aBxDesc[i].fHoursV * 60 - iOutTime - iInTime - iBTime * 2) /
  152 + _aBxDesc[i].fAverTime;
  153 + _aBxDesc[i].fBcCount = _aBxDesc[i].fQCount * 2;
  154 + }
137 } 155 }
138 156
  157 +
139 // 在第一个班次之前再添加一个模拟班次,用于中标线的作用 158 // 在第一个班次之前再添加一个模拟班次,用于中标线的作用
140 // 那一圈必定是低谷,而且圈索引0,班次索引1,暂时标记,最后删除 159 // 那一圈必定是低谷,而且圈索引0,班次索引1,暂时标记,最后删除
141 var iFirstStopTime = 160 var iFirstStopTime =
@@ -342,9 +361,14 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -342,9 +361,14 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
342 throw "总分班路牌数小于加班路牌数"; 361 throw "总分班路牌数小于加班路牌数";
343 } 362 }
344 363
  364 + //// 修正连班路牌数,班次间隔大于20的,加1,直至班次间隔小于20
  365 + //while(_paramObj.calcuPeakZzsj() / iDgminpc > 20) {
  366 + // iDgminpc ++;
  367 + //}
345 _iBx_lb_lpcount = iDgminpc; 368 _iBx_lb_lpcount = iDgminpc;
  369 +
346 _iBx_5_2_fb_lpcount = i_5_2_lpes; 370 _iBx_5_2_fb_lpcount = i_5_2_lpes;
347 - _iBx_other_fb_lpcount = iCls - iDgminpc - i_5_2_lpes; 371 + _iBx_other_fb_lpcount = iCls - _iBx_lb_lpcount - i_5_2_lpes;
348 372
349 //------------------------ 2、利用间隔法计算连班路牌分布 --------------------// 373 //------------------------ 2、利用间隔法计算连班路牌分布 --------------------//
350 var i; 374 var i;
@@ -401,7 +425,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -401,7 +425,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
401 } 425 }
402 } 426 }
403 427
404 - 428 + console.log("高峰周转时间:" + _paramObj.calcuPeakZzsj());
405 console.log("连班路牌数:" + _iBx_lb_lpcount); 429 console.log("连班路牌数:" + _iBx_lb_lpcount);
406 console.log("5休2分班路牌数:" + _iBx_5_2_fb_lpcount); 430 console.log("5休2分班路牌数:" + _iBx_5_2_fb_lpcount);
407 console.log("其他分班路牌数:" + _iBx_other_fb_lpcount); 431 console.log("其他分班路牌数:" + _iBx_other_fb_lpcount);
@@ -579,72 +603,75 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -579,72 +603,75 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
579 } 603 }
580 }; 604 };
581 605
582 -  
583 /** 606 /**
584 - * 在指定位置生成班次(内部重要方法)。  
585 - * @param lpIndex 第几个路牌  
586 - * @param qIndex 第几圈  
587 - * @param bcIndex 第几个班次  
588 - * @returns InternalBcObj 607 + * 获取班次列表。
  608 + * @param oIsUp 是否上行
  609 + * @param oStartTime 开始时间对象
  610 + * @returns [(InternalBcObj)]
589 */ 611 */
590 - var _generateBc = function(lpIndex, qIndex, bcIndex) {  
591 - // 在初始化布局后使用,否则没有参照班次加不了  
592 - // 初始化布局后,相当于把时刻表比作一个围棋棋盘,行为路牌数,列为圈数  
593 - // 上标线,中标线,早晚高峰已经布局在棋盘上,其余的空格可以创建班次  
594 -  
595 - // 这个生成班次是以上一班次时间,以发车间隔为基础添加的,纵向加  
596 - // 和生成标线时那种一直往后加班次时不一样,那种是以前一个班次为基础,横向加  
597 -  
598 - // 1、生成的班次以同一圈同一个方向里离它最早的班次的发车时间为基础  
599 - // 2、以每个路牌的纵向最小发车间隔时间为计算发车间隔  
600 - // 3、如果班次发车时间越界不管,有其余方法排除这种情况 612 + var _fnGetBcList2 = function(oIsUp, oStartTime) {
  613 + var i;
  614 + var j;
  615 + var oLp;
  616 + var oBc;
  617 + var aBc = [];
601 618
602 - // 1、查找同圈同方向里最近的班次,找不到报错(因为有标线存在是不可能找不到的)  
603 - var _i;  
604 - var _bcObj;  
605 - for (_i = lpIndex - 1; _i >= 0; _i--) {  
606 - _bcObj = _internalLpArray[_i].getBc(qIndex, bcIndex);  
607 - if (_bcObj) {  
608 - break; 619 + for (j = 0; j < _qCount; j++) {
  620 + for (i = 0; i < _internalLpArray.length; i++) {
  621 + oLp = _internalLpArray[i];
  622 + oBc = oLp.getBc(
  623 + j,
  624 + _qIsUp == oIsUp ? 0 : 1
  625 + );
  626 + if (oBc && oBc.getFcTimeObj().isAfter(oStartTime)) {
  627 + aBc.push(oBc);
  628 + }
609 } 629 }
610 } 630 }
611 - if (!_bcObj) {  
612 - return false;  
613 - //alert("无法在指定位置生成班次");  
614 - //throw "无法在路牌index=" + lpIndex + ",圈index=" + qIndex + ",班次index=" + bcIndex + "生成班次";  
615 - }  
616 631
617 - // 2、计算发车间隔  
618 - var _intervalTime = 0;  
619 - for (_i = _i + 1; _i <= lpIndex; _i++) {  
620 - _intervalTime += _internalLpArray[_i].getVerticalMinIntervalTime(); 632 + var aBcFcTime = [];
  633 + for (i = 0; i < aBc.length; i++) {
  634 + oBc = aBc[i];
  635 + aBcFcTime.push(oBc.getFcTimeObj().format("HH:mm"));
621 } 636 }
  637 + console.log((oIsUp ? "上行班次列表:" : "下行班次列表:") + aBcFcTime.join(","));
622 638
623 - // 3、计算班次并添加班次  
624 - var _kssj = _paramObj.addMinute(_bcObj.getFcTimeObj(), _intervalTime);  
625 - _bcObj = _factory.createBcObj(  
626 - _internalLpArray[lpIndex],  
627 - "normal", _bcObj.isUp(),  
628 - 1, _kssj, _paramObj);  
629 - _bcObj.setGroup(_internalLpArray[lpIndex].getGroup(qIndex));  
630 -  
631 - return _bcObj;  
632 -  
633 - // TODO:这种添加班次的方法,可能造成相邻班次的停站时间问题  
634 - // TODO:主要是由于中标线的问题,但是误差不会很大,  
635 - // TODO:后面有方法直接调整停站时间(所谓的平滑过度时间) 639 + return aBc;
636 }; 640 };
637 641
638 /** 642 /**
639 - * 在指定位置生成班次并添加到路牌指定位置中。  
640 - * @param lpIndex 第几个路牌  
641 - * @param qIndex 第几圈  
642 - * @param bcIndex 第几个班次 643 + * 获取班次列表。
  644 + * @param isUp boolean 是否上行
  645 + * @returns [(InternalBcObj)]
643 */ 646 */
644 - var _generateBcAndSetBc = function(lpIndex, qIndex, bcIndex) {  
645 - var _bcObj = _generateBc(lpIndex, qIndex, bcIndex);  
646 - _internalLpArray[lpIndex].setBc(qIndex, bcIndex, _bcObj); 647 + var _fnGetBcList = function(isUp) {
  648 + var i;
  649 + var j;
  650 + var oLp;
  651 + var oBc;
  652 + var aBc = [];
647 653
  654 + for (j = 0; j < _qCount; j++) {
  655 + for (i = 0; i < _internalLpArray.length; i++) {
  656 + oLp = _internalLpArray[i];
  657 + oBc = oLp.getBc(
  658 + j,
  659 + _qIsUp == isUp ? 0 : 1
  660 + );
  661 + if (oBc) {
  662 + aBc.push(oBc);
  663 + }
  664 + }
  665 + }
  666 +
  667 + var aBcFcTime = [];
  668 + for (i = 0; i < aBc.length; i++) {
  669 + oBc = aBc[i];
  670 + aBcFcTime.push(oBc.getFcTimeObj().format("HH:mm"));
  671 + }
  672 + console.log((isUp ? "上行班次列表:" : "下行班次列表:") + aBcFcTime.join(","));
  673 +
  674 + return aBc;
648 }; 675 };
649 676
650 /** 677 /**
@@ -653,9 +680,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -653,9 +680,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
653 * @param isUp 是否上行 680 * @param isUp 是否上行
654 * @returns [{路牌index},{圈index},{班次index}] 681 * @returns [{路牌index},{圈index},{班次index}]
655 */ 682 */
656 - var _findUpClosedBcIndexWithTime = function(timeObj, isUp) {  
657 -  
658 - // dododo 683 + var _fnFindUpClosedBcIndexWithTime = function(timeObj, isUp) {
659 684
660 var _lpObj; 685 var _lpObj;
661 var _groupObj; 686 var _groupObj;
@@ -672,9 +697,9 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -672,9 +697,9 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
672 for (_j = 0; _j < _internalLpArray.length; _j++) { 697 for (_j = 0; _j < _internalLpArray.length; _j++) {
673 _lpObj = _internalLpArray[_j]; 698 _lpObj = _internalLpArray[_j];
674 _groupObj = _lpObj.getGroup(_i); 699 _groupObj = _lpObj.getGroup(_i);
675 - _bcObj = isUp ? _groupObj.getBc1() : _groupObj.getBc2(); 700 + _bcObj = isUp == _qIsUp ? _groupObj.getBc1() : _groupObj.getBc2();
676 if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的 701 if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的
677 - _bcObj = _generateBc(_j, _i, isUp == _qIsUp ? 0 : 1); 702 + _bcObj = _fnGenerateBc(_j, _i, isUp == _qIsUp ? 0 : 1);
678 } 703 }
679 if (_bcObj) { 704 if (_bcObj) {
680 if (timeObj.diff(_bcObj.getFcTimeObj()) >= 0) { 705 if (timeObj.diff(_bcObj.getFcTimeObj()) >= 0) {
@@ -714,7 +739,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -714,7 +739,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
714 * @param isUp 是否上行 739 * @param isUp 是否上行
715 * @returns [{路牌index},{圈index},{班次index}] 740 * @returns [{路牌index},{圈index},{班次index}]
716 */ 741 */
717 - var _findDownClosedBcIndexWithTime = function(timeObj, isUp) { 742 + var _fnFindDownClosedBcIndexWithTime = function(timeObj, isUp) {
718 var _lpObj; 743 var _lpObj;
719 var _groupObj; 744 var _groupObj;
720 var _bcObj; 745 var _bcObj;
@@ -732,9 +757,10 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -732,9 +757,10 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
732 for (_j = 0; _j < _internalLpArray.length; _j++) { 757 for (_j = 0; _j < _internalLpArray.length; _j++) {
733 _lpObj = _internalLpArray[_j]; 758 _lpObj = _internalLpArray[_j];
734 _groupObj = _lpObj.getGroup(_i); 759 _groupObj = _lpObj.getGroup(_i);
735 - _bcObj = isUp ? _groupObj.getBc1() : _groupObj.getBc2(); 760 + // TODO:bug
  761 + _bcObj = isUp == _qIsUp ? _groupObj.getBc1() : _groupObj.getBc2();
736 if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的 762 if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的
737 - _bcObj = _generateBc(_j, _i, isUp == _qIsUp ? 0 : 1); 763 + _bcObj = _fnGenerateBc(_j, _i, isUp == _qIsUp ? 0 : 1);
738 } 764 }
739 if (_bcObj) { 765 if (_bcObj) {
740 //console.log("timeobj -> bcobj diff flag " + 766 //console.log("timeobj -> bcobj diff flag " +
@@ -777,6 +803,48 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -777,6 +803,48 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
777 return bcindex; 803 return bcindex;
778 }; 804 };
779 805
  806 + /**
  807 + * 获取班次索引。
  808 + * @param oBc 班次对象
  809 + * @returns [{路牌索引},{圈索引},{班次索引}]
  810 + */
  811 + var _fnGetBcIndex = function(oBc) {
  812 + // 路牌索引
  813 + var i;
  814 + var iLpIndex;
  815 + for (i = 0; i < _internalLpArray.length; i++) {
  816 + if (_internalLpArray[i]._$$_orign_lp_obj == oBc._$$_internal_lp_obj._$$_orign_lp_obj) {
  817 + iLpIndex = i;
  818 + break;
  819 + }
  820 + }
  821 + // 圈索引
  822 + var j;
  823 + var iGroupIndex;
  824 + var bFlag = false;
  825 + for (i = 0; i < _internalLpArray.length; i++) {
  826 + if (bFlag) {
  827 + break;
  828 + }
  829 + for (j = 0; j < _qCount; j++) {
  830 + if (_internalLpArray[i]._$_groupBcArray[j] == oBc._$$_internal_group_obj) {
  831 + iGroupIndex = j;
  832 + bFlag = true;
  833 + break;
  834 + }
  835 + }
  836 + }
  837 + // 班次索引
  838 + var iBcIndex = _qIsUp == oBc.isUp() ? 0 : 1;
  839 +
  840 + if (iLpIndex == undefined) {
  841 + return null;
  842 + } else {
  843 + return [].concat(iLpIndex, iGroupIndex, iBcIndex);
  844 + }
  845 +
  846 + };
  847 +
780 return { 848 return {
781 //------------- 布局初始化方法 ------------// 849 //------------- 布局初始化方法 ------------//
782 /** 850 /**
@@ -805,14 +873,14 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -805,14 +873,14 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
805 fnAdjustGfbc : function(isZgf, isUp) { 873 fnAdjustGfbc : function(isZgf, isUp) {
806 var oStartTime; // 开始时间 874 var oStartTime; // 开始时间
807 var oEndTime; // 结束时间 875 var oEndTime; // 结束时间
808 - var iStartBcIndex; // 开始班次索引  
809 - var iEndBcIndex; // 结束班次索引 876 + var aStartBcIndex; // 开始班次索引
  877 + var aEndBcIndex; // 结束班次索引
810 878
811 oStartTime = isZgf ? _paramObj.getMPeakStartTimeObj() : _paramObj.getEPeakStartTimeObj(); 879 oStartTime = isZgf ? _paramObj.getMPeakStartTimeObj() : _paramObj.getEPeakStartTimeObj();
812 oEndTime = isZgf ? _paramObj.getMPeakEndTimeObj() : _paramObj.getEPeakEndTimeObj(); 880 oEndTime = isZgf ? _paramObj.getMPeakEndTimeObj() : _paramObj.getEPeakEndTimeObj();
813 881
814 - aStartBcIndex = _findUpClosedBcIndexWithTime(oStartTime, isUp);  
815 - aEndBcIndex = _findDownClosedBcIndexWithTime(oEndTime, isUp); 882 + aStartBcIndex = _fnFindUpClosedBcIndexWithTime(oStartTime, isUp);
  883 + aEndBcIndex = _fnFindDownClosedBcIndexWithTime(oEndTime, isUp);
816 884
817 var iLpIndex; 885 var iLpIndex;
818 var iQIndex; 886 var iQIndex;
@@ -848,6 +916,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -848,6 +916,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
848 iQInternelCount = aEndBcIndex[1] - aStartBcIndex[1] - 1; 916 iQInternelCount = aEndBcIndex[1] - aStartBcIndex[1] - 1;
849 for (i = 1; i <= iQInternelCount; i++) { 917 for (i = 1; i <= iQInternelCount; i++) {
850 oLp = _internalLpArray[iQIndex + i]; 918 oLp = _internalLpArray[iQIndex + i];
  919 +
851 if (!oLp.getBc(iQIndex + i, iBcIndex)) { 920 if (!oLp.getBc(iQIndex + i, iBcIndex)) {
852 _fnGenerateBcAndSetBc(i, iQIndex + i, iBcIndex); 921 _fnGenerateBcAndSetBc(i, iQIndex + i, iBcIndex);
853 } 922 }
@@ -1024,14 +1093,15 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1024,14 +1093,15 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1024 * 从车次链的后面开始加 1093 * 从车次链的后面开始加
1025 */ 1094 */
1026 fnCalcuLpBx_other: function() { 1095 fnCalcuLpBx_other: function() {
1027 - // TODO:暂时使用做2休1的班型  
1028 - // 计算做5休2班型所需的班次数  
1029 - var iBxBcount = _aBxDesc[4].fBcCount;  
1030 - if (iBxBcount - Math.floor(iBxBcount) > 0.7) {  
1031 - iBxBcount = Math.floor(iBxBcount) + 1;  
1032 - } else {  
1033 - iBxBcount = Math.floor(iBxBcount); 1096 + // TODO:根据上标线的首班时间确定班型,小于05:59的做一休一,否则做二休一
  1097 + var oSt = _qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();
  1098 + var iBxIndex = 4;
  1099 + if (oSt.isBefore(_paramObj.toTimeObj("05:59"))) {
  1100 + iBxIndex = 5;
1034 } 1101 }
  1102 + // 计算做5休2班型所需的班次数
  1103 + var iQBcount = _aBxDesc[iBxIndex].fQCount;
  1104 + var iBxBcount = Math.round(iQBcount) * 2;
1035 1105
1036 var i; 1106 var i;
1037 var j; 1107 var j;
@@ -1110,8 +1180,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1110,8 +1180,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1110 while (iTempBcIndex <= 1) { 1180 while (iTempBcIndex <= 1) {
1111 oBc = _fnGenerateBc(aLbLpindexes[i], j, iTempBcIndex); 1181 oBc = _fnGenerateBc(aLbLpindexes[i], j, iTempBcIndex);
1112 if (oBc && 1182 if (oBc &&
1113 - oBc.getFcTimeObj().isBefore(oEndsj) &&  
1114 - oBc.getArrTimeObj().isBefore(oEndsj)) { 1183 + oBc.getFcTimeObj().isBefore(oEndsj) ) {
1115 oLp.setBc(j, iTempBcIndex, oBc); 1184 oLp.setBc(j, iTempBcIndex, oBc);
1116 } 1185 }
1117 iTempBcIndex++; 1186 iTempBcIndex++;
@@ -1177,157 +1246,95 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1177,157 +1246,95 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1177 }, 1246 },
1178 1247
1179 /** 1248 /**
1180 - * 计算末班车(一般都落在连班班型上,因为按照现在的布局方法,分班路牌不会一直连到最后)。  
1181 - * 1、确定末班车早的班次  
1182 - * 2、从后往前找到与这个班次最匹配的班次的位置(第几个路牌,第几圈,第几个班次),然后覆盖  
1183 - * 3、从第2步找的位置,往上找与另一个末班车匹配的班次位置,然后覆盖 1249 + * 计算末班车。
  1250 + * 1、将上下行拉成上下行两个班次列表(包括标记班次)
  1251 + * 2、分别找出离末班车发车时间最近的班次,并替换时间
  1252 + * 3、删除之后的班次
1184 */ 1253 */
1185 fnCalcuLastBc: function() { 1254 fnCalcuLastBc: function() {
1186 - //-------------------- 1、确定末班车早的方向,时间 -----------------------//  
1187 - var _oLastTime;  
1188 - var _bLastIsUp; 1255 + var i;
  1256 + var iTimeDiff;
  1257 + var iTempTime;
  1258 + var aBc;
  1259 + var oLastBcTime;
  1260 + var oLastBcIsUp;
  1261 + var iModifyIndex;
  1262 +
  1263 + // 查找末班车早的末班车时间和方向
1189 if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) { 1264 if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) {
1190 - _oLastTime = _paramObj.getUpLastDtimeObj();  
1191 - _bLastIsUp = true; 1265 + oLastBcTime = _paramObj.getUpLastDtimeObj();
  1266 + oLastBcIsUp = true;
1192 } else { 1267 } else {
1193 - _oLastTime = _paramObj.getDownLastDTimeObj();  
1194 - _bLastIsUp = false; 1268 + oLastBcTime = _paramObj.getDownLastDTimeObj();
  1269 + oLastBcIsUp = false;
1195 } 1270 }
1196 1271
1197 - //-------------------- 2、确定比 _oLastTime 小或者等于的班次位置,并修改班次时间到末班车时间 -----------------//  
1198 - var i;  
1199 - var j;  
1200 - var _oBc;  
1201 - var _oLp;  
1202 - var _aBcIndex;  
1203 -  
1204 - for (i = _qCount - 1; i >= 0; i--) {  
1205 - if (_aBcIndex) {  
1206 - break;  
1207 - }  
1208 - // 从大到小找到第一个合适的班次索引  
1209 - for (j = _internalLpArray.length - 1; j >= 0; j--) {  
1210 - _oLp = _internalLpArray[j];  
1211 - if (_oLp.isBxLb()) {  
1212 - _oBc = _oLp.getBc(i, _qIsUp == _bLastIsUp ? 0 : 1);  
1213 - }  
1214 - if (_oBc != undefined && _oBc.getFcTimeObj().isBefore(_oLastTime)) {  
1215 - _aBcIndex = [];  
1216 - _aBcIndex.push(j); // 路牌索引  
1217 - _aBcIndex.push(i); // 圈索引  
1218 - _aBcIndex.push(_qIsUp == _bLastIsUp ? 0 : 1); // 班次索引  
1219 - break;  
1220 - } 1272 + // 确定早的末班车时间
  1273 + aBc = _fnGetBcList(oLastBcIsUp);
  1274 + for (i = 0; i < aBc.length; i++) {
  1275 + iTempTime = oLastBcTime.diff(aBc[i].getFcTimeObj(), "m");
  1276 + if (iTimeDiff == undefined) {
  1277 + iTimeDiff = iTempTime;
  1278 + iModifyIndex = i;
  1279 + } else if (Math.abs(iTempTime) <= Math.abs(iTimeDiff)) {
  1280 + iTimeDiff = iTempTime;
  1281 + iModifyIndex = i;
1221 } 1282 }
1222 } 1283 }
1223 -  
1224 - //-------------------- 3、预估哪个个班次离末班最近,用末班替换,并删除后面的多余班次 -----------------//  
1225 - // 第2步找到的班次不一定是最适合的,需要把之后的班次模拟出来再比较一下  
1226 - var _aBcIndexes = []; // 里面放对象 {lpIndex,qIndex,bcIndex,fcsjTime}  
1227 - _oBc = undefined;  
1228 - for (i = _aBcIndex[0]; i < _internalLpArray.length; i++) {  
1229 - _oLp = _internalLpArray[i];  
1230 - if (_oLp.isBxLb()) {  
1231 - _oBc = _oLp.getBc(_aBcIndex[1], _aBcIndex[2]);  
1232 - if (_oBc == undefined) {  
1233 - _oBc = _fnGenerateBc(i, _aBcIndex[1], _aBcIndex[2]);  
1234 - }  
1235 - _aBcIndexes.push({  
1236 - lpIndex: i,  
1237 - qIndex: _aBcIndex[1],  
1238 - bcIndex: _aBcIndex[2],  
1239 - bcObj: _oBc  
1240 - })  
1241 - } 1284 + aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间
  1285 + aBc[iModifyIndex].fnSetDelFlag(false);
  1286 + for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次
  1287 + _qIsUp == oLastBcIsUp ?
  1288 + aBc[i]._$$_internal_group_obj.setBc1(undefined) :
  1289 + aBc[i]._$$_internal_group_obj.setBc2(undefined);
1242 } 1290 }
1243 - var _oBcIndex_find; // 第几个路牌离末班车最近  
1244 - for (i = _aBcIndexes.length - 1; i >= 0; i--) {  
1245 - if (_aBcIndexes[i].bcObj.getFcTimeObj().isBefore(_oLastTime)) {  
1246 - _oBcIndex_find = _aBcIndexes[i];  
1247 - break;  
1248 - }  
1249 - }  
1250 - // 替换成末班车  
1251 - _oBc = _oBcIndex_find.bcObj;  
1252 - _oBc.addMinuteToFcsj(_oLastTime.diff(_oBc.getFcTimeObj(), "m"));  
1253 - _internalLpArray[_oBcIndex_find.lpIndex].setBc(  
1254 - _oBcIndex_find.qIndex, _oBcIndex_find.bcIndex, _oBc  
1255 - );  
1256 1291
1257 - // 删除多余班次呢  
1258 - for (i = _oBcIndex_find.lpIndex + 1; i < _internalLpArray.length; i++) {  
1259 - _internalLpArray[i].removeBc(_oBcIndex_find.qIndex, _oBcIndex_find.bcIndex);  
1260 - }  
1261 -  
1262 - //---------------------- 4、从第3步找到的位置,开始往上找,确定另一个末班车,并删除后面多余的班次 -------------//  
1263 - // 因为另一个末班车时间晚,肯定在后面,并且必须在之前的路牌  
1264 - // 如果在之后的路牌,则意味着之前那个末班车位置不对,连班连起来会有两个之前的末班车  
1265 - // 计算大的末班车时间 1292 + // 查找末班车晚的末班车时间和方向
1266 if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) { 1293 if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) {
1267 - _oLastTime = _paramObj.getDownLastDTimeObj();  
1268 - _bLastIsUp = false; 1294 + oLastBcTime = _paramObj.getDownLastDTimeObj();
  1295 + oLastBcIsUp = false;
1269 } else { 1296 } else {
1270 - _oLastTime = _paramObj.getUpLastDtimeObj();  
1271 - _bLastIsUp = true; 1297 + oLastBcTime = _paramObj.getUpLastDtimeObj();
  1298 + oLastBcIsUp = true;
1272 } 1299 }
1273 - _aBcIndexes = [];  
1274 - for (i = _oBcIndex_find.lpIndex; i >=0; i--) {  
1275 - _oLp = _internalLpArray[i];  
1276 - if (_oLp.isBxLb()) {  
1277 - _oBc = _oLp.getBc(  
1278 - _oBcIndex_find.bcIndex == 0 ? _oBcIndex_find.qIndex : _oBcIndex_find.qIndex + 1,  
1279 - _oBcIndex_find.bcIndex == 0 ? 1 : 0  
1280 - );  
1281 - if (_oBc == undefined) {  
1282 - _oBc = _fnGenerateBc(  
1283 - i,  
1284 - _oBcIndex_find.bcIndex == 0 ? _oBcIndex_find.qIndex : _oBcIndex_find.qIndex + 1,  
1285 - _oBcIndex_find.bcIndex == 0 ? 1 : 0  
1286 - );  
1287 - }  
1288 - if (!_oBc) { // 纵向生成班次失败,用横向生成班次,发车时间取前一班次的到达时间加停战时间  
1289 - _oBc = _factory.createBcObj(  
1290 - _oLp,  
1291 - "normal",  
1292 - _bLastIsUp,  
1293 - 3,  
1294 - _oLp.getBc(_oBcIndex_find.qIndex, _oBcIndex_find.bcIndex).getArrTimeObj(),  
1295 - _paramObj  
1296 - ); 1300 + // 确定晚的末班车时间
  1301 + aBc = _fnGetBcList(oLastBcIsUp);
  1302 + var oBc;
  1303 + var aBcIndex;
  1304 + var iLpIndex;
  1305 + var iQIndex;
  1306 + var iBcIndex;
1297 1307
1298 - }  
1299 - _aBcIndexes.push({  
1300 - lpIndex: i,  
1301 - qIndex: _oBcIndex_find.bcIndex == 0 ? _oBcIndex_find.qIndex : _oBcIndex_find.qIndex + 1,  
1302 - bcIndex: _oBcIndex_find.bcIndex == 0 ? 1 : 0,  
1303 - bcObj: _oBc  
1304 - })  
1305 - }  
1306 - } 1308 + iTimeDiff = undefined;
  1309 + for (i = 0; i < aBc.length; i++) {
  1310 + oBc = aBc[i];
  1311 + aBcIndex = _fnGetBcIndex(oBc);
1307 1312
1308 - console.log(_aBcIndexes); 1313 + iLpIndex = aBcIndex[0];
  1314 + iQIndex = aBcIndex[2] == 0 ? aBcIndex[1] -1 : aBcIndex[1];
  1315 + iBcIndex = aBcIndex[2] == 0 ? 1 : 0;
1309 1316
1310 - _oBcIndex_find = _aBcIndexes[0]; 1317 + if (!_internalLpArray[iLpIndex].getBc(iQIndex, iBcIndex)) {
  1318 + continue;
  1319 + }
1311 1320
1312 - for (i = 0; i < _aBcIndexes.length; i++) {  
1313 - if (_aBcIndexes[i].bcObj.getFcTimeObj().isBefore(_oLastTime)) {  
1314 - _oBcIndex_find = _aBcIndexes[i];  
1315 - break; 1321 + iTempTime = oLastBcTime.diff(aBc[i].getFcTimeObj(), "m");
  1322 + if (iTimeDiff == undefined) {
  1323 + iTimeDiff = iTempTime;
  1324 + iModifyIndex = i;
  1325 + } else if (Math.abs(iTempTime) <= Math.abs(iTimeDiff)) {
  1326 + iTimeDiff = iTempTime;
  1327 + iModifyIndex = i;
1316 } 1328 }
1317 } 1329 }
1318 - // 替换成末班车  
1319 - _oBc = _oBcIndex_find.bcObj;  
1320 - _oBc.addMinuteToFcsj(_oLastTime.diff(_oBc.getFcTimeObj(), "m"));  
1321 - _internalLpArray[_oBcIndex_find.lpIndex].setBc(  
1322 - _oBcIndex_find.qIndex, _oBcIndex_find.bcIndex, _oBc  
1323 - );  
1324 -  
1325 - // 删除多余班次呢  
1326 - for (i = _oBcIndex_find.lpIndex + 1; i < _internalLpArray.length; i++) {  
1327 - _internalLpArray[i].removeBc(_oBcIndex_find.qIndex, _oBcIndex_find.bcIndex); 1330 + aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间
  1331 + aBc[iModifyIndex].fnSetDelFlag(false);
  1332 + for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次
  1333 + _qIsUp == oLastBcIsUp ?
  1334 + aBc[i]._$$_internal_group_obj.setBc1(undefined) :
  1335 + aBc[i]._$$_internal_group_obj.setBc2(undefined);
1328 } 1336 }
1329 1337
1330 -  
1331 }, 1338 },
1332 1339
1333 /** 1340 /**
@@ -1411,7 +1418,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1411,7 +1418,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1411 /** 1418 /**
1412 * 补每个路牌的其他班次(进出场,例保班次)。 1419 * 补每个路牌的其他班次(进出场,例保班次)。
1413 */ 1420 */
1414 - fnCalcuOtherBc: function() { 1421 + fnCalcuOtherBc_: function() {
1415 var i; 1422 var i;
1416 var _lpObj; 1423 var _lpObj;
1417 var _minBcIndex; 1424 var _minBcIndex;
@@ -1419,6 +1426,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1419,6 +1426,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1419 var _minBc; 1426 var _minBc;
1420 var _maxBc; 1427 var _maxBc;
1421 var _otherbc = []; 1428 var _otherbc = [];
  1429 + var _oFbbc;
1422 1430
1423 for (i = 0; i < _internalLpArray.length; i++) { 1431 for (i = 0; i < _internalLpArray.length; i++) {
1424 _lpObj = _internalLpArray[i]; 1432 _lpObj = _internalLpArray[i];
@@ -1428,11 +1436,11 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1428,11 +1436,11 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1428 _maxBc = _lpObj.getBc(_maxBcIndex[0], _maxBcIndex[1]); 1436 _maxBc = _lpObj.getBc(_maxBcIndex[0], _maxBcIndex[1]);
1429 1437
1430 _otherbc = []; 1438 _otherbc = [];
1431 - //_otherbc.push(_factory.createBcObj(  
1432 - // _lpObj, "bd", true, 1,  
1433 - // _minBc.getFcTimeObj(),  
1434 - // _paramObj  
1435 - //)); 1439 + _otherbc.push(_factory.createBcObj(
  1440 + _lpObj, "bd", true, 1,
  1441 + _minBc.getFcTimeObj(),
  1442 + _paramObj
  1443 + ));
1436 _otherbc.push(_factory.createBcObj( 1444 _otherbc.push(_factory.createBcObj(
1437 _lpObj, "out", true, 1, 1445 _lpObj, "out", true, 1,
1438 _minBc.getFcTimeObj(), 1446 _minBc.getFcTimeObj(),
@@ -1446,11 +1454,30 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1446,11 +1454,30 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1446 _maxBc.getArrTimeObj(), 1454 _maxBc.getArrTimeObj(),
1447 _paramObj 1455 _paramObj
1448 )); 1456 ));
1449 - //_otherbc.push(_factory.createBcObj(  
1450 - // _lpObj, "lc", true, 1,  
1451 - // _maxBc.getArrTimeObj(),  
1452 - // _paramObj  
1453 - //)); 1457 + _otherbc.push(_factory.createBcObj(
  1458 + _lpObj, "lc", true, 1,
  1459 + _maxBc.getArrTimeObj(),
  1460 + _paramObj
  1461 + ));
  1462 +
  1463 + // 5休2分班出场例保班次
  1464 + if (_lpObj.isBxFb5_2()) {
  1465 + _oFbbc = _lpObj.getBc(
  1466 + _lpObj.fnGetBcChainInfo(1)["s_q"],
  1467 + _lpObj.fnGetBcChainInfo(1)["s_b"]
  1468 + );
  1469 +
  1470 + _otherbc.push(_factory.createBcObj(
  1471 + _lpObj, "bd", true, 1,
  1472 + _oFbbc.getFcTimeObj(),
  1473 + _paramObj
  1474 + ));
  1475 + _otherbc.push(_factory.createBcObj(
  1476 + _lpObj, "out", true, 1,
  1477 + _oFbbc.getFcTimeObj(),
  1478 + _paramObj
  1479 + ));
  1480 + }
1454 1481
1455 _lpObj.addOtherBcArray(_otherbc); 1482 _lpObj.addOtherBcArray(_otherbc);
1456 } 1483 }
@@ -1458,13 +1485,75 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1458,13 +1485,75 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1458 }, 1485 },
1459 1486
1460 /** 1487 /**
1461 - * 祛除上标线有删除标记的班次。 1488 + * 补每个路牌的其他班次(进出场,例保班次)
  1489 + * 所有的车次链前后都加进出场、报道班次
1462 */ 1490 */
1463 - fnRemoveDelFlagBc: function() { 1491 + fnCalcuOtherBc: function() {
  1492 + var i;
  1493 + var j;
  1494 + var iBcChainCount;
  1495 + var oLp;
  1496 + var aOtherBc;
  1497 + var oStartBc;
  1498 + var oEndBc;
  1499 +
  1500 + for (i = 0; i < _internalLpArray.length; i++) {
  1501 + aOtherBc = [];
  1502 + oLp = _internalLpArray[i];
  1503 + iBcChainCount = oLp.fnGetBcChainCount();
  1504 +
  1505 + for (j = 0; j < iBcChainCount; j++) {
  1506 + oStartBc = oLp.getBc(
  1507 + oLp.fnGetBcChainInfo(j)["s_q"],
  1508 + oLp.fnGetBcChainInfo(j)["s_b"]
  1509 + );
  1510 + oEndBc = oLp.getBc(
  1511 + oLp.fnGetBcChainInfo(j)["e_q"],
  1512 + oLp.fnGetBcChainInfo(j)["e_b"]
  1513 + );
  1514 +
  1515 + // 车次链开头添加出场班次
  1516 + aOtherBc.push(_factory.createBcObj(
  1517 + oLp, "bd", true, 1,
  1518 + oStartBc.getFcTimeObj(),
  1519 + _paramObj
  1520 + ));
  1521 + aOtherBc.push(_factory.createBcObj(
  1522 + oLp, "out", true, 1,
  1523 + oStartBc.getFcTimeObj(),
  1524 + _paramObj
  1525 + ));
  1526 +
  1527 + // 车次链结尾添加进场班次
  1528 + aOtherBc.push(_factory.createBcObj(
  1529 + oLp, "in", true, 1,
  1530 + oEndBc.getArrTimeObj(),
  1531 + _paramObj
  1532 + ));
  1533 + aOtherBc.push(_factory.createBcObj(
  1534 + oLp, "lc", true, 1,
  1535 + oEndBc.getArrTimeObj(),
  1536 + _paramObj
  1537 + ));
  1538 + }
  1539 +
  1540 + oLp.addOtherBcArray(aOtherBc);
  1541 + }
  1542 + },
  1543 +
  1544 + /**
  1545 + * 祛除上标线开头的删除标记的班次。
  1546 + */
  1547 + fnRemoveDelFirstFlagBc: function() {
1464 var oLp = _internalLpArray[0]; 1548 var oLp = _internalLpArray[0];
1465 var aMinBcIndex = oLp.getMinBcObjPosition(); 1549 var aMinBcIndex = oLp.getMinBcObjPosition();
1466 oLp.removeBc(aMinBcIndex[0], aMinBcIndex[1]); 1550 oLp.removeBc(aMinBcIndex[0], aMinBcIndex[1]);
1467 - 1551 + },
  1552 + /**
  1553 + * 祛除上标线结尾的删除标记的班次。
  1554 + */
  1555 + fnRemoveDelLastFlagBc: function() {
  1556 + var oLp = _internalLpArray[0];
1468 var aMaxBcIndex = oLp.getMaxBcObjPosition(); 1557 var aMaxBcIndex = oLp.getMaxBcObjPosition();
1469 if (oLp.getBc(aMaxBcIndex[0], aMaxBcIndex[1]).fnIsDelFlag()) { 1558 if (oLp.getBc(aMaxBcIndex[0], aMaxBcIndex[1]).fnIsDelFlag()) {
1470 oLp.removeBc(aMaxBcIndex[0], aMaxBcIndex[1]); 1559 oLp.removeBc(aMaxBcIndex[0], aMaxBcIndex[1]);
@@ -1472,117 +1561,248 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1472,117 +1561,248 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1472 }, 1561 },
1473 1562
1474 /** 1563 /**
1475 - * 调整班次纵向间隔(发车时间调整)。  
1476 - * 1、只调整分班班次的发车时间  
1477 - * 2、调整每两个连班之间的分班班次组  
1478 - * 3、如果不是连续的班次才调整 1564 + * 调整路牌班次间隔(核准周转时间,停站时间)。
  1565 + * @param iFre int 迭代次数
1479 */ 1566 */
1480 - fnAdjust_vertical_bc_interval: function() {  
1481 - var i;  
1482 - var j;  
1483 - var iBIndex = 0;  
1484 - var oLbGroup = {};  
1485 - var oLp;  
1486 - for (i = 0; i < _qCount; i++) {  
1487 - while (iBIndex <= 1) {  
1488 - oLbGroup[i + "_" + iBIndex] = [];  
1489 - for (j = 0; j < _internalLpArray.length; j++) {  
1490 - oLp = _internalLpArray[j];  
1491 - if (oLp.isBxLb()) {  
1492 - if (oLp.getBc(i, iBIndex)) {  
1493 - oLbGroup[i + "_" + iBIndex].push(j);  
1494 - } 1567 + fnAdjustLpBcInterval: function(iFre) {
  1568 + if (iFre > 0) {
  1569 + for (var i = 0; i < _internalLpArray.length; i++) {
  1570 + _internalLpArray[i].fnAdjustBcInterval(
  1571 + this.fnCalcuAverPeakStopTime(),
  1572 + this.fnCalcuAverTroughStopTime(),
  1573 + _paramObj);
  1574 + }
  1575 +
  1576 + this.fnAdjustLpBcInterval(iFre - 1);
  1577 + }
  1578 + },
  1579 +
  1580 + /**
  1581 + * 调整班次间隔。
  1582 + * @param bIsUp 是否上行
  1583 + * @param oStartTime 开始时间对象
  1584 + * @param iFre 迭代次数
  1585 + */
  1586 + fnAdjustBcInterval2_: function(bIsUp, oStartTime, iFre) {
  1587 + if (iFre > 0) {
  1588 + var aBc = _fnGetBcList2(bIsUp, oStartTime); // 指定方向的班次列表
  1589 + aBc.sort(function(o1, o2) {
  1590 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1591 + return -1;
  1592 + } else {
  1593 + return 1;
  1594 + }
  1595 + });
  1596 + var i;
  1597 + var j;
  1598 +
  1599 + var iBcCountOfGroup = 3; // 3个班次取一次计算
  1600 + var aBcOfGroup; // 3个班次列表
  1601 + var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
  1602 +
  1603 + for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
  1604 + aBcOfGroup = [];
  1605 + aBcIntervalOfGroup = [];
  1606 + for (j = i; j < i + iBcCountOfGroup; j++) {
  1607 + aBcOfGroup.push(aBc[j]);
  1608 + }
  1609 +
  1610 + for (j = 0; j < aBcOfGroup.length; j++) {
  1611 + if (j < aBcOfGroup.length - 1) {
  1612 + aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
  1613 + aBcOfGroup[j].getFcTimeObj(), "m"));
1495 } 1614 }
1496 } 1615 }
1497 - if (oLbGroup[i + "_" + iBIndex].length == 1) {  
1498 - oLbGroup[i + "_" + iBIndex] = []; 1616 +
  1617 + if (aBcIntervalOfGroup[0] < 19) {
  1618 + aBcOfGroup[1].addMinuteToFcsj(1);
  1619 + } else if (aBcIntervalOfGroup[0] > 20) {
  1620 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1621 + } else {
  1622 + if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  1623 + //continue;
  1624 + } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  1625 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1626 + } else {
  1627 + aBcOfGroup[1].addMinuteToFcsj(1);
  1628 + }
1499 } 1629 }
1500 1630
1501 - iBIndex ++;  
1502 } 1631 }
1503 - iBIndex = 0; 1632 +
  1633 + this.fnAdjustBcInterval2(bIsUp, oStartTime, iFre - 1);
1504 } 1634 }
  1635 + },
1505 1636
1506 - //console.log(oLbGroup); 1637 + /**
  1638 + * 调整班次间隔。
  1639 + * @param boolean isUp 是否上行
  1640 + * @param oStartTime 开始时间对象
  1641 + * @param fre int 迭代次数
  1642 + */
  1643 + fnAdjustBcInterval: function(isUp, oStartTime, fre) {
  1644 + if (fre > 0) {
  1645 + var aBc = !oStartTime ? _fnGetBcList(isUp) : _fnGetBcList2(isUp, oStartTime); // 指定方向的班次列表
1507 1646
1508 - var sKey;  
1509 - var iQindex;  
1510 - var iBindex;  
1511 - var aBcLb = []; 1647 + aBc.sort(function(o1, o2) {
  1648 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1649 + return -1;
  1650 + } else {
  1651 + return 1;
  1652 + }
  1653 + });
1512 1654
1513 - var oLbGroup_m = {};  
1514 - var aLbGroup = []; 1655 + var i;
  1656 + var j;
1515 1657
  1658 + var iBcCountOfGroup = 3; // 3个班次取一次计算
  1659 + var aBcOfGroup; // 3个班次列表
  1660 + var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
  1661 + var oBcFcTime; // 班次发车时间
1516 1662
1517 - // 计算需要调整的连班区间  
1518 - for (sKey in oLbGroup) {  
1519 - iQindex = sKey.split('_')[0];  
1520 - iBindex = sKey.split('_')[1];  
1521 - oLbGroup_m[sKey] = [];  
1522 - for (i = 0; i < oLbGroup[sKey].length - 1; i++) {  
1523 - aBcLb = [];  
1524 - for (j = oLbGroup[sKey][i] + 1; j <= oLbGroup[sKey][i + 1] - 1; j++) {  
1525 - oLp = _internalLpArray[j];  
1526 - if (oLp.getBc(iQindex, iBindex)) {  
1527 - aBcLb.push(j); 1663 + for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
  1664 + aBcOfGroup = [];
  1665 + aBcIntervalOfGroup = [];
  1666 + for (j = i; j < i + iBcCountOfGroup; j++) {
  1667 + aBcOfGroup.push(aBc[j]);
  1668 + }
  1669 +
  1670 + for (j = 0; j < aBcOfGroup.length; j++) {
  1671 + if (j < aBcOfGroup.length - 1) {
  1672 + aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
  1673 + aBcOfGroup[j].getFcTimeObj(), "m"));
1528 } 1674 }
1529 } 1675 }
1530 - if (aBcLb.length != 0 && aBcLb.length < (oLbGroup[sKey][i + 1] - oLbGroup[sKey][i] - 1)) {  
1531 - aLbGroup = [];  
1532 - aLbGroup.push(oLbGroup[sKey][i]);  
1533 - aLbGroup.push(oLbGroup[sKey][i + 1]);  
1534 - aLbGroup.push(aBcLb);  
1535 - oLbGroup_m[sKey].push(aLbGroup); 1676 +
  1677 + // 判定规则
  1678 + oBcFcTime = aBcOfGroup[1].getFcTimeObj();
  1679 +
  1680 + // 第一个班次发车时间不动,根据间隔,调整中间一个班次
  1681 + // 如果3个班次2个间隔时间差1分钟,不调整
  1682 + // 如果第一个间隔大,调整第二个班次往前1分钟
  1683 + // 如果第二个间隔大,调整第二个班次往后1分钟
  1684 +
  1685 + if (_paramObj.isTroughBc(oBcFcTime) &&
  1686 + aBcIntervalOfGroup[0] > _paramObj.getTroughMaxFcjx()) {
  1687 + aBcOfGroup[1].addMinuteToFcsj(-1);
1536 } 1688 }
1537 - }  
1538 - }  
1539 1689
1540 - console.log(oLbGroup_m); 1690 + //else if (_paramObj.isMPeakBc(oBcFcTime) &&
  1691 + // aBcIntervalOfGroup[0] < _paramObj.getMPeakMinFcjx()) {
  1692 + // aBcOfGroup[1].addMinuteToFcsj(1);
  1693 + //} else if (_paramObj.isMPeakBc(oBcFcTime) &&
  1694 + // aBcIntervalOfGroup[0] > _paramObj.getMPeakMaxFcjx()) {
  1695 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  1696 + //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
  1697 + // aBcIntervalOfGroup[0] < _paramObj.getEPeakMinFcjx()) {
  1698 + // aBcOfGroup[1].addMinuteToFcsj(1);
  1699 + //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
  1700 + // aBcIntervalOfGroup[0] > _paramObj.getEPeakMaxFcjx()) {
  1701 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  1702 + //}
  1703 +
  1704 +
  1705 + else {
  1706 + if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  1707 + //continue;
  1708 + } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  1709 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1710 + } else {
  1711 + aBcOfGroup[1].addMinuteToFcsj(1);
  1712 + }
  1713 + }
1541 1714
1542 - var iStartLpIndex;  
1543 - var iEndLpIndex;  
1544 - var iDCount;  
1545 - var iDiffTime; 1715 + //if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  1716 + // //continue;
  1717 + //} else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  1718 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  1719 + //} else {
  1720 + // aBcOfGroup[1].addMinuteToFcsj(1);
  1721 + //}
1546 1722
1547 - var iC1;  
1548 - var iC2;  
1549 - var oKssj;  
1550 1723
1551 - for (sKey in oLbGroup_m) {  
1552 - iQindex = sKey.split('_')[0];  
1553 - iBindex = sKey.split('_')[1]; 1724 + }
1554 1725
1555 - for (i = 0; i < oLbGroup_m[sKey].length; i++) {  
1556 - aLbGroup = oLbGroup_m[sKey][i]; 1726 + this.fnAdjustBcInterval(isUp, oStartTime, fre - 1);
  1727 + }
1557 1728
1558 - iStartLpIndex = aLbGroup[0];  
1559 - iEndLpIndex = aLbGroup[1];  
1560 - iDCount = aLbGroup[2].length + 1; 1729 + },
1561 1730
1562 - iDiffTime = _internalLpArray[iEndLpIndex].getBc(iQindex, iBindex).getFcTimeObj().diff(  
1563 - _internalLpArray[iStartLpIndex].getBc(iQindex, iBindex).getFcTimeObj(), 'm'); 1731 + /**
  1732 + * 调整班次间隔(平均间隔)。
  1733 + * @param bIsUp 是否上行
  1734 + * @param oStartTime 开始时间对象
  1735 + */
  1736 + fnAdjustBcInterval2_avg: function(bIsUp, oStartTime) {
  1737 + var aBc = !oStartTime ? _fnGetBcList(bIsUp) : _fnGetBcList2(bIsUp, oStartTime); // 指定方向的班次列表
  1738 + aBc.sort(function(o1, o2) {
  1739 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1740 + return -1;
  1741 + } else {
  1742 + return 1;
  1743 + }
  1744 + });
1564 1745
1565 - iC1 = Math.floor(iDiffTime / iDCount);  
1566 - iC2 = iDiffTime % iDCount;  
1567 - oKssj = _internalLpArray[iStartLpIndex].getBc(iQindex, iBindex).getFcTimeObj(); 1746 + var j;
  1747 + var iCount = aBc.length - 1;
  1748 + var iC1 = Math.floor(aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") / iCount);
  1749 + var iC2 = aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") % iCount;
  1750 + var iTempTime;
  1751 +
  1752 + for (j = 0; j < iCount - iC2; j++) {
  1753 + iTempTime = aBc[j + 1].getFcTimeObj().diff(aBc[j].getFcTimeObj(), "m");
  1754 + aBc[j + 1].addMinuteToFcsj(iC1 - iTempTime);
  1755 + }
  1756 + for (j = 0; j < iC2; j++) {
  1757 + iTempTime = aBc[iCount - iC2 + j + 1].getFcTimeObj().diff(aBc[iCount - iC2 + j].getFcTimeObj(), "m");
  1758 + aBc[iCount - iC2 + j + 1].addMinuteToFcsj(iC1 + 1 - iTempTime);
  1759 + }
1568 1760
1569 - for (j = 1; j <= iDCount - iC2; j++) {  
1570 - if (j - 1 < aLbGroup[2].length) {  
1571 - oKssj = _paramObj.addMinute(oKssj, iC1);  
1572 - _internalLpArray[aLbGroup[2][j - 1]].getBc(  
1573 - iQindex, iBindex).setFcTimeObj(oKssj);  
1574 - }  
1575 - } 1761 + },
  1762 +
  1763 + /**
  1764 + * 计算高峰平均停站时间。
  1765 + */
  1766 + fnCalcuAverPeakStopTime: function() {
  1767 + var i;
  1768 + var j;
  1769 + var aBc;
  1770 + var iBcCount = 0;
  1771 + var iSum = 0;
  1772 + for (i = 0; i < _internalLpArray.length; i++) {
  1773 + aBc = _internalLpArray[i].getBcArray();
1576 1774
1577 - for (j = 1; j < iC2; j++) {  
1578 - oKssj = _paramObj.addMinute(oKssj, iC1 + 1);  
1579 - _internalLpArray[aLbGroup[2][iDCount - iC2 + j - 1]].getBc(  
1580 - iQindex, iBindex).setFcTimeObj(oKssj); 1775 + for (j = 0; j < aBc.length; j++) {
  1776 + if (!_paramObj.isTroughBc(aBc[j].getArrTimeObj())) {
  1777 + iBcCount ++;
  1778 + iSum += aBc[j].getStopTime();
1581 } 1779 }
  1780 + }
  1781 + }
  1782 +
  1783 + return Math.floor(iSum / iBcCount);
  1784 + },
1582 1785
  1786 + /**
  1787 + * 计算低谷平均停站时间。
  1788 + */
  1789 + fnCalcuAverTroughStopTime: function() {
  1790 + var i;
  1791 + var j;
  1792 + var aBc;
  1793 + var iBcCount = 0;
  1794 + var iSum = 0;
  1795 + for (i = 0; i < _internalLpArray.length; i++) {
  1796 + aBc = _internalLpArray[i].getBcArray();
  1797 + for (j = 0; j < aBc.length; j++) {
  1798 + if (_paramObj.isTroughBc(aBc[j].getArrTimeObj())) {
  1799 + iBcCount ++;
  1800 + iSum += aBc[j].getStopTime();
  1801 + }
1583 } 1802 }
1584 } 1803 }
1585 1804
  1805 + return Math.floor(iSum / iBcCount);
1586 }, 1806 },
1587 1807
1588 //------------- 其他方法 -------------// 1808 //------------- 其他方法 -------------//
@@ -1592,6 +1812,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1592,6 +1812,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1592 fnToGanttBcArray: function() { 1812 fnToGanttBcArray: function() {
1593 var aAllBc = []; 1813 var aAllBc = [];
1594 var aLpBc = []; 1814 var aLpBc = [];
  1815 + var aEatBc = [];
1595 var oLp; 1816 var oLp;
1596 var i; 1817 var i;
1597 var j; 1818 var j;
@@ -1600,6 +1821,23 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1600,6 +1821,23 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1600 oLp = _internalLpArray[i]; 1821 oLp = _internalLpArray[i];
1601 aLpBc = []; 1822 aLpBc = [];
1602 aLpBc = aLpBc.concat(oLp.getOtherBcArray(), oLp.getBcArray()); 1823 aLpBc = aLpBc.concat(oLp.getOtherBcArray(), oLp.getBcArray());
  1824 +
  1825 + aEatBc = [];
  1826 + // 根据班次的吃饭时间添加吃饭班次
  1827 + for (j = 0; j < aLpBc.length; j++) {
  1828 + if (aLpBc[j].fnGetEatTime() > 0) {
  1829 + aEatBc.push(_factory.createBcObj(
  1830 + oLp,
  1831 + "cf",
  1832 + !aLpBc[j].isUp(), // 和上一个班次方向相反
  1833 + 1,
  1834 + _paramObj.addMinute(aLpBc[j].getArrTimeObj(), aLpBc[j].getStopTime()), // 使用上一个班次的到达时间作为开始时间
  1835 + _paramObj
  1836 + ));
  1837 + }
  1838 + }
  1839 + aLpBc = aLpBc.concat(aEatBc);
  1840 +
1603 // 按照发车时间排序 1841 // 按照发车时间排序
1604 aLpBc.sort(function(o1, o2) { 1842 aLpBc.sort(function(o1, o2) {
1605 if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) { 1843 if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
@@ -1626,5 +1864,4 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { @@ -1626,5 +1864,4 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1626 } 1864 }
1627 1865
1628 }; 1866 };
1629 -  
1630 }; 1867 };
1631 \ No newline at end of file 1868 \ No newline at end of file
src/main/resources/static/pages/base/timesmodel/js/v2/main_v2.js
@@ -18,7 +18,8 @@ var Main_v2 = function() { @@ -18,7 +18,8 @@ var Main_v2 = function() {
18 var _fcsj = fcTimeObj; 18 var _fcsj = fcTimeObj;
19 var _bcsj = paramObj.calcuTravelTime(_fcsj, isUp); 19 var _bcsj = paramObj.calcuTravelTime(_fcsj, isUp);
20 var _arrsj = paramObj.addMinute(_fcsj, _bcsj); 20 var _arrsj = paramObj.addMinute(_fcsj, _bcsj);
21 - var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj); 21 + //var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj);
  22 + var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, undefined);
22 var _tccid = paramObj.getTTinfoId(); 23 var _tccid = paramObj.getTTinfoId();
23 var _ttinfoid = paramObj.getTTinfoId(); 24 var _ttinfoid = paramObj.getTTinfoId();
24 var _xl = paramObj.getXlId(); 25 var _xl = paramObj.getXlId();
@@ -161,6 +162,9 @@ var Main_v2 = function() { @@ -161,6 +162,9 @@ var Main_v2 = function() {
161 schedule.fnAdjustGfbc(false, true); // 修正上行晚高峰 162 schedule.fnAdjustGfbc(false, true); // 修正上行晚高峰
162 schedule.fnAdjustGfbc(false, false); // 修正下行晚高峰 163 schedule.fnAdjustGfbc(false, false); // 修正下行晚高峰
163 164
  165 + // 6、补吃饭班次
  166 + schedule.fnCalcuEatBc();
  167 +
164 // 4、按照车辆投入运营要求补充班次 168 // 4、按照车辆投入运营要求补充班次
165 schedule.fnCalcuLpBc_yy(); 169 schedule.fnCalcuLpBc_yy();
166 170
@@ -168,19 +172,26 @@ var Main_v2 = function() { @@ -168,19 +172,26 @@ var Main_v2 = function() {
168 schedule.fnCalcuLpBx_5_2(); 172 schedule.fnCalcuLpBx_5_2();
169 schedule.fnCalcuLpBx_other(); 173 schedule.fnCalcuLpBx_other();
170 174
171 - // 6、补吃饭班次  
172 - schedule.fnCalcuEatBc(); 175 + // 7、祛除上标线开头有删除标记的班次
  176 + schedule.fnRemoveDelFirstFlagBc();
173 177
174 - // 7、祛除有删除标记的班次  
175 - schedule.fnRemoveDelFlagBc(); 178 + // TODO:8、调整路牌班次间隔
  179 + schedule.fnAdjustLpBcInterval(1);
176 180
177 - // 8、调整纵向班次间隔  
178 - schedule.fnAdjust_vertical_bc_interval();  
179 - // TODO:横向调整 181 + // TODO:9、调整纵向班次间隔
  182 + schedule.fnAdjustBcInterval(true, false, 10);
  183 + schedule.fnAdjustBcInterval(false, false, 10);
180 184
181 - // 9、确定末班车 185 + // 10、确定末班车
182 schedule.fnCalcuLastBc(); 186 schedule.fnCalcuLastBc();
183 187
  188 + // 11、祛除上标线结尾有删除标记的班次
  189 + schedule.fnRemoveDelLastFlagBc();
  190 +
  191 + // TODO:12、平均化指定时间后的班次列表间隔
  192 + schedule.fnAdjustBcInterval2_avg(true, _paramObj.toTimeObj("19:50"));
  193 + schedule.fnAdjustBcInterval2_avg(false, _paramObj.toTimeObj("19:50"));
  194 +
184 // 10、补进出场例保班次 195 // 10、补进出场例保班次
185 schedule.fnCalcuOtherBc(); 196 schedule.fnCalcuOtherBc();
186 197
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="6" checked="true"/>缺车 41 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="6" checked="true"/>缺车
42 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="7" checked="true"/>客稀 42 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="7" checked="true"/>客稀
43 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="8" checked="true"/>气候 43 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="8" checked="true"/>气候
44 - <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="9" checked="true"/>外援 44 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="9" checked="true"/>援外
45 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="10" checked="true"/>其他 45 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="10" checked="true"/>其他
46 </div> 46 </div>
47 <div style="margin-top: 5px"></div> 47 <div style="margin-top: 5px"></div>
@@ -518,7 +518,7 @@ @@ -518,7 +518,7 @@
518 {{if reason[6].checked == true}}<th colspan="3">缺车</th>{{/if}} 518 {{if reason[6].checked == true}}<th colspan="3">缺车</th>{{/if}}
519 {{if reason[7].checked == true}}<th colspan="3">客稀</th>{{/if}} 519 {{if reason[7].checked == true}}<th colspan="3">客稀</th>{{/if}}
520 {{if reason[8].checked == true}}<th colspan="3">气候</th>{{/if}} 520 {{if reason[8].checked == true}}<th colspan="3">气候</th>{{/if}}
521 - {{if reason[9].checked == true}}<th colspan="3">外援</th>{{/if}} 521 + {{if reason[9].checked == true}}<th colspan="3">援外</th>{{/if}}
522 {{if reason[10].checked == true}}<th colspan="3">其他</th>{{/if}} 522 {{if reason[10].checked == true}}<th colspan="3">其他</th>{{/if}}
523 </tr> 523 </tr>
524 <tr> 524 <tr>
src/main/resources/static/pages/oil/list_ph.html
@@ -6,231 +6,228 @@ @@ -6,231 +6,228 @@
6 } 6 }
7 7
8 </style> 8 </style>
9 -<div class="page-head">  
10 - <div class="page-title">  
11 - <h1>进出场存油量</h1>  
12 - </div>  
13 -</div>  
14 -  
15 -<ul class="page-breadcrumb breadcrumb">  
16 - <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>  
17 - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>  
18 - <li><span class="active">进出场存油量</span></li>  
19 -</ul>  
20 -<div id="ll_oil_list"  
21 - class=" row col-md-12 portlet light porttlet-fit portlet-datatable bordered" style="height: calc(100% - 100px);background-color: #fff">  
22 - <!-- Begin: life time stats -->  
23 - <div class="portlet-title" >  
24 - <div class="caption">  
25 - <i class="fa fa-fire-extinguisher"></i> <span  
26 - class="caption-subject font-dark sbold uppercase">进出场存油量表</span>  
27 - </div>  
28 - <div class="actions">  
29 - <a class="btn btn-circle blue" href="add.html" data-pjax><i  
30 - class="fa fa-plus"></i> 添加</a>  
31 - <button type="button" class="btn btn-circle blue removeButton" id="removeButton">  
32 - <i class="fa fa-trash-o"></i> 删除  
33 - </button>  
34 - <button type="button" class="btn btn-circle blue sortButton" id="sortButton">  
35 - <i class="fa fa-minus-square"></i> 拆分  
36 - </button>  
37 - <button type="button" class="btn btn-circle blue saveButton" id="saveButton">  
38 - <i class="fa fa-check-circle"></i> 保存  
39 - </button>  
40 - <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> -->  
41 - <div class="btn-group">  
42 - <a class="btn red btn-outline btn-circle" href="javascript:;"  
43 - data-toggle="dropdown"> <i class="fa fa-share"></i> <span  
44 - class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i>  
45 - </a>  
46 - <ul class="dropdown-menu pull-right" id="datatable_ajax_tools">  
47 - <li><a href="javascript:;" data-action="0" class="tool-action"  
48 - id="obtain"> <i class="fa fa-hourglass-half"></i> 获取加/存油信息  
49 - </a></li>  
50 - <li><a href="javascript:;" data-action="1" class="tool-action"  
51 - id="outAndIn"> <i class="fa fa-pencil"></i> 油耗计算(进场=出场)  
52 - </a></li>  
53 - <li><a href="javascript:;" id="checkYl" data-action="3"  
54 - class="tool-action"> <i class="fa fa-gg-circle"></i>  
55 - 核对加注量(有加油无里程)  
56 - </a></li>  
57 - <li class="divider"></li>  
58 - <li><a href="javascript:;" data-action="3" class="tool-action"  
59 - id="export"> <i class="fa fa-file-excel-o"></i> 导出Excel  
60 - </a></li> 9 + <div class="page-head">
  10 + <div class="page-title">
  11 + <h1>进出场存油量</h1>
  12 + </div>
  13 + </div>
  14 +
  15 + <ul class="page-breadcrumb breadcrumb">
  16 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  17 + <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  18 + <li><span class="active">进出场存油量</span></li>
  19 + </ul>
  20 + <div id="ll_oil_list"
  21 + class=" row col-md-12 portlet light porttlet-fit portlet-datatable bordered" style="height: calc(100% - 100px);background-color: #fff">
  22 + <!-- Begin: life time stats -->
  23 + <div class="portlet-title" >
  24 + <div class="caption">
  25 + <i class="fa fa-fire-extinguisher"></i> <span
  26 + class="caption-subject font-dark sbold uppercase">进出场存油量表</span>
  27 + </div>
  28 + <div class="actions">
  29 + <a class="btn btn-circle blue" href="add.html" data-pjax><i
  30 + class="fa fa-plus"></i> 添加</a>
  31 + <button type="button" class="btn btn-circle blue removeButton" id="removeButton">
  32 + <i class="fa fa-trash-o"></i> 删除
  33 + </button>
  34 + <button type="button" class="btn btn-circle blue sortButton" id="sortButton">
  35 + <i class="fa fa-minus-square"></i> 拆分
  36 + </button>
  37 + <button type="button" class="btn btn-circle blue saveButton" id="saveButton">
  38 + <i class="fa fa-check-circle"></i> 保存
  39 + </button>
  40 + <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> -->
  41 + <div class="btn-group">
  42 + <a class="btn red btn-outline btn-circle" href="javascript:;"
  43 + data-toggle="dropdown"> <i class="fa fa-share"></i> <span
  44 + class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i>
  45 + </a>
  46 + <ul class="dropdown-menu pull-right" id="datatable_ajax_tools">
  47 + <li><a href="javascript:;" data-action="0" class="tool-action"
  48 + id="obtain"> <i class="fa fa-hourglass-half"></i> 获取加/存油信息
  49 + </a></li>
  50 + <li><a href="javascript:;" data-action="1" class="tool-action"
  51 + id="outAndIn"> <i class="fa fa-pencil"></i> 油耗计算(进场=出场)
  52 + </a></li>
  53 + <li><a href="javascript:;" id="checkYl" data-action="3"
  54 + class="tool-action"> <i class="fa fa-gg-circle"></i>
  55 + 核对加注量(有加油无里程)
  56 + </a></li>
  57 + <li class="divider"></li>
  58 + <li><a href="javascript:;" data-action="3" class="tool-action"
  59 + id="export"> <i class="fa fa-file-excel-o"></i> 导出Excel
  60 + </a></li>
  61 +
  62 +<!-- <li class="divider"></li> -->
  63 +<!-- <li><a href="javascript:;" data-action="3" class="tool-action" -->
  64 +<!-- id="cxtj"> <i class="fa fa-file-excel-o"></i> 重新统计 -->
  65 +<!-- </a></li> -->
  66 + </ul>
  67 + </div>
  68 + </div>
  69 + <div>
  70 + <table
  71 + class="table table-striped table-bordered table-hover table-checkable"
  72 + id="datatable_ylb" style="table-layout: fixed;margin-bottom: 0px">
  73 + <thead>
  74 + <tr role="row" class="filter">
  75 + <td colspan="2">
  76 + <div style="float: right;">&nbsp;公司&nbsp;</div>
  77 + </td>
  78 + <td colspan="3">
  79 + <div style="float: left; width: 150px">
  80 + <select class="form-control" name="ssgsdm_like"
  81 + id="ylbListGsdmId"></select>
  82 + </div>
  83 + </td>
  84 + <td colspan="2">
  85 + <div style="float: right;">&nbsp;分公司&nbsp;</div>
  86 + </td>
  87 + <td colspan="4">
  88 + <div style="float: left;">
  89 + <select class="form-control" name="fgsdm_like"
  90 + id="ylbListFgsdmId" style="width: 150px"></select>
  91 + </div>
  92 + </td>
  93 + <td>
  94 + <div style="float: right;">日期</div>
  95 + </td>
  96 + <td colspan="3">
  97 + <div style="float: left;">
  98 + <input type="text" style="width: 120px" name="rq" id="rq" />
  99 + </div>
  100 + </td>
  101 + <td rowspan="2" colspan="2">
  102 + <div style="float: left;">
  103 + &nbsp;
  104 + <button
  105 + class="btn btn-sm green btn-outline filter-submit margin-bottom"
  106 + style="margin-right: 0px">
  107 + <i class="fa fa-search"></i> 搜索
  108 + </button>
  109 + <!-- <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> -->
  110 + <!-- <i class="fa fa-times"></i> 重置 -->
  111 + <!-- </button> -->
  112 +
  113 + </div>
  114 + </td>
  115 + </tr>
  116 + <tr class="filter2">
  117 + <td colspan="2">
  118 + <div style="float: right;">&nbsp;线路</div>
  119 + </td>
  120 + <td colspan="3">
  121 + <div style="float: left;">
  122 + <select class="form-control" name="xlbm_like" id="xlbm"
  123 + style="width: 150px;"></select>
  124 + </div>
  125 + </td>
  126 + <td colspan="2">
  127 + <div style="float: right;">&nbsp;内部编码</div>
  128 + </td>
  129 + <td colspan="4">
  130 + <div style="float: left;">
  131 + <select class="form-control" name="nbbm_eq" id="nbbm"
  132 + style="width: 120px;"></select>
  133 + </div>
  134 + <div style="float: left;">
  135 + <button class="btn btn-sm #000 btn-outline filter-cancel"
  136 + style="margin-right: 0px">
  137 + <i class="fa fa-times"></i>
  138 + </button>
  139 + </div>
  140 + </td>
  141 + <td>
  142 + <div style="float: right;">类型</div>
  143 + </td>
  144 + <td colspan="3">
  145 + <div style="float: left;">
  146 + <select class="form-control" name="sxtj">
  147 + <option value="0">全部</option>
  148 + <option value="1">一车一单</option>
  149 + <option value="2">一车多单</option>
  150 + <option value="3">有加油没里程</option>
  151 + <option value="4">有里程没加油</option>
  152 + </select>
  153 + </div>
  154 +
  155 + </td>
  156 + </tr>
  157 + <tr>
  158 + <td colspan="17">
  159 + <div style="float: left;">
  160 + 总计 &nbsp;&nbsp; 加注量:&nbsp;<label id="sumJzl"></label>
  161 + &nbsp;&nbsp; 耗油量:&nbsp;<label id="sumYh"></label> &nbsp;&nbsp;
  162 + 损耗量:&nbsp;<label id="sumSh"></label>
  163 + </div>
  164 + </td>
  165 + </tr>
61 166
62 - <li class="divider"></li>  
63 - <li><a href="javascript:;" data-action="3" class="tool-action"  
64 - id="cxtj"> <i class="fa fa-file-excel-o"></i> 重新统计  
65 - </a></li>  
66 - </ul> 167 + </thead>
  168 +
  169 + </table>
67 </div> 170 </div>
68 </div> 171 </div>
69 - <div>  
70 - <table  
71 - class="table table-striped table-bordered table-hover table-checkable"  
72 - id="datatable_ylb" style="table-layout: fixed;margin-bottom: 0px">  
73 - <thead>  
74 - <tr role="row" class="filter">  
75 - <td colspan="2">  
76 - <div style="float: right;">&nbsp;公司&nbsp;</div>  
77 - </td>  
78 - <td colspan="3">  
79 - <div style="float: left; width: 150px">  
80 - <select class="form-control" name="ssgsdm_like"  
81 - id="ylbListGsdmId"></select>  
82 - </div>  
83 - </td>  
84 - <td colspan="2">  
85 - <div style="float: right;">&nbsp;分公司&nbsp;</div>  
86 - </td>  
87 - <td colspan="4">  
88 - <div style="float: left;">  
89 - <select class="form-control" name="fgsdm_like"  
90 - id="ylbListFgsdmId" style="width: 150px"></select>  
91 - </div>  
92 - </td>  
93 - <td>  
94 - <div style="float: right;">日期</div>  
95 - </td>  
96 - <td colspan="3">  
97 - <div style="float: left;">  
98 - <input type="text" style="width: 120px" name="rq" id="rq" />  
99 - </div>  
100 - </td>  
101 - <td rowspan="2" colspan="2">  
102 - <div style="float: left;">  
103 - &nbsp;  
104 - <button  
105 - class="btn btn-sm green btn-outline filter-submit margin-bottom"  
106 - style="margin-right: 0px">  
107 - <i class="fa fa-search"></i> 搜索  
108 - </button>  
109 - <!-- <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> -->  
110 - <!-- <i class="fa fa-times"></i> 重置 -->  
111 - <!-- </button> -->  
112 -  
113 - </div>  
114 - </td>  
115 - </tr>  
116 - <tr class="filter2">  
117 - <td colspan="2">  
118 - <div style="float: right;">&nbsp;线路</div>  
119 - </td>  
120 - <td colspan="3">  
121 - <div style="float: left;">  
122 - <select class="form-control" name="xlbm_like" id="xlbm"  
123 - style="width: 150px;"></select>  
124 - </div>  
125 - </td>  
126 - <td colspan="2">  
127 - <div style="float: right;">&nbsp;内部编码</div>  
128 - </td>  
129 - <td colspan="4">  
130 - <div style="float: left;">  
131 - <select class="form-control" name="nbbm_eq" id="nbbm"  
132 - style="width: 120px;"></select>  
133 - </div>  
134 - <div style="float: left;">  
135 - <button class="btn btn-sm #000 btn-outline filter-cancel"  
136 - style="margin-right: 0px">  
137 - <i class="fa fa-times"></i>  
138 - </button>  
139 - </div>  
140 - </td>  
141 - <td>  
142 - <div style="float: right;">类型</div>  
143 - </td>  
144 - <td colspan="3">  
145 - <div style="float: left;">  
146 - <select class="form-control" name="sxtj">  
147 - <option value="0">全部</option>  
148 - <option value="1">一车一单</option>  
149 - <option value="2">一车多单</option>  
150 - <option value="3">有加油没里程</option>  
151 - <option value="4">有里程没加油</option>  
152 - </select>  
153 - </div>  
154 -  
155 - </td>  
156 - </tr>  
157 - <tr>  
158 - <td colspan="17">  
159 - <div style="float: left;">  
160 - 总计 &nbsp;&nbsp; 加注量:&nbsp;<label id="sumJzl"></label>  
161 - &nbsp;&nbsp; 耗油量:&nbsp;<label id="sumYh"></label> &nbsp;&nbsp;  
162 - 损耗量:&nbsp;<label id="sumSh"></label>  
163 - </div>  
164 - </td>  
165 - </tr>  
166 -  
167 - </thead>  
168 -  
169 - </table>  
170 - </div>  
171 - </div>  
172 -  
173 - <div id="ylbtable" class="portlet-body table-container " style="height: calc(100% + 100px);overflow: hidden;position: absolute;background: #fff;">  
174 -  
175 - <table  
176 - class="table table-striped table-bordered table-hover table-checkable"  
177 - style="table-layout: fixed;margin-bottom: 0px;">  
178 - <thead>  
179 - <tr role="row" class="heading">  
180 - <td width="40px">  
181 - <input type="checkbox" id="selectAll" class="group-checkable" >  
182 - </td>  
183 - <td width="40px">序号</td>  
184 - <td width="8%">日期</td>  
185 - <td width="5%">公司</td>  
186 - <td width="8%">线路</td>  
187 - <td width="5%">自编号</td>  
188 - <td width="7%">驾驶员</td>  
189 - <td width="4%">加油量</td>  
190 - <td width="5%">出场存油</td>  
191 - <td width="5%">进场存油</td>  
192 - <td width="5%">油耗</td>  
193 - <td width="8%">燃油类型</td>  
194 - <td width="4%">尿素</td>  
195 - <td width="8%">耗损原因</td>  
196 - <td width="5%">耗损油量</td>  
197 - <td width="5%">当日总里程</td>  
198 - <td width="5%">数据类型</td>  
199 - <td >百公里油耗</td>  
200 - </tr>  
201 - </thead>  
202 - </table>  
203 - <div id="datatable_ylb_body_div" style="display: block;position:absolute;overflow: auto;height: calc(100% - 80px);"> 172 +
  173 + <div id="ylbtable" class="portlet-body table-container " style="height: calc(100% + 100px);overflow: hidden;position: absolute;background: #fff;">
  174 +
204 <table 175 <table
205 - class="table table-striped table-bordered table-hover table-checkable"  
206 - id="datatable_ylb_body"  
207 - style="table-layout: fixed; overflow: auto; ">  
208 - <tbody></tbody>  
209 - </table>  
210 - <div style="text-align: right;margin-right: 50px">  
211 - <a class="btn btn-circle " href="add.html" data-pjax><i  
212 - class="fa fa-plus"></i> 添加</a>  
213 - <button type="button" class="btn btn-circle removeButton" >  
214 - <i class="fa fa-trash-o"></i> 删除  
215 - </button>  
216 - <button type="button" class="btn btn-circle sortButton">  
217 - <i class="fa fa-minus-square"></i> 拆分  
218 - </button>  
219 - <button type="button" class="btn btn-circle saveButton" >  
220 - <i class="fa fa-check-circle"></i> 保存  
221 - </button>  
222 - <button type="button" class="btn btn-circle saveButton" >  
223 - <i class="fa fa-check-circle"></i> 保存  
224 - </button>  
225 - </div>  
226 - </div>  
227 -  
228 -  
229 - <div style="text-align: right;">  
230 - <ul id="pagination" class="pagination"></ul> 176 + class="table table-striped table-bordered table-hover table-checkable"
  177 + style="table-layout: fixed;margin-bottom: 0px;">
  178 + <thead>
  179 + <tr role="row" class="heading">
  180 + <td width="40px">
  181 + <input type="checkbox" id="selectAll" class="group-checkable" >
  182 + </td>
  183 + <td width="40px">序号</td>
  184 + <td width="8%">日期</td>
  185 + <td width="5%">公司</td>
  186 + <td width="8%">线路</td>
  187 + <td width="5%">自编号</td>
  188 + <td width="7%">驾驶员</td>
  189 + <td width="4%">加油量</td>
  190 + <td width="5%">出场存油</td>
  191 + <td width="5%">进场存油</td>
  192 + <td width="5%">油耗</td>
  193 + <td width="8%">燃油类型</td>
  194 + <td width="4%">尿素</td>
  195 + <td width="8%">耗损原因</td>
  196 + <td width="5%">耗损油量</td>
  197 + <td width="5%">当日总里程</td>
  198 + <td width="5%">数据类型</td>
  199 + <td >百公里油耗</td>
  200 + </tr>
  201 + </thead>
  202 + </table>
  203 + <div id="datatable_ylb_body_div" style="display: block;position:absolute;overflow: auto;height: calc(100% - 80px);">
  204 + <table
  205 + class="table table-striped table-bordered table-hover table-checkable"
  206 + id="datatable_ylb_body"
  207 + style="table-layout: fixed; overflow: auto; ">
  208 + <tbody></tbody>
  209 + </table>
  210 + <div style="text-align: right;margin-right: 50px">
  211 + <a class="btn btn-circle " href="add.html" data-pjax><i
  212 + class="fa fa-plus"></i> 添加</a>
  213 + <button type="button" class="btn btn-circle removeButton" >
  214 + <i class="fa fa-trash-o"></i> 删除
  215 + </button>
  216 + <button type="button" class="btn btn-circle sortButton">
  217 + <i class="fa fa-minus-square"></i> 拆分
  218 + </button>
  219 + <button type="button" class="btn btn-circle saveButton" >
  220 + <i class="fa fa-check-circle"></i> 保存
  221 + </button>
  222 + </div>
  223 + </div>
  224 +
  225 +
  226 + <div style="text-align: right;">
  227 + <ul id="pagination" class="pagination"></ul>
  228 + </div>
231 </div> 229 </div>
232 </div> 230 </div>
233 -</div>  
234 <script id="ylb_list_temp" type="text/html"> 231 <script id="ylb_list_temp" type="text/html">
235 {{each list as obj i}} 232 {{each list as obj i}}
236 <tr> 233 <tr>
@@ -252,10 +249,15 @@ @@ -252,10 +249,15 @@
252 249
253 </td> 250 </td>
254 <td width="7%"> 251 <td width="7%">
255 - {{obj.jsy}}/{{obj.name}} 252 + {{if obj.jsy=='' || obj.jsy==null }}
  253 + <input data-id="{{obj.id}}" style=" width:100%" type="text" class="in_carpark_jsy" ></input>
  254 + <button class="btn btn-sm blue btn-jsyUpdate" style=" width:100%" data-id="{{obj.id}}">填写</button>
  255 + {{else}}
  256 + {{obj.jsy}}/{{obj.name}}
  257 + {{/if}}
  258 +
256 </td> 259 </td>
257 <td width="4%"> 260 <td width="4%">
258 -  
259 <lable data-id="{{obj.id}}" class="in_carpark_jzl"> {{obj.jzl}}</lable> 261 <lable data-id="{{obj.id}}" class="in_carpark_jzl"> {{obj.jzl}}</lable>
260 </td> 262 </td>
261 <td width="5%"> 263 <td width="5%">
@@ -707,6 +709,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep @@ -707,6 +709,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
707 var bodyHtm = template('ylb_list_temp', {list:data}); 709 var bodyHtm = template('ylb_list_temp', {list:data});
708 710
709 $('#datatable_ylb_body tbody').html(bodyHtm); 711 $('#datatable_ylb_body tbody').html(bodyHtm);
  712 + $('.btn-jsyUpdate').on('click', jsyUpdate);
710 $('.yl_sxzy').on('mouseup', yhSxzy); 713 $('.yl_sxzy').on('mouseup', yhSxzy);
711 layer.close(l); 714 layer.close(l);
712 $get('/ylb/sumYlb',params,function(returns){ 715 $get('/ylb/sumYlb',params,function(returns){
@@ -746,6 +749,18 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep @@ -746,6 +749,18 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
746 }); 749 });
747 } 750 }
748 751
  752 +
  753 + function jsyUpdate(){
  754 + var id = $(this).data('id');
  755 + var jsy=$('.in_carpark_jsy[data-id='+id+']', '#ll_oil_list').val();
  756 + $get('/ylb/updateJsy',{id:id,jsy:jsy}, function(result){
  757 + layer.msg('修改成功.');
  758 + var params = getParamsList();
  759 + page = 0;
  760 + jsDoQuery(params, true);
  761 + });
  762 +
  763 + }
749 //页面计算防止精度丢失 764 //页面计算防止精度丢失
750 var accAdd = function (a, b) { 765 var accAdd = function (a, b) {
751 var c, d, e; 766 var c, d, e;
src/main/resources/static/pages/report/countMileage/countBus/company/countBusMileage.html
@@ -155,7 +155,7 @@ @@ -155,7 +155,7 @@
155 var tempData = {}; 155 var tempData = {};
156 $.get('/report/lineList',function(xlList){ 156 $.get('/report/lineList',function(xlList){
157 var data = []; 157 var data = [];
158 - data.push({id: " ", text: "全部线路"}); 158 +// data.push({id: " ", text: "全部线路"});
159 $.get('/user/companyData', function(result){ 159 $.get('/user/companyData', function(result){
160 for(var i = 0; i < result.length; i++){ 160 for(var i = 0; i < result.length; i++){
161 var companyCode = result[i].companyCode; 161 var companyCode = result[i].companyCode;
src/main/resources/static/pages/report/countMileage/countBus/countBusMileage.html
@@ -155,7 +155,7 @@ @@ -155,7 +155,7 @@
155 var tempData = {}; 155 var tempData = {};
156 $.get('/report/lineList',function(xlList){ 156 $.get('/report/lineList',function(xlList){
157 var data = []; 157 var data = [];
158 - data.push({id: " ", text: "全部线路"}); 158 +// data.push({id: " ", text: "全部线路"});
159 $.get('/user/companyData', function(result){ 159 $.get('/user/companyData', function(result){
160 for(var i = 0; i < result.length; i++){ 160 for(var i = 0; i < result.length; i++){
161 var companyCode = result[i].companyCode; 161 var companyCode = result[i].companyCode;
src/main/resources/static/pages/report/countMileage/countLine/countLineMileage.html
@@ -263,7 +263,7 @@ @@ -263,7 +263,7 @@
263 params['xlName'] = xlName; 263 params['xlName'] = xlName;
264 params['type'] = "query"; 264 params['type'] = "query";
265 var i = layer.load(2); 265 var i = layer.load(2);
266 - $get('/report/countLineMileage',params,function(result){ 266 + $get('/report/countLineMileage2',params,function(result){
267 $("#datetodate").html(date+"至"+date2); 267 $("#datetodate").html(date+"至"+date2);
268 layer.close(i); 268 layer.close(i);
269 // 把数据填充到模版中 269 // 把数据填充到模版中
@@ -290,7 +290,7 @@ @@ -290,7 +290,7 @@
290 params['xlName'] = xlName; 290 params['xlName'] = xlName;
291 params['type'] = "export"; 291 params['type'] = "export";
292 params['by']='sj'; 292 params['by']='sj';
293 - $get('/report/countLineMileage',params,function(result){ 293 + $get('/report/countLineMileage2',params,function(result){
294 window.open("/downloadFile/download?fileName=线路公里统计表"); 294 window.open("/downloadFile/download?fileName=线路公里统计表");
295 }); 295 });
296 }); 296 });
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/edit.html
@@ -234,7 +234,15 @@ @@ -234,7 +234,15 @@
234 placeholder="请输入标准油耗/关空调"/> 234 placeholder="请输入标准油耗/关空调"/>
235 </div> 235 </div>
236 </div> 236 </div>
  237 +
237 <div class="form-group"> 238 <div class="form-group">
  239 + <label class="col-md-2 control-label">是否报废:</label>
  240 + <div class="col-md-3">
  241 + <sa-Radiogroup model="ctrl.busInfoForSave.scrapState" dicgroup="truefalseType" name="scrapState"></sa-Radiogroup>
  242 + </div>
  243 + </div>
  244 +
  245 + <div class="form-group" ng-if="ctrl.busInfoForSave.scrapState == 1">
238 <label class="col-md-2 control-label">报废号:</label> 246 <label class="col-md-2 control-label">报废号:</label>
239 <div class="col-md-4"> 247 <div class="col-md-4">
240 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.scrapCode" 248 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.scrapCode"
@@ -242,7 +250,7 @@ @@ -242,7 +250,7 @@
242 </div> 250 </div>
243 </div> 251 </div>
244 252
245 - <div class="form-group"> 253 + <div class="form-group" ng-if="ctrl.busInfoForSave.scrapState == 1">
246 <label class="col-md-2 control-label">报废日期:</label> 254 <label class="col-md-2 control-label">报废日期:</label>
247 <div class="col-md-4"> 255 <div class="col-md-4">
248 <div class="input-group"> 256 <div class="input-group">
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/form.html
@@ -235,31 +235,31 @@ @@ -235,31 +235,31 @@
235 placeholder="请输入标准油耗/关空调"/> 235 placeholder="请输入标准油耗/关空调"/>
236 </div> 236 </div>
237 </div> 237 </div>
238 - <div class="form-group">  
239 - <label class="col-md-2 control-label">报废号:</label>  
240 - <div class="col-md-4">  
241 - <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.scrapCode"  
242 - placeholder="请输入报废号"/>  
243 - </div>  
244 - </div>  
245 -  
246 - <div class="form-group">  
247 - <label class="col-md-2 control-label">报废日期:</label>  
248 - <div class="col-md-4">  
249 - <div class="input-group">  
250 - <input type="text" class="form-control"  
251 - name="scrapDate" placeholder="请选择报废日期..."  
252 - uib-datepicker-popup="yyyy年MM月dd日"  
253 - is-open="ctrl.scrapDateOpen"  
254 - ng-model="ctrl.busInfoForSave.scrapDate" readonly/>  
255 - <span class="input-group-btn">  
256 - <button type="button" class="btn btn-default" ng-click="ctrl.scrapDate_open()">  
257 - <i class="glyphicon glyphicon-calendar"></i>  
258 - </button>  
259 - </span>  
260 - </div>  
261 - </div>  
262 - </div> 238 + <!--<div class="form-group">-->
  239 + <!--<label class="col-md-2 control-label">报废号:</label>-->
  240 + <!--<div class="col-md-4">-->
  241 + <!--<input type="text" class="form-control" ng-model="ctrl.busInfoForSave.scrapCode"-->
  242 + <!--placeholder="请输入报废号"/>-->
  243 + <!--</div>-->
  244 + <!--</div>-->
  245 +
  246 + <!--<div class="form-group">-->
  247 + <!--<label class="col-md-2 control-label">报废日期:</label>-->
  248 + <!--<div class="col-md-4">-->
  249 + <!--<div class="input-group">-->
  250 + <!--<input type="text" class="form-control"-->
  251 + <!--name="scrapDate" placeholder="请选择报废日期..."-->
  252 + <!--uib-datepicker-popup="yyyy年MM月dd日"-->
  253 + <!--is-open="ctrl.scrapDateOpen"-->
  254 + <!--ng-model="ctrl.busInfoForSave.scrapDate" readonly/>-->
  255 + <!--<span class="input-group-btn">-->
  256 + <!--<button type="button" class="btn btn-default" ng-click="ctrl.scrapDate_open()">-->
  257 + <!--<i class="glyphicon glyphicon-calendar"></i>-->
  258 + <!--</button>-->
  259 + <!--</span>-->
  260 + <!--</div>-->
  261 + <!--</div>-->
  262 + <!--</div>-->
263 <div class="form-group"> 263 <div class="form-group">
264 <label class="col-md-2 control-label">厂牌型号1:</label> 264 <label class="col-md-2 control-label">厂牌型号1:</label>
265 <div class="col-md-4"> 265 <div class="col-md-4">
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/list.html
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 <th style="width: 150px;">所在公司</th> 12 <th style="width: 150px;">所在公司</th>
13 <th style="width: 160px;">所在分公司</th> 13 <th style="width: 160px;">所在分公司</th>
14 <th style="width: 60px">电车</th> 14 <th style="width: 60px">电车</th>
  15 + <th style="width: 80px;" >状态</th>
15 <th style="width: 100%">操作</th> 16 <th style="width: 100%">操作</th>
16 </tr> 17 </tr>
17 <tr role="row" class="filter"> 18 <tr role="row" class="filter">
@@ -62,6 +63,11 @@ @@ -62,6 +63,11 @@
62 63
63 </td> 64 </td>
64 <td> 65 <td>
  66 + <label class="checkbox-inline input">
  67 + <input type="checkbox" ng-model="ctrl.searchCondition()['scrapState_eq']" />报废
  68 + </label>
  69 + </td>
  70 + <td>
65 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" 71 <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
66 ng-click="ctrl.doPage()"> 72 ng-click="ctrl.doPage()">
67 <i class="fa fa-search"></i> 搜索</button> 73 <i class="fa fa-search"></i> 搜索</button>
@@ -110,6 +116,9 @@ @@ -110,6 +116,9 @@
110 <span ng-bind="info.sfdc | dict:'truefalseType':'未知' "></span> 116 <span ng-bind="info.sfdc | dict:'truefalseType':'未知' "></span>
111 </td> 117 </td>
112 <td> 118 <td>
  119 + <span ng-bind="info.scrapState | dict:'truefalseType':'未知' "></span>
  120 + </td>
  121 + <td>
113 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> 122 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
114 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> 123 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
115 <a ui-sref="busInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> 124 <a ui-sref="busInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a>
src/main/resources/static/pages/trafficManage/js/timeTempletUpload.js
@@ -97,6 +97,7 @@ @@ -97,6 +97,7 @@
97 $.each(inputs, function(i, element) { 97 $.each(inputs, function(i, element) {
98 params[$(element).attr("name")] = $(element).val(); 98 params[$(element).attr("name")] = $(element).val();
99 }); 99 });
  100 + params["isCancel_ne"] = true;// 过滤作废时刻表
100 var i = layer.load(2); 101 var i = layer.load(2);
101 $get('/tic_ec', params, function(data) { 102 $get('/tic_ec', params, function(data) {
102 var content = data.data.content; 103 var content = data.data.content;