Commit df0f514bd657bd94263d366e81a4b4c7e857c353

Authored by 廖磊
2 parents a3ba2934 70d5cecb

Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control

into pudong
Showing 21 changed files with 681 additions and 368 deletions
src/main/java/com/bsth/controller/schedule/core/TTInfoController.java
... ... @@ -55,6 +55,23 @@ public class TTInfoController extends BController<TTInfo, Long> {
55 55 return rtn;
56 56 }
57 57  
  58 + @RequestMapping(value = "/versiondesc2/{lineid}/{status}")
  59 + public Map<String, Object> getLineVersionDesc2(
  60 + @PathVariable(value = "lineid") Integer lineid,
  61 + @PathVariable(value = "status") Integer status) {
  62 + Map<String, Object> rtn = new HashMap<>();
  63 + try {
  64 + rtn.put("status", ResponseCode.SUCCESS);
  65 + rtn.put("data", ttInfoService.getLineVersions(lineid, status));
  66 +
  67 + } catch (Exception exp) {
  68 + rtn.put("status", ResponseCode.ERROR);
  69 + rtn.put("msg", exp.getMessage());
  70 + }
  71 +
  72 + return rtn;
  73 + }
  74 +
58 75 @RequestMapping(value = "/validate_name", method = RequestMethod.GET)
59 76 public Map<String, Object> validate_name(@RequestParam Map<String, Object> param) {
60 77 Map<String, Object> rtn = new HashMap<>();
... ...
src/main/java/com/bsth/controller/schedule/core/TTInfoDetailController.java
... ... @@ -32,30 +32,18 @@ public class TTInfoDetailController extends BController&lt;TTInfoDetail, Long&gt; {
32 32 * @param sheetname sheet名字
33 33 * @param lineid 线路id
34 34 * @param linename 线路名称
  35 + * @param lineversion 线路版本
35 36 * @return
36 37 */
37 38 @RequestMapping(value = "/validate/sheet", method = RequestMethod.POST)
38 39 public Map<String, Object> validate_sheet(
39   - String filename, String sheetname, Integer lineid, String linename,
40   - Integer zdlytype, Integer zdlyversion) {
  40 + String filename, String sheetname, Integer lineid, String linename, Integer lineversion) {
41 41 Map<String, Object> rtn = new HashMap<>();
42 42 try {
43   - if (zdlytype == null) {
44   - throw new Exception("请选择路由版本类型");
45   - } else {
46   - if (zdlytype == 1) {
47   - ttInfoDetailService.validateExcelSheet(filename, sheetname, lineid, linename, null);
48   - } else if (zdlytype == 2) {
49   - if (zdlyversion == null || zdlyversion == -1) {
50   - throw new Exception("请选择具体版本");
51   - } else {
52   - ttInfoDetailService.validateExcelSheet(filename, sheetname, lineid, linename, zdlyversion);
53   - }
54   - } else {
55   - throw new Exception("未知路由版本类型");
56   - }
  43 + if (lineversion == null) {
  44 + throw new Exception("线路版本未知");
57 45 }
58   -
  46 + ttInfoDetailService.validateExcelSheet(filename, sheetname, lineid, linename, lineversion);
59 47 rtn.put("status", ResponseCode.SUCCESS);
60 48 } catch (Exception exp) {
61 49 rtn.put("status", ResponseCode.ERROR);
... ...
src/main/java/com/bsth/repository/schedule/TTInfoRepository.java
... ... @@ -11,7 +11,9 @@ import org.springframework.data.jpa.repository.EntityGraph;
11 11 import org.springframework.data.jpa.repository.Query;
12 12 import org.springframework.stereotype.Repository;
13 13  
  14 +import javax.persistence.Tuple;
14 15 import java.util.List;
  16 +import java.util.Map;
15 17  
16 18 /**
17 19 * Created by xu on 16/5/12.
... ... @@ -31,4 +33,19 @@ public interface TTInfoRepository extends BaseRepository&lt;TTInfo, Long&gt; {
31 33  
32 34 @Query("select t from TTInfo t where t.xl = ?1 and t.isCancel = false")
33 35 List<TTInfo> findInCanceledByXl(Line xl);
  36 +
  37 + @Query(value = "select new map(lv.name as name, lv.startDate as sd, " +
  38 + "lv.status as status, lv.versions as version) " +
  39 + "from LineVersions lv where lv.line.id = ?1 ")
  40 + List<Map<String, Object>> findLineVersionDescs(Integer lineId);
  41 +
  42 + @Query(value = "select new map(lv.name as name, lv.startDate as sd, " +
  43 + "lv.status as status, lv.versions as version) " +
  44 + "from LineVersions lv where lv.line.id = ?1 and lv.versions = ?2 ")
  45 + List<Map<String, Object>> findLineVersionDescs2(Integer lineId, Integer version);
  46 +
  47 + @Query(value = "select new map(lv.name as name, lv.versions as version) " +
  48 + "from LineVersions lv where lv.line.id = ?1 and lv.status = ?2 ")
  49 + List<Map<String, Object>> findLineVersionDescs3(Integer lineId, Integer status);
  50 +
34 51 }
... ...
src/main/java/com/bsth/service/schedule/TTInfoDetailService.java
... ... @@ -34,14 +34,14 @@ public interface TTInfoDetailService extends BService&lt;TTInfoDetail, Long&gt; {
34 34 * @param filename excel文件全路径名
35 35 * @param sheetname sheet名字
36 36 * @param lineid 线路id
37   - * @param zdlyversion 站点路由版本
  37 + * @param lineversion 线路版本
38 38 */
39 39 void validateExcelSheet(
40 40 String filename,
41 41 String sheetname,
42 42 Integer lineid,
43 43 String linename,
44   - Integer zdlyversion) throws ScheduleException;
  44 + Integer lineversion) throws ScheduleException;
45 45  
46 46 /**
47 47 * 验证关联的线路标准信息(以后放到规则引擎里去做)。
... ...
src/main/java/com/bsth/service/schedule/TTInfoService.java
... ... @@ -21,4 +21,6 @@ public interface TTInfoService extends BService&lt;TTInfo, Long&gt; {
21 21  
22 22 String getLineVersionDesc(Integer lineId, Integer version);
23 23  
  24 + List<Map<String, Object>> getLineVersions(Integer lineId, Integer status);
  25 +
24 26 }
... ...
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
... ... @@ -72,6 +72,10 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
72 72 try {
73 73 LOGGER.info("//---------------- 导入时刻表明细 start... ----------------//");
74 74  
  75 + if (params.get("lineversion") == null) {
  76 + throw new Exception("线路版本未知");
  77 + }
  78 +
75 79 String filename = file.getAbsolutePath(); // xls xlsx 文件名
76 80 String sheetname = String.valueOf(params.get("sheetname")); // sheet名字
77 81 Long ttid = Long.valueOf(String.valueOf(params.get("ttid"))); // 时刻表id
... ... @@ -79,7 +83,7 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
79 83 Integer lineid = Integer.valueOf(String.valueOf(params.get("lineinfo"))); // 线路标准id
80 84 String xlname = String.valueOf(params.get("xlname")); // 线路名字
81 85 String ttname = String.valueOf(params.get("ttname")); // 时刻表名字
82   - Integer zdlyversion = params.get("zdlyversion") == null ? null : Integer.valueOf(params.get("zdlyversion").toString());
  86 + Integer lineversion = Integer.valueOf(params.get("lineversion").toString());
83 87  
84 88 LOGGER.info("参数1, xls文件名={},sheet名字={}", filename, sheetname);
85 89 LOGGER.info("参数2, 线路id={},线路名字={}", xlid, xlname);
... ... @@ -149,30 +153,27 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
149 153  
150 154 // 创建ktr转换所需参数
151 155 Map<String, Object> ktrParms = new HashMap<>();
152   - File ktrFile = new File(this.getClass().getResource(
  156 + // 元数据ktr
  157 + File mktrFile = new File(this.getClass().getResource(
153 158 dataToolsProperties.getTtinfodetailMetadatainputktr()).toURI());
154   -// File ktrFile2 = new File(this.getClass().getResource(
155   -// dataToolsProperties.getTtinfodetailDatainputktr()).toURI());
156   - File ktrFile2 = new File(this.getClass().getResource(
157   - dataToolsProperties.getTtinfodetailDatainputktr2()).toURI());
158   - File ktrFile2_ls = new File(this.getClass().getResource(
159   - dataToolsProperties.getTtinfodetailDatainputktr2ls()).toURI());
  159 + // 实际数据ktr
  160 + File ktrFile2_version = new File(this.getClass().getResource(
  161 + dataToolsProperties.getTtinfodetailDatainputktr2version()).toURI());
160 162  
161 163 // 通用参数,转换文件路径,excel输入文件路径,错误输出文件路径
162   - ktrParms.put("transpath", ktrFile.getAbsolutePath());
  164 + ktrParms.put("transpath", mktrFile.getAbsolutePath());
163 165 ktrParms.put("filepath", fileCal.getAbsolutePath());
164 166 ktrParms.put("erroroutputdir", dataToolsProperties.getTransErrordir());
165 167  
166 168 // 附加参数
167   - ktrParms.put("injectktrfile", zdlyversion == null || zdlyversion == -1 ?
168   - ktrFile2.getAbsolutePath() : ktrFile2_ls.getAbsolutePath()); // 注入元数据的ktr文件
  169 + ktrParms.put("injectktrfile", ktrFile2_version.getAbsolutePath()); // 注入元数据的ktr文件
169 170 ktrParms.put("sheetname", sheetname); // sheet工作区的名字
170 171 ktrParms.put("lineinfoid", lineid); // 线路标准id
171 172 ktrParms.put("xlname", xlname); // 线路名称
172 173 ktrParms.put("xlid", xlid); // 线路id
173 174 ktrParms.put("ttinfoname", ttname); // 时刻表名称
174 175 ktrParms.put("ttid", ttid.intValue()); // 时刻表id
175   - ktrParms.put("zdlyversion", zdlyversion); // 站点路由版本
  176 + ktrParms.put("lineversion", lineversion); // 站点路由版本
176 177 ktrParms.put("excelfieldnames", StringUtils.join(columnames.toArray(), ",")); // 时刻表excel输入字段名,以逗号连接
177 178 columnames.remove(0);
178 179 ktrParms.put("normalizefieldnames", StringUtils.join(columnames.toArray(), ",")); // 数据范式化字段名,以逗号连接
... ...
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -1485,7 +1485,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1485 1485  
1486 1486 try {
1487 1487 String sql = "select a.schedule_date_str, a.real_exec_date, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name,"
1488   - + " a.cc_service, b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line"
  1488 + + " a.cc_service, a.remarks, a.adjust_exps, b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line"
1489 1489 + " where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'"
1490 1490 + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'";
1491 1491 if(line.length() != 0)
... ... @@ -1512,6 +1512,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1512 1512 schedule.setGsName(rs.getString("gs_name"));
1513 1513 schedule.setFgsName(rs.getString("fgs_name"));
1514 1514 schedule.setCcService(rs.getBoolean("cc_service"));
  1515 + schedule.setRemarks(rs.getString("remarks")!=null?rs.getString("remarks"):"");
  1516 + schedule.setAdjustExps(rs.getString("adjust_exps")!=null?rs.getString("adjust_exps"):"");
1515 1517  
1516 1518 int startOpt = 0;
1517 1519 if(rs.getString("start_opt") != null && rs.getString("start_opt").trim().length() != 0){
... ... @@ -1569,6 +1571,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1569 1571 subCompanyName = s.getFgsName();
1570 1572 }
1571 1573  
  1574 + List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
1572 1575 for(String xlName : keyMap.keySet()){
1573 1576 List<Map<String, Object>> tempList = new ArrayList<Map<String,Object>>();
1574 1577 Map<String, Object> tempMap = new HashMap<String, Object>();
... ... @@ -1630,10 +1633,38 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1630 1633 temp.put("sjfcLast0", s4.getFcsjActual());
1631 1634 temp.put("delayLast0", delayLast0>0?"+"+delayLast0:delayLast0);
1632 1635 jhbc += 2;
1633   - if(delayFirst0 <= 1l && delayFirst0 >= -3l)
  1636 + if(delayFirst0 <= 1l && delayFirst0 >= -3l){
1634 1637 sjbc++;
1635   - if(delayLast0 <= 1l && delayLast0 >= -3l)
  1638 + } else {
  1639 + Map<String, Object> m = new HashMap<String, Object>();
  1640 + m.put("date", date.substring(5));
  1641 + m.put("line", xlName);
  1642 + m.put("firstOrLast", "上行首发");
  1643 + m.put("qdz", s1.getQdzName());
  1644 + m.put("jhfc", s1.getFcsj());
  1645 + m.put("sjfc", s2.getFcsjActual());
  1646 + m.put("delay", delayFirst0>0?"+"+delayFirst0:delayFirst0);
  1647 + m.put("remarks1", s1.getRemarks());
  1648 + m.put("remarks2", s2.getRemarks());
  1649 + m.put("remarks", s1.getRemarks() + s2.getRemarks());
  1650 + mapList.add(m);
  1651 + }
  1652 + if(delayLast0 <= 1l && delayLast0 >= -3l){
1636 1653 sjbc++;
  1654 + } else {
  1655 + Map<String, Object> m = new HashMap<String, Object>();
  1656 + m.put("date", date.substring(5));
  1657 + m.put("line", xlName);
  1658 + m.put("firstOrLast", "上行末发");
  1659 + m.put("qdz", s3.getQdzName());
  1660 + m.put("jhfc", s3.getFcsj());
  1661 + m.put("sjfc", s4.getFcsjActual());
  1662 + m.put("delay", delayLast0>0?"+"+delayLast0:delayLast0);
  1663 + m.put("remarks1", s3.getRemarks());
  1664 + m.put("remarks2", s4.getRemarks());
  1665 + m.put("remarks", s3.getRemarks() + s4.getRemarks());
  1666 + mapList.add(m);
  1667 + }
1637 1668 } else {
1638 1669 temp.put("qdzFirst0", "--");
1639 1670 temp.put("jhfcFirst0", "/");
... ... @@ -1662,10 +1693,40 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1662 1693 temp.put("sjfcLast1", s4.getFcsjActual());
1663 1694 temp.put("delayLast1", delayLast1>0?"+"+delayLast1:delayLast1);
1664 1695 jhbc += 2;
1665   - if(delayFirst1 <= 1l && delayFirst1 >= -3l)
  1696 + if(delayFirst1 <= 1l && delayFirst1 >= -2l){
1666 1697 sjbc++;
1667   - if(delayLast1 <= 1l && delayLast1 >= -3l)
  1698 + } else {
  1699 + Map<String, Object> m = new HashMap<String, Object>();
  1700 + m.put("date", date.substring(5));
  1701 + m.put("line", xlName);
  1702 + m.put("firstOrLast", "下行首发");
  1703 + m.put("qdz", s1.getQdzName());
  1704 + m.put("jhfc", s1.getFcsj());
  1705 + m.put("sjfc", s2.getFcsjActual());
  1706 + m.put("delay", delayFirst1>0?"+"+delayFirst1:delayFirst1);
  1707 + m.put("remarks1", s1.getRemarks());
  1708 + m.put("remarks2", s2.getRemarks());
  1709 + m.put("remarks", s1.getRemarks() + s2.getAdjustExps());
  1710 + mapList.add(m);
  1711 + }
  1712 +
  1713 + if(delayLast1 <= 1l && delayLast1 >= -2l){
1668 1714 sjbc++;
  1715 + } else {
  1716 + Map<String, Object> m = new HashMap<String, Object>();
  1717 + m.put("date", date.substring(5));
  1718 + m.put("line", xlName);
  1719 + m.put("firstOrLast", "下行末发");
  1720 + m.put("qdz", s3.getQdzName());
  1721 + m.put("jhfc", s3.getFcsj());
  1722 + m.put("sjfc", s4.getFcsjActual());
  1723 + m.put("delay", delayLast1>0?"+"+delayLast1:delayLast1);
  1724 + m.put("remarks1", s3.getRemarks());
  1725 + m.put("remarks2", s4.getRemarks());
  1726 + m.put("remarks", s3.getRemarks() + s4.getRemarks());
  1727 + mapList.add(m);
  1728 + }
  1729 +
1669 1730 } else {
1670 1731 temp.put("qdzFirst1", "--");
1671 1732 temp.put("jhfcFirst1", "/");
... ... @@ -1692,14 +1753,20 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1692 1753 Map<String, Object> tempMap = new HashMap<String, Object>();
1693 1754 if(resList.size() > 0){
1694 1755 tempMap.put("date", "合计汇总");
1695   - int jhbc = 0, sjbc = 0;
  1756 + int jhbc = 0, sjbc = 0, i = 0;
1696 1757 for(Map<String, Object> m : resList){
1697 1758 jhbc += Integer.valueOf(m.get("jhbc").toString());
1698 1759 sjbc += Integer.valueOf(m.get("sjbc").toString());
1699 1760 }
1700 1761 tempMap.put("jhbc", jhbc);
1701 1762 tempMap.put("sjbc", sjbc);
1702   - tempMap.put("zdl", nf.format((float) sjbc / jhbc *100) + "%");
  1763 + tempMap.put("zdl", nf.format((float) sjbc / jhbc * 100) + "%");
  1764 + for(Map<String, Object> m : mapList){
  1765 + m.put("no", ++i);
  1766 + m.put("company", companyName);
  1767 + m.put("subCompany", subCompanyName);
  1768 + }
  1769 + tempMap.put("map", mapList);
1703 1770 if(!type.equals("export"))
1704 1771 resList.add(tempMap);
1705 1772 }
... ...
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
... ... @@ -146,7 +146,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
146 146 }
147 147  
148 148 @Override
149   - public void validateExcelSheet(String filename, String sheetname, Integer lineid, String linename, Integer zdlyversion) throws ScheduleException {
  149 + public void validateExcelSheet(String filename, String sheetname, Integer lineid, String linename, Integer lineversion) throws ScheduleException {
150 150 try {
151 151 File file = new File(filename);
152 152 Workbook workbook;
... ... @@ -178,7 +178,10 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
178 178 } else {
179 179 // 正则表达式去除右侧数字
180 180 // cell_con = cell_con.replaceAll("[\\d+]", "");
181   - cell_con = cell_con.replaceAll("(\\d+)$", "");
  181 +// cell_con = cell_con.replaceAll("(\\d+)$", "");
  182 +
  183 + // 如果站名中有类似->{数字},使用正则表达式过滤掉
  184 + cell_con = cell_con.replaceAll("(->\\d+)", "");
182 185  
183 186 if (i == 0) { // 第一列必须是路牌2个字
184 187 if (!"路牌".equals(cell_con.trim())) {
... ... @@ -189,35 +192,20 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
189 192 (!"进场".equals(cell_con.trim()))) {
190 193 Map<String, Object> p1 = new HashMap<>();
191 194 p1.put("line.id_eq", lineid);
192   - p1.put("stationName_like", cell_con.trim() + "%"); // 使用模糊匹配
193   - p1.put("stationMark_eq", "B");
  195 + p1.put("stationName_eq", cell_con.trim());
  196 + p1.put("stationMark_eq", "B"); // 起点站
194 197 p1.put("destroy_eq", 0); // 未撤销
195   -
196   -
197   - // TODO:这里要修改(起点站有启用撤销的标志的)
198   -
199   - if (zdlyversion == null) {
200   - List<StationRoute> stationRouteList = (List<StationRoute>) stationRouteService.list(p1);
201   - if (CollectionUtils.isEmpty(stationRouteList)) {
202   - throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中不是起点站", i + 1, cell_con.trim(), linename));
203   - } else if (stationRouteList.size() > 1) {
204   - throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中上下行都是起点站", i + 1, cell_con.trim(), linename));
205   - } else if (StringUtils.isEmpty(stationRouteList.get(0).getStationCode())) {
206   - throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中没有站点编码", i + 1, cell_con.trim(), linename));
207   - }
208   - } else {
209   - p1.put("versions_eq", zdlyversion);
210   - List<LsStationRoute> lsStationRoutes = (List<LsStationRoute>) stationRouteService.list_ls(p1);
211   - if (CollectionUtils.isEmpty(lsStationRoutes)) {
212   - throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中不是起点站", i + 1, cell_con.trim(), linename));
213   - } else if (lsStationRoutes.size() > 1) {
214   - throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中上下行都是起点站", i + 1, cell_con.trim(), linename));
215   - } else if (StringUtils.isEmpty(lsStationRoutes.get(0).getStationCode())) {
216   - throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中没有站点编码", i + 1, cell_con.trim(), linename));
217   - }
  198 + p1.put("versions_eq", lineversion); // 带线路版本
  199 +
  200 + List<LsStationRoute> lsStationRoutes = (List<LsStationRoute>) stationRouteService.list_ls(p1);
  201 + if (CollectionUtils.isEmpty(lsStationRoutes)) {
  202 + throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中不是起点站", i + 1, cell_con.trim(), linename));
  203 + } else if (lsStationRoutes.size() > 1) {
  204 + throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中上下行都是起点站", i + 1, cell_con.trim(), linename));
  205 + } else if (StringUtils.isEmpty(lsStationRoutes.get(0).getStationCode())) {
  206 + throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中没有站点编码", i + 1, cell_con.trim(), linename));
218 207 }
219 208  
220   -
221 209 }
222 210  
223 211 }
... ...
src/main/java/com/bsth/service/schedule/impl/TTInfoServiceImpl.java
1 1 package com.bsth.service.schedule.impl;
2 2  
3   -import com.bsth.entity.LineVersions;
4 3 import com.bsth.entity.schedule.TTInfo;
5 4 import com.bsth.entity.schedule.TTInfoBackup;
6 5 import com.bsth.entity.schedule.TTInfoDetail;
7 6 import com.bsth.repository.schedule.TTInfoBackupRepository;
8 7 import com.bsth.repository.schedule.TTInfoDetailRepository;
9 8 import com.bsth.repository.schedule.TTInfoRepository;
10   -import com.bsth.service.LineVersionsService;
11 9 import com.bsth.service.schedule.TTInfoService;
12 10 import com.bsth.service.schedule.exception.ScheduleException;
13 11 import com.bsth.service.schedule.utils.TimeTableProto;
... ... @@ -24,6 +22,7 @@ import org.springframework.util.CollectionUtils;
24 22  
25 23 import java.io.PrintWriter;
26 24 import java.io.StringWriter;
  25 +import java.sql.Timestamp;
27 26 import java.util.*;
28 27  
29 28 /**
... ... @@ -40,8 +39,6 @@ public class TTInfoServiceImpl extends BServiceImpl&lt;TTInfo, Long&gt; implements TTI
40 39 private TTInfoDetailRepository ttInfoDetailRepository;
41 40 @Autowired
42 41 private TTInfoBackupRepository ttInfoBackupRepository;
43   - @Autowired
44   - private LineVersionsService lineVersionsService;
45 42  
46 43 @Override
47 44 public void validate_name(TTInfo ttInfo) throws ScheduleException {
... ... @@ -140,15 +137,18 @@ public class TTInfoServiceImpl extends BServiceImpl&lt;TTInfo, Long&gt; implements TTI
140 137  
141 138 @Override
142 139 public List<Map<String, Object>> getLineStationRouteVersions(Integer lineId) {
143   - // 获取线路版本
144   - List<LineVersions> lineVersionsList = lineVersionsService.findByLineCode(lineId);
  140 + // 获取线路版本数据
  141 + List<Map<String, Object>> lineVersionDescs = ttInfoRepository.findLineVersionDescs(lineId);
145 142 // 按照version版本降序排序
146   - Collections.sort(lineVersionsList, new Comparator<LineVersions>() {
  143 + Collections.sort(lineVersionDescs, new Comparator<Map<String, Object>>() {
147 144 @Override
148   - public int compare(LineVersions o1, LineVersions o2) {
149   - if (o1.getVersions() > o2.getVersions()) {
  145 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  146 + int o1_v = Integer.parseInt(o1.get("version").toString());
  147 + int o2_v = Integer.parseInt(o2.get("version").toString());
  148 +
  149 + if (o1_v > o2_v) {
150 150 return -1;
151   - } else if (o1.getVersions() < o2.getVersions()) {
  151 + } else if (o1_v < o2_v) {
152 152 return 1;
153 153 } else {
154 154 return 0;
... ... @@ -158,14 +158,19 @@ public class TTInfoServiceImpl extends BServiceImpl&lt;TTInfo, Long&gt; implements TTI
158 158  
159 159 // 取最开始的2条记录
160 160 List<Map<String, Object>> mapList = new ArrayList<>();
161   - for (LineVersions lv: lineVersionsList) {
162   - String vname = lv.getName();
163   - String rq = lv.getStartDate() == null ? "未知启用日期" : new DateTime(lv.getStartDate()).toString("YYYY年MM月dd日");
164   - String sdesc = lv.getStatus() == 0 ? "历史" : (lv.getStatus() == 1 ? "当前" : "待更新");
  161 + for (Map<String, Object> lv: lineVersionDescs) {
  162 + String t_name = (String) lv.get("name");
  163 + Timestamp t_sd = (Timestamp) lv.get("sd");
  164 + int status = Integer.parseInt(lv.get("status").toString());
  165 + int version = Integer.parseInt(lv.get("version").toString());
  166 +
  167 + String vname = t_name;
  168 + String rq = t_sd == null ? "未知启用日期" : new DateTime(t_sd).toString("YYYY年MM月dd日");
  169 + String sdesc = status == 0 ? "历史" : (status == 1 ? "当前" : "待更新");
165 170  
166 171 Map<String, Object> value = new HashMap<>();
167 172 value.put("desc", vname + "-" + rq + "-" + sdesc);
168   - value.put("version", lv.getVersions());
  173 + value.put("version", version);
169 174  
170 175 mapList.add(value);
171 176  
... ... @@ -180,28 +185,34 @@ public class TTInfoServiceImpl extends BServiceImpl&lt;TTInfo, Long&gt; implements TTI
180 185 @Override
181 186 public String getLineVersionDesc(Integer lineId, Integer version) {
182 187 // 查找指定版本,并判定
183   - Map<String, Object> param = new HashMap<>();
184   - param.put("line_eq", lineId);
185   - param.put("versions_eq", version);
186   - List<LineVersions> lineVersionsList = (List<LineVersions>) lineVersionsService.list(param);
  188 + List<Map<String, Object>> lineVersionDescs = ttInfoRepository.findLineVersionDescs2(lineId, version);
187 189  
188   - LineVersions lv;
189   - if (CollectionUtils.isEmpty(lineVersionsList)) {
  190 + Map<String, Object> lv;
  191 + if (CollectionUtils.isEmpty(lineVersionDescs)) {
190 192 return "未知版本";
191   - } else if (lineVersionsList.size() > 1) {
  193 + } else if (lineVersionDescs.size() > 1) {
192 194 return "重复版本";
193 195 } else {
194   - lv = lineVersionsList.get(0);
  196 + lv = lineVersionDescs.get(0);
195 197 }
196 198  
197   - String vname = lv.getName();
198   - String rq = lv.getStartDate() == null ? "未知启用日期" : new DateTime(lv.getStartDate()).toString("YYYY年MM月dd日");
199   - String sdesc = lv.getStatus() == 0 ? "历史" : (lv.getStatus() == 1 ? "当前" : "待更新");
  199 + String t_name = (String) lv.get("name");
  200 + Timestamp t_sd = (Timestamp) lv.get("sd");
  201 + int status = Integer.parseInt(lv.get("status").toString());
  202 +
  203 + String vname = t_name;
  204 + String rq = t_sd == null ? "未知启用日期" : new DateTime(t_sd).toString("YYYY年MM月dd日");
  205 + String sdesc = status == 0 ? "历史" : (status == 1 ? "当前" : "待更新");
200 206  
201 207 return String.format("%s-%s-%s", vname, rq, sdesc);
202 208 }
203 209  
204 210 @Override
  211 + public List<Map<String, Object>> getLineVersions(Integer lineId, Integer status) {
  212 + return ttInfoRepository.findLineVersionDescs3(lineId, status);
  213 + }
  214 +
  215 + @Override
205 216 @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.REPEATABLE_READ)
206 217 public void backUp(Long ttInfoId) throws ScheduleException {
207 218 LOG.info(">>>>>>开始备份时刻表<<<<<<");
... ...
src/main/java/com/bsth/service/schedule/utils/DataToolsProperties.java
... ... @@ -75,12 +75,12 @@ public class DataToolsProperties {
75 75 /** 时刻表明细信息导入 */
76 76 @NotNull
77 77 private String ttinfodetailDatainputktr;
78   - /** 时刻表明细信息导入 */
  78 + /** 时刻表明细信息导入2 */
79 79 @NotNull
80 80 private String ttinfodetailDatainputktr2;
81   - /** 时刻表明细信息导入 */
  81 + /** 时刻表明细信息导入2(带版本) */
82 82 @NotNull
83   - private String ttinfodetailDatainputktr2ls;
  83 + private String ttinfodetailDatainputktr2version;
84 84 /** 排班规则信息导入 */
85 85 @NotNull
86 86 private String scheduleruleDatainputktr;
... ... @@ -314,12 +314,12 @@ public class DataToolsProperties {
314 314 this.carsconfigDataoutputktr = carsconfigDataoutputktr;
315 315 }
316 316  
317   - public String getTtinfodetailDatainputktr2ls() {
318   - return ttinfodetailDatainputktr2ls;
  317 + public String getTtinfodetailDatainputktr2version() {
  318 + return ttinfodetailDatainputktr2version;
319 319 }
320 320  
321   - public void setTtinfodetailDatainputktr2ls(String ttinfodetailDatainputktr2ls) {
322   - this.ttinfodetailDatainputktr2ls = ttinfodetailDatainputktr2ls;
  321 + public void setTtinfodetailDatainputktr2version(String ttinfodetailDatainputktr2version) {
  322 + this.ttinfodetailDatainputktr2version = ttinfodetailDatainputktr2version;
323 323 }
324 324  
325 325 public String getEmployeesconfigDataoutputktr() {
... ...
src/main/resources/datatools/config-dev.properties
... ... @@ -39,8 +39,8 @@ datatools.ttinfodetail_foreditktr=/datatools/ktrs/ttinfodetailoutputforedit.ktr
39 39 datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr
40 40 # 时刻表明细信息导入2
41 41 datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr
42   -# 时刻表明细信息导入2_ls
43   -datatools.ttinfodetail_datainputktr2ls=/datatools/ktrs/ttinfodetailDataInput2_ls.ktr
  42 +# 时刻表明细信息导入2(版本化)
  43 +datatools.ttinfodetail_datainputktr2version=/datatools/ktrs/ttinfodetailDataInput2_version.ktr
44 44  
45 45 # 车辆配置信息导入
46 46 datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr
... ...
src/main/resources/datatools/config-prod.properties
... ... @@ -40,8 +40,8 @@ datatools.ttinfodetail_foreditktr=/datatools/ktrs/ttinfodetailoutputforedit.ktr
40 40 datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr
41 41 # 时刻表明细信息导入2
42 42 datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr
43   -# 时刻表明细信息导入2_ls
44   -datatools.ttinfodetail_datainputktr2ls=/datatools/ktrs/ttinfodetailDataInput2_ls.ktr
  43 +# 时刻表明细信息导入2(版本化)
  44 +datatools.ttinfodetail_datainputktr2version=/datatools/ktrs/ttinfodetailDataInput2_version.ktr
45 45  
46 46 # 车辆配置信息导入
47 47 datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInput2_ls.ktr renamed to src/main/resources/datatools/ktrs/ttinfodetailDataInput2_version.ktr
... ... @@ -416,6 +416,7 @@
416 416 <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 3</to><enabled>Y</enabled> </hop>
417 417 <hop> <from>&#x67e5;&#x627e;&#x8def;&#x724c;&#x5173;&#x8054;</from><to>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</to><enabled>Y</enabled> </hop>
418 418 <hop> <from>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</from><to>&#x8ba1;&#x7b97;&#x73ed;&#x6b21;&#x7c7b;&#x578b;</to><enabled>Y</enabled> </hop>
  419 + <hop> <from>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</from><to>&#x66f4;&#x65b0;&#x65f6;&#x523b;&#x8868;&#x4e3b;&#x8868;&#x7248;&#x672c;</to><enabled>Y</enabled> </hop>
419 420 </order>
420 421 <step>
421 422 <name>&#x4e0a;&#x4e0b;&#x884c;NULL&#x5224;&#x5b9a;</name>
... ... @@ -829,7 +830,7 @@
829 830 <optimizationLevel>9</optimizationLevel>
830 831 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
831 832 <jsScript_name>Script 1</jsScript_name>
832   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x53bb;&#x9664;&#x7ad9;&#x70b9;&#x540d;&#x79f0;&#x53f3;&#x4fa7;&#x591a;&#x4f59;&#x7684;&#x6570;&#x5b57;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;&#x28;&#x5c;d&#x2b;&#x24;&#x29;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;if &#x28;qdzname &#x21;&#x3d; &#x22;&#x51fa;&#x573a;&#x22; &#x26;&#x26; qdzname &#x21;&#x3d; &#x22;&#x8fdb;&#x573a;&#x22;&#x29; &#x7b;&#xa; qdzname &#x3d; qdzname &#x2b; &#x22;&#x25;&#x22;&#x3b; &#x2f;&#x2f; &#x6a21;&#x7cca;&#x5339;&#x914d;&#x6807;&#x8bc6;&#x7b26;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; sendtime&#x5904;&#x7406;&#xff0c;hhmm&#xff0c;hh&#x3a;mm&#xff0c;hh,mm&#xa;var sendtime_calcu &#x3d; sendtime.replace&#x28;&#x2f;&#x5c;s&#x2f;g, &#x22;&#x22;&#x29;&#x3b;&#xa;if &#x28;sendtime.length &#x3d;&#x3d; 5&#x29; &#x7b; &#x2f;&#x2f; &#x6700;&#x957f;&#x683c;&#x5f0f;&#xff0c;&#x5305;&#x62ec;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x7edf;&#x4e00;&#x628a;&#x5206;&#x9694;&#x7b26;&#x66ff;&#x6362;&#x6210;&#x5192;&#x53f7;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;3, 2&#x29;&#x3b;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; if &#x28;sendtime.indexOf&#x28;&#x22;&#x3a;&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5192;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x65e0;&#x9700;&#x4fee;&#x6539;&#xa; sendtime_calcu &#x3d; sendtime&#x3b;&#xa; &#x7d; else if &#x28;sendtime.indexOf&#x28;&#x22;,&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x9017;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d; else &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 3&#x29; &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;1, 2&#x29;&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5168;&#x90e8;&#x4fee;&#x6b63;&#x5b8c;&#x6bd5;&#x540e;&#xff0c;&#x5982;&#x679c;&#x957f;&#x5ea6;&#x4e0d;&#x662f;5&#xff0c;&#x524d;&#x9762;&#x8865;0&#xa;if &#x28;sendtime_calcu.length &#x21;&#x3d; 5&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; &#x22;0&#x22; &#x2b; sendtime_calcu&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x505c;&#x9a76;&#xa;var ists &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
  833 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x5982;&#x679c;&#x7ad9;&#x540d;&#x4e2d;&#x6709;&#x7c7b;&#x4f3c;-&#x3e;&#x7b;&#x6570;&#x5b57;&#x7d;&#xff0c;&#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x8fc7;&#x6ee4;&#x6389;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;-&#x3e;&#x5c;d&#x2b;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;if &#x28;qdzname &#x21;&#x3d; &#x22;&#x51fa;&#x573a;&#x22; &#x26;&#x26; qdzname &#x21;&#x3d; &#x22;&#x8fdb;&#x573a;&#x22;&#x29; &#x7b;&#xa; qdzname &#x3d; qdzname &#x2b; &#x22;&#x25;&#x22;&#x3b; &#x2f;&#x2f; &#x6a21;&#x7cca;&#x5339;&#x914d;&#x6807;&#x8bc6;&#x7b26;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; sendtime&#x5904;&#x7406;&#xff0c;hhmm&#xff0c;hh&#x3a;mm&#xff0c;hh,mm&#xa;var sendtime_calcu &#x3d; sendtime.replace&#x28;&#x2f;&#x5c;s&#x2f;g, &#x22;&#x22;&#x29;&#x3b;&#xa;if &#x28;sendtime.length &#x3d;&#x3d; 5&#x29; &#x7b; &#x2f;&#x2f; &#x6700;&#x957f;&#x683c;&#x5f0f;&#xff0c;&#x5305;&#x62ec;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x7edf;&#x4e00;&#x628a;&#x5206;&#x9694;&#x7b26;&#x66ff;&#x6362;&#x6210;&#x5192;&#x53f7;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;3, 2&#x29;&#x3b;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; if &#x28;sendtime.indexOf&#x28;&#x22;&#x3a;&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5192;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x65e0;&#x9700;&#x4fee;&#x6539;&#xa; sendtime_calcu &#x3d; sendtime&#x3b;&#xa; &#x7d; else if &#x28;sendtime.indexOf&#x28;&#x22;,&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x9017;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d; else &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 3&#x29; &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;1, 2&#x29;&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5168;&#x90e8;&#x4fee;&#x6b63;&#x5b8c;&#x6bd5;&#x540e;&#xff0c;&#x5982;&#x679c;&#x957f;&#x5ea6;&#x4e0d;&#x662f;5&#xff0c;&#x524d;&#x9762;&#x8865;0&#xa;if &#x28;sendtime_calcu.length &#x21;&#x3d; 5&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; &#x22;0&#x22; &#x2b; sendtime_calcu&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x505c;&#x9a76;&#xa;var ists &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
833 834 </jsScript> </jsScripts> <fields> <field> <name>qdzname</name>
834 835 <rename>qdzname</rename>
835 836 <type>String</type>
... ... @@ -1095,6 +1096,11 @@
1095 1096 <rename>ists</rename>
1096 1097 <update>Y</update>
1097 1098 </value>
  1099 + <value>
  1100 + <name>line_version</name>
  1101 + <rename>version</rename>
  1102 + <update>Y</update>
  1103 + </value>
1098 1104 </lookup>
1099 1105 <cluster_schema/>
1100 1106 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
... ... @@ -1241,6 +1247,11 @@
1241 1247 <rename>ists</rename>
1242 1248 <update>Y</update>
1243 1249 </value>
  1250 + <value>
  1251 + <name>line_version</name>
  1252 + <rename>version</rename>
  1253 + <update>Y</update>
  1254 + </value>
1244 1255 </lookup>
1245 1256 <cluster_schema/>
1246 1257 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
... ... @@ -1387,6 +1398,11 @@
1387 1398 <rename>ists</rename>
1388 1399 <update>Y</update>
1389 1400 </value>
  1401 + <value>
  1402 + <name>line_version</name>
  1403 + <rename>version</rename>
  1404 + <update>Y</update>
  1405 + </value>
1390 1406 </lookup>
1391 1407 <cluster_schema/>
1392 1408 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
... ... @@ -1465,6 +1481,45 @@
1465 1481 </step>
1466 1482  
1467 1483 <step>
  1484 + <name>&#x66f4;&#x65b0;&#x65f6;&#x523b;&#x8868;&#x4e3b;&#x8868;&#x7248;&#x672c;</name>
  1485 + <type>Update</type>
  1486 + <description/>
  1487 + <distribute>Y</distribute>
  1488 + <custom_distribution/>
  1489 + <copies>1</copies>
  1490 + <partitioning>
  1491 + <method>none</method>
  1492 + <schema_name/>
  1493 + </partitioning>
  1494 + <connection>bus_control_variable</connection>
  1495 + <skip_lookup>N</skip_lookup>
  1496 + <commit>100</commit>
  1497 + <use_batch>N</use_batch>
  1498 + <error_ignored>N</error_ignored>
  1499 + <ignore_flag_field/>
  1500 + <lookup>
  1501 + <schema/>
  1502 + <table>bsth_c_s_ttinfo</table>
  1503 + <key>
  1504 + <name>ttid</name>
  1505 + <field>id</field>
  1506 + <condition>&#x3d;</condition>
  1507 + <name2/>
  1508 + </key>
  1509 + <value>
  1510 + <name>line_version</name>
  1511 + <rename>version</rename>
  1512 + </value>
  1513 + </lookup>
  1514 + <cluster_schema/>
  1515 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1516 + <xloc>863</xloc>
  1517 + <yloc>338</yloc>
  1518 + <draw>Y</draw>
  1519 + </GUI>
  1520 + </step>
  1521 +
  1522 + <step>
1468 1523 <name>&#x67e5;&#x627e;&#x505c;&#x8f66;&#x573a;1</name>
1469 1524 <type>DBLookup</type>
1470 1525 <description/>
... ... @@ -2197,7 +2252,7 @@
2197 2252 <cluster_schema/>
2198 2253 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2199 2254 <xloc>1013</xloc>
2200   - <yloc>265</yloc>
  2255 + <yloc>221</yloc>
2201 2256 <draw>Y</draw>
2202 2257 </GUI>
2203 2258 </step>
... ... @@ -2733,6 +2788,41 @@
2733 2788 </step>
2734 2789  
2735 2790 <step>
  2791 + <name>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</name>
  2792 + <type>SelectValues</type>
  2793 + <description/>
  2794 + <distribute>N</distribute>
  2795 + <custom_distribution/>
  2796 + <copies>1</copies>
  2797 + <partitioning>
  2798 + <method>none</method>
  2799 + <schema_name/>
  2800 + </partitioning>
  2801 + <fields> <select_unspecified>Y</select_unspecified>
  2802 + <meta> <name>zdlyversion_</name>
  2803 + <rename>version</rename>
  2804 + <type>Integer</type>
  2805 + <length>-2</length>
  2806 + <precision>-2</precision>
  2807 + <conversion_mask/>
  2808 + <date_format_lenient>false</date_format_lenient>
  2809 + <date_format_locale/>
  2810 + <date_format_timezone/>
  2811 + <lenient_string_to_number>false</lenient_string_to_number>
  2812 + <encoding/>
  2813 + <decimal_symbol/>
  2814 + <grouping_symbol/>
  2815 + <currency_symbol/>
  2816 + <storage_type/>
  2817 + </meta> </fields> <cluster_schema/>
  2818 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2819 + <xloc>1016</xloc>
  2820 + <yloc>305</yloc>
  2821 + <draw>Y</draw>
  2822 + </GUI>
  2823 + </step>
  2824 +
  2825 + <step>
2736 2826 <name>&#x7c7b;&#x578b;&#x4fee;&#x6b63;</name>
2737 2827 <type>SelectValues</type>
2738 2828 <description/>
... ... @@ -3071,41 +3161,6 @@
3071 3161 </GUI>
3072 3162 </step>
3073 3163  
3074   - <step>
3075   - <name>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;&#x7c7b;&#x578b;</name>
3076   - <type>SelectValues</type>
3077   - <description/>
3078   - <distribute>Y</distribute>
3079   - <custom_distribution/>
3080   - <copies>1</copies>
3081   - <partitioning>
3082   - <method>none</method>
3083   - <schema_name/>
3084   - </partitioning>
3085   - <fields> <select_unspecified>Y</select_unspecified>
3086   - <meta> <name>zdlyversion_</name>
3087   - <rename>version</rename>
3088   - <type>Integer</type>
3089   - <length>-2</length>
3090   - <precision>-2</precision>
3091   - <conversion_mask/>
3092   - <date_format_lenient>false</date_format_lenient>
3093   - <date_format_locale/>
3094   - <date_format_timezone/>
3095   - <lenient_string_to_number>false</lenient_string_to_number>
3096   - <encoding/>
3097   - <decimal_symbol/>
3098   - <grouping_symbol/>
3099   - <currency_symbol/>
3100   - <storage_type/>
3101   - </meta> </fields> <cluster_schema/>
3102   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
3103   - <xloc>1015</xloc>
3104   - <yloc>333</yloc>
3105   - <draw>Y</draw>
3106   - </GUI>
3107   - </step>
3108   -
3109 3164 <step_error_handling>
3110 3165 <error>
3111 3166 <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail</source_step>
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInputMetaData.ktr
... ... @@ -35,6 +35,11 @@
35 35 <description>&#x7ebf;&#x8def;&#x6807;&#x51c6;id</description>
36 36 </parameter>
37 37 <parameter>
  38 + <name>lineversion</name>
  39 + <default_value>-1</default_value>
  40 + <description>&#x7ebf;&#x8def;&#x7248;&#x672c;</description>
  41 + </parameter>
  42 + <parameter>
38 43 <name>normalizefieldnames</name>
39 44 <default_value>&#x51fa;&#x573a;,&#x4e1c;&#x5ddd;&#x8def;&#x5730;&#x94c1;&#x7ad9;1,&#x5858;&#x6cfe;&#x8def;&#x5c1a;&#x4e49;&#x8def;1,&#x4e1c;&#x5ddd;&#x8def;&#x5730;&#x94c1;&#x7ad9;2,&#x5858;&#x6cfe;&#x8def;&#x5c1a;&#x4e49;&#x8def;2,&#x4e1c;&#x5ddd;&#x8def;&#x5730;&#x94c1;&#x7ad9;3,&#x5858;&#x6cfe;&#x8def;&#x5c1a;&#x4e49;&#x8def;3,&#x4e1c;&#x5ddd;&#x8def;&#x5730;&#x94c1;&#x7ad9;4,&#x5858;&#x6cfe;&#x8def;&#x5c1a;&#x4e49;&#x8def;4,&#x4e1c;&#x5ddd;&#x8def;&#x5730;&#x94c1;&#x7ad9;5,&#x5858;&#x6cfe;&#x8def;&#x5c1a;&#x4e49;&#x8def;5,&#x4e1c;&#x5ddd;&#x8def;&#x5730;&#x94c1;&#x7ad9;6,&#x5858;&#x6cfe;&#x8def;&#x5c1a;&#x4e49;&#x8def;6,&#x4e1c;&#x5ddd;&#x8def;&#x5730;&#x94c1;&#x7ad9;7,&#x5858;&#x6cfe;&#x8def;&#x5c1a;&#x4e49;&#x8def;7,&#x4e1c;&#x5ddd;&#x8def;&#x5730;&#x94c1;&#x7ad9;8,&#x5858;&#x6cfe;&#x8def;&#x5c1a;&#x4e49;&#x8def;8,&#x4e1c;&#x5ddd;&#x8def;&#x5730;&#x94c1;&#x7ad9;9,&#x5858;&#x6cfe;&#x8def;&#x5c1a;&#x4e49;&#x8def;9,&#x4e1c;&#x5ddd;&#x8def;&#x5730;&#x94c1;&#x7ad9;10,&#x5858;&#x6cfe;&#x8def;&#x5c1a;&#x4e49;&#x8def;10,&#x8fdb;&#x573a;</default_value>
40 45 <description>&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;&#x5b57;&#x6bb5;&#x540d;&#xff0c;&#x4ee5;&#x9017;&#x53f7;&#x8fde;&#x63a5;</description>
... ... @@ -62,18 +67,13 @@
62 67 <parameter>
63 68 <name>xlid</name>
64 69 <default_value>-999</default_value>
65   - <description/>
  70 + <description>&#x7ebf;&#x8def;id</description>
66 71 </parameter>
67 72 <parameter>
68 73 <name>xlname</name>
69 74 <default_value>&#x95f5;&#x884c;26&#x8def;</default_value>
70 75 <description>&#x7ebf;&#x8def;&#x540d;&#x79f0;</description>
71 76 </parameter>
72   - <parameter>
73   - <name>zdlyversion</name>
74   - <default_value>-1</default_value>
75   - <description/>
76   - </parameter>
77 77 </parameters>
78 78 <log>
79 79 <trans-log-table><connection/>
... ... @@ -436,15 +436,15 @@
436 436 <source_step>&#x589e;&#x52a0;normalize&#x5143;&#x6570;&#x636e;</source_step>
437 437 <source_field>nfieldname</source_field>
438 438 </mapping> <mapping> <target_step_name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</target_step_name>
439   - <target_attribute_key>LENGTH</target_attribute_key>
440   - <target_detail>Y</target_detail>
441   - <source_step>&#x589e;&#x52a0;excel&#x5b57;&#x6bb5;&#x5176;&#x4ed6;&#x5143;&#x6570;&#x636e;</source_step>
442   - <source_field>length</source_field>
443   - </mapping> <mapping> <target_step_name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</target_step_name>
444 439 <target_attribute_key>SHEET_NAME</target_attribute_key>
445 440 <target_detail>Y</target_detail>
446 441 <source_step>&#x83b7;&#x53d6;excel&#x6587;&#x4ef6;&#x540d;</source_step>
447 442 <source_field>sheetname_</source_field>
  443 + </mapping> <mapping> <target_step_name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</target_step_name>
  444 + <target_attribute_key>LENGTH</target_attribute_key>
  445 + <target_detail>Y</target_detail>
  446 + <source_step>&#x589e;&#x52a0;excel&#x5b57;&#x6bb5;&#x5176;&#x4ed6;&#x5143;&#x6570;&#x636e;</source_step>
  447 + <source_field>length</source_field>
448 448 </mapping> <mapping> <target_step_name>&#x589e;&#x52a0;&#x65f6;&#x523b;&#x8868;&#x540d;&#x5b57;&#xff0c;&#x7ebf;&#x8def;&#x540d;&#x5b57;&#xff0c;&#x505c;&#x8f66;&#x573a;&#x540d;&#x5b57;</target_step_name>
449 449 <target_attribute_key>NAME</target_attribute_key>
450 450 <target_detail>Y</target_detail>
... ... @@ -460,41 +460,41 @@
460 460 <target_detail>Y</target_detail>
461 461 <source_step>&#x5217;&#x62c6;&#x5206;&#x4e3a;&#x591a;&#x884c;</source_step>
462 462 <source_field>fieldName</source_field>
463   - </mapping> <mapping> <target_step_name>&#x884c;&#x8f6c;&#x5217;</target_step_name>
464   - <target_attribute_key>VALUE</target_attribute_key>
465   - <target_detail>Y</target_detail>
466   - <source_step>&#x5217;&#x62c6;&#x5206;&#x4e3a;&#x591a;&#x884c; 2</source_step>
467   - <source_field>fieldName</source_field>
468 463 </mapping> <mapping> <target_step_name>Excel&#x8f93;&#x5165;</target_step_name>
469 464 <target_attribute_key>TRIM_TYPE</target_attribute_key>
470 465 <target_detail>Y</target_detail>
471 466 <source_step>&#x5217;&#x62c6;&#x5206;&#x4e3a;&#x591a;&#x884c;</source_step>
472 467 <source_field>trim_type</source_field>
473 468 </mapping> <mapping> <target_step_name>&#x884c;&#x8f6c;&#x5217;</target_step_name>
474   - <target_attribute_key>NORMALISED</target_attribute_key>
  469 + <target_attribute_key>VALUE</target_attribute_key>
475 470 <target_detail>Y</target_detail>
476 471 <source_step>&#x5217;&#x62c6;&#x5206;&#x4e3a;&#x591a;&#x884c; 2</source_step>
477   - <source_field>value</source_field>
  472 + <source_field>fieldName</source_field>
478 473 </mapping> <mapping> <target_step_name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</target_step_name>
479 474 <target_attribute_key>REPEAT</target_attribute_key>
480 475 <target_detail>Y</target_detail>
481 476 <source_step>&#x589e;&#x52a0;excel&#x5b57;&#x6bb5;&#x5176;&#x4ed6;&#x5143;&#x6570;&#x636e;</source_step>
482 477 <source_field>repeat</source_field>
483   - </mapping> <mapping> <target_step_name>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</target_step_name>
  478 + </mapping> <mapping> <target_step_name>&#x884c;&#x8f6c;&#x5217;</target_step_name>
484 479 <target_attribute_key>NORMALISED</target_attribute_key>
485 480 <target_detail>Y</target_detail>
486   - <source_step>&#x589e;&#x52a0;normalize&#x5143;&#x6570;&#x636e;</source_step>
487   - <source_field>valuefield</source_field>
  481 + <source_step>&#x5217;&#x62c6;&#x5206;&#x4e3a;&#x591a;&#x884c; 2</source_step>
  482 + <source_field>value</source_field>
488 483 </mapping> <mapping> <target_step_name>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</target_step_name>
489   - <target_attribute_key>VALUE</target_attribute_key>
  484 + <target_attribute_key>NORMALISED</target_attribute_key>
490 485 <target_detail>Y</target_detail>
491 486 <source_step>&#x589e;&#x52a0;normalize&#x5143;&#x6570;&#x636e;</source_step>
492   - <source_field>nfieldname</source_field>
  487 + <source_field>valuefield</source_field>
493 488 </mapping> <mapping> <target_step_name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</target_step_name>
494 489 <target_attribute_key>FORMAT</target_attribute_key>
495 490 <target_detail>Y</target_detail>
496 491 <source_step>&#x589e;&#x52a0;excel&#x5b57;&#x6bb5;&#x5176;&#x4ed6;&#x5143;&#x6570;&#x636e;</source_step>
497 492 <source_field>format</source_field>
  493 + </mapping> <mapping> <target_step_name>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</target_step_name>
  494 + <target_attribute_key>VALUE</target_attribute_key>
  495 + <target_detail>Y</target_detail>
  496 + <source_step>&#x589e;&#x52a0;normalize&#x5143;&#x6570;&#x636e;</source_step>
  497 + <source_field>nfieldname</source_field>
498 498 </mapping> <mapping> <target_step_name>Excel&#x8f93;&#x5165;</target_step_name>
499 499 <target_attribute_key>PRECISION</target_attribute_key>
500 500 <target_detail>Y</target_detail>
... ... @@ -917,6 +917,63 @@
917 917 </step>
918 918  
919 919 <step>
  920 + <name>&#x589e;&#x52a0;&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c; metadata</name>
  921 + <type>Constant</type>
  922 + <description/>
  923 + <distribute>Y</distribute>
  924 + <custom_distribution/>
  925 + <copies>1</copies>
  926 + <partitioning>
  927 + <method>none</method>
  928 + <schema_name/>
  929 + </partitioning>
  930 + <fields>
  931 + <field>
  932 + <name>col_name</name>
  933 + <type>String</type>
  934 + <format/>
  935 + <currency/>
  936 + <decimal/>
  937 + <group/>
  938 + <nullif>zdlyversion_</nullif>
  939 + <length>-1</length>
  940 + <precision>-1</precision>
  941 + <set_empty_string>N</set_empty_string>
  942 + </field>
  943 + <field>
  944 + <name>col_type</name>
  945 + <type>String</type>
  946 + <format/>
  947 + <currency/>
  948 + <decimal/>
  949 + <group/>
  950 + <nullif>String</nullif>
  951 + <length>-1</length>
  952 + <precision>-1</precision>
  953 + <set_empty_string>N</set_empty_string>
  954 + </field>
  955 + <field>
  956 + <name>col_value</name>
  957 + <type>String</type>
  958 + <format/>
  959 + <currency/>
  960 + <decimal/>
  961 + <group/>
  962 + <nullif>replace</nullif>
  963 + <length>-1</length>
  964 + <precision>-1</precision>
  965 + <set_empty_string>N</set_empty_string>
  966 + </field>
  967 + </fields>
  968 + <cluster_schema/>
  969 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  970 + <xloc>390</xloc>
  971 + <yloc>532</yloc>
  972 + <draw>Y</draw>
  973 + </GUI>
  974 + </step>
  975 +
  976 + <step>
920 977 <name>&#x589e;&#x52a0;&#x7ebf;&#x8def;&#x540d;&#x79f0;metadata</name>
921 978 <type>Constant</type>
922 979 <description/>
... ... @@ -1056,6 +1113,31 @@
1056 1113 </step>
1057 1114  
1058 1115 <step>
  1116 + <name>&#x66ff;&#x6362;&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;</name>
  1117 + <type>SetValueField</type>
  1118 + <description/>
  1119 + <distribute>Y</distribute>
  1120 + <custom_distribution/>
  1121 + <copies>1</copies>
  1122 + <partitioning>
  1123 + <method>none</method>
  1124 + <schema_name/>
  1125 + </partitioning>
  1126 + <fields>
  1127 + <field>
  1128 + <name>col_value</name>
  1129 + <replaceby>zdlyversion_</replaceby>
  1130 + </field>
  1131 + </fields>
  1132 + <cluster_schema/>
  1133 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1134 + <xloc>594</xloc>
  1135 + <yloc>532</yloc>
  1136 + <draw>Y</draw>
  1137 + </GUI>
  1138 + </step>
  1139 +
  1140 + <step>
1059 1141 <name>&#x66ff;&#x6362;&#x7ebf;&#x8def;&#x540d;&#x79f0;</name>
1060 1142 <type>SetValueField</type>
1061 1143 <description/>
... ... @@ -1081,6 +1163,38 @@
1081 1163 </step>
1082 1164  
1083 1165 <step>
  1166 + <name>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;metadata&#x5b57;&#x6bb5;</name>
  1167 + <type>SelectValues</type>
  1168 + <description/>
  1169 + <distribute>Y</distribute>
  1170 + <custom_distribution/>
  1171 + <copies>1</copies>
  1172 + <partitioning>
  1173 + <method>none</method>
  1174 + <schema_name/>
  1175 + </partitioning>
  1176 + <fields> <field> <name>col_name</name>
  1177 + <rename/>
  1178 + <length>-2</length>
  1179 + <precision>-2</precision>
  1180 + </field> <field> <name>col_type</name>
  1181 + <rename/>
  1182 + <length>-2</length>
  1183 + <precision>-2</precision>
  1184 + </field> <field> <name>col_value</name>
  1185 + <rename/>
  1186 + <length>-2</length>
  1187 + <precision>-2</precision>
  1188 + </field> <select_unspecified>N</select_unspecified>
  1189 + </fields> <cluster_schema/>
  1190 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1191 + <xloc>741</xloc>
  1192 + <yloc>533</yloc>
  1193 + <draw>Y</draw>
  1194 + </GUI>
  1195 + </step>
  1196 +
  1197 + <step>
1084 1198 <name>&#x7ebf;&#x8def;&#x540d;&#x79f0;metadata&#x5b57;&#x6bb5;</name>
1085 1199 <type>SelectValues</type>
1086 1200 <description/>
... ... @@ -1302,6 +1416,39 @@
1302 1416 </step>
1303 1417  
1304 1418 <step>
  1419 + <name>&#x83b7;&#x53d6;&#x7ad9;&#x70b9;&#x8def;&#x7531;version</name>
  1420 + <type>GetVariable</type>
  1421 + <description/>
  1422 + <distribute>Y</distribute>
  1423 + <custom_distribution/>
  1424 + <copies>1</copies>
  1425 + <partitioning>
  1426 + <method>none</method>
  1427 + <schema_name/>
  1428 + </partitioning>
  1429 + <fields>
  1430 + <field>
  1431 + <name>zdlyversion_</name>
  1432 + <variable>&#x24;&#x7b;lineversion&#x7d;</variable>
  1433 + <type>String</type>
  1434 + <format/>
  1435 + <currency/>
  1436 + <decimal/>
  1437 + <group/>
  1438 + <length>-1</length>
  1439 + <precision>-1</precision>
  1440 + <trim_type>none</trim_type>
  1441 + </field>
  1442 + </fields>
  1443 + <cluster_schema/>
  1444 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  1445 + <xloc>187</xloc>
  1446 + <yloc>534</yloc>
  1447 + <draw>Y</draw>
  1448 + </GUI>
  1449 + </step>
  1450 +
  1451 + <step>
1305 1452 <name>&#x83b7;&#x53d6;&#x7ebf;&#x8def;&#x540d;&#x79f0;</name>
1306 1453 <type>GetVariable</type>
1307 1454 <description/>
... ... @@ -1419,153 +1566,6 @@
1419 1566 </GUI>
1420 1567 </step>
1421 1568  
1422   - <step>
1423   - <name>&#x589e;&#x52a0;&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c; metadata</name>
1424   - <type>Constant</type>
1425   - <description/>
1426   - <distribute>Y</distribute>
1427   - <custom_distribution/>
1428   - <copies>1</copies>
1429   - <partitioning>
1430   - <method>none</method>
1431   - <schema_name/>
1432   - </partitioning>
1433   - <fields>
1434   - <field>
1435   - <name>col_name</name>
1436   - <type>String</type>
1437   - <format/>
1438   - <currency/>
1439   - <decimal/>
1440   - <group/>
1441   - <nullif>zdlyversion_</nullif>
1442   - <length>-1</length>
1443   - <precision>-1</precision>
1444   - <set_empty_string>N</set_empty_string>
1445   - </field>
1446   - <field>
1447   - <name>col_type</name>
1448   - <type>String</type>
1449   - <format/>
1450   - <currency/>
1451   - <decimal/>
1452   - <group/>
1453   - <nullif>String</nullif>
1454   - <length>-1</length>
1455   - <precision>-1</precision>
1456   - <set_empty_string>N</set_empty_string>
1457   - </field>
1458   - <field>
1459   - <name>col_value</name>
1460   - <type>String</type>
1461   - <format/>
1462   - <currency/>
1463   - <decimal/>
1464   - <group/>
1465   - <nullif>replace</nullif>
1466   - <length>-1</length>
1467   - <precision>-1</precision>
1468   - <set_empty_string>N</set_empty_string>
1469   - </field>
1470   - </fields>
1471   - <cluster_schema/>
1472   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1473   - <xloc>390</xloc>
1474   - <yloc>532</yloc>
1475   - <draw>Y</draw>
1476   - </GUI>
1477   - </step>
1478   -
1479   - <step>
1480   - <name>&#x66ff;&#x6362;&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;</name>
1481   - <type>SetValueField</type>
1482   - <description/>
1483   - <distribute>Y</distribute>
1484   - <custom_distribution/>
1485   - <copies>1</copies>
1486   - <partitioning>
1487   - <method>none</method>
1488   - <schema_name/>
1489   - </partitioning>
1490   - <fields>
1491   - <field>
1492   - <name>col_value</name>
1493   - <replaceby>zdlyversion_</replaceby>
1494   - </field>
1495   - </fields>
1496   - <cluster_schema/>
1497   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1498   - <xloc>594</xloc>
1499   - <yloc>532</yloc>
1500   - <draw>Y</draw>
1501   - </GUI>
1502   - </step>
1503   -
1504   - <step>
1505   - <name>&#x7ad9;&#x70b9;&#x8def;&#x7531;&#x7248;&#x672c;metadata&#x5b57;&#x6bb5;</name>
1506   - <type>SelectValues</type>
1507   - <description/>
1508   - <distribute>Y</distribute>
1509   - <custom_distribution/>
1510   - <copies>1</copies>
1511   - <partitioning>
1512   - <method>none</method>
1513   - <schema_name/>
1514   - </partitioning>
1515   - <fields> <field> <name>col_name</name>
1516   - <rename/>
1517   - <length>-2</length>
1518   - <precision>-2</precision>
1519   - </field> <field> <name>col_type</name>
1520   - <rename/>
1521   - <length>-2</length>
1522   - <precision>-2</precision>
1523   - </field> <field> <name>col_value</name>
1524   - <rename/>
1525   - <length>-2</length>
1526   - <precision>-2</precision>
1527   - </field> <select_unspecified>N</select_unspecified>
1528   - </fields> <cluster_schema/>
1529   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1530   - <xloc>741</xloc>
1531   - <yloc>533</yloc>
1532   - <draw>Y</draw>
1533   - </GUI>
1534   - </step>
1535   -
1536   - <step>
1537   - <name>&#x83b7;&#x53d6;&#x7ad9;&#x70b9;&#x8def;&#x7531;version</name>
1538   - <type>GetVariable</type>
1539   - <description/>
1540   - <distribute>Y</distribute>
1541   - <custom_distribution/>
1542   - <copies>1</copies>
1543   - <partitioning>
1544   - <method>none</method>
1545   - <schema_name/>
1546   - </partitioning>
1547   - <fields>
1548   - <field>
1549   - <name>zdlyversion_</name>
1550   - <variable>&#x24;&#x7b;zdlyversion&#x7d;</variable>
1551   - <type>String</type>
1552   - <format/>
1553   - <currency/>
1554   - <decimal/>
1555   - <group/>
1556   - <length>-1</length>
1557   - <precision>-1</precision>
1558   - <trim_type>none</trim_type>
1559   - </field>
1560   - </fields>
1561   - <cluster_schema/>
1562   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1563   - <xloc>187</xloc>
1564   - <yloc>534</yloc>
1565   - <draw>Y</draw>
1566   - </GUI>
1567   - </step>
1568   -
1569 1569 <step_error_handling>
1570 1570 </step_error_handling>
1571 1571 <slave-step-copy-partition-distribution>
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr
... ... @@ -16,7 +16,7 @@
16 16 </parameter>
17 17 <parameter>
18 18 <name>injectktrfile</name>
19   - <default_value>&#x2f;Users&#x2f;xu&#x2f;resource&#x2f;project_code&#x2f;bsth_project&#x2f;bsth_control&#x2f;src&#x2f;main&#x2f;resources&#x2f;datatools&#x2f;ktrs&#x2f;ttinfodetailDataOutput.ktr</default_value>
  19 + <default_value>&#x2f;Users&#x2f;xu&#x2f;resource&#x2f;project_code&#x2f;bsth_project&#x2f;bsth_control_parent&#x2f;bsth_control&#x2f;src&#x2f;main&#x2f;resources&#x2f;datatools&#x2f;ktrs&#x2f;ttinfodetailDataOutput.ktr</default_value>
20 20 <description>&#x6ce8;&#x5165;&#x5143;&#x6570;&#x636e;&#x7684;ktr&#x6587;&#x4ef6;</description>
21 21 </parameter>
22 22 <parameter>
... ... @@ -91,8 +91,8 @@
91 91 <notepads>
92 92 <notepad>
93 93 <note>TODO&#xff1a;&#x5982;&#x679c;groupby &#x52a0;&#x5165;bctype&#xff0c;&#xa;&#x5219;&#x4ee5;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;&#xff0c;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5206;&#x7ec4;&#x7684;&#x6570;&#x636e;&#x53ef;&#x80fd;&#x91cd;&#x590d;&#xff0c;&#xa;&#x5e94;&#x4e3a;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x53ef;&#x80fd;&#x4e0d;&#x4e00;&#x6837;&#xff08;&#x5bfc;&#x5165;&#x4e4b;&#x540e;&#x4eba;&#x4e3a;&#x4fee;&#x6539;&#x7684;&#xff0c;&#x5982;&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6539;&#x6210;&#x533a;&#x95f4;&#xff09;&#xff0c;&#xa;&#x56e0;&#x4e3a;&#x5bfc;&#x51fa;&#x65f6;&#x5fc5;&#x987b;&#x6570;&#x636e;&#x4e0d;&#x91cd;&#x590d;&#xff0c;&#x8fd9;&#x91cc;&#x7684;&#x89e3;&#x51b3;&#x65b9;&#x6cd5;&#xff0c;&#x53ea;&#x4f7f;&#x7528;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;&#x5206;&#x7ec4;&#xff0c;&#xa;&#x4ee5;&#x540e;&#x5efa;&#x8bae;&#xff0c;&#x8fd8;&#x662f;&#x539f;&#x6765;&#x7684;&#x65b9;&#x5f0f;&#x5206;&#x7ec4;&#xff0c;&#x7136;&#x540e;&#x628a;&#x66f4;&#x65b0;&#x65f6;&#x95f4;&#x665a;&#x7684;&#x53bb;&#x9664;&#xa;&#xa;&#x4ee5;&#x540e;&#x6539;&#x6210;&#x53bb;&#x9664;&#x91cd;&#x590d;&#x7eaa;&#x5f55;</note>
94   - <xloc>37</xloc>
95   - <yloc>309</yloc>
  94 + <xloc>46</xloc>
  95 + <yloc>400</yloc>
96 96 <width>406</width>
97 97 <heigth>122</heigth>
98 98 <fontname>YaHei Consolas Hybrid</fontname>
... ... @@ -368,6 +368,29 @@
368 368 </step>
369 369  
370 370 <step>
  371 + <name>&#x53bb;&#x9664;&#x91cd;&#x590d;&#x8bb0;&#x5f55;</name>
  372 + <type>Unique</type>
  373 + <description/>
  374 + <distribute>Y</distribute>
  375 + <custom_distribution/>
  376 + <copies>1</copies>
  377 + <partitioning>
  378 + <method>none</method>
  379 + <schema_name/>
  380 + </partitioning>
  381 + <count_rows>N</count_rows>
  382 + <count_field/>
  383 + <reject_duplicate_row>N</reject_duplicate_row>
  384 + <error_description/>
  385 + <fields> </fields> <cluster_schema/>
  386 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  387 + <xloc>842</xloc>
  388 + <yloc>592</yloc>
  389 + <draw>Y</draw>
  390 + </GUI>
  391 + </step>
  392 +
  393 + <step>
371 394 <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
372 395 <type>SelectValues</type>
373 396 <description/>
... ... @@ -590,7 +613,7 @@
590 613 <optimizationLevel>9</optimizationLevel>
591 614 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
592 615 <jsScript_name>Script 1</jsScript_name>
593   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var fieldname&#x3b; &#x2f;&#x2f; &#x5b57;&#x6bb5;&#x540d;&#xa;var fieldtype&#x3b; &#x2f;&#x2f; &#x5b57;&#x6bb5;&#x7c7b;&#x578b;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; &#x27;&#x8fdb;&#x573a;&#x27; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; &#x27;&#x51fa;&#x573a;&#x27; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; zdname &#x2b; fcno&#x3b;&#xa;&#x7d; else &#x7b;&#xa; fieldname &#x3d; zdname &#x2b; fcno&#x3b;&#xa;&#x7d; &#xa;&#xa;fieldtype &#x3d; &#x27;String&#x27;&#x3b;&#xa;</jsScript_script>
  616 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var fieldname&#x3b; &#x2f;&#x2f; &#x5b57;&#x6bb5;&#x540d;&#xa;var fieldtype&#x3b; &#x2f;&#x2f; &#x5b57;&#x6bb5;&#x7c7b;&#x578b;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; &#x27;&#x8fdb;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; &#x27;&#x51fa;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else &#x7b;&#xa; fieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; &#xa;&#xa;fieldtype &#x3d; &#x27;String&#x27;&#x3b;&#xa;</jsScript_script>
594 617 </jsScript> </jsScripts> <fields> <field> <name>fieldname</name>
595 618 <rename>fieldname</rename>
596 619 <type>String</type>
... ... @@ -626,7 +649,7 @@
626 649 <optimizationLevel>9</optimizationLevel>
627 650 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
628 651 <jsScript_name>Script 1</jsScript_name>
629   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var targetfieldname&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x5b57;&#x6bb5;&#x540d;&#xa;var targettype&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x7c7b;&#x578b;&#xa;var valuefieldname&#x3b; &#x2f;&#x2f; &#x503c;&#x5b57;&#x6bb5;&#x540d;&#xa;var keyvalue&#x3b; &#x2f;&#x2f; &#x5173;&#x952e;&#x5b57;&#x503c;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x8fdb;&#x573a;&#x27; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x51fa;&#x573a;&#x27; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; fcno&#x3b;&#xa;&#x7d; else &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; fcno&#x3b;&#xa;&#x7d; &#xa;&#xa;targettype &#x3d; &#x27;String&#x27;&#x3b;&#xa;valuefieldname &#x3d; &#x27;fcsj&#x27;&#x3b;&#xa;keyvalue &#x3d; fcno&#x3b;&#xa;</jsScript_script>
  652 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var targetfieldname&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x5b57;&#x6bb5;&#x540d;&#xa;var targettype&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x7c7b;&#x578b;&#xa;var valuefieldname&#x3b; &#x2f;&#x2f; &#x503c;&#x5b57;&#x6bb5;&#x540d;&#xa;var keyvalue&#x3b; &#x2f;&#x2f; &#x5173;&#x952e;&#x5b57;&#x503c;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x8fdb;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x51fa;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; &#xa;&#xa;targettype &#x3d; &#x27;String&#x27;&#x3b;&#xa;valuefieldname &#x3d; &#x27;fcsj&#x27;&#x3b;&#xa;keyvalue &#x3d; fcno&#x3b;&#xa;</jsScript_script>
630 653 </jsScript> </jsScripts> <fields> <field> <name>targetfieldname</name>
631 654 <rename>targetfieldname</rename>
632 655 <type>String</type>
... ... @@ -718,29 +741,6 @@
718 741 </GUI>
719 742 </step>
720 743  
721   - <step>
722   - <name>&#x53bb;&#x9664;&#x91cd;&#x590d;&#x8bb0;&#x5f55;</name>
723   - <type>Unique</type>
724   - <description/>
725   - <distribute>Y</distribute>
726   - <custom_distribution/>
727   - <copies>1</copies>
728   - <partitioning>
729   - <method>none</method>
730   - <schema_name/>
731   - </partitioning>
732   - <count_rows>N</count_rows>
733   - <count_field/>
734   - <reject_duplicate_row>N</reject_duplicate_row>
735   - <error_description/>
736   - <fields> </fields> <cluster_schema/>
737   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
738   - <xloc>842</xloc>
739   - <yloc>592</yloc>
740   - <draw>Y</draw>
741   - </GUI>
742   - </step>
743   -
744 744 <step_error_handling>
745 745 </step_error_handling>
746 746 <slave-step-copy-partition-distribution>
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
... ... @@ -75,11 +75,11 @@
75 75 </table>
76 76 </div>
77 77 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  78 + <input class="btn btn-default hidden" type="button" id="exportMap" value="导出明细" style="float: right;"/>
78 79 <table class="table table-bordered table-hover table-checkable" id="map">
79 80 <thead>
80 81 <tr class="hidden">
81   - <th style="display: none;"></th>
82   - <th rowspan="2">日期</th>
  82 + <th rowspan="2" align="center">日期</th>
83 83 <th rowspan="2">线路</th>
84 84 <th colspan="4">上行首发</th>
85 85 <th colspan="4">上行末发</th>
... ... @@ -87,8 +87,7 @@
87 87 <th colspan="4">下行末发</th>
88 88 </tr>
89 89 <tr class="hidden">
90   - <th style="display: none;"></th>
91   - <th>站点</th>
  90 + <th align="center">站点</th>
92 91 <th>计发</th>
93 92 <th>实发</th>
94 93 <th>快慢</th>
... ... @@ -110,12 +109,33 @@
110 109  
111 110 </tbody>
112 111 </table>
  112 +
  113 + <input class="btn btn-default hidden" type="button" id="exportSumMap" value="导出明细" style="float: right;"/>
  114 + <table class="table table-bordered table-hover table-checkable" id="sumMap">
  115 + <thead>
  116 + <tr class="hidden">
  117 + <th align="center">序号</th>
  118 + <th>日期</th>
  119 + <th>分公司</th>
  120 + <th>线路</th>
  121 + <th>首末班次</th>
  122 + <th>计发</th>
  123 + <th>实发</th>
  124 + <th>误差</th>
  125 + <th>调度路单备注</th>
  126 + </tr>
  127 + </thead>
  128 + <tbody>
  129 +
  130 + </tbody>
  131 + </table>
113 132 </div>
114 133 </div>
115 134 </div>
116 135 </div>
117 136 </div>
118 137  
  138 +<script type="text/javascript" src="js/jquery.table2excel.min.js"></script>
119 139 <script>
120 140 $(function(){
121 141 $('#export').attr('disabled', "true");
... ... @@ -124,12 +144,9 @@
124 144 if (!$('body').hasClass('page-sidebar-closed'))
125 145 $('.menu-toggler.sidebar-toggler').click();
126 146  
127   - $("#startDate,#endDate").datetimepicker({
128   - format : 'YYYY-MM-DD',
129   - locale : 'zh-cn'
130   - });
131 147  
132 148 var d = new Date();
  149 + d.setTime(d.getTime() - 1*1000*60*60*24);
133 150 var year = d.getFullYear();
134 151 var month = d.getMonth() + 1;
135 152 var day = d.getDate();
... ... @@ -137,7 +154,13 @@
137 154 month = "0" + month;
138 155 if(day < 10)
139 156 day = "0" + day;
140   - $("#startDate,#endDate").val(year + "-" + month + "-" + day);
  157 + var dateTime = year + "-" + month + "-" + day;
  158 + $("#startDate,#endDate").datetimepicker({
  159 + format : 'YYYY-MM-DD',
  160 + locale : 'zh-cn',
  161 + maxDate : dateTime
  162 + });
  163 + $("#startDate,#endDate").val(dateTime);
141 164  
142 165 var fage=false;
143 166 var xlList;
... ... @@ -218,14 +241,32 @@
218 241 var list;
219 242 $("#forms tbody").on("click","a",function(){
220 243 var index = $(this).parent().parent().index();
221   - $.each(list, function(i, g){
222   - if(index == i){
223   - var tbodyHtml = template('list_maps',{list:g.map});
224   - $('#map tbody').html(tbodyHtml);
225   - $("#map .hidden").removeClass("hidden");
226   - $("html,body").animate({scrollTop:$("#map").offset().top},1000);
227   - }
228   - });
  244 + if(index < list.length - 1){
  245 + $.each(list, function(i, g){
  246 + if(index == i){
  247 + var tbodyHtml = template('list_maps',{list:g.map});
  248 + $('#map tbody').html(tbodyHtml);
  249 + $("#sumMap tr").addClass("hidden");
  250 + $("#exportSumMap").addClass("hidden");
  251 + $("#map .hidden").removeClass("hidden");
  252 + $("#exportMap").removeClass("hidden");
  253 + $("html,body").animate({scrollTop:$("#map").offset().top},1000);
  254 + }
  255 + });
  256 + } else {
  257 + var tempList = [];
  258 + $.each(list, function(i, g){
  259 + if(index == i){
  260 + var tbodyHtml = template('list_sumMaps',{list:g.map});
  261 + $('#sumMap tbody').html(tbodyHtml);
  262 + $("#map tr").addClass("hidden");
  263 + $("#exportMap").addClass("hidden");
  264 + $("#sumMap .hidden").removeClass("hidden");
  265 + $("#exportSumMap").removeClass("hidden");
  266 + $("html,body").animate({scrollTop:$("#sumMap").offset().top},1000);
  267 + }
  268 + });
  269 + }
229 270 });
230 271  
231 272 $("#query").on("click",jsDoQuery);
... ... @@ -260,6 +301,7 @@
260 301 params['type'] = "query";
261 302 $("#forms .hidden").removeClass("hidden");
262 303 $("#map tr").addClass("hidden");
  304 + $("#sumMap tr").addClass("hidden");
263 305 $get('/pcpc/firstAndLastBus_sum', params, function(result){
264 306 // 把数据填充到模版中
265 307 var tbodyHtml = template('list_firstAndLastBus_sum',{list:result});
... ... @@ -288,6 +330,28 @@
288 330 });
289 331 });
290 332  
  333 + $("#exportMap").on("click",function(){
  334 + $("#map").table2excel({
  335 + exclue: ".noExl",
  336 + name: "Excel Document Name.xlsx",
  337 + filename: "线路首末班",
  338 + exclude_img: true,
  339 + exclude_links: true,
  340 + exclude_inputs: true
  341 + });
  342 + });
  343 +
  344 + $("#exportSumMap").on("click",function(){
  345 + $("#sumMap").table2excel({
  346 + exclue: ".noExl",
  347 + name: "Excel Document Name.xlsx",
  348 + filename: "首末班误点班次",
  349 + exclude_img: true,
  350 + exclude_links: true,
  351 + exclude_inputs: true
  352 + });
  353 + });
  354 +
291 355  
292 356 });
293 357  
... ... @@ -307,7 +371,7 @@
307 371 <td colspan='4'>{{obj.date}}</td>
308 372 <td>{{obj.jhbc}}</td>
309 373 <td>{{obj.sjbc}}</td>
310   - <td>{{obj.zdl}}</td>
  374 + <td><a id='delay'>{{obj.zdl}}</a></td>
311 375 {{/if}}
312 376 </tr>
313 377 {{/each}}
... ... @@ -368,4 +432,19 @@
368 432 {{/if}}
369 433 </tr>
370 434 {{/each}}
  435 +</script>
  436 +<script type="text/html" id="list_sumMaps">
  437 + {{each list as obj i}}
  438 + <tr>
  439 + <td>{{obj.no}}</td>
  440 + <td>{{obj.date}}</td>
  441 + <td>{{obj.subCompany}}</td>
  442 + <td>{{obj.line}}</td>
  443 + <td>{{obj.firstOrLast}}</td>
  444 + <td>{{obj.jhfc}}</td>
  445 + <td>{{obj.sjfc}}</td>
  446 + <td> {{obj.delay}}</td>
  447 + <td>{{obj.remarks1}}</td>
  448 + </tr>
  449 + {{/each}}
371 450 </script>
372 451 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/js/jquery.table2excel.min.js 0 → 100644
  1 +/*
  2 + * jQuery table2excel - v1.1.1
  3 + * jQuery plugin to export an .xls file in browser from an HTML table
  4 + * https://github.com/rainabba/jquery-table2excel
  5 + *
  6 + * Made by rainabba
  7 + * Under MIT License
  8 + */
  9 +!function(a,b,c,d){function e(b,c){this.element=b,this.settings=a.extend({},k,c),this._defaults=k,this._name=j,this.init()}function f(a){return a.filename?a.filename:"table2excel"}function g(a){var b=/(\s+alt\s*=\s*"([^"]*)"|\s+alt\s*=\s*'([^']*)')/i;return a.replace(/<img[^>]*>/gi,function(a){var c=b.exec(a);return null!==c&&c.length>=2?c[2]:""})}function h(a){return a.replace(/<a[^>]*>|<\/a>/gi,"")}function i(a){var b=/(\s+value\s*=\s*"([^"]*)"|\s+value\s*=\s*'([^']*)')/i;return a.replace(/<input[^>]*>|<\/input>/gi,function(a){var c=b.exec(a);return null!==c&&c.length>=2?c[2]:""})}var j="table2excel",k={exclude:".noExl",name:"Table2Excel",filename:"table2excel",fileext:".xls",exclude_img:!0,exclude_links:!0,exclude_inputs:!0};e.prototype={init:function(){var b=this;b.template={head:'<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8"><head>\x3c!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets>',sheet:{head:"<x:ExcelWorksheet><x:Name>",tail:"</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>"},mid:"</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--\x3e</head><body>",table:{head:"<table>",tail:"</table>"},foot:"</body></html>"},b.tableRows=[],a(b.element).each(function(c,d){var e="";a(d).find("tr").not(b.settings.exclude).each(function(c,d){e+="<tr>",a(d).find("td,th").not(b.settings.exclude).each(function(c,d){var f={rows:a(this).attr("rowspan"),cols:a(this).attr("colspan"),flag:a(d).find(b.settings.exclude)};f.flag.length>0?e+="<td> </td>":f.rows&f.cols?e+="<td>"+a(d).html()+"</td>":(e+="<td",f.rows>0&&(e+=" rowspan='"+f.rows+"' "),f.cols>0&&(e+=" colspan='"+f.cols+"' "),e+="/>"+a(d).html()+"</td>")}),e+="</tr>",console.log(e)}),b.settings.exclude_img&&(e=g(e)),b.settings.exclude_links&&(e=h(e)),b.settings.exclude_inputs&&(e=i(e)),b.tableRows.push(e)}),b.tableToExcel(b.tableRows,b.settings.name,b.settings.sheetName)},tableToExcel:function(d,e,g){var h,i,j,k=this,l="";if(k.format=function(a,b){return a.replace(/{(\w+)}/g,function(a,c){return b[c]})},g=void 0===g?"Sheet":g,k.ctx={worksheet:e||"Worksheet",table:d,sheetName:g},l=k.template.head,a.isArray(d))for(h in d)l+=k.template.sheet.head+g+h+k.template.sheet.tail;if(l+=k.template.mid,a.isArray(d))for(h in d)l+=k.template.table.head+"{table"+h+"}"+k.template.table.tail;l+=k.template.foot;for(h in d)k.ctx["table"+h]=d[h];if(delete k.ctx.table,!c.documentMode){var m=new Blob([k.format(l,k.ctx)],{type:"application/vnd.ms-excel"});b.URL=b.URL||b.webkitURL,i=b.URL.createObjectURL(m),j=c.createElement("a"),j.download=f(k.settings),j.href=i,c.body.appendChild(j),j.click(),c.body.removeChild(j)}else if("undefined"!=typeof Blob){l=k.format(l,k.ctx),l=[l];var n=new Blob(l,{type:"text/html"});b.navigator.msSaveBlob(n,f(k.settings))}else txtArea1.document.open("text/html","replace"),txtArea1.document.write(k.format(l,k.ctx)),txtArea1.document.close(),txtArea1.focus(),sa=txtArea1.document.execCommand("SaveAs",!0,f(k.settings));return!0}},a.fn[j]=function(b){var c=this;return c.each(function(){a.data(c,"plugin_"+j)||a.data(c,"plugin_"+j,new e(this,b))}),c}}(jQuery,window,document);
0 10 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -745,6 +745,25 @@ angular.module(&#39;ScheduleApp&#39;).factory(
745 745 }
746 746 }
747 747 }
  748 + ),
  749 +
  750 + lineverions: $resource(
  751 + '/tic_ec/versiondesc2/:lineId/:status',
  752 + {},
  753 + {
  754 + list: {
  755 + method: 'GET',
  756 + isArray: true,
  757 + transformResponse: function(rs) {
  758 + var dst = angular.fromJson(rs);
  759 + if (dst.status == 'SUCCESS') {
  760 + return dst.data;
  761 + } else {
  762 + return dst; // 业务错误留给控制器处理
  763 + }
  764 + }
  765 + }
  766 + }
748 767 )
749 768 };
750 769  
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/form.html
... ... @@ -106,7 +106,7 @@
106 106 <label class="col-md-2 control-label">站点路由版本类型*:</label>
107 107 <div class="col-md-4">
108 108 <sa-Select5 name="zdlytype"
109   - model="ctrl.ttInfoDetailManageForForm"
  109 + model="ctrl"
110 110 cmaps="{'zdlytype': 'value'}"
111 111 dcname="zdlytype"
112 112 icname="value"
... ... @@ -117,20 +117,24 @@
117 117 searchexp="this.name"
118 118 required >
119 119 </sa-Select5>
  120 + <input type="hidden" name="lineversion" ng-model="ctrl.ttInfoDetailManageForForm.lineversion" required/>
120 121 </div>
121 122 <!-- 隐藏快,显示验证信息 -->
122 123 <div class="alert alert-danger well-sm" ng-show="myForm.zdlytype.$error.required">
123 124 请选择站点路由版本类型
124 125 </div>
  126 + <div class="alert alert-danger well-sm" ng-show="myForm.lineversion.$error.required">
  127 + 未知线路版本
  128 + </div>
125 129 </div>
126 130  
127   - <div class="form-group has-success has-feedback" ng-if="ctrl.ttInfoDetailManageForForm.zdlytype == 2">
  131 + <div class="form-group has-success has-feedback" ng-if="ctrl.zdlytype == 2">
128 132 <label class="col-md-2 control-label">最近版本列表*:</label>
129 133 <div class="col-md-4">
130   - <sa-Select5 name="zdlyversion"
  134 + <sa-Select5 name="lineversion_sel"
131 135 model="ctrl.ttInfoDetailManageForForm"
132   - cmaps="{'zdlyversion' : 'version'}"
133   - dcname="zdlyversion"
  136 + cmaps="{'lineversion' : 'version'}"
  137 + dcname="lineversion"
134 138 icname="version"
135 139 dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.ttInfoDetailManageForForm.xlid}, atype:'rs_version_list' } | json }}"
136 140 iterobjname="item"
... ... @@ -139,8 +143,9 @@
139 143 searchexp="this.desc"
140 144 required >
141 145 </sa-Select5>
  146 +
