Commit 362ab2250519058453e646effe6bcb07a30ddab2

Authored by 潘钊
2 parents 4653a773 1b4276e6

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

# Conflicts:
#	src/main/java/com/bsth/XDApplication.java
#	src/main/java/com/bsth/data/ThreadMonotor.java
Showing 25 changed files with 944 additions and 684 deletions
src/main/java/com/bsth/XDApplication.java
... ... @@ -105,7 +105,7 @@ public class XDApplication implements CommandLineRunner {
105 105 sexec.scheduleWithFixedDelay(fcxxUpdateThread, 60, 40, TimeUnit.SECONDS);
106 106 //抓取GPS数据
107 107 sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS);
108   - //检查设备掉离线
  108 + //GPS设备掉离线
109 109 sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
110 110 //实际排班更新线程
111 111 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
... ...
src/main/java/com/bsth/data/ThreadMonotor.java
... ... @@ -42,4 +42,4 @@ public class ThreadMonotor extends Thread{
42 42 DirectivePushQueue.start();
43 43 }
44 44 }
45 45 -}
  46 +}
46 47 \ No newline at end of file
... ...
src/main/java/com/bsth/data/car_out_info/UpdateDBThread.java
1   -package com.bsth.data.car_out_info;
2   -
3   -import org.springframework.beans.factory.annotation.Autowired;
4   -import org.springframework.stereotype.Component;
5   -
6   -/**
7   - * 数据库发车信息表更新线程
8   - * Created by panzhao on 2017/5/14.
9   - */
10   -@Component
11   -public class UpdateDBThread extends Thread{
12   -
13   - @Autowired
14   - CarOutInfoHandler carOutInfoHandler;
15   -
16   - @Override
17   - public void run() {
18   - carOutInfoHandler.updateAll();
19   - }
20   -}
  1 +package com.bsth.data.car_out_info;
  2 +
  3 +import org.springframework.beans.factory.annotation.Autowired;
  4 +import org.springframework.stereotype.Component;
  5 +
  6 +/**
  7 + * 数据库发车信息表更新线程
  8 + * Created by panzhao on 2017/5/14.
  9 + */
  10 +@Component
  11 +public class UpdateDBThread extends Thread{
  12 +
  13 + @Autowired
  14 + CarOutInfoHandler carOutInfoHandler;
  15 +
  16 + @Override
  17 + public void run() {
  18 + carOutInfoHandler.updateAll();
  19 + }
  20 +}
... ...
src/main/java/com/bsth/data/msg_queue/DirectivePushQueue.java
1   -package com.bsth.data.msg_queue;
2   -
3   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
4   -import com.bsth.service.directive.DirectiveService;
5   -import org.slf4j.Logger;
6   -import org.slf4j.LoggerFactory;
7   -import org.springframework.beans.BeansException;
8   -import org.springframework.boot.CommandLineRunner;
9   -import org.springframework.context.ApplicationContext;
10   -import org.springframework.context.ApplicationContextAware;
11   -import org.springframework.stereotype.Component;
12   -
13   -import java.util.LinkedList;
14   -
15   -/**
16   - * 到网关的指令推送队列 (系统发送的队列, 用户手动发送的不走这里)
17   - * Created by panzhao on 2017/5/11.
18   - */
19   -@Component
20   -public class DirectivePushQueue implements CommandLineRunner, ApplicationContextAware {
21   -
22   - static LinkedList<QueueData_Directive> linkedList;
23   - static DataPushThread thread;
24   - static DirectiveService directiveService;
25   - static long t;
26   - static final int IDLE_TIME = 1000 * 30;
27   -
28   - static {
29   - linkedList = new LinkedList<>();
30   - }
31   -
32   - public static void put6002(ScheduleRealInfo sch, int finish, String sender){
33   - QueueData_Directive qd6002 = new QueueData_Directive();
34   - qd6002.setSch(sch);
35   - qd6002.setFinish(finish);
36   - qd6002.setSender(sender);
37   - qd6002.setCode("60_02");
38   -
39   - linkedList.add(qd6002);
40   - }
41   -
42   - public static void put6003(String nbbm, int state, int upDown, ScheduleRealInfo sch, String sender){
43   - QueueData_Directive qd6003 = new QueueData_Directive();
44   - qd6003.setNbbm(nbbm);
45   - qd6003.setState(state);
46   - qd6003.setUpDown(upDown);
47   - qd6003.setSch(sch);
48   - qd6003.setSender(sender);
49   -
50   - qd6003.setCode("60_03");
51   -
52   - linkedList.add(qd6003);
53   - }
54   -
55   - public static void put64(String nbbm, String lineCode, String sender){
56   - QueueData_Directive qd64 = new QueueData_Directive();
57   - qd64.setNbbm(nbbm);
58   - qd64.setLineCode(lineCode);
59   - qd64.setSender(sender);
60   -
61   - qd64.setCode("64");
62   -
63   - linkedList.add(qd64);
64   - }
65   -
66   - public static boolean isIdle(){
67   - return System.currentTimeMillis() - t > IDLE_TIME;
68   - }
69   -
70   - public static void start(){
71   - if(thread != null){
72   - thread.interrupt();
73   - }
74   - thread = new DataPushThread();
75   - thread.start();
76   - }
77   -
78   - @Override
79   - public void run(String... strings) throws Exception {
80   - start();
81   - }
82   -
83   - @Override
84   - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
85   - directiveService = applicationContext.getBean(DirectiveService.class);
86   - }
87   -
88   - public static class DataPushThread extends Thread {
89   -
90   - Logger log = LoggerFactory.getLogger(this.getClass());
91   -
92   - @Override
93   - public void run() {
94   - boolean sleepFlag = false;
95   - QueueData_Directive qd;
96   - String code;
97   - while (true) {
98   - try {
99   - qd = linkedList.pollFirst();
100   - if (qd != null) {
101   - sleepFlag = false;
102   - code = qd.getCode();
103   -
104   - if(code.equals("60_02")){
105   - directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender());
106   - log.info("directive 60_02 sch id: " + qd.getSch().getId());
107   - }
108   - else if(code.equals("60_03")){
109   - directiveService.send60Operation(qd.getNbbm(), qd.getState(), qd.getUpDown(), null, qd.getSender());
110   - log.info("directive 60_03 nbbm: " + qd.getNbbm());
111   - }
112   - else if(code.equals("64")){
113   - directiveService.lineChange(qd.getNbbm(), qd.getLineCode(), qd.getSender());
114   - log.info("directive 64 nbbm: " + qd.getNbbm() + " lineCode: " + qd.getLineCode());
115   - }
116   -
117   - } else{
118   - Thread.sleep(500);
119   - if(!sleepFlag){
120   - log.info("sleep...");
121   - sleepFlag = true;
122   - }
123   - }
124   - t = System.currentTimeMillis();
125   - }
126   - catch(InterruptedException e){
127   - break;
128   - }
129   - catch (Exception e) {
130   - log.error("", e);
131   - }
132   -
133   - }
134   - }
135   - }
136   -}
  1 +package com.bsth.data.msg_queue;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +import com.bsth.service.directive.DirectiveService;
  5 +import org.slf4j.Logger;
  6 +import org.slf4j.LoggerFactory;
  7 +import org.springframework.beans.BeansException;
  8 +import org.springframework.boot.CommandLineRunner;
  9 +import org.springframework.context.ApplicationContext;
  10 +import org.springframework.context.ApplicationContextAware;
  11 +import org.springframework.stereotype.Component;
  12 +
  13 +import java.util.LinkedList;
  14 +
  15 +/**
  16 + * 到网关的指令推送队列 (系统发送的队列, 用户手动发送的不走这里)
  17 + * Created by panzhao on 2017/5/11.
  18 + */
  19 +@Component
  20 +public class DirectivePushQueue implements CommandLineRunner, ApplicationContextAware {
  21 +
  22 + static LinkedList<QueueData_Directive> linkedList;
  23 + static DataPushThread thread;
  24 + static DirectiveService directiveService;
  25 + static long t;
  26 + static final int IDLE_TIME = 1000 * 30;
  27 +
  28 + static {
  29 + linkedList = new LinkedList<>();
  30 + }
  31 +
  32 + public static void put6002(ScheduleRealInfo sch, int finish, String sender){
  33 + QueueData_Directive qd6002 = new QueueData_Directive();
  34 + qd6002.setSch(sch);
  35 + qd6002.setFinish(finish);
  36 + qd6002.setSender(sender);
  37 + qd6002.setCode("60_02");
  38 +
  39 + linkedList.add(qd6002);
  40 + }
  41 +
  42 + public static void put6003(String nbbm, int state, int upDown, ScheduleRealInfo sch, String sender){
  43 + QueueData_Directive qd6003 = new QueueData_Directive();
  44 + qd6003.setNbbm(nbbm);
  45 + qd6003.setState(state);
  46 + qd6003.setUpDown(upDown);
  47 + qd6003.setSch(sch);
  48 + qd6003.setSender(sender);
  49 +
  50 + qd6003.setCode("60_03");
  51 +
  52 + linkedList.add(qd6003);
  53 + }
  54 +
  55 + public static void put64(String nbbm, String lineCode, String sender){
  56 + QueueData_Directive qd64 = new QueueData_Directive();
  57 + qd64.setNbbm(nbbm);
  58 + qd64.setLineCode(lineCode);
  59 + qd64.setSender(sender);
  60 +
  61 + qd64.setCode("64");
  62 +
  63 + linkedList.add(qd64);
  64 + }
  65 +
  66 + public static boolean isIdle(){
  67 + return System.currentTimeMillis() - t > IDLE_TIME;
  68 + }
  69 +
  70 + public static void start(){
  71 + if(thread != null){
  72 + thread.interrupt();
  73 + }
  74 + thread = new DataPushThread();
  75 + thread.start();
  76 + }
  77 +
  78 + @Override
  79 + public void run(String... strings) throws Exception {
  80 + start();
  81 + }
  82 +
  83 + @Override
  84 + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  85 + directiveService = applicationContext.getBean(DirectiveService.class);
  86 + }
  87 +
  88 + public static class DataPushThread extends Thread {
  89 +
  90 + Logger log = LoggerFactory.getLogger(this.getClass());
  91 +
  92 + @Override
  93 + public void run() {
  94 + boolean sleepFlag = false;
  95 + QueueData_Directive qd;
  96 + String code;
  97 + while (true) {
  98 + try {
  99 + qd = linkedList.pollFirst();
  100 + if (qd != null) {
  101 + sleepFlag = false;
  102 + code = qd.getCode();
  103 +
  104 + if(code.equals("60_02")){
  105 + directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender());
  106 + log.info("directive 60_02 sch id: " + qd.getSch().getId());
  107 + }
  108 + else if(code.equals("60_03")){
  109 + directiveService.send60Operation(qd.getNbbm(), qd.getState(), qd.getUpDown(), null, qd.getSender());
  110 + log.info("directive 60_03 nbbm: " + qd.getNbbm());
  111 + }
  112 + else if(code.equals("64")){
  113 + directiveService.lineChange(qd.getNbbm(), qd.getLineCode(), qd.getSender());
  114 + log.info("directive 64 nbbm: " + qd.getNbbm() + " lineCode: " + qd.getLineCode());
  115 + }
  116 +
  117 + } else{
  118 + Thread.sleep(500);
  119 + if(!sleepFlag){
  120 + log.info("sleep...");
  121 + sleepFlag = true;
  122 + }
  123 + }
  124 + t = System.currentTimeMillis();
  125 + }
  126 + catch(InterruptedException e){
  127 + break;
  128 + }
  129 + catch (Exception e) {
  130 + log.error("", e);
  131 + }
  132 +
  133 + }
  134 + }
  135 + }
  136 +}
