Commit 6d82b0f76049effdbaa9874506a83a02b31a1238

Authored by 娄高锋
1 parent e3634240

闵行工时报表加路牌搜索

src/main/java/com/bsth/controller/report/ReportController.java
... ... @@ -367,8 +367,8 @@ public class ReportController {
367 367 @RequestMapping(value="/workingHours" ,method = RequestMethod.POST)
368 368 public List<Map<String, Object>> workingHours(@RequestParam String gsdm, @RequestParam String fgsdm,
369 369 @RequestParam String line, @RequestParam String date, @RequestParam String date2, @RequestParam String gh,
370   - @RequestParam String cl, @RequestParam String lineName, @RequestParam String type){
371   - List<Map<String, Object>> list = service.workingHours(gsdm, fgsdm, line, date, date2, gh, cl);
  370 + @RequestParam String cl, @RequestParam String lpName, @RequestParam String lineName, @RequestParam String type){
  371 + List<Map<String, Object>> list = service.workingHours(gsdm, fgsdm, line, date, date2, gh, cl, lpName);
372 372 if("export".equals(type)){
373 373 try {
374 374 ReportUtils ee = new ReportUtils();
... ...
src/main/java/com/bsth/service/report/ReportService.java
... ... @@ -57,5 +57,5 @@ public interface ReportService {
57 57  
58 58 Map<String, Object> online(Map<String, Object> map);
59 59  
60   - List<Map<String, Object>> workingHours(String gsdm, String fgsdm, String line, String date, String date2, String gh, String cl);
  60 + List<Map<String, Object>> workingHours(String gsdm, String fgsdm, String line, String date, String date2, String gh, String cl, String lpName);
61 61 }
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -3556,7 +3556,7 @@ public class ReportServiceImpl implements ReportService{
3556 3556  
3557 3557 @Override
3558 3558 public List<Map<String, Object>> workingHours(String gsdm, String fgsdm, String line, String date, String date2,
3559   - String gh, String cl) {
  3559 + String gh, String cl, String lp) {
3560 3560 List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
3561 3561 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
3562 3562 SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
... ... @@ -3572,40 +3572,6 @@ public class ReportServiceImpl implements ReportService{
3572 3572  
3573 3573  
3574 3574 Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>();
3575   -// for(SchedulePlanInfo plan : planList){
3576   -// String gsBm = plan.getGsBm();
3577   -// String fgsBm = plan.getFgsBm();
3578   -// String xlBm = plan.getXlBm();
3579   -//// String scheduleDate = sdf.format(plan.getScheduleDate());
3580   -// String jGh = plan.getjGh();
3581   -// String jName = plan.getjName();
3582   -//// String sGh = plan.getsGh();
3583   -//// String sName = plan.getsName();
3584   -// String clZbh = plan.getClZbh();
3585   -// String lpName = plan.getLpName();
3586   -// Long bcsj = (long)plan.getBcsj();
3587   -//
3588   -// String key = gsBm + "/" + fgsBm + "/" + xlBm + "/"
3589   -// + jGh + "/" + jName + "/" + clZbh + "/" + lpName;
3590   -// if(!(keyMap.containsKey(key))){
3591   -// Map<String, Object> m = new HashMap<String, Object>();
3592   -// m.put("gsBm", gsBm);
3593   -// m.put("fgsBm", fgsBm);
3594   -// m.put("xlBm", xlBm);
3595   -//// m.put("date", scheduleDate);
3596   -// m.put("jGh", jGh);
3597   -// m.put("jName", jName);
3598   -//// m.put("sGh", sGh);
3599   -//// m.put("sName", sName);
3600   -// m.put("clZbh", clZbh);
3601   -// m.put("lpName", lpName);
3602   -// m.put("jh", 0);
3603   -// m.put("sj", 0);
3604   -// keyMap.put(key, m);
3605   -// }
3606   -// Map<String, Object> map = keyMap.get(key);
3607   -// map.put("jh", bcsj + Long.valueOf(map.get("jh").toString()));
3608   -// }
3609 3575 for(ScheduleRealInfo plan : realList){
3610 3576 if(!(plan.isSflj()) && !(plan.isCcService())){
3611 3577 String gsBm = plan.getGsBm();
... ... @@ -3734,6 +3700,11 @@ public class ReportServiceImpl implements ReportService{
3734 3700 continue;
3735 3701 }
3736 3702 }
  3703 + if(lp.trim().length() > 0){
  3704 + if(!(map.get("lpName").toString().toLowerCase().contains(lp.toLowerCase()))){
  3705 + continue;
  3706 + }
  3707 + }
3737 3708 String gsBm = map.get("gsBm").toString();
3738 3709 String fgsBm = map.get("fgsBm").toString();
3739 3710 String xlBm = map.get("xlBm").toString();
... ...
src/main/resources/static/pages/forms/statement/workingHours.html
... ... @@ -56,6 +56,10 @@
56 56 <span class="item-label" style="width: 80px;">车辆: </span>
57 57 <input class="form-control" type="text" id="cl" style="width: 180px;"/>
58 58 </div>
  59 + <div style="display: inline-block;margin-left: 32px;">
  60 + <span class="item-label" style="width: 80px;">路牌: </span>
  61 + <input class="form-control" type="text" id="lpName" style="width: 180px;"/>
  62 + </div>
59 63 <div class="form-group" style="margin-left: 10px">
60 64 <input class="btn btn-default" type="button" id="query" value="筛选"/>
61 65 <input class="btn btn-default" type="button" id="export" value="导出"/>
... ... @@ -200,6 +204,7 @@
200 204 var fgsdm;
201 205 var gh;
202 206 var cl;
  207 + var lpName;
203 208 var lineName=$("#select2-line-container").html();
204 209 $("#query").on("click",function(){
205 210 if($("#date").val() == null || $("#date").val().trim().length == 0){
... ... @@ -217,9 +222,10 @@
217 222 fgsdm=$("#fgsdm").val();
218 223 gh=$("#gh").val();
219 224 cl=$("#cl").val();
  225 + lpName=$("#lpName").val();
220 226 lineName=$("#select2-line-container").html();
221 227 var i = layer.load(2);
222   - $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,gh:gh,cl:cl,lineName:lineName,type:'query'},function(result){
  228 + $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,gh:gh,cl:cl,lpName:lpName,lineName:lineName,type:'query'},function(result){
223 229 // 把数据填充到模版中
224 230 var tbodyHtml = template('workingHours',{list:result});
225 231 // 把渲染好的模版html文本追加到表格中
... ... @@ -244,9 +250,10 @@
244 250 fgsdm=$("#fgsdm").val();
245 251 gh=$("#gh").val();
246 252 cl=$("#cl").val();
  253 + lpName=$("#lpName").val();
247 254 lineName=$("#select2-line-container").html();
248 255 var i = layer.load(2);
249   - $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,gh:gh,cl:cl,lineName:lineName,type:'export'},function(result){
  256 + $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,gh:gh,cl:cl,lpName:lpName,lineName:lineName,type:'export'},function(result){
250 257 window.open("/downloadFile/download?fileName="
251 258 +moment(date).format("YYYYMMDD")+"-"+lineName+"-工时统计表");
252 259 layer.close(i);
... ...