Commit ad38d709 by 徐高华

查询有单人码的导购

parent d0a5b5cf
......@@ -220,4 +220,6 @@ public interface HmQrcodeApiService {
*/
ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) ;
ServiceResponse<List<String>> listHasQrcodeClerk(String enterpriseId , List<String> clerkIdList) ;
}
......@@ -206,5 +206,17 @@ public interface TabHaobanHmQrcodeMapper {
List<String> getHmStoreForWxa(@Param("enterpriseId") String enterpriseId);
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;
import java.util.List;
import org.apache.ibatis.annotations.Param;
/**
* 活码(TabHaobanHmQrcode)表服务接口
......@@ -184,4 +186,6 @@ public interface HmQrcodeService {
List<String> getHmStoreForWxa(String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
List<String> listHasQrcodeClerk(String enterpriseId , List<String> clerkIdList) ;
}
......@@ -180,4 +180,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
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 {
public ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO 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));
}
}
......@@ -442,5 +442,14 @@
and b.hm_id is null
</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>
......@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo;
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.service.ClerkService;
import com.gic.commons.util.EntityUtil;
......@@ -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.common.utils.AuthWebRequestUtil;
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.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
......@@ -72,6 +72,7 @@ public class HmStoreController {
@ResponseBody
public RestResponse<Object> listStoreClerk(HttpServletRequest request, BasePageInfo basePageInfo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String enterpriseId = loginUser.getEnterpriseId();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
// 分组id
String storeGroupId = request.getParameter("storeGroupId");
......@@ -80,7 +81,7 @@ public class HmStoreController {
// 导购参数
String clerkSearchParams = request.getParameter("clerkSearchParams");
Map<String, Object> params = new HashMap<String, Object>();
params.put("enterpriseId", loginUser.getEnterpriseId());
params.put("enterpriseId", enterpriseId);
// 2线上
params.put("status", 2);
params.put("storeGroupId", storeGroupId);
......@@ -117,12 +118,12 @@ public class HmStoreController {
retPage.setTotalPage(page.getTotalPage());
List<ClerkStoreListVO> result = EntityUtil.changeEntityListByJSON(ClerkStoreListVO.class, page.getResult());
// 好办状态
this.haobanStatus(result, wxEnterpriseId);
this.haobanStatus(result, wxEnterpriseId, enterpriseId);
retPage.setResult(result);
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<>();
if (CollectionUtils.isEmpty(list)) {
return;
......@@ -156,21 +157,19 @@ public class HmStoreController {
}
}
if (CollectionUtils.isNotEmpty(statusList)) {
List<HmQrcodeListDTO> hmList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(hmList)) {
status2List.addAll(hmList.stream().filter(dto -> dto.getStatusFlag() == 3).map(dto -> dto.getClerkId())
.collect(Collectors.toList()));
status3List.addAll(hmList.stream().filter(dto -> dto.getStatusFlag() == 1).map(dto -> dto.getClerkId())
.collect(Collectors.toList()));
ServiceResponse<List<String>> hmClerkResp = this.hmQrcodeApiService.listHasQrcodeClerk(enterpriseId,
statusList);
if (!hmClerkResp.isSuccess()) {
}
if (CollectionUtils.isNotEmpty(hmClerkResp.getResult())) {
status3List.addAll(hmClerkResp.getResult());
}
status4List
.addAll(statusList.stream().filter(id -> (!status2List.contains(id) && !status3List.contains(id)))
.collect(Collectors.toList()));
}
logger.info("导购列表={}", status2List);
logger.info("导购列表={}", status3List);
logger.info("导购列表={}", status4List);
logger.info("导购列表未开启客户联系的={} , 已有单人活码的={}, 可以创建单人活码的={}", status2List, status3List, status4List);
list.stream().forEach(item -> {
for (ClerkListVO clerk : item.getClerkList()) {
if (status2List.contains(clerk.getClerkId())) {
......@@ -201,7 +200,7 @@ public class HmStoreController {
@ResponseBody
public RestResponse<Object> listStore(HttpServletRequest request, BasePageInfo basePageInfo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId() ;
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String enterpriseId = loginUser.getEnterpriseId();
String clerkId = loginUser.getClerkId();
// 如果有权限控制,进行管辖门店过0滤
......@@ -240,7 +239,7 @@ public class HmStoreController {
page.setPageSize(basePageInfo.getPageSize());
page.setCurrentPage(basePageInfo.getPageNum());
Map<String, Object> params = new HashMap<>();
params.put("searchDto", searchDTO) ;
params.put("searchDto", searchDTO);
page.setParams(params);
logger.info("查询条件={}", JSON.toJSONString(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