Commit d022d87a5834d0092a781892cd75bf9b1c314a19

Authored by 娄高锋
1 parent b93c22a4

加油量加电量保留三位小数;充电量导入格式变更,不再覆盖,提供详细查询、批量删除功能;

Showing 31 changed files with 1720 additions and 76 deletions
src/main/java/com/bsth/controller/oil/JdlController.java
... ... @@ -2,6 +2,7 @@ package com.bsth.controller.oil;
2 2  
3 3 import java.io.File;
4 4 import java.util.HashMap;
  5 +import java.util.List;
5 6 import java.util.Map;
6 7  
7 8 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -17,6 +18,7 @@ import com.alibaba.fastjson.JSONArray;
17 18 import com.alibaba.fastjson.JSONObject;
18 19 import com.bsth.controller.BaseController;
19 20 import com.bsth.entity.oil.Jdl;
  21 +import com.bsth.entity.oil.JdlReception;
20 22 import com.bsth.service.oil.JdlService;
21 23 import com.google.common.io.Files;
22 24  
... ... @@ -46,9 +48,46 @@ public class JdlController extends BaseController<Jdl, Integer> {
46 48 return "{\"result\":" + "\""+result+"\"}";
47 49 }
48 50  
  51 + /** 24年12月工单更新电量导入 */
  52 + @RequestMapping(value = "/uploadFile_2412",method = RequestMethod.POST)
  53 + public String uploadFile_2412(MultipartFile file, String gsbm_, String gsName,
  54 + String fgsbm_, String fgsName) throws Exception{
  55 + File newFile = new File(
  56 + getDataImportClasspath() + File.separator +
  57 + file.getOriginalFilename());
  58 + Files.write(file.getBytes(), newFile);
  59 + String result = jdlService.importExcel_2412(newFile, gsbm_, gsName, fgsbm_, fgsName);
  60 + return "{\"result\":" + "\""+result+"\"}";
  61 + }
  62 +
49 63 @RequestMapping(value = "/query",method = RequestMethod.GET)
50 64 public Map<String, Object> query(@RequestParam Map<String, Object> map) throws Exception{
51 65 return jdlService.query(map);
52 66 }
53 67  
  68 + @RequestMapping(value = "/query_2412",method = RequestMethod.GET)
  69 + public Map<String, Object> query_2412(@RequestParam Map<String, Object> map) throws Exception{
  70 + return jdlService.query_2412(map);
  71 + }
  72 +
  73 + @RequestMapping(value = "/queryJdlReception",method = RequestMethod.GET)
  74 + public List<JdlReception> queryJdlReception(@RequestParam Map<String, Object> map) throws Exception{
  75 + return jdlService.queryJdlReception(map);
  76 + }
  77 +
  78 + @RequestMapping(value = "/queryJdlReceptionBatch",method = RequestMethod.GET)
  79 + public Map<String, Object> queryJdlReceptionBatch(@RequestParam Map<String, Object> map) throws Exception{
  80 + return jdlService.queryJdlReceptionBatch(map);
  81 + }
  82 +
  83 + @RequestMapping(value = "/queryJdlReceptionBatchData",method = RequestMethod.GET)
  84 + public List<JdlReception> queryJdlReceptionBatchData(@RequestParam Map<String, Object> map) throws Exception{
  85 + return jdlService.queryJdlReceptionBatchData(map);
  86 + }
  87 +
  88 + @RequestMapping(value = "/deleteJdlReceptionBatch",method = RequestMethod.POST)
  89 + public Map<String, Object> deleteJdlReceptionBatch(@RequestParam Map<String, Object> map) throws Exception{
  90 + return jdlService.deleteJdlReceptionBatch(map);
  91 + }
  92 +
54 93 }
... ...
src/main/java/com/bsth/entity/oil/JdlReception.java 0 → 100644
  1 +package com.bsth.entity.oil;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.GenerationType;
  8 +import javax.persistence.Id;
  9 +import javax.persistence.Table;
  10 +
  11 +import org.springframework.format.annotation.DateTimeFormat;
  12 +
  13 +/**
  14 +--------------------------------------------------------
  15 + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  16 + `station_name` varchar(255) DEFAULT NULL COMMENT '站点名称',
  17 + `connector_id` varchar(255) DEFAULT NULL COMMENT '枪编号',
  18 + `order_no` varchar(255) DEFAULT NULL COMMENT '订单编号',
  19 + `start_time` varchar(255) DEFAULT NULL COMMENT '充电开始时间',
  20 + `end_time` varchar(255) DEFAULT NULL COMMENT '充电结束时间',
  21 + `start_soc` double(11,2) DEFAULT NULL COMMENT '开始 SOC(%)',
  22 + `end_soc` double(11,2) DEFAULT NULL COMMENT '结束 SOC(%)',
  23 + `stop_reason` varchar(255) DEFAULT NULL COMMENT '终止原因',
  24 + `charge_capacity` double(11,3) DEFAULT NULL COMMENT '充电量,单位:度',
  25 + `electric_charge` double(11,2) DEFAULT NULL COMMENT '电费,单位:元',
  26 + `service_charge` double(11,2) DEFAULT NULL COMMENT '服务费,单位:元',
  27 + `total_amount` double(11,2) DEFAULT NULL COMMENT '总费用,单位:元',
  28 + `vin_code` varchar(255) DEFAULT NULL COMMENT '卡号',
  29 + `card_no` varchar(255) DEFAULT NULL COMMENT 'VIN,车架号',
  30 + `car_code` varchar(255) DEFAULT NULL COMMENT '车牌号',
  31 + `date_str` varchar(255) DEFAULT NULL COMMENT '营运日期',
  32 + `origin` int(2) NOT NULL DEFAULT '0' COMMENT '数据源(0:接口获取;1:导入)',
  33 + `sum_time` bigint(11) DEFAULT NULL COMMENT '总计充电时间(分钟)',
  34 + `create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
  35 + `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  36 + `update_by` varchar(255) DEFAULT NULL COMMENT '修改人',
  37 + `update_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  38 +*/
  39 +@Entity
  40 +@Table(name = "bsth_c_jdl_reception")
  41 +public class JdlReception {
  42 + @Id
  43 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  44 + private Long id;
  45 + private String stationName;
  46 + private String connectorId;
  47 + private String orderNo;
  48 + private String startTime;
  49 + private String endTime;
  50 + private Double startSoc;
  51 + private Double endSoc;
  52 + private String stopReason;
  53 + private Double chargeCapacity;
  54 + private Double electricCharge;
  55 + private Double serviceCharge;
  56 + private Double totalAmount;
  57 + private String vinCode;
  58 + private String cardNo;
  59 + private String carCode;
  60 + private String dateStr;
  61 + private Integer origin;
  62 + private Integer sumTime;
  63 + private String createBy;
  64 + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
  65 + private Date createDate;
  66 + private String updateBy;
  67 + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
  68 + private Date updateDate;
  69 +
  70 +
  71 + public Long getId() {
  72 + return id;
  73 + }
  74 + public void setId(Long id) {
  75 + this.id = id;
  76 + }
  77 + public String getStationName() {
  78 + return stationName;
  79 + }
  80 + public void setStationName(String stationName) {
  81 + this.stationName = stationName;
  82 + }
  83 + public String getConnectorId() {
  84 + return connectorId;
  85 + }
  86 + public void setConnectorId(String connectorId) {
  87 + this.connectorId = connectorId;
  88 + }
  89 + public String getOrderNo() {
  90 + return orderNo;
  91 + }
  92 + public void setOrderNo(String orderNo) {
  93 + this.orderNo = orderNo;
  94 + }
  95 + public String getStartTime() {
  96 + return startTime;
  97 + }
  98 + public void setStartTime(String startTime) {
  99 + this.startTime = startTime;
  100 + }
  101 + public String getEndTime() {
  102 + return endTime;
  103 + }
  104 + public void setEndTime(String endTime) {
  105 + this.endTime = endTime;
  106 + }
  107 + public Double getStartSoc() {
  108 + return startSoc;
  109 + }
  110 + public void setStartSoc(Double startSoc) {
  111 + this.startSoc = startSoc;
  112 + }
  113 + public Double getEndSoc() {
  114 + return endSoc;
  115 + }
  116 + public void setEndSoc(Double endSoc) {
  117 + this.endSoc = endSoc;
  118 + }
  119 + public String getStopReason() {
  120 + return stopReason;
  121 + }
  122 + public void setStopReason(String stopReason) {
  123 + this.stopReason = stopReason;
  124 + }
  125 + public Double getChargeCapacity() {
  126 + return chargeCapacity;
  127 + }
  128 + public void setChargeCapacity(Double chargeCapacity) {
  129 + this.chargeCapacity = chargeCapacity;
  130 + }
  131 + public Double getElectricCharge() {
  132 + return electricCharge;
  133 + }
  134 + public void setElectricCharge(Double electricCharge) {
  135 + this.electricCharge = electricCharge;
  136 + }
  137 + public Double getServiceCharge() {
  138 + return serviceCharge;
  139 + }
  140 + public void setServiceCharge(Double serviceCharge) {
  141 + this.serviceCharge = serviceCharge;
  142 + }
  143 + public Double getTotalAmount() {
  144 + return totalAmount;
  145 + }
  146 + public void setTotalAmount(Double totalAmount) {
  147 + this.totalAmount = totalAmount;
  148 + }
  149 + public String getVinCode() {
  150 + return vinCode;
  151 + }
  152 + public void setVinCode(String vinCode) {
  153 + this.vinCode = vinCode;
  154 + }
  155 + public String getCardNo() {
  156 + return cardNo;
  157 + }
  158 + public void setCardNo(String cardNo) {
  159 + this.cardNo = cardNo;
  160 + }
  161 + public String getCarCode() {
  162 + return carCode;
  163 + }
  164 + public void setCarCode(String carCode) {
  165 + this.carCode = carCode;
  166 + }
  167 + public String getDateStr() {
  168 + return dateStr;
  169 + }
  170 + public void setDateStr(String dateStr) {
  171 + this.dateStr = dateStr;
  172 + }
  173 + public Integer getOrigin() {
  174 + return origin;
  175 + }
  176 + public void setOrigin(Integer origin) {
  177 + this.origin = origin;
  178 + }
  179 + public Integer getSumTime() {
  180 + return sumTime;
  181 + }
  182 + public void setSumTime(Integer sumTime) {
  183 + this.sumTime = sumTime;
  184 + }
  185 + public String getCreateBy() {
  186 + return createBy;
  187 + }
  188 + public void setCreateBy(String createBy) {
  189 + this.createBy = createBy;
  190 + }
  191 + public Date getCreateDate() {
  192 + return createDate;
  193 + }
  194 + public void setCreateDate(Date createDate) {
  195 + this.createDate = createDate;
  196 + }
  197 + public String getUpdateBy() {
  198 + return updateBy;
  199 + }
  200 + public void setUpdateBy(String updateBy) {
  201 + this.updateBy = updateBy;
  202 + }
  203 + public Date getUpdateDate() {
  204 + return updateDate;
  205 + }
  206 + public void setUpdateDate(Date updateDate) {
  207 + this.updateDate = updateDate;
  208 + }
  209 +
  210 +}
