Commit 83d7ff67dfdc5d54db5fb12176f9e044e2e8df8d

Authored by 娄高锋
2 parents 904a6b63 c34ebcc1

Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into

minhang
Showing 61 changed files with 1908 additions and 1272 deletions

Too many changes to show.

To preserve performance only 61 of 656 files are displayed.

src/main/java/com/bsth/controller/BaseController2.java
... ... @@ -187,9 +187,11 @@ public class BaseController2<T, ID extends Serializable> {
187 187 }
188 188  
189 189 System.out.println(outputfile.getName());
  190 + System.out.println(outputfile.getAbsolutePath());
  191 +
190 192 String filePath = outputfile.getAbsolutePath();
191   - String fp[] = filePath.split(File.separator);
192   - String fileName = fp[fp.length - 1];
  193 +// String fp[] = filePath.split(File.separator);
  194 +// String fileName = fp[fp.length - 1];
193 195  
194 196 // TODO:使用ktr获取导出数据
195 197  
... ...
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
1 1 package com.bsth.controller.realcontrol;
2 2  
3   -import java.util.HashMap;
4   -import java.util.List;
5   -import java.util.Map;
6   -
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RestController;
9   -
10 3 import com.alibaba.fastjson.JSON;
11 4 import com.alibaba.fastjson.serializer.PropertyFilter;
12 5 import com.bsth.data.BasicData;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RestController;
  8 +
  9 +import java.util.HashMap;
  10 +import java.util.List;
  11 +import java.util.Map;
13 12  
14 13 @RestController
15 14 @RequestMapping("/basic")
... ...
src/main/java/com/bsth/controller/schedule/BController.java
1 1 package com.bsth.controller.schedule;
2 2  
  3 +import com.bsth.common.Constants;
3 4 import com.bsth.common.ResponseCode;
  5 +import com.bsth.entity.schedule.BEntity;
  6 +import com.bsth.entity.sys.SysUser;
4 7 import com.bsth.service.schedule.BService;
5 8 import com.bsth.service.schedule.ScheduleException;
  9 +import com.bsth.service.sys.SysUserService;
6 10 import com.google.common.base.Splitter;
7 11 import org.springframework.beans.factory.annotation.Autowired;
8 12 import org.springframework.data.domain.PageRequest;
9 13 import org.springframework.data.domain.Sort;
10 14 import org.springframework.web.bind.annotation.*;
11 15  
  16 +import javax.servlet.http.HttpSession;
12 17 import java.io.Serializable;
13   -import java.util.ArrayList;
14   -import java.util.HashMap;
15   -import java.util.List;
16   -import java.util.Map;
  18 +import java.util.*;
17 19  
18 20 /**
19 21 * 基础控制器。
... ... @@ -21,12 +23,24 @@ import java.util.Map;
21 23 public class BController<T, ID extends Serializable> {
22 24 @Autowired
23 25 protected BService<T, ID> bService;
  26 + @Autowired
  27 + private SysUserService sysUserService;
24 28  
25 29 // CRUD 操作
26 30 // Create操作
27 31 @RequestMapping(method = RequestMethod.POST)
28   - public Map<String, Object> save(@RequestBody T t) {
29   - T t_saved = bService.save(t);
  32 + public Map<String, Object> save(@RequestBody T t, HttpSession httpSession) {
  33 + // 判定T是否是BEntity的子类,增加新的字段
  34 + String userName = String.valueOf(httpSession.getAttribute(Constants.SESSION_USERNAME));
  35 + SysUser sysUser = sysUserService.findByUserName(userName);
  36 + BEntity t_b = null;
  37 + if (t instanceof BEntity) {
  38 + t_b = (BEntity) t;
  39 + t_b.setCreateBy(sysUser);
  40 + t_b.setCreateDate(new Date());
  41 + }
  42 +
  43 + T t_saved = bService.save(t_b == null ? t : (T) t_b);
30 44 Map<String, Object> rtn = new HashMap<>();
31 45 rtn.put("status", ResponseCode.SUCCESS);
32 46 rtn.put("data", t_saved);
... ... @@ -34,8 +48,21 @@ public class BController&lt;T, ID extends Serializable&gt; {
34 48 }
35 49 // Update操作
36 50 @RequestMapping(value="/{id}", method = RequestMethod.POST)
37   - public Map<String, Object> update(@RequestBody T t) {
38   - return save(t);
  51 + public Map<String, Object> update(@RequestBody T t, HttpSession httpSession) {
  52 + String userName = String.valueOf(httpSession.getAttribute(Constants.SESSION_USERNAME));
  53 + SysUser sysUser = sysUserService.findByUserName(userName);
  54 + BEntity t_b = null;
  55 + if (t instanceof BEntity) {
  56 + t_b = (BEntity) t;
  57 + t_b.setUpdateBy(sysUser);
  58 + t_b.setUpdateDate(new Date());
  59 + }
  60 +
  61 + T t_updated = bService.save(t_b == null ? t : (T) t_b);
  62 + Map<String, Object> rtn = new HashMap<>();
  63 + rtn.put("status", ResponseCode.SUCCESS);
  64 + rtn.put("data", t_updated);
  65 + return rtn;
39 66 }
40 67 // Research操作
41 68 @RequestMapping(value = "/{id}", method = RequestMethod.GET)
... ... @@ -97,9 +124,10 @@ public class BController&lt;T, ID extends Serializable&gt; {
97 124  
98 125 // Delete操作
99 126 @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
100   - public Map<String, Object> delete(@PathVariable("id") ID id) {
  127 + public Map<String, Object> delete(@PathVariable("id") ID id, HttpSession httpSession) {
101 128 Map<String, Object> rtn = new HashMap<>();
102 129 try {
  130 + // 由于种种原因,这里不保存用户和操作时间了
103 131 bService.delete(id);
104 132 rtn.put("status", ResponseCode.SUCCESS);
105 133 } catch (ScheduleException exp) {
... ...
src/main/java/com/bsth/controller/schedule/RerunController.java deleted 100644 → 0
1   -package com.bsth.controller.schedule;
2   -
3   -import com.bsth.controller.BaseController;
4   -import com.bsth.entity.schedule.rule.RerunRule;
5   -import com.bsth.repository.schedule.RerunRuleRepository;
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.*;
8   -
9   -import java.util.Map;
10   -
11   -/**
12   - * Created by xu on 16/10/20.
13   - */
14   -@RestController
15   -@RequestMapping("rms")
16   -public class RerunController extends BaseController<RerunRule, Long> {
17   -
18   - @Autowired
19   - private RerunRuleRepository rerunRuleRepository;
20   -
21   - @Override
22   - public RerunRule findById(@PathVariable("id") Long aLong) {
23   - return rerunRuleRepository.findOneExtend(aLong);
24   - }
25   -
26   - /**
27   - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody
28   - * @Title: save
29   - * @Description: TODO(持久化对象)
30   - * @param @param t
31   - * @param @return 设定文件
32   - * @return Map<String,Object> {status: 1(成功),-1(失败)}
33   - * @throws
34   - */
35   - @RequestMapping(method = RequestMethod.POST)
36   - public Map<String, Object> save(@RequestBody RerunRule t){
37   - return baseService.save(t);
38   - }
39   -
40   -
41   -}
src/main/java/com/bsth/controller/schedule/TTInfoController.java deleted 100644 → 0
1   -package com.bsth.controller.schedule;
2   -
3   -import com.bsth.controller.BaseController2;
4   -import com.bsth.entity.schedule.TTInfo;
5   -import com.bsth.repository.schedule.TTInfoDetailRepository;
6   -import com.bsth.repository.schedule.TTInfoRepository;
7   -import com.bsth.service.schedule.utils.DataToolsProperties;
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.boot.context.properties.EnableConfigurationProperties;
10   -import org.springframework.data.domain.Page;
11   -import org.springframework.web.bind.annotation.*;
12   -
13   -import java.util.Map;
14   -
15   -/**
16   - * Created by xu on 16/5/12.
17   - */
18   -@RestController
19   -@RequestMapping("tic")
20   -@EnableConfigurationProperties(DataToolsProperties.class)
21   -public class TTInfoController extends BaseController2<TTInfo, Long> {
22   - @Autowired
23   - private DataToolsProperties dataToolsProperties;
24   - @Autowired
25   - private TTInfoRepository ttInfoRepository;
26   - @Autowired
27   - private TTInfoDetailRepository ttInfoDetailRepository;
28   -
29   - @Override
30   - protected String getDataImportKtrClasspath() {
31   - return dataToolsProperties.getTtinfoDatainputktr();
32   - }
33   -
34   - @Override
35   - public TTInfo findById(@PathVariable("id") Long aLong) {
36   - return ttInfoRepository.findOneExtend(aLong);
37   - }
38   -
39   - /**
40   - * 验证。
41   - * @param map
42   - * @return
43   - */
44   - @RequestMapping(value = "/validate/equale", method = RequestMethod.GET)
45   - public Map<String, Object> validateData(@RequestParam Map<String, Object> map) {
46   - // 一般比较自编号是否重复
47   - return baseService.validateEquale(map);
48   - }
49   -
50   - @Override
51   - public Page<TTInfo> list(@RequestParam Map<String, Object> map, @RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "10") int size, @RequestParam(defaultValue = "id") String order, @RequestParam(defaultValue = "DESC") String direction) {
52   - // 如果有isCancel键值,将其值变成boolean
53   - if (map.get("isCancel_eq") != null)
54   - map.put("isCancel_eq", new Boolean(map.get("isCancel_eq").toString()));
55   -
56   - return super.list(map, page, size, order, direction);
57   - }
58   -}
src/main/java/com/bsth/controller/schedule/TTInfoDetailController.java
... ... @@ -113,6 +113,9 @@ public class TTInfoDetailController extends BaseController2&lt;TTInfoDetail, Long&gt;
113 113 p1.put("stationName_eq", cell_con.trim());
114 114 p1.put("stationMark_eq", "B");
115 115  
  116 +
  117 + // TODO:这里要修改(起点站有启用撤销的标志的)
  118 +
