大屏接口

dev_0531
yechenhao 6 years ago
parent 1fe6b5aa6f
commit fd7e90e5dd

@ -16,7 +16,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@Slf4j
@ -39,6 +41,12 @@ public class DTOMessageHandler implements EventHandler<DTOMessage> {
PoiStoreStaffDOMapper poiStoreStaffDOMapper = dtoMessage.getPoiStoreStaffDOMapper();
QWMailListManageService qwMailListManageService = dtoMessage.getQwMailListManageService();
PrivilageCpUserStoreDO cpUserStoreDO = dtoMessage.getPrivilageCpUserStoreDO();
List<Map<String,Object>> tagList = poiStoreStaffDOMapper.selectStaffTagByStoreId(cpUserStoreDO.getStoreId());
Map<String,Long> tagMap = new HashMap<>();
for (Map<String,Object> map:tagList){
tagMap.put((String)map.get("tag"),(Long)map.get("staffId"));
}
List<WxCpUserExternalContactInfo> customers = null;
try {
customers = qwMailListManageService.getCustomer(cpUserId);
@ -63,14 +71,14 @@ public class DTOMessageHandler implements EventHandler<DTOMessage> {
if (StringUtils.isNotBlank(state)){
//判断是否有导购码
turnBackDTO.setEaCode(state);
}else if(tags != null && tags.length > 0){
}else if(tags != null && tags.length > 0 && tagList != null && tagList.size() > 0){
//判断是否有打tag
//todo 根据tag获取导购码
for (int j = 0;j<tags.length;j++){
String groupName = tags[j].getGroupName();
if ("导购".equals(groupName)){
String tagName = tags[j].getTagName();
Long staffId = poiStoreStaffDOMapper.selectStaffIdByTag(cpUserStoreDO.getStoreId(), tagName);
Long staffId = tagMap.get(tagName);
if (staffId != null){
PoiStoreStaff poiStoreStaff = poiStoreStaffDOMapper.selectById(staffId);
if (poiStoreStaff!=null){

@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* Mapper
@ -56,7 +57,9 @@ public interface PoiStoreStaffDOMapper extends BaseMapper<PoiStoreStaff> {
Long selectStaffIdByUserId(@Param("userId") Long userId);
Long selectStaffIdByTag(@Param("storeId") Long store,@Param("tag") String tag);
Long selectStaffIdByTag(@Param("storeId") Long storeId,@Param("tag") String tag);
List<Map<String,Object>> selectStaffTagByStoreId(@Param("storeId") Long storeId);
String selectUserNameById(@Param("id") Long id);

@ -291,7 +291,7 @@ public class QWMailListManageService {
List<WxCpUserExternalContactInfo> customers = null;
wxCpService = WxCpConfiguration.getCpService(applicationid);
WxCpExternalContactService externalContactService = wxCpService.getExternalContactService();
List<String> customerStrs = privilageCpUserDOMapper.selectCustomerIdsByCpUserId(cpUserId);
List<String> customerStrs = externalContactService.listExternalContacts(cpUserId);
//查询客户列表为空则直接返回
if (CollectionUtils.isNotEmpty(customerStrs)){
customers = new ArrayList<>();

@ -66,6 +66,10 @@
limit 1
</select>
<select id="selectStaffTagByStoreId" resultType="java.util.Map">
select staff_id as staffId,tag from poi_store_staff_tag where store_id = #{storeId}
</select>
<select id="selectUserNameById" resultType="java.lang.String">
select IFNULL(t5.name, '') from poi_store_staff t4,
privilage_user t5 where t4.user_id = t5.id and t4.id = #{id}

Loading…
Cancel
Save