0 211 \ No newline at end of file
... ...
src/main/java/com/bsth/repository/oil/JdlReceptionRepository.java 0 → 100644
  1 +package com.bsth.repository.oil;
  2 +
  3 +import java.util.Date;
  4 +import java.util.List;
  5 +
  6 +import org.springframework.data.jpa.repository.Modifying;
  7 +import org.springframework.data.jpa.repository.Query;
  8 +import org.springframework.stereotype.Repository;
  9 +import org.springframework.transaction.annotation.Transactional;
  10 +
  11 +import com.bsth.entity.oil.JdlReception;
  12 +import com.bsth.repository.BaseRepository;
  13 +
  14 +@Repository
  15 +public interface JdlReceptionRepository extends BaseRepository<JdlReception, Integer>{
  16 +
  17 + @Query(value="SELECT date_str, car_code, sum(CAST(charge_capacity AS DECIMAL(10, 3))) charge_capacity FROM bsth_c_jdl_reception where date_str = ?1 and car_code like %?2% group by date_str, car_code order by date_str" ,nativeQuery=true)
  18 + List<Object[]> querySum(String rq, String nbbm);
  19 +
  20 + @Query(value="SELECT * FROM bsth_c_jdl_reception where date_str = ?1 and car_code like %?2% " ,nativeQuery=true)
  21 + List<JdlReception> query(String rq, String nbbm);
  22 +
  23 + @Query(value="SELECT create_by, DATE_FORMAT(create_date, '%Y-%m-%d %H:%i:%s') create_date FROM bsth_c_jdl_reception where DATE_FORMAT(create_date, '%Y-%m-%d') = ?1 and origin = 1 group by create_by, create_date order by create_date" ,nativeQuery=true)
  24 + List<Object[]> queryBatch(String rq);
  25 +
  26 + @Query(value="SELECT * FROM bsth_c_jdl_reception where create_by = ?1 and DATE_FORMAT(create_date, '%Y-%m-%d %H:%i:%s') = ?2 and origin = 1 " ,nativeQuery=true)
  27 + List<JdlReception> queryBatchData(String createBy, String createDate);
  28 +
  29 + @Modifying
  30 + @Transactional
  31 + @Query(value = "delete JdlReception j where createBy = ?1 and DATE_FORMAT(createDate, '%Y-%m-%d %H:%i:%s') = ?2 and origin = 1")
  32 + void deleteBatch(String createBy, String createDate);
  33 +
  34 +}
... ...
src/main/java/com/bsth/service/oil/JdlService.java
1 1 package com.bsth.service.oil;
2 2  
3 3 import java.io.File;
  4 +import java.util.List;
4 5 import java.util.Map;
5 6  
6 7 import com.bsth.entity.oil.Jdl;
  8 +import com.bsth.entity.oil.JdlReception;
7 9 import com.bsth.service.BaseService;
8 10  
9 11 public interface JdlService extends BaseService<Jdl, Integer> {
10 12  
11 13 public String importExcel(File file, String gsbm_, String gsName, String fgsbm, String fgsName);
  14 +
  15 + /** 24年12月工单更新电量导入 */
  16 + public String importExcel_2412(File file, String gsbm_, String gsName, String fgsbm, String fgsName);
12 17  
13 18 public Map<String, Object> query(Map<String, Object> map);
  19 +
  20 + public Map<String, Object> query_2412(Map<String, Object> map);
  21 +
  22 + public List<JdlReception> queryJdlReception(Map<String, Object> map);
  23 +
  24 + public Map<String, Object> queryJdlReceptionBatch(Map<String, Object> map);
  25 +
  26 + public List<JdlReception> queryJdlReceptionBatchData(Map<String, Object> map);
  27 +
  28 + public Map<String, Object> deleteJdlReceptionBatch(Map<String, Object> map);
  29 +
  30 + /**
  31 + * 查询车辆充电量,以jdl表格式返回
  32 + * @param rq 营运日期
  33 + * @param nbbm 车辆自编号(为‘’时查询全部车辆)
  34 + * @return
  35 + */
  36 + public List<Jdl> queryJdlByJdlReception(String rq, String nbbm);
14 37  
15 38 }
... ...
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
... ... @@ -48,6 +48,7 @@ import com.bsth.repository.CarsRepository;
48 48 import com.bsth.repository.oil.CdlRepository;
49 49 import com.bsth.repository.oil.CylRepository;
50 50 import com.bsth.repository.oil.DlbRepository;
  51 +import com.bsth.repository.oil.JdlReceptionRepository;
51 52 import com.bsth.repository.oil.JdlRepository;
52 53 import com.bsth.repository.oil.NylogRepository;
53 54 import com.bsth.repository.oil.YlbRepository;
... ... @@ -55,6 +56,7 @@ import com.bsth.repository.oil.YlxxbRepository;
55 56 import com.bsth.security.util.SecurityUtils;
56 57 import com.bsth.service.impl.BaseServiceImpl;
57 58 import com.bsth.service.oil.DlbService;
  59 +import com.bsth.service.oil.JdlService;
58 60 import com.bsth.service.realcontrol.ScheduleRealInfoService;
59 61 import com.bsth.util.Arith;
60 62 import com.bsth.util.BatchSaveUtils;
... ... @@ -77,6 +79,8 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
77 79  
78 80 @Autowired
79 81 ScheduleRealInfoService scheduleRealInfoService;
  82 + @Autowired
  83 + JdlService jdlService;
80 84  
81 85 @Autowired
82 86 JdbcTemplate jdbcTemplate;
... ... @@ -91,7 +95,8 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
91 95 Map<String, Boolean> carsMap=new HashMap<String, Boolean>();
92 96 for (int i = 0; i < carsList.size(); i++) {
93 97 Cars c=carsList.get(i);
94   - carsMap.put(c.getInsideCode(), c.getSfdc());
  98 + carsMap.put(c.getInsideCode(), (c.getSfdc()!=null?c.getSfdc():false)
  99 + || (c.getSfmix()!=null?c.getSfmix():false));//电车或油电混合,都可以充电
95 100 }
96 101 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
97 102 Date dNow = new Date(); //当前时间
... ... @@ -104,7 +109,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
104 109 // String rq="2017-11-02";
105 110 String line="";
106 111 //保留两位小数
107   - DecimalFormat df = new DecimalFormat("#.00");
  112 + DecimalFormat df = new DecimalFormat("#.000");
108 113 // TODO Auto-generated method stub
109 114 Map<String, Object> newMap=new HashMap<String,Object>();
110 115 //当天DLB信息
... ... @@ -112,7 +117,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
112 117 //当天YLXXB信息
113 118 List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq,1,"");
114 119 //当天加电信息表
115   - List<Jdl> jdlList=jdlRepository.JdlList(rq);
  120 + List<Jdl> jdlList = jdlService.queryJdlByJdlReception(rq, "");
116 121 //前一天所有车辆最后进场班次信息
117 122 // List<Dlb> dlListBe=repository.obtainYlbefore(rq, "", "", "", "");
118 123 List<Cdl> cdyList=cdlRepository.obtainCdl();
... ... @@ -123,7 +128,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
123 128 boolean sfdc=false;
124 129 Map<String, Object> map=listpb.get(x);
125 130 if (carsMap.get(map.get("clZbh").toString())!=null) {
126   - sfdc= carsMap.get(map.get("clZbh").toString());
  131 + sfdc = carsMap.get(map.get("clZbh").toString());
127 132 }else{
128 133 sfdc=false;
129 134 }
... ... @@ -237,7 +242,8 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
237 242 Map<String, Boolean> carsMap = new HashMap<String, Boolean>();
238 243 for (int i = 0; i < carsList.size(); i++) {
239 244 Cars c = carsList.get(i);
240   - carsMap.put(c.getInsideCode(), c.getSfdc());
  245 + carsMap.put(c.getInsideCode(), (c.getSfdc()!=null?c.getSfdc():false)
  246 + || (c.getSfmix()!=null?c.getSfmix():false));//电车或油电混合,都可以充电
241 247 }
242 248 String rq = map2.get("rq").toString();
243 249 String line = "";
... ... @@ -258,7 +264,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
258 264 }
259 265 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
260 266 // 保留两位小数
261   - DecimalFormat df = new DecimalFormat("#.00");
  267 + DecimalFormat df = new DecimalFormat("#.000");
262 268 // TODO Auto-generated method stub
263 269 // 当天DLB信息
264 270 List<Dlb> dlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm");
... ... @@ -281,8 +287,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
281 287 }
282 288 }
283 289  
284   - List<Jdl> jdlList=jdlRepository.JdlList(rq);
285   - List<Jdl> jdlList_1=jdlRepository.JdlList_1(rq, gsbm, "-1");
  290 + List<Jdl> jdlList = jdlService.queryJdlByJdlReception(rq, "");