116 119 List<StationRoute> stationRouteList = (List<StationRoute>) stationRouteService.list(p1);
117 120 if (CollectionUtils.isEmpty(stationRouteList)) {
118 121 rtn.put("status", ResponseCode.ERROR);
... ...
src/main/java/com/bsth/controller/schedule/basicinfo/CarDeviceController.java 0 → 100644
  1 +package com.bsth.controller.schedule.basicinfo;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.schedule.BController;
  5 +import com.bsth.entity.CarDevice;
  6 +import com.bsth.service.schedule.CarDeviceService;
  7 +import com.bsth.service.schedule.ScheduleException;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import java.util.HashMap;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * Created by xu on 16/12/15.
  19 + */
  20 +@RestController(value = "carDeviceController_sc")
  21 +@RequestMapping("cde_sc")
  22 +public class CarDeviceController extends BController<CarDevice, Long> {
  23 + @Autowired
  24 + private CarDeviceService carDeviceService;
  25 +
  26 + @RequestMapping(value = "/validate_qyrq", method = RequestMethod.GET)
  27 + public Map<String, Object> validate_qyrq(@RequestParam Map<String, Object> param) {
  28 + Map<String, Object> rtn = new HashMap<>();
  29 +
  30 + try {
  31 + // 启用日期验证
  32 + CarDevice carDevice = new CarDevice(
  33 + param.get("id_eq"),
  34 + param.get("xl_eq"),
  35 + param.get("cl_eq"),
  36 + param.get("qyrq_eq")
  37 + );
  38 + carDeviceService.validate_qyrq(carDevice);
  39 + rtn.put("status", ResponseCode.SUCCESS);
  40 + } catch (ScheduleException exp) {
  41 + rtn.put("status", ResponseCode.ERROR);
  42 + rtn.put("msg", exp.getMessage());
  43 + }
  44 +
  45 + return rtn;
  46 + }
  47 +
  48 +}
... ...
src/main/java/com/bsth/controller/schedule/basicinfo/EmployeeController.java 0 → 100644
  1 +package com.bsth.controller.schedule.basicinfo;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.schedule.BController;
  5 +import com.bsth.entity.Personnel;
  6 +import com.bsth.service.schedule.EmployeeService;
  7 +import com.bsth.service.schedule.ScheduleException;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import java.util.HashMap;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * 人员基础信息Controller
  19 + */
  20 +@RestController
  21 +@RequestMapping("ee")
  22 +public class EmployeeController extends BController<Personnel, Integer> {
  23 + @Autowired
  24 + private EmployeeService employeeService;
  25 +
  26 + @RequestMapping(value = "/validate_gh", method = RequestMethod.GET)
  27 + public Map<String, Object> validate_gh(@RequestParam Map<String, Object> param) {
  28 + Map<String, Object> rtn = new HashMap<>();
  29 + try {
  30 + // 工号验证
  31 + Personnel personnel = new Personnel(
  32 + param.get("id_eq"),
  33 + param.get("companyCode_eq"),
  34 + param.get("jobCode_eq")
  35 + );
  36 + employeeService.validate_gh(personnel);
  37 + rtn.put("status", ResponseCode.SUCCESS);
  38 + } catch (ScheduleException exp) {
  39 + rtn.put("status", ResponseCode.ERROR);
  40 + rtn.put("msg", exp.getMessage());
  41 + }
  42 +
  43 + return rtn;
  44 + }
  45 +}
... ...
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java
... ... @@ -48,8 +48,8 @@ public class GuideboardInfoController extends BController&lt;GuideboardInfo, Long&gt;
48 48 return guideboardInfoRepository.findLpName(ttid);
49 49 }
50 50  
51   - @RequestMapping(value = "/validate1", method = RequestMethod.GET)
52   - public Map<String, Object> validate1(@RequestParam Map<String, Object> param) {
  51 + @RequestMapping(value = "/validate_lpno", method = RequestMethod.GET)
  52 + public Map<String, Object> validate_lpno(@RequestParam Map<String, Object> param) {
53 53 Map<String, Object> rtn = new HashMap<>();
54 54 try {
55 55 // 路牌编号验证
... ... @@ -59,7 +59,7 @@ public class GuideboardInfoController extends BController&lt;GuideboardInfo, Long&gt;
59 59 param.get("lpNo_eq"),
60 60 null
61 61 );
62   - guideboardInfoService.validate(guideboardInfo);
  62 + guideboardInfoService.validate_lpno(guideboardInfo);
63 63 rtn.put("status", ResponseCode.SUCCESS);
64 64 } catch (ScheduleException exp) {
65 65 rtn.put("status", ResponseCode.ERROR);
... ... @@ -68,8 +68,8 @@ public class GuideboardInfoController extends BController&lt;GuideboardInfo, Long&gt;
68 68 return rtn;
69 69 }
70 70  
71   - @RequestMapping(value = "/validate2", method = RequestMethod.GET)
72   - public Map<String, Object> validate2(@RequestParam Map<String, Object> param) {
  71 + @RequestMapping(value = "/validate_lpname", method = RequestMethod.GET)
  72 + public Map<String, Object> validate_lpname(@RequestParam Map<String, Object> param) {
73 73 Map<String, Object> rtn = new HashMap<>();
74 74 try {
75 75 // 路牌名称验证
... ... @@ -79,7 +79,7 @@ public class GuideboardInfoController extends BController&lt;GuideboardInfo, Long&gt;
79 79 null,
80 80 param.get("lpName_eq")
81 81 );
82   - guideboardInfoService.validate(guideboardInfo);
  82 + guideboardInfoService.validate_lpname(guideboardInfo);
83 83 rtn.put("status", ResponseCode.SUCCESS);
84 84 } catch (ScheduleException exp) {
85 85 rtn.put("status", ResponseCode.ERROR);
... ...
src/main/java/com/bsth/controller/schedule/core/RerunController.java 0 → 100644
  1 +package com.bsth.controller.schedule.core;
  2 +
  3 +import com.bsth.controller.schedule.BController;
  4 +import com.bsth.entity.schedule.rule.RerunRule;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RestController;
  7 +
  8 +/**
  9 + * Created by xu on 16/10/20.
  10 + */
  11 +@RestController
  12 +@RequestMapping("rms")
  13 +public class RerunController extends BController<RerunRule, Long> {
  14 +
  15 +
  16 +}
... ...
src/main/java/com/bsth/controller/schedule/core/TTInfoController.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.TTInfo;
  6 +import com.bsth.service.schedule.ScheduleException;
  7 +import com.bsth.service.schedule.TTInfoService;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import java.util.HashMap;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * Created by xu on 16/12/20.
  19 + */
  20 +@RestController(value = "tTInfoController_ec")
  21 +@RequestMapping(value = "tic_ec")
  22 +public class TTInfoController extends BController<TTInfo, Long> {
  23 + @Autowired
  24 + private TTInfoService ttInfoService;
  25 +
  26 + @RequestMapping(value = "/validate_name", method = RequestMethod.GET)
  27 + public Map<String, Object> validate_name(@RequestParam Map<String, Object> param) {
  28 + Map<String, Object> rtn = new HashMap<>();
  29 + try {
  30 + // 名字重复验证
  31 + TTInfo ttInfo = new TTInfo(
  32 + param.get("id_eq"),
  33 + param.get("xl.id_eq"),
  34 + param.get("name_eq"),
  35 + param.get("rule_days_eq"),
  36 + param.get("special_days_eq")
  37 + );
  38 + ttInfoService.validate_name(ttInfo);
  39 + rtn.put("status", ResponseCode.SUCCESS);
  40 + } catch (ScheduleException exp) {
  41 + rtn.put("status", ResponseCode.ERROR);
  42 + rtn.put("msg", exp.getMessage());
  43 + }
  44 +
  45 + return rtn;
  46 + }
  47 +
  48 + @RequestMapping(value = "/validate_n_d", method = RequestMethod.GET)
  49 + public Map<String, Object> validate_n_d(@RequestParam Map<String, Object> param) {
  50 + Map<String, Object> rtn = new HashMap<>();
  51 + try {
  52 + // 常规有效日重复验证
  53 + TTInfo ttInfo = new TTInfo(
  54 + param.get("id_eq"),
  55 + param.get("xl.id_eq"),
  56 + param.get("name_eq"),
  57 + param.get("rule_days_eq"),
  58 + param.get("special_days_eq")
  59 + );
  60 + ttInfoService.validate_n_d(ttInfo);
  61 + rtn.put("status", ResponseCode.SUCCESS);
  62 + } catch (ScheduleException exp) {
  63 + rtn.put("status", ResponseCode.ERROR);
  64 + rtn.put("msg", exp.getMessage());
  65 + }
  66 + return rtn;
  67 + }
  68 +
  69 + @RequestMapping(value = "/validate_s_d", method = RequestMethod.GET)
  70 + public Map<String, Object> validate_s_d(@RequestParam Map<String, Object> param) {
  71 + Map<String, Object> rtn = new HashMap<>();
  72 + try {
  73 + // 特殊有效日重复判定
  74 + TTInfo ttInfo = new TTInfo(
  75 + param.get("id_eq"),
  76 + param.get("xl.id_eq"),
  77 + param.get("name_eq"),
  78 + param.get("rule_days_eq"),
  79 + param.get("special_days_eq")
  80 + );
  81 + ttInfoService.validate_s_d(ttInfo);
  82 + rtn.put("status", ResponseCode.SUCCESS);
  83 + } catch (ScheduleException exp) {
  84 + rtn.put("status", ResponseCode.ERROR);
  85 + rtn.put("msg", exp.getMessage());
  86 + }
  87 + return rtn;
  88 + }
  89 +
  90 +}
  91 +
  92 +//
  93 +//@Autowired
  94 +//private DataToolsProperties dataToolsProperties;
  95 +//@Autowired
  96 +//private TTInfoRepository ttInfoRepository;
  97 +//@Autowired
  98 +//private TTInfoDetailRepository ttInfoDetailRepository;
  99 +//
  100 +// @Override
  101 +// protected String getDataImportKtrClasspath() {
  102 +// return dataToolsProperties.getTtinfoDatainputktr();
  103 +// }
  104 +//
  105 +// @Override
  106 +// public TTInfo findById(@PathVariable("id") Long aLong) {
  107 +// return ttInfoRepository.findOneExtend(aLong);
  108 +// }
  109 +//
  110 +// /**
  111 +// * 验证。
  112 +// * @param map
  113 +// * @return
  114 +// */
  115 +// @RequestMapping(value = "/validate/equale", method = RequestMethod.GET)
  116 +// public Map<String, Object> validateData(@RequestParam Map<String, Object> map) {
  117 +// // 一般比较自编号是否重复
  118 +// return baseService.validateEquale(map);
  119 +// }
  120 +//
  121 +// @Override
  122 +// public Page<TTInfo> list(@RequestParam Map<String, Object> map, @RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "10") int size, @RequestParam(defaultValue = "id") String order, @RequestParam(defaultValue = "DESC") String direction) {
  123 +// // 如果有isCancel键值,将其值变成boolean
  124 +// if (map.get("isCancel_eq") != null)
  125 +// map.put("isCancel_eq", new Boolean(map.get("isCancel_eq").toString()));
  126 +//
  127 +// return super.list(map, page, size, order, direction);
  128 +// }
0 129 \ No newline at end of file
... ...
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/CarDevice.java
1 1 package com.bsth.entity;
2 2  
3   -import com.bsth.entity.sys.SysUser;
  3 +import com.bsth.entity.schedule.BEntity;
  4 +import org.joda.time.DateTime;
4 5  
5 6 import javax.persistence.*;
6 7 import java.util.Date;
... ... @@ -10,7 +11,7 @@ import java.util.Date;
10 11 */
11 12 @Entity
12 13 @Table(name = "bsth_c_car_device")
13   -public class CarDevice {
  14 +public class CarDevice extends BEntity {
14 15  
15 16 /** 主键 */
16 17 @Id
... ... @@ -62,18 +63,26 @@ public class CarDevice {
62 63 @Column(nullable = false)
63 64 private Boolean isCancel = false;
64 65  
65   - /** 创建人 */
66   - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
67   - private SysUser createBy;
68   - /** 修改人 */
69   - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
70   - private SysUser updateBy;
71   - /** 创建日期 */
72   - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
73   - private Date createDate;
74   - /** 修改日期 */
75   - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
76   - private Date updateDate;
  66 + public CarDevice() {}
  67 + public CarDevice(Object id, Object xlid, Object clid, Object qyrq) {
  68 + if (id != null) {
  69 + this.id = Long.valueOf(id.toString());
  70 + }
  71 + if (xlid != null) {
  72 + this.xl = Integer.valueOf(xlid.toString());
  73 + }
  74 + if (clid != null) {
  75 + this.cl = Integer.valueOf(clid.toString());
  76 + }
  77 + if (qyrq != null) {
  78 + try {
  79 + this.qyrq = new Date();
  80 + this.qyrq.setTime(Long.parseLong(qyrq.toString()));
  81 + } catch (Exception exp) {
  82 + this.qyrq = new DateTime(qyrq.toString()).toDate();
  83 + }
  84 + }
  85 + }
77 86  
78 87 public Long getId() {
79 88 return id;
... ... @@ -179,38 +188,6 @@ public class CarDevice {
179 188 this.guaranteeDesc = guaranteeDesc;
180 189 }
181 190  
182   - public SysUser getCreateBy() {
183   - return createBy;
184   - }
185   -
186   - public void setCreateBy(SysUser createBy) {
187   - this.createBy = createBy;
188   - }
189   -
190   - public SysUser getUpdateBy() {
191   - return updateBy;
192   - }
193   -
194   - public void setUpdateBy(SysUser updateBy) {
195   - this.updateBy = updateBy;
196   - }
197   -
198   - public Date getCreateDate() {
199   - return createDate;
200   - }
201   -
202   - public void setCreateDate(Date createDate) {
203   - this.createDate = createDate;
204   - }
205   -
206   - public Date getUpdateDate() {
207   - return updateDate;
208   - }
209   -
210   - public void setUpdateDate(Date updateDate) {
211   - this.updateDate = updateDate;
212   - }
213   -
214 191 public Date getQyrq() {
215 192 return qyrq;
216 193 }
... ...
src/main/java/com/bsth/entity/Cars.java
1 1 package com.bsth.entity;
2 2  
3   -import com.bsth.entity.sys.SysUser;
  3 +import com.bsth.entity.schedule.BEntity;
4 4 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5 5  
6 6 import javax.persistence.*;
... ... @@ -24,7 +24,7 @@ import java.util.Date;
24 24 @Entity
25 25 @Table(name = "bsth_c_cars")
26 26 @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
27   -public class Cars implements Serializable {
  27 +public class Cars extends BEntity implements Serializable {
28 28  
29 29 /** 主键Id */
30 30 @Id
... ... @@ -136,23 +136,6 @@ public class Cars implements Serializable {
136 136 /** 线路名称(TODO:在原系统里没有,这里暂时留着,并且不做线路关联,只保留个名字) */
137 137 private String xlmc;
138 138  
139   -
140   - /** 创建人 */
141   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
142   - private SysUser createBy;
143   -
144   - /** 修改人 */
145   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
146   - private SysUser updateBy;
147   -
148   - /** 创建日期 */
149   - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
150   - private Date createDate;
151   -
152   - /** 修改日期 */
153   - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
154   - private Date updateDate;
155   -
156 139 public Cars() {}
157 140  
158 141 public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) {
... ... @@ -516,36 +499,4 @@ public class Cars implements Serializable {
516 499 public void setXlmc(String xlmc) {
517 500 this.xlmc = xlmc;
518 501 }
519   -
520   - public SysUser getCreateBy() {
521   - return createBy;
522   - }
523   -
524   - public void setCreateBy(SysUser createBy) {
525   - this.createBy = createBy;
526   - }
527   -
528   - public SysUser getUpdateBy() {
529   - return updateBy;
530   - }
531   -
532   - public void setUpdateBy(SysUser updateBy) {
533   - this.updateBy = updateBy;
534   - }
535   -
536   - public Date getCreateDate() {
537   - return createDate;
538   - }
539   -
540   - public void setCreateDate(Date createDate) {
541   - this.createDate = createDate;
542   - }
543   -
544   - public Date getUpdateDate() {
545   - return updateDate;
546   - }
547   -
548   - public void setUpdateDate(Date updateDate) {
549   - this.updateDate = updateDate;
550   - }
551 502 }
... ...
src/main/java/com/bsth/entity/Personnel.java
1 1 package com.bsth.entity;
2 2  
3   -import com.bsth.entity.sys.SysUser;
  3 +import com.bsth.entity.schedule.BEntity;
4 4 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5 5  
6 6 import javax.persistence.*;
7   -import java.util.Date;
8 7  
9 8 /**
10 9 *
... ... @@ -23,7 +22,7 @@ import java.util.Date;
23 22 @Entity
24 23 @Table(name = "bsth_c_personnel")
25 24 @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
26   -public class Personnel {
  25 +public class Personnel extends BEntity {
27 26  
28 27 /** 主键Id */
29 28 @Id
... ... @@ -59,6 +58,20 @@ public class Personnel {
59 58 /** 身份证 */
60 59 private String card;
61 60  
  61 + public Personnel() {}
  62 +
  63 + public Personnel(Object id, Object companyCode, Object gh) {
  64 + if (id != null) {
  65 + this.id = Integer.valueOf(id.toString());
  66 + }
  67 + if (companyCode != null) {
  68 + this.companyCode = companyCode.toString();
  69 + }
  70 + if (gh != null) {
  71 + this.jobCode = gh.toString();
  72 + }
  73 + }
  74 +
62 75 public String getCard() {
63 76 return card;
64 77 }
... ... @@ -78,23 +91,6 @@ public class Personnel {
78 91 /** 描述(TODO:在原系统里没有,这里暂时留着) */
79 92 private String descriptions;
80 93  
81   -
82   -
83   - /** 创建人 */
84   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
85   - private SysUser createBy;
86   - /** 修改人 */
87   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
88   - private SysUser updateBy;
89   -
90   - /** 创建日期 */
91   - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
92   - private Date createDate;
93   -
94   - /** 修改日期 */
95   - @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
96   - private Date updateDate;
97   -
98 94 public Integer getId() {
99 95 return id;
100 96 }
... ... @@ -222,36 +218,4 @@ public class Personnel {
222 218 public void setDescriptions(String descriptions) {
223 219 this.descriptions = descriptions;
224 220 }
225   -
226   - public SysUser getCreateBy() {
227   - return createBy;
228   - }
229   -
230   - public void setCreateBy(SysUser createBy) {
231   - this.createBy = createBy;
232   - }
233   -
234   - public SysUser getUpdateBy() {
235   - return updateBy;
236   - }
237   -
238   - public void setUpdateBy(SysUser updateBy) {
239   - this.updateBy = updateBy;
240   - }
241   -
242   - public Date getCreateDate() {
243   - return createDate;
244   - }
245   -
246   - public void setCreateDate(Date createDate) {
247   - this.createDate = createDate;
248   - }
249   -
250   - public Date getUpdateDate() {
251   - return updateDate;
252   - }
253   -
254   - public void setUpdateDate(Date updateDate) {
255   - this.updateDate = updateDate;
256   - }
257 221 }
... ...
src/main/java/com/bsth/entity/mcy_forms/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/ChildTaskPlan.java
1 1 package com.bsth.entity.realcontrol;
2 2  
3   -import javax.persistence.Entity;
4   -import javax.persistence.FetchType;
5   -import javax.persistence.GeneratedValue;
6   -import javax.persistence.Id;
7   -import javax.persistence.ManyToOne;
8   -import javax.persistence.NamedAttributeNode;
9   -import javax.persistence.NamedEntityGraph;
10   -import javax.persistence.NamedEntityGraphs;
11   -import javax.persistence.Table;
12   -
13 3 import com.fasterxml.jackson.annotation.JsonIgnore;
14 4  
  5 +import javax.persistence.*;
  6 +import java.util.Date;
  7 +
15 8  
16 9 /**
17 10 *
... ... @@ -95,6 +88,10 @@ public class ChildTaskPlan {
95 88 */
96 89 private String destroyReason;
97 90  
  91 + /** 创建日期 */
  92 + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  93 + private Date createDate;
  94 +
98 95 /**
99 96 * 主排班计划
100 97 */
... ... @@ -233,4 +230,12 @@ public class ChildTaskPlan {
233 230 public boolean equals(Object obj) {
234 231 return this.id.equals(((ChildTaskPlan)obj).getId());
235 232 }
  233 +
  234 + public Date getCreateDate() {
  235 + return createDate;
  236 + }
  237 +
  238 + public void setCreateDate(Date createDate) {
  239 + this.createDate = createDate;
  240 + }
236 241 }
... ...
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,6 @@ 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;
6 5 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
7 6  
8 7 import javax.persistence.*;
... ... @@ -21,7 +20,7 @@ import java.util.Date;
21 20 })
22 21 })
23 22 @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
24   -public class CarConfigInfo implements Serializable {
  23 +public class CarConfigInfo extends BEntity implements Serializable {
25 24  
26 25 /** 主健Id */
27 26 @Id
... ... @@ -59,20 +58,6 @@ public class CarConfigInfo implements Serializable {
59 58 @Column(nullable = false)
60 59 private Boolean isCancel = false;
61 60  
62   - /** 创建人 */
63   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
64   - private SysUser createBy;
65   - /** 修改人 */
66   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
67   - private SysUser updateBy;
68   -
69   - /** 创建日期 */
70   - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
71   - private Date createDate;
72   - /** 修改日期 */
73   - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
74   - private Date updateDate;
75   -
76 61 public CarConfigInfo() {}
77 62 public CarConfigInfo(Object id, Object xlid, Object xlname, Object clid) {
78 63 if (id != null) {
... ... @@ -164,38 +149,6 @@ public class CarConfigInfo implements Serializable {
164 149 this.isSwitch = isSwitch;
165 150 }
166 151  
167   - public SysUser getCreateBy() {
168   - return createBy;
169   - }
170   -
171   - public void setCreateBy(SysUser createBy) {
172   - this.createBy = createBy;
173   - }
174   -
175   - public SysUser getUpdateBy() {
176   - return updateBy;
177   - }
178   -
179   - public void setUpdateBy(SysUser updateBy) {
180   - this.updateBy = updateBy;
181   - }
182   -
183   - public Date getCreateDate() {
184   - return createDate;
185   - }
186   -
187   - public void setCreateDate(Date createDate) {
188   - this.createDate = createDate;
189   - }
190   -
191   - public Date getUpdateDate() {
192   - return updateDate;
193   - }
194   -
195   - public void setUpdateDate(Date updateDate) {
196   - this.updateDate = updateDate;
197   - }
198   -
199 152 public Boolean getIsCancel() {
200 153 return isCancel;
201 154 }
... ...
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
... ... @@ -3,13 +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;
7 6 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
8 7 import org.hibernate.annotations.Formula;
9 8  
10 9 import javax.persistence.*;
11 10 import javax.validation.constraints.NotNull;
12   -import java.util.Date;
  11 +import java.io.Serializable;
13 12  
14 13 /**
15 14 * 人员配置信息。
... ... @@ -24,7 +23,7 @@ import java.util.Date;
24 23 })
25 24 })
26 25 @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
27   -public class EmployeeConfigInfo {
  26 +public class EmployeeConfigInfo extends BEntity implements Serializable {
28 27  
29 28 /** 主键Id */
30 29 @Id
... ... @@ -55,20 +54,6 @@ public class EmployeeConfigInfo {
55 54 @Column(nullable = false)
56 55 private Boolean isCancel = false;
57 56  
58   - /** 创建人 */
59   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
60   - private SysUser createBy;
61   - /** 修改人 */
62   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
63   - private SysUser updateBy;
64   -
65   - /** 创建日期 */
66   - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
67   - private Date createDate;
68   - /** 修改日期 */
69   - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
70   - private Date updateDate;
71   -
72 57 public EmployeeConfigInfo() {}
73 58  
74 59 public EmployeeConfigInfo(Object id, Object xlid, Object xlname, Object jsyid, Object spyid) {
... ... @@ -156,36 +141,4 @@ public class EmployeeConfigInfo {
156 141 public void setIsCancel(Boolean isCancel) {
157 142 this.isCancel = isCancel;
158 143 }
159   -
160   - public SysUser getCreateBy() {
161   - return createBy;
162   - }
163   -
164   - public void setCreateBy(SysUser createBy) {
165   - this.createBy = createBy;
166   - }
167   -
168   - public SysUser getUpdateBy() {
169   - return updateBy;
170   - }
171   -
172   - public void setUpdateBy(SysUser updateBy) {
173   - this.updateBy = updateBy;
174   - }
175   -
176   - public Date getCreateDate() {
177   - return createDate;
178   - }
179   -
180   - public void setCreateDate(Date createDate) {
181   - this.createDate = createDate;
182   - }
183   -
184   - public Date getUpdateDate() {
185   - return updateDate;
186   - }
187   -
188   - public void setUpdateDate(Date updateDate) {
189   - this.updateDate = updateDate;
190   - }
191 144 }
... ...
src/main/java/com/bsth/entity/schedule/GuideboardInfo.java
1 1 package com.bsth.entity.schedule;
2 2  
3 3 import com.bsth.entity.Line;
4   -import com.bsth.entity.sys.SysUser;
5 4 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
6 5  
7 6 import javax.persistence.*;
8   -import java.util.Date;
9 7  
10 8 /**
11 9 * 路牌信息。
... ... @@ -18,7 +16,7 @@ import java.util.Date;
18 16 })
19 17 })
20 18 @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
21   -public class GuideboardInfo {
  19 +public class GuideboardInfo extends BEntity {
22 20  
23 21 /** 主键Id */
24 22 @Id
... ... @@ -43,21 +41,6 @@ public class GuideboardInfo {
43 41 @Column(nullable = false)
44 42 private Boolean isCancel = false;
45 43  
46   - /** 创建人 */
47   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
48   - private SysUser createBy;
49   - /** 修改人 */
50   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
51   - private SysUser updateBy;
52   -
53   - /** 创建日期 */
54   - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
55   - private Date createDate;
56   - /** 修改日期 */
57   - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
58   - private Date updateDate;
59   -
60   -
61 44 public GuideboardInfo() {}
62 45  
63 46 public GuideboardInfo(Object id, Object xlid, Object lpNo, Object lpName) {
... ... @@ -126,38 +109,6 @@ public class GuideboardInfo {
126 109 this.lpType = lpType;
127 110 }
128 111  
129   - public SysUser getCreateBy() {
130   - return createBy;
131   - }
132   -
133   - public void setCreateBy(SysUser createBy) {
134   - this.createBy = createBy;
135   - }
136   -
137   - public SysUser getUpdateBy() {
138   - return updateBy;
139   - }
140   -
141   - public void setUpdateBy(SysUser updateBy) {
142   - this.updateBy = updateBy;
143   - }
144   -
145   - public Date getCreateDate() {
146   - return createDate;
147   - }
148   -
149   - public void setCreateDate(Date createDate) {
150   - this.createDate = createDate;
151   - }
152   -
153   - public Date getUpdateDate() {
154   - return updateDate;
155   - }
156   -
157   - public void setUpdateDate(Date updateDate) {
158   - this.updateDate = updateDate;
159   - }
160   -
161 112 public Boolean getIsCancel() {
162 113 return isCancel;
163 114 }
... ...
src/main/java/com/bsth/entity/schedule/TTInfo.java
1 1 package com.bsth.entity.schedule;
2 2  
3 3 import com.bsth.entity.Line;
4   -import com.bsth.entity.sys.SysUser;
5 4  
6 5 import javax.persistence.*;
7 6 import java.util.Date;
... ... @@ -18,7 +17,7 @@ import java.util.Date;
18 17 @NamedAttributeNode("updateBy")
19 18 })
20 19 })
21   -public class TTInfo {
  20 +public class TTInfo extends BEntity {
22 21  
23 22 /** 主键Id */
24 23 @Id
... ... @@ -50,9 +49,9 @@ public class TTInfo {
50 49  
51 50 // TODO:还有很多判定条件,这里先不放
52 51  
53   - /** 路牌数 */
  52 + /** 路牌数(这两个字段暂时不用) */
54 53 private int lpCount;
55   - /** 圈数 */
  54 + /** 圈数(这两个字段暂时不倒) */
56 55 private int loopCount;
57 56  
58 57 // TODO:原系统里的分别在,圈后圈进场,意思不知道,再议
... ... @@ -62,19 +61,25 @@ public class TTInfo {
62 61 /** 特殊有效日期(格式:2001-01-01,多个用逗号隔开) */
63 62 private String special_days;
64 63  
65   - /** 操作人员关联 */
66   - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
67   - private SysUser createBy;
68   - /** 更新人员关联 */
69   - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
70   - private SysUser updateBy;
71   - // 创建日期
72   - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
73   - private Date createDate;
74   - // 修改日期
75   - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
76   - private Date updateDate;
77   -
  64 + public TTInfo() {}
  65 + public TTInfo(Object id, Object xlid, Object name, Object nds, Object sds) {
  66 + if (id != null) {
  67 + this.id = Long.parseLong(id.toString());
  68 + }
  69 + if (xlid != null) {
  70 + this.xl = new Line();
  71 + this.xl.setId(Integer.valueOf(xlid.toString()));
  72 + }
  73 + if (name != null) {
  74 + this.name = String.valueOf(name);
  75 + }
  76 + if (nds != null) {
  77 + this.rule_days = String.valueOf(nds);
  78 + }
  79 + if (sds != null) {
  80 + this.special_days = String.valueOf(sds);
  81 + }
  82 + }
78 83  
79 84 public Long getId() {
80 85 return id;
... ... @@ -164,38 +169,6 @@ public class TTInfo {
164 169 this.special_days = special_days;
165 170 }
166 171  
167   - public SysUser getCreateBy() {
168   - return createBy;
169   - }
170   -
171   - public void setCreateBy(SysUser createBy) {
172   - this.createBy = createBy;
173   - }
174   -
175   - public SysUser getUpdateBy() {
176   - return updateBy;
177   - }
178   -
179   - public void setUpdateBy(SysUser updateBy) {
180   - this.updateBy = updateBy;
181   - }
182   -
183   - public Date getCreateDate() {
184   - return createDate;
185   - }
186   -
187   - public void setCreateDate(Date createDate) {
188   - this.createDate = createDate;
189   - }
190   -
191   - public Date getUpdateDate() {
192   - return updateDate;
193   - }
194   -
195   - public void setUpdateDate(Date updateDate) {
196   - this.updateDate = updateDate;
197   - }
198   -
199 172 public Boolean getIsCancel() {
200 173 return isCancel;
201 174 }
... ...
src/main/java/com/bsth/entity/schedule/TTInfoDetail.java
... ... @@ -3,10 +3,8 @@ package com.bsth.entity.schedule;
3 3 import com.bsth.entity.CarPark;
4 4 import com.bsth.entity.Line;
5 5 import com.bsth.entity.Station;
6   -import com.bsth.entity.sys.SysUser;
7 6  
8 7 import javax.persistence.*;
9   -import java.util.Date;
10 8  
11 9 /**
12 10 * 时刻表明细
... ... @@ -23,7 +21,7 @@ import java.util.Date;
23 21 @NamedAttributeNode("tcc")
24 22 })
25 23 })
26   -public class TTInfoDetail {
  24 +public class TTInfoDetail extends BEntity {
27 25  
28 26 /** 主健Id */
29 27 @Id
... ... @@ -85,20 +83,6 @@ public class TTInfoDetail {
85 83 /** 备注 */
86 84 private String remark;
87 85  
88   - /** 创建人 */
89   - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
90   - private SysUser createBy;
91   - /** 修改人 */
92   - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
93   - private SysUser updateBy;
94   -
95   - /** 创建日期 */
96   - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
97   - private Date createDate;
98   - /** 修改日期 */
99   - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
100   - private Date updateDate;
101   -
102 86 public Long getId() {
103 87 return id;
104 88 }
... ... @@ -235,38 +219,6 @@ public class TTInfoDetail {
235 219 this.remark = remark;
236 220 }
237 221  
238   - public SysUser getCreateBy() {
239   - return createBy;
240   - }
241   -
242   - public void setCreateBy(SysUser createBy) {
243   - this.createBy = createBy;
244   - }
245   -
246   - public SysUser getUpdateBy() {
247   - return updateBy;
248   - }
249   -
250   - public void setUpdateBy(SysUser updateBy) {
251   - this.updateBy = updateBy;
252   - }
253   -
254   - public Date getCreateDate() {
255   - return createDate;
256   - }
257   -
258   - public void setCreateDate(Date createDate) {
259   - this.createDate = createDate;
260   - }
261   -
262   - public Date getUpdateDate() {
263   - return updateDate;
264   - }
265   -
266   - public void setUpdateDate(Date updateDate) {
267   - this.updateDate = updateDate;
268   - }
269   -
270 222 public CarPark getTcc() {
271 223 return tcc;
272 224 }
... ...
src/main/java/com/bsth/entity/schedule/rule/RerunRule.java
1 1 package com.bsth.entity.schedule.rule;
2 2  
3 3 import com.bsth.entity.Line;
4   -import com.bsth.entity.schedule.CarConfigInfo;
5   -import com.bsth.entity.schedule.EmployeeConfigInfo;
6   -import com.bsth.entity.schedule.GuideboardInfo;
7   -import com.bsth.entity.schedule.TTInfo;
8   -import com.bsth.entity.sys.SysUser;
  4 +import com.bsth.entity.schedule.*;
9 5  
10 6 import javax.persistence.*;
11   -import java.util.Date;
12 7  
13 8 /**
14 9 * 套跑规则。
... ... @@ -41,7 +36,7 @@ import java.util.Date;
41 36 })
42 37  
43 38  
44   -public class RerunRule {
  39 +public class RerunRule extends BEntity {
45 40 /** 主键Id */
46 41 @Id
47 42 @GeneratedValue
... ... @@ -84,19 +79,6 @@ public class RerunRule {
84 79 @Column(nullable = false)
85 80 private Boolean isCancel = false;
86 81  
87   - /** 创建人 */
88   - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
89   - private SysUser createBy;
90   - /** 修改人 */
91   - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
92   - private SysUser updateBy;
93   - /** 创建日期 */
94   - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
95   - private Date createDate;
96   - /** 修改日期 */
97   - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
98   - private Date updateDate;
99   -
100 82 public Long getId() {
101 83 return id;
102 84 }
... ... @@ -177,34 +159,6 @@ public class RerunRule {
177 159 this.useEmployeeConfig = useEmployeeConfig;
178 160 }
179 161  
180   - public SysUser getCreateBy() {
181   - return createBy;
182   - }
183   -
184   - public void setCreateBy(SysUser createBy) {
185   - this.createBy = createBy;
186   - }
187   -
188   - public SysUser getUpdateBy() {
189   - return updateBy;
190   - }
191   -
192   - public void setUpdateBy(SysUser updateBy) {
193   - this.updateBy = updateBy;
194   - }
195   -
196   - public Date getCreateDate() {
197   - return createDate;
198   - }
199   -
200   - public void setCreateDate(Date createDate) {
201   - this.createDate = createDate;
202   - }
203   -
204   - public Date getUpdateDate() {
205   - return updateDate;
206   - }
207   -
208 162 public Boolean getIsCancel() {
209 163 return isCancel;
210 164 }
... ... @@ -213,7 +167,4 @@ public class RerunRule {
213 167 this.isCancel = isCancel;
214 168 }
215 169  
216   - public void setUpdateDate(Date updateDate) {
217   - this.updateDate = updateDate;
218   - }
219 170 }
... ...
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
1 1 package com.bsth.repository.realcontrol;
2 2  
3   -import java.util.List;
4   -import java.util.Map;
5   -
6   -import javax.transaction.Transactional;
7   -
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +import com.bsth.repository.BaseRepository;
8 5 import org.springframework.data.jpa.repository.EntityGraph;
9 6 import org.springframework.data.jpa.repository.Modifying;
10 7 import org.springframework.data.jpa.repository.Query;
11 8 import org.springframework.stereotype.Repository;
12 9  
13   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
14   -import com.bsth.repository.BaseRepository;
  10 +import javax.transaction.Transactional;
  11 +import java.util.List;
  12 +import java.util.Map;
15 13  
16 14 @Repository
17 15 public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealInfo, Long>{
... ... @@ -35,11 +33,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
35 33 + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName")
36 34 List<Map<String, Object>> dailyInfo(String line,String date);
37 35  
38   - @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,d.sender,d.timestamp,"
39   - + " d.txt_content FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 "
40   - + "d ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND "
41   - + " DATE_FORMAT(r.schedule_date,'%Y-%m-%d') = ?2 and r.cl_zbh like %?3% order by d.timestamp",nativeQuery=true)
42   - List<Object[]> historyMessage(String line,String date,String code);
  36 + @Query(value="select t.car_code,d.sender,d.txt_content,d.timestamp,0 as xlbm from ("
  37 + + " select equipment_code,car_code from bsth_c_cars where id in("
  38 + + " select cl from bsth_c_s_ccinfo where xl in ( "
  39 + + " select id from bsth_c_line where line_code=?1 ))) t"
  40 + + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id "
  41 + + " where d.timestamp >=?2 and d.timestamp <=?3 and t.car_code like %?4% ",nativeQuery=true)
  42 + List<Object[]> historyMessage(String line,long d,long t,String code);
43 43  
44 44 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs "
45 45 + " FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 d "
... ... @@ -113,12 +113,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
113 113 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir")
114 114 List<ScheduleRealInfo> setLD(String date);
115 115  
116   - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,lpName,clZbh ORDER BY xlBm,lpName,clZbh")
117   - List<ScheduleRealInfo> setLDGroup(String date);
  116 + @Query(value="select new map(xlBm as xlBm,lpName as lpName,clZbh as clZbh) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,lpName,clZbh ORDER BY xlBm,lpName,clZbh")
  117 + List<Map<String,Object>> setLDGroup(String date);
118 118  
119   - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,clZbh ORDER BY xlBm,clZbh")
120   - List<ScheduleRealInfo> setLCYHGroup(String date);
  119 + @Query(value="select new map(xlBm as xlBm,clZbh as clZbh) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,clZbh ORDER BY xlBm,clZbh")
  120 + List<Map<String,Object>> setLCYHGroup(String date);
121 121  
122   - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm")
123   - List<ScheduleRealInfo> setDDRBGroup(String date);
  122 + @Query(value="select new map(xlBm as xlBm) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm")
  123 + List<Map<String,Object>> setDDRBGroup(String date);
  124 +
124 125 }
... ...
src/main/java/com/bsth/service/forms/CommonService.java 0 → 100644
  1 +package com.bsth.service.forms;
  2 +
  3 +import java.util.Map;
  4 +
  5 +import org.springframework.stereotype.Service;
  6 +
  7 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  8 +import com.bsth.service.BaseService;
  9 +
  10 +@Service
  11 +public interface CommonService{
  12 +
  13 + Map<String,Object> findKMBC1(String jName,String clZbh, String date,String enddate);
  14 +
  15 + Map<String,Object> findKMBC2(String jName,String clZbh,String date);
  16 +}
... ...
src/main/java/com/bsth/service/forms/impl/CommonServiceImpl.java 0 → 100644
  1 +package com.bsth.service.forms.impl;
  2 +
  3 +import java.text.DecimalFormat;
  4 +import java.util.HashMap;
  5 +import java.util.Iterator;
  6 +import java.util.List;
  7 +import java.util.Map;
  8 +import java.util.Set;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +import com.bsth.entity.realcontrol.ChildTaskPlan;
  12 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  13 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  14 +import com.bsth.service.forms.CommonService;
  15 +
  16 +@Service
  17 +public class CommonServiceImpl implements CommonService{
  18 +
  19 +
  20 + @Autowired
  21 + ScheduleRealInfoRepository scheduleRealInfoRepository;
  22 +
  23 + @Override
  24 + public Map<String, Object> findKMBC1(String jName, String clZbh,
  25 + String date, String enddate) {
  26 +
  27 + String sql=" select s from bsth_c_s_sp_info_real s "
  28 + + " where s.j_gh ='" + jName + "' and s.cl_zbh ='" + clZbh + "' and "
  29 + + " to_days(s.schedule_date) BETWEEN to_days('" + date + "') and to_days('" + enddate + "')"
  30 + + " order by bcs";
  31 +
  32 +
  33 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill4(jName, clZbh, date, enddate);
  34 + DecimalFormat format = new DecimalFormat("0.00");
  35 +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
  36 +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
  37 + int jhbc = 0,cjbc = 0,ljbc = 0;
  38 + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0;
  39 + float addMileage = 0l,remMileage = 0l;
  40 + Map<String,Object> map = new HashMap<String, Object>();
  41 + for(ScheduleRealInfo scheduleRealInfo : list){
  42 + if(scheduleRealInfo != null){
  43 + //计划里程(主任务过滤掉临加班次),
  44 + //烂班里程(主任务烂班),
  45 + //临加里程(主任务临加),
  46 + //计划班次,烂班班次,增加班次
  47 + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  48 + if(scheduleRealInfo.isSflj()){
  49 + addMileage += tempJhlc;
  50 + ljbc++;
  51 + }else{
  52 + jhlc += tempJhlc;
  53 + jhbc++;
  54 + if(scheduleRealInfo.getStatus() == -1){
  55 + remMileage += tempJhlc;
  56 + cjbc++;
  57 + }
  58 + }
  59 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  60 + //计算营运里程,空驶里程
  61 + if(childTaskPlans.isEmpty()){
  62 + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  63 + || scheduleRealInfo.getBcType().equals("venting")){
  64 + ksgl += tempJhlc;
  65 + }else{
  66 + yygl += tempJhlc;
  67 + }
  68 + }else{
  69 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  70 + while(it.hasNext()){
  71 + ChildTaskPlan childTaskPlan = it.next();
  72 + if(childTaskPlan.getMileageType().equals("empty")){
  73 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  74 + }else{
  75 + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  76 + }
  77 + }
  78 + }
  79 + }
  80 + }
  81 + map.put("jhlc", format.format(jhlc));
  82 + map.put("remMileage", format.format(remMileage));
  83 + map.put("addMileage", format.format(addMileage));
  84 + map.put("yygl", format.format(yygl));
  85 + map.put("ksgl", format.format(ksgl));
  86 + map.put("realMileage", format.format(yygl+ksgl));
  87 + map.put("jhbc", jhbc);
  88 + map.put("cjbc", cjbc);
  89 + map.put("ljbc", ljbc);
  90 + map.put("sjbc", jhbc-cjbc+ljbc);
  91 + return map;
  92 + }
  93 +
  94 +
  95 + @Override
  96 + public Map<String, Object> findKMBC2(String jName, String clZbh,String date) {
  97 +
  98 + String sql=" select s from bsth_c_s_sp_info_real s "
  99 + + " where s.j_gh ='" + jName + "' and s.cl_zbh ='" + clZbh + "' and "
  100 + + " to_days(s.schedule_date) =to_days('" + date + "')"
  101 + + " order by bcs";
  102 +
  103 +
  104 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill3(jName, clZbh , date);
  105 +
  106 + DecimalFormat format = new DecimalFormat("0.00");
  107 +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
  108 +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
  109 + int jhbc = 0,cjbc = 0,ljbc = 0;
  110 + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0;
  111 + float addMileage = 0l,remMileage = 0l;
  112 + String j_Name="";
  113 + Map<String,Object> map = new HashMap<String, Object>();
  114 + for(ScheduleRealInfo scheduleRealInfo : list){
  115 + if(scheduleRealInfo != null){
  116 + j_Name=scheduleRealInfo.getjName();
  117 + //计划里程(主任务过滤掉临加班次),
  118 + //烂班里程(主任务烂班),
  119 + //临加里程(主任务临加),
  120 + //计划班次,烂班班次,增加班次
  121 + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  122 + if(scheduleRealInfo.isSflj()){
  123 + addMileage += tempJhlc;
  124 + ljbc++;
  125 + }else{
  126 + jhlc += tempJhlc;
  127 + jhbc++;
  128 + if(scheduleRealInfo.getStatus() == -1){
  129 + remMileage += tempJhlc;
  130 + cjbc++;
  131 + }
  132 + }
  133 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  134 + //计算营运里程,空驶里程
  135 + if(childTaskPlans.isEmpty()){
  136 + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  137 + || scheduleRealInfo.getBcType().equals("venting")){
  138 + ksgl += tempJhlc;
  139 + }else{
  140 + yygl += tempJhlc;
  141 + }
  142 + }else{
  143 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  144 + while(it.hasNext()){
  145 + ChildTaskPlan childTaskPlan = it.next();
  146 + if(childTaskPlan.getMileageType().equals("empty")){
  147 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  148 + }else{
  149 + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  150 + }
  151 + }
  152 + }
  153 + }
  154 + }
  155 + map.put("j_name", j_Name);
  156 + map.put("jhlc", format.format(jhlc));
  157 + map.put("remMileage", format.format(remMileage));
  158 + map.put("addMileage", format.format(addMileage));
  159 + map.put("yygl", format.format(yygl));
  160 + map.put("ksgl", format.format(ksgl));
  161 + map.put("realMileage", format.format(yygl+ksgl));
  162 + map.put("jhbc", jhbc);
  163 + map.put("cjbc", cjbc);
  164 + map.put("ljbc", ljbc);
  165 + map.put("sjbc", jhbc-cjbc+ljbc);
  166 + return map;
  167 + }
  168 +
  169 +
  170 +
  171 +
  172 +}
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -64,16 +64,22 @@ public class FormsServiceImpl implements FormsService {
64 64 // System.out.println(arg0.getObject("yl"));
65 65 // wbd.setYl(arg0.getString("yl"));
66 66 // wbd.setNbbm(arg0.getString("nbbm"));
67   - Map<String, Object> maps = new HashMap<>();
68   - maps = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"),
69   - arg0.getString("schedule_date"));
70   - wbd.setJzl1(maps.get("ksgl").toString());
71   - wbd.setZlc(maps.get("realMileage").toString());
72   -
  67 + wbd.setRq(arg0.getString("schedule_date"));
  68 + wbd.setJgh(arg0.getString("j_gh"));
73 69 return wbd;
74 70  
75 71 }
76 72 });
  73 +
  74 + for(int i=0;i<list.size();i++){
  75 + Waybillday w=list.get(i);
  76 + Map<String, Object> maps = new HashMap<>();
  77 + maps = scheduleRealInfoService.findKMBC2(w.getJgh(), w.getCarPlate(),
  78 + w.getRq());
  79 + w.setJzl1(maps.get("ksgl").toString());
  80 + w.setZlc(maps.get("realMileage").toString());
  81 +
  82 + }
77 83 return list;
78 84 }
79 85  
... ... @@ -102,6 +108,9 @@ public class FormsServiceImpl implements FormsService {
102 108 return lin;
103 109 }
104 110 });
  111 +
  112 +
  113 +
105 114 return list;
106 115 }
107 116  
... ... @@ -111,12 +120,13 @@ public class FormsServiceImpl implements FormsService {
111 120  
112 121 @Override
113 122 public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) {
114   - String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  123 + String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
115 124 + " from bsth_c_s_sp_info_real r "
116 125 + " where to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') "
117 126 + " and to_days('" + map.get("endDate").toString() + "') "
118 127 + " and r.xl_bm='"+ map.get("line").toString() + "'"
119 128 + " AND r.gs_bm is not null"
  129 + + " and r.bc_type not in('in','out')"
120 130 /* + " and r.gs_bm='"+map.get("gsdmManth").toString()+"'"
121 131 + " and r.fgs_bm='"+map.get("fgsdmManth").toString()+"'"*/
122 132 + " GROUP BY r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name"
... ... @@ -130,26 +140,29 @@ public class FormsServiceImpl implements FormsService {
130 140 public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException {
131 141 Shiftuehiclemanth shif = new Shiftuehiclemanth();
132 142 shif.setjName(arg0.getString("j_name"));
133   -
134   - Map<String, Object> maps = new HashMap<>();
135   -
136   - maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate,
137   - endDate);
138   -
139   - shif.setJhlc(maps.get("jhlc").toString());
140   - shif.setEmptMileage(maps.get("ksgl").toString());
141   - shif.setRemMileage(maps.get("remMileage").toString());
142   - shif.setAddMileage(maps.get("addMileage").toString());
143   - shif.setTotalm(maps.get("realMileage").toString());
144   - shif.setCjbc(maps.get("cjbc").toString());
145   - shif.setLjbc(maps.get("ljbc").toString());
146   - shif.setSjbc(maps.get("sjbc").toString());
147   -
  143 + shif.setJgh(arg0.getString("j_gh"));
  144 + shif.setZbh(arg0.getString("cl_zbh"));
148 145 return shif;
149   -
150 146 }
151 147 });
  148 +
  149 + for(int i=0;i<list.size();i++){
  150 + Shiftuehiclemanth s=list.get(i);
  151 + Map<String, Object> maps = new HashMap<>();
  152 +
  153 + maps = scheduleRealInfoService.findKMBC1(s.getjName(),s.getZbh(), startDate,
  154 + endDate);
  155 +
  156 + s.setJhlc(maps.get("jhlc").toString());
  157 + s.setEmptMileage(maps.get("ksgl").toString());
  158 + s.setRemMileage(maps.get("remMileage").toString());
  159 + s.setAddMileage(maps.get("addMileage").toString());
  160 + s.setTotalm(maps.get("realMileage").toString());
  161 + s.setCjbc(maps.get("cjbc").toString());
  162 + s.setLjbc(maps.get("ljbc").toString());
  163 + s.setSjbc(maps.get("sjbc").toString());
152 164  
  165 + }
153 166 return list;
154 167 }
155 168  
... ... @@ -157,10 +170,11 @@ public class FormsServiceImpl implements FormsService {
157 170 @Override
158 171 public List<Shifday> shifday(Map<String, Object> map) {
159 172 String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,"
160   - + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  173 + + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
161 174 + " FROM bsth_c_s_sp_info_real r "
162 175 + " where to_days(r.schedule_date)=to_days('"
163 176 + map.get("date").toString() + "') and r.xl_bm=" + map.get("line").toString()
  177 + + " and r.bc_type not in('in','out')"
164 178 /*+ " and r.gs_bm='"+map.get("gsdmShif").toString()+"'"
165 179 + " and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'"*/
166 180 + " GROUP BY r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
... ... @@ -175,25 +189,34 @@ public class FormsServiceImpl implements FormsService {
175 189 shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString());
176 190 shifday.setLpName(arg0.getString("r.lp_name").toString());
177 191 shifday.setCarPlate(arg0.getString("cl_zbh").toString());
178   -
179   - Map<String, Object> map = new HashMap<>();
180   - map = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"),
181   - arg0.getString("schedule_date"));
182   - shifday.setJhlc(map.get("jhlc").toString());// 计划里程
183   - //shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程
184   - shifday.setYygl(map.get("yygl").toString());// 营运里程
185   - shifday.setEmptMileage(map.get("ksgl").toString());// 空驶里程
186   - shifday.setRemMileage(map.get("remMileage").toString());// 抽减里程
187   - shifday.setAddMileage(map.get("addMileage").toString());// 增加里程
188   - shifday.setTotalm(map.get("realMileage").toString());// 总里程
189   - shifday.setJhbc(map.get("jhbc").toString());// 计划班次
190   - //shifday.setSjjhbc(map.get("sjjhbc").toString());//实际计划班次
191   - shifday.setCjbc(map.get("cjbc").toString());// 抽减班次
192   - shifday.setLjbc(map.get("ljbc").toString());// 增加班次
193   - shifday.setSjbc(map.get("sjbc").toString());// 实际班次
  192 + shifday.setJgh(arg0.getString("j_gh"));
  193 + shifday.setZbh(arg0.getString("cl_zbh"));
  194 + shifday.setRq(arg0.getString("schedule_date"));
194 195 return shifday;
195 196 }
  197 +
196 198 });
  199 +
  200 + for(int i=0;i<list.size();i++){
  201 + Shifday shi=list.get(i);
  202 + Map<String, Object> maps = new HashMap<>();
  203 + maps = scheduleRealInfoService.findKMBC2(shi.getJgh(), shi.getCarPlate(),
  204 + shi.getRq());
  205 + shi.setJhlc(maps.get("jhlc").toString());// 计划里程
  206 + //shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程
  207 + shi.setYygl(maps.get("yygl").toString());// 营运里程
  208 + shi.setEmptMileage(maps.get("ksgl").toString());// 空驶里程
  209 + shi.setRemMileage(maps.get("remMileage").toString());// 抽减里程
  210 + shi.setAddMileage(maps.get("addMileage").toString());// 增加里程
  211 + shi.setTotalm(maps.get("realMileage").toString());// 总里程
  212 + shi.setJhbc(maps.get("jhbc").toString());// 计划班次
  213 + //shifday.setSjjhbc(map.get("sjjhbc").toString());//实际计划班次
  214 + shi.setCjbc(maps.get("cjbc").toString());// 抽减班次
  215 + shi.setLjbc(maps.get("ljbc").toString());// 增加班次
  216 + shi.setSjbc(maps.get("sjbc").toString());// 实际班次
  217 +
  218 + }
  219 +
197 220 return list;
198 221 }
199 222  
... ... @@ -240,20 +263,20 @@ public class FormsServiceImpl implements FormsService {
240 263 Changetochange chan = new Changetochange();
241 264  
242 265 chan.setRq(rq);
243   - chan.setGs(arg0.getString("gs").toString());
244   - chan.setFgs(arg0.getString("fgs").toString());
245   - chan.setXl(arg0.getString("xl").toString());
246   - chan.setLp(arg0.getString("lp").toString());
247   - chan.setFssj(arg0.getString("fssj").toString());
248   - chan.setXgsj(arg0.getString("xgsj").toString());
249   - chan.setPcch(arg0.getString("pcch").toString());
250   - chan.setPcry(arg0.getString("pcry").toString());
251   - chan.setJhch(arg0.getString("jhch").toString());
252   - chan.setJhgh(arg0.getString("jhgh").toString());
253   - chan.setSjch(arg0.getString("sjch").toString());
254   - chan.setSjgh(arg0.getString("sjgh").toString());
255   - chan.setYy(arg0.getString("yy").toString());
256   - chan.setXgr(arg0.getString("xgr").toString());
  266 + chan.setGs(arg0.getString("gs"));
  267 + chan.setFgs(arg0.getString("fgs"));
  268 + chan.setXl(arg0.getString("xl"));
  269 + chan.setLp(arg0.getString("lp"));
  270 + chan.setFssj(arg0.getString("fssj"));
  271 + chan.setXgsj(arg0.getString("xgsj"));
  272 + chan.setPcch(arg0.getString("pcch"));
  273 + chan.setPcry(arg0.getString("pcry"));
  274 + chan.setJhch(arg0.getString("jhch"));
  275 + chan.setJhgh(arg0.getString("jhgh"));
  276 + chan.setSjch(arg0.getString("sjch"));
  277 + chan.setSjgh(arg0.getString("sjgh"));
  278 + chan.setYy(arg0.getString("yy"));
  279 + chan.setXgr(arg0.getString("xgr"));
257 280 return chan;
258 281 }
259 282 });
... ... @@ -279,7 +302,7 @@ public class FormsServiceImpl implements FormsService {
279 302  
280 303 rq = rq2 + "-" + rq3;
281 304  
282   - String sql = " SELECT r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  305 + String sql = " SELECT r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
283 306 + " FROM bsth_c_s_sp_info_real r "
284 307 + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y "
285 308 + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "' and '"+ map.get("endDate").toString() + "'"
... ... @@ -309,19 +332,23 @@ public class FormsServiceImpl implements FormsService {
309 332 sin.setJzl(arg0.getString("JZL"));
310 333 // sin.setJzl(arg0.getString(""));//非营业性用油
311 334 sin.setJhjl(arg0.getString("JZL"));
312   - Map<String, Object> maps = new HashMap<>();
313   - maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate,
314   - endDate);
315   - //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString());
316   - sin.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString());
317   - sin.setsName(maps.get("s_name") == null ? "" : maps.get("s_name").toString());
318   - sin.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString());
319   - sin.setEmptMileage(maps.get("ksgl") == null ? "" : maps.get("ksgl").toString());
320   - sin.setJhjl(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString());
321   -
  335 +
322 336 return sin;
323 337 }
324 338 });
  339 + for(int i=0;i<list.size();i++){
  340 + Singledata si=list.get(i);
  341 + Map<String, Object> maps = new HashMap<>();
  342 + maps = scheduleRealInfoService.findKMBC1(si.getjName(),si.getClzbh(), startDate,
  343 + endDate);
  344 + //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString());
  345 + si.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString());
  346 + si.setsName(maps.get("s_name") == null ? "" : maps.get("s_name").toString());
  347 + si.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString());
  348 + si.setEmptMileage(maps.get("ksgl") == null ? "" : maps.get("ksgl").toString());
  349 + si.setJhjl(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString());
  350 +
  351 + }
