Commit 828a470d446206c6860825f237d18d07af68da49

Authored by liujun001
1 parent f022c7c0

分公司信息

src/main/java/com/bsth/controller/video/VideoController.java 0 → 100644
  1 +package com.bsth.controller.video;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.bsth.common.ResponseCode;
  5 +import com.bsth.entity.Business;
  6 +import com.bsth.entity.Line;
  7 +import com.bsth.entity.video.VideoTree;
  8 +import com.bsth.service.BusinessService;
  9 +import com.bsth.service.LineService;
  10 +import com.bsth.service.video.VideoService;
  11 +import lombok.extern.slf4j.Slf4j;
  12 +import org.apache.commons.collections.CollectionUtils;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.web.bind.annotation.GetMapping;
  15 +import org.springframework.web.bind.annotation.RequestMapping;
  16 +import org.springframework.web.bind.annotation.RestController;
  17 +
  18 +import java.util.*;
  19 +
  20 +/**
  21 + * @author liujun
  22 + * @date 2024年07月01日 12:52
  23 + */
  24 +@RestController
  25 +@Slf4j
  26 +@RequestMapping("video")
  27 +public class VideoController {
  28 + @Autowired
  29 + private VideoService videoService;
  30 +
  31 + @GetMapping("/tree")
  32 + public Map<String, Object> combinationTree() {
  33 + Map<String, Object> result = new HashMap<>();
  34 + try {
  35 + List<VideoTree> trees = videoService.combinationTree();
  36 + result.put("status", ResponseCode.SUCCESS);
  37 + result.put("data", trees);
  38 + } catch (Exception e) {
  39 + log.error("查询视频树异常", e);
  40 + result.put("status", ResponseCode.ERROR);
  41 + }
  42 +
  43 + return result;
  44 + }
  45 +
  46 + @GetMapping("/tree1")
  47 + public String combinationTree1() {
  48 + List<VideoTree> trees = videoService.combinationTree();
  49 + return JSON.toJSONString(trees);
  50 +
  51 + }
  52 +}
... ...
src/main/java/com/bsth/entity/video/VideoTree.java 0 → 100644
  1 +package com.bsth.entity.video;
  2 +
  3 +import lombok.Data;
  4 +
  5 +
  6 +import javax.persistence.Id;
  7 +import javax.persistence.Transient;
  8 +import java.io.Serializable;
  9 +import java.util.ArrayList;
  10 +import java.util.HashMap;
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
  14 +
  15 +/**
  16 + * @author liujun
  17 + * @date 2024年06月27日 11:16
  18 + */
  19 +@Data
  20 +public class VideoTree implements Serializable {
  21 +
  22 + private static final long serialVersionUID = 8270934502586526774L;
  23 + /**
  24 + * 公司ID、线路ID、汽车ID
  25 + */
  26 + @Transient
  27 + private Object sourceId;
  28 + /**
  29 + * 编码(公司、线路、汽车)
  30 + */
  31 +
  32 + @Id
  33 + @Transient
  34 + private Object id;
  35 + /**
  36 + * 公司名称、线路名称、汽车名称
  37 + */
  38 + @Transient
  39 + private String text;
  40 + /**
  41 + * 类型:1为公司;2为线路;3为汽车
  42 + */
  43 + @Transient
  44 + private Integer type;
  45 + /**
  46 + * 父节点
  47 + */
  48 + @Transient
  49 + private Object parentId;
  50 +
  51 + @Transient
  52 + private String icon;
  53 +
  54 + @Transient
  55 + private List<VideoTree> children;
  56 +
  57 + private Map<String,Object> state;
  58 +
  59 + public VideoTree(){
  60 + this.state = new HashMap<>();
  61 + state.put("opened",true);
  62 + }
  63 +
  64 +}
