コード例 #1
0
ファイル: project_list.go プロジェクト: zbzzbd/beego
func GetExportData(projects []*models.Project) [][]string {
	records := [][]string{{"序号", "启动时间", "项目名称", "服务项目", "合同编号", "赛事规模", "客户名称", "业务担当", "比赛日期", "开通报名时间", "关闭报名时间", "进程现况", "美术单元", "技术单元", "优先级", "登记人"}}
	light := len(projects)
	for i := 0; i < light; i++ {
		project := projects[i]
		data := []string{strconv.Itoa(i + 1), helpers.TimeFormat(project.Started), project.Name, project.ServiceItem, project.ContractNo, strconv.Itoa(int(project.Scale)), project.ClientName, project.BussinessUser.Name, helpers.TimeFormat(project.GameDate),
			helpers.TimeFormat(project.RegStartDate), helpers.TimeFormat(project.RegCloseDate), project.Progress.Name, project.ArtUser.Name, project.TechUser.Name, strconv.Itoa(int(project.Priority)), project.Registrant.Name,
		}
		records = append(records, data)
	}
	return records
}
コード例 #2
0
ファイル: job.go プロジェクト: zbzzbd/beego
func (jobList *JobList) GetExportData() [][]string {
	var res []*models.Job
	records := [][]string{{"序号", "作业状态", "作业编号", "项目名称", "业务单元", "作业要求", "作业对象", "作业部门", "作业单元", "发布时间", "审核时间", "要求完成时间", "作业认领时间", "实际完成时间", "任务用时", "任务延时"}}
	res = jobList.GetJobs()
	for i := 0; i < len(res); i++ {
		data := []string{strconv.Itoa(i + 1), helpers.GetStatusDesc(*res[i]), res[i].Code, res[i].Project.Name, res[i].CreateUser.Name, res[i].Type, res[i].Target,
			res[i].Department, res[i].Employee.Name, helpers.TimeFormat(res[i].Created), helpers.TimeFormat(res[i].ValidTime), helpers.TimeFormat(res[i].FinishTime), helpers.TimeFormat(res[i].ClaimTime),
			helpers.TimeFormat(res[i].SubmitTime), helpers.GetTimeDiff(res[i].SubmitTime, res[i].ClaimTime), helpers.GetTimeDiff(res[i].SubmitTime, res[i].FinishTime),
		}
		records = append(records, data)
	}
	return records
}
コード例 #3
0
ファイル: complaint.go プロジェクト: zbzzbd/beego
func (complainList *ComplainList) GetExportData() [][]string {
	var res []*models.JobComplaint
	records := [][]string{{"序号", "投诉日期", "投诉来源", "作业编号", "项目名称", "业务单元", "作业部门", "作业单元", "客诉事项", "客诉描述", "答复需求", "答复情况"}}
	res = complainList.GetComplaints()
	length := len(res)
	for i := 0; i < length; i++ {
		data := []string{strconv.Itoa(i + 1), helpers.TimeFormat(res[i].Created), res[i].Source, res[i].Job.Code, res[i].Project.Name, res[i].User.Name, res[i].Job.Department,
			res[i].Employee.Name, res[i].Type, res[i].Complain, strconv.Itoa(int(res[i].Response)), strconv.Itoa(int(res[i].ReplyStatus))}
		records = append(records, data)
	}
	return records

}