|
@@ -441,11 +441,11 @@ var (
|
|
|
"channelPhone": "联系电话",
|
|
|
"winner": "中标单位",
|
|
|
}
|
|
|
- BidTypeMap = map[int]interface{}{
|
|
|
+ BidTypeMap = map[int]string{
|
|
|
BidTypeDirect: "直接投标",
|
|
|
BidTypeChanel: "渠道投标",
|
|
|
}
|
|
|
- WinMap = map[int]interface{}{
|
|
|
+ WinMap = map[int]string{
|
|
|
1: "是",
|
|
|
2: "否",
|
|
|
0: "未选择",
|
|
@@ -454,11 +454,16 @@ var (
|
|
|
|
|
|
// 处理操作记录
|
|
|
func processRecordStr(oldMap, newMap map[string]interface{}) (recordContent string, err error) {
|
|
|
- actonStr := "%s%s%s"
|
|
|
- changeField := []string{}
|
|
|
- result := []string{}
|
|
|
+ var (
|
|
|
+ actonStr = "%s%s%s"
|
|
|
+ changeField = []string{}
|
|
|
+ result = []string{}
|
|
|
+ changeMap = map[string]interface{}{}
|
|
|
+ )
|
|
|
for k, fieldName := range ParticipateBidContentKey {
|
|
|
- changeStr := ""
|
|
|
+ var (
|
|
|
+ status, value, changeStr string
|
|
|
+ )
|
|
|
switch k {
|
|
|
case "bidType":
|
|
|
oldv := common.IntAll(oldMap[k])
|
|
@@ -467,12 +472,15 @@ func processRecordStr(oldMap, newMap map[string]interface{}) (recordContent stri
|
|
|
continue
|
|
|
}
|
|
|
newBidType := BidTypeMap[newv]
|
|
|
- if newBidType == nil {
|
|
|
+ if newBidType == "" {
|
|
|
newBidType = "未选择"
|
|
|
}
|
|
|
+ value = newBidType
|
|
|
if oldv == 0 && newv != 0 { // 说明是新增
|
|
|
+ status = "新增"
|
|
|
changeStr = fmt.Sprintf(actonStr, fieldName, ": (新增)", newBidType)
|
|
|
} else { // 调整
|
|
|
+ status = "调整"
|
|
|
changeStr = fmt.Sprintf(actonStr, fieldName, "(调整):", newBidType)
|
|
|
|
|
|
}
|
|
@@ -482,11 +490,13 @@ func processRecordStr(oldMap, newMap map[string]interface{}) (recordContent stri
|
|
|
if oldV == newV { // 没有改变
|
|
|
continue
|
|
|
}
|
|
|
- fieldName := fieldName
|
|
|
+ status = "调整"
|
|
|
+ //fieldName := fieldName
|
|
|
if common.IntAll(newMap["bidType"]) == BidTypeChanel {
|
|
|
fieldName = fmt.Sprintf("%s%s", "渠道", fieldName)
|
|
|
}
|
|
|
changeStr = fmt.Sprintf(actonStr, fieldName, "(调整) 为", WinMap[newV])
|
|
|
+ value = WinMap[newV]
|
|
|
case "bidStage":
|
|
|
bidAction := "%s%s"
|
|
|
bidChangeArr := []string{}
|
|
@@ -512,6 +522,8 @@ func processRecordStr(oldMap, newMap map[string]interface{}) (recordContent stri
|
|
|
})
|
|
|
tmpStr := strings.Join(bidChangeArr, " ")
|
|
|
changeStr = fmt.Sprintf(actonStr, fieldName, " :", tmpStr)
|
|
|
+ status = "调整"
|
|
|
+ value = tmpStr
|
|
|
default:
|
|
|
oldV := common.ObjToString(oldMap[k])
|
|
|
newV := common.ObjToString(newMap[k])
|
|
@@ -519,15 +531,23 @@ func processRecordStr(oldMap, newMap map[string]interface{}) (recordContent stri
|
|
|
continue
|
|
|
}
|
|
|
changeStr = fmt.Sprintf(actonStr, fieldName, "(调整)为", fmt.Sprintf("\"%s\"", newV))
|
|
|
+ status = "调整"
|
|
|
+ value = newV
|
|
|
}
|
|
|
result = append(result, changeStr)
|
|
|
changeField = append(changeField, k)
|
|
|
+ changeMap[k] = map[string]interface{}{
|
|
|
+ "status": status,
|
|
|
+ "value": value,
|
|
|
+ }
|
|
|
}
|
|
|
+ b, _ := json.Marshal(changeMap)
|
|
|
recordMap := map[string]interface{}{
|
|
|
"content": strings.Join(result, ";"), // 变更内容 文字描述
|
|
|
"before": oldMap, // 变更前
|
|
|
"after": newMap, // 变更后
|
|
|
"changeField": changeField, // 涉及变更的字段
|
|
|
+ "changeMap": string(b), // 涉及变更内容
|
|
|
}
|
|
|
|
|
|
tmp, err := json.Marshal(recordMap)
|