... ...
src/main/java/com/bsth/service/impl/videoimpl/VideoServiceImpl.java 0 → 100644
  1 +package com.bsth.service.impl.videoimpl;
  2 +
  3 +import com.bsth.entity.Business;
  4 +import com.bsth.entity.Line;
  5 +import com.bsth.entity.video.VideoTree;
  6 +import com.bsth.service.BusinessService;
  7 +import com.bsth.service.LineService;
  8 +import com.bsth.service.video.VideoService;
  9 +import org.apache.commons.collections.CollectionUtils;
  10 +import org.springframework.beans.BeanUtils;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.stereotype.Service;
  13 +
  14 +import java.util.*;
  15 +import java.util.stream.Collectors;
  16 +
  17 +/**
  18 + * @author liujun
  19 + * @date 2024年07月01日 12:57
  20 + */
  21 +@Service
  22 +public class VideoServiceImpl implements VideoService {
  23 + @Autowired
  24 + private BusinessService businessService;
  25 + @Autowired
  26 + private LineService lineService;
  27 +
  28 + @Override
  29 + public List<VideoTree> combinationTree() {
  30 + List<VideoTree> returnList = new ArrayList<>();
  31 +
  32 + List<VideoTree> bussessTree = queryBusiness();
  33 + if (CollectionUtils.isNotEmpty(bussessTree)) {
  34 + returnList.addAll(bussessTree);
  35 + }
  36 +
  37 +// List<VideoTree> lineTree = queryLine();
  38 +// if (CollectionUtils.isNotEmpty(lineTree)) {
  39 +// returnList.addAll(lineTree);
  40 +// }
  41 + return returnList;
  42 +
  43 + }
  44 +
  45 + /***
  46 + *查询公交公司的数据。
  47 + * @author liujun
  48 + * @date 2024/6/27 11:29
  49 + * @return java.util.List<com.bsth.entity.video.VideoTree>
  50 + */
  51 + private List<VideoTree> queryBusiness() {
  52 + Iterable<Business> businessIterable = businessService.list(new HashMap<>());
  53 + if (Objects.isNull(businessIterable)) {
  54 + return Collections.emptyList();
  55 + }
  56 +
  57 + List<VideoTree> trees = new ArrayList<>();
  58 + Iterator<Business> iterator = businessIterable.iterator();
  59 + while (iterator.hasNext()) {
  60 + Business business = iterator.next();
  61 + VideoTree videoTree = combinationVideoTree(business.getBusinessCode(), business.getBusinessName(), business.getUpCode(), business.getId(), 1, null);
  62 + trees.add(videoTree);
  63 + }
  64 + List<VideoTree> groupTree = new ArrayList<>();
  65 + for (VideoTree tree : trees) {
  66 + if (Objects.equals(tree.getParentId(), "0")) {
  67 + VideoTree target = new VideoTree();
  68 + BeanUtils.copyProperties(tree,target);
  69 + target.setParentId("#");
  70 + groupTree.add(target);
  71 + }
  72 + }
  73 +
  74 + if (CollectionUtils.isNotEmpty(groupTree)) {
  75 + for (VideoTree tree : groupTree) {
  76 + groupTree(trees, tree);
  77 + }
  78 + }
  79 +
  80 + return groupTree;
  81 + }
  82 +
  83 + private List<VideoTree> queryLine() {
  84 + Iterable<Line> lines = lineService.list(new HashMap<>());
  85 + if (Objects.isNull(lines)) {
  86 + return Collections.emptyList();
  87 + }
  88 +
  89 + List<VideoTree> trees = new ArrayList<>();
  90 + Iterator<Line> iterator = lines.iterator();
  91 + while (iterator.hasNext()) {
  92 + Line line = iterator.next();
  93 + VideoTree videoTree = combinationVideoTree(line.getId(), line.getName(), line.getCompany(), line.getId(), 2, null);
  94 + trees.add(videoTree);
  95 + }
  96 +
  97 +
  98 + return trees;
  99 + }
  100 +
  101 + private List<VideoTree> queryCars() {
  102 + return null;
  103 + }
  104 +
  105 + /***
  106 + * 组合树
  107 + * @author liujun
  108 + * @date 2024/6/27 13:12
  109 + * @param id id
  110 + * @param text 显示的文本
  111 + * @param sourceId 数据的ID
  112 + * @param parent 数据的父节点
  113 + * @param type 类型
  114 + * @param icon 图标
  115 + * @return com.bsth.entity.video.VideoTree
  116 + */
  117 + private VideoTree combinationVideoTree(Object id, String text, String parent, Integer sourceId, Integer type, String icon) {
  118 + VideoTree videoTree = new VideoTree();
  119 + videoTree.setId(id);
  120 + videoTree.setText(text);
  121 + videoTree.setSourceId(sourceId);
  122 + videoTree.setParentId(parent);
  123 + videoTree.setType(type);
  124 + videoTree.setIcon(icon);
  125 + return videoTree;
  126 + }
  127 +
  128 + private void groupTree(List<VideoTree> trees, VideoTree tree) {
  129 + if (Objects.isNull(trees) || CollectionUtils.isEmpty(trees)) {
  130 + return;
  131 + }
  132 + for (VideoTree videoTree : trees) {
  133 + if (Objects.equals(videoTree.getParentId(), tree.getId())) {
  134 + if (Objects.isNull(tree.getChildren())) {
  135 + tree.setChildren(new ArrayList<>());
  136 + }
  137 + tree.getChildren().add(videoTree);
  138 + groupTree(trees, videoTree);
  139 + }
  140 + }
  141 + }
  142 +
  143 +}
