Commit 4edb5f24028f506df7570c5c412a6067181193d3
Merge branch 'minhang' of
http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
26 changed files
with
614 additions
and
74 deletions
pom.xml
| ... | ... | @@ -299,6 +299,11 @@ |
| 299 | 299 | <version>3.3.0</version> |
| 300 | 300 | </dependency> |
| 301 | 301 | |
| 302 | + <dependency> | |
| 303 | + <groupId>com.github.stuxuhai</groupId> | |
| 304 | + <artifactId>jpinyin</artifactId> | |
| 305 | + <version>1.1.8</version> | |
| 306 | + </dependency> | |
| 302 | 307 | </dependencies> |
| 303 | 308 | |
| 304 | 309 | <dependencyManagement> | ... | ... |
src/main/java/com/bsth/controller/PersonnelController.java
| 1 | 1 | package com.bsth.controller; |
| 2 | 2 | |
| 3 | +import com.bsth.common.Constants; | |
| 4 | +import com.bsth.data.pinyin.PersionPinYin; | |
| 5 | +import com.bsth.data.pinyin.PersionPinYinBuffer; | |
| 3 | 6 | import com.bsth.entity.Personnel; |
| 7 | +import com.bsth.entity.sys.CompanyAuthority; | |
| 4 | 8 | import com.bsth.service.PersonnelService; |
| 5 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | 10 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -8,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod; |
| 8 | 12 | import org.springframework.web.bind.annotation.RequestParam; |
| 9 | 13 | import org.springframework.web.bind.annotation.RestController; |
| 10 | 14 | |
| 15 | +import javax.servlet.http.HttpServletRequest; | |
| 11 | 16 | import java.util.List; |
| 12 | 17 | import java.util.Map; |
| 13 | 18 | |
| ... | ... | @@ -21,8 +26,22 @@ public class PersonnelController extends BaseController<Personnel, Integer> { |
| 21 | 26 | @Autowired |
| 22 | 27 | private PersonnelService service; |
| 23 | 28 | |
| 29 | + @Autowired | |
| 30 | + PersionPinYinBuffer persionPinYinBuffer; | |
| 31 | + | |
| 24 | 32 | @RequestMapping(value = "/sreachPersonnel", method = RequestMethod.GET) |
| 25 | 33 | public List<Map<String, String>> sreachPersonnel(@RequestParam String jobCode) { |
| 26 | 34 | return service.sreachPersonnel(jobCode); |
| 27 | 35 | } |
| 36 | + | |
| 37 | + @RequestMapping(value = "/all_py", method = RequestMethod.GET) | |
| 38 | + public List<PersionPinYin> findAll_PY(){ | |
| 39 | + return persionPinYinBuffer.getAll(); | |
| 40 | + } | |
| 41 | + | |
| 42 | + @RequestMapping(value = "/list_py", method = RequestMethod.GET) | |
| 43 | + public List<PersionPinYin> findByCurrUser_PY(HttpServletRequest request){ | |
| 44 | + List<CompanyAuthority> auths = (List<CompanyAuthority>) request.getSession().getAttribute(Constants.COMPANY_AUTHORITYS); | |
| 45 | + return persionPinYinBuffer.getAll(auths); | |
| 46 | + } | |
| 28 | 47 | } | ... | ... |
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
| 1 | 1 | package com.bsth.controller.realcontrol; |
| 2 | 2 | |
| 3 | -import com.alibaba.fastjson.JSON; | |
| 4 | 3 | import com.alibaba.fastjson.serializer.PropertyFilter; |
| 5 | 4 | import com.bsth.common.ResponseCode; |
| 6 | 5 | import com.bsth.data.BasicData; |
| ... | ... | @@ -60,16 +59,16 @@ public class BasicDataController { |
| 60 | 59 | return rs; |
| 61 | 60 | } |
| 62 | 61 | |
| 63 | - @RequestMapping("/personnel") | |
| 62 | + /*@RequestMapping("/personnel") | |
| 64 | 63 | public Map<String, Object> findPersonnelInfo(){ |
| 65 | 64 | Map<String, Object> rs = new HashMap<>(); |
| 66 | 65 | PersonnelFieldFilter filter=new PersonnelFieldFilter(); |
| 67 | 66 | //驾驶员 |
| 68 | 67 | rs.put("jsy", JSON.parse(JSON.toJSONString(BasicData.jsyMap.values(), filter))); |
| 69 | 68 | //售票员 |
| 70 | - rs.put("spy", JSON.parse(JSON.toJSONString(BasicData.spyMap.values(), filter))); | |
| 69 | + rs.put("spy", JSON.parse(JSON.toJSONString(BasicData.spyMap.values(), filter)));*//* | |
| 71 | 70 | return rs; |
| 72 | - } | |
| 71 | + }*/ | |
| 73 | 72 | |
| 74 | 73 | @RequestMapping("/all_personnel") |
| 75 | 74 | public Map<String, String> all_personnel(){ |
| ... | ... | @@ -179,15 +178,12 @@ public class BasicDataController { |
| 179 | 178 | map.put("lineCode", line.getLineCode()); |
| 180 | 179 | rs.add(map); |
| 181 | 180 | } |
| 182 | - //listMultimap.put(line.getName(), nbbm); | |
| 183 | 181 | } |
| 184 | - //return listMultimap.asMap(); | |
| 185 | - | |
| 186 | 182 | return rs; |
| 187 | 183 | } |
| 188 | 184 | |
| 189 | 185 | /** |
| 190 | - * 获取站点和停车场对照表 | |
| 186 | + * 获取站点和停车场历时公里对照表 | |
| 191 | 187 | * @param idx |
| 192 | 188 | * @return |
| 193 | 189 | */ | ... | ... |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -335,8 +335,9 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 335 | 335 | @RequestMapping(value = "/correctForm") |
| 336 | 336 | public List<SchEditInfoDto> correctForm(@RequestParam String line, @RequestParam String date, |
| 337 | 337 | @RequestParam String endDate, |
| 338 | - @RequestParam String lpName, @RequestParam String code, @RequestParam String type) { | |
| 339 | - return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type); | |
| 338 | + @RequestParam String lpName, @RequestParam String code, | |
| 339 | + @RequestParam String type,@RequestParam String changType) { | |
| 340 | + return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type,changType); | |
| 340 | 341 | } |
| 341 | 342 | /** |
| 342 | 343 | * @Title queryListWaybill | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| ... | ... | @@ -2,6 +2,7 @@ package com.bsth.data; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.Application; |
| 4 | 4 | import com.bsth.data.gpsdata.arrival.GeoCacheData; |
| 5 | +import com.bsth.data.pinyin.PersionPinYinBuffer; | |
| 5 | 6 | import com.bsth.entity.*; |
| 6 | 7 | import com.bsth.entity.schedule.CarConfigInfo; |
| 7 | 8 | import com.bsth.repository.*; |
| ... | ... | @@ -64,10 +65,10 @@ public class BasicData implements CommandLineRunner { |
| 64 | 65 | //线路Code和shangHaiLinecode 对照 |
| 65 | 66 | public static Map<String, String> lineCode2ShangHaiCodeMap; |
| 66 | 67 | |
| 67 | - //驾驶员工号 和 personnel 对象映射 | |
| 68 | + /*//驾驶员工号 和 personnel 对象映射 | |
| 68 | 69 | public static Map<String, Personnel> jsyMap; |
| 69 | 70 | //售票员工号 和 personnel 对象映射 |
| 70 | - public static Map<String, Personnel> spyMap; | |
| 71 | + public static Map<String, Personnel> spyMap;*/ | |
| 71 | 72 | //所以员工和personnerl 对象映射 |
| 72 | 73 | public static Map<String, Personnel> perMap; |
| 73 | 74 | //全量员工 工号和姓名对照 |
| ... | ... | @@ -137,6 +138,9 @@ public class BasicData implements CommandLineRunner { |
| 137 | 138 | @Autowired |
| 138 | 139 | Station2ParkBuffer station2ParkBuffer; |
| 139 | 140 | |
| 141 | + @Autowired | |
| 142 | + PersionPinYinBuffer persionPinYinBuffer; | |
| 143 | + | |
| 140 | 144 | |
| 141 | 145 | @Override |
| 142 | 146 | public void run() { |
| ... | ... | @@ -165,6 +169,8 @@ public class BasicData implements CommandLineRunner { |
| 165 | 169 | geoCacheData.loadData(); |
| 166 | 170 | station2ParkBuffer.saveAll(); |
| 167 | 171 | logger.info("加载基础数据成功!,"); |
| 172 | + //人员拼音转换 | |
| 173 | + persionPinYinBuffer.refresh(); | |
| 168 | 174 | } catch (Exception e) { |
| 169 | 175 | logger.error("加载基础数据时出现异常,", e); |
| 170 | 176 | } |
| ... | ... | @@ -321,7 +327,7 @@ public class BasicData implements CommandLineRunner { |
| 321 | 327 | public void loadPersonnelInfo() { |
| 322 | 328 | Iterator<Personnel> iterator = personnelRepository.findAll().iterator(); |
| 323 | 329 | |
| 324 | - Map<String, Personnel> jsyTempMap = new HashMap<>(), spyTempMap = new HashMap<>(),perTempMap=new HashMap<>(); | |
| 330 | + Map<String, Personnel> /*jsyTempMap = new HashMap<>(), spyTempMap = new HashMap<>(),*/perTempMap=new HashMap<>(); | |
| 325 | 331 | Map<String, String> allPersonMap = new HashMap<>(); |
| 326 | 332 | |
| 327 | 333 | Personnel p; |
| ... | ... | @@ -333,20 +339,20 @@ public class BasicData implements CommandLineRunner { |
| 333 | 339 | if (StringUtils.isEmpty(jobCode)) |
| 334 | 340 | continue; |
| 335 | 341 | |
| 336 | - if (p.getPosts() != null) { | |
| 342 | + /*if (p.getPosts() != null) { | |
| 337 | 343 | if (p.getPosts().equals("1")) |
| 338 | 344 | jsyTempMap.put(jobCode, p); |
| 339 | 345 | else if (p.getPosts().equals("2")) |
| 340 | 346 | spyTempMap.put(jobCode, p); |
| 341 | - } | |
| 347 | + }*/ | |
| 342 | 348 | |
| 343 | 349 | perTempMap.put(jobCode, p); |
| 344 | 350 | |
| 345 | 351 | allPersonMap.put(jobCode, p.getPersonnelName()); |
| 346 | 352 | } |
| 347 | 353 | |
| 348 | - jsyMap = jsyTempMap; | |
| 349 | - spyMap = spyTempMap; | |
| 354 | + //jsyMap = jsyTempMap; | |
| 355 | + //spyMap = spyTempMap; | |
| 350 | 356 | allPerson = allPersonMap; |
| 351 | 357 | perMap = perTempMap; |
| 352 | 358 | } | ... | ... |
src/main/java/com/bsth/data/pinyin/PersionPinYin.java
0 → 100644
| 1 | +package com.bsth.data.pinyin; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonIgnore; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * 人员拼音映射 | |
| 7 | + * Created by panzhao on 2017/7/19. | |
| 8 | + */ | |
| 9 | +public class PersionPinYin { | |
| 10 | + | |
| 11 | + /** | |
| 12 | + * Id | |
| 13 | + */ | |
| 14 | + private Integer id; | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 工号 | |
| 18 | + */ | |
| 19 | + private String workId; | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 姓名 | |
| 23 | + */ | |
| 24 | + private String name; | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 全拼 | |
| 28 | + */ | |
| 29 | + private String fullChars; | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 简便 | |
| 33 | + */ | |
| 34 | + private String camelChars; | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 所属公司编码 | |
| 38 | + */ | |
| 39 | + @JsonIgnore | |
| 40 | + private String companyId; | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 所属分公司编码 | |
| 44 | + */ | |
| 45 | + @JsonIgnore | |
| 46 | + private String fgsCompanyId; | |
| 47 | + | |
| 48 | + public String getWorkId() { | |
| 49 | + return workId; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public void setWorkId(String workId) { | |
| 53 | + this.workId = workId; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public String getName() { | |
| 57 | + return name; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public void setName(String name) { | |
| 61 | + this.name = name; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public String getFullChars() { | |
| 65 | + return fullChars; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public void setFullChars(String fullChars) { | |
| 69 | + this.fullChars = fullChars; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public String getCamelChars() { | |
| 73 | + return camelChars; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public void setCamelChars(String camelChars) { | |
| 77 | + this.camelChars = camelChars; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public String getCompanyId() { | |
| 81 | + return companyId; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public void setCompanyId(String companyId) { | |
| 85 | + this.companyId = companyId; | |
| 86 | + } | |
| 87 | + | |
| 88 | + public String getFgsCompanyId() { | |
| 89 | + return fgsCompanyId; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public void setFgsCompanyId(String fgsCompanyId) { | |
| 93 | + this.fgsCompanyId = fgsCompanyId; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public Integer getId() { | |
| 97 | + return id; | |
| 98 | + } | |
| 99 | + | |
| 100 | + public void setId(Integer id) { | |
| 101 | + this.id = id; | |
| 102 | + } | |
| 103 | +} | ... | ... |
src/main/java/com/bsth/data/pinyin/PersionPinYinBuffer.java
0 → 100644
| 1 | +package com.bsth.data.pinyin; | |
| 2 | + | |
| 3 | +import com.bsth.data.BasicData; | |
| 4 | +import com.bsth.entity.Personnel; | |
| 5 | +import com.bsth.entity.sys.CompanyAuthority; | |
| 6 | +import com.github.stuxuhai.jpinyin.PinyinException; | |
| 7 | +import com.github.stuxuhai.jpinyin.PinyinFormat; | |
| 8 | +import com.github.stuxuhai.jpinyin.PinyinHelper; | |
| 9 | +import com.google.common.collect.ArrayListMultimap; | |
| 10 | +import org.slf4j.Logger; | |
| 11 | +import org.slf4j.LoggerFactory; | |
| 12 | +import org.springframework.stereotype.Component; | |
| 13 | + | |
| 14 | +import java.util.ArrayList; | |
| 15 | +import java.util.Collection; | |
| 16 | +import java.util.List; | |
| 17 | + | |
| 18 | +/** | |
| 19 | + * 人员拼音数据映射缓存 | |
| 20 | + * Created by panzhao on 2017/7/19. | |
| 21 | + */ | |
| 22 | +@Component | |
| 23 | +public class PersionPinYinBuffer { | |
| 24 | + | |
| 25 | + static ArrayListMultimap<String, PersionPinYin> listMultimap = ArrayListMultimap.create(); | |
| 26 | + static List<PersionPinYin> all = new ArrayList<>(); | |
| 27 | + | |
| 28 | + Logger log = LoggerFactory.getLogger(this.getClass()); | |
| 29 | + | |
| 30 | + | |
| 31 | + public void refresh(){ | |
| 32 | + ArrayListMultimap<String, PersionPinYin> listMultimapCopy = ArrayListMultimap.create(); | |
| 33 | + List<PersionPinYin> allCopy = new ArrayList<>(); | |
| 34 | + PersionPinYin ppy; | |
| 35 | + | |
| 36 | + Collection<Personnel> list = BasicData.perMap.values(); | |
| 37 | + for(Personnel p : list){ | |
| 38 | + ppy = new PersionPinYin(); | |
| 39 | + ppy.setId(p.getId()); | |
| 40 | + ppy.setCompanyId(p.getCompanyCode()); | |
| 41 | + ppy.setFgsCompanyId(p.getBrancheCompanyCode()); | |
| 42 | + ppy.setName(p.getPersonnelName()); | |
| 43 | + ppy.setWorkId(p.getJobCode()); | |
| 44 | + try { | |
| 45 | + ppy.setFullChars(PinyinHelper.convertToPinyinString(ppy.getName(), "" , PinyinFormat.WITHOUT_TONE)); | |
| 46 | + ppy.setCamelChars(PinyinHelper.getShortPinyin(ppy.getName())); | |
| 47 | + }catch (PinyinException pye){ | |
| 48 | + log.error("拼音转换出现异常," + ppy.getName(), pye); | |
| 49 | + continue; | |
| 50 | + } | |
| 51 | + | |
| 52 | + listMultimapCopy.put(ppy.getCompanyId() + "_" + ppy.getFgsCompanyId(), ppy); | |
| 53 | + allCopy.add(ppy); | |
| 54 | + } | |
| 55 | + | |
| 56 | + if(allCopy.size() > 0){ | |
| 57 | + all = allCopy; | |
| 58 | + listMultimap = listMultimapCopy; | |
| 59 | + } | |
| 60 | + } | |
| 61 | + | |
| 62 | + public List<PersionPinYin> getAll(){ | |
| 63 | + return all; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public List<PersionPinYin> getAll(List<CompanyAuthority> auths){ | |
| 67 | + List<PersionPinYin> rs = new ArrayList<>(); | |
| 68 | + for(CompanyAuthority ca : auths){ | |
| 69 | + rs.addAll(listMultimap.get(ca.getCompanyCode() + "_" + ca.getSubCompanyCode())); | |
| 70 | + } | |
| 71 | + return rs; | |
| 72 | + } | |
| 73 | +} | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -7,6 +7,7 @@ import com.bsth.common.ResponseCode; |
| 7 | 7 | import com.bsth.data.LineConfigData; |
| 8 | 8 | import com.bsth.data.gpsdata.GpsRealData; |
| 9 | 9 | import com.bsth.data.gpsdata.recovery.GpsDataRecovery; |
| 10 | +import com.bsth.data.schedule.f_a_l.FirstAndLastHandler; | |
| 10 | 11 | import com.bsth.entity.realcontrol.LineConfig; |
| 11 | 12 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 12 | 13 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| ... | ... | @@ -176,6 +177,8 @@ public class DayOfSchedule { |
| 176 | 177 | //添加到缓存 |
| 177 | 178 | putAll(list); |
| 178 | 179 | |
| 180 | + //标记首末班 | |
| 181 | + FirstAndLastHandler.marks(list); | |
| 179 | 182 | |
| 180 | 183 | Set<String> lps = searchAllLP(list); |
| 181 | 184 | for (String lp : lps) { | ... | ... |
src/main/java/com/bsth/data/schedule/f_a_l/FirstAndLastHandler.java
0 → 100644
| 1 | +package com.bsth.data.schedule.f_a_l; | |
| 2 | + | |
| 3 | +import com.bsth.data.BasicData; | |
| 4 | +import com.bsth.data.schedule.DayOfSchedule; | |
| 5 | +import com.bsth.data.schedule.ScheduleComparator; | |
| 6 | +import com.bsth.data.schedule.f_a_l.entity.ToGateway; | |
| 7 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 8 | +import com.bsth.util.db.DBUtils_MS; | |
| 9 | +import org.slf4j.Logger; | |
| 10 | +import org.slf4j.LoggerFactory; | |
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 12 | +import org.springframework.jdbc.core.BatchPreparedStatementSetter; | |
| 13 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 14 | +import org.springframework.jdbc.datasource.DataSourceTransactionManager; | |
| 15 | +import org.springframework.stereotype.Component; | |
| 16 | +import org.springframework.transaction.TransactionDefinition; | |
| 17 | +import org.springframework.transaction.TransactionStatus; | |
| 18 | +import org.springframework.transaction.support.DefaultTransactionDefinition; | |
| 19 | + | |
| 20 | +import java.sql.PreparedStatement; | |
| 21 | +import java.sql.SQLException; | |
| 22 | +import java.util.ArrayList; | |
| 23 | +import java.util.Collections; | |
| 24 | +import java.util.List; | |
| 25 | +import java.util.concurrent.ConcurrentHashMap; | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * 首末班处理程序 | |
| 29 | + * Created by panzhao on 2017/7/19. | |
| 30 | + */ | |
| 31 | +@Component | |
| 32 | +public class FirstAndLastHandler { | |
| 33 | + | |
| 34 | + static ConcurrentHashMap<String, ToGateway> maps = new ConcurrentHashMap<>(); | |
| 35 | + | |
| 36 | + static Logger log = LoggerFactory.getLogger(FirstAndLastHandler.class); | |
| 37 | + | |
| 38 | + static boolean flag; | |
| 39 | + | |
| 40 | + @Autowired | |
| 41 | + DayOfSchedule dayOfSchedule; | |
| 42 | + | |
| 43 | + public void marks(String lineCode){ | |
| 44 | + marks(dayOfSchedule.findByLineCode(lineCode)); | |
| 45 | + } | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 标记首末班 | |
| 49 | + * @param list | |
| 50 | + */ | |
| 51 | + public static void marks(List<ScheduleRealInfo> list){ | |
| 52 | + try{ | |
| 53 | + Collections.sort(list, new ScheduleComparator.FCSJ()); | |
| 54 | + //按上下行分组 | |
| 55 | + List<ScheduleRealInfo> ups = new ArrayList<>(), | |
| 56 | + downs = new ArrayList<>(); | |
| 57 | + | |
| 58 | + for(ScheduleRealInfo sch : list){ | |
| 59 | + if(sch.getXlDir().equals("0")) | |
| 60 | + ups.add(sch); | |
| 61 | + else | |
| 62 | + downs.add(sch); | |
| 63 | + } | |
| 64 | + | |
| 65 | + markOneWay(ups); | |
| 66 | + markOneWay(downs); | |
| 67 | + }catch (Exception e){ | |
| 68 | + log.error("", e); | |
| 69 | + } | |
| 70 | + } | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * 标记单程,上行或下行 | |
| 74 | + * @param list | |
| 75 | + */ | |
| 76 | + private static void markOneWay(List<ScheduleRealInfo> list){ | |
| 77 | + ScheduleRealInfo first = null, last = null; | |
| 78 | + | |
| 79 | + for(ScheduleRealInfo sch: list){ | |
| 80 | + if(sch._isInout() || sch.getBcType().equals("region") | |
| 81 | + || sch.getBcType().equals("venting")) | |
| 82 | + continue; | |
| 83 | + | |
| 84 | + if(first == null) | |
| 85 | + first = sch; | |
| 86 | + | |
| 87 | + last = sch; | |
| 88 | + } | |
| 89 | + | |
| 90 | + put(first, last); | |
| 91 | + } | |
| 92 | + | |
| 93 | + private static void put(ScheduleRealInfo first, ScheduleRealInfo last){ | |
| 94 | + if(first == null || last == null) | |
| 95 | + return; | |
| 96 | + | |
| 97 | + ToGateway tg = new ToGateway(); | |
| 98 | + tg.setLineCode(first.getXlBm()); | |
| 99 | + tg.setUpDown(Integer.parseInt(first.getXlDir())); | |
| 100 | + tg.setsDeviceId(BasicData.deviceId2NbbmMap.inverse().get(first.getClZbh())); | |
| 101 | + tg.setSt(first.getDfsjT()); | |
| 102 | + | |
| 103 | + tg.setRq(first.getScheduleDateStr()); | |
| 104 | + | |
| 105 | + tg.seteDeviceId(BasicData.deviceId2NbbmMap.inverse().get(last.getClZbh())); | |
| 106 | + tg.setEt(last.getDfsjT()); | |
| 107 | + | |
| 108 | + maps.put(tg.getLineCode() + "_" + tg.getUpDown(), tg); | |
| 109 | + flag = true; | |
| 110 | + } | |
| 111 | + | |
| 112 | + public static void saveAll(){ | |
| 113 | + if(!flag) | |
| 114 | + return; | |
| 115 | + | |
| 116 | + final List<ToGateway> pstList = new ArrayList<>(maps.values()); | |
| 117 | + if(pstList == null || pstList.size() == 0) | |
| 118 | + return; | |
| 119 | + | |
| 120 | + flag = false; | |
| 121 | + JdbcTemplate jdbcTemp = new JdbcTemplate(DBUtils_MS.getDataSource()); | |
| 122 | + //编程式事务 | |
| 123 | + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemp.getDataSource()); | |
| 124 | + DefaultTransactionDefinition def = new DefaultTransactionDefinition(); | |
| 125 | + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); | |
| 126 | + TransactionStatus status = tran.getTransaction(def); | |
| 127 | + | |
| 128 | + try{ | |
| 129 | + //删除 | |
| 130 | + jdbcTemp.update("delete from bsth_t_first_last"); | |
| 131 | + //重新写入 | |
| 132 | + jdbcTemp.batchUpdate("insert into bsth_t_first_last(line_code, s_device_id, st, e_device_id, et, up_down, rq) VALUES(?, ?, ?, ?, ?, ?, ?)", new BatchPreparedStatementSetter() { | |
| 133 | + @Override | |
| 134 | + public void setValues(PreparedStatement ps, int i) throws SQLException { | |
| 135 | + ToGateway tg = pstList.get(i); | |
| 136 | + ps.setString(1, tg.getLineCode()); | |
| 137 | + ps.setString(2, tg.getsDeviceId()); | |
| 138 | + ps.setLong(3, tg.getSt()); | |
| 139 | + ps.setString(4, tg.geteDeviceId()); | |
| 140 | + ps.setLong(5, tg.getEt()); | |
| 141 | + ps.setInt(6, tg.getUpDown()); | |
| 142 | + ps.setString(7, tg.getRq()); | |
| 143 | + } | |
| 144 | + | |
| 145 | + @Override | |
| 146 | + public int getBatchSize() { | |
| 147 | + return pstList.size(); | |
| 148 | + } | |
| 149 | + }); | |
| 150 | + | |
| 151 | + log.info("首末班数据入库," + pstList.size()); | |
| 152 | + tran.commit(status); | |
| 153 | + }catch (Exception e){ | |
| 154 | + log.error("", e); | |
| 155 | + tran.rollback(status); | |
| 156 | + } | |
| 157 | + } | |
| 158 | +} | ... | ... |
src/main/java/com/bsth/data/schedule/f_a_l/entity/ToGateway.java
0 → 100644
| 1 | +package com.bsth.data.schedule.f_a_l.entity; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 发送给网关的首末班数据格式 | |
| 5 | + * Created by panzhao on 2017/7/19. | |
| 6 | + */ | |
| 7 | +public class ToGateway { | |
| 8 | + | |
| 9 | + /** 线路 */ | |
| 10 | + private String lineCode; | |
| 11 | + | |
| 12 | + /** 上下行 */ | |
| 13 | + private int upDown; | |
| 14 | + | |
| 15 | + /** 首班设备号 */ | |
| 16 | + private String sDeviceId; | |
| 17 | + | |
| 18 | + /** 首班时间 */ | |
| 19 | + private Long st; | |
| 20 | + | |
| 21 | + /** 末班设备号 */ | |
| 22 | + private String eDeviceId; | |
| 23 | + | |
| 24 | + /** 末班时间 */ | |
| 25 | + private Long et; | |
| 26 | + | |
| 27 | + /** 班次日期 */ | |
| 28 | + private String rq; | |
| 29 | + | |
| 30 | + | |
| 31 | + public String getLineCode() { | |
| 32 | + return lineCode; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public void setLineCode(String lineCode) { | |
| 36 | + this.lineCode = lineCode; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public Long getSt() { | |
| 40 | + return st; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public void setSt(Long st) { | |
| 44 | + this.st = st; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public Long getEt() { | |
| 48 | + return et; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public void setEt(Long et) { | |
| 52 | + this.et = et; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public String getRq() { | |
| 56 | + return rq; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void setRq(String rq) { | |
| 60 | + this.rq = rq; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public int getUpDown() { | |
| 64 | + return upDown; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public void setUpDown(int upDown) { | |
| 68 | + this.upDown = upDown; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public String getsDeviceId() { | |
| 72 | + return sDeviceId; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setsDeviceId(String sDeviceId) { | |
| 76 | + this.sDeviceId = sDeviceId; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public String geteDeviceId() { | |
| 80 | + return eDeviceId; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void seteDeviceId(String eDeviceId) { | |
| 84 | + this.eDeviceId = eDeviceId; | |
| 85 | + } | |
| 86 | +} | ... | ... |
src/main/java/com/bsth/data/schedule/thread/ScheduleRefreshThread.java
| ... | ... | @@ -5,6 +5,7 @@ import com.bsth.data.LineConfigData; |
| 5 | 5 | import com.bsth.data.directive.DayOfDirectives; |
| 6 | 6 | import com.bsth.data.pilot80.PilotReport; |
| 7 | 7 | import com.bsth.data.schedule.DayOfSchedule; |
| 8 | +import com.bsth.data.schedule.f_a_l.FirstAndLastHandler; | |
| 8 | 9 | import com.bsth.entity.realcontrol.LineConfig; |
| 9 | 10 | import org.slf4j.Logger; |
| 10 | 11 | import org.slf4j.LoggerFactory; |
| ... | ... | @@ -69,7 +70,9 @@ public class ScheduleRefreshThread extends Thread{ |
| 69 | 70 | logger.info(lineCode + "翻班完成, " + currSchDate + " -班次数量:" + dayOfSchedule.findByLineCode(lineCode).size()); |
| 70 | 71 | } |
| 71 | 72 | } |
| 72 | - | |
| 73 | + | |
| 74 | + //首末班入库(给网关用的数据) | |
| 75 | + FirstAndLastHandler.saveAll(); | |
| 73 | 76 | } catch (Exception e) { |
| 74 | 77 | logger.error("", e); |
| 75 | 78 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| ... | ... | @@ -105,7 +105,7 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L |
| 105 | 105 | List<Map<String,Object>> accountPx(String line,String date,String code,String xlName, String px); |
| 106 | 106 | |
| 107 | 107 | |
| 108 | - List<SchEditInfoDto> correctForm(String line,String date,String endDate,String lpName,String code, String type); | |
| 108 | + List<SchEditInfoDto> correctForm(String line,String date,String endDate,String lpName,String code, String type,String changType); | |
| 109 | 109 | |
| 110 | 110 | List<ScheduleRealInfo> queryListWaybill(String jName,String clZbh,String lpName,String date,String line); |
| 111 | 111 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -1810,7 +1810,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1810 | 1810 | |
| 1811 | 1811 | @Override |
| 1812 | 1812 | public List<SchEditInfoDto> correctForm(String line,String date,String endDate, |
| 1813 | - String lpName,String code, String type) { | |
| 1813 | + String lpName,String code, String type,String changType) { | |
| 1814 | 1814 | |
| 1815 | 1815 | // var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班', |
| 1816 | 1816 | // 'CXZX': '撤销执行', 'CXSF': '撤销实发', 'SFTZ': '实发调整', 'TZRC': '调整人车'}; |
| ... | ... | @@ -1824,6 +1824,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1824 | 1824 | map.put("SFTZ", "实发调整"); |
| 1825 | 1825 | map.put("TZRC", "调整人车"); |
| 1826 | 1826 | |
| 1827 | + SimpleDateFormat sdf1=new SimpleDateFormat("HH:mm"); | |
| 1828 | + SimpleDateFormat sdf2=new SimpleDateFormat("yyyy-MM-dd HH:mm"); | |
| 1827 | 1829 | String cont = ""; |
| 1828 | 1830 | cont = " and xl_bm ='"+line +"'"; |
| 1829 | 1831 | if(!lpName.equals("")){ |
| ... | ... | @@ -1832,7 +1834,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1832 | 1834 | if(!code.equals("")){ |
| 1833 | 1835 | cont +=" and cl_zbh ='"+code+"'"; |
| 1834 | 1836 | } |
| 1835 | - String sql = "select t1.*, " | |
| 1837 | + String sql = "select t1.*, t2.real_exec_date," | |
| 1836 | 1838 | + "t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name," |
| 1837 | 1839 | + "t2.xl_dir,t2.real_exec_date from (select * from " |
| 1838 | 1840 | + "logger_sch_modify where rq BETWEEN ? and ? and line_code=? )" |
| ... | ... | @@ -1843,9 +1845,39 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1843 | 1845 | new BeanPropertyRowMapper(SchEditInfoDto.class),date,endDate, line); |
| 1844 | 1846 | List<SchEditInfoDto> lists=new ArrayList<SchEditInfoDto>(); |
| 1845 | 1847 | for (int i = 0; i < list.size(); i++) { |
| 1848 | + Long fcsjs=0l; | |
| 1849 | + Long updsj=0l; | |
| 1846 | 1850 | SchEditInfoDto t=list.get(i); |
| 1847 | 1851 | if(map.get(t.getType())!=null){ |
| 1848 | - t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";"); | |
| 1852 | + | |
| 1853 | + if(changType.equals("")){ | |
| 1854 | + t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";"); | |
| 1855 | + }else{ | |
| 1856 | + String fcsj=""; | |
| 1857 | + String updtime=""; | |
| 1858 | + try { | |
| 1859 | + fcsj= sdf1.format(sdf1.parse(t.getFcsj())); | |
| 1860 | + updtime=sdf1.format(sdf1.parse(t.getTimeStr())); | |
| 1861 | + fcsjs=sdf2.parse(t.getRealExecDate()+" "+fcsj).getTime(); | |
| 1862 | + updsj=sdf2.parse(t.getRq()+" "+updtime).getTime(); | |
| 1863 | + } catch (ParseException e) { | |
| 1864 | + // TODO Auto-generated catch block | |
| 1865 | + e.printStackTrace(); | |
| 1866 | + } | |
| 1867 | + if(changType.equals("1")){ | |
| 1868 | + if(fcsjs>updsj){ | |
| 1869 | + t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";"); | |
| 1870 | + }else{ | |
| 1871 | + t.setType2(""); | |
| 1872 | + } | |
| 1873 | + }else if(changType.equals("2")){ | |
| 1874 | + if(fcsjs<updsj){ | |
| 1875 | + t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";"); | |
| 1876 | + }else{ | |
| 1877 | + t.setType2(""); | |
| 1878 | + } | |
| 1879 | + } | |
| 1880 | + } | |
| 1849 | 1881 | }else{ |
| 1850 | 1882 | t.setType2(""); |
| 1851 | 1883 | } |
| ... | ... | @@ -1859,7 +1891,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1859 | 1891 | } |
| 1860 | 1892 | |
| 1861 | 1893 | if(fage){ |
| 1862 | - lists.add(t); | |
| 1894 | + if(changType.equals("")){ | |
| 1895 | + lists.add(t); | |
| 1896 | + } else { | |
| 1897 | + if (changType.equals("1")) { | |
| 1898 | + if (fcsjs > updsj) { | |
| 1899 | + lists.add(t); | |
| 1900 | + } | |
| 1901 | + } else if (changType.equals("2")) { | |
| 1902 | + if (fcsjs < updsj) { | |
| 1903 | + lists.add(t); | |
| 1904 | + } | |
| 1905 | + } | |
| 1906 | + } | |
| 1863 | 1907 | } |
| 1864 | 1908 | } |
| 1865 | 1909 | ... | ... |
src/main/java/com/bsth/service/schedule/impl/CarDeviceServiceImpl.java
| ... | ... | @@ -7,6 +7,8 @@ import com.bsth.service.schedule.CarDeviceService; |
| 7 | 7 | import com.bsth.service.schedule.exception.ScheduleException; |
| 8 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 9 | import org.springframework.stereotype.Service; |
| 10 | +import org.springframework.transaction.annotation.Isolation; | |
| 11 | +import org.springframework.transaction.annotation.Propagation; | |
| 10 | 12 | import org.springframework.transaction.annotation.Transactional; |
| 11 | 13 | import org.springframework.util.CollectionUtils; |
| 12 | 14 | |
| ... | ... | @@ -21,7 +23,7 @@ public class CarDeviceServiceImpl extends BServiceImpl<CarDevice, Long> implemen |
| 21 | 23 | @Autowired |
| 22 | 24 | private CarsService carsService; |
| 23 | 25 | |
| 24 | - @Transactional | |
| 26 | + @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED) | |
| 25 | 27 | @Override |
| 26 | 28 | public CarDevice save(CarDevice carDevice) { |
| 27 | 29 | // 查找对应的车辆基础信息,更新设备编号数据 | ... | ... |
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
| ... | ... | @@ -144,6 +144,11 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 144 | 144 | return ttInfoDetailForEdit.getEditInfo(xlid, ttid, maxfcno); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | + public static void main(String[] args) { | |
| 148 | + String test = "中1中111"; | |
| 149 | + System.out.println(test.replaceAll("(\\d+)$", "")); | |
| 150 | + } | |
| 151 | + | |
| 147 | 152 | @Override |
| 148 | 153 | public void validateExcelSheet(String filename, String sheetname, Integer lineid, String linename) throws ScheduleException { |
| 149 | 154 | try { |
| ... | ... | @@ -162,8 +167,9 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 162 | 167 | if (StringUtils.isEmpty(cell_con)) { |
| 163 | 168 | throw new Exception(String.format("第1行,第%d列数据不能为空", i + 1)); |
| 164 | 169 | } else { |
| 165 | - // 正则表达式去除数字 | |
| 166 | - cell_con = cell_con.replaceAll("[\\d+]", ""); | |
| 170 | + // 正则表达式去除右侧数字 | |
| 171 | +// cell_con = cell_con.replaceAll("[\\d+]", ""); | |
| 172 | + cell_con = cell_con.replaceAll("(\\d+)$", ""); | |
| 167 | 173 | |
| 168 | 174 | if (i == 0) { // 第一列必须是路牌2个字 |
| 169 | 175 | if (!"路牌".equals(cell_con.trim())) { | ... | ... |
src/main/resources/datatools/ktrs/ttinfodetailDataInput.ktr
| ... | ... | @@ -828,7 +828,7 @@ |
| 828 | 828 | <optimizationLevel>9</optimizationLevel> |
| 829 | 829 | <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> |
| 830 | 830 | <jsScript_name>Script 1</jsScript_name> |
| 831 | - <jsScript_script>//Script here

// 使用正则表达式去除站点名称中的数字
qdzname = qdzname.replace(/\d+/g,'');

// sendtime处理,hhmm,hh:mm,hh,mm
var sendtime_calcu;
if (sendtime.length == 5) { // 最长格式,包括分隔符,统一把分隔符替换成冒号
 sendtime_calcu = sendtime.substr(0, 2) + ":" + sendtime.substr(3, 2);
} else if (sendtime.length == 4) {
 if (sendtime.indexOf(":") > 0) { // 冒号分隔,无需修改
 sendtime_calcu = sendtime;
 } else if (sendtime.indexOf(",") > 0) { // 逗号分隔,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 1) + ":" + sendtime.substr(2, 2);
 } else { // 无分隔符,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 2) + ":" + sendtime.substr(2, 2);
 }
} else if (sendtime.length == 3) { // 无分隔符,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 1) + ":" + sendtime.substr(1, 2);
}

// 设置分班
var isfb = 0;

// 设置停驶
var ists = 0;

// 设置isCanceled
var iscanceled = 0;</jsScript_script> | |
| 831 | + <jsScript_script>//Script here

// 使用正则表达式去除站点名称右侧多余的数字
qdzname = qdzname.replace(/(\d+$)/g,'');

// sendtime处理,hhmm,hh:mm,hh,mm
var sendtime_calcu;
if (sendtime.length == 5) { // 最长格式,包括分隔符,统一把分隔符替换成冒号
 sendtime_calcu = sendtime.substr(0, 2) + ":" + sendtime.substr(3, 2);
} else if (sendtime.length == 4) {
 if (sendtime.indexOf(":") > 0) { // 冒号分隔,无需修改
 sendtime_calcu = sendtime;
 } else if (sendtime.indexOf(",") > 0) { // 逗号分隔,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 1) + ":" + sendtime.substr(2, 2);
 } else { // 无分隔符,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 2) + ":" + sendtime.substr(2, 2);
 }
} else if (sendtime.length == 3) { // 无分隔符,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 1) + ":" + sendtime.substr(1, 2);
}

// 设置分班
var isfb = 0;

// 设置停驶
var ists = 0;

// 设置isCanceled
var iscanceled = 0;</jsScript_script> | |
| 832 | 832 | </jsScript> </jsScripts> <fields> <field> <name>qdzname</name> |
| 833 | 833 | <rename>qdzname</rename> |
| 834 | 834 | <type>String</type> | ... | ... |
src/main/resources/datatools/ktrs/ttinfodetailDataInput2.ktr
| ... | ... | @@ -828,7 +828,7 @@ |
| 828 | 828 | <optimizationLevel>9</optimizationLevel> |
| 829 | 829 | <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> |
| 830 | 830 | <jsScript_name>Script 1</jsScript_name> |
| 831 | - <jsScript_script>//Script here

// 使用正则表达式去除站点名称中的数字
qdzname = qdzname.replace(/\d+/g,'');

// sendtime处理,hhmm,hh:mm,hh,mm
var sendtime_calcu;
if (sendtime.length == 5) { // 最长格式,包括分隔符,统一把分隔符替换成冒号
 sendtime_calcu = sendtime.substr(0, 2) + ":" + sendtime.substr(3, 2);
} else if (sendtime.length == 4) {
 if (sendtime.indexOf(":") > 0) { // 冒号分隔,无需修改
 sendtime_calcu = sendtime;
 } else if (sendtime.indexOf(",") > 0) { // 逗号分隔,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 1) + ":" + sendtime.substr(2, 2);
 } else { // 无分隔符,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 2) + ":" + sendtime.substr(2, 2);
 }
} else if (sendtime.length == 3) { // 无分隔符,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 1) + ":" + sendtime.substr(1, 2);
}

// 设置分班
var isfb = 0;

// 设置停驶
var ists = 0;

// 设置isCanceled
var iscanceled = 0;</jsScript_script> | |
| 831 | + <jsScript_script>//Script here

// 使用正则表达式去除站点名称右侧多余的数字
qdzname = qdzname.replace(/(\d+$)/g,'');

// sendtime处理,hhmm,hh:mm,hh,mm
var sendtime_calcu;
if (sendtime.length == 5) { // 最长格式,包括分隔符,统一把分隔符替换成冒号
 sendtime_calcu = sendtime.substr(0, 2) + ":" + sendtime.substr(3, 2);
} else if (sendtime.length == 4) {
 if (sendtime.indexOf(":") > 0) { // 冒号分隔,无需修改
 sendtime_calcu = sendtime;
 } else if (sendtime.indexOf(",") > 0) { // 逗号分隔,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 1) + ":" + sendtime.substr(2, 2);
 } else { // 无分隔符,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 2) + ":" + sendtime.substr(2, 2);
 }
} else if (sendtime.length == 3) { // 无分隔符,改成冒号分隔
 sendtime_calcu = sendtime.substr(0, 1) + ":" + sendtime.substr(1, 2);
}

// 设置分班
var isfb = 0;

// 设置停驶
var ists = 0;

// 设置isCanceled
var iscanceled = 0;</jsScript_script> | |
| 832 | 832 | </jsScript> </jsScripts> <fields> <field> <name>qdzname</name> |
| 833 | 833 | <rename>qdzname</rename> |
| 834 | 834 | <type>String</type> | ... | ... |
src/main/resources/static/pages/forms/statement/correctForm.html
| ... | ... | @@ -28,26 +28,35 @@ |
| 28 | 28 | <div class="portlet-title"> |
| 29 | 29 | <form class="form-inline" action=""> |
| 30 | 30 | <div style="display: inline-block;"> |
| 31 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 31 | + <span class="item-label" style="width: 140px;">线路: </span> | |
| 32 | 32 | <select class="form-control" name="line" id="line" style="width: 136px;"></select> |
| 33 | 33 | </div> |
| 34 | 34 | <div style="display: inline-block;margin-left: 15px;"> |
| 35 | 35 | <span class="item-label" style="width: 80px;">开始时间: </span> |
| 36 | - <input class="form-control" type="text" id="date" style="width: 120px;"/> | |
| 36 | + <input class="form-control" type="text" id="date" style="width: 160px;"/> | |
| 37 | 37 | </div> |
| 38 | 38 | <div style="display: inline-block;margin-left: 15px;"> |
| 39 | 39 | <span class="item-label" style="width: 80px;">结束时间: </span> |
| 40 | - <input class="form-control" type="text" id="endDate" style="width: 120px;"/> | |
| 40 | + <input class="form-control" type="text" id="endDate" style="width: 160px;"/> | |
| 41 | 41 | </div> |
| 42 | - <div style="display: inline-block;margin-left: 15px"> | |
| 43 | - <span class="item-label" style="width: 140px;">路牌: </span> | |
| 42 | + <div style="margin-top: 10px"></div> | |
| 43 | + <div style="display: inline-block;"> | |
| 44 | + <span class="item-label" style="width: 140px;">路牌: </span> | |
| 44 | 45 | <select class="form-control" name="lpName" id="lpName" style="width: 136px;"></select> |
| 45 | 46 | </div> |
| 46 | 47 | <div style="display: inline-block;margin-left: 15px"> |
| 47 | - <span class="item-label" style="width: 140px;">内部编码: </span> | |
| 48 | - <select class="form-control" name="code" id="code" style="width: 145px;"></select> | |
| 48 | + <span class="item-label" style="width: 80px;">内部编码: </span> | |
| 49 | + <select class="form-control" name="code" id="code" style="width: 120px;"></select> | |
| 49 | 50 | <input class="btn btn-default" type="button" id="czcl" value="X"/> |
| 50 | 51 | </div> |
| 52 | + <div style="display: inline-block;margin-left: 15px"> | |
| 53 | + <span class="item-label" style="width: 140px;">修改类型: </span> | |
| 54 | + <select class="form-control" name="code" id="changType" style="width: 160px;"> | |
| 55 | + <option value="">全部</option> | |
| 56 | + <option value="1">前修改</option> | |
| 57 | + <option value="2">后修改</option> | |
| 58 | + </select> | |
| 59 | + </div> | |
| 51 | 60 | <div class="form-group"> |
| 52 | 61 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 53 | 62 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| ... | ... | @@ -220,14 +229,16 @@ |
| 220 | 229 | var lpName = $("#lpName").val(); |
| 221 | 230 | var endDate = $("#endDate").val(); |
| 222 | 231 | var code = $("#code").val(); |
| 232 | + var changType=$("#changType").val(); | |
| 223 | 233 | $("#query").on("click",function(){ |
| 224 | 234 | line = $("#line").val(); |
| 225 | 235 | date = $("#date").val(); |
| 226 | 236 | lpName = $("#lpName").val(); |
| 227 | 237 | code = $("#code").val(); |
| 228 | 238 | endDate = $("#endDate").val(); |
| 239 | + changType=$("#changType").val(); | |
| 229 | 240 | var type = "query"; |
| 230 | - $get("/realSchedule/correctForm",{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type},function(result){ | |
| 241 | + $get("/realSchedule/correctForm",{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){ | |
| 231 | 242 | var list_correctForm = template('list_correctForm',{list:result}); |
| 232 | 243 | // 把渲染好的模版html文本追加到表格中 |
| 233 | 244 | $('#forms .list_correctForm').html(list_correctForm); |
| ... | ... | @@ -245,7 +256,7 @@ |
| 245 | 256 | |
| 246 | 257 | $("#export").on("click",function(){ |
| 247 | 258 | var type = "export"; |
| 248 | - $get('/realSchedule/correctForm',{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type},function(result){ | |
| 259 | + $get('/realSchedule/correctForm',{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){ | |
| 249 | 260 | window.open("/downloadFile/download?fileName=修正报表"+date); |
| 250 | 261 | }); |
| 251 | 262 | }); | ... | ... |
src/main/resources/static/pages/permission/authorize_all/authorize.html
0 → 100644
src/main/resources/static/pages/permission/authorize_all/main.html
0 → 100644
src/main/resources/static/pages/permission/role/settings.html
| ... | ... | @@ -160,10 +160,13 @@ $(function(){ |
| 160 | 160 | |
| 161 | 161 | //模块下拉框 |
| 162 | 162 | getModuleTreeData(function(treeData){ |
| 163 | + | |
| 163 | 164 | var options = ''; |
| 164 | 165 | $.each(treeData, function(i, g){ |
| 165 | 166 | var dArray = g.children; |
| 166 | - | |
| 167 | + | |
| 168 | + if(!dArray) | |
| 169 | + return true; | |
| 167 | 170 | for(var i = 0,d; d = dArray[i++];){ |
| 168 | 171 | options += '<optgroup label="'+d.name+'">'; |
| 169 | 172 | if(!d.children) | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/main.js
| ... | ... | @@ -67,28 +67,48 @@ ScheduleApp.factory('DataStore', [ |
| 67 | 67 | // 简拼数据 |
| 68 | 68 | dataMap.cl = result.data.data; |
| 69 | 69 | angular.forEach(result.data.data, function(obj) { |
| 70 | + //// 全拼 | |
| 71 | + //obj["$fullChars"] = pinyin.getFullChars(obj.insideCode ? obj.insideCode: ""); | |
| 72 | + //// 简拼 | |
| 73 | + //obj["$camelChars"] = pinyin.getCamelChars(obj.insideCode ? obj.insideCode: ""); | |
| 70 | 74 | // 全拼 |
| 71 | - obj["$fullChars"] = pinyin.getFullChars(obj.insideCode ? obj.insideCode: ""); | |
| 75 | + obj["$fullChars"] = obj.insideCode? obj.insideCode: ""; | |
| 72 | 76 | // 简拼 |
| 73 | - obj["$camelChars"] = pinyin.getCamelChars(obj.insideCode ? obj.insideCode: ""); | |
| 77 | + obj["$camelChars"] = obj.insideCode? obj.insideCode: ""; | |
| 74 | 78 | // 原值 |
| 75 | 79 | obj["$calcu_str"] = obj.insideCode? obj.insideCode: ""; |
| 76 | 80 | }); |
| 77 | 81 | }); |
| 78 | 82 | |
| 83 | + //$http({ | |
| 84 | + // method: 'GET', | |
| 85 | + // url: '/ee/all' | |
| 86 | + //}).then(function(result) { | |
| 87 | + // // 简拼数据 | |
| 88 | + // dataMap.ry = result.data.data; | |
| 89 | + // angular.forEach(result.data.data, function(obj) { | |
| 90 | + // // 全拼 | |
| 91 | + // obj["$fullChars"] = pinyin.getFullChars(obj.personnelName + "-" + obj.jobCode); | |
| 92 | + // // 简拼 | |
| 93 | + // obj["$camelChars"] = pinyin.getCamelChars(obj.personnelName + "-" + obj.jobCode); | |
| 94 | + // // 原值 | |
| 95 | + // obj["$calcu_str"] = obj.personnelName + "-" + obj.jobCode; | |
| 96 | + // }); | |
| 97 | + //}); | |
| 98 | + | |
| 79 | 99 | $http({ |
| 80 | 100 | method: 'GET', |
| 81 | - url: '/ee/all' | |
| 101 | + url: '/personnel/all_py' | |
| 82 | 102 | }).then(function(result) { |
| 83 | 103 | // 简拼数据 |
| 84 | - dataMap.ry = result.data.data; | |
| 85 | - angular.forEach(result.data.data, function(obj) { | |
| 104 | + dataMap.ry = result.data; | |
| 105 | + angular.forEach(result.data, function(obj) { | |
| 86 | 106 | // 全拼 |
| 87 | - obj["$fullChars"] = pinyin.getFullChars(obj.personnelName + "-" + obj.jobCode); | |
| 107 | + obj["$fullChars"] = obj.fullChars; | |
| 88 | 108 | // 简拼 |
| 89 | - obj["$camelChars"] = pinyin.getCamelChars(obj.personnelName + "-" + obj.jobCode); | |
| 109 | + obj["$camelChars"] = obj.camelChars; | |
| 90 | 110 | // 原值 |
| 91 | - obj["$calcu_str"] = obj.personnelName + "-" + obj.jobCode; | |
| 111 | + obj["$calcu_str"] = obj.name + "-" + obj.workId; | |
| 92 | 112 | }); |
| 93 | 113 | }); |
| 94 | 114 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/edit.html
| ... | ... | @@ -84,9 +84,9 @@ |
| 84 | 84 | icname="id" |
| 85 | 85 | dsparams="{{ {type: 'local', param: 'ry' } | json }}" |
| 86 | 86 | iterobjname="item" |
| 87 | - iterobjexp="item.personnelName + '<' + item.jobCode + '>'" | |
| 87 | + iterobjexp="item.name + '<' + item.workId + '>'" | |
| 88 | 88 | searchph="请输拼音..." |
| 89 | - searchexp="this.personnelName + '<' + this.jobCode + '>'" | |
| 89 | + searchexp="this.name + '<' + this.workId + '>'" | |
| 90 | 90 | required > |
| 91 | 91 | </sa-Select5> |
| 92 | 92 | <input type="hidden" name="jsy_h" ng-model="ctrl.employeeConfigForSave.jsy.id" |
| ... | ... | @@ -116,9 +116,9 @@ |
| 116 | 116 | icname="id" |
| 117 | 117 | dsparams="{{ {type: 'local', param: 'ry' } | json }}" |
| 118 | 118 | iterobjname="item" |
| 119 | - iterobjexp="item.personnelName + '<' + item.jobCode + '>'" | |
| 119 | + iterobjexp="item.name + '<' + item.workId + '>'" | |
| 120 | 120 | searchph="请输拼音..." |
| 121 | - searchexp="this.personnelName + '<' + this.jobCode + '>'" | |
| 121 | + searchexp="this.name + '<' + this.workId + '>'" | |
| 122 | 122 | > |
| 123 | 123 | </sa-Select5> |
| 124 | 124 | <input type="hidden" name="spy_h" ng-model="ctrl.employeeConfigForSave.spy.id" | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/form.html
| ... | ... | @@ -84,9 +84,9 @@ |
| 84 | 84 | icname="id" |
| 85 | 85 | dsparams="{{ {type: 'local', param: 'ry' } | json }}" |
| 86 | 86 | iterobjname="item" |
| 87 | - iterobjexp="item.personnelName + '<' + item.jobCode + '>'" | |
| 87 | + iterobjexp="item.name + '<' + item.workId + '>'" | |
| 88 | 88 | searchph="请输拼音..." |
| 89 | - searchexp="this.personnelName + '<' + this.jobCode + '>'" | |
| 89 | + searchexp="this.name + '<' + this.workId + '>'" | |
| 90 | 90 | required > |
| 91 | 91 | </sa-Select5> |
| 92 | 92 | <input type="hidden" name="jsy_h" ng-model="ctrl.employeeConfigForSave.jsy.id" |
| ... | ... | @@ -116,9 +116,9 @@ |
| 116 | 116 | icname="id" |
| 117 | 117 | dsparams="{{ {type: 'local', param: 'ry' } | json }}" |
| 118 | 118 | iterobjname="item" |
| 119 | - iterobjexp="item.personnelName + '<' + item.jobCode + '>'" | |
| 119 | + iterobjexp="item.name + '<' + item.workId + '>'" | |
| 120 | 120 | searchph="请输拼音..." |
| 121 | - searchexp="this.personnelName + '<' + this.jobCode + '>'" | |
| 121 | + searchexp="this.name + '<' + this.workId + '>'" | |
| 122 | 122 | > |
| 123 | 123 | </sa-Select5> |
| 124 | 124 | <input type="hidden" name="spy_h" ng-model="ctrl.employeeConfigForSave.spy.id" | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html
| ... | ... | @@ -96,9 +96,9 @@ |
| 96 | 96 | icname="id" |
| 97 | 97 | dsparams="{{ {type: 'local', param: 'ry' } | json }}" |
| 98 | 98 | iterobjname="item" |
| 99 | - iterobjexp="item.personnelName + '(' + item.jobCode + ')'" | |
| 99 | + iterobjexp="item.name + '(' + item.workId + ')'" | |
| 100 | 100 | searchph="请输拼音..." |
| 101 | - searchexp="this.personnelName" | |
| 101 | + searchexp="this.name" | |
| 102 | 102 | required |
| 103 | 103 | > |
| 104 | 104 | </sa-Select5> |
| ... | ... | @@ -119,9 +119,9 @@ |
| 119 | 119 | icname="id" |
| 120 | 120 | dsparams="{{ {type: 'local', param: 'ry' } | json }}" |
| 121 | 121 | iterobjname="item" |
| 122 | - iterobjexp="item.personnelName + '(' + item.jobCode + ')'" | |
| 122 | + iterobjexp="item.name + '(' + item.workId + ')'" | |
| 123 | 123 | searchph="请输拼音..." |
| 124 | - searchexp="this.personnelName" | |
| 124 | + searchexp="this.name" | |
| 125 | 125 | > |
| 126 | 126 | </sa-Select5> |
| 127 | 127 | </div> |
| ... | ... | @@ -137,9 +137,9 @@ |
| 137 | 137 | icname="id" |
| 138 | 138 | dsparams="{{ {type: 'local', param: 'ry' } | json }}" |
| 139 | 139 | iterobjname="item" |
| 140 | - iterobjexp="item.personnelName + '(' + item.jobCode + ')'" | |
| 140 | + iterobjexp="item.name + '(' + item.workId + ')'" | |
| 141 | 141 | searchph="请输拼音..." |
| 142 | - searchexp="this.personnelName" | |
| 142 | + searchexp="this.name" | |
| 143 | 143 | > |
| 144 | 144 | </sa-Select5> |
| 145 | 145 | </div> |
| ... | ... | @@ -155,9 +155,9 @@ |
| 155 | 155 | icname="id" |
| 156 | 156 | dsparams="{{ {type: 'local', param: 'ry' } | json }}" |
| 157 | 157 | iterobjname="item" |
| 158 | - iterobjexp="item.personnelName + '(' + item.jobCode + ')'" | |
| 158 | + iterobjexp="item.name + '(' + item.workId + ')'" | |
| 159 | 159 | searchph="请输拼音..." |
| 160 | - searchexp="this.personnelName" | |
| 160 | + searchexp="this.name" | |
| 161 | 161 | > |
| 162 | 162 | </sa-Select5> |
| 163 | 163 | </div> |
| ... | ... | @@ -173,9 +173,9 @@ |
| 173 | 173 | icname="id" |
| 174 | 174 | dsparams="{{ {type: 'local', param: 'ry' } | json }}" |
| 175 | 175 | iterobjname="item" |
| 176 | - iterobjexp="item.personnelName + '(' + item.jobCode + ')'" | |
| 176 | + iterobjexp="item.name + '(' + item.workId + ')'" | |
| 177 | 177 | searchph="请输拼音..." |
| 178 | - searchexp="this.personnelName" | |
| 178 | + searchexp="this.name" | |
| 179 | 179 | > |
| 180 | 180 | </sa-Select5> |
| 181 | 181 | </div> |
| ... | ... | @@ -191,9 +191,9 @@ |
| 191 | 191 | icname="id" |
| 192 | 192 | dsparams="{{ {type: 'local', param: 'ry' } | json }}" |
| 193 | 193 | iterobjname="item" |
| 194 | - iterobjexp="item.personnelName + '(' + item.jobCode + ')'" | |
| 194 | + iterobjexp="item.name + '(' + item.workId + ')'" | |
| 195 | 195 | searchph="请输拼音..." |
| 196 | - searchexp="this.personnelName" | |
| 196 | + searchexp="this.name" | |
| 197 | 197 | > |
| 198 | 198 | </sa-Select5> |
| 199 | 199 | </div> | ... | ... |
src/main/resources/static/real_control_v2/js/data/data_basic.js
| ... | ... | @@ -56,16 +56,15 @@ var gb_data_basic = (function () { |
| 56 | 56 | ep.emit('all_personnel', data); |
| 57 | 57 | }); |
| 58 | 58 | function loadAllPersonnel(cb) { |
| 59 | - $.get('/basic/all_personnel', function (rs) { | |
| 59 | + $.get('/personnel/all_py', function (rs) { | |
| 60 | 60 | //转换成自动补全组件需要的数据 |
| 61 | - var data = [], name, code; | |
| 62 | - for (var jobCode in rs) { | |
| 63 | - name = rs[jobCode]; | |
| 64 | - code = jobCode.indexOf('-')!=-1?jobCode.split('-')[1]:jobCode; | |
| 61 | + var data = [], code; | |
| 62 | + for(var i =0, p; p = rs[i++];){ | |
| 63 | + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 65 | 64 | data.push({ |
| 66 | - value: code + '/' + name, | |
| 67 | - fullChars: pinyin.getFullChars(name).toUpperCase(), | |
| 68 | - camelChars: pinyin.getCamelChars(name) | |
| 65 | + value: code + '/' + p.name, | |
| 66 | + fullChars: p.fullChars, | |
| 67 | + camelChars: p.camelChars | |
| 69 | 68 | }); |
| 70 | 69 | } |
| 71 | 70 | cb && cb(data); | ... | ... |