... ...
src/main/java/com/bsth/data/msg_queue/QueueData.java
1   -package com.bsth.data.msg_queue;
2   -
3   -import org.springframework.web.socket.TextMessage;
4   -import org.springframework.web.socket.WebSocketSession;
5   -
6   -/**
7   - * Created by panzhao on 2017/5/11.
8   - */
9   -public class QueueData {
10   -
11   - private TextMessage message;
12   -
13   - private WebSocketSession session;
14   -
15   -
16   - public WebSocketSession getSession() {
17   - return session;
18   - }
19   -
20   - public void setSession(WebSocketSession session) {
21   - this.session = session;
22   - }
23   -
24   - public TextMessage getMessage() {
25   - return message;
26   - }
27   -
28   - public void setMessage(TextMessage message) {
29   - this.message = message;
30   - }
31   -}
  1 +package com.bsth.data.msg_queue;
  2 +
  3 +import org.springframework.web.socket.TextMessage;
  4 +import org.springframework.web.socket.WebSocketSession;
  5 +
  6 +/**
  7 + * Created by panzhao on 2017/5/11.
  8 + */
  9 +public class QueueData {
  10 +
  11 + private TextMessage message;
  12 +
  13 + private WebSocketSession session;
  14 +
  15 +
  16 + public WebSocketSession getSession() {
  17 + return session;
  18 + }
  19 +
  20 + public void setSession(WebSocketSession session) {
  21 + this.session = session;
  22 + }
  23 +
  24 + public TextMessage getMessage() {
  25 + return message;
  26 + }
  27 +
  28 + public void setMessage(TextMessage message) {
  29 + this.message = message;
  30 + }
  31 +}
... ...
src/main/java/com/bsth/data/msg_queue/QueueData_Directive.java
1   -package com.bsth.data.msg_queue;
2   -
3   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
4   -
5   -/**
6   - * Created by panzhao on 2017/5/11.
7   - */
8   -public class QueueData_Directive {
9   -
10   - /**
11   - * 指令类型
12   - * 60_02
13   - * 60_03
14   - * 64
15   - */
16   - private String code;
17   -
18   - /** 60调度指令内容 60_02*/
19   - private ScheduleRealInfo sch;
20   - private int finish;
21   -
22   - /** 60 营运指令 60_03*/
23   - private String nbbm;
24   - private int state;
25   - private int upDown;
26   -
27   - /** 64指令内容 */
28   - private String lineCode;
29   -
30   - private String sender;
31   -
32   -
33   - public ScheduleRealInfo getSch() {
34   - return sch;
35   - }
36   -
37   - public void setSch(ScheduleRealInfo sch) {
38   - this.sch = sch;
39   - }
40   -
41   - public int getFinish() {
42   - return finish;
43   - }
44   -
45   - public void setFinish(int finish) {
46   - this.finish = finish;
47   - }
48   -
49   - public String getSender() {
50   - return sender;
51   - }
52   -
53   - public void setSender(String sender) {
54   - this.sender = sender;
55   - }
56   -
57   - public String getNbbm() {
58   - return nbbm;
59   - }
60   -
61   - public void setNbbm(String nbbm) {
62   - this.nbbm = nbbm;
63   - }
64   -
65   - public int getState() {
66   - return state;
67   - }
68   -
69   - public void setState(int state) {
70   - this.state = state;
71   - }
72   -
73   - public int getUpDown() {
74   - return upDown;
75   - }
76   -
77   - public void setUpDown(int upDown) {
78   - this.upDown = upDown;
79   - }
80   -
81   - public String getCode() {
82   - return code;
83   - }
84   -
85   - public void setCode(String code) {
86   - this.code = code;
87   - }
88   -
89   - public String getLineCode() {
90   - return lineCode;
91   - }
92   -
93   - public void setLineCode(String lineCode) {
94   - this.lineCode = lineCode;
95   - }
96   -}
  1 +package com.bsth.data.msg_queue;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +
  5 +/**
  6 + * Created by panzhao on 2017/5/11.
  7 + */
  8 +public class QueueData_Directive {
  9 +
  10 + /**
  11 + * 指令类型
  12 + * 60_02
  13 + * 60_03
  14 + * 64
  15 + */
  16 + private String code;
  17 +
  18 + /** 60调度指令内容 60_02*/
  19 + private ScheduleRealInfo sch;
  20 + private int finish;
  21 +
  22 + /** 60 营运指令 60_03*/
  23 + private String nbbm;
  24 + private int state;
  25 + private int upDown;
  26 +
  27 + /** 64指令内容 */
  28 + private String lineCode;
  29 +
  30 + private String sender;
  31 +
  32 +
  33 + public ScheduleRealInfo getSch() {
  34 + return sch;
  35 + }
  36 +
  37 + public void setSch(ScheduleRealInfo sch) {
  38 + this.sch = sch;
  39 + }
  40 +
  41 + public int getFinish() {
  42 + return finish;
  43 + }
  44 +
  45 + public void setFinish(int finish) {
  46 + this.finish = finish;
  47 + }
  48 +
  49 + public String getSender() {
  50 + return sender;
  51 + }
  52 +
  53 + public void setSender(String sender) {
  54 + this.sender = sender;
  55 + }
  56 +
  57 + public String getNbbm() {
  58 + return nbbm;
  59 + }
  60 +
  61 + public void setNbbm(String nbbm) {
  62 + this.nbbm = nbbm;
  63 + }
  64 +
  65 + public int getState() {
  66 + return state;
  67 + }
  68 +
  69 + public void setState(int state) {
  70 + this.state = state;
  71 + }
  72 +
  73 + public int getUpDown() {
  74 + return upDown;
  75 + }
  76 +
  77 + public void setUpDown(int upDown) {
  78 + this.upDown = upDown;
  79 + }
  80 +
  81 + public String getCode() {
  82 + return code;
  83 + }
  84 +
  85 + public void setCode(String code) {
  86 + this.code = code;
  87 + }
  88 +
  89 + public String getLineCode() {
  90 + return lineCode;
  91 + }
  92 +
  93 + public void setLineCode(String lineCode) {
  94 + this.lineCode = lineCode;
  95 + }
  96 +}
