|
@ -118,10 +118,11 @@ public class AllSignExpenseStatusJob implements Job{
|
|
for (Town town : towns) {
|
|
for (Town town : towns) {
|
|
townsMap.put(town.getCode(), town);
|
|
townsMap.put(town.getCode(), town);
|
|
}
|
|
}
|
|
int start=1;
|
|
|
|
|
|
int start=0;
|
|
int page=1;
|
|
int page=1;
|
|
int pageSize=10000;
|
|
int pageSize=10000;
|
|
int lastSize=0;
|
|
int lastSize=0;
|
|
|
|
int allsize=0;
|
|
//找出今天的已改簽信息
|
|
//找出今天的已改簽信息
|
|
String dateTemp = date + Constant.quota_date_last;
|
|
String dateTemp = date + Constant.quota_date_last;
|
|
Long cityCount = new Long(0L); //统计到市的数目
|
|
Long cityCount = new Long(0L); //统计到市的数目
|
|
@ -135,11 +136,12 @@ public class AllSignExpenseStatusJob implements Job{
|
|
List<ETLModel> etlModels = new ArrayList<ETLModel>();
|
|
List<ETLModel> etlModels = new ArrayList<ETLModel>();
|
|
List<SignFamily> signFamilys =null;
|
|
List<SignFamily> signFamilys =null;
|
|
while (true){
|
|
while (true){
|
|
String sql=" select id,code,idcard,hospital,admin_team_code,expenses_status from wlyy_sign_family a where a.type =2 and a.status >= 1 and a.apply_date<= '"+dateTemp+"' limit "+start+","+pageSize ;
|
|
|
|
|
|
String sql=" select id,code,idcard,hospital,admin_team_code,expenses_status from wlyy_sign_family a where a.type =2 and a.status >= 1 and a.apply_date< '"+dateTemp+"' limit "+start+","+pageSize ;
|
|
signFamilys = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily .class)); // signFamilyDao.findByJiatingSignYesterday(dateTemp);
|
|
signFamilys = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily .class)); // signFamilyDao.findByJiatingSignYesterday(dateTemp);
|
|
|
|
|
|
|
|
int i=0;
|
|
//数据过滤清洗出脏数据 -----------start
|
|
//数据过滤清洗出脏数据 -----------start
|
|
for (SignFamily signFamily : signFamilys) {
|
|
|
|
|
|
for (SignFamily signFamily:signFamilys) {
|
|
|
|
allsize++;
|
|
ETLModel etlModel = new ETLModel();
|
|
ETLModel etlModel = new ETLModel();
|
|
String orgCode = signFamily.getHospital();
|
|
String orgCode = signFamily.getHospital();
|
|
if (StringUtils.isEmpty(orgCode)) {
|
|
if (StringUtils.isEmpty(orgCode)) {
|
|
@ -211,18 +213,18 @@ public class AllSignExpenseStatusJob implements Job{
|
|
townCount++;
|
|
townCount++;
|
|
orgCount++;
|
|
orgCount++;
|
|
adminCount++;
|
|
adminCount++;
|
|
|
|
i++;
|
|
}
|
|
}
|
|
if(signFamilys.size()!=pageSize){
|
|
|
|
lastSize=signFamilys.size();
|
|
|
|
|
|
lastSize=signFamilys.size();
|
|
|
|
if(signFamilys.size()!=pageSize&&i==lastSize){
|
|
signFamilys.clear();
|
|
signFamilys.clear();
|
|
break;
|
|
break;
|
|
}else{
|
|
}else{
|
|
start =page*pageSize+1;
|
|
|
|
|
|
start =page*pageSize;
|
|
page++;
|
|
page++;
|
|
signFamilys.clear();
|
|
signFamilys.clear();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
List<WlyyQuotaResult> returnData=null;
|
|
|
|
//数据过滤清洗出脏数据 -----------end
|
|
//数据过滤清洗出脏数据 -----------end
|
|
try {
|
|
try {
|
|
//统计数据
|
|
//统计数据
|
|
@ -236,7 +238,7 @@ public class AllSignExpenseStatusJob implements Job{
|
|
}
|
|
}
|
|
//保存日志
|
|
//保存日志
|
|
quartzJobLog.setJobEndTime(new Date());
|
|
quartzJobLog.setJobEndTime(new Date());
|
|
quartzJobLog.setJobContent(saveContent((page-1)*pageSize+lastSize, adminCount, orgCount, townCount, cityCount, isAll, errorContent, errorCount));
|
|
|
|
|
|
quartzJobLog.setJobContent(saveContent(allsize, adminCount, orgCount, townCount, cityCount, isAll, errorContent, errorCount));
|
|
quartzJobLog.setJobType(isAll ? "1" : "0");
|
|
quartzJobLog.setJobType(isAll ? "1" : "0");
|
|
|
|
|
|
dbStorage.saveLog(quartzJobLog);
|
|
dbStorage.saveLog(quartzJobLog);
|
|
@ -249,6 +251,7 @@ public class AllSignExpenseStatusJob implements Job{
|
|
|
|
|
|
private String saveContent(Integer size, Long qkCount, Long orgCount, Long townCount, Long cityCount, boolean isAll, StringBuffer errorContent, Long errorCount) {
|
|
private String saveContent(Integer size, Long qkCount, Long orgCount, Long townCount, Long cityCount, boolean isAll, StringBuffer errorContent, Long errorCount) {
|
|
StringBuffer string = new StringBuffer("统计" + date + " 的簽約数据完成 ,数据库查询到簽約数据:" + size);
|
|
StringBuffer string = new StringBuffer("统计" + date + " 的簽約数据完成 ,数据库查询到簽約数据:" + size);
|
|
|
|
//string.append(",sql语句:" + sql);
|
|
string.append(",过滤的脏数据数目:" + errorCount);
|
|
string.append(",过滤的脏数据数目:" + errorCount);
|
|
string.append(",统计到市的数据总数:" + cityCount);
|
|
string.append(",统计到市的数据总数:" + cityCount);
|
|
string.append(",统计到区的数据总数:" + townCount);
|
|
string.append(",统计到区的数据总数:" + townCount);
|
|
@ -256,7 +259,7 @@ public class AllSignExpenseStatusJob implements Job{
|
|
string.append(",统计到团队的数据总数:" + qkCount);
|
|
string.append(",统计到团队的数据总数:" + qkCount);
|
|
string.append(",是否统计成功:" + isAll);
|
|
string.append(",是否统计成功:" + isAll);
|
|
if (!isAll) {
|
|
if (!isAll) {
|
|
// string.append(",失败原因:" + errorContent);
|
|
|
|
|
|
string.append(",失败原因:" + errorContent);
|
|
}
|
|
}
|
|
return string.toString();
|
|
return string.toString();
|
|
}
|
|
}
|