Commit 5675077243c28d0a4a3c3f033239cc2d6b35785b

Authored by 廖磊
1 parent addbcf56

计划车辆班次人员

src/main/java/com/bsth/controller/report/ReportController.java
@@ -46,11 +46,18 @@ public class ReportController { @@ -46,11 +46,18 @@ public class ReportController {
46 for (ArrivalInfo a:list ) { 46 for (ArrivalInfo a:list ) {
47 Map<String, Object> m = new HashMap<String, Object>(); 47 Map<String, Object> m = new HashMap<String, Object>();
48 m.put("i", i); 48 m.put("i", i);
49 - m.put("mbbm", a.getNbbm()); 49 + m.put("nbbm", a.getNbbm());
50 m.put("stopName", a.getStopName()); 50 m.put("stopName", a.getStopName());
51 m.put("jzsj", a.getJzsj()); 51 m.put("jzsj", a.getJzsj());
52 m.put("czsj", a.getCzsj()); 52 m.put("czsj", a.getCzsj());
  53 + m.put("kgm", "");
53 m.put("upDown", a.getUpDown()==0?"上行":"下行"); 54 m.put("upDown", a.getUpDown()==0?"上行":"下行");
  55 + m.put("kmsd", "");
  56 + m.put("bufa", "");
  57 + m.put("skcs", "");
  58 + m.put("skje", "");
  59 + m.put("mfskcs", "");
  60 + m.put("mfskje", "");
54 resList.add(m); 61 resList.add(m);
55 i++; 62 i++;
56 } 63 }
@@ -77,6 +84,46 @@ public class ReportController { @@ -77,6 +84,46 @@ public class ReportController {
77 84
78 85
79 86
  87 + @RequestMapping(value="/exportQueryListClzd" ,method = RequestMethod.GET)
  88 + public List<Map<String, Object>> exportQueryListClzd(@RequestParam String zd,@RequestParam String line,
  89 + @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){
  90 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  91 + ReportUtils ee = new ReportUtils();
  92 + List<ArrivalInfo> list=service.queryListClzd(line,zd,zdlx,fcsj,ddsj);
  93 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  94 + int i=1;
  95 + for (ArrivalInfo a:list ) {
  96 + Map<String, Object> m = new HashMap<String, Object>();
  97 + m.put("i", i);
  98 + m.put("nbbm", a.getNbbm());
  99 + m.put("stopName", a.getStopName());
  100 + m.put("jzsj", a.getJzsj());
  101 + m.put("czsj", a.getCzsj());
  102 + m.put("kgm", "");
  103 + m.put("upDown", a.getUpDown()==0?"上行":"下行");
  104 + m.put("kmsd", "");
  105 + m.put("bufa", "");
  106 + m.put("skcs", "");
  107 + m.put("skje", "");
  108 + m.put("mfskcs", "");
  109 + m.put("mfskje", "");
  110 + resList.add(m);
  111 + i++;
  112 + }
  113 +
  114 + try {
  115 + Map<String, Object> map=new HashMap<String, Object>();
  116 + listI.add(resList.iterator());
  117 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  118 + ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls",
  119 + path + "export/班次到离站.xls");
  120 + } catch (Exception e) {
  121 + e.printStackTrace();
  122 + }
  123 + return resList;
  124 + }
  125 +
  126 +
80 @RequestMapping(value="/jobSummaryExport" ,method = RequestMethod.GET) 127 @RequestMapping(value="/jobSummaryExport" ,method = RequestMethod.GET)
81 public List<Map<String, Object>> jobSummaryExport(@RequestParam Map<String, Object> map){ 128 public List<Map<String, Object>> jobSummaryExport(@RequestParam Map<String, Object> map){
82 List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); 129 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
@@ -141,8 +141,15 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -141,8 +141,15 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
141 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 141 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
142 List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); 142 List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
143 143
144 - String company = map.get("company").toString();  
145 - String subCompany = map.get("subCompany").toString(); 144 + /*String company = "";
  145 + String subCompany ="";
  146 + if(map.get("company")!=null){
  147 + company = map.get("company").toString();
  148 + }
  149 +
  150 + if(map.get("subCompany")!=null){
  151 + subCompany=map.get("subCompany").toString();
  152 + }*/
146 String line = map.get("line").toString(); 153 String line = map.get("line").toString();
147 String date = map.get("date").toString(); 154 String date = map.get("date").toString();
148 String type = map.get("type").toString(); 155 String type = map.get("type").toString();
@@ -157,9 +164,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -157,9 +164,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
157 if(line.length() != 0){ 164 if(line.length() != 0){
158 sql += " and xl_bm = '"+line+"'"; 165 sql += " and xl_bm = '"+line+"'";
159 } 166 }
160 - if(company.length() != 0){ 167 + /*if(company.length() != 0){
161 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; 168 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
162 - } 169 + }*/
163 170
164 list = jdbcTemplate.query(sql, 171 list = jdbcTemplate.query(sql,
165 new RowMapper<SchedulePlanInfo>(){ 172 new RowMapper<SchedulePlanInfo>(){
src/main/resources/static/pages/forms/mould/inoutstation.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
@@ -101,32 +101,31 @@ @@ -101,32 +101,31 @@
101 day = "0" + day; 101 day = "0" + day;
102 $("#date").val(year + "-" + month + "-" + day); 102 $("#date").val(year + "-" + month + "-" + day);
103 103
104 - $.get('/basic/lineCode2Name',function(result){  
105 - var data=[];  
106 -  
107 - data.push({id: " ", text: "全部线路"});  
108 - for(var code in result){  
109 - data.push({id: code, text: result[code]});  
110 - }  
111 - console.log(data);  
112 - initPinYinSelect2('#line',data,'');  
113 - });  
114 - 104 + var fage=false;
  105 + var xlList;
115 var obj = []; 106 var obj = [];
116 - $.get('/user/companyData', function(result){  
117 - obj = result;  
118 - var options = '';  
119 - for(var i = 0; i < obj.length; i++){  
120 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
121 - }  
122 - if(obj.length == 1){  
123 - $('#company1').hide();  
124 - if(obj[0].children.length == 1)  
125 - $('#subCompany1').hide();  
126 - }  
127 - $('#company').html(options);  
128 - updateCompany();  
129 - }); 107 +
  108 +
  109 + $.get('/report/lineList',function(result){
  110 + xlList=result;
  111 + $.get('/user/companyData', function(result){
  112 + obj = result;
  113 + var options = '';
  114 + for(var i = 0; i < obj.length; i++){
  115 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  116 + }
  117 +
  118 + if(obj.length ==0){
  119 + $("#company1").css('display','none');
  120 + }else if(obj.length ==1){
  121 + $("#company1").css('display','none');
  122 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  123 + $('#subCompany1').css('display','none');
  124 + }
  125 + $('#company').html(options);
  126 + updateCompany();
  127 + });
  128 + })
130 $("#company").on("change",updateCompany); 129 $("#company").on("change",updateCompany);
131 function updateCompany(){ 130 function updateCompany(){
132 var company = $('#company').val(); 131 var company = $('#company').val();
@@ -140,6 +139,42 @@ @@ -140,6 +139,42 @@
140 } 139 }
141 } 140 }
142 $('#subCompany').html(options); 141 $('#subCompany').html(options);
  142 + initXl();
  143 + }
  144 +
  145 + /* $.get('/basic/lineCode2Name',function(result){
  146 + var data=[];
  147 +
  148 + for(var code in result){
  149 + data.push({id: code, text: result[code]});
  150 + }
  151 + initPinYinSelect2('#line',data,'');
  152 +
  153 + }) */
  154 +
  155 + $("#subCompany").on("change",initXl);
  156 + function initXl(){
  157 + var data=[];
  158 + if(fage){
  159 + $("#line").select2("destroy").html('');
  160 + }
  161 + var fgs=$('#subCompany').val();
  162 + var gs=$('#company').val();
  163 + for(var i=0;i<xlList.length;i++){
  164 + if(gs!=""){
  165 + if(fgs!=""){
  166 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  167 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  168 + }
  169 + }else{
  170 + if(xlList[i]["gsbm"]==gs){
  171 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  172 + }
  173 + }
  174 + }
  175 + }
  176 + initPinYinSelect2('#line',data,'');
  177 + fage=true;
143 } 178 }
144 179
145 180