... ...
src/main/java/com/bsth/data/msg_queue/WebSocketPushQueue.java
1   -package com.bsth.data.msg_queue;
2   -
3   -import com.bsth.common.Constants;
4   -import org.slf4j.Logger;
5   -import org.slf4j.LoggerFactory;
6   -import org.springframework.boot.CommandLineRunner;
7   -import org.springframework.stereotype.Component;
8   -import org.springframework.web.socket.TextMessage;
9   -import org.springframework.web.socket.WebSocketSession;
10   -
11   -import java.util.LinkedList;
12   -
13   -/**
14   - * 线调web socket 推送队列
15   - * Created by panzhao on 2017/5/11.
16   - */
17   -@Component
18   -public class WebSocketPushQueue implements CommandLineRunner {
19   -
20   - static LinkedList<QueueData> linkedList;
21   - static DataPushThread thread;
22   - static Logger log = LoggerFactory.getLogger(WebSocketPushQueue.class);
23   - static long t;
24   - static final int IDLE_TIME = 1000 * 30;
25   -
26   - static {
27   - linkedList = new LinkedList();
28   - }
29   -
30   - public static boolean isIdle() {
31   - return System.currentTimeMillis() - t > IDLE_TIME;
32   - }
33   -
34   - public static void put(WebSocketSession session, TextMessage msg) {
35   - QueueData qd = new QueueData();
36   - qd.setMessage(msg);
37   - qd.setSession(session);
38   -
39   - log.info("put、[" + session.getAttributes().get(Constants.SESSION_USERNAME) + "] 、" + msg.getPayload());
40   - linkedList.add(qd);
41   - }
42   -
43   - public static void start() {
44   - if (thread != null) {
45   - thread.interrupt();
46   - }
47   - thread = new DataPushThread();
48   - thread.start();
49   - }
50   -
51   - @Override
52   - public void run(String... strings) throws Exception {
53   - start();
54   - }
55   -
56   - public static class DataPushThread extends Thread {
57   -
58   - Logger log = LoggerFactory.getLogger(this.getClass());
59   -
60   - @Override
61   - public void run() {
62   - QueueData qd;
63   - WebSocketSession session;
64   -
65   - boolean sleepFlag = false;
66   - while (true) {
67   - try {
68   - qd = linkedList.pollFirst();
69   - if (qd != null) {
70   - sleepFlag = false;
71   - session = qd.getSession();
72   - if (session.isOpen()) {
73   - log.info("push start、[" + session.getAttributes().get(Constants.SESSION_USERNAME) + "] 、" + qd.getMessage().getPayload());
74   - session.sendMessage(qd.getMessage());
75   - log.info("push end..");
76   - }
77   - } else {
78   - Thread.sleep(500);
79   - if (!sleepFlag) {
80   - log.info("sleep...");
81   - sleepFlag = true;
82   - }
83   - }
84   - t = System.currentTimeMillis();
85   - } catch (InterruptedException e) {
86   - break;
87   - } catch (Exception e) {
88   - log.error("", e);
89   - }
90   - }
91   - }
92   - }
93   -}
  1 +package com.bsth.data.msg_queue;
  2 +
  3 +import com.bsth.common.Constants;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.boot.CommandLineRunner;
  7 +import org.springframework.stereotype.Component;
  8 +import org.springframework.web.socket.TextMessage;
  9 +import org.springframework.web.socket.WebSocketSession;
  10 +
  11 +import java.util.LinkedList;
  12 +
  13 +/**
  14 + * 线调web socket 推送队列
  15 + * Created by panzhao on 2017/5/11.
  16 + */
  17 +@Component
  18 +public class WebSocketPushQueue implements CommandLineRunner {
  19 +
  20 + static LinkedList<QueueData> linkedList;
  21 + static DataPushThread thread;
  22 + static Logger log = LoggerFactory.getLogger(WebSocketPushQueue.class);
  23 + static long t;
  24 + static final int IDLE_TIME = 1000 * 30;
  25 +
  26 + static {
  27 + linkedList = new LinkedList();
  28 + }
  29 +
  30 + public static boolean isIdle() {
  31 + return System.currentTimeMillis() - t > IDLE_TIME;
  32 + }
  33 +
  34 + public static void put(WebSocketSession session, TextMessage msg) {
  35 + QueueData qd = new QueueData();
  36 + qd.setMessage(msg);
  37 + qd.setSession(session);
  38 +
  39 + log.info("put、[" + session.getAttributes().get(Constants.SESSION_USERNAME) + "] 、" + msg.getPayload());
  40 + linkedList.add(qd);
  41 + }
  42 +
  43 + public static void start() {
  44 + if (thread != null) {
  45 + thread.interrupt();
  46 + }
  47 + thread = new DataPushThread();
  48 + thread.start();
  49 + }
  50 +
  51 + @Override
  52 + public void run(String... strings) throws Exception {
  53 + start();
  54 + }
  55 +
  56 + public static class DataPushThread extends Thread {
  57 +
  58 + Logger log = LoggerFactory.getLogger(this.getClass());
  59 +
  60 + @Override
  61 + public void run() {
  62 + QueueData qd;
  63 + WebSocketSession session;
  64 +
  65 + boolean sleepFlag = false;
  66 + while (true) {
  67 + try {
  68 + qd = linkedList.pollFirst();
  69 + if (qd != null) {
  70 + sleepFlag = false;
  71 + session = qd.getSession();
  72 + if (session.isOpen()) {
  73 + log.info("push start、[" + session.getAttributes().get(Constants.SESSION_USERNAME) + "] 、" + qd.getMessage().getPayload());
  74 + session.sendMessage(qd.getMessage());
  75 + log.info("push end..");
  76 + }
  77 + } else {
  78 + Thread.sleep(500);
  79 + if (!sleepFlag) {
  80 + log.info("sleep...");
  81 + sleepFlag = true;
  82 + }
  83 + }
  84 + t = System.currentTimeMillis();
  85 + } catch (InterruptedException e) {
  86 + break;
  87 + } catch (Exception e) {
  88 + log.error("", e);
  89 + }
  90 + }
  91 + }
  92 + }
  93 +}