325 352 return list;
326 353 }
327 354  
... ... @@ -329,7 +356,7 @@ public class FormsServiceImpl implements FormsService {
329 356 @Override
330 357 public List<Operationservice> operationservice(Map<String, Object> map) {
331 358  
332   - String sql = " SELECT r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  359 + String sql = " SELECT r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
333 360 + " FROM bsth_c_s_sp_info_real r "
334 361 // + "LEFT JOIN bsth_c_s_sp_info_real r on r.cl_zbh=y.NBBM"
335 362 + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y "
... ... @@ -338,6 +365,7 @@ public class FormsServiceImpl implements FormsService {
338 365 + " where r.schedule_date_str BETWEEN '"+ map.get("startDate").toString()
339 366 + "'" + " and '" + map.get("endDate").toString() + "'"
340 367 + " and r.xl_bm='" + map.get("line").toString() + "'"
  368 + + " and r.bc_type not in('in','out')"
341 369 /* + " and r.gs_bm='"+map.get("gsdmOperat").toString()+"'"
342 370 + " and r.fgs_bm='"+map.get("fgsdmOperat").toString()+"'"*/
343 371 + " AND r.gs_bm is not null"
... ... @@ -373,11 +401,12 @@ public class FormsServiceImpl implements FormsService {
373 401 return list;
374 402 }
375 403  
  404 +
376 405 // 车辆加注
377 406 @Override
378 407 public List<Vehicleloading> vehicleloading(/*String gsdmVehic,String fgsdmVehic,*/String line, String date) {
379 408  
380   - String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  409 + String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
381 410 + " FROM bsth_c_s_sp_info_real r "
382 411 + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y "
383 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 "
... ... @@ -385,6 +414,7 @@ public class FormsServiceImpl implements FormsService {
385 414 + " where to_days(r.schedule_date_str)=to_days('" + date + "')"
386 415 + " and r.xl_bm='" + line + "' "
387 416 + " AND r.gs_bm is not null"
  417 + + " and r.bc_type not in('in','out')"
388 418 /* + " and r.gs_bm='"+gsdmVehic +"'"
389 419 + " and r.fgs_bm='"+fgsdmVehic +"'"*/
390 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 ";
... ... @@ -402,15 +432,21 @@ public class FormsServiceImpl implements FormsService {
402 432 ve.setHyl(arg0.getString("YH"));
403 433 ve.setJzl(arg0.getString("JZL"));
404 434 // ve.setLs(arg0.getString("").toString());//尿素
405   - Map<String, Object> maps = new HashMap<>();
406   - maps = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"),
407   - arg0.getString("schedule_date_str"));
408   - ve.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString());
409   - ve.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次
410   - ve.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次
  435 + ve.setJgh(arg0.getString("j_gh").toString());
411 436 return ve;
412 437 }
413 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 +
414 450 return list;
415 451 }
416 452  
... ... @@ -434,20 +470,22 @@ public class FormsServiceImpl implements FormsService {
434 470  
435 471 rq = rq2 + "-" + rq3;
436 472  
437   - 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 "
438   - + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl"
  473 + String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,b.warrant_car,a.bc_type from "
  474 + + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type"
439 475 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"+ map.get("startDate").toString() + "' "
440 476 + " and '" + map.get("endDate").toString() + "' and xl_bm='"+ map.get("line").toString() + "' "
441 477 + " AND gs_bm is not null "
  478 + + " AND bc_type NOT IN ('in', 'out')"
442 479 /*+ " and gs_bm='"+ map.get("gsdmTurn").toString() + "'"
443 480 + " and fgs_bm='"+ map.get("fgsdmTurn").toString() + "'"*/
444   - + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN ("
  481 + + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN ("
445 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 "
446   - + " from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real "
  483 + + " from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real "
447 484 + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '"
448 485 + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString()
449 486 + "' AND gs_bm is not null "
450   - + "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 "
451 489 + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm ";
452 490 List<Turnoutrate> list = jdbcTemplate.query(sql, new RowMapper<Turnoutrate>() {
453 491  
... ... @@ -480,6 +518,7 @@ public class FormsServiceImpl implements FormsService {
480 518  
481 519 });
482 520  
  521 +
483 522 return list;
484 523 }
485 524  
... ... @@ -503,20 +542,20 @@ public class FormsServiceImpl implements FormsService {
503 542  
504 543 rq = rq2 + "-" + rq3;
505 544  
506   - 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 "
507   - + " (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"
508 547 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"
509 548 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='"
510   - + map.get("line").toString() + "' AND gs_bm is not null"
  549 + + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')"
511 550 /*+ " and gs_bm='"+ map.get("gsdmEcecut").toString() + "'"
512 551 + " and fgs_bm='"+ map.get("fgsdmEcecut").toString() + "'"*/
513   - + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN ("
514   - + "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 "
515   - + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real "
  552 + + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN ("
  553 + + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl "
  554 + + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real "
516 555 + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '"
517 556 + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString()
518   - + "' AND gs_bm is not null "
519   - + "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 "
520 559 + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm ";
521 560 List<Executionrate> list = jdbcTemplate.query(sql, new RowMapper<Executionrate>() {
522 561  
... ... @@ -570,22 +609,27 @@ public class FormsServiceImpl implements FormsService {
570 609 String rq2 = sdf1.format(d);
571 610 String rq3 = sdf1.format(d1);
572 611  
  612 +
  613 +
573 614 rq = rq2 + "-" + rq3;
574 615  
575   - 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 "
576   - + " (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"
577 618 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"
578 619 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='"
579   - + map.get("line").toString() + "' AND gs_bm is not null"
  620 + + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') "
580 621 /*+ " and gs_bm='"+ map.get("gsdmAllline").toString() + "'"
581 622 + " and fgs_bm='"+ map.get("fgsdmAllline").toString() + "'"*/
582   - + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN ("
583   - + "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 "
584   - + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real "
  623 + + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN ("
  624 + + "SELECT COUNT(*"
  625 + + ") as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b."
  626 + + "xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl "
  627 + + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real "
585 628 + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '"
586   - + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString()
587   - + "' AND gs_bm is not null "
588   - + "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 "
589 633 + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm ";
590 634 List<Allline> list = jdbcTemplate.query(sql, new RowMapper<Allline>() {
591 635  
... ... @@ -610,14 +654,19 @@ public class FormsServiceImpl implements FormsService {
610 654 tu.setBcjh(arg0.getString("jbc").toString());
611 655 tu.setBcsj(arg0.getString("sbc").toString());
612 656 tu.setBbzxl(result2 + "%");// 班次执行率
  657 +
613 658 // tu.setSm(arg0.getString("xl_name").toString());
614 659 tu.setGsgs(arg0.getString("gslsbm").toString());
615 660 tu.setFgsgs(arg0.getString("fgsbm").toString());
616 661 return tu;
617 662 }
618 663  
  664 +
619 665 });
  666 +
620 667  
  668 +
  669 +
621 670 return list;
622 671 }
623   -}
624 672 \ No newline at end of file
  673 +}
... ...
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
... ... @@ -24,7 +24,6 @@ import org.slf4j.LoggerFactory;
24 24 import org.springframework.beans.factory.annotation.Autowired;
25 25 import org.springframework.data.domain.Sort;
26 26 import org.springframework.data.domain.Sort.Direction;
27   -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
28 27 import org.springframework.stereotype.Service;
29 28  
30 29 import java.io.BufferedOutputStream;
... ... @@ -37,6 +36,8 @@ import java.sql.ResultSet;
37 36 import java.text.DecimalFormat;
38 37 import java.text.SimpleDateFormat;
39 38 import java.util.*;
  39 +import java.util.regex.Pattern;
  40 +
40 41 /**
41 42 *
42 43 * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类)
... ... @@ -102,9 +103,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
102 103 @Autowired
103 104 private ScheduleRealInfoRepository scheduleRealInfoRepository;
104 105  
105   - @Autowired
106   - NamedParameterJdbcTemplate jdbcTemplate;
107   -
108 106  
109 107 // 运管处接口
110 108 private InternalPortType portType = new Internal().getInternalHttpSoap11Endpoint();
... ... @@ -299,32 +297,38 @@ public class TrafficManageServiceImpl implements TrafficManageService{
299 297 */
300 298 public String setLD(){
301 299 String result = "failure";
  300 + Line line;
302 301 // 取昨天 的日期
303 302 String date = sdfnyr.format(DateUtils.addDays(new Date(), -1));
304 303 StringBuffer sf = new StringBuffer();
305 304 try {
306 305 sf.append("<DLDS>");
307 306 List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date);
308   - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date);
  307 + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date);
309 308 Map<String,Object> map = new HashMap<String,Object>();
310   - for(ScheduleRealInfo schRealInfo:listGroup){
  309 + for(Map<String,Object> schRealInfo:listGroup){
311 310 if(schRealInfo != null){
312 311 //根据车辆自编号查询车牌号
313   - map.put("insideCode_eq", schRealInfo.getClZbh());
  312 + map.put("insideCode_eq", schRealInfo.get("clZbh")+"");
314 313 Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map));
  314 + // 获取线路是否使用标识,如果未使用,则不查该线路数据
  315 + line = lineRepository.findByLineCode(schRealInfo.get("xlBm")+"");
  316 + if(line.getInUse() == null || line.getInUse() == 0){
  317 + continue;
  318 + }
315 319 sf.append("<DLD>");
316   - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>");
317   - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>");
318   - sf.append("<LPBH>"+schRealInfo.getLpName()+"</LPBH>");
  320 + sf.append("<RQ>"+date+"</RQ>");
  321 + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm")+"")+"</XLBM>");
  322 + sf.append("<LPBH>"+schRealInfo.get("lpName")+"</LPBH>");
319 323 sf.append("<CPH>"+car.getCarPlate()+"</CPH>");
320   - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>");
  324 + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>");
321 325 sf.append("<LDList>");
322 326  
323 327 int seqNumber = 0;
324 328 for(ScheduleRealInfo scheduleRealInfo:list){
325   - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getLpName()
  329 + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("lpName")+"")
326 330 .equals(scheduleRealInfo.getLpName())
327   - && schRealInfo.getClZbh().equals(scheduleRealInfo.getClZbh())){
  331 + && (schRealInfo.get("clZbh")+"").equals(scheduleRealInfo.getClZbh())){
328 332 if(scheduleRealInfo.getFcsjActual() == null ||scheduleRealInfo.getBcType().equals("in")
329 333 || scheduleRealInfo.getBcType().equals("out")){
330 334 continue;
... ... @@ -382,22 +386,22 @@ public class TrafficManageServiceImpl implements TrafficManageService{
382 386 StringBuffer sf = new StringBuffer();
383 387 try {
384 388 sf.append("<LCYHS>");
385   - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date);
  389 + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLCYHGroup(date);
386 390 List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date);
387 391 Map<String,Object> map = new HashMap<String,Object>();
388   - for(ScheduleRealInfo schRealInfo:listGroup){
  392 + for(Map<String,Object> schRealInfo:listGroup){
389 393 if(schRealInfo != null){
390 394 //计算总公里和空驶公里,营运公里=总公里-空驶公里
391 395 double totalKilometers = 0,emptyKilometers =0;
392 396 sf.append("<LCYH>");
393   - map.put("insideCode_eq", schRealInfo.getClZbh());
  397 + map.put("insideCode_eq", schRealInfo.get("clZbh")+"");
394 398 Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map));
395 399 // Cars car = carsRepository.findCarByClzbh(schRealInfo.getClZbh());
396   - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>");
397   - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>");
  400 + sf.append("<RQ>"+date+"</RQ>");
  401 + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm"))+"</XLBM>");
398 402 sf.append("<CPH>"+car.getCarPlate()+"</CPH>");
399 403 for(ScheduleRealInfo scheduleRealInfo:list){
400   - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getClZbh()
  404 + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("clZbh")+"")
401 405 .equals(scheduleRealInfo.getClZbh())){
402 406 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
403 407 //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班
... ... @@ -428,7 +432,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
428 432 sf.append("<YH>"+""+"</YH>");
429 433 sf.append("<JZYL>"+""+"</JZYL>");
430 434 sf.append("<DH>"+""+"</DH>");
431   - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>");
  435 + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>");
432 436 sf.append("<BBSCBZ>"+0+"</BBSCBZ>");
433 437 sf.append("</LCYH>");
434 438 }
... ... @@ -458,18 +462,18 @@ public class TrafficManageServiceImpl implements TrafficManageService{
458 462 StringBuffer sf = new StringBuffer();
459 463 try {
460 464 sf.append("<DDRBS>");
461   - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date);
  465 + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setDDRBGroup(date);
462 466 List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date);
463   - for(ScheduleRealInfo schRealInfo:listGroup){
  467 + for(Map<String,Object> schRealInfo:listGroup){
464 468 if(schRealInfo != null){
465 469 double jhlc = 0,zlc = 0,jhkslc = 0,sjkslc = 0;
466 470 int jhbc = 0,sjbc = 0,jhzgfbc = 0,sjzgfbc = 0,jhwgfbc = 0,sjwgfbc = 0;
467 471 sf.append("<DDRB>");
468   - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>");
469   - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>");
  472 + sf.append("<RQ>"+date+"</RQ>");
  473 + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm"))+"</XLBM>");
470 474 for(ScheduleRealInfo scheduleRealInfo:list){
471 475 if(scheduleRealInfo != null){
472   - if(scheduleRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm())){
  476 + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm())){
473 477 //计划
474 478 if(!scheduleRealInfo.isSflj()){
475 479 jhlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc();
... ... @@ -532,7 +536,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
532 536 sf.append("<SJZGFBC>"+sjzgfbc+"</SJZGFBC>");
533 537 sf.append("<JHWGFBC>"+jhwgfbc+"</JHWGFBC>");
534 538 sf.append("<SJWGFBC>"+sjwgfbc+"</SJWGFBC>");
535   - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>");
  539 + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>");
536 540 sf.append("<RBSCBZ>"+0+"</RBSCBZ>");
537 541 sf.append("</DDRB>");
538 542 }
... ... @@ -557,24 +561,30 @@ public class TrafficManageServiceImpl implements TrafficManageService{
557 561 @Override
558 562 public String setJHBC() {
559 563 String result = "failure";
  564 + Line line;
560 565 StringBuffer sBuffer =new StringBuffer();
561 566 try {
562 567 sBuffer.append("<JHBCs>");
563 568 // 声明变量
564   - SchedulePlanInfo schedulePlanInfo = null;
565   - String xlbm = "",zbh = "";
  569 + SchedulePlanInfo schedulePlanInfo;
  570 + String xlbm,zbh = "";
566 571 Long lp = 0L;
567   - int startSerialNum = 0,endSerialNum = 0;;
568 572 // 取明天的日期
569 573 String tomorrow = sdfnyr.format(DateUtils.addDays(new Date(), +1));
570 574 // 查询所有班次
571 575 List<SchedulePlanInfo> schedulePlanList = schedulePlanInfoRepository.findLineScheduleBc(tomorrow);
  576 + int j = 0; // 初始化标识
572 577 if(schedulePlanList != null ){
573 578 int size = schedulePlanList.size();
574 579 for (int i = 0; i < size; i++) {
575 580 schedulePlanInfo = schedulePlanList.get(i);
576   - if(i == 0){// 第一次,则初始化值
577   - xlbm = schedulePlanInfo.getXlBm();
  581 + xlbm = schedulePlanInfo.getXlBm();
  582 + // 获取线路是否使用标识,如果未使用,则不查该线路数据
  583 + line = lineRepository.findByLineCode(xlbm);
  584 + if(line.getInUse() == null || line.getInUse() == 0){
  585 + continue;
  586 + }
  587 + if(++j == 1){// 第一次,则初始化值
578 588 zbh = schedulePlanInfo.getClZbh();
579 589 lp = schedulePlanInfo.getLp();
580 590 // 拼装XML
... ... @@ -605,18 +615,28 @@ public class TrafficManageServiceImpl implements TrafficManageService{
605 615 sBuffer.append("</JHBC>");
606 616 }
607 617 }else{
608   - xlbm = schedulePlanInfo.getXlBm();
609 618 zbh = schedulePlanInfo.getClZbh();
610 619 lp = schedulePlanInfo.getLp();
611 620 sBuffer.append("</BCList>");
612 621 sBuffer.append("</JHBC>");
613   - startSerialNum = 0;
614   - endSerialNum = 0;
615 622 // 拼装XML
616 623 assembleJHBC(sBuffer, schedulePlanInfo, xlbm, zbh, lp);
617 624 }
618 625 }
619 626 }
  627 + // 判断XML是否以</BCList>结尾,如果不是,则加上
  628 + String regex = "^*</JHBC>$";
  629 + Pattern p = Pattern.compile(regex);
  630 + java.util.regex.Matcher m = p.matcher(sBuffer);
  631 + boolean isEndWithTrueFlag = false;
  632 + while (m.find()) {
  633 + isEndWithTrueFlag = true;
  634 + }
  635 + // 加上缺失的标签
  636 + if(!isEndWithTrueFlag){
  637 + sBuffer.append("</BCList>");
  638 + sBuffer.append("</JHBC>");
  639 + }
620 640 sBuffer.append("</JHBCs>");
621 641 if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
622 642 result = "success";
... ... @@ -643,7 +663,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
643 663 StringBuffer sBufferA;
644 664 StringBuffer sBufferB;
645 665 TTInfo ttInfo;
646   - TTInfoDetail ttInfoDetail = null;
  666 + TTInfoDetail ttInfoDetail;
647 667 Iterator<TTInfoDetail> ttInfoDetailIterator;
648 668 HashMap<String,Object> param = new HashMap<String, Object>();
649 669 String lineCode ;
... ... @@ -1027,6 +1047,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1027 1047 company = "浦东金高公交公司";
1028 1048 }else if(company.equals("南汇公司")){
1029 1049 company = "浦东南汇公交公司";
  1050 + }else if(company.equals("青浦公交")){
  1051 + company = "浦东青浦公交公司";
1030 1052 }
1031 1053 }
1032 1054 /**
... ...
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&lt;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&lt;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
... ... @@ -613,11 +613,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
613 613  
614 614 @Override
615 615 public List<Object[]> historyMessage(String line, String date, String code) {
  616 +
  617 + String sql="select t.car_code,d.sender,d.txt_content,d.timestamp from ("
  618 + + " select equipment_code,car_code from bsth_c_cars where id in("
  619 + + " select cl from bsth_c_s_ccinfo where xl in ( "
  620 + + " select id from bsth_c_line where line_code=?1 ))) t"
  621 + + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id "
  622 + + " where d.timestamp >=?2 and d.timestamp <=?3 and t.car_code like '%?4%'";
616 623 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
617   - List<Object[]> list = scheduleRealInfoRepository.historyMessage(line, date, code);
  624 + long d= 0;
  625 + long t=0;
  626 + if(date.length()>0){
  627 + try {
  628 + d=sdf.parse(date+" 00:00:00").getTime();
  629 + t=sdf.parse(date+" 23:59:59").getTime();
  630 + } catch (ParseException e) {
  631 + // TODO Auto-generated catch block
  632 + e.printStackTrace();
  633 + }
  634 +
  635 + }
  636 +
  637 + List<Object[]> list = scheduleRealInfoRepository.historyMessage(line,d,t, code);
618 638 for(Object[] obj:list){
619 639 if(obj != null){
620   - obj[4] = sdf.format(new Date(Long.parseLong(obj[4].toString())));
  640 + obj[3] = sdf.format(new Date(Long.parseLong(obj[3].toString())));
  641 + obj[4] = BasicData.lineCode2NameMap.get(line);
621 642 }
622 643 }
623 644 return list;
... ... @@ -1129,10 +1150,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1129 1150 addMileage += tempJhlc;
1130 1151 ljbc++;
1131 1152 }else{
1132   - if(scheduleRealInfo.getBcType().equals("normal")){
  1153 + if( !(scheduleRealInfo.getBcType().equals("in")
  1154 + ||scheduleRealInfo.getBcType().equals("out")) ){
1133 1155 jhbc++;
  1156 + jhlc += tempJhlc;
1134 1157 }
1135   - jhlc += tempJhlc;
  1158 +
1136 1159 if(scheduleRealInfo.getStatus() == -1){
1137 1160 remMileage += tempJhlc;
1138 1161 cjbc++;
... ... @@ -1143,11 +1166,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1143 1166 if(childTaskPlans.isEmpty()){
1144 1167 if(scheduleRealInfo.getBcType().equals("in") ||
1145 1168 scheduleRealInfo.getBcType().equals("out")){
1146   - ksgl += tempJhlc;
1147 1169 jcclc +=tempJhlc;
1148   - }else if(scheduleRealInfo.getBcType().equals("venting")){
1149   - ksgl += tempJhlc;
1150   - }else{
  1170 + }
  1171 + //主任务 放空班次属于营运
  1172 +// else if(scheduleRealInfo.getBcType().equals("venting")){
  1173 +// ksgl += tempJhlc;
  1174 +// }
  1175 + else{
1151 1176 if(scheduleRealInfo.getStatus() != -1){
1152 1177 yygl += tempJhlc;
1153 1178 }
... ... @@ -1160,8 +1185,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1160 1185 ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
1161 1186 }else{
1162 1187 if(childTaskPlan.isDestroy()){
1163   - remMileage += tempJhlc;
1164   - cjbc++;
  1188 + remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1189 +// cjbc++;
1165 1190 }else{
1166 1191 yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
1167 1192 }
... ... @@ -1175,12 +1200,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1175 1200 map.put("addMileage", format.format(addMileage));
1176 1201 map.put("yygl", format.format(yygl));
1177 1202 map.put("ksgl", format.format(ksgl));
1178   - map.put("realMileage", format.format(yygl+ksgl));
  1203 + map.put("realMileage", format.format(yygl+ksgl+jcclc));
1179 1204 map.put("jhbc", jhbc);
1180 1205 map.put("cjbc", cjbc);
1181 1206 map.put("ljbc", ljbc);
1182 1207 map.put("sjbc", jhbc-cjbc+ljbc);
1183 1208 map.put("jcclc", jcclc);
  1209 + map.put("zkslc", ksgl+jcclc);
1184 1210 return map;
1185 1211 }
1186 1212  
... ... @@ -1259,115 +1285,121 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1259 1285 Map<String,Object> map = new HashMap<String, Object>();
1260 1286 for(ScheduleRealInfo scheduleRealInfo: list){
1261 1287 if(scheduleRealInfo != null){
1262   - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
1263   - //计算实际里程,少驶里程,计划里程=实际里程+少驶里程
1264   - if(childTaskPlans.isEmpty()){
1265   - tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
1266   - jhlc += tempJhlc;
1267   - if(scheduleRealInfo.getStatus() == 2){
1268   - sjgl += tempJhlc;
1269   - }else if(scheduleRealInfo.getStatus() == -1){
1270   - ssgl += tempJhlc;
1271   - if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("路阻") != -1){
1272   - ssgl_lz += tempJhlc;
1273   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("吊慢") != -1){
1274   - ssgl_dm += tempJhlc;
1275   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("故障") != -1){
1276   - ssgl_gz += tempJhlc;
1277   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("纠纷") != -1){
1278   - ssgl_jf += tempJhlc;
1279   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("肇事") != -1){
1280   - ssgl_zs += tempJhlc;
1281   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺人") != -1){
1282   - ssgl_qr += tempJhlc;
1283   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺车") != -1){
1284   - ssgl_qc += tempJhlc;
1285   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("客稀") != -1){
1286   - ssgl_kx += tempJhlc;
1287   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("气候") != -1){
1288   - ssgl_qh += tempJhlc;
1289   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("援外") != -1){
1290   - ssgl_yw += tempJhlc;
1291   - }else{
1292   - ssgl_other += tempJhlc;
1293   - }
1294   -
  1288 +
  1289 + if(!(scheduleRealInfo.getBcType().equals("in")
  1290 + ||scheduleRealInfo.getBcType().equals("out")) ){
  1291 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  1292 + //计算实际里程,少驶里程,计划里程=实际里程+少驶里程
  1293 + if(childTaskPlans.isEmpty()){
  1294 + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
1295 1295 //临加公里
1296 1296 if(scheduleRealInfo.isSflj()){
1297 1297 ljgl += tempJhlc;
  1298 + }else{
  1299 + jhlc += tempJhlc;
1298 1300 }
1299   - }else{
1300   - ssgl += tempJhlc;
1301   - ssgl_other += tempJhlc;
1302   - }
1303   - }else{
1304   - Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
1305   - while(it.hasNext()){
1306   - ChildTaskPlan childTaskPlan = it.next();
1307   - childMileage = childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
1308   - jhlc += childMileage;
1309   - if(childTaskPlan.isDestroy()){
1310   - ssgl += childMileage;
1311   - if(childTaskPlan.getDestroyReason().equals("路阻")){
1312   - ssgl_lz += childTaskPlan.getMileage();
1313   - }else if(childTaskPlan.getDestroyReason().equals("吊慢")){
1314   - ssgl_dm += childTaskPlan.getMileage();
1315   - }else if(childTaskPlan.getDestroyReason().equals("故障")){
1316   - ssgl_gz += childTaskPlan.getMileage();
1317   - }else if(childTaskPlan.getDestroyReason().equals("纠纷")){
1318   - ssgl_jf += childTaskPlan.getMileage();
1319   - }else if(childTaskPlan.getDestroyReason().equals("肇事")){
1320   - ssgl_zs += childTaskPlan.getMileage();
1321   - }else if(childTaskPlan.getDestroyReason().equals("缺人")){
1322   - ssgl_qr += childTaskPlan.getMileage();
1323   - }else if(childTaskPlan.getDestroyReason().equals("缺车")){
1324   - ssgl_qc += childTaskPlan.getMileage();
1325   - }else if(childTaskPlan.getDestroyReason().equals("客稀")){
1326   - ssgl_kx += childTaskPlan.getMileage();
1327   - }else if(childTaskPlan.getDestroyReason().equals("气候")){
1328   - ssgl_qh += childTaskPlan.getMileage();
1329   - }else if(childTaskPlan.getDestroyReason().equals("援外")){
1330   - ssgl_yw += childTaskPlan.getMileage();
  1301 + if(scheduleRealInfo.getStatus() == 2){
  1302 + sjgl += tempJhlc;
  1303 + }else if(scheduleRealInfo.getStatus() == -1){
  1304 + ssgl += tempJhlc;
  1305 + if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("路阻") != -1){
  1306 + ssgl_lz += tempJhlc;
  1307 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("吊慢") != -1){
  1308 + ssgl_dm += tempJhlc;
  1309 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("故障") != -1){
  1310 + ssgl_gz += tempJhlc;
  1311 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("纠纷") != -1){
  1312 + ssgl_jf += tempJhlc;
  1313 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("肇事") != -1){
  1314 + ssgl_zs += tempJhlc;
  1315 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺人") != -1){
  1316 + ssgl_qr += tempJhlc;
  1317 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺车") != -1){
  1318 + ssgl_qc += tempJhlc;
  1319 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("客稀") != -1){
  1320 + ssgl_kx += tempJhlc;
  1321 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("气候") != -1){
  1322 + ssgl_qh += tempJhlc;
  1323 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("援外") != -1){
  1324 + ssgl_yw += tempJhlc;
1331 1325 }else{
1332   - ssgl_other += childTaskPlan.getMileage();
  1326 + ssgl_other += tempJhlc;
1333 1327 }
  1328 +
  1329 +
1334 1330 }else{
1335   - sjgl += childMileage;
  1331 + ssgl += tempJhlc;
  1332 + ssgl_other += tempJhlc;
  1333 + }
  1334 + }else{
  1335 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1336 + while(it.hasNext()){
  1337 + ChildTaskPlan childTaskPlan = it.next();
  1338 + childMileage = childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1339 + jhlc += childMileage;
  1340 + if(childTaskPlan.isDestroy()){
  1341 + ssgl += childMileage;
  1342 + if(childTaskPlan.getDestroyReason().equals("路阻")){
  1343 + ssgl_lz += childTaskPlan.getMileage();
  1344 + }else if(childTaskPlan.getDestroyReason().equals("吊慢")){
  1345 + ssgl_dm += childTaskPlan.getMileage();
  1346 + }else if(childTaskPlan.getDestroyReason().equals("故障")){
  1347 + ssgl_gz += childTaskPlan.getMileage();
  1348 + }else if(childTaskPlan.getDestroyReason().equals("纠纷")){
  1349 + ssgl_jf += childTaskPlan.getMileage();
  1350 + }else if(childTaskPlan.getDestroyReason().equals("肇事")){
  1351 + ssgl_zs += childTaskPlan.getMileage();
  1352 + }else if(childTaskPlan.getDestroyReason().equals("缺人")){
  1353 + ssgl_qr += childTaskPlan.getMileage();
  1354 + }else if(childTaskPlan.getDestroyReason().equals("缺车")){
  1355 + ssgl_qc += childTaskPlan.getMileage();
  1356 + }else if(childTaskPlan.getDestroyReason().equals("客稀")){
  1357 + ssgl_kx += childTaskPlan.getMileage();
  1358 + }else if(childTaskPlan.getDestroyReason().equals("气候")){
  1359 + ssgl_qh += childTaskPlan.getMileage();
  1360 + }else if(childTaskPlan.getDestroyReason().equals("援外")){
  1361 + ssgl_yw += childTaskPlan.getMileage();
  1362 + }else{
  1363 + ssgl_other += childTaskPlan.getMileage();
  1364 + }
  1365 + }else{
  1366 + sjgl += childMileage;
  1367 + }
1336 1368 }
1337 1369 }
1338   - }
1339   -
1340   - //班次
1341   - jhbc++;
1342   - String[] fcsj = scheduleRealInfo.getFcsj().split(":");
1343   - String[] fcsjActual = (scheduleRealInfo.getFcsjActual()==null?"0:00":scheduleRealInfo.getFcsjActual()).split(":");
1344   - if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_0 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_1){
1345   - jhbc_m++;
1346   - }else if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_2 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_3){
1347   - jhbc_a++;
1348   - }
1349   - if(scheduleRealInfo.getStatus() == 2){
1350   - sjbc++;
1351   - if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
1352   - sjbc_m++;
1353   - }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
1354   - sjbc_a++;
  1370 +
  1371 + //班次
  1372 + jhbc++;
  1373 + String[] fcsj = scheduleRealInfo.getFcsj().split(":");
  1374 + String[] fcsjActual = (scheduleRealInfo.getFcsjActual()==null?"0:00":scheduleRealInfo.getFcsjActual()).split(":");
  1375 + if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_0 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_1){
  1376 + jhbc_m++;
  1377 + }else if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_2 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_3){
  1378 + jhbc_a++;
1355 1379 }
1356   - }
1357   - if(scheduleRealInfo.isSflj()){
1358   - ljbc++;
1359   - if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
1360   - ljbc_m++;
1361   - }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
1362   - ljbc_a++;
  1380 + if(scheduleRealInfo.getStatus() == 2){
  1381 + sjbc++;
  1382 + if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
  1383 + sjbc_m++;
  1384 + }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
  1385 + sjbc_a++;
  1386 + }
1363 1387 }
1364   - }
1365   - if(scheduleRealInfo.getBcType().equals("venting")){
1366   - fzbc++;
1367   - if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
1368   - fzbc_m++;
1369   - }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
1370   - fzbc_a++;
  1388 + if(scheduleRealInfo.isSflj()){
  1389 + ljbc++;
  1390 + if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
  1391 + ljbc_m++;
  1392 + }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
  1393 + ljbc_a++;
  1394 + }
  1395 + }
  1396 + if(scheduleRealInfo.getBcType().equals("venting")){
  1397 + fzbc++;
  1398 + if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
  1399 + fzbc_m++;
  1400 + }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
  1401 + fzbc_a++;
  1402 + }
1371 1403 }
1372 1404 }
1373 1405 }
... ...
src/main/java/com/bsth/service/schedule/CarConfigInfoService.java
... ... @@ -6,6 +6,6 @@ import com.bsth.entity.schedule.CarConfigInfo;
6 6 * Created by xu on 16/5/9.
7 7 */
8 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;
  9 + void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException;
  10 + void toggleCancel(Long id) throws ScheduleException;
11 11 }
... ...
src/main/java/com/bsth/service/schedule/CarDeviceService.java 0 → 100644
  1 +package com.bsth.service.schedule;
  2 +
  3 +import com.bsth.entity.CarDevice;
  4 +
  5 +/**
  6 + * Created by xu on 16/12/15.
  7 + */
  8 +public interface CarDeviceService extends BService<CarDevice, Long> {
  9 + void validate_qyrq(CarDevice carDevice) throws ScheduleException;
  10 +}
... ...
src/main/java/com/bsth/service/schedule/EmployeeService.java 0 → 100644
  1 +package com.bsth.service.schedule;
  2 +
  3 +import com.bsth.entity.Personnel;
  4 +
  5 +/**
  6 + * Created by xu on 16/12/15.
  7 + */
  8 +public interface EmployeeService extends BService<Personnel, Integer> {
  9 + public void validate_gh(Personnel personnel) throws ScheduleException;
  10 +}
... ...
src/main/java/com/bsth/service/schedule/GuideboardInfoService.java
... ... @@ -6,6 +6,8 @@ import com.bsth.entity.schedule.GuideboardInfo;
6 6 * Created by xu on 16/5/11.
7 7 */
8 8 public interface GuideboardInfoService extends BService<GuideboardInfo, Long> {
9   - public void validate(GuideboardInfo guideboardInfo) throws ScheduleException;
  9 + public void validate_lpno(GuideboardInfo guideboardInfo) throws ScheduleException;
  10 + public void validate_lpname(GuideboardInfo guideboardInfo) throws ScheduleException;
10 11 public void toggleCancel(Long id) throws ScheduleException;
  12 +
11 13 }
... ...
src/main/java/com/bsth/service/schedule/RerunService.java
1 1 package com.bsth.service.schedule;
2 2  
3 3 import com.bsth.entity.schedule.rule.RerunRule;
4   -import com.bsth.service.BaseService;
5 4  
6 5 /**
7 6 * Created by xu on 16/10/20.
8 7 */
9   -public interface RerunService extends BaseService<RerunRule, Long> {
  8 +public interface RerunService extends BService<RerunRule, Long> {
10 9 }
... ...
src/main/java/com/bsth/service/schedule/RerunServiceImpl.java deleted 100644 → 0
1   -package com.bsth.service.schedule;
2   -
3   -import com.bsth.common.ResponseCode;
4   -import com.bsth.entity.schedule.rule.RerunRule;
5   -import com.bsth.repository.schedule.RerunRuleRepository;
6   -import com.bsth.service.impl.BaseServiceImpl;
7   -import org.springframework.beans.factory.annotation.Autowired;
8   -import org.springframework.stereotype.Service;
9   -
10   -import javax.transaction.Transactional;
11   -import java.util.HashMap;
12   -import java.util.Map;
13   -
14   -/**
15   - * Created by xu on 16/10/20.
16   - */
17   -@Service
18   -public class RerunServiceImpl extends BaseServiceImpl<RerunRule, Long> implements RerunService {
19   -
20   - @Autowired
21   - private RerunRuleRepository rerunRuleRepository;
22   -
23   - @Override
24   - @Transactional
25   - public Map<String, Object> delete(Long aLong) {
26   - // 获取带作废的数据
27   - RerunRule rerunRule = rerunRuleRepository.findOne(aLong);
28   -
29   - toogleIsCancel(rerunRule);
30   -
31   - Map<String, Object> map = new HashMap<>();
32   - map.put("status", ResponseCode.SUCCESS);
33   -
34   - return map;
35   -
36   - }
37   -
38   - /**
39   - * 撤销/作废切换。
40   - * @param rerunRule
41   - */
42   - private void toogleIsCancel(RerunRule rerunRule) {
43   - boolean isCancel = rerunRule.getIsCancel();
44   - if (isCancel) {
45   - rerunRule.setIsCancel(false);
46   - } else {
47   - rerunRule.setIsCancel(true);
48   - }
49   - }
50   -}
src/main/java/com/bsth/service/schedule/TTInfoService.java
1 1 package com.bsth.service.schedule;
2 2  
3 3 import com.bsth.entity.schedule.TTInfo;
4   -import com.bsth.service.BaseService;
5 4  
6 5 /**
7 6 * Created by xu on 16/5/12.
8 7 */
9   -public interface TTInfoService extends BaseService<TTInfo, Long> {
  8 +public interface TTInfoService extends BService<TTInfo, Long> {
  9 + void validate_name(TTInfo ttInfo) throws ScheduleException;
  10 + void validate_n_d(TTInfo ttInfo) throws ScheduleException;
  11 + void validate_s_d(TTInfo ttInfo) throws ScheduleException;
  12 + void toggleCancel(Long id) throws ScheduleException;
  13 +
10 14 }
... ...
src/main/java/com/bsth/service/schedule/TTInfoServiceImpl.java deleted 100644 → 0
1   -package com.bsth.service.schedule;
2   -
3   -import com.bsth.common.ResponseCode;
4   -import com.bsth.entity.schedule.TTInfo;
5   -import com.bsth.repository.schedule.TTInfoRepository;
6   -import com.bsth.service.impl.BaseServiceImpl;
7   -import org.springframework.beans.factory.annotation.Autowired;
8   -import org.springframework.stereotype.Service;
9   -
10   -import javax.transaction.Transactional;
11   -import java.util.HashMap;
12   -import java.util.Map;
13   -
14   -/**
15   - * Created by xu on 16/5/12.
16   - */
17   -@Service
18   -@Transactional
19   -public class TTInfoServiceImpl extends BaseServiceImpl<TTInfo, Long> implements TTInfoService {
20   - @Autowired
21   - private TTInfoRepository ttInfoRepository;
22   -
23   - @Transactional
24   - @Override
25   - public Map<String, Object> delete(Long aLong) {
26   - // 获取待作废的数据
27   - TTInfo ttInfo = ttInfoRepository.findOne(aLong);
28   -
29   - toogleIsCancel(ttInfo);
30   -
31   - Map<String, Object> map = new HashMap<>();
32   - map.put("status", ResponseCode.SUCCESS);
33   -
34   - return map;
35   - }
36   -
37   -
38   -
39   - private void toogleIsCancel(TTInfo ttInfo) {
40   - boolean isCancel = ttInfo.getIsCancel();
41   - if (isCancel) {
42   - ttInfo.setIsCancel(false);
43   - } else {
44   - ttInfo.setIsCancel(true);
45   - }
46   - }
47   -}
src/main/java/com/bsth/service/schedule/impl/CarConfigInfoServiceImpl.java
... ... @@ -36,12 +36,14 @@ public class CarConfigInfoServiceImpl extends BServiceImpl&lt;CarConfigInfo, Long&gt;
36 36 throw new ScheduleException("线路未选择");
37 37 } else {
38 38 // param.put("xl.id_eq", carConfigInfo.getXl().getId());
  39 + param.put("isCancel_eq", false);
39 40 if (carConfigInfo.getCl() == null || carConfigInfo.getCl().getId() == null) {
40 41 throw new ScheduleException("车辆未选择");
41 42 } else {
42 43 param.put("cl.id_eq", carConfigInfo.getCl().getId());
43   - if (!CollectionUtils.isEmpty(list(param))) {
44   - throw new ScheduleException("车辆已经配置在" + carConfigInfo.getXl().getName() + "线路中!");
  44 + List<CarConfigInfo> carConfigInfos = list(param);
  45 + if (!CollectionUtils.isEmpty(carConfigInfos)) {
  46 + throw new ScheduleException("车辆已经配置在" + carConfigInfos.get(0).getXl().getName() + "线路中!");
45 47 }
46 48 }
47 49 }
... ...
src/main/java/com/bsth/service/schedule/impl/CarDeviceServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.CarDevice;
  4 +import com.bsth.entity.Cars;
  5 +import com.bsth.service.CarsService;
  6 +import com.bsth.service.schedule.CarDeviceService;
  7 +import com.bsth.service.schedule.ScheduleException;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Service;
  10 +import org.springframework.transaction.annotation.Transactional;
  11 +import org.springframework.util.CollectionUtils;
  12 +
  13 +import java.util.HashMap;
  14 +import java.util.Map;
  15 +
  16 +/**
  17 + * Created by xu on 16/12/15.
  18 + */
  19 +@Service(value = "carDeviceServiceImpl_sc")
  20 +public class CarDeviceServiceImpl extends BServiceImpl<CarDevice, Long> implements CarDeviceService {
  21 + @Autowired
  22 + private CarsService carsService;
  23 +
  24 + @Transactional
  25 + @Override
  26 + public CarDevice save(CarDevice carDevice) {
  27 + // 查找对应的车辆基础信息,更新设备编号数据
  28 + Cars cars = carsService.findById(carDevice.getCl());
  29 + cars.setEquipmentCode(carDevice.getNewDeviceNo());
  30 + return super.save(carDevice);
  31 + }
  32 +
  33 + @Transactional
  34 + @Override
  35 + public void validate_qyrq(CarDevice carDevice) throws ScheduleException {
  36 + if (carDevice.getXl() == null) {
  37 + throw new ScheduleException("线路未选择");
  38 + }
  39 + if (carDevice.getCl() == null) {
  40 + throw new ScheduleException("车辆未选择");
  41 + }
  42 + Map<String, Object> param = new HashMap<>();
  43 + if (carDevice.getId() != null) {
  44 + param.put("id_ne", carDevice.getId());
  45 + }
  46 + param.put("xl_eq", carDevice.getXl());
  47 + param.put("cl_eq", carDevice.getCl());
  48 + param.put("qyrq_ge", carDevice.getQyrq());
  49 + if (!CollectionUtils.isEmpty(list(param))) {
  50 + throw new ScheduleException("启用日期必须比历史的启用日期大");
  51 + }
  52 + }
  53 +
  54 + @Transactional
  55 + @Override
  56 + public void delete(Long aLong) throws ScheduleException {
  57 + toggleCancel(aLong);
  58 + }
  59 +
  60 + @Transactional
  61 + public void toggleCancel(Long id) throws ScheduleException {
  62 + CarDevice carDevice = findById(id);
  63 + if (carDevice.getIsCancel()) {
  64 + carDevice.setIsCancel(false);
  65 + } else {
  66 + carDevice.setIsCancel(true);
  67 + }
  68 + }
  69 +}
... ...
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
... ... @@ -34,12 +34,15 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl&lt;EmployeeConfigIn
34 34 employeeConfigInfo.getXl().getName() == null) {
35 35 throw new ScheduleException("线路未选择");
36 36 } else {
  37 +// param.put("xl.id_eq", employeeConfigInfo.getXl().getId());
  38 + param.put("isCancel_eq", false);
37 39 if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) {
38 40 throw new ScheduleException("驾驶员未选择");
39 41 } else {
40 42 param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId());
  43 + List<EmployeeConfigInfo> employeeConfigInfos = list(param);
41 44 if (!CollectionUtils.isEmpty(list(param))) {
42   - throw new ScheduleException("驾驶员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!");
  45 + throw new ScheduleException("驾驶员已经配置在" + employeeConfigInfos.get(0).getXl().getName() + "线路中!");
43 46 }
44 47 }
45 48 }
... ... @@ -59,12 +62,14 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl&lt;EmployeeConfigIn
59 62 employeeConfigInfo.getXl().getName() == null) {
60 63 throw new ScheduleException("线路未选择");
61 64 } else {
  65 +// param.put("xl.id_eq", employeeConfigInfo.getXl().getId());
62 66 if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) {
63 67 throw new ScheduleException("售票员未选择");
64 68 } else {
65 69 param.put("spy.id_eq", employeeConfigInfo.getSpy().getId());
  70 + List<EmployeeConfigInfo> employeeConfigInfos = list(param);
66 71 if (!CollectionUtils.isEmpty(list(param))) {
67   - throw new ScheduleException("售票员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!");
  72 + throw new ScheduleException("售票员已经配置在" + employeeConfigInfos.get(0).getXl().getName() + "线路中!");
68 73 }
69 74 }
70 75 }
... ... @@ -83,7 +88,9 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl&lt;EmployeeConfigIn
83 88 Map<String, Object> param = new HashMap<>();
84 89 if (employeeConfigInfo.getIsCancel()) {
85 90 validate_jsy(employeeConfigInfo);
86   - validate_spy(employeeConfigInfo);
  91 + if (employeeConfigInfo.getSpy() != null) {
  92 + validate_spy(employeeConfigInfo);
  93 + }
87 94 employeeConfigInfo.setIsCancel(false);
88 95 } else {
89 96 param.clear();
... ...
src/main/java/com/bsth/service/schedule/impl/EmployeeServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.Personnel;
  4 +import com.bsth.service.schedule.EmployeeService;
  5 +import com.bsth.service.schedule.ScheduleException;
  6 +import org.springframework.stereotype.Service;
  7 +import org.springframework.transaction.annotation.Transactional;
  8 +import org.springframework.util.CollectionUtils;
  9 +
  10 +import java.util.HashMap;
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * Created by xu on 16/12/15.
  15 + */
  16 +@Service
  17 +public class EmployeeServiceImpl extends BServiceImpl<Personnel, Integer> implements EmployeeService {
  18 + @Override
  19 + @Transactional
  20 + public void validate_gh(Personnel personnel) throws ScheduleException {
  21 + // 查询条件
  22 + Map<String, Object> param = new HashMap<>();
  23 + if (personnel.getId() != null) {
  24 + param.put("id_ne", personnel.getId());
  25 + }
  26 + param.put("companyCode_eq", personnel.getCompanyCode());
  27 + param.put("jobCode_eq", personnel.getJobCode());
  28 + if (!CollectionUtils.isEmpty(list(param))) {
  29 + throw new ScheduleException("相同公司工号重复");
  30 + }
  31 + }
  32 +}
... ...
src/main/java/com/bsth/service/schedule/impl/GuideboardInfoServiceImpl.java
... ... @@ -22,52 +22,44 @@ public class GuideboardInfoServiceImpl extends BServiceImpl&lt;GuideboardInfo, Long
22 22 @Autowired
23 23 private TTInfoDetailService ttInfoDetailService;
24 24  
25   - // 验证方法
26   - @Transactional
27   - public void validate(GuideboardInfo guideboardInfo) throws ScheduleException {
  25 + @Override
  26 + public void validate_lpno(GuideboardInfo guideboardInfo) throws ScheduleException {
28 27 // 查询条件
29 28 Map<String, Object> param = new HashMap<>();
30   - if (guideboardInfo.getId() != null)
  29 + if (guideboardInfo.getId() != null) {
31 30 param.put("id_ne", guideboardInfo.getId());
  31 + }
32 32  
33 33 if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) {
34 34 throw new ScheduleException("线路未选择");
35 35 } else {
  36 + param.put("isCancel_eq", false); // 作废的也算入判定区
36 37 param.put("xl.id_eq", guideboardInfo.getXl().getId());
  38 + param.put("lpNo_eq", guideboardInfo.getLpNo());
  39 + if (!CollectionUtils.isEmpty(list(param))) {
  40 + throw new ScheduleException("路牌编号重复");
  41 + }
  42 + }
  43 + }
37 44  
38   -// param.put("isCancel_eq", false); // 作废的也算入判定区
39   - if (guideboardInfo.getLpNo() != null) {
40   - if (guideboardInfo.getLpName() != null) {
41   - // 如果两个都写了,分开查询
42   - param.put("lpNo_eq", guideboardInfo.getLpNo());
43   - if (!CollectionUtils.isEmpty(list(param))) {
44   - throw new ScheduleException("路牌编号重复");
45   - }
46   - param.remove("lpNo_eq");
47   - param.put("lpName_eq", guideboardInfo.getLpName());
48   - if (!CollectionUtils.isEmpty(list(param))) {
49   - throw new ScheduleException("路牌名称重复");
50   - }
  45 + @Override
  46 + public void validate_lpname(GuideboardInfo guideboardInfo) throws ScheduleException {
  47 + // 查询条件
  48 + Map<String, Object> param = new HashMap<>();
  49 + if (guideboardInfo.getId() != null) {
  50 + param.put("id_ne", guideboardInfo.getId());
  51 + }
51 52  
52   - } else {
53   - param.put("lpNo_eq", guideboardInfo.getLpNo());
54   - if (!CollectionUtils.isEmpty(list(param))) {
55   - throw new ScheduleException("路牌编号重复");
56   - }
57   - }
58   - } else {
59   - if (guideboardInfo.getLpName() != null) {
60   - param.put("lpName_eq", guideboardInfo.getLpName());
61   - if (!CollectionUtils.isEmpty(list(param))) {
62   - throw new ScheduleException("路牌名字重复");
63   - }
64   - } else {
65   - // 都为空
66   - throw new ScheduleException("路牌编号名字都为空");
67   - }
  53 + if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) {
  54 + throw new ScheduleException("线路未选择");
  55 + } else {
  56 + param.put("isCancel_eq", false); // 作废的也算入判定区
  57 + param.put("xl.id_eq", guideboardInfo.getXl().getId());
  58 + param.put("lpName_eq", guideboardInfo.getLpName());
  59 + if (!CollectionUtils.isEmpty(list(param))) {
  60 + throw new ScheduleException("路牌名字重复");
68 61 }
69 62 }
70   -
71 63 }
72 64  
73 65 @Transactional
... ... @@ -83,7 +75,8 @@ public class GuideboardInfoServiceImpl extends BServiceImpl&lt;GuideboardInfo, Long
83 75 GuideboardInfo guideboardInfo = findById(id);
84 76 Map<String, Object> param = new HashMap<>();
85 77 if (guideboardInfo.getIsCancel()) {
86   - validate(guideboardInfo);
  78 + validate_lpno(guideboardInfo);
  79 + validate_lpname(guideboardInfo);
87 80 guideboardInfo.setIsCancel(false);
88 81 } else {
89 82 param.clear();
... ... @@ -96,7 +89,7 @@ public class GuideboardInfoServiceImpl extends BServiceImpl&lt;GuideboardInfo, Long
96 89 } else {
97 90 throw new ScheduleException("在时刻表" +
98 91 ttInfoDetailList.get(0).getTtinfo().getName() +
99   - "已使用,无法删除!");
  92 + "已使用,无法作废!");
100 93 }
101 94 }
102 95 }
... ...
src/main/java/com/bsth/service/schedule/impl/RerunServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.schedule.rule.RerunRule;
  4 +import com.bsth.service.schedule.RerunService;
  5 +import com.bsth.service.schedule.ScheduleException;
  6 +import org.springframework.stereotype.Service;
  7 +import org.springframework.transaction.annotation.Transactional;
  8 +
  9 +/**
  10 + * Created by xu on 16/10/20.
  11 + */
  12 +@Service
  13 +public class RerunServiceImpl extends BServiceImpl<RerunRule, Long> implements RerunService {
  14 +
  15 + @Transactional
  16 + @Override
  17 + public void delete(Long aLong) throws ScheduleException {
  18 + toggleCancel(aLong);
  19 + }
  20 +
  21 + private void toggleCancel(Long id) throws ScheduleException {
  22 + RerunRule rerunRule = findById(id);
  23 + if (rerunRule.getIsCancel()) {
  24 + rerunRule.setIsCancel(false);
  25 + } else {
  26 + rerunRule.setIsCancel(true);
  27 + }
  28 + }
  29 +}
... ...
src/main/java/com/bsth/service/schedule/impl/TTInfoServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.schedule.TTInfo;
  4 +import com.bsth.service.schedule.ScheduleException;
  5 +import com.bsth.service.schedule.TTInfoService;
  6 +import org.apache.commons.lang3.StringUtils;
  7 +import org.springframework.stereotype.Service;
  8 +import org.springframework.transaction.annotation.Transactional;
  9 +import org.springframework.util.CollectionUtils;
  10 +
  11 +import java.util.HashMap;
  12 +import java.util.List;
  13 +import java.util.Map;
  14 +
  15 +/**
  16 + * Created by xu on 16/12/20.
  17 + */
  18 +@Service
  19 +public class TTInfoServiceImpl extends BServiceImpl<TTInfo, Long> implements TTInfoService {
  20 +
  21 + @Override
  22 + public void validate_name(TTInfo ttInfo) throws ScheduleException {
  23 + // 名字重复验证
  24 + Map<String, Object> param = new HashMap<>();
  25 + if (ttInfo.getId() != null) {
  26 + param.put("id_ne", ttInfo.getId());
  27 + }
  28 + param.put("xl.id_eq", ttInfo.getXl().getId());
  29 + param.put("name_eq", ttInfo.getName());
  30 +
  31 + if (!CollectionUtils.isEmpty(list(param))) {
  32 + throw new ScheduleException("名字重复");
  33 + }
  34 + }
  35 +
  36 + @Override
  37 + public void validate_n_d(TTInfo ttInfo) throws ScheduleException {
  38 + // 常规有效日重复验证
  39 + // 找出所有未作废,已启用的时刻表,验证
  40 + Map<String, Object> param = new HashMap<>();
  41 + if (ttInfo.getId() != null) {
  42 + param.put("id_ne", ttInfo.getId());
  43 + }
  44 + param.put("xl.id_eq", ttInfo.getXl().getId());
  45 + param.put("isCancel_eq", false);
  46 + param.put("isEnableDisTemplate_eq", true);
  47 + List<TTInfo> ttInfos = list(param);
  48 + if (StringUtils.isEmpty(ttInfo.getRule_days())) {
  49 + throw new ScheduleException("常规有效日为空");
  50 + } else {
  51 + String[] nds = ttInfo.getRule_days().split(",");
  52 + for (TTInfo t : ttInfos) {
  53 + String[] nds_e = t.getRule_days().split(",");
  54 + for (int i = 0; i < 7; i++) {
  55 + if ("0".equals(nds[i])) {
  56 + //
  57 + } else {
  58 + if (nds[i].equals(nds_e[i])) {
  59 + throw new ScheduleException("当前常规有效日期已经使用");
  60 + }
  61 + }
  62 + }
  63 + }
  64 + }
  65 + }
  66 +
  67 + @Override
  68 + public void validate_s_d(TTInfo ttInfo) throws ScheduleException {
  69 + // 特殊有效日重复验证
  70 + // 找出所有未作废,已启用的时刻表,验证
  71 + Map<String, Object> param = new HashMap<>();
  72 + if (ttInfo.getId() != null) {
  73 + param.put("id_ne", ttInfo.getId());
  74 + }
  75 +
  76 + param.put("xl.id_eq", ttInfo.getXl().getId());
  77 + param.put("isCancel_eq", false);
  78 + param.put("isEnableDisTemplate_eq", true);
  79 + List<TTInfo> ttInfos = list(param);
  80 + if (StringUtils.isEmpty(ttInfo.getSpecial_days())) {
  81 + //
  82 + } else {
  83 + String[] sds = ttInfo.getSpecial_days().split(",");
  84 + for (TTInfo t : ttInfos) {
  85 + if (StringUtils.isEmpty(t.getSpecial_days())) {
  86 + //
  87 + } else {
  88 + for (String sd : sds) {
  89 + if (t.getSpecial_days().indexOf(sd) != -1) {
  90 + throw new ScheduleException("当前特殊日期已经使用");
  91 + }
  92 + }
  93 + }
  94 + }
  95 + }
  96 + }
  97 +
  98 +
  99 + @Transactional
  100 + @Override
  101 + public void delete(Long aLong) throws ScheduleException {
  102 + toggleCancel(aLong);
  103 + }
  104 +
  105 + @Transactional
  106 + @Override
  107 + public void toggleCancel(Long id) throws ScheduleException {
  108 + TTInfo ttInfo = findById(id);
  109 + if (ttInfo.getIsCancel()) {
  110 + ttInfo.setIsCancel(false);
  111 + } else {
  112 + ttInfo.setIsCancel(true);
  113 + }
  114 + }
  115 +}
... ...
src/main/resources/application-dev.properties
... ... @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 8 spring.jpa.database= MYSQL
9 9 spring.jpa.show-sql= true
10 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11   -spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  11 +spring.datasource.url= jdbc:mysql://127.0.0.1/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 12 spring.datasource.username= root
13   -spring.datasource.password= 123456
  13 +spring.datasource.password=
14 14 #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
15 15 #spring.datasource.username= root
16 16 #spring.datasource.password= root
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInput.ktr
... ... @@ -116,6 +116,27 @@
116 116 <bordercolorblue>100</bordercolorblue>
117 117 <drawshadow>Y</drawshadow>
118 118 </notepad>
  119 + <notepad>
  120 + <note>&#x8fd9;&#x91cc;&#x6709;&#x4e9b;&#x95ee;&#x9898;&#xa;&#x5728;window2012&#x7684;&#x73af;&#x5883;&#x4e0b;&#xff0c;&#xa;MySql&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x4e2d;&#x5982;&#x679c;&#x8fd4;&#x56de;&#x4e2d;&#x6587;&#x5185;&#x5bb9;&#x7684;&#x5b57;&#x6bb5;&#xff0c;&#x8fd9;&#x4e2a;&#x5185;&#x5bb9;&#x4e71;&#x7801;&#xa;&#x89e3;&#x51b3;&#x529e;&#x6cd5;&#xff0c;&#x5c31;&#x662f;&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x5168;&#x90e8;&#x7f13;&#x5b58;&#xff0c;&#x5c31;&#x4e0d;&#x4e71;&#x7801;&#xa;linux&#x73af;&#x5883;&#x4e0b;&#x6ca1;&#x95ee;&#x9898;</note>
  121 + <xloc>721</xloc>
  122 + <yloc>762</yloc>
  123 + <width>333</width>
  124 + <heigth>90</heigth>
  125 + <fontname>YaHei Consolas Hybrid</fontname>
  126 + <fontsize>12</fontsize>
  127 + <fontbold>N</fontbold>
  128 + <fontitalic>N</fontitalic>
  129 + <fontcolorred>0</fontcolorred>
  130 + <fontcolorgreen>0</fontcolorgreen>
  131 + <fontcolorblue>0</fontcolorblue>
  132 + <backgroundcolorred>255</backgroundcolorred>
  133 + <backgroundcolorgreen>205</backgroundcolorgreen>
  134 + <backgroundcolorblue>112</backgroundcolorblue>
  135 + <bordercolorred>100</bordercolorred>
  136 + <bordercolorgreen>100</bordercolorgreen>
  137 + <bordercolorblue>100</bordercolorblue>
  138 + <drawshadow>Y</drawshadow>
  139 + </notepad>
119 140 </notepads>
120 141 <connection>
121 142 <name>bus_control_variable</name>
... ... @@ -130,6 +151,7 @@
130 151 <data_tablespace/>
131 152 <index_tablespace/>
132 153 <attributes>
  154 + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
133 155 <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
134 156 <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
135 157 <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
... ... @@ -437,7 +459,7 @@
437 459 <optimizationLevel>9</optimizationLevel>
438 460 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
439 461 <jsScript_name>Script 1</jsScript_name>
440   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var cc_groups &#x3d; qdzgroups.split&#x28;&#x22;,&#x22;&#x29;&#x3b; &#x2f;&#x2f; &#x6240;&#x6709;&#x73ed;&#x6b21;&#x8d77;&#x70b9;&#x7ad9;&#x6570;&#x7ec4;&#xa;var zdzname &#x3d; cc_groups&#x5b;gno&#x5d;&#x3b; &#x2f;&#x2f; &#x51fa;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#x662f;&#x4e0b;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x59cb;&#x7ad9;&#xa;var endZdtype &#x3d; &#x27;E&#x27;&#x3b;</jsScript_script>
  462 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var cc_groups &#x3d; qdzgroups.split&#x28;&#x22;,&#x22;&#x29;&#x3b; &#x2f;&#x2f; &#x6240;&#x6709;&#x73ed;&#x6b21;&#x8d77;&#x70b9;&#x7ad9;&#x6570;&#x7ec4;&#xa;var zdzname &#x3d; cc_groups&#x5b;gno&#x5d;&#x3b; &#x2f;&#x2f; &#x51fa;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#x662f;&#x4e0b;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x59cb;&#x7ad9;&#xa;var endZdtype &#x3d; &#x27;E&#x27;&#x3b;&#xa;&#xa;var destory &#x3d; 0&#x3b; &#x2f;&#x2f; &#x672a;&#x64a4;&#x9500;flag</jsScript_script>
441 463 </jsScript> </jsScripts> <fields> <field> <name>zdzname</name>
442 464 <rename>zdzname</rename>
443 465 <type>String</type>
... ... @@ -450,6 +472,12 @@
450 472 <length>-1</length>
451 473 <precision>-1</precision>
452 474 <replace>N</replace>
  475 + </field> <field> <name>destory</name>
  476 + <rename>destory</rename>
  477 + <type>Integer</type>
  478 + <length>-1</length>
  479 + <precision>-1</precision>
  480 + <replace>N</replace>
453 481 </field> </fields> <cluster_schema/>
454 482 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
455 483 <xloc>575</xloc>
... ... @@ -1341,6 +1369,12 @@
1341 1369 <condition>&#x3d;</condition>
1342 1370 <name2/>
1343 1371 </key>
  1372 + <key>
  1373 + <name>destory</name>
  1374 + <field>destroy</field>
  1375 + <condition>&#x3d;</condition>
  1376 + <name2/>
  1377 + </key>
1344 1378 <value>
1345 1379 <name>station</name>
1346 1380 <rename>zdzid</rename>
... ... @@ -1677,6 +1711,12 @@
1677 1711 <condition>&#x3d;</condition>
1678 1712 <name2/>
1679 1713 </key>
  1714 + <key>
  1715 + <name>destory</name>
  1716 + <field>destroy</field>
  1717 + <condition>&#x3d;</condition>
  1718 + <name2/>
  1719 + </key>
1680 1720 <value>
1681 1721 <name>station_name</name>
1682 1722 <rename>zdzname</rename>
... ... @@ -1737,6 +1777,12 @@
1737 1777 <condition>&#x3d;</condition>
1738 1778 <name2/>
1739 1779 </key>
  1780 + <key>
  1781 + <name>destory</name>
  1782 + <field>destroy</field>
  1783 + <condition>&#x3d;</condition>
  1784 + <name2/>
  1785 + </key>
1740 1786 <value>
1741 1787 <name>station</name>
1742 1788 <rename>qdzid</rename>
... ... @@ -1845,6 +1891,12 @@
1845 1891 <condition>&#x3d;</condition>
1846 1892 <name2/>
1847 1893 </key>
  1894 + <key>
  1895 + <name>destory</name>
  1896 + <field>destroy</field>
  1897 + <condition>&#x3d;</condition>
  1898 + <name2/>
  1899 + </key>
1848 1900 <value>
1849 1901 <name>directions</name>
1850 1902 <rename>sxx</rename>
... ... @@ -1872,8 +1924,8 @@
1872 1924 <schema_name/>
1873 1925 </partitioning>
1874 1926 <connection>bus_control_variable</connection>
1875   - <cache>N</cache>
1876   - <cache_load_all>N</cache_load_all>
  1927 + <cache>Y</cache>
  1928 + <cache_load_all>Y</cache_load_all>
1877 1929 <cache_size>0</cache_size>
1878 1930 <lookup>
1879 1931 <schema/>
... ... @@ -1899,6 +1951,12 @@
1899 1951 <condition>&#x3d;</condition>
1900 1952 <name2/>
1901 1953 </key>
  1954 + <key>
  1955 + <name>destory</name>
  1956 + <field>destroy</field>
  1957 + <condition>&#x3d;</condition>
  1958 + <name2/>
  1959 + </key>
1902 1960 <value>
1903 1961 <name>station_name</name>
1904 1962 <rename>zdzname_calcu</rename>
... ... @@ -1953,6 +2011,12 @@
1953 2011 <condition>&#x3d;</condition>
1954 2012 <name2/>
1955 2013 </key>
  2014 + <key>
  2015 + <name>destory</name>
  2016 + <field>destroy</field>
  2017 + <condition>&#x3d;</condition>
  2018 + <name2/>
  2019 + </key>
1956 2020 <value>
1957 2021 <name>directions</name>
1958 2022 <rename>sxx2</rename>
... ... @@ -1989,7 +2053,7 @@
1989 2053 <optimizationLevel>9</optimizationLevel>
1990 2054 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
1991 2055 <jsScript_name>Script 1</jsScript_name>
1992   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var sendZdtype &#x3d; &#x27;B&#x27;&#x3b;&#xa;var endZdtype &#x3d; &#x27;E&#x27;&#x3b;&#xa;</jsScript_script>
  2056 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var sendZdtype &#x3d; &#x27;B&#x27;&#x3b;&#xa;var endZdtype &#x3d; &#x27;E&#x27;&#x3b;&#xa;&#xa;var destory &#x3d; 0&#x3b; &#x2f;&#x2f; &#x672a;&#x64a4;&#x9500;flag</jsScript_script>
1993 2057 </jsScript> </jsScripts> <fields> <field> <name>sendZdtype</name>
1994 2058 <rename>sendZdtype</rename>
1995 2059 <type>String</type>
... ... @@ -2002,6 +2066,12 @@
2002 2066 <length>-1</length>
2003 2067 <precision>-1</precision>
2004 2068 <replace>N</replace>
  2069 + </field> <field> <name>destory</name>
  2070 + <rename>destory</rename>
  2071 + <type>Integer</type>
  2072 + <length>-1</length>
  2073 + <precision>-1</precision>
  2074 + <replace>N</replace>
2005 2075 </field> </fields> <cluster_schema/>
2006 2076 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2007 2077 <xloc>588</xloc>
... ... @@ -2539,7 +2609,7 @@
2539 2609 <optimizationLevel>9</optimizationLevel>
2540 2610 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
2541 2611 <jsScript_name>Script 1</jsScript_name>
2542   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var cc_groups &#x3d; qdzgroups.split&#x28;&#x22;,&#x22;&#x29;&#x3b; &#x2f;&#x2f; &#x6240;&#x6709;&#x73ed;&#x6b21;&#x8d77;&#x70b9;&#x7ad9;&#x6570;&#x7ec4;&#xa;var qdzname_calcu &#x3d; cc_groups&#x5b;gno - 2&#x5d;&#x3b; &#x2f;&#x2f; &#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;&#x662f;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x8fd9;&#x91cc;&#x53ea;&#x6709;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;&#xff0c;&#x8fd8;&#x9700;&#x8981;&#x8ba1;&#x7b97;&#xa;var startZdtype_calcu &#x3d; &#x27;B&#x27;&#x3b;&#xa;var endZdtype_calcu &#x3d; &#x27;E&#x27;&#x3b;</jsScript_script>
  2612 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x6dfb;&#x52a0;&#x7ad9;&#x70b9;&#x6807;&#x8bc6;&#xa;var cc_groups &#x3d; qdzgroups.split&#x28;&#x22;,&#x22;&#x29;&#x3b; &#x2f;&#x2f; &#x6240;&#x6709;&#x73ed;&#x6b21;&#x8d77;&#x70b9;&#x7ad9;&#x6570;&#x7ec4;&#xa;var qdzname_calcu &#x3d; cc_groups&#x5b;gno - 2&#x5d;&#x3b; &#x2f;&#x2f; &#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;&#x662f;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x8fd9;&#x91cc;&#x53ea;&#x6709;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;&#xff0c;&#x8fd8;&#x9700;&#x8981;&#x8ba1;&#x7b97;&#xa;var startZdtype_calcu &#x3d; &#x27;B&#x27;&#x3b;&#xa;var endZdtype_calcu &#x3d; &#x27;E&#x27;&#x3b;&#xa;&#xa;var destory &#x3d; 0&#x3b; &#x2f;&#x2f; &#x672a;&#x64a4;&#x9500;flag</jsScript_script>
2543 2613 </jsScript> </jsScripts> <fields> <field> <name>qdzname_calcu</name>
2544 2614 <rename>qdzname_calcu</rename>
2545 2615 <type>String</type>
... ... @@ -2558,6 +2628,12 @@
2558 2628 <length>-1</length>
2559 2629 <precision>-1</precision>
2560 2630 <replace>N</replace>
  2631 + </field> <field> <name>destory</name>
  2632 + <rename>destory</rename>
  2633 + <type>Integer</type>
  2634 + <length>-1</length>
  2635 + <precision>-1</precision>
  2636 + <replace>N</replace>
2561 2637 </field> </fields> <cluster_schema/>
2562 2638 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2563 2639 <xloc>754</xloc>
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataOutput.ktr
... ... @@ -74,6 +74,27 @@
74 74 <is_key_private>N</is_key_private>
75 75 </info>
76 76 <notepads>
  77 + <notepad>
  78 + <note>&#x8fd9;&#x91cc;&#x6709;&#x4e9b;&#x95ee;&#x9898;&#xa;&#x5728;window2012&#x7684;&#x73af;&#x5883;&#x4e0b;&#xff0c;&#xa;MySql&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x4e2d;&#x5982;&#x679c;&#x8fd4;&#x56de;&#x4e2d;&#x6587;&#x5185;&#x5bb9;&#x7684;&#x5b57;&#x6bb5;&#xff0c;&#x8fd9;&#x4e2a;&#x5185;&#x5bb9;&#x4e71;&#x7801;&#xa;&#x89e3;&#x51b3;&#x529e;&#x6cd5;&#xff0c;&#x5c31;&#x662f;&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x5168;&#x90e8;&#x7f13;&#x5b58;&#xff0c;&#x5c31;&#x4e0d;&#x4e71;&#x7801;&#xa;linux&#x73af;&#x5883;&#x4e0b;&#x6ca1;&#x95ee;&#x9898;</note>
  79 + <xloc>114</xloc>
  80 + <yloc>227</yloc>
  81 + <width>333</width>
  82 + <heigth>90</heigth>
  83 + <fontname>YaHei Consolas Hybrid</fontname>
  84 + <fontsize>12</fontsize>
  85 + <fontbold>N</fontbold>
  86 + <fontitalic>N</fontitalic>
  87 + <fontcolorred>0</fontcolorred>
  88 + <fontcolorgreen>0</fontcolorgreen>
  89 + <fontcolorblue>0</fontcolorblue>
  90 + <backgroundcolorred>255</backgroundcolorred>
  91 + <backgroundcolorgreen>205</backgroundcolorgreen>
  92 + <backgroundcolorblue>112</backgroundcolorblue>
  93 + <bordercolorred>100</bordercolorred>
  94 + <bordercolorgreen>100</bordercolorgreen>
  95 + <bordercolorblue>100</bordercolorblue>
  96 + <drawshadow>Y</drawshadow>
  97 + </notepad>
77 98 </notepads>
78 99 <connection>
79 100 <name>bus_control_variable</name>
... ... @@ -88,6 +109,7 @@
88 109 <data_tablespace/>
89 110 <index_tablespace/>
90 111 <attributes>
  112 + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
91 113 <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
92 114 <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
93 115 <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
... ... @@ -243,6 +265,73 @@
243 265 <hop> <from>&#x8def;&#x724c;&#x540d;&#x5b57;&#x67e5;&#x627e;</from><to>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>
244 266 </order>
245 267 <step>
  268 + <name>Excel&#x8f93;&#x51fa;</name>
  269 + <type>ExcelOutput</type>
  270 + <description/>
  271 + <distribute>Y</distribute>
  272 + <custom_distribution/>
  273 + <copies>1</copies>
  274 + <partitioning>
  275 + <method>none</method>
  276 + <schema_name/>
  277 + </partitioning>
  278 + <header>Y</header>
  279 + <footer>N</footer>
  280 + <encoding/>
  281 + <append>N</append>
  282 + <add_to_result_filenames>Y</add_to_result_filenames>
  283 + <file>
  284 + <name>&#x24;&#x7b;filepath&#x7d;</name>
  285 + <extention/>
  286 + <do_not_open_newfile_init>N</do_not_open_newfile_init>
  287 + <create_parent_folder>N</create_parent_folder>
  288 + <split>N</split>
  289 + <add_date>N</add_date>
  290 + <add_time>N</add_time>
  291 + <SpecifyFormat>N</SpecifyFormat>
  292 + <date_time_format/>
  293 + <sheetname>Sheet1</sheetname>
  294 + <autosizecolums>N</autosizecolums>
  295 + <nullisblank>N</nullisblank>
  296 + <protect_sheet>N</protect_sheet>
  297 + <password>Encrypted </password>
  298 + <splitevery>0</splitevery>
  299 + <usetempfiles>N</usetempfiles>
  300 + <tempdirectory/>
  301 + </file>
  302 + <template>
  303 + <enabled>N</enabled>
  304 + <append>N</append>
  305 + <filename>template.xls</filename>
  306 + </template>
  307 + <fields>
  308 + </fields>
  309 + <custom>
  310 + <header_font_name>arial</header_font_name>
  311 + <header_font_size>10</header_font_size>
  312 + <header_font_bold>N</header_font_bold>
  313 + <header_font_italic>N</header_font_italic>
  314 + <header_font_underline>no</header_font_underline>
  315 + <header_font_orientation>horizontal</header_font_orientation>
  316 + <header_font_color>black</header_font_color>
  317 + <header_background_color>none</header_background_color>
  318 + <header_row_height>255</header_row_height>
  319 + <header_alignment>left</header_alignment>
  320 + <header_image/>
  321 + <row_font_name>arial</row_font_name>
  322 + <row_font_size>10</row_font_size>
  323 + <row_font_color>black</row_font_color>
  324 + <row_background_color>none</row_background_color>
  325 + </custom>
  326 + <cluster_schema/>
  327 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  328 + <xloc>731</xloc>
  329 + <yloc>65</yloc>
  330 + <draw>Y</draw>
  331 + </GUI>
  332 + </step>
  333 +
  334 + <step>
246 335 <name>&#x5217;&#x8f6c;&#x884c;</name>
247 336 <type>Denormaliser</type>
248 337 <description/>
... ... @@ -368,6 +457,30 @@
368 457 </step>
369 458  
370 459 <step>
  460 + <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
  461 + <type>SelectValues</type>
  462 + <description/>
  463 + <distribute>Y</distribute>
  464 + <custom_distribution/>
  465 + <copies>1</copies>
  466 + <partitioning>
  467 + <method>none</method>
  468 + <schema_name/>
  469 + </partitioning>
  470 + <fields> <field> <name>lp_name</name>
  471 + <rename>&#x8def;&#x724c;</rename>
  472 + <length>-2</length>
  473 + <precision>-2</precision>
  474 + </field> <select_unspecified>Y</select_unspecified>
  475 + </fields> <cluster_schema/>
  476 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  477 + <xloc>534</xloc>
  478 + <yloc>243</yloc>
  479 + <draw>Y</draw>
  480 + </GUI>
  481 + </step>
  482 +
  483 + <step>
371 484 <name>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</name>
372 485 <type>SortRows</type>
373 486 <description/>
... ... @@ -434,97 +547,6 @@
434 547 </step>
435 548  
436 549 <step>
437   - <name>Excel&#x8f93;&#x51fa;</name>
438   - <type>ExcelOutput</type>
439   - <description/>
440   - <distribute>Y</distribute>
441   - <custom_distribution/>
442   - <copies>1</copies>
443   - <partitioning>
444   - <method>none</method>
445   - <schema_name/>
446   - </partitioning>
447   - <header>Y</header>
448   - <footer>N</footer>
449   - <encoding/>
450   - <append>N</append>
451   - <add_to_result_filenames>Y</add_to_result_filenames>
452   - <file>
453   - <name>&#x24;&#x7b;filepath&#x7d;</name>
454   - <extention/>
455   - <do_not_open_newfile_init>N</do_not_open_newfile_init>
456   - <create_parent_folder>N</create_parent_folder>
457   - <split>N</split>
458   - <add_date>N</add_date>
459   - <add_time>N</add_time>
460   - <SpecifyFormat>N</SpecifyFormat>
461   - <date_time_format/>
462   - <sheetname>Sheet1</sheetname>
463   - <autosizecolums>N</autosizecolums>
464   - <nullisblank>N</nullisblank>
465   - <protect_sheet>N</protect_sheet>
466   - <password>Encrypted </password>
467   - <splitevery>0</splitevery>
468   - <usetempfiles>N</usetempfiles>
469   - <tempdirectory/>
470   - </file>
471   - <template>
472   - <enabled>N</enabled>
473   - <append>N</append>
474   - <filename>template.xls</filename>
475   - </template>
476   - <fields>
477   - </fields>
478   - <custom>
479   - <header_font_name>arial</header_font_name>
480   - <header_font_size>10</header_font_size>
481   - <header_font_bold>N</header_font_bold>
482   - <header_font_italic>N</header_font_italic>
483   - <header_font_underline>no</header_font_underline>
484   - <header_font_orientation>horizontal</header_font_orientation>
485   - <header_font_color>black</header_font_color>
486   - <header_background_color>none</header_background_color>
487   - <header_row_height>255</header_row_height>
488   - <header_alignment>left</header_alignment>
489   - <header_image/>
490   - <row_font_name>arial</row_font_name>
491   - <row_font_size>10</row_font_size>
492   - <row_font_color>black</row_font_color>
493   - <row_background_color>none</row_background_color>
494   - </custom>
495   - <cluster_schema/>
496   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
497   - <xloc>731</xloc>
498   - <yloc>65</yloc>
499   - <draw>Y</draw>
500   - </GUI>
501   - </step>
502   -
503   - <step>
504   - <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
505   - <type>SelectValues</type>
506   - <description/>
507   - <distribute>Y</distribute>
508   - <custom_distribution/>
509   - <copies>1</copies>
510   - <partitioning>
511   - <method>none</method>
512   - <schema_name/>
513   - </partitioning>
514   - <fields> <field> <name>lp_name</name>
515   - <rename>&#x8def;&#x724c;</rename>
516   - <length>-2</length>
517   - <precision>-2</precision>
518   - </field> <select_unspecified>Y</select_unspecified>
519   - </fields> <cluster_schema/>
520   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
521   - <xloc>534</xloc>
522   - <yloc>243</yloc>
523   - <draw>Y</draw>
524   - </GUI>
525   - </step>
526   -
527   - <step>
528 550 <name>&#x8def;&#x724c;&#x540d;&#x5b57;&#x67e5;&#x627e;</name>
529 551 <type>DBLookup</type>
530 552 <description/>
... ... @@ -536,8 +558,8 @@
536 558 <schema_name/>
537 559 </partitioning>
538 560 <connection>bus_control_variable</connection>
539   - <cache>N</cache>
540   - <cache_load_all>N</cache_load_all>
  561 + <cache>Y</cache>
  562 + <cache_load_all>Y</cache_load_all>
541 563 <cache_size>0</cache_size>
542 564 <lookup>
543 565 <schema/>
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr
... ... @@ -89,6 +89,27 @@
89 89 <is_key_private>N</is_key_private>
90 90 </info>
91 91 <notepads>
  92 + <notepad>
  93 + <note>&#x8fd9;&#x91cc;&#x6709;&#x4e9b;&#x95ee;&#x9898;&#xa;&#x5728;window2012&#x7684;&#x73af;&#x5883;&#x4e0b;&#xff0c;&#xa;MySql&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x4e2d;&#x5982;&#x679c;&#x8fd4;&#x56de;&#x4e2d;&#x6587;&#x5185;&#x5bb9;&#x7684;&#x5b57;&#x6bb5;&#xff0c;&#x8fd9;&#x4e2a;&#x5185;&#x5bb9;&#x4e71;&#x7801;&#xa;&#x89e3;&#x51b3;&#x529e;&#x6cd5;&#xff0c;&#x5c31;&#x662f;&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x5168;&#x90e8;&#x7f13;&#x5b58;&#xff0c;&#x5c31;&#x4e0d;&#x4e71;&#x7801;&#xa;linux&#x73af;&#x5883;&#x4e0b;&#x6ca1;&#x95ee;&#x9898;</note>
  94 + <xloc>165</xloc>
  95 + <yloc>402</yloc>
  96 + <width>333</width>
  97 + <heigth>90</heigth>
  98 + <fontname>YaHei Consolas Hybrid</fontname>
  99 + <fontsize>12</fontsize>
  100 + <fontbold>N</fontbold>
  101 + <fontitalic>N</fontitalic>
  102 + <fontcolorred>0</fontcolorred>
  103 + <fontcolorgreen>0</fontcolorgreen>
  104 + <fontcolorblue>0</fontcolorblue>
  105 + <backgroundcolorred>255</backgroundcolorred>
  106 + <backgroundcolorgreen>205</backgroundcolorgreen>
  107 + <backgroundcolorblue>112</backgroundcolorblue>
  108 + <bordercolorred>100</bordercolorred>
  109 + <bordercolorgreen>100</bordercolorgreen>
  110 + <bordercolorblue>100</bordercolorblue>
  111 + <drawshadow>Y</drawshadow>
  112 + </notepad>
92 113 </notepads>
93 114 <connection>
94 115 <name>bus_control_variable</name>
... ... @@ -103,6 +124,7 @@
103 124 <data_tablespace/>
104 125 <index_tablespace/>
105 126 <attributes>
  127 + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
106 128 <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
107 129 <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
108 130 <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
... ... @@ -322,8 +344,8 @@
322 344 </step>
323 345  
324 346 <step>
325   - <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5206;&#x7ec4;&#x6570;&#x636e;</name>
326   - <type>TableInput</type>
  347 + <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
  348 + <type>SelectValues</type>
327 349 <description/>
328 350 <distribute>Y</distribute>
329 351 <custom_distribution/>
... ... @@ -332,24 +354,30 @@
332 354 <method>none</method>
333 355 <schema_name/>
334 356 </partitioning>
335   - <connection>bus_control_variable</connection>
336   - <sql>select &#xa;fcno&#xa;, min&#x28;xl_dir&#x29; xl_dir&#xa;,min&#x28;qdz&#x29; qdz&#xa;,min&#x28;zdz&#x29; zdz&#xa;,bc_type &#xa;from bsth_c_s_ttinfo_detail&#xa;where ttinfo &#x3d; &#x24;&#x7b;ttinfoid&#x7d;&#xa;group by fcno,bc_type</sql>
337   - <limit>0</limit>
338   - <lookup/>
339   - <execute_each_row>N</execute_each_row>
340   - <variables_active>Y</variables_active>
341   - <lazy_conversion_active>N</lazy_conversion_active>
342   - <cluster_schema/>
  357 + <fields> <field> <name>fieldname</name>
  358 + <rename/>
  359 + <length>-2</length>
  360 + <precision>-2</precision>
  361 + </field> <field> <name>fieldtype</name>
  362 + <rename/>
  363 + <length>-2</length>
  364 + <precision>-2</precision>
  365 + </field> <field> <name>fcno</name>
  366 + <rename/>
  367 + <length>-2</length>
  368 + <precision>-2</precision>
  369 + </field> <select_unspecified>N</select_unspecified>
  370 + </fields> <cluster_schema/>
343 371 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
344   - <xloc>56</xloc>
345   - <yloc>185</yloc>
  372 + <xloc>533</xloc>
  373 + <yloc>325</yloc>
346 374 <draw>Y</draw>
347 375 </GUI>
348 376 </step>
349 377  
350 378 <step>
351   - <name>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;</name>
352   - <type>FilterRows</type>
  379 + <name>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</name>
  380 + <type>SortRows</type>
353 381 <description/>
354 382 <distribute>Y</distribute>
355 383 <custom_distribution/>
... ... @@ -358,27 +386,32 @@
358 386 <method>none</method>
359 387 <schema_name/>
360 388 </partitioning>
361   -<send_true_to/>
362   -<send_false_to/>
363   - <compare>
364   -<condition>
365   - <negated>N</negated>
366   - <leftvalue>bc_type</leftvalue>
367   - <function>IS NOT NULL</function>
368   - <rightvalue/>
369   - </condition>
370   - </compare>
  389 + <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
  390 + <prefix>out</prefix>
  391 + <sort_size>1000000</sort_size>
  392 + <free_memory/>
  393 + <compress>N</compress>
  394 + <compress_variable/>
  395 + <unique_rows>N</unique_rows>
  396 + <fields>
  397 + <field>
  398 + <name>fcno</name>
  399 + <ascending>Y</ascending>
  400 + <case_sensitive>N</case_sensitive>
  401 + <presorted>N</presorted>
  402 + </field>
  403 + </fields>
371 404 <cluster_schema/>
372 405 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
373   - <xloc>182</xloc>
374   - <yloc>189</yloc>
  406 + <xloc>642</xloc>
  407 + <yloc>325</yloc>
375 408 <draw>Y</draw>
376 409 </GUI>
377 410 </step>
378 411  
379 412 <step>
380   - <name>&#x8ba1;&#x7b97;&#x7ad9;&#x70b9;</name>
381   - <type>ScriptValueMod</type>
  413 + <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5206;&#x7ec4;&#x6570;&#x636e;</name>
  414 + <type>TableInput</type>
382 415 <description/>
383 416 <distribute>Y</distribute>
384 417 <custom_distribution/>
... ... @@ -387,21 +420,17 @@
387 420 <method>none</method>
388 421 <schema_name/>
389 422 </partitioning>
390   - <compatible>N</compatible>
391   - <optimizationLevel>9</optimizationLevel>
392   - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
393   - <jsScript_name>Script 1</jsScript_name>
394   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var zd&#x3b;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; zd &#x3d; zdz&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d; else &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d;&#xa;</jsScript_script>
395   - </jsScript> </jsScripts> <fields> <field> <name>zd</name>
396   - <rename>zd</rename>
397   - <type>String</type>
398   - <length>-1</length>
399   - <precision>-1</precision>
400   - <replace>N</replace>
401   - </field> </fields> <cluster_schema/>
  423 + <connection>bus_control_variable</connection>
  424 + <sql>select &#xa;fcno&#xa;, min&#x28;xl_dir&#x29; xl_dir&#xa;,min&#x28;qdz&#x29; qdz&#xa;,min&#x28;zdz&#x29; zdz&#xa;,bc_type &#xa;from bsth_c_s_ttinfo_detail&#xa;where ttinfo &#x3d; &#x24;&#x7b;ttinfoid&#x7d;&#xa;group by fcno,bc_type</sql>
  425 + <limit>0</limit>
  426 + <lookup/>
  427 + <execute_each_row>N</execute_each_row>
  428 + <variables_active>Y</variables_active>
  429 + <lazy_conversion_active>N</lazy_conversion_active>
  430 + <cluster_schema/>
402 431 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
403   - <xloc>300</xloc>
404   - <yloc>190</yloc>
  432 + <xloc>56</xloc>
  433 + <yloc>185</yloc>
405 434 <draw>Y</draw>
406 435 </GUI>
407 436 </step>
... ... @@ -418,8 +447,8 @@
418 447 <schema_name/>
419 448 </partitioning>
420 449 <connection>bus_control_variable</connection>
421   - <cache>N</cache>
422   - <cache_load_all>N</cache_load_all>
  450 + <cache>Y</cache>
  451 + <cache_load_all>Y</cache_load_all>
423 452 <cache_size>0</cache_size>
424 453 <lookup>
425 454 <schema/>
... ... @@ -455,8 +484,8 @@
455 484 </step>
456 485  
457 486 <step>
458   - <name>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</name>
459   - <type>ScriptValueMod</type>
  487 + <name>&#x751f;&#x6210;&#x8def;&#x724c;&#x5b57;&#x6bb5;</name>
  488 + <type>RowGenerator</type>
460 489 <description/>
461 490 <distribute>Y</distribute>
462 491 <custom_distribution/>
... ... @@ -465,39 +494,53 @@
465 494 <method>none</method>
466 495 <schema_name/>
467 496 </partitioning>
468   - <compatible>N</compatible>
469   - <optimizationLevel>9</optimizationLevel>
470   - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
471   - <jsScript_name>Script 1</jsScript_name>
472   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var targetfieldname&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x5b57;&#x6bb5;&#x540d;&#xa;var targettype&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x7c7b;&#x578b;&#xa;var valuefieldname&#x3b; &#x2f;&#x2f; &#x503c;&#x5b57;&#x6bb5;&#x540d;&#xa;var keyvalue&#x3b; &#x2f;&#x2f; &#x5173;&#x952e;&#x5b57;&#x503c;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x8fdb;&#x573a;&#x27; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x51fa;&#x573a;&#x27; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; fcno&#x3b;&#xa;&#x7d; else &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; fcno&#x3b;&#xa;&#x7d; &#xa;&#xa;targettype &#x3d; &#x27;String&#x27;&#x3b;&#xa;valuefieldname &#x3d; &#x27;fcsj&#x27;&#x3b;&#xa;keyvalue &#x3d; fcno&#x3b;&#xa;</jsScript_script>
473   - </jsScript> </jsScripts> <fields> <field> <name>targetfieldname</name>
474   - <rename>targetfieldname</rename>
475   - <type>String</type>
476   - <length>-1</length>
477   - <precision>-1</precision>
478   - <replace>N</replace>
479   - </field> <field> <name>targettype</name>
480   - <rename>targettype</rename>
  497 + <fields>
  498 + <field>
  499 + <name>fieldname</name>
481 500 <type>String</type>
  501 + <format/>
  502 + <currency/>
  503 + <decimal/>
  504 + <group/>
  505 + <nullif>&#x8def;&#x724c;</nullif>
482 506 <length>-1</length>
483 507 <precision>-1</precision>
484   - <replace>N</replace>
485   - </field> <field> <name>valuefieldname</name>
486   - <rename>valuefieldname</rename>
  508 + <set_empty_string>N</set_empty_string>
  509 + </field>
  510 + <field>
  511 + <name>fieldtype</name>
487 512 <type>String</type>
  513 + <format/>
  514 + <currency/>
  515 + <decimal/>
  516 + <group/>
  517 + <nullif>String</nullif>
488 518 <length>-1</length>
489 519 <precision>-1</precision>
490   - <replace>N</replace>
491   - </field> <field> <name>keyvalue</name>
492   - <rename>keyvalue</rename>
493   - <type>String</type>
  520 + <set_empty_string>N</set_empty_string>
  521 + </field>
  522 + <field>
  523 + <name>fcno</name>
  524 + <type>Integer</type>
  525 + <format/>
  526 + <currency/>
  527 + <decimal/>
  528 + <group/>
  529 + <nullif>0</nullif>
494 530 <length>-1</length>
495 531 <precision>-1</precision>
496   - <replace>N</replace>
497   - </field> </fields> <cluster_schema/>
  532 + <set_empty_string>N</set_empty_string>
  533 + </field>
  534 + </fields>
  535 + <limit>1</limit>
  536 + <never_ending>N</never_ending>
  537 + <interval_in_ms>5000</interval_in_ms>
  538 + <row_time_field>now</row_time_field>
  539 + <last_time_field>FiveSecondsAgo</last_time_field>
  540 + <cluster_schema/>
498 541 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
499   - <xloc>410</xloc>
500   - <yloc>64</yloc>
  542 + <xloc>530</xloc>
  543 + <yloc>194</yloc>
501 544 <draw>Y</draw>
502 545 </GUI>
503 546 </step>
... ... @@ -539,8 +582,8 @@
539 582 </step>
540 583  
541 584 <step>
542   - <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
543   - <type>SelectValues</type>
  585 + <name>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</name>
  586 + <type>ScriptValueMod</type>
544 587 <description/>
545 588 <distribute>Y</distribute>
546 589 <custom_distribution/>
... ... @@ -549,30 +592,46 @@
549 592 <method>none</method>
550 593 <schema_name/>
551 594 </partitioning>
552   - <fields> <field> <name>fieldname</name>
553   - <rename/>
554   - <length>-2</length>
555   - <precision>-2</precision>
556   - </field> <field> <name>fieldtype</name>
557   - <rename/>
558   - <length>-2</length>
559   - <precision>-2</precision>
560   - </field> <field> <name>fcno</name>
561   - <rename/>
562   - <length>-2</length>
563   - <precision>-2</precision>
564   - </field> <select_unspecified>N</select_unspecified>
565   - </fields> <cluster_schema/>
  595 + <compatible>N</compatible>
  596 + <optimizationLevel>9</optimizationLevel>
  597 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  598 + <jsScript_name>Script 1</jsScript_name>
  599 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var targetfieldname&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x5b57;&#x6bb5;&#x540d;&#xa;var targettype&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x7c7b;&#x578b;&#xa;var valuefieldname&#x3b; &#x2f;&#x2f; &#x503c;&#x5b57;&#x6bb5;&#x540d;&#xa;var keyvalue&#x3b; &#x2f;&#x2f; &#x5173;&#x952e;&#x5b57;&#x503c;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x8fdb;&#x573a;&#x27; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x51fa;&#x573a;&#x27; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; fcno&#x3b;&#xa;&#x7d; else &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; fcno&#x3b;&#xa;&#x7d; &#xa;&#xa;targettype &#x3d; &#x27;String&#x27;&#x3b;&#xa;valuefieldname &#x3d; &#x27;fcsj&#x27;&#x3b;&#xa;keyvalue &#x3d; fcno&#x3b;&#xa;</jsScript_script>
  600 + </jsScript> </jsScripts> <fields> <field> <name>targetfieldname</name>
  601 + <rename>targetfieldname</rename>
  602 + <type>String</type>
  603 + <length>-1</length>
  604 + <precision>-1</precision>
  605 + <replace>N</replace>
  606 + </field> <field> <name>targettype</name>
  607 + <rename>targettype</rename>
  608 + <type>String</type>
  609 + <length>-1</length>
  610 + <precision>-1</precision>
  611 + <replace>N</replace>
  612 + </field> <field> <name>valuefieldname</name>
  613 + <rename>valuefieldname</rename>
  614 + <type>String</type>
  615 + <length>-1</length>
  616 + <precision>-1</precision>
  617 + <replace>N</replace>
  618 + </field> <field> <name>keyvalue</name>
  619 + <rename>keyvalue</rename>
  620 + <type>String</type>
  621 + <length>-1</length>
  622 + <precision>-1</precision>
  623 + <replace>N</replace>
  624 + </field> </fields> <cluster_schema/>
566 625 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
567   - <xloc>533</xloc>
568   - <yloc>325</yloc>
  626 + <xloc>410</xloc>
  627 + <yloc>64</yloc>
569 628 <draw>Y</draw>
570 629 </GUI>
571 630 </step>
572 631  
573 632 <step>
574   - <name>&#x751f;&#x6210;&#x8def;&#x724c;&#x5b57;&#x6bb5;</name>
575   - <type>RowGenerator</type>
  633 + <name>&#x8ba1;&#x7b97;&#x7ad9;&#x70b9;</name>
  634 + <type>ScriptValueMod</type>
576 635 <description/>
577 636 <distribute>Y</distribute>
578 637 <custom_distribution/>
... ... @@ -581,60 +640,28 @@
581 640 <method>none</method>
582 641 <schema_name/>
583 642 </partitioning>
584   - <fields>
585   - <field>
586   - <name>fieldname</name>
587   - <type>String</type>
588   - <format/>
589   - <currency/>
590   - <decimal/>
591   - <group/>
592   - <nullif>&#x8def;&#x724c;</nullif>
593   - <length>-1</length>
594   - <precision>-1</precision>
595   - <set_empty_string>N</set_empty_string>
596   - </field>
597   - <field>
598   - <name>fieldtype</name>
  643 + <compatible>N</compatible>
  644 + <optimizationLevel>9</optimizationLevel>
  645 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  646 + <jsScript_name>Script 1</jsScript_name>
  647 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var zd&#x3b;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; zd &#x3d; zdz&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d; else &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d;&#xa;</jsScript_script>
  648 + </jsScript> </jsScripts> <fields> <field> <name>zd</name>
  649 + <rename>zd</rename>
599 650 <type>String</type>
600   - <format/>
601   - <currency/>
602   - <decimal/>
603   - <group/>
604   - <nullif>String</nullif>
605   - <length>-1</length>
606   - <precision>-1</precision>
607   - <set_empty_string>N</set_empty_string>
608   - </field>
609   - <field>
610   - <name>fcno</name>
611   - <type>Integer</type>
612   - <format/>
613   - <currency/>
614   - <decimal/>
615   - <group/>
616   - <nullif>0</nullif>
617 651 <length>-1</length>
618 652 <precision>-1</precision>
619   - <set_empty_string>N</set_empty_string>
620   - </field>
621   - </fields>
622   - <limit>1</limit>
623   - <never_ending>N</never_ending>
624   - <interval_in_ms>5000</interval_in_ms>
625   - <row_time_field>now</row_time_field>
626   - <last_time_field>FiveSecondsAgo</last_time_field>
627   - <cluster_schema/>
  653 + <replace>N</replace>
  654 + </field> </fields> <cluster_schema/>
628 655 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
629   - <xloc>530</xloc>
630   - <yloc>194</yloc>
  656 + <xloc>300</xloc>
  657 + <yloc>190</yloc>
631 658 <draw>Y</draw>
632 659 </GUI>
633 660 </step>
634 661  
635 662 <step>
636   - <name>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</name>
637   - <type>SortRows</type>
  663 + <name>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;</name>
  664 + <type>FilterRows</type>
638 665 <description/>
639 666 <distribute>Y</distribute>
640 667 <custom_distribution/>
... ... @@ -643,25 +670,20 @@
643 670 <method>none</method>
644 671 <schema_name/>
645 672 </partitioning>
646   - <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
647   - <prefix>out</prefix>
648   - <sort_size>1000000</sort_size>
649   - <free_memory/>
650   - <compress>N</compress>
651   - <compress_variable/>
652   - <unique_rows>N</unique_rows>
653   - <fields>
654   - <field>
655   - <name>fcno</name>
656   - <ascending>Y</ascending>
657   - <case_sensitive>N</case_sensitive>
658   - <presorted>N</presorted>
659   - </field>
660   - </fields>
  673 +<send_true_to/>
  674 +<send_false_to/>
  675 + <compare>
  676 +<condition>
  677 + <negated>N</negated>
  678 + <leftvalue>bc_type</leftvalue>
  679 + <function>IS NOT NULL</function>
  680 + <rightvalue/>
  681 + </condition>
  682 + </compare>
661 683 <cluster_schema/>
662 684 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
663   - <xloc>642</xloc>
664   - <yloc>325</yloc>
  685 + <xloc>182</xloc>
  686 + <yloc>189</yloc>
665 687 <draw>Y</draw>
666 688 </GUI>
667 689 </step>
... ...
src/main/resources/datatools/ktrs/ttinfodetailoutputforedit.ktr
... ... @@ -89,6 +89,27 @@
89 89 <is_key_private>N</is_key_private>
90 90 </info>
91 91 <notepads>
  92 + <notepad>
  93 + <note>&#x8fd9;&#x91cc;&#x6709;&#x4e9b;&#x95ee;&#x9898;&#xa;&#x5728;window2012&#x7684;&#x73af;&#x5883;&#x4e0b;&#xff0c;&#xa;MySql&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x4e2d;&#x5982;&#x679c;&#x8fd4;&#x56de;&#x4e2d;&#x6587;&#x5185;&#x5bb9;&#x7684;&#x5b57;&#x6bb5;&#xff0c;&#x8fd9;&#x4e2a;&#x5185;&#x5bb9;&#x4e71;&#x7801;&#xa;&#x89e3;&#x51b3;&#x529e;&#x6cd5;&#xff0c;&#x5c31;&#x662f;&#x6570;&#x636e;&#x5e93;&#x67e5;&#x8be2;&#x5168;&#x90e8;&#x7f13;&#x5b58;&#xff0c;&#x5c31;&#x4e0d;&#x4e71;&#x7801;&#xa;linux&#x73af;&#x5883;&#x4e0b;&#x6ca1;&#x95ee;&#x9898;</note>
  94 + <xloc>135</xloc>
  95 + <yloc>299</yloc>
  96 + <width>333</width>
  97 + <heigth>90</heigth>
  98 + <fontname>YaHei Consolas Hybrid</fontname>
  99 + <fontsize>12</fontsize>
  100 + <fontbold>N</fontbold>
  101 + <fontitalic>N</fontitalic>
  102 + <fontcolorred>0</fontcolorred>
  103 + <fontcolorgreen>0</fontcolorgreen>
  104 + <fontcolorblue>0</fontcolorblue>
  105 + <backgroundcolorred>255</backgroundcolorred>
  106 + <backgroundcolorgreen>205</backgroundcolorgreen>
  107 + <backgroundcolorblue>112</backgroundcolorblue>
  108 + <bordercolorred>100</bordercolorred>
  109 + <bordercolorgreen>100</bordercolorgreen>
  110 + <bordercolorblue>100</bordercolorblue>
  111 + <drawshadow>Y</drawshadow>
  112 + </notepad>
92 113 </notepads>
93 114 <connection>
94 115 <name>bus_control_variable</name>
... ... @@ -103,6 +124,7 @@
103 124 <data_tablespace/>
104 125 <index_tablespace/>
105 126 <attributes>
  127 + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
106 128 <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
107 129 <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
108 130 <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
... ... @@ -4544,8 +4566,8 @@
4544 4566 <schema_name/>
4545 4567 </partitioning>
4546 4568 <connection>bus_control_variable</connection>
4547   - <cache>N</cache>
4548   - <cache_load_all>N</cache_load_all>
  4569 + <cache>Y</cache>
  4570 + <cache_load_all>Y</cache_load_all>
4549 4571 <cache_size>0</cache_size>
4550 4572 <lookup>
4551 4573 <schema/>
... ... @@ -4598,8 +4620,8 @@
4598 4620 <schema_name/>
4599 4621 </partitioning>
4600 4622 <connection>bus_control_variable</connection>
4601   - <cache>N</cache>
4602   - <cache_load_all>N</cache_load_all>
  4623 + <cache>Y</cache>
  4624 + <cache_load_all>Y</cache_load_all>
4603 4625 <cache_size>0</cache_size>
4604 4626 <lookup>
4605 4627 <schema/>
... ...
src/main/resources/static/assets/bower_components/handsontable/.bower.json 0 → 100644
  1 +{
  2 + "name": "handsontable",
  3 + "description": "Spreadsheet-like data grid editor that provides copy/paste functionality compatible with Excel/Google Docs",
  4 + "version": "0.24.3",
  5 + "main": [
  6 + "./dist/handsontable.js",
  7 + "./dist/handsontable.css"
  8 + ],
  9 + "homepage": "http://handsontable.com/",
  10 + "repository": {
  11 + "type": "git",
  12 + "url": "https://github.com/handsontable/handsontable.git"
  13 + },
  14 + "authors": [
  15 + "Handsoncode",
  16 + "Handsoncode <hello@handsontable.com>"
  17 + ],
  18 + "keywords": [
  19 + "data",
  20 + "grid",
  21 + "table",
  22 + "editor",
  23 + "grid-editor",
  24 + "data-grid",
  25 + "data-table",
  26 + "spreadsheet",
  27 + "excel",
  28 + "tabular-data",
  29 + "edit-cell",
  30 + "editable-table",
  31 + "data-spreadsheet"
  32 + ],
  33 + "ignore": [
  34 + "**/.*",
  35 + "components",
  36 + "demo",
  37 + "node_modules",
  38 + "src",
  39 + "test"
  40 + ],
  41 + "dependencies": {
  42 + "zeroclipboard": "^2.2.0",
  43 + "moment": "^2.9.0",
  44 + "pikaday": "^1.3.2"
  45 + },
  46 + "devDependencies": {
  47 + "chroma-js": "~0.5.6"
  48 + },
  49 + "_release": "0.24.3",
  50 + "_resolution": {
  51 + "type": "version",
  52 + "tag": "0.24.3",
  53 + "commit": "eb19e2e0a364f0f535380238ddb10a2dd4fc150a"
  54 + },
  55 + "_source": "https://github.com/handsontable/handsontable.git",
  56 + "_target": "~0.24.0",
  57 + "_originalSource": "handsontable"
  58 +}
0 59 \ No newline at end of file
... ...
src/main/resources/static/assets/bower_components/handsontable/CHANGELOG.md 0 → 100644
  1 +All releases are described at https://github.com/handsontable/handsontable/releases
... ...
src/main/resources/static/assets/bower_components/handsontable/CNAME 0 → 100644
  1 +handsontable.com
... ...
src/main/resources/static/assets/bower_components/handsontable/CONTRIBUTING.md 0 → 100644
  1 +# Contributing to Handsontable
  2 +
  3 +Your contributions to the project are very welcome. If you would like to fix a bug or propose a new feature, you can submit a Pull Request.
  4 +
  5 +To help us merge your Pull Request, please make sure you follow these points:
  6 +
  7 +1. Please make your fix on a separate branch. This makes merging much easier.
  8 +2. Do not edit files in `dist/` directory (e.g: `handsontable.js`, `handsontable.css`, `handsontable.full.js`, `handsontable.full.css`). Instead, try to edit files inside the `src/` directory and then use `grunt` to make a build. More information about this on wiki page [Building](https://github.com/handsontable/handsontable/wiki/Building).
  9 +3. **Very important:** For any change that you make, **please try to also add a test case(s)** in `tests/jasmine/spec/` or `src/3rdparty/walkontable/test/jasmine/spec/`. This helps us understand the issue and make sure that it will stay fixed forever. See [Testing](https://github.com/handsontable/handsontable/wiki/Testing)
  10 +4. **Very important:** Please review our [coding style](https://github.com/handsontable/handsontable/wiki/Coding-style) for instructions on how to maintain a fork and submit patches.
  11 +5. Describe the problem in the Pull Request description (of course you would do it, why do I mention that?)
  12 +
  13 +Thank you for your commitment!
  14 +
  15 +## Team rules
  16 +
  17 +The Handsontable team utilizes Git-Flow. See [How we use Git-Flow](https://github.com/handsontable/handsontable/wiki/How-we-use-Git-Flow)
... ...