|
@@ -69,7 +69,7 @@ func (c *TaskController) List() {
|
|
|
T_reporting_state := c.GetString("T_reporting_state") // 报告编写 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
|
|
|
T_delivery_state := c.GetString("T_delivery_state") // 交付审核 状态 0 未完成 1 已完成 2 处理中
|
|
|
T_marking_state := c.GetString("T_marking_state") // 验证标识 状态 0 未完成 1 已完成
|
|
|
- CreateTime := c.GetString("CreateTime") // 任务添加时间
|
|
|
+ CreateTime := c.GetString("CreateTime") // 任务添加时间
|
|
|
|
|
|
UserMap := Account.UserListToMap(Account.Read_User_List_ALL_1())
|
|
|
AdminMap := Account.AdminListToMap(Account.Read_Admin_List_ALL_1())
|
|
@@ -80,14 +80,20 @@ func (c *TaskController) List() {
|
|
|
}
|
|
|
|
|
|
var T_admin string
|
|
|
- if User_r.T_power > 2 {
|
|
|
+ if User_r.T_power > 1 {
|
|
|
T_admin = User_r.T_uuid
|
|
|
}
|
|
|
+ // 经销商下管理员可查看自己经销商下所有的任务
|
|
|
+ // 经销商下其他角色只能查看分配给自己的任务
|
|
|
+ if len(User_r.T_Distributor_id) > 0 && User_r.T_power <= 2 {
|
|
|
+ T_admin = ""
|
|
|
+ }
|
|
|
|
|
|
var cnt int
|
|
|
- List, cnt := Task.Read_Task_List(T_uuid, T_admin, T_name, T_InfoCollection_id, T_scheme, T_collection, T_reporting, T_delivery,
|
|
|
+
|
|
|
+ List, cnt := Task.Read_Task_List(User_r.T_Distributor_id, T_uuid, T_admin, T_name, T_InfoCollection_id, T_scheme, T_collection, T_reporting, T_delivery,
|
|
|
T_scheme_state, T_collection_state, T_reporting_state, T_delivery_state, T_marking_state,
|
|
|
- T_company_list, UserMap, AdminMap,CreateTime, page, page_z)
|
|
|
+ T_company_list, UserMap, AdminMap, CreateTime, page, page_z)
|
|
|
|
|
|
page_size := math.Ceil(float64(cnt) / float64(page_z))
|
|
|
r_jsons.List = List
|
|
@@ -136,7 +142,7 @@ func (c *TaskController) Stat() {
|
|
|
T_reporting_state := c.GetString("T_reporting_state") // 报告编写 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
|
|
|
T_delivery_state := c.GetString("T_delivery_state") // 交付审核 状态 0 未完成 1 已完成 2 处理中
|
|
|
T_marking_state := c.GetString("T_marking_state") // 验证标识 状态 0 未完成 1 已完成
|
|
|
- CreateTime := c.GetString("CreateTime") // 任务添加时间
|
|
|
+ CreateTime := c.GetString("CreateTime") // 任务添加时间
|
|
|
|
|
|
UserMap := Account.UserListToMap(Account.Read_User_List_ALL_1())
|
|
|
AdminMap := Account.AdminListToMap(Account.Read_Admin_List_ALL_1())
|
|
@@ -152,9 +158,9 @@ func (c *TaskController) Stat() {
|
|
|
}
|
|
|
|
|
|
var cnt int
|
|
|
- List, cnt := Task.Read_Task_Stat(T_uuid, T_admin, T_name, T_InfoCollection_id, T_project, T_scheme, T_collection, T_reporting, T_delivery,
|
|
|
+ List, cnt := Task.Read_Task_Stat(User_r.T_Distributor_id, T_uuid, T_admin, T_name, T_InfoCollection_id, 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,
|
|
|
- T_company_list, UserMap, AdminMap,CreateTime, page, page_z)
|
|
|
+ T_company_list, UserMap, AdminMap, CreateTime, page, page_z)
|
|
|
|
|
|
page_size := math.Ceil(float64(cnt) / float64(page_z))
|
|
|
r_jsons.List = List
|
|
@@ -193,7 +199,7 @@ func (c *TaskController) Stat_Excel() {
|
|
|
T_reporting_state := c.GetString("T_reporting_state") // 报告编写 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
|
|
|
T_delivery_state := c.GetString("T_delivery_state") // 交付审核 状态 0 未完成 1 已完成 2 处理中
|
|
|
T_marking_state := c.GetString("T_marking_state") // 验证标识 状态 0 未完成 1 已完成
|
|
|
- CreateTime := c.GetString("CreateTime") // 任务添加时间
|
|
|
+ CreateTime := c.GetString("CreateTime") // 任务添加时间
|
|
|
|
|
|
UserMap := Account.UserListToMap(Account.Read_User_List_ALL_1())
|
|
|
AdminMap := Account.AdminListToMap(Account.Read_Admin_List_ALL_1())
|
|
@@ -208,9 +214,9 @@ func (c *TaskController) Stat_Excel() {
|
|
|
T_admin = User_r.T_uuid
|
|
|
}
|
|
|
|
|
|
- List, _ := Task.Read_Task_Stat(T_uuid, T_admin, T_name, T_InfoCollection_id, T_project, T_scheme, T_collection, T_reporting, T_delivery,
|
|
|
+ List, _ := Task.Read_Task_Stat(User_r.T_Distributor_id, T_uuid, T_admin, T_name, T_InfoCollection_id, 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,
|
|
|
- T_company_list, UserMap, AdminMap,CreateTime, 0, 9999)
|
|
|
+ T_company_list, UserMap, AdminMap, CreateTime, 0, 9999)
|
|
|
|
|
|
f := excelize.NewFile() // 设置单元格的值
|
|
|
line := 1
|
|
@@ -660,6 +666,7 @@ func (c *TaskController) Add() {
|
|
|
return
|
|
|
}
|
|
|
var_ := Task.Task{
|
|
|
+ T_Distributor_id: User_r.T_Distributor_id,
|
|
|
T_InfoCollection_id: T_InfoCollection_id,
|
|
|
T_InfoTemplate_id: infoCollection.T_InfoTemplate_id,
|
|
|
T_start_time: infoCollection.T_start_time, // 项目开始时间使用信息采集开始时间
|
|
@@ -708,7 +715,6 @@ func (c *TaskController) Add() {
|
|
|
go wx.WxSend(var_.T_reporting, fmt.Sprintf("【%s-%s】任务派发", company_r.T_name, var_.T_name))
|
|
|
go wx.WxSend(var_.T_delivery, fmt.Sprintf("【%s-%s】任务派发", company_r.T_name, var_.T_name))
|
|
|
|
|
|
-
|
|
|
// 添加任务操作日志
|
|
|
Task.Add_TaskLogs_T(User_r.T_uuid, T_task_id, "任务管理", "添加", var_)
|
|
|
System.Add_UserLogs_T(User_r.T_uuid, "任务管理", "添加", var_)
|
|
@@ -772,7 +778,7 @@ func (c *TaskController) ReceiptInfoCollection() {
|
|
|
// c.ServeJSON()
|
|
|
// return
|
|
|
//}
|
|
|
-
|
|
|
+
|
|
|
// 添加任务操作日志
|
|
|
//Task.Add_TaskLogs_T(User_r.T_uuid, T_task_id, "任务管理", "接收信息采集", task)
|
|
|
//System.Add_UserLogs_T(User_r.T_uuid, "任务管理", "接收信息采集", task)
|
|
@@ -897,8 +903,8 @@ func (c *TaskController) UpCollectionState() {
|
|
|
|
|
|
// 已退回(负责人)
|
|
|
if T_collection_state == Task.TaskCollectionStateReturn {
|
|
|
- System.Add_News(r.T_collection, fmt.Sprintf("【%s-%s】数据编辑 %s,%s", company_r.T_name, r.T_name, Task.TaskCollectionStateMap[T_collection_state],T_reason), "")
|
|
|
- go wx.WxSend(r.T_collection, fmt.Sprintf("【%s-%s】数据编辑 %s,%s", company_r.T_name, r.T_name, Task.TaskCollectionStateMap[T_collection_state],T_reason))
|
|
|
+ System.Add_News(r.T_collection, fmt.Sprintf("【%s-%s】数据编辑 %s,%s", company_r.T_name, r.T_name, Task.TaskCollectionStateMap[T_collection_state], T_reason), "")
|
|
|
+ go wx.WxSend(r.T_collection, fmt.Sprintf("【%s-%s】数据编辑 %s,%s", company_r.T_name, r.T_name, Task.TaskCollectionStateMap[T_collection_state], T_reason))
|
|
|
}
|
|
|
|
|
|
// 添加任务操作日志
|
|
@@ -960,14 +966,12 @@ func (c *TaskDataController) TaskData_Up_TaskData_Back() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 通知 报告人员
|
|
|
_, company_r := Account.Read_User_ByT_uuid(r.T_uuid)
|
|
|
infoCollection, _ := InfoCollection.Read_InfoCollection(r.T_InfoCollection_id)
|
|
|
System.Add_News(infoCollection.T_submit_uuid, fmt.Sprintf("【%s-%s】报告已完成,请及时通知客户审核", company_r.T_name, r.T_name), "")
|
|
|
go wx.WxSend(infoCollection.T_submit_uuid, fmt.Sprintf("【%s-%s】报告已完成,请及时通知客户审核", company_r.T_name, r.T_name))
|
|
|
|
|
|
-
|
|
|
c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
|
|
|
c.ServeJSON()
|
|
|
return
|
|
@@ -1004,9 +1008,7 @@ func (c *TaskController) Up() {
|
|
|
T_pdf2 := c.GetString("T_pdf2")
|
|
|
T_doc3 := c.GetString("T_doc3")
|
|
|
T_pdf3 := c.GetString("T_pdf3")
|
|
|
- T_pdf4 := c.GetString("T_pdf4") // 验证标识
|
|
|
-
|
|
|
-
|
|
|
+ T_pdf4 := c.GetString("T_pdf4") // 验证标识
|
|
|
|
|
|
T_VerifyDeviceDataStartTime := c.GetString("T_VerifyDeviceDataStartTime") // 验证设备数据开始时间
|
|
|
T_VerifyDeviceDataEndTime := c.GetString("T_VerifyDeviceDataEndTime") // 验证设备数据开始时间
|
|
@@ -1029,7 +1031,7 @@ func (c *TaskController) Up() {
|
|
|
T_subject_matter := c.GetString("T_subject_matter") // 标的物名称
|
|
|
T_temp_range := c.GetString("T_temp_range") // 验证温度范围
|
|
|
T_report_number := c.GetString("T_report_number") // 报告编号
|
|
|
- T_report_type := c.GetString("T_report_type") // 报告编号
|
|
|
+ T_report_type := c.GetString("T_report_type") // 报告编号
|
|
|
|
|
|
T_task_id := c.GetString("T_task_id")
|
|
|
r, is := Task.Read_Task(T_task_id)
|
|
@@ -1083,7 +1085,6 @@ func (c *TaskController) Up() {
|
|
|
clos = append(clos, "T_record")
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 完成编辑后设置实施结束时间
|
|
|
if T_collection_state == 4 {
|
|
|
r.T_collection_state = T_collection_state
|
|
@@ -1155,7 +1156,7 @@ func (c *TaskController) Up() {
|
|
|
// 所需时间 > 超时时间
|
|
|
if r.T_scheme_time_interval > Task.TaskSchemeTimeLimit[r.T_report_type] && len(r.T_report_type) > 0 {
|
|
|
r.T_scheme_overtime = r.T_scheme_time_interval - Task.TaskSchemeTimeLimit[r.T_report_type] // 超时时间
|
|
|
- if Task.TaskSchemeTimeLimit[r.T_report_type] == 0 {
|
|
|
+ if Task.TaskSchemeTimeLimit[r.T_report_type] == 0 {
|
|
|
r.T_scheme_overtime = 0
|
|
|
}
|
|
|
clos = append(clos, "T_scheme_overtime")
|
|
@@ -1261,7 +1262,7 @@ func (c *TaskController) Up() {
|
|
|
// 从3.0获取校准时间
|
|
|
if len(T_sn) > 0 && len(T_CalibrationExpirationTime) == 0 {
|
|
|
|
|
|
- go func(r Task.Task,T_sn ,T_CalibrationExpirationTime string) {
|
|
|
+ go func(r Task.Task, T_sn, T_CalibrationExpirationTime string) {
|
|
|
NatsServer.Cold_UpdateDevice_CalibrationTime(T_sn, T_CalibrationExpirationTime)
|
|
|
device, err := NatsServer.Cold_ReadDeviceByT_sn(T_sn)
|
|
|
if err == nil {
|
|
@@ -1271,7 +1272,7 @@ func (c *TaskController) Up() {
|
|
|
Task.Update_Task(r, "T_CalibrationExpirationTime")
|
|
|
}
|
|
|
}
|
|
|
- }(r,T_sn,T_CalibrationExpirationTime)
|
|
|
+ }(r, T_sn, T_CalibrationExpirationTime)
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1451,23 +1452,21 @@ func (c *TaskController) UpSchemeState() {
|
|
|
go wx.WxSend(infoCollection.T_submit_uuid, fmt.Sprintf("【%s-%s】验证方案 %s,请尽快与客户沟通确定", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state]))
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 已退回(负责人)
|
|
|
if T_scheme_state == Task.TaskSchemeStateReturn {
|
|
|
- System.Add_News(r.T_scheme, fmt.Sprintf("【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state],T_reason), "")
|
|
|
- go wx.WxSend(r.T_scheme, fmt.Sprintf("【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state],T_reason))
|
|
|
+ System.Add_News(r.T_scheme, fmt.Sprintf("【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state], T_reason), "")
|
|
|
+ go wx.WxSend(r.T_scheme, fmt.Sprintf("【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state], T_reason))
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 已退回(客户)
|
|
|
if T_scheme_state == Task.TaskSchemeStateClientReturn {
|
|
|
- System.Add_News(r.T_scheme, fmt.Sprintf("!!!【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state],T_reason), "")
|
|
|
- go wx.WxSend(r.T_scheme, fmt.Sprintf("!!!【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name,Task.TaskSchemeStateMap[T_scheme_state],T_reason))
|
|
|
+ System.Add_News(r.T_scheme, fmt.Sprintf("!!!【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state], T_reason), "")
|
|
|
+ go wx.WxSend(r.T_scheme, fmt.Sprintf("!!!【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state], T_reason))
|
|
|
|
|
|
- System.Add_News(conf.VdelUuid, fmt.Sprintf("!!!【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state],T_reason), "")
|
|
|
- go wx.WxSend(conf.VdelUuid, fmt.Sprintf("!!!【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name,Task.TaskSchemeStateMap[T_scheme_state],T_reason))
|
|
|
+ System.Add_News(conf.VdelUuid, fmt.Sprintf("!!!【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state], T_reason), "")
|
|
|
+ go wx.WxSend(conf.VdelUuid, fmt.Sprintf("!!!【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state], T_reason))
|
|
|
|
|
|
- go wx.WxSend(conf.BoosUuid, fmt.Sprintf("!!!【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name,Task.TaskSchemeStateMap[T_scheme_state],T_reason))
|
|
|
+ go wx.WxSend(conf.BoosUuid, fmt.Sprintf("!!!【%s-%s】验证方案 %s,%s", company_r.T_name, r.T_name, Task.TaskSchemeStateMap[T_scheme_state], T_reason))
|
|
|
}
|
|
|
|
|
|
// 添加任务操作日志
|
|
@@ -1588,15 +1587,15 @@ func (c *TaskController) UpReportingState() {
|
|
|
// 已通过
|
|
|
if T_reporting_state == Task.TaskReportingStatePass {
|
|
|
System.Add_News(infoCollection.T_submit_uuid, fmt.Sprintf("【%s-%s】验证报告 %s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state]), "")
|
|
|
- go wx.WxSend(infoCollection.T_submit_uuid, fmt.Sprintf("【%s-%s】验证报告 %s", infoCollection.T_name, r.T_name,Task.TaskReportingStateMap[T_reporting_state]))
|
|
|
+ go wx.WxSend(infoCollection.T_submit_uuid, fmt.Sprintf("【%s-%s】验证报告 %s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state]))
|
|
|
|
|
|
System.Add_News(r.T_reporting, fmt.Sprintf("【%s-%s】验证报告 %s,请及时 打印报告", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state]), "")
|
|
|
- go wx.WxSend(r.T_reporting, fmt.Sprintf("【%s-%s】验证报告 %s,请及时 打印报告", infoCollection.T_name, r.T_name,Task.TaskReportingStateMap[T_reporting_state]))
|
|
|
+ go wx.WxSend(r.T_reporting, fmt.Sprintf("【%s-%s】验证报告 %s,请及时 打印报告", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state]))
|
|
|
}
|
|
|
// 已退回
|
|
|
if T_reporting_state == Task.TaskReportingStateReturn {
|
|
|
- System.Add_News(r.T_reporting, fmt.Sprintf("【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state],T_reason), "")
|
|
|
- go wx.WxSend(r.T_reporting, fmt.Sprintf("【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name,Task.TaskReportingStateMap[T_reporting_state],T_reason))
|
|
|
+ System.Add_News(r.T_reporting, fmt.Sprintf("【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason), "")
|
|
|
+ go wx.WxSend(r.T_reporting, fmt.Sprintf("【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason))
|
|
|
}
|
|
|
// 已通过(客户) 通知销售
|
|
|
if T_reporting_state == Task.TaskReportingStateClientPass {
|
|
@@ -1604,22 +1603,22 @@ func (c *TaskController) UpReportingState() {
|
|
|
}
|
|
|
|
|
|
if T_reporting_state == Task.TaskReportingStateClientReturn {
|
|
|
- System.Add_News(r.T_scheme, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state],T_reason), "")
|
|
|
- go wx.WxSend(r.T_scheme, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name,Task.TaskReportingStateMap[T_reporting_state],T_reason))
|
|
|
+ System.Add_News(r.T_scheme, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason), "")
|
|
|
+ go wx.WxSend(r.T_scheme, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason))
|
|
|
|
|
|
- System.Add_News(r.T_collection, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state],T_reason), "")
|
|
|
- go wx.WxSend(r.T_collection, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name,Task.TaskReportingStateMap[T_reporting_state],T_reason))
|
|
|
+ System.Add_News(r.T_collection, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason), "")
|
|
|
+ go wx.WxSend(r.T_collection, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason))
|
|
|
|
|
|
- System.Add_News(r.T_reporting, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state],T_reason), "")
|
|
|
- go wx.WxSend(r.T_reporting, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name,Task.TaskReportingStateMap[T_reporting_state],T_reason))
|
|
|
+ System.Add_News(r.T_reporting, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason), "")
|
|
|
+ go wx.WxSend(r.T_reporting, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason))
|
|
|
|
|
|
//System.Add_News(r.T_delivery, fmt.Sprintf("!!!【%s-%s】验证报告 %s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state]), "")
|
|
|
//go wx.WxSend(r.T_delivery, fmt.Sprintf("!!!【%s-%s】验证报告 %s", infoCollection.T_name, r.T_name,Task.TaskReportingStateMap[T_reporting_state]))
|
|
|
|
|
|
- System.Add_News(conf.VdelUuid, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state],T_reason), "")
|
|
|
- go wx.WxSend(conf.VdelUuid, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name,Task.TaskReportingStateMap[T_reporting_state],T_reason))
|
|
|
+ System.Add_News(conf.VdelUuid, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason), "")
|
|
|
+ go wx.WxSend(conf.VdelUuid, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason))
|
|
|
|
|
|
- go wx.WxSend(conf.BoosUuid, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state],T_reason))
|
|
|
+ go wx.WxSend(conf.BoosUuid, fmt.Sprintf("!!!【%s-%s】验证报告 %s,%s", infoCollection.T_name, r.T_name, Task.TaskReportingStateMap[T_reporting_state], T_reason))
|
|
|
}
|
|
|
|
|
|
// 添加任务操作日志
|
|
@@ -1651,7 +1650,7 @@ func (c *TaskController) EnterArea() {
|
|
|
// 方案开始
|
|
|
if len(r.T_scheme_start_time) == 0 {
|
|
|
r.T_scheme_start_time = time.Now().Format("2006-01-02 15:04:05")
|
|
|
- Task.Update_Task(r,"T_scheme_start_time")
|
|
|
+ Task.Update_Task(r, "T_scheme_start_time")
|
|
|
}
|
|
|
|
|
|
// 添加任务操作日志
|
|
@@ -2440,17 +2439,17 @@ func (c *TaskController) StatisticalRanking() {
|
|
|
// 退回
|
|
|
if T.T_scheme_return_times > 0 {
|
|
|
Admin_t.T_scheme_returnnum += T.T_scheme_return_times
|
|
|
- Admin_t.T_scheme_log += " | 退回"+ lib.To_string(int(T.T_scheme_return_times))
|
|
|
+ Admin_t.T_scheme_log += " | 退回" + lib.To_string(int(T.T_scheme_return_times))
|
|
|
}
|
|
|
// 超时
|
|
|
if T.T_scheme_overtime > 0 {
|
|
|
Admin_t.T_scheme_overnum += 1
|
|
|
- Admin_t.T_scheme_log += " | 超时"+ lib.ConvertMinutesToDHM(int(T.T_scheme_overtime))
|
|
|
+ Admin_t.T_scheme_log += " | 超时" + lib.ConvertMinutesToDHM(int(T.T_scheme_overtime))
|
|
|
}
|
|
|
// 驳回
|
|
|
if T.T_reject_times > 0 {
|
|
|
Admin_t.T_rejectdnum += T.T_reject_times
|
|
|
- Admin_t.T_scheme_log += " | 驳回"+ lib.To_string(int(T.T_reject_times))
|
|
|
+ Admin_t.T_scheme_log += " | 驳回" + lib.To_string(int(T.T_reject_times))
|
|
|
}
|
|
|
|
|
|
Admin_t.T_scheme_log += "\n"
|
|
@@ -2468,17 +2467,17 @@ func (c *TaskController) StatisticalRanking() {
|
|
|
// 退回
|
|
|
if T.T_collection_return_times > 0 {
|
|
|
Admin_t.T_collection_returnnum += T.T_collection_return_times
|
|
|
- Admin_t.T_collection_log += " | 退回"+ lib.To_string(int(T.T_collection_return_times))
|
|
|
+ Admin_t.T_collection_log += " | 退回" + lib.To_string(int(T.T_collection_return_times))
|
|
|
}
|
|
|
// 超时
|
|
|
if T.T_collection_overtime > 0 {
|
|
|
Admin_t.T_collection_overnum += 1
|
|
|
- Admin_t.T_collection_log += " | 超时"+ lib.ConvertMinutesToDHM(int(T.T_collection_overtime))
|
|
|
+ Admin_t.T_collection_log += " | 超时" + lib.ConvertMinutesToDHM(int(T.T_collection_overtime))
|
|
|
}
|
|
|
// 驳回
|
|
|
if T.T_reject_times > 0 {
|
|
|
Admin_t.T_rejectdnum += T.T_reject_times
|
|
|
- Admin_t.T_collection_log += " | 驳回"+ lib.To_string(int(T.T_reject_times))
|
|
|
+ Admin_t.T_collection_log += " | 驳回" + lib.To_string(int(T.T_reject_times))
|
|
|
}
|
|
|
|
|
|
Admin_t.T_collection_log += "\n"
|
|
@@ -2496,17 +2495,17 @@ func (c *TaskController) StatisticalRanking() {
|
|
|
// 退回
|
|
|
if T.T_reporting_return_times > 0 {
|
|
|
Admin_t.T_reporting_returnnum += T.T_reporting_return_times
|
|
|
- Admin_t.T_reporting_log += " | 退回"+ lib.To_string(int(T.T_reporting_return_times))
|
|
|
+ Admin_t.T_reporting_log += " | 退回" + lib.To_string(int(T.T_reporting_return_times))
|
|
|
}
|
|
|
// 超时
|
|
|
if T.T_reporting_overtime > 0 {
|
|
|
Admin_t.T_reporting_overnum += 1
|
|
|
- Admin_t.T_reporting_log += " | 超时"+ lib.ConvertMinutesToDHM(int(T.T_reporting_overtime))
|
|
|
+ Admin_t.T_reporting_log += " | 超时" + lib.ConvertMinutesToDHM(int(T.T_reporting_overtime))
|
|
|
}
|
|
|
// 驳回
|
|
|
if T.T_reject_times > 0 {
|
|
|
Admin_t.T_rejectdnum += T.T_reject_times
|
|
|
- Admin_t.T_reporting_log += " | 驳回"+ lib.To_string(int(T.T_reject_times))
|
|
|
+ Admin_t.T_reporting_log += " | 驳回" + lib.To_string(int(T.T_reject_times))
|
|
|
}
|
|
|
Admin_t.T_reporting_log += "\n"
|
|
|
}
|
|
@@ -2525,3 +2524,87 @@ func (c *TaskController) StatisticalRanking() {
|
|
|
c.ServeJSON()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// 添加-
|
|
|
+func (c *TaskController) Copy() {
|
|
|
+
|
|
|
+ // 验证登录 User_is, User_r
|
|
|
+ User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
|
|
|
+ if !User_is {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ T_name := c.GetString("T_name")
|
|
|
+ T_task_id := c.GetString("T_task_id")
|
|
|
+ r, is := Task.Read_Task(T_task_id)
|
|
|
+ if !is {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "获取信息采集失败!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 查询信息采集信息
|
|
|
+ infoCollection, is := InfoCollection.Read_InfoCollection(r.T_InfoCollection_id)
|
|
|
+ if !is {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "获取信息采集失败!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var_ := Task.Task{
|
|
|
+ T_Distributor_id: User_r.T_Distributor_id,
|
|
|
+ T_InfoCollection_id: r.T_InfoCollection_id,
|
|
|
+ T_InfoTemplate_id: infoCollection.T_InfoTemplate_id,
|
|
|
+ T_start_time: infoCollection.T_start_time, // 项目开始时间使用信息采集开始时间
|
|
|
+ T_class: r.T_class,
|
|
|
+ T_uuid: r.T_uuid,
|
|
|
+ T_name: T_name,
|
|
|
+ T_VerifyTemplate_class: r.T_VerifyTemplate_class,
|
|
|
+ T_VerifyTemplate_id: r.T_VerifyTemplate_id,
|
|
|
+ T_deadline: r.T_deadline,
|
|
|
+ T_scheme: r.T_scheme,
|
|
|
+ T_collection: r.T_collection,
|
|
|
+ T_reporting: r.T_reporting,
|
|
|
+ T_delivery: r.T_delivery,
|
|
|
+ T_Show: 1,
|
|
|
+ T_State: 1,
|
|
|
+
|
|
|
+ T_project: r.T_project,
|
|
|
+ T_province: r.T_province,
|
|
|
+ T_city: r.T_city,
|
|
|
+ T_district: r.T_district,
|
|
|
+ T_province_code: r.T_province_code,
|
|
|
+ T_city_code: r.T_city_code,
|
|
|
+ T_district_code: r.T_district_code,
|
|
|
+ T_category: r.T_category,
|
|
|
+ T_device_type: r.T_device_type,
|
|
|
+ T_volume: r.T_volume,
|
|
|
+ T_verify_type: r.T_verify_type,
|
|
|
+ T_subject_matter: r.T_subject_matter,
|
|
|
+ T_temp_range: r.T_temp_range,
|
|
|
+ T_report_number: r.T_report_number,
|
|
|
+ T_report_type: r.T_report_type,
|
|
|
+ }
|
|
|
+
|
|
|
+ id, is := Task.Add_Task(var_)
|
|
|
+ if !is {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "添加失败!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ NatsServer.Create_Local_Table(T_task_id)
|
|
|
+
|
|
|
+ // 通知
|
|
|
+ _, company_r := Account.Read_User_ByT_uuid(var_.T_uuid)
|
|
|
+ go wx.WxSend(var_.T_scheme, fmt.Sprintf("【%s-%s】任务派发", company_r.T_name, var_.T_name))
|
|
|
+ go wx.WxSend(var_.T_collection, fmt.Sprintf("【%s-%s】任务派发", company_r.T_name, var_.T_name))
|
|
|
+ go wx.WxSend(var_.T_reporting, fmt.Sprintf("【%s-%s】任务派发", company_r.T_name, var_.T_name))
|
|
|
+ go wx.WxSend(var_.T_delivery, fmt.Sprintf("【%s-%s】任务派发", company_r.T_name, var_.T_name))
|
|
|
+
|
|
|
+ // 添加任务操作日志
|
|
|
+ Task.Add_TaskLogs_T(User_r.T_uuid, id, "任务管理", "添加", var_)
|
|
|
+ System.Add_UserLogs_T(User_r.T_uuid, "任务管理", "添加", var_)
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: id}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+}
|