... ...
src/main/java/com/bsth/entity/schedule/TTInfoDetail.java
... ... @@ -86,6 +86,8 @@ public class TTInfoDetail extends BEntity {
86 86  
87 87 /** 是否分班(表示这个班次是否是晚班班次,就是换另外一个驾驶员开)*/
88 88 private Boolean isFB;
  89 + /** 是否停驶(表示此班次执行完成,停在终点站,不进场) */
  90 + private Boolean isTS;
89 91  
90 92 /** 是否切换线路 */
91 93 private Boolean isSwitchXl;
... ... @@ -280,4 +282,12 @@ public class TTInfoDetail extends BEntity {
280 282 public void setZdzName(String zdzName) {
281 283 this.zdzName = zdzName;
282 284 }
  285 +
  286 + public Boolean getIsTS() {
  287 + return isTS;
  288 + }
  289 +
  290 + public void setIsTS(Boolean isTS) {
  291 + this.isTS = isTS;
  292 + }
283 293 }
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -198,7 +198,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
198 198  
199 199 }
200 200 if(addList.size()>0){
201   - new BatchSaveUtils<Ylb>().saveList(addList, Ylb.class);
  201 + try {
  202 + new BatchSaveUtils<Ylb>().saveList2(addList, Ylb.class);
  203 + } catch (Exception e) {
  204 + // TODO: handle exception
  205 + if(e.getMessage().indexOf("PK_YLB_UK")>0){
  206 + newMap.put("fage", "存在相同数据,数据已经过滤");
  207 + logger.info("定时器:存在相同数据,数据已经过滤");
  208 + }
  209 + }
  210 +// new BatchSaveUtils<Ylb>().saveList(addList, Ylb.class);
202 211 }
203 212 result = "success";
204 213 }catch (Exception e) {
... ... @@ -363,7 +372,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
363 372 }
364 373 }
365 374 if(addList.size()>0){
366   - new BatchSaveUtils<Ylb>().saveList(addList, Ylb.class);
  375 + try {
  376 + new BatchSaveUtils<Ylb>().saveList2(addList, Ylb.class);
  377 + } catch (Exception e) {
  378 + // TODO: handle exception
  379 + if(e.getMessage().indexOf("PK_YLB_UK")>0){
  380 + newMap.put("fage", "存在相同数据,数据已经过滤");
  381 + logger.info("获取:存在相同数据,数据已经过滤");
  382 + }
  383 + }
  384 +
367 385 }
368 386  
369 387 if(updateList.size()>0){
... ... @@ -372,7 +390,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
372 390 }
373 391 }
374 392 newMap.put("status", ResponseCode.SUCCESS);
375   - } catch (ParseException e) {
  393 + } catch (Exception e) {
376 394 // TODO Auto-generated catch block
377 395 newMap.put("status", ResponseCode.ERROR);
378 396 throw e;
... ... @@ -778,7 +796,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
778 796 t.setYh(0.0);
779 797 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){
780 798 t.setCreatetime(new Date());
781   - repository.save(t);
  799 + try {
  800 + repository.save(t);
  801 + } catch (Exception e) {
  802 + // TODO: handle exception
  803 + if(e.getMessage().indexOf("PK_YLB_UK")>0){
  804 + newMap.put("fage", "存在相同数据,数据已经过滤");
  805 + logger.info("核对有存油没里程:存在相同数据,数据已经过滤");
  806 + }
  807 + }
  808 +
782 809 /*if(null!=cyl){
783 810 cyl.setCyl(Arith.add(t.getJzl(), t.getCzyl()));
784 811 cyl.setUpdatetime(y1.getYyrq());
... ...
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
... ... @@ -222,7 +222,21 @@ public class CulateMileageServiceImpl implements CulateMileageService{
222 222 if (!isInOut(scheduleRealInfo)) {
223 223 if(!scheduleRealInfo.isDestroy()){
224 224 if(scheduleRealInfo.isSflj()){
225   - ljgl=Arith.add(ljgl,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
  225 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  226 + if(childTaskPlans.isEmpty()){
  227 + ljgl=Arith.add(ljgl,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
  228 + }else{
  229 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  230 + while (it.hasNext()) {
  231 + ChildTaskPlan childTaskPlan = it.next();
  232 + if(childTaskPlan.getMileageType().equals("service")){
  233 + if (!childTaskPlan.isDestroy()) {
  234 + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  235 + ljgl=Arith.add(ljgl,jhgl);
  236 + }
  237 + }
  238 + }
  239 + }
226 240 }else{
227 241 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
228 242 if(!childTaskPlans.isEmpty()){
... ...
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -869,50 +869,50 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
869 869 Map<String, Object> m0 = new HashMap<String, Object>();
870 870 m0.put("time", "首~6:30");
871 871 m0.put("upbc", "0"); m0.put("dnbc", "0");
872   - m0.put("upys", "--"); m0.put("dnys", "--");
873   - m0.put("pjys", "--");
  872 + m0.put("upys", "/"); m0.put("dnys", "/");
  873 + m0.put("pjys", "/");
874 874 tempList.add(m0);
875 875 Map<String, Object> m1 = new HashMap<String, Object>();
876 876 m1.put("time", "6:31~8:30");
877 877 m1.put("upbc", "0"); m1.put("dnbc", "0");
878   - m1.put("upys", "--"); m1.put("dnys", "--");
879   - m1.put("pjys", "--");
  878 + m1.put("upys", "/"); m1.put("dnys", "/");
  879 + m1.put("pjys", "/");
880 880 tempList.add(m1);
881 881 Map<String, Object> m2 = new HashMap<String, Object>();
882 882 m2.put("time", "8:31~11:00");
883 883 m2.put("upbc", "0"); m2.put("dnbc", "0");
884   - m2.put("upys", "--"); m2.put("dnys", "--");
885   - m2.put("pjys", "--");
  884 + m2.put("upys", "/"); m2.put("dnys", "/");
  885 + m2.put("pjys", "/");
886 886 tempList.add(m2);
887 887 Map<String, Object> m3 = new HashMap<String, Object>();
888 888 m3.put("time", "11:01~13:30");
889 889 m3.put("upbc", "0"); m3.put("dnbc", "0");
890   - m3.put("upys", "--"); m3.put("dnys", "--");
891   - m3.put("pjys", "--");
  890 + m3.put("upys", "/"); m3.put("dnys", "/");
  891 + m3.put("pjys", "/");
892 892 tempList.add(m3);
893 893 Map<String, Object> m4 = new HashMap<String, Object>();
894 894 m4.put("time", "13:31~16:00");
895 895 m4.put("upbc", "0"); m4.put("dnbc", "0");
896   - m4.put("upys", "--"); m4.put("dnys", "--");
897   - m4.put("pjys", "--");
  896 + m4.put("upys", "/"); m4.put("dnys", "/");
  897 + m4.put("pjys", "/");
898 898 tempList.add(m4);
899 899 Map<String, Object> m5 = new HashMap<String, Object>();
900 900 m5.put("time", "16:01~18:00");
901 901 m5.put("upbc", "0"); m5.put("dnbc", "0");
902   - m5.put("upys", "--"); m5.put("dnys", "--");
903   - m5.put("pjys", "--");
  902 + m5.put("upys", "/"); m5.put("dnys", "/");
  903 + m5.put("pjys", "/");
904 904 tempList.add(m5);
905 905 Map<String, Object> m6 = new HashMap<String, Object>();
906 906 m6.put("time", "18:01~20:30");
907 907 m6.put("upbc", "0"); m6.put("dnbc", "0");
908   - m6.put("upys", "--"); m6.put("dnys", "--");
909   - m6.put("pjys", "--");
  908 + m6.put("upys", "/"); m6.put("dnys", "/");
  909 + m6.put("pjys", "/");
910 910 tempList.add(m6);
911 911 Map<String, Object> m7 = new HashMap<String, Object>();
912 912 m7.put("time", "20:31~末");
913 913 m7.put("upbc", "0"); m7.put("dnbc", "0");
914   - m7.put("upys", "--"); m7.put("dnys", "--");
915   - m7.put("pjys", "--");
  914 + m7.put("upys", "/"); m7.put("dnys", "/");
  915 + m7.put("pjys", "/");
916 916 tempList.add(m7);
917 917 }
918 918  
... ... @@ -1367,6 +1367,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1367 1367 }
1368 1368 for(String key : keyMap.keySet()){
1369 1369 Map<String, Object> tempMap = new HashMap<String, Object>();
  1370 + Map<String, Object> m = new HashMap<String, Object>();
1370 1371 Map<Long, ScheduleRealInfo> temp0 = new HashMap<Long, ScheduleRealInfo>();
1371 1372 List<Long> longList0 = new ArrayList<Long>();
1372 1373 Map<Long, ScheduleRealInfo> temp1 = new HashMap<Long, ScheduleRealInfo>();
... ... @@ -1410,6 +1411,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1410 1411 if(delay >= -3 && delay <= 1){
1411 1412 sjbc++;
1412 1413 }
  1414 + m.put("qdzFirst0", shouban0.getQdzName());
  1415 + m.put("jhfcFirst0", shouban0.getFcsj());
  1416 + m.put("sjfcFirst0", shouban0.getFcsjActual());
  1417 + m.put("delayFirst0", delay>0?"+"+delay:delay);
1413 1418 }
1414 1419  
1415 1420 if(moban0.getFcsjActual() != null){
... ... @@ -1420,7 +1425,20 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1420 1425 if(delay >= -3 && delay <= 1){
1421 1426 sjbc++;
1422 1427 }
  1428 + m.put("qdzLast0", moban0.getQdzName());
  1429 + m.put("jhfcLast0", moban0.getFcsj());
  1430 + m.put("sjfcLast0", moban0.getFcsjActual());
  1431 + m.put("delayLast0", delay>0?"+"+delay:delay);
1423 1432 }
  1433 + } else {
  1434 + m.put("qdzFirst0", "--");
  1435 + m.put("jhfcFirst0", "/");
  1436 + m.put("sjfcFirst0", "/");
  1437 + m.put("delayFirst0", "/");
  1438 + m.put("qdzLast0", "--");
  1439 + m.put("jhfcLast0", "/");
  1440 + m.put("sjfcLast0", "/");
  1441 + m.put("delayLast0", "/");
1424 1442 }
1425 1443  
1426 1444 if(longList1.size() != 0){
... ... @@ -1435,7 +1453,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1435 1453 if(delay >= -3 && delay <= 1){
1436 1454 sjbc++;
1437 1455 }
  1456 + m.put("qdzFirst1", shouban1.getQdzName());
  1457 + m.put("jhfcFirst1", shouban1.getFcsj());
  1458 + m.put("sjfcFirst1", shouban1.getFcsjActual());
  1459 + m.put("delayFirst1", delay>0?"+"+delay:delay);
1438 1460 }
  1461 +
1439 1462 if(moban1.getFcsjActual() != null){
1440 1463 jhbc++;
1441 1464 String[] split = moban1.getFcsjActual().split(":");
... ... @@ -1444,9 +1467,24 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1444 1467 if(delay >= -3 && delay <= 1){
1445 1468 sjbc++;
1446 1469 }
  1470 + m.put("qdzLast1", moban1.getQdzName());
  1471 + m.put("jhfcLast1", moban1.getFcsj());
  1472 + m.put("sjfcLast1", moban1.getFcsjActual());
  1473 + m.put("delayLast1", delay>0?"+"+delay:delay);
1447 1474 }
  1475 + } else {
  1476 + m.put("qdzFirst1", "--");
  1477 + m.put("jhfcFirst1", "/");
  1478 + m.put("sjfcFirst1", "/");
  1479 + m.put("delayFirst1", "/");
  1480 + m.put("qdzLast1", "--");
  1481 + m.put("jhfcLast1", "/");
  1482 + m.put("sjfcLast1", "/");
  1483 + m.put("delayLast1", "/");
1448 1484 }
1449   -
  1485 +
  1486 + m.put("line", key);
  1487 + tempMap.put("map", m);
1450 1488 tempMap.put("jhbc", jhbc);
1451 1489 tempMap.put("sjbc", sjbc);
1452 1490 tempMap.put("zdl", nf.format((float) sjbc / jhbc *100) + "%");
... ...
src/main/java/com/bsth/service/schedule/rules/validate/ValidRepeatBcFunction.java
1   -package com.bsth.service.schedule.rules.validate;
2   -
3   -import com.bsth.entity.schedule.SchedulePlanInfo;
4   -import org.kie.api.runtime.rule.AccumulateFunction;
5   -
6   -import java.io.*;
7   -import java.text.SimpleDateFormat;
8   -import java.util.ArrayList;
9   -import java.util.HashMap;
10   -import java.util.List;
11   -import java.util.Map;
12   -
13   -/**
14   - * 计算班次重复错误。
15   - * 同一个路牌下,相同发车时间的班次数。
16   - * 注意:使用这个函数时,要一天计算一次,多天计算无意义。
17   - */
18   -public class ValidRepeatBcFunction implements AccumulateFunction {
19   - @Override
20   - public void writeExternal(ObjectOutput out) throws IOException {
21   - }
22   -
23   - @Override
24   - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
25   -
26   - }
27   -
28   - protected static class RepeatBcInfo implements Externalizable {
29   - /** 错误描述 */
30   - public List<ValidateResults_output.ValidInfo> validInfoList = new ArrayList<>();
31   - /** 内部计数Map,key:{路牌Id}_{发车时间},value:个数 */
32   - public Map<String, Integer> lpBcFcsjCount = new HashMap<>();
33   -
34   - public RepeatBcInfo() {
35   - }
36   -
37   - @Override
38   - public void writeExternal(ObjectOutput out) throws IOException {
39   - out.writeObject(validInfoList);
40   - }
41   -
42   - @Override
43   - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
44   - validInfoList = (List<ValidateResults_output.ValidInfo>) in.readObject();
45   - }
46   - }
47   -
48   - @Override
49   - public Serializable createContext() {
50   - System.out.println("create");
51   - return new RepeatBcInfo();
52   - }
53   -
54   - @Override
55   - public void init(Serializable serializable) throws Exception {
56   - // TODO:
57   - System.out.println("init");
58   - }
59   -
60   - @Override
61   - public void accumulate(Serializable context, Object o) {
62   - RepeatBcInfo repeatBcInfo = (RepeatBcInfo) context;
63   - SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o;
64   -
65   - String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj();
66   - SimpleDateFormat sf = new SimpleDateFormat("yyyy年MM月dd日");
67   - String infoformat = "日期(%s),路牌(%s),班次(%s),重复(%d)次";
68   - if (repeatBcInfo.lpBcFcsjCount.get(key) == null) {
69   - repeatBcInfo.lpBcFcsjCount.put(key, 1);
70   - } else {
71   - int count = repeatBcInfo.lpBcFcsjCount.get(key) + 1;
72   - ValidateResults_output.ValidInfo validInfo = new ValidateResults_output.ValidInfo();
73   - validInfo.setSd(schedulePlanInfo.getScheduleDate());
74   - validInfo.setDesc(String.format(
75   - infoformat,
76   - sf.format(schedulePlanInfo.getScheduleDate()),
77   - schedulePlanInfo.getLpName(),
78   - schedulePlanInfo.getFcsj(),
79   - count));
80   - repeatBcInfo.validInfoList.add(validInfo);
81   - repeatBcInfo.lpBcFcsjCount.put(key, count);
82   - }
83   - }
84   -
85   - @Override
86   - public boolean supportsReverse() {
87   - return true;
88   - }
89   -
90   - @Override
91   - public void reverse(Serializable context, Object o) throws Exception {
92   - RepeatBcInfo repeatBcInfo = (RepeatBcInfo) context;
93   - SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o;
94   -
95   - String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj();
96   - repeatBcInfo.lpBcFcsjCount.remove(key);
97   -
98   - if (!repeatBcInfo.validInfoList.isEmpty()) { // 全部清空
99   - repeatBcInfo.validInfoList.clear();
100   - }
101   - }
102   -
103   - @Override
104   - public Class<?> getResultType() {
105   - return List.class;
106   - }
107   -
108   - @Override
109   - public Object getResult(Serializable context) throws Exception {
110   - RepeatBcInfo repeatBcInfo = (RepeatBcInfo) context;
111   - return repeatBcInfo.validInfoList;
112   - }
113   -}
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import com.bsth.entity.schedule.SchedulePlanInfo;
  4 +import org.kie.api.runtime.rule.AccumulateFunction;
  5 +
  6 +import java.io.*;
  7 +import java.text.SimpleDateFormat;
  8 +import java.util.ArrayList;
  9 +import java.util.HashMap;
  10 +import java.util.List;
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * 计算班次重复错误。
  15 + * 同一个路牌下,相同发车时间的班次数。
  16 + * 注意:使用这个函数时,要一天计算一次,多天计算无意义。
  17 + */
  18 +public class ValidRepeatBcFunction implements AccumulateFunction {
  19 + @Override
  20 + public void writeExternal(ObjectOutput out) throws IOException {
  21 + }
  22 +
  23 + @Override
  24 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  25 +
  26 + }
  27 +
  28 + protected static class RepeatBcInfo implements Externalizable {
  29 + /** 错误描述 */
  30 + public List<ValidateResults_output.ValidInfo> validInfoList = new ArrayList<>();
  31 + /** 内部计数Map,key:{路牌Id}_{发车时间},value:个数 */
  32 + public Map<String, Integer> lpBcFcsjCount = new HashMap<>();
  33 +
  34 + public RepeatBcInfo() {
  35 + }
  36 +
  37 + @Override
  38 + public void writeExternal(ObjectOutput out) throws IOException {
  39 + out.writeObject(validInfoList);
  40 + }
  41 +
  42 + @Override
  43 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  44 + validInfoList = (List<ValidateResults_output.ValidInfo>) in.readObject();
  45 + }
  46 + }
  47 +
  48 + @Override
  49 + public Serializable createContext() {
  50 + System.out.println("create");
  51 + return new RepeatBcInfo();
  52 + }
  53 +
  54 + @Override
  55 + public void init(Serializable serializable) throws Exception {
  56 + // TODO:
  57 + System.out.println("init");
  58 + }
  59 +
  60 + @Override
  61 + public void accumulate(Serializable context, Object o) {
  62 + RepeatBcInfo repeatBcInfo = (RepeatBcInfo) context;
  63 + SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o;
  64 +
  65 + String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj();
  66 + SimpleDateFormat sf = new SimpleDateFormat("yyyy年MM月dd日");
  67 + String infoformat = "日期(%s),路牌(%s),班次(%s),重复(%d)次";
  68 + if (repeatBcInfo.lpBcFcsjCount.get(key) == null) {
  69 + repeatBcInfo.lpBcFcsjCount.put(key, 1);
  70 + } else {
  71 + int count = repeatBcInfo.lpBcFcsjCount.get(key) + 1;
  72 + ValidateResults_output.ValidInfo validInfo = new ValidateResults_output.ValidInfo();
  73 + validInfo.setSd(schedulePlanInfo.getScheduleDate());
  74 + validInfo.setDesc(String.format(
  75 + infoformat,
  76 + sf.format(schedulePlanInfo.getScheduleDate()),
  77 + schedulePlanInfo.getLpName(),
  78 + schedulePlanInfo.getFcsj(),
  79 + count));
  80 + repeatBcInfo.validInfoList.add(validInfo);
  81 + repeatBcInfo.lpBcFcsjCount.put(key, count);
  82 + }
  83 + }
  84 +
  85 + @Override
  86 + public boolean supportsReverse() {
  87 + return true;
  88 + }
  89 +
  90 + @Override
  91 + public void reverse(Serializable context, Object o) throws Exception {
  92 + RepeatBcInfo repeatBcInfo = (RepeatBcInfo) context;
  93 + SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o;
  94 +
  95 + String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj();
  96 + repeatBcInfo.lpBcFcsjCount.remove(key);
  97 +
  98 + if (!repeatBcInfo.validInfoList.isEmpty()) { // 全部清空
  99 + repeatBcInfo.validInfoList.clear();
  100 + }
  101 + }
  102 +
  103 + @Override
  104 + public Class<?> getResultType() {
  105 + return List.class;
  106 + }
  107 +
  108 + @Override
  109 + public Object getResult(Serializable context) throws Exception {
  110 + RepeatBcInfo repeatBcInfo = (RepeatBcInfo) context;
  111 + return repeatBcInfo.validInfoList;
  112 + }
  113 +}
