Commit 1228cdeb by 徐高华

关联状态

parent ccccabe4
...@@ -102,6 +102,15 @@ public class StaffDTO implements Serializable { ...@@ -102,6 +102,15 @@ public class StaffDTO implements Serializable {
private Integer activeStatus; private Integer activeStatus;
private String enterpriseId; private String enterpriseId;
private String storeId; private String storeId;
private int openConcatFlag = 0 ;
public int getOpenConcatFlag() {
return openConcatFlag;
}
public void setOpenConcatFlag(int openConcatFlag) {
this.openConcatFlag = openConcatFlag;
}
public String getDefaultGicEid() { public String getDefaultGicEid() {
return defaultGicEid; return defaultGicEid;
......
...@@ -57,8 +57,18 @@ public class GroupChatDTO implements Serializable{ ...@@ -57,8 +57,18 @@ public class GroupChatDTO implements Serializable{
private String staffImage ; private String staffImage ;
private String originalStaffId ; private String originalStaffId ;
private Date offTime ; private Date offTime ;
// 1已关联导购 0未关联导购
private int clerkRelationFlag = 0 ;
public String getStaffImage() { public int getClerkRelationFlag() {
return clerkRelationFlag;
}
public void setClerkRelationFlag(int clerkRelationFlag) {
this.clerkRelationFlag = clerkRelationFlag;
}
public String getStaffImage() {
return staffImage; return staffImage;
} }
......
...@@ -6,6 +6,7 @@ import com.github.pagehelper.Page; ...@@ -6,6 +6,7 @@ import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Set;
public interface StaffMapper { public interface StaffMapper {
...@@ -143,5 +144,7 @@ public interface StaffMapper { ...@@ -143,5 +144,7 @@ public interface StaffMapper {
List<TabHaobanStaff> listAllByPage(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("startItem") int startItem , @Param("pageSize") int pageSize); List<TabHaobanStaff> listAllByPage(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("startItem") int startItem , @Param("pageSize") int pageSize);
void updateOpenConcatFlag(@Param("staffIdList")Set<String> staffIdList);
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff; ...@@ -7,6 +7,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import java.util.List; import java.util.List;
import java.util.Set;
public interface StaffService { public interface StaffService {
...@@ -141,4 +142,6 @@ public interface StaffService { ...@@ -141,4 +142,6 @@ public interface StaffService {
* @date 2022-08-04 15:39:54 * @date 2022-08-04 15:39:54
*/ */
int updateActiveStatusById(Integer activeStatus,String staffId); int updateActiveStatusById(Integer activeStatus,String staffId);
void updateOpenConcatFlag(Set<String> staffIdList);
} }
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -149,4 +150,9 @@ public class StaffServiceImpl implements StaffService { ...@@ -149,4 +150,9 @@ public class StaffServiceImpl implements StaffService {
public int updateActiveStatusById(Integer activeStatus, String staffId) { public int updateActiveStatusById(Integer activeStatus, String staffId) {
return mapper.updateActiveStatusById(activeStatus,staffId); return mapper.updateActiveStatusById(activeStatus,staffId);
} }
@Override
public void updateOpenConcatFlag(Set<String> staffIdList) {
this.mapper.updateOpenConcatFlag(staffIdList);
}
} }
package com.gic.haoban.manage.service.service.out.impl.chat; package com.gic.haoban.manage.service.service.out.impl.chat;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -27,6 +29,7 @@ import com.gic.haoban.manage.api.service.chat.GroupChatApiService; ...@@ -27,6 +29,7 @@ import com.gic.haoban.manage.api.service.chat.GroupChatApiService;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import com.gic.haoban.manage.service.pojo.bo.chat.GroupChatBO; import com.gic.haoban.manage.service.pojo.bo.chat.GroupChatBO;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StaffService; import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService; import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import com.gic.haoban.manage.service.service.chat.GroupChatService; import com.gic.haoban.manage.service.service.chat.GroupChatService;
...@@ -45,11 +48,21 @@ public class GroupChatApiServiceImpl implements GroupChatApiService { ...@@ -45,11 +48,21 @@ public class GroupChatApiServiceImpl implements GroupChatApiService {
private StaffService staffService; private StaffService staffService;
@Autowired @Autowired
private WxEnterpriseRelatedService wxEnterpriseRelatedService; private WxEnterpriseRelatedService wxEnterpriseRelatedService;
@Autowired
private StaffClerkRelationService staffClerkRelationService ;
@Override @Override
public ServiceResponse<Page<GroupChatDTO>> listPage(GroupChatSearchQDTO qdto, BasePageInfo basePageInfo) { public ServiceResponse<Page<GroupChatDTO>> listPage(GroupChatSearchQDTO qdto, BasePageInfo basePageInfo) {
Page<GroupChatBO> page = this.groupChatService.listPage(qdto, basePageInfo); Page<GroupChatBO> page = this.groupChatService.listPage(qdto, basePageInfo);
Page<GroupChatDTO> resultPage = PageHelperUtils.changePageToCurrentPage(page, GroupChatDTO.class); Page<GroupChatDTO> resultPage = PageHelperUtils.changePageToCurrentPage(page, GroupChatDTO.class);
List<GroupChatDTO> dtoList = resultPage.getResult() ;
if(CollectionUtils.isNotEmpty(dtoList)) {
List<String> staffIdList = dtoList.stream().filter(dto->StringUtils.isNotBlank(dto.getStaffId())).map(dto->dto.getStaffId()).collect(Collectors.toList()) ;
List<String> relationIdList = this.staffClerkRelationService.listRelationsStaffId(new HashSet<>(staffIdList));
dtoList.forEach(one -> {
one.setClerkRelationFlag(relationIdList.contains(one.getStaffId()) ? 1 : 0);
});
}
return ServiceResponse.success(resultPage); return ServiceResponse.success(resultPage);
} }
......
package com.gic.haoban.manage.service.service.out.impl.hm; package com.gic.haoban.manage.service.service.out.impl.hm;
import cn.hutool.core.convert.Convert; import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
...@@ -29,7 +44,11 @@ import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType; ...@@ -29,7 +44,11 @@ import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService; import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.pojo.bo.hm.*; import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmGroupSettingBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeClerkBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO; import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO;
import com.gic.haoban.manage.service.service.StaffClerkRelationService; import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StaffService; import com.gic.haoban.manage.service.service.StaffService;
...@@ -54,20 +73,8 @@ import com.gic.wechat.api.dto.qywx.response.QywxResponseDTO; ...@@ -54,20 +73,8 @@ import com.gic.wechat.api.dto.qywx.response.QywxResponseDTO;
import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactDTO; import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactDTO;
import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactResultDTO; import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactResultDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import cn.hutool.core.convert.Convert;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/** /**
* @author mozhu * @author mozhu
...@@ -816,6 +823,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -816,6 +823,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logger.error("无导购关联数据"); logger.error("无导购关联数据");
return; return;
} }
Set<String> staffIdList = staffClerkRelationDTOS.stream().map(dto->dto.getStaffId()).collect(Collectors.toSet()) ;
this.staffService.updateOpenConcatFlag(staffIdList) ;
for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) { for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) {
//具有联系我功能的导购创建活码 //具有联系我功能的导购创建活码
staffClerkRelationService.updateOpenConcatFlagById(1, staffClerkRelationDTO.getStaffClerkRelationId()); staffClerkRelationService.updateOpenConcatFlagById(1, staffClerkRelationDTO.getStaffClerkRelationId());
......
...@@ -25,13 +25,14 @@ ...@@ -25,13 +25,14 @@
<result column="qr_code" property="qrCode" jdbcType="VARCHAR"/> <result column="qr_code" property="qrCode" jdbcType="VARCHAR"/>
<result column="add_num" property="addNum" jdbcType="INTEGER"/> <result column="add_num" property="addNum" jdbcType="INTEGER"/>
<result column="active_status" property="activeStatus" jdbcType="INTEGER"/> <result column="active_status" property="activeStatus" jdbcType="INTEGER"/>
<result column="open_concat_flag" property="openConcatFlag"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
staff_id staff_id
, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion, , wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img, active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img,
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num,active_status sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num,active_status,open_concat_flag
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
...@@ -521,5 +522,12 @@ ...@@ -521,5 +522,12 @@
select <include refid="Base_Column_List" /> from tab_haoban_staff where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1 order by staff_id select <include refid="Base_Column_List" /> from tab_haoban_staff where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1 order by staff_id
limit ${startItem},${pageSize} limit ${startItem},${pageSize}
</select> </select>
<update id="updateOpenConcatFlag">
update tab_haoban_staff set open_concat_flag = 1 where staff_id in
<foreach collection="staffIdList" index="index" item="id" close=")" open="(" separator=",">
#{id}
</foreach>
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -148,7 +148,7 @@ public class StaffController extends WebBaseController { ...@@ -148,7 +148,7 @@ public class StaffController extends WebBaseController {
Integer activeFlag, Integer activeFlag,
Integer relationFlag, Integer relationFlag,
String keyWord, String keyWord,
BasePageInfo pageInfo) { BasePageInfo pageInfo , String departmentIdList) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
List<String> departmentIds = new ArrayList<>(); List<String> departmentIds = new ArrayList<>();
......
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