大屏接口

dev_0531
yechenhao 6 years ago
parent 7e4c721cfb
commit b4bc30c1e5

@ -26,11 +26,21 @@ public class PoiCustomerContactDataStat {
* id * id
*/ */
private Long storeId; private Long storeId;
/**
*
*/
@TableField(exist = false)
private Integer number;
/** /**
* *
*/ */
@TableField(exist = false) @TableField(exist = false)
private String storeName; private String storeName;
/**
*
*/
@TableField(exist = false)
private String storeCode;
/** /**
* *
*/ */

@ -7,6 +7,7 @@ import com.kiisoo.ic.store.entity.StorePromotionDataDO;
import com.kiisoo.ic.store.service.StorePromotionDataService; import com.kiisoo.ic.store.service.StorePromotionDataService;
import com.kiisoo.ic.utils.DateUtils; import com.kiisoo.ic.utils.DateUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -107,14 +108,18 @@ public class StorePromotionDataController extends BaseController {
@RequestMapping(value = "/behavior",method = RequestMethod.POST) @RequestMapping(value = "/behavior",method = RequestMethod.POST)
@ResponseBody @ResponseBody
public Map<String,Object> listUserBehaviorData(@RequestParam("userId") Long userId, public Map<String,Object> listUserBehaviorData(@RequestParam("userId") Long userId,
@RequestParam(value = "startDate") Date startDate, @RequestParam(value = "startDate",required = false) String startDate,
@RequestParam(value = "endDate") Date endDate, @RequestParam(value = "endDate",required = false) String endDate,
@RequestParam(value = "companyId") Long companyId, @RequestParam(value = "companyId",required = false) Long companyId,
@RequestParam(value = "shopId") Long shopId, @RequestParam(value = "shopId",required = false) Long shopId,
@RequestParam(value = "pageNum") Integer pageNum, @RequestParam(value = "pageNum") Integer pageNum,
@RequestParam(value = "pageSize") Integer pageSize){ @RequestParam(value = "pageSize") Integer pageSize){
try { try {
PageInfo<PoiCustomerContactDataStat> poiCustomerContactDataStatPageInfo = storePromotionDataService.listUserBehaviorData(userId,companyId, shopId,startDate, endDate,pageNum,pageSize); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
PageInfo<PoiCustomerContactDataStat> poiCustomerContactDataStatPageInfo = storePromotionDataService.listUserBehaviorData(userId,companyId, shopId,
StringUtils.isBlank(startDate) ? null : sdf.parse(startDate),
StringUtils.isBlank(endDate) ? null : sdf.parse(endDate),
pageNum,pageSize);
return data(poiCustomerContactDataStatPageInfo); return data(poiCustomerContactDataStatPageInfo);
}catch (Exception e){ }catch (Exception e){
log.error("查询门店推广数据列表",e); log.error("查询门店推广数据列表",e);

@ -41,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.kiisoo.ic.config.WxCpConfiguration.APPLICATIONID; import static com.kiisoo.ic.config.WxCpConfiguration.APPLICATIONID;
@ -479,6 +480,9 @@ public class StorePromotionDataService {
//查询用户权限店铺 //查询用户权限店铺
shopIds = new HashSet<>(privilageDomainService.listUserDatePermission(userId)); shopIds = new HashSet<>(privilageDomainService.listUserDatePermission(userId));
} }
AtomicInteger number = new AtomicInteger(1 + ((pageNum - 1) * pageSize));
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<PoiCustomerContactDataStat> results = poiCustomerContactDataStatMapper.selectSumDataByShopIds(shopIds,startDate,endDate); List<PoiCustomerContactDataStat> results = poiCustomerContactDataStatMapper.selectSumDataByShopIds(shopIds,startDate,endDate);
if (CollectionUtils.isNotEmpty(results)){ if (CollectionUtils.isNotEmpty(results)){
@ -489,7 +493,10 @@ public class StorePromotionDataService {
return; return;
} }
result.setStoreName(poiStore.getName()); result.setStoreName(poiStore.getName());
result.setStoreCode(poiStore.getCode());
result.setAddress(poiStore.getAddress()); result.setAddress(poiStore.getAddress());
result.setNumber(number.get());
number.incrementAndGet();
//客户orgId //客户orgId
Long customerId = privilageDomainEntityDOMapper.selectDomainIdByShopEntity(storeId); Long customerId = privilageDomainEntityDOMapper.selectDomainIdByShopEntity(storeId);

@ -51,9 +51,9 @@
SUM(new_apply_cnt) as newApplyCnt, SUM(new_apply_cnt) as newApplyCnt,
SUM(chat_cnt) as chatCnt, SUM(chat_cnt) as chatCnt,
SUM(message_cnt) as messageCnt, SUM(message_cnt) as messageCnt,
AVG(avg_eply_ime) as avgReplyTime, AVG(avg_reply_time) as avgReplyTime,
AVG(reply_percentage) as replyPercentage, AVG(reply_percentage) as replyPercentage,
SUM(new_contact_cnt) as newContactCnt, SUM(new_contact_cnt) as newContactCnt
from poi_customer_contact_data_stat where from poi_customer_contact_data_stat where
store_id in store_id in
<foreach collection="storeIds" separator="," item="item" index="index" close=")" open="("> <foreach collection="storeIds" separator="," item="item" index="index" close=")" open="(">

Loading…
Cancel
Save