|
|
@@ -48,7 +48,7 @@ type KxData struct {
|
|
|
}
|
|
|
|
|
|
// 获取款项类型,1-收付款(PayAmount字段有值) 2-退款(DeductAmount字段有值) 3-收付款/退款(2个字段都有)
|
|
|
-func (r *KxData) CalcKxType(contractType int32) {
|
|
|
+func (r *KxData) CalcKxType() {
|
|
|
if r.PayAmount != nil && r.DeductAmount != nil {
|
|
|
r.KxType = 3
|
|
|
} else if r.PayAmount != nil {
|
|
|
@@ -65,8 +65,9 @@ type KpData struct {
|
|
|
|
|
|
// 查询合同操作请求
|
|
|
type QryOPApplyReq struct {
|
|
|
- UserId int64 `form:"UserId" binding:"required"` //用户ID
|
|
|
- RelatedId string `form:"relatedid" binding:"required"` //现货合同ID, 不填则查所有
|
|
|
+ UserId int64 `form:"UserId" binding:"required"` //用户ID
|
|
|
+ RelatedId string `form:"relatedid" binding:"required"` //现货合同ID, 不填则查所有
|
|
|
+ OperateapplyId string `form:"operateapplyid"` //操作申请id
|
|
|
}
|
|
|
|
|
|
// 查询业务管理/点价应答
|
|
|
@@ -121,6 +122,7 @@ type QryBussinessJsRsp struct {
|
|
|
// @Security ApiKeyAuth
|
|
|
// @Param UserId query int true "用户ID"
|
|
|
// @Param relatedid query string false "现货合同ID, 不填则查所有"
|
|
|
+// @Param operateapplyid query string false "操作申请id"
|
|
|
// @Success 200 {array} QryBussinessJsRsp
|
|
|
// @Failure 500 {object} app.Response
|
|
|
// @Router /Ermcp/QueryBusinessJs [get]
|
|
|
@@ -129,7 +131,7 @@ func QueryBusinessJs(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|
|
|
var req QryOPApplyReq
|
|
|
_ = c.ShouldBind(&req)
|
|
|
- m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId}
|
|
|
+ m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId, OPERATEAPPLYID: req.OperateapplyId}
|
|
|
if d, err := m.GetData(2); err == nil {
|
|
|
//构建应答数据
|
|
|
sData := make([]QryBussinessJsRsp, 0)
|
|
|
@@ -176,33 +178,33 @@ func QueryBusinessJsEx(c *gin.Context) {
|
|
|
var rd ReckonData
|
|
|
rsp.ErmcpOPApplyModel = v
|
|
|
if len(rsp.DETAILJSON) > 0 {
|
|
|
- if err := json.Unmarshal([]byte(rsp.DETAILJSON), &rd); err == nil{
|
|
|
- if rd.ReckonRealQty != nil{
|
|
|
+ if err := json.Unmarshal([]byte(rsp.DETAILJSON), &rd); err == nil {
|
|
|
+ if rd.ReckonRealQty != nil {
|
|
|
rsp.ReckonType = "确定量"
|
|
|
rsp.ReckonValue = *rd.ReckonRealQty
|
|
|
sData = append(sData, rsp)
|
|
|
}
|
|
|
- if rd.ReckonOtherAmount != nil{
|
|
|
+ if rd.ReckonOtherAmount != nil {
|
|
|
rsp.ReckonType = "其它费用"
|
|
|
rsp.ReckonValue = *rd.ReckonOtherAmount
|
|
|
sData = append(sData, rsp)
|
|
|
}
|
|
|
- if rd.ReckonAdjustAmount != nil{
|
|
|
+ if rd.ReckonAdjustAmount != nil {
|
|
|
rsp.ReckonType = "调整金额"
|
|
|
rsp.ReckonValue = *rd.ReckonAdjustAmount
|
|
|
sData = append(sData, rsp)
|
|
|
}
|
|
|
- if rd.AddMargin != nil{
|
|
|
+ if rd.AddMargin != nil {
|
|
|
rsp.ReckonType = "追加保证金"
|
|
|
rsp.ReckonValue = *rd.AddMargin
|
|
|
sData = append(sData, rsp)
|
|
|
}
|
|
|
- if rd.DecMargin != nil{
|
|
|
+ if rd.DecMargin != nil {
|
|
|
rsp.ReckonType = "退还保证金"
|
|
|
rsp.ReckonValue = *rd.DecMargin
|
|
|
sData = append(sData, rsp)
|
|
|
}
|
|
|
- if rd.ReckonOsAmount != nil{
|
|
|
+ if rd.ReckonOsAmount != nil {
|
|
|
rsp.ReckonType = "溢短金额"
|
|
|
rsp.ReckonValue = *rd.ReckonOsAmount
|
|
|
sData = append(sData, rsp)
|
|
|
@@ -245,7 +247,7 @@ func QueryBusinessKx(c *gin.Context) {
|
|
|
rsp.ErmcpOPApplyModel = v
|
|
|
if len(rsp.DETAILJSON) > 0 {
|
|
|
if err := json.Unmarshal([]byte(rsp.DETAILJSON), &rsp.KxData); err == nil {
|
|
|
- rsp.KxData.CalcKxType(rsp.CONTRACTTYPE)
|
|
|
+ rsp.KxData.CalcKxType()
|
|
|
sData = append(sData, rsp)
|
|
|
}
|
|
|
}
|