Commit 77130216 by qwmqiuwenmin

Merge branch 'developer' into 'master'

Developer

See merge request !7
parents bbc86588 252adb44
package com.gic.haoban.manage.api.service;
import java.util.List;
import java.util.Set;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.QywxCorpInfoSimpleDTO;
......@@ -35,4 +36,6 @@ public interface WxEnterpriseApiService {
void update(WxEnterpriseDTO enterpriseDTO);
List<YwWxEnterpriseDTO> listAll();
List<YwWxEnterpriseDTO> listByIds(Set<String> enterpriseIds);
}
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;
......@@ -28,4 +29,8 @@ public interface WxEnterpriseMapper {
List<TabHaobanWxEnterprise> listDelBycorpId(@Param("corpId") String corpId);
List<TabHaobanWxEnterprise> listAll();
List<TabHaobanWxEnterprise> listByIds(@Param("enterpriseIds")Set<String> enterpriseIds);
List<TabHaobanWxEnterprise> getEnterpriseBycorpIdNoStatus(@Param("corpId")String corpId);
}
\ No newline at end of file
......@@ -26,4 +26,6 @@ public interface WxEnterpriseService {
void update(WxEnterpriseDTO enterpriseDTO);
int delete(String wxEnterpriseId);
TabHaobanWxEnterprise getEnterpriseBycorpIdNoStatus(String corpid);
}
......@@ -69,4 +69,13 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
return this.mapper.updateByPrimaryKeySelective(enterprise);
}
@Override
public TabHaobanWxEnterprise getEnterpriseBycorpIdNoStatus(String corpId) {
List<TabHaobanWxEnterprise> list = this.mapper.getEnterpriseBycorpIdNoStatus(corpId);
if(CollectionUtils.isNotEmpty(list)){
return list.get(0);
}
return null;
}
}
......@@ -72,6 +72,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
unionId = jo.getString("unionid");
}
if(StringUtils.isBlank(unionId)){
return "";
}
MemberDTO member = null;
for (TabHaobanWxEnterpriseRelated tabHaobanWxEnterpriseRelated : list) {
member = memberService.getMemberByUnionid(unionId, tabHaobanWxEnterpriseRelated.getEnterpriseId());
......@@ -84,7 +88,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
dto.setWxEnterpriseId(wxEnterprise.getWxEnterpriseId());
dto.setUnionid(unionId);
this.getExternalUserUnionid(dto);
//this.getExternalUserUnionid(dto);
return memberUnionRelatedService.addMemberUnionidRelated(dto);
}
@Override
......
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.service.out.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import com.alibaba.fastjson.JSON;
import com.gic.haoban.base.api.common.BasePageInfo;
......@@ -55,7 +56,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
public void callbackReviceEnterprise(QywxCorpInfoSimpleDTO dto) {
log.info("企业微信授权信息:{}", JSON.toJSONString(dto));
WxEnterpriseDTO wxDTO = EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, dto);
TabHaobanWxEnterprise enterprise = this.wxEnterpriseService.getDelEnterpriseBycorpId(dto.getCorpid());
TabHaobanWxEnterprise enterprise = this.wxEnterpriseService.getEnterpriseBycorpIdNoStatus(dto.getCorpid());
String wxEnterpriseId = "";
if(enterprise != null){
wxEnterpriseId = enterprise.getWxEnterpriseId();
......@@ -104,6 +105,12 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
List<TabHaobanWxEnterprise> list = wxEnterpriseMapper.listAll();
return EntityUtil.changeEntityListByJSON(YwWxEnterpriseDTO.class, list);
}
@Override
public List<YwWxEnterpriseDTO> listByIds(Set<String> enterpriseIds) {
List<TabHaobanWxEnterprise> list = wxEnterpriseMapper.listByIds(enterpriseIds);
return EntityUtil.changeEntityListByJSON(YwWxEnterpriseDTO.class, list);
}
@Override
public WxEnterpriseDTO getOne(String wxEnterpriseId) {
......
......@@ -395,4 +395,23 @@
where status_flag = 1
</select>
<select id="listByIds" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_wx_enterprise
where status_flag = 1
<if test="enterpriseIds != null and enterpriseIds.size() > 0">
and wx_enterprise_id IN
<foreach collection="enterpriseIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
<select id="getEnterpriseBycorpIdNoStatus" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_wx_enterprise
where corpid= #{corpId}
</select>
</mapper>
\ No newline at end of file
......@@ -63,6 +63,7 @@ public class LoginController extends WebBaseController{
String corpId = user.getCorpid();
logger.info("【企业微信登录】userId={},auth_code={},corpId={}",user.getUserid(),auth_code,corpId);
WxEnterpriseDTO enterprise = wxEnterpriseApiService.getEnterpriseBycorpId(corpId);
logger.info("【企业微信】enterprise={}",JSON.toJSONString(enterprise));
StaffDTO loginStaff = null;
if(enterprise != null){
loginStaff = staffApiService.selectByUserIdAndEnterpriseId(user.getUserid(),enterprise.getWxEnterpriseId());
......
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