Commit d044b8377b53bf0efbb42dc0617e23c17303ab1e

Authored by 廖磊
1 parent 0bacebd5

报表修改

src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -47,33 +47,33 @@ public class FormsServiceImpl implements FormsService {
47 47 @Override
48 48 public List<Waybillday> waybillday(Map<String, Object> map) {
49 49  
50   - String sql ="select x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name "
51   - + " from bsth_c_s_sp_info_real x INNER join "
52   - + " ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,c.personnel_name from"
53   - + " bsth_c_ylb y LEFT JOIN bsth_c_personnel c ON c.job_code=y.JSY "
54   - + " where 1=1 ";
55   - if(map.get("date").toString()!=""){
56   - sql+=" and to_days(y.RQ)=to_days('"+map.get("date").toString() + "') ";
57   - }
58   - if( map.get("line").toString()!=""){
59   - sql+=" and y.XLBM= '"+ map.get("line").toString()+"' GROUP BY y.NBBM) ";
60   - }
61   - sql+= " z on x.cl_zbh=z.nbbm where to_days( x.schedule_date)=to_days('"+map.get("date").toString()+"') ";
62   - if(map.get("gsdmWaybillday").toString()!=""){
63   - sql+=" and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"'";
64   - }
65   - if(map.get("fgsdmWaybillday").toString()!=""){
66   - sql+=" and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"'";
67   - }
68   - sql += " GROUP BY x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name ";
  50 +
  51 +
  52 + String sql=" select t.*,z.jzl,z.yh from ("
  53 + + " select x.j_gh,x.cl_zbh,x.j_name,x.schedule_date,"
  54 + + " x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name from bsth_c_s_sp_info_real x "
  55 + + " where to_days( x.schedule_date)=to_days('"+map.get("date").toString() + "') "
  56 + + " and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"' "
  57 + + " and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"' "
  58 + + " and xl_bm like '%"+ map.get("line").toString().trim()+"%'"
  59 + + " GROUP BY x.j_gh,x.cl_zbh,x.j_name,"
  60 + + " x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name ) t"
  61 + + " LEFT join (select y.rq,y.xlbm,y.nbbm,y.jsy,y.jzl,y.yh from"
  62 + + " bsth_c_ylb y where 1=1 "
  63 + + " and to_days(y.RQ)=to_days('"+map.get("date").toString() + "') "
  64 + + " and y.XLBM like '%"+ map.get("line").toString().trim()+"%'"
  65 + + " and y.ssgsdm='"+map.get("gsdmWaybillday").toString()+"'"
  66 + + " and y.fgsdm='"+map.get("gsdmWaybillday").toString()+"') z "
  67 + + " on t.cl_zbh=z.nbbm ";
  68 +
69 69 List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() {
70 70 @Override
71 71 public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException {
72 72 Waybillday wbd = new Waybillday();
73 73 wbd.setCarPlate(arg0.getString("cl_zbh"));
74   - wbd.setJzl(arg0.getString("JZL"));
75   - wbd.setYh(arg0.getString("YH"));
76   - wbd.setjName(arg0.getString("personnel_name"));
  74 + wbd.setJzl(arg0.getString("jzl"));
  75 + wbd.setYh(arg0.getString("yh"));
  76 + wbd.setjName(arg0.getString("j_name"));
77 77 wbd.setRq(arg0.getString("schedule_date"));
78 78 wbd.setJgh(arg0.getString("j_gh"));
79 79 return wbd;
... ... @@ -193,7 +193,15 @@ public class FormsServiceImpl implements FormsService {
193 193 // 班次车辆人员日统计
194 194 @Override
195 195 public List<Shifday> shifday(Map<String, Object> map) {
196   - String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,"
  196 +
  197 + String sql ="select t.* from (select r.schedule_date,r.j_name,IFNULL(r.s_name,'')as s_name,"
  198 + + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm FROM bsth_c_s_sp_info_real r where 1=1 "
  199 + + " and to_days(r.schedule_date)=to_days('"+ map.get("date").toString() + "') "
  200 + + " and r.xl_bm like '%"+map.get("line").toString()+"%' "
  201 + + " and r.gs_bm='"+map.get("gsdmShif").toString()+"' "
  202 + + " and r.fgs_bm='"+map.get("fgsdmShif").toString()+"' ) t"
  203 + + " GROUP BY t.schedule_date,t.j_name,t.s_name, t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm ";
  204 + /*String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,"
197 205 + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
198 206 + " FROM bsth_c_s_sp_info_real r "
199 207 + " where 1=1 ";
... ... @@ -211,20 +219,18 @@ public class FormsServiceImpl implements FormsService {
211 219 sql+=" and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'";
212 220 }
213 221 sql += " GROUP BY r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
214   - + " ORDER BY r.lp_name asc";
  222 + + " ORDER BY r.lp_name asc";*/
215 223  
216 224 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() {
217 225  
218 226 @Override
219 227 public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException {
220 228 Shifday shifday = new Shifday();
  229 + shifday.setRq(arg0.getString("schedule_date"));
221 230 shifday.setjName(arg0.getString("j_name").toString());
222 231 shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString());
223   - shifday.setLpName(arg0.getString("r.lp_name").toString());
224 232 shifday.setCarPlate(arg0.getString("cl_zbh").toString());
225 233 shifday.setJgh(arg0.getString("j_gh"));
226   - shifday.setZbh(arg0.getString("cl_zbh"));
227   - shifday.setRq(arg0.getString("schedule_date"));
228 234 return shifday;
229 235 }
230 236  
... ...
src/main/resources/static/pages/mforms/shifdays/shifday.html
... ... @@ -156,15 +156,19 @@ $(function(){
156 156 var date = $("#date").val();
157 157 var gsdmShif = $("#gsdmShif").val();
158 158 var fgsdmShif = $("#fgsdmShif").val();
159   - $post('/mcy_forms/shifday',{gsdmShif:gsdmShif,fgsdmShif:fgsdmShif, line:line,date:date},function(result){
160   - $.each(result, function(i, obj) {
161   - obj.requestType = reqCodeMap[obj.requestType];
162   - });
163   - // 把数据填充到模版中
164   - var tbodyHtml = template('shifday',{list:result});
165   - // 把渲染好的模版html文本追加到表格中
166   - $('#forms tbody').html(tbodyHtml);
167   - });
  159 + if(date=="" || date ==null){
  160 + layer.msg('请选择日期.');
  161 + }else{
  162 + $post('/mcy_forms/shifday',{gsdmShif:gsdmShif,fgsdmShif:fgsdmShif, line:line,date:date},function(result){
  163 + $.each(result, function(i, obj) {
  164 + obj.requestType = reqCodeMap[obj.requestType];
  165 + });
  166 + // 把数据填充到模版中
  167 + var tbodyHtml = template('shifday',{list:result});
  168 + // 把渲染好的模版html文本追加到表格中
  169 + $('#forms tbody').html(tbodyHtml);
  170 + });
  171 + }
168 172 });
169 173  
170 174 $("#export").on("click",function(){
... ...
src/main/resources/static/pages/mforms/waybilldays/waybillday.html
... ... @@ -141,16 +141,19 @@
141 141 date = $("#date").val();
142 142 gsdmWaybillday=$("#gsdmWaybillday").val();
143 143 fgsdmWaybillday = $("#fgsdmWaybillday").val();
144   -
145   - $post('/mcy_forms/waybillday',{gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday, line:line,date:$("#date").val(),type:'query'},function(result){
146   - $.each(result, function(i, obj) {
147   - obj.requestType = reqCodeMap[obj.requestType];
148   - });
149   - // 把数据填充到模版中
150   - var tbodyHtml = template('waybillday',{list:result});
151   - // 把渲染好的模版html文本追加到表格中
152   - $('#forms tbody').html(tbodyHtml);
153   - });
  144 + if(date=="" || date ==null){
  145 + layer.msg('请选择日期.');
  146 + }else{
  147 + $post('/mcy_forms/waybillday',{gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday, line:line,date:date,type:'query'},function(result){
  148 + $.each(result, function(i, obj) {
  149 + obj.requestType = reqCodeMap[obj.requestType];
  150 + });
  151 + // 把数据填充到模版中
  152 + var tbodyHtml = template('waybillday',{list:result});
  153 + // 把渲染好的模版html文本追加到表格中
  154 + $('#forms tbody').html(tbodyHtml);
  155 + });
  156 + }
154 157 });
155 158  
156 159 $("#export").on("click",function(){
... ...