... ...
src/main/java/com/bsth/service/schedule/rules/validate/ValidateParam.java
1   -package com.bsth.service.schedule.rules.validate;
2   -
3   -import org.joda.time.DateTime;
4   -import org.joda.time.Period;
5   -import org.joda.time.PeriodType;
6   -
7   -/**
8   - * Created by xu on 17/5/11.
9   - */
10   -public class ValidateParam {
11   - /** 开始计算日期 */
12   - private DateTime fromDate;
13   - /** 结束计算日期 */
14   - private DateTime toDate;
15   -
16   - /** 间隔天数 */
17   - private Integer days;
18   -
19   - public ValidateParam(DateTime f, DateTime t) {
20   - this.fromDate = f;
21   - this.toDate = t;
22   - Period period = new Period(fromDate, toDate, PeriodType.days());
23   - days = period.getDays() + 1;
24   - }
25   -
26   - public DateTime getFromDate() {
27   - return fromDate;
28   - }
29   -
30   - public void setFromDate(DateTime fromDate) {
31   - this.fromDate = fromDate;
32   - }
33   -
34   - public DateTime getToDate() {
35   - return toDate;
36   - }
37   -
38   - public void setToDate(DateTime toDate) {
39   - this.toDate = toDate;
40   - }
41   -
42   - public Integer getDays() {
43   - return days;
44   - }
45   -
46   - public void setDays(Integer days) {
47   - this.days = days;
48   - }
49   -}
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import org.joda.time.DateTime;
  4 +import org.joda.time.Period;
  5 +import org.joda.time.PeriodType;
  6 +
  7 +/**
  8 + * Created by xu on 17/5/11.
  9 + */
  10 +public class ValidateParam {
  11 + /** 开始计算日期 */
  12 + private DateTime fromDate;
  13 + /** 结束计算日期 */
  14 + private DateTime toDate;
  15 +
  16 + /** 间隔天数 */
  17 + private Integer days;
  18 +
  19 + public ValidateParam(DateTime f, DateTime t) {
  20 + this.fromDate = f;
  21 + this.toDate = t;
  22 + Period period = new Period(fromDate, toDate, PeriodType.days());
  23 + days = period.getDays() + 1;
  24 + }
  25 +
  26 + public DateTime getFromDate() {
  27 + return fromDate;
  28 + }
  29 +
  30 + public void setFromDate(DateTime fromDate) {
  31 + this.fromDate = fromDate;
  32 + }
  33 +
  34 + public DateTime getToDate() {
  35 + return toDate;
  36 + }
  37 +
  38 + public void setToDate(DateTime toDate) {
  39 + this.toDate = toDate;
  40 + }
  41 +
  42 + public Integer getDays() {
  43 + return days;
  44 + }
  45 +
  46 + public void setDays(Integer days) {
  47 + this.days = days;
  48 + }
  49 +}
