Commit 43d5036431889f5712a8e1da2856f4db9558810a
1 parent
f05c5a7c
update...
Showing
26 changed files
with
809 additions
and
118 deletions
src/main/java/com/bsth/StartCommand.java
| 1 | package com.bsth; | 1 | package com.bsth; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import com.bsth.data.abnormal.rate_chart.thread.FixedCalcRateThread; | ||
| 4 | import com.bsth.data.abnormal.thread.AbnormalFixedScannerThread; | 5 | import com.bsth.data.abnormal.thread.AbnormalFixedScannerThread; |
| 5 | import com.bsth.data.in_out.buffer.BerthDataBuffer; | 6 | import com.bsth.data.in_out.buffer.BerthDataBuffer; |
| 6 | import com.bsth.data.in_out.thread.Car2BerthDataPstThread; | 7 | import com.bsth.data.in_out.thread.Car2BerthDataPstThread; |
| @@ -8,7 +9,7 @@ import com.bsth.data.in_out.thread.SignalPstThread; | @@ -8,7 +9,7 @@ import com.bsth.data.in_out.thread.SignalPstThread; | ||
| 8 | import com.bsth.data.led_http.LedHttpPushHandler; | 9 | import com.bsth.data.led_http.LedHttpPushHandler; |
| 9 | import com.bsth.data.msg_queue.SignalAndAttConsumeQueue; | 10 | import com.bsth.data.msg_queue.SignalAndAttConsumeQueue; |
| 10 | import com.bsth.data.msg_queue.WebSocketPushQueue; | 11 | import com.bsth.data.msg_queue.WebSocketPushQueue; |
| 11 | -import com.bsth.security.SecurityMetadataSourceService; | 12 | +import org.joda.time.format.DateTimeFormat; |
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.boot.CommandLineRunner; | 14 | import org.springframework.boot.CommandLineRunner; |
| 14 | import org.springframework.stereotype.Component; | 15 | import org.springframework.stereotype.Component; |
| @@ -26,8 +27,6 @@ import java.util.concurrent.TimeUnit; | @@ -26,8 +27,6 @@ import java.util.concurrent.TimeUnit; | ||
| 26 | public class StartCommand implements CommandLineRunner{ | 27 | public class StartCommand implements CommandLineRunner{ |
| 27 | 28 | ||
| 28 | @Autowired | 29 | @Autowired |
| 29 | - SecurityMetadataSourceService invocationSecurityMetadataSourceService; | ||
| 30 | - @Autowired | ||
| 31 | SignalPstThread signalPstThread; | 30 | SignalPstThread signalPstThread; |
| 32 | @Autowired | 31 | @Autowired |
| 33 | LedHttpPushHandler ledHttpPushHandler; | 32 | LedHttpPushHandler ledHttpPushHandler; |
| @@ -37,13 +36,13 @@ public class StartCommand implements CommandLineRunner{ | @@ -37,13 +36,13 @@ public class StartCommand implements CommandLineRunner{ | ||
| 37 | Car2BerthDataPstThread car2BerthDataPstThread; | 36 | Car2BerthDataPstThread car2BerthDataPstThread; |
| 38 | @Autowired | 37 | @Autowired |
| 39 | AbnormalFixedScannerThread abnormalFixedScannerThread; | 38 | AbnormalFixedScannerThread abnormalFixedScannerThread; |
| 39 | + @Autowired | ||
| 40 | + FixedCalcRateThread fixedCalcRateThread; | ||
| 40 | 41 | ||
| 41 | @Override | 42 | @Override |
| 42 | public void run(String... arg0){ | 43 | public void run(String... arg0){ |
| 43 | 44 | ||
| 44 | try { | 45 | try { |
| 45 | - //启动时加载所有资源 | ||
| 46 | - invocationSecurityMetadataSourceService.loadResourceDefine(); | ||
| 47 | 46 | ||
| 48 | //同步屏 LED 推送服务 | 47 | //同步屏 LED 推送服务 |
| 49 | //ledHttpPushHandler.start(); | 48 | //ledHttpPushHandler.start(); |
| @@ -62,11 +61,14 @@ public class StartCommand implements CommandLineRunner{ | @@ -62,11 +61,14 @@ public class StartCommand implements CommandLineRunner{ | ||
| 62 | //实时车辆泊位数据入库 | 61 | //实时车辆泊位数据入库 |
| 63 | sexec.scheduleWithFixedDelay(car2BerthDataPstThread, 20, 20, TimeUnit.SECONDS); | 62 | sexec.scheduleWithFixedDelay(car2BerthDataPstThread, 20, 20, TimeUnit.SECONDS); |
| 64 | 63 | ||
| 65 | - | ||
| 66 | /** | 64 | /** |
| 67 | * 异常监管 | 65 | * 异常监管 |
| 68 | */ | 66 | */ |
| 69 | - sexec.scheduleAtFixedRate(abnormalFixedScannerThread, 80, 60, TimeUnit.SECONDS); | 67 | + sexec.scheduleAtFixedRate(abnormalFixedScannerThread, 40, 60, TimeUnit.SECONDS); |
| 68 | + //定时计算统计率(第0秒开始) | ||
| 69 | + int seconeds = Integer.parseInt(DateTimeFormat.forPattern("mm").print(System.currentTimeMillis())); | ||
| 70 | + sexec.scheduleAtFixedRate(fixedCalcRateThread, 60 - seconeds, 60, TimeUnit.SECONDS); | ||
| 71 | + | ||
| 70 | } catch (Exception e) { | 72 | } catch (Exception e) { |
| 71 | e.printStackTrace(); | 73 | e.printStackTrace(); |
| 72 | } | 74 | } |
src/main/java/com/bsth/controller/plan/SchedulePlanController.java
0 → 100644
| 1 | +package com.bsth.controller.plan; | ||
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSONArray; | ||
| 4 | +import com.bsth.data.utils.HttpClientUtils; | ||
| 5 | +import com.bsth.data.utils.RsRequestUtils; | ||
| 6 | +import com.bsth.util.ConfigUtil; | ||
| 7 | +import org.slf4j.Logger; | ||
| 8 | +import org.slf4j.LoggerFactory; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 10 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 11 | +import org.springframework.web.bind.annotation.RestController; | ||
| 12 | + | ||
| 13 | +import java.util.List; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 计划排班 | ||
| 17 | + */ | ||
| 18 | +@RestController | ||
| 19 | +@RequestMapping("plan_sch") | ||
| 20 | +public class SchedulePlanController { | ||
| 21 | + | ||
| 22 | + static String dataUrl; | ||
| 23 | + | ||
| 24 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 25 | + | ||
| 26 | + static { | ||
| 27 | + dataUrl = ConfigUtil.get("data.base.url") + "/rest/schedule"; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + @RequestMapping("findInOutPlan") | ||
| 31 | + public List<Object> findInOutPlan(@RequestParam String rq,@RequestParam String lineCode) { | ||
| 32 | + List<Object> rs = null; | ||
| 33 | + try { | ||
| 34 | + StringBuilder sb = HttpClientUtils.get(dataUrl + "/plan_inout/" + rq + "/" + lineCode + RsRequestUtils.getParams()); | ||
| 35 | + | ||
| 36 | + rs = JSONArray.parseArray(sb.toString()); | ||
| 37 | + } catch (Exception e) { | ||
| 38 | + logger.error("", e); | ||
| 39 | + } | ||
| 40 | + return rs; | ||
| 41 | + } | ||
| 42 | +} |
src/main/java/com/bsth/controller/sys/UserController.java
| @@ -178,4 +178,15 @@ public class UserController extends BaseController<SysUser, Integer> { | @@ -178,4 +178,15 @@ public class UserController extends BaseController<SysUser, Integer> { | ||
| 178 | public List<SysUser> findAll_distinct(){ | 178 | public List<SysUser> findAll_distinct(){ |
| 179 | return sysUserService.findAll_distinct(); | 179 | return sysUserService.findAll_distinct(); |
| 180 | } | 180 | } |
| 181 | + | ||
| 182 | + | ||
| 183 | + @RequestMapping(value = "/configLineIdx") | ||
| 184 | + public Map<String, Object> configLineIdx(@RequestParam String idx){ | ||
| 185 | + return sysUserService.configLineIdx(idx); | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + @RequestMapping(value = "/getLineIdx") | ||
| 189 | + public String getLineIdx(){ | ||
| 190 | + return sysUserService.getLineIdx(); | ||
| 191 | + } | ||
| 181 | } | 192 | } |
src/main/java/com/bsth/data/basic/bus/BusDataBuffer.java
| @@ -46,7 +46,7 @@ public class BusDataBuffer implements CommandLineRunner { | @@ -46,7 +46,7 @@ public class BusDataBuffer implements CommandLineRunner { | ||
| 46 | static { | 46 | static { |
| 47 | list = new ArrayList<>(); | 47 | list = new ArrayList<>(); |
| 48 | idMaps = new HashMap<>(); | 48 | idMaps = new HashMap<>(); |
| 49 | - dataUrl = ConfigUtil.get("data.bus.url"); | 49 | + dataUrl = ConfigUtil.get("data.base.url") + "/rest/car"; |
| 50 | companys = Splitter.on(",").splitToList(ConfigUtil.get("tcc.company.id")); | 50 | companys = Splitter.on(",").splitToList(ConfigUtil.get("tcc.company.id")); |
| 51 | } | 51 | } |
| 52 | 52 |
src/main/java/com/bsth/data/basic/line/LineDataBuffer.java
| @@ -35,7 +35,7 @@ public class LineDataBuffer implements CommandLineRunner { | @@ -35,7 +35,7 @@ public class LineDataBuffer implements CommandLineRunner { | ||
| 35 | static Logger logger = LoggerFactory.getLogger(PersonDataBuffer.class); | 35 | static Logger logger = LoggerFactory.getLogger(PersonDataBuffer.class); |
| 36 | 36 | ||
| 37 | static { | 37 | static { |
| 38 | - dataUrl = ConfigUtil.get("data.line.url"); | 38 | + dataUrl = ConfigUtil.get("data.base.url") + "/rest/line"; |
| 39 | companys = Splitter.on(",").splitToList(ConfigUtil.get("tcc.company.id")); | 39 | companys = Splitter.on(",").splitToList(ConfigUtil.get("tcc.company.id")); |
| 40 | } | 40 | } |
| 41 | 41 |
src/main/java/com/bsth/data/basic/person/PersonDataBuffer.java
| @@ -43,7 +43,7 @@ public class PersonDataBuffer implements CommandLineRunner { | @@ -43,7 +43,7 @@ public class PersonDataBuffer implements CommandLineRunner { | ||
| 43 | static { | 43 | static { |
| 44 | list = new ArrayList<>(); | 44 | list = new ArrayList<>(); |
| 45 | idMaps = new HashMap<>(); | 45 | idMaps = new HashMap<>(); |
| 46 | - dataUrl = ConfigUtil.get("data.person.url"); | 46 | + dataUrl = ConfigUtil.get("data.base.url") + "/rest/person"; |
| 47 | companys = Splitter.on(",").splitToList(ConfigUtil.get("tcc.company.id")); | 47 | companys = Splitter.on(",").splitToList(ConfigUtil.get("tcc.company.id")); |
| 48 | } | 48 | } |
| 49 | 49 |
src/main/java/com/bsth/data/schedule/real/ScheduleDataBuffer.java
| @@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit; | @@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit; | ||
| 36 | public class ScheduleDataBuffer implements CommandLineRunner { | 36 | public class ScheduleDataBuffer implements CommandLineRunner { |
| 37 | 37 | ||
| 38 | private static String tccCode; | 38 | private static String tccCode; |
| 39 | - private static String dataUrl; | 39 | + public static String dataUrl; |
| 40 | private static ConcurrentHashMap<Long, ScheduleInOut> allMaps; | 40 | private static ConcurrentHashMap<Long, ScheduleInOut> allMaps; |
| 41 | private static List<ScheduleInOut> outList; | 41 | private static List<ScheduleInOut> outList; |
| 42 | private static List<ScheduleInOut> inList; | 42 | private static List<ScheduleInOut> inList; |
| @@ -67,7 +67,7 @@ public class ScheduleDataBuffer implements CommandLineRunner { | @@ -67,7 +67,7 @@ public class ScheduleDataBuffer implements CommandLineRunner { | ||
| 67 | static { | 67 | static { |
| 68 | allMaps = new ConcurrentHashMap<>(); | 68 | allMaps = new ConcurrentHashMap<>(); |
| 69 | tccCode = ConfigUtil.get("tcc.code"); | 69 | tccCode = ConfigUtil.get("tcc.code"); |
| 70 | - dataUrl = ConfigUtil.get("data.schedule.inout.url"); | 70 | + dataUrl = ConfigUtil.get("data.base.url") + "/rest/schedule_real"; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | public static Collection<ScheduleInOut> all() { | 73 | public static Collection<ScheduleInOut> all() { |
src/main/java/com/bsth/entity/sys/SysUser.java
| @@ -50,6 +50,7 @@ public class SysUser { | @@ -50,6 +50,7 @@ public class SysUser { | ||
| 50 | @ManyToMany(fetch = FetchType.EAGER) | 50 | @ManyToMany(fetch = FetchType.EAGER) |
| 51 | private Set<Role> roles = new LinkedHashSet<>(); | 51 | private Set<Role> roles = new LinkedHashSet<>(); |
| 52 | 52 | ||
| 53 | + private String lineIdx; | ||
| 53 | 54 | ||
| 54 | public Integer getId() { | 55 | public Integer getId() { |
| 55 | return id; | 56 | return id; |
| @@ -138,4 +139,12 @@ public class SysUser { | @@ -138,4 +139,12 @@ public class SysUser { | ||
| 138 | public void setFgsCompany(String fgsCompany) { | 139 | public void setFgsCompany(String fgsCompany) { |
| 139 | this.fgsCompany = fgsCompany; | 140 | this.fgsCompany = fgsCompany; |
| 140 | } | 141 | } |
| 142 | + | ||
| 143 | + public String getLineIdx() { | ||
| 144 | + return lineIdx; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + public void setLineIdx(String lineIdx) { | ||
| 148 | + this.lineIdx = lineIdx; | ||
| 149 | + } | ||
| 141 | } | 150 | } |
src/main/java/com/bsth/repository/sys/SysUserRepository.java
| @@ -2,7 +2,6 @@ package com.bsth.repository.sys; | @@ -2,7 +2,6 @@ package com.bsth.repository.sys; | ||
| 2 | 2 | ||
| 3 | import com.bsth.entity.sys.SysUser; | 3 | import com.bsth.entity.sys.SysUser; |
| 4 | import com.bsth.repository.BaseRepository; | 4 | import com.bsth.repository.BaseRepository; |
| 5 | -import org.springframework.data.jpa.repository.EntityGraph; | ||
| 6 | import org.springframework.data.jpa.repository.Modifying; | 5 | import org.springframework.data.jpa.repository.Modifying; |
| 7 | import org.springframework.data.jpa.repository.Query; | 6 | import org.springframework.data.jpa.repository.Query; |
| 8 | import org.springframework.stereotype.Repository; | 7 | import org.springframework.stereotype.Repository; |
| @@ -27,4 +26,9 @@ public interface SysUserRepository extends BaseRepository<SysUser, Integer>{ | @@ -27,4 +26,9 @@ public interface SysUserRepository extends BaseRepository<SysUser, Integer>{ | ||
| 27 | 26 | ||
| 28 | @Query(value = "select DISTINCT u from SysUser u") | 27 | @Query(value = "select DISTINCT u from SysUser u") |
| 29 | List<SysUser> findAll_distinct(); | 28 | List<SysUser> findAll_distinct(); |
| 29 | + | ||
| 30 | + @Transactional | ||
| 31 | + @Modifying | ||
| 32 | + @Query(value="update SysUser set lineIdx=?1") | ||
| 33 | + void updateLineIdx(String idx); | ||
| 30 | } | 34 | } |
src/main/java/com/bsth/service/schedule/impl/ScheduleServiceImpl.java
| @@ -21,7 +21,6 @@ import com.bsth.entity.Line; | @@ -21,7 +21,6 @@ import com.bsth.entity.Line; | ||
| 21 | import com.bsth.entity.Person; | 21 | import com.bsth.entity.Person; |
| 22 | import com.bsth.security.util.SecurityUtils; | 22 | import com.bsth.security.util.SecurityUtils; |
| 23 | import com.bsth.service.schedule.ScheduleService; | 23 | import com.bsth.service.schedule.ScheduleService; |
| 24 | -import com.bsth.util.ConfigUtil; | ||
| 25 | import com.bsth.websocket.handler.SendUtils; | 24 | import com.bsth.websocket.handler.SendUtils; |
| 26 | import com.google.common.base.Splitter; | 25 | import com.google.common.base.Splitter; |
| 27 | import org.apache.commons.lang3.StringEscapeUtils; | 26 | import org.apache.commons.lang3.StringEscapeUtils; |
| @@ -46,18 +45,12 @@ public class ScheduleServiceImpl implements ScheduleService { | @@ -46,18 +45,12 @@ public class ScheduleServiceImpl implements ScheduleService { | ||
| 46 | @Autowired | 45 | @Autowired |
| 47 | MainAbnormalClient mainAbnormalClient; | 46 | MainAbnormalClient mainAbnormalClient; |
| 48 | 47 | ||
| 49 | - private static String dataUrl; | ||
| 50 | - | ||
| 51 | @Autowired | 48 | @Autowired |
| 52 | ScheduleDataBuffer scheduleDataBuffer; | 49 | ScheduleDataBuffer scheduleDataBuffer; |
| 53 | 50 | ||
| 54 | @Autowired | 51 | @Autowired |
| 55 | SendUtils sendUtils; | 52 | SendUtils sendUtils; |
| 56 | 53 | ||
| 57 | - static { | ||
| 58 | - dataUrl = ConfigUtil.get("data.schedule.inout.url"); | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 54 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 62 | 55 | ||
| 63 | private static DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); | 56 | private static DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); |
| @@ -132,7 +125,7 @@ public class ScheduleServiceImpl implements ScheduleService { | @@ -132,7 +125,7 @@ public class ScheduleServiceImpl implements ScheduleService { | ||
| 132 | try { | 125 | try { |
| 133 | //从集调接口获取路牌下的班次信息 | 126 | //从集调接口获取路牌下的班次信息 |
| 134 | lpName = URLEncoder.encode(lpName, "UTF-8"); | 127 | lpName = URLEncoder.encode(lpName, "UTF-8"); |
| 135 | - String url = dataUrl + "/findByLpName/" + lineCode + "/" + lpName + RsRequestUtils.getParams(); | 128 | + String url = ScheduleDataBuffer.dataUrl + "/findByLpName/" + lineCode + "/" + lpName + RsRequestUtils.getParams(); |
| 136 | StringBuilder sb = HttpClientUtils.get(url); | 129 | StringBuilder sb = HttpClientUtils.get(url); |
| 137 | List<ScheduleRealInfo> list = JSON.parseArray(sb.toString(), ScheduleRealInfo.class); | 130 | List<ScheduleRealInfo> list = JSON.parseArray(sb.toString(), ScheduleRealInfo.class); |
| 138 | 131 | ||
| @@ -164,7 +157,7 @@ public class ScheduleServiceImpl implements ScheduleService { | @@ -164,7 +157,7 @@ public class ScheduleServiceImpl implements ScheduleService { | ||
| 164 | Map<String, Object> rs = new HashMap<>(); | 157 | Map<String, Object> rs = new HashMap<>(); |
| 165 | try { | 158 | try { |
| 166 | map.put("userId", SecurityUtils.getCurrentUser().getUserName()); | 159 | map.put("userId", SecurityUtils.getCurrentUser().getUserName()); |
| 167 | - StringBuilder sb = HttpClientUtils.post(dataUrl + "/tcc_dftz" + RsRequestUtils.getParams(), JSON.toJSONString(map)); | 160 | + StringBuilder sb = HttpClientUtils.post(ScheduleDataBuffer.dataUrl + "/tcc_dftz" + RsRequestUtils.getParams(), JSON.toJSONString(map)); |
| 168 | 161 | ||
| 169 | rs = JSON.parseObject(sb.toString()); | 162 | rs = JSON.parseObject(sb.toString()); |
| 170 | 163 | ||
| @@ -196,7 +189,7 @@ public class ScheduleServiceImpl implements ScheduleService { | @@ -196,7 +189,7 @@ public class ScheduleServiceImpl implements ScheduleService { | ||
| 196 | params.put("userId", SecurityUtils.getCurrentUser().getUserName()); | 189 | params.put("userId", SecurityUtils.getCurrentUser().getUserName()); |
| 197 | params.put("cpcs", JSON.parseArray(cpcsJson)); | 190 | params.put("cpcs", JSON.parseArray(cpcsJson)); |
| 198 | params.put("tccCode", Constants.tccCode); | 191 | params.put("tccCode", Constants.tccCode); |
| 199 | - StringBuilder sb = HttpClientUtils.post(dataUrl + "/tcc_tzrc" + RsRequestUtils.getParams(), JSON.toJSONString(params)); | 192 | + StringBuilder sb = HttpClientUtils.post(ScheduleDataBuffer.dataUrl + "/tcc_tzrc" + RsRequestUtils.getParams(), JSON.toJSONString(params)); |
| 200 | 193 | ||
| 201 | rs = JSON.parseObject(sb.toString()); | 194 | rs = JSON.parseObject(sb.toString()); |
| 202 | 195 |
src/main/java/com/bsth/service/sys/SysUserService.java
| @@ -17,4 +17,8 @@ public interface SysUserService extends BaseService<SysUser, Integer>{ | @@ -17,4 +17,8 @@ public interface SysUserService extends BaseService<SysUser, Integer>{ | ||
| 17 | Map<String,Object> register(SysUser u); | 17 | Map<String,Object> register(SysUser u); |
| 18 | 18 | ||
| 19 | List<SysUser> findAll_distinct(); | 19 | List<SysUser> findAll_distinct(); |
| 20 | + | ||
| 21 | + Map<String,Object> configLineIdx(String idx); | ||
| 22 | + | ||
| 23 | + String getLineIdx(); | ||
| 20 | } | 24 | } |
src/main/java/com/bsth/service/sys/impl/SysUserServiceImpl.java
| @@ -3,6 +3,7 @@ package com.bsth.service.sys.impl; | @@ -3,6 +3,7 @@ package com.bsth.service.sys.impl; | ||
| 3 | import com.bsth.common.ResponseCode; | 3 | import com.bsth.common.ResponseCode; |
| 4 | import com.bsth.entity.sys.SysUser; | 4 | import com.bsth.entity.sys.SysUser; |
| 5 | import com.bsth.repository.sys.SysUserRepository; | 5 | import com.bsth.repository.sys.SysUserRepository; |
| 6 | +import com.bsth.security.util.SecurityUtils; | ||
| 6 | import com.bsth.service.impl.BaseServiceImpl; | 7 | import com.bsth.service.impl.BaseServiceImpl; |
| 7 | import com.bsth.service.sys.SysUserService; | 8 | import com.bsth.service.sys.SysUserService; |
| 8 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| @@ -76,4 +77,29 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUser, Integer> implem | @@ -76,4 +77,29 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUser, Integer> implem | ||
| 76 | public List<SysUser> findAll_distinct() { | 77 | public List<SysUser> findAll_distinct() { |
| 77 | return sysUserRepository.findAll_distinct(); | 78 | return sysUserRepository.findAll_distinct(); |
| 78 | } | 79 | } |
| 80 | + | ||
| 81 | + @Override | ||
| 82 | + public Map<String, Object> configLineIdx(String idx) { | ||
| 83 | + Map<String, Object> rs = new HashMap<>(); | ||
| 84 | + try{ | ||
| 85 | + sysUserRepository.updateLineIdx(idx); | ||
| 86 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 87 | + }catch (Exception e){ | ||
| 88 | + rs.put("status", ResponseCode.ERROR); | ||
| 89 | + rs.put("msg", "服务器出现异常!!"); | ||
| 90 | + } | ||
| 91 | + return rs; | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + @Override | ||
| 95 | + public String getLineIdx() { | ||
| 96 | + String idx = ""; | ||
| 97 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 98 | + | ||
| 99 | + if(null == user) | ||
| 100 | + return null; | ||
| 101 | + | ||
| 102 | + idx = sysUserRepository.findOne(user.getId()).getLineIdx(); | ||
| 103 | + return idx; | ||
| 104 | + } | ||
| 79 | } | 105 | } |
src/main/resources/application.properties
| 1 | spring.profiles: dev,prod | 1 | spring.profiles: dev,prod |
| 2 | -spring.profiles.active: prod | 2 | +spring.profiles.active: dev |
| 3 | 3 | ||
| 4 | spring.view.suffix=.html | 4 | spring.view.suffix=.html |
| 5 | server.session-timeout=-1 | 5 | server.session-timeout=-1 |
| @@ -11,6 +11,8 @@ multipart.maxFileSize = -1 | @@ -11,6 +11,8 @@ multipart.maxFileSize = -1 | ||
| 11 | # Total request size for a multipart/form-data | 11 | # Total request size for a multipart/form-data |
| 12 | multipart.maxRequestSize = -1 | 12 | multipart.maxRequestSize = -1 |
| 13 | 13 | ||
| 14 | +server.session.timeout= -1 | ||
| 15 | + | ||
| 14 | server.compression.enabled=true | 16 | server.compression.enabled=true |
| 15 | server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain,text/javascript,text/css,application/javascript | 17 | server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain,text/javascript,text/css,application/javascript |
| 16 | 18 |
src/main/resources/config.properties
| @@ -2,18 +2,12 @@ | @@ -2,18 +2,12 @@ | ||
| 2 | 2 | ||
| 3 | #公司编码和名称对照JSON | 3 | #公司编码和名称对照JSON |
| 4 | data.company.json={"55": {"name": "上南公司","fgs": {"4": "上南一分公司","3": "上南六分公司","1": "上南二分公司","2": "上南三分公司"}},"22": {"name": "金高公司","fgs": {"2": "二分公司","1": "四分公司","3": "三分公司","5": "一分公司"}},"05": {"name": "杨高公司","fgs": {"5": "杨高分公司","6": "周浦分公司","3": "芦潮港分公司","1": "川沙分公司","2": "金桥分公司"}},"26": {"name": "南汇公司","fgs": {"3": "南汇三分","2": "南汇二分","1": "南汇一分","4": "南汇维修公司","5": "南汇公司"}}} | 4 | data.company.json={"55": {"name": "上南公司","fgs": {"4": "上南一分公司","3": "上南六分公司","1": "上南二分公司","2": "上南三分公司"}},"22": {"name": "金高公司","fgs": {"2": "二分公司","1": "四分公司","3": "三分公司","5": "一分公司"}},"05": {"name": "杨高公司","fgs": {"5": "杨高分公司","6": "周浦分公司","3": "芦潮港分公司","1": "川沙分公司","2": "金桥分公司"}},"26": {"name": "南汇公司","fgs": {"3": "南汇三分","2": "南汇二分","1": "南汇一分","4": "南汇维修公司","5": "南汇公司"}}} |
| 5 | -#人员信息数据源 | ||
| 6 | -data.person.url=http://114.80.178.12:9089/webservice/rest/person | ||
| 7 | -#data.person.url=http://127.0.0.1:9089/webservice/rest/person | ||
| 8 | -#线路信息数据源 | ||
| 9 | -data.line.url=http://114.80.178.12:9089/webservice/rest/line | ||
| 10 | -#data.line.url=http://127.0.0.1:9089/webservice/rest/line | ||
| 11 | -#车辆信息数据源 | ||
| 12 | -data.bus.url=http://114.80.178.12:9089/webservice/rest/car | ||
| 13 | -#data.bus.url=http://127.0.0.1:9089/webservice/rest/car | ||
| 14 | -#进出场排班数据源 | ||
| 15 | -data.schedule.inout.url=http://114.80.178.12:9089/webservice/rest/schedule_real | ||
| 16 | -#data.schedule.inout.url=http://127.0.0.1:9089/webservice/rest/schedule_real | 5 | + |
| 6 | +## 数据接口服务 | ||
| 7 | +data.base.url=http://127.0.0.1:9089/webservice | ||
| 8 | +#data.base.url=http://114.80.178.12:9089/webservice | ||
| 9 | + | ||
| 10 | + | ||
| 17 | # 集调接口密码 | 11 | # 集调接口密码 |
| 18 | data.password=6DABD12209BEDAB0808CF7DC967EC2B4C6748277 | 12 | data.password=6DABD12209BEDAB0808CF7DC967EC2B4C6748277 |
| 19 | 13 | ||
| @@ -21,6 +15,6 @@ data.password=6DABD12209BEDAB0808CF7DC967EC2B4C6748277 | @@ -21,6 +15,6 @@ data.password=6DABD12209BEDAB0808CF7DC967EC2B4C6748277 | ||
| 21 | led.push.url= http://192.168.0.10:8081/get/ | 15 | led.push.url= http://192.168.0.10:8081/get/ |
| 22 | 16 | ||
| 23 | ## 高科西路 | 17 | ## 高科西路 |
| 24 | -tcc.name=高科西路 | ||
| 25 | -tcc.company.id=55 | ||
| 26 | -tcc.code=FFFFFFF9 | 18 | +tcc.name=金高停车场 |
| 19 | +tcc.company.id=22 | ||
| 20 | +tcc.code=AB7C1101 |
src/main/resources/static/assets/css/main.css
| @@ -1031,4 +1031,68 @@ table tr th, table tr td{ | @@ -1031,4 +1031,68 @@ table tr th, table tr td{ | ||
| 1031 | 1031 | ||
| 1032 | .ct_sys_user_tab_width tr:hover .edit_icon{ | 1032 | .ct_sys_user_tab_width tr:hover .edit_icon{ |
| 1033 | visibility: visible; | 1033 | visibility: visible; |
| 1034 | -} | ||
| 1035 | \ No newline at end of file | 1034 | \ No newline at end of file |
| 1035 | +} | ||
| 1036 | + | ||
| 1037 | +.ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail { | ||
| 1038 | + opacity: 0.6 !important; | ||
| 1039 | + padding: 0 !important; | ||
| 1040 | +} | ||
| 1041 | + | ||
| 1042 | + | ||
| 1043 | +.plan_s_tab_width th:nth-of-type(1), .plan_s_tab_width td:nth-of-type(1) { | ||
| 1044 | + width: 12%; | ||
| 1045 | +} | ||
| 1046 | +.plan_s_tab_width th:nth-of-type(2), .plan_s_tab_width td:nth-of-type(2) { | ||
| 1047 | + width: 14%; | ||
| 1048 | +} | ||
| 1049 | +.plan_s_tab_width th:nth-of-type(3), .plan_s_tab_width td:nth-of-type(3) { | ||
| 1050 | + width: 10%; | ||
| 1051 | +} | ||
| 1052 | +.plan_s_tab_width th:nth-of-type(4), .plan_s_tab_width td:nth-of-type(4) { | ||
| 1053 | + width: 10%; | ||
| 1054 | +} | ||
| 1055 | +.plan_s_tab_width th:nth-of-type(5), .plan_s_tab_width td:nth-of-type(5) { | ||
| 1056 | + width: 8%; | ||
| 1057 | +} | ||
| 1058 | +.plan_s_tab_width th:nth-of-type(6), .plan_s_tab_width td:nth-of-type(6) { | ||
| 1059 | + width: 10%; | ||
| 1060 | +} | ||
| 1061 | +.plan_s_tab_width th:nth-of-type(7), .plan_s_tab_width td:nth-of-type(7) { | ||
| 1062 | + width: 7%; | ||
| 1063 | +} | ||
| 1064 | +.plan_s_tab_width th:nth-of-type(8), .plan_s_tab_width td:nth-of-type(8) { | ||
| 1065 | + width: 7%; | ||
| 1066 | +} | ||
| 1067 | +.plan_s_tab_width th:nth-of-type(9), .plan_s_tab_width td:nth-of-type(9) { | ||
| 1068 | + width: 11%; | ||
| 1069 | +} | ||
| 1070 | +.plan_s_tab_width th:nth-of-type(10), .plan_s_tab_width td:nth-of-type(10) { | ||
| 1071 | + width: 11%; | ||
| 1072 | +} | ||
| 1073 | + | ||
| 1074 | +.plan_s_tab_width tr td{ | ||
| 1075 | + vertical-align: middle; | ||
| 1076 | +} | ||
| 1077 | + | ||
| 1078 | +table.plan_s_tab_width small{ | ||
| 1079 | + color: grey; | ||
| 1080 | +} | ||
| 1081 | + | ||
| 1082 | +table.plan_s_tab_width .uk-badge{ | ||
| 1083 | + padding: 3px 12px; | ||
| 1084 | + background: #6888a7; | ||
| 1085 | + border-radius: 10px; | ||
| 1086 | + font-weight: 600; | ||
| 1087 | +} | ||
| 1088 | + | ||
| 1089 | +table.plan_s_tab_width a._grey{ | ||
| 1090 | + color: #949494; | ||
| 1091 | +} | ||
| 1092 | + | ||
| 1093 | +#plan_schedule_list_wrap .ct_search_form_wrap .ct_field input, | ||
| 1094 | +#plan_schedule_list_wrap .ct_search_form_wrap .ct_field select{ | ||
| 1095 | + width: 140px; | ||
| 1096 | +} | ||
| 1097 | + | ||
| 1098 | + | ||
| 1099 | + |
src/main/resources/static/assets/css/system_manager.css
| @@ -125,4 +125,66 @@ | @@ -125,4 +125,66 @@ | ||
| 125 | 125 | ||
| 126 | .footer_wrap .uk-margin-small-bottom{ | 126 | .footer_wrap .uk-margin-small-bottom{ |
| 127 | margin-bottom: 0 !important; | 127 | margin-bottom: 0 !important; |
| 128 | -} | ||
| 129 | \ No newline at end of file | 128 | \ No newline at end of file |
| 129 | +} | ||
| 130 | + | ||
| 131 | +.sys_user_line_config_page .all_lines>span{ | ||
| 132 | + background: #fff; | ||
| 133 | + color: #666; | ||
| 134 | + box-shadow: 0px 3px 12px rgba(0, 0, 0, 0.08); | ||
| 135 | + padding: 5px 12px; | ||
| 136 | + border: 1px solid #ececec; | ||
| 137 | + display: inline-block; | ||
| 138 | + margin: 5px; | ||
| 139 | + min-width: 70px; | ||
| 140 | + text-align: center; | ||
| 141 | + cursor: default; | ||
| 142 | +} | ||
| 143 | + | ||
| 144 | +.sys_user_line_config_page .all_lines{ | ||
| 145 | + height: 214px; | ||
| 146 | + overflow: auto; | ||
| 147 | + position: relative; | ||
| 148 | + padding: 15px 0 10px; | ||
| 149 | +} | ||
| 150 | + | ||
| 151 | +.sys_user_line_config_page .selected_lines>span{ | ||
| 152 | + color: #fbfbfb; | ||
| 153 | + box-shadow: 0px 3px 12px rgba(50, 197, 210, 0.3); | ||
| 154 | + padding: 7px 12px; | ||
| 155 | + border: 1px solid #ececec; | ||
| 156 | + display: inline-block; | ||
| 157 | + margin: 5px 2px; | ||
| 158 | + min-width: 70px; | ||
| 159 | + text-align: center; | ||
| 160 | + background: #32C5D2; | ||
| 161 | + cursor: move; | ||
| 162 | + height: 25px !important; | ||
| 163 | +} | ||
| 164 | + | ||
| 165 | +.sys_user_line_config_page .selected_lines{ | ||
| 166 | + border-top: 1px solid #ececec; | ||
| 167 | + width: calc(100% + 10px); | ||
| 168 | + margin-left: -30px; | ||
| 169 | + padding: 25px; | ||
| 170 | + box-shadow: 0px -4px 7px rgba(0, 0, 0, 0.08); | ||
| 171 | + border-bottom: 1px solid #ebebeb; | ||
| 172 | + min-height: 50px; | ||
| 173 | +} | ||
| 174 | + | ||
| 175 | +.sys_user_line_config_page .company_search_wrap select { | ||
| 176 | + display: inline-block; | ||
| 177 | + width: 128px; | ||
| 178 | + margin-right: 12px; | ||
| 179 | +} | ||
| 180 | + | ||
| 181 | +.sys_user_line_config_page .company_search_wrap{ | ||
| 182 | + border-bottom: 1px solid #ececec; | ||
| 183 | + width: calc(100% + 10px); | ||
| 184 | + margin-left: -30px; | ||
| 185 | + padding: 25px; | ||
| 186 | + box-shadow: 0px 4px 7px rgba(0, 0, 0, 0.08); | ||
| 187 | +} | ||
| 188 | + | ||
| 189 | +.sys_user_line_config_page .all_lines>span.active { | ||
| 190 | + background: #ffe9a5; | ||
| 191 | +} |
src/main/resources/static/index.html
| @@ -17,7 +17,6 @@ | @@ -17,7 +17,6 @@ | ||
| 17 | 17 | ||
| 18 | <!-- flatpickr --> | 18 | <!-- flatpickr --> |
| 19 | <link rel="stylesheet" href="/assets/plugins/flatpickr/flatpickr.min.css" > | 19 | <link rel="stylesheet" href="/assets/plugins/flatpickr/flatpickr.min.css" > |
| 20 | - <link rel="stylesheet" href="/assets/plugins/flatpickr/themes/material_orange.css" > | ||
| 21 | <!-- jquery contextMenu style --> | 20 | <!-- jquery contextMenu style --> |
| 22 | <link rel="stylesheet" href="/assets/plugins/contextmenu/jquery.contextMenu.min.css" /> | 21 | <link rel="stylesheet" href="/assets/plugins/contextmenu/jquery.contextMenu.min.css" /> |
| 23 | <link href="/assets/plugins/toastr/toastr.min.css" rel="stylesheet"> | 22 | <link href="/assets/plugins/toastr/toastr.min.css" rel="stylesheet"> |
| @@ -33,7 +32,7 @@ | @@ -33,7 +32,7 @@ | ||
| 33 | <span class="ct-btn-link lasting" data-name="abnormal_data" data-page="/pages/abnormal/main.html">异常监管</span> | 32 | <span class="ct-btn-link lasting" data-name="abnormal_data" data-page="/pages/abnormal/main.html">异常监管</span> |
| 34 | <span class="ct-btn-link" data-name="inout_data" data-page="/pages/inout/in_out_main.html">进出场</span> | 33 | <span class="ct-btn-link" data-name="inout_data" data-page="/pages/inout/in_out_main.html">进出场</span> |
| 35 | <span class="ct-btn-link" data-name="attendance_data" data-page="/pages/attendance/att_data_main.html">签到/退</span> | 34 | <span class="ct-btn-link" data-name="attendance_data" data-page="/pages/attendance/att_data_main.html">签到/退</span> |
| 36 | - <span class="ct-btn-link">计划/任务</span> | 35 | + <span class="ct-btn-link" data-name="schedule_plan" data-page="/pages/plan_schedule/p_s_main.html">计划排班</span> |
| 37 | <span class="ct-btn-link" data-name="basic_data" data-page="/pages/basic_data/main.html">基础数据</span> | 36 | <span class="ct-btn-link" data-name="basic_data" data-page="/pages/basic_data/main.html">基础数据</span> |
| 38 | <span class="ct-btn-link" data-name="system_manager" data-page="/pages/system_manager/sm_main.html">系统管理</span> | 37 | <span class="ct-btn-link" data-name="system_manager" data-page="/pages/system_manager/sm_main.html">系统管理</span> |
| 39 | 38 |
src/main/resources/static/js/common.js
| @@ -216,7 +216,7 @@ var gb_common = (function () { | @@ -216,7 +216,7 @@ var gb_common = (function () { | ||
| 216 | }; | 216 | }; |
| 217 | 217 | ||
| 218 | /** | 218 | /** |
| 219 | - * 构建公司到 ——> 分公司级联下拉框 (带总公司) | 219 | + * 构建公司到 ——> 分公司级联下拉框 |
| 220 | * @param comSelect | 220 | * @param comSelect |
| 221 | * @param fgsSelect | 221 | * @param fgsSelect |
| 222 | */ | 222 | */ |
| @@ -241,6 +241,7 @@ var gb_common = (function () { | @@ -241,6 +241,7 @@ var gb_common = (function () { | ||
| 241 | } | 241 | } |
| 242 | else{ | 242 | else{ |
| 243 | fgsSelect.empty().attr('disabled', 'disabled'); | 243 | fgsSelect.empty().attr('disabled', 'disabled'); |
| 244 | + return; | ||
| 244 | } | 245 | } |
| 245 | 246 | ||
| 246 | fgsSelect.html(opts).removeAttr('disabled').trigger('change'); | 247 | fgsSelect.html(opts).removeAttr('disabled').trigger('change'); |
| @@ -251,7 +252,7 @@ var gb_common = (function () { | @@ -251,7 +252,7 @@ var gb_common = (function () { | ||
| 251 | opts += '<option value="'+c+'">'+company_json[c].name+'</option>' | 252 | opts += '<option value="'+c+'">'+company_json[c].name+'</option>' |
| 252 | } | 253 | } |
| 253 | 254 | ||
| 254 | - opts+='<option value="88">总公司</option>'; | 255 | + //opts+='<option value="88">总公司</option>'; |
| 255 | comSelect.html(opts).trigger('change'); | 256 | comSelect.html(opts).trigger('change'); |
| 256 | }; | 257 | }; |
| 257 | 258 |
src/main/resources/static/js/main.js
| @@ -6,12 +6,16 @@ var current_tcc_name, current_tcc_code; | @@ -6,12 +6,16 @@ var current_tcc_name, current_tcc_code; | ||
| 6 | var toast_top_center_opts = {"positionClass": "toast-top-center"}; | 6 | var toast_top_center_opts = {"positionClass": "toast-top-center"}; |
| 7 | //按公司_分公司分组的线路数据 | 7 | //按公司_分公司分组的线路数据 |
| 8 | var groupLineArrays; | 8 | var groupLineArrays; |
| 9 | +var all_line_maps; | ||
| 10 | + | ||
| 9 | 11 | ||
| 10 | //loading end... | 12 | //loading end... |
| 11 | var ep = EventProxy.create('load_company', 'load_lines', function (companyData, linesData) { | 13 | var ep = EventProxy.create('load_company', 'load_lines', function (companyData, linesData) { |
| 12 | groupLineArrays = {}; | 14 | groupLineArrays = {}; |
| 15 | + all_line_maps = {}; | ||
| 13 | var key; | 16 | var key; |
| 14 | $.each(linesData, function () { | 17 | $.each(linesData, function () { |
| 18 | + all_line_maps[this.lineCode] = this; | ||
| 15 | key = this['company'] + '_' + this['brancheCompany']; | 19 | key = this['company'] + '_' + this['brancheCompany']; |
| 16 | if (!groupLineArrays[key]) | 20 | if (!groupLineArrays[key]) |
| 17 | groupLineArrays[key] = []; | 21 | groupLineArrays[key] = []; |
src/main/resources/static/pages/abnormal/main.html
| @@ -97,7 +97,8 @@ | @@ -97,7 +97,8 @@ | ||
| 97 | </div> | 97 | </div> |
| 98 | {{/if}} | 98 | {{/if}} |
| 99 | <div class="handler_btn_panel"> | 99 | <div class="handler_btn_panel"> |
| 100 | - <button class="uk-button uk-button-primary uk-button-small" data-type="{{obj.type}}" data-key="{{obj.schId}}_{{obj.type}}">处理 | 100 | + <button class="uk-button uk-button-primary uk-button-small" data-type="{{obj.type}}" |
| 101 | + data-key="{{obj.schId}}_{{obj.type}}">处理 | ||
| 101 | </button> | 102 | </button> |
| 102 | </div> | 103 | </div> |
| 103 | </div> | 104 | </div> |
| @@ -149,7 +150,9 @@ | @@ -149,7 +150,9 @@ | ||
| 149 | </script> | 150 | </script> |
| 150 | <script id="jd_schedule_list_table-temp" type="text/html"> | 151 | <script id="jd_schedule_list_table-temp" type="text/html"> |
| 151 | {{if list.length==0}} | 152 | {{if list.length==0}} |
| 152 | - <tr><td class="empty">没有加载到相关班次数据!</td></tr> | 153 | + <tr> |
| 154 | + <td class="empty">没有加载到相关班次数据!</td> | ||
| 155 | + </tr> | ||
| 153 | {{/if}} | 156 | {{/if}} |
| 154 | {{each list as sch i}} | 157 | {{each list as sch i}} |
| 155 | <tr data-id="{{sch.id}}" class=""> | 158 | <tr data-id="{{sch.id}}" class=""> |
| @@ -206,13 +209,17 @@ | @@ -206,13 +209,17 @@ | ||
| 206 | 209 | ||
| 207 | <input type="hidden" name="dftzId" value="{{currSch.id}}"> | 210 | <input type="hidden" name="dftzId" value="{{currSch.id}}"> |
| 208 | <div class="uk-width-1-2@s"> | 211 | <div class="uk-width-1-2@s"> |
| 209 | - <label class="uk-form-label">从<small>(停车场)</small></label> | 212 | + <label class="uk-form-label">从 |
| 213 | + <small>(停车场)</small> | ||
| 214 | + </label> | ||
| 210 | <div class="uk-form-controls"> | 215 | <div class="uk-form-controls"> |
| 211 | <input class="uk-input" value="{{currSch.qdzName}}" disabled> | 216 | <input class="uk-input" value="{{currSch.qdzName}}" disabled> |
| 212 | </div> | 217 | </div> |
| 213 | </div> | 218 | </div> |
| 214 | <div class="uk-width-1-2@s"> | 219 | <div class="uk-width-1-2@s"> |
| 215 | - <label class="uk-form-label">至<small>(站点)</small></label> | 220 | + <label class="uk-form-label">至 |
| 221 | + <small>(站点)</small> | ||
| 222 | + </label> | ||
| 216 | <div class="uk-form-controls"> | 223 | <div class="uk-form-controls"> |
| 217 | <input class="uk-input" value="{{currSch.zdzName}}" disabled> | 224 | <input class="uk-input" value="{{currSch.zdzName}}" disabled> |
| 218 | </div> | 225 | </div> |
| @@ -253,20 +260,22 @@ | @@ -253,20 +260,22 @@ | ||
| 253 | <div class="uk-width-1-2@s"> | 260 | <div class="uk-width-1-2@s"> |
| 254 | <label class="uk-form-label font-orange">预发时刻</label> | 261 | <label class="uk-form-label font-orange">预发时刻</label> |
| 255 | <div class="uk-form-controls"> | 262 | <div class="uk-form-controls"> |
| 256 | - <input class="uk-input" {{currSch.status > 0?"disabled":""}} name="newTimeStr" type="time" value="{{currSch.dfsj}}" > | 263 | + <input class="uk-input" {{currSch.status> 0?"disabled":""}} name="newTimeStr" type="time" |
| 264 | + value="{{currSch.dfsj}}" > | ||
| 257 | </div> | 265 | </div> |
| 258 | </div> | 266 | </div> |
| 259 | 267 | ||
| 260 | <div class="uk-width-1-1@s"> | 268 | <div class="uk-width-1-1@s"> |
| 261 | <label class="uk-form-label font-orange">备注</label> | 269 | <label class="uk-form-label font-orange">备注</label> |
| 262 | <div class="uk-form-controls"> | 270 | <div class="uk-form-controls"> |
| 263 | - <textarea class="uk-textarea" {{currSch.status > 0?"disabled":""}} name="remarks" rows="4" placeholder="必填,不超过50字" >{{currSch.remarks}}</textarea> | 271 | + <textarea class="uk-textarea" {{currSch.status> 0?"disabled":""}} name="remarks" rows="4" placeholder="必填,不超过50字" >{{currSch.remarks}}</textarea> |
| 264 | </div> | 272 | </div> |
| 265 | </div> | 273 | </div> |
| 266 | 274 | ||
| 267 | <div class="uk-width-1-1@s"> | 275 | <div class="uk-width-1-1@s"> |
| 268 | <br> | 276 | <br> |
| 269 | - <label class="ct_grey"><input {{currSch.status > 0?"disabled":""}} class="uk-checkbox destroy_c_box" type="checkbox" > 勾选需要烂班的班次!</label> | 277 | + <label class="ct_grey"><input {{currSch.status> 0?"disabled":""}} class="uk-checkbox destroy_c_box" |
| 278 | + type="checkbox" > 勾选需要烂班的班次!</label> | ||
| 270 | </div> | 279 | </div> |
| 271 | <div class="uk-width-1-1@s destroy_body_panel"> | 280 | <div class="uk-width-1-1@s destroy_body_panel"> |
| 272 | <table class="uk-table uk-table-small uk-table-divider tab_wid_2"> | 281 | <table class="uk-table uk-table-small uk-table-divider tab_wid_2"> |
| @@ -280,61 +289,64 @@ | @@ -280,61 +289,64 @@ | ||
| 280 | </tr> | 289 | </tr> |
| 281 | </table> | 290 | </table> |
| 282 | <div class="sch_list_table_wrap"> | 291 | <div class="sch_list_table_wrap"> |
| 283 | - <table class="uk-table uk-table-small uk-table-divider tab_wid_2 sch_list_table"> | ||
| 284 | - {{if list.length==0}} | ||
| 285 | - <tr><td class="empty">没有加载到相关班次数据!</td></tr> | ||
| 286 | - {{/if}} | ||
| 287 | - {{each list as sch i}} | ||
| 288 | - <tr data-id="{{sch.id}}"> | ||
| 289 | - <td> | ||
| 290 | - <input class="uk-checkbox " type="checkbox" name="destroyItem[{{i}}]" value="{{sch.id}}"> | ||
| 291 | - </td> | ||
| 292 | - <td> | ||
| 293 | - {{sch.fcsj}} | ||
| 294 | - {{if sch.bcType == "out"}} | ||
| 295 | - <span class="uk-badge ct_badge cc"> | 292 | + <table class="uk-table uk-table-small uk-table-divider tab_wid_2 sch_list_table"> |
| 293 | + {{if list.length==0}} | ||
| 294 | + <tr> | ||
| 295 | + <td class="empty">没有加载到相关班次数据!</td> | ||
| 296 | + </tr> | ||
| 297 | + {{/if}} | ||
| 298 | + {{each list as sch i}} | ||
| 299 | + <tr data-id="{{sch.id}}"> | ||
| 300 | + <td> | ||
| 301 | + <input class="uk-checkbox " type="checkbox" name="destroyItem[{{i}}]" value="{{sch.id}}"> | ||
| 302 | + </td> | ||
| 303 | + <td> | ||
| 304 | + {{sch.fcsj}} | ||
| 305 | + {{if sch.bcType == "out"}} | ||
| 306 | + <span class="uk-badge ct_badge cc"> | ||
| 296 | 出场 | 307 | 出场 |
| 297 | {{if sch.qdzCode!=tcc_code}} | 308 | {{if sch.qdzCode!=tcc_code}} |
| 298 | | {{sch.qdzName}} | 309 | | {{sch.qdzName}} |
| 299 | {{/if}} | 310 | {{/if}} |
| 300 | </span> | 311 | </span> |
| 301 | - {{else if sch.bcType == "in"}} | ||
| 302 | - <span class="uk-badge ct_badge jc">进场</span> | ||
| 303 | - {{else if sch.bcType == "venting"}} | ||
| 304 | - <span class="uk-badge ct_badge zf">直放</span> | ||
| 305 | - {{else if sch.bcType == "major"}} | ||
| 306 | - <span class="uk-badge ct_badge cfz">放站</span> | ||
| 307 | - {{/if}} | ||
| 308 | - {{if sch.sflj}} | ||
| 309 | - <span class="uk-badge ct_badge">临加</span> | ||
| 310 | - {{/if}} | ||
| 311 | - {{if sch.cTasks.length > 0}} | ||
| 312 | - <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | ||
| 313 | - {{/if}} | ||
| 314 | - </td> | ||
| 315 | - <td>{{sch.lpName}}</td> | ||
| 316 | - <td>{{sch.qdzName}}</td> | ||
| 317 | - <td>{{sch.zdzName}}</td> | ||
| 318 | - <td> | ||
| 319 | - {{if sch.status==2}} | ||
| 320 | - <span class="ct_zt_yzx">已执行</span> | ||
| 321 | - {{else if sch.status==1}} | ||
| 322 | - {{if sch.fcsjActual==null}} | ||
| 323 | - <span class="ct_zt_zzzx">准备执行</span> | ||
| 324 | - {{else}} | ||
| 325 | - <span class="ct_zt_zzzx">正在执行</span> | ||
| 326 | - {{/if}} | ||
| 327 | - {{else if sch.status==-1}} | ||
| 328 | - <span class="ct_zt_lb">已烂班</span> | ||
| 329 | - {{/if}} | ||
| 330 | - </td> | ||
| 331 | - </tr> | ||
| 332 | - {{/each}} | ||
| 333 | - </table> | 312 | + {{else if sch.bcType == "in"}} |
| 313 | + <span class="uk-badge ct_badge jc">进场</span> | ||
| 314 | + {{else if sch.bcType == "venting"}} | ||
| 315 | + <span class="uk-badge ct_badge zf">直放</span> | ||
| 316 | + {{else if sch.bcType == "major"}} | ||
| 317 | + <span class="uk-badge ct_badge cfz">放站</span> | ||
| 318 | + {{/if}} | ||
| 319 | + {{if sch.sflj}} | ||
| 320 | + <span class="uk-badge ct_badge">临加</span> | ||
| 321 | + {{/if}} | ||
| 322 | + {{if sch.cTasks.length > 0}} | ||
| 323 | + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | ||
| 324 | + {{/if}} | ||
| 325 | + </td> | ||
| 326 | + <td>{{sch.lpName}}</td> | ||
| 327 | + <td>{{sch.qdzName}}</td> | ||
| 328 | + <td>{{sch.zdzName}}</td> | ||
| 329 | + <td> | ||
| 330 | + {{if sch.status==2}} | ||
| 331 | + <span class="ct_zt_yzx">已执行</span> | ||
| 332 | + {{else if sch.status==1}} | ||
| 333 | + {{if sch.fcsjActual==null}} | ||
| 334 | + <span class="ct_zt_zzzx">准备执行</span> | ||
| 335 | + {{else}} | ||
| 336 | + <span class="ct_zt_zzzx">正在执行</span> | ||
| 337 | + {{/if}} | ||
| 338 | + {{else if sch.status==-1}} | ||
| 339 | + <span class="ct_zt_lb">已烂班</span> | ||
| 340 | + {{/if}} | ||
| 341 | + </td> | ||
| 342 | + </tr> | ||
| 343 | + {{/each}} | ||
| 344 | + </table> | ||
| 334 | </div> | 345 | </div> |
| 335 | 346 | ||
| 336 | <div class="uk-width-1-2@s" style="padding: 12px 0 12px 0;"> | 347 | <div class="uk-width-1-2@s" style="padding: 12px 0 12px 0;"> |
| 337 | - <label class="uk-form-label font-orange" style="width: 100px;text-indent: 22px;margin-top: 12px;">烂班原因:</label> | 348 | + <label class="uk-form-label font-orange" |
| 349 | + style="width: 100px;text-indent: 22px;margin-top: 12px;">烂班原因:</label> | ||
| 338 | <div class="uk-form-controls" style="margin-left: 102px;"> | 350 | <div class="uk-form-controls" style="margin-left: 102px;"> |
| 339 | <select class="uk-select" name="reason"> | 351 | <select class="uk-select" name="reason"> |
| 340 | <option value="">请选择..</option> | 352 | <option value="">请选择..</option> |
| @@ -355,20 +367,30 @@ | @@ -355,20 +367,30 @@ | ||
| 355 | <hr> | 367 | <hr> |
| 356 | <p class="uk-text-right"> | 368 | <p class="uk-text-right"> |
| 357 | <button class="uk-button uk-button-default uk-modal-close" type="button">取消</button> | 369 | <button class="uk-button uk-button-default uk-modal-close" type="button">取消</button> |
| 358 | - <button class="uk-button uk-button-primary submit-btn" type="button" {{currSch.status > 0?"disabled":""}}>提交</button> | 370 | + <button class="uk-button uk-button-primary submit-btn" type="button" {{currSch.status> |
| 371 | + 0?"disabled":""}}>提交 | ||
| 372 | + </button> | ||
| 359 | </p> | 373 | </p> |
| 360 | </div> | 374 | </div> |
| 361 | </script> | 375 | </script> |
| 362 | <script> | 376 | <script> |
| 363 | (function () { | 377 | (function () { |
| 364 | var wrap = '#abnormal_monitor_wrap'; | 378 | var wrap = '#abnormal_monitor_wrap'; |
| 365 | - var lineIdx = '10146'; | ||
| 366 | - window.localStorage.setItem("abnormal_line_idx", lineIdx); | 379 | + var lineIdx; |
| 380 | + | ||
| 381 | + //查询用户线路权限 | ||
| 382 | + $.get('/user/getLineIdx', function (rs) { | ||
| 383 | + lineIdx = rs; | ||
| 384 | + window.localStorage.setItem("abnormal_line_idx", lineIdx); | ||
| 385 | + | ||
| 386 | + if (!lineIdx) { | ||
| 387 | + $('.empty-line-div', wrap).show(); | ||
| 388 | + return; | ||
| 389 | + } | ||
| 390 | + | ||
| 391 | + run(); | ||
| 392 | + }); | ||
| 367 | 393 | ||
| 368 | - if(!lineIdx){ | ||
| 369 | - $('.empty-line-div',wrap).show(); | ||
| 370 | - return; | ||
| 371 | - } | ||
| 372 | 394 | ||
| 373 | var initFlag; | 395 | var initFlag; |
| 374 | 396 | ||
| @@ -400,12 +422,14 @@ | @@ -400,12 +422,14 @@ | ||
| 400 | }); | 422 | }); |
| 401 | }; | 423 | }; |
| 402 | 424 | ||
| 403 | - start(function () { | ||
| 404 | - //搜索栏自动补全 | ||
| 405 | - ct_autocompleter.initLineAndOpenSch($('#lineAutoCompleter', wrap), lineIdx); | ||
| 406 | - ct_autocompleter.initBusBySch($('#nbbmAutoCompleter', wrap)); | ||
| 407 | - ct_autocompleter.initPersonBySch($('#personAutoCompleter', wrap)); | ||
| 408 | - }); | 425 | + function run() { |
| 426 | + start(function () { | ||
| 427 | + //搜索栏自动补全 | ||
| 428 | + ct_autocompleter.initLineAndOpenSch($('#lineAutoCompleter', wrap), lineIdx); | ||
| 429 | + ct_autocompleter.initBusBySch($('#nbbmAutoCompleter', wrap)); | ||
| 430 | + ct_autocompleter.initPersonBySch($('#personAutoCompleter', wrap)); | ||
| 431 | + }); | ||
| 432 | + } | ||
| 409 | })(); | 433 | })(); |
| 410 | </script> | 434 | </script> |
| 411 | </div> | 435 | </div> |
| 412 | \ No newline at end of file | 436 | \ No newline at end of file |
src/main/resources/static/pages/plan_schedule/p_s_main.html
0 → 100644
| 1 | +<!-- 计划排班 --> | ||
| 2 | +<div id="plan_schedule_data_wrap" class="l_r_split_screen"> | ||
| 3 | + | ||
| 4 | + <div class="left-menus"> | ||
| 5 | + <ul class="uk-list"> | ||
| 6 | + <li class="ct-btn-link" data-name="p_s_tzrc" data-page="/pages/plan_schedule/tzrc/list.html">调整人车</li> | ||
| 7 | + </ul> | ||
| 8 | + </div> | ||
| 9 | + <div class="right-body"> | ||
| 10 | + | ||
| 11 | + </div> | ||
| 12 | + | ||
| 13 | + <script> | ||
| 14 | + | ||
| 15 | + (function () { | ||
| 16 | + | ||
| 17 | + var wrap = '#plan_schedule_data_wrap', $body = $('.right-body', wrap); | ||
| 18 | + | ||
| 19 | + $('.left-menus .ct-btn-link', wrap).on('click', function () { | ||
| 20 | + var page = $(this).data('page'); | ||
| 21 | + if(!page) | ||
| 22 | + return; | ||
| 23 | + | ||
| 24 | + var that = this; | ||
| 25 | + $body.empty().load(page, function () { | ||
| 26 | + $('.left-menus .ct-btn-link.active', wrap).removeClass('active'); | ||
| 27 | + $(that).addClass('active'); | ||
| 28 | + }); | ||
| 29 | + }); | ||
| 30 | + | ||
| 31 | + //默认选中第一项 | ||
| 32 | + $('.left-menus .ct-btn-link:eq(0)', wrap).trigger('click'); | ||
| 33 | + })(); | ||
| 34 | + </script> | ||
| 35 | +</div> | ||
| 0 | \ No newline at end of file | 36 | \ No newline at end of file |
src/main/resources/static/pages/plan_schedule/tzrc/list.html
0 → 100644
| 1 | +<div id="plan_schedule_list_wrap" style="padding: 25px;height: calc(100% - 50px);"> | ||
| 2 | + | ||
| 3 | + <div class="ct_cont" style="height: 100%;"> | ||
| 4 | + <div class="ct_search_form_wrap"> | ||
| 5 | + <form> | ||
| 6 | + <div class="ct_field"> | ||
| 7 | + <label>日期: | ||
| 8 | + <input class="uk-input flatpickr_input" name="rq" > | ||
| 9 | + </label> | ||
| 10 | + </div> | ||
| 11 | + <div class="ct_field"> | ||
| 12 | + <label>线路: | ||
| 13 | + <select class="uk-select" name="lineCode"></select> | ||
| 14 | + </label> | ||
| 15 | + </div> | ||
| 16 | + | ||
| 17 | + <!-- <div class="ct_field"> | ||
| 18 | + <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button> | ||
| 19 | + </div>--> | ||
| 20 | + </form> | ||
| 21 | + </div> | ||
| 22 | + <div class="ct_table_wrap" style="height: calc(100% - 76px);"> | ||
| 23 | + <table class="uk-table uk-table-small plan_s_tab_width" style="margin-bottom: 0;"> | ||
| 24 | + <thead> | ||
| 25 | + <tr> | ||
| 26 | + <th>操作</th> | ||
| 27 | + <th>操作人/时间</th> | ||
| 28 | + <th>日期</th> | ||
| 29 | + <th>线路</th> | ||
| 30 | + <th>路牌</th> | ||
| 31 | + <th>车辆</th> | ||
| 32 | + | ||
| 33 | + <th>出场时间</th> | ||
| 34 | + <th>进场时间</th> | ||
| 35 | + <th>驾驶员</th> | ||
| 36 | + <th>售票员</th> | ||
| 37 | + </tr> | ||
| 38 | + </thead> | ||
| 39 | + </table> | ||
| 40 | + <div class="t_body_wrap " style="max-height: calc(100% - 75px);overflow: auto;"> | ||
| 41 | + <table class="uk-table uk-table-striped uk-table-hover p_s_list_table plan_s_tab_width"> | ||
| 42 | + <tbody></tbody> | ||
| 43 | + </table> | ||
| 44 | + </div> | ||
| 45 | + <div class="pagination-holder"></div> | ||
| 46 | + <div class="count_text"></div> | ||
| 47 | + </div> | ||
| 48 | + </div> | ||
| 49 | + | ||
| 50 | + <script id="plan_schedule_list_body-temp" type="text/html"> | ||
| 51 | + {{each list as obj i}} | ||
| 52 | + <tr> | ||
| 53 | + <td> | ||
| 54 | + <button class="uk-button uk-button-primary" disabled>调整人车</button> | ||
| 55 | + </td> | ||
| 56 | + <td> | ||
| 57 | + <div> | ||
| 58 | + {{if obj.cUser==obj.upUser}} | ||
| 59 | + <a class="_grey">{{obj.cUser}}</a> | ||
| 60 | + | ||
| 61 | + {{else}} | ||
| 62 | + <a>{{obj.cUser}}</a> | ||
| 63 | + {{/if}} | ||
| 64 | + </div> | ||
| 65 | + <div><a class="_grey">{{obj.cTime}}</a> <small>创建</small></div> | ||
| 66 | + {{if obj.upTime > obj.cTime}} | ||
| 67 | + <div><a>{{obj.upTime}}</a> <small>修改</small></div> | ||
| 68 | + {{/if}} | ||
| 69 | + </td> | ||
| 70 | + <td>{{obj.rq}}</td> | ||
| 71 | + <td>{{obj.lineName}}</td> | ||
| 72 | + <td><span class="uk-badge">{{obj.lpName}}</span></td> | ||
| 73 | + <td> | ||
| 74 | + {{each obj.nbbms as n j}} | ||
| 75 | + <div>{{n}}</div> | ||
| 76 | + {{/each}} | ||
| 77 | + </td> | ||
| 78 | + <td> | ||
| 79 | + {{each obj.ccsj as time z}} | ||
| 80 | + <div><a>{{time}}</a></div> | ||
| 81 | + {{/each}} | ||
| 82 | + </td> | ||
| 83 | + <td> | ||
| 84 | + {{each obj.jcsj as time q}} | ||
| 85 | + <div><a>{{time}}</a></div> | ||
| 86 | + {{/each}} | ||
| 87 | + </td> | ||
| 88 | + <td> | ||
| 89 | + {{each obj.jsys as jsy i}} | ||
| 90 | + <div>{{jsy}}</div> | ||
| 91 | + {{/each}} | ||
| 92 | + </td> | ||
| 93 | + <td> | ||
| 94 | + {{each obj.spys as spy s}} | ||
| 95 | + <div>{{spy}}</div> | ||
| 96 | + {{/each}} | ||
| 97 | + </td> | ||
| 98 | + </tr> | ||
| 99 | + {{/each}} | ||
| 100 | + </script> | ||
| 101 | + | ||
| 102 | + <script> | ||
| 103 | + (function () { | ||
| 104 | + var wrap = '#plan_schedule_list_wrap', ps = $('.t_body_wrap', wrap); | ||
| 105 | + | ||
| 106 | + ps.perfectScrollbar();//滚动条 | ||
| 107 | + //日期控件 | ||
| 108 | + var minDate = moment(new Date().getTime() + (1000 * 60 * 60 * 24)).format('YYYY-MM-DD'); | ||
| 109 | + $('input[name=rq]', wrap).val(minDate); | ||
| 110 | + flatpickr(wrap + ' .flatpickr_input', {"locale": "zh",minDate: minDate}); | ||
| 111 | + | ||
| 112 | + //线路下拉框 | ||
| 113 | + $.get('/user/getLineIdx', function (rs) { | ||
| 114 | + var array = rs.split(',') | ||
| 115 | + ,opts = '<option value="">请选择线路...</option>'; | ||
| 116 | + | ||
| 117 | + for(var i=0,len=array.length;i<len;i++){ | ||
| 118 | + if(!array[i]) | ||
| 119 | + continue; | ||
| 120 | + | ||
| 121 | + opts += '<option value="'+array[i]+'">'+(all_line_maps[array[i]].name)+'</option>'; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + $('select[name=lineCode]', wrap).html(opts); | ||
| 125 | + }); | ||
| 126 | + | ||
| 127 | + | ||
| 128 | + $('input[name=rq]', wrap).on('change', jsDoQuery); | ||
| 129 | + $('select[name=lineCode]', wrap).on('change', jsDoQuery); | ||
| 130 | + | ||
| 131 | + function jsDoQuery(){ | ||
| 132 | + var rq = $('input[name=rq]', wrap).val() | ||
| 133 | + ,lineCode = $('select[name=lineCode]', wrap).val(); | ||
| 134 | + | ||
| 135 | + if(!rq){ | ||
| 136 | + UIkit.notification("请选择日期!", {status:'danger'}); | ||
| 137 | + return; | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + if(!lineCode){ | ||
| 141 | + UIkit.notification("请选择线路!", {status:'danger'}); | ||
| 142 | + return; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + $.get('/plan_sch/findInOutPlan', {rq: rq, lineCode: lineCode}, function (rs) { | ||
| 146 | + renderList(rs); | ||
| 147 | + }); | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + function renderList(list) { | ||
| 151 | + list.sort(plan_sch_sort); | ||
| 152 | + //按路牌分组数据 | ||
| 153 | + var groupData = {}; | ||
| 154 | + | ||
| 155 | + for(var i=0,sch;sch=list[i++];){ | ||
| 156 | + if(!groupData[sch.lp_name]) | ||
| 157 | + groupData[sch.lp_name] = []; | ||
| 158 | + | ||
| 159 | + groupData[sch.lp_name].push(sch); | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + var data = [], array, obj, upTime, upUser, sch, jsy,spy; | ||
| 163 | + var fs = 'YYYY-MM-DD HH:mm',fs2='YYYY-MM-DD'; | ||
| 164 | + for(var lp in groupData){ | ||
| 165 | + array = groupData[lp]; | ||
| 166 | + | ||
| 167 | + obj = { | ||
| 168 | + cTime: moment(array[0].create_date).format(fs), | ||
| 169 | + cUser: array[0].c_user, | ||
| 170 | + rq: moment(array[0].schedule_date).format(fs2), | ||
| 171 | + lineName: array[0].xl_name, | ||
| 172 | + lpName: lp, | ||
| 173 | + nbbms: [], | ||
| 174 | + jsys: [], | ||
| 175 | + spys:[], | ||
| 176 | + ccsj: [], | ||
| 177 | + jcsj: [] | ||
| 178 | + } | ||
| 179 | + for(var j=0,len=array.length;j<len;j++){ | ||
| 180 | + sch = array[j]; | ||
| 181 | + if(!upTime || sch.update_date > upTime){ | ||
| 182 | + upTime = sch.update_date; | ||
| 183 | + upUser = sch.u_user; | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + if(sch.bc_type=='out') | ||
| 187 | + obj.ccsj.push(sch.fcsj); | ||
| 188 | + if(sch.bc_type=='in') | ||
| 189 | + obj.jcsj.push(sch.fcsj); | ||
| 190 | + | ||
| 191 | + if(obj.nbbms.indexOf(sch.cl_zbh)==-1) | ||
| 192 | + obj.nbbms.push(sch.cl_zbh); | ||
| 193 | + | ||
| 194 | + jsy = sch.j_gh + '/' + sch.j_name; | ||
| 195 | + if(obj.jsys.indexOf(jsy)==-1) | ||
| 196 | + obj.jsys.push(jsy); | ||
| 197 | + | ||
| 198 | + if(sch.s_gh){ | ||
| 199 | + spy = sch.s_gh + '/' + sch.s_name; | ||
| 200 | + if(obj.spys.indexOf(spy)==-1) | ||
| 201 | + obj.spys.push(spy); | ||
| 202 | + } | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + obj.upUser = upUser; | ||
| 206 | + obj.upTime = moment(upTime).format(fs); | ||
| 207 | + | ||
| 208 | + data.push(obj); | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + //渲染dom p_s_list_table | ||
| 212 | + var htmlStr = template('plan_schedule_list_body-temp', {list: data}); | ||
| 213 | + $('.p_s_list_table tbody', wrap).html(htmlStr); | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + function plan_sch_sort(a, b) { | ||
| 217 | + return a.fcno - b.fcno; | ||
| 218 | + } | ||
| 219 | + })(); | ||
| 220 | + </script> | ||
| 221 | +</div> | ||
| 0 | \ No newline at end of file | 222 | \ No newline at end of file |
src/main/resources/static/pages/system_manager/role/auths.html
| @@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
| 19 | <div class="fun_s_list"></div> | 19 | <div class="fun_s_list"></div> |
| 20 | </div> | 20 | </div> |
| 21 | <div class="footer_wrap"> | 21 | <div class="footer_wrap"> |
| 22 | - <button class="uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom save_btn">保存</button> | 22 | + <button class="uk-button uk-width-1-1 uk-margin-small-bottom save_btn">保存</button> |
| 23 | </div> | 23 | </div> |
| 24 | </div> | 24 | </div> |
| 25 | 25 | ||
| @@ -89,7 +89,7 @@ | @@ -89,7 +89,7 @@ | ||
| 89 | $(this).addClass('active'); | 89 | $(this).addClass('active'); |
| 90 | 90 | ||
| 91 | var menuStr = menuStrMaps[$(this).data('id')]; | 91 | var menuStr = menuStrMaps[$(this).data('id')]; |
| 92 | - var chsJson = parseMenuStr(menuStr); | 92 | + var chsJson = parseMenuStr(menuStr?menuStr:''); |
| 93 | 93 | ||
| 94 | //加载右侧权限页面 | 94 | //加载右侧权限页面 |
| 95 | var htmlStr = template('sys_role_fun-temp', {all: auth_json, chs: chsJson}); | 95 | var htmlStr = template('sys_role_fun-temp', {all: auth_json, chs: chsJson}); |
src/main/resources/static/pages/system_manager/user/edit.html
| 1 | -<!-- 私家车信息编辑 --> | 1 | +<!-- 用户账号信息编辑 --> |
| 2 | <div class="sys_user_edit_page edit-form-modal"> | 2 | <div class="sys_user_edit_page edit-form-modal"> |
| 3 | <form class="uk-form-horizontal "> | 3 | <form class="uk-form-horizontal "> |
| 4 | </form> | 4 | </form> |
| @@ -64,6 +64,7 @@ | @@ -64,6 +64,7 @@ | ||
| 64 | var comp = $('[name=company]', wrap); | 64 | var comp = $('[name=company]', wrap); |
| 65 | var fgsComp = $('[name=fgsCompany]', wrap); | 65 | var fgsComp = $('[name=fgsCompany]', wrap); |
| 66 | gb_common.companySelect2(comp, fgsComp); | 66 | gb_common.companySelect2(comp, fgsComp); |
| 67 | + comp.append('<option value="88">总公司</option>'); | ||
| 67 | 68 | ||
| 68 | //设置值 | 69 | //设置值 |
| 69 | comp.val(rs.company); | 70 | comp.val(rs.company); |
src/main/resources/static/pages/system_manager/user/line_config.html
0 → 100644
| 1 | +<!-- 账号线路分配 --> | ||
| 2 | +<div class="sys_user_line_config_page edit-form-modal"> | ||
| 3 | + <div class="company_search_wrap"> | ||
| 4 | + <select class="uk-select company_search_select"></select> | ||
| 5 | + <select class="uk-select fgs_search_select" disabled> | ||
| 6 | + <option value="">分公司搜索</option> | ||
| 7 | + </select> | ||
| 8 | + <div class="uk-inline"> | ||
| 9 | + <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span> | ||
| 10 | + <input class="uk-input line_search_input" style="width: 310px;" placeholder="搜索线路"> | ||
| 11 | + </div> | ||
| 12 | + </div> | ||
| 13 | + | ||
| 14 | + <div class="cont"> | ||
| 15 | + <div class="all_lines"></div> | ||
| 16 | + <div class="selected_lines" uk-sortable></div> | ||
| 17 | + </div> | ||
| 18 | + | ||
| 19 | + <p class="uk-text-right"> | ||
| 20 | + <button class="uk-button uk-button-default uk-modal-close" type="button">取消</button> | ||
| 21 | + <button class="uk-button uk-button-primary submit_btn" type="button">保存</button> | ||
| 22 | + </p> | ||
| 23 | + | ||
| 24 | + <script id="line_config_all_list-temp" type="text/html"> | ||
| 25 | + {{each list as obj i}} | ||
| 26 | + <span data-code="{{obj.lineCode}}">{{obj.name}}</span> | ||
| 27 | + {{/each}} | ||
| 28 | + </script> | ||
| 29 | + <script> | ||
| 30 | + | ||
| 31 | + (function () { | ||
| 32 | + var allMapps = {};//线路搜索映射 | ||
| 33 | + var lineMaps = {}; | ||
| 34 | + var wrap = '.sys_user_line_config_page', modalId; | ||
| 35 | + | ||
| 36 | + //滚动条 | ||
| 37 | + $('.all_lines', wrap).perfectScrollbar(); | ||
| 38 | + $(wrap).on('init', function (e, data) { | ||
| 39 | + e.stopPropagation(); | ||
| 40 | + modalId = '#'+data.modalId; | ||
| 41 | + | ||
| 42 | + //加载线路信息 | ||
| 43 | + gb_common.$get('/line/all', {}, function (rs) { | ||
| 44 | + var htmlStr = template('line_config_all_list-temp', {list: rs.list}); | ||
| 45 | + $('.all_lines', wrap).html(htmlStr); | ||
| 46 | + | ||
| 47 | + $.each(rs.list, function () { | ||
| 48 | + lineMaps[this.lineCode] = this; | ||
| 49 | + }); | ||
| 50 | + | ||
| 51 | + //选中线路 | ||
| 52 | + initSelectItems(); | ||
| 53 | + createLineSearchMapps(rs.list); | ||
| 54 | + }); | ||
| 55 | + data && data.caller && data.caller(); | ||
| 56 | + }); | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + | ||
| 60 | + //初始化公司——>分公司 | ||
| 61 | + var comp = $('.company_search_select', wrap); | ||
| 62 | + var fgsComp = $('.fgs_search_select', wrap); | ||
| 63 | + var $lineInp = $('.line_search_input', wrap); | ||
| 64 | + gb_common.companySelect2(comp, fgsComp); | ||
| 65 | + comp.prepend('<option value="" selected>请选择...</option>').trigger('change'); | ||
| 66 | + | ||
| 67 | + //分公司切换 | ||
| 68 | + fgsComp.on('change', search_line_list); | ||
| 69 | + $lineInp.on('input', search_line_list); | ||
| 70 | + /** | ||
| 71 | + * 搜索线路 | ||
| 72 | + */ | ||
| 73 | + function search_line_list() { | ||
| 74 | + var gsbm = comp.val() | ||
| 75 | + ,fgsBm = fgsComp.val() | ||
| 76 | + ,v = $.trim($lineInp.val()).toUpperCase() | ||
| 77 | + ,ks = gb_common.get_keys(allMapps); | ||
| 78 | + | ||
| 79 | + var data = {},code; | ||
| 80 | + if(v){ | ||
| 81 | + for(var i=0,k;k=ks[i++];){ | ||
| 82 | + if(k.indexOf(v)==-1) | ||
| 83 | + continue; | ||
| 84 | + | ||
| 85 | + code = allMapps[k]; | ||
| 86 | + data[code] = lineMaps[code]; | ||
| 87 | + } | ||
| 88 | + }else | ||
| 89 | + data = lineMaps; | ||
| 90 | + | ||
| 91 | + var array = [],obj; | ||
| 92 | + //按公司过滤 | ||
| 93 | + for(var k in data){ | ||
| 94 | + obj = data[k]; | ||
| 95 | + | ||
| 96 | + if(gsbm && obj.company!=gsbm) | ||
| 97 | + continue; | ||
| 98 | + | ||
| 99 | + if(fgsBm && obj.brancheCompany!=fgsBm) | ||
| 100 | + continue | ||
| 101 | + | ||
| 102 | + array.push(obj); | ||
| 103 | + } | ||
| 104 | + //渲染 | ||
| 105 | + var htmlStr = template('line_config_all_list-temp', {list: array}); | ||
| 106 | + $('.all_lines', wrap).html(htmlStr); | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + | ||
| 110 | + /** | ||
| 111 | + * 点击选择线路 | ||
| 112 | + */ | ||
| 113 | + $(wrap).on('click', '.all_lines>span[data-code]', function () { | ||
| 114 | + var lineCode = $(this).data('code'), | ||
| 115 | + name = $(this).text(); | ||
| 116 | + | ||
| 117 | + if ($(this).hasClass('active')) { | ||
| 118 | + $(this).removeClass('active'); | ||
| 119 | + | ||
| 120 | + $('.selected_lines span[data-code='+lineCode+']', wrap).remove(); | ||
| 121 | + } | ||
| 122 | + else { | ||
| 123 | + $(this).addClass('active'); | ||
| 124 | + var span = $('<span data-code="'+lineCode+'" class="uk-animation-slide-bottom">'+name+'</span>') | ||
| 125 | + .one('webkitAnimationEnd', function () { | ||
| 126 | + $(this).removeClass('uk-animation-slide-bottom'); | ||
| 127 | + }); | ||
| 128 | + $('.selected_lines', wrap).append(span); | ||
| 129 | + } | ||
| 130 | + }); | ||
| 131 | + | ||
| 132 | + | ||
| 133 | + $('.selected_lines').on('click', 'span[data-code]', function () { | ||
| 134 | + var lineCode = $(this).data('code'); | ||
| 135 | + $('.all_lines>span[data-code='+lineCode+']', wrap).removeClass('active'); | ||
| 136 | + $(this).remove(); | ||
| 137 | + }); | ||
| 138 | + | ||
| 139 | + $('.submit_btn', wrap).on('click', function () { | ||
| 140 | + var idx = ''; | ||
| 141 | + var sps = $('.selected_lines>span[data-code]', wrap); | ||
| 142 | + | ||
| 143 | + sps.each(function () { | ||
| 144 | + idx += ($(this).data('code') + ','); | ||
| 145 | + }); | ||
| 146 | + | ||
| 147 | + gb_common.$post('/user/configLineIdx', {idx: idx}, function () { | ||
| 148 | + UIkit.notification("保存成功!", {status:'success'}); | ||
| 149 | + }); | ||
| 150 | + }); | ||
| 151 | + | ||
| 152 | + /** | ||
| 153 | + * 搜索映射 | ||
| 154 | + * @param list | ||
| 155 | + */ | ||
| 156 | + function createLineSearchMapps(list) { | ||
| 157 | + allMapps = {}; | ||
| 158 | + var name, code; | ||
| 159 | + for (var i = 0, line; line = list[i++];) { | ||
| 160 | + name = line.name; | ||
| 161 | + code = line.lineCode; | ||
| 162 | + //拼音映射 | ||
| 163 | + allMapps[pinyin.getCamelChars(name)] = code; | ||
| 164 | + allMapps[pinyin.getFullChars(name).toUpperCase()] = code; | ||
| 165 | + //中文映射 | ||
| 166 | + allMapps[name] = code; | ||
| 167 | + } | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + function initSelectItems() { | ||
| 171 | + $.get('/user/getLineIdx', function (rs) { | ||
| 172 | + if(!rs) | ||
| 173 | + return; | ||
| 174 | + | ||
| 175 | + var array = rs.split(','); | ||
| 176 | + | ||
| 177 | + $.each(array, function () { | ||
| 178 | + if(!this) | ||
| 179 | + return true; | ||
| 180 | + $('.all_lines>span[data-code='+this+']').trigger('click'); | ||
| 181 | + }); | ||
| 182 | + }); | ||
| 183 | + } | ||
| 184 | + })(); | ||
| 185 | + </script> | ||
| 186 | +</div> | ||
| 0 | \ No newline at end of file | 187 | \ No newline at end of file |
src/main/resources/static/pages/system_manager/user/user_list.html
| @@ -86,7 +86,7 @@ | @@ -86,7 +86,7 @@ | ||
| 86 | <td>{{user.enabled?'启用':'禁用'}}</td> | 86 | <td>{{user.enabled?'启用':'禁用'}}</td> |
| 87 | <td> | 87 | <td> |
| 88 | <a class="edit_icon" data-code="{{user.id}}" uk-icon="icon: file-edit"></a> | 88 | <a class="edit_icon" data-code="{{user.id}}" uk-icon="icon: file-edit"></a> |
| 89 | - <button class="uk-button uk-button-small" style="font-size: 12px;">线路分配</button> | 89 | + <button class="uk-button uk-button-small line_config_btn" style="font-size: 12px;">线路分配</button> |
| 90 | </td> | 90 | </td> |
| 91 | </tr> | 91 | </tr> |
| 92 | {{/each}} | 92 | {{/each}} |
| @@ -163,12 +163,12 @@ | @@ -163,12 +163,12 @@ | ||
| 163 | }); | 163 | }); |
| 164 | 164 | ||
| 165 | 165 | ||
| 166 | - //初始化公司——>分公司(2 -带总公司) | 166 | + //初始化公司——>分公司 |
| 167 | var comp = $('[name=company_eq]', wrap); | 167 | var comp = $('[name=company_eq]', wrap); |
| 168 | var fgsComp = $('[name=fgsCompany_eq]', wrap); | 168 | var fgsComp = $('[name=fgsCompany_eq]', wrap); |
| 169 | gb_common.companySelect2(comp, fgsComp); | 169 | gb_common.companySelect2(comp, fgsComp); |
| 170 | comp.prepend('<option value="" selected>请选择...</option>').trigger('change'); | 170 | comp.prepend('<option value="" selected>请选择...</option>').trigger('change'); |
| 171 | - | 171 | + comp.append('<option value="88">总公司</option>'); |
| 172 | 172 | ||
| 173 | $(wrap).on('refresh', function (e, data) { | 173 | $(wrap).on('refresh', function (e, data) { |
| 174 | if(data && data['resetPagination']){ | 174 | if(data && data['resetPagination']){ |
| @@ -183,6 +183,13 @@ | @@ -183,6 +183,13 @@ | ||
| 183 | var code = $(this).data('code'); | 183 | var code = $(this).data('code'); |
| 184 | gb_common.open_modal('/pages/system_manager/user/edit.html', ' 编辑', {code: code}); | 184 | gb_common.open_modal('/pages/system_manager/user/edit.html', ' 编辑', {code: code}); |
| 185 | }); | 185 | }); |
| 186 | + | ||
| 187 | + | ||
| 188 | + //线路分配 | ||
| 189 | + $(wrap).on('click', '.line_config_btn', function () { | ||
| 190 | + var code = $(this).data('code'); | ||
| 191 | + gb_common.open_modal_default('/pages/system_manager/user/line_config.html', ' 线路分配', {code: code}, 860); | ||
| 192 | + }); | ||
| 186 | })(); | 193 | })(); |
| 187 | </script> | 194 | </script> |
| 188 | </div> | 195 | </div> |
| 189 | \ No newline at end of file | 196 | \ No newline at end of file |