Commit a2c50bdd8b745e8ce21c3454f5a3ad9015b868d7

Authored by 廖磊
1 parent 459611b1

电量

src/main/java/com/bsth/controller/oil/DlbController.java
1 1 package com.bsth.controller.oil;
2 2  
  3 +import java.text.SimpleDateFormat;
  4 +import java.util.ArrayList;
3 5 import java.util.HashMap;
  6 +import java.util.Iterator;
4 7 import java.util.List;
5 8 import java.util.Map;
6 9  
... ... @@ -17,6 +20,7 @@ import com.bsth.controller.BaseController;
17 20 import com.bsth.entity.oil.Dlb;
18 21 import com.bsth.entity.oil.Ylb;
19 22 import com.bsth.service.oil.DlbService;
  23 +import com.bsth.util.ReportUtils;
20 24 import com.google.common.base.Splitter;
21 25  
22 26 @RestController
... ... @@ -124,4 +128,56 @@ public class DlbController extends BaseController<Dlb, Integer>{
124 128 }
125 129 return list;
126 130 }
  131 +
  132 +
  133 + @RequestMapping(value = "/listExport",method = RequestMethod.POST)
  134 + public List<Map<String, Object>> listExport(@RequestParam Map<String, Object> map){
  135 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  136 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  137 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  138 + ReportUtils ee = new ReportUtils();
  139 + List<Dlb> dlb= service.listDlb(map);
  140 +// (new CustomerSpecs<Ylb>(map)).iterator();
  141 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  142 + for (Dlb y : dlb) {
  143 + Map<String, Object> m = new HashMap<String, Object>();
  144 + m.put("rq", y.getRq());
  145 + m.put("gsname",y.getGsname() );
  146 + m.put("xlname", y.getXlname());
  147 + m.put("nbbm", y.getNbbm());
  148 + m.put("jsy", y.getJsy());
  149 + m.put("cdl", y.getCdl());
  150 + m.put("czcd", y.getCzcd()+"%");
  151 + m.put("jzcd", y.getJzcd()+"%");
  152 + m.put("hd", y.getHd());
  153 + String shyy ="无";
  154 + if(y.getShyy()!=null){
  155 + if(shyy.equals("1")){shyy="票务用油";}
  156 + else if(shyy.equals("2")){shyy="保养用油";}
  157 + else if(shyy.equals("3")){shyy="报废车用油";}
  158 + else if(shyy.equals("4")){shyy="其它用油";}
  159 + else if(shyy.equals("5")){shyy="人保部";}
  160 + else if(shyy.equals("6")){shyy="车队";}
  161 + else if(shyy.equals("7")){shyy="车间(高保)";}
  162 + else if(shyy.equals("8")){shyy="车间(小修)";}
  163 + else{shyy ="无";}
  164 + }
  165 + m.put("shyy", shyy);
  166 + m.put("sh", y.getSh());
  167 + m.put("zlc", y.getZlc());
  168 + m.put("bglyh", y.getBglyh());
  169 + resList.add(m);
  170 + }
  171 + try {
  172 + listI.add(resList.iterator());
  173 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  174 + ee.excelReplace(listI, new Object[] { map }, path+"mould/listDl.xls",
  175 + path+"export/"+map.get("rq").toString()+ "进出场存电量.xls");
  176 + } catch (Exception e) {
  177 + e.printStackTrace();
  178 + }
  179 +
  180 + return resList;
  181 +
  182 + }
127 183 }
... ...
src/main/resources/static/pages/electricity/list/list.html
... ... @@ -537,6 +537,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
537 537 }
538 538 $('#ylbListFgsdmId').html(options);
539 539 initXl();
  540 + initCl();
