diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/YanTaiConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/YanTaiConstant.java new file mode 100644 index 0000000000..74e1d13560 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/YanTaiConstant.java @@ -0,0 +1,12 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2022/10/18 16:43 + * @DESC + */ +public interface YanTaiConstant { + + String YT_CUSTOMER_ID = "1535072605621841922"; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index ada434a02e..df431a925e 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -1,11 +1,14 @@ package com.epmet.controller.yantai; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.yantai.DataSyncOrgDataDao; import com.epmet.dao.yantai.DataSyncUserDataDao; import com.epmet.dto.form.yantai.YtUserPageFormDTO; import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; +import com.epmet.entity.yantai.DataSyncOrgDataEntity; import com.epmet.service.DataSyncOrgDataService; import com.epmet.service.DataSyncUserDataService; import com.epmet.utils.OrgData; @@ -21,6 +24,9 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; + +import static com.epmet.constant.YanTaiConstant.YT_CUSTOMER_ID; /** * desc:烟台 从认证中心同步组织和用户信息 到本地 @@ -57,7 +63,15 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService needInsert.add(d); disposeYanTaiSyncOrg(d.getOrganizationId(),needInsert); }); - + List entities = needInsert.stream().map(m -> { + DataSyncOrgDataEntity entity = ConvertUtils.sourceToTarget(m, DataSyncOrgDataEntity.class); + entity.setCustomerId(YT_CUSTOMER_ID); + entity.setPid(""); + entity.setParentOrgName(""); + entity.setPids(""); + return entity; + }).collect(Collectors.toList()); + dataSyncOrgDataService.insertBatch(entities, NumConstant.ONE_HUNDRED); } return false; }