73d5ee4d 张雷

标准接口BUG修改

1 个父辈 b0280601
......@@ -95,7 +95,7 @@ spring:
driver-class-name: com.mysql.jdbc.Driver
# 恩菲数据同步
nf-db:
url: jdbc:mysql://113.249.91.27:3306/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false&connectTimeout=60000&socketTimeout=1800
url: jdbc:mysql://113.249.91.27:3306/zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false&connectTimeout=60000&socketTimeout=1800
username: root
password: jkauto@123
driver-class-name: com.mysql.jdbc.Driver
......
......@@ -260,7 +260,7 @@
ROUND(SUM(IFNULL(JSZD,0)) - SUM(IFNULL(CSTN,0)),2) AS TN,
ROUND(SUM(IFNULL(JSZL,0)) - SUM(IFNULL(CSZL,0)),2) AS TP
FROM
${view2119tb} v2
${view2119} v2
WHERE
v2.time >= #{startDate}
AND v2.time <= #{endDate}
......
......@@ -536,7 +536,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
List<Map<String, Object>> list = new ArrayList<>();
String startDate = statisticsParam.getStartDate();
String endDate = statisticsParam.getEndDate();
String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate, endDate);
String fields = "CSL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSZL,CSZL";
String dataView2119 = ReportViewUtil.buildView(view2119, fields, statisticsParam.getDepartId(), startDate, endDate);
list = factoryCenterMapper.getSzXjltj(startDate,endDate,statisticsParam.getDepartId(),dataView2119);
return list;
}
......
package com.skua.modules.job;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.report.service.IReportDataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 发送消息任务
......@@ -23,14 +31,32 @@ public class NFDataSyncJob implements Job {
@Override
public void execute(JobExecutionContext jobExecutionContext) {
log.info("开始同步昨日恩菲的数据入报表");
// String yesterday = DateUtils.getYesterday();
// Map<String, String> data = new HashMap<>();
// String departId = "";
// data.put("JSZL", "");
// data.put("departId", "departId");
// data.put("reportId", SZSL);
// data.put("time",yesterday);
// reportDataService.insertOrUpdateReportData(departId, yesterday, data, SZSL);
String yesterday = DateUtils.getYesterday();
JdbcTemplate nfDb = (JdbcTemplate) SpringContextUtils.getBean("nf-db");
String sql = "select * from day_report_data where update_time like '"+yesterday+"%'";
List<Map<String, Object>> dataList = nfDb.queryForList(sql);
if(dataList.size() > 0){
for (Map<String, Object> map : dataList) {
String departId = map.get("depart_id").toString();
String time = map.get("time").toString();
String itemCode = map.get("item_code").toString();
String itemValue = map.get("item_value").toString();
String itemType = map.get("item_type").toString();
Map<String, String> data = new HashMap<>();
data.put(itemCode, itemValue);
data.put("departId", departId);
data.put("time",yesterday);
if("szsl".equals(itemType)){
data.put("reportId", SZSL);
reportDataService.insertOrUpdateReportData(departId, time, data, SZSL);
}else if("hyrb".equals(itemType)){
data.put("reportId", HYRB);
reportDataService.insertOrUpdateReportData(departId, time, data, HYRB);
}else {
log.info("恩菲【"+itemType+"】类型数据未进行数据同步");
}
}
}
log.info("同步昨日恩菲的数据入报表完成");
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!