Browse Source

管理端入库操作人名称解析

zou.yingbin 4 years ago
parent
commit
5dea16c343
1 changed files with 10 additions and 0 deletions
  1. 10 0
      models/ermcpOPLog.go

+ 10 - 0
models/ermcpOPLog.go

@@ -9,6 +9,8 @@ package models
 import (
 	"fmt"
 	"mtp2_if/db"
+	"mtp2_if/mtpcache"
+	"strconv"
 )
 
 // ErmcpOPLogModel 变更变记录
@@ -26,6 +28,13 @@ type ErmcpOPLogModel struct {
 	APPLYNAME          string  `json:"applyname" xorm:"'APPLYNAME'"`            // 操作人名称
 }
 
+func (r *ErmcpOPLogModel) calc() {
+	if r.APPLYNAME == "" {
+		id, _ := strconv.ParseInt(r.APPLYID, 10, 64)
+		r.APPLYNAME = mtpcache.GetSystemmangerLoginCode(id)
+	}
+}
+
 func (r *ErmcpOPLogModel) decodeOperateLogType() {
 	//1:点价价格 2:点价数量 3:结算量 4:其它费用 5:追加保证金 6溢短金额 7:调整金额 8:付款金额 9:收款金额 10:退款金额
 	//11:收票金额 12:开票金额 13:提交审核(合同) 14:审核通过(合同) 15:审核拒绝(合同) 16:合同撤回 17:提交审核(计划)
@@ -67,6 +76,7 @@ func (r *ErmcpOPLogModel) GetData() ([]ErmcpOPLogModel, error) {
 	// 类型解析成中文
 	for i := range sData {
 		sData[i].decodeOperateLogType()
+		sData[i].calc()
 	}
 	return sData, nil
 }