|
@@ -288,11 +288,11 @@ type CustomerInfo struct {
|
|
|
|
|
|
|
|
// QuerySpotContractAppleFormRsp 查询合同申请表单数据返回模型
|
|
// QuerySpotContractAppleFormRsp 查询合同申请表单数据返回模型
|
|
|
type QuerySpotContractAppleFormRsp struct {
|
|
type QuerySpotContractAppleFormRsp struct {
|
|
|
- OurUser CustomerInfo `json:"ouruser"` // 我方账号
|
|
|
|
|
- OppositeUsers []CustomerInfo `json:"oppositeusers"` // 对方账号列表
|
|
|
|
|
- WrStandards []models.Wrstandard `json:"wrstandards"` // 仓单标准列表
|
|
|
|
|
- WareHouseInfos []models.Warehouseinfo `json:"warehouseinfos"` // 仓库信息列表
|
|
|
|
|
- Goodses []models.GoodsInfo `json:"goodses"` // 合约列表
|
|
|
|
|
|
|
+ OurUser CustomerInfo `json:"ouruser"` // 我方账号
|
|
|
|
|
+ OppositeUsers []CustomerInfo `json:"oppositeusers"` // 对方账号列表
|
|
|
|
|
+ WrStandards []models.Wrstandard `json:"wrstandards"` // 仓单标准列表
|
|
|
|
|
+ WareHouseInfos []models.Warehouseinfo `json:"warehouseinfos"` // 仓库信息列表
|
|
|
|
|
+ Goodses []models.GoodsIDAndName `json:"goodses"` // 合约列表
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// QuerySpotContractAppleForm 查询合同申请表单数据
|
|
// QuerySpotContractAppleForm 查询合同申请表单数据
|
|
@@ -327,10 +327,13 @@ func QuerySpotContractAppleForm(c *gin.Context) {
|
|
|
}
|
|
}
|
|
|
rsp.OurUser.Userid = ourUser.Userid
|
|
rsp.OurUser.Userid = ourUser.Userid
|
|
|
rsp.OurUser.Customername = ourUser.Customername
|
|
rsp.OurUser.Customername = ourUser.Customername
|
|
|
- key, _ := hex.DecodeString(utils.AESSecretKey) // 手机号码解密
|
|
|
|
|
- if phonenum, err := hex.DecodeString(ourUser.Mobile); err == nil { // hex -> []byte
|
|
|
|
|
- if mobile, err := utils.AESDecrypt(phonenum, key); err == nil {
|
|
|
|
|
- rsp.OurUser.Mobile = string(mobile)
|
|
|
|
|
|
|
+ key, _ := hex.DecodeString(utils.AESSecretKey)
|
|
|
|
|
+ if len(ourUser.Mobile) > 0 {
|
|
|
|
|
+ // 手机号码解密
|
|
|
|
|
+ if phonenum, err := hex.DecodeString(ourUser.Mobile); err == nil { // hex -> []byte
|
|
|
|
|
+ if mobile, err := utils.AESDecrypt(phonenum, key); err == nil {
|
|
|
|
|
+ rsp.OurUser.Mobile = string(mobile)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
taAccounts, err := models.GetTaAccountsByType(req.UserID, 3) // 获取内部资金账户,现货都使用内部资金账户
|
|
taAccounts, err := models.GetTaAccountsByType(req.UserID, 3) // 获取内部资金账户,现货都使用内部资金账户
|
|
@@ -363,6 +366,14 @@ func QuerySpotContractAppleForm(c *gin.Context) {
|
|
|
userInfo := CustomerInfo{}
|
|
userInfo := CustomerInfo{}
|
|
|
userInfo.Userid = v.Userid
|
|
userInfo.Userid = v.Userid
|
|
|
userInfo.Customername = v.Customername
|
|
userInfo.Customername = v.Customername
|
|
|
|
|
+ if len(v.Mobile) > 0 {
|
|
|
|
|
+ // 手机号码解密
|
|
|
|
|
+ if phonenum, err := hex.DecodeString(v.Mobile); err == nil { // hex -> []byte
|
|
|
|
|
+ if mobile, err := utils.AESDecrypt(phonenum, key); err == nil {
|
|
|
|
|
+ userInfo.Mobile = string(mobile)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// 获取客户的资金账户列表
|
|
// 获取客户的资金账户列表
|
|
|
opposTaAccounts, err := models.GetTaAccountsByType(int(v.Userid), 3) // 获取内部资金账户,现货都使用内部资金账户
|
|
opposTaAccounts, err := models.GetTaAccountsByType(int(v.Userid), 3) // 获取内部资金账户,现货都使用内部资金账户
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -402,7 +413,7 @@ func QuerySpotContractAppleForm(c *gin.Context) {
|
|
|
rsp.WareHouseInfos = wareHouseInfos
|
|
rsp.WareHouseInfos = wareHouseInfos
|
|
|
|
|
|
|
|
// 获取合约信息
|
|
// 获取合约信息
|
|
|
- rsp.Goodses = make([]models.GoodsInfo, 0)
|
|
|
|
|
|
|
+ rsp.Goodses = make([]models.GoodsIDAndName, 0)
|
|
|
goodses, err := models.GetGoodsInfosByTradeModes("15")
|
|
goodses, err := models.GetGoodsInfosByTradeModes("15")
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
// 查询失败
|
|
// 查询失败
|