Commit b3f706ca by qwmqiuwenmin

fix

parent 5f203fe8
......@@ -120,7 +120,7 @@ public interface DepartmentApiService {
List<DepartmentDTO> listByChainId(String chainId,String wxEnterpriseId);
void initwxDepartment(String corpid, String suiteid, String wxEnterpriseId);
void initwxDepartment(String corpid, String contactSecret, String wxEnterpriseId);
/**
* 回收站的数量
* @param wxEnterpriseId
......
......@@ -47,7 +47,7 @@ public interface StaffApiService {
StaffDepartmentRelatedDTO getDepartmentIdAndCode(String departmentId, String code);
void initWxUser(String corpid, String suiteid, String wxEnterpriseId, Integer wxDepartmentId);
void initWxUser(String corpid, String contactSecret, String wxEnterpriseId, Integer wxDepartmentId);
public List<String> listUnBindClerk(String storeId);
......
......@@ -47,10 +47,6 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
private WxEnterpriseMapper wxEnterpriseMapper;
@Autowired
private WxApplicationService wxApplicationService;
@Autowired
private QywxDepartmentApiService qywxDepartmentApiService;
@Autowired
private DepartmentService departmentService;
@Override
public void callbackReviceEnterprise(QywxCorpInfoSimpleDTO dto) {
......
......@@ -48,7 +48,7 @@ public class AdminController extends WebBaseController{
public HaobanResponse adminList() {
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
WxApplicationDTO application = wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 1);
WxApplicationDTO application = wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 2);
WxEnterpriseDTO enterprise = wxEnterpriseApiService.getOne(wxEnterpriseId);
logger.info("【管理员查询】corpid={},siteId={},agentId={}",enterprise.getCorpid(),application.getSiteId(),application.getAgentId());
String adminList = qywxSuiteApiService.getAdminList(enterprise.getCorpid(), application.getSiteId(), Integer.parseInt(application.getAgentId()));
......
......@@ -102,13 +102,18 @@ public class ApplicationController extends WebBaseController{
}
@RequestMapping("has-bind-contract")
public HaobanResponse hasBindContract(){
LoginVO login = AuthRequestUtil.getSessionUser();
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
WxApplicationDTO wxApplicationDTO = this.wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 1);
if(wxApplicationDTO != null){
return resultResponse(HaoBanErrCode.ERR_1, true);
WxEnterpriseDTO enterpriseDTO = this.wxEnterpriseApiService.getOne(wxEnterpriseId);
if(enterpriseDTO != null){
if(StringUtils.isNotBlank(enterpriseDTO.getContactSecret()) && enterpriseDTO.getContactFlag() != null && enterpriseDTO.getContactFlag() == 1){
this.departmentApiService.initwxDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId());
enterpriseDTO.setContactFlag(1);
wxEnterpriseApiService.update(enterpriseDTO);
}
}
return resultResponse(HaoBanErrCode.ERR_1, false);
return resultResponse(HaoBanErrCode.ERR_1, true);
}
@RequestMapping("get-auth-url")
......@@ -136,7 +141,7 @@ public class ApplicationController extends WebBaseController{
applicationDTO.setAgentName(dto.getAgentName());
applicationDTO.setSiteId(dto.getSuiteId());
wxApplicationApiService.addSuite(applicationDTO);
this.departmentApiService.initwxDepartment(dto.getCorpid(), suiteId, enterpriseDTO.getWxEnterpriseId());
this.departmentApiService.initwxDepartment(dto.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId());
enterpriseDTO.setContactFlag(1);
wxEnterpriseApiService.update(enterpriseDTO);
}
......
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