... ...
src/main/java/com/bsth/service/schedule/rules/validate/ValidateResults_output.java
1   -package com.bsth.service.schedule.rules.validate;
2   -
3   -import java.util.ArrayList;
4   -import java.util.Date;
5   -import java.util.List;
6   -
7   -/**
8   - * 验证输出。
9   - */
10   -public class ValidateResults_output {
11   - private List<ValidInfo> infos = new ArrayList<>();
12   -
13   - public static class ValidInfo {
14   - /** 日期 */
15   - private Date sd;
16   - /** 描述 */
17   - private String desc;
18   -
19   - public Date getSd() {
20   - return sd;
21   - }
22   -
23   - public void setSd(Date sd) {
24   - this.sd = sd;
25   - }
26   -
27   - public String getDesc() {
28   - return desc;
29   - }
30   -
31   - public void setDesc(String desc) {
32   - this.desc = desc;
33   - }
34   - }
35   -
36   - public List<ValidInfo> getInfos() {
37   - return infos;
38   - }
39   -
40   - public void setInfos(List<ValidInfo> infos) {
41   - this.infos = infos;
42   - }
43   -}
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.Date;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 验证输出。
  9 + */
  10 +public class ValidateResults_output {
  11 + private List<ValidInfo> infos = new ArrayList<>();
  12 +
  13 + public static class ValidInfo {
  14 + /** 日期 */
  15 + private Date sd;
  16 + /** 描述 */
  17 + private String desc;
  18 +
  19 + public Date getSd() {
  20 + return sd;
  21 + }
  22 +
  23 + public void setSd(Date sd) {
  24 + this.sd = sd;
  25 + }
  26 +
  27 + public String getDesc() {
  28 + return desc;
  29 + }
  30 +
  31 + public void setDesc(String desc) {
  32 + this.desc = desc;
  33 + }
  34 + }
  35 +
  36 + public List<ValidInfo> getInfos() {
  37 + return infos;
  38 + }
  39 +
  40 + public void setInfos(List<ValidInfo> infos) {
  41 + this.infos = infos;
  42 + }
  43 +}
... ...
src/main/java/com/bsth/util/BatchSaveUtils.java
... ... @@ -99,6 +99,47 @@ public class BatchSaveUtils&lt;T&gt; {
99 99 return 0;
100 100 }
101 101  
  102 + public int saveList2(List<T> list, Class<T> clazz) throws Exception{
  103 + //获取泛型 T 的字节码
  104 + Table table = clazz.getAnnotation(Table.class);
  105 + if(null == table){
  106 + logger.error("找不到" + clazz.getSimpleName() + "类的表映射");
  107 + return -1;
  108 + }
  109 + List<Field> fs = fieldFilter(clazz.getDeclaredFields());
  110 + String sql = createSql(table, fs);
  111 + logger.info(sql);
  112 +
  113 + //每5000条批量入库一次
  114 + Connection conn = null;
  115 + PreparedStatement ps = null;
  116 + try{
  117 + conn = getConn();
  118 + conn.setAutoCommit(false);
  119 + ps = conn.prepareStatement(sql);
  120 +
  121 + int fsize = fs.size(), count = 0;
  122 + for(T t : list){
  123 + count ++;
  124 + for(int i = 0; i < fsize; i ++){
  125 + ps.setObject(i + 1, fs.get(i).get(t));
  126 + }
  127 +
  128 + ps.addBatch();
  129 + if(count % batchSize == 0){
  130 + ps.executeBatch();
  131 + conn.commit();
  132 + ps.clearBatch();
  133 + }
  134 + }
  135 + ps.executeBatch();
  136 + conn.commit();
  137 + }finally {
  138 + closeAll(conn, ps, null);
  139 + }
  140 +
  141 + return 0;
  142 + }
