Commit bb294ddc by 墨竹

fix:bug修改

parent afc23ea3
...@@ -26,7 +26,8 @@ public interface StaffMapper { ...@@ -26,7 +26,8 @@ public interface StaffMapper {
Page<TabHaobanStaff> pageStaff(@Param("staffIds") Set<String> staffIds, @Param("activeFlag") Integer activeFlag, @Param("keyword") String keyword); Page<TabHaobanStaff> pageStaff(@Param("staffIds") Set<String> staffIds, @Param("activeFlag") Integer activeFlag, @Param("keyword") String keyword);
TabHaobanStaff selectByUserIdAndEnterpriseId(@Param("userId") String userId, @Param("wxEnterpriseId") String wxEnterpriseId); TabHaobanStaff selectByUserIdAndEnterpriseId(@Param("userId") String userId,
@Param("wxEnterpriseId") String wxEnterpriseId);
TabHaobanStaff selectSuperByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId); TabHaobanStaff selectSuperByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
...@@ -80,4 +81,16 @@ public interface StaffMapper { ...@@ -80,4 +81,16 @@ public interface StaffMapper {
int updateOpenUserIdsByUserId(@Param("wxEnterpriseId") String wxEnterpriseId, int updateOpenUserIdsByUserId(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("wxUserId") String wxUserId, @Param("wxUserId") String wxUserId,
@Param("wxOpenUseId") String wxOpenUseId); @Param("wxOpenUseId") String wxOpenUseId);
/**
* 选择通过打开用户id和企业标识
*
* @param wxOpenUseId wx开放使用id
* @param wxEnterpriseId wx企业标识
* @return {@link TabHaobanStaff }
* @author mozhu
* @date 2021-12-21 21:13:56
*/
TabHaobanStaff selectByOpenUserIdAndEnterpriseId(@Param("wxOpenUseId") String wxOpenUseId,
@Param("wxEnterpriseId") String wxEnterpriseId);
} }
\ No newline at end of file
...@@ -4,7 +4,9 @@ import com.gic.commons.util.EntityUtil; ...@@ -4,7 +4,9 @@ import com.gic.commons.util.EntityUtil;
import com.gic.haoban.common.utils.StringUtil; import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper; import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.service.MemberUnionRelatedService; import com.gic.haoban.manage.service.service.MemberUnionRelatedService;
import com.gic.haoban.manage.service.service.StaffService; import com.gic.haoban.manage.service.service.StaffService;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
...@@ -20,23 +22,24 @@ import java.util.Set; ...@@ -20,23 +22,24 @@ import java.util.Set;
public class StaffServiceImpl implements StaffService { public class StaffServiceImpl implements StaffService {
@Autowired @Autowired
StaffMapper mapper; private StaffMapper mapper;
@Autowired @Autowired
private MemberUnionRelatedService memberUnionRelatedService; private MemberUnionRelatedService memberUnionRelatedService;
@Autowired
private WxEnterpriseMapper wxEnterpriseMapper;
@Override @Override
public TabHaobanStaff selectById(String id) { public TabHaobanStaff selectById(String id) {
return mapper.selectByPrimaryKey(id); return mapper.selectByPrimaryKey(id);
} }
@Override @Override
public TabHaobanStaff selectByNationcodeAndPhoneNumber(String wxEnterpriseId,String nationcode, String phoneNumber) { public TabHaobanStaff selectByNationcodeAndPhoneNumber(String wxEnterpriseId, String nationcode, String phoneNumber) {
if(StringUtils.isBlank(phoneNumber)){ if (StringUtils.isBlank(phoneNumber)) {
return null; return null;
} }
return mapper.selectByNationcodeAndPhoneNumber(wxEnterpriseId,nationcode,phoneNumber); return mapper.selectByNationcodeAndPhoneNumber(wxEnterpriseId, nationcode, phoneNumber);
} }
@Override @Override
...@@ -44,7 +47,7 @@ public class StaffServiceImpl implements StaffService { ...@@ -44,7 +47,7 @@ public class StaffServiceImpl implements StaffService {
Date now = new Date(); Date now = new Date();
tab.setCreateTime(now); tab.setCreateTime(now);
tab.setUpdateTime(now); tab.setUpdateTime(now);
if(StringUtils.isBlank(tab.getStaffId())){ if (StringUtils.isBlank(tab.getStaffId())) {
tab.setStaffId(StringUtil.randomUUID()); tab.setStaffId(StringUtil.randomUUID());
} }
tab.setStatusFlag(1); tab.setStatusFlag(1);
...@@ -58,13 +61,21 @@ public class StaffServiceImpl implements StaffService { ...@@ -58,13 +61,21 @@ public class StaffServiceImpl implements StaffService {
@Override @Override
public Page<TabHaobanStaff> pageStaff(Set<String> staffIds, Integer activeFlag, String keyword) { public Page<TabHaobanStaff> pageStaff(Set<String> staffIds, Integer activeFlag, String keyword) {
return mapper.pageStaff(staffIds,activeFlag,keyword); return mapper.pageStaff(staffIds, activeFlag, keyword);
} }
@Override @Override
public TabHaobanStaff selectByUserIdAndEnterpriseId(String userId,String wxEnterpriseId) { public TabHaobanStaff selectByUserIdAndEnterpriseId(String userId, String wxEnterpriseId) {
TabHaobanWxEnterprise tabHaobanWxEnterprise = wxEnterpriseMapper.selectByPrimaryKey(wxEnterpriseId);
return mapper.selectByUserIdAndEnterpriseId(userId,wxEnterpriseId); if (tabHaobanWxEnterprise == null) {
return null;
}
String corpid = tabHaobanWxEnterprise.getCorpid();
if (corpid.length() > 20) {
return mapper.selectByOpenUserIdAndEnterpriseId(userId, wxEnterpriseId);
} else {
return mapper.selectByUserIdAndEnterpriseId(userId, wxEnterpriseId);
}
} }
@Override @Override
...@@ -83,13 +94,13 @@ public class StaffServiceImpl implements StaffService { ...@@ -83,13 +94,13 @@ public class StaffServiceImpl implements StaffService {
@Override @Override
public List<StaffDTO> listByUserIdsAndWxEnterpriseId(List<String> userIds, String wxEnterpriseId) { public List<StaffDTO> listByUserIdsAndWxEnterpriseId(List<String> userIds, String wxEnterpriseId) {
return EntityUtil.changeEntityListByJSON(StaffDTO.class, this.mapper.listByUserIdsAndWxEnterpriseId(userIds,wxEnterpriseId)); return EntityUtil.changeEntityListByJSON(StaffDTO.class, this.mapper.listByUserIdsAndWxEnterpriseId(userIds, wxEnterpriseId));
} }
@Override @Override
public int cleanStaff(String wxEnterpriseId, List<String> staffIds) { public int cleanStaff(String wxEnterpriseId, List<String> staffIds) {
memberUnionRelatedService.cleanStaffRelated(wxEnterpriseId,staffIds); memberUnionRelatedService.cleanStaffRelated(wxEnterpriseId, staffIds);
return mapper.cleanStaff(wxEnterpriseId,staffIds); return mapper.cleanStaff(wxEnterpriseId, staffIds);
} }
@Override @Override
......
...@@ -405,4 +405,14 @@ ...@@ -405,4 +405,14 @@
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId} and wx_user_id = #{wxUserId}
</update> </update>
<select id="selectByOpenUserIdAndEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_staff
where wx_open_user_id = #{wxOpenUseId}
and wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1 limit 1
</select>
</mapper> </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