Commit b292d514f7108473edef2d7fa153521165a401fe
1 parent
039f5e9f
20223-10-22
Showing
11 changed files
with
498 additions
and
50 deletions
pom.xml
| ... | ... | @@ -426,25 +426,6 @@ |
| 426 | 426 | |
| 427 | 427 | <build> |
| 428 | 428 | <plugins> |
| 429 | - <plugin> | |
| 430 | - <artifactId>maven-compiler-plugin</artifactId> | |
| 431 | - <version>2.3.2</version><!--$NO-MVN-MAN-VER$ --> | |
| 432 | - <configuration> | |
| 433 | - <source>1.8</source> | |
| 434 | - <target>1.8</target> | |
| 435 | - </configuration> | |
| 436 | - </plugin> | |
| 437 | - <plugin> | |
| 438 | - <artifactId>maven-war-plugin</artifactId> | |
| 439 | - <version>2.2</version><!--$NO-MVN-MAN-VER$ --> | |
| 440 | - <configuration> | |
| 441 | - <failOnMissingWebXml>false</failOnMissingWebXml> | |
| 442 | - </configuration> | |
| 443 | - </plugin> | |
| 444 | - <plugin> | |
| 445 | - <groupId>org.springframework.boot</groupId> | |
| 446 | - <artifactId>spring-boot-maven-plugin</artifactId> | |
| 447 | - </plugin> | |
| 448 | 429 | <plugin> |
| 449 | 430 | <groupId>org.codehaus.mojo</groupId> |
| 450 | 431 | <artifactId>jaxb2-maven-plugin</artifactId> | ... | ... |
src/main/java/com/bsth/entity/subject/Subject.java
| ... | ... | @@ -21,6 +21,8 @@ public class Subject { |
| 21 | 21 | private String dir; |
| 22 | 22 | //应对答案 |
| 23 | 23 | private String answer; |
| 24 | + | |
| 25 | + private String schStatus; | |
| 24 | 26 | |
| 25 | 27 | public String getSubjectText() { |
| 26 | 28 | return subjectText; |
| ... | ... | @@ -70,4 +72,12 @@ public class Subject { |
| 70 | 72 | public void setAnswer(String answer) { |
| 71 | 73 | this.answer = answer; |
| 72 | 74 | } |
| 75 | + | |
| 76 | + public String getSchStatus() { | |
| 77 | + return schStatus; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public void setSchStatus(String schStatus) { | |
| 81 | + this.schStatus = schStatus; | |
| 82 | + } | |
| 73 | 83 | } | ... | ... |
src/main/java/com/bsth/entity/subject/SubjectUser.java
| 1 | 1 | package com.bsth.entity.subject; |
| 2 | 2 | |
| 3 | +import com.bsth.entity.schedule.BEntity; | |
| 4 | + | |
| 3 | 5 | import javax.persistence.*; |
| 6 | +import java.io.Serializable; | |
| 7 | +import java.util.Date; | |
| 4 | 8 | |
| 5 | 9 | @Entity |
| 6 | 10 | @Table(name = "bsth_subject_user") |
| ... | ... | @@ -20,6 +24,22 @@ public class SubjectUser { |
| 20 | 24 | //题库id |
| 21 | 25 | @ManyToOne |
| 22 | 26 | private Subject subjectId; |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + // 创建人 | |
| 31 | + private Integer createBy; | |
| 32 | + | |
| 33 | + // 修改人 | |
| 34 | + private Integer updateBy; | |
| 35 | + | |
| 36 | + /** 创建日期 timestamp */ | |
| 37 | + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 38 | + private Date createDate; | |
| 39 | + | |
| 40 | + /** 修改日期 timestamp */ | |
| 41 | + @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 42 | + private Date updateDate; | |
| 23 | 43 | |
| 24 | 44 | public Integer getId() { |
| 25 | 45 | return id; |
| ... | ... | @@ -61,5 +81,35 @@ public class SubjectUser { |
| 61 | 81 | this.result = result; |
| 62 | 82 | } |
| 63 | 83 | |
| 64 | - | |
| 84 | + public Integer getCreateBy() { | |
| 85 | + return createBy; | |
| 86 | + } | |
| 87 | + | |
| 88 | + public void setCreateBy(Integer createBy) { | |
| 89 | + this.createBy = createBy; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public Integer getUpdateBy() { | |
| 93 | + return updateBy; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public void setUpdateBy(Integer updateBy) { | |
| 97 | + this.updateBy = updateBy; | |
| 98 | + } | |
| 99 | + | |
| 100 | + public Date getCreateDate() { | |
| 101 | + return createDate; | |
| 102 | + } | |
| 103 | + | |
| 104 | + public void setCreateDate(Date createDate) { | |
| 105 | + this.createDate = createDate; | |
| 106 | + } | |
| 107 | + | |
| 108 | + public Date getUpdateDate() { | |
| 109 | + return updateDate; | |
| 110 | + } | |
| 111 | + | |
| 112 | + public void setUpdateDate(Date updateDate) { | |
| 113 | + this.updateDate = updateDate; | |
| 114 | + } | |
| 65 | 115 | } | ... | ... |
src/main/java/com/bsth/repository/subject/SubjectUserRepository.java
| ... | ... | @@ -6,6 +6,7 @@ import org.springframework.data.jpa.repository.Modifying; |
| 6 | 6 | import org.springframework.data.jpa.repository.Query; |
| 7 | 7 | import org.springframework.transaction.annotation.Transactional; |
| 8 | 8 | |
| 9 | +import java.util.Date; | |
| 9 | 10 | import java.util.List; |
| 10 | 11 | |
| 11 | 12 | public interface SubjectUserRepository extends BaseRepository<SubjectUser, Integer> { |
| ... | ... | @@ -16,6 +17,6 @@ public interface SubjectUserRepository extends BaseRepository<SubjectUser, Integ |
| 16 | 17 | List<SubjectUser> userAll(String rq, Integer userId); |
| 17 | 18 | @Transactional |
| 18 | 19 | @Modifying |
| 19 | - @Query(value = "update SubjectUser su set su.result =?1 where su.id =?2") | |
| 20 | - int updates(String rq, Integer userId); | |
| 20 | + @Query(value = "update SubjectUser su set su.result =?1,su.updateBy = ?2,su.updateDate = ?3 where su.id =?4") | |
| 21 | + int updates(String rq, Integer id, Date updateDate, Integer userId); | |
| 21 | 22 | } | ... | ... |
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
| ... | ... | @@ -221,7 +221,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen |
| 221 | 221 | else |
| 222 | 222 | d60.setSender("系统"); |
| 223 | 223 | // 发送指令 |
| 224 | - int code = GatewayHttpUtils.postJson(JSON.toJSONString(d60)); | |
| 224 | + int code = 0; | |
| 225 | + //GatewayHttpUtils.postJson(JSON.toJSONString(d60)); | |
| 225 | 226 | // 添加到缓存,等待入库 |
| 226 | 227 | d60.setHttpCode(code); |
| 227 | 228 | |
| ... | ... | @@ -229,9 +230,9 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen |
| 229 | 230 | if(null != gps) |
| 230 | 231 | d60.setLineCode(gps.getLineId()); |
| 231 | 232 | |
| 232 | - if (code != 0) | |
| 233 | + /*if (code != 0) | |
| 233 | 234 | d60.setErrorText("网关通讯失败, code: " + code); |
| 234 | - | |
| 235 | +*/ | |
| 235 | 236 | dayOfDirectives.put60(d60); |
| 236 | 237 | return code; |
| 237 | 238 | } | ... | ... |
src/main/java/com/bsth/service/subject/impl/SubjectUserServiceImpl.java
| ... | ... | @@ -16,6 +16,7 @@ import org.springframework.stereotype.Service; |
| 16 | 16 | |
| 17 | 17 | import java.text.SimpleDateFormat; |
| 18 | 18 | import java.util.*; |
| 19 | +import java.util.stream.Collectors; | |
| 19 | 20 | |
| 20 | 21 | @Service |
| 21 | 22 | public class SubjectUserServiceImpl extends BaseServiceImpl<SubjectUser, Integer> implements SubjectUserService { |
| ... | ... | @@ -60,11 +61,21 @@ public class SubjectUserServiceImpl extends BaseServiceImpl<SubjectUser, Integer |
| 60 | 61 | String type = sur.getSubjectId().getType(); |
| 61 | 62 | //判断答题是否正确 |
| 62 | 63 | subEnum sjm = subEnum.valueOf(type); |
| 63 | - String result = sjm.run(sur,sch) == true ? "0" : "1"; | |
| 64 | + String result; | |
| 65 | + if (sur.getSubjectId().getSchStatus().equals("0")){ | |
| 66 | + List<ScheduleRealInfo> sh = sch.stream().filter(s -> s.getXlDir().equals(sur.getSubjectId().getDir())).collect(Collectors.toList()); | |
| 67 | + result = sjm.run(sur,sh) == true ? "0" : "1"; | |
| 68 | + }else { | |
| 69 | + result = sjm.run(sur,sch) == true ? "0" : "1"; | |
| 70 | + } | |
| 71 | + | |
| 72 | + SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); | |
| 73 | + Date date = new Date(); | |
| 74 | + // 修改日期 | |
| 75 | + String updateDate = formatter.format(date); | |
| 64 | 76 | |
| 65 | 77 | //修改答案 |
| 66 | - int status = subjectUserRepository.updates(result,id); | |
| 67 | - | |
| 78 | + int status = subjectUserRepository.updates(result,user.getId(),date,id); | |
| 68 | 79 | //List list = subjectUserRepository.userAll(sur.getRq(),sur.getUserId()); |
| 69 | 80 | // map.put("result",result); |
| 70 | 81 | //map.put("list",list); | ... | ... |
src/main/java/com/bsth/util/subject/subEnum.java
| 1 | 1 | package com.bsth.util.subject; |
| 2 | 2 | |
| 3 | +import com.bsth.data.schedule.ScheduleComparator; | |
| 4 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | |
| 3 | 5 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 4 | 6 | import com.bsth.entity.subject.SubjectUser; |
| 5 | 7 | |
| 8 | +import java.text.SimpleDateFormat; | |
| 9 | +import java.util.Collections; | |
| 10 | +import java.util.Comparator; | |
| 6 | 11 | import java.util.List; |
| 12 | +import java.util.Set; | |
| 7 | 13 | import java.util.stream.Collectors; |
| 8 | 14 | |
| 9 | 15 | public enum subEnum { |
| 16 | + | |
| 17 | + | |
| 10 | 18 | //判断待发 |
| 11 | 19 | df{ |
| 12 | 20 | @Override |
| 13 | 21 | public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch){ |
| 14 | 22 | String sj = sur.getSubjectId().getFcsj();//计划发车时间 |
| 15 | 23 | String answer = sur.getSubjectId().getAnswer();//待发是按 |
| 16 | - String dir = sur.getSubjectId().getDir();// | |
| 17 | - //筛选满足条件的情况下 | |
| 18 | - //List<ScheduleRealInfo> sh = sch.stream().filter(s -> s.getXlDir().equals(dir)).collect(Collectors.toList()); | |
| 19 | 24 | //判断结果是否合格 |
| 20 | 25 | for (ScheduleRealInfo s : sch) { |
| 21 | 26 | if (s.getFcsj().equals(sj) && |
| 22 | - s.getXlDir().equals(dir) && | |
| 23 | 27 | s.getDfsj().equals(answer)) { |
| 24 | 28 | return true; |
| 25 | 29 | } |
| ... | ... | @@ -34,13 +38,9 @@ public enum subEnum { |
| 34 | 38 | String sj = sur.getSubjectId().getFcsj();//计划发车时间 |
| 35 | 39 | String answer = sur.getSubjectId().getAnswer();//答案 |
| 36 | 40 | String[] t = answer.split(","); //0 计划里程 1 是否烂班状态 2烂班原因 |
| 37 | - String dir = sur.getSubjectId().getDir();// | |
| 38 | - //筛选满足条件的情况下 | |
| 39 | - //List<ScheduleRealInfo> sh = sch.stream().filter(s -> s.getXlDir().equals(dir)).collect(Collectors.toList()); | |
| 40 | 41 | //判断结果是否合格 |
| 41 | 42 | for (ScheduleRealInfo s : sch) { |
| 42 | 43 | if (s.getDfsj().equals(sj) && |
| 43 | - s.getXlDir().equals(dir) && | |
| 44 | 44 | s.getJhlc() == Double.parseDouble(t[0]) && |
| 45 | 45 | s.getStatus() == Integer.parseInt(t[1]) && |
| 46 | 46 | s.getRemarks().contains(t[2])) { |
| ... | ... | @@ -58,10 +58,11 @@ public enum subEnum { |
| 58 | 58 | String answer = sur.getSubjectId().getAnswer();//答案 |
| 59 | 59 | String[] t = answer.split(","); //0 是否烂班状态 1是否烂班过 |
| 60 | 60 | String dir = sur.getSubjectId().getDir();// |
| 61 | + //筛选满足条件的情况的班次 | |
| 62 | + List<ScheduleRealInfo> sh = sch.stream().filter(s -> s.getXlDir().equals(dir)).collect(Collectors.toList()); | |
| 61 | 63 | //判断结果是否合格 |
| 62 | 64 | for (ScheduleRealInfo s : sch) { |
| 63 | 65 | if (s.getDfsj().equals(sj) && |
| 64 | - s.getXlDir().equals(dir) && | |
| 65 | 66 | s.getStatus() == Integer.parseInt(t[0]) && |
| 66 | 67 | t[1].equals(s.getAdjustExps())) { |
| 67 | 68 | return true; |
| ... | ... | @@ -75,19 +76,392 @@ public enum subEnum { |
| 75 | 76 | public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch){ |
| 76 | 77 | String sj = sur.getSubjectId().getFcsj();//计划发车时间 |
| 77 | 78 | String answer = sur.getSubjectId().getAnswer();//答案 |
| 78 | - String[] t = answer.split(","); //0 计划里程 | |
| 79 | - String dir = sur.getSubjectId().getDir();// | |
| 80 | - //筛选满足条件的情况下 | |
| 81 | - List<ScheduleRealInfo> sh = sch.stream().filter(s -> s.getXlDir().equals(dir)).collect(Collectors.toList()); | |
| 79 | + String[] t = answer.split(","); //0 里程是否清0 1 是否烂班状态 2烂班原因3.班次间隔时间 | |
| 80 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); | |
| 81 | + //排序 | |
| 82 | + Collections.sort(sch, new ScheduleComparator.DFSJ2()); | |
| 83 | + int su = 0; | |
| 84 | + try{ | |
| 85 | + //判断结果是否合格 | |
| 86 | + int sunm = 0; | |
| 87 | + for (int i = 0; i < sch.size(); i++) { | |
| 88 | + ScheduleRealInfo s = sch.get(i); | |
| 89 | + //判断当前班次是否符合条件 | |
| 90 | + if (s.getDfsj().equals(sj) && | |
| 91 | + s.getJhlc() == Double.parseDouble(t[0]) && | |
| 92 | + s.getStatus() == Integer.parseInt(t[1]) && | |
| 93 | + s.getRemarks().contains(t[2])) { | |
| 94 | + su = i; | |
| 95 | + } | |
| 96 | + | |
| 97 | + //判断后续三个班次的dfsj修改成功 n烂班 n-1 与 n+1 n+1与n+2 | |
| 98 | + if (su != 0 && i > su && i <= su + 3){ | |
| 99 | + if (i == su +1){ //烂班下第一个 | |
| 100 | + Long stn = sdf.parse(sch.get(i).getDfsj()).getTime() - sdf.parse(sch.get(i-2).getDfsj()).getTime(); | |
| 101 | + int stg = stn.intValue() / 60 / 1000; | |
| 102 | + sunm = stg == Integer.parseInt(t[3]) ? sunm + 1 : sunm; //班次调整间隔时间 40/4 40/3 | |
| 103 | + }else { | |
| 104 | + Long stn = sdf.parse(sch.get(i).getDfsj()).getTime() - sdf.parse(sch.get(i-1).getDfsj()).getTime(); | |
| 105 | + int stg = stn.intValue() / 60 / 1000; | |
| 106 | + sunm = stg == Integer.parseInt(t[3]) ? sunm + 1 : sunm; //班次调整间隔时间 | |
| 107 | + } | |
| 108 | + } | |
| 109 | + } | |
| 110 | + //3个班次都正确 | |
| 111 | + if (sunm == 3){ | |
| 112 | + return true; | |
| 113 | + } | |
| 114 | + }catch (Exception e){ | |
| 115 | + e.printStackTrace(); | |
| 116 | + } | |
| 117 | + | |
| 118 | + return false; | |
| 119 | + } | |
| 120 | + }, //判断烂班 | |
| 121 | + //实发 | |
| 122 | + sf{ | |
| 123 | + @Override | |
| 124 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch){ | |
| 125 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 126 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 127 | + String[] t = answer.split(","); //0 实发时间 1调整说明 | |
| 82 | 128 | //判断结果是否合格 |
| 83 | 129 | for (ScheduleRealInfo s : sch) { |
| 84 | - | |
| 130 | + if (s.getDfsj().equals(sj) && | |
| 131 | + t[0].equals(s.getFcsjActual()) && | |
| 132 | + s.getRemarks().contains(t[1])) { | |
| 133 | + return true; | |
| 134 | + } | |
| 85 | 135 | } |
| 86 | 136 | return false; |
| 87 | 137 | } |
| 88 | - }; | |
| 138 | + }, | |
| 139 | + //撤销实发 | |
| 140 | + csf { | |
| 141 | + @Override | |
| 142 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch) { | |
| 143 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 144 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 145 | + String[] t = answer.split(","); //0 调整说明 | |
| 146 | + //判断结果是否合格 | |
| 147 | + for (ScheduleRealInfo s : sch) { | |
| 148 | + if (s.getDfsj().equals(sj) && | |
| 149 | + s.getFcsjActual() == null && | |
| 150 | + s.getRemarks() != null && | |
| 151 | + s.getRemarks().contains(t[0])) { | |
| 152 | + return true; | |
| 153 | + } | |
| 154 | + } | |
| 155 | + return false; | |
| 156 | + } | |
| 157 | + }, | |
| 158 | + //直放 | |
| 159 | + zf { | |
| 160 | + @Override | |
| 161 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch) { | |
| 162 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 163 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 164 | + String[] t = answer.split(","); //0 放站 | |
| 165 | + //判断结果是否合格 | |
| 166 | + for (ScheduleRealInfo s : sch) { | |
| 167 | + if (s.getDfsj().equals(sj) && | |
| 168 | + s.getBcType().equals(t[0])) { | |
| 169 | + return true; | |
| 170 | + } | |
| 171 | + } | |
| 172 | + return false; | |
| 173 | + } | |
| 174 | + }, | |
| 175 | + //直放 | |
| 176 | + fz { | |
| 177 | + @Override | |
| 178 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch) { | |
| 179 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 180 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 181 | + String[] t = answer.split(","); //0 放站 1备注-是不是龙阳路地铁站 | |
| 182 | + //判断结果是否合格 | |
| 183 | + for (ScheduleRealInfo s : sch) { | |
| 184 | + if (s.getDfsj().equals(sj) && | |
| 185 | + s.getBcType().equals(t[0]) && | |
| 186 | + s.getRemarks() != null && | |
| 187 | + s.getRemarks().contains(t[1])) { | |
| 188 | + return true; | |
| 189 | + } | |
| 190 | + } | |
| 191 | + return false; | |
| 192 | + } | |
| 193 | + }, | |
| 194 | + //直放 | |
| 195 | + zrw { | |
| 196 | + @Override | |
| 197 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch) { | |
| 198 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 199 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 200 | + String[] t = answer.split(","); //0 放站 1备注-是不是龙阳路地铁站 | |
| 201 | + //判断结果是否合格 | |
| 202 | + for (ScheduleRealInfo s : sch) { | |
| 203 | + if (s.getDfsj().equals(sj)) { | |
| 204 | + //涉及到子任务 | |
| 205 | + Set<ChildTaskPlan> ctaks = s.getcTasks(); | |
| 206 | + //ctaks.size() == 2 | |
| 207 | + Float lc = 0f; //统计营运里程 | |
| 208 | + int sn = 0;//是否两个班次都符合条件 | |
| 209 | + //判断子任务是否符合条件 | |
| 210 | + for (ChildTaskPlan p : ctaks){ | |
| 211 | + lc = lc + p.getMileage(); | |
| 212 | + if ((p.getEndStationName().equals(t[0]) && p.isDestroy() == false ) || | |
| 213 | + (p.getStartStationName().equals(t[0]) && p.getDestroyReason().equals(t[1]) && p.isDestroy() == true)){ | |
| 214 | + sn = sn + 1; | |
| 215 | + } | |
| 216 | + } | |
| 217 | + //判断子任务里程数和班次里程数是否一样 && 满足两个班次 | |
| 218 | + if (lc == s.getJhlc().floatValue() && sn == 2) { | |
| 219 | + return true; | |
| 220 | + } | |
| 221 | + | |
| 222 | + } | |
| 223 | + } | |
| 224 | + return false; | |
| 225 | + } | |
| 226 | + | |
| 227 | + }, | |
| 228 | + //临加班次 | |
| 229 | + ljbc{ | |
| 230 | + @Override | |
| 231 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch){ | |
| 232 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 233 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 234 | + String[] t = answer.split(","); //0 | |
| 235 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); | |
| 236 | + //排序 | |
| 237 | + Collections.sort(sch, new ScheduleComparator.DFSJ2()); | |
| 238 | + int su = 0; | |
| 239 | + try{ | |
| 240 | + //判断结果是否合格 | |
| 241 | + String df = ""; | |
| 242 | + for (int i = 0; i < sch.size(); i++) { | |
| 243 | + ScheduleRealInfo s = sch.get(i); | |
| 244 | + | |
| 245 | + //判断当前班次是否符合条件 1.是否临加 | |
| 246 | + if (s.getDfsj().equals(sj)) { | |
| 247 | + Long stn = sdf.parse(s.getDfsj()).getTime() + Long.parseLong(t[0]) * 60 * 1000; | |
| 248 | + df =sdf.format(stn); | |
| 249 | + } | |
| 250 | + //判断是否有这个临加班次 | |
| 251 | + if (s.getDfsj().equals(df) && s.getClZbh().contains(t[1]) && s.isSflj() == true) { | |
| 252 | + return true; | |
| 253 | + } | |
| 254 | + | |
| 255 | + } | |
| 256 | + }catch (Exception e){ | |
| 257 | + e.printStackTrace(); | |
| 258 | + } | |
| 259 | + | |
| 260 | + return false; | |
| 261 | + } | |
| 262 | + }, | |
| 263 | + //临加班次 往返班次 | |
| 264 | + ljbc_wf{ | |
| 265 | + @Override | |
| 266 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch){ | |
| 267 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 268 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 269 | + String[] t = answer.split(","); //0 | |
| 270 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); | |
| 271 | + //排序 | |
| 272 | + Collections.sort(sch, new ScheduleComparator.DFSJ2()); | |
| 273 | + int su = 0; | |
| 274 | + try{ | |
| 275 | + //判断结果是否合格 | |
| 276 | + String df = ""; | |
| 277 | + String dfsj =""; | |
| 278 | + for (int i = 0; i < sch.size(); i++) { | |
| 279 | + ScheduleRealInfo s = sch.get(i); | |
| 89 | 280 | |
| 281 | + //判断当前班次是否符合条件 全部班次 | |
| 282 | + if (s.getDfsj().equals(sj) && s.getXlDir().equals(sur.getSubjectId().getDir())) { | |
| 283 | + Long stn = sdf.parse(s.getDfsj()).getTime() + Long.parseLong(t[0]) * 60 * 1000; | |
| 284 | + df =sdf.format(stn); | |
| 285 | + } | |
| 286 | + //判断是否有这个临加班次 | |
| 287 | + if (s.getDfsj().equals(df) && s.getClZbh().contains(t[1]) && s.isSflj() == true) { | |
| 288 | + dfsj =s.getZdsj(); | |
| 289 | + } | |
| 290 | + if(s.getDfsj().equals(dfsj) && s.isSflj() == true){ | |
| 291 | + return true; | |
| 292 | + } | |
| 293 | + | |
| 90 | 294 | |
| 295 | + } | |
| 296 | + }catch (Exception e){ | |
| 297 | + e.printStackTrace(); | |
| 298 | + } | |
| 91 | 299 | |
| 300 | + return false; | |
| 301 | + } | |
| 302 | + }, | |
| 303 | + //临加班次 场到场 | |
| 304 | + ljbc_cdc{ | |
| 305 | + @Override | |
| 306 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch){ | |
| 307 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 308 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 309 | + String[] t = answer.split(","); //0 | |
| 310 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); | |
| 311 | + //排序 | |
| 312 | + Collections.sort(sch, new ScheduleComparator.DFSJ2()); | |
| 313 | + int su = 0; | |
| 314 | + try{ | |
| 315 | + //判断结果是否合格 | |
| 316 | + Integer nts = 0; | |
| 317 | + String dfsj =""; | |
| 318 | + for (int i = 0; i < sch.size(); i++) { | |
| 319 | + ScheduleRealInfo s = sch.get(i); | |
| 320 | + //判断当前班次是否符合条件 全部班次 | |
| 321 | + if ( s.getBcType().equals(t[0]) && s.isSflj() == true && s.getClZbh().equals(t[2]) && | |
| 322 | + (s.getDfsj().equals(sj) || s.getDfsj().equals(t[1]) )) { | |
| 323 | + if((s.getQdzName().equals(t[3]) && s.getZdzName().equals(t[4]) ) || | |
| 324 | + s.getQdzName().equals(t[4]) && s.getZdzName().equals(t[3])){ | |
| 325 | + nts++; | |
| 326 | + } | |
| 327 | + } | |
| 328 | + } | |
| 329 | + if(nts == 2){ | |
| 330 | + return true; | |
| 331 | + } | |
| 332 | + | |
| 333 | + }catch (Exception e){ | |
| 334 | + e.printStackTrace(); | |
| 335 | + } | |
| 336 | + | |
| 337 | + return false; | |
| 338 | + } | |
| 339 | + }, | |
| 340 | + //临加班次 场到场 | |
| 341 | + lp{ | |
| 342 | + @Override | |
| 343 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch){ | |
| 344 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 345 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 346 | + String[] t = answer.split(","); //0 | |
| 347 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); | |
| 348 | + //排序 | |
| 349 | + Collections.sort(sch, new ScheduleComparator.DFSJ2()); | |
| 350 | + int su = 0; | |
| 351 | + try{ | |
| 352 | + //判断结果是否合格 | |
| 353 | + for (int i = 0; i < sch.size(); i++) { | |
| 354 | + ScheduleRealInfo s = sch.get(i); | |
| 355 | + //判断当前班次是否符合条件 全部班次 | |
| 356 | + if ( s.getDfsj().equals(sj) && s.getLpName().equals(t[0]) && s.isSflj() == true) { | |
| 357 | + return true; | |
| 358 | + } | |
| 359 | + } | |
| 360 | + | |
| 361 | + }catch (Exception e){ | |
| 362 | + e.printStackTrace(); | |
| 363 | + } | |
| 364 | + | |
| 365 | + return false; | |
| 366 | + } | |
| 367 | + }, | |
| 368 | + //临加班次 场到场 | |
| 369 | + j_gh{ | |
| 370 | + @Override | |
| 371 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch){ | |
| 372 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 373 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 374 | + String[] t = answer.split(","); //0 | |
| 375 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); | |
| 376 | + //排序 | |
| 377 | + Collections.sort(sch, new ScheduleComparator.DFSJ2()); | |
| 378 | + int su = 0; | |
| 379 | + try{ | |
| 380 | + //判断结果是否合格 | |
| 381 | + for (int i = 0; i < sch.size(); i++) { | |
| 382 | + ScheduleRealInfo s = sch.get(i); | |
| 383 | + //判断当前班次是否符合条件 全部班次 | |
| 384 | + if ( s.getDfsj().equals(sj) && s.getjGh().equals(t[0])) { | |
| 385 | + return true; | |
| 386 | + } | |
| 387 | + } | |
| 388 | + | |
| 389 | + }catch (Exception e){ | |
| 390 | + e.printStackTrace(); | |
| 391 | + } | |
| 392 | + | |
| 393 | + return false; | |
| 394 | + } | |
| 395 | + }, | |
| 396 | + //换班 | |
| 397 | + hb{ | |
| 398 | + @Override | |
| 399 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch){ | |
| 400 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 401 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 402 | + String[] t = answer.split(","); //0 | |
| 403 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); | |
| 404 | + //排序 | |
| 405 | + Collections.sort(sch, new ScheduleComparator.DFSJ2()); | |
| 406 | + int su = 0; | |
| 407 | + try{ | |
| 408 | + //判断结果是否合格 | |
| 409 | + for (int i = 0; i < sch.size(); i++) { | |
| 410 | + ScheduleRealInfo s = sch.get(i); | |
| 411 | + //判断当前班次是否符合条件 全部班次 | |
| 412 | + if ( s.getDfsj().equals(sj) && s.getjGh().equals(t[1])) { | |
| 413 | + su ++; | |
| 414 | + } | |
| 415 | + | |
| 416 | + if ( s.getDfsj().equals(t[2]) && s.getjGh().equals(t[0])) { | |
| 417 | + su ++; | |
| 418 | + } | |
| 419 | + } | |
| 420 | + if(su == 2) | |
| 421 | + return true; | |
| 422 | + | |
| 423 | + | |
| 424 | + }catch (Exception e){ | |
| 425 | + e.printStackTrace(); | |
| 426 | + } | |
| 427 | + | |
| 428 | + return false; | |
| 429 | + } | |
| 430 | + }, | |
| 431 | + //批量修改待发 | |
| 432 | + pdf{ | |
| 433 | + @Override | |
| 434 | + public boolean run(SubjectUser sur, List<ScheduleRealInfo> sch){ | |
| 435 | + String sj = sur.getSubjectId().getFcsj();//计划发车时间 | |
| 436 | + String answer = sur.getSubjectId().getAnswer();//答案 | |
| 437 | + String[] t = answer.split(","); //0 | |
| 438 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); | |
| 439 | + //排序 | |
| 440 | + Collections.sort(sch, new ScheduleComparator.DFSJ2()); | |
| 441 | + int su = 0; | |
| 442 | + try{ | |
| 443 | + //判断结果是否合格 | |
| 444 | + for (int i = 0; i < sch.size(); i++) { | |
| 445 | + ScheduleRealInfo s = sch.get(i); | |
| 446 | + //判断当前班次是否符合条件 | |
| 447 | + if ( s.getDfsj().equals(sj) && s.getjGh().equals(t[1])) { | |
| 448 | + su ++; | |
| 449 | + } | |
| 450 | + | |
| 451 | + if ( s.getDfsj().equals(t[2]) && s.getjGh().equals(t[0])) { | |
| 452 | + su ++; | |
| 453 | + } | |
| 454 | + } | |
| 455 | + if(su == 2) | |
| 456 | + return true; | |
| 457 | + | |
| 458 | + | |
| 459 | + }catch (Exception e){ | |
| 460 | + e.printStackTrace(); | |
| 461 | + } | |
| 462 | + | |
| 463 | + return false; | |
| 464 | + } | |
| 465 | + }; | |
| 92 | 466 | public abstract boolean run(SubjectUser sur, List<ScheduleRealInfo> sch); |
| 93 | 467 | } | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/temp_sch/main.html
| ... | ... | @@ -61,9 +61,9 @@ |
| 61 | 61 | |
| 62 | 62 | //init-autoCom |
| 63 | 63 | $(modal).on('init-autoCom', '.add-sch-form', function () { |
| 64 | - //车辆 | |
| 64 | + /*//车辆 | |
| 65 | 65 | if(carsArray) |
| 66 | - gb_common.carAutocomplete($('.car-autocom', this), carsArray); | |
| 66 | + gb_common.carAutocomplete($('.car-autocom', this), carsArray);*/ | |
| 67 | 67 | //驾驶员 |
| 68 | 68 | gb_common.personAutocomplete($('.jsy-autocom', this)); |
| 69 | 69 | //售票员 | ... | ... |
src/main/resources/static/real_control_v2/js/home/context_menu.js
| ... | ... | @@ -309,7 +309,25 @@ var gb_home_context_menu = (function() { |
| 309 | 309 | 'send_phrase_multi': { |
| 310 | 310 | name: '群发消息短语' |
| 311 | 311 | }, |
| 312 | - | |
| 312 | + 'sep1': '---------', | |
| 313 | + 'fold_state': { | |
| 314 | + name: '状态切换', | |
| 315 | + items: { | |
| 316 | + 'state_up_1': { | |
| 317 | + 'name': '上行非营运' | |
| 318 | + }, | |
| 319 | + 'state_down_1': { | |
| 320 | + 'name': '下行非营运' | |
| 321 | + }, | |
| 322 | + 'sep3_2': '---------', | |
| 323 | + 'state_up_0': { | |
| 324 | + 'name': '上行营运' | |
| 325 | + }, | |
| 326 | + 'state_down_0': { | |
| 327 | + 'name': '下行营运' | |
| 328 | + } | |
| 329 | + } | |
| 330 | + }, | |
| 313 | 331 | } |
| 314 | 332 | }); |
| 315 | 333 | ... | ... |
src/main/resources/static/real_control_v2/js/subject/subject.js
| ... | ... | @@ -20,8 +20,10 @@ var su_subject = (function () { |
| 20 | 20 | var list = retunhtml(rs); |
| 21 | 21 | |
| 22 | 22 | $('.north_suject').remove(); |
| 23 | - if (list == null) | |
| 23 | + if (list == null){ | |
| 24 | + //otify_succ('全部题目已操作完成 请查看自己的成绩!'); | |
| 24 | 25 | return; //所有题目已经考完 无考题的情况 |
| 26 | + } | |
| 25 | 27 | |
| 26 | 28 | var htmlStr = template('suject_pop_wrap', list); |
| 27 | 29 | $wrap.append(htmlStr); |
| ... | ... | @@ -34,9 +36,9 @@ var su_subject = (function () { |
| 34 | 36 | //判断答题是否正确 返回参数 返回下一题的情况 |
| 35 | 37 | gb_common.$get('/subjectUser/determine', {id: id},function (rs) { |
| 36 | 38 | if (rs == 0){ //提示答题正确 |
| 37 | - | |
| 39 | + notify_succ('答题正确!'); | |
| 38 | 40 | }else if(rs == 1){ //提示答题失败 |
| 39 | - | |
| 41 | + notify_err('答题错误!'); | |
| 40 | 42 | }else { //系统出错 |
| 41 | 43 | |
| 42 | 44 | } | ... | ... |
src/main/resources/static/real_control_v2/main.html
| ... | ... | @@ -79,7 +79,7 @@ |
| 79 | 79 | 场景:{{subjectId.subjectText}} |
| 80 | 80 | </div> |
| 81 | 81 | <div class="north-tmx"> |
| 82 | - 操作: {{subjectId.operateTest}} | |
| 82 | + 操作:{{subjectId.operateTest}} | |
| 83 | 83 | </div> |
| 84 | 84 | <div class="north-button"> |
| 85 | 85 | <button id="submit" class="subject_button" data-id="{{id}}">提交</button> | ... | ... |