脚本修改
This commit is contained in:
@@ -2,6 +2,7 @@ package com.fangjia.job.fsh.job;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Semaphore;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -76,11 +77,16 @@ public class UserStatJob implements SimpleJob {
|
||||
final List<LoanCustomersConfig> LoanCustomersConfigList = loanCustomersConfigService.queryAll();
|
||||
long total = enterpriseProductUserService.queryCount();
|
||||
int pages = PageBean.calcPages(total, 1000);
|
||||
final Semaphore semaphore = new Semaphore(10);
|
||||
for (int i = 1; i <= pages; i++) {
|
||||
List<EnterpriseProductUser> users = enterpriseProductUserService.queryByPage(i, 1000);
|
||||
for (EnterpriseProductUser user : users) {
|
||||
final EnterpriseProductUser u = user;
|
||||
if (u.getEid() %2 == Integer.parseInt(shardingContext.getShardingParameter())) {
|
||||
try {
|
||||
semaphore.acquire();
|
||||
} catch (InterruptedException e1) {
|
||||
}
|
||||
FangjiaThreadPoolExecutor.execute(new Runnable() {
|
||||
|
||||
@Override
|
||||
@@ -93,6 +99,8 @@ public class UserStatJob implements SimpleJob {
|
||||
} catch (Exception e) {
|
||||
logger.error("用户维度统计任务异常", e);
|
||||
DingDingMessageUtil.sendTextMessage("用户维度统计任务异常:" + e.getMessage());
|
||||
} finally {
|
||||
semaphore.release();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
+13
@@ -49,6 +49,19 @@ public class DistrictDetail {
|
||||
*/
|
||||
private DistrictBaseInfoDto districtBaseInfo;
|
||||
|
||||
/**
|
||||
* 小区潜力指数
|
||||
*/
|
||||
private Integer index;
|
||||
|
||||
public Integer getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(Integer index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public Date getModifyTime() {
|
||||
return modifyTime;
|
||||
}
|
||||
|
||||
+4
@@ -19,6 +19,7 @@ import org.springframework.data.mongodb.core.query.Query;
|
||||
import com.dangdang.ddframe.job.api.ShardingContext;
|
||||
import com.dangdang.ddframe.job.api.simple.SimpleJob;
|
||||
import com.fangjia.job.common.util.DingDingMessageUtil;
|
||||
import com.fangjia.job.common.util.JsonUtils;
|
||||
import com.fangjia.job.common.util.RestApiCallUtils;
|
||||
import com.fangjia.job.youfang.document.AgencyInfo;
|
||||
import com.fangjia.job.youfang.document.DistrictBaseInfoDto;
|
||||
@@ -90,6 +91,9 @@ public class DistrictInfoJob implements SimpleJob{
|
||||
districtDetail.setName(name);
|
||||
districtDetail.setModifyTime(new Date());
|
||||
DistrictEvaluateSingleDto dto = fshApiRemoteService.getDistrictNewPriceInfo(params);
|
||||
if (dto != null && dto.getResult() != null && dto.getResult().getTagBo() != null) {
|
||||
districtDetail.setIndex(dto.getResult().getTagBo().getIndex());
|
||||
}
|
||||
DistrictInfoDto districtInfoDto = fshApiRemoteService.detail(params);
|
||||
Map<String,Object> s = fshApiRemoteService.getAgencyInfo(params);
|
||||
params.put("size", 111.11);
|
||||
|
||||
+2
-2
@@ -10,13 +10,13 @@ public class NewsServiceImpl extends EntityService<News> implements NewsService
|
||||
|
||||
@Override
|
||||
public void pushNews(String date) {
|
||||
String sql = "update news set `status`=1 where `status`=0 and deploy_time='"+date+"'";
|
||||
String sql = "update news set `status`=1 where `status`=0 and deploy_time<='"+date+"'";
|
||||
super.getJdbcTemplate().execute(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offlineNews(String date) {
|
||||
String sql = "update news set `status`=2 where `status`=1 and offline_time='"+date+"'";
|
||||
String sql = "update news set `status`=2 where `status`=1 and offline_time<='"+date+"'";
|
||||
super.getJdbcTemplate().execute(sql);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user