... ...
src/main/java/com/bsth/service/video/VideoService.java 0 → 100644
  1 +package com.bsth.service.video;
  2 +
  3 +import com.bsth.entity.Business;
  4 +import com.bsth.entity.video.VideoTree;
  5 +import com.bsth.service.BaseService;
  6 +
  7 +
  8 +import java.util.List;
  9 +import java.util.Map;
  10 +
  11 +/**
  12 + * @author liujun
  13 + * @date 2024年06月27日 11:14
  14 + */
  15 +
  16 +public interface VideoService {
  17 +
  18 + List<VideoTree> combinationTree();
  19 +}
... ...
src/main/resources/static/pages/video/bus_info.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>车辆信息管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">基础信息</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <span class="active">车辆信息管理</span>
  18 + </li>
  19 +</ul>
  20 +
  21 +<div class="row">
  22 + <div class="col-md-12" ng-controller="BusInfoManageCtrl as ctrl">
  23 + <style>
  24 + .dropdown-menu {
  25 + border-color: #32c5d2;
  26 + }
  27 + .btn-group > .dropdown-menu:before {
  28 + border-bottom-color: #32c5d2;
  29 + }
  30 + </style>
  31 +
  32 + <div class="portlet light bordered">
  33 + <div class="portlet-title">
  34 + <div class="caption font-dark">
  35 + <i class="fa fa-database font-dark"></i>
  36 + <span class="caption-subject bold uppercase">车辆信息表</span>
  37 + </div>
  38 + <div class="actions">
  39 + <!--<a href="javascript:" class="btn blue" ng-click="ctrl.goForm()">-->
  40 + <!--<i class="fa fa-plus"></i>-->
  41 + <!--添加车辆信息-->
  42 + <!--</a>-->
  43 + </div>
  44 + </div>
  45 +
  46 + <div class="portlet-body">
  47 + <div ui-view="busInfoManage_list"></div>
  48 + </div>
  49 + </div>
  50 + </div>
  51 +</div>
  52 +
