Commit 810e9826 by 墨竹

feat:解绑废弃活码

parent edd57cfd
......@@ -49,7 +49,7 @@ public interface StaffClerkRelationApiService {
* @param clerkCode
* @return
*/
String delByStoreIdAndCode(String storeId, String clerkCode);
void delByStoreIdAndCode(String storeId, String clerkCode);
StaffClerkRelationDTO getOneByClerkId(String clerkId);
......
......@@ -62,4 +62,15 @@ public interface HmQrcodeApiService {
* @date 2022-07-06 13:40:27
*/
boolean delById(Long hmId);
/**
* 导购解绑作废
*
* @param clerkId
* @param enterpriseId 企业标识
* @return boolean
* @author mozhu
* @date 2022-07-06 15:39:01
*/
boolean delByClerkId(String clerkId,String enterpriseId);
}
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.dao.mapper.hm;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.service.entity.hm.TabHaobanHmQrcode;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -73,5 +74,15 @@ public interface TabHaobanHmQrcodeMapper {
*/
int updateStatusById(@Param("statusFlag") Integer statusFlag, @Param("hmId")Long hmId);
/**
* 通过职员id列表
*
* @param clerkId 职员id
* @param enterpriseId 企业标识
* @return {@link List }<{@link HmQrcodeBO }>
* @author mozhu
* @date 2022-07-06 15:36:20
*/
List<HmQrcodeBO> listByClerkId(@Param("clerkId") String clerkId, @Param("enterpriseId") String enterpriseId);
}
......@@ -5,6 +5,8 @@ import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import java.util.List;
/**
* 活码(TabHaobanHmQrcode)表服务接口
......@@ -54,4 +56,15 @@ public interface TabHaobanHmQrcodeService {
*/
boolean deleteById(Long hmId);
/**
* 查询根据导购和企业id查询数据
*
* @param clerkId 职员id
* @param enterpriseId 企业标识
* @return {@link List }<{@link HmQrcodeBO }>
* @author mozhu
* @date 2022-07-06 15:35:40
*/
List<HmQrcodeBO> listByClerkId(String clerkId,String enterpriseId);
}
......@@ -67,4 +67,9 @@ public class TabHaobanHmQrcodeServiceImpl implements TabHaobanHmQrcodeService {
public boolean deleteById(Long hmId) {
return this.tabHaobanHmQrcodeMapper.updateStatusById(2,hmId) > 0;
}
@Override
public List<HmQrcodeBO> listByClerkId(String clerkId, String enterpriseId) {
return tabHaobanHmQrcodeMapper.listByClerkId(clerkId,enterpriseId);
}
}
......@@ -1090,11 +1090,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
memberUnionRelatedService.delMemberUnionidRelated(dto);
}
/**
* 删除好友
*
* @param dto
*/
private void editMemberUnionidRelatedProcess(MemberUnionidRelatedDTO dto) {
log.info("修改标签/会员信息回调:{}", JSONObject.toJSONString(dto));
TabHaobanWxEnterprise wxEnterprise = wxEnterpriseService.getEnterpriseBycorpId(dto.getCorpid());
......
......@@ -19,6 +19,7 @@ import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.entity.MemberClerkChatConfig;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
......@@ -68,6 +69,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
private SecretSettingService secretSettingService;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Autowired
private HmQrcodeApiService hmQrcodeApiService;
@Override
public void bindLogMq(String params) {
......@@ -222,11 +225,12 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public String delByStoreIdAndCode(String storeId, String clerkCode) {
public void delByStoreIdAndCode(String storeId, String clerkCode) {
TabHaobanStaffClerkRelation staffClerkRelation = tabHaobanStaffClerkRelationMapper.getByCodeAndStoreId(clerkCode, storeId);
//删除绑定关系
tabHaobanStaffClerkRelationMapper.delByStoreIdAndCode(storeId, clerkCode);
//删除主门店
delSetMainStore(staffClerkRelation);
return null;
}
@Override
......@@ -382,9 +386,12 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
String staffId = staffClerkRelation.getStaffId();
String wxEnterpriseId = staffClerkRelation.getWxEnterpriseId();
externalClerkRelatedService.delByClerkIdAndStaffId(staffClerkRelation.getClerkId(), staffId);
String clerkId = staffClerkRelation.getClerkId();
externalClerkRelatedService.delByClerkIdAndStaffId(clerkId, staffId);
//删除主门店
clerkMainStoreRelatedService.delMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId);
//废弃活码
hmQrcodeApiService.delByClerkId(clerkId,staffClerkRelation.getEnterpriseId());
}
@Override
......
......@@ -23,6 +23,7 @@ import com.gic.haoban.manage.service.service.hm.TabHaobanHmQrcodeService;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -178,4 +179,18 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
return true;
}
@Override
public boolean delByClerkId(String clerkId, String enterpriseId) {
List<HmQrcodeBO> hmQrcodeBOS = hmQrcodeService.listByClerkId(clerkId, enterpriseId);
if (CollectionUtils.isEmpty(hmQrcodeBOS)) {
logger.error("无活码:clerkId:{}",clerkId);
return false;
}
for (HmQrcodeBO hmQrcodeBO : hmQrcodeBOS) {
delById(hmQrcodeBO.getHmId());
}
return true;
}
}
......@@ -36,35 +36,7 @@
<!--查询单个-->
<select id="queryById" resultMap="TabHaobanHmQrcodeMap">
select hm_id,
hm_code,
hm_type,
wx_enterprise_id,
enterprise_id,
name,
creator_id,
creator_name,
modifier_id,
modifier_name,
create_time,
update_time,
member_label_id,
pass_flag,
welcome_id,
status_flag,
add_num,
over_flag,
wx_config_id,
wx_qrcode,
wx_user_id,
store_id,
store_name,
store_code,
clerk_id,
clerk_name,
clerk_code,
hm_user_num,
hm_group_id
select *
from tab_haoban_hm_qrcode
where hm_id = #{hmId}
</select>
......@@ -125,12 +97,13 @@
<!--新增所有列-->
<insert id="insert" keyProperty="hmId" useGeneratedKeys="true">
insert into tab_haoban_hm_qrcode(hm_id,hm_code, hm_type, wx_enterprise_id, enterprise_id, name, creator_id,
insert into tab_haoban_hm_qrcode(hm_id, hm_code, hm_type, wx_enterprise_id, enterprise_id, name, creator_id,
creator_name, modifier_id, modifier_name, create_time, update_time,
member_label_id, pass_flag, welcome_id, status_flag, add_num, over_flag,
wx_config_id, wx_qrcode, wx_user_id, store_id, store_name, store_code,
clerk_id, clerk_name, clerk_code, hm_user_num, hm_group_id)
values (#{hmId},#{hmCode}, #{hmType}, #{wxEnterpriseId}, #{enterpriseId}, #{name}, #{creatorId}, #{creatorName},
values (#{hmId}, #{hmCode}, #{hmType}, #{wxEnterpriseId}, #{enterpriseId}, #{name}, #{creatorId},
#{creatorName},
#{modifierId}, #{modifierName}, #{createTime}, #{updateTime}, #{memberLabelId}, #{passFlag},
#{welcomeId}, #{statusFlag}, #{addNum}, #{overFlag}, #{wxConfigId}, #{wxQrcode}, #{wxUserId},
#{storeId}, #{storeName}, #{storeCode}, #{clerkId}, #{clerkName}, #{clerkCode}, #{hmUserNum},
......@@ -144,7 +117,8 @@
clerk_id, clerk_name, clerk_code, hm_user_num, hm_group_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.hmId},#{entity.hmCode}, #{entity.hmType}, #{entity.wxEnterpriseId}, #{entity.enterpriseId}, #{entity.name},
(#{entity.hmId},#{entity.hmCode}, #{entity.hmType}, #{entity.wxEnterpriseId}, #{entity.enterpriseId},
#{entity.name},
#{entity.creatorId}, #{entity.creatorName}, #{entity.modifierId}, #{entity.modifierName},
#{entity.createTime}, #{entity.updateTime}, #{entity.memberLabelId}, #{entity.passFlag},
#{entity.welcomeId}, #{entity.statusFlag}, #{entity.addNum}, #{entity.overFlag}, #{entity.wxConfigId},
......@@ -262,5 +236,11 @@
</set>
where hm_id = #{hmId}
</update>
<select id="listByClerkId" resultMap="TabHaobanHmQrcodeMap">
select *
from tab_haoban_hm_qrcode
where enterprise_id = #{enterpriseId} and clerk_id = #{clerkId} and status_flag in (1,3)
</select>
</mapper>
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