Commit 19a651f6f85293d782798e21b943496c52b6b490
1 parent
a2699ffb
加油量加电量保留三位小数;充电量导入格式变更,不再覆盖,提供详细查询、批量删除功能;
# Conflicts: # src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java # src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java # src/main/resources/static/pages/electricity/jdl/list.html
Showing
41 changed files
with
5775 additions
and
4123 deletions
src/main/java/com/bsth/controller/oil/JdlController.java
| @@ -2,6 +2,7 @@ package com.bsth.controller.oil; | @@ -2,6 +2,7 @@ package com.bsth.controller.oil; | ||
| 2 | 2 | ||
| 3 | import java.io.File; | 3 | import java.io.File; |
| 4 | import java.util.HashMap; | 4 | import java.util.HashMap; |
| 5 | +import java.util.List; | ||
| 5 | import java.util.Map; | 6 | import java.util.Map; |
| 6 | 7 | ||
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -17,6 +18,7 @@ import com.alibaba.fastjson.JSONArray; | @@ -17,6 +18,7 @@ import com.alibaba.fastjson.JSONArray; | ||
| 17 | import com.alibaba.fastjson.JSONObject; | 18 | import com.alibaba.fastjson.JSONObject; |
| 18 | import com.bsth.controller.BaseController; | 19 | import com.bsth.controller.BaseController; |
| 19 | import com.bsth.entity.oil.Jdl; | 20 | import com.bsth.entity.oil.Jdl; |
| 21 | +import com.bsth.entity.oil.JdlReception; | ||
| 20 | import com.bsth.service.oil.JdlService; | 22 | import com.bsth.service.oil.JdlService; |
| 21 | import com.google.common.io.Files; | 23 | import com.google.common.io.Files; |
| 22 | 24 | ||
| @@ -46,9 +48,46 @@ public class JdlController extends BaseController<Jdl, Integer> { | @@ -46,9 +48,46 @@ public class JdlController extends BaseController<Jdl, Integer> { | ||
| 46 | return "{\"result\":" + "\""+result+"\"}"; | 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 | @RequestMapping(value = "/query",method = RequestMethod.GET) | 63 | @RequestMapping(value = "/query",method = RequestMethod.GET) |
| 50 | public Map<String, Object> query(@RequestParam Map<String, Object> map) throws Exception{ | 64 | public Map<String, Object> query(@RequestParam Map<String, Object> map) throws Exception{ |
| 51 | return jdlService.query(map); | 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/data/directive/GatewayHttpUtils.java
| 1 | -package com.bsth.data.directive; | ||
| 2 | - | ||
| 3 | -import com.alibaba.fastjson.JSONObject; | ||
| 4 | -import com.bsth.data.SystemParamCache; | ||
| 5 | -import org.apache.http.client.config.RequestConfig; | ||
| 6 | -import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 7 | -import org.apache.http.client.methods.HttpPost; | ||
| 8 | -import org.apache.http.entity.StringEntity; | ||
| 9 | -import org.apache.http.impl.client.CloseableHttpClient; | ||
| 10 | -import org.apache.http.impl.client.HttpClients; | ||
| 11 | -import org.apache.http.util.EntityUtils; | ||
| 12 | -import org.slf4j.Logger; | ||
| 13 | -import org.slf4j.LoggerFactory; | ||
| 14 | -import org.springframework.beans.factory.InitializingBean; | ||
| 15 | -import org.springframework.stereotype.Component; | ||
| 16 | - | ||
| 17 | -/** | ||
| 18 | - * @author PanZhao | ||
| 19 | - * @ClassName: GatewayHttpUtils | ||
| 20 | - * @Description: TODO(和网关HTTP通讯工具类) | ||
| 21 | - * @date 2016年8月14日 下午9:50:46 | ||
| 22 | - */ | ||
| 23 | -@Component | ||
| 24 | -public class GatewayHttpUtils implements InitializingBean { | ||
| 25 | - static Logger logger = LoggerFactory.getLogger(GatewayHttpUtils.class); | ||
| 26 | - | ||
| 27 | - static String url; | ||
| 28 | - static CloseableHttpClient httpClient = null; | ||
| 29 | - static HttpPost post; | ||
| 30 | - static RequestConfig requestConfig; | ||
| 31 | - static CloseableHttpResponse response; | ||
| 32 | - | ||
| 33 | - public static int postJson(String jsonStr) { | ||
| 34 | - logger.info("send : " + jsonStr); | ||
| 35 | - | ||
| 36 | - int code = -1; | ||
| 37 | - try { | ||
| 38 | - post.setEntity(new StringEntity(jsonStr, "utf-8")); | ||
| 39 | - | ||
| 40 | - response = httpClient.execute(post); | ||
| 41 | - | ||
| 42 | - int statusCode = response.getStatusLine().getStatusCode(); | ||
| 43 | - if(statusCode != 200){ | ||
| 44 | - logger.error("http client status code: " + statusCode); | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); | ||
| 48 | - if (null != json && json.getInteger("errCode") == 0) | ||
| 49 | - code = 0; | ||
| 50 | - else | ||
| 51 | - logger.error("和网关http通讯失败,rs: " + json); | ||
| 52 | - | ||
| 53 | - if (null != response) | ||
| 54 | - response.close(); | ||
| 55 | - } catch (Exception e) { | ||
| 56 | - logger.error("", e); | ||
| 57 | - } | ||
| 58 | - return code; | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - @Override | ||
| 62 | - public void afterPropertiesSet() throws Exception { | ||
| 63 | - url = SystemParamCache.getUrlHttpDirective(); | ||
| 64 | - httpClient = HttpClients.createDefault(); | ||
| 65 | - post = new HttpPost(url); | ||
| 66 | - requestConfig = RequestConfig.custom() | ||
| 67 | - .setConnectTimeout(3000).setConnectionRequestTimeout(2000) | ||
| 68 | - .setSocketTimeout(3000).build(); | ||
| 69 | - post.setConfig(requestConfig); | ||
| 70 | - } | ||
| 71 | -} | 1 | +package com.bsth.data.directive; |
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSONObject; | ||
| 4 | +import com.bsth.data.SystemParamCache; | ||
| 5 | +import org.apache.http.client.config.RequestConfig; | ||
| 6 | +import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 7 | +import org.apache.http.client.methods.HttpPost; | ||
| 8 | +import org.apache.http.entity.StringEntity; | ||
| 9 | +import org.apache.http.impl.client.CloseableHttpClient; | ||
| 10 | +import org.apache.http.impl.client.HttpClients; | ||
| 11 | +import org.apache.http.util.EntityUtils; | ||
| 12 | +import org.slf4j.Logger; | ||
| 13 | +import org.slf4j.LoggerFactory; | ||
| 14 | +import org.springframework.beans.factory.InitializingBean; | ||
| 15 | +import org.springframework.stereotype.Component; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * @author PanZhao | ||
| 19 | + * @ClassName: GatewayHttpUtils | ||
| 20 | + * @Description: TODO(和网关HTTP通讯工具类) | ||
| 21 | + * @date 2016年8月14日 下午9:50:46 | ||
| 22 | + */ | ||
| 23 | +@Component | ||
| 24 | +public class GatewayHttpUtils implements InitializingBean { | ||
| 25 | + static Logger logger = LoggerFactory.getLogger(GatewayHttpUtils.class); | ||
| 26 | + | ||
| 27 | + static String url; | ||
| 28 | + static CloseableHttpClient httpClient = null; | ||
| 29 | + static HttpPost post; | ||
| 30 | + static RequestConfig requestConfig; | ||
| 31 | + static CloseableHttpResponse response; | ||
| 32 | + | ||
| 33 | + public static int postJson(String jsonStr) { | ||
| 34 | + logger.info("send : " + jsonStr); | ||
| 35 | + | ||
| 36 | + int code = -1; | ||
| 37 | + try { | ||
| 38 | + post.setEntity(new StringEntity(jsonStr, "utf-8")); | ||
| 39 | + | ||
| 40 | + response = httpClient.execute(post); | ||
| 41 | + | ||
| 42 | + int statusCode = response.getStatusLine().getStatusCode(); | ||
| 43 | + if(statusCode != 200){ | ||
| 44 | + logger.error("http client status code: " + statusCode); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); | ||
| 48 | + if (null != json && json.getInteger("errCode") == 0) | ||
| 49 | + code = 0; | ||
| 50 | + else | ||
| 51 | + logger.error("和网关http通讯失败,rs: " + json); | ||
| 52 | + | ||
| 53 | + if (null != response) | ||
| 54 | + response.close(); | ||
| 55 | + } catch (Exception e) { | ||
| 56 | + logger.error("", e); | ||
| 57 | + } | ||
| 58 | + return code; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + @Override | ||
| 62 | + public void afterPropertiesSet() throws Exception { | ||
| 63 | + url = SystemParamCache.getUrlHttpDirective(); | ||
| 64 | + httpClient = HttpClients.createDefault(); | ||
| 65 | + post = new HttpPost(url); | ||
| 66 | + requestConfig = RequestConfig.custom() | ||
| 67 | + .setConnectTimeout(3000).setConnectionRequestTimeout(2000) | ||
| 68 | + .setSocketTimeout(3000).build(); | ||
| 69 | + post.setConfig(requestConfig); | ||
| 70 | + } | ||
| 71 | +} |
src/main/java/com/bsth/data/gpsdata_v2/load/GatewayHttpLoader.java
| 1 | -package com.bsth.data.gpsdata_v2.load; | ||
| 2 | - | ||
| 3 | -import com.alibaba.fastjson.JSON; | ||
| 4 | -import com.bsth.data.BasicData; | ||
| 5 | -import com.bsth.data.SystemParamCache; | ||
| 6 | -import com.bsth.data.gpsdata_v2.GpsRealData; | ||
| 7 | -import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 8 | -import com.bsth.data.gpsdata_v2.utils.GpsDataUtils; | ||
| 9 | -import org.apache.commons.lang3.StringUtils; | ||
| 10 | -import org.apache.http.HttpEntity; | ||
| 11 | -import org.apache.http.client.config.RequestConfig; | ||
| 12 | -import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 13 | -import org.apache.http.client.methods.HttpGet; | ||
| 14 | -import org.apache.http.impl.client.CloseableHttpClient; | ||
| 15 | -import org.apache.http.impl.client.HttpClients; | ||
| 16 | -import org.slf4j.Logger; | ||
| 17 | -import org.slf4j.LoggerFactory; | ||
| 18 | -import org.springframework.beans.BeansException; | ||
| 19 | -import org.springframework.beans.factory.InitializingBean; | ||
| 20 | -import org.springframework.context.ApplicationContext; | ||
| 21 | -import org.springframework.context.ApplicationContextAware; | ||
| 22 | -import org.springframework.stereotype.Component; | ||
| 23 | - | ||
| 24 | -import java.io.BufferedReader; | ||
| 25 | -import java.io.InputStreamReader; | ||
| 26 | -import java.util.ArrayList; | ||
| 27 | -import java.util.List; | ||
| 28 | - | ||
| 29 | -/** | ||
| 30 | - * 从网关http 接口加载数据 | ||
| 31 | - * Created by panzhao on 2017/11/15. | ||
| 32 | - */ | ||
| 33 | -@Component | ||
| 34 | -public class GatewayHttpLoader implements ApplicationContextAware, InitializingBean { | ||
| 35 | - | ||
| 36 | - static Logger logger = LoggerFactory.getLogger(GatewayHttpLoader.class); | ||
| 37 | - | ||
| 38 | - static String url; | ||
| 39 | - static List<GpsEntity> list; | ||
| 40 | - static CloseableHttpClient httpClient = null; | ||
| 41 | - static HttpGet get; | ||
| 42 | - static RequestConfig requestConfig; | ||
| 43 | - static CloseableHttpResponse response; | ||
| 44 | - static HttpEntity entity; | ||
| 45 | - static BufferedReader br; | ||
| 46 | - | ||
| 47 | - static GpsRealData gpsRealData; | ||
| 48 | - | ||
| 49 | - public static List<GpsEntity> load(){ | ||
| 50 | - try{ | ||
| 51 | - if(list.size() > 0) | ||
| 52 | - list.clear(); | ||
| 53 | - | ||
| 54 | - response = httpClient.execute(get); | ||
| 55 | - entity = response.getEntity(); | ||
| 56 | - | ||
| 57 | - logger.info("entity:" + entity + "get:" + get); | ||
| 58 | - if(null == entity) | ||
| 59 | - return list; | ||
| 60 | - | ||
| 61 | - br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 62 | - | ||
| 63 | - StringBuilder sb = new StringBuilder(); | ||
| 64 | - String str; | ||
| 65 | - while ((str = br.readLine()) != null) | ||
| 66 | - sb.append(str); | ||
| 67 | - | ||
| 68 | - logger.debug("gps:" + sb.toString()); | ||
| 69 | - list = JSON.parseArray(JSON.parseObject(sb.toString()).getString("data"), GpsEntity.class); | ||
| 70 | - //过滤掉无效的点位 | ||
| 71 | - list = GpsDataUtils.clearInvalid(list); | ||
| 72 | - | ||
| 73 | - List<GpsEntity> ups = new ArrayList<>(); | ||
| 74 | - String nbbm; | ||
| 75 | - for (GpsEntity gps : list) { | ||
| 76 | - if (StringUtils.isBlank(gps.getDeviceId())) | ||
| 77 | - continue; | ||
| 78 | - | ||
| 79 | - if (gps_equals(gpsRealData.get(gps.getDeviceId()), gps)) | ||
| 80 | - continue; | ||
| 81 | - | ||
| 82 | - nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); | ||
| 83 | - gps.setNbbm(nbbm); | ||
| 84 | - ups.add(gps); | ||
| 85 | - } | ||
| 86 | - list = ups; | ||
| 87 | - | ||
| 88 | - if (null != response) | ||
| 89 | - response.close(); | ||
| 90 | - }catch (Exception e){ | ||
| 91 | - logger.error("", e); | ||
| 92 | - } | ||
| 93 | - return list; | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - | ||
| 97 | - private static boolean gps_equals(GpsEntity old, GpsEntity gps){ | ||
| 98 | - if(old != null && | ||
| 99 | - old.getTimestamp().equals(gps.getTimestamp()) && | ||
| 100 | - old.getLat().equals(gps.getLat()) && | ||
| 101 | - old.getLon().equals(gps.getLon())) | ||
| 102 | - return true; | ||
| 103 | - return false; | ||
| 104 | - } | ||
| 105 | - | ||
| 106 | - @Override | ||
| 107 | - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | ||
| 108 | - gpsRealData = applicationContext.getBean(GpsRealData.class); | ||
| 109 | - } | ||
| 110 | - | ||
| 111 | - @Override | ||
| 112 | - public void afterPropertiesSet() throws Exception { | ||
| 113 | - url = SystemParamCache.getUrlHttpGpsReal(); | ||
| 114 | - list = new ArrayList<>(); | ||
| 115 | - httpClient = HttpClients.createDefault(); | ||
| 116 | - get = new HttpGet(url); | ||
| 117 | - requestConfig = RequestConfig.custom() | ||
| 118 | - .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 119 | - .setSocketTimeout(2500).build(); | ||
| 120 | - get.setConfig(requestConfig); | ||
| 121 | - } | ||
| 122 | -} | 1 | +package com.bsth.data.gpsdata_v2.load; |
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import com.bsth.data.BasicData; | ||
| 5 | +import com.bsth.data.SystemParamCache; | ||
| 6 | +import com.bsth.data.gpsdata_v2.GpsRealData; | ||
| 7 | +import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 8 | +import com.bsth.data.gpsdata_v2.utils.GpsDataUtils; | ||
| 9 | +import org.apache.commons.lang3.StringUtils; | ||
| 10 | +import org.apache.http.HttpEntity; | ||
| 11 | +import org.apache.http.client.config.RequestConfig; | ||
| 12 | +import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 13 | +import org.apache.http.client.methods.HttpGet; | ||
| 14 | +import org.apache.http.impl.client.CloseableHttpClient; | ||
| 15 | +import org.apache.http.impl.client.HttpClients; | ||
| 16 | +import org.slf4j.Logger; | ||
| 17 | +import org.slf4j.LoggerFactory; | ||
| 18 | +import org.springframework.beans.BeansException; | ||
| 19 | +import org.springframework.beans.factory.InitializingBean; | ||
| 20 | +import org.springframework.context.ApplicationContext; | ||
| 21 | +import org.springframework.context.ApplicationContextAware; | ||
| 22 | +import org.springframework.stereotype.Component; | ||
| 23 | + | ||
| 24 | +import java.io.BufferedReader; | ||
| 25 | +import java.io.InputStreamReader; | ||
| 26 | +import java.util.ArrayList; | ||
| 27 | +import java.util.List; | ||
| 28 | + | ||
| 29 | +/** | ||
| 30 | + * 从网关http 接口加载数据 | ||
| 31 | + * Created by panzhao on 2017/11/15. | ||
| 32 | + */ | ||
| 33 | +@Component | ||
| 34 | +public class GatewayHttpLoader implements ApplicationContextAware, InitializingBean { | ||
| 35 | + | ||
| 36 | + static Logger logger = LoggerFactory.getLogger(GatewayHttpLoader.class); | ||
| 37 | + | ||
| 38 | + static String url; | ||
| 39 | + static List<GpsEntity> list; | ||
| 40 | + static CloseableHttpClient httpClient = null; | ||
| 41 | + static HttpGet get; | ||
| 42 | + static RequestConfig requestConfig; | ||
| 43 | + static CloseableHttpResponse response; | ||
| 44 | + static HttpEntity entity; | ||
| 45 | + static BufferedReader br; | ||
| 46 | + | ||
| 47 | + static GpsRealData gpsRealData; | ||
| 48 | + | ||
| 49 | + public static List<GpsEntity> load(){ | ||
| 50 | + try{ | ||
| 51 | + if(list.size() > 0) | ||
| 52 | + list.clear(); | ||
| 53 | + | ||
| 54 | + response = httpClient.execute(get); | ||
| 55 | + entity = response.getEntity(); | ||
| 56 | + | ||
| 57 | + logger.info("entity:" + entity + "get:" + get); | ||
| 58 | + if(null == entity) | ||
| 59 | + return list; | ||
| 60 | + | ||
| 61 | + br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 62 | + | ||
| 63 | + StringBuilder sb = new StringBuilder(); | ||
| 64 | + String str; | ||
| 65 | + while ((str = br.readLine()) != null) | ||
| 66 | + sb.append(str); | ||
| 67 | + | ||
| 68 | + logger.debug("gps:" + sb.toString()); | ||
| 69 | + list = JSON.parseArray(JSON.parseObject(sb.toString()).getString("data"), GpsEntity.class); | ||
| 70 | + //过滤掉无效的点位 | ||
| 71 | + list = GpsDataUtils.clearInvalid(list); | ||
| 72 | + | ||
| 73 | + List<GpsEntity> ups = new ArrayList<>(); | ||
| 74 | + String nbbm; | ||
| 75 | + for (GpsEntity gps : list) { | ||
| 76 | + if (StringUtils.isBlank(gps.getDeviceId())) | ||
| 77 | + continue; | ||
| 78 | + | ||
| 79 | + if (gps_equals(gpsRealData.get(gps.getDeviceId()), gps)) | ||
| 80 | + continue; | ||
| 81 | + | ||
| 82 | + nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); | ||
| 83 | + gps.setNbbm(nbbm); | ||
| 84 | + ups.add(gps); | ||
| 85 | + } | ||
| 86 | + list = ups; | ||
| 87 | + | ||
| 88 | + if (null != response) | ||
| 89 | + response.close(); | ||
| 90 | + }catch (Exception e){ | ||
| 91 | + logger.error("", e); | ||
| 92 | + } | ||
| 93 | + return list; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + | ||
| 97 | + private static boolean gps_equals(GpsEntity old, GpsEntity gps){ | ||
| 98 | + if(old != null && | ||
| 99 | + old.getTimestamp().equals(gps.getTimestamp()) && | ||
| 100 | + old.getLat().equals(gps.getLat()) && | ||
| 101 | + old.getLon().equals(gps.getLon())) | ||
| 102 | + return true; | ||
| 103 | + return false; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + @Override | ||
| 107 | + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | ||
| 108 | + gpsRealData = applicationContext.getBean(GpsRealData.class); | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + @Override | ||
| 112 | + public void afterPropertiesSet() throws Exception { | ||
| 113 | + url = SystemParamCache.getUrlHttpGpsReal(); | ||
| 114 | + list = new ArrayList<>(); | ||
| 115 | + httpClient = HttpClients.createDefault(); | ||
| 116 | + get = new HttpGet(url); | ||
| 117 | + requestConfig = RequestConfig.custom() | ||
| 118 | + .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 119 | + .setSocketTimeout(2500).build(); | ||
| 120 | + get.setConfig(requestConfig); | ||
| 121 | + } | ||
| 122 | +} |
src/main/java/com/bsth/data/gpsdata_v2/load/SocketClientLoader.java
| 1 | -package com.bsth.data.gpsdata_v2.load; | ||
| 2 | - | ||
| 3 | -import com.alibaba.fastjson.JSON; | ||
| 4 | -import com.bsth.data.BasicData; | ||
| 5 | -import com.bsth.data.SystemParamCache; | ||
| 6 | -import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 7 | -import com.bsth.data.gpsdata_v2.utils.GpsDataUtils; | ||
| 8 | -import org.apache.http.HttpEntity; | ||
| 9 | -import org.apache.http.client.config.RequestConfig; | ||
| 10 | -import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 11 | -import org.apache.http.client.methods.HttpGet; | ||
| 12 | -import org.apache.http.impl.client.CloseableHttpClient; | ||
| 13 | -import org.apache.http.impl.client.HttpClients; | ||
| 14 | -import org.slf4j.Logger; | ||
| 15 | -import org.slf4j.LoggerFactory; | ||
| 16 | -import org.springframework.beans.factory.InitializingBean; | ||
| 17 | -import org.springframework.stereotype.Component; | ||
| 18 | - | ||
| 19 | -import java.io.BufferedReader; | ||
| 20 | -import java.io.InputStreamReader; | ||
| 21 | -import java.util.ArrayList; | ||
| 22 | -import java.util.List; | ||
| 23 | - | ||
| 24 | -/** | ||
| 25 | - * 从专用的socket client 加载数据 | ||
| 26 | - * Created by panzhao on 2017/11/15. | ||
| 27 | - */ | ||
| 28 | -@Component | ||
| 29 | -public class SocketClientLoader implements InitializingBean { | ||
| 30 | - | ||
| 31 | - static Logger logger = LoggerFactory.getLogger(SocketClientLoader.class); | ||
| 32 | - | ||
| 33 | - static String url; | ||
| 34 | - static List<GpsEntity> list; | ||
| 35 | - static CloseableHttpClient httpClient = null; | ||
| 36 | - static HttpGet get; | ||
| 37 | - static RequestConfig requestConfig; | ||
| 38 | - static CloseableHttpResponse response; | ||
| 39 | - static HttpEntity entity; | ||
| 40 | - static BufferedReader br; | ||
| 41 | - | ||
| 42 | - public static List<GpsEntity> load(){ | ||
| 43 | - try { | ||
| 44 | - if(list.size() > 0) | ||
| 45 | - list.clear(); | ||
| 46 | - logger.info("load start..."); | ||
| 47 | - response = httpClient.execute(get); | ||
| 48 | - entity = response.getEntity(); | ||
| 49 | - if(null == entity) | ||
| 50 | - return list; | ||
| 51 | - | ||
| 52 | - br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 53 | - StringBuilder sb = new StringBuilder(); | ||
| 54 | - String str; | ||
| 55 | - while ((str = br.readLine()) != null) | ||
| 56 | - sb.append(str); | ||
| 57 | - | ||
| 58 | - list = JSON.parseArray(sb.toString(), GpsEntity.class); | ||
| 59 | - | ||
| 60 | - logger.info("load end ! size: " + list.size()); | ||
| 61 | - //过滤掉无效的点位 | ||
| 62 | - list = GpsDataUtils.clearInvalid(list); | ||
| 63 | - | ||
| 64 | - for (GpsEntity gps : list) { | ||
| 65 | - gps.setNbbm(BasicData.deviceId2NbbmMap.get(gps.getDeviceId())); | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - if (null != response) | ||
| 69 | - response.close(); | ||
| 70 | - } catch (Exception e) { | ||
| 71 | - logger.error("", e); | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - return list; | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | - @Override | ||
| 78 | - public void afterPropertiesSet() throws Exception { | ||
| 79 | - url = SystemParamCache.getUrlHttpGpsRealCache(); | ||
| 80 | - list = new ArrayList<>(); | ||
| 81 | - httpClient = HttpClients.createDefault(); | ||
| 82 | - get = new HttpGet(url); | ||
| 83 | - requestConfig = RequestConfig.custom() | ||
| 84 | - .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 85 | - .setSocketTimeout(2500).build(); | ||
| 86 | - get.setConfig(requestConfig); | ||
| 87 | - } | ||
| 88 | -} | 1 | +package com.bsth.data.gpsdata_v2.load; |
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import com.bsth.data.BasicData; | ||
| 5 | +import com.bsth.data.SystemParamCache; | ||
| 6 | +import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 7 | +import com.bsth.data.gpsdata_v2.utils.GpsDataUtils; | ||
| 8 | +import org.apache.http.HttpEntity; | ||
| 9 | +import org.apache.http.client.config.RequestConfig; | ||
| 10 | +import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 11 | +import org.apache.http.client.methods.HttpGet; | ||
| 12 | +import org.apache.http.impl.client.CloseableHttpClient; | ||
| 13 | +import org.apache.http.impl.client.HttpClients; | ||
| 14 | +import org.slf4j.Logger; | ||
| 15 | +import org.slf4j.LoggerFactory; | ||
| 16 | +import org.springframework.beans.factory.InitializingBean; | ||
| 17 | +import org.springframework.stereotype.Component; | ||
| 18 | + | ||
| 19 | +import java.io.BufferedReader; | ||
| 20 | +import java.io.InputStreamReader; | ||
| 21 | +import java.util.ArrayList; | ||
| 22 | +import java.util.List; | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * 从专用的socket client 加载数据 | ||
| 26 | + * Created by panzhao on 2017/11/15. | ||
| 27 | + */ | ||
| 28 | +@Component | ||
| 29 | +public class SocketClientLoader implements InitializingBean { | ||
| 30 | + | ||
| 31 | + static Logger logger = LoggerFactory.getLogger(SocketClientLoader.class); | ||
| 32 | + | ||
| 33 | + static String url; | ||
| 34 | + static List<GpsEntity> list; | ||
| 35 | + static CloseableHttpClient httpClient = null; | ||
| 36 | + static HttpGet get; | ||
| 37 | + static RequestConfig requestConfig; | ||
| 38 | + static CloseableHttpResponse response; | ||
| 39 | + static HttpEntity entity; | ||
| 40 | + static BufferedReader br; | ||
| 41 | + | ||
| 42 | + public static List<GpsEntity> load(){ | ||
| 43 | + try { | ||
| 44 | + if(list.size() > 0) | ||
| 45 | + list.clear(); | ||
| 46 | + logger.info("load start..."); | ||
| 47 | + response = httpClient.execute(get); | ||
| 48 | + entity = response.getEntity(); | ||
| 49 | + if(null == entity) | ||
| 50 | + return list; | ||
| 51 | + | ||
| 52 | + br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 53 | + StringBuilder sb = new StringBuilder(); | ||
| 54 | + String str; | ||
| 55 | + while ((str = br.readLine()) != null) | ||
| 56 | + sb.append(str); | ||
| 57 | + | ||
| 58 | + list = JSON.parseArray(sb.toString(), GpsEntity.class); | ||
| 59 | + | ||
| 60 | + logger.info("load end ! size: " + list.size()); | ||
| 61 | + //过滤掉无效的点位 | ||
| 62 | + list = GpsDataUtils.clearInvalid(list); | ||
| 63 | + | ||
| 64 | + for (GpsEntity gps : list) { | ||
| 65 | + gps.setNbbm(BasicData.deviceId2NbbmMap.get(gps.getDeviceId())); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + if (null != response) | ||
| 69 | + response.close(); | ||
| 70 | + } catch (Exception e) { | ||
| 71 | + logger.error("", e); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + return list; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + @Override | ||
| 78 | + public void afterPropertiesSet() throws Exception { | ||
| 79 | + url = SystemParamCache.getUrlHttpGpsRealCache(); | ||
| 80 | + list = new ArrayList<>(); | ||
| 81 | + httpClient = HttpClients.createDefault(); | ||
| 82 | + get = new HttpGet(url); | ||
| 83 | + requestConfig = RequestConfig.custom() | ||
| 84 | + .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 85 | + .setSocketTimeout(2500).build(); | ||
| 86 | + get.setConfig(requestConfig); | ||
| 87 | + } | ||
| 88 | +} |
src/main/java/com/bsth/data/maintenance_plan/MtPlanDataLoadThread.java
| 1 | -package com.bsth.data.maintenance_plan; | ||
| 2 | - | ||
| 3 | -import com.bsth.data.SystemParamCache; | ||
| 4 | -import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 5 | -import org.apache.http.HttpEntity; | ||
| 6 | -import org.apache.http.client.config.RequestConfig; | ||
| 7 | -import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 8 | -import org.apache.http.client.methods.HttpGet; | ||
| 9 | -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; | ||
| 10 | -import org.apache.http.impl.client.CloseableHttpClient; | ||
| 11 | -import org.apache.http.impl.client.HttpClients; | ||
| 12 | -import org.joda.time.DateTime; | ||
| 13 | -import org.slf4j.Logger; | ||
| 14 | -import org.slf4j.LoggerFactory; | ||
| 15 | -import org.springframework.beans.factory.InitializingBean; | ||
| 16 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 17 | -import org.springframework.beans.factory.annotation.Value; | ||
| 18 | -import org.springframework.stereotype.Component; | ||
| 19 | - | ||
| 20 | -import javax.net.ssl.*; | ||
| 21 | -import java.io.BufferedReader; | ||
| 22 | -import java.io.InputStreamReader; | ||
| 23 | -import java.security.cert.CertificateException; | ||
| 24 | -import java.security.cert.X509Certificate; | ||
| 25 | -import java.util.List; | ||
| 26 | -import java.util.Map; | ||
| 27 | - | ||
| 28 | -/** | ||
| 29 | - * 维修保养计划 | ||
| 30 | - * @author Hill | ||
| 31 | - */ | ||
| 32 | -@Component | ||
| 33 | -public class MtPlanDataLoadThread extends Thread implements InitializingBean { | ||
| 34 | - | ||
| 35 | - private Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 36 | - | ||
| 37 | - private String url = SystemParamCache.getUrlHttpMaintenance(); | ||
| 38 | - private CloseableHttpClient httpClient; | ||
| 39 | - private RequestConfig requestConfig; | ||
| 40 | - private CloseableHttpResponse response; | ||
| 41 | - private HttpEntity entity; | ||
| 42 | - private BufferedReader br; | ||
| 43 | - | ||
| 44 | - private final static String HTTPS = "https://"; | ||
| 45 | - | ||
| 46 | - private SSLConnectionSocketFactory sslConnectionSocketFactory; | ||
| 47 | - | ||
| 48 | - @Autowired | ||
| 49 | - private ObjectMapper objectMapper; | ||
| 50 | - | ||
| 51 | - public CloseableHttpClient defaultHttpClient(String url) { | ||
| 52 | - if (url.startsWith(HTTPS)) { | ||
| 53 | - return HttpClients.custom().setSSLSocketFactory(sslConnectionSocketFactory).build(); | ||
| 54 | - } | ||
| 55 | - return HttpClients.createDefault(); | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - @Override | ||
| 59 | - public void run() { | ||
| 60 | - logger.warn("维修保养计划获取数据开始"); | ||
| 61 | - List<MaintenancePlan> list; | ||
| 62 | - StringBuilder sb = new StringBuilder(url); | ||
| 63 | - try { | ||
| 64 | - HttpGet get = new HttpGet(sb.append("?date=").append(new DateTime().toString("yyyy-MM-dd")).toString()); | ||
| 65 | - get.setConfig(requestConfig); | ||
| 66 | - response = httpClient.execute(get); | ||
| 67 | - | ||
| 68 | - int statusCode = response.getStatusLine().getStatusCode(); | ||
| 69 | - if(statusCode != 200){ | ||
| 70 | - logger.error("http client status code: " + statusCode); | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - entity = response.getEntity(); | ||
| 74 | - if (null != entity) { | ||
| 75 | - br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 76 | - StringBuffer stringBuffer = new StringBuffer(); | ||
| 77 | - String str = ""; | ||
| 78 | - while ((str = br.readLine()) != null) { | ||
| 79 | - stringBuffer.append(str); | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - //stringBuffer = new StringBuffer("{\"result\": [{\"gsmc\": \"杨高公司\", \"zbh\": \"S01-002\", \"bysj\": 1663171200000, \"bydj\": \"一级保养\", \"bydd\": \"成山路\"}], \"msg\": \"成功\", \"code\": \"200\", \"success\": true}"); | ||
| 83 | - Map map = objectMapper.readValue(stringBuffer.toString(), Map.class); | ||
| 84 | - list = objectMapper.readValue(objectMapper.writeValueAsString(map.get("result")), objectMapper.getTypeFactory().constructParametricType(List.class, MaintenancePlan.class)); | ||
| 85 | - | ||
| 86 | - for (MaintenancePlan sd : list) { | ||
| 87 | - MtPlanCenter.put(sd); | ||
| 88 | - } | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - if (null != response) | ||
| 92 | - response.close(); | ||
| 93 | - } catch (Exception e) { | ||
| 94 | - logger.error("维修保养计划接口报错了", e); | ||
| 95 | - } | ||
| 96 | - logger.warn("维修保养计划获取数据结束"); | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - @Override | ||
| 100 | - public void afterPropertiesSet() throws Exception { | ||
| 101 | - try { | ||
| 102 | - SSLContext sslCtx = SSLContext.getInstance("TLSv1.2"); | ||
| 103 | - sslCtx.init(null, new TrustManager[] { | ||
| 104 | - new X509TrustManager() { | ||
| 105 | - @Override | ||
| 106 | - public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { | ||
| 107 | - } | ||
| 108 | - | ||
| 109 | - @Override | ||
| 110 | - public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { | ||
| 111 | - } | ||
| 112 | - | ||
| 113 | - @Override | ||
| 114 | - public X509Certificate[] getAcceptedIssuers() { | ||
| 115 | - return null; | ||
| 116 | - } | ||
| 117 | - } | ||
| 118 | - }, null); | ||
| 119 | - sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslCtx, new HostnameVerifier() { | ||
| 120 | - | ||
| 121 | - @Override | ||
| 122 | - public boolean verify(String hostname, SSLSession session) { | ||
| 123 | - // TODO Auto-generated method stub | ||
| 124 | - return true; | ||
| 125 | - } | ||
| 126 | - }); | ||
| 127 | - } catch (Exception e) { | ||
| 128 | - logger.error("SSL context set fail: {}", e); | ||
| 129 | - } | ||
| 130 | - | ||
| 131 | - httpClient = defaultHttpClient(url); | ||
| 132 | - | ||
| 133 | - requestConfig = RequestConfig.custom() | ||
| 134 | - .setConnectTimeout(5500).setConnectionRequestTimeout(5000) | ||
| 135 | - .setSocketTimeout(5500).build(); | ||
| 136 | - } | ||
| 137 | -} | 1 | +package com.bsth.data.maintenance_plan; |
| 2 | + | ||
| 3 | +import com.bsth.data.SystemParamCache; | ||
| 4 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 5 | +import org.apache.http.HttpEntity; | ||
| 6 | +import org.apache.http.client.config.RequestConfig; | ||
| 7 | +import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 8 | +import org.apache.http.client.methods.HttpGet; | ||
| 9 | +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; | ||
| 10 | +import org.apache.http.impl.client.CloseableHttpClient; | ||
| 11 | +import org.apache.http.impl.client.HttpClients; | ||
| 12 | +import org.joda.time.DateTime; | ||
| 13 | +import org.slf4j.Logger; | ||
| 14 | +import org.slf4j.LoggerFactory; | ||
| 15 | +import org.springframework.beans.factory.InitializingBean; | ||
| 16 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 17 | +import org.springframework.beans.factory.annotation.Value; | ||
| 18 | +import org.springframework.stereotype.Component; | ||
| 19 | + | ||
| 20 | +import javax.net.ssl.*; | ||
| 21 | +import java.io.BufferedReader; | ||
| 22 | +import java.io.InputStreamReader; | ||
| 23 | +import java.security.cert.CertificateException; | ||
| 24 | +import java.security.cert.X509Certificate; | ||
| 25 | +import java.util.List; | ||
| 26 | +import java.util.Map; | ||
| 27 | + | ||
| 28 | +/** | ||
| 29 | + * 维修保养计划 | ||
| 30 | + * @author Hill | ||
| 31 | + */ | ||
| 32 | +@Component | ||
| 33 | +public class MtPlanDataLoadThread extends Thread implements InitializingBean { | ||
| 34 | + | ||
| 35 | + private Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 36 | + | ||
| 37 | + private String url = SystemParamCache.getUrlHttpMaintenance(); | ||
| 38 | + private CloseableHttpClient httpClient; | ||
| 39 | + private RequestConfig requestConfig; | ||
| 40 | + private CloseableHttpResponse response; | ||
| 41 | + private HttpEntity entity; | ||
| 42 | + private BufferedReader br; | ||
| 43 | + | ||
| 44 | + private final static String HTTPS = "https://"; | ||
| 45 | + | ||
| 46 | + private SSLConnectionSocketFactory sslConnectionSocketFactory; | ||
| 47 | + | ||
| 48 | + @Autowired | ||
| 49 | + private ObjectMapper objectMapper; | ||
| 50 | + | ||
| 51 | + public CloseableHttpClient defaultHttpClient(String url) { | ||
| 52 | + if (url.startsWith(HTTPS)) { | ||
| 53 | + return HttpClients.custom().setSSLSocketFactory(sslConnectionSocketFactory).build(); | ||
| 54 | + } | ||
| 55 | + return HttpClients.createDefault(); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + @Override | ||
| 59 | + public void run() { | ||
| 60 | + logger.warn("维修保养计划获取数据开始"); | ||
| 61 | + List<MaintenancePlan> list; | ||
| 62 | + StringBuilder sb = new StringBuilder(url); | ||
| 63 | + try { | ||
| 64 | + HttpGet get = new HttpGet(sb.append("?date=").append(new DateTime().toString("yyyy-MM-dd")).toString()); | ||
| 65 | + get.setConfig(requestConfig); | ||
| 66 | + response = httpClient.execute(get); | ||
| 67 | + | ||
| 68 | + int statusCode = response.getStatusLine().getStatusCode(); | ||
| 69 | + if(statusCode != 200){ | ||
| 70 | + logger.error("http client status code: " + statusCode); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + entity = response.getEntity(); | ||
| 74 | + if (null != entity) { | ||
| 75 | + br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 76 | + StringBuffer stringBuffer = new StringBuffer(); | ||
| 77 | + String str = ""; | ||
| 78 | + while ((str = br.readLine()) != null) { | ||
| 79 | + stringBuffer.append(str); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + //stringBuffer = new StringBuffer("{\"result\": [{\"gsmc\": \"杨高公司\", \"zbh\": \"S01-002\", \"bysj\": 1663171200000, \"bydj\": \"一级保养\", \"bydd\": \"成山路\"}], \"msg\": \"成功\", \"code\": \"200\", \"success\": true}"); | ||
| 83 | + Map map = objectMapper.readValue(stringBuffer.toString(), Map.class); | ||
| 84 | + list = objectMapper.readValue(objectMapper.writeValueAsString(map.get("result")), objectMapper.getTypeFactory().constructParametricType(List.class, MaintenancePlan.class)); | ||
| 85 | + | ||
| 86 | + for (MaintenancePlan sd : list) { | ||
| 87 | + MtPlanCenter.put(sd); | ||
| 88 | + } | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + if (null != response) | ||
| 92 | + response.close(); | ||
| 93 | + } catch (Exception e) { | ||
| 94 | + logger.error("维修保养计划接口报错了", e); | ||
| 95 | + } | ||
| 96 | + logger.warn("维修保养计划获取数据结束"); | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + @Override | ||
| 100 | + public void afterPropertiesSet() throws Exception { | ||
| 101 | + try { | ||
| 102 | + SSLContext sslCtx = SSLContext.getInstance("TLSv1.2"); | ||
| 103 | + sslCtx.init(null, new TrustManager[] { | ||
| 104 | + new X509TrustManager() { | ||
| 105 | + @Override | ||
| 106 | + public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + @Override | ||
| 110 | + public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + @Override | ||
| 114 | + public X509Certificate[] getAcceptedIssuers() { | ||
| 115 | + return null; | ||
| 116 | + } | ||
| 117 | + } | ||
| 118 | + }, null); | ||
| 119 | + sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslCtx, new HostnameVerifier() { | ||
| 120 | + | ||
| 121 | + @Override | ||
| 122 | + public boolean verify(String hostname, SSLSession session) { | ||
| 123 | + // TODO Auto-generated method stub | ||
| 124 | + return true; | ||
| 125 | + } | ||
| 126 | + }); | ||
| 127 | + } catch (Exception e) { | ||
| 128 | + logger.error("SSL context set fail: {}", e); | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + httpClient = defaultHttpClient(url); | ||
| 132 | + | ||
| 133 | + requestConfig = RequestConfig.custom() | ||
| 134 | + .setConnectTimeout(5500).setConnectionRequestTimeout(5000) | ||
| 135 | + .setSocketTimeout(5500).build(); | ||
| 136 | + } | ||
| 137 | +} |
src/main/java/com/bsth/entity/oil/Dlb.java
| 1 | -package com.bsth.entity.oil; | ||
| 2 | - | ||
| 3 | -import java.text.DecimalFormat; | ||
| 4 | -import java.util.Date; | ||
| 5 | - | ||
| 6 | -import javax.persistence.*; | ||
| 7 | - | ||
| 8 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | - | ||
| 10 | -import com.bsth.data.BasicData; | ||
| 11 | - | ||
| 12 | -@Entity | ||
| 13 | -@Table(name = "bsth_c_dlb") | ||
| 14 | -public class Dlb { | ||
| 15 | - @Id | ||
| 16 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 17 | - private Integer id; | ||
| 18 | - @DateTimeFormat(pattern="yyyy-MM-dd") | ||
| 19 | - private Date rq; | ||
| 20 | - private String xlbm; | ||
| 21 | - private String linename; | ||
| 22 | - private String ssgsdm; | ||
| 23 | - private String fgsdm; | ||
| 24 | - private String nbbm; | ||
| 25 | - private String jsy; | ||
| 26 | - private Double czlc=0.0; | ||
| 27 | - private Double jzlc=0.0; | ||
| 28 | - //出站存电 | ||
| 29 | - private Double czcd=0.0; | ||
| 30 | - //进站存电 | ||
| 31 | - private Double jzcd=0.0; | ||
| 32 | - //充电量 | ||
| 33 | - private Double cdl; | ||
| 34 | - private int sfkt; | ||
| 35 | - private String jhsj; | ||
| 36 | - //耗电 | ||
| 37 | - private Double hd=0.0; | ||
| 38 | - private Double sh=0.0; | ||
| 39 | - private String shyy; | ||
| 40 | - private Double zlc=0.0; | ||
| 41 | - private int yhlx; | ||
| 42 | - | ||
| 43 | - private Double ns=0.0; | ||
| 44 | - private Double fyylc=0.0; | ||
| 45 | - private Double jhzlc=0.0; | ||
| 46 | - private Double jhfyylc=0.0; | ||
| 47 | - private int jhzbc; | ||
| 48 | - private int jhbc; | ||
| 49 | - private int sjzbc; | ||
| 50 | - private int sjbc; | ||
| 51 | - private String edituser; | ||
| 52 | - private Date edittime; | ||
| 53 | - private Date createtime; | ||
| 54 | - private Date updatetime; | ||
| 55 | - private int nylx; | ||
| 56 | - //进场顺序(根据最先出场和最后进场来关联车辆的存电量) | ||
| 57 | - private int jcsx; | ||
| 58 | - | ||
| 59 | - private String jname; | ||
| 60 | - @Transient | ||
| 61 | - private String name; | ||
| 62 | - @Transient | ||
| 63 | - private String bglyh; | ||
| 64 | - | ||
| 65 | - @Transient | ||
| 66 | - private String xlname; | ||
| 67 | - | ||
| 68 | - @Transient | ||
| 69 | - private String gsname; | ||
| 70 | - | ||
| 71 | - @Transient | ||
| 72 | - private String fgsname; | ||
| 73 | - | ||
| 74 | - | ||
| 75 | - | ||
| 76 | - private String lp; | ||
| 77 | - | ||
| 78 | - public Integer getId() { | ||
| 79 | - return id; | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - public void setId(Integer id) { | ||
| 83 | - this.id = id; | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - public Date getRq() { | ||
| 87 | - return rq; | ||
| 88 | - } | ||
| 89 | - | ||
| 90 | - public void setRq(Date rq) { | ||
| 91 | - this.rq = rq; | ||
| 92 | - } | ||
| 93 | - | ||
| 94 | - public String getXlbm() { | ||
| 95 | - return xlbm; | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | - public void setXlbm(String xlbm) { | ||
| 99 | - this.xlbm = xlbm; | ||
| 100 | - } | ||
| 101 | - | ||
| 102 | - public String getLinename() { | ||
| 103 | - return linename; | ||
| 104 | - } | ||
| 105 | - | ||
| 106 | - public void setLinename(String linename) { | ||
| 107 | - this.linename = linename; | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | - public String getSsgsdm() { | ||
| 111 | - return ssgsdm; | ||
| 112 | - } | ||
| 113 | - | ||
| 114 | - public void setSsgsdm(String ssgsdm) { | ||
| 115 | - this.ssgsdm = ssgsdm; | ||
| 116 | - } | ||
| 117 | - | ||
| 118 | - public String getFgsdm() { | ||
| 119 | - return fgsdm; | ||
| 120 | - } | ||
| 121 | - | ||
| 122 | - public void setFgsdm(String fgsdm) { | ||
| 123 | - this.fgsdm = fgsdm; | ||
| 124 | - } | ||
| 125 | - | ||
| 126 | - public String getNbbm() { | ||
| 127 | - return nbbm; | ||
| 128 | - } | ||
| 129 | - | ||
| 130 | - public void setNbbm(String nbbm) { | ||
| 131 | - this.nbbm = nbbm; | ||
| 132 | - } | ||
| 133 | - | ||
| 134 | - public String getJsy() { | ||
| 135 | - return jsy; | ||
| 136 | - } | ||
| 137 | - | ||
| 138 | - public void setJsy(String jsy) { | ||
| 139 | - this.jsy = jsy; | ||
| 140 | - } | ||
| 141 | - | ||
| 142 | - public Double getCzlc() { | ||
| 143 | - return czlc; | ||
| 144 | - } | ||
| 145 | - | ||
| 146 | - public void setCzlc(Double czlc) { | ||
| 147 | - this.czlc = czlc; | ||
| 148 | - } | ||
| 149 | - | ||
| 150 | - public Double getJzlc() { | ||
| 151 | - return jzlc; | ||
| 152 | - } | ||
| 153 | - | ||
| 154 | - public void setJzlc(Double jzlc) { | ||
| 155 | - this.jzlc = jzlc; | ||
| 156 | - } | ||
| 157 | - | ||
| 158 | - public Double getCzcd() { | ||
| 159 | - return czcd; | ||
| 160 | - } | ||
| 161 | - | ||
| 162 | - public void setCzcd(Double czcd) { | ||
| 163 | - this.czcd = czcd; | ||
| 164 | - } | ||
| 165 | - | ||
| 166 | - public Double getJzcd() { | ||
| 167 | - return jzcd; | ||
| 168 | - } | ||
| 169 | - | ||
| 170 | - public void setJzcd(Double jzcd) { | ||
| 171 | - this.jzcd = jzcd; | ||
| 172 | - } | ||
| 173 | - | ||
| 174 | - public Double getCdl() { | ||
| 175 | - return cdl; | ||
| 176 | - } | ||
| 177 | - | ||
| 178 | - public void setCdl(Double cdl) { | ||
| 179 | - this.cdl = cdl; | ||
| 180 | - } | ||
| 181 | - | ||
| 182 | - public int getSfkt() { | ||
| 183 | - return sfkt; | ||
| 184 | - } | ||
| 185 | - | ||
| 186 | - public void setSfkt(int sfkt) { | ||
| 187 | - this.sfkt = sfkt; | ||
| 188 | - } | ||
| 189 | - | ||
| 190 | - public String getJhsj() { | ||
| 191 | - return jhsj; | ||
| 192 | - } | ||
| 193 | - | ||
| 194 | - public void setJhsj(String jhsj) { | ||
| 195 | - this.jhsj = jhsj; | ||
| 196 | - } | ||
| 197 | - | ||
| 198 | - public Double getHd() { | ||
| 199 | - return hd; | ||
| 200 | - } | ||
| 201 | - | ||
| 202 | - public void setHd(Double hd) { | ||
| 203 | - this.hd = hd; | ||
| 204 | - } | ||
| 205 | - | ||
| 206 | - public Double getSh() { | ||
| 207 | - return sh; | ||
| 208 | - } | ||
| 209 | - | ||
| 210 | - public void setSh(Double sh) { | ||
| 211 | - this.sh = sh; | ||
| 212 | - } | ||
| 213 | - | ||
| 214 | - public String getShyy() { | ||
| 215 | - return shyy; | ||
| 216 | - } | ||
| 217 | - | ||
| 218 | - public void setShyy(String shyy) { | ||
| 219 | - this.shyy = shyy; | ||
| 220 | - } | ||
| 221 | - | ||
| 222 | - public Double getZlc() { | ||
| 223 | - return zlc; | ||
| 224 | - } | ||
| 225 | - | ||
| 226 | - public void setZlc(Double zlc) { | ||
| 227 | - this.zlc = zlc; | ||
| 228 | - } | ||
| 229 | - | ||
| 230 | - public int getYhlx() { | ||
| 231 | - return yhlx; | ||
| 232 | - } | ||
| 233 | - | ||
| 234 | - public void setYhlx(int yhlx) { | ||
| 235 | - this.yhlx = yhlx; | ||
| 236 | - } | ||
| 237 | - | ||
| 238 | - public Double getNs() { | ||
| 239 | - return ns; | ||
| 240 | - } | ||
| 241 | - | ||
| 242 | - public void setNs(Double ns) { | ||
| 243 | - this.ns = ns; | ||
| 244 | - } | ||
| 245 | - | ||
| 246 | - public Double getFyylc() { | ||
| 247 | - return fyylc; | ||
| 248 | - } | ||
| 249 | - | ||
| 250 | - public void setFyylc(Double fyylc) { | ||
| 251 | - this.fyylc = fyylc; | ||
| 252 | - } | ||
| 253 | - | ||
| 254 | - public Double getJhzlc() { | ||
| 255 | - return jhzlc; | ||
| 256 | - } | ||
| 257 | - | ||
| 258 | - public void setJhzlc(Double jhzlc) { | ||
| 259 | - this.jhzlc = jhzlc; | ||
| 260 | - } | ||
| 261 | - | ||
| 262 | - public Double getJhfyylc() { | ||
| 263 | - return jhfyylc; | ||
| 264 | - } | ||
| 265 | - | ||
| 266 | - public void setJhfyylc(Double jhfyylc) { | ||
| 267 | - this.jhfyylc = jhfyylc; | ||
| 268 | - } | ||
| 269 | - | ||
| 270 | - public int getJhzbc() { | ||
| 271 | - return jhzbc; | ||
| 272 | - } | ||
| 273 | - | ||
| 274 | - public void setJhzbc(int jhzbc) { | ||
| 275 | - this.jhzbc = jhzbc; | ||
| 276 | - } | ||
| 277 | - | ||
| 278 | - public int getJhbc() { | ||
| 279 | - return jhbc; | ||
| 280 | - } | ||
| 281 | - | ||
| 282 | - public void setJhbc(int jhbc) { | ||
| 283 | - this.jhbc = jhbc; | ||
| 284 | - } | ||
| 285 | - | ||
| 286 | - public int getSjzbc() { | ||
| 287 | - return sjzbc; | ||
| 288 | - } | ||
| 289 | - | ||
| 290 | - public void setSjzbc(int sjzbc) { | ||
| 291 | - this.sjzbc = sjzbc; | ||
| 292 | - } | ||
| 293 | - | ||
| 294 | - public int getSjbc() { | ||
| 295 | - return sjbc; | ||
| 296 | - } | ||
| 297 | - | ||
| 298 | - public void setSjbc(int sjbc) { | ||
| 299 | - this.sjbc = sjbc; | ||
| 300 | - } | ||
| 301 | - | ||
| 302 | - public String getEdituser() { | ||
| 303 | - return edituser; | ||
| 304 | - } | ||
| 305 | - | ||
| 306 | - public void setEdituser(String edituser) { | ||
| 307 | - this.edituser = edituser; | ||
| 308 | - } | ||
| 309 | - | ||
| 310 | - public Date getEdittime() { | ||
| 311 | - return edittime; | ||
| 312 | - } | ||
| 313 | - | ||
| 314 | - public void setEdittime(Date edittime) { | ||
| 315 | - this.edittime = edittime; | ||
| 316 | - } | ||
| 317 | - | ||
| 318 | - public Date getCreatetime() { | ||
| 319 | - return createtime; | ||
| 320 | - } | ||
| 321 | - | ||
| 322 | - public void setCreatetime(Date createtime) { | ||
| 323 | - this.createtime = createtime; | ||
| 324 | - } | ||
| 325 | - | ||
| 326 | - public int getNylx() { | ||
| 327 | - return nylx; | ||
| 328 | - } | ||
| 329 | - | ||
| 330 | - public void setNylx(int nylx) { | ||
| 331 | - this.nylx = nylx; | ||
| 332 | - } | ||
| 333 | - | ||
| 334 | - public int getJcsx() { | ||
| 335 | - return jcsx; | ||
| 336 | - } | ||
| 337 | - | ||
| 338 | - public void setJcsx(int jcsx) { | ||
| 339 | - this.jcsx = jcsx; | ||
| 340 | - } | ||
| 341 | - | ||
| 342 | - public String getBglyh() { | ||
| 343 | - if(this.getZlc()==0){ | ||
| 344 | - return "0"; | ||
| 345 | - }else{ | ||
| 346 | - DecimalFormat df = new DecimalFormat("0.00"); | ||
| 347 | - return df.format(this.getHd()/this.getZlc()*100); | ||
| 348 | - } | ||
| 349 | - } | ||
| 350 | - | ||
| 351 | - public void setBglyh(String bglyh) { | ||
| 352 | - this.bglyh = bglyh; | ||
| 353 | - } | ||
| 354 | - | ||
| 355 | - public String getXlname() { | ||
| 356 | - return BasicData.lineCodeAllNameMap.get(this.xlbm); | ||
| 357 | - } | ||
| 358 | - | ||
| 359 | - public void setXlname(String xlname) { | ||
| 360 | - this.xlname = xlname; | ||
| 361 | - } | ||
| 362 | - | ||
| 363 | - public String getGsname() { | ||
| 364 | - return BasicData.businessCodeNameMap.get(this.ssgsdm); | ||
| 365 | - } | ||
| 366 | - | ||
| 367 | - public void setGsname(String gsname) { | ||
| 368 | - this.gsname = gsname; | ||
| 369 | - } | ||
| 370 | - | ||
| 371 | - public String getName() { | ||
| 372 | - return BasicData.allPerson.get(this.ssgsdm+"-"+this.jsy); | ||
| 373 | - } | ||
| 374 | - | ||
| 375 | - public void setName(String name) { | ||
| 376 | - this.name = name; | ||
| 377 | - } | ||
| 378 | - | ||
| 379 | - public String getFgsname() { | ||
| 380 | - return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.ssgsdm); | ||
| 381 | - } | ||
| 382 | - | ||
| 383 | - public void setFgsname(String fgsname) { | ||
| 384 | - this.fgsname = fgsname; | ||
| 385 | - } | ||
| 386 | - | ||
| 387 | - public Date getUpdatetime() { | ||
| 388 | - return updatetime; | ||
| 389 | - } | ||
| 390 | - | ||
| 391 | - public void setUpdatetime(Date updatetime) { | ||
| 392 | - this.updatetime = updatetime; | ||
| 393 | - } | ||
| 394 | - | ||
| 395 | - public String getLp() { | ||
| 396 | - return lp; | ||
| 397 | - } | ||
| 398 | - | ||
| 399 | - public void setLp(String lp) { | ||
| 400 | - this.lp = lp; | ||
| 401 | - } | ||
| 402 | - | ||
| 403 | - public String getJname() { | ||
| 404 | - return jname; | ||
| 405 | - } | ||
| 406 | - | ||
| 407 | - public void setJname(String jname) { | ||
| 408 | - this.jname = jname; | ||
| 409 | - } | ||
| 410 | - | ||
| 411 | - | ||
| 412 | - | ||
| 413 | -} | 1 | +package com.bsth.entity.oil; |
| 2 | + | ||
| 3 | +import java.text.DecimalFormat; | ||
| 4 | +import java.util.Date; | ||
| 5 | + | ||
| 6 | +import javax.persistence.*; | ||
| 7 | + | ||
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | + | ||
| 10 | +import com.bsth.data.BasicData; | ||
| 11 | + | ||
| 12 | +@Entity | ||
| 13 | +@Table(name = "bsth_c_dlb") | ||
| 14 | +public class Dlb { | ||
| 15 | + @Id | ||
| 16 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 17 | + private Integer id; | ||
| 18 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
| 19 | + private Date rq; | ||
| 20 | + private String xlbm; | ||
| 21 | + private String linename; | ||
| 22 | + private String ssgsdm; | ||
| 23 | + private String fgsdm; | ||
| 24 | + private String nbbm; | ||
| 25 | + private String jsy; | ||
| 26 | + private Double czlc=0.0; | ||
| 27 | + private Double jzlc=0.0; | ||
| 28 | + //出站存电 | ||
| 29 | + private Double czcd=0.0; | ||
| 30 | + //进站存电 | ||
| 31 | + private Double jzcd=0.0; | ||
| 32 | + //充电量 | ||
| 33 | + private Double cdl; | ||
| 34 | + private int sfkt; | ||
| 35 | + private String jhsj; | ||
| 36 | + //耗电 | ||
| 37 | + private Double hd=0.0; | ||
| 38 | + private Double sh=0.0; | ||
| 39 | + private String shyy; | ||
| 40 | + private Double zlc=0.0; | ||
| 41 | + private int yhlx; | ||
| 42 | + | ||
| 43 | + private Double ns=0.0; | ||
| 44 | + private Double fyylc=0.0; | ||
| 45 | + private Double jhzlc=0.0; | ||
| 46 | + private Double jhfyylc=0.0; | ||
| 47 | + private int jhzbc; | ||
| 48 | + private int jhbc; | ||
| 49 | + private int sjzbc; | ||
| 50 | + private int sjbc; | ||
| 51 | + private String edituser; | ||
| 52 | + private Date edittime; | ||
| 53 | + private Date createtime; | ||
| 54 | + private Date updatetime; | ||
| 55 | + private int nylx; | ||
| 56 | + //进场顺序(根据最先出场和最后进场来关联车辆的存电量) | ||
| 57 | + private int jcsx; | ||
| 58 | + | ||
| 59 | + private String jname; | ||
| 60 | + @Transient | ||
| 61 | + private String name; | ||
| 62 | + @Transient | ||
| 63 | + private String bglyh; | ||
| 64 | + | ||
| 65 | + @Transient | ||
| 66 | + private String xlname; | ||
| 67 | + | ||
| 68 | + @Transient | ||
| 69 | + private String gsname; | ||
| 70 | + | ||
| 71 | + @Transient | ||
| 72 | + private String fgsname; | ||
| 73 | + | ||
| 74 | + | ||
| 75 | + | ||
| 76 | + private String lp; | ||
| 77 | + | ||
| 78 | + public Integer getId() { | ||
| 79 | + return id; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + public void setId(Integer id) { | ||
| 83 | + this.id = id; | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + public Date getRq() { | ||
| 87 | + return rq; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + public void setRq(Date rq) { | ||
| 91 | + this.rq = rq; | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + public String getXlbm() { | ||
| 95 | + return xlbm; | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + public void setXlbm(String xlbm) { | ||
| 99 | + this.xlbm = xlbm; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + public String getLinename() { | ||
| 103 | + return linename; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + public void setLinename(String linename) { | ||
| 107 | + this.linename = linename; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + public String getSsgsdm() { | ||
| 111 | + return ssgsdm; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + public void setSsgsdm(String ssgsdm) { | ||
| 115 | + this.ssgsdm = ssgsdm; | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + public String getFgsdm() { | ||
| 119 | + return fgsdm; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + public void setFgsdm(String fgsdm) { | ||
| 123 | + this.fgsdm = fgsdm; | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + public String getNbbm() { | ||
| 127 | + return nbbm; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + public void setNbbm(String nbbm) { | ||
| 131 | + this.nbbm = nbbm; | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + public String getJsy() { | ||
| 135 | + return jsy; | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + public void setJsy(String jsy) { | ||
| 139 | + this.jsy = jsy; | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + public Double getCzlc() { | ||
| 143 | + return czlc; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + public void setCzlc(Double czlc) { | ||
| 147 | + this.czlc = czlc; | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + public Double getJzlc() { | ||
| 151 | + return jzlc; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + public void setJzlc(Double jzlc) { | ||
| 155 | + this.jzlc = jzlc; | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + public Double getCzcd() { | ||
| 159 | + return czcd; | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + public void setCzcd(Double czcd) { | ||
| 163 | + this.czcd = czcd; | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + public Double getJzcd() { | ||
| 167 | + return jzcd; | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + public void setJzcd(Double jzcd) { | ||
| 171 | + this.jzcd = jzcd; | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + public Double getCdl() { | ||
| 175 | + return cdl; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + public void setCdl(Double cdl) { | ||
| 179 | + this.cdl = cdl; | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + public int getSfkt() { | ||
| 183 | + return sfkt; | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + public void setSfkt(int sfkt) { | ||
| 187 | + this.sfkt = sfkt; | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + public String getJhsj() { | ||
| 191 | + return jhsj; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + public void setJhsj(String jhsj) { | ||
| 195 | + this.jhsj = jhsj; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + public Double getHd() { | ||
| 199 | + return hd; | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + public void setHd(Double hd) { | ||
| 203 | + this.hd = hd; | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + public Double getSh() { | ||
| 207 | + return sh; | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + public void setSh(Double sh) { | ||
| 211 | + this.sh = sh; | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + public String getShyy() { | ||
| 215 | + return shyy; | ||
| 216 | + } | ||
| 217 | + | ||
| 218 | + public void setShyy(String shyy) { | ||
| 219 | + this.shyy = shyy; | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + public Double getZlc() { | ||
| 223 | + return zlc; | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + public void setZlc(Double zlc) { | ||
| 227 | + this.zlc = zlc; | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + public int getYhlx() { | ||
| 231 | + return yhlx; | ||
| 232 | + } | ||
| 233 | + | ||
| 234 | + public void setYhlx(int yhlx) { | ||
| 235 | + this.yhlx = yhlx; | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + public Double getNs() { | ||
| 239 | + return ns; | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + public void setNs(Double ns) { | ||
| 243 | + this.ns = ns; | ||
| 244 | + } | ||
| 245 | + | ||
| 246 | + public Double getFyylc() { | ||
| 247 | + return fyylc; | ||
| 248 | + } | ||
| 249 | + | ||
| 250 | + public void setFyylc(Double fyylc) { | ||
| 251 | + this.fyylc = fyylc; | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + public Double getJhzlc() { | ||
| 255 | + return jhzlc; | ||
| 256 | + } | ||
| 257 | + | ||
| 258 | + public void setJhzlc(Double jhzlc) { | ||
| 259 | + this.jhzlc = jhzlc; | ||
| 260 | + } | ||
| 261 | + | ||
| 262 | + public Double getJhfyylc() { | ||
| 263 | + return jhfyylc; | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + public void setJhfyylc(Double jhfyylc) { | ||
| 267 | + this.jhfyylc = jhfyylc; | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + public int getJhzbc() { | ||
| 271 | + return jhzbc; | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + public void setJhzbc(int jhzbc) { | ||
| 275 | + this.jhzbc = jhzbc; | ||
| 276 | + } | ||
| 277 | + | ||
| 278 | + public int getJhbc() { | ||
| 279 | + return jhbc; | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + public void setJhbc(int jhbc) { | ||
| 283 | + this.jhbc = jhbc; | ||
| 284 | + } | ||
| 285 | + | ||
| 286 | + public int getSjzbc() { | ||
| 287 | + return sjzbc; | ||
| 288 | + } | ||
| 289 | + | ||
| 290 | + public void setSjzbc(int sjzbc) { | ||
| 291 | + this.sjzbc = sjzbc; | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + public int getSjbc() { | ||
| 295 | + return sjbc; | ||
| 296 | + } | ||
| 297 | + | ||
| 298 | + public void setSjbc(int sjbc) { | ||
| 299 | + this.sjbc = sjbc; | ||
| 300 | + } | ||
| 301 | + | ||
| 302 | + public String getEdituser() { | ||
| 303 | + return edituser; | ||
| 304 | + } | ||
| 305 | + | ||
| 306 | + public void setEdituser(String edituser) { | ||
| 307 | + this.edituser = edituser; | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + public Date getEdittime() { | ||
| 311 | + return edittime; | ||
| 312 | + } | ||
| 313 | + | ||
| 314 | + public void setEdittime(Date edittime) { | ||
| 315 | + this.edittime = edittime; | ||
| 316 | + } | ||
| 317 | + | ||
| 318 | + public Date getCreatetime() { | ||
| 319 | + return createtime; | ||
| 320 | + } | ||
| 321 | + | ||
| 322 | + public void setCreatetime(Date createtime) { | ||
| 323 | + this.createtime = createtime; | ||
| 324 | + } | ||
| 325 | + | ||
| 326 | + public int getNylx() { | ||
| 327 | + return nylx; | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | + public void setNylx(int nylx) { | ||
| 331 | + this.nylx = nylx; | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + public int getJcsx() { | ||
| 335 | + return jcsx; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + public void setJcsx(int jcsx) { | ||
| 339 | + this.jcsx = jcsx; | ||
| 340 | + } | ||
| 341 | + | ||
| 342 | + public String getBglyh() { | ||
| 343 | + if(this.getZlc()==0){ | ||
| 344 | + return "0"; | ||
| 345 | + }else{ | ||
| 346 | + DecimalFormat df = new DecimalFormat("0.000"); | ||
| 347 | + return df.format(this.getHd()/this.getZlc()*100); | ||
| 348 | + } | ||
| 349 | + } | ||
| 350 | + | ||
| 351 | + public void setBglyh(String bglyh) { | ||
| 352 | + this.bglyh = bglyh; | ||
| 353 | + } | ||
| 354 | + | ||
| 355 | + public String getXlname() { | ||
| 356 | + return BasicData.lineCodeAllNameMap.get(this.xlbm); | ||
| 357 | + } | ||
| 358 | + | ||
| 359 | + public void setXlname(String xlname) { | ||
| 360 | + this.xlname = xlname; | ||
| 361 | + } | ||
| 362 | + | ||
| 363 | + public String getGsname() { | ||
| 364 | + return BasicData.businessCodeNameMap.get(this.ssgsdm); | ||
| 365 | + } | ||
| 366 | + | ||
| 367 | + public void setGsname(String gsname) { | ||
| 368 | + this.gsname = gsname; | ||
| 369 | + } | ||
| 370 | + | ||
| 371 | + public String getName() { | ||
| 372 | + return BasicData.allPerson.get(this.ssgsdm+"-"+this.jsy); | ||
| 373 | + } | ||
| 374 | + | ||
| 375 | + public void setName(String name) { | ||
| 376 | + this.name = name; | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | + public String getFgsname() { | ||
| 380 | + return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.ssgsdm); | ||
| 381 | + } | ||
| 382 | + | ||
| 383 | + public void setFgsname(String fgsname) { | ||
| 384 | + this.fgsname = fgsname; | ||
| 385 | + } | ||
| 386 | + | ||
| 387 | + public Date getUpdatetime() { | ||
| 388 | + return updatetime; | ||
| 389 | + } | ||
| 390 | + | ||
| 391 | + public void setUpdatetime(Date updatetime) { | ||
| 392 | + this.updatetime = updatetime; | ||
| 393 | + } | ||
| 394 | + | ||
| 395 | + public String getLp() { | ||
| 396 | + return lp; | ||
| 397 | + } | ||
| 398 | + | ||
| 399 | + public void setLp(String lp) { | ||
| 400 | + this.lp = lp; | ||
| 401 | + } | ||
| 402 | + | ||
| 403 | + public String getJname() { | ||
| 404 | + return jname; | ||
| 405 | + } | ||
| 406 | + | ||
| 407 | + public void setJname(String jname) { | ||
| 408 | + this.jname = jname; | ||
| 409 | + } | ||
| 410 | + | ||
| 411 | + | ||
| 412 | + | ||
| 413 | +} |
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 | \ No newline at end of file | 211 | \ No newline at end of file |
src/main/java/com/bsth/entity/oil/Qlb.java
| @@ -348,7 +348,7 @@ public class Qlb { | @@ -348,7 +348,7 @@ public class Qlb { | ||
| 348 | if(this.getZlc()==0){ | 348 | if(this.getZlc()==0){ |
| 349 | return "0"; | 349 | return "0"; |
| 350 | }else{ | 350 | }else{ |
| 351 | - DecimalFormat df = new DecimalFormat("0.00"); | 351 | + DecimalFormat df = new DecimalFormat("0.000"); |
| 352 | return df.format(this.getHn()/this.getZlc()*100); | 352 | return df.format(this.getHn()/this.getZlc()*100); |
| 353 | } | 353 | } |
| 354 | } | 354 | } |
src/main/java/com/bsth/entity/oil/Ylb.java
| 1 | -package com.bsth.entity.oil; | ||
| 2 | - | ||
| 3 | -import java.text.DecimalFormat; | ||
| 4 | -import java.util.Date; | ||
| 5 | - | ||
| 6 | -import javax.persistence.*; | ||
| 7 | - | ||
| 8 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | - | ||
| 10 | -import com.bsth.data.BasicData; | ||
| 11 | - | ||
| 12 | -@Entity | ||
| 13 | -@Table(name = "bsth_c_ylb") | ||
| 14 | -public class Ylb { | ||
| 15 | - @Id | ||
| 16 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 17 | - private Integer id; | ||
| 18 | - @DateTimeFormat(pattern="yyyy-MM-dd") | ||
| 19 | - private Date rq; | ||
| 20 | - private String xlbm; | ||
| 21 | - private String linename; | ||
| 22 | - private String ssgsdm; | ||
| 23 | - private String fgsdm; | ||
| 24 | - private String nbbm; | ||
| 25 | - private String jsy; | ||
| 26 | - private String jname; | ||
| 27 | - private Double czlc=0.0; | ||
| 28 | - private Double jzlc=0.0; | ||
| 29 | - private Double czyl=0.0; | ||
| 30 | - private Double jzyl=0.0; | ||
| 31 | - private Double jzl=0.0; | ||
| 32 | - private int sfkt; | ||
| 33 | - private String jhsj; | ||
| 34 | - private Double yh=0.0; | ||
| 35 | - private Double sh=0.0; | ||
| 36 | - private String shyy; | ||
| 37 | - private Double zlc=0.0; | ||
| 38 | - private int yhlx; | ||
| 39 | - private String rylx="0"; | ||
| 40 | - private Double ns=0.0; | ||
| 41 | - private Double fyylc=0.0; | ||
| 42 | - private Double jhzlc=0.0; | ||
| 43 | - private Double jhfyylc=0.0; | ||
| 44 | - private int jhzbc; | ||
| 45 | - private int jhbc; | ||
| 46 | - private int sjzbc; | ||
| 47 | - private int sjbc; | ||
| 48 | - private String edituser; | ||
| 49 | - private Date edittime; | ||
| 50 | - private Date updatetime; | ||
| 51 | - private Date createtime; | ||
| 52 | - | ||
| 53 | - private int nylx; | ||
| 54 | - //进场顺序(根据最先出场和最后进场来关联车辆的存油量) | ||
| 55 | - private int jcsx; | ||
| 56 | - | ||
| 57 | - private String lp; | ||
| 58 | - @Transient | ||
| 59 | - private String bglyh; | ||
| 60 | - | ||
| 61 | - @Transient | ||
| 62 | - private String xlname; | ||
| 63 | - | ||
| 64 | - @Transient | ||
| 65 | - private String gsname; | ||
| 66 | - | ||
| 67 | - @Transient | ||
| 68 | - private String fgsname; | ||
| 69 | - | ||
| 70 | - @Transient | ||
| 71 | - private String name; | ||
| 72 | - | ||
| 73 | - public Integer getId() { | ||
| 74 | - return id; | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | - public void setId(Integer id) { | ||
| 78 | - this.id = id; | ||
| 79 | - } | ||
| 80 | - public Date getRq() { | ||
| 81 | - return rq; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - public void setRq(Date rq) { | ||
| 85 | - this.rq = rq; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - public String getXlbm() { | ||
| 89 | - return xlbm; | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - public void setXlbm(String xlbm) { | ||
| 93 | - this.xlbm = xlbm; | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - public String getLinename() { | ||
| 97 | - return linename; | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - public void setLinename(String linename) { | ||
| 101 | - this.linename = linename; | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - public String getSsgsdm() { | ||
| 105 | - return ssgsdm; | ||
| 106 | - } | ||
| 107 | - public void setSsgsdm(String ssgsdm) { | ||
| 108 | - this.ssgsdm = ssgsdm; | ||
| 109 | - } | ||
| 110 | - public String getFgsdm() { | ||
| 111 | - return fgsdm; | ||
| 112 | - } | ||
| 113 | - public void setFgsdm(String fgsdm) { | ||
| 114 | - this.fgsdm = fgsdm; | ||
| 115 | - } | ||
| 116 | - public String getNbbm() { | ||
| 117 | - return nbbm; | ||
| 118 | - } | ||
| 119 | - public void setNbbm(String nbbm) { | ||
| 120 | - this.nbbm = nbbm; | ||
| 121 | - } | ||
| 122 | - public String getJsy() { | ||
| 123 | - return jsy; | ||
| 124 | - } | ||
| 125 | - public void setJsy(String jsy) { | ||
| 126 | - this.jsy = jsy; | ||
| 127 | - } | ||
| 128 | - public Double getCzlc() { | ||
| 129 | - return czlc; | ||
| 130 | - } | ||
| 131 | - public void setCzlc(Double czlc) { | ||
| 132 | - this.czlc = czlc; | ||
| 133 | - } | ||
| 134 | - public Double getJzlc() { | ||
| 135 | - return jzlc; | ||
| 136 | - } | ||
| 137 | - public void setJzlc(Double jzlc) { | ||
| 138 | - this.jzlc = jzlc; | ||
| 139 | - } | ||
| 140 | - public Double getCzyl() { | ||
| 141 | - return czyl; | ||
| 142 | - } | ||
| 143 | - public void setCzyl(Double czyl) { | ||
| 144 | - this.czyl = czyl; | ||
| 145 | - } | ||
| 146 | - public Double getJzyl() { | ||
| 147 | - return jzyl; | ||
| 148 | - } | ||
| 149 | - public void setJzyl(Double jzyl) { | ||
| 150 | - this.jzyl = jzyl; | ||
| 151 | - } | ||
| 152 | - public Double getJzl() { | ||
| 153 | - return jzl; | ||
| 154 | - } | ||
| 155 | - public void setJzl(Double jzl) { | ||
| 156 | - this.jzl = jzl; | ||
| 157 | - } | ||
| 158 | - public int getSfkt() { | ||
| 159 | - return sfkt; | ||
| 160 | - } | ||
| 161 | - public void setSfkt(int sfkt) { | ||
| 162 | - this.sfkt = sfkt; | ||
| 163 | - } | ||
| 164 | - public String getJhsj() { | ||
| 165 | - return jhsj; | ||
| 166 | - } | ||
| 167 | - public void setJhsj(String jhsj) { | ||
| 168 | - this.jhsj = jhsj; | ||
| 169 | - } | ||
| 170 | - public Double getYh() { | ||
| 171 | - return yh; | ||
| 172 | - } | ||
| 173 | - public void setYh(Double yh) { | ||
| 174 | - this.yh = yh; | ||
| 175 | - } | ||
| 176 | - public Double getSh() { | ||
| 177 | - return sh; | ||
| 178 | - } | ||
| 179 | - public void setSh(Double sh) { | ||
| 180 | - this.sh = sh; | ||
| 181 | - } | ||
| 182 | - public String getShyy() { | ||
| 183 | - return shyy; | ||
| 184 | - } | ||
| 185 | - public void setShyy(String shyy) { | ||
| 186 | - this.shyy = shyy; | ||
| 187 | - } | ||
| 188 | - public Double getZlc() { | ||
| 189 | - return zlc; | ||
| 190 | - } | ||
| 191 | - public void setZlc(Double zlc) { | ||
| 192 | - this.zlc = zlc; | ||
| 193 | - } | ||
| 194 | - public int getYhlx() { | ||
| 195 | - return yhlx; | ||
| 196 | - } | ||
| 197 | - public void setYhlx(int yhlx) { | ||
| 198 | - this.yhlx = yhlx; | ||
| 199 | - } | ||
| 200 | - public String getRylx() { | ||
| 201 | - return rylx; | ||
| 202 | - } | ||
| 203 | - public void setRylx(String rylx) { | ||
| 204 | - this.rylx = rylx; | ||
| 205 | - } | ||
| 206 | - public Double getNs() { | ||
| 207 | - return ns; | ||
| 208 | - } | ||
| 209 | - public void setNs(Double ns) { | ||
| 210 | - this.ns = ns; | ||
| 211 | - } | ||
| 212 | - public Double getFyylc() { | ||
| 213 | - return fyylc; | ||
| 214 | - } | ||
| 215 | - public void setFyylc(Double fyylc) { | ||
| 216 | - this.fyylc = fyylc; | ||
| 217 | - } | ||
| 218 | - public Double getJhzlc() { | ||
| 219 | - return jhzlc; | ||
| 220 | - } | ||
| 221 | - public void setJhzlc(Double jhzlc) { | ||
| 222 | - this.jhzlc = jhzlc; | ||
| 223 | - } | ||
| 224 | - public Double getJhfyylc() { | ||
| 225 | - return jhfyylc; | ||
| 226 | - } | ||
| 227 | - public void setJhfyylc(Double jhfyylc) { | ||
| 228 | - this.jhfyylc = jhfyylc; | ||
| 229 | - } | ||
| 230 | - public int getJhzbc() { | ||
| 231 | - return jhzbc; | ||
| 232 | - } | ||
| 233 | - public void setJhzbc(int jhzbc) { | ||
| 234 | - this.jhzbc = jhzbc; | ||
| 235 | - } | ||
| 236 | - public int getJhbc() { | ||
| 237 | - return jhbc; | ||
| 238 | - } | ||
| 239 | - public void setJhbc(int jhbc) { | ||
| 240 | - this.jhbc = jhbc; | ||
| 241 | - } | ||
| 242 | - public int getSjzbc() { | ||
| 243 | - return sjzbc; | ||
| 244 | - } | ||
| 245 | - public void setSjzbc(int sjzbc) { | ||
| 246 | - this.sjzbc = sjzbc; | ||
| 247 | - } | ||
| 248 | - public int getSjbc() { | ||
| 249 | - return sjbc; | ||
| 250 | - } | ||
| 251 | - public void setSjbc(int sjbc) { | ||
| 252 | - this.sjbc = sjbc; | ||
| 253 | - } | ||
| 254 | - public String getEdituser() { | ||
| 255 | - return edituser; | ||
| 256 | - } | ||
| 257 | - public void setEdituser(String edituser) { | ||
| 258 | - this.edituser = edituser; | ||
| 259 | - } | ||
| 260 | - public Date getEdittime() { | ||
| 261 | - return edittime; | ||
| 262 | - } | ||
| 263 | - public void setEdittime(Date edittime) { | ||
| 264 | - this.edittime = edittime; | ||
| 265 | - } | ||
| 266 | - public Date getCreatetime() { | ||
| 267 | - return createtime; | ||
| 268 | - } | ||
| 269 | - public void setCreatetime(Date createtime) { | ||
| 270 | - this.createtime = createtime; | ||
| 271 | - } | ||
| 272 | - public int getNylx() { | ||
| 273 | - return nylx; | ||
| 274 | - } | ||
| 275 | - public void setNylx(int nylx) { | ||
| 276 | - this.nylx = nylx; | ||
| 277 | - } | ||
| 278 | - | ||
| 279 | - public int getJcsx(){ | ||
| 280 | - return jcsx; | ||
| 281 | - } | ||
| 282 | - | ||
| 283 | - public void setJcsx(int jcsx){ | ||
| 284 | - this.jcsx=jcsx; | ||
| 285 | - } | ||
| 286 | - | ||
| 287 | - public String getBglyh() { | ||
| 288 | - if(this.getZlc()==0){ | ||
| 289 | - return "0"; | ||
| 290 | - }else{ | ||
| 291 | - DecimalFormat df = new DecimalFormat("0.00"); | ||
| 292 | - return df.format(this.getYh()/this.getZlc()*100); | ||
| 293 | - } | ||
| 294 | - } | ||
| 295 | - | ||
| 296 | - public void setBglyh(String bglyh) { | ||
| 297 | - this.bglyh = bglyh; | ||
| 298 | - } | ||
| 299 | - | ||
| 300 | - public String getXlname() { | ||
| 301 | - return BasicData.lineCodeAllNameMap.get(this.xlbm); | ||
| 302 | - } | ||
| 303 | - | ||
| 304 | - public void setXlname(String xlname) { | ||
| 305 | - this.xlname = xlname; | ||
| 306 | - } | ||
| 307 | - | ||
| 308 | - public String getGsname() { | ||
| 309 | - return BasicData.businessCodeNameMap.get(this.ssgsdm); | ||
| 310 | - } | ||
| 311 | - | ||
| 312 | - public void setGsname(String gsname) { | ||
| 313 | - this.gsname = gsname; | ||
| 314 | - } | ||
| 315 | - | ||
| 316 | - | ||
| 317 | - public String getFgsname() { | ||
| 318 | - return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.ssgsdm); | ||
| 319 | - } | ||
| 320 | - | ||
| 321 | - public void setFgsname(String fgsname) { | ||
| 322 | - this.fgsname = fgsname; | ||
| 323 | - } | ||
| 324 | - | ||
| 325 | - public String getName() { | ||
| 326 | - return BasicData.allPerson.get(this.ssgsdm+"-"+this.jsy); | ||
| 327 | - } | ||
| 328 | - | ||
| 329 | - public void setName(String name) { | ||
| 330 | - this.name = name; | ||
| 331 | - } | ||
| 332 | - | ||
| 333 | - | ||
| 334 | - public Date getUpdatetime() { | ||
| 335 | - return updatetime; | ||
| 336 | - } | ||
| 337 | - | ||
| 338 | - public void setUpdatetime(Date updatetime) { | ||
| 339 | - this.updatetime = updatetime; | ||
| 340 | - } | ||
| 341 | - | ||
| 342 | - public String getLp() { | ||
| 343 | - return lp; | ||
| 344 | - } | ||
| 345 | - | ||
| 346 | - public void setLp(String lp) { | ||
| 347 | - this.lp = lp; | ||
| 348 | - } | ||
| 349 | - | ||
| 350 | - public String getJname() { | ||
| 351 | - return jname; | ||
| 352 | - } | ||
| 353 | - | ||
| 354 | - public void setJname(String jname) { | ||
| 355 | - this.jname = jname; | ||
| 356 | - } | ||
| 357 | - | ||
| 358 | - | ||
| 359 | -} | 1 | +package com.bsth.entity.oil; |
| 2 | + | ||
| 3 | +import java.text.DecimalFormat; | ||
| 4 | +import java.util.Date; | ||
| 5 | + | ||
| 6 | +import javax.persistence.*; | ||
| 7 | + | ||
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | + | ||
| 10 | +import com.bsth.data.BasicData; | ||
| 11 | + | ||
| 12 | +@Entity | ||
| 13 | +@Table(name = "bsth_c_ylb") | ||
| 14 | +public class Ylb { | ||
| 15 | + @Id | ||
| 16 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 17 | + private Integer id; | ||
| 18 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
| 19 | + private Date rq; | ||
| 20 | + private String xlbm; | ||
| 21 | + private String linename; | ||
| 22 | + private String ssgsdm; | ||
| 23 | + private String fgsdm; | ||
| 24 | + private String nbbm; | ||
| 25 | + private String jsy; | ||
| 26 | + private String jname; | ||
| 27 | + private Double czlc=0.0; | ||
| 28 | + private Double jzlc=0.0; | ||
| 29 | + private Double czyl=0.0; | ||
| 30 | + private Double jzyl=0.0; | ||
| 31 | + private Double jzl=0.0; | ||
| 32 | + private int sfkt; | ||
| 33 | + private String jhsj; | ||
| 34 | + private Double yh=0.0; | ||
| 35 | + private Double sh=0.0; | ||
| 36 | + private String shyy; | ||
| 37 | + private Double zlc=0.0; | ||
| 38 | + private int yhlx; | ||
| 39 | + private String rylx="0"; | ||
| 40 | + private Double ns=0.0; | ||
| 41 | + private Double fyylc=0.0; | ||
| 42 | + private Double jhzlc=0.0; | ||
| 43 | + private Double jhfyylc=0.0; | ||
| 44 | + private int jhzbc; | ||
| 45 | + private int jhbc; | ||
| 46 | + private int sjzbc; | ||
| 47 | + private int sjbc; | ||
| 48 | + private String edituser; | ||
| 49 | + private Date edittime; | ||
| 50 | + private Date updatetime; | ||
| 51 | + private Date createtime; | ||
| 52 | + | ||
| 53 | + private int nylx; | ||
| 54 | + //进场顺序(根据最先出场和最后进场来关联车辆的存油量) | ||
| 55 | + private int jcsx; | ||
| 56 | + | ||
| 57 | + private String lp; | ||
| 58 | + @Transient | ||
| 59 | + private String bglyh; | ||
| 60 | + | ||
| 61 | + @Transient | ||
| 62 | + private String xlname; | ||
| 63 | + | ||
| 64 | + @Transient | ||
| 65 | + private String gsname; | ||
| 66 | + | ||
| 67 | + @Transient | ||
| 68 | + private String fgsname; | ||
| 69 | + | ||
| 70 | + @Transient | ||
| 71 | + private String name; | ||
| 72 | + | ||
| 73 | + public Integer getId() { | ||
| 74 | + return id; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + public void setId(Integer id) { | ||
| 78 | + this.id = id; | ||
| 79 | + } | ||
| 80 | + public Date getRq() { | ||
| 81 | + return rq; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public void setRq(Date rq) { | ||
| 85 | + this.rq = rq; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public String getXlbm() { | ||
| 89 | + return xlbm; | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + public void setXlbm(String xlbm) { | ||
| 93 | + this.xlbm = xlbm; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + public String getLinename() { | ||
| 97 | + return linename; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + public void setLinename(String linename) { | ||
| 101 | + this.linename = linename; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + public String getSsgsdm() { | ||
| 105 | + return ssgsdm; | ||
| 106 | + } | ||
| 107 | + public void setSsgsdm(String ssgsdm) { | ||
| 108 | + this.ssgsdm = ssgsdm; | ||
| 109 | + } | ||
| 110 | + public String getFgsdm() { | ||
| 111 | + return fgsdm; | ||
| 112 | + } | ||
| 113 | + public void setFgsdm(String fgsdm) { | ||
| 114 | + this.fgsdm = fgsdm; | ||
| 115 | + } | ||
| 116 | + public String getNbbm() { | ||
| 117 | + return nbbm; | ||
| 118 | + } | ||
| 119 | + public void setNbbm(String nbbm) { | ||
| 120 | + this.nbbm = nbbm; | ||
| 121 | + } | ||
| 122 | + public String getJsy() { | ||
| 123 | + return jsy; | ||
| 124 | + } | ||
| 125 | + public void setJsy(String jsy) { | ||
| 126 | + this.jsy = jsy; | ||
| 127 | + } | ||
| 128 | + public Double getCzlc() { | ||
| 129 | + return czlc; | ||
| 130 | + } | ||
| 131 | + public void setCzlc(Double czlc) { | ||
| 132 | + this.czlc = czlc; | ||
| 133 | + } | ||
| 134 | + public Double getJzlc() { | ||
| 135 | + return jzlc; | ||
| 136 | + } | ||
| 137 | + public void setJzlc(Double jzlc) { | ||
| 138 | + this.jzlc = jzlc; | ||
| 139 | + } | ||
| 140 | + public Double getCzyl() { | ||
| 141 | + return czyl; | ||
| 142 | + } | ||
| 143 | + public void setCzyl(Double czyl) { | ||
| 144 | + this.czyl = czyl; | ||
| 145 | + } | ||
| 146 | + public Double getJzyl() { | ||
| 147 | + return jzyl; | ||
| 148 | + } | ||
| 149 | + public void setJzyl(Double jzyl) { | ||
| 150 | + this.jzyl = jzyl; | ||
| 151 | + } | ||
| 152 | + public Double getJzl() { | ||
| 153 | + return jzl; | ||
| 154 | + } | ||
| 155 | + public void setJzl(Double jzl) { | ||
| 156 | + this.jzl = jzl; | ||
| 157 | + } | ||
| 158 | + public int getSfkt() { | ||
| 159 | + return sfkt; | ||
| 160 | + } | ||
| 161 | + public void setSfkt(int sfkt) { | ||
| 162 | + this.sfkt = sfkt; | ||
| 163 | + } | ||
| 164 | + public String getJhsj() { | ||
| 165 | + return jhsj; | ||
| 166 | + } | ||
| 167 | + public void setJhsj(String jhsj) { | ||
| 168 | + this.jhsj = jhsj; | ||
| 169 | + } | ||
| 170 | + public Double getYh() { | ||
| 171 | + return yh; | ||
| 172 | + } | ||
| 173 | + public void setYh(Double yh) { | ||
| 174 | + this.yh = yh; | ||
| 175 | + } | ||
| 176 | + public Double getSh() { | ||
| 177 | + return sh; | ||
| 178 | + } | ||
| 179 | + public void setSh(Double sh) { | ||
| 180 | + this.sh = sh; | ||
| 181 | + } | ||
| 182 | + public String getShyy() { | ||
| 183 | + return shyy; | ||
| 184 | + } | ||
| 185 | + public void setShyy(String shyy) { | ||
| 186 | + this.shyy = shyy; | ||
| 187 | + } | ||
| 188 | + public Double getZlc() { | ||
| 189 | + return zlc; | ||
| 190 | + } | ||
| 191 | + public void setZlc(Double zlc) { | ||
| 192 | + this.zlc = zlc; | ||
| 193 | + } | ||
| 194 | + public int getYhlx() { | ||
| 195 | + return yhlx; | ||
| 196 | + } | ||
| 197 | + public void setYhlx(int yhlx) { | ||
| 198 | + this.yhlx = yhlx; | ||
| 199 | + } | ||
| 200 | + public String getRylx() { | ||
| 201 | + return rylx; | ||
| 202 | + } | ||
| 203 | + public void setRylx(String rylx) { | ||
| 204 | + this.rylx = rylx; | ||
| 205 | + } | ||
| 206 | + public Double getNs() { | ||
| 207 | + return ns; | ||
| 208 | + } | ||
| 209 | + public void setNs(Double ns) { | ||
| 210 | + this.ns = ns; | ||
| 211 | + } | ||
| 212 | + public Double getFyylc() { | ||
| 213 | + return fyylc; | ||
| 214 | + } | ||
| 215 | + public void setFyylc(Double fyylc) { | ||
| 216 | + this.fyylc = fyylc; | ||
| 217 | + } | ||
| 218 | + public Double getJhzlc() { | ||
| 219 | + return jhzlc; | ||
| 220 | + } | ||
| 221 | + public void setJhzlc(Double jhzlc) { | ||
| 222 | + this.jhzlc = jhzlc; | ||
| 223 | + } | ||
| 224 | + public Double getJhfyylc() { | ||
| 225 | + return jhfyylc; | ||
| 226 | + } | ||
| 227 | + public void setJhfyylc(Double jhfyylc) { | ||
| 228 | + this.jhfyylc = jhfyylc; | ||
| 229 | + } | ||
| 230 | + public int getJhzbc() { | ||
| 231 | + return jhzbc; | ||
| 232 | + } | ||
| 233 | + public void setJhzbc(int jhzbc) { | ||
| 234 | + this.jhzbc = jhzbc; | ||
| 235 | + } | ||
| 236 | + public int getJhbc() { | ||
| 237 | + return jhbc; | ||
| 238 | + } | ||
| 239 | + public void setJhbc(int jhbc) { | ||
| 240 | + this.jhbc = jhbc; | ||
| 241 | + } | ||
| 242 | + public int getSjzbc() { | ||
| 243 | + return sjzbc; | ||
| 244 | + } | ||
| 245 | + public void setSjzbc(int sjzbc) { | ||
| 246 | + this.sjzbc = sjzbc; | ||
| 247 | + } | ||
| 248 | + public int getSjbc() { | ||
| 249 | + return sjbc; | ||
| 250 | + } | ||
| 251 | + public void setSjbc(int sjbc) { | ||
| 252 | + this.sjbc = sjbc; | ||
| 253 | + } | ||
| 254 | + public String getEdituser() { | ||
| 255 | + return edituser; | ||
| 256 | + } | ||
| 257 | + public void setEdituser(String edituser) { | ||
| 258 | + this.edituser = edituser; | ||
| 259 | + } | ||
| 260 | + public Date getEdittime() { | ||
| 261 | + return edittime; | ||
| 262 | + } | ||
| 263 | + public void setEdittime(Date edittime) { | ||
| 264 | + this.edittime = edittime; | ||
| 265 | + } | ||
| 266 | + public Date getCreatetime() { | ||
| 267 | + return createtime; | ||
| 268 | + } | ||
| 269 | + public void setCreatetime(Date createtime) { | ||
| 270 | + this.createtime = createtime; | ||
| 271 | + } | ||
| 272 | + public int getNylx() { | ||
| 273 | + return nylx; | ||
| 274 | + } | ||
| 275 | + public void setNylx(int nylx) { | ||
| 276 | + this.nylx = nylx; | ||
| 277 | + } | ||
| 278 | + | ||
| 279 | + public int getJcsx(){ | ||
| 280 | + return jcsx; | ||
| 281 | + } | ||
| 282 | + | ||
| 283 | + public void setJcsx(int jcsx){ | ||
| 284 | + this.jcsx=jcsx; | ||
| 285 | + } | ||
| 286 | + | ||
| 287 | + public String getBglyh() { | ||
| 288 | + if(this.getZlc()==0){ | ||
| 289 | + return "0"; | ||
| 290 | + }else{ | ||
| 291 | + DecimalFormat df = new DecimalFormat("0.000"); | ||
| 292 | + return df.format(this.getYh()/this.getZlc()*100); | ||
| 293 | + } | ||
| 294 | + } | ||
| 295 | + | ||
| 296 | + public void setBglyh(String bglyh) { | ||
| 297 | + this.bglyh = bglyh; | ||
| 298 | + } | ||
| 299 | + | ||
| 300 | + public String getXlname() { | ||
| 301 | + return BasicData.lineCodeAllNameMap.get(this.xlbm); | ||
| 302 | + } | ||
| 303 | + | ||
| 304 | + public void setXlname(String xlname) { | ||
| 305 | + this.xlname = xlname; | ||
| 306 | + } | ||
| 307 | + | ||
| 308 | + public String getGsname() { | ||
| 309 | + return BasicData.businessCodeNameMap.get(this.ssgsdm); | ||
| 310 | + } | ||
| 311 | + | ||
| 312 | + public void setGsname(String gsname) { | ||
| 313 | + this.gsname = gsname; | ||
| 314 | + } | ||
| 315 | + | ||
| 316 | + | ||
| 317 | + public String getFgsname() { | ||
| 318 | + return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.ssgsdm); | ||
| 319 | + } | ||
| 320 | + | ||
| 321 | + public void setFgsname(String fgsname) { | ||
| 322 | + this.fgsname = fgsname; | ||
| 323 | + } | ||
| 324 | + | ||
| 325 | + public String getName() { | ||
| 326 | + return BasicData.allPerson.get(this.ssgsdm+"-"+this.jsy); | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | + public void setName(String name) { | ||
| 330 | + this.name = name; | ||
| 331 | + } | ||
| 332 | + | ||
| 333 | + | ||
| 334 | + public Date getUpdatetime() { | ||
| 335 | + return updatetime; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + public void setUpdatetime(Date updatetime) { | ||
| 339 | + this.updatetime = updatetime; | ||
| 340 | + } | ||
| 341 | + | ||
| 342 | + public String getLp() { | ||
| 343 | + return lp; | ||
| 344 | + } | ||
| 345 | + | ||
| 346 | + public void setLp(String lp) { | ||
| 347 | + this.lp = lp; | ||
| 348 | + } | ||
| 349 | + | ||
| 350 | + public String getJname() { | ||
| 351 | + return jname; | ||
| 352 | + } | ||
| 353 | + | ||
| 354 | + public void setJname(String jname) { | ||
| 355 | + this.jname = jname; | ||
| 356 | + } | ||
| 357 | + | ||
| 358 | + | ||
| 359 | +} |
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 | package com.bsth.service.oil; | 1 | package com.bsth.service.oil; |
| 2 | 2 | ||
| 3 | import java.io.File; | 3 | import java.io.File; |
| 4 | +import java.util.List; | ||
| 4 | import java.util.Map; | 5 | import java.util.Map; |
| 5 | 6 | ||
| 6 | import com.bsth.entity.oil.Jdl; | 7 | import com.bsth.entity.oil.Jdl; |
| 8 | +import com.bsth.entity.oil.JdlReception; | ||
| 7 | import com.bsth.service.BaseService; | 9 | import com.bsth.service.BaseService; |
| 8 | 10 | ||
| 9 | public interface JdlService extends BaseService<Jdl, Integer> { | 11 | public interface JdlService extends BaseService<Jdl, Integer> { |
| 10 | 12 | ||
| 11 | public String importExcel(File file, String gsbm_, String gsName, String fgsbm, String fgsName); | 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 | public Map<String, Object> query(Map<String, Object> map); | 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
| @@ -39,12 +39,14 @@ import com.bsth.entity.sys.SysUser; | @@ -39,12 +39,14 @@ import com.bsth.entity.sys.SysUser; | ||
| 39 | import com.bsth.repository.CarsRepository; | 39 | import com.bsth.repository.CarsRepository; |
| 40 | import com.bsth.repository.oil.CdlRepository; | 40 | import com.bsth.repository.oil.CdlRepository; |
| 41 | import com.bsth.repository.oil.DlbRepository; | 41 | import com.bsth.repository.oil.DlbRepository; |
| 42 | +import com.bsth.repository.oil.JdlReceptionRepository; | ||
| 42 | import com.bsth.repository.oil.JdlRepository; | 43 | import com.bsth.repository.oil.JdlRepository; |
| 43 | import com.bsth.repository.oil.NylogRepository; | 44 | import com.bsth.repository.oil.NylogRepository; |
| 44 | import com.bsth.repository.oil.YlxxbRepository; | 45 | import com.bsth.repository.oil.YlxxbRepository; |
| 45 | import com.bsth.security.util.SecurityUtils; | 46 | import com.bsth.security.util.SecurityUtils; |
| 46 | import com.bsth.service.impl.BaseServiceImpl; | 47 | import com.bsth.service.impl.BaseServiceImpl; |
| 47 | import com.bsth.service.oil.DlbService; | 48 | import com.bsth.service.oil.DlbService; |
| 49 | +import com.bsth.service.oil.JdlService; | ||
| 48 | import com.bsth.service.realcontrol.ScheduleRealInfoService; | 50 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 49 | import com.bsth.util.Arith; | 51 | import com.bsth.util.Arith; |
| 50 | import com.bsth.util.BatchSaveUtils; | 52 | import com.bsth.util.BatchSaveUtils; |
| @@ -67,6 +69,8 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -67,6 +69,8 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 67 | 69 | ||
| 68 | @Autowired | 70 | @Autowired |
| 69 | ScheduleRealInfoService scheduleRealInfoService; | 71 | ScheduleRealInfoService scheduleRealInfoService; |
| 72 | + @Autowired | ||
| 73 | + JdlService jdlService; | ||
| 70 | 74 | ||
| 71 | @Autowired | 75 | @Autowired |
| 72 | JdbcTemplate jdbcTemplate; | 76 | JdbcTemplate jdbcTemplate; |
| @@ -95,13 +99,13 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -95,13 +99,13 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 95 | // String rq="2017-11-02"; | 99 | // String rq="2017-11-02"; |
| 96 | String line=""; | 100 | String line=""; |
| 97 | //保留两位小数 | 101 | //保留两位小数 |
| 98 | - DecimalFormat df = new DecimalFormat("#.00"); | 102 | + DecimalFormat df = new DecimalFormat("#.000"); |
| 99 | // TODO Auto-generated method stub | 103 | // TODO Auto-generated method stub |
| 100 | Map<String, Object> newMap=new HashMap<String,Object>(); | 104 | Map<String, Object> newMap=new HashMap<String,Object>(); |
| 101 | //当天DLB信息 | 105 | //当天DLB信息 |
| 102 | List<Dlb> dlList=repository.obtainDl(rq, "", "", line, "", "nbbm"); | 106 | List<Dlb> dlList=repository.obtainDl(rq, "", "", line, "", "nbbm"); |
| 103 | //当天加电信息表 | 107 | //当天加电信息表 |
| 104 | - List<Jdl> jdlList=jdlRepository.JdlList(rq); | 108 | + List<Jdl> jdlList = jdlService.queryJdlByJdlReception(rq, ""); |
| 105 | //前一天所有车辆最后进场班次信息 | 109 | //前一天所有车辆最后进场班次信息 |
| 106 | // List<Dlb> dlListBe=repository.obtainYlbefore(rq, "", "", "", ""); | 110 | // List<Dlb> dlListBe=repository.obtainYlbefore(rq, "", "", "", ""); |
| 107 | List<Cdl> cdyList=cdlRepository.obtainCdl(); | 111 | List<Cdl> cdyList=cdlRepository.obtainCdl(); |
| @@ -240,7 +244,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -240,7 +244,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 240 | } | 244 | } |
| 241 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 245 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 242 | // 保留两位小数 | 246 | // 保留两位小数 |
| 243 | - DecimalFormat df = new DecimalFormat("#.00"); | 247 | + DecimalFormat df = new DecimalFormat("#.000"); |
| 244 | // TODO Auto-generated method stub | 248 | // TODO Auto-generated method stub |
| 245 | // 当天DLB信息 | 249 | // 当天DLB信息 |
| 246 | List<Dlb> dlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); | 250 | List<Dlb> dlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); |
| @@ -261,19 +265,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -261,19 +265,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 261 | } | 265 | } |
| 262 | } | 266 | } |
| 263 | 267 | ||
| 264 | -// Map<String, Double> shMap=new HashMap<String,Double>(); | ||
| 265 | -// for (int i = 0; i < dlList.size(); i++) { | ||
| 266 | -// Dlb dlb=dlList.get(i); | ||
| 267 | -// String cl=dlb.getNbbm(); | ||
| 268 | -// if(shMap.get(cl)==null){ | ||
| 269 | -// shMap.put(cl, dlb.getSh()); | ||
| 270 | -// }else{ | ||
| 271 | -// double sh=shMap.get(cl); | ||
| 272 | -// shMap.remove(cl); | ||
| 273 | -// shMap.put(cl, Arith.add(sh, dlb.getSh())); | ||
| 274 | -// } | ||
| 275 | -// } | ||
| 276 | - List<Jdl> jdlList=jdlRepository.JdlList(rq); | 268 | + List<Jdl> jdlList = jdlService.queryJdlByJdlReception(rq, ""); |
| 277 | String sxtj=map2.get("sxtj").toString(); | 269 | String sxtj=map2.get("sxtj").toString(); |
| 278 | if(sxtj.equals("0")){ | 270 | if(sxtj.equals("0")){ |
| 279 | listpb=listpbs; | 271 | listpb=listpbs; |
| @@ -330,21 +322,15 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -330,21 +322,15 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 330 | double zlc =lcMap.get(map_.get("clZbh").toString()); | 322 | double zlc =lcMap.get(map_.get("clZbh").toString()); |
| 331 | //车辆总加电量 | 323 | //车辆总加电量 |
| 332 | double zjzl = 0.0; | 324 | double zjzl = 0.0; |
| 325 | + | ||
| 326 | + // 2022年12月20号要求不按车队导入,这之后导入的加注量将覆盖原加注量 | ||
| 333 | for (int i = 0; i < jdlList.size(); i++) { | 327 | for (int i = 0; i < jdlList.size(); i++) { |
| 334 | Jdl jdl=jdlList.get(i); | 328 | Jdl jdl=jdlList.get(i); |
| 335 | - if(map_.get("clZbh").toString().equals(jdl.getNbbm()) | ||
| 336 | - &&map_.get("company").toString().equals(jdl.getGsBm()) | ||
| 337 | - &&map_.get("bCompany").toString().equals(jdl.getFgsBm())){ | ||
| 338 | - zjzl = Arith.add(zjzl,jdl.getJdl()); | 329 | + if(map_.get("clZbh").toString().equals(jdl.getNbbm())){ |
| 330 | + zjzl = Arith.add(zjzl, jdl.getJdl()); | ||
| 339 | } | 331 | } |
| 340 | } | 332 | } |
| 341 | -// double clsh=0.0; | ||
| 342 | -// if(shMap.get(map_.get("clZbh").toString())==null){ | ||
| 343 | -// clsh=0.0; | ||
| 344 | -// }else{ | ||
| 345 | -// clsh=shMap.get(map_.get("clZbh").toString()); | ||
| 346 | -// } | ||
| 347 | -// zjzl =Arith.sub(zjzl, clsh); | 333 | + |
| 348 | Double nextJzyl = 0.0; | 334 | Double nextJzyl = 0.0; |
| 349 | for (int i = 0; i < listpb.size(); i++) { | 335 | for (int i = 0; i < listpb.size(); i++) { |
| 350 | Map<String, Object> map = listpb.get(i); | 336 | Map<String, Object> map = listpb.get(i); |
| @@ -1026,7 +1012,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -1026,7 +1012,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 1026 | Map<String, List<Dlb>> mapList=new HashMap<String,List<Dlb>>(); | 1012 | Map<String, List<Dlb>> mapList=new HashMap<String,List<Dlb>>(); |
| 1027 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | 1013 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
| 1028 | // 保留两位小数 | 1014 | // 保留两位小数 |
| 1029 | - DecimalFormat df = new DecimalFormat("#.00"); | 1015 | + DecimalFormat df = new DecimalFormat("#.000"); |
| 1030 | List<Dlb> dlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); | 1016 | List<Dlb> dlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); |
| 1031 | List<Dlb> dlbList_upd=new ArrayList<Dlb>(); | 1017 | List<Dlb> dlbList_upd=new ArrayList<Dlb>(); |
| 1032 | List<Dlb> dlbList_del=new ArrayList<Dlb>(); | 1018 | List<Dlb> dlbList_del=new ArrayList<Dlb>(); |
| @@ -1082,7 +1068,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -1082,7 +1068,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 1082 | shMap.put(cl, Arith.add(sh, dlb.getSh())); | 1068 | shMap.put(cl, Arith.add(sh, dlb.getSh())); |
| 1083 | } | 1069 | } |
| 1084 | } | 1070 | } |
| 1085 | - List<Jdl> jdlList=jdlRepository.JdlList(date); | 1071 | + List<Jdl> jdlList = jdlService.queryJdlByJdlReception(date, ""); |
| 1086 | Map<String, Object> newMap_=new HashMap<String,Object>(); | 1072 | Map<String, Object> newMap_=new HashMap<String,Object>(); |
| 1087 | Map<String, Object> cMap=new HashMap<String, Object>(); | 1073 | Map<String, Object> cMap=new HashMap<String, Object>(); |
| 1088 | List<Map<String, Object>> listpb_=listpbDc; | 1074 | List<Map<String, Object>> listpb_=listpbDc; |
| @@ -1099,10 +1085,8 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -1099,10 +1085,8 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 1099 | double zjzl = 0.0; | 1085 | double zjzl = 0.0; |
| 1100 | for (int i = 0; i < jdlList.size(); i++) { | 1086 | for (int i = 0; i < jdlList.size(); i++) { |
| 1101 | Jdl jdl=jdlList.get(i); | 1087 | Jdl jdl=jdlList.get(i); |
| 1102 | - if(map_.get("clZbh").toString().equals(jdl.getNbbm()) | ||
| 1103 | - &&map_.get("company").toString().equals(jdl.getGsBm()) | ||
| 1104 | - &&map_.get("bCompany").toString().equals(jdl.getFgsBm())){ | ||
| 1105 | - zjzl = Arith.add(zjzl,jdl.getJdl()); | 1088 | + if(map_.get("clZbh").toString().equals(jdl.getNbbm())){ |
| 1089 | + zjzl = Arith.add(zjzl, jdl.getJdl()); | ||
| 1106 | } | 1090 | } |
| 1107 | } | 1091 | } |
| 1108 | double clsh=0.0; | 1092 | 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,6 +3,7 @@ package com.bsth.service.oil.impl; | ||
| 3 | import java.io.File; | 3 | import java.io.File; |
| 4 | import java.io.FileInputStream; | 4 | import java.io.FileInputStream; |
| 5 | import java.text.DecimalFormat; | 5 | import java.text.DecimalFormat; |
| 6 | +import java.text.ParseException; | ||
| 6 | import java.text.SimpleDateFormat; | 7 | import java.text.SimpleDateFormat; |
| 7 | import java.util.ArrayList; | 8 | import java.util.ArrayList; |
| 8 | import java.util.Date; | 9 | import java.util.Date; |
| @@ -19,8 +20,13 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; | @@ -19,8 +20,13 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; | ||
| 19 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 20 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
| 21 | 22 | ||
| 23 | +import com.bsth.common.ResponseCode; | ||
| 22 | import com.bsth.entity.oil.Jdl; | 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 | import com.bsth.repository.oil.JdlRepository; | 28 | import com.bsth.repository.oil.JdlRepository; |
| 29 | +import com.bsth.security.util.SecurityUtils; | ||
| 24 | import com.bsth.service.impl.BaseServiceImpl; | 30 | import com.bsth.service.impl.BaseServiceImpl; |
| 25 | import com.bsth.service.oil.JdlService; | 31 | import com.bsth.service.oil.JdlService; |
| 26 | import com.bsth.util.ReportUtils; | 32 | import com.bsth.util.ReportUtils; |
| @@ -30,6 +36,9 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | @@ -30,6 +36,9 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | ||
| 30 | 36 | ||
| 31 | @Autowired | 37 | @Autowired |
| 32 | JdlRepository repository; | 38 | JdlRepository repository; |
| 39 | + | ||
| 40 | + @Autowired | ||
| 41 | + JdlReceptionRepository jdlReceptionRepository; | ||
| 33 | 42 | ||
| 34 | @Override | 43 | @Override |
| 35 | public String importExcel(File file, String gsbm, String gsName, String fgsbm, String fgsName) { | 44 | public String importExcel(File file, String gsbm, String gsName, String fgsbm, String fgsName) { |
| @@ -152,5 +161,240 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | @@ -152,5 +161,240 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | ||
| 152 | } | 161 | } |
| 153 | return modelMap; | 162 | return modelMap; |
| 154 | } | 163 | } |
| 164 | + | ||
| 165 | + @Override | ||
| 166 | + public String importExcel_2412(File file, String gsbm, String gsName, String fgsbm, String fgsName) { | ||
| 167 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 168 | + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 169 | + SimpleDateFormat ddFormat = new SimpleDateFormat("dd"); | ||
| 170 | + DecimalFormat df = new DecimalFormat("######0.00"); | ||
| 171 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 172 | + Date currDate = new Date(); | ||
| 173 | + List<String> textList = new ArrayList<String>(); | ||
| 174 | + try { | ||
| 175 | + POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(file)); | ||
| 176 | + HSSFWorkbook wb = new HSSFWorkbook(fs); | ||
| 177 | + HSSFSheet sheet = wb.getSheetAt(0); | ||
| 178 | + // 取得总行数 | ||
| 179 | + int rowNum = sheet.getLastRowNum() + 1; | ||
| 180 | + // 取得总列数 | ||
| 181 | + int cellNum = sheet.getRow(0).getLastCellNum(); | ||
| 182 | + HSSFRow row = null; | ||
| 183 | + HSSFCell cell = null; | ||
| 184 | + for(int i = 3; i < rowNum; i++){ | ||
| 185 | + row = sheet.getRow(i); | ||
| 186 | + if (row == null){ | ||
| 187 | + continue; | ||
| 188 | + } | ||
| 189 | + String text = ""; | ||
| 190 | + for(int j = 0; j < cellNum; j++){ | ||
| 191 | + cell = row.getCell(j); | ||
| 192 | + if(cell == null){ | ||
| 193 | + text += ","; | ||
| 194 | + continue; | ||
| 195 | + } | ||
| 196 | + text += String.valueOf(cell) + ","; | ||
| 197 | + } | ||
| 198 | + String[] split = (text+";").split(","); | ||
| 199 | + String str = ""; | ||
| 200 | + for(int j = 0; j < split.length && j < 12; j++){ | ||
| 201 | + str += split[j]; | ||
| 202 | + } | ||
| 203 | + if(str.trim().length() == 0) | ||
| 204 | + continue; | ||
| 205 | + textList.add(text + ";"); | ||
| 206 | + } | ||
| 207 | + List<JdlReception> list = new ArrayList<JdlReception>(); | ||
| 208 | + for(int i = 0; i < textList.size(); i++){ | ||
| 209 | + String text = textList.get(i); | ||
| 210 | + String[] split = text.split(","); | ||
| 211 | + if(split[1] != null && split[1].trim().length() > 0){ | ||
| 212 | + Integer dd = Integer.valueOf(split[1].trim().split("\\.")[0]); // 日期 | ||
| 213 | + String zh = split[2].trim(); // 桩号 | ||
| 214 | + String nbbm = split[3].trim(); // 车号 | ||
| 215 | + String startTime = split[4].trim(); // 开始时间 | ||
| 216 | + String endTime = split[5].trim(); // 结束时间 | ||
| 217 | + String sumTime = split[6].trim(); // 总计(分钟) | ||
| 218 | + String startSoc = split[7].trim(); // 起始电量SOC% | ||
| 219 | + String endSoc = split[8].trim(); // 结束电量SOC% | ||
| 220 | + String jdl = split[9].trim(); // 充电度数 | ||
| 221 | + String lc = split[10].trim(); // 里程度数 | ||
| 222 | + String stopReason = split[11].trim(); // 一次不能正常充电记录 | ||
| 223 | + JdlReception jdlRe = new JdlReception(); | ||
| 224 | + Date date = sd.parse(startTime); | ||
| 225 | + if(!(dd == Integer.valueOf(ddFormat.format(date)))){ | ||
| 226 | + date.setTime(date.getTime() - 1l*1000*60*60*24); | ||
| 227 | + } | ||
| 228 | + jdlRe.setDateStr(sdf.format(date)); | ||
| 229 | + jdlRe.setConnectorId(zh); | ||
| 230 | + jdlRe.setCarCode(nbbm); | ||
| 231 | + jdlRe.setStartTime(startTime); | ||
| 232 | + jdlRe.setEndTime(endTime); | ||
| 233 | + jdlRe.setSumTime(Integer.valueOf(sumTime.split("\\.")[0])); | ||
| 234 | + jdlRe.setStartSoc(Double.valueOf(startSoc)); | ||
| 235 | + jdlRe.setEndSoc(Double.valueOf(endSoc)); | ||
| 236 | + jdlRe.setChargeCapacity(Double.valueOf(jdl)); | ||
| 237 | + jdlRe.setStopReason(stopReason); | ||
| 238 | + jdlRe.setCreateBy(user.getUserName()); | ||
| 239 | + jdlRe.setCreateDate(currDate); | ||
| 240 | + jdlRe.setOrigin(1); | ||
| 241 | + list.add(jdlRe); | ||
| 242 | + } | ||
| 243 | + } | ||
| 244 | + jdlReceptionRepository.saveAll(list); | ||
| 245 | + wb.close(); | ||
| 246 | + fs.close(); | ||
| 247 | + } catch (Exception e) { | ||
| 248 | + // TODO Auto-generated catch block | ||
| 249 | + e.printStackTrace(); | ||
| 250 | + return "文件导入失败"; | ||
| 251 | + } finally { | ||
| 252 | + file.delete(); | ||
| 253 | + } | ||
| 254 | + return "文件导入成功"; | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + @Override | ||
| 258 | + public Map<String, Object> query_2412(Map<String, Object> map) { | ||
| 259 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 260 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 261 | + Map<String, Object> modelMap = new HashMap<String, Object>(); | ||
| 262 | + String rq = map.get("rq").toString(); | ||
| 263 | + String nbbm = map.get("nbbm").toString(); | ||
| 264 | + Integer page = Integer.valueOf(map.containsKey("page")?map.get("page").toString():"0"); | ||
| 265 | + List<Jdl> query = new ArrayList<Jdl>(); | ||
| 266 | + | ||
| 267 | + List<Object[]> querySum = jdlReceptionRepository.querySum(rq, nbbm); | ||
| 268 | + | ||
| 269 | + try { | ||
| 270 | + for(Object[] j : querySum){ | ||
| 271 | + Jdl jdl = new Jdl(); | ||
| 272 | + jdl.setRq(sdfMonth.parse(j[0].toString())); | ||
| 273 | + jdl.setNbbm(j[1].toString()); | ||
| 274 | + jdl.setJdl(Double.valueOf(j[2].toString())); | ||
| 275 | + jdl.setJdz(""); | ||
| 276 | + jdl.setRemarks(""); | ||
| 277 | + query.add(jdl); | ||
| 278 | + } | ||
| 279 | + } catch (Exception e) { | ||
| 280 | + // TODO Auto-generated catch block | ||
| 281 | + e.printStackTrace(); | ||
| 282 | + } | ||
| 283 | + | ||
| 284 | + if(!map.containsKey("type")){ | ||
| 285 | + | ||
| 286 | + int end = (page+1)*10>query.size()?query.size():(page+1)*10; | ||
| 287 | + modelMap.put("dataList", query.subList(page*10, end)); | ||
| 288 | + modelMap.put("totalPages", query.size()%10>0?query.size()/10+1:query.size()/10); | ||
| 289 | + | ||
| 290 | + } else if(map.get("type").toString().equals("export")){ | ||
| 291 | + | ||
| 292 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | ||
| 293 | + for(Jdl jdl : query){ | ||
| 294 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 295 | + m.put("rq", sdfMonth.format(jdl.getRq())); | ||
| 296 | + m.put("nbbm", jdl.getNbbm()); | ||
| 297 | + m.put("jdl", jdl.getJdl()); | ||
| 298 | + m.put("jdz", jdl.getJdz()); | ||
| 299 | + m.put("remarks", jdl.getRemarks()); | ||
| 300 | + list.add(m); | ||
| 301 | + } | ||
| 302 | + | ||
| 303 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 304 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 305 | + ReportUtils ee = new ReportUtils(); | ||
| 306 | + try { | ||
| 307 | + listI.add(list.iterator()); | ||
| 308 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | ||
| 309 | + ee.excelReplace(listI, new Object[] { m }, path+"mould/export_Jdl.xls", | ||
| 310 | + path+"export/车辆充电量" + sdfSimple.format(sdfMonth.parse(rq)) + ".xls"); | ||
| 311 | + } catch (Exception e) { | ||
| 312 | + // TODO: handle exception | ||
| 313 | + e.printStackTrace(); | ||
| 314 | + } | ||
| 315 | + } | ||
| 316 | + return modelMap; | ||
| 317 | + } | ||
| 318 | + | ||
| 319 | + @Override | ||
| 320 | + public List<JdlReception> queryJdlReception(Map<String, Object> map) { | ||
| 321 | + String rq = map.get("rq").toString(); | ||
| 322 | + String nbbm = map.get("nbbm").toString(); | ||
| 323 | + List<JdlReception> query = jdlReceptionRepository.query(rq, nbbm); | ||
| 324 | + return query; | ||
| 325 | + } | ||
| 326 | + | ||
| 327 | + @Override | ||
| 328 | + public Map<String, Object> queryJdlReceptionBatch(Map<String, Object> map) { | ||
| 329 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 330 | + Map<String, Object> modelMap = new HashMap<String, Object>(); | ||
| 331 | + String rq = map.get("rq").toString(); | ||
| 332 | + Integer page = Integer.valueOf(map.containsKey("page")?map.get("page").toString():"0"); | ||
| 333 | + List<Map<String, Object>> query = new ArrayList<Map<String, Object>>(); | ||
| 334 | + | ||
| 335 | + List<Object[]> queryBatch = jdlReceptionRepository.queryBatch(rq); | ||
| 336 | + | ||
| 337 | + try { | ||
| 338 | + for(Object[] j : queryBatch){ | ||
| 339 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 340 | + m.put("createBy", j[0]); | ||
| 341 | + m.put("createDate", j[1]); | ||
| 342 | + query.add(m); | ||
| 343 | + } | ||
| 344 | + } catch (Exception e) { | ||
| 345 | + // TODO Auto-generated catch block | ||
| 346 | + e.printStackTrace(); | ||
| 347 | + } | ||
| 348 | + | ||
| 349 | + int end = (page+1)*10>query.size()?query.size():(page+1)*10; | ||
| 350 | + modelMap.put("dataList", query.subList(page*10, end)); | ||
| 351 | + modelMap.put("totalPages", query.size()%10>0?query.size()/10+1:query.size()/10); | ||
| 352 | + | ||
| 353 | + return modelMap; | ||
| 354 | + } | ||
| 355 | + | ||
| 356 | + @Override | ||
| 357 | + public List<JdlReception> queryJdlReceptionBatchData(Map<String, Object> map) { | ||
| 358 | + String createBy = map.get("createBy").toString(); | ||
| 359 | + String createDate = map.get("createDate").toString(); | ||
| 360 | + List<JdlReception> query = jdlReceptionRepository.queryBatchData(createBy, createDate); | ||
| 361 | + return query; | ||
| 362 | + } | ||
| 363 | + | ||
| 364 | + @Override | ||
| 365 | + public Map<String, Object> deleteJdlReceptionBatch(Map<String, Object> map) { | ||
| 366 | + Map<String, Object> resMap = new HashMap<>(); | ||
| 367 | + try{ | ||
| 368 | + String createBy = map.get("createBy").toString(); | ||
| 369 | + String createDate = map.get("createDate").toString(); | ||
| 370 | + jdlReceptionRepository.deleteBatch(createBy, createDate); | ||
| 371 | + resMap.put("status", ResponseCode.SUCCESS); | ||
| 372 | + }catch (Exception e){ | ||
| 373 | + resMap.put("status", ResponseCode.ERROR); | ||
| 374 | + resMap.put("msg", e.getMessage()); | ||
| 375 | + } | ||
| 376 | + return resMap; | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | + @Override | ||
| 380 | + public List<Jdl> queryJdlByJdlReception(String rq, String nbbm) { | ||
| 381 | + List<Jdl> list = new ArrayList<Jdl>(); | ||
| 382 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 383 | + List<JdlReception> query = jdlReceptionRepository.query(rq, nbbm); | ||
| 384 | + for(JdlReception jr : query){ | ||
| 385 | + try { | ||
| 386 | + Jdl jdl = new Jdl(); | ||
| 387 | + jdl.setFgsBm("-1"); | ||
| 388 | + jdl.setRq(sdf.parse(jr.getDateStr())); | ||
| 389 | + jdl.setJdl(jr.getChargeCapacity()); | ||
| 390 | + jdl.setNbbm(jr.getCarCode()); | ||
| 391 | + list.add(jdl); | ||
| 392 | + } catch (Exception e) { | ||
| 393 | + // TODO Auto-generated catch block | ||
| 394 | + e.printStackTrace(); | ||
| 395 | + } | ||
| 396 | + } | ||
| 397 | + return list; | ||
| 398 | + } | ||
| 155 | 399 | ||
| 156 | } | 400 | } |
src/main/java/com/bsth/service/oil/impl/QlbServiceImpl.java
| @@ -91,7 +91,7 @@ public class QlbServiceImpl extends BaseServiceImpl<Qlb,Integer> implements QlbS | @@ -91,7 +91,7 @@ public class QlbServiceImpl extends BaseServiceImpl<Qlb,Integer> implements QlbS | ||
| 91 | // String rq="2017-11-02"; | 91 | // String rq="2017-11-02"; |
| 92 | String line=""; | 92 | String line=""; |
| 93 | //保留两位小数 | 93 | //保留两位小数 |
| 94 | - DecimalFormat df = new DecimalFormat("#.00"); | 94 | + DecimalFormat df = new DecimalFormat("#.000"); |
| 95 | // TODO Auto-generated method stub | 95 | // TODO Auto-generated method stub |
| 96 | Map<String, Object> newMap=new HashMap<String,Object>(); | 96 | Map<String, Object> newMap=new HashMap<String,Object>(); |
| 97 | //当天QLB信息 | 97 | //当天QLB信息 |
| @@ -227,7 +227,7 @@ public class QlbServiceImpl extends BaseServiceImpl<Qlb,Integer> implements QlbS | @@ -227,7 +227,7 @@ public class QlbServiceImpl extends BaseServiceImpl<Qlb,Integer> implements QlbS | ||
| 227 | } | 227 | } |
| 228 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 228 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 229 | // 保留两位小数 | 229 | // 保留两位小数 |
| 230 | - DecimalFormat df = new DecimalFormat("#.00"); | 230 | + DecimalFormat df = new DecimalFormat("#.000"); |
| 231 | // TODO Auto-generated method stub | 231 | // TODO Auto-generated method stub |
| 232 | // 当天QLB信息 | 232 | // 当天QLB信息 |
| 233 | List<Qlb> qlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); | 233 | List<Qlb> qlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); |
| @@ -980,7 +980,7 @@ public class QlbServiceImpl extends BaseServiceImpl<Qlb,Integer> implements QlbS | @@ -980,7 +980,7 @@ public class QlbServiceImpl extends BaseServiceImpl<Qlb,Integer> implements QlbS | ||
| 980 | Map<String, List<Qlb>> mapList=new HashMap<String,List<Qlb>>(); | 980 | Map<String, List<Qlb>> mapList=new HashMap<String,List<Qlb>>(); |
| 981 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | 981 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
| 982 | // 保留两位小数 | 982 | // 保留两位小数 |
| 983 | - DecimalFormat df = new DecimalFormat("#.00"); | 983 | + DecimalFormat df = new DecimalFormat("#.000"); |
| 984 | List<Qlb> qlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); | 984 | List<Qlb> qlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); |
| 985 | List<Qlb> qlbList_upd=new ArrayList<Qlb>(); | 985 | List<Qlb> qlbList_upd=new ArrayList<Qlb>(); |
| 986 | List<Qlb> qlbList_del=new ArrayList<Qlb>(); | 986 | List<Qlb> qlbList_del=new ArrayList<Qlb>(); |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| 1 | -package com.bsth.service.oil.impl; | ||
| 2 | - | ||
| 3 | -import java.sql.ResultSet; | ||
| 4 | -import java.sql.SQLException; | ||
| 5 | -import java.text.DecimalFormat; | ||
| 6 | -import java.text.ParseException; | ||
| 7 | -import java.text.SimpleDateFormat; | ||
| 8 | -import java.util.ArrayList; | ||
| 9 | -import java.util.Calendar; | ||
| 10 | -import java.util.Date; | ||
| 11 | -import java.util.HashMap; | ||
| 12 | -import java.util.Iterator; | ||
| 13 | -import java.util.List; | ||
| 14 | -import java.util.Map; | ||
| 15 | -import java.util.Set; | ||
| 16 | - | ||
| 17 | -import javax.transaction.Transactional; | ||
| 18 | - | ||
| 19 | -import com.bsth.util.PrivilegeUtils; | ||
| 20 | -import org.apache.commons.lang3.StringEscapeUtils; | ||
| 21 | -import org.apache.commons.lang3.StringUtils; | ||
| 22 | -import org.slf4j.Logger; | ||
| 23 | -import org.slf4j.LoggerFactory; | ||
| 24 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 25 | -import org.springframework.data.domain.Sort; | ||
| 26 | -import org.springframework.data.domain.Sort.Direction; | ||
| 27 | -import org.springframework.jdbc.core.JdbcTemplate; | ||
| 28 | -import org.springframework.jdbc.core.RowMapper; | ||
| 29 | -import org.springframework.stereotype.Service; | ||
| 30 | - | ||
| 31 | -import com.alibaba.fastjson.JSONArray; | ||
| 32 | -import com.alibaba.fastjson.JSONObject; | ||
| 33 | -import com.bsth.common.Constants; | ||
| 34 | -import com.bsth.common.ResponseCode; | ||
| 35 | -import com.bsth.data.BasicData; | ||
| 36 | -import com.bsth.entity.Cars; | ||
| 37 | -import com.bsth.entity.Line; | ||
| 38 | -import com.bsth.entity.SystemParam; | ||
| 39 | -import com.bsth.entity.mcy_forms.Daily; | ||
| 40 | -import com.bsth.entity.oil.Cyl; | ||
| 41 | -import com.bsth.entity.oil.Dlb; | ||
| 42 | -import com.bsth.entity.oil.Nylog; | ||
| 43 | -import com.bsth.entity.oil.Ylb; | ||
| 44 | -import com.bsth.entity.oil.Ylxxb; | ||
| 45 | -import com.bsth.entity.search.CustomerSpecs; | ||
| 46 | -import com.bsth.entity.sys.Role; | ||
| 47 | -import com.bsth.entity.sys.SysUser; | ||
| 48 | -import com.bsth.repository.CarsRepository; | ||
| 49 | -import com.bsth.repository.LineRepository; | ||
| 50 | -import com.bsth.repository.oil.CylRepository; | ||
| 51 | -import com.bsth.repository.oil.DlbRepository; | ||
| 52 | -import com.bsth.repository.oil.NylogRepository; | ||
| 53 | -import com.bsth.repository.oil.YlbRepository; | ||
| 54 | -import com.bsth.repository.oil.YlxxbRepository; | ||
| 55 | -import com.bsth.security.util.SecurityUtils; | ||
| 56 | -import com.bsth.service.impl.BaseServiceImpl; | ||
| 57 | -import com.bsth.service.oil.DlbService; | ||
| 58 | -import com.bsth.service.oil.YlbService; | ||
| 59 | -import com.bsth.service.realcontrol.ScheduleRealInfoService; | ||
| 60 | -import com.bsth.util.Arith; | 1 | +package com.bsth.service.oil.impl; |
| 2 | + | ||
| 3 | +import java.sql.ResultSet; | ||
| 4 | +import java.sql.SQLException; | ||
| 5 | +import java.text.DecimalFormat; | ||
| 6 | +import java.text.ParseException; | ||
| 7 | +import java.text.SimpleDateFormat; | ||
| 8 | +import java.util.ArrayList; | ||
| 9 | +import java.util.Calendar; | ||
| 10 | +import java.util.Date; | ||
| 11 | +import java.util.HashMap; | ||
| 12 | +import java.util.Iterator; | ||
| 13 | +import java.util.List; | ||
| 14 | +import java.util.Map; | ||
| 15 | + | ||
| 16 | +import javax.transaction.Transactional; | ||
| 17 | + | ||
| 18 | +import org.apache.commons.lang3.StringEscapeUtils; | ||
| 19 | +import org.apache.commons.lang3.StringUtils; | ||
| 20 | +import org.slf4j.Logger; | ||
| 21 | +import org.slf4j.LoggerFactory; | ||
| 22 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 23 | +import org.springframework.data.domain.Sort; | ||
| 24 | +import org.springframework.data.domain.Sort.Direction; | ||
| 25 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 26 | +import org.springframework.jdbc.core.RowMapper; | ||
| 27 | +import org.springframework.stereotype.Service; | ||
| 28 | + | ||
| 29 | +import com.alibaba.fastjson.JSONArray; | ||
| 30 | +import com.alibaba.fastjson.JSONObject; | ||
| 31 | +import com.bsth.common.ResponseCode; | ||
| 32 | +import com.bsth.data.BasicData; | ||
| 33 | +import com.bsth.entity.Cars; | ||
| 34 | +import com.bsth.entity.Line; | ||
| 35 | +import com.bsth.entity.mcy_forms.Daily; | ||
| 36 | +import com.bsth.entity.oil.Cyl; | ||
| 37 | +import com.bsth.entity.oil.Dlb; | ||
| 38 | +import com.bsth.entity.oil.Nylog; | ||
| 39 | +import com.bsth.entity.oil.Ylb; | ||
| 40 | +import com.bsth.entity.oil.Ylxxb; | ||
| 41 | +import com.bsth.entity.search.CustomerSpecs; | ||
| 42 | +import com.bsth.entity.sys.SysUser; | ||
| 43 | +import com.bsth.repository.CarsRepository; | ||
| 44 | +import com.bsth.repository.LineRepository; | ||
| 45 | +import com.bsth.repository.oil.CylRepository; | ||
| 46 | +import com.bsth.repository.oil.DlbRepository; | ||
| 47 | +import com.bsth.repository.oil.NylogRepository; | ||
| 48 | +import com.bsth.repository.oil.YlbRepository; | ||
| 49 | +import com.bsth.repository.oil.YlxxbRepository; | ||
| 50 | +import com.bsth.security.util.SecurityUtils; | ||
| 51 | +import com.bsth.service.impl.BaseServiceImpl; | ||
| 52 | +import com.bsth.service.oil.DlbService; | ||
| 53 | +import com.bsth.service.oil.YlbService; | ||
| 54 | +import com.bsth.service.realcontrol.ScheduleRealInfoService; | ||
| 55 | +import com.bsth.util.Arith; | ||
| 61 | import com.bsth.util.BatchSaveUtils; | 56 | import com.bsth.util.BatchSaveUtils; |
| 62 | -import com.bsth.util.ReportUtils; | ||
| 63 | -import com.github.abel533.echarts.code.Y; | ||
| 64 | - | ||
| 65 | -import javassist.bytecode.stackmap.BasicBlock.Catch; | ||
| 66 | - | ||
| 67 | -@Service | ||
| 68 | -public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbService{ | ||
| 69 | - @Autowired | ||
| 70 | - YlbRepository repository; | ||
| 71 | - @Autowired | ||
| 72 | - NylogRepository nylogRepository; | ||
| 73 | - @Autowired | ||
| 74 | - YlxxbRepository ylxxbRepository; | ||
| 75 | - | ||
| 76 | - @Autowired | ||
| 77 | - DlbService dlbService; | ||
| 78 | - | ||
| 79 | - @Autowired | ||
| 80 | - DlbRepository dlbRepository; | ||
| 81 | - | ||
| 82 | - @Autowired | ||
| 83 | - CylRepository cylRepository; | ||
| 84 | - | ||
| 85 | - @Autowired | ||
| 86 | - CarsRepository carsRepository; | ||
| 87 | - | ||
| 88 | - | ||
| 89 | - @Autowired | ||
| 90 | - LineRepository lineRepository; | ||
| 91 | - | ||
| 92 | - @Autowired | ||
| 93 | - ScheduleRealInfoService scheduleRealInfoService; | ||
| 94 | - | ||
| 95 | - @Autowired | ||
| 96 | - JdbcTemplate jdbcTemplate; | ||
| 97 | - | 57 | +import com.bsth.util.PrivilegeUtils; |
| 58 | +import com.bsth.util.ReportUtils; | ||
| 59 | +import com.github.abel533.echarts.code.Y; | ||
| 60 | + | ||
| 61 | +import javassist.bytecode.stackmap.BasicBlock.Catch; | ||
| 62 | + | ||
| 63 | +@Service | ||
| 64 | +public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbService{ | ||
| 65 | + @Autowired | ||
| 66 | + YlbRepository repository; | ||
| 67 | + @Autowired | ||
| 68 | + NylogRepository nylogRepository; | ||
| 69 | + @Autowired | ||
| 70 | + YlxxbRepository ylxxbRepository; | ||
| 71 | + | ||
| 72 | + @Autowired | ||
| 73 | + DlbService dlbService; | ||
| 74 | + | ||
| 75 | + @Autowired | ||
| 76 | + DlbRepository dlbRepository; | ||
| 77 | + | ||
| 78 | + @Autowired | ||
| 79 | + CylRepository cylRepository; | ||
| 80 | + | ||
| 81 | + @Autowired | ||
| 82 | + CarsRepository carsRepository; | ||
| 83 | + | ||
| 84 | + | ||
| 85 | + @Autowired | ||
| 86 | + LineRepository lineRepository; | ||
| 87 | + | ||
| 88 | + @Autowired | ||
| 89 | + ScheduleRealInfoService scheduleRealInfoService; | ||
| 90 | + | ||
| 91 | + @Autowired | ||
| 92 | + JdbcTemplate jdbcTemplate; | ||
| 93 | + | ||
| 98 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 94 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 99 | 95 | ||
| 100 | private static boolean modify_rights_close = false; //南汇的油电修改权限(由于浦交加了限制,改为默认打开权限) | 96 | private static boolean modify_rights_close = false; //南汇的油电修改权限(由于浦交加了限制,改为默认打开权限) |
| 101 | 97 | ||
| 102 | - private static boolean modify_rights_close_pj = true; | ||
| 103 | - | ||
| 104 | - /** | ||
| 105 | - * 获取进存油信息 | ||
| 106 | - * @Transactional 回滚事物 | ||
| 107 | - */ | ||
| 108 | - @Transactional | ||
| 109 | - @Override | ||
| 110 | - public String obtainDsq() throws Exception{ | ||
| 111 | - String result = "failure"; | ||
| 112 | - try { | ||
| 113 | - List<Ylb> addList = new ArrayList<Ylb>(); | ||
| 114 | - String type = ""; | ||
| 115 | - List<Cars> carsList=carsRepository.findCars(); | ||
| 116 | - Map<String, Boolean> carsMap=new HashMap<String, Boolean>(); | ||
| 117 | - for (int i = 0; i < carsList.size(); i++) { | ||
| 118 | - Cars c=carsList.get(i); | ||
| 119 | - carsMap.put(c.getInsideCode(), (c.getSfdc()!=null?c.getSfdc():false) | ||
| 120 | - || (c.getHydrogen()!=null?c.getHydrogen():false));//电车或氢能源车,排除这些类型就都是油车 | ||
| 121 | - } | ||
| 122 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 123 | - Date dNow = new Date(); //当前时间 | ||
| 124 | - Date dBefore = new Date(); | ||
| 125 | - Calendar calendar = Calendar.getInstance(); //得到日历 | ||
| 126 | - calendar.setTime(dNow);//把当前时间赋给日历 | ||
| 127 | - calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | ||
| 128 | - dBefore = calendar.getTime(); //得到前一天的时间 | ||
| 129 | - String rq=sdf.format(dBefore); | ||
| 130 | - //保留两位小数 | ||
| 131 | - DecimalFormat df = new DecimalFormat("#.00"); | ||
| 132 | - // TODO Auto-generated method stub | ||
| 133 | - Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 134 | - //当天YLB信息 | ||
| 135 | -// List<Ylb> ylList=repository.obtainYl(rq,"","","","","nbbm"); | ||
| 136 | - List<Ylb> ylList=this.listOrderBy(rq,"","","","","nbbm"); | ||
| 137 | - //当天YLXXB信息 | ||
| 138 | - // List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq); | ||
| 139 | - //前一天所有车辆最后进场班次信息 | ||
| 140 | - List<Ylb> ylListBe=this.listByRqJcsx(rq,"","","",""); | ||
| 141 | -// List<Ylb> ylListBe=repository.listMaxRqJcsx(rq, "", "", "", ""); | ||
| 142 | - List<Cyl> clyList=cylRepository.obtainCyl("",""); | ||
| 143 | - //从排班表中计算出行驶的总里程 | ||
| 144 | - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("", rq, "", "", "", ""); | ||
| 145 | - | ||
| 146 | - for(int x=0;x<listpb.size();x++){ | ||
| 147 | - boolean sfyc = true;//是否油车 | ||
| 148 | - Map<String, Object> map = listpb.get(x); | ||
| 149 | - if (carsMap.get(map.get("clZbh").toString()) != null | ||
| 150 | - && carsMap.get(map.get("clZbh").toString())) { | ||
| 151 | - sfyc = false; | ||
| 152 | - } | ||
| 153 | - if(sfyc){ | ||
| 154 | - //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | ||
| 155 | - Ylb t=new Ylb(); | ||
| 156 | - for(int k=0;k<ylList.size();k++){ | ||
| 157 | - Ylb t1=ylList.get(k); | ||
| 158 | - if(t1.getNbbm().equals(map.get("clZbh").toString()) | ||
| 159 | - &&t1.getJsy().equals(map.get("jGh").toString()) | ||
| 160 | - &&t1.getXlbm().equals(map.get("xlBm").toString()) | ||
| 161 | - &&t1.getLp().equals(map.get("lpName").toString())) | ||
| 162 | - { | ||
| 163 | - t=t1; | ||
| 164 | - type="update"; | ||
| 165 | - } | ||
| 166 | - } | ||
| 167 | - | ||
| 168 | - //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | ||
| 169 | - if(map.get("seqNumber").toString().equals("1")){ | ||
| 170 | - boolean fage=true; | ||
| 171 | - for (int i = 0; i < ylListBe.size(); i++) { | ||
| 172 | - Ylb ylb=ylListBe.get(i); | ||
| 173 | - if(map.get("clZbh").toString().equals(ylb.getNbbm())){ | ||
| 174 | - if(ylb.getJzyl()!=null){ | ||
| 175 | - if(ylb.getJzyl()>=0){ | ||
| 176 | - t.setCzyl(ylb.getJzyl()); | ||
| 177 | - fage=false; | ||
| 178 | - break; | ||
| 179 | - } | ||
| 180 | - } | ||
| 181 | - | ||
| 182 | - } | ||
| 183 | - } | ||
| 184 | - if(fage){ | ||
| 185 | - for (int y = 0; y < clyList.size(); y++) { | ||
| 186 | - Cyl cyl=clyList.get(y); | ||
| 187 | - if(map.get("clZbh").toString().equals(cyl.getNbbm())){ | ||
| 188 | - if(cyl.getCyl()!=null){ | ||
| 189 | - t.setCzyl(cyl.getCyl()); | ||
| 190 | - fage=false; | ||
| 191 | - break; | ||
| 192 | - } | ||
| 193 | - } | ||
| 194 | - } | ||
| 195 | - } | ||
| 196 | - if(fage){ | ||
| 197 | - t.setCzyl(0.0); | ||
| 198 | - } | ||
| 199 | - } | ||
| 200 | - t.setNbbm(map.get("clZbh").toString()); | ||
| 201 | - t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | ||
| 202 | - t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString())); | ||
| 203 | - t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | ||
| 204 | - t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString()); | ||
| 205 | - t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | ||
| 206 | - t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | ||
| 207 | - t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | ||
| 208 | - t.setLp(map.get("lpName")==null?"":map.get("lpName").toString()); | ||
| 209 | - t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | ||
| 210 | - t.setJname(map.get("jName").toString()); | ||
| 211 | - t.setRq(sdf.parse(rq)); | ||
| 212 | - t.setCreatetime(dNow); | ||
| 213 | - if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 214 | - if(type.equals("update")){ | ||
| 215 | - repository.save(t); | ||
| 216 | - }else{ | ||
| 217 | - addList.add(t); | ||
| 218 | - } | ||
| 219 | - } | ||
| 220 | - } | ||
| 221 | - | ||
| 222 | - } | ||
| 223 | - if(addList.size()>0){ | ||
| 224 | - try { | ||
| 225 | - new BatchSaveUtils<Ylb>().saveList2(addList, Ylb.class); | ||
| 226 | - } catch (Exception e) { | ||
| 227 | - // TODO: handle exception | ||
| 228 | - if(e.getMessage().indexOf("PK_YLB_UK")>0){ | ||
| 229 | - newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 230 | - logger.info("定时器:存在相同数据,数据已经过滤"); | ||
| 231 | - } | ||
| 232 | - } | ||
| 233 | - } | ||
| 234 | - result = "success"; | ||
| 235 | - }catch (Exception e) { | ||
| 236 | - // TODO Auto-generated catch block | ||
| 237 | - throw e; | ||
| 238 | - }finally{ | ||
| 239 | - logger.info("setDDRB:"+result); | ||
| 240 | - } | ||
| 241 | - | ||
| 242 | - return result; | ||
| 243 | - } | ||
| 244 | - | ||
| 245 | - /** | ||
| 246 | - * 获取进存油信息 | ||
| 247 | - * @Transactional 回滚事物 | ||
| 248 | - */ | ||
| 249 | - @Transactional | ||
| 250 | - @Override | ||
| 251 | - public Map<String, Object> obtain(Map<String, Object> map2) throws Exception{ | ||
| 252 | - Map<String, Object> newMap = new HashMap<String, Object>(); | ||
| 253 | - try { | ||
| 254 | - Date date=new Date(); | ||
| 255 | - List<Cars> carsList = carsRepository.findCars(); | ||
| 256 | - Map<String, Boolean> carsMap = new HashMap<String, Boolean>(); | ||
| 257 | - for (int i = 0; i < carsList.size(); i++) { | ||
| 258 | - Cars c = carsList.get(i); | ||
| 259 | - carsMap.put(c.getInsideCode(), (c.getSfdc()!=null?c.getSfdc():false) | ||
| 260 | - || (c.getHydrogen()!=null?c.getHydrogen():false));//电车或氢能源车,排除这些类型就都是油车 | ||
| 261 | - } | ||
| 262 | - String rq = map2.get("rq").toString(); | ||
| 263 | - String line = ""; | ||
| 264 | - if (map2.get("xlbm_like") != null) { | ||
| 265 | - line = map2.get("xlbm_like").toString().trim(); | ||
| 266 | - } | ||
| 267 | - String gsbm=""; | ||
| 268 | - if(map2.get("ssgsdm_like")!=null){ | ||
| 269 | - gsbm=map2.get("ssgsdm_like").toString(); | ||
| 270 | - } | ||
| 271 | - String fgsbm=""; | ||
| 272 | - if(map2.get("fgsdm_like")!=null){ | ||
| 273 | - fgsbm=map2.get("fgsdm_like").toString(); | ||
| 274 | - } | ||
| 275 | - String nbbm=""; | ||
| 276 | - if(map2.get("nbbm_eq")!=null){ | ||
| 277 | - nbbm=map2.get("nbbm_eq").toString(); | ||
| 278 | - } | ||
| 279 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 280 | - // 保留两位小数 | ||
| 281 | - DecimalFormat df = new DecimalFormat("#.00"); | ||
| 282 | - // TODO Auto-generated method stub | ||
| 283 | - // 当天YLB信息 | ||
| 284 | - List<Ylb> ylList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); | ||
| 285 | - | ||
| 286 | - // 当天YLXXB信息 | ||
| 287 | - List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm); | ||
| 288 | - | ||
| 289 | - // 前一天所有车辆最后进场班次信息 | ||
| 290 | - List<Ylb> ylListBe = this.listByRqJcsx(rq, gsbm, fgsbm, "", nbbm); | ||
| 291 | - List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm); | ||
| 292 | - | ||
| 293 | - // 从排班表中计算出行驶的总里程 | ||
| 294 | - List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); | ||
| 295 | - List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList("", rq, gsbm, fgsbm, "", nbbm); | ||
| 296 | - | ||
| 297 | - String sxtj=map2.get("sxtj").toString(); | ||
| 298 | - if(sxtj.equals("0")){ | ||
| 299 | - listpb=listpbs; | ||
| 300 | - }else if (sxtj.equals("5")){ | ||
| 301 | - List<String> stringList=new ArrayList<String>(); | ||
| 302 | - | ||
| 303 | - List<Object[]> objectLists = repository.checkNbmmFgs(rq, gsbm); | ||
| 304 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 305 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 306 | - stringList.add(clbm); | ||
| 307 | - } | ||
| 308 | - | ||
| 309 | - for (int i = 0; i < stringList.size(); i++) { | ||
| 310 | - String strNbbm=stringList.get(i); | ||
| 311 | - for (int j = 0; j < listpbs.size(); j++) { | ||
| 312 | - Map<String, Object> map = listpbs.get(j); | ||
| 313 | - String mapNbbm=map.get("clZbh").toString(); | ||
| 314 | - if(strNbbm.equals(mapNbbm)){ | ||
| 315 | - listpb.add(map); | ||
| 316 | - } | ||
| 317 | - } | ||
| 318 | - } | ||
| 319 | - | ||
| 320 | - }else{ | ||
| 321 | - List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, "",nbbm); | ||
| 322 | - List<String> stringList=new ArrayList<String>(); | ||
| 323 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 324 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 325 | - int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 326 | - //一车一单 | ||
| 327 | - if(sxtj.equals("1")){ | ||
| 328 | - if(cs==1){ | ||
| 329 | - stringList.add(clbm); | ||
| 330 | - } | ||
| 331 | - } | ||
| 332 | - //一车多单 | ||
| 333 | - if(sxtj.equals("2")){ | ||
| 334 | - if(cs>1){ | ||
| 335 | - stringList.add(clbm); | ||
| 336 | - } | ||
| 337 | - } | ||
| 338 | - } | ||
| 339 | - | ||
| 340 | - for (int i = 0; i < stringList.size(); i++) { | ||
| 341 | - String strNbbm=stringList.get(i); | ||
| 342 | - for (int j = 0; j < listpbs.size(); j++) { | ||
| 343 | - Map<String, Object> map = listpbs.get(j); | ||
| 344 | - String mapNbbm=map.get("clZbh").toString(); | ||
| 345 | - if(strNbbm.equals(mapNbbm)){ | ||
| 346 | - listpb.add(map); | ||
| 347 | - } | ||
| 348 | - } | ||
| 349 | - } | ||
| 350 | - } | ||
| 351 | - | ||
| 352 | - List<Ylb> addList = new ArrayList<Ylb>(); | ||
| 353 | - List<Ylb> updateList = new ArrayList<Ylb>(); | ||
| 354 | - Map<String, Object> ylMap=new HashMap<String, Object>(); | ||
| 355 | - | ||
| 356 | - Map<String, Object> cMap=new HashMap<String, Object>(); | ||
| 357 | - for (int x = 0; x < listpb.size(); x++) { | ||
| 358 | - String type = "add"; | ||
| 359 | - boolean sfyc = true;//是否油车 | ||
| 360 | - Map<String, Object> map = listpb.get(x); | ||
| 361 | - if (carsMap.get(map.get("clZbh").toString()) != null | ||
| 362 | - && carsMap.get(map.get("clZbh").toString())) { | ||
| 363 | - sfyc = false; | ||
| 364 | - } | ||
| 365 | - if (sfyc) { | ||
| 366 | - // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | ||
| 367 | - Ylb t = new Ylb(); | ||
| 368 | - for (int k = 0; k < ylList.size(); k++) { | ||
| 369 | - Ylb t1 = ylList.get(k); | ||
| 370 | - if (t1.getNbbm().equals(map.get("clZbh").toString()) | ||
| 371 | - && t1.getJsy().equals(map.get("jGh").toString()) | ||
| 372 | - && t1.getXlbm().equals(map.get("xlBm").toString() | ||
| 373 | - )) { | ||
| 374 | - if(t1.getLp()==null){ | ||
| 375 | - //同人同车同线路不同路牌的过滤 (考虑到历史数据) | ||
| 376 | - if (cMap.get(map.get("clZbh").toString()+map.get("jGh").toString()+map.get("xlBm").toString())==null) { | ||
| 377 | - t = t1; | ||
| 378 | - type = "update"; | ||
| 379 | - cMap.put(map.get("clZbh").toString()+map.get("jGh").toString()+map.get("xlBm").toString(), | ||
| 380 | - map.get("clZbh").toString()); | ||
| 381 | - } | ||
| 382 | - }else{ | ||
| 383 | - if(t1.getLp().equals(map.get("lpName").toString())){ | ||
| 384 | - t = t1; | ||
| 385 | - type = "update"; | ||
| 386 | - } | ||
| 387 | - | ||
| 388 | - } | ||
| 389 | - } | ||
| 390 | - } | ||
| 391 | - // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | ||
| 392 | - if (map.get("seqNumber").toString().equals("1")) { | ||
| 393 | - boolean fage = true; | ||
| 394 | - if(line.equals("")){ | ||
| 395 | - for (int i = 0; i < ylListBe.size(); i++) { | ||
| 396 | - Ylb ylb = ylListBe.get(i); | ||
| 397 | - if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | ||
| 398 | - if(ylb.getJzyl()>=0){ | ||
| 399 | - t.setCzyl(ylb.getJzyl()); | ||
| 400 | - fage = false; | ||
| 401 | - break; | ||
| 402 | - } | ||
| 403 | - | ||
| 404 | - } | ||
| 405 | - } | ||
| 406 | - if (fage) { | ||
| 407 | - for (int y = 0; y < clyList.size(); y++) { | ||
| 408 | - Cyl cyl = clyList.get(y); | ||
| 409 | - if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | ||
| 410 | - if(cyl!=null){ | ||
| 411 | - if(cyl.getCyl()>=0){ | ||
| 412 | - t.setCzyl(cyl.getCyl()); | ||
| 413 | - fage = false; | ||
| 414 | - break; | ||
| 415 | - }else { | ||
| 416 | - if(cyl.getCxrl()!=null){ | ||
| 417 | - if(cyl.getCxrl()>0){ | ||
| 418 | - t.setCzyl(cyl.getCxrl()); | ||
| 419 | - fage = false; | ||
| 420 | - break; | ||
| 421 | - } | ||
| 422 | - } | ||
| 423 | - } | ||
| 424 | - } | ||
| 425 | - } | ||
| 426 | - } | ||
| 427 | - } | ||
| 428 | - if (fage) { | ||
| 429 | - t.setCzyl(0.0); | ||
| 430 | - } | ||
| 431 | - }else{ | ||
| 432 | - if (line.equals(map.get("xlBm").toString())) { | ||
| 433 | - for (int i = 0; i < ylListBe.size(); i++) { | ||
| 434 | - Ylb ylb = ylListBe.get(i); | ||
| 435 | - if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | ||
| 436 | - if(ylb.getJzyl()>=0){ | ||
| 437 | - t.setCzyl(ylb.getJzyl()); | ||
| 438 | - fage = false; | ||
| 439 | - break; | ||
| 440 | - } | ||
| 441 | - | ||
| 442 | - } | ||
| 443 | - } | ||
| 444 | - if (fage) { | ||
| 445 | - for (int y = 0; y < clyList.size(); y++) { | ||
| 446 | - Cyl cyl = clyList.get(y); | ||
| 447 | - if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | ||
| 448 | - if(cyl!=null){ | ||
| 449 | - if(cyl.getCyl()>=0){ | ||
| 450 | - t.setCzyl(cyl.getCyl()); | ||
| 451 | - fage = false; | ||
| 452 | - break; | ||
| 453 | - }else { | ||
| 454 | - if(cyl.getCxrl()!=null){ | ||
| 455 | - if(cyl.getCxrl()>0){ | ||
| 456 | - t.setCzyl(cyl.getCxrl()); | ||
| 457 | - fage = false; | ||
| 458 | - break; | ||
| 459 | - } | ||
| 460 | - } | ||
| 461 | - } | ||
| 462 | - } | ||
| 463 | - } | ||
| 464 | - } | ||
| 465 | - } | ||
| 466 | - if (fage) { | ||
| 467 | - t.setCzyl(0.0); | ||
| 468 | - } | ||
| 469 | - } | ||
| 470 | - } | ||
| 471 | - | ||
| 472 | - } | ||
| 473 | - | ||
| 474 | - Double jzl = 0.0; | ||
| 475 | - //一人一车加注量只匹配一次 | ||
| 476 | - if(ylMap.get(map.get("clZbh").toString()+"_"+ map.get("jGh").toString())==null){ | ||
| 477 | - | ||
| 478 | - boolean fage2=false; | ||
| 479 | - for (int i = 0; i < ylxxList.size(); i++) { | ||
| 480 | - Ylxxb ylxxb = ylxxList.get(i); | ||
| 481 | - if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 482 | - && map.get("jGh").toString().equals(ylxxb.getJsy()) | ||
| 483 | - && ylxxb.getJylx()==1) { | ||
| 484 | - if(ylxxb.getJzl()>0){ | ||
| 485 | - fage2=true; | ||
| 486 | - } | ||
| 487 | - | ||
| 488 | - } | ||
| 489 | - } | ||
| 490 | - //车辆的加注量如果有任工干预,略接口过来 数据 | ||
| 491 | - if(fage2){ | ||
| 492 | - // 把当天手工输入的的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断,加油类型为1) | ||
| 493 | - for (int j = 0; j < ylxxList.size(); j++) { | ||
| 494 | - Ylxxb ylxxb = ylxxList.get(j); | ||
| 495 | - if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 496 | - && map.get("jGh").toString().equals(ylxxb.getJsy()) | ||
| 497 | - && ylxxb.getJylx()==1) { | ||
| 498 | - jzl =Arith.add(jzl, ylxxb.getJzl()); | ||
| 499 | - } | ||
| 500 | - } | ||
| 501 | - ylMap.put(map.get("clZbh").toString()+"_"+ map.get("jGh").toString(),map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | ||
| 502 | - }else{ | ||
| 503 | - // 把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | ||
| 504 | - for (int j = 0; j < ylxxList.size(); j++) { | ||
| 505 | - Ylxxb ylxxb = ylxxList.get(j); | ||
| 506 | - if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 507 | - && map.get("jGh").toString().equals(ylxxb.getJsy())) { | ||
| 508 | - jzl =Arith.add(jzl, ylxxb.getJzl()); | ||
| 509 | - } | ||
| 510 | - } | ||
| 511 | - ylMap.put(map.get("clZbh").toString()+"_"+ map.get("jGh").toString(),map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | ||
| 512 | - } | ||
| 513 | - | ||
| 514 | - } | ||
| 515 | - t.setJzl(jzl); | ||
| 516 | - t.setNbbm(map.get("clZbh").toString()); | ||
| 517 | - t.setJsy(map.get("jGh") == null ? "" : map.get("jGh").toString()); | ||
| 518 | - t.setZlc(map.get("totalKilometers") == null ? 0.0 | ||
| 519 | - : Double.parseDouble(map.get("totalKilometers").toString())); | ||
| 520 | - t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | ||
| 521 | - t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString()); | ||
| 522 | - t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | ||
| 523 | - t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); | ||
| 524 | - t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | ||
| 525 | - t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | ||
| 526 | - t.setRq(sdf.parse(rq)); | ||
| 527 | - t.setLp(map.get("lpName")==null?"":map.get("lpName").toString()); | ||
| 528 | - t.setJname(map.get("jName").toString()); | ||
| 529 | - if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 530 | - if(type.equals("add")){ | ||
| 531 | - t.setCreatetime(date); | ||
| 532 | - addList.add(t); | ||
| 533 | - }else{ | ||
| 534 | - t.setUpdatetime(date); | ||
| 535 | - updateList.add(t); | ||
| 536 | - } | ||
| 537 | - } | ||
| 538 | -// repository.save(t); | ||
| 539 | - newMap.put("status", ResponseCode.SUCCESS); | ||
| 540 | - | ||
| 541 | - } | ||
| 542 | - } | ||
| 543 | - if(addList.size()>0){ | ||
| 544 | - try { | ||
| 545 | - new BatchSaveUtils<Ylb>().saveList2(addList, Ylb.class); | ||
| 546 | - } catch (Exception e) { | ||
| 547 | - // TODO: handle exception | ||
| 548 | - if(e.getMessage().indexOf("PK_YLB_UK")>0){ | ||
| 549 | - newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 550 | - logger.info("获取:存在相同数据,数据已经过滤"); | ||
| 551 | - } | ||
| 552 | - } | ||
| 553 | - | ||
| 554 | - } | ||
| 555 | - if(updateList.size()>0){ | ||
| 556 | - for (int i = 0; i < updateList.size(); i++) { | ||
| 557 | - repository.save(updateList.get(i)); | ||
| 558 | - } | ||
| 559 | - } | ||
| 560 | - SysUser user = SecurityUtils.getCurrentUser(); | ||
| 561 | - Nylog nylog=new Nylog(); | ||
| 562 | - nylog.setCreatedate(new Date()); | ||
| 563 | - nylog.setCzmc("获取加存油"); | ||
| 564 | - nylog.setNylx("油"); | ||
| 565 | - nylog.setUserid(user.getUserName()); | ||
| 566 | - nylog.setUsername(user.getName()); | ||
| 567 | - nylog.setCxtj(rq+"-"+gsbm+"-"+fgsbm+"-"+line+"-"+nbbm+"-"+sxtj); | ||
| 568 | - nylogRepository.save(nylog); | ||
| 569 | - newMap.put("status", ResponseCode.SUCCESS); | ||
| 570 | - } catch (Exception e) { | ||
| 571 | - // TODO Auto-generated catch block | ||
| 572 | - newMap.put("status", ResponseCode.ERROR); | ||
| 573 | - throw e; | ||
| 574 | - } | ||
| 575 | - | ||
| 576 | - return newMap; | ||
| 577 | - } | ||
| 578 | - | ||
| 579 | - | ||
| 580 | - /** | ||
| 581 | - * 进场等于出场 | ||
| 582 | - */ | ||
| 583 | - @Transactional | ||
| 584 | - @Override | ||
| 585 | - public Map<String, Object> outAndIn(Map<String, Object> map) throws Exception{ | ||
| 586 | - // TODO Auto-generated method stub | ||
| 587 | - String xlbm=""; | ||
| 588 | - if(map.get("xlbm_like")!=null){ | ||
| 589 | - xlbm= map.get("xlbm_like").toString().trim(); | ||
| 590 | - } | ||
| 591 | - String gsbm=""; | ||
| 592 | - if(map.get("ssgsdm_like")!=null){ | ||
| 593 | - gsbm=map.get("ssgsdm_like").toString(); | ||
| 594 | - } | ||
| 595 | - String fgsbm=""; | ||
| 596 | - if(map.get("fgsdm_like")!=null){ | ||
| 597 | - fgsbm=map.get("fgsdm_like").toString(); | ||
| 598 | - } | ||
| 599 | - String rq = map.get("rq").toString(); | ||
| 600 | - String nbbm=""; | ||
| 601 | - if(map.get("nbbm_eq")!=null){ | ||
| 602 | - nbbm=map.get("nbbm_eq").toString(); | ||
| 603 | - } | ||
| 604 | - | ||
| 605 | - Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 606 | - Map<String, Object> map2=new HashMap<String,Object>(); | ||
| 607 | - try { | ||
| 608 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 609 | - | ||
| 610 | - map.put("rq_eq", sdf.parse(rq)); | ||
| 611 | -// List<Cyl> clyList = cylRepository.obtainCyl(); | ||
| 612 | - // 获取车辆存油信息 | ||
| 613 | - List<Cyl> cylList = cylRepository.obtainCyl(nbbm,gsbm); | ||
| 614 | - // 指定日期YLB信息 | ||
| 615 | - List<Ylb> ylbList =new ArrayList<Ylb>(); | ||
| 616 | - List<Ylb> ylbLists =new ArrayList<Ylb>(); | ||
| 617 | - List<Ylb> iterator2=new ArrayList<Ylb>(); | ||
| 618 | - ylbLists=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | ||
| 619 | - iterator2=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx"); | ||
| 620 | - // 从排班表中计算出行驶的总里程 | ||
| 621 | - | ||
| 622 | - String sxtj=map.get("sxtj").toString(); | ||
| 623 | - if(sxtj.equals("0")){ | ||
| 624 | - ylbList=ylbLists; | ||
| 625 | - }else{ | ||
| 626 | - List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 627 | - List<String> stringList=new ArrayList<String>(); | ||
| 628 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 629 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 630 | - int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 631 | - //一车一单 | ||
| 632 | - if(sxtj.equals("1")){ | ||
| 633 | - if(cs==1){ | ||
| 634 | - stringList.add(clbm); | ||
| 635 | - } | ||
| 636 | - } | ||
| 637 | - //一车多单 | ||
| 638 | - if(sxtj.equals("2")){ | ||
| 639 | - if(cs>1){ | ||
| 640 | - stringList.add(clbm); | ||
| 641 | - } | ||
| 642 | - } | ||
| 643 | - } | ||
| 644 | - | ||
| 645 | - for (int i = 0; i < stringList.size(); i++) { | ||
| 646 | - String strNbbm=stringList.get(i); | ||
| 647 | - for (int j = 0; j < ylbLists.size(); j++) { | ||
| 648 | - Ylb y = ylbLists.get(j); | ||
| 649 | - String mapNbbm=y.getNbbm(); | ||
| 650 | - if(strNbbm.equals(mapNbbm)){ | ||
| 651 | - ylbList.add(y); | ||
| 652 | - } | ||
| 653 | - } | ||
| 654 | - } | ||
| 655 | - } | ||
| 656 | - | ||
| 657 | - for (int i=0;i<ylbList.size();i++) { | ||
| 658 | - Ylb ylb = ylbList.get(i); | ||
| 659 | - // 判断是否已经计算过 | ||
| 660 | - if (newMap.get("nbbm" + ylb.getNbbm()) == null) { | ||
| 661 | - String nbbm_eq = ylb.getNbbm(); | ||
| 662 | - Date rq_eq = ylb.getRq(); | ||
| 663 | - // 得到一天总的加油和里程(根据车,时间) | ||
| 664 | - List<Object[]> sumList = repository.sumLcYl(nbbm_eq, rq_eq,"",gsbm,fgsbm); | ||
| 665 | - // 保存总的加油量 | ||
| 666 | - Double jzl = 0.0; | ||
| 667 | - // 保存总的里程 | ||
| 668 | - Double zlc = 0.0; | ||
| 669 | - //保存总的损耗 | ||
| 670 | - Double zsh = 0.0; | ||
| 671 | - for (int j = 0; j < sumList.size(); j++) { | ||
| 672 | - jzl = Arith.add(jzl, Double.valueOf(sumList.get(j)[0].toString())); | ||
| 673 | - zlc = Arith.add(zlc, Double.valueOf(sumList.get(j)[1].toString())); | ||
| 674 | - zsh = Arith.add(zsh, Double.valueOf(sumList.get(j)[2].toString())); | ||
| 675 | - } | ||
| 676 | -// jzl = Arith.sub(jzl, zsh); | ||
| 677 | - // 保留两位小数 | ||
| 678 | - DecimalFormat df = new DecimalFormat("#.00"); | ||
| 679 | - Double zyl = 0.0; | ||
| 680 | - Double nextJzyl = 0.0; | ||
| 681 | - // 保存已经计算过的车辆,相同车辆编号的车不在计算 | ||
| 682 | - newMap.put("nbbm" + ylb.getNbbm(), ylb.getNbbm()); | ||
| 683 | - | ||
| 684 | - // 查询指定车辆,设置进、存、耗油量 | ||
| 685 | - map.remove("nbbm_eq"); | ||
| 686 | - map.put("nbbm_eq", ylb.getNbbm()); | ||
| 687 | - map.put("xlbm_like", ylb.getXlbm()); | ||
| 688 | -// Iterator<Ylb> iterator2 = repository | ||
| 689 | -// .findAll(new CustomerSpecs<Ylb>(map), new Sort(Direction.ASC, "jcsx")).iterator(); | ||
| 690 | - double czyl=0.0; | ||
| 691 | - for (int j = 0; j < iterator2.size(); j++) { | ||
| 692 | - Ylb t = iterator2.get(j); | ||
| 693 | - if(t.getNbbm().equals(ylb.getNbbm())){ | ||
| 694 | - if (t.getJcsx() == 1) { | ||
| 695 | - // 进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量 | ||
| 696 | -// Double yl = t.getCzyl(); | ||
| 697 | -// Double jcyl = t.getCzyl(); | ||
| 698 | - czyl = t.getCzyl(); | ||
| 699 | - zyl =jzl; | ||
| 700 | - Double yh=0.0; | ||
| 701 | - if(zlc>0 ){ | ||
| 702 | - yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 703 | - } | ||
| 704 | - nextJzyl =Arith.sub( Arith.add(t.getJzl(), t.getCzyl()),yh); | ||
| 705 | -// nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()), t.getCzyl()),yh); | ||
| 706 | - //把进场油量的小数和整数分别取出 | ||
| 707 | -// int ylxs=(int) nextJzyl; 10.6--11 10.3--10 | ||
| 708 | - if(zlc>0 && t.getZlc()>0){ | ||
| 709 | - long l=Math.round(nextJzyl); | ||
| 710 | - double ylxs=l*100/100; | ||
| 711 | -// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | ||
| 712 | - yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 713 | - t.setYh(yh); | ||
| 714 | - t.setJzyl(ylxs); | ||
| 715 | - nextJzyl=ylxs; | ||
| 716 | - }else{ | ||
| 717 | - t.setYh(yh); | ||
| 718 | - t.setJzyl(nextJzyl); | ||
| 719 | - } | ||
| 720 | - } else { | ||
| 721 | - t.setCzyl(nextJzyl); | ||
| 722 | - Double yh=0.0; | ||
| 723 | - if(zlc>0){ | ||
| 724 | - yh= Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 725 | - } | ||
| 726 | - nextJzyl =Arith.sub( Arith.add(t.getJzl(),nextJzyl),yh); | ||
| 727 | -// nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()),nextJzyl),yh); | ||
| 728 | - if(zlc>0 && t.getZlc()>0){ | ||
| 729 | - long l=0l; | ||
| 730 | - double ylxs=0.0; | ||
| 731 | - if(j==iterator2.size()-1){ | ||
| 732 | - ylxs=czyl; | ||
| 733 | - }else{ | ||
| 734 | - if(iterator2.get(j+1).getNbbm().equals(t.getNbbm())){ | ||
| 735 | - l=Math.round(nextJzyl); | ||
| 736 | - ylxs=l*100/100; | ||
| 737 | - }else{ | ||
| 738 | - ylxs=czyl; | ||
| 739 | - } | ||
| 740 | - | ||
| 741 | - } | ||
| 742 | - yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 743 | -// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | ||
| 744 | - | ||
| 745 | - t.setYh(yh); | ||
| 746 | - t.setJzyl(ylxs); | ||
| 747 | - nextJzyl=ylxs; | ||
| 748 | - }else{ | ||
| 749 | - t.setYh(yh); | ||
| 750 | - t.setJzyl(nextJzyl); | ||
| 751 | - } | ||
| 752 | - } | ||
| 753 | - if(t.getJzyl()<0){ | ||
| 754 | - t.setJzyl(0.0); | ||
| 755 | - } | ||
| 756 | - if(t.getCzyl()<0){ | ||
| 757 | - t.setCzyl(0.0); | ||
| 758 | - } | ||
| 759 | - if(t.getYh()<0){ | ||
| 760 | - t.setYh(0.0); | ||
| 761 | - } | ||
| 762 | - if(t.getSh()<0){ | ||
| 763 | - t.setSh(0.0); | ||
| 764 | - } | ||
| 765 | - repository.save(t); | ||
| 766 | - } | ||
| 767 | - map2.put("status", ResponseCode.SUCCESS); | ||
| 768 | - } | ||
| 769 | - } | ||
| 770 | - } | ||
| 771 | - | ||
| 772 | - SysUser user = SecurityUtils.getCurrentUser(); | ||
| 773 | - Nylog nylog=new Nylog(); | ||
| 774 | - nylog.setCreatedate(new Date()); | ||
| 775 | - nylog.setCzmc("进场等于出场"); | ||
| 776 | - nylog.setNylx("油"); | ||
| 777 | - nylog.setUserid(user.getUserName()); | ||
| 778 | - nylog.setUsername(user.getName()); | ||
| 779 | - nylog.setCxtj(rq+"-"+gsbm+"-"+fgsbm+"-"+xlbm+"-"+nbbm+"-"+sxtj); | ||
| 780 | - | ||
| 781 | - nylogRepository.save(nylog); | ||
| 782 | - } catch (Exception e) { | ||
| 783 | - map2.put("status", ResponseCode.ERROR); | ||
| 784 | - logger.error("save erro.", e); | ||
| 785 | - throw e; | ||
| 786 | - } | ||
| 787 | - return map2; | ||
| 788 | - } | ||
| 789 | - | ||
| 790 | - | ||
| 791 | - /** | ||
| 792 | - * 核对,有加注没里程 | ||
| 793 | - * @param map | ||
| 794 | - * @return | ||
| 795 | - */ | ||
| 796 | - @Transactional | ||
| 797 | - @Override | ||
| 798 | - public Map<String, Object> checkYl(Map<String, Object> map) throws Exception{ | ||
| 799 | - Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 800 | -// String xlbm=""; | ||
| 801 | -// if(map.get("xlbm_like")!=null){ | ||
| 802 | -// xlbm=map.get("xlbm_like").toString(); | ||
| 803 | -// } | ||
| 804 | - // TODO Auto-generated method stub | ||
| 805 | - | ||
| 806 | - List<Cars> carsList = carsRepository.findCars(); | ||
| 807 | - Map<String, String> carsMap = new HashMap<String, String>(); | ||
| 808 | - for (int i = 0; i < carsList.size(); i++) { | ||
| 809 | - Cars c = carsList.get(i); | ||
| 810 | - carsMap.put(c.getInsideCode(), c.getBrancheCompanyCode()==null?"":c.getBrancheCompanyCode()); | ||
| 811 | - } | ||
| 812 | - | ||
| 813 | - try{ | ||
| 814 | - //获取车辆存油信息 | ||
| 815 | - | ||
| 816 | - String rq=map.get("rq").toString(); | ||
| 817 | - String xlbm=""; | ||
| 818 | - if(map.get("xlbm_like")!=null){ | ||
| 819 | - xlbm= map.get("xlbm_like").toString().trim(); | ||
| 820 | - } | ||
| 821 | - String gsbm=""; | ||
| 822 | - if(map.get("ssgsdm_like")!=null){ | ||
| 823 | - gsbm=map.get("ssgsdm_like").toString(); | ||
| 824 | - } | ||
| 825 | - String fgsbm=""; | ||
| 826 | - if(map.get("fgsdm_like")!=null){ | ||
| 827 | - fgsbm=map.get("fgsdm_like").toString(); | ||
| 828 | - } | ||
| 829 | - String nbbm=""; | ||
| 830 | - if(map.get("nbbm_eq")!=null){ | ||
| 831 | - nbbm=map.get("nbbm_eq").toString(); | ||
| 832 | - } | ||
| 833 | -// List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm); | ||
| 834 | - List<Ylb> ylListBe=this.listByRqJcsx(rq, gsbm, fgsbm, "", nbbm); | ||
| 835 | - List<Ylb> ylbList=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); | ||
| 836 | -// repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); | ||
| 837 | -// List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm); | ||
| 838 | - String sql="select * from bsth_c_ylxxb where yyrq='"+rq+"' " | ||
| 839 | - + " and gsdm ='"+gsbm+"' and nylx ='0' and nbbm " | ||
| 840 | - + " not in ( select nbbm from bsth_c_ylb " | ||
| 841 | - + " where rq='"+rq+"' " | ||
| 842 | - + " and ssgsdm='"+gsbm+"' and fgsdm ='"+fgsbm+"')" | ||
| 843 | - + " and nbbm in (select inside_code from " | ||
| 844 | - + " bsth_c_cars where business_code ='"+gsbm+"' " | ||
| 845 | - + " and branche_company_code='"+fgsbm+"')"; | ||
| 846 | - | ||
| 847 | - List<Ylxxb> ylxxbList=jdbcTemplate.query(sql, | ||
| 848 | - new RowMapper<Ylxxb>(){ | ||
| 849 | - @Override | ||
| 850 | - public Ylxxb mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 851 | - Ylxxb s = new Ylxxb(); | ||
| 852 | - s.setId(rs.getInt("id")); | ||
| 853 | - s.setYyrq(rs.getDate("yyrq")); | ||
| 854 | - s.setNbbm(rs.getString("nbbm")); | ||
| 855 | - s.setGsdm(rs.getString("gsdm")); | ||
| 856 | - s.setFgsdm(rs.getString("fgsdm")); | ||
| 857 | - s.setJsy(rs.getString("jsy")); | ||
| 858 | - s.setJzl(rs.getDouble("jzl")); | ||
| 859 | - s.setStationid(rs.getString("stationid")); | ||
| 860 | - s.setNylx(rs.getInt("nylx")); | ||
| 861 | - s.setJyggh(rs.getString("jyggh")); | ||
| 862 | - s.setYj(rs.getDouble("yj")); | ||
| 863 | -// s.setLdgh(rs.getString("ldgh")); | ||
| 864 | - s.setBz(rs.getString("bz")); | ||
| 865 | - return s; | ||
| 866 | - } | ||
| 867 | - }); | ||
| 868 | - Map<String, Object> m=new HashMap<String,Object>(); | ||
| 869 | - for (int i = 0; i < ylxxbList.size(); i++) { | ||
| 870 | - Boolean fage=false; | ||
| 871 | - Ylxxb y1=ylxxbList.get(i); | ||
| 872 | - if(m.get(y1.getNbbm())==null){ | ||
| 873 | - Line line=BasicData.nbbm2LineMap.get(y1.getNbbm()); | ||
| 874 | - if(null !=line){ | ||
| 875 | - if(!xlbm.equals("")){ | ||
| 876 | - if(line.getLineCode().equals(xlbm)){ | ||
| 877 | - fage=true; | ||
| 878 | - } | ||
| 879 | - }else{ | ||
| 880 | - fage=true; | ||
| 881 | - } | ||
| 882 | - } | ||
| 883 | - | ||
| 884 | - if(fage){ | ||
| 885 | - Ylb t=new Ylb(); | ||
| 886 | - t.setNbbm(y1.getNbbm()); | ||
| 887 | - t.setRq(y1.getYyrq()); | ||
| 888 | - t.setJsy(y1.getJsy()); | ||
| 889 | - t.setJname(BasicData.allPerson.get(y1.getGsdm()+"-"+y1.getJsy())); | ||
| 890 | - t.setJzl(y1.getJzl()); | ||
| 891 | - t.setSsgsdm(y1.getGsdm()); | ||
| 892 | - String fgsdm=""; | ||
| 893 | - if(null !=carsMap.get(y1.getNbbm())){ | ||
| 894 | - fgsdm=carsMap.get(y1.getNbbm()); | ||
| 895 | - } | ||
| 896 | - t.setFgsdm(fgsdm); | ||
| 897 | - t.setJcsx(1); | ||
| 898 | - if(null !=line){ | ||
| 899 | - t.setXlbm(line.getLineCode()); | ||
| 900 | - }else{ | ||
| 901 | - t.setXlbm(""); | ||
| 902 | - } | ||
| 903 | - t.setJcsx(1); | ||
| 904 | - boolean status=true; | ||
| 905 | - for (int j = 0; j < ylListBe.size(); j++) { | ||
| 906 | - Ylb b=ylListBe.get(j); | ||
| 907 | - if(b.getNbbm().equals(y1.getNbbm())){ | ||
| 908 | - t.setCzyl(b.getJzyl()); | ||
| 909 | - status=false; | ||
| 910 | - break; | ||
| 911 | - } | ||
| 912 | - } | ||
| 913 | - if(status){ | ||
| 914 | - t.setCzyl(0.0); | ||
| 915 | - } | ||
| 916 | - t.setJzyl(Arith.add(t.getJzl(), t.getCzyl())); | ||
| 917 | - t.setYh(0.0); | ||
| 918 | - if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 919 | - t.setCreatetime(new Date()); | ||
| 920 | - try { | ||
| 921 | - repository.save(t); | ||
| 922 | - m.put(t.getName(), t.getName()); | ||
| 923 | - } catch (Exception e) { | ||
| 924 | - // TODO: handle exception | ||
| 925 | - if(e.getMessage().indexOf("PK_YLB_UK")>0){ | ||
| 926 | - newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 927 | - logger.info("核对有存油没里程:存在相同数据,数据已经过滤"); | ||
| 928 | - } | ||
| 929 | - } | ||
| 930 | - } | ||
| 931 | - } | ||
| 932 | - } | ||
| 933 | - } | ||
| 934 | - | ||
| 935 | - SysUser user = SecurityUtils.getCurrentUser(); | ||
| 936 | - Nylog nylog=new Nylog(); | ||
| 937 | - nylog.setCreatedate(new Date()); | ||
| 938 | - nylog.setCzmc("核对加注量"); | ||
| 939 | - nylog.setNylx("油"); | ||
| 940 | - nylog.setUserid(user.getUserName()); | ||
| 941 | - nylog.setUsername(user.getName()); | ||
| 942 | - nylog.setCxtj(rq+"-"+gsbm+"-"+fgsbm+"-"+xlbm+"-"+nbbm+"-"); | ||
| 943 | - nylogRepository.save(nylog); | ||
| 944 | - newMap.put("status", ResponseCode.SUCCESS); | ||
| 945 | - }catch(Exception e){ | ||
| 946 | - newMap.put("status", ResponseCode.ERROR); | ||
| 947 | - logger.error("save erro.", e); | ||
| 948 | - throw e; | ||
| 949 | - } | ||
| 950 | - | ||
| 951 | - return newMap; | ||
| 952 | - } | ||
| 953 | - | ||
| 954 | - | ||
| 955 | - @Override | ||
| 956 | - public List<Map<String, Object>> oilListMonth(Map<String, Object> map) { | ||
| 957 | - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 958 | - sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 959 | - | ||
| 960 | - String type=map.get("type").toString(); | ||
| 961 | - String date=map.get("date").toString().trim(); | ||
| 962 | - String gsdm=map.get("gsdm").toString(); | ||
| 963 | - String fgsdm=map.get("fgsdm").toString(); | ||
| 964 | - String date2=date.substring(0, 8)+"01"; | ||
| 965 | - String lineStr=""; | ||
| 966 | - String line =map.get("line").toString().trim(); | ||
| 967 | - /*if(line !=null && !line.equals("")){ | ||
| 968 | - lineStr =" and xlbm= '"+ line +"'"; | ||
| 969 | - }else{ | ||
| 970 | - lineStr =" and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"' "; | ||
| 971 | - } | ||
| 972 | - String sql="select a.nbbm,a.rq,a.jzyl from (" + | ||
| 973 | - " select x.nbbm,max(x.rq) as rq,max(x.jcsx) as jcsx from " | ||
| 974 | - + "(select nbbm,rq,max(jcsx) as jcsx from bsth_c_ylb where rq between '" | ||
| 975 | - + date2 +"' and '" + date+"' "+lineStr | ||
| 976 | - + " group by nbbm,rq) x group by x.nbbm ) b" | ||
| 977 | - + " left join (select nbbm,rq,jzyl,jcsx FROM bsth_c_ylb " | ||
| 978 | - + " where rq between '" | ||
| 979 | - + date2 +"' and '" + date+"' "+lineStr | ||
| 980 | - + ") a " | ||
| 981 | - + " on a.nbbm =b.nbbm and a.jcsx=b.jcsx and a.rq=b.rq " | ||
| 982 | - + " where a.nbbm is not null order by a.nbbm"; | ||
| 983 | - | ||
| 984 | - // TODO Auto-generated method stub | ||
| 985 | - List<Ylb> list =jdbcTemplate.query(sql, | ||
| 986 | - new RowMapper<Ylb>(){ | ||
| 987 | - @Override | ||
| 988 | - public Ylb mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 989 | - Ylb s = new Ylb(); | ||
| 990 | - s.setNbbm(rs.getString("nbbm")); | ||
| 991 | - s.setRq(rs.getDate("rq")); | ||
| 992 | - s.setJzyl(rs.getDouble("jzyl")); | ||
| 993 | - return s; | ||
| 994 | - } | ||
| 995 | - }); */ | ||
| 996 | - | ||
| 997 | - double qtyy=0.0;//其他用油 | ||
| 998 | - double cdyy=0.0;//车队用油 | ||
| 999 | - double byyy=0.0;//保养用油 | ||
| 1000 | - double cjxx=0.0;//车间小修 | ||
| 1001 | - double cjgb=0.0;//车间高保 | ||
| 1002 | - double fyyyhj=0.0;//非营运用油合计 | ||
| 1003 | - List<Ylb> listYlb=repository.listByMonthJcsx(date2, date, gsdm, fgsdm, line); | ||
| 1004 | - | ||
| 1005 | - Map<String, Object> ms=new HashMap<String,Object>(); | ||
| 1006 | - List<Ylb> list=new ArrayList<Ylb>(); | ||
| 1007 | - for (int i = 0; i < listYlb.size(); i++) { | ||
| 1008 | - Ylb t=listYlb.get(i); | ||
| 1009 | - fyyyhj =Arith.add(fyyyhj, t.getSh()); | ||
| 1010 | - if(t.getShyy()==null){ | ||
| 1011 | - qtyy=Arith.add(qtyy, t.getSh()); | ||
| 1012 | - }else{ | ||
| 1013 | - if(t.getShyy().equals("6")){ | ||
| 1014 | - cdyy=Arith.add(cdyy, t.getSh()); | ||
| 1015 | - }else if(t.getShyy().equals("2")){ | ||
| 1016 | - byyy=Arith.add(byyy, t.getSh()); | ||
| 1017 | - }else if(t.getShyy().equals("7")){ | ||
| 1018 | - cjxx=Arith.add(cjxx, t.getSh()); | ||
| 1019 | - }else if(t.getShyy().equals("8")){ | ||
| 1020 | - cjgb=Arith.add(cjgb, t.getSh()); | ||
| 1021 | - }else{ | ||
| 1022 | - qtyy=Arith.add(qtyy, t.getSh()); | ||
| 1023 | - } | ||
| 1024 | - } | ||
| 1025 | - if(ms.get(t.getNbbm())==null){ | ||
| 1026 | - ms.put(t.getNbbm(), t.getNbbm()); | ||
| 1027 | - list.add(t); | ||
| 1028 | - } | ||
| 1029 | - } | ||
| 1030 | - | ||
| 1031 | - List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); | ||
| 1032 | - int size = 0; | ||
| 1033 | - Map<String, Object> m_ = new HashMap<String, Object>(); | ||
| 1034 | - double ycyhj=0.0; | ||
| 1035 | - for(Ylb ylb : list){ | ||
| 1036 | - ycyhj=Arith.add(ycyhj, ylb.getJzyl()); | ||
| 1037 | - int x=size%3; | ||
| 1038 | - if(x==0 && size>0){ | ||
| 1039 | - mapList.add(m_); | ||
| 1040 | - m_ = new HashMap<String, Object>(); | ||
| 1041 | - } | ||
| 1042 | - size++; | ||
| 1043 | - m_.put("xh"+x, size); | ||
| 1044 | - m_.put("nbbm"+x, ylb.getNbbm()!=null?ylb.getNbbm():""); | ||
| 1045 | - m_.put("rq"+x, ylb.getRq()!=null?sdfMonth.format(ylb.getRq()):""); | ||
| 1046 | - m_.put("jzyl"+x, ylb.getJzyl()!=null?ylb.getJzyl():""); | ||
| 1047 | - | ||
| 1048 | - } | ||
| 1049 | - if(m_.get("nbbm0")!=null){ | ||
| 1050 | - if(m_.get("nbbm1")==null){ | ||
| 1051 | - m_.put("xh1", ""); | ||
| 1052 | - m_.put("nbbm1" , ""); | ||
| 1053 | - m_.put("rq1" , ""); | ||
| 1054 | - m_.put("jzyl1" , ""); | ||
| 1055 | - } | ||
| 1056 | - if(m_.get("nbbm2")==null){ | ||
| 1057 | - m_.put("xh2", ""); | ||
| 1058 | - m_.put("nbbm2" , ""); | ||
| 1059 | - m_.put("rq2" , ""); | ||
| 1060 | - m_.put("jzyl2" , ""); | ||
| 1061 | - } | ||
| 1062 | - mapList.add(m_); | ||
| 1063 | - } | ||
| 1064 | - | ||
| 1065 | - if(type != null && type.equals("export")){ | ||
| 1066 | - List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 1067 | - Map<String, Object> m = new HashMap<String, Object>(); | ||
| 1068 | - m.put("ycyhj", ycyhj); | ||
| 1069 | - m.put("qtyy", qtyy); | ||
| 1070 | - m.put("cdyy", cdyy); | ||
| 1071 | - m.put("byyy", byyy); | ||
| 1072 | - m.put("cjxx", cjxx); | ||
| 1073 | - m.put("cjgb", cjgb); | ||
| 1074 | - m.put("fyyyhj", fyyyhj); | ||
| 1075 | - ReportUtils ee = new ReportUtils(); | ||
| 1076 | - try { | ||
| 1077 | - String lineName = ""; | ||
| 1078 | - if(map.containsKey("lineName")) | ||
| 1079 | - lineName = map.get("lineName").toString(); | ||
| 1080 | - listI.add(mapList.iterator()); | ||
| 1081 | - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | ||
| 1082 | - ee.excelReplace(listI, new Object[] { m }, path+"mould/oilListMonth.xls", | ||
| 1083 | - path+"export/" + sdfSimple.format(sdfMonth.parse(date)) | ||
| 1084 | - + "-" + lineName + "-月存油报表.xls"); | ||
| 1085 | - } catch (Exception e) { | ||
| 1086 | - // TODO: handle exception | ||
| 1087 | - e.printStackTrace(); | ||
| 1088 | - } | ||
| 1089 | - }else{ | ||
| 1090 | - m_=new HashMap<String,Object>(); | ||
| 1091 | - m_.put("xh0", "99"); | ||
| 1092 | - m_.put("nbbm0", "存油合计:"+ycyhj +" 非营运用油: 其他用油:"+qtyy +",车队:"+cdyy+",保养用油:"+byyy | ||
| 1093 | - +",车间(小修):"+cjxx+",车间(高保):"+cjgb+",非营运用油合计:"+fyyyhj); | ||
| 1094 | - mapList.add(m_); | ||
| 1095 | - } | ||
| 1096 | - | ||
| 1097 | - return mapList; | ||
| 1098 | - } | ||
| 1099 | - | ||
| 1100 | - @Override | ||
| 1101 | - public StringBuffer checkNbmmNum(String rq, String gsbm, String fgsbm, String xlbm,String nbbm,int lx) { | ||
| 1102 | - StringBuffer stringList =new StringBuffer(); | ||
| 1103 | - List<Object[]> objectList=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 1104 | - for (int i = 0; i < objectList.size(); i++) { | ||
| 1105 | - String clbm=objectList.get(i)[0].toString()+","; | ||
| 1106 | - int cs=Integer.parseInt(objectList.get(i)[1].toString()); | ||
| 1107 | - //一车一单 | ||
| 1108 | - if(lx==1){ | ||
| 1109 | - if(cs==1){ | ||
| 1110 | - stringList.append(clbm); | ||
| 1111 | - } | ||
| 1112 | - } | ||
| 1113 | - //一车多单 | ||
| 1114 | - if(lx==2){ | ||
| 1115 | - if(cs>1){ | ||
| 1116 | - stringList.append(clbm); | ||
| 1117 | - } | ||
| 1118 | - | ||
| 1119 | - } | ||
| 1120 | - } | ||
| 1121 | - return stringList; | ||
| 1122 | - } | ||
| 1123 | - | ||
| 1124 | - | ||
| 1125 | - | ||
| 1126 | - @Override | ||
| 1127 | - public Map<String, Object> sumYlb(Map<String, Object> map) { | ||
| 1128 | - // TODO Auto-generated method stub | ||
| 1129 | - List<String> stringList=new ArrayList<String>(); | ||
| 1130 | - String rq=map.get("rq").toString(); | ||
| 1131 | - String gsbm=map.get("ssgsdm_like").toString(); | ||
| 1132 | - String fgsbm=map.get("fgsdm_like").toString(); | ||
| 1133 | - String xlbm=map.get("xlbm_like").toString().trim(); | ||
| 1134 | - String nbbm=map.get("nbbm_eq").toString(); | ||
| 1135 | - String sxtj=map.get("sxtj").toString(); | ||
| 1136 | - String type=map.get("type").toString(); | ||
| 1137 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 1138 | - List<Object[]> sumYlbList=new ArrayList<Object[]>(); | ||
| 1139 | - try { | ||
| 1140 | - if(nbbm.trim()!=""){ | ||
| 1141 | - stringList.add(nbbm); | ||
| 1142 | - }else{ | ||
| 1143 | - if(!sxtj.equals("0")){ | ||
| 1144 | - List<Object[]> objectLists; | ||
| 1145 | - if(sxtj.equals("3")){ | ||
| 1146 | - //有加油没里程 | ||
| 1147 | - objectLists=repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1148 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1149 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 1150 | - double jzl=Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1151 | - double zlc=Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1152 | - if(jzl>0 && zlc<=0){ | ||
| 1153 | - stringList.add(clbm); | ||
| 1154 | - } | ||
| 1155 | - | ||
| 1156 | - } | ||
| 1157 | - | ||
| 1158 | - }else if(sxtj.equals("4")){ | ||
| 1159 | - //有里程没加油 | ||
| 1160 | - objectLists=repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1161 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1162 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 1163 | - double jzl=Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1164 | - double zlc=Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1165 | - if(zlc>0 && jzl<=0){ | ||
| 1166 | - stringList.add(clbm); | ||
| 1167 | - } | ||
| 1168 | - | ||
| 1169 | - } | ||
| 1170 | - }else{ | ||
| 1171 | - objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 1172 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1173 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 1174 | - int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 1175 | - //一车一单 | ||
| 1176 | - | ||
| 1177 | - if(sxtj.equals("1")){ | ||
| 1178 | - if(cs==1){ | ||
| 1179 | - stringList.add(clbm); | ||
| 1180 | - } | ||
| 1181 | - } | ||
| 1182 | - //一车多单 | ||
| 1183 | - if(sxtj.equals("2")){ | ||
| 1184 | - if(cs>1){ | ||
| 1185 | - stringList.add(clbm); | ||
| 1186 | - } | ||
| 1187 | - } | ||
| 1188 | - } | ||
| 1189 | - } | ||
| 1190 | - } | ||
| 1191 | - } | ||
| 1192 | - if(sxtj.equals("0")){ | ||
| 1193 | - sumYlbList=repository.sumYlb2(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 1194 | - }else{ | ||
| 1195 | - if(stringList.size()>0){ | ||
| 1196 | - | ||
| 1197 | -// String strings[]=new String[stringList.size()]; | ||
| 1198 | -// for(int i=0;i<stringList.size();i++){ | ||
| 1199 | -// strings[i]=stringList.get(i); | ||
| 1200 | -// } | ||
| 1201 | - if (type.equals("1")) | ||
| 1202 | - sumYlbList=repository.sumYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1203 | - else | ||
| 1204 | - sumYlbList=repository.sumYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1205 | - } | ||
| 1206 | -// else{ | ||
| 1207 | -// sumYlbList=repository.sumYlb2(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1208 | -// } | ||
| 1209 | - | ||
| 1210 | - } | ||
| 1211 | - } catch (ParseException e) { | ||
| 1212 | - // TODO Auto-generated catch block | ||
| 1213 | - e.printStackTrace(); | ||
| 1214 | - } | ||
| 1215 | - Double jzl=0.0,yh=0.0,sh=0.0; | ||
| 1216 | - for (int i = 0; i < sumYlbList.size(); i++) { | ||
| 1217 | - jzl = Arith.add(jzl, Double.valueOf(sumYlbList.get(i)[0].toString())); | ||
| 1218 | - yh = Arith.add(yh, Double.valueOf(sumYlbList.get(i)[1].toString())); | ||
| 1219 | - sh = Arith.add(sh, Double.valueOf(sumYlbList.get(i)[2].toString())); | ||
| 1220 | - } | ||
| 1221 | - | ||
| 1222 | - Map<String, Object> sumMap=new HashMap<String,Object>(); | ||
| 1223 | - sumMap.put("jzl", jzl); | ||
| 1224 | - sumMap.put("yh", yh); | ||
| 1225 | - sumMap.put("sh", sh); | ||
| 1226 | - | ||
| 1227 | -// String sql="select sum(jzl),sum(yh),sum(sh) from bsth_c_ylb " | ||
| 1228 | -// + " where to_days('"+map.get("rq").toString()+"')=to_days(rq) " | ||
| 1229 | -// + " and ssgsdm like '%"+map.get("ssgsdm_like").toString()+"%' " | ||
| 1230 | -// + " and fgsdm like '%"+map.get("fgsdm_like").toString()+"%' " | ||
| 1231 | -// + " and xlbm like '%"+map.get("xlbm_like").toString()+ "%'" | ||
| 1232 | -// + " and nbbm like '%"+map.get("nbbm_eq").toString()+"% '"; | ||
| 1233 | -// if(map.get("nbbm_in")!=null){ | ||
| 1234 | -//// sql +=" and nbbm in (" | ||
| 1235 | -// } | ||
| 1236 | - return sumMap; | ||
| 1237 | - } | ||
| 1238 | - | ||
| 1239 | - | ||
| 1240 | - | ||
| 1241 | - @Override | ||
| 1242 | - public List<Ylb> listYlb(Map<String, Object> map) { | ||
| 1243 | - // TODO Auto-generated method stub | ||
| 1244 | - List<Ylb> listYlb = new ArrayList<Ylb>(); | ||
| 1245 | - try { | ||
| 1246 | - List<String> stringList = new ArrayList<String>(); | ||
| 1247 | - String rq = map.get("rq").toString(); | ||
| 1248 | - String gsbm = map.get("ssgsdm_like").toString(); | ||
| 1249 | - String fgsbm = map.get("fgsdm_like").toString(); | ||
| 1250 | - String xlbm = map.get("xlbm_like").toString().trim(); | ||
| 1251 | - String nbbm = map.get("nbbm_eq").toString(); | ||
| 1252 | - String sxtj = map.get("sxtj").toString(); | ||
| 1253 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 1254 | - String type = map.get("type").toString(); | ||
| 1255 | - if (nbbm.trim() != "") { | ||
| 1256 | - stringList.add(nbbm); | ||
| 1257 | - List<Object[]> objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1258 | - if (objectLists.size() > 0) { | ||
| 1259 | - int cs = Integer.parseInt(objectLists.get(0)[1].toString()); | ||
| 1260 | - if (sxtj.equals("1")) { | ||
| 1261 | - if (cs == 1) { | ||
| 1262 | - if (type.equals("1")) | ||
| 1263 | - listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1264 | - else | ||
| 1265 | - listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1266 | - | ||
| 1267 | - } | ||
| 1268 | - } else if (sxtj.equals("2")) { | ||
| 1269 | - if (cs > 1) { | ||
| 1270 | - if (type.equals("1")) | ||
| 1271 | - listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1272 | - else | ||
| 1273 | - listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1274 | - } | ||
| 1275 | - } else { | ||
| 1276 | - if (type.equals("1")) | ||
| 1277 | - listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1278 | - else | ||
| 1279 | - listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1280 | - } | ||
| 1281 | - } | ||
| 1282 | - | ||
| 1283 | - } else { | ||
| 1284 | - // 全部 | ||
| 1285 | - if (sxtj.equals("0")) { | ||
| 1286 | - List<Object[]> objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1287 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1288 | - String clbm = objectLists.get(i)[0].toString(); | ||
| 1289 | - stringList.add(clbm); | ||
| 1290 | - } | ||
| 1291 | - if (stringList.size() > 0) { | ||
| 1292 | - if (type.equals("1")) | ||
| 1293 | - listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1294 | - else | ||
| 1295 | - listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1296 | - } | ||
| 1297 | - }else if(sxtj.equals("5")){ | ||
| 1298 | - List<Object[]> objectLists = repository.checkNbmmFgs(rq, gsbm); | ||
| 1299 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1300 | - String clbm =objectLists.get(i)[0].toString(); | ||
| 1301 | - stringList.add(clbm); | ||
| 1302 | - } | ||
| 1303 | - | ||
| 1304 | - if (stringList.size() > 0) { | ||
| 1305 | - if (type.equals("1")) | ||
| 1306 | - listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1307 | - else | ||
| 1308 | - listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1309 | - } | ||
| 1310 | - } else { | ||
| 1311 | - List<Object[]> objectLists; | ||
| 1312 | - if (sxtj.equals("3")) { | ||
| 1313 | - // 有加油没里程 | ||
| 1314 | - objectLists = repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1315 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1316 | - String clbm = objectLists.get(i)[0].toString(); | ||
| 1317 | - double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1318 | - double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1319 | - if (jzl > 0 && zlc <= 0) { | ||
| 1320 | - stringList.add(clbm); | ||
| 1321 | - } | ||
| 1322 | - | ||
| 1323 | - } | ||
| 1324 | - | ||
| 1325 | - } else if (sxtj.equals("4")) { | ||
| 1326 | - // 有里程没加油 | ||
| 1327 | - objectLists = repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1328 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1329 | - String clbm = objectLists.get(i)[0].toString(); | ||
| 1330 | - double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1331 | - double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1332 | - if (zlc > 0 && jzl <= 0) { | ||
| 1333 | - stringList.add(clbm); | ||
| 1334 | - } | ||
| 1335 | - | ||
| 1336 | - } | ||
| 1337 | - } else { | ||
| 1338 | - objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1339 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1340 | - String clbm = objectLists.get(i)[0].toString(); | ||
| 1341 | - int cs = Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 1342 | - // 一车一单 | ||
| 1343 | - if (sxtj.equals("1")) { | ||
| 1344 | - if (cs == 1) { | ||
| 1345 | - stringList.add(clbm); | ||
| 1346 | - } | ||
| 1347 | - } | ||
| 1348 | - // 一车多单 | ||
| 1349 | - if (sxtj.equals("2")) { | ||
| 1350 | - if (cs > 1) { | ||
| 1351 | - stringList.add(clbm); | ||
| 1352 | - } | ||
| 1353 | - } | ||
| 1354 | - } | ||
| 1355 | - } | ||
| 1356 | - | ||
| 1357 | - if (stringList.size() > 0) { | ||
| 1358 | - if (type.equals("1")) | ||
| 1359 | - listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1360 | - else | ||
| 1361 | - listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1362 | - } | ||
| 1363 | - } | ||
| 1364 | - } | ||
| 1365 | - } catch (ParseException e) { | ||
| 1366 | - // TODO Auto-generated catch block | ||
| 1367 | - e.printStackTrace(); | ||
| 1368 | - } | ||
| 1369 | - return listYlb; | ||
| 1370 | - } | ||
| 1371 | - | ||
| 1372 | - @Transactional | ||
| 1373 | - @Override | ||
| 1374 | - public Map<String, Object> saveYlbList(Map<String, Object> map) throws Exception { | ||
| 1375 | - // TODO Auto-generated method stub | ||
| 1376 | - Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 1377 | - try{ | ||
| 1378 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1379 | - String json =StringEscapeUtils.unescapeHtml4(map.get("ylbList").toString()); | ||
| 1380 | - JSONArray jsonArray=JSONArray.parseArray(json); | ||
| 1381 | - JSONObject jsonObject; | ||
| 1382 | - // 获取车辆存油信息 | ||
| 1383 | - List<Cyl> cylList = cylRepository.obtainCyl("",""); | ||
| 1384 | - for (int i = 0; i < jsonArray.size(); i++) { | ||
| 1385 | -// Ylb t=new Ylb(); | ||
| 1386 | - jsonObject=jsonArray.getJSONObject(i); | ||
| 1387 | - double czyl = jsonObject.getDoubleValue("czyl"); | ||
| 1388 | - double jzl =jsonObject.getDoubleValue("jzl"); | ||
| 1389 | - double jzyl =jsonObject.getDoubleValue("jzyl"); | ||
| 1390 | - double sh =jsonObject.getDoubleValue("sh"); | ||
| 1391 | - String shyy =jsonObject.getString("shyy"); | ||
| 1392 | - double ns = jsonObject.getDoubleValue("ns"); | ||
| 1393 | - String rylx =jsonObject.getString("rylx"); | ||
| 1394 | - int yhlx =jsonObject.getIntValue("yhlx"); | ||
| 1395 | - Integer id =jsonObject.getInteger("id"); | ||
| 1396 | - String nbbm =jsonObject.getString("nbbm"); | ||
| 1397 | - String rq=jsonObject.getString("rq"); | ||
| 1398 | - double yh = Arith.sub(Arith.add(czyl, jzl),jzyl); | ||
| 1399 | - if(yh<0){ | ||
| 1400 | - yh=0.0; | ||
| 1401 | - } | ||
| 1402 | - repository.ylbUpdate(id, czyl, jzyl, yh, sh, shyy, ns, rylx,yhlx); | ||
| 1403 | - } | ||
| 1404 | -// List<Map<String, Object>> list=(List<Map<String, Object>>) map.get("ylbList"); | ||
| 1405 | - SysUser user = SecurityUtils.getCurrentUser(); | ||
| 1406 | - Nylog nylog=new Nylog(); | ||
| 1407 | - nylog.setCreatedate(new Date()); | ||
| 1408 | - nylog.setCzmc("保存全部"); | ||
| 1409 | - nylog.setNylx("油"); | ||
| 1410 | - nylog.setUserid(user.getUserName()); | ||
| 1411 | - nylog.setUsername(user.getName()); | ||
| 1412 | - nylog.setCxtj(""); | ||
| 1413 | - nylogRepository.save(nylog); | ||
| 1414 | - newMap.put("status", ResponseCode.SUCCESS); | ||
| 1415 | - }catch(Exception e){ | ||
| 1416 | - newMap.put("status", ResponseCode.ERROR); | ||
| 1417 | - logger.error("save erro.", e); | ||
| 1418 | - throw e; | ||
| 1419 | - } | ||
| 1420 | - return newMap; | ||
| 1421 | - } | ||
| 1422 | - | ||
| 1423 | - /** | ||
| 1424 | - * 拆分 | ||
| 1425 | - */ | ||
| 1426 | - @Transactional | ||
| 1427 | - @Override | ||
| 1428 | - public Map<String, Object> sort(Map<String, Object> map) throws Exception{ | ||
| 1429 | - // TODO Auto-generated method stub | ||
| 1430 | - Map<String, Object> newMap = new HashMap<String, Object>(); | ||
| 1431 | - SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1432 | - | ||
| 1433 | - try { | ||
| 1434 | - List<Cyl> cylList = cylRepository.findAll(new CustomerSpecs<Cyl>(newMap)); | ||
| 1435 | - String json =StringEscapeUtils.unescapeHtml4(map.get("ylbList").toString()); | ||
| 1436 | - String fgsbm="999"; | ||
| 1437 | - if(map.get("fgsbm")!=null){ | ||
| 1438 | - fgsbm=map.get("fgsbm").toString(); | ||
| 1439 | - } | ||
| 1440 | - JSONArray jsonArray=JSONArray.parseArray(json); | ||
| 1441 | - JSONObject jsonObject; | ||
| 1442 | - for (int x = 0; x < jsonArray.size(); x++) { | ||
| 1443 | - jsonObject=jsonArray.getJSONObject(x); | ||
| 1444 | - Double yl =jsonObject.getDoubleValue("jzyl"); | ||
| 1445 | - Double sh =jsonObject.getDoubleValue("sh"); | ||
| 1446 | - String shyy =jsonObject.getString("shyy"); | ||
| 1447 | - Double ns = jsonObject.getDoubleValue("ns"); | ||
| 1448 | - String rylx =jsonObject.getString("rylx"); | ||
| 1449 | - Integer id =jsonObject.getInteger("id"); | ||
| 1450 | - Ylb ylb = repository.findById(id).get(); | ||
| 1451 | - String nbbm_eq = ylb.getNbbm(); | ||
| 1452 | - Date rq_eq = ylb.getRq(); | ||
| 1453 | - // 得到一天总的加油和里程(根据车,时间) | ||
| 1454 | - List<Object[]> sumList=new ArrayList<Object[]>(); | ||
| 1455 | - if(fgsbm.equals("")) | ||
| 1456 | - sumList = repository.sumLcYl(nbbm_eq, rq_eq,"",ylb.getSsgsdm(),fgsbm); | ||
| 1457 | - else | ||
| 1458 | - sumList = repository.sumLcYl(nbbm_eq, rq_eq,"",ylb.getSsgsdm(),ylb.getFgsdm()); | ||
| 1459 | - | ||
| 1460 | - // 保存总的加油量 | ||
| 1461 | - Double jzl = 0.0; | ||
| 1462 | - // 保存总的里程 | ||
| 1463 | - Double zlc = 0.0; | ||
| 1464 | - //保存总的损耗 | ||
| 1465 | - Double zsh = 0.0; | ||
| 1466 | - for (int j = 0; j < sumList.size(); j++) { | ||
| 1467 | - jzl = Arith.add(jzl, Double.valueOf(sumList.get(j)[0].toString())); | ||
| 1468 | - zlc = Arith.add(zlc, Double.valueOf(sumList.get(j)[1].toString())); | ||
| 1469 | - zsh = Arith.add(zsh, Double.valueOf(sumList.get(j)[2].toString())); | ||
| 1470 | - } | ||
| 1471 | -// jzl = Arith.sub(jzl, zsh); | ||
| 1472 | - //新的 损耗不等于 旧的损耗 总损耗从新算 | ||
| 1473 | - /*if(Arith.sub(ylb.getSh(),sh )!=0){ | ||
| 1474 | - zsh =Arith.add(Arith.sub(zsh, ylb.getSh()), sh); | ||
| 1475 | - jzl =Arith.sub(jzl, zsh); | ||
| 1476 | - }else{ | ||
| 1477 | - jzl =Arith.sub(jzl, zsh); | ||
| 1478 | - }*/ | ||
| 1479 | - map.put("nbbm_eq", nbbm_eq); | ||
| 1480 | - map.put("rq_eq", rq_eq); | ||
| 1481 | - List<Ylb> iterator2=null; | ||
| 1482 | - if(fgsbm.equals("")) | ||
| 1483 | - iterator2=this.listOrderBy(sdf.format(rq_eq),ylb.getSsgsdm(),fgsbm,"", | ||
| 1484 | - ylb.getNbbm(),"jcsx"); | ||
| 1485 | - else | ||
| 1486 | - iterator2=this.listOrderBy(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"", | ||
| 1487 | - ylb.getNbbm(),"jcsx"); | ||
| 1488 | - | ||
| 1489 | -// repository.obtainYl(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"", | ||
| 1490 | -// ylb.getNbbm(),"jcsx"); | ||
| 1491 | - DecimalFormat df = new DecimalFormat("#.00"); | ||
| 1492 | - Double zyl = 0.0; | ||
| 1493 | - Double nextJzyl = 0.0; | ||
| 1494 | - // 车的,进,出油量及耗油 | ||
| 1495 | - double czyl=0.0; | ||
| 1496 | - for (int i = 0; i < iterator2.size(); i++) { | ||
| 1497 | - Ylb t = iterator2.get(i); | ||
| 1498 | - if (t.getJcsx() == 1) { | ||
| 1499 | - if(t.getId()==id){ | ||
| 1500 | - t.setSh(sh); | ||
| 1501 | - t.setShyy(shyy); | ||
| 1502 | - } | ||
| 1503 | - czyl=t.getCzyl(); | ||
| 1504 | - Double jcyl = t.getCzyl(); | ||
| 1505 | - zyl = Arith.sub(Arith.add(jcyl, jzl), yl); | ||
| 1506 | - Double yh = 0.0; | ||
| 1507 | - if (zlc > 0 && t.getZlc() > 0) { | ||
| 1508 | - yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 1509 | - } | ||
| 1510 | - nextJzyl =Arith.sub(Arith.add(t.getJzl(), t.getCzyl()), yh); | ||
| 1511 | -// nextJzyl =Arith.sub(Arith.add(t.getJzl(), t.getCzyl()), Arith.add(yh, t.getSh())); | ||
| 1512 | - if(zlc>0 && t.getZlc() > 0){ | ||
| 1513 | - long l=Math.round(nextJzyl); | ||
| 1514 | - double ylxs=l*100/100; | ||
| 1515 | -// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | ||
| 1516 | - yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 1517 | - t.setYh(yh); | ||
| 1518 | - t.setJzyl(ylxs); | ||
| 1519 | - nextJzyl=ylxs; | ||
| 1520 | - }else{ | ||
| 1521 | - t.setYh(yh); | ||
| 1522 | - t.setJzyl(nextJzyl); | ||
| 1523 | - } | ||
| 1524 | - } else { | ||
| 1525 | - if(t.getId()==id){ | ||
| 1526 | - t.setSh(sh); | ||
| 1527 | - t.setShyy(shyy); | ||
| 1528 | - } | ||
| 1529 | - t.setCzyl(nextJzyl); | ||
| 1530 | - Double yh =0.0; | ||
| 1531 | - if (t.getZlc() >= 0) { | ||
| 1532 | - yh= Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 1533 | - } | ||
| 1534 | -// nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), Arith.add(yh, t.getSh())); | ||
| 1535 | - nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), yh); | ||
| 1536 | - if(zlc>0 && t.getZlc() >0){ | ||
| 1537 | - long l=0l; | ||
| 1538 | - double ylxs=0.0; | ||
| 1539 | - if(i==iterator2.size()-1){ | ||
| 1540 | - ylxs=yl; | ||
| 1541 | - }else{ | ||
| 1542 | - l=Math.round(nextJzyl); | ||
| 1543 | - ylxs=l*100/100; | ||
| 1544 | - } | ||
| 1545 | - yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 1546 | - t.setYh(yh); | ||
| 1547 | - t.setJzyl(ylxs); | ||
| 1548 | - nextJzyl=ylxs; | ||
| 1549 | - }else{ | ||
| 1550 | - t.setYh(yh); | ||
| 1551 | - t.setJzyl(nextJzyl); | ||
| 1552 | - } | ||
| 1553 | - } | ||
| 1554 | - if(t.getJzyl()<0){ | ||
| 1555 | - t.setJzyl(0.0); | ||
| 1556 | - } | ||
| 1557 | - if(t.getCzyl()<0){ | ||
| 1558 | - t.setCzyl(0.0); | ||
| 1559 | - } | ||
| 1560 | - if(t.getYh()<0){ | ||
| 1561 | - t.setYh(0.0); | ||
| 1562 | - } | ||
| 1563 | - if(t.getSh()<0){ | ||
| 1564 | - t.setSh(0.0); | ||
| 1565 | - } | ||
| 1566 | - repository.save(t); | ||
| 1567 | - } | ||
| 1568 | - newMap.put("status", ResponseCode.SUCCESS); | ||
| 1569 | - } | ||
| 1570 | - | ||
| 1571 | - SysUser user = SecurityUtils.getCurrentUser(); | ||
| 1572 | - Nylog nylog=new Nylog(); | ||
| 1573 | - nylog.setCreatedate(new Date()); | ||
| 1574 | - nylog.setCzmc("拆分"); | ||
| 1575 | - nylog.setNylx("油"); | ||
| 1576 | - nylog.setUserid(user.getUserName()); | ||
| 1577 | - nylog.setUsername(user.getName()); | ||
| 1578 | - nylog.setCxtj(""); | ||
| 1579 | - nylogRepository.save(nylog); | ||
| 1580 | - } catch (Exception e) { | ||
| 1581 | - newMap.put("status", ResponseCode.ERROR); | ||
| 1582 | - logger.error("save erro.", e); | ||
| 1583 | - throw e; | ||
| 1584 | - } | ||
| 1585 | - return newMap; | ||
| 1586 | - } | ||
| 1587 | - | ||
| 1588 | - | ||
| 1589 | - @Override | ||
| 1590 | - public String checkJsy(Map<String, Object> map) { | ||
| 1591 | - // TODO Auto-generated method stub | ||
| 1592 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1593 | - String rq=map.get("date").toString(); | ||
| 1594 | - String nbbm=map.get("nbbm").toString(); | ||
| 1595 | - String jsy =map.get("jsy").toString(); | ||
| 1596 | - String xlbm=map.get("xlbm").toString(); | ||
| 1597 | - List<Ylb> list= repository.checkYlb(rq, nbbm, jsy,xlbm,"nbbm"); | ||
| 1598 | - String type="1"; | ||
| 1599 | - if(list.size()>0){ | ||
| 1600 | - type="0"; | ||
| 1601 | - } | ||
| 1602 | - return type; | 98 | + private static boolean modify_rights_close_pj = true; |
| 99 | + | ||
| 100 | + | ||
| 101 | + | ||
| 102 | + /** | ||
| 103 | + * 获取进存油信息 | ||
| 104 | + * @Transactional 回滚事物 | ||
| 105 | + */ | ||
| 106 | + @Transactional | ||
| 107 | + @Override | ||
| 108 | + public String obtainDsq() throws Exception{ | ||
| 109 | + String result = "failure"; | ||
| 110 | + try { | ||
| 111 | + List<Ylb> addList = new ArrayList<Ylb>(); | ||
| 112 | + String type = ""; | ||
| 113 | + List<Cars> carsList=carsRepository.findCars(); | ||
| 114 | + Map<String, Boolean> carsMap=new HashMap<String, Boolean>(); | ||
| 115 | + for (int i = 0; i < carsList.size(); i++) { | ||
| 116 | + Cars c=carsList.get(i); | ||
| 117 | + carsMap.put(c.getInsideCode(), c.getSfdc()); | ||
| 118 | + } | ||
| 119 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 120 | + Date dNow = new Date(); //当前时间 | ||
| 121 | + Date dBefore = new Date(); | ||
| 122 | + Calendar calendar = Calendar.getInstance(); //得到日历 | ||
| 123 | + calendar.setTime(dNow);//把当前时间赋给日历 | ||
| 124 | + calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | ||
| 125 | + dBefore = calendar.getTime(); //得到前一天的时间 | ||
| 126 | + String rq=sdf.format(dBefore); | ||
| 127 | + //保留两位小数 | ||
| 128 | + DecimalFormat df = new DecimalFormat("#.000"); | ||
| 129 | + // TODO Auto-generated method stub | ||
| 130 | + Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 131 | + //当天YLB信息 | ||
| 132 | +// List<Ylb> ylList=repository.obtainYl(rq,"","","","","nbbm"); | ||
| 133 | + List<Ylb> ylList=this.listOrderBy(rq,"","","","","nbbm"); | ||
| 134 | + //当天YLXXB信息 | ||
| 135 | + // List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq); | ||
| 136 | + //前一天所有车辆最后进场班次信息 | ||
| 137 | + List<Ylb> ylListBe=this.listByRqJcsx(rq,"","","",""); | ||
| 138 | +// List<Ylb> ylListBe=repository.listMaxRqJcsx(rq, "", "", "", ""); | ||
| 139 | + List<Cyl> clyList=cylRepository.obtainCyl("",""); | ||
| 140 | + //从排班表中计算出行驶的总里程 | ||
| 141 | + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("", rq, "", "", "", ""); | ||
| 142 | + | ||
| 143 | + for(int x=0;x<listpb.size();x++){ | ||
| 144 | + boolean sfdc=true; | ||
| 145 | + Map<String, Object> map=listpb.get(x); | ||
| 146 | + if (carsMap.get(map.get("clZbh").toString())!=null) { | ||
| 147 | + sfdc= carsMap.get(map.get("clZbh").toString()); | ||
| 148 | + }else{ | ||
| 149 | + sfdc=true; | ||
| 150 | + } | ||
| 151 | + if(!sfdc){ | ||
| 152 | + //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | ||
| 153 | + Ylb t=new Ylb(); | ||
| 154 | + for(int k=0;k<ylList.size();k++){ | ||
| 155 | + Ylb t1=ylList.get(k); | ||
| 156 | + if(t1.getNbbm().equals(map.get("clZbh").toString()) | ||
| 157 | + &&t1.getJsy().equals(map.get("jGh").toString()) | ||
| 158 | + &&t1.getXlbm().equals(map.get("xlBm").toString()) | ||
| 159 | + &&t1.getLp().equals(map.get("lpName").toString())) | ||
| 160 | + { | ||
| 161 | + t=t1; | ||
| 162 | + type="update"; | ||
| 163 | + } | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | ||
| 167 | + if(map.get("seqNumber").toString().equals("1")){ | ||
| 168 | + boolean fage=true; | ||
| 169 | + for (int i = 0; i < ylListBe.size(); i++) { | ||
| 170 | + Ylb ylb=ylListBe.get(i); | ||
| 171 | + if(map.get("clZbh").toString().equals(ylb.getNbbm())){ | ||
| 172 | + if(ylb.getJzyl()!=null){ | ||
| 173 | + if(ylb.getJzyl()>=0){ | ||
| 174 | + t.setCzyl(ylb.getJzyl()); | ||
| 175 | + fage=false; | ||
| 176 | + break; | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + } | ||
| 181 | + } | ||
| 182 | + if(fage){ | ||
| 183 | + for (int y = 0; y < clyList.size(); y++) { | ||
| 184 | + Cyl cyl=clyList.get(y); | ||
| 185 | + if(map.get("clZbh").toString().equals(cyl.getNbbm())){ | ||
| 186 | + if(cyl.getCyl()!=null){ | ||
| 187 | + t.setCzyl(cyl.getCyl()); | ||
| 188 | + fage=false; | ||
| 189 | + break; | ||
| 190 | + } | ||
| 191 | + } | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + if(fage){ | ||
| 195 | + t.setCzyl(0.0); | ||
| 196 | + } | ||
| 197 | + } | ||
| 198 | + t.setNbbm(map.get("clZbh").toString()); | ||
| 199 | + t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | ||
| 200 | + t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString())); | ||
| 201 | + t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | ||
| 202 | + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString()); | ||
| 203 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | ||
| 204 | + t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | ||
| 205 | + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | ||
| 206 | + t.setLp(map.get("lpName")==null?"":map.get("lpName").toString()); | ||
| 207 | + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | ||
| 208 | + t.setJname(map.get("jName").toString()); | ||
| 209 | + t.setRq(sdf.parse(rq)); | ||
| 210 | + t.setCreatetime(dNow); | ||
| 211 | + if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 212 | + if(type.equals("update")){ | ||
| 213 | + repository.save(t); | ||
| 214 | + }else{ | ||
| 215 | + addList.add(t); | ||
| 216 | + } | ||
| 217 | + } | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + } | ||
| 221 | + if(addList.size()>0){ | ||
| 222 | + try { | ||
| 223 | + new BatchSaveUtils<Ylb>().saveList2(addList, Ylb.class); | ||
| 224 | + } catch (Exception e) { | ||
| 225 | + // TODO: handle exception | ||
| 226 | + if(e.getMessage().indexOf("PK_YLB_UK")>0){ | ||
| 227 | + newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 228 | + logger.info("定时器:存在相同数据,数据已经过滤"); | ||
| 229 | + } | ||
| 230 | + } | ||
| 231 | + } | ||
| 232 | + result = "success"; | ||
| 233 | + }catch (Exception e) { | ||
| 234 | + // TODO Auto-generated catch block | ||
| 235 | + throw e; | ||
| 236 | + }finally{ | ||
| 237 | + logger.info("setDDRB:"+result); | ||
| 238 | + } | ||
| 239 | + | ||
| 240 | + return result; | ||
| 241 | + } | ||
| 242 | + | ||
| 243 | + /** | ||
| 244 | + * 获取进存油信息 | ||
| 245 | + * @Transactional 回滚事物 | ||
| 246 | + */ | ||
| 247 | + @Transactional | ||
| 248 | + @Override | ||
| 249 | + public Map<String, Object> obtain(Map<String, Object> map2) throws Exception{ | ||
| 250 | + Map<String, Object> newMap = new HashMap<String, Object>(); | ||
| 251 | + try { | ||
| 252 | + Date date=new Date(); | ||
| 253 | + List<Cars> carsList = carsRepository.findCars(); | ||
| 254 | + Map<String, Boolean> carsMap = new HashMap<String, Boolean>(); | ||
| 255 | + for (int i = 0; i < carsList.size(); i++) { | ||
| 256 | + Cars c = carsList.get(i); | ||
| 257 | + carsMap.put(c.getInsideCode(), c.getSfdc()); | ||
| 258 | + } | ||
| 259 | + String rq = map2.get("rq").toString(); | ||
| 260 | + String line = ""; | ||
| 261 | + if (map2.get("xlbm_like") != null) { | ||
| 262 | + line = map2.get("xlbm_like").toString().trim(); | ||
| 263 | + } | ||
| 264 | + String gsbm=""; | ||
| 265 | + if(map2.get("ssgsdm_like")!=null){ | ||
| 266 | + gsbm=map2.get("ssgsdm_like").toString(); | ||
| 267 | + } | ||
| 268 | + String fgsbm=""; | ||
| 269 | + if(map2.get("fgsdm_like")!=null){ | ||
| 270 | + fgsbm=map2.get("fgsdm_like").toString(); | ||
| 271 | + } | ||
| 272 | + String nbbm=""; | ||
| 273 | + if(map2.get("nbbm_eq")!=null){ | ||
| 274 | + nbbm=map2.get("nbbm_eq").toString(); | ||
| 275 | + } | ||
| 276 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 277 | + // 保留两位小数 | ||
| 278 | + DecimalFormat df = new DecimalFormat("#.000"); | ||
| 279 | + // TODO Auto-generated method stub | ||
| 280 | + // 当天YLB信息 | ||
| 281 | + List<Ylb> ylList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); | ||
| 282 | + | ||
| 283 | + // 当天YLXXB信息 | ||
| 284 | + List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm); | ||
| 285 | + | ||
| 286 | + // 前一天所有车辆最后进场班次信息 | ||
| 287 | + List<Ylb> ylListBe = this.listByRqJcsx(rq, gsbm, fgsbm, "", nbbm); | ||
| 288 | + List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm); | ||
| 289 | + | ||
| 290 | + // 从排班表中计算出行驶的总里程 | ||
| 291 | + List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); | ||
| 292 | + List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList("", rq, gsbm, fgsbm, "", nbbm); | ||
| 293 | + | ||
| 294 | + String sxtj=map2.get("sxtj").toString(); | ||
| 295 | + if(sxtj.equals("0")){ | ||
| 296 | + listpb=listpbs; | ||
| 297 | + }else if (sxtj.equals("5")){ | ||
| 298 | + List<String> stringList=new ArrayList<String>(); | ||
| 299 | + | ||
| 300 | + List<Object[]> objectLists = repository.checkNbmmFgs(rq, gsbm); | ||
| 301 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 302 | + String clbm=objectLists.get(i)[0].toString(); | ||
| 303 | + stringList.add(clbm); | ||
| 304 | + } | ||
| 305 | + | ||
| 306 | + for (int i = 0; i < stringList.size(); i++) { | ||
| 307 | + String strNbbm=stringList.get(i); | ||
| 308 | + for (int j = 0; j < listpbs.size(); j++) { | ||
| 309 | + Map<String, Object> map = listpbs.get(j); | ||
| 310 | + String mapNbbm=map.get("clZbh").toString(); | ||
| 311 | + if(strNbbm.equals(mapNbbm)){ | ||
| 312 | + listpb.add(map); | ||
| 313 | + } | ||
| 314 | + } | ||
| 315 | + } | ||
| 316 | + | ||
| 317 | + }else{ | ||
| 318 | + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, "",nbbm); | ||
| 319 | + List<String> stringList=new ArrayList<String>(); | ||
| 320 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 321 | + String clbm=objectLists.get(i)[0].toString(); | ||
| 322 | + int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 323 | + //一车一单 | ||
| 324 | + if(sxtj.equals("1")){ | ||
| 325 | + if(cs==1){ | ||
| 326 | + stringList.add(clbm); | ||
| 327 | + } | ||
| 328 | + } | ||
| 329 | + //一车多单 | ||
| 330 | + if(sxtj.equals("2")){ | ||
| 331 | + if(cs>1){ | ||
| 332 | + stringList.add(clbm); | ||
| 333 | + } | ||
| 334 | + } | ||
| 335 | + } | ||
| 336 | + | ||
| 337 | + for (int i = 0; i < stringList.size(); i++) { | ||
| 338 | + String strNbbm=stringList.get(i); | ||
| 339 | + for (int j = 0; j < listpbs.size(); j++) { | ||
| 340 | + Map<String, Object> map = listpbs.get(j); | ||
| 341 | + String mapNbbm=map.get("clZbh").toString(); | ||
| 342 | + if(strNbbm.equals(mapNbbm)){ | ||
| 343 | + listpb.add(map); | ||
| 344 | + } | ||
| 345 | + } | ||
| 346 | + } | ||
| 347 | + } | ||
| 348 | + | ||
| 349 | + List<Ylb> addList = new ArrayList<Ylb>(); | ||
| 350 | + List<Ylb> updateList = new ArrayList<Ylb>(); | ||
| 351 | + Map<String, Object> ylMap=new HashMap<String, Object>(); | ||
| 352 | + | ||
| 353 | + Map<String, Object> cMap=new HashMap<String, Object>(); | ||
| 354 | + for (int x = 0; x < listpb.size(); x++) { | ||
| 355 | + String type = "add"; | ||
| 356 | + boolean sfdc = true; | ||
| 357 | + Map<String, Object> map = listpb.get(x); | ||
| 358 | + if (carsMap.get(map.get("clZbh").toString()) != null) { | ||
| 359 | + sfdc = carsMap.get(map.get("clZbh").toString()); | ||
| 360 | + } else { | ||
| 361 | + sfdc = true; | ||
| 362 | + } | ||
| 363 | + if (!sfdc) { | ||
| 364 | + // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | ||
| 365 | + Ylb t = new Ylb(); | ||
| 366 | + for (int k = 0; k < ylList.size(); k++) { | ||
| 367 | + Ylb t1 = ylList.get(k); | ||
| 368 | + if (t1.getNbbm().equals(map.get("clZbh").toString()) | ||
| 369 | + && t1.getJsy().equals(map.get("jGh").toString()) | ||
| 370 | + && t1.getXlbm().equals(map.get("xlBm").toString() | ||
| 371 | + )) { | ||
| 372 | + if(t1.getLp()==null){ | ||
| 373 | + //同人同车同线路不同路牌的过滤 (考虑到历史数据) | ||
| 374 | + if (cMap.get(map.get("clZbh").toString()+map.get("jGh").toString()+map.get("xlBm").toString())==null) { | ||
| 375 | + t = t1; | ||
| 376 | + type = "update"; | ||
| 377 | + cMap.put(map.get("clZbh").toString()+map.get("jGh").toString()+map.get("xlBm").toString(), | ||
| 378 | + map.get("clZbh").toString()); | ||
| 379 | + } | ||
| 380 | + }else{ | ||
| 381 | + if(t1.getLp().equals(map.get("lpName").toString())){ | ||
| 382 | + t = t1; | ||
| 383 | + type = "update"; | ||
| 384 | + } | ||
| 385 | + | ||
| 386 | + } | ||
| 387 | + } | ||
| 388 | + } | ||
| 389 | + // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | ||
| 390 | + if (map.get("seqNumber").toString().equals("1")) { | ||
| 391 | + boolean fage = true; | ||
| 392 | + if(line.equals("")){ | ||
| 393 | + for (int i = 0; i < ylListBe.size(); i++) { | ||
| 394 | + Ylb ylb = ylListBe.get(i); | ||
| 395 | + if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | ||
| 396 | + if(ylb.getJzyl()>=0){ | ||
| 397 | + t.setCzyl(ylb.getJzyl()); | ||
| 398 | + fage = false; | ||
| 399 | + break; | ||
| 400 | + } | ||
| 401 | + | ||
| 402 | + } | ||
| 403 | + } | ||
| 404 | + if (fage) { | ||
| 405 | + for (int y = 0; y < clyList.size(); y++) { | ||
| 406 | + Cyl cyl = clyList.get(y); | ||
| 407 | + if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | ||
| 408 | + if(cyl!=null){ | ||
| 409 | + if(cyl.getCyl()>=0){ | ||
| 410 | + t.setCzyl(cyl.getCyl()); | ||
| 411 | + fage = false; | ||
| 412 | + break; | ||
| 413 | + }else { | ||
| 414 | + if(cyl.getCxrl()!=null){ | ||
| 415 | + if(cyl.getCxrl()>0){ | ||
| 416 | + t.setCzyl(cyl.getCxrl()); | ||
| 417 | + fage = false; | ||
| 418 | + break; | ||
| 419 | + } | ||
| 420 | + } | ||
| 421 | + } | ||
| 422 | + } | ||
| 423 | + } | ||
| 424 | + } | ||
| 425 | + } | ||
| 426 | + if (fage) { | ||
| 427 | + t.setCzyl(0.0); | ||
| 428 | + } | ||
| 429 | + }else{ | ||
| 430 | + if (line.equals(map.get("xlBm").toString())) { | ||
| 431 | + for (int i = 0; i < ylListBe.size(); i++) { | ||
| 432 | + Ylb ylb = ylListBe.get(i); | ||
| 433 | + if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | ||
| 434 | + if(ylb.getJzyl()>=0){ | ||
| 435 | + t.setCzyl(ylb.getJzyl()); | ||
| 436 | + fage = false; | ||
| 437 | + break; | ||
| 438 | + } | ||
| 439 | + | ||
| 440 | + } | ||
| 441 | + } | ||
| 442 | + if (fage) { | ||
| 443 | + for (int y = 0; y < clyList.size(); y++) { | ||
| 444 | + Cyl cyl = clyList.get(y); | ||
| 445 | + if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | ||
| 446 | + if(cyl!=null){ | ||
| 447 | + if(cyl.getCyl()>=0){ | ||
| 448 | + t.setCzyl(cyl.getCyl()); | ||
| 449 | + fage = false; | ||
| 450 | + break; | ||
| 451 | + }else { | ||
| 452 | + if(cyl.getCxrl()!=null){ | ||
| 453 | + if(cyl.getCxrl()>0){ | ||
| 454 | + t.setCzyl(cyl.getCxrl()); | ||
| 455 | + fage = false; | ||
| 456 | + break; | ||
| 457 | + } | ||
| 458 | + } | ||
| 459 | + } | ||
| 460 | + } | ||
| 461 | + } | ||
| 462 | + } | ||
| 463 | + } | ||
| 464 | + if (fage) { | ||
| 465 | + t.setCzyl(0.0); | ||
| 466 | + } | ||
| 467 | + } | ||
| 468 | + } | ||
| 469 | + | ||
| 470 | + } | ||
| 471 | + | ||
| 472 | + Double jzl = 0.0; | ||
| 473 | + //一人一车加注量只匹配一次 | ||
| 474 | + if(ylMap.get(map.get("clZbh").toString()+"_"+ map.get("jGh").toString())==null){ | ||
| 475 | + | ||
| 476 | + boolean fage2=false; | ||
| 477 | + for (int i = 0; i < ylxxList.size(); i++) { | ||
| 478 | + Ylxxb ylxxb = ylxxList.get(i); | ||
| 479 | + if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 480 | + && map.get("jGh").toString().equals(ylxxb.getJsy()) | ||
| 481 | + && ylxxb.getJylx()==1) { | ||
| 482 | + if(ylxxb.getJzl()>0){ | ||
| 483 | + fage2=true; | ||
| 484 | + } | ||
| 485 | + | ||
| 486 | + } | ||
| 487 | + } | ||
| 488 | + //车辆的加注量如果有任工干预,略接口过来 数据 | ||
| 489 | + if(fage2){ | ||
| 490 | + // 把当天手工输入的的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断,加油类型为1) | ||
| 491 | + for (int j = 0; j < ylxxList.size(); j++) { | ||
| 492 | + Ylxxb ylxxb = ylxxList.get(j); | ||
| 493 | + if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 494 | + && map.get("jGh").toString().equals(ylxxb.getJsy()) | ||
| 495 | + && ylxxb.getJylx()==1) { | ||
| 496 | + jzl =Arith.add(jzl, ylxxb.getJzl()); | ||
| 497 | + } | ||
| 498 | + } | ||
| 499 | + ylMap.put(map.get("clZbh").toString()+"_"+ map.get("jGh").toString(),map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | ||
| 500 | + }else{ | ||
| 501 | + // 把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | ||
| 502 | + for (int j = 0; j < ylxxList.size(); j++) { | ||
| 503 | + Ylxxb ylxxb = ylxxList.get(j); | ||
| 504 | + if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 505 | + && map.get("jGh").toString().equals(ylxxb.getJsy())) { | ||
| 506 | + jzl =Arith.add(jzl, ylxxb.getJzl()); | ||
| 507 | + } | ||
| 508 | + } | ||
| 509 | + ylMap.put(map.get("clZbh").toString()+"_"+ map.get("jGh").toString(),map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | ||
| 510 | + } | ||
| 511 | + | ||
| 512 | + } | ||
| 513 | + t.setJzl(jzl); | ||
| 514 | + t.setNbbm(map.get("clZbh").toString()); | ||
| 515 | + t.setJsy(map.get("jGh") == null ? "" : map.get("jGh").toString()); | ||
| 516 | + t.setZlc(map.get("totalKilometers") == null ? 0.0 | ||
| 517 | + : Double.parseDouble(map.get("totalKilometers").toString())); | ||
| 518 | + t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | ||
| 519 | + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString()); | ||
| 520 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | ||
| 521 | + t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); | ||
| 522 | + t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | ||
| 523 | + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | ||
| 524 | + t.setRq(sdf.parse(rq)); | ||
| 525 | + t.setLp(map.get("lpName")==null?"":map.get("lpName").toString()); | ||
| 526 | + t.setJname(map.get("jName").toString()); | ||
| 527 | + if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 528 | + if(type.equals("add")){ | ||
| 529 | + t.setCreatetime(date); | ||
| 530 | + addList.add(t); | ||
| 531 | + }else{ | ||
| 532 | + t.setUpdatetime(date); | ||
| 533 | + updateList.add(t); | ||
| 534 | + } | ||
| 535 | + } | ||
| 536 | +// repository.save(t); | ||
| 537 | + newMap.put("status", ResponseCode.SUCCESS); | ||
| 538 | + | ||
| 539 | + } | ||
| 540 | + } | ||
| 541 | + if(addList.size()>0){ | ||
| 542 | + try { | ||
| 543 | + new BatchSaveUtils<Ylb>().saveList2(addList, Ylb.class); | ||
| 544 | + } catch (Exception e) { | ||
| 545 | + // TODO: handle exception | ||
| 546 | + if(e.getMessage().indexOf("PK_YLB_UK")>0){ | ||
| 547 | + newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 548 | + logger.info("获取:存在相同数据,数据已经过滤"); | ||
| 549 | + } | ||
| 550 | + } | ||
| 551 | + | ||
| 552 | + } | ||
| 553 | + if(updateList.size()>0){ | ||
| 554 | + for (int i = 0; i < updateList.size(); i++) { | ||
| 555 | + repository.save(updateList.get(i)); | ||
| 556 | + } | ||
| 557 | + } | ||
| 558 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 559 | + Nylog nylog=new Nylog(); | ||
| 560 | + nylog.setCreatedate(new Date()); | ||
| 561 | + nylog.setCzmc("获取加存油"); | ||
| 562 | + nylog.setNylx("油"); | ||
| 563 | + nylog.setUserid(user.getUserName()); | ||
| 564 | + nylog.setUsername(user.getName()); | ||
| 565 | + nylog.setCxtj(rq+"-"+gsbm+"-"+fgsbm+"-"+line+"-"+nbbm+"-"+sxtj); | ||
| 566 | + nylogRepository.save(nylog); | ||
| 567 | + newMap.put("status", ResponseCode.SUCCESS); | ||
| 568 | + } catch (Exception e) { | ||
| 569 | + // TODO Auto-generated catch block | ||
| 570 | + newMap.put("status", ResponseCode.ERROR); | ||
| 571 | + throw e; | ||
| 572 | + } | ||
| 573 | + | ||
| 574 | + return newMap; | ||
| 575 | + } | ||
| 576 | + | ||
| 577 | + | ||
| 578 | + /** | ||
| 579 | + * 进场等于出场 | ||
| 580 | + */ | ||
| 581 | + @Transactional | ||
| 582 | + @Override | ||
| 583 | + public Map<String, Object> outAndIn(Map<String, Object> map) throws Exception{ | ||
| 584 | + // TODO Auto-generated method stub | ||
| 585 | + String xlbm=""; | ||
| 586 | + if(map.get("xlbm_like")!=null){ | ||
| 587 | + xlbm= map.get("xlbm_like").toString().trim(); | ||
| 588 | + } | ||
| 589 | + String gsbm=""; | ||
| 590 | + if(map.get("ssgsdm_like")!=null){ | ||
| 591 | + gsbm=map.get("ssgsdm_like").toString(); | ||
| 592 | + } | ||
| 593 | + String fgsbm=""; | ||
| 594 | + if(map.get("fgsdm_like")!=null){ | ||
| 595 | + fgsbm=map.get("fgsdm_like").toString(); | ||
| 596 | + } | ||
| 597 | + String rq = map.get("rq").toString(); | ||
| 598 | + String nbbm=""; | ||
| 599 | + if(map.get("nbbm_eq")!=null){ | ||
| 600 | + nbbm=map.get("nbbm_eq").toString(); | ||
| 601 | + } | ||
| 602 | + | ||
| 603 | + Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 604 | + Map<String, Object> map2=new HashMap<String,Object>(); | ||
| 605 | + try { | ||
| 606 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 607 | + | ||
| 608 | + map.put("rq_eq", sdf.parse(rq)); | ||
| 609 | +// List<Cyl> clyList = cylRepository.obtainCyl(); | ||
| 610 | + // 获取车辆存油信息 | ||
| 611 | + List<Cyl> cylList = cylRepository.obtainCyl(nbbm,gsbm); | ||
| 612 | + // 指定日期YLB信息 | ||
| 613 | + List<Ylb> ylbList =new ArrayList<Ylb>(); | ||
| 614 | + List<Ylb> ylbLists =new ArrayList<Ylb>(); | ||
| 615 | + List<Ylb> iterator2=new ArrayList<Ylb>(); | ||
| 616 | + ylbLists=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | ||
| 617 | + iterator2=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx"); | ||
| 618 | + // 从排班表中计算出行驶的总里程 | ||
| 619 | + | ||
| 620 | + String sxtj=map.get("sxtj").toString(); | ||
| 621 | + if(sxtj.equals("0")){ | ||
| 622 | + ylbList=ylbLists; | ||
| 623 | + }else{ | ||
| 624 | + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 625 | + List<String> stringList=new ArrayList<String>(); | ||
| 626 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 627 | + String clbm=objectLists.get(i)[0].toString(); | ||
| 628 | + int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 629 | + //一车一单 | ||
| 630 | + if(sxtj.equals("1")){ | ||
| 631 | + if(cs==1){ | ||
| 632 | + stringList.add(clbm); | ||
| 633 | + } | ||
| 634 | + } | ||
| 635 | + //一车多单 | ||
| 636 | + if(sxtj.equals("2")){ | ||
| 637 | + if(cs>1){ | ||
| 638 | + stringList.add(clbm); | ||
| 639 | + } | ||
| 640 | + } | ||
| 641 | + } | ||
| 642 | + | ||
| 643 | + for (int i = 0; i < stringList.size(); i++) { | ||
| 644 | + String strNbbm=stringList.get(i); | ||
| 645 | + for (int j = 0; j < ylbLists.size(); j++) { | ||
| 646 | + Ylb y = ylbLists.get(j); | ||
| 647 | + String mapNbbm=y.getNbbm(); | ||
| 648 | + if(strNbbm.equals(mapNbbm)){ | ||
| 649 | + ylbList.add(y); | ||
| 650 | + } | ||
| 651 | + } | ||
| 652 | + } | ||
| 653 | + } | ||
| 654 | + | ||
| 655 | + for (int i=0;i<ylbList.size();i++) { | ||
| 656 | + Ylb ylb = ylbList.get(i); | ||
| 657 | + // 判断是否已经计算过 | ||
| 658 | + if (newMap.get("nbbm" + ylb.getNbbm()) == null) { | ||
| 659 | + String nbbm_eq = ylb.getNbbm(); | ||
| 660 | + Date rq_eq = ylb.getRq(); | ||
| 661 | + // 得到一天总的加油和里程(根据车,时间) | ||
| 662 | + List<Object[]> sumList = repository.sumLcYl(nbbm_eq, rq_eq,"",gsbm,fgsbm); | ||
| 663 | + // 保存总的加油量 | ||
| 664 | + Double jzl = 0.0; | ||
| 665 | + // 保存总的里程 | ||
| 666 | + Double zlc = 0.0; | ||
| 667 | + //保存总的损耗 | ||
| 668 | + Double zsh = 0.0; | ||
| 669 | + for (int j = 0; j < sumList.size(); j++) { | ||
| 670 | + jzl = Arith.add(jzl, Double.valueOf(sumList.get(j)[0].toString())); | ||
| 671 | + zlc = Arith.add(zlc, Double.valueOf(sumList.get(j)[1].toString())); | ||
| 672 | + zsh = Arith.add(zsh, Double.valueOf(sumList.get(j)[2].toString())); | ||
| 673 | + } | ||
| 674 | +// jzl = Arith.sub(jzl, zsh); | ||
| 675 | + // 保留两位小数 | ||
| 676 | + DecimalFormat df = new DecimalFormat("#.000"); | ||
| 677 | + Double zyl = 0.0; | ||
| 678 | + Double nextJzyl = 0.0; | ||
| 679 | + // 保存已经计算过的车辆,相同车辆编号的车不在计算 | ||
| 680 | + newMap.put("nbbm" + ylb.getNbbm(), ylb.getNbbm()); | ||
| 681 | + | ||
| 682 | + // 查询指定车辆,设置进、存、耗油量 | ||
| 683 | + map.remove("nbbm_eq"); | ||
| 684 | + map.put("nbbm_eq", ylb.getNbbm()); | ||
| 685 | + map.put("xlbm_like", ylb.getXlbm()); | ||
| 686 | +// Iterator<Ylb> iterator2 = repository | ||
| 687 | +// .findAll(new CustomerSpecs<Ylb>(map), new Sort(Direction.ASC, "jcsx")).iterator(); | ||
| 688 | + double czyl=0.0; | ||
| 689 | + for (int j = 0; j < iterator2.size(); j++) { | ||
| 690 | + Ylb t = iterator2.get(j); | ||
| 691 | + if(t.getNbbm().equals(ylb.getNbbm())){ | ||
| 692 | + if (t.getJcsx() == 1) { | ||
| 693 | + // 进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量 | ||
| 694 | +// Double yl = t.getCzyl(); | ||
| 695 | +// Double jcyl = t.getCzyl(); | ||
| 696 | + czyl = t.getCzyl(); | ||
| 697 | + zyl =jzl; | ||
| 698 | + Double yh=0.0; | ||
| 699 | + if(zlc>0 ){ | ||
| 700 | + yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 701 | + } | ||
| 702 | + nextJzyl =Arith.sub( Arith.add(t.getJzl(), t.getCzyl()),yh); | ||
| 703 | +// nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()), t.getCzyl()),yh); | ||
| 704 | + //把进场油量的小数和整数分别取出 | ||
| 705 | +// int ylxs=(int) nextJzyl; 10.6--11 10.3--10 | ||
| 706 | + if(zlc>0 && t.getZlc()>0){ | ||
| 707 | + long l=Math.round(nextJzyl); | ||
| 708 | + double ylxs=l*100/100; | ||
| 709 | +// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | ||
| 710 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 711 | + t.setYh(yh); | ||
| 712 | + t.setJzyl(ylxs); | ||
| 713 | + nextJzyl=ylxs; | ||
| 714 | + }else{ | ||
| 715 | + t.setYh(yh); | ||
| 716 | + t.setJzyl(nextJzyl); | ||
| 717 | + } | ||
| 718 | + } else { | ||
| 719 | + t.setCzyl(nextJzyl); | ||
| 720 | + Double yh=0.0; | ||
| 721 | + if(zlc>0){ | ||
| 722 | + yh= Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 723 | + } | ||
| 724 | + nextJzyl =Arith.sub( Arith.add(t.getJzl(),nextJzyl),yh); | ||
| 725 | +// nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()),nextJzyl),yh); | ||
| 726 | + if(zlc>0 && t.getZlc()>0){ | ||
| 727 | + long l=0l; | ||
| 728 | + double ylxs=0.0; | ||
| 729 | + if(j==iterator2.size()-1){ | ||
| 730 | + ylxs=czyl; | ||
| 731 | + }else{ | ||
| 732 | + if(iterator2.get(j+1).getNbbm().equals(t.getNbbm())){ | ||
| 733 | + l=Math.round(nextJzyl); | ||
| 734 | + ylxs=l*100/100; | ||
| 735 | + }else{ | ||
| 736 | + ylxs=czyl; | ||
| 737 | + } | ||
| 738 | + | ||
| 739 | + } | ||
| 740 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 741 | +// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | ||
| 742 | + | ||
| 743 | + t.setYh(yh); | ||
| 744 | + t.setJzyl(ylxs); | ||
| 745 | + nextJzyl=ylxs; | ||
| 746 | + }else{ | ||
| 747 | + t.setYh(yh); | ||
| 748 | + t.setJzyl(nextJzyl); | ||
| 749 | + } | ||
| 750 | + } | ||
| 751 | + if(t.getJzyl()<0){ | ||
| 752 | + t.setJzyl(0.0); | ||
| 753 | + } | ||
| 754 | + if(t.getCzyl()<0){ | ||
| 755 | + t.setCzyl(0.0); | ||
| 756 | + } | ||
| 757 | + if(t.getYh()<0){ | ||
| 758 | + t.setYh(0.0); | ||
| 759 | + } | ||
| 760 | + if(t.getSh()<0){ | ||
| 761 | + t.setSh(0.0); | ||
| 762 | + } | ||
| 763 | + repository.save(t); | ||
| 764 | + } | ||
| 765 | + map2.put("status", ResponseCode.SUCCESS); | ||
| 766 | + } | ||
| 767 | + } | ||
| 768 | + } | ||
| 769 | + | ||
| 770 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 771 | + Nylog nylog=new Nylog(); | ||
| 772 | + nylog.setCreatedate(new Date()); | ||
| 773 | + nylog.setCzmc("进场等于出场"); | ||
| 774 | + nylog.setNylx("油"); | ||
| 775 | + nylog.setUserid(user.getUserName()); | ||
| 776 | + nylog.setUsername(user.getName()); | ||
| 777 | + nylog.setCxtj(rq+"-"+gsbm+"-"+fgsbm+"-"+xlbm+"-"+nbbm+"-"+sxtj); | ||
| 778 | + | ||
| 779 | + nylogRepository.save(nylog); | ||
| 780 | + } catch (Exception e) { | ||
| 781 | + map2.put("status", ResponseCode.ERROR); | ||
| 782 | + logger.error("save erro.", e); | ||
| 783 | + throw e; | ||
| 784 | + } | ||
| 785 | + return map2; | ||
| 786 | + } | ||
| 787 | + | ||
| 788 | + | ||
| 789 | + /** | ||
| 790 | + * 核对,有加注没里程 | ||
| 791 | + * @param map | ||
| 792 | + * @return | ||
| 793 | + */ | ||
| 794 | + @Transactional | ||
| 795 | + @Override | ||
| 796 | + public Map<String, Object> checkYl(Map<String, Object> map) throws Exception{ | ||
| 797 | + Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 798 | +// String xlbm=""; | ||
| 799 | +// if(map.get("xlbm_like")!=null){ | ||
| 800 | +// xlbm=map.get("xlbm_like").toString(); | ||
| 801 | +// } | ||
| 802 | + // TODO Auto-generated method stub | ||
| 803 | + | ||
| 804 | + List<Cars> carsList = carsRepository.findCars(); | ||
| 805 | + Map<String, String> carsMap = new HashMap<String, String>(); | ||
| 806 | + for (int i = 0; i < carsList.size(); i++) { | ||
| 807 | + Cars c = carsList.get(i); | ||
| 808 | + carsMap.put(c.getInsideCode(), c.getBrancheCompanyCode()==null?"":c.getBrancheCompanyCode()); | ||
| 809 | + } | ||
| 810 | + | ||
| 811 | + try{ | ||
| 812 | + //获取车辆存油信息 | ||
| 813 | + | ||
| 814 | + String rq=map.get("rq").toString(); | ||
| 815 | + String xlbm=""; | ||
| 816 | + if(map.get("xlbm_like")!=null){ | ||
| 817 | + xlbm= map.get("xlbm_like").toString().trim(); | ||
| 818 | + } | ||
| 819 | + String gsbm=""; | ||
| 820 | + if(map.get("ssgsdm_like")!=null){ | ||
| 821 | + gsbm=map.get("ssgsdm_like").toString(); | ||
| 822 | + } | ||
| 823 | + String fgsbm=""; | ||
| 824 | + if(map.get("fgsdm_like")!=null){ | ||
| 825 | + fgsbm=map.get("fgsdm_like").toString(); | ||
| 826 | + } | ||
| 827 | + String nbbm=""; | ||
| 828 | + if(map.get("nbbm_eq")!=null){ | ||
| 829 | + nbbm=map.get("nbbm_eq").toString(); | ||
| 830 | + } | ||
| 831 | +// List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm); | ||
| 832 | + List<Ylb> ylListBe=this.listByRqJcsx(rq, gsbm, fgsbm, "", nbbm); | ||
| 833 | + List<Ylb> ylbList=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); | ||
| 834 | +// repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); | ||
| 835 | +// List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm); | ||
| 836 | + String sql="select * from bsth_c_ylxxb where yyrq='"+rq+"' " | ||
| 837 | + + " and gsdm ='"+gsbm+"' and nylx ='0' and nbbm " | ||
| 838 | + + " not in ( select nbbm from bsth_c_ylb " | ||
| 839 | + + " where rq='"+rq+"' " | ||
| 840 | + + " and ssgsdm='"+gsbm+"' and fgsdm ='"+fgsbm+"')" | ||
| 841 | + + " and nbbm in (select inside_code from " | ||
| 842 | + + " bsth_c_cars where business_code ='"+gsbm+"' " | ||
| 843 | + + " and branche_company_code='"+fgsbm+"')"; | ||
| 844 | + | ||
| 845 | + List<Ylxxb> ylxxbList=jdbcTemplate.query(sql, | ||
| 846 | + new RowMapper<Ylxxb>(){ | ||
| 847 | + @Override | ||
| 848 | + public Ylxxb mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 849 | + Ylxxb s = new Ylxxb(); | ||
| 850 | + s.setId(rs.getInt("id")); | ||
| 851 | + s.setYyrq(rs.getDate("yyrq")); | ||
| 852 | + s.setNbbm(rs.getString("nbbm")); | ||
| 853 | + s.setGsdm(rs.getString("gsdm")); | ||
| 854 | + s.setFgsdm(rs.getString("fgsdm")); | ||
| 855 | + s.setJsy(rs.getString("jsy")); | ||
| 856 | + s.setJzl(rs.getDouble("jzl")); | ||
| 857 | + s.setStationid(rs.getString("stationid")); | ||
| 858 | + s.setNylx(rs.getInt("nylx")); | ||
| 859 | + s.setJyggh(rs.getString("jyggh")); | ||
| 860 | + s.setYj(rs.getDouble("yj")); | ||
| 861 | +// s.setLdgh(rs.getString("ldgh")); | ||
| 862 | + s.setBz(rs.getString("bz")); | ||
| 863 | + return s; | ||
| 864 | + } | ||
| 865 | + }); | ||
| 866 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 867 | + for (int i = 0; i < ylxxbList.size(); i++) { | ||
| 868 | + Boolean fage=false; | ||
| 869 | + Ylxxb y1=ylxxbList.get(i); | ||
| 870 | + if(m.get(y1.getNbbm())==null){ | ||
| 871 | + Line line=BasicData.nbbm2LineMap.get(y1.getNbbm()); | ||
| 872 | + if(null !=line){ | ||
| 873 | + if(!xlbm.equals("")){ | ||
| 874 | + if(line.getLineCode().equals(xlbm)){ | ||
| 875 | + fage=true; | ||
| 876 | + } | ||
| 877 | + }else{ | ||
| 878 | + fage=true; | ||
| 879 | + } | ||
| 880 | + } | ||
| 881 | + | ||
| 882 | + if(fage){ | ||
| 883 | + Ylb t=new Ylb(); | ||
| 884 | + t.setNbbm(y1.getNbbm()); | ||
| 885 | + t.setRq(y1.getYyrq()); | ||
| 886 | + t.setJsy(y1.getJsy()); | ||
| 887 | + t.setJname(BasicData.allPerson.get(y1.getGsdm()+"-"+y1.getJsy())); | ||
| 888 | + t.setJzl(y1.getJzl()); | ||
| 889 | + t.setSsgsdm(y1.getGsdm()); | ||
| 890 | + String fgsdm=""; | ||
| 891 | + if(null !=carsMap.get(y1.getNbbm())){ | ||
| 892 | + fgsdm=carsMap.get(y1.getNbbm()); | ||
| 893 | + } | ||
| 894 | + t.setFgsdm(fgsdm); | ||
| 895 | + t.setJcsx(1); | ||
| 896 | + if(null !=line){ | ||
| 897 | + t.setXlbm(line.getLineCode()); | ||
| 898 | + }else{ | ||
| 899 | + t.setXlbm(""); | ||
| 900 | + } | ||
| 901 | + t.setJcsx(1); | ||
| 902 | + boolean status=true; | ||
| 903 | + for (int j = 0; j < ylListBe.size(); j++) { | ||
| 904 | + Ylb b=ylListBe.get(j); | ||
| 905 | + if(b.getNbbm().equals(y1.getNbbm())){ | ||
| 906 | + t.setCzyl(b.getJzyl()); | ||
| 907 | + status=false; | ||
| 908 | + break; | ||
| 909 | + } | ||
| 910 | + } | ||
| 911 | + if(status){ | ||
| 912 | + t.setCzyl(0.0); | ||
| 913 | + } | ||
| 914 | + t.setJzyl(Arith.add(t.getJzl(), t.getCzyl())); | ||
| 915 | + t.setYh(0.0); | ||
| 916 | + if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 917 | + t.setCreatetime(new Date()); | ||
| 918 | + try { | ||
| 919 | + repository.save(t); | ||
| 920 | + m.put(t.getName(), t.getName()); | ||
| 921 | + } catch (Exception e) { | ||
| 922 | + // TODO: handle exception | ||
| 923 | + if(e.getMessage().indexOf("PK_YLB_UK")>0){ | ||
| 924 | + newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 925 | + logger.info("核对有存油没里程:存在相同数据,数据已经过滤"); | ||
| 926 | + } | ||
| 927 | + } | ||
| 928 | + } | ||
| 929 | + } | ||
| 930 | + } | ||
| 931 | + } | ||
| 932 | + | ||
| 933 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 934 | + Nylog nylog=new Nylog(); | ||
| 935 | + nylog.setCreatedate(new Date()); | ||
| 936 | + nylog.setCzmc("核对加注量"); | ||
| 937 | + nylog.setNylx("油"); | ||
| 938 | + nylog.setUserid(user.getUserName()); | ||
| 939 | + nylog.setUsername(user.getName()); | ||
| 940 | + nylog.setCxtj(rq+"-"+gsbm+"-"+fgsbm+"-"+xlbm+"-"+nbbm+"-"); | ||
| 941 | + nylogRepository.save(nylog); | ||
| 942 | + newMap.put("status", ResponseCode.SUCCESS); | ||
| 943 | + }catch(Exception e){ | ||
| 944 | + newMap.put("status", ResponseCode.ERROR); | ||
| 945 | + logger.error("save erro.", e); | ||
| 946 | + throw e; | ||
| 947 | + } | ||
| 948 | + | ||
| 949 | + return newMap; | ||
| 950 | + } | ||
| 951 | + | ||
| 952 | + | ||
| 953 | + @Override | ||
| 954 | + public List<Map<String, Object>> oilListMonth(Map<String, Object> map) { | ||
| 955 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 956 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 957 | + | ||
| 958 | + String type=map.get("type").toString(); | ||
| 959 | + String date=map.get("date").toString().trim(); | ||
| 960 | + String gsdm=map.get("gsdm").toString(); | ||
| 961 | + String fgsdm=map.get("fgsdm").toString(); | ||
| 962 | + String date2=date.substring(0, 8)+"01"; | ||
| 963 | + String lineStr=""; | ||
| 964 | + String line =map.get("line").toString().trim(); | ||
| 965 | + /*if(line !=null && !line.equals("")){ | ||
| 966 | + lineStr =" and xlbm= '"+ line +"'"; | ||
| 967 | + }else{ | ||
| 968 | + lineStr =" and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"' "; | ||
| 969 | + } | ||
| 970 | + String sql="select a.nbbm,a.rq,a.jzyl from (" + | ||
| 971 | + " select x.nbbm,max(x.rq) as rq,max(x.jcsx) as jcsx from " | ||
| 972 | + + "(select nbbm,rq,max(jcsx) as jcsx from bsth_c_ylb where rq between '" | ||
| 973 | + + date2 +"' and '" + date+"' "+lineStr | ||
| 974 | + + " group by nbbm,rq) x group by x.nbbm ) b" | ||
| 975 | + + " left join (select nbbm,rq,jzyl,jcsx FROM bsth_c_ylb " | ||
| 976 | + + " where rq between '" | ||
| 977 | + + date2 +"' and '" + date+"' "+lineStr | ||
| 978 | + + ") a " | ||
| 979 | + + " on a.nbbm =b.nbbm and a.jcsx=b.jcsx and a.rq=b.rq " | ||
| 980 | + + " where a.nbbm is not null order by a.nbbm"; | ||
| 981 | + | ||
| 982 | + // TODO Auto-generated method stub | ||
| 983 | + List<Ylb> list =jdbcTemplate.query(sql, | ||
| 984 | + new RowMapper<Ylb>(){ | ||
| 985 | + @Override | ||
| 986 | + public Ylb mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 987 | + Ylb s = new Ylb(); | ||
| 988 | + s.setNbbm(rs.getString("nbbm")); | ||
| 989 | + s.setRq(rs.getDate("rq")); | ||
| 990 | + s.setJzyl(rs.getDouble("jzyl")); | ||
| 991 | + return s; | ||
| 992 | + } | ||
| 993 | + }); */ | ||
| 994 | + | ||
| 995 | + double qtyy=0.0;//其他用油 | ||
| 996 | + double cdyy=0.0;//车队用油 | ||
| 997 | + double byyy=0.0;//保养用油 | ||
| 998 | + double cjxx=0.0;//车间小修 | ||
| 999 | + double cjgb=0.0;//车间高保 | ||
| 1000 | + double fyyyhj=0.0;//非营运用油合计 | ||
| 1001 | + List<Ylb> listYlb=repository.listByMonthJcsx(date2, date, gsdm, fgsdm, line); | ||
| 1002 | + | ||
| 1003 | + Map<String, Object> ms=new HashMap<String,Object>(); | ||
| 1004 | + List<Ylb> list=new ArrayList<Ylb>(); | ||
| 1005 | + for (int i = 0; i < listYlb.size(); i++) { | ||
| 1006 | + Ylb t=listYlb.get(i); | ||
| 1007 | + fyyyhj =Arith.add(fyyyhj, t.getSh()); | ||
| 1008 | + if(t.getShyy()==null){ | ||
| 1009 | + qtyy=Arith.add(qtyy, t.getSh()); | ||
| 1010 | + }else{ | ||
| 1011 | + if(t.getShyy().equals("6")){ | ||
| 1012 | + cdyy=Arith.add(cdyy, t.getSh()); | ||
| 1013 | + }else if(t.getShyy().equals("2")){ | ||
| 1014 | + byyy=Arith.add(byyy, t.getSh()); | ||
| 1015 | + }else if(t.getShyy().equals("7")){ | ||
| 1016 | + cjxx=Arith.add(cjxx, t.getSh()); | ||
| 1017 | + }else if(t.getShyy().equals("8")){ | ||
| 1018 | + cjgb=Arith.add(cjgb, t.getSh()); | ||
| 1019 | + }else{ | ||
| 1020 | + qtyy=Arith.add(qtyy, t.getSh()); | ||
| 1021 | + } | ||
| 1022 | + } | ||
| 1023 | + if(ms.get(t.getNbbm())==null){ | ||
| 1024 | + ms.put(t.getNbbm(), t.getNbbm()); | ||
| 1025 | + list.add(t); | ||
| 1026 | + } | ||
| 1027 | + } | ||
| 1028 | + | ||
| 1029 | + List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); | ||
| 1030 | + int size = 0; | ||
| 1031 | + Map<String, Object> m_ = new HashMap<String, Object>(); | ||
| 1032 | + double ycyhj=0.0; | ||
| 1033 | + for(Ylb ylb : list){ | ||
| 1034 | + ycyhj=Arith.add(ycyhj, ylb.getJzyl()); | ||
| 1035 | + int x=size%3; | ||
| 1036 | + if(x==0 && size>0){ | ||
| 1037 | + mapList.add(m_); | ||
| 1038 | + m_ = new HashMap<String, Object>(); | ||
| 1039 | + } | ||
| 1040 | + size++; | ||
| 1041 | + m_.put("xh"+x, size); | ||
| 1042 | + m_.put("nbbm"+x, ylb.getNbbm()!=null?ylb.getNbbm():""); | ||
| 1043 | + m_.put("rq"+x, ylb.getRq()!=null?sdfMonth.format(ylb.getRq()):""); | ||
| 1044 | + m_.put("jzyl"+x, ylb.getJzyl()!=null?ylb.getJzyl():""); | ||
| 1045 | + | ||
| 1046 | + } | ||
| 1047 | + if(m_.get("nbbm0")!=null){ | ||
| 1048 | + if(m_.get("nbbm1")==null){ | ||
| 1049 | + m_.put("xh1", ""); | ||
| 1050 | + m_.put("nbbm1" , ""); | ||
| 1051 | + m_.put("rq1" , ""); | ||
| 1052 | + m_.put("jzyl1" , ""); | ||
| 1053 | + } | ||
| 1054 | + if(m_.get("nbbm2")==null){ | ||
| 1055 | + m_.put("xh2", ""); | ||
| 1056 | + m_.put("nbbm2" , ""); | ||
| 1057 | + m_.put("rq2" , ""); | ||
| 1058 | + m_.put("jzyl2" , ""); | ||
| 1059 | + } | ||
| 1060 | + mapList.add(m_); | ||
| 1061 | + } | ||
| 1062 | + | ||
| 1063 | + if(type != null && type.equals("export")){ | ||
| 1064 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 1065 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 1066 | + m.put("ycyhj", ycyhj); | ||
| 1067 | + m.put("qtyy", qtyy); | ||
| 1068 | + m.put("cdyy", cdyy); | ||
| 1069 | + m.put("byyy", byyy); | ||
| 1070 | + m.put("cjxx", cjxx); | ||
| 1071 | + m.put("cjgb", cjgb); | ||
| 1072 | + m.put("fyyyhj", fyyyhj); | ||
| 1073 | + ReportUtils ee = new ReportUtils(); | ||
| 1074 | + try { | ||
| 1075 | + String lineName = ""; | ||
| 1076 | + if(map.containsKey("lineName")) | ||
| 1077 | + lineName = map.get("lineName").toString(); | ||
| 1078 | + listI.add(mapList.iterator()); | ||
| 1079 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | ||
| 1080 | + ee.excelReplace(listI, new Object[] { m }, path+"mould/oilListMonth.xls", | ||
| 1081 | + path+"export/" + sdfSimple.format(sdfMonth.parse(date)) | ||
| 1082 | + + "-" + lineName + "-月存油报表.xls"); | ||
| 1083 | + } catch (Exception e) { | ||
| 1084 | + // TODO: handle exception | ||
| 1085 | + e.printStackTrace(); | ||
| 1086 | + } | ||
| 1087 | + }else{ | ||
| 1088 | + m_=new HashMap<String,Object>(); | ||
| 1089 | + m_.put("xh0", "99"); | ||
| 1090 | + m_.put("nbbm0", "存油合计:"+ycyhj +" 非营运用油: 其他用油:"+qtyy +",车队:"+cdyy+",保养用油:"+byyy | ||
| 1091 | + +",车间(小修):"+cjxx+",车间(高保):"+cjgb+",非营运用油合计:"+fyyyhj); | ||
| 1092 | + mapList.add(m_); | ||
| 1093 | + } | ||
| 1094 | + | ||
| 1095 | + return mapList; | ||
| 1096 | + } | ||
| 1097 | + | ||
| 1098 | + @Override | ||
| 1099 | + public StringBuffer checkNbmmNum(String rq, String gsbm, String fgsbm, String xlbm,String nbbm,int lx) { | ||
| 1100 | + StringBuffer stringList =new StringBuffer(); | ||
| 1101 | + List<Object[]> objectList=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 1102 | + for (int i = 0; i < objectList.size(); i++) { | ||
| 1103 | + String clbm=objectList.get(i)[0].toString()+","; | ||
| 1104 | + int cs=Integer.parseInt(objectList.get(i)[1].toString()); | ||
| 1105 | + //一车一单 | ||
| 1106 | + if(lx==1){ | ||
| 1107 | + if(cs==1){ | ||
| 1108 | + stringList.append(clbm); | ||
| 1109 | + } | ||
| 1110 | + } | ||
| 1111 | + //一车多单 | ||
| 1112 | + if(lx==2){ | ||
| 1113 | + if(cs>1){ | ||
| 1114 | + stringList.append(clbm); | ||
| 1115 | + } | ||
| 1116 | + | ||
| 1117 | + } | ||
| 1118 | + } | ||
| 1119 | + return stringList; | ||
| 1120 | + } | ||
| 1121 | + | ||
| 1122 | + | ||
| 1123 | + | ||
| 1124 | + @Override | ||
| 1125 | + public Map<String, Object> sumYlb(Map<String, Object> map) { | ||
| 1126 | + // TODO Auto-generated method stub | ||
| 1127 | + List<String> stringList=new ArrayList<String>(); | ||
| 1128 | + String rq=map.get("rq").toString(); | ||
| 1129 | + String gsbm=map.get("ssgsdm_like").toString(); | ||
| 1130 | + String fgsbm=map.get("fgsdm_like").toString(); | ||
| 1131 | + String xlbm=map.get("xlbm_like").toString().trim(); | ||
| 1132 | + String nbbm=map.get("nbbm_eq").toString(); | ||
| 1133 | + String sxtj=map.get("sxtj").toString(); | ||
| 1134 | + String type=map.get("type").toString(); | ||
| 1135 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 1136 | + List<Object[]> sumYlbList=new ArrayList<Object[]>(); | ||
| 1137 | + try { | ||
| 1138 | + if(nbbm.trim()!=""){ | ||
| 1139 | + stringList.add(nbbm); | ||
| 1140 | + }else{ | ||
| 1141 | + if(!sxtj.equals("0")){ | ||
| 1142 | + List<Object[]> objectLists; | ||
| 1143 | + if(sxtj.equals("3")){ | ||
| 1144 | + //有加油没里程 | ||
| 1145 | + objectLists=repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1146 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1147 | + String clbm=objectLists.get(i)[0].toString(); | ||
| 1148 | + double jzl=Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1149 | + double zlc=Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1150 | + if(jzl>0 && zlc<=0){ | ||
| 1151 | + stringList.add(clbm); | ||
| 1152 | + } | ||
| 1153 | + | ||
| 1154 | + } | ||
| 1155 | + | ||
| 1156 | + }else if(sxtj.equals("4")){ | ||
| 1157 | + //有里程没加油 | ||
| 1158 | + objectLists=repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1159 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1160 | + String clbm=objectLists.get(i)[0].toString(); | ||
| 1161 | + double jzl=Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1162 | + double zlc=Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1163 | + if(zlc>0 && jzl<=0){ | ||
| 1164 | + stringList.add(clbm); | ||
| 1165 | + } | ||
| 1166 | + | ||
| 1167 | + } | ||
| 1168 | + }else{ | ||
| 1169 | + objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 1170 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1171 | + String clbm=objectLists.get(i)[0].toString(); | ||
| 1172 | + int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 1173 | + //一车一单 | ||
| 1174 | + | ||
| 1175 | + if(sxtj.equals("1")){ | ||
| 1176 | + if(cs==1){ | ||
| 1177 | + stringList.add(clbm); | ||
| 1178 | + } | ||
| 1179 | + } | ||
| 1180 | + //一车多单 | ||
| 1181 | + if(sxtj.equals("2")){ | ||
| 1182 | + if(cs>1){ | ||
| 1183 | + stringList.add(clbm); | ||
| 1184 | + } | ||
| 1185 | + } | ||
| 1186 | + } | ||
| 1187 | + } | ||
| 1188 | + } | ||
| 1189 | + } | ||
| 1190 | + if(sxtj.equals("0")){ | ||
| 1191 | + sumYlbList=repository.sumYlb2(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 1192 | + }else{ | ||
| 1193 | + if(stringList.size()>0){ | ||
| 1194 | + | ||
| 1195 | +// String strings[]=new String[stringList.size()]; | ||
| 1196 | +// for(int i=0;i<stringList.size();i++){ | ||
| 1197 | +// strings[i]=stringList.get(i); | ||
| 1198 | +// } | ||
| 1199 | + if (type.equals("1")) | ||
| 1200 | + sumYlbList=repository.sumYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1201 | + else | ||
| 1202 | + sumYlbList=repository.sumYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1203 | + } | ||
| 1204 | +// else{ | ||
| 1205 | +// sumYlbList=repository.sumYlb2(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1206 | +// } | ||
| 1207 | + | ||
| 1208 | + } | ||
| 1209 | + } catch (ParseException e) { | ||
| 1210 | + // TODO Auto-generated catch block | ||
| 1211 | + e.printStackTrace(); | ||
| 1212 | + } | ||
| 1213 | + Double jzl=0.0,yh=0.0,sh=0.0; | ||
| 1214 | + for (int i = 0; i < sumYlbList.size(); i++) { | ||
| 1215 | + jzl = Arith.add(jzl, Double.valueOf(sumYlbList.get(i)[0].toString())); | ||
| 1216 | + yh = Arith.add(yh, Double.valueOf(sumYlbList.get(i)[1].toString())); | ||
| 1217 | + sh = Arith.add(sh, Double.valueOf(sumYlbList.get(i)[2].toString())); | ||
| 1218 | + } | ||
| 1219 | + | ||
| 1220 | + Map<String, Object> sumMap=new HashMap<String,Object>(); | ||
| 1221 | + sumMap.put("jzl", jzl); | ||
| 1222 | + sumMap.put("yh", yh); | ||
| 1223 | + sumMap.put("sh", sh); | ||
| 1224 | + | ||
| 1225 | +// String sql="select sum(jzl),sum(yh),sum(sh) from bsth_c_ylb " | ||
| 1226 | +// + " where to_days('"+map.get("rq").toString()+"')=to_days(rq) " | ||
| 1227 | +// + " and ssgsdm like '%"+map.get("ssgsdm_like").toString()+"%' " | ||
| 1228 | +// + " and fgsdm like '%"+map.get("fgsdm_like").toString()+"%' " | ||
| 1229 | +// + " and xlbm like '%"+map.get("xlbm_like").toString()+ "%'" | ||
| 1230 | +// + " and nbbm like '%"+map.get("nbbm_eq").toString()+"% '"; | ||
| 1231 | +// if(map.get("nbbm_in")!=null){ | ||
| 1232 | +//// sql +=" and nbbm in (" | ||
| 1233 | +// } | ||
| 1234 | + return sumMap; | ||
| 1235 | + } | ||
| 1236 | + | ||
| 1237 | + | ||
| 1238 | + | ||
| 1239 | + @Override | ||
| 1240 | + public List<Ylb> listYlb(Map<String, Object> map) { | ||
| 1241 | + // TODO Auto-generated method stub | ||
| 1242 | + List<Ylb> listYlb = new ArrayList<Ylb>(); | ||
| 1243 | + try { | ||
| 1244 | + List<String> stringList = new ArrayList<String>(); | ||
| 1245 | + String rq = map.get("rq").toString(); | ||
| 1246 | + String gsbm = map.get("ssgsdm_like").toString(); | ||
| 1247 | + String fgsbm = map.get("fgsdm_like").toString(); | ||
| 1248 | + String xlbm = map.get("xlbm_like").toString().trim(); | ||
| 1249 | + String nbbm = map.get("nbbm_eq").toString(); | ||
| 1250 | + String sxtj = map.get("sxtj").toString(); | ||
| 1251 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 1252 | + String type = map.get("type").toString(); | ||
| 1253 | + if (nbbm.trim() != "") { | ||
| 1254 | + stringList.add(nbbm); | ||
| 1255 | + List<Object[]> objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1256 | + if (objectLists.size() > 0) { | ||
| 1257 | + int cs = Integer.parseInt(objectLists.get(0)[1].toString()); | ||
| 1258 | + if (sxtj.equals("1")) { | ||
| 1259 | + if (cs == 1) { | ||
| 1260 | + if (type.equals("1")) | ||
| 1261 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1262 | + else | ||
| 1263 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1264 | + | ||
| 1265 | + } | ||
| 1266 | + } else if (sxtj.equals("2")) { | ||
| 1267 | + if (cs > 1) { | ||
| 1268 | + if (type.equals("1")) | ||
| 1269 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1270 | + else | ||
| 1271 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1272 | + } | ||
| 1273 | + } else { | ||
| 1274 | + if (type.equals("1")) | ||
| 1275 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1276 | + else | ||
| 1277 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1278 | + } | ||
| 1279 | + } | ||
| 1280 | + | ||
| 1281 | + } else { | ||
| 1282 | + // 全部 | ||
| 1283 | + if (sxtj.equals("0")) { | ||
| 1284 | + List<Object[]> objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1285 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1286 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 1287 | + stringList.add(clbm); | ||
| 1288 | + } | ||
| 1289 | + if (stringList.size() > 0) { | ||
| 1290 | + if (type.equals("1")) | ||
| 1291 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1292 | + else | ||
| 1293 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1294 | + } | ||
| 1295 | + }else if(sxtj.equals("5")){ | ||
| 1296 | + List<Object[]> objectLists = repository.checkNbmmFgs(rq, gsbm); | ||
| 1297 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1298 | + String clbm =objectLists.get(i)[0].toString(); | ||
| 1299 | + stringList.add(clbm); | ||
| 1300 | + } | ||
| 1301 | + | ||
| 1302 | + if (stringList.size() > 0) { | ||
| 1303 | + if (type.equals("1")) | ||
| 1304 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1305 | + else | ||
| 1306 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1307 | + } | ||
| 1308 | + } else { | ||
| 1309 | + List<Object[]> objectLists; | ||
| 1310 | + if (sxtj.equals("3")) { | ||
| 1311 | + // 有加油没里程 | ||
| 1312 | + objectLists = repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1313 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1314 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 1315 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1316 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1317 | + if (jzl > 0 && zlc <= 0) { | ||
| 1318 | + stringList.add(clbm); | ||
| 1319 | + } | ||
| 1320 | + | ||
| 1321 | + } | ||
| 1322 | + | ||
| 1323 | + } else if (sxtj.equals("4")) { | ||
| 1324 | + // 有里程没加油 | ||
| 1325 | + objectLists = repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1326 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1327 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 1328 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1329 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1330 | + if (zlc > 0 && jzl <= 0) { | ||
| 1331 | + stringList.add(clbm); | ||
| 1332 | + } | ||
| 1333 | + | ||
| 1334 | + } | ||
| 1335 | + } else { | ||
| 1336 | + objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1337 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1338 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 1339 | + int cs = Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 1340 | + // 一车一单 | ||
| 1341 | + if (sxtj.equals("1")) { | ||
| 1342 | + if (cs == 1) { | ||
| 1343 | + stringList.add(clbm); | ||
| 1344 | + } | ||
| 1345 | + } | ||
| 1346 | + // 一车多单 | ||
| 1347 | + if (sxtj.equals("2")) { | ||
| 1348 | + if (cs > 1) { | ||
| 1349 | + stringList.add(clbm); | ||
| 1350 | + } | ||
| 1351 | + } | ||
| 1352 | + } | ||
| 1353 | + } | ||
| 1354 | + | ||
| 1355 | + if (stringList.size() > 0) { | ||
| 1356 | + if (type.equals("1")) | ||
| 1357 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1358 | + else | ||
| 1359 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1360 | + } | ||
| 1361 | + } | ||
| 1362 | + } | ||
| 1363 | + } catch (ParseException e) { | ||
| 1364 | + // TODO Auto-generated catch block | ||
| 1365 | + e.printStackTrace(); | ||
| 1366 | + } | ||
| 1367 | + return listYlb; | ||
| 1368 | + } | ||
| 1369 | + | ||
| 1370 | + @Transactional | ||
| 1371 | + @Override | ||
| 1372 | + public Map<String, Object> saveYlbList(Map<String, Object> map) throws Exception { | ||
| 1373 | + // TODO Auto-generated method stub | ||
| 1374 | + Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 1375 | + try{ | ||
| 1376 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1377 | + String json =StringEscapeUtils.unescapeHtml4(map.get("ylbList").toString()); | ||
| 1378 | + JSONArray jsonArray=JSONArray.parseArray(json); | ||
| 1379 | + JSONObject jsonObject; | ||
| 1380 | + // 获取车辆存油信息 | ||
| 1381 | + List<Cyl> cylList = cylRepository.obtainCyl("",""); | ||
| 1382 | + for (int i = 0; i < jsonArray.size(); i++) { | ||
| 1383 | +// Ylb t=new Ylb(); | ||
| 1384 | + jsonObject=jsonArray.getJSONObject(i); | ||
| 1385 | + double czyl = jsonObject.getDoubleValue("czyl"); | ||
| 1386 | + double jzl =jsonObject.getDoubleValue("jzl"); | ||
| 1387 | + double jzyl =jsonObject.getDoubleValue("jzyl"); | ||
| 1388 | + double sh =jsonObject.getDoubleValue("sh"); | ||
| 1389 | + String shyy =jsonObject.getString("shyy"); | ||
| 1390 | + double ns = jsonObject.getDoubleValue("ns"); | ||
| 1391 | + String rylx =jsonObject.getString("rylx"); | ||
| 1392 | + int yhlx =jsonObject.getIntValue("yhlx"); | ||
| 1393 | + Integer id =jsonObject.getInteger("id"); | ||
| 1394 | + String nbbm =jsonObject.getString("nbbm"); | ||
| 1395 | + String rq=jsonObject.getString("rq"); | ||
| 1396 | + double yh = Arith.sub(Arith.add(czyl, jzl),jzyl); | ||
| 1397 | + if(yh<0){ | ||
| 1398 | + yh=0.0; | ||
| 1399 | + } | ||
| 1400 | + repository.ylbUpdate(id, czyl, jzyl, yh, sh, shyy, ns, rylx,yhlx); | ||
| 1401 | + } | ||
| 1402 | +// List<Map<String, Object>> list=(List<Map<String, Object>>) map.get("ylbList"); | ||
| 1403 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 1404 | + Nylog nylog=new Nylog(); | ||
| 1405 | + nylog.setCreatedate(new Date()); | ||
| 1406 | + nylog.setCzmc("保存全部"); | ||
| 1407 | + nylog.setNylx("油"); | ||
| 1408 | + nylog.setUserid(user.getUserName()); | ||
| 1409 | + nylog.setUsername(user.getName()); | ||
| 1410 | + nylog.setCxtj(""); | ||
| 1411 | + nylogRepository.save(nylog); | ||
| 1412 | + newMap.put("status", ResponseCode.SUCCESS); | ||
| 1413 | + }catch(Exception e){ | ||
| 1414 | + newMap.put("status", ResponseCode.ERROR); | ||
| 1415 | + logger.error("save erro.", e); | ||
| 1416 | + throw e; | ||
| 1417 | + } | ||
| 1418 | + return newMap; | ||
| 1419 | + } | ||
| 1420 | + | ||
| 1421 | + /** | ||
| 1422 | + * 拆分 | ||
| 1423 | + */ | ||
| 1424 | + @Transactional | ||
| 1425 | + @Override | ||
| 1426 | + public Map<String, Object> sort(Map<String, Object> map) throws Exception{ | ||
| 1427 | + // TODO Auto-generated method stub | ||
| 1428 | + Map<String, Object> newMap = new HashMap<String, Object>(); | ||
| 1429 | + SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1430 | + | ||
| 1431 | + try { | ||
| 1432 | + List<Cyl> cylList = cylRepository.findAll(new CustomerSpecs<Cyl>(newMap)); | ||
| 1433 | + String json =StringEscapeUtils.unescapeHtml4(map.get("ylbList").toString()); | ||
| 1434 | + String fgsbm="999"; | ||
| 1435 | + if(map.get("fgsbm")!=null){ | ||
| 1436 | + fgsbm=map.get("fgsbm").toString(); | ||
| 1437 | + } | ||
| 1438 | + JSONArray jsonArray=JSONArray.parseArray(json); | ||
| 1439 | + JSONObject jsonObject; | ||
| 1440 | + for (int x = 0; x < jsonArray.size(); x++) { | ||
| 1441 | + jsonObject=jsonArray.getJSONObject(x); | ||
| 1442 | + Double yl =jsonObject.getDoubleValue("jzyl"); | ||
| 1443 | + Double sh =jsonObject.getDoubleValue("sh"); | ||
| 1444 | + String shyy =jsonObject.getString("shyy"); | ||
| 1445 | + Double ns = jsonObject.getDoubleValue("ns"); | ||
| 1446 | + String rylx =jsonObject.getString("rylx"); | ||
| 1447 | + Integer id =jsonObject.getInteger("id"); | ||
| 1448 | + Ylb ylb = repository.findById(id).get(); | ||
| 1449 | + String nbbm_eq = ylb.getNbbm(); | ||
| 1450 | + Date rq_eq = ylb.getRq(); | ||
| 1451 | + // 得到一天总的加油和里程(根据车,时间) | ||
| 1452 | + List<Object[]> sumList=new ArrayList<Object[]>(); | ||
| 1453 | + if(fgsbm.equals("")) | ||
| 1454 | + sumList = repository.sumLcYl(nbbm_eq, rq_eq,"",ylb.getSsgsdm(),fgsbm); | ||
| 1455 | + else | ||
| 1456 | + sumList = repository.sumLcYl(nbbm_eq, rq_eq,"",ylb.getSsgsdm(),ylb.getFgsdm()); | ||
| 1457 | + | ||
| 1458 | + // 保存总的加油量 | ||
| 1459 | + Double jzl = 0.0; | ||
| 1460 | + // 保存总的里程 | ||
| 1461 | + Double zlc = 0.0; | ||
| 1462 | + //保存总的损耗 | ||
| 1463 | + Double zsh = 0.0; | ||
| 1464 | + for (int j = 0; j < sumList.size(); j++) { | ||
| 1465 | + jzl = Arith.add(jzl, Double.valueOf(sumList.get(j)[0].toString())); | ||
| 1466 | + zlc = Arith.add(zlc, Double.valueOf(sumList.get(j)[1].toString())); | ||
| 1467 | + zsh = Arith.add(zsh, Double.valueOf(sumList.get(j)[2].toString())); | ||
| 1468 | + } | ||
| 1469 | +// jzl = Arith.sub(jzl, zsh); | ||
| 1470 | + //新的 损耗不等于 旧的损耗 总损耗从新算 | ||
| 1471 | + /*if(Arith.sub(ylb.getSh(),sh )!=0){ | ||
| 1472 | + zsh =Arith.add(Arith.sub(zsh, ylb.getSh()), sh); | ||
| 1473 | + jzl =Arith.sub(jzl, zsh); | ||
| 1474 | + }else{ | ||
| 1475 | + jzl =Arith.sub(jzl, zsh); | ||
| 1476 | + }*/ | ||
| 1477 | + map.put("nbbm_eq", nbbm_eq); | ||
| 1478 | + map.put("rq_eq", rq_eq); | ||
| 1479 | + List<Ylb> iterator2=null; | ||
| 1480 | + if(fgsbm.equals("")) | ||
| 1481 | + iterator2=this.listOrderBy(sdf.format(rq_eq),ylb.getSsgsdm(),fgsbm,"", | ||
| 1482 | + ylb.getNbbm(),"jcsx"); | ||
| 1483 | + else | ||
| 1484 | + iterator2=this.listOrderBy(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"", | ||
| 1485 | + ylb.getNbbm(),"jcsx"); | ||
| 1486 | + | ||
| 1487 | +// repository.obtainYl(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"", | ||
| 1488 | +// ylb.getNbbm(),"jcsx"); | ||
| 1489 | + DecimalFormat df = new DecimalFormat("#.000"); | ||
| 1490 | + Double zyl = 0.0; | ||
| 1491 | + Double nextJzyl = 0.0; | ||
| 1492 | + // 车的,进,出油量及耗油 | ||
| 1493 | + double czyl=0.0; | ||
| 1494 | + for (int i = 0; i < iterator2.size(); i++) { | ||
| 1495 | + Ylb t = iterator2.get(i); | ||
| 1496 | + if (t.getJcsx() == 1) { | ||
| 1497 | + if(t.getId()==id){ | ||
| 1498 | + t.setSh(sh); | ||
| 1499 | + t.setShyy(shyy); | ||
| 1500 | + } | ||
| 1501 | + czyl=t.getCzyl(); | ||
| 1502 | + Double jcyl = t.getCzyl(); | ||
| 1503 | + zyl = Arith.sub(Arith.add(jcyl, jzl), yl); | ||
| 1504 | + Double yh = 0.0; | ||
| 1505 | + if (zlc > 0 && t.getZlc() > 0) { | ||
| 1506 | + yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 1507 | + } | ||
| 1508 | + nextJzyl =Arith.sub(Arith.add(t.getJzl(), t.getCzyl()), yh); | ||
| 1509 | +// nextJzyl =Arith.sub(Arith.add(t.getJzl(), t.getCzyl()), Arith.add(yh, t.getSh())); | ||
| 1510 | + if(zlc>0 && t.getZlc() > 0){ | ||
| 1511 | + long l=Math.round(nextJzyl); | ||
| 1512 | + double ylxs=l*100/100; | ||
| 1513 | +// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | ||
| 1514 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 1515 | + t.setYh(yh); | ||
| 1516 | + t.setJzyl(ylxs); | ||
| 1517 | + nextJzyl=ylxs; | ||
| 1518 | + }else{ | ||
| 1519 | + t.setYh(yh); | ||
| 1520 | + t.setJzyl(nextJzyl); | ||
| 1521 | + } | ||
| 1522 | + } else { | ||
| 1523 | + if(t.getId()==id){ | ||
| 1524 | + t.setSh(sh); | ||
| 1525 | + t.setShyy(shyy); | ||
| 1526 | + } | ||
| 1527 | + t.setCzyl(nextJzyl); | ||
| 1528 | + Double yh =0.0; | ||
| 1529 | + if (t.getZlc() >= 0) { | ||
| 1530 | + yh= Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 1531 | + } | ||
| 1532 | +// nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), Arith.add(yh, t.getSh())); | ||
| 1533 | + nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), yh); | ||
| 1534 | + if(zlc>0 && t.getZlc() >0){ | ||
| 1535 | + long l=0l; | ||
| 1536 | + double ylxs=0.0; | ||
| 1537 | + if(i==iterator2.size()-1){ | ||
| 1538 | + ylxs=yl; | ||
| 1539 | + }else{ | ||
| 1540 | + l=Math.round(nextJzyl); | ||
| 1541 | + ylxs=l*100/100; | ||
| 1542 | + } | ||
| 1543 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 1544 | + t.setYh(yh); | ||
| 1545 | + t.setJzyl(ylxs); | ||
| 1546 | + nextJzyl=ylxs; | ||
| 1547 | + }else{ | ||
| 1548 | + t.setYh(yh); | ||
| 1549 | + t.setJzyl(nextJzyl); | ||
| 1550 | + } | ||
| 1551 | + } | ||
| 1552 | + if(t.getJzyl()<0){ | ||
| 1553 | + t.setJzyl(0.0); | ||
| 1554 | + } | ||
| 1555 | + if(t.getCzyl()<0){ | ||
| 1556 | + t.setCzyl(0.0); | ||
| 1557 | + } | ||
| 1558 | + if(t.getYh()<0){ | ||
| 1559 | + t.setYh(0.0); | ||
| 1560 | + } | ||
| 1561 | + if(t.getSh()<0){ | ||
| 1562 | + t.setSh(0.0); | ||
| 1563 | + } | ||
| 1564 | + repository.save(t); | ||
| 1565 | + } | ||
| 1566 | + newMap.put("status", ResponseCode.SUCCESS); | ||
| 1567 | + } | ||
| 1568 | + | ||
| 1569 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 1570 | + Nylog nylog=new Nylog(); | ||
| 1571 | + nylog.setCreatedate(new Date()); | ||
| 1572 | + nylog.setCzmc("拆分"); | ||
| 1573 | + nylog.setNylx("油"); | ||
| 1574 | + nylog.setUserid(user.getUserName()); | ||
| 1575 | + nylog.setUsername(user.getName()); | ||
| 1576 | + nylog.setCxtj(""); | ||
| 1577 | + nylogRepository.save(nylog); | ||
| 1578 | + } catch (Exception e) { | ||
| 1579 | + newMap.put("status", ResponseCode.ERROR); | ||
| 1580 | + logger.error("save erro.", e); | ||
| 1581 | + throw e; | ||
| 1582 | + } | ||
| 1583 | + return newMap; | ||
| 1584 | + } | ||
| 1585 | + | ||
| 1586 | + | ||
| 1587 | + @Override | ||
| 1588 | + public String checkJsy(Map<String, Object> map) { | ||
| 1589 | + // TODO Auto-generated method stub | ||
| 1590 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1591 | + String rq=map.get("date").toString(); | ||
| 1592 | + String nbbm=map.get("nbbm").toString(); | ||
| 1593 | + String jsy =map.get("jsy").toString(); | ||
| 1594 | + String xlbm=map.get("xlbm").toString(); | ||
| 1595 | + List<Ylb> list= repository.checkYlb(rq, nbbm, jsy,xlbm,"nbbm"); | ||
| 1596 | + String type="1"; | ||
| 1597 | + if(list.size()>0){ | ||
| 1598 | + type="0"; | ||
| 1599 | + } | ||
| 1600 | + return type; | ||
| 1603 | } | 1601 | } |
| 1604 | 1602 | ||
| 1605 | @Override | 1603 | @Override |
| @@ -1671,518 +1669,518 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1671,518 +1669,518 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1671 | modify_rights_close_pj = true; | 1669 | modify_rights_close_pj = true; |
| 1672 | } | 1670 | } |
| 1673 | return modify_rights_close_pj?"权限关闭":"权限打开"; | 1671 | return modify_rights_close_pj?"权限关闭":"权限打开"; |
| 1674 | - } | ||
| 1675 | - | ||
| 1676 | - | ||
| 1677 | - | ||
| 1678 | - @Override | ||
| 1679 | - public Map<String, Object> saveYlb(Ylb t) { | ||
| 1680 | - Map<String, Object> map = new HashMap<>(); | ||
| 1681 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1682 | - String rq=sdf.format(t.getRq()); | ||
| 1683 | - String gsdm=t.getSsgsdm(); | ||
| 1684 | - String fgsdm=t.getFgsdm(); | ||
| 1685 | - String xlbm=t.getXlbm(); | ||
| 1686 | - String jhsj=t.getJhsj(); | ||
| 1687 | - String jsy=t.getJsy(); | ||
| 1688 | - String nbbm=t.getNbbm(); | ||
| 1689 | - t.setCreatetime(new Date()); | ||
| 1690 | - String[] jhsjStr = jhsj.split(":"); | ||
| 1691 | - long fcsjL= Long.parseLong(jhsjStr[0])*60+Long.parseLong(jhsjStr[1]); | ||
| 1692 | - List<Ylb> list=this.listOrderBy(rq, gsdm, fgsdm, xlbm, nbbm, "jhsj"); | ||
| 1693 | -// repository.obtainYl(rq, gsdm, fgsdm, xlbm, nbbm, "jhsj"); | ||
| 1694 | - int jcsx=1; | ||
| 1695 | - if(list.size()>0){ | ||
| 1696 | - for (int i = 0; i < list.size(); i++) { | ||
| 1697 | - Ylb y=list.get(i); | ||
| 1698 | - String[] fcsjStr = y.getJhsj().split(":"); | ||
| 1699 | - long fcsj=Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 1700 | - if(fcsjL>fcsj){ | ||
| 1701 | - jcsx=jcsx+y.getJcsx(); | ||
| 1702 | - }else{ | ||
| 1703 | - y.setJcsx(y.getJcsx()+1); | ||
| 1704 | - repository.save(y); | ||
| 1705 | - } | ||
| 1706 | - } | ||
| 1707 | - | ||
| 1708 | - } | ||
| 1709 | - t.setJcsx(jcsx); | ||
| 1710 | - repository.save(t); | ||
| 1711 | - | ||
| 1712 | - SysUser user = SecurityUtils.getCurrentUser(); | ||
| 1713 | - Nylog nylog=new Nylog(); | ||
| 1714 | - nylog.setCreatedate(new Date()); | ||
| 1715 | - nylog.setCzmc("手动添加"); | ||
| 1716 | - nylog.setNylx("油"); | ||
| 1717 | - nylog.setUserid(user.getUserName()); | ||
| 1718 | - nylog.setUsername(user.getName()); | ||
| 1719 | - nylog.setCxtj(""); | ||
| 1720 | - nylogRepository.save(nylog); | ||
| 1721 | - map.put("status", ResponseCode.SUCCESS); | ||
| 1722 | - map.put("t", t); | ||
| 1723 | - return map; | ||
| 1724 | - } | ||
| 1725 | - @Transactional | ||
| 1726 | - @Override | ||
| 1727 | - public Map<String, Object> deleteIds(Map<String, Object> map) throws Exception{ | ||
| 1728 | - // TODO Auto-generated method stub | ||
| 1729 | - Map<String, Object> maps = new HashMap<>(); | ||
| 1730 | - try{ | ||
| 1731 | - String json =StringEscapeUtils.unescapeHtml4(map.get("ids").toString()); | ||
| 1732 | - JSONArray jsonArray=JSONArray.parseArray(json); | ||
| 1733 | - JSONObject jsonObject; | ||
| 1734 | - for (int x = 0; x < jsonArray.size(); x++) { | ||
| 1735 | - jsonObject=jsonArray.getJSONObject(x); | ||
| 1736 | - Integer id =jsonObject.getInteger("id"); | ||
| 1737 | - repository.deleteById(id); | ||
| 1738 | - } | ||
| 1739 | - | ||
| 1740 | - SysUser user = SecurityUtils.getCurrentUser(); | ||
| 1741 | - Nylog nylog=new Nylog(); | ||
| 1742 | - nylog.setCreatedate(new Date()); | ||
| 1743 | - nylog.setCzmc("删除"); | ||
| 1744 | - nylog.setNylx("油"); | ||
| 1745 | - nylog.setUserid(user.getUserName()); | ||
| 1746 | - nylog.setUsername(user.getName()); | ||
| 1747 | - nylog.setCxtj(""); | ||
| 1748 | - nylogRepository.save(nylog); | ||
| 1749 | - maps.put("status", ResponseCode.SUCCESS); | ||
| 1750 | - } catch (Exception e) { | ||
| 1751 | - maps.put("status", ResponseCode.ERROR); | ||
| 1752 | - logger.error("save erro.", e); | ||
| 1753 | - throw e; | ||
| 1754 | - } | ||
| 1755 | - return maps; | ||
| 1756 | - } | ||
| 1757 | - | ||
| 1758 | - public List<Ylb> listOrderBy(String rq,String gsdm, | ||
| 1759 | - String fgsdm,String xlbm,String nbbm, | ||
| 1760 | - String px) { | ||
| 1761 | - // TODO Auto-generated method stub | ||
| 1762 | - String sql="SELECT * FROM bsth_c_ylb " | ||
| 1763 | - + " where rq ='"+rq+"' and ssgsdm like '%"+gsdm+"%' " | ||
| 1764 | - + " and fgsdm like '%"+fgsdm+"%'"; | ||
| 1765 | - if(xlbm.equals("")){ | ||
| 1766 | - sql+= " and xlbm like '%"+xlbm+"%' "; | ||
| 1767 | - }else{ | ||
| 1768 | - sql+= " and xlbm = '"+xlbm+"' "; | ||
| 1769 | - } | ||
| 1770 | - | ||
| 1771 | - sql += "and nbbm like '%"+nbbm+"%' order by "+px+" asc "; | ||
| 1772 | - | ||
| 1773 | - List<Ylb> list = jdbcTemplate.query(sql, new RowMapper<Ylb>() { | ||
| 1774 | - @Override | ||
| 1775 | - public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 1776 | - Ylb y = new Ylb(); | ||
| 1777 | - y.setId(arg0.getInt("id")); | ||
| 1778 | - return y; | ||
| 1779 | - } | ||
| 1780 | - }); | ||
| 1781 | - List<Ylb> lists=new ArrayList<Ylb>(); | ||
| 1782 | - List<Ylb> ylbLists=repository.obtainYl(rq,gsdm,fgsdm,xlbm,nbbm,"jcsx"); | ||
| 1783 | - for (int i = 0; i < list.size(); i++) { | ||
| 1784 | - Ylb t=list.get(i); | ||
| 1785 | - for (int j = 0; j < ylbLists.size(); j++) { | ||
| 1786 | - Ylb t2=ylbLists.get(j); | ||
| 1787 | - if(t.getId().intValue()==t2.getId().intValue()){ | ||
| 1788 | - lists.add(t2); | ||
| 1789 | - break; | ||
| 1790 | - } | ||
| 1791 | - } | ||
| 1792 | - } | ||
| 1793 | - | ||
| 1794 | - return lists; | ||
| 1795 | - } | ||
| 1796 | - | ||
| 1797 | - @Override | ||
| 1798 | - public Map<String, Object> updateHistory(Map<String, Object> map) throws Exception { | ||
| 1799 | - // TODO Auto-generated method stub | ||
| 1800 | - Map<String, Object> newMap = new HashMap<String, Object>(); | ||
| 1801 | - | ||
| 1802 | - List<Cars> carsList = carsRepository.findCars(); | ||
| 1803 | - Map<String, Boolean> carsMap = new HashMap<String, Boolean>(); | ||
| 1804 | - for (int i = 0; i < carsList.size(); i++) { | ||
| 1805 | - Cars c = carsList.get(i); | ||
| 1806 | - carsMap.put(c.getInsideCode(), c.getSfdc()); | ||
| 1807 | - } | ||
| 1808 | - try{ | ||
| 1809 | - String date = map.get("date").toString(); | ||
| 1810 | - String line = map.get("line").toString(); | ||
| 1811 | - List<Line> listLine=lineRepository.findLineByCode(line); | ||
| 1812 | - String gsdm =""; | ||
| 1813 | - String fgsdm =""; | ||
| 1814 | - if(listLine.size()>0){ | ||
| 1815 | - Line l=listLine.get(0); | ||
| 1816 | - gsdm=l.getCompany(); | ||
| 1817 | - fgsdm=l.getBrancheCompany(); | ||
| 1818 | - } | ||
| 1819 | - | ||
| 1820 | - String nbbmstr=""; | ||
| 1821 | - List<Map<String, Object>> listpbYc=new ArrayList<Map<String, Object>>();//油车数据 | ||
| 1822 | - List<Map<String, Object>> listpbDc=new ArrayList<Map<String, Object>>();//电车数据 | ||
| 1823 | - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("", date,gsdm, fgsdm, "", ""); | ||
| 1824 | - for (int i = 0; i < listpb.size(); i++) { | ||
| 1825 | - if(listpb.get(i).get("xlBm").toString().equals(line)){ | ||
| 1826 | - nbbmstr +=listpb.get(i).get("clZbh").toString(); | ||
| 1827 | - } | ||
| 1828 | - } | ||
| 1829 | - for (int i = 0; i < listpb.size(); i++) { | ||
| 1830 | - boolean sfdc=true; | ||
| 1831 | - Map<String, Object> m = listpb.get(i); | ||
| 1832 | - if (carsMap.get(m.get("clZbh").toString()) != null) { | ||
| 1833 | - sfdc = carsMap.get(m.get("clZbh").toString()); | ||
| 1834 | - } else { | ||
| 1835 | - sfdc = true; | ||
| 1836 | - } | ||
| 1837 | - if(nbbmstr.indexOf(m.get("clZbh").toString())>-1){ | ||
| 1838 | - if(sfdc){ | ||
| 1839 | - listpbDc.add(m); | ||
| 1840 | - }else{ | ||
| 1841 | - listpbYc.add(m); | ||
| 1842 | - } | ||
| 1843 | - } | ||
| 1844 | - } | ||
| 1845 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1846 | - //初始存油量 | ||
| 1847 | - List<Cyl> clyList = cylRepository.obtainCyl("",gsdm); | ||
| 1848 | - List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(date, 0,gsdm); | ||
| 1849 | - //重新统计油车数据开始 | ||
| 1850 | - List<Ylb> ylListBe =repository.listByRqJcsx(date, gsdm, fgsdm, "", ""); | ||
| 1851 | - List<Ylb> ylbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); | ||
| 1852 | - List<Ylb> ylbList_upd=new ArrayList<Ylb>(); | ||
| 1853 | - List<Ylb> ylbList_del=new ArrayList<Ylb>(); | ||
| 1854 | - | ||
| 1855 | - for (int j = 0; j < ylbList.size(); j++) { | ||
| 1856 | - Ylb t=ylbList.get(j); | ||
| 1857 | - boolean fage=true; | ||
| 1858 | - if(StringUtils.isEmpty(t.getLp())){ | ||
| 1859 | - fage=false; | ||
| 1860 | - }else{ | ||
| 1861 | - for (int i = 0; i < listpbYc.size(); i++) { | ||
| 1862 | - Map<String, Object> m = listpbYc.get(i); | ||
| 1863 | - if(t.getNbbm().equals(m.get("clZbh").toString()) | ||
| 1864 | - &&t.getJsy().equals(m.get("jGh").toString()) | ||
| 1865 | - &&t.getXlbm().equals(m.get("xlBm").toString()) | ||
| 1866 | - &&t.getLp().equals(m.get("lpName").toString())){ | ||
| 1867 | - //该条记录不用删除 | ||
| 1868 | - fage =false; | ||
| 1869 | - ylbList_upd.add(t); | ||
| 1870 | - } | ||
| 1871 | - } | ||
| 1872 | - } | ||
| 1873 | - if(fage){ | ||
| 1874 | - if(t.getXlbm().equals(line)){ | ||
| 1875 | - ylbList_del.add(t); | ||
| 1876 | - } | ||
| 1877 | - } | ||
| 1878 | - | ||
| 1879 | - } | ||
| 1880 | - String nbbmStr=""; | ||
| 1881 | - List<Ylb> list=new ArrayList<Ylb>(); | ||
| 1882 | - /* | ||
| 1883 | - * 第一步 修改车辆里程 和加注量 | ||
| 1884 | - */ | ||
| 1885 | - Map<String, Object> ylMap=new HashMap<String, Object>(); | ||
| 1886 | - for (int x = 0; x < listpbYc.size(); x++) { | ||
| 1887 | - String type = "add"; | ||
| 1888 | - Map<String, Object> maps = listpbYc.get(x); | ||
| 1889 | - // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | ||
| 1890 | - Ylb t = new Ylb(); | ||
| 1891 | - for (int k = 0; k < ylbList_upd.size(); k++) { | ||
| 1892 | - Ylb t1 = ylbList_upd.get(k); | ||
| 1893 | - if (t1.getNbbm().equals(maps.get("clZbh").toString()) | ||
| 1894 | - && t1.getJsy().equals(maps.get("jGh").toString()) | ||
| 1895 | - && t1.getXlbm().equals(maps.get("xlBm").toString()) | ||
| 1896 | - && t1.getLp().equals(maps.get("lpName").toString())) { | ||
| 1897 | - t = t1; | ||
| 1898 | - type = "update"; | ||
| 1899 | - } | ||
| 1900 | - } | ||
| 1901 | - if(type.equals("add")){ | ||
| 1902 | - // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | ||
| 1903 | - if (maps.get("seqNumber").toString().equals("1")) { | ||
| 1904 | - boolean fage = true; | ||
| 1905 | - for (int i = 0; i < ylListBe.size(); i++) { | ||
| 1906 | - Ylb ylb = ylListBe.get(i); | ||
| 1907 | - if (maps.get("clZbh").toString().equals(ylb.getNbbm())) { | ||
| 1908 | - if(ylb.getJzyl()>=0){ | ||
| 1909 | - t.setCzyl(ylb.getJzyl()); | ||
| 1910 | - fage = false; | ||
| 1911 | - break; | ||
| 1912 | - } | ||
| 1913 | - } | ||
| 1914 | - } | ||
| 1915 | - if (fage) { | ||
| 1916 | - for (int y = 0; y < clyList.size(); y++) { | ||
| 1917 | - Cyl cyl = clyList.get(y); | ||
| 1918 | - if (maps.get("clZbh").toString().equals(cyl.getNbbm())) { | ||
| 1919 | - if(cyl!=null){ | ||
| 1920 | - if(cyl.getCyl()>=0){ | ||
| 1921 | - t.setCzyl(cyl.getCyl()); | ||
| 1922 | - fage = false; | ||
| 1923 | - break; | ||
| 1924 | - }else { | ||
| 1925 | - if(cyl.getCxrl()!=null){ | ||
| 1926 | - if(cyl.getCxrl()>0){ | ||
| 1927 | - t.setCzyl(cyl.getCxrl()); | ||
| 1928 | - fage = false; | ||
| 1929 | - break; | ||
| 1930 | - } | ||
| 1931 | - } | ||
| 1932 | - } | ||
| 1933 | - } | ||
| 1934 | - } | ||
| 1935 | - } | ||
| 1936 | - } | ||
| 1937 | - if (fage) { | ||
| 1938 | - t.setCzyl(0.0); | ||
| 1939 | - } | ||
| 1940 | - } | ||
| 1941 | - } | ||
| 1942 | - | ||
| 1943 | - Double jzl = 0.0; | ||
| 1944 | - //一人一车加注量只匹配一次 | ||
| 1945 | - if(ylMap.get(maps.get("clZbh").toString()+"_"+ maps.get("jGh").toString())!=null){ | ||
| 1946 | - }else{ | ||
| 1947 | - boolean fage2=false; | ||
| 1948 | - for (int i = 0; i < ylxxList.size(); i++) { | ||
| 1949 | - Ylxxb ylxxb = ylxxList.get(i); | ||
| 1950 | - if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 1951 | - && maps.get("jGh").toString().equals(ylxxb.getJsy()) | ||
| 1952 | - && ylxxb.getJylx()==1) { | ||
| 1953 | - if(ylxxb.getJzl()>0){ | ||
| 1954 | - fage2=true; | ||
| 1955 | - } | ||
| 1956 | - } | ||
| 1957 | - } | ||
| 1958 | - //车辆的加注量如果有任工干预,略接口过来 数据 | ||
| 1959 | - if(fage2){ | ||
| 1960 | - // 把当天手工输入的的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断,加油类型为1) | ||
| 1961 | - for (int j = 0; j < ylxxList.size(); j++) { | ||
| 1962 | - Ylxxb ylxxb = ylxxList.get(j); | ||
| 1963 | - if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 1964 | - && maps.get("jGh").toString().equals(ylxxb.getJsy()) | ||
| 1965 | - && ylxxb.getJylx()==1) { | ||
| 1966 | - jzl =Arith.add(jzl, ylxxb.getJzl()); | ||
| 1967 | - } | ||
| 1968 | - } | ||
| 1969 | - ylMap.put(maps.get("clZbh").toString()+"_"+ maps.get("jGh").toString(),maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); | ||
| 1970 | - }else{ | ||
| 1971 | - // 把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | ||
| 1972 | - for (int j = 0; j < ylxxList.size(); j++) { | ||
| 1973 | - Ylxxb ylxxb = ylxxList.get(j); | ||
| 1974 | - if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 1975 | - && maps.get("jGh").toString().equals(ylxxb.getJsy())) { | ||
| 1976 | - jzl =Arith.add(jzl, ylxxb.getJzl()); | ||
| 1977 | - } | ||
| 1978 | - } | ||
| 1979 | - ylMap.put(maps.get("clZbh").toString()+"_"+ maps.get("jGh").toString(),maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); | ||
| 1980 | - } | ||
| 1981 | - } | ||
| 1982 | - t.setJzl(jzl); | ||
| 1983 | - t.setNbbm(maps.get("clZbh").toString()); | ||
| 1984 | - t.setJsy(maps.get("jGh") == null ? "" : maps.get("jGh").toString()); | ||
| 1985 | - t.setJname(maps.get("jName").toString()); | ||
| 1986 | - t.setZlc(maps.get("totalKilometers") == null ? 0.0 | ||
| 1987 | - : Double.parseDouble(maps.get("totalKilometers").toString())); | ||
| 1988 | - t.setXlbm(maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); | ||
| 1989 | - t.setJcsx(Integer.parseInt(maps.get("seqNumber").toString())); | ||
| 1990 | - t.setSsgsdm(maps.get("company") == null ? "" : maps.get("company").toString()); | ||
| 1991 | - t.setFgsdm(maps.get("bCompany") == null ? "" : maps.get("bCompany").toString()); | ||
| 1992 | - t.setJhsj(maps.get("fcsj")==null?"":maps.get("fcsj").toString()); | ||
| 1993 | - t.setRq(sdf.parse(date)); | ||
| 1994 | - t.setLp(maps.get("lpName")==null?"":maps.get("lpName").toString()); | ||
| 1995 | - if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 1996 | - if(type.equals("add")){ | ||
| 1997 | - if(nbbmStr.indexOf(t.getNbbm())<0){ | ||
| 1998 | - nbbmStr +=t.getNbbm()+","; | ||
| 1999 | - } | ||
| 2000 | - t.setCreatetime(new Date()); | ||
| 2001 | - }else{ | ||
| 2002 | - t.setUpdatetime(new Date()); | ||
| 2003 | - } | ||
| 2004 | - } | ||
| 2005 | - try { | ||
| 2006 | - repository.save(t); | ||
| 2007 | - } catch (Exception e) { | ||
| 2008 | - // TODO: handle exception | ||
| 2009 | - if(e.getMessage().indexOf("PK_YLB_UK")>0){ | ||
| 2010 | - newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 2011 | - logger.info("油量存在相同数据,数据已经过滤"); | ||
| 2012 | - } | ||
| 2013 | - } | ||
| 2014 | - | ||
| 2015 | - } | ||
| 2016 | - for (int i = 0; i < ylbList_del.size(); i++) { | ||
| 2017 | - Ylb y=ylbList_del.get(i); | ||
| 2018 | - if(nbbmStr.indexOf(y.getNbbm())<0){ | ||
| 2019 | - nbbmStr +=y.getNbbm()+","; | ||
| 2020 | - } | ||
| 2021 | - repository.deleteById(y.getId()); | ||
| 2022 | - } | ||
| 2023 | - | ||
| 2024 | - //重新计算删除了的或者新增了的车的车的油耗信息(考虑车辆可能跨线路,从分公司赛选计算) | ||
| 2025 | - double czyl=0.0; | ||
| 2026 | - List<Ylb> iterator2=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm,jcsx"); | ||
| 2027 | - String[] nbbms=nbbmStr.split(","); | ||
| 2028 | - for (int i = 0; i < nbbms.length; i++) { | ||
| 2029 | - String clzbm=nbbms[i]; | ||
| 2030 | - // 得到一天总的加油和里程(根据车,时间) | ||
| 2031 | - List<Object[]> sumList = repository.sumLcYl(clzbm, sdf.parse(date),"",gsdm,fgsdm); | ||
| 2032 | - // 保存总的加油量 | ||
| 2033 | - Double jzl = 0.0; | ||
| 2034 | - // 保存总的里程 | ||
| 2035 | - Double zlc = 0.0; | ||
| 2036 | - for (int j = 0; j < sumList.size(); j++) { | ||
| 2037 | - jzl = Arith.add(jzl, Double.valueOf(sumList.get(j)[0].toString())); | ||
| 2038 | - zlc = Arith.add(zlc, Double.valueOf(sumList.get(j)[1].toString())); | ||
| 2039 | - } | ||
| 2040 | - // 保留两位小数 | ||
| 2041 | - DecimalFormat df = new DecimalFormat("#.00"); | ||
| 2042 | - Double zyl = 0.0; | ||
| 2043 | - Double nextJzyl = 0.0; | ||
| 2044 | - for (int j = 0; j < iterator2.size(); j++) { | ||
| 2045 | - Ylb t = iterator2.get(j); | ||
| 2046 | - if(t.getNbbm().equals(clzbm)){ | ||
| 2047 | - if (t.getJcsx() == 1) { | ||
| 2048 | - // 进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量 | ||
| 2049 | - czyl = t.getCzyl(); | ||
| 2050 | - zyl =jzl; | ||
| 2051 | - Double yh=0.0; | ||
| 2052 | - if(zlc>0 ){ | ||
| 2053 | - yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 2054 | - } | ||
| 2055 | - nextJzyl =Arith.sub( Arith.add(t.getJzl(), t.getCzyl()),yh); | ||
| 2056 | - //把进场油量的小数和整数分别取出 | ||
| 2057 | - if(zlc>0 && t.getZlc()>0){ | ||
| 2058 | - long l=Math.round(nextJzyl); | ||
| 2059 | - double ylxs=l*100/100; | ||
| 2060 | - yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 2061 | - t.setYh(yh); | ||
| 2062 | - t.setJzyl(ylxs); | ||
| 2063 | - nextJzyl=ylxs; | ||
| 2064 | - }else{ | ||
| 2065 | - t.setYh(yh); | ||
| 2066 | - t.setJzyl(nextJzyl); | ||
| 2067 | - } | ||
| 2068 | - } else { | ||
| 2069 | - t.setCzyl(nextJzyl); | ||
| 2070 | - Double yh=0.0; | ||
| 2071 | - if(zlc>0){ | ||
| 2072 | - yh= Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 2073 | - } | ||
| 2074 | - nextJzyl =Arith.sub( Arith.add(t.getJzl(),nextJzyl),yh); | ||
| 2075 | - if(zlc>0 && t.getZlc()>0){ | ||
| 2076 | - long l=0l; | ||
| 2077 | - double ylxs=0.0; | ||
| 2078 | - if(j==iterator2.size()-1){ | ||
| 2079 | - ylxs=czyl; | ||
| 2080 | - }else{ | ||
| 2081 | - if(iterator2.get(j+1).getNbbm().equals(t.getNbbm())){ | ||
| 2082 | - l=Math.round(nextJzyl); | ||
| 2083 | - ylxs=l*100/100; | ||
| 2084 | - }else{ | ||
| 2085 | - ylxs=czyl; | ||
| 2086 | - } | ||
| 2087 | - | ||
| 2088 | - } | ||
| 2089 | - yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 2090 | - t.setYh(yh); | ||
| 2091 | - t.setJzyl(ylxs); | ||
| 2092 | - nextJzyl=ylxs; | ||
| 2093 | - }else{ | ||
| 2094 | - t.setYh(yh); | ||
| 2095 | - t.setJzyl(nextJzyl); | ||
| 2096 | - } | ||
| 2097 | - } | ||
| 2098 | - if(t.getJzyl()<0){ | ||
| 2099 | - t.setJzyl(0.0); | ||
| 2100 | - } | ||
| 2101 | - if(t.getCzyl()<0){ | ||
| 2102 | - t.setCzyl(0.0); | ||
| 2103 | - } | ||
| 2104 | - if(t.getYh()<0){ | ||
| 2105 | - t.setYh(0.0); | ||
| 2106 | - } | ||
| 2107 | - if(t.getSh()<0){ | ||
| 2108 | - t.setSh(0.0); | ||
| 2109 | - } | ||
| 2110 | - repository.save(t); | ||
| 2111 | - } | ||
| 2112 | - } | ||
| 2113 | - } | ||
| 2114 | - | ||
| 2115 | - //重新统计油车数据结束 | ||
| 2116 | - | ||
| 2117 | - | ||
| 2118 | - //重新获取电耗数据开始 | ||
| 2119 | - Map<String, List<Dlb>> mapList=dlbService.updeteHistory(listpbDc, date, gsdm, fgsdm, line); | ||
| 2120 | - List<Dlb> delDlb=mapList.get("delList"); | ||
| 2121 | - for (int i = 0; i < delDlb.size(); i++) { | ||
| 2122 | - Dlb d=delDlb.get(i); | ||
| 2123 | - dlbRepository.deleteById(d.getId()); | ||
| 2124 | - } | ||
| 2125 | - List<Dlb> updDlb=mapList.get("updList"); | ||
| 2126 | - for (int i = 0; i < updDlb.size(); i++) { | ||
| 2127 | - Dlb d=updDlb.get(i); | ||
| 2128 | - try { | ||
| 2129 | - dlbRepository.save(d); | ||
| 2130 | - } catch (Exception e) { | ||
| 2131 | - // TODO: handle exception | ||
| 2132 | - if(e.getMessage().indexOf("PK_DLB_UK")>0){ | ||
| 2133 | - newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 2134 | - logger.info("电量存在相同数据,数据已经过滤"); | ||
| 2135 | - } | ||
| 2136 | - } | ||
| 2137 | - } | ||
| 2138 | - //重新获取电耗数据结束 | ||
| 2139 | - | ||
| 2140 | - SysUser user = SecurityUtils.getCurrentUser(); | ||
| 2141 | - Nylog nylog=new Nylog(); | ||
| 2142 | - nylog.setCreatedate(new Date()); | ||
| 2143 | - nylog.setCzmc("重新统计"); | ||
| 2144 | - nylog.setNylx("油"); | ||
| 2145 | - nylog.setUserid(user.getUserName()); | ||
| 2146 | - nylog.setUsername(user.getName()); | ||
| 2147 | - nylog.setCxtj(line+"-"+ date+"-"+gsdm+"-"+fgsdm); | ||
| 2148 | - nylogRepository.save(nylog); | ||
| 2149 | - newMap.put("status", ResponseCode.SUCCESS); | ||
| 2150 | - }catch(Exception e){ | ||
| 2151 | - // TODO Auto-generated catch block | ||
| 2152 | - newMap.put("status", ResponseCode.ERROR); | ||
| 2153 | - throw e; | ||
| 2154 | - } | ||
| 2155 | - | ||
| 2156 | - | ||
| 2157 | - return newMap; | ||
| 2158 | - } | ||
| 2159 | - | ||
| 2160 | - public List<Ylb> listByRqJcsx(String rq,String gsdm,String fgsdm,String xlbm,String nbbm) { | ||
| 2161 | - List<Ylb> list=repository.listByRqJcsx(rq, gsdm, fgsdm, xlbm, nbbm); | ||
| 2162 | - Map<String, Object> m=new HashMap<String,Object>(); | ||
| 2163 | - List<Ylb> list_=new ArrayList<Ylb>(); | ||
| 2164 | - for (int i = 0; i < list.size(); i++) { | ||
| 2165 | - Ylb t=list.get(i); | ||
| 2166 | - if(m.get(t.getNbbm())==null){ | ||
| 2167 | - m.put(t.getNbbm(), t.getNbbm()); | ||
| 2168 | - list_.add(t); | ||
| 2169 | - } | ||
| 2170 | - } | ||
| 2171 | - return list_; | ||
| 2172 | - } | ||
| 2173 | - | ||
| 2174 | - @Override | ||
| 2175 | - public Map<String, Object> update(Map<String, Object> map) { | ||
| 2176 | - if(map.get("id")!=null){ | ||
| 2177 | - if(map.get("id").toString().length()>0){ | ||
| 2178 | - Integer id=Integer.parseInt(map.get("id").toString()); | ||
| 2179 | - String jsy=map.get("jsy").toString(); | ||
| 2180 | - Ylb t=repository.findById(id).get(); | ||
| 2181 | - t.setJsy(jsy); | ||
| 2182 | - repository.save(t); | ||
| 2183 | - map.put("status", ResponseCode.SUCCESS); | ||
| 2184 | - } | ||
| 2185 | - } | ||
| 2186 | - return map; | ||
| 2187 | - } | ||
| 2188 | -} | 1672 | + } |
| 1673 | + | ||
| 1674 | + | ||
| 1675 | + | ||
| 1676 | + @Override | ||
| 1677 | + public Map<String, Object> saveYlb(Ylb t) { | ||
| 1678 | + Map<String, Object> map = new HashMap<>(); | ||
| 1679 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1680 | + String rq=sdf.format(t.getRq()); | ||
| 1681 | + String gsdm=t.getSsgsdm(); | ||
| 1682 | + String fgsdm=t.getFgsdm(); | ||
| 1683 | + String xlbm=t.getXlbm(); | ||
| 1684 | + String jhsj=t.getJhsj(); | ||
| 1685 | + String jsy=t.getJsy(); | ||
| 1686 | + String nbbm=t.getNbbm(); | ||
| 1687 | + t.setCreatetime(new Date()); | ||
| 1688 | + String[] jhsjStr = jhsj.split(":"); | ||
| 1689 | + long fcsjL= Long.parseLong(jhsjStr[0])*60+Long.parseLong(jhsjStr[1]); | ||
| 1690 | + List<Ylb> list=this.listOrderBy(rq, gsdm, fgsdm, xlbm, nbbm, "jhsj"); | ||
| 1691 | +// repository.obtainYl(rq, gsdm, fgsdm, xlbm, nbbm, "jhsj"); | ||
| 1692 | + int jcsx=1; | ||
| 1693 | + if(list.size()>0){ | ||
| 1694 | + for (int i = 0; i < list.size(); i++) { | ||
| 1695 | + Ylb y=list.get(i); | ||
| 1696 | + String[] fcsjStr = y.getJhsj().split(":"); | ||
| 1697 | + long fcsj=Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 1698 | + if(fcsjL>fcsj){ | ||
| 1699 | + jcsx=jcsx+y.getJcsx(); | ||
| 1700 | + }else{ | ||
| 1701 | + y.setJcsx(y.getJcsx()+1); | ||
| 1702 | + repository.save(y); | ||
| 1703 | + } | ||
| 1704 | + } | ||
| 1705 | + | ||
| 1706 | + } | ||
| 1707 | + t.setJcsx(jcsx); | ||
| 1708 | + repository.save(t); | ||
| 1709 | + | ||
| 1710 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 1711 | + Nylog nylog=new Nylog(); | ||
| 1712 | + nylog.setCreatedate(new Date()); | ||
| 1713 | + nylog.setCzmc("手动添加"); | ||
| 1714 | + nylog.setNylx("油"); | ||
| 1715 | + nylog.setUserid(user.getUserName()); | ||
| 1716 | + nylog.setUsername(user.getName()); | ||
| 1717 | + nylog.setCxtj(""); | ||
| 1718 | + nylogRepository.save(nylog); | ||
| 1719 | + map.put("status", ResponseCode.SUCCESS); | ||
| 1720 | + map.put("t", t); | ||
| 1721 | + return map; | ||
| 1722 | + } | ||
| 1723 | + @Transactional | ||
| 1724 | + @Override | ||
| 1725 | + public Map<String, Object> deleteIds(Map<String, Object> map) throws Exception{ | ||
| 1726 | + // TODO Auto-generated method stub | ||
| 1727 | + Map<String, Object> maps = new HashMap<>(); | ||
| 1728 | + try{ | ||
| 1729 | + String json =StringEscapeUtils.unescapeHtml4(map.get("ids").toString()); | ||
| 1730 | + JSONArray jsonArray=JSONArray.parseArray(json); | ||
| 1731 | + JSONObject jsonObject; | ||
| 1732 | + for (int x = 0; x < jsonArray.size(); x++) { | ||
| 1733 | + jsonObject=jsonArray.getJSONObject(x); | ||
| 1734 | + Integer id =jsonObject.getInteger("id"); | ||
| 1735 | + repository.deleteById(id); | ||
| 1736 | + } | ||
| 1737 | + | ||
| 1738 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 1739 | + Nylog nylog=new Nylog(); | ||
| 1740 | + nylog.setCreatedate(new Date()); | ||
| 1741 | + nylog.setCzmc("删除"); | ||
| 1742 | + nylog.setNylx("油"); | ||
| 1743 | + nylog.setUserid(user.getUserName()); | ||
| 1744 | + nylog.setUsername(user.getName()); | ||
| 1745 | + nylog.setCxtj(""); | ||
| 1746 | + nylogRepository.save(nylog); | ||
| 1747 | + maps.put("status", ResponseCode.SUCCESS); | ||
| 1748 | + } catch (Exception e) { | ||
| 1749 | + maps.put("status", ResponseCode.ERROR); | ||
| 1750 | + logger.error("save erro.", e); | ||
| 1751 | + throw e; | ||
| 1752 | + } | ||
| 1753 | + return maps; | ||
| 1754 | + } | ||
| 1755 | + | ||
| 1756 | + public List<Ylb> listOrderBy(String rq,String gsdm, | ||
| 1757 | + String fgsdm,String xlbm,String nbbm, | ||
| 1758 | + String px) { | ||
| 1759 | + // TODO Auto-generated method stub | ||
| 1760 | + String sql="SELECT * FROM bsth_c_ylb " | ||
| 1761 | + + " where rq ='"+rq+"' and ssgsdm like '%"+gsdm+"%' " | ||
| 1762 | + + " and fgsdm like '%"+fgsdm+"%'"; | ||
| 1763 | + if(xlbm.equals("")){ | ||
| 1764 | + sql+= " and xlbm like '%"+xlbm+"%' "; | ||
| 1765 | + }else{ | ||
| 1766 | + sql+= " and xlbm = '"+xlbm+"' "; | ||
| 1767 | + } | ||
| 1768 | + | ||
| 1769 | + sql += "and nbbm like '%"+nbbm+"%' order by "+px+" asc "; | ||
| 1770 | + | ||
| 1771 | + List<Ylb> list = jdbcTemplate.query(sql, new RowMapper<Ylb>() { | ||
| 1772 | + @Override | ||
| 1773 | + public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 1774 | + Ylb y = new Ylb(); | ||
| 1775 | + y.setId(arg0.getInt("id")); | ||
| 1776 | + return y; | ||
| 1777 | + } | ||
| 1778 | + }); | ||
| 1779 | + List<Ylb> lists=new ArrayList<Ylb>(); | ||
| 1780 | + List<Ylb> ylbLists=repository.obtainYl(rq,gsdm,fgsdm,xlbm,nbbm,"jcsx"); | ||
| 1781 | + for (int i = 0; i < list.size(); i++) { | ||
| 1782 | + Ylb t=list.get(i); | ||
| 1783 | + for (int j = 0; j < ylbLists.size(); j++) { | ||
| 1784 | + Ylb t2=ylbLists.get(j); | ||
| 1785 | + if(t.getId().intValue()==t2.getId().intValue()){ | ||
| 1786 | + lists.add(t2); | ||
| 1787 | + break; | ||
| 1788 | + } | ||
| 1789 | + } | ||
| 1790 | + } | ||
| 1791 | + | ||
| 1792 | + return lists; | ||
| 1793 | + } | ||
| 1794 | + | ||
| 1795 | + @Override | ||
| 1796 | + public Map<String, Object> updateHistory(Map<String, Object> map) throws Exception { | ||
| 1797 | + // TODO Auto-generated method stub | ||
| 1798 | + Map<String, Object> newMap = new HashMap<String, Object>(); | ||
| 1799 | + | ||
| 1800 | + List<Cars> carsList = carsRepository.findCars(); | ||
| 1801 | + Map<String, Boolean> carsMap = new HashMap<String, Boolean>(); | ||
| 1802 | + for (int i = 0; i < carsList.size(); i++) { | ||
| 1803 | + Cars c = carsList.get(i); | ||
| 1804 | + carsMap.put(c.getInsideCode(), c.getSfdc()); | ||
| 1805 | + } | ||
| 1806 | + try{ | ||
| 1807 | + String date = map.get("date").toString(); | ||
| 1808 | + String line = map.get("line").toString(); | ||
| 1809 | + List<Line> listLine=lineRepository.findLineByCode(line); | ||
| 1810 | + String gsdm =""; | ||
| 1811 | + String fgsdm =""; | ||
| 1812 | + if(listLine.size()>0){ | ||
| 1813 | + Line l=listLine.get(0); | ||
| 1814 | + gsdm=l.getCompany(); | ||
| 1815 | + fgsdm=l.getBrancheCompany(); | ||
| 1816 | + } | ||
| 1817 | + | ||
| 1818 | + String nbbmstr=""; | ||
| 1819 | + List<Map<String, Object>> listpbYc=new ArrayList<Map<String, Object>>();//油车数据 | ||
| 1820 | + List<Map<String, Object>> listpbDc=new ArrayList<Map<String, Object>>();//电车数据 | ||
| 1821 | + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("", date,gsdm, fgsdm, "", ""); | ||
| 1822 | + for (int i = 0; i < listpb.size(); i++) { | ||
| 1823 | + if(listpb.get(i).get("xlBm").toString().equals(line)){ | ||
| 1824 | + nbbmstr +=listpb.get(i).get("clZbh").toString(); | ||
| 1825 | + } | ||
| 1826 | + } | ||
| 1827 | + for (int i = 0; i < listpb.size(); i++) { | ||
| 1828 | + boolean sfdc=true; | ||
| 1829 | + Map<String, Object> m = listpb.get(i); | ||
| 1830 | + if (carsMap.get(m.get("clZbh").toString()) != null) { | ||
| 1831 | + sfdc = carsMap.get(m.get("clZbh").toString()); | ||
| 1832 | + } else { | ||
| 1833 | + sfdc = true; | ||
| 1834 | + } | ||
| 1835 | + if(nbbmstr.indexOf(m.get("clZbh").toString())>-1){ | ||
| 1836 | + if(sfdc){ | ||
| 1837 | + listpbDc.add(m); | ||
| 1838 | + }else{ | ||
| 1839 | + listpbYc.add(m); | ||
| 1840 | + } | ||
| 1841 | + } | ||
| 1842 | + } | ||
| 1843 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1844 | + //初始存油量 | ||
| 1845 | + List<Cyl> clyList = cylRepository.obtainCyl("",gsdm); | ||
| 1846 | + List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(date, 0,gsdm); | ||
| 1847 | + //重新统计油车数据开始 | ||
| 1848 | + List<Ylb> ylListBe =repository.listByRqJcsx(date, gsdm, fgsdm, "", ""); | ||
| 1849 | + List<Ylb> ylbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); | ||
| 1850 | + List<Ylb> ylbList_upd=new ArrayList<Ylb>(); | ||
| 1851 | + List<Ylb> ylbList_del=new ArrayList<Ylb>(); | ||
| 1852 | + | ||
| 1853 | + for (int j = 0; j < ylbList.size(); j++) { | ||
| 1854 | + Ylb t=ylbList.get(j); | ||
| 1855 | + boolean fage=true; | ||
| 1856 | + if(StringUtils.isEmpty(t.getLp())){ | ||
| 1857 | + fage=false; | ||
| 1858 | + }else{ | ||
| 1859 | + for (int i = 0; i < listpbYc.size(); i++) { | ||
| 1860 | + Map<String, Object> m = listpbYc.get(i); | ||
| 1861 | + if(t.getNbbm().equals(m.get("clZbh").toString()) | ||
| 1862 | + &&t.getJsy().equals(m.get("jGh").toString()) | ||
| 1863 | + &&t.getXlbm().equals(m.get("xlBm").toString()) | ||
| 1864 | + &&t.getLp().equals(m.get("lpName").toString())){ | ||
| 1865 | + //该条记录不用删除 | ||
| 1866 | + fage =false; | ||
| 1867 | + ylbList_upd.add(t); | ||
| 1868 | + } | ||
| 1869 | + } | ||
| 1870 | + } | ||
| 1871 | + if(fage){ | ||
| 1872 | + if(t.getXlbm().equals(line)){ | ||
| 1873 | + ylbList_del.add(t); | ||
| 1874 | + } | ||
| 1875 | + } | ||
| 1876 | + | ||
| 1877 | + } | ||
| 1878 | + String nbbmStr=""; | ||
| 1879 | + List<Ylb> list=new ArrayList<Ylb>(); | ||
| 1880 | + /* | ||
| 1881 | + * 第一步 修改车辆里程 和加注量 | ||
| 1882 | + */ | ||
| 1883 | + Map<String, Object> ylMap=new HashMap<String, Object>(); | ||
| 1884 | + for (int x = 0; x < listpbYc.size(); x++) { | ||
| 1885 | + String type = "add"; | ||
| 1886 | + Map<String, Object> maps = listpbYc.get(x); | ||
| 1887 | + // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | ||
| 1888 | + Ylb t = new Ylb(); | ||
| 1889 | + for (int k = 0; k < ylbList_upd.size(); k++) { | ||
| 1890 | + Ylb t1 = ylbList_upd.get(k); | ||
| 1891 | + if (t1.getNbbm().equals(maps.get("clZbh").toString()) | ||
| 1892 | + && t1.getJsy().equals(maps.get("jGh").toString()) | ||
| 1893 | + && t1.getXlbm().equals(maps.get("xlBm").toString()) | ||
| 1894 | + && t1.getLp().equals(maps.get("lpName").toString())) { | ||
| 1895 | + t = t1; | ||
| 1896 | + type = "update"; | ||
| 1897 | + } | ||
| 1898 | + } | ||
| 1899 | + if(type.equals("add")){ | ||
| 1900 | + // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | ||
| 1901 | + if (maps.get("seqNumber").toString().equals("1")) { | ||
| 1902 | + boolean fage = true; | ||
| 1903 | + for (int i = 0; i < ylListBe.size(); i++) { | ||
| 1904 | + Ylb ylb = ylListBe.get(i); | ||
| 1905 | + if (maps.get("clZbh").toString().equals(ylb.getNbbm())) { | ||
| 1906 | + if(ylb.getJzyl()>=0){ | ||
| 1907 | + t.setCzyl(ylb.getJzyl()); | ||
| 1908 | + fage = false; | ||
| 1909 | + break; | ||
| 1910 | + } | ||
| 1911 | + } | ||
| 1912 | + } | ||
| 1913 | + if (fage) { | ||
| 1914 | + for (int y = 0; y < clyList.size(); y++) { | ||
| 1915 | + Cyl cyl = clyList.get(y); | ||
| 1916 | + if (maps.get("clZbh").toString().equals(cyl.getNbbm())) { | ||
| 1917 | + if(cyl!=null){ | ||
| 1918 | + if(cyl.getCyl()>=0){ | ||
| 1919 | + t.setCzyl(cyl.getCyl()); | ||
| 1920 | + fage = false; | ||
| 1921 | + break; | ||
| 1922 | + }else { | ||
| 1923 | + if(cyl.getCxrl()!=null){ | ||
| 1924 | + if(cyl.getCxrl()>0){ | ||
| 1925 | + t.setCzyl(cyl.getCxrl()); | ||
| 1926 | + fage = false; | ||
| 1927 | + break; | ||
| 1928 | + } | ||
| 1929 | + } | ||
| 1930 | + } | ||
| 1931 | + } | ||
| 1932 | + } | ||
| 1933 | + } | ||
| 1934 | + } | ||
| 1935 | + if (fage) { | ||
| 1936 | + t.setCzyl(0.0); | ||
| 1937 | + } | ||
| 1938 | + } | ||
| 1939 | + } | ||
| 1940 | + | ||
| 1941 | + Double jzl = 0.0; | ||
| 1942 | + //一人一车加注量只匹配一次 | ||
| 1943 | + if(ylMap.get(maps.get("clZbh").toString()+"_"+ maps.get("jGh").toString())!=null){ | ||
| 1944 | + }else{ | ||
| 1945 | + boolean fage2=false; | ||
| 1946 | + for (int i = 0; i < ylxxList.size(); i++) { | ||
| 1947 | + Ylxxb ylxxb = ylxxList.get(i); | ||
| 1948 | + if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 1949 | + && maps.get("jGh").toString().equals(ylxxb.getJsy()) | ||
| 1950 | + && ylxxb.getJylx()==1) { | ||
| 1951 | + if(ylxxb.getJzl()>0){ | ||
| 1952 | + fage2=true; | ||
| 1953 | + } | ||
| 1954 | + } | ||
| 1955 | + } | ||
| 1956 | + //车辆的加注量如果有任工干预,略接口过来 数据 | ||
| 1957 | + if(fage2){ | ||
| 1958 | + // 把当天手工输入的的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断,加油类型为1) | ||
| 1959 | + for (int j = 0; j < ylxxList.size(); j++) { | ||
| 1960 | + Ylxxb ylxxb = ylxxList.get(j); | ||
| 1961 | + if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 1962 | + && maps.get("jGh").toString().equals(ylxxb.getJsy()) | ||
| 1963 | + && ylxxb.getJylx()==1) { | ||
| 1964 | + jzl =Arith.add(jzl, ylxxb.getJzl()); | ||
| 1965 | + } | ||
| 1966 | + } | ||
| 1967 | + ylMap.put(maps.get("clZbh").toString()+"_"+ maps.get("jGh").toString(),maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); | ||
| 1968 | + }else{ | ||
| 1969 | + // 把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | ||
| 1970 | + for (int j = 0; j < ylxxList.size(); j++) { | ||
| 1971 | + Ylxxb ylxxb = ylxxList.get(j); | ||
| 1972 | + if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 1973 | + && maps.get("jGh").toString().equals(ylxxb.getJsy())) { | ||
| 1974 | + jzl =Arith.add(jzl, ylxxb.getJzl()); | ||
| 1975 | + } | ||
| 1976 | + } | ||
| 1977 | + ylMap.put(maps.get("clZbh").toString()+"_"+ maps.get("jGh").toString(),maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); | ||
| 1978 | + } | ||
| 1979 | + } | ||
| 1980 | + t.setJzl(jzl); | ||
| 1981 | + t.setNbbm(maps.get("clZbh").toString()); | ||
| 1982 | + t.setJsy(maps.get("jGh") == null ? "" : maps.get("jGh").toString()); | ||
| 1983 | + t.setJname(maps.get("jName").toString()); | ||
| 1984 | + t.setZlc(maps.get("totalKilometers") == null ? 0.0 | ||
| 1985 | + : Double.parseDouble(maps.get("totalKilometers").toString())); | ||
| 1986 | + t.setXlbm(maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); | ||
| 1987 | + t.setJcsx(Integer.parseInt(maps.get("seqNumber").toString())); | ||
| 1988 | + t.setSsgsdm(maps.get("company") == null ? "" : maps.get("company").toString()); | ||
| 1989 | + t.setFgsdm(maps.get("bCompany") == null ? "" : maps.get("bCompany").toString()); | ||
| 1990 | + t.setJhsj(maps.get("fcsj")==null?"":maps.get("fcsj").toString()); | ||
| 1991 | + t.setRq(sdf.parse(date)); | ||
| 1992 | + t.setLp(maps.get("lpName")==null?"":maps.get("lpName").toString()); | ||
| 1993 | + if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 1994 | + if(type.equals("add")){ | ||
| 1995 | + if(nbbmStr.indexOf(t.getNbbm())<0){ | ||
| 1996 | + nbbmStr +=t.getNbbm()+","; | ||
| 1997 | + } | ||
| 1998 | + t.setCreatetime(new Date()); | ||
| 1999 | + }else{ | ||
| 2000 | + t.setUpdatetime(new Date()); | ||
| 2001 | + } | ||
| 2002 | + } | ||
| 2003 | + try { | ||
| 2004 | + repository.save(t); | ||
| 2005 | + } catch (Exception e) { | ||
| 2006 | + // TODO: handle exception | ||
| 2007 | + if(e.getMessage().indexOf("PK_YLB_UK")>0){ | ||
| 2008 | + newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 2009 | + logger.info("油量存在相同数据,数据已经过滤"); | ||
| 2010 | + } | ||
| 2011 | + } | ||
| 2012 | + | ||
| 2013 | + } | ||
| 2014 | + for (int i = 0; i < ylbList_del.size(); i++) { | ||
| 2015 | + Ylb y=ylbList_del.get(i); | ||
| 2016 | + if(nbbmStr.indexOf(y.getNbbm())<0){ | ||
| 2017 | + nbbmStr +=y.getNbbm()+","; | ||
| 2018 | + } | ||
| 2019 | + repository.deleteById(y.getId()); | ||
| 2020 | + } | ||
| 2021 | + | ||
| 2022 | + //重新计算删除了的或者新增了的车的车的油耗信息(考虑车辆可能跨线路,从分公司赛选计算) | ||
| 2023 | + double czyl=0.0; | ||
| 2024 | + List<Ylb> iterator2=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm,jcsx"); | ||
| 2025 | + String[] nbbms=nbbmStr.split(","); | ||
| 2026 | + for (int i = 0; i < nbbms.length; i++) { | ||
| 2027 | + String clzbm=nbbms[i]; | ||
| 2028 | + // 得到一天总的加油和里程(根据车,时间) | ||
| 2029 | + List<Object[]> sumList = repository.sumLcYl(clzbm, sdf.parse(date),"",gsdm,fgsdm); | ||
| 2030 | + // 保存总的加油量 | ||
| 2031 | + Double jzl = 0.0; | ||
| 2032 | + // 保存总的里程 | ||
| 2033 | + Double zlc = 0.0; | ||
| 2034 | + for (int j = 0; j < sumList.size(); j++) { | ||
| 2035 | + jzl = Arith.add(jzl, Double.valueOf(sumList.get(j)[0].toString())); | ||
| 2036 | + zlc = Arith.add(zlc, Double.valueOf(sumList.get(j)[1].toString())); | ||
| 2037 | + } | ||
| 2038 | + // 保留两位小数 | ||
| 2039 | + DecimalFormat df = new DecimalFormat("#.000"); | ||
| 2040 | + Double zyl = 0.0; | ||
| 2041 | + Double nextJzyl = 0.0; | ||
| 2042 | + for (int j = 0; j < iterator2.size(); j++) { | ||
| 2043 | + Ylb t = iterator2.get(j); | ||
| 2044 | + if(t.getNbbm().equals(clzbm)){ | ||
| 2045 | + if (t.getJcsx() == 1) { | ||
| 2046 | + // 进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量 | ||
| 2047 | + czyl = t.getCzyl(); | ||
| 2048 | + zyl =jzl; | ||
| 2049 | + Double yh=0.0; | ||
| 2050 | + if(zlc>0 ){ | ||
| 2051 | + yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 2052 | + } | ||
| 2053 | + nextJzyl =Arith.sub( Arith.add(t.getJzl(), t.getCzyl()),yh); | ||
| 2054 | + //把进场油量的小数和整数分别取出 | ||
| 2055 | + if(zlc>0 && t.getZlc()>0){ | ||
| 2056 | + long l=Math.round(nextJzyl); | ||
| 2057 | + double ylxs=l*100/100; | ||
| 2058 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 2059 | + t.setYh(yh); | ||
| 2060 | + t.setJzyl(ylxs); | ||
| 2061 | + nextJzyl=ylxs; | ||
| 2062 | + }else{ | ||
| 2063 | + t.setYh(yh); | ||
| 2064 | + t.setJzyl(nextJzyl); | ||
| 2065 | + } | ||
| 2066 | + } else { | ||
| 2067 | + t.setCzyl(nextJzyl); | ||
| 2068 | + Double yh=0.0; | ||
| 2069 | + if(zlc>0){ | ||
| 2070 | + yh= Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | ||
| 2071 | + } | ||
| 2072 | + nextJzyl =Arith.sub( Arith.add(t.getJzl(),nextJzyl),yh); | ||
| 2073 | + if(zlc>0 && t.getZlc()>0){ | ||
| 2074 | + long l=0l; | ||
| 2075 | + double ylxs=0.0; | ||
| 2076 | + if(j==iterator2.size()-1){ | ||
| 2077 | + ylxs=czyl; | ||
| 2078 | + }else{ | ||
| 2079 | + if(iterator2.get(j+1).getNbbm().equals(t.getNbbm())){ | ||
| 2080 | + l=Math.round(nextJzyl); | ||
| 2081 | + ylxs=l*100/100; | ||
| 2082 | + }else{ | ||
| 2083 | + ylxs=czyl; | ||
| 2084 | + } | ||
| 2085 | + | ||
| 2086 | + } | ||
| 2087 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | ||
| 2088 | + t.setYh(yh); | ||
| 2089 | + t.setJzyl(ylxs); | ||
| 2090 | + nextJzyl=ylxs; | ||
| 2091 | + }else{ | ||
| 2092 | + t.setYh(yh); | ||
| 2093 | + t.setJzyl(nextJzyl); | ||
| 2094 | + } | ||
| 2095 | + } | ||
| 2096 | + if(t.getJzyl()<0){ | ||
| 2097 | + t.setJzyl(0.0); | ||
| 2098 | + } | ||
| 2099 | + if(t.getCzyl()<0){ | ||
| 2100 | + t.setCzyl(0.0); | ||
| 2101 | + } | ||
| 2102 | + if(t.getYh()<0){ | ||
| 2103 | + t.setYh(0.0); | ||
| 2104 | + } | ||
| 2105 | + if(t.getSh()<0){ | ||
| 2106 | + t.setSh(0.0); | ||
| 2107 | + } | ||
| 2108 | + repository.save(t); | ||
| 2109 | + } | ||
| 2110 | + } | ||
| 2111 | + } | ||
| 2112 | + | ||
| 2113 | + //重新统计油车数据结束 | ||
| 2114 | + | ||
| 2115 | + | ||
| 2116 | + //重新获取电耗数据开始 | ||
| 2117 | + Map<String, List<Dlb>> mapList=dlbService.updeteHistory(listpbDc, date, gsdm, fgsdm, line); | ||
| 2118 | + List<Dlb> delDlb=mapList.get("delList"); | ||
| 2119 | + for (int i = 0; i < delDlb.size(); i++) { | ||
| 2120 | + Dlb d=delDlb.get(i); | ||
| 2121 | + dlbRepository.deleteById(d.getId()); | ||
| 2122 | + } | ||
| 2123 | + List<Dlb> updDlb=mapList.get("updList"); | ||
| 2124 | + for (int i = 0; i < updDlb.size(); i++) { | ||
| 2125 | + Dlb d=updDlb.get(i); | ||
| 2126 | + try { | ||
| 2127 | + dlbRepository.save(d); | ||
| 2128 | + } catch (Exception e) { | ||
| 2129 | + // TODO: handle exception | ||
| 2130 | + if(e.getMessage().indexOf("PK_DLB_UK")>0){ | ||
| 2131 | + newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 2132 | + logger.info("电量存在相同数据,数据已经过滤"); | ||
| 2133 | + } | ||
| 2134 | + } | ||
| 2135 | + } | ||
| 2136 | + //重新获取电耗数据结束 | ||
| 2137 | + | ||
| 2138 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 2139 | + Nylog nylog=new Nylog(); | ||
| 2140 | + nylog.setCreatedate(new Date()); | ||
| 2141 | + nylog.setCzmc("重新统计"); | ||
| 2142 | + nylog.setNylx("油"); | ||
| 2143 | + nylog.setUserid(user.getUserName()); | ||
| 2144 | + nylog.setUsername(user.getName()); | ||
| 2145 | + nylog.setCxtj(line+"-"+ date+"-"+gsdm+"-"+fgsdm); | ||
| 2146 | + nylogRepository.save(nylog); | ||
| 2147 | + newMap.put("status", ResponseCode.SUCCESS); | ||
| 2148 | + }catch(Exception e){ | ||
| 2149 | + // TODO Auto-generated catch block | ||
| 2150 | + newMap.put("status", ResponseCode.ERROR); | ||
| 2151 | + throw e; | ||
| 2152 | + } | ||
| 2153 | + | ||
| 2154 | + | ||
| 2155 | + return newMap; | ||
| 2156 | + } | ||
| 2157 | + | ||
| 2158 | + public List<Ylb> listByRqJcsx(String rq,String gsdm,String fgsdm,String xlbm,String nbbm) { | ||
| 2159 | + List<Ylb> list=repository.listByRqJcsx(rq, gsdm, fgsdm, xlbm, nbbm); | ||
| 2160 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 2161 | + List<Ylb> list_=new ArrayList<Ylb>(); | ||
| 2162 | + for (int i = 0; i < list.size(); i++) { | ||
| 2163 | + Ylb t=list.get(i); | ||
| 2164 | + if(m.get(t.getNbbm())==null){ | ||
| 2165 | + m.put(t.getNbbm(), t.getNbbm()); | ||
| 2166 | + list_.add(t); | ||
| 2167 | + } | ||
| 2168 | + } | ||
| 2169 | + return list_; | ||
| 2170 | + } | ||
| 2171 | + | ||
| 2172 | + @Override | ||
| 2173 | + public Map<String, Object> update(Map<String, Object> map) { | ||
| 2174 | + if(map.get("id")!=null){ | ||
| 2175 | + if(map.get("id").toString().length()>0){ | ||
| 2176 | + Integer id=Integer.parseInt(map.get("id").toString()); | ||
| 2177 | + String jsy=map.get("jsy").toString(); | ||
| 2178 | + Ylb t=repository.findById(id).get(); | ||
| 2179 | + t.setJsy(jsy); | ||
| 2180 | + repository.save(t); | ||
| 2181 | + map.put("status", ResponseCode.SUCCESS); | ||
| 2182 | + } | ||
| 2183 | + } | ||
| 2184 | + return map; | ||
| 2185 | + } | ||
| 2186 | +} |
src/main/resources/application-test.properties
| 1 | -server.port=9088 | ||
| 2 | - | ||
| 3 | -# dubbo����ʹ�ÿ���flag | ||
| 4 | -dubbo.use=false | ||
| 5 | - | ||
| 6 | -#JPA | ||
| 7 | -spring.jpa.hibernate.ddl-auto= none | ||
| 8 | -spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl | ||
| 9 | -spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy | ||
| 10 | -spring.jpa.database= MYSQL | ||
| 11 | -spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true | ||
| 12 | -spring.jpa.show-sql= false | ||
| 13 | -spring.jpa.properties.hibernate.dialect= org.hibernate.spatial.dialect.mysql.MySQL56InnoDBSpatialDialect | ||
| 14 | - | ||
| 15 | -#DATABASE | ||
| 16 | -spring.datasource.driver-class-name= com.mysql.jdbc.Driver | ||
| 17 | -spring.datasource.url= jdbc:mysql://192.168.168.152/control_changsha?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 18 | -spring.datasource.username= root | ||
| 19 | -spring.datasource.password= root2jsp | ||
| 20 | -spring.datasource.type= com.zaxxer.hikari.HikariDataSource | ||
| 21 | - | ||
| 22 | -#DATASOURCE SETTING | ||
| 23 | -spring.datasource.hikari.minimum-idle= 8 | ||
| 24 | -spring.datasource.hikari.maximum-pool-size= 100 | ||
| 25 | -#spring.datasource.hikari.auto-commit= true | ||
| 26 | -spring.datasource.hikari.idle-timeout= 60000 | ||
| 27 | -#spring.datasource.hikari.pool-name= HikariPool | ||
| 28 | -spring.datasource.hikari.max-lifetime= 1800000 | ||
| 29 | -spring.datasource.hikari.connection-timeout= 3000 | ||
| 30 | -spring.datasource.hikari.connection-test-query= SELECT 1 | ||
| 31 | -spring.datasource.hikari.validation-timeout= 3000 | ||
| 32 | -spring.datasource.hikari.register-mbeans=true | ||
| 33 | - | ||
| 34 | -kafka.use= false | ||
| 35 | -spring.kafka.consumer.bootstrap-servers= 192.170.100.114:9092,192.170.100.114:9093,192.170.100.114:9094 | ||
| 36 | -spring.kafka.consumer.group-id= schedule-system-test | ||
| 37 | -spring.kafka.consumer.auto-offset-reset= latest | ||
| 38 | -spring.kafka.consumer.key-deserializer= org.apache.kafka.common.serialization.StringDeserializer | ||
| 39 | -spring.kafka.consumer.value-deserializer= org.apache.kafka.common.serialization.StringDeserializer | ||
| 40 | - | ||
| 41 | -sso.enabled= true | ||
| 42 | -sso.systemcode = SYSUS0023 | ||
| 43 | -sso.http.url.login= http://47.92.212.107:9102/login?redirect=%2Findex | ||
| 44 | -sso.http.url.logout= http://47.92.212.107:9102/login?redirect=%2Findex | 1 | +server.port=9088 |
| 2 | + | ||
| 3 | +# dubbo����ʹ�ÿ���flag | ||
| 4 | +dubbo.use=false | ||
| 5 | + | ||
| 6 | +#JPA | ||
| 7 | +spring.jpa.hibernate.ddl-auto= none | ||
| 8 | +spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl | ||
| 9 | +spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy | ||
| 10 | +spring.jpa.database= MYSQL | ||
| 11 | +spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true | ||
| 12 | +spring.jpa.show-sql= false | ||
| 13 | +spring.jpa.properties.hibernate.dialect= org.hibernate.spatial.dialect.mysql.MySQL56InnoDBSpatialDialect | ||
| 14 | + | ||
| 15 | +#DATABASE | ||
| 16 | +spring.datasource.driver-class-name= com.mysql.jdbc.Driver | ||
| 17 | +spring.datasource.url= jdbc:mysql://192.168.168.152/control_changsha?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 18 | +spring.datasource.username= root | ||
| 19 | +spring.datasource.password= root2jsp | ||
| 20 | +spring.datasource.type= com.zaxxer.hikari.HikariDataSource | ||
| 21 | + | ||
| 22 | +#DATASOURCE SETTING | ||
| 23 | +spring.datasource.hikari.minimum-idle= 8 | ||
| 24 | +spring.datasource.hikari.maximum-pool-size= 100 | ||
| 25 | +#spring.datasource.hikari.auto-commit= true | ||
| 26 | +spring.datasource.hikari.idle-timeout= 60000 | ||
| 27 | +#spring.datasource.hikari.pool-name= HikariPool | ||
| 28 | +spring.datasource.hikari.max-lifetime= 1800000 | ||
| 29 | +spring.datasource.hikari.connection-timeout= 3000 | ||
| 30 | +spring.datasource.hikari.connection-test-query= SELECT 1 | ||
| 31 | +spring.datasource.hikari.validation-timeout= 3000 | ||
| 32 | +spring.datasource.hikari.register-mbeans=true | ||
| 33 | + | ||
| 34 | +kafka.use= false | ||
| 35 | +spring.kafka.consumer.bootstrap-servers= 192.170.100.114:9092,192.170.100.114:9093,192.170.100.114:9094 | ||
| 36 | +spring.kafka.consumer.group-id= schedule-system-test | ||
| 37 | +spring.kafka.consumer.auto-offset-reset= latest | ||
| 38 | +spring.kafka.consumer.key-deserializer= org.apache.kafka.common.serialization.StringDeserializer | ||
| 39 | +spring.kafka.consumer.value-deserializer= org.apache.kafka.common.serialization.StringDeserializer | ||
| 40 | + | ||
| 41 | +sso.enabled= true | ||
| 42 | +sso.systemcode = SYSUS0023 | ||
| 43 | +sso.http.url.login= http://47.92.212.107:9102/login?redirect=%2Findex | ||
| 44 | +sso.http.url.logout= http://47.92.212.107:9102/login?redirect=%2Findex | ||
| 45 | sso.http.url.auth= http://47.92.212.107:9102/prod-api/system/utilitySystem/checkToken | 45 | sso.http.url.auth= http://47.92.212.107:9102/prod-api/system/utilitySystem/checkToken |
| 46 | \ No newline at end of file | 46 | \ No newline at end of file |
src/main/resources/application.properties
| 1 | -spring.profiles.active = test | ||
| 2 | - | ||
| 3 | -spring.view.suffix=.html | ||
| 4 | -server.session-timeout=-1 | ||
| 5 | - | ||
| 6 | -# File size limit | ||
| 7 | -multipart.maxFileSize = -1 | ||
| 8 | -# Total request size for a multipart/form-data | ||
| 9 | -multipart.maxRequestSize = -1 | ||
| 10 | - | ||
| 11 | -server.compression.enabled=true | ||
| 12 | -server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain,text/javascript,text/css,application/javascript | ||
| 13 | - | ||
| 14 | -# batch insert | ||
| 15 | -hibernate.jdbc.batch_size = 50 | ||
| 16 | - | ||
| 17 | -debug=false | 1 | +spring.profiles.active = test |
| 2 | + | ||
| 3 | +spring.view.suffix=.html | ||
| 4 | +server.session-timeout=-1 | ||
| 5 | + | ||
| 6 | +# File size limit | ||
| 7 | +multipart.maxFileSize = -1 | ||
| 8 | +# Total request size for a multipart/form-data | ||
| 9 | +multipart.maxRequestSize = -1 | ||
| 10 | + | ||
| 11 | +server.compression.enabled=true | ||
| 12 | +server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain,text/javascript,text/css,application/javascript | ||
| 13 | + | ||
| 14 | +# batch insert | ||
| 15 | +hibernate.jdbc.batch_size = 50 | ||
| 16 | + | ||
| 17 | +debug=false |
src/main/resources/static/index.html
| 1 | -<!DOCTYPE html> | ||
| 2 | -<html lang="zh"> | ||
| 3 | -<head> | ||
| 4 | - <meta name="renderer" content="webkit" /> | ||
| 5 | - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
| 6 | - <meta charset="UTF-8"> | ||
| 7 | - <title>调度系统</title> | ||
| 8 | - | ||
| 9 | - <meta http-equiv="Pragma" content="no-cache"> | ||
| 10 | - <meta http-equiv="Cache-control" content="no-cache"> | ||
| 11 | - <meta http-equiv="Cache" content="no-cache"> | ||
| 12 | - | ||
| 13 | - <!-- Font Awesome 图标字体 --> | ||
| 14 | - <link | ||
| 15 | - href="/metronic_v4.5.4/plugins/font-awesome/css/font-awesome.min.css" | ||
| 16 | - rel="stylesheet" type="text/css" /> | ||
| 17 | - <!-- Bootstrap style --> | ||
| 18 | - <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" | ||
| 19 | - rel="stylesheet" type="text/css" /> | ||
| 20 | - <!-- jsTree 数插件 --> | ||
| 21 | - <link | ||
| 22 | - href="/metronic_v4.5.4/plugins/jstree/dist/themes/default/style.min.css" | ||
| 23 | - rel="stylesheet" type="text/css" /> | ||
| 24 | - <!-- MULTI-select 多选下拉框美化 --> | ||
| 25 | - <link | ||
| 26 | - href="/metronic_v4.5.4/plugins/jquery-multi-select/css/multi-select.css" | ||
| 27 | - rel="stylesheet" type="text/css" /> | ||
| 28 | - | ||
| 29 | - <!-- editable --> | ||
| 30 | - <link | ||
| 31 | - href="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css" | ||
| 32 | - rel="stylesheet" type="text/css" /> | ||
| 33 | - <!-- METRONIC style --> | ||
| 34 | - <link href="/metronic_v4.5.4/layout4/css/themes/light.min.css" | ||
| 35 | - rel="stylesheet" type="text/css" id="style_color" /> | ||
| 36 | - <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" | ||
| 37 | - type="text/css" /> | ||
| 38 | - <link href="/metronic_v4.5.4/css/plugins.css" rel="stylesheet" | ||
| 39 | - type="text/css" /> | ||
| 40 | - <link href="/metronic_v4.5.4/layout4/css/layout.min.css" | ||
| 41 | - rel="stylesheet" type="text/css" /> | ||
| 42 | - <link href="/metronic_v4.5.4/layout4/css/custom.min.css" | ||
| 43 | - rel="stylesheet" type="text/css" /> | ||
| 44 | - <!-- select2 下拉框插件 --> | ||
| 45 | - <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" | ||
| 46 | - rel="stylesheet" type="text/css" /> | ||
| 47 | - <link | ||
| 48 | - href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" | ||
| 49 | - rel="stylesheet" type="text/css" /> | ||
| 50 | - <!-- layer 弹层 插件 --> | ||
| 51 | - <link href="/assets/plugins/layer-v2.4/layer/skin/layer.css" | ||
| 52 | - rel="stylesheet" type="text/css" /> | ||
| 53 | - <!-- fileinput 上传 插件 --> | ||
| 54 | - <link href="/assets/plugins/fileinput/css/fileinput.min.css" | ||
| 55 | - rel="stylesheet" type="text/css" /> | ||
| 56 | - <!-- iCheck 单选框和复选框 --> | ||
| 57 | - <link href="/metronic_v4.5.4/plugins/icheck/skins/all.css" | ||
| 58 | - rel="stylesheet" type="text/css" /> | ||
| 59 | - <!-- 日期控件 --> | ||
| 60 | - <link | ||
| 61 | - href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css" | ||
| 62 | - rel="stylesheet" type="text/css" /> | ||
| 63 | - <!-- table 表格控件 --> | ||
| 64 | - <!--<link rel="stylesheet"--> | ||
| 65 | - <!--href="//api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"--> | ||
| 66 | - <!--type="text/css" />--> | ||
| 67 | - <link href="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet" type="text/css"/> | ||
| 68 | - <!-- handsontable样式 --> | ||
| 69 | - <link rel="stylesheet" | ||
| 70 | - href="/assets/bower_components/handsontable/dist/handsontable.full.css" /> | ||
| 71 | - <!-- sweetalert样式 --> | ||
| 72 | - <link rel="stylesheet" | ||
| 73 | - href="/assets/bower_components/sweetalert/dist/sweetalert.css" /> | ||
| 74 | - <!-- schedule计划调度AngularJS模块主css --> | ||
| 75 | - <link rel="stylesheet" href="/pages/scheduleApp/module/common/main.css" | ||
| 76 | - type="text/css" /> | ||
| 77 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | ||
| 78 | - | ||
| 79 | - <!-- CSS动画 --> | ||
| 80 | - <link | ||
| 81 | - href="/metronic_v4.5.4/plugins/tipso/css/animate.css" | ||
| 82 | - rel="stylesheet" type="text/css" /> | ||
| 83 | - | ||
| 84 | - <!-- 提示工具样式 --> | ||
| 85 | - <link | ||
| 86 | - href="/metronic_v4.5.4/plugins/tipso/css/tipso.css" | ||
| 87 | - rel="stylesheet" type="text/css" /> | ||
| 88 | - | ||
| 89 | - <style type="text/css"> | ||
| 90 | - .searchForm { | ||
| 91 | - | ||
| 92 | - } | ||
| 93 | - | ||
| 94 | - .searchForm .form-group .control-label { | ||
| 95 | - padding-right: 0px; | ||
| 96 | - text-align: right; | ||
| 97 | - margin-top: 7px; | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - .searchForm .form-group>div { | ||
| 101 | - padding-left: 10px; | ||
| 102 | - padding-right: 0px; | ||
| 103 | - } | ||
| 104 | - | ||
| 105 | - .searchForm .row>div { | ||
| 106 | - padding-left: 0px; | ||
| 107 | - padding-right: 0px; | ||
| 108 | - padding: 5px 0 5px 0; | ||
| 109 | - width: 270px; | ||
| 110 | - display: inline-block; | ||
| 111 | - } | ||
| 112 | - | ||
| 113 | - .searchForm .form-actions { | ||
| 114 | - | ||
| 115 | - } | ||
| 116 | - | ||
| 117 | - tr.row-active td { | ||
| 118 | - border-bottom: 1px solid blue !important; | ||
| 119 | - color: blue; | ||
| 120 | - } | ||
| 121 | - | ||
| 122 | - .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | ||
| 123 | - { | ||
| 124 | - font-size: 14px; | ||
| 125 | - } | ||
| 126 | - | ||
| 127 | - .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | ||
| 128 | - { | ||
| 129 | - padding: 6px 26px; | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - .ms-container .ms-list { | ||
| 133 | - height: 306px; | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | - .ms-container .ms-selectable,.ms-container .ms-selection { | ||
| 137 | - width: 47%; | ||
| 138 | - } | ||
| 139 | - | ||
| 140 | - .ms-container { | ||
| 141 | - width: 470px; | ||
| 142 | - margin: auto; | ||
| 143 | - } | ||
| 144 | - | ||
| 145 | - .multi-custom-header-left { | ||
| 146 | - text-align: center; | ||
| 147 | - padding: 7px; | ||
| 148 | - color: #3B3F51; | ||
| 149 | - } | ||
| 150 | - | ||
| 151 | - .multi-custom-header-right { | ||
| 152 | - text-align: center; | ||
| 153 | - padding: 7px; | ||
| 154 | - font-weight: bold; | ||
| 155 | - color: #36C6D3; | ||
| 156 | - } | ||
| 157 | - | ||
| 158 | - .mt-element-list .list-simple.mt-list-container ul>.mt-list-item>.list-item-content | ||
| 159 | - { | ||
| 160 | - padding: 0 55px 0 0px; | ||
| 161 | - } | ||
| 162 | - | ||
| 163 | - .mt-element-list .list-simple.mt-list-container ul>.mt-list-item { | ||
| 164 | - padding: 3.3px 0; | ||
| 165 | - } | ||
| 166 | - | ||
| 167 | - #route-container { | ||
| 168 | - display: none; | ||
| 169 | - } | ||
| 170 | - | ||
| 171 | - .page-content.active { | ||
| 172 | - display: block !important; | ||
| 173 | - } | ||
| 174 | - | ||
| 175 | - .page-header.navbar .page-logo .logo-default { | ||
| 176 | - margin: 0; | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - .page-header.navbar .top-menu .navbar-nav>li.dropdown.open .dropdown-toggle | ||
| 180 | - { | ||
| 181 | - background-color: #284a99; | ||
| 182 | - } | ||
| 183 | - | ||
| 184 | - .page-header.navbar .page-logo { | ||
| 185 | - padding-right: 10px; | ||
| 186 | - } | ||
| 187 | - | ||
| 188 | - .page-logo .logo-default.logo-default-text { | ||
| 189 | - font-weight: 600; | ||
| 190 | - color: white !important; | ||
| 191 | - margin-top: 19px !important; | ||
| 192 | - font-size: 20px; | ||
| 193 | - text-decoration: none; | ||
| 194 | - } | ||
| 195 | - | ||
| 196 | - .page-logo .logo-default.logo-default-text:HOVER { | ||
| 197 | - color: #dedede !important; | ||
| 198 | - } | ||
| 199 | - | ||
| 200 | - body,.page-content-wrapper,#pjax-container{ | ||
| 201 | - height: 100%; | ||
| 202 | - } | ||
| 203 | - html{ | ||
| 204 | - height: 90%; | ||
| 205 | - } | ||
| 206 | - .page-container{ | ||
| 207 | - height: 100%; | ||
| 208 | - } | ||
| 209 | - </style> | ||
| 210 | - | ||
| 211 | - <!-- ocLazyLoading载入文件的位置 --> | ||
| 212 | - <link id="ng_load_plugins_before" /> | ||
| 213 | - | ||
| 214 | -</head> | ||
| 215 | -<body | ||
| 216 | - class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo page-sidebar-fixed"> | ||
| 217 | -<div class="page-header navbar navbar-fixed-top" | ||
| 218 | - style="background: linear-gradient(to bottom, #124e78, #125688);"> | ||
| 219 | - <div class="page-header-inner "> | ||
| 220 | - <!-- LOGO --> | ||
| 221 | - <div class="page-logo"> | ||
| 222 | - <a href="index.html" class="logo-default logo-default-text"> | ||
| 223 | - 智慧公交运营管理系统 </a> | ||
| 224 | - <div class="menu-toggler sidebar-toggler"></div> | ||
| 225 | - </div> | ||
| 226 | - <!-- END LOGO --> | ||
| 227 | - <a href="javascript:;" class="menu-toggler responsive-toggler" | ||
| 228 | - data-toggle="collapse" data-target=".navbar-collapse"> </a> | ||
| 229 | - <div class="page-top"> | ||
| 230 | - <div class="top-menu"> | ||
| 231 | - <ul class="nav navbar-nav pull-right"> | ||
| 232 | - <!-- 信息通知区 --> | ||
| 233 | - <li | ||
| 234 | - class="dropdown dropdown-extended dropdown-notification dropdown-dark" | ||
| 235 | - id="header_notification_bar"><a href="javascript:;" | ||
| 236 | - class="dropdown-toggle" data-toggle="dropdown" | ||
| 237 | - data-hover="dropdown" data-close-others="true"> <i | ||
| 238 | - class="fa fa-bell"></i> <span class="badge badge-success"> | ||
| 239 | - 0 </span> | ||
| 240 | - </a> | ||
| 241 | - <ul class="dropdown-menu" style="max-width: 345px; width: 345px;"> | ||
| 242 | - <li class="external"> | ||
| 243 | - <h3> | ||
| 244 | - 今日 <span class="bold">0 条</span> 通知 | ||
| 245 | - </h3> <a href="javascript:;">查看全部</a> | ||
| 246 | - </li> | ||
| 247 | - <li> | ||
| 248 | - <ul class="dropdown-menu-list scroller" style="height: 250px;" | ||
| 249 | - data-handle-color="#637283"> | ||
| 250 | - </ul> | ||
| 251 | - </li> | ||
| 252 | - </ul></li> | ||
| 253 | - <li class="dropdown dropdown-user dropdown-dark"><a | ||
| 254 | - href="javascript:;" class="dropdown-toggle" | ||
| 255 | - data-toggle="dropdown" data-hover="dropdown" | ||
| 256 | - data-close-others="true"> <span id="indexTopUName" | ||
| 257 | - class="username username-hide-on-mobile" | ||
| 258 | - style="vertical-align: middle;"> <i class="fa fa-user"></i></span> | ||
| 259 | - </a> | ||
| 260 | - <ul class="dropdown-menu dropdown-menu-default"> | ||
| 261 | - <li><a href="javascript:;" id="changePWD"> <i | ||
| 262 | - class="fa fa-unlock-alt"></i> 修改密码 | ||
| 263 | - </a></li> | ||
| 264 | - <li class="divider"></li> | ||
| 265 | - <li><a href="/logout"> <i class="fa fa-key"></i> 注销登陆 | ||
| 266 | - </a></li> | ||
| 267 | - </ul></li> | ||
| 268 | - </ul> | ||
| 269 | - </div> | ||
| 270 | - </div> | ||
| 271 | - </div> | ||
| 272 | -</div> | ||
| 273 | -<div class="page-container"> | ||
| 274 | - <div class="page-sidebar-wrapper"> | ||
| 275 | - <div class="page-sidebar navbar-collapse collapse"> | ||
| 276 | - <ul class="page-sidebar-menu page-sidebar-menu-fixed" | ||
| 277 | - data-keep-expanded="false" data-auto-scroll="true" | ||
| 278 | - data-slide-speed="200" id="leftMenuSidebar"> | ||
| 279 | - </ul> | ||
| 280 | - </div> | ||
| 281 | - </div> | ||
| 282 | - <div class="page-content-wrapper"> | ||
| 283 | - <div id="pjax-container" class="page-content"></div> | ||
| 284 | - | ||
| 285 | - <div id="route-container"> | ||
| 286 | - <div ng-app="ScheduleApp"> | ||
| 287 | - <div ng-controller="ScheduleAppController"> | ||
| 288 | - | ||
| 289 | - <!-- loading widget --> | ||
| 290 | - <div id="loadingWidget" class="flyover mask" loading-widget> | ||
| 291 | - <div class="alert alert-info"> | ||
| 292 | - <strong>载入中......</strong> | ||
| 293 | - </div> | ||
| 294 | - </div> | ||
| 295 | - | ||
| 296 | - <div ui-view class="uv"></div> | ||
| 297 | - </div> | ||
| 298 | - </div> | ||
| 299 | - </div> | ||
| 300 | - </div> | ||
| 301 | -</div> | ||
| 302 | - | ||
| 303 | -<script id="menu_list_temp" type="text/html"> | ||
| 304 | - {{each list as group i}} | ||
| 305 | - <li class="heading"> | ||
| 306 | - <h3 class="uppercase">{{group.name}}</h3> | ||
| 307 | - </li> | ||
| 308 | - {{each group.children as dir j}} | ||
| 309 | - <li class="nav-item"> | ||
| 310 | - <a href="javascript:;" class="nav-link nav-toggle "> | ||
| 311 | - <i class="{{dir.icon}}"></i> | ||
| 312 | - <span class="title">{{dir.name}}</span> | ||
| 313 | - <span class="arrow"></span> | ||
| 314 | - </a> | ||
| 315 | - <ul class="sub-menu"> | ||
| 316 | - {{each dir.children as module s}} | ||
| 317 | - <li class="nav-item "> | ||
| 318 | - {{if module.container=="pjax-container"}} | ||
| 319 | - <a href="/pages/{{module.path}}" class="nav-link " data-pjax> | ||
| 320 | - <span class="title">{{module.name}}</span> | ||
| 321 | - </a> | ||
| 322 | - {{else}} | ||
| 323 | - <a href="{{module.path}}" class="nav-link " data-angularjs> | ||
| 324 | - <span class="title">{{module.name}}</span> | ||
| 325 | - </a> | ||
| 326 | - {{/if}} | ||
| 327 | - </li> | ||
| 328 | - {{/each}} | ||
| 329 | - </ul> | ||
| 330 | - </li> | ||
| 331 | - {{/each}} | ||
| 332 | - {{/each}} | ||
| 333 | - | ||
| 334 | -</script> | ||
| 335 | -<script> | ||
| 336 | - delete window.require; | ||
| 337 | - delete window.exports; | ||
| 338 | - delete window.module; | ||
| 339 | -</script> | ||
| 340 | -<!-- jQuery --> | ||
| 341 | -<script src="/metronic_v4.5.4/plugins/jquery.min.js" data-exclude=1></script> | ||
| 342 | -<!-- bootstrap --> | ||
| 343 | -<script src="/metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js" | ||
| 344 | - data-exclude=1></script> | ||
| 345 | -<script src="/pages/forms/statement/js/jquery.autocompleter.js"></script> | ||
| 346 | -<script src="/pages/forms/statement/js/jquery.PrintArea.js"></script> | ||
| 347 | -<!-- MTRONIC JS --> | ||
| 348 | -<script src="/metronic_v4.5.4/scripts/app.min.js" data-exclude=1></script> | ||
| 349 | -<script src="/metronic_v4.5.4/layout4/scripts/layout.min.js" | ||
| 350 | - data-exclude=1></script> | ||
| 351 | -<!-- 虚拟滚动条 --> | ||
| 352 | -<script | ||
| 353 | - src="/metronic_v4.5.4/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script> | ||
| 354 | -<!-- jsTree 树插件 --> | ||
| 355 | -<script src="/metronic_v4.5.4/plugins/jstree/dist/jstree.min.js"></script> | ||
| 356 | -<!-- bootstrap-hover-dropDown --> | ||
| 357 | -<script | ||
| 358 | - src="/metronic_v4.5.4/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"></script> | ||
| 359 | -<!-- jquery.validate 表单验证 --> | ||
| 360 | -<script | ||
| 361 | - src="/metronic_v4.5.4/plugins/jquery-validation/js/jquery.validate.min.js"></script> | ||
| 362 | -<script | ||
| 363 | - src="/metronic_v4.5.4/plugins/jquery-validation/js/localization/messages_zh.js"></script> | ||
| 364 | -<!-- 向导式插件 --> | ||
| 365 | -<script | ||
| 366 | - src="/metronic_v4.5.4//plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script> | ||
| 367 | -<!-- iCheck 单选框和复选框 --> | ||
| 368 | -<script src="/metronic_v4.5.4/plugins/icheck/icheck.min.js"></script> | ||
| 369 | -<!-- select2 下拉框 --> | ||
| 370 | -<script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script> | ||
| 371 | -<!-- MULTI SELECT 多选下拉框 --> | ||
| 372 | -<script | ||
| 373 | - src="/metronic_v4.5.4/plugins/jquery-multi-select/js/jquery.multi-select.js"></script> | ||
| 374 | -<!-- editable.js --> | ||
| 375 | -<script | ||
| 376 | - src="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script> | ||
| 377 | -<!-- PJAX --> | ||
| 378 | -<script src="/assets/plugins/jquery.pjax.js"></script> | ||
| 379 | -<!-- layer 弹层 --> | ||
| 380 | -<script src="/assets/plugins/layer-v2.4/layer/layer.js" data-exclude=1></script> | ||
| 381 | -<!-- fileinput 上传 --> | ||
| 382 | -<script src="/assets/plugins/fileinput/canvas-to-blob.min.js"></script> | ||
| 383 | -<script src="/assets/plugins/fileinput/purify.min.js"></script> | ||
| 384 | -<script src="/assets/plugins/fileinput/sortable.min.js"></script> | ||
| 385 | -<script src="/assets/plugins/fileinput/fileinput.min.js"></script> | ||
| 386 | -<script src="/assets/plugins/fileinput/fileinput_locale_zh.js"></script> | ||
| 387 | -<!-- jquery.purl URL解析 --> | ||
| 388 | -<script src="/assets/plugins/purl.js"></script> | ||
| 389 | -<!-- jquery.serializejson JSON序列化插件 --> | ||
| 390 | -<script src="/assets/plugins/jquery.serializejson.js"></script> | ||
| 391 | -<!-- art-template 模版引擎 --> | ||
| 392 | -<script src="/assets/plugins/template.js"></script> | ||
| 393 | -<!-- jquery.pageinator 分页 --> | ||
| 394 | -<script src="/assets/plugins/jqPaginator.min.js"></script> | ||
| 395 | -<!-- moment.js 日期处理类库 --> | ||
| 396 | -<script src="/assets/plugins/moment-with-locales.js"></script> | ||
| 397 | - | ||
| 398 | -<script src="/assets/plugins/pinyin.js"></script> | ||
| 399 | -<!-- 日期控件 --> | ||
| 400 | -<script | ||
| 401 | - src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | ||
| 402 | -<!-- 表格控件 --> | ||
| 403 | -<script src="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script> | ||
| 404 | -<!-- 统计图控件 --> | ||
| 405 | -<!--<script src="/assets/global/getEchart.js"></script> | ||
| 406 | -<script src="/assets/global/echarts.js"></script> --> | ||
| 407 | -<script src="/assets/js/common.js"></script> | ||
| 408 | -<script src="/assets/js/dictionary.js"></script> | ||
| 409 | -<!-- tipso JS --> | ||
| 410 | -<script src="/metronic_v4.5.4/plugins/tipso/js/tipso.js"></script> | ||
| 411 | -<script data-exclude=1> | ||
| 412 | - //初始打开的片段地址 | ||
| 413 | - var initFragment = "^_^initFragment^_^"; | ||
| 414 | - //静态文件目录 | ||
| 415 | - var dir = '/pages/'; | ||
| 416 | - //片段容器 | ||
| 417 | - var pjaxContainer = '#pjax-container' | ||
| 418 | - , angJsContainer = '#route-container'; | ||
| 419 | - | ||
| 420 | - $(document).ajaxError(function (event, jqxhr, settings, thrownError) { | ||
| 421 | - if(jqxhr.status == 403){ | ||
| 422 | - layer.closeAll(); | ||
| 423 | - layer.alert(jqxhr.message?jqxhr.message:'访问被拒绝', {icon: 2, title: '操作失败'}); | ||
| 424 | - } | ||
| 425 | - }); | ||
| 426 | - | ||
| 427 | - $(function () { | ||
| 428 | - $.ajax({ | ||
| 429 | - url: '/user/isWeakCipher', | ||
| 430 | - type: 'POST', | ||
| 431 | - async: false, | ||
| 432 | - success: function (result,status,xhr) { | ||
| 433 | - if (result.data == 1) { | ||
| 434 | - $.get('/pages/permission/user/forceChangePWD.html', function (content) { | ||
| 435 | - layer.open({ | ||
| 436 | - type: 1, | ||
| 437 | - area: ['600px', '360px'], | ||
| 438 | - content: content, | ||
| 439 | - title: '修改密码', | ||
| 440 | - shift: 5, | ||
| 441 | - scrollbar: false, | ||
| 442 | - closeBtn: 0, | ||
| 443 | - success: function () { | ||
| 444 | - } | ||
| 445 | - }); | ||
| 446 | - }); | ||
| 447 | - } | ||
| 448 | - } | ||
| 449 | - }); | ||
| 450 | - | ||
| 451 | - $.get('/user/currentUser', function (user) { | ||
| 452 | - $('#indexTopUName').text(user.userName); | ||
| 453 | - }); | ||
| 454 | - | ||
| 455 | - //带 data-pjax 的链接由pjax加载 | ||
| 456 | - $(document).pjax('a[data-pjax]', pjaxContainer); | ||
| 457 | - | ||
| 458 | - //pjax左菜单点击事件 | ||
| 459 | - $(document).on('click', '#leftMenuSidebar a[data-pjax]', function () { | ||
| 460 | - setTitle(this); | ||
| 461 | - | ||
| 462 | - $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | ||
| 463 | - $(this).parent().addClass('active'); | ||
| 464 | - showPjax(); | ||
| 465 | - }); | ||
| 466 | - | ||
| 467 | - //angularjs左菜单点击事件 | ||
| 468 | - $(document).on('click', '#leftMenuSidebar a[data-angularjs]', function () { | ||
| 469 | - setTitle(this); | ||
| 470 | - | ||
| 471 | - $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | ||
| 472 | - $(this).parent().addClass('active'); | ||
| 473 | - showAngJs(); | ||
| 474 | - }); | ||
| 475 | - | ||
| 476 | - //加载左菜单栏 | ||
| 477 | - $get('/module/findByCurrentUser', null, | ||
| 478 | - function (ms) { | ||
| 479 | - var treeArray = createTreeData(ms); | ||
| 480 | - treeArray.sort(function (a, b) { | ||
| 481 | - return a.createDate - b.createDate; | ||
| 482 | - }); | ||
| 483 | - var menuHtml = template('menu_list_temp', {list: treeArray}); | ||
| 484 | - $('#leftMenuSidebar').html(menuHtml); | ||
| 485 | - | ||
| 486 | - //----------- 检查URL ---------------- | ||
| 487 | - var h = location.hash; | ||
| 488 | - if (initFragment && initFragment != '') { | ||
| 489 | - showPjax(); | ||
| 490 | - //普通片段 | ||
| 491 | - loadPage(initFragment); | ||
| 492 | - //选中菜单 | ||
| 493 | - $.each($('#leftMenuSidebar a'), function (i, item) { | ||
| 494 | - if (urlPattern($(item).attr('href'), initFragment)) { | ||
| 495 | - activeLeftMenu(item); | ||
| 496 | - } | ||
| 497 | - }); | ||
| 498 | - } else if (h) { | ||
| 499 | - //angularjs片段 | ||
| 500 | - showAngJs(); | ||
| 501 | - //选中菜单 | ||
| 502 | - $.each($('#leftMenuSidebar a'), function (i, item) { | ||
| 503 | - if ($(item).attr('href') == h) { | ||
| 504 | - activeLeftMenu(item); | ||
| 505 | - } | ||
| 506 | - }); | ||
| 507 | - } | ||
| 508 | - else { | ||
| 509 | - //加载主页 | ||
| 510 | - loadPage('/pages/home.html'); | ||
| 511 | - } | ||
| 512 | - }); | ||
| 513 | - | ||
| 514 | - //修改密码 | ||
| 515 | - $('#changePWD').on('click', function () { | ||
| 516 | - $.get('/pages/permission/user/changePWD.html', function (content) { | ||
| 517 | - layer.open({ | ||
| 518 | - type: 1, | ||
| 519 | - area: ['600px', '360px'], | ||
| 520 | - content: content, | ||
| 521 | - title: '修改密码', | ||
| 522 | - shift: 5, | ||
| 523 | - scrollbar: false, | ||
| 524 | - success: function () { | ||
| 525 | - } | ||
| 526 | - }); | ||
| 527 | - }); | ||
| 528 | - }); | ||
| 529 | - }); | ||
| 530 | - | ||
| 531 | - //modal关闭时销毁dom | ||
| 532 | - $(document).on('hidden.bs.modal', '.modal', function () { | ||
| 533 | - $(this).remove(); | ||
| 534 | - }); | ||
| 535 | - | ||
| 536 | - //pjax加载完成事件 | ||
| 537 | - $(document).on('pjax:success', function () { | ||
| 538 | - var dicts = $(pjaxContainer).find('.nt-dictionary'); | ||
| 539 | - dictionaryUtils.transformDom(dicts); | ||
| 540 | - }); | ||
| 541 | - | ||
| 542 | - function loadPage(url) { | ||
| 543 | - $.pjax({url: url, container: pjaxContainer}) | ||
| 544 | - } | ||
| 545 | - | ||
| 546 | - function urlPattern(a, b) { | ||
| 547 | - var r; | ||
| 548 | - try { | ||
| 549 | - r = a.substring(0, a.lastIndexOf('/')) == b.substring(0, b.lastIndexOf('/')); | ||
| 550 | - } catch (e) { | ||
| 551 | - r = false; | ||
| 552 | - } | ||
| 553 | - return r; | ||
| 554 | - } | ||
| 555 | - | ||
| 556 | - function showPjax() { | ||
| 557 | - $(angJsContainer).removeClass('page-content active').hide(); | ||
| 558 | - $(pjaxContainer).addClass('page-content active'); | ||
| 559 | - } | ||
| 560 | - | ||
| 561 | - function showAngJs() { | ||
| 562 | - $(pjaxContainer).html('').removeClass('page-content active').hide(); | ||
| 563 | - $(angJsContainer).addClass('page-content active'); | ||
| 564 | - } | ||
| 565 | - | ||
| 566 | - function activeLeftMenu(item) { | ||
| 567 | - $(item).parent('.nav-item').addClass('active').parent('.sub-menu').show().parent().addClass('open'); | ||
| 568 | - setTitle(item); | ||
| 569 | - } | ||
| 570 | - | ||
| 571 | - function setTitle(menuItem){ | ||
| 572 | - document.title = $('span.title', menuItem).text(); | ||
| 573 | - } | ||
| 574 | - | ||
| 575 | -</script> | ||
| 576 | -<!-- d3 --> | ||
| 577 | -<script src="/assets/js/d3.min.js" data-exclude=1></script> | ||
| 578 | -<!-- webSocket JS --> | ||
| 579 | -<script src="/assets/js/sockjs.min.js"></script> | ||
| 580 | - | ||
| 581 | -<!-- TODO:angularJS相关库 --> | ||
| 582 | - | ||
| 583 | -<!-- angularJS相关库 --> | ||
| 584 | -<!-- 这个是基于angularjs 1.4.10修改的版本,主要是修改了history控制部分,用于兼容route和pjax的同时操作history的冲突 --> | ||
| 585 | -<script src="/assets/js/angular.js" data-autocephaly=1></script> | ||
| 586 | -<script src="/assets/bower_components/angular-i18n/angular-locale_zh-cn.js" data-autocephaly=1></script> | ||
| 587 | -<script | ||
| 588 | - src="/assets/bower_components/angular-resource/angular-resource.min.js" | ||
| 589 | - data-exclude=1></script> | ||
| 590 | -<script | ||
| 591 | - src="/assets/bower_components/angular-sanitize/angular-sanitize.min.js" | ||
| 592 | - data-exclude=1></script> | ||
| 593 | -<script | ||
| 594 | - src="/assets/bower_components/angular-animate/angular-animate.min.js" | ||
| 595 | - data-exclude=1></script> | ||
| 596 | -<script | ||
| 597 | - src="/assets/bower_components/angular-touch/angular-touch.min.js" | ||
| 598 | - data-exclude=1></script> | ||
| 599 | -<script | ||
| 600 | - src="/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js" | ||
| 601 | - data-exclude=1></script> | ||
| 602 | -<script | ||
| 603 | - src="/assets/bower_components/oclazyload/dist/ocLazyLoad.min.js" | ||
| 604 | - data-exclude=1></script> | ||
| 605 | -<script | ||
| 606 | - src="/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js" | ||
| 607 | - data-exclude=1></script> | ||
| 608 | -<!-- handsontable相关js --> | ||
| 609 | -<script | ||
| 610 | - src="/assets/bower_components/handsontable/dist/handsontable.full.js"></script> | ||
| 611 | -<script | ||
| 612 | - src="/assets/bower_components/ngHandsontable/dist/ngHandsontable.js"></script> | ||
| 613 | -<!-- sweetalert相关js --> | ||
| 614 | -<script src="/assets/bower_components/sweetalert/dist/sweetalert.min.js"></script> | ||
| 615 | -<script src="/assets/bower_components/ng-sweet-alert/ng-sweet-alert.js"></script> | ||
| 616 | - | ||
| 617 | -<!-- schedule计划调度AngularJS模块主JS --> | ||
| 618 | -<script src="/pages/scheduleApp/module/common/main.js" data-exclude=1></script> | ||
| 619 | -<script | ||
| 620 | - src="/pages/scheduleApp/module/common/prj-common-globalservice.js" | ||
| 621 | - data-exclude=1></script> | ||
| 622 | -<script src="/pages/scheduleApp/module/common/prj-common-filter.js" | ||
| 623 | - data-exclude=1></script> | ||
| 624 | -<script src="/pages/scheduleApp/module/common/prj-common-directive.js" | ||
| 625 | - data-exclude=1></script> | ||
| 626 | -<script | ||
| 627 | - src="/pages/scheduleApp/module/common/prj-common-ui-route-state.js" | ||
| 628 | - data-exclude=1></script> | ||
| 629 | - | ||
| 630 | -<!-- 地图相关 --> | ||
| 631 | -<!-- 百度 --> | ||
| 632 | -<script | ||
| 633 | - src="//api.map.baidu.com/api?v=3.0&ak=IGGrr4UjwIYzatoCRFKEL8sT" | ||
| 634 | - data-exclude=1></script> | ||
| 635 | -<script | ||
| 636 | - src="//api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js" | ||
| 637 | - data-exclude=1></script> | ||
| 638 | -<script type="text/javascript" | ||
| 639 | - src="//api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js" | ||
| 640 | - data-exclude=1></script> | ||
| 641 | -<script type="text/javascript" | ||
| 642 | - src="//api.map.baidu.com/library/RichMarker/1.2/src/RichMarker_min.js " | ||
| 643 | - data-exclude=1></script> | ||
| 644 | -<script src="/assets/js/baidu/TextIconOverlay.js" data-exclude=1></script> | ||
| 645 | -<script src="/assets/js/baidu//MarkerClusterer.js" data-exclude=1></script> | ||
| 646 | -<!-- 高德 --> | ||
| 647 | -<script | ||
| 648 | - src="//webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda" | ||
| 649 | - data-exclude=1></script> | ||
| 650 | -<!-- echarts4 --> | ||
| 651 | -<script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script> | ||
| 652 | -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | ||
| 653 | -<!-- RSA加密 --> | ||
| 654 | -<script src="/assets/plugins/jsencrypt.min.js"></script> | ||
| 655 | -<script src="/assets/js/eventproxy.js"></script> | ||
| 656 | -</body> | 1 | +<!DOCTYPE html> |
| 2 | +<html lang="zh"> | ||
| 3 | +<head> | ||
| 4 | + <meta name="renderer" content="webkit" /> | ||
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
| 6 | + <meta charset="UTF-8"> | ||
| 7 | + <title>调度系统</title> | ||
| 8 | + | ||
| 9 | + <meta http-equiv="Pragma" content="no-cache"> | ||
| 10 | + <meta http-equiv="Cache-control" content="no-cache"> | ||
| 11 | + <meta http-equiv="Cache" content="no-cache"> | ||
| 12 | + | ||
| 13 | + <!-- Font Awesome 图标字体 --> | ||
| 14 | + <link | ||
| 15 | + href="/metronic_v4.5.4/plugins/font-awesome/css/font-awesome.min.css" | ||
| 16 | + rel="stylesheet" type="text/css" /> | ||
| 17 | + <!-- Bootstrap style --> | ||
| 18 | + <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" | ||
| 19 | + rel="stylesheet" type="text/css" /> | ||
| 20 | + <!-- jsTree 数插件 --> | ||
| 21 | + <link | ||
| 22 | + href="/metronic_v4.5.4/plugins/jstree/dist/themes/default/style.min.css" | ||
| 23 | + rel="stylesheet" type="text/css" /> | ||
| 24 | + <!-- MULTI-select 多选下拉框美化 --> | ||
| 25 | + <link | ||
| 26 | + href="/metronic_v4.5.4/plugins/jquery-multi-select/css/multi-select.css" | ||
| 27 | + rel="stylesheet" type="text/css" /> | ||
| 28 | + | ||
| 29 | + <!-- editable --> | ||
| 30 | + <link | ||
| 31 | + href="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css" | ||
| 32 | + rel="stylesheet" type="text/css" /> | ||
| 33 | + <!-- METRONIC style --> | ||
| 34 | + <link href="/metronic_v4.5.4/layout4/css/themes/light.min.css" | ||
| 35 | + rel="stylesheet" type="text/css" id="style_color" /> | ||
| 36 | + <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" | ||
| 37 | + type="text/css" /> | ||
| 38 | + <link href="/metronic_v4.5.4/css/plugins.css" rel="stylesheet" | ||
| 39 | + type="text/css" /> | ||
| 40 | + <link href="/metronic_v4.5.4/layout4/css/layout.min.css" | ||
| 41 | + rel="stylesheet" type="text/css" /> | ||
| 42 | + <link href="/metronic_v4.5.4/layout4/css/custom.min.css" | ||
| 43 | + rel="stylesheet" type="text/css" /> | ||
| 44 | + <!-- select2 下拉框插件 --> | ||
| 45 | + <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" | ||
| 46 | + rel="stylesheet" type="text/css" /> | ||
| 47 | + <link | ||
| 48 | + href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" | ||
| 49 | + rel="stylesheet" type="text/css" /> | ||
| 50 | + <!-- layer 弹层 插件 --> | ||
| 51 | + <link href="/assets/plugins/layer-v2.4/layer/skin/layer.css" | ||
| 52 | + rel="stylesheet" type="text/css" /> | ||
| 53 | + <!-- fileinput 上传 插件 --> | ||
| 54 | + <link href="/assets/plugins/fileinput/css/fileinput.min.css" | ||
| 55 | + rel="stylesheet" type="text/css" /> | ||
| 56 | + <!-- iCheck 单选框和复选框 --> | ||
| 57 | + <link href="/metronic_v4.5.4/plugins/icheck/skins/all.css" | ||
| 58 | + rel="stylesheet" type="text/css" /> | ||
| 59 | + <!-- 日期控件 --> | ||
| 60 | + <link | ||
| 61 | + href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css" | ||
| 62 | + rel="stylesheet" type="text/css" /> | ||
| 63 | + <!-- table 表格控件 --> | ||
| 64 | + <!--<link rel="stylesheet"--> | ||
| 65 | + <!--href="//api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"--> | ||
| 66 | + <!--type="text/css" />--> | ||
| 67 | + <link href="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet" type="text/css"/> | ||
| 68 | + <!-- handsontable样式 --> | ||
| 69 | + <link rel="stylesheet" | ||
| 70 | + href="/assets/bower_components/handsontable/dist/handsontable.full.css" /> | ||
| 71 | + <!-- sweetalert样式 --> | ||
| 72 | + <link rel="stylesheet" | ||
| 73 | + href="/assets/bower_components/sweetalert/dist/sweetalert.css" /> | ||
| 74 | + <!-- schedule计划调度AngularJS模块主css --> | ||
| 75 | + <link rel="stylesheet" href="/pages/scheduleApp/module/common/main.css" | ||
| 76 | + type="text/css" /> | ||
| 77 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | ||
| 78 | + | ||
| 79 | + <!-- CSS动画 --> | ||
| 80 | + <link | ||
| 81 | + href="/metronic_v4.5.4/plugins/tipso/css/animate.css" | ||
| 82 | + rel="stylesheet" type="text/css" /> | ||
| 83 | + | ||
| 84 | + <!-- 提示工具样式 --> | ||
| 85 | + <link | ||
| 86 | + href="/metronic_v4.5.4/plugins/tipso/css/tipso.css" | ||
| 87 | + rel="stylesheet" type="text/css" /> | ||
| 88 | + | ||
| 89 | + <style type="text/css"> | ||
| 90 | + .searchForm { | ||
| 91 | + | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + .searchForm .form-group .control-label { | ||
| 95 | + padding-right: 0px; | ||
| 96 | + text-align: right; | ||
| 97 | + margin-top: 7px; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + .searchForm .form-group>div { | ||
| 101 | + padding-left: 10px; | ||
| 102 | + padding-right: 0px; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + .searchForm .row>div { | ||
| 106 | + padding-left: 0px; | ||
| 107 | + padding-right: 0px; | ||
| 108 | + padding: 5px 0 5px 0; | ||
| 109 | + width: 270px; | ||
| 110 | + display: inline-block; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + .searchForm .form-actions { | ||
| 114 | + | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + tr.row-active td { | ||
| 118 | + border-bottom: 1px solid blue !important; | ||
| 119 | + color: blue; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | ||
| 123 | + { | ||
| 124 | + font-size: 14px; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | ||
| 128 | + { | ||
| 129 | + padding: 6px 26px; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + .ms-container .ms-list { | ||
| 133 | + height: 306px; | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + .ms-container .ms-selectable,.ms-container .ms-selection { | ||
| 137 | + width: 47%; | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + .ms-container { | ||
| 141 | + width: 470px; | ||
| 142 | + margin: auto; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + .multi-custom-header-left { | ||
| 146 | + text-align: center; | ||
| 147 | + padding: 7px; | ||
| 148 | + color: #3B3F51; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + .multi-custom-header-right { | ||
| 152 | + text-align: center; | ||
| 153 | + padding: 7px; | ||
| 154 | + font-weight: bold; | ||
| 155 | + color: #36C6D3; | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + .mt-element-list .list-simple.mt-list-container ul>.mt-list-item>.list-item-content | ||
| 159 | + { | ||
| 160 | + padding: 0 55px 0 0px; | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + .mt-element-list .list-simple.mt-list-container ul>.mt-list-item { | ||
| 164 | + padding: 3.3px 0; | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + #route-container { | ||
| 168 | + display: none; | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + .page-content.active { | ||
| 172 | + display: block !important; | ||
| 173 | + } | ||
| 174 | + | ||
| 175 | + .page-header.navbar .page-logo .logo-default { | ||
| 176 | + margin: 0; | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + .page-header.navbar .top-menu .navbar-nav>li.dropdown.open .dropdown-toggle | ||
| 180 | + { | ||
| 181 | + background-color: #284a99; | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + .page-header.navbar .page-logo { | ||
| 185 | + padding-right: 10px; | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + .page-logo .logo-default.logo-default-text { | ||
| 189 | + font-weight: 600; | ||
| 190 | + color: white !important; | ||
| 191 | + margin-top: 19px !important; | ||
| 192 | + font-size: 20px; | ||
| 193 | + text-decoration: none; | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + .page-logo .logo-default.logo-default-text:HOVER { | ||
| 197 | + color: #dedede !important; | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + body,.page-content-wrapper,#pjax-container{ | ||
| 201 | + height: 100%; | ||
| 202 | + } | ||
| 203 | + html{ | ||
| 204 | + height: 90%; | ||
| 205 | + } | ||
| 206 | + .page-container{ | ||
| 207 | + height: 100%; | ||
| 208 | + } | ||
| 209 | + </style> | ||
| 210 | + | ||
| 211 | + <!-- ocLazyLoading载入文件的位置 --> | ||
| 212 | + <link id="ng_load_plugins_before" /> | ||
| 213 | + | ||
| 214 | +</head> | ||
| 215 | +<body | ||
| 216 | + class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo page-sidebar-fixed"> | ||
| 217 | +<div class="page-header navbar navbar-fixed-top" | ||
| 218 | + style="background: linear-gradient(to bottom, #124e78, #125688);"> | ||
| 219 | + <div class="page-header-inner "> | ||
| 220 | + <!-- LOGO --> | ||
| 221 | + <div class="page-logo"> | ||
| 222 | + <a href="index.html" class="logo-default logo-default-text"> | ||
| 223 | + 智慧公交运营管理系统 </a> | ||
| 224 | + <div class="menu-toggler sidebar-toggler"></div> | ||
| 225 | + </div> | ||
| 226 | + <!-- END LOGO --> | ||
| 227 | + <a href="javascript:;" class="menu-toggler responsive-toggler" | ||
| 228 | + data-toggle="collapse" data-target=".navbar-collapse"> </a> | ||
| 229 | + <div class="page-top"> | ||
| 230 | + <div class="top-menu"> | ||
| 231 | + <ul class="nav navbar-nav pull-right"> | ||
| 232 | + <!-- 信息通知区 --> | ||
| 233 | + <li | ||
| 234 | + class="dropdown dropdown-extended dropdown-notification dropdown-dark" | ||
| 235 | + id="header_notification_bar"><a href="javascript:;" | ||
| 236 | + class="dropdown-toggle" data-toggle="dropdown" | ||
| 237 | + data-hover="dropdown" data-close-others="true"> <i | ||
| 238 | + class="fa fa-bell"></i> <span class="badge badge-success"> | ||
| 239 | + 0 </span> | ||
| 240 | + </a> | ||
| 241 | + <ul class="dropdown-menu" style="max-width: 345px; width: 345px;"> | ||
| 242 | + <li class="external"> | ||
| 243 | + <h3> | ||
| 244 | + 今日 <span class="bold">0 条</span> 通知 | ||
| 245 | + </h3> <a href="javascript:;">查看全部</a> | ||
| 246 | + </li> | ||
| 247 | + <li> | ||
| 248 | + <ul class="dropdown-menu-list scroller" style="height: 250px;" | ||
| 249 | + data-handle-color="#637283"> | ||
| 250 | + </ul> | ||
| 251 | + </li> | ||
| 252 | + </ul></li> | ||
| 253 | + <li class="dropdown dropdown-user dropdown-dark"><a | ||
| 254 | + href="javascript:;" class="dropdown-toggle" | ||
| 255 | + data-toggle="dropdown" data-hover="dropdown" | ||
| 256 | + data-close-others="true"> <span id="indexTopUName" | ||
| 257 | + class="username username-hide-on-mobile" | ||
| 258 | + style="vertical-align: middle;"> <i class="fa fa-user"></i></span> | ||
| 259 | + </a> | ||
| 260 | + <ul class="dropdown-menu dropdown-menu-default"> | ||
| 261 | + <li><a href="javascript:;" id="changePWD"> <i | ||
| 262 | + class="fa fa-unlock-alt"></i> 修改密码 | ||
| 263 | + </a></li> | ||
| 264 | + <li class="divider"></li> | ||
| 265 | + <li><a href="/logout"> <i class="fa fa-key"></i> 注销登陆 | ||
| 266 | + </a></li> | ||
| 267 | + </ul></li> | ||
| 268 | + </ul> | ||
| 269 | + </div> | ||
| 270 | + </div> | ||
| 271 | + </div> | ||
| 272 | +</div> | ||
| 273 | +<div class="page-container"> | ||
| 274 | + <div class="page-sidebar-wrapper"> | ||
| 275 | + <div class="page-sidebar navbar-collapse collapse"> | ||
| 276 | + <ul class="page-sidebar-menu page-sidebar-menu-fixed" | ||
| 277 | + data-keep-expanded="false" data-auto-scroll="true" | ||
| 278 | + data-slide-speed="200" id="leftMenuSidebar"> | ||
| 279 | + </ul> | ||
| 280 | + </div> | ||
| 281 | + </div> | ||
| 282 | + <div class="page-content-wrapper"> | ||
| 283 | + <div id="pjax-container" class="page-content"></div> | ||
| 284 | + | ||
| 285 | + <div id="route-container"> | ||
| 286 | + <div ng-app="ScheduleApp"> | ||
| 287 | + <div ng-controller="ScheduleAppController"> | ||
| 288 | + | ||
| 289 | + <!-- loading widget --> | ||
| 290 | + <div id="loadingWidget" class="flyover mask" loading-widget> | ||
| 291 | + <div class="alert alert-info"> | ||
| 292 | + <strong>载入中......</strong> | ||
| 293 | + </div> | ||
| 294 | + </div> | ||
| 295 | + | ||
| 296 | + <div ui-view class="uv"></div> | ||
| 297 | + </div> | ||
| 298 | + </div> | ||
| 299 | + </div> | ||
| 300 | + </div> | ||
| 301 | +</div> | ||
| 302 | + | ||
| 303 | +<script id="menu_list_temp" type="text/html"> | ||
| 304 | + {{each list as group i}} | ||
| 305 | + <li class="heading"> | ||
| 306 | + <h3 class="uppercase">{{group.name}}</h3> | ||
| 307 | + </li> | ||
| 308 | + {{each group.children as dir j}} | ||
| 309 | + <li class="nav-item"> | ||
| 310 | + <a href="javascript:;" class="nav-link nav-toggle "> | ||
| 311 | + <i class="{{dir.icon}}"></i> | ||
| 312 | + <span class="title">{{dir.name}}</span> | ||
| 313 | + <span class="arrow"></span> | ||
| 314 | + </a> | ||
| 315 | + <ul class="sub-menu"> | ||
| 316 | + {{each dir.children as module s}} | ||
| 317 | + <li class="nav-item "> | ||
| 318 | + {{if module.container=="pjax-container"}} | ||
| 319 | + <a href="/pages/{{module.path}}" class="nav-link " data-pjax> | ||
| 320 | + <span class="title">{{module.name}}</span> | ||
| 321 | + </a> | ||
| 322 | + {{else}} | ||
| 323 | + <a href="{{module.path}}" class="nav-link " data-angularjs> | ||
| 324 | + <span class="title">{{module.name}}</span> | ||
| 325 | + </a> | ||
| 326 | + {{/if}} | ||
| 327 | + </li> | ||
| 328 | + {{/each}} | ||
| 329 | + </ul> | ||
| 330 | + </li> | ||
| 331 | + {{/each}} | ||
| 332 | + {{/each}} | ||
| 333 | + | ||
| 334 | +</script> | ||
| 335 | +<script> | ||
| 336 | + delete window.require; | ||
| 337 | + delete window.exports; | ||
| 338 | + delete window.module; | ||
| 339 | +</script> | ||
| 340 | +<!-- jQuery --> | ||
| 341 | +<script src="/metronic_v4.5.4/plugins/jquery.min.js" data-exclude=1></script> | ||
| 342 | +<!-- bootstrap --> | ||
| 343 | +<script src="/metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js" | ||
| 344 | + data-exclude=1></script> | ||
| 345 | +<script src="/pages/forms/statement/js/jquery.autocompleter.js"></script> | ||
| 346 | +<script src="/pages/forms/statement/js/jquery.PrintArea.js"></script> | ||
| 347 | +<!-- MTRONIC JS --> | ||
| 348 | +<script src="/metronic_v4.5.4/scripts/app.min.js" data-exclude=1></script> | ||
| 349 | +<script src="/metronic_v4.5.4/layout4/scripts/layout.min.js" | ||
| 350 | + data-exclude=1></script> | ||
| 351 | +<!-- 虚拟滚动条 --> | ||
| 352 | +<script | ||
| 353 | + src="/metronic_v4.5.4/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script> | ||
| 354 | +<!-- jsTree 树插件 --> | ||
| 355 | +<script src="/metronic_v4.5.4/plugins/jstree/dist/jstree.min.js"></script> | ||
| 356 | +<!-- bootstrap-hover-dropDown --> | ||
| 357 | +<script | ||
| 358 | + src="/metronic_v4.5.4/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"></script> | ||
| 359 | +<!-- jquery.validate 表单验证 --> | ||
| 360 | +<script | ||
| 361 | + src="/metronic_v4.5.4/plugins/jquery-validation/js/jquery.validate.min.js"></script> | ||
| 362 | +<script | ||
| 363 | + src="/metronic_v4.5.4/plugins/jquery-validation/js/localization/messages_zh.js"></script> | ||
| 364 | +<!-- 向导式插件 --> | ||
| 365 | +<script | ||
| 366 | + src="/metronic_v4.5.4//plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script> | ||
| 367 | +<!-- iCheck 单选框和复选框 --> | ||
| 368 | +<script src="/metronic_v4.5.4/plugins/icheck/icheck.min.js"></script> | ||
| 369 | +<!-- select2 下拉框 --> | ||
| 370 | +<script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script> | ||
| 371 | +<!-- MULTI SELECT 多选下拉框 --> | ||
| 372 | +<script | ||
| 373 | + src="/metronic_v4.5.4/plugins/jquery-multi-select/js/jquery.multi-select.js"></script> | ||
| 374 | +<!-- editable.js --> | ||
| 375 | +<script | ||
| 376 | + src="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script> | ||
| 377 | +<!-- PJAX --> | ||
| 378 | +<script src="/assets/plugins/jquery.pjax.js"></script> | ||
| 379 | +<!-- layer 弹层 --> | ||
| 380 | +<script src="/assets/plugins/layer-v2.4/layer/layer.js" data-exclude=1></script> | ||
| 381 | +<!-- fileinput 上传 --> | ||
| 382 | +<script src="/assets/plugins/fileinput/canvas-to-blob.min.js"></script> | ||
| 383 | +<script src="/assets/plugins/fileinput/purify.min.js"></script> | ||
| 384 | +<script src="/assets/plugins/fileinput/sortable.min.js"></script> | ||
| 385 | +<script src="/assets/plugins/fileinput/fileinput.min.js"></script> | ||
| 386 | +<script src="/assets/plugins/fileinput/fileinput_locale_zh.js"></script> | ||
| 387 | +<!-- jquery.purl URL解析 --> | ||
| 388 | +<script src="/assets/plugins/purl.js"></script> | ||
| 389 | +<!-- jquery.serializejson JSON序列化插件 --> | ||
| 390 | +<script src="/assets/plugins/jquery.serializejson.js"></script> | ||
| 391 | +<!-- art-template 模版引擎 --> | ||
| 392 | +<script src="/assets/plugins/template.js"></script> | ||
| 393 | +<!-- jquery.pageinator 分页 --> | ||
| 394 | +<script src="/assets/plugins/jqPaginator.min.js"></script> | ||
| 395 | +<!-- moment.js 日期处理类库 --> | ||
| 396 | +<script src="/assets/plugins/moment-with-locales.js"></script> | ||
| 397 | + | ||
| 398 | +<script src="/assets/plugins/pinyin.js"></script> | ||
| 399 | +<!-- 日期控件 --> | ||
| 400 | +<script | ||
| 401 | + src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | ||
| 402 | +<!-- 表格控件 --> | ||
| 403 | +<script src="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script> | ||
| 404 | +<!-- 统计图控件 --> | ||
| 405 | +<!--<script src="/assets/global/getEchart.js"></script> | ||
| 406 | +<script src="/assets/global/echarts.js"></script> --> | ||
| 407 | +<script src="/assets/js/common.js"></script> | ||
| 408 | +<script src="/assets/js/dictionary.js"></script> | ||
| 409 | +<!-- tipso JS --> | ||
| 410 | +<script src="/metronic_v4.5.4/plugins/tipso/js/tipso.js"></script> | ||
| 411 | +<script data-exclude=1> | ||
| 412 | + //初始打开的片段地址 | ||
| 413 | + var initFragment = "^_^initFragment^_^"; | ||
| 414 | + //静态文件目录 | ||
| 415 | + var dir = '/pages/'; | ||
| 416 | + //片段容器 | ||
| 417 | + var pjaxContainer = '#pjax-container' | ||
| 418 | + , angJsContainer = '#route-container'; | ||
| 419 | + | ||
| 420 | + $(document).ajaxError(function (event, jqxhr, settings, thrownError) { | ||
| 421 | + if(jqxhr.status == 403){ | ||
| 422 | + layer.closeAll(); | ||
| 423 | + layer.alert(jqxhr.message?jqxhr.message:'访问被拒绝', {icon: 2, title: '操作失败'}); | ||
| 424 | + } | ||
| 425 | + }); | ||
| 426 | + | ||
| 427 | + $(function () { | ||
| 428 | + $.ajax({ | ||
| 429 | + url: '/user/isWeakCipher', | ||
| 430 | + type: 'POST', | ||
| 431 | + async: false, | ||
| 432 | + success: function (result,status,xhr) { | ||
| 433 | + if (result.data == 1) { | ||
| 434 | + $.get('/pages/permission/user/forceChangePWD.html', function (content) { | ||
| 435 | + layer.open({ | ||
| 436 | + type: 1, | ||
| 437 | + area: ['600px', '360px'], | ||
| 438 | + content: content, | ||
| 439 | + title: '修改密码', | ||
| 440 | + shift: 5, | ||
| 441 | + scrollbar: false, | ||
| 442 | + closeBtn: 0, | ||
| 443 | + success: function () { | ||
| 444 | + } | ||
| 445 | + }); | ||
| 446 | + }); | ||
| 447 | + } | ||
| 448 | + } | ||
| 449 | + }); | ||
| 450 | + | ||
| 451 | + $.get('/user/currentUser', function (user) { | ||
| 452 | + $('#indexTopUName').text(user.userName); | ||
| 453 | + }); | ||
| 454 | + | ||
| 455 | + //带 data-pjax 的链接由pjax加载 | ||
| 456 | + $(document).pjax('a[data-pjax]', pjaxContainer); | ||
| 457 | + | ||
| 458 | + //pjax左菜单点击事件 | ||
| 459 | + $(document).on('click', '#leftMenuSidebar a[data-pjax]', function () { | ||
| 460 | + setTitle(this); | ||
| 461 | + | ||
| 462 | + $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | ||
| 463 | + $(this).parent().addClass('active'); | ||
| 464 | + showPjax(); | ||
| 465 | + }); | ||
| 466 | + | ||
| 467 | + //angularjs左菜单点击事件 | ||
| 468 | + $(document).on('click', '#leftMenuSidebar a[data-angularjs]', function () { | ||
| 469 | + setTitle(this); | ||
| 470 | + | ||
| 471 | + $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | ||
| 472 | + $(this).parent().addClass('active'); | ||
| 473 | + showAngJs(); | ||
| 474 | + }); | ||
| 475 | + | ||
| 476 | + //加载左菜单栏 | ||
| 477 | + $get('/module/findByCurrentUser', null, | ||
| 478 | + function (ms) { | ||
| 479 | + var treeArray = createTreeData(ms); | ||
| 480 | + treeArray.sort(function (a, b) { | ||
| 481 | + return a.createDate - b.createDate; | ||
| 482 | + }); | ||
| 483 | + var menuHtml = template('menu_list_temp', {list: treeArray}); | ||
| 484 | + $('#leftMenuSidebar').html(menuHtml); | ||
| 485 | + | ||
| 486 | + //----------- 检查URL ---------------- | ||
| 487 | + var h = location.hash; | ||
| 488 | + if (initFragment && initFragment != '') { | ||
| 489 | + showPjax(); | ||
| 490 | + //普通片段 | ||
| 491 | + loadPage(initFragment); | ||
| 492 | + //选中菜单 | ||
| 493 | + $.each($('#leftMenuSidebar a'), function (i, item) { | ||
| 494 | + if (urlPattern($(item).attr('href'), initFragment)) { | ||
| 495 | + activeLeftMenu(item); | ||
| 496 | + } | ||
| 497 | + }); | ||
| 498 | + } else if (h) { | ||
| 499 | + //angularjs片段 | ||
| 500 | + showAngJs(); | ||
| 501 | + //选中菜单 | ||
| 502 | + $.each($('#leftMenuSidebar a'), function (i, item) { | ||
| 503 | + if ($(item).attr('href') == h) { | ||
| 504 | + activeLeftMenu(item); | ||
| 505 | + } | ||
| 506 | + }); | ||
| 507 | + } | ||
| 508 | + else { | ||
| 509 | + //加载主页 | ||
| 510 | + loadPage('/pages/home.html'); | ||
| 511 | + } | ||
| 512 | + }); | ||
| 513 | + | ||
| 514 | + //修改密码 | ||
| 515 | + $('#changePWD').on('click', function () { | ||
| 516 | + $.get('/pages/permission/user/changePWD.html', function (content) { | ||
| 517 | + layer.open({ | ||
| 518 | + type: 1, | ||
| 519 | + area: ['600px', '360px'], | ||
| 520 | + content: content, | ||
| 521 | + title: '修改密码', | ||
| 522 | + shift: 5, | ||
| 523 | + scrollbar: false, | ||
| 524 | + success: function () { | ||
| 525 | + } | ||
| 526 | + }); | ||
| 527 | + }); | ||
| 528 | + }); | ||
| 529 | + }); | ||
| 530 | + | ||
| 531 | + //modal关闭时销毁dom | ||
| 532 | + $(document).on('hidden.bs.modal', '.modal', function () { | ||
| 533 | + $(this).remove(); | ||
| 534 | + }); | ||
| 535 | + | ||
| 536 | + //pjax加载完成事件 | ||
| 537 | + $(document).on('pjax:success', function () { | ||
| 538 | + var dicts = $(pjaxContainer).find('.nt-dictionary'); | ||
| 539 | + dictionaryUtils.transformDom(dicts); | ||
| 540 | + }); | ||
| 541 | + | ||
| 542 | + function loadPage(url) { | ||
| 543 | + $.pjax({url: url, container: pjaxContainer}) | ||
| 544 | + } | ||
| 545 | + | ||
| 546 | + function urlPattern(a, b) { | ||
| 547 | + var r; | ||
| 548 | + try { | ||
| 549 | + r = a.substring(0, a.lastIndexOf('/')) == b.substring(0, b.lastIndexOf('/')); | ||
| 550 | + } catch (e) { | ||
| 551 | + r = false; | ||
| 552 | + } | ||
| 553 | + return r; | ||
| 554 | + } | ||
| 555 | + | ||
| 556 | + function showPjax() { | ||
| 557 | + $(angJsContainer).removeClass('page-content active').hide(); | ||
| 558 | + $(pjaxContainer).addClass('page-content active'); | ||
| 559 | + } | ||
| 560 | + | ||
| 561 | + function showAngJs() { | ||
| 562 | + $(pjaxContainer).html('').removeClass('page-content active').hide(); | ||
| 563 | + $(angJsContainer).addClass('page-content active'); | ||
| 564 | + } | ||
| 565 | + | ||
| 566 | + function activeLeftMenu(item) { | ||
| 567 | + $(item).parent('.nav-item').addClass('active').parent('.sub-menu').show().parent().addClass('open'); | ||
| 568 | + setTitle(item); | ||
| 569 | + } | ||
| 570 | + | ||
| 571 | + function setTitle(menuItem){ | ||
| 572 | + document.title = $('span.title', menuItem).text(); | ||
| 573 | + } | ||
| 574 | + | ||
| 575 | +</script> | ||
| 576 | +<!-- d3 --> | ||
| 577 | +<script src="/assets/js/d3.min.js" data-exclude=1></script> | ||
| 578 | +<!-- webSocket JS --> | ||
| 579 | +<script src="/assets/js/sockjs.min.js"></script> | ||
| 580 | + | ||
| 581 | +<!-- TODO:angularJS相关库 --> | ||
| 582 | + | ||
| 583 | +<!-- angularJS相关库 --> | ||
| 584 | +<!-- 这个是基于angularjs 1.4.10修改的版本,主要是修改了history控制部分,用于兼容route和pjax的同时操作history的冲突 --> | ||
| 585 | +<script src="/assets/js/angular.js" data-autocephaly=1></script> | ||
| 586 | +<script src="/assets/bower_components/angular-i18n/angular-locale_zh-cn.js" data-autocephaly=1></script> | ||
| 587 | +<script | ||
| 588 | + src="/assets/bower_components/angular-resource/angular-resource.min.js" | ||
| 589 | + data-exclude=1></script> | ||
| 590 | +<script | ||
| 591 | + src="/assets/bower_components/angular-sanitize/angular-sanitize.min.js" | ||
| 592 | + data-exclude=1></script> | ||
| 593 | +<script | ||
| 594 | + src="/assets/bower_components/angular-animate/angular-animate.min.js" | ||
| 595 | + data-exclude=1></script> | ||
| 596 | +<script | ||
| 597 | + src="/assets/bower_components/angular-touch/angular-touch.min.js" | ||
| 598 | + data-exclude=1></script> | ||
| 599 | +<script | ||
| 600 | + src="/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js" | ||
| 601 | + data-exclude=1></script> | ||
| 602 | +<script | ||
| 603 | + src="/assets/bower_components/oclazyload/dist/ocLazyLoad.min.js" | ||
| 604 | + data-exclude=1></script> | ||
| 605 | +<script | ||
| 606 | + src="/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js" | ||
| 607 | + data-exclude=1></script> | ||
| 608 | +<!-- handsontable相关js --> | ||
| 609 | +<script | ||
| 610 | + src="/assets/bower_components/handsontable/dist/handsontable.full.js"></script> | ||
| 611 | +<script | ||
| 612 | + src="/assets/bower_components/ngHandsontable/dist/ngHandsontable.js"></script> | ||
| 613 | +<!-- sweetalert相关js --> | ||
| 614 | +<script src="/assets/bower_components/sweetalert/dist/sweetalert.min.js"></script> | ||
| 615 | +<script src="/assets/bower_components/ng-sweet-alert/ng-sweet-alert.js"></script> | ||
| 616 | + | ||
| 617 | +<!-- schedule计划调度AngularJS模块主JS --> | ||
| 618 | +<script src="/pages/scheduleApp/module/common/main.js" data-exclude=1></script> | ||
| 619 | +<script | ||
| 620 | + src="/pages/scheduleApp/module/common/prj-common-globalservice.js" | ||
| 621 | + data-exclude=1></script> | ||
| 622 | +<script src="/pages/scheduleApp/module/common/prj-common-filter.js" | ||
| 623 | + data-exclude=1></script> | ||
| 624 | +<script src="/pages/scheduleApp/module/common/prj-common-directive.js" | ||
| 625 | + data-exclude=1></script> | ||
| 626 | +<script | ||
| 627 | + src="/pages/scheduleApp/module/common/prj-common-ui-route-state.js" | ||
| 628 | + data-exclude=1></script> | ||
| 629 | + | ||
| 630 | +<!-- 地图相关 --> | ||
| 631 | +<!-- 百度 --> | ||
| 632 | +<script | ||
| 633 | + src="//api.map.baidu.com/api?v=3.0&ak=IGGrr4UjwIYzatoCRFKEL8sT" | ||
| 634 | + data-exclude=1></script> | ||
| 635 | +<script | ||
| 636 | + src="//api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js" | ||
| 637 | + data-exclude=1></script> | ||
| 638 | +<script type="text/javascript" | ||
| 639 | + src="//api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js" | ||
| 640 | + data-exclude=1></script> | ||
| 641 | +<script type="text/javascript" | ||
| 642 | + src="//api.map.baidu.com/library/RichMarker/1.2/src/RichMarker_min.js " | ||
| 643 | + data-exclude=1></script> | ||
| 644 | +<script src="/assets/js/baidu/TextIconOverlay.js" data-exclude=1></script> | ||
| 645 | +<script src="/assets/js/baidu//MarkerClusterer.js" data-exclude=1></script> | ||
| 646 | +<!-- 高德 --> | ||
| 647 | +<script | ||
| 648 | + src="//webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda" | ||
| 649 | + data-exclude=1></script> | ||
| 650 | +<!-- echarts4 --> | ||
| 651 | +<script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script> | ||
| 652 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | ||
| 653 | +<!-- RSA加密 --> | ||
| 654 | +<script src="/assets/plugins/jsencrypt.min.js"></script> | ||
| 655 | +<script src="/assets/js/eventproxy.js"></script> | ||
| 656 | +</body> | ||
| 657 | </html> | 657 | </html> |
| 658 | \ No newline at end of file | 658 | \ No newline at end of file |
src/main/resources/static/pages/electricity/cdl/cdlAdd.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><a href="cylList.html" data-pjax>车辆存电</a> <i class="fa fa-circle"></i></li> | 10 | <li><a href="cylList.html" data-pjax>车辆存电</a> <i class="fa fa-circle"></i></li> |
| 11 | <li><span class="active">添加存电</span></li> | 11 | <li><span class="active">添加存电</span></li> |
| 12 | </ul> | 12 | </ul> |
src/main/resources/static/pages/electricity/cdl/cdlList.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">车辆存电</span></li> | 10 | <li><span class="active">车辆存电</span></li> |
| 11 | </ul> | 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 | \ No newline at end of file | 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 ? ' <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 | \ No newline at end of file | 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 | \ No newline at end of file | 101 | \ No newline at end of file |
src/main/resources/static/pages/electricity/jdl/list.html
| @@ -2,57 +2,53 @@ | @@ -2,57 +2,53 @@ | ||
| 2 | .blue{ | 2 | .blue{ |
| 3 | background-color: #87CEFF | 3 | background-color: #87CEFF |
| 4 | } | 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>公司:</td> | ||
| 43 | - <td> | ||
| 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>日期:</td> | ||
| 51 | - <td width="86px"> | ||
| 52 | - <input type="text" style="width: 80px" name="rq" id="rq"/> | ||
| 53 | - </td> | ||
| 54 | - <td>内部编码:</td> | ||
| 55 | - <td> | 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 width="120px"> | ||
| 48 | + <input type="text" style="width: 100px" name="rq" id="rq"/> | ||
| 49 | + </td> | ||
| 50 | + <td colspan="2">内部编码:</td> | ||
| 51 | + <td colspan="2"> | ||
| 56 | <select class="form-control" name="nbbm" id="nbbm" style="width: 120px;"></select> | 52 | <select class="form-control" name="nbbm" id="nbbm" style="width: 120px;"></select> |
| 57 | </td> | 53 | </td> |
| 58 | 54 |
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 ? ' <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 | \ No newline at end of file | 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 | \ No newline at end of file | 98 | \ No newline at end of file |
src/main/resources/static/pages/electricity/list/add.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><a href="list.html" data-pjax>进出场电量</a> <i class="fa fa-circle"></i></li> | 10 | <li><a href="list.html" data-pjax>进出场电量</a> <i class="fa fa-circle"></i></li> |
| 11 | <li><span class="active">进出站电量信息编辑</span></li> | 11 | <li><span class="active">进出站电量信息编辑</span></li> |
| 12 | </ul> | 12 | </ul> |
src/main/resources/static/pages/electricity/list/list.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">进出场存电量</span></li> | 10 | <li><span class="active">进出场存电量</span></li> |
| 11 | </ul> | 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,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><a href="list_ph.html" data-pjax>进出场油量</a> <i class="fa fa-circle"></i></li> | 10 | <li><a href="list_ph.html" data-pjax>进出场油量</a> <i class="fa fa-circle"></i></li> |
| 11 | <li><span class="active">进出站油量信息编辑</span></li> | 11 | <li><span class="active">进出站油量信息编辑</span></li> |
| 12 | </ul> | 12 | </ul> |
src/main/resources/static/pages/oil/checkJyryList.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">加油人员不符</span></li> | 10 | <li><span class="active">加油人员不符</span></li> |
| 11 | </ul> | 11 | </ul> |
| 12 | 12 |
src/main/resources/static/pages/oil/checkNbbmList.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">加油车辆备卡</span></li> | 10 | <li><span class="active">加油车辆备卡</span></li> |
| 11 | </ul> | 11 | </ul> |
| 12 | 12 |
src/main/resources/static/pages/oil/cylAdd.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><a href="cylList.html" data-pjax>车辆存油</a> <i class="fa fa-circle"></i></li> | 10 | <li><a href="cylList.html" data-pjax>车辆存油</a> <i class="fa fa-circle"></i></li> |
| 11 | <li><span class="active">添加存油</span></li> | 11 | <li><span class="active">添加存油</span></li> |
| 12 | </ul> | 12 | </ul> |
src/main/resources/static/pages/oil/cylList.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">车辆存油</span></li> | 10 | <li><span class="active">车辆存油</span></li> |
| 11 | </ul> | 11 | </ul> |
| 12 | 12 |
src/main/resources/static/pages/oil/history/list_lsdl.html
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | 14 | ||
| 15 | <ul class="page-breadcrumb breadcrumb"> | 15 | <ul class="page-breadcrumb breadcrumb"> |
| 16 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">进出场存电量</span></li> | 18 | <li><span class="active">进出场存电量</span></li> |
| 19 | </ul> | 19 | </ul> |
| 20 | <div id="ll_lsoil_list" | 20 | <div id="ll_lsoil_list" |
src/main/resources/static/pages/oil/history/list_lsyl.html
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | 14 | ||
| 15 | <ul class="page-breadcrumb breadcrumb"> | 15 | <ul class="page-breadcrumb breadcrumb"> |
| 16 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">进出场存油量</span></li> | 18 | <li><span class="active">进出场存油量</span></li> |
| 19 | </ul> | 19 | </ul> |
| 20 | <div id="ll_lsoil_list" | 20 | <div id="ll_lsoil_list" |
src/main/resources/static/pages/oil/jyglList.html
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | <ul class="page-breadcrumb breadcrumb"> | 9 | <ul class="page-breadcrumb breadcrumb"> |
| 10 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">场外加油管理</span></li> | 12 | <li><span class="active">场外加油管理</span></li> |
| 13 | </ul> | 13 | </ul> |
| 14 | 14 |
src/main/resources/static/pages/oil/jyszList.html
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | 7 | ||
| 8 | <ul class="page-breadcrumb breadcrumb"> | 8 | <ul class="page-breadcrumb breadcrumb"> |
| 9 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">场外加油设置</span></li> | 11 | <li><span class="active">场外加油设置</span></li> |
| 12 | </ul> | 12 | </ul> |
| 13 | <div class="row"> | 13 | <div class="row"> |
src/main/resources/static/pages/oil/list.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">进出场存油量</span></li> | 10 | <li><span class="active">进出场存油量</span></li> |
| 11 | </ul> | 11 | </ul> |
| 12 | 12 |
src/main/resources/static/pages/oil/list_ph.html
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | 14 | ||
| 15 | <ul class="page-breadcrumb breadcrumb"> | 15 | <ul class="page-breadcrumb breadcrumb"> |
| 16 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">进出场存油量</span></li> | 18 | <li><span class="active">进出场存油量</span></li> |
| 19 | </ul> | 19 | </ul> |
| 20 | <div id="ll_oil_list" | 20 | <div id="ll_oil_list" |
src/main/resources/static/pages/oil/oillist/list.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 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 | <li><span class="active">进出场存油量</span></li> | 10 | <li><span class="active">进出场存油量</span></li> |
| 11 | </ul> | 11 | </ul> |
| 12 | 12 |