标准接口BUG修改
正在显示
4 个修改的文件
包含
38 行增加
和
11 行删除
... | @@ -95,7 +95,7 @@ spring: | ... | @@ -95,7 +95,7 @@ spring: |
95 | driver-class-name: com.mysql.jdbc.Driver | 95 | driver-class-name: com.mysql.jdbc.Driver |
96 | # 恩菲数据同步 | 96 | # 恩菲数据同步 |
97 | nf-db: | 97 | nf-db: |
98 | url: jdbc:mysql://113.249.91.27:3306/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false&connectTimeout=60000&socketTimeout=1800 | 98 | url: jdbc:mysql://113.249.91.27:3306/zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false&connectTimeout=60000&socketTimeout=1800 |
99 | username: root | 99 | username: root |
100 | password: jkauto@123 | 100 | password: jkauto@123 |
101 | driver-class-name: com.mysql.jdbc.Driver | 101 | driver-class-name: com.mysql.jdbc.Driver | ... | ... |
... | @@ -260,7 +260,7 @@ | ... | @@ -260,7 +260,7 @@ |
260 | ROUND(SUM(IFNULL(JSZD,0)) - SUM(IFNULL(CSTN,0)),2) AS TN, | 260 | ROUND(SUM(IFNULL(JSZD,0)) - SUM(IFNULL(CSTN,0)),2) AS TN, |
261 | ROUND(SUM(IFNULL(JSZL,0)) - SUM(IFNULL(CSZL,0)),2) AS TP | 261 | ROUND(SUM(IFNULL(JSZL,0)) - SUM(IFNULL(CSZL,0)),2) AS TP |
262 | FROM | 262 | FROM |
263 | ${view2119tb} v2 | 263 | ${view2119} v2 |
264 | WHERE | 264 | WHERE |
265 | v2.time >= #{startDate} | 265 | v2.time >= #{startDate} |
266 | AND v2.time <= #{endDate} | 266 | AND v2.time <= #{endDate} | ... | ... |
... | @@ -536,7 +536,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -536,7 +536,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
536 | List<Map<String, Object>> list = new ArrayList<>(); | 536 | List<Map<String, Object>> list = new ArrayList<>(); |
537 | String startDate = statisticsParam.getStartDate(); | 537 | String startDate = statisticsParam.getStartDate(); |
538 | String endDate = statisticsParam.getEndDate(); | 538 | String endDate = statisticsParam.getEndDate(); |
539 | String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate, endDate); | 539 | String fields = "CSL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSZL,CSZL"; |
540 | String dataView2119 = ReportViewUtil.buildView(view2119, fields, statisticsParam.getDepartId(), startDate, endDate); | ||
540 | list = factoryCenterMapper.getSzXjltj(startDate,endDate,statisticsParam.getDepartId(),dataView2119); | 541 | list = factoryCenterMapper.getSzXjltj(startDate,endDate,statisticsParam.getDepartId(),dataView2119); |
541 | return list; | 542 | return list; |
542 | } | 543 | } | ... | ... |
1 | package com.skua.modules.job; | 1 | package com.skua.modules.job; |
2 | 2 | ||
3 | import com.skua.core.context.SpringContextUtils; | ||
4 | import com.skua.core.util.DateUtils; | ||
3 | import com.skua.modules.report.service.IReportDataService; | 5 | import com.skua.modules.report.service.IReportDataService; |
4 | import lombok.extern.slf4j.Slf4j; | 6 | import lombok.extern.slf4j.Slf4j; |
7 | import org.apache.commons.lang.StringUtils; | ||
5 | import org.quartz.Job; | 8 | import org.quartz.Job; |
6 | import org.quartz.JobExecutionContext; | 9 | import org.quartz.JobExecutionContext; |
7 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.jdbc.core.JdbcTemplate; | ||
12 | |||
13 | import java.util.HashMap; | ||
14 | import java.util.List; | ||
15 | import java.util.Map; | ||
8 | 16 | ||
9 | /** | 17 | /** |
10 | * 发送消息任务 | 18 | * 发送消息任务 |
... | @@ -23,14 +31,32 @@ public class NFDataSyncJob implements Job { | ... | @@ -23,14 +31,32 @@ public class NFDataSyncJob implements Job { |
23 | @Override | 31 | @Override |
24 | public void execute(JobExecutionContext jobExecutionContext) { | 32 | public void execute(JobExecutionContext jobExecutionContext) { |
25 | log.info("开始同步昨日恩菲的数据入报表"); | 33 | log.info("开始同步昨日恩菲的数据入报表"); |
26 | // String yesterday = DateUtils.getYesterday(); | 34 | String yesterday = DateUtils.getYesterday(); |
27 | // Map<String, String> data = new HashMap<>(); | 35 | JdbcTemplate nfDb = (JdbcTemplate) SpringContextUtils.getBean("nf-db"); |
28 | // String departId = ""; | 36 | String sql = "select * from day_report_data where update_time like '"+yesterday+"%'"; |
29 | // data.put("JSZL", ""); | 37 | List<Map<String, Object>> dataList = nfDb.queryForList(sql); |
30 | // data.put("departId", "departId"); | 38 | if(dataList.size() > 0){ |
31 | // data.put("reportId", SZSL); | 39 | for (Map<String, Object> map : dataList) { |
32 | // data.put("time",yesterday); | 40 | String departId = map.get("depart_id").toString(); |
33 | // reportDataService.insertOrUpdateReportData(departId, yesterday, data, SZSL); | 41 | String time = map.get("time").toString(); |
42 | String itemCode = map.get("item_code").toString(); | ||
43 | String itemValue = map.get("item_value").toString(); | ||
44 | String itemType = map.get("item_type").toString(); | ||
45 | Map<String, String> data = new HashMap<>(); | ||
46 | data.put(itemCode, itemValue); | ||
47 | data.put("departId", departId); | ||
48 | data.put("time",yesterday); | ||
49 | if("szsl".equals(itemType)){ | ||
50 | data.put("reportId", SZSL); | ||
51 | reportDataService.insertOrUpdateReportData(departId, time, data, SZSL); | ||
52 | }else if("hyrb".equals(itemType)){ | ||
53 | data.put("reportId", HYRB); | ||
54 | reportDataService.insertOrUpdateReportData(departId, time, data, HYRB); | ||
55 | }else { | ||
56 | log.info("恩菲【"+itemType+"】类型数据未进行数据同步"); | ||
57 | } | ||
58 | } | ||
59 | } | ||
34 | log.info("同步昨日恩菲的数据入报表完成"); | 60 | log.info("同步昨日恩菲的数据入报表完成"); |
35 | } | 61 | } |
36 | 62 | ... | ... |
-
请 注册 或 登录 后发表评论