286 291 String sxtj=map2.get("sxtj").toString();
287 292 if(sxtj.equals("0")){
288 293 listpb=listpbs;
... ... @@ -360,41 +365,15 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
360 365 //车辆总里程
361 366 double zlc =lcMap.get(map_.get("clZbh").toString());
362 367 //车辆总加电量
363   - double zjzl = 0.0, zjzl_1 = 0.0;
364   - for (int j = 0; j < ylxxList.size(); j++) {
365   - Ylxxb ylxxb = ylxxList.get(j);
366   - if (map_.get("clZbh").toString().equals(ylxxb.getNbbm())
367   - && map_.get("company").toString().equals(ylxxb.getGsdm())) {
368   - zjzl = Arith.add(zjzl, ylxxb.getJzl());
369   - }
370   - }
  368 + double zjzl = 0.0;
  369 + // 2022年12月20号要求不按车队导入,这之后导入的加注量将覆盖原加注量
371 370 for (int i = 0; i < jdlList.size(); i++) {
372 371 Jdl jdl=jdlList.get(i);
373   - if(map_.get("clZbh").toString().equals(jdl.getNbbm())
374   - &&clFgs.get(map_.get("clZbh").toString()).contains(jdl.getGsBm()+"_"+jdl.getFgsBm())){
375   - zjzl = Arith.add(zjzl,jdl.getJdl());
376   - }
377   - }
378   - int num = 0; // 2022年12月20号要求不按车队导入,这之后导入的加注量将覆盖原加注量
379   - for (int i = 0; i < jdlList_1.size(); i++) {
380   - Jdl jdl=jdlList_1.get(i);
381   - if(map_.get("clZbh").toString().equals(jdl.getNbbm())
382   - &&map_.get("company").toString().equals(jdl.getGsBm())){
383   - zjzl_1 = Arith.add(zjzl_1,jdl.getJdl());
384   - num++;
  372 + if(map_.get("clZbh").toString().equals(jdl.getNbbm())){
  373 + zjzl = Arith.add(zjzl, jdl.getJdl());
385 374 }
386 375 }
387   - if(num > 0){
388   - zjzl = zjzl_1;
389   - }
390 376  
391   -// double clsh=0.0;
392   -// if(shMap.get(map_.get("clZbh").toString())==null){
393   -// clsh=0.0;
394   -// }else{
395   -// clsh=shMap.get(map_.get("clZbh").toString());
396   -// }
397   -// zjzl =Arith.sub(zjzl, clsh);
398 377 Double nextJzyl = 0.0;
399 378 for (int i = 0; i < listpb.size(); i++) {
400 379 Map<String, Object> map = listpb.get(i);
... ... @@ -1076,7 +1055,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
1076 1055 Map<String, List<Dlb>> mapList=new HashMap<String,List<Dlb>>();
1077 1056 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
1078 1057 // 保留两位小数
1079   - DecimalFormat df = new DecimalFormat("#.00");
  1058 + DecimalFormat df = new DecimalFormat("#.000");
1080 1059 List<Dlb> dlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm");
1081 1060 List<Dlb> dlbList_upd=new ArrayList<Dlb>();
1082 1061 List<Dlb> dlbList_del=new ArrayList<Dlb>();
... ... @@ -1132,7 +1111,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
1132 1111 shMap.put(cl, Arith.add(sh, dlb.getSh()));
1133 1112 }
1134 1113 }
1135   - List<Jdl> jdlList=jdlRepository.JdlList(date);
  1114 + List<Jdl> jdlList = jdlService.queryJdlByJdlReception(date, "");
1136 1115 List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(date, 0,gsdm);
1137 1116 Map<String, Object> newMap_=new HashMap<String,Object>();
1138 1117 Map<String, Object> cMap=new HashMap<String, Object>();
... ... @@ -1148,19 +1127,10 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
1148 1127 double zlc =lcMap.get(map_.get("clZbh").toString());
1149 1128 //车辆总加电量
1150 1129 double zjzl = 0.0;
1151   - for (int j = 0; j < ylxxList.size(); j++) {
1152   - Ylxxb ylxxb = ylxxList.get(j);
1153   - if (map_.get("clZbh").toString().equals(ylxxb.getNbbm())
1154   - && map_.get("company").toString().equals(ylxxb.getGsdm())) {
1155   - zjzl = Arith.add(zjzl, ylxxb.getJzl());
1156   - }
1157   - }
1158 1130 for (int i = 0; i < jdlList.size(); i++) {
1159 1131 Jdl jdl=jdlList.get(i);
1160   - if(map_.get("clZbh").toString().equals(jdl.getNbbm())
1161   - &&map_.get("company").toString().equals(jdl.getGsBm())
1162   - &&map_.get("bCompany").toString().equals(jdl.getFgsBm())){
1163   - zjzl = Arith.add(zjzl,jdl.getJdl());
  1132 + if(map_.get("clZbh").toString().equals(jdl.getNbbm())){
  1133 + zjzl = Arith.add(zjzl, jdl.getJdl());
1164 1134 }
1165 1135 }
1166 1136 double clsh=0.0;
... ...
src/main/java/com/bsth/service/oil/impl/JdlServiceImpl.java
... ... @@ -3,6 +3,7 @@ package com.bsth.service.oil.impl;
3 3 import java.io.File;
4 4 import java.io.FileInputStream;
5 5 import java.text.DecimalFormat;
  6 +import java.text.ParseException;
6 7 import java.text.SimpleDateFormat;
7 8 import java.util.ArrayList;
8 9 import java.util.Date;
... ... @@ -19,8 +20,13 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
19 20 import org.springframework.beans.factory.annotation.Autowired;
20 21 import org.springframework.stereotype.Service;
21 22  
  23 +import com.bsth.common.ResponseCode;
22 24 import com.bsth.entity.oil.Jdl;
  25 +import com.bsth.entity.oil.JdlReception;
  26 +import com.bsth.entity.sys.SysUser;
  27 +import com.bsth.repository.oil.JdlReceptionRepository;
23 28 import com.bsth.repository.oil.JdlRepository;
  29 +import com.bsth.security.util.SecurityUtils;
24 30 import com.bsth.service.impl.BaseServiceImpl;
25 31 import com.bsth.service.oil.JdlService;
26 32 import com.bsth.util.ReportUtils;
... ... @@ -30,6 +36,9 @@ public class JdlServiceImpl extends BaseServiceImpl&lt;Jdl, Integer&gt; implements Jdl
30 36  
31 37 @Autowired
32 38 JdlRepository repository;
  39 +
  40 + @Autowired
  41 + JdlReceptionRepository jdlReceptionRepository;
33 42  
34 43 @Override
35 44 public String importExcel(File file, String gsbm, String gsName, String fgsbm, String fgsName) {
... ... @@ -156,5 +165,240 @@ public class JdlServiceImpl extends BaseServiceImpl&lt;Jdl, Integer&gt; implements Jdl
156 165 }
157 166 return modelMap;
158 167 }
  168 +
  169 + @Override
  170 + public String importExcel_2412(File file, String gsbm, String gsName, String fgsbm, String fgsName) {
  171 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  172 + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  173 + SimpleDateFormat ddFormat = new SimpleDateFormat("dd");
  174 + DecimalFormat df = new DecimalFormat("######0.00");
  175 + SysUser user = SecurityUtils.getCurrentUser();
  176 + Date currDate = new Date();
  177 + List<String> textList = new ArrayList<String>();
  178 + try {
  179 + POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(file));
  180 + HSSFWorkbook wb = new HSSFWorkbook(fs);
  181 + HSSFSheet sheet = wb.getSheetAt(0);
  182 + // 取得总行数
  183 + int rowNum = sheet.getLastRowNum() + 1;
  184 + // 取得总列数
  185 + int cellNum = sheet.getRow(0).getLastCellNum();
  186 + HSSFRow row = null;
  187 + HSSFCell cell = null;
  188 + for(int i = 3; i < rowNum; i++){
  189 + row = sheet.getRow(i);
  190 + if (row == null){
  191 + continue;
  192 + }
  193 + String text = "";
  194 + for(int j = 0; j < cellNum; j++){
  195 + cell = row.getCell(j);
  196 + if(cell == null){
  197 + text += ",";
  198 + continue;
  199 + }
  200 + text += String.valueOf(cell) + ",";
  201 + }
  202 + String[] split = (text+";").split(",");
  203 + String str = "";
  204 + for(int j = 0; j < split.length && j < 12; j++){
  205 + str += split[j];
  206 + }
  207 + if(str.trim().length() == 0)
  208 + continue;
  209 + textList.add(text + ";");
  210 + }
  211 + List<JdlReception> list = new ArrayList<JdlReception>();
  212 + for(int i = 0; i < textList.size(); i++){
  213 + String text = textList.get(i);
  214 + String[] split = text.split(",");
  215 + if(split[1] != null && split[1].trim().length() > 0){
  216 + Integer dd = Integer.valueOf(split[1].trim().split("\\.")[0]); // 日期
  217 + String zh = split[2].trim(); // 桩号
  218 + String nbbm = split[3].trim(); // 车号
  219 + String startTime = split[4].trim(); // 开始时间
  220 + String endTime = split[5].trim(); // 结束时间
  221 + String sumTime = split[6].trim(); // 总计(分钟)
  222 + String startSoc = split[7].trim(); // 起始电量SOC%
  223 + String endSoc = split[8].trim(); // 结束电量SOC%
  224 + String jdl = split[9].trim(); // 充电度数
  225 + String lc = split[10].trim(); // 里程度数
  226 + String stopReason = split[11].trim(); // 一次不能正常充电记录
  227 + JdlReception jdlRe = new JdlReception();
  228 + Date date = sd.parse(startTime);
  229 + if(!(dd == Integer.valueOf(ddFormat.format(date)))){
  230 + date.setTime(date.getTime() - 1l*1000*60*60*24);
  231 + }
  232 + jdlRe.setDateStr(sdf.format(date));
  233 + jdlRe.setConnectorId(zh);
  234 + jdlRe.setCarCode(nbbm);
  235 + jdlRe.setStartTime(startTime);
  236 + jdlRe.setEndTime(endTime);
  237 + jdlRe.setSumTime(Integer.valueOf(sumTime.split("\\.")[0]));
  238 + jdlRe.setStartSoc(Double.valueOf(startSoc));
  239 + jdlRe.setEndSoc(Double.valueOf(endSoc));
  240 + jdlRe.setChargeCapacity(Double.valueOf(jdl));
  241 + jdlRe.setStopReason(stopReason);
  242 + jdlRe.setCreateBy(user.getUserName());
  243 + jdlRe.setCreateDate(currDate);
  244 + jdlRe.setOrigin(1);
  245 + list.add(jdlRe);
  246 + }
  247 + }
  248 + jdlReceptionRepository.saveAll(list);
  249 + wb.close();
  250 + fs.close();
  251 + } catch (Exception e) {
  252 + // TODO Auto-generated catch block
  253 + e.printStackTrace();
  254 + return "文件导入失败";
  255 + } finally {
  256 + file.delete();
  257 + }
  258 + return "文件导入成功";
  259 + }
  260 +
  261 + @Override
  262 + public Map<String, Object> query_2412(Map<String, Object> map) {
  263 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  264 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  265 + Map<String, Object> modelMap = new HashMap<String, Object>();
  266 + String rq = map.get("rq").toString();
  267 + String nbbm = map.get("nbbm").toString();
  268 + Integer page = Integer.valueOf(map.containsKey("page")?map.get("page").toString():"0");
  269 + List<Jdl> query = new ArrayList<Jdl>();
  270 +
  271 + List<Object[]> querySum = jdlReceptionRepository.querySum(rq, nbbm);
  272 +
  273 + try {
  274 + for(Object[] j : querySum){
  275 + Jdl jdl = new Jdl();
  276 + jdl.setRq(sdfMonth.parse(j[0].toString()));
  277 + jdl.setNbbm(j[1].toString());
  278 + jdl.setJdl(Double.valueOf(j[2].toString()));
  279 + jdl.setJdz("");
  280 + jdl.setRemarks("");
  281 + query.add(jdl);
  282 + }
  283 + } catch (Exception e) {
  284 + // TODO Auto-generated catch block
  285 + e.printStackTrace();
  286 + }
  287 +
  288 + if(!map.containsKey("type")){
  289 +
  290 + int end = (page+1)*10>query.size()?query.size():(page+1)*10;
  291 + modelMap.put("dataList", query.subList(page*10, end));
  292 + modelMap.put("totalPages", query.size()%10>0?query.size()/10+1:query.size()/10);
  293 +
  294 + } else if(map.get("type").toString().equals("export")){
  295 +
  296 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  297 + for(Jdl jdl : query){
  298 + Map<String, Object> m = new HashMap<String, Object>();
  299 + m.put("rq", sdfMonth.format(jdl.getRq()));
  300 + m.put("nbbm", jdl.getNbbm());
  301 + m.put("jdl", jdl.getJdl());
  302 + m.put("jdz", jdl.getJdz());
  303 + m.put("remarks", jdl.getRemarks());
  304 + list.add(m);
  305 + }
  306 +
  307 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  308 + Map<String, Object> m = new HashMap<String, Object>();
  309 + ReportUtils ee = new ReportUtils();
  310 + try {
  311 + listI.add(list.iterator());
  312 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  313 + ee.excelReplace(listI, new Object[] { m }, path+"mould/export_Jdl.xls",
  314 + path+"export/车辆充电量" + sdfSimple.format(sdfMonth.parse(rq)) + ".xls");
  315 + } catch (Exception e) {
  316 + // TODO: handle exception
  317 + e.printStackTrace();
  318 + }
  319 + }
  320 + return modelMap;
  321 + }
  322 +
  323 + @Override
  324 + public List<JdlReception> queryJdlReception(Map<String, Object> map) {
  325 + String rq = map.get("rq").toString();
  326 + String nbbm = map.get("nbbm").toString();
  327 + List<JdlReception> query = jdlReceptionRepository.query(rq, nbbm);
  328 + return query;
  329 + }
  330 +
  331 + @Override
  332 + public Map<String, Object> queryJdlReceptionBatch(Map<String, Object> map) {
  333 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd");
  334 + Map<String, Object> modelMap = new HashMap<String, Object>();
  335 + String rq = map.get("rq").toString();
  336 + Integer page = Integer.valueOf(map.containsKey("page")?map.get("page").toString():"0");
  337 + List<Map<String, Object>> query = new ArrayList<Map<String, Object>>();
  338 +
  339 + List<Object[]> queryBatch = jdlReceptionRepository.queryBatch(rq);
  340 +
  341 + try {
  342 + for(Object[] j : queryBatch){
  343 + Map<String, Object> m = new HashMap<String, Object>();
  344 + m.put("createBy", j[0]);
  345 + m.put("createDate", j[1]);
  346 + query.add(m);
  347 + }
  348 + } catch (Exception e) {
  349 + // TODO Auto-generated catch block
  350 + e.printStackTrace();
  351 + }
  352 +
  353 + int end = (page+1)*10>query.size()?query.size():(page+1)*10;
  354 + modelMap.put("dataList", query.subList(page*10, end));
  355 + modelMap.put("totalPages", query.size()%10>0?query.size()/10+1:query.size()/10);
  356 +
  357 + return modelMap;
  358 + }
  359 +
  360 + @Override
  361 + public List<JdlReception> queryJdlReceptionBatchData(Map<String, Object> map) {
  362 + String createBy = map.get("createBy").toString();
  363 + String createDate = map.get("createDate").toString();
  364 + List<JdlReception> query = jdlReceptionRepository.queryBatchData(createBy, createDate);
  365 + return query;
  366 + }
  367 +
  368 + @Override
  369 + public Map<String, Object> deleteJdlReceptionBatch(Map<String, Object> map) {
  370 + Map<String, Object> resMap = new HashMap<>();
  371 + try{
  372 + String createBy = map.get("createBy").toString();
  373 + String createDate = map.get("createDate").toString();
  374 + jdlReceptionRepository.deleteBatch(createBy, createDate);
  375 + resMap.put("status", ResponseCode.SUCCESS);
  376 + }catch (Exception e){
  377 + resMap.put("status", ResponseCode.ERROR);
  378 + resMap.put("msg", e.getMessage());
  379 + }
  380 + return resMap;
  381 + }
  382 +
  383 + @Override
  384 + public List<Jdl> queryJdlByJdlReception(String rq, String nbbm) {
  385 + List<Jdl> list = new ArrayList<Jdl>();
  386 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  387 + List<JdlReception> query = jdlReceptionRepository.query(rq, nbbm);
  388 + for(JdlReception jr : query){
  389 + try {
  390 + Jdl jdl = new Jdl();
  391 + jdl.setFgsBm("-1");
  392 + jdl.setRq(sdf.parse(jr.getDateStr()));
  393 + jdl.setJdl(jr.getChargeCapacity());
  394 + jdl.setNbbm(jr.getCarCode());
  395 + list.add(jdl);
  396 + } catch (Exception e) {
  397 + // TODO Auto-generated catch block
  398 + e.printStackTrace();
  399 + }
  400 + }
  401 + return list;
  402 + }
