可以加个状态表,后端刚开始插入数据前先加到状态表(处理中),然后前端不断请求状态接口,后端插入完更改状态表,前端得到状态表为已完成
List> partitionList = Lists.partition(empPerfCmpltValDOTeamList, IndexConstants.BATCH_SIZE);
//IndexConstants.BATCH_SIZE=2000
for (List empPerfCmpltValDOS : partitionList) {
empPerfCmpltValMapper.insertList(empPerfCmpltValDOS);//insertList是自己写的insert values
}
insert into t_emp_perf_cmplt_val(year_months, assess_year, assess_pd_value, user_id, dept_id, index_code, index_value, index_valuestr, index_source, index_source_cn2, remark1, remark2, creator, create_time, updater, update_time)
values
(#{entity.yearMonths}, #{entity.assessYear}, #{entity.assessPdValue}, #{entity.userId}, #{entity.deptId}, #{entity.indexCode}, #{entity.indexValue}, #{entity.indexValuestr}, #{entity.indexSource}, #{entity.indexSourceCn2}, #{entity.remark1}, #{entity.remark2}, #{entity.creator}, #{entity.createTime}, #{entity.updater}, #{entity.updateTime})