Commit ae3c4d664be4d82bc84e903a4a1196e5fca91280
Merge branch 'minhang' of http://192.168.168.201:8888/panzhaov5/bsth_control into minhang
Showing
60 changed files
with
2150 additions
and
1813 deletions
src/main/java/com/bsth/controller/schedule/BController.java
| @@ -40,7 +40,7 @@ public class BController<T, ID extends Serializable> { | @@ -40,7 +40,7 @@ public class BController<T, ID extends Serializable> { | ||
| 40 | t_b.setCreateDate(new Date()); | 40 | t_b.setCreateDate(new Date()); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | - T t_saved = bService.save((T) t_b); | 43 | + T t_saved = bService.save(t_b == null ? t : (T) t_b); |
| 44 | Map<String, Object> rtn = new HashMap<>(); | 44 | Map<String, Object> rtn = new HashMap<>(); |
| 45 | rtn.put("status", ResponseCode.SUCCESS); | 45 | rtn.put("status", ResponseCode.SUCCESS); |
| 46 | rtn.put("data", t_saved); | 46 | rtn.put("data", t_saved); |
| @@ -58,7 +58,7 @@ public class BController<T, ID extends Serializable> { | @@ -58,7 +58,7 @@ public class BController<T, ID extends Serializable> { | ||
| 58 | t_b.setUpdateDate(new Date()); | 58 | t_b.setUpdateDate(new Date()); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | - T t_updated = bService.save((T) t_b); | 61 | + T t_updated = bService.save(t_b == null ? t : (T) t_b); |
| 62 | Map<String, Object> rtn = new HashMap<>(); | 62 | Map<String, Object> rtn = new HashMap<>(); |
| 63 | rtn.put("status", ResponseCode.SUCCESS); | 63 | rtn.put("status", ResponseCode.SUCCESS); |
| 64 | rtn.put("data", t_updated); | 64 | rtn.put("data", t_updated); |
src/main/java/com/bsth/controller/schedule/basicinfo/CarDeviceController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.basicinfo; | ||
| 2 | + | ||
| 3 | +import com.bsth.common.ResponseCode; | ||
| 4 | +import com.bsth.controller.schedule.BController; | ||
| 5 | +import com.bsth.entity.CarDevice; | ||
| 6 | +import com.bsth.service.schedule.CarDeviceService; | ||
| 7 | +import com.bsth.service.schedule.ScheduleException; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 10 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 11 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 12 | +import org.springframework.web.bind.annotation.RestController; | ||
| 13 | + | ||
| 14 | +import java.util.HashMap; | ||
| 15 | +import java.util.Map; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * Created by xu on 16/12/15. | ||
| 19 | + */ | ||
| 20 | +@RestController(value = "carDeviceController_sc") | ||
| 21 | +@RequestMapping("cde_sc") | ||
| 22 | +public class CarDeviceController extends BController<CarDevice, Long> { | ||
| 23 | + @Autowired | ||
| 24 | + private CarDeviceService carDeviceService; | ||
| 25 | + | ||
| 26 | + @RequestMapping(value = "/validate_qyrq", method = RequestMethod.GET) | ||
| 27 | + public Map<String, Object> validate_qyrq(@RequestParam Map<String, Object> param) { | ||
| 28 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 29 | + | ||
| 30 | + try { | ||
| 31 | + // 启用日期验证 | ||
| 32 | + CarDevice carDevice = new CarDevice( | ||
| 33 | + param.get("id_eq"), | ||
| 34 | + param.get("xl_eq"), | ||
| 35 | + param.get("cl_eq"), | ||
| 36 | + param.get("qyrq_eq") | ||
| 37 | + ); | ||
| 38 | + carDeviceService.validate_qyrq(carDevice); | ||
| 39 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 40 | + } catch (ScheduleException exp) { | ||
| 41 | + rtn.put("status", ResponseCode.ERROR); | ||
| 42 | + rtn.put("msg", exp.getMessage()); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + return rtn; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | +} |
src/main/java/com/bsth/controller/schedule/basicinfo/EmployeeController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.basicinfo; | ||
| 2 | + | ||
| 3 | +import com.bsth.common.ResponseCode; | ||
| 4 | +import com.bsth.controller.schedule.BController; | ||
| 5 | +import com.bsth.entity.Personnel; | ||
| 6 | +import com.bsth.service.schedule.EmployeeService; | ||
| 7 | +import com.bsth.service.schedule.ScheduleException; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 10 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 11 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 12 | +import org.springframework.web.bind.annotation.RestController; | ||
| 13 | + | ||
| 14 | +import java.util.HashMap; | ||
| 15 | +import java.util.Map; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 人员基础信息Controller | ||
| 19 | + */ | ||
| 20 | +@RestController | ||
| 21 | +@RequestMapping("ee") | ||
| 22 | +public class EmployeeController extends BController<Personnel, Integer> { | ||
| 23 | + @Autowired | ||
| 24 | + private EmployeeService employeeService; | ||
| 25 | + | ||
| 26 | + @RequestMapping(value = "/validate_gh", method = RequestMethod.GET) | ||
| 27 | + public Map<String, Object> validate_gh(@RequestParam Map<String, Object> param) { | ||
| 28 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 29 | + try { | ||
| 30 | + // 工号验证 | ||
| 31 | + Personnel personnel = new Personnel( | ||
| 32 | + param.get("id_eq"), | ||
| 33 | + param.get("companyCode_eq"), | ||
| 34 | + param.get("jobCode_eq") | ||
| 35 | + ); | ||
| 36 | + employeeService.validate_gh(personnel); | ||
| 37 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 38 | + } catch (ScheduleException exp) { | ||
| 39 | + rtn.put("status", ResponseCode.ERROR); | ||
| 40 | + rtn.put("msg", exp.getMessage()); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + return rtn; | ||
| 44 | + } | ||
| 45 | +} |
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java
| @@ -48,8 +48,8 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | @@ -48,8 +48,8 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | ||
| 48 | return guideboardInfoRepository.findLpName(ttid); | 48 | return guideboardInfoRepository.findLpName(ttid); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | - @RequestMapping(value = "/validate1", method = RequestMethod.GET) | ||
| 52 | - public Map<String, Object> validate1(@RequestParam Map<String, Object> param) { | 51 | + @RequestMapping(value = "/validate_lpno", method = RequestMethod.GET) |
| 52 | + public Map<String, Object> validate_lpno(@RequestParam Map<String, Object> param) { | ||
| 53 | Map<String, Object> rtn = new HashMap<>(); | 53 | Map<String, Object> rtn = new HashMap<>(); |
| 54 | try { | 54 | try { |
| 55 | // 路牌编号验证 | 55 | // 路牌编号验证 |
| @@ -59,7 +59,7 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | @@ -59,7 +59,7 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | ||
| 59 | param.get("lpNo_eq"), | 59 | param.get("lpNo_eq"), |
| 60 | null | 60 | null |
| 61 | ); | 61 | ); |
| 62 | - guideboardInfoService.validate(guideboardInfo); | 62 | + guideboardInfoService.validate_lpno(guideboardInfo); |
| 63 | rtn.put("status", ResponseCode.SUCCESS); | 63 | rtn.put("status", ResponseCode.SUCCESS); |
| 64 | } catch (ScheduleException exp) { | 64 | } catch (ScheduleException exp) { |
| 65 | rtn.put("status", ResponseCode.ERROR); | 65 | rtn.put("status", ResponseCode.ERROR); |
| @@ -68,8 +68,8 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | @@ -68,8 +68,8 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | ||
| 68 | return rtn; | 68 | return rtn; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | - @RequestMapping(value = "/validate2", method = RequestMethod.GET) | ||
| 72 | - public Map<String, Object> validate2(@RequestParam Map<String, Object> param) { | 71 | + @RequestMapping(value = "/validate_lpname", method = RequestMethod.GET) |
| 72 | + public Map<String, Object> validate_lpname(@RequestParam Map<String, Object> param) { | ||
| 73 | Map<String, Object> rtn = new HashMap<>(); | 73 | Map<String, Object> rtn = new HashMap<>(); |
| 74 | try { | 74 | try { |
| 75 | // 路牌名称验证 | 75 | // 路牌名称验证 |
| @@ -79,7 +79,7 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | @@ -79,7 +79,7 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | ||
| 79 | null, | 79 | null, |
| 80 | param.get("lpName_eq") | 80 | param.get("lpName_eq") |
| 81 | ); | 81 | ); |
| 82 | - guideboardInfoService.validate(guideboardInfo); | 82 | + guideboardInfoService.validate_lpname(guideboardInfo); |
| 83 | rtn.put("status", ResponseCode.SUCCESS); | 83 | rtn.put("status", ResponseCode.SUCCESS); |
| 84 | } catch (ScheduleException exp) { | 84 | } catch (ScheduleException exp) { |
| 85 | rtn.put("status", ResponseCode.ERROR); | 85 | rtn.put("status", ResponseCode.ERROR); |
src/main/java/com/bsth/entity/CarDevice.java
| 1 | package com.bsth.entity; | 1 | package com.bsth.entity; |
| 2 | 2 | ||
| 3 | -import com.bsth.entity.sys.SysUser; | 3 | +import com.bsth.entity.schedule.BEntity; |
| 4 | +import org.joda.time.DateTime; | ||
| 4 | 5 | ||
| 5 | import javax.persistence.*; | 6 | import javax.persistence.*; |
| 6 | import java.util.Date; | 7 | import java.util.Date; |
| @@ -10,7 +11,7 @@ import java.util.Date; | @@ -10,7 +11,7 @@ import java.util.Date; | ||
| 10 | */ | 11 | */ |
| 11 | @Entity | 12 | @Entity |
| 12 | @Table(name = "bsth_c_car_device") | 13 | @Table(name = "bsth_c_car_device") |
| 13 | -public class CarDevice { | 14 | +public class CarDevice extends BEntity { |
| 14 | 15 | ||
| 15 | /** 主键 */ | 16 | /** 主键 */ |
| 16 | @Id | 17 | @Id |
| @@ -62,18 +63,26 @@ public class CarDevice { | @@ -62,18 +63,26 @@ public class CarDevice { | ||
| 62 | @Column(nullable = false) | 63 | @Column(nullable = false) |
| 63 | private Boolean isCancel = false; | 64 | private Boolean isCancel = false; |
| 64 | 65 | ||
| 65 | - /** 创建人 */ | ||
| 66 | - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | ||
| 67 | - private SysUser createBy; | ||
| 68 | - /** 修改人 */ | ||
| 69 | - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | ||
| 70 | - private SysUser updateBy; | ||
| 71 | - /** 创建日期 */ | ||
| 72 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 73 | - private Date createDate; | ||
| 74 | - /** 修改日期 */ | ||
| 75 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 76 | - private Date updateDate; | 66 | + public CarDevice() {} |
| 67 | + public CarDevice(Object id, Object xlid, Object clid, Object qyrq) { | ||
| 68 | + if (id != null) { | ||
| 69 | + this.id = Long.valueOf(id.toString()); | ||
| 70 | + } | ||
| 71 | + if (xlid != null) { | ||
| 72 | + this.xl = Integer.valueOf(xlid.toString()); | ||
| 73 | + } | ||
| 74 | + if (clid != null) { | ||
| 75 | + this.cl = Integer.valueOf(clid.toString()); | ||
| 76 | + } | ||
| 77 | + if (qyrq != null) { | ||
| 78 | + try { | ||
| 79 | + this.qyrq = new Date(); | ||
| 80 | + this.qyrq.setTime(Long.parseLong(qyrq.toString())); | ||
| 81 | + } catch (Exception exp) { | ||
| 82 | + this.qyrq = new DateTime(qyrq.toString()).toDate(); | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + } | ||
| 77 | 86 | ||
| 78 | public Long getId() { | 87 | public Long getId() { |
| 79 | return id; | 88 | return id; |
| @@ -179,38 +188,6 @@ public class CarDevice { | @@ -179,38 +188,6 @@ public class CarDevice { | ||
| 179 | this.guaranteeDesc = guaranteeDesc; | 188 | this.guaranteeDesc = guaranteeDesc; |
| 180 | } | 189 | } |
| 181 | 190 | ||
| 182 | - public SysUser getCreateBy() { | ||
| 183 | - return createBy; | ||
| 184 | - } | ||
| 185 | - | ||
| 186 | - public void setCreateBy(SysUser createBy) { | ||
| 187 | - this.createBy = createBy; | ||
| 188 | - } | ||
| 189 | - | ||
| 190 | - public SysUser getUpdateBy() { | ||
| 191 | - return updateBy; | ||
| 192 | - } | ||
| 193 | - | ||
| 194 | - public void setUpdateBy(SysUser updateBy) { | ||
| 195 | - this.updateBy = updateBy; | ||
| 196 | - } | ||
| 197 | - | ||
| 198 | - public Date getCreateDate() { | ||
| 199 | - return createDate; | ||
| 200 | - } | ||
| 201 | - | ||
| 202 | - public void setCreateDate(Date createDate) { | ||
| 203 | - this.createDate = createDate; | ||
| 204 | - } | ||
| 205 | - | ||
| 206 | - public Date getUpdateDate() { | ||
| 207 | - return updateDate; | ||
| 208 | - } | ||
| 209 | - | ||
| 210 | - public void setUpdateDate(Date updateDate) { | ||
| 211 | - this.updateDate = updateDate; | ||
| 212 | - } | ||
| 213 | - | ||
| 214 | public Date getQyrq() { | 191 | public Date getQyrq() { |
| 215 | return qyrq; | 192 | return qyrq; |
| 216 | } | 193 | } |
src/main/java/com/bsth/entity/Cars.java
| 1 | package com.bsth.entity; | 1 | package com.bsth.entity; |
| 2 | 2 | ||
| 3 | -import com.bsth.entity.sys.SysUser; | 3 | +import com.bsth.entity.schedule.BEntity; |
| 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 5 | 5 | ||
| 6 | import javax.persistence.*; | 6 | import javax.persistence.*; |
| @@ -24,7 +24,7 @@ import java.util.Date; | @@ -24,7 +24,7 @@ import java.util.Date; | ||
| 24 | @Entity | 24 | @Entity |
| 25 | @Table(name = "bsth_c_cars") | 25 | @Table(name = "bsth_c_cars") |
| 26 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | 26 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) |
| 27 | -public class Cars implements Serializable { | 27 | +public class Cars extends BEntity implements Serializable { |
| 28 | 28 | ||
| 29 | /** 主键Id */ | 29 | /** 主键Id */ |
| 30 | @Id | 30 | @Id |
| @@ -136,23 +136,6 @@ public class Cars implements Serializable { | @@ -136,23 +136,6 @@ public class Cars implements Serializable { | ||
| 136 | /** 线路名称(TODO:在原系统里没有,这里暂时留着,并且不做线路关联,只保留个名字) */ | 136 | /** 线路名称(TODO:在原系统里没有,这里暂时留着,并且不做线路关联,只保留个名字) */ |
| 137 | private String xlmc; | 137 | private String xlmc; |
| 138 | 138 | ||
| 139 | - | ||
| 140 | - /** 创建人 */ | ||
| 141 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 142 | - private SysUser createBy; | ||
| 143 | - | ||
| 144 | - /** 修改人 */ | ||
| 145 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 146 | - private SysUser updateBy; | ||
| 147 | - | ||
| 148 | - /** 创建日期 */ | ||
| 149 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 150 | - private Date createDate; | ||
| 151 | - | ||
| 152 | - /** 修改日期 */ | ||
| 153 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 154 | - private Date updateDate; | ||
| 155 | - | ||
| 156 | public Cars() {} | 139 | public Cars() {} |
| 157 | 140 | ||
| 158 | public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) { | 141 | public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) { |
| @@ -516,36 +499,4 @@ public class Cars implements Serializable { | @@ -516,36 +499,4 @@ public class Cars implements Serializable { | ||
| 516 | public void setXlmc(String xlmc) { | 499 | public void setXlmc(String xlmc) { |
| 517 | this.xlmc = xlmc; | 500 | this.xlmc = xlmc; |
| 518 | } | 501 | } |
| 519 | - | ||
| 520 | - public SysUser getCreateBy() { | ||
| 521 | - return createBy; | ||
| 522 | - } | ||
| 523 | - | ||
| 524 | - public void setCreateBy(SysUser createBy) { | ||
| 525 | - this.createBy = createBy; | ||
| 526 | - } | ||
| 527 | - | ||
| 528 | - public SysUser getUpdateBy() { | ||
| 529 | - return updateBy; | ||
| 530 | - } | ||
| 531 | - | ||
| 532 | - public void setUpdateBy(SysUser updateBy) { | ||
| 533 | - this.updateBy = updateBy; | ||
| 534 | - } | ||
| 535 | - | ||
| 536 | - public Date getCreateDate() { | ||
| 537 | - return createDate; | ||
| 538 | - } | ||
| 539 | - | ||
| 540 | - public void setCreateDate(Date createDate) { | ||
| 541 | - this.createDate = createDate; | ||
| 542 | - } | ||
| 543 | - | ||
| 544 | - public Date getUpdateDate() { | ||
| 545 | - return updateDate; | ||
| 546 | - } | ||
| 547 | - | ||
| 548 | - public void setUpdateDate(Date updateDate) { | ||
| 549 | - this.updateDate = updateDate; | ||
| 550 | - } | ||
| 551 | } | 502 | } |
src/main/java/com/bsth/entity/Personnel.java
| 1 | package com.bsth.entity; | 1 | package com.bsth.entity; |
| 2 | 2 | ||
| 3 | -import com.bsth.entity.sys.SysUser; | 3 | +import com.bsth.entity.schedule.BEntity; |
| 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 5 | 5 | ||
| 6 | import javax.persistence.*; | 6 | import javax.persistence.*; |
| 7 | -import java.util.Date; | ||
| 8 | 7 | ||
| 9 | /** | 8 | /** |
| 10 | * | 9 | * |
| @@ -23,7 +22,7 @@ import java.util.Date; | @@ -23,7 +22,7 @@ import java.util.Date; | ||
| 23 | @Entity | 22 | @Entity |
| 24 | @Table(name = "bsth_c_personnel") | 23 | @Table(name = "bsth_c_personnel") |
| 25 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | 24 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) |
| 26 | -public class Personnel { | 25 | +public class Personnel extends BEntity { |
| 27 | 26 | ||
| 28 | /** 主键Id */ | 27 | /** 主键Id */ |
| 29 | @Id | 28 | @Id |
| @@ -59,6 +58,20 @@ public class Personnel { | @@ -59,6 +58,20 @@ public class Personnel { | ||
| 59 | /** 身份证 */ | 58 | /** 身份证 */ |
| 60 | private String card; | 59 | private String card; |
| 61 | 60 | ||
| 61 | + public Personnel() {} | ||
| 62 | + | ||
| 63 | + public Personnel(Object id, Object companyCode, Object gh) { | ||
| 64 | + if (id != null) { | ||
| 65 | + this.id = Integer.valueOf(id.toString()); | ||
| 66 | + } | ||
| 67 | + if (companyCode != null) { | ||
| 68 | + this.companyCode = companyCode.toString(); | ||
| 69 | + } | ||
| 70 | + if (gh != null) { | ||
| 71 | + this.jobCode = gh.toString(); | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + | ||
| 62 | public String getCard() { | 75 | public String getCard() { |
| 63 | return card; | 76 | return card; |
| 64 | } | 77 | } |
| @@ -78,23 +91,6 @@ public class Personnel { | @@ -78,23 +91,6 @@ public class Personnel { | ||
| 78 | /** 描述(TODO:在原系统里没有,这里暂时留着) */ | 91 | /** 描述(TODO:在原系统里没有,这里暂时留着) */ |
| 79 | private String descriptions; | 92 | private String descriptions; |
| 80 | 93 | ||
| 81 | - | ||
| 82 | - | ||
| 83 | - /** 创建人 */ | ||
| 84 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 85 | - private SysUser createBy; | ||
| 86 | - /** 修改人 */ | ||
| 87 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 88 | - private SysUser updateBy; | ||
| 89 | - | ||
| 90 | - /** 创建日期 */ | ||
| 91 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 92 | - private Date createDate; | ||
| 93 | - | ||
| 94 | - /** 修改日期 */ | ||
| 95 | - @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 96 | - private Date updateDate; | ||
| 97 | - | ||
| 98 | public Integer getId() { | 94 | public Integer getId() { |
| 99 | return id; | 95 | return id; |
| 100 | } | 96 | } |
| @@ -222,36 +218,4 @@ public class Personnel { | @@ -222,36 +218,4 @@ public class Personnel { | ||
| 222 | public void setDescriptions(String descriptions) { | 218 | public void setDescriptions(String descriptions) { |
| 223 | this.descriptions = descriptions; | 219 | this.descriptions = descriptions; |
| 224 | } | 220 | } |
| 225 | - | ||
| 226 | - public SysUser getCreateBy() { | ||
| 227 | - return createBy; | ||
| 228 | - } | ||
| 229 | - | ||
| 230 | - public void setCreateBy(SysUser createBy) { | ||
| 231 | - this.createBy = createBy; | ||
| 232 | - } | ||
| 233 | - | ||
| 234 | - public SysUser getUpdateBy() { | ||
| 235 | - return updateBy; | ||
| 236 | - } | ||
| 237 | - | ||
| 238 | - public void setUpdateBy(SysUser updateBy) { | ||
| 239 | - this.updateBy = updateBy; | ||
| 240 | - } | ||
| 241 | - | ||
| 242 | - public Date getCreateDate() { | ||
| 243 | - return createDate; | ||
| 244 | - } | ||
| 245 | - | ||
| 246 | - public void setCreateDate(Date createDate) { | ||
| 247 | - this.createDate = createDate; | ||
| 248 | - } | ||
| 249 | - | ||
| 250 | - public Date getUpdateDate() { | ||
| 251 | - return updateDate; | ||
| 252 | - } | ||
| 253 | - | ||
| 254 | - public void setUpdateDate(Date updateDate) { | ||
| 255 | - this.updateDate = updateDate; | ||
| 256 | - } | ||
| 257 | } | 221 | } |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| @@ -163,7 +163,7 @@ public class ScheduleRealInfo { | @@ -163,7 +163,7 @@ public class ScheduleRealInfo { | ||
| 163 | private String qdzArrDatesj; | 163 | private String qdzArrDatesj; |
| 164 | 164 | ||
| 165 | /** 子任务 */ | 165 | /** 子任务 */ |
| 166 | - @OneToMany(fetch = FetchType.LAZY/*, cascade = CascadeType.ALL*/) | 166 | + @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) |
| 167 | private Set<ChildTaskPlan> cTasks = new HashSet<>(); | 167 | private Set<ChildTaskPlan> cTasks = new HashSet<>(); |
| 168 | 168 | ||
| 169 | /** 关联的公司名称 */ | 169 | /** 关联的公司名称 */ |
src/main/java/com/bsth/entity/schedule/GuideboardInfo.java
| 1 | package com.bsth.entity.schedule; | 1 | package com.bsth.entity.schedule; |
| 2 | 2 | ||
| 3 | import com.bsth.entity.Line; | 3 | import com.bsth.entity.Line; |
| 4 | -import com.bsth.entity.sys.SysUser; | ||
| 5 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 6 | 5 | ||
| 7 | import javax.persistence.*; | 6 | import javax.persistence.*; |
| 8 | -import java.util.Date; | ||
| 9 | 7 | ||
| 10 | /** | 8 | /** |
| 11 | * 路牌信息。 | 9 | * 路牌信息。 |
| @@ -18,7 +16,7 @@ import java.util.Date; | @@ -18,7 +16,7 @@ import java.util.Date; | ||
| 18 | }) | 16 | }) |
| 19 | }) | 17 | }) |
| 20 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | 18 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) |
| 21 | -public class GuideboardInfo { | 19 | +public class GuideboardInfo extends BEntity { |
| 22 | 20 | ||
| 23 | /** 主键Id */ | 21 | /** 主键Id */ |
| 24 | @Id | 22 | @Id |
| @@ -43,21 +41,6 @@ public class GuideboardInfo { | @@ -43,21 +41,6 @@ public class GuideboardInfo { | ||
| 43 | @Column(nullable = false) | 41 | @Column(nullable = false) |
| 44 | private Boolean isCancel = false; | 42 | private Boolean isCancel = false; |
| 45 | 43 | ||
| 46 | - /** 创建人 */ | ||
| 47 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 48 | - private SysUser createBy; | ||
| 49 | - /** 修改人 */ | ||
| 50 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 51 | - private SysUser updateBy; | ||
| 52 | - | ||
| 53 | - /** 创建日期 */ | ||
| 54 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 55 | - private Date createDate; | ||
| 56 | - /** 修改日期 */ | ||
| 57 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 58 | - private Date updateDate; | ||
| 59 | - | ||
| 60 | - | ||
| 61 | public GuideboardInfo() {} | 44 | public GuideboardInfo() {} |
| 62 | 45 | ||
| 63 | public GuideboardInfo(Object id, Object xlid, Object lpNo, Object lpName) { | 46 | public GuideboardInfo(Object id, Object xlid, Object lpNo, Object lpName) { |
| @@ -126,38 +109,6 @@ public class GuideboardInfo { | @@ -126,38 +109,6 @@ public class GuideboardInfo { | ||
| 126 | this.lpType = lpType; | 109 | this.lpType = lpType; |
| 127 | } | 110 | } |
| 128 | 111 | ||
| 129 | - public SysUser getCreateBy() { | ||
| 130 | - return createBy; | ||
| 131 | - } | ||
| 132 | - | ||
| 133 | - public void setCreateBy(SysUser createBy) { | ||
| 134 | - this.createBy = createBy; | ||
| 135 | - } | ||
| 136 | - | ||
| 137 | - public SysUser getUpdateBy() { | ||
| 138 | - return updateBy; | ||
| 139 | - } | ||
| 140 | - | ||
| 141 | - public void setUpdateBy(SysUser updateBy) { | ||
| 142 | - this.updateBy = updateBy; | ||
| 143 | - } | ||
| 144 | - | ||
| 145 | - public Date getCreateDate() { | ||
| 146 | - return createDate; | ||
| 147 | - } | ||
| 148 | - | ||
| 149 | - public void setCreateDate(Date createDate) { | ||
| 150 | - this.createDate = createDate; | ||
| 151 | - } | ||
| 152 | - | ||
| 153 | - public Date getUpdateDate() { | ||
| 154 | - return updateDate; | ||
| 155 | - } | ||
| 156 | - | ||
| 157 | - public void setUpdateDate(Date updateDate) { | ||
| 158 | - this.updateDate = updateDate; | ||
| 159 | - } | ||
| 160 | - | ||
| 161 | public Boolean getIsCancel() { | 112 | public Boolean getIsCancel() { |
| 162 | return isCancel; | 113 | return isCancel; |
| 163 | } | 114 | } |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| 1 | package com.bsth.repository.realcontrol; | 1 | package com.bsth.repository.realcontrol; |
| 2 | 2 | ||
| 3 | -import java.util.List; | ||
| 4 | -import java.util.Map; | ||
| 5 | - | ||
| 6 | -import javax.transaction.Transactional; | ||
| 7 | - | 3 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 4 | +import com.bsth.repository.BaseRepository; | ||
| 8 | import org.springframework.data.jpa.repository.EntityGraph; | 5 | import org.springframework.data.jpa.repository.EntityGraph; |
| 9 | import org.springframework.data.jpa.repository.Modifying; | 6 | import org.springframework.data.jpa.repository.Modifying; |
| 10 | import org.springframework.data.jpa.repository.Query; | 7 | import org.springframework.data.jpa.repository.Query; |
| 11 | import org.springframework.stereotype.Repository; | 8 | import org.springframework.stereotype.Repository; |
| 12 | 9 | ||
| 13 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 14 | -import com.bsth.repository.BaseRepository; | 10 | +import javax.transaction.Transactional; |
| 11 | +import java.util.List; | ||
| 12 | +import java.util.Map; | ||
| 15 | 13 | ||
| 16 | @Repository | 14 | @Repository |
| 17 | public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealInfo, Long>{ | 15 | public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealInfo, Long>{ |
| @@ -113,12 +111,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -113,12 +111,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 113 | @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") | 111 | @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") |
| 114 | List<ScheduleRealInfo> setLD(String date); | 112 | List<ScheduleRealInfo> setLD(String date); |
| 115 | 113 | ||
| 116 | - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,lpName,clZbh ORDER BY xlBm,lpName,clZbh") | ||
| 117 | - List<ScheduleRealInfo> setLDGroup(String date); | 114 | + @Query(value="select new map(xlBm as xlBm,lpName as lpName,clZbh as clZbh) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,lpName,clZbh ORDER BY xlBm,lpName,clZbh") |
| 115 | + List<Map<String,Object>> setLDGroup(String date); | ||
| 118 | 116 | ||
| 119 | - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,clZbh ORDER BY xlBm,clZbh") | ||
| 120 | - List<ScheduleRealInfo> setLCYHGroup(String date); | 117 | + @Query(value="select new map(xlBm as xlBm,clZbh as clZbh) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,clZbh ORDER BY xlBm,clZbh") |
| 118 | + List<Map<String,Object>> setLCYHGroup(String date); | ||
| 121 | 119 | ||
| 122 | - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm") | ||
| 123 | - List<ScheduleRealInfo> setDDRBGroup(String date); | 120 | + @Query(value="select new map(xlBm as xlBm) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm") |
| 121 | + List<Map<String,Object>> setDDRBGroup(String date); | ||
| 122 | + | ||
| 124 | } | 123 | } |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| @@ -24,7 +24,6 @@ import org.slf4j.LoggerFactory; | @@ -24,7 +24,6 @@ import org.slf4j.LoggerFactory; | ||
| 24 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
| 25 | import org.springframework.data.domain.Sort; | 25 | import org.springframework.data.domain.Sort; |
| 26 | import org.springframework.data.domain.Sort.Direction; | 26 | import org.springframework.data.domain.Sort.Direction; |
| 27 | -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; | ||
| 28 | import org.springframework.stereotype.Service; | 27 | import org.springframework.stereotype.Service; |
| 29 | 28 | ||
| 30 | import java.io.BufferedOutputStream; | 29 | import java.io.BufferedOutputStream; |
| @@ -104,9 +103,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -104,9 +103,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 104 | @Autowired | 103 | @Autowired |
| 105 | private ScheduleRealInfoRepository scheduleRealInfoRepository; | 104 | private ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 106 | 105 | ||
| 107 | - @Autowired | ||
| 108 | - NamedParameterJdbcTemplate jdbcTemplate; | ||
| 109 | - | ||
| 110 | 106 | ||
| 111 | // 运管处接口 | 107 | // 运管处接口 |
| 112 | private InternalPortType portType = new Internal().getInternalHttpSoap11Endpoint(); | 108 | private InternalPortType portType = new Internal().getInternalHttpSoap11Endpoint(); |
| @@ -308,31 +304,31 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -308,31 +304,31 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 308 | try { | 304 | try { |
| 309 | sf.append("<DLDS>"); | 305 | sf.append("<DLDS>"); |
| 310 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); | 306 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); |
| 311 | - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date); | 307 | + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date); |
| 312 | Map<String,Object> map = new HashMap<String,Object>(); | 308 | Map<String,Object> map = new HashMap<String,Object>(); |
| 313 | - for(ScheduleRealInfo schRealInfo:listGroup){ | 309 | + for(Map<String,Object> schRealInfo:listGroup){ |
| 314 | if(schRealInfo != null){ | 310 | if(schRealInfo != null){ |
| 315 | //根据车辆自编号查询车牌号 | 311 | //根据车辆自编号查询车牌号 |
| 316 | - map.put("insideCode_eq", schRealInfo.getClZbh()); | 312 | + map.put("insideCode_eq", schRealInfo.get("clZbh")+""); |
| 317 | Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); | 313 | Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); |
| 318 | // 获取线路是否使用标识,如果未使用,则不查该线路数据 | 314 | // 获取线路是否使用标识,如果未使用,则不查该线路数据 |
| 319 | - line = lineRepository.findByLineCode(schRealInfo.getXlBm()); | 315 | + line = lineRepository.findByLineCode(schRealInfo.get("xlBm")+""); |
| 320 | if(line.getInUse() == null || line.getInUse() == 0){ | 316 | if(line.getInUse() == null || line.getInUse() == 0){ |
| 321 | continue; | 317 | continue; |
| 322 | } | 318 | } |
| 323 | sf.append("<DLD>"); | 319 | sf.append("<DLD>"); |
| 324 | - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 325 | - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>"); | ||
| 326 | - sf.append("<LPBH>"+schRealInfo.getLpName()+"</LPBH>"); | 320 | + sf.append("<RQ>"+date+"</RQ>"); |
| 321 | + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm")+"")+"</XLBM>"); | ||
| 322 | + sf.append("<LPBH>"+schRealInfo.get("lpName")+"</LPBH>"); | ||
| 327 | sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); | 323 | sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); |
| 328 | - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | 324 | + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); |
| 329 | sf.append("<LDList>"); | 325 | sf.append("<LDList>"); |
| 330 | 326 | ||
| 331 | int seqNumber = 0; | 327 | int seqNumber = 0; |
| 332 | for(ScheduleRealInfo scheduleRealInfo:list){ | 328 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 333 | - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getLpName() | 329 | + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("lpName")+"") |
| 334 | .equals(scheduleRealInfo.getLpName()) | 330 | .equals(scheduleRealInfo.getLpName()) |
| 335 | - && schRealInfo.getClZbh().equals(scheduleRealInfo.getClZbh())){ | 331 | + && (schRealInfo.get("clZbh")+"").equals(scheduleRealInfo.getClZbh())){ |
| 336 | if(scheduleRealInfo.getFcsjActual() == null ||scheduleRealInfo.getBcType().equals("in") | 332 | if(scheduleRealInfo.getFcsjActual() == null ||scheduleRealInfo.getBcType().equals("in") |
| 337 | || scheduleRealInfo.getBcType().equals("out")){ | 333 | || scheduleRealInfo.getBcType().equals("out")){ |
| 338 | continue; | 334 | continue; |
| @@ -390,22 +386,22 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -390,22 +386,22 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 390 | StringBuffer sf = new StringBuffer(); | 386 | StringBuffer sf = new StringBuffer(); |
| 391 | try { | 387 | try { |
| 392 | sf.append("<LCYHS>"); | 388 | sf.append("<LCYHS>"); |
| 393 | - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); | 389 | + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); |
| 394 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | 390 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); |
| 395 | Map<String,Object> map = new HashMap<String,Object>(); | 391 | Map<String,Object> map = new HashMap<String,Object>(); |
| 396 | - for(ScheduleRealInfo schRealInfo:listGroup){ | 392 | + for(Map<String,Object> schRealInfo:listGroup){ |
| 397 | if(schRealInfo != null){ | 393 | if(schRealInfo != null){ |
| 398 | //计算总公里和空驶公里,营运公里=总公里-空驶公里 | 394 | //计算总公里和空驶公里,营运公里=总公里-空驶公里 |
| 399 | double totalKilometers = 0,emptyKilometers =0; | 395 | double totalKilometers = 0,emptyKilometers =0; |
| 400 | sf.append("<LCYH>"); | 396 | sf.append("<LCYH>"); |
| 401 | - map.put("insideCode_eq", schRealInfo.getClZbh()); | 397 | + map.put("insideCode_eq", schRealInfo.get("clZbh")+""); |
| 402 | Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); | 398 | Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); |
| 403 | // Cars car = carsRepository.findCarByClzbh(schRealInfo.getClZbh()); | 399 | // Cars car = carsRepository.findCarByClzbh(schRealInfo.getClZbh()); |
| 404 | - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 405 | - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>"); | 400 | + sf.append("<RQ>"+date+"</RQ>"); |
| 401 | + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm"))+"</XLBM>"); | ||
| 406 | sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); | 402 | sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); |
| 407 | for(ScheduleRealInfo scheduleRealInfo:list){ | 403 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 408 | - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getClZbh() | 404 | + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("clZbh")+"") |
| 409 | .equals(scheduleRealInfo.getClZbh())){ | 405 | .equals(scheduleRealInfo.getClZbh())){ |
| 410 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 406 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 411 | //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 | 407 | //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 |
| @@ -436,7 +432,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -436,7 +432,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 436 | sf.append("<YH>"+""+"</YH>"); | 432 | sf.append("<YH>"+""+"</YH>"); |
| 437 | sf.append("<JZYL>"+""+"</JZYL>"); | 433 | sf.append("<JZYL>"+""+"</JZYL>"); |
| 438 | sf.append("<DH>"+""+"</DH>"); | 434 | sf.append("<DH>"+""+"</DH>"); |
| 439 | - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | 435 | + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); |
| 440 | sf.append("<BBSCBZ>"+0+"</BBSCBZ>"); | 436 | sf.append("<BBSCBZ>"+0+"</BBSCBZ>"); |
| 441 | sf.append("</LCYH>"); | 437 | sf.append("</LCYH>"); |
| 442 | } | 438 | } |
| @@ -466,18 +462,18 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -466,18 +462,18 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 466 | StringBuffer sf = new StringBuffer(); | 462 | StringBuffer sf = new StringBuffer(); |
| 467 | try { | 463 | try { |
| 468 | sf.append("<DDRBS>"); | 464 | sf.append("<DDRBS>"); |
| 469 | - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); | 465 | + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); |
| 470 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | 466 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); |
| 471 | - for(ScheduleRealInfo schRealInfo:listGroup){ | 467 | + for(Map<String,Object> schRealInfo:listGroup){ |
| 472 | if(schRealInfo != null){ | 468 | if(schRealInfo != null){ |
| 473 | double jhlc = 0,zlc = 0,jhkslc = 0,sjkslc = 0; | 469 | double jhlc = 0,zlc = 0,jhkslc = 0,sjkslc = 0; |
| 474 | int jhbc = 0,sjbc = 0,jhzgfbc = 0,sjzgfbc = 0,jhwgfbc = 0,sjwgfbc = 0; | 470 | int jhbc = 0,sjbc = 0,jhzgfbc = 0,sjzgfbc = 0,jhwgfbc = 0,sjwgfbc = 0; |
| 475 | sf.append("<DDRB>"); | 471 | sf.append("<DDRB>"); |
| 476 | - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 477 | - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>"); | 472 | + sf.append("<RQ>"+date+"</RQ>"); |
| 473 | + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm"))+"</XLBM>"); | ||
| 478 | for(ScheduleRealInfo scheduleRealInfo:list){ | 474 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 479 | if(scheduleRealInfo != null){ | 475 | if(scheduleRealInfo != null){ |
| 480 | - if(scheduleRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm())){ | 476 | + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm())){ |
| 481 | //计划 | 477 | //计划 |
| 482 | if(!scheduleRealInfo.isSflj()){ | 478 | if(!scheduleRealInfo.isSflj()){ |
| 483 | jhlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | 479 | jhlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); |
| @@ -540,7 +536,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -540,7 +536,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 540 | sf.append("<SJZGFBC>"+sjzgfbc+"</SJZGFBC>"); | 536 | sf.append("<SJZGFBC>"+sjzgfbc+"</SJZGFBC>"); |
| 541 | sf.append("<JHWGFBC>"+jhwgfbc+"</JHWGFBC>"); | 537 | sf.append("<JHWGFBC>"+jhwgfbc+"</JHWGFBC>"); |
| 542 | sf.append("<SJWGFBC>"+sjwgfbc+"</SJWGFBC>"); | 538 | sf.append("<SJWGFBC>"+sjwgfbc+"</SJWGFBC>"); |
| 543 | - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | 539 | + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); |
| 544 | sf.append("<RBSCBZ>"+0+"</RBSCBZ>"); | 540 | sf.append("<RBSCBZ>"+0+"</RBSCBZ>"); |
| 545 | sf.append("</DDRB>"); | 541 | sf.append("</DDRB>"); |
| 546 | } | 542 | } |
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
| 1 | package com.bsth.service.realcontrol.impl; | 1 | package com.bsth.service.realcontrol.impl; |
| 2 | 2 | ||
| 3 | -import java.util.Map; | ||
| 4 | - | ||
| 5 | -import javax.transaction.Transactional; | ||
| 6 | - | ||
| 7 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 8 | -import org.springframework.stereotype.Service; | ||
| 9 | - | ||
| 10 | import com.bsth.data.BasicData; | 3 | import com.bsth.data.BasicData; |
| 11 | import com.bsth.data.match.Arrival2Schedule; | 4 | import com.bsth.data.match.Arrival2Schedule; |
| 12 | import com.bsth.data.schedule.DayOfSchedule; | 5 | import com.bsth.data.schedule.DayOfSchedule; |
| 13 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 6 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 14 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 7 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 15 | import com.bsth.repository.realcontrol.ChildTaskPlanRepository; | 8 | import com.bsth.repository.realcontrol.ChildTaskPlanRepository; |
| 9 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | ||
| 16 | import com.bsth.service.impl.BaseServiceImpl; | 10 | import com.bsth.service.impl.BaseServiceImpl; |
| 17 | import com.bsth.service.realcontrol.ChildTaskPlanService; | 11 | import com.bsth.service.realcontrol.ChildTaskPlanService; |
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 14 | +import org.springframework.stereotype.Service; | ||
| 15 | + | ||
| 16 | +import javax.transaction.Transactional; | ||
| 17 | +import java.util.Map; | ||
| 18 | 18 | ||
| 19 | @Service | 19 | @Service |
| 20 | public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService{ | 20 | public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService{ |
| 21 | 21 | ||
| 22 | /*@Autowired | 22 | /*@Autowired |
| 23 | ScheduleRealInfoServiceImpl scheduleRealInfoService;*/ | 23 | ScheduleRealInfoServiceImpl scheduleRealInfoService;*/ |
| 24 | + | ||
| 25 | + @Autowired | ||
| 26 | + ScheduleRealInfoRepository scheduleRealInfoRepository; | ||
| 24 | 27 | ||
| 25 | @Autowired | 28 | @Autowired |
| 26 | ChildTaskPlanRepository childTaskPlanRepository; | 29 | ChildTaskPlanRepository childTaskPlanRepository; |
| @@ -30,6 +33,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | @@ -30,6 +33,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | ||
| 30 | 33 | ||
| 31 | @Autowired | 34 | @Autowired |
| 32 | Arrival2Schedule arrival2Schedule; | 35 | Arrival2Schedule arrival2Schedule; |
| 36 | + | ||
| 37 | + @Autowired | ||
| 38 | + JdbcTemplate jdbcTemplate; | ||
| 33 | 39 | ||
| 34 | @Transactional | 40 | @Transactional |
| 35 | @Override | 41 | @Override |
| @@ -62,10 +68,13 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | @@ -62,10 +68,13 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | ||
| 62 | //解除和主任务关联 | 68 | //解除和主任务关联 |
| 63 | ScheduleRealInfo sch = dayOfSchedule.get(cPlan.getSchedule().getId()); | 69 | ScheduleRealInfo sch = dayOfSchedule.get(cPlan.getSchedule().getId()); |
| 64 | sch.getcTasks().remove(cPlan); | 70 | sch.getcTasks().remove(cPlan); |
| 71 | + //删除关联表数据 | ||
| 72 | + jdbcTemplate.execute("delete from bsth_c_s_sp_info_real_c_tasks where bsth_c_s_sp_info_real="+sch.getId()+" and c_tasks="+cPlan.getId()); | ||
| 73 | + | ||
| 65 | //删除子任务 | 74 | //删除子任务 |
| 66 | rs = super.delete(id); | 75 | rs = super.delete(id); |
| 67 | dayOfSchedule.save(sch); | 76 | dayOfSchedule.save(sch); |
| 68 | - | 77 | + |
| 69 | rs.put("t", sch); | 78 | rs.put("t", sch); |
| 70 | return rs; | 79 | return rs; |
| 71 | } | 80 | } |
src/main/java/com/bsth/service/schedule/CarDeviceService.java
0 → 100644
src/main/java/com/bsth/service/schedule/EmployeeService.java
0 → 100644
src/main/java/com/bsth/service/schedule/GuideboardInfoService.java
| @@ -6,6 +6,8 @@ import com.bsth.entity.schedule.GuideboardInfo; | @@ -6,6 +6,8 @@ import com.bsth.entity.schedule.GuideboardInfo; | ||
| 6 | * Created by xu on 16/5/11. | 6 | * Created by xu on 16/5/11. |
| 7 | */ | 7 | */ |
| 8 | public interface GuideboardInfoService extends BService<GuideboardInfo, Long> { | 8 | public interface GuideboardInfoService extends BService<GuideboardInfo, Long> { |
| 9 | - public void validate(GuideboardInfo guideboardInfo) throws ScheduleException; | 9 | + public void validate_lpno(GuideboardInfo guideboardInfo) throws ScheduleException; |
| 10 | + public void validate_lpname(GuideboardInfo guideboardInfo) throws ScheduleException; | ||
| 10 | public void toggleCancel(Long id) throws ScheduleException; | 11 | public void toggleCancel(Long id) throws ScheduleException; |
| 12 | + | ||
| 11 | } | 13 | } |
src/main/java/com/bsth/service/schedule/impl/CarConfigInfoServiceImpl.java
| @@ -36,12 +36,14 @@ public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> | @@ -36,12 +36,14 @@ public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> | ||
| 36 | throw new ScheduleException("线路未选择"); | 36 | throw new ScheduleException("线路未选择"); |
| 37 | } else { | 37 | } else { |
| 38 | // param.put("xl.id_eq", carConfigInfo.getXl().getId()); | 38 | // param.put("xl.id_eq", carConfigInfo.getXl().getId()); |
| 39 | + param.put("isCancel_eq", false); | ||
| 39 | if (carConfigInfo.getCl() == null || carConfigInfo.getCl().getId() == null) { | 40 | if (carConfigInfo.getCl() == null || carConfigInfo.getCl().getId() == null) { |
| 40 | throw new ScheduleException("车辆未选择"); | 41 | throw new ScheduleException("车辆未选择"); |
| 41 | } else { | 42 | } else { |
| 42 | param.put("cl.id_eq", carConfigInfo.getCl().getId()); | 43 | param.put("cl.id_eq", carConfigInfo.getCl().getId()); |
| 43 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 44 | - throw new ScheduleException("车辆已经配置在" + carConfigInfo.getXl().getName() + "线路中!"); | 44 | + List<CarConfigInfo> carConfigInfos = list(param); |
| 45 | + if (!CollectionUtils.isEmpty(carConfigInfos)) { | ||
| 46 | + throw new ScheduleException("车辆已经配置在" + carConfigInfos.get(0).getXl().getName() + "线路中!"); | ||
| 45 | } | 47 | } |
| 46 | } | 48 | } |
| 47 | } | 49 | } |
src/main/java/com/bsth/service/schedule/impl/CarDeviceServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.CarDevice; | ||
| 4 | +import com.bsth.entity.Cars; | ||
| 5 | +import com.bsth.service.CarsService; | ||
| 6 | +import com.bsth.service.schedule.CarDeviceService; | ||
| 7 | +import com.bsth.service.schedule.ScheduleException; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.stereotype.Service; | ||
| 10 | +import org.springframework.transaction.annotation.Transactional; | ||
| 11 | +import org.springframework.util.CollectionUtils; | ||
| 12 | + | ||
| 13 | +import java.util.HashMap; | ||
| 14 | +import java.util.Map; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * Created by xu on 16/12/15. | ||
| 18 | + */ | ||
| 19 | +@Service(value = "carDeviceServiceImpl_sc") | ||
| 20 | +public class CarDeviceServiceImpl extends BServiceImpl<CarDevice, Long> implements CarDeviceService { | ||
| 21 | + @Autowired | ||
| 22 | + private CarsService carsService; | ||
| 23 | + | ||
| 24 | + @Transactional | ||
| 25 | + @Override | ||
| 26 | + public CarDevice save(CarDevice carDevice) { | ||
| 27 | + // 查找对应的车辆基础信息,更新设备编号数据 | ||
| 28 | + Cars cars = carsService.findById(carDevice.getCl()); | ||
| 29 | + cars.setEquipmentCode(carDevice.getNewDeviceNo()); | ||
| 30 | + return super.save(carDevice); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + @Transactional | ||
| 34 | + @Override | ||
| 35 | + public void validate_qyrq(CarDevice carDevice) throws ScheduleException { | ||
| 36 | + if (carDevice.getXl() == null) { | ||
| 37 | + throw new ScheduleException("线路未选择"); | ||
| 38 | + } | ||
| 39 | + if (carDevice.getCl() == null) { | ||
| 40 | + throw new ScheduleException("车辆未选择"); | ||
| 41 | + } | ||
| 42 | + Map<String, Object> param = new HashMap<>(); | ||
| 43 | + if (carDevice.getId() != null) { | ||
| 44 | + param.put("id_ne", carDevice.getId()); | ||
| 45 | + } | ||
| 46 | + param.put("xl_eq", carDevice.getXl()); | ||
| 47 | + param.put("cl_eq", carDevice.getCl()); | ||
| 48 | + param.put("qyrq_ge", carDevice.getQyrq()); | ||
| 49 | + if (!CollectionUtils.isEmpty(list(param))) { | ||
| 50 | + throw new ScheduleException("启用日期必须比历史的启用日期大"); | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + @Transactional | ||
| 55 | + @Override | ||
| 56 | + public void delete(Long aLong) throws ScheduleException { | ||
| 57 | + toggleCancel(aLong); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @Transactional | ||
| 61 | + public void toggleCancel(Long id) throws ScheduleException { | ||
| 62 | + CarDevice carDevice = findById(id); | ||
| 63 | + if (carDevice.getIsCancel()) { | ||
| 64 | + carDevice.setIsCancel(false); | ||
| 65 | + } else { | ||
| 66 | + carDevice.setIsCancel(true); | ||
| 67 | + } | ||
| 68 | + } | ||
| 69 | +} |
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
| @@ -34,12 +34,15 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | @@ -34,12 +34,15 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | ||
| 34 | employeeConfigInfo.getXl().getName() == null) { | 34 | employeeConfigInfo.getXl().getName() == null) { |
| 35 | throw new ScheduleException("线路未选择"); | 35 | throw new ScheduleException("线路未选择"); |
| 36 | } else { | 36 | } else { |
| 37 | +// param.put("xl.id_eq", employeeConfigInfo.getXl().getId()); | ||
| 38 | + param.put("isCancel_eq", false); | ||
| 37 | if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) { | 39 | if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) { |
| 38 | throw new ScheduleException("驾驶员未选择"); | 40 | throw new ScheduleException("驾驶员未选择"); |
| 39 | } else { | 41 | } else { |
| 40 | param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId()); | 42 | param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId()); |
| 43 | + List<EmployeeConfigInfo> employeeConfigInfos = list(param); | ||
| 41 | if (!CollectionUtils.isEmpty(list(param))) { | 44 | if (!CollectionUtils.isEmpty(list(param))) { |
| 42 | - throw new ScheduleException("驾驶员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!"); | 45 | + throw new ScheduleException("驾驶员已经配置在" + employeeConfigInfos.get(0).getXl().getName() + "线路中!"); |
| 43 | } | 46 | } |
| 44 | } | 47 | } |
| 45 | } | 48 | } |
| @@ -59,12 +62,14 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | @@ -59,12 +62,14 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | ||
| 59 | employeeConfigInfo.getXl().getName() == null) { | 62 | employeeConfigInfo.getXl().getName() == null) { |
| 60 | throw new ScheduleException("线路未选择"); | 63 | throw new ScheduleException("线路未选择"); |
| 61 | } else { | 64 | } else { |
| 65 | +// param.put("xl.id_eq", employeeConfigInfo.getXl().getId()); | ||
| 62 | if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) { | 66 | if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) { |
| 63 | throw new ScheduleException("售票员未选择"); | 67 | throw new ScheduleException("售票员未选择"); |
| 64 | } else { | 68 | } else { |
| 65 | param.put("spy.id_eq", employeeConfigInfo.getSpy().getId()); | 69 | param.put("spy.id_eq", employeeConfigInfo.getSpy().getId()); |
| 70 | + List<EmployeeConfigInfo> employeeConfigInfos = list(param); | ||
| 66 | if (!CollectionUtils.isEmpty(list(param))) { | 71 | if (!CollectionUtils.isEmpty(list(param))) { |
| 67 | - throw new ScheduleException("售票员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!"); | 72 | + throw new ScheduleException("售票员已经配置在" + employeeConfigInfos.get(0).getXl().getName() + "线路中!"); |
| 68 | } | 73 | } |
| 69 | } | 74 | } |
| 70 | } | 75 | } |
src/main/java/com/bsth/service/schedule/impl/EmployeeServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.Personnel; | ||
| 4 | +import com.bsth.service.schedule.EmployeeService; | ||
| 5 | +import com.bsth.service.schedule.ScheduleException; | ||
| 6 | +import org.springframework.stereotype.Service; | ||
| 7 | +import org.springframework.transaction.annotation.Transactional; | ||
| 8 | +import org.springframework.util.CollectionUtils; | ||
| 9 | + | ||
| 10 | +import java.util.HashMap; | ||
| 11 | +import java.util.Map; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * Created by xu on 16/12/15. | ||
| 15 | + */ | ||
| 16 | +@Service | ||
| 17 | +public class EmployeeServiceImpl extends BServiceImpl<Personnel, Integer> implements EmployeeService { | ||
| 18 | + @Override | ||
| 19 | + @Transactional | ||
| 20 | + public void validate_gh(Personnel personnel) throws ScheduleException { | ||
| 21 | + // 查询条件 | ||
| 22 | + Map<String, Object> param = new HashMap<>(); | ||
| 23 | + if (personnel.getId() != null) { | ||
| 24 | + param.put("id_ne", personnel.getId()); | ||
| 25 | + } | ||
| 26 | + param.put("companyCode_eq", personnel.getCompanyCode()); | ||
| 27 | + param.put("jobCode_eq", personnel.getJobCode()); | ||
| 28 | + if (!CollectionUtils.isEmpty(list(param))) { | ||
| 29 | + throw new ScheduleException("相同公司工号重复"); | ||
| 30 | + } | ||
| 31 | + } | ||
| 32 | +} |
src/main/java/com/bsth/service/schedule/impl/GuideboardInfoServiceImpl.java
| @@ -22,52 +22,44 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | @@ -22,52 +22,44 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | ||
| 22 | @Autowired | 22 | @Autowired |
| 23 | private TTInfoDetailService ttInfoDetailService; | 23 | private TTInfoDetailService ttInfoDetailService; |
| 24 | 24 | ||
| 25 | - // 验证方法 | ||
| 26 | - @Transactional | ||
| 27 | - public void validate(GuideboardInfo guideboardInfo) throws ScheduleException { | 25 | + @Override |
| 26 | + public void validate_lpno(GuideboardInfo guideboardInfo) throws ScheduleException { | ||
| 28 | // 查询条件 | 27 | // 查询条件 |
| 29 | Map<String, Object> param = new HashMap<>(); | 28 | Map<String, Object> param = new HashMap<>(); |
| 30 | - if (guideboardInfo.getId() != null) | 29 | + if (guideboardInfo.getId() != null) { |
| 31 | param.put("id_ne", guideboardInfo.getId()); | 30 | param.put("id_ne", guideboardInfo.getId()); |
| 31 | + } | ||
| 32 | 32 | ||
| 33 | if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) { | 33 | if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) { |
| 34 | throw new ScheduleException("线路未选择"); | 34 | throw new ScheduleException("线路未选择"); |
| 35 | } else { | 35 | } else { |
| 36 | + param.put("isCancel_eq", false); // 作废的也算入判定区 | ||
| 36 | param.put("xl.id_eq", guideboardInfo.getXl().getId()); | 37 | param.put("xl.id_eq", guideboardInfo.getXl().getId()); |
| 38 | + param.put("lpNo_eq", guideboardInfo.getLpNo()); | ||
| 39 | + if (!CollectionUtils.isEmpty(list(param))) { | ||
| 40 | + throw new ScheduleException("路牌编号重复"); | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + } | ||
| 37 | 44 | ||
| 38 | -// param.put("isCancel_eq", false); // 作废的也算入判定区 | ||
| 39 | - if (guideboardInfo.getLpNo() != null) { | ||
| 40 | - if (guideboardInfo.getLpName() != null) { | ||
| 41 | - // 如果两个都写了,分开查询 | ||
| 42 | - param.put("lpNo_eq", guideboardInfo.getLpNo()); | ||
| 43 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 44 | - throw new ScheduleException("路牌编号重复"); | ||
| 45 | - } | ||
| 46 | - param.remove("lpNo_eq"); | ||
| 47 | - param.put("lpName_eq", guideboardInfo.getLpName()); | ||
| 48 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 49 | - throw new ScheduleException("路牌名称重复"); | ||
| 50 | - } | 45 | + @Override |
| 46 | + public void validate_lpname(GuideboardInfo guideboardInfo) throws ScheduleException { | ||
| 47 | + // 查询条件 | ||
| 48 | + Map<String, Object> param = new HashMap<>(); | ||
| 49 | + if (guideboardInfo.getId() != null) { | ||
| 50 | + param.put("id_ne", guideboardInfo.getId()); | ||
| 51 | + } | ||
| 51 | 52 | ||
| 52 | - } else { | ||
| 53 | - param.put("lpNo_eq", guideboardInfo.getLpNo()); | ||
| 54 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 55 | - throw new ScheduleException("路牌编号重复"); | ||
| 56 | - } | ||
| 57 | - } | ||
| 58 | - } else { | ||
| 59 | - if (guideboardInfo.getLpName() != null) { | ||
| 60 | - param.put("lpName_eq", guideboardInfo.getLpName()); | ||
| 61 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 62 | - throw new ScheduleException("路牌名字重复"); | ||
| 63 | - } | ||
| 64 | - } else { | ||
| 65 | - // 都为空 | ||
| 66 | - throw new ScheduleException("路牌编号名字都为空"); | ||
| 67 | - } | 53 | + if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) { |
| 54 | + throw new ScheduleException("线路未选择"); | ||
| 55 | + } else { | ||
| 56 | + param.put("isCancel_eq", false); // 作废的也算入判定区 | ||
| 57 | + param.put("xl.id_eq", guideboardInfo.getXl().getId()); | ||
| 58 | + param.put("lpName_eq", guideboardInfo.getLpName()); | ||
| 59 | + if (!CollectionUtils.isEmpty(list(param))) { | ||
| 60 | + throw new ScheduleException("路牌名字重复"); | ||
| 68 | } | 61 | } |
| 69 | } | 62 | } |
| 70 | - | ||
| 71 | } | 63 | } |
| 72 | 64 | ||
| 73 | @Transactional | 65 | @Transactional |
| @@ -83,7 +75,8 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | @@ -83,7 +75,8 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | ||
| 83 | GuideboardInfo guideboardInfo = findById(id); | 75 | GuideboardInfo guideboardInfo = findById(id); |
| 84 | Map<String, Object> param = new HashMap<>(); | 76 | Map<String, Object> param = new HashMap<>(); |
| 85 | if (guideboardInfo.getIsCancel()) { | 77 | if (guideboardInfo.getIsCancel()) { |
| 86 | - validate(guideboardInfo); | 78 | + validate_lpno(guideboardInfo); |
| 79 | + validate_lpname(guideboardInfo); | ||
| 87 | guideboardInfo.setIsCancel(false); | 80 | guideboardInfo.setIsCancel(false); |
| 88 | } else { | 81 | } else { |
| 89 | param.clear(); | 82 | param.clear(); |
| @@ -96,7 +89,7 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | @@ -96,7 +89,7 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | ||
| 96 | } else { | 89 | } else { |
| 97 | throw new ScheduleException("在时刻表" + | 90 | throw new ScheduleException("在时刻表" + |
| 98 | ttInfoDetailList.get(0).getTtinfo().getName() + | 91 | ttInfoDetailList.get(0).getTtinfo().getName() + |
| 99 | - "已使用,无法删除!"); | 92 | + "已使用,无法作废!"); |
| 100 | } | 93 | } |
| 101 | } | 94 | } |
| 102 | } | 95 | } |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/edit.html
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | required ng-maxlength="20" | 48 | required ng-maxlength="20" |
| 49 | remote-Validation | 49 | remote-Validation |
| 50 | remotevtype="cars_zbh" | 50 | remotevtype="cars_zbh" |
| 51 | - remotevparam="{{ {'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}" | 51 | + remotevparam="{{ {'id_eq': ctrl.busInfoForSave.id, 'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}" |
| 52 | placeholder="请输入车辆内部编码"/> | 52 | placeholder="请输入车辆内部编码"/> |
| 53 | </div> | 53 | </div> |
| 54 | <!-- 隐藏块,显示验证信息 --> | 54 | <!-- 隐藏块,显示验证信息 --> |
| @@ -66,18 +66,18 @@ | @@ -66,18 +66,18 @@ | ||
| 66 | <div class="form-group has-success has-feedback"> | 66 | <div class="form-group has-success has-feedback"> |
| 67 | <label class="col-md-2 control-label">所属公司*:</label> | 67 | <label class="col-md-2 control-label">所属公司*:</label> |
| 68 | <div class="col-md-3"> | 68 | <div class="col-md-3"> |
| 69 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 70 | - name="gs" | ||
| 71 | - placeholder="请选择所属公司..." | ||
| 72 | - dcvalue="{{ctrl.busInfoForSave.businessCode}}" | 69 | + <sa-Select5 name="gs" |
| 70 | + model="ctrl.busInfoForSave" | ||
| 71 | + cmaps="{'businessCode': 'code', 'company': 'name'}" | ||
| 73 | dcname="businessCode" | 72 | dcname="businessCode" |
| 74 | icname="code" | 73 | icname="code" |
| 75 | - dcname2="company" | ||
| 76 | - icname2="name" | ||
| 77 | - icnames="name" | ||
| 78 | - datatype="gsType" | 74 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 75 | + iterobjname="item" | ||
| 76 | + iterobjexp="item.name" | ||
| 77 | + searchph="请选择所属公司..." | ||
| 78 | + searchexp="this.name" | ||
| 79 | required > | 79 | required > |
| 80 | - </sa-Select3> | 80 | + </sa-Select5> |
| 81 | 81 | ||
| 82 | </div> | 82 | </div> |
| 83 | <!-- 隐藏块,显示验证信息 --> | 83 | <!-- 隐藏块,显示验证信息 --> |
| @@ -108,7 +108,7 @@ | @@ -108,7 +108,7 @@ | ||
| 108 | required placeholder="请输入车辆编码" | 108 | required placeholder="请输入车辆编码" |
| 109 | remote-Validation | 109 | remote-Validation |
| 110 | remotevtype="cars_clbh" | 110 | remotevtype="cars_clbh" |
| 111 | - remotevparam="{{ {'carCode_eq': ctrl.busInfoForSave.carCode} | json}}" | 111 | + remotevparam="{{ {'id_eq': ctrl.busInfoForSave.id, 'carCode_eq': ctrl.busInfoForSave.carCode} | json}}" |
| 112 | /> | 112 | /> |
| 113 | </div> | 113 | </div> |
| 114 | <!-- 隐藏块,显示验证信息 --> | 114 | <!-- 隐藏块,显示验证信息 --> |
| @@ -128,7 +128,7 @@ | @@ -128,7 +128,7 @@ | ||
| 128 | required placeholder="请输入车牌号" | 128 | required placeholder="请输入车牌号" |
| 129 | remote-Validation | 129 | remote-Validation |
| 130 | remotevtype="cars_cph" | 130 | remotevtype="cars_cph" |
| 131 | - remotevparam="{{ {'carPlate_eq': ctrl.busInfoForSave.carPlate} | json}}" | 131 | + remotevparam="{{ {'id_eq': ctrl.busInfoForSave.id, 'carPlate_eq': ctrl.busInfoForSave.carPlate} | json}}" |
| 132 | /> | 132 | /> |
| 133 | </div> | 133 | </div> |
| 134 | <!-- 隐藏快,显示验证信息 --> | 134 | <!-- 隐藏快,显示验证信息 --> |
| @@ -143,16 +143,18 @@ | @@ -143,16 +143,18 @@ | ||
| 143 | <div class="form-group has-success has-feedback"> | 143 | <div class="form-group has-success has-feedback"> |
| 144 | <label class="col-md-2 control-label">设备供应厂商*:</label> | 144 | <label class="col-md-2 control-label">设备供应厂商*:</label> |
| 145 | <div class="col-md-3"> | 145 | <div class="col-md-3"> |
| 146 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 147 | - name="supplierName" | ||
| 148 | - placeholder="请选择设备厂商..." | ||
| 149 | - dcvalue="{{ctrl.busInfoForSave.supplierName}}" | 146 | + <sa-Select5 name="supplierName" |
| 147 | + model="ctrl.busInfoForSave" | ||
| 148 | + cmaps="{'supplierName': 'code'}" | ||
| 150 | dcname="supplierName" | 149 | dcname="supplierName" |
| 151 | icname="code" | 150 | icname="code" |
| 152 | - icnames="name" | ||
| 153 | - datatype="snames" | 151 | + dsparams="{{ {type: 'dic', param: 'snames' } | json }}" |
| 152 | + iterobjname="item" | ||
| 153 | + iterobjexp="item.name" | ||
| 154 | + searchph="请选择设备厂商..." | ||
| 155 | + searchexp="this.name" | ||
| 154 | required > | 156 | required > |
| 155 | - </sa-Select3> | 157 | + </sa-Select5> |
| 156 | </div> | 158 | </div> |
| 157 | <!-- 隐藏快,显示验证信息 --> | 159 | <!-- 隐藏快,显示验证信息 --> |
| 158 | <div class="alert alert-danger well-sm" ng-show="myForm.supplierName.$error.required"> | 160 | <div class="alert alert-danger well-sm" ng-show="myForm.supplierName.$error.required"> |
| @@ -168,7 +170,7 @@ | @@ -168,7 +170,7 @@ | ||
| 168 | required placeholder="请输入设备终端号" | 170 | required placeholder="请输入设备终端号" |
| 169 | remote-Validation | 171 | remote-Validation |
| 170 | remotevtype="cars_sbbh" | 172 | remotevtype="cars_sbbh" |
| 171 | - remotevparam="{{ {'equipmentCode_eq': ctrl.busInfoForSave.equipmentCode} | json}}" | 173 | + remotevparam="{{ {'id_eq': ctrl.busInfoForSave.id, 'equipmentCode_eq': ctrl.busInfoForSave.equipmentCode} | json}}" |
| 172 | /> | 174 | /> |
| 173 | </div> | 175 | </div> |
| 174 | <!-- 隐藏块,显示验证信息 --> | 176 | <!-- 隐藏块,显示验证信息 --> |
| @@ -369,45 +371,54 @@ | @@ -369,45 +371,54 @@ | ||
| 369 | <div class="form-group"> | 371 | <div class="form-group"> |
| 370 | <label class="col-md-2 control-label">车辆类型:</label> | 372 | <label class="col-md-2 control-label">车辆类型:</label> |
| 371 | <div class="col-md-3"> | 373 | <div class="col-md-3"> |
| 372 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 373 | - name="carType" | ||
| 374 | - placeholder="请选择车辆类型..." | ||
| 375 | - dcvalue="{{ctrl.busInfoForSave.carType}}" | 374 | + <sa-Select5 name="carType" |
| 375 | + model="ctrl.busInfoForSave" | ||
| 376 | + cmaps="{'carType': 'code'}" | ||
| 376 | dcname="carType" | 377 | dcname="carType" |
| 377 | icname="code" | 378 | icname="code" |
| 378 | - icnames="name" | ||
| 379 | - datatype="carType" > | ||
| 380 | - </sa-Select3> | 379 | + dsparams="{{ {type: 'dic', param: 'carType' } | json }}" |
| 380 | + iterobjname="item" | ||
| 381 | + iterobjexp="item.name" | ||
| 382 | + searchph="请选择车辆类型..." | ||
| 383 | + searchexp="this.name" | ||
| 384 | + > | ||
| 385 | + </sa-Select5> | ||
| 381 | </div> | 386 | </div> |
| 382 | </div> | 387 | </div> |
| 383 | 388 | ||
| 384 | <div class="form-group"> | 389 | <div class="form-group"> |
| 385 | <label class="col-md-2 control-label">是否机动车:</label> | 390 | <label class="col-md-2 control-label">是否机动车:</label> |
| 386 | <div class="col-md-3"> | 391 | <div class="col-md-3"> |
| 387 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 388 | - name="vehicleStats" | ||
| 389 | - placeholder="请选择机动车类型..." | ||
| 390 | - dcvalue="{{ctrl.busInfoForSave.vehicleStats}}" | 392 | + <sa-Select5 name="vehicleStats" |
| 393 | + model="ctrl.busInfoForSave" | ||
| 394 | + cmaps="{'vehicleStats': 'code'}" | ||
| 391 | dcname="vehicleStats" | 395 | dcname="vehicleStats" |
| 392 | icname="code" | 396 | icname="code" |
| 393 | - icnames="name" | ||
| 394 | - datatype="jdcType" > | ||
| 395 | - </sa-Select3> | 397 | + dsparams="{{ {type: 'dic', param: 'jdcType' } | json }}" |
| 398 | + iterobjname="item" | ||
| 399 | + iterobjexp="item.name" | ||
| 400 | + searchph="请选择机动车类型..." | ||
| 401 | + searchexp="this.name" | ||
| 402 | + > | ||
| 403 | + </sa-Select5> | ||
| 396 | </div> | 404 | </div> |
| 397 | </div> | 405 | </div> |
| 398 | 406 | ||
| 399 | <div class="form-group"> | 407 | <div class="form-group"> |
| 400 | <label class="col-md-2 control-label">营运状态:</label> | 408 | <label class="col-md-2 control-label">营运状态:</label> |
| 401 | <div class="col-md-3"> | 409 | <div class="col-md-3"> |
| 402 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 403 | - name="operatorsState" | ||
| 404 | - placeholder="请选择营运状态..." | ||
| 405 | - dcvalue="{{ctrl.busInfoForSave.operatorsState}}" | 410 | + <sa-Select5 name="operatorsState" |
| 411 | + model="ctrl.busInfoForSave" | ||
| 412 | + cmaps="{'operatorsState': 'code'}" | ||
| 406 | dcname="operatorsState" | 413 | dcname="operatorsState" |
| 407 | icname="code" | 414 | icname="code" |
| 408 | - icnames="name" | ||
| 409 | - datatype="yyztType" > | ||
| 410 | - </sa-Select3> | 415 | + dsparams="{{ {type: 'dic', param: 'yyztType' } | json }}" |
| 416 | + iterobjname="item" | ||
| 417 | + iterobjexp="item.name" | ||
| 418 | + searchph="请选择营运状态..." | ||
| 419 | + searchexp="this.name" | ||
| 420 | + > | ||
| 421 | + </sa-Select5> | ||
| 411 | </div> | 422 | </div> |
| 412 | </div> | 423 | </div> |
| 413 | 424 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/form.html
| @@ -66,18 +66,18 @@ | @@ -66,18 +66,18 @@ | ||
| 66 | <div class="form-group has-success has-feedback"> | 66 | <div class="form-group has-success has-feedback"> |
| 67 | <label class="col-md-2 control-label">所属公司*:</label> | 67 | <label class="col-md-2 control-label">所属公司*:</label> |
| 68 | <div class="col-md-3"> | 68 | <div class="col-md-3"> |
| 69 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 70 | - name="gs" | ||
| 71 | - placeholder="请选择所属公司..." | ||
| 72 | - dcvalue="{{ctrl.busInfoForSave.businessCode}}" | 69 | + <sa-Select5 name="gs" |
| 70 | + model="ctrl.busInfoForSave" | ||
| 71 | + cmaps="{'businessCode': 'code', 'company': 'name'}" | ||
| 73 | dcname="businessCode" | 72 | dcname="businessCode" |
| 74 | icname="code" | 73 | icname="code" |
| 75 | - dcname2="company" | ||
| 76 | - icname2="name" | ||
| 77 | - icnames="name" | ||
| 78 | - datatype="gsType" | 74 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 75 | + iterobjname="item" | ||
| 76 | + iterobjexp="item.name" | ||
| 77 | + searchph="请选择所属公司..." | ||
| 78 | + searchexp="this.name" | ||
| 79 | required > | 79 | required > |
| 80 | - </sa-Select3> | 80 | + </sa-Select5> |
| 81 | 81 | ||
| 82 | </div> | 82 | </div> |
| 83 | <!-- 隐藏块,显示验证信息 --> | 83 | <!-- 隐藏块,显示验证信息 --> |
| @@ -143,16 +143,18 @@ | @@ -143,16 +143,18 @@ | ||
| 143 | <div class="form-group has-success has-feedback"> | 143 | <div class="form-group has-success has-feedback"> |
| 144 | <label class="col-md-2 control-label">设备供应厂商*:</label> | 144 | <label class="col-md-2 control-label">设备供应厂商*:</label> |
| 145 | <div class="col-md-3"> | 145 | <div class="col-md-3"> |
| 146 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 147 | - name="supplierName" | ||
| 148 | - placeholder="请选择设备厂商..." | ||
| 149 | - dcvalue="{{ctrl.busInfoForSave.supplierName}}" | 146 | + <sa-Select5 name="supplierName" |
| 147 | + model="ctrl.busInfoForSave" | ||
| 148 | + cmaps="{'supplierName': 'code'}" | ||
| 150 | dcname="supplierName" | 149 | dcname="supplierName" |
| 151 | icname="code" | 150 | icname="code" |
| 152 | - icnames="name" | ||
| 153 | - datatype="snames" | 151 | + dsparams="{{ {type: 'dic', param: 'snames' } | json }}" |
| 152 | + iterobjname="item" | ||
| 153 | + iterobjexp="item.name" | ||
| 154 | + searchph="请选择设备厂商..." | ||
| 155 | + searchexp="this.name" | ||
| 154 | required > | 156 | required > |
| 155 | - </sa-Select3> | 157 | + </sa-Select5> |
| 156 | </div> | 158 | </div> |
| 157 | <!-- 隐藏快,显示验证信息 --> | 159 | <!-- 隐藏快,显示验证信息 --> |
| 158 | <div class="alert alert-danger well-sm" ng-show="myForm.supplierName.$error.required"> | 160 | <div class="alert alert-danger well-sm" ng-show="myForm.supplierName.$error.required"> |
| @@ -369,45 +371,54 @@ | @@ -369,45 +371,54 @@ | ||
| 369 | <div class="form-group"> | 371 | <div class="form-group"> |
| 370 | <label class="col-md-2 control-label">车辆类型:</label> | 372 | <label class="col-md-2 control-label">车辆类型:</label> |
| 371 | <div class="col-md-3"> | 373 | <div class="col-md-3"> |
| 372 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 373 | - name="carType" | ||
| 374 | - placeholder="请选择车辆类型..." | ||
| 375 | - dcvalue="{{ctrl.busInfoForSave.carType}}" | 374 | + <sa-Select5 name="carType" |
| 375 | + model="ctrl.busInfoForSave" | ||
| 376 | + cmaps="{'carType': 'code'}" | ||
| 376 | dcname="carType" | 377 | dcname="carType" |
| 377 | icname="code" | 378 | icname="code" |
| 378 | - icnames="name" | ||
| 379 | - datatype="carType" > | ||
| 380 | - </sa-Select3> | 379 | + dsparams="{{ {type: 'dic', param: 'carType' } | json }}" |
| 380 | + iterobjname="item" | ||
| 381 | + iterobjexp="item.name" | ||
| 382 | + searchph="请选择车辆类型..." | ||
| 383 | + searchexp="this.name" | ||
| 384 | + > | ||
| 385 | + </sa-Select5> | ||
| 381 | </div> | 386 | </div> |
| 382 | </div> | 387 | </div> |
| 383 | 388 | ||
| 384 | <div class="form-group"> | 389 | <div class="form-group"> |
| 385 | <label class="col-md-2 control-label">是否机动车:</label> | 390 | <label class="col-md-2 control-label">是否机动车:</label> |
| 386 | <div class="col-md-3"> | 391 | <div class="col-md-3"> |
| 387 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 388 | - name="vehicleStats" | ||
| 389 | - placeholder="请选择机动车类型..." | ||
| 390 | - dcvalue="{{ctrl.busInfoForSave.vehicleStats}}" | 392 | + <sa-Select5 name="vehicleStats" |
| 393 | + model="ctrl.busInfoForSave" | ||
| 394 | + cmaps="{'vehicleStats': 'code'}" | ||
| 391 | dcname="vehicleStats" | 395 | dcname="vehicleStats" |
| 392 | icname="code" | 396 | icname="code" |
| 393 | - icnames="name" | ||
| 394 | - datatype="jdcType" > | ||
| 395 | - </sa-Select3> | 397 | + dsparams="{{ {type: 'dic', param: 'jdcType' } | json }}" |
| 398 | + iterobjname="item" | ||
| 399 | + iterobjexp="item.name" | ||
| 400 | + searchph="请选择机动车类型..." | ||
| 401 | + searchexp="this.name" | ||
| 402 | + > | ||
| 403 | + </sa-Select5> | ||
| 396 | </div> | 404 | </div> |
| 397 | </div> | 405 | </div> |
| 398 | 406 | ||
| 399 | <div class="form-group"> | 407 | <div class="form-group"> |
| 400 | <label class="col-md-2 control-label">营运状态:</label> | 408 | <label class="col-md-2 control-label">营运状态:</label> |
| 401 | <div class="col-md-3"> | 409 | <div class="col-md-3"> |
| 402 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 403 | - name="operatorsState" | ||
| 404 | - placeholder="请选择营运状态..." | ||
| 405 | - dcvalue="{{ctrl.busInfoForSave.operatorsState}}" | 410 | + <sa-Select5 name="operatorsState" |
| 411 | + model="ctrl.busInfoForSave" | ||
| 412 | + cmaps="{'operatorsState': 'code'}" | ||
| 406 | dcname="operatorsState" | 413 | dcname="operatorsState" |
| 407 | icname="code" | 414 | icname="code" |
| 408 | - icnames="name" | ||
| 409 | - datatype="yyztType" > | ||
| 410 | - </sa-Select3> | 415 | + dsparams="{{ {type: 'dic', param: 'yyztType' } | json }}" |
| 416 | + iterobjname="item" | ||
| 417 | + iterobjexp="item.name" | ||
| 418 | + searchph="请选择营运状态..." | ||
| 419 | + searchexp="this.name" | ||
| 420 | + > | ||
| 421 | + </sa-Select5> | ||
| 411 | </div> | 422 | </div> |
| 412 | </div> | 423 | </div> |
| 413 | 424 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/list.html
| @@ -30,15 +30,18 @@ | @@ -30,15 +30,18 @@ | ||
| 30 | </td> | 30 | </td> |
| 31 | <td> | 31 | <td> |
| 32 | <div> | 32 | <div> |
| 33 | - <sa-Select3 model="ctrl.searchCondition()" | ||
| 34 | - name="gs" | ||
| 35 | - placeholder="请选择..." | ||
| 36 | - dcvalue="{{ctrl.searchCondition().businessCode_eq}}" | 33 | + <sa-Select5 name="gs" |
| 34 | + model="ctrl.searchCondition()" | ||
| 35 | + cmaps="{'businessCode_eq': 'code'}" | ||
| 37 | dcname="businessCode_eq" | 36 | dcname="businessCode_eq" |
| 38 | icname="code" | 37 | icname="code" |
| 39 | - icnames="name" | ||
| 40 | - datatype="gsType"> | ||
| 41 | - </sa-Select3> | 38 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 39 | + iterobjname="item" | ||
| 40 | + iterobjexp="item.name" | ||
| 41 | + searchph="选择公司..." | ||
| 42 | + searchexp="this.name" | ||
| 43 | + > | ||
| 44 | + </sa-Select5> | ||
| 42 | </div> | 45 | </div> |
| 43 | </td> | 46 | </td> |
| 44 | <td> | 47 | <td> |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
| @@ -247,9 +247,7 @@ angular.module('ScheduleApp').controller( | @@ -247,9 +247,7 @@ angular.module('ScheduleApp').controller( | ||
| 247 | // 提交方法 | 247 | // 提交方法 |
| 248 | self.submit = function() { | 248 | self.submit = function() { |
| 249 | console.log(self.busInfoForSave); | 249 | console.log(self.busInfoForSave); |
| 250 | - //if (self.busInfoForSave) { | ||
| 251 | - // delete $stateParams.id; | ||
| 252 | - //} | 250 | + // 保存或者更新 |
| 253 | self.busInfoForSave.$save(function() { | 251 | self.busInfoForSave.$save(function() { |
| 254 | $state.go("busInfoManage"); | 252 | $state.go("busInfoManage"); |
| 255 | }); | 253 | }); |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/service.js
| 1 | // 车辆信息service | 1 | // 车辆信息service |
| 2 | -angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) { | ||
| 3 | - return { | ||
| 4 | - rest: $resource( | ||
| 5 | - '/cars_sc/:id', | ||
| 6 | - {order: 'carCode', direction: 'ASC', id: '@id_route'}, | ||
| 7 | - { | ||
| 8 | - list: { | ||
| 9 | - method: 'GET', | ||
| 10 | - params: { | ||
| 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; // 业务错误留给控制器处理 | 2 | +angular.module('ScheduleApp').factory( |
| 3 | + 'BusInfoManageService_g', | ||
| 4 | + [ | ||
| 5 | + '$resource', | ||
| 6 | + function($resource) { | ||
| 7 | + return { | ||
| 8 | + rest: $resource( | ||
| 9 | + '/cars_sc/:id', | ||
| 10 | + {order: 'carCode', direction: 'ASC', id: '@id'}, | ||
| 11 | + { | ||
| 12 | + list: { | ||
| 13 | + method: 'GET', | ||
| 14 | + params: { | ||
| 15 | + page: 0 | ||
| 16 | + }, | ||
| 17 | + transformResponse: function(rs) { | ||
| 18 | + var dst = angular.fromJson(rs); | ||
| 19 | + if (dst.status == 'SUCCESS') { | ||
| 20 | + return dst.data; | ||
| 21 | + } else { | ||
| 22 | + return dst; // 业务错误留给控制器处理 | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + }, | ||
| 26 | + get: { | ||
| 27 | + method: 'GET', | ||
| 28 | + transformResponse: function(rs) { | ||
| 29 | + var dst = angular.fromJson(rs); | ||
| 30 | + if (dst.status == 'SUCCESS') { | ||
| 31 | + return dst.data; | ||
| 32 | + } else { | ||
| 33 | + return dst; | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + save: { | ||
| 38 | + method: 'POST' | ||
| 19 | } | 39 | } |
| 20 | } | 40 | } |
| 21 | - }, | ||
| 22 | - 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; | 41 | + ), |
| 42 | + import: $resource( | ||
| 43 | + '/cars/importfile', | ||
| 44 | + {}, | ||
| 45 | + { | ||
| 46 | + do: { | ||
| 47 | + method: 'POST', | ||
| 48 | + headers: { | ||
| 49 | + 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 50 | + }, | ||
| 51 | + transformRequest: function(obj) { | ||
| 52 | + var str = []; | ||
| 53 | + for (var p in obj) { | ||
| 54 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 55 | + } | ||
| 56 | + return str.join("&"); | ||
| 57 | + } | ||
| 30 | } | 58 | } |
| 31 | } | 59 | } |
| 32 | - }, | ||
| 33 | - save: { | ||
| 34 | - method: 'POST' | ||
| 35 | - } | ||
| 36 | - } | ||
| 37 | - ), | ||
| 38 | - import: $resource( | ||
| 39 | - '/cars/importfile', | ||
| 40 | - {}, | ||
| 41 | - { | ||
| 42 | - do: { | ||
| 43 | - method: 'POST', | ||
| 44 | - headers: { | ||
| 45 | - 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 46 | - }, | ||
| 47 | - transformRequest: function(obj) { | ||
| 48 | - var str = []; | ||
| 49 | - for (var p in obj) { | ||
| 50 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | 60 | + ), |
| 61 | + dataTools: $resource( | ||
| 62 | + '/cars/:type', | ||
| 63 | + {}, | ||
| 64 | + { | ||
| 65 | + dataExport: { | ||
| 66 | + method: 'GET', | ||
| 67 | + responseType: "arraybuffer", | ||
| 68 | + params: { | ||
| 69 | + type: "dataExport" | ||
| 70 | + }, | ||
| 71 | + transformResponse: function(data, headers){ | ||
| 72 | + return {data : data}; | ||
| 73 | + } | ||
| 51 | } | 74 | } |
| 52 | - return str.join("&"); | ||
| 53 | } | 75 | } |
| 54 | - } | ||
| 55 | - } | ||
| 56 | - ), | ||
| 57 | - validate: $resource( | ||
| 58 | - '/cars/validate/:type', | ||
| 59 | - {}, | ||
| 60 | - { | ||
| 61 | - insideCode: { | ||
| 62 | - method: 'GET' | ||
| 63 | - } | ||
| 64 | - } | ||
| 65 | - ), | ||
| 66 | - dataTools: $resource( | ||
| 67 | - '/cars/:type', | ||
| 68 | - {}, | ||
| 69 | - { | ||
| 70 | - dataExport: { | ||
| 71 | - method: 'GET', | ||
| 72 | - responseType: "arraybuffer", | ||
| 73 | - params: { | ||
| 74 | - type: "dataExport" | ||
| 75 | - }, | ||
| 76 | - transformResponse: function(data, headers){ | ||
| 77 | - return {data : data}; | ||
| 78 | - } | ||
| 79 | - } | ||
| 80 | - } | ||
| 81 | - ) | ||
| 82 | - }; | ||
| 83 | -}]); | ||
| 84 | \ No newline at end of file | 76 | \ No newline at end of file |
| 77 | + ) | ||
| 78 | + }; | ||
| 79 | + | ||
| 80 | + } | ||
| 81 | + ] | ||
| 82 | +); | ||
| 85 | \ No newline at end of file | 83 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html
| @@ -147,7 +147,7 @@ | @@ -147,7 +147,7 @@ | ||
| 147 | ng-model="ctrl.deviceInfoForSave.qyrq" readonly | 147 | ng-model="ctrl.deviceInfoForSave.qyrq" readonly |
| 148 | remote-Validation | 148 | remote-Validation |
| 149 | remotevtype="cde1" | 149 | remotevtype="cde1" |
| 150 | - remotevparam="{{ {'qyrq': ctrl.deviceInfoForSave.qyrq, 'xl': ctrl.deviceInfoForSave.xl, 'cl': ctrl.deviceInfoForSave.cl} | json}}"/> | 150 | + remotevparam="{{ {'id_eq': ctrl.deviceInfoForSave.id, 'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}"/> |
| 151 | <span class="input-group-btn"> | 151 | <span class="input-group-btn"> |
| 152 | <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> | 152 | <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> |
| 153 | <i class="glyphicon glyphicon-calendar"></i> | 153 | <i class="glyphicon glyphicon-calendar"></i> |
| @@ -160,7 +160,7 @@ | @@ -160,7 +160,7 @@ | ||
| 160 | 启用日期必须选择 | 160 | 启用日期必须选择 |
| 161 | </div> | 161 | </div> |
| 162 | <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote"> | 162 | <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote"> |
| 163 | - 启用日期必须比历史的启用日期大 | 163 | + {{$remote_msg}} |
| 164 | </div> | 164 | </div> |
| 165 | </div> | 165 | </div> |
| 166 | 166 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html
| @@ -147,7 +147,7 @@ | @@ -147,7 +147,7 @@ | ||
| 147 | ng-model="ctrl.deviceInfoForSave.qyrq" readonly | 147 | ng-model="ctrl.deviceInfoForSave.qyrq" readonly |
| 148 | remote-Validation | 148 | remote-Validation |
| 149 | remotevtype="cde1" | 149 | remotevtype="cde1" |
| 150 | - remotevparam="{{ {'qyrq': ctrl.deviceInfoForSave.qyrq, 'xl': ctrl.deviceInfoForSave.xl, 'cl': ctrl.deviceInfoForSave.cl} | json}}"/> | 150 | + remotevparam="{{ {'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}"/> |
| 151 | <span class="input-group-btn"> | 151 | <span class="input-group-btn"> |
| 152 | <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> | 152 | <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> |
| 153 | <i class="glyphicon glyphicon-calendar"></i> | 153 | <i class="glyphicon glyphicon-calendar"></i> |
| @@ -160,7 +160,7 @@ | @@ -160,7 +160,7 @@ | ||
| 160 | 启用日期必须选择 | 160 | 启用日期必须选择 |
| 161 | </div> | 161 | </div> |
| 162 | <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote"> | 162 | <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote"> |
| 163 | - 启用日期必须比历史的启用日期大 | 163 | + {{$remote_msg}} |
| 164 | </div> | 164 | </div> |
| 165 | </div> | 165 | </div> |
| 166 | 166 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html
| @@ -12,7 +12,8 @@ | @@ -12,7 +12,8 @@ | ||
| 12 | <th>新设备编号</th> | 12 | <th>新设备编号</th> |
| 13 | <th>旧SIM卡</th> | 13 | <th>旧SIM卡</th> |
| 14 | <th>新SIM卡</th> | 14 | <th>新SIM卡</th> |
| 15 | - <th style="width: 180px;">创建时间</th> | 15 | + <th style="width: 180px;">更新时间</th> |
| 16 | + <th style="width: 80px;" >状态</th> | ||
| 16 | <th style="width: 150pt;">操作</th> | 17 | <th style="width: 150pt;">操作</th> |
| 17 | </tr> | 18 | </tr> |
| 18 | <tr role="row" class="filter"> | 19 | <tr role="row" class="filter"> |
| @@ -41,19 +42,24 @@ | @@ -41,19 +42,24 @@ | ||
| 41 | <td></td> | 42 | <td></td> |
| 42 | <td></td> | 43 | <td></td> |
| 43 | <td> | 44 | <td> |
| 45 | + <label class="checkbox-inline input"> | ||
| 46 | + <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']" />已作废 | ||
| 47 | + </label> | ||
| 48 | + </td> | ||
| 49 | + <td> | ||
| 44 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" | 50 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" |
| 45 | - ng-click="ctrl.pageChanaged()"> | 51 | + ng-click="ctrl.doPage()"> |
| 46 | <i class="fa fa-search"></i> 搜索</button> | 52 | <i class="fa fa-search"></i> 搜索</button> |
| 47 | 53 | ||
| 48 | <button class="btn btn-sm red btn-outline filter-cancel" | 54 | <button class="btn btn-sm red btn-outline filter-cancel" |
| 49 | - ng-click="ctrl.resetSearchCondition()"> | 55 | + ng-click="ctrl.reset()"> |
| 50 | <i class="fa fa-times"></i> 重置</button> | 56 | <i class="fa fa-times"></i> 重置</button> |
| 51 | </td> | 57 | </td> |
| 52 | 58 | ||
| 53 | </tr> | 59 | </tr> |
| 54 | </thead> | 60 | </thead> |
| 55 | <tbody> | 61 | <tbody> |
| 56 | - <tr ng-repeat="info in ctrl.pageInfo.infos" ng-class="{odd: true, gradeX: true, danger: info.isCancel}"> | 62 | + <tr ng-repeat="info in ctrl.page()['content']" ng-class="{odd: true, gradeX: true, danger: info.isCancel}"> |
| 57 | <td> | 63 | <td> |
| 58 | <span ng-bind="$index + 1"></span> | 64 | <span ng-bind="$index + 1"></span> |
| 59 | </td> | 65 | </td> |
| @@ -79,15 +85,19 @@ | @@ -79,15 +85,19 @@ | ||
| 79 | <span ng-bind="info.newSimNo"></span> | 85 | <span ng-bind="info.newSimNo"></span> |
| 80 | </td> | 86 | </td> |
| 81 | <td> | 87 | <td> |
| 82 | - <span ng-bind="info.createDate | date:'yyyy-MM-dd HH:mm:ss'"></span> | 88 | + <span ng-bind="info.updateDate | date:'yyyy-MM-dd HH:mm:ss'"></span> |
| 89 | + </td> | ||
| 90 | + <td> | ||
| 91 | + <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span> | ||
| 92 | + <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span> | ||
| 83 | </td> | 93 | </td> |
| 84 | <td> | 94 | <td> |
| 85 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> | 95 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> |
| 86 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | 96 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> |
| 87 | <a ui-sref="deviceInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> | 97 | <a ui-sref="deviceInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> |
| 88 | <a ui-sref="deviceInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> | 98 | <a ui-sref="deviceInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> |
| 89 | - <a ng-click="ctrl.toggleCde(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a> | ||
| 90 | - <a ng-click="ctrl.toggleCde(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> | 99 | + <a ng-click="ctrl.toggleCarDevice(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a> |
| 100 | + <a ng-click="ctrl.toggleCarDevice(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> | ||
| 91 | </td> | 101 | </td> |
| 92 | </tr> | 102 | </tr> |
| 93 | </tbody> | 103 | </tbody> |
| @@ -96,9 +106,9 @@ | @@ -96,9 +106,9 @@ | ||
| 96 | </div> | 106 | </div> |
| 97 | 107 | ||
| 98 | <div style="text-align: right;"> | 108 | <div style="text-align: right;"> |
| 99 | - <uib-pagination total-items="ctrl.pageInfo.totalItems" | ||
| 100 | - ng-model="ctrl.pageInfo.currentPage" | ||
| 101 | - ng-change="ctrl.pageChanaged()" | 109 | + <uib-pagination total-items="ctrl.page()['totalElements']" |
| 110 | + ng-model="ctrl.page()['uiNumber']" | ||
| 111 | + ng-change="ctrl.doPage()" | ||
| 102 | rotate="false" | 112 | rotate="false" |
| 103 | max-size="10" | 113 | max-size="10" |
| 104 | boundary-links="true" | 114 | boundary-links="true" |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js
| 1 | // 设备信息维护 service controller 等写在一起 | 1 | // 设备信息维护 service controller 等写在一起 |
| 2 | 2 | ||
| 3 | -angular.module('ScheduleApp').factory('DeviceInfoManageService', ['DeviceInfoManageService_g', function(service) { | ||
| 4 | - /** 当前的查询条件信息 */ | ||
| 5 | - var currentSearchCondition = {}; | ||
| 6 | - | ||
| 7 | - /** 当前第几页 */ | ||
| 8 | - var currentPageNo = 1; | ||
| 9 | - | ||
| 10 | - return { | ||
| 11 | - /** | ||
| 12 | - * 获取查询条件信息, | ||
| 13 | - * 用于给controller用来和页面数据绑定。 | ||
| 14 | - */ | ||
| 15 | - getSearchCondition: function() { | ||
| 16 | - return currentSearchCondition; | ||
| 17 | - }, | ||
| 18 | - /** | ||
| 19 | - * 重置查询条件信息。 | ||
| 20 | - */ | ||
| 21 | - resetSearchCondition: function() { | ||
| 22 | - var key; | ||
| 23 | - for (key in currentSearchCondition) { | ||
| 24 | - currentSearchCondition[key] = ""; | ||
| 25 | - } | ||
| 26 | - }, | ||
| 27 | - /** | ||
| 28 | - * 设置当前页码。 | ||
| 29 | - * @param cpn 从1开始,后台是从0开始的 | ||
| 30 | - */ | ||
| 31 | - setCurrentPageNo: function(cpn) { | ||
| 32 | - currentPageNo = cpn; | ||
| 33 | - }, | ||
| 34 | - /** | ||
| 35 | - * 组装查询参数,返回一个promise查询结果。 | ||
| 36 | - * @param params 查询参数 | ||
| 37 | - * @return 返回一个 promise | ||
| 38 | - */ | ||
| 39 | - getPage: function() { | ||
| 40 | - var params = currentSearchCondition; // 查询条件 | ||
| 41 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | ||
| 42 | - return service.list(params).$promise; | ||
| 43 | - }, | ||
| 44 | - /** | ||
| 45 | - * 获取明细信息。 | ||
| 46 | - * @param id 车辆id | ||
| 47 | - * @return 返回一个 promise | ||
| 48 | - */ | ||
| 49 | - getDetail: function(id) { | ||
| 50 | - var params = {id: id}; | ||
| 51 | - return service.get(params).$promise; | ||
| 52 | - }, | ||
| 53 | - /** | ||
| 54 | - * 保存信息。 | ||
| 55 | - * @param obj 车辆详细信息 | ||
| 56 | - * @return 返回一个 promise | ||
| 57 | - */ | ||
| 58 | - saveDetail: function(obj) { | ||
| 59 | - return service.save(obj).$promise; | ||
| 60 | - }, | ||
| 61 | - /** | ||
| 62 | - * 删除信息。 | ||
| 63 | - * @param id 主键id | ||
| 64 | - * @returns {*|Function|promise|n} | ||
| 65 | - */ | ||
| 66 | - deleteDetail: function(id) { | ||
| 67 | - return service.delete({id: id}).$promise; | 3 | +angular.module('ScheduleApp').factory( |
| 4 | + 'DeviceInfoManageService', | ||
| 5 | + [ | ||
| 6 | + 'DeviceInfoManageService_g', | ||
| 7 | + function(service) { | ||
| 8 | + /** 当前的查询条件信息 */ | ||
| 9 | + var currentSearchCondition = {'isCancel_eq': false}; | ||
| 10 | + | ||
| 11 | + // 当前查询返回的信息 | ||
| 12 | + var currentPage = { // 后台spring data返回的格式 | ||
| 13 | + totalElements: 0, | ||
| 14 | + number: 0, // 后台返回的页码,spring返回从0开始 | ||
| 15 | + content: [], | ||
| 16 | + | ||
| 17 | + uiNumber: 1 // 页面绑定的页码 | ||
| 18 | + }; | ||
| 19 | + | ||
| 20 | + // 查询对象 | ||
| 21 | + var queryClass = service; | ||
| 22 | + | ||
| 23 | + return { | ||
| 24 | + getQueryClass: function() { | ||
| 25 | + return queryClass; | ||
| 26 | + }, | ||
| 27 | + getSearchCondition: function() { | ||
| 28 | + currentSearchCondition.page = currentPage.uiNumber - 1; | ||
| 29 | + return currentSearchCondition; | ||
| 30 | + }, | ||
| 31 | + getPage: function(page) { | ||
| 32 | + if (page) { | ||
| 33 | + currentPage.totalElements = page.totalElements; | ||
| 34 | + currentPage.number = page.number; | ||
| 35 | + currentPage.content = page.content; | ||
| 36 | + } | ||
| 37 | + return currentPage; | ||
| 38 | + }, | ||
| 39 | + resetStatus: function() { | ||
| 40 | + currentSearchCondition = {page: 0, 'isCancel_eq': false}; | ||
| 41 | + currentPage = { | ||
| 42 | + totalElements: 0, | ||
| 43 | + number: 0, | ||
| 44 | + content: [], | ||
| 45 | + uiNumber: 1 | ||
| 46 | + }; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + }; | ||
| 50 | + | ||
| 68 | } | 51 | } |
| 69 | - }; | ||
| 70 | - | ||
| 71 | -}]); | ||
| 72 | - | ||
| 73 | -angular.module('ScheduleApp').controller('DeviceInfoManageCtrl', ['DeviceInfoManageService', '$state', function(deviceInfoManageService, $state) { | ||
| 74 | - var self = this; | ||
| 75 | - | ||
| 76 | - // 切换到form状态 | ||
| 77 | - self.goForm = function() { | ||
| 78 | - //alert("切换"); | ||
| 79 | - $state.go("deviceInfoManage_form"); | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - | ||
| 83 | -}]); | ||
| 84 | - | ||
| 85 | -angular.module('ScheduleApp').controller('DeviceInfoManageListCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) { | ||
| 86 | - var self = this; | ||
| 87 | - self.pageInfo = { | ||
| 88 | - totalItems : 0, | ||
| 89 | - currentPage : 1, | ||
| 90 | - infos: [] | ||
| 91 | - }; | ||
| 92 | - | ||
| 93 | - // 初始创建的时候,获取一次列表数据 | ||
| 94 | - deviceInfoManageService.getPage().then( | ||
| 95 | - function(result) { | ||
| 96 | - self.pageInfo.totalItems = result.totalElements; | ||
| 97 | - self.pageInfo.currentPage = result.number + 1; | ||
| 98 | - self.pageInfo.infos = result.content; | ||
| 99 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | ||
| 100 | - }, | ||
| 101 | - function(result) { | ||
| 102 | - alert("出错啦!"); | 52 | + ] |
| 53 | +); | ||
| 54 | + | ||
| 55 | +// index.html控制器 | ||
| 56 | +angular.module('ScheduleApp').controller( | ||
| 57 | + 'DeviceInfoManageCtrl', | ||
| 58 | + [ | ||
| 59 | + 'DeviceInfoManageService', | ||
| 60 | + '$state', | ||
| 61 | + function(service, $state) { | ||
| 62 | + var self = this; | ||
| 63 | + | ||
| 64 | + // 切换到form状态 | ||
| 65 | + self.goForm = function() { | ||
| 66 | + //alert("切换"); | ||
| 67 | + $state.go("deviceInfoManage_form"); | ||
| 68 | + }; | ||
| 69 | + | ||
| 103 | } | 70 | } |
| 104 | - ); | ||
| 105 | - | ||
| 106 | - // 翻页的时候调用 | ||
| 107 | - self.pageChanaged = function() { | ||
| 108 | - deviceInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | ||
| 109 | - deviceInfoManageService.getPage().then( | ||
| 110 | - function(result) { | ||
| 111 | - self.pageInfo.totalItems = result.totalElements; | ||
| 112 | - self.pageInfo.currentPage = result.number + 1; | ||
| 113 | - self.pageInfo.infos = result.content; | ||
| 114 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | ||
| 115 | - }, | ||
| 116 | - function(result) { | ||
| 117 | - alert("出错啦!"); | ||
| 118 | - } | ||
| 119 | - ); | ||
| 120 | - }; | ||
| 121 | - // 获取查询条件数据 | ||
| 122 | - self.searchCondition = function() { | ||
| 123 | - return deviceInfoManageService.getSearchCondition(); | ||
| 124 | - }; | ||
| 125 | - // 重置查询条件 | ||
| 126 | - self.resetSearchCondition = function() { | ||
| 127 | - deviceInfoManageService.resetSearchCondition(); | ||
| 128 | - self.pageInfo.currentPage = 1; | ||
| 129 | - self.pageChanaged(); | ||
| 130 | - }; | ||
| 131 | - | ||
| 132 | - // 作废/撤销 | ||
| 133 | - self.toggleCde = function(id) { | ||
| 134 | - // TODO: | ||
| 135 | - deviceInfoManageService.deleteDetail(id).then( | ||
| 136 | - function(result) { | ||
| 137 | - if (result.message) { // 暂时这样做,之后全局拦截 | ||
| 138 | - alert("失败:" + result.message); | ||
| 139 | - } else { | ||
| 140 | - alert("成功!"); | ||
| 141 | - | ||
| 142 | - deviceInfoManageService.getPage().then( | ||
| 143 | - function(result) { | ||
| 144 | - self.pageInfo.totalItems = result.totalElements; | ||
| 145 | - self.pageInfo.currentPage = result.number + 1; | ||
| 146 | - self.pageInfo.infos = result.content; | ||
| 147 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | ||
| 148 | - }, | ||
| 149 | - function(result) { | ||
| 150 | - alert("出错啦!"); | ||
| 151 | - } | ||
| 152 | - ); | ||
| 153 | - } | 71 | + ] |
| 72 | +); | ||
| 73 | + | ||
| 74 | +// list.html控制器 | ||
| 75 | +angular.module('ScheduleApp').controller( | ||
| 76 | + 'DeviceInfoManageListCtrl', | ||
| 77 | + [ | ||
| 78 | + 'DeviceInfoManageService', | ||
| 79 | + function(service) { | ||
| 80 | + var self = this; | ||
| 81 | + var CarDevice = service.getQueryClass(); | ||
| 82 | + | ||
| 83 | + self.page = function() { | ||
| 84 | + return service.getPage(); | ||
| 85 | + }; | ||
| 86 | + | ||
| 87 | + self.searchCondition = function() { | ||
| 88 | + return service.getSearchCondition(); | ||
| 89 | + }; | ||
| 90 | + | ||
| 91 | + self.doPage = function() { | ||
| 92 | + var page = CarDevice.list(self.searchCondition(), function() { | ||
| 93 | + service.getPage(page); | ||
| 94 | + }); | ||
| 95 | + }; | ||
| 96 | + self.reset = function() { | ||
| 97 | + service.resetStatus(); | ||
| 98 | + var page = CarDevice.list(self.searchCondition(), function() { | ||
| 99 | + service.getPage(page); | ||
| 100 | + }); | ||
| 101 | + }; | ||
| 102 | + self.toggleCarDevice = function(id) { | ||
| 103 | + CarDevice.delete({id: id}, function(result) { | ||
| 104 | + if (result.msg) { // 暂时这样做,之后全局拦截 | ||
| 105 | + alert("失败:" + result.msg); | ||
| 106 | + } else { | ||
| 107 | + self.doPage(); | ||
| 108 | + } | ||
| 109 | + }); | ||
| 110 | + }; | ||
| 111 | + | ||
| 112 | + self.doPage(); | ||
| 154 | 113 | ||
| 155 | - }, | ||
| 156 | - function(result) { | ||
| 157 | - alert("出错啦!" + result); | ||
| 158 | - } | ||
| 159 | - ); | ||
| 160 | - }; | ||
| 161 | - | ||
| 162 | -}]); | ||
| 163 | - | ||
| 164 | -angular.module('ScheduleApp').controller('DeviceInfoManageFormCtrl', ['DeviceInfoManageService', '$stateParams', '$state', function(deviceInfoManageService, $stateParams, $state) { | ||
| 165 | - var self = this; | ||
| 166 | - | ||
| 167 | - // 启用日期 日期控件开关 | ||
| 168 | - self.qyrqOpen = false; | ||
| 169 | - self.qyrq_open = function() { | ||
| 170 | - self.qyrqOpen = true; | ||
| 171 | - }; | ||
| 172 | - | ||
| 173 | - // 欲保存的busInfo信息,绑定 | ||
| 174 | - self.deviceInfoForSave = {}; | ||
| 175 | - | ||
| 176 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 177 | - var id = $stateParams.id; | ||
| 178 | - if (id) { | ||
| 179 | - self.deviceInfoForSave.id = id; | ||
| 180 | - deviceInfoManageService.getDetail(id).then( | ||
| 181 | - function(result) { | ||
| 182 | - var key; | ||
| 183 | - for (key in result) { | ||
| 184 | - self.deviceInfoForSave[key] = result[key]; | ||
| 185 | - } | ||
| 186 | - // 填写所有的 select 控件选中框数据 | ||
| 187 | - // 公司字典 | ||
| 188 | - if (self.deviceInfoForSave.gsName) { | ||
| 189 | - angular.forEach(self.gses, function(data) { | ||
| 190 | - if (self.deviceInfoForSave.gsName == data.gsmc) { | ||
| 191 | - self.deviceInfoForSave.gs_selected = data; | ||
| 192 | - } | ||
| 193 | - }); | ||
| 194 | - } | ||
| 195 | - }, | ||
| 196 | - function(result) { | ||
| 197 | - alert("出错啦!"); | 114 | + |
| 115 | + } | ||
| 116 | + ] | ||
| 117 | +); | ||
| 118 | + | ||
| 119 | +// form.html控制器 | ||
| 120 | +angular.module('ScheduleApp').controller( | ||
| 121 | + 'DeviceInfoManageFormCtrl', | ||
| 122 | + [ | ||
| 123 | + 'DeviceInfoManageService', | ||
| 124 | + '$stateParams', | ||
| 125 | + '$state', | ||
| 126 | + function(service, $stateParams, $state) { | ||
| 127 | + var self = this; | ||
| 128 | + var CarDevice = service.getQueryClass(); | ||
| 129 | + | ||
| 130 | + // 启用日期 日期控件开关 | ||
| 131 | + self.qyrqOpen = false; | ||
| 132 | + self.qyrq_open = function() { | ||
| 133 | + self.qyrqOpen = true; | ||
| 134 | + }; | ||
| 135 | + | ||
| 136 | + // 欲保存的busInfo信息,绑定 | ||
| 137 | + self.deviceInfoForSave = new CarDevice; | ||
| 138 | + | ||
| 139 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 140 | + var id = $stateParams.id; | ||
| 141 | + if (id) { | ||
| 142 | + CarDevice.get({id: id}, function(value) { | ||
| 143 | + self.deviceInfoForSave = value; | ||
| 144 | + }); | ||
| 198 | } | 145 | } |
| 199 | - ); | ||
| 200 | - } | ||
| 201 | - | ||
| 202 | - // 提交方法 | ||
| 203 | - self.submit = function() { | ||
| 204 | - console.log(self.deviceInfoForSave); | ||
| 205 | - deviceInfoManageService.saveDetail(self.deviceInfoForSave).then( | ||
| 206 | - function(result) { | ||
| 207 | - // TODO:弹出框方式以后改 | ||
| 208 | - if (result.status == 'SUCCESS') { | ||
| 209 | - alert("保存成功!"); | 146 | + |
| 147 | + // 提交方法 | ||
| 148 | + self.submit = function() { | ||
| 149 | + console.log(self.deviceInfoForSave); | ||
| 150 | + | ||
| 151 | + // 保存或者更新 | ||
| 152 | + self.deviceInfoForSave.$save(function() { | ||
| 210 | $state.go("deviceInfoManage"); | 153 | $state.go("deviceInfoManage"); |
| 211 | - } else { | ||
| 212 | - alert("保存异常!"); | ||
| 213 | - } | ||
| 214 | - }, | ||
| 215 | - function(result) { | ||
| 216 | - // TODO:弹出框方式以后改 | ||
| 217 | - alert("出错啦!"); | ||
| 218 | - } | ||
| 219 | - ); | ||
| 220 | - }; | ||
| 221 | - | ||
| 222 | -}]); | ||
| 223 | - | ||
| 224 | -angular.module('ScheduleApp').controller('DeviceInfoManageDetailCtrl', ['DeviceInfoManageService', '$stateParams', function(deviceInfoManageService, $stateParams) { | ||
| 225 | - var self = this; | ||
| 226 | - self.title = ""; | ||
| 227 | - self.deviceInfoForDetail = {}; | ||
| 228 | - self.deviceInfoForDetail.id = $stateParams.id; | ||
| 229 | - | ||
| 230 | - // 当转向到此页面时,就获取明细信息并绑定 | ||
| 231 | - deviceInfoManageService.getDetail($stateParams.id).then( | ||
| 232 | - function(result) { | ||
| 233 | - var key; | ||
| 234 | - for (key in result) { | ||
| 235 | - self.deviceInfoForDetail[key] = result[key]; | ||
| 236 | - } | 154 | + }); |
| 155 | + }; | ||
| 156 | + | ||
| 157 | + } | ||
| 158 | + ] | ||
| 159 | +); | ||
| 160 | + | ||
| 161 | +// detail.html控制器 | ||
| 162 | +angular.module('ScheduleApp').controller( | ||
| 163 | + 'DeviceInfoManageDetailCtrl', | ||
| 164 | + [ | ||
| 165 | + 'DeviceInfoManageService', | ||
| 166 | + '$stateParams', | ||
| 167 | + function(service, $stateParams) { | ||
| 168 | + var self = this; | ||
| 169 | + var CarDevice = service.getQueryClass(); | ||
| 170 | + var id = $stateParams.id; | ||
| 171 | + | ||
| 172 | + self.title = ""; | ||
| 173 | + self.deviceInfoForDetail = {}; | ||
| 174 | + | ||
| 175 | + // 当转向到此页面时,就获取明细信息并绑定 | ||
| 176 | + CarDevice.get({id: id}, function(value) { | ||
| 177 | + self.deviceInfoForDetail = value; | ||
| 178 | + self.title = "车辆 " + | ||
| 179 | + self.deviceInfoForDetail.clZbh + | ||
| 180 | + "设备信息"; | ||
| 181 | + }); | ||
| 237 | 182 | ||
| 238 | - self.title = "车辆 " + self.deviceInfoForDetail.clZbh + "设备信息"; | ||
| 239 | - }, | ||
| 240 | - function(result) { | ||
| 241 | - // TODO:弹出框方式以后改 | ||
| 242 | - alert("出错啦!"); | ||
| 243 | } | 183 | } |
| 244 | - ); | ||
| 245 | -}]); | ||
| 246 | \ No newline at end of file | 184 | \ No newline at end of file |
| 185 | + ] | ||
| 186 | +); | ||
| 247 | \ No newline at end of file | 187 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/service.js
| 1 | // 车辆设备信息service | 1 | // 车辆设备信息service |
| 2 | angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | 2 | angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { |
| 3 | return $resource( | 3 | return $resource( |
| 4 | - '/cde/:id', | ||
| 5 | - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'}, | 4 | + '/cde_sc/:id', |
| 5 | + {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id'}, | ||
| 6 | { | 6 | { |
| 7 | list: { | 7 | list: { |
| 8 | method: 'GET', | 8 | method: 'GET', |
| 9 | params: { | 9 | params: { |
| 10 | page: 0 | 10 | page: 0 |
| 11 | + }, | ||
| 12 | + transformResponse: function(rs) { | ||
| 13 | + var dst = angular.fromJson(rs); | ||
| 14 | + if (dst.status == 'SUCCESS') { | ||
| 15 | + return dst.data; | ||
| 16 | + } else { | ||
| 17 | + return dst; // 业务错误留给控制器处理 | ||
| 18 | + } | ||
| 11 | } | 19 | } |
| 12 | }, | 20 | }, |
| 13 | get: { | 21 | get: { |
| 14 | - method: 'GET' | 22 | + method: 'GET', |
| 23 | + transformResponse: function(rs) { | ||
| 24 | + var dst = angular.fromJson(rs); | ||
| 25 | + if (dst.status == 'SUCCESS') { | ||
| 26 | + return dst.data; | ||
| 27 | + } else { | ||
| 28 | + return dst; | ||
| 29 | + } | ||
| 30 | + } | ||
| 15 | }, | 31 | }, |
| 16 | save: { | 32 | save: { |
| 17 | method: 'POST' | 33 | method: 'POST' |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html
| @@ -36,18 +36,18 @@ | @@ -36,18 +36,18 @@ | ||
| 36 | <div class="form-group has-success has-feedback"> | 36 | <div class="form-group has-success has-feedback"> |
| 37 | <label class="col-md-2 control-label">所属公司*:</label> | 37 | <label class="col-md-2 control-label">所属公司*:</label> |
| 38 | <div class="col-md-3"> | 38 | <div class="col-md-3"> |
| 39 | - <sa-Select3 model="ctrl.employeeInfoForSave" | ||
| 40 | - name="gs" | ||
| 41 | - placeholder="请选择所属公司..." | ||
| 42 | - dcvalue="{{ctrl.employeeInfoForSave.companyCode}}" | 39 | + <sa-Select5 name="gs" |
| 40 | + model="ctrl.employeeInfoForSave" | ||
| 41 | + cmaps="{'companyCode': 'code', 'company': 'name'}" | ||
| 43 | dcname="companyCode" | 42 | dcname="companyCode" |
| 44 | icname="code" | 43 | icname="code" |
| 45 | - dcname2="company" | ||
| 46 | - icname2="name" | ||
| 47 | - icnames="name" | ||
| 48 | - datatype="gsType" | 44 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 45 | + iterobjname="item" | ||
| 46 | + iterobjexp="item.name" | ||
| 47 | + searchph="请输拼音..." | ||
| 48 | + searchexp="this.name" | ||
| 49 | required > | 49 | required > |
| 50 | - </sa-Select3> | 50 | + </sa-Select5> |
| 51 | </div> | 51 | </div> |
| 52 | <!-- 隐藏块,显示验证信息 --> | 52 | <!-- 隐藏块,显示验证信息 --> |
| 53 | <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> | 53 | <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> |
| @@ -74,15 +74,17 @@ | @@ -74,15 +74,17 @@ | ||
| 74 | <div class="col-md-3"> | 74 | <div class="col-md-3"> |
| 75 | <input type="text" class="form-control" | 75 | <input type="text" class="form-control" |
| 76 | name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCode" | 76 | name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCode" |
| 77 | - remote-Validaton rvtype="jobCode" rv1="{{ctrl.employeeInfoForSave.companyCode}}" | ||
| 78 | - required placeholder="请输入工号"/> | 77 | + required placeholder="请输入工号" |
| 78 | + remote-Validation | ||
| 79 | + remotevtype="ee_gh" | ||
| 80 | + remotevparam="{{ {'id_eq': ctrl.employeeInfoForSave.id, 'companyCode_eq' : ctrl.employeeInfoForSave.companyCode, 'jobCode_eq': ctrl.employeeInfoForSave.jobCode} | json}}"/> | ||
| 79 | </div> | 81 | </div> |
| 80 | <!-- 隐藏块,显示验证信息 --> | 82 | <!-- 隐藏块,显示验证信息 --> |
| 81 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> | 83 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> |
| 82 | 工号必须填写 | 84 | 工号必须填写 |
| 83 | </div> | 85 | </div> |
| 84 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> | 86 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> |
| 85 | - 选择公司并且相同公司工号不能重复 | 87 | + {{$remote_msg}} |
| 86 | </div> | 88 | </div> |
| 87 | </div> | 89 | </div> |
| 88 | 90 | ||
| @@ -125,15 +127,18 @@ | @@ -125,15 +127,18 @@ | ||
| 125 | <div class="form-group"> | 127 | <div class="form-group"> |
| 126 | <label class="col-md-2 control-label">工种:</label> | 128 | <label class="col-md-2 control-label">工种:</label> |
| 127 | <div class="col-md-4"> | 129 | <div class="col-md-4"> |
| 128 | - <sa-Select3 model="ctrl.employeeInfoForSave" | ||
| 129 | - name="posts" | ||
| 130 | - placeholder="请选择工种..." | ||
| 131 | - dcvalue="{{ctrl.employeeInfoForSave.posts}}" | 130 | + <sa-Select5 name="posts" |
| 131 | + model="ctrl.employeeInfoForSave" | ||
| 132 | + cmaps="{'posts': 'code'}" | ||
| 132 | dcname="posts" | 133 | dcname="posts" |
| 133 | icname="code" | 134 | icname="code" |
| 134 | - icnames="name" | ||
| 135 | - datatype="gzType"> | ||
| 136 | - </sa-Select3> | 135 | + dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" |
| 136 | + iterobjname="item" | ||
| 137 | + iterobjexp="item.name" | ||
| 138 | + searchph="请输拼音..." | ||
| 139 | + searchexp="this.name" | ||
| 140 | + > | ||
| 141 | + </sa-Select5> | ||
| 137 | </div> | 142 | </div> |
| 138 | </div> | 143 | </div> |
| 139 | 144 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html
| @@ -36,18 +36,18 @@ | @@ -36,18 +36,18 @@ | ||
| 36 | <div class="form-group has-success has-feedback"> | 36 | <div class="form-group has-success has-feedback"> |
| 37 | <label class="col-md-2 control-label">所属公司*:</label> | 37 | <label class="col-md-2 control-label">所属公司*:</label> |
| 38 | <div class="col-md-3"> | 38 | <div class="col-md-3"> |
| 39 | - <sa-Select3 model="ctrl.employeeInfoForSave" | ||
| 40 | - name="gs" | ||
| 41 | - placeholder="请选择所属公司..." | ||
| 42 | - dcvalue="{{ctrl.employeeInfoForSave.companyCode}}" | 39 | + <sa-Select5 name="gs" |
| 40 | + model="ctrl.employeeInfoForSave" | ||
| 41 | + cmaps="{'companyCode': 'code', 'company': 'name'}" | ||
| 43 | dcname="companyCode" | 42 | dcname="companyCode" |
| 44 | icname="code" | 43 | icname="code" |
| 45 | - dcname2="company" | ||
| 46 | - icname2="name" | ||
| 47 | - icnames="name" | ||
| 48 | - datatype="gsType" | 44 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 45 | + iterobjname="item" | ||
| 46 | + iterobjexp="item.name" | ||
| 47 | + searchph="请输拼音..." | ||
| 48 | + searchexp="this.name" | ||
| 49 | required > | 49 | required > |
| 50 | - </sa-Select3> | 50 | + </sa-Select5> |
| 51 | </div> | 51 | </div> |
| 52 | <!-- 隐藏块,显示验证信息 --> | 52 | <!-- 隐藏块,显示验证信息 --> |
| 53 | <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> | 53 | <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> |
| @@ -74,15 +74,17 @@ | @@ -74,15 +74,17 @@ | ||
| 74 | <div class="col-md-3"> | 74 | <div class="col-md-3"> |
| 75 | <input type="text" class="form-control" | 75 | <input type="text" class="form-control" |
| 76 | name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCode" | 76 | name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCode" |
| 77 | - remote-Validaton rvtype="jobCode" rv1="{{ctrl.employeeInfoForSave.companyCode}}" | ||
| 78 | - required placeholder="请输入工号"/> | 77 | + required placeholder="请输入工号" |
| 78 | + remote-Validation | ||
| 79 | + remotevtype="ee_gh" | ||
| 80 | + remotevparam="{{ {'companyCode_eq' : ctrl.employeeInfoForSave.companyCode, 'jobCode_eq': ctrl.employeeInfoForSave.jobCode} | json}}"/> | ||
| 79 | </div> | 81 | </div> |
| 80 | <!-- 隐藏块,显示验证信息 --> | 82 | <!-- 隐藏块,显示验证信息 --> |
| 81 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> | 83 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> |
| 82 | 工号必须填写 | 84 | 工号必须填写 |
| 83 | </div> | 85 | </div> |
| 84 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> | 86 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> |
| 85 | - 选择公司并且相同公司工号不能重复 | 87 | + {{$remote_msg}} |
| 86 | </div> | 88 | </div> |
| 87 | </div> | 89 | </div> |
| 88 | 90 | ||
| @@ -125,15 +127,18 @@ | @@ -125,15 +127,18 @@ | ||
| 125 | <div class="form-group"> | 127 | <div class="form-group"> |
| 126 | <label class="col-md-2 control-label">工种:</label> | 128 | <label class="col-md-2 control-label">工种:</label> |
| 127 | <div class="col-md-4"> | 129 | <div class="col-md-4"> |
| 128 | - <sa-Select3 model="ctrl.employeeInfoForSave" | ||
| 129 | - name="posts" | ||
| 130 | - placeholder="请选择工种..." | ||
| 131 | - dcvalue="{{ctrl.employeeInfoForSave.posts}}" | 130 | + <sa-Select5 name="posts" |
| 131 | + model="ctrl.employeeInfoForSave" | ||
| 132 | + cmaps="{'posts': 'code'}" | ||
| 132 | dcname="posts" | 133 | dcname="posts" |
| 133 | icname="code" | 134 | icname="code" |
| 134 | - icnames="name" | ||
| 135 | - datatype="gzType"> | ||
| 136 | - </sa-Select3> | 135 | + dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" |
| 136 | + iterobjname="item" | ||
| 137 | + iterobjexp="item.name" | ||
| 138 | + searchph="请输拼音..." | ||
| 139 | + searchexp="this.name" | ||
| 140 | + > | ||
| 141 | + </sa-Select5> | ||
| 137 | </div> | 142 | </div> |
| 138 | </div> | 143 | </div> |
| 139 | 144 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html
| @@ -26,41 +26,46 @@ | @@ -26,41 +26,46 @@ | ||
| 26 | </td> | 26 | </td> |
| 27 | <td> | 27 | <td> |
| 28 | <div> | 28 | <div> |
| 29 | - <sa-Select3 model="ctrl.searchCondition()" | ||
| 30 | - name="gs" | ||
| 31 | - placeholder="请选择..." | ||
| 32 | - dcvalue="{{ctrl.searchCondition().companyCode_eq}}" | 29 | + <sa-Select5 name="gs" |
| 30 | + model="ctrl.searchCondition()" | ||
| 31 | + cmaps="{'companyCode_eq': 'code'}" | ||
| 33 | dcname="companyCode_eq" | 32 | dcname="companyCode_eq" |
| 34 | icname="code" | 33 | icname="code" |
| 35 | - icnames="name" | ||
| 36 | - datatype="gsType"> | ||
| 37 | - </sa-Select3> | 34 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 35 | + iterobjname="item" | ||
| 36 | + iterobjexp="item.name" | ||
| 37 | + searchph="请输拼音..." | ||
| 38 | + searchexp="this.name" | ||
| 39 | + > | ||
| 40 | + </sa-Select5> | ||
| 38 | </div> | 41 | </div> |
| 39 | </td> | 42 | </td> |
| 40 | - <td style="width: 100px"> | ||
| 41 | - | 43 | + <td> |
| 42 | </td> | 44 | </td> |
| 43 | <td> | 45 | <td> |
| 44 | <div> | 46 | <div> |
| 45 | - <sa-Select3 model="ctrl.searchCondition()" | ||
| 46 | - name="gs" | ||
| 47 | - placeholder="请选择..." | ||
| 48 | - dcvalue="{{ctrl.searchCondition().posts_eq}}" | 47 | + <sa-Select5 name="gz" |
| 48 | + model="ctrl.searchCondition()" | ||
| 49 | + cmaps="{'posts_eq': 'code'}" | ||
| 49 | dcname="posts_eq" | 50 | dcname="posts_eq" |
| 50 | icname="code" | 51 | icname="code" |
| 51 | - icnames="name" | ||
| 52 | - datatype="gzType"> | ||
| 53 | - </sa-Select3> | 52 | + dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" |
| 53 | + iterobjname="item" | ||
| 54 | + iterobjexp="item.name" | ||
| 55 | + searchph="请输拼音..." | ||
| 56 | + searchexp="this.name" | ||
| 57 | + > | ||
| 58 | + </sa-Select5> | ||
| 54 | </div> | 59 | </div> |
| 55 | </td> | 60 | </td> |
| 56 | <td> | 61 | <td> |
| 57 | <div> | 62 | <div> |
| 58 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" | 63 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" |
| 59 | - ng-click="ctrl.pageChanaged()"> | 64 | + ng-click="ctrl.doPage()"> |
| 60 | <i class="fa fa-search"></i> 搜索</button> | 65 | <i class="fa fa-search"></i> 搜索</button> |
| 61 | 66 | ||
| 62 | <button class="btn btn-sm red btn-outline filter-cancel" | 67 | <button class="btn btn-sm red btn-outline filter-cancel" |
| 63 | - ng-click="ctrl.resetSearchCondition()"> | 68 | + ng-click="ctrl.reset()"> |
| 64 | <i class="fa fa-times"></i> 重置</button> | 69 | <i class="fa fa-times"></i> 重置</button> |
| 65 | </div> | 70 | </div> |
| 66 | 71 | ||
| @@ -69,7 +74,7 @@ | @@ -69,7 +74,7 @@ | ||
| 69 | </tr> | 74 | </tr> |
| 70 | </thead> | 75 | </thead> |
| 71 | <tbody> | 76 | <tbody> |
| 72 | - <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> | 77 | + <tr ng-repeat="info in ctrl.page()['content']" class="odd gradeX"> |
| 73 | <td> | 78 | <td> |
| 74 | <span ng-bind="$index + 1"></span> | 79 | <span ng-bind="$index + 1"></span> |
| 75 | </td> | 80 | </td> |
| @@ -104,9 +109,9 @@ | @@ -104,9 +109,9 @@ | ||
| 104 | 109 | ||
| 105 | 110 | ||
| 106 | <div style="text-align: right;"> | 111 | <div style="text-align: right;"> |
| 107 | - <uib-pagination total-items="ctrl.pageInfo.totalItems" | ||
| 108 | - ng-model="ctrl.pageInfo.currentPage" | ||
| 109 | - ng-change="ctrl.pageChanaged()" | 112 | + <uib-pagination total-items="ctrl.page()['totalElements']" |
| 113 | + ng-model="ctrl.page()['uiNumber']" | ||
| 114 | + ng-change="ctrl.doPage()" | ||
| 110 | rotate="false" | 115 | rotate="false" |
| 111 | max-size="10" | 116 | max-size="10" |
| 112 | boundary-links="true" | 117 | boundary-links="true" |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js
| 1 | // 人员信息管理 service controller等写在一起 | 1 | // 人员信息管理 service controller等写在一起 |
| 2 | 2 | ||
| 3 | -angular.module('ScheduleApp').factory('EmployeeInfoManageService', ['EmployeeInfoManageService_g', function(service) { | ||
| 4 | - | ||
| 5 | - /** 当前的查询条件信息 */ | ||
| 6 | - var currentSearchCondition = { | ||
| 7 | - //"carCode_like" : "", | ||
| 8 | - //"insideCode_like" : "", | ||
| 9 | - //"equipmentCode_like" : "", | ||
| 10 | - //"carPlate_like" : "" | ||
| 11 | - }; | 3 | +angular.module('ScheduleApp').factory( |
| 4 | + 'EmployeeInfoManageService', | ||
| 5 | + [ | ||
| 6 | + 'EmployeeInfoManageService_g', | ||
| 7 | + function(service) { | ||
| 12 | 8 | ||
| 13 | - /** 当前第几页 */ | ||
| 14 | - var currentPageNo = 1; | ||
| 15 | - | ||
| 16 | - return { | ||
| 17 | - /** | ||
| 18 | - * 获取查询条件信息, | ||
| 19 | - * 用于给controller用来和页面数据绑定。 | ||
| 20 | - */ | ||
| 21 | - getSearchCondition: function() { | ||
| 22 | - return currentSearchCondition; | ||
| 23 | - }, | ||
| 24 | - /** | ||
| 25 | - * 重置查询条件信息。 | ||
| 26 | - */ | ||
| 27 | - resetSearchCondition: function() { | ||
| 28 | - var key; | ||
| 29 | - for (key in currentSearchCondition) { | ||
| 30 | - currentSearchCondition[key] = undefined; | ||
| 31 | - } | ||
| 32 | - currentPageNo = 1; | ||
| 33 | - }, | ||
| 34 | - /** | ||
| 35 | - * 设置当前页码。 | ||
| 36 | - * @param cpn 从1开始,后台是从0开始的 | ||
| 37 | - */ | ||
| 38 | - setCurrentPageNo: function(cpn) { | ||
| 39 | - currentPageNo = cpn; | ||
| 40 | - }, | ||
| 41 | - /** | ||
| 42 | - * 组装查询参数,返回一个promise查询结果。 | ||
| 43 | - * @param params 查询参数 | ||
| 44 | - * @return 返回一个 promise | ||
| 45 | - */ | ||
| 46 | - getPage: function() { | ||
| 47 | - var params = currentSearchCondition; // 查询条件 | ||
| 48 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | ||
| 49 | - return service.rest.list(params).$promise; | ||
| 50 | - }, | ||
| 51 | - /** | ||
| 52 | - * 获取明细信息。 | ||
| 53 | - * @param id 车辆id | ||
| 54 | - * @return 返回一个 promise | ||
| 55 | - */ | ||
| 56 | - getDetail: function(id) { | ||
| 57 | - var params = {id: id}; | ||
| 58 | - return service.rest.get(params).$promise; | ||
| 59 | - }, | ||
| 60 | - /** | ||
| 61 | - * 保存信息。 | ||
| 62 | - * @param obj 车辆详细信息 | ||
| 63 | - * @return 返回一个 promise | ||
| 64 | - */ | ||
| 65 | - saveDetail: function(obj) { | ||
| 66 | - return service.rest.save(obj).$promise; | ||
| 67 | - }, | ||
| 68 | - /** | ||
| 69 | - * 数据导出。 | ||
| 70 | - * @returns {*|Function|promise|n} | ||
| 71 | - */ | ||
| 72 | - dataExport: function() { | ||
| 73 | - return service.dataTools.dataExport().$promise; | ||
| 74 | - } | ||
| 75 | - } | 9 | + /** 当前的查询条件信息 */ |
| 10 | + var currentSearchCondition = { | ||
| 11 | + //"carCode_like" : "", | ||
| 12 | + //"insideCode_like" : "", | ||
| 13 | + //"equipmentCode_like" : "", | ||
| 14 | + //"carPlate_like" : "" | ||
| 15 | + }; | ||
| 76 | 16 | ||
| 77 | -}]); | 17 | + // 当前查询返回的信息 |
| 18 | + var currentPage = { // 后台spring data返回的格式 | ||
| 19 | + totalElements: 0, | ||
| 20 | + number: 0, // 后台返回的页码,spring返回从0开始 | ||
| 21 | + content: [], | ||
| 78 | 22 | ||
| 79 | -angular.module('ScheduleApp').controller('EmployeeInfoManageCtrl', [ | ||
| 80 | - 'EmployeeInfoManageService', '$state', '$uibModal', 'FileDownload_g', | ||
| 81 | - function(employeeInfoManageService, $state, $uibModal, fileDownload) { | ||
| 82 | - var self = this; | 23 | + uiNumber: 1 // 页面绑定的页码 |
| 24 | + }; | ||
| 83 | 25 | ||
| 84 | - // 切换到form状态 | ||
| 85 | - self.goForm = function() { | ||
| 86 | - //alert("切换"); | ||
| 87 | - $state.go("employeeInfoManage_form"); | ||
| 88 | - } | 26 | + // 查询对象 |
| 27 | + var queryClass = service.rest; | ||
| 89 | 28 | ||
| 90 | - // 导入excel | ||
| 91 | - self.importData = function() { | ||
| 92 | - // large方式弹出模态对话框 | ||
| 93 | - var modalInstance = $uibModal.open({ | ||
| 94 | - templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/dataImport.html', | ||
| 95 | - size: "lg", | ||
| 96 | - animation: true, | ||
| 97 | - backdrop: 'static', | ||
| 98 | - resolve: { | ||
| 99 | - // 可以传值给controller | 29 | + return { |
| 30 | + getQueryClass: function() { | ||
| 31 | + return queryClass; | ||
| 100 | }, | 32 | }, |
| 101 | - windowClass: 'center-modal', | ||
| 102 | - controller: "EmployInfoManageToolsCtrl", | ||
| 103 | - controllerAs: "ctrl", | ||
| 104 | - bindToController: true | ||
| 105 | - }); | ||
| 106 | - modalInstance.result.then( | ||
| 107 | - function() { | ||
| 108 | - console.log("dataImport.html打开"); | 33 | + /** |
| 34 | + * 获取查询条件信息, | ||
| 35 | + * 用于给controller用来和页面数据绑定。 | ||
| 36 | + */ | ||
| 37 | + getSearchCondition: function() { | ||
| 38 | + currentSearchCondition.page = currentPage.uiNumber - 1; | ||
| 39 | + return currentSearchCondition; | ||
| 109 | }, | 40 | }, |
| 110 | - function() { | ||
| 111 | - console.log("dataImport.html消失"); | ||
| 112 | - } | ||
| 113 | - ); | ||
| 114 | - }; | ||
| 115 | - | ||
| 116 | - // 导出excel | ||
| 117 | - self.exportData = function() { | ||
| 118 | - employeeInfoManageService.dataExport().then( | ||
| 119 | - function(result) { | ||
| 120 | - fileDownload.downloadFile(result.data, "application/octet-stream", "人员基础信息.xls"); | 41 | + /** |
| 42 | + * 组装查询参数,返回一个promise查询结果。 | ||
| 43 | + * @param params 查询参数 | ||
| 44 | + * @return 返回一个 promise | ||
| 45 | + */ | ||
| 46 | + getPage: function(page) { | ||
| 47 | + if (page) { | ||
| 48 | + currentPage.totalElements = page.totalElements; | ||
| 49 | + currentPage.number = page.number; | ||
| 50 | + currentPage.content = page.content; | ||
| 51 | + } | ||
| 52 | + return currentPage; | ||
| 53 | + }, | ||
| 54 | + resetStatus: function() { | ||
| 55 | + currentSearchCondition = {page: 0}; | ||
| 56 | + currentPage = { | ||
| 57 | + totalElements: 0, | ||
| 58 | + number: 0, | ||
| 59 | + content: [], | ||
| 60 | + uiNumber: 1 | ||
| 61 | + }; | ||
| 121 | }, | 62 | }, |
| 122 | - function(result) { | ||
| 123 | - console.log("exportData failed:" + result); | 63 | + |
| 64 | + /** | ||
| 65 | + * 数据导出。 | ||
| 66 | + * @returns {*|Function|promise|n} | ||
| 67 | + */ | ||
| 68 | + dataExport: function() { | ||
| 69 | + return service.dataTools.dataExport().$promise; | ||
| 124 | } | 70 | } |
| 125 | - ); | ||
| 126 | - }; | ||
| 127 | - }]); | 71 | + } |
| 72 | + } | ||
| 73 | + ] | ||
| 74 | +); | ||
| 75 | + | ||
| 76 | +// index.html控制器 | ||
| 77 | +angular.module('ScheduleApp').controller( | ||
| 78 | + 'EmployeeInfoManageCtrl', | ||
| 79 | + [ | ||
| 80 | + 'EmployeeInfoManageService', | ||
| 81 | + '$state', | ||
| 82 | + '$uibModal', | ||
| 83 | + 'FileDownload_g', | ||
| 84 | + function(employeeInfoManageService, $state, $uibModal, fileDownload) { | ||
| 85 | + var self = this; | ||
| 86 | + | ||
| 87 | + // 切换到form状态 | ||
| 88 | + self.goForm = function() { | ||
| 89 | + //alert("切换"); | ||
| 90 | + $state.go("employeeInfoManage_form"); | ||
| 91 | + }; | ||
| 92 | + | ||
| 93 | + // 导入excel | ||
| 94 | + self.importData = function() { | ||
| 95 | + // large方式弹出模态对话框 | ||
| 96 | + var modalInstance = $uibModal.open({ | ||
| 97 | + templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/dataImport.html', | ||
| 98 | + size: "lg", | ||
| 99 | + animation: true, | ||
| 100 | + backdrop: 'static', | ||
| 101 | + resolve: { | ||
| 102 | + // 可以传值给controller | ||
| 103 | + }, | ||
| 104 | + windowClass: 'center-modal', | ||
| 105 | + controller: "EmployInfoManageToolsCtrl", | ||
| 106 | + controllerAs: "ctrl", | ||
| 107 | + bindToController: true | ||
| 108 | + }); | ||
| 109 | + modalInstance.result.then( | ||
| 110 | + function() { | ||
| 111 | + console.log("dataImport.html打开"); | ||
| 112 | + }, | ||
| 113 | + function() { | ||
| 114 | + console.log("dataImport.html消失"); | ||
| 115 | + } | ||
| 116 | + ); | ||
| 117 | + }; | ||
| 118 | + | ||
| 119 | + // 导出excel | ||
| 120 | + self.exportData = function() { | ||
| 121 | + employeeInfoManageService.dataExport().then( | ||
| 122 | + function(result) { | ||
| 123 | + fileDownload.downloadFile(result.data, "application/octet-stream", "人员基础信息.xls"); | ||
| 124 | + }, | ||
| 125 | + function(result) { | ||
| 126 | + console.log("exportData failed:" + result); | ||
| 127 | + } | ||
| 128 | + ); | ||
| 129 | + }; | ||
| 130 | + | ||
| 131 | + } | ||
| 132 | + ] | ||
| 133 | +); | ||
| 128 | 134 | ||
| 129 | angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | 135 | angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { |
| 130 | var self = this; | 136 | var self = this; |
| @@ -161,124 +167,101 @@ angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalIn | @@ -161,124 +167,101 @@ angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalIn | ||
| 161 | 167 | ||
| 162 | }]); | 168 | }]); |
| 163 | 169 | ||
| 164 | -angular.module('ScheduleApp').controller('EmployeeInfoManageListCtrl', ['EmployeeInfoManageService', function(employeeInfoManageService) { | ||
| 165 | - var self = this; | ||
| 166 | - self.pageInfo = { | ||
| 167 | - totalItems : 0, | ||
| 168 | - currentPage : 1, | ||
| 169 | - infos: [] | ||
| 170 | - }; | 170 | +// list.html控制器 |
| 171 | +angular.module('ScheduleApp').controller( | ||
| 172 | + 'EmployeeInfoManageListCtrl', | ||
| 173 | + [ | ||
| 174 | + 'EmployeeInfoManageService', | ||
| 175 | + function(service) { | ||
| 176 | + var self = this; | ||
| 177 | + var Employee = service.getQueryClass(); | ||
| 178 | + | ||
| 179 | + self.page = function() { | ||
| 180 | + return service.getPage(); | ||
| 181 | + }; | ||
| 182 | + | ||
| 183 | + self.searchCondition = function() { | ||
| 184 | + return service.getSearchCondition(); | ||
| 185 | + }; | ||
| 186 | + | ||
| 187 | + self.doPage = function() { | ||
| 188 | + var result = Employee.list(self.searchCondition(), function() { | ||
| 189 | + if (!result.status) { | ||
| 190 | + service.getPage(result); | ||
| 191 | + } | ||
| 192 | + }); | ||
| 193 | + }; | ||
| 194 | + self.reset = function() { | ||
| 195 | + service.resetStatus(); | ||
| 196 | + var result = Employee.list(self.searchCondition(), function() { | ||
| 197 | + if (!result.status) { | ||
| 198 | + service.getPage(result); | ||
| 199 | + } | ||
| 200 | + }); | ||
| 201 | + }; | ||
| 202 | + | ||
| 203 | + self.doPage(); | ||
| 171 | 204 | ||
| 172 | - // 初始创建的时候,获取一次列表数据 | ||
| 173 | - employeeInfoManageService.getPage().then( | ||
| 174 | - function(result) { | ||
| 175 | - self.pageInfo.totalItems = result.totalElements; | ||
| 176 | - self.pageInfo.currentPage = result.number + 1; | ||
| 177 | - self.pageInfo.infos = result.content; | ||
| 178 | - employeeInfoManageService.setCurrentPageNo(result.number + 1); | ||
| 179 | - }, | ||
| 180 | - function(result) { | ||
| 181 | - alert("出错啦!"); | ||
| 182 | } | 205 | } |
| 183 | - ); | ||
| 184 | - | ||
| 185 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | ||
| 186 | - // alert("dfdfdf"); | ||
| 187 | - //}); | ||
| 188 | - | ||
| 189 | - // 翻页的时候调用 | ||
| 190 | - self.pageChanaged = function() { | ||
| 191 | - employeeInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | ||
| 192 | - employeeInfoManageService.getPage().then( | ||
| 193 | - function(result) { | ||
| 194 | - self.pageInfo.totalItems = result.totalElements; | ||
| 195 | - self.pageInfo.currentPage = result.number + 1; | ||
| 196 | - self.pageInfo.infos = result.content; | ||
| 197 | - employeeInfoManageService.setCurrentPageNo(result.number + 1); | ||
| 198 | - }, | ||
| 199 | - function(result) { | ||
| 200 | - alert("出错啦!"); | ||
| 201 | - } | ||
| 202 | - ); | ||
| 203 | - }; | ||
| 204 | - // 获取查询条件数据 | ||
| 205 | - self.searchCondition = function() { | ||
| 206 | - return employeeInfoManageService.getSearchCondition(); | ||
| 207 | - }; | ||
| 208 | - // 重置查询条件 | ||
| 209 | - self.resetSearchCondition = function() { | ||
| 210 | - employeeInfoManageService.resetSearchCondition(); | ||
| 211 | - self.pageInfo.currentPage = 1; | ||
| 212 | - self.pageChanaged(); | ||
| 213 | - }; | ||
| 214 | -}]); | 206 | + ] |
| 207 | +); | ||
| 215 | 208 | ||
| 216 | -angular.module('ScheduleApp').controller('EmployeeInfoManageFormCtrl', ['EmployeeInfoManageService', '$stateParams', '$state', function(employeeInfoManageService, $stateParams, $state) { | ||
| 217 | - var self = this; | 209 | +// form.html控制器 |
| 210 | +angular.module('ScheduleApp').controller( | ||
| 211 | + 'EmployeeInfoManageFormCtrl', | ||
| 212 | + [ | ||
| 213 | + 'EmployeeInfoManageService', | ||
| 214 | + '$stateParams', | ||
| 215 | + '$state', | ||
| 216 | + function(service, $stateParams, $state) { | ||
| 217 | + var self = this; | ||
| 218 | + var Employee = service.getQueryClass(); | ||
| 218 | 219 | ||
| 219 | - // 欲保存的busInfo信息,绑定 | ||
| 220 | - self.employeeInfoForSave = {}; | ||
| 221 | - | ||
| 222 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 223 | - var id = $stateParams.id; | ||
| 224 | - if (id) { | ||
| 225 | - self.employeeInfoForSave.id = id; | ||
| 226 | - employeeInfoManageService.getDetail(id).then( | ||
| 227 | - function(result) { | ||
| 228 | - var key; | ||
| 229 | - for (key in result) { | ||
| 230 | - self.employeeInfoForSave[key] = result[key]; | ||
| 231 | - } | ||
| 232 | - }, | ||
| 233 | - function(result) { | ||
| 234 | - alert("出错啦!"); | 220 | + // 欲保存的busInfo信息,绑定 |
| 221 | + self.employeeInfoForSave = new Employee; | ||
| 222 | + | ||
| 223 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 224 | + var id = $stateParams.id; | ||
| 225 | + if (id) { | ||
| 226 | + self.employeeInfoForSave = Employee.get({id: id}, function() {}); | ||
| 235 | } | 227 | } |
| 236 | - ); | ||
| 237 | - } | ||
| 238 | - | ||
| 239 | - // 提交方法 | ||
| 240 | - self.submit = function() { | ||
| 241 | - console.log(self.employeeInfoForSave); | ||
| 242 | - employeeInfoManageService.saveDetail(self.employeeInfoForSave).then( | ||
| 243 | - function(result) { | ||
| 244 | - // TODO:弹出框方式以后改 | ||
| 245 | - if (result.status == 'SUCCESS') { | ||
| 246 | - alert("保存成功!"); | 228 | + |
| 229 | + // 提交方法 | ||
| 230 | + self.submit = function() { | ||
| 231 | + console.log(self.employeeInfoForSave); | ||
| 232 | + | ||
| 233 | + // 保存或更新 | ||
| 234 | + self.employeeInfoForSave.$save(function() { | ||
| 247 | $state.go("employeeInfoManage"); | 235 | $state.go("employeeInfoManage"); |
| 248 | - } else { | ||
| 249 | - alert("保存异常!"); | ||
| 250 | - } | ||
| 251 | - }, | ||
| 252 | - function(result) { | ||
| 253 | - // TODO:弹出框方式以后改 | ||
| 254 | - alert("出错啦!"); | ||
| 255 | - } | ||
| 256 | - ); | ||
| 257 | - }; | 236 | + }); |
| 237 | + }; | ||
| 258 | 238 | ||
| 239 | + } | ||
| 240 | + ] | ||
| 241 | +); | ||
| 259 | 242 | ||
| 260 | -}]); | 243 | +// detail.html控制器 |
| 244 | +angular.module('ScheduleApp').controller( | ||
| 245 | + 'EmployeeInfoManageDetailCtrl', | ||
| 246 | + [ | ||
| 247 | + 'EmployeeInfoManageService', | ||
| 248 | + '$stateParams', | ||
| 249 | + function(service, $stateParams) { | ||
| 250 | + var self = this; | ||
| 251 | + var Employee = service.getQueryClass(); | ||
| 252 | + var id = $stateParams.id; | ||
| 261 | 253 | ||
| 262 | -angular.module('ScheduleApp').controller('EmployeeInfoManageDetailCtrl', ['EmployeeInfoManageService', '$stateParams', function(employeeInfoManageService, $stateParams) { | ||
| 263 | - var self = this; | ||
| 264 | - self.title = ""; | ||
| 265 | - self.employeeInfoForDetail = {}; | ||
| 266 | - self.employeeInfoForDetail.id = $stateParams.id; | ||
| 267 | - | ||
| 268 | - // 当转向到此页面时,就获取明细信息并绑定 | ||
| 269 | - employeeInfoManageService.getDetail($stateParams.id).then( | ||
| 270 | - function(result) { | ||
| 271 | - var key; | ||
| 272 | - for (key in result) { | ||
| 273 | - self.employeeInfoForDetail[key] = result[key]; | ||
| 274 | - } | 254 | + self.title = ""; |
| 255 | + self.employeeInfoForDetail = {}; | ||
| 256 | + | ||
| 257 | + // 当转向到此页面时,就获取明细信息并绑定 | ||
| 258 | + self.employeeInfoForDetail = Employee.get({id: id}, function() { | ||
| 259 | + self.title = "员工 " + | ||
| 260 | + self.employeeInfoForDetail.personnelName + | ||
| 261 | + " 详细信息"; | ||
| 262 | + }); | ||
| 275 | 263 | ||
| 276 | - self.title = "员工 " + self.employeeInfoForDetail.personnelName + " 详细信息"; | ||
| 277 | - }, | ||
| 278 | - function(result) { | ||
| 279 | - // TODO:弹出框方式以后改 | ||
| 280 | - alert("出错啦!"); | ||
| 281 | } | 264 | } |
| 282 | - ); | ||
| 283 | -}]); | 265 | + ] |
| 266 | +); | ||
| 284 | 267 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/service.js
| 1 | // 人员信息service | 1 | // 人员信息service |
| 2 | -angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) { | ||
| 3 | - return { | ||
| 4 | - rest : $resource( | ||
| 5 | - '/personnel/:id', | ||
| 6 | - {order: 'jobCode', direction: 'ASC', id: '@id_route'}, | ||
| 7 | - { | ||
| 8 | - list: { | ||
| 9 | - method: 'GET', | ||
| 10 | - params: { | ||
| 11 | - page: 0 | 2 | +angular.module('ScheduleApp').factory( |
| 3 | + 'EmployeeInfoManageService_g', | ||
| 4 | + [ | ||
| 5 | + '$resource', | ||
| 6 | + function($resource) { | ||
| 7 | + return { | ||
| 8 | + rest : $resource( | ||
| 9 | + '/ee/:id', | ||
| 10 | + {order: 'jobCode', direction: 'ASC', id: '@id'}, | ||
| 11 | + { | ||
| 12 | + list: { | ||
| 13 | + method: 'GET', | ||
| 14 | + params: { | ||
| 15 | + page: 0 | ||
| 16 | + }, | ||
| 17 | + transformResponse: function(rs) { | ||
| 18 | + var dst = angular.fromJson(rs); | ||
| 19 | + if (dst.status == 'SUCCESS') { | ||
| 20 | + return dst.data; | ||
| 21 | + } else { | ||
| 22 | + return dst; // 业务错误留给控制器处理 | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + }, | ||
| 26 | + get: { | ||
| 27 | + method: 'GET', | ||
| 28 | + transformResponse: function(rs) { | ||
| 29 | + var dst = angular.fromJson(rs); | ||
| 30 | + if (dst.status == 'SUCCESS') { | ||
| 31 | + return dst.data; | ||
| 32 | + } else { | ||
| 33 | + return dst; | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + save: { | ||
| 38 | + method: 'POST' | ||
| 39 | + } | ||
| 12 | } | 40 | } |
| 13 | - }, | ||
| 14 | - get: { | ||
| 15 | - method: 'GET' | ||
| 16 | - }, | ||
| 17 | - save: { | ||
| 18 | - method: 'POST' | ||
| 19 | - } | ||
| 20 | - } | ||
| 21 | - ), | ||
| 22 | - validate: $resource( | ||
| 23 | - '/personnel/validate/:type', | ||
| 24 | - {}, | ||
| 25 | - { | ||
| 26 | - jobCode: { | ||
| 27 | - method: 'GET' | ||
| 28 | - } | ||
| 29 | - } | ||
| 30 | - ), | ||
| 31 | - dataTools: $resource( | ||
| 32 | - '/personnel/:type', | ||
| 33 | - {}, | ||
| 34 | - { | ||
| 35 | - dataExport: { | ||
| 36 | - method: 'GET', | ||
| 37 | - responseType: "arraybuffer", | ||
| 38 | - params: { | ||
| 39 | - type: "dataExport" | ||
| 40 | - }, | ||
| 41 | - transformResponse: function(data, headers){ | ||
| 42 | - return {data : data}; | 41 | + ), |
| 42 | + | ||
| 43 | + dataTools: $resource( | ||
| 44 | + '/personnel/:type', | ||
| 45 | + {}, | ||
| 46 | + { | ||
| 47 | + dataExport: { | ||
| 48 | + method: 'GET', | ||
| 49 | + responseType: "arraybuffer", | ||
| 50 | + params: { | ||
| 51 | + type: "dataExport" | ||
| 52 | + }, | ||
| 53 | + transformResponse: function(data, headers){ | ||
| 54 | + return {data : data}; | ||
| 55 | + } | ||
| 56 | + } | ||
| 43 | } | 57 | } |
| 44 | - } | ||
| 45 | - } | ||
| 46 | - ) | ||
| 47 | - }; | ||
| 48 | -}]); | 58 | + ) |
| 59 | + }; | ||
| 60 | + | ||
| 61 | + } | ||
| 62 | + ] | ||
| 63 | +); |
src/main/resources/static/pages/scheduleApp/module/common/dts1/select/saSelect5.js
| @@ -109,6 +109,10 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -109,6 +109,10 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 109 | // dom,span ng-bind属性设置,TODO:暂时无法用transclude设置,先用属性设置 | 109 | // dom,span ng-bind属性设置,TODO:暂时无法用transclude设置,先用属性设置 |
| 110 | tElem.find("ui-select-choices").html("{{" + $iterobjexp_attr + "}}"); | 110 | tElem.find("ui-select-choices").html("{{" + $iterobjexp_attr + "}}"); |
| 111 | 111 | ||
| 112 | + | ||
| 113 | + // 当前的数据模式,ajax,dic,local | ||
| 114 | + var dataModelType = undefined; | ||
| 115 | + | ||
| 112 | return { | 116 | return { |
| 113 | pre: function (scope, element, attr) { | 117 | pre: function (scope, element, attr) { |
| 114 | // TODO: | 118 | // TODO: |
| @@ -167,17 +171,19 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -167,17 +171,19 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 167 | // 处理search | 171 | // 处理search |
| 168 | console.log("search:" + search); | 172 | console.log("search:" + search); |
| 169 | 173 | ||
| 170 | - scope[ctrlAs].$$data = []; | ||
| 171 | - for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) { | ||
| 172 | - var upTerm = search.toUpperCase(); | ||
| 173 | - if (scope[ctrlAs].$$data.length < 10) { | ||
| 174 | - if (scope[ctrlAs].$$data_real[k].$fullChars.indexOf(upTerm) != -1 | ||
| 175 | - || scope[ctrlAs].$$data_real[k].$camelChars.indexOf(upTerm) != -1 | ||
| 176 | - || scope[ctrlAs].$$data_real[k].$calcu_str.indexOf(upTerm) != -1) { | ||
| 177 | - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k])); | 174 | + if (dataModelType == 'ajax') { |
| 175 | + scope[ctrlAs].$$data = []; | ||
| 176 | + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) { | ||
| 177 | + var upTerm = search.toUpperCase(); | ||
| 178 | + if (scope[ctrlAs].$$data.length < 10) { | ||
| 179 | + if (scope[ctrlAs].$$data_real[k].$fullChars.indexOf(upTerm) != -1 | ||
| 180 | + || scope[ctrlAs].$$data_real[k].$camelChars.indexOf(upTerm) != -1 | ||
| 181 | + || scope[ctrlAs].$$data_real[k].$calcu_str.indexOf(upTerm) != -1) { | ||
| 182 | + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k])); | ||
| 183 | + } | ||
| 184 | + } else { | ||
| 185 | + break; | ||
| 178 | } | 186 | } |
| 179 | - } else { | ||
| 180 | - break; | ||
| 181 | } | 187 | } |
| 182 | } | 188 | } |
| 183 | } | 189 | } |
| @@ -327,16 +333,18 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -327,16 +333,18 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 327 | 333 | ||
| 328 | // 重新创建内部保存的数据 | 334 | // 重新创建内部保存的数据 |
| 329 | scope[ctrlAs].$$data_real = []; | 335 | scope[ctrlAs].$$data_real = []; |
| 330 | - var origin_dicgroup = dictionaryUtils.getByGroup(dicgroup); | 336 | + var origin_dicgroup = dictionaryUtils.getByGroup(dictype); |
| 331 | var dic_key; // 字典key | 337 | var dic_key; // 字典key |
| 332 | 338 | ||
| 339 | + //console.log(origin_dicgroup); | ||
| 340 | + | ||
| 333 | for (dic_key in origin_dicgroup) { | 341 | for (dic_key in origin_dicgroup) { |
| 334 | var data = {}; // 重新组合的字典元素对象 | 342 | var data = {}; // 重新组合的字典元素对象 |
| 335 | if (dic_key == "true") | 343 | if (dic_key == "true") |
| 336 | data[$icname_attr] = true; | 344 | data[$icname_attr] = true; |
| 337 | else | 345 | else |
| 338 | data[$icname_attr] = dic_key; | 346 | data[$icname_attr] = dic_key; |
| 339 | - data[$dscol_attr] = origin_dicgroup[dic_key]; | 347 | + data['name'] = origin_dicgroup[dic_key]; // 字典写死name这个key名字 |
| 340 | scope[ctrlAs].$$data_real.push(data); | 348 | scope[ctrlAs].$$data_real.push(data); |
| 341 | } | 349 | } |
| 342 | 350 | ||
| @@ -380,11 +388,14 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -380,11 +388,14 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 380 | // {type: 'dic/ajax', param: 'dic名字'/'ajax查询参数对象', atype: 'ajax查询类型'} | 388 | // {type: 'dic/ajax', param: 'dic名字'/'ajax查询参数对象', atype: 'ajax查询类型'} |
| 381 | 389 | ||
| 382 | if (obj.type == 'dic') { | 390 | if (obj.type == 'dic') { |
| 391 | + dataModelType = 'dic'; | ||
| 383 | scope[ctrlAs].$$internal_dic_data(obj.param); | 392 | scope[ctrlAs].$$internal_dic_data(obj.param); |
| 384 | 393 | ||
| 385 | } else if (obj.type == 'ajax') { | 394 | } else if (obj.type == 'ajax') { |
| 395 | + dataModelType = 'ajax'; | ||
| 386 | scope[ctrlAs].$$internal_ajax_data(obj.atype, obj.param); | 396 | scope[ctrlAs].$$internal_ajax_data(obj.atype, obj.param); |
| 387 | } else if (obj.type == 'local') { | 397 | } else if (obj.type == 'local') { |
| 398 | + dataModelType = 'local'; | ||
| 388 | scope[ctrlAs].$$internal_local_data(obj.ldata); | 399 | scope[ctrlAs].$$internal_local_data(obj.ldata); |
| 389 | } else { | 400 | } else { |
| 390 | throw new Error("dsparams参数格式异常=" + obj); | 401 | throw new Error("dsparams参数格式异常=" + obj); |
src/main/resources/static/pages/scheduleApp/module/common/main.js
| @@ -104,18 +104,17 @@ ScheduleApp.factory( | @@ -104,18 +104,17 @@ ScheduleApp.factory( | ||
| 104 | // 如:{"timestamp":1478674739246,"status":500,"error":"Internal Server Error","exception":"java.lang.ClassCastException","message":"java.lang.String cannot be cast to java.lang.Long","path":"/tidc/importfile"} | 104 | // 如:{"timestamp":1478674739246,"status":500,"error":"Internal Server Error","exception":"java.lang.ClassCastException","message":"java.lang.String cannot be cast to java.lang.Long","path":"/tidc/importfile"} |
| 105 | 105 | ||
| 106 | var output = []; | 106 | var output = []; |
| 107 | - if (!status) { | 107 | + if (!rejection.status) { |
| 108 | alert("我擦,后台返回连个状态码都没返回,见鬼了,服务器可能重启了"); | 108 | alert("我擦,后台返回连个状态码都没返回,见鬼了,服务器可能重启了"); |
| 109 | - } else if (status == -1) { | 109 | + } else if (rejection.status == -1) { |
| 110 | // 服务器断开了 | 110 | // 服务器断开了 |
| 111 | alert("貌似服务端连接不上"); | 111 | alert("貌似服务端连接不上"); |
| 112 | } else { | 112 | } else { |
| 113 | - output.push("状态编码:" + status); | ||
| 114 | - output.push("访问路径:" + rejection.path); | ||
| 115 | - output.push("错误消息:" + rejection.message); | ||
| 116 | - if (status == 500) { | 113 | + output.push("状态编码:" + rejection.status); |
| 114 | + output.push("错误内容:" + angular.toJson(rejection.data)); | ||
| 115 | + if (rejection.status == 500) { | ||
| 117 | alert("服务端错误:" + "\n" + output.join("\n")); | 116 | alert("服务端错误:" + "\n" + output.join("\n")); |
| 118 | - } else if (status == 407) { | 117 | + } else if (rejection.status == 407) { |
| 119 | alert("请重新登录:" + "\n" + output.join("\n")); | 118 | alert("请重新登录:" + "\n" + output.join("\n")); |
| 120 | } else { | 119 | } else { |
| 121 | alert("其他错误:" + "\n" + output.join("\n")); | 120 | alert("其他错误:" + "\n" + output.join("\n")); |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
| @@ -59,7 +59,7 @@ angular.module('ScheduleApp').directive('remoteValidation', [ | @@ -59,7 +59,7 @@ angular.module('ScheduleApp').directive('remoteValidation', [ | ||
| 59 | // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证 | 59 | // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证 |
| 60 | var isParamAll = true; | 60 | var isParamAll = true; |
| 61 | for (var key in paramTemplate) { | 61 | for (var key in paramTemplate) { |
| 62 | - if (!$watch_rvparam_obj[key]) { | 62 | + if (key != "id" && !$watch_rvparam_obj[key]) { // id去掉 |
| 63 | isParamAll = false; | 63 | isParamAll = false; |
| 64 | break; | 64 | break; |
| 65 | } | 65 | } |
| @@ -1385,6 +1385,10 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -1385,6 +1385,10 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 1385 | // dom,span ng-bind属性设置,TODO:暂时无法用transclude设置,先用属性设置 | 1385 | // dom,span ng-bind属性设置,TODO:暂时无法用transclude设置,先用属性设置 |
| 1386 | tElem.find("ui-select-choices").html("{{" + $iterobjexp_attr + "}}"); | 1386 | tElem.find("ui-select-choices").html("{{" + $iterobjexp_attr + "}}"); |
| 1387 | 1387 | ||
| 1388 | + | ||
| 1389 | + // 当前的数据模式,ajax,dic,local | ||
| 1390 | + var dataModelType = undefined; | ||
| 1391 | + | ||
| 1388 | return { | 1392 | return { |
| 1389 | pre: function (scope, element, attr) { | 1393 | pre: function (scope, element, attr) { |
| 1390 | // TODO: | 1394 | // TODO: |
| @@ -1443,17 +1447,19 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -1443,17 +1447,19 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 1443 | // 处理search | 1447 | // 处理search |
| 1444 | console.log("search:" + search); | 1448 | console.log("search:" + search); |
| 1445 | 1449 | ||
| 1446 | - scope[ctrlAs].$$data = []; | ||
| 1447 | - for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) { | ||
| 1448 | - var upTerm = search.toUpperCase(); | ||
| 1449 | - if (scope[ctrlAs].$$data.length < 10) { | ||
| 1450 | - if (scope[ctrlAs].$$data_real[k].$fullChars.indexOf(upTerm) != -1 | ||
| 1451 | - || scope[ctrlAs].$$data_real[k].$camelChars.indexOf(upTerm) != -1 | ||
| 1452 | - || scope[ctrlAs].$$data_real[k].$calcu_str.indexOf(upTerm) != -1) { | ||
| 1453 | - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k])); | 1450 | + if (dataModelType == 'ajax') { |
| 1451 | + scope[ctrlAs].$$data = []; | ||
| 1452 | + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) { | ||
| 1453 | + var upTerm = search.toUpperCase(); | ||
| 1454 | + if (scope[ctrlAs].$$data.length < 10) { | ||
| 1455 | + if (scope[ctrlAs].$$data_real[k].$fullChars.indexOf(upTerm) != -1 | ||
| 1456 | + || scope[ctrlAs].$$data_real[k].$camelChars.indexOf(upTerm) != -1 | ||
| 1457 | + || scope[ctrlAs].$$data_real[k].$calcu_str.indexOf(upTerm) != -1) { | ||
| 1458 | + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k])); | ||
| 1459 | + } | ||
| 1460 | + } else { | ||
| 1461 | + break; | ||
| 1454 | } | 1462 | } |
| 1455 | - } else { | ||
| 1456 | - break; | ||
| 1457 | } | 1463 | } |
| 1458 | } | 1464 | } |
| 1459 | } | 1465 | } |
| @@ -1603,16 +1609,18 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -1603,16 +1609,18 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 1603 | 1609 | ||
| 1604 | // 重新创建内部保存的数据 | 1610 | // 重新创建内部保存的数据 |
| 1605 | scope[ctrlAs].$$data_real = []; | 1611 | scope[ctrlAs].$$data_real = []; |
| 1606 | - var origin_dicgroup = dictionaryUtils.getByGroup(dicgroup); | 1612 | + var origin_dicgroup = dictionaryUtils.getByGroup(dictype); |
| 1607 | var dic_key; // 字典key | 1613 | var dic_key; // 字典key |
| 1608 | 1614 | ||
| 1615 | + //console.log(origin_dicgroup); | ||
| 1616 | + | ||
| 1609 | for (dic_key in origin_dicgroup) { | 1617 | for (dic_key in origin_dicgroup) { |
| 1610 | var data = {}; // 重新组合的字典元素对象 | 1618 | var data = {}; // 重新组合的字典元素对象 |
| 1611 | if (dic_key == "true") | 1619 | if (dic_key == "true") |
| 1612 | data[$icname_attr] = true; | 1620 | data[$icname_attr] = true; |
| 1613 | else | 1621 | else |
| 1614 | data[$icname_attr] = dic_key; | 1622 | data[$icname_attr] = dic_key; |
| 1615 | - data[$dscol_attr] = origin_dicgroup[dic_key]; | 1623 | + data['name'] = origin_dicgroup[dic_key]; // 字典写死name这个key名字 |
| 1616 | scope[ctrlAs].$$data_real.push(data); | 1624 | scope[ctrlAs].$$data_real.push(data); |
| 1617 | } | 1625 | } |
| 1618 | 1626 | ||
| @@ -1656,11 +1664,14 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -1656,11 +1664,14 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 1656 | // {type: 'dic/ajax', param: 'dic名字'/'ajax查询参数对象', atype: 'ajax查询类型'} | 1664 | // {type: 'dic/ajax', param: 'dic名字'/'ajax查询参数对象', atype: 'ajax查询类型'} |
| 1657 | 1665 | ||
| 1658 | if (obj.type == 'dic') { | 1666 | if (obj.type == 'dic') { |
| 1667 | + dataModelType = 'dic'; | ||
| 1659 | scope[ctrlAs].$$internal_dic_data(obj.param); | 1668 | scope[ctrlAs].$$internal_dic_data(obj.param); |
| 1660 | 1669 | ||
| 1661 | } else if (obj.type == 'ajax') { | 1670 | } else if (obj.type == 'ajax') { |
| 1671 | + dataModelType = 'ajax'; | ||
| 1662 | scope[ctrlAs].$$internal_ajax_data(obj.atype, obj.param); | 1672 | scope[ctrlAs].$$internal_ajax_data(obj.atype, obj.param); |
| 1663 | } else if (obj.type == 'local') { | 1673 | } else if (obj.type == 'local') { |
| 1674 | + dataModelType = 'local'; | ||
| 1664 | scope[ctrlAs].$$internal_local_data(obj.ldata); | 1675 | scope[ctrlAs].$$internal_local_data(obj.ldata); |
| 1665 | } else { | 1676 | } else { |
| 1666 | throw new Error("dsparams参数格式异常=" + obj); | 1677 | throw new Error("dsparams参数格式异常=" + obj); |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
| @@ -263,7 +263,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -263,7 +263,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 263 | gbv1: { // 路牌序号验证 | 263 | gbv1: { // 路牌序号验证 |
| 264 | template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'}, | 264 | template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'}, |
| 265 | remote: $resource( | 265 | remote: $resource( |
| 266 | - '/gic/validate1', | 266 | + '/gic/validate_lpno', |
| 267 | {}, | 267 | {}, |
| 268 | { | 268 | { |
| 269 | do: { | 269 | do: { |
| @@ -275,7 +275,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -275,7 +275,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 275 | gbv2: { // 路牌名称验证 | 275 | gbv2: { // 路牌名称验证 |
| 276 | template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'}, | 276 | template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'}, |
| 277 | remote: $resource( | 277 | remote: $resource( |
| 278 | - '/gic/validate2', | 278 | + '/gic/validate_lpname', |
| 279 | {}, | 279 | {}, |
| 280 | { | 280 | { |
| 281 | do: { | 281 | do: { |
| @@ -336,6 +336,20 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -336,6 +336,20 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 336 | } | 336 | } |
| 337 | ) | 337 | ) |
| 338 | }, | 338 | }, |
| 339 | + | ||
| 340 | + ee_gh: { // 工号不能重复 | ||
| 341 | + template: {'companyCode_eq': '-1', 'jobCode_eq': '-1'}, // 查询参数模版 | ||
| 342 | + remote: $resource( // $resource封装对象 | ||
| 343 | + '/ee/validate_gh', | ||
| 344 | + {}, | ||
| 345 | + { | ||
| 346 | + do: { | ||
| 347 | + method: 'GET' | ||
| 348 | + } | ||
| 349 | + } | ||
| 350 | + ) | ||
| 351 | + }, | ||
| 352 | + | ||
| 339 | cc_cars: { // 车辆不能重复配置 | 353 | cc_cars: { // 车辆不能重复配置 |
| 340 | template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 | 354 | template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 |
| 341 | remote: $resource( // $resource封装对象 | 355 | remote: $resource( // $resource封装对象 |
| @@ -374,9 +388,9 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -374,9 +388,9 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 374 | }, | 388 | }, |
| 375 | 389 | ||
| 376 | cde1: { // 车辆设备启用日期验证 | 390 | cde1: { // 车辆设备启用日期验证 |
| 377 | - template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒 | 391 | + template: {'xl_eq': -1, 'cl_eq': -1, 'qyrq_eq': 1}, // 日期毫秒 |
| 378 | remote: $resource( // $resource封装对象 | 392 | remote: $resource( // $resource封装对象 |
| 379 | - '/cde//validate/qyrq', | 393 | + '/cde_sc/validate_qyrq', |
| 380 | {}, | 394 | {}, |
| 381 | { | 395 | { |
| 382 | do: { | 396 | do: { |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| 1 | //所有模块service配置 | 1 | //所有模块service配置 |
| 2 | // 车辆信息service | 2 | // 车辆信息service |
| 3 | -angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) { | 3 | +angular.module('ScheduleApp').factory( |
| 4 | + 'BusInfoManageService_g', | ||
| 5 | + [ | ||
| 6 | + '$resource', | ||
| 7 | + function($resource) { | ||
| 8 | + return { | ||
| 9 | + rest: $resource( | ||
| 10 | + '/cars_sc/:id', | ||
| 11 | + {order: 'carCode', direction: 'ASC', id: '@id'}, | ||
| 12 | + { | ||
| 13 | + list: { | ||
| 14 | + method: 'GET', | ||
| 15 | + params: { | ||
| 16 | + page: 0 | ||
| 17 | + }, | ||
| 18 | + transformResponse: function(rs) { | ||
| 19 | + var dst = angular.fromJson(rs); | ||
| 20 | + if (dst.status == 'SUCCESS') { | ||
| 21 | + return dst.data; | ||
| 22 | + } else { | ||
| 23 | + return dst; // 业务错误留给控制器处理 | ||
| 24 | + } | ||
| 25 | + } | ||
| 26 | + }, | ||
| 27 | + get: { | ||
| 28 | + method: 'GET', | ||
| 29 | + transformResponse: function(rs) { | ||
| 30 | + var dst = angular.fromJson(rs); | ||
| 31 | + if (dst.status == 'SUCCESS') { | ||
| 32 | + return dst.data; | ||
| 33 | + } else { | ||
| 34 | + return dst; | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | + }, | ||
| 38 | + save: { | ||
| 39 | + method: 'POST' | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + ), | ||
| 43 | + import: $resource( | ||
| 44 | + '/cars/importfile', | ||
| 45 | + {}, | ||
| 46 | + { | ||
| 47 | + do: { | ||
| 48 | + method: 'POST', | ||
| 49 | + headers: { | ||
| 50 | + 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 51 | + }, | ||
| 52 | + transformRequest: function(obj) { | ||
| 53 | + var str = []; | ||
| 54 | + for (var p in obj) { | ||
| 55 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 56 | + } | ||
| 57 | + return str.join("&"); | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + ), | ||
| 62 | + dataTools: $resource( | ||
| 63 | + '/cars/:type', | ||
| 64 | + {}, | ||
| 65 | + { | ||
| 66 | + dataExport: { | ||
| 67 | + method: 'GET', | ||
| 68 | + responseType: "arraybuffer", | ||
| 69 | + params: { | ||
| 70 | + type: "dataExport" | ||
| 71 | + }, | ||
| 72 | + transformResponse: function(data, headers){ | ||
| 73 | + return {data : data}; | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + ) | ||
| 78 | + }; | ||
| 79 | + | ||
| 80 | + } | ||
| 81 | + ] | ||
| 82 | +); | ||
| 83 | +// 车辆设备信息service | ||
| 84 | +angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | ||
| 85 | + return $resource( | ||
| 86 | + '/cde_sc/:id', | ||
| 87 | + {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id'}, | ||
| 88 | + { | ||
| 89 | + list: { | ||
| 90 | + method: 'GET', | ||
| 91 | + params: { | ||
| 92 | + page: 0 | ||
| 93 | + }, | ||
| 94 | + transformResponse: function(rs) { | ||
| 95 | + var dst = angular.fromJson(rs); | ||
| 96 | + if (dst.status == 'SUCCESS') { | ||
| 97 | + return dst.data; | ||
| 98 | + } else { | ||
| 99 | + return dst; // 业务错误留给控制器处理 | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + }, | ||
| 103 | + get: { | ||
| 104 | + method: 'GET', | ||
| 105 | + transformResponse: function(rs) { | ||
| 106 | + var dst = angular.fromJson(rs); | ||
| 107 | + if (dst.status == 'SUCCESS') { | ||
| 108 | + return dst.data; | ||
| 109 | + } else { | ||
| 110 | + return dst; | ||
| 111 | + } | ||
| 112 | + } | ||
| 113 | + }, | ||
| 114 | + save: { | ||
| 115 | + method: 'POST' | ||
| 116 | + }, | ||
| 117 | + delete: { | ||
| 118 | + method: 'DELETE' | ||
| 119 | + } | ||
| 120 | + } | ||
| 121 | + ); | ||
| 122 | +}]); | ||
| 123 | +// 人员信息service | ||
| 124 | +angular.module('ScheduleApp').factory( | ||
| 125 | + 'EmployeeInfoManageService_g', | ||
| 126 | + [ | ||
| 127 | + '$resource', | ||
| 128 | + function($resource) { | ||
| 129 | + return { | ||
| 130 | + rest : $resource( | ||
| 131 | + '/ee/:id', | ||
| 132 | + {order: 'jobCode', direction: 'ASC', id: '@id'}, | ||
| 133 | + { | ||
| 134 | + list: { | ||
| 135 | + method: 'GET', | ||
| 136 | + params: { | ||
| 137 | + page: 0 | ||
| 138 | + }, | ||
| 139 | + transformResponse: function(rs) { | ||
| 140 | + var dst = angular.fromJson(rs); | ||
| 141 | + if (dst.status == 'SUCCESS') { | ||
| 142 | + return dst.data; | ||
| 143 | + } else { | ||
| 144 | + return dst; // 业务错误留给控制器处理 | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | + }, | ||
| 148 | + get: { | ||
| 149 | + method: 'GET', | ||
| 150 | + transformResponse: function(rs) { | ||
| 151 | + var dst = angular.fromJson(rs); | ||
| 152 | + if (dst.status == 'SUCCESS') { | ||
| 153 | + return dst.data; | ||
| 154 | + } else { | ||
| 155 | + return dst; | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + }, | ||
| 159 | + save: { | ||
| 160 | + method: 'POST' | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + ), | ||
| 164 | + | ||
| 165 | + dataTools: $resource( | ||
| 166 | + '/personnel/:type', | ||
| 167 | + {}, | ||
| 168 | + { | ||
| 169 | + dataExport: { | ||
| 170 | + method: 'GET', | ||
| 171 | + responseType: "arraybuffer", | ||
| 172 | + params: { | ||
| 173 | + type: "dataExport" | ||
| 174 | + }, | ||
| 175 | + transformResponse: function(data, headers){ | ||
| 176 | + return {data : data}; | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | + ) | ||
| 181 | + }; | ||
| 182 | + | ||
| 183 | + } | ||
| 184 | + ] | ||
| 185 | +); | ||
| 186 | + | ||
| 187 | +// 车辆配置service | ||
| 188 | +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) { | ||
| 4 | return { | 189 | return { |
| 5 | - rest: $resource( | ||
| 6 | - '/cars_sc/:id', | ||
| 7 | - {order: 'carCode', direction: 'ASC', id: '@id_route'}, | 190 | + rest : $resource( |
| 191 | + '/cci/:id', | ||
| 192 | + {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id'}, | ||
| 8 | { | 193 | { |
| 9 | list: { | 194 | list: { |
| 10 | method: 'GET', | 195 | method: 'GET', |
| @@ -35,99 +220,66 @@ angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', fu | @@ -35,99 +220,66 @@ angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', fu | ||
| 35 | method: 'POST' | 220 | method: 'POST' |
| 36 | } | 221 | } |
| 37 | } | 222 | } |
| 38 | - ), | ||
| 39 | - import: $resource( | ||
| 40 | - '/cars/importfile', | ||
| 41 | - {}, | ||
| 42 | - { | ||
| 43 | - do: { | ||
| 44 | - method: 'POST', | ||
| 45 | - headers: { | ||
| 46 | - 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 47 | - }, | ||
| 48 | - transformRequest: function(obj) { | ||
| 49 | - var str = []; | ||
| 50 | - for (var p in obj) { | ||
| 51 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 52 | - } | ||
| 53 | - return str.join("&"); | ||
| 54 | - } | ||
| 55 | - } | ||
| 56 | - } | ||
| 57 | - ), | ||
| 58 | - validate: $resource( | ||
| 59 | - '/cars/validate/:type', | ||
| 60 | - {}, | ||
| 61 | - { | ||
| 62 | - insideCode: { | ||
| 63 | - method: 'GET' | ||
| 64 | - } | ||
| 65 | - } | ||
| 66 | - ), | ||
| 67 | - dataTools: $resource( | ||
| 68 | - '/cars/:type', | ||
| 69 | - {}, | ||
| 70 | - { | ||
| 71 | - dataExport: { | ||
| 72 | - method: 'GET', | ||
| 73 | - responseType: "arraybuffer", | ||
| 74 | - params: { | ||
| 75 | - type: "dataExport" | ||
| 76 | - }, | ||
| 77 | - transformResponse: function(data, headers){ | ||
| 78 | - return {data : data}; | ||
| 79 | - } | ||
| 80 | - } | ||
| 81 | - } | ||
| 82 | ) | 223 | ) |
| 83 | }; | 224 | }; |
| 84 | }]); | 225 | }]); |
| 85 | -// 车辆设备信息service | ||
| 86 | -angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | 226 | +// 线路运营统计service |
| 227 | +angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) { | ||
| 87 | return $resource( | 228 | return $resource( |
| 88 | - '/cde/:id', | ||
| 89 | - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'}, | 229 | + '/bic/:id', |
| 230 | + {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询 | ||
| 90 | { | 231 | { |
| 91 | list: { | 232 | list: { |
| 92 | method: 'GET', | 233 | method: 'GET', |
| 93 | params: { | 234 | params: { |
| 94 | page: 0 | 235 | page: 0 |
| 95 | } | 236 | } |
| 96 | - }, | ||
| 97 | - get: { | ||
| 98 | - method: 'GET' | ||
| 99 | - }, | ||
| 100 | - save: { | ||
| 101 | - method: 'POST' | ||
| 102 | - }, | ||
| 103 | - delete: { | ||
| 104 | - method: 'DELETE' | ||
| 105 | } | 237 | } |
| 106 | } | 238 | } |
| 107 | ); | 239 | ); |
| 108 | -}]); | ||
| 109 | -// 人员信息service | ||
| 110 | -angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) { | 240 | +}]); |
| 241 | + | ||
| 242 | +// 人员配置service | ||
| 243 | +angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) { | ||
| 111 | return { | 244 | return { |
| 112 | rest : $resource( | 245 | rest : $resource( |
| 113 | - '/personnel/:id', | ||
| 114 | - {order: 'jobCode', direction: 'ASC', id: '@id_route'}, | 246 | + '/eci/:id', |
| 247 | + {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id'}, | ||
| 115 | { | 248 | { |
| 116 | list: { | 249 | list: { |
| 117 | method: 'GET', | 250 | method: 'GET', |
| 118 | params: { | 251 | params: { |
| 119 | page: 0 | 252 | page: 0 |
| 253 | + }, | ||
| 254 | + transformResponse: function(rs) { | ||
| 255 | + var dst = angular.fromJson(rs); | ||
| 256 | + if (dst.status == 'SUCCESS') { | ||
| 257 | + return dst.data; | ||
| 258 | + } else { | ||
| 259 | + return dst; // 业务错误留给控制器处理 | ||
| 260 | + } | ||
| 120 | } | 261 | } |
| 121 | }, | 262 | }, |
| 122 | get: { | 263 | get: { |
| 123 | - method: 'GET' | 264 | + method: 'GET', |
| 265 | + transformResponse: function(rs) { | ||
| 266 | + var dst = angular.fromJson(rs); | ||
| 267 | + if (dst.status == 'SUCCESS') { | ||
| 268 | + return dst.data; | ||
| 269 | + } else { | ||
| 270 | + return dst; | ||
| 271 | + } | ||
| 272 | + } | ||
| 124 | }, | 273 | }, |
| 125 | save: { | 274 | save: { |
| 126 | method: 'POST' | 275 | method: 'POST' |
| 276 | + }, | ||
| 277 | + delete: { | ||
| 278 | + method: 'DELETE' | ||
| 127 | } | 279 | } |
| 128 | } | 280 | } |
| 129 | ), | 281 | ), |
| 130 | - validate: $resource( | 282 | + validate: $resource( // TODO: |
| 131 | '/personnel/validate/:type', | 283 | '/personnel/validate/:type', |
| 132 | {}, | 284 | {}, |
| 133 | { | 285 | { |
| @@ -135,138 +287,15 @@ angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource | @@ -135,138 +287,15 @@ angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource | ||
| 135 | method: 'GET' | 287 | method: 'GET' |
| 136 | } | 288 | } |
| 137 | } | 289 | } |
| 138 | - ), | ||
| 139 | - dataTools: $resource( | ||
| 140 | - '/personnel/:type', | ||
| 141 | - {}, | ||
| 142 | - { | ||
| 143 | - dataExport: { | ||
| 144 | - method: 'GET', | ||
| 145 | - responseType: "arraybuffer", | ||
| 146 | - params: { | ||
| 147 | - type: "dataExport" | ||
| 148 | - }, | ||
| 149 | - transformResponse: function(data, headers){ | ||
| 150 | - return {data : data}; | ||
| 151 | - } | ||
| 152 | - } | ||
| 153 | - } | ||
| 154 | ) | 290 | ) |
| 155 | }; | 291 | }; |
| 156 | -}]); | ||
| 157 | - | ||
| 158 | -// 车辆配置service | ||
| 159 | -angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) { | ||
| 160 | - return { | ||
| 161 | - rest : $resource( | ||
| 162 | - '/cci/:id', | ||
| 163 | - {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'}, | ||
| 164 | - { | ||
| 165 | - list: { | ||
| 166 | - method: 'GET', | ||
| 167 | - params: { | ||
| 168 | - page: 0 | ||
| 169 | - }, | ||
| 170 | - transformResponse: function(rs) { | ||
| 171 | - var dst = angular.fromJson(rs); | ||
| 172 | - if (dst.status == 'SUCCESS') { | ||
| 173 | - return dst.data; | ||
| 174 | - } else { | ||
| 175 | - return dst; // 业务错误留给控制器处理 | ||
| 176 | - } | ||
| 177 | - } | ||
| 178 | - }, | ||
| 179 | - get: { | ||
| 180 | - method: 'GET', | ||
| 181 | - transformResponse: function(rs) { | ||
| 182 | - var dst = angular.fromJson(rs); | ||
| 183 | - if (dst.status == 'SUCCESS') { | ||
| 184 | - return dst.data; | ||
| 185 | - } else { | ||
| 186 | - return dst; | ||
| 187 | - } | ||
| 188 | - } | ||
| 189 | - }, | ||
| 190 | - save: { | ||
| 191 | - method: 'POST' | ||
| 192 | - } | ||
| 193 | - } | ||
| 194 | - ) | ||
| 195 | - }; | ||
| 196 | -}]); | ||
| 197 | -// 线路运营统计service | ||
| 198 | -angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) { | ||
| 199 | - return $resource( | ||
| 200 | - '/bic/:id', | ||
| 201 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询 | ||
| 202 | - { | ||
| 203 | - list: { | ||
| 204 | - method: 'GET', | ||
| 205 | - params: { | ||
| 206 | - page: 0 | ||
| 207 | - } | ||
| 208 | - } | ||
| 209 | - } | ||
| 210 | - ); | ||
| 211 | -}]); | ||
| 212 | - | ||
| 213 | -// 人员配置service | ||
| 214 | -angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) { | ||
| 215 | - return { | ||
| 216 | - rest : $resource( | ||
| 217 | - '/eci/:id', | ||
| 218 | - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'}, | ||
| 219 | - { | ||
| 220 | - list: { | ||
| 221 | - method: 'GET', | ||
| 222 | - params: { | ||
| 223 | - page: 0 | ||
| 224 | - }, | ||
| 225 | - transformResponse: function(rs) { | ||
| 226 | - var dst = angular.fromJson(rs); | ||
| 227 | - if (dst.status == 'SUCCESS') { | ||
| 228 | - return dst.data; | ||
| 229 | - } else { | ||
| 230 | - return dst; // 业务错误留给控制器处理 | ||
| 231 | - } | ||
| 232 | - } | ||
| 233 | - }, | ||
| 234 | - get: { | ||
| 235 | - method: 'GET', | ||
| 236 | - transformResponse: function(rs) { | ||
| 237 | - var dst = angular.fromJson(rs); | ||
| 238 | - if (dst.status == 'SUCCESS') { | ||
| 239 | - return dst.data; | ||
| 240 | - } else { | ||
| 241 | - return dst; | ||
| 242 | - } | ||
| 243 | - } | ||
| 244 | - }, | ||
| 245 | - save: { | ||
| 246 | - method: 'POST' | ||
| 247 | - }, | ||
| 248 | - delete: { | ||
| 249 | - method: 'DELETE' | ||
| 250 | - } | ||
| 251 | - } | ||
| 252 | - ), | ||
| 253 | - validate: $resource( // TODO: | ||
| 254 | - '/personnel/validate/:type', | ||
| 255 | - {}, | ||
| 256 | - { | ||
| 257 | - jobCode: { | ||
| 258 | - method: 'GET' | ||
| 259 | - } | ||
| 260 | - } | ||
| 261 | - ) | ||
| 262 | - }; | ||
| 263 | }]); | 292 | }]); |
| 264 | // 路牌管理service | 293 | // 路牌管理service |
| 265 | angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) { | 294 | angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) { |
| 266 | return { | 295 | return { |
| 267 | rest: $resource( | 296 | rest: $resource( |
| 268 | '/gic/:id', | 297 | '/gic/:id', |
| 269 | - {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id_route'}, | 298 | + {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id'}, |
| 270 | { | 299 | { |
| 271 | list: { | 300 | list: { |
| 272 | method: 'GET', | 301 | method: 'GET', |
| @@ -523,454 +552,468 @@ angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resou | @@ -523,454 +552,468 @@ angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resou | ||
| 523 | // TODO:导入数据 | 552 | // TODO:导入数据 |
| 524 | }; | 553 | }; |
| 525 | }]); | 554 | }]); |
| 526 | -// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用 | ||
| 527 | - | ||
| 528 | -// 文件下载服务 | ||
| 529 | -angular.module('ScheduleApp').factory('FileDownload_g', function() { | ||
| 530 | - return { | ||
| 531 | - downloadFile: function (data, mimeType, fileName) { | ||
| 532 | - var success = false; | ||
| 533 | - var blob = new Blob([data], { type: mimeType }); | ||
| 534 | - try { | ||
| 535 | - if (navigator.msSaveBlob) | ||
| 536 | - navigator.msSaveBlob(blob, fileName); | ||
| 537 | - else { | ||
| 538 | - // Try using other saveBlob implementations, if available | ||
| 539 | - var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob; | ||
| 540 | - if (saveBlob === undefined) throw "Not supported"; | ||
| 541 | - saveBlob(blob, fileName); | ||
| 542 | - } | ||
| 543 | - success = true; | ||
| 544 | - } catch (ex) { | ||
| 545 | - console.log("saveBlob method failed with the following exception:"); | ||
| 546 | - console.log(ex); | ||
| 547 | - } | ||
| 548 | - | ||
| 549 | - if (!success) { | ||
| 550 | - // Get the blob url creator | ||
| 551 | - var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL; | ||
| 552 | - if (urlCreator) { | ||
| 553 | - // Try to use a download link | ||
| 554 | - var link = document.createElement('a'); | ||
| 555 | - if ('download' in link) { | ||
| 556 | - // Try to simulate a click | ||
| 557 | - try { | ||
| 558 | - // Prepare a blob URL | ||
| 559 | - var url = urlCreator.createObjectURL(blob); | ||
| 560 | - link.setAttribute('href', url); | ||
| 561 | - | ||
| 562 | - // Set the download attribute (Supported in Chrome 14+ / Firefox 20+) | ||
| 563 | - link.setAttribute("download", fileName); | ||
| 564 | - | ||
| 565 | - // Simulate clicking the download link | ||
| 566 | - var event = document.createEvent('MouseEvents'); | ||
| 567 | - event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); | ||
| 568 | - link.dispatchEvent(event); | ||
| 569 | - success = true; | ||
| 570 | - | ||
| 571 | - } catch (ex) { | ||
| 572 | - console.log("Download link method with simulated click failed with the following exception:"); | ||
| 573 | - console.log(ex); | ||
| 574 | - } | ||
| 575 | - } | ||
| 576 | - | ||
| 577 | - if (!success) { | ||
| 578 | - // Fallback to window.location method | ||
| 579 | - try { | ||
| 580 | - // Prepare a blob URL | ||
| 581 | - // Use application/octet-stream when using window.location to force download | ||
| 582 | - var url = urlCreator.createObjectURL(blob); | ||
| 583 | - window.location = url; | ||
| 584 | - console.log("Download link method with window.location succeeded"); | ||
| 585 | - success = true; | ||
| 586 | - } catch (ex) { | ||
| 587 | - console.log("Download link method with window.location failed with the following exception:"); | ||
| 588 | - console.log(ex); | ||
| 589 | - } | ||
| 590 | - } | ||
| 591 | - } | ||
| 592 | - } | ||
| 593 | - | ||
| 594 | - if (!success) { | ||
| 595 | - // Fallback to window.open method | ||
| 596 | - console.log("No methods worked for saving the arraybuffer, using last resort window.open"); | ||
| 597 | - window.open("", '_blank', ''); | ||
| 598 | - } | ||
| 599 | - } | ||
| 600 | - }; | ||
| 601 | -}); | ||
| 602 | - | ||
| 603 | - | ||
| 604 | -/** | ||
| 605 | - * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。 | ||
| 606 | - * 1、compile阶段使用的属性如下: | ||
| 607 | - * required:用于和表单验证连接,指定成required="true"才有效。 | ||
| 608 | - * 2、link阶段使用的属性如下 | ||
| 609 | - * model:关联的模型对象 | ||
| 610 | - * name:表单验证时需要的名字 | ||
| 611 | - * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加 | ||
| 612 | - * modelcolname1:关联的模型字段名字1(一般应该是编码字段) | ||
| 613 | - * modelcolname2:关联的模型字段名字2(一般应该是名字字段) | ||
| 614 | - * datacolname1;内部数据对应的字段名字1(与模型字段1对应) | ||
| 615 | - * datacolname2:内部数据对应的字段名字2(与模型字段2对应) | ||
| 616 | - * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用 | ||
| 617 | - * placeholder:select placeholder字符串描述 | ||
| 618 | - * | ||
| 619 | - * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。 | ||
| 620 | - * $$SearchInfoService_g,内部使用的数据服务 | ||
| 621 | - */ | ||
| 622 | -// saSelect2指令使用的内部信service | ||
| 623 | -angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) { | ||
| 624 | - return { | ||
| 625 | - xl: $resource( | ||
| 626 | - '/line/:type', | ||
| 627 | - {order: 'name', direction: 'ASC'}, | ||
| 628 | - { | ||
| 629 | - list: { | ||
| 630 | - method: 'GET', | ||
| 631 | - isArray: true | ||
| 632 | - } | ||
| 633 | - } | ||
| 634 | - ), | ||
| 635 | - xlinfo: $resource( | ||
| 636 | - '/lineInformation/:type', | ||
| 637 | - {order: 'line.name', direction: 'ASC'}, | ||
| 638 | - { | ||
| 639 | - list: { | ||
| 640 | - method: 'GET', | ||
| 641 | - isArray: true | ||
| 642 | - } | ||
| 643 | - } | ||
| 644 | - ), | ||
| 645 | - zd: $resource( | ||
| 646 | - '/stationroute/stations', | ||
| 647 | - {order: 'stationCode', direction: 'ASC'}, | ||
| 648 | - { | ||
| 649 | - list: { | ||
| 650 | - method: 'GET', | ||
| 651 | - isArray: true | ||
| 652 | - } | ||
| 653 | - } | ||
| 654 | - ), | ||
| 655 | - tcc: $resource( | ||
| 656 | - '/carpark/:type', | ||
| 657 | - {order: 'parkCode', direction: 'ASC'}, | ||
| 658 | - { | ||
| 659 | - list: { | ||
| 660 | - method: 'GET', | ||
| 661 | - isArray: true | ||
| 662 | - } | ||
| 663 | - } | ||
| 664 | - ), | ||
| 665 | - ry: $resource( | ||
| 666 | - '/personnel/:type', | ||
| 667 | - {order: 'personnelName', direction: 'ASC'}, | ||
| 668 | - { | ||
| 669 | - list: { | ||
| 670 | - method: 'GET', | ||
| 671 | - isArray: true | ||
| 672 | - } | ||
| 673 | - } | ||
| 674 | - ), | ||
| 675 | - cl: $resource( | ||
| 676 | - '/cars/:type', | ||
| 677 | - {order: "insideCode", direction: 'ASC'}, | ||
| 678 | - { | ||
| 679 | - list: { | ||
| 680 | - method: 'GET', | ||
| 681 | - isArray: true | ||
| 682 | - } | ||
| 683 | - } | ||
| 684 | - ), | ||
| 685 | - ttInfo: $resource( | ||
| 686 | - '/tic/:type', | ||
| 687 | - {order: "name", direction: 'ASC'}, | ||
| 688 | - { | ||
| 689 | - list: { | ||
| 690 | - method: 'GET', | ||
| 691 | - isArray: true | ||
| 692 | - } | ||
| 693 | - } | ||
| 694 | - ), | ||
| 695 | - lpInfo: $resource( | ||
| 696 | - '/gic/ttlpnames', | ||
| 697 | - {order: "lpName", direction: 'ASC'}, | ||
| 698 | - { | ||
| 699 | - list: { | ||
| 700 | - method: 'GET', | ||
| 701 | - isArray: true | ||
| 702 | - } | ||
| 703 | - } | ||
| 704 | - ), | ||
| 705 | - lpInfo2: $resource( | ||
| 706 | - '/gic/:type', | ||
| 707 | - {order: "lpName", direction: 'ASC'}, | ||
| 708 | - { | ||
| 709 | - list: { | ||
| 710 | - method: 'GET', | ||
| 711 | - isArray: true | ||
| 712 | - } | ||
| 713 | - } | ||
| 714 | - ), | ||
| 715 | - cci: $resource( | ||
| 716 | - '/cci/cars', | ||
| 717 | - {}, | ||
| 718 | - { | ||
| 719 | - list: { | ||
| 720 | - method: 'GET', | ||
| 721 | - isArray: true | ||
| 722 | - } | ||
| 723 | - } | ||
| 724 | - | ||
| 725 | - ), | ||
| 726 | - cci2: $resource( | ||
| 727 | - '/cci/:type', | ||
| 728 | - {}, | ||
| 729 | - { | ||
| 730 | - list: { | ||
| 731 | - method: 'GET', | ||
| 732 | - isArray: true, | ||
| 733 | - transformResponse: function(rs) { | ||
| 734 | - var dst = angular.fromJson(rs); | ||
| 735 | - if (dst.status == 'SUCCESS') { | ||
| 736 | - return dst.data; | ||
| 737 | - } else { | ||
| 738 | - return dst; // 业务错误留给控制器处理 | ||
| 739 | - } | ||
| 740 | - } | ||
| 741 | - } | ||
| 742 | - } | ||
| 743 | - ), | ||
| 744 | - cci3: $resource( | ||
| 745 | - '/cci/cars2', | ||
| 746 | - {}, | ||
| 747 | - { | ||
| 748 | - list: { | ||
| 749 | - method: 'GET', | ||
| 750 | - isArray: true | ||
| 751 | - } | ||
| 752 | - } | ||
| 753 | - | ||
| 754 | - ), | ||
| 755 | - eci: $resource( | ||
| 756 | - '/eci/jsy', | ||
| 757 | - {}, | ||
| 758 | - { | ||
| 759 | - list: { | ||
| 760 | - method: 'GET', | ||
| 761 | - isArray: true | ||
| 762 | - } | ||
| 763 | - } | ||
| 764 | - ), | ||
| 765 | - eci2: $resource( | ||
| 766 | - '/eci/spy', | ||
| 767 | - {}, | ||
| 768 | - { | ||
| 769 | - list: { | ||
| 770 | - method: 'GET', | ||
| 771 | - isArray: true | ||
| 772 | - } | ||
| 773 | - } | ||
| 774 | - ), | ||
| 775 | - eci3: $resource( | ||
| 776 | - '/eci/:type', | ||
| 777 | - {}, | ||
| 778 | - { | ||
| 779 | - list: { | ||
| 780 | - method: 'GET', | ||
| 781 | - isArray: true | ||
| 782 | - } | ||
| 783 | - } | ||
| 784 | - ), | ||
| 785 | - | ||
| 786 | - | ||
| 787 | - validate: { // remoteValidation指令用到的resource | ||
| 788 | - gbv1: { // 路牌序号验证 | ||
| 789 | - template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'}, | ||
| 790 | - remote: $resource( | ||
| 791 | - '/gic/validate1', | ||
| 792 | - {}, | ||
| 793 | - { | ||
| 794 | - do: { | ||
| 795 | - method: 'GET' | ||
| 796 | - } | ||
| 797 | - } | ||
| 798 | - ) | ||
| 799 | - }, | ||
| 800 | - gbv2: { // 路牌名称验证 | ||
| 801 | - template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'}, | ||
| 802 | - remote: $resource( | ||
| 803 | - '/gic/validate2', | ||
| 804 | - {}, | ||
| 805 | - { | ||
| 806 | - do: { | ||
| 807 | - method: 'GET' | ||
| 808 | - } | ||
| 809 | - } | ||
| 810 | - ) | ||
| 811 | - }, | ||
| 812 | - | ||
| 813 | - cars_zbh: { // 自编号验证 | ||
| 814 | - template: {'insideCode_eq': '-1'}, // 查询参数模版 | ||
| 815 | - remote: $resource( // $resource封装对象 | ||
| 816 | - '/cars_sc/validate_zbh', | ||
| 817 | - {}, | ||
| 818 | - { | ||
| 819 | - do: { | ||
| 820 | - method: 'GET' | ||
| 821 | - } | ||
| 822 | - } | ||
| 823 | - ) | ||
| 824 | - }, | ||
| 825 | - | ||
| 826 | - cars_sbbh: { // 验证设备编号 | ||
| 827 | - template: {'equipmentCode_eq': '-1'}, // 查询参数模版 | ||
| 828 | - remote: $resource( // $resource封装对象 | ||
| 829 | - '/cars_sc/validate_sbbh', | ||
| 830 | - {}, | ||
| 831 | - { | ||
| 832 | - do: { | ||
| 833 | - method: 'GET' | ||
| 834 | - } | ||
| 835 | - } | ||
| 836 | - ) | ||
| 837 | - }, | ||
| 838 | - | ||
| 839 | - cars_clbh: { // 车辆编号验证 | ||
| 840 | - template: {'carCode_eq': '-1'}, // 查询参数模版 | ||
| 841 | - remote: $resource( // $resource封装对象 | ||
| 842 | - '/cars_sc/validate_clbh', | ||
| 843 | - {}, | ||
| 844 | - { | ||
| 845 | - do: { | ||
| 846 | - method: 'GET' | ||
| 847 | - } | ||
| 848 | - } | ||
| 849 | - ) | ||
| 850 | - }, | ||
| 851 | - | ||
| 852 | - cars_cph: { // 车牌号验证 | ||
| 853 | - template: {'carPlate_eq': '-1'}, // 查询参数模版 | ||
| 854 | - remote: $resource( // $resource封装对象 | ||
| 855 | - '/cars_sc/validate_cph', | ||
| 856 | - {}, | ||
| 857 | - { | ||
| 858 | - do: { | ||
| 859 | - method: 'GET' | ||
| 860 | - } | ||
| 861 | - } | ||
| 862 | - ) | ||
| 863 | - }, | ||
| 864 | - cc_cars: { // 车辆不能重复配置 | ||
| 865 | - template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 | ||
| 866 | - remote: $resource( // $resource封装对象 | ||
| 867 | - '/cci/validate_cars', | ||
| 868 | - {}, | ||
| 869 | - { | ||
| 870 | - do: { | ||
| 871 | - method: 'GET' | ||
| 872 | - } | ||
| 873 | - } | ||
| 874 | - ) | ||
| 875 | - }, | ||
| 876 | - ec_jsy: { // 驾驶员不能重复配置 | ||
| 877 | - template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版 | ||
| 878 | - remote: $resource( // $resource封装对象 | ||
| 879 | - '/eci/validate_jsy', | ||
| 880 | - {}, | ||
| 881 | - { | ||
| 882 | - do: { | ||
| 883 | - method: 'GET' | ||
| 884 | - } | ||
| 885 | - } | ||
| 886 | - ) | ||
| 887 | - }, | ||
| 888 | - ec_spy: { // 售票员不能重复配置 | ||
| 889 | - template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版 | ||
| 890 | - remote: $resource( // $resource封装对象 | ||
| 891 | - '/eci/validate_spy', | ||
| 892 | - {}, | ||
| 893 | - { | ||
| 894 | - do: { | ||
| 895 | - method: 'GET' | ||
| 896 | - } | ||
| 897 | - } | ||
| 898 | - ) | ||
| 899 | - }, | ||
| 900 | - | ||
| 901 | - cde1: { // 车辆设备启用日期验证 | ||
| 902 | - template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒 | ||
| 903 | - remote: $resource( // $resource封装对象 | ||
| 904 | - '/cde//validate/qyrq', | ||
| 905 | - {}, | ||
| 906 | - { | ||
| 907 | - do: { | ||
| 908 | - method: 'GET' | ||
| 909 | - } | ||
| 910 | - } | ||
| 911 | - ) | ||
| 912 | - }, | ||
| 913 | - ttc1: { // 时刻表名字验证 | ||
| 914 | - template: {'xl.id_eq': -1, 'name_eq': 'ddd'}, | ||
| 915 | - remote: $resource( // $resource封装对象 | ||
| 916 | - '/tic/validate/equale', | ||
| 917 | - {}, | ||
| 918 | - { | ||
| 919 | - do: { | ||
| 920 | - method: 'GET' | ||
| 921 | - } | ||
| 922 | - } | ||
| 923 | - ) | ||
| 924 | - }, | ||
| 925 | - sheet: { // 时刻表sheet工作区验证 | ||
| 926 | - template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''}, | ||
| 927 | - remote: $resource( // $resource封装对象 | ||
| 928 | - '/tidc/validate/sheet', | ||
| 929 | - {}, | ||
| 930 | - { | ||
| 931 | - do: { | ||
| 932 | - method: 'POST', | ||
| 933 | - headers: { | ||
| 934 | - 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 935 | - }, | ||
| 936 | - transformRequest: function(obj) { | ||
| 937 | - var str = []; | ||
| 938 | - for (var p in obj) { | ||
| 939 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 940 | - } | ||
| 941 | - return str.join("&"); | ||
| 942 | - } | ||
| 943 | - } | ||
| 944 | - } | ||
| 945 | - ) | ||
| 946 | - }, | ||
| 947 | - sheetli: { // 时刻表线路标准验证 | ||
| 948 | - template: {'lineinfoid': -1}, | ||
| 949 | - remote: $resource( // $resource封装对象 | ||
| 950 | - '/tidc/validate/lineinfo', | ||
| 951 | - {}, | ||
| 952 | - { | ||
| 953 | - do: { | ||
| 954 | - method: 'GET' | ||
| 955 | - } | ||
| 956 | - } | ||
| 957 | - ) | ||
| 958 | - } | ||
| 959 | - } | ||
| 960 | - | ||
| 961 | - //validate: $resource( | ||
| 962 | - // '/cars/validate/:type', | ||
| 963 | - // {}, | ||
| 964 | - // { | ||
| 965 | - // insideCode: { | ||
| 966 | - // method: 'GET' | ||
| 967 | - // } | ||
| 968 | - // } | ||
| 969 | - //) | ||
| 970 | - | ||
| 971 | - | ||
| 972 | - | ||
| 973 | - } | ||
| 974 | -}]); | ||
| 975 | - | ||
| 976 | - | 555 | +// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用 |
| 556 | + | ||
| 557 | +// 文件下载服务 | ||
| 558 | +angular.module('ScheduleApp').factory('FileDownload_g', function() { | ||
| 559 | + return { | ||
| 560 | + downloadFile: function (data, mimeType, fileName) { | ||
| 561 | + var success = false; | ||
| 562 | + var blob = new Blob([data], { type: mimeType }); | ||
| 563 | + try { | ||
| 564 | + if (navigator.msSaveBlob) | ||
| 565 | + navigator.msSaveBlob(blob, fileName); | ||
| 566 | + else { | ||
| 567 | + // Try using other saveBlob implementations, if available | ||
| 568 | + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob; | ||
| 569 | + if (saveBlob === undefined) throw "Not supported"; | ||
| 570 | + saveBlob(blob, fileName); | ||
| 571 | + } | ||
| 572 | + success = true; | ||
| 573 | + } catch (ex) { | ||
| 574 | + console.log("saveBlob method failed with the following exception:"); | ||
| 575 | + console.log(ex); | ||
| 576 | + } | ||
| 577 | + | ||
| 578 | + if (!success) { | ||
| 579 | + // Get the blob url creator | ||
| 580 | + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL; | ||
| 581 | + if (urlCreator) { | ||
| 582 | + // Try to use a download link | ||
| 583 | + var link = document.createElement('a'); | ||
| 584 | + if ('download' in link) { | ||
| 585 | + // Try to simulate a click | ||
| 586 | + try { | ||
| 587 | + // Prepare a blob URL | ||
| 588 | + var url = urlCreator.createObjectURL(blob); | ||
| 589 | + link.setAttribute('href', url); | ||
| 590 | + | ||
| 591 | + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+) | ||
| 592 | + link.setAttribute("download", fileName); | ||
| 593 | + | ||
| 594 | + // Simulate clicking the download link | ||
| 595 | + var event = document.createEvent('MouseEvents'); | ||
| 596 | + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); | ||
| 597 | + link.dispatchEvent(event); | ||
| 598 | + success = true; | ||
| 599 | + | ||
| 600 | + } catch (ex) { | ||
| 601 | + console.log("Download link method with simulated click failed with the following exception:"); | ||
| 602 | + console.log(ex); | ||
| 603 | + } | ||
| 604 | + } | ||
| 605 | + | ||
| 606 | + if (!success) { | ||
| 607 | + // Fallback to window.location method | ||
| 608 | + try { | ||
| 609 | + // Prepare a blob URL | ||
| 610 | + // Use application/octet-stream when using window.location to force download | ||
| 611 | + var url = urlCreator.createObjectURL(blob); | ||
| 612 | + window.location = url; | ||
| 613 | + console.log("Download link method with window.location succeeded"); | ||
| 614 | + success = true; | ||
| 615 | + } catch (ex) { | ||
| 616 | + console.log("Download link method with window.location failed with the following exception:"); | ||
| 617 | + console.log(ex); | ||
| 618 | + } | ||
| 619 | + } | ||
| 620 | + } | ||
| 621 | + } | ||
| 622 | + | ||
| 623 | + if (!success) { | ||
| 624 | + // Fallback to window.open method | ||
| 625 | + console.log("No methods worked for saving the arraybuffer, using last resort window.open"); | ||
| 626 | + window.open("", '_blank', ''); | ||
| 627 | + } | ||
| 628 | + } | ||
| 629 | + }; | ||
| 630 | +}); | ||
| 631 | + | ||
| 632 | + | ||
| 633 | +/** | ||
| 634 | + * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。 | ||
| 635 | + * 1、compile阶段使用的属性如下: | ||
| 636 | + * required:用于和表单验证连接,指定成required="true"才有效。 | ||
| 637 | + * 2、link阶段使用的属性如下 | ||
| 638 | + * model:关联的模型对象 | ||
| 639 | + * name:表单验证时需要的名字 | ||
| 640 | + * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加 | ||
| 641 | + * modelcolname1:关联的模型字段名字1(一般应该是编码字段) | ||
| 642 | + * modelcolname2:关联的模型字段名字2(一般应该是名字字段) | ||
| 643 | + * datacolname1;内部数据对应的字段名字1(与模型字段1对应) | ||
| 644 | + * datacolname2:内部数据对应的字段名字2(与模型字段2对应) | ||
| 645 | + * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用 | ||
| 646 | + * placeholder:select placeholder字符串描述 | ||
| 647 | + * | ||
| 648 | + * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。 | ||
| 649 | + * $$SearchInfoService_g,内部使用的数据服务 | ||
| 650 | + */ | ||
| 651 | +// saSelect2指令使用的内部信service | ||
| 652 | +angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) { | ||
| 653 | + return { | ||
| 654 | + xl: $resource( | ||
| 655 | + '/line/:type', | ||
| 656 | + {order: 'name', direction: 'ASC'}, | ||
| 657 | + { | ||
| 658 | + list: { | ||
| 659 | + method: 'GET', | ||
| 660 | + isArray: true | ||
| 661 | + } | ||
| 662 | + } | ||
| 663 | + ), | ||
| 664 | + xlinfo: $resource( | ||
| 665 | + '/lineInformation/:type', | ||
| 666 | + {order: 'line.name', direction: 'ASC'}, | ||
| 667 | + { | ||
| 668 | + list: { | ||
| 669 | + method: 'GET', | ||
| 670 | + isArray: true | ||
| 671 | + } | ||
| 672 | + } | ||
| 673 | + ), | ||
| 674 | + zd: $resource( | ||
| 675 | + '/stationroute/stations', | ||
| 676 | + {order: 'stationCode', direction: 'ASC'}, | ||
| 677 | + { | ||
| 678 | + list: { | ||
| 679 | + method: 'GET', | ||
| 680 | + isArray: true | ||
| 681 | + } | ||
| 682 | + } | ||
| 683 | + ), | ||
| 684 | + tcc: $resource( | ||
| 685 | + '/carpark/:type', | ||
| 686 | + {order: 'parkCode', direction: 'ASC'}, | ||
| 687 | + { | ||
| 688 | + list: { | ||
| 689 | + method: 'GET', | ||
| 690 | + isArray: true | ||
| 691 | + } | ||
| 692 | + } | ||
| 693 | + ), | ||
| 694 | + ry: $resource( | ||
| 695 | + '/personnel/:type', | ||
| 696 | + {order: 'personnelName', direction: 'ASC'}, | ||
| 697 | + { | ||
| 698 | + list: { | ||
| 699 | + method: 'GET', | ||
| 700 | + isArray: true | ||
| 701 | + } | ||
| 702 | + } | ||
| 703 | + ), | ||
| 704 | + cl: $resource( | ||
| 705 | + '/cars/:type', | ||
| 706 | + {order: "insideCode", direction: 'ASC'}, | ||
| 707 | + { | ||
| 708 | + list: { | ||
| 709 | + method: 'GET', | ||
| 710 | + isArray: true | ||
| 711 | + } | ||
| 712 | + } | ||
| 713 | + ), | ||
| 714 | + ttInfo: $resource( | ||
| 715 | + '/tic/:type', | ||
| 716 | + {order: "name", direction: 'ASC'}, | ||
| 717 | + { | ||
| 718 | + list: { | ||
| 719 | + method: 'GET', | ||
| 720 | + isArray: true | ||
| 721 | + } | ||
| 722 | + } | ||
| 723 | + ), | ||
| 724 | + lpInfo: $resource( | ||
| 725 | + '/gic/ttlpnames', | ||
| 726 | + {order: "lpName", direction: 'ASC'}, | ||
| 727 | + { | ||
| 728 | + list: { | ||
| 729 | + method: 'GET', | ||
| 730 | + isArray: true | ||
| 731 | + } | ||
| 732 | + } | ||
| 733 | + ), | ||
| 734 | + lpInfo2: $resource( | ||
| 735 | + '/gic/:type', | ||
| 736 | + {order: "lpName", direction: 'ASC'}, | ||
| 737 | + { | ||
| 738 | + list: { | ||
| 739 | + method: 'GET', | ||
| 740 | + isArray: true | ||
| 741 | + } | ||
| 742 | + } | ||
| 743 | + ), | ||
| 744 | + cci: $resource( | ||
| 745 | + '/cci/cars', | ||
| 746 | + {}, | ||
| 747 | + { | ||
| 748 | + list: { | ||
| 749 | + method: 'GET', | ||
| 750 | + isArray: true | ||
| 751 | + } | ||
| 752 | + } | ||
| 753 | + | ||
| 754 | + ), | ||
| 755 | + cci2: $resource( | ||
| 756 | + '/cci/:type', | ||
| 757 | + {}, | ||
| 758 | + { | ||
| 759 | + list: { | ||
| 760 | + method: 'GET', | ||
| 761 | + isArray: true, | ||
| 762 | + transformResponse: function(rs) { | ||
| 763 | + var dst = angular.fromJson(rs); | ||
| 764 | + if (dst.status == 'SUCCESS') { | ||
| 765 | + return dst.data; | ||
| 766 | + } else { | ||
| 767 | + return dst; // 业务错误留给控制器处理 | ||
| 768 | + } | ||
| 769 | + } | ||
| 770 | + } | ||
| 771 | + } | ||
| 772 | + ), | ||
| 773 | + cci3: $resource( | ||
| 774 | + '/cci/cars2', | ||
| 775 | + {}, | ||
| 776 | + { | ||
| 777 | + list: { | ||
| 778 | + method: 'GET', | ||
| 779 | + isArray: true | ||
| 780 | + } | ||
| 781 | + } | ||
| 782 | + | ||
| 783 | + ), | ||
| 784 | + eci: $resource( | ||
| 785 | + '/eci/jsy', | ||
| 786 | + {}, | ||
| 787 | + { | ||
| 788 | + list: { | ||
| 789 | + method: 'GET', | ||
| 790 | + isArray: true | ||
| 791 | + } | ||
| 792 | + } | ||
| 793 | + ), | ||
| 794 | + eci2: $resource( | ||
| 795 | + '/eci/spy', | ||
| 796 | + {}, | ||
| 797 | + { | ||
| 798 | + list: { | ||
| 799 | + method: 'GET', | ||
| 800 | + isArray: true | ||
| 801 | + } | ||
| 802 | + } | ||
| 803 | + ), | ||
| 804 | + eci3: $resource( | ||
| 805 | + '/eci/:type', | ||
| 806 | + {}, | ||
| 807 | + { | ||
| 808 | + list: { | ||
| 809 | + method: 'GET', | ||
| 810 | + isArray: true | ||
| 811 | + } | ||
| 812 | + } | ||
| 813 | + ), | ||
| 814 | + | ||
| 815 | + | ||
| 816 | + validate: { // remoteValidation指令用到的resource | ||
| 817 | + gbv1: { // 路牌序号验证 | ||
| 818 | + template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'}, | ||
| 819 | + remote: $resource( | ||
| 820 | + '/gic/validate_lpno', | ||
| 821 | + {}, | ||
| 822 | + { | ||
| 823 | + do: { | ||
| 824 | + method: 'GET' | ||
| 825 | + } | ||
| 826 | + } | ||
| 827 | + ) | ||
| 828 | + }, | ||
| 829 | + gbv2: { // 路牌名称验证 | ||
| 830 | + template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'}, | ||
| 831 | + remote: $resource( | ||
| 832 | + '/gic/validate_lpname', | ||
| 833 | + {}, | ||
| 834 | + { | ||
| 835 | + do: { | ||
| 836 | + method: 'GET' | ||
| 837 | + } | ||
| 838 | + } | ||
| 839 | + ) | ||
| 840 | + }, | ||
| 841 | + | ||
| 842 | + cars_zbh: { // 自编号验证 | ||
| 843 | + template: {'insideCode_eq': '-1'}, // 查询参数模版 | ||
| 844 | + remote: $resource( // $resource封装对象 | ||
| 845 | + '/cars_sc/validate_zbh', | ||
| 846 | + {}, | ||
| 847 | + { | ||
| 848 | + do: { | ||
| 849 | + method: 'GET' | ||
| 850 | + } | ||
| 851 | + } | ||
| 852 | + ) | ||
| 853 | + }, | ||
| 854 | + | ||
| 855 | + cars_sbbh: { // 验证设备编号 | ||
| 856 | + template: {'equipmentCode_eq': '-1'}, // 查询参数模版 | ||
| 857 | + remote: $resource( // $resource封装对象 | ||
| 858 | + '/cars_sc/validate_sbbh', | ||
| 859 | + {}, | ||
| 860 | + { | ||
| 861 | + do: { | ||
| 862 | + method: 'GET' | ||
| 863 | + } | ||
| 864 | + } | ||
| 865 | + ) | ||
| 866 | + }, | ||
| 867 | + | ||
| 868 | + cars_clbh: { // 车辆编号验证 | ||
| 869 | + template: {'carCode_eq': '-1'}, // 查询参数模版 | ||
| 870 | + remote: $resource( // $resource封装对象 | ||
| 871 | + '/cars_sc/validate_clbh', | ||
| 872 | + {}, | ||
| 873 | + { | ||
| 874 | + do: { | ||
| 875 | + method: 'GET' | ||
| 876 | + } | ||
| 877 | + } | ||
| 878 | + ) | ||
| 879 | + }, | ||
| 880 | + | ||
| 881 | + cars_cph: { // 车牌号验证 | ||
| 882 | + template: {'carPlate_eq': '-1'}, // 查询参数模版 | ||
| 883 | + remote: $resource( // $resource封装对象 | ||
| 884 | + '/cars_sc/validate_cph', | ||
| 885 | + {}, | ||
| 886 | + { | ||
| 887 | + do: { | ||
| 888 | + method: 'GET' | ||
| 889 | + } | ||
| 890 | + } | ||
| 891 | + ) | ||
| 892 | + }, | ||
| 893 | + | ||
| 894 | + ee_gh: { // 工号不能重复 | ||
| 895 | + template: {'companyCode_eq': '-1', 'jobCode_eq': '-1'}, // 查询参数模版 | ||
| 896 | + remote: $resource( // $resource封装对象 | ||
| 897 | + '/ee/validate_gh', | ||
| 898 | + {}, | ||
| 899 | + { | ||
| 900 | + do: { | ||
| 901 | + method: 'GET' | ||
| 902 | + } | ||
| 903 | + } | ||
| 904 | + ) | ||
| 905 | + }, | ||
| 906 | + | ||
| 907 | + cc_cars: { // 车辆不能重复配置 | ||
| 908 | + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 | ||
| 909 | + remote: $resource( // $resource封装对象 | ||
| 910 | + '/cci/validate_cars', | ||
| 911 | + {}, | ||
| 912 | + { | ||
| 913 | + do: { | ||
| 914 | + method: 'GET' | ||
| 915 | + } | ||
| 916 | + } | ||
| 917 | + ) | ||
| 918 | + }, | ||
| 919 | + ec_jsy: { // 驾驶员不能重复配置 | ||
| 920 | + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版 | ||
| 921 | + remote: $resource( // $resource封装对象 | ||
| 922 | + '/eci/validate_jsy', | ||
| 923 | + {}, | ||
| 924 | + { | ||
| 925 | + do: { | ||
| 926 | + method: 'GET' | ||
| 927 | + } | ||
| 928 | + } | ||
| 929 | + ) | ||
| 930 | + }, | ||
| 931 | + ec_spy: { // 售票员不能重复配置 | ||
| 932 | + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版 | ||
| 933 | + remote: $resource( // $resource封装对象 | ||
| 934 | + '/eci/validate_spy', | ||
| 935 | + {}, | ||
| 936 | + { | ||
| 937 | + do: { | ||
| 938 | + method: 'GET' | ||
| 939 | + } | ||
| 940 | + } | ||
| 941 | + ) | ||
| 942 | + }, | ||
| 943 | + | ||
| 944 | + cde1: { // 车辆设备启用日期验证 | ||
| 945 | + template: {'xl_eq': -1, 'cl_eq': -1, 'qyrq_eq': 1}, // 日期毫秒 | ||
| 946 | + remote: $resource( // $resource封装对象 | ||
| 947 | + '/cde_sc/validate_qyrq', | ||
| 948 | + {}, | ||
| 949 | + { | ||
| 950 | + do: { | ||
| 951 | + method: 'GET' | ||
| 952 | + } | ||
| 953 | + } | ||
| 954 | + ) | ||
| 955 | + }, | ||
| 956 | + ttc1: { // 时刻表名字验证 | ||
| 957 | + template: {'xl.id_eq': -1, 'name_eq': 'ddd'}, | ||
| 958 | + remote: $resource( // $resource封装对象 | ||
| 959 | + '/tic/validate/equale', | ||
| 960 | + {}, | ||
| 961 | + { | ||
| 962 | + do: { | ||
| 963 | + method: 'GET' | ||
| 964 | + } | ||
| 965 | + } | ||
| 966 | + ) | ||
| 967 | + }, | ||
| 968 | + sheet: { // 时刻表sheet工作区验证 | ||
| 969 | + template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''}, | ||
| 970 | + remote: $resource( // $resource封装对象 | ||
| 971 | + '/tidc/validate/sheet', | ||
| 972 | + {}, | ||
| 973 | + { | ||
| 974 | + do: { | ||
| 975 | + method: 'POST', | ||
| 976 | + headers: { | ||
| 977 | + 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 978 | + }, | ||
| 979 | + transformRequest: function(obj) { | ||
| 980 | + var str = []; | ||
| 981 | + for (var p in obj) { | ||
| 982 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 983 | + } | ||
| 984 | + return str.join("&"); | ||
| 985 | + } | ||
| 986 | + } | ||
| 987 | + } | ||
| 988 | + ) | ||
| 989 | + }, | ||
| 990 | + sheetli: { // 时刻表线路标准验证 | ||
| 991 | + template: {'lineinfoid': -1}, | ||
| 992 | + remote: $resource( // $resource封装对象 | ||
| 993 | + '/tidc/validate/lineinfo', | ||
| 994 | + {}, | ||
| 995 | + { | ||
| 996 | + do: { | ||
| 997 | + method: 'GET' | ||
| 998 | + } | ||
| 999 | + } | ||
| 1000 | + ) | ||
| 1001 | + } | ||
| 1002 | + } | ||
| 1003 | + | ||
| 1004 | + //validate: $resource( | ||
| 1005 | + // '/cars/validate/:type', | ||
| 1006 | + // {}, | ||
| 1007 | + // { | ||
| 1008 | + // insideCode: { | ||
| 1009 | + // method: 'GET' | ||
| 1010 | + // } | ||
| 1011 | + // } | ||
| 1012 | + //) | ||
| 1013 | + | ||
| 1014 | + | ||
| 1015 | + | ||
| 1016 | + } | ||
| 1017 | +}]); | ||
| 1018 | + | ||
| 1019 | + |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/edit.html
| @@ -135,17 +135,18 @@ | @@ -135,17 +135,18 @@ | ||
| 135 | <div class="form-group has-success has-feedback"> | 135 | <div class="form-group has-success has-feedback"> |
| 136 | <label class="col-md-2 control-label">停车场*:</label> | 136 | <label class="col-md-2 control-label">停车场*:</label> |
| 137 | <div class="col-md-3"> | 137 | <div class="col-md-3"> |
| 138 | - <sa-Select3 model="ctrl.busConfigForSave" | ||
| 139 | - name="tcd" | ||
| 140 | - placeholder="请输拼音..." | ||
| 141 | - dcvalue="{{ctrl.busConfigForSave.tcd}}" | 138 | + <sa-Select5 name="tcd" |
| 139 | + model="ctrl.busConfigForSave" | ||
| 140 | + cmaps="{'tcd': 'parkName'}" | ||
| 142 | dcname="tcd" | 141 | dcname="tcd" |
| 143 | icname="parkName" | 142 | icname="parkName" |
| 144 | - icnames="parkName" | ||
| 145 | - datatype="tcc" | ||
| 146 | - mlp="true" | 143 | + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}" |
| 144 | + iterobjname="item" | ||
| 145 | + iterobjexp="item.parkName" | ||
| 146 | + searchph="请输拼音..." | ||
| 147 | + searchexp="this.parkName" | ||
| 147 | required > | 148 | required > |
| 148 | - </sa-Select3> | 149 | + </sa-Select5> |
| 149 | </div> | 150 | </div> |
| 150 | <!-- 隐藏块,显示验证信息 --> | 151 | <!-- 隐藏块,显示验证信息 --> |
| 151 | <div class="alert alert-danger well-sm" ng-show="myForm.tcd.$error.required"> | 152 | <div class="alert alert-danger well-sm" ng-show="myForm.tcd.$error.required"> |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/form.html
| @@ -79,7 +79,7 @@ | @@ -79,7 +79,7 @@ | ||
| 79 | <input type="hidden" name="cl_h" ng-model="ctrl.busConfigForSave.cl.id" | 79 | <input type="hidden" name="cl_h" ng-model="ctrl.busConfigForSave.cl.id" |
| 80 | remote-Validation | 80 | remote-Validation |
| 81 | remotevtype="cc_cars" | 81 | remotevtype="cc_cars" |
| 82 | - remotevparam="{{ {'id_eq': ctrl.busConfigForSave.id, 'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}" | 82 | + remotevparam="{{ {'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}" |
| 83 | /> | 83 | /> |
| 84 | </div> | 84 | </div> |
| 85 | <!-- 隐藏块,显示验证信息 --> | 85 | <!-- 隐藏块,显示验证信息 --> |
| @@ -135,17 +135,18 @@ | @@ -135,17 +135,18 @@ | ||
| 135 | <div class="form-group has-success has-feedback"> | 135 | <div class="form-group has-success has-feedback"> |
| 136 | <label class="col-md-2 control-label">停车场*:</label> | 136 | <label class="col-md-2 control-label">停车场*:</label> |
| 137 | <div class="col-md-3"> | 137 | <div class="col-md-3"> |
| 138 | - <sa-Select3 model="ctrl.busConfigForSave" | ||
| 139 | - name="tcd" | ||
| 140 | - placeholder="请输拼音..." | ||
| 141 | - dcvalue="{{ctrl.busConfigForSave.tcd}}" | 138 | + <sa-Select5 name="tcd" |
| 139 | + model="ctrl.busConfigForSave" | ||
| 140 | + cmaps="{'tcd': 'parkName'}" | ||
| 142 | dcname="tcd" | 141 | dcname="tcd" |
| 143 | icname="parkName" | 142 | icname="parkName" |
| 144 | - icnames="parkName" | ||
| 145 | - datatype="tcc" | ||
| 146 | - mlp="true" | 143 | + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}" |
| 144 | + iterobjname="item" | ||
| 145 | + iterobjexp="item.parkName" | ||
| 146 | + searchph="请输拼音..." | ||
| 147 | + searchexp="this.parkName" | ||
| 147 | required > | 148 | required > |
| 148 | - </sa-Select3> | 149 | + </sa-Select5> |
| 149 | </div> | 150 | </div> |
| 150 | <!-- 隐藏块,显示验证信息 --> | 151 | <!-- 隐藏块,显示验证信息 --> |
| 151 | <div class="alert alert-danger well-sm" ng-show="myForm.tcd.$error.required"> | 152 | <div class="alert alert-danger well-sm" ng-show="myForm.tcd.$error.required"> |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/module.js
| @@ -222,17 +222,10 @@ angular.module('ScheduleApp').controller( | @@ -222,17 +222,10 @@ angular.module('ScheduleApp').controller( | ||
| 222 | 222 | ||
| 223 | // 提交方法 | 223 | // 提交方法 |
| 224 | self.submit = function() { | 224 | self.submit = function() { |
| 225 | - if (id) { | ||
| 226 | - // 更新 | ||
| 227 | - self.busConfigForSave.$save({id: id}, function() { | ||
| 228 | - $state.go("busConfig"); | ||
| 229 | - }); | ||
| 230 | - } else { | ||
| 231 | - // 保存 | ||
| 232 | - self.busConfigForSave.$save(function() { | ||
| 233 | - $state.go("busConfig"); | ||
| 234 | - }); | ||
| 235 | - } | 225 | + // 保存或者更新 |
| 226 | + self.busConfigForSave.$save(function() { | ||
| 227 | + $state.go("busConfig"); | ||
| 228 | + }); | ||
| 236 | }; | 229 | }; |
| 237 | }]); | 230 | }]); |
| 238 | 231 |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/service.js
| @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', functi | @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', functi | ||
| 3 | return { | 3 | return { |
| 4 | rest : $resource( | 4 | rest : $resource( |
| 5 | '/cci/:id', | 5 | '/cci/:id', |
| 6 | - {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'}, | 6 | + {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id'}, |
| 7 | { | 7 | { |
| 8 | list: { | 8 | list: { |
| 9 | method: 'GET', | 9 | method: 'GET', |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/form.html
| @@ -92,7 +92,7 @@ | @@ -92,7 +92,7 @@ | ||
| 92 | <input type="hidden" name="jsy_h" ng-model="ctrl.employeeConfigForSave.jsy.id" | 92 | <input type="hidden" name="jsy_h" ng-model="ctrl.employeeConfigForSave.jsy.id" |
| 93 | remote-Validation | 93 | remote-Validation |
| 94 | remotevtype="ec_jsy" | 94 | remotevtype="ec_jsy" |
| 95 | - remotevparam="{{ {'id_eq': ctrl.employeeConfigForSave.id, 'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.jsy.id} | json}}" | 95 | + remotevparam="{{ {'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.jsy.id} | json}}" |
| 96 | /> | 96 | /> |
| 97 | </div> | 97 | </div> |
| 98 | <!-- 隐藏块,显示验证信息 --> | 98 | <!-- 隐藏块,显示验证信息 --> |
| @@ -122,7 +122,7 @@ | @@ -122,7 +122,7 @@ | ||
| 122 | <input type="hidden" name="spy_h" ng-model="ctrl.employeeConfigForSave.spy.id" | 122 | <input type="hidden" name="spy_h" ng-model="ctrl.employeeConfigForSave.spy.id" |
| 123 | remote-Validation | 123 | remote-Validation |
| 124 | remotevtype="ec_spy" | 124 | remotevtype="ec_spy" |
| 125 | - remotevparam="{{ {'id_eq': ctrl.employeeConfigForSave.id, 'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'spy.id_eq': ctrl.employeeConfigForSave.spy.id} | json}}" | 125 | + remotevparam="{{ {'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'spy.id_eq': ctrl.employeeConfigForSave.spy.id} | json}}" |
| 126 | /> | 126 | /> |
| 127 | </div> | 127 | </div> |
| 128 | <!-- 隐藏块,显示验证信息 --> | 128 | <!-- 隐藏块,显示验证信息 --> |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/module.js
| @@ -220,17 +220,10 @@ angular.module('ScheduleApp').controller( | @@ -220,17 +220,10 @@ angular.module('ScheduleApp').controller( | ||
| 220 | self.employeeConfigForSave.spy = null; | 220 | self.employeeConfigForSave.spy = null; |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | - if (id) { | ||
| 224 | - // 更新 | ||
| 225 | - self.employeeConfigForSave.$save({id: id}, function() { | ||
| 226 | - $state.go("employeeConfig"); | ||
| 227 | - }); | ||
| 228 | - } else { | ||
| 229 | - // 保存 | ||
| 230 | - self.employeeConfigForSave.$save(function() { | ||
| 231 | - $state.go("employeeConfig"); | ||
| 232 | - }); | ||
| 233 | - } | 223 | + // 保存或更新 |
| 224 | + self.employeeConfigForSave.$save(function() { | ||
| 225 | + $state.go("employeeConfig"); | ||
| 226 | + }); | ||
| 234 | }; | 227 | }; |
| 235 | }]); | 228 | }]); |
| 236 | 229 |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/service.js
| @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', f | @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', f | ||
| 3 | return { | 3 | return { |
| 4 | rest : $resource( | 4 | rest : $resource( |
| 5 | '/eci/:id', | 5 | '/eci/:id', |
| 6 | - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'}, | 6 | + {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id'}, |
| 7 | { | 7 | { |
| 8 | list: { | 8 | list: { |
| 9 | method: 'GET', | 9 | method: 'GET', |
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/form.html
| @@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
| 63 | name="lpNo" placeholder="请输入路牌编号..." min="1" required | 63 | name="lpNo" placeholder="请输入路牌编号..." min="1" required |
| 64 | remote-Validation | 64 | remote-Validation |
| 65 | remotevtype="gbv1" | 65 | remotevtype="gbv1" |
| 66 | - remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}" | 66 | + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}" |
| 67 | 67 | ||
| 68 | /> | 68 | /> |
| 69 | </div> | 69 | </div> |
| @@ -85,7 +85,7 @@ | @@ -85,7 +85,7 @@ | ||
| 85 | name="lpName" placeholder="请输入路牌名字..." required | 85 | name="lpName" placeholder="请输入路牌名字..." required |
| 86 | remote-Validation | 86 | remote-Validation |
| 87 | remotevtype="gbv2" | 87 | remotevtype="gbv2" |
| 88 | - remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}" | 88 | + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}" |
| 89 | 89 | ||
| 90 | /> | 90 | /> |
| 91 | </div> | 91 | </div> |
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/list.html
| @@ -77,8 +77,8 @@ | @@ -77,8 +77,8 @@ | ||
| 77 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | 77 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> |
| 78 | <a ui-sref="guideboardManage_detail({id : info.id})" class="btn btn-info btn-sm"> 详细 </a> | 78 | <a ui-sref="guideboardManage_detail({id : info.id})" class="btn btn-info btn-sm"> 详细 </a> |
| 79 | <a ui-sref="guideboardManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> | 79 | <a ui-sref="guideboardManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> |
| 80 | - <a ng-click="ctrl.toggleCancel(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a> | ||
| 81 | - <a ng-click="ctrl.toggleCancel(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> | 80 | + <a ng-click="ctrl.toggleGuideboard(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a> |
| 81 | + <a ng-click="ctrl.toggleGuideboard(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> | ||
| 82 | </td> | 82 | </td> |
| 83 | </tr> | 83 | </tr> |
| 84 | </tbody> | 84 | </tbody> |
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/module.js
| @@ -180,18 +180,8 @@ angular.module('ScheduleApp').controller( | @@ -180,18 +180,8 @@ angular.module('ScheduleApp').controller( | ||
| 180 | service.getPage(result); | 180 | service.getPage(result); |
| 181 | }); | 181 | }); |
| 182 | }; | 182 | }; |
| 183 | - self.toggleTtinfo = function(id) { | ||
| 184 | - Gb.delete({id: id}, function(result) { | ||
| 185 | - if (result.message) { // 暂时这样做,之后全局拦截 | ||
| 186 | - alert("失败:" + result.message); | ||
| 187 | - } else { | ||
| 188 | - self.doPage(); | ||
| 189 | - } | ||
| 190 | - }); | ||
| 191 | - }; | ||
| 192 | - | ||
| 193 | // 作废切换 | 183 | // 作废切换 |
| 194 | - self.toggleCancel = function(id) { | 184 | + self.toggleGuideboard = function(id) { |
| 195 | Gb.delete({id: id}, function(result) { | 185 | Gb.delete({id: id}, function(result) { |
| 196 | if (result.status == "ERROR") { // 暂时这样做,之后全局拦截 | 186 | if (result.status == "ERROR") { // 暂时这样做,之后全局拦截 |
| 197 | alert("失败:" + result.msg); | 187 | alert("失败:" + result.msg); |
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/service.js
| @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', | @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', | ||
| 3 | return { | 3 | return { |
| 4 | rest: $resource( | 4 | rest: $resource( |
| 5 | '/gic/:id', | 5 | '/gic/:id', |
| 6 | - {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id_route'}, | 6 | + {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id'}, |
| 7 | { | 7 | { |
| 8 | list: { | 8 | list: { |
| 9 | method: 'GET', | 9 | method: 'GET', |
src/main/resources/static/real_control_v2/css/ct_table.css
src/main/resources/static/real_control_v2/css/line_schedule.css
| @@ -943,4 +943,73 @@ input.i-cbox[type=checkbox]{ | @@ -943,4 +943,73 @@ input.i-cbox[type=checkbox]{ | ||
| 943 | 943 | ||
| 944 | .fixed_legend .tl-qrlb::before{ | 944 | .fixed_legend .tl-qrlb::before{ |
| 945 | font-size: 12px; | 945 | font-size: 12px; |
| 946 | +} | ||
| 947 | + | ||
| 948 | +.schedule-body .ct_table dl.dl-last-sch{ | ||
| 949 | + height: 55px; | ||
| 950 | +} | ||
| 951 | + | ||
| 952 | +.schedule-body .ct_table dl.dl-last-sch dd{ | ||
| 953 | + line-height: 55px; | ||
| 954 | +} | ||
| 955 | + | ||
| 956 | +.schedule-body .ct_table dl.dl-last-sch dd.fcsjActualCell{ | ||
| 957 | + line-height: 28px; | ||
| 958 | +} | ||
| 959 | + | ||
| 960 | +dd.fcsjActualCell div.last-sch-sunken{ | ||
| 961 | + height: 25px; | ||
| 962 | + line-height: 25px; | ||
| 963 | + margin: 0; | ||
| 964 | + background: #fff; | ||
| 965 | + /*border-top: 1px solid #eeeeee;*/ | ||
| 966 | +} | ||
| 967 | + | ||
| 968 | +dd.fcsjActualCell div.last-sch-sunken span._badge{ | ||
| 969 | + font-size: 12px; | ||
| 970 | + border-radius: 0 7px 7px 0; | ||
| 971 | + padding-left: 0; | ||
| 972 | + width: 29px; | ||
| 973 | + display: inline-block; | ||
| 974 | + height: 18px; | ||
| 975 | + line-height: 18px; | ||
| 976 | + box-shadow: 2px 0px 2px 0 rgba(0,0,0,0.16), 2px 0px 4px 0 rgba(0,0,0,0.12); | ||
| 977 | + vertical-align: top; | ||
| 978 | + margin-right: 3px; | ||
| 979 | + margin-top: 3px; | ||
| 980 | + margin-left: -7px; | ||
| 981 | + text-indent: 2px; | ||
| 982 | + border-left: 0; | ||
| 983 | + transform: scale(.9); | ||
| 984 | + color: grey; | ||
| 985 | +} | ||
| 986 | + | ||
| 987 | +.relevance-active dd.fcsjActualCell div.last-sch-sunken{ | ||
| 988 | + background: #f1efef; | ||
| 989 | +} | ||
| 990 | + | ||
| 991 | +.intimity.relevance-active dd.fcsjActualCell div.last-sch-sunken{ | ||
| 992 | + background: #76a6c7 !important; | ||
| 993 | + border-top: 1px solid #f7f8f8 !important; | ||
| 994 | + color: #f8f8f8; | ||
| 995 | +} | ||
| 996 | + | ||
| 997 | +.intimity.relevance-active dd.fcsjActualCell div.last-sch-sunken span._badge{ | ||
| 998 | + background: #76a6c7 ; | ||
| 999 | + color: #ffffff ; | ||
| 1000 | +} | ||
| 1001 | + | ||
| 1002 | +.drag-active dd.fcsjActualCell div.last-sch-sunken{ | ||
| 1003 | + background: #cef9e3 !important; | ||
| 1004 | + border-top: 1px solid #d9e6e0 !important; | ||
| 1005 | +} | ||
| 1006 | + | ||
| 1007 | +.drag-active dd.fcsjActualCell div.last-sch-sunken span._badge{ | ||
| 1008 | + color: #6e6969; | ||
| 1009 | + background: #cef9e3; | ||
| 1010 | +} | ||
| 1011 | + | ||
| 1012 | +.ct_table>.ct_table_body dl.dl-last-sch:hover div.last-sch-sunken, | ||
| 1013 | +.ct_table>.ct_table_body dl.dl-last-sch.context-menu-active div.last-sch-sunken{ | ||
| 1014 | + background: #f5fbff; | ||
| 946 | } | 1015 | } |
| 947 | \ No newline at end of file | 1016 | \ No newline at end of file |
src/main/resources/static/real_control_v2/css/main.css
| @@ -369,4 +369,32 @@ li.map-panel{ | @@ -369,4 +369,32 @@ li.map-panel{ | ||
| 369 | .ct-bottom-drawer-body{ | 369 | .ct-bottom-drawer-body{ |
| 370 | width: 100%; | 370 | width: 100%; |
| 371 | height: 100%; | 371 | height: 100%; |
| 372 | +} | ||
| 373 | + | ||
| 374 | +#station_route_spacing_chart_drawer .svg_wrap{ | ||
| 375 | + width: 80%;height: 100%;display: inline-block;font-size: 14px;overflow: hidden; | ||
| 376 | + position: relative; | ||
| 377 | +} | ||
| 378 | + | ||
| 379 | +#station_route_spacing_chart_drawer .drawer_right_map{ | ||
| 380 | + width: 20%;height: 100%;display: inline-block; | ||
| 381 | +} | ||
| 382 | + | ||
| 383 | +#station_route_spacing_chart_drawer .svg_cont_body{ | ||
| 384 | + height:100%; | ||
| 385 | + position: absolute; | ||
| 386 | + top:0; | ||
| 387 | + left: 0; | ||
| 388 | +} | ||
| 389 | + | ||
| 390 | +#station_route_spacing_chart_drawer svg{ | ||
| 391 | + width: 100%; | ||
| 392 | + height: 100%; | ||
| 393 | +} | ||
| 394 | + | ||
| 395 | +#station_route_spacing_chart_drawer svg g._item rect{ | ||
| 396 | + stroke: rgb(62, 80, 179); | ||
| 397 | + fill: rgb(62, 80, 179); | ||
| 398 | + width: 30px; | ||
| 399 | + height: 140px; | ||
| 372 | } | 400 | } |
| 373 | \ No newline at end of file | 401 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
| @@ -322,7 +322,8 @@ | @@ -322,7 +322,8 @@ | ||
| 322 | name: "添加子任务", | 322 | name: "添加子任务", |
| 323 | items: { | 323 | items: { |
| 324 | 'add_sub_task_in': { | 324 | 'add_sub_task_in': { |
| 325 | - name: '回场' | 325 | + name: '回场', |
| 326 | + disabled: true | ||
| 326 | }, | 327 | }, |
| 327 | 'add_sub_task_out': { | 328 | 'add_sub_task_out': { |
| 328 | name: '出场', | 329 | name: '出场', |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html
| 1 | <!-- 站点路由间距图 --> | 1 | <!-- 站点路由间距图 --> |
| 2 | <div id="station_route_spacing_chart_drawer" style="width: 100%;height: 100%;font-size: 0;"> | 2 | <div id="station_route_spacing_chart_drawer" style="width: 100%;height: 100%;font-size: 0;"> |
| 3 | - <div style="width: 80%;height: 100%;display: inline-block;font-size: 14px;" class="svg_wrap"> | 3 | + <div class="svg_wrap"></div> |
| 4 | 4 | ||
| 5 | - </div> | ||
| 6 | - | ||
| 7 | - <div style="width: 20%;height: 100%;display: inline-block;"> | 5 | + <div class="drawer_right_map" > |
| 8 | 6 | ||
| 9 | </div> | 7 | </div> |
| 10 | 8 | ||
| @@ -12,10 +10,10 @@ | @@ -12,10 +10,10 @@ | ||
| 12 | 10 | ||
| 13 | (function () { | 11 | (function () { |
| 14 | var drawer = '#station_route_spacing_chart_drawer' | 12 | var drawer = '#station_route_spacing_chart_drawer' |
| 15 | - , sch, locData; | 13 | + , sch, locData, stationArr; |
| 16 | 14 | ||
| 15 | + //var xScale; | ||
| 17 | $(drawer).on('drawer-init', function (e, data) { | 16 | $(drawer).on('drawer-init', function (e, data) { |
| 18 | - //console.log('data', data); | ||
| 19 | sch = data.sch; | 17 | sch = data.sch; |
| 20 | locData = window.localStorage.getItem('control_route_distance_' + sch.xlBm); | 18 | locData = window.localStorage.getItem('control_route_distance_' + sch.xlBm); |
| 21 | 19 | ||
| @@ -26,19 +24,42 @@ | @@ -26,19 +24,42 @@ | ||
| 26 | }); | 24 | }); |
| 27 | 25 | ||
| 28 | function drawCharts() { | 26 | function drawCharts() { |
| 29 | - //console.log('开始绘图', locData); | ||
| 30 | - var stations; | ||
| 31 | try { | 27 | try { |
| 32 | - stations = JSON.parse(locData).stations[sch.xlDir == 0 ? 'up' : 'down']; | 28 | + stationArr = JSON.parse(locData).stations[sch.xlDir == 0 ? 'up' : 'down']; |
| 33 | }catch (e){ | 29 | }catch (e){ |
| 34 | alert('数据异常!!'); | 30 | alert('数据异常!!'); |
| 35 | return; | 31 | return; |
| 36 | } | 32 | } |
| 37 | 33 | ||
| 38 | - console.log('stations..', stations); | ||
| 39 | - //$('.svg_wrap', drawer). | 34 | + var width = 1500; |
| 35 | + var svgCont = $('<div style="width: '+width+'px;" class="svg_cont_body"></div>'); | ||
| 36 | + var svg = d3.select(svgCont[0]).append('svg'); | ||
| 37 | + | ||
| 38 | + //初始化 X 比例尺 | ||
| 39 | + var sum=0; | ||
| 40 | + $.each(stationArr, function () { | ||
| 41 | + sum += this.toDistance; | ||
| 42 | + }); | ||
| 43 | + | ||
| 44 | + console.log('stations', stationArr); | ||
| 45 | + var items = svg.selectAll('g._item').data(stationArr) | ||
| 46 | + .enter() | ||
| 47 | + .append('g') | ||
| 48 | + .classed({_item: true}); | ||
| 49 | + | ||
| 50 | + //rect | ||
| 51 | + items.append('rect').attr('x', xScale).attr('y', 40); | ||
| 52 | + $('.svg_wrap', drawer).append(svgCont); | ||
| 40 | } | 53 | } |
| 41 | 54 | ||
| 55 | + var xScale = function (d, i) { | ||
| 56 | + var sum=0; | ||
| 57 | + for(var j = 0; j <= i; j++){ | ||
| 58 | + sum+=stationArr[j].toDistance; | ||
| 59 | + } | ||
| 60 | + return sum / 5; | ||
| 61 | + }; | ||
| 62 | + | ||
| 42 | //页面切换 | 63 | //页面切换 |
| 43 | function drawerLoadPage(url, id) { | 64 | function drawerLoadPage(url, id) { |
| 44 | $(drawer).parent('.ct-bottom-drawer-body').load(url, function () { | 65 | $(drawer).parent('.ct-bottom-drawer-body').load(url, function () { |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| @@ -7,10 +7,9 @@ | @@ -7,10 +7,9 @@ | ||
| 7 | {{else}} | 7 | {{else}} |
| 8 | 下行/{{line.endStationName}} | 8 | 下行/{{line.endStationName}} |
| 9 | {{/if}} | 9 | {{/if}} |
| 10 | - <i class="uk-icon-question-circle" ></i> | 10 | + <i class="uk-icon-question-circle"></i> |
| 11 | <div class="fixed_legend"> | 11 | <div class="fixed_legend"> |
| 12 | <div> | 12 | <div> |
| 13 | - <!--<i class="uk-icon-angle-right" ></i>--> | ||
| 14 | <span class="tl-xxfc">消息发出</span> | 13 | <span class="tl-xxfc">消息发出</span> |
| 15 | <span class="tl-xxsd">消息收到</span> | 14 | <span class="tl-xxsd">消息收到</span> |
| 16 | <span class="tl-xxrd">消息阅读</span> | 15 | <span class="tl-xxrd">消息阅读</span> |
| @@ -54,7 +53,7 @@ | @@ -54,7 +53,7 @@ | ||
| 54 | </div> | 53 | </div> |
| 55 | <div class="ct_table_body"> | 54 | <div class="ct_table_body"> |
| 56 | {{each list as sch i}} | 55 | {{each list as sch i}} |
| 57 | - <dl data-id="{{sch.id}}" > | 56 | + <dl data-id="{{sch.id}}"> |
| 58 | <dd class="seq_no">{{i + 1}}</dd> | 57 | <dd class="seq_no">{{i + 1}}</dd> |
| 59 | <dd class="lpName"><a>{{sch.lpName}}</a></dd> | 58 | <dd class="lpName"><a>{{sch.lpName}}</a></dd> |
| 60 | <dd data-nbbm="{{sch.clZbh}}" | 59 | <dd data-nbbm="{{sch.clZbh}}" |
| @@ -81,7 +80,9 @@ | @@ -81,7 +80,9 @@ | ||
| 81 | <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | 80 | <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> |
| 82 | {{/if}} | 81 | {{/if}} |
| 83 | </dd> | 82 | </dd> |
| 84 | - <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}">{{sch.dfsj}}</dd> | 83 | + <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}"> |
| 84 | + {{sch.dfsj}} | ||
| 85 | + </dd> | ||
| 85 | <dd class=" | 86 | <dd class=" |
| 86 | {{if sch.status==-1}} | 87 | {{if sch.status==-1}} |
| 87 | tl-qrlb | 88 | tl-qrlb |
| @@ -91,11 +92,12 @@ | @@ -91,11 +92,12 @@ | ||
| 91 | tl-zzzx | 92 | tl-zzzx |
| 92 | {{else if sch.status == 0 && sch.late}} | 93 | {{else if sch.status == 0 && sch.late}} |
| 93 | tl-wd | 94 | tl-wd |
| 94 | - {{/if}} fcsjActualCell" > | 95 | + {{/if}} fcsjActualCell"> |
| 95 | {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span> | 96 | {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span> |
| 96 | </dd> | 97 | </dd> |
| 97 | <dd data-uk-observe> | 98 | <dd data-uk-observe> |
| 98 | - <span title="{{sch.remarks}}" data-uk-tooltip="{pos:'top-left'}" >{{sch.remarks}}</span> | 99 | + <span title="{{sch.remarks}}" |
| 100 | + data-uk-tooltip="{pos:'top-left'}">{{sch.remarks}}</span> | ||
| 99 | </dd> | 101 | </dd> |
| 100 | </dl> | 102 | </dl> |
| 101 | {{/each}} | 103 | {{/each}} |
| @@ -128,7 +130,7 @@ | @@ -128,7 +130,7 @@ | ||
| 128 | </script> | 130 | </script> |
| 129 | 131 | ||
| 130 | <script id="line-schedule-sfsj-temp" type="text/html"> | 132 | <script id="line-schedule-sfsj-temp" type="text/html"> |
| 131 | - <dd class=" | 133 | + <dd class=" |
| 132 | {{if status==-1}} | 134 | {{if status==-1}} |
| 133 | tl-qrlb | 135 | tl-qrlb |
| 134 | {{else if status==2}} | 136 | {{else if status==2}} |
| @@ -138,8 +140,8 @@ | @@ -138,8 +140,8 @@ | ||
| 138 | {{else if status == 0 && late}} | 140 | {{else if status == 0 && late}} |
| 139 | tl-wd | 141 | tl-wd |
| 140 | {{/if}} fcsjActualCell"> | 142 | {{/if}} fcsjActualCell"> |
| 141 | - {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span> | ||
| 142 | - </dd> | 143 | + {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span> |
| 144 | + </dd> | ||
| 143 | </script> | 145 | </script> |
| 144 | 146 | ||
| 145 | <script id="line-schedule-nbbm-temp" type="text/html"> | 147 | <script id="line-schedule-nbbm-temp" type="text/html"> |
| @@ -162,4 +164,10 @@ | @@ -162,4 +164,10 @@ | ||
| 162 | <li><span>终点站:</span>{{zdzName}}</li> | 164 | <li><span>终点站:</span>{{zdzName}}</li> |
| 163 | </ul> | 165 | </ul> |
| 164 | </script> | 166 | </script> |
| 167 | + | ||
| 168 | + <script id="last-sch-sunken-temp" type="text/html"> | ||
| 169 | + <div class="last-sch-sunken"> | ||
| 170 | + <span class="_badge">终点</span>{{zdsj}}/{{zdsjActual}} | ||
| 171 | + </div> | ||
| 172 | + </script> | ||
| 165 | </div> | 173 | </div> |
src/main/resources/static/real_control_v2/js/line_schedule/legend.js
| @@ -2,14 +2,16 @@ | @@ -2,14 +2,16 @@ | ||
| 2 | 2 | ||
| 3 | var gb_sch_legend = (function () { | 3 | var gb_sch_legend = (function () { |
| 4 | 4 | ||
| 5 | + var locaKey = 'sch_legend_flag'; | ||
| 6 | + var storage = window.localStorage; | ||
| 5 | 7 | ||
| 6 | var animationend = 'webkitAnimationEnd animationend'; | 8 | var animationend = 'webkitAnimationEnd animationend'; |
| 7 | - var initLegend = function () { | 9 | + var initLegend = function (cont) { |
| 8 | //双击展开 | 10 | //双击展开 |
| 9 | - $('.schedule-wrap i.uk-icon-question-circle').dblclick(openLegend); | 11 | + $('.schedule-wrap i.uk-icon-question-circle', cont).dblclick(openLegend); |
| 10 | 12 | ||
| 11 | //关闭事件 | 13 | //关闭事件 |
| 12 | - $('.schedule-wrap .fixed_legend_close').on('click', function () { | 14 | + $('.schedule-wrap .fixed_legend_close', cont).on('click', function () { |
| 13 | //隐藏 fixed_legend | 15 | //隐藏 fixed_legend |
| 14 | $('.schedule-wrap .fixed_legend').each(function () { | 16 | $('.schedule-wrap .fixed_legend').each(function () { |
| 15 | var anim = 'uk-animation-slide-top uk-animation-reverse'; | 17 | var anim = 'uk-animation-slide-top uk-animation-reverse'; |
| @@ -26,7 +28,14 @@ var gb_sch_legend = (function () { | @@ -26,7 +28,14 @@ var gb_sch_legend = (function () { | ||
| 26 | $(this).hide().parents('.header-title').find('.uk-icon-question-circle').show(); | 28 | $(this).hide().parents('.header-title').find('.uk-icon-question-circle').show(); |
| 27 | } | 29 | } |
| 28 | }); | 30 | }); |
| 31 | + | ||
| 32 | + //记录状态 | ||
| 33 | + storage.setItem(locaKey, 0); | ||
| 29 | }); | 34 | }); |
| 35 | + | ||
| 36 | + var flag=storage.getItem(locaKey); | ||
| 37 | + if(flag && flag==1) | ||
| 38 | + openLegend(); | ||
| 30 | }; | 39 | }; |
| 31 | 40 | ||
| 32 | 41 | ||
| @@ -47,6 +56,9 @@ var gb_sch_legend = (function () { | @@ -47,6 +56,9 @@ var gb_sch_legend = (function () { | ||
| 47 | } | 56 | } |
| 48 | }); | 57 | }); |
| 49 | $('.schedule-wrap .fixed_legend').css('display', 'inline-block'); | 58 | $('.schedule-wrap .fixed_legend').css('display', 'inline-block'); |
| 59 | + | ||
| 60 | + //记录状态 | ||
| 61 | + storage.setItem(locaKey, 1); | ||
| 50 | }; | 62 | }; |
| 51 | 63 | ||
| 52 | return { | 64 | return { |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| @@ -56,6 +56,11 @@ var gb_schedule_table = (function () { | @@ -56,6 +56,11 @@ var gb_schedule_table = (function () { | ||
| 56 | 56 | ||
| 57 | $('.schedule-wrap .card-panel:eq(' + upDown + ')', this).html(htmlStr); | 57 | $('.schedule-wrap .card-panel:eq(' + upDown + ')', this).html(htmlStr); |
| 58 | } | 58 | } |
| 59 | + | ||
| 60 | + //标记车辆最后一个班次 | ||
| 61 | + markerLastByLine(lineCode); | ||
| 62 | + //初始化图例相关,dbclick 不能代理事件 | ||
| 63 | + gb_sch_legend.init(this); | ||
| 59 | }); | 64 | }); |
| 60 | var content = $('.line_schedule .ct_table_wrap'); | 65 | var content = $('.line_schedule .ct_table_wrap'); |
| 61 | //fixed table head | 66 | //fixed table head |
| @@ -67,9 +72,6 @@ var gb_schedule_table = (function () { | @@ -67,9 +72,6 @@ var gb_schedule_table = (function () { | ||
| 67 | //点击实发,show detail | 72 | //点击实发,show detail |
| 68 | fcsjActualCellQtip(); | 73 | fcsjActualCellQtip(); |
| 69 | cb && cb(); | 74 | cb && cb(); |
| 70 | - | ||
| 71 | - //图例相关 | ||
| 72 | - gb_sch_legend.init(); | ||
| 73 | }); | 75 | }); |
| 74 | }; | 76 | }; |
| 75 | 77 | ||
| @@ -159,6 +161,11 @@ var gb_schedule_table = (function () { | @@ -159,6 +161,11 @@ var gb_schedule_table = (function () { | ||
| 159 | }); | 161 | }); |
| 160 | $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr); | 162 | $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr); |
| 161 | } | 163 | } |
| 164 | + //图例相关 | ||
| 165 | + gb_sch_legend.init(tabCont); | ||
| 166 | + //标记末班 | ||
| 167 | + markerLastByLine(sch.xlBm); | ||
| 168 | + //计算应发未发 | ||
| 162 | calc_yfwf_num(sch.xlBm); | 169 | calc_yfwf_num(sch.xlBm); |
| 163 | //重新固定表头 | 170 | //重新固定表头 |
| 164 | gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap')); | 171 | gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap')); |
| @@ -184,10 +191,20 @@ var gb_schedule_table = (function () { | @@ -184,10 +191,20 @@ var gb_schedule_table = (function () { | ||
| 184 | if (!isArray(schArr)) | 191 | if (!isArray(schArr)) |
| 185 | schArr = [schArr]; | 192 | schArr = [schArr]; |
| 186 | 193 | ||
| 194 | + var tMaps={}; | ||
| 187 | $.each(schArr, function () { | 195 | $.each(schArr, function () { |
| 188 | line2Schedule[this.xlBm][this.id] = this; | 196 | line2Schedule[this.xlBm][this.id] = this; |
| 189 | updateDom(this); | 197 | updateDom(this); |
| 198 | + //线路_车辆 过滤重复数据 | ||
| 199 | + tMaps[this.xlBm+'_'+this.clZbh]=1; | ||
| 190 | }); | 200 | }); |
| 201 | + | ||
| 202 | + //重新标记末班 | ||
| 203 | + var ts=[]; | ||
| 204 | + for(var k in tMaps){ | ||
| 205 | + ts = k.split('_'); | ||
| 206 | + markerLastByNbbm(ts[0], ts[1]); | ||
| 207 | + } | ||
| 191 | }; | 208 | }; |
| 192 | 209 | ||
| 193 | //update dom | 210 | //update dom |
| @@ -217,6 +234,10 @@ var gb_schedule_table = (function () { | @@ -217,6 +234,10 @@ var gb_schedule_table = (function () { | ||
| 217 | $(dds[8]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>'); | 234 | $(dds[8]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>'); |
| 218 | else | 235 | else |
| 219 | $(dds[8]).html(''); | 236 | $(dds[8]).html(''); |
| 237 | + | ||
| 238 | + //班次是车辆的最后一班 | ||
| 239 | + if(dl.hasClass('dl-last-sch')) | ||
| 240 | + markerLastSch([sch]); | ||
| 220 | }; | 241 | }; |
| 221 | 242 | ||
| 222 | //拖拽选中... | 243 | //拖拽选中... |
| @@ -265,12 +286,14 @@ var gb_schedule_table = (function () { | @@ -265,12 +286,14 @@ var gb_schedule_table = (function () { | ||
| 265 | return item.clZbh == sch.clZbh; | 286 | return item.clZbh == sch.clZbh; |
| 266 | }).sort(schedule_sort), | 287 | }).sort(schedule_sort), |
| 267 | nextSch, tempDL; | 288 | nextSch, tempDL; |
| 289 | + | ||
| 290 | + getDl(sch).addClass('intimity'); | ||
| 268 | $.each(schArr, function (i) { | 291 | $.each(schArr, function (i) { |
| 269 | tempDL = $('dl[data-id=' + this.id + ']', contWrap); | 292 | tempDL = $('dl[data-id=' + this.id + ']', contWrap); |
| 270 | tempDL.addClass('relevance-active'); | 293 | tempDL.addClass('relevance-active'); |
| 271 | if (i < schArr.length - 1 && this.id == id) { | 294 | if (i < schArr.length - 1 && this.id == id) { |
| 272 | nextSch = schArr[i + 1]; | 295 | nextSch = schArr[i + 1]; |
| 273 | - tempDL.addClass('intimity'); | 296 | + //tempDL.addClass('intimity'); |
| 274 | } | 297 | } |
| 275 | }); | 298 | }); |
| 276 | 299 | ||
| @@ -309,7 +332,7 @@ var gb_schedule_table = (function () { | @@ -309,7 +332,7 @@ var gb_schedule_table = (function () { | ||
| 309 | }); | 332 | }); |
| 310 | 333 | ||
| 311 | var scroToDl = function (sch) { | 334 | var scroToDl = function (sch) { |
| 312 | - var dl = $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')), | 335 | + var dl = getDl(sch), |
| 313 | cont = dl.parents('.ct_table_wrap'), | 336 | cont = dl.parents('.ct_table_wrap'), |
| 314 | diff = cont.height() / 2; | 337 | diff = cont.height() / 2; |
| 315 | cont.animate({ | 338 | cont.animate({ |
| @@ -319,6 +342,10 @@ var gb_schedule_table = (function () { | @@ -319,6 +342,10 @@ var gb_schedule_table = (function () { | ||
| 319 | return dl; | 342 | return dl; |
| 320 | }; | 343 | }; |
| 321 | 344 | ||
| 345 | + var getDl = function (sch) { | ||
| 346 | + return $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')); | ||
| 347 | + }; | ||
| 348 | + | ||
| 322 | var reset_drag_active_all = function (dd) { | 349 | var reset_drag_active_all = function (dd) { |
| 323 | $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); | 350 | $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); |
| 324 | reset_relevance_active(dd); | 351 | reset_relevance_active(dd); |
| @@ -355,6 +382,57 @@ var gb_schedule_table = (function () { | @@ -355,6 +382,57 @@ var gb_schedule_table = (function () { | ||
| 355 | $('#badge_yfwf_num_' + lineCode).text(yfwf_num); | 382 | $('#badge_yfwf_num_' + lineCode).text(yfwf_num); |
| 356 | }; | 383 | }; |
| 357 | 384 | ||
| 385 | + //标记终点时间 -线路 | ||
| 386 | + var markerLastByLine = function (lineCode) { | ||
| 387 | + var data = gb_common.groupBy(gb_common.get_vals(line2Schedule[lineCode]).filter(schDestroyFilter), 'clZbh'); | ||
| 388 | + | ||
| 389 | + var array, lastSch, dl; | ||
| 390 | + for (var nbbm in data) { | ||
| 391 | + array = data[nbbm].sort(schedule_sort); | ||
| 392 | + markerLastSch(array); | ||
| 393 | + } | ||
| 394 | + }; | ||
| 395 | + | ||
| 396 | + //标记终点时间 -车辆 | ||
| 397 | + var markerLastByNbbm = function (lineCode, nbbm) { | ||
| 398 | + var array = gb_common.get_vals(line2Schedule[lineCode]).filter(function (a) { | ||
| 399 | + return a.clZbh == nbbm && a.status != -1; | ||
| 400 | + }).sort(schedule_sort); | ||
| 401 | + | ||
| 402 | + removeMarkers(lineCode, array); | ||
| 403 | + markerLastSch(array); | ||
| 404 | + }; | ||
| 405 | + | ||
| 406 | + var markerLastSch = function (array) { | ||
| 407 | + var lastSch = array[array.length - 1]; | ||
| 408 | + | ||
| 409 | + if (!lastSch.jhlc) | ||
| 410 | + return; | ||
| 411 | + | ||
| 412 | + var dl = getDl(lastSch); | ||
| 413 | + dl.addClass('dl-last-sch'); | ||
| 414 | + | ||
| 415 | + $('dd.fcsjActualCell', dl).append(temps['last-sch-sunken-temp'](lastSch)); | ||
| 416 | + } | ||
| 417 | + | ||
| 418 | + //清除线路下指定班次的 末班标记 | ||
| 419 | + var removeMarkers = function (lineCode, array) { | ||
| 420 | + var idx=[]; | ||
| 421 | + $.each(array, function () { | ||
| 422 | + idx.push(this.id); | ||
| 423 | + }); | ||
| 424 | + | ||
| 425 | + $('dl.dl-last-sch','li.line_schedule[data-id=' + lineCode + ']').each(function () { | ||
| 426 | + if($(this).hasClass('dl-last-sch') && idx.indexOf($(this).data('id'))){ | ||
| 427 | + $(this).removeClass('dl-last-sch').find('.last-sch-sunken').remove(); | ||
| 428 | + } | ||
| 429 | + }); | ||
| 430 | + } | ||
| 431 | + | ||
| 432 | + var schDestroyFilter = function (a) { | ||
| 433 | + return a.status != -1; | ||
| 434 | + } | ||
| 435 | + | ||
| 358 | return { | 436 | return { |
| 359 | show: show, | 437 | show: show, |
| 360 | findScheduleByLine: findScheduleByLine, | 438 | findScheduleByLine: findScheduleByLine, |
src/main/resources/static/real_control_v2/js/main.js
| @@ -196,8 +196,8 @@ var open_modal = function(pageUrl, data, opt) { | @@ -196,8 +196,8 @@ var open_modal = function(pageUrl, data, opt) { | ||
| 196 | function showUpdateDescription() { | 196 | function showUpdateDescription() { |
| 197 | //更新说明 | 197 | //更新说明 |
| 198 | var updateDescription={ | 198 | var updateDescription={ |
| 199 | - date: '2016-12-11', | ||
| 200 | - text: '<h5>1、电子路单单击“实发”时,tootip内的人员显示工号。</h5><h5>2、修复某些情况下,班次被操作后 点击“实发” 无法显示tootip的情况。</h5><h5>3、获取GPS数据失败时,页面会弹出提示,并等待7秒后尝试再次获取。</h5>' | 199 | + date: '2016-12-15', |
| 200 | + text: '<h5>1、双击电子路单title右侧 ? 号图标,可将图例固定在上发。</h5><h5>2、每辆车最后一个班次,实发栏会显示计划和实际终点时间。</h5><h5>3、修复了子任务添加1分钟后再删除,弹出完整性约束校验失败 的问题。</h5>' | ||
| 201 | }; | 201 | }; |
| 202 | 202 | ||
| 203 | var storage = window.localStorage | 203 | var storage = window.localStorage |