Commit 6e93dfe89c75dfb0bd74aaf60def11e9974a23ce
Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into
minhang
Showing
92 changed files
with
3354 additions
and
2544 deletions
src/main/java/com/bsth/controller/schedule/BController.java
| 1 | package com.bsth.controller.schedule; | 1 | package com.bsth.controller.schedule; |
| 2 | 2 | ||
| 3 | +import com.bsth.common.Constants; | ||
| 3 | import com.bsth.common.ResponseCode; | 4 | import com.bsth.common.ResponseCode; |
| 5 | +import com.bsth.entity.schedule.BEntity; | ||
| 6 | +import com.bsth.entity.sys.SysUser; | ||
| 4 | import com.bsth.service.schedule.BService; | 7 | import com.bsth.service.schedule.BService; |
| 5 | import com.bsth.service.schedule.ScheduleException; | 8 | import com.bsth.service.schedule.ScheduleException; |
| 9 | +import com.bsth.service.sys.SysUserService; | ||
| 6 | import com.google.common.base.Splitter; | 10 | import com.google.common.base.Splitter; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.data.domain.PageRequest; | 12 | import org.springframework.data.domain.PageRequest; |
| 9 | import org.springframework.data.domain.Sort; | 13 | import org.springframework.data.domain.Sort; |
| 10 | import org.springframework.web.bind.annotation.*; | 14 | import org.springframework.web.bind.annotation.*; |
| 11 | 15 | ||
| 16 | +import javax.servlet.http.HttpSession; | ||
| 12 | import java.io.Serializable; | 17 | import java.io.Serializable; |
| 13 | -import java.util.ArrayList; | ||
| 14 | -import java.util.HashMap; | ||
| 15 | -import java.util.List; | ||
| 16 | -import java.util.Map; | 18 | +import java.util.*; |
| 17 | 19 | ||
| 18 | /** | 20 | /** |
| 19 | * 基础控制器。 | 21 | * 基础控制器。 |
| @@ -21,12 +23,24 @@ import java.util.Map; | @@ -21,12 +23,24 @@ import java.util.Map; | ||
| 21 | public class BController<T, ID extends Serializable> { | 23 | public class BController<T, ID extends Serializable> { |
| 22 | @Autowired | 24 | @Autowired |
| 23 | protected BService<T, ID> bService; | 25 | protected BService<T, ID> bService; |
| 26 | + @Autowired | ||
| 27 | + private SysUserService sysUserService; | ||
| 24 | 28 | ||
| 25 | // CRUD 操作 | 29 | // CRUD 操作 |
| 26 | // Create操作 | 30 | // Create操作 |
| 27 | @RequestMapping(method = RequestMethod.POST) | 31 | @RequestMapping(method = RequestMethod.POST) |
| 28 | - public Map<String, Object> save(@RequestBody T t) { | ||
| 29 | - T t_saved = bService.save(t); | 32 | + public Map<String, Object> save(@RequestBody T t, HttpSession httpSession) { |
| 33 | + // 判定T是否是BEntity的子类,增加新的字段 | ||
| 34 | + String userName = String.valueOf(httpSession.getAttribute(Constants.SESSION_USERNAME)); | ||
| 35 | + SysUser sysUser = sysUserService.findByUserName(userName); | ||
| 36 | + BEntity t_b = null; | ||
| 37 | + if (t instanceof BEntity) { | ||
| 38 | + t_b = (BEntity) t; | ||
| 39 | + t_b.setCreateBy(sysUser); | ||
| 40 | + t_b.setCreateDate(new Date()); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + T t_saved = bService.save(t_b == null ? t : (T) t_b); | ||
| 30 | Map<String, Object> rtn = new HashMap<>(); | 44 | Map<String, Object> rtn = new HashMap<>(); |
| 31 | rtn.put("status", ResponseCode.SUCCESS); | 45 | rtn.put("status", ResponseCode.SUCCESS); |
| 32 | rtn.put("data", t_saved); | 46 | rtn.put("data", t_saved); |
| @@ -34,8 +48,21 @@ public class BController<T, ID extends Serializable> { | @@ -34,8 +48,21 @@ public class BController<T, ID extends Serializable> { | ||
| 34 | } | 48 | } |
| 35 | // Update操作 | 49 | // Update操作 |
| 36 | @RequestMapping(value="/{id}", method = RequestMethod.POST) | 50 | @RequestMapping(value="/{id}", method = RequestMethod.POST) |
| 37 | - public Map<String, Object> update(@RequestBody T t) { | ||
| 38 | - return save(t); | 51 | + public Map<String, Object> update(@RequestBody T t, HttpSession httpSession) { |
| 52 | + String userName = String.valueOf(httpSession.getAttribute(Constants.SESSION_USERNAME)); | ||
| 53 | + SysUser sysUser = sysUserService.findByUserName(userName); | ||
| 54 | + BEntity t_b = null; | ||
| 55 | + if (t instanceof BEntity) { | ||
| 56 | + t_b = (BEntity) t; | ||
| 57 | + t_b.setUpdateBy(sysUser); | ||
| 58 | + t_b.setUpdateDate(new Date()); | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + T t_updated = bService.save(t_b == null ? t : (T) t_b); | ||
| 62 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 63 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 64 | + rtn.put("data", t_updated); | ||
| 65 | + return rtn; | ||
| 39 | } | 66 | } |
| 40 | // Research操作 | 67 | // Research操作 |
| 41 | @RequestMapping(value = "/{id}", method = RequestMethod.GET) | 68 | @RequestMapping(value = "/{id}", method = RequestMethod.GET) |
| @@ -97,9 +124,10 @@ public class BController<T, ID extends Serializable> { | @@ -97,9 +124,10 @@ public class BController<T, ID extends Serializable> { | ||
| 97 | 124 | ||
| 98 | // Delete操作 | 125 | // Delete操作 |
| 99 | @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) | 126 | @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) |
| 100 | - public Map<String, Object> delete(@PathVariable("id") ID id) { | 127 | + public Map<String, Object> delete(@PathVariable("id") ID id, HttpSession httpSession) { |
| 101 | Map<String, Object> rtn = new HashMap<>(); | 128 | Map<String, Object> rtn = new HashMap<>(); |
| 102 | try { | 129 | try { |
| 130 | + // 由于种种原因,这里不保存用户和操作时间了 | ||
| 103 | bService.delete(id); | 131 | bService.delete(id); |
| 104 | rtn.put("status", ResponseCode.SUCCESS); | 132 | rtn.put("status", ResponseCode.SUCCESS); |
| 105 | } catch (ScheduleException exp) { | 133 | } catch (ScheduleException exp) { |
src/main/java/com/bsth/controller/schedule/basicinfo/CarDeviceController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.basicinfo; | ||
| 2 | + | ||
| 3 | +import com.bsth.common.ResponseCode; | ||
| 4 | +import com.bsth.controller.schedule.BController; | ||
| 5 | +import com.bsth.entity.CarDevice; | ||
| 6 | +import com.bsth.service.schedule.CarDeviceService; | ||
| 7 | +import com.bsth.service.schedule.ScheduleException; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 10 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 11 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 12 | +import org.springframework.web.bind.annotation.RestController; | ||
| 13 | + | ||
| 14 | +import java.util.HashMap; | ||
| 15 | +import java.util.Map; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * Created by xu on 16/12/15. | ||
| 19 | + */ | ||
| 20 | +@RestController(value = "carDeviceController_sc") | ||
| 21 | +@RequestMapping("cde_sc") | ||
| 22 | +public class CarDeviceController extends BController<CarDevice, Long> { | ||
| 23 | + @Autowired | ||
| 24 | + private CarDeviceService carDeviceService; | ||
| 25 | + | ||
| 26 | + @RequestMapping(value = "/validate_qyrq", method = RequestMethod.GET) | ||
| 27 | + public Map<String, Object> validate_qyrq(@RequestParam Map<String, Object> param) { | ||
| 28 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 29 | + | ||
| 30 | + try { | ||
| 31 | + // 启用日期验证 | ||
| 32 | + CarDevice carDevice = new CarDevice( | ||
| 33 | + param.get("id_eq"), | ||
| 34 | + param.get("xl_eq"), | ||
| 35 | + param.get("cl_eq"), | ||
| 36 | + param.get("qyrq_eq") | ||
| 37 | + ); | ||
| 38 | + carDeviceService.validate_qyrq(carDevice); | ||
| 39 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 40 | + } catch (ScheduleException exp) { | ||
| 41 | + rtn.put("status", ResponseCode.ERROR); | ||
| 42 | + rtn.put("msg", exp.getMessage()); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + return rtn; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | +} |
src/main/java/com/bsth/controller/schedule/basicinfo/EmployeeController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.basicinfo; | ||
| 2 | + | ||
| 3 | +import com.bsth.common.ResponseCode; | ||
| 4 | +import com.bsth.controller.schedule.BController; | ||
| 5 | +import com.bsth.entity.Personnel; | ||
| 6 | +import com.bsth.service.schedule.EmployeeService; | ||
| 7 | +import com.bsth.service.schedule.ScheduleException; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 10 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 11 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 12 | +import org.springframework.web.bind.annotation.RestController; | ||
| 13 | + | ||
| 14 | +import java.util.HashMap; | ||
| 15 | +import java.util.Map; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 人员基础信息Controller | ||
| 19 | + */ | ||
| 20 | +@RestController | ||
| 21 | +@RequestMapping("ee") | ||
| 22 | +public class EmployeeController extends BController<Personnel, Integer> { | ||
| 23 | + @Autowired | ||
| 24 | + private EmployeeService employeeService; | ||
| 25 | + | ||
| 26 | + @RequestMapping(value = "/validate_gh", method = RequestMethod.GET) | ||
| 27 | + public Map<String, Object> validate_gh(@RequestParam Map<String, Object> param) { | ||
| 28 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 29 | + try { | ||
| 30 | + // 工号验证 | ||
| 31 | + Personnel personnel = new Personnel( | ||
| 32 | + param.get("id_eq"), | ||
| 33 | + param.get("companyCode_eq"), | ||
| 34 | + param.get("jobCode_eq") | ||
| 35 | + ); | ||
| 36 | + employeeService.validate_gh(personnel); | ||
| 37 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 38 | + } catch (ScheduleException exp) { | ||
| 39 | + rtn.put("status", ResponseCode.ERROR); | ||
| 40 | + rtn.put("msg", exp.getMessage()); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + return rtn; | ||
| 44 | + } | ||
| 45 | +} |
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java
| @@ -48,8 +48,8 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | @@ -48,8 +48,8 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | ||
| 48 | return guideboardInfoRepository.findLpName(ttid); | 48 | return guideboardInfoRepository.findLpName(ttid); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | - @RequestMapping(value = "/validate1", method = RequestMethod.GET) | ||
| 52 | - public Map<String, Object> validate1(@RequestParam Map<String, Object> param) { | 51 | + @RequestMapping(value = "/validate_lpno", method = RequestMethod.GET) |
| 52 | + public Map<String, Object> validate_lpno(@RequestParam Map<String, Object> param) { | ||
| 53 | Map<String, Object> rtn = new HashMap<>(); | 53 | Map<String, Object> rtn = new HashMap<>(); |
| 54 | try { | 54 | try { |
| 55 | // 路牌编号验证 | 55 | // 路牌编号验证 |
| @@ -59,7 +59,7 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | @@ -59,7 +59,7 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | ||
| 59 | param.get("lpNo_eq"), | 59 | param.get("lpNo_eq"), |
| 60 | null | 60 | null |
| 61 | ); | 61 | ); |
| 62 | - guideboardInfoService.validate(guideboardInfo); | 62 | + guideboardInfoService.validate_lpno(guideboardInfo); |
| 63 | rtn.put("status", ResponseCode.SUCCESS); | 63 | rtn.put("status", ResponseCode.SUCCESS); |
| 64 | } catch (ScheduleException exp) { | 64 | } catch (ScheduleException exp) { |
| 65 | rtn.put("status", ResponseCode.ERROR); | 65 | rtn.put("status", ResponseCode.ERROR); |
| @@ -68,8 +68,8 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | @@ -68,8 +68,8 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | ||
| 68 | return rtn; | 68 | return rtn; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | - @RequestMapping(value = "/validate2", method = RequestMethod.GET) | ||
| 72 | - public Map<String, Object> validate2(@RequestParam Map<String, Object> param) { | 71 | + @RequestMapping(value = "/validate_lpname", method = RequestMethod.GET) |
| 72 | + public Map<String, Object> validate_lpname(@RequestParam Map<String, Object> param) { | ||
| 73 | Map<String, Object> rtn = new HashMap<>(); | 73 | Map<String, Object> rtn = new HashMap<>(); |
| 74 | try { | 74 | try { |
| 75 | // 路牌名称验证 | 75 | // 路牌名称验证 |
| @@ -79,7 +79,7 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | @@ -79,7 +79,7 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> | ||
| 79 | null, | 79 | null, |
| 80 | param.get("lpName_eq") | 80 | param.get("lpName_eq") |
| 81 | ); | 81 | ); |
| 82 | - guideboardInfoService.validate(guideboardInfo); | 82 | + guideboardInfoService.validate_lpname(guideboardInfo); |
| 83 | rtn.put("status", ResponseCode.SUCCESS); | 83 | rtn.put("status", ResponseCode.SUCCESS); |
| 84 | } catch (ScheduleException exp) { | 84 | } catch (ScheduleException exp) { |
| 85 | rtn.put("status", ResponseCode.ERROR); | 85 | rtn.put("status", ResponseCode.ERROR); |
src/main/java/com/bsth/data/forecast/ForecastRealServer.java
| 1 | package com.bsth.data.forecast; | 1 | package com.bsth.data.forecast; |
| 2 | 2 | ||
| 3 | -import java.text.DecimalFormat; | ||
| 4 | -import java.util.ArrayList; | ||
| 5 | -import java.util.HashMap; | ||
| 6 | -import java.util.List; | ||
| 7 | -import java.util.Map; | ||
| 8 | -import java.util.concurrent.TimeUnit; | ||
| 9 | - | ||
| 10 | -import org.slf4j.Logger; | ||
| 11 | -import org.slf4j.LoggerFactory; | ||
| 12 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | -import org.springframework.boot.CommandLineRunner; | ||
| 14 | -import org.springframework.stereotype.Component; | ||
| 15 | - | ||
| 16 | -import com.bsth.Application; | ||
| 17 | import com.bsth.data.forecast.entity.ForecastResult; | 3 | import com.bsth.data.forecast.entity.ForecastResult; |
| 18 | import com.bsth.data.forecast.entity.ForecastResult.ForecastResultItem; | 4 | import com.bsth.data.forecast.entity.ForecastResult.ForecastResultItem; |
| 19 | import com.bsth.data.forecast.entity.SimpleRoute; | 5 | import com.bsth.data.forecast.entity.SimpleRoute; |
| @@ -23,6 +9,17 @@ import com.bsth.data.gpsdata.GpsRealData; | @@ -23,6 +9,17 @@ import com.bsth.data.gpsdata.GpsRealData; | ||
| 23 | import com.bsth.data.schedule.DayOfSchedule; | 9 | import com.bsth.data.schedule.DayOfSchedule; |
| 24 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 10 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 25 | import com.google.common.collect.ArrayListMultimap; | 11 | import com.google.common.collect.ArrayListMultimap; |
| 12 | +import org.slf4j.Logger; | ||
| 13 | +import org.slf4j.LoggerFactory; | ||
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | +import org.springframework.boot.CommandLineRunner; | ||
| 16 | +import org.springframework.stereotype.Component; | ||
| 17 | + | ||
| 18 | +import java.text.DecimalFormat; | ||
| 19 | +import java.util.ArrayList; | ||
| 20 | +import java.util.HashMap; | ||
| 21 | +import java.util.List; | ||
| 22 | +import java.util.Map; | ||
| 26 | 23 | ||
| 27 | /** | 24 | /** |
| 28 | * | 25 | * |
| @@ -61,7 +58,7 @@ public class ForecastRealServer implements CommandLineRunner { | @@ -61,7 +58,7 @@ public class ForecastRealServer implements CommandLineRunner { | ||
| 61 | @Override | 58 | @Override |
| 62 | public void run(String... arg0) throws Exception { | 59 | public void run(String... arg0) throws Exception { |
| 63 | //2小时更新一次站点间耗时数据 | 60 | //2小时更新一次站点间耗时数据 |
| 64 | -// Application.mainServices.scheduleWithFixedDelay(dataLoader, 12, 120 * 60, TimeUnit.SECONDS); | 61 | + //Application.mainServices.scheduleWithFixedDelay(dataLoader, 12, 120 * 60, TimeUnit.SECONDS); |
| 65 | } | 62 | } |
| 66 | 63 | ||
| 67 | /** | 64 | /** |
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
| @@ -3,6 +3,7 @@ package com.bsth.data.schedule; | @@ -3,6 +3,7 @@ package com.bsth.data.schedule; | ||
| 3 | import com.bsth.data.LineConfigData; | 3 | import com.bsth.data.LineConfigData; |
| 4 | import com.bsth.entity.realcontrol.LineConfig; | 4 | import com.bsth.entity.realcontrol.LineConfig; |
| 5 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 5 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 6 | +import org.apache.commons.lang3.StringUtils; | ||
| 6 | import org.joda.time.format.DateTimeFormat; | 7 | import org.joda.time.format.DateTimeFormat; |
| 7 | import org.joda.time.format.DateTimeFormatter; | 8 | import org.joda.time.format.DateTimeFormatter; |
| 8 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| @@ -115,8 +116,11 @@ public class SchAttrCalculator { | @@ -115,8 +116,11 @@ public class SchAttrCalculator { | ||
| 115 | ScheduleRealInfo prve = list.get(0), curr; | 116 | ScheduleRealInfo prve = list.get(0), curr; |
| 116 | for(int i = 1; i < len; i ++){ | 117 | for(int i = 1; i < len; i ++){ |
| 117 | curr = list.get(i); | 118 | curr = list.get(i); |
| 118 | - if(prve.getZdzName().equals(curr.getQdzName())) | 119 | + if(prve.getZdzName().equals(curr.getQdzName())){ |
| 119 | curr.setQdzArrDateJH(prve.getZdsj()); | 120 | curr.setQdzArrDateJH(prve.getZdsj()); |
| 121 | + if(StringUtils.isNotEmpty(prve.getZdsjActual()) && StringUtils.isEmpty(curr.getQdzArrDatesj())) | ||
| 122 | + curr.setQdzArrDatesj(prve.getZdsjActual()); | ||
| 123 | + } | ||
| 120 | 124 | ||
| 121 | prve = curr; | 125 | prve = curr; |
| 122 | } | 126 | } |
src/main/java/com/bsth/entity/CarDevice.java
| 1 | package com.bsth.entity; | 1 | package com.bsth.entity; |
| 2 | 2 | ||
| 3 | -import com.bsth.entity.sys.SysUser; | 3 | +import com.bsth.entity.schedule.BEntity; |
| 4 | +import org.joda.time.DateTime; | ||
| 4 | 5 | ||
| 5 | import javax.persistence.*; | 6 | import javax.persistence.*; |
| 6 | import java.util.Date; | 7 | import java.util.Date; |
| @@ -10,7 +11,7 @@ import java.util.Date; | @@ -10,7 +11,7 @@ import java.util.Date; | ||
| 10 | */ | 11 | */ |
| 11 | @Entity | 12 | @Entity |
| 12 | @Table(name = "bsth_c_car_device") | 13 | @Table(name = "bsth_c_car_device") |
| 13 | -public class CarDevice { | 14 | +public class CarDevice extends BEntity { |
| 14 | 15 | ||
| 15 | /** 主键 */ | 16 | /** 主键 */ |
| 16 | @Id | 17 | @Id |
| @@ -62,18 +63,26 @@ public class CarDevice { | @@ -62,18 +63,26 @@ public class CarDevice { | ||
| 62 | @Column(nullable = false) | 63 | @Column(nullable = false) |
| 63 | private Boolean isCancel = false; | 64 | private Boolean isCancel = false; |
| 64 | 65 | ||
| 65 | - /** 创建人 */ | ||
| 66 | - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | ||
| 67 | - private SysUser createBy; | ||
| 68 | - /** 修改人 */ | ||
| 69 | - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | ||
| 70 | - private SysUser updateBy; | ||
| 71 | - /** 创建日期 */ | ||
| 72 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 73 | - private Date createDate; | ||
| 74 | - /** 修改日期 */ | ||
| 75 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 76 | - private Date updateDate; | 66 | + public CarDevice() {} |
| 67 | + public CarDevice(Object id, Object xlid, Object clid, Object qyrq) { | ||
| 68 | + if (id != null) { | ||
| 69 | + this.id = Long.valueOf(id.toString()); | ||
| 70 | + } | ||
| 71 | + if (xlid != null) { | ||
| 72 | + this.xl = Integer.valueOf(xlid.toString()); | ||
| 73 | + } | ||
| 74 | + if (clid != null) { | ||
| 75 | + this.cl = Integer.valueOf(clid.toString()); | ||
| 76 | + } | ||
| 77 | + if (qyrq != null) { | ||
| 78 | + try { | ||
| 79 | + this.qyrq = new Date(); | ||
| 80 | + this.qyrq.setTime(Long.parseLong(qyrq.toString())); | ||
| 81 | + } catch (Exception exp) { | ||
| 82 | + this.qyrq = new DateTime(qyrq.toString()).toDate(); | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + } | ||
| 77 | 86 | ||
| 78 | public Long getId() { | 87 | public Long getId() { |
| 79 | return id; | 88 | return id; |
| @@ -179,38 +188,6 @@ public class CarDevice { | @@ -179,38 +188,6 @@ public class CarDevice { | ||
| 179 | this.guaranteeDesc = guaranteeDesc; | 188 | this.guaranteeDesc = guaranteeDesc; |
| 180 | } | 189 | } |
| 181 | 190 | ||
| 182 | - public SysUser getCreateBy() { | ||
| 183 | - return createBy; | ||
| 184 | - } | ||
| 185 | - | ||
| 186 | - public void setCreateBy(SysUser createBy) { | ||
| 187 | - this.createBy = createBy; | ||
| 188 | - } | ||
| 189 | - | ||
| 190 | - public SysUser getUpdateBy() { | ||
| 191 | - return updateBy; | ||
| 192 | - } | ||
| 193 | - | ||
| 194 | - public void setUpdateBy(SysUser updateBy) { | ||
| 195 | - this.updateBy = updateBy; | ||
| 196 | - } | ||
| 197 | - | ||
| 198 | - public Date getCreateDate() { | ||
| 199 | - return createDate; | ||
| 200 | - } | ||
| 201 | - | ||
| 202 | - public void setCreateDate(Date createDate) { | ||
| 203 | - this.createDate = createDate; | ||
| 204 | - } | ||
| 205 | - | ||
| 206 | - public Date getUpdateDate() { | ||
| 207 | - return updateDate; | ||
| 208 | - } | ||
| 209 | - | ||
| 210 | - public void setUpdateDate(Date updateDate) { | ||
| 211 | - this.updateDate = updateDate; | ||
| 212 | - } | ||
| 213 | - | ||
| 214 | public Date getQyrq() { | 191 | public Date getQyrq() { |
| 215 | return qyrq; | 192 | return qyrq; |
| 216 | } | 193 | } |
src/main/java/com/bsth/entity/Cars.java
| 1 | package com.bsth.entity; | 1 | package com.bsth.entity; |
| 2 | 2 | ||
| 3 | -import com.bsth.entity.sys.SysUser; | 3 | +import com.bsth.entity.schedule.BEntity; |
| 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 5 | 5 | ||
| 6 | import javax.persistence.*; | 6 | import javax.persistence.*; |
| @@ -24,7 +24,7 @@ import java.util.Date; | @@ -24,7 +24,7 @@ import java.util.Date; | ||
| 24 | @Entity | 24 | @Entity |
| 25 | @Table(name = "bsth_c_cars") | 25 | @Table(name = "bsth_c_cars") |
| 26 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | 26 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) |
| 27 | -public class Cars implements Serializable { | 27 | +public class Cars extends BEntity implements Serializable { |
| 28 | 28 | ||
| 29 | /** 主键Id */ | 29 | /** 主键Id */ |
| 30 | @Id | 30 | @Id |
| @@ -136,23 +136,6 @@ public class Cars implements Serializable { | @@ -136,23 +136,6 @@ public class Cars implements Serializable { | ||
| 136 | /** 线路名称(TODO:在原系统里没有,这里暂时留着,并且不做线路关联,只保留个名字) */ | 136 | /** 线路名称(TODO:在原系统里没有,这里暂时留着,并且不做线路关联,只保留个名字) */ |
| 137 | private String xlmc; | 137 | private String xlmc; |
| 138 | 138 | ||
| 139 | - | ||
| 140 | - /** 创建人 */ | ||
| 141 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 142 | - private SysUser createBy; | ||
| 143 | - | ||
| 144 | - /** 修改人 */ | ||
| 145 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 146 | - private SysUser updateBy; | ||
| 147 | - | ||
| 148 | - /** 创建日期 */ | ||
| 149 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 150 | - private Date createDate; | ||
| 151 | - | ||
| 152 | - /** 修改日期 */ | ||
| 153 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 154 | - private Date updateDate; | ||
| 155 | - | ||
| 156 | public Cars() {} | 139 | public Cars() {} |
| 157 | 140 | ||
| 158 | public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) { | 141 | public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) { |
| @@ -516,36 +499,4 @@ public class Cars implements Serializable { | @@ -516,36 +499,4 @@ public class Cars implements Serializable { | ||
| 516 | public void setXlmc(String xlmc) { | 499 | public void setXlmc(String xlmc) { |
| 517 | this.xlmc = xlmc; | 500 | this.xlmc = xlmc; |
| 518 | } | 501 | } |
| 519 | - | ||
| 520 | - public SysUser getCreateBy() { | ||
| 521 | - return createBy; | ||
| 522 | - } | ||
| 523 | - | ||
| 524 | - public void setCreateBy(SysUser createBy) { | ||
| 525 | - this.createBy = createBy; | ||
| 526 | - } | ||
| 527 | - | ||
| 528 | - public SysUser getUpdateBy() { | ||
| 529 | - return updateBy; | ||
| 530 | - } | ||
| 531 | - | ||
| 532 | - public void setUpdateBy(SysUser updateBy) { | ||
| 533 | - this.updateBy = updateBy; | ||
| 534 | - } | ||
| 535 | - | ||
| 536 | - public Date getCreateDate() { | ||
| 537 | - return createDate; | ||
| 538 | - } | ||
| 539 | - | ||
| 540 | - public void setCreateDate(Date createDate) { | ||
| 541 | - this.createDate = createDate; | ||
| 542 | - } | ||
| 543 | - | ||
| 544 | - public Date getUpdateDate() { | ||
| 545 | - return updateDate; | ||
| 546 | - } | ||
| 547 | - | ||
| 548 | - public void setUpdateDate(Date updateDate) { | ||
| 549 | - this.updateDate = updateDate; | ||
| 550 | - } | ||
| 551 | } | 502 | } |
src/main/java/com/bsth/entity/Personnel.java
| 1 | package com.bsth.entity; | 1 | package com.bsth.entity; |
| 2 | 2 | ||
| 3 | -import com.bsth.entity.sys.SysUser; | 3 | +import com.bsth.entity.schedule.BEntity; |
| 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 5 | 5 | ||
| 6 | import javax.persistence.*; | 6 | import javax.persistence.*; |
| 7 | -import java.util.Date; | ||
| 8 | 7 | ||
| 9 | /** | 8 | /** |
| 10 | * | 9 | * |
| @@ -23,7 +22,7 @@ import java.util.Date; | @@ -23,7 +22,7 @@ import java.util.Date; | ||
| 23 | @Entity | 22 | @Entity |
| 24 | @Table(name = "bsth_c_personnel") | 23 | @Table(name = "bsth_c_personnel") |
| 25 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | 24 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) |
| 26 | -public class Personnel { | 25 | +public class Personnel extends BEntity { |
| 27 | 26 | ||
| 28 | /** 主键Id */ | 27 | /** 主键Id */ |
| 29 | @Id | 28 | @Id |
| @@ -59,6 +58,20 @@ public class Personnel { | @@ -59,6 +58,20 @@ public class Personnel { | ||
| 59 | /** 身份证 */ | 58 | /** 身份证 */ |
| 60 | private String card; | 59 | private String card; |
| 61 | 60 | ||
| 61 | + public Personnel() {} | ||
| 62 | + | ||
| 63 | + public Personnel(Object id, Object companyCode, Object gh) { | ||
| 64 | + if (id != null) { | ||
| 65 | + this.id = Integer.valueOf(id.toString()); | ||
| 66 | + } | ||
| 67 | + if (companyCode != null) { | ||
| 68 | + this.companyCode = companyCode.toString(); | ||
| 69 | + } | ||
| 70 | + if (gh != null) { | ||
| 71 | + this.jobCode = gh.toString(); | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + | ||
| 62 | public String getCard() { | 75 | public String getCard() { |
| 63 | return card; | 76 | return card; |
| 64 | } | 77 | } |
| @@ -78,23 +91,6 @@ public class Personnel { | @@ -78,23 +91,6 @@ public class Personnel { | ||
| 78 | /** 描述(TODO:在原系统里没有,这里暂时留着) */ | 91 | /** 描述(TODO:在原系统里没有,这里暂时留着) */ |
| 79 | private String descriptions; | 92 | private String descriptions; |
| 80 | 93 | ||
| 81 | - | ||
| 82 | - | ||
| 83 | - /** 创建人 */ | ||
| 84 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 85 | - private SysUser createBy; | ||
| 86 | - /** 修改人 */ | ||
| 87 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 88 | - private SysUser updateBy; | ||
| 89 | - | ||
| 90 | - /** 创建日期 */ | ||
| 91 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 92 | - private Date createDate; | ||
| 93 | - | ||
| 94 | - /** 修改日期 */ | ||
| 95 | - @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 96 | - private Date updateDate; | ||
| 97 | - | ||
| 98 | public Integer getId() { | 94 | public Integer getId() { |
| 99 | return id; | 95 | return id; |
| 100 | } | 96 | } |
| @@ -222,36 +218,4 @@ public class Personnel { | @@ -222,36 +218,4 @@ public class Personnel { | ||
| 222 | public void setDescriptions(String descriptions) { | 218 | public void setDescriptions(String descriptions) { |
| 223 | this.descriptions = descriptions; | 219 | this.descriptions = descriptions; |
| 224 | } | 220 | } |
| 225 | - | ||
| 226 | - public SysUser getCreateBy() { | ||
| 227 | - return createBy; | ||
| 228 | - } | ||
| 229 | - | ||
| 230 | - public void setCreateBy(SysUser createBy) { | ||
| 231 | - this.createBy = createBy; | ||
| 232 | - } | ||
| 233 | - | ||
| 234 | - public SysUser getUpdateBy() { | ||
| 235 | - return updateBy; | ||
| 236 | - } | ||
| 237 | - | ||
| 238 | - public void setUpdateBy(SysUser updateBy) { | ||
| 239 | - this.updateBy = updateBy; | ||
| 240 | - } | ||
| 241 | - | ||
| 242 | - public Date getCreateDate() { | ||
| 243 | - return createDate; | ||
| 244 | - } | ||
| 245 | - | ||
| 246 | - public void setCreateDate(Date createDate) { | ||
| 247 | - this.createDate = createDate; | ||
| 248 | - } | ||
| 249 | - | ||
| 250 | - public Date getUpdateDate() { | ||
| 251 | - return updateDate; | ||
| 252 | - } | ||
| 253 | - | ||
| 254 | - public void setUpdateDate(Date updateDate) { | ||
| 255 | - this.updateDate = updateDate; | ||
| 256 | - } | ||
| 257 | } | 221 | } |
src/main/java/com/bsth/entity/mcy_forms/Operationservice.java
| @@ -13,6 +13,26 @@ public class Operationservice { | @@ -13,6 +13,26 @@ public class Operationservice { | ||
| 13 | private String emptMileage;//空驶里程 | 13 | private String emptMileage;//空驶里程 |
| 14 | 14 | ||
| 15 | private String sjbc;//实际班次 | 15 | private String sjbc;//实际班次 |
| 16 | + | ||
| 17 | + private String jname; | ||
| 18 | + | ||
| 19 | + private String clzbh; | ||
| 20 | + | ||
| 21 | + public String getJname() { | ||
| 22 | + return jname; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + public void setJname(String jname) { | ||
| 26 | + this.jname = jname; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + public String getClzbh() { | ||
| 30 | + return clzbh; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + public void setClzbh(String clzbh) { | ||
| 34 | + this.clzbh = clzbh; | ||
| 35 | + } | ||
| 16 | 36 | ||
| 17 | public String getXlName() { | 37 | public String getXlName() { |
| 18 | return xlName; | 38 | return xlName; |
src/main/java/com/bsth/entity/mcy_forms/Shifday.java
| @@ -34,7 +34,36 @@ public class Shifday { | @@ -34,7 +34,36 @@ public class Shifday { | ||
| 34 | 34 | ||
| 35 | private String sjbc;//实际班次 | 35 | private String sjbc;//实际班次 |
| 36 | 36 | ||
| 37 | + private String jgh; | ||
| 37 | 38 | ||
| 39 | + private String zbh; | ||
| 40 | + | ||
| 41 | + private String rq; | ||
| 42 | + | ||
| 43 | + public String getRq() { | ||
| 44 | + return rq; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public void setRq(String rq) { | ||
| 48 | + this.rq = rq; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + public String getJgh() { | ||
| 52 | + return jgh; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public void setJgh(String jgh) { | ||
| 56 | + this.jgh = jgh; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public String getZbh() { | ||
| 60 | + return zbh; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + public void setZbh(String zbh) { | ||
| 64 | + this.zbh = zbh; | ||
| 65 | + } | ||
| 66 | + | ||
| 38 | public String getJhlc() { | 67 | public String getJhlc() { |
| 39 | return jhlc; | 68 | return jhlc; |
| 40 | } | 69 | } |
src/main/java/com/bsth/entity/mcy_forms/Shiftuehiclemanth.java
| @@ -20,7 +20,24 @@ public class Shiftuehiclemanth { | @@ -20,7 +20,24 @@ public class Shiftuehiclemanth { | ||
| 20 | 20 | ||
| 21 | private String sjbc;//实际班次 | 21 | private String sjbc;//实际班次 |
| 22 | 22 | ||
| 23 | - | 23 | + private String jgh; |
| 24 | + private String zbh; | ||
| 25 | + public String getJgh() { | ||
| 26 | + return jgh; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + public void setJgh(String jgh) { | ||
| 30 | + this.jgh = jgh; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + public String getZbh() { | ||
| 34 | + return zbh; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + public void setZbh(String zbh) { | ||
| 38 | + this.zbh = zbh; | ||
| 39 | + } | ||
| 40 | + | ||
| 24 | public String getCjbc() { | 41 | public String getCjbc() { |
| 25 | return cjbc; | 42 | return cjbc; |
| 26 | } | 43 | } |
src/main/java/com/bsth/entity/mcy_forms/Vehicleloading.java
| @@ -24,6 +24,26 @@ public class Vehicleloading { | @@ -24,6 +24,26 @@ public class Vehicleloading { | ||
| 24 | 24 | ||
| 25 | private String sjbc;//实际班次 | 25 | private String sjbc;//实际班次 |
| 26 | 26 | ||
| 27 | + private String jgh;//驾驶员工号 | ||
| 28 | + | ||
| 29 | + private String zbh;//车辆自编号 | ||
| 30 | + | ||
| 31 | + public String getJgh() { | ||
| 32 | + return jgh; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public void setJgh(String jgh) { | ||
| 36 | + this.jgh = jgh; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public String getZbh() { | ||
| 40 | + return zbh; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public void setZbh(String zbh) { | ||
| 44 | + this.zbh = zbh; | ||
| 45 | + } | ||
| 46 | + | ||
| 27 | public String getLs() { | 47 | public String getLs() { |
| 28 | return ls; | 48 | return ls; |
| 29 | } | 49 | } |
src/main/java/com/bsth/entity/mcy_forms/Waybillday.java
| @@ -20,9 +20,29 @@ public class Waybillday { | @@ -20,9 +20,29 @@ public class Waybillday { | ||
| 20 | 20 | ||
| 21 | private String zlc;//里程 | 21 | private String zlc;//里程 |
| 22 | 22 | ||
| 23 | + public String getJgh() { | ||
| 24 | + return jgh; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public void setJgh(String jgh) { | ||
| 28 | + this.jgh = jgh; | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public String getRq() { | ||
| 32 | + return rq; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public void setRq(String rq) { | ||
| 36 | + this.rq = rq; | ||
| 37 | + } | ||
| 38 | + | ||
| 23 | private String yl;//用油 | 39 | private String yl;//用油 |
| 24 | 40 | ||
| 25 | private String nbbm;//机油 | 41 | private String nbbm;//机油 |
| 42 | + | ||
| 43 | + private String jgh;//员工号 | ||
| 44 | + | ||
| 45 | + private String rq;//日期 | ||
| 26 | 46 | ||
| 27 | public String getCarPlate() { | 47 | public String getCarPlate() { |
| 28 | return carPlate; | 48 | return carPlate; |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| @@ -163,7 +163,7 @@ public class ScheduleRealInfo { | @@ -163,7 +163,7 @@ public class ScheduleRealInfo { | ||
| 163 | private String qdzArrDatesj; | 163 | private String qdzArrDatesj; |
| 164 | 164 | ||
| 165 | /** 子任务 */ | 165 | /** 子任务 */ |
| 166 | - @OneToMany(fetch = FetchType.LAZY/*, cascade = CascadeType.ALL*/) | 166 | + @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) |
| 167 | private Set<ChildTaskPlan> cTasks = new HashSet<>(); | 167 | private Set<ChildTaskPlan> cTasks = new HashSet<>(); |
| 168 | 168 | ||
| 169 | /** 关联的公司名称 */ | 169 | /** 关联的公司名称 */ |
src/main/java/com/bsth/entity/schedule/BEntity.java
0 → 100644
| 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/CarConfigInfo.java
| @@ -2,7 +2,6 @@ package com.bsth.entity.schedule; | @@ -2,7 +2,6 @@ package com.bsth.entity.schedule; | ||
| 2 | 2 | ||
| 3 | import com.bsth.entity.Cars; | 3 | import com.bsth.entity.Cars; |
| 4 | import com.bsth.entity.Line; | 4 | import com.bsth.entity.Line; |
| 5 | -import com.bsth.entity.sys.SysUser; | ||
| 6 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | 5 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 7 | 6 | ||
| 8 | import javax.persistence.*; | 7 | import javax.persistence.*; |
| @@ -21,7 +20,7 @@ import java.util.Date; | @@ -21,7 +20,7 @@ import java.util.Date; | ||
| 21 | }) | 20 | }) |
| 22 | }) | 21 | }) |
| 23 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | 22 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) |
| 24 | -public class CarConfigInfo implements Serializable { | 23 | +public class CarConfigInfo extends BEntity implements Serializable { |
| 25 | 24 | ||
| 26 | /** 主健Id */ | 25 | /** 主健Id */ |
| 27 | @Id | 26 | @Id |
| @@ -59,20 +58,6 @@ public class CarConfigInfo implements Serializable { | @@ -59,20 +58,6 @@ public class CarConfigInfo implements Serializable { | ||
| 59 | @Column(nullable = false) | 58 | @Column(nullable = false) |
| 60 | private Boolean isCancel = false; | 59 | private Boolean isCancel = false; |
| 61 | 60 | ||
| 62 | - /** 创建人 */ | ||
| 63 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 64 | - private SysUser createBy; | ||
| 65 | - /** 修改人 */ | ||
| 66 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 67 | - private SysUser updateBy; | ||
| 68 | - | ||
| 69 | - /** 创建日期 */ | ||
| 70 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 71 | - private Date createDate; | ||
| 72 | - /** 修改日期 */ | ||
| 73 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 74 | - private Date updateDate; | ||
| 75 | - | ||
| 76 | public CarConfigInfo() {} | 61 | public CarConfigInfo() {} |
| 77 | public CarConfigInfo(Object id, Object xlid, Object xlname, Object clid) { | 62 | public CarConfigInfo(Object id, Object xlid, Object xlname, Object clid) { |
| 78 | if (id != null) { | 63 | if (id != null) { |
| @@ -164,38 +149,6 @@ public class CarConfigInfo implements Serializable { | @@ -164,38 +149,6 @@ public class CarConfigInfo implements Serializable { | ||
| 164 | this.isSwitch = isSwitch; | 149 | this.isSwitch = isSwitch; |
| 165 | } | 150 | } |
| 166 | 151 | ||
| 167 | - public SysUser getCreateBy() { | ||
| 168 | - return createBy; | ||
| 169 | - } | ||
| 170 | - | ||
| 171 | - public void setCreateBy(SysUser createBy) { | ||
| 172 | - this.createBy = createBy; | ||
| 173 | - } | ||
| 174 | - | ||
| 175 | - public SysUser getUpdateBy() { | ||
| 176 | - return updateBy; | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - public void setUpdateBy(SysUser updateBy) { | ||
| 180 | - this.updateBy = updateBy; | ||
| 181 | - } | ||
| 182 | - | ||
| 183 | - public Date getCreateDate() { | ||
| 184 | - return createDate; | ||
| 185 | - } | ||
| 186 | - | ||
| 187 | - public void setCreateDate(Date createDate) { | ||
| 188 | - this.createDate = createDate; | ||
| 189 | - } | ||
| 190 | - | ||
| 191 | - public Date getUpdateDate() { | ||
| 192 | - return updateDate; | ||
| 193 | - } | ||
| 194 | - | ||
| 195 | - public void setUpdateDate(Date updateDate) { | ||
| 196 | - this.updateDate = updateDate; | ||
| 197 | - } | ||
| 198 | - | ||
| 199 | public Boolean getIsCancel() { | 152 | public Boolean getIsCancel() { |
| 200 | return isCancel; | 153 | return isCancel; |
| 201 | } | 154 | } |
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
| @@ -3,13 +3,12 @@ package com.bsth.entity.schedule; | @@ -3,13 +3,12 @@ package com.bsth.entity.schedule; | ||
| 3 | import com.bsth.entity.Cars; | 3 | import com.bsth.entity.Cars; |
| 4 | import com.bsth.entity.Line; | 4 | import com.bsth.entity.Line; |
| 5 | import com.bsth.entity.Personnel; | 5 | import com.bsth.entity.Personnel; |
| 6 | -import com.bsth.entity.sys.SysUser; | ||
| 7 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | 6 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 8 | import org.hibernate.annotations.Formula; | 7 | import org.hibernate.annotations.Formula; |
| 9 | 8 | ||
| 10 | import javax.persistence.*; | 9 | import javax.persistence.*; |
| 11 | import javax.validation.constraints.NotNull; | 10 | import javax.validation.constraints.NotNull; |
| 12 | -import java.util.Date; | 11 | +import java.io.Serializable; |
| 13 | 12 | ||
| 14 | /** | 13 | /** |
| 15 | * 人员配置信息。 | 14 | * 人员配置信息。 |
| @@ -24,7 +23,7 @@ import java.util.Date; | @@ -24,7 +23,7 @@ import java.util.Date; | ||
| 24 | }) | 23 | }) |
| 25 | }) | 24 | }) |
| 26 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | 25 | @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) |
| 27 | -public class EmployeeConfigInfo { | 26 | +public class EmployeeConfigInfo extends BEntity implements Serializable { |
| 28 | 27 | ||
| 29 | /** 主键Id */ | 28 | /** 主键Id */ |
| 30 | @Id | 29 | @Id |
| @@ -55,20 +54,6 @@ public class EmployeeConfigInfo { | @@ -55,20 +54,6 @@ public class EmployeeConfigInfo { | ||
| 55 | @Column(nullable = false) | 54 | @Column(nullable = false) |
| 56 | private Boolean isCancel = false; | 55 | private Boolean isCancel = false; |
| 57 | 56 | ||
| 58 | - /** 创建人 */ | ||
| 59 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 60 | - private SysUser createBy; | ||
| 61 | - /** 修改人 */ | ||
| 62 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | ||
| 63 | - private SysUser updateBy; | ||
| 64 | - | ||
| 65 | - /** 创建日期 */ | ||
| 66 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 67 | - private Date createDate; | ||
| 68 | - /** 修改日期 */ | ||
| 69 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 70 | - private Date updateDate; | ||
| 71 | - | ||
| 72 | public EmployeeConfigInfo() {} | 57 | public EmployeeConfigInfo() {} |
| 73 | 58 | ||
| 74 | public EmployeeConfigInfo(Object id, Object xlid, Object xlname, Object jsyid, Object spyid) { | 59 | public EmployeeConfigInfo(Object id, Object xlid, Object xlname, Object jsyid, Object spyid) { |
| @@ -156,36 +141,4 @@ public class EmployeeConfigInfo { | @@ -156,36 +141,4 @@ public class EmployeeConfigInfo { | ||
| 156 | public void setIsCancel(Boolean isCancel) { | 141 | public void setIsCancel(Boolean isCancel) { |
| 157 | this.isCancel = isCancel; | 142 | this.isCancel = isCancel; |
| 158 | } | 143 | } |
| 159 | - | ||
| 160 | - public SysUser getCreateBy() { | ||
| 161 | - return createBy; | ||
| 162 | - } | ||
| 163 | - | ||
| 164 | - public void setCreateBy(SysUser createBy) { | ||
| 165 | - this.createBy = createBy; | ||
| 166 | - } | ||
| 167 | - | ||
| 168 | - public SysUser getUpdateBy() { | ||
| 169 | - return updateBy; | ||
| 170 | - } | ||
| 171 | - | ||
| 172 | - public void setUpdateBy(SysUser updateBy) { | ||
| 173 | - this.updateBy = updateBy; | ||
| 174 | - } | ||
| 175 | - | ||
| 176 | - public Date getCreateDate() { | ||
| 177 | - return createDate; | ||
| 178 | - } | ||
| 179 | - | ||
| 180 | - public void setCreateDate(Date createDate) { | ||
| 181 | - this.createDate = createDate; | ||
| 182 | - } | ||
| 183 | - | ||
| 184 | - public Date getUpdateDate() { | ||
| 185 | - return updateDate; | ||
| 186 | - } | ||
| 187 | - | ||
| 188 | - public void setUpdateDate(Date updateDate) { | ||
| 189 | - this.updateDate = updateDate; | ||
| 190 | - } | ||
| 191 | } | 144 | } |
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/entity/sys/SysUser.java
| 1 | package com.bsth.entity.sys; | 1 | package com.bsth.entity.sys; |
| 2 | 2 | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
| 4 | + | ||
| 5 | +import javax.persistence.*; | ||
| 3 | import java.util.Date; | 6 | import java.util.Date; |
| 4 | import java.util.LinkedHashSet; | 7 | import java.util.LinkedHashSet; |
| 5 | import java.util.Set; | 8 | import java.util.Set; |
| 6 | 9 | ||
| 7 | -import javax.persistence.Column; | ||
| 8 | -import javax.persistence.Entity; | ||
| 9 | -import javax.persistence.FetchType; | ||
| 10 | -import javax.persistence.GeneratedValue; | ||
| 11 | -import javax.persistence.GenerationType; | ||
| 12 | -import javax.persistence.Id; | ||
| 13 | -import javax.persistence.ManyToMany; | ||
| 14 | -import javax.persistence.Table; | ||
| 15 | - | ||
| 16 | @Entity | 10 | @Entity |
| 17 | @Table(name = "bsth_c_sys_user") | 11 | @Table(name = "bsth_c_sys_user") |
| 12 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | ||
| 18 | public class SysUser { | 13 | public class SysUser { |
| 19 | 14 | ||
| 20 | @Id | 15 | @Id |
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>{ |
| @@ -115,12 +113,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -115,12 +113,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 115 | @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") |
| 116 | List<ScheduleRealInfo> setLD(String date); | 114 | List<ScheduleRealInfo> setLD(String date); |
| 117 | 115 | ||
| 118 | - @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") | ||
| 119 | - 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); | ||
| 120 | 118 | ||
| 121 | - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,clZbh ORDER BY xlBm,clZbh") | ||
| 122 | - 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); | ||
| 123 | 121 | ||
| 124 | - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm") | ||
| 125 | - 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 | + | ||
| 126 | } | 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/forms/impl/FormsServiceImpl.java
| @@ -64,16 +64,22 @@ public class FormsServiceImpl implements FormsService { | @@ -64,16 +64,22 @@ public class FormsServiceImpl implements FormsService { | ||
| 64 | // System.out.println(arg0.getObject("yl")); | 64 | // System.out.println(arg0.getObject("yl")); |
| 65 | // wbd.setYl(arg0.getString("yl")); | 65 | // wbd.setYl(arg0.getString("yl")); |
| 66 | // wbd.setNbbm(arg0.getString("nbbm")); | 66 | // wbd.setNbbm(arg0.getString("nbbm")); |
| 67 | - Map<String, Object> maps = new HashMap<>(); | ||
| 68 | - maps = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"), | ||
| 69 | - arg0.getString("schedule_date")); | ||
| 70 | - wbd.setJzl1(maps.get("ksgl").toString()); | ||
| 71 | - wbd.setZlc(maps.get("realMileage").toString()); | ||
| 72 | - | 67 | + wbd.setRq(arg0.getString("schedule_date")); |
| 68 | + wbd.setJgh(arg0.getString("j_gh")); | ||
| 73 | return wbd; | 69 | return wbd; |
| 74 | 70 | ||
| 75 | } | 71 | } |
| 76 | }); | 72 | }); |
| 73 | + | ||
| 74 | + for(int i=0;i<list.size();i++){ | ||
| 75 | + Waybillday w=list.get(i); | ||
| 76 | + Map<String, Object> maps = new HashMap<>(); | ||
| 77 | + maps = scheduleRealInfoService.findKMBC2(w.getJgh(), w.getCarPlate(), | ||
| 78 | + w.getRq()); | ||
| 79 | + w.setJzl1(maps.get("ksgl").toString()); | ||
| 80 | + w.setZlc(maps.get("realMileage").toString()); | ||
| 81 | + | ||
| 82 | + } | ||
| 77 | return list; | 83 | return list; |
| 78 | } | 84 | } |
| 79 | 85 | ||
| @@ -102,6 +108,9 @@ public class FormsServiceImpl implements FormsService { | @@ -102,6 +108,9 @@ public class FormsServiceImpl implements FormsService { | ||
| 102 | return lin; | 108 | return lin; |
| 103 | } | 109 | } |
| 104 | }); | 110 | }); |
| 111 | + | ||
| 112 | + | ||
| 113 | + | ||
| 105 | return list; | 114 | return list; |
| 106 | } | 115 | } |
| 107 | 116 | ||
| @@ -111,12 +120,13 @@ public class FormsServiceImpl implements FormsService { | @@ -111,12 +120,13 @@ public class FormsServiceImpl implements FormsService { | ||
| 111 | 120 | ||
| 112 | @Override | 121 | @Override |
| 113 | public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) { | 122 | public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) { |
| 114 | - String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " | 123 | + String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " |
| 115 | + " from bsth_c_s_sp_info_real r " | 124 | + " from bsth_c_s_sp_info_real r " |
| 116 | + " where to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') " | 125 | + " where to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') " |
| 117 | + " and to_days('" + map.get("endDate").toString() + "') " | 126 | + " and to_days('" + map.get("endDate").toString() + "') " |
| 118 | + " and r.xl_bm='"+ map.get("line").toString() + "'" | 127 | + " and r.xl_bm='"+ map.get("line").toString() + "'" |
| 119 | + " AND r.gs_bm is not null" | 128 | + " AND r.gs_bm is not null" |
| 129 | + + " and r.bc_type not in('in','out')" | ||
| 120 | /* + " and r.gs_bm='"+map.get("gsdmManth").toString()+"'" | 130 | /* + " and r.gs_bm='"+map.get("gsdmManth").toString()+"'" |
| 121 | + " and r.fgs_bm='"+map.get("fgsdmManth").toString()+"'"*/ | 131 | + " and r.fgs_bm='"+map.get("fgsdmManth").toString()+"'"*/ |
| 122 | + " GROUP BY r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name" | 132 | + " GROUP BY r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name" |
| @@ -130,26 +140,29 @@ public class FormsServiceImpl implements FormsService { | @@ -130,26 +140,29 @@ public class FormsServiceImpl implements FormsService { | ||
| 130 | public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { | 140 | public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 131 | Shiftuehiclemanth shif = new Shiftuehiclemanth(); | 141 | Shiftuehiclemanth shif = new Shiftuehiclemanth(); |
| 132 | shif.setjName(arg0.getString("j_name")); | 142 | shif.setjName(arg0.getString("j_name")); |
| 133 | - | ||
| 134 | - Map<String, Object> maps = new HashMap<>(); | ||
| 135 | - | ||
| 136 | - maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate, | ||
| 137 | - endDate); | ||
| 138 | - | ||
| 139 | - shif.setJhlc(maps.get("jhlc").toString()); | ||
| 140 | - shif.setEmptMileage(maps.get("ksgl").toString()); | ||
| 141 | - shif.setRemMileage(maps.get("remMileage").toString()); | ||
| 142 | - shif.setAddMileage(maps.get("addMileage").toString()); | ||
| 143 | - shif.setTotalm(maps.get("realMileage").toString()); | ||
| 144 | - shif.setCjbc(maps.get("cjbc").toString()); | ||
| 145 | - shif.setLjbc(maps.get("ljbc").toString()); | ||
| 146 | - shif.setSjbc(maps.get("sjbc").toString()); | ||
| 147 | - | 143 | + shif.setJgh(arg0.getString("j_gh")); |
| 144 | + shif.setZbh(arg0.getString("cl_zbh")); | ||
| 148 | return shif; | 145 | return shif; |
| 149 | - | ||
| 150 | } | 146 | } |
| 151 | }); | 147 | }); |
| 148 | + | ||
| 149 | + for(int i=0;i<list.size();i++){ | ||
| 150 | + Shiftuehiclemanth s=list.get(i); | ||
| 151 | + Map<String, Object> maps = new HashMap<>(); | ||
| 152 | + | ||
| 153 | + maps = scheduleRealInfoService.findKMBC1(s.getjName(),s.getZbh(), startDate, | ||
| 154 | + endDate); | ||
| 155 | + | ||
| 156 | + s.setJhlc(maps.get("jhlc").toString()); | ||
| 157 | + s.setEmptMileage(maps.get("ksgl").toString()); | ||
| 158 | + s.setRemMileage(maps.get("remMileage").toString()); | ||
| 159 | + s.setAddMileage(maps.get("addMileage").toString()); | ||
| 160 | + s.setTotalm(maps.get("realMileage").toString()); | ||
| 161 | + s.setCjbc(maps.get("cjbc").toString()); | ||
| 162 | + s.setLjbc(maps.get("ljbc").toString()); | ||
| 163 | + s.setSjbc(maps.get("sjbc").toString()); | ||
| 152 | 164 | ||
| 165 | + } | ||
| 153 | return list; | 166 | return list; |
| 154 | } | 167 | } |
| 155 | 168 | ||
| @@ -157,10 +170,11 @@ public class FormsServiceImpl implements FormsService { | @@ -157,10 +170,11 @@ public class FormsServiceImpl implements FormsService { | ||
| 157 | @Override | 170 | @Override |
| 158 | public List<Shifday> shifday(Map<String, Object> map) { | 171 | public List<Shifday> shifday(Map<String, Object> map) { |
| 159 | String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm," | 172 | String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm," |
| 160 | - + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " | 173 | + + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " |
| 161 | + " FROM bsth_c_s_sp_info_real r " | 174 | + " FROM bsth_c_s_sp_info_real r " |
| 162 | + " where to_days(r.schedule_date)=to_days('" | 175 | + " where to_days(r.schedule_date)=to_days('" |
| 163 | + map.get("date").toString() + "') and r.xl_bm=" + map.get("line").toString() | 176 | + map.get("date").toString() + "') and r.xl_bm=" + map.get("line").toString() |
| 177 | + + " and r.bc_type not in('in','out')" | ||
| 164 | /*+ " and r.gs_bm='"+map.get("gsdmShif").toString()+"'" | 178 | /*+ " and r.gs_bm='"+map.get("gsdmShif").toString()+"'" |
| 165 | + " and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'"*/ | 179 | + " and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'"*/ |
| 166 | + " GROUP BY r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " | 180 | + " GROUP BY r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " |
| @@ -175,25 +189,34 @@ public class FormsServiceImpl implements FormsService { | @@ -175,25 +189,34 @@ public class FormsServiceImpl implements FormsService { | ||
| 175 | shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString()); | 189 | shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString()); |
| 176 | shifday.setLpName(arg0.getString("r.lp_name").toString()); | 190 | shifday.setLpName(arg0.getString("r.lp_name").toString()); |
| 177 | shifday.setCarPlate(arg0.getString("cl_zbh").toString()); | 191 | shifday.setCarPlate(arg0.getString("cl_zbh").toString()); |
| 178 | - | ||
| 179 | - Map<String, Object> map = new HashMap<>(); | ||
| 180 | - map = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"), | ||
| 181 | - arg0.getString("schedule_date")); | ||
| 182 | - shifday.setJhlc(map.get("jhlc").toString());// 计划里程 | ||
| 183 | - //shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程 | ||
| 184 | - shifday.setYygl(map.get("yygl").toString());// 营运里程 | ||
| 185 | - shifday.setEmptMileage(map.get("ksgl").toString());// 空驶里程 | ||
| 186 | - shifday.setRemMileage(map.get("remMileage").toString());// 抽减里程 | ||
| 187 | - shifday.setAddMileage(map.get("addMileage").toString());// 增加里程 | ||
| 188 | - shifday.setTotalm(map.get("realMileage").toString());// 总里程 | ||
| 189 | - shifday.setJhbc(map.get("jhbc").toString());// 计划班次 | ||
| 190 | - //shifday.setSjjhbc(map.get("sjjhbc").toString());//实际计划班次 | ||
| 191 | - shifday.setCjbc(map.get("cjbc").toString());// 抽减班次 | ||
| 192 | - shifday.setLjbc(map.get("ljbc").toString());// 增加班次 | ||
| 193 | - shifday.setSjbc(map.get("sjbc").toString());// 实际班次 | 192 | + shifday.setJgh(arg0.getString("j_gh")); |
| 193 | + shifday.setZbh(arg0.getString("cl_zbh")); | ||
| 194 | + shifday.setRq(arg0.getString("schedule_date")); | ||
| 194 | return shifday; | 195 | return shifday; |
| 195 | } | 196 | } |
| 197 | + | ||
| 196 | }); | 198 | }); |
| 199 | + | ||
| 200 | + for(int i=0;i<list.size();i++){ | ||
| 201 | + Shifday shi=list.get(i); | ||
| 202 | + Map<String, Object> maps = new HashMap<>(); | ||
| 203 | + maps = scheduleRealInfoService.findKMBC2(shi.getJgh(), shi.getCarPlate(), | ||
| 204 | + shi.getRq()); | ||
| 205 | + shi.setJhlc(maps.get("jhlc").toString());// 计划里程 | ||
| 206 | + //shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程 | ||
| 207 | + shi.setYygl(maps.get("yygl").toString());// 营运里程 | ||
| 208 | + shi.setEmptMileage(maps.get("ksgl").toString());// 空驶里程 | ||
| 209 | + shi.setRemMileage(maps.get("remMileage").toString());// 抽减里程 | ||
| 210 | + shi.setAddMileage(maps.get("addMileage").toString());// 增加里程 | ||
| 211 | + shi.setTotalm(maps.get("realMileage").toString());// 总里程 | ||
| 212 | + shi.setJhbc(maps.get("jhbc").toString());// 计划班次 | ||
| 213 | + //shifday.setSjjhbc(map.get("sjjhbc").toString());//实际计划班次 | ||
| 214 | + shi.setCjbc(maps.get("cjbc").toString());// 抽减班次 | ||
| 215 | + shi.setLjbc(maps.get("ljbc").toString());// 增加班次 | ||
| 216 | + shi.setSjbc(maps.get("sjbc").toString());// 实际班次 | ||
| 217 | + | ||
| 218 | + } | ||
| 219 | + | ||
| 197 | return list; | 220 | return list; |
| 198 | } | 221 | } |
| 199 | 222 | ||
| @@ -240,20 +263,20 @@ public class FormsServiceImpl implements FormsService { | @@ -240,20 +263,20 @@ public class FormsServiceImpl implements FormsService { | ||
| 240 | Changetochange chan = new Changetochange(); | 263 | Changetochange chan = new Changetochange(); |
| 241 | 264 | ||
| 242 | chan.setRq(rq); | 265 | chan.setRq(rq); |
| 243 | - chan.setGs(arg0.getString("gs").toString()); | ||
| 244 | - chan.setFgs(arg0.getString("fgs").toString()); | ||
| 245 | - chan.setXl(arg0.getString("xl").toString()); | ||
| 246 | - chan.setLp(arg0.getString("lp").toString()); | ||
| 247 | - chan.setFssj(arg0.getString("fssj").toString()); | ||
| 248 | - chan.setXgsj(arg0.getString("xgsj").toString()); | ||
| 249 | - chan.setPcch(arg0.getString("pcch").toString()); | ||
| 250 | - chan.setPcry(arg0.getString("pcry").toString()); | ||
| 251 | - chan.setJhch(arg0.getString("jhch").toString()); | ||
| 252 | - chan.setJhgh(arg0.getString("jhgh").toString()); | ||
| 253 | - chan.setSjch(arg0.getString("sjch").toString()); | ||
| 254 | - chan.setSjgh(arg0.getString("sjgh").toString()); | ||
| 255 | - chan.setYy(arg0.getString("yy").toString()); | ||
| 256 | - chan.setXgr(arg0.getString("xgr").toString()); | 266 | + chan.setGs(arg0.getString("gs")); |
| 267 | + chan.setFgs(arg0.getString("fgs")); | ||
| 268 | + chan.setXl(arg0.getString("xl")); | ||
| 269 | + chan.setLp(arg0.getString("lp")); | ||
| 270 | + chan.setFssj(arg0.getString("fssj")); | ||
| 271 | + chan.setXgsj(arg0.getString("xgsj")); | ||
| 272 | + chan.setPcch(arg0.getString("pcch")); | ||
| 273 | + chan.setPcry(arg0.getString("pcry")); | ||
| 274 | + chan.setJhch(arg0.getString("jhch")); | ||
| 275 | + chan.setJhgh(arg0.getString("jhgh")); | ||
| 276 | + chan.setSjch(arg0.getString("sjch")); | ||
| 277 | + chan.setSjgh(arg0.getString("sjgh")); | ||
| 278 | + chan.setYy(arg0.getString("yy")); | ||
| 279 | + chan.setXgr(arg0.getString("xgr")); | ||
| 257 | return chan; | 280 | return chan; |
| 258 | } | 281 | } |
| 259 | }); | 282 | }); |
| @@ -279,7 +302,7 @@ public class FormsServiceImpl implements FormsService { | @@ -279,7 +302,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 279 | 302 | ||
| 280 | rq = rq2 + "-" + rq3; | 303 | rq = rq2 + "-" + rq3; |
| 281 | 304 | ||
| 282 | - String sql = " SELECT r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " | 305 | + String sql = " SELECT r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " |
| 283 | + " FROM bsth_c_s_sp_info_real r " | 306 | + " FROM bsth_c_s_sp_info_real r " |
| 284 | + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y " | 307 | + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y " |
| 285 | + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "' and '"+ map.get("endDate").toString() + "'" | 308 | + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "' and '"+ map.get("endDate").toString() + "'" |
| @@ -300,28 +323,32 @@ public class FormsServiceImpl implements FormsService { | @@ -300,28 +323,32 @@ public class FormsServiceImpl implements FormsService { | ||
| 300 | public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | 323 | public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 301 | Singledata sin = new Singledata(); | 324 | Singledata sin = new Singledata(); |
| 302 | sin.setrQ(rq); | 325 | sin.setrQ(rq); |
| 303 | - sin.setgS(arg0.getString("gs_name").toString()); | ||
| 304 | - sin.setxL(arg0.getString("xl_bm").toString()); | ||
| 305 | - sin.setClzbh(arg0.getString("cl_zbh").toString()); | ||
| 306 | - sin.setJsy(arg0.getString("j_gh").toString()); | ||
| 307 | - sin.setjName(arg0.getString("j_name").toString()); | ||
| 308 | - sin.setHyl(arg0.getString("YH").toString()); | ||
| 309 | - sin.setJzl(arg0.getString("JZL").toString()); | 326 | + sin.setgS(arg0.getString("gs_name")); |
| 327 | + sin.setxL(arg0.getString("xl_bm")); | ||
| 328 | + sin.setClzbh(arg0.getString("cl_zbh")); | ||
| 329 | + sin.setJsy(arg0.getString("j_gh")); | ||
| 330 | + sin.setjName(arg0.getString("j_name")); | ||
| 331 | + sin.setHyl(arg0.getString("YH")); | ||
| 332 | + sin.setJzl(arg0.getString("JZL")); | ||
| 310 | // sin.setJzl(arg0.getString(""));//非营业性用油 | 333 | // sin.setJzl(arg0.getString(""));//非营业性用油 |
| 311 | sin.setJhjl(arg0.getString("JZL")); | 334 | sin.setJhjl(arg0.getString("JZL")); |
| 312 | - Map<String, Object> maps = new HashMap<>(); | ||
| 313 | - maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate, | ||
| 314 | - endDate); | ||
| 315 | - //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString()); | ||
| 316 | - sin.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString()); | ||
| 317 | - sin.setsName(maps.get("s_name") == null ? "" : maps.get("s_name").toString()); | ||
| 318 | - sin.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString()); | ||
| 319 | - sin.setEmptMileage(maps.get("ksgl") == null ? "" : maps.get("ksgl").toString()); | ||
| 320 | - sin.setJhjl(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString()); | ||
| 321 | - | 335 | + |
| 322 | return sin; | 336 | return sin; |
| 323 | } | 337 | } |
| 324 | }); | 338 | }); |
| 339 | + for(int i=0;i<list.size();i++){ | ||
| 340 | + Singledata si=list.get(i); | ||
| 341 | + Map<String, Object> maps = new HashMap<>(); | ||
| 342 | + maps = scheduleRealInfoService.findKMBC1(si.getjName(),si.getClzbh(), startDate, | ||
| 343 | + endDate); | ||
| 344 | + //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString()); | ||
| 345 | + si.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString()); | ||
| 346 | + si.setsName(maps.get("s_name") == null ? "" : maps.get("s_name").toString()); | ||
| 347 | + si.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString()); | ||
| 348 | + si.setEmptMileage(maps.get("ksgl") == null ? "" : maps.get("ksgl").toString()); | ||
| 349 | + si.setJhjl(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString()); | ||
| 350 | + | ||
| 351 | + } | ||
| 325 | return list; | 352 | return list; |
| 326 | } | 353 | } |
| 327 | 354 | ||
| @@ -329,7 +356,7 @@ public class FormsServiceImpl implements FormsService { | @@ -329,7 +356,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 329 | @Override | 356 | @Override |
| 330 | public List<Operationservice> operationservice(Map<String, Object> map) { | 357 | public List<Operationservice> operationservice(Map<String, Object> map) { |
| 331 | 358 | ||
| 332 | - String sql = " SELECT r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " | 359 | + String sql = " SELECT r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " |
| 333 | + " FROM bsth_c_s_sp_info_real r " | 360 | + " FROM bsth_c_s_sp_info_real r " |
| 334 | // + "LEFT JOIN bsth_c_s_sp_info_real r on r.cl_zbh=y.NBBM" | 361 | // + "LEFT JOIN bsth_c_s_sp_info_real r on r.cl_zbh=y.NBBM" |
| 335 | + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y " | 362 | + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y " |
| @@ -338,6 +365,7 @@ public class FormsServiceImpl implements FormsService { | @@ -338,6 +365,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 338 | + " where r.schedule_date_str BETWEEN '"+ map.get("startDate").toString() | 365 | + " where r.schedule_date_str BETWEEN '"+ map.get("startDate").toString() |
| 339 | + "'" + " and '" + map.get("endDate").toString() + "'" | 366 | + "'" + " and '" + map.get("endDate").toString() + "'" |
| 340 | + " and r.xl_bm='" + map.get("line").toString() + "'" | 367 | + " and r.xl_bm='" + map.get("line").toString() + "'" |
| 368 | + + " and r.bc_type not in('in','out')" | ||
| 341 | /* + " and r.gs_bm='"+map.get("gsdmOperat").toString()+"'" | 369 | /* + " and r.gs_bm='"+map.get("gsdmOperat").toString()+"'" |
| 342 | + " and r.fgs_bm='"+map.get("fgsdmOperat").toString()+"'"*/ | 370 | + " and r.fgs_bm='"+map.get("fgsdmOperat").toString()+"'"*/ |
| 343 | + " AND r.gs_bm is not null" | 371 | + " AND r.gs_bm is not null" |
| @@ -351,26 +379,34 @@ public class FormsServiceImpl implements FormsService { | @@ -351,26 +379,34 @@ public class FormsServiceImpl implements FormsService { | ||
| 351 | @Override | 379 | @Override |
| 352 | public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException { | 380 | public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 353 | Operationservice op = new Operationservice(); | 381 | Operationservice op = new Operationservice(); |
| 354 | - op.setXlName(arg0.getString("xl_name").toString()); | ||
| 355 | - op.setJzl(arg0.getString("JZL").toString()); | ||
| 356 | - op.setXhl(arg0.getString("YH").toString()); | ||
| 357 | - Map<String, Object> maps = new HashMap<>(); | ||
| 358 | - maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate, | ||
| 359 | - endDate); | ||
| 360 | - op.setXsgl(maps.get("yygl").toString() == null ? "" : maps.get("yygl").toString()); | ||
| 361 | - op.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString()); | ||
| 362 | - op.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString()); | 382 | + op.setXlName(arg0.getString("xl_name")); |
| 383 | + op.setJzl(arg0.getString("JZL")); | ||
| 384 | + op.setXhl(arg0.getString("YH")); | ||
| 385 | + op.setClzbh(arg0.getString("cl_zbh")); | ||
| 386 | + op.setJname(arg0.getString("j_name")); | ||
| 387 | + | ||
| 363 | return op; | 388 | return op; |
| 364 | } | 389 | } |
| 365 | }); | 390 | }); |
| 391 | + | ||
| 392 | + for(int i=0;i<list.size();i++){ | ||
| 393 | + Operationservice o=list.get(i); | ||
| 394 | + Map<String, Object> maps = new HashMap<>(); | ||
| 395 | + maps = scheduleRealInfoService.findKMBC1(o.getJname(), o.getClzbh(), startDate, | ||
| 396 | + endDate); | ||
| 397 | + o.setXsgl(maps.get("yygl").toString() == null ? "" : maps.get("yygl").toString()); | ||
| 398 | + o.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString()); | ||
| 399 | + o.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString()); | ||
| 400 | + } | ||
| 366 | return list; | 401 | return list; |
| 367 | } | 402 | } |
| 368 | 403 | ||
| 404 | + | ||
| 369 | // 车辆加注 | 405 | // 车辆加注 |
| 370 | @Override | 406 | @Override |
| 371 | public List<Vehicleloading> vehicleloading(/*String gsdmVehic,String fgsdmVehic,*/String line, String date) { | 407 | public List<Vehicleloading> vehicleloading(/*String gsdmVehic,String fgsdmVehic,*/String line, String date) { |
| 372 | 408 | ||
| 373 | - String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " | 409 | + String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " |
| 374 | + " FROM bsth_c_s_sp_info_real r " | 410 | + " FROM bsth_c_s_sp_info_real r " |
| 375 | + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y " | 411 | + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y " |
| 376 | + " where to_days(y.RQ)=to_days('" + date + "') and y.XLBM= '" + line + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y " | 412 | + " where to_days(y.RQ)=to_days('" + date + "') and y.XLBM= '" + line + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y " |
| @@ -378,6 +414,7 @@ public class FormsServiceImpl implements FormsService { | @@ -378,6 +414,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 378 | + " where to_days(r.schedule_date_str)=to_days('" + date + "')" | 414 | + " where to_days(r.schedule_date_str)=to_days('" + date + "')" |
| 379 | + " and r.xl_bm='" + line + "' " | 415 | + " and r.xl_bm='" + line + "' " |
| 380 | + " AND r.gs_bm is not null" | 416 | + " AND r.gs_bm is not null" |
| 417 | + + " and r.bc_type not in('in','out')" | ||
| 381 | /* + " and r.gs_bm='"+gsdmVehic +"'" | 418 | /* + " and r.gs_bm='"+gsdmVehic +"'" |
| 382 | + " and r.fgs_bm='"+fgsdmVehic +"'"*/ | 419 | + " and r.fgs_bm='"+fgsdmVehic +"'"*/ |
| 383 | + " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "; | 420 | + " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "; |
| @@ -388,22 +425,28 @@ public class FormsServiceImpl implements FormsService { | @@ -388,22 +425,28 @@ public class FormsServiceImpl implements FormsService { | ||
| 388 | @Override | 425 | @Override |
| 389 | public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException { | 426 | public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 390 | Vehicleloading ve = new Vehicleloading(); | 427 | Vehicleloading ve = new Vehicleloading(); |
| 391 | - ve.setrQ(arg0.getString("schedule_date_str").toString()); | ||
| 392 | - ve.setgS(arg0.getString("gs_name").toString()); | ||
| 393 | - ve.setxL(arg0.getString("xl_name").toString()); | ||
| 394 | - ve.setClzbh(arg0.getString("cl_zbh").toString()); | ||
| 395 | - ve.setHyl(arg0.getString("YH").toString()); | ||
| 396 | - ve.setJzl(arg0.getString("JZL").toString()); | 428 | + ve.setrQ(arg0.getString("schedule_date_str")); |
| 429 | + ve.setgS(arg0.getString("gs_name")); | ||
| 430 | + ve.setxL(arg0.getString("xl_name")); | ||
| 431 | + ve.setClzbh(arg0.getString("cl_zbh")); | ||
| 432 | + ve.setHyl(arg0.getString("YH")); | ||
| 433 | + ve.setJzl(arg0.getString("JZL")); | ||
| 397 | // ve.setLs(arg0.getString("").toString());//尿素 | 434 | // ve.setLs(arg0.getString("").toString());//尿素 |
| 398 | - Map<String, Object> maps = new HashMap<>(); | ||
| 399 | - maps = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"), | ||
| 400 | - arg0.getString("schedule_date_str")); | ||
| 401 | - ve.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString()); | ||
| 402 | - ve.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次 | ||
| 403 | - ve.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次 | 435 | + ve.setJgh(arg0.getString("j_gh").toString()); |
| 404 | return ve; | 436 | return ve; |
| 405 | } | 437 | } |
| 406 | }); | 438 | }); |
| 439 | + | ||
| 440 | + for(int i=0;i<list.size();i++){ | ||
| 441 | + Vehicleloading v=list.get(i); | ||
| 442 | + Map<String, Object> maps = new HashMap<>(); | ||
| 443 | + maps = scheduleRealInfoService.findKMBC2(v.getJgh(), line, | ||
| 444 | + date); | ||
| 445 | + v.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString()); | ||
| 446 | + v.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次 | ||
| 447 | + v.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次 | ||
| 448 | + } | ||
| 449 | + | ||
| 407 | return list; | 450 | return list; |
| 408 | } | 451 | } |
| 409 | 452 | ||
| @@ -427,20 +470,22 @@ public class FormsServiceImpl implements FormsService { | @@ -427,20 +470,22 @@ public class FormsServiceImpl implements FormsService { | ||
| 427 | 470 | ||
| 428 | rq = rq2 + "-" + rq3; | 471 | rq = rq2 + "-" + rq3; |
| 429 | 472 | ||
| 430 | - String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,b.warrant_car from " | ||
| 431 | - + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl" | 473 | + String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,b.warrant_car,a.bc_type from " |
| 474 | + + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type" | ||
| 432 | + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"+ map.get("startDate").toString() + "' " | 475 | + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"+ map.get("startDate").toString() + "' " |
| 433 | + " and '" + map.get("endDate").toString() + "' and xl_bm='"+ map.get("line").toString() + "' " | 476 | + " and '" + map.get("endDate").toString() + "' and xl_bm='"+ map.get("line").toString() + "' " |
| 434 | + " AND gs_bm is not null " | 477 | + " AND gs_bm is not null " |
| 478 | + + " AND bc_type NOT IN ('in', 'out')" | ||
| 435 | /*+ " and gs_bm='"+ map.get("gsdmTurn").toString() + "'" | 479 | /*+ " and gs_bm='"+ map.get("gsdmTurn").toString() + "'" |
| 436 | + " and fgs_bm='"+ map.get("fgsdmTurn").toString() + "'"*/ | 480 | + " and fgs_bm='"+ map.get("fgsdmTurn").toString() + "'"*/ |
| 437 | - + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN (" | 481 | + + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN (" |
| 438 | + " SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl,t.warrant_car " | 482 | + " SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl,t.warrant_car " |
| 439 | - + " from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real " | 483 | + + " from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real " |
| 440 | + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" | 484 | + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" |
| 441 | + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() | 485 | + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() |
| 442 | + "' AND gs_bm is not null " | 486 | + "' AND gs_bm is not null " |
| 443 | - + "GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name) b ON t.company=b.gs_bm) b on " | 487 | + + " AND bc_type NOT IN ('in', 'out')" |
| 488 | + + "GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type) b ON t.company=b.gs_bm) b on " | ||
| 444 | + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; | 489 | + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; |
| 445 | List<Turnoutrate> list = jdbcTemplate.query(sql, new RowMapper<Turnoutrate>() { | 490 | List<Turnoutrate> list = jdbcTemplate.query(sql, new RowMapper<Turnoutrate>() { |
| 446 | 491 | ||
| @@ -473,6 +518,7 @@ public class FormsServiceImpl implements FormsService { | @@ -473,6 +518,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 473 | 518 | ||
| 474 | }); | 519 | }); |
| 475 | 520 | ||
| 521 | + | ||
| 476 | return list; | 522 | return list; |
| 477 | } | 523 | } |
| 478 | 524 | ||
| @@ -496,20 +542,20 @@ public class FormsServiceImpl implements FormsService { | @@ -496,20 +542,20 @@ public class FormsServiceImpl implements FormsService { | ||
| 496 | 542 | ||
| 497 | rq = rq2 + "-" + rq3; | 543 | rq = rq2 + "-" + rq3; |
| 498 | 544 | ||
| 499 | - String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm from " | ||
| 500 | - + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl" | 545 | + String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,a.bc_type from " |
| 546 | + + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type" | ||
| 501 | + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" | 547 | + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" |
| 502 | + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" | 548 | + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" |
| 503 | - + map.get("line").toString() + "' AND gs_bm is not null" | 549 | + + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')" |
| 504 | /*+ " and gs_bm='"+ map.get("gsdmEcecut").toString() + "'" | 550 | /*+ " and gs_bm='"+ map.get("gsdmEcecut").toString() + "'" |
| 505 | + " and fgs_bm='"+ map.get("fgsdmEcecut").toString() + "'"*/ | 551 | + " and fgs_bm='"+ map.get("fgsdmEcecut").toString() + "'"*/ |
| 506 | - + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN (" | ||
| 507 | - + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " | ||
| 508 | - + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real " | 552 | + + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN (" |
| 553 | + + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " | ||
| 554 | + + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real " | ||
| 509 | + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" | 555 | + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" |
| 510 | + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() | 556 | + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() |
| 511 | - + "' AND gs_bm is not null " | ||
| 512 | - + "GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name) b ON t.company=b.gs_bm) b on " | 557 | + + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') " |
| 558 | + + "GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type) b ON t.company=b.gs_bm) b on " | ||
| 513 | + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; | 559 | + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; |
| 514 | List<Executionrate> list = jdbcTemplate.query(sql, new RowMapper<Executionrate>() { | 560 | List<Executionrate> list = jdbcTemplate.query(sql, new RowMapper<Executionrate>() { |
| 515 | 561 | ||
| @@ -563,22 +609,27 @@ public class FormsServiceImpl implements FormsService { | @@ -563,22 +609,27 @@ public class FormsServiceImpl implements FormsService { | ||
| 563 | String rq2 = sdf1.format(d); | 609 | String rq2 = sdf1.format(d); |
| 564 | String rq3 = sdf1.format(d1); | 610 | String rq3 = sdf1.format(d1); |
| 565 | 611 | ||
| 612 | + | ||
| 613 | + | ||
| 566 | rq = rq2 + "-" + rq3; | 614 | rq = rq2 + "-" + rq3; |
| 567 | 615 | ||
| 568 | - String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm from " | ||
| 569 | - + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl" | 616 | + String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,a.bc_type from " |
| 617 | + + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type" | ||
| 570 | + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" | 618 | + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" |
| 571 | + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" | 619 | + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" |
| 572 | - + map.get("line").toString() + "' AND gs_bm is not null" | 620 | + + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') " |
| 573 | /*+ " and gs_bm='"+ map.get("gsdmAllline").toString() + "'" | 621 | /*+ " and gs_bm='"+ map.get("gsdmAllline").toString() + "'" |
| 574 | + " and fgs_bm='"+ map.get("fgsdmAllline").toString() + "'"*/ | 622 | + " and fgs_bm='"+ map.get("fgsdmAllline").toString() + "'"*/ |
| 575 | - + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN (" | ||
| 576 | - + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " | ||
| 577 | - + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real " | 623 | + + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN (" |
| 624 | + + "SELECT COUNT(*" | ||
| 625 | + + ") as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b." | ||
| 626 | + + "xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " | ||
| 627 | + + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real " | ||
| 578 | + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" | 628 | + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" |
| 579 | - + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() | ||
| 580 | - + "' AND gs_bm is not null " | ||
| 581 | - + "GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name) b ON t.company=b.gs_bm) b on " | 629 | + + map.get("endDate").toString() + "' and xl_bm='" + map.get |
| 630 | + ("line").toString() | ||
| 631 | + + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')" | ||
| 632 | + + "GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type) b ON t.company=b.gs_bm) b on " | ||
| 582 | + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; | 633 | + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; |
| 583 | List<Allline> list = jdbcTemplate.query(sql, new RowMapper<Allline>() { | 634 | List<Allline> list = jdbcTemplate.query(sql, new RowMapper<Allline>() { |
| 584 | 635 | ||
| @@ -603,14 +654,19 @@ public class FormsServiceImpl implements FormsService { | @@ -603,14 +654,19 @@ public class FormsServiceImpl implements FormsService { | ||
| 603 | tu.setBcjh(arg0.getString("jbc").toString()); | 654 | tu.setBcjh(arg0.getString("jbc").toString()); |
| 604 | tu.setBcsj(arg0.getString("sbc").toString()); | 655 | tu.setBcsj(arg0.getString("sbc").toString()); |
| 605 | tu.setBbzxl(result2 + "%");// 班次执行率 | 656 | tu.setBbzxl(result2 + "%");// 班次执行率 |
| 657 | + | ||
| 606 | // tu.setSm(arg0.getString("xl_name").toString()); | 658 | // tu.setSm(arg0.getString("xl_name").toString()); |
| 607 | tu.setGsgs(arg0.getString("gslsbm").toString()); | 659 | tu.setGsgs(arg0.getString("gslsbm").toString()); |
| 608 | tu.setFgsgs(arg0.getString("fgsbm").toString()); | 660 | tu.setFgsgs(arg0.getString("fgsbm").toString()); |
| 609 | return tu; | 661 | return tu; |
| 610 | } | 662 | } |
| 611 | 663 | ||
| 664 | + | ||
| 612 | }); | 665 | }); |
| 666 | + | ||
| 613 | 667 | ||
| 668 | + | ||
| 669 | + | ||
| 614 | return list; | 670 | return list; |
| 615 | } | 671 | } |
| 616 | } | 672 | } |
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; |
| @@ -37,6 +36,8 @@ import java.sql.ResultSet; | @@ -37,6 +36,8 @@ import java.sql.ResultSet; | ||
| 37 | import java.text.DecimalFormat; | 36 | import java.text.DecimalFormat; |
| 38 | import java.text.SimpleDateFormat; | 37 | import java.text.SimpleDateFormat; |
| 39 | import java.util.*; | 38 | import java.util.*; |
| 39 | +import java.util.regex.Pattern; | ||
| 40 | + | ||
| 40 | /** | 41 | /** |
| 41 | * | 42 | * |
| 42 | * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) | 43 | * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) |
| @@ -102,9 +103,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -102,9 +103,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 102 | @Autowired | 103 | @Autowired |
| 103 | private ScheduleRealInfoRepository scheduleRealInfoRepository; | 104 | private ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 104 | 105 | ||
| 105 | - @Autowired | ||
| 106 | - NamedParameterJdbcTemplate jdbcTemplate; | ||
| 107 | - | ||
| 108 | 106 | ||
| 109 | // 运管处接口 | 107 | // 运管处接口 |
| 110 | private InternalPortType portType = new Internal().getInternalHttpSoap11Endpoint(); | 108 | private InternalPortType portType = new Internal().getInternalHttpSoap11Endpoint(); |
| @@ -299,32 +297,38 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -299,32 +297,38 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 299 | */ | 297 | */ |
| 300 | public String setLD(){ | 298 | public String setLD(){ |
| 301 | String result = "failure"; | 299 | String result = "failure"; |
| 300 | + Line line; | ||
| 302 | // 取昨天 的日期 | 301 | // 取昨天 的日期 |
| 303 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | 302 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 304 | StringBuffer sf = new StringBuffer(); | 303 | StringBuffer sf = new StringBuffer(); |
| 305 | try { | 304 | try { |
| 306 | sf.append("<DLDS>"); | 305 | sf.append("<DLDS>"); |
| 307 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); | 306 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); |
| 308 | - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date); | 307 | + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date); |
| 309 | Map<String,Object> map = new HashMap<String,Object>(); | 308 | Map<String,Object> map = new HashMap<String,Object>(); |
| 310 | - for(ScheduleRealInfo schRealInfo:listGroup){ | 309 | + for(Map<String,Object> schRealInfo:listGroup){ |
| 311 | if(schRealInfo != null){ | 310 | if(schRealInfo != null){ |
| 312 | //根据车辆自编号查询车牌号 | 311 | //根据车辆自编号查询车牌号 |
| 313 | - map.put("insideCode_eq", schRealInfo.getClZbh()); | 312 | + map.put("insideCode_eq", schRealInfo.get("clZbh")+""); |
| 314 | Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); | 313 | Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); |
| 314 | + // 获取线路是否使用标识,如果未使用,则不查该线路数据 | ||
| 315 | + line = lineRepository.findByLineCode(schRealInfo.get("xlBm")+""); | ||
| 316 | + if(line.getInUse() == null || line.getInUse() == 0){ | ||
| 317 | + continue; | ||
| 318 | + } | ||
| 315 | sf.append("<DLD>"); | 319 | sf.append("<DLD>"); |
| 316 | - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 317 | - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>"); | ||
| 318 | - 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>"); | ||
| 319 | sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); | 323 | sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); |
| 320 | - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | 324 | + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); |
| 321 | sf.append("<LDList>"); | 325 | sf.append("<LDList>"); |
| 322 | 326 | ||
| 323 | int seqNumber = 0; | 327 | int seqNumber = 0; |
| 324 | for(ScheduleRealInfo scheduleRealInfo:list){ | 328 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 325 | - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getLpName() | 329 | + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("lpName")+"") |
| 326 | .equals(scheduleRealInfo.getLpName()) | 330 | .equals(scheduleRealInfo.getLpName()) |
| 327 | - && schRealInfo.getClZbh().equals(scheduleRealInfo.getClZbh())){ | 331 | + && (schRealInfo.get("clZbh")+"").equals(scheduleRealInfo.getClZbh())){ |
| 328 | if(scheduleRealInfo.getFcsjActual() == null ||scheduleRealInfo.getBcType().equals("in") | 332 | if(scheduleRealInfo.getFcsjActual() == null ||scheduleRealInfo.getBcType().equals("in") |
| 329 | || scheduleRealInfo.getBcType().equals("out")){ | 333 | || scheduleRealInfo.getBcType().equals("out")){ |
| 330 | continue; | 334 | continue; |
| @@ -382,22 +386,22 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -382,22 +386,22 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 382 | StringBuffer sf = new StringBuffer(); | 386 | StringBuffer sf = new StringBuffer(); |
| 383 | try { | 387 | try { |
| 384 | sf.append("<LCYHS>"); | 388 | sf.append("<LCYHS>"); |
| 385 | - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); | 389 | + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); |
| 386 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | 390 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); |
| 387 | Map<String,Object> map = new HashMap<String,Object>(); | 391 | Map<String,Object> map = new HashMap<String,Object>(); |
| 388 | - for(ScheduleRealInfo schRealInfo:listGroup){ | 392 | + for(Map<String,Object> schRealInfo:listGroup){ |
| 389 | if(schRealInfo != null){ | 393 | if(schRealInfo != null){ |
| 390 | //计算总公里和空驶公里,营运公里=总公里-空驶公里 | 394 | //计算总公里和空驶公里,营运公里=总公里-空驶公里 |
| 391 | double totalKilometers = 0,emptyKilometers =0; | 395 | double totalKilometers = 0,emptyKilometers =0; |
| 392 | sf.append("<LCYH>"); | 396 | sf.append("<LCYH>"); |
| 393 | - map.put("insideCode_eq", schRealInfo.getClZbh()); | 397 | + map.put("insideCode_eq", schRealInfo.get("clZbh")+""); |
| 394 | Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); | 398 | Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); |
| 395 | // Cars car = carsRepository.findCarByClzbh(schRealInfo.getClZbh()); | 399 | // Cars car = carsRepository.findCarByClzbh(schRealInfo.getClZbh()); |
| 396 | - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 397 | - 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>"); | ||
| 398 | sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); | 402 | sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); |
| 399 | for(ScheduleRealInfo scheduleRealInfo:list){ | 403 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 400 | - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getClZbh() | 404 | + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("clZbh")+"") |
| 401 | .equals(scheduleRealInfo.getClZbh())){ | 405 | .equals(scheduleRealInfo.getClZbh())){ |
| 402 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 406 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 403 | //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 | 407 | //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 |
| @@ -428,7 +432,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -428,7 +432,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 428 | sf.append("<YH>"+""+"</YH>"); | 432 | sf.append("<YH>"+""+"</YH>"); |
| 429 | sf.append("<JZYL>"+""+"</JZYL>"); | 433 | sf.append("<JZYL>"+""+"</JZYL>"); |
| 430 | sf.append("<DH>"+""+"</DH>"); | 434 | sf.append("<DH>"+""+"</DH>"); |
| 431 | - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | 435 | + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); |
| 432 | sf.append("<BBSCBZ>"+0+"</BBSCBZ>"); | 436 | sf.append("<BBSCBZ>"+0+"</BBSCBZ>"); |
| 433 | sf.append("</LCYH>"); | 437 | sf.append("</LCYH>"); |
| 434 | } | 438 | } |
| @@ -458,18 +462,18 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -458,18 +462,18 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 458 | StringBuffer sf = new StringBuffer(); | 462 | StringBuffer sf = new StringBuffer(); |
| 459 | try { | 463 | try { |
| 460 | sf.append("<DDRBS>"); | 464 | sf.append("<DDRBS>"); |
| 461 | - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); | 465 | + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); |
| 462 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | 466 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); |
| 463 | - for(ScheduleRealInfo schRealInfo:listGroup){ | 467 | + for(Map<String,Object> schRealInfo:listGroup){ |
| 464 | if(schRealInfo != null){ | 468 | if(schRealInfo != null){ |
| 465 | double jhlc = 0,zlc = 0,jhkslc = 0,sjkslc = 0; | 469 | double jhlc = 0,zlc = 0,jhkslc = 0,sjkslc = 0; |
| 466 | 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; |
| 467 | sf.append("<DDRB>"); | 471 | sf.append("<DDRB>"); |
| 468 | - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 469 | - 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>"); | ||
| 470 | for(ScheduleRealInfo scheduleRealInfo:list){ | 474 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 471 | if(scheduleRealInfo != null){ | 475 | if(scheduleRealInfo != null){ |
| 472 | - if(scheduleRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm())){ | 476 | + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm())){ |
| 473 | //计划 | 477 | //计划 |
| 474 | if(!scheduleRealInfo.isSflj()){ | 478 | if(!scheduleRealInfo.isSflj()){ |
| 475 | jhlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | 479 | jhlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); |
| @@ -532,7 +536,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -532,7 +536,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 532 | sf.append("<SJZGFBC>"+sjzgfbc+"</SJZGFBC>"); | 536 | sf.append("<SJZGFBC>"+sjzgfbc+"</SJZGFBC>"); |
| 533 | sf.append("<JHWGFBC>"+jhwgfbc+"</JHWGFBC>"); | 537 | sf.append("<JHWGFBC>"+jhwgfbc+"</JHWGFBC>"); |
| 534 | sf.append("<SJWGFBC>"+sjwgfbc+"</SJWGFBC>"); | 538 | sf.append("<SJWGFBC>"+sjwgfbc+"</SJWGFBC>"); |
| 535 | - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | 539 | + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); |
| 536 | sf.append("<RBSCBZ>"+0+"</RBSCBZ>"); | 540 | sf.append("<RBSCBZ>"+0+"</RBSCBZ>"); |
| 537 | sf.append("</DDRB>"); | 541 | sf.append("</DDRB>"); |
| 538 | } | 542 | } |
| @@ -557,14 +561,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -557,14 +561,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 557 | @Override | 561 | @Override |
| 558 | public String setJHBC() { | 562 | public String setJHBC() { |
| 559 | String result = "failure"; | 563 | String result = "failure"; |
| 564 | + Line line; | ||
| 560 | StringBuffer sBuffer =new StringBuffer(); | 565 | StringBuffer sBuffer =new StringBuffer(); |
| 561 | try { | 566 | try { |
| 562 | sBuffer.append("<JHBCs>"); | 567 | sBuffer.append("<JHBCs>"); |
| 563 | // 声明变量 | 568 | // 声明变量 |
| 564 | - SchedulePlanInfo schedulePlanInfo = null; | ||
| 565 | - String xlbm = "",zbh = ""; | 569 | + SchedulePlanInfo schedulePlanInfo; |
| 570 | + String xlbm,zbh = ""; | ||
| 566 | Long lp = 0L; | 571 | Long lp = 0L; |
| 567 | - int startSerialNum = 0,endSerialNum = 0;; | ||
| 568 | // 取明天的日期 | 572 | // 取明天的日期 |
| 569 | String tomorrow = sdfnyr.format(DateUtils.addDays(new Date(), +1)); | 573 | String tomorrow = sdfnyr.format(DateUtils.addDays(new Date(), +1)); |
| 570 | // 查询所有班次 | 574 | // 查询所有班次 |
| @@ -573,8 +577,13 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -573,8 +577,13 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 573 | int size = schedulePlanList.size(); | 577 | int size = schedulePlanList.size(); |
| 574 | for (int i = 0; i < size; i++) { | 578 | for (int i = 0; i < size; i++) { |
| 575 | schedulePlanInfo = schedulePlanList.get(i); | 579 | schedulePlanInfo = schedulePlanList.get(i); |
| 580 | + xlbm = schedulePlanInfo.getXlBm(); | ||
| 581 | + // 获取线路是否使用标识,如果未使用,则不查该线路数据 | ||
| 582 | + line = lineRepository.findByLineCode(xlbm); | ||
| 583 | + if(line.getInUse() == null || line.getInUse() == 0){ | ||
| 584 | + continue; | ||
| 585 | + } | ||
| 576 | if(i == 0){// 第一次,则初始化值 | 586 | if(i == 0){// 第一次,则初始化值 |
| 577 | - xlbm = schedulePlanInfo.getXlBm(); | ||
| 578 | zbh = schedulePlanInfo.getClZbh(); | 587 | zbh = schedulePlanInfo.getClZbh(); |
| 579 | lp = schedulePlanInfo.getLp(); | 588 | lp = schedulePlanInfo.getLp(); |
| 580 | // 拼装XML | 589 | // 拼装XML |
| @@ -605,18 +614,28 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -605,18 +614,28 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 605 | sBuffer.append("</JHBC>"); | 614 | sBuffer.append("</JHBC>"); |
| 606 | } | 615 | } |
| 607 | }else{ | 616 | }else{ |
| 608 | - xlbm = schedulePlanInfo.getXlBm(); | ||
| 609 | zbh = schedulePlanInfo.getClZbh(); | 617 | zbh = schedulePlanInfo.getClZbh(); |
| 610 | lp = schedulePlanInfo.getLp(); | 618 | lp = schedulePlanInfo.getLp(); |
| 611 | sBuffer.append("</BCList>"); | 619 | sBuffer.append("</BCList>"); |
| 612 | sBuffer.append("</JHBC>"); | 620 | sBuffer.append("</JHBC>"); |
| 613 | - startSerialNum = 0; | ||
| 614 | - endSerialNum = 0; | ||
| 615 | // 拼装XML | 621 | // 拼装XML |
| 616 | assembleJHBC(sBuffer, schedulePlanInfo, xlbm, zbh, lp); | 622 | assembleJHBC(sBuffer, schedulePlanInfo, xlbm, zbh, lp); |
| 617 | } | 623 | } |
| 618 | } | 624 | } |
| 619 | } | 625 | } |
| 626 | + // 判断XML是否以</BCList>结尾,如果不是,则加上 | ||
| 627 | + String regex = "^*</JHBC>$"; | ||
| 628 | + Pattern p = Pattern.compile(regex); | ||
| 629 | + java.util.regex.Matcher m = p.matcher(sBuffer); | ||
| 630 | + boolean isEndWithTrueFlag = false; | ||
| 631 | + while (m.find()) { | ||
| 632 | + isEndWithTrueFlag = true; | ||
| 633 | + } | ||
| 634 | + // 加上缺失的标签 | ||
| 635 | + if(!isEndWithTrueFlag){ | ||
| 636 | + sBuffer.append("</BCList>"); | ||
| 637 | + sBuffer.append("</JHBC>"); | ||
| 638 | + } | ||
| 620 | sBuffer.append("</JHBCs>"); | 639 | sBuffer.append("</JHBCs>"); |
| 621 | if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | 640 | if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 622 | result = "success"; | 641 | result = "success"; |
| @@ -643,7 +662,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -643,7 +662,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 643 | StringBuffer sBufferA; | 662 | StringBuffer sBufferA; |
| 644 | StringBuffer sBufferB; | 663 | StringBuffer sBufferB; |
| 645 | TTInfo ttInfo; | 664 | TTInfo ttInfo; |
| 646 | - TTInfoDetail ttInfoDetail = null; | 665 | + TTInfoDetail ttInfoDetail; |
| 647 | Iterator<TTInfoDetail> ttInfoDetailIterator; | 666 | Iterator<TTInfoDetail> ttInfoDetailIterator; |
| 648 | HashMap<String,Object> param = new HashMap<String, Object>(); | 667 | HashMap<String,Object> param = new HashMap<String, Object>(); |
| 649 | String lineCode ; | 668 | String lineCode ; |
| @@ -1027,6 +1046,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -1027,6 +1046,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 1027 | company = "浦东金高公交公司"; | 1046 | company = "浦东金高公交公司"; |
| 1028 | }else if(company.equals("南汇公司")){ | 1047 | }else if(company.equals("南汇公司")){ |
| 1029 | company = "浦东南汇公交公司"; | 1048 | company = "浦东南汇公交公司"; |
| 1049 | + }else if(company.equals("青浦公交")){ | ||
| 1050 | + company = "浦东青浦公交公司"; | ||
| 1030 | } | 1051 | } |
| 1031 | } | 1052 | } |
| 1032 | /** | 1053 | /** |
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
| @@ -52,14 +52,14 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | @@ -52,14 +52,14 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | ||
| 52 | // TODO Auto-generated catch block | 52 | // TODO Auto-generated catch block |
| 53 | e.printStackTrace(); | 53 | e.printStackTrace(); |
| 54 | } | 54 | } |
| 55 | - if(map.get("gsdm_in")!=null){ | 55 | + /*if(map.get("gsdm_in")!=null){ |
| 56 | map.put("ssgsdm_in", map.get("gsdm_in")); | 56 | map.put("ssgsdm_in", map.get("gsdm_in")); |
| 57 | map.remove("gsdm_in"); | 57 | map.remove("gsdm_in"); |
| 58 | 58 | ||
| 59 | }else{ | 59 | }else{ |
| 60 | map.put("ssgsdm_like", map.get("gsdm_like")); | 60 | map.put("ssgsdm_like", map.get("gsdm_like")); |
| 61 | map.remove("gsdm_like"); | 61 | map.remove("gsdm_like"); |
| 62 | - } | 62 | + }*/ |
| 63 | 63 | ||
| 64 | //根具条件查询指定日期Ylb的数据 | 64 | //根具条件查询指定日期Ylb的数据 |
| 65 | List<Ylb> ylbIterator=(List<Ylb>) ylbRepository.findAll(new CustomerSpecs<Ylb>(map)); | 65 | List<Ylb> ylbIterator=(List<Ylb>) ylbRepository.findAll(new CustomerSpecs<Ylb>(map)); |
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
| 1 | package com.bsth.service.realcontrol.impl; | 1 | package com.bsth.service.realcontrol.impl; |
| 2 | 2 | ||
| 3 | -import java.util.Map; | ||
| 4 | - | ||
| 5 | -import javax.transaction.Transactional; | ||
| 6 | - | ||
| 7 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 8 | -import org.springframework.stereotype.Service; | ||
| 9 | - | ||
| 10 | import com.bsth.data.BasicData; | 3 | import com.bsth.data.BasicData; |
| 11 | import com.bsth.data.match.Arrival2Schedule; | 4 | import com.bsth.data.match.Arrival2Schedule; |
| 12 | import com.bsth.data.schedule.DayOfSchedule; | 5 | import com.bsth.data.schedule.DayOfSchedule; |
| 13 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 6 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 14 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 7 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 15 | import com.bsth.repository.realcontrol.ChildTaskPlanRepository; | 8 | import com.bsth.repository.realcontrol.ChildTaskPlanRepository; |
| 9 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | ||
| 16 | import com.bsth.service.impl.BaseServiceImpl; | 10 | import com.bsth.service.impl.BaseServiceImpl; |
| 17 | import com.bsth.service.realcontrol.ChildTaskPlanService; | 11 | import com.bsth.service.realcontrol.ChildTaskPlanService; |
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 14 | +import org.springframework.stereotype.Service; | ||
| 15 | + | ||
| 16 | +import javax.transaction.Transactional; | ||
| 17 | +import java.util.Map; | ||
| 18 | 18 | ||
| 19 | @Service | 19 | @Service |
| 20 | public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService{ | 20 | public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService{ |
| 21 | 21 | ||
| 22 | /*@Autowired | 22 | /*@Autowired |
| 23 | ScheduleRealInfoServiceImpl scheduleRealInfoService;*/ | 23 | ScheduleRealInfoServiceImpl scheduleRealInfoService;*/ |
| 24 | + | ||
| 25 | + @Autowired | ||
| 26 | + ScheduleRealInfoRepository scheduleRealInfoRepository; | ||
| 24 | 27 | ||
| 25 | @Autowired | 28 | @Autowired |
| 26 | ChildTaskPlanRepository childTaskPlanRepository; | 29 | ChildTaskPlanRepository childTaskPlanRepository; |
| @@ -30,6 +33,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | @@ -30,6 +33,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | ||
| 30 | 33 | ||
| 31 | @Autowired | 34 | @Autowired |
| 32 | Arrival2Schedule arrival2Schedule; | 35 | Arrival2Schedule arrival2Schedule; |
| 36 | + | ||
| 37 | + @Autowired | ||
| 38 | + JdbcTemplate jdbcTemplate; | ||
| 33 | 39 | ||
| 34 | @Transactional | 40 | @Transactional |
| 35 | @Override | 41 | @Override |
| @@ -62,10 +68,13 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | @@ -62,10 +68,13 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | ||
| 62 | //解除和主任务关联 | 68 | //解除和主任务关联 |
| 63 | ScheduleRealInfo sch = dayOfSchedule.get(cPlan.getSchedule().getId()); | 69 | ScheduleRealInfo sch = dayOfSchedule.get(cPlan.getSchedule().getId()); |
| 64 | sch.getcTasks().remove(cPlan); | 70 | sch.getcTasks().remove(cPlan); |
| 71 | + //删除关联表数据 | ||
| 72 | + jdbcTemplate.execute("delete from bsth_c_s_sp_info_real_c_tasks where bsth_c_s_sp_info_real="+sch.getId()+" and c_tasks="+cPlan.getId()); | ||
| 73 | + | ||
| 65 | //删除子任务 | 74 | //删除子任务 |
| 66 | rs = super.delete(id); | 75 | rs = super.delete(id); |
| 67 | dayOfSchedule.save(sch); | 76 | dayOfSchedule.save(sch); |
| 68 | - | 77 | + |
| 69 | rs.put("t", sch); | 78 | rs.put("t", sch); |
| 70 | return rs; | 79 | return rs; |
| 71 | } | 80 | } |
src/main/java/com/bsth/service/schedule/CarDeviceService.java
0 → 100644
src/main/java/com/bsth/service/schedule/EmployeeService.java
0 → 100644
src/main/java/com/bsth/service/schedule/GuideboardInfoService.java
| @@ -6,6 +6,8 @@ import com.bsth.entity.schedule.GuideboardInfo; | @@ -6,6 +6,8 @@ import com.bsth.entity.schedule.GuideboardInfo; | ||
| 6 | * Created by xu on 16/5/11. | 6 | * Created by xu on 16/5/11. |
| 7 | */ | 7 | */ |
| 8 | public interface GuideboardInfoService extends BService<GuideboardInfo, Long> { | 8 | public interface GuideboardInfoService extends BService<GuideboardInfo, Long> { |
| 9 | - public void validate(GuideboardInfo guideboardInfo) throws ScheduleException; | 9 | + public void validate_lpno(GuideboardInfo guideboardInfo) throws ScheduleException; |
| 10 | + public void validate_lpname(GuideboardInfo guideboardInfo) throws ScheduleException; | ||
| 10 | public void toggleCancel(Long id) throws ScheduleException; | 11 | public void toggleCancel(Long id) throws ScheduleException; |
| 12 | + | ||
| 11 | } | 13 | } |
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
| @@ -46,7 +46,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -46,7 +46,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 46 | if(company.length() != 0) | 46 | if(company.length() != 0) |
| 47 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; | 47 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| 48 | 48 | ||
| 49 | - list =jdbcTemplate.query(sql, | 49 | + list = jdbcTemplate.query(sql, |
| 50 | new RowMapper<ScheduleRealInfo>(){ | 50 | new RowMapper<ScheduleRealInfo>(){ |
| 51 | @Override | 51 | @Override |
| 52 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | 52 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |
| @@ -117,7 +117,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -117,7 +117,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 117 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; | 117 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | - list =jdbcTemplate.query(sql, | 120 | + list = jdbcTemplate.query(sql, |
| 121 | new RowMapper<SchedulePlanInfo>(){ | 121 | new RowMapper<SchedulePlanInfo>(){ |
| 122 | @Override | 122 | @Override |
| 123 | public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | 123 | public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |
| @@ -362,13 +362,15 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -362,13 +362,15 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 362 | } | 362 | } |
| 363 | ScheduleRealInfo shouban = tempList.get(0); | 363 | ScheduleRealInfo shouban = tempList.get(0); |
| 364 | ScheduleRealInfo moban = tempList.get(tempList.size() - 1); | 364 | ScheduleRealInfo moban = tempList.get(tempList.size() - 1); |
| 365 | +// System.out.println(shouban.getFcsjActual() + "-首班-" + shouban.getFcsj()); | ||
| 366 | +// System.out.println(moban.getFcsjActual() + "-末班-" + moban.getFcsj()); | ||
| 367 | + jhsb++; | ||
| 365 | if(shouban.getFcsjActual() != null){ | 368 | if(shouban.getFcsjActual() != null){ |
| 366 | - jhsb++; | ||
| 367 | if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -60000 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 180000) | 369 | if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -60000 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 180000) |
| 368 | sjsb++; | 370 | sjsb++; |
| 369 | } | 371 | } |
| 372 | + jhmb++; | ||
| 370 | if(moban.getFcsjActual() != null){ | 373 | if(moban.getFcsjActual() != null){ |
| 371 | - jhmb++; | ||
| 372 | if(moban.getFcsjActualTime() - moban.getFcsjT() >= -60000 && moban.getFcsjActualTime() - moban.getFcsjT() <= 180000) | 374 | if(moban.getFcsjActualTime() - moban.getFcsjT() >= -60000 && moban.getFcsjActualTime() - moban.getFcsjT() <= 180000) |
| 373 | sjmb++; | 375 | sjmb++; |
| 374 | } | 376 | } |
| @@ -452,7 +454,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -452,7 +454,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 452 | } | 454 | } |
| 453 | sql += " and bc_type = 'normal'"; | 455 | sql += " and bc_type = 'normal'"; |
| 454 | 456 | ||
| 455 | - list =jdbcTemplate.query(sql, | 457 | + list = jdbcTemplate.query(sql, |
| 456 | new RowMapper<ScheduleRealInfo>(){ | 458 | new RowMapper<ScheduleRealInfo>(){ |
| 457 | @Override | 459 | @Override |
| 458 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | 460 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |
src/main/java/com/bsth/service/schedule/impl/CarConfigInfoServiceImpl.java
| @@ -36,12 +36,14 @@ public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> | @@ -36,12 +36,14 @@ public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> | ||
| 36 | throw new ScheduleException("线路未选择"); | 36 | throw new ScheduleException("线路未选择"); |
| 37 | } else { | 37 | } else { |
| 38 | // param.put("xl.id_eq", carConfigInfo.getXl().getId()); | 38 | // param.put("xl.id_eq", carConfigInfo.getXl().getId()); |
| 39 | + param.put("isCancel_eq", false); | ||
| 39 | if (carConfigInfo.getCl() == null || carConfigInfo.getCl().getId() == null) { | 40 | if (carConfigInfo.getCl() == null || carConfigInfo.getCl().getId() == null) { |
| 40 | throw new ScheduleException("车辆未选择"); | 41 | throw new ScheduleException("车辆未选择"); |
| 41 | } else { | 42 | } else { |
| 42 | param.put("cl.id_eq", carConfigInfo.getCl().getId()); | 43 | param.put("cl.id_eq", carConfigInfo.getCl().getId()); |
| 43 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 44 | - throw new ScheduleException("车辆已经配置在" + carConfigInfo.getXl().getName() + "线路中!"); | 44 | + List<CarConfigInfo> carConfigInfos = list(param); |
| 45 | + if (!CollectionUtils.isEmpty(carConfigInfos)) { | ||
| 46 | + throw new ScheduleException("车辆已经配置在" + carConfigInfos.get(0).getXl().getName() + "线路中!"); | ||
| 45 | } | 47 | } |
| 46 | } | 48 | } |
| 47 | } | 49 | } |
src/main/java/com/bsth/service/schedule/impl/CarDeviceServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.CarDevice; | ||
| 4 | +import com.bsth.entity.Cars; | ||
| 5 | +import com.bsth.service.CarsService; | ||
| 6 | +import com.bsth.service.schedule.CarDeviceService; | ||
| 7 | +import com.bsth.service.schedule.ScheduleException; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.stereotype.Service; | ||
| 10 | +import org.springframework.transaction.annotation.Transactional; | ||
| 11 | +import org.springframework.util.CollectionUtils; | ||
| 12 | + | ||
| 13 | +import java.util.HashMap; | ||
| 14 | +import java.util.Map; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * Created by xu on 16/12/15. | ||
| 18 | + */ | ||
| 19 | +@Service(value = "carDeviceServiceImpl_sc") | ||
| 20 | +public class CarDeviceServiceImpl extends BServiceImpl<CarDevice, Long> implements CarDeviceService { | ||
| 21 | + @Autowired | ||
| 22 | + private CarsService carsService; | ||
| 23 | + | ||
| 24 | + @Transactional | ||
| 25 | + @Override | ||
| 26 | + public CarDevice save(CarDevice carDevice) { | ||
| 27 | + // 查找对应的车辆基础信息,更新设备编号数据 | ||
| 28 | + Cars cars = carsService.findById(carDevice.getCl()); | ||
| 29 | + cars.setEquipmentCode(carDevice.getNewDeviceNo()); | ||
| 30 | + return super.save(carDevice); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + @Transactional | ||
| 34 | + @Override | ||
| 35 | + public void validate_qyrq(CarDevice carDevice) throws ScheduleException { | ||
| 36 | + if (carDevice.getXl() == null) { | ||
| 37 | + throw new ScheduleException("线路未选择"); | ||
| 38 | + } | ||
| 39 | + if (carDevice.getCl() == null) { | ||
| 40 | + throw new ScheduleException("车辆未选择"); | ||
| 41 | + } | ||
| 42 | + Map<String, Object> param = new HashMap<>(); | ||
| 43 | + if (carDevice.getId() != null) { | ||
| 44 | + param.put("id_ne", carDevice.getId()); | ||
| 45 | + } | ||
| 46 | + param.put("xl_eq", carDevice.getXl()); | ||
| 47 | + param.put("cl_eq", carDevice.getCl()); | ||
| 48 | + param.put("qyrq_ge", carDevice.getQyrq()); | ||
| 49 | + if (!CollectionUtils.isEmpty(list(param))) { | ||
| 50 | + throw new ScheduleException("启用日期必须比历史的启用日期大"); | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + @Transactional | ||
| 55 | + @Override | ||
| 56 | + public void delete(Long aLong) throws ScheduleException { | ||
| 57 | + toggleCancel(aLong); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @Transactional | ||
| 61 | + public void toggleCancel(Long id) throws ScheduleException { | ||
| 62 | + CarDevice carDevice = findById(id); | ||
| 63 | + if (carDevice.getIsCancel()) { | ||
| 64 | + carDevice.setIsCancel(false); | ||
| 65 | + } else { | ||
| 66 | + carDevice.setIsCancel(true); | ||
| 67 | + } | ||
| 68 | + } | ||
| 69 | +} |
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
| @@ -34,12 +34,15 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | @@ -34,12 +34,15 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | ||
| 34 | employeeConfigInfo.getXl().getName() == null) { | 34 | employeeConfigInfo.getXl().getName() == null) { |
| 35 | throw new ScheduleException("线路未选择"); | 35 | throw new ScheduleException("线路未选择"); |
| 36 | } else { | 36 | } else { |
| 37 | +// param.put("xl.id_eq", employeeConfigInfo.getXl().getId()); | ||
| 38 | + param.put("isCancel_eq", false); | ||
| 37 | if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) { | 39 | if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) { |
| 38 | throw new ScheduleException("驾驶员未选择"); | 40 | throw new ScheduleException("驾驶员未选择"); |
| 39 | } else { | 41 | } else { |
| 40 | param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId()); | 42 | param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId()); |
| 43 | + List<EmployeeConfigInfo> employeeConfigInfos = list(param); | ||
| 41 | if (!CollectionUtils.isEmpty(list(param))) { | 44 | if (!CollectionUtils.isEmpty(list(param))) { |
| 42 | - throw new ScheduleException("驾驶员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!"); | 45 | + throw new ScheduleException("驾驶员已经配置在" + employeeConfigInfos.get(0).getXl().getName() + "线路中!"); |
| 43 | } | 46 | } |
| 44 | } | 47 | } |
| 45 | } | 48 | } |
| @@ -59,12 +62,14 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | @@ -59,12 +62,14 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | ||
| 59 | employeeConfigInfo.getXl().getName() == null) { | 62 | employeeConfigInfo.getXl().getName() == null) { |
| 60 | throw new ScheduleException("线路未选择"); | 63 | throw new ScheduleException("线路未选择"); |
| 61 | } else { | 64 | } else { |
| 65 | +// param.put("xl.id_eq", employeeConfigInfo.getXl().getId()); | ||
| 62 | if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) { | 66 | if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) { |
| 63 | throw new ScheduleException("售票员未选择"); | 67 | throw new ScheduleException("售票员未选择"); |
| 64 | } else { | 68 | } else { |
| 65 | param.put("spy.id_eq", employeeConfigInfo.getSpy().getId()); | 69 | param.put("spy.id_eq", employeeConfigInfo.getSpy().getId()); |
| 70 | + List<EmployeeConfigInfo> employeeConfigInfos = list(param); | ||
| 66 | if (!CollectionUtils.isEmpty(list(param))) { | 71 | if (!CollectionUtils.isEmpty(list(param))) { |
| 67 | - throw new ScheduleException("售票员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!"); | 72 | + throw new ScheduleException("售票员已经配置在" + employeeConfigInfos.get(0).getXl().getName() + "线路中!"); |
| 68 | } | 73 | } |
| 69 | } | 74 | } |
| 70 | } | 75 | } |
| @@ -83,7 +88,9 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | @@ -83,7 +88,9 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | ||
| 83 | Map<String, Object> param = new HashMap<>(); | 88 | Map<String, Object> param = new HashMap<>(); |
| 84 | if (employeeConfigInfo.getIsCancel()) { | 89 | if (employeeConfigInfo.getIsCancel()) { |
| 85 | validate_jsy(employeeConfigInfo); | 90 | validate_jsy(employeeConfigInfo); |
| 86 | - validate_spy(employeeConfigInfo); | 91 | + if (employeeConfigInfo.getSpy() != null) { |
| 92 | + validate_spy(employeeConfigInfo); | ||
| 93 | + } | ||
| 87 | employeeConfigInfo.setIsCancel(false); | 94 | employeeConfigInfo.setIsCancel(false); |
| 88 | } else { | 95 | } else { |
| 89 | param.clear(); | 96 | param.clear(); |
src/main/java/com/bsth/service/schedule/impl/EmployeeServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.Personnel; | ||
| 4 | +import com.bsth.service.schedule.EmployeeService; | ||
| 5 | +import com.bsth.service.schedule.ScheduleException; | ||
| 6 | +import org.springframework.stereotype.Service; | ||
| 7 | +import org.springframework.transaction.annotation.Transactional; | ||
| 8 | +import org.springframework.util.CollectionUtils; | ||
| 9 | + | ||
| 10 | +import java.util.HashMap; | ||
| 11 | +import java.util.Map; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * Created by xu on 16/12/15. | ||
| 15 | + */ | ||
| 16 | +@Service | ||
| 17 | +public class EmployeeServiceImpl extends BServiceImpl<Personnel, Integer> implements EmployeeService { | ||
| 18 | + @Override | ||
| 19 | + @Transactional | ||
| 20 | + public void validate_gh(Personnel personnel) throws ScheduleException { | ||
| 21 | + // 查询条件 | ||
| 22 | + Map<String, Object> param = new HashMap<>(); | ||
| 23 | + if (personnel.getId() != null) { | ||
| 24 | + param.put("id_ne", personnel.getId()); | ||
| 25 | + } | ||
| 26 | + param.put("companyCode_eq", personnel.getCompanyCode()); | ||
| 27 | + param.put("jobCode_eq", personnel.getJobCode()); | ||
| 28 | + if (!CollectionUtils.isEmpty(list(param))) { | ||
| 29 | + throw new ScheduleException("相同公司工号重复"); | ||
| 30 | + } | ||
| 31 | + } | ||
| 32 | +} |
src/main/java/com/bsth/service/schedule/impl/GuideboardInfoServiceImpl.java
| @@ -22,52 +22,44 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | @@ -22,52 +22,44 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | ||
| 22 | @Autowired | 22 | @Autowired |
| 23 | private TTInfoDetailService ttInfoDetailService; | 23 | private TTInfoDetailService ttInfoDetailService; |
| 24 | 24 | ||
| 25 | - // 验证方法 | ||
| 26 | - @Transactional | ||
| 27 | - public void validate(GuideboardInfo guideboardInfo) throws ScheduleException { | 25 | + @Override |
| 26 | + public void validate_lpno(GuideboardInfo guideboardInfo) throws ScheduleException { | ||
| 28 | // 查询条件 | 27 | // 查询条件 |
| 29 | Map<String, Object> param = new HashMap<>(); | 28 | Map<String, Object> param = new HashMap<>(); |
| 30 | - if (guideboardInfo.getId() != null) | 29 | + if (guideboardInfo.getId() != null) { |
| 31 | param.put("id_ne", guideboardInfo.getId()); | 30 | param.put("id_ne", guideboardInfo.getId()); |
| 31 | + } | ||
| 32 | 32 | ||
| 33 | if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) { | 33 | if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) { |
| 34 | throw new ScheduleException("线路未选择"); | 34 | throw new ScheduleException("线路未选择"); |
| 35 | } else { | 35 | } else { |
| 36 | + param.put("isCancel_eq", false); // 作废的也算入判定区 | ||
| 36 | param.put("xl.id_eq", guideboardInfo.getXl().getId()); | 37 | param.put("xl.id_eq", guideboardInfo.getXl().getId()); |
| 38 | + param.put("lpNo_eq", guideboardInfo.getLpNo()); | ||
| 39 | + if (!CollectionUtils.isEmpty(list(param))) { | ||
| 40 | + throw new ScheduleException("路牌编号重复"); | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + } | ||
| 37 | 44 | ||
| 38 | -// param.put("isCancel_eq", false); // 作废的也算入判定区 | ||
| 39 | - if (guideboardInfo.getLpNo() != null) { | ||
| 40 | - if (guideboardInfo.getLpName() != null) { | ||
| 41 | - // 如果两个都写了,分开查询 | ||
| 42 | - param.put("lpNo_eq", guideboardInfo.getLpNo()); | ||
| 43 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 44 | - throw new ScheduleException("路牌编号重复"); | ||
| 45 | - } | ||
| 46 | - param.remove("lpNo_eq"); | ||
| 47 | - param.put("lpName_eq", guideboardInfo.getLpName()); | ||
| 48 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 49 | - throw new ScheduleException("路牌名称重复"); | ||
| 50 | - } | 45 | + @Override |
| 46 | + public void validate_lpname(GuideboardInfo guideboardInfo) throws ScheduleException { | ||
| 47 | + // 查询条件 | ||
| 48 | + Map<String, Object> param = new HashMap<>(); | ||
| 49 | + if (guideboardInfo.getId() != null) { | ||
| 50 | + param.put("id_ne", guideboardInfo.getId()); | ||
| 51 | + } | ||
| 51 | 52 | ||
| 52 | - } else { | ||
| 53 | - param.put("lpNo_eq", guideboardInfo.getLpNo()); | ||
| 54 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 55 | - throw new ScheduleException("路牌编号重复"); | ||
| 56 | - } | ||
| 57 | - } | ||
| 58 | - } else { | ||
| 59 | - if (guideboardInfo.getLpName() != null) { | ||
| 60 | - param.put("lpName_eq", guideboardInfo.getLpName()); | ||
| 61 | - if (!CollectionUtils.isEmpty(list(param))) { | ||
| 62 | - throw new ScheduleException("路牌名字重复"); | ||
| 63 | - } | ||
| 64 | - } else { | ||
| 65 | - // 都为空 | ||
| 66 | - throw new ScheduleException("路牌编号名字都为空"); | ||
| 67 | - } | 53 | + if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) { |
| 54 | + throw new ScheduleException("线路未选择"); | ||
| 55 | + } else { | ||
| 56 | + param.put("isCancel_eq", false); // 作废的也算入判定区 | ||
| 57 | + param.put("xl.id_eq", guideboardInfo.getXl().getId()); | ||
| 58 | + param.put("lpName_eq", guideboardInfo.getLpName()); | ||
| 59 | + if (!CollectionUtils.isEmpty(list(param))) { | ||
| 60 | + throw new ScheduleException("路牌名字重复"); | ||
| 68 | } | 61 | } |
| 69 | } | 62 | } |
| 70 | - | ||
| 71 | } | 63 | } |
| 72 | 64 | ||
| 73 | @Transactional | 65 | @Transactional |
| @@ -83,7 +75,8 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | @@ -83,7 +75,8 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | ||
| 83 | GuideboardInfo guideboardInfo = findById(id); | 75 | GuideboardInfo guideboardInfo = findById(id); |
| 84 | Map<String, Object> param = new HashMap<>(); | 76 | Map<String, Object> param = new HashMap<>(); |
| 85 | if (guideboardInfo.getIsCancel()) { | 77 | if (guideboardInfo.getIsCancel()) { |
| 86 | - validate(guideboardInfo); | 78 | + validate_lpno(guideboardInfo); |
| 79 | + validate_lpname(guideboardInfo); | ||
| 87 | guideboardInfo.setIsCancel(false); | 80 | guideboardInfo.setIsCancel(false); |
| 88 | } else { | 81 | } else { |
| 89 | param.clear(); | 82 | param.clear(); |
| @@ -96,7 +89,7 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | @@ -96,7 +89,7 @@ public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long | ||
| 96 | } else { | 89 | } else { |
| 97 | throw new ScheduleException("在时刻表" + | 90 | throw new ScheduleException("在时刻表" + |
| 98 | ttInfoDetailList.get(0).getTtinfo().getName() + | 91 | ttInfoDetailList.get(0).getTtinfo().getName() + |
| 99 | - "已使用,无法删除!"); | 92 | + "已使用,无法作废!"); |
| 100 | } | 93 | } |
| 101 | } | 94 | } |
| 102 | } | 95 | } |
src/main/resources/static/pages/base/line/js/line-add-form.js
| @@ -94,7 +94,7 @@ $(function(){ | @@ -94,7 +94,7 @@ $(function(){ | ||
| 94 | $('#endStationEndTimeInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'}); | 94 | $('#endStationEndTimeInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'}); |
| 95 | 95 | ||
| 96 | /** get请求获取公司表数据并填充公司下拉框选择值 */ | 96 | /** get请求获取公司表数据并填充公司下拉框选择值 */ |
| 97 | - $get('/business/all', {upCode_eq: '77'}, function(array){ | 97 | + $get('/business/all', {upCode_eq: '88'}, function(array){ |
| 98 | 98 | ||
| 99 | /** 公司下拉options属性值 */ | 99 | /** 公司下拉options属性值 */ |
| 100 | var options = '<option value="">-- 请选择公司 --</option>'; | 100 | var options = '<option value="">-- 请选择公司 --</option>'; |
src/main/resources/static/pages/base/line/js/line-details-info.js
| @@ -47,7 +47,7 @@ $(function(){ | @@ -47,7 +47,7 @@ $(function(){ | ||
| 47 | function selectTemp(callback) { | 47 | function selectTemp(callback) { |
| 48 | 48 | ||
| 49 | // 填充公司下拉框选择值 | 49 | // 填充公司下拉框选择值 |
| 50 | - $.get('/business/all', {upCode_eq: '77'}, function(array){ | 50 | + $.get('/business/all', {upCode_eq: '88'}, function(array){ |
| 51 | 51 | ||
| 52 | // 公司下拉options属性值 | 52 | // 公司下拉options属性值 |
| 53 | var options = '<option value="">-- 请选择公司 --</option>'; | 53 | var options = '<option value="">-- 请选择公司 --</option>'; |
src/main/resources/static/pages/base/line/js/line-edit-form.js
| @@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
| 42 | function selectTemp(callback) { | 42 | function selectTemp(callback) { |
| 43 | 43 | ||
| 44 | // 填充公司下拉框选择值 | 44 | // 填充公司下拉框选择值 |
| 45 | - $.get('/business/all', {upCode_eq: '77'}, function(array){ | 45 | + $.get('/business/all', {upCode_eq: '88'}, function(array){ |
| 46 | 46 | ||
| 47 | // 公司下拉options属性值 | 47 | // 公司下拉options属性值 |
| 48 | var options = '<option value="">-- 请选择公司 --</option>'; | 48 | var options = '<option value="">-- 请选择公司 --</option>'; |
src/main/resources/static/pages/base/line/js/line-list-table.js
| @@ -202,7 +202,7 @@ | @@ -202,7 +202,7 @@ | ||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | /** 填充公司下拉框选择值 */ | 204 | /** 填充公司下拉框选择值 */ |
| 205 | - $get('/business/all', {upCode_eq: '77'}, function(array){ | 205 | + $get('/business/all', {upCode_eq: '88'}, function(array){ |
| 206 | 206 | ||
| 207 | // 公司下拉options属性值 | 207 | // 公司下拉options属性值 |
| 208 | var options = '<option value="">请选择...</option>'; | 208 | var options = '<option value="">请选择...</option>'; |
src/main/resources/static/pages/forecast/sample/js/svg.js
| @@ -218,6 +218,8 @@ var sampleSvg = (function(){ | @@ -218,6 +218,8 @@ var sampleSvg = (function(){ | ||
| 218 | 218 | ||
| 219 | //分析path d 路径中间点 | 219 | //分析path d 路径中间点 |
| 220 | function analysePath(d){ | 220 | function analysePath(d){ |
| 221 | + if(!d) | ||
| 222 | + return [-100, -100]; | ||
| 221 | d = d.replace('M', ''); | 223 | d = d.replace('M', ''); |
| 222 | var sp = d.split('L')[0].split(',') | 224 | var sp = d.split('L')[0].split(',') |
| 223 | ,ep = d.split('L')[1].split(',') | 225 | ,ep = d.split('L')[1].split(',') |
src/main/resources/static/pages/forms/statement/operationservice.html
| @@ -79,7 +79,7 @@ | @@ -79,7 +79,7 @@ | ||
| 79 | <th>消耗量</th> | 79 | <th>消耗量</th> |
| 80 | <th>行驶公里(含空放里程)</th> | 80 | <th>行驶公里(含空放里程)</th> |
| 81 | <th>空驶里程</th> | 81 | <th>空驶里程</th> |
| 82 | - <th>实际班次(包含空放把班次)</th> | 82 | + <th>实际班次(包含空放班次)</th> |
| 83 | </tr> | 83 | </tr> |
| 84 | </thead> | 84 | </thead> |
| 85 | <tbody> | 85 | <tbody> |
| @@ -112,7 +112,6 @@ | @@ -112,7 +112,6 @@ | ||
| 112 | text : result[code] | 112 | text : result[code] |
| 113 | }); | 113 | }); |
| 114 | } | 114 | } |
| 115 | - console.log(data); | ||
| 116 | initPinYinSelect2('#line', data, ''); | 115 | initPinYinSelect2('#line', data, ''); |
| 117 | 116 | ||
| 118 | }) | 117 | }) |
| @@ -199,7 +198,6 @@ | @@ -199,7 +198,6 @@ | ||
| 199 | obj.updateDate = moment(obj.startDate).format( | 198 | obj.updateDate = moment(obj.startDate).format( |
| 200 | "YYYY-MM-DD HH:mm:ss"); | 199 | "YYYY-MM-DD HH:mm:ss"); |
| 201 | }); | 200 | }); |
| 202 | - console.log(result); | ||
| 203 | var operationservice = template('operationservice', { | 201 | var operationservice = template('operationservice', { |
| 204 | list : result | 202 | list : result |
| 205 | }); | 203 | }); |
src/main/resources/static/pages/forms/statement/shifday.html
| @@ -147,7 +147,6 @@ $(function(){ | @@ -147,7 +147,6 @@ $(function(){ | ||
| 147 | for(var code in result){ | 147 | for(var code in result){ |
| 148 | data.push({id: code, text: result[code]}); | 148 | data.push({id: code, text: result[code]}); |
| 149 | } | 149 | } |
| 150 | - console.log(data); | ||
| 151 | initPinYinSelect2('#line',data,''); | 150 | initPinYinSelect2('#line',data,''); |
| 152 | 151 | ||
| 153 | }) | 152 | }) |
src/main/resources/static/pages/forms/statement/shiftuehiclemanth.html
| @@ -137,7 +137,6 @@ | @@ -137,7 +137,6 @@ | ||
| 137 | for(var code in result){ | 137 | for(var code in result){ |
| 138 | data.push({id: code, text: result[code]}); | 138 | data.push({id: code, text: result[code]}); |
| 139 | } | 139 | } |
| 140 | - console.log(data); | ||
| 141 | initPinYinSelect2('#line',data,''); | 140 | initPinYinSelect2('#line',data,''); |
| 142 | 141 | ||
| 143 | }) | 142 | }) |
src/main/resources/static/pages/forms/statement/singledata.html
| @@ -142,7 +142,6 @@ | @@ -142,7 +142,6 @@ | ||
| 142 | for(var code in result){ | 142 | for(var code in result){ |
| 143 | data.push({id: code, text: result[code]}); | 143 | data.push({id: code, text: result[code]}); |
| 144 | } | 144 | } |
| 145 | - console.log(data); | ||
| 146 | initPinYinSelect2('#line',data,''); | 145 | initPinYinSelect2('#line',data,''); |
| 147 | 146 | ||
| 148 | }) | 147 | }) |
| @@ -167,7 +166,6 @@ | @@ -167,7 +166,6 @@ | ||
| 167 | } | 166 | } |
| 168 | obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); | 167 | obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); |
| 169 | }); | 168 | }); |
| 170 | - console.log(result); | ||
| 171 | var singledata = template('singledata',{list:result}); | 169 | var singledata = template('singledata',{list:result}); |
| 172 | // 把渲染好的模版html文本追加到表格中 | 170 | // 把渲染好的模版html文本追加到表格中 |
| 173 | $('#forms tbody').html(singledata); | 171 | $('#forms tbody').html(singledata); |
src/main/resources/static/pages/forms/statement/vehicleloading.html
| @@ -130,7 +130,6 @@ | @@ -130,7 +130,6 @@ | ||
| 130 | for(var code in result){ | 130 | for(var code in result){ |
| 131 | data.push({id: code, text: result[code]}); | 131 | data.push({id: code, text: result[code]}); |
| 132 | } | 132 | } |
| 133 | - console.log(data); | ||
| 134 | initPinYinSelect2('#line',data,''); | 133 | initPinYinSelect2('#line',data,''); |
| 135 | 134 | ||
| 136 | }) | 135 | }) |
src/main/resources/static/pages/forms/statement/waybillday.html
| @@ -129,7 +129,6 @@ | @@ -129,7 +129,6 @@ | ||
| 129 | for(var code in result){ | 129 | for(var code in result){ |
| 130 | data.push({id: code, text: result[code]}); | 130 | data.push({id: code, text: result[code]}); |
| 131 | } | 131 | } |
| 132 | - console.log(data); | ||
| 133 | initPinYinSelect2('#line',data,''); | 132 | initPinYinSelect2('#line',data,''); |
| 134 | 133 | ||
| 135 | }) | 134 | }) |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/edit.html
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | required ng-maxlength="20" | 48 | required ng-maxlength="20" |
| 49 | remote-Validation | 49 | remote-Validation |
| 50 | remotevtype="cars_zbh" | 50 | remotevtype="cars_zbh" |
| 51 | - remotevparam="{{ {'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}" | 51 | + remotevparam="{{ {'id_eq': ctrl.busInfoForSave.id, 'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}" |
| 52 | placeholder="请输入车辆内部编码"/> | 52 | placeholder="请输入车辆内部编码"/> |
| 53 | </div> | 53 | </div> |
| 54 | <!-- 隐藏块,显示验证信息 --> | 54 | <!-- 隐藏块,显示验证信息 --> |
| @@ -66,18 +66,18 @@ | @@ -66,18 +66,18 @@ | ||
| 66 | <div class="form-group has-success has-feedback"> | 66 | <div class="form-group has-success has-feedback"> |
| 67 | <label class="col-md-2 control-label">所属公司*:</label> | 67 | <label class="col-md-2 control-label">所属公司*:</label> |
| 68 | <div class="col-md-3"> | 68 | <div class="col-md-3"> |
| 69 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 70 | - name="gs" | ||
| 71 | - placeholder="请选择所属公司..." | ||
| 72 | - dcvalue="{{ctrl.busInfoForSave.businessCode}}" | 69 | + <sa-Select5 name="gs" |
| 70 | + model="ctrl.busInfoForSave" | ||
| 71 | + cmaps="{'businessCode': 'code', 'company': 'name'}" | ||
| 73 | dcname="businessCode" | 72 | dcname="businessCode" |
| 74 | icname="code" | 73 | icname="code" |
| 75 | - dcname2="company" | ||
| 76 | - icname2="name" | ||
| 77 | - icnames="name" | ||
| 78 | - datatype="gsType" | 74 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 75 | + iterobjname="item" | ||
| 76 | + iterobjexp="item.name" | ||
| 77 | + searchph="请选择所属公司..." | ||
| 78 | + searchexp="this.name" | ||
| 79 | required > | 79 | required > |
| 80 | - </sa-Select3> | 80 | + </sa-Select5> |
| 81 | 81 | ||
| 82 | </div> | 82 | </div> |
| 83 | <!-- 隐藏块,显示验证信息 --> | 83 | <!-- 隐藏块,显示验证信息 --> |
| @@ -108,7 +108,7 @@ | @@ -108,7 +108,7 @@ | ||
| 108 | required placeholder="请输入车辆编码" | 108 | required placeholder="请输入车辆编码" |
| 109 | remote-Validation | 109 | remote-Validation |
| 110 | remotevtype="cars_clbh" | 110 | remotevtype="cars_clbh" |
| 111 | - remotevparam="{{ {'carCode_eq': ctrl.busInfoForSave.carCode} | json}}" | 111 | + remotevparam="{{ {'id_eq': ctrl.busInfoForSave.id, 'carCode_eq': ctrl.busInfoForSave.carCode} | json}}" |
| 112 | /> | 112 | /> |
| 113 | </div> | 113 | </div> |
| 114 | <!-- 隐藏块,显示验证信息 --> | 114 | <!-- 隐藏块,显示验证信息 --> |
| @@ -128,7 +128,7 @@ | @@ -128,7 +128,7 @@ | ||
| 128 | required placeholder="请输入车牌号" | 128 | required placeholder="请输入车牌号" |
| 129 | remote-Validation | 129 | remote-Validation |
| 130 | remotevtype="cars_cph" | 130 | remotevtype="cars_cph" |
| 131 | - remotevparam="{{ {'carPlate_eq': ctrl.busInfoForSave.carPlate} | json}}" | 131 | + remotevparam="{{ {'id_eq': ctrl.busInfoForSave.id, 'carPlate_eq': ctrl.busInfoForSave.carPlate} | json}}" |
| 132 | /> | 132 | /> |
| 133 | </div> | 133 | </div> |
| 134 | <!-- 隐藏快,显示验证信息 --> | 134 | <!-- 隐藏快,显示验证信息 --> |
| @@ -143,16 +143,18 @@ | @@ -143,16 +143,18 @@ | ||
| 143 | <div class="form-group has-success has-feedback"> | 143 | <div class="form-group has-success has-feedback"> |
| 144 | <label class="col-md-2 control-label">设备供应厂商*:</label> | 144 | <label class="col-md-2 control-label">设备供应厂商*:</label> |
| 145 | <div class="col-md-3"> | 145 | <div class="col-md-3"> |
| 146 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 147 | - name="supplierName" | ||
| 148 | - placeholder="请选择设备厂商..." | ||
| 149 | - dcvalue="{{ctrl.busInfoForSave.supplierName}}" | 146 | + <sa-Select5 name="supplierName" |
| 147 | + model="ctrl.busInfoForSave" | ||
| 148 | + cmaps="{'supplierName': 'code'}" | ||
| 150 | dcname="supplierName" | 149 | dcname="supplierName" |
| 151 | icname="code" | 150 | icname="code" |
| 152 | - icnames="name" | ||
| 153 | - datatype="snames" | 151 | + dsparams="{{ {type: 'dic', param: 'snames' } | json }}" |
| 152 | + iterobjname="item" | ||
| 153 | + iterobjexp="item.name" | ||
| 154 | + searchph="请选择设备厂商..." | ||
| 155 | + searchexp="this.name" | ||
| 154 | required > | 156 | required > |
| 155 | - </sa-Select3> | 157 | + </sa-Select5> |
| 156 | </div> | 158 | </div> |
| 157 | <!-- 隐藏快,显示验证信息 --> | 159 | <!-- 隐藏快,显示验证信息 --> |
| 158 | <div class="alert alert-danger well-sm" ng-show="myForm.supplierName.$error.required"> | 160 | <div class="alert alert-danger well-sm" ng-show="myForm.supplierName.$error.required"> |
| @@ -168,7 +170,7 @@ | @@ -168,7 +170,7 @@ | ||
| 168 | required placeholder="请输入设备终端号" | 170 | required placeholder="请输入设备终端号" |
| 169 | remote-Validation | 171 | remote-Validation |
| 170 | remotevtype="cars_sbbh" | 172 | remotevtype="cars_sbbh" |
| 171 | - remotevparam="{{ {'equipmentCode_eq': ctrl.busInfoForSave.equipmentCode} | json}}" | 173 | + remotevparam="{{ {'id_eq': ctrl.busInfoForSave.id, 'equipmentCode_eq': ctrl.busInfoForSave.equipmentCode} | json}}" |
| 172 | /> | 174 | /> |
| 173 | </div> | 175 | </div> |
| 174 | <!-- 隐藏块,显示验证信息 --> | 176 | <!-- 隐藏块,显示验证信息 --> |
| @@ -369,45 +371,54 @@ | @@ -369,45 +371,54 @@ | ||
| 369 | <div class="form-group"> | 371 | <div class="form-group"> |
| 370 | <label class="col-md-2 control-label">车辆类型:</label> | 372 | <label class="col-md-2 control-label">车辆类型:</label> |
| 371 | <div class="col-md-3"> | 373 | <div class="col-md-3"> |
| 372 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 373 | - name="carType" | ||
| 374 | - placeholder="请选择车辆类型..." | ||
| 375 | - dcvalue="{{ctrl.busInfoForSave.carType}}" | 374 | + <sa-Select5 name="carType" |
| 375 | + model="ctrl.busInfoForSave" | ||
| 376 | + cmaps="{'carType': 'code'}" | ||
| 376 | dcname="carType" | 377 | dcname="carType" |
| 377 | icname="code" | 378 | icname="code" |
| 378 | - icnames="name" | ||
| 379 | - datatype="carType" > | ||
| 380 | - </sa-Select3> | 379 | + dsparams="{{ {type: 'dic', param: 'carType' } | json }}" |
| 380 | + iterobjname="item" | ||
| 381 | + iterobjexp="item.name" | ||
| 382 | + searchph="请选择车辆类型..." | ||
| 383 | + searchexp="this.name" | ||
| 384 | + > | ||
| 385 | + </sa-Select5> | ||
| 381 | </div> | 386 | </div> |
| 382 | </div> | 387 | </div> |
| 383 | 388 | ||
| 384 | <div class="form-group"> | 389 | <div class="form-group"> |
| 385 | <label class="col-md-2 control-label">是否机动车:</label> | 390 | <label class="col-md-2 control-label">是否机动车:</label> |
| 386 | <div class="col-md-3"> | 391 | <div class="col-md-3"> |
| 387 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 388 | - name="vehicleStats" | ||
| 389 | - placeholder="请选择机动车类型..." | ||
| 390 | - dcvalue="{{ctrl.busInfoForSave.vehicleStats}}" | 392 | + <sa-Select5 name="vehicleStats" |
| 393 | + model="ctrl.busInfoForSave" | ||
| 394 | + cmaps="{'vehicleStats': 'code'}" | ||
| 391 | dcname="vehicleStats" | 395 | dcname="vehicleStats" |
| 392 | icname="code" | 396 | icname="code" |
| 393 | - icnames="name" | ||
| 394 | - datatype="jdcType" > | ||
| 395 | - </sa-Select3> | 397 | + dsparams="{{ {type: 'dic', param: 'jdcType' } | json }}" |
| 398 | + iterobjname="item" | ||
| 399 | + iterobjexp="item.name" | ||
| 400 | + searchph="请选择机动车类型..." | ||
| 401 | + searchexp="this.name" | ||
| 402 | + > | ||
| 403 | + </sa-Select5> | ||
| 396 | </div> | 404 | </div> |
| 397 | </div> | 405 | </div> |
| 398 | 406 | ||
| 399 | <div class="form-group"> | 407 | <div class="form-group"> |
| 400 | <label class="col-md-2 control-label">营运状态:</label> | 408 | <label class="col-md-2 control-label">营运状态:</label> |
| 401 | <div class="col-md-3"> | 409 | <div class="col-md-3"> |
| 402 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 403 | - name="operatorsState" | ||
| 404 | - placeholder="请选择营运状态..." | ||
| 405 | - dcvalue="{{ctrl.busInfoForSave.operatorsState}}" | 410 | + <sa-Select5 name="operatorsState" |
| 411 | + model="ctrl.busInfoForSave" | ||
| 412 | + cmaps="{'operatorsState': 'code'}" | ||
| 406 | dcname="operatorsState" | 413 | dcname="operatorsState" |
| 407 | icname="code" | 414 | icname="code" |
| 408 | - icnames="name" | ||
| 409 | - datatype="yyztType" > | ||
| 410 | - </sa-Select3> | 415 | + dsparams="{{ {type: 'dic', param: 'yyztType' } | json }}" |
| 416 | + iterobjname="item" | ||
| 417 | + iterobjexp="item.name" | ||
| 418 | + searchph="请选择营运状态..." | ||
| 419 | + searchexp="this.name" | ||
| 420 | + > | ||
| 421 | + </sa-Select5> | ||
| 411 | </div> | 422 | </div> |
| 412 | </div> | 423 | </div> |
| 413 | 424 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/form.html
| @@ -66,18 +66,18 @@ | @@ -66,18 +66,18 @@ | ||
| 66 | <div class="form-group has-success has-feedback"> | 66 | <div class="form-group has-success has-feedback"> |
| 67 | <label class="col-md-2 control-label">所属公司*:</label> | 67 | <label class="col-md-2 control-label">所属公司*:</label> |
| 68 | <div class="col-md-3"> | 68 | <div class="col-md-3"> |
| 69 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 70 | - name="gs" | ||
| 71 | - placeholder="请选择所属公司..." | ||
| 72 | - dcvalue="{{ctrl.busInfoForSave.businessCode}}" | 69 | + <sa-Select5 name="gs" |
| 70 | + model="ctrl.busInfoForSave" | ||
| 71 | + cmaps="{'businessCode': 'code', 'company': 'name'}" | ||
| 73 | dcname="businessCode" | 72 | dcname="businessCode" |
| 74 | icname="code" | 73 | icname="code" |
| 75 | - dcname2="company" | ||
| 76 | - icname2="name" | ||
| 77 | - icnames="name" | ||
| 78 | - datatype="gsType" | 74 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 75 | + iterobjname="item" | ||
| 76 | + iterobjexp="item.name" | ||
| 77 | + searchph="请选择所属公司..." | ||
| 78 | + searchexp="this.name" | ||
| 79 | required > | 79 | required > |
| 80 | - </sa-Select3> | 80 | + </sa-Select5> |
| 81 | 81 | ||
| 82 | </div> | 82 | </div> |
| 83 | <!-- 隐藏块,显示验证信息 --> | 83 | <!-- 隐藏块,显示验证信息 --> |
| @@ -143,16 +143,18 @@ | @@ -143,16 +143,18 @@ | ||
| 143 | <div class="form-group has-success has-feedback"> | 143 | <div class="form-group has-success has-feedback"> |
| 144 | <label class="col-md-2 control-label">设备供应厂商*:</label> | 144 | <label class="col-md-2 control-label">设备供应厂商*:</label> |
| 145 | <div class="col-md-3"> | 145 | <div class="col-md-3"> |
| 146 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 147 | - name="supplierName" | ||
| 148 | - placeholder="请选择设备厂商..." | ||
| 149 | - dcvalue="{{ctrl.busInfoForSave.supplierName}}" | 146 | + <sa-Select5 name="supplierName" |
| 147 | + model="ctrl.busInfoForSave" | ||
| 148 | + cmaps="{'supplierName': 'code'}" | ||
| 150 | dcname="supplierName" | 149 | dcname="supplierName" |
| 151 | icname="code" | 150 | icname="code" |
| 152 | - icnames="name" | ||
| 153 | - datatype="snames" | 151 | + dsparams="{{ {type: 'dic', param: 'snames' } | json }}" |
| 152 | + iterobjname="item" | ||
| 153 | + iterobjexp="item.name" | ||
| 154 | + searchph="请选择设备厂商..." | ||
| 155 | + searchexp="this.name" | ||
| 154 | required > | 156 | required > |
| 155 | - </sa-Select3> | 157 | + </sa-Select5> |
| 156 | </div> | 158 | </div> |
| 157 | <!-- 隐藏快,显示验证信息 --> | 159 | <!-- 隐藏快,显示验证信息 --> |
| 158 | <div class="alert alert-danger well-sm" ng-show="myForm.supplierName.$error.required"> | 160 | <div class="alert alert-danger well-sm" ng-show="myForm.supplierName.$error.required"> |
| @@ -369,45 +371,54 @@ | @@ -369,45 +371,54 @@ | ||
| 369 | <div class="form-group"> | 371 | <div class="form-group"> |
| 370 | <label class="col-md-2 control-label">车辆类型:</label> | 372 | <label class="col-md-2 control-label">车辆类型:</label> |
| 371 | <div class="col-md-3"> | 373 | <div class="col-md-3"> |
| 372 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 373 | - name="carType" | ||
| 374 | - placeholder="请选择车辆类型..." | ||
| 375 | - dcvalue="{{ctrl.busInfoForSave.carType}}" | 374 | + <sa-Select5 name="carType" |
| 375 | + model="ctrl.busInfoForSave" | ||
| 376 | + cmaps="{'carType': 'code'}" | ||
| 376 | dcname="carType" | 377 | dcname="carType" |
| 377 | icname="code" | 378 | icname="code" |
| 378 | - icnames="name" | ||
| 379 | - datatype="carType" > | ||
| 380 | - </sa-Select3> | 379 | + dsparams="{{ {type: 'dic', param: 'carType' } | json }}" |
| 380 | + iterobjname="item" | ||
| 381 | + iterobjexp="item.name" | ||
| 382 | + searchph="请选择车辆类型..." | ||
| 383 | + searchexp="this.name" | ||
| 384 | + > | ||
| 385 | + </sa-Select5> | ||
| 381 | </div> | 386 | </div> |
| 382 | </div> | 387 | </div> |
| 383 | 388 | ||
| 384 | <div class="form-group"> | 389 | <div class="form-group"> |
| 385 | <label class="col-md-2 control-label">是否机动车:</label> | 390 | <label class="col-md-2 control-label">是否机动车:</label> |
| 386 | <div class="col-md-3"> | 391 | <div class="col-md-3"> |
| 387 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 388 | - name="vehicleStats" | ||
| 389 | - placeholder="请选择机动车类型..." | ||
| 390 | - dcvalue="{{ctrl.busInfoForSave.vehicleStats}}" | 392 | + <sa-Select5 name="vehicleStats" |
| 393 | + model="ctrl.busInfoForSave" | ||
| 394 | + cmaps="{'vehicleStats': 'code'}" | ||
| 391 | dcname="vehicleStats" | 395 | dcname="vehicleStats" |
| 392 | icname="code" | 396 | icname="code" |
| 393 | - icnames="name" | ||
| 394 | - datatype="jdcType" > | ||
| 395 | - </sa-Select3> | 397 | + dsparams="{{ {type: 'dic', param: 'jdcType' } | json }}" |
| 398 | + iterobjname="item" | ||
| 399 | + iterobjexp="item.name" | ||
| 400 | + searchph="请选择机动车类型..." | ||
| 401 | + searchexp="this.name" | ||
| 402 | + > | ||
| 403 | + </sa-Select5> | ||
| 396 | </div> | 404 | </div> |
| 397 | </div> | 405 | </div> |
| 398 | 406 | ||
| 399 | <div class="form-group"> | 407 | <div class="form-group"> |
| 400 | <label class="col-md-2 control-label">营运状态:</label> | 408 | <label class="col-md-2 control-label">营运状态:</label> |
| 401 | <div class="col-md-3"> | 409 | <div class="col-md-3"> |
| 402 | - <sa-Select3 model="ctrl.busInfoForSave" | ||
| 403 | - name="operatorsState" | ||
| 404 | - placeholder="请选择营运状态..." | ||
| 405 | - dcvalue="{{ctrl.busInfoForSave.operatorsState}}" | 410 | + <sa-Select5 name="operatorsState" |
| 411 | + model="ctrl.busInfoForSave" | ||
| 412 | + cmaps="{'operatorsState': 'code'}" | ||
| 406 | dcname="operatorsState" | 413 | dcname="operatorsState" |
| 407 | icname="code" | 414 | icname="code" |
| 408 | - icnames="name" | ||
| 409 | - datatype="yyztType" > | ||
| 410 | - </sa-Select3> | 415 | + dsparams="{{ {type: 'dic', param: 'yyztType' } | json }}" |
| 416 | + iterobjname="item" | ||
| 417 | + iterobjexp="item.name" | ||
| 418 | + searchph="请选择营运状态..." | ||
| 419 | + searchexp="this.name" | ||
| 420 | + > | ||
| 421 | + </sa-Select5> | ||
| 411 | </div> | 422 | </div> |
| 412 | </div> | 423 | </div> |
| 413 | 424 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/list.html
| @@ -30,15 +30,18 @@ | @@ -30,15 +30,18 @@ | ||
| 30 | </td> | 30 | </td> |
| 31 | <td> | 31 | <td> |
| 32 | <div> | 32 | <div> |
| 33 | - <sa-Select3 model="ctrl.searchCondition()" | ||
| 34 | - name="gs" | ||
| 35 | - placeholder="请选择..." | ||
| 36 | - dcvalue="{{ctrl.searchCondition().businessCode_eq}}" | 33 | + <sa-Select5 name="gs" |
| 34 | + model="ctrl.searchCondition()" | ||
| 35 | + cmaps="{'businessCode_eq': 'code'}" | ||
| 37 | dcname="businessCode_eq" | 36 | dcname="businessCode_eq" |
| 38 | icname="code" | 37 | icname="code" |
| 39 | - icnames="name" | ||
| 40 | - datatype="gsType"> | ||
| 41 | - </sa-Select3> | 38 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 39 | + iterobjname="item" | ||
| 40 | + iterobjexp="item.name" | ||
| 41 | + searchph="选择公司..." | ||
| 42 | + searchexp="this.name" | ||
| 43 | + > | ||
| 44 | + </sa-Select5> | ||
| 42 | </div> | 45 | </div> |
| 43 | </td> | 46 | </td> |
| 44 | <td> | 47 | <td> |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
| @@ -247,9 +247,7 @@ angular.module('ScheduleApp').controller( | @@ -247,9 +247,7 @@ angular.module('ScheduleApp').controller( | ||
| 247 | // 提交方法 | 247 | // 提交方法 |
| 248 | self.submit = function() { | 248 | self.submit = function() { |
| 249 | console.log(self.busInfoForSave); | 249 | console.log(self.busInfoForSave); |
| 250 | - //if (self.busInfoForSave) { | ||
| 251 | - // delete $stateParams.id; | ||
| 252 | - //} | 250 | + // 保存或者更新 |
| 253 | self.busInfoForSave.$save(function() { | 251 | self.busInfoForSave.$save(function() { |
| 254 | $state.go("busInfoManage"); | 252 | $state.go("busInfoManage"); |
| 255 | }); | 253 | }); |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/service.js
| 1 | // 车辆信息service | 1 | // 车辆信息service |
| 2 | -angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) { | ||
| 3 | - return { | ||
| 4 | - rest: $resource( | ||
| 5 | - '/cars_sc/:id', | ||
| 6 | - {order: 'carCode', direction: 'ASC', id: '@id_route'}, | ||
| 7 | - { | ||
| 8 | - list: { | ||
| 9 | - method: 'GET', | ||
| 10 | - params: { | ||
| 11 | - page: 0 | ||
| 12 | - }, | ||
| 13 | - transformResponse: function(rs) { | ||
| 14 | - var dst = angular.fromJson(rs); | ||
| 15 | - if (dst.status == 'SUCCESS') { | ||
| 16 | - return dst.data; | ||
| 17 | - } else { | ||
| 18 | - return dst; // 业务错误留给控制器处理 | 2 | +angular.module('ScheduleApp').factory( |
| 3 | + 'BusInfoManageService_g', | ||
| 4 | + [ | ||
| 5 | + '$resource', | ||
| 6 | + function($resource) { | ||
| 7 | + return { | ||
| 8 | + rest: $resource( | ||
| 9 | + '/cars_sc/:id', | ||
| 10 | + {order: 'carCode', direction: 'ASC', id: '@id'}, | ||
| 11 | + { | ||
| 12 | + list: { | ||
| 13 | + method: 'GET', | ||
| 14 | + params: { | ||
| 15 | + page: 0 | ||
| 16 | + }, | ||
| 17 | + transformResponse: function(rs) { | ||
| 18 | + var dst = angular.fromJson(rs); | ||
| 19 | + if (dst.status == 'SUCCESS') { | ||
| 20 | + return dst.data; | ||
| 21 | + } else { | ||
| 22 | + return dst; // 业务错误留给控制器处理 | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + }, | ||
| 26 | + get: { | ||
| 27 | + method: 'GET', | ||
| 28 | + transformResponse: function(rs) { | ||
| 29 | + var dst = angular.fromJson(rs); | ||
| 30 | + if (dst.status == 'SUCCESS') { | ||
| 31 | + return dst.data; | ||
| 32 | + } else { | ||
| 33 | + return dst; | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + save: { | ||
| 38 | + method: 'POST' | ||
| 19 | } | 39 | } |
| 20 | } | 40 | } |
| 21 | - }, | ||
| 22 | - get: { | ||
| 23 | - method: 'GET', | ||
| 24 | - transformResponse: function(rs) { | ||
| 25 | - var dst = angular.fromJson(rs); | ||
| 26 | - if (dst.status == 'SUCCESS') { | ||
| 27 | - return dst.data; | ||
| 28 | - } else { | ||
| 29 | - return dst; | 41 | + ), |
| 42 | + import: $resource( | ||
| 43 | + '/cars/importfile', | ||
| 44 | + {}, | ||
| 45 | + { | ||
| 46 | + do: { | ||
| 47 | + method: 'POST', | ||
| 48 | + headers: { | ||
| 49 | + 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 50 | + }, | ||
| 51 | + transformRequest: function(obj) { | ||
| 52 | + var str = []; | ||
| 53 | + for (var p in obj) { | ||
| 54 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 55 | + } | ||
| 56 | + return str.join("&"); | ||
| 57 | + } | ||
| 30 | } | 58 | } |
| 31 | } | 59 | } |
| 32 | - }, | ||
| 33 | - save: { | ||
| 34 | - method: 'POST' | ||
| 35 | - } | ||
| 36 | - } | ||
| 37 | - ), | ||
| 38 | - import: $resource( | ||
| 39 | - '/cars/importfile', | ||
| 40 | - {}, | ||
| 41 | - { | ||
| 42 | - do: { | ||
| 43 | - method: 'POST', | ||
| 44 | - headers: { | ||
| 45 | - 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 46 | - }, | ||
| 47 | - transformRequest: function(obj) { | ||
| 48 | - var str = []; | ||
| 49 | - for (var p in obj) { | ||
| 50 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | 60 | + ), |
| 61 | + dataTools: $resource( | ||
| 62 | + '/cars/:type', | ||
| 63 | + {}, | ||
| 64 | + { | ||
| 65 | + dataExport: { | ||
| 66 | + method: 'GET', | ||
| 67 | + responseType: "arraybuffer", | ||
| 68 | + params: { | ||
| 69 | + type: "dataExport" | ||
| 70 | + }, | ||
| 71 | + transformResponse: function(data, headers){ | ||
| 72 | + return {data : data}; | ||
| 73 | + } | ||
| 51 | } | 74 | } |
| 52 | - return str.join("&"); | ||
| 53 | } | 75 | } |
| 54 | - } | ||
| 55 | - } | ||
| 56 | - ), | ||
| 57 | - validate: $resource( | ||
| 58 | - '/cars/validate/:type', | ||
| 59 | - {}, | ||
| 60 | - { | ||
| 61 | - insideCode: { | ||
| 62 | - method: 'GET' | ||
| 63 | - } | ||
| 64 | - } | ||
| 65 | - ), | ||
| 66 | - dataTools: $resource( | ||
| 67 | - '/cars/:type', | ||
| 68 | - {}, | ||
| 69 | - { | ||
| 70 | - dataExport: { | ||
| 71 | - method: 'GET', | ||
| 72 | - responseType: "arraybuffer", | ||
| 73 | - params: { | ||
| 74 | - type: "dataExport" | ||
| 75 | - }, | ||
| 76 | - transformResponse: function(data, headers){ | ||
| 77 | - return {data : data}; | ||
| 78 | - } | ||
| 79 | - } | ||
| 80 | - } | ||
| 81 | - ) | ||
| 82 | - }; | ||
| 83 | -}]); | ||
| 84 | \ No newline at end of file | 76 | \ No newline at end of file |
| 77 | + ) | ||
| 78 | + }; | ||
| 79 | + | ||
| 80 | + } | ||
| 81 | + ] | ||
| 82 | +); | ||
| 85 | \ No newline at end of file | 83 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html
| @@ -147,7 +147,7 @@ | @@ -147,7 +147,7 @@ | ||
| 147 | ng-model="ctrl.deviceInfoForSave.qyrq" readonly | 147 | ng-model="ctrl.deviceInfoForSave.qyrq" readonly |
| 148 | remote-Validation | 148 | remote-Validation |
| 149 | remotevtype="cde1" | 149 | remotevtype="cde1" |
| 150 | - remotevparam="{{ {'qyrq': ctrl.deviceInfoForSave.qyrq, 'xl': ctrl.deviceInfoForSave.xl, 'cl': ctrl.deviceInfoForSave.cl} | json}}"/> | 150 | + remotevparam="{{ {'id_eq': ctrl.deviceInfoForSave.id, 'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}"/> |
| 151 | <span class="input-group-btn"> | 151 | <span class="input-group-btn"> |
| 152 | <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> | 152 | <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> |
| 153 | <i class="glyphicon glyphicon-calendar"></i> | 153 | <i class="glyphicon glyphicon-calendar"></i> |
| @@ -160,7 +160,7 @@ | @@ -160,7 +160,7 @@ | ||
| 160 | 启用日期必须选择 | 160 | 启用日期必须选择 |
| 161 | </div> | 161 | </div> |
| 162 | <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote"> | 162 | <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote"> |
| 163 | - 启用日期必须比历史的启用日期大 | 163 | + {{$remote_msg}} |
| 164 | </div> | 164 | </div> |
| 165 | </div> | 165 | </div> |
| 166 | 166 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html
| @@ -147,7 +147,7 @@ | @@ -147,7 +147,7 @@ | ||
| 147 | ng-model="ctrl.deviceInfoForSave.qyrq" readonly | 147 | ng-model="ctrl.deviceInfoForSave.qyrq" readonly |
| 148 | remote-Validation | 148 | remote-Validation |
| 149 | remotevtype="cde1" | 149 | remotevtype="cde1" |
| 150 | - remotevparam="{{ {'qyrq': ctrl.deviceInfoForSave.qyrq, 'xl': ctrl.deviceInfoForSave.xl, 'cl': ctrl.deviceInfoForSave.cl} | json}}"/> | 150 | + remotevparam="{{ {'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}"/> |
| 151 | <span class="input-group-btn"> | 151 | <span class="input-group-btn"> |
| 152 | <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> | 152 | <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> |
| 153 | <i class="glyphicon glyphicon-calendar"></i> | 153 | <i class="glyphicon glyphicon-calendar"></i> |
| @@ -160,7 +160,7 @@ | @@ -160,7 +160,7 @@ | ||
| 160 | 启用日期必须选择 | 160 | 启用日期必须选择 |
| 161 | </div> | 161 | </div> |
| 162 | <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote"> | 162 | <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote"> |
| 163 | - 启用日期必须比历史的启用日期大 | 163 | + {{$remote_msg}} |
| 164 | </div> | 164 | </div> |
| 165 | </div> | 165 | </div> |
| 166 | 166 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html
| @@ -12,7 +12,8 @@ | @@ -12,7 +12,8 @@ | ||
| 12 | <th>新设备编号</th> | 12 | <th>新设备编号</th> |
| 13 | <th>旧SIM卡</th> | 13 | <th>旧SIM卡</th> |
| 14 | <th>新SIM卡</th> | 14 | <th>新SIM卡</th> |
| 15 | - <th style="width: 180px;">创建时间</th> | 15 | + <th style="width: 180px;">更新时间</th> |
| 16 | + <th style="width: 80px;" >状态</th> | ||
| 16 | <th style="width: 150pt;">操作</th> | 17 | <th style="width: 150pt;">操作</th> |
| 17 | </tr> | 18 | </tr> |
| 18 | <tr role="row" class="filter"> | 19 | <tr role="row" class="filter"> |
| @@ -41,19 +42,24 @@ | @@ -41,19 +42,24 @@ | ||
| 41 | <td></td> | 42 | <td></td> |
| 42 | <td></td> | 43 | <td></td> |
| 43 | <td> | 44 | <td> |
| 45 | + <label class="checkbox-inline input"> | ||
| 46 | + <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']" />已作废 | ||
| 47 | + </label> | ||
| 48 | + </td> | ||
| 49 | + <td> | ||
| 44 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" | 50 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" |
| 45 | - ng-click="ctrl.pageChanaged()"> | 51 | + ng-click="ctrl.doPage()"> |
| 46 | <i class="fa fa-search"></i> 搜索</button> | 52 | <i class="fa fa-search"></i> 搜索</button> |
| 47 | 53 | ||
| 48 | <button class="btn btn-sm red btn-outline filter-cancel" | 54 | <button class="btn btn-sm red btn-outline filter-cancel" |
| 49 | - ng-click="ctrl.resetSearchCondition()"> | 55 | + ng-click="ctrl.reset()"> |
| 50 | <i class="fa fa-times"></i> 重置</button> | 56 | <i class="fa fa-times"></i> 重置</button> |
| 51 | </td> | 57 | </td> |
| 52 | 58 | ||
| 53 | </tr> | 59 | </tr> |
| 54 | </thead> | 60 | </thead> |
| 55 | <tbody> | 61 | <tbody> |
| 56 | - <tr ng-repeat="info in ctrl.pageInfo.infos" ng-class="{odd: true, gradeX: true, danger: info.isCancel}"> | 62 | + <tr ng-repeat="info in ctrl.page()['content']" ng-class="{odd: true, gradeX: true, danger: info.isCancel}"> |
| 57 | <td> | 63 | <td> |
| 58 | <span ng-bind="$index + 1"></span> | 64 | <span ng-bind="$index + 1"></span> |
| 59 | </td> | 65 | </td> |
| @@ -79,15 +85,19 @@ | @@ -79,15 +85,19 @@ | ||
| 79 | <span ng-bind="info.newSimNo"></span> | 85 | <span ng-bind="info.newSimNo"></span> |
| 80 | </td> | 86 | </td> |
| 81 | <td> | 87 | <td> |
| 82 | - <span ng-bind="info.createDate | date:'yyyy-MM-dd HH:mm:ss'"></span> | 88 | + <span ng-bind="info.updateDate | date:'yyyy-MM-dd HH:mm:ss'"></span> |
| 89 | + </td> | ||
| 90 | + <td> | ||
| 91 | + <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span> | ||
| 92 | + <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span> | ||
| 83 | </td> | 93 | </td> |
| 84 | <td> | 94 | <td> |
| 85 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> | 95 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> |
| 86 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | 96 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> |
| 87 | <a ui-sref="deviceInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> | 97 | <a ui-sref="deviceInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> |
| 88 | <a ui-sref="deviceInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> | 98 | <a ui-sref="deviceInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> |
| 89 | - <a ng-click="ctrl.toggleCde(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a> | ||
| 90 | - <a ng-click="ctrl.toggleCde(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> | 99 | + <a ng-click="ctrl.toggleCarDevice(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a> |
| 100 | + <a ng-click="ctrl.toggleCarDevice(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> | ||
| 91 | </td> | 101 | </td> |
| 92 | </tr> | 102 | </tr> |
| 93 | </tbody> | 103 | </tbody> |
| @@ -96,9 +106,9 @@ | @@ -96,9 +106,9 @@ | ||
| 96 | </div> | 106 | </div> |
| 97 | 107 | ||
| 98 | <div style="text-align: right;"> | 108 | <div style="text-align: right;"> |
| 99 | - <uib-pagination total-items="ctrl.pageInfo.totalItems" | ||
| 100 | - ng-model="ctrl.pageInfo.currentPage" | ||
| 101 | - ng-change="ctrl.pageChanaged()" | 109 | + <uib-pagination total-items="ctrl.page()['totalElements']" |
| 110 | + ng-model="ctrl.page()['uiNumber']" | ||
| 111 | + ng-change="ctrl.doPage()" | ||
| 102 | rotate="false" | 112 | rotate="false" |
| 103 | max-size="10" | 113 | max-size="10" |
| 104 | boundary-links="true" | 114 | boundary-links="true" |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js
| 1 | // 设备信息维护 service controller 等写在一起 | 1 | // 设备信息维护 service controller 等写在一起 |
| 2 | 2 | ||
| 3 | -angular.module('ScheduleApp').factory('DeviceInfoManageService', ['DeviceInfoManageService_g', function(service) { | ||
| 4 | - /** 当前的查询条件信息 */ | ||
| 5 | - var currentSearchCondition = {}; | ||
| 6 | - | ||
| 7 | - /** 当前第几页 */ | ||
| 8 | - var currentPageNo = 1; | ||
| 9 | - | ||
| 10 | - return { | ||
| 11 | - /** | ||
| 12 | - * 获取查询条件信息, | ||
| 13 | - * 用于给controller用来和页面数据绑定。 | ||
| 14 | - */ | ||
| 15 | - getSearchCondition: function() { | ||
| 16 | - return currentSearchCondition; | ||
| 17 | - }, | ||
| 18 | - /** | ||
| 19 | - * 重置查询条件信息。 | ||
| 20 | - */ | ||
| 21 | - resetSearchCondition: function() { | ||
| 22 | - var key; | ||
| 23 | - for (key in currentSearchCondition) { | ||
| 24 | - currentSearchCondition[key] = ""; | ||
| 25 | - } | ||
| 26 | - }, | ||
| 27 | - /** | ||
| 28 | - * 设置当前页码。 | ||
| 29 | - * @param cpn 从1开始,后台是从0开始的 | ||
| 30 | - */ | ||
| 31 | - setCurrentPageNo: function(cpn) { | ||
| 32 | - currentPageNo = cpn; | ||
| 33 | - }, | ||
| 34 | - /** | ||
| 35 | - * 组装查询参数,返回一个promise查询结果。 | ||
| 36 | - * @param params 查询参数 | ||
| 37 | - * @return 返回一个 promise | ||
| 38 | - */ | ||
| 39 | - getPage: function() { | ||
| 40 | - var params = currentSearchCondition; // 查询条件 | ||
| 41 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | ||
| 42 | - return service.list(params).$promise; | ||
| 43 | - }, | ||
| 44 | - /** | ||
| 45 | - * 获取明细信息。 | ||
| 46 | - * @param id 车辆id | ||
| 47 | - * @return 返回一个 promise | ||
| 48 | - */ | ||
| 49 | - getDetail: function(id) { | ||
| 50 | - var params = {id: id}; | ||
| 51 | - return service.get(params).$promise; | ||
| 52 | - }, | ||
| 53 | - /** | ||
| 54 | - * 保存信息。 | ||
| 55 | - * @param obj 车辆详细信息 | ||
| 56 | - * @return 返回一个 promise | ||
| 57 | - */ | ||
| 58 | - saveDetail: function(obj) { | ||
| 59 | - return service.save(obj).$promise; | ||
| 60 | - }, | ||
| 61 | - /** | ||
| 62 | - * 删除信息。 | ||
| 63 | - * @param id 主键id | ||
| 64 | - * @returns {*|Function|promise|n} | ||
| 65 | - */ | ||
| 66 | - deleteDetail: function(id) { | ||
| 67 | - return service.delete({id: id}).$promise; | 3 | +angular.module('ScheduleApp').factory( |
| 4 | + 'DeviceInfoManageService', | ||
| 5 | + [ | ||
| 6 | + 'DeviceInfoManageService_g', | ||
| 7 | + function(service) { | ||
| 8 | + /** 当前的查询条件信息 */ | ||
| 9 | + var currentSearchCondition = {'isCancel_eq': false}; | ||
| 10 | + | ||
| 11 | + // 当前查询返回的信息 | ||
| 12 | + var currentPage = { // 后台spring data返回的格式 | ||
| 13 | + totalElements: 0, | ||
| 14 | + number: 0, // 后台返回的页码,spring返回从0开始 | ||
| 15 | + content: [], | ||
| 16 | + | ||
| 17 | + uiNumber: 1 // 页面绑定的页码 | ||
| 18 | + }; | ||
| 19 | + | ||
| 20 | + // 查询对象 | ||
| 21 | + var queryClass = service; | ||
| 22 | + | ||
| 23 | + return { | ||
| 24 | + getQueryClass: function() { | ||
| 25 | + return queryClass; | ||
| 26 | + }, | ||
| 27 | + getSearchCondition: function() { | ||
| 28 | + currentSearchCondition.page = currentPage.uiNumber - 1; | ||
| 29 | + return currentSearchCondition; | ||
| 30 | + }, | ||
| 31 | + getPage: function(page) { | ||
| 32 | + if (page) { | ||
| 33 | + currentPage.totalElements = page.totalElements; | ||
| 34 | + currentPage.number = page.number; | ||
| 35 | + currentPage.content = page.content; | ||
| 36 | + } | ||
| 37 | + return currentPage; | ||
| 38 | + }, | ||
| 39 | + resetStatus: function() { | ||
| 40 | + currentSearchCondition = {page: 0, 'isCancel_eq': false}; | ||
| 41 | + currentPage = { | ||
| 42 | + totalElements: 0, | ||
| 43 | + number: 0, | ||
| 44 | + content: [], | ||
| 45 | + uiNumber: 1 | ||
| 46 | + }; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + }; | ||
| 50 | + | ||
| 68 | } | 51 | } |
| 69 | - }; | ||
| 70 | - | ||
| 71 | -}]); | ||
| 72 | - | ||
| 73 | -angular.module('ScheduleApp').controller('DeviceInfoManageCtrl', ['DeviceInfoManageService', '$state', function(deviceInfoManageService, $state) { | ||
| 74 | - var self = this; | ||
| 75 | - | ||
| 76 | - // 切换到form状态 | ||
| 77 | - self.goForm = function() { | ||
| 78 | - //alert("切换"); | ||
| 79 | - $state.go("deviceInfoManage_form"); | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - | ||
| 83 | -}]); | ||
| 84 | - | ||
| 85 | -angular.module('ScheduleApp').controller('DeviceInfoManageListCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) { | ||
| 86 | - var self = this; | ||
| 87 | - self.pageInfo = { | ||
| 88 | - totalItems : 0, | ||
| 89 | - currentPage : 1, | ||
| 90 | - infos: [] | ||
| 91 | - }; | ||
| 92 | - | ||
| 93 | - // 初始创建的时候,获取一次列表数据 | ||
| 94 | - deviceInfoManageService.getPage().then( | ||
| 95 | - function(result) { | ||
| 96 | - self.pageInfo.totalItems = result.totalElements; | ||
| 97 | - self.pageInfo.currentPage = result.number + 1; | ||
| 98 | - self.pageInfo.infos = result.content; | ||
| 99 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | ||
| 100 | - }, | ||
| 101 | - function(result) { | ||
| 102 | - alert("出错啦!"); | 52 | + ] |
| 53 | +); | ||
| 54 | + | ||
| 55 | +// index.html控制器 | ||
| 56 | +angular.module('ScheduleApp').controller( | ||
| 57 | + 'DeviceInfoManageCtrl', | ||
| 58 | + [ | ||
| 59 | + 'DeviceInfoManageService', | ||
| 60 | + '$state', | ||
| 61 | + function(service, $state) { | ||
| 62 | + var self = this; | ||
| 63 | + | ||
| 64 | + // 切换到form状态 | ||
| 65 | + self.goForm = function() { | ||
| 66 | + //alert("切换"); | ||
| 67 | + $state.go("deviceInfoManage_form"); | ||
| 68 | + }; | ||
| 69 | + | ||
| 103 | } | 70 | } |
| 104 | - ); | ||
| 105 | - | ||
| 106 | - // 翻页的时候调用 | ||
| 107 | - self.pageChanaged = function() { | ||
| 108 | - deviceInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | ||
| 109 | - deviceInfoManageService.getPage().then( | ||
| 110 | - function(result) { | ||
| 111 | - self.pageInfo.totalItems = result.totalElements; | ||
| 112 | - self.pageInfo.currentPage = result.number + 1; | ||
| 113 | - self.pageInfo.infos = result.content; | ||
| 114 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | ||
| 115 | - }, | ||
| 116 | - function(result) { | ||
| 117 | - alert("出错啦!"); | ||
| 118 | - } | ||
| 119 | - ); | ||
| 120 | - }; | ||
| 121 | - // 获取查询条件数据 | ||
| 122 | - self.searchCondition = function() { | ||
| 123 | - return deviceInfoManageService.getSearchCondition(); | ||
| 124 | - }; | ||
| 125 | - // 重置查询条件 | ||
| 126 | - self.resetSearchCondition = function() { | ||
| 127 | - deviceInfoManageService.resetSearchCondition(); | ||
| 128 | - self.pageInfo.currentPage = 1; | ||
| 129 | - self.pageChanaged(); | ||
| 130 | - }; | ||
| 131 | - | ||
| 132 | - // 作废/撤销 | ||
| 133 | - self.toggleCde = function(id) { | ||
| 134 | - // TODO: | ||
| 135 | - deviceInfoManageService.deleteDetail(id).then( | ||
| 136 | - function(result) { | ||
| 137 | - if (result.message) { // 暂时这样做,之后全局拦截 | ||
| 138 | - alert("失败:" + result.message); | ||
| 139 | - } else { | ||
| 140 | - alert("成功!"); | ||
| 141 | - | ||
| 142 | - deviceInfoManageService.getPage().then( | ||
| 143 | - function(result) { | ||
| 144 | - self.pageInfo.totalItems = result.totalElements; | ||
| 145 | - self.pageInfo.currentPage = result.number + 1; | ||
| 146 | - self.pageInfo.infos = result.content; | ||
| 147 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | ||
| 148 | - }, | ||
| 149 | - function(result) { | ||
| 150 | - alert("出错啦!"); | ||
| 151 | - } | ||
| 152 | - ); | ||
| 153 | - } | 71 | + ] |
| 72 | +); | ||
| 73 | + | ||
| 74 | +// list.html控制器 | ||
| 75 | +angular.module('ScheduleApp').controller( | ||
| 76 | + 'DeviceInfoManageListCtrl', | ||
| 77 | + [ | ||
| 78 | + 'DeviceInfoManageService', | ||
| 79 | + function(service) { | ||
| 80 | + var self = this; | ||
| 81 | + var CarDevice = service.getQueryClass(); | ||
| 82 | + | ||
| 83 | + self.page = function() { | ||
| 84 | + return service.getPage(); | ||
| 85 | + }; | ||
| 86 | + | ||
| 87 | + self.searchCondition = function() { | ||
| 88 | + return service.getSearchCondition(); | ||
| 89 | + }; | ||
| 90 | + | ||
| 91 | + self.doPage = function() { | ||
| 92 | + var page = CarDevice.list(self.searchCondition(), function() { | ||
| 93 | + service.getPage(page); | ||
| 94 | + }); | ||
| 95 | + }; | ||
| 96 | + self.reset = function() { | ||
| 97 | + service.resetStatus(); | ||
| 98 | + var page = CarDevice.list(self.searchCondition(), function() { | ||
| 99 | + service.getPage(page); | ||
| 100 | + }); | ||
| 101 | + }; | ||
| 102 | + self.toggleCarDevice = function(id) { | ||
| 103 | + CarDevice.delete({id: id}, function(result) { | ||
| 104 | + if (result.msg) { // 暂时这样做,之后全局拦截 | ||
| 105 | + alert("失败:" + result.msg); | ||
| 106 | + } else { | ||
| 107 | + self.doPage(); | ||
| 108 | + } | ||
| 109 | + }); | ||
| 110 | + }; | ||
| 111 | + | ||
| 112 | + self.doPage(); | ||
| 154 | 113 | ||
| 155 | - }, | ||
| 156 | - function(result) { | ||
| 157 | - alert("出错啦!" + result); | ||
| 158 | - } | ||
| 159 | - ); | ||
| 160 | - }; | ||
| 161 | - | ||
| 162 | -}]); | ||
| 163 | - | ||
| 164 | -angular.module('ScheduleApp').controller('DeviceInfoManageFormCtrl', ['DeviceInfoManageService', '$stateParams', '$state', function(deviceInfoManageService, $stateParams, $state) { | ||
| 165 | - var self = this; | ||
| 166 | - | ||
| 167 | - // 启用日期 日期控件开关 | ||
| 168 | - self.qyrqOpen = false; | ||
| 169 | - self.qyrq_open = function() { | ||
| 170 | - self.qyrqOpen = true; | ||
| 171 | - }; | ||
| 172 | - | ||
| 173 | - // 欲保存的busInfo信息,绑定 | ||
| 174 | - self.deviceInfoForSave = {}; | ||
| 175 | - | ||
| 176 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 177 | - var id = $stateParams.id; | ||
| 178 | - if (id) { | ||
| 179 | - self.deviceInfoForSave.id = id; | ||
| 180 | - deviceInfoManageService.getDetail(id).then( | ||
| 181 | - function(result) { | ||
| 182 | - var key; | ||
| 183 | - for (key in result) { | ||
| 184 | - self.deviceInfoForSave[key] = result[key]; | ||
| 185 | - } | ||
| 186 | - // 填写所有的 select 控件选中框数据 | ||
| 187 | - // 公司字典 | ||
| 188 | - if (self.deviceInfoForSave.gsName) { | ||
| 189 | - angular.forEach(self.gses, function(data) { | ||
| 190 | - if (self.deviceInfoForSave.gsName == data.gsmc) { | ||
| 191 | - self.deviceInfoForSave.gs_selected = data; | ||
| 192 | - } | ||
| 193 | - }); | ||
| 194 | - } | ||
| 195 | - }, | ||
| 196 | - function(result) { | ||
| 197 | - alert("出错啦!"); | 114 | + |
| 115 | + } | ||
| 116 | + ] | ||
| 117 | +); | ||
| 118 | + | ||
| 119 | +// form.html控制器 | ||
| 120 | +angular.module('ScheduleApp').controller( | ||
| 121 | + 'DeviceInfoManageFormCtrl', | ||
| 122 | + [ | ||
| 123 | + 'DeviceInfoManageService', | ||
| 124 | + '$stateParams', | ||
| 125 | + '$state', | ||
| 126 | + function(service, $stateParams, $state) { | ||
| 127 | + var self = this; | ||
| 128 | + var CarDevice = service.getQueryClass(); | ||
| 129 | + | ||
| 130 | + // 启用日期 日期控件开关 | ||
| 131 | + self.qyrqOpen = false; | ||
| 132 | + self.qyrq_open = function() { | ||
| 133 | + self.qyrqOpen = true; | ||
| 134 | + }; | ||
| 135 | + | ||
| 136 | + // 欲保存的busInfo信息,绑定 | ||
| 137 | + self.deviceInfoForSave = new CarDevice; | ||
| 138 | + | ||
| 139 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 140 | + var id = $stateParams.id; | ||
| 141 | + if (id) { | ||
| 142 | + CarDevice.get({id: id}, function(value) { | ||
| 143 | + self.deviceInfoForSave = value; | ||
| 144 | + }); | ||
| 198 | } | 145 | } |
| 199 | - ); | ||
| 200 | - } | ||
| 201 | - | ||
| 202 | - // 提交方法 | ||
| 203 | - self.submit = function() { | ||
| 204 | - console.log(self.deviceInfoForSave); | ||
| 205 | - deviceInfoManageService.saveDetail(self.deviceInfoForSave).then( | ||
| 206 | - function(result) { | ||
| 207 | - // TODO:弹出框方式以后改 | ||
| 208 | - if (result.status == 'SUCCESS') { | ||
| 209 | - alert("保存成功!"); | 146 | + |
| 147 | + // 提交方法 | ||
| 148 | + self.submit = function() { | ||
| 149 | + console.log(self.deviceInfoForSave); | ||
| 150 | + | ||
| 151 | + // 保存或者更新 | ||
| 152 | + self.deviceInfoForSave.$save(function() { | ||
| 210 | $state.go("deviceInfoManage"); | 153 | $state.go("deviceInfoManage"); |
| 211 | - } else { | ||
| 212 | - alert("保存异常!"); | ||
| 213 | - } | ||
| 214 | - }, | ||
| 215 | - function(result) { | ||
| 216 | - // TODO:弹出框方式以后改 | ||
| 217 | - alert("出错啦!"); | ||
| 218 | - } | ||
| 219 | - ); | ||
| 220 | - }; | ||
| 221 | - | ||
| 222 | -}]); | ||
| 223 | - | ||
| 224 | -angular.module('ScheduleApp').controller('DeviceInfoManageDetailCtrl', ['DeviceInfoManageService', '$stateParams', function(deviceInfoManageService, $stateParams) { | ||
| 225 | - var self = this; | ||
| 226 | - self.title = ""; | ||
| 227 | - self.deviceInfoForDetail = {}; | ||
| 228 | - self.deviceInfoForDetail.id = $stateParams.id; | ||
| 229 | - | ||
| 230 | - // 当转向到此页面时,就获取明细信息并绑定 | ||
| 231 | - deviceInfoManageService.getDetail($stateParams.id).then( | ||
| 232 | - function(result) { | ||
| 233 | - var key; | ||
| 234 | - for (key in result) { | ||
| 235 | - self.deviceInfoForDetail[key] = result[key]; | ||
| 236 | - } | 154 | + }); |
| 155 | + }; | ||
| 156 | + | ||
| 157 | + } | ||
| 158 | + ] | ||
| 159 | +); | ||
| 160 | + | ||
| 161 | +// detail.html控制器 | ||
| 162 | +angular.module('ScheduleApp').controller( | ||
| 163 | + 'DeviceInfoManageDetailCtrl', | ||
| 164 | + [ | ||
| 165 | + 'DeviceInfoManageService', | ||
| 166 | + '$stateParams', | ||
| 167 | + function(service, $stateParams) { | ||
| 168 | + var self = this; | ||
| 169 | + var CarDevice = service.getQueryClass(); | ||
| 170 | + var id = $stateParams.id; | ||
| 171 | + | ||
| 172 | + self.title = ""; | ||
| 173 | + self.deviceInfoForDetail = {}; | ||
| 174 | + | ||
| 175 | + // 当转向到此页面时,就获取明细信息并绑定 | ||
| 176 | + CarDevice.get({id: id}, function(value) { | ||
| 177 | + self.deviceInfoForDetail = value; | ||
| 178 | + self.title = "车辆 " + | ||
| 179 | + self.deviceInfoForDetail.clZbh + | ||
| 180 | + "设备信息"; | ||
| 181 | + }); | ||
| 237 | 182 | ||
| 238 | - self.title = "车辆 " + self.deviceInfoForDetail.clZbh + "设备信息"; | ||
| 239 | - }, | ||
| 240 | - function(result) { | ||
| 241 | - // TODO:弹出框方式以后改 | ||
| 242 | - alert("出错啦!"); | ||
| 243 | } | 183 | } |
| 244 | - ); | ||
| 245 | -}]); | ||
| 246 | \ No newline at end of file | 184 | \ No newline at end of file |
| 185 | + ] | ||
| 186 | +); | ||
| 247 | \ No newline at end of file | 187 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/service.js
| 1 | // 车辆设备信息service | 1 | // 车辆设备信息service |
| 2 | angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | 2 | angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { |
| 3 | return $resource( | 3 | return $resource( |
| 4 | - '/cde/:id', | ||
| 5 | - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'}, | 4 | + '/cde_sc/:id', |
| 5 | + {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id'}, | ||
| 6 | { | 6 | { |
| 7 | list: { | 7 | list: { |
| 8 | method: 'GET', | 8 | method: 'GET', |
| 9 | params: { | 9 | params: { |
| 10 | page: 0 | 10 | page: 0 |
| 11 | + }, | ||
| 12 | + transformResponse: function(rs) { | ||
| 13 | + var dst = angular.fromJson(rs); | ||
| 14 | + if (dst.status == 'SUCCESS') { | ||
| 15 | + return dst.data; | ||
| 16 | + } else { | ||
| 17 | + return dst; // 业务错误留给控制器处理 | ||
| 18 | + } | ||
| 11 | } | 19 | } |
| 12 | }, | 20 | }, |
| 13 | get: { | 21 | get: { |
| 14 | - method: 'GET' | 22 | + method: 'GET', |
| 23 | + transformResponse: function(rs) { | ||
| 24 | + var dst = angular.fromJson(rs); | ||
| 25 | + if (dst.status == 'SUCCESS') { | ||
| 26 | + return dst.data; | ||
| 27 | + } else { | ||
| 28 | + return dst; | ||
| 29 | + } | ||
| 30 | + } | ||
| 15 | }, | 31 | }, |
| 16 | save: { | 32 | save: { |
| 17 | method: 'POST' | 33 | method: 'POST' |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html
| @@ -36,18 +36,18 @@ | @@ -36,18 +36,18 @@ | ||
| 36 | <div class="form-group has-success has-feedback"> | 36 | <div class="form-group has-success has-feedback"> |
| 37 | <label class="col-md-2 control-label">所属公司*:</label> | 37 | <label class="col-md-2 control-label">所属公司*:</label> |
| 38 | <div class="col-md-3"> | 38 | <div class="col-md-3"> |
| 39 | - <sa-Select3 model="ctrl.employeeInfoForSave" | ||
| 40 | - name="gs" | ||
| 41 | - placeholder="请选择所属公司..." | ||
| 42 | - dcvalue="{{ctrl.employeeInfoForSave.companyCode}}" | 39 | + <sa-Select5 name="gs" |
| 40 | + model="ctrl.employeeInfoForSave" | ||
| 41 | + cmaps="{'companyCode': 'code', 'company': 'name'}" | ||
| 43 | dcname="companyCode" | 42 | dcname="companyCode" |
| 44 | icname="code" | 43 | icname="code" |
| 45 | - dcname2="company" | ||
| 46 | - icname2="name" | ||
| 47 | - icnames="name" | ||
| 48 | - datatype="gsType" | 44 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 45 | + iterobjname="item" | ||
| 46 | + iterobjexp="item.name" | ||
| 47 | + searchph="请输拼音..." | ||
| 48 | + searchexp="this.name" | ||
| 49 | required > | 49 | required > |
| 50 | - </sa-Select3> | 50 | + </sa-Select5> |
| 51 | </div> | 51 | </div> |
| 52 | <!-- 隐藏块,显示验证信息 --> | 52 | <!-- 隐藏块,显示验证信息 --> |
| 53 | <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> | 53 | <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> |
| @@ -74,15 +74,17 @@ | @@ -74,15 +74,17 @@ | ||
| 74 | <div class="col-md-3"> | 74 | <div class="col-md-3"> |
| 75 | <input type="text" class="form-control" | 75 | <input type="text" class="form-control" |
| 76 | name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCode" | 76 | name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCode" |
| 77 | - remote-Validaton rvtype="jobCode" rv1="{{ctrl.employeeInfoForSave.companyCode}}" | ||
| 78 | - required placeholder="请输入工号"/> | 77 | + required placeholder="请输入工号" |
| 78 | + remote-Validation | ||
| 79 | + remotevtype="ee_gh" | ||
| 80 | + remotevparam="{{ {'id_eq': ctrl.employeeInfoForSave.id, 'companyCode_eq' : ctrl.employeeInfoForSave.companyCode, 'jobCode_eq': ctrl.employeeInfoForSave.jobCode} | json}}"/> | ||
| 79 | </div> | 81 | </div> |
| 80 | <!-- 隐藏块,显示验证信息 --> | 82 | <!-- 隐藏块,显示验证信息 --> |
| 81 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> | 83 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> |
| 82 | 工号必须填写 | 84 | 工号必须填写 |
| 83 | </div> | 85 | </div> |
| 84 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> | 86 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> |
| 85 | - 选择公司并且相同公司工号不能重复 | 87 | + {{$remote_msg}} |
| 86 | </div> | 88 | </div> |
| 87 | </div> | 89 | </div> |
| 88 | 90 | ||
| @@ -125,15 +127,18 @@ | @@ -125,15 +127,18 @@ | ||
| 125 | <div class="form-group"> | 127 | <div class="form-group"> |
| 126 | <label class="col-md-2 control-label">工种:</label> | 128 | <label class="col-md-2 control-label">工种:</label> |
| 127 | <div class="col-md-4"> | 129 | <div class="col-md-4"> |
| 128 | - <sa-Select3 model="ctrl.employeeInfoForSave" | ||
| 129 | - name="posts" | ||
| 130 | - placeholder="请选择工种..." | ||
| 131 | - dcvalue="{{ctrl.employeeInfoForSave.posts}}" | 130 | + <sa-Select5 name="posts" |
| 131 | + model="ctrl.employeeInfoForSave" | ||
| 132 | + cmaps="{'posts': 'code'}" | ||
| 132 | dcname="posts" | 133 | dcname="posts" |
| 133 | icname="code" | 134 | icname="code" |
| 134 | - icnames="name" | ||
| 135 | - datatype="gzType"> | ||
| 136 | - </sa-Select3> | 135 | + dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" |
| 136 | + iterobjname="item" | ||
| 137 | + iterobjexp="item.name" | ||
| 138 | + searchph="请输拼音..." | ||
| 139 | + searchexp="this.name" | ||
| 140 | + > | ||
| 141 | + </sa-Select5> | ||
| 137 | </div> | 142 | </div> |
| 138 | </div> | 143 | </div> |
| 139 | 144 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html
| @@ -36,18 +36,18 @@ | @@ -36,18 +36,18 @@ | ||
| 36 | <div class="form-group has-success has-feedback"> | 36 | <div class="form-group has-success has-feedback"> |
| 37 | <label class="col-md-2 control-label">所属公司*:</label> | 37 | <label class="col-md-2 control-label">所属公司*:</label> |
| 38 | <div class="col-md-3"> | 38 | <div class="col-md-3"> |
| 39 | - <sa-Select3 model="ctrl.employeeInfoForSave" | ||
| 40 | - name="gs" | ||
| 41 | - placeholder="请选择所属公司..." | ||
| 42 | - dcvalue="{{ctrl.employeeInfoForSave.companyCode}}" | 39 | + <sa-Select5 name="gs" |
| 40 | + model="ctrl.employeeInfoForSave" | ||
| 41 | + cmaps="{'companyCode': 'code', 'company': 'name'}" | ||
| 43 | dcname="companyCode" | 42 | dcname="companyCode" |
| 44 | icname="code" | 43 | icname="code" |
| 45 | - dcname2="company" | ||
| 46 | - icname2="name" | ||
| 47 | - icnames="name" | ||
| 48 | - datatype="gsType" | 44 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 45 | + iterobjname="item" | ||
| 46 | + iterobjexp="item.name" | ||
| 47 | + searchph="请输拼音..." | ||
| 48 | + searchexp="this.name" | ||
| 49 | required > | 49 | required > |
| 50 | - </sa-Select3> | 50 | + </sa-Select5> |
| 51 | </div> | 51 | </div> |
| 52 | <!-- 隐藏块,显示验证信息 --> | 52 | <!-- 隐藏块,显示验证信息 --> |
| 53 | <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> | 53 | <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> |
| @@ -74,15 +74,17 @@ | @@ -74,15 +74,17 @@ | ||
| 74 | <div class="col-md-3"> | 74 | <div class="col-md-3"> |
| 75 | <input type="text" class="form-control" | 75 | <input type="text" class="form-control" |
| 76 | name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCode" | 76 | name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCode" |
| 77 | - remote-Validaton rvtype="jobCode" rv1="{{ctrl.employeeInfoForSave.companyCode}}" | ||
| 78 | - required placeholder="请输入工号"/> | 77 | + required placeholder="请输入工号" |
| 78 | + remote-Validation | ||
| 79 | + remotevtype="ee_gh" | ||
| 80 | + remotevparam="{{ {'companyCode_eq' : ctrl.employeeInfoForSave.companyCode, 'jobCode_eq': ctrl.employeeInfoForSave.jobCode} | json}}"/> | ||
| 79 | </div> | 81 | </div> |
| 80 | <!-- 隐藏块,显示验证信息 --> | 82 | <!-- 隐藏块,显示验证信息 --> |
| 81 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> | 83 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> |
| 82 | 工号必须填写 | 84 | 工号必须填写 |
| 83 | </div> | 85 | </div> |
| 84 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> | 86 | <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> |
| 85 | - 选择公司并且相同公司工号不能重复 | 87 | + {{$remote_msg}} |
| 86 | </div> | 88 | </div> |
| 87 | </div> | 89 | </div> |
| 88 | 90 | ||
| @@ -125,15 +127,18 @@ | @@ -125,15 +127,18 @@ | ||
| 125 | <div class="form-group"> | 127 | <div class="form-group"> |
| 126 | <label class="col-md-2 control-label">工种:</label> | 128 | <label class="col-md-2 control-label">工种:</label> |
| 127 | <div class="col-md-4"> | 129 | <div class="col-md-4"> |
| 128 | - <sa-Select3 model="ctrl.employeeInfoForSave" | ||
| 129 | - name="posts" | ||
| 130 | - placeholder="请选择工种..." | ||
| 131 | - dcvalue="{{ctrl.employeeInfoForSave.posts}}" | 130 | + <sa-Select5 name="posts" |
| 131 | + model="ctrl.employeeInfoForSave" | ||
| 132 | + cmaps="{'posts': 'code'}" | ||
| 132 | dcname="posts" | 133 | dcname="posts" |
| 133 | icname="code" | 134 | icname="code" |
| 134 | - icnames="name" | ||
| 135 | - datatype="gzType"> | ||
| 136 | - </sa-Select3> | 135 | + dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" |
| 136 | + iterobjname="item" | ||
| 137 | + iterobjexp="item.name" | ||
| 138 | + searchph="请输拼音..." | ||
| 139 | + searchexp="this.name" | ||
| 140 | + > | ||
| 141 | + </sa-Select5> | ||
| 137 | </div> | 142 | </div> |
| 138 | </div> | 143 | </div> |
| 139 | 144 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html
| @@ -26,41 +26,46 @@ | @@ -26,41 +26,46 @@ | ||
| 26 | </td> | 26 | </td> |
| 27 | <td> | 27 | <td> |
| 28 | <div> | 28 | <div> |
| 29 | - <sa-Select3 model="ctrl.searchCondition()" | ||
| 30 | - name="gs" | ||
| 31 | - placeholder="请选择..." | ||
| 32 | - dcvalue="{{ctrl.searchCondition().companyCode_eq}}" | 29 | + <sa-Select5 name="gs" |
| 30 | + model="ctrl.searchCondition()" | ||
| 31 | + cmaps="{'companyCode_eq': 'code'}" | ||
| 33 | dcname="companyCode_eq" | 32 | dcname="companyCode_eq" |
| 34 | icname="code" | 33 | icname="code" |
| 35 | - icnames="name" | ||
| 36 | - datatype="gsType"> | ||
| 37 | - </sa-Select3> | 34 | + dsparams="{{ {type: 'dic', param: 'gsType' } | json }}" |
| 35 | + iterobjname="item" | ||
| 36 | + iterobjexp="item.name" | ||
| 37 | + searchph="请输拼音..." | ||
| 38 | + searchexp="this.name" | ||
| 39 | + > | ||
| 40 | + </sa-Select5> | ||
| 38 | </div> | 41 | </div> |
| 39 | </td> | 42 | </td> |
| 40 | - <td style="width: 100px"> | ||
| 41 | - | 43 | + <td> |
| 42 | </td> | 44 | </td> |
| 43 | <td> | 45 | <td> |
| 44 | <div> | 46 | <div> |
| 45 | - <sa-Select3 model="ctrl.searchCondition()" | ||
| 46 | - name="gs" | ||
| 47 | - placeholder="请选择..." | ||
| 48 | - dcvalue="{{ctrl.searchCondition().posts_eq}}" | 47 | + <sa-Select5 name="gz" |
| 48 | + model="ctrl.searchCondition()" | ||
| 49 | + cmaps="{'posts_eq': 'code'}" | ||
| 49 | dcname="posts_eq" | 50 | dcname="posts_eq" |
| 50 | icname="code" | 51 | icname="code" |
| 51 | - icnames="name" | ||
| 52 | - datatype="gzType"> | ||
| 53 | - </sa-Select3> | 52 | + dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" |
| 53 | + iterobjname="item" | ||
| 54 | + iterobjexp="item.name" | ||
| 55 | + searchph="请输拼音..." | ||
| 56 | + searchexp="this.name" | ||
| 57 | + > | ||
| 58 | + </sa-Select5> | ||
| 54 | </div> | 59 | </div> |
| 55 | </td> | 60 | </td> |
| 56 | <td> | 61 | <td> |
| 57 | <div> | 62 | <div> |
| 58 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" | 63 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" |
| 59 | - ng-click="ctrl.pageChanaged()"> | 64 | + ng-click="ctrl.doPage()"> |
| 60 | <i class="fa fa-search"></i> 搜索</button> | 65 | <i class="fa fa-search"></i> 搜索</button> |
| 61 | 66 | ||
| 62 | <button class="btn btn-sm red btn-outline filter-cancel" | 67 | <button class="btn btn-sm red btn-outline filter-cancel" |
| 63 | - ng-click="ctrl.resetSearchCondition()"> | 68 | + ng-click="ctrl.reset()"> |
| 64 | <i class="fa fa-times"></i> 重置</button> | 69 | <i class="fa fa-times"></i> 重置</button> |
| 65 | </div> | 70 | </div> |
| 66 | 71 | ||
| @@ -69,7 +74,7 @@ | @@ -69,7 +74,7 @@ | ||
| 69 | </tr> | 74 | </tr> |
| 70 | </thead> | 75 | </thead> |
| 71 | <tbody> | 76 | <tbody> |
| 72 | - <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> | 77 | + <tr ng-repeat="info in ctrl.page()['content']" class="odd gradeX"> |
| 73 | <td> | 78 | <td> |
| 74 | <span ng-bind="$index + 1"></span> | 79 | <span ng-bind="$index + 1"></span> |
| 75 | </td> | 80 | </td> |
| @@ -104,9 +109,9 @@ | @@ -104,9 +109,9 @@ | ||
| 104 | 109 | ||
| 105 | 110 | ||
| 106 | <div style="text-align: right;"> | 111 | <div style="text-align: right;"> |
| 107 | - <uib-pagination total-items="ctrl.pageInfo.totalItems" | ||
| 108 | - ng-model="ctrl.pageInfo.currentPage" | ||
| 109 | - ng-change="ctrl.pageChanaged()" | 112 | + <uib-pagination total-items="ctrl.page()['totalElements']" |
| 113 | + ng-model="ctrl.page()['uiNumber']" | ||
| 114 | + ng-change="ctrl.doPage()" | ||
| 110 | rotate="false" | 115 | rotate="false" |
| 111 | max-size="10" | 116 | max-size="10" |
| 112 | boundary-links="true" | 117 | boundary-links="true" |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js
| 1 | // 人员信息管理 service controller等写在一起 | 1 | // 人员信息管理 service controller等写在一起 |
| 2 | 2 | ||
| 3 | -angular.module('ScheduleApp').factory('EmployeeInfoManageService', ['EmployeeInfoManageService_g', function(service) { | ||
| 4 | - | ||
| 5 | - /** 当前的查询条件信息 */ | ||
| 6 | - var currentSearchCondition = { | ||
| 7 | - //"carCode_like" : "", | ||
| 8 | - //"insideCode_like" : "", | ||
| 9 | - //"equipmentCode_like" : "", | ||
| 10 | - //"carPlate_like" : "" | ||
| 11 | - }; | 3 | +angular.module('ScheduleApp').factory( |
| 4 | + 'EmployeeInfoManageService', | ||
| 5 | + [ | ||
| 6 | + 'EmployeeInfoManageService_g', | ||
| 7 | + function(service) { | ||
| 12 | 8 | ||
| 13 | - /** 当前第几页 */ | ||
| 14 | - var currentPageNo = 1; | ||
| 15 | - | ||
| 16 | - return { | ||
| 17 | - /** | ||
| 18 | - * 获取查询条件信息, | ||
| 19 | - * 用于给controller用来和页面数据绑定。 | ||
| 20 | - */ | ||
| 21 | - getSearchCondition: function() { | ||
| 22 | - return currentSearchCondition; | ||
| 23 | - }, | ||
| 24 | - /** | ||
| 25 | - * 重置查询条件信息。 | ||
| 26 | - */ | ||
| 27 | - resetSearchCondition: function() { | ||
| 28 | - var key; | ||
| 29 | - for (key in currentSearchCondition) { | ||
| 30 | - currentSearchCondition[key] = undefined; | ||
| 31 | - } | ||
| 32 | - currentPageNo = 1; | ||
| 33 | - }, | ||
| 34 | - /** | ||
| 35 | - * 设置当前页码。 | ||
| 36 | - * @param cpn 从1开始,后台是从0开始的 | ||
| 37 | - */ | ||
| 38 | - setCurrentPageNo: function(cpn) { | ||
| 39 | - currentPageNo = cpn; | ||
| 40 | - }, | ||
| 41 | - /** | ||
| 42 | - * 组装查询参数,返回一个promise查询结果。 | ||
| 43 | - * @param params 查询参数 | ||
| 44 | - * @return 返回一个 promise | ||
| 45 | - */ | ||
| 46 | - getPage: function() { | ||
| 47 | - var params = currentSearchCondition; // 查询条件 | ||
| 48 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | ||
| 49 | - return service.rest.list(params).$promise; | ||
| 50 | - }, | ||
| 51 | - /** | ||
| 52 | - * 获取明细信息。 | ||
| 53 | - * @param id 车辆id | ||
| 54 | - * @return 返回一个 promise | ||
| 55 | - */ | ||
| 56 | - getDetail: function(id) { | ||
| 57 | - var params = {id: id}; | ||
| 58 | - return service.rest.get(params).$promise; | ||
| 59 | - }, | ||
| 60 | - /** | ||
| 61 | - * 保存信息。 | ||
| 62 | - * @param obj 车辆详细信息 | ||
| 63 | - * @return 返回一个 promise | ||
| 64 | - */ | ||
| 65 | - saveDetail: function(obj) { | ||
| 66 | - return service.rest.save(obj).$promise; | ||
| 67 | - }, | ||
| 68 | - /** | ||
| 69 | - * 数据导出。 | ||
| 70 | - * @returns {*|Function|promise|n} | ||
| 71 | - */ | ||
| 72 | - dataExport: function() { | ||
| 73 | - return service.dataTools.dataExport().$promise; | ||
| 74 | - } | ||
| 75 | - } | 9 | + /** 当前的查询条件信息 */ |
| 10 | + var currentSearchCondition = { | ||
| 11 | + //"carCode_like" : "", | ||
| 12 | + //"insideCode_like" : "", | ||
| 13 | + //"equipmentCode_like" : "", | ||
| 14 | + //"carPlate_like" : "" | ||
| 15 | + }; | ||
| 76 | 16 | ||
| 77 | -}]); | 17 | + // 当前查询返回的信息 |
| 18 | + var currentPage = { // 后台spring data返回的格式 | ||
| 19 | + totalElements: 0, | ||
| 20 | + number: 0, // 后台返回的页码,spring返回从0开始 | ||
| 21 | + content: [], | ||
| 78 | 22 | ||
| 79 | -angular.module('ScheduleApp').controller('EmployeeInfoManageCtrl', [ | ||
| 80 | - 'EmployeeInfoManageService', '$state', '$uibModal', 'FileDownload_g', | ||
| 81 | - function(employeeInfoManageService, $state, $uibModal, fileDownload) { | ||
| 82 | - var self = this; | 23 | + uiNumber: 1 // 页面绑定的页码 |
| 24 | + }; | ||
| 83 | 25 | ||
| 84 | - // 切换到form状态 | ||
| 85 | - self.goForm = function() { | ||
| 86 | - //alert("切换"); | ||
| 87 | - $state.go("employeeInfoManage_form"); | ||
| 88 | - } | 26 | + // 查询对象 |
| 27 | + var queryClass = service.rest; | ||
| 89 | 28 | ||
| 90 | - // 导入excel | ||
| 91 | - self.importData = function() { | ||
| 92 | - // large方式弹出模态对话框 | ||
| 93 | - var modalInstance = $uibModal.open({ | ||
| 94 | - templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/dataImport.html', | ||
| 95 | - size: "lg", | ||
| 96 | - animation: true, | ||
| 97 | - backdrop: 'static', | ||
| 98 | - resolve: { | ||
| 99 | - // 可以传值给controller | 29 | + return { |
| 30 | + getQueryClass: function() { | ||
| 31 | + return queryClass; | ||
| 100 | }, | 32 | }, |
| 101 | - windowClass: 'center-modal', | ||
| 102 | - controller: "EmployInfoManageToolsCtrl", | ||
| 103 | - controllerAs: "ctrl", | ||
| 104 | - bindToController: true | ||
| 105 | - }); | ||
| 106 | - modalInstance.result.then( | ||
| 107 | - function() { | ||
| 108 | - console.log("dataImport.html打开"); | 33 | + /** |
| 34 | + * 获取查询条件信息, | ||
| 35 | + * 用于给controller用来和页面数据绑定。 | ||
| 36 | + */ | ||
| 37 | + getSearchCondition: function() { | ||
| 38 | + currentSearchCondition.page = currentPage.uiNumber - 1; | ||
| 39 | + return currentSearchCondition; | ||
| 109 | }, | 40 | }, |
| 110 | - function() { | ||
| 111 | - console.log("dataImport.html消失"); | ||
| 112 | - } | ||
| 113 | - ); | ||
| 114 | - }; | ||
| 115 | - | ||
| 116 | - // 导出excel | ||
| 117 | - self.exportData = function() { | ||
| 118 | - employeeInfoManageService.dataExport().then( | ||
| 119 | - function(result) { | ||
| 120 | - fileDownload.downloadFile(result.data, "application/octet-stream", "人员基础信息.xls"); | 41 | + /** |
| 42 | + * 组装查询参数,返回一个promise查询结果。 | ||
| 43 | + * @param params 查询参数 | ||
| 44 | + * @return 返回一个 promise | ||
| 45 | + */ | ||
| 46 | + getPage: function(page) { | ||
| 47 | + if (page) { | ||
| 48 | + currentPage.totalElements = page.totalElements; | ||
| 49 | + currentPage.number = page.number; | ||
| 50 | + currentPage.content = page.content; | ||
| 51 | + } | ||
| 52 | + return currentPage; | ||
| 53 | + }, | ||
| 54 | + resetStatus: function() { | ||
| 55 | + currentSearchCondition = {page: 0}; | ||
| 56 | + currentPage = { | ||
| 57 | + totalElements: 0, | ||
| 58 | + number: 0, | ||
| 59 | + content: [], | ||
| 60 | + uiNumber: 1 | ||
| 61 | + }; | ||
| 121 | }, | 62 | }, |
| 122 | - function(result) { | ||
| 123 | - console.log("exportData failed:" + result); | 63 | + |
| 64 | + /** | ||
| 65 | + * 数据导出。 | ||
| 66 | + * @returns {*|Function|promise|n} | ||
| 67 | + */ | ||
| 68 | + dataExport: function() { | ||
| 69 | + return service.dataTools.dataExport().$promise; | ||
| 124 | } | 70 | } |
| 125 | - ); | ||
| 126 | - }; | ||
| 127 | - }]); | 71 | + } |
| 72 | + } | ||
| 73 | + ] | ||
| 74 | +); | ||
| 75 | + | ||
| 76 | +// index.html控制器 | ||
| 77 | +angular.module('ScheduleApp').controller( | ||
| 78 | + 'EmployeeInfoManageCtrl', | ||
| 79 | + [ | ||
| 80 | + 'EmployeeInfoManageService', | ||
| 81 | + '$state', | ||
| 82 | + '$uibModal', | ||
| 83 | + 'FileDownload_g', | ||
| 84 | + function(employeeInfoManageService, $state, $uibModal, fileDownload) { | ||
| 85 | + var self = this; | ||
| 86 | + | ||
| 87 | + // 切换到form状态 | ||
| 88 | + self.goForm = function() { | ||
| 89 | + //alert("切换"); | ||
| 90 | + $state.go("employeeInfoManage_form"); | ||
| 91 | + }; | ||
| 92 | + | ||
| 93 | + // 导入excel | ||
| 94 | + self.importData = function() { | ||
| 95 | + // large方式弹出模态对话框 | ||
| 96 | + var modalInstance = $uibModal.open({ | ||
| 97 | + templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/dataImport.html', | ||
| 98 | + size: "lg", | ||
| 99 | + animation: true, | ||
| 100 | + backdrop: 'static', | ||
| 101 | + resolve: { | ||
| 102 | + // 可以传值给controller | ||
| 103 | + }, | ||
| 104 | + windowClass: 'center-modal', | ||
| 105 | + controller: "EmployInfoManageToolsCtrl", | ||
| 106 | + controllerAs: "ctrl", | ||
| 107 | + bindToController: true | ||
| 108 | + }); | ||
| 109 | + modalInstance.result.then( | ||
| 110 | + function() { | ||
| 111 | + console.log("dataImport.html打开"); | ||
| 112 | + }, | ||
| 113 | + function() { | ||
| 114 | + console.log("dataImport.html消失"); | ||
| 115 | + } | ||
| 116 | + ); | ||
| 117 | + }; | ||
| 118 | + | ||
| 119 | + // 导出excel | ||
| 120 | + self.exportData = function() { | ||
| 121 | + employeeInfoManageService.dataExport().then( | ||
| 122 | + function(result) { | ||
| 123 | + fileDownload.downloadFile(result.data, "application/octet-stream", "人员基础信息.xls"); | ||
| 124 | + }, | ||
| 125 | + function(result) { | ||
| 126 | + console.log("exportData failed:" + result); | ||
| 127 | + } | ||
| 128 | + ); | ||
| 129 | + }; | ||
| 130 | + | ||
| 131 | + } | ||
| 132 | + ] | ||
| 133 | +); | ||
| 128 | 134 | ||
| 129 | angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | 135 | angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { |
| 130 | var self = this; | 136 | var self = this; |
| @@ -161,124 +167,101 @@ angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalIn | @@ -161,124 +167,101 @@ angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalIn | ||
| 161 | 167 | ||
| 162 | }]); | 168 | }]); |
| 163 | 169 | ||
| 164 | -angular.module('ScheduleApp').controller('EmployeeInfoManageListCtrl', ['EmployeeInfoManageService', function(employeeInfoManageService) { | ||
| 165 | - var self = this; | ||
| 166 | - self.pageInfo = { | ||
| 167 | - totalItems : 0, | ||
| 168 | - currentPage : 1, | ||
| 169 | - infos: [] | ||
| 170 | - }; | 170 | +// list.html控制器 |
| 171 | +angular.module('ScheduleApp').controller( | ||
| 172 | + 'EmployeeInfoManageListCtrl', | ||
| 173 | + [ | ||
| 174 | + 'EmployeeInfoManageService', | ||
| 175 | + function(service) { | ||
| 176 | + var self = this; | ||
| 177 | + var Employee = service.getQueryClass(); | ||
| 178 | + | ||
| 179 | + self.page = function() { | ||
| 180 | + return service.getPage(); | ||
| 181 | + }; | ||
| 182 | + | ||
| 183 | + self.searchCondition = function() { | ||
| 184 | + return service.getSearchCondition(); | ||
| 185 | + }; | ||
| 186 | + | ||
| 187 | + self.doPage = function() { | ||
| 188 | + var result = Employee.list(self.searchCondition(), function() { | ||
| 189 | + if (!result.status) { | ||
| 190 | + service.getPage(result); | ||
| 191 | + } | ||
| 192 | + }); | ||
| 193 | + }; | ||
| 194 | + self.reset = function() { | ||
| 195 | + service.resetStatus(); | ||
| 196 | + var result = Employee.list(self.searchCondition(), function() { | ||
| 197 | + if (!result.status) { | ||
| 198 | + service.getPage(result); | ||
| 199 | + } | ||
| 200 | + }); | ||
| 201 | + }; | ||
| 202 | + | ||
| 203 | + self.doPage(); | ||
| 171 | 204 | ||
| 172 | - // 初始创建的时候,获取一次列表数据 | ||
| 173 | - employeeInfoManageService.getPage().then( | ||
| 174 | - function(result) { | ||
| 175 | - self.pageInfo.totalItems = result.totalElements; | ||
| 176 | - self.pageInfo.currentPage = result.number + 1; | ||
| 177 | - self.pageInfo.infos = result.content; | ||
| 178 | - employeeInfoManageService.setCurrentPageNo(result.number + 1); | ||
| 179 | - }, | ||
| 180 | - function(result) { | ||
| 181 | - alert("出错啦!"); | ||
| 182 | } | 205 | } |
| 183 | - ); | ||
| 184 | - | ||
| 185 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | ||
| 186 | - // alert("dfdfdf"); | ||
| 187 | - //}); | ||
| 188 | - | ||
| 189 | - // 翻页的时候调用 | ||
| 190 | - self.pageChanaged = function() { | ||
| 191 | - employeeInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | ||
| 192 | - employeeInfoManageService.getPage().then( | ||
| 193 | - function(result) { | ||
| 194 | - self.pageInfo.totalItems = result.totalElements; | ||
| 195 | - self.pageInfo.currentPage = result.number + 1; | ||
| 196 | - self.pageInfo.infos = result.content; | ||
| 197 | - employeeInfoManageService.setCurrentPageNo(result.number + 1); | ||
| 198 | - }, | ||
| 199 | - function(result) { | ||
| 200 | - alert("出错啦!"); | ||
| 201 | - } | ||
| 202 | - ); | ||
| 203 | - }; | ||
| 204 | - // 获取查询条件数据 | ||
| 205 | - self.searchCondition = function() { | ||
| 206 | - return employeeInfoManageService.getSearchCondition(); | ||
| 207 | - }; | ||
| 208 | - // 重置查询条件 | ||
| 209 | - self.resetSearchCondition = function() { | ||
| 210 | - employeeInfoManageService.resetSearchCondition(); | ||
| 211 | - self.pageInfo.currentPage = 1; | ||
| 212 | - self.pageChanaged(); | ||
| 213 | - }; | ||
| 214 | -}]); | 206 | + ] |
| 207 | +); | ||
| 215 | 208 | ||
| 216 | -angular.module('ScheduleApp').controller('EmployeeInfoManageFormCtrl', ['EmployeeInfoManageService', '$stateParams', '$state', function(employeeInfoManageService, $stateParams, $state) { | ||
| 217 | - var self = this; | 209 | +// form.html控制器 |
| 210 | +angular.module('ScheduleApp').controller( | ||
| 211 | + 'EmployeeInfoManageFormCtrl', | ||
| 212 | + [ | ||
| 213 | + 'EmployeeInfoManageService', | ||
| 214 | + '$stateParams', | ||
| 215 | + '$state', | ||
| 216 | + function(service, $stateParams, $state) { | ||
| 217 | + var self = this; | ||
| 218 | + var Employee = service.getQueryClass(); | ||
| 218 | 219 | ||
| 219 | - // 欲保存的busInfo信息,绑定 | ||
| 220 | - self.employeeInfoForSave = {}; | ||
| 221 | - | ||
| 222 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 223 | - var id = $stateParams.id; | ||
| 224 | - if (id) { | ||
| 225 | - self.employeeInfoForSave.id = id; | ||
| 226 | - employeeInfoManageService.getDetail(id).then( | ||
| 227 | - function(result) { | ||
| 228 | - var key; | ||
| 229 | - for (key in result) { | ||
| 230 | - self.employeeInfoForSave[key] = result[key]; | ||
| 231 | - } | ||
| 232 | - }, | ||
| 233 | - function(result) { | ||
| 234 | - alert("出错啦!"); | 220 | + // 欲保存的busInfo信息,绑定 |
| 221 | + self.employeeInfoForSave = new Employee; | ||
| 222 | + | ||
| 223 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 224 | + var id = $stateParams.id; | ||
| 225 | + if (id) { | ||
| 226 | + self.employeeInfoForSave = Employee.get({id: id}, function() {}); | ||
| 235 | } | 227 | } |
| 236 | - ); | ||
| 237 | - } | ||
| 238 | - | ||
| 239 | - // 提交方法 | ||
| 240 | - self.submit = function() { | ||
| 241 | - console.log(self.employeeInfoForSave); | ||
| 242 | - employeeInfoManageService.saveDetail(self.employeeInfoForSave).then( | ||
| 243 | - function(result) { | ||
| 244 | - // TODO:弹出框方式以后改 | ||
| 245 | - if (result.status == 'SUCCESS') { | ||
| 246 | - alert("保存成功!"); | 228 | + |
| 229 | + // 提交方法 | ||
| 230 | + self.submit = function() { | ||
| 231 | + console.log(self.employeeInfoForSave); | ||
| 232 | + | ||
| 233 | + // 保存或更新 | ||
| 234 | + self.employeeInfoForSave.$save(function() { | ||
| 247 | $state.go("employeeInfoManage"); | 235 | $state.go("employeeInfoManage"); |
| 248 | - } else { | ||
| 249 | - alert("保存异常!"); | ||
| 250 | - } | ||
| 251 | - }, | ||
| 252 | - function(result) { | ||
| 253 | - // TODO:弹出框方式以后改 | ||
| 254 | - alert("出错啦!"); | ||
| 255 | - } | ||
| 256 | - ); | ||
| 257 | - }; | 236 | + }); |
| 237 | + }; | ||
| 258 | 238 | ||
| 239 | + } | ||
| 240 | + ] | ||
| 241 | +); | ||
| 259 | 242 | ||
| 260 | -}]); | 243 | +// detail.html控制器 |
| 244 | +angular.module('ScheduleApp').controller( | ||
| 245 | + 'EmployeeInfoManageDetailCtrl', | ||
| 246 | + [ | ||
| 247 | + 'EmployeeInfoManageService', | ||
| 248 | + '$stateParams', | ||
| 249 | + function(service, $stateParams) { | ||
| 250 | + var self = this; | ||
| 251 | + var Employee = service.getQueryClass(); | ||
| 252 | + var id = $stateParams.id; | ||
| 261 | 253 | ||
| 262 | -angular.module('ScheduleApp').controller('EmployeeInfoManageDetailCtrl', ['EmployeeInfoManageService', '$stateParams', function(employeeInfoManageService, $stateParams) { | ||
| 263 | - var self = this; | ||
| 264 | - self.title = ""; | ||
| 265 | - self.employeeInfoForDetail = {}; | ||
| 266 | - self.employeeInfoForDetail.id = $stateParams.id; | ||
| 267 | - | ||
| 268 | - // 当转向到此页面时,就获取明细信息并绑定 | ||
| 269 | - employeeInfoManageService.getDetail($stateParams.id).then( | ||
| 270 | - function(result) { | ||
| 271 | - var key; | ||
| 272 | - for (key in result) { | ||
| 273 | - self.employeeInfoForDetail[key] = result[key]; | ||
| 274 | - } | 254 | + self.title = ""; |
| 255 | + self.employeeInfoForDetail = {}; | ||
| 256 | + | ||
| 257 | + // 当转向到此页面时,就获取明细信息并绑定 | ||
| 258 | + self.employeeInfoForDetail = Employee.get({id: id}, function() { | ||
| 259 | + self.title = "员工 " + | ||
| 260 | + self.employeeInfoForDetail.personnelName + | ||
| 261 | + " 详细信息"; | ||
| 262 | + }); | ||
| 275 | 263 | ||
| 276 | - self.title = "员工 " + self.employeeInfoForDetail.personnelName + " 详细信息"; | ||
| 277 | - }, | ||
| 278 | - function(result) { | ||
| 279 | - // TODO:弹出框方式以后改 | ||
| 280 | - alert("出错啦!"); | ||
| 281 | } | 264 | } |
| 282 | - ); | ||
| 283 | -}]); | 265 | + ] |
| 266 | +); | ||
| 284 | 267 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/service.js
| 1 | // 人员信息service | 1 | // 人员信息service |
| 2 | -angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) { | ||
| 3 | - return { | ||
| 4 | - rest : $resource( | ||
| 5 | - '/personnel/:id', | ||
| 6 | - {order: 'jobCode', direction: 'ASC', id: '@id_route'}, | ||
| 7 | - { | ||
| 8 | - list: { | ||
| 9 | - method: 'GET', | ||
| 10 | - params: { | ||
| 11 | - page: 0 | 2 | +angular.module('ScheduleApp').factory( |
| 3 | + 'EmployeeInfoManageService_g', | ||
| 4 | + [ | ||
| 5 | + '$resource', | ||
| 6 | + function($resource) { | ||
| 7 | + return { | ||
| 8 | + rest : $resource( | ||
| 9 | + '/ee/:id', | ||
| 10 | + {order: 'jobCode', direction: 'ASC', id: '@id'}, | ||
| 11 | + { | ||
| 12 | + list: { | ||
| 13 | + method: 'GET', | ||
| 14 | + params: { | ||
| 15 | + page: 0 | ||
| 16 | + }, | ||
| 17 | + transformResponse: function(rs) { | ||
| 18 | + var dst = angular.fromJson(rs); | ||
| 19 | + if (dst.status == 'SUCCESS') { | ||
| 20 | + return dst.data; | ||
| 21 | + } else { | ||
| 22 | + return dst; // 业务错误留给控制器处理 | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + }, | ||
| 26 | + get: { | ||
| 27 | + method: 'GET', | ||
| 28 | + transformResponse: function(rs) { | ||
| 29 | + var dst = angular.fromJson(rs); | ||
| 30 | + if (dst.status == 'SUCCESS') { | ||
| 31 | + return dst.data; | ||
| 32 | + } else { | ||
| 33 | + return dst; | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + save: { | ||
| 38 | + method: 'POST' | ||
| 39 | + } | ||
| 12 | } | 40 | } |
| 13 | - }, | ||
| 14 | - get: { | ||
| 15 | - method: 'GET' | ||
| 16 | - }, | ||
| 17 | - save: { | ||
| 18 | - method: 'POST' | ||
| 19 | - } | ||
| 20 | - } | ||
| 21 | - ), | ||
| 22 | - validate: $resource( | ||
| 23 | - '/personnel/validate/:type', | ||
| 24 | - {}, | ||
| 25 | - { | ||
| 26 | - jobCode: { | ||
| 27 | - method: 'GET' | ||
| 28 | - } | ||
| 29 | - } | ||
| 30 | - ), | ||
| 31 | - dataTools: $resource( | ||
| 32 | - '/personnel/:type', | ||
| 33 | - {}, | ||
| 34 | - { | ||
| 35 | - dataExport: { | ||
| 36 | - method: 'GET', | ||
| 37 | - responseType: "arraybuffer", | ||
| 38 | - params: { | ||
| 39 | - type: "dataExport" | ||
| 40 | - }, | ||
| 41 | - transformResponse: function(data, headers){ | ||
| 42 | - return {data : data}; | 41 | + ), |
| 42 | + | ||
| 43 | + dataTools: $resource( | ||
| 44 | + '/personnel/:type', | ||
| 45 | + {}, | ||
| 46 | + { | ||
| 47 | + dataExport: { | ||
| 48 | + method: 'GET', | ||
| 49 | + responseType: "arraybuffer", | ||
| 50 | + params: { | ||
| 51 | + type: "dataExport" | ||
| 52 | + }, | ||
| 53 | + transformResponse: function(data, headers){ | ||
| 54 | + return {data : data}; | ||
| 55 | + } | ||
| 56 | + } | ||
| 43 | } | 57 | } |
| 44 | - } | ||
| 45 | - } | ||
| 46 | - ) | ||
| 47 | - }; | ||
| 48 | -}]); | 58 | + ) |
| 59 | + }; | ||
| 60 | + | ||
| 61 | + } | ||
| 62 | + ] | ||
| 63 | +); |
src/main/resources/static/pages/scheduleApp/module/common/dts1/select/saSelect5.js
| @@ -109,6 +109,10 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -109,6 +109,10 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 109 | // dom,span ng-bind属性设置,TODO:暂时无法用transclude设置,先用属性设置 | 109 | // dom,span ng-bind属性设置,TODO:暂时无法用transclude设置,先用属性设置 |
| 110 | tElem.find("ui-select-choices").html("{{" + $iterobjexp_attr + "}}"); | 110 | tElem.find("ui-select-choices").html("{{" + $iterobjexp_attr + "}}"); |
| 111 | 111 | ||
| 112 | + | ||
| 113 | + // 当前的数据模式,ajax,dic,local | ||
| 114 | + var dataModelType = undefined; | ||
| 115 | + | ||
| 112 | return { | 116 | return { |
| 113 | pre: function (scope, element, attr) { | 117 | pre: function (scope, element, attr) { |
| 114 | // TODO: | 118 | // TODO: |
| @@ -167,17 +171,19 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -167,17 +171,19 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 167 | // 处理search | 171 | // 处理search |
| 168 | console.log("search:" + search); | 172 | console.log("search:" + search); |
| 169 | 173 | ||
| 170 | - scope[ctrlAs].$$data = []; | ||
| 171 | - for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) { | ||
| 172 | - var upTerm = search.toUpperCase(); | ||
| 173 | - if (scope[ctrlAs].$$data.length < 10) { | ||
| 174 | - if (scope[ctrlAs].$$data_real[k].$fullChars.indexOf(upTerm) != -1 | ||
| 175 | - || scope[ctrlAs].$$data_real[k].$camelChars.indexOf(upTerm) != -1 | ||
| 176 | - || scope[ctrlAs].$$data_real[k].$calcu_str.indexOf(upTerm) != -1) { | ||
| 177 | - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k])); | 174 | + if (dataModelType == 'ajax') { |
| 175 | + scope[ctrlAs].$$data = []; | ||
| 176 | + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) { | ||
| 177 | + var upTerm = search.toUpperCase(); | ||
| 178 | + if (scope[ctrlAs].$$data.length < 10) { | ||
| 179 | + if (scope[ctrlAs].$$data_real[k].$fullChars.indexOf(upTerm) != -1 | ||
| 180 | + || scope[ctrlAs].$$data_real[k].$camelChars.indexOf(upTerm) != -1 | ||
| 181 | + || scope[ctrlAs].$$data_real[k].$calcu_str.indexOf(upTerm) != -1) { | ||
| 182 | + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k])); | ||
| 183 | + } | ||
| 184 | + } else { | ||
| 185 | + break; | ||
| 178 | } | 186 | } |
| 179 | - } else { | ||
| 180 | - break; | ||
| 181 | } | 187 | } |
| 182 | } | 188 | } |
| 183 | } | 189 | } |
| @@ -327,16 +333,18 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -327,16 +333,18 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 327 | 333 | ||
| 328 | // 重新创建内部保存的数据 | 334 | // 重新创建内部保存的数据 |
| 329 | scope[ctrlAs].$$data_real = []; | 335 | scope[ctrlAs].$$data_real = []; |
| 330 | - var origin_dicgroup = dictionaryUtils.getByGroup(dicgroup); | 336 | + var origin_dicgroup = dictionaryUtils.getByGroup(dictype); |
| 331 | var dic_key; // 字典key | 337 | var dic_key; // 字典key |
| 332 | 338 | ||
| 339 | + //console.log(origin_dicgroup); | ||
| 340 | + | ||
| 333 | for (dic_key in origin_dicgroup) { | 341 | for (dic_key in origin_dicgroup) { |
| 334 | var data = {}; // 重新组合的字典元素对象 | 342 | var data = {}; // 重新组合的字典元素对象 |
| 335 | if (dic_key == "true") | 343 | if (dic_key == "true") |
| 336 | data[$icname_attr] = true; | 344 | data[$icname_attr] = true; |
| 337 | else | 345 | else |
| 338 | data[$icname_attr] = dic_key; | 346 | data[$icname_attr] = dic_key; |
| 339 | - data[$dscol_attr] = origin_dicgroup[dic_key]; | 347 | + data['name'] = origin_dicgroup[dic_key]; // 字典写死name这个key名字 |
| 340 | scope[ctrlAs].$$data_real.push(data); | 348 | scope[ctrlAs].$$data_real.push(data); |
| 341 | } | 349 | } |
| 342 | 350 | ||
| @@ -380,11 +388,14 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -380,11 +388,14 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 380 | // {type: 'dic/ajax', param: 'dic名字'/'ajax查询参数对象', atype: 'ajax查询类型'} | 388 | // {type: 'dic/ajax', param: 'dic名字'/'ajax查询参数对象', atype: 'ajax查询类型'} |
| 381 | 389 | ||
| 382 | if (obj.type == 'dic') { | 390 | if (obj.type == 'dic') { |
| 391 | + dataModelType = 'dic'; | ||
| 383 | scope[ctrlAs].$$internal_dic_data(obj.param); | 392 | scope[ctrlAs].$$internal_dic_data(obj.param); |
| 384 | 393 | ||
| 385 | } else if (obj.type == 'ajax') { | 394 | } else if (obj.type == 'ajax') { |
| 395 | + dataModelType = 'ajax'; | ||
| 386 | scope[ctrlAs].$$internal_ajax_data(obj.atype, obj.param); | 396 | scope[ctrlAs].$$internal_ajax_data(obj.atype, obj.param); |
| 387 | } else if (obj.type == 'local') { | 397 | } else if (obj.type == 'local') { |
| 398 | + dataModelType = 'local'; | ||
| 388 | scope[ctrlAs].$$internal_local_data(obj.ldata); | 399 | scope[ctrlAs].$$internal_local_data(obj.ldata); |
| 389 | } else { | 400 | } else { |
| 390 | throw new Error("dsparams参数格式异常=" + obj); | 401 | throw new Error("dsparams参数格式异常=" + obj); |
src/main/resources/static/pages/scheduleApp/module/common/main.js
| @@ -104,18 +104,17 @@ ScheduleApp.factory( | @@ -104,18 +104,17 @@ ScheduleApp.factory( | ||
| 104 | // 如:{"timestamp":1478674739246,"status":500,"error":"Internal Server Error","exception":"java.lang.ClassCastException","message":"java.lang.String cannot be cast to java.lang.Long","path":"/tidc/importfile"} | 104 | // 如:{"timestamp":1478674739246,"status":500,"error":"Internal Server Error","exception":"java.lang.ClassCastException","message":"java.lang.String cannot be cast to java.lang.Long","path":"/tidc/importfile"} |
| 105 | 105 | ||
| 106 | var output = []; | 106 | var output = []; |
| 107 | - if (!status) { | 107 | + if (!rejection.status) { |
| 108 | alert("我擦,后台返回连个状态码都没返回,见鬼了,服务器可能重启了"); | 108 | alert("我擦,后台返回连个状态码都没返回,见鬼了,服务器可能重启了"); |
| 109 | - } else if (status == -1) { | 109 | + } else if (rejection.status == -1) { |
| 110 | // 服务器断开了 | 110 | // 服务器断开了 |
| 111 | alert("貌似服务端连接不上"); | 111 | alert("貌似服务端连接不上"); |
| 112 | } else { | 112 | } else { |
| 113 | - output.push("状态编码:" + status); | ||
| 114 | - output.push("访问路径:" + rejection.path); | ||
| 115 | - output.push("错误消息:" + rejection.message); | ||
| 116 | - if (status == 500) { | 113 | + output.push("状态编码:" + rejection.status); |
| 114 | + output.push("错误内容:" + angular.toJson(rejection.data)); | ||
| 115 | + if (rejection.status == 500) { | ||
| 117 | alert("服务端错误:" + "\n" + output.join("\n")); | 116 | alert("服务端错误:" + "\n" + output.join("\n")); |
| 118 | - } else if (status == 407) { | 117 | + } else if (rejection.status == 407) { |
| 119 | alert("请重新登录:" + "\n" + output.join("\n")); | 118 | alert("请重新登录:" + "\n" + output.join("\n")); |
| 120 | } else { | 119 | } else { |
| 121 | alert("其他错误:" + "\n" + output.join("\n")); | 120 | alert("其他错误:" + "\n" + output.join("\n")); |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
| @@ -59,7 +59,7 @@ angular.module('ScheduleApp').directive('remoteValidation', [ | @@ -59,7 +59,7 @@ angular.module('ScheduleApp').directive('remoteValidation', [ | ||
| 59 | // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证 | 59 | // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证 |
| 60 | var isParamAll = true; | 60 | var isParamAll = true; |
| 61 | for (var key in paramTemplate) { | 61 | for (var key in paramTemplate) { |
| 62 | - if (!$watch_rvparam_obj[key]) { | 62 | + if (key != "id" && !$watch_rvparam_obj[key]) { // id去掉 |
| 63 | isParamAll = false; | 63 | isParamAll = false; |
| 64 | break; | 64 | break; |
| 65 | } | 65 | } |
| @@ -1385,6 +1385,10 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -1385,6 +1385,10 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 1385 | // dom,span ng-bind属性设置,TODO:暂时无法用transclude设置,先用属性设置 | 1385 | // dom,span ng-bind属性设置,TODO:暂时无法用transclude设置,先用属性设置 |
| 1386 | tElem.find("ui-select-choices").html("{{" + $iterobjexp_attr + "}}"); | 1386 | tElem.find("ui-select-choices").html("{{" + $iterobjexp_attr + "}}"); |
| 1387 | 1387 | ||
| 1388 | + | ||
| 1389 | + // 当前的数据模式,ajax,dic,local | ||
| 1390 | + var dataModelType = undefined; | ||
| 1391 | + | ||
| 1388 | return { | 1392 | return { |
| 1389 | pre: function (scope, element, attr) { | 1393 | pre: function (scope, element, attr) { |
| 1390 | // TODO: | 1394 | // TODO: |
| @@ -1443,17 +1447,19 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -1443,17 +1447,19 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 1443 | // 处理search | 1447 | // 处理search |
| 1444 | console.log("search:" + search); | 1448 | console.log("search:" + search); |
| 1445 | 1449 | ||
| 1446 | - scope[ctrlAs].$$data = []; | ||
| 1447 | - for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) { | ||
| 1448 | - var upTerm = search.toUpperCase(); | ||
| 1449 | - if (scope[ctrlAs].$$data.length < 10) { | ||
| 1450 | - if (scope[ctrlAs].$$data_real[k].$fullChars.indexOf(upTerm) != -1 | ||
| 1451 | - || scope[ctrlAs].$$data_real[k].$camelChars.indexOf(upTerm) != -1 | ||
| 1452 | - || scope[ctrlAs].$$data_real[k].$calcu_str.indexOf(upTerm) != -1) { | ||
| 1453 | - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k])); | 1450 | + if (dataModelType == 'ajax') { |
| 1451 | + scope[ctrlAs].$$data = []; | ||
| 1452 | + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) { | ||
| 1453 | + var upTerm = search.toUpperCase(); | ||
| 1454 | + if (scope[ctrlAs].$$data.length < 10) { | ||
| 1455 | + if (scope[ctrlAs].$$data_real[k].$fullChars.indexOf(upTerm) != -1 | ||
| 1456 | + || scope[ctrlAs].$$data_real[k].$camelChars.indexOf(upTerm) != -1 | ||
| 1457 | + || scope[ctrlAs].$$data_real[k].$calcu_str.indexOf(upTerm) != -1) { | ||
| 1458 | + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k])); | ||
| 1459 | + } | ||
| 1460 | + } else { | ||
| 1461 | + break; | ||
| 1454 | } | 1462 | } |
| 1455 | - } else { | ||
| 1456 | - break; | ||
| 1457 | } | 1463 | } |
| 1458 | } | 1464 | } |
| 1459 | } | 1465 | } |
| @@ -1603,16 +1609,18 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -1603,16 +1609,18 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 1603 | 1609 | ||
| 1604 | // 重新创建内部保存的数据 | 1610 | // 重新创建内部保存的数据 |
| 1605 | scope[ctrlAs].$$data_real = []; | 1611 | scope[ctrlAs].$$data_real = []; |
| 1606 | - var origin_dicgroup = dictionaryUtils.getByGroup(dicgroup); | 1612 | + var origin_dicgroup = dictionaryUtils.getByGroup(dictype); |
| 1607 | var dic_key; // 字典key | 1613 | var dic_key; // 字典key |
| 1608 | 1614 | ||
| 1615 | + //console.log(origin_dicgroup); | ||
| 1616 | + | ||
| 1609 | for (dic_key in origin_dicgroup) { | 1617 | for (dic_key in origin_dicgroup) { |
| 1610 | var data = {}; // 重新组合的字典元素对象 | 1618 | var data = {}; // 重新组合的字典元素对象 |
| 1611 | if (dic_key == "true") | 1619 | if (dic_key == "true") |
| 1612 | data[$icname_attr] = true; | 1620 | data[$icname_attr] = true; |
| 1613 | else | 1621 | else |
| 1614 | data[$icname_attr] = dic_key; | 1622 | data[$icname_attr] = dic_key; |
| 1615 | - data[$dscol_attr] = origin_dicgroup[dic_key]; | 1623 | + data['name'] = origin_dicgroup[dic_key]; // 字典写死name这个key名字 |
| 1616 | scope[ctrlAs].$$data_real.push(data); | 1624 | scope[ctrlAs].$$data_real.push(data); |
| 1617 | } | 1625 | } |
| 1618 | 1626 | ||
| @@ -1656,11 +1664,14 @@ angular.module('ScheduleApp').directive('saSelect5', [ | @@ -1656,11 +1664,14 @@ angular.module('ScheduleApp').directive('saSelect5', [ | ||
| 1656 | // {type: 'dic/ajax', param: 'dic名字'/'ajax查询参数对象', atype: 'ajax查询类型'} | 1664 | // {type: 'dic/ajax', param: 'dic名字'/'ajax查询参数对象', atype: 'ajax查询类型'} |
| 1657 | 1665 | ||
| 1658 | if (obj.type == 'dic') { | 1666 | if (obj.type == 'dic') { |
| 1667 | + dataModelType = 'dic'; | ||
| 1659 | scope[ctrlAs].$$internal_dic_data(obj.param); | 1668 | scope[ctrlAs].$$internal_dic_data(obj.param); |
| 1660 | 1669 | ||
| 1661 | } else if (obj.type == 'ajax') { | 1670 | } else if (obj.type == 'ajax') { |
| 1671 | + dataModelType = 'ajax'; | ||
| 1662 | scope[ctrlAs].$$internal_ajax_data(obj.atype, obj.param); | 1672 | scope[ctrlAs].$$internal_ajax_data(obj.atype, obj.param); |
| 1663 | } else if (obj.type == 'local') { | 1673 | } else if (obj.type == 'local') { |
| 1674 | + dataModelType = 'local'; | ||
| 1664 | scope[ctrlAs].$$internal_local_data(obj.ldata); | 1675 | scope[ctrlAs].$$internal_local_data(obj.ldata); |
| 1665 | } else { | 1676 | } else { |
| 1666 | throw new Error("dsparams参数格式异常=" + obj); | 1677 | throw new Error("dsparams参数格式异常=" + obj); |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
| @@ -263,7 +263,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -263,7 +263,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 263 | gbv1: { // 路牌序号验证 | 263 | gbv1: { // 路牌序号验证 |
| 264 | template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'}, | 264 | template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'}, |
| 265 | remote: $resource( | 265 | remote: $resource( |
| 266 | - '/gic/validate1', | 266 | + '/gic/validate_lpno', |
| 267 | {}, | 267 | {}, |
| 268 | { | 268 | { |
| 269 | do: { | 269 | do: { |
| @@ -275,7 +275,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -275,7 +275,7 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 275 | gbv2: { // 路牌名称验证 | 275 | gbv2: { // 路牌名称验证 |
| 276 | template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'}, | 276 | template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'}, |
| 277 | remote: $resource( | 277 | remote: $resource( |
| 278 | - '/gic/validate2', | 278 | + '/gic/validate_lpname', |
| 279 | {}, | 279 | {}, |
| 280 | { | 280 | { |
| 281 | do: { | 281 | do: { |
| @@ -336,6 +336,20 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -336,6 +336,20 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 336 | } | 336 | } |
| 337 | ) | 337 | ) |
| 338 | }, | 338 | }, |
| 339 | + | ||
| 340 | + ee_gh: { // 工号不能重复 | ||
| 341 | + template: {'companyCode_eq': '-1', 'jobCode_eq': '-1'}, // 查询参数模版 | ||
| 342 | + remote: $resource( // $resource封装对象 | ||
| 343 | + '/ee/validate_gh', | ||
| 344 | + {}, | ||
| 345 | + { | ||
| 346 | + do: { | ||
| 347 | + method: 'GET' | ||
| 348 | + } | ||
| 349 | + } | ||
| 350 | + ) | ||
| 351 | + }, | ||
| 352 | + | ||
| 339 | cc_cars: { // 车辆不能重复配置 | 353 | cc_cars: { // 车辆不能重复配置 |
| 340 | template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 | 354 | template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 |
| 341 | remote: $resource( // $resource封装对象 | 355 | remote: $resource( // $resource封装对象 |
| @@ -374,9 +388,9 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -374,9 +388,9 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 374 | }, | 388 | }, |
| 375 | 389 | ||
| 376 | cde1: { // 车辆设备启用日期验证 | 390 | cde1: { // 车辆设备启用日期验证 |
| 377 | - template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒 | 391 | + template: {'xl_eq': -1, 'cl_eq': -1, 'qyrq_eq': 1}, // 日期毫秒 |
| 378 | remote: $resource( // $resource封装对象 | 392 | remote: $resource( // $resource封装对象 |
| 379 | - '/cde//validate/qyrq', | 393 | + '/cde_sc/validate_qyrq', |
| 380 | {}, | 394 | {}, |
| 381 | { | 395 | { |
| 382 | do: { | 396 | do: { |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| 1 | //所有模块service配置 | 1 | //所有模块service配置 |
| 2 | // 车辆信息service | 2 | // 车辆信息service |
| 3 | -angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) { | 3 | +angular.module('ScheduleApp').factory( |
| 4 | + 'BusInfoManageService_g', | ||
| 5 | + [ | ||
| 6 | + '$resource', | ||
| 7 | + function($resource) { | ||
| 8 | + return { | ||
| 9 | + rest: $resource( | ||
| 10 | + '/cars_sc/:id', | ||
| 11 | + {order: 'carCode', direction: 'ASC', id: '@id'}, | ||
| 12 | + { | ||
| 13 | + list: { | ||
| 14 | + method: 'GET', | ||
| 15 | + params: { | ||
| 16 | + page: 0 | ||
| 17 | + }, | ||
| 18 | + transformResponse: function(rs) { | ||
| 19 | + var dst = angular.fromJson(rs); | ||
| 20 | + if (dst.status == 'SUCCESS') { | ||
| 21 | + return dst.data; | ||
| 22 | + } else { | ||
| 23 | + return dst; // 业务错误留给控制器处理 | ||
| 24 | + } | ||
| 25 | + } | ||
| 26 | + }, | ||
| 27 | + get: { | ||
| 28 | + method: 'GET', | ||
| 29 | + transformResponse: function(rs) { | ||
| 30 | + var dst = angular.fromJson(rs); | ||
| 31 | + if (dst.status == 'SUCCESS') { | ||
| 32 | + return dst.data; | ||
| 33 | + } else { | ||
| 34 | + return dst; | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | + }, | ||
| 38 | + save: { | ||
| 39 | + method: 'POST' | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + ), | ||
| 43 | + import: $resource( | ||
| 44 | + '/cars/importfile', | ||
| 45 | + {}, | ||
| 46 | + { | ||
| 47 | + do: { | ||
| 48 | + method: 'POST', | ||
| 49 | + headers: { | ||
| 50 | + 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 51 | + }, | ||
| 52 | + transformRequest: function(obj) { | ||
| 53 | + var str = []; | ||
| 54 | + for (var p in obj) { | ||
| 55 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 56 | + } | ||
| 57 | + return str.join("&"); | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + ), | ||
| 62 | + dataTools: $resource( | ||
| 63 | + '/cars/:type', | ||
| 64 | + {}, | ||
| 65 | + { | ||
| 66 | + dataExport: { | ||
| 67 | + method: 'GET', | ||
| 68 | + responseType: "arraybuffer", | ||
| 69 | + params: { | ||
| 70 | + type: "dataExport" | ||
| 71 | + }, | ||
| 72 | + transformResponse: function(data, headers){ | ||
| 73 | + return {data : data}; | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + ) | ||
| 78 | + }; | ||
| 79 | + | ||
| 80 | + } | ||
| 81 | + ] | ||
| 82 | +); | ||
| 83 | +// 车辆设备信息service | ||
| 84 | +angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | ||
| 85 | + return $resource( | ||
| 86 | + '/cde_sc/:id', | ||
| 87 | + {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id'}, | ||
| 88 | + { | ||
| 89 | + list: { | ||
| 90 | + method: 'GET', | ||
| 91 | + params: { | ||
| 92 | + page: 0 | ||
| 93 | + }, | ||
| 94 | + transformResponse: function(rs) { | ||
| 95 | + var dst = angular.fromJson(rs); | ||
| 96 | + if (dst.status == 'SUCCESS') { | ||
| 97 | + return dst.data; | ||
| 98 | + } else { | ||
| 99 | + return dst; // 业务错误留给控制器处理 | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + }, | ||
| 103 | + get: { | ||
| 104 | + method: 'GET', | ||
| 105 | + transformResponse: function(rs) { | ||
| 106 | + var dst = angular.fromJson(rs); | ||
| 107 | + if (dst.status == 'SUCCESS') { | ||
| 108 | + return dst.data; | ||
| 109 | + } else { | ||
| 110 | + return dst; | ||
| 111 | + } | ||
| 112 | + } | ||
| 113 | + }, | ||
| 114 | + save: { | ||
| 115 | + method: 'POST' | ||
| 116 | + }, | ||
| 117 | + delete: { | ||
| 118 | + method: 'DELETE' | ||
| 119 | + } | ||
| 120 | + } | ||
| 121 | + ); | ||
| 122 | +}]); | ||
| 123 | +// 人员信息service | ||
| 124 | +angular.module('ScheduleApp').factory( | ||
| 125 | + 'EmployeeInfoManageService_g', | ||
| 126 | + [ | ||
| 127 | + '$resource', | ||
| 128 | + function($resource) { | ||
| 129 | + return { | ||
| 130 | + rest : $resource( | ||
| 131 | + '/ee/:id', | ||
| 132 | + {order: 'jobCode', direction: 'ASC', id: '@id'}, | ||
| 133 | + { | ||
| 134 | + list: { | ||
| 135 | + method: 'GET', | ||
| 136 | + params: { | ||
| 137 | + page: 0 | ||
| 138 | + }, | ||
| 139 | + transformResponse: function(rs) { | ||
| 140 | + var dst = angular.fromJson(rs); | ||
| 141 | + if (dst.status == 'SUCCESS') { | ||
| 142 | + return dst.data; | ||
| 143 | + } else { | ||
| 144 | + return dst; // 业务错误留给控制器处理 | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | + }, | ||
| 148 | + get: { | ||
| 149 | + method: 'GET', | ||
| 150 | + transformResponse: function(rs) { | ||
| 151 | + var dst = angular.fromJson(rs); | ||
| 152 | + if (dst.status == 'SUCCESS') { | ||
| 153 | + return dst.data; | ||
| 154 | + } else { | ||
| 155 | + return dst; | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + }, | ||
| 159 | + save: { | ||
| 160 | + method: 'POST' | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + ), | ||
| 164 | + | ||
| 165 | + dataTools: $resource( | ||
| 166 | + '/personnel/:type', | ||
| 167 | + {}, | ||
| 168 | + { | ||
| 169 | + dataExport: { | ||
| 170 | + method: 'GET', | ||
| 171 | + responseType: "arraybuffer", | ||
| 172 | + params: { | ||
| 173 | + type: "dataExport" | ||
| 174 | + }, | ||
| 175 | + transformResponse: function(data, headers){ | ||
| 176 | + return {data : data}; | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | + ) | ||
| 181 | + }; | ||
| 182 | + | ||
| 183 | + } | ||
| 184 | + ] | ||
| 185 | +); | ||
| 186 | + | ||
| 187 | +// 车辆配置service | ||
| 188 | +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) { | ||
| 4 | return { | 189 | return { |
| 5 | - rest: $resource( | ||
| 6 | - '/cars_sc/:id', | ||
| 7 | - {order: 'carCode', direction: 'ASC', id: '@id_route'}, | 190 | + rest : $resource( |
| 191 | + '/cci/:id', | ||
| 192 | + {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id'}, | ||
| 8 | { | 193 | { |
| 9 | list: { | 194 | list: { |
| 10 | method: 'GET', | 195 | method: 'GET', |
| @@ -35,99 +220,66 @@ angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', fu | @@ -35,99 +220,66 @@ angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', fu | ||
| 35 | method: 'POST' | 220 | method: 'POST' |
| 36 | } | 221 | } |
| 37 | } | 222 | } |
| 38 | - ), | ||
| 39 | - import: $resource( | ||
| 40 | - '/cars/importfile', | ||
| 41 | - {}, | ||
| 42 | - { | ||
| 43 | - do: { | ||
| 44 | - method: 'POST', | ||
| 45 | - headers: { | ||
| 46 | - 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 47 | - }, | ||
| 48 | - transformRequest: function(obj) { | ||
| 49 | - var str = []; | ||
| 50 | - for (var p in obj) { | ||
| 51 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 52 | - } | ||
| 53 | - return str.join("&"); | ||
| 54 | - } | ||
| 55 | - } | ||
| 56 | - } | ||
| 57 | - ), | ||
| 58 | - validate: $resource( | ||
| 59 | - '/cars/validate/:type', | ||
| 60 | - {}, | ||
| 61 | - { | ||
| 62 | - insideCode: { | ||
| 63 | - method: 'GET' | ||
| 64 | - } | ||
| 65 | - } | ||
| 66 | - ), | ||
| 67 | - dataTools: $resource( | ||
| 68 | - '/cars/:type', | ||
| 69 | - {}, | ||
| 70 | - { | ||
| 71 | - dataExport: { | ||
| 72 | - method: 'GET', | ||
| 73 | - responseType: "arraybuffer", | ||
| 74 | - params: { | ||
| 75 | - type: "dataExport" | ||
| 76 | - }, | ||
| 77 | - transformResponse: function(data, headers){ | ||
| 78 | - return {data : data}; | ||
| 79 | - } | ||
| 80 | - } | ||
| 81 | - } | ||
| 82 | ) | 223 | ) |
| 83 | }; | 224 | }; |
| 84 | }]); | 225 | }]); |
| 85 | -// 车辆设备信息service | ||
| 86 | -angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | 226 | +// 线路运营统计service |
| 227 | +angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) { | ||
| 87 | return $resource( | 228 | return $resource( |
| 88 | - '/cde/:id', | ||
| 89 | - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'}, | 229 | + '/bic/:id', |
| 230 | + {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询 | ||
| 90 | { | 231 | { |
| 91 | list: { | 232 | list: { |
| 92 | method: 'GET', | 233 | method: 'GET', |
| 93 | params: { | 234 | params: { |
| 94 | page: 0 | 235 | page: 0 |
| 95 | } | 236 | } |
| 96 | - }, | ||
| 97 | - get: { | ||
| 98 | - method: 'GET' | ||
| 99 | - }, | ||
| 100 | - save: { | ||
| 101 | - method: 'POST' | ||
| 102 | - }, | ||
| 103 | - delete: { | ||
| 104 | - method: 'DELETE' | ||
| 105 | } | 237 | } |
| 106 | } | 238 | } |
| 107 | ); | 239 | ); |
| 108 | -}]); | ||
| 109 | -// 人员信息service | ||
| 110 | -angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) { | 240 | +}]); |
| 241 | + | ||
| 242 | +// 人员配置service | ||
| 243 | +angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) { | ||
| 111 | return { | 244 | return { |
| 112 | rest : $resource( | 245 | rest : $resource( |
| 113 | - '/personnel/:id', | ||
| 114 | - {order: 'jobCode', direction: 'ASC', id: '@id_route'}, | 246 | + '/eci/:id', |
| 247 | + {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id'}, | ||
| 115 | { | 248 | { |
| 116 | list: { | 249 | list: { |
| 117 | method: 'GET', | 250 | method: 'GET', |
| 118 | params: { | 251 | params: { |
| 119 | page: 0 | 252 | page: 0 |
| 253 | + }, | ||
| 254 | + transformResponse: function(rs) { | ||
| 255 | + var dst = angular.fromJson(rs); | ||
| 256 | + if (dst.status == 'SUCCESS') { | ||
| 257 | + return dst.data; | ||
| 258 | + } else { | ||
| 259 | + return dst; // 业务错误留给控制器处理 | ||
| 260 | + } | ||
| 120 | } | 261 | } |
| 121 | }, | 262 | }, |
| 122 | get: { | 263 | get: { |
| 123 | - method: 'GET' | 264 | + method: 'GET', |
| 265 | + transformResponse: function(rs) { | ||
| 266 | + var dst = angular.fromJson(rs); | ||
| 267 | + if (dst.status == 'SUCCESS') { | ||
| 268 | + return dst.data; | ||
| 269 | + } else { | ||
| 270 | + return dst; | ||
| 271 | + } | ||
| 272 | + } | ||
| 124 | }, | 273 | }, |
| 125 | save: { | 274 | save: { |
| 126 | method: 'POST' | 275 | method: 'POST' |
| 276 | + }, | ||
| 277 | + delete: { | ||
| 278 | + method: 'DELETE' | ||
| 127 | } | 279 | } |
| 128 | } | 280 | } |
| 129 | ), | 281 | ), |
| 130 | - validate: $resource( | 282 | + validate: $resource( // TODO: |
| 131 | '/personnel/validate/:type', | 283 | '/personnel/validate/:type', |
| 132 | {}, | 284 | {}, |
| 133 | { | 285 | { |
| @@ -135,138 +287,15 @@ angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource | @@ -135,138 +287,15 @@ angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource | ||
| 135 | method: 'GET' | 287 | method: 'GET' |
| 136 | } | 288 | } |
| 137 | } | 289 | } |
| 138 | - ), | ||
| 139 | - dataTools: $resource( | ||
| 140 | - '/personnel/:type', | ||
| 141 | - {}, | ||
| 142 | - { | ||
| 143 | - dataExport: { | ||
| 144 | - method: 'GET', | ||
| 145 | - responseType: "arraybuffer", | ||
| 146 | - params: { | ||
| 147 | - type: "dataExport" | ||
| 148 | - }, | ||
| 149 | - transformResponse: function(data, headers){ | ||
| 150 | - return {data : data}; | ||
| 151 | - } | ||
| 152 | - } | ||
| 153 | - } | ||
| 154 | ) | 290 | ) |
| 155 | }; | 291 | }; |
| 156 | -}]); | ||
| 157 | - | ||
| 158 | -// 车辆配置service | ||
| 159 | -angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) { | ||
| 160 | - return { | ||
| 161 | - rest : $resource( | ||
| 162 | - '/cci/:id', | ||
| 163 | - {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'}, | ||
| 164 | - { | ||
| 165 | - list: { | ||
| 166 | - method: 'GET', | ||
| 167 | - params: { | ||
| 168 | - page: 0 | ||
| 169 | - }, | ||
| 170 | - transformResponse: function(rs) { | ||
| 171 | - var dst = angular.fromJson(rs); | ||
| 172 | - if (dst.status == 'SUCCESS') { | ||
| 173 | - return dst.data; | ||
| 174 | - } else { | ||
| 175 | - return dst; // 业务错误留给控制器处理 | ||
| 176 | - } | ||
| 177 | - } | ||
| 178 | - }, | ||
| 179 | - get: { | ||
| 180 | - method: 'GET', | ||
| 181 | - transformResponse: function(rs) { | ||
| 182 | - var dst = angular.fromJson(rs); | ||
| 183 | - if (dst.status == 'SUCCESS') { | ||
| 184 | - return dst.data; | ||
| 185 | - } else { | ||
| 186 | - return dst; | ||
| 187 | - } | ||
| 188 | - } | ||
| 189 | - }, | ||
| 190 | - save: { | ||
| 191 | - method: 'POST' | ||
| 192 | - } | ||
| 193 | - } | ||
| 194 | - ) | ||
| 195 | - }; | ||
| 196 | -}]); | ||
| 197 | -// 线路运营统计service | ||
| 198 | -angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) { | ||
| 199 | - return $resource( | ||
| 200 | - '/bic/:id', | ||
| 201 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询 | ||
| 202 | - { | ||
| 203 | - list: { | ||
| 204 | - method: 'GET', | ||
| 205 | - params: { | ||
| 206 | - page: 0 | ||
| 207 | - } | ||
| 208 | - } | ||
| 209 | - } | ||
| 210 | - ); | ||
| 211 | -}]); | ||
| 212 | - | ||
| 213 | -// 人员配置service | ||
| 214 | -angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) { | ||
| 215 | - return { | ||
| 216 | - rest : $resource( | ||
| 217 | - '/eci/:id', | ||
| 218 | - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'}, | ||
| 219 | - { | ||
| 220 | - list: { | ||
| 221 | - method: 'GET', | ||
| 222 | - params: { | ||
| 223 | - page: 0 | ||
| 224 | - }, | ||
| 225 | - transformResponse: function(rs) { | ||
| 226 | - var dst = angular.fromJson(rs); | ||
| 227 | - if (dst.status == 'SUCCESS') { | ||
| 228 | - return dst.data; | ||
| 229 | - } else { | ||
| 230 | - return dst; // 业务错误留给控制器处理 | ||
| 231 | - } | ||
| 232 | - } | ||
| 233 | - }, | ||
| 234 | - get: { | ||
| 235 | - method: 'GET', | ||
| 236 | - transformResponse: function(rs) { | ||
| 237 | - var dst = angular.fromJson(rs); | ||
| 238 | - if (dst.status == 'SUCCESS') { | ||
| 239 | - return dst.data; | ||
| 240 | - } else { | ||
| 241 | - return dst; | ||
| 242 | - } | ||
| 243 | - } | ||
| 244 | - }, | ||
| 245 | - save: { | ||
| 246 | - method: 'POST' | ||
| 247 | - }, | ||
| 248 | - delete: { | ||
| 249 | - method: 'DELETE' | ||
| 250 | - } | ||
| 251 | - } | ||
| 252 | - ), | ||
| 253 | - validate: $resource( // TODO: | ||
| 254 | - '/personnel/validate/:type', | ||
| 255 | - {}, | ||
| 256 | - { | ||
| 257 | - jobCode: { | ||
| 258 | - method: 'GET' | ||
| 259 | - } | ||
| 260 | - } | ||
| 261 | - ) | ||
| 262 | - }; | ||
| 263 | }]); | 292 | }]); |
| 264 | // 路牌管理service | 293 | // 路牌管理service |
| 265 | angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) { | 294 | angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) { |
| 266 | return { | 295 | return { |
| 267 | rest: $resource( | 296 | rest: $resource( |
| 268 | '/gic/:id', | 297 | '/gic/:id', |
| 269 | - {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id_route'}, | 298 | + {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id'}, |
| 270 | { | 299 | { |
| 271 | list: { | 300 | list: { |
| 272 | method: 'GET', | 301 | method: 'GET', |
| @@ -523,454 +552,468 @@ angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resou | @@ -523,454 +552,468 @@ angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resou | ||
| 523 | // TODO:导入数据 | 552 | // TODO:导入数据 |
| 524 | }; | 553 | }; |
| 525 | }]); | 554 | }]); |
| 526 | -// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用 | ||
| 527 | - | ||
| 528 | -// 文件下载服务 | ||
| 529 | -angular.module('ScheduleApp').factory('FileDownload_g', function() { | ||
| 530 | - return { | ||
| 531 | - downloadFile: function (data, mimeType, fileName) { | ||
| 532 | - var success = false; | ||
| 533 | - var blob = new Blob([data], { type: mimeType }); | ||
| 534 | - try { | ||
| 535 | - if (navigator.msSaveBlob) | ||
| 536 | - navigator.msSaveBlob(blob, fileName); | ||
| 537 | - else { | ||
| 538 | - // Try using other saveBlob implementations, if available | ||
| 539 | - var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob; | ||
| 540 | - if (saveBlob === undefined) throw "Not supported"; | ||
| 541 | - saveBlob(blob, fileName); | ||
| 542 | - } | ||
| 543 | - success = true; | ||
| 544 | - } catch (ex) { | ||
| 545 | - console.log("saveBlob method failed with the following exception:"); | ||
| 546 | - console.log(ex); | ||
| 547 | - } | ||
| 548 | - | ||
| 549 | - if (!success) { | ||
| 550 | - // Get the blob url creator | ||
| 551 | - var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL; | ||
| 552 | - if (urlCreator) { | ||
| 553 | - // Try to use a download link | ||
| 554 | - var link = document.createElement('a'); | ||
| 555 | - if ('download' in link) { | ||
| 556 | - // Try to simulate a click | ||
| 557 | - try { | ||
| 558 | - // Prepare a blob URL | ||
| 559 | - var url = urlCreator.createObjectURL(blob); | ||
| 560 | - link.setAttribute('href', url); | ||
| 561 | - | ||
| 562 | - // Set the download attribute (Supported in Chrome 14+ / Firefox 20+) | ||
| 563 | - link.setAttribute("download", fileName); | ||
| 564 | - | ||
| 565 | - // Simulate clicking the download link | ||
| 566 | - var event = document.createEvent('MouseEvents'); | ||
| 567 | - event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); | ||
| 568 | - link.dispatchEvent(event); | ||
| 569 | - success = true; | ||
| 570 | - | ||
| 571 | - } catch (ex) { | ||
| 572 | - console.log("Download link method with simulated click failed with the following exception:"); | ||
| 573 | - console.log(ex); | ||
| 574 | - } | ||
| 575 | - } | ||
| 576 | - | ||
| 577 | - if (!success) { | ||
| 578 | - // Fallback to window.location method | ||
| 579 | - try { | ||
| 580 | - // Prepare a blob URL | ||
| 581 | - // Use application/octet-stream when using window.location to force download | ||
| 582 | - var url = urlCreator.createObjectURL(blob); | ||
| 583 | - window.location = url; | ||
| 584 | - console.log("Download link method with window.location succeeded"); | ||
| 585 | - success = true; | ||
| 586 | - } catch (ex) { | ||
| 587 | - console.log("Download link method with window.location failed with the following exception:"); | ||
| 588 | - console.log(ex); | ||
| 589 | - } | ||
| 590 | - } | ||
| 591 | - } | ||
| 592 | - } | ||
| 593 | - | ||
| 594 | - if (!success) { | ||
| 595 | - // Fallback to window.open method | ||
| 596 | - console.log("No methods worked for saving the arraybuffer, using last resort window.open"); | ||
| 597 | - window.open("", '_blank', ''); | ||
| 598 | - } | ||
| 599 | - } | ||
| 600 | - }; | ||
| 601 | -}); | ||
| 602 | - | ||
| 603 | - | ||
| 604 | -/** | ||
| 605 | - * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。 | ||
| 606 | - * 1、compile阶段使用的属性如下: | ||
| 607 | - * required:用于和表单验证连接,指定成required="true"才有效。 | ||
| 608 | - * 2、link阶段使用的属性如下 | ||
| 609 | - * model:关联的模型对象 | ||
| 610 | - * name:表单验证时需要的名字 | ||
| 611 | - * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加 | ||
| 612 | - * modelcolname1:关联的模型字段名字1(一般应该是编码字段) | ||
| 613 | - * modelcolname2:关联的模型字段名字2(一般应该是名字字段) | ||
| 614 | - * datacolname1;内部数据对应的字段名字1(与模型字段1对应) | ||
| 615 | - * datacolname2:内部数据对应的字段名字2(与模型字段2对应) | ||
| 616 | - * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用 | ||
| 617 | - * placeholder:select placeholder字符串描述 | ||
| 618 | - * | ||
| 619 | - * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。 | ||
| 620 | - * $$SearchInfoService_g,内部使用的数据服务 | ||
| 621 | - */ | ||
| 622 | -// saSelect2指令使用的内部信service | ||
| 623 | -angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) { | ||
| 624 | - return { | ||
| 625 | - xl: $resource( | ||
| 626 | - '/line/:type', | ||
| 627 | - {order: 'name', direction: 'ASC'}, | ||
| 628 | - { | ||
| 629 | - list: { | ||
| 630 | - method: 'GET', | ||
| 631 | - isArray: true | ||
| 632 | - } | ||
| 633 | - } | ||
| 634 | - ), | ||
| 635 | - xlinfo: $resource( | ||
| 636 | - '/lineInformation/:type', | ||
| 637 | - {order: 'line.name', direction: 'ASC'}, | ||
| 638 | - { | ||
| 639 | - list: { | ||
| 640 | - method: 'GET', | ||
| 641 | - isArray: true | ||
| 642 | - } | ||
| 643 | - } | ||
| 644 | - ), | ||
| 645 | - zd: $resource( | ||
| 646 | - '/stationroute/stations', | ||
| 647 | - {order: 'stationCode', direction: 'ASC'}, | ||
| 648 | - { | ||
| 649 | - list: { | ||
| 650 | - method: 'GET', | ||
| 651 | - isArray: true | ||
| 652 | - } | ||
| 653 | - } | ||
| 654 | - ), | ||
| 655 | - tcc: $resource( | ||
| 656 | - '/carpark/:type', | ||
| 657 | - {order: 'parkCode', direction: 'ASC'}, | ||
| 658 | - { | ||
| 659 | - list: { | ||
| 660 | - method: 'GET', | ||
| 661 | - isArray: true | ||
| 662 | - } | ||
| 663 | - } | ||
| 664 | - ), | ||
| 665 | - ry: $resource( | ||
| 666 | - '/personnel/:type', | ||
| 667 | - {order: 'personnelName', direction: 'ASC'}, | ||
| 668 | - { | ||
| 669 | - list: { | ||
| 670 | - method: 'GET', | ||
| 671 | - isArray: true | ||
| 672 | - } | ||
| 673 | - } | ||
| 674 | - ), | ||
| 675 | - cl: $resource( | ||
| 676 | - '/cars/:type', | ||
| 677 | - {order: "insideCode", direction: 'ASC'}, | ||
| 678 | - { | ||
| 679 | - list: { | ||
| 680 | - method: 'GET', | ||
| 681 | - isArray: true | ||
| 682 | - } | ||
| 683 | - } | ||
| 684 | - ), | ||
| 685 | - ttInfo: $resource( | ||
| 686 | - '/tic/:type', | ||
| 687 | - {order: "name", direction: 'ASC'}, | ||
| 688 | - { | ||
| 689 | - list: { | ||
| 690 | - method: 'GET', | ||
| 691 | - isArray: true | ||
| 692 | - } | ||
| 693 | - } | ||
| 694 | - ), | ||
| 695 | - lpInfo: $resource( | ||
| 696 | - '/gic/ttlpnames', | ||
| 697 | - {order: "lpName", direction: 'ASC'}, | ||
| 698 | - { | ||
| 699 | - list: { | ||
| 700 | - method: 'GET', | ||
| 701 | - isArray: true | ||
| 702 | - } | ||
| 703 | - } | ||
| 704 | - ), | ||
| 705 | - lpInfo2: $resource( | ||
| 706 | - '/gic/:type', | ||
| 707 | - {order: "lpName", direction: 'ASC'}, | ||
| 708 | - { | ||
| 709 | - list: { | ||
| 710 | - method: 'GET', | ||
| 711 | - isArray: true | ||
| 712 | - } | ||
| 713 | - } | ||
| 714 | - ), | ||
| 715 | - cci: $resource( | ||
| 716 | - '/cci/cars', | ||
| 717 | - {}, | ||
| 718 | - { | ||
| 719 | - list: { | ||
| 720 | - method: 'GET', | ||
| 721 | - isArray: true | ||
| 722 | - } | ||
| 723 | - } | ||
| 724 | - | ||
| 725 | - ), | ||
| 726 | - cci2: $resource( | ||
| 727 | - '/cci/:type', | ||
| 728 | - {}, | ||
| 729 | - { | ||
| 730 | - list: { | ||
| 731 | - method: 'GET', | ||
| 732 | - isArray: true, | ||
| 733 | - transformResponse: function(rs) { | ||
| 734 | - var dst = angular.fromJson(rs); | ||
| 735 | - if (dst.status == 'SUCCESS') { | ||
| 736 | - return dst.data; | ||
| 737 | - } else { | ||
| 738 | - return dst; // 业务错误留给控制器处理 | ||
| 739 | - } | ||
| 740 | - } | ||
| 741 | - } | ||
| 742 | - } | ||
| 743 | - ), | ||
| 744 | - cci3: $resource( | ||
| 745 | - '/cci/cars2', | ||
| 746 | - {}, | ||
| 747 | - { | ||
| 748 | - list: { | ||
| 749 | - method: 'GET', | ||
| 750 | - isArray: true | ||
| 751 | - } | ||
| 752 | - } | ||
| 753 | - | ||
| 754 | - ), | ||
| 755 | - eci: $resource( | ||
| 756 | - '/eci/jsy', | ||
| 757 | - {}, | ||
| 758 | - { | ||
| 759 | - list: { | ||
| 760 | - method: 'GET', | ||
| 761 | - isArray: true | ||
| 762 | - } | ||
| 763 | - } | ||
| 764 | - ), | ||
| 765 | - eci2: $resource( | ||
| 766 | - '/eci/spy', | ||
| 767 | - {}, | ||
| 768 | - { | ||
| 769 | - list: { | ||
| 770 | - method: 'GET', | ||
| 771 | - isArray: true | ||
| 772 | - } | ||
| 773 | - } | ||
| 774 | - ), | ||
| 775 | - eci3: $resource( | ||
| 776 | - '/eci/:type', | ||
| 777 | - {}, | ||
| 778 | - { | ||
| 779 | - list: { | ||
| 780 | - method: 'GET', | ||
| 781 | - isArray: true | ||
| 782 | - } | ||
| 783 | - } | ||
| 784 | - ), | ||
| 785 | - | ||
| 786 | - | ||
| 787 | - validate: { // remoteValidation指令用到的resource | ||
| 788 | - gbv1: { // 路牌序号验证 | ||
| 789 | - template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'}, | ||
| 790 | - remote: $resource( | ||
| 791 | - '/gic/validate1', | ||
| 792 | - {}, | ||
| 793 | - { | ||
| 794 | - do: { | ||
| 795 | - method: 'GET' | ||
| 796 | - } | ||
| 797 | - } | ||
| 798 | - ) | ||
| 799 | - }, | ||
| 800 | - gbv2: { // 路牌名称验证 | ||
| 801 | - template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'}, | ||
| 802 | - remote: $resource( | ||
| 803 | - '/gic/validate2', | ||
| 804 | - {}, | ||
| 805 | - { | ||
| 806 | - do: { | ||
| 807 | - method: 'GET' | ||
| 808 | - } | ||
| 809 | - } | ||
| 810 | - ) | ||
| 811 | - }, | ||
| 812 | - | ||
| 813 | - cars_zbh: { // 自编号验证 | ||
| 814 | - template: {'insideCode_eq': '-1'}, // 查询参数模版 | ||
| 815 | - remote: $resource( // $resource封装对象 | ||
| 816 | - '/cars_sc/validate_zbh', | ||
| 817 | - {}, | ||
| 818 | - { | ||
| 819 | - do: { | ||
| 820 | - method: 'GET' | ||
| 821 | - } | ||
| 822 | - } | ||
| 823 | - ) | ||
| 824 | - }, | ||
| 825 | - | ||
| 826 | - cars_sbbh: { // 验证设备编号 | ||
| 827 | - template: {'equipmentCode_eq': '-1'}, // 查询参数模版 | ||
| 828 | - remote: $resource( // $resource封装对象 | ||
| 829 | - '/cars_sc/validate_sbbh', | ||
| 830 | - {}, | ||
| 831 | - { | ||
| 832 | - do: { | ||
| 833 | - method: 'GET' | ||
| 834 | - } | ||
| 835 | - } | ||
| 836 | - ) | ||
| 837 | - }, | ||
| 838 | - | ||
| 839 | - cars_clbh: { // 车辆编号验证 | ||
| 840 | - template: {'carCode_eq': '-1'}, // 查询参数模版 | ||
| 841 | - remote: $resource( // $resource封装对象 | ||
| 842 | - '/cars_sc/validate_clbh', | ||
| 843 | - {}, | ||
| 844 | - { | ||
| 845 | - do: { | ||
| 846 | - method: 'GET' | ||
| 847 | - } | ||
| 848 | - } | ||
| 849 | - ) | ||
| 850 | - }, | ||
| 851 | - | ||
| 852 | - cars_cph: { // 车牌号验证 | ||
| 853 | - template: {'carPlate_eq': '-1'}, // 查询参数模版 | ||
| 854 | - remote: $resource( // $resource封装对象 | ||
| 855 | - '/cars_sc/validate_cph', | ||
| 856 | - {}, | ||
| 857 | - { | ||
| 858 | - do: { | ||
| 859 | - method: 'GET' | ||
| 860 | - } | ||
| 861 | - } | ||
| 862 | - ) | ||
| 863 | - }, | ||
| 864 | - cc_cars: { // 车辆不能重复配置 | ||
| 865 | - template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 | ||
| 866 | - remote: $resource( // $resource封装对象 | ||
| 867 | - '/cci/validate_cars', | ||
| 868 | - {}, | ||
| 869 | - { | ||
| 870 | - do: { | ||
| 871 | - method: 'GET' | ||
| 872 | - } | ||
| 873 | - } | ||
| 874 | - ) | ||
| 875 | - }, | ||
| 876 | - ec_jsy: { // 驾驶员不能重复配置 | ||
| 877 | - template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版 | ||
| 878 | - remote: $resource( // $resource封装对象 | ||
| 879 | - '/eci/validate_jsy', | ||
| 880 | - {}, | ||
| 881 | - { | ||
| 882 | - do: { | ||
| 883 | - method: 'GET' | ||
| 884 | - } | ||
| 885 | - } | ||
| 886 | - ) | ||
| 887 | - }, | ||
| 888 | - ec_spy: { // 售票员不能重复配置 | ||
| 889 | - template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版 | ||
| 890 | - remote: $resource( // $resource封装对象 | ||
| 891 | - '/eci/validate_spy', | ||
| 892 | - {}, | ||
| 893 | - { | ||
| 894 | - do: { | ||
| 895 | - method: 'GET' | ||
| 896 | - } | ||
| 897 | - } | ||
| 898 | - ) | ||
| 899 | - }, | ||
| 900 | - | ||
| 901 | - cde1: { // 车辆设备启用日期验证 | ||
| 902 | - template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒 | ||
| 903 | - remote: $resource( // $resource封装对象 | ||
| 904 | - '/cde//validate/qyrq', | ||
| 905 | - {}, | ||
| 906 | - { | ||
| 907 | - do: { | ||
| 908 | - method: 'GET' | ||
| 909 | - } | ||
| 910 | - } | ||
| 911 | - ) | ||
| 912 | - }, | ||
| 913 | - ttc1: { // 时刻表名字验证 | ||
| 914 | - template: {'xl.id_eq': -1, 'name_eq': 'ddd'}, | ||
| 915 | - remote: $resource( // $resource封装对象 | ||
| 916 | - '/tic/validate/equale', | ||
| 917 | - {}, | ||
| 918 | - { | ||
| 919 | - do: { | ||
| 920 | - method: 'GET' | ||
| 921 | - } | ||
| 922 | - } | ||
| 923 | - ) | ||
| 924 | - }, | ||
| 925 | - sheet: { // 时刻表sheet工作区验证 | ||
| 926 | - template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''}, | ||
| 927 | - remote: $resource( // $resource封装对象 | ||
| 928 | - '/tidc/validate/sheet', | ||
| 929 | - {}, | ||
| 930 | - { | ||
| 931 | - do: { | ||
| 932 | - method: 'POST', | ||
| 933 | - headers: { | ||
| 934 | - 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 935 | - }, | ||
| 936 | - transformRequest: function(obj) { | ||
| 937 | - var str = []; | ||
| 938 | - for (var p in obj) { | ||
| 939 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 940 | - } | ||
| 941 | - return str.join("&"); | ||
| 942 | - } | ||
| 943 | - } | ||
| 944 | - } | ||
| 945 | - ) | ||
| 946 | - }, | ||
| 947 | - sheetli: { // 时刻表线路标准验证 | ||
| 948 | - template: {'lineinfoid': -1}, | ||
| 949 | - remote: $resource( // $resource封装对象 | ||
| 950 | - '/tidc/validate/lineinfo', | ||
| 951 | - {}, | ||
| 952 | - { | ||
| 953 | - do: { | ||
| 954 | - method: 'GET' | ||
| 955 | - } | ||
| 956 | - } | ||
| 957 | - ) | ||
| 958 | - } | ||
| 959 | - } | ||
| 960 | - | ||
| 961 | - //validate: $resource( | ||
| 962 | - // '/cars/validate/:type', | ||
| 963 | - // {}, | ||
| 964 | - // { | ||
| 965 | - // insideCode: { | ||
| 966 | - // method: 'GET' | ||
| 967 | - // } | ||
| 968 | - // } | ||
| 969 | - //) | ||
| 970 | - | ||
| 971 | - | ||
| 972 | - | ||
| 973 | - } | ||
| 974 | -}]); | ||
| 975 | - | ||
| 976 | - | 555 | +// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用 |
| 556 | + | ||
| 557 | +// 文件下载服务 | ||
| 558 | +angular.module('ScheduleApp').factory('FileDownload_g', function() { | ||
| 559 | + return { | ||
| 560 | + downloadFile: function (data, mimeType, fileName) { | ||
| 561 | + var success = false; | ||
| 562 | + var blob = new Blob([data], { type: mimeType }); | ||
| 563 | + try { | ||
| 564 | + if (navigator.msSaveBlob) | ||
| 565 | + navigator.msSaveBlob(blob, fileName); | ||
| 566 | + else { | ||
| 567 | + // Try using other saveBlob implementations, if available | ||
| 568 | + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob; | ||
| 569 | + if (saveBlob === undefined) throw "Not supported"; | ||
| 570 | + saveBlob(blob, fileName); | ||
| 571 | + } | ||
| 572 | + success = true; | ||
| 573 | + } catch (ex) { | ||
| 574 | + console.log("saveBlob method failed with the following exception:"); | ||
| 575 | + console.log(ex); | ||
| 576 | + } | ||
| 577 | + | ||
| 578 | + if (!success) { | ||
| 579 | + // Get the blob url creator | ||
| 580 | + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL; | ||
| 581 | + if (urlCreator) { | ||
| 582 | + // Try to use a download link | ||
| 583 | + var link = document.createElement('a'); | ||
| 584 | + if ('download' in link) { | ||
| 585 | + // Try to simulate a click | ||
| 586 | + try { | ||
| 587 | + // Prepare a blob URL | ||
| 588 | + var url = urlCreator.createObjectURL(blob); | ||
| 589 | + link.setAttribute('href', url); | ||
| 590 | + | ||
| 591 | + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+) | ||
| 592 | + link.setAttribute("download", fileName); | ||
| 593 | + | ||
| 594 | + // Simulate clicking the download link | ||
| 595 | + var event = document.createEvent('MouseEvents'); | ||
| 596 | + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); | ||
| 597 | + link.dispatchEvent(event); | ||
| 598 | + success = true; | ||
| 599 | + | ||
| 600 | + } catch (ex) { | ||
| 601 | + console.log("Download link method with simulated click failed with the following exception:"); | ||
| 602 | + console.log(ex); | ||
| 603 | + } | ||
| 604 | + } | ||
| 605 | + | ||
| 606 | + if (!success) { | ||
| 607 | + // Fallback to window.location method | ||
| 608 | + try { | ||
| 609 | + // Prepare a blob URL | ||
| 610 | + // Use application/octet-stream when using window.location to force download | ||
| 611 | + var url = urlCreator.createObjectURL(blob); | ||
| 612 | + window.location = url; | ||
| 613 | + console.log("Download link method with window.location succeeded"); | ||
| 614 | + success = true; | ||
| 615 | + } catch (ex) { | ||
| 616 | + console.log("Download link method with window.location failed with the following exception:"); | ||
| 617 | + console.log(ex); | ||
| 618 | + } | ||
| 619 | + } | ||
| 620 | + } | ||
| 621 | + } | ||
| 622 | + | ||
| 623 | + if (!success) { | ||
| 624 | + // Fallback to window.open method | ||
| 625 | + console.log("No methods worked for saving the arraybuffer, using last resort window.open"); | ||
| 626 | + window.open("", '_blank', ''); | ||
| 627 | + } | ||
| 628 | + } | ||
| 629 | + }; | ||
| 630 | +}); | ||
| 631 | + | ||
| 632 | + | ||
| 633 | +/** | ||
| 634 | + * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。 | ||
| 635 | + * 1、compile阶段使用的属性如下: | ||
| 636 | + * required:用于和表单验证连接,指定成required="true"才有效。 | ||
| 637 | + * 2、link阶段使用的属性如下 | ||
| 638 | + * model:关联的模型对象 | ||
| 639 | + * name:表单验证时需要的名字 | ||
| 640 | + * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加 | ||
| 641 | + * modelcolname1:关联的模型字段名字1(一般应该是编码字段) | ||
| 642 | + * modelcolname2:关联的模型字段名字2(一般应该是名字字段) | ||
| 643 | + * datacolname1;内部数据对应的字段名字1(与模型字段1对应) | ||
| 644 | + * datacolname2:内部数据对应的字段名字2(与模型字段2对应) | ||
| 645 | + * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用 | ||
| 646 | + * placeholder:select placeholder字符串描述 | ||
| 647 | + * | ||
| 648 | + * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。 | ||
| 649 | + * $$SearchInfoService_g,内部使用的数据服务 | ||
| 650 | + */ | ||
| 651 | +// saSelect2指令使用的内部信service | ||
| 652 | +angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) { | ||
| 653 | + return { | ||
| 654 | + xl: $resource( | ||
| 655 | + '/line/:type', | ||
| 656 | + {order: 'name', direction: 'ASC'}, | ||
| 657 | + { | ||
| 658 | + list: { | ||
| 659 | + method: 'GET', | ||
| 660 | + isArray: true | ||
| 661 | + } | ||
| 662 | + } | ||
| 663 | + ), | ||
| 664 | + xlinfo: $resource( | ||
| 665 | + '/lineInformation/:type', | ||
| 666 | + {order: 'line.name', direction: 'ASC'}, | ||
| 667 | + { | ||
| 668 | + list: { | ||
| 669 | + method: 'GET', | ||
| 670 | + isArray: true | ||
| 671 | + } | ||
| 672 | + } | ||
| 673 | + ), | ||
| 674 | + zd: $resource( | ||
| 675 | + '/stationroute/stations', | ||
| 676 | + {order: 'stationCode', direction: 'ASC'}, | ||
| 677 | + { | ||
| 678 | + list: { | ||
| 679 | + method: 'GET', | ||
| 680 | + isArray: true | ||
| 681 | + } | ||
| 682 | + } | ||
| 683 | + ), | ||
| 684 | + tcc: $resource( | ||
| 685 | + '/carpark/:type', | ||
| 686 | + {order: 'parkCode', direction: 'ASC'}, | ||
| 687 | + { | ||
| 688 | + list: { | ||
| 689 | + method: 'GET', | ||
| 690 | + isArray: true | ||
| 691 | + } | ||
| 692 | + } | ||
| 693 | + ), | ||
| 694 | + ry: $resource( | ||
| 695 | + '/personnel/:type', | ||
| 696 | + {order: 'personnelName', direction: 'ASC'}, | ||
| 697 | + { | ||
| 698 | + list: { | ||
| 699 | + method: 'GET', | ||
| 700 | + isArray: true | ||
| 701 | + } | ||
| 702 | + } | ||
| 703 | + ), | ||
| 704 | + cl: $resource( | ||
| 705 | + '/cars/:type', | ||
| 706 | + {order: "insideCode", direction: 'ASC'}, | ||
| 707 | + { | ||
| 708 | + list: { | ||
| 709 | + method: 'GET', | ||
| 710 | + isArray: true | ||
| 711 | + } | ||
| 712 | + } | ||
| 713 | + ), | ||
| 714 | + ttInfo: $resource( | ||
| 715 | + '/tic/:type', | ||
| 716 | + {order: "name", direction: 'ASC'}, | ||
| 717 | + { | ||
| 718 | + list: { | ||
| 719 | + method: 'GET', | ||
| 720 | + isArray: true | ||
| 721 | + } | ||
| 722 | + } | ||
| 723 | + ), | ||
| 724 | + lpInfo: $resource( | ||
| 725 | + '/gic/ttlpnames', | ||
| 726 | + {order: "lpName", direction: 'ASC'}, | ||
| 727 | + { | ||
| 728 | + list: { | ||
| 729 | + method: 'GET', | ||
| 730 | + isArray: true | ||
| 731 | + } | ||
| 732 | + } | ||
| 733 | + ), | ||
| 734 | + lpInfo2: $resource( | ||
| 735 | + '/gic/:type', | ||
| 736 | + {order: "lpName", direction: 'ASC'}, | ||
| 737 | + { | ||
| 738 | + list: { | ||
| 739 | + method: 'GET', | ||
| 740 | + isArray: true | ||
| 741 | + } | ||
| 742 | + } | ||
| 743 | + ), | ||
| 744 | + cci: $resource( | ||
| 745 | + '/cci/cars', | ||
| 746 | + {}, | ||
| 747 | + { | ||
| 748 | + list: { | ||
| 749 | + method: 'GET', | ||
| 750 | + isArray: true | ||
| 751 | + } | ||
| 752 | + } | ||
| 753 | + | ||
| 754 | + ), | ||
| 755 | + cci2: $resource( | ||
| 756 | + '/cci/:type', | ||
| 757 | + {}, | ||
| 758 | + { | ||
| 759 | + list: { | ||
| 760 | + method: 'GET', | ||
| 761 | + isArray: true, | ||
| 762 | + transformResponse: function(rs) { | ||
| 763 | + var dst = angular.fromJson(rs); | ||
| 764 | + if (dst.status == 'SUCCESS') { | ||
| 765 | + return dst.data; | ||
| 766 | + } else { | ||
| 767 | + return dst; // 业务错误留给控制器处理 | ||
| 768 | + } | ||
| 769 | + } | ||
| 770 | + } | ||
| 771 | + } | ||
| 772 | + ), | ||
| 773 | + cci3: $resource( | ||
| 774 | + '/cci/cars2', | ||
| 775 | + {}, | ||
| 776 | + { | ||
| 777 | + list: { | ||
| 778 | + method: 'GET', | ||
| 779 | + isArray: true | ||
| 780 | + } | ||
| 781 | + } | ||
| 782 | + | ||
| 783 | + ), | ||
| 784 | + eci: $resource( | ||
| 785 | + '/eci/jsy', | ||
| 786 | + {}, | ||
| 787 | + { | ||
| 788 | + list: { | ||
| 789 | + method: 'GET', | ||
| 790 | + isArray: true | ||
| 791 | + } | ||
| 792 | + } | ||
| 793 | + ), | ||
| 794 | + eci2: $resource( | ||
| 795 | + '/eci/spy', | ||
| 796 | + {}, | ||
| 797 | + { | ||
| 798 | + list: { | ||
| 799 | + method: 'GET', | ||
| 800 | + isArray: true | ||
| 801 | + } | ||
| 802 | + } | ||
| 803 | + ), | ||
| 804 | + eci3: $resource( | ||
| 805 | + '/eci/:type', | ||
| 806 | + {}, | ||
| 807 | + { | ||
| 808 | + list: { | ||
| 809 | + method: 'GET', | ||
| 810 | + isArray: true | ||
| 811 | + } | ||
| 812 | + } | ||
| 813 | + ), | ||
| 814 | + | ||
| 815 | + | ||
| 816 | + validate: { // remoteValidation指令用到的resource | ||
| 817 | + gbv1: { // 路牌序号验证 | ||
| 818 | + template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'}, | ||
| 819 | + remote: $resource( | ||
| 820 | + '/gic/validate_lpno', | ||
| 821 | + {}, | ||
| 822 | + { | ||
| 823 | + do: { | ||
| 824 | + method: 'GET' | ||
| 825 | + } | ||
| 826 | + } | ||
| 827 | + ) | ||
| 828 | + }, | ||
| 829 | + gbv2: { // 路牌名称验证 | ||
| 830 | + template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'}, | ||
| 831 | + remote: $resource( | ||
| 832 | + '/gic/validate_lpname', | ||
| 833 | + {}, | ||
| 834 | + { | ||
| 835 | + do: { | ||
| 836 | + method: 'GET' | ||
| 837 | + } | ||
| 838 | + } | ||
| 839 | + ) | ||
| 840 | + }, | ||
| 841 | + | ||
| 842 | + cars_zbh: { // 自编号验证 | ||
| 843 | + template: {'insideCode_eq': '-1'}, // 查询参数模版 | ||
| 844 | + remote: $resource( // $resource封装对象 | ||
| 845 | + '/cars_sc/validate_zbh', | ||
| 846 | + {}, | ||
| 847 | + { | ||
| 848 | + do: { | ||
| 849 | + method: 'GET' | ||
| 850 | + } | ||
| 851 | + } | ||
| 852 | + ) | ||
| 853 | + }, | ||
| 854 | + | ||
| 855 | + cars_sbbh: { // 验证设备编号 | ||
| 856 | + template: {'equipmentCode_eq': '-1'}, // 查询参数模版 | ||
| 857 | + remote: $resource( // $resource封装对象 | ||
| 858 | + '/cars_sc/validate_sbbh', | ||
| 859 | + {}, | ||
| 860 | + { | ||
| 861 | + do: { | ||
| 862 | + method: 'GET' | ||
| 863 | + } | ||
| 864 | + } | ||
| 865 | + ) | ||
| 866 | + }, | ||
| 867 | + | ||
| 868 | + cars_clbh: { // 车辆编号验证 | ||
| 869 | + template: {'carCode_eq': '-1'}, // 查询参数模版 | ||
| 870 | + remote: $resource( // $resource封装对象 | ||
| 871 | + '/cars_sc/validate_clbh', | ||
| 872 | + {}, | ||
| 873 | + { | ||
| 874 | + do: { | ||
| 875 | + method: 'GET' | ||
| 876 | + } | ||
| 877 | + } | ||
| 878 | + ) | ||
| 879 | + }, | ||
| 880 | + | ||
| 881 | + cars_cph: { // 车牌号验证 | ||
| 882 | + template: {'carPlate_eq': '-1'}, // 查询参数模版 | ||
| 883 | + remote: $resource( // $resource封装对象 | ||
| 884 | + '/cars_sc/validate_cph', | ||
| 885 | + {}, | ||
| 886 | + { | ||
| 887 | + do: { | ||
| 888 | + method: 'GET' | ||
| 889 | + } | ||
| 890 | + } | ||
| 891 | + ) | ||
| 892 | + }, | ||
| 893 | + | ||
| 894 | + ee_gh: { // 工号不能重复 | ||
| 895 | + template: {'companyCode_eq': '-1', 'jobCode_eq': '-1'}, // 查询参数模版 | ||
| 896 | + remote: $resource( // $resource封装对象 | ||
| 897 | + '/ee/validate_gh', | ||
| 898 | + {}, | ||
| 899 | + { | ||
| 900 | + do: { | ||
| 901 | + method: 'GET' | ||
| 902 | + } | ||
| 903 | + } | ||
| 904 | + ) | ||
| 905 | + }, | ||
| 906 | + | ||
| 907 | + cc_cars: { // 车辆不能重复配置 | ||
| 908 | + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版 | ||
| 909 | + remote: $resource( // $resource封装对象 | ||
| 910 | + '/cci/validate_cars', | ||
| 911 | + {}, | ||
| 912 | + { | ||
| 913 | + do: { | ||
| 914 | + method: 'GET' | ||
| 915 | + } | ||
| 916 | + } | ||
| 917 | + ) | ||
| 918 | + }, | ||
| 919 | + ec_jsy: { // 驾驶员不能重复配置 | ||
| 920 | + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版 | ||
| 921 | + remote: $resource( // $resource封装对象 | ||
| 922 | + '/eci/validate_jsy', | ||
| 923 | + {}, | ||
| 924 | + { | ||
| 925 | + do: { | ||
| 926 | + method: 'GET' | ||
| 927 | + } | ||
| 928 | + } | ||
| 929 | + ) | ||
| 930 | + }, | ||
| 931 | + ec_spy: { // 售票员不能重复配置 | ||
| 932 | + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版 | ||
| 933 | + remote: $resource( // $resource封装对象 | ||
| 934 | + '/eci/validate_spy', | ||
| 935 | + {}, | ||
| 936 | + { | ||
| 937 | + do: { | ||
| 938 | + method: 'GET' | ||
| 939 | + } | ||
| 940 | + } | ||
| 941 | + ) | ||
| 942 | + }, | ||
| 943 | + | ||
| 944 | + cde1: { // 车辆设备启用日期验证 | ||
| 945 | + template: {'xl_eq': -1, 'cl_eq': -1, 'qyrq_eq': 1}, // 日期毫秒 | ||
| 946 | + remote: $resource( // $resource封装对象 | ||
| 947 | + '/cde_sc/validate_qyrq', | ||
| 948 | + {}, | ||
| 949 | + { | ||
| 950 | + do: { | ||
| 951 | + method: 'GET' | ||
| 952 | + } | ||
| 953 | + } | ||
| 954 | + ) | ||
| 955 | + }, | ||
| 956 | + ttc1: { // 时刻表名字验证 | ||
| 957 | + template: {'xl.id_eq': -1, 'name_eq': 'ddd'}, | ||
| 958 | + remote: $resource( // $resource封装对象 | ||
| 959 | + '/tic/validate/equale', | ||
| 960 | + {}, | ||
| 961 | + { | ||
| 962 | + do: { | ||
| 963 | + method: 'GET' | ||
| 964 | + } | ||
| 965 | + } | ||
| 966 | + ) | ||
| 967 | + }, | ||
| 968 | + sheet: { // 时刻表sheet工作区验证 | ||
| 969 | + template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''}, | ||
| 970 | + remote: $resource( // $resource封装对象 | ||
| 971 | + '/tidc/validate/sheet', | ||
| 972 | + {}, | ||
| 973 | + { | ||
| 974 | + do: { | ||
| 975 | + method: 'POST', | ||
| 976 | + headers: { | ||
| 977 | + 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 978 | + }, | ||
| 979 | + transformRequest: function(obj) { | ||
| 980 | + var str = []; | ||
| 981 | + for (var p in obj) { | ||
| 982 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 983 | + } | ||
| 984 | + return str.join("&"); | ||
| 985 | + } | ||
| 986 | + } | ||
| 987 | + } | ||
| 988 | + ) | ||
| 989 | + }, | ||
| 990 | + sheetli: { // 时刻表线路标准验证 | ||
| 991 | + template: {'lineinfoid': -1}, | ||
| 992 | + remote: $resource( // $resource封装对象 | ||
| 993 | + '/tidc/validate/lineinfo', | ||
| 994 | + {}, | ||
| 995 | + { | ||
| 996 | + do: { | ||
| 997 | + method: 'GET' | ||
| 998 | + } | ||
| 999 | + } | ||
| 1000 | + ) | ||
| 1001 | + } | ||
| 1002 | + } | ||
| 1003 | + | ||
| 1004 | + //validate: $resource( | ||
| 1005 | + // '/cars/validate/:type', | ||
| 1006 | + // {}, | ||
| 1007 | + // { | ||
| 1008 | + // insideCode: { | ||
| 1009 | + // method: 'GET' | ||
| 1010 | + // } | ||
| 1011 | + // } | ||
| 1012 | + //) | ||
| 1013 | + | ||
| 1014 | + | ||
| 1015 | + | ||
| 1016 | + } | ||
| 1017 | +}]); | ||
| 1018 | + | ||
| 1019 | + |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/edit.html
| @@ -135,17 +135,18 @@ | @@ -135,17 +135,18 @@ | ||
| 135 | <div class="form-group has-success has-feedback"> | 135 | <div class="form-group has-success has-feedback"> |
| 136 | <label class="col-md-2 control-label">停车场*:</label> | 136 | <label class="col-md-2 control-label">停车场*:</label> |
| 137 | <div class="col-md-3"> | 137 | <div class="col-md-3"> |
| 138 | - <sa-Select3 model="ctrl.busConfigForSave" | ||
| 139 | - name="tcd" | ||
| 140 | - placeholder="请输拼音..." | ||
| 141 | - dcvalue="{{ctrl.busConfigForSave.tcd}}" | 138 | + <sa-Select5 name="tcd" |
| 139 | + model="ctrl.busConfigForSave" | ||
| 140 | + cmaps="{'tcd': 'parkName'}" | ||
| 142 | dcname="tcd" | 141 | dcname="tcd" |
| 143 | icname="parkName" | 142 | icname="parkName" |
| 144 | - icnames="parkName" | ||
| 145 | - datatype="tcc" | ||
| 146 | - mlp="true" | 143 | + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}" |
| 144 | + iterobjname="item" | ||
| 145 | + iterobjexp="item.parkName" | ||
| 146 | + searchph="请输拼音..." | ||
| 147 | + searchexp="this.parkName" | ||
| 147 | required > | 148 | required > |
| 148 | - </sa-Select3> | 149 | + </sa-Select5> |
| 149 | </div> | 150 | </div> |
| 150 | <!-- 隐藏块,显示验证信息 --> | 151 | <!-- 隐藏块,显示验证信息 --> |
| 151 | <div class="alert alert-danger well-sm" ng-show="myForm.tcd.$error.required"> | 152 | <div class="alert alert-danger well-sm" ng-show="myForm.tcd.$error.required"> |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/form.html
| @@ -79,7 +79,7 @@ | @@ -79,7 +79,7 @@ | ||
| 79 | <input type="hidden" name="cl_h" ng-model="ctrl.busConfigForSave.cl.id" | 79 | <input type="hidden" name="cl_h" ng-model="ctrl.busConfigForSave.cl.id" |
| 80 | remote-Validation | 80 | remote-Validation |
| 81 | remotevtype="cc_cars" | 81 | remotevtype="cc_cars" |
| 82 | - remotevparam="{{ {'id_eq': ctrl.busConfigForSave.id, 'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}" | 82 | + remotevparam="{{ {'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}" |
| 83 | /> | 83 | /> |
| 84 | </div> | 84 | </div> |
| 85 | <!-- 隐藏块,显示验证信息 --> | 85 | <!-- 隐藏块,显示验证信息 --> |
| @@ -135,17 +135,18 @@ | @@ -135,17 +135,18 @@ | ||
| 135 | <div class="form-group has-success has-feedback"> | 135 | <div class="form-group has-success has-feedback"> |
| 136 | <label class="col-md-2 control-label">停车场*:</label> | 136 | <label class="col-md-2 control-label">停车场*:</label> |
| 137 | <div class="col-md-3"> | 137 | <div class="col-md-3"> |
| 138 | - <sa-Select3 model="ctrl.busConfigForSave" | ||
| 139 | - name="tcd" | ||
| 140 | - placeholder="请输拼音..." | ||
| 141 | - dcvalue="{{ctrl.busConfigForSave.tcd}}" | 138 | + <sa-Select5 name="tcd" |
| 139 | + model="ctrl.busConfigForSave" | ||
| 140 | + cmaps="{'tcd': 'parkName'}" | ||
| 142 | dcname="tcd" | 141 | dcname="tcd" |
| 143 | icname="parkName" | 142 | icname="parkName" |
| 144 | - icnames="parkName" | ||
| 145 | - datatype="tcc" | ||
| 146 | - mlp="true" | 143 | + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}" |
| 144 | + iterobjname="item" | ||
| 145 | + iterobjexp="item.parkName" | ||
| 146 | + searchph="请输拼音..." | ||
| 147 | + searchexp="this.parkName" | ||
| 147 | required > | 148 | required > |
| 148 | - </sa-Select3> | 149 | + </sa-Select5> |
| 149 | </div> | 150 | </div> |
| 150 | <!-- 隐藏块,显示验证信息 --> | 151 | <!-- 隐藏块,显示验证信息 --> |
| 151 | <div class="alert alert-danger well-sm" ng-show="myForm.tcd.$error.required"> | 152 | <div class="alert alert-danger well-sm" ng-show="myForm.tcd.$error.required"> |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/list.html
| @@ -17,15 +17,18 @@ | @@ -17,15 +17,18 @@ | ||
| 17 | <td></td> | 17 | <td></td> |
| 18 | <td> | 18 | <td> |
| 19 | <div> | 19 | <div> |
| 20 | - <sa-Select3 model="ctrl.searchCondition()" | ||
| 21 | - name="xl" | ||
| 22 | - placeholder="请输拼音..." | ||
| 23 | - dcvalue="{{ctrl.searchCondition()['xl.lineCode_eq']}}" | 20 | + <sa-Select5 name="xl" |
| 21 | + model="ctrl.searchCondition()" | ||
| 22 | + cmaps="{'xl.lineCode_eq' : 'lineCode'}" | ||
| 24 | dcname="xl.lineCode_eq" | 23 | dcname="xl.lineCode_eq" |
| 25 | icname="lineCode" | 24 | icname="lineCode" |
| 26 | - icnames="name" | ||
| 27 | - datatype="xl"> | ||
| 28 | - </sa-Select3> | 25 | + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}" |
| 26 | + iterobjname="item" | ||
| 27 | + iterobjexp="item.name" | ||
| 28 | + searchph="请输拼音..." | ||
| 29 | + searchexp="this.name" | ||
| 30 | + required > | ||
| 31 | + </sa-Select5> | ||
| 29 | </div> | 32 | </div> |
| 30 | </td> | 33 | </td> |
| 31 | <td> | 34 | <td> |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/module.js
| @@ -169,8 +169,8 @@ angular.module('ScheduleApp').controller( | @@ -169,8 +169,8 @@ angular.module('ScheduleApp').controller( | ||
| 169 | }; | 169 | }; |
| 170 | self.toggleBusConfig = function(id) { | 170 | self.toggleBusConfig = function(id) { |
| 171 | BusConfig.delete({id: id}, function(result) { | 171 | BusConfig.delete({id: id}, function(result) { |
| 172 | - if (result.message) { // 暂时这样做,之后全局拦截 | ||
| 173 | - alert("失败:" + result.message); | 172 | + if (result.msg) { // 暂时这样做,之后全局拦截 |
| 173 | + alert("失败:" + result.msg); | ||
| 174 | } else { | 174 | } else { |
| 175 | self.doPage(); | 175 | self.doPage(); |
| 176 | } | 176 | } |
| @@ -222,6 +222,7 @@ angular.module('ScheduleApp').controller( | @@ -222,6 +222,7 @@ angular.module('ScheduleApp').controller( | ||
| 222 | 222 | ||
| 223 | // 提交方法 | 223 | // 提交方法 |
| 224 | self.submit = function() { | 224 | self.submit = function() { |
| 225 | + // 保存或者更新 | ||
| 225 | self.busConfigForSave.$save(function() { | 226 | self.busConfigForSave.$save(function() { |
| 226 | $state.go("busConfig"); | 227 | $state.go("busConfig"); |
| 227 | }); | 228 | }); |
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/edit.html
| @@ -121,8 +121,8 @@ | @@ -121,8 +121,8 @@ | ||
| 121 | </sa-Select5> | 121 | </sa-Select5> |
| 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_jsy" | ||
| 125 | - 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.spy.id} | json}}" | 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}}" | ||
| 126 | /> | 126 | /> |
| 127 | </div> | 127 | </div> |
| 128 | <!-- 隐藏块,显示验证信息 --> | 128 | <!-- 隐藏块,显示验证信息 --> |
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/list.html
| @@ -18,17 +18,18 @@ | @@ -18,17 +18,18 @@ | ||
| 18 | <td></td> | 18 | <td></td> |
| 19 | <td> | 19 | <td> |
| 20 | <div> | 20 | <div> |
| 21 | - <sa-Select3 model="ctrl.searchCondition()" | ||
| 22 | - name="xl" | ||
| 23 | - placeholder="请输拼音..." | ||
| 24 | - dcvalue="{{ctrl.searchCondition()['xl.lineCode_eq']}}" | 21 | + <sa-Select5 name="xl" |
| 22 | + model="ctrl.searchCondition()" | ||
| 23 | + cmaps="{'xl.lineCode_eq' : 'lineCode'}" | ||
| 25 | dcname="xl.lineCode_eq" | 24 | dcname="xl.lineCode_eq" |
| 26 | icname="lineCode" | 25 | icname="lineCode" |
| 27 | - dcname2="xl.company_eq" | ||
| 28 | - icname2="company" | ||
| 29 | - icnames="name" | ||
| 30 | - datatype="xl"> | ||
| 31 | - </sa-Select3> | 26 | + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}" |
| 27 | + iterobjname="item" | ||
| 28 | + iterobjexp="item.name" | ||
| 29 | + searchph="请输拼音..." | ||
| 30 | + searchexp="this.name" | ||
| 31 | + required > | ||
| 32 | + </sa-Select5> | ||
| 32 | </div> | 33 | </div> |
| 33 | </td> | 34 | </td> |
| 34 | <td></td> | 35 | <td></td> |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/module.js
| @@ -170,8 +170,8 @@ angular.module('ScheduleApp').controller( | @@ -170,8 +170,8 @@ angular.module('ScheduleApp').controller( | ||
| 170 | 170 | ||
| 171 | self.toggleEmpConfig = function(id) { | 171 | self.toggleEmpConfig = function(id) { |
| 172 | EmpConfig.delete({id: id}, function(result) { | 172 | EmpConfig.delete({id: id}, function(result) { |
| 173 | - if (result.message) { // 暂时这样做,之后全局拦截 | ||
| 174 | - alert("失败:" + result.message); | 173 | + if (result.msg) { // 暂时这样做,之后全局拦截 |
| 174 | + alert("失败:" + result.msg); | ||
| 175 | } else { | 175 | } else { |
| 176 | self.doPage(); | 176 | self.doPage(); |
| 177 | } | 177 | } |
| @@ -220,6 +220,7 @@ angular.module('ScheduleApp').controller( | @@ -220,6 +220,7 @@ angular.module('ScheduleApp').controller( | ||
| 220 | self.employeeConfigForSave.spy = null; | 220 | self.employeeConfigForSave.spy = null; |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | + // 保存或更新 | ||
| 223 | self.employeeConfigForSave.$save(function() { | 224 | self.employeeConfigForSave.$save(function() { |
| 224 | $state.go("employeeConfig"); | 225 | $state.go("employeeConfig"); |
| 225 | }); | 226 | }); |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/service.js
| @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', f | @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', f | ||
| 3 | return { | 3 | return { |
| 4 | rest : $resource( | 4 | rest : $resource( |
| 5 | '/eci/:id', | 5 | '/eci/:id', |
| 6 | - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'}, | 6 | + {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id'}, |
| 7 | { | 7 | { |
| 8 | list: { | 8 | list: { |
| 9 | method: 'GET', | 9 | method: 'GET', |
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/form.html
| @@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
| 63 | name="lpNo" placeholder="请输入路牌编号..." min="1" required | 63 | name="lpNo" placeholder="请输入路牌编号..." min="1" required |
| 64 | remote-Validation | 64 | remote-Validation |
| 65 | remotevtype="gbv1" | 65 | remotevtype="gbv1" |
| 66 | - remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}" | 66 | + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}" |
| 67 | 67 | ||
| 68 | /> | 68 | /> |
| 69 | </div> | 69 | </div> |
| @@ -85,7 +85,7 @@ | @@ -85,7 +85,7 @@ | ||
| 85 | name="lpName" placeholder="请输入路牌名字..." required | 85 | name="lpName" placeholder="请输入路牌名字..." required |
| 86 | remote-Validation | 86 | remote-Validation |
| 87 | remotevtype="gbv2" | 87 | remotevtype="gbv2" |
| 88 | - remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}" | 88 | + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}" |
| 89 | 89 | ||
| 90 | /> | 90 | /> |
| 91 | </div> | 91 | </div> |
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/list.html
| @@ -77,8 +77,8 @@ | @@ -77,8 +77,8 @@ | ||
| 77 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | 77 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> |
| 78 | <a ui-sref="guideboardManage_detail({id : info.id})" class="btn btn-info btn-sm"> 详细 </a> | 78 | <a ui-sref="guideboardManage_detail({id : info.id})" class="btn btn-info btn-sm"> 详细 </a> |
| 79 | <a ui-sref="guideboardManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> | 79 | <a ui-sref="guideboardManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> |
| 80 | - <a ng-click="ctrl.toggleCancel(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a> | ||
| 81 | - <a ng-click="ctrl.toggleCancel(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> | 80 | + <a ng-click="ctrl.toggleGuideboard(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a> |
| 81 | + <a ng-click="ctrl.toggleGuideboard(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> | ||
| 82 | </td> | 82 | </td> |
| 83 | </tr> | 83 | </tr> |
| 84 | </tbody> | 84 | </tbody> |
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/module.js
| @@ -180,18 +180,8 @@ angular.module('ScheduleApp').controller( | @@ -180,18 +180,8 @@ angular.module('ScheduleApp').controller( | ||
| 180 | service.getPage(result); | 180 | service.getPage(result); |
| 181 | }); | 181 | }); |
| 182 | }; | 182 | }; |
| 183 | - self.toggleTtinfo = function(id) { | ||
| 184 | - Gb.delete({id: id}, function(result) { | ||
| 185 | - if (result.message) { // 暂时这样做,之后全局拦截 | ||
| 186 | - alert("失败:" + result.message); | ||
| 187 | - } else { | ||
| 188 | - self.doPage(); | ||
| 189 | - } | ||
| 190 | - }); | ||
| 191 | - }; | ||
| 192 | - | ||
| 193 | // 作废切换 | 183 | // 作废切换 |
| 194 | - self.toggleCancel = function(id) { | 184 | + self.toggleGuideboard = function(id) { |
| 195 | Gb.delete({id: id}, function(result) { | 185 | Gb.delete({id: id}, function(result) { |
| 196 | if (result.status == "ERROR") { // 暂时这样做,之后全局拦截 | 186 | if (result.status == "ERROR") { // 暂时这样做,之后全局拦截 |
| 197 | alert("失败:" + result.msg); | 187 | alert("失败:" + result.msg); |
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/service.js
| @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', | @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', | ||
| 3 | return { | 3 | return { |
| 4 | rest: $resource( | 4 | rest: $resource( |
| 5 | '/gic/:id', | 5 | '/gic/:id', |
| 6 | - {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id_route'}, | 6 | + {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id'}, |
| 7 | { | 7 | { |
| 8 | list: { | 8 | list: { |
| 9 | method: 'GET', | 9 | method: 'GET', |
src/main/resources/static/real_control_v2/css/ct_table.css
src/main/resources/static/real_control_v2/css/line_schedule.css
| @@ -64,6 +64,9 @@ | @@ -64,6 +64,9 @@ | ||
| 64 | .line_schedule .schedule-wrap h3 { | 64 | .line_schedule .schedule-wrap h3 { |
| 65 | margin: 7px 0 5px; | 65 | margin: 7px 0 5px; |
| 66 | text-indent: 5px; | 66 | text-indent: 5px; |
| 67 | + margin: 0; | ||
| 68 | + height: 31px; | ||
| 69 | + line-height: 31px; | ||
| 67 | } | 70 | } |
| 68 | 71 | ||
| 69 | .line_schedule .schedule-wrap.up h3 { | 72 | .line_schedule .schedule-wrap.up h3 { |
| @@ -245,6 +248,7 @@ span.fcsj-diff { | @@ -245,6 +248,7 @@ span.fcsj-diff { | ||
| 245 | .tl-yzx { | 248 | .tl-yzx { |
| 246 | background: #c1ddf0; | 249 | background: #c1ddf0; |
| 247 | border-top: 1px solid #ebebeb !important; | 250 | border-top: 1px solid #ebebeb !important; |
| 251 | + color: #444; | ||
| 248 | } | 252 | } |
| 249 | 253 | ||
| 250 | .tl-xxfc{ | 254 | .tl-xxfc{ |
| @@ -254,15 +258,18 @@ span.fcsj-diff { | @@ -254,15 +258,18 @@ span.fcsj-diff { | ||
| 254 | 258 | ||
| 255 | .tl-wd{ | 259 | .tl-wd{ |
| 256 | background: #caca4f; | 260 | background: #caca4f; |
| 261 | + color: #444; | ||
| 257 | } | 262 | } |
| 258 | 263 | ||
| 259 | .tl-xxsd{ | 264 | .tl-xxsd{ |
| 260 | background: #e2de94; | 265 | background: #e2de94; |
| 266 | + color: #444; | ||
| 261 | } | 267 | } |
| 262 | 268 | ||
| 263 | .tl-xxrd{ | 269 | .tl-xxrd{ |
| 264 | background: #c1ddf0; | 270 | background: #c1ddf0; |
| 265 | border-top: 1px solid #ebebeb !important; | 271 | border-top: 1px solid #ebebeb !important; |
| 272 | + color: #444; | ||
| 266 | } | 273 | } |
| 267 | 274 | ||
| 268 | .tl-qrlb { | 275 | .tl-qrlb { |
| @@ -277,6 +284,7 @@ span.fcsj-diff { | @@ -277,6 +284,7 @@ span.fcsj-diff { | ||
| 277 | 284 | ||
| 278 | .tl-zzzx { | 285 | .tl-zzzx { |
| 279 | background: #96F396; | 286 | background: #96F396; |
| 287 | + color: #444; | ||
| 280 | } | 288 | } |
| 281 | 289 | ||
| 282 | .ct_table>.ct_table_body dl:hover dd.tl-yzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-yzx, .ct_table>.ct_table_body dl:hover dd.tl-zzzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-zzzx { | 290 | .ct_table>.ct_table_body dl:hover dd.tl-yzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-yzx, .ct_table>.ct_table_body dl:hover dd.tl-zzzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-zzzx { |
| @@ -901,4 +909,107 @@ input.i-cbox[type=checkbox]{ | @@ -901,4 +909,107 @@ input.i-cbox[type=checkbox]{ | ||
| 901 | .uk-modal-footer .ct-footer-left a{ | 909 | .uk-modal-footer .ct-footer-left a{ |
| 902 | color: #6e6b6b; | 910 | color: #6e6b6b; |
| 903 | margin-right: 5px; | 911 | margin-right: 5px; |
| 912 | +} | ||
| 913 | + | ||
| 914 | +.fixed_legend{ | ||
| 915 | + font-size: 12px; | ||
| 916 | + display: none; | ||
| 917 | + height: 28px; | ||
| 918 | + border-radius: 4px; | ||
| 919 | + background: #efeeee; | ||
| 920 | + padding-bottom: .5px; | ||
| 921 | + margin-left: 10px; | ||
| 922 | + padding-right: 8px; | ||
| 923 | +} | ||
| 924 | +.fixed_legend>div{ | ||
| 925 | + height: 100%; | ||
| 926 | +} | ||
| 927 | +.fixed_legend span{ | ||
| 928 | + padding: 4px 4px; | ||
| 929 | + border-radius: 2px; | ||
| 930 | + margin-right: 5px; | ||
| 931 | + font-size: 12px; | ||
| 932 | +} | ||
| 933 | + | ||
| 934 | +.fixed_legend span:last-child{ | ||
| 935 | + margin-right: 0px; | ||
| 936 | +} | ||
| 937 | + | ||
| 938 | +/*.fixed_legend i{ | ||
| 939 | + font-size: 16px; | ||
| 940 | + vertical-align: middle; | ||
| 941 | + margin: -3px 3px 0 0; | ||
| 942 | +}*/ | ||
| 943 | + | ||
| 944 | +.fixed_legend .tl-qrlb::before{ | ||
| 945 | + font-size: 12px; | ||
| 946 | +} | ||
| 947 | + | ||
| 948 | +.schedule-body .ct_table dl.dl-last-sch{ | ||
| 949 | + height: 55px; | ||
| 950 | +} | ||
| 951 | + | ||
| 952 | +.schedule-body .ct_table dl.dl-last-sch dd{ | ||
| 953 | + line-height: 55px; | ||
| 954 | +} | ||
| 955 | + | ||
| 956 | +.schedule-body .ct_table dl.dl-last-sch dd.fcsjActualCell{ | ||
| 957 | + line-height: 28px; | ||
| 958 | +} | ||
| 959 | + | ||
| 960 | +dd.fcsjActualCell div.last-sch-sunken{ | ||
| 961 | + height: 25px; | ||
| 962 | + line-height: 25px; | ||
| 963 | + margin: 0; | ||
| 964 | + background: #fff; | ||
| 965 | + /*border-top: 1px solid #eeeeee;*/ | ||
| 966 | +} | ||
| 967 | + | ||
| 968 | +dd.fcsjActualCell div.last-sch-sunken span._badge{ | ||
| 969 | + font-size: 12px; | ||
| 970 | + border-radius: 0 7px 7px 0; | ||
| 971 | + padding-left: 0; | ||
| 972 | + width: 29px; | ||
| 973 | + display: inline-block; | ||
| 974 | + height: 18px; | ||
| 975 | + line-height: 18px; | ||
| 976 | + box-shadow: 2px 0px 2px 0 rgba(0,0,0,0.16), 2px 0px 4px 0 rgba(0,0,0,0.12); | ||
| 977 | + vertical-align: top; | ||
| 978 | + margin-right: 3px; | ||
| 979 | + margin-top: 3px; | ||
| 980 | + margin-left: -7px; | ||
| 981 | + text-indent: 2px; | ||
| 982 | + border-left: 0; | ||
| 983 | + transform: scale(.9); | ||
| 984 | + color: grey; | ||
| 985 | +} | ||
| 986 | + | ||
| 987 | +.relevance-active dd.fcsjActualCell div.last-sch-sunken{ | ||
| 988 | + background: #f1efef; | ||
| 989 | +} | ||
| 990 | + | ||
| 991 | +.intimity.relevance-active dd.fcsjActualCell div.last-sch-sunken{ | ||
| 992 | + background: #76a6c7 !important; | ||
| 993 | + border-top: 1px solid #f7f8f8 !important; | ||
| 994 | + color: #f8f8f8; | ||
| 995 | +} | ||
| 996 | + | ||
| 997 | +.intimity.relevance-active dd.fcsjActualCell div.last-sch-sunken span._badge{ | ||
| 998 | + background: #76a6c7 ; | ||
| 999 | + color: #ffffff ; | ||
| 1000 | +} | ||
| 1001 | + | ||
| 1002 | +.drag-active dd.fcsjActualCell div.last-sch-sunken{ | ||
| 1003 | + background: #cef9e3 !important; | ||
| 1004 | + border-top: 1px solid #d9e6e0 !important; | ||
| 1005 | +} | ||
| 1006 | + | ||
| 1007 | +.drag-active dd.fcsjActualCell div.last-sch-sunken span._badge{ | ||
| 1008 | + color: #6e6969; | ||
| 1009 | + background: #cef9e3; | ||
| 1010 | +} | ||
| 1011 | + | ||
| 1012 | +.ct_table>.ct_table_body dl.dl-last-sch:hover div.last-sch-sunken, | ||
| 1013 | +.ct_table>.ct_table_body dl.dl-last-sch.context-menu-active div.last-sch-sunken{ | ||
| 1014 | + background: #f5fbff; | ||
| 904 | } | 1015 | } |
| 905 | \ No newline at end of file | 1016 | \ No newline at end of file |
src/main/resources/static/real_control_v2/css/main.css
| @@ -369,4 +369,32 @@ li.map-panel{ | @@ -369,4 +369,32 @@ li.map-panel{ | ||
| 369 | .ct-bottom-drawer-body{ | 369 | .ct-bottom-drawer-body{ |
| 370 | width: 100%; | 370 | width: 100%; |
| 371 | height: 100%; | 371 | height: 100%; |
| 372 | +} | ||
| 373 | + | ||
| 374 | +#station_route_spacing_chart_drawer .svg_wrap{ | ||
| 375 | + width: 80%;height: 100%;display: inline-block;font-size: 14px;overflow: hidden; | ||
| 376 | + position: relative; | ||
| 377 | +} | ||
| 378 | + | ||
| 379 | +#station_route_spacing_chart_drawer .drawer_right_map{ | ||
| 380 | + width: 20%;height: 100%;display: inline-block; | ||
| 381 | +} | ||
| 382 | + | ||
| 383 | +#station_route_spacing_chart_drawer .svg_cont_body{ | ||
| 384 | + height:100%; | ||
| 385 | + position: absolute; | ||
| 386 | + top:0; | ||
| 387 | + left: 0; | ||
| 388 | +} | ||
| 389 | + | ||
| 390 | +#station_route_spacing_chart_drawer svg{ | ||
| 391 | + width: 100%; | ||
| 392 | + height: 100%; | ||
| 393 | +} | ||
| 394 | + | ||
| 395 | +#station_route_spacing_chart_drawer svg g._item rect{ | ||
| 396 | + stroke: rgb(62, 80, 179); | ||
| 397 | + fill: rgb(62, 80, 179); | ||
| 398 | + width: 30px; | ||
| 399 | + height: 140px; | ||
| 372 | } | 400 | } |
| 373 | \ No newline at end of file | 401 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_inpark.html
| 1 | -<div class="uk-modal" id="add-sub-task-inpark-modal"> | ||
| 2 | - <div class="uk-modal-dialog"> | ||
| 3 | - <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | - <div class="uk-modal-header"> | ||
| 5 | - <h2>回场子任务</h2></div> | ||
| 6 | - | ||
| 7 | - <div style="width: 100%;padding-left: 1%;"> | ||
| 8 | - <div class="sub-task-card"> | ||
| 9 | - <div class="uk-panel uk-panel-box uk-panel-box-primary"> | ||
| 10 | - <div class="uk-panel-badge uk-badge">营运</div> | ||
| 11 | - <h3 class="uk-panel-title">线路上站点间</h3> | ||
| 12 | - <form class="uk-form uk-form-horizontal" service_form> | ||
| 13 | - <div class="uk-grid"> | ||
| 14 | - <div class="uk-width-3-10"> | ||
| 15 | - <div class="uk-form-row"> | ||
| 16 | - <label class="uk-form-label">起点 </label> | ||
| 17 | - </div> | ||
| 18 | - </div> | ||
| 19 | - <div class="uk-width-7-10 pl5"> | ||
| 20 | - <select name="startStation" disabled></select> | ||
| 21 | - </div> | ||
| 22 | - </div> | ||
| 23 | - <div class="uk-grid"> | ||
| 24 | - <div class="uk-width-3-10"> | ||
| 25 | - <div class="uk-form-row"> | ||
| 26 | - <label class="uk-form-label">终点 </label> | ||
| 27 | - </div> | ||
| 28 | - </div> | ||
| 29 | - <div class="uk-width-7-10 pl5"> | ||
| 30 | - <select name="endStation" class="ct_focus"></select> | ||
| 31 | - </div> | ||
| 32 | - </div> | ||
| 33 | - <div class="uk-grid"> | ||
| 34 | - <div class="uk-width-3-10"> | ||
| 35 | - <div class="uk-form-row"> | ||
| 36 | - <label class="uk-form-label">营运里程</label> | ||
| 37 | - </div> | ||
| 38 | - </div> | ||
| 39 | - <div class="uk-width-7-10 pl5"> | ||
| 40 | - <input type="text" name="mileageType" required> | ||
| 41 | - </div> | ||
| 42 | - </div> | ||
| 43 | - <div class="uk-grid"> | ||
| 44 | - <div class="uk-width-3-10"> | ||
| 45 | - <div class="uk-form-row"> | ||
| 46 | - <label class="uk-form-label">开始时间</label> | ||
| 47 | - </div> | ||
| 48 | - </div> | ||
| 49 | - <div class="uk-width-7-10 pl5"> | ||
| 50 | - <input type="time" name="startDate" required> | ||
| 51 | - </div> | ||
| 52 | - </div> | ||
| 53 | - <div class="uk-grid"> | ||
| 54 | - <div class="uk-width-3-10"> | ||
| 55 | - <div class="uk-form-row"> | ||
| 56 | - <label class="uk-form-label">结束时间</label> | ||
| 57 | - </div> | ||
| 58 | - </div> | ||
| 59 | - <div class="uk-width-7-10 pl5"> | ||
| 60 | - <input type="time" name="endDate" required> | ||
| 61 | - </div> | ||
| 62 | - </div> | ||
| 63 | - </form> | ||
| 64 | - </div> | ||
| 65 | - </div> | ||
| 66 | - <div class="sub-task-card"> | ||
| 67 | - <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | ||
| 68 | - <div class="uk-panel-badge uk-badge uk-badge-default">空驶</div> | ||
| 69 | - <h3 class="uk-panel-title">进场</h3> | ||
| 70 | - <form class="uk-form uk-form-horizontal" empty_form> | ||
| 71 | - <div class="uk-grid"> | ||
| 72 | - <div class="uk-width-3-10"> | ||
| 73 | - <div class="uk-form-row"> | ||
| 74 | - <label class="uk-form-label">起点 </label> | ||
| 75 | - </div> | ||
| 76 | - </div> | ||
| 77 | - <div class="uk-width-7-10 pl5"> | ||
| 78 | - <select name="startStation" disabled></select> | ||
| 79 | - </div> | ||
| 80 | - </div> | ||
| 81 | - <div class="uk-grid"> | ||
| 82 | - <div class="uk-width-3-10"> | ||
| 83 | - <div class="uk-form-row"> | ||
| 84 | - <label class="uk-form-label">终点 </label> | ||
| 85 | - </div> | ||
| 86 | - </div> | ||
| 87 | - <div class="uk-width-7-10 pl5"> | ||
| 88 | - <select name="endStation" class="ct_focus"></select> | ||
| 89 | - </div> | ||
| 90 | - </div> | ||
| 91 | - <div class="uk-grid"> | ||
| 92 | - <div class="uk-width-3-10"> | ||
| 93 | - <div class="uk-form-row"> | ||
| 94 | - <label class="uk-form-label">空驶里程</label> | ||
| 95 | - </div> | ||
| 96 | - </div> | ||
| 97 | - <div class="uk-width-7-10 pl5"> | ||
| 98 | - <input type="text" name="mileageType" required style="width: calc(100% - 62px);"> | ||
| 99 | - <a style="font-size: 12px;">路径(3)</a> | ||
| 100 | - </div> | ||
| 101 | - </div> | ||
| 102 | - <div class="uk-grid"> | ||
| 103 | - <div class="uk-width-3-10"> | ||
| 104 | - <div class="uk-form-row"> | ||
| 105 | - <label class="uk-form-label">开始时间</label> | ||
| 106 | - </div> | ||
| 107 | - </div> | ||
| 108 | - <div class="uk-width-7-10 pl5"> | ||
| 109 | - <input type="time" name="startDate" required> | ||
| 110 | - </div> | ||
| 111 | - </div> | ||
| 112 | - <div class="uk-grid"> | ||
| 113 | - <div class="uk-width-3-10"> | ||
| 114 | - <div class="uk-form-row"> | ||
| 115 | - <label class="uk-form-label">结束时间</label> | ||
| 116 | - </div> | ||
| 117 | - </div> | ||
| 118 | - <div class="uk-width-7-10 pl5"> | ||
| 119 | - <input type="time" name="endDate" required> | ||
| 120 | - </div> | ||
| 121 | - </div> | ||
| 122 | - </form> | ||
| 123 | - </div> | ||
| 124 | - </div> | ||
| 125 | - <div class="sub-task-card destroy-card uk-animation-scale"> | ||
| 126 | - <div class="uk-panel uk-panel-box uk-panel-box-danger"> | ||
| 127 | - <div class="uk-panel-badge uk-badge uk-badge-danger">烂班</div> | ||
| 128 | - <h3 class="uk-panel-title">线路上站点间</h3> | ||
| 129 | - <form class="uk-form uk-form-horizontal" destroy_form> | ||
| 130 | - <div class="uk-grid"> | ||
| 131 | - <div class="uk-width-3-10"> | ||
| 132 | - <div class="uk-form-row"> | ||
| 133 | - <label class="uk-form-label">起点 </label> | ||
| 134 | - </div> | ||
| 135 | - </div> | ||
| 136 | - <div class="uk-width-7-10 pl5"> | ||
| 137 | - <select name="startStation" disabled></select> | ||
| 138 | - </div> | ||
| 139 | - </div> | ||
| 140 | - <div class="uk-grid"> | ||
| 141 | - <div class="uk-width-3-10"> | ||
| 142 | - <div class="uk-form-row"> | ||
| 143 | - <label class="uk-form-label">终点 </label> | ||
| 144 | - </div> | ||
| 145 | - </div> | ||
| 146 | - <div class="uk-width-7-10 pl5"> | ||
| 147 | - <select name="endStation" class="ct_focus" disabled></select> | ||
| 148 | - </div> | ||
| 149 | - </div> | ||
| 150 | - <div class="uk-grid"> | ||
| 151 | - <div class="uk-width-3-10"> | ||
| 152 | - <div class="uk-form-row"> | ||
| 153 | - <label class="uk-form-label">烂班里程</label> | ||
| 154 | - </div> | ||
| 155 | - </div> | ||
| 156 | - <div class="uk-width-7-10 pl5"> | ||
| 157 | - <input type="text" name="mileageType" required> | ||
| 158 | - </div> | ||
| 159 | - </div> | ||
| 160 | - <div class="uk-grid"> | ||
| 161 | - <div class="uk-width-3-10"> | ||
| 162 | - <div class="uk-form-row"> | ||
| 163 | - <label class="uk-form-label">开始时间</label> | ||
| 164 | - </div> | ||
| 165 | - </div> | ||
| 166 | - <div class="uk-width-7-10 pl5"> | ||
| 167 | - <input type="time" name="startDate" required> | ||
| 168 | - </div> | ||
| 169 | - </div> | ||
| 170 | - <div class="uk-grid"> | ||
| 171 | - <div class="uk-width-3-10"> | ||
| 172 | - <div class="uk-form-row"> | ||
| 173 | - <label class="uk-form-label">烂班原因</label> | ||
| 174 | - </div> | ||
| 175 | - </div> | ||
| 176 | - <div class="uk-width-7-10 pl5"> | ||
| 177 | - <select name="destroyReason" required></select> | ||
| 178 | - </div> | ||
| 179 | - </div> | ||
| 180 | - </form> | ||
| 181 | - </div> | ||
| 182 | - </div> | ||
| 183 | - | ||
| 184 | - <form class="uk-form" style="margin-top: 15px; padding: 0 10px 0 0;"> | ||
| 185 | - <textarea placeholder="备注" style="width: 100%;height: 70px;"></textarea> | ||
| 186 | - </form> | ||
| 187 | - </div> | ||
| 188 | - | ||
| 189 | - <div class="uk-modal-footer uk-text-right"> | ||
| 190 | - <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 191 | - <button type="button" class="uk-button uk-button-primary">提交子任务</button> | ||
| 192 | - | ||
| 193 | - <div class="ct-footer-left"> | ||
| 194 | - <a id="betweenStationRangeCalc" data-drawer-id="station_route_spacing_chart_drawer">站点间公里不准?</a> | ||
| 195 | - </div> | ||
| 196 | - </div> | ||
| 197 | - </div> | ||
| 198 | - | ||
| 199 | - <div class="ct-bottom-drawer"> | ||
| 200 | - <a class="ct-bottom-drawer-close"></a> | ||
| 201 | - | ||
| 202 | - <div class="ct-bottom-drawer-body"></div> | ||
| 203 | - </div> | ||
| 204 | - | ||
| 205 | - <script id="sub-task-inpark-form-temp" type="text/html"> | ||
| 206 | - </script> | ||
| 207 | - | ||
| 208 | - <script> | ||
| 209 | - (function () { | ||
| 210 | - var modal = '#add-sub-task-inpark-modal', | ||
| 211 | - serviceForm = $('form[service_form]', modal), | ||
| 212 | - emptyForm = $('form[empty_form]', modal), | ||
| 213 | - destroyForm = $('form[destroy_form]', modal), | ||
| 214 | - sch, stationRoutes, parks, information, esCode, timeLocStations; | ||
| 215 | - var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; | ||
| 216 | - $(modal).on('init', function (e, data) { | ||
| 217 | - sch = data.sch; | ||
| 218 | - //var formHtml = template('sub-task-inpark-form-temp', {sch:sch, adjustExps: adjustExps}); | ||
| 219 | - //$('form', modal).html(formHtml); | ||
| 220 | - //字典转换 | ||
| 221 | - //dictionaryUtils.transformDom($('.nt-dictionary', modal)); | ||
| 222 | - | ||
| 223 | - //站点路由 | ||
| 224 | - stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | ||
| 225 | - return a.stationRouteCode - b.stationRouteCode; | ||
| 226 | - }), 'directions')[sch.xlDir]; | ||
| 227 | - //空驶终点(停车场) | ||
| 228 | - $.get('/basic/parks', function (rs) { | ||
| 229 | - parks = rs; | ||
| 230 | - var opts = ''; | ||
| 231 | - for (var code in parks) { | ||
| 232 | - opts += '<option value="' + code + '">' + parks[code] + '</option>'; | ||
| 233 | - } | ||
| 234 | - $('select[name=endStation]', emptyForm).html(opts).val(information.carPark); | ||
| 235 | - }); | ||
| 236 | - //线路标准 | ||
| 237 | - information = gb_data_basic.getLineInformation(sch.xlBm); | ||
| 238 | - //本地存储的站点耗时 | ||
| 239 | - try { | ||
| 240 | - timeLocStations = window.localStorage.getItem('control_route_distance_' + sch.xlBm); | ||
| 241 | - if (timeLocStations) | ||
| 242 | - timeLocStations = JSON.parse(timeLocStations).stations[sch.xlDir == 0 ? 'up' : 'down']; | ||
| 243 | - } catch (e) { | ||
| 244 | - console.log(e); | ||
| 245 | - } | ||
| 246 | - | ||
| 247 | - //设置默认值 | ||
| 248 | - setDefaultVal(); | ||
| 249 | - | ||
| 250 | - //切换营运终点 | ||
| 251 | - $('select[name=endStation]', serviceForm).val(esCode).on('change', function () { | ||
| 252 | - var val = $(this).val(); | ||
| 253 | - if (val == esCode) { | ||
| 254 | - $('.uk-modal-dialog', modal).removeClass('three-children'); | ||
| 255 | - $('.sub-task-card.destroy-card').css("display", "none"); | ||
| 256 | - } | ||
| 257 | - else { | ||
| 258 | - $('.uk-modal-dialog', modal).addClass('three-children'); | ||
| 259 | - $('.sub-task-card.destroy-card').css("display", "inline-block"); | ||
| 260 | - } | ||
| 261 | - | ||
| 262 | - reClac(); | ||
| 263 | - }).trigger('change'); | ||
| 264 | - | ||
| 265 | - | ||
| 266 | - //submit | ||
| 267 | - /*var f = $('form', modal).formValidation({ | ||
| 268 | - framework: 'uikit', | ||
| 269 | - locale: 'zh_CN', | ||
| 270 | - }); | ||
| 271 | - f.on('success.form.fv', function(e) { | ||
| 272 | - disabled_submit_btn(this); | ||
| 273 | - e.preventDefault(); | ||
| 274 | - var data = $(this).serializeJSON(); | ||
| 275 | - | ||
| 276 | - });*/ | ||
| 277 | - }); | ||
| 278 | - | ||
| 279 | - function setDefaultVal() { | ||
| 280 | - var routeOpts = ''; | ||
| 281 | - $.each(stationRoutes, function () { | ||
| 282 | - routeOpts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>'; | ||
| 283 | - }); | ||
| 284 | - esCode = stationRoutes[stationRoutes.length - 1].stationCode; | ||
| 285 | - | ||
| 286 | - //营运起终点 | ||
| 287 | - $('select[name=startStation],select[name=endStation]', serviceForm).html(routeOpts); | ||
| 288 | - //空驶起点 | ||
| 289 | - $('select[name=startStation]', emptyForm).html(routeOpts).val(esCode); | ||
| 290 | - //烂班起终点 | ||
| 291 | - $('select[name=startStation],select[name=endStation]', destroyForm).html(routeOpts).val(esCode); | ||
| 292 | - | ||
| 293 | - //烂班原因 | ||
| 294 | - var adjustExpsOpts = '<option value="">请选择...</option>'; | ||
| 295 | - $.each(adjustExps, function (i, str) { | ||
| 296 | - adjustExpsOpts += '<option value="' + str + '">' + str + '</option>'; | ||
| 297 | - }); | ||
| 298 | - $('select[name=destroyReason]', destroyForm).html(adjustExpsOpts); | ||
| 299 | - | ||
| 300 | - //营运开始时间 | ||
| 301 | - $('input[name=startDate]', serviceForm).val(sch.dfsj); | ||
| 302 | - } | ||
| 303 | - | ||
| 304 | - function reClac() { | ||
| 305 | - var serviceEnd = $('select[name=endStation]', serviceForm).val(); | ||
| 306 | - //空驶起点 == 营运终点 | ||
| 307 | - $('select[name=startStation]', emptyForm).val(serviceEnd); | ||
| 308 | - | ||
| 309 | - //计算营运里程 | ||
| 310 | - var s = $('select[name=startStation]', serviceForm).val(), | ||
| 311 | - e = $('select[name=endStation]', serviceForm).val(); | ||
| 312 | - var sMileage = calcMileage(s, e); | ||
| 313 | - if(sMileage >= 0) | ||
| 314 | - $('input[name=mileageType]', serviceForm).val(sMileage); | ||
| 315 | - | ||
| 316 | - if (serviceEnd != esCode) { | ||
| 317 | - //烂班起点 == 营运终点 | ||
| 318 | - $('select[name=startStation]', destroyForm).val(serviceEnd); | ||
| 319 | - } | ||
| 320 | - } | ||
| 321 | - | ||
| 322 | - function calcMileage(s, e) { | ||
| 323 | - var mileage = 0, flag, code; | ||
| 324 | - if (timeLocStations) { | ||
| 325 | - $.each(timeLocStations, function () { | ||
| 326 | - code = this.station.STATION_CODE; | ||
| 327 | - if (code == s) { | ||
| 328 | - flag = true; | ||
| 329 | - } | ||
| 330 | - | ||
| 331 | - if (flag) | ||
| 332 | - mileage += this.toDistance; | ||
| 333 | - | ||
| 334 | - if (code == e) | ||
| 335 | - return false; | ||
| 336 | - }); | ||
| 337 | - } | ||
| 338 | - return mileage / 1000; | ||
| 339 | - } | ||
| 340 | - | ||
| 341 | - | ||
| 342 | - //------ 下抽屉 ------ | ||
| 343 | - $('#betweenStationRangeCalc', modal).on('click', function () { | ||
| 344 | - var id = $(this).data('drawer-id'); | ||
| 345 | - switchBtmDrawer(id, '/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html'); | ||
| 346 | - }); | ||
| 347 | - | ||
| 348 | - var btmDrawer = $('.ct-bottom-drawer', modal); | ||
| 349 | - //打开事件 | ||
| 350 | - btmDrawer.on('drawer_show', function () { | ||
| 351 | - var url = $(this).data('url'); | ||
| 352 | - if (!url) { | ||
| 353 | - alert('无效的地址'); | ||
| 354 | - } | ||
| 355 | - | ||
| 356 | - var drawerPanel = $(this).data('name'); | ||
| 357 | - $('.ct-bottom-drawer-body', btmDrawer).load(url, function () { | ||
| 358 | - $('#' + drawerPanel).trigger('drawer-init', {sch: sch}); | ||
| 359 | - }); | ||
| 360 | - }); | ||
| 361 | - | ||
| 362 | - function switchBtmDrawer(id, url) { | ||
| 363 | - if (btmDrawer.hasClass('open') && btmDrawer.data('name') == id) { | ||
| 364 | - btmDrawer.removeClass('open'); | ||
| 365 | - btmDrawer.removeData('name').removeData('url'); | ||
| 366 | - } | ||
| 367 | - else { | ||
| 368 | - btmDrawer.addClass('open'); | ||
| 369 | - btmDrawer.data('name', id).data('url', url).trigger('drawer_show'); | ||
| 370 | - } | ||
| 371 | - } | ||
| 372 | - })(); | ||
| 373 | - </script> | 1 | +<div class="uk-modal" id="add-sub-task-inpark-modal"> |
| 2 | + <div class="uk-modal-dialog"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>回场子任务</h2></div> | ||
| 6 | + | ||
| 7 | + <div style="width: 100%;padding-left: 1%;"> | ||
| 8 | + <div class="sub-task-card"> | ||
| 9 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | ||
| 10 | + <div class="uk-panel-badge uk-badge">营运</div> | ||
| 11 | + <h3 class="uk-panel-title">线路上站点间</h3> | ||
| 12 | + <form class="uk-form uk-form-horizontal" service_form> | ||
| 13 | + <div class="uk-grid"> | ||
| 14 | + <div class="uk-width-3-10"> | ||
| 15 | + <div class="uk-form-row"> | ||
| 16 | + <label class="uk-form-label">起点 </label> | ||
| 17 | + </div> | ||
| 18 | + </div> | ||
| 19 | + <div class="uk-width-7-10 pl5"> | ||
| 20 | + <select name="startStation" disabled></select> | ||
| 21 | + </div> | ||
| 22 | + </div> | ||
| 23 | + <div class="uk-grid"> | ||
| 24 | + <div class="uk-width-3-10"> | ||
| 25 | + <div class="uk-form-row"> | ||
| 26 | + <label class="uk-form-label">终点 </label> | ||
| 27 | + </div> | ||
| 28 | + </div> | ||
| 29 | + <div class="uk-width-7-10 pl5"> | ||
| 30 | + <select name="endStation" class="ct_focus"></select> | ||
| 31 | + </div> | ||
| 32 | + </div> | ||
| 33 | + <div class="uk-grid"> | ||
| 34 | + <div class="uk-width-3-10"> | ||
| 35 | + <div class="uk-form-row"> | ||
| 36 | + <label class="uk-form-label">营运里程</label> | ||
| 37 | + </div> | ||
| 38 | + </div> | ||
| 39 | + <div class="uk-width-7-10 pl5"> | ||
| 40 | + <input type="text" name="mileageType" required> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + <div class="uk-grid"> | ||
| 44 | + <div class="uk-width-3-10"> | ||
| 45 | + <div class="uk-form-row"> | ||
| 46 | + <label class="uk-form-label">开始时间</label> | ||
| 47 | + </div> | ||
| 48 | + </div> | ||
| 49 | + <div class="uk-width-7-10 pl5"> | ||
| 50 | + <input type="time" name="startDate" required> | ||
| 51 | + </div> | ||
| 52 | + </div> | ||
| 53 | + <div class="uk-grid"> | ||
| 54 | + <div class="uk-width-3-10"> | ||
| 55 | + <div class="uk-form-row"> | ||
| 56 | + <label class="uk-form-label">结束时间</label> | ||
| 57 | + </div> | ||
| 58 | + </div> | ||
| 59 | + <div class="uk-width-7-10 pl5"> | ||
| 60 | + <input type="time" name="endDate" required> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | + </form> | ||
| 64 | + </div> | ||
| 65 | + </div> | ||
| 66 | + <div class="sub-task-card"> | ||
| 67 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | ||
| 68 | + <div class="uk-panel-badge uk-badge uk-badge-default">空驶</div> | ||
| 69 | + <h3 class="uk-panel-title">进场</h3> | ||
| 70 | + <form class="uk-form uk-form-horizontal" empty_form> | ||
| 71 | + <div class="uk-grid"> | ||
| 72 | + <div class="uk-width-3-10"> | ||
| 73 | + <div class="uk-form-row"> | ||
| 74 | + <label class="uk-form-label">起点 </label> | ||
| 75 | + </div> | ||
| 76 | + </div> | ||
| 77 | + <div class="uk-width-7-10 pl5"> | ||
| 78 | + <select name="startStation" disabled></select> | ||
| 79 | + </div> | ||
| 80 | + </div> | ||
| 81 | + <div class="uk-grid"> | ||
| 82 | + <div class="uk-width-3-10"> | ||
| 83 | + <div class="uk-form-row"> | ||
| 84 | + <label class="uk-form-label">终点 </label> | ||
| 85 | + </div> | ||
| 86 | + </div> | ||
| 87 | + <div class="uk-width-7-10 pl5"> | ||
| 88 | + <select name="endStation" class="ct_focus"></select> | ||
| 89 | + </div> | ||
| 90 | + </div> | ||
| 91 | + <div class="uk-grid"> | ||
| 92 | + <div class="uk-width-3-10"> | ||
| 93 | + <div class="uk-form-row"> | ||
| 94 | + <label class="uk-form-label">空驶里程</label> | ||
| 95 | + </div> | ||
| 96 | + </div> | ||
| 97 | + <div class="uk-width-7-10 pl5"> | ||
| 98 | + <input type="text" name="mileageType" required style="width: calc(100% - 62px);"> | ||
| 99 | + <a style="font-size: 12px;">路径(3)</a> | ||
| 100 | + </div> | ||
| 101 | + </div> | ||
| 102 | + <div class="uk-grid"> | ||
| 103 | + <div class="uk-width-3-10"> | ||
| 104 | + <div class="uk-form-row"> | ||
| 105 | + <label class="uk-form-label">开始时间</label> | ||
| 106 | + </div> | ||
| 107 | + </div> | ||
| 108 | + <div class="uk-width-7-10 pl5"> | ||
| 109 | + <input type="time" name="startDate" required> | ||
| 110 | + </div> | ||
| 111 | + </div> | ||
| 112 | + <div class="uk-grid"> | ||
| 113 | + <div class="uk-width-3-10"> | ||
| 114 | + <div class="uk-form-row"> | ||
| 115 | + <label class="uk-form-label">结束时间</label> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + <div class="uk-width-7-10 pl5"> | ||
| 119 | + <input type="time" name="endDate" required> | ||
| 120 | + </div> | ||
| 121 | + </div> | ||
| 122 | + </form> | ||
| 123 | + </div> | ||
| 124 | + </div> | ||
| 125 | + <div class="sub-task-card destroy-card uk-animation-scale"> | ||
| 126 | + <div class="uk-panel uk-panel-box uk-panel-box-danger"> | ||
| 127 | + <div class="uk-panel-badge uk-badge uk-badge-danger">烂班</div> | ||
| 128 | + <h3 class="uk-panel-title">线路上站点间</h3> | ||
| 129 | + <form class="uk-form uk-form-horizontal" destroy_form> | ||
| 130 | + <div class="uk-grid"> | ||
| 131 | + <div class="uk-width-3-10"> | ||
| 132 | + <div class="uk-form-row"> | ||
| 133 | + <label class="uk-form-label">起点 </label> | ||
| 134 | + </div> | ||
| 135 | + </div> | ||
| 136 | + <div class="uk-width-7-10 pl5"> | ||
| 137 | + <select name="startStation" disabled></select> | ||
| 138 | + </div> | ||
| 139 | + </div> | ||
| 140 | + <div class="uk-grid"> | ||
| 141 | + <div class="uk-width-3-10"> | ||
| 142 | + <div class="uk-form-row"> | ||
| 143 | + <label class="uk-form-label">终点 </label> | ||
| 144 | + </div> | ||
| 145 | + </div> | ||
| 146 | + <div class="uk-width-7-10 pl5"> | ||
| 147 | + <select name="endStation" class="ct_focus" disabled></select> | ||
| 148 | + </div> | ||
| 149 | + </div> | ||
| 150 | + <div class="uk-grid"> | ||
| 151 | + <div class="uk-width-3-10"> | ||
| 152 | + <div class="uk-form-row"> | ||
| 153 | + <label class="uk-form-label">烂班里程</label> | ||
| 154 | + </div> | ||
| 155 | + </div> | ||
| 156 | + <div class="uk-width-7-10 pl5"> | ||
| 157 | + <input type="text" name="mileageType" required> | ||
| 158 | + </div> | ||
| 159 | + </div> | ||
| 160 | + <div class="uk-grid"> | ||
| 161 | + <div class="uk-width-3-10"> | ||
| 162 | + <div class="uk-form-row"> | ||
| 163 | + <label class="uk-form-label">开始时间</label> | ||
| 164 | + </div> | ||
| 165 | + </div> | ||
| 166 | + <div class="uk-width-7-10 pl5"> | ||
| 167 | + <input type="time" name="startDate" required> | ||
| 168 | + </div> | ||
| 169 | + </div> | ||
| 170 | + <div class="uk-grid"> | ||
| 171 | + <div class="uk-width-3-10"> | ||
| 172 | + <div class="uk-form-row"> | ||
| 173 | + <label class="uk-form-label">烂班原因</label> | ||
| 174 | + </div> | ||
| 175 | + </div> | ||
| 176 | + <div class="uk-width-7-10 pl5"> | ||
| 177 | + <select name="destroyReason" required></select> | ||
| 178 | + </div> | ||
| 179 | + </div> | ||
| 180 | + </form> | ||
| 181 | + </div> | ||
| 182 | + </div> | ||
| 183 | + | ||
| 184 | + <form class="uk-form" style="margin-top: 15px; padding: 0 10px 0 0;"> | ||
| 185 | + <textarea placeholder="备注" style="width: 100%;height: 70px;"></textarea> | ||
| 186 | + </form> | ||
| 187 | + </div> | ||
| 188 | + | ||
| 189 | + <div class="uk-modal-footer uk-text-right"> | ||
| 190 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 191 | + <button type="button" class="uk-button uk-button-primary">提交子任务</button> | ||
| 192 | + | ||
| 193 | + <div class="ct-footer-left"> | ||
| 194 | + <a id="betweenStationRangeCalc" data-drawer-id="station_route_spacing_chart_drawer">站点间公里不准?</a> | ||
| 195 | + </div> | ||
| 196 | + </div> | ||
| 197 | + </div> | ||
| 198 | + | ||
| 199 | + <div class="ct-bottom-drawer"> | ||
| 200 | + <a class="ct-bottom-drawer-close"></a> | ||
| 201 | + | ||
| 202 | + <div class="ct-bottom-drawer-body"></div> | ||
| 203 | + </div> | ||
| 204 | + | ||
| 205 | + <script id="sub-task-inpark-form-temp" type="text/html"> | ||
| 206 | + </script> | ||
| 207 | + | ||
| 208 | + <script> | ||
| 209 | + (function () { | ||
| 210 | + var modal = '#add-sub-task-inpark-modal', | ||
| 211 | + serviceForm = $('form[service_form]', modal), | ||
| 212 | + emptyForm = $('form[empty_form]', modal), | ||
| 213 | + destroyForm = $('form[destroy_form]', modal), | ||
| 214 | + sch, stationRoutes, parks, information, esCode, timeLocStations; | ||
| 215 | + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; | ||
| 216 | + $(modal).on('init', function (e, data) { | ||
| 217 | + sch = data.sch; | ||
| 218 | + //var formHtml = template('sub-task-inpark-form-temp', {sch:sch, adjustExps: adjustExps}); | ||
| 219 | + //$('form', modal).html(formHtml); | ||
| 220 | + //字典转换 | ||
| 221 | + //dictionaryUtils.transformDom($('.nt-dictionary', modal)); | ||
| 222 | + | ||
| 223 | + //站点路由 | ||
| 224 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | ||
| 225 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 226 | + }), 'directions')[sch.xlDir]; | ||
| 227 | + //空驶终点(停车场) | ||
| 228 | + $.get('/basic/parks', function (rs) { | ||
| 229 | + parks = rs; | ||
| 230 | + var opts = ''; | ||
| 231 | + for (var code in parks) { | ||
| 232 | + opts += '<option value="' + code + '">' + parks[code] + '</option>'; | ||
| 233 | + } | ||
| 234 | + $('select[name=endStation]', emptyForm).html(opts).val(information.carPark); | ||
| 235 | + }); | ||
| 236 | + //线路标准 | ||
| 237 | + information = gb_data_basic.getLineInformation(sch.xlBm); | ||
| 238 | + //本地存储的站点耗时 | ||
| 239 | + try { | ||
| 240 | + timeLocStations = window.localStorage.getItem('control_route_distance_' + sch.xlBm); | ||
| 241 | + if (timeLocStations) | ||
| 242 | + timeLocStations = JSON.parse(timeLocStations).stations[sch.xlDir == 0 ? 'up' : 'down']; | ||
| 243 | + } catch (e) { | ||
| 244 | + console.log(e); | ||
| 245 | + } | ||
| 246 | + | ||
| 247 | + //设置默认值 | ||
| 248 | + setDefaultVal(); | ||
| 249 | + | ||
| 250 | + //切换营运终点 | ||
| 251 | + $('select[name=endStation]', serviceForm).val(esCode).on('change', function () { | ||
| 252 | + var val = $(this).val(); | ||
| 253 | + if (val == esCode) { | ||
| 254 | + $('.uk-modal-dialog', modal).removeClass('three-children'); | ||
| 255 | + $('.sub-task-card.destroy-card').css("display", "none"); | ||
| 256 | + } | ||
| 257 | + else { | ||
| 258 | + $('.uk-modal-dialog', modal).addClass('three-children'); | ||
| 259 | + $('.sub-task-card.destroy-card').css("display", "inline-block"); | ||
| 260 | + } | ||
| 261 | + | ||
| 262 | + reClac(); | ||
| 263 | + }).trigger('change'); | ||
| 264 | + | ||
| 265 | + | ||
| 266 | + //submit | ||
| 267 | + /*var f = $('form', modal).formValidation({ | ||
| 268 | + framework: 'uikit', | ||
| 269 | + locale: 'zh_CN', | ||
| 270 | + }); | ||
| 271 | + f.on('success.form.fv', function(e) { | ||
| 272 | + disabled_submit_btn(this); | ||
| 273 | + e.preventDefault(); | ||
| 274 | + var data = $(this).serializeJSON(); | ||
| 275 | + | ||
| 276 | + });*/ | ||
| 277 | + }); | ||
| 278 | + | ||
| 279 | + function setDefaultVal() { | ||
| 280 | + var routeOpts = ''; | ||
| 281 | + $.each(stationRoutes, function () { | ||
| 282 | + routeOpts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>'; | ||
| 283 | + }); | ||
| 284 | + esCode = stationRoutes[stationRoutes.length - 1].stationCode; | ||
| 285 | + | ||
| 286 | + //营运起终点 | ||
| 287 | + $('select[name=startStation],select[name=endStation]', serviceForm).html(routeOpts); | ||
| 288 | + //空驶起点 | ||
| 289 | + $('select[name=startStation]', emptyForm).html(routeOpts).val(esCode); | ||
| 290 | + //烂班起终点 | ||
| 291 | + $('select[name=startStation],select[name=endStation]', destroyForm).html(routeOpts).val(esCode); | ||
| 292 | + | ||
| 293 | + //烂班原因 | ||
| 294 | + var adjustExpsOpts = '<option value="">请选择...</option>'; | ||
| 295 | + $.each(adjustExps, function (i, str) { | ||
| 296 | + adjustExpsOpts += '<option value="' + str + '">' + str + '</option>'; | ||
| 297 | + }); | ||
| 298 | + $('select[name=destroyReason]', destroyForm).html(adjustExpsOpts); | ||
| 299 | + | ||
| 300 | + //营运开始时间 | ||
| 301 | + $('input[name=startDate]', serviceForm).val(sch.dfsj); | ||
| 302 | + } | ||
| 303 | + | ||
| 304 | + function reClac() { | ||
| 305 | + var serviceEnd = $('select[name=endStation]', serviceForm).val(); | ||
| 306 | + //空驶起点 == 营运终点 | ||
| 307 | + $('select[name=startStation]', emptyForm).val(serviceEnd); | ||
| 308 | + | ||
| 309 | + //计算营运里程 | ||
| 310 | + var s = $('select[name=startStation]', serviceForm).val(), | ||
| 311 | + e = $('select[name=endStation]', serviceForm).val(); | ||
| 312 | + var sMileage = calcMileage(s, e); | ||
| 313 | + if(sMileage >= 0) | ||
| 314 | + $('input[name=mileageType]', serviceForm).val(sMileage); | ||
| 315 | + | ||
| 316 | + if (serviceEnd != esCode) { | ||
| 317 | + //烂班起点 == 营运终点 | ||
| 318 | + $('select[name=startStation]', destroyForm).val(serviceEnd); | ||
| 319 | + } | ||
| 320 | + } | ||
| 321 | + | ||
| 322 | + function calcMileage(s, e) { | ||
| 323 | + var mileage = 0, flag, code; | ||
| 324 | + if (timeLocStations) { | ||
| 325 | + $.each(timeLocStations, function () { | ||
| 326 | + code = this.station.STATION_CODE; | ||
| 327 | + if (code == s) { | ||
| 328 | + flag = true; | ||
| 329 | + } | ||
| 330 | + | ||
| 331 | + if (flag) | ||
| 332 | + mileage += this.toDistance; | ||
| 333 | + | ||
| 334 | + if (code == e) | ||
| 335 | + return false; | ||
| 336 | + }); | ||
| 337 | + } | ||
| 338 | + return mileage / 1000; | ||
| 339 | + } | ||
| 340 | + | ||
| 341 | + | ||
| 342 | + //------ 下抽屉 ------ | ||
| 343 | + $('#betweenStationRangeCalc', modal).on('click', function () { | ||
| 344 | + var id = $(this).data('drawer-id'); | ||
| 345 | + switchBtmDrawer(id, '/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html'); | ||
| 346 | + }); | ||
| 347 | + | ||
| 348 | + var btmDrawer = $('.ct-bottom-drawer', modal); | ||
| 349 | + //打开事件 | ||
| 350 | + btmDrawer.on('drawer_show', function () { | ||
| 351 | + var url = $(this).data('url'); | ||
| 352 | + if (!url) { | ||
| 353 | + alert('无效的地址'); | ||
| 354 | + } | ||
| 355 | + | ||
| 356 | + var drawerPanel = $(this).data('name'); | ||
| 357 | + $('.ct-bottom-drawer-body', btmDrawer).load(url, function () { | ||
| 358 | + $('#' + drawerPanel).trigger('drawer-init', {sch: sch}); | ||
| 359 | + }); | ||
| 360 | + }); | ||
| 361 | + | ||
| 362 | + function switchBtmDrawer(id, url) { | ||
| 363 | + if (btmDrawer.hasClass('open') && btmDrawer.data('name') == id) { | ||
| 364 | + btmDrawer.removeClass('open'); | ||
| 365 | + btmDrawer.removeData('name').removeData('url'); | ||
| 366 | + } | ||
| 367 | + else { | ||
| 368 | + btmDrawer.addClass('open'); | ||
| 369 | + btmDrawer.data('name', id).data('url', url).trigger('drawer_show'); | ||
| 370 | + } | ||
| 371 | + } | ||
| 372 | + })(); | ||
| 373 | + </script> | ||
| 374 | </div> | 374 | </div> |
| 375 | \ No newline at end of file | 375 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html
| 1 | <!-- 站点路由间距图 --> | 1 | <!-- 站点路由间距图 --> |
| 2 | <div id="station_route_spacing_chart_drawer" style="width: 100%;height: 100%;font-size: 0;"> | 2 | <div id="station_route_spacing_chart_drawer" style="width: 100%;height: 100%;font-size: 0;"> |
| 3 | - <div style="width: 80%;height: 100%;display: inline-block;font-size: 14px;"> | 3 | + <div class="svg_wrap"></div> |
| 4 | 4 | ||
| 5 | - </div> | ||
| 6 | - | ||
| 7 | - <div style="width: 20%;height: 100%;display: inline-block;"> | 5 | + <div class="drawer_right_map" > |
| 8 | 6 | ||
| 9 | </div> | 7 | </div> |
| 10 | 8 | ||
| @@ -12,10 +10,10 @@ | @@ -12,10 +10,10 @@ | ||
| 12 | 10 | ||
| 13 | (function () { | 11 | (function () { |
| 14 | var drawer = '#station_route_spacing_chart_drawer' | 12 | var drawer = '#station_route_spacing_chart_drawer' |
| 15 | - , sch, locData; | 13 | + , sch, locData, stationArr; |
| 16 | 14 | ||
| 15 | + //var xScale; | ||
| 17 | $(drawer).on('drawer-init', function (e, data) { | 16 | $(drawer).on('drawer-init', function (e, data) { |
| 18 | - //console.log('data', data); | ||
| 19 | sch = data.sch; | 17 | sch = data.sch; |
| 20 | locData = window.localStorage.getItem('control_route_distance_' + sch.xlBm); | 18 | locData = window.localStorage.getItem('control_route_distance_' + sch.xlBm); |
| 21 | 19 | ||
| @@ -26,18 +24,42 @@ | @@ -26,18 +24,42 @@ | ||
| 26 | }); | 24 | }); |
| 27 | 25 | ||
| 28 | function drawCharts() { | 26 | function drawCharts() { |
| 29 | - //console.log('开始绘图', locData); | ||
| 30 | - var stations; | ||
| 31 | try { | 27 | try { |
| 32 | - stations = JSON.parse(locData).stations[sch.xlDir == 0 ? 'up' : 'down']; | 28 | + stationArr = JSON.parse(locData).stations[sch.xlDir == 0 ? 'up' : 'down']; |
| 33 | }catch (e){ | 29 | }catch (e){ |
| 34 | alert('数据异常!!'); | 30 | alert('数据异常!!'); |
| 35 | return; | 31 | return; |
| 36 | } | 32 | } |
| 37 | 33 | ||
| 38 | - console.log('stations..', stations); | 34 | + var width = 1500; |
| 35 | + var svgCont = $('<div style="width: '+width+'px;" class="svg_cont_body"></div>'); | ||
| 36 | + var svg = d3.select(svgCont[0]).append('svg'); | ||
| 37 | + | ||
| 38 | + //初始化 X 比例尺 | ||
| 39 | + var sum=0; | ||
| 40 | + $.each(stationArr, function () { | ||
| 41 | + sum += this.toDistance; | ||
| 42 | + }); | ||
| 43 | + | ||
| 44 | + console.log('stations', stationArr); | ||
| 45 | + var items = svg.selectAll('g._item').data(stationArr) | ||
| 46 | + .enter() | ||
| 47 | + .append('g') | ||
| 48 | + .classed({_item: true}); | ||
| 49 | + | ||
| 50 | + //rect | ||
| 51 | + items.append('rect').attr('x', xScale).attr('y', 40); | ||
| 52 | + $('.svg_wrap', drawer).append(svgCont); | ||
| 39 | } | 53 | } |
| 40 | 54 | ||
| 55 | + var xScale = function (d, i) { | ||
| 56 | + var sum=0; | ||
| 57 | + for(var j = 0; j <= i; j++){ | ||
| 58 | + sum+=stationArr[j].toDistance; | ||
| 59 | + } | ||
| 60 | + return sum / 5; | ||
| 61 | + }; | ||
| 62 | + | ||
| 41 | //页面切换 | 63 | //页面切换 |
| 42 | function drawerLoadPage(url, id) { | 64 | function drawerLoadPage(url, id) { |
| 43 | $(drawer).parent('.ct-bottom-drawer-body').load(url, function () { | 65 | $(drawer).parent('.ct-bottom-drawer-body').load(url, function () { |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| @@ -7,7 +7,22 @@ | @@ -7,7 +7,22 @@ | ||
| 7 | {{else}} | 7 | {{else}} |
| 8 | 下行/{{line.endStationName}} | 8 | 下行/{{line.endStationName}} |
| 9 | {{/if}} | 9 | {{/if}} |
| 10 | - <i class="uk-icon-question-circle" ></i> | 10 | + <i class="uk-icon-question-circle"></i> |
| 11 | + <div class="fixed_legend"> | ||
| 12 | + <div> | ||
| 13 | + <span class="tl-xxfc">消息发出</span> | ||
| 14 | + <span class="tl-xxsd">消息收到</span> | ||
| 15 | + <span class="tl-xxrd">消息阅读</span> | ||
| 16 | + | ||
| 17 | + <span class="tl-wd">误点</span> | ||
| 18 | + <span class="tl-zzzx">正在执行</span> | ||
| 19 | + <span class="tl-qrlb"></span> | ||
| 20 | + <span class="tl-yzx">已执行</span> | ||
| 21 | + <a> | ||
| 22 | + <i class="uk-icon-angle-double-up fixed_legend_close"></i> | ||
| 23 | + </a> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 11 | <div class="search_sch_panel"> | 26 | <div class="search_sch_panel"> |
| 12 | <form class="uk-form" onsubmit="javascript:return false;"> | 27 | <form class="uk-form" onsubmit="javascript:return false;"> |
| 13 | <div class="uk-autocomplete sch-search-autocom"> | 28 | <div class="uk-autocomplete sch-search-autocom"> |
| @@ -38,7 +53,7 @@ | @@ -38,7 +53,7 @@ | ||
| 38 | </div> | 53 | </div> |
| 39 | <div class="ct_table_body"> | 54 | <div class="ct_table_body"> |
| 40 | {{each list as sch i}} | 55 | {{each list as sch i}} |
| 41 | - <dl data-id="{{sch.id}}" > | 56 | + <dl data-id="{{sch.id}}"> |
| 42 | <dd class="seq_no">{{i + 1}}</dd> | 57 | <dd class="seq_no">{{i + 1}}</dd> |
| 43 | <dd class="lpName"><a>{{sch.lpName}}</a></dd> | 58 | <dd class="lpName"><a>{{sch.lpName}}</a></dd> |
| 44 | <dd data-nbbm="{{sch.clZbh}}" | 59 | <dd data-nbbm="{{sch.clZbh}}" |
| @@ -65,7 +80,9 @@ | @@ -65,7 +80,9 @@ | ||
| 65 | <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | 80 | <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> |
| 66 | {{/if}} | 81 | {{/if}} |
| 67 | </dd> | 82 | </dd> |
| 68 | - <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}">{{sch.dfsj}}</dd> | 83 | + <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}"> |
| 84 | + {{sch.dfsj}} | ||
| 85 | + </dd> | ||
| 69 | <dd class=" | 86 | <dd class=" |
| 70 | {{if sch.status==-1}} | 87 | {{if sch.status==-1}} |
| 71 | tl-qrlb | 88 | tl-qrlb |
| @@ -75,11 +92,12 @@ | @@ -75,11 +92,12 @@ | ||
| 75 | tl-zzzx | 92 | tl-zzzx |
| 76 | {{else if sch.status == 0 && sch.late}} | 93 | {{else if sch.status == 0 && sch.late}} |
| 77 | tl-wd | 94 | tl-wd |
| 78 | - {{/if}} fcsjActualCell" > | 95 | + {{/if}} fcsjActualCell"> |
| 79 | {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span> | 96 | {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span> |
| 80 | </dd> | 97 | </dd> |
| 81 | <dd data-uk-observe> | 98 | <dd data-uk-observe> |
| 82 | - <span title="{{sch.remarks}}" data-uk-tooltip="{pos:'top-left'}" >{{sch.remarks}}</span> | 99 | + <span title="{{sch.remarks}}" |
| 100 | + data-uk-tooltip="{pos:'top-left'}">{{sch.remarks}}</span> | ||
| 83 | </dd> | 101 | </dd> |
| 84 | </dl> | 102 | </dl> |
| 85 | {{/each}} | 103 | {{/each}} |
| @@ -112,7 +130,7 @@ | @@ -112,7 +130,7 @@ | ||
| 112 | </script> | 130 | </script> |
| 113 | 131 | ||
| 114 | <script id="line-schedule-sfsj-temp" type="text/html"> | 132 | <script id="line-schedule-sfsj-temp" type="text/html"> |
| 115 | - <dd class=" | 133 | + <dd class=" |
| 116 | {{if status==-1}} | 134 | {{if status==-1}} |
| 117 | tl-qrlb | 135 | tl-qrlb |
| 118 | {{else if status==2}} | 136 | {{else if status==2}} |
| @@ -122,8 +140,8 @@ | @@ -122,8 +140,8 @@ | ||
| 122 | {{else if status == 0 && late}} | 140 | {{else if status == 0 && late}} |
| 123 | tl-wd | 141 | tl-wd |
| 124 | {{/if}} fcsjActualCell"> | 142 | {{/if}} fcsjActualCell"> |
| 125 | - {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span> | ||
| 126 | - </dd> | 143 | + {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span> |
| 144 | + </dd> | ||
| 127 | </script> | 145 | </script> |
| 128 | 146 | ||
| 129 | <script id="line-schedule-nbbm-temp" type="text/html"> | 147 | <script id="line-schedule-nbbm-temp" type="text/html"> |
| @@ -146,4 +164,10 @@ | @@ -146,4 +164,10 @@ | ||
| 146 | <li><span>终点站:</span>{{zdzName}}</li> | 164 | <li><span>终点站:</span>{{zdzName}}</li> |
| 147 | </ul> | 165 | </ul> |
| 148 | </script> | 166 | </script> |
| 167 | + | ||
| 168 | + <script id="last-sch-sunken-temp" type="text/html"> | ||
| 169 | + <div class="last-sch-sunken"> | ||
| 170 | + <span class="_badge">终点</span>{{zdsj}}/{{zdsjActual}} | ||
| 171 | + </div> | ||
| 172 | + </script> | ||
| 149 | </div> | 173 | </div> |
src/main/resources/static/real_control_v2/js/line_schedule/layout.js
| @@ -15,14 +15,13 @@ var gb_line_layout = (function() { | @@ -15,14 +15,13 @@ var gb_line_layout = (function() { | ||
| 15 | var lineCode=$(this).data('id') | 15 | var lineCode=$(this).data('id') |
| 16 | ,svgWrap=$('.footer-chart .svg-wrap', this); | 16 | ,svgWrap=$('.footer-chart .svg-wrap', this); |
| 17 | gb_svg_chart.draw_line(lineCode, svgWrap); | 17 | gb_svg_chart.draw_line(lineCode, svgWrap); |
| 18 | - //console.log('gb_line_layout...', this); | ||
| 19 | - //$('.footer-chart .svg-wrap', this) | ||
| 20 | }); | 18 | }); |
| 21 | 19 | ||
| 22 | cb && cb(); | 20 | cb && cb(); |
| 23 | }); | 21 | }); |
| 24 | }; | 22 | }; |
| 25 | 23 | ||
| 24 | + //图例icon tootip | ||
| 26 | $(document).on('mouseenter', '.schedule-wrap i.uk-icon-question-circle', function() { | 25 | $(document).on('mouseenter', '.schedule-wrap i.uk-icon-question-circle', function() { |
| 27 | $(this).qtip({ | 26 | $(this).qtip({ |
| 28 | show: { | 27 | show: { |
| @@ -49,7 +48,7 @@ var gb_line_layout = (function() { | @@ -49,7 +48,7 @@ var gb_line_layout = (function() { | ||
| 49 | //destroy dom | 48 | //destroy dom |
| 50 | $(this).qtip('destroy', true); | 49 | $(this).qtip('destroy', true); |
| 51 | } | 50 | } |
| 52 | - }// max-width: 335px; | 51 | + } |
| 53 | }); | 52 | }); |
| 54 | }); | 53 | }); |
| 55 | 54 |
src/main/resources/static/real_control_v2/js/line_schedule/legend.js
0 → 100644
| 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 | +})(); | ||
| 0 | \ No newline at end of file | 68 | \ No newline at end of file |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| 1 | /** schedule table */ | 1 | /** schedule table */ |
| 2 | 2 | ||
| 3 | -var gb_schedule_table = (function() { | 3 | +var gb_schedule_table = (function () { |
| 4 | 4 | ||
| 5 | var temps; | 5 | var temps; |
| 6 | //线路分组的班次数据 | 6 | //线路分组的班次数据 |
| 7 | var line2Schedule = {}; | 7 | var line2Schedule = {}; |
| 8 | //车辆应发未发车辆数 | 8 | //车辆应发未发车辆数 |
| 9 | var car_yfwf_map = {}; | 9 | var car_yfwf_map = {}; |
| 10 | - var schedule_sort = function(s1, s2) { | 10 | + var schedule_sort = function (s1, s2) { |
| 11 | return s1.dfsjT - s2.dfsjT; | 11 | return s1.dfsjT - s2.dfsjT; |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | - var show = function(cb) { | 14 | + var show = function (cb) { |
| 15 | //从服务器获取班次数据 | 15 | //从服务器获取班次数据 |
| 16 | $.get('/realSchedule/lines', { | 16 | $.get('/realSchedule/lines', { |
| 17 | lines: gb_data_basic.line_idx | 17 | lines: gb_data_basic.line_idx |
| 18 | - }, function(rs) { | 18 | + }, function (rs) { |
| 19 | for (var lineCode in rs) { | 19 | for (var lineCode in rs) { |
| 20 | //排序 | 20 | //排序 |
| 21 | rs[lineCode].sort(schedule_sort); | 21 | rs[lineCode].sort(schedule_sort); |
| 22 | line2Schedule[lineCode] = {}; | 22 | line2Schedule[lineCode] = {}; |
| 23 | //calc shift | 23 | //calc shift |
| 24 | - $.each(rs[lineCode], function() { | 24 | + $.each(rs[lineCode], function () { |
| 25 | calc_sch_real_shift(this); | 25 | calc_sch_real_shift(this); |
| 26 | line2Schedule[lineCode][this.id] = this; | 26 | line2Schedule[lineCode][this.id] = this; |
| 27 | }); | 27 | }); |
| @@ -32,17 +32,17 @@ var gb_schedule_table = (function() { | @@ -32,17 +32,17 @@ var gb_schedule_table = (function() { | ||
| 32 | }); | 32 | }); |
| 33 | 33 | ||
| 34 | //加载班次表格渲染模板 | 34 | //加载班次表格渲染模板 |
| 35 | - $.get('/real_control_v2/fragments/line_schedule/sch_table.html', function(dom) { | 35 | + $.get('/real_control_v2/fragments/line_schedule/sch_table.html', function (dom) { |
| 36 | ep.emit('temp', gb_common.compileTempByDom(dom, { | 36 | ep.emit('temp', gb_common.compileTempByDom(dom, { |
| 37 | compress: true | 37 | compress: true |
| 38 | })); | 38 | })); |
| 39 | }); | 39 | }); |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | - var ep = EventProxy.create("data", "temp", function(data, temp) { | 42 | + var ep = EventProxy.create("data", "temp", function (data, temp) { |
| 43 | temps = temp; | 43 | temps = temp; |
| 44 | var lineCode, dirData, htmlStr; | 44 | var lineCode, dirData, htmlStr; |
| 45 | - $('#main-tab-content .line_schedule').each(function() { | 45 | + $('#main-tab-content .line_schedule').each(function () { |
| 46 | lineCode = $(this).data('id'); | 46 | lineCode = $(this).data('id'); |
| 47 | if (arrayIsNull(data[lineCode])) | 47 | if (arrayIsNull(data[lineCode])) |
| 48 | return true; | 48 | return true; |
| @@ -56,6 +56,11 @@ var gb_schedule_table = (function() { | @@ -56,6 +56,11 @@ var gb_schedule_table = (function() { | ||
| 56 | 56 | ||
| 57 | $('.schedule-wrap .card-panel:eq(' + upDown + ')', this).html(htmlStr); | 57 | $('.schedule-wrap .card-panel:eq(' + upDown + ')', this).html(htmlStr); |
| 58 | } | 58 | } |
| 59 | + | ||
| 60 | + //标记车辆最后一个班次 | ||
| 61 | + markerLastByLine(lineCode); | ||
| 62 | + //初始化图例相关,dbclick 不能代理事件 | ||
| 63 | + gb_sch_legend.init(this); | ||
| 59 | }); | 64 | }); |
| 60 | var content = $('.line_schedule .ct_table_wrap'); | 65 | var content = $('.line_schedule .ct_table_wrap'); |
| 61 | //fixed table head | 66 | //fixed table head |
| @@ -64,27 +69,27 @@ var gb_schedule_table = (function() { | @@ -64,27 +69,27 @@ var gb_schedule_table = (function() { | ||
| 64 | gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init); | 69 | gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init); |
| 65 | //dbclick event | 70 | //dbclick event |
| 66 | gb_schedule_table_dbclick.init(); | 71 | gb_schedule_table_dbclick.init(); |
| 67 | - | 72 | + //点击实发,show detail |
| 68 | fcsjActualCellQtip(); | 73 | fcsjActualCellQtip(); |
| 69 | cb && cb(); | 74 | cb && cb(); |
| 70 | }); | 75 | }); |
| 71 | }; | 76 | }; |
| 72 | 77 | ||
| 73 | - function fcsjActualCellQtip(){ | 78 | + function fcsjActualCellQtip() { |
| 74 | //单击实发单元格显示详细信息 | 79 | //单击实发单元格显示详细信息 |
| 75 | $(document).on('click', 'dd.fcsjActualCell', function () { | 80 | $(document).on('click', 'dd.fcsjActualCell', function () { |
| 76 | - var that=this; | 81 | + var that = this; |
| 77 | $(that).qtip({ | 82 | $(that).qtip({ |
| 78 | show: true, | 83 | show: true, |
| 79 | content: { | 84 | content: { |
| 80 | - text: function(e) { | ||
| 81 | - var lineCode=$(that).parents('li.line_schedule').data('id') | ||
| 82 | - ,id=$(that).parents('dl').data('id') | ||
| 83 | - ,sch=line2Schedule[lineCode][id]; | 85 | + text: function (e) { |
| 86 | + var lineCode = $(that).parents('li.line_schedule').data('id') | ||
| 87 | + , id = $(that).parents('dl').data('id') | ||
| 88 | + , sch = line2Schedule[lineCode][id]; | ||
| 84 | return temps['sfsj_sch-detail-temp'](sch); | 89 | return temps['sfsj_sch-detail-temp'](sch); |
| 85 | } | 90 | } |
| 86 | } | 91 | } |
| 87 | - ,style: { | 92 | + , style: { |
| 88 | classes: 'qtip-dark qtip-rounded qtip-shadow' | 93 | classes: 'qtip-dark qtip-rounded qtip-shadow' |
| 89 | }, | 94 | }, |
| 90 | hide: { | 95 | hide: { |
| @@ -103,44 +108,17 @@ var gb_schedule_table = (function() { | @@ -103,44 +108,17 @@ var gb_schedule_table = (function() { | ||
| 103 | } | 108 | } |
| 104 | }); | 109 | }); |
| 105 | }); | 110 | }); |
| 106 | -/* $('dd.fcsjActualCell').qtip({ | ||
| 107 | - show: 'click', | ||
| 108 | - content: { | ||
| 109 | - text: function(e) { | ||
| 110 | - var lineCode=$(e.target).parents('li.line_schedule').data('id') | ||
| 111 | - ,id=$(e.target).parents('dl').data('id') | ||
| 112 | - ,sch=line2Schedule[lineCode][id]; | ||
| 113 | - return temps['sfsj_sch-detail-temp'](sch); | ||
| 114 | - } | ||
| 115 | - } | ||
| 116 | - ,style: { | ||
| 117 | - classes: 'qtip-dark qtip-rounded qtip-shadow' | ||
| 118 | - }, | ||
| 119 | - hide: { | ||
| 120 | - fixed: true, | ||
| 121 | - delay: 300 | ||
| 122 | - }, | ||
| 123 | - position: { | ||
| 124 | - my: 'center left', | ||
| 125 | - at: 'center right' | ||
| 126 | - }, | ||
| 127 | - events: { | ||
| 128 | - hidden: function (event, api) { | ||
| 129 | - $(this).qtip('destroy', true); | ||
| 130 | - } | ||
| 131 | - } | ||
| 132 | - });*/ | ||
| 133 | } | 111 | } |
| 134 | 112 | ||
| 135 | //重置序号 | 113 | //重置序号 |
| 136 | - var reset_seq_no = function(dls) { | ||
| 137 | - dls.each(function(i, dl) { | 114 | + var reset_seq_no = function (dls) { |
| 115 | + dls.each(function (i, dl) { | ||
| 138 | $('dd:eq(0)', dl).text(i + 1); | 116 | $('dd:eq(0)', dl).text(i + 1); |
| 139 | }); | 117 | }); |
| 140 | - } | 118 | + }; |
| 141 | 119 | ||
| 142 | //计算实发时间差值 | 120 | //计算实发时间差值 |
| 143 | - var calc_sch_real_shift = function(sch) { | 121 | + var calc_sch_real_shift = function (sch) { |
| 144 | if (sch.fcsjActualTime) { | 122 | if (sch.fcsjActualTime) { |
| 145 | var diff = parseInt((sch.fcsjActualTime - sch.dfsjT) / 1000 / 60); | 123 | var diff = parseInt((sch.fcsjActualTime - sch.dfsjT) / 1000 / 60); |
| 146 | if (diff > 0) | 124 | if (diff > 0) |
| @@ -150,22 +128,22 @@ var gb_schedule_table = (function() { | @@ -150,22 +128,22 @@ var gb_schedule_table = (function() { | ||
| 150 | else | 128 | else |
| 151 | sch.fcsj_diff = ''; | 129 | sch.fcsj_diff = ''; |
| 152 | } | 130 | } |
| 153 | - } | 131 | + }; |
| 154 | 132 | ||
| 155 | function arrayIsNull(array) { | 133 | function arrayIsNull(array) { |
| 156 | return !array || array.length == 0; | 134 | return !array || array.length == 0; |
| 157 | } | 135 | } |
| 158 | 136 | ||
| 159 | - var findScheduleByLine = function(lineCode) { | 137 | + var findScheduleByLine = function (lineCode) { |
| 160 | return line2Schedule[lineCode]; | 138 | return line2Schedule[lineCode]; |
| 161 | - } | 139 | + }; |
| 162 | 140 | ||
| 163 | //新增一个班次,附带更新的班次 | 141 | //新增一个班次,附带更新的班次 |
| 164 | - var insertSchedule = function(sch, upArr) { | 142 | + var insertSchedule = function (sch, upArr) { |
| 165 | line2Schedule[sch.xlBm][sch.id] = sch; | 143 | line2Schedule[sch.xlBm][sch.id] = sch; |
| 166 | //update | 144 | //update |
| 167 | if (isArray(upArr)) { | 145 | if (isArray(upArr)) { |
| 168 | - $.each(upArr, function() { | 146 | + $.each(upArr, function () { |
| 169 | line2Schedule[this.xlBm][this.id] = this; | 147 | line2Schedule[this.xlBm][this.id] = this; |
| 170 | }); | 148 | }); |
| 171 | } | 149 | } |
| @@ -183,15 +161,20 @@ var gb_schedule_table = (function() { | @@ -183,15 +161,20 @@ var gb_schedule_table = (function() { | ||
| 183 | }); | 161 | }); |
| 184 | $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr); | 162 | $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr); |
| 185 | } | 163 | } |
| 164 | + //图例相关 | ||
| 165 | + gb_sch_legend.init(tabCont); | ||
| 166 | + //标记末班 | ||
| 167 | + markerLastByLine(sch.xlBm); | ||
| 168 | + //计算应发未发 | ||
| 186 | calc_yfwf_num(sch.xlBm); | 169 | calc_yfwf_num(sch.xlBm); |
| 187 | //重新固定表头 | 170 | //重新固定表头 |
| 188 | gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap')); | 171 | gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap')); |
| 189 | //定位到新添加的班次 | 172 | //定位到新添加的班次 |
| 190 | scroToDl(sch); | 173 | scroToDl(sch); |
| 191 | - } | 174 | + }; |
| 192 | 175 | ||
| 193 | //删除一个班次 | 176 | //删除一个班次 |
| 194 | - var deheteSchedule = function(sch) { | 177 | + var deheteSchedule = function (sch) { |
| 195 | sch = line2Schedule[sch.xlBm][sch.id]; | 178 | sch = line2Schedule[sch.xlBm][sch.id]; |
| 196 | if (sch) { | 179 | if (sch) { |
| 197 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'), | 180 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'), |
| @@ -201,21 +184,31 @@ var gb_schedule_table = (function() { | @@ -201,21 +184,31 @@ var gb_schedule_table = (function() { | ||
| 201 | reset_seq_no(dls); | 184 | reset_seq_no(dls); |
| 202 | calc_yfwf_num(sch.xlBm); | 185 | calc_yfwf_num(sch.xlBm); |
| 203 | } | 186 | } |
| 204 | - } | 187 | + }; |
| 205 | 188 | ||
| 206 | //更新班次 | 189 | //更新班次 |
| 207 | - var updateSchedule = function(schArr) { | 190 | + var updateSchedule = function (schArr) { |
| 208 | if (!isArray(schArr)) | 191 | if (!isArray(schArr)) |
| 209 | schArr = [schArr]; | 192 | schArr = [schArr]; |
| 210 | 193 | ||
| 211 | - $.each(schArr, function() { | 194 | + var tMaps={}; |
| 195 | + $.each(schArr, function () { | ||
| 212 | line2Schedule[this.xlBm][this.id] = this; | 196 | line2Schedule[this.xlBm][this.id] = this; |
| 213 | updateDom(this); | 197 | updateDom(this); |
| 198 | + //线路_车辆 过滤重复数据 | ||
| 199 | + tMaps[this.xlBm+'_'+this.clZbh]=1; | ||
| 214 | }); | 200 | }); |
| 215 | - } | 201 | + |
| 202 | + //重新标记末班 | ||
| 203 | + var ts=[]; | ||
| 204 | + for(var k in tMaps){ | ||
| 205 | + ts = k.split('_'); | ||
| 206 | + markerLastByNbbm(ts[0], ts[1]); | ||
| 207 | + } | ||
| 208 | + }; | ||
| 216 | 209 | ||
| 217 | //update dom | 210 | //update dom |
| 218 | - var updateDom = function(sch) { | 211 | + var updateDom = function (sch) { |
| 219 | if (!sch) return; | 212 | if (!sch) return; |
| 220 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); | 213 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); |
| 221 | var dds = $('dd', dl); | 214 | var dds = $('dd', dl); |
| @@ -241,12 +234,16 @@ var gb_schedule_table = (function() { | @@ -241,12 +234,16 @@ var gb_schedule_table = (function() { | ||
| 241 | $(dds[8]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>'); | 234 | $(dds[8]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>'); |
| 242 | else | 235 | else |
| 243 | $(dds[8]).html(''); | 236 | $(dds[8]).html(''); |
| 244 | - } | 237 | + |
| 238 | + //班次是车辆的最后一班 | ||
| 239 | + if(dl.hasClass('dl-last-sch')) | ||
| 240 | + markerLastSch([sch]); | ||
| 241 | + }; | ||
| 245 | 242 | ||
| 246 | //拖拽选中... | 243 | //拖拽选中... |
| 247 | var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no'; | 244 | var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no'; |
| 248 | var drag_strat; | 245 | var drag_strat; |
| 249 | - $(document).on('mousedown', seq_nos, function(e) { | 246 | + $(document).on('mousedown', seq_nos, function (e) { |
| 250 | if (e.button != 0) return; | 247 | if (e.button != 0) return; |
| 251 | var dl = $(this).parent(); | 248 | var dl = $(this).parent(); |
| 252 | if (dl.hasClass('drag-active')) | 249 | if (dl.hasClass('drag-active')) |
| @@ -255,9 +252,9 @@ var gb_schedule_table = (function() { | @@ -255,9 +252,9 @@ var gb_schedule_table = (function() { | ||
| 255 | dl.addClass('drag-active'); | 252 | dl.addClass('drag-active'); |
| 256 | 253 | ||
| 257 | drag_strat = parseInt($(this).text()) - 1; | 254 | drag_strat = parseInt($(this).text()) - 1; |
| 258 | - }).on('mouseup', function() { | 255 | + }).on('mouseup', function () { |
| 259 | drag_strat = null; | 256 | drag_strat = null; |
| 260 | - }).on('mouseover', seq_nos, function() { | 257 | + }).on('mouseover', seq_nos, function () { |
| 261 | if (drag_strat != null) { | 258 | if (drag_strat != null) { |
| 262 | var e = parseInt($(this).text()), | 259 | var e = parseInt($(this).text()), |
| 263 | dls = $(this).parents('.ct_table_body').find('dl'); | 260 | dls = $(this).parents('.ct_table_body').find('dl'); |
| @@ -274,27 +271,29 @@ var gb_schedule_table = (function() { | @@ -274,27 +271,29 @@ var gb_schedule_table = (function() { | ||
| 274 | $(dls[j]).addClass('drag-active'); | 271 | $(dls[j]).addClass('drag-active'); |
| 275 | } | 272 | } |
| 276 | } | 273 | } |
| 277 | - }).on('click', seq_nos, function() { | 274 | + }).on('click', seq_nos, function () { |
| 278 | reset_relevance_active(this); | 275 | reset_relevance_active(this); |
| 279 | }); | 276 | }); |
| 280 | //非seq_no 单元格点击 | 277 | //非seq_no 单元格点击 |
| 281 | - $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class!=seq_no][class!=lpName]', function() { | 278 | + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class!=seq_no][class!=lpName]', function () { |
| 282 | reset_drag_active_all(this); | 279 | reset_drag_active_all(this); |
| 283 | //选中相关班次 | 280 | //选中相关班次 |
| 284 | var id = $(this).parent().data('id'), | 281 | var id = $(this).parent().data('id'), |
| 285 | contWrap = $(this).parents('li.line_schedule'), | 282 | contWrap = $(this).parents('li.line_schedule'), |
| 286 | lineCode = contWrap.data('id'), | 283 | lineCode = contWrap.data('id'), |
| 287 | sch = line2Schedule[lineCode][id], | 284 | sch = line2Schedule[lineCode][id], |
| 288 | - schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function(item) { | 285 | + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) { |
| 289 | return item.clZbh == sch.clZbh; | 286 | return item.clZbh == sch.clZbh; |
| 290 | }).sort(schedule_sort), | 287 | }).sort(schedule_sort), |
| 291 | nextSch, tempDL; | 288 | nextSch, tempDL; |
| 292 | - $.each(schArr, function(i) { | 289 | + |
| 290 | + getDl(sch).addClass('intimity'); | ||
| 291 | + $.each(schArr, function (i) { | ||
| 293 | tempDL = $('dl[data-id=' + this.id + ']', contWrap); | 292 | tempDL = $('dl[data-id=' + this.id + ']', contWrap); |
| 294 | tempDL.addClass('relevance-active'); | 293 | tempDL.addClass('relevance-active'); |
| 295 | if (i < schArr.length - 1 && this.id == id) { | 294 | if (i < schArr.length - 1 && this.id == id) { |
| 296 | nextSch = schArr[i + 1]; | 295 | nextSch = schArr[i + 1]; |
| 297 | - tempDL.addClass('intimity'); | 296 | + //tempDL.addClass('intimity'); |
| 298 | } | 297 | } |
| 299 | }); | 298 | }); |
| 300 | 299 | ||
| @@ -308,17 +307,17 @@ var gb_schedule_table = (function() { | @@ -308,17 +307,17 @@ var gb_schedule_table = (function() { | ||
| 308 | }); | 307 | }); |
| 309 | 308 | ||
| 310 | //路牌点击 | 309 | //路牌点击 |
| 311 | - $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class=lpName]', function() { | 310 | + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class=lpName]', function () { |
| 312 | reset_drag_active_all(this); | 311 | reset_drag_active_all(this); |
| 313 | //选中路牌下相关班次 | 312 | //选中路牌下相关班次 |
| 314 | var id = $(this).parent().data('id'), | 313 | var id = $(this).parent().data('id'), |
| 315 | contWrap = $(this).parents('li.line_schedule'), | 314 | contWrap = $(this).parents('li.line_schedule'), |
| 316 | lineCode = contWrap.data('id'), | 315 | lineCode = contWrap.data('id'), |
| 317 | sch = line2Schedule[lineCode][id], | 316 | sch = line2Schedule[lineCode][id], |
| 318 | - schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function(item) { | 317 | + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) { |
| 319 | return item.lpName == sch.lpName; | 318 | return item.lpName == sch.lpName; |
| 320 | }).sort(schedule_sort); | 319 | }).sort(schedule_sort); |
| 321 | - $.each(schArr, function(i) { | 320 | + $.each(schArr, function (i) { |
| 322 | $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active intimity'); | 321 | $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active intimity'); |
| 323 | }); | 322 | }); |
| 324 | 323 | ||
| @@ -326,14 +325,14 @@ var gb_schedule_table = (function() { | @@ -326,14 +325,14 @@ var gb_schedule_table = (function() { | ||
| 326 | }); | 325 | }); |
| 327 | 326 | ||
| 328 | //头部点击去掉选中光标 | 327 | //头部点击去掉选中光标 |
| 329 | - $(document).on('click', '.header-title', function() { | 328 | + $(document).on('click', '.header-title', function () { |
| 330 | // $(this).parents('.schedule-wrap').find('.relevance-active') | 329 | // $(this).parents('.schedule-wrap').find('.relevance-active') |
| 331 | // .removeClass('relevance-active'); | 330 | // .removeClass('relevance-active'); |
| 332 | reset_drag_active_all(this); | 331 | reset_drag_active_all(this); |
| 333 | }); | 332 | }); |
| 334 | 333 | ||
| 335 | - var scroToDl = function(sch) { | ||
| 336 | - var dl = $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')), | 334 | + var scroToDl = function (sch) { |
| 335 | + var dl = getDl(sch), | ||
| 337 | cont = dl.parents('.ct_table_wrap'), | 336 | cont = dl.parents('.ct_table_wrap'), |
| 338 | diff = cont.height() / 2; | 337 | diff = cont.height() / 2; |
| 339 | cont.animate({ | 338 | cont.animate({ |
| @@ -341,42 +340,97 @@ var gb_schedule_table = (function() { | @@ -341,42 +340,97 @@ var gb_schedule_table = (function() { | ||
| 341 | }, 500); | 340 | }, 500); |
| 342 | 341 | ||
| 343 | return dl; | 342 | return dl; |
| 344 | - } | 343 | + }; |
| 345 | 344 | ||
| 346 | - var reset_drag_active_all = function(dd) { | 345 | + var getDl = function (sch) { |
| 346 | + return $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')); | ||
| 347 | + }; | ||
| 348 | + | ||
| 349 | + var reset_drag_active_all = function (dd) { | ||
| 347 | $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); | 350 | $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); |
| 348 | reset_relevance_active(dd); | 351 | reset_relevance_active(dd); |
| 349 | - } | 352 | + }; |
| 350 | 353 | ||
| 351 | - var reset_relevance_active = function(dd) { | 354 | + var reset_relevance_active = function (dd) { |
| 352 | $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active intimity'); | 355 | $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active intimity'); |
| 353 | - } | 356 | + }; |
| 354 | 357 | ||
| 355 | 358 | ||
| 356 | //计算应发未发数量 car_yfwf_map | 359 | //计算应发未发数量 car_yfwf_map |
| 357 | - var calc_yfwf_num = function(lineCode) { | 360 | + var calc_yfwf_num = function (lineCode) { |
| 358 | 361 | ||
| 359 | var schArr = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), | 362 | var schArr = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), |
| 360 | yfwf_num = 0, | 363 | yfwf_num = 0, |
| 361 | t = new Date().valueOf(); | 364 | t = new Date().valueOf(); |
| 362 | 365 | ||
| 363 | - var carYfwfMap={}, nbbm; | ||
| 364 | - $.each(schArr, function() { | 366 | + var carYfwfMap = {}, nbbm; |
| 367 | + $.each(schArr, function () { | ||
| 365 | if (this.fcsjT > t) | 368 | if (this.fcsjT > t) |
| 366 | return false; | 369 | return false; |
| 367 | 370 | ||
| 368 | - if (this.fcsjActual == null && this.fcsjActualTime == null && this.status != -1){ | ||
| 369 | - yfwf_num++; | ||
| 370 | - nbbm=this.clZbh; | ||
| 371 | - if(carYfwfMap[nbbm]) | ||
| 372 | - carYfwfMap[nbbm]++; | ||
| 373 | - else | ||
| 374 | - carYfwfMap[nbbm]=1; | 371 | + if (this.fcsjActual == null && this.fcsjActualTime == null && this.status != -1) { |
| 372 | + yfwf_num++; | ||
| 373 | + nbbm = this.clZbh; | ||
| 374 | + if (carYfwfMap[nbbm]) | ||
| 375 | + carYfwfMap[nbbm]++; | ||
| 376 | + else | ||
| 377 | + carYfwfMap[nbbm] = 1; | ||
| 375 | } | 378 | } |
| 376 | }); | 379 | }); |
| 377 | - car_yfwf_map[lineCode]=carYfwfMap; | 380 | + car_yfwf_map[lineCode] = carYfwfMap; |
| 378 | 381 | ||
| 379 | $('#badge_yfwf_num_' + lineCode).text(yfwf_num); | 382 | $('#badge_yfwf_num_' + lineCode).text(yfwf_num); |
| 383 | + }; | ||
| 384 | + | ||
| 385 | + //标记终点时间 -线路 | ||
| 386 | + var markerLastByLine = function (lineCode) { | ||
| 387 | + var data = gb_common.groupBy(gb_common.get_vals(line2Schedule[lineCode]).filter(schDestroyFilter), 'clZbh'); | ||
| 388 | + | ||
| 389 | + var array, lastSch, dl; | ||
| 390 | + for (var nbbm in data) { | ||
| 391 | + array = data[nbbm].sort(schedule_sort); | ||
| 392 | + markerLastSch(array); | ||
| 393 | + } | ||
| 394 | + }; | ||
| 395 | + | ||
| 396 | + //标记终点时间 -车辆 | ||
| 397 | + var markerLastByNbbm = function (lineCode, nbbm) { | ||
| 398 | + var array = gb_common.get_vals(line2Schedule[lineCode]).filter(function (a) { | ||
| 399 | + return a.clZbh == nbbm && a.status != -1; | ||
| 400 | + }).sort(schedule_sort); | ||
| 401 | + | ||
| 402 | + removeMarkers(lineCode, array); | ||
| 403 | + markerLastSch(array); | ||
| 404 | + }; | ||
| 405 | + | ||
| 406 | + var markerLastSch = function (array) { | ||
| 407 | + var lastSch = array[array.length - 1]; | ||
| 408 | + | ||
| 409 | + if (!lastSch.jhlc) | ||
| 410 | + return; | ||
| 411 | + | ||
| 412 | + var dl = getDl(lastSch); | ||
| 413 | + dl.addClass('dl-last-sch'); | ||
| 414 | + | ||
| 415 | + $('dd.fcsjActualCell', dl).append(temps['last-sch-sunken-temp'](lastSch)); | ||
| 416 | + } | ||
| 417 | + | ||
| 418 | + //清除线路下指定班次的 末班标记 | ||
| 419 | + var removeMarkers = function (lineCode, array) { | ||
| 420 | + var idx=[]; | ||
| 421 | + $.each(array, function () { | ||
| 422 | + idx.push(this.id); | ||
| 423 | + }); | ||
| 424 | + | ||
| 425 | + $('dl.dl-last-sch','li.line_schedule[data-id=' + lineCode + ']').each(function () { | ||
| 426 | + if($(this).hasClass('dl-last-sch') && idx.indexOf($(this).data('id'))){ | ||
| 427 | + $(this).removeClass('dl-last-sch').find('.last-sch-sunken').remove(); | ||
| 428 | + } | ||
| 429 | + }); | ||
| 430 | + } | ||
| 431 | + | ||
| 432 | + var schDestroyFilter = function (a) { | ||
| 433 | + return a.status != -1; | ||
| 380 | } | 434 | } |
| 381 | 435 | ||
| 382 | return { | 436 | return { |
| @@ -387,7 +441,9 @@ var gb_schedule_table = (function() { | @@ -387,7 +441,9 @@ var gb_schedule_table = (function() { | ||
| 387 | insertSchedule: insertSchedule, | 441 | insertSchedule: insertSchedule, |
| 388 | schedule_sort: schedule_sort, | 442 | schedule_sort: schedule_sort, |
| 389 | calc_yfwf_num: calc_yfwf_num, | 443 | calc_yfwf_num: calc_yfwf_num, |
| 390 | - car_yfwf_map: function(lineCode){return car_yfwf_map[lineCode];}, | 444 | + car_yfwf_map: function (lineCode) { |
| 445 | + return car_yfwf_map[lineCode]; | ||
| 446 | + }, | ||
| 391 | scroToDl: scroToDl, | 447 | scroToDl: scroToDl, |
| 392 | reset_drag_active_all: reset_drag_active_all | 448 | reset_drag_active_all: reset_drag_active_all |
| 393 | }; | 449 | }; |
src/main/resources/static/real_control_v2/js/main.js
| @@ -196,8 +196,8 @@ var open_modal = function(pageUrl, data, opt) { | @@ -196,8 +196,8 @@ var open_modal = function(pageUrl, data, opt) { | ||
| 196 | function showUpdateDescription() { | 196 | function showUpdateDescription() { |
| 197 | //更新说明 | 197 | //更新说明 |
| 198 | var updateDescription={ | 198 | var updateDescription={ |
| 199 | - date: '2016-12-11', | ||
| 200 | - text: '<h5>1、电子路单单击“实发”时,tootip内的人员显示工号。</h5><h5>2、修复某些情况下,班次被操作后 点击“实发” 无法显示tootip的情况。</h5><h5>3、获取GPS数据失败时,页面会弹出提示,并等待7秒后尝试再次获取。</h5>' | 199 | + date: '2016-12-15', |
| 200 | + text: '<h5>1、双击电子路单title右侧 ? 号图标,可将图例固定在上发。</h5><h5>2、每辆车最后一个班次,实发栏会显示计划和实际终点时间。</h5><h5>3、修复了子任务添加1分钟后再删除,弹出完整性约束校验失败 的问题。</h5>' | ||
| 201 | }; | 201 | }; |
| 202 | 202 | ||
| 203 | var storage = window.localStorage | 203 | var storage = window.localStorage |
src/main/resources/static/real_control_v2/main.html
| @@ -123,6 +123,7 @@ | @@ -123,6 +123,7 @@ | ||
| 123 | <script src="/real_control_v2/js/home/line_panel.js"></script> | 123 | <script src="/real_control_v2/js/home/line_panel.js"></script> |
| 124 | <script src="/real_control_v2/js/home/context_menu.js"></script> | 124 | <script src="/real_control_v2/js/home/context_menu.js"></script> |
| 125 | <!-- line schedule js --> | 125 | <!-- line schedule js --> |
| 126 | + <script src="/real_control_v2/js/line_schedule/legend.js"></script> | ||
| 126 | <script src="/real_control_v2/js/line_schedule/layout.js"></script> | 127 | <script src="/real_control_v2/js/line_schedule/layout.js"></script> |
| 127 | <script src="/real_control_v2/js/line_schedule/sch_table.js"></script> | 128 | <script src="/real_control_v2/js/line_schedule/sch_table.js"></script> |
| 128 | <script src="/real_control_v2/js/line_schedule/context_menu.js"></script> | 129 | <script src="/real_control_v2/js/line_schedule/context_menu.js"></script> |