142 147 </div>
143   - <div class="alert alert-danger well-sm" ng-show="myForm.zdlyversion.$error.required">
  148 + <div class="alert alert-danger well-sm" ng-show="myForm.lineversion_sel.$error.required">
144 149 必须选择版本列表
145 150 </div>
146 151 </div>
... ... @@ -168,8 +173,7 @@
168 173 'sheetname': ctrl.ttInfoDetailManageForForm.sheetname,
169 174 'lineid' : ctrl.ttInfoDetailManageForForm.xlid,
170 175 'linename' : ctrl.ttInfoDetailManageForForm.xlname,
171   - 'zdlytype': ctrl.ttInfoDetailManageForForm.zdlytype,
172   - 'zdlyversion' : ctrl.ttInfoDetailManageForForm.zdlyversion
  176 + 'lineversion' : ctrl.ttInfoDetailManageForForm.lineversion
173 177 } | json}}"/>
174 178 </div>
175 179 <!-- 隐藏块,显示验证信息 -->
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/module.js
... ... @@ -3,7 +3,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
3 3 'TtInfoDetailManageService',
4 4 [
5 5 'TimeTableDetailManageService_g',
6   - function(service) {
  6 + 'TTInfoManageService_g',
  7 + function(service, service2) {
7 8 // TODO:
8 9  
9 10 return {
... ... @@ -17,6 +18,16 @@ angular.module(&#39;ScheduleApp&#39;).factory(
17 18 getEditInfo: function(xlid, ttid) {
18 19 var params = {xlid : xlid, ttid : ttid};
19 20 return service.edit.list(params).$promise;
  21 + },
  22 + /**
  23 + * 获取当前线路版本。
  24 + * @param xlid
  25 + * @returns {*|Function|promise|n}
  26 + */
  27 + getCurrentLineVersion: function(xlid) {
  28 + var params = {'lineId': xlid, 'status': 1};
  29 + return service2.lineverions.list(params).$promise;
  30 +
20 31 }
21 32 };
22 33 }
... ... @@ -31,7 +42,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
31 42 'FileUploader',
32 43 '$stateParams',
33 44 '$state',
34   - function(service, FileUploader, $stateParams, $state) {
  45 + '$scope',
  46 + function(service, FileUploader, $stateParams, $state, $scope) {
35 47 var self = this;
36 48 var xlid = $stateParams.xlid;
37 49 var ttid = $stateParams.ttid;
... ... @@ -40,10 +52,35 @@ angular.module(&#39;ScheduleApp&#39;).controller(
40 52  
41 53 self.title = xlname + '(' + ttname + ')' + '时刻表明细信息excel数据导入';
42 54  
  55 + // 站点路由选择类型
  56 + self.zdlytype = 1;
  57 +
  58 + $scope.$watch(
  59 + function() {
  60 + return self.zdlytype;
  61 + },
  62 + function(n, o) {
  63 + if (n == 1) {
  64 + // 初始获取线路当前版本
  65 + service.getCurrentLineVersion(xlid).then(
  66 + function(result) {
  67 + if (result.length == 0) {
  68 + alert("没有线路当前版本");
  69 + } else if (result.length > 1) {
  70 + alert("有多个线路当前版本");
  71 + } else {
  72 + self.ttInfoDetailManageForForm.lineversion = result[0].version;
  73 + }
  74 + }
  75 + );
  76 + }
  77 + },
  78 + true
  79 + );
  80 +
43 81 // 欲保存的表单信息,双向绑定
44 82 self.ttInfoDetailManageForForm = {
45   - zdlytype: 1, // 站点路由类型
46   - zdlyversion: -1, // 站点路由版本
  83 + lineversion: undefined, // 线路版本
47 84 xlid: xlid, // 线路id
48 85 ttid: ttid, // 时刻表id
49 86 xlname: xlname, // 线路名称
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/service.js
... ... @@ -71,6 +71,25 @@ angular.module(&#39;ScheduleApp&#39;).factory(
71 71 }
72 72 }
73 73 }
  74 + ),
  75 +
  76 + lineverions: $resource(
  77 + '/tic_ec/versiondesc2/:lineId/:status',
  78 + {},
  79 + {
  80 + list: {
  81 + method: 'GET',
  82 + isArray: true,
  83 + transformResponse: function(rs) {
  84 + var dst = angular.fromJson(rs);
  85 + if (dst.status == 'SUCCESS') {
  86 + return dst.data;
  87 + } else {
  88 + return dst; // 业务错误留给控制器处理
  89 + }
  90 + }
  91 + }
  92 + }
74 93 )
75 94 };
76 95  
... ...