Commit 0655f0ae31a34408cbb6a9ae2c690d9169233578
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
24 changed files
with
1301 additions
and
308 deletions
src/main/java/com/bsth/controller/DownloadController.java
| ... | ... | @@ -20,6 +20,7 @@ import org.springframework.http.ResponseEntity; |
| 20 | 20 | import org.springframework.stereotype.Component; |
| 21 | 21 | import org.springframework.web.bind.annotation.RequestMapping; |
| 22 | 22 | |
| 23 | +import com.google.protobuf.UnknownFieldSet.Field; | |
| 23 | 24 | import com.mysql.fabric.Response; |
| 24 | 25 | |
| 25 | 26 | /** |
| ... | ... | @@ -74,13 +75,14 @@ public class DownloadController |
| 74 | 75 | os.write(buffer);// 输出文件 |
| 75 | 76 | os.flush(); |
| 76 | 77 | os.close(); |
| 78 | + file.delete(); | |
| 77 | 79 | } |
| 78 | 80 | |
| 79 | 81 | @RequestMapping("downloadList") |
| 80 | 82 | public void downloadList(HttpServletResponse response,String fileName) |
| 81 | 83 | throws IOException { |
| 82 | 84 | // String fileNames=URLDecoder.decode(fileName,"UTF-8"); |
| 83 | - fileName =fileName + ".zip"; | |
| 85 | + fileName = fileName + ".zip"; | |
| 84 | 86 | String moudelPath = this.getClass().getResource("/").getPath()+ "static/pages/forms/export/"+fileName; |
| 85 | 87 | File file = new File(moudelPath);// path是根据日志路径和文件名拼接出来的 |
| 86 | 88 | // String filename = file.getName();// 获取日志文件名称 |
| ... | ... | @@ -96,5 +98,6 @@ public class DownloadController |
| 96 | 98 | os.write(buffer);// 输出文件 |
| 97 | 99 | os.flush(); |
| 98 | 100 | os.close(); |
| 101 | + file.delete(); | |
| 99 | 102 | } |
| 100 | 103 | } | ... | ... |
src/main/java/com/bsth/controller/oil/DlbController.java
0 → 100644
| 1 | +package com.bsth.controller.oil; | |
| 2 | + | |
| 3 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 4 | +import org.springframework.web.bind.annotation.RestController; | |
| 5 | +import com.bsth.controller.BaseController; | |
| 6 | +import com.bsth.entity.oil.Dlb; | |
| 7 | + | |
| 8 | +@RestController | |
| 9 | +@RequestMapping("dlb") | |
| 10 | +public class DlbController extends BaseController<Dlb, Integer>{ | |
| 11 | + | |
| 12 | +} | ... | ... |
src/main/java/com/bsth/controller/schedule/BController.java
| ... | ... | @@ -40,9 +40,12 @@ public class BController<T, ID extends Serializable> { |
| 40 | 40 | SysUser sysUser = sysUserService.findByUserName(userName); |
| 41 | 41 | BEntity t_b = null; |
| 42 | 42 | if (t instanceof BEntity) { |
| 43 | + Date cdate = new Date(); | |
| 43 | 44 | t_b = (BEntity) t; |
| 44 | 45 | t_b.setCreateBy(sysUser); |
| 45 | - t_b.setCreateDate(new Date()); | |
| 46 | + t_b.setCreateDate(cdate); | |
| 47 | + t_b.setUpdateBy(sysUser); | |
| 48 | + t_b.setUpdateDate(cdate); | |
| 46 | 49 | } |
| 47 | 50 | |
| 48 | 51 | T t_saved = bService.save(t_b == null ? t : (T) t_b); | ... | ... |
src/main/java/com/bsth/controller/schedule/SchedulePlanController.java renamed to src/main/java/com/bsth/controller/schedule/core/SchedulePlanController.java
| 1 | -package com.bsth.controller.schedule; | |
| 1 | +package com.bsth.controller.schedule.core; | |
| 2 | 2 | |
| 3 | -import com.bsth.controller.BaseController; | |
| 3 | +import com.bsth.controller.schedule.BController; | |
| 4 | 4 | import com.bsth.entity.schedule.SchedulePlan; |
| 5 | 5 | import com.bsth.service.schedule.SchedulePlanService; |
| 6 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | -import org.springframework.web.bind.annotation.RequestBody; | |
| 8 | 7 | import org.springframework.web.bind.annotation.RequestMapping; |
| 9 | 8 | import org.springframework.web.bind.annotation.RequestMethod; |
| 10 | 9 | import org.springframework.web.bind.annotation.RestController; |
| 11 | 10 | |
| 12 | -import java.util.Map; | |
| 13 | - | |
| 14 | 11 | /** |
| 15 | 12 | * Created by xu on 16/6/16. |
| 16 | 13 | */ |
| 17 | 14 | @RestController |
| 18 | 15 | @RequestMapping("spc") |
| 19 | -public class SchedulePlanController extends BaseController<SchedulePlan, Long> { | |
| 16 | +public class SchedulePlanController extends BController<SchedulePlan, Long> { | |
| 20 | 17 | @Autowired |
| 21 | 18 | private SchedulePlanService schedulePlanService; |
| 22 | 19 | |
| 23 | 20 | /** |
| 24 | - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody | |
| 25 | - * @Title: save | |
| 26 | - * @Description: TODO(持久化对象) | |
| 27 | - * @param @param t | |
| 28 | - * @param @return 设定文件 | |
| 29 | - * @return Map<String,Object> {status: 1(成功),-1(失败)} | |
| 30 | - * @throws | |
| 31 | - */ | |
| 32 | - @RequestMapping(method = RequestMethod.POST) | |
| 33 | - public Map<String, Object> save(@RequestBody SchedulePlan t){ | |
| 34 | - | |
| 35 | - return baseService.save(t); | |
| 36 | - } | |
| 37 | - | |
| 38 | - /** | |
| 39 | 21 | * 获取明天的一歌排班计划。 |
| 40 | 22 | * @return |
| 41 | 23 | * @throws Exception | ... | ... |
src/main/java/com/bsth/entity/oil/Dlb.java
0 → 100644
| 1 | +package com.bsth.entity.oil; | |
| 2 | + | |
| 3 | +import java.text.DecimalFormat; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +import javax.persistence.Entity; | |
| 7 | +import javax.persistence.GeneratedValue; | |
| 8 | +import javax.persistence.Id; | |
| 9 | +import javax.persistence.Table; | |
| 10 | +import javax.persistence.Transient; | |
| 11 | + | |
| 12 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 13 | + | |
| 14 | +import com.bsth.data.BasicData; | |
| 15 | + | |
| 16 | +@Entity | |
| 17 | +@Table(name = "bsth_c_dlb") | |
| 18 | +public class Dlb { | |
| 19 | + @Id | |
| 20 | + @GeneratedValue | |
| 21 | + private Integer id; | |
| 22 | + @DateTimeFormat(pattern="yyyy-MM-dd") | |
| 23 | + private Date rq; | |
| 24 | + private String xlbm; | |
| 25 | + private String ssgsdm; | |
| 26 | + private String fgsdm; | |
| 27 | + private String nbbm; | |
| 28 | + private String jsy; | |
| 29 | + private Double czlc=0.0; | |
| 30 | + private Double jzlc=0.0; | |
| 31 | + //出站存电 | |
| 32 | + private Double czcd=0.0; | |
| 33 | + //进站存电 | |
| 34 | + private Double jzcd=0.0; | |
| 35 | + //充电量 | |
| 36 | + private Double cdl; | |
| 37 | + private int sfkt; | |
| 38 | + private String jhsj; | |
| 39 | + //耗电 | |
| 40 | + private Double hd=0.0; | |
| 41 | + private Double sh=0.0; | |
| 42 | + private String shyy; | |
| 43 | + private Double zlc=0.0; | |
| 44 | + private int yhlx; | |
| 45 | + | |
| 46 | + private Double ns=0.0; | |
| 47 | + private Double fyylc=0.0; | |
| 48 | + private Double jhzlc=0.0; | |
| 49 | + private Double jhfyylc=0.0; | |
| 50 | + private int jhzbc; | |
| 51 | + private int jhbc; | |
| 52 | + private int sjzbc; | |
| 53 | + private int sjbc; | |
| 54 | + private String edituser; | |
| 55 | + private Date edittime; | |
| 56 | + private Date createtime; | |
| 57 | + private int nylx; | |
| 58 | + //进场顺序(根据最先出场和最后进场来关联车辆的存油量) | |
| 59 | + private int jcsx; | |
| 60 | + | |
| 61 | + @Transient | |
| 62 | + private String bglyh; | |
| 63 | + | |
| 64 | + @Transient | |
| 65 | + private String xlname; | |
| 66 | + | |
| 67 | + @Transient | |
| 68 | + private String gsname; | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + public Integer getId() { | |
| 74 | + return id; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setId(Integer id) { | |
| 78 | + this.id = id; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public Date getRq() { | |
| 82 | + return rq; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public void setRq(Date rq) { | |
| 86 | + this.rq = rq; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public String getXlbm() { | |
| 90 | + return xlbm; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public void setXlbm(String xlbm) { | |
| 94 | + this.xlbm = xlbm; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public String getSsgsdm() { | |
| 98 | + return ssgsdm; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public void setSsgsdm(String ssgsdm) { | |
| 102 | + this.ssgsdm = ssgsdm; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public String getFgsdm() { | |
| 106 | + return fgsdm; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public void setFgsdm(String fgsdm) { | |
| 110 | + this.fgsdm = fgsdm; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public String getNbbm() { | |
| 114 | + return nbbm; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public void setNbbm(String nbbm) { | |
| 118 | + this.nbbm = nbbm; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public String getJsy() { | |
| 122 | + return jsy; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public void setJsy(String jsy) { | |
| 126 | + this.jsy = jsy; | |
| 127 | + } | |
| 128 | + | |
| 129 | + public Double getCzlc() { | |
| 130 | + return czlc; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public void setCzlc(Double czlc) { | |
| 134 | + this.czlc = czlc; | |
| 135 | + } | |
| 136 | + | |
| 137 | + public Double getJzlc() { | |
| 138 | + return jzlc; | |
| 139 | + } | |
| 140 | + | |
| 141 | + public void setJzlc(Double jzlc) { | |
| 142 | + this.jzlc = jzlc; | |
| 143 | + } | |
| 144 | + | |
| 145 | + public Double getCzcd() { | |
| 146 | + return czcd; | |
| 147 | + } | |
| 148 | + | |
| 149 | + public void setCzcd(Double czcd) { | |
| 150 | + this.czcd = czcd; | |
| 151 | + } | |
| 152 | + | |
| 153 | + public Double getJzcd() { | |
| 154 | + return jzcd; | |
| 155 | + } | |
| 156 | + | |
| 157 | + public void setJzcd(Double jzcd) { | |
| 158 | + this.jzcd = jzcd; | |
| 159 | + } | |
| 160 | + | |
| 161 | + public Double getCdl() { | |
| 162 | + return cdl; | |
| 163 | + } | |
| 164 | + | |
| 165 | + public void setCdl(Double cdl) { | |
| 166 | + this.cdl = cdl; | |
| 167 | + } | |
| 168 | + | |
| 169 | + public int getSfkt() { | |
| 170 | + return sfkt; | |
| 171 | + } | |
| 172 | + | |
| 173 | + public void setSfkt(int sfkt) { | |
| 174 | + this.sfkt = sfkt; | |
| 175 | + } | |
| 176 | + | |
| 177 | + public String getJhsj() { | |
| 178 | + return jhsj; | |
| 179 | + } | |
| 180 | + | |
| 181 | + public void setJhsj(String jhsj) { | |
| 182 | + this.jhsj = jhsj; | |
| 183 | + } | |
| 184 | + | |
| 185 | + public Double getHd() { | |
| 186 | + return hd; | |
| 187 | + } | |
| 188 | + | |
| 189 | + public void setHd(Double hd) { | |
| 190 | + this.hd = hd; | |
| 191 | + } | |
| 192 | + | |
| 193 | + public Double getSh() { | |
| 194 | + return sh; | |
| 195 | + } | |
| 196 | + | |
| 197 | + public void setSh(Double sh) { | |
| 198 | + this.sh = sh; | |
| 199 | + } | |
| 200 | + | |
| 201 | + public String getShyy() { | |
| 202 | + return shyy; | |
| 203 | + } | |
| 204 | + | |
| 205 | + public void setShyy(String shyy) { | |
| 206 | + this.shyy = shyy; | |
| 207 | + } | |
| 208 | + | |
| 209 | + public Double getZlc() { | |
| 210 | + return zlc; | |
| 211 | + } | |
| 212 | + | |
| 213 | + public void setZlc(Double zlc) { | |
| 214 | + this.zlc = zlc; | |
| 215 | + } | |
| 216 | + | |
| 217 | + public int getYhlx() { | |
| 218 | + return yhlx; | |
| 219 | + } | |
| 220 | + | |
| 221 | + public void setYhlx(int yhlx) { | |
| 222 | + this.yhlx = yhlx; | |
| 223 | + } | |
| 224 | + | |
| 225 | + public Double getNs() { | |
| 226 | + return ns; | |
| 227 | + } | |
| 228 | + | |
| 229 | + public void setNs(Double ns) { | |
| 230 | + this.ns = ns; | |
| 231 | + } | |
| 232 | + | |
| 233 | + public Double getFyylc() { | |
| 234 | + return fyylc; | |
| 235 | + } | |
| 236 | + | |
| 237 | + public void setFyylc(Double fyylc) { | |
| 238 | + this.fyylc = fyylc; | |
| 239 | + } | |
| 240 | + | |
| 241 | + public Double getJhzlc() { | |
| 242 | + return jhzlc; | |
| 243 | + } | |
| 244 | + | |
| 245 | + public void setJhzlc(Double jhzlc) { | |
| 246 | + this.jhzlc = jhzlc; | |
| 247 | + } | |
| 248 | + | |
| 249 | + public Double getJhfyylc() { | |
| 250 | + return jhfyylc; | |
| 251 | + } | |
| 252 | + | |
| 253 | + public void setJhfyylc(Double jhfyylc) { | |
| 254 | + this.jhfyylc = jhfyylc; | |
| 255 | + } | |
| 256 | + | |
| 257 | + public int getJhzbc() { | |
| 258 | + return jhzbc; | |
| 259 | + } | |
| 260 | + | |
| 261 | + public void setJhzbc(int jhzbc) { | |
| 262 | + this.jhzbc = jhzbc; | |
| 263 | + } | |
| 264 | + | |
| 265 | + public int getJhbc() { | |
| 266 | + return jhbc; | |
| 267 | + } | |
| 268 | + | |
| 269 | + public void setJhbc(int jhbc) { | |
| 270 | + this.jhbc = jhbc; | |
| 271 | + } | |
| 272 | + | |
| 273 | + public int getSjzbc() { | |
| 274 | + return sjzbc; | |
| 275 | + } | |
| 276 | + | |
| 277 | + public void setSjzbc(int sjzbc) { | |
| 278 | + this.sjzbc = sjzbc; | |
| 279 | + } | |
| 280 | + | |
| 281 | + public int getSjbc() { | |
| 282 | + return sjbc; | |
| 283 | + } | |
| 284 | + | |
| 285 | + public void setSjbc(int sjbc) { | |
| 286 | + this.sjbc = sjbc; | |
| 287 | + } | |
| 288 | + | |
| 289 | + public String getEdituser() { | |
| 290 | + return edituser; | |
| 291 | + } | |
| 292 | + | |
| 293 | + public void setEdituser(String edituser) { | |
| 294 | + this.edituser = edituser; | |
| 295 | + } | |
| 296 | + | |
| 297 | + public Date getEdittime() { | |
| 298 | + return edittime; | |
| 299 | + } | |
| 300 | + | |
| 301 | + public void setEdittime(Date edittime) { | |
| 302 | + this.edittime = edittime; | |
| 303 | + } | |
| 304 | + | |
| 305 | + public Date getCreatetime() { | |
| 306 | + return createtime; | |
| 307 | + } | |
| 308 | + | |
| 309 | + public void setCreatetime(Date createtime) { | |
| 310 | + this.createtime = createtime; | |
| 311 | + } | |
| 312 | + | |
| 313 | + public int getNylx() { | |
| 314 | + return nylx; | |
| 315 | + } | |
| 316 | + | |
| 317 | + public void setNylx(int nylx) { | |
| 318 | + this.nylx = nylx; | |
| 319 | + } | |
| 320 | + | |
| 321 | + public int getJcsx() { | |
| 322 | + return jcsx; | |
| 323 | + } | |
| 324 | + | |
| 325 | + public void setJcsx(int jcsx) { | |
| 326 | + this.jcsx = jcsx; | |
| 327 | + } | |
| 328 | + | |
| 329 | + public String getBglyh() { | |
| 330 | + if(this.getZlc()==0){ | |
| 331 | + return "0.00"; | |
| 332 | + }else{ | |
| 333 | + DecimalFormat df = new DecimalFormat("0.00"); | |
| 334 | + return df.format(this.getHd()/this.getZlc()*100); | |
| 335 | + } | |
| 336 | + } | |
| 337 | + | |
| 338 | + public void setBglyh(String bglyh) { | |
| 339 | + this.bglyh = bglyh; | |
| 340 | + } | |
| 341 | + | |
| 342 | + public String getXlname() { | |
| 343 | + return BasicData.lineCode2NameMap.get(this.xlbm); | |
| 344 | + } | |
| 345 | + | |
| 346 | + public void setXlname(String xlname) { | |
| 347 | + this.xlname = xlname; | |
| 348 | + } | |
| 349 | + | |
| 350 | + public String getGsname() { | |
| 351 | + return BasicData.businessCodeNameMap.get(this.ssgsdm); | |
| 352 | + } | |
| 353 | + | |
| 354 | + public void setGsname(String gsname) { | |
| 355 | + this.gsname = gsname; | |
| 356 | + } | |
| 357 | + | |
| 358 | + | |
| 359 | +} | ... | ... |
src/main/java/com/bsth/entity/oil/Jdl.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 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 11 | + | |
| 12 | +@Entity | |
| 13 | +@Table(name = "bsth_c_jdl") | |
| 14 | +public class Jdl { | |
| 15 | + @Id | |
| 16 | + @GeneratedValue | |
| 17 | + private Integer id; | |
| 18 | + @DateTimeFormat(pattern="yyyy-MM-dd") | |
| 19 | + private Date rq; | |
| 20 | + private String gsBm; | |
| 21 | + private String gsName; | |
| 22 | + private String fgsBm; | |
| 23 | + private String fgsName; | |
| 24 | + private String clZbh; | |
| 25 | + private Double jdl = 0.0; | |
| 26 | + private String jdz; | |
| 27 | + private String remarks; | |
| 28 | + | |
| 29 | + | |
| 30 | + public Integer getId() { | |
| 31 | + return id; | |
| 32 | + } | |
| 33 | + public void setId(Integer id) { | |
| 34 | + this.id = id; | |
| 35 | + } | |
| 36 | + public Date getRq() { | |
| 37 | + return rq; | |
| 38 | + } | |
| 39 | + public void setRq(Date rq) { | |
| 40 | + this.rq = rq; | |
| 41 | + } | |
| 42 | + public String getGsBm() { | |
| 43 | + return gsBm; | |
| 44 | + } | |
| 45 | + public void setGsBm(String gsBm) { | |
| 46 | + this.gsBm = gsBm; | |
| 47 | + } | |
| 48 | + public String getGsName() { | |
| 49 | + return gsName; | |
| 50 | + } | |
| 51 | + public void setGsName(String gsName) { | |
| 52 | + this.gsName = gsName; | |
| 53 | + } | |
| 54 | + public String getFgsBm() { | |
| 55 | + return fgsBm; | |
| 56 | + } | |
| 57 | + public void setFgsBm(String fgsBm) { | |
| 58 | + this.fgsBm = fgsBm; | |
| 59 | + } | |
| 60 | + public String getFgsName() { | |
| 61 | + return fgsName; | |
| 62 | + } | |
| 63 | + public void setFgsName(String fgsName) { | |
| 64 | + this.fgsName = fgsName; | |
| 65 | + } | |
| 66 | + public String getClZbh() { | |
| 67 | + return clZbh; | |
| 68 | + } | |
| 69 | + public void setClZbh(String clZbh) { | |
| 70 | + this.clZbh = clZbh; | |
| 71 | + } | |
| 72 | + public Double getJdl() { | |
| 73 | + return jdl; | |
| 74 | + } | |
| 75 | + public void setJdl(Double jdl) { | |
| 76 | + this.jdl = jdl; | |
| 77 | + } | |
| 78 | + public String getJdz() { | |
| 79 | + return jdz; | |
| 80 | + } | |
| 81 | + public void setJdz(String jdz) { | |
| 82 | + this.jdz = jdz; | |
| 83 | + } | |
| 84 | + public String getRemarks() { | |
| 85 | + return remarks; | |
| 86 | + } | |
| 87 | + public void setRemarks(String remarks) { | |
| 88 | + this.remarks = remarks; | |
| 89 | + } | |
| 90 | + | |
| 91 | +} | ... | ... |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| ... | ... | @@ -344,6 +344,8 @@ public class ScheduleRealInfo { |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | public String getsGh() { |
| 347 | + if(sGh == null) | |
| 348 | + return ""; | |
| 347 | 349 | return sGh; |
| 348 | 350 | } |
| 349 | 351 | |
| ... | ... | @@ -352,6 +354,8 @@ public class ScheduleRealInfo { |
| 352 | 354 | } |
| 353 | 355 | |
| 354 | 356 | public String getsName() { |
| 357 | + if(sGh == null) | |
| 358 | + return ""; | |
| 355 | 359 | return sName; |
| 356 | 360 | } |
| 357 | 361 | ... | ... |
src/main/java/com/bsth/entity/schedule/SchedulePlan.java
| ... | ... | @@ -2,7 +2,6 @@ package com.bsth.entity.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.Line; |
| 4 | 4 | import com.bsth.entity.schedule.rule.ScheduleRule1; |
| 5 | -import com.bsth.entity.sys.SysUser; | |
| 6 | 5 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 7 | 6 | |
| 8 | 7 | import javax.persistence.*; |
| ... | ... | @@ -21,7 +20,7 @@ import java.util.List; |
| 21 | 20 | @NamedAttributeNode("ttInfo") |
| 22 | 21 | }) |
| 23 | 22 | }) |
| 24 | -public class SchedulePlan { | |
| 23 | +public class SchedulePlan extends BEntity { | |
| 25 | 24 | |
| 26 | 25 | /** 主键Id */ |
| 27 | 26 | @Id |
| ... | ... | @@ -60,19 +59,6 @@ public class SchedulePlan { |
| 60 | 59 | @OneToMany(mappedBy = "schedulePlan", cascade = CascadeType.ALL, fetch = FetchType.LAZY) |
| 61 | 60 | private List<SchedulePlanInfo> schedulePlanInfoList = new ArrayList<>(); |
| 62 | 61 | |
| 63 | - /** 创建人 */ | |
| 64 | - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | |
| 65 | - private SysUser createBy; | |
| 66 | - /** 修改人 */ | |
| 67 | - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | |
| 68 | - private SysUser updateBy; | |
| 69 | - /** 创建日期 */ | |
| 70 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 71 | - private Date createDate; | |
| 72 | - /** 修改日期 */ | |
| 73 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 74 | - private Date updateDate; | |
| 75 | - | |
| 76 | 62 | public Long getId() { |
| 77 | 63 | return id; |
| 78 | 64 | } |
| ... | ... | @@ -129,38 +115,6 @@ public class SchedulePlan { |
| 129 | 115 | this.schedulePlanInfoList = schedulePlanInfoList; |
| 130 | 116 | } |
| 131 | 117 | |
| 132 | - public SysUser getCreateBy() { | |
| 133 | - return createBy; | |
| 134 | - } | |
| 135 | - | |
| 136 | - public void setCreateBy(SysUser createBy) { | |
| 137 | - this.createBy = createBy; | |
| 138 | - } | |
| 139 | - | |
| 140 | - public SysUser getUpdateBy() { | |
| 141 | - return updateBy; | |
| 142 | - } | |
| 143 | - | |
| 144 | - public void setUpdateBy(SysUser updateBy) { | |
| 145 | - this.updateBy = updateBy; | |
| 146 | - } | |
| 147 | - | |
| 148 | - public Date getCreateDate() { | |
| 149 | - return createDate; | |
| 150 | - } | |
| 151 | - | |
| 152 | - public void setCreateDate(Date createDate) { | |
| 153 | - this.createDate = createDate; | |
| 154 | - } | |
| 155 | - | |
| 156 | - public Date getUpdateDate() { | |
| 157 | - return updateDate; | |
| 158 | - } | |
| 159 | - | |
| 160 | - public void setUpdateDate(Date updateDate) { | |
| 161 | - this.updateDate = updateDate; | |
| 162 | - } | |
| 163 | - | |
| 164 | 118 | public String getTtInfoNames() { |
| 165 | 119 | return ttInfoNames; |
| 166 | 120 | } | ... | ... |
src/main/java/com/bsth/repository/oil/DlbRepository.java
0 → 100644
src/main/java/com/bsth/service/oil/DlbService.java
0 → 100644
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.oil.impl; | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | +import org.springframework.stereotype.Service; | |
| 6 | + | |
| 7 | +import com.bsth.entity.oil.Dlb; | |
| 8 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 9 | +import com.bsth.service.oil.DlbService; | |
| 10 | + | |
| 11 | +@Service | |
| 12 | +public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbService{ | |
| 13 | + | |
| 14 | + | |
| 15 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/SchedulePlanService.java
| 1 | 1 | package com.bsth.service.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.schedule.SchedulePlan; |
| 4 | -import com.bsth.service.BaseService; | |
| 5 | 4 | |
| 6 | 5 | /** |
| 7 | 6 | * Created by xu on 16/6/16. |
| 8 | 7 | */ |
| 9 | -public interface SchedulePlanService extends BaseService<SchedulePlan, Long> { | |
| 8 | +public interface SchedulePlanService extends BService<SchedulePlan, Long> { | |
| 10 | 9 | /** |
| 11 | 10 | * 获取有明日排班的计划。 |
| 12 | 11 | * @return | ... | ... |
src/main/java/com/bsth/service/schedule/SchedulePlanServiceImpl.java renamed to src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
| 1 | -package com.bsth.service.schedule; | |
| 1 | +package com.bsth.service.schedule.impl; | |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.Line; |
| 4 | 4 | import com.bsth.entity.schedule.*; |
| 5 | 5 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 6 | 6 | import com.bsth.repository.schedule.SchedulePlanInfoRepository; |
| 7 | 7 | import com.bsth.repository.schedule.SchedulePlanRepository; |
| 8 | -import com.bsth.service.impl.BaseServiceImpl; | |
| 8 | +import com.bsth.service.schedule.SchedulePlanService; | |
| 9 | 9 | import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; |
| 10 | 10 | import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output; |
| 11 | 11 | import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output; |
| ... | ... | @@ -28,7 +28,7 @@ import java.util.*; |
| 28 | 28 | * Created by xu on 16/6/16. |
| 29 | 29 | */ |
| 30 | 30 | @Service |
| 31 | -public class SchedulePlanServiceImpl extends BaseServiceImpl<SchedulePlan, Long> implements SchedulePlanService { | |
| 31 | +public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> implements SchedulePlanService { | |
| 32 | 32 | @Autowired |
| 33 | 33 | private KieBase kieBase; |
| 34 | 34 | @Autowired |
| ... | ... | @@ -40,7 +40,7 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl<SchedulePlan, Long> |
| 40 | 40 | |
| 41 | 41 | @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED) |
| 42 | 42 | @Override |
| 43 | - public Map<String, Object> save(SchedulePlan schedulePlan) { | |
| 43 | + public SchedulePlan save(SchedulePlan schedulePlan) { | |
| 44 | 44 | // 1-1、查找线路具体信息 |
| 45 | 45 | Line xl = strategy.getLine(schedulePlan.getXl().getId()); |
| 46 | 46 | // 1-2、查出指定线路的所有规则 |
| ... | ... | @@ -126,7 +126,9 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl<SchedulePlan, Long> |
| 126 | 126 | |
| 127 | 127 | // 3-2、保存生成的排班和明细 |
| 128 | 128 | schedulePlan.getSchedulePlanInfoList().addAll(schedulePlanInfos); // 关联的排班明细信息 |
| 129 | - return super.save(schedulePlan); | |
| 129 | + super.save(schedulePlan); | |
| 130 | + | |
| 131 | + return new SchedulePlan(); | |
| 130 | 132 | } |
| 131 | 133 | |
| 132 | 134 | @Override | ... | ... |
src/main/resources/static/pages/electricity/list/list.html
0 → 100644
| 1 | +<div class="page-head"> | |
| 2 | + <div class="page-title"> | |
| 3 | + <h1>进出场存电量</h1> | |
| 4 | + </div> | |
| 5 | +</div> | |
| 6 | + | |
| 7 | +<ul class="page-breadcrumb breadcrumb"> | |
| 8 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 9 | + <li><span class="active">用电管理</span> <i class="fa fa-circle"></i></li> | |
| 10 | + <li><span class="active">进出场存电量</span></li> | |
| 11 | +</ul> | |
| 12 | + | |
| 13 | +<div class="row" id="ll_oil_list"> | |
| 14 | + <div class="col-md-12"> | |
| 15 | + <!-- Begin: life time stats --> | |
| 16 | + <div class="portlet light portlet-fit portlet-datatable bordered"> | |
| 17 | + <div class="portlet-title"> | |
| 18 | + <div class="caption"> | |
| 19 | + <i class="fa fa-fire-extinguisher"></i> <span | |
| 20 | + class="caption-subject font-dark sbold uppercase">进出场存电量表</span> | |
| 21 | + </div> | |
| 22 | + <div class="actions"> | |
| 23 | + <!-- <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> --> | |
| 24 | + <button type="button" class="btn btn-circle blue" id="obtain"><i class="fa fa-hourglass-half"></i> | |
| 25 | + 获取加/存电信息 | |
| 26 | + </button> | |
| 27 | + <button type="button" class="btn btn-circle blue" id="checkYl"><i class="fa fa-gg-circle"></i> | |
| 28 | + 核对加注量(有加电无里程) | |
| 29 | + </button> | |
| 30 | + <button type="button" class="btn btn-circle blue" id="export"><i class="fa fa-file-excel-o"></i> | |
| 31 | + 导出Excel | |
| 32 | + </button> | |
| 33 | + <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> --> | |
| 34 | + </div> | |
| 35 | + </div> | |
| 36 | + <div class="portlet-body"> | |
| 37 | + <div class="table-container" style="margin-top: 10px"> | |
| 38 | + <table | |
| 39 | + class="table table-striped table-bordered table-hover table-checkable" | |
| 40 | + id="datatable_dlb"> | |
| 41 | + <thead> | |
| 42 | + <tr role="row" class="filter"> | |
| 43 | + <td> 公司:</td> | |
| 44 | + <td colspan="2"> | |
| 45 | + | |
| 46 | + <select class="form-control" name="ssgsdm_like" id="ylbListGsdmId" ></select> | |
| 47 | + | |
| 48 | + </td> | |
| 49 | + <td> | |
| 50 | + 分公司: | |
| 51 | + </td> | |
| 52 | + <td colspan="2"> | |
| 53 | + | |
| 54 | + <select class="form-control" name="fgsdm_like" id="ylbListFgsdmId" ></select> | |
| 55 | + </td> | |
| 56 | + | |
| 57 | + <td> | |
| 58 | + 日期: | |
| 59 | + </td> | |
| 60 | + <td> | |
| 61 | + <input type="text" style="width: 80px" name="rq" id="rq"/> | |
| 62 | + </td> | |
| 63 | + <td > | |
| 64 | + 线路: | |
| 65 | + </td> | |
| 66 | + <td colspan="2"> | |
| 67 | + <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select> | |
| 68 | + | |
| 69 | + </td> | |
| 70 | + <td > | |
| 71 | + 内部编码: | |
| 72 | + </td> | |
| 73 | + <td colspan="2"> | |
| 74 | + <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select> | |
| 75 | + </td> | |
| 76 | + <td colspan="4"> | |
| 77 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px"> | |
| 78 | + <i class="fa fa-search"></i> 搜索 | |
| 79 | + </button> | |
| 80 | + | |
| 81 | + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> | |
| 82 | + <i class="fa fa-times"></i> 重置 | |
| 83 | + </button> | |
| 84 | + | |
| 85 | + </td> | |
| 86 | + </tr> | |
| 87 | + <tr role="row" class="heading"> | |
| 88 | + <th width="2%">#</th> | |
| 89 | + <th width="9%">日期</th> | |
| 90 | + <th width="6%">公司</th> | |
| 91 | + <th width="9%">线路</th> | |
| 92 | + <th width="6%">自编号</th> | |
| 93 | + <th width="7%">驾驶员</th> | |
| 94 | + <th width="4%">充电量</th> | |
| 95 | + <th width="5%">出场公里</th> | |
| 96 | + <th width="4%">进场公里</th> | |
| 97 | + <th width="4%">出场存电</th> | |
| 98 | + <th width="4%">进场存电</th> | |
| 99 | + <th width="5%">耗电</th> | |
| 100 | + <th width="4%">尿素</th> | |
| 101 | + <th width="5%">耗损原因</th> | |
| 102 | + <th width="5%">耗损电量</th> | |
| 103 | + <th width="5%">当日总里程</th> | |
| 104 | + <th width="5%">数据类型</th> | |
| 105 | + <th width="5%">百公里电耗</th> | |
| 106 | + <!-- <th width="5%">操作</th> --> | |
| 107 | + </tr> | |
| 108 | + </thead> | |
| 109 | + <tbody></tbody> | |
| 110 | + </table> | |
| 111 | + <div style="text-align: right;"> | |
| 112 | + <ul id="pagination" class="pagination"></ul> | |
| 113 | + </div> | |
| 114 | + </div> | |
| 115 | + </div> | |
| 116 | + </div> | |
| 117 | + </div> | |
| 118 | +</div> | |
| 119 | + | |
| 120 | +<script id="ylb_list_temp" type="text/html"> | |
| 121 | + {{each list as obj i}} | |
| 122 | + <tr> | |
| 123 | + <td style="vertical-align: middle;"> | |
| 124 | + <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> | |
| 125 | + </td> | |
| 126 | + | |
| 127 | + <td> | |
| 128 | + {{obj.rq}} | |
| 129 | + </td> | |
| 130 | + <td> | |
| 131 | + {{obj.gsname}} | |
| 132 | + </td> | |
| 133 | + <td> | |
| 134 | + {{obj.xlname}} | |
| 135 | + </td> | |
| 136 | + <td> | |
| 137 | + {{obj.nbbm}} | |
| 138 | + </td> | |
| 139 | + <td> | |
| 140 | + {{obj.jsy}} | |
| 141 | + </td> | |
| 142 | + <td> | |
| 143 | + {{obj.jzl}} | |
| 144 | + </td> | |
| 145 | + <td> | |
| 146 | + {{obj.czlc}} | |
| 147 | + </td> | |
| 148 | + <td> | |
| 149 | + {{obj.jzlc}} | |
| 150 | + </td> | |
| 151 | + <td> | |
| 152 | + {{obj.czyl}} | |
| 153 | + </td> | |
| 154 | + <td> | |
| 155 | + <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzyl"> | |
| 156 | + {{obj.jzyl}} | |
| 157 | + </a> | |
| 158 | + </td> | |
| 159 | + <td> | |
| 160 | + {{obj.yh}} | |
| 161 | + </td> | |
| 162 | + <td> | |
| 163 | + {{obj.ns}} | |
| 164 | + </td> | |
| 165 | + <td> | |
| 166 | + {{obj.shyy}} | |
| 167 | + </td> | |
| 168 | + <td> | |
| 169 | + {{obj.sh}} | |
| 170 | + </td> | |
| 171 | + <td> | |
| 172 | + {{obj.zlc}} | |
| 173 | + </td> | |
| 174 | + <td> | |
| 175 | + {{obj.yhlx}} | |
| 176 | + </td> | |
| 177 | + <td> | |
| 178 | + {{obj.bglyh}} | |
| 179 | + </td> | |
| 180 | + <td> | |
| 181 | + <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>--> | |
| 182 | + </td> | |
| 183 | + </tr> | |
| 184 | + {{/each}} | |
| 185 | + {{if list.length == 0}} | |
| 186 | + <tr> | |
| 187 | + <td colspan=19><h6 class="muted">没有找到相关数据</h6></td> | |
| 188 | + </tr> | |
| 189 | + {{/if}} | |
| 190 | +</script> | |
| 191 | + | |
| 192 | +<script> | |
| 193 | + $(function () { | |
| 194 | + //var id = 15; | |
| 195 | + //$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list') | |
| 196 | + | |
| 197 | + $("#checkYl").on('click', function () { | |
| 198 | + if ($("#rq").val() != "") { | |
| 199 | + var cells = $('tr.filter')[0].cells | |
| 200 | + , params = {} | |
| 201 | + , name; | |
| 202 | + $.each(cells, function (i, cell) { | |
| 203 | + var items = $('input,select', cell); | |
| 204 | + for (var j = 0, item; item = items[j++];) { | |
| 205 | + name = $(item).attr('name'); | |
| 206 | + if (name) { | |
| 207 | + params[name] = $(item).val(); | |
| 208 | + } | |
| 209 | + } | |
| 210 | + }); | |
| 211 | + $get('/ylb/checkYl', params, function () { | |
| 212 | + jsDoQuery(null, true); | |
| 213 | + }); | |
| 214 | + } else { | |
| 215 | + layer.msg('请选择日期.'); | |
| 216 | + } | |
| 217 | + }) | |
| 218 | + | |
| 219 | + | |
| 220 | + //获取加存信息 | |
| 221 | + $("#obtain").on('click', function () { | |
| 222 | + if ($("#rq").val() != "") { | |
| 223 | + var cells = $('tr.filter')[0].cells | |
| 224 | + , params = {} | |
| 225 | + , name; | |
| 226 | + $.each(cells, function (i, cell) { | |
| 227 | + var items = $('input,select', cell); | |
| 228 | + for (var j = 0, item; item = items[j++];) { | |
| 229 | + name = $(item).attr('name'); | |
| 230 | + if (name) { | |
| 231 | + params[name] = $(item).val(); | |
| 232 | + } | |
| 233 | + } | |
| 234 | + }); | |
| 235 | + $get('/ylb/obtain', params, function () { | |
| 236 | + jsDoQuery(params, true); | |
| 237 | + }); | |
| 238 | + } else { | |
| 239 | + layer.msg('请选择日期.'); | |
| 240 | + } | |
| 241 | + | |
| 242 | + }) | |
| 243 | + $("#rq").datetimepicker({ | |
| 244 | + format: 'YYYY-MM-DD', | |
| 245 | + locale: 'zh-cn' | |
| 246 | + }); | |
| 247 | + | |
| 248 | + var page = 0, initPagination; | |
| 249 | + var icheckOptions = { | |
| 250 | + radioClass: 'iradio_square-blue icheck', | |
| 251 | + increaseArea: '20%' | |
| 252 | + } | |
| 253 | + | |
| 254 | + //重置 | |
| 255 | + $('tr.filter .filter-cancel').on('click', function () { | |
| 256 | + $('tr.filter input, select').val('').change(); | |
| 257 | + }); | |
| 258 | + | |
| 259 | + //提交 | |
| 260 | + $('tr.filter .filter-submit').on('click', function () { | |
| 261 | + var ylbGsdm=$("#ylbListGsdmId").val(); | |
| 262 | + var ylbFgsdm=$("#ylbListFgsdmId").val(); | |
| 263 | + if ($("#rq").val() == "" || $("#rq").val() ==null){ | |
| 264 | + layer.msg('请选择日期.'); | |
| 265 | + }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){ | |
| 266 | + layer.msg('请选择公司和分公司.'); | |
| 267 | + }else { | |
| 268 | + var cells = $('tr.filter')[0].cells | |
| 269 | + , params = {} | |
| 270 | + , name; | |
| 271 | + $.each(cells, function (i, cell) { | |
| 272 | + var items = $('input,select', cell); | |
| 273 | + for (var j = 0, item; item = items[j++];) { | |
| 274 | + name = $(item).attr('name'); | |
| 275 | + if (name) { | |
| 276 | + params[name] = $(item).val(); | |
| 277 | + } | |
| 278 | + } | |
| 279 | + }); | |
| 280 | + page = 0; | |
| 281 | + jsDoQuery(params, true); | |
| 282 | + } | |
| 283 | + }); | |
| 284 | + | |
| 285 | + | |
| 286 | +// var gsqxdm=""; | |
| 287 | + | |
| 288 | + | |
| 289 | + $.get('/user/companyData', function(result){ | |
| 290 | + obj = result; | |
| 291 | + var options=""; | |
| 292 | +// = '<option value="">请选择</option>'; | |
| 293 | + for(var i = 0; i < obj.length; i++){ | |
| 294 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 295 | +// setFgsqx(obj[i].companyCode); | |
| 296 | + } | |
| 297 | + $('#ylbListGsdmId').html(options); | |
| 298 | + updateCompany(); | |
| 299 | + }); | |
| 300 | + /* function setFgsqx(gs){ | |
| 301 | + var company =gs | |
| 302 | + var options = ''; | |
| 303 | + for(var i = 0; i < obj.length; i++){ | |
| 304 | + if(obj[i].companyCode == company){ | |
| 305 | + var children = obj[i].children; | |
| 306 | + for(var j = 0; j < children.length; j++){ | |
| 307 | + gsqxdm +=company+""+children[j].code+","; | |
| 308 | + } | |
| 309 | + } | |
| 310 | + } | |
| 311 | + } */ | |
| 312 | + $("#ylbListGsdmId").on("change",updateCompany); | |
| 313 | + function updateCompany(){ | |
| 314 | + var company = $('#ylbListGsdmId').val(); | |
| 315 | + var options =""; | |
| 316 | +// = '<option value="">请选择</option>'; | |
| 317 | + for(var i = 0; i < obj.length; i++){ | |
| 318 | + if(obj[i].companyCode == company){ | |
| 319 | + var children = obj[i].children; | |
| 320 | + for(var j = 0; j < children.length; j++){ | |
| 321 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 322 | + } | |
| 323 | + } | |
| 324 | + } | |
| 325 | + $('#ylbListFgsdmId').html(options); | |
| 326 | + } | |
| 327 | + /* | |
| 328 | + * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | |
| 329 | + */ | |
| 330 | + function jsDoQuery(p, pagination) { | |
| 331 | + var params = {}; | |
| 332 | + if (p) | |
| 333 | + params = p; | |
| 334 | + //更新时间排序 | |
| 335 | + params['order'] = 'nbbm'; | |
| 336 | + params['page'] = page; | |
| 337 | + params['rq'] = $("#rq").val(); | |
| 338 | + | |
| 339 | + /* var ylbGsdm=$("#ylbListGsdmId").val(); | |
| 340 | + var ylbFgsdm=$("#ylbListFgsdmId").val(); | |
| 341 | + if(ylbGsdm==''|| ylbGsdm==null){ | |
| 342 | + params['concat(ssgsdm,fgsdm)_in']=gsqxdm; | |
| 343 | + }else{ | |
| 344 | + if(ylbFgsdm==''||ylbFgsdm==null){ | |
| 345 | + var fgsqx1=''; | |
| 346 | + for(var i = 0; i < obj.length; i++){ | |
| 347 | + if(obj[i].companyCode == ylbGsdm){ | |
| 348 | + var children = obj[i].children; | |
| 349 | + for(var j = 0; j < children.length; j++){ | |
| 350 | + fgsqx1 +=children[j].code+","; | |
| 351 | + } | |
| 352 | + } | |
| 353 | + } | |
| 354 | + params['fgsdm_in']=fgsqx1; | |
| 355 | + } | |
| 356 | + } */ | |
| 357 | + var i = layer.load(2); | |
| 358 | + $get('/ylb', params, function (data) { | |
| 359 | + $.each(data.content, function (i, obj) { | |
| 360 | + obj.rq = moment(obj.rq).format("YYYY-MM-DD"); | |
| 361 | + }); | |
| 362 | + var bodyHtm = template('ylb_list_temp', {list: data.content}); | |
| 363 | + | |
| 364 | + $('#datatable_dlb tbody').html(bodyHtm) | |
| 365 | + .find('.icheck').iCheck(icheckOptions) | |
| 366 | + .on('ifChanged', iCheckChange); | |
| 367 | + if (pagination && data.content.length > 0) { | |
| 368 | + //重新分页 | |
| 369 | + initPagination = true; | |
| 370 | + showPagination(data); | |
| 371 | + } | |
| 372 | + layer.close(i); | |
| 373 | + | |
| 374 | + startOptJzylLink($('#ll_oil_list .in_carpark_jzyl')); | |
| 375 | + }); | |
| 376 | + } | |
| 377 | + | |
| 378 | + //改变状态 | |
| 379 | + function startOptJzylLink(es) { | |
| 380 | + es.editable({ | |
| 381 | + type: 'text', | |
| 382 | + placement: 'right', | |
| 383 | + width: 100, | |
| 384 | + display: false, | |
| 385 | + validate: function (value) { | |
| 386 | + if (!value) | |
| 387 | + return '值不能为空!'; | |
| 388 | + if (isNaN(value)) | |
| 389 | + return '只能为数字!'; | |
| 390 | + if (value < 0) | |
| 391 | + return '值不能小于0!'; | |
| 392 | + }, | |
| 393 | + inputclass: 'form-control input-medium input-edtable-sm' | |
| 394 | + }) | |
| 395 | + .on('save', function (e, params) { | |
| 396 | + $(this).text(params.newValue); | |
| 397 | + }); | |
| 398 | + } | |
| 399 | + | |
| 400 | + function iCheckChange() { | |
| 401 | + var tr = $(this).parents('tr'); | |
| 402 | + if (this.checked) | |
| 403 | + tr.addClass('row-active'); | |
| 404 | + else | |
| 405 | + tr.removeClass('row-active'); | |
| 406 | + | |
| 407 | + /* if($('#datatable_resource input.icheck:checked').length == 1) | |
| 408 | + $('#removeButton').removeAttr('disabled'); | |
| 409 | + else | |
| 410 | + $('#removeButton').attr('disabled', 'disabled'); */ | |
| 411 | + } | |
| 412 | + | |
| 413 | + function showPagination(data) { | |
| 414 | + //分页 | |
| 415 | + $('#pagination').jqPaginator({ | |
| 416 | + totalPages: data.totalPages, | |
| 417 | + visiblePages: 6, | |
| 418 | + currentPage: page + 1, | |
| 419 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 420 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 421 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 422 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 423 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 424 | + onPageChange: function (num, type) { | |
| 425 | + if (initPagination) { | |
| 426 | + initPagination = false; | |
| 427 | + return; | |
| 428 | + } | |
| 429 | + | |
| 430 | + var cells = $('tr.filter')[0].cells | |
| 431 | + , params = {} | |
| 432 | + , name; | |
| 433 | + $.each(cells, function (i, cell) { | |
| 434 | + var items = $('input,select', cell); | |
| 435 | + for (var j = 0, item; item = items[j++];) { | |
| 436 | + name = $(item).attr('name'); | |
| 437 | + if (name) { | |
| 438 | + params[name] = $(item).val(); | |
| 439 | + } | |
| 440 | + } | |
| 441 | + }); | |
| 442 | + page = num - 1; | |
| 443 | + jsDoQuery(params, true); | |
| 444 | + } | |
| 445 | + }); | |
| 446 | + } | |
| 447 | + | |
| 448 | + | |
| 449 | + //删除 | |
| 450 | + $('#removeButton').on('click', function () { | |
| 451 | + if ($(this).attr('disabled')) | |
| 452 | + return; | |
| 453 | + | |
| 454 | + var id = $('input.icheck:checked').data('id'); | |
| 455 | + removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () { | |
| 456 | + $('tr.filter .filter-submit').click(); | |
| 457 | + }); | |
| 458 | + }); | |
| 459 | + | |
| 460 | + //搜索线路 | |
| 461 | + $.get('/basic/lineCode2Name',function(result){ | |
| 462 | + var data=[]; | |
| 463 | + | |
| 464 | + for(var code in result){ | |
| 465 | + data.push({id: code, text: result[code]}); | |
| 466 | + } | |
| 467 | + initPinYinSelect2('#xlbm',data,''); | |
| 468 | + | |
| 469 | + }) | |
| 470 | + | |
| 471 | + $('#nbbm').select2({ | |
| 472 | + placeholder: '搜索车辆...', | |
| 473 | + ajax: { | |
| 474 | + url: '/realSchedule/sreachVehic', | |
| 475 | + dataType: 'json', | |
| 476 | + delay: 150, | |
| 477 | + data: function (params) { | |
| 478 | + return {nbbm: params.term}; | |
| 479 | + }, | |
| 480 | + processResults: function (data) { | |
| 481 | + return { | |
| 482 | + results: data | |
| 483 | + }; | |
| 484 | + }, | |
| 485 | + cache: true | |
| 486 | + }, | |
| 487 | + templateResult: function (repo) { | |
| 488 | + if (repo.loading) return repo.text; | |
| 489 | + var h = '<span>' + repo.text + '</span>'; | |
| 490 | + h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | |
| 491 | + return h; | |
| 492 | + }, | |
| 493 | + escapeMarkup: function (markup) { | |
| 494 | + return markup; | |
| 495 | + }, | |
| 496 | + minimumInputLength: 1, | |
| 497 | + templateSelection: function (repo) { | |
| 498 | + return repo.text; | |
| 499 | + }, | |
| 500 | + language: { | |
| 501 | + noResults: function () { | |
| 502 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | |
| 503 | + }, | |
| 504 | + inputTooShort: function (e) { | |
| 505 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | |
| 506 | + }, | |
| 507 | + searching: function () { | |
| 508 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | |
| 509 | + } | |
| 510 | + } | |
| 511 | + }) | |
| 512 | + | |
| 513 | + | |
| 514 | +//导出 | |
| 515 | + | |
| 516 | + $("#export").on("click", function () { | |
| 517 | + if ($("#rq").val() != "") { | |
| 518 | + var cells = $('tr.filter')[0].cells | |
| 519 | + , params = {} | |
| 520 | + , name; | |
| 521 | + $.each(cells, function (i, cell) { | |
| 522 | + var items = $('input,select', cell); | |
| 523 | + for (var j = 0, item; item = items[j++];) { | |
| 524 | + name = $(item).attr('name'); | |
| 525 | + if (name) { | |
| 526 | + params[name] = $(item).val(); | |
| 527 | + } | |
| 528 | + } | |
| 529 | + }); | |
| 530 | + $post('/ylb/listExport', params, function (result) { | |
| 531 | + window.open("/downloadFile/download?fileName=进出场存电量" + moment($("#rq").val()).format("YYYYMMDD")); | |
| 532 | + }); | |
| 533 | + } else { | |
| 534 | + layer.msg('请选择日期.'); | |
| 535 | + } | |
| 536 | + }); | |
| 537 | + | |
| 538 | + }); | |
| 539 | +</script> | |
| 0 | 540 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| ... | ... | @@ -425,16 +425,32 @@ angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource |
| 425 | 425 | return { |
| 426 | 426 | rest : $resource( |
| 427 | 427 | '/spc/:id', |
| 428 | - {order: 'xl.id,createDate', direction: 'DESC,DESC', id: '@id_route'}, | |
| 428 | + {order: 'xl.id,createDate', direction: 'DESC,DESC', id: '@id'}, | |
| 429 | 429 | { |
| 430 | 430 | list: { |
| 431 | 431 | method: 'GET', |
| 432 | 432 | params: { |
| 433 | 433 | page: 0 |
| 434 | + }, | |
| 435 | + transformResponse: function(rs) { | |
| 436 | + var dst = angular.fromJson(rs); | |
| 437 | + if (dst.status == 'SUCCESS') { | |
| 438 | + return dst.data; | |
| 439 | + } else { | |
| 440 | + return dst; // 业务错误留给控制器处理 | |
| 441 | + } | |
| 434 | 442 | } |
| 435 | 443 | }, |
| 436 | 444 | get: { |
| 437 | - method: 'GET' | |
| 445 | + method: 'GET', | |
| 446 | + transformResponse: function(rs) { | |
| 447 | + var dst = angular.fromJson(rs); | |
| 448 | + if (dst.status == 'SUCCESS') { | |
| 449 | + return dst.data; | |
| 450 | + } else { | |
| 451 | + return dst; | |
| 452 | + } | |
| 453 | + } | |
| 438 | 454 | }, |
| 439 | 455 | save: { |
| 440 | 456 | method: 'POST' | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list.html
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | <th style="width: 100%;">关联时刻表</th> |
| 10 | 10 | <th style="width: 150px;">排班开始日期</th> |
| 11 | 11 | <th style="width: 150px;">排班结束日期</th> |
| 12 | - <th style="width: 180px;">排班操作时间</th> | |
| 12 | + <th style="width: 250px;">排班人/操作时间</th> | |
| 13 | 13 | <th style="width: 180px;">操作</th> |
| 14 | 14 | </tr> |
| 15 | 15 | <tr role="row" class="filter"> |
| ... | ... | @@ -59,18 +59,18 @@ |
| 59 | 59 | <td></td> |
| 60 | 60 | <td> |
| 61 | 61 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" |
| 62 | - ng-click="ctrl.pageChanaged()"> | |
| 62 | + ng-click="ctrl.doPage()"> | |
| 63 | 63 | <i class="fa fa-search"></i> 搜索</button> |
| 64 | 64 | |
| 65 | 65 | <button class="btn btn-sm red btn-outline filter-cancel" |
| 66 | - ng-click="ctrl.resetSearchCondition()"> | |
| 66 | + ng-click="ctrl.reset()"> | |
| 67 | 67 | <i class="fa fa-times"></i> 重置</button> |
| 68 | 68 | </td> |
| 69 | 69 | |
| 70 | 70 | </tr> |
| 71 | 71 | </thead> |
| 72 | 72 | <tbody> |
| 73 | - <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> | |
| 73 | + <tr ng-repeat="info in ctrl.page()['content']" class="odd gradeX"> | |
| 74 | 74 | <td> |
| 75 | 75 | <span ng-bind="$index + 1"></span> |
| 76 | 76 | </td> |
| ... | ... | @@ -87,6 +87,8 @@ |
| 87 | 87 | <span ng-bind="info.scheduleToTime | date: 'yyyy-MM-dd '"></span> |
| 88 | 88 | </td> |
| 89 | 89 | <td> |
| 90 | + <span ng-bind="info.updateBy.name"></span> | |
| 91 | + / | |
| 90 | 92 | <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span> |
| 91 | 93 | </td> |
| 92 | 94 | <td> |
| ... | ... | @@ -95,6 +97,7 @@ |
| 95 | 97 | <a ui-sref="schedulePlanInfoManage({spid : info.id, xlname : info.xl.name, ttname : info.ttInfoNames, stime : info.scheduleFromTime, etime : info.scheduleToTime})" |
| 96 | 98 | class="btn btn-info btn-sm"> 明细 </a> |
| 97 | 99 | <a ng-click="ctrl.deletePlan(info.id)" |
| 100 | + uib-popover="删除当前排班计划,请慎重处理!" popover-trigger="mouseenter" | |
| 98 | 101 | class="btn btn-danger btn-sm"> 删除 </a> |
| 99 | 102 | </td> |
| 100 | 103 | </tr> |
| ... | ... | @@ -104,9 +107,9 @@ |
| 104 | 107 | |
| 105 | 108 | |
| 106 | 109 | <div style="text-align: right;"> |
| 107 | - <uib-pagination total-items="ctrl.pageInfo.totalItems" | |
| 108 | - ng-model="ctrl.pageInfo.currentPage" | |
| 109 | - ng-change="ctrl.pageChanaged()" | |
| 110 | + <uib-pagination total-items="ctrl.page()['totalElements']" | |
| 111 | + ng-model="ctrl.page()['uiNumber']" | |
| 112 | + ng-change="ctrl.doPage()" | |
| 110 | 113 | rotate="false" |
| 111 | 114 | max-size="10" |
| 112 | 115 | boundary-links="true" | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/module.js
| 1 | 1 | // 车辆配置管理 service controller 等写在一起 |
| 2 | -angular.module('ScheduleApp').factory('SchedulePlanManageService', ['SchedulePlanManageService_g', function(service) { | |
| 3 | - /** 当前的查询条件信息 */ | |
| 4 | - var currentSearchCondition = {}; | |
| 5 | - | |
| 6 | - /** 当前第几页 */ | |
| 7 | - var currentPageNo = 1; | |
| 8 | - | |
| 9 | - return { | |
| 10 | - /** | |
| 11 | - * 获取查询条件信息, | |
| 12 | - * 用于给controller用来和页面数据绑定。 | |
| 13 | - */ | |
| 14 | - getSearchCondition: function() { | |
| 15 | - return currentSearchCondition; | |
| 16 | - }, | |
| 17 | - /** | |
| 18 | - * 重置查询条件信息。 | |
| 19 | - */ | |
| 20 | - resetSearchCondition: function() { | |
| 21 | - var key; | |
| 22 | - for (key in currentSearchCondition) { | |
| 23 | - currentSearchCondition[key] = undefined; | |
| 24 | - } | |
| 25 | - }, | |
| 26 | - /** | |
| 27 | - * 设置当前页码。 | |
| 28 | - * @param cpn 从1开始,后台是从0开始的 | |
| 29 | - */ | |
| 30 | - setCurrentPageNo: function(cpn) { | |
| 31 | - currentPageNo = cpn; | |
| 32 | - }, | |
| 33 | - /** | |
| 34 | - * 组装查询参数,返回一个promise查询结果。 | |
| 35 | - * @param params 查询参数 | |
| 36 | - * @return 返回一个 promise | |
| 37 | - */ | |
| 38 | - getPage: function() { | |
| 39 | - var params = currentSearchCondition; // 查询条件 | |
| 40 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 41 | - return service.rest.list(params).$promise; | |
| 42 | - }, | |
| 43 | - /** | |
| 44 | - * 保存信息。 | |
| 45 | - * @param obj 车辆详细信息 | |
| 46 | - * @return 返回一个 promise | |
| 47 | - */ | |
| 48 | - saveDetail: function(obj) { | |
| 49 | - return service.rest.save(obj).$promise; | |
| 50 | - }, | |
| 51 | - /** | |
| 52 | - * 删除信息。 | |
| 53 | - * @param id 主键id | |
| 54 | - * @returns {*|Function|promise|n} | |
| 55 | - */ | |
| 56 | - deleteDetail: function(id) { | |
| 57 | - return service.rest.delete({id: id}).$promise; | |
| 58 | - } | |
| 2 | +angular.module('ScheduleApp').factory( | |
| 3 | + 'SchedulePlanManageService', | |
| 4 | + [ | |
| 5 | + 'SchedulePlanManageService_g', | |
| 6 | + function(service) { | |
| 7 | + /** 当前的查询条件信息 */ | |
| 8 | + var currentSearchCondition = {}; | |
| 9 | + | |
| 10 | + // 当前查询返回的信息 | |
| 11 | + var currentPage = { // 后台spring data返回的格式 | |
| 12 | + totalElements: 0, | |
| 13 | + number: 0, // 后台返回的页码,spring返回从0开始 | |
| 14 | + content: [], | |
| 15 | + | |
| 16 | + uiNumber: 1 // 页面绑定的页码 | |
| 17 | + }; | |
| 18 | + | |
| 19 | + // 查询对象 | |
| 20 | + var queryClass = service.rest; | |
| 21 | + | |
| 22 | + return { | |
| 23 | + getQueryClass: function() { | |
| 24 | + return queryClass; | |
| 25 | + }, | |
| 26 | + getSearchCondition: function() { | |
| 27 | + currentSearchCondition.page = currentPage.uiNumber - 1; | |
| 28 | + return currentSearchCondition; | |
| 29 | + }, | |
| 30 | + getPage: function(page) { | |
| 31 | + if (page) { | |
| 32 | + currentPage.totalElements = page.totalElements; | |
| 33 | + currentPage.number = page.number; | |
| 34 | + currentPage.content = page.content; | |
| 35 | + } | |
| 36 | + return currentPage; | |
| 37 | + }, | |
| 38 | + resetStatus: function() { | |
| 39 | + currentSearchCondition = {page: 0}; | |
| 40 | + currentPage = { | |
| 41 | + totalElements: 0, | |
| 42 | + number: 0, | |
| 43 | + content: [], | |
| 44 | + uiNumber: 1 | |
| 45 | + }; | |
| 46 | + } | |
| 59 | 47 | |
| 60 | - }; | |
| 48 | + }; | |
| 61 | 49 | |
| 62 | 50 | }]); |
| 63 | 51 | |
| 64 | -angular.module('ScheduleApp').controller('SchedulePlanManageCtrl', ['SchedulePlanManageService', '$state', function(schedulePlanManageService, $state) { | |
| 65 | - var self = this; | |
| 52 | +// index.html控制器 | |
| 53 | +angular.module('ScheduleApp').controller( | |
| 54 | + 'SchedulePlanManageCtrl', | |
| 55 | + [ | |
| 56 | + 'SchedulePlanManageService', | |
| 57 | + '$state', | |
| 58 | + function(service, $state) { | |
| 59 | + var self = this; | |
| 66 | 60 | |
| 67 | - // 切换到form状态 | |
| 68 | - self.goForm = function() { | |
| 69 | - $state.go("schedulePlanManage_form"); | |
| 70 | - } | |
| 71 | -}]); | |
| 61 | + // 切换到form状态 | |
| 62 | + self.goForm = function() { | |
| 63 | + $state.go("schedulePlanManage_form"); | |
| 64 | + }; | |
| 72 | 65 | |
| 73 | -angular.module('ScheduleApp').controller('SchedulePlanManageListCtrl', ['SchedulePlanManageService', function(schedulePlanManageService) { | |
| 74 | - var self = this; | |
| 75 | - self.pageInfo = { | |
| 76 | - totalItems : 0, | |
| 77 | - currentPage : 1, | |
| 78 | - infos: [] | |
| 79 | - }; | |
| 80 | - | |
| 81 | - // 日期 日期控件开关 | |
| 82 | - self.scheduleFromTime = false; | |
| 83 | - self.scheduleFromTime_open = function() { | |
| 84 | - self.scheduleFromTime = true; | |
| 85 | - }; | |
| 86 | - self.scheduleToTime = false; | |
| 87 | - self.scheduleToTime_open = function() { | |
| 88 | - self.scheduleToTime = true; | |
| 89 | - }; | |
| 90 | - | |
| 91 | - // 初始创建的时候,获取一次列表数据 | |
| 92 | - schedulePlanManageService.getPage().then( | |
| 93 | - function(result) { | |
| 94 | - self.pageInfo.totalItems = result.totalElements; | |
| 95 | - self.pageInfo.currentPage = result.number + 1; | |
| 96 | - self.pageInfo.infos = result.content; | |
| 97 | - schedulePlanManageService.setCurrentPageNo(result.number + 1); | |
| 98 | - }, | |
| 99 | - function(result) { | |
| 100 | - alert("出错啦!"); | |
| 101 | 66 | } |
| 102 | - ); | |
| 103 | - | |
| 104 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 105 | - // alert("dfdfdf"); | |
| 106 | - //}); | |
| 107 | - | |
| 108 | - // 翻页的时候调用 | |
| 109 | - self.pageChanaged = function() { | |
| 110 | - schedulePlanManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 111 | - schedulePlanManageService.getPage().then( | |
| 112 | - function(result) { | |
| 113 | - self.pageInfo.totalItems = result.totalElements; | |
| 114 | - self.pageInfo.currentPage = result.number + 1; | |
| 115 | - self.pageInfo.infos = result.content; | |
| 116 | - schedulePlanManageService.setCurrentPageNo(result.number + 1); | |
| 117 | - }, | |
| 118 | - function(result) { | |
| 119 | - alert("出错啦!"); | |
| 120 | - } | |
| 121 | - ); | |
| 122 | - }; | |
| 123 | - // 获取查询条件数据 | |
| 124 | - self.searchCondition = function() { | |
| 125 | - return schedulePlanManageService.getSearchCondition(); | |
| 126 | - }; | |
| 127 | - // 重置查询条件 | |
| 128 | - self.resetSearchCondition = function() { | |
| 129 | - schedulePlanManageService.resetSearchCondition(); | |
| 130 | - self.pageInfo.currentPage = 1; | |
| 131 | - self.pageChanaged(); | |
| 132 | - }; | |
| 133 | - | |
| 134 | - // 删除排班(整个删除) | |
| 135 | - self.deletePlan = function(id) { | |
| 136 | - schedulePlanManageService.deleteDetail(id).then( | |
| 137 | - function(result) { | |
| 138 | - alert("删除成功!"); | |
| 139 | - | |
| 140 | - schedulePlanManageService.getPage().then( | |
| 141 | - function(result) { | |
| 142 | - self.pageInfo.totalItems = result.totalElements; | |
| 143 | - self.pageInfo.currentPage = result.number + 1; | |
| 144 | - self.pageInfo.infos = result.content; | |
| 145 | - schedulePlanManageService.setCurrentPageNo(result.number + 1); | |
| 146 | - }, | |
| 147 | - function(result) { | |
| 148 | - alert("出错啦!"); | |
| 149 | - } | |
| 150 | - ); | |
| 151 | - }, | |
| 152 | - function(result) { | |
| 153 | - alert("出错啦!"); | |
| 154 | - } | |
| 155 | - ); | |
| 156 | - } | |
| 157 | - | |
| 158 | -}]); | |
| 159 | - | |
| 160 | - | |
| 161 | -angular.module('ScheduleApp').controller('SchedulePlanManageFormCtrl', ['SchedulePlanManageService', '$stateParams', '$state', '$scope', function(schedulePlanManageService, $stateParams, $state, $scope) { | |
| 162 | - var self = this; | |
| 163 | - | |
| 164 | - // 开始日期 日期控件开关 | |
| 165 | - self.scheduleFromTimeOpen = false; | |
| 166 | - self.scheduleFromTime_open = function() { | |
| 167 | - self.scheduleFromTimeOpen = true; | |
| 168 | - }; | |
| 169 | - | |
| 170 | - // 结束日期 日期控件开关 | |
| 171 | - self.scheduleToTimeOpen = false; | |
| 172 | - self.scheduleToTime_open = function() { | |
| 173 | - self.scheduleToTimeOpen = true; | |
| 174 | - }; | |
| 175 | - | |
| 176 | - // 欲保存的busInfo信息,绑定 | |
| 177 | - self.schedulePlanManageForSave = {xl: {}}; | |
| 178 | - | |
| 179 | - // 提交方法 | |
| 180 | - self.submit = function() { | |
| 181 | - console.log(self.schedulePlanManageForSave); | |
| 182 | - | |
| 183 | - schedulePlanManageService.saveDetail(self.schedulePlanManageForSave).then( | |
| 184 | - function(result) { | |
| 185 | - // TODO:弹出框方式以后改 | |
| 186 | - if (result.status == 'SUCCESS') { | |
| 187 | - alert("保存成功!"); | |
| 67 | + ] | |
| 68 | +); | |
| 69 | + | |
| 70 | +// list.html控制器 | |
| 71 | +angular.module('ScheduleApp').controller( | |
| 72 | + 'SchedulePlanManageListCtrl', | |
| 73 | + [ | |
| 74 | + 'SchedulePlanManageService', | |
| 75 | + function(service) { | |
| 76 | + var self = this; | |
| 77 | + // 日期 日期控件开关 | |
| 78 | + self.scheduleFromTime = false; | |
| 79 | + self.scheduleFromTime_open = function() { | |
| 80 | + self.scheduleFromTime = true; | |
| 81 | + }; | |
| 82 | + self.scheduleToTime = false; | |
| 83 | + self.scheduleToTime_open = function() { | |
| 84 | + self.scheduleToTime = true; | |
| 85 | + }; | |
| 86 | + | |
| 87 | + var SPlan = service.getQueryClass(); | |
| 88 | + self.page = function() { | |
| 89 | + return service.getPage(); | |
| 90 | + }; | |
| 91 | + | |
| 92 | + self.searchCondition = function() { | |
| 93 | + return service.getSearchCondition(); | |
| 94 | + }; | |
| 95 | + | |
| 96 | + self.doPage = function() { | |
| 97 | + var page = SPlan.list(self.searchCondition(), function() { | |
| 98 | + service.getPage(page); | |
| 99 | + }); | |
| 100 | + }; | |
| 101 | + self.reset = function() { | |
| 102 | + service.resetStatus(); | |
| 103 | + var page = SPlan.list(self.searchCondition(), function() { | |
| 104 | + service.getPage(page); | |
| 105 | + }); | |
| 106 | + }; | |
| 107 | + | |
| 108 | + // 删除排班(整个删除) | |
| 109 | + self.deletePlan = function(id) { | |
| 110 | + SPlan.delete({id: id}, function() { | |
| 111 | + self.doPage(); | |
| 112 | + }); | |
| 113 | + }; | |
| 114 | + | |
| 115 | + self.doPage(); | |
| 116 | + } | |
| 117 | + ] | |
| 118 | +); | |
| 119 | + | |
| 120 | +// form.html控制器 | |
| 121 | +angular.module('ScheduleApp').controller( | |
| 122 | + 'SchedulePlanManageFormCtrl', | |
| 123 | + [ | |
| 124 | + 'SchedulePlanManageService', | |
| 125 | + '$stateParams', | |
| 126 | + '$state', | |
| 127 | + '$scope', | |
| 128 | + function(service, $stateParams, $state, $scope) { | |
| 129 | + var self = this; | |
| 130 | + | |
| 131 | + var SPlan = service.getQueryClass(); | |
| 132 | + | |
| 133 | + // 开始日期 日期控件开关 | |
| 134 | + self.scheduleFromTimeOpen = false; | |
| 135 | + self.scheduleFromTime_open = function() { | |
| 136 | + self.scheduleFromTimeOpen = true; | |
| 137 | + }; | |
| 138 | + | |
| 139 | + // 结束日期 日期控件开关 | |
| 140 | + self.scheduleToTimeOpen = false; | |
| 141 | + self.scheduleToTime_open = function() { | |
| 142 | + self.scheduleToTimeOpen = true; | |
| 143 | + }; | |
| 144 | + | |
| 145 | + // 欲保存的busInfo信息,绑定 | |
| 146 | + self.schedulePlanManageForSave = new SPlan; | |
| 147 | + self.schedulePlanManageForSave.xl = {}; | |
| 148 | + | |
| 149 | + // 提交方法 | |
| 150 | + self.submit = function() { | |
| 151 | + console.log(self.schedulePlanManageForSave); | |
| 152 | + | |
| 153 | + self.schedulePlanManageForSave.$save(function() { | |
| 188 | 154 | $state.go("schedulePlanManage"); |
| 189 | - } else { | |
| 190 | - alert("保存异常!"); | |
| 191 | - } | |
| 192 | - }, | |
| 193 | - function(result) { | |
| 194 | - // TODO:弹出框方式以后改 | |
| 195 | - alert("出错啦!"); | |
| 196 | - } | |
| 197 | - ); | |
| 198 | - }; | |
| 199 | -}]); | |
| 155 | + }); | |
| 156 | + }; | |
| 157 | + | |
| 158 | + } | |
| 159 | + ] | |
| 160 | +); | |
| 200 | 161 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js
| ... | ... | @@ -3,16 +3,32 @@ angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource |
| 3 | 3 | return { |
| 4 | 4 | rest : $resource( |
| 5 | 5 | '/spc/:id', |
| 6 | - {order: 'xl.id,createDate', direction: 'DESC,DESC', id: '@id_route'}, | |
| 6 | + {order: 'xl.id,createDate', direction: 'DESC,DESC', id: '@id'}, | |
| 7 | 7 | { |
| 8 | 8 | list: { |
| 9 | 9 | method: 'GET', |
| 10 | 10 | params: { |
| 11 | 11 | page: 0 |
| 12 | + }, | |
| 13 | + transformResponse: function(rs) { | |
| 14 | + var dst = angular.fromJson(rs); | |
| 15 | + if (dst.status == 'SUCCESS') { | |
| 16 | + return dst.data; | |
| 17 | + } else { | |
| 18 | + return dst; // 业务错误留给控制器处理 | |
| 19 | + } | |
| 12 | 20 | } |
| 13 | 21 | }, |
| 14 | 22 | get: { |
| 15 | - method: 'GET' | |
| 23 | + method: 'GET', | |
| 24 | + transformResponse: function(rs) { | |
| 25 | + var dst = angular.fromJson(rs); | |
| 26 | + if (dst.status == 'SUCCESS') { | |
| 27 | + return dst.data; | |
| 28 | + } else { | |
| 29 | + return dst; | |
| 30 | + } | |
| 31 | + } | |
| 16 | 32 | }, |
| 17 | 33 | save: { |
| 18 | 34 | method: 'POST' | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/list.html
| ... | ... | @@ -5,10 +5,9 @@ |
| 5 | 5 | <tr role="row" class="heading"> |
| 6 | 6 | <th style="width: 5%;">序号</th> |
| 7 | 7 | <th style="width: 15%;">线路</th> |
| 8 | - <th style="width: 15%;">修改时间</th> | |
| 8 | + <th style="width: 15%;">修改人/修改时间</th> | |
| 9 | 9 | <th style="width: 10%;">启用日期</th> |
| 10 | 10 | <th style="width: 10%;">车辆</th> |
| 11 | - <th>翻版模式</th> | |
| 12 | 11 | <th>起始路牌</th> |
| 13 | 12 | <th>路牌范围</th> |
| 14 | 13 | <th>起始人员</th> |
| ... | ... | @@ -38,7 +37,6 @@ |
| 38 | 37 | <td></td> |
| 39 | 38 | <td></td> |
| 40 | 39 | <td></td> |
| 41 | - <td></td> | |
| 42 | 40 | <td> |
| 43 | 41 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" |
| 44 | 42 | ng-click="ctrl.doPage()"> |
| ... | ... | @@ -60,6 +58,8 @@ |
| 60 | 58 | <span ng-bind="info.xl.name"></span> |
| 61 | 59 | </td> |
| 62 | 60 | <td> |
| 61 | + <span ng-bind="info.updateBy.name"></span> | |
| 62 | + / | |
| 63 | 63 | <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span> |
| 64 | 64 | </td> |
| 65 | 65 | <td> |
| ... | ... | @@ -69,9 +69,6 @@ |
| 69 | 69 | <span ng-bind="info.carConfigInfo.cl.insideCode"></span> |
| 70 | 70 | </td> |
| 71 | 71 | <td> |
| 72 | - <span ng-bind="info.fbgs"></span> | |
| 73 | - </td> | |
| 74 | - <td> | |
| 75 | 72 | <span ng-bind="info.lpStart"></span> |
| 76 | 73 | </td> |
| 77 | 74 | <td> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | <i class="fa fa-circle"></i> |
| 20 | 20 | </li> |
| 21 | 21 | <li> |
| 22 | - <a ui-sref="ttInfoDetailManage_edit({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})"><span ng-bind="ctrl.title1"></span></a> | |
| 22 | + <a ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})"><span ng-bind="ctrl.title1"></span></a> | |
| 23 | 23 | <i class="fa fa-circle"></i> |
| 24 | 24 | </li> |
| 25 | 25 | <li> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | <i class="fa fa-circle"></i> |
| 20 | 20 | </li> |
| 21 | 21 | <li> |
| 22 | - <a ui-sref="ttInfoDetailManage_edit({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})"><span ng-bind="ctrl.title1"></span></a> | |
| 22 | + <a ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})"><span ng-bind="ctrl.title1"></span></a> | |
| 23 | 23 | <i class="fa fa-circle"></i> |
| 24 | 24 | </li> |
| 25 | 25 | <li> |
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | cmaps="{'qdz.id' : 'stationid'}" |
| 55 | 55 | dcname="qdz.id" |
| 56 | 56 | icname="stationid" |
| 57 | - dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.TimeTableDetailForSave.xlDir}, atype:'zd' } | json }}" | |
| 57 | + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}" | |
| 58 | 58 | iterobjname="item" |
| 59 | 59 | iterobjexp="item.stationname" |
| 60 | 60 | searchph="请输拼音..." |
| ... | ... | @@ -71,7 +71,7 @@ |
| 71 | 71 | cmaps="{'zdz.id' : 'stationid'}" |
| 72 | 72 | dcname="zdz.id" |
| 73 | 73 | icname="stationid" |
| 74 | - dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.TimeTableDetailForSave.xlDir}, atype:'zd' } | json }}" | |
| 74 | + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}" | |
| 75 | 75 | iterobjname="item" |
| 76 | 76 | iterobjexp="item.stationname" |
| 77 | 77 | searchph="请输拼音..." | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
| ... | ... | @@ -61,6 +61,12 @@ |
| 61 | 61 | </li> |
| 62 | 62 | <li class="divider"></li> |
| 63 | 63 | <li> |
| 64 | + <a href="javascript:" class="tool-action" ng-click="ctrl.clearsel()"> | |
| 65 | + <i class="fa fa-refresh"></i> | |
| 66 | + 清除选择 | |
| 67 | + </a> | |
| 68 | + </li> | |
| 69 | + <li> | |
| 64 | 70 | <a href="javascript:" class="tool-action" ng-click="ctrl.refresh()"> |
| 65 | 71 | <i class="fa fa-refresh"></i> |
| 66 | 72 | 刷行数据 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
| ... | ... | @@ -182,18 +182,8 @@ angular.module('ScheduleApp').factory( |
| 182 | 182 | deferred.reject(); |
| 183 | 183 | } |
| 184 | 184 | } else { |
| 185 | - for (var key in updateObject) { | |
| 186 | - if (updateObject[key]) { | |
| 187 | - if (key == 'tcc' || key == 'qdz' || key == 'zdz') { | |
| 188 | - if (updateObject[key].id) { | |
| 189 | - value[key] = updateObject[key]; | |
| 190 | - } | |
| 191 | - } else { | |
| 192 | - value[key] = updateObject[key]; | |
| 193 | - } | |
| 185 | + updateObject.reSetTTinfoDetail(value); | |
| 194 | 186 | |
| 195 | - } | |
| 196 | - } | |
| 197 | 187 | } |
| 198 | 188 | value.$save(function() { |
| 199 | 189 | if (value.status == 'ERROR') { |
| ... | ... | @@ -285,6 +275,15 @@ angular.module('ScheduleApp').controller( |
| 285 | 275 | true |
| 286 | 276 | ); |
| 287 | 277 | |
| 278 | + // 清除选择 | |
| 279 | + self.clearsel = function() { | |
| 280 | + var ds = service.getEditInfo().detailInfos; | |
| 281 | + for (var i = 0; i < ds.length; i++) { | |
| 282 | + for (var j = 0; j < ds[i].length; j++) { | |
| 283 | + ds[i][j].sel = false; | |
| 284 | + } | |
| 285 | + } | |
| 286 | + }; | |
| 288 | 287 | // 刷新时刻表数据 |
| 289 | 288 | self.refresh = function() { |
| 290 | 289 | service.refreshEditInfo(self.xlid, self.ttid); |
| ... | ... | @@ -555,10 +554,9 @@ angular.module('ScheduleApp').controller( |
| 555 | 554 | 'TimeTableDetailManageFormCtrl_old2', |
| 556 | 555 | [ |
| 557 | 556 | 'TimeTableDetailManageService_old', |
| 558 | - 'ttInfoDetailService_edit3', | |
| 559 | 557 | '$stateParams', |
| 560 | 558 | '$state', |
| 561 | - function(service, service2, $stateParams, $state) { | |
| 559 | + function(service, $stateParams, $state) { | |
| 562 | 560 | var self = this; |
| 563 | 561 | var TTInfoDetail = service.getQueryClass(); |
| 564 | 562 | |
| ... | ... | @@ -570,10 +568,26 @@ angular.module('ScheduleApp').controller( |
| 570 | 568 | self.float_regex = /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/; |
| 571 | 569 | |
| 572 | 570 | // 欲保存的busInfo信息,绑定 |
| 573 | - self.tt = new TTInfoDetail; | |
| 574 | - self.tt.tcc = {id: undefined}; | |
| 575 | - self.tt.qdz = {id: undefined}; | |
| 576 | - self.tt.zdz = {id: undefined}; | |
| 571 | + //self.tt = new TTInfoDetail; | |
| 572 | + self.tt = { | |
| 573 | + xlDir: undefined, | |
| 574 | + tcc: {id: undefined}, | |
| 575 | + qdz: {id: undefined}, | |
| 576 | + zdz: {id: undefined}, | |
| 577 | + reSetTTinfoDetail: function(value) { | |
| 578 | + for (var key in this) { | |
| 579 | + if (!angular.isFunction(this[key])) { | |
| 580 | + if (key == 'tcc' || key == 'qdz' || key == 'zdz') { | |
| 581 | + if (this[key].id) { | |
| 582 | + value[key] = this[key]; | |
| 583 | + } | |
| 584 | + } else if (this[key]) { | |
| 585 | + value[key] = this[key]; | |
| 586 | + } | |
| 587 | + } | |
| 588 | + } | |
| 589 | + } | |
| 590 | + }; | |
| 577 | 591 | |
| 578 | 592 | // 获取传过来的id,有的话就是修改,获取一遍数据 |
| 579 | 593 | self.xlid = $stateParams.xlid; // 获取传过来的线路id | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/list.html
| ... | ... | @@ -79,12 +79,12 @@ |
| 79 | 79 | <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span> |
| 80 | 80 | </td> |
| 81 | 81 | <td> |
| 82 | - <a ui-sref="ttInfoDetailManage_edit({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name, rflag : true})" | |
| 83 | - class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a> | |
| 82 | + <!--<a ui-sref="ttInfoDetailManage_edit({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name, rflag : true})"--> | |
| 83 | + <!--class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a>--> | |
| 84 | 84 | <!--<a ui-sref="ttInfoDetailManage_edit2({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})"--> |
| 85 | 85 | <!--class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑2 </a>--> |
| 86 | 86 | <a ui-sref="ttInfoDetailManage_edit3({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name, rflag : true})" |
| 87 | - class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑3 </a> | |
| 87 | + class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a> | |
| 88 | 88 | <a ng-click="ctrl.toTtInfoDetailAuto(info.id)" |
| 89 | 89 | class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 生成 </a> |
| 90 | 90 | <a ui-sref="ttInfoDetailManage_form({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" | ... | ... |