审查视图

pkg/domain/enums.go 3.5 KB
1 2 3 4 5
package domain

/*****   1.用户模块  *****/
// 用户类型
const (
yangfu authored
6 7 8 9 10
	UserTypeEmployee       = 1
	UserTypeCooperation    = 2
	UserTypeVisitor        = 4
	UserTypeOperationAdmin = 8
	UserTypeCompanyAdmin   = 1024
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
)

// 用户状态
const (
	UserStatusEnable  int = 1
	UserStatusDisable int = 2
	UserStatusDestroy int = 3
)

/*****   2.菜单模块  *****/
// 菜单启用状态 结合用户菜单权限
const (
	MenuStatusEnable  = 1 // 菜单启用
	MenuStatusDisable = 2 // 菜单禁用
)

// 菜单公开状态
const (
	MenuPublic  = 1 // 菜单公开
	MenuPrivate = 2 // 菜单未公开
)

const (
	WebMenuCode = "web"
	AppMenuCode = "app"
)

/*****   3.组织模块  *****/
const (
	IsOrgFlag    = 1 //   标记为组织
	IsNotOrgFlag = 2 // 标记为非组织
)

const (
	OrgStatusEnable  = 1
	OrgStatusDisable = 2
)
yangfu authored
48 49 50 51 52

const (
	MaxQueryRowCount    = 1000
	NormalQueryRowCount = 100
)
yangfu authored
53 54 55

const (
	// 导入公司用户
yangfu authored
56
	ImportCompanyUser = "ADMIN_SYSTEM-MANAGE_BASE_USER"
yangfu authored
57
	// 导入公司组织
yangfu authored
58
	ImportOrganization = "ADMIN_SYSTEM-MANAGE_BASE_DEPARTMENT"
yangfu authored
59
	// 导入共创用户
yangfu authored
60
	ImportCooperationUser = "ADMIN_SYSTEM-MANAGE_BASE_ALLIED-USER"
yangfu authored
61 62

	// 导入分红订单
yangfu authored
63 64 65
	ImportDividendsOrders = "BUSINESS_ALLIED-CREATION_BONUS_ORDER"
	// 导入退货订单
	ImportDividendsReturnOrders = "BUSINESS_ALLIED-CREATION_BONUS_RETURN"
66 67

	// 导入产品
68
	ImportProducts = "BUSINESS_ALLIED-MANUFACTURING_BASIC_PRODUCT"
yangfu authored
69
	// 导入设备
70
	ImportDevices = "BUSINESS_ALLIED-MANUFACTURING_BASIC_DEVICE"
庄敏学 authored
71 72
	//导入成本结构
	ImportCosts = "BUSINESS_ALLIED-COST"
yangfu authored
73
)
yangfu authored
74 75 76 77 78 79

const (
	// 导入公司用户
	ExportCompanyUser = "ExportCompanyUser"
	// 导入共创用户
	ExportCooperationUser = "ExportCooperationUser"
80 81 82

	// 导入产品
	ExportProducts = "ExportProducts"
83 84 85 86
	// 导出员工产能统计
	ExportManufactureEmployeeProductive = "ExportManufactureEmployeeProductive"
	// 导出车间产能统计
	ExportManufactureWorkshopProductive = "ExportManufactureWorkshopProductive"
yangfu authored
87 88
	// 报废记录
	ExportSecondLevelRecord = "ExportSecondLevelRecord"
89 90 91 92 93

	// 员工工时
	ExportManufactureEmployeeAttendanceStatics = "ExportManufactureEmployeeAttendanceStatics"
	// 车间工时
	ExportManufactureWorkshopAttendanceStatics = "ExportManufactureWorkshopAttendanceStatics"
94 95 96

	// 成本结构化 - 每日填报异常日志
	ExportCostStructuredDailyFillingAbnormalLog = "ExportCostStructuredDailyFillingAbnormalLog"
yangfu authored
97
)
yangfu authored
98 99 100 101

const (
	CooperationUserDepartmentName = "共创用户"
)
yangfu authored
102 103

const (
yangfu authored
104
	BlockChainSourceCooperationContract          = "allied-creation.cooperation.contract"
yangfu authored
105 106 107
	BlockChainSourceCooperationProject           = "allied-creation.cooperation.project"
	BlockChainSourceCooperationDividendsEstimate = "allied-creation.cooperation.dividends-estimate"
)
yangfu authored
108 109 110 111

const (
	DefaultPassword = "4a693460c4cf078ea5b6b5a9e2cf382064a6f810" // TL123456!
)
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134

func EmployeeTypeDescription(employeeType int) string {
	if employeeType == 1 {
		return "固定"
	}
	if employeeType == 2 {
		return "派遣"
	}
	if employeeType == 3 {
		return "临时"
	}
	return "固定"
}

func ParticipateTypeDescription(participateType int) string {
	if participateType == 1 {
		return "正常"
	}
	if participateType == 2 {
		return "支援"
	}
	return "正常"
}
yangfu authored
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158

// 班次
const (
	WorkOnFullDay = 1 //全天
	WorkOnDay     = 2 //白班
	WorkOnMidDay  = 4 //中班
	WorkOnNight   = 8 //夜班
)

func WorkOnDescription(workOn int) string {
	if workOn&WorkOnFullDay > 0 {
		return "全天"
	}
	if workOn&WorkOnDay > 0 {
		return "白班"
	}
	if workOn&WorkOnMidDay > 0 {
		return "中班"
	}
	if workOn&WorkOnNight > 0 {
		return "夜班"
	}
	return ""
}