Commit 58e557a6 by fudahua

插入绑定日志

parent 5cdbb856
......@@ -42,4 +42,6 @@ public interface StaffMapper {
public int cleanStaff(@Param("wxEnterpriseId")String wxEnterpriseId,@Param("staffIds")List<String> staffIds);
TabHaobanStaff getWxStaffByOne(@Param("wxEnterpriseId")String wxEnterpriseId);
public List<String> listUserStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds);
}
\ No newline at end of file
......@@ -35,4 +35,12 @@ public interface StaffService {
TabHaobanStaff getWxStaffByOne( String wxEnterpriseId);
/**
* 获取需要删除的staff列表
* @param wxEnterpriseId
* @param staffIds
* @return
*/
public List<String> listDelUserStaffId(String wxEnterpriseId,List<String> staffIds);
}
......@@ -12,6 +12,7 @@ import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.service.ExternalClerkRelatedService;
import com.gic.haoban.manage.service.service.StaffClerkBindLogService;
import com.gic.haoban.manage.service.service.StaffService;
import javafx.scene.control.Tab;
import org.apache.commons.collections.CollectionUtils;
......@@ -41,6 +42,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Autowired
private ExternalClerkRelatedService externalClerkRelatedService;
@Autowired
private StaffService staffService;
@Override
public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) {
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, mapper.listBindCode(enterpriseId,clerkCodeList));
......@@ -115,7 +119,12 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
@Override
public int cleanStaffClerk(String wxEnterpriseId, List<String> staffIds) {
staffIds.forEach(staffId->{
List<String> delStaffIds = staffService.listDelUserStaffId(wxEnterpriseId, staffIds);
if (CollectionUtils.isEmpty(delStaffIds)) {
logger.info("没有要删除的成员:{}",wxEnterpriseId);
return 0;
}
delStaffIds.forEach(staffId->{
List<StaffClerkRelationDTO> relationDTOS = listBindCodeByStaffId(null, staffId);
if (CollectionUtils.isNotEmpty(relationDTOS)) {
relationDTOS.forEach(mid->{
......
......@@ -97,4 +97,9 @@ public class StaffServiceImpl implements StaffService {
public TabHaobanStaff getWxStaffByOne(String wxEnterpriseId) {
return mapper.getWxStaffByOne(wxEnterpriseId);
}
@Override
public List<String> listDelUserStaffId(String wxEnterpriseId, List<String> staffIds) {
return mapper.listUserStaffId(wxEnterpriseId,staffIds);
}
}
......@@ -363,4 +363,14 @@
and wx_user_id is not null and wx_user_id!=''
limit 1
</select>
<select id="listUserStaffId" resultType="string">
select staff_id FROM tab_haoban_staff
WHERE
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} and status_flag = 1 and super_manager_flag!=1
and staff_id not in
<foreach collection="staffIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
......@@ -358,6 +358,13 @@
and store_id = #{storeId}
and status_flag = 1
</select>
<select id="getOneByStoreIdAndStaffId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where status_flag=1
and store_id = #{storeId,jdbcType=VARCHAR}
and staff_id = #{staffId,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
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