228 lines
9.4 KiB
Go
228 lines
9.4 KiB
Go
// ==========================================================================
|
||
// GFast自动生成model操作代码。
|
||
// 生成日期:2023-08-04 17:26:59
|
||
// 生成路径: internal/app/system/model/plan_week.go
|
||
// 生成人:gfast
|
||
// desc:周计划
|
||
// company:云南奇讯科技有限公司
|
||
// ==========================================================================
|
||
|
||
package model
|
||
|
||
import (
|
||
"github.com/gogf/gf/v2/os/gtime"
|
||
"github.com/gogf/gf/v2/util/gmeta"
|
||
"strings"
|
||
)
|
||
|
||
// PlanWeekNameStr word的工程进度需要展示的数据
|
||
const PlanWeekNameStr = "zhuangdian, lizhu, zhijia, guangfuban, nibianqi, xiangbian, jidianxianlu"
|
||
|
||
// 声明一个 progressOfWorksNum 类型
|
||
type progressOfWorksNum int
|
||
|
||
// 枚举
|
||
const (
|
||
zhuangdian = iota
|
||
lizhu
|
||
zhijia
|
||
guangfuban
|
||
nibianqi
|
||
xiangbian
|
||
jidianxianlu
|
||
)
|
||
|
||
// NameFunc 实现 progressOfWorksNum 类型的 ---->名称
|
||
func (p progressOfWorksNum) NameFunc() string {
|
||
return [...]string{"桩点浇筑", "立柱安装", "支架安装", "组件安装", "逆变器安装", "箱变安装", "集电线路"}[p]
|
||
}
|
||
|
||
// UnitFunc 实现 progressOfWorksNum 类型的 ---->单位
|
||
func (p progressOfWorksNum) UnitFunc() string {
|
||
return [...]string{"个", "根", "组", "组", "个", "个", "迷"}[p]
|
||
}
|
||
|
||
func PlanWeekEnum(str string) (name string, unit string) {
|
||
arrCount := strings.Split(PlanWeekNameStr, ", ")
|
||
var num int
|
||
switch str {
|
||
case arrCount[0]:
|
||
num = zhuangdian
|
||
case arrCount[1]:
|
||
num = lizhu
|
||
case arrCount[2]:
|
||
num = zhijia
|
||
case arrCount[3]:
|
||
num = guangfuban
|
||
case arrCount[4]:
|
||
num = nibianqi
|
||
case arrCount[5]:
|
||
num = xiangbian
|
||
case arrCount[6]:
|
||
num = jidianxianlu
|
||
}
|
||
var pown = progressOfWorksNum(num)
|
||
name = pown.NameFunc()
|
||
unit = pown.UnitFunc()
|
||
return
|
||
}
|
||
|
||
// PlanWeekInfoRes is the golang structure for table plan_week.
|
||
type PlanWeekInfoRes struct {
|
||
gmeta.Meta `orm:"table:plan_week"`
|
||
Id int `orm:"id,primary" json:"id"` //
|
||
ProjectId string `orm:"project_id" json:"projectId"` // 项目id
|
||
SourceId string `orm:"source_id" json:"sourceId"` // 资源id
|
||
Name string `orm:"name" json:"name"` // 资源名称
|
||
Start string `orm:"start" json:"start"` // 开始时间
|
||
End string `orm:"end" json:"end"` // 结束时间
|
||
PlanName string `orm:"plan_name" json:"planName"` // 计划名称
|
||
PlanId string `orm:"plan_id" json:"planId"` // 周id
|
||
CreateBy string `orm:"create_by" json:"createBy"` //
|
||
UpdateBy string `orm:"update_by" json:"updateBy"` //
|
||
CreateAt *gtime.Time `orm:"create_at" json:"createAt"` //
|
||
UpdateAt *gtime.Time `orm:"update_at" json:"updateAt"` //
|
||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` //
|
||
Table string `orm:"table" json:"table"` // source_id的数据对应的数据表
|
||
Status int `orm:"status" json:"status"` // 工作状态,0:未开始,1:进行中,2:已完成
|
||
SourceType string `orm:"source_type" json:"source_type"`
|
||
Cnt int `orm:"cnt" json:"cnt" v:"资源数量"`
|
||
StatusTwo int `orm:"statusTwo" json:"statusTwo" v:"工作状态,0:未开始,1:进行中,2:已完成"`
|
||
}
|
||
|
||
/*
|
||
type PlanWeekListRes struct{
|
||
Id int `json:"id"`
|
||
ProjectId string `json:"projectId"`
|
||
SourceId string `json:"sourceId"`
|
||
Name string `json:"name"`
|
||
Start string `json:"start"`
|
||
End string `json:"end"`
|
||
PlanName string `json:"planName"`
|
||
PlanId string `json:"planId"`
|
||
CreateBy string `json:"createBy"`
|
||
UpdateBy string `json:"updateBy"`
|
||
CreateAt *gtime.Time `json:"createAt"`
|
||
UpdateAt *gtime.Time `json:"updateAt"`
|
||
Table string `json:"table"`
|
||
Status int `json:"status"`
|
||
}
|
||
*/
|
||
type PlanWeekListRes struct {
|
||
Week_plan
|
||
}
|
||
type Task struct {
|
||
SourceId string `json:"sourceId" v:"required#资源id不能为空"`
|
||
Name string `json:"name" v:"required#资源名称不能为空"`
|
||
Table string `json:"table" v:"source_id的数据对应的数据表不能为空"`
|
||
Status int `json:"status" v:"工作状态,0:未开始,1:进行中,2:已完成不能为空"`
|
||
SourceType string `json:"source_type" v:"资源类型"`
|
||
Cnt int `json:"cnt" v:"资源数量"`
|
||
}
|
||
type Week_plan struct {
|
||
ProjectId string `json:"projectId" v:"#项目id不能为空"`
|
||
Start string `json:"start" v:"#开始时间不能为空"`
|
||
End string `json:"end" v:"#结束时间不能为空"`
|
||
PlanName string `json:"planName" v:"#计划名称不能为空"`
|
||
PlanID string `json:"planId" `
|
||
Status int `json:"status" v:"工作状态,0:未开始,1:进行中,2:已完成不能为空"`
|
||
Tasks []Task `json:"tasks" `
|
||
}
|
||
|
||
// ProgressOfWorksListRes 工程进度统计(代表一个周计划)
|
||
type ProgressOfWorksListRes struct {
|
||
WeekName string `json:"weekName" dc:"周计划名字"`
|
||
ProjectName string `json:"projectName" dc:"主题:项目名称"`
|
||
Logo string `json:"logo" dc:"logo"`
|
||
WeekOrMonth string `json:"weekOrMonth" dc:"副标题:周报/月报" `
|
||
WeekOrMonthTime string `json:"weekOrMonthTime" dc:"日期(周报开始结束日期/月报最小最大日期)"`
|
||
TextOne string `json:"textOne" dc:"固定文字《中煤科工重庆设计研究院(集团)有限公司》"`
|
||
TextTwo string `json:"textTwo" dc:"固定文字《******项目EPC总承包项目部》"`
|
||
GeneratedTime string `json:"generatedTime" dc:"生成日期"`
|
||
POWRList []*ProgressOfWorksRes `json:"powrList" dc:"一、工程进度列表"`
|
||
ManpowerText string `json:"manpowerText" dc:"二、人力资源"`
|
||
MechanicalText string `json:"mechanicalText" dc:"三、机械情况"`
|
||
MIRList []*MaterialInputRes `json:"miRList" dc:"四、材料投入情况"`
|
||
Quality *QualitySituationRes `json:"quality" dc:"五、质量情况"`
|
||
Polling *FieldInspectionRes `json:"polling" dc:"六、现场巡检照片"`
|
||
}
|
||
|
||
// ProgressOfWorksRes 工程进度统计(一个周计划有很多工程进度)
|
||
type ProgressOfWorksRes struct {
|
||
Name string `json:"name" dc:"名称"`
|
||
Unit string `json:"unit" dc:"单位"`
|
||
DesignTotal int64 `json:"design_total" dc:"设计总量"`
|
||
PlanNum int `json:"planNum" dc:"本周计划统计"`
|
||
RealityNum int `json:"realityNum" dc:"本周实际统计"`
|
||
AddUp int `json:"addUp" dc:"累积完成"`
|
||
Percentage float64 `json:"percentage" dc:"累计完成百分比"`
|
||
}
|
||
|
||
// ManpowerRes 人力资源
|
||
type ManpowerRes struct {
|
||
DictLabel string `json:"dictLabel"`
|
||
Num int `json:"num"`
|
||
}
|
||
|
||
// MechanicalRes 机械情况
|
||
type MechanicalRes struct {
|
||
Name string `json:"num"`
|
||
Num int `json:"num"`
|
||
}
|
||
|
||
// MaterialInputRes 材料投入
|
||
type MaterialInputRes struct {
|
||
Name string `json:"name" dc:"材料名称"`
|
||
SumNum int `json:"sumNum" dc:"总数量(材料入库的总数)"`
|
||
UseNum int `json:"useNum" dc:"当前时间段使用的数量"`
|
||
Weight int `json:"weight" dc:"单位"`
|
||
}
|
||
|
||
// QualitySituationRes 质量情况One
|
||
type QualitySituationRes struct {
|
||
ExamineList []*QualitySituationTwoRes `json:"examineList" dc:"质量检查、检查整改"`
|
||
InspectList []*QualitySituationTwoRes `json:"inspectList" dc:"送检"`
|
||
}
|
||
|
||
// QualitySituationTwoRes 质量情况Two
|
||
type QualitySituationTwoRes struct {
|
||
CreatedAt string `json:"createdAt" dc:"创建时间"`
|
||
QualityName string `json:"qualityName" dc:"质量检查名称"`
|
||
QualityExplain string `json:"qualityExplain" dc:"质量说明"`
|
||
QualityDocument string `json:"QualityDocument" dc:"质量检查文件"`
|
||
QualitType string `json:"qualityType" dc:"质量类型(1,送检,2质量检查,3检查整改)"`
|
||
IsQualified string `json:"isQualified" dc:"是否合格(文字描述,条件文件不为空)"`
|
||
TextStr string `json:"TextStr" dc:"纯文本(将以上字段数据组装)"`
|
||
}
|
||
|
||
// FieldInspectionRes 现场巡检照片
|
||
type FieldInspectionRes struct {
|
||
QualityList []*FieldInspectionResTwoRes `json:"qualityList" dc:"质量管理"`
|
||
SafetyList []*FieldInspectionResTwoRes `json:"safetyList" dc:"安全管理"`
|
||
}
|
||
|
||
// FieldInspectionResTwoRes 现场巡检照片Two
|
||
type FieldInspectionResTwoRes struct {
|
||
PollingName string `json:"pollingName" dc:"名称"`
|
||
QualityType string `json:"qualityType" dc:"质量类型 1,送检,2质量检查,3检查整改"`
|
||
SafetyType string `json:"safetyType" dc:"安全类型 1,例会,2检查,3整改,4站例会"`
|
||
Document string `json:"document" dc:"文件内容(json格式,前端用不上)"`
|
||
//PollingImg []*comModel.UpFile `json:"pollingImg" dc:"图片"`
|
||
PollingImg string `json:"pollingImg" dc:"图片"`
|
||
}
|
||
|
||
// DataAssemblyRequest 数据组装请求结构体
|
||
type DataAssemblyRequest struct {
|
||
ArrCount []string `json:"arrCount" dc:"限制-字符串数组"`
|
||
ArrCountStr string `json:"arrCountStr" dc:"限制-字符串"`
|
||
PlanId string `json:"planId" dc:"周计划ID"`
|
||
ProjectId int64 `json:"projectId" dc:"项目ID"`
|
||
TypeStr string `json:"typeStr" dc:"导出类型"`
|
||
Start string `json:"start" dc:"开始时间"`
|
||
End string `json:"end" dc:"结束时间"`
|
||
WeekName string `json:"weekName" dc:"项目名称"`
|
||
PlanIds string `json:"planIds" dc:"多个项目id"`
|
||
|
||
DesignTotal int64 `json:"designTotal" dc:"多个项目id"`
|
||
}
|