Merge remote-tracking branch 'origin/mark' into jdshop
This commit is contained in:
@@ -82,6 +82,12 @@ func PrintOrderByOrder4Store(ctx *jxcontext.Context, order *model.GoodsOrder, st
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
storeDetail, _ := dao.GetStoreDetail(db, storeID, order.VendorID, order.VendorOrgCode)
|
storeDetail, _ := dao.GetStoreDetail(db, storeID, order.VendorID, order.VendorOrgCode)
|
||||||
|
if storeDetail == nil && order.VendorOrderID == testVendorOrderID {
|
||||||
|
storeDetail = &dao.StoreDetail{
|
||||||
|
BrandName: testVendorOrderID,
|
||||||
|
BrandIsPrint: model.NO,
|
||||||
|
}
|
||||||
|
}
|
||||||
printResult, err = handler.PrintOrder(ctx, store, storeDetail, order)
|
printResult, err = handler.PrintOrder(ctx, store, storeDetail, order)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
dao.SetOrderPrintFlag(db, ctx.GetUserName(), order.VendorOrderID, order.VendorID, true)
|
dao.SetOrderPrintFlag(db, ctx.GetUserName(), order.VendorOrderID, order.VendorID, true)
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
getCode = fmt.Sprintf("<B>饿百取货码:%s</B><BR><BR>\n", jxutils.GetEbaiOrderGetCode(order))
|
getCode = fmt.Sprintf("<B>饿百取货码:%s</B><BR><BR>\n", jxutils.GetEbaiOrderGetCode(order))
|
||||||
}
|
}
|
||||||
orderFmt := ``
|
orderFmt := ``
|
||||||
|
if storeDetail != nil {
|
||||||
if storeDetail.BrandIsPrint == model.NO {
|
if storeDetail.BrandIsPrint == model.NO {
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
<CB>%s</CB><BR><BR>
|
<CB>%s</CB><BR><BR>
|
||||||
@@ -50,6 +51,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
orderParams = append(orderParams, storeDetail.BrandName)
|
orderParams = append(orderParams, storeDetail.BrandName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
<C>手机买菜上京西</C><BR>
|
<C>手机买菜上京西</C><BR>
|
||||||
<C>极速到家送惊喜</C><BR>
|
<C>极速到家送惊喜</C><BR>
|
||||||
@@ -124,6 +126,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
|
|||||||
}
|
}
|
||||||
orderParams := []interface{}{}
|
orderParams := []interface{}{}
|
||||||
orderFmt := ``
|
orderFmt := ``
|
||||||
|
if storeDetail != nil {
|
||||||
if storeDetail.BrandIsPrint == model.NO {
|
if storeDetail.BrandIsPrint == model.NO {
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
<CB>%s</CB><BR><BR>
|
<CB>%s</CB><BR><BR>
|
||||||
@@ -134,6 +137,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
|
|||||||
orderParams = append(orderParams, storeDetail.BrandName)
|
orderParams = append(orderParams, storeDetail.BrandName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
<C>手机买菜上京西</C><BR>
|
<C>手机买菜上京西</C><BR>
|
||||||
<C>极速到家送惊喜</C><BR>
|
<C>极速到家送惊喜</C><BR>
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
}
|
}
|
||||||
orderParams := []interface{}{}
|
orderParams := []interface{}{}
|
||||||
orderFmt := ``
|
orderFmt := ``
|
||||||
|
if storeDetail != nil {
|
||||||
if storeDetail.BrandIsPrint == model.NO {
|
if storeDetail.BrandIsPrint == model.NO {
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
<FS2><center>%s</center></FS2>\n\n
|
<FS2><center>%s</center></FS2>\n\n
|
||||||
@@ -49,6 +50,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
orderParams = append(orderParams, storeDetail.BrandName)
|
orderParams = append(orderParams, storeDetail.BrandName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
<center>手机买菜上京西</center>
|
<center>手机买菜上京西</center>
|
||||||
<center>极速到家送惊喜</center>\n
|
<center>极速到家送惊喜</center>\n
|
||||||
@@ -117,6 +119,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
|
|||||||
}
|
}
|
||||||
orderParams := []interface{}{}
|
orderParams := []interface{}{}
|
||||||
orderFmt := ``
|
orderFmt := ``
|
||||||
|
if storeDetail != nil {
|
||||||
if storeDetail.BrandIsPrint == model.NO {
|
if storeDetail.BrandIsPrint == model.NO {
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
<FS2><center>%s</center></FS2>\n\n
|
<FS2><center>%s</center></FS2>\n\n
|
||||||
@@ -127,6 +130,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
|
|||||||
orderParams = append(orderParams, storeDetail.BrandName)
|
orderParams = append(orderParams, storeDetail.BrandName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
<center>手机买菜上京西</center>
|
<center>手机买菜上京西</center>
|
||||||
<center>极速到家送惊喜</center>\n
|
<center>极速到家送惊喜</center>\n
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
}
|
}
|
||||||
orderParams := []interface{}{}
|
orderParams := []interface{}{}
|
||||||
orderFmt := ``
|
orderFmt := ``
|
||||||
|
if storeDetail != nil {
|
||||||
if storeDetail.BrandIsPrint == model.NO {
|
if storeDetail.BrandIsPrint == model.NO {
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
<S2><C>%s</C></S2><RN><RN>
|
<S2><C>%s</C></S2><RN><RN>
|
||||||
@@ -50,6 +51,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
orderParams = append(orderParams, storeDetail.BrandName)
|
orderParams = append(orderParams, storeDetail.BrandName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
<C>手机买菜上京西</C>
|
<C>手机买菜上京西</C>
|
||||||
<C>极速到家送惊喜</C><RN>
|
<C>极速到家送惊喜</C><RN>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EbaiSupplierIDsc = "1486975681715"
|
EbaiSupplierIDsc = "1921188187760"
|
||||||
EbaiSupplierIDc4 = "22267134648"
|
EbaiSupplierIDc4 = "22267134648"
|
||||||
EbaiSupplierIDhc = "2233065879"
|
EbaiSupplierIDhc = "2233065879"
|
||||||
EbaiSupplierIDgy = "2267230126"
|
EbaiSupplierIDgy = "2267230126"
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ var (
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
BusinessFormID: 1672214913,
|
BusinessFormID: 1672214913,
|
||||||
BrandName: "京西到家便利店",
|
BrandName: "京西到家",
|
||||||
},
|
},
|
||||||
EbaiSupplierIDhc: &tEbaiSupplierInfo{
|
EbaiSupplierIDhc: &tEbaiSupplierInfo{
|
||||||
SupplierID: EbaiSupplierIDhc,
|
SupplierID: EbaiSupplierIDhc,
|
||||||
|
|||||||
@@ -433,26 +433,33 @@ func genSkuParamsFromStoreSkuInfo2(storeSku *dao.StoreSkuSyncInfo, isCreate, isE
|
|||||||
if !isExd {
|
if !isExd {
|
||||||
var categoryID = utils.Str2Int64(storeSku.VendorCatID)
|
var categoryID = utils.Str2Int64(storeSku.VendorCatID)
|
||||||
if ebaiExSkuCatMap[storeSku.SkuID] != 0 {
|
if ebaiExSkuCatMap[storeSku.SkuID] != 0 {
|
||||||
store, _ := dao.GetStoreDetail(dao.GetDB(), storeSku.StoreID, model.VendorIDEBAI, "")
|
if store, err := dao.GetStoreDetail(dao.GetDB(), storeSku.StoreID, model.VendorIDEBAI, ""); err == nil && store != nil {
|
||||||
if store.CityCode == 510100 {
|
if store.CityCode == 510100 {
|
||||||
s, _ := dao.GetStoreSkuCategoryMap(dao.GetDB(), 439, storeSku.StoreID)
|
if s, err2 := dao.GetStoreSkuCategoryMap(dao.GetDB(), 439, storeSku.StoreID); err2 == nil && s != nil {
|
||||||
categoryID = s.EbaiID
|
categoryID = s.EbaiID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if ebaiExSkuCatMap2[storeSku.SkuID] != 0 {
|
if ebaiExSkuCatMap2[storeSku.SkuID] != 0 {
|
||||||
store, _ := dao.GetStoreDetail(dao.GetDB(), storeSku.StoreID, model.VendorIDEBAI, "")
|
if store, err := dao.GetStoreDetail(dao.GetDB(), storeSku.StoreID, model.VendorIDEBAI, ""); err == nil && store != nil {
|
||||||
if store.CityCode == 510100 {
|
if store.CityCode == 510100 {
|
||||||
s, _ := dao.GetStoreSkuCategoryMap(dao.GetDB(), 440, storeSku.StoreID)
|
if s, err2 := dao.GetStoreSkuCategoryMap(dao.GetDB(), 440, storeSku.StoreID); err2 == nil && s != nil {
|
||||||
categoryID = s.EbaiID
|
categoryID = s.EbaiID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if ebaiExSkuCatMap3[storeSku.SkuID] != 0 {
|
if ebaiExSkuCatMap3[storeSku.SkuID] != 0 {
|
||||||
store, _ := dao.GetStoreDetail(dao.GetDB(), storeSku.StoreID, model.VendorIDEBAI, "")
|
if store, err := dao.GetStoreDetail(dao.GetDB(), storeSku.StoreID, model.VendorIDEBAI, ""); err == nil && store != nil {
|
||||||
if store.CityCode == 510100 {
|
if store.CityCode == 510100 {
|
||||||
s, _ := dao.GetStoreSkuCategoryMap(dao.GetDB(), 175, storeSku.StoreID)
|
if s, err2 := dao.GetStoreSkuCategoryMap(dao.GetDB(), 175, storeSku.StoreID); err2 == nil && s != nil {
|
||||||
categoryID = s.EbaiID
|
categoryID = s.EbaiID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
params["category_id"] = categoryID
|
params["category_id"] = categoryID
|
||||||
params["name"] = utils.LimitMixedStringLen(storeSku.SkuName, ebaiapi.MaxSkuNameByteCount)
|
params["name"] = utils.LimitMixedStringLen(storeSku.SkuName, ebaiapi.MaxSkuNameByteCount)
|
||||||
params["cat3_id"] = getEbaiCat(storeSku.VendorVendorCatID)
|
params["cat3_id"] = getEbaiCat(storeSku.VendorVendorCatID)
|
||||||
|
|||||||
@@ -24,10 +24,28 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
opTimeErrReg = regexp.MustCompile(`当前配送营业时间为:([\d:~,]*)`)
|
opTimeErrReg = regexp.MustCompile(`当前配送营业时间为:([\d:~,]*)`)
|
||||||
storeVendorOrgCodeMap = map[string]string{
|
storeVendorOrgCodeMap = map[string]map[string]string{
|
||||||
"589": mtwmapi.MtwmC4Tag,
|
"589": map[string]string{
|
||||||
"5873": mtwmapi.MtwmSCTag,
|
"firstTag": mtwmapi.MtwmC4Tag, //经营品类
|
||||||
"4123": mtwmapi.MtwmSGTag,
|
"settlementID": "7030017", //结算ID
|
||||||
|
"poiCert": "1,5", //资质列表
|
||||||
|
},
|
||||||
|
"5873": map[string]string{
|
||||||
|
"firstTag": mtwmapi.MtwmSCTag,
|
||||||
|
"settlementID": "",
|
||||||
|
"poiCert": "1,2,5,6",
|
||||||
|
},
|
||||||
|
"4123": map[string]string{
|
||||||
|
"firstTag": mtwmapi.MtwmSGTag,
|
||||||
|
"settlementID": "6572945",
|
||||||
|
"poiCert": "1,5",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
poiCertMap = map[string]string{
|
||||||
|
"1": "门脸图",
|
||||||
|
"2": "环境图",
|
||||||
|
"5": "营业执照",
|
||||||
|
"6": "食品经营许可证",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -124,24 +142,24 @@ func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
|
|||||||
shippingTime += jxutils.JxOperationTime2StrTime(storeDetail.CloseTime2)
|
shippingTime += jxutils.JxOperationTime2StrTime(storeDetail.CloseTime2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
vendorInfoMap := storeVendorOrgCodeMap[vendorOrgCode]
|
||||||
poiSettleSaveParam := &mtwmapi.PoiSettleSaveParam{
|
poiSettleSaveParam := &mtwmapi.PoiSettleSaveParam{
|
||||||
Type: 0, //创建
|
Type: 0, //创建
|
||||||
ApplyInfos: []*mtwmapi.ApplyInfo{
|
ApplyInfos: []*mtwmapi.ApplyInfo{
|
||||||
&mtwmapi.ApplyInfo{
|
&mtwmapi.ApplyInfo{
|
||||||
AppPoiCode: utils.Int2Str(storeDetail.ID),
|
AppPoiCode: utils.Int2Str(storeDetail.ID),
|
||||||
SettlementID: 0, //结算ID,暂时还没得
|
SettlementID: utils.Str2Int(vendorInfoMap["settlementID"]), //结算ID,暂时还没得
|
||||||
MultiPoiBasicInfo: &mtwmapi.MultiPoiBasicInfo{
|
MultiPoiBasicInfo: &mtwmapi.MultiPoiBasicInfo{
|
||||||
Name: params["vendorStoreName"].(string),
|
Name: params["vendorStoreName"].(string),
|
||||||
City: cityName,
|
City: cityName,
|
||||||
Address: storeDetail.Address,
|
Address: storeDetail.Address,
|
||||||
Longitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng)),
|
Longitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng)),
|
||||||
Latitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat)),
|
Latitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat)),
|
||||||
FirstTag: storeVendorOrgCodeMap[vendorOrgCode],
|
FirstTag: vendorInfoMap["firstTag"],
|
||||||
CallCenter: storeDetail.Tel1,
|
CallCenter: storeDetail.Tel1,
|
||||||
ContactPhone: storeDetail.Tel1,
|
ContactPhone: storeDetail.Tel1,
|
||||||
ContactName: storeDetail.IDName,
|
ContactName: storeDetail.IDName,
|
||||||
EcommerceAccountPhone: "18048531223",
|
EcommerceAccountPhone: "18048531223", //石总的手机
|
||||||
ShippingTime: shippingTime,
|
ShippingTime: shippingTime,
|
||||||
},
|
},
|
||||||
MultiPoiShippingInfo: &mtwmapi.MultiPoiShippingInfo{
|
MultiPoiShippingInfo: &mtwmapi.MultiPoiShippingInfo{
|
||||||
@@ -153,8 +171,52 @@ func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
switchCertType := func(certType string) (licensePic, licenseSocialCreditCode, licenseNumber, licenseLegalPerson, licenseAddress, licenseValidStartDate, licenseValidity string, isLongTime int) {
|
||||||
|
switch certType {
|
||||||
|
case "1":
|
||||||
|
licensePic = storeDetail.StoreFrontPic
|
||||||
|
case "2":
|
||||||
|
licensePic = storeDetail.StoreInPic
|
||||||
|
case "5":
|
||||||
|
licensePic = storeDetail.Licence
|
||||||
|
licenseSocialCreditCode = storeDetail.LicenceCode
|
||||||
|
licenseNumber = storeDetail.LicenceCode
|
||||||
|
licenseLegalPerson = storeDetail.LicenceOwnerName
|
||||||
|
licenseAddress = storeDetail.LicenceAddress
|
||||||
|
licenseValidStartDate = storeDetail.LicenceValid
|
||||||
|
if storeDetail.LicenceExpire == "" {
|
||||||
|
isLongTime = 1
|
||||||
|
} else {
|
||||||
|
licenseValidity = storeDetail.LicenceExpire
|
||||||
|
}
|
||||||
|
case "6":
|
||||||
|
licensePic = storeDetail.Licence2Image
|
||||||
|
licenseSocialCreditCode = storeDetail.Licence2Code
|
||||||
|
licenseNumber = storeDetail.Licence2Code
|
||||||
|
licenseLegalPerson = storeDetail.LicenceOwnerName
|
||||||
|
licenseAddress = storeDetail.LicenceAddress
|
||||||
|
licenseValidStartDate = storeDetail.Licence2Valid
|
||||||
|
if storeDetail.Licence2Expire == "" {
|
||||||
|
isLongTime = 1
|
||||||
|
} else {
|
||||||
|
licenseValidity = storeDetail.Licence2Expire
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return licensePic, licenseSocialCreditCode, licenseNumber, licenseLegalPerson, licenseAddress, licenseValidStartDate, licenseValidity, isLongTime
|
||||||
|
}
|
||||||
|
var certs []*mtwmapi.MultiPoiCertInfo
|
||||||
|
for _, v := range strings.Split(vendorInfoMap["poiCert"], ",") {
|
||||||
|
cert := &mtwmapi.MultiPoiCertInfo{
|
||||||
|
Type: utils.Str2Int(v),
|
||||||
|
LicenseName: poiCertMap[v],
|
||||||
|
}
|
||||||
|
cert.LicensePic, cert.LicenseSocialCreditCode, cert.LicenseNumber, cert.LicenseLegalPerson, cert.LicenseAddress, cert.LicenseValidStartDate, cert.LicenseValidity, cert.IsLongTime = switchCertType(v)
|
||||||
|
certs = append(certs, cert)
|
||||||
|
}
|
||||||
mtapi := getAPIWithoutToken(storeDetail.VendorOrgCode)
|
mtapi := getAPIWithoutToken(storeDetail.VendorOrgCode)
|
||||||
mtapi.PoiSettleSave(poiSettleSaveParam)
|
if vendorStoreID, err = mtapi.PoiSettleSave(poiSettleSaveParam); err == nil {
|
||||||
|
err = mtapi.PoiSettleAuditSubmit([]string{vendorStoreID})
|
||||||
|
}
|
||||||
return vendorStoreID, err
|
return vendorStoreID, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user