Commit b36340bb by jinxin

活码删除

parent 45305950
...@@ -134,6 +134,17 @@ public interface TabHaobanHmQrcodeMapper { ...@@ -134,6 +134,17 @@ public interface TabHaobanHmQrcodeMapper {
@Param("hmType") Integer hmType); @Param("hmType") Integer hmType);
/** /**
*
* @param staffId
* @param wxEnterpriseId
* @param hmType
* @return
*/
List<Long> queryByStaffIdAndOverFlag(@Param("staffId") String staffId,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("hmType") Integer hmType);
/**
* 活码门店ids * 活码门店ids
* *
* @param enterpriseId 企业标识 * @param enterpriseId 企业标识
......
...@@ -210,4 +210,5 @@ public interface HmQrcodeService { ...@@ -210,4 +210,5 @@ public interface HmQrcodeService {
void updateClerkInfo(Long hmId,String newClerkId); void updateClerkInfo(Long hmId,String newClerkId);
String getClerkQrcode( String enterpriseId, String clerkId); String getClerkQrcode( String enterpriseId, String clerkId);
List<Long> queryByStaffIdAndOverFlag(String staffId, String wxEnterpriseId, Integer hmType);
} }
...@@ -226,4 +226,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService { ...@@ -226,4 +226,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
public String getClerkQrcode(String enterpriseId, String clerkId) { public String getClerkQrcode(String enterpriseId, String clerkId) {
return this.tabHaobanHmQrcodeMapper.getClerkQrcode(enterpriseId, clerkId); return this.tabHaobanHmQrcodeMapper.getClerkQrcode(enterpriseId, clerkId);
} }
@Override
public List<Long> queryByStaffIdAndOverFlag(String staffId, String wxEnterpriseId, Integer hmType) {
return this.tabHaobanHmQrcodeMapper.queryByStaffIdAndOverFlag(staffId,wxEnterpriseId,hmType);
}
} }
...@@ -10,6 +10,7 @@ import java.util.Map; ...@@ -10,6 +10,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.gic.commons.util.DateUtil;
import com.gic.haoban.manage.service.entity.*; import com.gic.haoban.manage.service.entity.*;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -519,6 +520,10 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -519,6 +520,10 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
delFlag = true ; delFlag = true ;
} }
} }
Date time = DateUtil.addDay(new Date(),-1);
if (delFlag && null != clerk && clerk.getUpdateTime().after(time)){
delFlag = false;
}
if(delFlag) { if(delFlag) {
this.mapper.delByClerkId(clerkId); this.mapper.delByClerkId(clerkId);
}else { }else {
...@@ -544,6 +549,10 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -544,6 +549,10 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
delFlag = true ; delFlag = true ;
} }
} }
Date time = DateUtil.addDay(new Date(),-1);
if (delFlag && null != clerk && clerk.getUpdateTime().after(time)){
delFlag = false;
}
if(delFlag) { if(delFlag) {
this.mapper.delByClerkId(clerkId); this.mapper.delByClerkId(clerkId);
dto = null ; dto = null ;
......
...@@ -12,8 +12,11 @@ import java.util.Set; ...@@ -12,8 +12,11 @@ import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import com.gic.business.order.dto.ordermanage.OrderInfoDTO; import com.gic.business.order.dto.ordermanage.OrderInfoDTO;
import com.gic.business.order.service.ordermanage.WebOrderManageApiService; import com.gic.business.order.service.ordermanage.WebOrderManageApiService;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -134,6 +137,10 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -134,6 +137,10 @@ public class MessageApiServiceImpl implements MessageApiService {
private MemberQueryService memberQueryService ; private MemberQueryService memberQueryService ;
@Autowired @Autowired
private WebOrderManageApiService webOrderManageApiService ; private WebOrderManageApiService webOrderManageApiService ;
@Autowired
private HmQrcodeService hmQrcodeService;
@Autowired
private HmQrcodeApiService hmQrcodeApiService;
@Override @Override
...@@ -387,6 +394,13 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -387,6 +394,13 @@ public class MessageApiServiceImpl implements MessageApiService {
this.groupChatService.ownerDimission(staffId); this.groupChatService.ownerDimission(staffId);
// 删除员工表-注意顺序 // 删除员工表-注意顺序
this.staffService.delByStaffId(staffId); this.staffService.delByStaffId(staffId);
//活码删除
List<Long> hmIdList = hmQrcodeService.queryByStaffIdAndOverFlag(staffId, wxEnterpriseId, 1);
if(CollUtil.isNotEmpty(hmIdList)){
for (Long hmId : hmIdList){
hmQrcodeApiService.delById(hmId,ChannelCodeEnum.ADMIN_UNBIND.getCode(),null);
}
}
} }
log.error("成员同步结束"); log.error("成员同步结束");
} }
......
...@@ -262,6 +262,19 @@ ...@@ -262,6 +262,19 @@
limit 1 limit 1
</select> </select>
<select id="queryByStaffIdAndOverFlag" resultType="Long">
select
hm_id as hmId
from tab_haoban_hm_qrcode
where staff_id = #{staffId} and status_flag = 1
<if test="null != wxEnterpriseId">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="hmType != null">
and hm_type = #{hmType}
</if>
</select>
<select id="getHmStoreByEnterpriseId" resultMap="TabHaobanHmQrcodeMap"> <select id="getHmStoreByEnterpriseId" resultMap="TabHaobanHmQrcodeMap">
select store_id storeId, select store_id storeId,
......
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