Commit 222cedde authored by fangxinjiang's avatar fangxinjiang

BUG修复

parent 21ccf6c1
......@@ -3444,7 +3444,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
List<TForecastLibrary> libraryFundInfoList;
for (int i = 0; i < monthDiff; i++) {
//获取所有的预估数据
List<TForecastLibrary> libraryFundInfoList1 = new ArrayList<>();
//List<TForecastLibrary> libraryFundInfoList1 = new ArrayList<>();
libraryFundInfoList = forecastLibraryService.list(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, sf.getEmpIdcard())
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)
......@@ -3453,14 +3453,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(libraryFundInfoList)) {
for (TForecastLibrary library :libraryFundInfoList) {
//办理成功生成收入
socialTask.asynchronousDisPatchHandle(null,0,null,library,CommonConstants.THREE_INT);
/*socialTask.asynchronousDisPatchHandle(null,0,null,library,CommonConstants.THREE_INT);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoList1.add(library);
}*/
socialTask.asynchronousDisPatchHandleForDispatch(library,CommonConstants.ZERO_INT == library.getDataPush());
}
}
if (Common.isNotNull(libraryFundInfoList1)) {
/*if (Common.isNotNull(libraryFundInfoList1)) {
socialTask.asynchronousDisPatchHandle(null,0,libraryFundInfoList1,null,CommonConstants.TWO_INT);
}
}*/
}
}
......
......@@ -24,6 +24,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -91,7 +92,7 @@ public class DoSocialTask {
}
forecastLibraryService.pushForecastFundInfo(libs,false,null);
}
// 获取预估库数据并推送
// 获取预估库数据生成收入并推送
if (type == CommonConstants.THREE_INT){
linkId = library.getId();
createIncomeInfo(library);
......@@ -102,6 +103,43 @@ public class DoSocialTask {
}
}
/**
* @Author fxj
* @Description 异步处理相关信息 公积金同事生成收入和预估并推送
* @Date 11:23 2022/11/28
* @param library 生成预估推送 libForIncome 生成收入推送
**/
@Async
public void asynchronousDisPatchHandleForDispatch(TForecastLibrary library,boolean foreFlag) {
synchronized (this){
List<TForecastLibrary> libs = new ArrayList<>();
String linkId = null;
try {
if (Common.isNotNull(library)){
// 获取预估库数据并推送
if (foreFlag){
libs.add(library);
for (TForecastLibrary lib:libs){
if (Common.isEmpty(linkId)){
linkId = lib.getId();
}else {
linkId = linkId + CommonConstants.COMMA_CHAR + lib.getId();
}
}
forecastLibraryService.pushForecastFundInfo(libs,false,null);
}
// 获取预估库数据生成收入并推送
linkId = library.getId();
createIncomeInfo(library);
}
}catch (Exception e){
initSendError(linkId, e.getMessage(),"asynchronousDisPatchHandle:");
}finally {
libs.clear();
}
}
}
private void initSendError(String linkId, String msg,String title) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment