|
@@ -2,18 +2,14 @@ package entity
|
|
|
|
|
|
import (
|
|
|
"app.yhyue.com/moapp/jybase/es"
|
|
|
-<<<<<<< HEAD
|
|
|
"app.yhyue.com/moapp/jybase/mongodb"
|
|
|
-=======
|
|
|
->>>>>>> master
|
|
|
+
|
|
|
"bytes"
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
-<<<<<<< HEAD
|
|
|
-=======
|
|
|
+
|
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
|
->>>>>>> master
|
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|
|
"io/ioutil"
|
|
|
"jy/src/jfw/modules/subscribepay/src/config"
|
|
@@ -73,10 +69,7 @@ type OrderInfo struct {
|
|
|
DataSpec string `json:"data_spec,omitempty"`
|
|
|
UserMail string `json:"user_mail,omitempty"`
|
|
|
UserPhone string `json:"user_phone,omitempty"`
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone string `json:"person_phone,omitempty"`
|
|
|
-=======
|
|
|
->>>>>>> master
|
|
|
DataCount int `json:"data_count,omitempty"`
|
|
|
FilterPublishtime string `json:"filter_publishtime,omitempty"`
|
|
|
FilterKeys string `json:"filter_keys,omitempty"`
|
|
@@ -159,7 +152,6 @@ func (this *commonOrderStruct) InserMap(product, productId, userid, lotteryId, d
|
|
|
if orderinfo == nil && msg != "" {
|
|
|
return
|
|
|
}
|
|
|
-<<<<<<< HEAD
|
|
|
if userid != "" {
|
|
|
if mongodb.IsObjectIdHex(userid) {
|
|
|
userData, ok := util.MQFW.FindById("user", userid, "")
|
|
@@ -173,39 +165,21 @@ func (this *commonOrderStruct) InserMap(product, productId, userid, lotteryId, d
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-=======
|
|
|
->>>>>>> master
|
|
|
filterM := map[string]interface{}{}
|
|
|
if err := json.Unmarshal([]byte(orderinfo.Filter), &filterM); err != nil {
|
|
|
return
|
|
|
}
|
|
|
// p738 芝麻分析报告首购优惠 不与活动叠加
|
|
|
if product == consts.ZmAnalysisReportProductName {
|
|
|
-<<<<<<< HEAD
|
|
|
- if isFirst, b := m["is_first"].(bool); b && isFirst {
|
|
|
- // 再次判断是否符合首购优惠
|
|
|
- if ok, firstDiscount := GetZmAnalysisReportFirstDiscount(qu.Int64All(productId), userid); ok && firstDiscount > 0 {
|
|
|
-=======
|
|
|
if gconv.Int(filterM["pack_type"]) == 0 {
|
|
|
//if isFirst, b := m["is_first"].(bool); b && isFirst {
|
|
|
// 再次判断是否符合首购优惠
|
|
|
if ok, firstDiscount, isCombo := GetZmAnalysisReportFirstDiscount(qu.Int64All(productId), userid); ok && firstDiscount > 0 {
|
|
|
->>>>>>> master
|
|
|
// 如果符合首次优惠则取首次优惠价格
|
|
|
orderinfo.OrderMoney = orderinfo.OriginalPrice - firstDiscount
|
|
|
orderinfo.DiscountPrice = firstDiscount
|
|
|
orderinfo.OrderDetail["final_price"] = orderinfo.OrderMoney
|
|
|
-<<<<<<< HEAD
|
|
|
- filterM["first_price"] = 1 // 首购优惠标识
|
|
|
- filterByte, _ := json.Marshal(filterM)
|
|
|
- orderinfo.Filter = string(filterByte)
|
|
|
- } else {
|
|
|
- return nil, "优惠状态异常,请刷新后重新提交"
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
-=======
|
|
|
if isCombo {
|
|
|
filterM["combo_price"] = 1 // 套餐优惠标识
|
|
|
} else {
|
|
@@ -224,7 +198,6 @@ func (this *commonOrderStruct) InserMap(product, productId, userid, lotteryId, d
|
|
|
orderinfo.Filter = string(filterByte)
|
|
|
}
|
|
|
}
|
|
|
->>>>>>> master
|
|
|
}
|
|
|
//卡券
|
|
|
log.Println("卡卷信息", lotteryId)
|
|
@@ -449,11 +422,8 @@ func dataExportOrder(m map[string]interface{}, userId string) (*OrderInfo, strin
|
|
|
return &OrderInfo{
|
|
|
UserId: userId,
|
|
|
OrderCode: ordercode,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: qu.ObjToString(m["order_phone"]),
|
|
|
-=======
|
|
|
UserPhone: qu.ObjToString(m["order_phone"]),
|
|
|
->>>>>>> master
|
|
|
UserMail: qu.ObjToString(m["order_email"]),
|
|
|
ProductType: "历史数据",
|
|
|
OrderMoney: order_money,
|
|
@@ -795,17 +765,10 @@ func vipFirstBuy(m map[string]interface{}, userId string, session *httpsession.S
|
|
|
"finalAreaCount": areaCount,
|
|
|
}),
|
|
|
},
|
|
|
-<<<<<<< HEAD
|
|
|
UserId: userId,
|
|
|
Filter: string(filterStr),
|
|
|
DisWord: disWord,
|
|
|
PersonPhone: qu.ObjToString(m["order_phone"]),
|
|
|
-=======
|
|
|
- UserId: userId,
|
|
|
- Filter: string(filterStr),
|
|
|
- DisWord: disWord,
|
|
|
- UserPhone: qu.ObjToString(m["order_phone"]),
|
|
|
->>>>>>> master
|
|
|
}, ""
|
|
|
}
|
|
|
|
|
@@ -916,11 +879,7 @@ func vipRenew(m map[string]interface{}, userId string, session *httpsession.Sess
|
|
|
VipType: 1,
|
|
|
VipStartTime: FormatDate(&startTime, Date_Full_Layout),
|
|
|
VipEndTime: FormatDate(&endTime, Date_Full_Layout),
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: qu.ObjToString(m["order_phone"]),
|
|
|
-=======
|
|
|
- UserPhone: qu.ObjToString(m["order_phone"]),
|
|
|
->>>>>>> master
|
|
|
OrderDetail: g.Map{
|
|
|
"order_code": ordercode,
|
|
|
"product_type": "VIP订阅",
|
|
@@ -1083,11 +1042,7 @@ func vipUpgrade(m map[string]interface{}, userId string, session *httpsession.Se
|
|
|
Filter: string(filterStr),
|
|
|
DisWord: disWord,
|
|
|
VipType: 2,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: order_phone,
|
|
|
-=======
|
|
|
- UserPhone: order_phone,
|
|
|
->>>>>>> master
|
|
|
VipStartTime: FormatDate(&startTime, Date_Full_Layout),
|
|
|
VipEndTime: FormatDate(&endTime, Date_Full_Layout),
|
|
|
OrderDetail: g.Map{
|
|
@@ -1176,11 +1131,7 @@ func memberOrder(m map[string]interface{}, userId string, session *httpsession.S
|
|
|
PrepayTime: NowFormat(Date_Full_Layout),
|
|
|
UserId: userId,
|
|
|
OriginalPrice: order_money,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: order_phone,
|
|
|
-=======
|
|
|
- UserPhone: order_phone,
|
|
|
->>>>>>> master
|
|
|
OrderDetail: g.Map{
|
|
|
"order_code": code,
|
|
|
"product_type": "大会员",
|
|
@@ -1235,11 +1186,7 @@ func integralOrder(m map[string]interface{}, userId string) (*OrderInfo, string)
|
|
|
PrepayTime: NowFormat(Date_Full_Layout),
|
|
|
UserId: userId,
|
|
|
OriginalPrice: original_price,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: order_phone,
|
|
|
-=======
|
|
|
- UserPhone: order_phone,
|
|
|
->>>>>>> master
|
|
|
OrderDetail: g.Map{
|
|
|
"order_code": code,
|
|
|
"product_type": "剑鱼币",
|
|
@@ -1295,11 +1242,7 @@ func dataexportPackOrder(m map[string]interface{}, userId string) (*OrderInfo, s
|
|
|
OrderMoney: orderMoney,
|
|
|
OrderStatus: 0,
|
|
|
ServiceStatus: 0,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: qu.ObjToString(m["order_phone"]),
|
|
|
-=======
|
|
|
- UserPhone: qu.ObjToString(m["order_phone"]),
|
|
|
->>>>>>> master
|
|
|
OrderCode: orderCode,
|
|
|
ProductType: "数据流量包",
|
|
|
CreateTime: NowFormat(Date_Full_Layout),
|
|
@@ -1369,11 +1312,7 @@ func pdfExportPackOrder(m map[string]interface{}, userId, product, productId str
|
|
|
OrderMoney: packDetail.Price, //订单金额
|
|
|
OrderStatus: 0,
|
|
|
ServiceStatus: 0,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: qu.ObjToString(m["order_phone"]),
|
|
|
-=======
|
|
|
- UserPhone: qu.ObjToString(m["order_phone"]),
|
|
|
->>>>>>> master
|
|
|
OrderCode: orderCode,
|
|
|
ProductType: product,
|
|
|
CreateTime: NowFormat(Date_Full_Layout),
|
|
@@ -1435,11 +1374,7 @@ func areaPackOrder(m map[string]interface{}, userId string, session *httpsession
|
|
|
OrderMoney: totalfee,
|
|
|
OrderStatus: 0,
|
|
|
ServiceStatus: 0,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: qu.ObjToString(m["order_phone"]),
|
|
|
-=======
|
|
|
- UserPhone: qu.ObjToString(m["order_phone"]),
|
|
|
->>>>>>> master
|
|
|
OrderCode: orderCode,
|
|
|
ProductType: "省份订阅包",
|
|
|
CreateTime: NowFormat(Date_Full_Layout),
|
|
@@ -1564,11 +1499,7 @@ func filePackOrder(m map[string]interface{}, userId string, session *httpsession
|
|
|
OrderMoney: price,
|
|
|
OrderStatus: 0,
|
|
|
ServiceStatus: 0,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: order_phone,
|
|
|
-=======
|
|
|
- UserPhone: order_phone,
|
|
|
->>>>>>> master
|
|
|
OrderCode: orderCode,
|
|
|
ProductType: "附件下载包",
|
|
|
CreateTime: FormatDate(&now, Date_Full_Layout),
|
|
@@ -1656,11 +1587,7 @@ func buyerPortraitPackOrder(m map[string]interface{}, userId string, session *ht
|
|
|
OrderMoney: price,
|
|
|
OrderStatus: 0,
|
|
|
ServiceStatus: 0,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: order_phone,
|
|
|
-=======
|
|
|
- UserPhone: order_phone,
|
|
|
->>>>>>> master
|
|
|
OrderCode: orderCode,
|
|
|
ProductType: "采购单位画像包",
|
|
|
CreateTime: FormatDate(&now, Date_Full_Layout),
|
|
@@ -1732,11 +1659,7 @@ func newDataReportOrder(m map[string]interface{}, userId string) (*OrderInfo, st
|
|
|
OrderMoney: qu.IntAll((*r)["i_price"]),
|
|
|
OrderStatus: 0,
|
|
|
ServiceStatus: 0,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: phone,
|
|
|
-=======
|
|
|
- UserPhone: phone,
|
|
|
->>>>>>> master
|
|
|
OrderCode: orderCode,
|
|
|
ProductType: "数据报告",
|
|
|
CreateTime: FormatDate(&now, Date_Full_Layout),
|
|
@@ -1794,11 +1717,7 @@ func bidReportOrder(m map[string]interface{}, userId, productId string, session
|
|
|
OrderMoney: packDetail.Price,
|
|
|
OrderStatus: 0,
|
|
|
ServiceStatus: 0,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: phone,
|
|
|
-=======
|
|
|
- UserPhone: phone,
|
|
|
->>>>>>> master
|
|
|
OrderCode: orderCode,
|
|
|
ProductType: "投标企业信用报告",
|
|
|
CreateTime: FormatDate(&now, Date_Full_Layout),
|
|
@@ -1829,10 +1748,7 @@ type zmAnalysisReportOrderData struct {
|
|
|
CertNo string `json:"certNo,omitempty"`
|
|
|
ProjectName string `json:"projectName,omitempty"`
|
|
|
BiddingTitle string `json:"biddingTitle,omitempty"`
|
|
|
-<<<<<<< HEAD
|
|
|
-=======
|
|
|
PackType int `json:"packType,omitempty"`
|
|
|
->>>>>>> master
|
|
|
}
|
|
|
|
|
|
func zmAnalysisReportOrder(m map[string]interface{}, userId, productId string) (*OrderInfo, string) {
|
|
@@ -1846,8 +1762,6 @@ func zmAnalysisReportOrder(m map[string]interface{}, userId, productId string) (
|
|
|
//生成订单号
|
|
|
orderCode := pay.GetOrderCode(userId)
|
|
|
order_phone := qu.ObjToString(m["order_phone"])
|
|
|
-<<<<<<< HEAD
|
|
|
-=======
|
|
|
var (
|
|
|
equity string
|
|
|
)
|
|
@@ -1861,7 +1775,6 @@ func zmAnalysisReportOrder(m map[string]interface{}, userId, productId string) (
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
->>>>>>> master
|
|
|
now := time.Now()
|
|
|
report := map[string]interface{}{
|
|
|
"ent_name": params.EntName,
|
|
@@ -1873,11 +1786,8 @@ func zmAnalysisReportOrder(m map[string]interface{}, userId, productId string) (
|
|
|
"bidding_id": params.BiddingId,
|
|
|
"bidding_title": params.BiddingTitle,
|
|
|
"project_name": params.ProjectName,
|
|
|
-<<<<<<< HEAD
|
|
|
-=======
|
|
|
"pack_type": params.PackType,
|
|
|
"equity": equity,
|
|
|
->>>>>>> master
|
|
|
}
|
|
|
filterStr, _ := json.Marshal(report)
|
|
|
packDetail, err := JyPdfExportPack.GetPdfPackDetail(productId)
|
|
@@ -1888,11 +1798,7 @@ func zmAnalysisReportOrder(m map[string]interface{}, userId, productId string) (
|
|
|
OrderMoney: packDetail.Price,
|
|
|
OrderStatus: 0,
|
|
|
ServiceStatus: 0,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: params.Phone,
|
|
|
-=======
|
|
|
- UserPhone: params.Phone,
|
|
|
->>>>>>> master
|
|
|
OrderCode: orderCode,
|
|
|
ProductType: consts.ZmAnalysisReportProductName,
|
|
|
CreateTime: FormatDate(&now, Date_Full_Layout),
|
|
@@ -1923,8 +1829,7 @@ func zmReportCheckParams(m map[string]interface{}, userId string) (*zmAnalysisRe
|
|
|
if !EmailReg.MatchString(email) {
|
|
|
return nil, "数据校验不通过"
|
|
|
}
|
|
|
-<<<<<<< HEAD
|
|
|
-=======
|
|
|
+
|
|
|
number, endTime, _ := ZmAnalysis(userId)
|
|
|
if number > 0 {
|
|
|
return nil, "套餐存在可用权益"
|
|
@@ -1932,7 +1837,6 @@ func zmReportCheckParams(m map[string]interface{}, userId string) (*zmAnalysisRe
|
|
|
if gconv.Int64(m["pack_type"]) > 0 && endTime >= time.Now().Unix() {
|
|
|
return nil, "已购买套餐,请选择单份购买"
|
|
|
}
|
|
|
->>>>>>> master
|
|
|
// todo 待确认是否需要校验其他信息有效性
|
|
|
var certNo, projectName string
|
|
|
entNameSingel := entName
|
|
@@ -2002,10 +1906,6 @@ func zmReportCheckParams(m map[string]interface{}, userId string) (*zmAnalysisRe
|
|
|
BiddingId: biddingId,
|
|
|
ProjectName: projectName,
|
|
|
BiddingTitle: biddingTitle,
|
|
|
-<<<<<<< HEAD
|
|
|
- }
|
|
|
- return returnData, ""
|
|
|
-=======
|
|
|
PackType: gconv.Int(m["pack_type"]),
|
|
|
}
|
|
|
return returnData, ""
|
|
@@ -2036,7 +1936,6 @@ func ZmAnalysis(userId string) (int64, int64, int64) {
|
|
|
}
|
|
|
}
|
|
|
return 0, i_zhima_endtime, i_zhima_status
|
|
|
->>>>>>> master
|
|
|
}
|
|
|
|
|
|
// 中标必听课
|
|
@@ -2088,11 +1987,7 @@ func courseOnlineOrder(m map[string]interface{}, userId string) (*OrderInfo, str
|
|
|
OrderMoney: price,
|
|
|
OrderStatus: 0,
|
|
|
ServiceStatus: 0,
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: order_phone,
|
|
|
-=======
|
|
|
- UserPhone: order_phone,
|
|
|
->>>>>>> master
|
|
|
OrderCode: orderCode,
|
|
|
ProductType: "中标必听课",
|
|
|
CreateTime: FormatDate(&now, Date_Full_Layout),
|
|
@@ -2195,11 +2090,7 @@ func docMemberFirstBuy(m map[string]interface{}, userId string, session *httpses
|
|
|
OriginalPrice: original_price,
|
|
|
UserId: userId,
|
|
|
Filter: string(filterStr),
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: qu.ObjToString(m["order_phone"]),
|
|
|
-=======
|
|
|
- UserPhone: qu.ObjToString(m["order_phone"]),
|
|
|
->>>>>>> master
|
|
|
OrderDetail: g.Map{
|
|
|
"order_code": ordercode,
|
|
|
"product_type": DocMemberProductName,
|
|
@@ -2276,11 +2167,7 @@ func docMemberRenew(m map[string]interface{}, userId string, session *httpsessio
|
|
|
VipType: 1, // 续费
|
|
|
VipStartTime: FormatDate(&startTime, Date_Full_Layout),
|
|
|
VipEndTime: FormatDate(&endTime, Date_Full_Layout),
|
|
|
-<<<<<<< HEAD
|
|
|
PersonPhone: order_phone,
|
|
|
-=======
|
|
|
- UserPhone: order_phone,
|
|
|
->>>>>>> master
|
|
|
OrderDetail: g.Map{
|
|
|
"order_code": ordercode,
|
|
|
"product_type": DocMemberProductName,
|