|
@@ -0,0 +1,55 @@
|
|
|
+package com.rongwei.zhsw.system.service.impl;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.rongwe.zhsw.system.domain.SwUserManagementDo;
|
|
|
+import com.rongwe.zhsw.system.domain.SwUserWechatDo;
|
|
|
+import com.rongwe.zhsw.system.dto.UnbindWechatRequest;
|
|
|
+import com.rongwei.rwcommon.base.R;
|
|
|
+import com.rongwei.zhsw.system.service.SwUserManagementService;
|
|
|
+import com.rongwei.zhsw.system.service.SwUserWechatService;
|
|
|
+import com.rongwei.zhsw.system.service.WeChatUnbindService;
|
|
|
+import com.rongwei.zhsw.system.wechat.OwnerService;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import java.util.Map;
|
|
|
+@Service
|
|
|
+public class WeChatUnbindServiceImpl implements WeChatUnbindService {
|
|
|
+ @Autowired
|
|
|
+ SwUserManagementService swUserManagementService;
|
|
|
+ @Autowired
|
|
|
+ SwUserWechatService swUserWechatService;
|
|
|
+ @Autowired
|
|
|
+ OwnerService ownerService;
|
|
|
+
|
|
|
+ private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R unbingWechat(Map<String, String> refreshPara, String userid) {
|
|
|
+
|
|
|
+ try{
|
|
|
+ UpdateWrapper<SwUserWechatDo> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.eq("deleted", "0");
|
|
|
+ updateWrapper.eq("userid",userid);
|
|
|
+ updateWrapper.set("deleted", "1");
|
|
|
+ swUserWechatService.update(null,updateWrapper);
|
|
|
+
|
|
|
+ UpdateWrapper<SwUserManagementDo> updateWrapper1 =new UpdateWrapper<>();
|
|
|
+ updateWrapper1.eq("id",userid);
|
|
|
+ updateWrapper1.set("wechatbindstatus","0");
|
|
|
+ swUserManagementService.update(null, updateWrapper1);
|
|
|
+
|
|
|
+ ownerService.refreshOwner(refreshPara);
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("解绑微信失败,错误信息:{}", e.getMessage(), e);
|
|
|
+ return R.error("微信解绑失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|