540 541 }
541 542 /*
542 543 * 获取数据 p: 要提交的参数, pagination: 是否重新分页
... ... @@ -750,7 +751,8 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
750 751 // var gsbm=$('#ylbListGsdmId').val(),
751 752 // var fgsbm=$('#ylbListFgsdmId').val(),
752 753 // var xlbm=$('#xlbm').val();
753   -
  754 + $("#xlbm").on("change",initCl);
  755 + function initCl(){
754 756 $('#nbbm').select2({
755 757 placeholder: '搜索车辆...',
756 758 ajax: {
... ... @@ -795,6 +797,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
795 797 }
796 798 }
797 799 });
  800 + }
798 801 // }
799 802  
800 803  
... ... @@ -803,8 +806,8 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
803 806 $("#export").on("click", function () {
804 807 if ($("#rq").val() != "") {
805 808 var params=getParamsList();
806   - $post('/ylb/listExport', params, function (result) {
807   - window.open("/downloadFile/download?fileName="+$("#rq").val()+"进出场存油量" );
  809 + $post('/dlb/listExport', params, function (result) {
  810 + window.open("/downloadFile/download?fileName="+$("#rq").val()+"进出场存电量" );
808 811 });
809 812 } else {
810 813 layer.msg('请选择日期.');
... ...
src/main/resources/static/pages/forms/mould/listDl.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/jobSummary.html
... ... @@ -72,7 +72,7 @@
72 72 </thead>
73 73 <tbody>
74 74  
75   - </tbody>
  75 + </tbody >
76 76 <tr>
77 77 <td>内容</td>
78 78 <td>路牌</td>
... ... @@ -277,7 +277,6 @@
277 277 initPinYinSelect2('#line',data,'');
278 278  
279 279 }) */
280   -
281 280 $("#query").on("click",function(){
282 281 var line=$("#line").val();;
283 282 var lineName=$(".select2-selection__rendered").html();
... ... @@ -302,7 +301,6 @@
302 301 })
303 302  
304 303 $get('/report/jobHzxx',{line:line,date:date},function(result){
305   - console.log(result)
306 304 $("#jhbc").html(result.jhbc);
307 305 $("#sjbc").html(result.sjbc)
308 306 $("#jhgl").html(result.jhgl);
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -570,6 +570,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
570 570 }
571 571 $('#ylbListFgsdmId').html(options);
572 572 initXl();
  573 + initCl();
573 574 }
574 575 /*
575 576 * 获取数据 p: 要提交的参数, pagination: 是否重新分页
... ... @@ -783,51 +784,55 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
783 784 // var gsbm=$('#ylbListGsdmId').val(),
784 785 // var fgsbm=$('#ylbListFgsdmId').val(),
785 786 // var xlbm=$('#xlbm').val();
  787 +
  788 + $("#xlbm").on("change",initCl);
  789 + function initCl(){
  790 + $('#nbbm').select2({
  791 + placeholder: '搜索车辆...',
  792 + ajax: {
  793 + url: '/report/carList',
  794 + dataType: 'json',
  795 + delay: 150,
  796 + data: function (params) {
  797 + return {nbbm: params.term,
  798 + gsbm:$('#ylbListGsdmId').val(),
  799 + fgsbm:$('#ylbListFgsdmId').val(),
  800 + xlbm:$('#xlbm').val()};
  801 + },
  802 + processResults: function (data) {
  803 + return {
  804 + results: data
  805 + };
  806 + },
  807 + cache: true
  808 + },
  809 + templateResult: function (repo) {
  810 + if (repo.loading) return repo.text;
  811 + var h = '<span>' + repo.text + '</span>';
  812 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  813 + return h;
  814 + },
  815 + escapeMarkup: function (markup) {
  816 + return markup;
  817 + },
  818 + minimumInputLength: 1,
  819 + templateSelection: function (repo) {
  820 + return repo.text;
  821 + },
  822 + language: {
  823 + noResults: function () {
  824 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  825 + },
  826 + inputTooShort: function (e) {
  827 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  828 + },
  829 + searching: function () {
  830 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  831 + }
  832 + }
  833 + });
786 834  
787   - $('#nbbm').select2({
788   - placeholder: '搜索车辆...',
789   - ajax: {
790   - url: '/report/carList',
791   - dataType: 'json',
792   - delay: 150,
793   - data: function (params) {
794   - return {nbbm: params.term,
795   - gsbm:$('#ylbListGsdmId').val(),
796   - fgsbm:$('#ylbListFgsdmId').val(),
797   - xlbm:$('#xlbm').val()};
798   - },
799   - processResults: function (data) {
800   - return {
801   - results: data
802   - };
803   - },
804   - cache: true
805   - },
806   - templateResult: function (repo) {
807   - if (repo.loading) return repo.text;
808   - var h = '<span>' + repo.text + '</span>';
809   - h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
810   - return h;
811   - },
812   - escapeMarkup: function (markup) {
813   - return markup;
814   - },
815   - minimumInputLength: 1,
816   - templateSelection: function (repo) {
817   - return repo.text;
818   - },
819   - language: {
820   - noResults: function () {
821   - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
822   - },
823   - inputTooShort: function (e) {
824   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
825   - },
826   - searching: function () {
827   - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
828   - }
829   - }
830   - });
  835 + }
831 836 // }
832 837  
833 838  
... ...