159 403  
160 404 }
... ...
src/main/java/com/bsth/service/oil/impl/QlbServiceImpl.java
... ... @@ -91,7 +91,7 @@ public class QlbServiceImpl extends BaseServiceImpl&lt;Qlb,Integer&gt; implements QlbS
91 91 // String rq="2017-11-02";
92 92 String line="";
93 93 //保留两位小数
94   - DecimalFormat df = new DecimalFormat("#.00");
  94 + DecimalFormat df = new DecimalFormat("#.000");
95 95 // TODO Auto-generated method stub
96 96 Map<String, Object> newMap=new HashMap<String,Object>();
97 97 //当天QLB信息
... ... @@ -229,7 +229,7 @@ public class QlbServiceImpl extends BaseServiceImpl&lt;Qlb,Integer&gt; implements QlbS
229 229 }
230 230 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
231 231 // 保留两位小数
232   - DecimalFormat df = new DecimalFormat("#.00");
  232 + DecimalFormat df = new DecimalFormat("#.000");
233 233 // TODO Auto-generated method stub
234 234 // 当天QLB信息
235 235 List<Qlb> qlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm");
... ... @@ -1020,7 +1020,7 @@ public class QlbServiceImpl extends BaseServiceImpl&lt;Qlb,Integer&gt; implements QlbS
1020 1020 Map<String, List<Qlb>> mapList=new HashMap<String,List<Qlb>>();
1021 1021 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
1022 1022 // 保留两位小数
1023   - DecimalFormat df = new DecimalFormat("#.00");
  1023 + DecimalFormat df = new DecimalFormat("#.000");
1024 1024 List<Qlb> qlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm");
1025 1025 List<Qlb> qlbList_upd=new ArrayList<Qlb>();
1026 1026 List<Qlb> qlbList_del=new ArrayList<Qlb>();
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -120,7 +120,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
120 120 dBefore = calendar.getTime(); //得到前一天的时间
121 121 String rq=sdf.format(dBefore);
122 122 //保留两位小数
123   - DecimalFormat df = new DecimalFormat("#.00");
  123 + DecimalFormat df = new DecimalFormat("#.000");
124 124 // TODO Auto-generated method stub
125 125 Map<String, Object> newMap=new HashMap<String,Object>();
126 126 //当天YLB信息
... ... @@ -270,7 +270,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
270 270 }
271 271 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
272 272 // 保留两位小数
273   - DecimalFormat df = new DecimalFormat("#.00");
  273 + DecimalFormat df = new DecimalFormat("#.000");
274 274 // TODO Auto-generated method stub
275 275 // 当天YLB信息
276 276 List<Ylb> ylList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm");
... ... @@ -668,7 +668,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
668 668 }
669 669 // jzl = Arith.sub(jzl, zsh);
670 670 // 保留两位小数
671   - DecimalFormat df = new DecimalFormat("#.00");
  671 + DecimalFormat df = new DecimalFormat("#.000");
672 672 Double zyl = 0.0;
673 673 Double nextJzyl = 0.0;
674 674 // 保存已经计算过的车辆,相同车辆编号的车不在计算
... ... @@ -1481,7 +1481,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1481 1481  
1482 1482 // repository.obtainYl(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"",
1483 1483 // ylb.getNbbm(),"jcsx");
1484   - DecimalFormat df = new DecimalFormat("#.00");
  1484 + DecimalFormat df = new DecimalFormat("#.000");
1485 1485 Double zyl = 0.0;
1486 1486 Double nextJzyl = 0.0;
1487 1487 // 车的,进,出油量及耗油
... ... @@ -1984,7 +1984,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1984 1984 zlc = Arith.add(zlc, Double.valueOf(sumList.get(j)[1].toString()));
1985 1985 }
1986 1986 // 保留两位小数
1987   - DecimalFormat df = new DecimalFormat("#.00");
  1987 + DecimalFormat df = new DecimalFormat("#.000");
