1.批量导入json数据修改为异步执行

master
MrZhai 3 years ago
parent fd0266f0c4
commit 273b1daa26

@ -9,6 +9,7 @@ import com.glxp.api.admin.entity.basic.UdiInfoImportDetailEntity;
import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest; import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest;
import com.glxp.api.admin.res.basic.UdiRelevanceExportJsonResponse; import com.glxp.api.admin.res.basic.UdiRelevanceExportJsonResponse;
import com.glxp.api.admin.service.basic.UdiInfoImportDetailService; import com.glxp.api.admin.service.basic.UdiInfoImportDetailService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -66,6 +67,7 @@ public class UdiInfoImportDetailServiceImpl implements UdiInfoImportDetailServic
} }
@Override @Override
@Async
public void importJsonData(UdiRelevanceExportJsonResponse udiRelevanceExportJsonResponse) { public void importJsonData(UdiRelevanceExportJsonResponse udiRelevanceExportJsonResponse) {
if (CollUtil.isNotEmpty(udiRelevanceExportJsonResponse.getUdiInfoEntities())) { if (CollUtil.isNotEmpty(udiRelevanceExportJsonResponse.getUdiInfoEntities())) {
udiInfoDao.importUdiInfo(udiRelevanceExportJsonResponse.getUdiInfoEntities()); udiInfoDao.importUdiInfo(udiRelevanceExportJsonResponse.getUdiInfoEntities());

@ -75,6 +75,7 @@ public class BasicCorpImportService {
* *
* @param basicUnitMaintainEntities * @param basicUnitMaintainEntities
*/ */
@Async
public void importJsonData(List<BasicUnitMaintainEntity> basicUnitMaintainEntities) { public void importJsonData(List<BasicUnitMaintainEntity> basicUnitMaintainEntities) {
if (CollUtil.isNotEmpty(basicUnitMaintainEntities)) { if (CollUtil.isNotEmpty(basicUnitMaintainEntities)) {
try { try {

Loading…
Cancel
Save