Commit 4ac76536ebbd4ea427b0178b0870bbb5fb159cc2

Authored by 游瑞烽
2 parents e3fbcae3 3cbf015d

Merge branch 'pudong' of 192.168.168.201:panzhaov5/bsth_control into pudong

src/main/java/com/bsth/entity/calc/CalcInterval.java
... ... @@ -47,6 +47,8 @@ public class CalcInterval {
47 47 private Integer djgDg;
48 48 /*最大间隔时间*/
49 49 private Integer djgTime;
  50 + /*全日班次数*/
  51 + private Integer bcs;
50 52 /*数据创建时间*/
51 53 private Date createtime;
52 54 /*数据修改时间*/
... ... @@ -143,6 +145,12 @@ public class CalcInterval {
143 145 public void setDjgTime(Integer djgTime) {
144 146 this.djgTime = djgTime;
145 147 }
  148 + public Integer getBcs() {
  149 + return bcs;
  150 + }
  151 + public void setBcs(Integer bcs) {
  152 + this.bcs = bcs;
  153 + }
146 154 public Date getCreatetime() {
147 155 return createtime;
148 156 }
... ...
src/main/java/com/bsth/service/calc/impl/CalcIntervalServiceImpl.java
... ... @@ -67,7 +67,11 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege
67 67 if(level.equals("D")){
68 68 String sql1=" select xl_bm,gsbm,fgsbm,xl_name from bsth_c_calc_interval where date >='"+sDate+"' and date <= '"+eDate+"' and `level`='D'";
69 69 if(line.equals("")){
70   - sql1 +=" and gsbm like '%"+gs+"%' and fgsbm like '%"+fgs+"%'";
  70 + if(fgs.equals("")){
  71 + sql1 +=" and gsbm = '"+gs+"'";
  72 + }else{
  73 + sql1 +=" and gsbm = '"+gs+"' and fgsbm = '"+fgs+"'";
  74 + }
71 75 }else{
72 76 sql1 +=" and xl_bm ='"+line+"'";
73 77 }
... ... @@ -76,7 +80,11 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl&lt;CalcInterval,Intege
76 80 String sql2="select gsdm,fgsdm,xl,xl_name,max(id) as id,sum(jhszfcs) as jhszfcs,"
77 81 + " sum(sjszfczds) as sjszfczds,sum(sjszddzds) as sjszddzds from bsth_c_calc_sheet where date >= '"+sDate+"' and date <= '"+eDate+"'";
78 82 if(line.trim().equals("")){
79   - sql2 +=" and gsdm = '"+gs+"' and fgsdm like '%"+fgs+"%'";
  83 + if(fgs.equals("")){
  84 + sql2 +=" and gsdm = '"+gs+"'";
  85 + }else{
  86 + sql2 +=" and gsdm = '"+gs+"' and fgsdm = '"+fgs+"'";
  87 + }
80 88 }else{
81 89 sql2 +=" and xl ='"+line+"'";
82 90 }
... ... @@ -110,17 +118,20 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl&lt;CalcInterval,Intege
110 118 }else{
111 119 m.put("zdlv", "0.0%");
112 120 m.put("ddzdlv", "0.0%");
113   -
114 121 }
115 122 return m;
116 123 }
117 124 });
118 125 }else{
119   - String sql="select gsbm,fgsbm,xl_bm,xl_name,MAX(id) as id,SUM(djg_all) as djgAll,SUM(djg_gf) as djgGf,"
  126 + String sql="select gsbm,fgsbm,xl_bm,xl_name,SUM(bcs) as bcs,MAX(id) as id,SUM(djg_all) as djgAll,SUM(djg_gf) as djgGf,"
120 127 + "SUM(djg_dg) as djgDg,SUM(djg_zgf) as djgZgf,SUM(djg_wgf) as djgWgf,MAX(djg_time) as djgTime "
121   - + "from bsth_c_calc_interval where date>= '"+sDate+"' and date<='"+eDate+"' and level <> 'D' ";
  128 + + "from bsth_c_calc_interval where date>= '"+sDate+"' and date<='"+eDate+"' and level <> 'D' and djg_all >0 ";
122 129 if(line.equals("")){
123   - sql +=" and gsbm like '%"+gs+"%' and fgsbm like '%"+fgs+"%'";
  130 + if(fgs.equals("")){
  131 + sql +=" and gsbm = '"+gs+"'";
  132 + }else{
  133 + sql +=" and gsbm = '"+gs+"' and fgsbm = '"+fgs+"'";
  134 + }
124 135 }else{
125 136 sql +=" and xl_bm ='"+line+"'";
126 137 }
... ... @@ -135,7 +146,17 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl&lt;CalcInterval,Intege
135 146 m.put("fgs", BasicData.businessFgsCodeNameMap.get(rs.getString("fgsbm")+"_"+rs.getString("gsbm")));
136 147 m.put("xlBm", rs.getString("xl_bm"));
137 148 m.put("xlName", rs.getString("xl_name"));
  149 + m.put("bcs", rs.getInt("bcs"));
138 150 m.put("id", rs.getInt("id"));
  151 + int djgAll=rs.getInt("djgAll");
  152 + int bcs=rs.getInt("bcs");
  153 + //全日发生率 (大间隔次数/全日班次数)
  154 + if(bcs>0){
  155 + double fsl=(djgAll*1.0)/(bcs*1.0)*100;
  156 + m.put("fsl", df.format(fsl)+"%");
  157 + }else{
  158 + m.put("fsl", "0.0%");
  159 + }
139 160 m.put("djgAll", rs.getString("djgAll"));
140 161 m.put("djgGf", rs.getString("djgGf"));
141 162 m.put("djgZgf", rs.getString("djgZgf"));
... ... @@ -149,12 +170,14 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl&lt;CalcInterval,Intege
149 170  
150 171 if(map.get("type").equals("export")){
151 172 String lineName="";
152   - if(!line.equals("")){
  173 + if(line.equals("")){
  174 + if(fgs.equals("")){
  175 + lineName=list.get(0).get("gs").toString();
  176 + }else{
  177 + lineName=list.get(0).get("fgs").toString();
  178 + }
  179 + }else{
153 180 lineName=list.get(0).get("xlName").toString();
154   - }else if(!fgs.equals("")){
155   - lineName=list.get(0).get("fgs").toString();
156   - }else{
157   - lineName=list.get(0).get("gs").toString();
158 181 }
159 182 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
160 183 Map<String, Object> m = new HashMap<String, Object>();
... ... @@ -196,6 +219,8 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl&lt;CalcInterval,Intege
196 219 @Override
197 220 public List<Map<String, Object>> listInterval(Map<String, Object> map) {
198 221 // TODO Auto-generated method stub
  222 + final DecimalFormat df = new DecimalFormat("0.00");
  223 +
199 224 String line=map.get("line").toString();
200 225 String date=map.get("date").toString();
201 226 String endDate=map.get("endDate").toString();
... ... @@ -216,6 +241,16 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl&lt;CalcInterval,Intege
216 241 m.put("djgZgf", t.getDjgZgf());
217 242 m.put("djgWgf", t.getDjgWgf());
218 243 m.put("djgDg", t.getDjgDg());
  244 + int djgAll=t.getDjgAll();
  245 + int bcs=t.getBcs();
  246 + //全日发生率 (大间隔次数/全日班次数)
  247 + if(bcs>0){
  248 + double fsl=(djgAll*1.0)/(bcs*1.0)*100;
  249 + m.put("fsl", df.format(fsl)+"%");
  250 + }else{
  251 + m.put("fsl", "0.0%");
  252 + }
  253 + m.put("bcs", t.getBcs());
219 254 m.put("djgTime", t.getDjgTime());
220 255 tempList.add(m);
221 256 }
... ...
src/main/resources/static/pages/forms/mould/calcIntervalCount.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/calcIntervalList1.xls
No preview for this file type
src/main/resources/static/pages/report/sheet/intervalCount.html
... ... @@ -78,6 +78,8 @@
78 78 <td>早高峰次数</td>
79 79 <td>晚高峰次数</td>
80 80 <td>低谷次数</td>
  81 + <td>全日班次数</td>
  82 + <td>全日发生率</td>
81 83 <td>最大间隔时间</td>
82 84 <td>查看</td>
83 85 </tr>
... ... @@ -122,6 +124,8 @@
122 124 <td>早高峰次数</td>
123 125 <td>晚高峰次数</td>
124 126 <td>低谷次数</td>
  127 + <td>全日班次数</td>
  128 + <td>全日发生率</td>
125 129 <td>最大间隔</td>
126 130 <td>查看</td>
127 131 </tr>
... ... @@ -196,7 +200,6 @@
196 200 for(var i = 0; i < obj.length; i++){
197 201 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
198 202 }
199   -
200 203 if(obj.length ==0){
201 204 $("#gsdmDiv").css('display','none');
202 205 }else if(obj.length ==1){
... ... @@ -213,7 +216,7 @@
213 216 $("#gsdm").on("change",updateCompany);
214 217 function updateCompany(){
215 218 var company = $('#gsdm').val();
216   - var options = '';
  219 + var options = '<option value="">全部分公司</option>';
217 220 for(var i = 0; i < obj.length; i++){
218 221 if(obj[i].companyCode == company){
219 222 var children = obj[i].children;
... ... @@ -396,6 +399,9 @@
396 399 var lineName = $('#line option:selected').text();
397 400 if(lineName == "全部线路")
398 401 lineName = $('#fgsdm option:selected').text();
  402 + if(lineName=="全部分公司")
  403 + lineName = $('#gsdm option:selected').text();
  404 +
399 405 var i = layer.load(2);
400 406 $get('/calcInterval/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,levelType:levelType,type:"export",lineName:lineName},function(result){
401 407 var dateTime = "";
... ... @@ -450,6 +456,8 @@
450 456 <td>{{obj.djgZgf}}</td>
451 457 <td>{{obj.djgWgf}}</td>
452 458 <td>{{obj.djgDg}}</td>
  459 + <td>{{obj.bcs}}</td>
  460 + <td>{{obj.fsl}}</td>
453 461 <td>{{obj.djgTime}}</td>
454 462 <td>
455 463 <button type="button" class="btn btn-sm blue btn-intervalList"
... ... @@ -502,6 +510,8 @@
502 510 <td>{{obj.djgZgf}}</td>
503 511 <td>{{obj.djgWgf}}</td>
504 512 <td>{{obj.djgDg}}</td>
  513 + <td>{{obj.bcs}}</td>
  514 + <td>{{obj.fsl}}</td>
505 515 <td>{{obj.djgTime}}</td>
506 516 <td>
507 517 <button type="button" class="btn btn-sm blue btn-intervalList_1"
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
... ... @@ -191,10 +191,10 @@
191 191 $('input:checkbox').click(function(){
192 192 var remark = $('[name=remarks]').val(), title = $(this).prop("title");
193 193 if ($(this).prop('checked')) {
194   - if (remark.indexOf(title) > -1) return;
195   - $('[name=remarks]').val((remark ? remark + ";" : "") + title);
  194 + if (remark.indexOf(title + ";;") > -1) return;
  195 + $('[name=remarks]').val((remark ? remark + "," : "") + title + ";;");
196 196 } else {
197   - $('[name=remarks]').val(remark.replace(";" + title, "").replace(title + ";", "").replace(title, ""));
  197 + $('[name=remarks]').val(remark.replace("," + title + ";;", "").replace(title + ";;", ""));
198 198 }
199 199 });
200 200 //字典转换
... ... @@ -210,15 +210,13 @@
210 210 gb_common.personAutocomplete($('.spy-autocom', modal));
211 211 // 维修类型选中
212 212 var initReport = function() {
213   - var remark = $('[name=remarks]').val(), items = remark.split(';');
214   - for (var i = 0;i < items.length;i++) {
215   - for (var j = 0;j < reportTypes.length;j++) {
216   - if (items[i] == reportTypes[j].name) {
217   - $('input:checkbox[value=' + reportTypes[j].code + ']').prop('checked', true);
218   - isReport = true;
219   - }
220   - }
221   - }
  213 + var remark = $('[name=remarks]').val();
  214 + for (var i = 0;i < reportTypes.length;i++) {
  215 + if (remark.indexOf(reportTypes[i] + ";;") > -1) {
  216 + $('input:checkbox[value=' + reportTypes[i].code + ']').prop('checked', true);
  217 + isReport = true;
  218 + }
  219 + }
222 220 }
223 221 initReport();
224 222  
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sftz.html
... ... @@ -94,10 +94,10 @@
94 94 $('input:checkbox').click(function(){
95 95 var remark = $('[name=remarks]').val(), title = $(this).prop("title");
96 96 if ($(this).prop('checked')) {
97   - if (remark.indexOf(title) > -1) return;
98   - $('[name=remarks]').val((remark ? remark + ";" : "") + title);
  97 + if (remark.indexOf(title + ";;") > -1) return;
  98 + $('[name=remarks]').val((remark ? remark + "," : "") + title + ";;");
99 99 } else {
100   - $('[name=remarks]').val(remark.replace(";" + title, "").replace(title + ";", "").replace(title, ""));
  100 + $('[name=remarks]').val(remark.replace("," + title + ";;", "").replace(title + ";;", ""));
101 101 }
102 102 });
103 103  
... ... @@ -156,14 +156,13 @@
156 156  
157 157 // 维修类型选中
158 158 var initReport = function() {
159   - var remark = $('[name=remarks]').val(), items = remark.split(';');
160   - for (var i = 0;i < items.length;i++) {
161   - for (var j = 0;j < reportTypes.length;j++) {
162   - if (items[i] == reportTypes[j].name) {
163   - $('input:checkbox[value=' + reportTypes[j].code + ']').prop('checked', true);
164   - }
165   - }
166   - }
  159 + var remark = $('[name=remarks]').val();
  160 + for (var i = 0;i < reportTypes.length;i++) {
  161 + if (remark.indexOf(reportTypes[i] + ";;") > -1) {
  162 + $('input:checkbox[value=' + reportTypes[i].code + ']').prop('checked', true);
  163 + isReport = true;
  164 + }
  165 + }
167 166 }
168 167 initReport();
169 168 });
... ...