102 143 public String createSql(Table table, List<Field> fs){
103 144 String sqlBefore = "insert into " + table.name() + "("
104 145 ,sqlValues = " values(";
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInput.ktr
... ... @@ -828,7 +828,7 @@
828 828 <optimizationLevel>9</optimizationLevel>
829 829 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
830 830 <jsScript_name>Script 1</jsScript_name>
831   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x53bb;&#x9664;&#x7ad9;&#x70b9;&#x540d;&#x79f0;&#x4e2d;&#x7684;&#x6570;&#x5b57;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;&#x5c;d&#x2b;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;&#xa;&#x2f;&#x2f; sendtime&#x5904;&#x7406;&#xff0c;hhmm&#xff0c;hh&#x3a;mm&#xff0c;hh,mm&#xa;var sendtime_calcu&#x3b;&#xa;if &#x28;sendtime.length &#x3d;&#x3d; 5&#x29; &#x7b; &#x2f;&#x2f; &#x6700;&#x957f;&#x683c;&#x5f0f;&#xff0c;&#x5305;&#x62ec;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x7edf;&#x4e00;&#x628a;&#x5206;&#x9694;&#x7b26;&#x66ff;&#x6362;&#x6210;&#x5192;&#x53f7;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;3, 2&#x29;&#x3b;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; if &#x28;sendtime.indexOf&#x28;&#x22;&#x3a;&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5192;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x65e0;&#x9700;&#x4fee;&#x6539;&#xa; sendtime_calcu &#x3d; sendtime&#x3b;&#xa; &#x7d; else if &#x28;sendtime.indexOf&#x28;&#x22;,&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x9017;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d; else &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 3&#x29; &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;1, 2&#x29;&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
  831 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x53bb;&#x9664;&#x7ad9;&#x70b9;&#x540d;&#x79f0;&#x4e2d;&#x7684;&#x6570;&#x5b57;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;&#x5c;d&#x2b;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;&#xa;&#x2f;&#x2f; sendtime&#x5904;&#x7406;&#xff0c;hhmm&#xff0c;hh&#x3a;mm&#xff0c;hh,mm&#xa;var sendtime_calcu&#x3b;&#xa;if &#x28;sendtime.length &#x3d;&#x3d; 5&#x29; &#x7b; &#x2f;&#x2f; &#x6700;&#x957f;&#x683c;&#x5f0f;&#xff0c;&#x5305;&#x62ec;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x7edf;&#x4e00;&#x628a;&#x5206;&#x9694;&#x7b26;&#x66ff;&#x6362;&#x6210;&#x5192;&#x53f7;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;3, 2&#x29;&#x3b;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; if &#x28;sendtime.indexOf&#x28;&#x22;&#x3a;&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5192;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x65e0;&#x9700;&#x4fee;&#x6539;&#xa; sendtime_calcu &#x3d; sendtime&#x3b;&#xa; &#x7d; else if &#x28;sendtime.indexOf&#x28;&#x22;,&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x9017;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d; else &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 3&#x29; &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;1, 2&#x29;&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x505c;&#x9a76;&#xa;var ists &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
832 832 </jsScript> </jsScripts> <fields> <field> <name>qdzname</name>
833 833 <rename>qdzname</rename>
834 834 <type>String</type>
... ... @@ -853,6 +853,12 @@
853 853 <length>-1</length>
854 854 <precision>-1</precision>
855 855 <replace>N</replace>
  856 + </field> <field> <name>ists</name>
  857 + <rename>ists</rename>
  858 + <type>Integer</type>
  859 + <length>-1</length>
  860 + <precision>-1</precision>
  861 + <replace>N</replace>
856 862 </field> </fields> <cluster_schema/>
857 863 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
858 864 <xloc>788</xloc>
... ... @@ -1083,6 +1089,11 @@
1083 1089 <rename>zdzname</rename>
1084 1090 <update>Y</update>
1085 1091 </value>
  1092 + <value>
  1093 + <name>ists</name>
  1094 + <rename>ists</rename>
  1095 + <update>Y</update>
  1096 + </value>
1086 1097 </lookup>
1087 1098 <cluster_schema/>
1088 1099 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
... ... @@ -1224,6 +1235,11 @@
1224 1235 <rename>zdzname</rename>
1225 1236 <update>Y</update>
1226 1237 </value>
  1238 + <value>
  1239 + <name>ists</name>
  1240 + <rename>ists</rename>
  1241 + <update>Y</update>
  1242 + </value>
1227 1243 </lookup>
1228 1244 <cluster_schema/>
1229 1245 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
... ... @@ -1365,6 +1381,11 @@
1365 1381 <rename>tn</rename>
1366 1382 <update>Y</update>
1367 1383 </value>
  1384 + <value>
  1385 + <name>ists</name>
  1386 + <rename>ists</rename>
  1387 + <update>Y</update>
  1388 + </value>
1368 1389 </lookup>
1369 1390 <cluster_schema/>
1370 1391 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInput2.ktr
... ... @@ -828,7 +828,7 @@
828 828 <optimizationLevel>9</optimizationLevel>
829 829 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
830 830 <jsScript_name>Script 1</jsScript_name>
831   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x53bb;&#x9664;&#x7ad9;&#x70b9;&#x540d;&#x79f0;&#x4e2d;&#x7684;&#x6570;&#x5b57;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;&#x5c;d&#x2b;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;&#xa;&#x2f;&#x2f; sendtime&#x5904;&#x7406;&#xff0c;hhmm&#xff0c;hh&#x3a;mm&#xff0c;hh,mm&#xa;var sendtime_calcu&#x3b;&#xa;if &#x28;sendtime.length &#x3d;&#x3d; 5&#x29; &#x7b; &#x2f;&#x2f; &#x6700;&#x957f;&#x683c;&#x5f0f;&#xff0c;&#x5305;&#x62ec;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x7edf;&#x4e00;&#x628a;&#x5206;&#x9694;&#x7b26;&#x66ff;&#x6362;&#x6210;&#x5192;&#x53f7;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;3, 2&#x29;&#x3b;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; if &#x28;sendtime.indexOf&#x28;&#x22;&#x3a;&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5192;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x65e0;&#x9700;&#x4fee;&#x6539;&#xa; sendtime_calcu &#x3d; sendtime&#x3b;&#xa; &#x7d; else if &#x28;sendtime.indexOf&#x28;&#x22;,&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x9017;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d; else &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 3&#x29; &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;1, 2&#x29;&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
  831 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x53bb;&#x9664;&#x7ad9;&#x70b9;&#x540d;&#x79f0;&#x4e2d;&#x7684;&#x6570;&#x5b57;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;&#x5c;d&#x2b;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;&#xa;&#x2f;&#x2f; sendtime&#x5904;&#x7406;&#xff0c;hhmm&#xff0c;hh&#x3a;mm&#xff0c;hh,mm&#xa;var sendtime_calcu&#x3b;&#xa;if &#x28;sendtime.length &#x3d;&#x3d; 5&#x29; &#x7b; &#x2f;&#x2f; &#x6700;&#x957f;&#x683c;&#x5f0f;&#xff0c;&#x5305;&#x62ec;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x7edf;&#x4e00;&#x628a;&#x5206;&#x9694;&#x7b26;&#x66ff;&#x6362;&#x6210;&#x5192;&#x53f7;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;3, 2&#x29;&#x3b;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; if &#x28;sendtime.indexOf&#x28;&#x22;&#x3a;&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5192;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x65e0;&#x9700;&#x4fee;&#x6539;&#xa; sendtime_calcu &#x3d; sendtime&#x3b;&#xa; &#x7d; else if &#x28;sendtime.indexOf&#x28;&#x22;,&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x9017;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d; else &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 3&#x29; &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;1, 2&#x29;&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x505c;&#x9a76;&#xa;var ists &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
832 832 </jsScript> </jsScripts> <fields> <field> <name>qdzname</name>
833 833 <rename>qdzname</rename>
834 834 <type>String</type>
... ... @@ -853,6 +853,12 @@
853 853 <length>-1</length>
854 854 <precision>-1</precision>
855 855 <replace>N</replace>
  856 + </field> <field> <name>ists</name>
  857 + <rename>ists</rename>
  858 + <type>Integer</type>
  859 + <length>-1</length>
  860 + <precision>-1</precision>
  861 + <replace>N</replace>
856 862 </field> </fields> <cluster_schema/>
857 863 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
858 864 <xloc>788</xloc>
... ... @@ -1083,6 +1089,11 @@
1083 1089 <rename>zdzname</rename>
1084 1090 <update>Y</update>
1085 1091 </value>
  1092 + <value>
  1093 + <name>ists</name>
  1094 + <rename>ists</rename>
  1095 + <update>Y</update>
  1096 + </value>
1086 1097 </lookup>
1087 1098 <cluster_schema/>
1088 1099 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
... ... @@ -1224,6 +1235,11 @@
1224 1235 <rename>zdzname</rename>
1225 1236 <update>Y</update>
1226 1237 </value>
  1238 + <value>
  1239 + <name>ists</name>
  1240 + <rename>ists</rename>
  1241 + <update>Y</update>
  1242 + </value>
1227 1243 </lookup>
1228 1244 <cluster_schema/>
1229 1245 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
... ... @@ -1365,6 +1381,11 @@
1365 1381 <rename>tn</rename>
1366 1382 <update>Y</update>
1367 1383 </value>
  1384 + <value>
  1385 + <name>ists</name>
  1386 + <rename>ists</rename>
  1387 + <update>Y</update>
  1388 + </value>
1368 1389 </lookup>
1369 1390 <cluster_schema/>
1370 1391 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
... ...
src/main/resources/rules/validplan.drl
1   -package com.bsth.service.schedule.rules.validate;
2   -
3   -import com.bsth.entity.schedule.SchedulePlanInfo;
4   -
5   -import org.joda.time.*;
6   -import java.util.*;
7   -
8   -import org.slf4j.Logger;
9   -
10   -// 全局日志类(一般使用调用此规则的service类)
11   -global Logger log;
12   -
13   -// 输出
14   -global ValidateResults_output validResult;
15   -
16   -//------------------------- 第一阶段、构造循环体 ----------------------------//
17   -
18   -declare Loop_param
19   - start_date: DateTime // 开始日期(这个要不停的更新迭代)
20   - end_date: DateTime // 结束日期
21   - sdays: Integer // 总共循环的天数
22   -end
23   -
24   -rule "Calcu_Loop_param"
25   - salience 1000
26   - when
27   - ValidateParam(
28   - $fd: fromDate,
29   - $ed: toDate,
30   - $days: days
31   - )
32   - then
33   - Loop_param p = new Loop_param();
34   - p.setStart_date($fd);
35   - p.setEnd_date($ed);
36   - p.setSdays($days);
37   -
38   - insert(p);
39   -end
40   -
41   -//------------------------- 第二阶段、验证计算 ----------------------------//
42   -
43   -
44   -rule "Valid_repeat_bc" // 验证是否存在重复班次
45   - salience 600
46   - when
47   - $lp: Loop_param($sd: start_date, $ed: end_date)
48   - eval($sd.isBefore($ed) || $sd.isEqual($ed))
49   - $spiList: ArrayList() from collect (SchedulePlanInfo(scheduleDate.getTime() == $sd.getMillis()))
50   - $infos: ArrayList() from accumulate ($spi: SchedulePlanInfo() from $spiList, vrb($spi))
51   - then
52   - // TODO:
53   - log.info("日期={},班次重复错误数={}", $sd, $infos.size());
54   -
55   - validResult.getInfos().addAll($infos);
56   -
57   - // 迭代
58   - $lp.setStart_date($sd.plusDays(1));
59   - update($lp);
60   -
61   -end
62   -
63   -
64   -
65   -
66   -
67   -
68   -
69   -
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import com.bsth.entity.schedule.SchedulePlanInfo;
  4 +
  5 +import org.joda.time.*;
  6 +import java.util.*;
  7 +
  8 +import org.slf4j.Logger;
  9 +
  10 +// 全局日志类(一般使用调用此规则的service类)
  11 +global Logger log;
  12 +
  13 +// 输出
  14 +global ValidateResults_output validResult;
  15 +
  16 +//------------------------- 第一阶段、构造循环体 ----------------------------//
  17 +
  18 +declare Loop_param
  19 + start_date: DateTime // 开始日期(这个要不停的更新迭代)
  20 + end_date: DateTime // 结束日期
  21 + sdays: Integer // 总共循环的天数
  22 +end
  23 +
  24 +rule "Calcu_Loop_param"
  25 + salience 1000
  26 + when
  27 + ValidateParam(
  28 + $fd: fromDate,
  29 + $ed: toDate,
  30 + $days: days
  31 + )
  32 + then
  33 + Loop_param p = new Loop_param();
  34 + p.setStart_date($fd);
  35 + p.setEnd_date($ed);
  36 + p.setSdays($days);
  37 +
  38 + insert(p);
  39 +end
  40 +
  41 +//------------------------- 第二阶段、验证计算 ----------------------------//
  42 +
  43 +
  44 +rule "Valid_repeat_bc" // 验证是否存在重复班次
  45 + salience 600
  46 + when
  47 + $lp: Loop_param($sd: start_date, $ed: end_date)
  48 + eval($sd.isBefore($ed) || $sd.isEqual($ed))
  49 + $spiList: ArrayList() from collect (SchedulePlanInfo(scheduleDate.getTime() == $sd.getMillis()))
  50 + $infos: ArrayList() from accumulate ($spi: SchedulePlanInfo() from $spiList, vrb($spi))
  51 + then
  52 + // TODO:
  53 + log.info("日期={},班次重复错误数={}", $sd, $infos.size());
  54 +
  55 + validResult.getInfos().addAll($infos);
  56 +
  57 + // 迭代
  58 + $lp.setStart_date($sd.plusDays(1));
  59 + update($lp);
  60 +
  61 +end
  62 +
  63 +
  64 +
  65 +
  66 +
  67 +
  68 +
  69 +
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
... ... @@ -67,9 +67,42 @@
67 67  
68 68 </tbody>
69 69 </table>
70   - <div style="text-align: right;">
71   - <ul id="pagination" class="pagination"></ul>
72   - </div>
  70 + </div>
  71 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  72 + <table class="table table-bordered table-hover table-checkable" id="map">
  73 + <thead>
  74 + <tr class="hidden">
  75 + <th style="display: none;"></th>
  76 + <th rowspan="2">线路</th>
  77 + <th colspan="4">上行首发</th>
  78 + <th colspan="4">上行末发</th>
  79 + <th colspan="4">下行首发</th>
  80 + <th colspan="4">下行末发</th>
  81 + </tr>
  82 + <tr class="hidden">
  83 + <th style="display: none;"></th>
  84 + <th>站点</th>
  85 + <th>计发</th>
  86 + <th>实发</th>
  87 + <th>快慢</th>
  88 + <th>站点</th>
  89 + <th>计发</th>
  90 + <th>实发</th>
  91 + <th>快慢</th>
  92 + <th>站点</th>
  93 + <th>计发</th>
  94 + <th>实发</th>
  95 + <th>快慢</th>
  96 + <th>站点</th>
  97 + <th>计发</th>
  98 + <th>实发</th>
  99 + <th>快慢</th>
  100 + </tr>
  101 + </thead>
  102 + <tbody>
  103 +
  104 + </tbody>
  105 + </table>
73 106 </div>
74 107 </div>
75 108 </div>
... ... @@ -165,6 +198,18 @@
165 198 fage=true;
166 199 }
167 200  
  201 + var list;
  202 + $("#forms tbody").on("click","a",function(){
  203 + var index = $(this).parent().parent().index();
  204 + $.each(list, function(i, g){
  205 + if(index == i){
  206 + var tbodyHtml = template('list_maps',{list:g.map});
  207 + $('#map tbody').html(tbodyHtml);
  208 + $("#map .hidden").removeClass("hidden");
  209 + $("html,body").animate({scrollTop:$("#map").offset().top},1000);
  210 + }
  211 + });
  212 + });
