Commit 1228cdeb by 徐高华

关联状态

parent ccccabe4
......@@ -102,6 +102,15 @@ public class StaffDTO implements Serializable {
private Integer activeStatus;
private String enterpriseId;
private String storeId;
private int openConcatFlag = 0 ;
public int getOpenConcatFlag() {
return openConcatFlag;
}
public void setOpenConcatFlag(int openConcatFlag) {
this.openConcatFlag = openConcatFlag;
}
public String getDefaultGicEid() {
return defaultGicEid;
......
......@@ -57,6 +57,16 @@ public class GroupChatDTO implements Serializable{
private String staffImage ;
private String originalStaffId ;
private Date offTime ;
// 1已关联导购 0未关联导购
private int clerkRelationFlag = 0 ;
public int getClerkRelationFlag() {
return clerkRelationFlag;
}
public void setClerkRelationFlag(int clerkRelationFlag) {
this.clerkRelationFlag = clerkRelationFlag;
}
public String getStaffImage() {
return staffImage;
......
......@@ -6,6 +6,7 @@ import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
public interface StaffMapper {
......@@ -144,4 +145,6 @@ public interface StaffMapper {
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;
import com.github.pagehelper.Page;
import java.util.List;
import java.util.Set;
public interface StaffService {
......@@ -141,4 +142,6 @@ public interface StaffService {
* @date 2022-08-04 15:39:54
*/
int updateActiveStatusById(Integer activeStatus,String staffId);
void updateOpenConcatFlag(Set<String> staffIdList);
}
package com.gic.haoban.manage.service.service.impl;
import java.util.Date;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -149,4 +150,9 @@ public class StaffServiceImpl implements StaffService {
public int updateActiveStatusById(Integer activeStatus, String 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;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -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.TabHaobanWxEnterpriseRelated;
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.WxEnterpriseRelatedService;
import com.gic.haoban.manage.service.service.chat.GroupChatService;
......@@ -45,11 +48,21 @@ public class GroupChatApiServiceImpl implements GroupChatApiService {
private StaffService staffService;
@Autowired
private WxEnterpriseRelatedService wxEnterpriseRelatedService;
@Autowired
private StaffClerkRelationService staffClerkRelationService ;
@Override
public ServiceResponse<Page<GroupChatDTO>> listPage(GroupChatSearchQDTO qdto, BasePageInfo basePageInfo) {
Page<GroupChatBO> page = this.groupChatService.listPage(qdto, basePageInfo);
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);
}
......
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.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
......@@ -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.service.config.Config;
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.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StaffService;
......@@ -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.QywxExternalcontactResultDTO;
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 java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import cn.hutool.core.convert.Convert;
/**
* @author mozhu
......@@ -816,6 +823,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logger.error("无导购关联数据");
return;
}
Set<String> staffIdList = staffClerkRelationDTOS.stream().map(dto->dto.getStaffId()).collect(Collectors.toSet()) ;
this.staffService.updateOpenConcatFlag(staffIdList) ;
for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) {
//具有联系我功能的导购创建活码
staffClerkRelationService.updateOpenConcatFlagById(1, staffClerkRelationDTO.getStaffClerkRelationId());
......
......@@ -25,13 +25,14 @@
<result column="qr_code" property="qrCode" jdbcType="VARCHAR"/>
<result column="add_num" property="addNum" jdbcType="INTEGER"/>
<result column="active_status" property="activeStatus" jdbcType="INTEGER"/>
<result column="open_concat_flag" property="openConcatFlag"/>
</resultMap>
<sql id="Base_Column_List">
staff_id
, 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,
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>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
......@@ -522,4 +523,11 @@
limit ${startItem},${pageSize}
</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>
\ No newline at end of file
......@@ -148,7 +148,7 @@ public class StaffController extends WebBaseController {
Integer activeFlag,
Integer relationFlag,
String keyWord,
BasePageInfo pageInfo) {
BasePageInfo pageInfo , String departmentIdList) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
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