|
@@ -731,13 +731,13 @@ func (c *TaskDataController) TaskData_AddS_Excel() {
|
|
|
}
|
|
|
|
|
|
// 删除重复数据
|
|
|
- err = Task.DeleteDeduplicate(T_task_id)
|
|
|
+ _, err = Task.DeleteDeduplicate(T_task_id)
|
|
|
if err != nil {
|
|
|
c.Data["json"] = lib.JSONS{Code: 202, Msg: "导入失败"}
|
|
|
c.ServeJSON()
|
|
|
return
|
|
|
}
|
|
|
- // 创建唯一缩影
|
|
|
+ // 创建唯一索引
|
|
|
err = Task.Create_Unique_Index(T_task_id)
|
|
|
if err != nil {
|
|
|
c.Data["json"] = lib.JSONS{Code: 202, Msg: "导入失败"}
|
|
@@ -2070,6 +2070,38 @@ func (c *TaskDataController) CopyFromPositionSN() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// DataRemoveDuplicates 数据去重
|
|
|
+func (c *TaskDataController) DataRemoveDuplicates() {
|
|
|
+ T_uuid, _ := lib.GetAdminT_Uuid(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id")
|
|
|
+ Task_r, err := NatsServer.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_task_id 错误!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if Task_r.T_collection_state == 2 {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "数据采集中,请稍后!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 删除重复数据
|
|
|
+ var count int64
|
|
|
+ count, err = Task.DeleteDeduplicate(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "导入失败"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ System.Add_UserLogs_T(T_uuid, "数据去重", fmt.Sprintf("数据平滑(%s)[%d]条", T_task_id, count), nil)
|
|
|
+
|
|
|
+ c.Data["json"] = lib.JSONS{200, "操作成功处理" + fmt.Sprint(count) + "条数据", nil}
|
|
|
+ c.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
// 数据偏移到区间内
|
|
|
func (c *TaskDataController) DataSkewingInterval() {
|
|
|
T_uuid, _ := lib.GetAdminT_Uuid(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
|