|
|
@ -6,11 +6,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.ServiceConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.feign.ResultDataResolver; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dao.LogOperationDao; |
|
|
|
import com.epmet.dto.ComplementLogOperationDTO; |
|
|
|
import com.epmet.dto.CustomerStaffDTO; |
|
|
|
import com.epmet.dto.form.CustomerStaffFormDTO; |
|
|
|
import com.epmet.dto.region.LogOperationResultDTO; |
|
|
@ -22,6 +25,7 @@ import com.github.pagehelper.PageInfo; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
@ -214,10 +218,32 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR |
|
|
|
Integer no = NumConstant.ONE; |
|
|
|
Integer size; |
|
|
|
do { |
|
|
|
PageInfo<String> pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> logOperationDao.getStaffId()); |
|
|
|
PageInfo<Map<String,String>> pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> logOperationDao.getStaffId()); |
|
|
|
size = pageInfo.getList().size(); |
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(pageInfo.getList())){ |
|
|
|
List<ComplementLogOperationDTO> needUpdate = new ArrayList<>(); |
|
|
|
for (Map<String, String> m : pageInfo.getList()) { |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(m.get("CUSTOMER_ID"), m.get("OPERATOR_ID")); |
|
|
|
if (null == staffInfo){ |
|
|
|
logger.warn("未查询到工作人员信息"+m.get("OPERATOR_ID")); |
|
|
|
continue; |
|
|
|
} |
|
|
|
ComplementLogOperationDTO dto = new ComplementLogOperationDTO(); |
|
|
|
dto.setStaffId(staffInfo.getStaffId()); |
|
|
|
dto.setOrgId(staffInfo.getAgencyId()); |
|
|
|
dto.setOrgIdPath(StringUtils.isBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds().concat(":").concat(staffInfo.getAgencyId())); |
|
|
|
needUpdate.add(dto); |
|
|
|
} |
|
|
|
if (!CollectionUtils.isEmpty(needUpdate)){ |
|
|
|
updateLog(needUpdate); |
|
|
|
} |
|
|
|
} |
|
|
|
no++; |
|
|
|
}while (size == NumConstant.ONE_HUNDRED); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void updateLog(List<ComplementLogOperationDTO> list){ |
|
|
|
logOperationDao.updateBatchLog(list); |
|
|
|
} |
|
|
|
} |
|
|
|