|
|
@@ -3,6 +3,8 @@ package cust
|
|
|
import (
|
|
|
"bytes"
|
|
|
"context"
|
|
|
+ "dashoo.cn/opms_libary/plugin/dingtalk/workflow"
|
|
|
+ "dashoo.cn/opms_libary/utils"
|
|
|
"fmt"
|
|
|
"math"
|
|
|
"strconv"
|
|
|
@@ -10,7 +12,6 @@ import (
|
|
|
|
|
|
"dashoo.cn/opms_libary/myerrors"
|
|
|
"dashoo.cn/opms_libary/plugin/dingtalk/message"
|
|
|
- "dashoo.cn/opms_libary/plugin/dingtalk/workflow"
|
|
|
"github.com/360EntSecGroup-Skylar/excelize"
|
|
|
"github.com/gogf/gf/database/gdb"
|
|
|
"github.com/gogf/gf/encoding/gjson"
|
|
|
@@ -336,11 +337,7 @@ func (s *CustomerService) MoveToPubic(Ids []int64) (err error) {
|
|
|
|
|
|
var AssignCustomerRequestProcessCode = "PROC-FE42B2D1-6097-4DE8-8AC5-23541B7D5C8A"
|
|
|
|
|
|
-func ptrString(s string) *string {
|
|
|
- return &s
|
|
|
-}
|
|
|
-
|
|
|
-// 领取客户申请
|
|
|
+// AssignCustomerRequest 领取客户申请
|
|
|
func (s *CustomerService) AssignCustomerRequest(ctx context.Context, req *model.AssignCustomerReq) error {
|
|
|
data, err := s.Dao.Where("id in (?)", req.Ids).LockShared().All()
|
|
|
if err != nil {
|
|
|
@@ -366,20 +363,24 @@ func (s *CustomerService) AssignCustomerRequest(ctx context.Context, req *model.
|
|
|
ProcessCode: &AssignCustomerRequestProcessCode,
|
|
|
FormComponentValues: []*workflow.StartProcessInstanceRequestFormComponentValues{
|
|
|
{
|
|
|
- Name: ptrString("客户编码"),
|
|
|
- Value: ptrString(u.CustCode),
|
|
|
+ Id: utils.String("TextField_1QEXO83G7GDC0"),
|
|
|
+ Name: utils.String("客户编码"),
|
|
|
+ Value: utils.String(u.CustCode),
|
|
|
},
|
|
|
{
|
|
|
- Name: ptrString("客户名称"),
|
|
|
- Value: ptrString(u.CustName),
|
|
|
+ Id: utils.String("TextField_13MDZ97RV16K0"),
|
|
|
+ Name: utils.String("客户名称"),
|
|
|
+ Value: utils.String(u.CustName),
|
|
|
},
|
|
|
{
|
|
|
- Name: ptrString("申请人"),
|
|
|
- Value: ptrString(s.GetCxtUserName()),
|
|
|
+ Id: utils.String("TextField_1ZY48VZY6WG00"),
|
|
|
+ Name: utils.String("申请人"),
|
|
|
+ Value: utils.String(s.GetCxtUserName()),
|
|
|
},
|
|
|
{
|
|
|
- Name: ptrString("申请说明"),
|
|
|
- Value: ptrString(""),
|
|
|
+ Id: utils.String("TextareaField_5U6VKA6N1VK0"),
|
|
|
+ Name: utils.String("申请说明"),
|
|
|
+ Value: utils.String("申请说明"),
|
|
|
},
|
|
|
},
|
|
|
})
|
|
|
@@ -429,7 +430,7 @@ func (s *CustomerService) AssignCustomerRequestApproval(flow *workflowModel.Plat
|
|
|
if msg.ProcessType != "finish" && msg.ProcessType != "terminate" {
|
|
|
return fmt.Errorf("无法识别的 ProcessType :%s", msg.ProcessType)
|
|
|
}
|
|
|
- if msg.Result != "agree" && msg.Result != "refuse" {
|
|
|
+ if msg.Result != "agree" && msg.Result != "refuse" && msg.Result != "" {
|
|
|
return fmt.Errorf("无法识别的 Result :%s", msg.Result)
|
|
|
}
|
|
|
|