1988 1988 Double zyl = 0.0;
1989 1989 Double nextJzyl = 0.0;
1990 1990 for (int j = 0; j < iterator2.size(); j++) {
... ...
src/main/resources/static/pages/electricity/cdl/cdlAdd.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><a href="cylList.html" data-pjax>车辆存电</a> <i class="fa fa-circle"></i></li>
11 11 <li><span class="active">添加存电</span></li>
12 12 </ul>
... ...
src/main/resources/static/pages/electricity/cdl/cdlList.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用点管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><span class="active">车辆存电</span></li>
11 11 </ul>
12 12  
... ...
src/main/resources/static/pages/electricity/jdl/jdlReception.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<!-- <div class="page-head"> -->
  20 +<!-- <div class="page-title" style="margin-left: 20px"> -->
  21 +<!-- <button id="exportList">数据导出</button> -->
  22 +<!-- </div> -->
  23 +<!-- </div> -->
  24 +
  25 +<div class="row" id="jdlReception">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-body">
  29 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px">
  30 + <table class="table table-bordered table-hover table-checkable" id="forms_2">
  31 + <thead>
  32 + <tr>
  33 + <td style="min-width: 170px">桩号、枪号</td>
  34 + <td>车号</td>
  35 + <td>开始时间</td>
  36 + <td>结束时间</td>
  37 + <td>总计(分钟)</td>
  38 + <td>起始电量SOC(%)</td>
  39 + <td>结束电量SOC(%)</td>
  40 + <td>充电度数</td>
  41 + <td>一次不能正常充电记录</td>
  42 + <td>来源</td>
  43 + </tr>
  44 + </thead>
  45 +
  46 + <tbody>
  47 +
  48 + </tbody>
  49 + </table>
  50 + </div>
  51 + </div>
  52 + </div>
  53 + </div>
  54 +</div>
  55 +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script>
  56 +<script>
  57 + $(function(){
  58 + // 关闭左侧栏
  59 + if (!$('body').hasClass('page-sidebar-closed'))
  60 + $('.menu-toggler.sidebar-toggler').click();
  61 + var date = "";
  62 + var nbbm = "";
  63 + $("#jdlReception").on('init', function (e, id) {
  64 + date = id.split(",")[0];
  65 + nbbm = id.split(",")[1];
  66 + var i = layer.load(2);
  67 + $get('/jdl/queryJdlReception',{rq:date,nbbm:nbbm,type:'query'},function(result){
  68 + layer.close(i);
  69 + $.each(result, function(i, e){
  70 +// console.log(e);
  71 + if(e.origin == 1){
  72 + e.originName = "导入";
  73 + } else {
  74 + e.originName = "接口";
  75 + }
  76 + });
  77 + var jdlReception = template('jdlReception_tbody',{list:result});
  78 + $('#forms_2 tbody').html(jdlReception);
  79 + });
  80 + })
  81 + $("#exportList").on('click',function(){
  82 +// var i = layer.load(2);
  83 +// var name="";
  84 +// if(dir=="1"){
  85 +// fileName="发车准点率"+dates;
  86 +// }else{
  87 +// fileName="到站准点率"+dates;
  88 +// }
  89 +// $get('/calcSheet/calcSheet',{line:no,date:dates,dir:dir,type:'export'},function(result){
  90 +// window.open("/downloadFile/download?fileName="+fileName);
  91 +// layer.close(i);
  92 +// });
  93 + });
  94 +
  95 +
  96 + });
  97 +</script>
  98 +<script type="text/html" id="jdlReception_tbody">
  99 + {{each list as obj i}}
  100 + <tr>
  101 + <td>{{obj.connectorId}}</td>
  102 + <td>{{obj.carCode}}</td>
  103 + <td>{{obj.startTime}}</td>
  104 + <td>{{obj.endTime}}</td>
  105 + <td>{{obj.sumTime}}</td>
  106 + <td>{{obj.startSoc}}</td>
  107 + <td>{{obj.endSoc}}</td>
  108 + <td>{{obj.chargeCapacity}}</td>
  109 + <td>{{obj.stopReason}}</td>
  110 + <td>{{obj.originName}}</td>
  111 + </tr>
  112 + {{/each}}
  113 + {{if list.length == 0}}
  114 + <tr>
  115 + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td>
  116 + </tr>
  117 + {{/if}}
  118 +</script>
0 119 \ No newline at end of file
... ...
src/main/resources/static/pages/electricity/jdl/jdlReceptionBatch.html 0 → 100644
  1 +<style>
  2 +.blue{
  3 + background-color: #87CEFF
  4 +}
  5 +</style>
  6 +<div class="page-head">
  7 + <div class="page-title">
  8 + <h1>充电量导入批次</h1>
  9 + </div>
  10 +</div>
  11 +<ul class="page-breadcrumb breadcrumb">
  12 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  13 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
  14 + <li><span class="active">充电量导入批次</span></li>
  15 +</ul>
  16 +
  17 +<div class="row" id="jdlReceptionBatch_list">
  18 + <div class="col-md-12">
  19 + <!-- Begin: life time stats -->
  20 + <div class="portlet light portlet-fit portlet-datatable bordered">
  21 + <div class="portlet-title">
  22 + <div class="caption">
  23 + <i class="fa fa-fire-extinguisher"></i> <span
  24 + class="caption-subject font-dark sbold uppercase">车辆充电量</span>
  25 + </div>
  26 +<!-- <div class="actions"> -->
  27 +<!-- <button type="button" class="btn btn-circle blue" id="upload"><i class="fa fa-file-excel-o"></i> -->
  28 +<!-- 导入Excel -->
  29 +<!-- </button> -->
  30 +<!-- <button type="button" class="btn btn-circle blue" id="export"><i class="fa fa-file-excel-o"></i> -->
  31 +<!-- 导出Excel -->
  32 +<!-- </button> -->
  33 +<!-- </div> -->
  34 + </div>
  35 + <div class="portlet-body">
  36 + <div class="table-container" style="margin-top: 0px">
  37 + <table
  38 + class="table table-striped table-bordered table-hover table-checkable"
  39 + id="datatable_dlb">
  40 + <thead>
  41 + <tr role="row" class="filter">
  42 + <td colspan="2">日期:</td>
  43 + <td colspan="2" width="120px">
  44 + <input type="text" style="width: 100px" name="rq" id="rq"/>
  45 + </td>
  46 + <td width="24%">
  47 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px">
  48 + <i class="fa fa-search"></i> 搜索
  49 + </button>
  50 + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px">
  51 + <i class="fa fa-times"></i> 重置
  52 + </button>
  53 + </td>
  54 + </tr>
  55 + <tr role="row" class="heading">
  56 + <th>#</th>
  57 + <th>导入时间</th>
  58 + <th colspan="2">处理人</th>
  59 + <td colspan="2">操作</td>
  60 + </tr>
  61 + </thead>
  62 + <tbody></tbody>
  63 + </table>
  64 + <div style="text-align: right;">
  65 + <ul id="pagination" class="pagination"></ul>
  66 + </div>
  67 + </div>
  68 + </div>
  69 + <div class="portlet-body">
  70 + <div id="modules_tree"></div>
  71 + </div>
  72 + </div>
  73 + </div>
  74 +</div>
  75 +
  76 +
  77 +<script src="/assets/js/ajaxfileupload/ajaxfileupload.js"></script>
  78 +<script>
  79 + $(function () {
  80 +
  81 + // 关闭左侧栏
  82 + if (!$('body').hasClass('page-sidebar-closed'))
  83 + $('.menu-toggler.sidebar-toggler').click();
  84 +
  85 + $("#rq").datetimepicker({
  86 + format: 'YYYY-MM-DD',
  87 + locale: 'zh-cn'
  88 + });
  89 + var d = new Date();
  90 +// d.setTime(d.getTime() - 1*1000*60*60*24);
  91 + d.setTime(d.getTime());
  92 + var year = d.getFullYear();
  93 + var month = d.getMonth() + 1;
  94 + var day = d.getDate();
  95 + if(month < 10)
  96 + month = "0" + month;
  97 + if(day < 10)
  98 + day = "0" + day;
  99 + $("#rq").val(year + "-" + month + "-" + day);
  100 +
  101 + var page = 0, initPagination;
  102 + var icheckOptions = {
  103 + radioClass: 'iradio_square-blue icheck',
  104 + increaseArea: '20%'
  105 + }
  106 +
  107 + //重置
  108 + $('tr.filter .filter-cancel').on('click', function () {
  109 + $('tr.filter input, select').val('').change();
  110 + });
  111 +
  112 + //提交
  113 + $('tr.filter .filter-submit').on('click', function () {
  114 + if ($("#rq").val() == "" || $("#rq").val() ==null){
  115 + layer.msg('请选择日期.');
  116 + }else {
  117 +
  118 + var params = getParams();
  119 +
  120 + page = 0;
  121 + jsDoQuery(params, true);
  122 + }
  123 + });
  124 +
  125 +
  126 + $.get('/user/companyData', function(result){
  127 + obj = result;
  128 + var options="";
  129 +// = '<option value="">请选择</option>';
  130 + for(var i = 0; i < obj.length; i++){
  131 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  132 +// setFgsqx(obj[i].companyCode);
  133 + }
  134 + $('#gsbm').html(options);
  135 + updateCompany();
  136 + });
  137 +
  138 + $("#gsbm").on("change",updateCompany);
  139 + function updateCompany(){
  140 + var company = $('#gsbm').val();
  141 + var options ="";
  142 +// = '<option value="">请选择</option>';
  143 + for(var i = 0; i < obj.length; i++){
  144 + if(obj[i].companyCode == company){
  145 + var children = obj[i].children;
  146 + for(var j = 0; j < children.length; j++){
  147 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  148 + }
  149 + }
  150 + }
  151 + $('#fgsbm').html(options);
  152 + }
  153 + /*
  154 + * 获取数据 p: 要提交的参数, pagination: 是否重新分页
  155 + */
  156 + function jsDoQuery(p, pagination) {
  157 + var params = {};
  158 + if (p)
  159 + params = p;
  160 + params['order'] = 'nbbm';
  161 + params['page'] = page;
  162 + params['rq'] = $("#rq").val();
  163 +
  164 + var j = layer.load(2);
  165 + $get('/jdl/queryJdlReceptionBatch', params, function (data) {
  166 + $.each(data.dataList, function (i, obj) {
  167 + obj.rq = moment(obj.rq).format("YYYY-MM-DD");
  168 + });
  169 + var bodyHtml = template('jdlReceptionBatch', {list:data.dataList});
  170 +
  171 + $('#datatable_dlb tbody').html(bodyHtml)
  172 + .find('.icheck').iCheck(icheckOptions)
  173 + .on('ifChanged', iCheckChange);
  174 + if (pagination && data.dataList.length > 0) {
  175 + //重新分页
  176 + initPagination = true;
  177 + showPagination(data);
  178 + $('#pagination').show();
  179 + } else if(data.dataList.length == 0){
  180 + $('#pagination').hide();
  181 + }
  182 +
  183 + layer.close(j);
  184 +
  185 + startOptJzylLink($('#jdlReceptionBatch_list .in_carpark_jzyl'));
  186 +
  187 + $('.btn-ReceptionBatch').on('click', openReceptionBatchData);
  188 + $('.btn-ReceptionBatch-del').on('click', openReceptionBatchDataDel);
  189 + });
  190 + }
  191 +
  192 + function openReceptionBatchData(){
  193 + var id = $(this).data('date');
  194 + id += ","+$(this).data('by');
  195 + $.get('/pages/electricity/jdl/jdlReceptionBatchData.html', function (content) {
  196 + layer.open({
  197 + type: 1,
  198 + area: ['1200px', '600px'],
  199 + content: content,
  200 + title: '充电量详细',
  201 + shift: 5,
  202 + scrollbar: false,
  203 + success: function () {
  204 + $('#jdlReceptionBatchData').trigger('init', id);
  205 + }
  206 + });
  207 + });
  208 + }
  209 +
  210 + function openReceptionBatchDataDel(){
  211 + var createDate = $(this).data('date');
  212 + var createBy = $(this).data('by');
  213 + layer.confirm('你确定要删除充电量吗?', {
  214 + btn: ['确定删除','取消'] //按钮
  215 + }, function(){
  216 + layer.msg('操作中...', {icon: 16,shade: 0.01});
  217 + $post('/jdl/deleteJdlReceptionBatch', {createDate:createDate, createBy:createBy}, function (rs) {
  218 + layer.msg('删除成功!');
  219 + $('.filter-submit.margin-bottom').trigger('click');
  220 + });
  221 + });
  222 + }
  223 +
  224 + //改变状态
  225 + function startOptJzylLink(es) {
  226 + es.editable({
  227 + type: 'text',
  228 + placement: 'right',
  229 + width: 100,
  230 + display: false,
  231 + validate: function (value) {
  232 + if (!value)
  233 + return '值不能为空!';
  234 + if (isNaN(value))
  235 + return '只能为数字!';
  236 + if (value < 0)
  237 + return '值不能小于0!';
  238 + },
  239 + inputclass: 'form-control input-medium input-edtable-sm'
  240 + }).on('save', function (e, params) {
  241 + $(this).text(params.newValue);
  242 + });
  243 + }
  244 +
  245 + function iCheckChange() {
  246 + var tr = $(this).parents('tr');
  247 + if (this.checked)
  248 + tr.addClass('row-active');
  249 + else
  250 + tr.removeClass('row-active');
  251 + }
  252 +
  253 + function showPagination(data) {
  254 + //分页
  255 + $('#pagination').jqPaginator({
  256 + totalPages: data.totalPages,
  257 + visiblePages: 6,
  258 + currentPage: page + 1,
  259 + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  260 + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  261 + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  262 + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  263 + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  264 + onPageChange: function (num, type) {
  265 + if (initPagination) {
  266 + initPagination = false;
  267 + return;
  268 + }
  269 +
  270 + var params = getParams();
  271 +
  272 + page = num - 1;
  273 + jsDoQuery(params, true);
  274 + }
  275 + });
  276 + }
  277 +
  278 + //搜索线路
  279 + $.get('/basic/lineCode2Name',function(result){
  280 + var data=[];
  281 +
  282 + for(var code in result){
  283 + data.push({id: code, text: result[code]});
  284 + }
  285 + initPinYinSelect2('#xlbm',data,'');
  286 +
  287 + });
  288 +
  289 + $('#nbbm').select2({
  290 + placeholder: '搜索车辆...',
  291 + ajax: {
  292 + url: '/realSchedule/sreachVehic',
  293 + dataType: 'json',
  294 + delay: 150,
  295 + data: function (params) {
  296 + return {nbbm: params.term};
  297 + },
  298 + processResults: function (data) {
  299 + return {
  300 + results: data
  301 + };
  302 + },
  303 + cache: true
  304 + },
  305 + templateResult: function (repo) {
  306 + if (repo.loading) return repo.text;
  307 + var h = '<span>' + repo.text + '</span>';
  308 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  309 + return h;
  310 + },
  311 + escapeMarkup: function (markup) {
  312 + return markup;
  313 + },
  314 + minimumInputLength: 1,
  315 + templateSelection: function (repo) {
  316 + return repo.text;
  317 + },
  318 + language: {
  319 + noResults: function () {
  320 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  321 + },
  322 + inputTooShort: function (e) {
  323 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  324 + },
  325 + searching: function () {
  326 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  327 + }
  328 + }
  329 + })
  330 +
  331 + function getParams(){
  332 + var cells = $('tr.filter')[0].cells
  333 + , params = {}
  334 + , name;
  335 + $.each(cells, function (i, cell) {
  336 + var items = $('input,select', cell);
  337 + for (var j = 0, item; item = items[j++];) {
  338 + name = $(item).attr('name');
  339 + if (name) {
  340 + params[name] = $(item).val();
  341 + }
  342 + }
  343 + });
  344 + return params;
  345 + };
  346 +
  347 + });
  348 +
  349 +</script>
  350 +
  351 +<script id="jdlReceptionBatch" type="text/html">
  352 + {{each list as obj i}}
  353 + <tr>
  354 + <td style="vertical-align: middle;">
  355 + <!-- <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> -->
  356 + {{i + 1}}
  357 + </td>
  358 + <td>{{obj.createDate}}</td>
  359 + <td colspan="2">{{obj.createBy}}</td>
  360 + <td colspan="2">
  361 + <button class="btn btn-info btn-sm btn-ReceptionBatch" data-date="{{obj.createDate}}" data-by="{{obj.createBy}}">
  362 + <i class="fa fa-search"></i> 查看
  363 + </button>
  364 + <button class="btn btn-danger btn-sm red btn-ReceptionBatch-del" data-date="{{obj.createDate}}" data-by="{{obj.createBy}}">
  365 + <i class="fa fa-times"></i> 删除
  366 + </button>
  367 + </td>
  368 + </tr>
  369 + {{/each}}
  370 + {{if list.length == 0}}
  371 + <tr>
  372 + <td colspan=9><h6 class="muted">没有找到相关数据</h6></td>
  373 + </tr>
  374 + {{/if}}
  375 +</script>
0 376 \ No newline at end of file
... ...
src/main/resources/static/pages/electricity/jdl/jdlReceptionBatchData.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="row" id="jdlReceptionBatchData">
  20 + <div class="col-md-12">
  21 + <div class="portlet light porttlet-fit bordered">
  22 + <div class="portlet-body">
  23 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px">
  24 + <table class="table table-bordered table-hover table-checkable" id="forms_2">
  25 + <thead>
  26 + <tr>
  27 + <td style="min-width: 90px">营运日期</td>
  28 + <td style="min-width: 60px">桩号、枪号</td>
  29 + <td>车号</td>
  30 + <td>开始时间</td>
  31 + <td>结束时间</td>
  32 + <td>总计(分钟)</td>
  33 + <td>起始电量SOC(%)</td>
  34 + <td>结束电量SOC(%)</td>
  35 + <td>充电度数</td>
  36 + <td>一次不能正常充电记录</td>
  37 + <td>来源</td>
  38 + </tr>
  39 + </thead>
  40 +
  41 + <tbody>
  42 +
  43 + </tbody>
  44 + </table>
  45 + </div>
  46 + </div>
  47 + </div>
  48 + </div>
  49 +</div>
  50 +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script>
  51 +<script>
  52 + $(function(){
  53 + // 关闭左侧栏
  54 + if (!$('body').hasClass('page-sidebar-closed'))
  55 + $('.menu-toggler.sidebar-toggler').click();
  56 + var date = "";
  57 + var nbbm = "";
  58 + $("#jdlReceptionBatchData").on('init', function (e, id) {
  59 + date = id.split(",")[0];
  60 + by = id.split(",")[1];
  61 + var i = layer.load(2);
  62 + $get('/jdl/queryJdlReceptionBatchData',{createDate:date,createBy:by,type:'query'},function(result){
  63 + layer.close(i);
  64 + $.each(result, function(i, e){
  65 +// console.log(e);
  66 + if(e.origin == 1){
  67 + e.originName = "导入";
  68 + } else {
  69 + e.originName = "接口";
  70 + }
  71 + });
  72 + var jdlReceptionBatchData = template('jdlReceptionBatchData_tbody',{list:result});
  73 + $('#forms_2 tbody').html(jdlReceptionBatchData);
  74 + });
  75 + })
  76 +
  77 + });
  78 +</script>
  79 +<script type="text/html" id="jdlReceptionBatchData_tbody">
  80 + {{each list as obj i}}
  81 + <tr>
  82 + <td>{{obj.dateStr}}</td>
  83 + <td>{{obj.connectorId}}</td>
  84 + <td>{{obj.carCode}}</td>
  85 + <td>{{obj.startTime}}</td>
  86 + <td>{{obj.endTime}}</td>
  87 + <td>{{obj.sumTime}}</td>
  88 + <td>{{obj.startSoc}}</td>
  89 + <td>{{obj.endSoc}}</td>
  90 + <td>{{obj.chargeCapacity}}</td>
  91 + <td>{{obj.stopReason}}</td>
  92 + <td>{{obj.originName}}</td>
  93 + </tr>
  94 + {{/each}}
  95 + {{if list.length == 0}}
  96 + <tr>
  97 + <td colspan="11"><h6 class="muted">没有找到相关数据</h6></td>
  98 + </tr>
  99 + {{/if}}
  100 +</script>
0 101 \ No newline at end of file
... ...
src/main/resources/static/pages/electricity/jdl/list.html
... ... @@ -10,7 +10,7 @@
10 10 </div>
11 11 <ul class="page-breadcrumb breadcrumb">
12 12 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
13   - <li><span class="active">用电管理</span> <i class="fa fa-circle"></i></li>
  13 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
14 14 <li><span class="active">车辆充电管理</span></li>
15 15 </ul>
16 16  
... ...
src/main/resources/static/pages/electricity/jdl/list_2412.html 0 → 100644
  1 +<style>
  2 +.blue{
  3 + background-color: #87CEFF
  4 +}
  5 +</style>
  6 +<div class="page-head">
  7 + <div class="page-title">
  8 + <h1>车辆充电量</h1>
  9 + </div>
  10 +</div>
  11 +<ul class="page-breadcrumb breadcrumb">
  12 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  13 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
  14 + <li><span class="active">车辆充电管理</span></li>
  15 +</ul>
  16 +
  17 +<div class="row" id="ll_oil_list">
  18 + <div class="col-md-12">
  19 + <!-- Begin: life time stats -->
  20 + <div class="portlet light portlet-fit portlet-datatable bordered">
  21 + <div class="portlet-title">
  22 + <div class="caption">
  23 + <i class="fa fa-fire-extinguisher"></i> <span
  24 + class="caption-subject font-dark sbold uppercase">车辆充电量</span>
  25 + </div>
  26 + <div class="actions">
  27 + <button type="button" class="btn btn-circle blue" id="upload"><i class="fa fa-file-excel-o"></i>
  28 + 导入Excel
  29 + </button>
  30 + <button type="button" class="btn btn-circle blue" id="export"><i class="fa fa-file-excel-o"></i>
  31 + 导出Excel
  32 + </button>
  33 + </div>
  34 + </div>
  35 + <div class="portlet-body">
  36 + <div class="table-container" style="margin-top: 0px">
  37 + <table
  38 + class="table table-striped table-bordered table-hover table-checkable"
  39 + id="datatable_dlb">
  40 + <thead>
  41 + <tr role="row" class="filter">
  42 +<!-- <td width="80px">公司:</td> -->
  43 +<!-- <td width="160px"> -->
  44 +<!-- <select class="form-control" id="gsbm" ></select> -->
  45 +<!-- </td> -->
  46 +<!-- <td>分公司:</td> -->
  47 +<!-- <td> -->
  48 +<!-- <select class="form-control" id="fgsbm" ></select> -->
  49 +<!-- </td> -->
  50 + <td colspan="2">日期:</td>
  51 + <td colspan="2" width="120px">
  52 + <input type="text" style="width: 100px" name="rq" id="rq"/>
  53 + </td>
  54 + <td colspan="2">内部编码:</td>
  55 + <td colspan="2">
  56 + <select class="form-control" name="nbbm" id="nbbm" style="width: 120px;"></select>
  57 + </td>
  58 +
  59 + <td width="24%">
  60 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px">
  61 + <i class="fa fa-search"></i> 搜索
  62 + </button>
  63 + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px">
  64 + <i class="fa fa-times"></i> 重置
  65 + </button>
  66 +<!-- <button class="btn btn-danger btn-sm red" id="del" style="margin-right:0px"> -->
  67 +<!-- <i class="fa fa-times"></i> 删除 -->
  68 +<!-- </button> -->
  69 + </td>
  70 + </tr>
  71 + <tr role="row" class="heading">
  72 + <th>#</th>
  73 + <th>日期</th>
  74 + <th colspan="2">内部编码</th>
  75 + <th colspan="4">充电量</th>
  76 +<!-- <th colspan="2">充电站</th> -->
  77 +<!-- <th colspan="2">备注</th> -->
  78 + <td colspan="2">操作</td>
  79 + </tr>
  80 + </thead>
  81 + <tbody></tbody>
  82 + </table>
  83 + <div style="text-align: right;">
  84 + <ul id="pagination" class="pagination"></ul>
  85 + </div>
  86 + </div>
  87 + </div>
  88 + <div class="portlet-body">
  89 + <div id="modules_tree"></div>
  90 + </div>
  91 + </div>
  92 + </div>
  93 +</div>
  94 +
  95 +
  96 +<script src="/assets/js/ajaxfileupload/ajaxfileupload.js"></script>
  97 +<script>
  98 + $(function () {
  99 +
  100 + // 关闭左侧栏
  101 + if (!$('body').hasClass('page-sidebar-closed'))
  102 + $('.menu-toggler.sidebar-toggler').click();
  103 +
  104 + $("#rq").datetimepicker({
  105 + format: 'YYYY-MM-DD',
  106 + locale: 'zh-cn'
  107 + });
  108 + var d = new Date();
  109 + d.setTime(d.getTime() - 1*1000*60*60*24);
  110 + var year = d.getFullYear();
  111 + var month = d.getMonth() + 1;
  112 + var day = d.getDate();
  113 + if(month < 10)
  114 + month = "0" + month;
  115 + if(day < 10)
  116 + day = "0" + day;
  117 + $("#rq").val(year + "-" + month + "-" + day);
  118 +
  119 + var page = 0, initPagination;
  120 + var icheckOptions = {
  121 + radioClass: 'iradio_square-blue icheck',
  122 + increaseArea: '20%'
  123 + }
  124 +
  125 + //重置
  126 + $('tr.filter .filter-cancel').on('click', function () {
  127 + $('tr.filter input, select').val('').change();
  128 + });
  129 +
  130 + //提交
  131 + $('tr.filter .filter-submit').on('click', function () {
  132 + var gsbm = $('#gsbm').val();
  133 +// var fgsbm = $('#fgsbm').val();
  134 + var fgsbm = -1;
  135 + if ($("#rq").val() == "" || $("#rq").val() ==null){
  136 + layer.msg('请选择日期.');
  137 +// }else if(gsbm=="" || gsbm==null || fgsbm=="" ||fgsbm==null){
  138 +// layer.msg('请选择公司和分公司.');
  139 +// }else if(gsbm=="" || gsbm==null){
  140 +// layer.msg('请选择公司.');
  141 + }else {
  142 +
  143 + var params = getParams();
  144 +
  145 + page = 0;
  146 + jsDoQuery(params, true);
  147 + }
  148 + });
  149 +
  150 +
  151 + $.get('/user/companyData', function(result){
  152 + obj = result;
  153 + var options="";
  154 +// = '<option value="">请选择</option>';
  155 + for(var i = 0; i < obj.length; i++){
  156 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  157 +// setFgsqx(obj[i].companyCode);
  158 + }
  159 + $('#gsbm').html(options);
  160 + updateCompany();
  161 + });
  162 +
  163 + $("#gsbm").on("change",updateCompany);
  164 + function updateCompany(){
  165 + var company = $('#gsbm').val();
  166 + var options ="";
  167 +// = '<option value="">请选择</option>';
  168 + for(var i = 0; i < obj.length; i++){
  169 + if(obj[i].companyCode == company){
  170 + var children = obj[i].children;
  171 + for(var j = 0; j < children.length; j++){
  172 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  173 + }
  174 + }
  175 + }
  176 + $('#fgsbm').html(options);
  177 + }
  178 + /*
  179 + * 获取数据 p: 要提交的参数, pagination: 是否重新分页
  180 + */
  181 + function jsDoQuery(p, pagination) {
  182 + var params = {};
  183 + if (p)
  184 + params = p;
  185 + params['order'] = 'nbbm';
  186 + params['page'] = page;
  187 + params['rq'] = $("#rq").val();
  188 +
  189 + var j = layer.load(2);
  190 + $get('/jdl/query_2412', params, function (data) {
  191 + $.each(data.dataList, function (i, obj) {
  192 + obj.rq = moment(obj.rq).format("YYYY-MM-DD");
  193 + });
  194 + var bodyHtm = template('jdl_2412_list', {list:data.dataList});
  195 +
  196 + $('#datatable_dlb tbody').html(bodyHtm)
  197 + .find('.icheck').iCheck(icheckOptions)
  198 + .on('ifChanged', iCheckChange);
  199 + if (pagination && data.dataList.length > 0) {
  200 + //重新分页
  201 + initPagination = true;
  202 + showPagination(data);
  203 + $('#pagination').show();
  204 + } else if(data.dataList.length == 0){
  205 + $('#pagination').hide();
  206 + }
  207 +
  208 + layer.close(j);
  209 +
  210 + startOptJzylLink($('#ll_oil_list .in_carpark_jzyl'));
  211 +
  212 + $('.btn-Reception').on('click', openReception);
  213 + });
  214 + }
  215 +
  216 + function openReception(){
  217 + var id = $(this).data('date');
  218 + id += ","+$(this).data('nbbm');
  219 + $.get('/pages/electricity/jdl/jdlReception.html', function (content) {
  220 + layer.open({
  221 + type: 1,
  222 + area: ['1200px', '600px'],
  223 + content: content,
  224 + title: '充电量详细',
  225 + shift: 5,
  226 + scrollbar: false,
  227 + success: function () {
  228 + $('#jdlReception').trigger('init', id);
  229 + }
  230 + });
  231 + });
  232 + }
  233 +
  234 + //改变状态
  235 + function startOptJzylLink(es) {
  236 + es.editable({
  237 + type: 'text',
  238 + placement: 'right',
  239 + width: 100,
  240 + display: false,
  241 + validate: function (value) {
  242 + if (!value)
  243 + return '值不能为空!';
  244 + if (isNaN(value))
  245 + return '只能为数字!';
  246 + if (value < 0)
  247 + return '值不能小于0!';
  248 + },
  249 + inputclass: 'form-control input-medium input-edtable-sm'
  250 + }).on('save', function (e, params) {
  251 + $(this).text(params.newValue);
  252 + });
  253 + }
  254 +
  255 + function iCheckChange() {
  256 + var tr = $(this).parents('tr');
  257 + if (this.checked)
  258 + tr.addClass('row-active');
  259 + else
  260 + tr.removeClass('row-active');
  261 +
  262 + /* if($('#datatable_resource input.icheck:checked').length == 1)
  263 + $('#removeButton').removeAttr('disabled');
  264 + else
  265 + $('#removeButton').attr('disabled', 'disabled'); */
  266 + }
  267 +
  268 + function showPagination(data) {
  269 + //分页
  270 + $('#pagination').jqPaginator({
  271 + totalPages: data.totalPages,
  272 + visiblePages: 6,
  273 + currentPage: page + 1,
  274 + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  275 + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  276 + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  277 + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  278 + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  279 + onPageChange: function (num, type) {
  280 + if (initPagination) {
  281 + initPagination = false;
  282 + return;
  283 + }
  284 +
  285 + var params = getParams();
  286 +
  287 + page = num - 1;
  288 + jsDoQuery(params, true);
  289 + }
  290 + });
  291 + }
  292 +
  293 +
  294 + //删除
  295 + $('#del').on('click', function () {
  296 + if ($(this).attr('disabled'))
  297 + return;
  298 +
  299 + var id = $('input.icheck:checked').data('id');
  300 + removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () {
  301 + $('tr.filter .filter-submit').click();
  302 + });
  303 + });
  304 +
  305 + //搜索线路
  306 + $.get('/basic/lineCode2Name',function(result){
  307 + var data=[];
  308 +
  309 + for(var code in result){
  310 + data.push({id: code, text: result[code]});
  311 + }
  312 + initPinYinSelect2('#xlbm',data,'');
  313 +
  314 + });
  315 +
  316 + $('#nbbm').select2({
  317 + placeholder: '搜索车辆...',
  318 + ajax: {
  319 + url: '/realSchedule/sreachVehic',
  320 + dataType: 'json',
  321 + delay: 150,
  322 + data: function (params) {
  323 + return {nbbm: params.term};
  324 + },
  325 + processResults: function (data) {
  326 + return {
  327 + results: data
  328 + };
  329 + },
  330 + cache: true
  331 + },
  332 + templateResult: function (repo) {
  333 + if (repo.loading) return repo.text;
  334 + var h = '<span>' + repo.text + '</span>';
  335 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  336 + return h;
  337 + },
  338 + escapeMarkup: function (markup) {
  339 + return markup;
  340 + },
  341 + minimumInputLength: 1,
  342 + templateSelection: function (repo) {
  343 + return repo.text;
  344 + },
  345 + language: {
  346 + noResults: function () {
  347 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  348 + },
  349 + inputTooShort: function (e) {
  350 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  351 + },
  352 + searching: function () {
  353 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  354 + }
  355 + }
  356 + })
  357 +
  358 + //导入
  359 + $("#upload").on("click", function(){
  360 + $.get('upload_2412.html', function(m){$(pjaxContainer).append(m);});
  361 + });
  362 +
  363 + //导出
  364 + $("#export").on("click", function () {
  365 + if ($("#rq").val() != "") {
  366 + var gsbm=$("#gsbm").val();
  367 +// var fgsbm=$("#fgsbm").val();
  368 +// if(gsbm=="" || gsbm==null || fgsbm=="" ||fgsbm==null){
  369 +// layer.msg('请选择公司和分公司.');
  370 +// if(gsbm=="" || gsbm==null){
  371 +// layer.msg('请选择公司.');
  372 +// return;
  373 +// }
  374 + var params = getParams();
  375 +
  376 + params["type"] = "export";
  377 + $get('/jdl/query_2412', params, function (result) {
  378 + window.open("/downloadFile/download?fileName=车辆充电量" + moment($("#rq").val()).format("YYYYMMDD"));
  379 + });
  380 + } else {
  381 + layer.msg('请选择日期.');
  382 + }
  383 + });
  384 +
  385 + function getParams(){
  386 + var gsbm=$("#gsbm").val();
  387 +// var fgsbm=$("#fgsbm").val();
  388 + var cells = $('tr.filter')[0].cells
  389 + , params = {}
  390 + , name;
  391 + params["gsbm"] = gsbm;
  392 +// params["fgsbm"] = fgsbm;
  393 + params["fgsbm"] = '-1';
  394 + $.each(cells, function (i, cell) {
  395 + var items = $('input,select', cell);
  396 + for (var j = 0, item; item = items[j++];) {
  397 + name = $(item).attr('name');
  398 + if (name) {
  399 + params[name] = $(item).val();
  400 + }
  401 + }
  402 + });
  403 + return params;
  404 + };
  405 +
  406 + });
  407 +
  408 +</script>
  409 +
  410 +<script id="jdl_2412_list" type="text/html">
  411 + {{each list as obj i}}
  412 + <tr>
  413 + <td style="vertical-align: middle;">
  414 + <!-- <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> -->
  415 + {{i + 1}}
  416 + </td>
  417 + <td>{{obj.rq}}</td>
  418 + <td colspan="2">{{obj.nbbm}}</td>
  419 + <td colspan="4">{{obj.jdl}}</td>
  420 + <!-- <td colspan="2">{{obj.jdz}}</td> -->
  421 + <!-- <td>{{obj.remarks}}</td> -->
  422 + <td colspan="2">
  423 + <button class="btn btn-info btn-sm btn-Reception" data-date="{{obj.rq}}" data-nbbm="{{obj.nbbm}}">
  424 + <i class="fa fa-search"></i> 查看
  425 + </button>
  426 + </td>
  427 + </tr>
  428 + {{/each}}
  429 + {{if list.length == 0}}
  430 + <tr>
  431 + <td colspan=9><h6 class="muted">没有找到相关数据</h6></td>
  432 + </tr>
  433 + {{/if}}
  434 +</script>
