正在显示
11 个修改的文件
包含
68 行增加
和
22 行删除
@@ -27,13 +27,13 @@ | @@ -27,13 +27,13 @@ | ||
27 | ### 阶段二接口完成进度 | 27 | ### 阶段二接口完成进度 |
28 | |功能|完成状态|时间|接口路径 | 28 | |功能|完成状态|时间|接口路径 |
29 | |---|---|----|----| | 29 | |---|---|----|----| |
30 | -|我的机会-我提交的| | | | | ||
31 | -|机会详情| | | | | 30 | +|我的机会-我提交的| | |/v1/chance/mySubmitChance| |
31 | +|机会详情| | |v1/chance/detail| | ||
32 | |机会更新| | | | | 32 | |机会更新| | | | |
33 | -|机会删除| | | | | 33 | +|机会删除| | |/v1/chance/delete| |
34 | |我的机会-我的审核| | | | | 34 | |我的机会-我的审核| | | | |
35 | |机会审核(评分/修改公开状态)| | | | | 35 | |机会审核(评分/修改公开状态)| | | | |
36 | -|用户评分配置| | | | | 36 | +|计算发现分| | | | |
37 | |用户机会权限| | | | | 37 | |用户机会权限| | | | |
38 | |机会池| | | | | 38 | |机会池| | | | |
39 | |消息-点赞| | |v1/message/msgInteractive| | 39 | |消息-点赞| | |v1/message/msgInteractive| |
@@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
49 | |机会审核消息| | |v1/message/msgInteractive| | 49 | |机会审核消息| | |v1/message/msgInteractive| |
50 | |我提交的机会| | | v1/chance/chances| | 50 | |我提交的机会| | | v1/chance/chances| |
51 | |我审核的机会| | | v1/chance/chances| | 51 | |我审核的机会| | | v1/chance/chances| |
52 | -|机会详情| | | v1/chance/detail| | 52 | +|机会详情| | | | |
53 | |待抓住机会列表| | |v1/chance/chances| | 53 | |待抓住机会列表| | |v1/chance/chances| |
54 | |配置-评分| | |v1/config/score| | 54 | |配置-评分| | |v1/config/score| |
55 | |机会审核| | |v1/chance/audit| | 55 | |机会审核| | |v1/chance/audit| |
@@ -74,7 +74,6 @@ func (this *BaseController) Valid(obj interface{}) (result bool, msg *protocol.R | @@ -74,7 +74,6 @@ func (this *BaseController) Valid(obj interface{}) (result bool, msg *protocol.R | ||
74 | } | 74 | } |
75 | 75 | ||
76 | func (this *BaseController) Resp(msg *protocol.ResponseMessage) { | 76 | func (this *BaseController) Resp(msg *protocol.ResponseMessage) { |
77 | - | ||
78 | this.Data["json"] = msg | 77 | this.Data["json"] = msg |
79 | this.ServeJSON() | 78 | this.ServeJSON() |
80 | } | 79 | } |
@@ -315,7 +315,7 @@ func (this *ChanceController) ChanceDetail() { | @@ -315,7 +315,7 @@ func (this *ChanceController) ChanceDetail() { | ||
315 | //} | 315 | //} |
316 | 316 | ||
317 | //ChanceDelete 机会删除 | 317 | //ChanceDelete 机会删除 |
318 | -//@router /chanceDelete [post] | 318 | +//@router /delete [post] |
319 | func (this *ChanceController) ChanceDelete() { | 319 | func (this *ChanceController) ChanceDelete() { |
320 | var msg *protocol.ResponseMessage | 320 | var msg *protocol.ResponseMessage |
321 | defer func() { | 321 | defer func() { |
@@ -65,3 +65,12 @@ func JoinInt64s(ids []int64, spilt string) string { | @@ -65,3 +65,12 @@ func JoinInt64s(ids []int64, spilt string) string { | ||
65 | } | 65 | } |
66 | return strings.Join(idStrings, spilt) | 66 | return strings.Join(idStrings, spilt) |
67 | } | 67 | } |
68 | + | ||
69 | +//判断是否为空 | ||
70 | +func IsNil(i interface{}) bool { | ||
71 | + vi := reflect.ValueOf(i) | ||
72 | + if vi.Kind() == reflect.Ptr { | ||
73 | + return vi.IsNil() | ||
74 | + } | ||
75 | + return false | ||
76 | +} |
@@ -127,3 +127,13 @@ func GetAuditFlowProcessList(chanceId int64) (v []*AuditFlowProcess, err error) | @@ -127,3 +127,13 @@ func GetAuditFlowProcessList(chanceId int64) (v []*AuditFlowProcess, err error) | ||
127 | } | 127 | } |
128 | return nil, err | 128 | return nil, err |
129 | } | 129 | } |
130 | + | ||
131 | +//删除机会时关闭所有审核信息 | ||
132 | +func CloseAuditFlowProcess(chanceId int64) (err error) { | ||
133 | + o := orm.NewOrm() | ||
134 | + sql := "update audit_flow_process set enable_status =0,is_active=0,update_at=now() where chance_id=?" | ||
135 | + if err = utils.ExecuteSQLWithOrmer(o, sql, chanceId); err != nil { | ||
136 | + return | ||
137 | + } | ||
138 | + return | ||
139 | +} |
@@ -94,6 +94,7 @@ type Score struct { | @@ -94,6 +94,7 @@ type Score struct { | ||
94 | 94 | ||
95 | //审核操作权限 | 95 | //审核操作权限 |
96 | type ApproveAccess struct { | 96 | type ApproveAccess struct { |
97 | - AllowApprove int `json:"allowApprove"` | ||
98 | - AllowReject int `json:"allowReject"` | 97 | + ProcessId int64 `json:"processId"` |
98 | + AllowApprove int `json:"allowApprove"` | ||
99 | + AllowReject int `json:"allowReject"` | ||
99 | } | 100 | } |
@@ -37,7 +37,7 @@ var errmessge ErrorMap = map[int]string{ | @@ -37,7 +37,7 @@ var errmessge ErrorMap = map[int]string{ | ||
37 | 37 | ||
38 | //机会审批相关 | 38 | //机会审批相关 |
39 | 5201: "该机会模板未配置审批人,请选择其他模板", | 39 | 5201: "该机会模板未配置审批人,请选择其他模板", |
40 | - 5202: "该机会已被其他人审批", | 40 | + 5202: "该机会已被审批", |
41 | 5203: "审批服务器操作失败", | 41 | 5203: "审批服务器操作失败", |
42 | 42 | ||
43 | //模板相关 | 43 | //模板相关 |
@@ -65,14 +65,6 @@ func init() { | @@ -65,14 +65,6 @@ func init() { | ||
65 | 65 | ||
66 | beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], | 66 | beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], |
67 | beego.ControllerComments{ | 67 | beego.ControllerComments{ |
68 | - Method: "ChanceDelete", | ||
69 | - Router: `/chanceDelete`, | ||
70 | - AllowHTTPMethods: []string{"post"}, | ||
71 | - MethodParams: param.Make(), | ||
72 | - Params: nil}) | ||
73 | - | ||
74 | - beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], | ||
75 | - beego.ControllerComments{ | ||
76 | Method: "ChanceDetail", | 68 | Method: "ChanceDetail", |
77 | Router: `/chanceDetail`, | 69 | Router: `/chanceDetail`, |
78 | AllowHTTPMethods: []string{"post"}, | 70 | AllowHTTPMethods: []string{"post"}, |
@@ -113,6 +105,14 @@ func init() { | @@ -113,6 +105,14 @@ func init() { | ||
113 | 105 | ||
114 | beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], | 106 | beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], |
115 | beego.ControllerComments{ | 107 | beego.ControllerComments{ |
108 | + Method: "ChanceDelete", | ||
109 | + Router: `/delete`, | ||
110 | + AllowHTTPMethods: []string{"post"}, | ||
111 | + MethodParams: param.Make(), | ||
112 | + Params: nil}) | ||
113 | + | ||
114 | + beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], | ||
115 | + beego.ControllerComments{ | ||
116 | Method: "Favorite", | 116 | Method: "Favorite", |
117 | Router: `/favorite`, | 117 | Router: `/favorite`, |
118 | AllowHTTPMethods: []string{"post"}, | 118 | AllowHTTPMethods: []string{"post"}, |
@@ -30,6 +30,7 @@ const ( | @@ -30,6 +30,7 @@ const ( | ||
30 | ApproveIntegrate = "/approve-processes/integrate" | 30 | ApproveIntegrate = "/approve-processes/integrate" |
31 | ) | 31 | ) |
32 | 32 | ||
33 | +//素加审批系统 | ||
33 | type SuplusApprove struct { | 34 | type SuplusApprove struct { |
34 | } | 35 | } |
35 | 36 | ||
@@ -315,7 +316,7 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro | @@ -315,7 +316,7 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro | ||
315 | if approveItemResponse.IsOver == 1 { | 316 | if approveItemResponse.IsOver == 1 { |
316 | //结束审批 | 317 | //结束审批 |
317 | if err = utils.UpdateTableByMap(chance, map[string]interface{}{ | 318 | if err = utils.UpdateTableByMap(chance, map[string]interface{}{ |
318 | - "ReviewStatus": int8(request.ReviewStatus), "AuditLevel": chance.AuditLevel + 1}); err != nil { | 319 | + "ReviewStatus": int8(request.ReviewStatus), "AuditLevel": chance.AuditLevel}); err != nil { |
319 | log.Error("更新机会审核状态失败 chance_id:", chance.Id, err) | 320 | log.Error("更新机会审核状态失败 chance_id:", chance.Id, err) |
320 | return | 321 | return |
321 | } | 322 | } |
@@ -446,6 +447,7 @@ func ChanceApproveProcess(header *protocol.RequestHeader, chance *models.Chance) | @@ -446,6 +447,7 @@ func ChanceApproveProcess(header *protocol.RequestHeader, chance *models.Chance) | ||
446 | rsp.ApproveAccess = &protocol.ApproveAccess{ | 447 | rsp.ApproveAccess = &protocol.ApproveAccess{ |
447 | AllowApprove: 1, | 448 | AllowApprove: 1, |
448 | AllowReject: 1, | 449 | AllowReject: 1, |
450 | + ProcessId: process.Id, | ||
449 | } | 451 | } |
450 | } | 452 | } |
451 | } | 453 | } |
@@ -699,6 +699,7 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail | @@ -699,6 +699,7 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail | ||
699 | provider *protocol.BaseUserInfo | 699 | provider *protocol.BaseUserInfo |
700 | approveProcess *protocol.ChanceApproveProcessResponse | 700 | approveProcess *protocol.ChanceApproveProcessResponse |
701 | ) | 701 | ) |
702 | + rsp = &protocol.ChanceDetailResponse{} | ||
702 | if chance, err = models.GetChanceById(request.Id); err != nil { | 703 | if chance, err = models.GetChanceById(request.Id); err != nil { |
703 | if err == orm.ErrNoRows { | 704 | if err == orm.ErrNoRows { |
704 | err = protocol.NewErrWithMessage(5101) | 705 | err = protocol.NewErrWithMessage(5101) |
@@ -707,13 +708,16 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail | @@ -707,13 +708,16 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail | ||
707 | log.Error(err) | 708 | log.Error(err) |
708 | return | 709 | return |
709 | } | 710 | } |
711 | + if chance.EnableStatus == 0 { | ||
712 | + err = protocol.NewErrWithMessage(5101) | ||
713 | + return | ||
714 | + } | ||
710 | //用户信息 | 715 | //用户信息 |
711 | if provider, err = agg.GetUserBaseInfo(chance.UserId, header.CompanyId); err != nil { | 716 | if provider, err = agg.GetUserBaseInfo(chance.UserId, header.CompanyId); err != nil { |
712 | log.Error(err) | 717 | log.Error(err) |
713 | return | 718 | return |
714 | } | 719 | } |
715 | 720 | ||
716 | - rsp = &protocol.ChanceDetailResponse{} | ||
717 | item := protocol.ChanceItem{ | 721 | item := protocol.ChanceItem{ |
718 | Id: chance.Id, | 722 | Id: chance.Id, |
719 | Provider: provider, | 723 | Provider: provider, |
@@ -742,6 +746,7 @@ func ChanceDelete(header *protocol.RequestHeader, request *protocol.ChanceDelete | @@ -742,6 +746,7 @@ func ChanceDelete(header *protocol.RequestHeader, request *protocol.ChanceDelete | ||
742 | var ( | 746 | var ( |
743 | chance *models.Chance | 747 | chance *models.Chance |
744 | ) | 748 | ) |
749 | + rsp = &protocol.ChanceDeleteResponse{} | ||
745 | if chance, err = models.GetChanceById(request.Id); err != nil { | 750 | if chance, err = models.GetChanceById(request.Id); err != nil { |
746 | if err == orm.ErrNoRows { | 751 | if err == orm.ErrNoRows { |
747 | err = protocol.NewErrWithMessage(5101) | 752 | err = protocol.NewErrWithMessage(5101) |
@@ -750,8 +755,24 @@ func ChanceDelete(header *protocol.RequestHeader, request *protocol.ChanceDelete | @@ -750,8 +755,24 @@ func ChanceDelete(header *protocol.RequestHeader, request *protocol.ChanceDelete | ||
750 | log.Error(err) | 755 | log.Error(err) |
751 | return | 756 | return |
752 | } | 757 | } |
753 | - if chance != nil { | 758 | + if chance.ReviewStatus == protocol.ReviewStatusPass { |
759 | + err = protocol.NewErrWithMessage(5202) | ||
760 | + return | ||
761 | + } | ||
762 | + //被人审核过 公开状态数据不为空 | ||
763 | + if chance.ReviewStatus == protocol.ReviewStatusAuditging && len(chance.PublishData) != 0 { | ||
764 | + err = protocol.NewErrWithMessage(5202) | ||
765 | + return | ||
766 | + } | ||
767 | + if err = utils.UpdateTableByMap(chance, map[string]interface{}{ | ||
768 | + "EnableStatus": int8(0), | ||
769 | + }); err != nil { | ||
770 | + log.Error(err) | ||
771 | + return | ||
772 | + } | ||
773 | + if err = models.CloseAuditFlowProcess(chance.Id); err != nil { | ||
774 | + log.Error(err) | ||
775 | + return | ||
754 | } | 776 | } |
755 | - rsp = &protocol.ChanceDeleteResponse{} | ||
756 | return | 777 | return |
757 | } | 778 | } |
@@ -91,3 +91,7 @@ func UploadFile(request *protocol.FileRequest) (rsp *protocol.FileResponse, err | @@ -91,3 +91,7 @@ func UploadFile(request *protocol.FileRequest) (rsp *protocol.FileResponse, err | ||
91 | } | 91 | } |
92 | return | 92 | return |
93 | } | 93 | } |
94 | + | ||
95 | +func ResizeImage(fileType int, fileName string, file *multipart.FileHeader) (err error) { | ||
96 | + return | ||
97 | +} |
-
请 注册 或 登录 后发表评论