Commit ad38d709 by 徐高华

查询有单人码的导购

parent d0a5b5cf
...@@ -219,5 +219,7 @@ public interface HmQrcodeApiService { ...@@ -219,5 +219,7 @@ public interface HmQrcodeApiService {
* @throws * @throws
*/ */
ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) ; ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) ;
ServiceResponse<List<String>> listHasQrcodeClerk(String enterpriseId , List<String> clerkIdList) ;
} }
...@@ -206,5 +206,17 @@ public interface TabHaobanHmQrcodeMapper { ...@@ -206,5 +206,17 @@ public interface TabHaobanHmQrcodeMapper {
List<String> getHmStoreForWxa(@Param("enterpriseId") String enterpriseId); List<String> getHmStoreForWxa(@Param("enterpriseId") String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto); List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
/**
*
* @Title: listHasQrcodeClerk
* @Description: 返回已有单人活码的clerkId
* @author xugh
* @param enterpriseId
* @param clerkId
* @return
* @throws
*/
List<String> listHasQrcodeClerk(@Param("enterpriseId")String enterpriseId , @Param("clerkIdList")List<String> clerkIdList) ;
} }
...@@ -9,6 +9,8 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO; ...@@ -9,6 +9,8 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
/** /**
* 活码(TabHaobanHmQrcode)表服务接口 * 活码(TabHaobanHmQrcode)表服务接口
...@@ -184,4 +186,6 @@ public interface HmQrcodeService { ...@@ -184,4 +186,6 @@ public interface HmQrcodeService {
List<String> getHmStoreForWxa(String enterpriseId); List<String> getHmStoreForWxa(String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto); List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
List<String> listHasQrcodeClerk(String enterpriseId , List<String> clerkIdList) ;
} }
...@@ -179,5 +179,10 @@ public class HmQrcodeServiceImpl implements HmQrcodeService { ...@@ -179,5 +179,10 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
public List<String> listHmIdForIndex(HmQrcodeListQDTO qdto) { public List<String> listHmIdForIndex(HmQrcodeListQDTO qdto) {
return tabHaobanHmQrcodeMapper.listHmIdForIndex(qdto) ; return tabHaobanHmQrcodeMapper.listHmIdForIndex(qdto) ;
} }
@Override
public List<String> listHasQrcodeClerk(String enterpriseId, List<String> clerkIdList) {
return this.tabHaobanHmQrcodeMapper.listHasQrcodeClerk(enterpriseId, clerkIdList);
}
} }
...@@ -780,4 +780,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -780,4 +780,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
public ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) { public ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) {
return ServiceResponse.success(hmQrcodeService.listHmIdForIndex(qdto)); return ServiceResponse.success(hmQrcodeService.listHmIdForIndex(qdto));
} }
@Override
public ServiceResponse<List<String>> listHasQrcodeClerk(String enterpriseId, List<String> clerkIdList) {
return ServiceResponse.success(hmQrcodeService.listHasQrcodeClerk(enterpriseId,clerkIdList));
}
} }
...@@ -441,6 +441,15 @@ ...@@ -441,6 +441,15 @@
and a.wx_enterprise_id = #{wxEnterpriseId} and a.wx_enterprise_id = #{wxEnterpriseId}
and b.hm_id is null and b.hm_id is null
</sql> </sql>
<select id="listHasQrcodeClerk" resultType="String">
select clerk_id from tab_haoban_hm_qrcode where enterprise_id=#{enterpriseId}
and clerk_id in
<foreach collection="clerkIdList" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
and hm_type = 1 and status_flag in (1,3)
</select>
</mapper> </mapper>
...@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkStoreListDTO; import com.gic.clerk.api.dto.ClerkStoreListDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
...@@ -31,7 +32,6 @@ import com.gic.enterprise.api.service.StoreService; ...@@ -31,7 +32,6 @@ import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO; import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil; import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeListDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO; import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService; import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
...@@ -72,6 +72,7 @@ public class HmStoreController { ...@@ -72,6 +72,7 @@ public class HmStoreController {
@ResponseBody @ResponseBody
public RestResponse<Object> listStoreClerk(HttpServletRequest request, BasePageInfo basePageInfo) { public RestResponse<Object> listStoreClerk(HttpServletRequest request, BasePageInfo basePageInfo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String enterpriseId = loginUser.getEnterpriseId();
String wxEnterpriseId = loginUser.getWxEnterpriseId(); String wxEnterpriseId = loginUser.getWxEnterpriseId();
// 分组id // 分组id
String storeGroupId = request.getParameter("storeGroupId"); String storeGroupId = request.getParameter("storeGroupId");
...@@ -80,7 +81,7 @@ public class HmStoreController { ...@@ -80,7 +81,7 @@ public class HmStoreController {
// 导购参数 // 导购参数
String clerkSearchParams = request.getParameter("clerkSearchParams"); String clerkSearchParams = request.getParameter("clerkSearchParams");
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("enterpriseId", loginUser.getEnterpriseId()); params.put("enterpriseId", enterpriseId);
// 2线上 // 2线上
params.put("status", 2); params.put("status", 2);
params.put("storeGroupId", storeGroupId); params.put("storeGroupId", storeGroupId);
...@@ -117,12 +118,12 @@ public class HmStoreController { ...@@ -117,12 +118,12 @@ public class HmStoreController {
retPage.setTotalPage(page.getTotalPage()); retPage.setTotalPage(page.getTotalPage());
List<ClerkStoreListVO> result = EntityUtil.changeEntityListByJSON(ClerkStoreListVO.class, page.getResult()); List<ClerkStoreListVO> result = EntityUtil.changeEntityListByJSON(ClerkStoreListVO.class, page.getResult());
// 好办状态 // 好办状态
this.haobanStatus(result, wxEnterpriseId); this.haobanStatus(result, wxEnterpriseId, enterpriseId);
retPage.setResult(result); retPage.setResult(result);
return RestResponse.successResult(retPage); return RestResponse.successResult(retPage);
} }
private void haobanStatus(List<ClerkStoreListVO> list, String wxEnterpriseId) { private void haobanStatus(List<ClerkStoreListVO> list, String wxEnterpriseId, String enterpriseId) {
List<String> clerkIdList = new ArrayList<>(); List<String> clerkIdList = new ArrayList<>();
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return; return;
...@@ -156,21 +157,19 @@ public class HmStoreController { ...@@ -156,21 +157,19 @@ public class HmStoreController {
} }
} }
if (CollectionUtils.isNotEmpty(statusList)) { if (CollectionUtils.isNotEmpty(statusList)) {
List<HmQrcodeListDTO> hmList = new ArrayList<>(); ServiceResponse<List<String>> hmClerkResp = this.hmQrcodeApiService.listHasQrcodeClerk(enterpriseId,
if (CollectionUtils.isNotEmpty(hmList)) { statusList);
status2List.addAll(hmList.stream().filter(dto -> dto.getStatusFlag() == 3).map(dto -> dto.getClerkId()) if (!hmClerkResp.isSuccess()) {
.collect(Collectors.toList()));
status3List.addAll(hmList.stream().filter(dto -> dto.getStatusFlag() == 1).map(dto -> dto.getClerkId()) }
.collect(Collectors.toList())); if (CollectionUtils.isNotEmpty(hmClerkResp.getResult())) {
status3List.addAll(hmClerkResp.getResult());
} }
status4List status4List
.addAll(statusList.stream().filter(id -> (!status2List.contains(id) && !status3List.contains(id))) .addAll(statusList.stream().filter(id -> (!status2List.contains(id) && !status3List.contains(id)))
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
logger.info("导购列表未开启客户联系的={} , 已有单人活码的={}, 可以创建单人活码的={}", status2List, status3List, status4List);
logger.info("导购列表={}", status2List);
logger.info("导购列表={}", status3List);
logger.info("导购列表={}", status4List);
list.stream().forEach(item -> { list.stream().forEach(item -> {
for (ClerkListVO clerk : item.getClerkList()) { for (ClerkListVO clerk : item.getClerkList()) {
if (status2List.contains(clerk.getClerkId())) { if (status2List.contains(clerk.getClerkId())) {
...@@ -201,7 +200,7 @@ public class HmStoreController { ...@@ -201,7 +200,7 @@ public class HmStoreController {
@ResponseBody @ResponseBody
public RestResponse<Object> listStore(HttpServletRequest request, BasePageInfo basePageInfo) { public RestResponse<Object> listStore(HttpServletRequest request, BasePageInfo basePageInfo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId() ; String wxEnterpriseId = loginUser.getWxEnterpriseId();
String enterpriseId = loginUser.getEnterpriseId(); String enterpriseId = loginUser.getEnterpriseId();
String clerkId = loginUser.getClerkId(); String clerkId = loginUser.getClerkId();
// 如果有权限控制,进行管辖门店过0滤 // 如果有权限控制,进行管辖门店过0滤
...@@ -240,7 +239,7 @@ public class HmStoreController { ...@@ -240,7 +239,7 @@ public class HmStoreController {
page.setPageSize(basePageInfo.getPageSize()); page.setPageSize(basePageInfo.getPageSize());
page.setCurrentPage(basePageInfo.getPageNum()); page.setCurrentPage(basePageInfo.getPageNum());
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("searchDto", searchDTO) ; params.put("searchDto", searchDTO);
page.setParams(params); page.setParams(params);
logger.info("查询条件={}", JSON.toJSONString(page)); logger.info("查询条件={}", JSON.toJSONString(page));
Map<String, Object> result = storeService.getStoreListPage(page); Map<String, Object> result = storeService.getStoreListPage(page);
......
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