0 435 \ No newline at end of file
... ...
src/main/resources/static/pages/electricity/jdl/upload_2412.html 0 → 100644
  1 +<div class="modal fade" id="uploadFile" tabindex="-1" role="basic"
  2 + aria-hidden="true">
  3 + <div class="modal-dialog">
  4 + <div class="modal-content">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal"
  7 + aria-hidden="true"></button>
  8 + <h4 class="modal-title">导入Excel</h4>
  9 + </div>
  10 + <div class="modal-body">
  11 + <form class="form-horizontal" role="form" id="excelFile" method="post"
  12 + action="" enctype="multipart/form-data">
  13 + <input type="hidden" name="groupType" value="3">
  14 + <div class="alert alert-danger display-hide">
  15 + <button class="close" data-close="alert"></button>
  16 + 您的输入有误,请检查下面的输入项
  17 + </div>
  18 + <div class="form-body">
  19 + <div class="form-group">
  20 + <label class="col-md-3 control-label">选择文件</label>
  21 + <div class="col-md-9">
  22 + <input type="file" name="file" id="file"
  23 + accept="application/vnd.ms-excel"/>
  24 + <input type="hidden" name="gsbm_" id="gsbm_">
  25 + <input type="hidden" name="gsName" id="gsName">
  26 + <input type="hidden" name="fgsbm_" id="fgsbm_">
  27 + <input type="hidden" name="fgsName" id="fgsName">
  28 + </div>
  29 + </div>
  30 + </div>
  31 + </form>
  32 + </div>
  33 + <div class="modal-footer">
  34 + <button type="button" class="btn default" id="downLoad">下载模板</button>
  35 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  36 + <button type="button" class="btn btn-primary" id="submit">确认导入</button>
  37 + </div>
  38 + </div>
  39 + </div>
  40 +</div>
  41 +<script id="res_tbody_temp" type="text/html">
  42 +
  43 +</script>
  44 +<script data-exclude=1>
  45 + $(function() {
  46 + var form = $('#excelFile');
  47 + var error = $('.alert-danger', form);
  48 +
  49 + $('#gsbm_').val($("#gsbm").val());
  50 + $('#gsName').val($("#gsbm").find("option:selected").text());
  51 +// $('#fgsbm_').val($("#fgsbm").val());
  52 +// $('#fgsName').val($("#fgsbm").find("option:selected").text());
  53 + $('#fgsbm_').val('-1');
  54 + $('#fgsName').val('全部车队');
  55 +
  56 + //modal 显示事件
  57 + $('#uploadFile').on('show.bs.modal', function(){
  58 + })
  59 + .modal('show');
  60 +
  61 + $('#submit').on('click', function() {
  62 + var j = layer.load(2);
  63 + var param = {};
  64 + param.uploadDir = 'upload';
  65 + param["gsbm_"] = $('#gsbm_').val();
  66 + param["gsName"] = $('#gsName').val();
  67 + param["fgsbm_"] = $('#fgsbm_').val();
  68 + param["fgsName"] = $('#fgsName').val();
  69 + $.ajaxFileUpload({
  70 + url : '/jdl/uploadFile_2412',
  71 + secureuri : false,
  72 + fileElementId : 'file',
  73 + dataType : 'json',
  74 + data : param,
  75 + success : function(data) {
  76 + layer.close(j);
  77 + alert(data.result);
  78 +// alert("文件导入成功");
  79 + $('#uploadFile').modal('hide');
  80 + $('tr.filter .filter-submit').click();
  81 + },
  82 + error : function(data, status, e) {
  83 + layer.close(j);
  84 + alert("文件导入失败");
  85 + }
  86 + })
  87 + });
  88 +
  89 + $('#downLoad').on('click', function(){
  90 + window.open("/downloadFile/downloadModel?fileName=import_Jdl_2412");
  91 + });
  92 +
  93 + function getCurrSelNode(){
  94 + return $.jstree.reference("#modules_tree").get_selected(true);
  95 + }
  96 + });
  97 +</script>
