1
This commit is contained in:
@@ -17,7 +17,7 @@ func ApplyContract(callback *lakala.ApplyContractCallBack) error {
|
|||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
)
|
)
|
||||||
if callback.Code == "000000" {
|
if callback.Code == "000000" {
|
||||||
merchantInfo, err := dao.GetStoreContract(db, 0, callback.RespData.OrderNo)
|
merchantInfo, err := dao.GetStoreContract(db, 0, callback.RespData.OrderNo, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ func CreateSeparateShop(callback *lakala.SeparateCallback) error {
|
|||||||
var (
|
var (
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
)
|
)
|
||||||
merchantInfo, err := dao.GetStoreInfoByMerchantID(db, callback.MerCupNo, 0, callback.ApplyId, "")
|
merchantInfo, err := dao.GetStoreInfoByMerchantID(db, callback.MerCupNo, 0, utils.Int64ToStr(callback.ApplyId), "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,10 +43,29 @@ func LaKaLaApplyContract(ctx *jxcontext.Context, apply *lakala.ApplyContractPara
|
|||||||
return contractObj, nil
|
return contractObj, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LaKaLaApplyContractByPeople 生气人工审核 ApplyElectronicContractByPeople
|
||||||
|
func LaKaLaApplyContractByPeople(storeId int, apply *lakala.ApplyContractByPeople) (string, error) {
|
||||||
|
apply.OrderNo = lakala.GetOrderNumber(8)
|
||||||
|
apply.RetUrl = lakala.ApplyContractCallback
|
||||||
|
err := api.LaKaLaApi.ApplyElectronicContractByPeople(apply)
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("申请人工审核失败:%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
contract, err := dao.GetStoreContract(dao.GetDB(), storeId, "", utils.Int64ToStr(apply.EcApplyId))
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
contract.ContractStatus = "people"
|
||||||
|
dao.UpdateEntity(dao.GetDB(), contract, "ContractStatus")
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
// QueryElectronicContract 拉卡拉签约合同查询
|
// QueryElectronicContract 拉卡拉签约合同查询
|
||||||
func QueryElectronicContract(orderNo string, orgId int, ecApplyId string, storeID int) (*lakala.ElectronicContractStatus, error) {
|
func QueryElectronicContract(orderNo string, orgId int, ecApplyId string, storeID int) (*lakala.ElectronicContractStatus, error) {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
merchantInfo, err := dao.GetStoreContract(db, storeID, orderNo)
|
merchantInfo, err := dao.GetStoreContract(db, storeID, orderNo, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetStoreContract(db *DaoDB, storeId int, orderId string) (*model.LakalaContract, error) {
|
func GetStoreContract(db *DaoDB, storeId int, orderId string, contractApplyId string) (*model.LakalaContract, error) {
|
||||||
merchantObj := &model.LakalaContract{}
|
merchantObj := &model.LakalaContract{}
|
||||||
param := []interface{}{}
|
param := []interface{}{}
|
||||||
sql := ` SELECT * FROM lakala_contract WHERE 1=1`
|
sql := ` SELECT * FROM lakala_contract WHERE 1=1`
|
||||||
@@ -21,6 +21,12 @@ func GetStoreContract(db *DaoDB, storeId int, orderId string) (*model.LakalaCont
|
|||||||
sql += ` AND contract_id = ?`
|
sql += ` AND contract_id = ?`
|
||||||
param = append(param, orderId)
|
param = append(param, orderId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if contractApplyId != "" {
|
||||||
|
sql += ` AND contract_apply_id = ?`
|
||||||
|
param = append(param, contractApplyId)
|
||||||
|
}
|
||||||
|
|
||||||
if err := GetRow(db, merchantObj, sql, param...); err != nil {
|
if err := GetRow(db, merchantObj, sql, param...); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,28 @@ func (c *LaKaLaController) LaKaLaApplyContract() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LaKaLaApplyContractByPeople 拉卡拉商户合同申请,人工审核
|
||||||
|
// @Title 拉卡拉商户合同申请,人工审核
|
||||||
|
// @Description 拉卡拉商户合同申请,人工审核
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param payload formData string true "json数据,lakala.ApplyContractByPeople 对象"
|
||||||
|
// @Param storeID formData int true "门店ID"
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /LaKaLaApplyContractByPeople [post]
|
||||||
|
func (c *LaKaLaController) LaKaLaApplyContractByPeople() {
|
||||||
|
c.callLaKaLaApplyContractByPeople(func(params *tLakalaLaKaLaApplyContractByPeopleParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
contract := &lakala.ApplyContractByPeople{}
|
||||||
|
err = utils.UnmarshalUseNumber([]byte(params.Payload), contract)
|
||||||
|
if err != nil {
|
||||||
|
return retVal, "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
retVal, err = lakalaServer.LaKaLaApplyContractByPeople(params.StoreID, contract)
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// QueryElectronicContract 合同申请状态查询
|
// QueryElectronicContract 合同申请状态查询
|
||||||
// @Title 合同申请状态查询
|
// @Title 合同申请状态查询
|
||||||
// @Description 合同申请状态查询
|
// @Description 合同申请状态查询
|
||||||
|
|||||||
@@ -4699,6 +4699,15 @@ func init() {
|
|||||||
MethodParams: param.Make(),
|
MethodParams: param.Make(),
|
||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
// lakala商户进件合同申请人工审核
|
||||||
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:LaKaLaController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:LaKaLaController"],
|
||||||
|
web.ControllerComments{
|
||||||
|
Method: "LaKaLaApplyContractByPeople",
|
||||||
|
Router: `/LaKaLaApplyContractByPeople`,
|
||||||
|
AllowHTTPMethods: []string{"post"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
// lakala商户进件合同申请审核查询
|
// lakala商户进件合同申请审核查询
|
||||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:LaKaLaController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:LaKaLaController"],
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:LaKaLaController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:LaKaLaController"],
|
||||||
web.ControllerComments{
|
web.ControllerComments{
|
||||||
|
|||||||
Reference in New Issue
Block a user