昨日回访量与营销比修改
This commit is contained in:
parent
c068d1e5dc
commit
61d2ca3f88
|
@ -39,18 +39,20 @@ public class MeituanController {
|
|||
@GetMapping("/refresh")
|
||||
public R refresh(){
|
||||
iMeituanService.getComments(SecurityUtils.getUsername());
|
||||
iMeituanService.getReturnInfo(null);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/getComment")
|
||||
public R getComment(Long id){
|
||||
iMeituanService.getComment(id);
|
||||
iMeituanService.getReturnInfo(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/getReturnInfo")
|
||||
public R getReturnInfo(){
|
||||
iMeituanService.getReturnInfo();
|
||||
iMeituanService.getReturnInfo(null);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.ruoyi.business.domain.BusStoreDayInfo;
|
|||
import com.ruoyi.business.domain.BusStoreExcelInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -63,4 +64,6 @@ public interface BusStoreDayHistoryInfoMapper
|
|||
*/
|
||||
public int deleteBusStoreDayHistoryInfoByIds(Long[] ids);
|
||||
BusStoreDayHistoryInfo getByDate(@Param("id") Long id, @Param("sT") String sT, @Param("eT") String eT);
|
||||
|
||||
List<BusStoreDayHistoryInfo> selectBusStoreDayHistoryInfoListByDate(@Param("id") Long id,@Param("date") String date);
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public interface IMeituanService {
|
|||
String mtgsigInfo(String orderId,String regionId,String regionVersion);
|
||||
String getStoreName(String cookie);
|
||||
|
||||
void getReturnInfo();
|
||||
void getReturnInfo(Long id);
|
||||
|
||||
String getComment(Long id);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ import java.time.LocalDate;
|
|||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 采集美团数据service
|
||||
|
@ -396,6 +397,7 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
list.add(orderInfo);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
List<BusOrderInfo> newList = list.stream().collect(Collectors.toMap(BusOrderInfo::getDayseq, p->p,(p1, p2)->p1)).values().stream().collect(Collectors.toList());
|
||||
// list.stream().sorted(Comparator.comparing(OrderInfo::getDaySeq)).collect(Collectors.toList());
|
||||
// int integral = iBusAgentInfoService.getIntegralByAccount(busStoreInfoMapper.getBindUserByStoreCode(wmPoiId));
|
||||
// for (OrderInfo orderInfo : list) {
|
||||
|
@ -405,9 +407,9 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
// busOrderInfoMapper.insertBusOrderInfo(busOrderInfo);
|
||||
// priPhoneInfo(busOrderInfo.getId(),orderInfo.getWmOrderViewId(),cookie);
|
||||
// }
|
||||
busOrderInfoMapper.batchInsertOrder(list);
|
||||
busOrderInfoMapper.batchInsertOrder(newList);
|
||||
|
||||
priPhoneInfo(list,cookie);
|
||||
priPhoneInfo(newList,cookie);
|
||||
}
|
||||
pageNum += 1;
|
||||
JSONObject jo = merchantOrders(pageNum, date, cookie);
|
||||
|
@ -645,11 +647,14 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getReturnInfo() {
|
||||
getComments(null);
|
||||
public void getReturnInfo(Long id) {
|
||||
// getComments(null);
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDateTime date = LocalDateTime.now().minusDays(1);
|
||||
BusStoreInfo storeInfo = new BusStoreInfo();
|
||||
if (id != null){
|
||||
storeInfo.setId(id);
|
||||
}
|
||||
List<BusStoreInfo> storeInfoList = busStoreInfoMapper.selectBusStoreInfoList(storeInfo);
|
||||
for (BusStoreInfo busStoreInfo : storeInfoList) {
|
||||
List<BusReturnVisitInfo> list = busReturnVisitInfoMapper.selectBusReturnVisitInfoListByDate(busStoreInfo.getStoreCode(), date.format(dateTimeFormatter));
|
||||
|
@ -659,17 +664,36 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
if (list1.size() == 1) {
|
||||
busStoreDayInfo = list1.get(0);
|
||||
busStoreDayInfo.setLastReturnVisitNum(list.size());
|
||||
int a = busStoreDayInfo.getLastPositiveReviewsNum();//todo 好评-五星
|
||||
int b = busStoreDayInfo.getLastReturnVisitNum();
|
||||
if (a != 0 && b != 0) {
|
||||
busStoreDayInfo.setLastReturnVisitRate(getRate(a,b));
|
||||
} else {
|
||||
busStoreDayInfo.setLastReturnVisitRate("0");
|
||||
}
|
||||
busStoreDayInfoMapper.updateBusStoreDayInfo(busStoreDayInfo);
|
||||
|
||||
BusStoreDayHistoryInfo target = new BusStoreDayHistoryInfo();
|
||||
BeanUtils.copyProperties(busStoreDayInfo,target);
|
||||
target.setId(null);
|
||||
busStoreDayHistoryInfoMapper.insertBusStoreDayHistoryInfo(target);
|
||||
|
||||
List<BusStoreDayHistoryInfo> list2 = busStoreDayHistoryInfoMapper.selectBusStoreDayHistoryInfoListByDate(storeInfo.getId(),date.format(dateTimeFormatter));
|
||||
if (list2.size() > 0){
|
||||
BusStoreDayHistoryInfo target = new BusStoreDayHistoryInfo();
|
||||
BeanUtils.copyProperties(busStoreDayInfo, target);
|
||||
target.setId(list2.get(0).getId());
|
||||
busStoreDayHistoryInfoMapper.updateBusStoreDayHistoryInfo(target);
|
||||
}else {
|
||||
BusStoreDayHistoryInfo target = new BusStoreDayHistoryInfo();
|
||||
BeanUtils.copyProperties(busStoreDayInfo, target);
|
||||
target.setId(null);
|
||||
busStoreDayHistoryInfoMapper.insertBusStoreDayHistoryInfo(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getRate(int a, int b){
|
||||
java.text.DecimalFormat df = new java.text.DecimalFormat("0.00");
|
||||
return df.format(((double) a / b)*100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取评分单条
|
||||
*
|
||||
|
|
|
@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectBusStoreDayHistoryInfoList" parameterType="com.ruoyi.business.domain.BusStoreExcelInfo" resultType="com.ruoyi.business.domain.BusStoreExcelInfo">
|
||||
<include refid="selectBusStoreDayHistoryInfoVo1"/>
|
||||
<where>
|
||||
DATE_FORMAT(a.create_time,'%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
|
||||
DATE_FORMAT(a.create_time,'%Y-%m-%d') = DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY),'%Y-%m-%d')
|
||||
and b.self_delivery_status != '3'
|
||||
<if test="storeList != null">
|
||||
and a.store_id in
|
||||
|
@ -112,6 +112,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectBusStoreDayHistoryInfoVo"/>
|
||||
where store_id = #{id} and create_time between #{sT} and #{eT}
|
||||
</select>
|
||||
<select id="selectBusStoreDayHistoryInfoListByDate"
|
||||
resultType="com.ruoyi.business.domain.BusStoreDayHistoryInfo">
|
||||
<include refid="selectBusStoreDayHistoryInfoVo"/>
|
||||
<where>
|
||||
<if test="date != null and date != '' "> DATE_FORMAT(create_time,'%Y-%m-%d') = #{date}</if>
|
||||
<if test="id != null and id != '' "> and store_id = #{id}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -43,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectBusStoreInfoVo"/>
|
||||
<where>
|
||||
self_delivery_status != '3'
|
||||
<if test="id != null and id != ''"> and id = #{id}</if>
|
||||
<if test="platformType != null and platformType != ''"> and platform_type = #{platformType}</if>
|
||||
<if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode}</if>
|
||||
<if test="storeName != null and storeName != ''"> and store_name like concat('%', #{storeName}, '%')</if>
|
||||
|
|
Loading…
Reference in New Issue