0 98 \ No newline at end of file
... ...
src/main/resources/static/pages/electricity/list/add.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用电管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><a href="list.html" data-pjax>进出场电量</a> <i class="fa fa-circle"></i></li>
11 11 <li><span class="active">进出站电量信息编辑</span></li>
12 12 </ul>
... ...
src/main/resources/static/pages/electricity/list/list.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用电管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><span class="active">进出场存电量</span></li>
11 11 </ul>
12 12  
... ...
src/main/resources/static/pages/forms/export/import_Jdl_2412.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/oil/add.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><a href="list_ph.html" data-pjax>进出场油量</a> <i class="fa fa-circle"></i></li>
11 11 <li><span class="active">进出站油量信息编辑</span></li>
12 12 </ul>
... ...
src/main/resources/static/pages/oil/checkJyryList.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><span class="active">加油人员不符</span></li>
11 11 </ul>
12 12  
... ...
src/main/resources/static/pages/oil/checkNbbmList.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><span class="active">加油车辆备卡</span></li>
11 11 </ul>
12 12  
... ...
src/main/resources/static/pages/oil/cylAdd.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><a href="cylList.html" data-pjax>车辆存油</a> <i class="fa fa-circle"></i></li>
11 11 <li><span class="active">添加存油</span></li>
12 12 </ul>
... ...
src/main/resources/static/pages/oil/cylList.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><span class="active">车辆存油</span></li>
11 11 </ul>
12 12  
... ...
src/main/resources/static/pages/oil/history/list_lsdl.html
... ... @@ -14,7 +14,7 @@
14 14  
15 15 <ul class="page-breadcrumb breadcrumb">
16 16 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
17   - <li><span class="active">用电管理</span> <i class="fa fa-circle"></i></li>
  17 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
