Commit d85c8ca4 by 墨竹

feat:查询区经 商户列表

parent d4cbaf8c
......@@ -203,4 +203,13 @@ public interface StaffClerkRelationApiService {
List<String> listStaffIdByWxEnterpriseId(String wxEnterpriseId);
/**
* 获取区经绑定
*
* @param staffId 员工id
* @return {@link List}<{@link StaffClerkInfoDTO}>
*/
List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId);
}
......@@ -265,4 +265,6 @@ public interface TabHaobanStaffClerkRelationMapper {
int getBindByManage(@Param("enterpriseId") String enterpriseId);
int getBindByStaffIdAndEnterpriseId(@Param("enterpriseId") String enterpriseId, @Param("staffId") String staffId);
List<TabHaobanStaffClerkRelation> listManageBindByStaffId(@Param("staffId") String staffId);
}
\ No newline at end of file
......@@ -205,4 +205,6 @@ public interface StaffClerkRelationService {
* @return boolean
*/
boolean getBindByStaffIdAndEnterpriseId(String enterpriseId, String staffId);
List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId);
}
......@@ -373,4 +373,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public boolean getBindByStaffIdAndEnterpriseId(String enterpriseId, String staffId) {
return mapper.getBindByStaffIdAndEnterpriseId(enterpriseId, staffId) > 0;
}
@Override
public List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId) {
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class,mapper.listManageBindByStaffId(staffId));
}
}
......@@ -513,4 +513,9 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
public List<String> listStaffIdByWxEnterpriseId(String wxEnterpriseId) {
return this.staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId);
}
@Override
public List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId) {
return staffClerkRelationService.listManageBindByStaffId(staffId);
}
}
......@@ -557,4 +557,12 @@
where status_flag=1 and enterprise_id = #{enterpriseId} and staff_id = #{staffId}
</select>
<select id="listManageBindByStaffId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from tab_haoban_staff_clerk_relation
where status_flag=1 and manage_flag = 1 and staff_id = #{staffId}
</select>
</mapper>
\ No newline at end of file
......@@ -1286,6 +1286,7 @@ public class ClerkController extends WebBaseController {
/**
* 导购gic门店和好办企业门店交集
*
* @param clerkId
* @return
*/
......@@ -1295,4 +1296,53 @@ public class ClerkController extends WebBaseController {
return RestResponse.successResult(storeIds);
}
/**
* 获取区经的绑定商户
*
* @return
*/
@RequestMapping(value = "/getManageEnterpriseByStaffId", method = RequestMethod.GET)
public RestResponse<List<StaffStoreVO>> getManageEnterpriseByStaffId() {
String staffId = this.getLoginUser().getStaffId();
String wxEnterpriseId = this.getLoginUser().getWxEnterpriseId();
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listManageBindByStaffId(staffId);
List<StaffStoreVO> list = new ArrayList<>();
for (StaffClerkRelationDTO staffClerkRelationDTO : bindRelationList) {
String clerkId = staffClerkRelationDTO.getClerkId();
String enterpriseId = staffClerkRelationDTO.getEnterpriseId();
ClerkDTO clerk = clerkService.getclerkById(clerkId);
if (clerk == null) {
continue;
}
StaffDTO staffDTO = staffApiService.selectById(staffId);
if (staffDTO == null) {
continue;
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(wxEnterpriseId);
if (wxEnterpriseDTO == null) {
continue;
}
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(enterpriseId);
if (enterpriseDTO == null) {
continue;
}
StaffStoreVO vo = new StaffStoreVO();
vo.setClerkCode(clerk.getClerkCode());
vo.setClerkId(clerk.getClerkId());
vo.setClerkType(clerk.getClerkType());
vo.setEnterpriseId(enterpriseId);
vo.setPhoneNumber(clerk.getPhoneNumber());
vo.setStaffId(staffId);
vo.setWxEnterpriseId(wxEnterpriseId);
vo.setClerkName(clerk.getClerkName());
vo.setHeadImg(staffDTO.getHeadImg());
vo.setBindFlag(1);
vo.setEnterpriseName(enterpriseDTO.getBrandName());
vo.setCorpName(wxEnterpriseDTO.getCorpName());
list.add(vo);
}
return RestResponse.successResult();
}
}
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