Commit 2276d32289f236af00bfc49ce51dd7c27eb18ed2
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
# Conflicts: # src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html
Showing
43 changed files
with
1100 additions
and
888 deletions
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
| 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 | -} | 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.schedule.BEntity; | 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; |
| @@ -62,6 +63,27 @@ public class CarDevice extends BEntity { | @@ -62,6 +63,27 @@ public class CarDevice extends BEntity { | ||
| 62 | @Column(nullable = false) | 63 | @Column(nullable = false) |
| 63 | private Boolean isCancel = false; | 64 | private Boolean isCancel = false; |
| 64 | 65 | ||
| 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 | + } | ||
| 86 | + | ||
| 65 | public Long getId() { | 87 | public Long getId() { |
| 66 | return id; | 88 | return id; |
| 67 | } | 89 | } |
src/main/java/com/bsth/entity/schedule/BEntity.java
| 1 | -package com.bsth.entity.schedule; | ||
| 2 | - | ||
| 3 | -import com.bsth.entity.sys.SysUser; | ||
| 4 | - | ||
| 5 | -import javax.persistence.*; | ||
| 6 | -import java.util.Date; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * Created by xu on 16/12/14. | ||
| 10 | - */ | ||
| 11 | -@MappedSuperclass | ||
| 12 | -public class BEntity { | ||
| 13 | - | ||
| 14 | - /** 创建人 */ | ||
| 15 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 16 | - private SysUser createBy; | ||
| 17 | - /** 修改人 */ | ||
| 18 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 19 | - private SysUser updateBy; | ||
| 20 | - | ||
| 21 | - /** 创建日期 */ | ||
| 22 | - @Column(updatable = false, name = "create_date") | ||
| 23 | - private Date createDate; | ||
| 24 | - /** 修改日期 */ | ||
| 25 | - @Column(name = "update_date") | ||
| 26 | - private Date updateDate; | ||
| 27 | - | ||
| 28 | - public SysUser getCreateBy() { | ||
| 29 | - return createBy; | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - public void setCreateBy(SysUser createBy) { | ||
| 33 | - this.createBy = createBy; | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - public SysUser getUpdateBy() { | ||
| 37 | - return updateBy; | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - public void setUpdateBy(SysUser updateBy) { | ||
| 41 | - this.updateBy = updateBy; | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - public Date getCreateDate() { | ||
| 45 | - return createDate; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - public void setCreateDate(Date createDate) { | ||
| 49 | - this.createDate = createDate; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public Date getUpdateDate() { | ||
| 53 | - return updateDate; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - public void setUpdateDate(Date updateDate) { | ||
| 57 | - this.updateDate = updateDate; | ||
| 58 | - } | ||
| 59 | -} | 1 | +package com.bsth.entity.schedule; |
| 2 | + | ||
| 3 | +import com.bsth.entity.sys.SysUser; | ||
| 4 | + | ||
| 5 | +import javax.persistence.*; | ||
| 6 | +import java.util.Date; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * Created by xu on 16/12/14. | ||
| 10 | + */ | ||
| 11 | +@MappedSuperclass | ||
| 12 | +public class BEntity { | ||
| 13 | + | ||
| 14 | + /** 创建人 */ | ||
| 15 | + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 16 | + private SysUser createBy; | ||
| 17 | + /** 修改人 */ | ||
| 18 | + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 19 | + private SysUser updateBy; | ||
| 20 | + | ||
| 21 | + /** 创建日期 */ | ||
| 22 | + @Column(updatable = false, name = "create_date") | ||
| 23 | + private Date createDate; | ||
| 24 | + /** 修改日期 */ | ||
| 25 | + @Column(name = "update_date") | ||
| 26 | + private Date updateDate; | ||
| 27 | + | ||
| 28 | + public SysUser getCreateBy() { | ||
| 29 | + return createBy; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + public void setCreateBy(SysUser createBy) { | ||
| 33 | + this.createBy = createBy; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + public SysUser getUpdateBy() { | ||
| 37 | + return updateBy; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + public void setUpdateBy(SysUser updateBy) { | ||
| 41 | + this.updateBy = updateBy; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + public Date getCreateDate() { | ||
| 45 | + return createDate; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + public void setCreateDate(Date createDate) { | ||
| 49 | + this.createDate = createDate; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + public Date getUpdateDate() { | ||
| 53 | + return updateDate; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + public void setUpdateDate(Date updateDate) { | ||
| 57 | + this.updateDate = updateDate; | ||
| 58 | + } | ||
| 59 | +} |
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>{ |
| @@ -35,11 +33,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -35,11 +33,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 35 | + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName") | 33 | + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName") |
| 36 | List<Map<String, Object>> dailyInfo(String line,String date); | 34 | List<Map<String, Object>> dailyInfo(String line,String date); |
| 37 | 35 | ||
| 38 | - @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,d.sender,d.timestamp," | ||
| 39 | - + " d.txt_content FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 " | ||
| 40 | - + "d ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND " | ||
| 41 | - + " DATE_FORMAT(r.schedule_date,'%Y-%m-%d') = ?2 and r.cl_zbh like %?3% order by d.timestamp",nativeQuery=true) | ||
| 42 | - List<Object[]> historyMessage(String line,String date,String code); | 36 | + @Query(value="select t.car_code,d.sender,d.txt_content,d.timestamp,0 as xlbm from (" |
| 37 | + + " select equipment_code,car_code from bsth_c_cars where id in(" | ||
| 38 | + + " select cl from bsth_c_s_ccinfo where xl in ( " | ||
| 39 | + + " select id from bsth_c_line where line_code=?1 ))) t" | ||
| 40 | + + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id " | ||
| 41 | + + " where d.timestamp >=?2 and d.timestamp <=?3 and t.car_code like %?4% ",nativeQuery=true) | ||
| 42 | + List<Object[]> historyMessage(String line,long d,long t,String code); | ||
| 43 | 43 | ||
| 44 | @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs " | 44 | @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs " |
| 45 | + " FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 d " | 45 | + " FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 d " |
| @@ -113,13 +113,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -113,13 +113,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") | 113 | @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); | 114 | List<ScheduleRealInfo> setLD(String date); |
| 115 | 115 | ||
| 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); | 116 | + @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") |
| 117 | + List<Map<String,Object>> setLDGroup(String date); | ||
| 118 | 118 | ||
| 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); | 119 | + @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") |
| 120 | + List<Map<String,Object>> setLCYHGroup(String date); | ||
| 121 | 121 | ||
| 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); | 122 | + @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") |
| 123 | + List<Map<String,Object>> setDDRBGroup(String date); | ||
| 124 | 124 | ||
| 125 | } | 125 | } |
src/main/java/com/bsth/service/forms/CommonService.java
0 → 100644
| 1 | +package com.bsth.service.forms; | ||
| 2 | + | ||
| 3 | +import java.util.Map; | ||
| 4 | + | ||
| 5 | +import org.springframework.stereotype.Service; | ||
| 6 | + | ||
| 7 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 8 | +import com.bsth.service.BaseService; | ||
| 9 | + | ||
| 10 | +@Service | ||
| 11 | +public interface CommonService{ | ||
| 12 | + | ||
| 13 | + Map<String,Object> findKMBC1(String jName,String clZbh, String date,String enddate); | ||
| 14 | + | ||
| 15 | + Map<String,Object> findKMBC2(String jName,String clZbh,String date); | ||
| 16 | +} |
src/main/java/com/bsth/service/forms/impl/CommonServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.forms.impl; | ||
| 2 | + | ||
| 3 | +import java.text.DecimalFormat; | ||
| 4 | +import java.util.HashMap; | ||
| 5 | +import java.util.Iterator; | ||
| 6 | +import java.util.List; | ||
| 7 | +import java.util.Map; | ||
| 8 | +import java.util.Set; | ||
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | +import org.springframework.stereotype.Service; | ||
| 11 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | ||
| 12 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 13 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | ||
| 14 | +import com.bsth.service.forms.CommonService; | ||
| 15 | + | ||
| 16 | +@Service | ||
| 17 | +public class CommonServiceImpl implements CommonService{ | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + @Autowired | ||
| 21 | + ScheduleRealInfoRepository scheduleRealInfoRepository; | ||
| 22 | + | ||
| 23 | + @Override | ||
| 24 | + public Map<String, Object> findKMBC1(String jName, String clZbh, | ||
| 25 | + String date, String enddate) { | ||
| 26 | + | ||
| 27 | + String sql=" select s from bsth_c_s_sp_info_real s " | ||
| 28 | + + " where s.j_gh ='" + jName + "' and s.cl_zbh ='" + clZbh + "' and " | ||
| 29 | + + " to_days(s.schedule_date) BETWEEN to_days('" + date + "') and to_days('" + enddate + "')" | ||
| 30 | + + " order by bcs"; | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill4(jName, clZbh, date, enddate); | ||
| 34 | + DecimalFormat format = new DecimalFormat("0.00"); | ||
| 35 | +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | ||
| 36 | +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | ||
| 37 | + int jhbc = 0,cjbc = 0,ljbc = 0; | ||
| 38 | + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0; | ||
| 39 | + float addMileage = 0l,remMileage = 0l; | ||
| 40 | + Map<String,Object> map = new HashMap<String, Object>(); | ||
| 41 | + for(ScheduleRealInfo scheduleRealInfo : list){ | ||
| 42 | + if(scheduleRealInfo != null){ | ||
| 43 | + //计划里程(主任务过滤掉临加班次), | ||
| 44 | + //烂班里程(主任务烂班), | ||
| 45 | + //临加里程(主任务临加), | ||
| 46 | + //计划班次,烂班班次,增加班次 | ||
| 47 | + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | ||
| 48 | + if(scheduleRealInfo.isSflj()){ | ||
| 49 | + addMileage += tempJhlc; | ||
| 50 | + ljbc++; | ||
| 51 | + }else{ | ||
| 52 | + jhlc += tempJhlc; | ||
| 53 | + jhbc++; | ||
| 54 | + if(scheduleRealInfo.getStatus() == -1){ | ||
| 55 | + remMileage += tempJhlc; | ||
| 56 | + cjbc++; | ||
| 57 | + } | ||
| 58 | + } | ||
| 59 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 60 | + //计算营运里程,空驶里程 | ||
| 61 | + if(childTaskPlans.isEmpty()){ | ||
| 62 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 63 | + || scheduleRealInfo.getBcType().equals("venting")){ | ||
| 64 | + ksgl += tempJhlc; | ||
| 65 | + }else{ | ||
| 66 | + yygl += tempJhlc; | ||
| 67 | + } | ||
| 68 | + }else{ | ||
| 69 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 70 | + while(it.hasNext()){ | ||
| 71 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 72 | + if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 73 | + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 74 | + }else{ | ||
| 75 | + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + map.put("jhlc", format.format(jhlc)); | ||
| 82 | + map.put("remMileage", format.format(remMileage)); | ||
| 83 | + map.put("addMileage", format.format(addMileage)); | ||
| 84 | + map.put("yygl", format.format(yygl)); | ||
| 85 | + map.put("ksgl", format.format(ksgl)); | ||
| 86 | + map.put("realMileage", format.format(yygl+ksgl)); | ||
| 87 | + map.put("jhbc", jhbc); | ||
| 88 | + map.put("cjbc", cjbc); | ||
| 89 | + map.put("ljbc", ljbc); | ||
| 90 | + map.put("sjbc", jhbc-cjbc+ljbc); | ||
| 91 | + return map; | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + | ||
| 95 | + @Override | ||
| 96 | + public Map<String, Object> findKMBC2(String jName, String clZbh,String date) { | ||
| 97 | + | ||
| 98 | + String sql=" select s from bsth_c_s_sp_info_real s " | ||
| 99 | + + " where s.j_gh ='" + jName + "' and s.cl_zbh ='" + clZbh + "' and " | ||
| 100 | + + " to_days(s.schedule_date) =to_days('" + date + "')" | ||
| 101 | + + " order by bcs"; | ||
| 102 | + | ||
| 103 | + | ||
| 104 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill3(jName, clZbh , date); | ||
| 105 | + | ||
| 106 | + DecimalFormat format = new DecimalFormat("0.00"); | ||
| 107 | +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | ||
| 108 | +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | ||
| 109 | + int jhbc = 0,cjbc = 0,ljbc = 0; | ||
| 110 | + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0; | ||
| 111 | + float addMileage = 0l,remMileage = 0l; | ||
| 112 | + String j_Name=""; | ||
| 113 | + Map<String,Object> map = new HashMap<String, Object>(); | ||
| 114 | + for(ScheduleRealInfo scheduleRealInfo : list){ | ||
| 115 | + if(scheduleRealInfo != null){ | ||
| 116 | + j_Name=scheduleRealInfo.getjName(); | ||
| 117 | + //计划里程(主任务过滤掉临加班次), | ||
| 118 | + //烂班里程(主任务烂班), | ||
| 119 | + //临加里程(主任务临加), | ||
| 120 | + //计划班次,烂班班次,增加班次 | ||
| 121 | + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | ||
| 122 | + if(scheduleRealInfo.isSflj()){ | ||
| 123 | + addMileage += tempJhlc; | ||
| 124 | + ljbc++; | ||
| 125 | + }else{ | ||
| 126 | + jhlc += tempJhlc; | ||
| 127 | + jhbc++; | ||
| 128 | + if(scheduleRealInfo.getStatus() == -1){ | ||
| 129 | + remMileage += tempJhlc; | ||
| 130 | + cjbc++; | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 134 | + //计算营运里程,空驶里程 | ||
| 135 | + if(childTaskPlans.isEmpty()){ | ||
| 136 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 137 | + || scheduleRealInfo.getBcType().equals("venting")){ | ||
| 138 | + ksgl += tempJhlc; | ||
| 139 | + }else{ | ||
| 140 | + yygl += tempJhlc; | ||
| 141 | + } | ||
| 142 | + }else{ | ||
| 143 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 144 | + while(it.hasNext()){ | ||
| 145 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 146 | + if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 147 | + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 148 | + }else{ | ||
| 149 | + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 150 | + } | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + } | ||
| 154 | + } | ||
| 155 | + map.put("j_name", j_Name); | ||
| 156 | + map.put("jhlc", format.format(jhlc)); | ||
| 157 | + map.put("remMileage", format.format(remMileage)); | ||
| 158 | + map.put("addMileage", format.format(addMileage)); | ||
| 159 | + map.put("yygl", format.format(yygl)); | ||
| 160 | + map.put("ksgl", format.format(ksgl)); | ||
| 161 | + map.put("realMileage", format.format(yygl+ksgl)); | ||
| 162 | + map.put("jhbc", jhbc); | ||
| 163 | + map.put("cjbc", cjbc); | ||
| 164 | + map.put("ljbc", ljbc); | ||
| 165 | + map.put("sjbc", jhbc-cjbc+ljbc); | ||
| 166 | + return map; | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + | ||
| 170 | + | ||
| 171 | + | ||
| 172 | +} |
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/ScheduleRealInfoServiceImpl.java
| @@ -613,11 +613,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -613,11 +613,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 613 | 613 | ||
| 614 | @Override | 614 | @Override |
| 615 | public List<Object[]> historyMessage(String line, String date, String code) { | 615 | public List<Object[]> historyMessage(String line, String date, String code) { |
| 616 | + | ||
| 617 | + String sql="select t.car_code,d.sender,d.txt_content,d.timestamp from (" | ||
| 618 | + + " select equipment_code,car_code from bsth_c_cars where id in(" | ||
| 619 | + + " select cl from bsth_c_s_ccinfo where xl in ( " | ||
| 620 | + + " select id from bsth_c_line where line_code=?1 ))) t" | ||
| 621 | + + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id " | ||
| 622 | + + " where d.timestamp >=?2 and d.timestamp <=?3 and t.car_code like '%?4%'"; | ||
| 616 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 623 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 617 | - List<Object[]> list = scheduleRealInfoRepository.historyMessage(line, date, code); | 624 | + long d= 0; |
| 625 | + long t=0; | ||
| 626 | + if(date.length()>0){ | ||
| 627 | + try { | ||
| 628 | + d=sdf.parse(date+" 00:00:00").getTime(); | ||
| 629 | + t=sdf.parse(date+" 23:59:59").getTime(); | ||
| 630 | + } catch (ParseException e) { | ||
| 631 | + // TODO Auto-generated catch block | ||
| 632 | + e.printStackTrace(); | ||
| 633 | + } | ||
| 634 | + | ||
| 635 | + } | ||
| 636 | + | ||
| 637 | + List<Object[]> list = scheduleRealInfoRepository.historyMessage(line,d,t, code); | ||
| 618 | for(Object[] obj:list){ | 638 | for(Object[] obj:list){ |
| 619 | if(obj != null){ | 639 | if(obj != null){ |
| 620 | - obj[4] = sdf.format(new Date(Long.parseLong(obj[4].toString()))); | 640 | + obj[3] = sdf.format(new Date(Long.parseLong(obj[3].toString()))); |
| 641 | + obj[4] = BasicData.lineCode2NameMap.get(line); | ||
| 621 | } | 642 | } |
| 622 | } | 643 | } |
| 623 | return list; | 644 | return list; |
| @@ -1129,10 +1150,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1129,10 +1150,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1129 | addMileage += tempJhlc; | 1150 | addMileage += tempJhlc; |
| 1130 | ljbc++; | 1151 | ljbc++; |
| 1131 | }else{ | 1152 | }else{ |
| 1132 | - if(scheduleRealInfo.getBcType().equals("normal")){ | 1153 | + if( !(scheduleRealInfo.getBcType().equals("in") |
| 1154 | + ||scheduleRealInfo.getBcType().equals("out")) ){ | ||
| 1133 | jhbc++; | 1155 | jhbc++; |
| 1156 | + jhlc += tempJhlc; | ||
| 1134 | } | 1157 | } |
| 1135 | - jhlc += tempJhlc; | 1158 | + |
| 1136 | if(scheduleRealInfo.getStatus() == -1){ | 1159 | if(scheduleRealInfo.getStatus() == -1){ |
| 1137 | remMileage += tempJhlc; | 1160 | remMileage += tempJhlc; |
| 1138 | cjbc++; | 1161 | cjbc++; |
| @@ -1143,11 +1166,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1143,11 +1166,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1143 | if(childTaskPlans.isEmpty()){ | 1166 | if(childTaskPlans.isEmpty()){ |
| 1144 | if(scheduleRealInfo.getBcType().equals("in") || | 1167 | if(scheduleRealInfo.getBcType().equals("in") || |
| 1145 | scheduleRealInfo.getBcType().equals("out")){ | 1168 | scheduleRealInfo.getBcType().equals("out")){ |
| 1146 | - ksgl += tempJhlc; | ||
| 1147 | jcclc +=tempJhlc; | 1169 | jcclc +=tempJhlc; |
| 1148 | - }else if(scheduleRealInfo.getBcType().equals("venting")){ | ||
| 1149 | - ksgl += tempJhlc; | ||
| 1150 | - }else{ | 1170 | + } |
| 1171 | + //主任务 放空班次属于营运 | ||
| 1172 | +// else if(scheduleRealInfo.getBcType().equals("venting")){ | ||
| 1173 | +// ksgl += tempJhlc; | ||
| 1174 | +// } | ||
| 1175 | + else{ | ||
| 1151 | if(scheduleRealInfo.getStatus() != -1){ | 1176 | if(scheduleRealInfo.getStatus() != -1){ |
| 1152 | yygl += tempJhlc; | 1177 | yygl += tempJhlc; |
| 1153 | } | 1178 | } |
| @@ -1160,8 +1185,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1160,8 +1185,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1160 | ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | 1185 | ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); |
| 1161 | }else{ | 1186 | }else{ |
| 1162 | if(childTaskPlan.isDestroy()){ | 1187 | if(childTaskPlan.isDestroy()){ |
| 1163 | - remMileage += tempJhlc; | ||
| 1164 | - cjbc++; | 1188 | + remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); |
| 1189 | +// cjbc++; | ||
| 1165 | }else{ | 1190 | }else{ |
| 1166 | yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | 1191 | yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); |
| 1167 | } | 1192 | } |
| @@ -1175,12 +1200,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1175,12 +1200,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1175 | map.put("addMileage", format.format(addMileage)); | 1200 | map.put("addMileage", format.format(addMileage)); |
| 1176 | map.put("yygl", format.format(yygl)); | 1201 | map.put("yygl", format.format(yygl)); |
| 1177 | map.put("ksgl", format.format(ksgl)); | 1202 | map.put("ksgl", format.format(ksgl)); |
| 1178 | - map.put("realMileage", format.format(yygl+ksgl)); | 1203 | + map.put("realMileage", format.format(yygl+ksgl+jcclc)); |
| 1179 | map.put("jhbc", jhbc); | 1204 | map.put("jhbc", jhbc); |
| 1180 | map.put("cjbc", cjbc); | 1205 | map.put("cjbc", cjbc); |
| 1181 | map.put("ljbc", ljbc); | 1206 | map.put("ljbc", ljbc); |
| 1182 | map.put("sjbc", jhbc-cjbc+ljbc); | 1207 | map.put("sjbc", jhbc-cjbc+ljbc); |
| 1183 | map.put("jcclc", jcclc); | 1208 | map.put("jcclc", jcclc); |
| 1209 | + map.put("zkslc", ksgl+jcclc); | ||
| 1184 | return map; | 1210 | return map; |
| 1185 | } | 1211 | } |
| 1186 | 1212 | ||
| @@ -1259,115 +1285,121 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1259,115 +1285,121 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1259 | Map<String,Object> map = new HashMap<String, Object>(); | 1285 | Map<String,Object> map = new HashMap<String, Object>(); |
| 1260 | for(ScheduleRealInfo scheduleRealInfo: list){ | 1286 | for(ScheduleRealInfo scheduleRealInfo: list){ |
| 1261 | if(scheduleRealInfo != null){ | 1287 | if(scheduleRealInfo != null){ |
| 1262 | - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 1263 | - //计算实际里程,少驶里程,计划里程=实际里程+少驶里程 | ||
| 1264 | - if(childTaskPlans.isEmpty()){ | ||
| 1265 | - tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | ||
| 1266 | - jhlc += tempJhlc; | ||
| 1267 | - if(scheduleRealInfo.getStatus() == 2){ | ||
| 1268 | - sjgl += tempJhlc; | ||
| 1269 | - }else if(scheduleRealInfo.getStatus() == -1){ | ||
| 1270 | - ssgl += tempJhlc; | ||
| 1271 | - if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("路阻") != -1){ | ||
| 1272 | - ssgl_lz += tempJhlc; | ||
| 1273 | - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("吊慢") != -1){ | ||
| 1274 | - ssgl_dm += tempJhlc; | ||
| 1275 | - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("故障") != -1){ | ||
| 1276 | - ssgl_gz += tempJhlc; | ||
| 1277 | - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("纠纷") != -1){ | ||
| 1278 | - ssgl_jf += tempJhlc; | ||
| 1279 | - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("肇事") != -1){ | ||
| 1280 | - ssgl_zs += tempJhlc; | ||
| 1281 | - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺人") != -1){ | ||
| 1282 | - ssgl_qr += tempJhlc; | ||
| 1283 | - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺车") != -1){ | ||
| 1284 | - ssgl_qc += tempJhlc; | ||
| 1285 | - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("客稀") != -1){ | ||
| 1286 | - ssgl_kx += tempJhlc; | ||
| 1287 | - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("气候") != -1){ | ||
| 1288 | - ssgl_qh += tempJhlc; | ||
| 1289 | - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("援外") != -1){ | ||
| 1290 | - ssgl_yw += tempJhlc; | ||
| 1291 | - }else{ | ||
| 1292 | - ssgl_other += tempJhlc; | ||
| 1293 | - } | ||
| 1294 | - | 1288 | + |
| 1289 | + if(!(scheduleRealInfo.getBcType().equals("in") | ||
| 1290 | + ||scheduleRealInfo.getBcType().equals("out")) ){ | ||
| 1291 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 1292 | + //计算实际里程,少驶里程,计划里程=实际里程+少驶里程 | ||
| 1293 | + if(childTaskPlans.isEmpty()){ | ||
| 1294 | + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | ||
| 1295 | //临加公里 | 1295 | //临加公里 |
| 1296 | if(scheduleRealInfo.isSflj()){ | 1296 | if(scheduleRealInfo.isSflj()){ |
| 1297 | ljgl += tempJhlc; | 1297 | ljgl += tempJhlc; |
| 1298 | + }else{ | ||
| 1299 | + jhlc += tempJhlc; | ||
| 1298 | } | 1300 | } |
| 1299 | - }else{ | ||
| 1300 | - ssgl += tempJhlc; | ||
| 1301 | - ssgl_other += tempJhlc; | ||
| 1302 | - } | ||
| 1303 | - }else{ | ||
| 1304 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 1305 | - while(it.hasNext()){ | ||
| 1306 | - ChildTaskPlan childTaskPlan = it.next(); | ||
| 1307 | - childMileage = childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 1308 | - jhlc += childMileage; | ||
| 1309 | - if(childTaskPlan.isDestroy()){ | ||
| 1310 | - ssgl += childMileage; | ||
| 1311 | - if(childTaskPlan.getDestroyReason().equals("路阻")){ | ||
| 1312 | - ssgl_lz += childTaskPlan.getMileage(); | ||
| 1313 | - }else if(childTaskPlan.getDestroyReason().equals("吊慢")){ | ||
| 1314 | - ssgl_dm += childTaskPlan.getMileage(); | ||
| 1315 | - }else if(childTaskPlan.getDestroyReason().equals("故障")){ | ||
| 1316 | - ssgl_gz += childTaskPlan.getMileage(); | ||
| 1317 | - }else if(childTaskPlan.getDestroyReason().equals("纠纷")){ | ||
| 1318 | - ssgl_jf += childTaskPlan.getMileage(); | ||
| 1319 | - }else if(childTaskPlan.getDestroyReason().equals("肇事")){ | ||
| 1320 | - ssgl_zs += childTaskPlan.getMileage(); | ||
| 1321 | - }else if(childTaskPlan.getDestroyReason().equals("缺人")){ | ||
| 1322 | - ssgl_qr += childTaskPlan.getMileage(); | ||
| 1323 | - }else if(childTaskPlan.getDestroyReason().equals("缺车")){ | ||
| 1324 | - ssgl_qc += childTaskPlan.getMileage(); | ||
| 1325 | - }else if(childTaskPlan.getDestroyReason().equals("客稀")){ | ||
| 1326 | - ssgl_kx += childTaskPlan.getMileage(); | ||
| 1327 | - }else if(childTaskPlan.getDestroyReason().equals("气候")){ | ||
| 1328 | - ssgl_qh += childTaskPlan.getMileage(); | ||
| 1329 | - }else if(childTaskPlan.getDestroyReason().equals("援外")){ | ||
| 1330 | - ssgl_yw += childTaskPlan.getMileage(); | 1301 | + if(scheduleRealInfo.getStatus() == 2){ |
| 1302 | + sjgl += tempJhlc; | ||
| 1303 | + }else if(scheduleRealInfo.getStatus() == -1){ | ||
| 1304 | + ssgl += tempJhlc; | ||
| 1305 | + if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("路阻") != -1){ | ||
| 1306 | + ssgl_lz += tempJhlc; | ||
| 1307 | + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("吊慢") != -1){ | ||
| 1308 | + ssgl_dm += tempJhlc; | ||
| 1309 | + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("故障") != -1){ | ||
| 1310 | + ssgl_gz += tempJhlc; | ||
| 1311 | + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("纠纷") != -1){ | ||
| 1312 | + ssgl_jf += tempJhlc; | ||
| 1313 | + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("肇事") != -1){ | ||
| 1314 | + ssgl_zs += tempJhlc; | ||
| 1315 | + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺人") != -1){ | ||
| 1316 | + ssgl_qr += tempJhlc; | ||
| 1317 | + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺车") != -1){ | ||
| 1318 | + ssgl_qc += tempJhlc; | ||
| 1319 | + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("客稀") != -1){ | ||
| 1320 | + ssgl_kx += tempJhlc; | ||
| 1321 | + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("气候") != -1){ | ||
| 1322 | + ssgl_qh += tempJhlc; | ||
| 1323 | + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("援外") != -1){ | ||
| 1324 | + ssgl_yw += tempJhlc; | ||
| 1331 | }else{ | 1325 | }else{ |
| 1332 | - ssgl_other += childTaskPlan.getMileage(); | 1326 | + ssgl_other += tempJhlc; |
| 1333 | } | 1327 | } |
| 1328 | + | ||
| 1329 | + | ||
| 1334 | }else{ | 1330 | }else{ |
| 1335 | - sjgl += childMileage; | 1331 | + ssgl += tempJhlc; |
| 1332 | + ssgl_other += tempJhlc; | ||
| 1333 | + } | ||
| 1334 | + }else{ | ||
| 1335 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 1336 | + while(it.hasNext()){ | ||
| 1337 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 1338 | + childMileage = childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 1339 | + jhlc += childMileage; | ||
| 1340 | + if(childTaskPlan.isDestroy()){ | ||
| 1341 | + ssgl += childMileage; | ||
| 1342 | + if(childTaskPlan.getDestroyReason().equals("路阻")){ | ||
| 1343 | + ssgl_lz += childTaskPlan.getMileage(); | ||
| 1344 | + }else if(childTaskPlan.getDestroyReason().equals("吊慢")){ | ||
| 1345 | + ssgl_dm += childTaskPlan.getMileage(); | ||
| 1346 | + }else if(childTaskPlan.getDestroyReason().equals("故障")){ | ||
| 1347 | + ssgl_gz += childTaskPlan.getMileage(); | ||
| 1348 | + }else if(childTaskPlan.getDestroyReason().equals("纠纷")){ | ||
| 1349 | + ssgl_jf += childTaskPlan.getMileage(); | ||
| 1350 | + }else if(childTaskPlan.getDestroyReason().equals("肇事")){ | ||
| 1351 | + ssgl_zs += childTaskPlan.getMileage(); | ||
| 1352 | + }else if(childTaskPlan.getDestroyReason().equals("缺人")){ | ||
| 1353 | + ssgl_qr += childTaskPlan.getMileage(); | ||
| 1354 | + }else if(childTaskPlan.getDestroyReason().equals("缺车")){ | ||
| 1355 | + ssgl_qc += childTaskPlan.getMileage(); | ||
| 1356 | + }else if(childTaskPlan.getDestroyReason().equals("客稀")){ | ||
| 1357 | + ssgl_kx += childTaskPlan.getMileage(); | ||
| 1358 | + }else if(childTaskPlan.getDestroyReason().equals("气候")){ | ||
| 1359 | + ssgl_qh += childTaskPlan.getMileage(); | ||
| 1360 | + }else if(childTaskPlan.getDestroyReason().equals("援外")){ | ||
| 1361 | + ssgl_yw += childTaskPlan.getMileage(); | ||
| 1362 | + }else{ | ||
| 1363 | + ssgl_other += childTaskPlan.getMileage(); | ||
| 1364 | + } | ||
| 1365 | + }else{ | ||
| 1366 | + sjgl += childMileage; | ||
| 1367 | + } | ||
| 1336 | } | 1368 | } |
| 1337 | } | 1369 | } |
| 1338 | - } | ||
| 1339 | - | ||
| 1340 | - //班次 | ||
| 1341 | - jhbc++; | ||
| 1342 | - String[] fcsj = scheduleRealInfo.getFcsj().split(":"); | ||
| 1343 | - String[] fcsjActual = (scheduleRealInfo.getFcsjActual()==null?"0:00":scheduleRealInfo.getFcsjActual()).split(":"); | ||
| 1344 | - if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_0 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_1){ | ||
| 1345 | - jhbc_m++; | ||
| 1346 | - }else if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_2 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_3){ | ||
| 1347 | - jhbc_a++; | ||
| 1348 | - } | ||
| 1349 | - if(scheduleRealInfo.getStatus() == 2){ | ||
| 1350 | - sjbc++; | ||
| 1351 | - if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){ | ||
| 1352 | - sjbc_m++; | ||
| 1353 | - }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){ | ||
| 1354 | - sjbc_a++; | 1370 | + |
| 1371 | + //班次 | ||
| 1372 | + jhbc++; | ||
| 1373 | + String[] fcsj = scheduleRealInfo.getFcsj().split(":"); | ||
| 1374 | + String[] fcsjActual = (scheduleRealInfo.getFcsjActual()==null?"0:00":scheduleRealInfo.getFcsjActual()).split(":"); | ||
| 1375 | + if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_0 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_1){ | ||
| 1376 | + jhbc_m++; | ||
| 1377 | + }else if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_2 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_3){ | ||
| 1378 | + jhbc_a++; | ||
| 1355 | } | 1379 | } |
| 1356 | - } | ||
| 1357 | - if(scheduleRealInfo.isSflj()){ | ||
| 1358 | - ljbc++; | ||
| 1359 | - if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){ | ||
| 1360 | - ljbc_m++; | ||
| 1361 | - }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){ | ||
| 1362 | - ljbc_a++; | 1380 | + if(scheduleRealInfo.getStatus() == 2){ |
| 1381 | + sjbc++; | ||
| 1382 | + if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){ | ||
| 1383 | + sjbc_m++; | ||
| 1384 | + }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){ | ||
| 1385 | + sjbc_a++; | ||
| 1386 | + } | ||
| 1363 | } | 1387 | } |
| 1364 | - } | ||
| 1365 | - if(scheduleRealInfo.getBcType().equals("venting")){ | ||
| 1366 | - fzbc++; | ||
| 1367 | - if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){ | ||
| 1368 | - fzbc_m++; | ||
| 1369 | - }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){ | ||
| 1370 | - fzbc_a++; | 1388 | + if(scheduleRealInfo.isSflj()){ |
| 1389 | + ljbc++; | ||
| 1390 | + if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){ | ||
| 1391 | + ljbc_m++; | ||
| 1392 | + }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){ | ||
| 1393 | + ljbc_a++; | ||
| 1394 | + } | ||
| 1395 | + } | ||
| 1396 | + if(scheduleRealInfo.getBcType().equals("venting")){ | ||
| 1397 | + fzbc++; | ||
| 1398 | + if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){ | ||
| 1399 | + fzbc_m++; | ||
| 1400 | + }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){ | ||
| 1401 | + fzbc_a++; | ||
| 1402 | + } | ||
| 1371 | } | 1403 | } |
| 1372 | } | 1404 | } |
| 1373 | } | 1405 | } |
src/main/java/com/bsth/service/schedule/CarDeviceService.java
| 1 | -package com.bsth.service.schedule; | ||
| 2 | - | ||
| 3 | -import com.bsth.entity.CarDevice; | ||
| 4 | - | ||
| 5 | -/** | ||
| 6 | - * Created by xu on 16/12/15. | ||
| 7 | - */ | ||
| 8 | -public interface CarDeviceService extends BService<CarDevice, Long> { | ||
| 9 | - void validate_qyrq(CarDevice carDevice) throws ScheduleException; | ||
| 10 | -} | 1 | +package com.bsth.service.schedule; |
| 2 | + | ||
| 3 | +import com.bsth.entity.CarDevice; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * Created by xu on 16/12/15. | ||
| 7 | + */ | ||
| 8 | +public interface CarDeviceService extends BService<CarDevice, Long> { | ||
| 9 | + void validate_qyrq(CarDevice carDevice) throws ScheduleException; | ||
| 10 | +} |
src/main/java/com/bsth/service/schedule/EmployeeService.java
| 1 | -package com.bsth.service.schedule; | ||
| 2 | - | ||
| 3 | -import com.bsth.entity.Personnel; | ||
| 4 | - | ||
| 5 | -/** | ||
| 6 | - * Created by xu on 16/12/15. | ||
| 7 | - */ | ||
| 8 | -public interface EmployeeService extends BService<Personnel, Integer> { | ||
| 9 | - public void validate_gh(Personnel personnel) throws ScheduleException; | ||
| 10 | -} | 1 | +package com.bsth.service.schedule; |
| 2 | + | ||
| 3 | +import com.bsth.entity.Personnel; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * Created by xu on 16/12/15. | ||
| 7 | + */ | ||
| 8 | +public interface EmployeeService extends BService<Personnel, Integer> { | ||
| 9 | + public void validate_gh(Personnel personnel) throws ScheduleException; | ||
| 10 | +} |
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
| 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 | - | ||
| 30 | - return null; | ||
| 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_ne", carDevice.getQyrq()); | ||
| 49 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 50 | - throw new ScheduleException("启用日期必须比历史的启用日期大"); | ||
| 51 | - } | ||
| 52 | - } | ||
| 53 | -} | 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
| 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 | -} | 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/forms/statement/historyMessage.html
| @@ -52,7 +52,6 @@ | @@ -52,7 +52,6 @@ | ||
| 52 | <tr class="hidden"> | 52 | <tr class="hidden"> |
| 53 | <th>序号</th> | 53 | <th>序号</th> |
| 54 | <th>线路</th> | 54 | <th>线路</th> |
| 55 | - <th>路牌</th> | ||
| 56 | <th>运营车辆</th> | 55 | <th>运营车辆</th> |
| 57 | <th>发送人</th> | 56 | <th>发送人</th> |
| 58 | <th>发送时间</th> | 57 | <th>发送时间</th> |
| @@ -151,17 +150,16 @@ | @@ -151,17 +150,16 @@ | ||
| 151 | {{each list as obj i}} | 150 | {{each list as obj i}} |
| 152 | <tr> | 151 | <tr> |
| 153 | <td>{{i+1}}</td> | 152 | <td>{{i+1}}</td> |
| 153 | + <td>{{obj[4]}}</td> | ||
| 154 | <td>{{obj[0]}}</td> | 154 | <td>{{obj[0]}}</td> |
| 155 | <td>{{obj[1]}}</td> | 155 | <td>{{obj[1]}}</td> |
| 156 | - <td>{{obj[2]}}</td> | ||
| 157 | <td>{{obj[3]}}</td> | 156 | <td>{{obj[3]}}</td> |
| 158 | - <td>{{obj[4]}}</td> | ||
| 159 | - <td>{{obj[5]}}</td> | 157 | + <td>{{obj[2]}}</td> |
| 160 | </tr> | 158 | </tr> |
| 161 | {{/each}} | 159 | {{/each}} |
| 162 | {{if list.length == 0}} | 160 | {{if list.length == 0}} |
| 163 | <tr> | 161 | <tr> |
| 164 | - <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | 162 | + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> |
| 165 | </tr> | 163 | </tr> |
| 166 | {{/if}} | 164 | {{/if}} |
| 167 | </script> | 165 | </script> |
| 168 | \ No newline at end of file | 166 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/waybill.html
| @@ -332,30 +332,30 @@ | @@ -332,30 +332,30 @@ | ||
| 332 | </script> | 332 | </script> |
| 333 | <script type="text/html" id="ludan_3"> | 333 | <script type="text/html" id="ludan_3"> |
| 334 | <tr> | 334 | <tr> |
| 335 | + <td colspan="2">计划班次</td> | ||
| 336 | + <td>{{jhbc}}</td> | ||
| 335 | <td colspan="2">计划公里</td> | 337 | <td colspan="2">计划公里</td> |
| 336 | <td>{{jhlc}}</td> | 338 | <td>{{jhlc}}</td> |
| 337 | - <td colspan="2">烂班公里</td> | ||
| 338 | - <td>{{remMileage}}</td> | 339 | + <td colspan="2">烂班班次</td> |
| 340 | + <td>{{cjbc}}</td> | ||
| 341 | + <td colspan="3"> 烂班公里</td> | ||
| 342 | + <td colspan="2">{{remMileage}}</td> | ||
| 343 | + </tr> | ||
| 344 | + <tr> | ||
| 345 | + <td colspan="2">临加班次</td> | ||
| 346 | + <td>{{ljbc}}</td> | ||
| 339 | <td colspan="2">临加公里</td> | 347 | <td colspan="2">临加公里</td> |
| 340 | <td>{{addMileage}}</td> | 348 | <td>{{addMileage}}</td> |
| 349 | + <td colspan="2">实际班次</td> | ||
| 350 | + <td>{{sjbc}}</td> | ||
| 341 | <td colspan="3">营运公里</td> | 351 | <td colspan="3">营运公里</td> |
| 342 | <td colspan="2">{{yygl}}</td> | 352 | <td colspan="2">{{yygl}}</td> |
| 343 | </tr> | 353 | </tr> |
| 344 | <tr> | 354 | <tr> |
| 345 | <td colspan="2">空驶公里</td> | 355 | <td colspan="2">空驶公里</td> |
| 346 | - <td>{{ksgl}}</td> | 356 | + <td>{{zkslc}}</td> |
| 347 | <td colspan="2">总公里</td> | 357 | <td colspan="2">总公里</td> |
| 348 | <td>{{realMileage}}</td> | 358 | <td>{{realMileage}}</td> |
| 349 | - <td colspan="2">计划班次</td> | ||
| 350 | - <td>{{jhbc}}</td> | ||
| 351 | - <td colspan="3">烂班班次</td> | ||
| 352 | - <td colspan="2">{{cjbc}}</td> | ||
| 353 | - </tr> | ||
| 354 | - <tr> | ||
| 355 | - <td colspan="2">增加班次</td> | ||
| 356 | - <td>{{ljbc}}</td> | ||
| 357 | - <td colspan="2">实际班次</td> | ||
| 358 | - <td>{{sjbc}}</td> | ||
| 359 | <td colspan="2"></td> | 359 | <td colspan="2"></td> |
| 360 | <td></td> | 360 | <td></td> |
| 361 | <td colspan="3"></td> | 361 | <td colspan="3"></td> |
src/main/resources/static/pages/forms/statement/waybillQp.html
| @@ -336,10 +336,10 @@ | @@ -336,10 +336,10 @@ | ||
| 336 | <td>{{jhlc}}</td> | 336 | <td>{{jhlc}}</td> |
| 337 | <td colspan="2">营运公里</td> | 337 | <td colspan="2">营运公里</td> |
| 338 | <td >{{yygl}}</td> | 338 | <td >{{yygl}}</td> |
| 339 | - <td colspan="2">烂班公里</td> | ||
| 340 | - <td>{{remMileage}}</td> | ||
| 341 | - <td colspan="3">空驶公里</td> | ||
| 342 | - <td colspan="2">{{ksgl}}</td> | 339 | + <td colspan="2">空驶公里</td> |
| 340 | + <td>{{ksgl}}</td> | ||
| 341 | + <td colspan="3">烂班公里</td> | ||
| 342 | + <td colspan="2">{{remMileage}}</td> | ||
| 343 | 343 | ||
| 344 | 344 | ||
| 345 | </tr> | 345 | </tr> |
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/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-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: { |
| @@ -388,9 +388,9 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -388,9 +388,9 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 388 | }, | 388 | }, |
| 389 | 389 | ||
| 390 | cde1: { // 车辆设备启用日期验证 | 390 | cde1: { // 车辆设备启用日期验证 |
| 391 | - template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒 | 391 | + template: {'xl_eq': -1, 'cl_eq': -1, 'qyrq_eq': 1}, // 日期毫秒 |
| 392 | remote: $resource( // $resource封装对象 | 392 | remote: $resource( // $resource封装对象 |
| 393 | - '/cde//validate/qyrq', | 393 | + '/cde_sc/validate_qyrq', |
| 394 | {}, | 394 | {}, |
| 395 | { | 395 | { |
| 396 | do: { | 396 | do: { |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| @@ -83,17 +83,33 @@ angular.module('ScheduleApp').factory( | @@ -83,17 +83,33 @@ angular.module('ScheduleApp').factory( | ||
| 83 | // 车辆设备信息service | 83 | // 车辆设备信息service |
| 84 | angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | 84 | angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { |
| 85 | return $resource( | 85 | return $resource( |
| 86 | - '/cde/:id', | ||
| 87 | - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'}, | 86 | + '/cde_sc/:id', |
| 87 | + {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id'}, | ||
| 88 | { | 88 | { |
| 89 | list: { | 89 | list: { |
| 90 | method: 'GET', | 90 | method: 'GET', |
| 91 | params: { | 91 | params: { |
| 92 | page: 0 | 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 | + } | ||
| 93 | } | 101 | } |
| 94 | }, | 102 | }, |
| 95 | get: { | 103 | get: { |
| 96 | - method: '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 | + } | ||
| 97 | }, | 113 | }, |
| 98 | save: { | 114 | save: { |
| 99 | method: 'POST' | 115 | method: 'POST' |
| @@ -173,7 +189,7 @@ angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', functi | @@ -173,7 +189,7 @@ angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', functi | ||
| 173 | return { | 189 | return { |
| 174 | rest : $resource( | 190 | rest : $resource( |
| 175 | '/cci/:id', | 191 | '/cci/:id', |
| 176 | - {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'}, | 192 | + {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id'}, |
| 177 | { | 193 | { |
| 178 | list: { | 194 | list: { |
| 179 | method: 'GET', | 195 | method: 'GET', |
| @@ -228,7 +244,7 @@ angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', f | @@ -228,7 +244,7 @@ angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', f | ||
| 228 | return { | 244 | return { |
| 229 | rest : $resource( | 245 | rest : $resource( |
| 230 | '/eci/:id', | 246 | '/eci/:id', |
| 231 | - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'}, | 247 | + {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id'}, |
| 232 | { | 248 | { |
| 233 | list: { | 249 | list: { |
| 234 | method: 'GET', | 250 | method: 'GET', |
| @@ -279,7 +295,7 @@ angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', | @@ -279,7 +295,7 @@ angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', | ||
| 279 | return { | 295 | return { |
| 280 | rest: $resource( | 296 | rest: $resource( |
| 281 | '/gic/:id', | 297 | '/gic/:id', |
| 282 | - {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id_route'}, | 298 | + {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id'}, |
| 283 | { | 299 | { |
| 284 | list: { | 300 | list: { |
| 285 | method: 'GET', | 301 | method: 'GET', |
| @@ -801,7 +817,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -801,7 +817,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 801 | gbv1: { // 路牌序号验证 | 817 | gbv1: { // 路牌序号验证 |
| 802 | template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'}, | 818 | template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'}, |
| 803 | remote: $resource( | 819 | remote: $resource( |
| 804 | - '/gic/validate1', | 820 | + '/gic/validate_lpno', |
| 805 | {}, | 821 | {}, |
| 806 | { | 822 | { |
| 807 | do: { | 823 | do: { |
| @@ -813,7 +829,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -813,7 +829,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 813 | gbv2: { // 路牌名称验证 | 829 | gbv2: { // 路牌名称验证 |
| 814 | template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'}, | 830 | template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'}, |
| 815 | remote: $resource( | 831 | remote: $resource( |
| 816 | - '/gic/validate2', | 832 | + '/gic/validate_lpname', |
| 817 | {}, | 833 | {}, |
| 818 | { | 834 | { |
| 819 | do: { | 835 | do: { |
| @@ -926,9 +942,9 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -926,9 +942,9 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 926 | }, | 942 | }, |
| 927 | 943 | ||
| 928 | cde1: { // 车辆设备启用日期验证 | 944 | cde1: { // 车辆设备启用日期验证 |
| 929 | - template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒 | 945 | + template: {'xl_eq': -1, 'cl_eq': -1, 'qyrq_eq': 1}, // 日期毫秒 |
| 930 | remote: $resource( // $resource封装对象 | 946 | remote: $resource( // $resource封装对象 |
| 931 | - '/cde//validate/qyrq', | 947 | + '/cde_sc/validate_qyrq', |
| 932 | {}, | 948 | {}, |
| 933 | { | 949 | { |
| 934 | do: { | 950 | do: { |
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/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html
| @@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
| 40 | 40 | ||
| 41 | setTimeout(initMap, 800); | 41 | setTimeout(initMap, 800); |
| 42 | }); | 42 | }); |
| 43 | - | 43 | + |
| 44 | function initMap() { | 44 | function initMap() { |
| 45 | //初始化地图 | 45 | //初始化地图 |
| 46 | map = new BMap.Map($('.drawer_right_map', drawer)[0]); | 46 | map = new BMap.Map($('.drawer_right_map', drawer)[0]); |
| @@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
| 82 | 82 | ||
| 83 | autoPosition(); | 83 | autoPosition(); |
| 84 | } | 84 | } |
| 85 | - | 85 | + |
| 86 | function drawCharts() { | 86 | function drawCharts() { |
| 87 | try { | 87 | try { |
| 88 | stationArr = JSON.parse(locData).stations[sch.xlDir == 0 ? 'up' : 'down']; | 88 | stationArr = JSON.parse(locData).stations[sch.xlDir == 0 ? 'up' : 'down']; |
| @@ -100,7 +100,7 @@ | @@ -100,7 +100,7 @@ | ||
| 100 | //初始化 X 比例尺 | 100 | //初始化 X 比例尺 |
| 101 | var sum=0; | 101 | var sum=0; |
| 102 | $.each(stationArr, function () { | 102 | $.each(stationArr, function () { |
| 103 | - sum += this.toDistance; | 103 | + sum += this.toDistance; |
| 104 | }); | 104 | }); |
| 105 | 105 | ||
| 106 | var items = svg.selectAll('g._item').data(stationArr) | 106 | var items = svg.selectAll('g._item').data(stationArr) |
| @@ -119,8 +119,8 @@ | @@ -119,8 +119,8 @@ | ||
| 119 | 119 | ||
| 120 | //path | 120 | //path |
| 121 | items.append('path').attr('d', function (d, i) { | 121 | items.append('path').attr('d', function (d, i) { |
| 122 | - return i>=len-1?'':line([i , i + 1]); | ||
| 123 | - }); | 122 | + return i>=len-1?'':line([i , i + 1]); |
| 123 | + }); | ||
| 124 | 124 | ||
| 125 | //上弧线 | 125 | //上弧线 |
| 126 | items.append('path').classed({arc_path: true}).attr('d', route_arc_path); | 126 | items.append('path').classed({arc_path: true}).attr('d', route_arc_path); |
| @@ -215,7 +215,7 @@ | @@ -215,7 +215,7 @@ | ||
| 215 | function toGeoCalcPage() { | 215 | function toGeoCalcPage() { |
| 216 | drawerLoadPage('/real_control_v2/fragments/geo/calc_station_space.html','cal_station_space_drawer'); | 216 | drawerLoadPage('/real_control_v2/fragments/geo/calc_station_space.html','cal_station_space_drawer'); |
| 217 | } | 217 | } |
| 218 | - | 218 | + |
| 219 | //页面切换 | 219 | //页面切换 |
| 220 | function drawerLoadPage(url, id) { | 220 | function drawerLoadPage(url, id) { |
| 221 | $(drawer).parent('.ct-bottom-drawer-body').load(url, function () { | 221 | $(drawer).parent('.ct-bottom-drawer-body').load(url, function () { |
| @@ -248,4 +248,4 @@ | @@ -248,4 +248,4 @@ | ||
| 248 | }); | 248 | }); |
| 249 | })(); | 249 | })(); |
| 250 | </script> | 250 | </script> |
| 251 | -</div> | ||
| 252 | \ No newline at end of file | 251 | \ No newline at end of file |
| 252 | + </div> | ||
| 253 | \ No newline at end of file | 253 | \ No newline at end of file |
src/main/resources/static/real_control_v2/js/line_schedule/legend.js
| 1 | -/* 图例相关 */ | ||
| 2 | - | ||
| 3 | -var gb_sch_legend = (function () { | ||
| 4 | - | ||
| 5 | - var locaKey = 'sch_legend_flag'; | ||
| 6 | - var storage = window.localStorage; | ||
| 7 | - | ||
| 8 | - var animationend = 'webkitAnimationEnd animationend'; | ||
| 9 | - var initLegend = function (cont) { | ||
| 10 | - //双击展开 | ||
| 11 | - $('.schedule-wrap i.uk-icon-question-circle', cont).dblclick(openLegend); | ||
| 12 | - | ||
| 13 | - //关闭事件 | ||
| 14 | - $('.schedule-wrap .fixed_legend_close', cont).on('click', function () { | ||
| 15 | - //隐藏 fixed_legend | ||
| 16 | - $('.schedule-wrap .fixed_legend').each(function () { | ||
| 17 | - var anim = 'uk-animation-slide-top uk-animation-reverse'; | ||
| 18 | - if (!$(this).parents('.header-title').is(':hidden')) { | ||
| 19 | - $(this).addClass(anim).one(animationend, function () { | ||
| 20 | - var icon=$(this).removeClass(anim).hide().parents('.header-title').find('.uk-icon-question-circle'); | ||
| 21 | - | ||
| 22 | - icon.addClass('uk-animation-slide-top').show().one(animationend, function () { | ||
| 23 | - $(this).removeClass('uk-animation-slide-top'); | ||
| 24 | - }); | ||
| 25 | - }); | ||
| 26 | - } | ||
| 27 | - else { | ||
| 28 | - $(this).hide().parents('.header-title').find('.uk-icon-question-circle').show(); | ||
| 29 | - } | ||
| 30 | - }); | ||
| 31 | - | ||
| 32 | - //记录状态 | ||
| 33 | - storage.setItem(locaKey, 0); | ||
| 34 | - }); | ||
| 35 | - | ||
| 36 | - var flag=storage.getItem(locaKey); | ||
| 37 | - if(flag && flag==1) | ||
| 38 | - openLegend(); | ||
| 39 | - }; | ||
| 40 | - | ||
| 41 | - | ||
| 42 | - //展开图例 | ||
| 43 | - var openLegend = function () { | ||
| 44 | - $('.qtip.sch-tl-tip').qtip('destroy', true); | ||
| 45 | - | ||
| 46 | - //隐藏ICON | ||
| 47 | - $('.schedule-wrap i.uk-icon-question-circle').hide(); | ||
| 48 | - | ||
| 49 | - var anim = 'uk-animation-slide-top'; | ||
| 50 | - //显示 fixed_legend | ||
| 51 | - $('.schedule-wrap .fixed_legend').each(function () { | ||
| 52 | - if (!$(this).parents('.header-title').is(':hidden')) { | ||
| 53 | - $(this).addClass(anim).one('webkitAnimationEnd animationend', function () { | ||
| 54 | - $(this).removeClass(anim); | ||
| 55 | - }); | ||
| 56 | - } | ||
| 57 | - }); | ||
| 58 | - $('.schedule-wrap .fixed_legend').css('display', 'inline-block'); | ||
| 59 | - | ||
| 60 | - //记录状态 | ||
| 61 | - storage.setItem(locaKey, 1); | ||
| 62 | - }; | ||
| 63 | - | ||
| 64 | - return { | ||
| 65 | - init: initLegend | ||
| 66 | - }; | 1 | +/* 图例相关 */ |
| 2 | + | ||
| 3 | +var gb_sch_legend = (function () { | ||
| 4 | + | ||
| 5 | + var locaKey = 'sch_legend_flag'; | ||
| 6 | + var storage = window.localStorage; | ||
| 7 | + | ||
| 8 | + var animationend = 'webkitAnimationEnd animationend'; | ||
| 9 | + var initLegend = function (cont) { | ||
| 10 | + //双击展开 | ||
| 11 | + $('.schedule-wrap i.uk-icon-question-circle', cont).dblclick(openLegend); | ||
| 12 | + | ||
| 13 | + //关闭事件 | ||
| 14 | + $('.schedule-wrap .fixed_legend_close', cont).on('click', function () { | ||
| 15 | + //隐藏 fixed_legend | ||
| 16 | + $('.schedule-wrap .fixed_legend').each(function () { | ||
| 17 | + var anim = 'uk-animation-slide-top uk-animation-reverse'; | ||
| 18 | + if (!$(this).parents('.header-title').is(':hidden')) { | ||
| 19 | + $(this).addClass(anim).one(animationend, function () { | ||
| 20 | + var icon=$(this).removeClass(anim).hide().parents('.header-title').find('.uk-icon-question-circle'); | ||
| 21 | + | ||
| 22 | + icon.addClass('uk-animation-slide-top').show().one(animationend, function () { | ||
| 23 | + $(this).removeClass('uk-animation-slide-top'); | ||
| 24 | + }); | ||
| 25 | + }); | ||
| 26 | + } | ||
| 27 | + else { | ||
| 28 | + $(this).hide().parents('.header-title').find('.uk-icon-question-circle').show(); | ||
| 29 | + } | ||
| 30 | + }); | ||
| 31 | + | ||
| 32 | + //记录状态 | ||
| 33 | + storage.setItem(locaKey, 0); | ||
| 34 | + }); | ||
| 35 | + | ||
| 36 | + var flag=storage.getItem(locaKey); | ||
| 37 | + if(flag && flag==1) | ||
| 38 | + openLegend(); | ||
| 39 | + }; | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + //展开图例 | ||
| 43 | + var openLegend = function () { | ||
| 44 | + $('.qtip.sch-tl-tip').qtip('destroy', true); | ||
| 45 | + | ||
| 46 | + //隐藏ICON | ||
| 47 | + $('.schedule-wrap i.uk-icon-question-circle').hide(); | ||
| 48 | + | ||
| 49 | + var anim = 'uk-animation-slide-top'; | ||
| 50 | + //显示 fixed_legend | ||
| 51 | + $('.schedule-wrap .fixed_legend').each(function () { | ||
| 52 | + if (!$(this).parents('.header-title').is(':hidden')) { | ||
| 53 | + $(this).addClass(anim).one('webkitAnimationEnd animationend', function () { | ||
| 54 | + $(this).removeClass(anim); | ||
| 55 | + }); | ||
| 56 | + } | ||
| 57 | + }); | ||
| 58 | + $('.schedule-wrap .fixed_legend').css('display', 'inline-block'); | ||
| 59 | + | ||
| 60 | + //记录状态 | ||
| 61 | + storage.setItem(locaKey, 1); | ||
| 62 | + }; | ||
| 63 | + | ||
| 64 | + return { | ||
| 65 | + init: initLegend | ||
| 66 | + }; | ||
| 67 | })(); | 67 | })(); |
| 68 | \ No newline at end of file | 68 | \ No newline at end of file |