Commit 9159ecaa2b6200da8a514c15b273def6346cff7f
1 parent
24999b61
报表油量
Showing
19 changed files
with
477 additions
and
272 deletions
src/main/java/com/bsth/controller/oil/CwjyController.java
| @@ -2,6 +2,8 @@ package com.bsth.controller.oil; | @@ -2,6 +2,8 @@ package com.bsth.controller.oil; | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | import java.util.Date; | 4 | import java.util.Date; |
| 5 | +import java.util.HashMap; | ||
| 6 | +import java.util.List; | ||
| 5 | import java.util.Map; | 7 | import java.util.Map; |
| 6 | 8 | ||
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -31,9 +33,9 @@ public class CwjyController extends BaseController<Cwjy, Integer>{ | @@ -31,9 +33,9 @@ public class CwjyController extends BaseController<Cwjy, Integer>{ | ||
| 31 | return service.save(t); | 33 | return service.save(t); |
| 32 | } | 34 | } |
| 33 | 35 | ||
| 34 | - @RequestMapping(value = "/pagequery",method = RequestMethod.GET) | ||
| 35 | - public PageObject<Ylxxb> pagequery(@RequestParam Map<String, Object> map){ | ||
| 36 | - PageObject<Ylxxb> pagequery=null; | 36 | + @RequestMapping(value = "/queryList",method = RequestMethod.GET) |
| 37 | + public List<Ylxxb> queryList(@RequestParam Map<String, Object> map){ | ||
| 38 | + List<Ylxxb> pagequery=null; | ||
| 37 | map.put("curPage", map.get("page").toString()); | 39 | map.put("curPage", map.get("page").toString()); |
| 38 | map.put("pageData","10"); | 40 | map.put("pageData","10"); |
| 39 | pagequery=service.Pagequery(map); | 41 | pagequery=service.Pagequery(map); |
| @@ -56,9 +58,15 @@ public class CwjyController extends BaseController<Cwjy, Integer>{ | @@ -56,9 +58,15 @@ public class CwjyController extends BaseController<Cwjy, Integer>{ | ||
| 56 | * @throws | 58 | * @throws |
| 57 | */ | 59 | */ |
| 58 | @RequestMapping(value="/savejzl",method = RequestMethod.POST) | 60 | @RequestMapping(value="/savejzl",method = RequestMethod.POST) |
| 59 | - public Map<String, Object> savejzl(Ylxxb t){ | ||
| 60 | - Map<String, Object> map=service.savejzl(t); | ||
| 61 | - return map; | 61 | + public Map<String, Object> savejzl(Map<String, Object> map){ |
| 62 | + Map<String, Object> maps=new HashMap<>(); | ||
| 63 | + try { | ||
| 64 | + maps = service.savejzl(map); | ||
| 65 | + } catch (Exception e) { | ||
| 66 | + // TODO Auto-generated catch block | ||
| 67 | + e.printStackTrace(); | ||
| 68 | + } | ||
| 69 | + return maps; | ||
| 62 | } | 70 | } |
| 63 | 71 | ||
| 64 | } | 72 | } |
src/main/java/com/bsth/controller/oil/YlxxbController.java
| 1 | package com.bsth.controller.oil; | 1 | package com.bsth.controller.oil; |
| 2 | 2 | ||
| 3 | +import java.util.HashMap; | ||
| 3 | import java.util.Map; | 4 | import java.util.Map; |
| 4 | 5 | ||
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -33,9 +34,15 @@ public class YlxxbController extends BaseController<Ylxxb, Integer>{ | @@ -33,9 +34,15 @@ public class YlxxbController extends BaseController<Ylxxb, Integer>{ | ||
| 33 | * @param map | 34 | * @param map |
| 34 | * @return | 35 | * @return |
| 35 | */ | 36 | */ |
| 36 | - @RequestMapping(value = "/check",method = RequestMethod.GET) | 37 | + @RequestMapping(value = "/check",method = RequestMethod.POST) |
| 37 | public Map<String, Object> check(@RequestParam Map<String, Object> map){ | 38 | public Map<String, Object> check(@RequestParam Map<String, Object> map){ |
| 38 | - Map<String, Object> list=service.checkJsy(map); | 39 | + Map<String, Object> list=new HashMap<>(); |
| 40 | + try { | ||
| 41 | + list = service.checkJsy(map); | ||
| 42 | + } catch (Exception e) { | ||
| 43 | + // TODO Auto-generated catch block | ||
| 44 | + e.printStackTrace(); | ||
| 45 | + } | ||
| 39 | return list; | 46 | return list; |
| 40 | } | 47 | } |
| 41 | } | 48 | } |
src/main/java/com/bsth/controller/report/ReportController.java
| @@ -108,4 +108,9 @@ public class ReportController { | @@ -108,4 +108,9 @@ public class ReportController { | ||
| 108 | return service.carList(map); | 108 | return service.carList(map); |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | + @RequestMapping(value="/userList",method = RequestMethod.GET) | ||
| 112 | + public List<Map<String,String>> userList(@RequestParam Map<String, Object> map){ | ||
| 113 | + return service.userList(map); | ||
| 114 | + } | ||
| 115 | + | ||
| 111 | } | 116 | } |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -731,22 +731,33 @@ public class FormsServiceImpl implements FormsService { | @@ -731,22 +731,33 @@ public class FormsServiceImpl implements FormsService { | ||
| 731 | 731 | ||
| 732 | @Override | 732 | @Override |
| 733 | public List<Daily> daily(Map<String, Object> map) { | 733 | public List<Daily> daily(Map<String, Object> map) { |
| 734 | + | ||
| 735 | + String gsbm=""; | ||
| 736 | + if(map.get("gsdmDaily")!=null){ | ||
| 737 | + gsbm=map.get("gsdmDaily").toString(); | ||
| 738 | + } | ||
| 739 | + | ||
| 740 | + String fgsbm=""; | ||
| 741 | + if(map.get("fgsdmDaily").toString()!=null){ | ||
| 742 | + fgsbm=map.get("fgsdmDaily").toString(); | ||
| 743 | + } | ||
| 744 | + | ||
| 734 | String sql="select t.schedule_date_str," | 745 | String sql="select t.schedule_date_str," |
| 735 | + " t.cl_zbh,t.j_gh,t.j_name,x.yh from (select r.schedule_date_str,r.xl_bm,r.xl_name," | 746 | + " t.cl_zbh,t.j_gh,t.j_name,x.yh from (select r.schedule_date_str,r.xl_bm,r.xl_name," |
| 736 | + " r.cl_zbh,r.j_gh,r.j_name from bsth_c_s_sp_info_real r WHERE " | 747 | + " r.cl_zbh,r.j_gh,r.j_name from bsth_c_s_sp_info_real r WHERE " |
| 737 | - + " r.xl_bm='" + map.get("line").toString() + "' and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"') " | ||
| 738 | - + " and r.gs_bm like '%"+map.get("gsdmDaily").toString()+"%' " | ||
| 739 | - + " and r.fgs_bm like '%"+map.get("fgsdmDaily").toString()+"%' " | 748 | + + " r.xl_bm='" + map.get("line").toString() + "' " |
| 749 | + + " and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"') " | ||
| 750 | + + " and r.gs_bm like '%"+gsbm+"%' " | ||
| 751 | + + " and r.fgs_bm like '%"+fgsbm+"%' " | ||
| 740 | + " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name) t" | 752 | + " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name) t" |
| 741 | + " left join (select * from bsth_c_ylb y where " | 753 | + " left join (select * from bsth_c_ylb y where " |
| 742 | + " to_days(y.rq)=to_days('"+map.get("date").toString()+"') " | 754 | + " to_days(y.rq)=to_days('"+map.get("date").toString()+"') " |
| 743 | + " and y.xlbm= '" + map.get("line").toString() + "'" | 755 | + " and y.xlbm= '" + map.get("line").toString() + "'" |
| 744 | - + " and y.ssgsdm like '%"+map.get("gsdmDaily").toString()+"%' " | ||
| 745 | - + " and y.fgsdm like '%"+map.get("fgsdmDaily").toString()+"%'" | 756 | + + " and y.ssgsdm like '%"+gsbm+"%' " |
| 757 | + + " and y.fgsdm like '%"+fgsbm+"%'" | ||
| 746 | + " ) x" | 758 | + " ) x" |
| 747 | + " on t.cl_zbh = x.nbbm "; | 759 | + " on t.cl_zbh = x.nbbm "; |
| 748 | 760 | ||
| 749 | - System.out.println(new Date()); | ||
| 750 | List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { | 761 | List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { |
| 751 | @Override | 762 | @Override |
| 752 | public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { | 763 | public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { |
src/main/java/com/bsth/service/oil/CwjyService.java
| 1 | package com.bsth.service.oil; | 1 | package com.bsth.service.oil; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import java.util.List; | ||
| 4 | import java.util.Map; | 5 | import java.util.Map; |
| 5 | 6 | ||
| 6 | import com.bsth.entity.oil.Cwjy; | 7 | import com.bsth.entity.oil.Cwjy; |
| @@ -9,8 +10,8 @@ import com.bsth.service.BaseService; | @@ -9,8 +10,8 @@ import com.bsth.service.BaseService; | ||
| 9 | import com.bsth.util.PageObject; | 10 | import com.bsth.util.PageObject; |
| 10 | 11 | ||
| 11 | public interface CwjyService extends BaseService<Cwjy, Integer>{ | 12 | public interface CwjyService extends BaseService<Cwjy, Integer>{ |
| 12 | - PageObject<Ylxxb> Pagequery(Map<String, Object> map) ; | 13 | + List<Ylxxb> Pagequery(Map<String, Object> map) ; |
| 13 | Ylxxb bynbbm(Map<String, Object> map); | 14 | Ylxxb bynbbm(Map<String, Object> map); |
| 14 | 15 | ||
| 15 | - Map<String, Object> savejzl(Ylxxb t); | 16 | + Map<String, Object> savejzl(Map<String, Object> map) throws Exception ; |
| 16 | } | 17 | } |
src/main/java/com/bsth/service/oil/YlxxbService.java
| @@ -9,6 +9,6 @@ import com.bsth.util.PageObject; | @@ -9,6 +9,6 @@ import com.bsth.util.PageObject; | ||
| 9 | public interface YlxxbService extends BaseService<Ylxxb, Integer>{ | 9 | public interface YlxxbService extends BaseService<Ylxxb, Integer>{ |
| 10 | PageObject<Ylxxb> Pagequery(Map<String, Object> map) ; | 10 | PageObject<Ylxxb> Pagequery(Map<String, Object> map) ; |
| 11 | 11 | ||
| 12 | - Map<String, Object> checkJsy(Map<String, Object> map); | 12 | + Map<String, Object> checkJsy(Map<String, Object> map) throws Exception; |
| 13 | 13 | ||
| 14 | } | 14 | } |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -135,11 +135,9 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -135,11 +135,9 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 135 | Ylb ylb=ylListBe.get(i); | 135 | Ylb ylb=ylListBe.get(i); |
| 136 | if(map.get("clZbh").toString().equals(ylb.getNbbm())){ | 136 | if(map.get("clZbh").toString().equals(ylb.getNbbm())){ |
| 137 | if(ylb.getJzyl()!=null){ | 137 | if(ylb.getJzyl()!=null){ |
| 138 | - if(ylb.getJzyl()>0){ | ||
| 139 | - t.setCzyl(ylb.getJzyl()); | ||
| 140 | - fage=false; | ||
| 141 | - break; | ||
| 142 | - } | 138 | + t.setCzyl(ylb.getJzyl()); |
| 139 | + fage=false; | ||
| 140 | + break; | ||
| 143 | } | 141 | } |
| 144 | 142 | ||
| 145 | } | 143 | } |
| @@ -272,7 +270,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -272,7 +270,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 272 | for (int i = 0; i < ylListBe.size(); i++) { | 270 | for (int i = 0; i < ylListBe.size(); i++) { |
| 273 | Ylb ylb = ylListBe.get(i); | 271 | Ylb ylb = ylListBe.get(i); |
| 274 | if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | 272 | if (map.get("clZbh").toString().equals(ylb.getNbbm())) { |
| 275 | - if(ylb.getJzyl()>0){ | 273 | + if(ylb.getJzyl()>=0){ |
| 276 | t.setCzyl(ylb.getJzyl()); | 274 | t.setCzyl(ylb.getJzyl()); |
| 277 | fage = false; | 275 | fage = false; |
| 278 | break; | 276 | break; |
| @@ -284,7 +282,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -284,7 +282,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 284 | for (int y = 0; y < clyList.size(); y++) { | 282 | for (int y = 0; y < clyList.size(); y++) { |
| 285 | Cyl cyl = clyList.get(y); | 283 | Cyl cyl = clyList.get(y); |
| 286 | if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | 284 | if (map.get("clZbh").toString().equals(cyl.getNbbm())) { |
| 287 | - if(cyl.getCyl()>0){ | 285 | + if(cyl.getCyl()>=0){ |
| 288 | t.setCzyl(cyl.getCyl()); | 286 | t.setCzyl(cyl.getCyl()); |
| 289 | fage = false; | 287 | fage = false; |
| 290 | break; | 288 | break; |
| @@ -680,7 +678,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -680,7 +678,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 680 | if(map.get("nbbm_eq")!=null){ | 678 | if(map.get("nbbm_eq")!=null){ |
| 681 | nbbm=map.get("nbbm_eq").toString(); | 679 | nbbm=map.get("nbbm_eq").toString(); |
| 682 | } | 680 | } |
| 683 | - List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, fgsbm, xlbm, nbbm); | 681 | + List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm); |
| 684 | List<Cyl> cylList=cylRepository.obtainCyl(nbbm, gsbm); | 682 | List<Cyl> cylList=cylRepository.obtainCyl(nbbm, gsbm); |
| 685 | List<Ylb> ylbList=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); | 683 | List<Ylb> ylbList=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); |
| 686 | List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm); | 684 | List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm); |
| @@ -703,10 +701,15 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -703,10 +701,15 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 703 | t.setJsy(y1.getJsy()); | 701 | t.setJsy(y1.getJsy()); |
| 704 | t.setJzl(y1.getJzl()); | 702 | t.setJzl(y1.getJzl()); |
| 705 | t.setSsgsdm(y1.getGsdm()); | 703 | t.setSsgsdm(y1.getGsdm()); |
| 706 | - t.setFgsdm(carsMap.get(y1.getNbbm())); | 704 | + String fgsdm=carsMap.get(y1.getNbbm()); |
| 705 | + t.setFgsdm(fgsdm); | ||
| 706 | + t.setJcsx(1); | ||
| 707 | Line line= BasicData.nbbm2LineMap.get(y1.getNbbm()); | 707 | Line line= BasicData.nbbm2LineMap.get(y1.getNbbm()); |
| 708 | - if(null !=line) | ||
| 709 | - t.setXlbm(line.getLineCode()); | 708 | + if(null !=line){ |
| 709 | + t.setXlbm(line.getLineCode()); | ||
| 710 | + }else{ | ||
| 711 | + t.setXlbm(""); | ||
| 712 | + } | ||
| 710 | t.setJcsx(1); | 713 | t.setJcsx(1); |
| 711 | boolean status=true; | 714 | boolean status=true; |
| 712 | for (int j = 0; j < ylListBe.size(); j++) { | 715 | for (int j = 0; j < ylListBe.size(); j++) { |
| @@ -734,10 +737,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -734,10 +737,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 734 | // double jzyl=Arith.add(t.getJzl(), t.getCzyl()); | 737 | // double jzyl=Arith.add(t.getJzl(), t.getCzyl()); |
| 735 | t.setJzyl(Arith.add(t.getJzl(), t.getCzyl())); | 738 | t.setJzyl(Arith.add(t.getJzl(), t.getCzyl())); |
| 736 | t.setYh(0.0); | 739 | t.setYh(0.0); |
| 737 | - repository.save(t); | ||
| 738 | - if(null!=cyl){ | ||
| 739 | - cyl.setCyl(Arith.add(t.getJzl(), t.getCzyl())); | ||
| 740 | - cylRepository.save(cyl); | 740 | + if(fgsdm.equals("fgsbm")){ |
| 741 | + repository.save(t); | ||
| 742 | + if(null!=cyl){ | ||
| 743 | + cyl.setCyl(Arith.add(t.getJzl(), t.getCzyl())); | ||
| 744 | + cylRepository.save(cyl); | ||
| 745 | + } | ||
| 741 | } | 746 | } |
| 742 | } | 747 | } |
| 743 | } | 748 | } |
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
| @@ -9,6 +9,9 @@ import java.util.HashMap; | @@ -9,6 +9,9 @@ import java.util.HashMap; | ||
| 9 | import java.util.List; | 9 | import java.util.List; |
| 10 | import java.util.Map; | 10 | import java.util.Map; |
| 11 | 11 | ||
| 12 | +import javax.transaction.Transactional; | ||
| 13 | + | ||
| 14 | +import org.apache.commons.lang3.StringEscapeUtils; | ||
| 12 | import org.slf4j.Logger; | 15 | import org.slf4j.Logger; |
| 13 | import org.slf4j.LoggerFactory; | 16 | import org.slf4j.LoggerFactory; |
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -16,6 +19,8 @@ import org.springframework.jdbc.core.JdbcTemplate; | @@ -16,6 +19,8 @@ import org.springframework.jdbc.core.JdbcTemplate; | ||
| 16 | import org.springframework.jdbc.core.RowMapper; | 19 | import org.springframework.jdbc.core.RowMapper; |
| 17 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
| 18 | 21 | ||
| 22 | +import com.alibaba.fastjson.JSONArray; | ||
| 23 | +import com.alibaba.fastjson.JSONObject; | ||
| 19 | import com.bsth.common.ResponseCode; | 24 | import com.bsth.common.ResponseCode; |
| 20 | import com.bsth.entity.excep.Offline; | 25 | import com.bsth.entity.excep.Offline; |
| 21 | import com.bsth.entity.oil.Ylb; | 26 | import com.bsth.entity.oil.Ylb; |
| @@ -44,12 +49,27 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | @@ -44,12 +49,27 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | ||
| 44 | String rq=map.get("yyrq").toString(); | 49 | String rq=map.get("yyrq").toString(); |
| 45 | String gsdm=map.get("gsdm_like").toString(); | 50 | String gsdm=map.get("gsdm_like").toString(); |
| 46 | String fgsdm=map.get("fgsdm_like").toString(); | 51 | String fgsdm=map.get("fgsdm_like").toString(); |
| 47 | - | 52 | + /* |
| 48 | String sql=" select x.*,y.jsy as ldgh,y.fgsdm as fgsdm from bsth_c_ylxxb x " | 53 | String sql=" select x.*,y.jsy as ldgh,y.fgsdm as fgsdm from bsth_c_ylxxb x " |
| 49 | + " left join bsth_c_ylb y on x.nbbm = y.nbbm and x.jsy !=y.jsy " | 54 | + " left join bsth_c_ylb y on x.nbbm = y.nbbm and x.jsy !=y.jsy " |
| 50 | + " where DATE_FORMAT(y.rq,'%Y-%m-%d')='"+rq+"' and y.ssgsdm='"+gsdm+"' " | 55 | + " where DATE_FORMAT(y.rq,'%Y-%m-%d')='"+rq+"' and y.ssgsdm='"+gsdm+"' " |
| 51 | + " and y.fgsdm='"+fgsdm+"' and DATE_FORMAT(x.yyrq,'%Y-%m-%d')='"+rq+"' " | 56 | + " and y.fgsdm='"+fgsdm+"' and DATE_FORMAT(x.yyrq,'%Y-%m-%d')='"+rq+"' " |
| 52 | - + " and x.gsdm='"+gsdm+"'"; | 57 | + + " and x.gsdm='"+gsdm+"'";*/ |
| 58 | + | ||
| 59 | + String sql= "select v.*,u.jsy as ldgh from " | ||
| 60 | + + " ( select * from bsth_c_ylxxb x where " | ||
| 61 | + + " DATE_FORMAT(x.yyrq,'%Y-%m-%d')='"+rq+"' and x.gsdm='"+gsdm+"'" | ||
| 62 | + + " and x.jsy not in (" | ||
| 63 | + + " select jsy from bsth_c_ylb " | ||
| 64 | + + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"' " | ||
| 65 | + + " and ssgsdm='"+gsdm+"' and fgsdm='"+fgsdm+"')" | ||
| 66 | + + " and x.nbbm in (select nbbm from bsth_c_ylb " | ||
| 67 | + + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"' " | ||
| 68 | + + " and ssgsdm='"+gsdm+"' and fgsdm='"+fgsdm+"' )) v " | ||
| 69 | + + " left join (select * from bsth_c_ylb " | ||
| 70 | + + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"'" | ||
| 71 | + + " and ssgsdm='"+gsdm+"' and fgsdm='"+fgsdm+"' ) u " | ||
| 72 | + + " on v.nbbm=u.nbbm "; | ||
| 53 | 73 | ||
| 54 | //根具条件查询指定日期Ylxxb的数据 | 74 | //根具条件查询指定日期Ylxxb的数据 |
| 55 | // List<Ylxxb> iterator=repository.checkYlxx(rq,gsdm); | 75 | // List<Ylxxb> iterator=repository.checkYlxx(rq,gsdm); |
| @@ -114,21 +134,33 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | @@ -114,21 +134,33 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | ||
| 114 | pageObject.setDataList(list); | 134 | pageObject.setDataList(list); |
| 115 | return pageObject; | 135 | return pageObject; |
| 116 | } | 136 | } |
| 117 | - | 137 | + @Transactional |
| 118 | @Override | 138 | @Override |
| 119 | - public Map<String, Object> checkJsy(Map<String, Object> map) { | 139 | + public Map<String, Object> checkJsy(Map<String, Object> map) throws Exception{ |
| 120 | Map<String, Object> newMap=new HashMap<String,Object>(); | 140 | Map<String, Object> newMap=new HashMap<String,Object>(); |
| 121 | // TODO Auto-generated method stub | 141 | // TODO Auto-generated method stub |
| 122 | try { | 142 | try { |
| 123 | - int id=Integer.parseInt(map.get("id").toString()); | ||
| 124 | - String jsy=map.get("jsy").toString(); | ||
| 125 | - Ylxxb ylxxb=repository.findOne(id); | ||
| 126 | - ylxxb.setJsy(jsy); | ||
| 127 | - repository.save(ylxxb); | 143 | +// int id=Integer.parseInt(map.get("id").toString()); |
| 144 | +// String jsy=map.get("jsy").toString(); | ||
| 145 | +// Ylxxb ylxxb=repository.findOne(id); | ||
| 146 | +// ylxxb.setJsy(jsy); | ||
| 147 | +// repository.save(ylxxb); | ||
| 148 | + String json =StringEscapeUtils.unescapeHtml4(map.get("ylbList").toString()); | ||
| 149 | + JSONArray jsonArray=JSONArray.parseArray(json); | ||
| 150 | + JSONObject jsonObject; | ||
| 151 | + for (int x = 0; x < jsonArray.size(); x++) { | ||
| 152 | + jsonObject=jsonArray.getJSONObject(x); | ||
| 153 | + Integer id =jsonObject.getInteger("id"); | ||
| 154 | + String jsy =jsonObject.getString("jsy"); | ||
| 155 | + Ylxxb ylxxb=repository.findOne(id); | ||
| 156 | + ylxxb.setJsy(jsy); | ||
| 157 | + repository.save(ylxxb); | ||
| 158 | + } | ||
| 128 | newMap.put("status", ResponseCode.SUCCESS); | 159 | newMap.put("status", ResponseCode.SUCCESS); |
| 129 | }catch(Exception e){ | 160 | }catch(Exception e){ |
| 130 | newMap.put("status", ResponseCode.ERROR); | 161 | newMap.put("status", ResponseCode.ERROR); |
| 131 | logger.error("save erro.", e); | 162 | logger.error("save erro.", e); |
| 163 | + throw e; | ||
| 132 | } | 164 | } |
| 133 | return newMap; | 165 | return newMap; |
| 134 | } | 166 | } |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -1579,10 +1579,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1579,10 +1579,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1579 | listSchedule.add(s); | 1579 | listSchedule.add(s); |
| 1580 | //计算营运里程,空驶里程 | 1580 | //计算营运里程,空驶里程 |
| 1581 | if (!childTaskPlans.isEmpty()) { | 1581 | if (!childTaskPlans.isEmpty()) { |
| 1582 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 1583 | - while (it.hasNext()) { | 1582 | +// Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| 1583 | + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans); | ||
| 1584 | + Collections.sort(listit, new ComparableChild()); | ||
| 1585 | + for (int j = 0; j < listit.size(); j++) { | ||
| 1584 | ScheduleRealInfo t = new ScheduleRealInfo(); | 1586 | ScheduleRealInfo t = new ScheduleRealInfo(); |
| 1585 | - ChildTaskPlan childTaskPlan = it.next(); | 1587 | + ChildTaskPlan childTaskPlan = listit.get(j); |
| 1586 | if (childTaskPlan.isDestroy()) { | 1588 | if (childTaskPlan.isDestroy()) { |
| 1587 | t.setFcsjActual(""); | 1589 | t.setFcsjActual(""); |
| 1588 | t.setZdsjActual(""); | 1590 | t.setZdsjActual(""); |
src/main/java/com/bsth/service/report/ReportService.java
| @@ -38,4 +38,6 @@ public interface ReportService { | @@ -38,4 +38,6 @@ public interface ReportService { | ||
| 38 | List<Map<String, Object>> lineList(); | 38 | List<Map<String, Object>> lineList(); |
| 39 | 39 | ||
| 40 | List<Map<String, String>> carList(Map<String, Object> map); | 40 | List<Map<String, String>> carList(Map<String, Object> map); |
| 41 | + | ||
| 42 | + List<Map<String, String>> userList(Map<String, Object> map); | ||
| 41 | } | 43 | } |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| @@ -221,15 +221,29 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -221,15 +221,29 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 221 | if (!(scheduleRealInfo.getBcType().equals("in") | 221 | if (!(scheduleRealInfo.getBcType().equals("in") |
| 222 | || scheduleRealInfo.getBcType().equals("out"))) { | 222 | || scheduleRealInfo.getBcType().equals("out"))) { |
| 223 | if(scheduleRealInfo.isSflj()){ | 223 | if(scheduleRealInfo.isSflj()){ |
| 224 | - String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); | ||
| 225 | - long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 226 | - if(item.equals("zgf")){ | ||
| 227 | - if(fcsj>=zgf1 && fcsj<=zgf2){ | ||
| 228 | - ljbc++; | 224 | + if(item.equals("zgf") || item.equals("wgf")){ |
| 225 | + String time=""; | ||
| 226 | + if(scheduleRealInfo.getFcsjActual()!=null){ | ||
| 227 | + time=scheduleRealInfo.getFcsjActual(); | ||
| 229 | } | 228 | } |
| 230 | - }else if(item.equals("wgf")){ | ||
| 231 | - if(fcsj>=wgf1 && fcsj<=wgf2){ | ||
| 232 | - ljbc++; | 229 | + if(time.equals("")){ |
| 230 | + if(scheduleRealInfo.getDfsj()!=null){ | ||
| 231 | + time=scheduleRealInfo.getDfsj(); | ||
| 232 | + } | ||
| 233 | + } | ||
| 234 | + if(!time.equals("")){ | ||
| 235 | + String[] fcsjStr = time.split(":"); | ||
| 236 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 237 | + | ||
| 238 | + if(item.equals("zgf")){ | ||
| 239 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | ||
| 240 | + ljbc++; | ||
| 241 | + } | ||
| 242 | + }else if(item.equals("wgf")){ | ||
| 243 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | ||
| 244 | + ljbc++; | ||
| 245 | + } | ||
| 246 | + } | ||
| 233 | } | 247 | } |
| 234 | }else{ | 248 | }else{ |
| 235 | ljbc++; | 249 | ljbc++; |
| @@ -327,37 +341,24 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -327,37 +341,24 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 327 | || scheduleRealInfo.getBcType().equals("out"))) { | 341 | || scheduleRealInfo.getBcType().equals("out"))) { |
| 328 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 342 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 329 | if(!scheduleRealInfo.isSflj()){ | 343 | if(!scheduleRealInfo.isSflj()){ |
| 330 | - String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); | ||
| 331 | - long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 332 | - if(childTaskPlans.isEmpty()){ | ||
| 333 | - if(scheduleRealInfo.getStatus()!=-1){ | ||
| 334 | - if(item.equals("zgf")){ | ||
| 335 | - if(fcsj>=zgf1 && fcsj<=zgf2){ | ||
| 336 | - sjbc++; | ||
| 337 | - } | ||
| 338 | - }else if(item.equals("wgf")){ | ||
| 339 | - if(fcsj>=wgf1 && fcsj<=wgf2){ | ||
| 340 | - sjbc++; | ||
| 341 | - } | ||
| 342 | - }else{ | ||
| 343 | - sjbc++; | 344 | + String time=""; |
| 345 | + if(item.equals("zgf") || item.equals("wgf")){ | ||
| 346 | + if(scheduleRealInfo.getFcsjActual()!=null){ | ||
| 347 | + time=scheduleRealInfo.getFcsjActual(); | ||
| 348 | + } | ||
| 349 | + if(time.equals("")){ | ||
| 350 | + if(scheduleRealInfo.getDfsj()!=null){ | ||
| 351 | + time=scheduleRealInfo.getDfsj(); | ||
| 344 | } | 352 | } |
| 345 | - | ||
| 346 | } | 353 | } |
| 347 | }else{ | 354 | }else{ |
| 348 | - if(scheduleRealInfo.getStatus() == -1){ | ||
| 349 | - boolean fage=false; | ||
| 350 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 351 | - if(it.hasNext()){ | ||
| 352 | - ChildTaskPlan childTaskPlan = it.next(); | ||
| 353 | - if(!childTaskPlan.isDestroy()){ | ||
| 354 | - if(childTaskPlan.getMileageType().equals("service")){ | ||
| 355 | - fage=true; | ||
| 356 | - } | ||
| 357 | - } | ||
| 358 | - | ||
| 359 | - } | ||
| 360 | - if(fage){ | 355 | + time=scheduleRealInfo.getFcsj(); |
| 356 | + } | ||
| 357 | + if(!time.equals("")){ | ||
| 358 | + String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); | ||
| 359 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 360 | + if(childTaskPlans.isEmpty()){ | ||
| 361 | + if(scheduleRealInfo.getStatus()!=-1){ | ||
| 361 | if(item.equals("zgf")){ | 362 | if(item.equals("zgf")){ |
| 362 | if(fcsj>=zgf1 && fcsj<=zgf2){ | 363 | if(fcsj>=zgf1 && fcsj<=zgf2){ |
| 363 | sjbc++; | 364 | sjbc++; |
| @@ -369,19 +370,47 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -369,19 +370,47 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 369 | }else{ | 370 | }else{ |
| 370 | sjbc++; | 371 | sjbc++; |
| 371 | } | 372 | } |
| 373 | + | ||
| 372 | } | 374 | } |
| 373 | - | ||
| 374 | }else{ | 375 | }else{ |
| 375 | - if(item.equals("zgf")){ | ||
| 376 | - if(fcsj>=zgf1 && fcsj<=zgf2){ | ||
| 377 | - sjbc++; | 376 | + if(scheduleRealInfo.getStatus() == -1){ |
| 377 | + boolean fage=false; | ||
| 378 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 379 | + if(it.hasNext()){ | ||
| 380 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 381 | + if(!childTaskPlan.isDestroy()){ | ||
| 382 | + if(childTaskPlan.getMileageType().equals("service")){ | ||
| 383 | + fage=true; | ||
| 384 | + } | ||
| 385 | + } | ||
| 386 | + | ||
| 378 | } | 387 | } |
| 379 | - }else if(item.equals("wgf")){ | ||
| 380 | - if(fcsj>=wgf1 && fcsj<=wgf2){ | ||
| 381 | - sjbc++; | 388 | + if(fage){ |
| 389 | + if(item.equals("zgf")){ | ||
| 390 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | ||
| 391 | + sjbc++; | ||
| 392 | + } | ||
| 393 | + }else if(item.equals("wgf")){ | ||
| 394 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | ||
| 395 | + sjbc++; | ||
| 396 | + } | ||
| 397 | + }else{ | ||
| 398 | + sjbc++; | ||
| 399 | + } | ||
| 382 | } | 400 | } |
| 401 | + | ||
| 383 | }else{ | 402 | }else{ |
| 384 | - sjbc++; | 403 | + if(item.equals("zgf")){ |
| 404 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | ||
| 405 | + sjbc++; | ||
| 406 | + } | ||
| 407 | + }else if(item.equals("wgf")){ | ||
| 408 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | ||
| 409 | + sjbc++; | ||
| 410 | + } | ||
| 411 | + }else{ | ||
| 412 | + sjbc++; | ||
| 413 | + } | ||
| 385 | } | 414 | } |
| 386 | } | 415 | } |
| 387 | } | 416 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -25,6 +25,7 @@ import org.springframework.stereotype.Service; | @@ -25,6 +25,7 @@ import org.springframework.stereotype.Service; | ||
| 25 | 25 | ||
| 26 | import com.bsth.data.BasicData; | 26 | import com.bsth.data.BasicData; |
| 27 | import com.bsth.entity.Line; | 27 | import com.bsth.entity.Line; |
| 28 | +import com.bsth.entity.Personnel; | ||
| 28 | import com.bsth.entity.StationRoute; | 29 | import com.bsth.entity.StationRoute; |
| 29 | import com.bsth.entity.excep.ArrivalInfo; | 30 | import com.bsth.entity.excep.ArrivalInfo; |
| 30 | import com.bsth.entity.oil.Ylb; | 31 | import com.bsth.entity.oil.Ylb; |
| @@ -1384,4 +1385,47 @@ public class ReportServiceImpl implements ReportService{ | @@ -1384,4 +1385,47 @@ public class ReportServiceImpl implements ReportService{ | ||
| 1384 | } | 1385 | } |
| 1385 | return list; | 1386 | return list; |
| 1386 | } | 1387 | } |
| 1388 | + | ||
| 1389 | + | ||
| 1390 | + @Override | ||
| 1391 | + public List<Map<String, String>> userList(Map<String, Object> maps) { | ||
| 1392 | + // TODO Auto-generated method stub | ||
| 1393 | + // 转大写 | ||
| 1394 | + String jsy =maps.get("jsy").toString().toUpperCase(); | ||
| 1395 | + String gsbm=maps.get("gsbm").toString().trim(); | ||
| 1396 | +// String fgsbm=maps.get("fgsbm").toString().trim(); | ||
| 1397 | + List<Map<String, String>> list = new ArrayList<Map<String, String>>(); | ||
| 1398 | + Map<String, String> map; | ||
| 1399 | +// Set<String> allSet = BasicData.nbbm2CompanyCodeMap.keySet(); | ||
| 1400 | + Set<String> allJsy = BasicData.jsyMap.keySet(); | ||
| 1401 | + | ||
| 1402 | + Personnel per; | ||
| 1403 | + for (String k : allJsy) { | ||
| 1404 | + if (k.indexOf(jsy) != -1) { | ||
| 1405 | + // 所属线路 | ||
| 1406 | + boolean fage=true; | ||
| 1407 | + map = new HashMap<>(); | ||
| 1408 | + per = BasicData.jsyMap.get(k); | ||
| 1409 | + String rygsdm= per.getCompanyCode(); | ||
| 1410 | + | ||
| 1411 | + map.put("id", k); | ||
| 1412 | + map.put("text", k+"/"+per.getPersonnelName()); | ||
| 1413 | + | ||
| 1414 | + if(!gsbm.equals("")){ | ||
| 1415 | + if(!rygsdm.equals(gsbm)){ | ||
| 1416 | + fage=false; | ||
| 1417 | + } | ||
| 1418 | + } | ||
| 1419 | + | ||
| 1420 | + if(fage){ | ||
| 1421 | + list.add(map); | ||
| 1422 | + } | ||
| 1423 | + | ||
| 1424 | + } | ||
| 1425 | + | ||
| 1426 | + if (list.size() > 20) | ||
| 1427 | + break; | ||
| 1428 | + } | ||
| 1429 | + return list; | ||
| 1430 | + } | ||
| 1387 | } | 1431 | } |
src/main/java/com/bsth/util/ComparableChild.java
0 → 100644
| 1 | +package com.bsth.util; | ||
| 2 | + | ||
| 3 | +import java.util.Comparator; | ||
| 4 | +import java.util.List; | ||
| 5 | + | ||
| 6 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | ||
| 7 | + | ||
| 8 | +public class ComparableChild implements Comparator<ChildTaskPlan>{ | ||
| 9 | + | ||
| 10 | + @Override | ||
| 11 | + public int compare(ChildTaskPlan o1, ChildTaskPlan o2) { | ||
| 12 | + // TODO Auto-generated method stub | ||
| 13 | + return o1.getStartDate().compareTo(o2.getStartDate()); | ||
| 14 | + } | ||
| 15 | + | ||
| 16 | +} |
src/main/resources/application-dev.properties
| @@ -8,7 +8,7 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | @@ -8,7 +8,7 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | ||
| 8 | spring.jpa.database= MYSQL | 8 | spring.jpa.database= MYSQL |
| 9 | spring.jpa.show-sql= true | 9 | spring.jpa.show-sql= true |
| 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | -spring.datasource.url= jdbc:mysql://127.0.0.1:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | 11 | +spring.datasource.url= jdbc:mysql://127.0.0.1:3306/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 12 | spring.datasource.username= root | 12 | spring.datasource.username= root |
| 13 | spring.datasource.password= | 13 | spring.datasource.password= |
| 14 | #DATASOURCE | 14 | #DATASOURCE |
src/main/resources/static/pages/oil/add.html
| @@ -214,6 +214,8 @@ | @@ -214,6 +214,8 @@ | ||
| 214 | } | 214 | } |
| 215 | $('#fgsdm').html(options); | 215 | $('#fgsdm').html(options); |
| 216 | initXl(); | 216 | initXl(); |
| 217 | + selectNbbm(); | ||
| 218 | + selectJsy(); | ||
| 217 | } | 219 | } |
| 218 | $("#fgsdm").on("change",initXl); | 220 | $("#fgsdm").on("change",initXl); |
| 219 | function initXl(){ | 221 | function initXl(){ |
| @@ -238,94 +240,100 @@ | @@ -238,94 +240,100 @@ | ||
| 238 | } | 240 | } |
| 239 | initPinYinSelect2('#xlbm',data,''); | 241 | initPinYinSelect2('#xlbm',data,''); |
| 240 | fage=true; | 242 | fage=true; |
| 243 | + selectNbbm(); | ||
| 244 | + selectJsy(); | ||
| 241 | } | 245 | } |
| 242 | $("#date").datetimepicker({ | 246 | $("#date").datetimepicker({ |
| 243 | format : 'YYYY-MM-DD', | 247 | format : 'YYYY-MM-DD', |
| 244 | locale : 'zh-cn' | 248 | locale : 'zh-cn' |
| 245 | }); | 249 | }); |
| 246 | 250 | ||
| 247 | - $('#nbbm').select2({ | ||
| 248 | - placeholder: '搜索车辆...', | ||
| 249 | - ajax: { | ||
| 250 | - url: '/report/carList', | ||
| 251 | - dataType: 'json', | ||
| 252 | - delay: 150, | ||
| 253 | - data: function(params){ | ||
| 254 | - return{nbbm: params.term, | ||
| 255 | - gsbm:$('#ssgsdm').val(), | ||
| 256 | - fgsbm:$('#fgsdm').val(), | ||
| 257 | - xlbm:$('#xlbm').val()}; | 251 | + function selectNbbm(){ |
| 252 | + $('#nbbm').select2({ | ||
| 253 | + placeholder: '搜索车辆...', | ||
| 254 | + ajax: { | ||
| 255 | + url: '/report/carList', | ||
| 256 | + dataType: 'json', | ||
| 257 | + delay: 150, | ||
| 258 | + data: function(params){ | ||
| 259 | + return{nbbm: params.term, | ||
| 260 | + gsbm:$('#ssgsdm').val(), | ||
| 261 | + fgsbm:$('#fgsdm').val(), | ||
| 262 | + xlbm:$('#xlbm').val()}; | ||
| 263 | + }, | ||
| 264 | + processResults: function (data) { | ||
| 265 | + return { | ||
| 266 | + results: data | ||
| 267 | + }; | ||
| 268 | + }, | ||
| 269 | + cache: true | ||
| 258 | }, | 270 | }, |
| 259 | - processResults: function (data) { | ||
| 260 | - return { | ||
| 261 | - results: data | ||
| 262 | - }; | ||
| 263 | - }, | ||
| 264 | - cache: true | ||
| 265 | - }, | ||
| 266 | - templateResult: function(repo){ | ||
| 267 | - if (repo.loading) return repo.text; | ||
| 268 | - var h = '<span>'+repo.text+'</span>'; | ||
| 269 | - h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | ||
| 270 | - return h; | ||
| 271 | - }, | ||
| 272 | - escapeMarkup: function (markup) { return markup; }, | ||
| 273 | - minimumInputLength: 1, | ||
| 274 | - templateSelection: function(repo){ | ||
| 275 | - return repo.text; | ||
| 276 | - }, | ||
| 277 | - language: { | ||
| 278 | - noResults: function(){ | ||
| 279 | - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 280 | - }, | ||
| 281 | - inputTooShort : function(e) { | ||
| 282 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 283 | - }, | ||
| 284 | - searching : function() { | ||
| 285 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 286 | - } | ||
| 287 | - } | ||
| 288 | - }) | 271 | + templateResult: function(repo){ |
| 272 | + if (repo.loading) return repo.text; | ||
| 273 | + var h = '<span>'+repo.text+'</span>'; | ||
| 274 | + h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | ||
| 275 | + return h; | ||
| 276 | + }, | ||
| 277 | + escapeMarkup: function (markup) { return markup; }, | ||
| 278 | + minimumInputLength: 1, | ||
| 279 | + templateSelection: function(repo){ | ||
| 280 | + return repo.text; | ||
| 281 | + }, | ||
| 282 | + language: { | ||
| 283 | + noResults: function(){ | ||
| 284 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 285 | + }, | ||
| 286 | + inputTooShort : function(e) { | ||
| 287 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 288 | + }, | ||
| 289 | + searching : function() { | ||
| 290 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 291 | + } | ||
| 292 | + } | ||
| 293 | + }) | ||
| 294 | + } | ||
| 289 | 295 | ||
| 290 | 296 | ||
| 291 | - $('#jsy').select2({ | ||
| 292 | - placeholder: '搜索驾驶员...', | ||
| 293 | - ajax: { | ||
| 294 | - url: '/personnel/sreachPersonnel', | ||
| 295 | - dataType: 'json', | ||
| 296 | - delay: 150, | ||
| 297 | - data: function(params){ | ||
| 298 | - return{jobCode: params.term}; | 297 | + function selectJsy(){ |
| 298 | + $('#jsy').select2({ | ||
| 299 | + placeholder: '搜索驾驶员...', | ||
| 300 | + ajax: { | ||
| 301 | + url: '/report/userList', | ||
| 302 | + dataType: 'json', | ||
| 303 | + delay: 150, | ||
| 304 | + data: function(params){ | ||
| 305 | + return{jsy: params.term,gsbm:$('#ssgsdm').val()}; | ||
| 306 | + }, | ||
| 307 | + processResults: function (data) { | ||
| 308 | + return { | ||
| 309 | + results: data | ||
| 310 | + }; | ||
| 311 | + }, | ||
| 312 | + cache: true | ||
| 299 | }, | 313 | }, |
| 300 | - processResults: function (data) { | ||
| 301 | - return { | ||
| 302 | - results: data | ||
| 303 | - }; | ||
| 304 | - }, | ||
| 305 | - cache: true | ||
| 306 | - }, | ||
| 307 | - templateResult: function(repo){ | ||
| 308 | - if (repo.loading) return repo.text; | ||
| 309 | - var h = '<span>'+repo.text+'</span>'; | ||
| 310 | - return h; | ||
| 311 | - }, | ||
| 312 | - escapeMarkup: function (markup) { return markup; }, | ||
| 313 | - minimumInputLength: 1, | ||
| 314 | - templateSelection: function(repo){ | ||
| 315 | - return repo.text; | ||
| 316 | - }, | ||
| 317 | - language: { | ||
| 318 | - noResults: function(){ | ||
| 319 | - return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>'; | ||
| 320 | - }, | ||
| 321 | - inputTooShort : function(e) { | ||
| 322 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>'; | ||
| 323 | - }, | ||
| 324 | - searching : function() { | ||
| 325 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>'; | ||
| 326 | - } | ||
| 327 | - } | ||
| 328 | - }); | 314 | + templateResult: function(repo){ |
| 315 | + if (repo.loading) return repo.text; | ||
| 316 | + var h = '<span>'+repo.text+'</span>'; | ||
| 317 | + return h; | ||
| 318 | + }, | ||
| 319 | + escapeMarkup: function (markup) { return markup; }, | ||
| 320 | + minimumInputLength: 1, | ||
| 321 | + templateSelection: function(repo){ | ||
| 322 | + return repo.text; | ||
| 323 | + }, | ||
| 324 | + language: { | ||
| 325 | + noResults: function(){ | ||
| 326 | + return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>'; | ||
| 327 | + }, | ||
| 328 | + inputTooShort : function(e) { | ||
| 329 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>'; | ||
| 330 | + }, | ||
| 331 | + searching : function() { | ||
| 332 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>'; | ||
| 333 | + } | ||
| 334 | + } | ||
| 335 | + }); | ||
| 336 | + } | ||
| 329 | $(function(){ | 337 | $(function(){ |
| 330 | /* $get('/role/all',null,function(result){ | 338 | /* $get('/role/all',null,function(result){ |
| 331 | $.each(result,function(i,obj){ | 339 | $.each(result,function(i,obj){ |
src/main/resources/static/pages/oil/checkJyryList.html
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | <li><span class="active">加油人员不符</span></li> | 10 | <li><span class="active">加油人员不符</span></li> |
| 11 | </ul> | 11 | </ul> |
| 12 | 12 | ||
| 13 | -<div class="row"> | 13 | +<div class="row" id="ll_jyry_list"> |
| 14 | <div class="col-md-12"> | 14 | <div class="col-md-12"> |
| 15 | <!-- Begin: life time stats --> | 15 | <!-- Begin: life time stats --> |
| 16 | <div class="portlet light portlet-fit portlet-datatable bordered"> | 16 | <div class="portlet light portlet-fit portlet-datatable bordered"> |
| @@ -114,7 +114,7 @@ | @@ -114,7 +114,7 @@ | ||
| 114 | {{each list as obj i}} | 114 | {{each list as obj i}} |
| 115 | <tr> | 115 | <tr> |
| 116 | <td style="vertical-align: middle;"> | 116 | <td style="vertical-align: middle;"> |
| 117 | - <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> | 117 | + <input type="checkbox" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> |
| 118 | </td> | 118 | </td> |
| 119 | <td>{{obj.yyrq}}</td> | 119 | <td>{{obj.yyrq}}</td> |
| 120 | <td> | 120 | <td> |
| @@ -127,9 +127,9 @@ | @@ -127,9 +127,9 @@ | ||
| 127 | {{obj.nbbm}} | 127 | {{obj.nbbm}} |
| 128 | </td> | 128 | </td> |
| 129 | <td> | 129 | <td> |
| 130 | -<select class="form-control" disabled="disabled" name="jsy" id="jsy{{obj.id}}" > | ||
| 131 | - <option selected="selected" value="{{obj.jsy}}">{{obj.jsy}}<option> | ||
| 132 | -</select> | 130 | + <select class="form-control in_carpark_jsy" name="jsy" id="jsy{{obj.id}}" data-id="{{obj.id}}"> |
| 131 | + <option selected="selected" value="{{obj.jsy}}">{{obj.jsy}}<option> | ||
| 132 | + </select> | ||
| 133 | </td> | 133 | </td> |
| 134 | <td> | 134 | <td> |
| 135 | {{obj.jzl}} | 135 | {{obj.jzl}} |
| @@ -137,7 +137,7 @@ | @@ -137,7 +137,7 @@ | ||
| 137 | <td>{{obj.stationid}}</td> | 137 | <td>{{obj.stationid}}</td> |
| 138 | <td>{{obj.nylx}}</td> | 138 | <td>{{obj.nylx}}</td> |
| 139 | <td>{{obj.jyggh}}</td> | 139 | <td>{{obj.jyggh}}</td> |
| 140 | - <td>{{obj.yj}}</td> | 140 | + <td></td> |
| 141 | <td>{{obj.ldgh}}</td> | 141 | <td>{{obj.ldgh}}</td> |
| 142 | <td> | 142 | <td> |
| 143 | {{obj.bz}} | 143 | {{obj.bz}} |
| @@ -150,37 +150,42 @@ | @@ -150,37 +150,42 @@ | ||
| 150 | {{/each}} | 150 | {{/each}} |
| 151 | {{if list.length == 0}} | 151 | {{if list.length == 0}} |
| 152 | <tr> | 152 | <tr> |
| 153 | - <td colspan=13><h6 class="muted">没有找到相关数据</h6></td> | 153 | + <td colspan=14><h6 class="muted">没有找到相关数据</h6></td> |
| 154 | </tr> | 154 | </tr> |
| 155 | {{/if}} | 155 | {{/if}} |
| 156 | </script> | 156 | </script> |
| 157 | <script> | 157 | <script> |
| 158 | $(function(){ | 158 | $(function(){ |
| 159 | $("#saveButton").on('click',function(){ | 159 | $("#saveButton").on('click',function(){ |
| 160 | - var id = $('input.icheck:checked').data('id'); | ||
| 161 | - if(typeof(id)=='undefined'){ | ||
| 162 | - layer.msg("请选择一行数据"); | ||
| 163 | - }else{ | ||
| 164 | - var jsy=$("#jsy"+id).val(); | ||
| 165 | - var params = {}; | ||
| 166 | - params['jsy']=jsy; | ||
| 167 | - params['id']=id; | ||
| 168 | - $get('/ylxxb/check', params, function(){ | ||
| 169 | - var cells = $('tr.filter')[0].cells | ||
| 170 | - ,params1 = {} | ||
| 171 | - ,name; | ||
| 172 | - $.each(cells, function(i, cell){ | ||
| 173 | - var items = $('input,select', cell); | ||
| 174 | - for(var j = 0, item; item = items[j++];){ | ||
| 175 | - name = $(item).attr('name'); | ||
| 176 | - if(name){ | ||
| 177 | - params1[name] = $(item).val(); | ||
| 178 | - } | ||
| 179 | - } | ||
| 180 | - }); | ||
| 181 | - jsDoQuery(params1,true); | ||
| 182 | - }); | ||
| 183 | - } | 160 | + var ylArray = []; |
| 161 | + $('input.icheck').each(function(){ | ||
| 162 | + var map = {}; | ||
| 163 | + var id=$(this).data('id'); | ||
| 164 | + var jsy=$('.in_carpark_jsy[data-id='+id+']', '#ll_jyry_list').val(); | ||
| 165 | + map['id']=id; | ||
| 166 | + map['jsy']=jsy; | ||
| 167 | + ylArray.push(map); | ||
| 168 | + }) | ||
| 169 | + var params = {}; | ||
| 170 | + params['ylbList']=JSON.stringify(ylArray); | ||
| 171 | + console.log(params); | ||
| 172 | + var i = layer.load(2); | ||
| 173 | + $post('/ylxxb/check', params, function(){ | ||
| 174 | + layer.close(i); | ||
| 175 | + var cells = $('tr.filter')[0].cells | ||
| 176 | + ,params1 = {} | ||
| 177 | + ,name; | ||
| 178 | + $.each(cells, function(i, cell){ | ||
| 179 | + var items = $('input,select', cell); | ||
| 180 | + for(var j = 0, item; item = items[j++];){ | ||
| 181 | + name = $(item).attr('name'); | ||
| 182 | + if(name){ | ||
| 183 | + params1[name] = $(item).val(); | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + }); | ||
| 187 | + jsDoQuery(params1,true); | ||
| 188 | + }) | ||
| 184 | }) | 189 | }) |
| 185 | 190 | ||
| 186 | $("#yyrq").datetimepicker({ | 191 | $("#yyrq").datetimepicker({ |
| @@ -189,7 +194,7 @@ $(function(){ | @@ -189,7 +194,7 @@ $(function(){ | ||
| 189 | }); | 194 | }); |
| 190 | var page = 0, initPagination; | 195 | var page = 0, initPagination; |
| 191 | var icheckOptions = { | 196 | var icheckOptions = { |
| 192 | - radioClass: 'iradio_square-blue icheck', | 197 | + radioClass: 'icheckbox_flat-blue icheck', |
| 193 | increaseArea: '20%' | 198 | increaseArea: '20%' |
| 194 | } | 199 | } |
| 195 | //重置 | 200 | //重置 |
| @@ -308,9 +313,8 @@ $(function(){ | @@ -308,9 +313,8 @@ $(function(){ | ||
| 308 | obj.yyrq = moment(obj.yyrq).format("YYYY-MM-DD"); | 313 | obj.yyrq = moment(obj.yyrq).format("YYYY-MM-DD"); |
| 309 | }); | 314 | }); |
| 310 | var bodyHtm = template('check_list_temp', {list: data.dataList}); | 315 | var bodyHtm = template('check_list_temp', {list: data.dataList}); |
| 311 | - $('#datatable_check tbody').html(bodyHtm) | ||
| 312 | - .find('.icheck').iCheck(icheckOptions) | ||
| 313 | - .on('ifChanged', iCheckChange); | 316 | + $('#datatable_check tbody').html(bodyHtm); |
| 317 | + iCheckChange(); | ||
| 314 | if(pagination && data.dataList.length > 0){ | 318 | if(pagination && data.dataList.length > 0){ |
| 315 | //重新分页 | 319 | //重新分页 |
| 316 | initPagination = true; | 320 | initPagination = true; |
| @@ -327,14 +331,15 @@ $(function(){ | @@ -327,14 +331,15 @@ $(function(){ | ||
| 327 | else | 331 | else |
| 328 | tr.removeClass('row-active'); | 332 | tr.removeClass('row-active'); |
| 329 | 333 | ||
| 330 | - var id = $('input.icheck:checked').data('id'); | ||
| 331 | - $("#jsy"+id).attr("disabled", false); | ||
| 332 | - startOptJsy(id); | ||
| 333 | - /* | ||
| 334 | - if($('#datatable_resource input.icheck:checked').length == 1) | 334 | + $('input.icheck').each(function(){ |
| 335 | + var id=$(this).data('id'); | ||
| 336 | + startOptJsy(id); | ||
| 337 | + }) | ||
| 338 | + | ||
| 339 | + /* if($('#datatable_resource input.icheck:checked').length == 1) | ||
| 335 | $('#removeButton').removeAttr('disabled'); | 340 | $('#removeButton').removeAttr('disabled'); |
| 336 | else | 341 | else |
| 337 | - $('#removeButton').attr('disabled', 'disabled'); */ | 342 | + $('#removeButton').attr('disabled', 'disabled'); */ |
| 338 | } | 343 | } |
| 339 | 344 | ||
| 340 | function showPagination(data){ | 345 | function showPagination(data){ |
| @@ -379,11 +384,12 @@ $(function(){ | @@ -379,11 +384,12 @@ $(function(){ | ||
| 379 | $('#jsy'+id).select2({ | 384 | $('#jsy'+id).select2({ |
| 380 | placeholder: '搜索驾驶员...', | 385 | placeholder: '搜索驾驶员...', |
| 381 | ajax: { | 386 | ajax: { |
| 382 | - url: '/personnel/sreachPersonnel', | 387 | + url: '/report/userList', |
| 383 | dataType: 'json', | 388 | dataType: 'json', |
| 384 | delay: 150, | 389 | delay: 150, |
| 385 | data: function(params){ | 390 | data: function(params){ |
| 386 | - return{jobCode: params.term}; | 391 | + return{jsy: params.term, |
| 392 | + gsbm:$('#jyryListGsdmId').val()}; | ||
| 387 | }, | 393 | }, |
| 388 | processResults: function (data) { | 394 | processResults: function (data) { |
| 389 | return { | 395 | return { |
src/main/resources/static/pages/oil/cylAdd.html
| @@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
| 63 | <div class="row"> | 63 | <div class="row"> |
| 64 | <div class="col-md-offset-3 col-md-4"> | 64 | <div class="col-md-offset-3 col-md-4"> |
| 65 | <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | 65 | <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> |
| 66 | - <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> | 66 | + <a type="button" class="btn default" href="cylList.html" data-pjax><i class="fa fa-times"></i> 取消</a> |
| 67 | </div> | 67 | </div> |
| 68 | </div> | 68 | </div> |
| 69 | </div> | 69 | </div> |
src/main/resources/static/pages/oil/jyglList.html
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | <li><span class="active">场外加油管理</span></li> | 12 | <li><span class="active">场外加油管理</span></li> |
| 13 | </ul> | 13 | </ul> |
| 14 | 14 | ||
| 15 | -<div class="row"> | 15 | +<div class="row" id="ll_jygl_list"> |
| 16 | <div class="col-md-12"> | 16 | <div class="col-md-12"> |
| 17 | <!-- Begin: life time stats --> | 17 | <!-- Begin: life time stats --> |
| 18 | <div class="portlet light portlet-fit portlet-datatable bordered"> | 18 | <div class="portlet light portlet-fit portlet-datatable bordered"> |
| @@ -61,15 +61,15 @@ | @@ -61,15 +61,15 @@ | ||
| 61 | <th width="10%">公司</th> | 61 | <th width="10%">公司</th> |
| 62 | <th width="10%">分公司</th> | 62 | <th width="10%">分公司</th> |
| 63 | <th width="8%">车辆</th> | 63 | <th width="8%">车辆</th> |
| 64 | - <th width="8%">驾驶员</th> | ||
| 65 | - <th width="3%">加注量</th> | ||
| 66 | - <th width="3%">加油站</th> | 64 | + <th width="14%">驾驶员</th> |
| 65 | + <th width="5%">加注量</th> | ||
| 66 | + <th width="4%">加油站</th> | ||
| 67 | <th width="3%">加油类型</th> | 67 | <th width="3%">加油类型</th> |
| 68 | <th width="5%">加油工工号</th> | 68 | <th width="5%">加油工工号</th> |
| 69 | <th width="3%">油价</th> | 69 | <th width="3%">油价</th> |
| 70 | <th width="4%">路单工号</th> | 70 | <th width="4%">路单工号</th> |
| 71 | <th width="4%">备注</th> | 71 | <th width="4%">备注</th> |
| 72 | - <th width="19%">操作</th> | 72 | + <th width="10%">操作</th> |
| 73 | </tr> | 73 | </tr> |
| 74 | <tr role="row" class="filter"> | 74 | <tr role="row" class="filter"> |
| 75 | <td></td> | 75 | <td></td> |
| @@ -96,9 +96,6 @@ | @@ -96,9 +96,6 @@ | ||
| 96 | <td> | 96 | <td> |
| 97 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > | 97 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 98 | <i class="fa fa-search"></i> 搜索</button> | 98 | <i class="fa fa-search"></i> 搜索</button> |
| 99 | - | ||
| 100 | - <button class="btn btn-sm red btn-outline filter-cancel"> | ||
| 101 | - <i class="fa fa-times"></i> 重置</button> | ||
| 102 | </td> | 99 | </td> |
| 103 | </tr> | 100 | </tr> |
| 104 | </thead> | 101 | </thead> |
| @@ -117,7 +114,8 @@ | @@ -117,7 +114,8 @@ | ||
| 117 | {{each list as obj i}} | 114 | {{each list as obj i}} |
| 118 | <tr> | 115 | <tr> |
| 119 | <td style="vertical-align: middle;"> | 116 | <td style="vertical-align: middle;"> |
| 120 | - <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.nbbm}}"> | 117 | + <input type="checkbox" name="id" class="group-checkable icheck" data-id="{{obj.nbbm}}"> |
| 118 | + <input type="hidden" value="{{obj.id}}" class="in_carpark_id" data-id="{{obj.nbbm}}"> | ||
| 121 | </td> | 119 | </td> |
| 122 | <td>{{obj.yyrq}}</td> | 120 | <td>{{obj.yyrq}}</td> |
| 123 | <td> | 121 | <td> |
| @@ -130,24 +128,39 @@ | @@ -130,24 +128,39 @@ | ||
| 130 | {{obj.nbbm}} | 128 | {{obj.nbbm}} |
| 131 | </td> | 129 | </td> |
| 132 | <td> | 130 | <td> |
| 133 | -<!--<select class="form-control" disabled="disabled" name="jsy" id="jsy{{obj.nbbm}}" > | ||
| 134 | - <option selected="selected" value="{{obj.jsy}}">{{obj.jsy}}<option> | ||
| 135 | -</select>--> | ||
| 136 | - {{obj.jsy}} | 131 | + <select class="form-control in_carpark_jsy" name="jsy" id="jsy{{obj.id}}" data-id="{{obj.id}}"> |
| 132 | + <option selected="selected" value="{{obj.jsy}}">{{obj.jsy}}<option> | ||
| 133 | + </select> | ||
| 137 | </td> | 134 | </td> |
| 138 | <td> | 135 | <td> |
| 139 | - {{obj.jzl}} | 136 | + |
| 137 | + <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzl" | ||
| 138 | + type="text" value="{{obj.jzl}}" style=" width:45px" | ||
| 139 | +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 140 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 141 | + </td> | ||
| 142 | + <td> | ||
| 143 | + <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_stationid" | ||
| 144 | + type="text" value="{{obj.stationid}}" style=" width:45px" /> | ||
| 145 | + </td> | ||
| 146 | + <td> | ||
| 147 | + <select data-id="{{obj.id}}" class="in_carpark_nylx" style=" width:80px" > | ||
| 148 | + <option value='0' {{if obj.nylx==0}} selected = 'selected' {{/if}}>0号柴油</option> | ||
| 149 | + <option value='1' {{if obj.nylx==1}} selected = 'selected' {{/if}}>负10号柴油</option> | ||
| 150 | + </select> | ||
| 151 | + </td> | ||
| 152 | + <td> | ||
| 153 | + <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jyggh" | ||
| 154 | + type="text" value="{{obj.jyggh}}" style=" width:45px" /> | ||
| 140 | </td> | 155 | </td> |
| 141 | - <td>{{obj.stationid}}</td> | ||
| 142 | - <td>{{obj.nylx}}</td> | ||
| 143 | - <td>{{obj.jyggh}}</td> | ||
| 144 | - <td>{{obj.yj}}</td> | 156 | + <td></td> |
| 145 | <td>{{obj.ldgh}}</td> | 157 | <td>{{obj.ldgh}}</td> |
| 146 | <td> | 158 | <td> |
| 147 | - {{obj.bz}} | 159 | +<input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_bz" |
| 160 | + type="text" value="{{obj.bz}}" style=" width:45px" /> | ||
| 148 | </td> | 161 | </td> |
| 149 | <td> | 162 | <td> |
| 150 | - <a class="btn btn-sm blue btn-outline" onclick="editCyjy('{{obj.nbbm}}')" data-pjax><i class="fa fa-edit"></i> 编辑</a> | 163 | + <!--<a class="btn btn-sm blue btn-outline" onclick="editCyjy('{{obj.nbbm}}')" data-pjax><i class="fa fa-edit"></i> 编辑</a>--> |
| 151 | </td> | 164 | </td> |
| 152 | </tr> | 165 | </tr> |
| 153 | {{/each}} | 166 | {{/each}} |
| @@ -160,33 +173,50 @@ | @@ -160,33 +173,50 @@ | ||
| 160 | <script> | 173 | <script> |
| 161 | $(function(){ | 174 | $(function(){ |
| 162 | $("#saveButton").on('click',function(){ | 175 | $("#saveButton").on('click',function(){ |
| 163 | - var id = $('input.icheck:checked').data('id'); | ||
| 164 | - if(typeof(id)=='undefined'){ | ||
| 165 | - layer.msg("请选择一行数据"); | ||
| 166 | - }else{ | ||
| 167 | - var jsy=$("#jsy"+id).val(); | ||
| 168 | - var params = {}; | ||
| 169 | - params['jsy']=jsy; | ||
| 170 | - params['id']=id; | ||
| 171 | - $get('/ylxxb/check', params, function(){ | ||
| 172 | - if($("#rq").val()!=""){ | ||
| 173 | - var cells = $('tr.filter')[0].cells | ||
| 174 | - ,params = {} | ||
| 175 | - ,name; | ||
| 176 | - $.each(cells, function(i, cell){ | ||
| 177 | - var items = $('input,select', cell); | ||
| 178 | - for(var j = 0, item; item = items[j++];){ | ||
| 179 | - name = $(item).attr('name'); | ||
| 180 | - if(name){ | ||
| 181 | - params[name] = $(item).val(); | ||
| 182 | - } | ||
| 183 | - } | ||
| 184 | - }); | ||
| 185 | - jsDoQuery(params,true); | ||
| 186 | - } | ||
| 187 | - | ||
| 188 | - }); | ||
| 189 | - } | 176 | + var ylArray = []; |
| 177 | + $('input.icheck').each(function(){ | ||
| 178 | + var map = {}; | ||
| 179 | + var nbbm=$(this).data('id'); | ||
| 180 | + var id=$('.in_carpark_id[data-id='+nbbm+']', '#ll_jygl_list').val(); | ||
| 181 | + var jsy=$('.in_carpark_jsy[data-id='+nbbm+']', '#ll_jygl_list').val(); | ||
| 182 | + var jzl=$('.in_carpark_jzl[data-id='+nbbm+']','#ll_jygl_list').val(); | ||
| 183 | + var stationid=$('.in_carpark_stationid[data-id='+nbbm+']','#ll_jygl_list').val(); | ||
| 184 | + var nylx=$('.in_carpark_nylx[data-id='+nbbm+']','#ll_jygl_list').val(); | ||
| 185 | + var jyggh=$('.in_carpark_jyggh[data-id='+nbbm+']','#ll_jygl_list').val(); | ||
| 186 | + var bz=$('.in_carpark_bz[data-id='+nbbm+']','#ll_jygl_list').val(); | ||
| 187 | + map['nbbm']=nbbm; | ||
| 188 | + map['id']=id; | ||
| 189 | + map['jsy']=jsy; | ||
| 190 | + map['jzl']=jzl; | ||
| 191 | + map['stationid']=stationid; | ||
| 192 | + map['nylx']=nylx; | ||
| 193 | + map['jyggh']=jyggh; | ||
| 194 | + map['bz']=bz; | ||
| 195 | + ylArray.push(map); | ||
| 196 | + }) | ||
| 197 | + var params = {}; | ||
| 198 | + params['ylbList']=JSON.stringify(ylArray); | ||
| 199 | + params['gsbm']=$("#jyglListGsdmId").val(); | ||
| 200 | + params['fgsbm']=$("#jyglListFgsdmId").val(); | ||
| 201 | + params['rq']=$("#rq").val(); | ||
| 202 | + console.log(params); | ||
| 203 | + var i = layer.load(2); | ||
| 204 | + $post('/cwjy/savejzl', params, function(){ | ||
| 205 | + layer.close(i); | ||
| 206 | + var cells = $('tr.filter')[0].cells | ||
| 207 | + ,params1 = {} | ||
| 208 | + ,name; | ||
| 209 | + $.each(cells, function(i, cell){ | ||
| 210 | + var items = $('input,select', cell); | ||
| 211 | + for(var j = 0, item; item = items[j++];){ | ||
| 212 | + name = $(item).attr('name'); | ||
| 213 | + if(name){ | ||
| 214 | + params1[name] = $(item).val(); | ||
| 215 | + } | ||
| 216 | + } | ||
| 217 | + }); | ||
| 218 | + jsDoQuery(params1,true); | ||
| 219 | + }) | ||
| 190 | }) | 220 | }) |
| 191 | 221 | ||
| 192 | $("#rq").datetimepicker({ | 222 | $("#rq").datetimepicker({ |
| @@ -195,7 +225,7 @@ $(function(){ | @@ -195,7 +225,7 @@ $(function(){ | ||
| 195 | }); | 225 | }); |
| 196 | var page = 0, initPagination; | 226 | var page = 0, initPagination; |
| 197 | var icheckOptions = { | 227 | var icheckOptions = { |
| 198 | - radioClass: 'iradio_square-blue icheck', | 228 | + radioClass: 'icheckbox_flat-blue', |
| 199 | increaseArea: '20%' | 229 | increaseArea: '20%' |
| 200 | } | 230 | } |
| 201 | 231 | ||
| @@ -306,19 +336,20 @@ $(function(){ | @@ -306,19 +336,20 @@ $(function(){ | ||
| 306 | params['fgsdm_in']=fgsqx1; | 336 | params['fgsdm_in']=fgsqx1; |
| 307 | } | 337 | } |
| 308 | } */ | 338 | } */ |
| 309 | - $get('/cwjy/pagequery' ,params, function(data){ | ||
| 310 | - $.each(data.dataList, function(i, obj) { | 339 | + $get('/cwjy/queryList' ,params, function(data){ |
| 340 | + $.each(data, function(i, obj) { | ||
| 311 | obj.yyrq = $("#rq").val(); | 341 | obj.yyrq = $("#rq").val(); |
| 312 | }); | 342 | }); |
| 313 | - var bodyHtm = template('jygl_list_temp', {list: data.dataList}); | ||
| 314 | - $('#datatable_cwjy tbody').html(bodyHtm) | ||
| 315 | - .find('.icheck').iCheck(icheckOptions) | ||
| 316 | - .on('ifChanged', iCheckChange); | ||
| 317 | - if(pagination && data.dataList.length > 0){ | ||
| 318 | - //重新分页 | ||
| 319 | - initPagination = true; | ||
| 320 | - showPagination(data); | ||
| 321 | - } | 343 | + console.log(data) |
| 344 | + var bodyHtm = template('jygl_list_temp', {list: data}); | ||
| 345 | + $('#datatable_cwjy tbody').html(bodyHtm); | ||
| 346 | +// .find('.icheck').iCheck(icheckOptions) | ||
| 347 | +// .on('ifChanged', iCheckChange); | ||
| 348 | +// if(pagination && data.dataList.length > 0){ | ||
| 349 | +// //重新分页 | ||
| 350 | +// initPagination = true; | ||
| 351 | +// showPagination(data); | ||
| 352 | +// } | ||
| 322 | layer.close(i); | 353 | layer.close(i); |
| 323 | }); | 354 | }); |
| 324 | } | 355 | } |
src/main/resources/static/pages/oil/jyszAdd.html
| @@ -21,14 +21,12 @@ | @@ -21,14 +21,12 @@ | ||
| 21 | <label class="col-md-3 control-label">公司</label> | 21 | <label class="col-md-3 control-label">公司</label> |
| 22 | <div class="col-md-4"> | 22 | <div class="col-md-4"> |
| 23 | <select class="form-control" name="gsdm" id="gsdm" ></select> | 23 | <select class="form-control" name="gsdm" id="gsdm" ></select> |
| 24 | - <span class="help-block"> 公司</span> | ||
| 25 | </div> | 24 | </div> |
| 26 | </div> | 25 | </div> |
| 27 | <div class="form-group" id="fgsdmDivId"> | 26 | <div class="form-group" id="fgsdmDivId"> |
| 28 | <label class="col-md-3 control-label">分公司</label> | 27 | <label class="col-md-3 control-label">分公司</label> |
| 29 | <div class="col-md-4"> | 28 | <div class="col-md-4"> |
| 30 | <select class="form-control" name="fgsdm" id="fgsdm" ></select> | 29 | <select class="form-control" name="fgsdm" id="fgsdm" ></select> |
| 31 | - <span class="help-block"> 分公司</span> | ||
| 32 | </div> | 30 | </div> |
| 33 | </div> | 31 | </div> |
| 34 | <div class="form-group"> | 32 | <div class="form-group"> |