... ...
src/main/resources/static/pages/video/bus_info_list.html 0 → 100644
  1 +<!-- ui-route busInfoManage.list -->
  2 +<div ng-controller="BusInfoManageListCtrl as ctrl">
  3 + <div class="fixDiv">
  4 + <table class="table fixTable table-striped table-bordered table-hover table-checkable order-column">
  5 + <thead>
  6 + <tr role="row" class="heading">
  7 + <th style="width:70px;">序号</th>
  8 + <th style="width: 120px;">车辆编号</th>
  9 + <th style="width: 120px;">内部编号</th>
  10 + <th style="width: 120px;">设备编号</th>
  11 + <th style="width: 120px;">车牌号</th>
  12 + <th >所在公司</th>
  13 + <th >所在分公司</th>
  14 + <th style="width: 60px">电车</th>
  15 + <th style="width: 80px;" >状态</th>
  16 + <th >操作</th>
  17 + </tr>
  18 + <tr role="row" class="filter">
  19 + <td></td>
  20 + <td>
  21 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().carCode_like" placeholder="输入车辆编号..."/>
  22 + </td>
  23 + <td>
  24 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().insideCode_like" placeholder="输入内部编号..."/>
  25 + </td>
  26 + <td>
  27 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().equipmentCode_like" placeholder="输入设备编号..."/>
  28 + </td>
  29 + <td>
  30 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().carPlate_like" placeholder="输入车牌号..."/>
  31 + </td>
  32 + <td>
  33 + <sa-Select5 name="gs"
  34 + model="ctrl.searchCondition()"
  35 + cmaps="{'businessCode_eq': 'businessCode'}"
  36 + dcname="businessCode_eq"
  37 + icname="businessCode"
  38 + dsparams="{{ {type: 'ajax', param:{'upCode_eq': '88' }, atype:'gs' } | json }}"
  39 + iterobjname="item"
  40 + iterobjexp="item.businessName"
  41 + searchph="请输拼音..."
  42 + searchexp="this.businessName"
  43 + required
  44 + >
  45 + </sa-Select5>
  46 + </td>
  47 + <td>
  48 + <sa-Select5 name="fgs"
  49 + model="ctrl.searchCondition()"
  50 + cmaps="{'brancheCompanyCode_eq': 'businessCode'}"
  51 + dcname="brancheCompanyCode_eq"
  52 + icname="businessCode"
  53 + dsparams="{{ {type: 'ajax', param:{'upCode_eq': ctrl.searchCondition().businessCode_eq }, atype:'gs' } | json }}"
  54 + iterobjname="item"
  55 + iterobjexp="item.businessName"
  56 + searchph="请输拼音..."
  57 + searchexp="this.businessName"
  58 + required
  59 + >
  60 + </sa-Select5>
  61 + </td>
  62 + <td>
  63 +
  64 + </td>
  65 + <td>
  66 + <label class="checkbox-inline input">
  67 + <input type="checkbox" ng-model="ctrl.searchCondition()['scrapState_eq']" />报废
  68 + </label>
  69 + </td>
  70 + <td>
  71 + <div class="btn-group">
  72 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;"
  73 + ng-click="ctrl.doPage()">
  74 + <i class="fa fa-search"></i> 搜索</button>
  75 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom dropdown-toggle"
  76 + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  77 + <span class="caret"></span>
  78 + <span class="sr-only">dropdown</span>
  79 + </button>
  80 + <ul class="dropdown-menu pull-right">
  81 + <li>
  82 + <a href="javascript:" class="tool-action" ng-click="ctrl.customOrder()">
  83 + <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
  84 + 排序选项
  85 + </a>
  86 + </li>
  87 + </ul>
  88 + </div>
  89 +
  90 + <button class="btn btn-sm red btn-outline filter-cancel"
  91 + ng-click="ctrl.reset()">
  92 + <i class="fa fa-times"></i> 重置</button>
  93 + </td>
  94 +
  95 + </tr>
  96 + </thead>
  97 + <tbody>
  98 + <tr ng-repeat="info in ctrl.page()['content']" class="odd gradeX">
  99 + <td>
  100 + <div>
  101 + <a href="#"
  102 + tooltip-animation="false"
  103 + tooltip-placement="top"
  104 + uib-tooltip="{{'公司/编号:' + info.company + '/' + info.insideCode}}"
  105 + tooltip-class="headClass">
  106 +
  107 + <i class="fa fa-list-ol" aria-hidden="true"></i>
  108 + {{$index + ctrl.page().number * 10 + 1}}
  109 + </a>
  110 + </div>
  111 + </td>
  112 + <td>
  113 + <span ng-bind="info.carCode"></span>
  114 + </td>
  115 + <td>
  116 + <span ng-bind="info.insideCode"></span>
  117 + </td>
  118 + <td>
  119 + <span ng-bind="info.equipmentCode"></span>
  120 + </td>
  121 + <td>
  122 + <span ng-bind="info.carPlate"></span>
  123 + </td>
  124 + <td>
  125 + <span ng-bind="info.company"></span>
  126 + </td>
  127 + <td>
  128 + <span ng-bind="info.brancheCompany"></span>
  129 + </td>
  130 + <td>
  131 + <span ng-bind="info.sfdc | dict:'truefalseType':'未知' "></span>
  132 + </td>
  133 + <td>
  134 + <span ng-bind="info.scrapState | dict:'truefalseType':'未知' "></span>
  135 + </td>
  136 + <td>
  137 + <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
  138 + <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
  139 + <a ui-sref="busInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a>
  140 + <!--<a ui-sref="busInfoManage_edit({id: info.id})" class="btn btn-info btn-sm"> 修改 </a>-->
  141 + <!--<a sweetalert-->
  142 + <!--sweet-options="{title: '是否删除车辆信息?',text: '内部编码:' + info.insideCode + '</br>如果有车辆配置信息关联,会报错,建议不要随便删除!', html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"-->
  143 + <!--sweet-on-confirm="ctrl.deleteCar(info.id)"-->
  144 + <!--class="btn btn-danger btn-sm">删除</a>-->
  145 + </td>
  146 + </tr>
  147 + </tbody>
  148 + </table>
  149 + </div>
  150 +
  151 + <div class="pageBar">
  152 + <div class="pageBarLeft">
  153 + {{'显示从' + ctrl.page()['uiFromRecord'] + '到' + ctrl.page()['uiToRecord'] + ' 共' + ctrl.page()['totalElements'] + '条' + ' 每页显示10条'}}
  154 + </div>
  155 +
  156 + <div class="pageBarRight">
  157 + <uib-pagination total-items="ctrl.page()['totalElements']"
  158 + ng-model="ctrl.page()['uiNumber']"
  159 + ng-change="ctrl.doPage()"
  160 + rotate="false"
  161 + max-size="10"
  162 + boundary-links="true"
  163 + first-text="首页"
  164 + previous-text="上一页"
  165 + next-text="下一页"
  166 + last-text="尾页">
  167 + </uib-pagination>
  168 + </div>
  169 + </div>
  170 +
  171 +</div>
