添加线程
parent
312663aff2
commit
ff705cc8ad
|
@ -230,30 +230,55 @@ public class TaskInfoServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> i
|
|||
map.put(lastFieName[i], newFieName[i]);
|
||||
fieName += "," + tableNameMap.get(lastFieName[i]);
|
||||
}
|
||||
|
||||
fieName = fieName.substring(1);
|
||||
String sql = " SELECT count(1) FROM " + joint;
|
||||
Result<Long> count = datasourceFeign.findCount(basicId, sql);
|
||||
System.out.println("======="+count+"=======");
|
||||
Result<Long> countResult = datasourceFeign.findCount(basicId, sql);
|
||||
Long data = countResult.getData();
|
||||
System.out.println("======="+data+"=======");
|
||||
String finalFieName = fieName;
|
||||
String finalJoint = joint;
|
||||
if (Weight.high.equals(weight)){
|
||||
long count = data/10000;
|
||||
for (long i = 0; i < count; i++) {
|
||||
long pageNum = (i - 1) * 10000;
|
||||
submitHighPriorityTask(()->{
|
||||
|
||||
getString(pageNum, finalFieName, finalJoint,basicId,newBasicId,tableId,map);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (Weight.centre.equals(weight)){
|
||||
|
||||
long count = data/10000;
|
||||
for (long i = 0; i < count; i++) {
|
||||
long pageNum = (i - 1) * 10000;
|
||||
submitHighPriorityTask(()->{
|
||||
getString(pageNum, finalFieName, finalJoint,basicId,newBasicId,tableId,map);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (Weight.low.equals(weight)){
|
||||
|
||||
long count = data/10000;
|
||||
for (long i = 0; i < count; i++) {
|
||||
long pageNum = (i - 1) * 10000;
|
||||
submitHighPriorityTask(()->{
|
||||
getString(pageNum, finalFieName, finalJoint,basicId,newBasicId,tableId,map);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (Weight.urgency.equals(weight)){
|
||||
|
||||
long count = data/10000;
|
||||
for (long i = 0; i < count; i++) {
|
||||
long pageNum = (i - 1) * 10000;
|
||||
submitHighPriorityTask(()->{
|
||||
getString(pageNum, finalFieName, finalJoint,basicId,newBasicId,tableId,map);
|
||||
});
|
||||
}
|
||||
}
|
||||
//return getString(fieName,joint,basicId,newBasicId,tableId,map);
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getString(String fieName,String joint,Long basicId,Long newBasicId,Long tableId,HashMap<String, String> map ) {
|
||||
private void getString(Long pageNum,String fieName,String joint,Long basicId,Long newBasicId,Long tableId,HashMap<String, String> map ) {
|
||||
|
||||
String sql = " SELECT " + fieName + " FROM " + joint;
|
||||
System.out.println(sql);
|
||||
|
@ -268,7 +293,6 @@ public class TaskInfoServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> i
|
|||
}
|
||||
}
|
||||
Result result = datasourceFeign.addProduct(newBasicId, tableId, tableValue);
|
||||
return "执行成功";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue