|
|
package domain
|
|
|
|
|
|
//NoticeModule 消息模块
|
|
|
type NoticeModule struct {
|
|
|
ModuleCode string `json:"Code"`
|
|
|
Name string `json:"name"`
|
|
|
}
|
|
|
|
|
|
//NoticeModuleAction 业务环节
|
|
|
type NoticeModuleAction struct {
|
|
|
ModuleCode string `json:"module_code"`
|
|
|
ActionCode string `json:"action_Code"`
|
|
|
Name string `json:"name"`
|
|
|
}
|
|
|
|
|
|
// 编排消息需要的变量
|
|
|
type NoticeSettingParam struct {
|
|
|
// 变量的代码标识
|
|
|
ParamCode string `json:"paramCode"`
|
|
|
// 变量名称描述
|
|
|
ParamName string `json:"paramName"`
|
|
|
// 业务环节
|
|
|
ModuleAction string `json:"moduleAction"`
|
|
|
// 消息对应的业务模块
|
|
|
Module string `json:"module"`
|
|
|
}
|
|
|
|
|
|
//GetNoticeModuleList 获取消息模块列表
|
|
|
func GetNoticeModuleList() []NoticeModule {
|
|
|
return noticeModuleList
|
|
|
}
|
|
|
|
|
|
//GetNoticeModuleActionList 获取业务环节列表
|
|
|
func GetNoticeModuleActionList() []NoticeModuleAction {
|
|
|
return noticeModuleActionList
|
|
|
}
|
|
|
|
|
|
//GetNoticeSettingParamList 获取变量列表
|
|
|
func GetNoticeSettingParamList(actionCode string) []NoticeSettingParam {
|
|
|
if len(actionCode) == 0 {
|
|
|
return noticeSettingParamList
|
|
|
}
|
|
|
var list []NoticeSettingParam
|
|
|
for i := range noticeSettingParamList {
|
|
|
if noticeSettingParamList[i].ModuleAction == actionCode {
|
|
|
list = append(list, noticeSettingParamList[i])
|
|
|
}
|
|
|
}
|
|
|
return list
|
|
|
}
|
|
|
|
|
|
//ValidNoticeModule 校验NoticeModule编码
|
|
|
func ValidNoticeModule(code string) bool {
|
|
|
for i := range noticeModuleList {
|
|
|
if noticeModuleList[i].ModuleCode == code {
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
//ValidNoticeModuleAction 校验NoticeModuleAction编码
|
|
|
func ValidNoticeModuleAction(moduleCode string, actioncode string) bool {
|
|
|
for i := range noticeModuleActionList {
|
|
|
if (noticeModuleActionList[i].ActionCode == actioncode) &&
|
|
|
(noticeModuleActionList[i].ModuleCode == moduleCode) {
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
//业务模块
|
|
|
const (
|
|
|
Module01 = "module01" // 天联共创
|
|
|
)
|
|
|
|
|
|
//业务环节
|
|
|
const (
|
|
|
Action01_01 = "action01_01" //天联共创-共创申请通过
|
|
|
Action01_02 = "action01_02" //天联共创-共创申请拒绝
|
|
|
Action01_03 = "action01_03" //天联共创-共创确认
|
|
|
Action01_04 = "action01_04" //天联共创-分红预算消息
|
|
|
Action01_05 = "action01_05" //天联共创-账期结算消息
|
|
|
Action01_06 = "action01_06" //天联共创-支付消息
|
|
|
)
|
|
|
|
|
|
//业务环节变量
|
|
|
const (
|
|
|
Param01_01_01 = "param01_01_01" //共创申请通过-共创项目编号
|
|
|
Param01_01_02 = "param01_01_02" //共创申请通过-共创项目名称
|
|
|
|
|
|
Param01_02_01 = "param01_02_01" //共创申请拒绝-共创项目编号
|
|
|
Param01_02_02 = "param01_02_02" //共创申请拒绝-共创项目名称
|
|
|
|
|
|
Param01_03_01 = "param01_03_01" //共创确认-共创项目编号
|
|
|
Param01_03_02 = "param01_03_02" //共创确认-共创项目名称
|
|
|
Param01_03_03 = "param01_03_03" //共创确认-项目合约编号
|
|
|
Param01_03_04 = "param01_03_04" //共创确认-项目合约名称
|
|
|
|
|
|
Param01_04_01 = "param01_04_01" //分红预算消息-共创项目编号
|
|
|
Param01_04_02 = "param01_04_02" //分红预算消息-共创项目名称
|
|
|
Param01_04_03 = "param01_04_03" //分红预算消息-项目合约编号
|
|
|
Param01_04_04 = "param01_04_04" //分红预算消息-项目合约名称
|
|
|
Param01_04_05 = "param01_04_05" //分红预算消息-订单产品信息
|
|
|
Param01_04_06 = "param01_04_06" //分红预算消息-分红金额
|
|
|
|
|
|
Param01_05_01 = "param01_05_01" //账期结算消息-账期结算单号
|
|
|
Param01_05_02 = "param01_05_02" //账期结算消息-结算金额
|
|
|
Param01_05_03 = "param01_05_03" //账期结算消息-分红预算单号
|
|
|
|
|
|
Param01_06_01 = "param01_06_01" //支付消息-账期结算单号
|
|
|
Param01_06_02 = "param01_06_02" //支付消息-结算金额
|
|
|
Param01_06_03 = "param01_06_03" //支付消息-实付金额
|
|
|
)
|
|
|
|
|
|
//noticeModuleList 模块列表
|
|
|
var noticeModuleList = []NoticeModule{
|
|
|
{ModuleCode: Module01, Name: "天联共创"},
|
|
|
}
|
|
|
|
|
|
//noticeModuleActionList 业务环节列表
|
|
|
var noticeModuleActionList = []NoticeModuleAction{
|
|
|
{ModuleCode: Module01, ActionCode: Action01_01, Name: "共创申请通过"},
|
|
|
{ModuleCode: Module01, ActionCode: Action01_02, Name: "共创申请拒绝"},
|
|
|
{ModuleCode: Module01, ActionCode: Action01_03, Name: "共创确认"},
|
|
|
{ModuleCode: Module01, ActionCode: Action01_04, Name: "分红预算消息"},
|
|
|
{ModuleCode: Module01, ActionCode: Action01_05, Name: "账期结算消息"},
|
|
|
{ModuleCode: Module01, ActionCode: Action01_06, Name: "支付消息"},
|
|
|
}
|
|
|
|
|
|
//noticeSettingParamList 业务变量列表
|
|
|
var noticeSettingParamList = []NoticeSettingParam{
|
|
|
{ModuleAction: Module01, Module: Action01_01, ParamCode: Param01_01_01, ParamName: "共创项目编号"},
|
|
|
{ModuleAction: Module01, Module: Action01_01, ParamCode: Param01_01_02, ParamName: "共创项目名称"},
|
|
|
|
|
|
{ModuleAction: Module01, Module: Action01_02, ParamCode: Param01_02_01, ParamName: "共创项目编号"},
|
|
|
{ModuleAction: Module01, Module: Action01_02, ParamCode: Param01_02_02, ParamName: "共创项目名称"},
|
|
|
|
|
|
{ModuleAction: Module01, Module: Action01_03, ParamCode: Param01_03_01, ParamName: "共创项目编号"},
|
|
|
{ModuleAction: Module01, Module: Action01_03, ParamCode: Param01_03_02, ParamName: "共创项目名称"},
|
|
|
{ModuleAction: Module01, Module: Action01_03, ParamCode: Param01_03_03, ParamName: "项目合约编号"},
|
|
|
{ModuleAction: Module01, Module: Action01_03, ParamCode: Param01_03_04, ParamName: "项目合约名称"},
|
|
|
|
|
|
{ModuleAction: Module01, Module: Action01_04, ParamCode: Param01_04_01, ParamName: "共创项目编号"},
|
|
|
{ModuleAction: Module01, Module: Action01_04, ParamCode: Param01_04_02, ParamName: "共创项目名称"},
|
|
|
{ModuleAction: Module01, Module: Action01_04, ParamCode: Param01_04_03, ParamName: "项目合约编号"},
|
|
|
{ModuleAction: Module01, Module: Action01_04, ParamCode: Param01_04_04, ParamName: "项目合约名称"},
|
|
|
{ModuleAction: Module01, Module: Action01_04, ParamCode: Param01_04_05, ParamName: "订单产品信息"},
|
|
|
{ModuleAction: Module01, Module: Action01_04, ParamCode: Param01_04_06, ParamName: "分红金额"},
|
|
|
|
|
|
{ModuleAction: Module01, Module: Action01_05, ParamCode: Param01_05_01, ParamName: "账期结算单号"},
|
|
|
{ModuleAction: Module01, Module: Action01_05, ParamCode: Param01_05_02, ParamName: "结算金额"},
|
|
|
{ModuleAction: Module01, Module: Action01_05, ParamCode: Param01_05_03, ParamName: "分红预算单号"},
|
|
|
|
|
|
{ModuleAction: Module01, Module: Action01_06, ParamCode: Param01_06_01, ParamName: "账期结算单号"},
|
|
|
{ModuleAction: Module01, Module: Action01_06, ParamCode: Param01_06_02, ParamName: "结算金额"},
|
|
|
{ModuleAction: Module01, Module: Action01_06, ParamCode: Param01_06_03, ParamName: "实付金额"},
|
|
|
} |
...
|
...
|
|