... ...
src/main/resources/static/pages/video/bus_info_module.js 0 → 100644
  1 +// 车辆基础信息维护 service controller等写在一起
  2 +
  3 +angular.module('ScheduleApp').factory(
  4 + 'BusInfoManageService',
  5 + [
  6 + 'BusInfoManageService_g',
  7 + 'UserPrincipal',
  8 + function(service, UserPrincipal) {
  9 +
  10 + /** 当前的查询条件信息 */
  11 + var currentSearchCondition = {
  12 + page: 0,
  13 + "carCode_like" : "",
  14 + "insideCode_like" : "",
  15 + "equipmentCode_like" : "",
  16 + "carPlate_like" : ""
  17 + };
  18 + // 当前查询返回的信息
  19 + var currentPage = { // 后台spring data返回的格式
  20 + totalElements: 0,
  21 + number: 0, // 后台返回的页码,spring返回从0开始
  22 + content: [],
  23 +
  24 + uiNumber: 1, // 页面绑定的页码
  25 + uiFromRecord: 0, // 页面绑定,当前页第几条记录
  26 + uiToRecord: 0 // 页面绑定,当前页到第几条记录
  27 + };
  28 +
  29 + // 字段描述
  30 + var columns = [
  31 + {name: "carCode", desc: "车辆编号"},
  32 + {name: "insideCode", desc: "自编号"},
  33 + {name: "equipmentCode", desc: "设备编号"},
  34 + {name: "carPlate", desc: "车牌号"},
  35 + {name: "company", desc: "所在公司"},
  36 + {name: "brancheCompany", desc: "所在分公司"},
  37 + {name: "sfdc", desc: "是否电车"},
  38 + {name: "scrapState", desc: "是否报废"},
  39 + {name: "updateDate", desc: "更新时间"}
  40 + ];
  41 + // 排序字段
  42 + var orderColumns = {
  43 + order: "carCode",
  44 + direction: "ASC"
  45 + };
  46 +
  47 + // 查询对象
  48 + var queryClass = service.rest;
  49 +
  50 + return {
  51 + getQueryClass: function() {
  52 + return queryClass;
  53 + },
  54 + getColumns: function() {
  55 + return columns;
  56 + },
  57 + getOrderColumns: function() {
  58 + return orderColumns;
  59 + },
  60 + /**
  61 + * 获取查询条件信息,
  62 + * 用于给controller用来和页面数据绑定。
  63 + */
  64 + getSearchCondition: function() {
  65 + currentSearchCondition.page = currentPage.uiNumber - 1;
  66 +
  67 + if (UserPrincipal.getGsStrs().length > 0) {
  68 + currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  69 + }
  70 +
  71 + // 重置排序字段条件
  72 + currentSearchCondition.order = orderColumns.order;
  73 + currentSearchCondition.direction = orderColumns.direction;
  74 +
  75 + return currentSearchCondition;
  76 + },
  77 + /**
  78 + * 组装查询参数,返回一个promise查询结果。
  79 + * @param params 查询参数
  80 + * @return 返回一个 promise
  81 + */
  82 + getPage: function(page) {
  83 + if (page) {
  84 + currentPage.totalElements = page.totalElements;
  85 + currentPage.number = page.number;
  86 + currentPage.content = page.content;
  87 +
  88 + // 计算当前页开始记录,结束记录
  89 + if (page.numberOfElements && page.numberOfElements > 0) {
  90 + currentPage.uiFromRecord = page.number * 10 + 1;
  91 + currentPage.uiToRecord = page.number * 10 + page.numberOfElements;
  92 + }
  93 + }
  94 + return currentPage;
  95 + },
  96 + resetStatus: function() {
  97 + currentSearchCondition = {page: 0};
  98 + currentPage = {
  99 + totalElements: 0,
  100 + number: 0,
  101 + content: [],
  102 + uiNumber: 1,
  103 + uiFromRecord: 0,
  104 + uiToRecord: 0
  105 + };
  106 + },
  107 +
  108 + /**
  109 + * 数据导出。
  110 + * @returns {*|Function|promise|n}
  111 + */
  112 + dataExport: function(query) {
  113 + if (UserPrincipal.getGsStrsQuery().length > 0) {
  114 + return service.dataTools.dataExport(
  115 + {'QUERY': query}
  116 + ).$promise;
  117 + } else {
  118 + return null;
  119 + }
  120 + }
  121 + };
  122 +
  123 + }
  124 + ]
  125 +);
  126 +
  127 +// index.html控制器
  128 +angular.module('ScheduleApp').controller(
  129 + 'BusInfoManageCtrl',
  130 + [
  131 + 'BusInfoManageService',
  132 + '$state',
  133 + '$uibModal',
  134 + 'FileDownload_g',
  135 + 'UserPrincipal',
  136 + function(busInfoManageService, $state, $uibModal, fileDownload, UserPrincipal) {
  137 + var self = this;
  138 +
  139 + // 切换到form状态
  140 + self.goForm = function() {
  141 + //alert("切换");
  142 + $state.go("busInfoManage_form");
  143 + };
  144 +
  145 + // 导入excel
  146 + self.importData = function() {
  147 + // large方式弹出模态对话框
  148 + var modalInstance = $uibModal.open({
  149 + templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html',
  150 + size: "lg",
  151 + animation: true,
  152 + backdrop: 'static',
  153 + resolve: {
  154 + // 可以传值给controller
  155 + },
  156 + windowClass: 'center-modal',
  157 + controller: "BusInfoManageToolsCtrl",
  158 + controllerAs: "ctrl",
  159 + bindToController: true
  160 + });
  161 + modalInstance.result.then(
  162 + function() {
  163 + console.log("dataImport.html打开");
  164 + },
  165 + function() {
  166 + console.log("dataImport.html消失");
  167 + }
  168 + );
  169 + };
  170 +
  171 + // 导出excel
  172 + self.exportData = function() {
  173 + // 组装查询条件
  174 + var QUERY = [];
  175 + var fgs_query = [];
  176 + var i;
  177 + for (i in UserPrincipal.getGsStrs()) {
  178 + fgs_query.push("'" + UserPrincipal.getGsStrs()[i] + "'");
  179 + }
  180 + QUERY.push(" concat(business_code, '_', branche_company_code) in " + "(" + fgs_query.join(",") + ")");
  181 + var key_map = {
  182 + "car_code": "carCode_like",
  183 + "inside_code": "insideCode_like",
  184 + "equipment_code": "equipmentCode_like",
  185 + "car_plate": "carPlate_like"
  186 + };
  187 +
  188 + var key;
  189 + var value;
  190 + var field;
  191 + var condition = busInfoManageService.getSearchCondition();
  192 + for (key in key_map) {
  193 + value = condition[key_map[key]];
  194 + if (value !== undefined && value !== "") {
  195 + field = key;
  196 + QUERY.push(field + " = " + "'" + value + "'");
  197 + }
  198 + }
  199 +
  200 + var p = busInfoManageService.dataExport(QUERY.join(" and "));
  201 + if (p) {
  202 + p.then(
  203 + function(result) {
  204 + fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls");
  205 + },
  206 + function(result) {
  207 + console.log("exportData failed:" + result);
  208 + }
  209 + );
  210 + }
  211 +
  212 + };
  213 + }
  214 + ]
  215 +);
  216 +
  217 +angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
  218 + var self = this;
  219 + self.data = "TODO";
  220 +
  221 + // 关闭窗口
  222 + self.close = function() {
  223 + $modalInstance.dismiss("cancel");
  224 + };
  225 +
  226 + self.clearInputFile = function() {
  227 + angular.element("input[type='file']").val(null);
  228 + };
  229 +
  230 + // 上传文件组件
  231 + self.uploader = new FileUploader({
  232 + url: "/cars_sc/uploadAndImportFile",
  233 + filters: [] // 用于过滤文件,比如只允许导入excel
  234 + });
  235 + self.uploader.onAfterAddingFile = function(fileItem)
  236 + {
  237 + console.info('onAfterAddingFile', fileItem);
  238 + console.log(self.uploader.queue.length);
  239 + if (self.uploader.queue.length > 1)
  240 + self.uploader.removeFromQueue(0);
  241 + };
  242 + self.uploader.onSuccessItem = function(fileItem, response, status, headers)
  243 + {
  244 + if (response.status == "SUCCESS") {
  245 + console.info('onSuccessItem', fileItem, response, status, headers);
  246 + } else {
  247 + fileItem.isSuccess = false;
  248 + fileItem.isCancel = false;
  249 + fileItem.isError = true;
  250 +
  251 + alert(response.msg);
  252 + }
  253 +
  254 + };
  255 + self.uploader.onErrorItem = function(fileItem, response, status, headers)
  256 + {
  257 + console.info('onErrorItem', fileItem, response, status, headers);
  258 + };
  259 +
  260 +}]);
  261 +
  262 +// list.html控制器
  263 +angular.module('ScheduleApp').controller(
  264 + 'BusInfoManageListCtrl',
  265 + [
  266 + 'BusInfoManageService',
  267 + '$uibModal',
  268 + function(service, $uibModal) {
  269 + var self = this;
  270 + var Cars = service.getQueryClass();
  271 +
  272 + self.page = function() {
  273 + return service.getPage();
  274 + };
  275 +
  276 + self.searchCondition = function() {
  277 + return service.getSearchCondition();
  278 + };
  279 +
  280 + self.doPage = function() {
  281 + var result = Cars.list(self.searchCondition(), function() {
  282 + if (!result.status) {
  283 + service.getPage(result);
  284 + }
  285 + });
  286 + };
  287 + self.reset = function() {
  288 + service.resetStatus();
  289 + var result = Cars.list(self.searchCondition(), function() {
  290 + if (!result.status) {
  291 + service.getPage(result);
  292 + }
  293 + });
  294 + };
  295 +
  296 + self.deleteCar = function(id) {
  297 + Cars.delete({id: id}, function(result) {
  298 + if (result.msg) { // 暂时这样做,之后全局拦截
  299 + alert("失败:" + result.msg);
  300 + } else {
  301 + self.doPage();
  302 + }
  303 + });
  304 + };
  305 +
  306 + self.doPage();
  307 +
  308 + self.customOrder = function() {
  309 + // large方式弹出模态对话框
  310 + var modalInstance = $uibModal.open({
  311 + templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/orderOptionOpen.html',
  312 + // size: "sm",
  313 + animation: true,
  314 + backdrop: 'static',
  315 + resolve: {
  316 + },
  317 + windowClass: 'order-option-modal',
  318 + controller: "BusInfoManageListOrderOptionModalInstanceCtrl",
  319 + controllerAs: "$ctrl",
  320 + bindToController: true
  321 + });
  322 + modalInstance.result.then(
  323 + function(result) {
  324 + console.log("dataImport.html打开");
  325 + },
  326 + function() {
  327 + console.log("dataImport.html消失");
  328 + }
  329 + );
  330 + };
  331 + }
  332 + ]
  333 +);
  334 +
  335 +angular.module('ScheduleApp').controller(
  336 + "BusInfoManageListOrderOptionModalInstanceCtrl",
  337 + [
  338 + "BusInfoManageService",
  339 + "$modalInstance",
  340 + function(service, $modalInstance) {
  341 + var self = this;
  342 +
  343 + self.columns = service.getColumns();
  344 + self.orderColumns = service.getOrderColumns();
  345 +
  346 + self.confirm = function(result) {
  347 + // console.log(result);
  348 + // console.log(service.getOrderColumns());
  349 + $modalInstance.dismiss("cancel");
  350 +
  351 + }
  352 + }
  353 + ]
  354 +);
  355 +
  356 +// form.html控制器
  357 +angular.module('ScheduleApp').controller(
  358 + 'BusInfoManageFormCtrl',
  359 + [
  360 + 'BusInfoManageService',
  361 + '$stateParams',
  362 + '$state',
  363 + 'DataStore',
  364 + function(service, $stateParams, $state, DataStore) {
  365 + var self = this;
  366 + var Cars = service.getQueryClass();
  367 +
  368 + // 报废日期 日期控件开关
  369 + self.scrapDateOpen = false;
  370 + self.scrapDate_open = function() {
  371 + self.scrapDateOpen = true;
  372 + };
  373 +
  374 + // 启用日期 日期控件开关
  375 + self.openDateOpen = false;
  376 + self.openDate_open = function() {
  377 + self.openDateOpen = true;
  378 + };
  379 + // 取消日期 日期控件开关
  380 + self.closeDateOpen = false;
  381 + self.closeDate_open = function() {
  382 + self.closeDateOpen = true;
  383 + };
  384 +
  385 + // 欲保存的busInfo信息,绑定
  386 + self.busInfoForSave = new Cars;
  387 +
  388 + // 获取传过来的id,有的话就是修改,获取一遍数据
  389 + var id = $stateParams.id;
  390 + if (id) {
  391 + self.busInfoForSave = Cars.get({id: id}, function() {});
  392 + }
  393 +
  394 + // 提交方法
  395 + self.submit = function() {
  396 + console.log(self.busInfoForSave);
  397 +
  398 + // // 报废的车辆,修改原来的车辆终端号
  399 + // if (self.busInfoForSave.scrapState == true) {
  400 + // self.busInfoForSave.equipmentCode = "BF-" + self.busInfoForSave.equipmentCode;
  401 + // self.busInfoForSave.scrapCode = "BF-" + self.busInfoForSave.equipmentCode;
  402 + // }
  403 +
  404 +
  405 + // 保存或者更新
  406 + self.busInfoForSave.$save(function() {
  407 + DataStore.refreshData("cl");
  408 + $state.go("busInfoManage");
  409 + });
  410 + };
  411 + }
  412 + ]
  413 +);
  414 +
  415 +// detail.html控制器
  416 +angular.module('ScheduleApp').controller(
  417 + 'BusInfoManageDetailCtrl',
  418 + [
  419 + 'BusInfoManageService',
  420 + '$stateParams',
  421 + function(service, $stateParams) {
  422 + var self = this;
  423 + var Cars = service.getQueryClass();
  424 + var id = $stateParams.id;
  425 +
  426 + self.title = "";
  427 + self.busInfoForDetail = {};
  428 +
  429 + // 当转向到此页面时,就获取明细信息并绑定
  430 + self.busInfoForDetail = Cars.get({id: id}, function() {
  431 + self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息";
  432 + });
  433 + }
  434 + ]
  435 +);
