Commit d827d514 by 徐高华

运维

parent 253b5c86
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class YwWxEnterpriseDTO implements Serializable {
......@@ -41,6 +42,15 @@ public class YwWxEnterpriseDTO implements Serializable {
*/
private Boolean openMassFlag;
private List<EnterpriseDetailDTO> enList ;
public List<EnterpriseDetailDTO> getEnList() {
return enList;
}
public void setEnList(List<EnterpriseDetailDTO> enList) {
this.enList = enList;
}
public static long getSerialversionuid() {
return serialVersionUID;
......
......@@ -19,6 +19,8 @@ public interface WxEnterpriseRelatedApiService {
List<EnterpriseDetailDTO> listEnterpriseByWxEnterpriseId(String wxEnterpriseId);
List<EnterpriseDetailDTO> listEnterpriseByWxEnterpriseIdList(List<String> wxEnterpriseIdList);
List<EnterpriseDetailDTO> listEnterpriseByWxEnterpriseId(String wxEnterpriseId , String phoneNumber);
String getGicEnterpriseIdByEnterpriseRelatedId(String wxEnterpriseRelatedId);
......
......@@ -29,6 +29,8 @@ import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -137,7 +139,16 @@ public class EnterpriseController extends WebBaseController {
}
doProcessOpenSendMass(page.getResult());
if(CollectionUtils.isNotEmpty(page.getResult())) {
List<String> idList = page.getResult().stream().map(dto->dto.getWxEnterpriseId()).collect(Collectors.toList()) ;
List<EnterpriseDetailDTO> enList = this.wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseIdList(idList);
if(CollectionUtils.isNotEmpty(enList)) {
Map<String, List<EnterpriseDetailDTO>> map = enList.stream().collect(Collectors.groupingBy(EnterpriseDetailDTO::getWxEnterpriseId)) ;
for(YwWxEnterpriseDTO item : page.getResult()) {
item.setEnList(map.get(item.getWxEnterpriseId()));
}
}
}
pageResult.setList(page.getResult());
pageResult.setPageNum(page.getCurrentPage());
pageResult.setPages(page.getPages());
......
......@@ -21,6 +21,8 @@ public interface WxEnterpriseRelatedMapper {
List<TabHaobanWxEnterpriseRelated> listByWxenterpriseId(String wxEnterpriseId);
List<TabHaobanWxEnterpriseRelated> listByWxenterpriseIdList(@Param("wxEnterpriseIdList") List<String> wxEnterpriseIdList);
TabHaobanWxEnterpriseRelated findOneByEnterpriseId(String enterpriseId);
List<TabHaobanWxEnterpriseRelated> queryAllHasGicEnterpriseId();
......
......@@ -125,6 +125,23 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
}
@Override
public List<EnterpriseDetailDTO> listEnterpriseByWxEnterpriseIdList(List<String> wxEnterpriseIdList) {
List<TabHaobanWxEnterpriseRelated> relatedList = this.wxEnterpriseRelatedMapper.listByWxenterpriseIdList(wxEnterpriseIdList) ;
if(CollectionUtils.isNotEmpty(relatedList)) {
List<EnterpriseDetailDTO> list = EntityUtil.changeEntityListByJSON(EnterpriseDetailDTO.class, relatedList);
for(EnterpriseDetailDTO item : list) {
String enterpriseId = item.getEnterpriseId() ;
EnterpriseDTO en = this.enterpriseService.getEnterpriseById(enterpriseId) ;
if(null != en) {
item.setEnterpriseName(en.getBrandName());
}
}
return list ;
}
return null;
}
@Override
public List<EnterpriseDetailDTO> listEnterpriseByWxEnterpriseId(String wxEnterpriseId, String phoneNumber) {
logger.info("listEnterpriseByWxEnterpriseId,wxeid={},phone={}",wxEnterpriseId,phoneNumber);
List<TabHaobanWxEnterpriseRelated> relatedList = wxEnterpriseRelatedMapper.listByWxenterpriseId(wxEnterpriseId);
......
......@@ -178,6 +178,18 @@
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag = 1
</select>
<select id="listByWxenterpriseIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_haoban_wx_enterprise_related
where wx_enterprise_id in
<foreach collection="wxEnterpriseIdList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
and status_flag = 1
</select>
<select id="findOneByEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
......
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