Commit 5f15dc82 by 墨竹

feat:新增是否同意授权转换external_userid字段

parent 47fadd49
package com.gic.haoban.manage.api.dto; package com.gic.haoban.manage.api.dto;
import org.springframework.util.StringUtils;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import org.springframework.util.StringUtils;
public class WxEnterpriseDTO implements Serializable { public class WxEnterpriseDTO implements Serializable {
private String wxEnterpriseId; private static final long serialVersionUID = 1L;
private String wxEnterpriseId;
private String corpid; private String corpid;
...@@ -74,9 +76,9 @@ public class WxEnterpriseDTO implements Serializable { ...@@ -74,9 +76,9 @@ public class WxEnterpriseDTO implements Serializable {
private Date wxSecretKeyLastTime; private Date wxSecretKeyLastTime;
private Date contactSecretLastTime; private Date contactSecretLastTime;
private Date memberSecretLastTime; private Date memberSecretLastTime;
private Integer storeTotal; private Integer storeTotal;
private Date createTime; private Date createTime;
...@@ -85,6 +87,15 @@ public class WxEnterpriseDTO implements Serializable { ...@@ -85,6 +87,15 @@ public class WxEnterpriseDTO implements Serializable {
//小程序版本 //小程序版本
private String smallVersion; private String smallVersion;
/**
* 是否同意授权转换external_userid,1:是
*/
private Integer agreeExternalUseridFlag;
/**
* 是否同意授权转换external_userid时间
*/
private Date agreeExternalUseridTime;
public String getMemberSecret() { public String getMemberSecret() {
return memberSecret; return memberSecret;
} }
...@@ -93,8 +104,6 @@ public class WxEnterpriseDTO implements Serializable { ...@@ -93,8 +104,6 @@ public class WxEnterpriseDTO implements Serializable {
this.memberSecret = memberSecret; this.memberSecret = memberSecret;
} }
private static final long serialVersionUID = 1L;
public String getSmallVersion() { public String getSmallVersion() {
return smallVersion; return smallVersion;
} }
...@@ -389,17 +398,29 @@ public class WxEnterpriseDTO implements Serializable { ...@@ -389,17 +398,29 @@ public class WxEnterpriseDTO implements Serializable {
public void setContactSecretFlag(Boolean contactSecretFlag) { public void setContactSecretFlag(Boolean contactSecretFlag) {
this.contactSecretFlag = contactSecretFlag; this.contactSecretFlag = contactSecretFlag;
} }
public Integer getStoreTotal() { public Integer getStoreTotal() {
return storeTotal; return storeTotal;
} }
public void setStoreTotal(Integer storeTotal) { public void setStoreTotal(Integer storeTotal) {
this.storeTotal = storeTotal; this.storeTotal = storeTotal;
} }
public Integer getAgreeExternalUseridFlag() {
return agreeExternalUseridFlag;
}
public void setAgreeExternalUseridFlag(Integer agreeExternalUseridFlag) {
this.agreeExternalUseridFlag = agreeExternalUseridFlag;
}
public Date getAgreeExternalUseridTime() {
return agreeExternalUseridTime;
}
public void setAgreeExternalUseridTime(Date agreeExternalUseridTime) {
this.agreeExternalUseridTime = agreeExternalUseridTime;
}
} }
...@@ -143,4 +143,15 @@ public interface WxEnterpriseApiService { ...@@ -143,4 +143,15 @@ public interface WxEnterpriseApiService {
* @return * @return
*/ */
boolean delWelcome(String wxEnterpriseId); boolean delWelcome(String wxEnterpriseId);
/**
* 企微回调-同意授权转换external_userid
*
* @param corpId 公司标识
* @param serviceCorpId 服务公司id
* @author mozhu
* @date 2021-11-30 19:14:08
*/
void agreeExternalUseridCallBack(String corpId, String serviceCorpId);
} }
package com.gic.haoban.manage.service.dao.mapper; package com.gic.haoban.manage.service.dao.mapper;
import java.util.List;
import java.util.Set;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
public interface WxEnterpriseMapper { public interface WxEnterpriseMapper {
int deleteByPrimaryKey(String wxEnterpriseId); int deleteByPrimaryKey(String wxEnterpriseId);
...@@ -20,8 +18,6 @@ public interface WxEnterpriseMapper { ...@@ -20,8 +18,6 @@ public interface WxEnterpriseMapper {
int updateByPrimaryKeySelective(TabHaobanWxEnterprise record); int updateByPrimaryKeySelective(TabHaobanWxEnterprise record);
int updateByPrimaryKey(TabHaobanWxEnterprise record);
Page<TabHaobanWxEnterprise> list(@Param("keyword") String keyword, Page<TabHaobanWxEnterprise> list(@Param("keyword") String keyword,
@Param("enterpriseIds") List<String> enterpriseIds, @Param("enterpriseIds") List<String> enterpriseIds,
@Param("gicContactFlag") Integer gicContactFlag, @Param("gicContactFlag") Integer gicContactFlag,
......
...@@ -4,6 +4,9 @@ import java.io.Serializable; ...@@ -4,6 +4,9 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class TabHaobanWxEnterprise implements Serializable { public class TabHaobanWxEnterprise implements Serializable {
private static final long serialVersionUID = 1L;
private String wxEnterpriseId; private String wxEnterpriseId;
private String corpid; private String corpid;
...@@ -61,18 +64,25 @@ public class TabHaobanWxEnterprise implements Serializable { ...@@ -61,18 +64,25 @@ public class TabHaobanWxEnterprise implements Serializable {
private String memberSecret; private String memberSecret;
private String contactSecret; private String contactSecret;
private Date wxSecretKeyLastTime; private Date wxSecretKeyLastTime;
private Date contactSecretLastTime; private Date contactSecretLastTime;
private Date memberSecretLastTime; private Date memberSecretLastTime;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
/**
* 是否同意授权转换external_userid,1:是
*/
private Integer agreeExternalUseridFlag;
/**
* 是否同意授权转换external_userid时间
*/
private Date agreeExternalUseridTime;
private static final long serialVersionUID = 1L;
public String getMemberSecret() { public String getMemberSecret() {
return memberSecret; return memberSecret;
...@@ -336,17 +346,29 @@ public class TabHaobanWxEnterprise implements Serializable { ...@@ -336,17 +346,29 @@ public class TabHaobanWxEnterprise implements Serializable {
public void setContactSecretLastTime(Date contactSecretLastTime) { public void setContactSecretLastTime(Date contactSecretLastTime) {
this.contactSecretLastTime = contactSecretLastTime; this.contactSecretLastTime = contactSecretLastTime;
} }
public Date getMemberSecretLastTime() { public Date getMemberSecretLastTime() {
return memberSecretLastTime; return memberSecretLastTime;
} }
public void setMemberSecretLastTime(Date memberSecretLastTime) { public void setMemberSecretLastTime(Date memberSecretLastTime) {
this.memberSecretLastTime = memberSecretLastTime; this.memberSecretLastTime = memberSecretLastTime;
} }
public Integer getAgreeExternalUseridFlag() {
return agreeExternalUseridFlag;
}
public void setAgreeExternalUseridFlag(Integer agreeExternalUseridFlag) {
this.agreeExternalUseridFlag = agreeExternalUseridFlag;
}
public Date getAgreeExternalUseridTime() {
return agreeExternalUseridTime;
}
public void setAgreeExternalUseridTime(Date agreeExternalUseridTime) {
this.agreeExternalUseridTime = agreeExternalUseridTime;
}
} }
\ No newline at end of file
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.haoban.manage.api.dto.ApplicationDTO; import com.gic.haoban.manage.api.dto.ApplicationDTO;
import com.gic.haoban.manage.api.dto.ApplicationTemplateDTO; import com.gic.haoban.manage.api.dto.ApplicationTemplateDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.api.dto.TemplateEnterpriseRelatedDTO; import com.gic.haoban.manage.api.dto.TemplateEnterpriseRelatedDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.ApplicationApiService; import com.gic.haoban.manage.api.service.ApplicationApiService;
import com.gic.haoban.manage.service.dao.mapper.ApplicationMapper; import com.gic.haoban.manage.service.dao.mapper.ApplicationMapper;
import com.gic.haoban.manage.service.entity.TabHaobanApplication; import com.gic.haoban.manage.service.entity.TabHaobanApplication;
import com.gic.haoban.manage.service.entity.TabHaobanTemplateApplicationRelated; import com.gic.haoban.manage.service.entity.TabHaobanTemplateApplicationRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated; import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.service.ApplicationService; import org.springframework.beans.factory.annotation.Autowired;
import com.gic.haoban.manage.service.service.ApplicationTemplateService;
import com.gic.haoban.manage.service.service.TemplateApplicationRelatedService;
import com.gic.haoban.manage.service.service.TemplateEnterpriseRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseApplicationRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@Service @Service
public class ApplicationApiServiceImpl implements ApplicationApiService { public class ApplicationApiServiceImpl implements ApplicationApiService {
@Autowired @Autowired
private ApplicationService applicationService; private ApplicationService applicationService;
@Autowired @Autowired
private ApplicationMapper applicationMapper; private ApplicationMapper applicationMapper;
@Autowired @Autowired
private WxEnterpriseApplicationRelatedService wxEnterpriseApplicationRelatedService;
@Autowired
private TemplateEnterpriseRelatedService templateEnterpriseRelatedService; private TemplateEnterpriseRelatedService templateEnterpriseRelatedService;
@Autowired @Autowired
private TemplateApplicationRelatedService templateApplicationRelatedService; private TemplateApplicationRelatedService templateApplicationRelatedService;
...@@ -63,9 +50,6 @@ public class ApplicationApiServiceImpl implements ApplicationApiService { ...@@ -63,9 +50,6 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
return result; return result;
} }
void saveEnterpriseApplicationRelateds(Set<String> applicationSet, String wxEnterpriseId){
wxEnterpriseApplicationRelatedService.saveEnterpriseApplicationRelateds(applicationSet, wxEnterpriseId);
}
@Override @Override
public List<ApplicationDTO> listApplicationByWxEnterpriseId(String wxEnterpriseId) { public List<ApplicationDTO> listApplicationByWxEnterpriseId(String wxEnterpriseId) {
...@@ -76,7 +60,6 @@ public class ApplicationApiServiceImpl implements ApplicationApiService { ...@@ -76,7 +60,6 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
} }
List<TabHaobanTemplateApplicationRelated> applicatinList = templateApplicationRelatedService.listByTemplateId(template.getApplicationTemplateId()); List<TabHaobanTemplateApplicationRelated> applicatinList = templateApplicationRelatedService.listByTemplateId(template.getApplicationTemplateId());
//List<TabHaobanWxEnterpriseApplicationRelated> relatedList = wxEnterpriseApplicationRelatedService.listByWxEnterpriseId(wxEnterpriseId);
List<String> applicationIds = applicatinList.stream().map(s->s.getApplicationId()).collect(Collectors.toList()); List<String> applicationIds = applicatinList.stream().map(s->s.getApplicationId()).collect(Collectors.toList());
List<TabHaobanApplication> result = new ArrayList<TabHaobanApplication>(); List<TabHaobanApplication> result = new ArrayList<TabHaobanApplication>();
for (TabHaobanApplication tabHaobanApplication : list) { for (TabHaobanApplication tabHaobanApplication : list) {
...@@ -104,9 +87,6 @@ public class ApplicationApiServiceImpl implements ApplicationApiService { ...@@ -104,9 +87,6 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
templateEnterpriseRelatedService.insert(dto); templateEnterpriseRelatedService.insert(dto);
} }
} }
// List<TabHaobanApplication> list = applicationService.listApplication();
// Set<String> applicationSet = list.stream().map(TabHaobanApplication::getApplicationId).collect(Collectors.toSet());
// wxEnterpriseApplicationRelatedService.saveEnterpriseApplicationRelateds(applicationSet, wxEnterpriseId);
} }
} }
...@@ -273,4 +273,20 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -273,4 +273,20 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
welcomeMapper.updateByPrimaryKey(tabWelcome); welcomeMapper.updateByPrimaryKey(tabWelcome);
return true; return true;
} }
@Override
public void agreeExternalUseridCallBack(String corpId, String serviceCorpId) {
TabHaobanWxEnterprise tabHaobanWxEnterprise = wxEnterpriseService.getEnterpriseBycorpId(corpId);
if (tabHaobanWxEnterprise == null) {
return;
}
WxEnterpriseDTO wxEnterpriseDTO = new WxEnterpriseDTO();
wxEnterpriseDTO.setWxEnterpriseId(tabHaobanWxEnterprise.getWxEnterpriseId());
wxEnterpriseDTO.setAgreeExternalUseridFlag(1);
wxEnterpriseDTO.setAgreeExternalUseridTime(new Date());
wxEnterpriseDTO.setUpdateTime(new Date());
wxEnterpriseService.update(wxEnterpriseDTO);
}
} }
...@@ -232,7 +232,6 @@ public class WxEnterpriseController extends WebBaseController { ...@@ -232,7 +232,6 @@ public class WxEnterpriseController extends WebBaseController {
public HaobanResponse storeFullList(BasePageInfo basePageInfo, String keyWord) { public HaobanResponse storeFullList(BasePageInfo basePageInfo, String keyWord) {
LoginDTO login = (LoginDTO) AuthRequestUtil.getLoginUser(); LoginDTO login = (LoginDTO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
// String wxEnterpriseId = "1";
int maxVersionCount = 0; int maxVersionCount = 0;
List<EnterpriseDetailDTO> enterpriseList = wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseId(wxEnterpriseId); List<EnterpriseDetailDTO> enterpriseList = wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtil.isEmpty(enterpriseList)) { if (CollectionUtil.isEmpty(enterpriseList)) {
...@@ -271,7 +270,6 @@ public class WxEnterpriseController extends WebBaseController { ...@@ -271,7 +270,6 @@ public class WxEnterpriseController extends WebBaseController {
} }
} }
Page resultPage = new Page<>(); Page resultPage = new Page<>();
resultPage.setCurrentPage(page.getCurrentPage()); resultPage.setCurrentPage(page.getCurrentPage());
resultPage.setPageSize(page.getPageSize()); resultPage.setPageSize(page.getPageSize());
...@@ -508,11 +506,8 @@ public class WxEnterpriseController extends WebBaseController { ...@@ -508,11 +506,8 @@ public class WxEnterpriseController extends WebBaseController {
if (StringUtils.isAnyBlank(secretId)) { if (StringUtils.isAnyBlank(secretId)) {
return resultResponse(HaoBanErrCode.ERR_2); return resultResponse(HaoBanErrCode.ERR_2);
} }
boolean b = wxEnterpriseApiService.delSecretSetting(secretId); boolean b = wxEnterpriseApiService.delSecretSetting(secretId);
return resultResponse(HaoBanErrCode.ERR_1, b); return resultResponse(HaoBanErrCode.ERR_1, b);
} }
//企业信息 //企业信息
......
...@@ -35,6 +35,7 @@ import org.slf4j.Logger; ...@@ -35,6 +35,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -44,9 +45,9 @@ import java.util.Set; ...@@ -44,9 +45,9 @@ import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@RestController @RestController
public class WxEnterpriseController extends WebBaseController { public class WxEnterpriseInfoController extends WebBaseController {
private static final Logger logger = LoggerFactory.getLogger(WxEnterpriseController.class); private static final Logger logger = LoggerFactory.getLogger(WxEnterpriseInfoController.class);
@Autowired @Autowired
private QywxCorpApiService qywxCorpApiService; private QywxCorpApiService qywxCorpApiService;
...@@ -85,7 +86,7 @@ public class WxEnterpriseController extends WebBaseController { ...@@ -85,7 +86,7 @@ public class WxEnterpriseController extends WebBaseController {
* @param code * @param code
* @return * @return
*/ */
@RequestMapping("get-info-by-code") @RequestMapping(value = "get-info-by-code", method = {RequestMethod.GET, RequestMethod.POST})
public HaobanResponse getInfoByCode(String code) { public HaobanResponse getInfoByCode(String code) {
String userDTOJson = qywxCorpApiService.getCodeSession(config.getWxSuiteid(), code); String userDTOJson = qywxCorpApiService.getCodeSession(config.getWxSuiteid(), code);
logger.info("userDTOJson=============>{}", userDTOJson); logger.info("userDTOJson=============>{}", userDTOJson);
...@@ -134,7 +135,6 @@ public class WxEnterpriseController extends WebBaseController { ...@@ -134,7 +135,6 @@ public class WxEnterpriseController extends WebBaseController {
} }
} }
} }
} }
//激活状态 //激活状态
if(loginStaff.getActiveFlag()==0) { if(loginStaff.getActiveFlag()==0) {
...@@ -164,6 +164,7 @@ public class WxEnterpriseController extends WebBaseController { ...@@ -164,6 +164,7 @@ public class WxEnterpriseController extends WebBaseController {
@RequestMapping("welldone-login") @RequestMapping("welldone-login")
public HaobanResponse welldoneLogin() { public HaobanResponse welldoneLogin() {
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
......
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