... ...
src/main/resources/static/pages/video/bus_info_route.js 0 → 100644
  1 +// ui route 配置
  2 +
  3 +/** 车辆基础信息模块配置route */
  4 +ScheduleApp.config([
  5 + '$stateProvider',
  6 + '$urlRouterProvider',
  7 + function($stateProvider, $urlRouterProvider) {
  8 + // 默认路由
  9 + //$urlRouterProvider.otherwise('/busConfig.html');
  10 +
  11 + $stateProvider
  12 + .state("busInfoManage", { // index页面
  13 + url: '/busInfoManage',
  14 + views: {
  15 + "": {
  16 + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html'
  17 + },
  18 + "busInfoManage_list@busInfoManage": {
  19 + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html'
  20 + }
  21 + },
  22 +
  23 + resolve: {
  24 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  25 + return $ocLazyLoad.load({
  26 + name: 'busInfoManage_module',
  27 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  28 + files: [
  29 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  30 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  31 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  32 + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js"
  33 + ]
  34 + });
  35 + }]
  36 + }
  37 + })
  38 + .state("busInfoManage_form", { // 添加车辆form
  39 + url: '/busInfoManage_form',
  40 + views: {
  41 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'}
  42 + },
  43 + resolve: {
  44 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  45 + return $ocLazyLoad.load({
  46 + name: 'busInfoManage_form_module',
  47 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  48 + files: [
  49 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  50 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  51 + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js"
  52 + ]
  53 + });
  54 + }]
  55 + }
  56 + })
  57 + .state("busInfoManage_edit", { // 修改车辆form
  58 + url: '/busInfoManage_edit/:id',
  59 + views: {
  60 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'}
  61 + },
  62 + resolve: {
  63 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  64 + return $ocLazyLoad.load({
  65 + name: 'busInfoManage_edit_module',
  66 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  67 + files: [
  68 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  69 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  70 + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js"
  71 + ]
  72 + });
  73 + }]
  74 + }
  75 + })
  76 + .state("busInfoManage_detail", { // 车辆详细信息
  77 + url: '/busInfoManage_detail/:id',
  78 + views: {
  79 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'}
  80 + },
  81 + resolve: {
  82 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  83 + return $ocLazyLoad.load({
  84 + name: 'busInfoManage_detail_module',
  85 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  86 + files: [
  87 + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js"
  88 + ]
  89 + });
  90 + }]
  91 + }
  92 + })
  93 + }
  94 +]);
