Commit 5f15dc82 by 墨竹

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

parent 47fadd49
package com.gic.haoban.manage.api.dto;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.util.Date;
import org.springframework.util.StringUtils;
public class WxEnterpriseDTO implements Serializable {
private String wxEnterpriseId;
private static final long serialVersionUID = 1L;
private String wxEnterpriseId;
private String corpid;
......@@ -74,9 +76,9 @@ public class WxEnterpriseDTO implements Serializable {
private Date wxSecretKeyLastTime;
private Date contactSecretLastTime;
private Date memberSecretLastTime;
private Integer storeTotal;
private Date createTime;
......@@ -85,6 +87,15 @@ public class WxEnterpriseDTO implements Serializable {
//小程序版本
private String smallVersion;
/**
* 是否同意授权转换external_userid,1:是
*/
private Integer agreeExternalUseridFlag;
/**
* 是否同意授权转换external_userid时间
*/
private Date agreeExternalUseridTime;
public String getMemberSecret() {
return memberSecret;
}
......@@ -93,8 +104,6 @@ public class WxEnterpriseDTO implements Serializable {
this.memberSecret = memberSecret;
}
private static final long serialVersionUID = 1L;
public String getSmallVersion() {
return smallVersion;
}
......@@ -389,17 +398,29 @@ public class WxEnterpriseDTO implements Serializable {
public void setContactSecretFlag(Boolean contactSecretFlag) {
this.contactSecretFlag = contactSecretFlag;
}
}
public Integer getStoreTotal() {
return storeTotal;
}
public Integer getStoreTotal() {
return storeTotal;
}
public void setStoreTotal(Integer storeTotal) {
this.storeTotal = storeTotal;
}
public void setStoreTotal(Integer 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 {
* @return
*/
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;
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.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
public interface WxEnterpriseMapper {
int deleteByPrimaryKey(String wxEnterpriseId);
......@@ -20,8 +18,6 @@ public interface WxEnterpriseMapper {
int updateByPrimaryKeySelective(TabHaobanWxEnterprise record);
int updateByPrimaryKey(TabHaobanWxEnterprise record);
Page<TabHaobanWxEnterprise> list(@Param("keyword") String keyword,
@Param("enterpriseIds") List<String> enterpriseIds,
@Param("gicContactFlag") Integer gicContactFlag,
......
......@@ -4,6 +4,9 @@ import java.io.Serializable;
import java.util.Date;
public class TabHaobanWxEnterprise implements Serializable {
private static final long serialVersionUID = 1L;
private String wxEnterpriseId;
private String corpid;
......@@ -61,18 +64,25 @@ public class TabHaobanWxEnterprise implements Serializable {
private String memberSecret;
private String contactSecret;
private Date wxSecretKeyLastTime;
private Date contactSecretLastTime;
private Date memberSecretLastTime;
private Date createTime;
private Date updateTime;
/**
* 是否同意授权转换external_userid,1:是
*/
private Integer agreeExternalUseridFlag;
/**
* 是否同意授权转换external_userid时间
*/
private Date agreeExternalUseridTime;
private static final long serialVersionUID = 1L;
public String getMemberSecret() {
return memberSecret;
......@@ -336,17 +346,29 @@ public class TabHaobanWxEnterprise implements Serializable {
public void setContactSecretLastTime(Date contactSecretLastTime) {
this.contactSecretLastTime = contactSecretLastTime;
}
}
public Date getMemberSecretLastTime() {
return memberSecretLastTime;
}
public Date getMemberSecretLastTime() {
return memberSecretLastTime;
}
public void setMemberSecretLastTime(Date memberSecretLastTime) {
this.memberSecretLastTime = memberSecretLastTime;
}
public void setMemberSecretLastTime(Date 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;
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 com.gic.commons.util.EntityUtil;
import com.gic.haoban.manage.api.dto.ApplicationDTO;
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.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.ApplicationApiService;
import com.gic.haoban.manage.service.dao.mapper.ApplicationMapper;
import com.gic.haoban.manage.service.entity.TabHaobanApplication;
import com.gic.haoban.manage.service.entity.TabHaobanTemplateApplicationRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated;
import com.gic.haoban.manage.service.service.ApplicationService;
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 com.gic.haoban.manage.service.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class ApplicationApiServiceImpl implements ApplicationApiService {
@Autowired
private ApplicationService applicationService;
@Autowired
private ApplicationMapper applicationMapper;
@Autowired
private WxEnterpriseApplicationRelatedService wxEnterpriseApplicationRelatedService;
@Autowired
private TemplateEnterpriseRelatedService templateEnterpriseRelatedService;
@Autowired
private TemplateApplicationRelatedService templateApplicationRelatedService;
......@@ -63,9 +50,6 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
return result;
}
void saveEnterpriseApplicationRelateds(Set<String> applicationSet, String wxEnterpriseId){
wxEnterpriseApplicationRelatedService.saveEnterpriseApplicationRelateds(applicationSet, wxEnterpriseId);
}
@Override
public List<ApplicationDTO> listApplicationByWxEnterpriseId(String wxEnterpriseId) {
......@@ -76,7 +60,6 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
}
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<TabHaobanApplication> result = new ArrayList<TabHaobanApplication>();
for (TabHaobanApplication tabHaobanApplication : list) {
......@@ -104,9 +87,6 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
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 {
welcomeMapper.updateByPrimaryKey(tabWelcome);
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 {
public HaobanResponse storeFullList(BasePageInfo basePageInfo, String keyWord) {
LoginDTO login = (LoginDTO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
// String wxEnterpriseId = "1";
int maxVersionCount = 0;
List<EnterpriseDetailDTO> enterpriseList = wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtil.isEmpty(enterpriseList)) {
......@@ -271,7 +270,6 @@ public class WxEnterpriseController extends WebBaseController {
}
}
Page resultPage = new Page<>();
resultPage.setCurrentPage(page.getCurrentPage());
resultPage.setPageSize(page.getPageSize());
......@@ -508,11 +506,8 @@ public class WxEnterpriseController extends WebBaseController {
if (StringUtils.isAnyBlank(secretId)) {
return resultResponse(HaoBanErrCode.ERR_2);
}
boolean b = wxEnterpriseApiService.delSecretSetting(secretId);
return resultResponse(HaoBanErrCode.ERR_1, b);
}
//企业信息
......
......@@ -35,6 +35,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
......@@ -44,9 +45,9 @@ import java.util.Set;
import java.util.stream.Collectors;
@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
private QywxCorpApiService qywxCorpApiService;
......@@ -85,7 +86,7 @@ public class WxEnterpriseController extends WebBaseController {
* @param code
* @return
*/
@RequestMapping("get-info-by-code")
@RequestMapping(value = "get-info-by-code", method = {RequestMethod.GET, RequestMethod.POST})
public HaobanResponse getInfoByCode(String code) {
String userDTOJson = qywxCorpApiService.getCodeSession(config.getWxSuiteid(), code);
logger.info("userDTOJson=============>{}", userDTOJson);
......@@ -134,7 +135,6 @@ public class WxEnterpriseController extends WebBaseController {
}
}
}
}
//激活状态
if(loginStaff.getActiveFlag()==0) {
......@@ -164,6 +164,7 @@ public class WxEnterpriseController extends WebBaseController {
@RequestMapping("welldone-login")
public HaobanResponse welldoneLogin() {
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