Commit 38be5df2 by 墨竹

feat:成员同步日志

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