示例#1
0
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
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
}