Commit b3beb659 by huangZW

待完善接口

parent 3614db44
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class MemberStoreDTO implements Serializable {
private String memberId;
private String storeId;
private static final long serialVersionUID = 1L;
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
}
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.service;
import java.util.List;
import com.gic.haoban.manage.api.dto.MemberStoreDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
public interface MemberUnionidRelatedApiService {
......@@ -15,5 +16,7 @@ public interface MemberUnionidRelatedApiService {
MemberUnionidRelatedDTO getByMemberId(String staffId, String memberId);
List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId);
List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId);
}
......@@ -28,4 +28,6 @@ public interface MemberUnionidRelatedMapper {
MemberUnionidRelated getByParams(@Param("wxUserId")String wxUserId, @Param("wxEnterpriseId")String wxEnterpriseId,
@Param("externalName")String name, @Param("addCreateTime")String createTime);
List<MemberUnionidRelated> listByExTernalUseridAndWxUserId(@Param("externalUserid")String externalUserid, @Param("wxUserId")String wxUserId);
}
\ No newline at end of file
......@@ -43,5 +43,7 @@ public interface StaffDepartmentRelatedMapper {
List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(@Param("departmentId")String departmentId, @Param("keyword")String keyword);
int countByDepartmentIds(@Param("departmentIds")List<String> departmentIds);
List<TabHaobanStaffDepartmentRelated> listByWxUserId(@Param("wxUserId")String wxUserId);
}
\ No newline at end of file
......@@ -25,4 +25,7 @@ public interface StaffDepartmentRelatedService {
int countByDepartmentId(String departmentId);
List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(String departmentId, String keyword);
List<TabHaobanStaffDepartmentRelated> listByWxUserId(String wxUserId);
}
......@@ -20,7 +20,12 @@ public class StaffDepartmentRelatedServiceImpl implements StaffDepartmentRelated
@Autowired
private StaffDepartmentRelatedMapper mapper;
@Override
public List<TabHaobanStaffDepartmentRelated> listByWxUserId(String wxUserId){
List<TabHaobanStaffDepartmentRelated> list = mapper.listByWxUserId(wxUserId);
return list;
}
@Override
public List<TabHaobanStaffDepartmentRelated> listByDepartmentId(String departmentId) {
......
package com.gic.haoban.manage.service.service.out.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -8,6 +10,7 @@ import com.gic.wechat.api.service.qywx.QywxUserApiService;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -21,16 +24,21 @@ import com.gic.commons.util.MD5Utils;
import com.gic.commons.util.Md5Util;
import com.gic.commons.util.StringUtil;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.MemberStoreDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper;
import com.gic.haoban.manage.service.entity.MemberUnionidRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import com.gic.haoban.manage.service.service.MemberUnionRelatedService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
......@@ -71,7 +79,42 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
@Autowired
private DepartmentApiService departmentApiService;
@Autowired
private MemberUnionidRelatedMapper memberUnionidRelatedMapper;
@Autowired
private StaffDepartmentRelatedService staffDepartmentRelatedService;
@Override
public List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId) {
List<MemberUnionidRelated> list = memberUnionidRelatedMapper.listByExTernalUseridAndWxUserId(externalUserid, wxUserId);
if(CollectionUtil.isEmpty(list)){
return null;
}
//TODO 待完善
for(MemberUnionidRelated tab : list){
String memberId = tab.getMemberId();
if(StringUtils.isEmpty(memberId)){
continue ;
}
memberService.getMember(memberId);
//查该staff的门店id
List<TabHaobanStaffDepartmentRelated> relatedIds = staffDepartmentRelatedService.listByWxUserId(wxUserId);
if(CollectionUtil.isEmpty(relatedIds)){
break;
}
List<String> departmentIds = relatedIds.stream().map(s->s.getDepartmentId()).collect(Collectors.toList());
if(CollectionUtil.isEmpty(departmentIds)){
break;
}
List<DepartmentDTO> stores = departmentApiService.listByDepartmentIds(departmentIds, 1);
if(CollectionUtil.isEmpty(stores)){
break;
}
List<String> storeIds = stores.stream().map(s->s.getRelatedId()).collect(Collectors.toList());
return null;
}
return null;
}
@Override
public MemberUnionidRelatedDTO getByUnionId(String staffId, String unionid) {
TabHaobanStaff staff = staffService.selectById(staffId);
......
......@@ -28,6 +28,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
private StaffDepartmentRelatedService staffDepartmentRelatedService;
@Autowired
private StaffDepartmentRelatedMapper staffDepartmentRelatedMapper;
@Override
public List<StaffDepartmentRelatedDTO> listByDepartmentId(
String departmentId) {
......
......@@ -198,6 +198,14 @@
and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
</select>
<select id="listByExTernalUseridAndWxUserId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag = 1
and external_userid = #{externalUserid}
</select>
<select id="getByParams" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
......
......@@ -232,6 +232,14 @@
limit 1
</select>
<select id="listByWxUserId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_department_related
where wx_user_id = #{wxUserId}
and status_flag = 1
</select>
<select id="countByDepartmentId" resultType="java.lang.Integer" parameterType="java.lang.String" >
select
......
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