Commit 36620bf2 by fudahua

同步处理 死循环处理

parent aab9cd68
......@@ -326,11 +326,11 @@ public class StaffApiServiceImpl implements StaffApiService {
tab.setPhoneNumber(user.getMobile());
if (StringUtils.isNotBlank(user.getName())) {
user.setName(EmojiParser.removeAllEmojis(user.getName()));
tab.setStaffName(EmojiParser.removeAllEmojis(user.getName()));
tab.setStaffName((user.getName()));
}
if (StringUtils.isNotBlank(user.getAlias())) {
user.setAlias(EmojiParser.removeAllEmojis(user.getAlias()));
tab.setNickName(EmojiParser.removeAllEmojis(user.getAlias()));
tab.setNickName((user.getAlias()));
}
// tab.setNickName(user.getAlias());
tab.setNationCode("86");
......@@ -463,11 +463,18 @@ public class StaffApiServiceImpl implements StaffApiService {
//if(!staffDTO.getPhoneNumber().equals(related.getPhoneNumber())||!staffDTO.getStaffName().equals(clerkDTO.getStaffName())){
logger.info("clerkDto:{}", JSONObject.toJSONString(clerkDTO));
String headPic = staffDTO.getHeadImg();
if(clerkDTO != null && (StringUtils.isNotBlank(staffName) && !clerkDTO.getClerkName().equals(staffName) || !staffDTO.getPhoneNumber().equals(clerkDTO.getPhoneNumber()))
|| (org.apache.commons.lang3.StringUtils.isNotBlank(headPic) && !headPic.equals(clerkDTO.getHeadImgUrl()))
|| !staffDTO.getSex().equals(clerkDTO.getClerkGender())){
logger.info("【员工修改】clerkDTO={}",JSON.toJSONString(clerkDTO));
clerkDTO.setClerkName(staffDTO.getStaffName());
if (StringUtils.isBlank(staffDTO.getPhoneNumber())) {
staffDTO.setPhoneNumber("");
}
if (StringUtils.isBlank(clerkDTO.getPhoneNumber())) {
clerkDTO.setPhoneNumber("");
}
if (clerkDTO != null && (StringUtils.isNotBlank(staffName) && !clerkDTO.getClerkName().equals(staffName)
|| !staffDTO.getPhoneNumber().equals(clerkDTO.getPhoneNumber()))
|| (org.apache.commons.lang3.StringUtils.isNotBlank(headPic) && !headPic.equals(clerkDTO.getHeadImgUrl()))
|| !staffDTO.getSex().equals(Integer.valueOf(clerkDTO.getClerkGender()))) {
logger.info("【员工修改】clerkDTO={}", JSON.toJSONString(clerkDTO));
clerkDTO.setClerkName(staffDTO.getStaffName());
clerkDTO.setPhoneNumber(staffDTO.getPhoneNumber());
clerkDTO.setHeadImgUrl(staffDTO.getHeadImg());
clerkDTO.setClerkGender(staffDTO.getSex().toString());
......
......@@ -138,6 +138,9 @@ public class GroupSyncOperation implements BaseSyncOperation {
}
//todo 需要优化 测试
for (String id : ids) {
if (id.equals(dataId)) {
continue;
}
preDealService.updateStatusByDataId(taskId, id, PreDealStatusEnum.exception.getVal(), "父分组同步异常");
}
checkDepartmentTask(taskId);
......@@ -145,11 +148,7 @@ public class GroupSyncOperation implements BaseSyncOperation {
@Override
public void dealSuccess(String taskId, String dataId, String enterpriseId, String wxEnterpriseId) {
boolean b = preDealService.updateStatusByDataId(taskId, dataId, PreDealStatusEnum.computed.getVal(), "成功");
if (!b) {
logger.info("成功修改错误!{}", dataId);
return;
}
List<StoreDTO> storeDTOS = storeService.listStoreByStoreGroupId(dataId);
List<TabHaobanPreDealLog> hasExists = preDealService.listByPDataId(taskId, dataId, -1);
Set<String> hasDatas = new HashSet<>();
......@@ -179,6 +178,11 @@ public class GroupSyncOperation implements BaseSyncOperation {
}).collect(Collectors.toList());
preDealService.insert(preDealLogList);
}
boolean b = preDealService.updateStatusByDataId(taskId, dataId, PreDealStatusEnum.computed.getVal(), "成功");
if (!b) {
logger.info("成功修改错误!{}", dataId);
return;
}
List<TabHaobanPreDealLog> list = preDealService.listReByPDataId(taskId, dataId);
if (CollectionUtils.isNotEmpty(list)) {
Set<String> mid = list.stream().map(tab -> tab.getDataId()).collect(Collectors.toSet());
......
......@@ -179,11 +179,7 @@ public class QywxGroupSyncOperation implements BaseSyncOperation {
@Override
public void dealSuccess(String taskId, String dataId, String enterpriseId, String wxEnterpriseId) {
boolean b = preDealService.updateStatusByDataId(taskId, dataId, PreDealStatusEnum.computed.getVal(), "成功");
if (!b) {
logger.info("成功修改错误!{}", dataId);
return;
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
List<UserDTO> list = this.qywxUserApiService.listSelfDepartmentUser(wxEnterpriseDTO.getCorpid(), wxEnterpriseDTO.getContactSecret(), dataId, 0);
......@@ -209,6 +205,11 @@ public class QywxGroupSyncOperation implements BaseSyncOperation {
}).collect(Collectors.toList());
preDealService.insert(preDealLogList);
}
boolean b = preDealService.updateStatusByDataId(taskId, dataId, PreDealStatusEnum.computed.getVal(), "成功");
if (!b) {
logger.info("成功修改错误!{}", dataId);
return;
}
List<TabHaobanPreDealLog> preList = preDealService.listReByPDataId(taskId, dataId);
if (CollectionUtils.isNotEmpty(preList)) {
Set<String> mid = preList.stream().map(tab -> tab.getDataId()).collect(Collectors.toSet());
......
......@@ -142,11 +142,7 @@ public class StoreSyncOperation implements BaseSyncOperation {
@Override
public void dealSuccess(String taskId, String dataId, String enterpriseId, String wxEnterpriseId) {
boolean b = preDealService.updateStatusByDataId(taskId, dataId, PreDealStatusEnum.computed.getVal(), "成功");
if (!b) {
logger.info("成功修改错误!{}", dataId);
return;
}
List<ClerkListDTO> clerks = clerkService.getClerkByStoreId(enterpriseId, dataId);
List<TabHaobanPreDealLog> hasExists = preDealService.listByPDataId(taskId, dataId, -1);
Set<String> hasDatas = new HashSet<>();
......@@ -175,7 +171,11 @@ public class StoreSyncOperation implements BaseSyncOperation {
}).collect(Collectors.toList());
preDealService.insert(preDealLogList);
}
boolean b = preDealService.updateStatusByDataId(taskId, dataId, PreDealStatusEnum.computed.getVal(), "成功");
if (!b) {
logger.info("成功修改错误!{}", dataId);
return;
}
checkDepartmentTask(taskId);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment