Jelajahi Sumber

fix bug: 客户资料联系电话解密、合同增加附件字段、业务类型描述修改

zou.yingbin 4 tahun lalu
induk
melakukan
6d77c74b36

+ 2 - 2
controllers/ermcp/qryOPApply.go

@@ -178,7 +178,7 @@ func QueryBusinessJsEx(c *gin.Context) {
 			if len(rsp.DETAILJSON) > 0 {
 				if err := json.Unmarshal([]byte(rsp.DETAILJSON), &rd); err == nil{
 					if rd.ReckonRealQty != nil{
-						rsp.ReckonType = "结算量"
+						rsp.ReckonType = "确定量"
 						rsp.ReckonValue = *rd.ReckonRealQty
 						sData = append(sData, rsp)
 					}
@@ -198,7 +198,7 @@ func QueryBusinessJsEx(c *gin.Context) {
 						sData = append(sData, rsp)
 					}
 					if rd.DecMargin != nil{
-						rsp.ReckonType = "减少保证金"
+						rsp.ReckonType = "退还保证金"
 						rsp.ReckonValue = *rd.DecMargin
 						sData = append(sData, rsp)
 					}

+ 8 - 0
docs/docs.go

@@ -9739,6 +9739,10 @@ var doc = `{
                     "description": "账户名称",
                     "type": "string"
                 },
+                "attachment": {
+                    "description": "附件",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
@@ -10082,6 +10086,10 @@ var doc = `{
                     "description": "金额 [1:一口价、3:暂定价]",
                     "type": "number"
                 },
+                "attachment": {
+                    "description": "附件",
+                    "type": "string"
+                },
                 "auditremark": {
                     "description": "审核意见",
                     "type": "string"

+ 8 - 0
docs/swagger.json

@@ -9723,6 +9723,10 @@
                     "description": "账户名称",
                     "type": "string"
                 },
+                "attachment": {
+                    "description": "附件",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
@@ -10066,6 +10070,10 @@
                     "description": "金额 [1:一口价、3:暂定价]",
                     "type": "number"
                 },
+                "attachment": {
+                    "description": "附件",
+                    "type": "string"
+                },
                 "auditremark": {
                     "description": "审核意见",
                     "type": "string"

+ 6 - 0
docs/swagger.yaml

@@ -3251,6 +3251,9 @@ definitions:
       accountname:
         description: 账户名称
         type: string
+      attachment:
+        description: 附件
+        type: string
       audittime:
         description: 审核时间
         type: string
@@ -3506,6 +3509,9 @@ definitions:
       amount:
         description: 金额 [1:一口价、3:暂定价]
         type: number
+      attachment:
+        description: 附件
+        type: string
       auditremark:
         description: 审核意见
         type: string

+ 4 - 0
models/ermcp.go

@@ -54,6 +54,7 @@ type ErmcpSpotContractModel struct {
 	SPOTGOODSBRANDID  int32   `json:"spotgoodsbrandid"  xorm:"'SPOTGOODSBRANDID'"`   // 现货品牌ID
 	BRANDNAME         string  `json:"brandname"  xorm:"'brandname'"`                 // 品牌名称
 	MODELNAME         string  `json:"modelname"  xorm:"'modelname'"`                 // 型号名称
+	ATTACHMENT        string  `json:"attachment"  xorm:"'ATTACHMENT'"`               // 附件
 }
 
 func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
@@ -82,6 +83,7 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
 		"       t.contractmargin," +
 		"       t.remark," +
 		"       t.auditremark," +
+		"       to_char(t.contractattachment) attachment," +
 		"       t.contractstatus," +
 		"       t.SPOTGOODSMODELID," +
 		"       t.SPOTGOODSBRANDID," +
@@ -176,6 +178,7 @@ type ErmcpModel struct {
 	Margin             float64 `json:"margin"  xorm:"'MARGIN'"`                         // 保证金
 	CONTRACTMARGIN     float64 `json:"contractmargin"  xorm:"'CONTRACTMARGIN'"`         // 合同保证金
 	Remark             string  `json:"remark"  xorm:"'Remark'"`                         // 备注
+	ATTACHMENT         string  `json:"attachment"  xorm:"'ATTACHMENT'"`                 // 附件
 	ReckonRealQty      float64 `json:"reckonrealqty"  xorm:"'ReckonRealQty'"`           // 已确定量
 	ReckonOtherAmount  float64 `json:"reckonotheramount"  xorm:"'ReckonOtherAmount'"`   // 其它费用
 	ReckonAdjustAmount float64 `json:"reckonadjustamount"  xorm:"'ReckonAdjustAmount'"` // 调整金额
@@ -236,6 +239,7 @@ func (r *ErmcpModel) buildSql(nContractType, nQueryType int32) string {
 		"       t.producttype," +
 		"       t.contracttype," +
 		"       t.remark," +
+		"       to_char(t.contractattachment) attachment," +
 		"       t.margin," +
 		"       t.contractmargin," +
 		"       u.accountname," +

+ 19 - 3
models/ermcpExposure.go

@@ -180,8 +180,14 @@ func (r *ErmcpExposureDetailModel) buildSql() string {
 
 // 处理数据
 func (r *ErmcpExposureDetailModel) Calc() {
-	if r.Contracttype == -1{
-		// 销售的变动量转换为负数
+	// 销售合同转换为负数
+	if r.Logtype == 2 && r.Contracttype == -1 {
+		r.ChangeQty *= -1
+		r.Qty *= -1
+	}
+
+	// 采购计划 转换为负数
+	if r.Logtype == 1 && r.Contracttype == 1 {
 		r.ChangeQty *= -1
 		r.Qty *= -1
 	}
@@ -336,8 +342,18 @@ func (r *ErmcpAreaSpotDetailModel) Calc() {
 		contractTypeName = "采购"
 	} else {
 		contractTypeName = "销售"
+	}
+
+	// 销售合同 数量转为负数
+	if r.LogType == 2 && r.Contracttype == -1 {
+		if r.Qty > 0 {
+			r.Qty = r.Qty * -1
+		}
+	}
+
+	// 采购计划 数量转为负数
+	if r.LogType == 1 && r.Contracttype == 1 {
 		if r.Qty > 0 {
-			// 销售的数量转为负数
 			r.Qty = r.Qty * -1
 		}
 	}

+ 1 - 0
models/ermcpUser.go

@@ -115,6 +115,7 @@ func (r *ErmcpUserModel) DecryptField(decryptAddress bool) {
 
 	r.CARDNUM = fd(r.CARDNUM)
 	r.MOBILE = fd(r.MOBILE)
+	r.TELPHONE = fd(r.TELPHONE)
 
 	if decryptAddress {
 		r.ADDRESS = fd(r.ADDRESS)