Commit 38be5df2 by 墨竹

feat:成员同步日志

parent 4b070b44
...@@ -115,7 +115,7 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -115,7 +115,7 @@ public class MessageApiServiceImpl implements MessageApiService {
@Override @Override
public void dealWxMessage(String param) { public void dealWxMessage(String param) {
QywxCallBackDTO dto = JSON.parseObject(param, QywxCallBackDTO.class); QywxCallBackDTO dto = JSON.parseObject(param, QywxCallBackDTO.class);
log.info("【成员回调处理】dto={}", JSON.toJSONString(param)); log.info("【成员同步回调处理】dto={}", JSON.toJSONString(param));
TabHaobanWxApplication wxApplication = wxApplicationService.selectByCorpId(dto.getAuthCorpId()); TabHaobanWxApplication wxApplication = wxApplicationService.selectByCorpId(dto.getAuthCorpId());
if (Objects.isNull(wxApplication)) { if (Objects.isNull(wxApplication)) {
log.info("通过corpId:【{}】未查询到授权企业,无法处理", dto.getAuthCorpId()); log.info("通过corpId:【{}】未查询到授权企业,无法处理", dto.getAuthCorpId());
...@@ -125,6 +125,7 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -125,6 +125,7 @@ public class MessageApiServiceImpl implements MessageApiService {
// 校验适用企业-定制 // 校验适用企业-定制
boolean suitWxEnterpriseIid = checkSuitEnterpriseId(wxEnterpriseId); boolean suitWxEnterpriseIid = checkSuitEnterpriseId(wxEnterpriseId);
if (suitWxEnterpriseIid) { if (suitWxEnterpriseIid) {
log.info("成员同步定制化开始");
// 处理定制-目前鸿星尔克用 // 处理定制-目前鸿星尔克用
boolean checkErkeDeal = checkErkeDeal(dto); boolean checkErkeDeal = checkErkeDeal(dto);
if (!checkErkeDeal) { if (!checkErkeDeal) {
...@@ -153,6 +154,7 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -153,6 +154,7 @@ public class MessageApiServiceImpl implements MessageApiService {
} }
// 取第一个企业的id // 取第一个企业的id
doDealUser(dto, relatedList.get(0).getEnterpriseId(), secretSetting.getSecretVal()); doDealUser(dto, relatedList.get(0).getEnterpriseId(), secretSetting.getSecretVal());
log.info("成员同步定制化结束");
} else { } else {
dealUser(dto); dealUser(dto);
} }
...@@ -227,15 +229,15 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -227,15 +229,15 @@ public class MessageApiServiceImpl implements MessageApiService {
String changeType = qywxCallBackDTO.getChangeType(); String changeType = qywxCallBackDTO.getChangeType();
if (changeType.equals(WxEditType.ADDUSER.getCode())) { if (changeType.equals(WxEditType.ADDUSER.getCode())) {
log.info("成员新增,userid:{}", userid); log.info("成员同步新增,userid:{}", userid);
//新增 //新增
this.staffApiService.wxGetAdd(userid, wxEnterpriseId); this.staffApiService.wxGetAdd(userid, wxEnterpriseId);
} else if (changeType.equals(WxEditType.UPDATEUSER.getCode())) { } else if (changeType.equals(WxEditType.UPDATEUSER.getCode())) {
log.info("成员修改,userid:{}", userid); log.info("成员同步修改,userid:{}", userid);
//修改 //修改
TabHaobanStaff oldStaff = this.staffService.selectByUserIdAndEnterpriseId(userid, wxEnterpriseId); TabHaobanStaff oldStaff = this.staffService.selectByUserIdAndEnterpriseId(userid, wxEnterpriseId);
if (oldStaff == null) { if (oldStaff == null) {
log.error("成员更新失败,无历史员工数据:userid:{},wxEnterpriseId:{}", userid, wxEnterpriseId); log.error("成员同步更新失败,无历史员工数据:userid:{},wxEnterpriseId:{}", userid, wxEnterpriseId);
return; return;
} }
TabHaobanStaff staff = new TabHaobanStaff(); TabHaobanStaff staff = new TabHaobanStaff();
...@@ -261,7 +263,7 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -261,7 +263,7 @@ public class MessageApiServiceImpl implements MessageApiService {
for (String s : departArr) { for (String s : departArr) {
TabHaobanDepartment department = this.departmentService.getByWxId(s, wxEnterpriseId); TabHaobanDepartment department = this.departmentService.getByWxId(s, wxEnterpriseId);
if (department == null) { if (department == null) {
log.info("部门不存在"); log.info("成员同步,部门不存在");
continue; continue;
} }
departmentIds.append(department.getDepartmentId()).append(","); departmentIds.append(department.getDepartmentId()).append(",");
...@@ -278,11 +280,11 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -278,11 +280,11 @@ public class MessageApiServiceImpl implements MessageApiService {
StaffDTO staffDTO = EntityUtil.changeEntityByJSON(StaffDTO.class, staff); StaffDTO staffDTO = EntityUtil.changeEntityByJSON(StaffDTO.class, staff);
staffApiService.staffEdit(staffDTO, departmentIds.toString()); staffApiService.staffEdit(staffDTO, departmentIds.toString());
} else if (changeType.equals(WxEditType.DELETEUSER.getCode())) { } else if (changeType.equals(WxEditType.DELETEUSER.getCode())) {
log.info("成员删除,userid:{}", userid); log.info("成员同步删除,userid:{}", userid);
//删除 //删除
TabHaobanStaff oldStaff = this.staffService.selectByUserIdAndEnterpriseId(userid, wxEnterpriseId); TabHaobanStaff oldStaff = this.staffService.selectByUserIdAndEnterpriseId(userid, wxEnterpriseId);
if (oldStaff == null) { if (oldStaff == null) {
log.info("微信同步删除的门店不存在,{}", userid); log.info("微信成员同步删除的门店不存在,{}", userid);
return; return;
} }
//销毁卡券 //销毁卡券
...@@ -291,7 +293,10 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -291,7 +293,10 @@ public class MessageApiServiceImpl implements MessageApiService {
this.staffDepartmentRelatedService.delByUserid(userid); this.staffDepartmentRelatedService.delByUserid(userid);
//删除员工表 //删除员工表
this.staffService.delByStaffId(oldStaff.getStaffId()); this.staffService.delByStaffId(oldStaff.getStaffId());
}else {
log.error("成员同步类型错误,changeType:{}",changeType);
} }
log.error("成员同步结束");
} }
private String changeHeaderImageUrl(String headImgUrl) { private String changeHeaderImageUrl(String headImgUrl) {
......
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