Commit dff12beee485818e3614bd6477da98ce770b2cfa
Merge branch 'minhang' of
http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
8 changed files
with
38 additions
and
11 deletions
Too many changes to show.
To preserve performance only 8 of 22 files are displayed.
src/main/java/com/bsth/controller/LineController.java
| @@ -47,6 +47,16 @@ public class LineController extends BaseController<Line, Integer> { | @@ -47,6 +47,16 @@ public class LineController extends BaseController<Line, Integer> { | ||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| 50 | + * 验证线路编码是否存在 | ||
| 51 | + * | ||
| 52 | + * @return Map < {valid: true }:是否通过验证> | ||
| 53 | + */ | ||
| 54 | + @RequestMapping(value = "lineCodeVerification", method = RequestMethod.GET) | ||
| 55 | + public String lineCodeVerification(@RequestParam(defaultValue = "lineCode") String lineCode) { | ||
| 56 | + return service.lineCodeVerification(lineCode); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 50 | * | 60 | * |
| 51 | * 保存 | 61 | * 保存 |
| 52 | * | 62 | * |
| @@ -59,7 +69,7 @@ public class LineController extends BaseController<Line, Integer> { | @@ -59,7 +69,7 @@ public class LineController extends BaseController<Line, Integer> { | ||
| 59 | t.setId(Integer.valueOf(t.getLineCode())); | 69 | t.setId(Integer.valueOf(t.getLineCode())); |
| 60 | 70 | ||
| 61 | } | 71 | } |
| 62 | - if( (t.getId().toString().length()) > 6) { | 72 | + if( (t.getId().toString().length()) > 6 || service.lineCodeVerification(t.getLineCode()).equals("false") ) { |
| 63 | 73 | ||
| 64 | map.put("status", ResponseCode.ERROR); | 74 | map.put("status", ResponseCode.ERROR); |
| 65 | return map; | 75 | return map; |
src/main/java/com/bsth/data/directive/DayOfDirectives.java
| @@ -156,7 +156,7 @@ public class DayOfDirectives { | @@ -156,7 +156,7 @@ public class DayOfDirectives { | ||
| 156 | Collection<D60> d60s = d60Map.values(); | 156 | Collection<D60> d60s = d60Map.values(); |
| 157 | List<D60> rem60List = new ArrayList<>(); | 157 | List<D60> rem60List = new ArrayList<>(); |
| 158 | for(D60 d60 : d60s){ | 158 | for(D60 d60 : d60s){ |
| 159 | - if(d60.getDeviceId().equals(device)) | 159 | + if(device.equals(d60.getDeviceId())) |
| 160 | rem60List.add(d60); | 160 | rem60List.add(d60); |
| 161 | } | 161 | } |
| 162 | //清除60数据 | 162 | //清除60数据 |
| @@ -173,7 +173,7 @@ public class DayOfDirectives { | @@ -173,7 +173,7 @@ public class DayOfDirectives { | ||
| 173 | Collection<D64> d64s = d64Map.values(); | 173 | Collection<D64> d64s = d64Map.values(); |
| 174 | List<D64> rem64List = new ArrayList<>(); | 174 | List<D64> rem64List = new ArrayList<>(); |
| 175 | for(D64 d64 : d64s){ | 175 | for(D64 d64 : d64s){ |
| 176 | - if(d64.getDeviceId().equals(device)) | 176 | + if(device.equals(d64.getDeviceId())) |
| 177 | rem64List.add(d64); | 177 | rem64List.add(d64); |
| 178 | } | 178 | } |
| 179 | 179 |
src/main/java/com/bsth/service/LineService.java
| 1 | package com.bsth.service; | 1 | package com.bsth.service; |
| 2 | 2 | ||
| 3 | +import java.util.Map; | ||
| 4 | + | ||
| 3 | import org.springframework.web.bind.annotation.RequestMapping; | 5 | import org.springframework.web.bind.annotation.RequestMapping; |
| 4 | import org.springframework.web.bind.annotation.RequestMethod; | 6 | import org.springframework.web.bind.annotation.RequestMethod; |
| 5 | 7 | ||
| @@ -32,4 +34,6 @@ public interface LineService extends BaseService<Line, Integer> { | @@ -32,4 +34,6 @@ public interface LineService extends BaseService<Line, Integer> { | ||
| 32 | Line findByLineCode(String lineCode); | 34 | Line findByLineCode(String lineCode); |
| 33 | 35 | ||
| 34 | Line findById(Integer id); | 36 | Line findById(Integer id); |
| 37 | + | ||
| 38 | + String lineCodeVerification(String lineCode); | ||
| 35 | } | 39 | } |
src/main/java/com/bsth/service/impl/LineServiceImpl.java
| 1 | package com.bsth.service.impl; | 1 | package com.bsth.service.impl; |
| 2 | 2 | ||
| 3 | +import java.util.HashMap; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 3 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 4 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
| 5 | 8 | ||
| @@ -50,4 +53,14 @@ public class LineServiceImpl extends BaseServiceImpl<Line, Integer> implements L | @@ -50,4 +53,14 @@ public class LineServiceImpl extends BaseServiceImpl<Line, Integer> implements L | ||
| 50 | return repository.findOne(id); | 53 | return repository.findOne(id); |
| 51 | } | 54 | } |
| 52 | 55 | ||
| 56 | + @Override | ||
| 57 | + public String lineCodeVerification(String lineCode) { | ||
| 58 | + String state = "true"; | ||
| 59 | + Line line = repository.findByLineCode(lineCode); | ||
| 60 | + if(line != null){ | ||
| 61 | + state = "false"; | ||
| 62 | + } | ||
| 63 | + return state; | ||
| 64 | + } | ||
| 65 | + | ||
| 53 | } | 66 | } |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -246,7 +246,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -246,7 +246,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 246 | 246 | ||
| 247 | schedule.setDfsjAll(dfsj); | 247 | schedule.setDfsjAll(dfsj); |
| 248 | schedule.setDfAuto(false); | 248 | schedule.setDfAuto(false); |
| 249 | - schedule.addRemarks(remarks); | 249 | + schedule.setRemarks(remarks); |
| 250 | 250 | ||
| 251 | List<ScheduleRealInfo> ts = new ArrayList<>(); | 251 | List<ScheduleRealInfo> ts = new ArrayList<>(); |
| 252 | ts.add(schedule); | 252 | ts.add(schedule); |
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
| @@ -426,8 +426,8 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im | @@ -426,8 +426,8 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im | ||
| 426 | public SchedulePlan save(SchedulePlan schedulePlan) { | 426 | public SchedulePlan save(SchedulePlan schedulePlan) { |
| 427 | // pre、如果排班的数据之前已经有了,删除之前的数据 | 427 | // pre、如果排班的数据之前已经有了,删除之前的数据 |
| 428 | Date startpre = new Date(); | 428 | Date startpre = new Date(); |
| 429 | - scheduleRuleService.deelteSchedulePlanInfo( | ||
| 430 | - schedulePlan.getXl().getId(), | 429 | + scheduleRuleService.deleteSchedulePlanInfo( |
| 430 | + schedulePlan.getXl().getLineCode(), | ||
| 431 | schedulePlan.getScheduleFromTime(), | 431 | schedulePlan.getScheduleFromTime(), |
| 432 | schedulePlan.getScheduleToTime()); | 432 | schedulePlan.getScheduleToTime()); |
| 433 | Date endpre = new Date(); | 433 | Date endpre = new Date(); |
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleService.java
| @@ -44,11 +44,11 @@ public interface ScheduleRuleService { | @@ -44,11 +44,11 @@ public interface ScheduleRuleService { | ||
| 44 | 44 | ||
| 45 | /** | 45 | /** |
| 46 | * 删除指定时间范围的排班明细。 | 46 | * 删除指定时间范围的排班明细。 |
| 47 | - * @param xlid 线路id | 47 | + * @param xlbm 线路编码 |
| 48 | * @param datefrom 开始日期 | 48 | * @param datefrom 开始日期 |
| 49 | * @param dateto 结束日期 | 49 | * @param dateto 结束日期 |
| 50 | */ | 50 | */ |
| 51 | - void deelteSchedulePlanInfo(Integer xlid, Date datefrom, Date dateto); | 51 | + void deleteSchedulePlanInfo(String xlbm, Date datefrom, Date dateto); |
| 52 | 52 | ||
| 53 | /** | 53 | /** |
| 54 | * 查找线路的套跑规则,并封装成规则输入对象。 | 54 | * 查找线路的套跑规则,并封装成规则输入对象。 |
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleServiceImpl.java
| @@ -137,9 +137,9 @@ public class ScheduleRuleServiceImpl implements ScheduleRuleService { | @@ -137,9 +137,9 @@ public class ScheduleRuleServiceImpl implements ScheduleRuleService { | ||
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED) | 139 | @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED) |
| 140 | - public void deelteSchedulePlanInfo(Integer xlid, Date datefrom, Date dateto) { | ||
| 141 | - String sql = "delete from bsth_c_s_sp_info where xl = ? and schedule_date >= ? and schedule_date <= ?"; | ||
| 142 | - jdbcTemplate.update(sql, xlid, datefrom, dateto); | 140 | + public void deleteSchedulePlanInfo(String xlbm, Date datefrom, Date dateto) { |
| 141 | + String sql = "delete from bsth_c_s_sp_info where xl_bm = ? and schedule_date >= ? and schedule_date <= ?"; | ||
| 142 | + jdbcTemplate.update(sql, xlbm, datefrom, dateto); | ||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | @Override | 145 | @Override |