ソースを参照

feature(bug): 项目转移 浅拷贝问题

ZZH-wl 2 年 前
コミット
563f11bf03

+ 1 - 4
opms_admin/app/service/sys_send_message.go

@@ -6,7 +6,6 @@ import (
 	"dashoo.cn/opms_libary/plugin/dingtalk"
 	"dashoo.cn/opms_libary/plugin/dingtalk/message/corpconversation"
 	"dashoo.cn/opms_libary/plugin/email"
-	"dashoo.cn/opms_libary/plugin/wechat"
 	"github.com/gogf/gf/frame/g"
 	"strings"
 )
@@ -194,8 +193,6 @@ func (c *contextService) SendUserMiniWechatMsg(userId, msgTitle, msgContent stri
 		g.Log().Error(errMsg)
 		return myerrors.TipsError(errMsg)
 	}
-	client, err := wechat.Client.MiniClient()
-	client.GetMessage()
 
 	if err != nil {
 		g.Log().Error("发送用户 "+userInfo.NickName+" 微信小程序消息失败:"+userInfo.WechatId, err)
@@ -218,7 +215,7 @@ func (c *contextService) BatchSendUserMiniWechatMsg(userIds []string, msgTitle,
 		}
 
 		if err != nil {
-			g.Log().Error("发送用户邮箱邮件失败:"+userInfo.Email, err)
+			g.Log().Error("发送用户 "+userInfo.NickName+" 微信小程序消息失败:"+userInfo.WechatId, err)
 			continue
 		}
 	}

+ 11 - 3
opms_parent/app/service/proj/business.go

@@ -352,7 +352,7 @@ func (p *businessService) BusinessTransfer(req *model.BusinessTransferReq) error
 	}
 	service.SetUpdatedInfo(businessMap, p.GetCxtUserId(), p.GetCxtUserName())
 
-	opnContent := businessMap
+	opnContent := gconv.Map(gconv.String(businessMap))
 	opnContent["origSaleId"] = business.SaleId
 	opnContent["origSaleName"] = business.SaleName
 	opnContent["saleId"] = req.UserId
@@ -817,6 +817,7 @@ func (p *businessService) BusinessUpgradeNotify(flow *workflowModel.PlatWorkflow
 	}
 
 	var data = g.Map{}
+	var remark string
 	if msg.ProcessType == "terminate" {
 		data[p.Dao.C.ApproStatus] = ApprovalReturn
 	}
@@ -835,6 +836,8 @@ func (p *businessService) BusinessUpgradeNotify(flow *workflowModel.PlatWorkflow
 		gconv.Struct(dynamics.OpnContent, updateData)
 		data = gconv.Map(updateData)
 		data[p.Dao.C.ApproStatus] = ApprovalOK
+		remarkMap := gconv.Map(dynamics.OpnContent)
+		remark = gconv.String(g.Map{"nboType": remarkMap["remarkMap"], "origNboType": remarkMap["origNboType"]})
 	}
 
 	// 项目修改
@@ -846,6 +849,7 @@ func (p *businessService) BusinessUpgradeNotify(flow *workflowModel.PlatWorkflow
 	dynamics := model.ProjBusinessDynamics{
 		BusId:   business.Id,
 		OpnType: OpnUpgradeApproval,
+		Remark:  remark,
 	}
 	_, err = p.CreateProjBusinessDynamics(nil, dynamics, data)
 	if err != nil {
@@ -982,6 +986,7 @@ func (p *businessService) BusinessDowngradeNotify(flow *workflowModel.PlatWorkfl
 	}
 
 	var data = g.Map{}
+	var remark string
 	if msg.ProcessType == "terminate" {
 		data[p.Dao.C.ApproStatus] = ApprovalReturn
 	}
@@ -1000,6 +1005,8 @@ func (p *businessService) BusinessDowngradeNotify(flow *workflowModel.PlatWorkfl
 		gconv.Struct(dynamics.OpnContent, updateData)
 		data = gconv.Map(updateData)
 		data[p.Dao.C.ApproStatus] = ApprovalOK
+		remarkMap := gconv.Map(dynamics.OpnContent)
+		remark = gconv.String(g.Map{"nboType": remarkMap["remarkMap"], "origNboType": remarkMap["origNboType"]})
 	}
 
 	// 项目修改
@@ -1011,6 +1018,7 @@ func (p *businessService) BusinessDowngradeNotify(flow *workflowModel.PlatWorkfl
 	dynamics := model.ProjBusinessDynamics{
 		BusId:   business.Id,
 		OpnType: OpnDowngradeApproval,
+		Remark:  remark,
 	}
 	_, err = p.CreateProjBusinessDynamics(nil, dynamics, data)
 	if err != nil {
@@ -1036,7 +1044,7 @@ func (p *businessService) SetPrimacyContact(req *model.BusinessPrimacyContactReq
 	}
 	service.SetUpdatedInfo(businessMap, p.GetCxtUserId(), p.GetCxtUserName())
 
-	opnContent := businessMap
+	opnContent := gconv.Map(gconv.String(businessMap))
 	opnContent["origContactId"] = business.ContactId
 	opnContent["origContactName"] = business.ContactName
 	opnContent["origContactPostion"] = business.ContactPostion
@@ -1074,7 +1082,7 @@ func (p *businessService) UpdateBusinessStatus(req *model.UpdateBusinessStatusRe
 	}
 	service.SetUpdatedInfo(businessMap, p.GetCxtUserId(), p.GetCxtUserName())
 
-	opnContent := businessMap
+	opnContent := gconv.Map(gconv.String(businessMap))
 	opnContent["origNboStatus"] = business.NboStatus
 	err = p.Dao.Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
 		// 更新项目