|
@@ -297,19 +297,31 @@ public class GLPPGFWebsitWorkerServiceImpl implements GLPPGFWebsitWorkerService
|
|
|
List<WorkerBrandAccount> upWorkerBrandAccounts,
|
|
|
Map<Long,ItfTblWangdianWxgDownload> uprecs) {
|
|
|
List<String> WebsitWorkers = new ArrayList<>();
|
|
|
+ List<WorkerBrandAccount> oldwbas = new ArrayList<>();
|
|
|
|
|
|
for (ItfTblWangdianWxgDownload m : addRec){
|
|
|
// 只有存在网点对应关系才可以新增师傅到网点信息中来 存在品牌网点对应平台多网点
|
|
|
if (!websitOrderSignMap.containsKey(m.getWdno())){
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
// 看师傅+网点信息 在品牌商网点信息是否存在 存在修改,不存在新增 会存在多条记录
|
|
|
- List<WorkerBrandAccount> oldwbas = workerBrandAccountService.lambdaQuery()
|
|
|
+ // 1:按总部师傅已同步并写入表处理
|
|
|
+ oldwbas = workerBrandAccountService.lambdaQuery()
|
|
|
.eq(WorkerBrandAccount::getBrandWebsitId,m.getWdno())
|
|
|
.eq(WorkerBrandAccount::getBrandWorkerId,m.getWxgid()).list();
|
|
|
|
|
|
+ // 无数据时 会存在平台已添加了师傅入驻对应的网点但并未同步到总部时需再次查询
|
|
|
+ if (oldwbas.size()<=0){
|
|
|
+ if (workerIdCardMap.containsKey(m.getSfzen().trim())){
|
|
|
+ oldwbas = workerBrandAccountService.lambdaQuery()
|
|
|
+ .eq(WorkerBrandAccount::getWorkerId,workerIdCardMap.get(m.getSfzen().trim()).get(0).getWorkerId())
|
|
|
+ .eq(WorkerBrandAccount::getBrandWebsitId,m.getWdno()).list();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 存在只修改师傅帐号状态 + 网点编号因为平台会删除
|
|
|
- if (CollectionUtils.isNotEmpty(oldwbas)){
|
|
|
+ if (oldwbas.size()>0){
|
|
|
for (WorkerBrandAccount wba : oldwbas){
|
|
|
// 修改网点师傅信息
|
|
|
wba.setBrandWorkerStatus(DictTypeEnum.DICT_TYPE_OFF.getCode());
|