Commit e52331ef0e34a9312205bde9caf0c6482a722d2f
Merge branch 'minhang' of http://192.168.168.201:8888/panzhaov5/bsth_control into minhang
Showing
50 changed files
with
1813 additions
and
1558 deletions
Too many changes to show.
To preserve performance only 50 of 89 files are displayed.
src/main/java/com/bsth/controller/schedule/BController.java
| 1 | -package com.bsth.controller.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.common.ResponseCode; | |
| 4 | -import com.bsth.service.schedule.BService; | |
| 5 | -import com.bsth.service.schedule.ScheduleException; | |
| 6 | -import com.google.common.base.Splitter; | |
| 7 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | -import org.springframework.data.domain.PageRequest; | |
| 9 | -import org.springframework.data.domain.Sort; | |
| 10 | -import org.springframework.web.bind.annotation.*; | |
| 11 | - | |
| 12 | -import java.io.Serializable; | |
| 13 | -import java.util.ArrayList; | |
| 14 | -import java.util.HashMap; | |
| 15 | -import java.util.List; | |
| 16 | -import java.util.Map; | |
| 17 | - | |
| 18 | -/** | |
| 19 | - * 基础控制器。 | |
| 20 | - */ | |
| 21 | -public class BController<T, ID extends Serializable> { | |
| 22 | - @Autowired | |
| 23 | - protected BService<T, ID> bService; | |
| 24 | - | |
| 25 | - // CRUD 操作 | |
| 26 | - // Create操作 | |
| 27 | - @RequestMapping(method = RequestMethod.POST) | |
| 28 | - public Map<String, Object> save(@RequestBody T t) { | |
| 29 | - T t_saved = bService.save(t); | |
| 30 | - Map<String, Object> rtn = new HashMap<>(); | |
| 31 | - rtn.put("status", ResponseCode.SUCCESS); | |
| 32 | - rtn.put("data", t_saved); | |
| 33 | - return rtn; | |
| 34 | - } | |
| 35 | - // Update操作 | |
| 36 | - @RequestMapping(value="/{id}", method = RequestMethod.POST) | |
| 37 | - public Map<String, Object> update(@RequestBody T t) { | |
| 38 | - return save(t); | |
| 39 | - } | |
| 40 | - // Research操作 | |
| 41 | - @RequestMapping(value = "/{id}", method = RequestMethod.GET) | |
| 42 | - public Map<String, Object> findById(@PathVariable("id") ID id) { | |
| 43 | - T t = bService.findById(id); | |
| 44 | - Map<String, Object> rtn = new HashMap<>(); | |
| 45 | - rtn.put("status", ResponseCode.SUCCESS); | |
| 46 | - rtn.put("data", t); | |
| 47 | - return rtn; | |
| 48 | - } | |
| 49 | - @RequestMapping(value = "/all", method = RequestMethod.GET) | |
| 50 | - public Map<String, Object> list(@RequestParam Map<String, Object> param) { | |
| 51 | - List<T> tList = bService.list(param); | |
| 52 | - Map<String, Object> rtn = new HashMap<>(); | |
| 53 | - rtn.put("status", ResponseCode.SUCCESS); | |
| 54 | - rtn.put("data", tList); | |
| 55 | - return rtn; | |
| 56 | - } | |
| 57 | - @RequestMapping(method = RequestMethod.GET) | |
| 58 | - public Map<String, Object> list( | |
| 59 | - @RequestParam Map<String, Object> map, | |
| 60 | - @RequestParam(defaultValue = "0") int page, | |
| 61 | - @RequestParam(defaultValue = "10") int size, | |
| 62 | - @RequestParam(defaultValue = "id") String order, | |
| 63 | - @RequestParam(defaultValue = "DESC") String direction) { | |
| 64 | - // 允许多个字段排序,order可以写单个字段,也可以写多个字段 | |
| 65 | - // 多个字段格式:{col1},{col2},{col3},....,{coln} | |
| 66 | - List<String> order_columns = Splitter.on(",").trimResults().splitToList(order); | |
| 67 | - // 多字段排序:DESC,ASC... | |
| 68 | - List<String> order_dirs = Splitter.on(",").trimResults().splitToList(direction); | |
| 69 | - | |
| 70 | - Map<String, Object> rtn = new HashMap<>(); | |
| 71 | - | |
| 72 | - if (order_dirs.size() == 1) { // 所有字段采用一种排序 | |
| 73 | - rtn.put("status", ResponseCode.SUCCESS); | |
| 74 | - if (order_dirs.get(0).equals("ASC")) { | |
| 75 | - rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.ASC, order_columns)))); | |
| 76 | - } else { | |
| 77 | - rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.DESC, order_columns)))); | |
| 78 | - } | |
| 79 | - } else if (order_columns.size() == order_dirs.size()) { | |
| 80 | - List<Sort.Order> orderList = new ArrayList<>(); | |
| 81 | - for (int i = 0; i < order_columns.size(); i++) { | |
| 82 | - if (null != order_dirs.get(i) && order_dirs.get(i).equals("ASC")) { | |
| 83 | - orderList.add(new Sort.Order(Sort.Direction.ASC, order_columns.get(i))); | |
| 84 | - } else { | |
| 85 | - orderList.add(new Sort.Order(Sort.Direction.DESC, order_columns.get(i))); | |
| 86 | - } | |
| 87 | - } | |
| 88 | - rtn.put("status", ResponseCode.SUCCESS); | |
| 89 | - rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(orderList)))); | |
| 90 | - } else { | |
| 91 | - throw new RuntimeException("多字段排序参数格式问题,排序顺序和字段数不一致"); | |
| 92 | - } | |
| 93 | - | |
| 94 | - return rtn; | |
| 95 | - | |
| 96 | - } | |
| 97 | - | |
| 98 | - // Delete操作 | |
| 99 | - @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) | |
| 100 | - public Map<String, Object> delete(@PathVariable("id") ID id) { | |
| 101 | - Map<String, Object> rtn = new HashMap<>(); | |
| 102 | - try { | |
| 103 | - bService.delete(id); | |
| 104 | - rtn.put("status", ResponseCode.SUCCESS); | |
| 105 | - } catch (ScheduleException exp) { | |
| 106 | - rtn.put("status", ResponseCode.ERROR); | |
| 107 | - rtn.put("msg", exp.getMessage()); | |
| 108 | - } | |
| 109 | - | |
| 110 | - return rtn; | |
| 111 | - } | |
| 112 | - | |
| 113 | -} | |
| 1 | +package com.bsth.controller.schedule; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.service.schedule.BService; | |
| 5 | +import com.bsth.service.schedule.ScheduleException; | |
| 6 | +import com.google.common.base.Splitter; | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.data.domain.PageRequest; | |
| 9 | +import org.springframework.data.domain.Sort; | |
| 10 | +import org.springframework.web.bind.annotation.*; | |
| 11 | + | |
| 12 | +import java.io.Serializable; | |
| 13 | +import java.util.ArrayList; | |
| 14 | +import java.util.HashMap; | |
| 15 | +import java.util.List; | |
| 16 | +import java.util.Map; | |
| 17 | + | |
| 18 | +/** | |
| 19 | + * 基础控制器。 | |
| 20 | + */ | |
| 21 | +public class BController<T, ID extends Serializable> { | |
| 22 | + @Autowired | |
| 23 | + protected BService<T, ID> bService; | |
| 24 | + | |
| 25 | + // CRUD 操作 | |
| 26 | + // Create操作 | |
| 27 | + @RequestMapping(method = RequestMethod.POST) | |
| 28 | + public Map<String, Object> save(@RequestBody T t) { | |
| 29 | + T t_saved = bService.save(t); | |
| 30 | + Map<String, Object> rtn = new HashMap<>(); | |
| 31 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 32 | + rtn.put("data", t_saved); | |
| 33 | + return rtn; | |
| 34 | + } | |
| 35 | + // Update操作 | |
| 36 | + @RequestMapping(value="/{id}", method = RequestMethod.POST) | |
| 37 | + public Map<String, Object> update(@RequestBody T t) { | |
| 38 | + return save(t); | |
| 39 | + } | |
| 40 | + // Research操作 | |
| 41 | + @RequestMapping(value = "/{id}", method = RequestMethod.GET) | |
| 42 | + public Map<String, Object> findById(@PathVariable("id") ID id) { | |
| 43 | + T t = bService.findById(id); | |
| 44 | + Map<String, Object> rtn = new HashMap<>(); | |
| 45 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 46 | + rtn.put("data", t); | |
| 47 | + return rtn; | |
| 48 | + } | |
| 49 | + @RequestMapping(value = "/all", method = RequestMethod.GET) | |
| 50 | + public Map<String, Object> list(@RequestParam Map<String, Object> param) { | |
| 51 | + List<T> tList = bService.list(param); | |
| 52 | + Map<String, Object> rtn = new HashMap<>(); | |
| 53 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 54 | + rtn.put("data", tList); | |
| 55 | + return rtn; | |
| 56 | + } | |
| 57 | + @RequestMapping(method = RequestMethod.GET) | |
| 58 | + public Map<String, Object> list( | |
| 59 | + @RequestParam Map<String, Object> map, | |
| 60 | + @RequestParam(defaultValue = "0") int page, | |
| 61 | + @RequestParam(defaultValue = "10") int size, | |
| 62 | + @RequestParam(defaultValue = "id") String order, | |
| 63 | + @RequestParam(defaultValue = "DESC") String direction) { | |
| 64 | + // 允许多个字段排序,order可以写单个字段,也可以写多个字段 | |
| 65 | + // 多个字段格式:{col1},{col2},{col3},....,{coln} | |
| 66 | + List<String> order_columns = Splitter.on(",").trimResults().splitToList(order); | |
| 67 | + // 多字段排序:DESC,ASC... | |
| 68 | + List<String> order_dirs = Splitter.on(",").trimResults().splitToList(direction); | |
| 69 | + | |
| 70 | + Map<String, Object> rtn = new HashMap<>(); | |
| 71 | + | |
| 72 | + if (order_dirs.size() == 1) { // 所有字段采用一种排序 | |
| 73 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 74 | + if (order_dirs.get(0).equals("ASC")) { | |
| 75 | + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.ASC, order_columns)))); | |
| 76 | + } else { | |
| 77 | + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.DESC, order_columns)))); | |
| 78 | + } | |
| 79 | + } else if (order_columns.size() == order_dirs.size()) { | |
| 80 | + List<Sort.Order> orderList = new ArrayList<>(); | |
| 81 | + for (int i = 0; i < order_columns.size(); i++) { | |
| 82 | + if (null != order_dirs.get(i) && order_dirs.get(i).equals("ASC")) { | |
| 83 | + orderList.add(new Sort.Order(Sort.Direction.ASC, order_columns.get(i))); | |
| 84 | + } else { | |
| 85 | + orderList.add(new Sort.Order(Sort.Direction.DESC, order_columns.get(i))); | |
| 86 | + } | |
| 87 | + } | |
| 88 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 89 | + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(orderList)))); | |
| 90 | + } else { | |
| 91 | + throw new RuntimeException("多字段排序参数格式问题,排序顺序和字段数不一致"); | |
| 92 | + } | |
| 93 | + | |
| 94 | + return rtn; | |
| 95 | + | |
| 96 | + } | |
| 97 | + | |
| 98 | + // Delete操作 | |
| 99 | + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) | |
| 100 | + public Map<String, Object> delete(@PathVariable("id") ID id) { | |
| 101 | + Map<String, Object> rtn = new HashMap<>(); | |
| 102 | + try { | |
| 103 | + bService.delete(id); | |
| 104 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 105 | + } catch (ScheduleException exp) { | |
| 106 | + rtn.put("status", ResponseCode.ERROR); | |
| 107 | + rtn.put("msg", exp.getMessage()); | |
| 108 | + } | |
| 109 | + | |
| 110 | + return rtn; | |
| 111 | + } | |
| 112 | + | |
| 113 | +} | ... | ... |
src/main/java/com/bsth/controller/schedule/CarConfigInfoController.java deleted
100644 → 0
| 1 | -package com.bsth.controller.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.controller.BaseController; | |
| 4 | -import com.bsth.entity.schedule.CarConfigInfo; | |
| 5 | -import com.bsth.repository.schedule.CarConfigInfoRepository; | |
| 6 | -import com.bsth.service.schedule.utils.DataToolsProperties; | |
| 7 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
| 9 | -import org.springframework.web.bind.annotation.*; | |
| 10 | - | |
| 11 | -import java.util.List; | |
| 12 | -import java.util.Map; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * Created by xu on 16/5/9. | |
| 16 | - */ | |
| 17 | -@RestController | |
| 18 | -@RequestMapping("cci") | |
| 19 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 20 | -public class CarConfigInfoController extends BaseController<CarConfigInfo, Long> { | |
| 21 | - @Autowired | |
| 22 | - private DataToolsProperties dataToolsProperties; | |
| 23 | - @Autowired | |
| 24 | - private CarConfigInfoRepository carConfigInfoRepository; | |
| 25 | - | |
| 26 | - @Override | |
| 27 | - protected String getDataImportKtrClasspath() { | |
| 28 | - return dataToolsProperties.getCarsconfigDatainputktr(); | |
| 29 | - } | |
| 30 | - | |
| 31 | - @Override | |
| 32 | - public CarConfigInfo findById(@PathVariable("id") Long aLong) { | |
| 33 | - return carConfigInfoRepository.findOneExtend(aLong); | |
| 34 | - } | |
| 35 | - | |
| 36 | - /** | |
| 37 | - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody | |
| 38 | - * @Title: save | |
| 39 | - * @Description: TODO(持久化对象) | |
| 40 | - * @param @param t | |
| 41 | - * @param @return 设定文件 | |
| 42 | - * @return Map<String,Object> {status: 1(成功),-1(失败)} | |
| 43 | - * @throws | |
| 44 | - */ | |
| 45 | - @RequestMapping(method = RequestMethod.POST) | |
| 46 | - public Map<String, Object> save(@RequestBody CarConfigInfo t){ | |
| 47 | - return baseService.save(t); | |
| 48 | - } | |
| 49 | - | |
| 50 | - @RequestMapping(value = "/cars", method = RequestMethod.GET) | |
| 51 | - public List<Map<String, Object>> findCarConfigCars() { | |
| 52 | - return carConfigInfoRepository.findCarConfigCars(); | |
| 53 | - } | |
| 54 | - | |
| 55 | - @RequestMapping(value = "/cars2", method = RequestMethod.GET) | |
| 56 | - public List<Map<String, Object>> findCarsFromConfig() { | |
| 57 | - return carConfigInfoRepository.findCarsFromConfig(); | |
| 58 | - } | |
| 59 | -} |
src/main/java/com/bsth/controller/schedule/EmployeeConfigInfoController.java deleted
100644 → 0
| 1 | -package com.bsth.controller.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.controller.BaseController; | |
| 4 | -import com.bsth.entity.schedule.EmployeeConfigInfo; | |
| 5 | -import com.bsth.repository.schedule.EmployeeConfigInfoRepository; | |
| 6 | -import com.bsth.service.schedule.utils.DataToolsProperties; | |
| 7 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | -import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
| 9 | -import org.springframework.web.bind.annotation.*; | |
| 10 | - | |
| 11 | -import java.util.List; | |
| 12 | -import java.util.Map; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * Created by xu on 16/5/10. | |
| 16 | - */ | |
| 17 | -@RestController | |
| 18 | -@RequestMapping("eci") | |
| 19 | -@EnableConfigurationProperties(DataToolsProperties.class) | |
| 20 | -public class EmployeeConfigInfoController extends BaseController<EmployeeConfigInfo, Long> { | |
| 21 | - @Autowired | |
| 22 | - private DataToolsProperties dataToolsProperties; | |
| 23 | - @Autowired | |
| 24 | - private EmployeeConfigInfoRepository employeeConfigInfoRepository; | |
| 25 | - | |
| 26 | - @Override | |
| 27 | - protected String getDataImportKtrClasspath() { | |
| 28 | - return dataToolsProperties.getEmployeesconfigDatainputktr(); | |
| 29 | - } | |
| 30 | - | |
| 31 | - @Override | |
| 32 | - public EmployeeConfigInfo findById(@PathVariable("id") Long aLong) { | |
| 33 | - return employeeConfigInfoRepository.findOneExtend(aLong); | |
| 34 | - } | |
| 35 | - | |
| 36 | - /** | |
| 37 | - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody | |
| 38 | - * @Title: save | |
| 39 | - * @Description: TODO(持久化对象) | |
| 40 | - * @param @param t | |
| 41 | - * @param @return 设定文件 | |
| 42 | - * @return Map<String,Object> {status: 1(成功),-1(失败)} | |
| 43 | - * @throws | |
| 44 | - */ | |
| 45 | - @RequestMapping(method = RequestMethod.POST) | |
| 46 | - public Map<String, Object> save(@RequestBody EmployeeConfigInfo t){ | |
| 47 | - return baseService.save(t); | |
| 48 | - } | |
| 49 | - | |
| 50 | - @RequestMapping(value = "/jsy", method = RequestMethod.GET) | |
| 51 | - public List<Map<String, Object>> findJsyFromConfig() { | |
| 52 | - return employeeConfigInfoRepository.findJsyFromConfig(); | |
| 53 | - } | |
| 54 | - | |
| 55 | - @RequestMapping(value = "/spy", method = RequestMethod.GET) | |
| 56 | - public List<Map<String, Object>> findSpyFromConfig() { | |
| 57 | - return employeeConfigInfoRepository.findSpyFromConfig(); | |
| 58 | - } | |
| 59 | -} |
src/main/java/com/bsth/controller/schedule/basicinfo/CarsController.java
| 1 | -package com.bsth.controller.schedule.basicinfo; | |
| 2 | - | |
| 3 | -import com.bsth.common.ResponseCode; | |
| 4 | -import com.bsth.controller.schedule.BController; | |
| 5 | -import com.bsth.entity.Cars; | |
| 6 | -import com.bsth.service.schedule.CarsService; | |
| 7 | -import com.bsth.service.schedule.ScheduleException; | |
| 8 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 10 | -import org.springframework.web.bind.annotation.RequestMethod; | |
| 11 | -import org.springframework.web.bind.annotation.RequestParam; | |
| 12 | -import org.springframework.web.bind.annotation.RestController; | |
| 13 | - | |
| 14 | -import java.util.HashMap; | |
| 15 | -import java.util.Map; | |
| 16 | - | |
| 17 | -/** | |
| 18 | - * 车辆基础信息controller | |
| 19 | - */ | |
| 20 | -@RestController(value = "carsController_sc") | |
| 21 | -@RequestMapping("cars_sc") | |
| 22 | -public class CarsController extends BController<Cars, Integer> { | |
| 23 | - @Autowired | |
| 24 | - private CarsService carsService; | |
| 25 | - | |
| 26 | - @RequestMapping(value = "/validate_zbh", method = RequestMethod.GET) | |
| 27 | - public Map<String, Object> validate_zbh(@RequestParam Map<String, Object> param) { | |
| 28 | - Map<String, Object> rtn = new HashMap<>(); | |
| 29 | - try { | |
| 30 | - // 自编号验证 | |
| 31 | - Cars cars = new Cars( | |
| 32 | - param.get("id_eq"), | |
| 33 | - param.get("insideCode_eq"), | |
| 34 | - null, | |
| 35 | - null, | |
| 36 | - null); | |
| 37 | - carsService.validate_nbbh(cars); | |
| 38 | - rtn.put("status", ResponseCode.SUCCESS); | |
| 39 | - } catch (ScheduleException exp) { | |
| 40 | - rtn.put("status", ResponseCode.ERROR); | |
| 41 | - rtn.put("msg", exp.getMessage()); | |
| 42 | - } | |
| 43 | - return rtn; | |
| 44 | - } | |
| 45 | - | |
| 46 | - @RequestMapping(value = "/validate_clbh", method = RequestMethod.GET) | |
| 47 | - public Map<String, Object> validate_clbh(@RequestParam Map<String, Object> param) { | |
| 48 | - Map<String, Object> rtn = new HashMap<>(); | |
| 49 | - try { | |
| 50 | - // 车辆编号验证 | |
| 51 | - Cars cars = new Cars( | |
| 52 | - param.get("id_eq"), | |
| 53 | - null, | |
| 54 | - param.get("carCode_eq"), | |
| 55 | - null, | |
| 56 | - null); | |
| 57 | - carsService.validate_clbh(cars); | |
| 58 | - rtn.put("status", ResponseCode.SUCCESS); | |
| 59 | - } catch (ScheduleException exp) { | |
| 60 | - rtn.put("status", ResponseCode.ERROR); | |
| 61 | - rtn.put("msg", exp.getMessage()); | |
| 62 | - } | |
| 63 | - return rtn; | |
| 64 | - } | |
| 65 | - | |
| 66 | - @RequestMapping(value = "/validate_cph", method = RequestMethod.GET) | |
| 67 | - public Map<String, Object> validate_cph(@RequestParam Map<String, Object> param) { | |
| 68 | - Map<String, Object> rtn = new HashMap<>(); | |
| 69 | - try { | |
| 70 | - // 车牌号验证 | |
| 71 | - Cars cars = new Cars( | |
| 72 | - param.get("id_eq"), | |
| 73 | - null, | |
| 74 | - null, | |
| 75 | - param.get("carPlate_eq"), | |
| 76 | - null); | |
| 77 | - carsService.validate_cph(cars); | |
| 78 | - rtn.put("status", ResponseCode.SUCCESS); | |
| 79 | - } catch (ScheduleException exp) { | |
| 80 | - rtn.put("status", ResponseCode.ERROR); | |
| 81 | - rtn.put("msg", exp.getMessage()); | |
| 82 | - } | |
| 83 | - return rtn; | |
| 84 | - } | |
| 85 | - | |
| 86 | - @RequestMapping(value = "/validate_sbbh", method = RequestMethod.GET) | |
| 87 | - public Map<String, Object> validate_sbbh(@RequestParam Map<String, Object> param) { | |
| 88 | - Map<String, Object> rtn = new HashMap<>(); | |
| 89 | - try { | |
| 90 | - // 设备编号验证 | |
| 91 | - Cars cars = new Cars( | |
| 92 | - param.get("id_eq"), | |
| 93 | - null, | |
| 94 | - null, | |
| 95 | - null, | |
| 96 | - param.get("equipmentCode_eq") | |
| 97 | - ); | |
| 98 | - carsService.validate_sbbh(cars); | |
| 99 | - rtn.put("status", ResponseCode.SUCCESS); | |
| 100 | - } catch (ScheduleException exp) { | |
| 101 | - rtn.put("status", ResponseCode.ERROR); | |
| 102 | - rtn.put("msg", exp.getMessage()); | |
| 103 | - } | |
| 104 | - return rtn; | |
| 105 | - } | |
| 106 | -} | |
| 1 | +package com.bsth.controller.schedule.basicinfo; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.controller.schedule.BController; | |
| 5 | +import com.bsth.entity.Cars; | |
| 6 | +import com.bsth.service.schedule.CarsService; | |
| 7 | +import com.bsth.service.schedule.ScheduleException; | |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 11 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 12 | +import org.springframework.web.bind.annotation.RestController; | |
| 13 | + | |
| 14 | +import java.util.HashMap; | |
| 15 | +import java.util.Map; | |
| 16 | + | |
| 17 | +/** | |
| 18 | + * 车辆基础信息controller | |
| 19 | + */ | |
| 20 | +@RestController(value = "carsController_sc") | |
| 21 | +@RequestMapping("cars_sc") | |
| 22 | +public class CarsController extends BController<Cars, Integer> { | |
| 23 | + @Autowired | |
| 24 | + private CarsService carsService; | |
| 25 | + | |
| 26 | + @RequestMapping(value = "/validate_zbh", method = RequestMethod.GET) | |
| 27 | + public Map<String, Object> validate_zbh(@RequestParam Map<String, Object> param) { | |
| 28 | + Map<String, Object> rtn = new HashMap<>(); | |
| 29 | + try { | |
| 30 | + // 自编号验证 | |
| 31 | + Cars cars = new Cars( | |
| 32 | + param.get("id_eq"), | |
| 33 | + param.get("insideCode_eq"), | |
| 34 | + null, | |
| 35 | + null, | |
| 36 | + null); | |
| 37 | + carsService.validate_nbbh(cars); | |
| 38 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 39 | + } catch (ScheduleException exp) { | |
| 40 | + rtn.put("status", ResponseCode.ERROR); | |
| 41 | + rtn.put("msg", exp.getMessage()); | |
| 42 | + } | |
| 43 | + return rtn; | |
| 44 | + } | |
| 45 | + | |
| 46 | + @RequestMapping(value = "/validate_clbh", method = RequestMethod.GET) | |
| 47 | + public Map<String, Object> validate_clbh(@RequestParam Map<String, Object> param) { | |
| 48 | + Map<String, Object> rtn = new HashMap<>(); | |
| 49 | + try { | |
| 50 | + // 车辆编号验证 | |
| 51 | + Cars cars = new Cars( | |
| 52 | + param.get("id_eq"), | |
| 53 | + null, | |
| 54 | + param.get("carCode_eq"), | |
| 55 | + null, | |
| 56 | + null); | |
| 57 | + carsService.validate_clbh(cars); | |
| 58 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 59 | + } catch (ScheduleException exp) { | |
| 60 | + rtn.put("status", ResponseCode.ERROR); | |
| 61 | + rtn.put("msg", exp.getMessage()); | |
| 62 | + } | |
| 63 | + return rtn; | |
| 64 | + } | |
| 65 | + | |
| 66 | + @RequestMapping(value = "/validate_cph", method = RequestMethod.GET) | |
| 67 | + public Map<String, Object> validate_cph(@RequestParam Map<String, Object> param) { | |
| 68 | + Map<String, Object> rtn = new HashMap<>(); | |
| 69 | + try { | |
| 70 | + // 车牌号验证 | |
| 71 | + Cars cars = new Cars( | |
| 72 | + param.get("id_eq"), | |
| 73 | + null, | |
| 74 | + null, | |
| 75 | + param.get("carPlate_eq"), | |
| 76 | + null); | |
| 77 | + carsService.validate_cph(cars); | |
| 78 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 79 | + } catch (ScheduleException exp) { | |
| 80 | + rtn.put("status", ResponseCode.ERROR); | |
| 81 | + rtn.put("msg", exp.getMessage()); | |
| 82 | + } | |
| 83 | + return rtn; | |
| 84 | + } | |
| 85 | + | |
| 86 | + @RequestMapping(value = "/validate_sbbh", method = RequestMethod.GET) | |
| 87 | + public Map<String, Object> validate_sbbh(@RequestParam Map<String, Object> param) { | |
| 88 | + Map<String, Object> rtn = new HashMap<>(); | |
| 89 | + try { | |
| 90 | + // 设备编号验证 | |
| 91 | + Cars cars = new Cars( | |
| 92 | + param.get("id_eq"), | |
| 93 | + null, | |
| 94 | + null, | |
| 95 | + null, | |
| 96 | + param.get("equipmentCode_eq") | |
| 97 | + ); | |
| 98 | + carsService.validate_sbbh(cars); | |
| 99 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 100 | + } catch (ScheduleException exp) { | |
| 101 | + rtn.put("status", ResponseCode.ERROR); | |
| 102 | + rtn.put("msg", exp.getMessage()); | |
| 103 | + } | |
| 104 | + return rtn; | |
| 105 | + } | |
| 106 | +} | ... | ... |
src/main/java/com/bsth/controller/schedule/core/CarConfigInfoController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.core; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.controller.schedule.BController; | |
| 5 | +import com.bsth.entity.schedule.CarConfigInfo; | |
| 6 | +import com.bsth.repository.schedule.CarConfigInfoRepository; | |
| 7 | +import com.bsth.service.schedule.CarConfigInfoService; | |
| 8 | +import com.bsth.service.schedule.ScheduleException; | |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 13 | +import org.springframework.web.bind.annotation.RestController; | |
| 14 | + | |
| 15 | +import java.util.HashMap; | |
| 16 | +import java.util.List; | |
| 17 | +import java.util.Map; | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * Created by xu on 16/5/9. | |
| 21 | + */ | |
| 22 | +@RestController | |
| 23 | +@RequestMapping("cci") | |
| 24 | +public class CarConfigInfoController extends BController<CarConfigInfo, Long> { | |
| 25 | + @Autowired | |
| 26 | + private CarConfigInfoRepository carConfigInfoRepository; | |
| 27 | + @Autowired | |
| 28 | + private CarConfigInfoService carConfigInfoService; | |
| 29 | + | |
| 30 | + | |
| 31 | + @RequestMapping(value = "/cars", method = RequestMethod.GET) | |
| 32 | + public List<Map<String, Object>> findCarConfigCars() { | |
| 33 | + return carConfigInfoRepository.findCarConfigCars(); | |
| 34 | + } | |
| 35 | + | |
| 36 | + @RequestMapping(value = "/cars2", method = RequestMethod.GET) | |
| 37 | + public List<Map<String, Object>> findCarsFromConfig() { | |
| 38 | + return carConfigInfoRepository.findCarsFromConfig(); | |
| 39 | + } | |
| 40 | + | |
| 41 | + @RequestMapping(value = "/validate_cars", method = RequestMethod.GET) | |
| 42 | + public Map<String, Object> validate_cars(@RequestParam Map<String, Object> param) { | |
| 43 | + Map<String, Object> rtn = new HashMap<>(); | |
| 44 | + try { | |
| 45 | + // 车辆重复配置验证 | |
| 46 | + CarConfigInfo carConfigInfo = new CarConfigInfo( | |
| 47 | + param.get("id_eq"), | |
| 48 | + param.get("xl.id_eq"), | |
| 49 | + param.get("xl.name_eq"), | |
| 50 | + param.get("cl.id_eq") | |
| 51 | + ); | |
| 52 | + carConfigInfoService.validate_cars(carConfigInfo); | |
| 53 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 54 | + } catch (ScheduleException exp) { | |
| 55 | + rtn.put("status", ResponseCode.ERROR); | |
| 56 | + rtn.put("msg", exp.getMessage()); | |
| 57 | + } | |
| 58 | + | |
| 59 | + return rtn; | |
| 60 | + } | |
| 61 | +} | ... | ... |
src/main/java/com/bsth/controller/schedule/core/EmployeeConfigInfoController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule.core; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.controller.schedule.BController; | |
| 5 | +import com.bsth.entity.schedule.EmployeeConfigInfo; | |
| 6 | +import com.bsth.repository.schedule.EmployeeConfigInfoRepository; | |
| 7 | +import com.bsth.service.schedule.EmployeeConfigInfoService; | |
| 8 | +import com.bsth.service.schedule.ScheduleException; | |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 13 | +import org.springframework.web.bind.annotation.RestController; | |
| 14 | + | |
| 15 | +import java.util.HashMap; | |
| 16 | +import java.util.List; | |
| 17 | +import java.util.Map; | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * Created by xu on 16/5/10. | |
| 21 | + */ | |
| 22 | +@RestController | |
| 23 | +@RequestMapping("eci") | |
| 24 | +public class EmployeeConfigInfoController extends BController<EmployeeConfigInfo, Long> { | |
| 25 | + @Autowired | |
| 26 | + private EmployeeConfigInfoRepository employeeConfigInfoRepository; | |
| 27 | + @Autowired | |
| 28 | + private EmployeeConfigInfoService employeeConfigInfoService; | |
| 29 | + | |
| 30 | + @RequestMapping(value = "/jsy", method = RequestMethod.GET) | |
| 31 | + public List<Map<String, Object>> findJsyFromConfig() { | |
| 32 | + return employeeConfigInfoRepository.findJsyFromConfig(); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @RequestMapping(value = "/spy", method = RequestMethod.GET) | |
| 36 | + public List<Map<String, Object>> findSpyFromConfig() { | |
| 37 | + return employeeConfigInfoRepository.findSpyFromConfig(); | |
| 38 | + } | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + @RequestMapping(value = "/validate_jsy", method = RequestMethod.GET) | |
| 43 | + public Map<String, Object> validate_jsy(@RequestParam Map<String, Object> param) { | |
| 44 | + Map<String, Object> rtn = new HashMap<>(); | |
| 45 | + try { | |
| 46 | + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo( | |
| 47 | + param.get("id_eq"), | |
| 48 | + param.get("xl.id_eq"), | |
| 49 | + param.get("xl.name_eq"), | |
| 50 | + param.get("jsy.id_eq"), | |
| 51 | + null | |
| 52 | + ); | |
| 53 | + employeeConfigInfoService.validate_jsy(employeeConfigInfo); | |
| 54 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 55 | + } catch (ScheduleException exp) { | |
| 56 | + rtn.put("status", ResponseCode.ERROR); | |
| 57 | + rtn.put("msg", exp.getMessage()); | |
| 58 | + } | |
| 59 | + | |
| 60 | + return rtn; | |
| 61 | + } | |
| 62 | + | |
| 63 | + @RequestMapping(value = "/validate_spy", method = RequestMethod.GET) | |
| 64 | + public Map<String, Object> validate_spy(@RequestParam Map<String, Object> param) { | |
| 65 | + Map<String, Object> rtn = new HashMap<>(); | |
| 66 | + try { | |
| 67 | + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo( | |
| 68 | + param.get("id_eq"), | |
| 69 | + param.get("xl.id_eq"), | |
| 70 | + param.get("xl.name_eq"), | |
| 71 | + null, | |
| 72 | + param.get("spy.id_eq") | |
| 73 | + ); | |
| 74 | + employeeConfigInfoService.validate_spy(employeeConfigInfo); | |
| 75 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 76 | + } catch (ScheduleException exp) { | |
| 77 | + rtn.put("status", ResponseCode.ERROR); | |
| 78 | + rtn.put("msg", exp.getMessage()); | |
| 79 | + } | |
| 80 | + return rtn; | |
| 81 | + } | |
| 82 | +} | ... | ... |
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java
| ... | ... | @@ -54,6 +54,7 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> |
| 54 | 54 | try { |
| 55 | 55 | // 路牌编号验证 |
| 56 | 56 | GuideboardInfo guideboardInfo = new GuideboardInfo( |
| 57 | + param.get("id_eq"), | |
| 57 | 58 | param.get("xl.id_eq"), |
| 58 | 59 | param.get("lpNo_eq"), |
| 59 | 60 | null |
| ... | ... | @@ -73,6 +74,7 @@ public class GuideboardInfoController extends BController<GuideboardInfo, Long> |
| 73 | 74 | try { |
| 74 | 75 | // 路牌名称验证 |
| 75 | 76 | GuideboardInfo guideboardInfo = new GuideboardInfo( |
| 77 | + param.get("id_eq"), | |
| 76 | 78 | param.get("xl.id_eq"), |
| 77 | 79 | null, |
| 78 | 80 | param.get("lpName_eq") | ... | ... |
src/main/java/com/bsth/entity/Personnel.java
| 1 | 1 | package com.bsth.entity; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.sys.SysUser; |
| 4 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 4 | 5 | |
| 5 | 6 | import javax.persistence.*; |
| 6 | 7 | import java.util.Date; |
| ... | ... | @@ -21,6 +22,7 @@ import java.util.Date; |
| 21 | 22 | |
| 22 | 23 | @Entity |
| 23 | 24 | @Table(name = "bsth_c_personnel") |
| 25 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 24 | 26 | public class Personnel { |
| 25 | 27 | |
| 26 | 28 | /** 主键Id */ | ... | ... |
src/main/java/com/bsth/entity/schedule/CarConfigInfo.java
| ... | ... | @@ -3,6 +3,7 @@ package com.bsth.entity.schedule; |
| 3 | 3 | import com.bsth.entity.Cars; |
| 4 | 4 | import com.bsth.entity.Line; |
| 5 | 5 | import com.bsth.entity.sys.SysUser; |
| 6 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 6 | 7 | |
| 7 | 8 | import javax.persistence.*; |
| 8 | 9 | import java.io.Serializable; |
| ... | ... | @@ -19,6 +20,7 @@ import java.util.Date; |
| 19 | 20 | @NamedAttributeNode("cl") |
| 20 | 21 | }) |
| 21 | 22 | }) |
| 23 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 22 | 24 | public class CarConfigInfo implements Serializable { |
| 23 | 25 | |
| 24 | 26 | /** 主健Id */ |
| ... | ... | @@ -71,6 +73,25 @@ public class CarConfigInfo implements Serializable { |
| 71 | 73 | @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") |
| 72 | 74 | private Date updateDate; |
| 73 | 75 | |
| 76 | + public CarConfigInfo() {} | |
| 77 | + public CarConfigInfo(Object id, Object xlid, Object xlname, Object clid) { | |
| 78 | + if (id != null) { | |
| 79 | + this.id = Long.parseLong(id.toString()); | |
| 80 | + } | |
| 81 | + if (xlid != null && xlname != null) { | |
| 82 | + Line line = new Line(); | |
| 83 | + line.setId(Integer.valueOf(xlid.toString())); | |
| 84 | + line.setName(xlname.toString()); | |
| 85 | + this.xl = line; | |
| 86 | + } | |
| 87 | + if (clid != null) { | |
| 88 | + Cars cars = new Cars(); | |
| 89 | + cars.setId(Integer.valueOf(clid.toString())); | |
| 90 | + this.cl = cars; | |
| 91 | + } | |
| 92 | + | |
| 93 | + } | |
| 94 | + | |
| 74 | 95 | public Long getId() { |
| 75 | 96 | return id; |
| 76 | 97 | } | ... | ... |
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
| ... | ... | @@ -4,6 +4,7 @@ import com.bsth.entity.Cars; |
| 4 | 4 | import com.bsth.entity.Line; |
| 5 | 5 | import com.bsth.entity.Personnel; |
| 6 | 6 | import com.bsth.entity.sys.SysUser; |
| 7 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 7 | 8 | import org.hibernate.annotations.Formula; |
| 8 | 9 | |
| 9 | 10 | import javax.persistence.*; |
| ... | ... | @@ -22,6 +23,7 @@ import java.util.Date; |
| 22 | 23 | @NamedAttributeNode("xl") |
| 23 | 24 | }) |
| 24 | 25 | }) |
| 26 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 25 | 27 | public class EmployeeConfigInfo { |
| 26 | 28 | |
| 27 | 29 | /** 主键Id */ |
| ... | ... | @@ -67,6 +69,30 @@ public class EmployeeConfigInfo { |
| 67 | 69 | @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") |
| 68 | 70 | private Date updateDate; |
| 69 | 71 | |
| 72 | + public EmployeeConfigInfo() {} | |
| 73 | + | |
| 74 | + public EmployeeConfigInfo(Object id, Object xlid, Object xlname, Object jsyid, Object spyid) { | |
| 75 | + if (id != null) { | |
| 76 | + this.id = Long.parseLong(id.toString()); | |
| 77 | + } | |
| 78 | + if (xlid != null && xlname != null) { | |
| 79 | + Line line = new Line(); | |
| 80 | + line.setId(Integer.valueOf(xlid.toString())); | |
| 81 | + line.setName(xlname.toString()); | |
| 82 | + this.xl = line; | |
| 83 | + } | |
| 84 | + if (jsyid != null) { | |
| 85 | + Personnel personnel = new Personnel(); | |
| 86 | + personnel.setId(Integer.valueOf(jsyid.toString())); | |
| 87 | + this.jsy = personnel; | |
| 88 | + } | |
| 89 | + if (spyid != null) { | |
| 90 | + Personnel personnel = new Personnel(); | |
| 91 | + personnel.setId(Integer.valueOf(spyid.toString())); | |
| 92 | + this.spy = personnel; | |
| 93 | + } | |
| 94 | + } | |
| 95 | + | |
| 70 | 96 | public Long getId() { |
| 71 | 97 | return id; |
| 72 | 98 | } | ... | ... |
src/main/java/com/bsth/entity/schedule/GuideboardInfo.java
| ... | ... | @@ -60,7 +60,11 @@ public class GuideboardInfo { |
| 60 | 60 | |
| 61 | 61 | public GuideboardInfo() {} |
| 62 | 62 | |
| 63 | - public GuideboardInfo(Object xlid, Object lpNo, Object lpName) { | |
| 63 | + public GuideboardInfo(Object id, Object xlid, Object lpNo, Object lpName) { | |
| 64 | + if (id != null) { | |
| 65 | + this.id = Long.parseLong(id.toString()); | |
| 66 | + } | |
| 67 | + | |
| 64 | 68 | Integer xlid_ = xlid == null ? null : Integer.valueOf(xlid.toString()); |
| 65 | 69 | Integer lpNo_ = lpNo == null ? null : Integer.valueOf(lpNo.toString()); |
| 66 | 70 | String lpName_ = lpName == null ? null : String.valueOf(lpName); |
| ... | ... | @@ -75,11 +79,11 @@ public class GuideboardInfo { |
| 75 | 79 | this.lpName = lpName_; |
| 76 | 80 | } |
| 77 | 81 | |
| 78 | - public GuideboardInfo(Integer xlid, Integer lpNo) { | |
| 79 | - this(xlid, lpNo, null); | |
| 82 | + public GuideboardInfo(Object id, Integer xlid, Integer lpNo) { | |
| 83 | + this(id, xlid, lpNo, null); | |
| 80 | 84 | } |
| 81 | - public GuideboardInfo(Integer xlid, String lpName) { | |
| 82 | - this(xlid, null, lpName); | |
| 85 | + public GuideboardInfo(Object id, Integer xlid, String lpName) { | |
| 86 | + this(id, xlid, null, lpName); | |
| 83 | 87 | } |
| 84 | 88 | |
| 85 | 89 | public Long getId() { | ... | ... |
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
| ... | ... | @@ -163,8 +163,10 @@ public class SchedulePlanInfo { |
| 163 | 163 | |
| 164 | 164 | // TODO:关联的公司名称 |
| 165 | 165 | // TODO:关联的公司编码 |
| 166 | + this.gsBm = xl.getCompany(); | |
| 166 | 167 | // TODO:关联的分公司名称 |
| 167 | 168 | // TODO:关联的分公司编码 |
| 169 | + this.fgsBm = xl.getBrancheCompany(); | |
| 168 | 170 | // TODO:关联的出场顺序号 |
| 169 | 171 | |
| 170 | 172 | // 关联的排班计划 | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
| ... | ... | @@ -52,14 +52,14 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 52 | 52 | // TODO Auto-generated catch block |
| 53 | 53 | e.printStackTrace(); |
| 54 | 54 | } |
| 55 | - /*if(map.get("gsdm_in")!=null){ | |
| 55 | + if(map.get("gsdm_in")!=null){ | |
| 56 | 56 | map.put("ssgsdm_in", map.get("gsdm_in")); |
| 57 | 57 | map.remove("gsdm_in"); |
| 58 | 58 | |
| 59 | 59 | }else{ |
| 60 | 60 | map.put("ssgsdm_like", map.get("gsdm_like")); |
| 61 | 61 | map.remove("gsdm_like"); |
| 62 | - }*/ | |
| 62 | + } | |
| 63 | 63 | |
| 64 | 64 | //根具条件查询指定日期Ylb的数据 |
| 65 | 65 | List<Ylb> ylbIterator=(List<Ylb>) ylbRepository.findAll(new CustomerSpecs<Ylb>(map)); | ... | ... |
src/main/java/com/bsth/service/realcontrol/dto/SectionRouteCoords.java
| 1 | -package com.bsth.service.realcontrol.dto; | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * 线调地图 路段路由DTO | |
| 5 | - * Created by panzhao on 2016/12/1. | |
| 6 | - */ | |
| 7 | -public class SectionRouteCoords { | |
| 8 | - | |
| 9 | - private int id; | |
| 10 | - | |
| 11 | - private String lineCode; | |
| 12 | - | |
| 13 | - private String sectionCode; | |
| 14 | - | |
| 15 | - private String sectionrouteCode; | |
| 16 | - | |
| 17 | - private int directions; | |
| 18 | - | |
| 19 | - private String sectionName; | |
| 20 | - | |
| 21 | - private String gsectionVector; | |
| 22 | - | |
| 23 | - private Float sectionDistance; | |
| 24 | - | |
| 25 | - private Float sectionTime; | |
| 26 | - | |
| 27 | - public int getId() { | |
| 28 | - return id; | |
| 29 | - } | |
| 30 | - | |
| 31 | - public void setId(int id) { | |
| 32 | - this.id = id; | |
| 33 | - } | |
| 34 | - | |
| 35 | - public String getLineCode() { | |
| 36 | - return lineCode; | |
| 37 | - } | |
| 38 | - | |
| 39 | - public void setLineCode(String lineCode) { | |
| 40 | - this.lineCode = lineCode; | |
| 41 | - } | |
| 42 | - | |
| 43 | - public String getSectionCode() { | |
| 44 | - return sectionCode; | |
| 45 | - } | |
| 46 | - | |
| 47 | - public void setSectionCode(String sectionCode) { | |
| 48 | - this.sectionCode = sectionCode; | |
| 49 | - } | |
| 50 | - | |
| 51 | - public String getSectionrouteCode() { | |
| 52 | - return sectionrouteCode; | |
| 53 | - } | |
| 54 | - | |
| 55 | - public void setSectionrouteCode(String sectionrouteCode) { | |
| 56 | - this.sectionrouteCode = sectionrouteCode; | |
| 57 | - } | |
| 58 | - | |
| 59 | - public int getDirections() { | |
| 60 | - return directions; | |
| 61 | - } | |
| 62 | - | |
| 63 | - public void setDirections(int directions) { | |
| 64 | - this.directions = directions; | |
| 65 | - } | |
| 66 | - | |
| 67 | - public String getSectionName() { | |
| 68 | - return sectionName; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public void setSectionName(String sectionName) { | |
| 72 | - this.sectionName = sectionName; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public String getGsectionVector() { | |
| 76 | - return gsectionVector; | |
| 77 | - } | |
| 78 | - | |
| 79 | - public void setGsectionVector(String gsectionVector) { | |
| 80 | - this.gsectionVector = gsectionVector; | |
| 81 | - } | |
| 82 | - | |
| 83 | - public Float getSectionDistance() { | |
| 84 | - return sectionDistance; | |
| 85 | - } | |
| 86 | - | |
| 87 | - public void setSectionDistance(Float sectionDistance) { | |
| 88 | - this.sectionDistance = sectionDistance; | |
| 89 | - } | |
| 90 | - | |
| 91 | - public Float getSectionTime() { | |
| 92 | - return sectionTime; | |
| 93 | - } | |
| 94 | - | |
| 95 | - public void setSectionTime(Float sectionTime) { | |
| 96 | - this.sectionTime = sectionTime; | |
| 97 | - } | |
| 98 | -} | |
| 1 | +package com.bsth.service.realcontrol.dto; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 线调地图 路段路由DTO | |
| 5 | + * Created by panzhao on 2016/12/1. | |
| 6 | + */ | |
| 7 | +public class SectionRouteCoords { | |
| 8 | + | |
| 9 | + private int id; | |
| 10 | + | |
| 11 | + private String lineCode; | |
| 12 | + | |
| 13 | + private String sectionCode; | |
| 14 | + | |
| 15 | + private String sectionrouteCode; | |
| 16 | + | |
| 17 | + private int directions; | |
| 18 | + | |
| 19 | + private String sectionName; | |
| 20 | + | |
| 21 | + private String gsectionVector; | |
| 22 | + | |
| 23 | + private Float sectionDistance; | |
| 24 | + | |
| 25 | + private Float sectionTime; | |
| 26 | + | |
| 27 | + public int getId() { | |
| 28 | + return id; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void setId(int id) { | |
| 32 | + this.id = id; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public String getLineCode() { | |
| 36 | + return lineCode; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setLineCode(String lineCode) { | |
| 40 | + this.lineCode = lineCode; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public String getSectionCode() { | |
| 44 | + return sectionCode; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public void setSectionCode(String sectionCode) { | |
| 48 | + this.sectionCode = sectionCode; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public String getSectionrouteCode() { | |
| 52 | + return sectionrouteCode; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setSectionrouteCode(String sectionrouteCode) { | |
| 56 | + this.sectionrouteCode = sectionrouteCode; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public int getDirections() { | |
| 60 | + return directions; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setDirections(int directions) { | |
| 64 | + this.directions = directions; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public String getSectionName() { | |
| 68 | + return sectionName; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setSectionName(String sectionName) { | |
| 72 | + this.sectionName = sectionName; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public String getGsectionVector() { | |
| 76 | + return gsectionVector; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setGsectionVector(String gsectionVector) { | |
| 80 | + this.gsectionVector = gsectionVector; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public Float getSectionDistance() { | |
| 84 | + return sectionDistance; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setSectionDistance(Float sectionDistance) { | |
| 88 | + this.sectionDistance = sectionDistance; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public Float getSectionTime() { | |
| 92 | + return sectionTime; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void setSectionTime(Float sectionTime) { | |
| 96 | + this.sectionTime = sectionTime; | |
| 97 | + } | |
| 98 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -1115,7 +1115,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1115 | 1115 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 1116 | 1116 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); |
| 1117 | 1117 | int jhbc = 0,cjbc = 0,ljbc = 0; |
| 1118 | - double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0; | |
| 1118 | + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0,jcclc=0; | |
| 1119 | 1119 | float addMileage = 0l,remMileage = 0l; |
| 1120 | 1120 | Map<String,Object> map = new HashMap<String, Object>(); |
| 1121 | 1121 | for(ScheduleRealInfo scheduleRealInfo : list){ |
| ... | ... | @@ -1141,8 +1141,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1141 | 1141 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 1142 | 1142 | //计算营运里程,空驶里程 |
| 1143 | 1143 | if(childTaskPlans.isEmpty()){ |
| 1144 | - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | |
| 1145 | - || scheduleRealInfo.getBcType().equals("venting")){ | |
| 1144 | + if(scheduleRealInfo.getBcType().equals("in") || | |
| 1145 | + scheduleRealInfo.getBcType().equals("out")){ | |
| 1146 | + ksgl += tempJhlc; | |
| 1147 | + jcclc +=tempJhlc; | |
| 1148 | + }else if(scheduleRealInfo.getBcType().equals("venting")){ | |
| 1146 | 1149 | ksgl += tempJhlc; |
| 1147 | 1150 | }else{ |
| 1148 | 1151 | if(scheduleRealInfo.getStatus() != -1){ |
| ... | ... | @@ -1177,6 +1180,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1177 | 1180 | map.put("cjbc", cjbc); |
| 1178 | 1181 | map.put("ljbc", ljbc); |
| 1179 | 1182 | map.put("sjbc", jhbc-cjbc+ljbc); |
| 1183 | + map.put("jcclc", jcclc); | |
| 1180 | 1184 | return map; |
| 1181 | 1185 | } |
| 1182 | 1186 | ... | ... |
src/main/java/com/bsth/service/schedule/BService.java
| 1 | -package com.bsth.service.schedule; | |
| 2 | - | |
| 3 | -import org.springframework.data.domain.Page; | |
| 4 | -import org.springframework.data.domain.Pageable; | |
| 5 | - | |
| 6 | -import java.io.Serializable; | |
| 7 | -import java.util.List; | |
| 8 | -import java.util.Map; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * 基础service接口。 | |
| 12 | - */ | |
| 13 | -public interface BService<T, ID extends Serializable> { | |
| 14 | - // CRUD 操作 | |
| 15 | - // Create,Update操作 | |
| 16 | - T save(T t); | |
| 17 | - <S extends T> List<S> bulkSave(List<S> entities); // 批量保存(TODO:待测试) | |
| 18 | - // Research操作 | |
| 19 | - T findById(ID id); | |
| 20 | - List<T> findAll(); | |
| 21 | - Page<T> list(Map<String, Object> param, Pageable pageable); | |
| 22 | - List<T> list(Map<String, Object> param); | |
| 23 | - // Delete操作 | |
| 24 | - void delete(ID id) throws ScheduleException; | |
| 25 | -} | |
| 1 | +package com.bsth.service.schedule; | |
| 2 | + | |
| 3 | +import org.springframework.data.domain.Page; | |
| 4 | +import org.springframework.data.domain.Pageable; | |
| 5 | + | |
| 6 | +import java.io.Serializable; | |
| 7 | +import java.util.List; | |
| 8 | +import java.util.Map; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 基础service接口。 | |
| 12 | + */ | |
| 13 | +public interface BService<T, ID extends Serializable> { | |
| 14 | + // CRUD 操作 | |
| 15 | + // Create,Update操作 | |
| 16 | + T save(T t); | |
| 17 | + <S extends T> List<S> bulkSave(List<S> entities); // 批量保存(TODO:待测试) | |
| 18 | + // Research操作 | |
| 19 | + T findById(ID id); | |
| 20 | + List<T> findAll(); | |
| 21 | + Page<T> list(Map<String, Object> param, Pageable pageable); | |
| 22 | + List<T> list(Map<String, Object> param); | |
| 23 | + // Delete操作 | |
| 24 | + void delete(ID id) throws ScheduleException; | |
| 25 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/CarConfigInfoService.java
| 1 | 1 | package com.bsth.service.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.schedule.CarConfigInfo; |
| 4 | -import com.bsth.service.BaseService; | |
| 5 | 4 | |
| 6 | 5 | /** |
| 7 | 6 | * Created by xu on 16/5/9. |
| 8 | 7 | */ |
| 9 | -public interface CarConfigInfoService extends BaseService<CarConfigInfo, Long> { | |
| 8 | +public interface CarConfigInfoService extends BService<CarConfigInfo, Long> { | |
| 9 | + public void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException; | |
| 10 | + public void toggleCancel(Long id) throws ScheduleException; | |
| 10 | 11 | } | ... | ... |
src/main/java/com/bsth/service/schedule/CarConfigInfoServiceImpl.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.common.ResponseCode; | |
| 4 | -import com.bsth.entity.schedule.CarConfigInfo; | |
| 5 | -import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | |
| 6 | -import com.bsth.repository.schedule.CarConfigInfoRepository; | |
| 7 | -import com.bsth.service.impl.BaseServiceImpl; | |
| 8 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | -import org.springframework.stereotype.Service; | |
| 10 | - | |
| 11 | -import javax.transaction.Transactional; | |
| 12 | -import java.util.*; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * Created by xu on 16/5/9. | |
| 16 | - */ | |
| 17 | -@Service | |
| 18 | -public class CarConfigInfoServiceImpl extends BaseServiceImpl<CarConfigInfo, Long> implements CarConfigInfoService { | |
| 19 | - @Autowired | |
| 20 | - private CarConfigInfoRepository carConfigInfoRepository; | |
| 21 | - @Autowired | |
| 22 | - private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 23 | - | |
| 24 | - @Override | |
| 25 | - @Transactional | |
| 26 | - public Map<String, Object> delete(Long aLong) { | |
| 27 | - // 获取待作废的车辆配置 | |
| 28 | - CarConfigInfo carConfigInfo = carConfigInfoRepository.findOne(aLong); | |
| 29 | - // 查询有无规则使用过此车辆配置 | |
| 30 | - Map<String, Object> param = new HashMap<>(); | |
| 31 | - param.put("carConfigInfo.id_eq", carConfigInfo.getId()); | |
| 32 | - Iterator<ScheduleRule1Flat> scheduleRule1FlatIterator = | |
| 33 | - scheduleRule1FlatService.list(param).iterator(); | |
| 34 | - boolean isExist = false; | |
| 35 | - while (scheduleRule1FlatIterator.hasNext()) { | |
| 36 | - ScheduleRule1Flat scheduleRule1Flat = scheduleRule1FlatIterator.next(); | |
| 37 | - if (scheduleRule1Flat.getCarConfigInfo().getId().equals(carConfigInfo.getId())) { | |
| 38 | - isExist = true; | |
| 39 | - break; | |
| 40 | - } | |
| 41 | - } | |
| 42 | - | |
| 43 | - Map<String, Object> map = new HashMap<>(); | |
| 44 | - | |
| 45 | - if (isExist) { | |
| 46 | - throw new RuntimeException("车辆配置已被规则使用,不能删除,请先修改规则!"); | |
| 47 | - } else { | |
| 48 | - carConfigInfo.setIsCancel(true); | |
| 49 | - map.put("status", ResponseCode.SUCCESS); | |
| 50 | - } | |
| 51 | - | |
| 52 | - return map; | |
| 53 | - | |
| 54 | - } | |
| 55 | -} |
src/main/java/com/bsth/service/schedule/CarsService.java
| 1 | -package com.bsth.service.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.entity.Cars; | |
| 4 | - | |
| 5 | -/** | |
| 6 | - * Created by xu on 16/12/8. | |
| 7 | - */ | |
| 8 | -public interface CarsService extends BService<Cars, Integer> { | |
| 9 | - public void validate_nbbh(Cars cars) throws ScheduleException; | |
| 10 | - public void validate_clbh(Cars cars) throws ScheduleException; | |
| 11 | - public void validate_cph(Cars cars) throws ScheduleException; | |
| 12 | - public void validate_sbbh(Cars cars) throws ScheduleException; | |
| 13 | -} | |
| 1 | +package com.bsth.service.schedule; | |
| 2 | + | |
| 3 | +import com.bsth.entity.Cars; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * Created by xu on 16/12/8. | |
| 7 | + */ | |
| 8 | +public interface CarsService extends BService<Cars, Integer> { | |
| 9 | + public void validate_nbbh(Cars cars) throws ScheduleException; | |
| 10 | + public void validate_clbh(Cars cars) throws ScheduleException; | |
| 11 | + public void validate_cph(Cars cars) throws ScheduleException; | |
| 12 | + public void validate_sbbh(Cars cars) throws ScheduleException; | |
| 13 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoService.java
| 1 | 1 | package com.bsth.service.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.schedule.EmployeeConfigInfo; |
| 4 | -import com.bsth.service.BaseService; | |
| 5 | 4 | |
| 6 | 5 | /** |
| 7 | 6 | * Created by xu on 16/5/10. |
| 8 | 7 | */ |
| 9 | -public interface EmployeeConfigInfoService extends BaseService<EmployeeConfigInfo, Long> { | |
| 8 | +public interface EmployeeConfigInfoService extends BService<EmployeeConfigInfo, Long> { | |
| 9 | + void validate_jsy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException; | |
| 10 | + void validate_spy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException; | |
| 11 | + public void toggleCancel(Long id) throws ScheduleException; | |
| 10 | 12 | } | ... | ... |
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoServiceImpl.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule; | |
| 2 | - | |
| 3 | -import com.bsth.common.ResponseCode; | |
| 4 | -import com.bsth.entity.Line; | |
| 5 | -import com.bsth.entity.schedule.EmployeeConfigInfo; | |
| 6 | -import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | |
| 7 | -import com.bsth.repository.schedule.EmployeeConfigInfoRepository; | |
| 8 | -import com.bsth.service.impl.BaseServiceImpl; | |
| 9 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | -import org.springframework.stereotype.Service; | |
| 11 | - | |
| 12 | -import javax.transaction.Transactional; | |
| 13 | -import java.util.*; | |
| 14 | - | |
| 15 | -/** | |
| 16 | - * Created by xu on 16/5/10. | |
| 17 | - */ | |
| 18 | -@Service | |
| 19 | -public class EmployeeConfigInfoServiceImpl extends BaseServiceImpl<EmployeeConfigInfo, Long> implements EmployeeConfigInfoService { | |
| 20 | - @Autowired | |
| 21 | - private EmployeeConfigInfoRepository employeeConfigInfoRepository; | |
| 22 | - @Autowired | |
| 23 | - private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 24 | - | |
| 25 | - | |
| 26 | - @Override | |
| 27 | - @Transactional | |
| 28 | - public Map<String, Object> delete(Long aLong) { | |
| 29 | - // 获取待作废的人员配置 | |
| 30 | - EmployeeConfigInfo employeeConfigInfo = employeeConfigInfoRepository.findOne(aLong); | |
| 31 | - // 获取线路 | |
| 32 | - Line xl = employeeConfigInfo.getXl(); | |
| 33 | - // 查找线路的规则,比较人员配置信息 | |
| 34 | - Map<String, Object> param = new HashMap<>(); | |
| 35 | - param.put("xl.id_eq", xl.getId()); | |
| 36 | - Iterator<ScheduleRule1Flat> employeeConfigInfoIterator = scheduleRule1FlatService.list(param).iterator(); | |
| 37 | - List<String> ryConfigIds = new ArrayList<>(); | |
| 38 | - while (employeeConfigInfoIterator.hasNext()) { | |
| 39 | - ScheduleRule1Flat scheduleRule1Flat = employeeConfigInfoIterator.next(); | |
| 40 | - ryConfigIds.addAll(Arrays.asList(scheduleRule1Flat.getRyConfigIds().split(","))); | |
| 41 | - } | |
| 42 | - | |
| 43 | - Map<String, Object> map = new HashMap<>(); | |
| 44 | - | |
| 45 | - if (ryConfigIds.contains(employeeConfigInfo.getId().toString())) { | |
| 46 | - throw new RuntimeException("人员配置已被规则使用,不能删除,请先修改规则!"); | |
| 47 | - } else { | |
| 48 | - employeeConfigInfo.setIsCancel(true); | |
| 49 | - map.put("status", ResponseCode.SUCCESS); | |
| 50 | - } | |
| 51 | - | |
| 52 | - return map; | |
| 53 | - } | |
| 54 | - | |
| 55 | -} |
src/main/java/com/bsth/service/schedule/ScheduleException.java
| 1 | -package com.bsth.service.schedule; | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * Created by xu on 16/12/5. | |
| 5 | - */ | |
| 6 | -public class ScheduleException extends Exception { | |
| 7 | - public ScheduleException(String message) { | |
| 8 | - super("计划调度业务错误==>>" + message); | |
| 9 | - } | |
| 10 | -} | |
| 1 | +package com.bsth.service.schedule; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Created by xu on 16/12/5. | |
| 5 | + */ | |
| 6 | +public class ScheduleException extends Exception { | |
| 7 | + public ScheduleException(String message) { | |
| 8 | + super("计划调度业务错误==>>" + message); | |
| 9 | + } | |
| 10 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/impl/BServiceImpl.java
| 1 | -package com.bsth.service.schedule.impl; | |
| 2 | - | |
| 3 | -import com.bsth.entity.search.CustomerSpecs; | |
| 4 | -import com.bsth.repository.BaseRepository; | |
| 5 | -import com.bsth.service.schedule.BService; | |
| 6 | -import com.bsth.service.schedule.ScheduleException; | |
| 7 | -import org.slf4j.Logger; | |
| 8 | -import org.slf4j.LoggerFactory; | |
| 9 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | -import org.springframework.beans.factory.annotation.Value; | |
| 11 | -import org.springframework.data.domain.Page; | |
| 12 | -import org.springframework.data.domain.Pageable; | |
| 13 | -import org.springframework.data.jpa.domain.Specification; | |
| 14 | - | |
| 15 | -import javax.persistence.EntityManager; | |
| 16 | -import java.io.Serializable; | |
| 17 | -import java.util.ArrayList; | |
| 18 | -import java.util.List; | |
| 19 | -import java.util.Map; | |
| 20 | - | |
| 21 | -/** | |
| 22 | - * 基础BService实现。 | |
| 23 | - */ | |
| 24 | -public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> { | |
| 25 | - @Autowired | |
| 26 | - private BaseRepository<T, ID> baseRepository; | |
| 27 | - @Autowired | |
| 28 | - private EntityManager entityManager; | |
| 29 | - @Value("${hibernate.jdbc.batch_size}") | |
| 30 | - private int batchSize; | |
| 31 | - | |
| 32 | - /** 日志记录器 */ | |
| 33 | - protected Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 34 | - | |
| 35 | - // CRUD 操作 | |
| 36 | - // Create,Update操作 | |
| 37 | - @Override | |
| 38 | - public T save(T t) { | |
| 39 | - if (logger.isDebugEnabled()) { | |
| 40 | - logger.debug("save..."); | |
| 41 | - } | |
| 42 | - return baseRepository.save(t); | |
| 43 | - } | |
| 44 | - @Override | |
| 45 | - public <S extends T> List<S> bulkSave(List<S> entities) { | |
| 46 | - if (logger.isDebugEnabled()) { | |
| 47 | - logger.debug("bulkSave..."); | |
| 48 | - } | |
| 49 | - | |
| 50 | - // 不使用内部批量保存,自己实现批量保存 | |
| 51 | - final List<S> savedEntities = new ArrayList<>(entities.size()); | |
| 52 | - int i = 0; | |
| 53 | - for (S t : entities) { | |
| 54 | - entityManager.persist(t); | |
| 55 | - savedEntities.add(t); | |
| 56 | - i++; | |
| 57 | - if (i % batchSize == 0) { | |
| 58 | - entityManager.flush(); | |
| 59 | - entityManager.clear(); | |
| 60 | - } | |
| 61 | - } | |
| 62 | - return savedEntities; | |
| 63 | - } | |
| 64 | - | |
| 65 | - // Research操作 | |
| 66 | - @Override | |
| 67 | - public T findById(ID id) { | |
| 68 | - if (logger.isDebugEnabled()) { | |
| 69 | - logger.debug("findById..."); | |
| 70 | - } | |
| 71 | - | |
| 72 | - return baseRepository.findOne(id); | |
| 73 | - } | |
| 74 | - @Override | |
| 75 | - public List<T> findAll() { | |
| 76 | - if (logger.isDebugEnabled()) { | |
| 77 | - logger.debug("findAll..."); | |
| 78 | - } | |
| 79 | - | |
| 80 | - return (List<T>) baseRepository.findAll(); | |
| 81 | - } | |
| 82 | - @Override | |
| 83 | - public Page<T> list(Map<String, Object> param, Pageable pageable) { | |
| 84 | - if (logger.isDebugEnabled()) { | |
| 85 | - logger.debug("list(...,pageable)..."); | |
| 86 | - } | |
| 87 | - | |
| 88 | - // 自定义查询参数 | |
| 89 | - Specification<T> specification = new CustomerSpecs<>(param); | |
| 90 | - return baseRepository.findAll(specification, pageable); | |
| 91 | - } | |
| 92 | - @Override | |
| 93 | - public List<T> list(Map<String, Object> param) { | |
| 94 | - if (logger.isDebugEnabled()) { | |
| 95 | - logger.debug("list..."); | |
| 96 | - } | |
| 97 | - | |
| 98 | - // 自定义查询参数 | |
| 99 | - Specification<T> specification = new CustomerSpecs<>(param); | |
| 100 | - return baseRepository.findAll(specification); | |
| 101 | - } | |
| 102 | - // Delete操作 | |
| 103 | - @Override | |
| 104 | - public void delete(ID id) throws ScheduleException { | |
| 105 | - if (logger.isDebugEnabled()) { | |
| 106 | - logger.debug("delete..."); | |
| 107 | - } | |
| 108 | - | |
| 109 | - baseRepository.delete(id); | |
| 110 | - } | |
| 111 | -} | |
| 1 | +package com.bsth.service.schedule.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.search.CustomerSpecs; | |
| 4 | +import com.bsth.repository.BaseRepository; | |
| 5 | +import com.bsth.service.schedule.BService; | |
| 6 | +import com.bsth.service.schedule.ScheduleException; | |
| 7 | +import org.slf4j.Logger; | |
| 8 | +import org.slf4j.LoggerFactory; | |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | +import org.springframework.beans.factory.annotation.Value; | |
| 11 | +import org.springframework.data.domain.Page; | |
| 12 | +import org.springframework.data.domain.Pageable; | |
| 13 | +import org.springframework.data.jpa.domain.Specification; | |
| 14 | + | |
| 15 | +import javax.persistence.EntityManager; | |
| 16 | +import java.io.Serializable; | |
| 17 | +import java.util.ArrayList; | |
| 18 | +import java.util.List; | |
| 19 | +import java.util.Map; | |
| 20 | + | |
| 21 | +/** | |
| 22 | + * 基础BService实现。 | |
| 23 | + */ | |
| 24 | +public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> { | |
| 25 | + @Autowired | |
| 26 | + private BaseRepository<T, ID> baseRepository; | |
| 27 | + @Autowired | |
| 28 | + private EntityManager entityManager; | |
| 29 | + @Value("${hibernate.jdbc.batch_size}") | |
| 30 | + private int batchSize; | |
| 31 | + | |
| 32 | + /** 日志记录器 */ | |
| 33 | + protected Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 34 | + | |
| 35 | + // CRUD 操作 | |
| 36 | + // Create,Update操作 | |
| 37 | + @Override | |
| 38 | + public T save(T t) { | |
| 39 | + if (logger.isDebugEnabled()) { | |
| 40 | + logger.debug("save..."); | |
| 41 | + } | |
| 42 | + return baseRepository.save(t); | |
| 43 | + } | |
| 44 | + @Override | |
| 45 | + public <S extends T> List<S> bulkSave(List<S> entities) { | |
| 46 | + if (logger.isDebugEnabled()) { | |
| 47 | + logger.debug("bulkSave..."); | |
| 48 | + } | |
| 49 | + | |
| 50 | + // 不使用内部批量保存,自己实现批量保存 | |
| 51 | + final List<S> savedEntities = new ArrayList<>(entities.size()); | |
| 52 | + int i = 0; | |
| 53 | + for (S t : entities) { | |
| 54 | + entityManager.persist(t); | |
| 55 | + savedEntities.add(t); | |
| 56 | + i++; | |
| 57 | + if (i % batchSize == 0) { | |
| 58 | + entityManager.flush(); | |
| 59 | + entityManager.clear(); | |
| 60 | + } | |
| 61 | + } | |
| 62 | + return savedEntities; | |
| 63 | + } | |
| 64 | + | |
| 65 | + // Research操作 | |
| 66 | + @Override | |
| 67 | + public T findById(ID id) { | |
| 68 | + if (logger.isDebugEnabled()) { | |
| 69 | + logger.debug("findById..."); | |
| 70 | + } | |
| 71 | + | |
| 72 | + return baseRepository.findOne(id); | |
| 73 | + } | |
| 74 | + @Override | |
| 75 | + public List<T> findAll() { | |
| 76 | + if (logger.isDebugEnabled()) { | |
| 77 | + logger.debug("findAll..."); | |
| 78 | + } | |
| 79 | + | |
| 80 | + return (List<T>) baseRepository.findAll(); | |
| 81 | + } | |
| 82 | + @Override | |
| 83 | + public Page<T> list(Map<String, Object> param, Pageable pageable) { | |
| 84 | + if (logger.isDebugEnabled()) { | |
| 85 | + logger.debug("list(...,pageable)..."); | |
| 86 | + } | |
| 87 | + | |
| 88 | + // 自定义查询参数 | |
| 89 | + Specification<T> specification = new CustomerSpecs<>(param); | |
| 90 | + return baseRepository.findAll(specification, pageable); | |
| 91 | + } | |
| 92 | + @Override | |
| 93 | + public List<T> list(Map<String, Object> param) { | |
| 94 | + if (logger.isDebugEnabled()) { | |
| 95 | + logger.debug("list..."); | |
| 96 | + } | |
| 97 | + | |
| 98 | + // 自定义查询参数 | |
| 99 | + Specification<T> specification = new CustomerSpecs<>(param); | |
| 100 | + return baseRepository.findAll(specification); | |
| 101 | + } | |
| 102 | + // Delete操作 | |
| 103 | + @Override | |
| 104 | + public void delete(ID id) throws ScheduleException { | |
| 105 | + if (logger.isDebugEnabled()) { | |
| 106 | + logger.debug("delete..."); | |
| 107 | + } | |
| 108 | + | |
| 109 | + baseRepository.delete(id); | |
| 110 | + } | |
| 111 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/impl/CarConfigInfoServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.schedule.CarConfigInfo; | |
| 4 | +import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | |
| 5 | +import com.bsth.service.schedule.CarConfigInfoService; | |
| 6 | +import com.bsth.service.schedule.ScheduleException; | |
| 7 | +import com.bsth.service.schedule.ScheduleRule1FlatService; | |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | +import org.springframework.stereotype.Service; | |
| 10 | +import org.springframework.transaction.annotation.Transactional; | |
| 11 | +import org.springframework.util.CollectionUtils; | |
| 12 | + | |
| 13 | +import java.util.HashMap; | |
| 14 | +import java.util.List; | |
| 15 | +import java.util.Map; | |
| 16 | + | |
| 17 | +/** | |
| 18 | + * Created by xu on 16/5/9. | |
| 19 | + */ | |
| 20 | +@Service | |
| 21 | +public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> implements CarConfigInfoService { | |
| 22 | + @Autowired | |
| 23 | + private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 24 | + | |
| 25 | + @Transactional | |
| 26 | + public void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException { | |
| 27 | + // 相同车辆不能同时配置 | |
| 28 | + Map<String, Object> param = new HashMap<>(); | |
| 29 | + if (carConfigInfo.getId() != null) { | |
| 30 | + param.put("id_ne", carConfigInfo.getId()); | |
| 31 | + } | |
| 32 | + | |
| 33 | + if (carConfigInfo.getXl() == null || | |
| 34 | + carConfigInfo.getXl().getId() == null || | |
| 35 | + carConfigInfo.getXl().getName() == null) { | |
| 36 | + throw new ScheduleException("线路未选择"); | |
| 37 | + } else { | |
| 38 | +// param.put("xl.id_eq", carConfigInfo.getXl().getId()); | |
| 39 | + if (carConfigInfo.getCl() == null || carConfigInfo.getCl().getId() == null) { | |
| 40 | + throw new ScheduleException("车辆未选择"); | |
| 41 | + } else { | |
| 42 | + param.put("cl.id_eq", carConfigInfo.getCl().getId()); | |
| 43 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 44 | + throw new ScheduleException("车辆已经配置在" + carConfigInfo.getXl().getName() + "线路中!"); | |
| 45 | + } | |
| 46 | + } | |
| 47 | + } | |
| 48 | + | |
| 49 | + } | |
| 50 | + | |
| 51 | + @Transactional | |
| 52 | + @Override | |
| 53 | + public void delete(Long aLong) throws ScheduleException { | |
| 54 | + toggleCancel(aLong); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @Transactional | |
| 58 | + public void toggleCancel(Long id) throws ScheduleException { | |
| 59 | + CarConfigInfo carConfigInfo = findById(id); | |
| 60 | + Map<String, Object> param = new HashMap<>(); | |
| 61 | + if (carConfigInfo.getIsCancel()) { | |
| 62 | + validate_cars(carConfigInfo); | |
| 63 | + carConfigInfo.setIsCancel(false); | |
| 64 | + } else { | |
| 65 | + param.clear(); | |
| 66 | + param.put("carConfigInfo.id_eq", carConfigInfo.getId()); | |
| 67 | + List<ScheduleRule1Flat> scheduleRule1Flats = (List<ScheduleRule1Flat>) scheduleRule1FlatService.list(param); | |
| 68 | + if (CollectionUtils.isEmpty(scheduleRule1Flats)) { | |
| 69 | + carConfigInfo.setIsCancel(true); | |
| 70 | + } else { | |
| 71 | + throw new ScheduleException("车辆配置已被规则使用,不能作废,请先修改规则!"); | |
| 72 | + } | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 76 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/impl/CarsServiceImpl.java
| 1 | -package com.bsth.service.schedule.impl; | |
| 2 | - | |
| 3 | -import com.bsth.entity.Cars; | |
| 4 | -import com.bsth.service.schedule.CarsService; | |
| 5 | -import com.bsth.service.schedule.ScheduleException; | |
| 6 | -import org.springframework.stereotype.Service; | |
| 7 | -import org.springframework.transaction.annotation.Transactional; | |
| 8 | -import org.springframework.util.CollectionUtils; | |
| 9 | - | |
| 10 | -import java.util.HashMap; | |
| 11 | -import java.util.Map; | |
| 12 | - | |
| 13 | -/** | |
| 14 | - * Created by xu on 16/12/8. | |
| 15 | - */ | |
| 16 | -@Service(value = "carsServiceImpl_sc") | |
| 17 | -public class CarsServiceImpl extends BServiceImpl<Cars, Integer> implements CarsService { | |
| 18 | - | |
| 19 | - @Override | |
| 20 | - @Transactional | |
| 21 | - public void validate_nbbh(Cars cars) throws ScheduleException { | |
| 22 | - // 查询条件 | |
| 23 | - Map<String, Object> param = new HashMap<>(); | |
| 24 | - if (cars.getId() != null) { | |
| 25 | - param.put("id_ne", cars.getId()); | |
| 26 | - } | |
| 27 | - param.put("insideCode_eq", cars.getInsideCode()); | |
| 28 | - if (!CollectionUtils.isEmpty(list(param))) { | |
| 29 | - throw new ScheduleException("车辆内部编号/自编号重复"); | |
| 30 | - } | |
| 31 | - } | |
| 32 | - | |
| 33 | - @Override | |
| 34 | - @Transactional | |
| 35 | - public void validate_clbh(Cars cars) throws ScheduleException { | |
| 36 | - // 查询条件 | |
| 37 | - Map<String, Object> param = new HashMap<>(); | |
| 38 | - if (cars.getId() != null) { | |
| 39 | - param.put("id_ne", cars.getId()); | |
| 40 | - } | |
| 41 | - param.put("carCode_eq", cars.getCarCode()); | |
| 42 | - if (!CollectionUtils.isEmpty(list(param))) { | |
| 43 | - throw new ScheduleException("车辆编号重复"); | |
| 44 | - } | |
| 45 | - } | |
| 46 | - | |
| 47 | - @Override | |
| 48 | - @Transactional | |
| 49 | - public void validate_cph(Cars cars) throws ScheduleException { | |
| 50 | - // 查询条件 | |
| 51 | - Map<String, Object> param = new HashMap<>(); | |
| 52 | - if (cars.getId() != null) { | |
| 53 | - param.put("id_ne", cars.getId()); | |
| 54 | - } | |
| 55 | - param.put("carPlate_eq", cars.getCarPlate()); | |
| 56 | - if (!CollectionUtils.isEmpty(list(param))) { | |
| 57 | - throw new ScheduleException("车牌号重复"); | |
| 58 | - } | |
| 59 | - } | |
| 60 | - | |
| 61 | - @Override | |
| 62 | - @Transactional | |
| 63 | - public void validate_sbbh(Cars cars) throws ScheduleException { | |
| 64 | - // 查询条件 | |
| 65 | - Map<String, Object> param = new HashMap<>(); | |
| 66 | - if (cars.getId() != null) { | |
| 67 | - param.put("id_ne", cars.getId()); | |
| 68 | - } | |
| 69 | - param.put("equipmentCode_eq", cars.getEquipmentCode()); | |
| 70 | - if (!CollectionUtils.isEmpty(list(param))) { | |
| 71 | - throw new ScheduleException("设备编号重复"); | |
| 72 | - } | |
| 73 | - } | |
| 74 | -} | |
| 1 | +package com.bsth.service.schedule.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.Cars; | |
| 4 | +import com.bsth.service.schedule.CarsService; | |
| 5 | +import com.bsth.service.schedule.ScheduleException; | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | +import org.springframework.transaction.annotation.Transactional; | |
| 8 | +import org.springframework.util.CollectionUtils; | |
| 9 | + | |
| 10 | +import java.util.HashMap; | |
| 11 | +import java.util.Map; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * Created by xu on 16/12/8. | |
| 15 | + */ | |
| 16 | +@Service(value = "carsServiceImpl_sc") | |
| 17 | +public class CarsServiceImpl extends BServiceImpl<Cars, Integer> implements CarsService { | |
| 18 | + | |
| 19 | + @Override | |
| 20 | + @Transactional | |
| 21 | + public void validate_nbbh(Cars cars) throws ScheduleException { | |
| 22 | + // 查询条件 | |
| 23 | + Map<String, Object> param = new HashMap<>(); | |
| 24 | + if (cars.getId() != null) { | |
| 25 | + param.put("id_ne", cars.getId()); | |
| 26 | + } | |
| 27 | + param.put("insideCode_eq", cars.getInsideCode()); | |
| 28 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 29 | + throw new ScheduleException("车辆内部编号/自编号重复"); | |
| 30 | + } | |
| 31 | + } | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + @Transactional | |
| 35 | + public void validate_clbh(Cars cars) throws ScheduleException { | |
| 36 | + // 查询条件 | |
| 37 | + Map<String, Object> param = new HashMap<>(); | |
| 38 | + if (cars.getId() != null) { | |
| 39 | + param.put("id_ne", cars.getId()); | |
| 40 | + } | |
| 41 | + param.put("carCode_eq", cars.getCarCode()); | |
| 42 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 43 | + throw new ScheduleException("车辆编号重复"); | |
| 44 | + } | |
| 45 | + } | |
| 46 | + | |
| 47 | + @Override | |
| 48 | + @Transactional | |
| 49 | + public void validate_cph(Cars cars) throws ScheduleException { | |
| 50 | + // 查询条件 | |
| 51 | + Map<String, Object> param = new HashMap<>(); | |
| 52 | + if (cars.getId() != null) { | |
| 53 | + param.put("id_ne", cars.getId()); | |
| 54 | + } | |
| 55 | + param.put("carPlate_eq", cars.getCarPlate()); | |
| 56 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 57 | + throw new ScheduleException("车牌号重复"); | |
| 58 | + } | |
| 59 | + } | |
| 60 | + | |
| 61 | + @Override | |
| 62 | + @Transactional | |
| 63 | + public void validate_sbbh(Cars cars) throws ScheduleException { | |
| 64 | + // 查询条件 | |
| 65 | + Map<String, Object> param = new HashMap<>(); | |
| 66 | + if (cars.getId() != null) { | |
| 67 | + param.put("id_ne", cars.getId()); | |
| 68 | + } | |
| 69 | + param.put("equipmentCode_eq", cars.getEquipmentCode()); | |
| 70 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 71 | + throw new ScheduleException("设备编号重复"); | |
| 72 | + } | |
| 73 | + } | |
| 74 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.schedule.EmployeeConfigInfo; | |
| 4 | +import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | |
| 5 | +import com.bsth.service.schedule.EmployeeConfigInfoService; | |
| 6 | +import com.bsth.service.schedule.ScheduleException; | |
| 7 | +import com.bsth.service.schedule.ScheduleRule1FlatService; | |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | +import org.springframework.stereotype.Service; | |
| 10 | +import org.springframework.transaction.annotation.Transactional; | |
| 11 | +import org.springframework.util.CollectionUtils; | |
| 12 | + | |
| 13 | +import java.util.*; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * Created by xu on 16/5/10. | |
| 17 | + */ | |
| 18 | +@Service | |
| 19 | +public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigInfo, Long> implements EmployeeConfigInfoService { | |
| 20 | + @Autowired | |
| 21 | + private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 22 | + | |
| 23 | + @Transactional | |
| 24 | + @Override | |
| 25 | + public void validate_jsy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException { | |
| 26 | + // 驾驶员不能重复配置 | |
| 27 | + Map<String, Object> param = new HashMap<>(); | |
| 28 | + if (employeeConfigInfo.getId() != null) { | |
| 29 | + param.put("id_ne", employeeConfigInfo.getId()); | |
| 30 | + } | |
| 31 | + | |
| 32 | + if (employeeConfigInfo.getXl() == null || | |
| 33 | + employeeConfigInfo.getXl().getId() == null || | |
| 34 | + employeeConfigInfo.getXl().getName() == null) { | |
| 35 | + throw new ScheduleException("线路未选择"); | |
| 36 | + } else { | |
| 37 | + if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) { | |
| 38 | + throw new ScheduleException("驾驶员未选择"); | |
| 39 | + } else { | |
| 40 | + param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId()); | |
| 41 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 42 | + throw new ScheduleException("驾驶员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!"); | |
| 43 | + } | |
| 44 | + } | |
| 45 | + } | |
| 46 | + } | |
| 47 | + | |
| 48 | + @Transactional | |
| 49 | + @Override | |
| 50 | + public void validate_spy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException { | |
| 51 | + // 售票员不能重复配置 | |
| 52 | + Map<String, Object> param = new HashMap<>(); | |
| 53 | + if (employeeConfigInfo.getId() != null) { | |
| 54 | + param.put("id_ne", employeeConfigInfo.getId()); | |
| 55 | + } | |
| 56 | + | |
| 57 | + if (employeeConfigInfo.getXl() == null || | |
| 58 | + employeeConfigInfo.getXl().getId() == null || | |
| 59 | + employeeConfigInfo.getXl().getName() == null) { | |
| 60 | + throw new ScheduleException("线路未选择"); | |
| 61 | + } else { | |
| 62 | + if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) { | |
| 63 | + throw new ScheduleException("售票员未选择"); | |
| 64 | + } else { | |
| 65 | + param.put("spy.id_eq", employeeConfigInfo.getSpy().getId()); | |
| 66 | + if (!CollectionUtils.isEmpty(list(param))) { | |
| 67 | + throw new ScheduleException("售票员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!"); | |
| 68 | + } | |
| 69 | + } | |
| 70 | + } | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Transactional | |
| 74 | + @Override | |
| 75 | + public void delete(Long aLong) throws ScheduleException { | |
| 76 | + toggleCancel(aLong); | |
| 77 | + } | |
| 78 | + | |
| 79 | + @Transactional | |
| 80 | + @Override | |
| 81 | + public void toggleCancel(Long id) throws ScheduleException { | |
| 82 | + EmployeeConfigInfo employeeConfigInfo = findById(id); | |
| 83 | + Map<String, Object> param = new HashMap<>(); | |
| 84 | + if (employeeConfigInfo.getIsCancel()) { | |
| 85 | + validate_jsy(employeeConfigInfo); | |
| 86 | + validate_spy(employeeConfigInfo); | |
| 87 | + employeeConfigInfo.setIsCancel(false); | |
| 88 | + } else { | |
| 89 | + param.clear(); | |
| 90 | + param.put("xl.id_eq", employeeConfigInfo.getXl().getId()); | |
| 91 | + List<ScheduleRule1Flat> scheduleRule1Flats = (List<ScheduleRule1Flat>) scheduleRule1FlatService.list(param); | |
| 92 | + List<String> ryConfigIds = new ArrayList<>(); | |
| 93 | + for (ScheduleRule1Flat scheduleRule1Flat : scheduleRule1Flats) { | |
| 94 | + ryConfigIds.addAll(Arrays.asList(scheduleRule1Flat.getRyConfigIds().split(","))); | |
| 95 | + } | |
| 96 | + | |
| 97 | + if (ryConfigIds.contains(String.valueOf(id))) { | |
| 98 | + throw new ScheduleException("人员配置已被规则使用,不能作废,请先修改规则!"); | |
| 99 | + } else { | |
| 100 | + employeeConfigInfo.setIsCancel(true); | |
| 101 | + } | |
| 102 | + } | |
| 103 | + } | |
| 104 | + | |
| 105 | +} | ... | ... |
src/main/resources/application-dev.properties
| ... | ... | @@ -6,7 +6,7 @@ spring.jpa.hibernate.ddl-auto= update |
| 6 | 6 | spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy |
| 7 | 7 | #DATABASE |
| 8 | 8 | spring.jpa.database= MYSQL |
| 9 | -spring.jpa.show-sql= false | |
| 9 | +spring.jpa.show-sql= true | |
| 10 | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | 11 | spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 12 | 12 | spring.datasource.username= root | ... | ... |
src/main/resources/static/pages/base/line/js/line-add-form.js
| ... | ... | @@ -94,7 +94,7 @@ $(function(){ |
| 94 | 94 | $('#endStationEndTimeInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'}); |
| 95 | 95 | |
| 96 | 96 | /** get请求获取公司表数据并填充公司下拉框选择值 */ |
| 97 | - $get('/business/all', {upCode_eq: '77'}, function(array){ | |
| 97 | + $get('/business/all', {upCode_eq: '88'}, function(array){ | |
| 98 | 98 | |
| 99 | 99 | /** 公司下拉options属性值 */ |
| 100 | 100 | var options = '<option value="">-- 请选择公司 --</option>'; | ... | ... |
src/main/resources/static/pages/base/line/js/line-details-info.js
| ... | ... | @@ -47,7 +47,7 @@ $(function(){ |
| 47 | 47 | function selectTemp(callback) { |
| 48 | 48 | |
| 49 | 49 | // 填充公司下拉框选择值 |
| 50 | - $.get('/business/all', {upCode_eq: '77'}, function(array){ | |
| 50 | + $.get('/business/all', {upCode_eq: '88'}, function(array){ | |
| 51 | 51 | |
| 52 | 52 | // 公司下拉options属性值 |
| 53 | 53 | var options = '<option value="">-- 请选择公司 --</option>'; | ... | ... |
src/main/resources/static/pages/base/line/js/line-edit-form.js
| ... | ... | @@ -42,7 +42,7 @@ |
| 42 | 42 | function selectTemp(callback) { |
| 43 | 43 | |
| 44 | 44 | // 填充公司下拉框选择值 |
| 45 | - $.get('/business/all', {upCode_eq: '77'}, function(array){ | |
| 45 | + $.get('/business/all', {upCode_eq: '88'}, function(array){ | |
| 46 | 46 | |
| 47 | 47 | // 公司下拉options属性值 |
| 48 | 48 | var options = '<option value="">-- 请选择公司 --</option>'; | ... | ... |
src/main/resources/static/pages/base/line/js/line-list-table.js
src/main/resources/static/pages/forms/statement/correctStatis.html
| ... | ... | @@ -147,7 +147,7 @@ |
| 147 | 147 | initPinYinSelect2('#line',data,''); |
| 148 | 148 | |
| 149 | 149 | line = ""; |
| 150 | - updateModel(); | |
| 150 | +// updateModel(); | |
| 151 | 151 | }); |
| 152 | 152 | |
| 153 | 153 | var obj = []; |
| ... | ... | @@ -285,17 +285,17 @@ |
| 285 | 285 | line = $("#line").val(); |
| 286 | 286 | if(line == " ") |
| 287 | 287 | line = ""; |
| 288 | - updateModel(); | |
| 288 | +// updateModel(); | |
| 289 | 289 | }); |
| 290 | 290 | $('#startDate').on("blur", function(){ |
| 291 | 291 | startDate = $("#startDate").val(); |
| 292 | 292 | endDate = $("#endDate").val(); |
| 293 | - updateModel(); | |
| 293 | +// updateModel(); | |
| 294 | 294 | }); |
| 295 | 295 | $('#endDate').on("blur", function(){ |
| 296 | 296 | startDate = $("#startDate").val(); |
| 297 | 297 | endDate = $("#endDate").val(); |
| 298 | - updateModel(); | |
| 298 | +// updateModel(); | |
| 299 | 299 | }); |
| 300 | 300 | |
| 301 | 301 | ... | ... |
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -338,8 +338,8 @@ |
| 338 | 338 | <td>{{remMileage}}</td> |
| 339 | 339 | <td colspan="2">临加公里</td> |
| 340 | 340 | <td>{{addMileage}}</td> |
| 341 | - <td colspan="2">营运公里</td> | |
| 342 | - <td colspan="3">{{yygl}}</td> | |
| 341 | + <td colspan="3">营运公里</td> | |
| 342 | + <td colspan="2">{{yygl}}</td> | |
| 343 | 343 | </tr> |
| 344 | 344 | <tr> |
| 345 | 345 | <td colspan="2">空驶公里</td> |
| ... | ... | @@ -348,8 +348,8 @@ |
| 348 | 348 | <td>{{realMileage}}</td> |
| 349 | 349 | <td colspan="2">计划班次</td> |
| 350 | 350 | <td>{{jhbc}}</td> |
| 351 | - <td colspan="2">烂班班次</td> | |
| 352 | - <td colspan="3">{{cjbc}}</td> | |
| 351 | + <td colspan="3">烂班班次</td> | |
| 352 | + <td colspan="2">{{cjbc}}</td> | |
| 353 | 353 | </tr> |
| 354 | 354 | <tr> |
| 355 | 355 | <td colspan="2">增加班次</td> |
| ... | ... | @@ -358,8 +358,8 @@ |
| 358 | 358 | <td>{{sjbc}}</td> |
| 359 | 359 | <td colspan="2"></td> |
| 360 | 360 | <td></td> |
| 361 | - <td colspan="2"></td> | |
| 362 | 361 | <td colspan="3"></td> |
| 362 | + <td colspan="2"></td> | |
| 363 | 363 | </tr> |
| 364 | 364 | </script> |
| 365 | 365 | <script type="text/html" id="ludan_4"> | ... | ... |
src/main/resources/static/pages/forms/statement/waybillQp.html
| ... | ... | @@ -334,32 +334,38 @@ |
| 334 | 334 | <tr> |
| 335 | 335 | <td colspan="2">计划公里</td> |
| 336 | 336 | <td>{{jhlc}}</td> |
| 337 | + <td colspan="2">营运公里</td> | |
| 338 | + <td >{{yygl}}</td> | |
| 337 | 339 | <td colspan="2">烂班公里</td> |
| 338 | 340 | <td>{{remMileage}}</td> |
| 339 | - <td colspan="2">临加公里</td> | |
| 340 | - <td>{{addMileage}}</td> | |
| 341 | - <td colspan="2">营运公里</td> | |
| 342 | - <td colspan="3">{{yygl}}</td> | |
| 341 | + <td colspan="3">空驶公里</td> | |
| 342 | + <td colspan="2">{{ksgl}}</td> | |
| 343 | + | |
| 344 | + | |
| 343 | 345 | </tr> |
| 344 | 346 | <tr> |
| 345 | - <td colspan="2">空驶公里</td> | |
| 346 | - <td>{{ksgl}}</td> | |
| 347 | - <td colspan="2">总公里</td> | |
| 348 | - <td>{{realMileage}}</td> | |
| 349 | 347 | <td colspan="2">计划班次</td> |
| 350 | 348 | <td>{{jhbc}}</td> |
| 351 | - <td colspan="2">烂班班次</td> | |
| 352 | - <td colspan="3">{{cjbc}}</td> | |
| 349 | + | |
| 350 | + <td colspan="2">进出场公里</td> | |
| 351 | + <td>{{jcclc}}</td> | |
| 352 | + <td colspan="2">临加公里</td> | |
| 353 | + <td>{{addMileage}}</td> | |
| 354 | + <td colspan="3">烂班班次</td> | |
| 355 | + <td colspan="2">{{cjbc}}</td> | |
| 356 | + | |
| 353 | 357 | </tr> |
| 354 | 358 | <tr> |
| 355 | - <td colspan="2">增加班次</td> | |
| 356 | - <td>{{ljbc}}</td> | |
| 359 | + | |
| 357 | 360 | <td colspan="2">实际班次</td> |
| 358 | 361 | <td>{{sjbc}}</td> |
| 359 | - <td colspan="2"></td> | |
| 360 | - <td></td> | |
| 361 | - <td colspan="2"></td> | |
| 362 | + <td colspan="2">总公里</td> | |
| 363 | + <td>{{realMileage}}</td> | |
| 364 | + <td colspan="2">临加班次</td> | |
| 365 | + <td>{{ljbc}}</td> | |
| 366 | + | |
| 362 | 367 | <td colspan="3"></td> |
| 368 | + <td colspan="2"></td> | |
| 363 | 369 | </tr> |
| 364 | 370 | </script> |
| 365 | 371 | <script type="text/html" id="ludan_4"> | ... | ... |
src/main/resources/static/pages/oil/checkJyryList.html
| ... | ... | @@ -75,10 +75,10 @@ |
| 75 | 75 | <input type="text" id="yyrq" class="form-control form-filter input-sm" name="yyrq"> |
| 76 | 76 | </td> |
| 77 | 77 | <td> |
| 78 | -<!-- <select class="form-control" name="gsdm_like" id="jyryListGsdmId" ></select> --> | |
| 78 | + <select class="form-control" name="gsdm_like" id="jyryListGsdmId" ></select> | |
| 79 | 79 | </td> |
| 80 | 80 | <td> |
| 81 | -<!-- <select class="form-control" name="fgsdm_like" id="jyryListFgsdmId" ></select> --> | |
| 81 | + <select class="form-control" name="fgsdm_like" id="jyryListFgsdmId" ></select> | |
| 82 | 82 | </td> |
| 83 | 83 | <td> |
| 84 | 84 | </td> |
| ... | ... | @@ -166,7 +166,19 @@ $(function(){ |
| 166 | 166 | params['jsy']=jsy; |
| 167 | 167 | params['id']=id; |
| 168 | 168 | $get('/ylxxb/check', params, function(){ |
| 169 | - jsDoQuery(null,true); | |
| 169 | + var cells = $('tr.filter')[0].cells | |
| 170 | + ,params1 = {} | |
| 171 | + ,name; | |
| 172 | + $.each(cells, function(i, cell){ | |
| 173 | + var items = $('input,select', cell); | |
| 174 | + for(var j = 0, item; item = items[j++];){ | |
| 175 | + name = $(item).attr('name'); | |
| 176 | + if(name){ | |
| 177 | + params1[name] = $(item).val(); | |
| 178 | + } | |
| 179 | + } | |
| 180 | + }); | |
| 181 | + jsDoQuery(params1,true); | |
| 170 | 182 | }); |
| 171 | 183 | } |
| 172 | 184 | }) |
| ... | ... | @@ -186,21 +198,22 @@ $(function(){ |
| 186 | 198 | // jsDoQuery(null, true); |
| 187 | 199 | }); |
| 188 | 200 | |
| 189 | - var gsqx=""; | |
| 190 | - var fgsqx=""; | |
| 201 | +// var gsqx=""; | |
| 202 | +// var fgsqx=""; | |
| 191 | 203 | |
| 192 | 204 | $.get('/user/companyData', function(result){ |
| 193 | 205 | obj = result; |
| 194 | - var options = '<option value="">请选择</option>'; | |
| 206 | + var options = ''; | |
| 207 | +// '<option value="">请选择</option>'; | |
| 195 | 208 | for(var i = 0; i < obj.length; i++){ |
| 196 | 209 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 197 | - setFgsqx(obj[i].companyCode); | |
| 198 | - gsqx +=obj[i].companyCode+","; | |
| 210 | +// setFgsqx(obj[i].companyCode); | |
| 211 | +// gsqx +=obj[i].companyCode+","; | |
| 199 | 212 | } |
| 200 | 213 | $('#jyryListGsdmId').html(options); |
| 201 | 214 | updateCompany(); |
| 202 | 215 | }); |
| 203 | - function setFgsqx(gs){ | |
| 216 | + /* function setFgsqx(gs){ | |
| 204 | 217 | var company =gs |
| 205 | 218 | var options = ''; |
| 206 | 219 | for(var i = 0; i < obj.length; i++){ |
| ... | ... | @@ -211,11 +224,12 @@ $(function(){ |
| 211 | 224 | } |
| 212 | 225 | } |
| 213 | 226 | } |
| 214 | - } | |
| 227 | + } */ | |
| 215 | 228 | $("#jyryListGsdmId").on("change",updateCompany); |
| 216 | 229 | function updateCompany(){ |
| 217 | 230 | var company = $('#jyryListGsdmId').val(); |
| 218 | - var options = '<option value="">请选择</option>'; | |
| 231 | + var options = ''; | |
| 232 | +// '<option value="">请选择</option>'; | |
| 219 | 233 | for(var i = 0; i < obj.length; i++){ |
| 220 | 234 | if(obj[i].companyCode == company){ |
| 221 | 235 | var children = obj[i].children; |
| ... | ... | @@ -230,7 +244,13 @@ $(function(){ |
| 230 | 244 | |
| 231 | 245 | //提交 |
| 232 | 246 | $('tr.filter .filter-submit').on('click', function(){ |
| 233 | - if($("#yyrq").val()!=""){ | |
| 247 | + var jyryGsdm=$("#jyryListGsdmId").val(); | |
| 248 | + var jyryFgsdm=$("#jyryListFgsdmId").val(); | |
| 249 | + if($("#yyrq").val()==""||$("#yyrq").val()==null ){ | |
| 250 | + layer.msg('请选择日期.'); | |
| 251 | + }else if(jyryGsdm=="" || jyryGsdm==null ||jyryFgsdm==""||jyryFgsdm==null){ | |
| 252 | + layer.msg('请选择公司和分公司.'); | |
| 253 | + }else{ | |
| 234 | 254 | var cells = $('tr.filter')[0].cells |
| 235 | 255 | ,params = {} |
| 236 | 256 | ,name; |
| ... | ... | @@ -245,8 +265,6 @@ $(function(){ |
| 245 | 265 | }); |
| 246 | 266 | page = 0; |
| 247 | 267 | jsDoQuery(params, true); |
| 248 | - }else{ | |
| 249 | - layer.msg('请选择日期.'); | |
| 250 | 268 | } |
| 251 | 269 | }); |
| 252 | 270 | |
| ... | ... | @@ -283,7 +301,7 @@ $(function(){ |
| 283 | 301 | } |
| 284 | 302 | params['fgsdm_in']=fgsqx1; |
| 285 | 303 | } |
| 286 | - } */ | |
| 304 | + } */ | |
| 287 | 305 | |
| 288 | 306 | $get('/ylxxb/pagequery' ,params, function(data){ |
| 289 | 307 | $.each(data.dataList, function(i, obj) { |
| ... | ... | @@ -296,7 +314,7 @@ $(function(){ |
| 296 | 314 | if(pagination && data.dataList.length > 0){ |
| 297 | 315 | //重新分页 |
| 298 | 316 | initPagination = true; |
| 299 | - showPagination(data); | |
| 317 | + //showPagination(data); | |
| 300 | 318 | } |
| 301 | 319 | layer.close(i); |
| 302 | 320 | }); |
| ... | ... | @@ -355,54 +373,49 @@ $(function(){ |
| 355 | 373 | }); |
| 356 | 374 | |
| 357 | 375 | |
| 358 | -}); | |
| 359 | -//改变状态 | |
| 360 | -function changeEnabled(id,enabled){ | |
| 361 | - debugger | |
| 362 | - $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){ | |
| 363 | - jsDoQuery(null, true); | |
| 364 | - }) | |
| 365 | -} | |
| 366 | 376 | |
| 367 | -//改变状态 | |
| 368 | -function startOptJsy(id){ | |
| 369 | - $('#jsy'+id).select2({ | |
| 370 | - placeholder: '搜索驾驶员...', | |
| 371 | - ajax: { | |
| 372 | - url: '/personnel/sreachPersonnel', | |
| 373 | - dataType: 'json', | |
| 374 | - delay: 150, | |
| 375 | - data: function(params){ | |
| 376 | - return{jobCode: params.term}; | |
| 377 | + //改变状态 | |
| 378 | + function startOptJsy(id){ | |
| 379 | + $('#jsy'+id).select2({ | |
| 380 | + placeholder: '搜索驾驶员...', | |
| 381 | + ajax: { | |
| 382 | + url: '/personnel/sreachPersonnel', | |
| 383 | + dataType: 'json', | |
| 384 | + delay: 150, | |
| 385 | + data: function(params){ | |
| 386 | + return{jobCode: params.term}; | |
| 387 | + }, | |
| 388 | + processResults: function (data) { | |
| 389 | + return { | |
| 390 | + results: data | |
| 391 | + }; | |
| 392 | + }, | |
| 393 | + cache: true | |
| 377 | 394 | }, |
| 378 | - processResults: function (data) { | |
| 379 | - return { | |
| 380 | - results: data | |
| 381 | - }; | |
| 382 | - }, | |
| 383 | - cache: true | |
| 384 | - }, | |
| 385 | - templateResult: function(repo){ | |
| 386 | - if (repo.loading) return repo.text; | |
| 387 | - var h = '<span>'+repo.text+'</span>'; | |
| 388 | - return h; | |
| 389 | - }, | |
| 390 | - escapeMarkup: function (markup) { return markup; }, | |
| 391 | - minimumInputLength: 1, | |
| 392 | - templateSelection: function(repo){ | |
| 393 | - return repo.text; | |
| 394 | - }, | |
| 395 | - language: { | |
| 396 | - noResults: function(){ | |
| 397 | - return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>'; | |
| 398 | - }, | |
| 399 | - inputTooShort : function(e) { | |
| 400 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>'; | |
| 401 | - }, | |
| 402 | - searching : function() { | |
| 403 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>'; | |
| 404 | - } | |
| 405 | - } | |
| 406 | - }) | |
| 407 | -} | |
| 395 | + templateResult: function(repo){ | |
| 396 | + if (repo.loading) return repo.text; | |
| 397 | + var h = '<span>'+repo.text+'</span>'; | |
| 398 | + return h; | |
| 399 | + }, | |
| 400 | + escapeMarkup: function (markup) { return markup; }, | |
| 401 | + minimumInputLength: 1, | |
| 402 | + templateSelection: function(repo){ | |
| 403 | + return repo.text; | |
| 404 | + }, | |
| 405 | + language: { | |
| 406 | + noResults: function(){ | |
| 407 | + return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>'; | |
| 408 | + }, | |
| 409 | + inputTooShort : function(e) { | |
| 410 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>'; | |
| 411 | + }, | |
| 412 | + searching : function() { | |
| 413 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>'; | |
| 414 | + } | |
| 415 | + } | |
| 416 | + }) | |
| 417 | + } | |
| 418 | + | |
| 419 | +}); | |
| 420 | + | |
| 408 | 421 | </script> |
| 409 | 422 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/oil/cylList.html
| ... | ... | @@ -141,23 +141,24 @@ $(function(){ |
| 141 | 141 | increaseArea: '20%' |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - var gsqx=""; | |
| 145 | - var fgsqx=""; | |
| 144 | +// var gsqx=""; | |
| 145 | +// var fgsqx=""; | |
| 146 | 146 | |
| 147 | 147 | $.get('/user/companyData', function(result){ |
| 148 | 148 | obj = result; |
| 149 | - var options = '<option value="">请选择</option>'; | |
| 149 | + var options = ''; | |
| 150 | +// '<option value="">请选择</option>'; | |
| 150 | 151 | for(var i = 0; i < obj.length; i++){ |
| 151 | 152 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 152 | - setFgsqx(obj[i].companyCode); | |
| 153 | - gsqx +=obj[i].companyCode+","; | |
| 153 | +// setFgsqx(obj[i].companyCode); | |
| 154 | +// gsqx +=obj[i].companyCode+","; | |
| 154 | 155 | } |
| 155 | 156 | $('#cylListGsdmId').html(options); |
| 156 | 157 | updateCompany(); |
| 157 | - jsDoQuery(null,true); | |
| 158 | +// jsDoQuery(null,true); | |
| 158 | 159 | }); |
| 159 | 160 | |
| 160 | - function setFgsqx(gs){ | |
| 161 | + /* function setFgsqx(gs){ | |
| 161 | 162 | var company =gs |
| 162 | 163 | var options = ''; |
| 163 | 164 | for(var i = 0; i < obj.length; i++){ |
| ... | ... | @@ -168,12 +169,13 @@ $(function(){ |
| 168 | 169 | } |
| 169 | 170 | } |
| 170 | 171 | } |
| 171 | - } | |
| 172 | + } */ | |
| 172 | 173 | |
| 173 | 174 | $("#cylListGsdmId").on("change",updateCompany); |
| 174 | 175 | function updateCompany(){ |
| 175 | 176 | var company = $('#cylListGsdmId').val(); |
| 176 | - var options = '<option value="">请选择</option>'; | |
| 177 | + var options = ''; | |
| 178 | +// '<option value="">请选择</option>'; | |
| 177 | 179 | for(var i = 0; i < obj.length; i++){ |
| 178 | 180 | if(obj[i].companyCode == company){ |
| 179 | 181 | var children = obj[i].children; |
| ... | ... | @@ -188,25 +190,31 @@ $(function(){ |
| 188 | 190 | //重置 |
| 189 | 191 | $('tr.filter .filter-cancel').on('click', function(){ |
| 190 | 192 | $('tr.filter input, select').val('').change(); |
| 191 | - jsDoQuery(null, true); | |
| 193 | +// jsDoQuery(null, true); | |
| 192 | 194 | }); |
| 193 | 195 | |
| 194 | 196 | //提交 |
| 195 | 197 | $('tr.filter .filter-submit').on('click', function(){ |
| 196 | - var cells = $('tr.filter')[0].cells | |
| 197 | - ,params = {} | |
| 198 | - ,name; | |
| 199 | - $.each(cells, function(i, cell){ | |
| 200 | - var items = $('input,select', cell); | |
| 201 | - for(var j = 0, item; item = items[j++];){ | |
| 202 | - name = $(item).attr('name'); | |
| 203 | - if(name){ | |
| 204 | - params[name] = $(item).val(); | |
| 198 | + var cylGsdm=$("#cylListGsdmId").val(); | |
| 199 | + var cylFgsdm=$("#cylListFgsdmId").val(); | |
| 200 | + if(cylGsdm=="" ||cylGsdm ==null ||cylFgsdm=="" ||cylFgsdm ==null){ | |
| 201 | + layer.msg("请选择公司和分公司"); | |
| 202 | + }else{ | |
| 203 | + var cells = $('tr.filter')[0].cells | |
| 204 | + ,params = {} | |
| 205 | + ,name; | |
| 206 | + $.each(cells, function(i, cell){ | |
| 207 | + var items = $('input,select', cell); | |
| 208 | + for(var j = 0, item; item = items[j++];){ | |
| 209 | + name = $(item).attr('name'); | |
| 210 | + if(name){ | |
| 211 | + params[name] = $(item).val(); | |
| 212 | + } | |
| 205 | 213 | } |
| 206 | - } | |
| 207 | - }); | |
| 208 | - page = 0; | |
| 209 | - jsDoQuery(params, true); | |
| 214 | + }); | |
| 215 | + page = 0; | |
| 216 | + jsDoQuery(params, true); | |
| 217 | + } | |
| 210 | 218 | }); |
| 211 | 219 | |
| 212 | 220 | |
| ... | ... | @@ -222,7 +230,7 @@ $(function(){ |
| 222 | 230 | params['order'] = 'nbbm'; |
| 223 | 231 | params['page'] = page; |
| 224 | 232 | var i = 2; |
| 225 | - var cylGsdm=$("#cylListGsdmId").val(); | |
| 233 | + /* var cylGsdm=$("#cylListGsdmId").val(); | |
| 226 | 234 | var cylFgsdm=$("#cylListFgsdmId").val(); |
| 227 | 235 | if(cylGsdm==''|| cylGsdm==null){ |
| 228 | 236 | params['gsdm_in']=gsqx; |
| ... | ... | @@ -240,8 +248,7 @@ $(function(){ |
| 240 | 248 | } |
| 241 | 249 | params['fgsdm_in']=fgsqx1; |
| 242 | 250 | } |
| 243 | - } | |
| 244 | - console.log(params); | |
| 251 | + } */ | |
| 245 | 252 | $get('/cyl' ,params, function(data){ |
| 246 | 253 | $.each(data.content, function(i, obj) { |
| 247 | 254 | obj.updatetime = moment(obj.updatetime).format("YYYY-MM-DD"); | ... | ... |
src/main/resources/static/pages/oil/jyglList.html
| ... | ... | @@ -202,39 +202,25 @@ $(function(){ |
| 202 | 202 | //重置 |
| 203 | 203 | $('tr.filter .filter-cancel').on('click', function(){ |
| 204 | 204 | $('tr.filter input, select').val('').change(); |
| 205 | - if($("#rq").val()!=""){ | |
| 206 | - var cells = $('tr.filter')[0].cells | |
| 207 | - ,params = {} | |
| 208 | - ,name; | |
| 209 | - $.each(cells, function(i, cell){ | |
| 210 | - var items = $('input,select', cell); | |
| 211 | - for(var j = 0, item; item = items[j++];){ | |
| 212 | - name = $(item).attr('name'); | |
| 213 | - if(name){ | |
| 214 | - params[name] = $(item).val(); | |
| 215 | - } | |
| 216 | - } | |
| 217 | - }); | |
| 218 | - jsDoQuery(params, true); | |
| 219 | - } | |
| 220 | 205 | }); |
| 221 | 206 | |
| 222 | 207 | |
| 223 | - var gsqx=""; | |
| 224 | - var fgsqx=""; | |
| 208 | +// var gsqx=""; | |
| 209 | +// var fgsqx=""; | |
| 225 | 210 | |
| 226 | 211 | $.get('/user/companyData', function(result){ |
| 227 | 212 | obj = result; |
| 228 | - var options = '<option value="">请选择</option>'; | |
| 213 | + var options = ''; | |
| 214 | +// '<option value="">请选择</option>'; | |
| 229 | 215 | for(var i = 0; i < obj.length; i++){ |
| 230 | 216 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 231 | - setFgsqx(obj[i].companyCode); | |
| 232 | - gsqx +=obj[i].companyCode+","; | |
| 217 | +// setFgsqx(obj[i].companyCode); | |
| 218 | +// gsqx +=obj[i].companyCode+","; | |
| 233 | 219 | } |
| 234 | 220 | $('#jyglListGsdmId').html(options); |
| 235 | 221 | updateCompany(); |
| 236 | 222 | }); |
| 237 | - function setFgsqx(gs){ | |
| 223 | + /* function setFgsqx(gs){ | |
| 238 | 224 | var company =gs |
| 239 | 225 | var options = ''; |
| 240 | 226 | for(var i = 0; i < obj.length; i++){ |
| ... | ... | @@ -245,11 +231,12 @@ $(function(){ |
| 245 | 231 | } |
| 246 | 232 | } |
| 247 | 233 | } |
| 248 | - } | |
| 234 | + } */ | |
| 249 | 235 | $("#jyglListGsdmId").on("change",updateCompany); |
| 250 | 236 | function updateCompany(){ |
| 251 | 237 | var company = $('#jyglListGsdmId').val(); |
| 252 | - var options = '<option value="">请选择</option>'; | |
| 238 | + var options = ''; | |
| 239 | +// '<option value="">请选择</option>'; | |
| 253 | 240 | for(var i = 0; i < obj.length; i++){ |
| 254 | 241 | if(obj[i].companyCode == company){ |
| 255 | 242 | var children = obj[i].children; |
| ... | ... | @@ -262,7 +249,13 @@ $(function(){ |
| 262 | 249 | } |
| 263 | 250 | //提交 |
| 264 | 251 | $('tr.filter .filter-submit').on('click', function(){ |
| 265 | - if($("#rq").val()!=""){ | |
| 252 | + var jyglGsdm=$("#jyglListGsdmId").val(); | |
| 253 | + var jyglFgsdm=$("#jyglListFgsdmId").val(); | |
| 254 | + if($("#rq").val()==""||$("#rq").val()==null){ | |
| 255 | + layer.msg('请选择日期.'); | |
| 256 | + }else if(jyglGsdm=="" || jyglGsdm==null || jyglFgsdm=="" || jyglFgsdm==null){ | |
| 257 | + layer.msg('请选择公司和分公司.'); | |
| 258 | + }else{ | |
| 266 | 259 | var cells = $('tr.filter')[0].cells |
| 267 | 260 | ,params = {} |
| 268 | 261 | ,name; |
| ... | ... | @@ -277,8 +270,6 @@ $(function(){ |
| 277 | 270 | }); |
| 278 | 271 | page = 0; |
| 279 | 272 | jsDoQuery(params, true); |
| 280 | - }else{ | |
| 281 | - layer.msg('请选择日期.'); | |
| 282 | 273 | } |
| 283 | 274 | }); |
| 284 | 275 | |
| ... | ... | @@ -296,7 +287,7 @@ $(function(){ |
| 296 | 287 | params['rq']=$("#rq").val(); |
| 297 | 288 | |
| 298 | 289 | var i = 2; |
| 299 | - var jyglGsdm=$("#jyglListGsdmId").val(); | |
| 290 | + /* var jyglGsdm=$("#jyglListGsdmId").val(); | |
| 300 | 291 | var jyglFgsdm=$("#jyglListFgsdmId").val(); |
| 301 | 292 | if(jyglGsdm=="" || jyglGsdm==null){ |
| 302 | 293 | params['gsdm_in']=gsqx; |
| ... | ... | @@ -314,7 +305,7 @@ $(function(){ |
| 314 | 305 | } |
| 315 | 306 | params['fgsdm_in']=fgsqx1; |
| 316 | 307 | } |
| 317 | - } | |
| 308 | + } */ | |
| 318 | 309 | $get('/cwjy/pagequery' ,params, function(data){ |
| 319 | 310 | $.each(data.dataList, function(i, obj) { |
| 320 | 311 | obj.yyrq = $("#rq").val(); | ... | ... |
src/main/resources/static/pages/oil/jyszList.html
| ... | ... | @@ -127,22 +127,23 @@ $(function(){ |
| 127 | 127 | checkboxClass: 'icheckbox_flat-blue', |
| 128 | 128 | increaseArea: '20%' |
| 129 | 129 | } |
| 130 | - var gsqx=""; | |
| 131 | - var fgsqx=""; | |
| 130 | +// var gsqx=""; | |
| 131 | +// var fgsqx=""; | |
| 132 | 132 | $.get('/user/companyData', function(result){ |
| 133 | 133 | obj = result; |
| 134 | - var options = '<option value="">请选择</option>'; | |
| 134 | + var options = ''; | |
| 135 | +// '<option value="">请选择</option>'; | |
| 135 | 136 | for(var i = 0; i < obj.length; i++){ |
| 136 | 137 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 137 | - setFgsqx(obj[i].companyCode); | |
| 138 | - gsqx +=obj[i].companyCode+","; | |
| 138 | +// setFgsqx(obj[i].companyCode); | |
| 139 | +// gsqx +=obj[i].companyCode+","; | |
| 139 | 140 | } |
| 140 | 141 | $('#jyszListGsdmId').html(options); |
| 141 | 142 | updateCompany(); |
| 142 | - jsDoQuery(null,true); | |
| 143 | +// jsDoQuery(null,true); | |
| 143 | 144 | }); |
| 144 | 145 | |
| 145 | - function setFgsqx(gs){ | |
| 146 | + /* function setFgsqx(gs){ | |
| 146 | 147 | var company =gs |
| 147 | 148 | for(var i = 0; i < obj.length; i++){ |
| 148 | 149 | if(obj[i].companyCode == company){ |
| ... | ... | @@ -152,7 +153,7 @@ $(function(){ |
| 152 | 153 | } |
| 153 | 154 | } |
| 154 | 155 | } |
| 155 | - } | |
| 156 | + } */ | |
| 156 | 157 | $("#jyszListGsdmId").on("change",updateCompany); |
| 157 | 158 | function updateCompany(){ |
| 158 | 159 | var company = $('#jyszListGsdmId').val(); |
| ... | ... | @@ -160,7 +161,7 @@ $(function(){ |
| 160 | 161 | for(var i = 0; i < obj.length; i++){ |
| 161 | 162 | if(obj[i].companyCode == company){ |
| 162 | 163 | var children = obj[i].children; |
| 163 | - options += '<option value="">请选择</option>'; | |
| 164 | +// options += '<option value="">请选择</option>'; | |
| 164 | 165 | for(var j = 0; j < children.length; j++){ |
| 165 | 166 | options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; |
| 166 | 167 | } |
| ... | ... | @@ -173,25 +174,31 @@ $(function(){ |
| 173 | 174 | //重置 |
| 174 | 175 | $('tr.filter .filter-cancel').on('click', function(){ |
| 175 | 176 | $('tr.filter input, select').val('').change(); |
| 176 | - jsDoQuery(null, true); | |
| 177 | + //jsDoQuery(null, true); | |
| 177 | 178 | }); |
| 178 | 179 | |
| 179 | 180 | //提交 |
| 180 | 181 | $('tr.filter .filter-submit').on('click', function(){ |
| 181 | - var cells = $('tr.filter')[0].cells | |
| 182 | - ,params = {} | |
| 183 | - ,name; | |
| 184 | - $.each(cells, function(i, cell){ | |
| 185 | - var items = $('input,select', cell); | |
| 186 | - for(var j = 0, item; item = items[j++];){ | |
| 187 | - name = $(item).attr('name'); | |
| 188 | - if(name){ | |
| 189 | - params[name] = $(item).val(); | |
| 182 | + var jyszGsdm=$("#jyszListGsdmId").val(); | |
| 183 | + var jyszFgsdm=$("#jyszListFgsdmId").val(); | |
| 184 | + if(jyszGsdm=="" || jyszGsdm==null ||jyszFgsdm==""||jyszFgsdm==null){ | |
| 185 | + layer.msg('请选择公司和分公司.'); | |
| 186 | + }else{ | |
| 187 | + var cells = $('tr.filter')[0].cells | |
| 188 | + ,params = {} | |
| 189 | + ,name; | |
| 190 | + $.each(cells, function(i, cell){ | |
| 191 | + var items = $('input,select', cell); | |
| 192 | + for(var j = 0, item; item = items[j++];){ | |
| 193 | + name = $(item).attr('name'); | |
| 194 | + if(name){ | |
| 195 | + params[name] = $(item).val(); | |
| 196 | + } | |
| 190 | 197 | } |
| 191 | - } | |
| 192 | - }); | |
| 193 | - page = 0; | |
| 194 | - jsDoQuery(params, true); | |
| 198 | + }); | |
| 199 | + page = 0; | |
| 200 | + jsDoQuery(params, true); | |
| 201 | + } | |
| 195 | 202 | }); |
| 196 | 203 | |
| 197 | 204 | /* |
| ... | ... | @@ -205,8 +212,8 @@ $(function(){ |
| 205 | 212 | //更新时间排序 |
| 206 | 213 | params['order'] = 'nbbm'; |
| 207 | 214 | params['page'] = page; |
| 208 | - var i = layer.load(2); | |
| 209 | - var jyszGsdm=$("#jyszListGsdmId").val(); | |
| 215 | + var i = 2; | |
| 216 | + /* var jyszGsdm=$("#jyszListGsdmId").val(); | |
| 210 | 217 | var jyszFgsdm=$("#jyszListFgsdmId").val(); |
| 211 | 218 | if(jyszGsdm==''|| jyszGsdm==null){ |
| 212 | 219 | params['gsdm_in']=gsqx; |
| ... | ... | @@ -224,7 +231,7 @@ $(function(){ |
| 224 | 231 | } |
| 225 | 232 | params['fgsdm_in']=fgsqx1; |
| 226 | 233 | } |
| 227 | - } | |
| 234 | + } */ | |
| 228 | 235 | $get('/cwjy' ,params, function(data){ |
| 229 | 236 | $.each(data.content, function(i, obj) { |
| 230 | 237 | obj.createDate = moment(obj.createDate).format("YYYY-MM-DD"); | ... | ... |
src/main/resources/static/pages/oil/list.html
| ... | ... | @@ -58,45 +58,45 @@ |
| 58 | 58 | id="datatable_ylb"> |
| 59 | 59 | <thead> |
| 60 | 60 | <tr role="row" class="filter"> |
| 61 | - <td colspan="3"> | |
| 62 | - <!-- 公司: | |
| 63 | - <select name="ssgsdm" id="ssgsdm"> | |
| 64 | - <option value="">请选择...</option> | |
| 65 | - <option value="1">可用</option> | |
| 66 | - <option value="0">禁用</option> | |
| 67 | - </select> --> | |
| 61 | + <td> 公司:</td> | |
| 62 | + <td colspan="2"> | |
| 63 | + | |
| 64 | + <select class="form-control" name="ssgsdm_like" id="ylbListGsdmId" ></select> | |
| 65 | + | |
| 68 | 66 | </td> |
| 69 | 67 | <td> |
| 70 | - <!-- <select name="fgsdm"> --> | |
| 71 | - <!-- <option value="">请选择...</option> --> | |
| 72 | - <!-- <option value="1">可用</option> --> | |
| 73 | - <!-- <option value="0">禁用</option> --> | |
| 74 | - <!-- </select> --> | |
| 75 | - | |
| 76 | - 日期: | |
| 68 | + 分公司: | |
| 77 | 69 | </td> |
| 78 | 70 | <td colspan="2"> |
| 71 | + | |
| 72 | + <select class="form-control" name="fgsdm_like" id="ylbListFgsdmId" ></select> | |
| 73 | + </td> | |
| 74 | + | |
| 75 | + <td> | |
| 76 | + 日期: | |
| 77 | + </td> | |
| 78 | + <td> | |
| 79 | 79 | <input type="text" style="width: 80px" name="rq" id="rq"/> |
| 80 | 80 | </td> |
| 81 | - <td colspan="2"> | |
| 82 | - 线路: | |
| 81 | + <td > | |
| 82 | + 线路: | |
| 83 | 83 | </td> |
| 84 | 84 | <td colspan="3"> |
| 85 | 85 | <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select> |
| 86 | 86 | |
| 87 | 87 | </td> |
| 88 | - <td colspan="2"> | |
| 89 | - 内部编码: | |
| 88 | + <td > | |
| 89 | + 内部编码: | |
| 90 | 90 | </td> |
| 91 | 91 | <td colspan="3"> |
| 92 | 92 | <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select> |
| 93 | 93 | </td> |
| 94 | 94 | <td colspan="4"> |
| 95 | - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"> | |
| 95 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px"> | |
| 96 | 96 | <i class="fa fa-search"></i> 搜索 |
| 97 | 97 | </button> |
| 98 | 98 | |
| 99 | - <button class="btn btn-sm red btn-outline filter-cancel"> | |
| 99 | + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> | |
| 100 | 100 | <i class="fa fa-times"></i> 重置 |
| 101 | 101 | </button> |
| 102 | 102 | |
| ... | ... | @@ -315,9 +315,6 @@ |
| 315 | 315 | locale: 'zh-cn' |
| 316 | 316 | }); |
| 317 | 317 | |
| 318 | - if ($("#rq").val() != "") { | |
| 319 | - jsDoQuery(null, true); | |
| 320 | - } | |
| 321 | 318 | var page = 0, initPagination; |
| 322 | 319 | var icheckOptions = { |
| 323 | 320 | radioClass: 'iradio_square-blue icheck', |
| ... | ... | @@ -331,7 +328,14 @@ |
| 331 | 328 | |
| 332 | 329 | //提交 |
| 333 | 330 | $('tr.filter .filter-submit').on('click', function () { |
| 334 | - if ($("#rq").val() != "") { | |
| 331 | + var ylbGsdm=$("#ylbListGsdmId").val(); | |
| 332 | + var ylbFgsdm=$("#ylbListFgsdmId").val(); | |
| 333 | + console.log(); | |
| 334 | + if ($("#rq").val() == "" || $("#rq").val() ==null){ | |
| 335 | + layer.msg('请选择日期.'); | |
| 336 | + }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){ | |
| 337 | + layer.msg('请选择公司和分公司.'); | |
| 338 | + }else { | |
| 335 | 339 | var cells = $('tr.filter')[0].cells |
| 336 | 340 | , params = {} |
| 337 | 341 | , name; |
| ... | ... | @@ -346,11 +350,51 @@ |
| 346 | 350 | }); |
| 347 | 351 | page = 0; |
| 348 | 352 | jsDoQuery(params, true); |
| 349 | - } else { | |
| 350 | - layer.msg('请选择日期.'); | |
| 351 | - } | |
| 353 | + } | |
| 352 | 354 | }); |
| 353 | 355 | |
| 356 | + | |
| 357 | +// var gsqxdm=""; | |
| 358 | + | |
| 359 | + | |
| 360 | + $.get('/user/companyData', function(result){ | |
| 361 | + obj = result; | |
| 362 | + var options=""; | |
| 363 | +// = '<option value="">请选择</option>'; | |
| 364 | + for(var i = 0; i < obj.length; i++){ | |
| 365 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 366 | +// setFgsqx(obj[i].companyCode); | |
| 367 | + } | |
| 368 | + $('#ylbListGsdmId').html(options); | |
| 369 | + updateCompany(); | |
| 370 | + }); | |
| 371 | + /* function setFgsqx(gs){ | |
| 372 | + var company =gs | |
| 373 | + var options = ''; | |
| 374 | + for(var i = 0; i < obj.length; i++){ | |
| 375 | + if(obj[i].companyCode == company){ | |
| 376 | + var children = obj[i].children; | |
| 377 | + for(var j = 0; j < children.length; j++){ | |
| 378 | + gsqxdm +=company+""+children[j].code+","; | |
| 379 | + } | |
| 380 | + } | |
| 381 | + } | |
| 382 | + } */ | |
| 383 | + $("#ylbListGsdmId").on("change",updateCompany); | |
| 384 | + function updateCompany(){ | |
| 385 | + var company = $('#ylbListGsdmId').val(); | |
| 386 | + var options =""; | |
| 387 | +// = '<option value="">请选择</option>'; | |
| 388 | + for(var i = 0; i < obj.length; i++){ | |
| 389 | + if(obj[i].companyCode == company){ | |
| 390 | + var children = obj[i].children; | |
| 391 | + for(var j = 0; j < children.length; j++){ | |
| 392 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 393 | + } | |
| 394 | + } | |
| 395 | + } | |
| 396 | + $('#ylbListFgsdmId').html(options); | |
| 397 | + } | |
| 354 | 398 | /* |
| 355 | 399 | * 获取数据 p: 要提交的参数, pagination: 是否重新分页 |
| 356 | 400 | */ |
| ... | ... | @@ -362,6 +406,25 @@ |
| 362 | 406 | params['order'] = 'nbbm'; |
| 363 | 407 | params['page'] = page; |
| 364 | 408 | params['rq'] = $("#rq").val(); |
| 409 | + | |
| 410 | + /* var ylbGsdm=$("#ylbListGsdmId").val(); | |
| 411 | + var ylbFgsdm=$("#ylbListFgsdmId").val(); | |
| 412 | + if(ylbGsdm==''|| ylbGsdm==null){ | |
| 413 | + params['concat(ssgsdm,fgsdm)_in']=gsqxdm; | |
| 414 | + }else{ | |
| 415 | + if(ylbFgsdm==''||ylbFgsdm==null){ | |
| 416 | + var fgsqx1=''; | |
| 417 | + for(var i = 0; i < obj.length; i++){ | |
| 418 | + if(obj[i].companyCode == ylbGsdm){ | |
| 419 | + var children = obj[i].children; | |
| 420 | + for(var j = 0; j < children.length; j++){ | |
| 421 | + fgsqx1 +=children[j].code+","; | |
| 422 | + } | |
| 423 | + } | |
| 424 | + } | |
| 425 | + params['fgsdm_in']=fgsqx1; | |
| 426 | + } | |
| 427 | + } */ | |
| 365 | 428 | var i = layer.load(2); |
| 366 | 429 | $get('/ylb', params, function (data) { |
| 367 | 430 | $.each(data.content, function (i, obj) { | ... | ... |
src/main/resources/static/pages/report/inoutstation.html
| ... | ... | @@ -36,7 +36,7 @@ |
| 36 | 36 | </div> |
| 37 | 37 | <div style="display: inline-block;margin-left: 15px;"> |
| 38 | 38 | <span class="item-label" style="width: 80px;">线路: </span> |
| 39 | - <select class="form-control" name="line" id="line" onchange="sreachZd()" style="width: 180px;"></select> | |
| 39 | + <select class="form-control sreach-zd" name="line" id="line" style="width: 180px;"></select> | |
| 40 | 40 | </div> |
| 41 | 41 | </div> |
| 42 | 42 | <br/> |
| ... | ... | @@ -58,7 +58,7 @@ |
| 58 | 58 | <span class="item-label" style="width: 60px;">至: </span> |
| 59 | 59 | <input class="form-control" type="text" id="date2" style="width: 180px;"/> |
| 60 | 60 | <span class="item-label" style="width: 80px;">站点: </span> |
| 61 | - <select id="zdlx" onchange="sreachZd()"> | |
| 61 | + <select id="zdlx" class="sreach-zd" > | |
| 62 | 62 | <option value="">请选择</option> |
| 63 | 63 | <option value="0">上行</option> |
| 64 | 64 | <option value="1">下行</option> |
| ... | ... | @@ -68,7 +68,7 @@ |
| 68 | 68 | </div> |
| 69 | 69 | <div class="form-group" style="display: inline-block;margin-left: 15px;"> |
| 70 | 70 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 71 | - <input class="btn btn-default" type="button" style="display: none;" onclick="clzd()" id="query2" value="查询"/> | |
| 71 | + <input class="btn btn-default" type="button" style="display: none;" id="query2" value="查询"/> | |
| 72 | 72 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 73 | 73 | <input class="btn btn-default" type="button" id="print" value="打印"/> |
| 74 | 74 | <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/> |
| ... | ... | @@ -176,7 +176,6 @@ |
| 176 | 176 | for(var code in result){ |
| 177 | 177 | data.push({id: code, text: result[code]}); |
| 178 | 178 | } |
| 179 | - console.log(data); | |
| 180 | 179 | initPinYinSelect2('#line',data,''); |
| 181 | 180 | |
| 182 | 181 | }) |
| ... | ... | @@ -195,7 +194,6 @@ |
| 195 | 194 | }else{ |
| 196 | 195 | $post('/report/queryListBczx',{clzbh:clzbh,date:date,line:line},function(result){ |
| 197 | 196 | getTime(result); |
| 198 | - console.log(result); | |
| 199 | 197 | var ludan_ll_2 = template('ludan_ll_2',{list:result}); |
| 200 | 198 | // 把渲染好的模版html文本追加到表格中 |
| 201 | 199 | $('#forms .ludan_ll_2').html(ludan_ll_2); |
| ... | ... | @@ -279,111 +277,119 @@ |
| 279 | 277 | return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; |
| 280 | 278 | } |
| 281 | 279 | } |
| 282 | - }) | |
| 283 | - | |
| 284 | - }); | |
| 285 | - | |
| 286 | - | |
| 287 | - function zdxx(fcsj,ddsj){ | |
| 288 | - var rq=$("#date").val(); | |
| 289 | - var line=$("#line").val(); | |
| 290 | - var nbbm=$("#nbbm").val(); | |
| 280 | + }); | |
| 291 | 281 | |
| 292 | - $post('/report/queryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){ | |
| 293 | - var xlmc="线路: "+$("#select2-line-container").html(); | |
| 294 | - var clmc="车辆: "+nbbm; | |
| 295 | - var rqmc="日期: "+rq; | |
| 296 | - var bcmc="班次: "+fcsj+"-"+ddsj; | |
| 297 | - $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc); | |
| 298 | - console.log(result); | |
| 299 | - var ludan_ll_1 = template('ludan_ll_1',{list:result}); | |
| 300 | - // 把渲染好的模版html文本追加到表格中 | |
| 301 | - $('#forms1 .ludan_ll_1').html(ludan_ll_1); | |
| 282 | + $("#forms tbody").on("click","tr",function(){ | |
| 283 | + var rq=$("#date").val(); | |
| 284 | + var line=$("#line").val(); | |
| 285 | + var nbbm=$("#nbbm").val(); | |
| 286 | + var params = new Array(); | |
| 287 | + if($(this).children().size() < 2){ | |
| 288 | + return; | |
| 289 | + } | |
| 290 | + | |
| 291 | + $(this).children().each(function(index){ | |
| 292 | + params[index] = $(this).text(); | |
| 302 | 293 | }); |
| 294 | + var id=params[0].split("\\")[0]; | |
| 295 | + var fcsj = $('.in_carpark_fcsj[data-id='+id+']', '#forms').html(); | |
| 296 | + var ddsj= $('.in_carpark_zdsj[data-id='+id+']', '#forms').html(); | |
| 297 | + | |
| 298 | + $post('/report/queryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){ | |
| 299 | + var xlmc="线路: "+$("#select2-line-container").html(); | |
| 300 | + var clmc="车辆: "+nbbm; | |
| 301 | + var rqmc="日期: "+rq; | |
| 302 | + var bcmc="班次: "+fcsj+"-"+ddsj; | |
| 303 | + $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc); | |
| 304 | + var ludan_ll_1 = template('ludan_ll_1',{list:result}); | |
| 305 | + // 把渲染好的模版html文本追加到表格中 | |
| 306 | + $('#forms1 .ludan_ll_1').html(ludan_ll_1); | |
| 307 | + }); | |
| 308 | + }) | |
| 303 | 309 | |
| 304 | - } | |
| 305 | - | |
| 306 | - function clzd(){ | |
| 307 | - var date1=$("#date1").val(); | |
| 308 | - var date2=$("#date2").val(); | |
| 309 | - var line=$("#line").val(); | |
| 310 | - var zdlx=$("#zdlx").val(); | |
| 311 | - var zd=$("#zd").val(); | |
| 312 | - console.log(nbbm); | |
| 313 | - if(date1=="" || date1==null){ | |
| 314 | - layer.msg("请选择时间"); | |
| 315 | - }else if( line=="" || line==null){ | |
| 316 | - layer.msg("请选择线路"); | |
| 317 | - }else if(date2 ==null || date2==""){ | |
| 318 | - layer.msg("请选择时间"); | |
| 319 | - }else if(zdlx=="" || zdlx==null){ | |
| 320 | - layer.msg("请选择方向"); | |
| 321 | - }else{ | |
| 322 | - var xlmc="线路: "+$("#select2-line-container").html(); | |
| 323 | - var rqmc="日期: "+date1+"-"+date2; | |
| 324 | - var sxmc="上下行: "+ zdlx; | |
| 325 | - var zdmc=""; | |
| 326 | - if(zd==null || zd==""){ | |
| 327 | - zdmc="站点: " | |
| 328 | - }else{ | |
| 329 | - zdmc="站点: "+$("#select2-zd-container").html(); | |
| 330 | - } | |
| 331 | - $("#dlzmx").html("到离站详细 "+xlmc+" "+rqmc+" "+sxmc+" "+zdmc); | |
| 332 | - $post('/report/queryListClzd',{zd:zd,zdlx:zdlx,line:line,fcsj:date1,ddsj:date2},function(result){ | |
| 333 | - console.log(result); | |
| 334 | - var ludan_ll_1 = template('ludan_ll_1',{list:result}); | |
| 335 | - // 把渲染好的模版html文本追加到表格中 | |
| 336 | - $('#forms1 .ludan_ll_1').html(ludan_ll_1); | |
| 337 | - }); | |
| 338 | - } | |
| 339 | - } | |
| 340 | - | |
| 341 | - function sreachZd(){ | |
| 342 | - var line = $("#line").val(); | |
| 343 | - var zdlx = $("#zdlx").val(); | |
| 344 | - if(line==null|| line =="" || zdlx ==null || zdlx==""){ | |
| 345 | - | |
| 346 | - }else{ | |
| 347 | - $('#zd').select2({ | |
| 348 | - placeholder: '搜索站点...', | |
| 349 | - ajax: { | |
| 350 | - url: '/report/sreachZd', | |
| 351 | - dataType: 'json', | |
| 352 | - delay: 150, | |
| 353 | - data: function(params){ | |
| 354 | - return{line: line,zdlx:zdlx,zd:params.term}; | |
| 310 | + $("#query2").click(function(){ | |
| 311 | + var date1=$("#date1").val(); | |
| 312 | + var date2=$("#date2").val(); | |
| 313 | + var line=$("#line").val(); | |
| 314 | + var zdlx=$("#zdlx").val(); | |
| 315 | + var zd=$("#zd").val(); | |
| 316 | + if(date1=="" || date1==null){ | |
| 317 | + layer.msg("请选择时间"); | |
| 318 | + }else if( line=="" || line==null){ | |
| 319 | + layer.msg("请选择线路"); | |
| 320 | + }else if(date2 ==null || date2==""){ | |
| 321 | + layer.msg("请选择时间"); | |
| 322 | + }else if(zdlx=="" || zdlx==null){ | |
| 323 | + layer.msg("请选择方向"); | |
| 324 | + }else{ | |
| 325 | + var xlmc="线路: "+$("#select2-line-container").html(); | |
| 326 | + var rqmc="日期: "+date1+"-"+date2; | |
| 327 | + var sxmc="上下行: "+ zdlx; | |
| 328 | + var zdmc=""; | |
| 329 | + if(zd==null || zd==""){ | |
| 330 | + zdmc="站点: " | |
| 331 | + }else{ | |
| 332 | + zdmc="站点: "+$("#select2-zd-container").html(); | |
| 333 | + } | |
| 334 | + $("#dlzmx").html("到离站详细 "+xlmc+" "+rqmc+" "+sxmc+" "+zdmc); | |
| 335 | + $post('/report/queryListClzd',{zd:zd,zdlx:zdlx,line:line,fcsj:date1,ddsj:date2},function(result){ | |
| 336 | + var ludan_ll_1 = template('ludan_ll_1',{list:result}); | |
| 337 | + // 把渲染好的模版html文本追加到表格中 | |
| 338 | + $('#forms1 .ludan_ll_1').html(ludan_ll_1); | |
| 339 | + }); | |
| 340 | + } | |
| 341 | + }) | |
| 342 | + | |
| 343 | + $(".sreach-zd").click(function(){ | |
| 344 | + var line = $("#line").val(); | |
| 345 | + var zdlx = $("#zdlx").val(); | |
| 346 | + if(line==null|| line =="" || zdlx ==null || zdlx==""){ | |
| 347 | + | |
| 348 | + }else{ | |
| 349 | + $('#zd').select2({ | |
| 350 | + placeholder: '搜索站点...', | |
| 351 | + ajax: { | |
| 352 | + url: '/report/sreachZd', | |
| 353 | + dataType: 'json', | |
| 354 | + delay: 150, | |
| 355 | + data: function(params){ | |
| 356 | + return{line: line,zdlx:zdlx,zd:params.term}; | |
| 357 | + }, | |
| 358 | + processResults: function (data) { | |
| 359 | + return { | |
| 360 | + results: data | |
| 361 | + }; | |
| 362 | + }, | |
| 363 | + cache: true | |
| 355 | 364 | }, |
| 356 | - processResults: function (data) { | |
| 357 | - return { | |
| 358 | - results: data | |
| 359 | - }; | |
| 360 | - }, | |
| 361 | - cache: true | |
| 362 | - }, | |
| 363 | - templateResult: function(repo){ | |
| 364 | - if (repo.loading) return repo.text; | |
| 365 | - var h = '<span>'+repo.text+'</span>'; | |
| 366 | - return h; | |
| 367 | - }, | |
| 368 | - escapeMarkup: function (markup) { return markup; }, | |
| 369 | - minimumInputLength: 1, | |
| 370 | - templateSelection: function(repo){ | |
| 371 | - return repo.text; | |
| 372 | - }, | |
| 373 | - language: { | |
| 374 | - noResults: function(){ | |
| 375 | - return '<span style="color:red;font-size: 12px;">没有搜索到站点!</span>'; | |
| 376 | - }, | |
| 377 | - inputTooShort : function(e) { | |
| 378 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入站点名称</span>'; | |
| 379 | - }, | |
| 380 | - searching : function() { | |
| 381 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索站点...</span>'; | |
| 382 | - } | |
| 383 | - } | |
| 384 | - }); | |
| 385 | - } | |
| 386 | - } | |
| 365 | + templateResult: function(repo){ | |
| 366 | + if (repo.loading) return repo.text; | |
| 367 | + var h = '<span>'+repo.text+'</span>'; | |
| 368 | + return h; | |
| 369 | + }, | |
| 370 | + escapeMarkup: function (markup) { return markup; }, | |
| 371 | + minimumInputLength: 1, | |
| 372 | + templateSelection: function(repo){ | |
| 373 | + return repo.text; | |
| 374 | + }, | |
| 375 | + language: { | |
| 376 | + noResults: function(){ | |
| 377 | + return '<span style="color:red;font-size: 12px;">没有搜索到站点!</span>'; | |
| 378 | + }, | |
| 379 | + inputTooShort : function(e) { | |
| 380 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入站点名称</span>'; | |
| 381 | + }, | |
| 382 | + searching : function() { | |
| 383 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索站点...</span>'; | |
| 384 | + } | |
| 385 | + } | |
| 386 | + }); | |
| 387 | + } | |
| 388 | + }) | |
| 389 | + | |
| 390 | + | |
| 391 | + }); | |
| 392 | + | |
| 387 | 393 | </script> |
| 388 | 394 | <script type="text/html" id="ludan_ll_1"> |
| 389 | 395 | {{each list as obj i}} |
| ... | ... | @@ -426,7 +432,7 @@ |
| 426 | 432 | {{else if obj.status==-1}} |
| 427 | 433 | (已烂班 ) |
| 428 | 434 | {{else}} |
| 429 | - <a onclick='zdxx("{{obj.fcsjActual}}","{{obj.zdsjActual}}")'> | |
| 435 | + <a > | |
| 430 | 436 | ({{obj.fcsjActual}} |
| 431 | 437 | {{if obj.fast>0}} |
| 432 | 438 | 早点 {{obj.fast}}分钟 |
| ... | ... | @@ -436,6 +442,8 @@ |
| 436 | 442 | 整点 |
| 437 | 443 | {{/if}} |
| 438 | 444 | ) |
| 445 | + <span class="in_carpark_fcsj" data-id="{{i+1}}" style="display:none">{{obj.fcsjActual}}</span> | |
| 446 | + <span class="in_carpark_zdsj" data-id="{{i+1}}" style="display:none">{{obj.zdsjActual}}</span> | |
| 439 | 447 | </a> |
| 440 | 448 | {{/if}} |
| 441 | 449 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/service.js
| 1 | -// 车辆信息service | |
| 2 | -angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) { | |
| 3 | - return { | |
| 4 | - rest: $resource( | |
| 5 | - '/cars_sc/:id', | |
| 6 | - {order: 'carCode', direction: 'ASC', id: '@id_route'}, | |
| 7 | - { | |
| 8 | - list: { | |
| 9 | - method: 'GET', | |
| 10 | - params: { | |
| 11 | - page: 0 | |
| 12 | - }, | |
| 13 | - transformResponse: function(rs) { | |
| 14 | - var dst = angular.fromJson(rs); | |
| 15 | - if (dst.status == 'SUCCESS') { | |
| 16 | - return dst.data; | |
| 17 | - } else { | |
| 18 | - return dst; // 业务错误留给控制器处理 | |
| 19 | - } | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - get: { | |
| 23 | - method: 'GET', | |
| 24 | - transformResponse: function(rs) { | |
| 25 | - var dst = angular.fromJson(rs); | |
| 26 | - if (dst.status == 'SUCCESS') { | |
| 27 | - return dst.data; | |
| 28 | - } else { | |
| 29 | - return dst; | |
| 30 | - } | |
| 31 | - } | |
| 32 | - }, | |
| 33 | - save: { | |
| 34 | - method: 'POST' | |
| 35 | - } | |
| 36 | - } | |
| 37 | - ), | |
| 38 | - import: $resource( | |
| 39 | - '/cars/importfile', | |
| 40 | - {}, | |
| 41 | - { | |
| 42 | - do: { | |
| 43 | - method: 'POST', | |
| 44 | - headers: { | |
| 45 | - 'Content-Type': 'application/x-www-form-urlencoded' | |
| 46 | - }, | |
| 47 | - transformRequest: function(obj) { | |
| 48 | - var str = []; | |
| 49 | - for (var p in obj) { | |
| 50 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | |
| 51 | - } | |
| 52 | - return str.join("&"); | |
| 53 | - } | |
| 54 | - } | |
| 55 | - } | |
| 56 | - ), | |
| 57 | - validate: $resource( | |
| 58 | - '/cars/validate/:type', | |
| 59 | - {}, | |
| 60 | - { | |
| 61 | - insideCode: { | |
| 62 | - method: 'GET' | |
| 63 | - } | |
| 64 | - } | |
| 65 | - ), | |
| 66 | - dataTools: $resource( | |
| 67 | - '/cars/:type', | |
| 68 | - {}, | |
| 69 | - { | |
| 70 | - dataExport: { | |
| 71 | - method: 'GET', | |
| 72 | - responseType: "arraybuffer", | |
| 73 | - params: { | |
| 74 | - type: "dataExport" | |
| 75 | - }, | |
| 76 | - transformResponse: function(data, headers){ | |
| 77 | - return {data : data}; | |
| 78 | - } | |
| 79 | - } | |
| 80 | - } | |
| 81 | - ) | |
| 82 | - }; | |
| 1 | +// 车辆信息service | |
| 2 | +angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) { | |
| 3 | + return { | |
| 4 | + rest: $resource( | |
| 5 | + '/cars_sc/:id', | |
| 6 | + {order: 'carCode', direction: 'ASC', id: '@id_route'}, | |
| 7 | + { | |
| 8 | + list: { | |
| 9 | + method: 'GET', | |
| 10 | + params: { | |
| 11 | + page: 0 | |
| 12 | + }, | |
| 13 | + transformResponse: function(rs) { | |
| 14 | + var dst = angular.fromJson(rs); | |
| 15 | + if (dst.status == 'SUCCESS') { | |
| 16 | + return dst.data; | |
| 17 | + } else { | |
| 18 | + return dst; // 业务错误留给控制器处理 | |
| 19 | + } | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + get: { | |
| 23 | + method: 'GET', | |
| 24 | + transformResponse: function(rs) { | |
| 25 | + var dst = angular.fromJson(rs); | |
| 26 | + if (dst.status == 'SUCCESS') { | |
| 27 | + return dst.data; | |
| 28 | + } else { | |
| 29 | + return dst; | |
| 30 | + } | |
| 31 | + } | |
| 32 | + }, | |
| 33 | + save: { | |
| 34 | + method: 'POST' | |
| 35 | + } | |
| 36 | + } | |
| 37 | + ), | |
| 38 | + import: $resource( | |
| 39 | + '/cars/importfile', | |
| 40 | + {}, | |
| 41 | + { | |
| 42 | + do: { | |
| 43 | + method: 'POST', | |
| 44 | + headers: { | |
| 45 | + 'Content-Type': 'application/x-www-form-urlencoded' | |
| 46 | + }, | |
| 47 | + transformRequest: function(obj) { | |
| 48 | + var str = []; | |
| 49 | + for (var p in obj) { | |
| 50 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | |
| 51 | + } | |
| 52 | + return str.join("&"); | |
| 53 | + } | |
| 54 | + } | |
| 55 | + } | |
| 56 | + ), | |
| 57 | + validate: $resource( | |
| 58 | + '/cars/validate/:type', | |
| 59 | + {}, | |
| 60 | + { | |
| 61 | + insideCode: { | |
| 62 | + method: 'GET' | |
| 63 | + } | |
| 64 | + } | |
| 65 | + ), | |
| 66 | + dataTools: $resource( | |
| 67 | + '/cars/:type', | |
| 68 | + {}, | |
| 69 | + { | |
| 70 | + dataExport: { | |
| 71 | + method: 'GET', | |
| 72 | + responseType: "arraybuffer", | |
| 73 | + params: { | |
| 74 | + type: "dataExport" | |
| 75 | + }, | |
| 76 | + transformResponse: function(data, headers){ | |
| 77 | + return {data : data}; | |
| 78 | + } | |
| 79 | + } | |
| 80 | + } | |
| 81 | + ) | |
| 82 | + }; | |
| 83 | 83 | }]); |
| 84 | 84 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/service.js
| 1 | -// 车辆设备信息service | |
| 2 | -angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | |
| 3 | - return $resource( | |
| 4 | - '/cde/:id', | |
| 5 | - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'}, | |
| 6 | - { | |
| 7 | - list: { | |
| 8 | - method: 'GET', | |
| 9 | - params: { | |
| 10 | - page: 0 | |
| 11 | - } | |
| 12 | - }, | |
| 13 | - get: { | |
| 14 | - method: 'GET' | |
| 15 | - }, | |
| 16 | - save: { | |
| 17 | - method: 'POST' | |
| 18 | - }, | |
| 19 | - delete: { | |
| 20 | - method: 'DELETE' | |
| 21 | - } | |
| 22 | - } | |
| 23 | - ); | |
| 1 | +// 车辆设备信息service | |
| 2 | +angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | |
| 3 | + return $resource( | |
| 4 | + '/cde/:id', | |
| 5 | + {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'}, | |
| 6 | + { | |
| 7 | + list: { | |
| 8 | + method: 'GET', | |
| 9 | + params: { | |
| 10 | + page: 0 | |
| 11 | + } | |
| 12 | + }, | |
| 13 | + get: { | |
| 14 | + method: 'GET' | |
| 15 | + }, | |
| 16 | + save: { | |
| 17 | + method: 'POST' | |
| 18 | + }, | |
| 19 | + delete: { | |
| 20 | + method: 'DELETE' | |
| 21 | + } | |
| 22 | + } | |
| 23 | + ); | |
| 24 | 24 | }]); |
| 25 | 25 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/service.js
| 1 | -// 人员信息service | |
| 2 | -angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) { | |
| 3 | - return { | |
| 4 | - rest : $resource( | |
| 5 | - '/personnel/:id', | |
| 6 | - {order: 'jobCode', direction: 'ASC', id: '@id_route'}, | |
| 7 | - { | |
| 8 | - list: { | |
| 9 | - method: 'GET', | |
| 10 | - params: { | |
| 11 | - page: 0 | |
| 12 | - } | |
| 13 | - }, | |
| 14 | - get: { | |
| 15 | - method: 'GET' | |
| 16 | - }, | |
| 17 | - save: { | |
| 18 | - method: 'POST' | |
| 19 | - } | |
| 20 | - } | |
| 21 | - ), | |
| 22 | - validate: $resource( | |
| 23 | - '/personnel/validate/:type', | |
| 24 | - {}, | |
| 25 | - { | |
| 26 | - jobCode: { | |
| 27 | - method: 'GET' | |
| 28 | - } | |
| 29 | - } | |
| 30 | - ), | |
| 31 | - dataTools: $resource( | |
| 32 | - '/personnel/:type', | |
| 33 | - {}, | |
| 34 | - { | |
| 35 | - dataExport: { | |
| 36 | - method: 'GET', | |
| 37 | - responseType: "arraybuffer", | |
| 38 | - params: { | |
| 39 | - type: "dataExport" | |
| 40 | - }, | |
| 41 | - transformResponse: function(data, headers){ | |
| 42 | - return {data : data}; | |
| 43 | - } | |
| 44 | - } | |
| 45 | - } | |
| 46 | - ) | |
| 47 | - }; | |
| 48 | -}]); | |
| 1 | +// 人员信息service | |
| 2 | +angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) { | |
| 3 | + return { | |
| 4 | + rest : $resource( | |
| 5 | + '/personnel/:id', | |
| 6 | + {order: 'jobCode', direction: 'ASC', id: '@id_route'}, | |
| 7 | + { | |
| 8 | + list: { | |
| 9 | + method: 'GET', | |
| 10 | + params: { | |
| 11 | + page: 0 | |
| 12 | + } | |
| 13 | + }, | |
| 14 | + get: { | |
| 15 | + method: 'GET' | |
| 16 | + }, | |
| 17 | + save: { | |
| 18 | + method: 'POST' | |
| 19 | + } | |
| 20 | + } | |
| 21 | + ), | |
| 22 | + validate: $resource( | |
| 23 | + '/personnel/validate/:type', | |
| 24 | + {}, | |
| 25 | + { | |
| 26 | + jobCode: { | |
| 27 | + method: 'GET' | |
| 28 | + } | |
| 29 | + } | |
| 30 | + ), | |
| 31 | + dataTools: $resource( | |
| 32 | + '/personnel/:type', | |
| 33 | + {}, | |
| 34 | + { | |
| 35 | + dataExport: { | |
| 36 | + method: 'GET', | |
| 37 | + responseType: "arraybuffer", | |
| 38 | + params: { | |
| 39 | + type: "dataExport" | |
| 40 | + }, | |
| 41 | + transformResponse: function(data, headers){ | |
| 42 | + return {data : data}; | |
| 43 | + } | |
| 44 | + } | |
| 45 | + } | |
| 46 | + ) | |
| 47 | + }; | |
| 48 | +}]); | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/directives/select/mySelect.js
| 1 | -/** | |
| 2 | - * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选 | |
| 3 | - * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够 | |
| 4 | - * cmoptions(必须):描述绑定的逻辑配置对象,格式如下: | |
| 5 | - * | |
| 6 | - * // TODO: | |
| 7 | - */ | |
| 8 | -angular.module('ScheduleApp').directive('mySelect', [ | |
| 9 | - function() { | |
| 10 | - return { | |
| 11 | - restrict: 'E', | |
| 12 | - template: '<div>bioxuxuan</div>', | |
| 13 | - require: 'ngModel', | |
| 14 | - compile: function(tElem, tAttrs) { | |
| 15 | - return { | |
| 16 | - pre: function(scope, element, attr) { | |
| 17 | - | |
| 18 | - }, | |
| 19 | - post: function(scope, element, attr, ngModelCtr) { | |
| 20 | - // model -> view | |
| 21 | - ngModelCtr.$formatters.push(function(modelValue) { | |
| 22 | - // 监控model的变化 | |
| 23 | - if (typeof modelValue != "undefined") { | |
| 24 | - console.log(modelValue); | |
| 25 | - | |
| 26 | - return modelValue; | |
| 27 | - } | |
| 28 | - }); | |
| 29 | - | |
| 30 | - ngModelCtr.$render = function() { | |
| 31 | - if (typeof scope.ctrl.say != "undefined") { | |
| 32 | - element.find('div').css('color', 'red'); | |
| 33 | - } | |
| 34 | - }; | |
| 35 | - | |
| 36 | - ngModelCtr.$setViewValue("init value"); | |
| 37 | - | |
| 38 | - | |
| 39 | - } | |
| 40 | - } | |
| 41 | - } | |
| 42 | - } | |
| 43 | - } | |
| 1 | +/** | |
| 2 | + * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选 | |
| 3 | + * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够 | |
| 4 | + * cmoptions(必须):描述绑定的逻辑配置对象,格式如下: | |
| 5 | + * | |
| 6 | + * // TODO: | |
| 7 | + */ | |
| 8 | +angular.module('ScheduleApp').directive('mySelect', [ | |
| 9 | + function() { | |
| 10 | + return { | |
| 11 | + restrict: 'E', | |
| 12 | + template: '<div>bioxuxuan</div>', | |
| 13 | + require: 'ngModel', | |
| 14 | + compile: function(tElem, tAttrs) { | |
| 15 | + return { | |
| 16 | + pre: function(scope, element, attr) { | |
| 17 | + | |
| 18 | + }, | |
| 19 | + post: function(scope, element, attr, ngModelCtr) { | |
| 20 | + // model -> view | |
| 21 | + ngModelCtr.$formatters.push(function(modelValue) { | |
| 22 | + // 监控model的变化 | |
| 23 | + if (typeof modelValue != "undefined") { | |
| 24 | + console.log(modelValue); | |
| 25 | + | |
| 26 | + return modelValue; | |
| 27 | + } | |
| 28 | + }); | |
| 29 | + | |
| 30 | + ngModelCtr.$render = function() { | |
| 31 | + if (typeof scope.ctrl.say != "undefined") { | |
| 32 | + element.find('div').css('color', 'red'); | |
| 33 | + } | |
| 34 | + }; | |
| 35 | + | |
| 36 | + ngModelCtr.$setViewValue("init value"); | |
| 37 | + | |
| 38 | + | |
| 39 | + } | |
| 40 | + } | |
| 41 | + } | |
| 42 | + } | |
| 43 | + } | |
| 44 | 44 | ]); |
| 45 | 45 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/directives/select/mySelectTemplate.html
| 1 | -<div class="input-group" name="指令compile阶段设定1" | |
| 2 | - ng-model="$saSelectCtrl.$$internalmodel"> | |
| 3 | - <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)" | |
| 4 | - theme="bootstrap" > | |
| 5 | - <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定2</ui-select-match> | |
| 6 | - <ui-select-choices repeat="指令compile阶段设定3" | |
| 7 | - refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)" | |
| 8 | - refresh-delay="10"> | |
| 9 | - | |
| 10 | - 指令compile阶段设定777 | |
| 11 | - | |
| 12 | - </ui-select-choices> | |
| 13 | - </ui-select> | |
| 14 | - <span class="input-group-btn"> | |
| 15 | - <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default"> | |
| 16 | - <span class="glyphicon glyphicon-trash"></span> | |
| 17 | - </button> | |
| 18 | - </span> | |
| 1 | +<div class="input-group" name="指令compile阶段设定1" | |
| 2 | + ng-model="$saSelectCtrl.$$internalmodel"> | |
| 3 | + <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)" | |
| 4 | + theme="bootstrap" > | |
| 5 | + <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定2</ui-select-match> | |
| 6 | + <ui-select-choices repeat="指令compile阶段设定3" | |
| 7 | + refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)" | |
| 8 | + refresh-delay="10"> | |
| 9 | + | |
| 10 | + 指令compile阶段设定777 | |
| 11 | + | |
| 12 | + </ui-select-choices> | |
| 13 | + </ui-select> | |
| 14 | + <span class="input-group-btn"> | |
| 15 | + <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default"> | |
| 16 | + <span class="glyphicon glyphicon-trash"></span> | |
| 17 | + </button> | |
| 18 | + </span> | |
| 19 | 19 | </div> |
| 20 | 20 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dts1/validation/remoteValidation.js
| ... | ... | @@ -37,7 +37,7 @@ angular.module('ScheduleApp').directive('remoteValidation', [ |
| 37 | 37 | // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证 |
| 38 | 38 | var isParamAll = true; |
| 39 | 39 | for (var key in paramTemplate) { |
| 40 | - if (!$watch_rvparam_obj[key]) { | |
| 40 | + if (key != "id" && !$watch_rvparam_obj[key]) { // id去掉 | |
| 41 | 41 | isParamAll = false; |
| 42 | 42 | break; |
| 43 | 43 | } |
| ... | ... | @@ -83,9 +83,9 @@ angular.module('ScheduleApp').directive('remoteValidation', [ |
| 83 | 83 | */ |
| 84 | 84 | attr.$observe("remotevparam", function(value) { |
| 85 | 85 | if (value && value != "") { |
| 86 | - if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证 | |
| 87 | - return; | |
| 88 | - } | |
| 86 | + //if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证 | |
| 87 | + // return; | |
| 88 | + //} | |
| 89 | 89 | $watch_rvparam_obj = JSON.parse(value); |
| 90 | 90 | $$internal_validate(ngModelCtrl, scope); |
| 91 | 91 | } | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dts1/validation/remoteValidation3.js
| 1 | -/** | |
| 2 | - * remoteValidationt3 远程验证指令(监控依赖的model变化) | |
| 3 | - * 属性如下: | |
| 4 | - * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl" | |
| 5 | - * remotemodel(必须):关联的model | |
| 6 | - * remotemodelcol(必须):关联的model属性 | |
| 7 | - */ | |
| 8 | -angular.module('ScheduleApp').directive( | |
| 9 | - 'remoteValidation3', | |
| 10 | - [ | |
| 11 | - '$$SearchInfoService_g', | |
| 12 | - '$q', | |
| 13 | - function($$SearchInfoService_g, $q) { | |
| 14 | - return { | |
| 15 | - restrict: 'A', // 属性 | |
| 16 | - require: '^ngModel', // 依赖所属指令的ngModel | |
| 17 | - compile: function(tElem, tAttrs) { | |
| 18 | - var remotevtype_attr = tAttrs['remotevtype']; | |
| 19 | - var remotemodel_attr = tAttrs['remotemodel']; | |
| 20 | - var remotemodelcol_attr = tAttrs['remotemodelcol']; | |
| 21 | - if (!remotevtype_attr) { | |
| 22 | - throw new Error("remotevtype属性必须填写"); | |
| 23 | - } | |
| 24 | - if (!remotemodel_attr) { | |
| 25 | - throw new Error("remotemodel属性必须填写"); | |
| 26 | - } | |
| 27 | - if (!remotemodelcol_attr) { | |
| 28 | - throw new Error("remotemodelcol属性必须填写"); | |
| 29 | - } | |
| 30 | - | |
| 31 | - return { | |
| 32 | - pre: function(scope, element, attr) { | |
| 33 | - | |
| 34 | - }, | |
| 35 | - | |
| 36 | - post: function(scope, element, attr, ngModelCtrl) { | |
| 37 | - ngModelCtrl.$asyncValidators.remote = | |
| 38 | - function(modelValue, viewValue) { | |
| 39 | - var deferred = $q.defer(); | |
| 40 | - | |
| 41 | - // 远端验证service | |
| 42 | - var param = JSON.parse(attr['remotemodel']); | |
| 43 | - console.log(param); | |
| 44 | - param[remotemodelcol_attr] = modelValue; | |
| 45 | - $$SearchInfoService_g.validate[remotevtype_attr].remote.do( | |
| 46 | - param, | |
| 47 | - function(result) { | |
| 48 | - if (result.status == "SUCCESS") { | |
| 49 | - deferred.resolve(); | |
| 50 | - } else { | |
| 51 | - scope.$remote_msg = result.msg; | |
| 52 | - deferred.reject(); | |
| 53 | - } | |
| 54 | - }, | |
| 55 | - function(result) { | |
| 56 | - deferred.reject(); | |
| 57 | - } | |
| 58 | - ); | |
| 59 | - | |
| 60 | - return deferred.promise; | |
| 61 | - }; | |
| 62 | - } | |
| 63 | - }; | |
| 64 | - } | |
| 65 | - } | |
| 66 | - } | |
| 67 | - ] | |
| 1 | +/** | |
| 2 | + * remoteValidationt3 远程验证指令(监控依赖的model变化) | |
| 3 | + * 属性如下: | |
| 4 | + * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl" | |
| 5 | + * remotemodel(必须):关联的model | |
| 6 | + * remotemodelcol(必须):关联的model属性 | |
| 7 | + */ | |
| 8 | +angular.module('ScheduleApp').directive( | |
| 9 | + 'remoteValidation3', | |
| 10 | + [ | |
| 11 | + '$$SearchInfoService_g', | |
| 12 | + '$q', | |
| 13 | + function($$SearchInfoService_g, $q) { | |
| 14 | + return { | |
| 15 | + restrict: 'A', // 属性 | |
| 16 | + require: '^ngModel', // 依赖所属指令的ngModel | |
| 17 | + compile: function(tElem, tAttrs) { | |
| 18 | + var remotevtype_attr = tAttrs['remotevtype']; | |
| 19 | + var remotemodel_attr = tAttrs['remotemodel']; | |
| 20 | + var remotemodelcol_attr = tAttrs['remotemodelcol']; | |
| 21 | + if (!remotevtype_attr) { | |
| 22 | + throw new Error("remotevtype属性必须填写"); | |
| 23 | + } | |
| 24 | + if (!remotemodel_attr) { | |
| 25 | + throw new Error("remotemodel属性必须填写"); | |
| 26 | + } | |
| 27 | + if (!remotemodelcol_attr) { | |
| 28 | + throw new Error("remotemodelcol属性必须填写"); | |
| 29 | + } | |
| 30 | + | |
| 31 | + return { | |
| 32 | + pre: function(scope, element, attr) { | |
| 33 | + | |
| 34 | + }, | |
| 35 | + | |
| 36 | + post: function(scope, element, attr, ngModelCtrl) { | |
| 37 | + ngModelCtrl.$asyncValidators.remote = | |
| 38 | + function(modelValue, viewValue) { | |
| 39 | + var deferred = $q.defer(); | |
| 40 | + | |
| 41 | + // 远端验证service | |
| 42 | + var param = JSON.parse(attr['remotemodel']); | |
| 43 | + console.log(param); | |
| 44 | + param[remotemodelcol_attr] = modelValue; | |
| 45 | + $$SearchInfoService_g.validate[remotevtype_attr].remote.do( | |
| 46 | + param, | |
| 47 | + function(result) { | |
| 48 | + if (result.status == "SUCCESS") { | |
| 49 | + deferred.resolve(); | |
| 50 | + } else { | |
| 51 | + scope.$remote_msg = result.msg; | |
| 52 | + deferred.reject(); | |
| 53 | + } | |
| 54 | + }, | |
| 55 | + function(result) { | |
| 56 | + deferred.reject(); | |
| 57 | + } | |
| 58 | + ); | |
| 59 | + | |
| 60 | + return deferred.promise; | |
| 61 | + }; | |
| 62 | + } | |
| 63 | + }; | |
| 64 | + } | |
| 65 | + } | |
| 66 | + } | |
| 67 | + ] | |
| 68 | 68 | ); |
| 69 | 69 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/mySelect.js
| 1 | -/** | |
| 2 | - * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选 | |
| 3 | - * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够 | |
| 4 | - * cmoptions(必须):描述绑定的逻辑配置对象,格式如下: | |
| 5 | - * | |
| 6 | - * // TODO: | |
| 7 | - */ | |
| 8 | -angular.module('ScheduleApp').directive('mySelect', [ | |
| 9 | - function() { | |
| 10 | - return { | |
| 11 | - restrict: 'E', | |
| 12 | - template: '<div>bioxuxuan</div>', | |
| 13 | - require: 'ngModel', | |
| 14 | - compile: function(tElem, tAttrs) { | |
| 15 | - return { | |
| 16 | - pre: function(scope, element, attr) { | |
| 17 | - | |
| 18 | - }, | |
| 19 | - post: function(scope, element, attr, ngModelCtr) { | |
| 20 | - // model -> view | |
| 21 | - ngModelCtr.$formatters.push(function(modelValue) { | |
| 22 | - // 监控model的变化 | |
| 23 | - if (typeof modelValue != "undefined") { | |
| 24 | - console.log(modelValue); | |
| 25 | - | |
| 26 | - return modelValue; | |
| 27 | - } | |
| 28 | - }); | |
| 29 | - | |
| 30 | - ngModelCtr.$render = function() { | |
| 31 | - if (typeof scope.ctrl.say != "undefined") { | |
| 32 | - element.find('div').css('color', 'red'); | |
| 33 | - } | |
| 34 | - }; | |
| 35 | - | |
| 36 | - ngModelCtr.$setViewValue("init value"); | |
| 37 | - | |
| 38 | - | |
| 39 | - } | |
| 40 | - } | |
| 41 | - } | |
| 42 | - } | |
| 43 | - } | |
| 1 | +/** | |
| 2 | + * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选 | |
| 3 | + * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够 | |
| 4 | + * cmoptions(必须):描述绑定的逻辑配置对象,格式如下: | |
| 5 | + * | |
| 6 | + * // TODO: | |
| 7 | + */ | |
| 8 | +angular.module('ScheduleApp').directive('mySelect', [ | |
| 9 | + function() { | |
| 10 | + return { | |
| 11 | + restrict: 'E', | |
| 12 | + template: '<div>bioxuxuan</div>', | |
| 13 | + require: 'ngModel', | |
| 14 | + compile: function(tElem, tAttrs) { | |
| 15 | + return { | |
| 16 | + pre: function(scope, element, attr) { | |
| 17 | + | |
| 18 | + }, | |
| 19 | + post: function(scope, element, attr, ngModelCtr) { | |
| 20 | + // model -> view | |
| 21 | + ngModelCtr.$formatters.push(function(modelValue) { | |
| 22 | + // 监控model的变化 | |
| 23 | + if (typeof modelValue != "undefined") { | |
| 24 | + console.log(modelValue); | |
| 25 | + | |
| 26 | + return modelValue; | |
| 27 | + } | |
| 28 | + }); | |
| 29 | + | |
| 30 | + ngModelCtr.$render = function() { | |
| 31 | + if (typeof scope.ctrl.say != "undefined") { | |
| 32 | + element.find('div').css('color', 'red'); | |
| 33 | + } | |
| 34 | + }; | |
| 35 | + | |
| 36 | + ngModelCtr.$setViewValue("init value"); | |
| 37 | + | |
| 38 | + | |
| 39 | + } | |
| 40 | + } | |
| 41 | + } | |
| 42 | + } | |
| 43 | + } | |
| 44 | 44 | ]); |
| 45 | 45 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/mySelectTemplate.html
| 1 | -<div class="input-group" name="指令compile阶段设定1" | |
| 2 | - ng-model="$saSelectCtrl.$$internalmodel"> | |
| 3 | - <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)" | |
| 4 | - theme="bootstrap" > | |
| 5 | - <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定2</ui-select-match> | |
| 6 | - <ui-select-choices repeat="指令compile阶段设定3" | |
| 7 | - refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)" | |
| 8 | - refresh-delay="10"> | |
| 9 | - | |
| 10 | - 指令compile阶段设定777 | |
| 11 | - | |
| 12 | - </ui-select-choices> | |
| 13 | - </ui-select> | |
| 14 | - <span class="input-group-btn"> | |
| 15 | - <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default"> | |
| 16 | - <span class="glyphicon glyphicon-trash"></span> | |
| 17 | - </button> | |
| 18 | - </span> | |
| 1 | +<div class="input-group" name="指令compile阶段设定1" | |
| 2 | + ng-model="$saSelectCtrl.$$internalmodel"> | |
| 3 | + <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)" | |
| 4 | + theme="bootstrap" > | |
| 5 | + <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定2</ui-select-match> | |
| 6 | + <ui-select-choices repeat="指令compile阶段设定3" | |
| 7 | + refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)" | |
| 8 | + refresh-delay="10"> | |
| 9 | + | |
| 10 | + 指令compile阶段设定777 | |
| 11 | + | |
| 12 | + </ui-select-choices> | |
| 13 | + </ui-select> | |
| 14 | + <span class="input-group-btn"> | |
| 15 | + <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default"> | |
| 16 | + <span class="glyphicon glyphicon-trash"></span> | |
| 17 | + </button> | |
| 18 | + </span> | |
| 19 | 19 | </div> |
| 20 | 20 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
| ... | ... | @@ -105,9 +105,9 @@ angular.module('ScheduleApp').directive('remoteValidation', [ |
| 105 | 105 | */ |
| 106 | 106 | attr.$observe("remotevparam", function(value) { |
| 107 | 107 | if (value && value != "") { |
| 108 | - if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证 | |
| 109 | - return; | |
| 110 | - } | |
| 108 | + //if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证 | |
| 109 | + // return; | |
| 110 | + //} | |
| 111 | 111 | $watch_rvparam_obj = JSON.parse(value); |
| 112 | 112 | $$internal_validate(ngModelCtrl, scope); |
| 113 | 113 | } |
| ... | ... | @@ -219,73 +219,73 @@ angular.module('ScheduleApp').directive('remoteValidationt2', [ |
| 219 | 219 | } |
| 220 | 220 | ]); |
| 221 | 221 | |
| 222 | -/** | |
| 223 | - * remoteValidationt3 远程验证指令(监控依赖的model变化) | |
| 224 | - * 属性如下: | |
| 225 | - * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl" | |
| 226 | - * remotemodel(必须):关联的model | |
| 227 | - * remotemodelcol(必须):关联的model属性 | |
| 228 | - */ | |
| 229 | -angular.module('ScheduleApp').directive( | |
| 230 | - 'remoteValidation3', | |
| 231 | - [ | |
| 232 | - '$$SearchInfoService_g', | |
| 233 | - '$q', | |
| 234 | - function($$SearchInfoService_g, $q) { | |
| 235 | - return { | |
| 236 | - restrict: 'A', // 属性 | |
| 237 | - require: '^ngModel', // 依赖所属指令的ngModel | |
| 238 | - compile: function(tElem, tAttrs) { | |
| 239 | - var remotevtype_attr = tAttrs['remotevtype']; | |
| 240 | - var remotemodel_attr = tAttrs['remotemodel']; | |
| 241 | - var remotemodelcol_attr = tAttrs['remotemodelcol']; | |
| 242 | - if (!remotevtype_attr) { | |
| 243 | - throw new Error("remotevtype属性必须填写"); | |
| 244 | - } | |
| 245 | - if (!remotemodel_attr) { | |
| 246 | - throw new Error("remotemodel属性必须填写"); | |
| 247 | - } | |
| 248 | - if (!remotemodelcol_attr) { | |
| 249 | - throw new Error("remotemodelcol属性必须填写"); | |
| 250 | - } | |
| 251 | - | |
| 252 | - return { | |
| 253 | - pre: function(scope, element, attr) { | |
| 254 | - | |
| 255 | - }, | |
| 256 | - | |
| 257 | - post: function(scope, element, attr, ngModelCtrl) { | |
| 258 | - ngModelCtrl.$asyncValidators.remote = | |
| 259 | - function(modelValue, viewValue) { | |
| 260 | - var deferred = $q.defer(); | |
| 261 | - | |
| 262 | - // 远端验证service | |
| 263 | - var param = JSON.parse(attr['remotemodel']); | |
| 264 | - console.log(param); | |
| 265 | - param[remotemodelcol_attr] = modelValue; | |
| 266 | - $$SearchInfoService_g.validate[remotevtype_attr].remote.do( | |
| 267 | - param, | |
| 268 | - function(result) { | |
| 269 | - if (result.status == "SUCCESS") { | |
| 270 | - deferred.resolve(); | |
| 271 | - } else { | |
| 272 | - scope.$remote_msg = result.msg; | |
| 273 | - deferred.reject(); | |
| 274 | - } | |
| 275 | - }, | |
| 276 | - function(result) { | |
| 277 | - deferred.reject(); | |
| 278 | - } | |
| 279 | - ); | |
| 280 | - | |
| 281 | - return deferred.promise; | |
| 282 | - }; | |
| 283 | - } | |
| 284 | - }; | |
| 285 | - } | |
| 286 | - } | |
| 287 | - } | |
| 288 | - ] | |
| 222 | +/** | |
| 223 | + * remoteValidationt3 远程验证指令(监控依赖的model变化) | |
| 224 | + * 属性如下: | |
| 225 | + * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl" | |
| 226 | + * remotemodel(必须):关联的model | |
| 227 | + * remotemodelcol(必须):关联的model属性 | |
| 228 | + */ | |
| 229 | +angular.module('ScheduleApp').directive( | |
| 230 | + 'remoteValidation3', | |
| 231 | + [ | |
| 232 | + '$$SearchInfoService_g', | |
| 233 | + '$q', | |
| 234 | + function($$SearchInfoService_g, $q) { | |
| 235 | + return { | |
| 236 | + restrict: 'A', // 属性 | |
| 237 | + require: '^ngModel', // 依赖所属指令的ngModel | |
| 238 | + compile: function(tElem, tAttrs) { | |
| 239 | + var remotevtype_attr = tAttrs['remotevtype']; | |
| 240 | + var remotemodel_attr = tAttrs['remotemodel']; | |
| 241 | + var remotemodelcol_attr = tAttrs['remotemodelcol']; | |
| 242 | + if (!remotevtype_attr) { | |
| 243 | + throw new Error("remotevtype属性必须填写"); | |
| 244 | + } | |
| 245 | + if (!remotemodel_attr) { | |
| 246 | + throw new Error("remotemodel属性必须填写"); | |
| 247 | + } | |
| 248 | + if (!remotemodelcol_attr) { | |
| 249 | + throw new Error("remotemodelcol属性必须填写"); | |
| 250 | + } | |
| 251 | + | |
| 252 | + return { | |
| 253 | + pre: function(scope, element, attr) { | |
| 254 | + | |
| 255 | + }, | |
| 256 | + | |
| 257 | + post: function(scope, element, attr, ngModelCtrl) { | |
| 258 | + ngModelCtrl.$asyncValidators.remote = | |
| 259 | + function(modelValue, viewValue) { | |
| 260 | + var deferred = $q.defer(); | |
| 261 | + | |
| 262 | + // 远端验证service | |
| 263 | + var param = JSON.parse(attr['remotemodel']); | |
| 264 | + console.log(param); | |
| 265 | + param[remotemodelcol_attr] = modelValue; | |
| 266 | + $$SearchInfoService_g.validate[remotevtype_attr].remote.do( | |
| 267 | + param, | |
| 268 | + function(result) { | |
| 269 | + if (result.status == "SUCCESS") { | |
| 270 | + deferred.resolve(); | |
| 271 | + } else { | |
| 272 | + scope.$remote_msg = result.msg; | |
| 273 | + deferred.reject(); | |
| 274 | + } | |
| 275 | + }, | |
| 276 | + function(result) { | |
| 277 | + deferred.reject(); | |
| 278 | + } | |
| 279 | + ); | |
| 280 | + | |
| 281 | + return deferred.promise; | |
| 282 | + }; | |
| 283 | + } | |
| 284 | + }; | |
| 285 | + } | |
| 286 | + } | |
| 287 | + } | |
| 288 | + ] | |
| 289 | 289 | ); |
| 290 | 290 | |
| 291 | 291 | angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) { |
| ... | ... | @@ -1698,49 +1698,49 @@ angular.module('ScheduleApp').directive('saSelect5', [ |
| 1698 | 1698 | }; |
| 1699 | 1699 | } |
| 1700 | 1700 | ]); |
| 1701 | -/** | |
| 1702 | - * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选 | |
| 1703 | - * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够 | |
| 1704 | - * cmoptions(必须):描述绑定的逻辑配置对象,格式如下: | |
| 1705 | - * | |
| 1706 | - * // TODO: | |
| 1707 | - */ | |
| 1708 | -angular.module('ScheduleApp').directive('mySelect', [ | |
| 1709 | - function() { | |
| 1710 | - return { | |
| 1711 | - restrict: 'E', | |
| 1712 | - template: '<div>bioxuxuan</div>', | |
| 1713 | - require: 'ngModel', | |
| 1714 | - compile: function(tElem, tAttrs) { | |
| 1715 | - return { | |
| 1716 | - pre: function(scope, element, attr) { | |
| 1717 | - | |
| 1718 | - }, | |
| 1719 | - post: function(scope, element, attr, ngModelCtr) { | |
| 1720 | - // model -> view | |
| 1721 | - ngModelCtr.$formatters.push(function(modelValue) { | |
| 1722 | - // 监控model的变化 | |
| 1723 | - if (typeof modelValue != "undefined") { | |
| 1724 | - console.log(modelValue); | |
| 1725 | - | |
| 1726 | - return modelValue; | |
| 1727 | - } | |
| 1728 | - }); | |
| 1729 | - | |
| 1730 | - ngModelCtr.$render = function() { | |
| 1731 | - if (typeof scope.ctrl.say != "undefined") { | |
| 1732 | - element.find('div').css('color', 'red'); | |
| 1733 | - } | |
| 1734 | - }; | |
| 1735 | - | |
| 1736 | - ngModelCtr.$setViewValue("init value"); | |
| 1737 | - | |
| 1738 | - | |
| 1739 | - } | |
| 1740 | - } | |
| 1741 | - } | |
| 1742 | - } | |
| 1743 | - } | |
| 1701 | +/** | |
| 1702 | + * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选 | |
| 1703 | + * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够 | |
| 1704 | + * cmoptions(必须):描述绑定的逻辑配置对象,格式如下: | |
| 1705 | + * | |
| 1706 | + * // TODO: | |
| 1707 | + */ | |
| 1708 | +angular.module('ScheduleApp').directive('mySelect', [ | |
| 1709 | + function() { | |
| 1710 | + return { | |
| 1711 | + restrict: 'E', | |
| 1712 | + template: '<div>bioxuxuan</div>', | |
| 1713 | + require: 'ngModel', | |
| 1714 | + compile: function(tElem, tAttrs) { | |
| 1715 | + return { | |
| 1716 | + pre: function(scope, element, attr) { | |
| 1717 | + | |
| 1718 | + }, | |
| 1719 | + post: function(scope, element, attr, ngModelCtr) { | |
| 1720 | + // model -> view | |
| 1721 | + ngModelCtr.$formatters.push(function(modelValue) { | |
| 1722 | + // 监控model的变化 | |
| 1723 | + if (typeof modelValue != "undefined") { | |
| 1724 | + console.log(modelValue); | |
| 1725 | + | |
| 1726 | + return modelValue; | |
| 1727 | + } | |
| 1728 | + }); | |
| 1729 | + | |
| 1730 | + ngModelCtr.$render = function() { | |
| 1731 | + if (typeof scope.ctrl.say != "undefined") { | |
| 1732 | + element.find('div').css('color', 'red'); | |
| 1733 | + } | |
| 1734 | + }; | |
| 1735 | + | |
| 1736 | + ngModelCtr.$setViewValue("init value"); | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + } | |
| 1740 | + } | |
| 1741 | + } | |
| 1742 | + } | |
| 1743 | + } | |
| 1744 | 1744 | ]); |
| 1745 | 1745 | |
| 1746 | 1746 | /** | ... | ... |