168 213  
169 214 $("#query").on("click",jsDoQuery);
170 215  
... ... @@ -190,12 +235,15 @@
190 235 params['line'] = line;
191 236 params['date'] = date;
192 237 params['type'] = "query";
193   - $(".hidden").removeClass("hidden");
  238 + $("#forms .hidden").removeClass("hidden");
  239 + $("#map tr").addClass("hidden");
194 240 $get('/pcpc/firstAndLastBus_sum', params, function(result){
195 241 // 把数据填充到模版中
196 242 var tbodyHtml = template('list_firstAndLastBus',{list:result});
197 243 // 把渲染好的模版html文本追加到表格中
198 244 $('#forms tbody').html(tbodyHtml);
  245 +
  246 + list = result;
199 247  
200 248 if(result.length == 0)
201 249 $("#export").attr('disabled',"true");
... ... @@ -234,7 +282,7 @@
234 282 <td>{{obj.line}}</td>
235 283 <td>{{obj.jhbc}}</td>
236 284 <td>{{obj.sjbc}}</td>
237   - <td>{{obj.zdl}}</td>
  285 + <td><a id='delay'>{{obj.zdl}}</a></td>
238 286 </tr>
239 287 {{/each}}
240 288 {{if list.length == 0}}
... ... @@ -242,4 +290,25 @@
242 290 <td colspan="20"><h6 class="muted">没有找到相关数据</h6></td>
243 291 </tr>
244 292 {{/if}}
  293 +</script>
  294 +<script type="text/html" id="list_maps">
  295 + <tr>
  296 + <td>{{list.line}}</td>
  297 + <td>{{list.qdzFirst0}}</td>
  298 + <td>{{list.jhfcFirst0}}</td>
  299 + <td>{{list.sjfcFirst0}}</td>
  300 + <td>{{list.delayFirst0}}</td>
  301 + <td>{{list.qdzLast0}}</td>
  302 + <td>{{list.jhfcLast0}}</td>
  303 + <td>{{list.sjfcLast0}}</td>
  304 + <td>{{list.delayLast0}}</td>
  305 + <td>{{list.qdzFirst1}}</td>
  306 + <td>{{list.jhfcFirst1}}</td>
  307 + <td>{{list.sjfcFirst1}}</td>
  308 + <td>{{list.delayFirst1}}</td>
  309 + <td>{{list.qdzLast1}}</td>
  310 + <td>{{list.jhfcLast1}}</td>
  311 + <td>{{list.sjfcLast1}}</td>
  312 + <td>{{list.delayLast1}}</td>
  313 + </tr>
245 314 </script>
246 315 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/edit.html
... ... @@ -73,7 +73,7 @@
73 73 icnames="cl.insideCode"
74 74 datatype="cci2"
75 75 dataassociate="true"
76   - dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id, 'isCancel_eq': false} | json }}"
  76 + dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id} | json }}"
77 77 mlp="true"
78 78 required >
79 79 </sa-Select3>
... ...
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/form.html
... ... @@ -73,7 +73,7 @@
73 73 icnames="cl.insideCode"
74 74 datatype="cci2"
75 75 dataassociate="true"
76   - dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id, 'isCancel_eq': false} | json }}"
  76 + dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id} | json }}"
77 77 mlp="true"
78 78 required >
79 79 </sa-Select3>
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html
... ... @@ -218,6 +218,14 @@
218 218  
219 219 </div>
220 220  
  221 + <div class="form-group has-success has-feedback">
  222 + <label class="col-md-2 control-label">是否停驶:</label>
  223 + <div class="col-md-3">
  224 + <sa-Radiogroup model="ctrl.TimeTableDetailForSave.isTS" dicgroup="truefalseType" name="isTS"></sa-Radiogroup>
  225 + </div>
  226 +
  227 + </div>
  228 +
221 229 <div class="form-group">
222 230 <label class="col-md-2 control-label">备注:</label>
223 231 <div class="col-md-3">
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html
... ... @@ -172,6 +172,14 @@
172 172  
173 173 </div>
174 174  
  175 + <div class="form-group has-success has-feedback">
  176 + <label class="col-md-2 control-label">是否停驶:</label>
  177 + <div class="col-md-3">
  178 + <sa-Radiogroup model="ctrl.tt.isTS" dicgroup="truefalseType" name="isTS"></sa-Radiogroup>
  179 + </div>
  180 +
  181 + </div>
  182 +
175 183 <div class="form-group">
176 184 <label class="col-md-2 control-label">备注:</label>
177 185 <div class="col-md-3">
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
... ... @@ -573,6 +573,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(
573 573 zdzCode: undefined,
574 574 bcType: undefined,
575 575 isFB: undefined,
  576 + isTS: undefined,
576 577 reSetTTinfoDetail: function(value) {
577 578 for (var key in this) {
578 579 if (!angular.isFunction(this[key])) {
... ...
src/test/resources/testdata/problem.properties
... ... @@ -2,7 +2,7 @@
2 2 ##2=时刻表明细编辑功能,数据工具移到时刻表里,类似工具栏的样子
3 3 3=时刻表导入,可以选一个已经存在的时刻表导入,而不是excel文件
4 4 ##4=所有的删除,作废,都要有提示框操作
5   -5=排班计划错误提示,如果选的排班日期之前没有排班,提示错误,排班结果有重复与时刻表不符合,显示错误
  5 +##5=排班计划错误提示,如果选的排班日期之前没有排班,提示错误,排班结果有重复与时刻表不符合,显示错误
6 6 ##6=调度执行日报,显示最近排班日期,修改操作强化
7 7 7=警告功能,如时刻表选择相同的常规有效日,特殊有效日,车辆,人员配置重复等等
8 8 8=时刻表明细编辑,颜色覆盖冲突
... ... @@ -31,4 +31,5 @@
31 31 ##30=时刻表公里数 三位数
32 32  
33 33 31=规则修改,路牌范围,人员范围可以拖动
34   -#32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入
  34 +##32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入
  35 +##33=时刻表明细班次,里添加,是否停驶选项(计算工时使用)
... ...