记得上下班打卡 | git大法好,push需谨慎

Commit 3f4abb59 authored by 胡佳晨's avatar 胡佳晨

pv uv

parent e946b619
......@@ -85,4 +85,28 @@ public class KylinTableStatusConst {
public static final Integer ORDER_EXPRESS_STATUS8000 = 8000; // 签收结单
public static final Integer ORDER_EXPRESS_SEND_TYPE1 = 1; // 发货
public static final Integer ORDER_EXPRESS_SEND_TYPE2 = 2; // 退款
public enum PvUv {
TK_DETAILS("now_tk_detail", "详情页"),
TK_TICKET("now_tk_ticket", "票种页"),
TK_ORDER("now_tk_order", "预下单页"),
TK_PAY("now_tk_pay", "支付操作");
private final String key;
private final String desc;
PvUv(String key, String desc) {
this.key = key;
this.desc = desc;
}
public String getKey() {
return key;
}
public String getDesc() {
return desc;
}
}
}
......@@ -228,12 +228,12 @@ public class KylinOrderTickets implements Serializable, Cloneable {
*
* @return
*/
public Object[] getAddObject(String ipAddress) {
public Object[] getAddObject(String ipAddress,String area,String areaProvince,String areaCity,String areaCounty) {
return new Object[]{
orderTicketsId, userId, userName, userMobile, performanceTitle, orderCode, qrCode, orderType, orderVersion,
number, price, priceMember, priceTotal, priceVoucher, priceActual, priceExpress, priceRefund, refundNumber,
payType, paymentType, timePay, expressContacts, expressAddress, expressPhone, couponType, getTicketType,
getTicketDescribe, payCountdownMinute, comment, createdAt, updatedAt, payCode,ipAddress
getTicketDescribe, payCountdownMinute, comment, createdAt, updatedAt, payCode,ipAddress,area,areaProvince,areaCity,areaCounty
};
}
......
......@@ -8,6 +8,7 @@ import com.liquidnet.commons.lang.util.DistanceUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.UserPathDto;
import com.liquidnet.service.kylin.constant.KylinPerformanceStatusEnum;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dto.param.PerformanceMemberAuditParam;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketVo;
......@@ -20,6 +21,7 @@ import com.liquidnet.service.kylin.dto.vo.returns.PayDetailVo;
import com.liquidnet.service.kylin.service.IKylinPerformancesService;
import com.liquidnet.service.kylin.utils.DataUtils;
import com.liquidnet.service.kylin.utils.ObjectUtil;
import com.liquidnet.service.kylin.utils.QueueUtils;
import lombok.extern.slf4j.Slf4j;
import org.bson.Document;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -54,6 +56,8 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
@Autowired
private DataUtils dataUtils;
@Autowired
private QueueUtils queueUtils;
public HashMap<String, Object> localList(
int days, String cityName, int type,
......@@ -222,7 +226,7 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
public HashMap<String, Object> ticketTimesPartner(String performancesId, Integer isAgent) {
KylinPerformanceVo vo = dataUtils.getPerformanceVo(performancesId);
vo = checkAppStatusInfo(vo);
queueUtils.pushPvUv(CurrentUtil.getCurrentUid(), KylinTableStatusConst.PvUv.TK_TICKET.getKey(), performancesId, null, null, CurrentUtil.getCliIpAddr());
List<KylinTicketTimesVo> ticketTimesList = vo.getTicketTimeList();
if (null != ticketTimesList) {
......@@ -392,7 +396,7 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
KylinTicketVo ticketVo = null;
KylinPerformanceVo performancesInfo = dataUtils.getPerformanceVo(performancesId);
performancesInfo = checkAppStatusInfo(performancesInfo);
queueUtils.pushPvUv(CurrentUtil.getCurrentUid(), KylinTableStatusConst.PvUv.TK_ORDER.getKey(), performancesId, null, null, CurrentUtil.getCliIpAddr());
for (int i = 0; i < performancesInfo.getTicketTimeList().size(); i++) {
for (int x = 0; x < performancesInfo.getTicketTimeList().get(i).getTicketList().size(); x++) {
KylinTicketVo ticketItem = performancesInfo.getTicketTimeList().get(i).getTicketList().get(x);
......
package com.liquidnet.service.kylin.utils;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.HashMap;
@Component
......@@ -38,4 +41,17 @@ public class QueueUtils {
map.put("message", jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
}
public void pushPvUv(String uid, String accessType, String performanceId, String orderId, String orderCode, String ipAddress) {
try {
sendMsgByRedis(MQConst.KylinQueue.SQL_PERFORMANCE_LACK.getKey(),
SqlMapping.get("bi_ticket_access_records.insert", new Object[]{
uid, accessType, performanceId, orderId, orderCode,
ipAddress, area, areaProvince, areaCity, areaCounty,
LocalDateTime.now(),
}));
} catch (Exception e) {
}
}
}
......@@ -124,6 +124,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
}
queueUtils.pushPvUv(uid,KylinTableStatusConst.PvUv.TK_PAY.getKey(),performanceData.getPerformancesId(),null,null,CurrentUtil.getCliIpAddr());
if (performanceData == null || ticketTimesData == null || ticketData == null) {
return ResponseDto.failure(ErrorMapping.get("20004"));//参数错误
}
......
......@@ -23,6 +23,7 @@ import org.springframework.stereotype.Component;
import org.springframework.util.MultiValueMap;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -39,8 +40,6 @@ public class OrderUtils {
private String candyUrl;
@Value("${liquidnet.service.stone.url}")
private String stoneUrl;
@Autowired
private QueueUtils queueUtils;
public String judgeOrderLimit(
int type,
......@@ -142,13 +141,13 @@ public class OrderUtils {
return surplusGeneral;
}
public void doTask(String uid,String title,BigDecimal price) {
public void doTask(String uid, String title, BigDecimal price) {
try {
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
header.add("Accept", "application/json;charset=UTF-8");
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
params.add("score", price.intValue()+"");
params.add("content", "购买演出:"+title);
params.add("score", price.intValue() + "");
params.add("content", "购买演出:" + title);
params.add("uid", uid);
String resultData = HttpUtil.post(stoneUrl + "/user/logs/in2111", params, header);
} catch (Exception e) {
......@@ -157,7 +156,7 @@ public class OrderUtils {
}
}
public AdamRscPolymer01Vo adamAddressEnterMember(String uid,String enterIds,String addressId) {
public AdamRscPolymer01Vo adamAddressEnterMember(String uid, String enterIds, String addressId) {
try {
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
header.add("Accept", "application/json;charset=UTF-8");
......@@ -271,8 +270,8 @@ public class OrderUtils {
hashMap.put("type", type);
hashMap.put("voucher", voucher.setScale(2, BigDecimal.ROUND_HALF_UP));
return hashMap;
}catch (Exception e){
log.error("用券ERROR:{}",e);
} catch (Exception e) {
log.error("用券ERROR:{}", e);
hashMap.put("type", -1);
hashMap.put("voucher", -1);
return hashMap;
......@@ -298,8 +297,8 @@ public class OrderUtils {
params.add(param);
String jsonString = JSON.toJSONString(params);
String returnData = HttpUtil.postRaw(candyUrl + "/candy-coupon/useBack", jsonString, header);
}catch (Exception e){
log.error("回退券ERROR:{}",e);
} catch (Exception e) {
log.error("回退券ERROR:{}", e);
}
}
......@@ -365,13 +364,4 @@ public class OrderUtils {
return false;
}
}
public boolean pushPvUv(){
queueUtils.sendMsgByRedis(MQConst.KylinQueue.SQL_PERFORMANCE_LACK.getKey(),
SqlMapping.get("bi_ticket_access_records.insert", new Object[]{
"user_id", "access_type", "performance_id", "order_id", "order_code",
"ip_address", "area", "area_province", "area_city", "area_county",
"created_at",
}));
}
}
package com.liquidnet.service.order.utils;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.HashMap;
@Component
......@@ -37,4 +40,17 @@ public class QueueUtils {
map.put("message", jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
}
public void pushPvUv(String uid, String accessType, String performanceId, String orderId, String orderCode, String ipAddress) {
try {
sendMsgByRedis(MQConst.KylinQueue.SQL_PERFORMANCE_LACK.getKey(),
SqlMapping.get("bi_ticket_access_records.insert", new Object[]{
uid, accessType, performanceId, orderId, orderCode,
ipAddress, area, areaProvince, areaCity, areaCounty,
LocalDateTime.now(),
}));
} catch (Exception e) {
}
}
}
......@@ -4,7 +4,7 @@ kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id
# ------------------------PV/UV----------------------------
bi_ticket_access_records.insert=INSERT INTO `bi_ticket_access_records` ( `user_id`, `access_type`, `performance_id`, `order_id`, `order_code`,`ip_address`, `area`, "area_province", `area_city`, `area_county`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?);
# ------------------------创建订单----------------------------
kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address,area,area_province,area_city,area_county)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_relation.add=INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id ,ticket_id ,created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status ,created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?)
kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
......
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