コード例 #1
0
ファイル: finance.go プロジェクト: hjqhezgh/wooyou-admin
func RoleCodesAction(w http.ResponseWriter, r *http.Request) {
	m := make(map[string]interface{})

	roleCodes, err := tool.GetCurrentEmployeeRoles(r)
	if err != nil {
		lessgo.Log.Error(err)
		m["success"] = false
		m["code"] = 100
		m["msg"] = err.Error()
		commonlib.OutputJson(w, m, " ")
		return
	}

	m["success"] = true
	m["code"] = "200"
	m["datas"] = roleCodes
	commonlib.OutputJson(w, m, "")

	return
}
コード例 #2
0
ファイル: finance.go プロジェクト: hjqhezgh/wooyou-admin
func HandleApplyAction(w http.ResponseWriter, r *http.Request) {
	m := make(map[string]interface{})

	roleCodes, err := tool.GetCurrentEmployeeRoles(r)
	if err != nil {
		lessgo.Log.Error(err)
		m["success"] = false
		m["code"] = 100
		m["msg"] = err.Error()
		commonlib.OutputJson(w, m, " ")
		return
	}

	handleApply := new(HandleApply)
	handleApply.PendingReceiptAmount = GetPendingReceiptAmount(roleCodes)
	handleApply.CompletedReceiptAmount = GetCompletedReceiptAmount(roleCodes)

	m["success"] = true
	m["code"] = "200"
	m["datas"] = handleApply
	commonlib.OutputJson(w, m, "")

	return
}