Commit 00bf7cb450702354747e937a1547b48806b52289
1 parent
0b829b21
update
Showing
17 changed files
with
815 additions
and
130 deletions
src/main/java/com/bsth/Application.java
| 1 | package com.bsth; | 1 | package com.bsth; |
| 2 | 2 | ||
| 3 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 4 | +import com.fasterxml.jackson.databind.SerializationFeature; | ||
| 3 | import org.springframework.boot.SpringApplication; | 5 | import org.springframework.boot.SpringApplication; |
| 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 7 | +import org.springframework.context.annotation.Bean; | ||
| 8 | +import org.springframework.context.annotation.Primary; | ||
| 5 | 9 | ||
| 6 | @SpringBootApplication | 10 | @SpringBootApplication |
| 7 | public class Application{ | 11 | public class Application{ |
| 8 | 12 | ||
| 9 | -// @Bean | ||
| 10 | -// @Primary | ||
| 11 | -// public ObjectMapper objectMapper() { | ||
| 12 | -// ObjectMapper objectMapper = new ObjectMapper(); | ||
| 13 | -// objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); | ||
| 14 | -// | ||
| 15 | -// return objectMapper; | ||
| 16 | -// } | 13 | + @Bean |
| 14 | + @Primary | ||
| 15 | + public ObjectMapper objectMapper() { | ||
| 16 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
| 17 | + objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); | ||
| 18 | + | ||
| 19 | + return objectMapper; | ||
| 20 | + } | ||
| 17 | 21 | ||
| 18 | public static void main(String[] args) throws Exception { | 22 | public static void main(String[] args) throws Exception { |
| 19 | SpringApplication.run(Application.class, args); | 23 | SpringApplication.run(Application.class, args); |
src/main/java/com/bsth/controller/schedule/SchedulePlanController.java
| @@ -2,13 +2,33 @@ package com.bsth.controller.schedule; | @@ -2,13 +2,33 @@ package com.bsth.controller.schedule; | ||
| 2 | 2 | ||
| 3 | import com.bsth.controller.BaseController; | 3 | import com.bsth.controller.BaseController; |
| 4 | import com.bsth.entity.schedule.SchedulePlan; | 4 | import com.bsth.entity.schedule.SchedulePlan; |
| 5 | +import org.springframework.web.bind.annotation.RequestBody; | ||
| 5 | import org.springframework.web.bind.annotation.RequestMapping; | 6 | import org.springframework.web.bind.annotation.RequestMapping; |
| 7 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 6 | import org.springframework.web.bind.annotation.RestController; | 8 | import org.springframework.web.bind.annotation.RestController; |
| 7 | 9 | ||
| 10 | +import java.util.Map; | ||
| 11 | + | ||
| 8 | /** | 12 | /** |
| 9 | * Created by xu on 16/6/16. | 13 | * Created by xu on 16/6/16. |
| 10 | */ | 14 | */ |
| 11 | @RestController | 15 | @RestController |
| 12 | @RequestMapping("spc") | 16 | @RequestMapping("spc") |
| 13 | public class SchedulePlanController extends BaseController<SchedulePlan, Long> { | 17 | public class SchedulePlanController extends BaseController<SchedulePlan, Long> { |
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody | ||
| 21 | + * @Title: save | ||
| 22 | + * @Description: TODO(持久化对象) | ||
| 23 | + * @param @param t | ||
| 24 | + * @param @return 设定文件 | ||
| 25 | + * @return Map<String,Object> {status: 1(成功),-1(失败)} | ||
| 26 | + * @throws | ||
| 27 | + */ | ||
| 28 | + @RequestMapping(method = RequestMethod.POST) | ||
| 29 | + public Map<String, Object> save(@RequestBody SchedulePlan t){ | ||
| 30 | + | ||
| 31 | + return baseService.save(t); | ||
| 32 | + } | ||
| 33 | + | ||
| 14 | } | 34 | } |
src/main/java/com/bsth/entity/schedule/SchedulePlan.java
| @@ -27,12 +27,12 @@ public class SchedulePlan { | @@ -27,12 +27,12 @@ public class SchedulePlan { | ||
| 27 | private Long id; | 27 | private Long id; |
| 28 | 28 | ||
| 29 | /** 关联的线路 */ | 29 | /** 关联的线路 */ |
| 30 | - @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | 30 | + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY) |
| 31 | private Line xl; | 31 | private Line xl; |
| 32 | /** 关联的时刻表/模版 */ | 32 | /** 关联的时刻表/模版 */ |
| 33 | - @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | 33 | + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY) |
| 34 | private TTInfo ttInfo; | 34 | private TTInfo ttInfo; |
| 35 | - /** 关联的排班规则(这里暂时改成可以不关联规则,直接生成排班) */ | 35 | + /** TODO:关联的排班规则(这里暂时改成可以不关联规则,直接生成排班) */ |
| 36 | @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | 36 | @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) |
| 37 | private ScheduleRule1 scheduleRule1; | 37 | private ScheduleRule1 scheduleRule1; |
| 38 | 38 |
src/main/java/com/bsth/entity/schedule/TTInfo.java
| @@ -24,7 +24,7 @@ public class TTInfo { | @@ -24,7 +24,7 @@ public class TTInfo { | ||
| 24 | private Long id; | 24 | private Long id; |
| 25 | 25 | ||
| 26 | /** 线路关联 */ | 26 | /** 线路关联 */ |
| 27 | - @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | 27 | + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY) |
| 28 | private Line xl; | 28 | private Line xl; |
| 29 | 29 | ||
| 30 | /** 时刻表名称 */ | 30 | /** 时刻表名称 */ |
src/main/java/com/bsth/service/schedule/SchedulePlanServiceImpl.java
| 1 | package com.bsth.service.schedule; | 1 | package com.bsth.service.schedule; |
| 2 | 2 | ||
| 3 | import com.bsth.entity.schedule.SchedulePlan; | 3 | import com.bsth.entity.schedule.SchedulePlan; |
| 4 | +import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | ||
| 4 | import com.bsth.service.impl.BaseServiceImpl; | 5 | import com.bsth.service.impl.BaseServiceImpl; |
| 6 | +import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; | ||
| 7 | +import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output; | ||
| 8 | +import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input; | ||
| 9 | +import org.kie.api.KieBase; | ||
| 10 | +import org.kie.api.runtime.KieSession; | ||
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 5 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
| 13 | +import org.springframework.transaction.annotation.Isolation; | ||
| 14 | +import org.springframework.transaction.annotation.Propagation; | ||
| 15 | +import org.springframework.transaction.annotation.Transactional; | ||
| 16 | + | ||
| 17 | +import java.util.*; | ||
| 6 | 18 | ||
| 7 | /** | 19 | /** |
| 8 | * Created by xu on 16/6/16. | 20 | * Created by xu on 16/6/16. |
| 9 | */ | 21 | */ |
| 10 | @Service | 22 | @Service |
| 11 | public class SchedulePlanServiceImpl extends BaseServiceImpl<SchedulePlan, Long> implements SchedulePlanService { | 23 | public class SchedulePlanServiceImpl extends BaseServiceImpl<SchedulePlan, Long> implements SchedulePlanService { |
| 24 | + @Autowired | ||
| 25 | + private KieBase kieBase; | ||
| 26 | + @Autowired | ||
| 27 | + private ScheduleRule1FlatService scheduleRule1FlatService; | ||
| 28 | + | ||
| 29 | + @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED) | ||
| 30 | + @Override | ||
| 31 | + public Map<String, Object> save(SchedulePlan schedulePlan) { | ||
| 32 | + // 查询参数 | ||
| 33 | + Map<String, Object> param = new HashMap<>(); | ||
| 34 | + | ||
| 35 | + // 1、查出指定线路的所有规则 | ||
| 36 | + param.clear(); | ||
| 37 | + param.put("xl.id_eq", schedulePlan.getXl().getId()); | ||
| 38 | + Iterable<ScheduleRule1Flat> scheduleRule1FlatIterable = scheduleRule1FlatService.list(param); | ||
| 39 | + if (!scheduleRule1FlatIterable.iterator().hasNext()) | ||
| 40 | + throw new RuntimeException("线路:" + schedulePlan.getXl().getName() + " 没有配置规则!"); | ||
| 41 | + | ||
| 42 | + // 2-1、构造drools规则输入数据,输出数据 | ||
| 43 | + // 全局计算参数 | ||
| 44 | + ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(schedulePlan); | ||
| 45 | + // 每个规则对应的输入参数 | ||
| 46 | + List<ScheduleRule_input> scheduleRule_inputs = new ArrayList<>(); | ||
| 47 | + Iterator<ScheduleRule1Flat> scheduleRule1FlatIterator = scheduleRule1FlatIterable.iterator(); | ||
| 48 | + while (scheduleRule1FlatIterator.hasNext()) { | ||
| 49 | + ScheduleRule1Flat scheduleRule1Flat_temp = scheduleRule1FlatIterator.next(); | ||
| 50 | + ScheduleRule_input scheduleRule_input = new ScheduleRule_input(scheduleRule1Flat_temp); | ||
| 51 | + scheduleRule_inputs.add(scheduleRule_input); | ||
| 52 | + } | ||
| 53 | + // 规则输出数据 | ||
| 54 | + ScheduleResults_output scheduleResults_output = new ScheduleResults_output(); | ||
| 55 | + | ||
| 56 | + // 2-2、构造drools session->载入数据->启动规则->计算->销毁session | ||
| 57 | + // 创建session,内部配置的是stateful | ||
| 58 | + KieSession session = kieBase.newKieSession(); | ||
| 59 | + // 设置gloable对象,在drl中通过别名使用 | ||
| 60 | + session.setGlobal("scheduleResult", scheduleResults_output); | ||
| 61 | + // 载入数据 | ||
| 62 | + session.insert(scheduleCalcuParam_input); | ||
| 63 | + for (ScheduleRule_input scheduleRule_input : scheduleRule_inputs) { | ||
| 64 | + session.insert(scheduleRule_input); | ||
| 65 | + } | ||
| 66 | + // 执行rule | ||
| 67 | + session.fireAllRules(); | ||
| 68 | + | ||
| 69 | + // 执行完毕销毁,有日志的也要关闭 | ||
| 70 | + session.dispose(); | ||
| 71 | + | ||
| 72 | + | ||
| 73 | + // TODO: | ||
| 74 | + | ||
| 75 | + System.out.println(scheduleResults_output.showGuideboardDesc1()); | ||
| 76 | + | ||
| 77 | + return null; | ||
| 78 | + | ||
| 79 | +// return super.save(schedulePlan); | ||
| 80 | + } | ||
| 12 | } | 81 | } |
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleCalcuParam_input.java
| 1 | package com.bsth.service.schedule.rules.shiftloop; | 1 | package com.bsth.service.schedule.rules.shiftloop; |
| 2 | 2 | ||
| 3 | +import com.bsth.entity.schedule.SchedulePlan; | ||
| 3 | import org.joda.time.DateTime; | 4 | import org.joda.time.DateTime; |
| 4 | 5 | ||
| 5 | /** | 6 | /** |
| @@ -13,6 +14,14 @@ public class ScheduleCalcuParam_input { | @@ -13,6 +14,14 @@ public class ScheduleCalcuParam_input { | ||
| 13 | /** 时刻表id */ | 14 | /** 时刻表id */ |
| 14 | private Long ttinfoId; | 15 | private Long ttinfoId; |
| 15 | 16 | ||
| 17 | + public ScheduleCalcuParam_input() {} | ||
| 18 | + | ||
| 19 | + public ScheduleCalcuParam_input(SchedulePlan schedulePlan) { | ||
| 20 | + this.fromDate = new DateTime((schedulePlan.getScheduleFromTime())); | ||
| 21 | + this.toDate = new DateTime((schedulePlan.getScheduleToTime())); | ||
| 22 | + this.ttinfoId = schedulePlan.getTtInfo().getId(); | ||
| 23 | + } | ||
| 24 | + | ||
| 16 | public DateTime getFromDate() { | 25 | public DateTime getFromDate() { |
| 17 | return fromDate; | 26 | return fromDate; |
| 18 | } | 27 | } |
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleRule_input.java
| 1 | package com.bsth.service.schedule.rules.shiftloop; | 1 | package com.bsth.service.schedule.rules.shiftloop; |
| 2 | 2 | ||
| 3 | +import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | ||
| 4 | +import com.google.common.base.Splitter; | ||
| 3 | import org.joda.time.DateTime; | 5 | import org.joda.time.DateTime; |
| 4 | 6 | ||
| 5 | import java.util.ArrayList; | 7 | import java.util.ArrayList; |
| @@ -29,6 +31,24 @@ public class ScheduleRule_input { | @@ -29,6 +31,24 @@ public class ScheduleRule_input { | ||
| 29 | 31 | ||
| 30 | // TODO:车辆翻班暂时不考虑进去 | 32 | // TODO:车辆翻班暂时不考虑进去 |
| 31 | 33 | ||
| 34 | + public ScheduleRule_input() {} | ||
| 35 | + | ||
| 36 | + public ScheduleRule_input(ScheduleRule1Flat scheduleRule1Flat) { | ||
| 37 | + this.ruleId = scheduleRule1Flat.getId(); | ||
| 38 | + this.qyrq = new DateTime(scheduleRule1Flat.getQyrq()); | ||
| 39 | + List<String> lpIds = Splitter.on(",").splitToList(scheduleRule1Flat.getLpIds()); | ||
| 40 | + for (String lpId : lpIds) { | ||
| 41 | + this.guideboardIds.add(Long.parseLong(lpId)); | ||
| 42 | + } | ||
| 43 | + this.startGbdIndex = scheduleRule1Flat.getLpStart(); | ||
| 44 | + List<String> ryCids = Splitter.on(",").splitToList(scheduleRule1Flat.getRyIds()); | ||
| 45 | + for (String ryCid : ryCids) { | ||
| 46 | + this.employeeConfigIds.add(Long.parseLong(ryCid)); | ||
| 47 | + } | ||
| 48 | + this.startEIndex = scheduleRule1Flat.getRyStart(); | ||
| 49 | + this.carConfigId = new Long(scheduleRule1Flat.getCl().getId()); | ||
| 50 | + } | ||
| 51 | + | ||
| 32 | 52 | ||
| 33 | public Long getRuleId() { | 53 | public Long getRuleId() { |
| 34 | return ruleId; | 54 | return ruleId; |
src/main/resources/static/index.html
| @@ -304,7 +304,7 @@ tr.row-active td { | @@ -304,7 +304,7 @@ tr.row-active td { | ||
| 304 | <script src="/assets/bower_components/oclazyload/dist/ocLazyLoad.min.js" data-autocephaly=1></script> | 304 | <script src="/assets/bower_components/oclazyload/dist/ocLazyLoad.min.js" data-autocephaly=1></script> |
| 305 | <script src="/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js" data-autocephaly=1></script> | 305 | <script src="/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js" data-autocephaly=1></script> |
| 306 | <!-- schedule计划调度AngularJS模块主JS --> | 306 | <!-- schedule计划调度AngularJS模块主JS --> |
| 307 | -<script src="/pages/scheduleApp/module/main.js" data-autocephaly=1></script> | 307 | +<script src="/pages/scheduleApp/module/main.js" data-exclude=1></script> |
| 308 | 308 | ||
| 309 | <script data-exclude=1> | 309 | <script data-exclude=1> |
| 310 | //初始打开的片段地址 | 310 | //初始打开的片段地址 |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html
| 1 | <!-- ui-route employeeInfoManage.list --> | 1 | <!-- ui-route employeeInfoManage.list --> |
| 2 | <div ng-controller="EmployeeInfoManageListCtrl as ctrl"> | 2 | <div ng-controller="EmployeeInfoManageListCtrl as ctrl"> |
| 3 | - <table class="table table-striped table-bordered table-hover table-checkable order-column"> | ||
| 4 | - <thead> | ||
| 5 | - <tr role="row" class="heading"> | ||
| 6 | - <th> | ||
| 7 | - <input type="checkbox" class="group-checkable"/> | ||
| 8 | - </th> | ||
| 9 | - <th>序号</th> | ||
| 10 | - <th>姓名</th> | ||
| 11 | - <th>工号</th> | ||
| 12 | - <th>性别</th> | ||
| 13 | - <th>所在公司</th> | ||
| 14 | - <th>分公司</th> | ||
| 15 | - <th>工种</th> | ||
| 16 | - <th width="14%">操作</th> | ||
| 17 | - </tr> | ||
| 18 | - <tr role="row" class="filter"> | ||
| 19 | - <td></td> | ||
| 20 | - <td> | ||
| 21 | - <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().personnelCode_like"/> | ||
| 22 | - </td> | ||
| 23 | - <td> | ||
| 24 | - <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().personnelName_like"/> | ||
| 25 | - </td> | ||
| 26 | - <td> | ||
| 27 | - <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().jobCode_like"/> | ||
| 28 | - </td> | ||
| 29 | - <td> | ||
| 30 | - <div style="width: 150px"> | ||
| 31 | - <sa-Select model="ctrl.searchCondition()" | ||
| 32 | - dicgroup="sexType" | ||
| 33 | - placeholder="请选择..." | ||
| 34 | - name="personnelType" | ||
| 35 | - codename="personnelType_eq"> | ||
| 36 | - </sa-Select> | ||
| 37 | - </div> | ||
| 38 | - </td> | ||
| 39 | - <td> | ||
| 40 | - <div style="width: 150px"> | ||
| 41 | - <sa-Select model="ctrl.searchCondition()" | ||
| 42 | - dicgroup="gsType" | ||
| 43 | - placeholder="请选择..." | ||
| 44 | - name="gs" | ||
| 45 | - codename="companyCode_eq"> | ||
| 46 | - </sa-Select> | ||
| 47 | - </div> | ||
| 48 | - </td> | ||
| 49 | - <td style="width: 100px"> | 3 | + <div style="width: 100%; height: 100%; overflow: auto"> |
| 4 | + <table style="2000px:" class="table table-striped table-bordered table-hover table-checkable order-column"> | ||
| 5 | + <thead> | ||
| 6 | + <tr role="row" class="heading"> | ||
| 7 | + <th> | ||
| 8 | + <input type="checkbox" class="group-checkable"/> | ||
| 9 | + </th> | ||
| 10 | + <th>序号</th> | ||
| 11 | + <th>姓名</th> | ||
| 12 | + <th>工号</th> | ||
| 13 | + <th>性别</th> | ||
| 14 | + <th>所在公司</th> | ||
| 15 | + <th>分公司</th> | ||
| 16 | + <th>工种</th> | ||
| 17 | + <th>操作</th> | ||
| 18 | + </tr> | ||
| 19 | + <tr role="row" class="filter"> | ||
| 20 | + <td></td> | ||
| 21 | + <td> | ||
| 22 | + <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().personnelCode_like"/> | ||
| 23 | + </td> | ||
| 24 | + <td> | ||
| 25 | + <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().personnelName_like"/> | ||
| 26 | + </td> | ||
| 27 | + <td> | ||
| 28 | + <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().jobCode_like"/> | ||
| 29 | + </td> | ||
| 30 | + <td> | ||
| 31 | + <div style="width: 150px"> | ||
| 32 | + <sa-Select model="ctrl.searchCondition()" | ||
| 33 | + dicgroup="sexType" | ||
| 34 | + placeholder="请选择..." | ||
| 35 | + name="personnelType" | ||
| 36 | + codename="personnelType_eq"> | ||
| 37 | + </sa-Select> | ||
| 38 | + </div> | ||
| 39 | + </td> | ||
| 40 | + <td> | ||
| 41 | + <div style="width: 150px"> | ||
| 42 | + <sa-Select model="ctrl.searchCondition()" | ||
| 43 | + dicgroup="gsType" | ||
| 44 | + placeholder="请选择..." | ||
| 45 | + name="gs" | ||
| 46 | + codename="companyCode_eq"> | ||
| 47 | + </sa-Select> | ||
| 48 | + </div> | ||
| 49 | + </td> | ||
| 50 | + <td style="width: 100px"> | ||
| 50 | 51 | ||
| 51 | - </td> | ||
| 52 | - <td> | ||
| 53 | - <div style="width: 180px"> | ||
| 54 | - <sa-Select model="ctrl.searchCondition()" | ||
| 55 | - dicgroup="gzType" | ||
| 56 | - placeholder="请选择..." | ||
| 57 | - name="posts" | ||
| 58 | - codename="posts_eq"> | ||
| 59 | - </sa-Select> | ||
| 60 | - </div> | ||
| 61 | - </td> | ||
| 62 | - <td> | ||
| 63 | - <button class="btn btn-sm green btn-outline filter-submit margin-bottom" | ||
| 64 | - ng-click="ctrl.pageChanaged()"> | ||
| 65 | - <i class="fa fa-search"></i> 搜索</button> | 52 | + </td> |
| 53 | + <td> | ||
| 54 | + <div style="width: 180px"> | ||
| 55 | + <sa-Select model="ctrl.searchCondition()" | ||
| 56 | + dicgroup="gzType" | ||
| 57 | + placeholder="请选择..." | ||
| 58 | + name="posts" | ||
| 59 | + codename="posts_eq"> | ||
| 60 | + </sa-Select> | ||
| 61 | + </div> | ||
| 62 | + </td> | ||
| 63 | + <td> | ||
| 64 | + <div style="width: 150px"> | ||
| 65 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" | ||
| 66 | + ng-click="ctrl.pageChanaged()"> | ||
| 67 | + <i class="fa fa-search"></i> 搜索</button> | ||
| 66 | 68 | ||
| 67 | - <button class="btn btn-sm red btn-outline filter-cancel" | ||
| 68 | - ng-click="ctrl.resetSearchCondition()"> | ||
| 69 | - <i class="fa fa-times"></i> 重置</button> | ||
| 70 | - </td> | 69 | + <button class="btn btn-sm red btn-outline filter-cancel" |
| 70 | + ng-click="ctrl.resetSearchCondition()"> | ||
| 71 | + <i class="fa fa-times"></i> 重置</button> | ||
| 72 | + </div> | ||
| 73 | + | ||
| 74 | + </td> | ||
| 75 | + | ||
| 76 | + </tr> | ||
| 77 | + </thead> | ||
| 78 | + <tbody> | ||
| 79 | + <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> | ||
| 80 | + <td> | ||
| 81 | + <input type="checkbox"/> | ||
| 82 | + </td> | ||
| 83 | + <td> | ||
| 84 | + <span ng-bind="$index + 1"></span> | ||
| 85 | + </td> | ||
| 86 | + <td> | ||
| 87 | + <span ng-bind="info.personnelName"></span> | ||
| 88 | + </td> | ||
| 89 | + <td> | ||
| 90 | + <span ng-bind="info.jobCode"></span> | ||
| 91 | + </td> | ||
| 92 | + <td> | ||
| 93 | + <span ng-bind="info.personnelType | dict:'sexType':'未知'"></span> | ||
| 94 | + </td> | ||
| 95 | + <td> | ||
| 96 | + <span ng-bind="info.company"></span> | ||
| 97 | + </td> | ||
| 98 | + <td> | ||
| 99 | + <span ng-bind="info.brancheCompany"></span> | ||
| 100 | + </td> | ||
| 101 | + <td> | ||
| 102 | + <span ng-bind="info.posts | dict:'gzType':'未知'"></span> | ||
| 103 | + </td> | ||
| 104 | + <td> | ||
| 105 | + <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> | ||
| 106 | + <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | ||
| 107 | + <a ui-sref="employeeInfoManage_detail({id: info.id})" class="btn default blue-stripe btn-sm"> 详细 </a> | ||
| 108 | + <a ui-sref="employeeInfoManage_edit({id: info.id})" class="btn default blue-stripe btn-sm"> 修改 </a> | ||
| 109 | + </td> | ||
| 110 | + </tr> | ||
| 111 | + </tbody> | ||
| 112 | + </table> | ||
| 113 | + </div> | ||
| 71 | 114 | ||
| 72 | - </tr> | ||
| 73 | - </thead> | ||
| 74 | - <tbody> | ||
| 75 | - <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> | ||
| 76 | - <td> | ||
| 77 | - <input type="checkbox"/> | ||
| 78 | - </td> | ||
| 79 | - <td> | ||
| 80 | - <span ng-bind="$index + 1"></span> | ||
| 81 | - </td> | ||
| 82 | - <td> | ||
| 83 | - <span ng-bind="info.personnelName"></span> | ||
| 84 | - </td> | ||
| 85 | - <td> | ||
| 86 | - <span ng-bind="info.jobCode"></span> | ||
| 87 | - </td> | ||
| 88 | - <td> | ||
| 89 | - <span ng-bind="info.personnelType | dict:'sexType':'未知'"></span> | ||
| 90 | - </td> | ||
| 91 | - <td> | ||
| 92 | - <span ng-bind="info.company"></span> | ||
| 93 | - </td> | ||
| 94 | - <td> | ||
| 95 | - <span ng-bind="info.brancheCompany"></span> | ||
| 96 | - </td> | ||
| 97 | - <td> | ||
| 98 | - <span ng-bind="info.posts | dict:'gzType':'未知'"></span> | ||
| 99 | - </td> | ||
| 100 | - <td> | ||
| 101 | - <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> | ||
| 102 | - <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | ||
| 103 | - <a ui-sref="employeeInfoManage_detail({id: info.id})" class="btn default blue-stripe btn-sm"> 详细 </a> | ||
| 104 | - <a ui-sref="employeeInfoManage_edit({id: info.id})" class="btn default blue-stripe btn-sm"> 修改 </a> | ||
| 105 | - </td> | ||
| 106 | - </tr> | ||
| 107 | - </tbody> | ||
| 108 | - </table> | ||
| 109 | 115 | ||
| 110 | <div style="text-align: right;"> | 116 | <div style="text-align: right;"> |
| 111 | <uib-pagination total-items="ctrl.pageInfo.totalItems" | 117 | <uib-pagination total-items="ctrl.pageInfo.totalItems" |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/form.html
0 → 100644
| 1 | +<div class="page-head"> | ||
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>排班计划管理</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">运营计划管理</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="schedulePlanManage">排班计划管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">生成排班明细信息</span> | ||
| 22 | + </li> | ||
| 23 | +</ul> | ||
| 24 | + | ||
| 25 | +<div class="portlet light bordered" ng-controller="SchedulePlanManageFormCtrl as ctrl"> | ||
| 26 | + <div class="portlet-title"> | ||
| 27 | + <div class="caption"> | ||
| 28 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | + class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 30 | + </div> | ||
| 31 | + </div> | ||
| 32 | + | ||
| 33 | + <div class="portlet-body form"> | ||
| 34 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 35 | + <!--<div class="alert alert-danger display-hide">--> | ||
| 36 | + <!--<button class="close" data-close="alert"></button>--> | ||
| 37 | + <!--您的输入有误,请检查下面的输入项--> | ||
| 38 | + <!--</div>--> | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + <!-- 其他信息放置在这里 --> | ||
| 42 | + <div class="form-body"> | ||
| 43 | + <div class="form-group has-success has-feedback"> | ||
| 44 | + <label class="col-md-2 control-label">线路*:</label> | ||
| 45 | + <div class="col-md-3"> | ||
| 46 | + <sa-Select2 model="ctrl.schedulePlanManageForSave" | ||
| 47 | + name="xl" | ||
| 48 | + required="true" | ||
| 49 | + type="xl" | ||
| 50 | + modelcolname1="xl_id" | ||
| 51 | + datacolname1="id" | ||
| 52 | + showcolname="name" | ||
| 53 | + placeholder="请输拼音..."> | ||
| 54 | + </sa-Select2> | ||
| 55 | + </div> | ||
| 56 | + <!-- 隐藏块,显示验证信息 --> | ||
| 57 | + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required"> | ||
| 58 | + 线路必须选择 | ||
| 59 | + </div> | ||
| 60 | + </div> | ||
| 61 | + <div class="form-group has-success has-feedback"> | ||
| 62 | + <label class="col-md-2 control-label">时刻表*:</label> | ||
| 63 | + <div class="col-md-3"> | ||
| 64 | + <sa-Select2 model="ctrl.schedulePlanManageForSave" | ||
| 65 | + name="ttInfo" | ||
| 66 | + required="true" | ||
| 67 | + type="ttInfo" | ||
| 68 | + modelcolname1="ttInfo_id" | ||
| 69 | + datacolname1="id" | ||
| 70 | + showcolname="name" | ||
| 71 | + placeholder="请输拼音..."> | ||
| 72 | + </sa-Select2> | ||
| 73 | + </div> | ||
| 74 | + <!-- 隐藏块,显示验证信息 --> | ||
| 75 | + <div class="alert alert-danger well-sm" ng-show="myForm.ttInfo.$error.required"> | ||
| 76 | + 时刻表必须选择 | ||
| 77 | + </div> | ||
| 78 | + </div> | ||
| 79 | + | ||
| 80 | + <div class="form-group"> | ||
| 81 | + <label class="col-md-2 control-label">开始日期*:</label> | ||
| 82 | + <div class="col-md-3"> | ||
| 83 | + <div class="input-group"> | ||
| 84 | + <input type="text" class="form-control" | ||
| 85 | + name="scheduleFromTime" placeholder="请选择开始日期..." | ||
| 86 | + uib-datepicker-popup="yyyy年MM月dd日" | ||
| 87 | + is-open="ctrl.scheduleFromTimeOpen" required | ||
| 88 | + ng-model="ctrl.schedulePlanManageForSave.scheduleFromTime" readonly/> | ||
| 89 | + <span class="input-group-btn"> | ||
| 90 | + <button type="button" class="btn btn-default" ng-click="ctrl.scheduleFromTime_open()"> | ||
| 91 | + <i class="glyphicon glyphicon-calendar"></i> | ||
| 92 | + </button> | ||
| 93 | + </span> | ||
| 94 | + </div> | ||
| 95 | + </div> | ||
| 96 | + <!-- 隐藏块,显示验证信息 --> | ||
| 97 | + <div class="alert alert-danger well-sm" ng-show="myForm.scheduleFromTime.$error.required"> | ||
| 98 | + 开始日期必须选择 | ||
| 99 | + </div> | ||
| 100 | + </div> | ||
| 101 | + | ||
| 102 | + <div class="form-group"> | ||
| 103 | + <label class="col-md-2 control-label">结束日期*:</label> | ||
| 104 | + <div class="col-md-3"> | ||
| 105 | + <div class="input-group"> | ||
| 106 | + <input type="text" class="form-control" | ||
| 107 | + name="scheduleToTime" placeholder="请选择启用日期..." | ||
| 108 | + uib-datepicker-popup="yyyy年MM月dd日" | ||
| 109 | + is-open="ctrl.scheduleToTimeOpen" required | ||
| 110 | + ng-model="ctrl.schedulePlanManageForSave.scheduleToTime" readonly/> | ||
| 111 | + <span class="input-group-btn"> | ||
| 112 | + <button type="button" class="btn btn-default" ng-click="ctrl.scheduleToTime_open()"> | ||
| 113 | + <i class="glyphicon glyphicon-calendar"></i> | ||
| 114 | + </button> | ||
| 115 | + </span> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + <!-- 隐藏块,显示验证信息 --> | ||
| 119 | + <div class="alert alert-danger well-sm" ng-show="myForm.scheduleToTime.$error.required"> | ||
| 120 | + 结束日期必须选择 | ||
| 121 | + </div> | ||
| 122 | + </div> | ||
| 123 | + | ||
| 124 | + <!-- 其他form-group --> | ||
| 125 | + | ||
| 126 | + </div> | ||
| 127 | + | ||
| 128 | + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 --> | ||
| 129 | + <div class="form-actions"> | ||
| 130 | + <div class="row"> | ||
| 131 | + <div class="col-md-offset-3 col-md-4"> | ||
| 132 | + <button type="submit" class="btn green" | ||
| 133 | + ng-disabled="myForm.xl.$error.required || | ||
| 134 | + myForm.ttInfo.$error.required || | ||
| 135 | + myForm.scheduleFromTime.$error.required || | ||
| 136 | + myForm.scheduleToTime.$error.required" | ||
| 137 | + ><i class="fa fa-check"></i> 提交</button> | ||
| 138 | + <a type="button" class="btn default" ui-sref="busConfig" ><i class="fa fa-times"></i> 取消</a> | ||
| 139 | + </div> | ||
| 140 | + </div> | ||
| 141 | + </div> | ||
| 142 | + | ||
| 143 | + </form> | ||
| 144 | + | ||
| 145 | + </div> | ||
| 146 | + | ||
| 147 | + | ||
| 148 | +</div> | ||
| 0 | \ No newline at end of file | 149 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list.html
| @@ -14,7 +14,17 @@ | @@ -14,7 +14,17 @@ | ||
| 14 | </tr> | 14 | </tr> |
| 15 | <tr role="row" class="filter"> | 15 | <tr role="row" class="filter"> |
| 16 | <td></td> | 16 | <td></td> |
| 17 | - <td></td> | 17 | + <td> |
| 18 | + <div style="width: 150px"> | ||
| 19 | + <sa-Select2 model="ctrl.searchCondition()" | ||
| 20 | + type="xl" | ||
| 21 | + modelcolname1="xl.id_eq" | ||
| 22 | + datacolname1="id" | ||
| 23 | + showcolname="name" | ||
| 24 | + placeholder="请输拼音..."> | ||
| 25 | + </sa-Select2> | ||
| 26 | + </div> | ||
| 27 | + </td> | ||
| 18 | <td></td> | 28 | <td></td> |
| 19 | <td></td> | 29 | <td></td> |
| 20 | <td></td> | 30 | <td></td> |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/schedulePlanInfoManage.js
| 1 | // 车辆配置管理 service controller 等写在一起 | 1 | // 车辆配置管理 service controller 等写在一起 |
| 2 | -angular.module('ScheduleApp').factory('SchedulePlanInfoManageService', ['SchedulePlanManageService_g', function(service) { | 2 | +angular.module('ScheduleApp').factory('SchedulePlanInfoManageService', ['SchedulePlanInfoManageService_g', function(service) { |
| 3 | /** 当前的查询条件信息 */ | 3 | /** 当前的查询条件信息 */ |
| 4 | var currentSearchCondition = {}; | 4 | var currentSearchCondition = {}; |
| 5 | 5 | ||
| @@ -38,7 +38,7 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService', ['Schedul | @@ -38,7 +38,7 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService', ['Schedul | ||
| 38 | getPage: function() { | 38 | getPage: function() { |
| 39 | var params = currentSearchCondition; // 查询条件 | 39 | var params = currentSearchCondition; // 查询条件 |
| 40 | params.page = currentPageNo - 1; // 服务端页码从0开始 | 40 | params.page = currentPageNo - 1; // 服务端页码从0开始 |
| 41 | - return service.detail.list(params).$promise; | 41 | + return service.rest.list(params).$promise; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | }; | 44 | }; |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js
| @@ -38,7 +38,15 @@ angular.module('ScheduleApp').factory('SchedulePlanManageService', ['SchedulePla | @@ -38,7 +38,15 @@ angular.module('ScheduleApp').factory('SchedulePlanManageService', ['SchedulePla | ||
| 38 | getPage: function() { | 38 | getPage: function() { |
| 39 | var params = currentSearchCondition; // 查询条件 | 39 | var params = currentSearchCondition; // 查询条件 |
| 40 | params.page = currentPageNo - 1; // 服务端页码从0开始 | 40 | params.page = currentPageNo - 1; // 服务端页码从0开始 |
| 41 | - return service.info.list(params).$promise; | 41 | + return service.rest.list(params).$promise; |
| 42 | + }, | ||
| 43 | + /** | ||
| 44 | + * 保存信息。 | ||
| 45 | + * @param obj 车辆详细信息 | ||
| 46 | + * @return 返回一个 promise | ||
| 47 | + */ | ||
| 48 | + saveDetail: function(obj) { | ||
| 49 | + return service.rest.save(obj).$promise; | ||
| 42 | } | 50 | } |
| 43 | 51 | ||
| 44 | }; | 52 | }; |
| @@ -50,8 +58,7 @@ angular.module('ScheduleApp').controller('SchedulePlanManageCtrl', ['SchedulePla | @@ -50,8 +58,7 @@ angular.module('ScheduleApp').controller('SchedulePlanManageCtrl', ['SchedulePla | ||
| 50 | 58 | ||
| 51 | // 切换到form状态 | 59 | // 切换到form状态 |
| 52 | self.goForm = function() { | 60 | self.goForm = function() { |
| 53 | - alert("等待生成"); | ||
| 54 | - | 61 | + $state.go("schedulePlanManage_form"); |
| 55 | } | 62 | } |
| 56 | }]); | 63 | }]); |
| 57 | 64 | ||
| @@ -107,5 +114,53 @@ angular.module('ScheduleApp').controller('SchedulePlanManageListCtrl', ['Schedul | @@ -107,5 +114,53 @@ angular.module('ScheduleApp').controller('SchedulePlanManageListCtrl', ['Schedul | ||
| 107 | }]); | 114 | }]); |
| 108 | 115 | ||
| 109 | 116 | ||
| 117 | +angular.module('ScheduleApp').controller('SchedulePlanManageFormCtrl', ['SchedulePlanManageService', '$stateParams', '$state', '$scope', function(schedulePlanManageService, $stateParams, $state, $scope) { | ||
| 118 | + var self = this; | ||
| 119 | + | ||
| 120 | + // 开始日期 日期控件开关 | ||
| 121 | + self.scheduleFromTimeOpen = false; | ||
| 122 | + self.scheduleFromTime_open = function() { | ||
| 123 | + self.scheduleFromTimeOpen = true; | ||
| 124 | + }; | ||
| 125 | + | ||
| 126 | + // 结束日期 日期控件开关 | ||
| 127 | + self.scheduleToTimeOpen = false; | ||
| 128 | + self.scheduleToTime_open = function() { | ||
| 129 | + self.scheduleToTimeOpen = true; | ||
| 130 | + }; | ||
| 131 | + | ||
| 132 | + // 欲保存的busInfo信息,绑定 | ||
| 133 | + self.schedulePlanManageForSave = {}; | ||
| 134 | + | ||
| 135 | + // 提交方法 | ||
| 136 | + self.submit = function() { | ||
| 137 | + console.log(self.schedulePlanManageForSave); | ||
| 138 | + | ||
| 139 | + var mf = $scope.myForm; | ||
| 140 | + | ||
| 141 | + // xl_id,ttInfo_id要组织成对象,然后删除 | ||
| 142 | + self.schedulePlanManageForSave["xl"] = {}; | ||
| 143 | + self.schedulePlanManageForSave.xl["id"] = self.schedulePlanManageForSave["xl_id"]; | ||
| 144 | + delete self.schedulePlanManageForSave["xl_id"]; | ||
| 145 | + self.schedulePlanManageForSave["ttInfo"] = {}; | ||
| 146 | + self.schedulePlanManageForSave.ttInfo["id"] = self.schedulePlanManageForSave["ttInfo_id"]; | ||
| 147 | + delete self.schedulePlanManageForSave["ttInfo_id"]; | ||
| 110 | 148 | ||
| 149 | + schedulePlanManageService.saveDetail(self.schedulePlanManageForSave).then( | ||
| 150 | + function(result) { | ||
| 151 | + // TODO:弹出框方式以后改 | ||
| 152 | + if (result.status == 'SUCCESS') { | ||
| 153 | + alert("保存成功!"); | ||
| 154 | + $state.go("schedulePlanManage"); | ||
| 155 | + } else { | ||
| 156 | + alert("保存异常!"); | ||
| 157 | + } | ||
| 158 | + }, | ||
| 159 | + function(result) { | ||
| 160 | + // TODO:弹出框方式以后改 | ||
| 161 | + alert("出错啦!"); | ||
| 162 | + } | ||
| 163 | + ); | ||
| 164 | + }; | ||
| 165 | +}]); | ||
| 111 | 166 |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/detail.html
| 1 | +<div class="page-head"> | ||
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>排班规则管理</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">运营计划管理</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="scheduleRuleManage">排班规则管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">排班规则详细信息</span> | ||
| 22 | + </li> | ||
| 23 | +</ul> | ||
| 24 | + | ||
| 25 | +<div class="portlet light bordered" ng-controller="ScheduleRuleManageDetailCtrl as ctrl"> | ||
| 26 | + <div class="portlet-title"> | ||
| 27 | + <div class="caption"> | ||
| 28 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | + class="caption-subject font-red-sunglo bold uppercase" | ||
| 30 | + ng-bind="ctrl.title"></span> | ||
| 31 | + </div> | ||
| 32 | + </div> | ||
| 33 | + | ||
| 34 | + <div class="portlet-body form"> | ||
| 35 | + <form class="form-horizontal" novalidate name="myForm"> | ||
| 36 | + <!--<div class="alert alert-danger display-hide">--> | ||
| 37 | + <!--<button class="close" data-close="alert"></button>--> | ||
| 38 | + <!--您的输入有误,请检查下面的输入项--> | ||
| 39 | + <!--</div>--> | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + <!-- 其他信息放置在这里 --> | ||
| 43 | + <div class="form-body"> | ||
| 44 | + <div class="form-group has-success has-feedback"> | ||
| 45 | + <label class="col-md-2 control-label">线路*:</label> | ||
| 46 | + <div class="col-md-3"> | ||
| 47 | + <input type="text" class="form-control" | ||
| 48 | + name="xl" ng-model="ctrl.scheduleRuleManageForDetail.xl.name" readonly/> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | + | ||
| 52 | + <div class="form-group has-success has-feedback"> | ||
| 53 | + <label class="col-md-2 control-label">车辆*:</label> | ||
| 54 | + <div class="col-md-3"> | ||
| 55 | + <input type="text" class="form-control" name="cl" | ||
| 56 | + ng-model="ctrl.scheduleRuleManageForDetail.cl.insideCode" readonly/> | ||
| 57 | + </div> | ||
| 58 | + </div> | ||
| 59 | + | ||
| 60 | + <div class="form-group"> | ||
| 61 | + <label class="col-md-2 control-label">启用日期*:</label> | ||
| 62 | + <div class="col-md-4"> | ||
| 63 | + <input type="text" class="form-control" | ||
| 64 | + name="qyrq" uib-datepicker-popup="yyyy年MM月dd日" | ||
| 65 | + ng-model="ctrl.scheduleRuleManageForDetail.qyrq" readonly/> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + | ||
| 69 | + <div class="form-group"> | ||
| 70 | + <label class="col-md-2 control-label">路牌范围*:</label> | ||
| 71 | + <div class="col-md-4"> | ||
| 72 | + <input type="text" class="form-control" | ||
| 73 | + ng-model="ctrl.scheduleRuleManageForDetail.lpNames" readonly/> | ||
| 74 | + </div> | ||
| 75 | + </div> | ||
| 76 | + | ||
| 77 | + <div class="form-group"> | ||
| 78 | + <label class="col-md-2 control-label">起始路牌*:</label> | ||
| 79 | + <div class="col-md-4"> | ||
| 80 | + <input type="text" class="form-control" | ||
| 81 | + ng-model="ctrl.scheduleRuleManageForDetail.lpStart" readonly/> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | + | ||
| 85 | + <div class="form-group"> | ||
| 86 | + <label class="col-md-2 control-label">人员范围*:</label> | ||
| 87 | + <div class="col-md-4"> | ||
| 88 | + <input type="text" class="form-control" | ||
| 89 | + ng-model="ctrl.scheduleRuleManageForDetail.ryDbbms" readonly/> | ||
| 90 | + </div> | ||
| 91 | + </div> | ||
| 92 | + | ||
| 93 | + <div class="form-group"> | ||
| 94 | + <label class="col-md-2 control-label">起始人员*:</label> | ||
| 95 | + <div class="col-md-4"> | ||
| 96 | + <input type="text" class="form-control" | ||
| 97 | + ng-model="ctrl.scheduleRuleManageForDetail.ryStart" readonly/> | ||
| 98 | + </div> | ||
| 99 | + </div> | ||
| 100 | + | ||
| 101 | + <div class="form-group"> | ||
| 102 | + <label class="col-md-2 control-label">翻班格式:</label> | ||
| 103 | + <div class="col-md-4"> | ||
| 104 | + <input type="text" class="form-control" | ||
| 105 | + ng-model="ctrl.scheduleRuleManageForDetail.fbgs" readonly/> | ||
| 106 | + </div> | ||
| 107 | + </div> | ||
| 108 | + | ||
| 109 | + <!-- 其他form-group --> | ||
| 110 | + | ||
| 111 | + </div> | ||
| 112 | + | ||
| 113 | + </form> | ||
| 114 | + | ||
| 115 | + </div> | ||
| 116 | +</div> | ||
| 0 | \ No newline at end of file | 117 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/edit.html
| 1 | +<div class="page-head"> | ||
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>排班规则管理</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">运营计划管理</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="scheduleRuleManage">排班规则管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">修改排班规则信息</span> | ||
| 22 | + </li> | ||
| 23 | +</ul> | ||
| 24 | + | ||
| 25 | +<div class="portlet light bordered" ng-controller="ScheduleRuleManageFormCtrl as ctrl"> | ||
| 26 | + <div class="portlet-title"> | ||
| 27 | + <div class="caption"> | ||
| 28 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | + class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 30 | + </div> | ||
| 31 | + </div> | ||
| 32 | + | ||
| 33 | + <div class="portlet-body form"> | ||
| 34 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 35 | + <!--<div class="alert alert-danger display-hide">--> | ||
| 36 | + <!--<button class="close" data-close="alert"></button>--> | ||
| 37 | + <!--您的输入有误,请检查下面的输入项--> | ||
| 38 | + <!--</div>--> | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + <!-- 其他信息放置在这里 --> | ||
| 42 | + <div class="form-body"> | ||
| 43 | + <div class="form-group has-success has-feedback"> | ||
| 44 | + <label class="col-md-2 control-label">线路*:</label> | ||
| 45 | + <div class="col-md-3"> | ||
| 46 | + <sa-Select2 model="ctrl.scheduleRuleManageForSave" | ||
| 47 | + name="xl" | ||
| 48 | + required="true" | ||
| 49 | + type="xl" | ||
| 50 | + modelcolname1="xl_id" | ||
| 51 | + datacolname1="id" | ||
| 52 | + showcolname="name" | ||
| 53 | + placeholder="请输拼音..."> | ||
| 54 | + </sa-Select2> | ||
| 55 | + </div> | ||
| 56 | + <!-- 隐藏块,显示验证信息 --> | ||
| 57 | + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required"> | ||
| 58 | + 线路必须选择 | ||
| 59 | + </div> | ||
| 60 | + </div> | ||
| 61 | + <div class="form-group has-success has-feedback"> | ||
| 62 | + <label class="col-md-2 control-label">车辆*:</label> | ||
| 63 | + <div class="col-md-3"> | ||
| 64 | + <sa-Select2 model="ctrl.scheduleRuleManageForSave" | ||
| 65 | + name="cl" | ||
| 66 | + required="true" | ||
| 67 | + type="cl" | ||
| 68 | + modelcolname1="cl_id" | ||
| 69 | + datacolname1="id" | ||
| 70 | + showcolname="insideCode" | ||
| 71 | + placeholder="请输拼音..."> | ||
| 72 | + </sa-Select2> | ||
| 73 | + </div> | ||
| 74 | + <!-- 隐藏块,显示验证信息 --> | ||
| 75 | + <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required"> | ||
| 76 | + 车辆必须选择 | ||
| 77 | + </div> | ||
| 78 | + </div> | ||
| 79 | + | ||
| 80 | + <div class="form-group"> | ||
| 81 | + <label class="col-md-2 control-label">启用日期:</label> | ||
| 82 | + <div class="col-md-3"> | ||
| 83 | + <div class="input-group"> | ||
| 84 | + <input type="text" class="form-control" | ||
| 85 | + name="qyrq" placeholder="请选择启用日期..." | ||
| 86 | + uib-datepicker-popup="yyyy年MM月dd日" | ||
| 87 | + is-open="ctrl.qyrqOpen" required | ||
| 88 | + ng-model="ctrl.scheduleRuleManageForSave.qyrq"/> | ||
| 89 | + <span class="input-group-btn"> | ||
| 90 | + <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> | ||
| 91 | + <i class="glyphicon glyphicon-calendar"></i> | ||
| 92 | + </button> | ||
| 93 | + </span> | ||
| 94 | + </div> | ||
| 95 | + </div> | ||
| 96 | + <!-- 隐藏块,显示验证信息 --> | ||
| 97 | + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required"> | ||
| 98 | + 启用日期必须选择 | ||
| 99 | + </div> | ||
| 100 | + </div> | ||
| 101 | + | ||
| 102 | + <div class="form-group"> | ||
| 103 | + <label class="col-md-2 control-label">路牌范围*:</label> | ||
| 104 | + <div class="col-md-3"> | ||
| 105 | + <input type="text" class="form-control" name="lpNames" ng-model="ctrl.scheduleRuleManageForSave.lpNames" required | ||
| 106 | + placeholder="由路牌名称组成,逗号分隔"/> | ||
| 107 | + </div> | ||
| 108 | + <!-- 隐藏块,显示验证信息 --> | ||
| 109 | + <div class="alert alert-danger well-sm" ng-show="myForm.lpNames.$error.required"> | ||
| 110 | + 路牌范围必须填写 | ||
| 111 | + </div> | ||
| 112 | + </div> | ||
| 113 | + | ||
| 114 | + <div class="form-group"> | ||
| 115 | + <label class="col-md-2 control-label">起始路牌*:</label> | ||
| 116 | + <div class="col-md-3"> | ||
| 117 | + <input type="text" class="form-control" name="lpStart" ng-model="ctrl.scheduleRuleManageForSave.lpStart" required | ||
| 118 | + placeholder="起始路牌,从0开始"/> | ||
| 119 | + </div> | ||
| 120 | + <!-- 隐藏块,显示验证信息 --> | ||
| 121 | + <div class="alert alert-danger well-sm" ng-show="myForm.lpStart.$error.required"> | ||
| 122 | + 起始路牌必须填写 | ||
| 123 | + </div> | ||
| 124 | + </div> | ||
| 125 | + | ||
| 126 | + <div class="form-group"> | ||
| 127 | + <label class="col-md-2 control-label">人员范围*:</label> | ||
| 128 | + <div class="col-md-3"> | ||
| 129 | + <input type="text" class="form-control" name="ryDbbms" ng-model="ctrl.scheduleRuleManageForSave.ryDbbms" required | ||
| 130 | + placeholder="由人员配置的搭班编码组成,逗号分隔"/> | ||
| 131 | + </div> | ||
| 132 | + <!-- 隐藏块,显示验证信息 --> | ||
| 133 | + <div class="alert alert-danger well-sm" ng-show="myForm.ryDbbms.$error.required"> | ||
| 134 | + 人员范围必须填写 | ||
| 135 | + </div> | ||
| 136 | + </div> | ||
| 137 | + | ||
| 138 | + <div class="form-group"> | ||
| 139 | + <label class="col-md-2 control-label">起始人员*:</label> | ||
| 140 | + <div class="col-md-3"> | ||
| 141 | + <input type="text" class="form-control" name="ryStart" ng-model="ctrl.scheduleRuleManageForSave.ryStart" required | ||
| 142 | + placeholder="起始路牌,从0开始"/> | ||
| 143 | + </div> | ||
| 144 | + <!-- 隐藏块,显示验证信息 --> | ||
| 145 | + <div class="alert alert-danger well-sm" ng-show="myForm.ryStart.$error.required"> | ||
| 146 | + 起始路牌必须填写 | ||
| 147 | + </div> | ||
| 148 | + </div> | ||
| 149 | + | ||
| 150 | + <div class="form-group"> | ||
| 151 | + <label class="col-md-2 control-label">翻班格式:</label> | ||
| 152 | + <div class="col-md-3"> | ||
| 153 | + <input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs" | ||
| 154 | + placeholder="车辆翻班格式"/> | ||
| 155 | + </div> | ||
| 156 | + </div> | ||
| 157 | + | ||
| 158 | + | ||
| 159 | + <!-- 其他form-group --> | ||
| 160 | + | ||
| 161 | + </div> | ||
| 162 | + | ||
| 163 | + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 --> | ||
| 164 | + <div class="form-actions"> | ||
| 165 | + <div class="row"> | ||
| 166 | + <div class="col-md-offset-3 col-md-4"> | ||
| 167 | + <button type="submit" class="btn green" | ||
| 168 | + ng-disabled="myForm.xl.$error.required || | ||
| 169 | + myForm.cl.$error.required || | ||
| 170 | + myForm.qyrq.$error.required || | ||
| 171 | + myForm.lpNames.$error.required || | ||
| 172 | + myForm.lpStart.$error.required || | ||
| 173 | + myForm.ryDbbms.$error.required || | ||
| 174 | + myForm.ryStart.$error.required" | ||
| 175 | + ><i class="fa fa-check"></i> 提交</button> | ||
| 176 | + <a type="button" class="btn default" ui-sref="scheduleRuleManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 177 | + </div> | ||
| 178 | + </div> | ||
| 179 | + </div> | ||
| 180 | + | ||
| 181 | + </form> | ||
| 182 | + | ||
| 183 | + </div> | ||
| 184 | + | ||
| 185 | + | ||
| 186 | +</div> | ||
| 0 | \ No newline at end of file | 187 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/list.html
| @@ -92,8 +92,8 @@ | @@ -92,8 +92,8 @@ | ||
| 92 | <td> | 92 | <td> |
| 93 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> | 93 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> |
| 94 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | 94 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> |
| 95 | - <a ui-sref="#" class="btn default blue-stripe btn-sm"> 详细 </a> | ||
| 96 | - <a ui-sref="#" class="btn default blue-stripe btn-sm"> 修改 </a> | 95 | + <a ui-sref="scheduleRuleManage_detail({id : info.id})" class="btn default blue-stripe btn-sm"> 详细 </a> |
| 96 | + <a ui-sref="scheduleRuleManage_edit({id : info.id})" class="btn default blue-stripe btn-sm"> 修改 </a> | ||
| 97 | </td> | 97 | </td> |
| 98 | </tr> | 98 | </tr> |
| 99 | </tbody> | 99 | </tbody> |
src/main/resources/static/pages/scheduleApp/module/main.js
| @@ -700,12 +700,38 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi | @@ -700,12 +700,38 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi | ||
| 700 | name: 'schedulePlanManage_module', | 700 | name: 'schedulePlanManage_module', |
| 701 | insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | 701 | insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 |
| 702 | files: [ | 702 | files: [ |
| 703 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 704 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 705 | + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js" | ||
| 706 | + ] | ||
| 707 | + }); | ||
| 708 | + }] | ||
| 709 | + } | ||
| 710 | + }) | ||
| 711 | + .state("schedulePlanManage_form", { | ||
| 712 | + url: '/schedulePlanManage_form', | ||
| 713 | + views: { | ||
| 714 | + "": { | ||
| 715 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/form.html' | ||
| 716 | + } | ||
| 717 | + }, | ||
| 718 | + | ||
| 719 | + resolve: { | ||
| 720 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 721 | + return $ocLazyLoad.load({ | ||
| 722 | + name: 'schedulePlanManage_form_module', | ||
| 723 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 724 | + files: [ | ||
| 725 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 726 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 703 | "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js" | 727 | "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js" |
| 704 | ] | 728 | ] |
| 705 | }); | 729 | }); |
| 706 | }] | 730 | }] |
| 707 | } | 731 | } |
| 708 | }) | 732 | }) |
| 733 | + | ||
| 734 | + // 排班计划明细管理模块 | ||
| 709 | .state("schedulePlanInfoManage", { | 735 | .state("schedulePlanInfoManage", { |
| 710 | url: '/schedulePlanInfoManage', | 736 | url: '/schedulePlanInfoManage', |
| 711 | views: { | 737 | views: { |
| @@ -991,9 +1017,9 @@ angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', | @@ -991,9 +1017,9 @@ angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', | ||
| 991 | // 排班计划管理service | 1017 | // 排班计划管理service |
| 992 | angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) { | 1018 | angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) { |
| 993 | return { | 1019 | return { |
| 994 | - info: $resource( | 1020 | + rest : $resource( |
| 995 | '/spc/:id', | 1021 | '/spc/:id', |
| 996 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询 | 1022 | + {order: 'createDate', direction: 'DESC', id: '@id_route'}, |
| 997 | { | 1023 | { |
| 998 | list: { | 1024 | list: { |
| 999 | method: 'GET', | 1025 | method: 'GET', |
| @@ -1008,10 +1034,16 @@ angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource | @@ -1008,10 +1034,16 @@ angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource | ||
| 1008 | method: 'POST' | 1034 | method: 'POST' |
| 1009 | } | 1035 | } |
| 1010 | } | 1036 | } |
| 1011 | - ), | ||
| 1012 | - detail: $resource( | 1037 | + ) |
| 1038 | + }; | ||
| 1039 | +}]); | ||
| 1040 | + | ||
| 1041 | +// 排班计划明细管理service | ||
| 1042 | +angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$resource', function($resource) { | ||
| 1043 | + return { | ||
| 1044 | + rest : $resource( | ||
| 1013 | '/spic/:id', | 1045 | '/spic/:id', |
| 1014 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询 | 1046 | + {order: 'createDate', direction: 'DESC', id: '@id_route'}, |
| 1015 | { | 1047 | { |
| 1016 | list: { | 1048 | list: { |
| 1017 | method: 'GET', | 1049 | method: 'GET', |
| @@ -1027,7 +1059,7 @@ angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource | @@ -1027,7 +1059,7 @@ angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource | ||
| 1027 | } | 1059 | } |
| 1028 | } | 1060 | } |
| 1029 | ) | 1061 | ) |
| 1030 | - } | 1062 | + }; |
| 1031 | }]); | 1063 | }]); |
| 1032 | 1064 | ||
| 1033 | // 线路运营统计service | 1065 | // 线路运营统计service |
| @@ -1380,6 +1412,16 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | @@ -1380,6 +1412,16 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun | ||
| 1380 | isArray: true | 1412 | isArray: true |
| 1381 | } | 1413 | } |
| 1382 | } | 1414 | } |
| 1415 | + ), | ||
| 1416 | + ttInfo: $resource( | ||
| 1417 | + '/tic/:type', | ||
| 1418 | + {order: "name", direction: 'ASC'}, | ||
| 1419 | + { | ||
| 1420 | + list: { | ||
| 1421 | + method: 'GET', | ||
| 1422 | + isArray: true | ||
| 1423 | + } | ||
| 1424 | + } | ||
| 1383 | ) | 1425 | ) |
| 1384 | } | 1426 | } |
| 1385 | }]); | 1427 | }]); |