Commit c071f6bc authored by 赵啸非's avatar 赵啸非

添加材料数量统计

parent ea9c380d
package com.mortals.xhx.daemon.task;
import cn.hutool.core.collection.ListUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
......@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
......@@ -44,7 +46,7 @@ public class SyncSiteMatterTaskImpl implements ITaskExcuteService {
siteRest.getData().forEach(site -> {
SiteMatterPdu siteMatterPdu = new SiteMatterPdu();
siteMatterPdu.setPage(1);
siteMatterPdu.setSize(-1);
//siteMatterPdu.setSize(-1);
Rest<RespData<List<SiteMatterPdu>>> siteMatterRest = siteMatterFeign.list(siteMatterPdu);
if (siteMatterRest.getCode() == YesNoEnum.YES.getValue()) {
//删除后新增
......@@ -61,7 +63,13 @@ public class SyncSiteMatterTaskImpl implements ITaskExcuteService {
}).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(sheetMatterEntities)) {
sheetMatterService.save(sheetMatterEntities);
sheetMatterService.getDao().delete(new HashMap());
List<List<SheetMatterEntity>> partition = ListUtil.partition(sheetMatterEntities, 500);
for (List<SheetMatterEntity> matterEntities : partition) {
sheetMatterService.save(matterEntities);
}
}
}
});
......
......@@ -4,6 +4,7 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.sheet.dao.SheetMatterDao;
import com.mortals.xhx.module.sheet.model.SheetMatterEntity;
/**
......@@ -16,5 +17,7 @@ import com.mortals.xhx.module.sheet.model.SheetMatterEntity;
*/
public interface SheetMatterService extends ICRUDService<SheetMatterEntity, Long> {
SheetMatterDao getDao();
Result<SheetMatterEntity> findSubList(SheetMatterEntity matterQuery, PageInfo pageInfo, Context context);
}
\ No newline at end of file
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