Commit df55175f by fudahua

Merge remote-tracking branch 'origin/developer' into developer

parents 9d88ee0e a9878b56
...@@ -120,7 +120,7 @@ public interface DepartmentApiService { ...@@ -120,7 +120,7 @@ public interface DepartmentApiService {
List<DepartmentDTO> listByChainId(String chainId,String wxEnterpriseId); 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 * @param wxEnterpriseId
......
...@@ -47,7 +47,7 @@ public interface StaffApiService { ...@@ -47,7 +47,7 @@ public interface StaffApiService {
StaffDepartmentRelatedDTO getDepartmentIdAndCode(String departmentId, String code); 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); public List<String> listUnBindClerk(String storeId);
......
...@@ -157,18 +157,14 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -157,18 +157,14 @@ public class MessageApiServiceImpl implements MessageApiService {
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));
if(dto != null){ if(dto != null){
String siteId = dto.getSuiteId();
String corpId = dto.getAuthCorpId(); String corpId = dto.getAuthCorpId();
TabHaobanWxEnterprise enterprise = this.enterpriseService.getEnterpriseBycorpId(corpId); TabHaobanWxEnterprise enterprise = this.enterpriseService.getEnterpriseBycorpId(corpId);
if(enterprise != null){ if(enterprise != null){
TabHaobanWxApplication application = wxApplicationService.selectBySiteIdAndWxEnterpriseId(siteId, enterprise.getWxEnterpriseId()); if(dto.getChangeType().endsWith("party")){
if(application != null && application.getApplicationType() == 1){ this.dealDepartment(dto);
if(dto.getChangeType().endsWith("party")){ }else {
this.dealDepartment(dto); this.dealUser(dto);
}else { }
this.dealUser(dto);
}
}
} }
} }
} }
......
...@@ -47,10 +47,6 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -47,10 +47,6 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
private WxEnterpriseMapper wxEnterpriseMapper; private WxEnterpriseMapper wxEnterpriseMapper;
@Autowired @Autowired
private WxApplicationService wxApplicationService; private WxApplicationService wxApplicationService;
@Autowired
private QywxDepartmentApiService qywxDepartmentApiService;
@Autowired
private DepartmentService departmentService;
@Override @Override
public void callbackReviceEnterprise(QywxCorpInfoSimpleDTO dto) { public void callbackReviceEnterprise(QywxCorpInfoSimpleDTO dto) {
......
...@@ -48,7 +48,7 @@ public class AdminController extends WebBaseController{ ...@@ -48,7 +48,7 @@ public class AdminController extends WebBaseController{
public HaobanResponse adminList() { public HaobanResponse adminList() {
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser(); LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
WxApplicationDTO application = wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 1); WxApplicationDTO application = wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 2);
WxEnterpriseDTO enterprise = wxEnterpriseApiService.getOne(wxEnterpriseId); WxEnterpriseDTO enterprise = wxEnterpriseApiService.getOne(wxEnterpriseId);
logger.info("【管理员查询】corpid={},siteId={},agentId={}",enterprise.getCorpid(),application.getSiteId(),application.getAgentId()); logger.info("【管理员查询】corpid={},siteId={},agentId={}",enterprise.getCorpid(),application.getSiteId(),application.getAgentId());
String adminList = qywxSuiteApiService.getAdminList(enterprise.getCorpid(), application.getSiteId(), Integer.parseInt(application.getAgentId())); String adminList = qywxSuiteApiService.getAdminList(enterprise.getCorpid(), application.getSiteId(), Integer.parseInt(application.getAgentId()));
......
...@@ -102,13 +102,18 @@ public class ApplicationController extends WebBaseController{ ...@@ -102,13 +102,18 @@ public class ApplicationController extends WebBaseController{
} }
@RequestMapping("has-bind-contract") @RequestMapping("has-bind-contract")
public HaobanResponse hasBindContract(){ public HaobanResponse hasBindContract(){
LoginVO login = AuthRequestUtil.getSessionUser(); LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
WxApplicationDTO wxApplicationDTO = this.wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 1); WxEnterpriseDTO enterpriseDTO = this.wxEnterpriseApiService.getOne(wxEnterpriseId);
if(wxApplicationDTO != null){ if(enterpriseDTO != null){
return resultResponse(HaoBanErrCode.ERR_1, true); 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") @RequestMapping("get-auth-url")
...@@ -136,7 +141,7 @@ public class ApplicationController extends WebBaseController{ ...@@ -136,7 +141,7 @@ public class ApplicationController extends WebBaseController{
applicationDTO.setAgentName(dto.getAgentName()); applicationDTO.setAgentName(dto.getAgentName());
applicationDTO.setSiteId(dto.getSuiteId()); applicationDTO.setSiteId(dto.getSuiteId());
wxApplicationApiService.addSuite(applicationDTO); wxApplicationApiService.addSuite(applicationDTO);
this.departmentApiService.initwxDepartment(dto.getCorpid(), suiteId, enterpriseDTO.getWxEnterpriseId()); this.departmentApiService.initwxDepartment(dto.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId());
enterpriseDTO.setContactFlag(1); enterpriseDTO.setContactFlag(1);
wxEnterpriseApiService.update(enterpriseDTO); 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