Commit 0911e1e2 by sunxiwang

客户流失提醒状体查询

1 parent af7013f5
...@@ -94,4 +94,15 @@ public class WeCorpAccountController extends BaseController ...@@ -94,4 +94,15 @@ public class WeCorpAccountController extends BaseController
return toAjax(weCorpAccountService.startCustomerChurnNoticeSwitch(status)); return toAjax(weCorpAccountService.startCustomerChurnNoticeSwitch(status));
} }
/**
* 客户流失通知开关查询
*/
@PreAuthorize("@ss.hasPermi('wechat:corp:getCustomerChurnNoticeSwitch')")
@Log(title = "客户流失通知开关查询", businessType = BusinessType.OTHER)
@GetMapping("/getCustomerChurnNoticeSwitch")
public AjaxResult getCustomerChurnNoticeSwitch()
{
return AjaxResult.success(weCorpAccountService.getCustomerChurnNoticeSwitch());
}
} }
...@@ -66,4 +66,9 @@ public interface IWeCorpAccountService ...@@ -66,4 +66,9 @@ public interface IWeCorpAccountService
* @return * @return
*/ */
public int startCustomerChurnNoticeSwitch(String status); public int startCustomerChurnNoticeSwitch(String status);
/**
* 客户流失通知开关查询
*/
public Boolean getCustomerChurnNoticeSwitch();
} }
package com.linkwechat.wecom.service.impl; package com.linkwechat.wecom.service.impl;
import java.util.List; import java.util.List;
import java.util.Optional;
import com.linkwechat.common.constant.Constants; import com.linkwechat.common.constant.Constants;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.utils.DateUtils; import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.wecom.service.IWeCorpAccountService; import com.linkwechat.wecom.service.IWeCorpAccountService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -102,5 +104,24 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService { ...@@ -102,5 +104,24 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
return weCorpAccountMapper.updateWeCorpAccount(validWeCorpAccount); return weCorpAccountMapper.updateWeCorpAccount(validWeCorpAccount);
} }
@Override
public Boolean getCustomerChurnNoticeSwitch() {
boolean flag = false;
WeCorpAccount validWeCorpAccount = weCorpAccountMapper.findValidWeCorpAccount();
String noticeSwitch = Optional.ofNullable(validWeCorpAccount).map(WeCorpAccount::getCustomerChurnNoticeSwitch)
.orElse(WeConstans.DEL_FOLLOW_USER_SWITCH_CLOSE);
switch (noticeSwitch){
case WeConstans.DEL_FOLLOW_USER_SWITCH_CLOSE:
flag = false;
break;
case WeConstans.DEL_FOLLOW_USER_SWITCH_OPEN:
flag =true;
break;
default:
break;
}
return flag;
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!