Commit 8b49554e2abc2165867e93762f2a94b7b147b87f
Merge branch 'minhang' into qingpu
Showing
64 changed files
with
2600 additions
and
1206 deletions
Too many changes to show.
To preserve performance only 64 of 147 files are displayed.
src/main/java/com/bsth/controller/forms/ExportController.java
| ... | ... | @@ -203,7 +203,7 @@ public class ExportController { |
| 203 | 203 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 204 | 204 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 205 | 205 | ReportUtils ee = new ReportUtils(); |
| 206 | - List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(), | |
| 206 | + List<Vehicleloading> vehicleloading = formsService.vehicleloading(/*map.get("gsdmVehic").toString(),map.get("fgsdmVehic").toString(),*/map.get("line").toString(), | |
| 207 | 207 | map.get("date").toString()); |
| 208 | 208 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 209 | 209 | int i = 1; | ... | ... |
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
| ... | ... | @@ -26,93 +26,90 @@ import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 26 | 26 | @RestController |
| 27 | 27 | @RequestMapping("mcy_forms") |
| 28 | 28 | public class MCY_FormsController { |
| 29 | - | |
| 29 | + | |
| 30 | 30 | @Autowired |
| 31 | 31 | FormsService formsService; |
| 32 | - | |
| 32 | + | |
| 33 | 33 | @Autowired |
| 34 | 34 | ScheduleRealInfoService scheduleRealInfoService; |
| 35 | - | |
| 36 | - //行车路单日报表 | |
| 37 | - @RequestMapping(value = "/waybillday",method = RequestMethod.POST) | |
| 38 | - public List<Waybillday> waybillday(@RequestParam Map<String, Object> map){ | |
| 39 | - | |
| 40 | - | |
| 41 | -// scheduleRealInfoService.findKMBC(jName, clZbh, lpName, date) | |
| 35 | + | |
| 36 | + // 行车路单日报表 | |
| 37 | + | |
| 38 | + @RequestMapping(value = "/waybillday", method = RequestMethod.POST) | |
| 39 | + public List<Waybillday> waybillday(@RequestParam Map<String, Object> map) { | |
| 40 | + | |
| 41 | + // scheduleRealInfoService.findKMBC(jName, clZbh, lpName, date) | |
| 42 | 42 | return formsService.waybillday(map); |
| 43 | 43 | } |
| 44 | - | |
| 45 | - //线路客流量报表 | |
| 46 | - @RequestMapping(value = "/linepasswengerflow",method = RequestMethod.POST) | |
| 47 | - public List<Linepasswengerflow> linepasswengerflow(@RequestParam Map<String, Object> map){ | |
| 48 | - | |
| 44 | + | |
| 45 | + // 线路客流量报表 | |
| 46 | + | |
| 47 | + @RequestMapping(value = "/linepasswengerflow", method = RequestMethod.POST) | |
| 48 | + public List<Linepasswengerflow> linepasswengerflow(@RequestParam Map<String, Object> map) { | |
| 49 | + | |
| 49 | 50 | return formsService.linepasswengerflow(map); |
| 50 | 51 | } |
| 51 | - | |
| 52 | - | |
| 53 | - | |
| 54 | - //班次车辆人员月报表 | |
| 55 | - @RequestMapping(value = "/shiftuehiclemanth",method = RequestMethod.POST) | |
| 56 | - public List<Shiftuehiclemanth> shiftuehiclemanth(@RequestParam Map<String, Object> map){ | |
| 57 | - | |
| 52 | + | |
| 53 | + // 班次车辆人员月报表 | |
| 54 | + @RequestMapping(value = "/shiftuehiclemanth", method = RequestMethod.POST) | |
| 55 | + public List<Shiftuehiclemanth> shiftuehiclemanth(@RequestParam Map<String, Object> map) { | |
| 56 | + | |
| 58 | 57 | return formsService.shiftuehiclemanth(map); |
| 59 | 58 | } |
| 60 | - | |
| 61 | - | |
| 62 | - //班次车辆人员日统计 | |
| 63 | - @RequestMapping(value = "/shifday",method = RequestMethod.POST) | |
| 64 | - public List<Shifday> shifday(@RequestParam Map<String, Object> map){ | |
| 65 | - | |
| 59 | + | |
| 60 | + // 班次车辆人员日统计 | |
| 61 | + @RequestMapping(value = "/shifday", method = RequestMethod.POST) | |
| 62 | + public List<Shifday> shifday(@RequestParam Map<String, Object> map) { | |
| 63 | + | |
| 66 | 64 | return formsService.shifday(map); |
| 67 | 65 | } |
| 68 | - | |
| 69 | - //换人换车情况统计表 | |
| 70 | - @RequestMapping(value = "/changetochange",method = RequestMethod.POST) | |
| 71 | - public List<Changetochange> changetochange(@RequestParam Map<String, Object> map){ | |
| 72 | - | |
| 66 | + | |
| 67 | + // 换人换车情况统计表 | |
| 68 | + @RequestMapping(value = "/changetochange", method = RequestMethod.POST) | |
| 69 | + public List<Changetochange> changetochange(@RequestParam Map<String, Object> map) { | |
| 70 | + | |
| 73 | 71 | return formsService.changetochange(map); |
| 74 | 72 | } |
| 75 | - | |
| 76 | - //路单数据 | |
| 77 | - @RequestMapping(value = "/singledata",method = RequestMethod.POST) | |
| 78 | - public List<Singledata> singledata(@RequestParam Map<String, Object> map){ | |
| 79 | - | |
| 73 | + | |
| 74 | + // 路单数据 | |
| 75 | + @RequestMapping(value = "/singledata", method = RequestMethod.POST) | |
| 76 | + public List<Singledata> singledata(@RequestParam Map<String, Object> map) { | |
| 77 | + | |
| 80 | 78 | return formsService.singledata(map); |
| 81 | - } | |
| 82 | - | |
| 83 | - //车辆加注 | |
| 84 | - @RequestMapping(value = "/vehicleloading",method = RequestMethod.POST) | |
| 85 | - public List<Vehicleloading> vehicleloading(@RequestParam String line ,@RequestParam String data){ | |
| 86 | - return formsService.vehicleloading(line,data); | |
| 87 | 79 | } |
| 88 | - | |
| 89 | - | |
| 90 | - //运营服务阶段报表 | |
| 91 | - @RequestMapping(value = "/operationservice",method = RequestMethod.POST) | |
| 92 | - public List<Operationservice> operationservice(@RequestParam Map<String, Object> map){ | |
| 93 | - | |
| 80 | + | |
| 81 | + // 车辆加注 | |
| 82 | + @RequestMapping(value = "/vehicleloading", method = RequestMethod.POST) | |
| 83 | + public List<Vehicleloading> vehicleloading(/*@RequestParam String gsdmVehic, @RequestParam String fgsdmVehic,*/ | |
| 84 | + @RequestParam String line, @RequestParam String data) { | |
| 85 | + return formsService.vehicleloading(/*gsdmVehic, fgsdmVehic, */line, data); | |
| 86 | + } | |
| 87 | + | |
| 88 | + // 运营服务阶段报表 | |
| 89 | + @RequestMapping(value = "/operationservice", method = RequestMethod.POST) | |
| 90 | + public List<Operationservice> operationservice(@RequestParam Map<String, Object> map) { | |
| 91 | + | |
| 94 | 92 | return formsService.operationservice(map); |
| 95 | 93 | } |
| 96 | - | |
| 97 | - //营运线路出车率统计表 | |
| 98 | - @RequestMapping(value = "/turnoutrate",method = RequestMethod.POST) | |
| 99 | - public List<Turnoutrate> turnoutrate(@RequestParam Map<String, Object> map){ | |
| 100 | - | |
| 101 | - return formsService.turnoutrate(map); | |
| 102 | - } | |
| 103 | - | |
| 104 | - //班次执行率统计表 | |
| 105 | - @RequestMapping(value = "/executionrate",method = RequestMethod.POST) | |
| 106 | - public List<Executionrate> executionrate(@RequestParam Map<String, Object> map){ | |
| 107 | - | |
| 108 | - return formsService.executionrate(map); | |
| 109 | - } | |
| 110 | - | |
| 111 | - | |
| 112 | - //营运线路名称统计表 | |
| 113 | - @RequestMapping(value = "/allline",method = RequestMethod.POST) | |
| 114 | - public List<Allline> allline(@RequestParam Map<String, Object> map){ | |
| 115 | - | |
| 116 | - return formsService.allline(map); | |
| 94 | + | |
| 95 | + // 营运线路出车率统计表 | |
| 96 | + @RequestMapping(value = "/turnoutrate", method = RequestMethod.POST) | |
| 97 | + public List<Turnoutrate> turnoutrate(@RequestParam Map<String, Object> map) { | |
| 98 | + | |
| 99 | + return formsService.turnoutrate(map); | |
| 100 | + } | |
| 101 | + | |
| 102 | + // 班次执行率统计表 | |
| 103 | + @RequestMapping(value = "/executionrate", method = RequestMethod.POST) | |
| 104 | + public List<Executionrate> executionrate(@RequestParam Map<String, Object> map) { | |
| 105 | + | |
| 106 | + return formsService.executionrate(map); | |
| 107 | + } | |
| 108 | + | |
| 109 | + // 营运线路名称统计表 | |
| 110 | + @RequestMapping(value = "/allline", method = RequestMethod.POST) | |
| 111 | + public List<Allline> allline(@RequestParam Map<String, Object> map) { | |
| 112 | + | |
| 113 | + return formsService.allline(map); | |
| 117 | 114 | } |
| 118 | 115 | } | ... | ... |
src/main/java/com/bsth/controller/schedule/BController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule; | |
| 2 | + | |
| 3 | +import com.bsth.common.Constants; | |
| 4 | +import com.bsth.common.ResponseCode; | |
| 5 | +import com.bsth.entity.schedule.BEntity; | |
| 6 | +import com.bsth.entity.sys.SysUser; | |
| 7 | +import com.bsth.service.schedule.BService; | |
| 8 | +import com.bsth.service.schedule.ScheduleException; | |
| 9 | +import com.bsth.service.sys.SysUserService; | |
| 10 | +import com.google.common.base.Splitter; | |
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 12 | +import org.springframework.data.domain.PageRequest; | |
| 13 | +import org.springframework.data.domain.Sort; | |
| 14 | +import org.springframework.web.bind.annotation.*; | |
| 15 | + | |
| 16 | +import javax.servlet.http.HttpSession; | |
| 17 | +import java.io.Serializable; | |
| 18 | +import java.util.*; | |
| 19 | + | |
| 20 | +/** | |
| 21 | + * 基础控制器。 | |
| 22 | + */ | |
| 23 | +public class BController<T, ID extends Serializable> { | |
| 24 | + @Autowired | |
| 25 | + protected BService<T, ID> bService; | |
| 26 | + @Autowired | |
| 27 | + private SysUserService sysUserService; | |
| 28 | + | |
| 29 | + // CRUD 操作 | |
| 30 | + // Create操作 | |
| 31 | + @RequestMapping(method = RequestMethod.POST) | |
| 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) t_b); | |
| 44 | + Map<String, Object> rtn = new HashMap<>(); | |
| 45 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 46 | + rtn.put("data", t_saved); | |
| 47 | + return rtn; | |
| 48 | + } | |
| 49 | + // Update操作 | |
| 50 | + @RequestMapping(value="/{id}", method = RequestMethod.POST) | |
| 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) t_b); | |
| 62 | + Map<String, Object> rtn = new HashMap<>(); | |
| 63 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 64 | + rtn.put("data", t_updated); | |
| 65 | + return rtn; | |
| 66 | + } | |
| 67 | + // Research操作 | |
| 68 | + @RequestMapping(value = "/{id}", method = RequestMethod.GET) | |
| 69 | + public Map<String, Object> findById(@PathVariable("id") ID id) { | |
| 70 | + T t = bService.findById(id); | |
| 71 | + Map<String, Object> rtn = new HashMap<>(); | |
| 72 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 73 | + rtn.put("data", t); | |
| 74 | + return rtn; | |
| 75 | + } | |
| 76 | + @RequestMapping(value = "/all", method = RequestMethod.GET) | |
| 77 | + public Map<String, Object> list(@RequestParam Map<String, Object> param) { | |
| 78 | + List<T> tList = bService.list(param); | |
| 79 | + Map<String, Object> rtn = new HashMap<>(); | |
| 80 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 81 | + rtn.put("data", tList); | |
| 82 | + return rtn; | |
| 83 | + } | |
| 84 | + @RequestMapping(method = RequestMethod.GET) | |
| 85 | + public Map<String, Object> list( | |
| 86 | + @RequestParam Map<String, Object> map, | |
| 87 | + @RequestParam(defaultValue = "0") int page, | |
| 88 | + @RequestParam(defaultValue = "10") int size, | |
| 89 | + @RequestParam(defaultValue = "id") String order, | |
| 90 | + @RequestParam(defaultValue = "DESC") String direction) { | |
| 91 | + // 允许多个字段排序,order可以写单个字段,也可以写多个字段 | |
| 92 | + // 多个字段格式:{col1},{col2},{col3},....,{coln} | |
| 93 | + List<String> order_columns = Splitter.on(",").trimResults().splitToList(order); | |
| 94 | + // 多字段排序:DESC,ASC... | |
| 95 | + List<String> order_dirs = Splitter.on(",").trimResults().splitToList(direction); | |
| 96 | + | |
| 97 | + Map<String, Object> rtn = new HashMap<>(); | |
| 98 | + | |
| 99 | + if (order_dirs.size() == 1) { // 所有字段采用一种排序 | |
| 100 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 101 | + if (order_dirs.get(0).equals("ASC")) { | |
| 102 | + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.ASC, order_columns)))); | |
| 103 | + } else { | |
| 104 | + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.DESC, order_columns)))); | |
| 105 | + } | |
| 106 | + } else if (order_columns.size() == order_dirs.size()) { | |
| 107 | + List<Sort.Order> orderList = new ArrayList<>(); | |
| 108 | + for (int i = 0; i < order_columns.size(); i++) { | |
| 109 | + if (null != order_dirs.get(i) && order_dirs.get(i).equals("ASC")) { | |
| 110 | + orderList.add(new Sort.Order(Sort.Direction.ASC, order_columns.get(i))); | |
| 111 | + } else { | |
| 112 | + orderList.add(new Sort.Order(Sort.Direction.DESC, order_columns.get(i))); | |
| 113 | + } | |
| 114 | + } | |
| 115 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 116 | + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(orderList)))); | |
| 117 | + } else { | |
| 118 | + throw new RuntimeException("多字段排序参数格式问题,排序顺序和字段数不一致"); | |
| 119 | + } | |
| 120 | + | |
| 121 | + return rtn; | |
| 122 | + | |
| 123 | + } | |
| 124 | + | |
| 125 | + // Delete操作 | |
| 126 | + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) | |
| 127 | + public Map<String, Object> delete(@PathVariable("id") ID id, HttpSession httpSession) { | |
| 128 | + Map<String, Object> rtn = new HashMap<>(); | |
| 129 | + try { | |
| 130 | + // 由于种种原因,这里不保存用户和操作时间了 | |
| 131 | + bService.delete(id); | |
| 132 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 133 | + } catch (ScheduleException exp) { | |
| 134 | + rtn.put("status", ResponseCode.ERROR); | |
| 135 | + rtn.put("msg", exp.getMessage()); | |
| 136 | + } | |
| 137 | + | |
| 138 | + return rtn; | |
| 139 | + } | |
| 140 | + | |
| 141 | +} | ... | ... |
src/main/java/com/bsth/controller/schedule/CarConfigInfoController.java deleted
100644 → 0
| 1 | -package com.bsth.controller.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.controller.BaseController; | |
| 4 | -import com.bsth.entity.schedule.CarConfigInfo; | |
| 5 | -import com.bsth.repository.schedule.CarConfigInfoRepository; | |
| 6 | -import com.bsth.service.schedule.utils.DataToolsProperties; | |
| 7 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
| 9 | -import org.springframework.web.bind.annotation.*; | |
| 10 | - | |
| 11 | -import java.util.List; | |
| 12 | -import java.util.Map; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * Created by xu on 16/5/9. | |
| 16 | - */ | |
| 17 | -@RestController | |
| 18 | -@RequestMapping("cci") | |
| 19 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 20 | -public class CarConfigInfoController extends BaseController<CarConfigInfo, Long> { | |
| 21 | - @Autowired | |
| 22 | - private DataToolsProperties dataToolsProperties; | |
| 23 | - @Autowired | |
| 24 | - private CarConfigInfoRepository carConfigInfoRepository; | |
| 25 | - | |
| 26 | - @Override | |
| 27 | - protected String getDataImportKtrClasspath() { | |
| 28 | - return dataToolsProperties.getCarsconfigDatainputktr(); | |
| 29 | - } | |
| 30 | - | |
| 31 | - @Override | |
| 32 | - public CarConfigInfo findById(@PathVariable("id") Long aLong) { | |
| 33 | - return carConfigInfoRepository.findOneExtend(aLong); | |
| 34 | - } | |
| 35 | - | |
| 36 | - /** | |
| 37 | - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody | |
| 38 | - * @Title: save | |
| 39 | - * @Description: TODO(持久化对象) | |
| 40 | - * @param @param t | |
| 41 | - * @param @return 设定文件 | |
| 42 | - * @return Map<String,Object> {status: 1(成功),-1(失败)} | |
| 43 | - * @throws | |
| 44 | - */ | |
| 45 | - @RequestMapping(method = RequestMethod.POST) | |
| 46 | - public Map<String, Object> save(@RequestBody CarConfigInfo t){ | |
| 47 | - return baseService.save(t); | |
| 48 | - } | |
| 49 | - | |
| 50 | - @RequestMapping(value = "/cars", method = RequestMethod.GET) | |
| 51 | - public List<Map<String, Object>> findCarConfigCars() { | |
| 52 | - return carConfigInfoRepository.findCarConfigCars(); | |
| 53 | - } | |
| 54 | - | |
| 55 | - @RequestMapping(value = "/cars2", method = RequestMethod.GET) | |
| 56 | - public List<Map<String, Object>> findCarsFromConfig() { | |
| 57 | - return carConfigInfoRepository.findCarsFromConfig(); | |
| 58 | - } | |
| 59 | -} |
src/main/java/com/bsth/controller/schedule/EmployeeConfigInfoController.java deleted
100644 → 0
| 1 | -package com.bsth.controller.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.controller.BaseController; | |
| 4 | -import com.bsth.entity.schedule.EmployeeConfigInfo; | |
| 5 | -import com.bsth.repository.schedule.EmployeeConfigInfoRepository; | |
| 6 | -import com.bsth.service.schedule.utils.DataToolsProperties; | |
| 7 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
| 9 | -import org.springframework.web.bind.annotation.*; | |
| 10 | - | |
| 11 | -import java.util.List; | |
| 12 | -import java.util.Map; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * Created by xu on 16/5/10. | |
| 16 | - */ | |
| 17 | -@RestController | |
| 18 | -@RequestMapping("eci") | |
| 19 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 20 | -public class EmployeeConfigInfoController extends BaseController<EmployeeConfigInfo, Long> { | |
| 21 | - @Autowired | |
| 22 | - private DataToolsProperties dataToolsProperties; | |
| 23 | - @Autowired | |
| 24 | - private EmployeeConfigInfoRepository employeeConfigInfoRepository; | |
| 25 | - | |
| 26 | - @Override | |
| 27 | - protected String getDataImportKtrClasspath() { | |
| 28 | - return dataToolsProperties.getEmployeesconfigDatainputktr(); | |
| 29 | - } | |
| 30 | - | |
| 31 | - @Override | |
| 32 | - public EmployeeConfigInfo findById(@PathVariable("id") Long aLong) { | |
| 33 | - return employeeConfigInfoRepository.findOneExtend(aLong); | |
| 34 | - } | |
| 35 | - | |
| 36 | - /** | |
| 37 | - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody | |
| 38 | - * @Title: save | |
| 39 | - * @Description: TODO(持久化对象) | |
| 40 | - * @param @param t | |
| 41 | - * @param @return 设定文件 | |
| 42 | - * @return Map<String,Object> {status: 1(成功),-1(失败)} | |
| 43 | - * @throws | |
| 44 | - */ | |
| 45 | - @RequestMapping(method = RequestMethod.POST) | |
| 46 | - public Map<String, Object> save(@RequestBody EmployeeConfigInfo t){ | |
| 47 | - return baseService.save(t); | |
| 48 | - } | |
| 49 | - | |
| 50 | - @RequestMapping(value = "/jsy", method = RequestMethod.GET) | |
| 51 | - public List<Map<String, Object>> findJsyFromConfig() { | |
| 52 | - return employeeConfigInfoRepository.findJsyFromConfig(); | |
| 53 | - } | |
| 54 | - | |
| 55 | - @RequestMapping(value = "/spy", method = RequestMethod.GET) | |
| 56 | - public List<Map<String, Object>> findSpyFromConfig() { | |
| 57 | - return employeeConfigInfoRepository.findSpyFromConfig(); | |
| 58 | - } | |
| 59 | -} |
src/main/java/com/bsth/controller/schedule/GuideboardInfoController.java deleted
100644 → 0
| 1 | -package com.bsth.controller.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.controller.BaseController; | |
| 4 | -import com.bsth.entity.schedule.GuideboardInfo; | |
| 5 | -import com.bsth.repository.schedule.GuideboardInfoRepository; | |
| 6 | -import com.bsth.service.schedule.utils.DataToolsProperties; | |
| 7 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
| 9 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 10 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | -import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | -import org.springframework.web.bind.annotation.RestController; | |
| 13 | - | |
| 14 | -import java.util.List; | |
| 15 | -import java.util.Map; | |
| 16 | - | |
| 17 | -/** | |
| 18 | - * Created by xu on 16/5/11. | |
| 19 | - */ | |
| 20 | -@RestController | |
| 21 | -@RequestMapping("gic") | |
| 22 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 23 | -public class GuideboardInfoController extends BaseController<GuideboardInfo, Long> { | |
| 24 | - @Autowired | |
| 25 | - private DataToolsProperties dataToolsProperties; | |
| 26 | - @Autowired | |
| 27 | - private GuideboardInfoRepository guideboardInfoRepository; | |
| 28 | - | |
| 29 | - @Override | |
| 30 | - protected String getDataImportKtrClasspath() { | |
| 31 | - return dataToolsProperties.getGuideboardsDatainputktr(); | |
| 32 | - } | |
| 33 | - | |
| 34 | - @Override | |
| 35 | - public GuideboardInfo findById(@PathVariable("id") Long aLong) { | |
| 36 | - return guideboardInfoRepository.findOneExtend(aLong); | |
| 37 | - } | |
| 38 | - | |
| 39 | - | |
| 40 | - @RequestMapping(value = "/ttlpnames", method = RequestMethod.GET) | |
| 41 | - public List<Map<String, Object>> findLpName(Long ttid) { | |
| 42 | - return guideboardInfoRepository.findLpName(ttid); | |
| 43 | - } | |
| 44 | -} |
src/main/java/com/bsth/controller/schedule/basicinfo/CarsController.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.Cars; | |
| 6 | +import com.bsth.service.schedule.CarsService; | |
| 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(value = "carsController_sc") | |
| 21 | +@RequestMapping("cars_sc") | |
| 22 | +public class CarsController extends BController<Cars, Integer> { | |
| 23 | + @Autowired | |
| 24 | + private CarsService carsService; | |
| 25 | + | |
| 26 | + @RequestMapping(value = "/validate_zbh", method = RequestMethod.GET) | |
| 27 | + public Map<String, Object> validate_zbh(@RequestParam Map<String, Object> param) { | |
| 28 | + Map<String, Object> rtn = new HashMap<>(); | |
| 29 | + try { | |
| 30 | + // 自编号验证 | |
| 31 | + Cars cars = new Cars( | |
| 32 | + param.get("id_eq"), | |
| 33 | + param.get("insideCode_eq"), | |
| 34 | + null, | |
| 35 | + null, | |
| 36 | + null); | |
| 37 | + carsService.validate_nbbh(cars); | |
| 38 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 39 | + } catch (ScheduleException exp) { | |
| 40 | + rtn.put("status", ResponseCode.ERROR); | |
| 41 | + rtn.put("msg", exp.getMessage()); | |
| 42 | + } | |
| 43 | + return rtn; | |
| 44 | + } | |
| 45 | + | |
| 46 | + @RequestMapping(value = "/validate_clbh", method = RequestMethod.GET) | |
| 47 | + public Map<String, Object> validate_clbh(@RequestParam Map<String, Object> param) { | |
| 48 | + Map<String, Object> rtn = new HashMap<>(); | |
| 49 | + try { | |
| 50 | + // 车辆编号验证 | |
| 51 | + Cars cars = new Cars( | |
| 52 | + param.get("id_eq"), | |
| 53 | + null, | |
| 54 | + param.get("carCode_eq"), | |
| 55 | + null, | |
| 56 | + null); | |
| 57 | + carsService.validate_clbh(cars); | |
| 58 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 59 | + } catch (ScheduleException exp) { | |
| 60 | + rtn.put("status", ResponseCode.ERROR); | |
| 61 | + rtn.put("msg", exp.getMessage()); | |
| 62 | + } | |
| 63 | + return rtn; | |
| 64 | + } | |
| 65 | + | |
| 66 | + @RequestMapping(value = "/validate_cph", method = RequestMethod.GET) | |
| 67 | + public Map<String, Object> validate_cph(@RequestParam Map<String, Object> param) { | |
| 68 | + Map<String, Object> rtn = new HashMap<>(); | |
| 69 | + try { | |
| 70 | + // 车牌号验证 | |
| 71 | + Cars cars = new Cars( | |
| 72 | + param.get("id_eq"), | |
| 73 | + null, | |
| 74 | + null, | |
| 75 | + param.get("carPlate_eq"), | |
| 76 | + null); | |
| 77 | + carsService.validate_cph(cars); | |
| 78 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 79 | + } catch (ScheduleException exp) { | |
| 80 | + rtn.put("status", ResponseCode.ERROR); | |
| 81 | + rtn.put("msg", exp.getMessage()); | |
| 82 | + } | |
| 83 | + return rtn; | |
| 84 | + } | |
| 85 | + | |
| 86 | + @RequestMapping(value = "/validate_sbbh", method = RequestMethod.GET) | |
| 87 | + public Map<String, Object> validate_sbbh(@RequestParam Map<String, Object> param) { | |
| 88 | + Map<String, Object> rtn = new HashMap<>(); | |
| 89 | + try { | |
| 90 | + // 设备编号验证 | |
| 91 | + Cars cars = new Cars( | |
| 92 | + param.get("id_eq"), | |
| 93 | + null, | |
| 94 | + null, | |
| 95 | + null, | |
| 96 | + param.get("equipmentCode_eq") | |
| 97 | + ); | |
| 98 | + carsService.validate_sbbh(cars); | |
| 99 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 100 | + } catch (ScheduleException exp) { | |
| 101 | + rtn.put("status", ResponseCode.ERROR); | |
| 102 | + rtn.put("msg", exp.getMessage()); | |
| 103 | + } | |
| 104 | + return rtn; | |
| 105 | + } | |
| 106 | +} | ... | ... |
src/main/java/com/bsth/controller/schedule/core/CarConfigInfoController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.core; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.controller.schedule.BController; | |
| 5 | +import com.bsth.entity.schedule.CarConfigInfo; | |
| 6 | +import com.bsth.repository.schedule.CarConfigInfoRepository; | |
| 7 | +import com.bsth.service.schedule.CarConfigInfoService; | |
| 8 | +import com.bsth.service.schedule.ScheduleException; | |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 13 | +import org.springframework.web.bind.annotation.RestController; | |
| 14 | + | |
| 15 | +import java.util.HashMap; | |
| 16 | +import java.util.List; | |
| 17 | +import java.util.Map; | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * Created by xu on 16/5/9. | |
| 21 | + */ | |
| 22 | +@RestController | |
| 23 | +@RequestMapping("cci") | |
| 24 | +public class CarConfigInfoController extends BController<CarConfigInfo, Long> { | |
| 25 | + @Autowired | |
| 26 | + private CarConfigInfoRepository carConfigInfoRepository; | |
| 27 | + @Autowired | |
| 28 | + private CarConfigInfoService carConfigInfoService; | |
| 29 | + | |
| 30 | + | |
| 31 | + @RequestMapping(value = "/cars", method = RequestMethod.GET) | |
| 32 | + public List<Map<String, Object>> findCarConfigCars() { | |
| 33 | + return carConfigInfoRepository.findCarConfigCars(); | |
| 34 | + } | |
| 35 | + | |
| 36 | + @RequestMapping(value = "/cars2", method = RequestMethod.GET) | |
| 37 | + public List<Map<String, Object>> findCarsFromConfig() { | |
| 38 | + return carConfigInfoRepository.findCarsFromConfig(); | |
| 39 | + } | |
| 40 | + | |
| 41 | + @RequestMapping(value = "/validate_cars", method = RequestMethod.GET) | |
| 42 | + public Map<String, Object> validate_cars(@RequestParam Map<String, Object> param) { | |
| 43 | + Map<String, Object> rtn = new HashMap<>(); | |
| 44 | + try { | |
| 45 | + // 车辆重复配置验证 | |
| 46 | + CarConfigInfo carConfigInfo = new CarConfigInfo( | |
| 47 | + param.get("id_eq"), | |
| 48 | + param.get("xl.id_eq"), | |
| 49 | + param.get("xl.name_eq"), | |
| 50 | + param.get("cl.id_eq") | |
| 51 | + ); | |
| 52 | + carConfigInfoService.validate_cars(carConfigInfo); | |
| 53 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 54 | + } catch (ScheduleException exp) { | |
| 55 | + rtn.put("status", ResponseCode.ERROR); | |
| 56 | + rtn.put("msg", exp.getMessage()); | |
| 57 | + } | |
| 58 | + | |
| 59 | + return rtn; | |
| 60 | + } | |
| 61 | +} | ... | ... |
src/main/java/com/bsth/controller/schedule/core/EmployeeConfigInfoController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.core; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.controller.schedule.BController; | |
| 5 | +import com.bsth.entity.schedule.EmployeeConfigInfo; | |
| 6 | +import com.bsth.repository.schedule.EmployeeConfigInfoRepository; | |
| 7 | +import com.bsth.service.schedule.EmployeeConfigInfoService; | |
| 8 | +import com.bsth.service.schedule.ScheduleException; | |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 13 | +import org.springframework.web.bind.annotation.RestController; | |
| 14 | + | |
| 15 | +import java.util.HashMap; | |
| 16 | +import java.util.List; | |
| 17 | +import java.util.Map; | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * Created by xu on 16/5/10. | |
| 21 | + */ | |
| 22 | +@RestController | |
| 23 | +@RequestMapping("eci") | |
| 24 | +public class EmployeeConfigInfoController extends BController<EmployeeConfigInfo, Long> { | |
| 25 | + @Autowired | |
| 26 | + private EmployeeConfigInfoRepository employeeConfigInfoRepository; | |
| 27 | + @Autowired | |
| 28 | + private EmployeeConfigInfoService employeeConfigInfoService; | |
| 29 | + | |
| 30 | + @RequestMapping(value = "/jsy", method = RequestMethod.GET) | |
| 31 | + public List<Map<String, Object>> findJsyFromConfig() { | |
| 32 | + return employeeConfigInfoRepository.findJsyFromConfig(); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @RequestMapping(value = "/spy", method = RequestMethod.GET) | |
| 36 | + public List<Map<String, Object>> findSpyFromConfig() { | |
| 37 | + return employeeConfigInfoRepository.findSpyFromConfig(); | |
| 38 | + } | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + @RequestMapping(value = "/validate_jsy", method = RequestMethod.GET) | |
| 43 | + public Map<String, Object> validate_jsy(@RequestParam Map<String, Object> param) { | |
| 44 | + Map<String, Object> rtn = new HashMap<>(); | |
| 45 | + try { | |
| 46 | + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo( | |
| 47 | + param.get("id_eq"), | |
| 48 | + param.get("xl.id_eq"), | |
| 49 | + param.get("xl.name_eq"), | |
| 50 | + param.get("jsy.id_eq"), | |
| 51 | + null | |
| 52 | + ); | |
| 53 | + employeeConfigInfoService.validate_jsy(employeeConfigInfo); | |
| 54 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 55 | + } catch (ScheduleException exp) { | |
| 56 | + rtn.put("status", ResponseCode.ERROR); | |
| 57 | + rtn.put("msg", exp.getMessage()); | |
| 58 | + } | |
| 59 | + | |
| 60 | + return rtn; | |
| 61 | + } | |
| 62 | + | |
| 63 | + @RequestMapping(value = "/validate_spy", method = RequestMethod.GET) | |
| 64 | + public Map<String, Object> validate_spy(@RequestParam Map<String, Object> param) { | |
| 65 | + Map<String, Object> rtn = new HashMap<>(); | |
| 66 | + try { | |
| 67 | + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo( | |
| 68 | + param.get("id_eq"), | |
| 69 | + param.get("xl.id_eq"), | |
| 70 | + param.get("xl.name_eq"), | |
| 71 | + null, | |
| 72 | + param.get("spy.id_eq") | |
| 73 | + ); | |
| 74 | + employeeConfigInfoService.validate_spy(employeeConfigInfo); | |
| 75 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 76 | + } catch (ScheduleException exp) { | |
| 77 | + rtn.put("status", ResponseCode.ERROR); | |
| 78 | + rtn.put("msg", exp.getMessage()); | |
| 79 | + } | |
| 80 | + return rtn; | |
| 81 | + } | |
| 82 | +} | ... | ... |
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.core; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.controller.schedule.BController; | |
| 5 | +import com.bsth.entity.schedule.GuideboardInfo; | |
| 6 | +import com.bsth.repository.schedule.GuideboardInfoRepository; | |
| 7 | +import com.bsth.service.schedule.GuideboardInfoService; | |
| 8 | +import com.bsth.service.schedule.ScheduleException; | |
| 9 | +import com.bsth.service.schedule.utils.DataToolsProperties; | |
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 11 | +import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
| 12 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 13 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 14 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 15 | +import org.springframework.web.bind.annotation.RestController; | |
| 16 | + | |
| 17 | +import java.util.HashMap; | |
| 18 | +import java.util.List; | |
| 19 | +import java.util.Map; | |
| 20 | + | |
| 21 | +/** | |
| 22 | + * 路牌管理控制器。 | |
| 23 | + */ | |
| 24 | +@RestController | |
| 25 | +@RequestMapping("gic") | |
| 26 | +@EnableConfigurationProperties(DataToolsProperties.class) | |
| 27 | +public class GuideboardInfoController extends BController<GuideboardInfo, Long> { | |
| 28 | + @Autowired | |
| 29 | + private GuideboardInfoService guideboardInfoService; | |
| 30 | +// @Autowired | |
| 31 | +// private DataToolsProperties dataToolsProperties; | |
| 32 | + @Autowired | |
| 33 | + private GuideboardInfoRepository guideboardInfoRepository; | |
| 34 | +// | |
| 35 | +// @Override | |
| 36 | +// protected String getDataImportKtrClasspath() { | |
| 37 | +// return dataToolsProperties.getGuideboardsDatainputktr(); | |
| 38 | +// } | |
| 39 | +// | |
| 40 | +// @Override | |
| 41 | +// public GuideboardInfo findById(@PathVariable("id") Long aLong) { | |
| 42 | +// return guideboardInfoRepository.findOneExtend(aLong); | |
| 43 | +// } | |
| 44 | +// | |
| 45 | +// | |
| 46 | + @RequestMapping(value = "/ttlpnames", method = RequestMethod.GET) | |
| 47 | + public List<Map<String, Object>> findLpName(Long ttid) { | |
| 48 | + return guideboardInfoRepository.findLpName(ttid); | |
| 49 | + } | |
| 50 | + | |
| 51 | + @RequestMapping(value = "/validate1", method = RequestMethod.GET) | |
| 52 | + public Map<String, Object> validate1(@RequestParam Map<String, Object> param) { | |
| 53 | + Map<String, Object> rtn = new HashMap<>(); | |
| 54 | + try { | |
| 55 | + // 路牌编号验证 | |
| 56 | + GuideboardInfo guideboardInfo = new GuideboardInfo( | |
| 57 | + param.get("id_eq"), | |
| 58 | + param.get("xl.id_eq"), | |
| 59 | + param.get("lpNo_eq"), | |
| 60 | + null | |
| 61 | + ); | |
| 62 | + guideboardInfoService.validate(guideboardInfo); | |
| 63 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 64 | + } catch (ScheduleException exp) { | |
| 65 | + rtn.put("status", ResponseCode.ERROR); | |
| 66 | + rtn.put("msg", exp.getMessage()); | |
| 67 | + } | |
| 68 | + return rtn; | |
| 69 | + } | |
| 70 | + | |
| 71 | + @RequestMapping(value = "/validate2", method = RequestMethod.GET) | |
| 72 | + public Map<String, Object> validate2(@RequestParam Map<String, Object> param) { | |
| 73 | + Map<String, Object> rtn = new HashMap<>(); | |
| 74 | + try { | |
| 75 | + // 路牌名称验证 | |
| 76 | + GuideboardInfo guideboardInfo = new GuideboardInfo( | |
| 77 | + param.get("id_eq"), | |
| 78 | + param.get("xl.id_eq"), | |
| 79 | + null, | |
| 80 | + param.get("lpName_eq") | |
| 81 | + ); | |
| 82 | + guideboardInfoService.validate(guideboardInfo); | |
| 83 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 84 | + } catch (ScheduleException exp) { | |
| 85 | + rtn.put("status", ResponseCode.ERROR); | |
| 86 | + rtn.put("msg", exp.getMessage()); | |
| 87 | + } | |
| 88 | + return rtn; | |
| 89 | + } | |
| 90 | +} | ... | ... |
src/main/java/com/bsth/data/forecast/ForecastRealServer.java
| 1 | 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 | 3 | import com.bsth.data.forecast.entity.ForecastResult; |
| 18 | 4 | import com.bsth.data.forecast.entity.ForecastResult.ForecastResultItem; |
| 19 | 5 | import com.bsth.data.forecast.entity.SimpleRoute; |
| ... | ... | @@ -23,6 +9,17 @@ import com.bsth.data.gpsdata.GpsRealData; |
| 23 | 9 | import com.bsth.data.schedule.DayOfSchedule; |
| 24 | 10 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 25 | 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 | 58 | @Override |
| 62 | 59 | public void run(String... arg0) throws Exception { |
| 63 | 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 | 3 | import com.bsth.data.LineConfigData; |
| 4 | 4 | import com.bsth.entity.realcontrol.LineConfig; |
| 5 | 5 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 6 | +import org.apache.commons.lang3.StringUtils; | |
| 6 | 7 | import org.joda.time.format.DateTimeFormat; |
| 7 | 8 | import org.joda.time.format.DateTimeFormatter; |
| 8 | 9 | import org.slf4j.Logger; |
| ... | ... | @@ -115,8 +116,11 @@ public class SchAttrCalculator { |
| 115 | 116 | ScheduleRealInfo prve = list.get(0), curr; |
| 116 | 117 | for(int i = 1; i < len; i ++){ |
| 117 | 118 | curr = list.get(i); |
| 118 | - if(prve.getZdzName().equals(curr.getQdzName())) | |
| 119 | + if(prve.getZdzName().equals(curr.getQdzName())){ | |
| 119 | 120 | curr.setQdzArrDateJH(prve.getZdsj()); |
| 121 | + if(StringUtils.isNotEmpty(prve.getZdsjActual()) && StringUtils.isEmpty(curr.getQdzArrDatesj())) | |
| 122 | + curr.setQdzArrDatesj(prve.getZdsjActual()); | |
| 123 | + } | |
| 120 | 124 | |
| 121 | 125 | prve = curr; |
| 122 | 126 | } | ... | ... |
src/main/java/com/bsth/entity/Cars.java
| 1 | 1 | package com.bsth.entity; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.sys.SysUser; |
| 4 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 4 | 5 | |
| 5 | 6 | import javax.persistence.*; |
| 6 | 7 | import java.io.Serializable; |
| ... | ... | @@ -22,6 +23,7 @@ import java.util.Date; |
| 22 | 23 | |
| 23 | 24 | @Entity |
| 24 | 25 | @Table(name = "bsth_c_cars") |
| 26 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 25 | 27 | public class Cars implements Serializable { |
| 26 | 28 | |
| 27 | 29 | /** 主键Id */ |
| ... | ... | @@ -30,7 +32,7 @@ public class Cars implements Serializable { |
| 30 | 32 | private Integer id; |
| 31 | 33 | |
| 32 | 34 | /** 自编号/内部编号 */ |
| 33 | - @Column(nullable = false, length = 8, unique = true) | |
| 35 | + @Column(nullable = false, length = 20, unique = true) | |
| 34 | 36 | private String insideCode; |
| 35 | 37 | |
| 36 | 38 | // 公司、分公司暂时不用关联实体 |
| ... | ... | @@ -150,6 +152,26 @@ public class Cars implements Serializable { |
| 150 | 152 | /** 修改日期 */ |
| 151 | 153 | @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") |
| 152 | 154 | private Date updateDate; |
| 155 | + | |
| 156 | + public Cars() {} | |
| 157 | + | |
| 158 | + public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) { | |
| 159 | + if (id != null) { | |
| 160 | + this.id = Integer.valueOf(id.toString()); | |
| 161 | + } | |
| 162 | + if (nbbh != null) { | |
| 163 | + this.insideCode = nbbh.toString(); | |
| 164 | + } | |
| 165 | + if (clbh != null) { | |
| 166 | + this.carCode = clbh.toString(); | |
| 167 | + } | |
| 168 | + if (cph != null) { | |
| 169 | + this.carPlate = cph.toString(); | |
| 170 | + } | |
| 171 | + if (sbbh != null) { | |
| 172 | + this.equipmentCode = sbbh.toString(); | |
| 173 | + } | |
| 174 | + } | |
| 153 | 175 | |
| 154 | 176 | public String getServiceNo() { |
| 155 | 177 | return serviceNo; | ... | ... |
src/main/java/com/bsth/entity/Line.java
| 1 | 1 | package com.bsth.entity; |
| 2 | 2 | |
| 3 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 3 | 4 | import org.springframework.format.annotation.DateTimeFormat; |
| 4 | 5 | |
| 5 | 6 | import javax.persistence.*; |
| ... | ... | @@ -23,6 +24,7 @@ import java.util.Date; |
| 23 | 24 | |
| 24 | 25 | @Entity |
| 25 | 26 | @Table(name = "bsth_c_line") |
| 27 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 26 | 28 | public class Line implements Serializable { |
| 27 | 29 | |
| 28 | 30 | @Id | ... | ... |
src/main/java/com/bsth/entity/Personnel.java
| 1 | 1 | package com.bsth.entity; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.sys.SysUser; |
| 4 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 4 | 5 | |
| 5 | 6 | import javax.persistence.*; |
| 6 | 7 | import java.util.Date; |
| ... | ... | @@ -21,6 +22,7 @@ import java.util.Date; |
| 21 | 22 | |
| 22 | 23 | @Entity |
| 23 | 24 | @Table(name = "bsth_c_personnel") |
| 25 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 24 | 26 | public class Personnel { |
| 25 | 27 | |
| 26 | 28 | /** 主键Id */ | ... | ... |
src/main/java/com/bsth/entity/mcy_forms/Operationservice.java
| ... | ... | @@ -13,6 +13,26 @@ public class Operationservice { |
| 13 | 13 | private String emptMileage;//空驶里程 |
| 14 | 14 | |
| 15 | 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 | 37 | public String getXlName() { |
| 18 | 38 | return xlName; | ... | ... |
src/main/java/com/bsth/entity/mcy_forms/Shifday.java
| ... | ... | @@ -34,7 +34,36 @@ public class Shifday { |
| 34 | 34 | |
| 35 | 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 | 67 | public String getJhlc() { |
| 39 | 68 | return jhlc; |
| 40 | 69 | } | ... | ... |
src/main/java/com/bsth/entity/mcy_forms/Shiftuehiclemanth.java
| ... | ... | @@ -20,7 +20,24 @@ public class Shiftuehiclemanth { |
| 20 | 20 | |
| 21 | 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 | 41 | public String getCjbc() { |
| 25 | 42 | return cjbc; |
| 26 | 43 | } | ... | ... |
src/main/java/com/bsth/entity/mcy_forms/Vehicleloading.java
| ... | ... | @@ -24,6 +24,26 @@ public class Vehicleloading { |
| 24 | 24 | |
| 25 | 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 | 47 | public String getLs() { |
| 28 | 48 | return ls; |
| 29 | 49 | } | ... | ... |
src/main/java/com/bsth/entity/mcy_forms/Waybillday.java
| ... | ... | @@ -20,9 +20,29 @@ public class Waybillday { |
| 20 | 20 | |
| 21 | 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 | 39 | private String yl;//用油 |
| 24 | 40 | |
| 25 | 41 | private String nbbm;//机油 |
| 42 | + | |
| 43 | + private String jgh;//员工号 | |
| 44 | + | |
| 45 | + private String rq;//日期 | |
| 26 | 46 | |
| 27 | 47 | public String getCarPlate() { |
| 28 | 48 | return carPlate; | ... | ... |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| ... | ... | @@ -163,7 +163,7 @@ public class ScheduleRealInfo { |
| 163 | 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 | 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,7 @@ package com.bsth.entity.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.Cars; |
| 4 | 4 | import com.bsth.entity.Line; |
| 5 | -import com.bsth.entity.sys.SysUser; | |
| 5 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 6 | 6 | |
| 7 | 7 | import javax.persistence.*; |
| 8 | 8 | import java.io.Serializable; |
| ... | ... | @@ -19,7 +19,8 @@ import java.util.Date; |
| 19 | 19 | @NamedAttributeNode("cl") |
| 20 | 20 | }) |
| 21 | 21 | }) |
| 22 | -public class CarConfigInfo implements Serializable { | |
| 22 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 23 | +public class CarConfigInfo extends BEntity implements Serializable { | |
| 23 | 24 | |
| 24 | 25 | /** 主健Id */ |
| 25 | 26 | @Id |
| ... | ... | @@ -57,19 +58,24 @@ public class CarConfigInfo implements Serializable { |
| 57 | 58 | @Column(nullable = false) |
| 58 | 59 | private Boolean isCancel = false; |
| 59 | 60 | |
| 60 | - /** 创建人 */ | |
| 61 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | |
| 62 | - private SysUser createBy; | |
| 63 | - /** 修改人 */ | |
| 64 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | |
| 65 | - private SysUser updateBy; | |
| 61 | + public CarConfigInfo() {} | |
| 62 | + public CarConfigInfo(Object id, Object xlid, Object xlname, Object clid) { | |
| 63 | + if (id != null) { | |
| 64 | + this.id = Long.parseLong(id.toString()); | |
| 65 | + } | |
| 66 | + if (xlid != null && xlname != null) { | |
| 67 | + Line line = new Line(); | |
| 68 | + line.setId(Integer.valueOf(xlid.toString())); | |
| 69 | + line.setName(xlname.toString()); | |
| 70 | + this.xl = line; | |
| 71 | + } | |
| 72 | + if (clid != null) { | |
| 73 | + Cars cars = new Cars(); | |
| 74 | + cars.setId(Integer.valueOf(clid.toString())); | |
| 75 | + this.cl = cars; | |
| 76 | + } | |
| 66 | 77 | |
| 67 | - /** 创建日期 */ | |
| 68 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 69 | - private Date createDate; | |
| 70 | - /** 修改日期 */ | |
| 71 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 72 | - private Date updateDate; | |
| 78 | + } | |
| 73 | 79 | |
| 74 | 80 | public Long getId() { |
| 75 | 81 | return id; |
| ... | ... | @@ -143,38 +149,6 @@ public class CarConfigInfo implements Serializable { |
| 143 | 149 | this.isSwitch = isSwitch; |
| 144 | 150 | } |
| 145 | 151 | |
| 146 | - public SysUser getCreateBy() { | |
| 147 | - return createBy; | |
| 148 | - } | |
| 149 | - | |
| 150 | - public void setCreateBy(SysUser createBy) { | |
| 151 | - this.createBy = createBy; | |
| 152 | - } | |
| 153 | - | |
| 154 | - public SysUser getUpdateBy() { | |
| 155 | - return updateBy; | |
| 156 | - } | |
| 157 | - | |
| 158 | - public void setUpdateBy(SysUser updateBy) { | |
| 159 | - this.updateBy = updateBy; | |
| 160 | - } | |
| 161 | - | |
| 162 | - public Date getCreateDate() { | |
| 163 | - return createDate; | |
| 164 | - } | |
| 165 | - | |
| 166 | - public void setCreateDate(Date createDate) { | |
| 167 | - this.createDate = createDate; | |
| 168 | - } | |
| 169 | - | |
| 170 | - public Date getUpdateDate() { | |
| 171 | - return updateDate; | |
| 172 | - } | |
| 173 | - | |
| 174 | - public void setUpdateDate(Date updateDate) { | |
| 175 | - this.updateDate = updateDate; | |
| 176 | - } | |
| 177 | - | |
| 178 | 152 | public Boolean getIsCancel() { |
| 179 | 153 | return isCancel; |
| 180 | 154 | } | ... | ... |
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
| ... | ... | @@ -3,12 +3,12 @@ package com.bsth.entity.schedule; |
| 3 | 3 | import com.bsth.entity.Cars; |
| 4 | 4 | import com.bsth.entity.Line; |
| 5 | 5 | import com.bsth.entity.Personnel; |
| 6 | -import com.bsth.entity.sys.SysUser; | |
| 6 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 7 | 7 | import org.hibernate.annotations.Formula; |
| 8 | 8 | |
| 9 | 9 | import javax.persistence.*; |
| 10 | 10 | import javax.validation.constraints.NotNull; |
| 11 | -import java.util.Date; | |
| 11 | +import java.io.Serializable; | |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * 人员配置信息。 |
| ... | ... | @@ -22,7 +22,8 @@ import java.util.Date; |
| 22 | 22 | @NamedAttributeNode("xl") |
| 23 | 23 | }) |
| 24 | 24 | }) |
| 25 | -public class EmployeeConfigInfo { | |
| 25 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 26 | +public class EmployeeConfigInfo extends BEntity implements Serializable { | |
| 26 | 27 | |
| 27 | 28 | /** 主键Id */ |
| 28 | 29 | @Id |
| ... | ... | @@ -53,19 +54,29 @@ public class EmployeeConfigInfo { |
| 53 | 54 | @Column(nullable = false) |
| 54 | 55 | private Boolean isCancel = false; |
| 55 | 56 | |
| 56 | - /** 创建人 */ | |
| 57 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | |
| 58 | - private SysUser createBy; | |
| 59 | - /** 修改人 */ | |
| 60 | - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) | |
| 61 | - private SysUser updateBy; | |
| 62 | - | |
| 63 | - /** 创建日期 */ | |
| 64 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 65 | - private Date createDate; | |
| 66 | - /** 修改日期 */ | |
| 67 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 68 | - private Date updateDate; | |
| 57 | + public EmployeeConfigInfo() {} | |
| 58 | + | |
| 59 | + public EmployeeConfigInfo(Object id, Object xlid, Object xlname, Object jsyid, Object spyid) { | |
| 60 | + if (id != null) { | |
| 61 | + this.id = Long.parseLong(id.toString()); | |
| 62 | + } | |
| 63 | + if (xlid != null && xlname != null) { | |
| 64 | + Line line = new Line(); | |
| 65 | + line.setId(Integer.valueOf(xlid.toString())); | |
| 66 | + line.setName(xlname.toString()); | |
| 67 | + this.xl = line; | |
| 68 | + } | |
| 69 | + if (jsyid != null) { | |
| 70 | + Personnel personnel = new Personnel(); | |
| 71 | + personnel.setId(Integer.valueOf(jsyid.toString())); | |
| 72 | + this.jsy = personnel; | |
| 73 | + } | |
| 74 | + if (spyid != null) { | |
| 75 | + Personnel personnel = new Personnel(); | |
| 76 | + personnel.setId(Integer.valueOf(spyid.toString())); | |
| 77 | + this.spy = personnel; | |
| 78 | + } | |
| 79 | + } | |
| 69 | 80 | |
| 70 | 81 | public Long getId() { |
| 71 | 82 | return id; |
| ... | ... | @@ -130,36 +141,4 @@ public class EmployeeConfigInfo { |
| 130 | 141 | public void setIsCancel(Boolean isCancel) { |
| 131 | 142 | this.isCancel = isCancel; |
| 132 | 143 | } |
| 133 | - | |
| 134 | - public SysUser getCreateBy() { | |
| 135 | - return createBy; | |
| 136 | - } | |
| 137 | - | |
| 138 | - public void setCreateBy(SysUser createBy) { | |
| 139 | - this.createBy = createBy; | |
| 140 | - } | |
| 141 | - | |
| 142 | - public SysUser getUpdateBy() { | |
| 143 | - return updateBy; | |
| 144 | - } | |
| 145 | - | |
| 146 | - public void setUpdateBy(SysUser updateBy) { | |
| 147 | - this.updateBy = updateBy; | |
| 148 | - } | |
| 149 | - | |
| 150 | - public Date getCreateDate() { | |
| 151 | - return createDate; | |
| 152 | - } | |
| 153 | - | |
| 154 | - public void setCreateDate(Date createDate) { | |
| 155 | - this.createDate = createDate; | |
| 156 | - } | |
| 157 | - | |
| 158 | - public Date getUpdateDate() { | |
| 159 | - return updateDate; | |
| 160 | - } | |
| 161 | - | |
| 162 | - public void setUpdateDate(Date updateDate) { | |
| 163 | - this.updateDate = updateDate; | |
| 164 | - } | |
| 165 | 144 | } | ... | ... |
src/main/java/com/bsth/entity/schedule/GuideboardInfo.java
| ... | ... | @@ -2,9 +2,9 @@ package com.bsth.entity.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.Line; |
| 4 | 4 | import com.bsth.entity.sys.SysUser; |
| 5 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 5 | 6 | |
| 6 | 7 | import javax.persistence.*; |
| 7 | -import javax.persistence.Table; | |
| 8 | 8 | import java.util.Date; |
| 9 | 9 | |
| 10 | 10 | /** |
| ... | ... | @@ -17,6 +17,7 @@ import java.util.Date; |
| 17 | 17 | @NamedAttributeNode("xl") |
| 18 | 18 | }) |
| 19 | 19 | }) |
| 20 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 20 | 21 | public class GuideboardInfo { |
| 21 | 22 | |
| 22 | 23 | /** 主键Id */ |
| ... | ... | @@ -38,6 +39,10 @@ public class GuideboardInfo { |
| 38 | 39 | @Column(nullable = false) |
| 39 | 40 | private String lpType; |
| 40 | 41 | |
| 42 | + /** 是否删除(标记) */ | |
| 43 | + @Column(nullable = false) | |
| 44 | + private Boolean isCancel = false; | |
| 45 | + | |
| 41 | 46 | /** 创建人 */ |
| 42 | 47 | @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) |
| 43 | 48 | private SysUser createBy; |
| ... | ... | @@ -53,6 +58,34 @@ public class GuideboardInfo { |
| 53 | 58 | private Date updateDate; |
| 54 | 59 | |
| 55 | 60 | |
| 61 | + public GuideboardInfo() {} | |
| 62 | + | |
| 63 | + public GuideboardInfo(Object id, Object xlid, Object lpNo, Object lpName) { | |
| 64 | + if (id != null) { | |
| 65 | + this.id = Long.parseLong(id.toString()); | |
| 66 | + } | |
| 67 | + | |
| 68 | + Integer xlid_ = xlid == null ? null : Integer.valueOf(xlid.toString()); | |
| 69 | + Integer lpNo_ = lpNo == null ? null : Integer.valueOf(lpNo.toString()); | |
| 70 | + String lpName_ = lpName == null ? null : String.valueOf(lpName); | |
| 71 | + | |
| 72 | + if (xlid_ != null) { | |
| 73 | + Line line = new Line(); | |
| 74 | + line.setId(xlid_); | |
| 75 | + this.xl = line; | |
| 76 | + } | |
| 77 | + | |
| 78 | + this.lpNo = lpNo_; | |
| 79 | + this.lpName = lpName_; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public GuideboardInfo(Object id, Integer xlid, Integer lpNo) { | |
| 83 | + this(id, xlid, lpNo, null); | |
| 84 | + } | |
| 85 | + public GuideboardInfo(Object id, Integer xlid, String lpName) { | |
| 86 | + this(id, xlid, null, lpName); | |
| 87 | + } | |
| 88 | + | |
| 56 | 89 | public Long getId() { |
| 57 | 90 | return id; |
| 58 | 91 | } |
| ... | ... | @@ -124,4 +157,12 @@ public class GuideboardInfo { |
| 124 | 157 | public void setUpdateDate(Date updateDate) { |
| 125 | 158 | this.updateDate = updateDate; |
| 126 | 159 | } |
| 160 | + | |
| 161 | + public Boolean getIsCancel() { | |
| 162 | + return isCancel; | |
| 163 | + } | |
| 164 | + | |
| 165 | + public void setIsCancel(Boolean isCancel) { | |
| 166 | + this.isCancel = isCancel; | |
| 167 | + } | |
| 127 | 168 | } | ... | ... |
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
| ... | ... | @@ -163,8 +163,10 @@ public class SchedulePlanInfo { |
| 163 | 163 | |
| 164 | 164 | // TODO:关联的公司名称 |
| 165 | 165 | // TODO:关联的公司编码 |
| 166 | + this.gsBm = xl.getCompany(); | |
| 166 | 167 | // TODO:关联的分公司名称 |
| 167 | 168 | // TODO:关联的分公司编码 |
| 169 | + this.fgsBm = xl.getBrancheCompany(); | |
| 168 | 170 | // TODO:关联的出场顺序号 |
| 169 | 171 | |
| 170 | 172 | // 关联的排班计划 | ... | ... |
src/main/java/com/bsth/entity/sys/SysUser.java
| 1 | 1 | package com.bsth.entity.sys; |
| 2 | 2 | |
| 3 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 4 | + | |
| 5 | +import javax.persistence.*; | |
| 3 | 6 | import java.util.Date; |
| 4 | 7 | import java.util.LinkedHashSet; |
| 5 | 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 | 10 | @Entity |
| 17 | 11 | @Table(name = "bsth_c_sys_user") |
| 12 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 18 | 13 | public class SysUser { |
| 19 | 14 | |
| 20 | 15 | @Id | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -85,6 +85,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 85 | 85 | @Query(value="select s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') order by bcs") |
| 86 | 86 | List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date); |
| 87 | 87 | |
| 88 | + @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between str_to_date(?3,'%Y-%m-%d') and str_to_date(?4,'%Y-%m-%d') order by bcs") | |
| 89 | + List<ScheduleRealInfo> queryListWaybill4(String jName,String clZbh,String date,String enddate); | |
| 90 | + | |
| 88 | 91 | @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2") |
| 89 | 92 | List<ScheduleRealInfo> scheduleDaily(String line,String date); |
| 90 | 93 | |
| ... | ... | @@ -118,4 +121,5 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 118 | 121 | |
| 119 | 122 | @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm") |
| 120 | 123 | List<ScheduleRealInfo> setDDRBGroup(String date); |
| 124 | + | |
| 121 | 125 | } | ... | ... |
src/main/java/com/bsth/service/forms/FormsService.java
| ... | ... | @@ -30,7 +30,7 @@ public interface FormsService { |
| 30 | 30 | |
| 31 | 31 | public List<Singledata> singledata(Map<String, Object> map); |
| 32 | 32 | |
| 33 | - public List<Vehicleloading> vehicleloading(String line,String data); | |
| 33 | + public List<Vehicleloading> vehicleloading(/*String gsdmVehic,String fgsdmVehic,*/String line,String data); | |
| 34 | 34 | |
| 35 | 35 | public List<Operationservice> operationservice(Map<String, Object> map); |
| 36 | 36 | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| 1 | 1 | package com.bsth.service.forms.impl; |
| 2 | 2 | |
| 3 | -import java.math.BigDecimal; | |
| 4 | -import java.math.MathContext; | |
| 5 | -import java.math.RoundingMode; | |
| 6 | 3 | import java.sql.ResultSet; |
| 7 | 4 | import java.sql.SQLException; |
| 8 | 5 | import java.text.NumberFormat; |
| 9 | 6 | import java.text.ParseException; |
| 10 | 7 | import java.text.SimpleDateFormat; |
| 11 | -import java.util.ArrayList; | |
| 12 | 8 | import java.util.Date; |
| 13 | 9 | import java.util.HashMap; |
| 14 | 10 | import java.util.List; |
| ... | ... | @@ -32,8 +28,6 @@ import com.bsth.entity.mcy_forms.Changetochange; |
| 32 | 28 | import com.bsth.entity.mcy_forms.Executionrate; |
| 33 | 29 | import com.bsth.service.forms.FormsService; |
| 34 | 30 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 35 | -import com.bsth.util.ReportRelatedUtils; | |
| 36 | -import com.bsth.util.ReportUtils; | |
| 37 | 31 | |
| 38 | 32 | @Service |
| 39 | 33 | public class FormsServiceImpl implements FormsService { |
| ... | ... | @@ -47,14 +41,17 @@ public class FormsServiceImpl implements FormsService { |
| 47 | 41 | // 行车路单日报表 |
| 48 | 42 | @Override |
| 49 | 43 | public List<Waybillday> waybillday(Map<String, Object> map) { |
| 50 | - List list1 = new ArrayList<>();// | |
| 51 | - String sql ="select x.schedule_date,x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name " | |
| 52 | - + "from bsth_c_s_sp_info_real x INNER join " | |
| 53 | - + "( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,c.personnel_name from" | |
| 44 | + String sql ="select x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name " | |
| 45 | + + " from bsth_c_s_sp_info_real x INNER join " | |
| 46 | + + " ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,c.personnel_name from" | |
| 54 | 47 | + " bsth_c_ylb y LEFT JOIN bsth_c_personnel c ON c.job_code=y.JSY " |
| 55 | - + "where to_days(y.RQ)=to_days('"+map.get("date").toString() + "') and y.XLBM= '"+ map.get("line").toString()+"' GROUP BY y.NBBM) " | |
| 56 | - + "z on x.cl_zbh=z.nbbm where to_days( x.schedule_date)=to_days('"+map.get("date").toString()+"') " | |
| 57 | - + "and x.xl_bm='"+map.get("line").toString()+"' GROUP BY x.cl_zbh,j_gh"; | |
| 48 | + + " where to_days(y.RQ)=to_days('"+map.get("date").toString() + "') and y.XLBM= '"+ map.get("line").toString()+"' GROUP BY y.NBBM) " | |
| 49 | + + " z on x.cl_zbh=z.nbbm where to_days( x.schedule_date)=to_days('"+map.get("date").toString()+"') " | |
| 50 | + + " and x.xl_bm='"+map.get("line").toString()+"'" | |
| 51 | + /*+ " and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"'" | |
| 52 | + + " and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"'"*/ | |
| 53 | + + " GROUP BY x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name"; | |
| 54 | + //x.cl_zbh,j_gh | |
| 58 | 55 | List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() { |
| 59 | 56 | @Override |
| 60 | 57 | public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException { |
| ... | ... | @@ -67,28 +64,40 @@ public class FormsServiceImpl implements FormsService { |
| 67 | 64 | // System.out.println(arg0.getObject("yl")); |
| 68 | 65 | // wbd.setYl(arg0.getString("yl")); |
| 69 | 66 | // wbd.setNbbm(arg0.getString("nbbm")); |
| 70 | - Map<String, Object> maps = new HashMap<>(); | |
| 71 | - maps = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"), | |
| 72 | - arg0.getString("schedule_date")); | |
| 73 | - wbd.setJzl1(maps.get("ksgl").toString()); | |
| 74 | - wbd.setZlc(maps.get("realMileage").toString()); | |
| 75 | - | |
| 67 | + wbd.setRq(arg0.getString("schedule_date")); | |
| 68 | + wbd.setJgh(arg0.getString("j_gh")); | |
| 76 | 69 | return wbd; |
| 77 | 70 | |
| 78 | 71 | } |
| 79 | 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 | + } | |
| 80 | 83 | return list; |
| 81 | 84 | } |
| 82 | 85 | |
| 83 | 86 | // 线路客流量报表 |
| 84 | 87 | @Override |
| 85 | 88 | public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map) { |
| 86 | - String sql = " SELECT s.station_name,l.name,l.create_date from bsth_c_stationroute s " | |
| 87 | - + " LEFT JOIN bsth_c_line l on s.line_code=l.line_code " | |
| 89 | + String sql = " SELECT s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name" | |
| 90 | + + " from bsth_c_stationroute s " | |
| 91 | + + " LEFT JOIN bsth_c_line l on s.line_code=l.line_code " | |
| 92 | + + " LEFT JOIN bsth_c_s_sp_info_real r on r.xl_bm=l.line_code" | |
| 88 | 93 | + " where to_days(l.create_date)=to_days('"+map.get("date").toString() + "') " |
| 89 | - + " and l.line_code=" + map.get("line").toString() | |
| 90 | - + " GROUP BY s.station_name "; | |
| 94 | + + " and l.line_code=" + map.get("line").toString() | |
| 95 | + + " AND r.gs_bm is not null" | |
| 96 | + /*+ " and r.gs_bm='"+map.get("gsdmLine").toString()+"'" | |
| 97 | + + " and r.fgs_bm='"+map.get("fgsdmLine").toString()+"'"*/ | |
| 98 | + + " GROUP BY s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "; | |
| 91 | 99 | |
| 100 | + //s.station_name | |
| 92 | 101 | List<Linepasswengerflow> list = jdbcTemplate.query(sql, new RowMapper<Linepasswengerflow>() { |
| 93 | 102 | |
| 94 | 103 | @Override |
| ... | ... | @@ -99,6 +108,9 @@ public class FormsServiceImpl implements FormsService { |
| 99 | 108 | return lin; |
| 100 | 109 | } |
| 101 | 110 | }); |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 102 | 114 | return list; |
| 103 | 115 | } |
| 104 | 116 | |
| ... | ... | @@ -108,13 +120,18 @@ public class FormsServiceImpl implements FormsService { |
| 108 | 120 | |
| 109 | 121 | @Override |
| 110 | 122 | public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) { |
| 111 | - List list1 = new ArrayList<>();// | |
| 112 | - String sql = "select r.j_name,r.schedule_date_str,r.update_date,r.cl_zbh " + " from bsth_c_s_sp_info_real r " | |
| 113 | - + " LEFT JOIN bsth_c_s_ttinfo_detail d on r.lp_name=d.lp " | |
| 114 | - + " LEFT JOIN bsth_c_line_information l on l.line=r.lp_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 " | |
| 124 | + + " from bsth_c_s_sp_info_real r " | |
| 115 | 125 | + " where to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') " |
| 116 | - + " and to_days('" + map.get("endDate").toString() + "') " + " and r.xl_bm='" | |
| 117 | - + map.get("line").toString() + "' " + " GROUP BY r.j_name" + " ORDER BY r.j_name"; | |
| 126 | + + " and to_days('" + map.get("endDate").toString() + "') " | |
| 127 | + + " and r.xl_bm='"+ map.get("line").toString() + "'" | |
| 128 | + + " AND r.gs_bm is not null" | |
| 129 | + + " and r.bc_type not in('in','out')" | |
| 130 | + /* + " and r.gs_bm='"+map.get("gsdmManth").toString()+"'" | |
| 131 | + + " and r.fgs_bm='"+map.get("fgsdmManth").toString()+"'"*/ | |
| 132 | + + " GROUP BY r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name" | |
| 133 | + + " ORDER BY r.j_name"; | |
| 134 | + //r.j_name | |
| 118 | 135 | startDate = map.get("startDate").toString(); |
| 119 | 136 | endDate = map.get("endDate").toString(); |
| 120 | 137 | List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { |
| ... | ... | @@ -123,34 +140,45 @@ public class FormsServiceImpl implements FormsService { |
| 123 | 140 | public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 124 | 141 | Shiftuehiclemanth shif = new Shiftuehiclemanth(); |
| 125 | 142 | shif.setjName(arg0.getString("j_name")); |
| 126 | - | |
| 127 | - Map<String, Object> maps = new HashMap<>(); | |
| 128 | - | |
| 129 | - maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate, | |
| 130 | - endDate); | |
| 131 | - shif.setJhlc(maps.get("jhlc").toString()); | |
| 132 | - shif.setEmptMileage(maps.get("ksgl").toString()); | |
| 133 | - shif.setRemMileage(maps.get("remMileage").toString()); | |
| 134 | - shif.setAddMileage(maps.get("addMileage").toString()); | |
| 135 | - shif.setTotalm(maps.get("realMileage").toString()); | |
| 136 | - shif.setCjbc(maps.get("cjbc").toString()); | |
| 137 | - shif.setLjbc(maps.get("ljbc").toString()); | |
| 138 | - shif.setSjbc(maps.get("sjbc").toString()); | |
| 139 | - | |
| 143 | + shif.setJgh(arg0.getString("j_gh")); | |
| 144 | + shif.setZbh(arg0.getString("cl_zbh")); | |
| 140 | 145 | return shif; |
| 141 | - | |
| 142 | 146 | } |
| 143 | 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()); | |
| 144 | 164 | |
| 165 | + } | |
| 145 | 166 | return list; |
| 146 | 167 | } |
| 147 | 168 | |
| 148 | 169 | // 班次车辆人员日统计 |
| 149 | 170 | @Override |
| 150 | 171 | public List<Shifday> shifday(Map<String, Object> map) { |
| 151 | - String sql = " select r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.schedule_date,r.cl_zbh,r.j_gh " | |
| 152 | - + " FROM bsth_c_s_sp_info_real r " + " where to_days(r.schedule_date)=to_days('" | |
| 153 | - + map.get("date").toString() + "') and r.xl_bm=" + map.get("line").toString() + " GROUP BY r.j_name "; | |
| 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," | |
| 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 " | |
| 174 | + + " FROM bsth_c_s_sp_info_real r " | |
| 175 | + + " where to_days(r.schedule_date)=to_days('" | |
| 176 | + + map.get("date").toString() + "') and r.xl_bm=" + map.get("line").toString() | |
| 177 | + + " and r.bc_type not in('in','out')" | |
| 178 | + /*+ " and r.gs_bm='"+map.get("gsdmShif").toString()+"'" | |
| 179 | + + " and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'"*/ | |
| 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 " | |
| 181 | + + " ORDER BY r.lp_name asc"; | |
| 154 | 182 | |
| 155 | 183 | List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { |
| 156 | 184 | |
| ... | ... | @@ -161,25 +189,34 @@ public class FormsServiceImpl implements FormsService { |
| 161 | 189 | shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString()); |
| 162 | 190 | shifday.setLpName(arg0.getString("r.lp_name").toString()); |
| 163 | 191 | shifday.setCarPlate(arg0.getString("cl_zbh").toString()); |
| 164 | - | |
| 165 | - Map<String, Object> map = new HashMap<>(); | |
| 166 | - map = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"), | |
| 167 | - arg0.getString("schedule_date")); | |
| 168 | - shifday.setJhlc(map.get("jhlc").toString());// 计划里程 | |
| 169 | - // shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程 | |
| 170 | - shifday.setYygl(map.get("yygl").toString());// 营运里程 | |
| 171 | - shifday.setEmptMileage(map.get("ksgl").toString());// 空驶里程 | |
| 172 | - shifday.setRemMileage(map.get("remMileage").toString());// 抽减里程 | |
| 173 | - shifday.setAddMileage(map.get("addMileage").toString());// 增加里程 | |
| 174 | - shifday.setTotalm(map.get("realMileage").toString());// 总里程 | |
| 175 | - shifday.setJhbc(map.get("jhbc").toString());// 计划班次 | |
| 176 | - // shifday.setSjjhbc(map.get("sjjhbc").toString());//实际计划班次 | |
| 177 | - shifday.setCjbc(map.get("cjbc").toString());// 抽减班次 | |
| 178 | - shifday.setLjbc(map.get("ljbc").toString());// 增加班次 | |
| 179 | - 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")); | |
| 180 | 195 | return shifday; |
| 181 | 196 | } |
| 197 | + | |
| 182 | 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 | + | |
| 183 | 220 | return list; |
| 184 | 221 | } |
| 185 | 222 | |
| ... | ... | @@ -226,20 +263,20 @@ public class FormsServiceImpl implements FormsService { |
| 226 | 263 | Changetochange chan = new Changetochange(); |
| 227 | 264 | |
| 228 | 265 | chan.setRq(rq); |
| 229 | - chan.setGs(arg0.getString("gs").toString()); | |
| 230 | - chan.setFgs(arg0.getString("fgs").toString()); | |
| 231 | - chan.setXl(arg0.getString("xl").toString()); | |
| 232 | - chan.setLp(arg0.getString("lp").toString()); | |
| 233 | - chan.setFssj(arg0.getString("fssj").toString()); | |
| 234 | - chan.setXgsj(arg0.getString("xgsj").toString()); | |
| 235 | - chan.setPcch(arg0.getString("pcch").toString()); | |
| 236 | - chan.setPcry(arg0.getString("pcry").toString()); | |
| 237 | - chan.setJhch(arg0.getString("jhch").toString()); | |
| 238 | - chan.setJhgh(arg0.getString("jhgh").toString()); | |
| 239 | - chan.setSjch(arg0.getString("sjch").toString()); | |
| 240 | - chan.setSjgh(arg0.getString("sjgh").toString()); | |
| 241 | - chan.setYy(arg0.getString("yy").toString()); | |
| 242 | - 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")); | |
| 243 | 280 | return chan; |
| 244 | 281 | } |
| 245 | 282 | }); |
| ... | ... | @@ -249,39 +286,69 @@ public class FormsServiceImpl implements FormsService { |
| 249 | 286 | // 路单数据 |
| 250 | 287 | @Override |
| 251 | 288 | public List<Singledata> singledata(Map<String, Object> map) { |
| 289 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 290 | + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); | |
| 291 | + Date d = null; | |
| 292 | + Date d1 = null; | |
| 293 | + try { | |
| 294 | + d = sdf.parse(map.get("startDate").toString()); | |
| 295 | + d1 = sdf.parse(map.get("endDate").toString()); | |
| 296 | + } catch (ParseException e) { | |
| 252 | 297 | |
| 253 | - String sql = " SELECT y.RQ,y.SSGSDM,y.XLBM,y.NBBM,y.JSY,y.YH,y.JZL " + " FROM bsth_c_ylb y" | |
| 254 | - + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "'" + " and '" | |
| 255 | - + map.get("endDate").toString() + "'" + " and y.XLBM='" + map.get("line").toString() + "'" | |
| 256 | - + " GROUP BY y.NBBM "; | |
| 298 | + e.printStackTrace(); | |
| 299 | + } | |
| 300 | + String rq2 = sdf1.format(d); | |
| 301 | + String rq3 = sdf1.format(d1); | |
| 257 | 302 | |
| 303 | + rq = rq2 + "-" + rq3; | |
| 304 | + | |
| 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 " | |
| 306 | + + " FROM bsth_c_s_sp_info_real r " | |
| 307 | + + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y " | |
| 308 | + + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "' and '"+ map.get("endDate").toString() + "'" | |
| 309 | + + " and y.XLBM= '" + map.get("line").toString() + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y on r.cl_zbh=y.nbbm " | |
| 310 | + + " where r.schedule_date_str BETWEEN '" + map.get("startDate").toString() + "'" | |
| 311 | + + " and '"+ map.get("endDate").toString() + "'" | |
| 312 | + + " and r.xl_bm='" + map.get("line").toString() + "'" | |
| 313 | + + " AND r.gs_bm is not null" | |
| 314 | + /* + " and r.gs_bm='"+map.get("gsdmSing").toString()+"'" | |
| 315 | + + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"'"*/ | |
| 316 | + + " GROUP BY 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 "; | |
| 317 | + | |
| 318 | + startDate = map.get("startDate").toString(); | |
| 319 | + endDate = map.get("endDate").toString(); | |
| 258 | 320 | List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 259 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 260 | - | |
| 321 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 261 | 322 | @Override |
| 262 | 323 | public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 263 | 324 | Singledata sin = new Singledata(); |
| 264 | - sin.setrQ(sdf.format(arg0.getDate("rq"))); | |
| 265 | - sin.setgS(arg0.getString("SSGSDM").toString()); | |
| 266 | - sin.setxL(arg0.getString("XLBM").toString()); | |
| 267 | - sin.setClzbh(arg0.getString("NBBM").toString()); | |
| 268 | - sin.setJsy(arg0.getString("JSY").toString()); | |
| 269 | - sin.setHyl(arg0.getString("YH").toString()); | |
| 270 | - sin.setJzl(arg0.getString("JZL").toString()); | |
| 325 | + sin.setrQ(rq); | |
| 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")); | |
| 271 | 333 | // sin.setJzl(arg0.getString(""));//非营业性用油 |
| 272 | 334 | sin.setJhjl(arg0.getString("JZL")); |
| 273 | - Map<String, Object> maps = new HashMap<>(); | |
| 274 | - maps = scheduleRealInfoService.findKMBC2(sin.getJsy(), sin.getClzbh(), sin.getrQ()); | |
| 275 | - sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString()); | |
| 276 | - sin.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString()); | |
| 277 | - sin.setsName(maps.get("s_name") == null ? "" : maps.get("s_name").toString()); | |
| 278 | - sin.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString()); | |
| 279 | - sin.setEmptMileage(maps.get("ksgl") == null ? "" : maps.get("ksgl").toString()); | |
| 280 | - sin.setJhjl(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString()); | |
| 281 | - | |
| 335 | + | |
| 282 | 336 | return sin; |
| 283 | 337 | } |
| 284 | 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 | + } | |
| 285 | 352 | return list; |
| 286 | 353 | } |
| 287 | 354 | |
| ... | ... | @@ -289,59 +356,97 @@ public class FormsServiceImpl implements FormsService { |
| 289 | 356 | @Override |
| 290 | 357 | public List<Operationservice> operationservice(Map<String, Object> map) { |
| 291 | 358 | |
| 292 | - String sql = " SELECT y.RQ,y.XLBM,y.NBBM,y.JSY,y.YH,y.JZL " + " FROM bsth_c_ylb y" + " where y.RQ BETWEEN '" | |
| 293 | - + map.get("startDate").toString() + "'" + " and '" + map.get("endDate").toString() + "'" | |
| 294 | - + " and y.XLBM='" + map.get("line").toString() + "'" + " GROUP BY y.NBBM "; | |
| 295 | - | |
| 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 " | |
| 360 | + + " FROM bsth_c_s_sp_info_real r " | |
| 361 | + // + "LEFT JOIN bsth_c_s_sp_info_real r on r.cl_zbh=y.NBBM" | |
| 362 | + + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y " | |
| 363 | + + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "' and '"+ map.get("endDate").toString() + "'" | |
| 364 | + + " and y.XLBM= '" + map.get("line").toString() + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y on r.cl_zbh=y.nbbm " | |
| 365 | + + " where r.schedule_date_str BETWEEN '"+ map.get("startDate").toString() | |
| 366 | + + "'" + " and '" + map.get("endDate").toString() + "'" | |
| 367 | + + " and r.xl_bm='" + map.get("line").toString() + "'" | |
| 368 | + + " and r.bc_type not in('in','out')" | |
| 369 | + /* + " and r.gs_bm='"+map.get("gsdmOperat").toString()+"'" | |
| 370 | + + " and r.fgs_bm='"+map.get("fgsdmOperat").toString()+"'"*/ | |
| 371 | + + " AND r.gs_bm is not null" | |
| 372 | + + " GROUP BY 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"; | |
| 373 | + | |
| 374 | + //r.j_name | |
| 375 | + startDate = map.get("startDate").toString(); | |
| 376 | + endDate = map.get("endDate").toString(); | |
| 296 | 377 | List<Operationservice> list = jdbcTemplate.query(sql, new RowMapper<Operationservice>() { |
| 297 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 298 | 378 | |
| 299 | 379 | @Override |
| 300 | 380 | public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 301 | - Singledata sin = new Singledata(); | |
| 302 | 381 | Operationservice op = new Operationservice(); |
| 303 | - op.setXlName(arg0.getString("XLBM").toString()); | |
| 304 | - op.setJzl(arg0.getString("JZL").toString()); | |
| 305 | - op.setXhl(arg0.getString("YH").toString()); | |
| 306 | - Map<String, Object> maps = new HashMap<>(); | |
| 307 | - maps = scheduleRealInfoService.findKMBC2(sin.getJsy(), sin.getClzbh(), sin.getrQ()); | |
| 308 | - op.setXsgl(maps.get("yygl").toString() == null ? "" : maps.get("yygl").toString()); | |
| 309 | - op.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString()); | |
| 310 | - 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 | + | |
| 311 | 388 | return op; |
| 312 | 389 | } |
| 313 | 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 | + } | |
| 314 | 401 | return list; |
| 315 | 402 | } |
| 316 | 403 | |
| 404 | + | |
| 317 | 405 | // 车辆加注 |
| 318 | 406 | @Override |
| 319 | - public List<Vehicleloading> vehicleloading(String line, String data) { | |
| 320 | - | |
| 321 | - String sql = " SELECT y.RQ,y.SSGSDM,y.XLBM,y.NBBM,y.JSY,y.YH,y.JZL " + " FROM bsth_c_ylb y " | |
| 322 | - + " where to_days(y.RQ)=to_days('" + data + "')" + " and y.XLBM='" + line + "' " | |
| 323 | - + " GROUP BY y.NBBM "; | |
| 324 | - | |
| 407 | + public List<Vehicleloading> vehicleloading(/*String gsdmVehic,String fgsdmVehic,*/String line, String date) { | |
| 408 | + | |
| 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 " | |
| 410 | + + " FROM bsth_c_s_sp_info_real r " | |
| 411 | + + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb 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 " | |
| 413 | + + " on r.cl_zbh=y.nbbm " | |
| 414 | + + " where to_days(r.schedule_date_str)=to_days('" + date + "')" | |
| 415 | + + " and r.xl_bm='" + line + "' " | |
| 416 | + + " AND r.gs_bm is not null" | |
| 417 | + + " and r.bc_type not in('in','out')" | |
| 418 | + /* + " and r.gs_bm='"+gsdmVehic +"'" | |
| 419 | + + " and r.fgs_bm='"+fgsdmVehic +"'"*/ | |
| 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 "; | |
| 421 | + | |
| 422 | + | |
| 423 | + //r.cl_zbh | |
| 325 | 424 | List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() { |
| 326 | 425 | @Override |
| 327 | 426 | public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 328 | 427 | Vehicleloading ve = new Vehicleloading(); |
| 329 | - ve.setrQ(arg0.getString("RQ").toString()); | |
| 330 | - ve.setgS(arg0.getString("SSDM").toString()); | |
| 331 | - ve.setxL(arg0.getString("XLBM").toString()); | |
| 332 | - ve.setClzbh(arg0.getString("NBBM").toString()); | |
| 333 | - ve.setHyl(arg0.getString("YH").toString()); | |
| 334 | - 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")); | |
| 335 | 434 | // ve.setLs(arg0.getString("").toString());//尿素 |
| 336 | - Map<String, Object> maps = new HashMap<>(); | |
| 337 | - maps = scheduleRealInfoService.findKMBC2(arg0.getString("JSY"), arg0.getString("NBBM"), | |
| 338 | - arg0.getString("RQ")); | |
| 339 | - ve.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString()); | |
| 340 | - ve.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次 | |
| 341 | - ve.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次 | |
| 435 | + ve.setJgh(arg0.getString("j_gh").toString()); | |
| 342 | 436 | return ve; |
| 343 | 437 | } |
| 344 | 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 | + | |
| 345 | 450 | return list; |
| 346 | 451 | } |
| 347 | 452 | |
| ... | ... | @@ -365,18 +470,22 @@ public class FormsServiceImpl implements FormsService { |
| 365 | 470 | |
| 366 | 471 | rq = rq2 + "-" + rq3; |
| 367 | 472 | |
| 368 | - 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 " | |
| 369 | - + " (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" | |
| 370 | - + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" | |
| 371 | - + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" | |
| 372 | - + map.get("line").toString() + "' AND gs_bm is not null" | |
| 373 | - + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN (" | |
| 374 | - + "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 " | |
| 375 | - + "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 " | |
| 376 | - + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" | |
| 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" | |
| 475 | + + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"+ map.get("startDate").toString() + "' " | |
| 476 | + + " and '" + map.get("endDate").toString() + "' and xl_bm='"+ map.get("line").toString() + "' " | |
| 477 | + + " AND gs_bm is not null " | |
| 478 | + + " AND bc_type NOT IN ('in', 'out')" | |
| 479 | + /*+ " and gs_bm='"+ map.get("gsdmTurn").toString() + "'" | |
| 480 | + + " and fgs_bm='"+ map.get("fgsdmTurn").toString() + "'"*/ | |
| 481 | + + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN (" | |
| 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 " | |
| 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 " | |
| 484 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" | |
| 377 | 485 | + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() |
| 378 | 486 | + "' AND gs_bm is not null " |
| 379 | - + "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 " | |
| 380 | 489 | + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; |
| 381 | 490 | List<Turnoutrate> list = jdbcTemplate.query(sql, new RowMapper<Turnoutrate>() { |
| 382 | 491 | |
| ... | ... | @@ -409,9 +518,12 @@ public class FormsServiceImpl implements FormsService { |
| 409 | 518 | |
| 410 | 519 | }); |
| 411 | 520 | |
| 521 | + | |
| 412 | 522 | return list; |
| 413 | 523 | } |
| 414 | 524 | |
| 525 | + | |
| 526 | + //班次执行率统计表 | |
| 415 | 527 | @Override |
| 416 | 528 | public List<Executionrate> executionrate(Map<String, Object> map) { |
| 417 | 529 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| ... | ... | @@ -430,18 +542,20 @@ public class FormsServiceImpl implements FormsService { |
| 430 | 542 | |
| 431 | 543 | rq = rq2 + "-" + rq3; |
| 432 | 544 | |
| 433 | - 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 " | |
| 434 | - + " (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" | |
| 435 | 547 | + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" |
| 436 | 548 | + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" |
| 437 | - + map.get("line").toString() + "' AND gs_bm is not null" | |
| 438 | - + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN (" | |
| 439 | - + "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 " | |
| 440 | - + "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 " | |
| 549 | + + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')" | |
| 550 | + /*+ " and gs_bm='"+ map.get("gsdmEcecut").toString() + "'" | |
| 551 | + + " and fgs_bm='"+ map.get("fgsdmEcecut").toString() + "'"*/ | |
| 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 " | |
| 441 | 555 | + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" |
| 442 | 556 | + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() |
| 443 | - + "' AND gs_bm is not null " | |
| 444 | - + "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 " | |
| 445 | 559 | + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; |
| 446 | 560 | List<Executionrate> list = jdbcTemplate.query(sql, new RowMapper<Executionrate>() { |
| 447 | 561 | |
| ... | ... | @@ -457,7 +571,8 @@ public class FormsServiceImpl implements FormsService { |
| 457 | 571 | tu.setRq(rq); |
| 458 | 572 | tu.setGs(arg0.getString("gs_name").toString()); |
| 459 | 573 | tu.setZhgs(arg0.getString("fgs_name").toString()); |
| 460 | - tu.setXl(arg0.getString("xlgs")); | |
| 574 | + //tu.setXl(arg0.getString("xlgs"));这个是根据公司判断线路有几条 | |
| 575 | + tu.setXl(arg0.getString("sxl")); | |
| 461 | 576 | tu.setXlmc(arg0.getString("sxl")); |
| 462 | 577 | tu.setCchjh(arg0.getString("jcl").toString()); |
| 463 | 578 | tu.setCchsj(arg0.getString("scl").toString()); |
| ... | ... | @@ -494,20 +609,27 @@ public class FormsServiceImpl implements FormsService { |
| 494 | 609 | String rq2 = sdf1.format(d); |
| 495 | 610 | String rq3 = sdf1.format(d1); |
| 496 | 611 | |
| 612 | + | |
| 613 | + | |
| 497 | 614 | rq = rq2 + "-" + rq3; |
| 498 | 615 | |
| 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" | |
| 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" | |
| 501 | 618 | + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" |
| 502 | 619 | + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" |
| 503 | - + map.get("line").toString() + "' AND gs_bm is not null" | |
| 504 | - + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN (" | |
| 505 | - + "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 " | |
| 506 | - + "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 " | |
| 620 | + + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') " | |
| 621 | + /*+ " and gs_bm='"+ map.get("gsdmAllline").toString() + "'" | |
| 622 | + + " and fgs_bm='"+ map.get("fgsdmAllline").toString() + "'"*/ | |
| 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 " | |
| 507 | 628 | + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" |
| 508 | - + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() | |
| 509 | - + "' AND gs_bm is not null " | |
| 510 | - + "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 " | |
| 511 | 633 | + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; |
| 512 | 634 | List<Allline> list = jdbcTemplate.query(sql, new RowMapper<Allline>() { |
| 513 | 635 | |
| ... | ... | @@ -532,14 +654,19 @@ public class FormsServiceImpl implements FormsService { |
| 532 | 654 | tu.setBcjh(arg0.getString("jbc").toString()); |
| 533 | 655 | tu.setBcsj(arg0.getString("sbc").toString()); |
| 534 | 656 | tu.setBbzxl(result2 + "%");// 班次执行率 |
| 657 | + | |
| 535 | 658 | // tu.setSm(arg0.getString("xl_name").toString()); |
| 536 | 659 | tu.setGsgs(arg0.getString("gslsbm").toString()); |
| 537 | 660 | tu.setFgsgs(arg0.getString("fgsbm").toString()); |
| 538 | 661 | return tu; |
| 539 | 662 | } |
| 540 | 663 | |
| 664 | + | |
| 541 | 665 | }); |
| 666 | + | |
| 542 | 667 | |
| 668 | + | |
| 669 | + | |
| 543 | 670 | return list; |
| 544 | 671 | } |
| 545 | 672 | } | ... | ... |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| ... | ... | @@ -133,7 +133,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 133 | 133 | DO:{ |
| 134 | 134 | if(model.length() != 0){ |
| 135 | 135 | for(Long tt : ttList){ |
| 136 | - if(tt == schedule.getSpId()){ | |
| 136 | + if((long)tt == (long)schedule.getSpId()){ | |
| 137 | 137 | resList.add(schedule); |
| 138 | 138 | break DO; |
| 139 | 139 | } | ... | ... |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| ... | ... | @@ -37,6 +37,8 @@ import java.sql.ResultSet; |
| 37 | 37 | import java.text.DecimalFormat; |
| 38 | 38 | import java.text.SimpleDateFormat; |
| 39 | 39 | import java.util.*; |
| 40 | +import java.util.regex.Pattern; | |
| 41 | + | |
| 40 | 42 | /** |
| 41 | 43 | * |
| 42 | 44 | * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) |
| ... | ... | @@ -299,6 +301,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 299 | 301 | */ |
| 300 | 302 | public String setLD(){ |
| 301 | 303 | String result = "failure"; |
| 304 | + Line line; | |
| 302 | 305 | // 取昨天 的日期 |
| 303 | 306 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 304 | 307 | StringBuffer sf = new StringBuffer(); |
| ... | ... | @@ -312,6 +315,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 312 | 315 | //根据车辆自编号查询车牌号 |
| 313 | 316 | map.put("insideCode_eq", schRealInfo.getClZbh()); |
| 314 | 317 | Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); |
| 318 | + // 获取线路是否使用标识,如果未使用,则不查该线路数据 | |
| 319 | + line = lineRepository.findByLineCode(schRealInfo.getXlBm()); | |
| 320 | + if(line.getInUse() == null || line.getInUse() == 0){ | |
| 321 | + continue; | |
| 322 | + } | |
| 315 | 323 | sf.append("<DLD>"); |
| 316 | 324 | sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); |
| 317 | 325 | sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>"); |
| ... | ... | @@ -557,14 +565,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 557 | 565 | @Override |
| 558 | 566 | public String setJHBC() { |
| 559 | 567 | String result = "failure"; |
| 568 | + Line line; | |
| 560 | 569 | StringBuffer sBuffer =new StringBuffer(); |
| 561 | 570 | try { |
| 562 | 571 | sBuffer.append("<JHBCs>"); |
| 563 | 572 | // 声明变量 |
| 564 | - SchedulePlanInfo schedulePlanInfo = null; | |
| 565 | - String xlbm = "",zbh = ""; | |
| 573 | + SchedulePlanInfo schedulePlanInfo; | |
| 574 | + String xlbm,zbh = ""; | |
| 566 | 575 | Long lp = 0L; |
| 567 | - int startSerialNum = 0,endSerialNum = 0;; | |
| 568 | 576 | // 取明天的日期 |
| 569 | 577 | String tomorrow = sdfnyr.format(DateUtils.addDays(new Date(), +1)); |
| 570 | 578 | // 查询所有班次 |
| ... | ... | @@ -573,8 +581,13 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 573 | 581 | int size = schedulePlanList.size(); |
| 574 | 582 | for (int i = 0; i < size; i++) { |
| 575 | 583 | schedulePlanInfo = schedulePlanList.get(i); |
| 584 | + xlbm = schedulePlanInfo.getXlBm(); | |
| 585 | + // 获取线路是否使用标识,如果未使用,则不查该线路数据 | |
| 586 | + line = lineRepository.findByLineCode(xlbm); | |
| 587 | + if(line.getInUse() == null || line.getInUse() == 0){ | |
| 588 | + continue; | |
| 589 | + } | |
| 576 | 590 | if(i == 0){// 第一次,则初始化值 |
| 577 | - xlbm = schedulePlanInfo.getXlBm(); | |
| 578 | 591 | zbh = schedulePlanInfo.getClZbh(); |
| 579 | 592 | lp = schedulePlanInfo.getLp(); |
| 580 | 593 | // 拼装XML |
| ... | ... | @@ -605,18 +618,28 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 605 | 618 | sBuffer.append("</JHBC>"); |
| 606 | 619 | } |
| 607 | 620 | }else{ |
| 608 | - xlbm = schedulePlanInfo.getXlBm(); | |
| 609 | 621 | zbh = schedulePlanInfo.getClZbh(); |
| 610 | 622 | lp = schedulePlanInfo.getLp(); |
| 611 | 623 | sBuffer.append("</BCList>"); |
| 612 | 624 | sBuffer.append("</JHBC>"); |
| 613 | - startSerialNum = 0; | |
| 614 | - endSerialNum = 0; | |
| 615 | 625 | // 拼装XML |
| 616 | 626 | assembleJHBC(sBuffer, schedulePlanInfo, xlbm, zbh, lp); |
| 617 | 627 | } |
| 618 | 628 | } |
| 619 | 629 | } |
| 630 | + // 判断XML是否以</BCList>结尾,如果不是,则加上 | |
| 631 | + String regex = "^*</JHBC>$"; | |
| 632 | + Pattern p = Pattern.compile(regex); | |
| 633 | + java.util.regex.Matcher m = p.matcher(sBuffer); | |
| 634 | + boolean isEndWithTrueFlag = false; | |
| 635 | + while (m.find()) { | |
| 636 | + isEndWithTrueFlag = true; | |
| 637 | + } | |
| 638 | + // 加上缺失的标签 | |
| 639 | + if(!isEndWithTrueFlag){ | |
| 640 | + sBuffer.append("</BCList>"); | |
| 641 | + sBuffer.append("</JHBC>"); | |
| 642 | + } | |
| 620 | 643 | sBuffer.append("</JHBCs>"); |
| 621 | 644 | if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 622 | 645 | result = "success"; |
| ... | ... | @@ -643,7 +666,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 643 | 666 | StringBuffer sBufferA; |
| 644 | 667 | StringBuffer sBufferB; |
| 645 | 668 | TTInfo ttInfo; |
| 646 | - TTInfoDetail ttInfoDetail = null; | |
| 669 | + TTInfoDetail ttInfoDetail; | |
| 647 | 670 | Iterator<TTInfoDetail> ttInfoDetailIterator; |
| 648 | 671 | HashMap<String,Object> param = new HashMap<String, Object>(); |
| 649 | 672 | String lineCode ; |
| ... | ... | @@ -1027,6 +1050,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 1027 | 1050 | company = "浦东金高公交公司"; |
| 1028 | 1051 | }else if(company.equals("南汇公司")){ |
| 1029 | 1052 | company = "浦东南汇公交公司"; |
| 1053 | + }else if(company.equals("青浦公交")){ | |
| 1054 | + company = "浦东青浦公交公司"; | |
| 1030 | 1055 | } |
| 1031 | 1056 | } |
| 1032 | 1057 | /** | ... | ... |
src/main/java/com/bsth/service/realcontrol/dto/SectionRouteCoords.java
| 1 | -package com.bsth.service.realcontrol.dto; | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * 线调地图 路段路由DTO | |
| 5 | - * Created by panzhao on 2016/12/1. | |
| 6 | - */ | |
| 7 | -public class SectionRouteCoords { | |
| 8 | - | |
| 9 | - private int id; | |
| 10 | - | |
| 11 | - private String lineCode; | |
| 12 | - | |
| 13 | - private String sectionCode; | |
| 14 | - | |
| 15 | - private String sectionrouteCode; | |
| 16 | - | |
| 17 | - private int directions; | |
| 18 | - | |
| 19 | - private String sectionName; | |
| 20 | - | |
| 21 | - private String gsectionVector; | |
| 22 | - | |
| 23 | - private Float sectionDistance; | |
| 24 | - | |
| 25 | - private Float sectionTime; | |
| 26 | - | |
| 27 | - public int getId() { | |
| 28 | - return id; | |
| 29 | - } | |
| 30 | - | |
| 31 | - public void setId(int id) { | |
| 32 | - this.id = id; | |
| 33 | - } | |
| 34 | - | |
| 35 | - public String getLineCode() { | |
| 36 | - return lineCode; | |
| 37 | - } | |
| 38 | - | |
| 39 | - public void setLineCode(String lineCode) { | |
| 40 | - this.lineCode = lineCode; | |
| 41 | - } | |
| 42 | - | |
| 43 | - public String getSectionCode() { | |
| 44 | - return sectionCode; | |
| 45 | - } | |
| 46 | - | |
| 47 | - public void setSectionCode(String sectionCode) { | |
| 48 | - this.sectionCode = sectionCode; | |
| 49 | - } | |
| 50 | - | |
| 51 | - public String getSectionrouteCode() { | |
| 52 | - return sectionrouteCode; | |
| 53 | - } | |
| 54 | - | |
| 55 | - public void setSectionrouteCode(String sectionrouteCode) { | |
| 56 | - this.sectionrouteCode = sectionrouteCode; | |
| 57 | - } | |
| 58 | - | |
| 59 | - public int getDirections() { | |
| 60 | - return directions; | |
| 61 | - } | |
| 62 | - | |
| 63 | - public void setDirections(int directions) { | |
| 64 | - this.directions = directions; | |
| 65 | - } | |
| 66 | - | |
| 67 | - public String getSectionName() { | |
| 68 | - return sectionName; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public void setSectionName(String sectionName) { | |
| 72 | - this.sectionName = sectionName; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public String getGsectionVector() { | |
| 76 | - return gsectionVector; | |
| 77 | - } | |
| 78 | - | |
| 79 | - public void setGsectionVector(String gsectionVector) { | |
| 80 | - this.gsectionVector = gsectionVector; | |
| 81 | - } | |
| 82 | - | |
| 83 | - public Float getSectionDistance() { | |
| 84 | - return sectionDistance; | |
| 85 | - } | |
| 86 | - | |
| 87 | - public void setSectionDistance(Float sectionDistance) { | |
| 88 | - this.sectionDistance = sectionDistance; | |
| 89 | - } | |
| 90 | - | |
| 91 | - public Float getSectionTime() { | |
| 92 | - return sectionTime; | |
| 93 | - } | |
| 94 | - | |
| 95 | - public void setSectionTime(Float sectionTime) { | |
| 96 | - this.sectionTime = sectionTime; | |
| 97 | - } | |
| 98 | -} | |
| 1 | +package com.bsth.service.realcontrol.dto; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 线调地图 路段路由DTO | |
| 5 | + * Created by panzhao on 2016/12/1. | |
| 6 | + */ | |
| 7 | +public class SectionRouteCoords { | |
| 8 | + | |
| 9 | + private int id; | |
| 10 | + | |
| 11 | + private String lineCode; | |
| 12 | + | |
| 13 | + private String sectionCode; | |
| 14 | + | |
| 15 | + private String sectionrouteCode; | |
| 16 | + | |
| 17 | + private int directions; | |
| 18 | + | |
| 19 | + private String sectionName; | |
| 20 | + | |
| 21 | + private String gsectionVector; | |
| 22 | + | |
| 23 | + private Float sectionDistance; | |
| 24 | + | |
| 25 | + private Float sectionTime; | |
| 26 | + | |
| 27 | + public int getId() { | |
| 28 | + return id; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void setId(int id) { | |
| 32 | + this.id = id; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public String getLineCode() { | |
| 36 | + return lineCode; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setLineCode(String lineCode) { | |
| 40 | + this.lineCode = lineCode; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public String getSectionCode() { | |
| 44 | + return sectionCode; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public void setSectionCode(String sectionCode) { | |
| 48 | + this.sectionCode = sectionCode; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public String getSectionrouteCode() { | |
| 52 | + return sectionrouteCode; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setSectionrouteCode(String sectionrouteCode) { | |
| 56 | + this.sectionrouteCode = sectionrouteCode; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public int getDirections() { | |
| 60 | + return directions; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setDirections(int directions) { | |
| 64 | + this.directions = directions; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public String getSectionName() { | |
| 68 | + return sectionName; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setSectionName(String sectionName) { | |
| 72 | + this.sectionName = sectionName; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public String getGsectionVector() { | |
| 76 | + return gsectionVector; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setGsectionVector(String gsectionVector) { | |
| 80 | + this.gsectionVector = gsectionVector; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public Float getSectionDistance() { | |
| 84 | + return sectionDistance; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setSectionDistance(Float sectionDistance) { | |
| 88 | + this.sectionDistance = sectionDistance; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public Float getSectionTime() { | |
| 92 | + return sectionTime; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void setSectionTime(Float sectionTime) { | |
| 96 | + this.sectionTime = sectionTime; | |
| 97 | + } | |
| 98 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
| 1 | 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 | 3 | import com.bsth.data.BasicData; |
| 11 | 4 | import com.bsth.data.match.Arrival2Schedule; |
| 12 | 5 | import com.bsth.data.schedule.DayOfSchedule; |
| 13 | 6 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 14 | 7 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 15 | 8 | import com.bsth.repository.realcontrol.ChildTaskPlanRepository; |
| 9 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 16 | 10 | import com.bsth.service.impl.BaseServiceImpl; |
| 17 | 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 | 19 | @Service |
| 20 | 20 | public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService{ |
| 21 | 21 | |
| 22 | 22 | /*@Autowired |
| 23 | 23 | ScheduleRealInfoServiceImpl scheduleRealInfoService;*/ |
| 24 | + | |
| 25 | + @Autowired | |
| 26 | + ScheduleRealInfoRepository scheduleRealInfoRepository; | |
| 24 | 27 | |
| 25 | 28 | @Autowired |
| 26 | 29 | ChildTaskPlanRepository childTaskPlanRepository; |
| ... | ... | @@ -30,6 +33,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon |
| 30 | 33 | |
| 31 | 34 | @Autowired |
| 32 | 35 | Arrival2Schedule arrival2Schedule; |
| 36 | + | |
| 37 | + @Autowired | |
| 38 | + JdbcTemplate jdbcTemplate; | |
| 33 | 39 | |
| 34 | 40 | @Transactional |
| 35 | 41 | @Override |
| ... | ... | @@ -62,10 +68,13 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon |
| 62 | 68 | //解除和主任务关联 |
| 63 | 69 | ScheduleRealInfo sch = dayOfSchedule.get(cPlan.getSchedule().getId()); |
| 64 | 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 | 75 | rs = super.delete(id); |
| 67 | 76 | dayOfSchedule.save(sch); |
| 68 | - | |
| 77 | + | |
| 69 | 78 | rs.put("t", sch); |
| 70 | 79 | return rs; |
| 71 | 80 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -1115,7 +1115,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1115 | 1115 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 1116 | 1116 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); |
| 1117 | 1117 | int jhbc = 0,cjbc = 0,ljbc = 0; |
| 1118 | - double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0; | |
| 1118 | + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0,jcclc=0; | |
| 1119 | 1119 | float addMileage = 0l,remMileage = 0l; |
| 1120 | 1120 | Map<String,Object> map = new HashMap<String, Object>(); |
| 1121 | 1121 | for(ScheduleRealInfo scheduleRealInfo : list){ |
| ... | ... | @@ -1141,8 +1141,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1141 | 1141 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 1142 | 1142 | //计算营运里程,空驶里程 |
| 1143 | 1143 | if(childTaskPlans.isEmpty()){ |
| 1144 | - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | |
| 1145 | - || scheduleRealInfo.getBcType().equals("venting")){ | |
| 1144 | + if(scheduleRealInfo.getBcType().equals("in") || | |
| 1145 | + scheduleRealInfo.getBcType().equals("out")){ | |
| 1146 | + ksgl += tempJhlc; | |
| 1147 | + jcclc +=tempJhlc; | |
| 1148 | + }else if(scheduleRealInfo.getBcType().equals("venting")){ | |
| 1146 | 1149 | ksgl += tempJhlc; |
| 1147 | 1150 | }else{ |
| 1148 | 1151 | if(scheduleRealInfo.getStatus() != -1){ |
| ... | ... | @@ -1177,6 +1180,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1177 | 1180 | map.put("cjbc", cjbc); |
| 1178 | 1181 | map.put("ljbc", ljbc); |
| 1179 | 1182 | map.put("sjbc", jhbc-cjbc+ljbc); |
| 1183 | + map.put("jcclc", jcclc); | |
| 1180 | 1184 | return map; |
| 1181 | 1185 | } |
| 1182 | 1186 | |
| ... | ... | @@ -1680,7 +1684,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1680 | 1684 | @Override |
| 1681 | 1685 | public Map<String, Object> findKMBC1(String jName, String clZbh, |
| 1682 | 1686 | String date, String enddate) { |
| 1683 | - List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill2(jName, clZbh, date, enddate); | |
| 1687 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill4(jName, clZbh, date, enddate); | |
| 1684 | 1688 | DecimalFormat format = new DecimalFormat("0.00"); |
| 1685 | 1689 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 1686 | 1690 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | ... | ... |
src/main/java/com/bsth/service/schedule/BService.java
0 → 100644
| 1 | +package com.bsth.service.schedule; | |
| 2 | + | |
| 3 | +import org.springframework.data.domain.Page; | |
| 4 | +import org.springframework.data.domain.Pageable; | |
| 5 | + | |
| 6 | +import java.io.Serializable; | |
| 7 | +import java.util.List; | |
| 8 | +import java.util.Map; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 基础service接口。 | |
| 12 | + */ | |
| 13 | +public interface BService<T, ID extends Serializable> { | |
| 14 | + // CRUD 操作 | |
| 15 | + // Create,Update操作 | |
| 16 | + T save(T t); | |
| 17 | + <S extends T> List<S> bulkSave(List<S> entities); // 批量保存(TODO:待测试) | |
| 18 | + // Research操作 | |
| 19 | + T findById(ID id); | |
| 20 | + List<T> findAll(); | |
| 21 | + Page<T> list(Map<String, Object> param, Pageable pageable); | |
| 22 | + List<T> list(Map<String, Object> param); | |
| 23 | + // Delete操作 | |
| 24 | + void delete(ID id) throws ScheduleException; | |
| 25 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/CarConfigInfoService.java
| 1 | 1 | package com.bsth.service.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.schedule.CarConfigInfo; |
| 4 | -import com.bsth.service.BaseService; | |
| 5 | 4 | |
| 6 | 5 | /** |
| 7 | 6 | * Created by xu on 16/5/9. |
| 8 | 7 | */ |
| 9 | -public interface CarConfigInfoService extends BaseService<CarConfigInfo, Long> { | |
| 8 | +public interface CarConfigInfoService extends BService<CarConfigInfo, Long> { | |
| 9 | + public void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException; | |
| 10 | + public void toggleCancel(Long id) throws ScheduleException; | |
| 10 | 11 | } | ... | ... |
src/main/java/com/bsth/service/schedule/CarConfigInfoServiceImpl.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.common.ResponseCode; | |
| 4 | -import com.bsth.entity.schedule.CarConfigInfo; | |
| 5 | -import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | |
| 6 | -import com.bsth.repository.schedule.CarConfigInfoRepository; | |
| 7 | -import com.bsth.service.impl.BaseServiceImpl; | |
| 8 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | -import org.springframework.stereotype.Service; | |
| 10 | - | |
| 11 | -import javax.transaction.Transactional; | |
| 12 | -import java.util.*; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * Created by xu on 16/5/9. | |
| 16 | - */ | |
| 17 | -@Service | |
| 18 | -public class CarConfigInfoServiceImpl extends BaseServiceImpl<CarConfigInfo, Long> implements CarConfigInfoService { | |
| 19 | - @Autowired | |
| 20 | - private CarConfigInfoRepository carConfigInfoRepository; | |
| 21 | - @Autowired | |
| 22 | - private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 23 | - | |
| 24 | - @Override | |
| 25 | - @Transactional | |
| 26 | - public Map<String, Object> delete(Long aLong) { | |
| 27 | - // 获取待作废的车辆配置 | |
| 28 | - CarConfigInfo carConfigInfo = carConfigInfoRepository.findOne(aLong); | |
| 29 | - // 查询有无规则使用过此车辆配置 | |
| 30 | - Map<String, Object> param = new HashMap<>(); | |
| 31 | - param.put("carConfigInfo.id_eq", carConfigInfo.getId()); | |
| 32 | - Iterator<ScheduleRule1Flat> scheduleRule1FlatIterator = | |
| 33 | - scheduleRule1FlatService.list(param).iterator(); | |
| 34 | - boolean isExist = false; | |
| 35 | - while (scheduleRule1FlatIterator.hasNext()) { | |
| 36 | - ScheduleRule1Flat scheduleRule1Flat = scheduleRule1FlatIterator.next(); | |
| 37 | - if (scheduleRule1Flat.getCarConfigInfo().getId().equals(carConfigInfo.getId())) { | |
| 38 | - isExist = true; | |
| 39 | - break; | |
| 40 | - } | |
| 41 | - } | |
| 42 | - | |
| 43 | - Map<String, Object> map = new HashMap<>(); | |
| 44 | - | |
| 45 | - if (isExist) { | |
| 46 | - throw new RuntimeException("车辆配置已被规则使用,不能删除,请先修改规则!"); | |
| 47 | - } else { | |
| 48 | - carConfigInfo.setIsCancel(true); | |
| 49 | - map.put("status", ResponseCode.SUCCESS); | |
| 50 | - } | |
| 51 | - | |
| 52 | - return map; | |
| 53 | - | |
| 54 | - } | |
| 55 | -} |
src/main/java/com/bsth/service/schedule/CarsService.java
0 → 100644
| 1 | +package com.bsth.service.schedule; | |
| 2 | + | |
| 3 | +import com.bsth.entity.Cars; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * Created by xu on 16/12/8. | |
| 7 | + */ | |
| 8 | +public interface CarsService extends BService<Cars, Integer> { | |
| 9 | + public void validate_nbbh(Cars cars) throws ScheduleException; | |
| 10 | + public void validate_clbh(Cars cars) throws ScheduleException; | |
| 11 | + public void validate_cph(Cars cars) throws ScheduleException; | |
| 12 | + public void validate_sbbh(Cars cars) throws ScheduleException; | |
| 13 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoService.java
| 1 | 1 | package com.bsth.service.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.schedule.EmployeeConfigInfo; |
| 4 | -import com.bsth.service.BaseService; | |
| 5 | 4 | |
| 6 | 5 | /** |
| 7 | 6 | * Created by xu on 16/5/10. |
| 8 | 7 | */ |
| 9 | -public interface EmployeeConfigInfoService extends BaseService<EmployeeConfigInfo, Long> { | |
| 8 | +public interface EmployeeConfigInfoService extends BService<EmployeeConfigInfo, Long> { | |
| 9 | + void validate_jsy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException; | |
| 10 | + void validate_spy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException; | |
| 11 | + public void toggleCancel(Long id) throws ScheduleException; | |
| 10 | 12 | } | ... | ... |
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoServiceImpl.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.common.ResponseCode; | |
| 4 | -import com.bsth.entity.Line; | |
| 5 | -import com.bsth.entity.schedule.EmployeeConfigInfo; | |
| 6 | -import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | |
| 7 | -import com.bsth.repository.schedule.EmployeeConfigInfoRepository; | |
| 8 | -import com.bsth.service.impl.BaseServiceImpl; | |
| 9 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | -import org.springframework.stereotype.Service; | |
| 11 | - | |
| 12 | -import javax.transaction.Transactional; | |
| 13 | -import java.util.*; | |
| 14 | - | |
| 15 | -/** | |
| 16 | - * Created by xu on 16/5/10. | |
| 17 | - */ | |
| 18 | -@Service | |
| 19 | -public class EmployeeConfigInfoServiceImpl extends BaseServiceImpl<EmployeeConfigInfo, Long> implements EmployeeConfigInfoService { | |
| 20 | - @Autowired | |
| 21 | - private EmployeeConfigInfoRepository employeeConfigInfoRepository; | |
| 22 | - @Autowired | |
| 23 | - private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 24 | - | |
| 25 | - | |
| 26 | - @Override | |
| 27 | - @Transactional | |
| 28 | - public Map<String, Object> delete(Long aLong) { | |
| 29 | - // 获取待作废的人员配置 | |
| 30 | - EmployeeConfigInfo employeeConfigInfo = employeeConfigInfoRepository.findOne(aLong); | |
| 31 | - // 获取线路 | |
| 32 | - Line xl = employeeConfigInfo.getXl(); | |
| 33 | - // 查找线路的规则,比较人员配置信息 | |
| 34 | - Map<String, Object> param = new HashMap<>(); | |
| 35 | - param.put("xl.id_eq", xl.getId()); | |
| 36 | - Iterator<ScheduleRule1Flat> employeeConfigInfoIterator = scheduleRule1FlatService.list(param).iterator(); | |
| 37 | - List<String> ryConfigIds = new ArrayList<>(); | |
| 38 | - while (employeeConfigInfoIterator.hasNext()) { | |
| 39 | - ScheduleRule1Flat scheduleRule1Flat = employeeConfigInfoIterator.next(); | |
| 40 | - ryConfigIds.addAll(Arrays.asList(scheduleRule1Flat.getRyConfigIds().split(","))); | |
| 41 | - } | |
| 42 | - | |
| 43 | - Map<String, Object> map = new HashMap<>(); | |
| 44 | - | |
| 45 | - if (ryConfigIds.contains(employeeConfigInfo.getId().toString())) { | |
| 46 | - throw new RuntimeException("人员配置已被规则使用,不能删除,请先修改规则!"); | |
| 47 | - } else { | |
| 48 | - employeeConfigInfo.setIsCancel(true); | |
| 49 | - map.put("status", ResponseCode.SUCCESS); | |
| 50 | - } | |
| 51 | - | |
| 52 | - return map; | |
| 53 | - } | |
| 54 | - | |
| 55 | -} |
src/main/java/com/bsth/service/schedule/GuideboardInfoService.java
| 1 | 1 | package com.bsth.service.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.schedule.GuideboardInfo; |
| 4 | -import com.bsth.service.BaseService; | |
| 5 | 4 | |
| 6 | 5 | /** |
| 7 | 6 | * Created by xu on 16/5/11. |
| 8 | 7 | */ |
| 9 | -public interface GuideboardInfoService extends BaseService<GuideboardInfo, Long> { | |
| 8 | +public interface GuideboardInfoService extends BService<GuideboardInfo, Long> { | |
| 9 | + public void validate(GuideboardInfo guideboardInfo) throws ScheduleException; | |
| 10 | + public void toggleCancel(Long id) throws ScheduleException; | |
| 10 | 11 | } | ... | ... |
src/main/java/com/bsth/service/schedule/GuideboardInfoServiceImpl.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.entity.schedule.GuideboardInfo; | |
| 4 | -import com.bsth.service.impl.BaseServiceImpl; | |
| 5 | -import org.springframework.stereotype.Service; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * Created by xu on 16/5/11. | |
| 9 | - */ | |
| 10 | -@Service | |
| 11 | -public class GuideboardInfoServiceImpl extends BaseServiceImpl<GuideboardInfo, Long> implements GuideboardInfoService { | |
| 12 | -} |
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
| ... | ... | @@ -46,7 +46,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 46 | 46 | if(company.length() != 0) |
| 47 | 47 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| 48 | 48 | |
| 49 | - list =jdbcTemplate.query(sql, | |
| 49 | + list = jdbcTemplate.query(sql, | |
| 50 | 50 | new RowMapper<ScheduleRealInfo>(){ |
| 51 | 51 | @Override |
| 52 | 52 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |
| ... | ... | @@ -117,7 +117,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 117 | 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 | 121 | new RowMapper<SchedulePlanInfo>(){ |
| 122 | 122 | @Override |
| 123 | 123 | public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |
| ... | ... | @@ -362,13 +362,15 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 362 | 362 | } |
| 363 | 363 | ScheduleRealInfo shouban = tempList.get(0); |
| 364 | 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 | 368 | if(shouban.getFcsjActual() != null){ |
| 366 | - jhsb++; | |
| 367 | 369 | if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -60000 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 180000) |
| 368 | 370 | sjsb++; |
| 369 | 371 | } |
| 372 | + jhmb++; | |
| 370 | 373 | if(moban.getFcsjActual() != null){ |
| 371 | - jhmb++; | |
| 372 | 374 | if(moban.getFcsjActualTime() - moban.getFcsjT() >= -60000 && moban.getFcsjActualTime() - moban.getFcsjT() <= 180000) |
| 373 | 375 | sjmb++; |
| 374 | 376 | } |
| ... | ... | @@ -452,7 +454,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 452 | 454 | } |
| 453 | 455 | sql += " and bc_type = 'normal'"; |
| 454 | 456 | |
| 455 | - list =jdbcTemplate.query(sql, | |
| 457 | + list = jdbcTemplate.query(sql, | |
| 456 | 458 | new RowMapper<ScheduleRealInfo>(){ |
| 457 | 459 | @Override |
| 458 | 460 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |
| ... | ... | @@ -497,7 +499,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 497 | 499 | DO:{ |
| 498 | 500 | if(model.length() != 0){ |
| 499 | 501 | for(Long tt : ttList){ |
| 500 | - if(tt == schedule.getSpId()){ | |
| 502 | + if((long)tt == (long)schedule.getSpId()){ | |
| 501 | 503 | String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj(); |
| 502 | 504 | if(!keyMap.containsKey(key)) |
| 503 | 505 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ... | ... |
src/main/java/com/bsth/service/schedule/ScheduleException.java
0 → 100644
src/main/java/com/bsth/service/schedule/impl/BServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.search.CustomerSpecs; | |
| 4 | +import com.bsth.repository.BaseRepository; | |
| 5 | +import com.bsth.service.schedule.BService; | |
| 6 | +import com.bsth.service.schedule.ScheduleException; | |
| 7 | +import org.slf4j.Logger; | |
| 8 | +import org.slf4j.LoggerFactory; | |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | +import org.springframework.beans.factory.annotation.Value; | |
| 11 | +import org.springframework.data.domain.Page; | |
| 12 | +import org.springframework.data.domain.Pageable; | |
| 13 | +import org.springframework.data.jpa.domain.Specification; | |
| 14 | + | |
| 15 | +import javax.persistence.EntityManager; | |
| 16 | +import java.io.Serializable; | |
| 17 | +import java.util.ArrayList; | |
| 18 | +import java.util.List; | |
| 19 | +import java.util.Map; | |
| 20 | + | |
| 21 | +/** | |
| 22 | + * 基础BService实现。 | |
| 23 | + */ | |
| 24 | +public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> { | |
| 25 | + @Autowired | |
| 26 | + private BaseRepository<T, ID> baseRepository; | |
| 27 | + @Autowired | |
| 28 | + private EntityManager entityManager; | |
| 29 | + @Value("${hibernate.jdbc.batch_size}") | |
| 30 | + private int batchSize; | |
| 31 | + | |
| 32 | + /** 日志记录器 */ | |
| 33 | + protected Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 34 | + | |
| 35 | + // CRUD 操作 | |
| 36 | + // Create,Update操作 | |
| 37 | + @Override | |
| 38 | + public T save(T t) { | |
| 39 | + if (logger.isDebugEnabled()) { | |
| 40 | + logger.debug("save..."); | |
| 41 | + } | |
| 42 | + return baseRepository.save(t); | |
| 43 | + } | |
| 44 | + @Override | |
| 45 | + public <S extends T> List<S> bulkSave(List<S> entities) { | |
| 46 | + if (logger.isDebugEnabled()) { | |
| 47 | + logger.debug("bulkSave..."); | |
| 48 | + } | |
| 49 | + | |
| 50 | + // 不使用内部批量保存,自己实现批量保存 | |
| 51 | + final List<S> savedEntities = new ArrayList<>(entities.size()); | |
| 52 | + int i = 0; | |
| 53 | + for (S t : entities) { | |
| 54 | + entityManager.persist(t); | |
| 55 | + savedEntities.add(t); | |
| 56 | + i++; | |
| 57 | + if (i % batchSize == 0) { | |
| 58 | + entityManager.flush(); | |
| 59 | + entityManager.clear(); | |
| 60 | + } | |
| 61 | + } | |
| 62 | + return savedEntities; | |
| 63 | + } | |
| 64 | + | |
| 65 | + // Research操作 | |
| 66 | + @Override | |
| 67 | + public T findById(ID id) { | |
| 68 | + if (logger.isDebugEnabled()) { | |
| 69 | + logger.debug("findById..."); | |
| 70 | + } | |
| 71 | + | |
| 72 | + return baseRepository.findOne(id); | |
| 73 | + } | |
| 74 | + @Override | |
| 75 | + public List<T> findAll() { | |
| 76 | + if (logger.isDebugEnabled()) { | |
| 77 | + logger.debug("findAll..."); | |
| 78 | + } | |
| 79 | + | |
| 80 | + return (List<T>) baseRepository.findAll(); | |
| 81 | + } | |
| 82 | + @Override | |
| 83 | + public Page<T> list(Map<String, Object> param, Pageable pageable) { | |
| 84 | + if (logger.isDebugEnabled()) { | |
| 85 | + logger.debug("list(...,pageable)..."); | |
| 86 | + } | |
| 87 | + | |
| 88 | + // 自定义查询参数 | |
| 89 | + Specification<T> specification = new CustomerSpecs<>(param); | |
| 90 | + return baseRepository.findAll(specification, pageable); | |
| 91 | + } | |
| 92 | + @Override | |
| 93 | + public List<T> list(Map<String, Object> param) { | |
| 94 | + if (logger.isDebugEnabled()) { | |
| 95 | + logger.debug("list..."); | |
| 96 | + } | |
| 97 | + | |
| 98 | + // 自定义查询参数 | |
| 99 | + Specification<T> specification = new CustomerSpecs<>(param); | |
| 100 | + return baseRepository.findAll(specification); | |
| 101 | + } | |
| 102 | + // Delete操作 | |
| 103 | + @Override | |
| 104 | + public void delete(ID id) throws ScheduleException { | |
| 105 | + if (logger.isDebugEnabled()) { | |
| 106 | + logger.debug("delete..."); | |
| 107 | + } | |
| 108 | + | |
| 109 | + baseRepository.delete(id); | |
| 110 | + } | |
| 111 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/impl/CarConfigInfoServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.schedule.CarConfigInfo; | |
| 4 | +import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | |
| 5 | +import com.bsth.service.schedule.CarConfigInfoService; | |
| 6 | +import com.bsth.service.schedule.ScheduleException; | |
| 7 | +import com.bsth.service.schedule.ScheduleRule1FlatService; | |
| 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.List; | |
| 15 | +import java.util.Map; | |
| 16 | + | |
| 17 | +/** | |
| 18 | + * Created by xu on 16/5/9. | |
| 19 | + */ | |
| 20 | +@Service | |
| 21 | +public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> implements CarConfigInfoService { | |
| 22 | + @Autowired | |
| 23 | + private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 24 | + | |
| 25 | + @Transactional | |
| 26 | + public void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException { | |
| 27 | + // 相同车辆不能同时配置 | |
| 28 | + Map<String, Object> param = new HashMap<>(); | |
| 29 | + if (carConfigInfo.getId() != null) { | |
| 30 | + param.put("id_ne", carConfigInfo.getId()); | |
| 31 | + } | |
| 32 | + | |
| 33 | + if (carConfigInfo.getXl() == null || | |
| 34 | + carConfigInfo.getXl().getId() == null || | |
| 35 | + carConfigInfo.getXl().getName() == null) { | |
| 36 | + throw new ScheduleException("线路未选择"); | |
| 37 | + } else { | |
| 38 | +// param.put("xl.id_eq", carConfigInfo.getXl().getId()); | |
| 39 | + if (carConfigInfo.getCl() == null || carConfigInfo.getCl().getId() == null) { | |
| 40 | + throw new ScheduleException("车辆未选择"); | |
| 41 | + } else { | |
| 42 | + param.put("cl.id_eq", carConfigInfo.getCl().getId()); | |
| 43 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 44 | + throw new ScheduleException("车辆已经配置在" + carConfigInfo.getXl().getName() + "线路中!"); | |
| 45 | + } | |
| 46 | + } | |
| 47 | + } | |
| 48 | + | |
| 49 | + } | |
| 50 | + | |
| 51 | + @Transactional | |
| 52 | + @Override | |
| 53 | + public void delete(Long aLong) throws ScheduleException { | |
| 54 | + toggleCancel(aLong); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @Transactional | |
| 58 | + public void toggleCancel(Long id) throws ScheduleException { | |
| 59 | + CarConfigInfo carConfigInfo = findById(id); | |
| 60 | + Map<String, Object> param = new HashMap<>(); | |
| 61 | + if (carConfigInfo.getIsCancel()) { | |
| 62 | + validate_cars(carConfigInfo); | |
| 63 | + carConfigInfo.setIsCancel(false); | |
| 64 | + } else { | |
| 65 | + param.clear(); | |
| 66 | + param.put("carConfigInfo.id_eq", carConfigInfo.getId()); | |
| 67 | + List<ScheduleRule1Flat> scheduleRule1Flats = (List<ScheduleRule1Flat>) scheduleRule1FlatService.list(param); | |
| 68 | + if (CollectionUtils.isEmpty(scheduleRule1Flats)) { | |
| 69 | + carConfigInfo.setIsCancel(true); | |
| 70 | + } else { | |
| 71 | + throw new ScheduleException("车辆配置已被规则使用,不能作废,请先修改规则!"); | |
| 72 | + } | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 76 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/impl/CarsServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.Cars; | |
| 4 | +import com.bsth.service.schedule.CarsService; | |
| 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/8. | |
| 15 | + */ | |
| 16 | +@Service(value = "carsServiceImpl_sc") | |
| 17 | +public class CarsServiceImpl extends BServiceImpl<Cars, Integer> implements CarsService { | |
| 18 | + | |
| 19 | + @Override | |
| 20 | + @Transactional | |
| 21 | + public void validate_nbbh(Cars cars) throws ScheduleException { | |
| 22 | + // 查询条件 | |
| 23 | + Map<String, Object> param = new HashMap<>(); | |
| 24 | + if (cars.getId() != null) { | |
| 25 | + param.put("id_ne", cars.getId()); | |
| 26 | + } | |
| 27 | + param.put("insideCode_eq", cars.getInsideCode()); | |
| 28 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 29 | + throw new ScheduleException("车辆内部编号/自编号重复"); | |
| 30 | + } | |
| 31 | + } | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + @Transactional | |
| 35 | + public void validate_clbh(Cars cars) throws ScheduleException { | |
| 36 | + // 查询条件 | |
| 37 | + Map<String, Object> param = new HashMap<>(); | |
| 38 | + if (cars.getId() != null) { | |
| 39 | + param.put("id_ne", cars.getId()); | |
| 40 | + } | |
| 41 | + param.put("carCode_eq", cars.getCarCode()); | |
| 42 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 43 | + throw new ScheduleException("车辆编号重复"); | |
| 44 | + } | |
| 45 | + } | |
| 46 | + | |
| 47 | + @Override | |
| 48 | + @Transactional | |
| 49 | + public void validate_cph(Cars cars) throws ScheduleException { | |
| 50 | + // 查询条件 | |
| 51 | + Map<String, Object> param = new HashMap<>(); | |
| 52 | + if (cars.getId() != null) { | |
| 53 | + param.put("id_ne", cars.getId()); | |
| 54 | + } | |
| 55 | + param.put("carPlate_eq", cars.getCarPlate()); | |
| 56 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 57 | + throw new ScheduleException("车牌号重复"); | |
| 58 | + } | |
| 59 | + } | |
| 60 | + | |
| 61 | + @Override | |
| 62 | + @Transactional | |
| 63 | + public void validate_sbbh(Cars cars) throws ScheduleException { | |
| 64 | + // 查询条件 | |
| 65 | + Map<String, Object> param = new HashMap<>(); | |
| 66 | + if (cars.getId() != null) { | |
| 67 | + param.put("id_ne", cars.getId()); | |
| 68 | + } | |
| 69 | + param.put("equipmentCode_eq", cars.getEquipmentCode()); | |
| 70 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 71 | + throw new ScheduleException("设备编号重复"); | |
| 72 | + } | |
| 73 | + } | |
| 74 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.schedule.EmployeeConfigInfo; | |
| 4 | +import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | |
| 5 | +import com.bsth.service.schedule.EmployeeConfigInfoService; | |
| 6 | +import com.bsth.service.schedule.ScheduleException; | |
| 7 | +import com.bsth.service.schedule.ScheduleRule1FlatService; | |
| 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.*; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * Created by xu on 16/5/10. | |
| 17 | + */ | |
| 18 | +@Service | |
| 19 | +public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigInfo, Long> implements EmployeeConfigInfoService { | |
| 20 | + @Autowired | |
| 21 | + private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 22 | + | |
| 23 | + @Transactional | |
| 24 | + @Override | |
| 25 | + public void validate_jsy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException { | |
| 26 | + // 驾驶员不能重复配置 | |
| 27 | + Map<String, Object> param = new HashMap<>(); | |
| 28 | + if (employeeConfigInfo.getId() != null) { | |
| 29 | + param.put("id_ne", employeeConfigInfo.getId()); | |
| 30 | + } | |
| 31 | + | |
| 32 | + if (employeeConfigInfo.getXl() == null || | |
| 33 | + employeeConfigInfo.getXl().getId() == null || | |
| 34 | + employeeConfigInfo.getXl().getName() == null) { | |
| 35 | + throw new ScheduleException("线路未选择"); | |
| 36 | + } else { | |
| 37 | + if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) { | |
| 38 | + throw new ScheduleException("驾驶员未选择"); | |
| 39 | + } else { | |
| 40 | + param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId()); | |
| 41 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 42 | + throw new ScheduleException("驾驶员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!"); | |
| 43 | + } | |
| 44 | + } | |
| 45 | + } | |
| 46 | + } | |
| 47 | + | |
| 48 | + @Transactional | |
| 49 | + @Override | |
| 50 | + public void validate_spy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException { | |
| 51 | + // 售票员不能重复配置 | |
| 52 | + Map<String, Object> param = new HashMap<>(); | |
| 53 | + if (employeeConfigInfo.getId() != null) { | |
| 54 | + param.put("id_ne", employeeConfigInfo.getId()); | |
| 55 | + } | |
| 56 | + | |
| 57 | + if (employeeConfigInfo.getXl() == null || | |
| 58 | + employeeConfigInfo.getXl().getId() == null || | |
| 59 | + employeeConfigInfo.getXl().getName() == null) { | |
| 60 | + throw new ScheduleException("线路未选择"); | |
| 61 | + } else { | |
| 62 | + if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) { | |
| 63 | + throw new ScheduleException("售票员未选择"); | |
| 64 | + } else { | |
| 65 | + param.put("spy.id_eq", employeeConfigInfo.getSpy().getId()); | |
| 66 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 67 | + throw new ScheduleException("售票员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!"); | |
| 68 | + } | |
| 69 | + } | |
| 70 | + } | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Transactional | |
| 74 | + @Override | |
| 75 | + public void delete(Long aLong) throws ScheduleException { | |
| 76 | + toggleCancel(aLong); | |
| 77 | + } | |
| 78 | + | |
| 79 | + @Transactional | |
| 80 | + @Override | |
| 81 | + public void toggleCancel(Long id) throws ScheduleException { | |
| 82 | + EmployeeConfigInfo employeeConfigInfo = findById(id); | |
| 83 | + Map<String, Object> param = new HashMap<>(); | |
| 84 | + if (employeeConfigInfo.getIsCancel()) { | |
| 85 | + validate_jsy(employeeConfigInfo); | |
| 86 | + if (employeeConfigInfo.getSpy() != null) { | |
| 87 | + validate_spy(employeeConfigInfo); | |
| 88 | + } | |
| 89 | + employeeConfigInfo.setIsCancel(false); | |
| 90 | + } else { | |
| 91 | + param.clear(); | |
| 92 | + param.put("xl.id_eq", employeeConfigInfo.getXl().getId()); | |
| 93 | + List<ScheduleRule1Flat> scheduleRule1Flats = (List<ScheduleRule1Flat>) scheduleRule1FlatService.list(param); | |
| 94 | + List<String> ryConfigIds = new ArrayList<>(); | |
| 95 | + for (ScheduleRule1Flat scheduleRule1Flat : scheduleRule1Flats) { | |
| 96 | + ryConfigIds.addAll(Arrays.asList(scheduleRule1Flat.getRyConfigIds().split(","))); | |
| 97 | + } | |
| 98 | + | |
| 99 | + if (ryConfigIds.contains(String.valueOf(id))) { | |
| 100 | + throw new ScheduleException("人员配置已被规则使用,不能作废,请先修改规则!"); | |
| 101 | + } else { | |
| 102 | + employeeConfigInfo.setIsCancel(true); | |
| 103 | + } | |
| 104 | + } | |
| 105 | + } | |
| 106 | + | |
| 107 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/impl/GuideboardInfoServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.schedule.GuideboardInfo; | |
| 4 | +import com.bsth.entity.schedule.TTInfoDetail; | |
| 5 | +import com.bsth.service.schedule.GuideboardInfoService; | |
| 6 | +import com.bsth.service.schedule.ScheduleException; | |
| 7 | +import com.bsth.service.schedule.TTInfoDetailService; | |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | +import org.springframework.stereotype.Service; | |
| 10 | +import org.springframework.util.CollectionUtils; | |
| 11 | + | |
| 12 | +import javax.transaction.Transactional; | |
| 13 | +import java.util.HashMap; | |
| 14 | +import java.util.List; | |
| 15 | +import java.util.Map; | |
| 16 | + | |
| 17 | +/** | |
| 18 | + * 路牌信息服务。 | |
| 19 | + */ | |
| 20 | +@Service | |
| 21 | +public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long> implements GuideboardInfoService { | |
| 22 | + @Autowired | |
| 23 | + private TTInfoDetailService ttInfoDetailService; | |
| 24 | + | |
| 25 | + // 验证方法 | |
| 26 | + @Transactional | |
| 27 | + public void validate(GuideboardInfo guideboardInfo) throws ScheduleException { | |
| 28 | + // 查询条件 | |
| 29 | + Map<String, Object> param = new HashMap<>(); | |
| 30 | + if (guideboardInfo.getId() != null) | |
| 31 | + param.put("id_ne", guideboardInfo.getId()); | |
| 32 | + | |
| 33 | + if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) { | |
| 34 | + throw new ScheduleException("线路未选择"); | |
| 35 | + } else { | |
| 36 | + param.put("xl.id_eq", guideboardInfo.getXl().getId()); | |
| 37 | + | |
| 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 | + } | |
| 51 | + | |
| 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 | + } | |
| 68 | + } | |
| 69 | + } | |
| 70 | + | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Transactional | |
| 74 | + @Override | |
| 75 | + public void delete(Long aLong) throws ScheduleException { | |
| 76 | + // 删除操作就是作废操作 | |
| 77 | + toggleCancel(aLong); | |
| 78 | + } | |
| 79 | + | |
| 80 | + // 作废方法 | |
| 81 | + @Transactional | |
| 82 | + public void toggleCancel(Long id) throws ScheduleException { | |
| 83 | + GuideboardInfo guideboardInfo = findById(id); | |
| 84 | + Map<String, Object> param = new HashMap<>(); | |
| 85 | + if (guideboardInfo.getIsCancel()) { | |
| 86 | + validate(guideboardInfo); | |
| 87 | + guideboardInfo.setIsCancel(false); | |
| 88 | + } else { | |
| 89 | + param.clear(); | |
| 90 | + param.put("xl.id_eq", guideboardInfo.getXl().getId()); | |
| 91 | + param.put("ttinfo.isCancel_eq", false); | |
| 92 | + param.put("lp.id_eq", guideboardInfo.getId()); | |
| 93 | + List<TTInfoDetail> ttInfoDetailList = (List<TTInfoDetail>) ttInfoDetailService.list(param); | |
| 94 | + if (CollectionUtils.isEmpty(ttInfoDetailList)) { | |
| 95 | + guideboardInfo.setIsCancel(true); | |
| 96 | + } else { | |
| 97 | + throw new ScheduleException("在时刻表" + | |
| 98 | + ttInfoDetailList.get(0).getTtinfo().getName() + | |
| 99 | + "已使用,无法删除!"); | |
| 100 | + } | |
| 101 | + } | |
| 102 | + } | |
| 103 | + | |
| 104 | +} | ... | ... |
src/main/resources/application-dev.properties
| ... | ... | @@ -6,7 +6,7 @@ spring.jpa.hibernate.ddl-auto= update |
| 6 | 6 | spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy |
| 7 | 7 | #DATABASE |
| 8 | 8 | spring.jpa.database= MYSQL |
| 9 | -spring.jpa.show-sql= false | |
| 9 | +spring.jpa.show-sql= true | |
| 10 | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | 11 | spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 12 | 12 | spring.datasource.username= root | ... | ... |
src/main/resources/static/pages/base/line/js/line-add-form.js
| ... | ... | @@ -94,7 +94,7 @@ $(function(){ |
| 94 | 94 | $('#endStationEndTimeInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'}); |
| 95 | 95 | |
| 96 | 96 | /** get请求获取公司表数据并填充公司下拉框选择值 */ |
| 97 | - $get('/business/all', {upCode_eq: '77'}, function(array){ | |
| 97 | + $get('/business/all', {upCode_eq: '88'}, function(array){ | |
| 98 | 98 | |
| 99 | 99 | /** 公司下拉options属性值 */ |
| 100 | 100 | var options = '<option value="">-- 请选择公司 --</option>'; | ... | ... |
src/main/resources/static/pages/base/line/js/line-details-info.js
| ... | ... | @@ -47,7 +47,7 @@ $(function(){ |
| 47 | 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 | 52 | // 公司下拉options属性值 |
| 53 | 53 | var options = '<option value="">-- 请选择公司 --</option>'; | ... | ... |
src/main/resources/static/pages/base/line/js/line-edit-form.js
| ... | ... | @@ -42,7 +42,7 @@ |
| 42 | 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 | 47 | // 公司下拉options属性值 |
| 48 | 48 | var options = '<option value="">-- 请选择公司 --</option>'; | ... | ... |
src/main/resources/static/pages/base/line/js/line-list-table.js
src/main/resources/static/pages/forecast/sample/js/svg.js
src/main/resources/static/pages/forms/statement/allline.html
| 1 | 1 | <style type="text/css"> |
| 2 | - .table-bordered { | |
| 3 | - border: 1px solid; } | |
| 4 | - .table-bordered > thead > tr > th, | |
| 5 | - .table-bordered > thead > tr > td, | |
| 6 | - .table-bordered > tbody > tr > th, | |
| 7 | - .table-bordered > tbody > tr > td, | |
| 8 | - .table-bordered > tfoot > tr > th, | |
| 9 | - .table-bordered > tfoot > tr > td { | |
| 10 | - border: 1px solid; } | |
| 11 | - .table-bordered > thead > tr > th, | |
| 12 | - .table-bordered > thead > tr > td { | |
| 13 | - border-bottom-width: 2px; | |
| 14 | - text-align: center;} | |
| 15 | - | |
| 16 | - .table > tbody + tbody { | |
| 17 | - border-top: 1px solid; } | |
| 18 | - .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ text-align: center; } | |
| 19 | -.table-checkable tr > th:first-child, .table-checkable tr > td:first-child { | |
| 20 | - text-align: center; | |
| 21 | - max-width: initial; | |
| 22 | - min-width: 40px; | |
| 23 | - padding-left: 0; | |
| 24 | - padding-right: 0; | |
| 2 | +.table-bordered { | |
| 3 | + border: 1px solid; | |
| 25 | 4 | } |
| 26 | 5 | |
| 6 | +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td, | |
| 7 | + .table-bordered>tbody>tr>th, .table-bordered>tbody>tr>td, | |
| 8 | + .table-bordered>tfoot>tr>th, .table-bordered>tfoot>tr>td { | |
| 9 | + border: 1px solid; | |
| 10 | +} | |
| 11 | + | |
| 12 | +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td { | |
| 13 | + border-bottom-width: 2px; | |
| 14 | + text-align: center; | |
| 15 | +} | |
| 16 | + | |
| 17 | +.table>tbody+tbody { | |
| 18 | + border-top: 1px solid; | |
| 19 | +} | |
| 20 | + | |
| 21 | +.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, | |
| 22 | + .table>thead>tr>td, .table>thead>tr>th { | |
| 23 | + text-align: center; | |
| 24 | +} | |
| 25 | + | |
| 26 | +.table-checkable tr>th:first-child, .table-checkable tr>td:first-child { | |
| 27 | + text-align: center; | |
| 28 | + max-width: initial; | |
| 29 | + min-width: 40px; | |
| 30 | + padding-left: 0; | |
| 31 | + padding-right: 0; | |
| 32 | +} | |
| 27 | 33 | </style> |
| 28 | 34 | |
| 29 | 35 | <div class="page-head"> |
| ... | ... | @@ -37,51 +43,64 @@ |
| 37 | 43 | <div class="portlet light porttlet-fit bordered"> |
| 38 | 44 | <div class="portlet-title"> |
| 39 | 45 | <form class="form-inline" action="" method="post"> |
| 40 | - <div style="display: inline-block;"> | |
| 41 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 42 | - <select class="form-control" name="line" id="line" style="width: 120px;"></select> | |
| 43 | - </div> | |
| 44 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 45 | - <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 46 | - <input class="form-control" type="text" id="startDate" style="width: 120px;"/> | |
| 47 | - </div> | |
| 48 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 49 | - <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 50 | - <input class="form-control" type="text" id="endDate" style="width: 120px;"/> | |
| 51 | - </div> | |
| 52 | - <div class="form-group"> | |
| 53 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 54 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 55 | - </div> | |
| 46 | + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_allline"> | |
| 47 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 48 | + <select class="form-control" name="company" id="gsdmAllline" style="width: 140px;"></select> | |
| 49 | + </div> | |
| 50 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_allline"> | |
| 51 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 52 | + <select class="form-control" name="subCompany" id="fgsdmAllline" style="width: 140px;"></select> | |
| 53 | + </div> --> | |
| 54 | + <div style="display: inline-block;"> | |
| 55 | + <span class="item-label" style="width: 80px;">线路: </span> <select | |
| 56 | + class="form-control" name="line" id="line" style="width: 120px;"></select> | |
| 57 | + </div> | |
| 58 | + <div style="display: inline-block; margin-left: 15px;"> | |
| 59 | + <span class="item-label" style="width: 80px;">开始时间: </span> <input | |
| 60 | + class="form-control" type="text" id="startDate" | |
| 61 | + style="width: 120px;" /> | |
| 62 | + </div> | |
| 63 | + <div style="display: inline-block; margin-left: 15px;"> | |
| 64 | + <span class="item-label" style="width: 80px;">结束时间: </span> <input | |
| 65 | + class="form-control" type="text" id="endDate" | |
| 66 | + style="width: 120px;" /> | |
| 67 | + </div> | |
| 68 | + <div class="form-group"> | |
| 69 | + <input class="btn btn-default" type="button" id="query" value="筛选" /> | |
| 70 | + <input class="btn btn-default" type="button" id="export" | |
| 71 | + value="导出" /> | |
| 72 | + </div> | |
| 56 | 73 | </form> |
| 57 | 74 | </div> |
| 58 | 75 | <div class="portlet-body"> |
| 59 | - <div class="table-container" style="margin-top: 20px;overflow:auto;min-width: 1000px"> | |
| 60 | - <table class="table table-bordered table-hover table-checkable" id="forms1"> | |
| 76 | + <div class="table-container" | |
| 77 | + style="margin-top: 20px; overflow: auto; min-width: 1000px"> | |
| 78 | + <table class="table table-bordered table-hover table-checkable" | |
| 79 | + id="forms1"> | |
| 61 | 80 | <thead> |
| 62 | 81 | <tr> |
| 63 | 82 | <th colspan="15">营运线路名称统计表</th> |
| 64 | 83 | </tr> |
| 65 | 84 | <tr> |
| 66 | - <td rowspan="2" style=" padding-top: 20px;">日期</td> | |
| 67 | - <td rowspan="2" style=" padding-top: 20px;">公司</td> | |
| 68 | - <td rowspan="2" style=" padding-top: 20px;">直属公司</td> | |
| 69 | - <td rowspan="2" style=" padding-top: 20px;">线路名称</td> | |
| 85 | + <td rowspan="2" style="padding-top: 20px;">日期</td> | |
| 86 | + <td rowspan="2" style="padding-top: 20px;">公司</td> | |
| 87 | + <td rowspan="2" style="padding-top: 20px;">直属公司</td> | |
| 88 | + <td rowspan="2" style="padding-top: 20px;">线路名称</td> | |
| 70 | 89 | <td colspan="2">出车数</td> |
| 71 | - <td rowspan="2" >出车率</td> | |
| 72 | - <td colspan="2" >班次数</td> | |
| 73 | - <td rowspan="2" style=" padding-top: 20px;">班次执行率</td> | |
| 74 | - <td rowspan="2" style=" padding-top: 20px;">说明</td> | |
| 90 | + <td rowspan="2">出车率</td> | |
| 91 | + <td colspan="2">班次数</td> | |
| 92 | + <td rowspan="2" style="padding-top: 20px;">班次执行率</td> | |
| 93 | + <td rowspan="2" style="padding-top: 20px;">说明</td> | |
| 75 | 94 | </tr> |
| 76 | 95 | <tr> |
| 77 | 96 | <td>计划</td> |
| 78 | 97 | <td>实际</td> |
| 79 | - <td>计划</td> | |
| 98 | + <td>计划</td> | |
| 80 | 99 | <td>实际</td> |
| 81 | 100 | </tr> |
| 82 | 101 | </thead> |
| 83 | 102 | <tbody id="tbody"> |
| 84 | - | |
| 103 | + | |
| 85 | 104 | </tbody> |
| 86 | 105 | <tr> |
| 87 | 106 | <td colspan="1">分类汇总</td> |
| ... | ... | @@ -104,96 +123,178 @@ |
| 104 | 123 | </div> |
| 105 | 124 | |
| 106 | 125 | <script> |
| 107 | - $(function(){ | |
| 126 | + $(function() { | |
| 108 | 127 | // 关闭左侧栏 |
| 109 | 128 | if (!$('body').hasClass('page-sidebar-closed')) |
| 110 | 129 | $('.menu-toggler.sidebar-toggler').click(); |
| 111 | - | |
| 130 | + | |
| 112 | 131 | $("#startDate,#endDate").datetimepicker({ |
| 113 | 132 | format : 'YYYY-MM-DD', |
| 114 | 133 | locale : 'zh-cn' |
| 115 | 134 | }); |
| 116 | - | |
| 117 | - $.get('/basic/lineCode2Name',function(result){ | |
| 118 | - var data=[]; | |
| 119 | - | |
| 120 | - for(var code in result){ | |
| 121 | - data.push({id: code, text: result[code]}); | |
| 135 | + | |
| 136 | + var obj = []; | |
| 137 | + $.get('/user/companyData', function(result) { | |
| 138 | + obj = result; | |
| 139 | + var options = ''; | |
| 140 | + for (var i = 0; i < obj.length; i++) { | |
| 141 | + options += '<option value="'+obj[i].companyCode+'">' | |
| 142 | + + obj[i].companyName + '</option>'; | |
| 122 | 143 | } |
| 123 | - initPinYinSelect2('#line',data,''); | |
| 124 | - | |
| 125 | - }) | |
| 126 | 144 | |
| 127 | - var line; | |
| 128 | - var startDate; | |
| 129 | - var endDate; | |
| 130 | - $("#query").on("click",function(){ | |
| 131 | - | |
| 132 | - line = $("#line").val(); | |
| 133 | - startDate1=$("#startDate").val(); | |
| 134 | - endDate1=$("#endDate").val(); | |
| 135 | - | |
| 136 | - if(startDate1!=''&&endDate1!=''){ | |
| 137 | - $post('/mcy_forms/allline',{line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ | |
| 138 | - // 把数据填充到模版中 | |
| 139 | - var tbodyHtml = template('allline',{list:result}); | |
| 140 | - // 把渲染好的模版html文本追加到表格中 | |
| 141 | - $('#tbody').html(tbodyHtml); | |
| 142 | - line = $("#line").val(); | |
| 143 | - startDate = $("#startDate").val(); | |
| 144 | - endDate = $("#endDate").val(); | |
| 145 | - $("#sDate").text(startDate); | |
| 146 | - $("#eDate").text(endDate); | |
| 147 | - | |
| 148 | - var total_jh = 0; | |
| 149 | - var total_sj = 0,total_ccl = 0,total_bcjh = 0; | |
| 150 | - var total_bcjh = 0,total_bcsj = 0,total_bczxl = 0; | |
| 151 | - var total_gs=0; | |
| 152 | - var total_zhgs=0; | |
| 153 | - $.each(result, function(i, obj) { | |
| 154 | - total_gs +=Number(obj.gsgs); | |
| 155 | - total_zhgs +=Number(obj.fgsgs); | |
| 156 | - total_jh = Number(obj.cchjh)+Number(total_jh); | |
| 157 | - total_sj = Number(obj.cchsj)+Number(total_sj); | |
| 158 | - | |
| 159 | - total_ccl =(Number(total_sj)/Number(total_jh))*100; | |
| 160 | - total_bcjh = Number(obj.bcjh)+Number(total_bcjh); | |
| 161 | - total_bcsj = Number(obj.bcsj)+Number(total_bcsj); | |
| 162 | - total_bczxl = (Number(total_bcsj)/Number(total_bcjh))*100; | |
| 163 | - | |
| 164 | - }); | |
| 165 | - $("#total_gs").text(total_gs); | |
| 166 | - $("#total_zhgs").text(total_zhgs); | |
| 167 | - $("#total_jh").text(total_jh); | |
| 168 | - $("#total_sj").text(total_sj); | |
| 169 | - $("#total_ccl").text(total_ccl.toFixed(2)+'%'); | |
| 170 | - $("#total_bcjh").text(total_bcjh); | |
| 171 | - $("#total_bcsj").text(total_bcsj); | |
| 172 | - $("#total_bczxl").text(total_bczxl.toFixed(2)+'%'); | |
| 173 | - | |
| 174 | - var temp = {}; | |
| 175 | - var today_account = 0; | |
| 176 | - | |
| 177 | - temp["line"] = $("#line").text(); | |
| 178 | - $.each(result, function(i, obj) { | |
| 179 | - if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){ | |
| 180 | - today_account++; | |
| 181 | - } | |
| 182 | - obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); | |
| 183 | - }); | |
| 184 | - | |
| 185 | - }) | |
| 186 | - | |
| 187 | - }else{ | |
| 188 | - alert("请选择时间范围!"); | |
| 189 | - } | |
| 190 | - }); | |
| 191 | - | |
| 192 | - $("#export").on("click",function(){ | |
| 193 | - $post('/mcy_export/alllineExport',{line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){ | |
| 194 | - window.open("/downloadFile/download?fileName=营运线路名称统计表"+moment(startDate).format("YYYYMMDD")); | |
| 145 | + if (obj.length == 0) { | |
| 146 | + $("#gsdmDiv_allline").css('display', 'none'); | |
| 147 | + $('#fgsdmDiv_allline').css('display', 'none'); | |
| 148 | + } else if (obj.length == 1) { | |
| 149 | + $("#gsdmDiv_allline").css('display', 'none'); | |
| 150 | + if (obj[0].children.length == 1 || obj[0].children.length == 0) | |
| 151 | + $('#fgsdmDiv_allline').css('display', 'none'); | |
| 152 | + } | |
| 153 | + $('#gsdmAllline').html(options); | |
| 154 | + updateCompany(); | |
| 195 | 155 | }); |
| 196 | - }); | |
| 156 | + | |
| 157 | + $("#gsdmAllline").on("change", updateCompany); | |
| 158 | + function updateCompany() { | |
| 159 | + var company = $('#gsdmAllline').val(); | |
| 160 | + var options = ''; | |
| 161 | + for (var i = 0; i < obj.length; i++) { | |
| 162 | + if (obj[i].companyCode == company) { | |
| 163 | + var children = obj[i].children; | |
| 164 | + for (var j = 0; j < children.length; j++) { | |
| 165 | + options += '<option value="'+children[j].code+'">' | |
| 166 | + + children[j].name + '</option>'; | |
| 167 | + } | |
| 168 | + } | |
| 169 | + } | |
| 170 | + $('#fgsdmAllline').html(options); | |
| 171 | + } | |
| 172 | + | |
| 173 | + $.get('/basic/lineCode2Name', function(result) { | |
| 174 | + var data = []; | |
| 175 | + | |
| 176 | + for ( var code in result) { | |
| 177 | + data.push({ | |
| 178 | + id : code, | |
| 179 | + text : result[code] | |
| 180 | + }); | |
| 181 | + } | |
| 182 | + initPinYinSelect2('#line', data, ''); | |
| 183 | + | |
| 184 | + }) | |
| 185 | + | |
| 186 | + var line; | |
| 187 | + var startDate; | |
| 188 | + var endDate; | |
| 189 | + var gsdmAllline; | |
| 190 | + var fgsdmAllline; | |
| 191 | + $("#query").on("click",function() { | |
| 192 | + line = $("#line").val(); | |
| 193 | + startDate1 = $("#startDate").val(); | |
| 194 | + endDate1 = $("#endDate").val(); | |
| 195 | + gsdmAllline = $("#gsdmAllline").val(); | |
| 196 | + fgsdmAllline = $("#fgsdmAllline").val(); | |
| 197 | + if (startDate1 != '' && endDate1 != '') { | |
| 198 | + $post('/mcy_forms/allline',{ | |
| 199 | + /* gsdmAllline:gsdmAllline,fgsdmAllline:fgsdmAllline, */ | |
| 200 | + line : line, | |
| 201 | + startDate : $("#startDate").val(), | |
| 202 | + endDate : $("#endDate").val(), | |
| 203 | + type : 'query' | |
| 204 | + }, | |
| 205 | + function(result) { | |
| 206 | + // 把数据填充到模版中 | |
| 207 | + var tbodyHtml = template('allline', | |
| 208 | + { | |
| 209 | + list : result | |
| 210 | + }); | |
| 211 | + // 把渲染好的模版html文本追加到表格中 | |
| 212 | + $('#tbody').html(tbodyHtml); | |
| 213 | + line = $("#line").val(); | |
| 214 | + startDate = $("#startDate").val(); | |
| 215 | + endDate = $("#endDate").val(); | |
| 216 | + $("#sDate").text(startDate); | |
| 217 | + $("#eDate").text(endDate); | |
| 218 | + | |
| 219 | + var total_jh = 0; | |
| 220 | + var total_sj = 0, total_ccl = 0, total_bcjh = 0; | |
| 221 | + var total_bcjh = 0, total_bcsj = 0, total_bczxl = 0; | |
| 222 | + var total_gs = 0; | |
| 223 | + var total_zhgs = 0; | |
| 224 | + $ | |
| 225 | + .each( | |
| 226 | + result, | |
| 227 | + function(i, obj) { | |
| 228 | + total_gs += Number(obj.gsgs); | |
| 229 | + total_zhgs += Number(obj.fgsgs); | |
| 230 | + total_jh = Number(obj.cchjh) | |
| 231 | + + Number(total_jh); | |
| 232 | + total_sj = Number(obj.cchsj) | |
| 233 | + + Number(total_sj); | |
| 234 | + | |
| 235 | + total_ccl = (Number(total_sj) / Number(total_jh)) * 100; | |
| 236 | + total_bcjh = Number(obj.bcjh) | |
| 237 | + + Number(total_bcjh); | |
| 238 | + total_bcsj = Number(obj.bcsj) | |
| 239 | + + Number(total_bcsj); | |
| 240 | + total_bczxl = (Number(total_bcsj) / Number(total_bcjh)) * 100; | |
| 241 | + | |
| 242 | + }); | |
| 243 | + $("#total_gs").text(total_gs); | |
| 244 | + $("#total_zhgs").text(total_zhgs); | |
| 245 | + $("#total_jh").text(total_jh); | |
| 246 | + $("#total_sj").text(total_sj); | |
| 247 | + $("#total_ccl").text( | |
| 248 | + total_ccl.toFixed(2) + '%'); | |
| 249 | + $("#total_bcjh").text(total_bcjh); | |
| 250 | + $("#total_bcsj").text(total_bcsj); | |
| 251 | + $("#total_bczxl").text( | |
| 252 | + total_bczxl.toFixed(2) | |
| 253 | + + '%'); | |
| 254 | + | |
| 255 | + var temp = {}; | |
| 256 | + var today_account = 0; | |
| 257 | + | |
| 258 | + temp["line"] = $("#line").text(); | |
| 259 | + $ | |
| 260 | + .each( | |
| 261 | + result, | |
| 262 | + function(i, obj) { | |
| 263 | + if (moment( | |
| 264 | + obj.schedule_date_str) | |
| 265 | + .format( | |
| 266 | + "YYYY-MM-DD") == moment( | |
| 267 | + obj.startDate) | |
| 268 | + .format( | |
| 269 | + "YYYY-MM-DD")) { | |
| 270 | + today_account++; | |
| 271 | + } | |
| 272 | + obj.updateDate = moment( | |
| 273 | + obj.startDate) | |
| 274 | + .format( | |
| 275 | + "YYYY-MM-DD HH:mm:ss"); | |
| 276 | + }); | |
| 277 | + | |
| 278 | + }) | |
| 279 | + | |
| 280 | + } else { | |
| 281 | + alert("请选择时间范围!"); | |
| 282 | + } | |
| 283 | + }); | |
| 284 | + | |
| 285 | + $("#export").on( | |
| 286 | + "click", | |
| 287 | + function() { | |
| 288 | + $post('/mcy_export/alllineExport', { | |
| 289 | + line : line, | |
| 290 | + startDate : startDate, | |
| 291 | + endDate : endDate, | |
| 292 | + type : 'export' | |
| 293 | + }, function(result) { | |
| 294 | + window.open("/downloadFile/download?fileName=营运线路名称统计表" | |
| 295 | + + moment(startDate).format("YYYYMMDD")); | |
| 296 | + }); | |
| 297 | + }); | |
| 197 | 298 | }); |
| 198 | 299 | </script> |
| 199 | 300 | <script type="text/html" id="allline"> | ... | ... |
src/main/resources/static/pages/forms/statement/changetochange.html
| 1 | 1 | <style type="text/css"> |
| 2 | - .table-bordered { | |
| 3 | - border: 1px solid; } | |
| 4 | - .table-bordered > thead > tr > th, | |
| 5 | - .table-bordered > thead > tr > td, | |
| 6 | - .table-bordered > tbody > tr > th, | |
| 7 | - .table-bordered > tbody > tr > td, | |
| 8 | - .table-bordered > tfoot > tr > th, | |
| 9 | - .table-bordered > tfoot > tr > td { | |
| 10 | - border: 1px solid; } | |
| 11 | - .table-bordered > thead > tr > th, | |
| 12 | - .table-bordered > thead > tr > td { | |
| 13 | - border-bottom-width: 2px; | |
| 14 | - text-align: center;} | |
| 15 | - | |
| 16 | - .table > tbody + tbody { | |
| 17 | - border-top: 1px solid; } | |
| 18 | - .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ text-align: center; } | |
| 19 | -.table-checkable tr > th:first-child, .table-checkable tr > td:first-child { | |
| 20 | - text-align: center; | |
| 21 | - max-width: initial; | |
| 22 | - min-width: 40px; | |
| 23 | - padding-left: 0; | |
| 24 | - padding-right: 0; | |
| 2 | +.table-bordered { | |
| 3 | + border: 1px solid; | |
| 25 | 4 | } |
| 26 | 5 | |
| 6 | +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td, | |
| 7 | + .table-bordered>tbody>tr>th, .table-bordered>tbody>tr>td, | |
| 8 | + .table-bordered>tfoot>tr>th, .table-bordered>tfoot>tr>td { | |
| 9 | + border: 1px solid; | |
| 10 | +} | |
| 11 | + | |
| 12 | +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td { | |
| 13 | + border-bottom-width: 2px; | |
| 14 | + text-align: center; | |
| 15 | +} | |
| 16 | + | |
| 17 | +.table>tbody+tbody { | |
| 18 | + border-top: 1px solid; | |
| 19 | +} | |
| 20 | + | |
| 21 | +.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, | |
| 22 | + .table>thead>tr>td, .table>thead>tr>th { | |
| 23 | + text-align: center; | |
| 24 | +} | |
| 25 | + | |
| 26 | +.table-checkable tr>th:first-child, .table-checkable tr>td:first-child { | |
| 27 | + text-align: center; | |
| 28 | + max-width: initial; | |
| 29 | + min-width: 40px; | |
| 30 | + padding-left: 0; | |
| 31 | + padding-right: 0; | |
| 32 | +} | |
| 27 | 33 | </style> |
| 28 | 34 | |
| 29 | 35 | <div class="page-head"> |
| ... | ... | @@ -37,58 +43,71 @@ |
| 37 | 43 | <div class="portlet light porttlet-fit bordered"> |
| 38 | 44 | <div class="portlet-title"> |
| 39 | 45 | <form class="form-inline" action="" method="post"> |
| 40 | - <div style="display: inline-block;"> | |
| 46 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_change"> | |
| 47 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 48 | + <select class="form-control" name="company" id="gsdmChange" style="width: 140px;"></select> | |
| 49 | + </div> | |
| 50 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_change"> | |
| 51 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 52 | + <select class="form-control" name="subCompany" id="fgsdmChange" style="width: 140px;"></select> | |
| 53 | + </div> | |
| 54 | + <div style="display: inline-block;"> | |
| 41 | 55 | <span class="item-label" style="width: 80px;">线路: </span> |
| 42 | - <select class="form-control" name="line" id="line" style="width: 120px;"></select> | |
| 43 | - </div> | |
| 44 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 45 | - <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 46 | - <input class="form-control" type="text" id="startDate" style="width: 120px;"/> | |
| 56 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 47 | 57 | </div> |
| 48 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 49 | - <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 50 | - <input class="form-control" type="text" id="endDate" style="width: 120px;"/> | |
| 51 | - </div> | |
| 52 | - <div style="display: inline-block;"> | |
| 53 | - <span class="item-label" style="width: 120px;">类型: </span> | |
| 54 | - <select class="form-control" id="sel"> | |
| 55 | - <option value="">请选择</option> | |
| 56 | - <option value="1">换人</option> | |
| 57 | - <option value="2">换车</option> | |
| 58 | + <div style="display: inline-block; margin-left: 15px;"> | |
| 59 | + <span class="item-label" style="width: 80px;">开始时间: </span> <input | |
| 60 | + class="form-control" type="text" id="startDate" | |
| 61 | + style="width: 120px;" /> | |
| 62 | + </div> | |
| 63 | + <div style="display: inline-block; margin-left: 15px;"> | |
| 64 | + <span class="item-label" style="width: 80px;">结束时间: </span> <input | |
| 65 | + class="form-control" type="text" id="endDate" | |
| 66 | + style="width: 120px;" /> | |
| 67 | + </div> | |
| 68 | + <div style="display: inline-block;"> | |
| 69 | + <span class="item-label" style="width: 120px;">类型: </span> <select | |
| 70 | + class="form-control" id="sel"> | |
| 71 | + <option value="">请选择</option> | |
| 72 | + <option value="1">换人</option> | |
| 73 | + <option value="2">换车</option> | |
| 58 | 74 | </select> |
| 59 | 75 | </div> |
| 60 | - <div class="form-group"> | |
| 61 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 62 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 63 | - </div> | |
| 76 | + <div class="form-group"> | |
| 77 | + <input class="btn btn-default" type="button" id="query" value="筛选" /> | |
| 78 | + <input class="btn btn-default" type="button" id="export" | |
| 79 | + value="导出" /> | |
| 80 | + </div> | |
| 64 | 81 | </form> |
| 65 | 82 | </div> |
| 66 | 83 | <div class="portlet-body"> |
| 67 | - <div class="table-container" style="margin-top: 20px;overflow:auto;min-width: 1000px"> | |
| 68 | - <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 84 | + <div class="table-container" | |
| 85 | + style="margin-top: 20px; overflow: auto; min-width: 1000px"> | |
| 86 | + <table class="table table-bordered table-hover table-checkable" | |
| 87 | + id="forms"> | |
| 69 | 88 | <thead> |
| 70 | 89 | <tr> |
| 71 | 90 | <th colspan="15">换人换车情况统计表</th> |
| 72 | 91 | </tr> |
| 73 | 92 | <tr> |
| 74 | - <td rowspan="3" style=" padding-top: 50px;">日期</td> | |
| 75 | - <td rowspan="3" style=" padding-top: 50px;">公司</td> | |
| 76 | - <td rowspan="3" style=" padding-top: 50px;">分公司</td> | |
| 77 | - <td rowspan="3" style=" padding-top: 50px;">线路</td> | |
| 78 | - <td rowspan="3" style=" padding-top: 50px;">路牌</td> | |
| 79 | - <td rowspan="3" style=" padding-top: 50px;">发生时间</td> | |
| 80 | - <td rowspan="3" style=" padding-top: 50px;">修改时间</td> | |
| 93 | + <td rowspan="3" style="padding-top: 50px;">日期</td> | |
| 94 | + <td rowspan="3" style="padding-top: 50px;">公司</td> | |
| 95 | + <td rowspan="3" style="padding-top: 50px;">分公司</td> | |
| 96 | + <td rowspan="3" style="padding-top: 50px;">线路</td> | |
| 97 | + <td rowspan="3" style="padding-top: 50px;">路牌</td> | |
| 98 | + <td rowspan="3" style="padding-top: 50px;">发生时间</td> | |
| 99 | + <td rowspan="3" style="padding-top: 50px;">修改时间</td> | |
| 81 | 100 | <td colspan="2">配车</td> |
| 82 | 101 | <td colspan="4">人员</td> |
| 83 | - <td rowspan="3" style=" padding-top: 50px;">原因</td> | |
| 84 | - <td rowspan="3" style=" padding-top: 50px;">修改人</td> | |
| 102 | + <td rowspan="3" style="padding-top: 50px;">原因</td> | |
| 103 | + <td rowspan="3" style="padding-top: 50px;">修改人</td> | |
| 85 | 104 | </tr> |
| 86 | 105 | <tr> |
| 87 | 106 | <td>计划</td> |
| 88 | 107 | <td>实际</td> |
| 89 | 108 | <td colspan="2">计划</td> |
| 90 | 109 | <td colspan="2">实际</td> |
| 91 | - | |
| 110 | + | |
| 92 | 111 | </tr> |
| 93 | 112 | <tr> |
| 94 | 113 | <td>车号</td> |
| ... | ... | @@ -100,7 +119,7 @@ |
| 100 | 119 | </tr> |
| 101 | 120 | </thead> |
| 102 | 121 | <tbody> |
| 103 | - | |
| 122 | + | |
| 104 | 123 | </tbody> |
| 105 | 124 | </table> |
| 106 | 125 | </div> |
| ... | ... | @@ -110,94 +129,121 @@ |
| 110 | 129 | </div> |
| 111 | 130 | |
| 112 | 131 | <script> |
| 113 | - $(function(){ | |
| 132 | + $(function() { | |
| 114 | 133 | // 关闭左侧栏 |
| 115 | 134 | if (!$('body').hasClass('page-sidebar-closed')) |
| 116 | 135 | $('.menu-toggler.sidebar-toggler').click(); |
| 117 | - | |
| 136 | + | |
| 118 | 137 | $("#startDate,#endDate").datetimepicker({ |
| 119 | 138 | format : 'YYYY-MM-DD', |
| 120 | 139 | locale : 'zh-cn' |
| 121 | 140 | }); |
| 141 | + | |
| 122 | 142 | |
| 123 | - $('#line').select2({ | |
| 124 | - ajax: { | |
| 125 | - url: '/realSchedule/findLine', | |
| 126 | - type: 'post', | |
| 127 | - dataType: 'json', | |
| 128 | - delay: 150, | |
| 129 | - data: function(params){ | |
| 130 | - return{line: params.term}; | |
| 131 | - }, | |
| 132 | - processResults: function (data) { | |
| 133 | - return { | |
| 134 | - results: data | |
| 135 | - }; | |
| 136 | - }, | |
| 137 | - cache: true | |
| 138 | - }, | |
| 139 | - templateResult: function(repo){ | |
| 140 | - if (repo.loading) return repo.text; | |
| 141 | - var h = '<span>'+repo.text+'</span>'; | |
| 142 | - return h; | |
| 143 | - }, | |
| 144 | - escapeMarkup: function (markup) { return markup; }, | |
| 145 | - minimumInputLength: 1, | |
| 146 | - templateSelection: function(repo){ | |
| 147 | - return repo.text; | |
| 148 | - }, | |
| 149 | - language: { | |
| 150 | - noResults: function(){ | |
| 151 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 152 | - }, | |
| 153 | - inputTooShort : function(e) { | |
| 154 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 155 | - }, | |
| 156 | - searching : function() { | |
| 157 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 158 | - } | |
| 159 | - } | |
| 160 | - }); | |
| 161 | - var line; | |
| 162 | - var startDate; | |
| 163 | - var endDate; | |
| 164 | - $("#query").on("click",function(){ | |
| 165 | - line = $("#line").val(); | |
| 166 | - sel = $("#sel").val(); | |
| 167 | - var startDate1=$("#startDate").val(); | |
| 168 | - var endDate1=$("#endDate").val(); | |
| 143 | + var obj = []; | |
| 144 | + $.get('/user/companyData', function(result){ | |
| 145 | + obj = result; | |
| 146 | + var options = ''; | |
| 147 | + for(var i = 0; i < obj.length; i++){ | |
| 148 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 149 | + } | |
| 150 | + if(obj.length ==0){ | |
| 151 | + $("#gsdmDiv_change").css('display','none'); | |
| 152 | + $('#fgsdmDiv_change').css('display','none'); | |
| 153 | + }else if(obj.length ==1){ | |
| 154 | + $("#gsdmDiv_change").css('display','none'); | |
| 155 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 156 | + $('#fgsdmDiv_change').css('display','none'); | |
| 157 | + } | |
| 158 | + $('#gsdmChange').html(options); | |
| 159 | + updateCompany(); | |
| 160 | + }); | |
| 161 | + | |
| 162 | + $("#gsdmChange").on("change",updateCompany); | |
| 163 | + function updateCompany(){ | |
| 164 | + var company = $('#gsdmChange').val(); | |
| 165 | + var options = ''; | |
| 166 | + for(var i = 0; i < obj.length; i++){ | |
| 167 | + if(obj[i].companyCode == company){ | |
| 168 | + var children = obj[i].children; | |
| 169 | + for(var j = 0; j < children.length; j++){ | |
| 170 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 171 | + } | |
| 172 | + } | |
| 173 | + } | |
| 174 | + $('#fgsdmChange').html(options); | |
| 175 | + } | |
| 176 | + | |
| 177 | + $.get('/basic/lineCode2Name',function(result){ | |
| 178 | + var data=[]; | |
| 169 | 179 | |
| 170 | - if(startDate1!=''&&endDate1!=''){ | |
| 171 | - $post('/mcy_forms/changetochange',{sel:sel,line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ | |
| 172 | - startDate = $("#startDate").val(); | |
| 173 | - endDate = $("#endDate").val(); | |
| 174 | - $("#sDate").text(startDate); | |
| 175 | - $("#eDate").text(endDate); | |
| 176 | - var temp = {}; | |
| 177 | - var today_account = 0; | |
| 178 | - temp["line"] = $("#line").text(); | |
| 179 | - $.each(result, function(i, obj) { | |
| 180 | - if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){ | |
| 181 | - today_account++; | |
| 182 | - } | |
| 183 | - obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); | |
| 184 | - }); | |
| 185 | - // 把数据填充到模版中 | |
| 186 | - var tbodyHtml = template('changetochange',{list:result}); | |
| 187 | - // 把渲染好的模版html文本追加到表格中 | |
| 188 | - $('#forms tbody').html(tbodyHtml); | |
| 189 | - }) | |
| 180 | + for(var code in result){ | |
| 181 | + data.push({id: code, text: result[code]}); | |
| 182 | + } | |
| 183 | + initPinYinSelect2('#line',data,''); | |
| 184 | + | |
| 185 | + }) | |
| 190 | 186 | |
| 191 | - }else{ | |
| 192 | - alert("请选择时间范围!"); | |
| 193 | - } | |
| 194 | - }); | |
| 195 | - | |
| 196 | - $("#export").on("click",function(){ | |
| 197 | - $post('/mcy_export/changetochangeExport',{startDate:startDate,endDate:endDate,type:'export'},function(result){ | |
| 198 | - window.open("/downloadFile/download?fileName=换人换车情况日统计"+moment(startDate).format("YYYYMMDD")); | |
| 199 | - }); | |
| 200 | - }); | |
| 187 | + var line; | |
| 188 | + var startDate; | |
| 189 | + var endDate; | |
| 190 | + $("#query").on( | |
| 191 | + "click", | |
| 192 | + function() { | |
| 193 | + line = $("#line").val(); | |
| 194 | + sel = $("#sel").val(); | |
| 195 | + var startDate1 = $("#startDate").val(); | |
| 196 | + var endDate1 = $("#endDate").val(); | |
| 197 | + | |
| 198 | + if (startDate1 != '' && endDate1 != '') { | |
| 199 | + $post('/mcy_forms/changetochange', { | |
| 200 | + sel : sel, | |
| 201 | + line : line, | |
| 202 | + startDate : $("#startDate").val(), | |
| 203 | + endDate : $("#endDate").val(), | |
| 204 | + type : 'query' | |
| 205 | + }, function(result) { | |
| 206 | + startDate = $("#startDate").val(); | |
| 207 | + endDate = $("#endDate").val(); | |
| 208 | + $("#sDate").text(startDate); | |
| 209 | + $("#eDate").text(endDate); | |
| 210 | + var temp = {}; | |
| 211 | + var today_account = 0; | |
| 212 | + temp["line"] = $("#line").text(); | |
| 213 | + $.each(result, function(i, obj) { | |
| 214 | + if (moment(obj.schedule_date_str).format( | |
| 215 | + "YYYY-MM-DD") == moment(obj.startDate) | |
| 216 | + .format("YYYY-MM-DD")) { | |
| 217 | + today_account++; | |
| 218 | + } | |
| 219 | + obj.updateDate = moment(obj.startDate).format( | |
| 220 | + "YYYY-MM-DD HH:mm:ss"); | |
| 221 | + }); | |
| 222 | + // 把数据填充到模版中 | |
| 223 | + var tbodyHtml = template('changetochange', { | |
| 224 | + list : result | |
| 225 | + }); | |
| 226 | + // 把渲染好的模版html文本追加到表格中 | |
| 227 | + $('#forms tbody').html(tbodyHtml); | |
| 228 | + }) | |
| 229 | + | |
| 230 | + } else { | |
| 231 | + alert("请选择时间范围!"); | |
| 232 | + } | |
| 233 | + }); | |
| 234 | + | |
| 235 | + $("#export").on( | |
| 236 | + "click", | |
| 237 | + function() { | |
| 238 | + $post('/mcy_export/changetochangeExport', { | |
| 239 | + startDate : startDate, | |
| 240 | + endDate : endDate, | |
| 241 | + type : 'export' | |
| 242 | + }, function(result) { | |
| 243 | + window.open("/downloadFile/download?fileName=换人换车情况日统计" | |
| 244 | + + moment(startDate).format("YYYYMMDD")); | |
| 245 | + }); | |
| 246 | + }); | |
| 201 | 247 | }); |
| 202 | 248 | </script> |
| 203 | 249 | <script type="text/html" id="changetochange"> | ... | ... |
src/main/resources/static/pages/forms/statement/correctStatis.html
| ... | ... | @@ -147,7 +147,7 @@ |
| 147 | 147 | initPinYinSelect2('#line',data,''); |
| 148 | 148 | |
| 149 | 149 | line = ""; |
| 150 | - updateModel(); | |
| 150 | +// updateModel(); | |
| 151 | 151 | }); |
| 152 | 152 | |
| 153 | 153 | var obj = []; |
| ... | ... | @@ -285,17 +285,17 @@ |
| 285 | 285 | line = $("#line").val(); |
| 286 | 286 | if(line == " ") |
| 287 | 287 | line = ""; |
| 288 | - updateModel(); | |
| 288 | +// updateModel(); | |
| 289 | 289 | }); |
| 290 | 290 | $('#startDate').on("blur", function(){ |
| 291 | 291 | startDate = $("#startDate").val(); |
| 292 | 292 | endDate = $("#endDate").val(); |
| 293 | - updateModel(); | |
| 293 | +// updateModel(); | |
| 294 | 294 | }); |
| 295 | 295 | $('#endDate').on("blur", function(){ |
| 296 | 296 | startDate = $("#startDate").val(); |
| 297 | 297 | endDate = $("#endDate").val(); |
| 298 | - updateModel(); | |
| 298 | +// updateModel(); | |
| 299 | 299 | }); |
| 300 | 300 | |
| 301 | 301 | ... | ... |
src/main/resources/static/pages/forms/statement/daily.html
| ... | ... | @@ -98,7 +98,6 @@ |
| 98 | 98 | for(var code in result){ |
| 99 | 99 | data.push({id: code, text: result[code]}); |
| 100 | 100 | } |
| 101 | - console.log(data); | |
| 102 | 101 | initPinYinSelect2('#line',data,''); |
| 103 | 102 | |
| 104 | 103 | }) |
| ... | ... | @@ -106,9 +105,10 @@ |
| 106 | 105 | var date; |
| 107 | 106 | $("#query").on("click",function(){ |
| 108 | 107 | line = $("#line").val(); |
| 108 | + var lineName=$("#select2-line-container").html(); | |
| 109 | 109 | date = $("#date").val(); |
| 110 | 110 | $get('/realSchedule/dailyInfo',{line:line,date:date,type:'query'},function(result){ |
| 111 | - $("#form_line").text(line); | |
| 111 | + $("#form_line").text(lineName); | |
| 112 | 112 | $("#form_date").text(date); |
| 113 | 113 | var total_zgl = 0,total_ksgl = 0,total_yh = 0,total_bcs = 0; |
| 114 | 114 | $.each(result, function(i, obj) { | ... | ... |
src/main/resources/static/pages/forms/statement/executionrate.html
| ... | ... | @@ -37,6 +37,14 @@ |
| 37 | 37 | <div class="portlet light porttlet-fit bordered"> |
| 38 | 38 | <div class="portlet-title"> |
| 39 | 39 | <form class="form-inline" action="" method="post"> |
| 40 | + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_ececut"> | |
| 41 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 42 | + <select class="form-control" name="company" id="gsdmEcecut" style="width: 140px;"></select> | |
| 43 | + </div> | |
| 44 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_ececut"> | |
| 45 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 46 | + <select class="form-control" name="subCompany" id="fgsdmEcecut" style="width: 140px;"></select> | |
| 47 | + </div> --> | |
| 40 | 48 | <div style="display: inline-block;"> |
| 41 | 49 | <span class="item-label" style="width: 80px;">线路: </span> |
| 42 | 50 | <select class="form-control" name="line" id="line" style="width: 120px;"></select> |
| ... | ... | @@ -114,6 +122,42 @@ |
| 114 | 122 | locale : 'zh-cn' |
| 115 | 123 | }); |
| 116 | 124 | |
| 125 | + | |
| 126 | + var obj = []; | |
| 127 | + $.get('/user/companyData', function(result){ | |
| 128 | + obj = result; | |
| 129 | + var options = ''; | |
| 130 | + for(var i = 0; i < obj.length; i++){ | |
| 131 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 132 | + } | |
| 133 | + | |
| 134 | + if(obj.length ==0){ | |
| 135 | + $("#gsdmDiv_ececut").css('display','none'); | |
| 136 | + $('#fgsdmDiv_ececut').css('display','none'); | |
| 137 | + }else if(obj.length ==1){ | |
| 138 | + $("#gsdmDiv_ececut").css('display','none'); | |
| 139 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 140 | + $('#fgsdmDiv_ececut').css('display','none'); | |
| 141 | + } | |
| 142 | + $('#gsdmEcecut').html(options); | |
| 143 | + updateCompany(); | |
| 144 | + }); | |
| 145 | + | |
| 146 | + $("#gsdmEcecut").on("change",updateCompany); | |
| 147 | + function updateCompany(){ | |
| 148 | + var company = $('#gsdmEcecut').val(); | |
| 149 | + var options = ''; | |
| 150 | + for(var i = 0; i < obj.length; i++){ | |
| 151 | + if(obj[i].companyCode == company){ | |
| 152 | + var children = obj[i].children; | |
| 153 | + for(var j = 0; j < children.length; j++){ | |
| 154 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 155 | + } | |
| 156 | + } | |
| 157 | + } | |
| 158 | + $('#fgsdmEcecut').html(options); | |
| 159 | + } | |
| 160 | + | |
| 117 | 161 | $.get('/basic/lineCode2Name',function(result){ |
| 118 | 162 | var data=[]; |
| 119 | 163 | |
| ... | ... | @@ -127,19 +171,23 @@ |
| 127 | 171 | var line; |
| 128 | 172 | var startDate; |
| 129 | 173 | var endDate; |
| 174 | + var gsdmEcecut; | |
| 175 | + var fgsdmEcecut; | |
| 130 | 176 | $("#query").on("click",function(){ |
| 131 | 177 | |
| 132 | 178 | line = $("#line").val(); |
| 133 | 179 | startDate1=$("#startDate").val(); |
| 134 | 180 | endDate1=$("#endDate").val(); |
| 135 | - | |
| 181 | + gsdmEcecut=$("#gsdmEcecut").val(); | |
| 182 | + fgsdmEcecut=$("#fgsdmEcecut").val(); | |
| 136 | 183 | if(startDate1!=''&&endDate1!=''){ |
| 137 | - $post('/mcy_forms/executionrate',{line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ | |
| 184 | + $post('/mcy_forms/executionrate',{/* gsdmEcecut:gsdmEcecut,fgsdmEcecut:fgsdmEcecut, */line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ | |
| 138 | 185 | // 把数据填充到模版中 |
| 139 | 186 | var tbodyHtml = template('executionrate',{list:result}); |
| 140 | 187 | // 把渲染好的模版html文本追加到表格中 |
| 141 | 188 | $('#tbody').html(tbodyHtml); |
| 142 | 189 | line = $("#line").val(); |
| 190 | + | |
| 143 | 191 | startDate = $("#startDate").val(); |
| 144 | 192 | endDate = $("#endDate").val(); |
| 145 | 193 | $("#sDate").text(startDate); | ... | ... |
src/main/resources/static/pages/forms/statement/linepassengerflow.html
| ... | ... | @@ -27,6 +27,14 @@ |
| 27 | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | 28 | <div class="portlet-title"> |
| 29 | 29 | <form class="form-inline" action=""> |
| 30 | + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_line"> | |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 32 | + <select class="form-control" name="company" id="gsdmLine" style="width: 140px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_line"> | |
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 36 | + <select class="form-control" name="subCompany" id="fgsdmLine" style="width: 140px;"></select> | |
| 37 | + </div> --> | |
| 30 | 38 | <div style="display: inline-block;"> |
| 31 | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 32 | 40 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| ... | ... | @@ -74,6 +82,43 @@ |
| 74 | 82 | locale : 'zh-cn' |
| 75 | 83 | }); |
| 76 | 84 | |
| 85 | + var obj = []; | |
| 86 | + $.get('/user/companyData', function(result){ | |
| 87 | + obj = result; | |
| 88 | + var options = ''; | |
| 89 | + for(var i = 0; i < obj.length; i++){ | |
| 90 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 91 | + } | |
| 92 | + | |
| 93 | + if(obj.length ==0){ | |
| 94 | + $("#gsdmDiv_line").css('display','none'); | |
| 95 | + $('#fgsdmDiv_line').css('display','none'); | |
| 96 | + }else if(obj.length ==1){ | |
| 97 | + $("#gsdmDiv_line").css('display','none'); | |
| 98 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 99 | + $('#fgsdmDiv_line').css('display','none'); | |
| 100 | + } | |
| 101 | + $('#gsdmLine').html(options); | |
| 102 | + updateCompany(); | |
| 103 | + }); | |
| 104 | + | |
| 105 | + $("#gsdmLine").on("change",updateCompany); | |
| 106 | + function updateCompany(){ | |
| 107 | + var company = $('#gsdmLine').val(); | |
| 108 | + var options = ''; | |
| 109 | + for(var i = 0; i < obj.length; i++){ | |
| 110 | + if(obj[i].companyCode == company){ | |
| 111 | + var children = obj[i].children; | |
| 112 | + for(var j = 0; j < children.length; j++){ | |
| 113 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 114 | + } | |
| 115 | + } | |
| 116 | + } | |
| 117 | + $('#fgsdmLine').html(options); | |
| 118 | + } | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 77 | 122 | $.get('/basic/lineCode2Name',function(result){ |
| 78 | 123 | var data=[]; |
| 79 | 124 | |
| ... | ... | @@ -85,10 +130,17 @@ |
| 85 | 130 | |
| 86 | 131 | }) |
| 87 | 132 | |
| 133 | + | |
| 134 | + var line; | |
| 135 | + var date; | |
| 136 | + var gsdmLine; | |
| 137 | + var fgsdmLine; | |
| 88 | 138 | $("#query").on("click",function(){ |
| 89 | 139 | var line = $("#line").val(); |
| 90 | 140 | var date = $("#date").val(); |
| 91 | - $post('/mcy_forms/linepasswengerflow',{line:line,date:date},function(result){ | |
| 141 | + var gsdmLine = $("#gsdmLine").val(); | |
| 142 | + var fgsdmLine = $("#fgsdmLine").val(); | |
| 143 | + $post('/mcy_forms/linepasswengerflow',{/* gsdmLine:gsdmLine,fgsdmLine:fgsdmLine, */line:line,date:date,type:'query'},function(result){ | |
| 92 | 144 | $.each(result, function(i, obj) { |
| 93 | 145 | obj.requestType = reqCodeMap[obj.requestType]; |
| 94 | 146 | }); | ... | ... |
src/main/resources/static/pages/forms/statement/operationservice.html
| 1 | 1 | <style type="text/css"> |
| 2 | - .table-bordered { | |
| 3 | - border: 1px solid; } | |
| 4 | - .table-bordered > thead > tr > th, | |
| 5 | - .table-bordered > thead > tr > td, | |
| 6 | - .table-bordered > tbody > tr > th, | |
| 7 | - .table-bordered > tbody > tr > td, | |
| 8 | - .table-bordered > tfoot > tr > th, | |
| 9 | - .table-bordered > tfoot > tr > td { | |
| 10 | - border: 1px solid; } | |
| 11 | - .table-bordered > thead > tr > th, | |
| 12 | - .table-bordered > thead > tr > td { | |
| 13 | - border-bottom-width: 2px; | |
| 14 | - text-align: center; } | |
| 15 | - | |
| 16 | - .table > tbody + tbody { | |
| 17 | - border-top: 1px solid; } | |
| 2 | +.table-bordered { | |
| 3 | + border: 1px solid; | |
| 4 | +} | |
| 5 | + | |
| 6 | +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td, | |
| 7 | + .table-bordered>tbody>tr>th, .table-bordered>tbody>tr>td, | |
| 8 | + .table-bordered>tfoot>tr>th, .table-bordered>tfoot>tr>td { | |
| 9 | + border: 1px solid; | |
| 10 | +} | |
| 11 | + | |
| 12 | +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td { | |
| 13 | + border-bottom-width: 2px; | |
| 14 | + text-align: center; | |
| 15 | +} | |
| 16 | + | |
| 17 | +.table>tbody+tbody { | |
| 18 | + border-top: 1px solid; | |
| 19 | +} | |
| 18 | 20 | </style> |
| 19 | 21 | |
| 20 | 22 | <div class="page-head"> |
| ... | ... | @@ -22,54 +24,53 @@ |
| 22 | 24 | <h1>运营服务阶段报表</h1> |
| 23 | 25 | </div> |
| 24 | 26 | </div> |
| 25 | - | |
| 26 | -<div class="row"> | |
| 27 | - <div class="col-md-12"> | |
| 28 | - <div class="portlet light porttlet-fit bordered"> | |
| 29 | - <div class="portlet-title"> | |
| 30 | - <form class="form-inline" action=""> | |
| 31 | - <!-- <div style="display: inline-block;"> | |
| 32 | - <span class="item-label" style="width: 120px;">公司: </span> | |
| 33 | - <select class="form-control"> | |
| 34 | - <option value="normal">请选择</option> | |
| 35 | - <option value="22">金高公司</option> | |
| 36 | - <option value="05">杨高公司</option> | |
| 37 | - <option value="26">南汇公司</option> | |
| 38 | - <option value="55">上南公司</option> | |
| 39 | - <option value="77">闵行公司</option> | |
| 40 | - </select> | |
| 41 | - <select class="form-control"> | |
| 42 | - <option value="22">金高公司</option> | |
| 43 | - <option value="05">杨高公司</option> | |
| 44 | - <option value="26">南汇公司</option> | |
| 45 | - <option value="55">上南公司</option> | |
| 46 | - <option value="77">闵行公司</option> | |
| 47 | - </select> | |
| 48 | - </div> --> | |
| 49 | - <div style="display: inline-block;"> | |
| 50 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 51 | - <select class="form-control" name="line" id="line" style="width: 136px;"></select> | |
| 52 | - </div> | |
| 53 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 54 | - <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 55 | - <input class="form-control" type="text" id="startDate" style="width: 120px;"/> | |
| 56 | - </div> | |
| 57 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 58 | - <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 59 | - <input class="form-control" type="text" id="endDate" style="width: 120px;"/> | |
| 60 | - </div> | |
| 61 | - <div style="display: inline-block;margin-left: 15px"> | |
| 62 | - <span class="item-label" style="width: 150px;">统计: </span> | |
| 63 | - </div> | |
| 64 | - <div class="form-group"> | |
| 65 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 66 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 67 | - </div> | |
| 68 | - </form> | |
| 69 | - </div> | |
| 70 | - <div class="portlet-body"> | |
| 71 | - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 72 | - <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 27 | + | |
| 28 | +<div class="row"> | |
| 29 | + <div class="col-md-12"> | |
| 30 | + <div class="portlet light porttlet-fit bordered"> | |
| 31 | + <div class="portlet-title"> | |
| 32 | + <form class="form-inline" action="" method="post"> | |
| 33 | + <!--<div style="display: inline-block; margin-left: 33px;" | |
| 34 | + id="gsdmDiv_operat"> | |
| 35 | + <span class="item-label" style="width: 80px;">公司: </span> <select | |
| 36 | + class="form-control" name="company" id="gsdmOperat" | |
| 37 | + style="width: 140px;"></select> | |
| 38 | + </div> | |
| 39 | + <div style="display: inline-block; margin-left: 24px;" | |
| 40 | + id="fgsdmDiv_operat"> | |
| 41 | + <span class="item-label" style="width: 80px;">分公司: </span> <select | |
| 42 | + class="form-control" name="subCompany" id="fgsdmOperat" | |
| 43 | + style="width: 140px;"></select> | |
| 44 | + </div> --> | |
| 45 | + <div style="display: inline-block;"> | |
| 46 | + <span class="item-label" style="width: 80px;">线路: </span> <select | |
| 47 | + class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 48 | + </div> | |
| 49 | + <div style="display: inline-block; margin-left: 15px;"> | |
| 50 | + <span class="item-label" style="width: 80px;">开始时间: </span> <input | |
| 51 | + class="form-control" type="text" id="startDate" | |
| 52 | + style="width: 120px;" /> | |
| 53 | + </div> | |
| 54 | + <div style="display: inline-block; margin-left: 15px;"> | |
| 55 | + <span class="item-label" style="width: 80px;">结束时间: </span> <input | |
| 56 | + class="form-control" type="text" id="endDate" | |
| 57 | + style="width: 120px;" /> | |
| 58 | + </div> | |
| 59 | + <div style="display: inline-block; margin-left: 15px"> | |
| 60 | + <span class="item-label" style="width: 150px;">统计: </span> | |
| 61 | + </div> | |
| 62 | + <div class="form-group"> | |
| 63 | + <input class="btn btn-default" type="button" id="query" value="筛选" /> | |
| 64 | + <input class="btn btn-default" type="button" id="export" | |
| 65 | + value="导出" /> | |
| 66 | + </div> | |
| 67 | + </form> | |
| 68 | + </div> | |
| 69 | + <div class="portlet-body"> | |
| 70 | + <div class="table-container" | |
| 71 | + style="margin-top: 10px; overflow: auto; min-width: 906px"> | |
| 72 | + <table class="table table-bordered table-hover table-checkable" | |
| 73 | + id="forms"> | |
| 73 | 74 | <thead> |
| 74 | 75 | <tr> |
| 75 | 76 | <th>序号</th> |
| ... | ... | @@ -78,106 +79,135 @@ |
| 78 | 79 | <th>消耗量</th> |
| 79 | 80 | <th>行驶公里(含空放里程)</th> |
| 80 | 81 | <th>空驶里程</th> |
| 81 | - <th>实际班次(包含空放把班次)</th> | |
| 82 | + <th>实际班次(包含空放班次)</th> | |
| 82 | 83 | </tr> |
| 83 | 84 | </thead> |
| 84 | 85 | <tbody> |
| 85 | - | |
| 86 | + | |
| 86 | 87 | </tbody> |
| 87 | 88 | </table> |
| 88 | - </div> | |
| 89 | - </div> | |
| 90 | - </div> | |
| 91 | - </div> | |
| 92 | -</div> | |
| 93 | - | |
| 94 | -<script> | |
| 95 | - $(function(){ | |
| 96 | - // 关闭左侧栏 | |
| 97 | - if (!$('body').hasClass('page-sidebar-closed')) | |
| 89 | + </div> | |
| 90 | + </div> | |
| 91 | + </div> | |
| 92 | + </div> | |
| 93 | +</div> | |
| 94 | + | |
| 95 | +<script> | |
| 96 | + $(function() { | |
| 97 | + // 关闭左侧栏 | |
| 98 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 98 | 99 | $('.menu-toggler.sidebar-toggler').click(); |
| 99 | - | |
| 100 | - $("#startDate,#endDate").datetimepicker({ | |
| 101 | - format : 'YYYY-MM-DD', | |
| 102 | - locale : 'zh-cn' | |
| 100 | + | |
| 101 | + $("#startDate,#endDate").datetimepicker({ | |
| 102 | + format : 'YYYY-MM-DD', | |
| 103 | + locale : 'zh-cn' | |
| 103 | 104 | }); |
| 104 | - | |
| 105 | - | |
| 106 | - $.get('/basic/lineCode2Name',function(result){ | |
| 107 | - var data=[]; | |
| 108 | - | |
| 109 | - for(var code in result){ | |
| 110 | - data.push({id: code, text: result[code]}); | |
| 105 | + | |
| 106 | + $.get('/basic/lineCode2Name', function(result) { | |
| 107 | + var data = []; | |
| 108 | + | |
| 109 | + for ( var code in result) { | |
| 110 | + data.push({ | |
| 111 | + id : code, | |
| 112 | + text : result[code] | |
| 113 | + }); | |
| 111 | 114 | } |
| 112 | - console.log(data); | |
| 113 | - initPinYinSelect2('#line',data,''); | |
| 114 | - | |
| 115 | + initPinYinSelect2('#line', data, ''); | |
| 116 | + | |
| 115 | 117 | }) |
| 116 | - | |
| 117 | - $('#lpName').select2({ | |
| 118 | - ajax: { | |
| 119 | - url: '/realSchedule/findLpName', | |
| 120 | - type: 'post', | |
| 121 | - dataType: 'json', | |
| 122 | - delay: 150, | |
| 123 | - data: function(params){ | |
| 124 | - return{lpName: params.term}; | |
| 125 | - }, | |
| 126 | - processResults: function (data) { | |
| 127 | - return { | |
| 128 | - results: data | |
| 129 | - }; | |
| 130 | - }, | |
| 131 | - cache: true | |
| 132 | - }, | |
| 133 | - templateResult: function(repo){ | |
| 134 | - if (repo.loading) return repo.text; | |
| 135 | - var h = '<span>'+repo.text+'</span>'; | |
| 136 | - return h; | |
| 137 | - }, | |
| 138 | - escapeMarkup: function (markup) { return markup; }, | |
| 139 | - minimumInputLength: 1, | |
| 140 | - templateSelection: function(repo){ | |
| 141 | - return repo.text; | |
| 142 | - }, | |
| 143 | - language: { | |
| 144 | - noResults: function(){ | |
| 145 | - return '<span style="color:red;font-size: 12px;">没有搜索到路牌!</span>'; | |
| 146 | - }, | |
| 147 | - inputTooShort : function(e) { | |
| 148 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入路牌搜索路牌</span>'; | |
| 149 | - }, | |
| 150 | - searching : function() { | |
| 151 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索路牌...</span>'; | |
| 152 | - } | |
| 153 | - } | |
| 154 | - }); | |
| 155 | - $("#query").on("click",function(){ | |
| 156 | - var line = $("#line").val(); | |
| 157 | - var startDate = $("#startDate").val(); | |
| 158 | - var endDate = $("#endDate").val(); | |
| 159 | - var lpName = $("#lpName").val(); | |
| 160 | - $post("/mcy_forms/operationservice",{line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){ | |
| 161 | - $("#sDate").text(startDate); | |
| 162 | - $("#eDate").text(endDate); | |
| 163 | - var temp = {}; | |
| 164 | - var today_account = 0; | |
| 165 | - temp["line"] = $("#line").text(); | |
| 166 | - $.each(result, function(i, obj) { | |
| 167 | - if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){ | |
| 168 | - today_account++; | |
| 169 | - } | |
| 170 | - obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); | |
| 171 | - }); | |
| 172 | - console.log(result); | |
| 173 | - var operationservice = template('operationservice',{list:result}); | |
| 174 | - // 把渲染好的模版html文本追加到表格中 | |
| 175 | - $('#forms tbody').html(operationservice); | |
| 176 | - | |
| 177 | - }); | |
| 178 | - }); | |
| 179 | - }); | |
| 180 | -</script> | |
| 118 | + | |
| 119 | + var obj = []; | |
| 120 | + $.get('/user/companyData', function(result) { | |
| 121 | + obj = result; | |
| 122 | + var options = ''; | |
| 123 | + for (var i = 0; i < obj.length; i++) { | |
| 124 | + options += '<option value="'+obj[i].companyCode+'">' | |
| 125 | + + obj[i].companyName + '</option>'; | |
| 126 | + } | |
| 127 | + | |
| 128 | + if (obj.length == 0) { | |
| 129 | + $("#gsdmDiv_operat").css('display', 'none'); | |
| 130 | + $('#fgsdmDiv_operat').css('display', 'none'); | |
| 131 | + } else if (obj.length == 1) { | |
| 132 | + $("#gsdmDiv_operat").css('display', 'none'); | |
| 133 | + if (obj[0].children.length == 1 || obj[0].children.length == 0) | |
| 134 | + $('#fgsdmDiv_operat').css('display', 'none'); | |
| 135 | + } | |
| 136 | + $('#gsdmOperat').html(options); | |
| 137 | + updateCompany(); | |
| 138 | + }); | |
| 139 | + | |
| 140 | + $("#gsdmOperat").on("change", updateCompany); | |
| 141 | + function updateCompany() { | |
| 142 | + var company = $('#gsdmOperat').val(); | |
| 143 | + var options = ''; | |
| 144 | + for (var i = 0; i < obj.length; i++) { | |
| 145 | + if (obj[i].companyCode == company) { | |
| 146 | + var children = obj[i].children; | |
| 147 | + for (var j = 0; j < children.length; j++) { | |
| 148 | + options += '<option value="'+children[j].code+'">' | |
| 149 | + + children[j].name + '</option>'; | |
| 150 | + } | |
| 151 | + } | |
| 152 | + } | |
| 153 | + $('#fgsdmOperat').html(options); | |
| 154 | + } | |
| 155 | + | |
| 156 | + $.get('/basic/lineCode2Name', function(result) { | |
| 157 | + var data = []; | |
| 158 | + | |
| 159 | + for ( var code in result) { | |
| 160 | + data.push({ | |
| 161 | + id : code, | |
| 162 | + text : result[code] | |
| 163 | + }); | |
| 164 | + } | |
| 165 | + initPinYinSelect2('#line', data, ''); | |
| 166 | + | |
| 167 | + }) | |
| 168 | + | |
| 169 | + $("#query").on( | |
| 170 | + "click", | |
| 171 | + function() { | |
| 172 | + var line = $("#line").val(); | |
| 173 | + var startDate = $("#startDate").val(); | |
| 174 | + var endDate = $("#endDate").val(); | |
| 175 | + var lpName = $("#lpName").val(); | |
| 176 | + /* var gsdmOperat = $("#gsdmOperat").val(); | |
| 177 | + var fgsdmOperat = $("#fgsdmOperat").val(); */ | |
| 178 | + $post("/mcy_forms/operationservice", { | |
| 179 | + /* gsdmOperat : gsdmOperat, | |
| 180 | + fgsdmOperat : fgsdmOperat, */ | |
| 181 | + line : line, | |
| 182 | + startDate : startDate, | |
| 183 | + endDate : endDate, | |
| 184 | + lpName : lpName, | |
| 185 | + type:'query' | |
| 186 | + }, function(result) { | |
| 187 | + $("#sDate").text(startDate); | |
| 188 | + $("#eDate").text(endDate); | |
| 189 | + var temp = {}; | |
| 190 | + var today_account = 0; | |
| 191 | + temp["line"] = $("#line").text(); | |
| 192 | + $.each(result, function(i, obj) { | |
| 193 | + if (moment(obj.schedule_date_str).format( | |
| 194 | + "YYYY-MM-DD") == moment(obj.startDate) | |
| 195 | + .format("YYYY-MM-DD")) { | |
| 196 | + today_account++; | |
| 197 | + } | |
| 198 | + obj.updateDate = moment(obj.startDate).format( | |
| 199 | + "YYYY-MM-DD HH:mm:ss"); | |
| 200 | + }); | |
| 201 | + var operationservice = template('operationservice', { | |
| 202 | + list : result | |
| 203 | + }); | |
| 204 | + // 把渲染好的模版html文本追加到表格中 | |
| 205 | + $('#forms tbody').html(operationservice); | |
| 206 | + | |
| 207 | + }); | |
| 208 | + }); | |
| 209 | + }); | |
| 210 | +</script> | |
| 181 | 211 | <script type="text/html" id="operationservice"> |
| 182 | 212 | {{each list as obj i}} |
| 183 | 213 | <tr> |
| ... | ... | @@ -192,7 +222,7 @@ |
| 192 | 222 | {{/each}} |
| 193 | 223 | {{if list.length == 0}} |
| 194 | 224 | <tr> |
| 195 | - <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> | |
| 225 | + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | |
| 196 | 226 | </tr> |
| 197 | 227 | {{/if}} |
| 198 | 228 | </script> | ... | ... |
src/main/resources/static/pages/forms/statement/shifday.html
| ... | ... | @@ -28,6 +28,14 @@ |
| 28 | 28 | <div class="portlet light porttlet-fit bordered"> |
| 29 | 29 | <div class="portlet-title"> |
| 30 | 30 | <form class="form-inline" action="" method="post"> |
| 31 | + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_shif"> | |
| 32 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 33 | + <select class="form-control" name="company" id="gsdmShif" style="width: 140px;"></select> | |
| 34 | + </div> | |
| 35 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_shif"> | |
| 36 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 37 | + <select class="form-control" name="subCompany" id="fgsdmShif" style="width: 140px;"></select> | |
| 38 | + </div> --> | |
| 31 | 39 | <div style="display: inline-block;"> |
| 32 | 40 | <span class="item-label" style="width: 80px;">线路: </span> |
| 33 | 41 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| ... | ... | @@ -97,6 +105,41 @@ $(function(){ |
| 97 | 105 | locale : 'zh-cn' |
| 98 | 106 | }); |
| 99 | 107 | |
| 108 | + var obj = []; | |
| 109 | + $.get('/user/companyData', function(result){ | |
| 110 | + obj = result; | |
| 111 | + var options = ''; | |
| 112 | + for(var i = 0; i < obj.length; i++){ | |
| 113 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 114 | + } | |
| 115 | + | |
| 116 | + if(obj.length ==0){ | |
| 117 | + $("#gsdmDiv_shif").css('display','none'); | |
| 118 | + $('#fgsdmDiv_shif').css('display','none'); | |
| 119 | + }else if(obj.length ==1){ | |
| 120 | + $("#gsdmDiv_shif").css('display','none'); | |
| 121 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 122 | + $('#fgsdmDiv_shif').css('display','none'); | |
| 123 | + } | |
| 124 | + $('#gsdmShif').html(options); | |
| 125 | + updateCompany(); | |
| 126 | + }); | |
| 127 | + | |
| 128 | + $("#gsdmShif").on("change",updateCompany); | |
| 129 | + function updateCompany(){ | |
| 130 | + var company = $('#gsdmShif').val(); | |
| 131 | + var options = ''; | |
| 132 | + for(var i = 0; i < obj.length; i++){ | |
| 133 | + if(obj[i].companyCode == company){ | |
| 134 | + var children = obj[i].children; | |
| 135 | + for(var j = 0; j < children.length; j++){ | |
| 136 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 137 | + } | |
| 138 | + } | |
| 139 | + } | |
| 140 | + $('#fgsdmShif').html(options); | |
| 141 | + } | |
| 142 | + | |
| 100 | 143 | |
| 101 | 144 | $.get('/basic/lineCode2Name',function(result){ |
| 102 | 145 | var data=[]; |
| ... | ... | @@ -104,7 +147,6 @@ $(function(){ |
| 104 | 147 | for(var code in result){ |
| 105 | 148 | data.push({id: code, text: result[code]}); |
| 106 | 149 | } |
| 107 | - console.log(data); | |
| 108 | 150 | initPinYinSelect2('#line',data,''); |
| 109 | 151 | |
| 110 | 152 | }) |
| ... | ... | @@ -112,7 +154,9 @@ $(function(){ |
| 112 | 154 | $("#query").on("click",function(){ |
| 113 | 155 | var line = $("#line").val(); |
| 114 | 156 | var date = $("#date").val(); |
| 115 | - $post('/mcy_forms/shifday',{line:line,date:date},function(result){ | |
| 157 | + /* var gsdmShif = $("#gsdmShif").val(); | |
| 158 | + var fgsdmShif = $("#fgsdmShif").val(); */ | |
| 159 | + $post('/mcy_forms/shifday',{/* gsdmShif:gsdmShif,fgsdmShif:fgsdmShif, */line:line,date:date},function(result){ | |
| 116 | 160 | $.each(result, function(i, obj) { |
| 117 | 161 | obj.requestType = reqCodeMap[obj.requestType]; |
| 118 | 162 | }); | ... | ... |