Commit 2ce9fd5e1e75ddaedd18c6761fa6be35334564f8
Merge branch 'pudong' into pudong_test
Showing
12 changed files
with
110 additions
and
49 deletions
src/main/java/com/bsth/controller/LineController.java
| ... | ... | @@ -81,6 +81,10 @@ public class LineController extends BaseController<Line, Integer> { |
| 81 | 81 | map.put("status", ResponseCode.ERROR); |
| 82 | 82 | return map; |
| 83 | 83 | } |
| 84 | + if(t.getDestroy() == 0){ | |
| 85 | + t.setInUse(1); | |
| 86 | + } else | |
| 87 | + t.setInUse(0); | |
| 84 | 88 | // 添加线路版本 |
| 85 | 89 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 86 | 90 | try { | ... | ... |
src/main/java/com/bsth/controller/realcontrol/ReportRegisterController.java
| ... | ... | @@ -7,7 +7,6 @@ import com.bsth.controller.BaseController; |
| 7 | 7 | import com.bsth.data.report_register.ReportRegisterService; |
| 8 | 8 | import com.bsth.data.report_register.entity.ReportRegister; |
| 9 | 9 | import com.bsth.util.HttpClientUtils; |
| 10 | -import org.apache.poi.ss.formula.functions.T; | |
| 11 | 10 | import org.slf4j.Logger; |
| 12 | 11 | import org.slf4j.LoggerFactory; |
| 13 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -37,8 +36,8 @@ public class ReportRegisterController extends BaseController<ReportRegister, Lon |
| 37 | 36 | |
| 38 | 37 | Logger log = LoggerFactory.getLogger(this.getClass()); |
| 39 | 38 | |
| 40 | -// final static String url = "http://114.80.178.13/complaint/TsReport/input.do"; | |
| 41 | - final static String url = "http://192.168.168.228:8080/complaint/TsReport/input.do"; | |
| 39 | + final static String url = "http://114.80.178.13/complaint/TsReport/input.do"; | |
| 40 | +// final static String url = "http://192.168.168.228:8080/complaint/TsReport/input.do"; | |
| 42 | 41 | |
| 43 | 42 | @Autowired |
| 44 | 43 | ReportRegisterService reportRegisterService; | ... | ... |
src/main/java/com/bsth/entity/calc/CalcInterval.java
| ... | ... | @@ -34,7 +34,7 @@ public class CalcInterval { |
| 34 | 34 | /*大间隔等级*/ |
| 35 | 35 | private String level; |
| 36 | 36 | /*等级具体时间*/ |
| 37 | - private Integer levelTime; | |
| 37 | + private Double levelTime; | |
| 38 | 38 | /*全日大间隔次数*/ |
| 39 | 39 | private Integer djgAll; |
| 40 | 40 | /*高峰大间隔次数*/ |
| ... | ... | @@ -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 | /*数据修改时间*/ |
| ... | ... | @@ -100,10 +102,10 @@ public class CalcInterval { |
| 100 | 102 | public void setLevel(String level) { |
| 101 | 103 | this.level = level; |
| 102 | 104 | } |
| 103 | - public Integer getLevelTime() { | |
| 105 | + public Double getLevelTime() { | |
| 104 | 106 | return levelTime; |
| 105 | 107 | } |
| 106 | - public void setLevelTime(Integer levelTime) { | |
| 108 | + public void setLevelTime(Double levelTime) { | |
| 107 | 109 | this.levelTime = levelTime; |
| 108 | 110 | } |
| 109 | 111 | public Integer getDjgAll() { |
| ... | ... | @@ -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/repository/LineRepository.java
| ... | ... | @@ -60,14 +60,14 @@ public interface LineRepository extends BaseRepository<Line, Integer> { |
| 60 | 60 | + "l.startStationEndTime=?9, l.endStationFirstTime=?10, l.endStationEndTime=?11, l.linePlayType=?12, " |
| 61 | 61 | + "l.openDate=?13, l.es=?14, l.shortName=?15, l.shanghaiLinecode=?16, l.eqLinecode=?17, l.startPhone=?18, " |
| 62 | 62 | + "l.endPhone=?19, l.carSumNumber=?20, l.hvacCarNumber=?21, l.ordCarNumber=?22, l.history=?23, " |
| 63 | - + "l.descriptions=?24, l.destroy=?25, l.supperLine=?26, l.spacGrade=?27, l.warrantCar=?28, l.region=?30 where " | |
| 63 | + + "l.descriptions=?24, l.destroy=?25, l.supperLine=?26, l.spacGrade=?27, l.warrantCar=?28, l.region=?30 , l.inUse=?31 where " | |
| 64 | 64 | + "l.lineCode=?29") |
| 65 | - public int update(String name, String company, String brancheCompany, String level, String nature, | |
| 65 | + int update(String name, String company, String brancheCompany, String level, String nature, | |
| 66 | 66 | String startStationName, String endStationName, String startStationFirstTime, String startStationEndTime, |
| 67 | 67 | String endStationFirstTime, String endStationEndTime, Integer linePlayType, Date openDate, String es, |
| 68 | 68 | String shortName, String shanghaiLinecode, String eqLinecode, String startPhone, String endPhone, |
| 69 | 69 | Integer carSumNumber, Integer hvacCarNumber, Integer ordCarNumber, String history, String descriptions, |
| 70 | - Integer destroy, Integer supperLine, Integer spacGrade, Integer warrantCar, String lineCode, Integer region); | |
| 70 | + Integer destroy, Integer supperLine, Integer spacGrade, Integer warrantCar, String lineCode, Integer region, Integer inUser); | |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * 查询线路版本文件 | ... | ... |
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<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 | } |
| ... | ... | @@ -94,6 +102,7 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 94 | 102 | m.put("fgs", BasicData.businessFgsCodeNameMap.get(rs.getString("fgsdm")+"_"+rs.getString("gsdm"))); |
| 95 | 103 | m.put("xlBm", rs.getString("xl")); |
| 96 | 104 | m.put("line", rs.getString("xl_name")); |
| 105 | + m.put("xlName", rs.getString("xl_name"));//与另一个导出通用 | |
| 97 | 106 | m.put("id", rs.getInt("id")); |
| 98 | 107 | m.put("bcs", rs.getString("jhszfcs")); |
| 99 | 108 | m.put("zdbcs", rs.getString("sjszfczds")); |
| ... | ... | @@ -109,17 +118,20 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 109 | 118 | }else{ |
| 110 | 119 | m.put("zdlv", "0.0%"); |
| 111 | 120 | m.put("ddzdlv", "0.0%"); |
| 112 | - | |
| 113 | 121 | } |
| 114 | 122 | return m; |
| 115 | 123 | } |
| 116 | 124 | }); |
| 117 | 125 | }else{ |
| 118 | - 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," | |
| 119 | 127 | + "SUM(djg_dg) as djgDg,SUM(djg_zgf) as djgZgf,SUM(djg_wgf) as djgWgf,MAX(djg_time) as djgTime " |
| 120 | - + "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 "; | |
| 121 | 129 | if(line.equals("")){ |
| 122 | - 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 | + } | |
| 123 | 135 | }else{ |
| 124 | 136 | sql +=" and xl_bm ='"+line+"'"; |
| 125 | 137 | } |
| ... | ... | @@ -134,7 +146,17 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 134 | 146 | m.put("fgs", BasicData.businessFgsCodeNameMap.get(rs.getString("fgsbm")+"_"+rs.getString("gsbm"))); |
| 135 | 147 | m.put("xlBm", rs.getString("xl_bm")); |
| 136 | 148 | m.put("xlName", rs.getString("xl_name")); |
| 149 | + m.put("bcs", rs.getInt("bcs")); | |
| 137 | 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 | + } | |
| 138 | 160 | m.put("djgAll", rs.getString("djgAll")); |
| 139 | 161 | m.put("djgGf", rs.getString("djgGf")); |
| 140 | 162 | m.put("djgZgf", rs.getString("djgZgf")); |
| ... | ... | @@ -148,12 +170,14 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 148 | 170 | |
| 149 | 171 | if(map.get("type").equals("export")){ |
| 150 | 172 | String lineName=""; |
| 151 | - 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{ | |
| 152 | 180 | lineName=list.get(0).get("xlName").toString(); |
| 153 | - }else if(!fgs.equals("")){ | |
| 154 | - lineName=list.get(0).get("fgs").toString(); | |
| 155 | - }else{ | |
| 156 | - lineName=list.get(0).get("gs").toString(); | |
| 157 | 181 | } |
| 158 | 182 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 159 | 183 | Map<String, Object> m = new HashMap<String, Object>(); |
| ... | ... | @@ -177,7 +201,7 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 177 | 201 | xls="calcSheetList.xls"; |
| 178 | 202 | xlsName="发车到站准点率.xls"; |
| 179 | 203 | }else{ |
| 180 | - m.put("sdate", sDate); | |
| 204 | + m.put("sDate", sDate); | |
| 181 | 205 | m.put("eDate", eDate); |
| 182 | 206 | xls="calcIntervalCount.xls"; |
| 183 | 207 | xlsName="大间隔汇总表.xls"; |
| ... | ... | @@ -195,6 +219,8 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 195 | 219 | @Override |
| 196 | 220 | public List<Map<String, Object>> listInterval(Map<String, Object> map) { |
| 197 | 221 | // TODO Auto-generated method stub |
| 222 | + final DecimalFormat df = new DecimalFormat("0.00"); | |
| 223 | + | |
| 198 | 224 | String line=map.get("line").toString(); |
| 199 | 225 | String date=map.get("date").toString(); |
| 200 | 226 | String endDate=map.get("endDate").toString(); |
| ... | ... | @@ -215,6 +241,16 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 215 | 241 | m.put("djgZgf", t.getDjgZgf()); |
| 216 | 242 | m.put("djgWgf", t.getDjgWgf()); |
| 217 | 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()); | |
| 218 | 254 | m.put("djgTime", t.getDjgTime()); |
| 219 | 255 | tempList.add(m); |
| 220 | 256 | } |
| ... | ... | @@ -289,11 +325,13 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 289 | 325 | } |
| 290 | 326 | if(s.getBcType().equals("region")){ |
| 291 | 327 | if(s.getXlDir().equals("0")){ |
| 292 | - if(s.getQdzName().equals(line.getStartStationName())); | |
| 328 | + if(s.getQdzName().equals(line.getStartStationName())){ | |
| 293 | 329 | fage=true; |
| 330 | + } | |
| 294 | 331 | }else{ |
| 295 | - if(s.getQdzName().equals(line.getEndStationName())); | |
| 332 | + if(s.getQdzName().equals(line.getEndStationName())){ | |
| 296 | 333 | fage=true; |
| 334 | + } | |
| 297 | 335 | } |
| 298 | 336 | } |
| 299 | 337 | if (fage) { | ... | ... |
src/main/java/com/bsth/service/impl/LineServiceImpl.java
| ... | ... | @@ -77,13 +77,18 @@ public class LineServiceImpl extends BaseServiceImpl<Line, Integer> implements L |
| 77 | 77 | public Map<String, Object> update(Line l) { |
| 78 | 78 | Map<String, Object> map = new HashMap<>(); |
| 79 | 79 | |
| 80 | + if(l.getDestroy() == 0){ | |
| 81 | + l.setInUse(1); | |
| 82 | + } else | |
| 83 | + l.setInUse(0); | |
| 84 | + | |
| 80 | 85 | int status = repository.update(l.getName(), l.getCompany(), l.getBrancheCompany(), l.getLevel(), l.getNature(), |
| 81 | 86 | l.getStartStationName(), l.getEndStationName(), l.getStartStationFirstTime(), |
| 82 | 87 | l.getStartStationEndTime(), l.getEndStationFirstTime(), l.getEndStationEndTime(), l.getLinePlayType(), |
| 83 | 88 | l.getOpenDate(), l.getEs(), l.getShortName(), l.getShanghaiLinecode(), l.getEqLinecode(), |
| 84 | 89 | l.getStartPhone(), l.getEndPhone(), l.getCarSumNumber(), l.getHvacCarNumber(), l.getOrdCarNumber(), |
| 85 | 90 | l.getHistory(), l.getDescriptions(), l.getDestroy(), l.getSupperLine(), l.getSpacGrade(), |
| 86 | - l.getWarrantCar(), l.getLineCode(), l.getRegion()); | |
| 91 | + l.getWarrantCar(), l.getLineCode(), l.getRegion(),l.getInUse()); | |
| 87 | 92 | if (status==1) { |
| 88 | 93 | map.put("status", ResponseCode.SUCCESS); |
| 89 | 94 | } else { | ... | ... |
src/main/resources/static/pages/forms/mould/calcIntervalCount.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/calcIntervalList1.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/interval.xls
0 → 100644
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 | }); | ... | ... |