|
@@ -84,37 +84,37 @@ var (
|
|
|
|
|
|
var (
|
|
|
TaskSchemeTimeLimit = map[string]float64{
|
|
|
- "BWX": 30, // 保温箱
|
|
|
- "LDX": 30, // 冷冻箱
|
|
|
- "LCG": 30, // 冷藏柜
|
|
|
- "LDG": 30, // 冷冻柜
|
|
|
- "YLG": 30, // 阴凉柜
|
|
|
- "LDC": 60, // 冷藏车
|
|
|
- "LK": 60, // 冷库
|
|
|
- "BG": 60, // 冰柜
|
|
|
- "DWBWX": 60, // 低温保存箱
|
|
|
- "XT": 30, // 系统验证
|
|
|
- "WZ": 80, // 位置
|
|
|
- "XJ": 0, // 巡检
|
|
|
- "PX": 0, // 培训
|
|
|
- "QT": 0, // 其他
|
|
|
+ "BWX": 30, // 保温箱
|
|
|
+ "LDX": 30, // 冷冻箱
|
|
|
+ "LCG": 30, // 冷藏柜
|
|
|
+ "LDG": 30, // 冷冻柜
|
|
|
+ "YLG": 30, // 阴凉柜
|
|
|
+ "LDC": 60, // 冷藏车
|
|
|
+ "LK": 60, // 冷库
|
|
|
+ "BG": 60, // 冰柜
|
|
|
+ "DWBWX": 60, // 低温保存箱
|
|
|
+ "XT": 30, // 系统验证
|
|
|
+ "WZ": 80, // 位置
|
|
|
+ "XJ": 0, // 巡检
|
|
|
+ "PX": 0, // 培训
|
|
|
+ "QT": 0, // 其他
|
|
|
}
|
|
|
|
|
|
TaskReportingTimeLimit = map[string]float64{
|
|
|
- "BWX": 180, // 保温箱
|
|
|
- "LDX": 180, // 冷冻箱
|
|
|
- "LCG": 210, // 冷藏柜
|
|
|
- "LDG": 210, // 冷冻柜
|
|
|
- "YLG": 210, // 阴凉柜
|
|
|
- "LDC": 300, // 冷藏车
|
|
|
- "LK": 390, // 冷库
|
|
|
- "BG": 210, // 冰柜
|
|
|
- "DWBWX": 180, // 低温保存箱
|
|
|
- "XT": 300, // 系统验证
|
|
|
- "WZ": 240, // 位置
|
|
|
- "XJ": 0, // 巡检
|
|
|
- "PX": 0, // 培训
|
|
|
- "QT": 0, // 其他
|
|
|
+ "BWX": 180, // 保温箱
|
|
|
+ "LDX": 180, // 冷冻箱
|
|
|
+ "LCG": 210, // 冷藏柜
|
|
|
+ "LDG": 210, // 冷冻柜
|
|
|
+ "YLG": 210, // 阴凉柜
|
|
|
+ "LDC": 300, // 冷藏车
|
|
|
+ "LK": 390, // 冷库
|
|
|
+ "BG": 210, // 冰柜
|
|
|
+ "DWBWX": 180, // 低温保存箱
|
|
|
+ "XT": 300, // 系统验证
|
|
|
+ "WZ": 240, // 位置
|
|
|
+ "XJ": 0, // 巡检
|
|
|
+ "PX": 0, // 培训
|
|
|
+ "QT": 0, // 其他
|
|
|
|
|
|
}
|
|
|
|
|
@@ -132,18 +132,18 @@ type AuditRecord struct {
|
|
|
T_type string `orm:"type(256)"` // 退回类型 scheme方案 reporting报告
|
|
|
}
|
|
|
|
|
|
-// 模板
|
|
|
+// 模版
|
|
|
type Task struct {
|
|
|
Id int `orm:"column(ID);size(11);auto;pk"`
|
|
|
T_class int `orm:"size(200);default(0)"` // 分类id
|
|
|
T_InfoCollection_id string `orm:"size(256);null"` // 信息采集ID
|
|
|
- T_InfoTemplate_id string `orm:"size(256);null"` // 信息采集模板ID
|
|
|
+ T_InfoTemplate_id string `orm:"size(256);null"` // 信息采集模版ID
|
|
|
|
|
|
T_task_id string `orm:"size(256);null"` // 任务ID
|
|
|
T_uuid string `orm:"size(256);null"` // 用户 UUID
|
|
|
T_name string `orm:"size(256);null"` // 标题
|
|
|
- T_VerifyTemplate_class string `orm:"size(256);null"` // 模板id
|
|
|
- T_VerifyTemplate_id string `orm:"size(256);null"` // 模板id
|
|
|
+ T_VerifyTemplate_class string `orm:"size(256);null"` // 模版id
|
|
|
+ T_VerifyTemplate_id string `orm:"size(256);null"` // 模版id
|
|
|
T_deadline string `orm:"size(256);null"` // 截止时间
|
|
|
T_scheme string `orm:"size(256);null"` // 实施方案 负责人UUID
|
|
|
T_collection string `orm:"size(256);null"` // 数据采集 负责人UUID
|
|
@@ -154,7 +154,7 @@ type Task struct {
|
|
|
T_reporting_state int `orm:"size(2);default(0)"` // 报告编写 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
|
|
|
T_delivery_state int `orm:"size(2);default(0)"` // 交付审核 状态 0 未完成 1 已完成 2 处理中
|
|
|
T_marking_state int `orm:"size(2);default(0)"` // 验证标识 状态 0 未完成 1 已完成
|
|
|
- T_record string `orm:"type(text)"` // 领导备注
|
|
|
+ T_record string `orm:"type(text)"` // 领导备注
|
|
|
|
|
|
T_VerifyDeviceDataStartTime string `orm:"size(256);null"` // 验证设备数据开始时间
|
|
|
T_VerifyDeviceDataEndTime string `orm:"size(256);null"` // 验证设备数据开始时间
|
|
@@ -230,7 +230,6 @@ type Task struct {
|
|
|
T_reporting_return_times int `orm:"size(256);null"` // 验证报告退回次数
|
|
|
T_reporting_audit_record string `orm:"type(text);null"` // 验证报告审核记录
|
|
|
|
|
|
-
|
|
|
CreateTime time.Time `orm:"column(create_time);type(timestamp);null;auto_now_add"` //auto_now_add 第一次保存时才设置时间
|
|
|
UpdateTime time.Time `orm:"column(update_time);type(timestamp);null;auto_now"` //auto_now 每次 model 保存时都会对时间自动更新
|
|
|
}
|
|
@@ -243,8 +242,8 @@ type Task_ struct {
|
|
|
T_uuid string // 用户 UUID
|
|
|
T_user_name string // 用户 UUID
|
|
|
T_name string // 标题
|
|
|
- T_VerifyTemplate_class string // 任务模板id
|
|
|
- T_VerifyTemplate_id string // 任务模板id
|
|
|
+ T_VerifyTemplate_class string // 任务模版id
|
|
|
+ T_VerifyTemplate_id string // 任务模版id
|
|
|
T_deadline string // 截止时间
|
|
|
T_scheme string // 实施方案 负责人UUID
|
|
|
T_collection string // 数据采集 负责人UUID
|
|
@@ -289,7 +288,7 @@ type Task_ struct {
|
|
|
T_district_code string // 区 code
|
|
|
T_area_code []string // 省市区
|
|
|
InfoCollection InfoCollection.InfoCollection //信息采集
|
|
|
- T_record string //
|
|
|
+ T_record string //
|
|
|
|
|
|
}
|
|
|
|
|
@@ -297,14 +296,14 @@ type Task_Stat struct {
|
|
|
Id int
|
|
|
T_class int // 分类ID
|
|
|
T_InfoCollection_id string // 信息采集ID
|
|
|
- T_InfoTemplate_id string // 信息采集模板ID
|
|
|
+ T_InfoTemplate_id string // 信息采集模版ID
|
|
|
|
|
|
T_task_id string // 任务ID
|
|
|
T_uuid string // 用户 UUID
|
|
|
T_user_name string // 用户 UUID
|
|
|
T_name string // 标题
|
|
|
- T_VerifyTemplate_class string // 任务模板id
|
|
|
- T_VerifyTemplate_id string // 任务模板id
|
|
|
+ T_VerifyTemplate_class string // 任务模版id
|
|
|
+ T_VerifyTemplate_id string // 任务模版id
|
|
|
T_deadline string // 截止时间
|
|
|
T_scheme string // 实施方案 负责人UUID
|
|
|
T_collection string // 数据采集 负责人UUID
|
|
@@ -392,7 +391,7 @@ type Task_Stat struct {
|
|
|
T_reporting_audit_record string // 验证报告审核记录
|
|
|
InfoCollection InfoCollection.InfoCollection_R //信息菜鸡
|
|
|
|
|
|
- T_record string //
|
|
|
+ T_record string //
|
|
|
|
|
|
}
|
|
|
|
|
@@ -581,7 +580,7 @@ func TaskToTask_Stat(T Task, userMap, adminMap map[string]string) (T_ Task_Stat)
|
|
|
T_.T_collection_start_time = T.T_collection_start_time
|
|
|
T_.T_collection_end_time = T.T_collection_end_time
|
|
|
if T.T_collection_state == TaskCollectionStatePass ||
|
|
|
- T.T_collection_state == TaskCollectionStateSubmitted{
|
|
|
+ T.T_collection_state == TaskCollectionStateSubmitted {
|
|
|
T_.T_collection_time_interval = lib.ConvertMinutesToDHM(int(T.T_collection_time_interval))
|
|
|
T_.T_collection_overtime = lib.ConvertMinutesToDHM(int(T.T_collection_overtime))
|
|
|
}
|
|
@@ -766,6 +765,7 @@ func Add_Task_Visit(m Task) bool {
|
|
|
}
|
|
|
return false
|
|
|
}
|
|
|
+
|
|
|
// 获取用户任务列表
|
|
|
func Read_Task_List_All() ([]Task, int) {
|
|
|
|
|
@@ -783,6 +783,7 @@ func Read_Task_List_All() ([]Task, int) {
|
|
|
|
|
|
return r, int(cnt)
|
|
|
}
|
|
|
+
|
|
|
// 获取用户任务列表
|
|
|
func Read_UserTask_List(T_uuid string, T_name string, userMap, adminMap map[string]string, page int, page_z int) ([]Task_, int) {
|
|
|
|
|
@@ -818,7 +819,7 @@ func Read_UserTask_List(T_uuid string, T_name string, userMap, adminMap map[stri
|
|
|
// 获取任务列表
|
|
|
func Read_Task_List(T_uuid, T_admin, T_name, T_InfoCollection_id string, T_scheme, T_collection, T_reporting, T_delivery,
|
|
|
T_scheme_state, T_collection_state, T_reporting_state, T_delivery_state, T_marking_state string,
|
|
|
- T_company_list []string, userMap, adminMap map[string]string,CreateTime string, page int, page_z int) ([]Task_, int) {
|
|
|
+ T_company_list []string, userMap, adminMap map[string]string, CreateTime string, page int, page_z int) ([]Task_, int) {
|
|
|
|
|
|
o := orm.NewOrm()
|
|
|
|
|
@@ -875,13 +876,13 @@ func Read_Task_List(T_uuid, T_admin, T_name, T_InfoCollection_id string, T_schem
|
|
|
cond1 = cond1.And("T_marking_state", T_marking_state)
|
|
|
}
|
|
|
if len(CreateTime) > 0 {
|
|
|
- CreateTime_s := strings.Split(CreateTime,"-")
|
|
|
+ CreateTime_s := strings.Split(CreateTime, "-")
|
|
|
|
|
|
- if len(CreateTime_s) == 2{
|
|
|
+ if len(CreateTime_s) == 2 {
|
|
|
// 定义开始和结束时间
|
|
|
start := time.Date(lib.To_int(CreateTime_s[0]), time.Month(lib.To_int(CreateTime_s[1])), 1, 0, 0, 0, 0, time.UTC)
|
|
|
end := start.AddDate(0, 1, 0) // 下个月的第一天
|
|
|
- logs.Println("CreateTime_s:",start.Format("2006-01-02 15:04:05"),end.Format("2006-01-02 15:04:05"))
|
|
|
+ logs.Println("CreateTime_s:", start.Format("2006-01-02 15:04:05"), end.Format("2006-01-02 15:04:05"))
|
|
|
cond1 = cond1.And("CreateTime__gte", start).And("CreateTime__lt", end)
|
|
|
}
|
|
|
|
|
@@ -990,7 +991,7 @@ func Get_Task_UserList(T_type string) []string {
|
|
|
|
|
|
func Read_Task_Stat(T_uuid, T_admin, T_name, T_InfoCollection_id string, T_project, T_scheme, T_collection, T_reporting, T_delivery,
|
|
|
T_scheme_state, T_collection_state, T_reporting_state, T_delivery_state, T_marking_state string,
|
|
|
- T_company_list []string, userMap, adminMap map[string]string,CreateTime string, page int, page_z int) ([]Task_Stat, int) {
|
|
|
+ T_company_list []string, userMap, adminMap map[string]string, CreateTime string, page int, page_z int) ([]Task_Stat, int) {
|
|
|
|
|
|
o := orm.NewOrm()
|
|
|
|
|
@@ -1050,13 +1051,13 @@ func Read_Task_Stat(T_uuid, T_admin, T_name, T_InfoCollection_id string, T_proje
|
|
|
cond1 = cond1.And("T_marking_state", T_marking_state)
|
|
|
}
|
|
|
if len(CreateTime) > 0 {
|
|
|
- CreateTime_s := strings.Split(CreateTime,"-")
|
|
|
+ CreateTime_s := strings.Split(CreateTime, "-")
|
|
|
|
|
|
- if len(CreateTime_s) == 2{
|
|
|
+ if len(CreateTime_s) == 2 {
|
|
|
// 定义开始和结束时间
|
|
|
start := time.Date(lib.To_int(CreateTime_s[0]), time.Month(lib.To_int(CreateTime_s[1])), 1, 0, 0, 0, 0, time.UTC)
|
|
|
end := start.AddDate(0, 1, 0) // 下个月的第一天
|
|
|
- logs.Println("CreateTime_s:",start.Format("2006-01-02 15:04:05"),end.Format("2006-01-02 15:04:05"))
|
|
|
+ logs.Println("CreateTime_s:", start.Format("2006-01-02 15:04:05"), end.Format("2006-01-02 15:04:05"))
|
|
|
cond1 = cond1.And("CreateTime__gte", start).And("CreateTime__lt", end)
|
|
|
}
|
|
|
|
|
@@ -1077,9 +1078,8 @@ func Read_Task_Stat(T_uuid, T_admin, T_name, T_InfoCollection_id string, T_proje
|
|
|
return TaskList, int(cnt)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 获取用户任务列表
|
|
|
-func Read_UserTask_StatisticalRanking(T_uuid,T_scheme string) []Task {
|
|
|
+func Read_UserTask_StatisticalRanking(T_uuid, T_scheme string) []Task {
|
|
|
|
|
|
o := orm.NewOrm()
|
|
|
|
|
@@ -1089,12 +1089,10 @@ func Read_UserTask_StatisticalRanking(T_uuid,T_scheme string) []Task {
|
|
|
cond := orm.NewCondition()
|
|
|
//cond_T_uuid := orm.NewCondition().Or("T_scheme", T_uuid).Or("T_collection", T_uuid).Or("T_reporting", T_uuid)
|
|
|
//cond1 := cond.And("T_name__icontains", T_name).And("T_State", 1)
|
|
|
- cond1 := cond.And("T_State", 1).And(T_scheme,T_uuid)
|
|
|
-
|
|
|
+ cond1 := cond.And("T_State", 1).And(T_scheme, T_uuid)
|
|
|
|
|
|
qs.Limit(500, 0).SetCond((*orm2.Condition)(cond1)).OrderBy("-UpdateTime").All(&r)
|
|
|
qs.SetCond((*orm2.Condition)(cond1)).Count()
|
|
|
|
|
|
-
|
|
|
return r
|
|
|
-}
|
|
|
+}
|