Commit 174816d7 by 墨竹

Merge branch 'feature/login-token' into developer

# Conflicts:
#	haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
parents ac6c9f40 63ffaa56
......@@ -20,10 +20,19 @@ public interface WxApplicationApiService {
void cancelSuite(String corpId, String suiteId);
/**
*
* @param wxEnterpriseId
* @param type
* @return
*/
WxApplicationDTO selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int type);
/**
* 根据corpid进行查询
*
* @param corpId 公司标识
* @return {@link WxApplicationDTO }
* @author mozhu
* @date 2021-12-22 19:39:32
*/
WxApplicationDTO selectByCorpid(String corpId);
}
......@@ -242,14 +242,14 @@ public interface TabHaobanExternalClerkRelatedMapper {
/**
* 更新外部用户id的老外部用户id
*
* @param externalUserId 外部用户id
* @param newExternalUserId 外部用户id
* @param oldExternalUserId 旧的外部用户id
* @param wxEnterpriseId wx企业标识
* @return int
* @author mozhu
* @date 2021-12-13 15:33:41
*/
int updateExternalUserIdByOldExternalUserId(@Param("externalUserId") String externalUserId,
int updateExternalUserIdByOldExternalUserId(@Param("newExternalUserId") String newExternalUserId,
@Param("oldExternalUserId") String oldExternalUserId,
@Param("wxEnterpriseId") String wxEnterpriseId);
......
......@@ -13,4 +13,6 @@ public interface WxApplicationService {
TabHaobanWxApplication selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int applicationType);
int cancalWxApplication(String wxEnterpriseId, String suiteId);
TabHaobanWxApplication selectByCorpId(String corpid);
}
......@@ -49,5 +49,10 @@ public class WxApplicationServiceImpl implements WxApplicationService {
return this.mapper.cancelWxApplication(wxEnterpriseId, suiteId);
}
@Override
public TabHaobanWxApplication selectByCorpId(String corpid) {
return mapper.selectByCorpId(corpid);
}
}
......@@ -368,7 +368,7 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
break;
}
for (QywxNewExternalUseridDTO qywxNewExternalUseridDTO : newExternalUseridList) {
tabHaobanExternalClerkRelatedMapper.updateExternalUserIdByOldExternalUserId(qywxNewExternalUseridDTO.getNewExternalUserid(), qywxNewExternalUseridDTO.getExternalUserid(), wxEnterpriseId);
tabHaobanExternalClerkRelatedMapper.updateExternalUserIdByOldExternalUserId(qywxNewExternalUseridDTO.getNew_external_userid(), qywxNewExternalUseridDTO.getExternal_userid(), wxEnterpriseId);
}
}
}
......
......@@ -723,6 +723,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
* @return
*/
private Map<String, Set<String>> getExternalTagMap(String externalUseridInfo, String wxEnterpriseId) {
logger.info("externalUseridInfo:{}", externalUseridInfo);
Map<String, Set<String>> ret = new HashMap<>();
JSONObject jsonObject = JSONObject.parseObject(externalUseridInfo);
......@@ -738,7 +739,9 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
//做兼容
TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(wxUserId, wxEnterpriseId);
if (staff != null) {
logger.info("旧wxUserId:{}", wxUserId);
wxUserId = staff.getWxUserId();
logger.info("新wxUserId:{}", wxUserId);
}
Set<String> midTagIds = new HashSet<>();
if (!midUser.containsKey("tags")) {
......
......@@ -51,4 +51,9 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{
public WxApplicationDTO selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int type) {
return EntityUtil.changeEntityByJSON(WxApplicationDTO.class, wxApplicationService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, type));
}
@Override
public WxApplicationDTO selectByCorpid(String corpId) {
return EntityUtil.changeEntityByJSON(WxApplicationDTO.class, wxApplicationService.selectByCorpId(corpId));
}
}
......@@ -585,7 +585,7 @@
<update id="updateExternalUserIdByOldExternalUserId">
UPDATE
tab_haoban_external_clerk_related
SET external_user_id = #{externalUserId},
SET external_user_id = #{newExternalUserId},
update_time = now()
where external_user_id = #{oldExternalUserId}
and wx_enterprise_id = #{wxEnterpriseId}
......
......@@ -227,6 +227,19 @@ public class TestController extends WebBaseController {
}
/**
* 设置迁移完成
*
* @param corpid
* @param serviceCorpid
* @return
*/
@RequestMapping("/finishExternalUseridMigration")
public HaobanResponse finishExternalUseridMigration(String corpid, String serviceCorpid) {
qywxUserApiService.finishExternalUseridMigration(corpid, serviceCorpid);
return resultResponse(HaoBanErrCode.ERR_1);
}
/**
* 测试授权回调
*
* @param param
......
......@@ -88,6 +88,8 @@ public class WxEnterpriseInfoController extends WebBaseController {
private EnterpriseService enterpriseService;
@Autowired
private Config config;
@Autowired
private WxApplicationApiService wxApplicationApiService;
/**
......@@ -256,10 +258,9 @@ public class WxEnterpriseInfoController extends WebBaseController {
}
enterpriseDetailDTO = wxEnterpriseDTOS.get(0);
}
WxEnterpriseDTO enterpriseDTO = wxEnterpriseApiService.getOne(enterpriseDetailDTO.getWxEnterpriseId());
if (enterpriseDTO == null) {
logger.info("企业不存在:{}", qo.getGicEnterpriseId());
logger.info("企业不存在:{}", qo.getGicEnterpriseId());
return resultResponse(HaoBanErrCode.ERR_400002);
}
MemberLoginQo user = new MemberLoginQo();
......@@ -268,10 +269,19 @@ public class WxEnterpriseInfoController extends WebBaseController {
if (user == null) {
return resultResponse(HaoBanErrCode.ERR_6);
}
if (!user.getCorpId().equals(enterpriseDTO.getCorpid())) {
WxApplicationDTO wxApplicationDTO = wxApplicationApiService.selectByCorpid(user.getCorpId());
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(wxApplicationDTO.getWxEnterpriseId());
if (wxEnterpriseDTO == null) {
logger.info("该企业不存在:{}", qo.getGicEnterpriseId());
return resultResponse(HaoBanErrCode.ERR_400002);
}
return resultResponse(HaoBanErrCode.ERR_500003, wxEnterpriseDTO.getCorpid());
}
} else {
user.setUserId(qo.getUserId());
}
user.setCorpId(enterpriseDTO.getCorpid());
StaffDTO staffDTO = staffApiService.selectByUserIdAndEnterpriseId(user.getUserId(), enterpriseDTO.getWxEnterpriseId());
if (staffDTO == null) {
logger.info("成员不存在");
......
......@@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
/**
* Created 2018/7/20.
......@@ -48,6 +49,11 @@ public class MobileWebInterceptor extends HandlerInterceptorAdapter {
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
String requestURI = httpServletRequest.getRequestURI();
logger.info("post-url:{}", requestURI);
Map<String, String[]> parameterMap = httpServletRequest.getParameterMap();
logger.info("post-params:{}", JSONObject.toJSONString(parameterMap));
if (true) {
return true;
}
HandlerMethod handler = (HandlerMethod) o;
IgnoreLogin ignoreLogin = handler.getMethodAnnotation(IgnoreLogin.class);
if (null != ignoreLogin) {
......
......@@ -67,11 +67,13 @@
<dubbo:reference interface="com.gic.clerk.api.service.ClerkNewService" id="clerkNewService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.DealSyncOperationApiService" id="dealSyncOperationApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.DealSyncOperationApiService"
id="dealSyncOperationApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService"
id="externalClerkRelatedApiService"/>
<dubbo:reference id="operationSettingApiServiceImpl" interface="com.gic.haoban.manage.api.service.OperationSettingApiService" timeout="10000"
<dubbo:reference id="operationSettingApiServiceImpl"
interface="com.gic.haoban.manage.api.service.OperationSettingApiService" timeout="10000"
retries="0" check="false"/>
<dubbo:reference id="pendingTaskApiService"
......@@ -82,4 +84,7 @@
interface="com.gic.haoban.manage.api.service.notify.NoticeMessageApiService" timeout="10000"
retries="0" check="false"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.WxApplicationApiService"
id="wxApplicationApiService"/>
</beans>
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