18 18 <li><span class="active">进出场存电量</span></li>
19 19 </ul>
20 20 <div id="ll_lsoil_list"
... ...
src/main/resources/static/pages/oil/history/list_lsyl.html
... ... @@ -14,7 +14,7 @@
14 14  
15 15 <ul class="page-breadcrumb breadcrumb">
16 16 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
17   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  17 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
18 18 <li><span class="active">进出场存油量</span></li>
19 19 </ul>
20 20 <div id="ll_lsoil_list"
... ...
src/main/resources/static/pages/oil/jyglList.html
... ... @@ -8,7 +8,7 @@
8 8  
9 9 <ul class="page-breadcrumb breadcrumb">
10 10 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
11   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  11 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
12 12 <li><span class="active">场外加油管理</span></li>
13 13 </ul>
14 14  
... ...
src/main/resources/static/pages/oil/jyszList.html
... ... @@ -7,7 +7,7 @@
7 7  
8 8 <ul class="page-breadcrumb breadcrumb">
9 9 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
10   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  10 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
11 11 <li><span class="active">场外加油设置</span></li>
12 12 </ul>
13 13 <div class="row">
... ...
src/main/resources/static/pages/oil/list.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><span class="active">进出场存油量</span></li>
11 11 </ul>
12 12  
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -14,7 +14,7 @@
14 14  
15 15 <ul class="page-breadcrumb breadcrumb">
16 16 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
17   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  17 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
18 18 <li><span class="active">进出场存油量</span></li>
19 19 </ul>
20 20 <div id="ll_oil_list"
... ...
src/main/resources/static/pages/oil/oillist/list.html
... ... @@ -6,7 +6,7 @@
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8 8 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">能耗管理</span> <i class="fa fa-circle"></i></li>
10 10 <li><span class="active">进出场存油量</span></li>
11 11 </ul>
12 12  
... ...