Browse Source

fix:【灵山-红色代办】导入+新增:orgIdPath计算错误

master
wxz 2 years ago
parent
commit
4340254960
  1. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java
  2. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java

12
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java

@ -9,7 +9,9 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.PidUtils; import com.epmet.commons.tools.utils.PidUtils;
@ -244,7 +246,7 @@ public abstract class AbstractLingShanSpecialCrowdExcelImportListener<T extends
* @date: 2023/4/18 3:42 PM * @date: 2023/4/18 3:42 PM
*/ */
protected void saveBatch() { protected void saveBatch() {
String orgIdPath = PidUtils.convertPid2OrgIdPath(currentStaffInfo.getAgencyId(), currentStaffInfo.getAgencyPIds()); // String orgIdPath = PidUtils.convertPid2OrgIdPath(currentStaffInfo.getAgencyId(), currentStaffInfo.getAgencyPIds());
String customerId = EpmetRequestHolder.getLoginUserCustomerId(); String customerId = EpmetRequestHolder.getLoginUserCustomerId();
Date now = new Date(); Date now = new Date();
Iterator<T> it = getOriginDatas().iterator(); Iterator<T> it = getOriginDatas().iterator();
@ -256,9 +258,15 @@ public abstract class AbstractLingShanSpecialCrowdExcelImportListener<T extends
errorDatas.add(row); errorDatas.add(row);
it.remove(); it.remove();
} else { } else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(row.getResiGridId());
if (gridInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道-特殊人群】导入:未找到网格: " + row.getResiGridId());
}
specialTypes.add(new PersonSpecialTypeBean(row.getResiId(), row.getIdCard(), specialCrowdType.getType())); specialTypes.add(new PersonSpecialTypeBean(row.getResiId(), row.getIdCard(), specialCrowdType.getType()));
orgIdPath = PidUtils.convertPid2OrgIdPath(row.getResiGridId(), orgIdPath); String orgIdPath = PidUtils.convertPid2OrgIdPath(row.getResiGridId(), gridInfo.getPids());
E e = ConvertUtils.sourceToTarget(row, entityClass); E e = ConvertUtils.sourceToTarget(row, entityClass);
e.setCustomerId(customerId); e.setCustomerId(customerId);

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java

@ -433,10 +433,16 @@ public class LingShanSpecialCrowdServiceImpl implements LingShanSpecialCrowdServ
String customerId = EpmetRequestHolder.getLoginUserCustomerId(); String customerId = EpmetRequestHolder.getLoginUserCustomerId();
String staffId = EpmetRequestHolder.getLoginUserId(); String staffId = EpmetRequestHolder.getLoginUserId();
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId); // CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId);
String orgIdPath = PidUtils.convertPid2OrgIdPath(staffInfo.getAgencyId(), staffInfo.getAgencyPIds()); // String orgIdPath = PidUtils.convertPid2OrgIdPath(staffInfo.getAgencyId(), staffInfo.getAgencyPIds());
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(vt.getResiGridId());
if (gridInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道-特殊人群】新增:未找到网格: " + vt.getResiGridId());
}
orgIdPath = PidUtils.convertPid2OrgIdPath(vt.getResiGridId(), orgIdPath); String orgIdPath = PidUtils.convertPid2OrgIdPath(vt.getResiGridId(), gridInfo.getPids());
Date now = new Date(); Date now = new Date();

Loading…
Cancel
Save