0 95 \ No newline at end of file
... ...
src/main/resources/static/pages/video/test.html 0 → 100644
src/main/resources/static/pages/video/video.html 0 → 100644
  1 +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/themes/default/style.min.css" />
  2 +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.1/jquery.min.js"></script>
  3 +<script src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/jstree.min.js"></script>
  4 +
  5 +<script>
  6 +
  7 + $(document).ready(function (){
  8 + $.get("/video/tree1",function (data){
  9 + $('#video_tree').jstree({ 'core' : {
  10 + 'data' :$.parseJSON(data)
  11 + } });
  12 + });
  13 + });
  14 +
  15 + function combinationNodes(nodes){
  16 + var html="";
  17 + if(nodes){
  18 + html = html+"<ul>";
  19 + $.each(nodes,function (index,node){
  20 + html = html+combinationNode(node);
  21 + if(node.children){
  22 + html=html+combinationNodes(node.children)
  23 + }
  24 + });
  25 + html = html+"</ul>";
  26 + }
  27 + return html;
  28 + }
  29 + function combinationNode(node){
  30 + return "<li nodeId='"+node.id+"' nodeType='"+node.type+"' nodeSourceId='"+node.sourceId+"'>"+node.text+"</li>";
  31 + }
  32 +
  33 +</script>
  34 +
  35 +<div class="page-head">
  36 + <div class="page-title">
  37 + <h1>视频管理</h1>
  38 + </div>
  39 +</div>
  40 +
  41 +<ul class="page-breadcrumb breadcrumb">
  42 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  43 + <li><span class="active">视频管理</span> <i class="fa fa-circle"></i></li>
  44 +</ul>
  45 +
  46 +
  47 +<div class="row">
  48 + <div class="col-md-4" style="padding-right: 0px;">
  49 + <div class="portlet light bordered" style="min-height: 520px;">
  50 + <div class="portlet-body">
  51 + <div id="video_tree" ></div>
  52 + </div>
  53 + </div>
  54 + </div>
  55 +
  56 + <div class="col-md-6" style="padding-left: 0px;">
  57 + <div class="portlet light bordered" style="height: 520px;">
  58 + <div class="portlet-body" style="min-height: 200px;">
  59 + <div class="text-info" style="text-align: center;line-height: 200px;">
  60 + <i class="fa fa-info"></i> 单击节点查看详细
  61 + </div>
  62 + </div>
  63 + </div>
  64 + </div>
  65 +</div>
  66 +
... ...
src/main/resources/static/pages/video/videoPage.html 0 → 100644
  1 +<script type="text/javascript">
  2 + var url = window.location.href;
  3 + url= url.substring(0,url.indexOf("/pages/"))+"/video/video.html";
  4 + window.location.href=url;
  5 +</script>
... ...