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
...@@ -18,12 +18,21 @@ public interface WxApplicationApiService { ...@@ -18,12 +18,21 @@ public interface WxApplicationApiService {
* @param suiteId * @param suiteId
*/ */
void cancelSuite(String corpId, String suiteId); void cancelSuite(String corpId, String suiteId);
/** /**
*
* @param wxEnterpriseId * @param wxEnterpriseId
* @param type * @param type
* @return * @return
*/ */
WxApplicationDTO selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int type); 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 { ...@@ -242,14 +242,14 @@ public interface TabHaobanExternalClerkRelatedMapper {
/** /**
* 更新外部用户id的老外部用户id * 更新外部用户id的老外部用户id
* *
* @param externalUserId 外部用户id * @param newExternalUserId 外部用户id
* @param oldExternalUserId 旧的外部用户id * @param oldExternalUserId 旧的外部用户id
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
* @return int * @return int
* @author mozhu * @author mozhu
* @date 2021-12-13 15:33:41 * @date 2021-12-13 15:33:41
*/ */
int updateExternalUserIdByOldExternalUserId(@Param("externalUserId") String externalUserId, int updateExternalUserIdByOldExternalUserId(@Param("newExternalUserId") String newExternalUserId,
@Param("oldExternalUserId") String oldExternalUserId, @Param("oldExternalUserId") String oldExternalUserId,
@Param("wxEnterpriseId") String wxEnterpriseId); @Param("wxEnterpriseId") String wxEnterpriseId);
......
...@@ -13,4 +13,6 @@ public interface WxApplicationService { ...@@ -13,4 +13,6 @@ public interface WxApplicationService {
TabHaobanWxApplication selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int applicationType); TabHaobanWxApplication selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int applicationType);
int cancalWxApplication(String wxEnterpriseId, String suiteId); int cancalWxApplication(String wxEnterpriseId, String suiteId);
TabHaobanWxApplication selectByCorpId(String corpid);
} }
...@@ -39,15 +39,20 @@ public class WxApplicationServiceImpl implements WxApplicationService { ...@@ -39,15 +39,20 @@ public class WxApplicationServiceImpl implements WxApplicationService {
} }
@Override @Override
public TabHaobanWxApplication selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int applicationType) { public TabHaobanWxApplication selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int applicationType) {
return mapper.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, applicationType); return mapper.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, applicationType);
} }
@Override @Override
public int cancalWxApplication(String wxEnterpriseId, String suiteId) { public int cancalWxApplication(String wxEnterpriseId, String suiteId) {
return this.mapper.cancelWxApplication(wxEnterpriseId, suiteId); 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 ...@@ -368,7 +368,7 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
break; break;
} }
for (QywxNewExternalUseridDTO qywxNewExternalUseridDTO : newExternalUseridList) { 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 { ...@@ -723,6 +723,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
* @return * @return
*/ */
private Map<String, Set<String>> getExternalTagMap(String externalUseridInfo, String wxEnterpriseId) { private Map<String, Set<String>> getExternalTagMap(String externalUseridInfo, String wxEnterpriseId) {
logger.info("externalUseridInfo:{}", externalUseridInfo);
Map<String, Set<String>> ret = new HashMap<>(); Map<String, Set<String>> ret = new HashMap<>();
JSONObject jsonObject = JSONObject.parseObject(externalUseridInfo); JSONObject jsonObject = JSONObject.parseObject(externalUseridInfo);
...@@ -738,7 +739,9 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -738,7 +739,9 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
//做兼容 //做兼容
TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(wxUserId, wxEnterpriseId); TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(wxUserId, wxEnterpriseId);
if (staff != null) { if (staff != null) {
logger.info("旧wxUserId:{}", wxUserId);
wxUserId = staff.getWxUserId(); wxUserId = staff.getWxUserId();
logger.info("新wxUserId:{}", wxUserId);
} }
Set<String> midTagIds = new HashSet<>(); Set<String> midTagIds = new HashSet<>();
if (!midUser.containsKey("tags")) { if (!midUser.containsKey("tags")) {
......
...@@ -47,8 +47,13 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{ ...@@ -47,8 +47,13 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{
log.info("企业未绑定过,{}", corpId); log.info("企业未绑定过,{}", corpId);
} }
@Override @Override
public WxApplicationDTO selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int type) { public WxApplicationDTO selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int type) {
return EntityUtil.changeEntityByJSON(WxApplicationDTO.class, wxApplicationService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 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 @@ ...@@ -585,7 +585,7 @@
<update id="updateExternalUserIdByOldExternalUserId"> <update id="updateExternalUserIdByOldExternalUserId">
UPDATE UPDATE
tab_haoban_external_clerk_related tab_haoban_external_clerk_related
SET external_user_id = #{externalUserId}, SET external_user_id = #{newExternalUserId},
update_time = now() update_time = now()
where external_user_id = #{oldExternalUserId} where external_user_id = #{oldExternalUserId}
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
......
...@@ -227,6 +227,19 @@ public class TestController extends WebBaseController { ...@@ -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 * @param param
......
...@@ -88,6 +88,8 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -88,6 +88,8 @@ public class WxEnterpriseInfoController extends WebBaseController {
private EnterpriseService enterpriseService; private EnterpriseService enterpriseService;
@Autowired @Autowired
private Config config; private Config config;
@Autowired
private WxApplicationApiService wxApplicationApiService;
/** /**
...@@ -256,10 +258,9 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -256,10 +258,9 @@ public class WxEnterpriseInfoController extends WebBaseController {
} }
enterpriseDetailDTO = wxEnterpriseDTOS.get(0); enterpriseDetailDTO = wxEnterpriseDTOS.get(0);
} }
WxEnterpriseDTO enterpriseDTO = wxEnterpriseApiService.getOne(enterpriseDetailDTO.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseApiService.getOne(enterpriseDetailDTO.getWxEnterpriseId());
if (enterpriseDTO == null) { if (enterpriseDTO == null) {
logger.info("企业不存在:{}", qo.getGicEnterpriseId()); logger.info("企业不存在:{}", qo.getGicEnterpriseId());
return resultResponse(HaoBanErrCode.ERR_400002); return resultResponse(HaoBanErrCode.ERR_400002);
} }
MemberLoginQo user = new MemberLoginQo(); MemberLoginQo user = new MemberLoginQo();
...@@ -268,10 +269,19 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -268,10 +269,19 @@ public class WxEnterpriseInfoController extends WebBaseController {
if (user == null) { if (user == null) {
return resultResponse(HaoBanErrCode.ERR_6); 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 { } else {
user.setUserId(qo.getUserId()); user.setUserId(qo.getUserId());
} }
user.setCorpId(enterpriseDTO.getCorpid());
StaffDTO staffDTO = staffApiService.selectByUserIdAndEnterpriseId(user.getUserId(), enterpriseDTO.getWxEnterpriseId()); StaffDTO staffDTO = staffApiService.selectByUserIdAndEnterpriseId(user.getUserId(), enterpriseDTO.getWxEnterpriseId());
if (staffDTO == null) { if (staffDTO == null) {
logger.info("成员不存在"); logger.info("成员不存在");
......
...@@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.Map;
/** /**
* Created 2018/7/20. * Created 2018/7/20.
...@@ -48,6 +49,11 @@ public class MobileWebInterceptor extends HandlerInterceptorAdapter { ...@@ -48,6 +49,11 @@ public class MobileWebInterceptor extends HandlerInterceptorAdapter {
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception { public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
String requestURI = httpServletRequest.getRequestURI(); String requestURI = httpServletRequest.getRequestURI();
logger.info("post-url:{}", requestURI); 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; HandlerMethod handler = (HandlerMethod) o;
IgnoreLogin ignoreLogin = handler.getMethodAnnotation(IgnoreLogin.class); IgnoreLogin ignoreLogin = handler.getMethodAnnotation(IgnoreLogin.class);
if (null != ignoreLogin) { if (null != ignoreLogin) {
......
...@@ -64,14 +64,16 @@ ...@@ -64,14 +64,16 @@
id="memberOpenCardBusinessService"/> id="memberOpenCardBusinessService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.StaffClerkRelationApiService" id="staffClerkRelationApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.StaffClerkRelationApiService" id="staffClerkRelationApiService"/>
<dubbo:reference interface="com.gic.clerk.api.service.ClerkNewService" id="clerkNewService"/> <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" <dubbo:reference interface="com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService"
id="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"/> retries="0" check="false"/>
<dubbo:reference id="pendingTaskApiService" <dubbo:reference id="pendingTaskApiService"
...@@ -82,4 +84,7 @@ ...@@ -82,4 +84,7 @@
interface="com.gic.haoban.manage.api.service.notify.NoticeMessageApiService" timeout="10000" interface="com.gic.haoban.manage.api.service.notify.NoticeMessageApiService" timeout="10000"
retries="0" check="false"/> retries="0" check="false"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.WxApplicationApiService"
id="wxApplicationApiService"/>
</beans> </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