Commit 7acde53580b1f2c9ee8979032fc01ba9ff412268

Authored by 潘钊
1 parent afe60cad

update...

src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -144,6 +144,16 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo,
144 144 }
145 145  
146 146 /**
  147 + * 撤销执行
  148 + * @param id
  149 + * @return
  150 + */
  151 + @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST)
  152 + public Map<String, Object> revokeRealArrive(@RequestParam Long id){
  153 + return scheduleRealInfoService.revokeRealArrive(id);
  154 + }
  155 +
  156 + /**
147 157 *
148 158 * @Title: spaceAdjust
149 159 * @Description: TODO(间隔调整)
... ...
src/main/java/com/bsth/repository/oil/YlbRepository.java
... ... @@ -39,7 +39,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
39 39  
40 40 @Transactional
41 41 @Modifying
42   - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and fgsdm=?3 ",nativeQuery=true)
  42 + @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 ",nativeQuery=true)
43 43 List<Ylb> queryListYlb(String rq,String nbbm);
44 44 /**
45 45 * 查询当天总的加注量和总里程
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -157,4 +157,6 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
157 157 Map<String,Object> lpChangeMulti(String leftIdx, String rightIdx, int type);
158 158  
159 159 void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type);
  160 +
  161 + Map<String,Object> revokeRealArrive(Long id);
160 162 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -9,8 +9,6 @@ import com.bsth.controller.realcontrol.dto.DfsjChange;
9 9 import com.bsth.controller.realcontrol.dto.LpData;
10 10 import com.bsth.data.BasicData;
11 11 import com.bsth.data.LineConfigData;
12   -import com.bsth.data.arrival.ArrivalData_GPS;
13   -import com.bsth.data.arrival.ArrivalEntity;
14 12 import com.bsth.data.schedule.DayOfSchedule;
15 13 import com.bsth.data.schedule.SchAttrCalculator;
16 14 import com.bsth.data.schedule.ScheduleComparator;
... ... @@ -812,8 +810,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
812 810 rs.put("status", ResponseCode.ERROR);
813 811 rs.put("msg", "无实发时间,无法撤销!");
814 812 } else {
815   - //将对应的到离站数据标记为不可信
816   - List<ArrivalEntity> list = ArrivalData_GPS.findByNbbm(sch.getClZbh());
  813 + //将对应的到离站数据标记为不可信 ### 废弃的代码 ####
  814 + /*List<ArrivalEntity> list = ArrivalData_GPS.findByNbbm(sch.getClZbh());
817 815 for (ArrivalEntity arr : list) {
818 816 if (arr.getInOut() == 1
819 817 && arr.getUpDown() == Integer.parseInt(sch.getXlDir())
... ... @@ -822,7 +820,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
822 820 arr.setEnable(false);
823 821 break;
824 822 }
825   - }
  823 + }*/
826 824  
827 825 sch.clearFcsjActual();
828 826 rs.put("status", ResponseCode.SUCCESS);
... ... @@ -830,6 +828,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
830 828 ts.add(sch);
831 829 rs.put("ts", ts);
832 830  
  831 + dayOfSchedule.save(sch);
  832 +
833 833 }
834 834 } catch (Exception e) {
835 835 logger.error("", e);
... ... @@ -2997,7 +2997,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2997 2997 jzl += y.getJzl();
2998 2998 }
2999 2999  
3000   - List<Ylb> listYlb=ylbRepository.queryListYlb(s.getClZbh(), fcrq);
  3000 + List<Ylb> listYlb=ylbRepository.queryListYlb( fcrq,s.getClZbh());
3001 3001 Double ccyl=0.0;
3002 3002 Double jcyl=0.0;
3003 3003 Double yh=0.0;
... ... @@ -3460,4 +3460,39 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3460 3460 leftData.appendTo(rightSch, type);
3461 3461 rightData.appendTo(leftSch, type);
3462 3462 }
  3463 +
  3464 + @Override
  3465 + public Map<String, Object> revokeRealArrive(Long id) {
  3466 + Map<String, Object> rs = new HashMap<>();
  3467 + List<ScheduleRealInfo> ts = new ArrayList<>();
  3468 +
  3469 + try {
  3470 + ScheduleRealInfo sch = dayOfSchedule.get(id);
  3471 + if (sch.getZdsjActual() == null) {
  3472 + rs.put("status", ResponseCode.ERROR);
  3473 + rs.put("msg", "无实际到达时间,无法撤销!");
  3474 + } else {
  3475 +
  3476 + sch.clearZdsjActual();
  3477 + //清除下一个班次的起点到达时间
  3478 + ScheduleRealInfo next = dayOfSchedule.next(sch);
  3479 + if (null != next) {
  3480 + next.setQdzArrDateSJ(null);
  3481 + ts.add(next);
  3482 + }
  3483 +
  3484 + rs.put("status", ResponseCode.SUCCESS);
  3485 +
  3486 + ts.add(sch);
  3487 + rs.put("ts", ts);
  3488 +
  3489 + dayOfSchedule.save(sch);
  3490 +
  3491 + }
  3492 + } catch (Exception e) {
  3493 + logger.error("", e);
  3494 + rs.put("status", ResponseCode.ERROR);
  3495 + }
  3496 + return rs;
  3497 + }
3463 3498 }
3464 3499 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -330,11 +330,11 @@
330 330 <td colspan="14">路别:{{xlName}} 路牌:{{lpName}} 车号:{{clZbh}} 出场时间:{{fcsjActual}} 到达站名:{{zdzName}} 当班调派:&nbsp; 日期:{{scheduleDate}}</td>
331 331 </tr>
332 332 <tr>
333   - <td colspan="2">出场存油 {{map.ccyl}};升</td>
334   - <td colspan="2">加注油量 {{map.jzl}}升</td>
335   - <td colspan="2">进场存油 {{map.jcyl}}升</td>
  333 + <td colspan="2">出场存油 {{ccyl}};升</td>
  334 + <td colspan="2">加注油量 {{jzl}}升</td>
  335 + <td colspan="2">进场存油 {{jcyl}}升</td>
336 336 <td colspan="4">加注机油 &nbsp;升</td>
337   - <td colspan="4">本日耗油 {{map.yh}}升</td>
  337 + <td colspan="4">本日耗油 {{yh}}升</td>
338 338 </tr>
339 339 <tr>
340 340 <td rowspan="2">调度章</td>
... ...
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
... ... @@ -130,6 +130,20 @@ var gb_schedule_context_menu = (function () {
130 130 open_modal(folder + '/lp_change.html', {
131 131 sch: sch
132 132 }, modal_opts);
  133 + },
  134 + cxzx: function (sch) {
  135 + if (!sch.zdsjActual)
  136 + return notify_err('车辆未执行,无法撤销执行!');
  137 +
  138 + var content = '<h3>确定要撤销<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>的实达时间?</h3>'
  139 + alt_confirm(content, function () {
  140 + gb_common.$post('/realSchedule/revokeRealArrive', {
  141 + id: sch.id
  142 + }, function (rs) {
  143 + gb_schedule_table.updateSchedule(rs.ts);
  144 + notify_succ('撤销执行成功!');
  145 + });
  146 + }, '确认撤销执行');
133 147 }
134 148 };
135 149  
... ... @@ -161,6 +175,9 @@ var gb_schedule_context_menu = (function () {
161 175 'cxsf': {
162 176 name: '撤销实发'
163 177 },
  178 + 'cxzx': {
  179 + name: '撤销执行'
  180 + },
164 181 'sep2': '---------',
165 182 'fcxxwt': {
166 183 name: '发车信息微调'
... ...