Просмотр исходного кода

代码提交-通知管理 任务管理

zoie 1 месяц назад
Родитель
Сommit
87857c540a

+ 63 - 0
Nats/NatsServer/NatsColdApi.go

@@ -8,6 +8,42 @@ import (
 	"time"
 )
 
+
+type Device struct {
+	T_sn              string    // 设备序列号
+	T_pid             int       // Account.Company 绑定公司
+	T_devName         string    // 设备名称  20字
+	T_protocol        int       // 冷链通讯协议 1 :1.0协议   2 :2.0协议    3 :3.0协议
+	T_mqttid          string    // MQTT 服务ID
+	T_VerifyTime      time.Time // 验证时间
+	T_CalibrationTime time.Time // 校准时间
+	T_PatrolTime      time.Time // 巡检时间
+	T_abandonTime     time.Time // 弃用时间
+	T_ist             int       // 温度   1开启   2关闭
+	T_ish             int       // 湿度   1开启   2关闭
+
+	T_State int // 0 屏蔽   1 正常  (屏蔽后 只有内部管理员才能看到,用户 输入SN\名称 搜索时 也能看到)
+
+	// 设备同步参数
+	T_Dattery  int    // 电量
+	T_Site     string // GPS
+	T_monitor  int    // 监控状态 0 未监控 1 监控  停止记录
+	T_online   int    // 在线状态 0 未启用  1 在线  2 离线
+	T_online_s int    // 在线状态-备用  0 未启用  1 在线  2 离线
+
+	// 硬件信息
+	T_model string // KF200BG  设备型号
+	T_sver  string // "1.0.0",//软件版本
+	T_hver  string // "1.0.0",//硬件版本
+	T_imei  string // "867387060327718",//模组imei
+	T_iccid string // "89860477102170049750",//sim卡号
+	T_rssi  string // "80",//信号强度
+
+	CreateTime time.Time //auto_now_add 第一次保存时才设置时间
+	UpdateTime time.Time //auto_now 每次 model 保存时都会对时间自动更新
+}
+
+
 func Cold_UpdateDevice_CalibrationTime(T_sn, T_CalibrationExpirationTime string) error {
 	logs.Println("Nats =>", lib.FuncName(), T_sn, T_CalibrationExpirationTime)
 
@@ -47,3 +83,30 @@ func Cold_UpdateDevice_CalibrationTime(T_sn, T_CalibrationExpirationTime string)
 	}
 	return nil
 }
+
+func Cold_ReadDeviceByT_sn(T_sn string) (data Device, err error) {
+
+	msg, err := lib.Nats.Request("Cold_ReadDeviceByT_sn", []byte(T_sn), 3*time.Second)
+	if err != nil {
+		return
+	}
+
+	type T_R struct {
+		Code int16  `xml:"Code"`
+		Msg  string `xml:"Msg"`
+		Data Device `xml:"Data"` // 泛型
+	}
+	var t_R T_R
+
+	err = msgpack.Unmarshal(msg.Data, &t_R)
+	if err != nil {
+		return
+	}
+	if t_R.Code != 200 {
+		err = errors.New(t_R.Msg)
+		return
+	}
+	data = t_R.Data
+
+	return data, nil
+}

+ 4 - 0
README.md

@@ -3,6 +3,10 @@
 冷链验证报告系统
 
 ## 项目部署
+安装python依赖
+```bash
+pip install PyPDF2
+```
 
 ### 1、修改配置文件
 conf/app.conf

+ 5 - 0
conf/app.conf

@@ -30,3 +30,8 @@ Qiniu_AccessKey = "-8ezB_d-8-eUFTMvhOGbGzgeQRPeKQnaQ3DBcUxo"
 Qiniu_SecretKey = "KFhkYxTAJ2ZPN3ZS3euTsfWk8-C92rKgkhAMkDRN"
 Qiniu_BUCKET = "bzdcoldverify"
 Oss = "https://bzdcoldverifyoss.baozhida.cn"
+
+
+# 发送微信通知
+WechatNews_GroupName = "宝智达-软件组"
+WechatNews_Url = "http://111.85.177.202:12088/send"

+ 5 - 0
conf/app_prod.conf

@@ -30,3 +30,8 @@ Qiniu_AccessKey = "-8ezB_d-8-eUFTMvhOGbGzgeQRPeKQnaQ3DBcUxo"
 Qiniu_SecretKey = "KFhkYxTAJ2ZPN3ZS3euTsfWk8-C92rKgkhAMkDRN"
 Qiniu_BUCKET = "bzdcoldverify"
 Oss = "https://bzdcoldverifyoss.baozhida.cn"
+
+# 发送微信通知
+WechatNews_GroupName = "宝智达-软件组"
+WechatNews_Url = "http://111.85.177.202:12088/send"
+

+ 4 - 0
conf/config.go

@@ -34,3 +34,7 @@ var Qiniu_BUCKET, _ = beego.AppConfig.String("Qiniu_BUCKET")
 var OssQiniu = "https://bzdcoldverifyoss.baozhida.cn"
 var Oss, _ = beego.AppConfig.String("Oss")
 var Oss_file, _ = beego.AppConfig.String("Oss_file")
+
+// 微信消息群通知
+var WechatNews_GroupName, _ = beego.AppConfig.String("WechatNews_GroupName")
+var WechatNews_Url, _ = beego.AppConfig.String("WechatNews_Url")

+ 17 - 17
controllers/InfoTemplate.go

@@ -10,6 +10,7 @@ import (
 	beego "github.com/beego/beego/v2/server/web"
 	"math"
 	"strconv"
+	"time"
 )
 
 type InfoTemplateController struct {
@@ -416,7 +417,7 @@ func (c *InfoTemplateController) Map_Data_List() {
 	T_InfoTemplate_id := c.GetString("T_InfoTemplate_id")
 
 	T_InfoCollection_id := c.GetString("T_InfoCollection_id")
-	_, is := InfoCollection.Read_InfoCollection(T_InfoTemplate_id)
+	_, is := InfoCollection.Read_InfoCollection(T_InfoCollection_id)
 	if !is {
 		c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_InfoCollection_id 错误!"}
 		c.ServeJSON()
@@ -467,19 +468,28 @@ func (c *InfoTemplateController) Map_Data_Pu() {
 
 	User_r, User_is := Account.Verification_Admin(body.User_tokey, "")
 	if !User_is {
-		System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签数据", "未登录-保存", body)
+		System.Add_UserLogs_T(User_r.T_uuid, "信息采集模版标签数据", "未登录-保存", body)
 		c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
 		c.ServeJSON()
 		return
 	}
-	_, is := InfoCollection.Read_InfoCollection(body.T_InfoCollection_id)
-
+	infoCollection, is := InfoCollection.Read_InfoCollection(body.T_InfoCollection_id)
 	if !is {
 		c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_InfoCollection_id 错误!"}
 		c.ServeJSON()
 		return
 	}
 
+	// 如果信息采集开始时间为空,则设置为当前时间
+	if len(infoCollection.T_start_time) == 0 {
+		infoCollection.T_start_time = time.Now().Format("2006-01-02 15:04:05")
+		if !InfoCollection.Update_InfoCollection(infoCollection, "T_start_time") {
+			c.Data["json"] = lib.JSONS{Code: 202, Msg: "修改信息采集开始时间失败!"}
+			c.ServeJSON()
+			return
+		}
+	}
+
 	MapDataList := make([]InfoCollection.InfoTemplateMapData, 0)
 	for _, v := range body.InfoTemplateMapData {
 		val := InfoCollection.InfoTemplateMapData{
@@ -496,7 +506,7 @@ func (c *InfoTemplateController) Map_Data_Pu() {
 		c.ServeJSON()
 		return
 	}
-	System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签数据", "保存", body)
+	System.Add_UserLogs_T(User_r.T_uuid, "信息采集模版标签数据", "保存", body)
 
 	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: ids}
 	c.ServeJSON()
@@ -512,16 +522,6 @@ func (c *InfoTemplateController) Map_Data_Copy() {
 		return
 	}
 
-	T_source, _ := c.GetInt("T_source")
-
-	T_flow, _ := c.GetInt("T_flow")
-
-	if T_flow == 0 && T_source == 0 {
-		c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_source Err!"}
-		c.ServeJSON()
-		return
-	}
-
 	T_copy_InfoCollection_id := c.GetString("T_copy_InfoCollection_id")
 	copy_InfoCollection, is := InfoCollection.Read_InfoCollection(T_copy_InfoCollection_id)
 	if !is {
@@ -543,7 +543,7 @@ func (c *InfoTemplateController) Map_Data_Copy() {
 		return
 	}
 
-	list := InfoCollection.Read_MapData_List(T_source, T_copy_InfoCollection_id, copy_InfoCollection.T_InfoTemplate_id)
+	list := InfoCollection.Read_MapData_List(T_copy_InfoCollection_id, copy_InfoCollection.T_InfoTemplate_id)
 
 	MapDataList := make([]InfoCollection.InfoTemplateMapData, 0)
 	for _, v := range list {
@@ -562,7 +562,7 @@ func (c *InfoTemplateController) Map_Data_Copy() {
 		c.ServeJSON()
 		return
 	}
-	System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签数据", "复制", MapDataList)
+	System.Add_UserLogs_T(User_r.T_uuid, "信息采集模版标签数据", "复制", MapDataList)
 
 	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: ids}
 	c.ServeJSON()

+ 78 - 0
controllers/News.go

@@ -0,0 +1,78 @@
+package controllers
+
+import (
+	"ColdVerify_server/conf"
+	"ColdVerify_server/lib"
+	"ColdVerify_server/models/Account"
+	"ColdVerify_server/models/System"
+	beego "github.com/beego/beego/v2/server/web"
+	"math"
+)
+
+type NewsController struct {
+	beego.Controller
+}
+
+// 列表 -
+func (c *NewsController) List() {
+	// 验证登录 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
+	}
+	// 分页参数 初始化
+	page, _ := c.GetInt("page")
+	if page < 1 {
+		page = 1
+	}
+	page_z, _ := c.GetInt("page_z")
+	if page_z < 1 {
+		page_z = conf.Page_size
+	}
+
+	// 查询
+	T_title := c.GetString("T_title")
+	T_Tag, _ := c.GetInt("T_Tag")
+	List, cnt := System.Read_News_List(User_r.T_uuid, T_title, T_Tag, page, page_z)
+	var r_jsons lib.R_JSONS
+	page_size := math.Ceil(float64(cnt) / float64(page_z))
+	r_jsons.List = List
+	r_jsons.Page = page
+	r_jsons.Page_size = int(page_size)
+	r_jsons.Pages = lib.Func_page(int64(page), int64(page_size))
+	r_jsons.Num = int(cnt)
+
+	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: r_jsons}
+	c.ServeJSON()
+	return
+}
+
+func (c *NewsController) See() {
+	// 验证登录 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
+	}
+	Id, _ := c.GetInt("Id")
+
+	if Id == 0 {
+		c.Data["json"] = lib.JSONS{Code: 201, Msg: "Id Err!"}
+		c.ServeJSON()
+		return
+	}
+
+	if err := System.Update_News_Tag(Id, User_r.T_uuid); err != nil {
+		c.Data["json"] = lib.JSONS{Code: 200, Msg: "修改失败!"}
+		c.ServeJSON()
+		return
+	}
+
+	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
+	c.ServeJSON()
+	return
+
+}

Разница между файлами не показана из-за своего большого размера
+ 1037 - 26
controllers/Task.go


+ 2 - 0
controllers/TaskData.go

@@ -1353,6 +1353,8 @@ func (c *TaskDataController) TaskData_Pdf(Time_start, Time_end, T_task_id, T_sn,
 	return nil
 
 }
+
+// 添加公章图片
 func addStampImage(pdf *gopdf.GoPdf, x, y float64) {
 	imagePath := "./static/commonSeal.jpg"
 	if x < 10 {

+ 205 - 14
controllers/infoCollection.go

@@ -4,11 +4,16 @@ import (
 	"ColdVerify_server/Nats/NatsServer"
 	"ColdVerify_server/conf"
 	"ColdVerify_server/lib"
+	"ColdVerify_server/logs"
 	"ColdVerify_server/models/Account"
 	"ColdVerify_server/models/InfoCollection"
 	"ColdVerify_server/models/System"
+	"ColdVerify_server/models/Task"
+	"encoding/json"
+	"fmt"
 	beego "github.com/beego/beego/v2/server/web"
 	"math"
+	"time"
 )
 
 type InfoCollectionController struct {
@@ -18,7 +23,7 @@ type InfoCollectionController struct {
 // 列表 -
 func (c *InfoCollectionController) List() {
 	// 验证登录 User_is, User_r
-	User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
+	_, 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()
@@ -37,16 +42,15 @@ func (c *InfoCollectionController) List() {
 
 	T_name := c.GetString("T_name")
 	T_uuid := c.GetString("T_uuid")
+	T_status, _ := c.GetInt("T_status")
 
+	UserMap := Account.UserListToMap(Account.Read_User_List_ALL_1())
 	AdminMap := Account.AdminListToMap(Account.Read_Admin_List_ALL_1())
-
-	var T_admin string
-	if User_r.T_power > 2 {
-		T_admin = User_r.T_uuid
-	}
+	InfoTemplateMap := InfoCollection.InfoTemplateListToMap(InfoCollection.Read_InfoTemplate_List_ALL())
+	InfoTemplateClassMap := InfoCollection.InfoTemplateClassListToMap(InfoCollection.Read_InfoTemplateClass_List_ALL())
 
 	var cnt int
-	List, cnt := InfoCollection.Read_InfoCollection_List(T_uuid, T_admin, T_name, AdminMap, page, page_z)
+	List, cnt := InfoCollection.Read_InfoCollection_List(T_uuid, T_name, T_status, UserMap, AdminMap, InfoTemplateMap, InfoTemplateClassMap, page, page_z)
 
 	page_size := math.Ceil(float64(cnt) / float64(page_z))
 	r_jsons.List = List
@@ -60,10 +64,10 @@ func (c *InfoCollectionController) List() {
 	return
 }
 
-// 列表 -
-func (c *InfoCollectionController) UserInfoCollectionList() {
+// 用户列表
+func (c *InfoCollectionController) UserList() {
 	// 验证登录 User_is, User_r
-	User_r, User_is := Account.Verification(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
+	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()
@@ -81,10 +85,14 @@ func (c *InfoCollectionController) UserInfoCollectionList() {
 	}
 
 	T_name := c.GetString("T_name")
+	T_status, _ := c.GetInt("T_status")
+	UserMap := Account.UserListToMap(Account.Read_User_List_ALL_1())
 	AdminMap := Account.AdminListToMap(Account.Read_Admin_List_ALL_1())
+	InfoTemplateMap := InfoCollection.InfoTemplateListToMap(InfoCollection.Read_InfoTemplate_List_ALL())
+	InfoTemplateClassMap := InfoCollection.InfoTemplateClassListToMap(InfoCollection.Read_InfoTemplateClass_List_ALL())
 
 	var cnt int
-	List, cnt := InfoCollection.Read_UserInfoCollection_List(User_r.T_uuid, T_name, AdminMap, page, page_z)
+	List, cnt := InfoCollection.Read_UserInfoCollection_List(User_r.T_uuid, T_name, T_status, UserMap, AdminMap, InfoTemplateMap, InfoTemplateClassMap, page, page_z)
 	page_size := math.Ceil(float64(cnt) / float64(page_z))
 	r_jsons.List = List
 	r_jsons.Page = page
@@ -114,8 +122,11 @@ func (c *InfoCollectionController) Get() {
 		c.ServeJSON()
 		return
 	}
-
-	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: InfoCollection.InfoCollectionToInfoCollection_R(r, map[string]string{})}
+	UserMap := Account.UserListToMap(Account.Read_User_List_ALL_1())
+	AdminMap := Account.AdminListToMap(Account.Read_Admin_List_ALL_1())
+	InfoTemplateMap := InfoCollection.InfoTemplateListToMap(InfoCollection.Read_InfoTemplate_List_ALL())
+	InfoTemplateClassMap := InfoCollection.InfoTemplateClassListToMap(InfoCollection.Read_InfoTemplateClass_List_ALL())
+	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: InfoCollection.InfoCollectionToInfoCollection_R(r, UserMap, AdminMap, InfoTemplateMap, InfoTemplateClassMap)}
 	c.ServeJSON()
 	return
 }
@@ -148,7 +159,7 @@ func (c *InfoCollectionController) Add() {
 
 	T_InfoCollection_id, err := InfoCollection.Add_InfoCollection(var_)
 	if err != nil {
-		c.Data["json"] = lib.JSONS{Code: 202, Msg: "添加失败!"}
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: err.Error()}
 		c.ServeJSON()
 		return
 	}
@@ -173,6 +184,7 @@ func (c *InfoCollectionController) Up() {
 	T_InfoTemplate_class := c.GetString("T_InfoTemplate_class")
 	T_InfoTemplate_id := c.GetString("T_InfoTemplate_id")
 	T_InfoCollection_id := c.GetString("T_InfoCollection_id")
+	T_status, _ := c.GetInt("T_status")
 	r, is := InfoCollection.Read_InfoCollection(T_InfoCollection_id)
 	if !is {
 		c.Data["json"] = lib.JSONS{Code: 202, Msg: "Id 错误!"}
@@ -186,10 +198,18 @@ func (c *InfoCollectionController) Up() {
 		r.T_name = T_name
 		clos = append(clos, "T_name")
 	}
+	if T_status > 0 {
+		r.T_status = T_status
+		clos = append(clos, "T_status")
+	}
 	if len(T_InfoTemplate_class) > 0 {
 		r.T_InfoTemplate_class = T_InfoTemplate_class
 		clos = append(clos, "T_InfoTemplate_class")
 	}
+	if T_InfoTemplate_id != r.T_InfoTemplate_id {
+		// 修改任务信息采集模板
+		Task.Update_Task_T_InfoTemplate_id(T_InfoCollection_id, T_InfoTemplate_id)
+	}
 	if len(T_InfoTemplate_id) > 0 {
 		r.T_InfoTemplate_id = T_InfoTemplate_id
 		clos = append(clos, "T_InfoTemplate_id")
@@ -233,3 +253,174 @@ func (c *InfoCollectionController) Del() {
 	c.ServeJSON()
 	return
 }
+
+// 修改状态
+func (c *InfoCollectionController) UpStatus() {
+	// 验证登录 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_InfoCollection_id := c.GetString("T_InfoCollection_id")
+	T_status, _ := c.GetInt("T_status")
+	T_reason := c.GetString("T_reason") //退回原因
+	r, is := InfoCollection.Read_InfoCollection(T_InfoCollection_id)
+	if !is {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: "Id 错误!"}
+		c.ServeJSON()
+		return
+	}
+	_, user_r := Account.Read_User_ByT_uuid(r.T_uuid)
+
+	if T_status == InfoCollection.InfoCollectionStatusSubmitted && (r.T_status != InfoCollection.InfoCollectionStatusWaitSubmit && r.T_status != InfoCollection.InfoCollectionStatusReturn) {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: fmt.Sprintf("当前状态为%s,禁止提交为%s", InfoCollection.InfoCollectionStatusMap[r.T_status], InfoCollection.InfoCollectionStatusMap[T_status])}
+		c.ServeJSON()
+		return
+	}
+
+	if T_status == InfoCollection.InfoCollectionStatusReturnedMoney && r.T_status != InfoCollection.InfoCollectionStatusReceipt {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: fmt.Sprintf("当前状态为%s,禁止提交为%s", InfoCollection.InfoCollectionStatusMap[r.T_status], InfoCollection.InfoCollectionStatusMap[T_status])}
+		c.ServeJSON()
+		return
+	}
+
+	if T_status == InfoCollection.InfoCollectionStatusReturn && (r.T_status != InfoCollection.InfoCollectionStatusSubmitted && r.T_status != InfoCollection.InfoCollectionStatusReturn) {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: fmt.Sprintf("当前状态为%s,禁止提交为%s", InfoCollection.InfoCollectionStatusMap[r.T_status], InfoCollection.InfoCollectionStatusMap[T_status])}
+		c.ServeJSON()
+		return
+	}
+
+	if T_status == InfoCollection.InfoCollectionStatusReceipt && (r.T_status != InfoCollection.InfoCollectionStatusSubmitted && r.T_status != InfoCollection.InfoCollectionStatusReceipt) {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: fmt.Sprintf("当前状态为%s,禁止提交为%s", InfoCollection.InfoCollectionStatusMap[r.T_status], InfoCollection.InfoCollectionStatusMap[T_status])}
+		c.ServeJSON()
+		return
+	}
+
+	// 1待提交 2已提交 3已接收 4已退回 5已回款
+	clos := make([]string, 0)
+	if T_status > 0 {
+		r.T_status = T_status
+		clos = append(clos, "T_status")
+	}
+
+	if T_status == InfoCollection.InfoCollectionStatusReturn {
+		r.T_return_times += 1
+		clos = append(clos, "T_return_times")
+	}
+
+	var returnRecordList []InfoCollection.AuditRecord
+	if len(r.T_audit_record) > 0 {
+		err := json.Unmarshal([]byte(r.T_audit_record), &returnRecordList)
+		if err != nil {
+			logs.Error("JSON 反序列化失败:", err)
+			return
+		}
+	}
+	returnRecordList = append(returnRecordList, InfoCollection.AuditRecord{
+		T_uuid:   User_r.T_uuid,
+		T_status: T_status,
+		T_reason: T_reason,
+		T_time:   time.Now().Format("2006-01-02 15:04:05"),
+	})
+	returnRecordJson, err := json.Marshal(returnRecordList)
+	if err != nil {
+		logs.Error("JSON 反序列化失败:", err)
+		return
+	}
+	r.T_audit_record = string(returnRecordJson)
+	clos = append(clos, "T_audit_record")
+
+	if !InfoCollection.Update_InfoCollection(r, clos...) {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: "修改失败!"}
+		c.ServeJSON()
+		return
+	}
+	AdminMap := Account.AdminListToMap(Account.Read_Admin_List_ALL_1())
+	if T_status == InfoCollection.InfoCollectionStatusReceipt || T_status == InfoCollection.InfoCollectionStatusReturn {
+		System.Add_News(r.T_submit_uuid, fmt.Sprintf("【信息采集】您提交的信息采集【%s-%s】%s", user_r.T_name, r.T_name, InfoCollection.InfoCollectionStatusMap[T_status]), "")
+		System.Send_Weichat_News(AdminMap[r.T_submit_uuid], fmt.Sprintf("【信息采集】您提交的信息采集【%s-%s】%s", user_r.T_name, r.T_name, InfoCollection.InfoCollectionStatusMap[T_status]), "")
+	}
+	System.Add_UserLogs_T(User_r.T_uuid, "信息采集管理", "修改状态", r)
+	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
+	c.ServeJSON()
+	return
+}
+
+// 退回记录列表
+func (c *InfoCollectionController) AuditRecordList() {
+	// 验证登录 User_is, 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_InfoCollection_id := c.GetString("T_InfoCollection_id")
+	T_status, _ := c.GetInt("T_status")
+	r, is := InfoCollection.Read_InfoCollection(T_InfoCollection_id)
+	if !is {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: "Id 错误!"}
+		c.ServeJSON()
+		return
+	}
+
+	var auditRecordList []InfoCollection.AuditRecord
+	if len(r.T_audit_record) > 0 {
+		err := json.Unmarshal([]byte(r.T_audit_record), &auditRecordList)
+		if err != nil {
+			logs.Error("JSON 反序列化失败:", err)
+			return
+		}
+	}
+	AdminMap := Account.AdminListToMap(Account.Read_Admin_List_ALL_1())
+	var auditRecordList2 []InfoCollection.AuditRecord
+
+	if T_status == 0 {
+		for i := 0; i < len(auditRecordList); i++ {
+			auditRecordList[i].T_uuid_name = AdminMap[auditRecordList[i].T_uuid]
+			auditRecordList2 = append(auditRecordList2, auditRecordList[i])
+		}
+		c.Data["json"] = lib.JSONS{Data: auditRecordList2, Code: 200, Msg: "ok!"}
+		c.ServeJSON()
+		return
+	}
+
+	for i := 0; i < len(auditRecordList); i++ {
+		if auditRecordList[i].T_status == T_status {
+			auditRecordList[i].T_uuid_name = AdminMap[auditRecordList[i].T_uuid]
+			auditRecordList2 = append(auditRecordList2, auditRecordList[i])
+		}
+	}
+	c.Data["json"] = lib.JSONS{Data: auditRecordList2, Code: 200, Msg: "ok!"}
+	c.ServeJSON()
+	return
+}
+
+// 信息采集统计
+func (c *InfoCollectionController) Statistics() {
+	// 验证登录 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
+	}
+
+	List, cnt := InfoCollection.Read_UserInfoCollection_List(User_r.T_uuid, "", 0, map[string]string{}, map[string]string{}, map[string]string{}, map[string]string{}, 0, 999)
+	res := make(map[int]int)
+	for k, _ := range InfoCollection.InfoCollectionStatusMap {
+		res[k] = 0
+	}
+	res[0] = cnt
+	for _, r := range List {
+		res[r.T_status] += 1
+	}
+
+	c.Data["json"] = lib.JSONS{Data: res, Code: 200, Msg: "ok!"}
+	c.ServeJSON()
+	return
+}

+ 6 - 9
go.mod

@@ -1,13 +1,14 @@
 module ColdVerify_server
 
-go 1.18
+go 1.21
 
 require (
 	github.com/astaxie/beego v1.12.3
 	github.com/beego/beego/v2 v2.0.7
+	github.com/go-resty/resty/v2 v2.11.0
 	github.com/go-sql-driver/mysql v1.7.0
+	github.com/google/uuid v1.2.0
 	github.com/nats-io/nats.go v1.27.0
-	github.com/pdfcpu/pdfcpu v0.8.1
 	github.com/qiniu/go-sdk/v7 v7.14.0
 	github.com/satori/go.uuid v1.2.0
 	github.com/signintech/gopdf v0.15.1
@@ -28,10 +29,7 @@ require (
 	github.com/golang/protobuf v1.5.2 // indirect
 	github.com/gomodule/redigo v2.0.0+incompatible // indirect
 	github.com/hashicorp/golang-lru v0.5.4 // indirect
-	github.com/hhrutter/lzw v1.0.0 // indirect
-	github.com/hhrutter/tiff v1.0.1 // indirect
 	github.com/klauspost/compress v1.16.5 // indirect
-	github.com/mattn/go-runewidth v0.0.16 // indirect
 	github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
 	github.com/mitchellh/mapstructure v1.5.0 // indirect
 	github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
@@ -46,16 +44,15 @@ require (
 	github.com/prometheus/procfs v0.8.0 // indirect
 	github.com/richardlehane/mscfb v1.0.4 // indirect
 	github.com/richardlehane/msoleps v1.0.3 // indirect
-	github.com/rivo/uniseg v0.4.7 // indirect
 	github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 // indirect
 	github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
 	github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 // indirect
 	github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 // indirect
-	golang.org/x/crypto v0.9.0 // indirect
+	golang.org/x/crypto v0.25.0 // indirect
 	golang.org/x/image v0.20.0 // indirect
-	golang.org/x/net v0.10.0 // indirect
+	golang.org/x/net v0.27.0 // indirect
 	golang.org/x/sync v0.8.0 // indirect
-	golang.org/x/sys v0.8.0 // indirect
+	golang.org/x/sys v0.22.0 // indirect
 	golang.org/x/text v0.18.0 // indirect
 	google.golang.org/protobuf v1.28.1 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect

+ 36 - 15
go.sum

@@ -32,6 +32,7 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
 cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
 git.sr.ht/~sbinet/cmpimg v0.1.0 h1:E0zPRk2muWuCqSKSVZIWsgtU9pjsw3eKHi8VmQeScxo=
+git.sr.ht/~sbinet/cmpimg v0.1.0/go.mod h1:FU12psLbF4TfNXkKH2ZZQ29crIqoiqTZmeQ7dkp/pxE=
 git.sr.ht/~sbinet/gg v0.4.1 h1:YccqPPS57/TpqX2fFnSRlisrqQ43gEdqVm3JtabPrp0=
 git.sr.ht/~sbinet/gg v0.4.1/go.mod h1:xKrQ22W53kn8Hlq+gzYeyyohGMwR8yGgSMlVpY/mHGc=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -82,6 +83,7 @@ github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt
 github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
 github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
 github.com/elazarl/go-bindata-assetfs v1.0.1 h1:m0kkaHRKEu7tUIUFVwhGGGYClXvyl4RE03qmvRTNfbw=
+github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
 github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
@@ -89,7 +91,9 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
 github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ=
+github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
 github.com/go-fonts/latin-modern v0.3.1 h1:/cT8A7uavYKvglYXvrdDw4oS5ZLkcOU22fa2HJ1/JVM=
+github.com/go-fonts/latin-modern v0.3.1/go.mod h1:ysEQXnuT/sCDOAONxC7ImeEDVINbltClhasMAqEtRK0=
 github.com/go-fonts/liberation v0.3.1 h1:9RPT2NhUpxQ7ukUvz3jeUckmN42T9D9TpjtQcqK/ceM=
 github.com/go-fonts/liberation v0.3.1/go.mod h1:jdJ+cqF+F4SUL2V+qxBth8fvBpBDS7yloUL5Fi8GTGY=
 github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
@@ -114,6 +118,8 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+
 github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
 github.com/go-playground/validator/v10 v10.8.0/go.mod h1:9JhgTzTaE31GZDpH/HSvHiRJrJ3iKAgqqH0Bl/Ocjdk=
 github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
+github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8=
+github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A=
 github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
 github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
@@ -165,6 +171,7 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
 github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
+github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
 github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
 github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -176,16 +183,14 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf
 github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
+github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
 github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
 github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
-github.com/hhrutter/lzw v1.0.0 h1:laL89Llp86W3rRs83LvKbwYRx6INE8gDn0XNb1oXtm0=
-github.com/hhrutter/lzw v1.0.0/go.mod h1:2HC6DJSn/n6iAZfgM3Pg+cP1KxeWc3ezG8bBqW5+WEo=
-github.com/hhrutter/tiff v1.0.1 h1:MIus8caHU5U6823gx7C6jrfoEvfSTGtEFRiM8/LOzC0=
-github.com/hhrutter/tiff v1.0.1/go.mod h1:zU/dNgDm0cMIa8y8YwcYBeuEEveI4B0owqHyiPpJPHc=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
@@ -215,13 +220,13 @@ github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDu
 github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
 github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ=
-github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
-github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
+github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
 github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
 github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
+github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
 github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
 github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -234,6 +239,7 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwd
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4=
+github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI=
 github.com/nats-io/nats-server/v2 v2.9.20 h1:bt1dW6xsL1hWWwv7Hovm+EJt5L6iplyqlgEFkoEUk0k=
 github.com/nats-io/nats-server/v2 v2.9.20/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw=
 github.com/nats-io/nats.go v1.27.0 h1:3o9fsPhmoKm+yK7rekH2GtWoE+D9jFbw8N3/ayI1C00=
@@ -246,8 +252,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
 github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
-github.com/pdfcpu/pdfcpu v0.8.1 h1:AiWUb8uXlrXqJ73OmiYXBjDF0Qxt4OuM281eAfkAOMA=
-github.com/pdfcpu/pdfcpu v0.8.1/go.mod h1:M5SFotxdaw0fedxthpjbA/PADytAo6wJnGH0SSBWJ7s=
 github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
 github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
@@ -297,9 +301,6 @@ github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7
 github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
 github.com/richardlehane/msoleps v1.0.3 h1:aznSZzrwYRl3rLKRT3gUk9am7T/mLNSnJINvN0AQoVM=
 github.com/richardlehane/msoleps v1.0.3/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
-github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
-github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
 github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
@@ -362,8 +363,9 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
 golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
-golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
-golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
+golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
+golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
+golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -375,6 +377,7 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0
 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
 golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
 golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4=
+golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
 golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
 golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
 golang.org/x/image v0.0.0-20220902085622-e7cb96979f69/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY=
@@ -399,6 +402,7 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
 golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -435,8 +439,11 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su
 golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
 golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
-golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
+golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
 golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
+golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -455,6 +462,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
 golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -504,11 +512,17 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
+golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
+golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
+golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -517,12 +531,16 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
 golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
 golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
+golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
@@ -565,11 +583,13 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc
 golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 gonum.org/v1/gonum v0.13.0 h1:a0T3bh+7fhRyqeNbiC3qVHYmkiQgit3wnNan/2c0HMM=
+gonum.org/v1/gonum v0.13.0/go.mod h1:/WPYRckkfWrhWefxyYTfrTtQR0KH4iyHNuzxqXAKyAU=
 gonum.org/v1/plot v0.13.0 h1:yb2Z/b8bY5h/xC4uix+ujJ+ixvPUvBmUOtM73CJzpsw=
 gonum.org/v1/plot v0.13.0/go.mod h1:mV4Bpu4PWTgN2CETURNF8hCMg7EtlZqJYCcmYo/t4Co=
 google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
@@ -682,5 +702,6 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=
+rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

+ 28 - 1
lib/lib.go

@@ -1,8 +1,10 @@
 package lib
 
 import (
+	"ColdVerify_server/conf"
 	"encoding/json"
 	"fmt"
+	"github.com/beego/beego/v2/core/logs"
 	"github.com/nats-io/nats.go"
 	"github.com/signintech/gopdf"
 	"math/rand"
@@ -422,7 +424,32 @@ func FuncName() string {
 
 // golang获取程序运行路径
 func GetCurrentDirectory() string {
+	if conf.RunMode == "dev" {
+		currentPath, err := os.Getwd()
+		if err != nil {
+			logs.Error("获取程序运行路径失败", err)
+		}
+		return currentPath
+	}
 	dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
-
 	return strings.Replace(dir, "\\", "/", -1)
 }
+
+func ConvertMinutesToDHM(minutes int) string {
+	if minutes == 0 {
+		return ""
+	}
+	days := minutes / 1440           // 1天 = 1440分钟
+	hours := (minutes % 1440) / 60   // 1小时 = 60分钟
+	remainingMinutes := minutes % 60 // 剩余分钟
+
+	if minutes < 60 {
+		return fmt.Sprintf("%dm", remainingMinutes)
+	}
+
+	if minutes < 1440 && minutes >= 60 {
+		return fmt.Sprintf("%dh%dm", hours, remainingMinutes)
+	}
+
+	return fmt.Sprintf("%dd%dh%dm", days, hours, remainingMinutes)
+}

+ 20 - 0
lib/libString.go

@@ -1,6 +1,8 @@
 package lib
 
 import (
+	"fmt"
+	"math"
 	"math/rand"
 	"regexp"
 	"strings"
@@ -62,3 +64,21 @@ func IsNumeric(str string) bool {
 	re := regexp.MustCompile(`^\d+$`)
 	return re.MatchString(str)
 }
+
+// 计算两个时间字符串之间的分钟差
+func MinutesDifference(startTime, endTime string) (float64, error) {
+	layout := "2006-01-02 15:04:05"
+
+	st, err := time.Parse(layout, startTime)
+	if err != nil {
+		return 0, fmt.Errorf("error parsing timeStr1: %w", err)
+	}
+
+	et, err := time.Parse(layout, endTime)
+	if err != nil {
+		return 0, fmt.Errorf("error parsing timeStr2: %w", err)
+	}
+	duration := et.Sub(st)
+	minutes := math.Ceil(duration.Minutes())
+	return minutes, nil
+}

+ 0 - 1
models/Device/DeviceData.go

@@ -4,7 +4,6 @@ import (
 	"ColdVerify_server/conf"
 	"ColdVerify_server/lib"
 	"ColdVerify_server/logs"
-
 	"encoding/json"
 	"fmt"
 	"github.com/astaxie/beego/cache"

+ 101 - 40
models/InfoCollection/InfoCollection.go

@@ -11,39 +11,77 @@ import (
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	_ "github.com/go-sql-driver/mysql"
+	"strings"
 	"time"
 )
 
+var (
+	InfoCollectionStatusWaitSubmit    = 1 // 待提交
+	InfoCollectionStatusSubmitted     = 2 // 已提交
+	InfoCollectionStatusReceipt       = 3 // 已接收
+	InfoCollectionStatusReturn        = 4 // 已退回
+	InfoCollectionStatusReturnedMoney = 5 // 已回款
+	InfoCollectionStatusMap           = map[int]string{
+		InfoCollectionStatusWaitSubmit:    "待提交",
+		InfoCollectionStatusSubmitted:     "已提交",
+		InfoCollectionStatusReceipt:       "已接收",
+		InfoCollectionStatusReturn:        "已退回",
+		InfoCollectionStatusReturnedMoney: "已回款",
+	}
+)
+
+type AuditRecord struct {
+	T_uuid      string `orm:"size(256);null"`     // 提交人 UUID
+	T_uuid_name string `orm:"size(256);null"`     // 提交人名称
+	T_status    int    `orm:"size(2);default(0)"` // 状态 1待提交 2已提交 3已接收 4已退回 5已回款
+	T_reason    string `orm:"type(text)"`         // 原因
+	T_time      string `orm:"type(256)"`          // 时间
+}
+
 // 模板
 type InfoCollection struct {
-	Id                   int    `orm:"column(ID);size(11);auto;pk"`
-	T_InfoCollection_id  string `orm:"size(256);null"`     // 信息采集ID
-	T_uuid               string `orm:"size(256);null"`     // 用户 UUID
-	T_name               string `orm:"size(256);null"`     // 标题
-	T_InfoTemplate_class string `orm:"size(256);null"`     // 模板分类
-	T_InfoTemplate_id    string `orm:"size(256);null"`     // 模板id
-	T_status             int    `orm:"size(2);default(0)"` // 状态 1 待提交 2 已提交 3 已接收 4 已回款
-	T_State              int    `orm:"size(2);default(1)"` // 0 删除  1 正常
-	T_submit_uuid        string `orm:"size(256);null"`     // 提交人 UUID
+	Id                   int     `orm:"column(ID);size(11);auto;pk"`
+	T_InfoCollection_id  string  `orm:"size(256);null"`     // 信息采集ID
+	T_uuid               string  `orm:"size(256);null"`     // 公司 UUID
+	T_name               string  `orm:"size(256);null"`     // 标题
+	T_InfoTemplate_class string  `orm:"size(256);null"`     // 模板分类
+	T_InfoTemplate_id    string  `orm:"size(256);null"`     // 模板id
+	T_status             int     `orm:"size(2);default(0)"` // 状态 1待提交 2已提交 3已接收 4已退回 5已回款
+	T_State              int     `orm:"size(2);default(1)"` // 0 删除  1 正常
+	T_submit_uuid        string  `orm:"size(256);null"`     // 提交人 UUID
+	T_start_time         string  `orm:"size(256);null"`     // 开始时间
+	T_end_time           string  `orm:"size(256);null"`     // 结束时间
+	T_time_interval      float64 `orm:"size(256);null"`     // 时间间隔
+
+	T_return_times int    `orm:"size(200);null"` // 退回次数
+	T_audit_record string `orm:"type(text)"`
 
 	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 保存时都会对时间自动更新
 }
 
 type InfoCollection_R struct {
-	Id                   int
-	T_InfoCollection_id  string // 信息采集ID
-	T_uuid               string // 用户 UUID
-	T_uuid_name          string // 用户姓名
-	T_name               string // 标题
-	T_InfoTemplate_class string // 模板id
-	T_InfoTemplate_id    string // 模板id
-	T_status             int    // 状态
-	T_State              int    // 0 删除   1 正常
-	T_submit_uuid        string // 提交人uuid
-	T_submit_uuid_name   string // 提交人姓名
-	CreateTime           string
-	UpdateTime           string
+	Id                        int
+	T_InfoCollection_id       string  // 信息采集ID
+	T_uuid                    string  // 用户 UUID
+	T_uuid_name               string  // 用户姓名
+	T_name                    string  // 标题
+	T_InfoTemplate_class      string  // 模板分类
+	T_InfoTemplate_class_name string  // 模板分类名称
+	T_InfoTemplate_id         string  // 模板id
+	T_InfoTemplate_name       string  // 模板名称
+	T_status                  int     // 状态
+	T_status_str              string  // 状态字符串
+	T_State                   int     // 0 删除   1 正常
+	T_submit_uuid             string  // 提交人uuid
+	T_submit_uuid_name        string  // 提交人姓名
+	T_start_time              string  // 开始时间
+	T_end_time                string  // 结束时间
+	T_time_interval           float64 // 时间间隔
+	T_return_times            int     // 退回次数
+	T_audit_record            string
+	CreateTime                string
+	UpdateTime                string
 }
 
 func (t *InfoCollection) TableName() string {
@@ -69,19 +107,33 @@ func init() {
 }
 
 // -------------------------------------------------------------
-func InfoCollectionToInfoCollection_R(T InfoCollection, adminMap map[string]string) (T_r InfoCollection_R) {
-
+func InfoCollectionToInfoCollection_R(T InfoCollection, userMap, adminMap, infoTemplateMap, infoTemplateClassMap map[string]string) (T_r InfoCollection_R) {
+	T_r.Id = T.Id
 	T_r.T_InfoCollection_id = T.T_InfoCollection_id
 	T_r.T_uuid = T.T_uuid
 	T_r.T_name = T.T_name
 	T_r.T_InfoTemplate_class = T.T_InfoTemplate_class
 	T_r.T_InfoTemplate_id = T.T_InfoTemplate_id
 	T_r.T_status = T.T_status
+	T_r.T_status_str = InfoCollectionStatusMap[T.T_status]
 	T_r.T_State = T.T_State
-	T_r.T_uuid_name = adminMap[T.T_uuid]
+	T_r.T_uuid_name = userMap[T.T_uuid]
 	T_r.T_submit_uuid = T.T_submit_uuid
 	T_r.T_submit_uuid_name = adminMap[T.T_submit_uuid]
 
+	T_r.T_InfoTemplate_name = infoTemplateMap[T.T_InfoTemplate_id]
+	classList := strings.Split(strings.Trim(T.T_InfoTemplate_class, "/"), "/")
+	for _, s := range classList {
+		T_r.T_InfoTemplate_class_name += infoTemplateClassMap[s] + "/"
+	}
+	T_r.T_InfoTemplate_class_name = strings.TrimRight(T_r.T_InfoTemplate_class_name, "/")
+
+	T_r.T_start_time = T.T_start_time
+	T_r.T_end_time = T.T_end_time
+	T_r.T_time_interval = T.T_time_interval
+	T_r.T_return_times = T.T_return_times
+	T_r.T_audit_record = T.T_audit_record
+
 	T_r.UpdateTime = T.UpdateTime.Format("2006-01-02 15:04:05")
 	T_r.CreateTime = T.CreateTime.Format("2006-01-02 15:04:05")
 
@@ -145,7 +197,6 @@ func Read_InfoCollection(T_InfoCollection_id string) (r InfoCollection, is bool)
 
 	o := orm.NewOrm()
 	qs := o.QueryTable(new(InfoCollection))
-	//err := qs.Filter("T_InfoCollection_id", T_InfoCollection_id).Filter("T_State", 1).One(&r)
 	err := qs.Filter("T_InfoCollection_id", T_InfoCollection_id).Filter("T_State", 1).One(&r)
 	if err != nil {
 		return r, false
@@ -159,7 +210,8 @@ func Read_InfoCollection(T_InfoCollection_id string) (r InfoCollection, is bool)
 func Add_InfoCollection(r InfoCollection) (string, error) {
 	o := orm.NewOrm()
 	// 查询标题是否重复
-	err := o.Read(&r, "T_name")
+	qs := o.QueryTable(new(InfoCollection))
+	err := qs.Filter("T_name", r.T_name).Filter("T_uuid", r.T_uuid).Filter("T_State", 1).One(&r)
 	if err == nil {
 		return "", errors.New("信息采集标题重复")
 	}
@@ -212,7 +264,7 @@ func Update_InfoCollection(m InfoCollection, cols ...string) bool {
 }
 
 // 获取用户信息采集列表
-func Read_UserInfoCollection_List(T_uuid string, T_name string, adminMap map[string]string, page int, page_z int) ([]InfoCollection_R, int) {
+func Read_UserInfoCollection_List(T_admin string, T_name string, T_status int, userMap, adminMap, infoTemplateMap, infoTemplateClassMap map[string]string, page int, page_z int) ([]InfoCollection_R, int) {
 
 	o := orm.NewOrm()
 
@@ -225,25 +277,30 @@ func Read_UserInfoCollection_List(T_uuid string, T_name string, adminMap map[str
 		offset = int64((page - 1) * page_z)
 	}
 	cond := orm.NewCondition()
-	cond1 := cond.And("T_name__icontains", T_name).And("T_State", 1)
-	if len(T_uuid) > 0 {
-		cond1 = cond1.And("T_uuid", T_uuid)
+	cond1 := cond.And("T_name__icontains", T_name).And("T_State", 1).And("T_submit_uuid", T_admin)
+
+	if T_status > 0 {
+		cond1 = cond1.And("T_status", T_status)
 	}
+	if page_z == 9999 {
+		qs.SetCond((*orm2.Condition)(cond1)).OrderBy("-Id").All(&r)
 
-	qs.Limit(page_z, offset).SetCond((*orm2.Condition)(cond1)).OrderBy("-Id").All(&r)
+	} else {
+		qs.Limit(page_z, offset).SetCond((*orm2.Condition)(cond1)).OrderBy("-Id").All(&r)
+	}
 	cnt, _ := qs.SetCond((*orm2.Condition)(cond1)).Count()
 
 	// 转换
 	var InfoCollectionList []InfoCollection_R
 	for _, v := range r {
-		InfoCollectionList = append(InfoCollectionList, InfoCollectionToInfoCollection_R(v, adminMap))
+		InfoCollectionList = append(InfoCollectionList, InfoCollectionToInfoCollection_R(v, userMap, adminMap, infoTemplateMap, infoTemplateClassMap))
 	}
 
 	return InfoCollectionList, int(cnt)
 }
 
 // 获取信息采集列表
-func Read_InfoCollection_List(T_uuid, T_admin string, T_name string, adminMap map[string]string, page int, page_z int) ([]InfoCollection_R, int) {
+func Read_InfoCollection_List(T_uuid, T_name string, T_status int, userMap, adminMap, infoTemplateMap, infoTemplateClassMap map[string]string, page int, page_z int) ([]InfoCollection_R, int) {
 
 	o := orm.NewOrm()
 
@@ -257,22 +314,26 @@ func Read_InfoCollection_List(T_uuid, T_admin string, T_name string, adminMap ma
 	}
 	cond := orm.NewCondition()
 	cond1 := cond.AndCond(cond.Or("T_name__icontains", T_name).Or("T_InfoCollection_id", T_name)).And("T_State", 1)
+
 	if len(T_uuid) > 0 {
 		cond1 = cond1.And("T_uuid", T_uuid)
-
 	}
-	if len(T_admin) > 0 {
-		cond1 = cond1.AndCond(cond.Or("T_scheme", T_admin).Or("T_collection", T_admin).
-			Or("T_reporting", T_admin).Or("T_delivery", T_admin))
+
+	if T_status > 0 {
+		cond1 = cond1.And("T_status", T_status)
 	}
 
-	qs.Limit(page_z, offset).SetCond((*orm2.Condition)(cond1)).OrderBy("-Id").All(&r)
+	if page_z == 9999 {
+		qs.SetCond((*orm2.Condition)(cond1)).OrderBy("-Id").All(&r)
+	} else {
+		qs.Limit(page_z, offset).SetCond((*orm2.Condition)(cond1)).OrderBy("-Id").All(&r)
+	}
 	cnt, _ := qs.SetCond((*orm2.Condition)(cond1)).Count()
 
 	// 转换
 	var InfoCollectionList []InfoCollection_R
 	for _, v := range r {
-		InfoCollectionList = append(InfoCollectionList, InfoCollectionToInfoCollection_R(v, adminMap))
+		InfoCollectionList = append(InfoCollectionList, InfoCollectionToInfoCollection_R(v, userMap, adminMap, infoTemplateMap, infoTemplateClassMap))
 	}
 
 	return InfoCollectionList, int(cnt)

+ 18 - 6
models/InfoCollection/InfoTemplate.go

@@ -14,13 +14,9 @@ type InfoTemplate struct {
 	Id      int `orm:"column(ID);size(11);auto;pk"`
 	T_class int `orm:"size(8);default(0)"` // 分类
 
-	T_InfoTemplate_id string `orm:"size(256);null"`     // 标题
+	T_InfoTemplate_id string `orm:"size(256);null"`     // id
 	T_name            string `orm:"size(256);null"`     // 标题
-	T_sort            int    `orm:"size(2);default(1)"` // 排
-
-	T_scheme    string `orm:"size(256);null"` // 方案模板
-	T_reporting string `orm:"size(256);null"` // 报告模板
-	T_inspect   string `orm:"size(256);null"` // 自检
+	T_sort            int    `orm:"size(2);default(1)"` // 排序
 
 	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 保存时都会对时间自动更新
@@ -52,6 +48,22 @@ func InfoTemplateToInfoTemplate_R(T InfoTemplate) (T_r InfoTemplate_R) {
 	return T_r
 }
 
+func Read_InfoTemplate_List_ALL() (maps []InfoTemplate) {
+
+	o := orm.NewOrm()
+	qs := o.QueryTable(new(InfoTemplate))
+
+	qs.OrderBy("Id").All(&maps)
+	return maps
+}
+func InfoTemplateListToMap(A []InfoTemplate) map[string]string {
+	maps := make(map[string]string, len(A))
+	for _, v := range A {
+		maps[v.T_InfoTemplate_id] = v.T_name
+	}
+	return maps
+}
+
 // ---------------- 特殊方法 -------------------
 
 // 获取 ById

+ 16 - 0
models/InfoCollection/InfoTemplateClass.go

@@ -39,6 +39,22 @@ type InfoTemplateClass_R struct {
 	Children []InfoTemplateClass `orm:"-"`
 }
 
+func Read_InfoTemplateClass_List_ALL() (maps []InfoTemplateClass) {
+
+	o := orm.NewOrm()
+	qs := o.QueryTable(new(InfoTemplateClass))
+
+	qs.OrderBy("Id").All(&maps)
+	return maps
+}
+func InfoTemplateClassListToMap(A []InfoTemplateClass) map[string]string {
+	maps := make(map[string]string, len(A))
+	for _, v := range A {
+		maps[strconv.Itoa(v.Id)] = v.T_name
+	}
+	return maps
+}
+
 // 获取 ById
 func Read_InfoTemplateClass_ById(id int) (r InfoTemplateClass, err error) {
 	o := orm.NewOrm()

+ 7 - 12
models/InfoCollection/VerifyTemplateMapData.go

@@ -3,6 +3,7 @@ package InfoCollection
 import (
 	"ColdVerify_server/lib"
 	"ColdVerify_server/logs"
+	"fmt"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	_ "github.com/go-sql-driver/mysql"
@@ -11,8 +12,7 @@ import (
 
 // 模板
 type InfoTemplateMapData struct {
-	Id int `orm:"column(ID);size(11);auto;pk"`
-	//T_source             int    `orm:"size(2);"`             // 来源 0-所有 1-方案 2-报告 3-表单
+	Id                   int    `orm:"column(ID);size(11);auto;pk"`
 	T_InfoCollection_id  string `orm:"index,size(256);null"` // 信息采集id
 	T_InfoTemplate_id    string `orm:"index,size(256);null"` // 模板id
 	T_InfoTemplateMap_id string `orm:"index,size(256);null"` // 标签id
@@ -74,6 +74,9 @@ func AddOrUpdate_InfoTemplateMapData(List []InfoTemplateMapData) (ids []int64, i
 	for _, v := range List {
 		var r InfoTemplateMapData
 		// 创建验证模版数据,有则更新,没有则创建
+		if v.T_InfoTemplateMap_id == "gVqW" {
+			fmt.Println(v.T_value)
+		}
 		err := qs.Filter("T_InfoCollection_id", v.T_InfoCollection_id).Filter("T_InfoTemplate_id", v.T_InfoTemplate_id).Filter("T_InfoTemplateMap_id", v.T_InfoTemplateMap_id).One(&r)
 		if err != nil {
 			if err.Error() == orm.ErrNoRows.Error() {
@@ -149,7 +152,7 @@ func Read_InfoTemplateMapData_List(T_InfoCollection_id, T_InfoTemplate_id string
 }
 
 // 获取列表
-func Read_MapData_List(T_source int, T_InfoCollection_id, T_InfoTemplate_id string) []InfoTemplateMapData {
+func Read_MapData_List(T_InfoCollection_id, T_InfoTemplate_id string) []InfoTemplateMapData {
 
 	o := orm.NewOrm()
 	// 也可以直接使用 Model 结构体作为表名
@@ -157,15 +160,7 @@ func Read_MapData_List(T_source int, T_InfoCollection_id, T_InfoTemplate_id stri
 	qs := o.QueryTable(new(InfoTemplateMapData))
 	cond := orm.NewCondition()
 
-	source := []int{T_source}
-	if T_source == 2 {
-		source = append(source, 3)
-	}
-	if T_source != 3 {
-		source = append(source, 0)
-	}
-
-	cond1 := cond.And("T_source__in", source).And("T_InfoCollection_id", T_InfoCollection_id).And("T_InfoTemplate_id", T_InfoTemplate_id)
+	cond1 := cond.And("T_InfoCollection_id", T_InfoCollection_id).And("T_InfoTemplate_id", T_InfoTemplate_id)
 
 	qs.SetCond((*orm2.Condition)(cond1)).All(&r)
 

+ 92 - 16
models/System/News.go

@@ -1,49 +1,125 @@
 package System
 
 import (
-	"ColdVerify_server/logs"
+	"ColdVerify_server/conf"
+	"fmt"
 	"github.com/beego/beego/v2/adapter/orm"
+	orm2 "github.com/beego/beego/v2/client/orm"
+	"github.com/go-resty/resty/v2"
 	"time"
 )
 
 type News struct {
 	Id         int       `orm:"column(ID);size(11);auto;pk"`
-	Admin_uuid string    `orm:"size(256);null"`                                        //
-	News_Title string    `orm:"size(256);null"`                                        // 标题
-	News_Url   string    `orm:"size(256);null"`                                        // 地址
-	News_Tag   int       `orm:"size(2);null"`                                          //  标记 1 未阅读
+	T_uuid     string    `orm:"size(256);null"`                                        //
+	T_Title    string    `orm:"size(256);null"`                                        // 标题
+	T_Url      string    `orm:"size(256);null"`                                        // 地址
+	T_Tag      int       `orm:"size(2);null"`                                          // 标记   0未阅读   1 已阅读
 	CreateTime time.Time `orm:"column(create_time);type(timestamp);null;auto_now_add"` //auto_now 每次 model 保存时都会对时间自动更新
-	UpdateTime time.Time `orm:"column(update_time);type(timestamp);null;auto_now"`     //auto_now_add 第一次保存时才设置时间
+}
+type News_R struct {
+	Id         int
+	T_uuid     string
+	T_Title    string
+	T_Url      string
+	T_Tag      int
+	CreateTime string
 }
 
 func (t *News) TableName() string {
-	return "news" // 数据库名称   // ************** 替换 FormulaList **************
+	return "news" // 数据库名称
 }
 
 func init() {
 	//注册模型
 	orm.RegisterModel(new(News))
+}
+func NewsToNews_R(r News) (m News_R) {
+	m.Id = r.Id
+	m.T_uuid = r.T_uuid
+	m.T_Title = r.T_Title
+	m.T_Url = r.T_Url
+	m.T_Tag = r.T_Tag
+	m.CreateTime = r.CreateTime.Format("2006-01-02 15:04:05")
+	return
+}
+
+// 添加
+func Add_News(T_uuid, T_Title, T_Url string) {
+	r := News{T_uuid: T_uuid, T_Title: T_Title, T_Url: T_Url}
+
+	o := orm.NewOrm()
+
+	r.T_Tag = 0
+	o.Insert(&r)
+	//id, err = o.Insert(&r)
+	//if err != nil {
+	//	fmt.Println(err)
+	//}
+	//return id, err
+}
+
+// 发送微信通知
+func Send_Weichat_News(T_admin_name, T_Title, T_Url string) {
+	client := resty.New()
+	client.R().
+		SetFormData(map[string]string{
+			"name": conf.WechatNews_GroupName,
+			"data": fmt.Sprintf("@%s %s", T_admin_name, T_Title),
+		}).
+		Post(conf.WechatNews_Url)
 
 }
 
-// 获取 ById
-func Read_AdminNews_all_1(Admin_uuid string) (r []News) {
+// 获取列表
+func Read_News_List(T_uuid string, T_Title string, T_Tag int, page int, page_z int) (r_ []News_R, cnt int64) {
 	o := orm.NewOrm()
+	// 也可以直接使用 Model 结构体作为表名
 	qs := o.QueryTable(new(News))
-	qs.Filter("Admin_uuid", Admin_uuid).Filter("News_Tag", 1).All(&r)
-	return r
+	var offset int64
+	if page <= 1 {
+		offset = 0
+	} else {
+		offset = int64((page - 1) * page_z)
+	}
+
+	// 过滤
+	cond := orm.NewCondition()
+	cond1 := cond.And("T_uuid", T_uuid) //  .AndNot("status__in", 1).Or("profile__age__gt", 2000)
+
+	if len(T_Title) > 0 {
+		//cond1.AndCond(cond.And("T_class", class))
+		cond1 = cond1.And("T_Title__icontains", T_Title)
+	}
+	if T_Tag == 0 {
+		cond1 = cond1.And("T_Tag", 0)
+	}
+	var r []News
+	// 查询
+	qs.Limit(page_z, offset).SetCond((*orm2.Condition)(cond1)).OrderBy("-Id").All(&r)
+	cnt, _ = qs.SetCond((*orm2.Condition)(cond1)).Count()
+
+	for _, v := range r {
+		r_ = append(r_, NewsToNews_R(v))
+	}
+
+	return r_, cnt
 }
 
 // 修改 排序
-func Update_AdminNews_News_Tag_2(Id int) (err error) {
+func Update_News_Tag(Id int, T_uuid string) (err error) {
 	o := orm.NewOrm()
 	v := News{Id: Id}
 
-	if err = o.Read(&v, "Id", "Admin_uuid"); err == nil {
+	if err = o.Read(&v, "Id"); err == nil {
 		var num int64
-		v.News_Tag = 2
-		if num, err = o.Update(&v, "News_Tag"); err == nil {
-			logs.Println("Number of records updated in database:", num)
+		if v.T_uuid != T_uuid {
+			return
+		}
+
+		v.T_Tag = 1
+		if num, err = o.Update(&v, "T_Tag"); err == nil {
+			fmt.Println("Number of records updated in database:", num)
 		}
 	}
 

+ 630 - 184
models/Task/Task.go

@@ -4,7 +4,9 @@ import (
 	"ColdVerify_server/conf"
 	"ColdVerify_server/lib"
 	"ColdVerify_server/logs"
+	"ColdVerify_server/models/InfoCollection"
 	"encoding/json"
+	"errors"
 	"fmt"
 	"github.com/astaxie/beego/cache"
 	"github.com/beego/beego/v2/adapter/orm"
@@ -13,39 +15,142 @@ import (
 	"time"
 )
 
+var (
+	TaskSchemeStateWaitSubmit   = 0 // 待提交
+	TaskSchemeStateSubmitted    = 5 // 已提交
+	TaskSchemeStateClientPass   = 1 // 已通过(客户)
+	TaskSchemeStateClientReturn = 2 // 已退回(客户)
+	TaskSchemeStatePass         = 3 // 已通过(负责人)
+	TaskSchemeStateReturn       = 4 // 已退回(负责人)
+	TaskSchemeStateMap          = map[int]string{
+		TaskSchemeStateWaitSubmit:   "待提交",
+		TaskSchemeStateSubmitted:    "已提交",
+		TaskSchemeStateClientPass:   "已通过(客户)",
+		TaskSchemeStateClientReturn: "已退回(客户)",
+		TaskSchemeStatePass:         "已通过(负责人)",
+		TaskSchemeStateReturn:       "已退回(负责人)",
+	}
+
+	// 0 未完成 1 数据来源已完成 2 处理中 3 已采集-无数据 4-数据编辑已完成(已提交) 5已通过(报告负责人) 6已退回(报告负责人)
+	TaskCollectionStateWaitSubmit = 0 // 待提交
+	TaskCollectionStateFinish     = 1 // 已完成
+	TaskCollectionStateInProgress = 2 // 处理中
+	TaskCollectionStateNoData     = 3 // 已采集-无数据
+	TaskCollectionStateSubmitted  = 4 // 已提交
+	TaskCollectionStatePass       = 5 // 已通过(负责人)
+	TaskCollectionStateReturn     = 6 // 已退回(负责人)
+	TaskCollectionStateMap        = map[int]string{
+		TaskCollectionStateWaitSubmit: "待提交",
+		TaskCollectionStateFinish:     "已完成",
+		TaskCollectionStateInProgress: "处理中",
+		TaskCollectionStateNoData:     "已采集-无数据",
+		TaskCollectionStateSubmitted:  "数据编辑已完成",
+		TaskCollectionStatePass:       "已通过(负责人)",
+		TaskCollectionStateReturn:     "已退回(负责人)",
+	}
+
+	TaskReportingStateWaitSubmit   = 0 // 待提交
+	TaskReportingStateSubmitted    = 5 // 已提交
+	TaskReportingStateClientPass   = 1 // 已通过(客户)
+	TaskReportingStateClientReturn = 2 // 已退回(客户)
+	TaskReportingStatePass         = 3 // 已通过(负责人)
+	TaskReportingStateReturn       = 4 // 已退回(负责人)
+	TaskReportingStateMap          = map[int]string{
+		TaskReportingStateWaitSubmit:   "待提交",
+		TaskReportingStateSubmitted:    "已提交",
+		TaskReportingStateClientPass:   "已通过(客户)",
+		TaskReportingStateClientReturn: "已退回(客户)",
+		TaskReportingStatePass:         "已通过(负责人)",
+		TaskReportingStateReturn:       "已退回(负责人)",
+	}
+
+	TaskDeliveryStateUnfinished = 0 // 未完成
+	TaskDeliveryStateFinished   = 1 // 已完成
+	TaskDeliveryStateGoing      = 2 // 进行中
+	TaskDeliveryStateMap        = map[int]string{
+		TaskDeliveryStateUnfinished: "未完成",
+		TaskDeliveryStateFinished:   "已完成",
+		TaskDeliveryStateGoing:      "处理中",
+	}
+
+	TaskMarkingStateUnfinished = 0 // 未完成
+	TaskMarkingStateFinished   = 1 // 已完成
+	TaskMarkingStateMap        = map[int]string{
+		TaskMarkingStateUnfinished: "未完成",
+		TaskMarkingStateFinished:   "已完成",
+	}
+)
+
+var (
+	TaskSchemeTimeLimit = map[string]float64{
+		"LC":  60, // LC-冷藏车
+		"XT":  30, // XT-系统
+		"WZ":  80, // WZ-位置
+		"LK":  60, // LK-冷库
+		"LG":  30, // LG-冷柜
+		"BWX": 30, // BWX-保温箱
+	}
+
+	TaskReportingTimeLimit = map[string]float64{
+		"LC":  300, // LC-冷藏车
+		"XT":  300, // XT-系统
+		"WZ":  240, // WZ-位置
+		"LK":  360, // LK-冷库
+		"LG":  180, // LG-冷柜
+		"BWX": 180, // BWX-保温箱
+	}
+
+	TaskCollectionTimeLimit float64 = 7 * 24 * 60
+)
+
+type AuditRecord struct {
+	T_uuid       string `orm:"size(256);null"`     // 提交人(客户)UUID
+	T_uuid_name  string `orm:"size(256);null"`     // 提交人名称
+	T_admin      string `orm:"size(256);null"`     // 提交人(报告负责人)UUID
+	T_admin_name string `orm:"size(256);null"`     // 提交人名称
+	T_state      int    `orm:"size(2);default(0)"` // 状态 1 已完成(客户通过) 2已退回(客户) 3已通过(报告负责人) 4已退回(报告负责人) 5已提交
+	T_reason     string `orm:"type(text)"`         // 原因
+	T_time       string `orm:"type(256)"`          // 时间
+	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_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_deadline             string `orm:"size(256);null"`       // 截止时间
-	T_scheme               string `orm:"size(256);null"`       // 实施方案 负责人UUID
-	T_collection           string `orm:"size(256);null"`       // 数据采集 负责人UUID
-	T_reporting            string `orm:"size(256);null"`       // 报告编写 负责人UUID
-	T_delivery             string `orm:"size(256);null"`       // 交付审核 负责人UUID
-	T_scheme_state         int    `orm:"size(2);default(0)"`   // 实施方案 状态 0 未完成 1 已完成
-	T_collection_state     int    `orm:"size(2);default(0)"`   // 数据采集 状态 0 未完成 1 数据来源已完成 2 处理中 3 已采集-无数据 4-数据编辑已完成
-	T_reporting_state      int    `orm:"size(2);default(0)"`   // 报告编写 状态 0 未完成 1 已完成
-	T_delivery_state       int    `orm:"size(2);default(0)"`   // 交付审核 状态 0 未完成 1 已完成 2 处理中
-	T_marking_state        int    `orm:"size(2);default(0)"`   // 验证标识 状态 0 未完成 1 已完成
+	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_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_deadline             string `orm:"size(256);null"`     // 截止时间
+	T_scheme               string `orm:"size(256);null"`     // 实施方案 负责人UUID
+	T_collection           string `orm:"size(256);null"`     // 数据采集 负责人UUID
+	T_reporting            string `orm:"size(256);null"`     // 报告编写 负责人UUID
+	T_delivery             string `orm:"size(256);null"`     // 交付审核 负责人UUID
+	T_scheme_state         int    `orm:"size(2);default(0)"` // 实施方案 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
+	T_collection_state     int    `orm:"size(2);default(0)"` // 数据采集 状态 0 未完成 1 数据来源已完成 2 处理中 3 已采集-无数据 4-数据编辑已完成(已提交) 5已通过(负责人) 6已退回(负责人)
+	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_VerifyDeviceDataStartTime string `orm:"size(256);null"` // 验证设备数据开始时间
 	T_VerifyDeviceDataEndTime   string `orm:"size(256);null"` // 验证设备数据开始时间
 	T_BindDeviceDataStartTime   string `orm:"size(256);null"` // 绑定设备数据开始时间
 	T_BindDeviceDataEndTime     string `orm:"size(256);null"` // 绑定设备数据结束时间
 
-	T_doc1 string `orm:"type(text);null"` // 封面
-	T_pdf1 string `orm:"type(text);null"` // 封面
-	T_doc2 string `orm:"type(text);null"` // 报告
-	T_pdf2 string `orm:"type(text);null"` // 报告
-	T_doc3 string `orm:"type(text);null"` // 证书
-	T_pdf3 string `orm:"type(text);null"` // 证书
-	T_pdf4 string `orm:"type(text);null"` // 验证标识
+	T_doc1           string `orm:"type(text);null"` // 封面
+	T_pdf1           string `orm:"type(text);null"` // 验证方案
+	T_pdf1_watermark string `orm:"type(text);null"` // 验证方案 带水印
+	T_doc2           string `orm:"type(text);null"` // 报告
+	T_pdf2           string `orm:"type(text);null"` // 验证报告
+	T_pdf2_watermark string `orm:"type(text);null"` // 验证报告 带水印
+	T_doc3           string `orm:"type(text);null"` // 证书
+	T_pdf3           string `orm:"type(text);null"` // 证书
+	T_pdf4           string `orm:"type(text);null"` // 验证标识
 
 	T_Show  int `orm:"size(2);default(1)"`   // 0 隐藏   1 公开
 	T_Visit int `orm:"size(200);default(0)"` // 浏览量
@@ -56,71 +161,216 @@ type Task struct {
 	T_sn                        string `orm:"size(256);null"` // sn
 	T_CalibrationExpirationTime string `orm:"size(256);null"` // 校准到期时间
 
+	T_project        string `orm:"size(256);null"` // 项目 负责人UUID
+	T_province       string `orm:"size(256);null"` // 省
+	T_city           string `orm:"size(256);null"` // 市
+	T_district       string `orm:"size(256);null"` // 区
+	T_province_code  string `orm:"size(256);null"` // 省 code
+	T_city_code      string `orm:"size(256);null"` // 市 code
+	T_district_code  string `orm:"size(256);null"` // 区 code
+	T_category       string `orm:"size(256);null"` // 类别
+	T_device_type    string `orm:"size(256);null"` // 设备类型
+	T_volume         string `orm:"size(256);null"` // 规格/容积
+	T_verify_type    string `orm:"size(256);null"` // 验证类型
+	T_subject_matter string `orm:"size(256);null"` // 标的物名称
+	T_temp_range     string `orm:"size(256);null"` // 验证温度范围
+	T_report_number  string `orm:"size(256);null"` // 报告编号
+	T_report_type    string `orm:"size(256);null"` // 报告类型
+
+	T_start_time    string  `orm:"size(256);null"` // 项目开始时间
+	T_end_time      string  `orm:"size(256);null"` // 结束时间 报告审核通过时间
+	T_time_interval float64 `orm:"size(256);null"` // 时间间隔 单位分钟
+	T_reject_times  int     `orm:"size(256);null"` // 驳回次数 客户退回方案和报告时
+	T_reject_record string  `orm:"type(text)"`     // 驳回记录
+
+	// 方案
+	T_scheme_start_time    string  `orm:"size(256);null"` // 验证方案开始时间 接收信息采集表的时间
+	T_scheme_end_time      string  `orm:"size(256);null"` // 验证方案结束时间 负责人审核通过后最后一次上传时间
+	T_scheme_time_interval float64 `orm:"size(256);null"` // 时间间隔 单位分钟
+	T_scheme_overtime      float64 `orm:"size(256);null"` // 验证方案超时时间 单位分钟
+	T_scheme_signature     string  `orm:"type(text)"`     // 验证方案客户签字确认图片
+	T_scheme_return_times  int     `orm:"size(256);null"` // 验证方案退回次数
+	T_scheme_audit_record  string  `orm:"type(text)"`     // 验证方案审核记录
+
+	// 实施
+	T_enter_area_time          string  `orm:"size(256);null"`  // 进场时间
+	T_collection_start_time    string  `orm:"size(256);null"`  // 实施开始时间(app开始验证时间)
+	T_collection_end_time      string  `orm:"size(256);null"`  // 实施结束时间 (审核通过后签字确认提交时间)
+	T_collection_time_interval float64 `orm:"size(256);null"`  // 时间间隔 单位分钟
+	T_collection_overtime      float64 `orm:"size(256);null"`  // 实施超时时间 单位分钟
+	T_collection_signature     string  `orm:"type(text)"`      // 实施人员签字确认图片
+	T_collection_return_times  int     `orm:"size(256);null"`  // 实施方案退回次数
+	T_collection_audit_record  string  `orm:"type(text);null"` // 实施方案审核记录
+
+	// 报告
+	T_reporting_start_time    string  `orm:"size(256);null"`  // 验证报告开始时间 接收信息采集表的时间
+	T_reporting_end_time      string  `orm:"size(256);null"`  // 验证报告结束时间 负责人审核通过后最后一次上传时间
+	T_reporting_time_interval float64 `orm:"size(256);null"`  // 时间间隔 单位分钟
+	T_reporting_overtime      float64 `orm:"size(256);null"`  // 验证报告超时时间 单位分钟
+	T_reporting_signature     string  `orm:"type(text)"`      // 验证报告客户签字确认图片
+	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 保存时都会对时间自动更新
 }
 
-type Task_R struct {
-	T_InfoCollection_id         string    // 信息采集id
-	T_task_id                   string    // id
-	T_name                      string    // 标题
-	T_doc1                      string    // 封面
-	T_pdf1                      string    // 封面
-	T_doc2                      string    // 报告
-	T_pdf2                      string    // 报告
-	T_doc3                      string    // 证书
-	T_pdf3                      string    // 证书
-	T_Show                      int       // 公开/隐藏
-	T_Visit                     int       // 浏览量
-	T_State                     int       // 0    1
-	T_scheme_state              int       // 实施方案 状态 0 未完成 1 已完成
-	T_collection_state          int       // 数据采集 状态 0 未完成 1 已完成
-	T_reporting_state           int       // 报告编写 状态 0 未完成 1 已完成
-	T_delivery_state            int       // 交付审核 状态 0 未完成 1 已完成
-	T_VerifyDeviceDataTime      [2]string // 验证设备数据开始-结束时间
-	T_BindDeviceDataTime        [2]string // 绑定设备数据开始-结束时间
-	T_sn                        string    // sn
-	T_CalibrationExpirationTime string    // 校准到期时间
-	CreateTime                  string
-	UpdateTime                  string
+type Task_ struct {
+	Id                     int
+	T_class                int       // 分类ID
+	T_InfoCollection_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_deadline             string    // 截止时间
+	T_scheme               string    // 实施方案 负责人UUID
+	T_collection           string    // 数据采集 负责人UUID
+	T_reporting            string    // 报告编写 负责人UUID
+	T_delivery             string    // 交付审核 负责人UUID
+	T_scheme_state         int       // 实施方案 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
+	T_collection_state     int       // 数据采集 状态 0 未完成 1 数据来源已完成 2 处理中 3 已采集-无数据 4-数据编辑已完成(已提交) 5已通过(负责人) 6已退回(负责人)
+	T_reporting_state      int       // 报告编写 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
+	T_delivery_state       int       // 交付审核 状态 0 未完成 1 已完成 2 处理中
+	T_marking_state        int       // 验证标识 状态 0 未完成 1 已完成
+	T_scheme_state_str     string    // 实施方案 状态 字符串
+	T_collection_state_str string    // 数据采集 状态 字符串
+	T_reporting_state_str  string    // 报告编写 状态 字符串
+	T_delivery_state_str   string    // 交付审核 状态 字符串
+	T_marking_state_str    string    // 验证标识 状态 字符串
+	T_scheme_name          string    // 实施方案 负责人姓名
+	T_collection_name      string    // 数据采集 负责人姓名
+	T_reporting_name       string    // 报告编写 负责人姓名
+	T_delivery_name        string    // 交付审核 负责人姓名
+	T_VerifyDeviceDataTime [2]string // 验证设备数据开始-结束时间
+	T_BindDeviceDataTime   [2]string // 绑定设备数据开始-结束时间
+	T_doc1                 string    // 封面
+	T_pdf1                 string    // 验证方案
+	T_doc2                 string    // 报告
+	T_pdf2                 string    // 报告
+	T_doc3                 string    // 证书
+	T_pdf3                 string    // 证书
+	T_pdf4                 string    // 验证标识
+
+	T_Show                      int    // 0 公开 1 隐藏
+	T_Visit                     int    // 浏览量
+	T_State                     int    // 0 删除 1 正常
+	T_sn                        string // sn
+	T_CalibrationExpirationTime string // 校准到期时间
+
+	T_province      string                        // 省
+	T_city          string                        // 市
+	T_district      string                        // 区
+	T_area          []string                      // 省市区
+	T_province_code string                        // 省 code
+	T_city_code     string                        // 市 code
+	T_district_code string                        // 区 code
+	T_area_code     []string                      // 省市区
+	InfoCollection  InfoCollection.InfoCollection //信息采集
+
 }
 
-type Task_ struct {
-	Id                          int
-	T_class                     int       // 分类ID
-	T_InfoCollection_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_deadline                  string    // 截止时间
-	T_scheme                    string    // 实施方案 负责人UUID
-	T_collection                string    // 数据采集 负责人UUID
-	T_reporting                 string    // 报告编写 负责人UUID
-	T_delivery                  string    // 交付审核 负责人UUID
-	T_scheme_state              int       // 实施方案 状态 0 未完成 1 已完成
-	T_collection_state          int       // 数据采集 状态 0 未完成 1 已完成
-	T_reporting_state           int       // 报告编写 状态 0 未完成 1 已完成
-	T_delivery_state            int       // 交付审核 状态 0 未完成 1 已完成
-	T_scheme_name               string    // 实施方案 负责人姓名
-	T_collection_name           string    // 数据采集 负责人姓名
-	T_reporting_name            string    // 报告编写 负责人姓名
-	T_delivery_name             string    // 交付审核 负责人姓名
-	T_VerifyDeviceDataTime      [2]string // 验证设备数据开始-结束时间
-	T_BindDeviceDataTime        [2]string // 绑定设备数据开始-结束时间
-	T_doc1                      string    // 封面
-	T_pdf1                      string    // 封面
-	T_doc2                      string    // 报告
-	T_pdf2                      string    // 报告
-	T_doc3                      string    // 证书
-	T_pdf3                      string    // 证书
-	T_Show                      int       // 0 公开 1 隐藏
-	T_Visit                     int       // 浏览量
-	T_State                     int       // 0 删除 1 正常
-	T_sn                        string    // sn
-	T_CalibrationExpirationTime string    // 校准到期时间
+type Task_Stat struct {
+	Id                  int
+	T_class             int    // 分类ID
+	T_InfoCollection_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_deadline             string // 截止时间
+	T_scheme               string // 实施方案 负责人UUID
+	T_collection           string // 数据采集 负责人UUID
+	T_reporting            string // 报告编写 负责人UUID
+	T_delivery             string // 交付审核 负责人UUID
+	T_scheme_state         int    // 实施方案 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
+	T_collection_state     int    // 数据采集 状态 0 未完成 1 数据来源已完成 2 处理中 3 已采集-无数据 4-数据编辑已完成(已提交) 5已通过(负责人) 6已退回(负责人)
+	T_reporting_state      int    // 报告编写 状态 0 未完成 1 已完成(客户通过) 2已退回(客户) 3已通过(负责人) 4已退回(负责人) 5已提交
+	T_delivery_state       int    // 交付审核 状态 0 未完成 1 已完成 2 处理中
+	T_marking_state        int    // 验证标识 状态 0 未完成 1 已完成
+	T_scheme_state_str     string // 实施方案 状态 字符串
+	T_collection_state_str string // 数据采集 状态 字符串
+	T_reporting_state_str  string // 报告编写 状态 字符串
+	T_delivery_state_str   string // 交付审核 状态 字符串
+	T_marking_state_str    string // 验证标识 状态 字符串
+	T_scheme_name          string // 实施方案 负责人姓名
+	T_collection_name      string // 数据采集 负责人姓名
+	T_reporting_name       string // 报告编写 负责人姓名
+	T_delivery_name        string // 交付审核 负责人姓名
+
+	T_VerifyDeviceDataTime [2]string // 验证设备数据开始-结束时间
+	T_BindDeviceDataTime   [2]string // 绑定设备数据开始-结束时间
+
+	T_doc1 string // 封面
+	T_pdf1 string // 验证方案
+	T_doc2 string // 报告
+	T_pdf2 string // 报告
+	T_doc3 string // 证书
+	T_pdf3 string // 证书
+	T_pdf4 string // 验证标识
+
+	T_Show                      int    // 0 公开 1 隐藏
+	T_Visit                     int    // 浏览量
+	T_State                     int    // 0 删除 1 正常
+	T_sn                        string // sn
+	T_CalibrationExpirationTime string // 校准到期时间
+
+	T_project        string   // 项目 负责人UUID
+	T_project_name   string   // 项目 负责人姓名
+	T_province       string   // 省
+	T_city           string   // 市
+	T_district       string   // 区
+	T_area           []string // 省市区
+	T_province_code  string   // 省 code
+	T_city_code      string   // 市 code
+	T_district_code  string   // 区 code
+	T_area_code      []string // 省市区
+	T_category       string   // 类别
+	T_device_type    string   // 设备类型
+	T_volume         string   // 规格/容积
+	T_verify_type    string   // 验证类型
+	T_subject_matter string   // 标的物名称
+	T_temp_range     string   // 验证温度范围
+	T_report_number  string   // 报告编号
+	T_report_type    string   // 报告类型
+	T_start_time     string   // 项目开始时间
+	T_end_time       string   // 结束时间 报告审核通过时间
+	T_time_interval  string   // 时间间隔 单位分钟
+	T_reject_times   int      // 驳回次数 客户退回方案和报告时
+	T_reject_record  string   // 驳回记录
+	// 方案
+	T_scheme_start_time    string // 验证方案开始时间 接收信息采集表的时间
+	T_scheme_end_time      string // 验证方案结束时间
+	T_scheme_time_interval string // 时间间隔 单位分钟
+	T_scheme_overtime      string // 验证方案超时时间 单位分钟
+	T_scheme_signature     string // 验证方案客户签字确认图片
+	T_scheme_return_times  int    // 验证方案退回次数
+	T_scheme_audit_record  string // 验证方案审核记录
+	// 实施
+	T_enter_area_time          string // 进场时间
+	T_collection_start_time    string // 实施开始时间(app开始验证时间)
+	T_collection_end_time      string // 实施结束时间 (签字确认提交时间)
+	T_collection_time_interval string // 时间间隔 单位分钟
+	T_collection_overtime      string // 实施超时时间 单位分钟
+	T_collection_signature     string // 实施人员签字确认图片
+	T_collection_return_times  int    // 实施方案退回次数
+	T_collection_audit_record  string // 实施方案审核记录
+	// 报告
+	T_reporting_start_time    string                          // 验证报告开始时间 接收信息采集表的时间
+	T_reporting_end_time      string                          // 验证报告结束时间
+	T_reporting_time_interval string                          // 时间间隔 单位分钟
+	T_reporting_overtime      string                          // 验证报告超时时间 单位分钟
+	T_reporting_signature     string                          // 验证报告客户签字确认图片
+	T_reporting_return_times  int                             // 验证报告退回次数
+	T_reporting_audit_record  string                          // 验证报告审核记录
+	InfoCollection            InfoCollection.InfoCollection_R //信息菜鸡
+
 }
 
 func (t *Task) TableName() string {
@@ -146,39 +396,15 @@ func init() {
 }
 
 // -------------------------------------------------------------
-func TaskToTask_R(T Task) (T_r Task_R) {
-	T_r.T_InfoCollection_id = T.T_InfoCollection_id
-	T_r.T_task_id = T.T_task_id
-	T_r.T_name = T.T_name
-	T_r.T_doc1 = T.T_doc1
-	T_r.T_pdf1 = T.T_pdf1
-	T_r.T_doc2 = T.T_doc2
-	T_r.T_pdf2 = T.T_pdf2
-	T_r.T_doc3 = T.T_doc3
-	T_r.T_pdf3 = T.T_pdf3
-	T_r.T_Show = T.T_Show
-	T_r.T_State = T.T_State
-	T_r.T_Visit = T.T_Visit
-	T_r.T_scheme_state = T.T_scheme_state
-	T_r.T_collection_state = T.T_collection_state
-	T_r.T_reporting_state = T.T_reporting_state
-	T_r.T_delivery_state = T.T_delivery_state
-	T_r.T_VerifyDeviceDataTime = [2]string{T.T_VerifyDeviceDataStartTime, T.T_VerifyDeviceDataEndTime}
-	T_r.T_BindDeviceDataTime = [2]string{T.T_BindDeviceDataStartTime, T.T_BindDeviceDataEndTime}
-	T_r.UpdateTime = T.UpdateTime.Format("2006-01-02 15:04:05")
-	T_r.CreateTime = T.CreateTime.Format("2006-01-02 15:04:05")
-
-	T_r.T_sn = T.T_sn
-	T_r.T_CalibrationExpirationTime = T.T_CalibrationExpirationTime
-
-	//......
-	return T_r
-}
 
 func TaskToTask_(T Task, userMap, adminMap map[string]string) (T_ Task_) {
 	T_.Id = T.Id
 	T_.T_class = T.T_class
 	T_.T_InfoCollection_id = T.T_InfoCollection_id
+	if len(T.T_InfoCollection_id) > 0 {
+		T_.InfoCollection, _ = InfoCollection.Read_InfoCollection(T.T_InfoCollection_id)
+	}
+
 	T_.T_task_id = T.T_task_id
 	T_.T_uuid = T.T_uuid
 	T_.T_user_name = userMap[T.T_uuid]
@@ -194,6 +420,12 @@ func TaskToTask_(T Task, userMap, adminMap map[string]string) (T_ Task_) {
 	T_.T_collection_state = T.T_collection_state
 	T_.T_reporting_state = T.T_reporting_state
 	T_.T_delivery_state = T.T_delivery_state
+	T_.T_marking_state = T.T_marking_state
+	T_.T_scheme_state_str = TaskSchemeStateMap[T.T_scheme_state]
+	T_.T_collection_state_str = TaskCollectionStateMap[T.T_collection_state]
+	T_.T_reporting_state_str = TaskReportingStateMap[T.T_reporting_state]
+	T_.T_delivery_state_str = TaskDeliveryStateMap[T.T_delivery_state]
+	T_.T_marking_state_str = TaskMarkingStateMap[T.T_marking_state]
 	T_.T_scheme_name = adminMap[T.T_scheme]
 	T_.T_collection_name = adminMap[T.T_collection]
 	T_.T_reporting_name = adminMap[T.T_reporting]
@@ -201,11 +433,19 @@ func TaskToTask_(T Task, userMap, adminMap map[string]string) (T_ Task_) {
 	T_.T_VerifyDeviceDataTime = [2]string{T.T_VerifyDeviceDataStartTime, T.T_VerifyDeviceDataEndTime}
 	T_.T_BindDeviceDataTime = [2]string{T.T_BindDeviceDataStartTime, T.T_BindDeviceDataEndTime}
 	T_.T_doc1 = T.T_doc1
-	T_.T_pdf1 = T.T_pdf1
 	T_.T_doc2 = T.T_doc2
-	T_.T_pdf2 = T.T_pdf2
 	T_.T_doc3 = T.T_doc3
+
+	T_.T_pdf1 = T.T_pdf1_watermark
+	if T_.InfoCollection.T_status == InfoCollection.InfoCollectionStatusReturnedMoney || len(T.T_InfoCollection_id) == 0 || len(T.T_pdf1_watermark) == 0 {
+		T_.T_pdf1 = T.T_pdf1
+	}
+	T_.T_pdf2 = T.T_pdf2_watermark
+	if T_.InfoCollection.T_status == InfoCollection.InfoCollectionStatusReturnedMoney || len(T.T_InfoCollection_id) == 0 || len(T.T_pdf2_watermark) == 0 {
+		T_.T_pdf2 = T.T_pdf2
+	}
 	T_.T_pdf3 = T.T_pdf3
+	T_.T_pdf4 = T.T_pdf4
 	T_.T_Show = T.T_Show
 	T_.T_Visit = T.T_Visit
 	T_.T_State = T.T_State
@@ -213,7 +453,132 @@ func TaskToTask_(T Task, userMap, adminMap map[string]string) (T_ Task_) {
 	T_.T_sn = T.T_sn
 	T_.T_CalibrationExpirationTime = T.T_CalibrationExpirationTime
 
-	//......
+	return T_
+}
+func TaskToTask_Stat(T Task, userMap, adminMap map[string]string) (T_ Task_Stat) {
+	T_.Id = T.Id
+	T_.T_class = T.T_class
+	T_.T_InfoCollection_id = T.T_InfoCollection_id
+	if len(T.T_InfoCollection_id) > 0 {
+		infoCollection, _ := InfoCollection.Read_InfoCollection(T.T_InfoCollection_id)
+		T_.InfoCollection = InfoCollection.InfoCollectionToInfoCollection_R(infoCollection, userMap, adminMap, map[string]string{}, map[string]string{})
+	}
+
+	T_.T_task_id = T.T_task_id
+	T_.T_uuid = T.T_uuid
+	T_.T_user_name = userMap[T.T_uuid]
+	T_.T_name = T.T_name
+	T_.T_VerifyTemplate_class = T.T_VerifyTemplate_class
+	T_.T_VerifyTemplate_id = T.T_VerifyTemplate_id
+	T_.T_deadline = T.T_deadline
+	T_.T_scheme = T.T_scheme
+	T_.T_collection = T.T_collection
+	T_.T_reporting = T.T_reporting
+	T_.T_delivery = T.T_delivery
+	T_.T_scheme_state = T.T_scheme_state
+	T_.T_collection_state = T.T_collection_state
+	T_.T_reporting_state = T.T_reporting_state
+	T_.T_delivery_state = T.T_delivery_state
+	T_.T_marking_state = T.T_marking_state
+	T_.T_scheme_state_str = TaskSchemeStateMap[T.T_scheme_state]
+	T_.T_collection_state_str = TaskCollectionStateMap[T.T_collection_state]
+	T_.T_reporting_state_str = TaskReportingStateMap[T.T_reporting_state]
+	T_.T_delivery_state_str = TaskDeliveryStateMap[T.T_delivery_state]
+	T_.T_marking_state_str = TaskMarkingStateMap[T.T_marking_state]
+
+	T_.T_project_name = adminMap[T.T_project]
+	T_.T_scheme_name = adminMap[T.T_scheme]
+	T_.T_collection_name = adminMap[T.T_collection]
+	T_.T_reporting_name = adminMap[T.T_reporting]
+	T_.T_delivery_name = adminMap[T.T_delivery]
+	T_.T_VerifyDeviceDataTime = [2]string{T.T_VerifyDeviceDataStartTime, T.T_VerifyDeviceDataEndTime}
+	T_.T_BindDeviceDataTime = [2]string{T.T_BindDeviceDataStartTime, T.T_BindDeviceDataEndTime}
+	T_.T_doc1 = T.T_doc1
+	T_.T_doc2 = T.T_doc2
+	T_.T_doc3 = T.T_doc3
+
+	T_.T_pdf1 = T.T_pdf1_watermark
+	if T_.InfoCollection.T_status == InfoCollection.InfoCollectionStatusReturnedMoney || len(T.T_InfoCollection_id) == 0 || len(T.T_pdf1_watermark) == 0 {
+		T_.T_pdf1 = T.T_pdf1
+	}
+	T_.T_pdf2 = T.T_pdf2_watermark
+	if T_.InfoCollection.T_status == InfoCollection.InfoCollectionStatusReturnedMoney || len(T.T_InfoCollection_id) == 0 || len(T.T_pdf2_watermark) == 0 {
+		T_.T_pdf2 = T.T_pdf2
+	}
+	T_.T_pdf3 = T.T_pdf3
+	T_.T_pdf4 = T.T_pdf4
+	T_.T_Show = T.T_Show
+	T_.T_Visit = T.T_Visit
+	T_.T_State = T.T_State
+
+	T_.T_sn = T.T_sn
+	T_.T_CalibrationExpirationTime = T.T_CalibrationExpirationTime
+
+	T_.T_project = T.T_project
+	T_.T_province = T.T_province
+	T_.T_city = T.T_city
+	T_.T_district = T.T_district
+	T_.T_area = []string{T.T_province, T.T_city, T.T_district}
+	T_.T_province_code = T.T_province_code
+	T_.T_city_code = T.T_city_code
+	T_.T_district_code = T.T_district_code
+	T_.T_area_code = []string{T.T_province_code, T.T_city_code, T.T_district_code}
+	T_.T_category = T.T_category
+	T_.T_device_type = T.T_device_type
+	T_.T_volume = T.T_volume
+	T_.T_verify_type = T.T_verify_type
+	T_.T_subject_matter = T.T_subject_matter
+	T_.T_temp_range = T.T_temp_range
+	T_.T_report_number = T.T_report_number
+	T_.T_report_type = T.T_report_type
+	T_.T_start_time = T.T_start_time
+	T_.T_end_time = T.T_end_time
+	T_.T_time_interval = lib.ConvertMinutesToDHM(int(T.T_time_interval))
+	T_.T_reject_times = T.T_reject_times
+	T_.T_reject_record = T.T_reject_record
+
+	// 方案
+	T_.T_scheme_start_time = T.T_scheme_start_time
+	T_.T_scheme_end_time = T.T_scheme_end_time
+
+	if T.T_scheme_state == TaskSchemeStateClientPass ||
+		T.T_scheme_state == TaskSchemeStateClientReturn ||
+		T.T_scheme_state == TaskSchemeStatePass {
+		T_.T_scheme_time_interval = lib.ConvertMinutesToDHM(int(T.T_scheme_time_interval))
+		T_.T_scheme_overtime = lib.ConvertMinutesToDHM(int(T.T_scheme_overtime))
+	}
+
+	T_.T_scheme_signature = T.T_scheme_signature
+	T_.T_scheme_return_times = T.T_scheme_return_times
+	T_.T_scheme_audit_record = T.T_scheme_audit_record
+
+	// 实施
+	T_.T_enter_area_time = T.T_enter_area_time
+	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_time_interval = lib.ConvertMinutesToDHM(int(T.T_collection_time_interval))
+		T_.T_collection_overtime = lib.ConvertMinutesToDHM(int(T.T_collection_overtime))
+	}
+	T_.T_collection_signature = T.T_collection_signature
+	T_.T_collection_return_times = T.T_collection_return_times
+	T_.T_collection_audit_record = T.T_collection_audit_record
+
+	// 报告
+	T_.T_reporting_start_time = T.T_reporting_start_time
+	T_.T_reporting_end_time = T.T_reporting_end_time
+
+	if T.T_reporting_state == TaskReportingStateClientPass ||
+		T.T_reporting_state == TaskReportingStateClientReturn ||
+		T.T_reporting_state == TaskReportingStatePass {
+		T_.T_reporting_time_interval = lib.ConvertMinutesToDHM(int(T.T_reporting_time_interval))
+		T_.T_reporting_overtime = lib.ConvertMinutesToDHM(int(T.T_reporting_overtime))
+	}
+
+	T_.T_reporting_signature = T.T_reporting_signature
+	T_.T_reporting_return_times = T.T_reporting_return_times
+	T_.T_reporting_audit_record = T.T_reporting_audit_record
+
 	return T_
 }
 
@@ -375,35 +740,6 @@ func Add_Task_Visit(m Task) bool {
 	return false
 }
 
-//// 获取列表
-//func Read_Task_List(T_name string, page int, page_z int) ([]Task_R, int64) {
-//
-//	o := orm.NewOrm()
-//	// 也可以直接使用 Model 结构体作为表名
-//	var r []Task
-//	qs := o.QueryTable(new(Task))
-//	var offset int64
-//	if page <= 1 {
-//		offset = 0
-//	} else {
-//		offset = int64((page - 1) * page_z)
-//	}
-//	cond := orm.NewCondition()
-//	cond1 := cond.And("T_name__icontains", T_name) // .AndNot("status__in", 1).Or("profile__age__gt", 2000)
-//
-//
-//	qs.Limit(page_z, offset).SetCond((*orm2.Condition)(cond1)).OrderBy("-Id").All(&r)
-//	cnt, _ := qs.SetCond((*orm2.Condition)(cond1)).Count()
-//
-//	// 转换
-//	var Task_r []Task_R
-//	for _, v := range r {
-//		Task_r = append(Task_r, TaskToTask_R(v))
-//	}
-//
-//	return Task_r, cnt
-//}
-
 // 获取用户任务列表
 func Read_UserTask_List(T_uuid string, T_name string, userMap, adminMap map[string]string, page int, page_z int) ([]Task_, int) {
 
@@ -437,7 +773,7 @@ func Read_UserTask_List(T_uuid string, T_name string, userMap, adminMap map[stri
 }
 
 // 获取任务列表
-func Read_Task_List(T_uuid, T_admin string, T_name string, T_scheme, T_collection, T_reporting, T_delivery,
+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, page int, page_z int) ([]Task_, int) {
 
@@ -455,7 +791,9 @@ func Read_Task_List(T_uuid, T_admin string, T_name string, T_scheme, T_collectio
 	cond1 := cond.AndCond(cond.Or("T_name__icontains", T_name).Or("T_task_id__icontains", T_name)).And("T_State", 1)
 	if len(T_uuid) > 0 {
 		cond1 = cond1.And("T_uuid", T_uuid)
-
+	}
+	if len(T_InfoCollection_id) > 0 {
+		cond1 = cond1.And("T_InfoCollection_id", T_InfoCollection_id)
 	}
 	if len(T_admin) > 0 {
 		cond1 = cond1.AndCond(cond.Or("T_scheme", T_admin).Or("T_collection", T_admin).
@@ -505,62 +843,170 @@ func Read_Task_List(T_uuid, T_admin string, T_name string, T_scheme, T_collectio
 
 	return TaskList, int(cnt)
 }
+func Read_Task_BySN(sn string) (r Task, err error) {
+	if task, is := Redis_Task_Get(sn); is == true {
+		return task, nil
+	}
 
-// 获取列表 /时间筛选  Time_start_ Time_end_    2021-12-30,所以下面要加后缀 时间
-func Read_Task_List_Time(page int, T_sn string, T_Title string, Time_start_ string, Time_end_ string) ([]Task_R, int64) {
+	o := orm.NewOrm()
+	qs := o.QueryTable(new(Task))
+	err = qs.Filter("T_sn", sn).Filter("T_State", 1).One(&r)
+	if err != nil {
+		return r, err
+	}
+
+	Redis_Task_Set(sn, r)
+	return r, nil
+}
 
+// 修改
+func Update_Task_T_InfoTemplate_id(T_InfoCollection_id, T_InfoTemplate_id string) error {
 	o := orm.NewOrm()
-	// 也可以直接使用 Model 结构体作为表名
+
+	qs := o.QueryTable(new(Task))
 	var r []Task
-	var cnt int64
+	o.Begin()
+	qs.Filter("T_InfoCollection_id", T_InfoCollection_id).All(&r)
+	for _, task := range r {
+		task.T_InfoTemplate_id = T_InfoTemplate_id
+		if _, err := o.Update(&task, "T_InfoTemplate_id"); err == nil {
+			Redis_Task_Set(task.T_task_id, task)
+		} else {
+			o.Rollback()
+			logs.Error(lib.FuncName(), err)
+			return err
+		}
+	}
+	o.Commit()
+	return nil
+
+}
+
+func Add_AuditRecord(T_audit_record string, T_uuid, T_admin string, T_scheme_state int, T_reason string, T_type string) (string, error) {
+
+	auditRecord := AuditRecord{
+		T_uuid:   T_uuid,
+		T_admin:  T_admin,
+		T_state:  T_scheme_state,
+		T_reason: T_reason,
+		T_type:   T_type,
+		T_time:   time.Now().Format("2006-01-02 15:04:05"),
+	}
+
+	var returnRecordList []AuditRecord
+	if len(T_audit_record) > 0 {
+		err := json.Unmarshal([]byte(T_audit_record), &returnRecordList)
+		if err != nil {
+			logs.Error("JSON 反序列化失败:", err)
+			return "", errors.New("JSON 反序列化失败")
+		}
+	}
+
+	returnRecordList = append(returnRecordList, auditRecord)
+	returnRecordJson, err := json.Marshal(returnRecordList)
+	if err != nil {
+		logs.Error("JSON 反序列化失败:", err)
+		return "", errors.New("JSON 反序列化失败")
+	}
+	return string(returnRecordJson), nil
+}
+
+// 获取项目负责人列表
+func Get_Task_UserList(T_type string) []string {
+	o := orm.NewOrm()
+	var err error
+	var pl_lists []string
+	switch T_type {
+	case "T_project":
+		_, err = o.Raw("SELECT DISTINCT t_project FROM task LIMIT 0,1000").QueryRows(&pl_lists)
+	case "T_scheme":
+		_, err = o.Raw("SELECT DISTINCT t_scheme FROM task LIMIT 0,1000").QueryRows(&pl_lists)
+	case "T_collection":
+		_, err = o.Raw("SELECT DISTINCT t_collection FROM task LIMIT 0,1000").QueryRows(&pl_lists)
+	case "T_reporting":
+		_, err = o.Raw("SELECT DISTINCT t_reporting FROM task LIMIT 0,1000").QueryRows(&pl_lists)
+
+	}
+	if err != nil {
+		logs.Error("获取项目负责人列表失败:", err)
+	}
+	return pl_lists
+}
+
+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, page int, page_z int) ([]Task_Stat, int) {
+
+	o := orm.NewOrm()
+
 	qs := o.QueryTable(new(Task))
+	var r []Task
 	var offset int64
 	if page <= 1 {
 		offset = 0
 	} else {
-		offset = int64((page - 1) * conf.Page_size)
+		offset = int64((page - 1) * page_z)
 	}
-
-	if len(Time_start_) > 1 && len(Time_end_) > 1 {
-		logs.Println(Time_start_, Time_end_)
-		qs.Limit(conf.Page_size, offset).Filter("T_Ut__lte", Time_end_+" 23:59:59").Filter("T_Ut__gte", Time_start_+" 00:00:00").Filter("T_Title__icontains", T_Title).Filter("T_sn__icontains", T_sn).OrderBy("-Id").Filter("T_State", 1).All(&r)
-		cnt, _ = qs.Filter("T_Ut__lte", Time_end_+" 23:59:59").Filter("T_Ut__gte", Time_start_+" 00:00:00").Filter("T_Title__icontains", T_Title).Filter("T_sn__icontains", T_sn).Filter("T_State", 1).Count()
-		return []Task_R{}, cnt
+	cond := orm.NewCondition()
+	cond1 := cond.AndCond(cond.Or("T_name__icontains", T_name).Or("T_task_id__icontains", T_name)).And("T_State", 1)
+	if len(T_uuid) > 0 {
+		cond1 = cond1.And("T_uuid", T_uuid)
 	}
-
-	if len(Time_start_) > 1 {
-		qs.Limit(conf.Page_size, offset).Filter("T_Ut__gte", Time_start_+" 00:00:00").Filter("T_Title__icontains", T_Title).Filter("T_sn__icontains", T_sn).OrderBy("-Id").Filter("T_State", 1).All(&r)
-		cnt, _ = qs.Filter("T_Ut__gte", Time_start_+" 00:00:00").Filter("T_Title__icontains", T_Title).Filter("T_sn__icontains", T_sn).Filter("T_State", 1).Count()
-		return []Task_R{}, cnt
-	} else if len(Time_end_) > 1 {
-		qs.Limit(conf.Page_size, offset).Filter("T_Ut__lte", Time_end_+" 23:59:59").Filter("T_Title__icontains", T_Title).Filter("T_sn__icontains", T_sn).OrderBy("-Id").Filter("T_State", 1).All(&r)
-		cnt, _ = qs.Filter("T_Ut__lte", Time_end_+" 23:59:59").Filter("T_Title__icontains", T_Title).Filter("T_sn__icontains", T_sn).Filter("T_State", 1).Count()
-		return []Task_R{}, cnt
+	if len(T_InfoCollection_id) > 0 {
+		cond1 = cond1.And("T_InfoCollection_id", T_InfoCollection_id)
+	}
+	if len(T_admin) > 0 {
+		cond1 = cond1.AndCond(cond.Or("T_scheme", T_admin).Or("T_collection", T_admin).
+			Or("T_reporting", T_admin).Or("T_delivery", T_admin))
+	}
+	if len(T_company_list) > 0 {
+		cond1 = cond1.And("T_uuid__in", T_company_list)
 	}
 
-	qs.Limit(conf.Page_size, offset).Filter("T_Title__icontains", T_Title).Filter("T_sn__icontains", T_sn).OrderBy("-Id").Filter("T_State", 1).All(&r)
-	cnt, _ = qs.Filter("T_Title__icontains", T_Title).Filter("T_sn__icontains", T_sn).Filter("T_State", 1).Count()
-
-	var Task_r []Task_R
-	for _, v := range r {
-		Task_r = append(Task_r, TaskToTask_R(v))
+	if len(T_project) > 0 {
+		cond1 = cond1.And("T_project", T_project)
+	}
+	if len(T_scheme) > 0 {
+		cond1 = cond1.And("T_scheme", T_scheme)
+	}
+	if len(T_collection) > 0 {
+		cond1 = cond1.And("T_collection", T_collection)
+	}
+	if len(T_reporting) > 0 {
+		cond1 = cond1.And("T_reporting", T_reporting)
+	}
+	if len(T_delivery) > 0 {
+		cond1 = cond1.And("T_delivery", T_delivery)
 	}
 
-	return Task_r, cnt
-}
+	if len(T_scheme_state) > 0 {
+		cond1 = cond1.And("T_scheme_state", T_scheme_state)
+	}
+	if len(T_collection_state) > 0 {
+		cond1 = cond1.And("T_collection_state", T_collection_state)
+	}
+	if len(T_reporting_state) > 0 {
+		cond1 = cond1.And("T_reporting_state", T_reporting_state)
+	}
+	if len(T_delivery_state) > 0 {
+		cond1 = cond1.And("T_delivery_state", T_delivery_state)
+	}
+	if len(T_marking_state) > 0 {
+		cond1 = cond1.And("T_marking_state", T_marking_state)
+	}
 
-func Read_Task_BySN(sn string) (r Task, err error) {
-	if task, is := Redis_Task_Get(sn); is == true {
-		return task, nil
+	if page_z == 9999 {
+		qs.SetCond((*orm2.Condition)(cond1)).OrderBy("-Id").All(&r)
+	} else {
+		qs.Limit(page_z, offset).SetCond((*orm2.Condition)(cond1)).OrderBy("-Id").All(&r)
 	}
+	cnt, _ := qs.SetCond((*orm2.Condition)(cond1)).Count()
 
-	o := orm.NewOrm()
-	qs := o.QueryTable(new(Task))
-	err = qs.Filter("T_sn", sn).Filter("T_State", 1).One(&r)
-	if err != nil {
-		return r, err
+	// 转换
+	var TaskList []Task_Stat
+	for _, v := range r {
+		TaskList = append(TaskList, TaskToTask_Stat(v, userMap, adminMap))
 	}
 
-	Redis_Task_Set(sn, r)
-	return r, nil
+	return TaskList, int(cnt)
 }

+ 1 - 1
models/VerifyTemplate/VerifyTemplateMap.go

@@ -214,7 +214,7 @@ func Read_VerifyTemplateMap_List_For_Data(T_VerifyTemplate_id string, T_source,
 		cond = cond.AndNot("T_flow_sort", 0).And("T_VerifyTemplate_id", T_VerifyTemplate_id)
 		qs.SetCond((*orm2.Condition)(cond)).OrderBy("T_flow_sort").All(&r)
 	} else {
-		cond = cond.And("T_source__in", source).And("T_VerifyTemplate_id", T_VerifyTemplate_id) // .AndNot("status__in", 1).Or("profile__age__gt", 2000)
+		cond = cond.And("T_source__in", source).And("T_VerifyTemplate_id", T_VerifyTemplate_id)
 		qs.SetCond((*orm2.Condition)(cond)).OrderBy("T_sort").All(&r)
 	}
 

+ 4 - 0
routers/Account.go

@@ -31,4 +31,8 @@ func init() {
 	// - 用户权限
 	beego.Router("/UserPower/List_All", &controllers.AccountController{}, "*:UserPower_List_All") // 用户权限所有列表
 
+	//-----------消息通知
+	beego.Router("/News/List", &controllers.NewsController{}, "*:List")
+	beego.Router("/News/See", &controllers.NewsController{}, "*:See")
+
 }

+ 11 - 5
routers/InfoCollection.go

@@ -6,11 +6,15 @@ import (
 )
 
 func init() {
-	beego.Router("/InfoCollection/List", &controllers.InfoCollectionController{}, "*:List") // 信息采集列表
-	beego.Router("/InfoCollection/Get", &controllers.InfoCollectionController{}, "*:Get")   // 获取信息采集
-	beego.Router("/InfoCollection/Add", &controllers.InfoCollectionController{}, "*:Add")   // 添加信息采集
-	beego.Router("/InfoCollection/Up", &controllers.InfoCollectionController{}, "*:Up")     // 编辑信息采集
-	beego.Router("/InfoCollection/Del", &controllers.InfoCollectionController{}, "*:Del")   // 删除信息采集
+	beego.Router("/InfoCollection/List", &controllers.InfoCollectionController{}, "*:List")                       // 信息采集列表
+	beego.Router("/InfoCollection/UserList", &controllers.InfoCollectionController{}, "*:UserList")               // 信息采集列表-个人
+	beego.Router("/InfoCollection/Get", &controllers.InfoCollectionController{}, "*:Get")                         // 获取信息采集
+	beego.Router("/InfoCollection/Add", &controllers.InfoCollectionController{}, "*:Add")                         // 添加信息采集
+	beego.Router("/InfoCollection/Up", &controllers.InfoCollectionController{}, "*:Up")                           // 编辑信息采集
+	beego.Router("/InfoCollection/Del", &controllers.InfoCollectionController{}, "*:Del")                         // 删除信息采集
+	beego.Router("/InfoCollection/UpStatus", &controllers.InfoCollectionController{}, "*:UpStatus")               // 修改信息采集状态
+	beego.Router("/InfoCollection/AuditRecordList", &controllers.InfoCollectionController{}, "*:AuditRecordList") // 信息采集审核记录
+	beego.Router("/InfoCollection/Statistics", &controllers.InfoCollectionController{}, "*:Statistics")      // 小程序统计
 
 	beego.Router("/InfoTemplate/Class_List", &controllers.InfoTemplateController{}, "*:Class_List") // 分类列表
 	beego.Router("/InfoTemplate/Class_Add", &controllers.InfoTemplateController{}, "*:Class_Add")   // 分类添加
@@ -30,4 +34,6 @@ func init() {
 
 	beego.Router("/InfoTemplateMapData/List", &controllers.InfoTemplateController{}, "*:Map_Data_List") // 标签数据列表
 	beego.Router("/InfoTemplateMapData/Pu", &controllers.InfoTemplateController{}, "*:Map_Data_Pu")     // 添加标签数据
+	beego.Router("/InfoTemplateMapData/Copy", &controllers.InfoTemplateController{}, "*:Map_Data_Copy") // 复制标签数据
+
 }

+ 18 - 8
routers/Task.go

@@ -9,14 +9,24 @@ func init() {
 
 	beego.Router("/UpFileToken", &controllers.UpFileController{}, "*:ConfigUpFileToken") // 上传文件
 
-	beego.Router("/Task/List", &controllers.TaskController{}, "*:List")                           // 任务列表
-	beego.Router("/Task/Get", &controllers.TaskController{}, "*:Get")                             // 获取任务
-	beego.Router("/Task/Add", &controllers.TaskController{}, "*:Add")                             // 添加任务
-	beego.Router("/Task/Up", &controllers.TaskController{}, "*:Up")                               // 编辑任务
-	beego.Router("/Task/Del", &controllers.TaskController{}, "*:Del")                             // 删除任务
-	beego.Router("/Task/UpCollectionState", &controllers.TaskController{}, "*:UpCollectionState") // 修改任务状态
-	beego.Router("/Task/UpDeliveryState", &controllers.TaskController{}, "*:UpDeliveryState") // 修改交付审核状态
-	beego.Router("/Task/AddData_Tool", &controllers.TaskController{}, "*:AddData_Tool")           // 1.0 添加任务数据
+	beego.Router("/Task/List", &controllers.TaskController{}, "*:List")                                   // 任务列表
+	beego.Router("/Task/Get", &controllers.TaskController{}, "*:Get")                                     // 获取任务
+	beego.Router("/Task/Add", &controllers.TaskController{}, "*:Add")                                     // 添加任务
+	beego.Router("/Task/Up", &controllers.TaskController{}, "*:Up")                                       // 编辑任务
+	beego.Router("/Task/Del", &controllers.TaskController{}, "*:Del")                                     // 删除任务
+	beego.Router("/Task/UpCollectionState", &controllers.TaskController{}, "*:UpCollectionState")         // 修改任务状态
+	beego.Router("/Task/UpDeliveryState", &controllers.TaskController{}, "*:UpDeliveryState")             // 修改交付审核状态
+	beego.Router("/Task/AddData_Tool", &controllers.TaskController{}, "*:AddData_Tool")                   // 1.0 添加任务数据
+	beego.Router("/Task/ReceiptInfoCollection", &controllers.TaskController{}, "*:ReceiptInfoCollection") // 接收信息采集
+	beego.Router("/Task/SyncInfoCollection", &controllers.TaskController{}, "*:SyncInfoCollection")       // 同步信息采集
+	beego.Router("/Task/UpSchemeState", &controllers.TaskController{}, "*:UpSchemeState")                 // 修改验证方案状态
+	beego.Router("/Task/EnterArea", &controllers.TaskController{}, "*:EnterArea")                         // 进场
+	beego.Router("/Task/StartVerify", &controllers.TaskController{}, "*:StartVerify")                     // 开始验证-实施开始时间
+	beego.Router("/Task/UpReportingState", &controllers.TaskController{}, "*:UpReportingState")           // 修改验证报告状态
+	beego.Router("/Task/AuditRecordList", &controllers.TaskController{}, "*:AuditRecordList")             // 审核记录
+	beego.Router("/Task/GetTaskUserList", &controllers.TaskController{}, "*:GetTaskUserList")             // 获取任务负责人列表
+	beego.Router("/Task/Stat", &controllers.TaskController{}, "*:Stat")                                   // 报告统计
+	beego.Router("/Task/Stat_Excel", &controllers.TaskController{}, "*:Stat_Excel")                       // 报告统计-excel
 
 	// 日志
 	beego.Router("/TaskLogs/List", &controllers.TaskController{}, "*:Logs_List")

+ 0 - 34
routers/VerifyTemplate.go

@@ -7,40 +7,6 @@ import (
 
 func init() {
 
-	//   -----------网关接口-----------
-	// 添加网关
-	//beego.Router("/API/A_Device_List", &controllers.DeviceController{}, "*:A_Device_List") // *全部;  get,post:
-	//// 添加网关
-	//beego.Router("/API/Add_A_Device", &controllers.DeviceController{}, "*:Add_A_Device") // *全部;  get,post:
-	//// 修改网关
-	//beego.Router("/API/Up_A_Device", &controllers.DeviceController{}, "*:Up_A_Device") // *全部;  get,post:
-	//// 删除网关
-	//beego.Router("/API/Delete_A_Device", &controllers.DeviceController{}, "*:Delete_A_Device") // *全部;  get,post:
-	// 用户 - 微信授权
-	//beego.Router("/", &controllers.AdminController{}, "*:Login")
-	//// 网关 WebSocket
-	//beego.Router("/ws/join", &WebSocket.WebSocketController{}, "get:Join")
-	//
-	//
-	//beego.Router("/UpFile", &controllers.UpFileController{}, "*:UpFile") // *全部;  get,post:
-	//
-	//
-	//beego.Router("/Login", &controllers.AdminController{}, "*:Login")                           // *全部;  get,post:
-	//beego.Router("/Login_verification", &controllers.AdminController{}, "*:Login_verification") // *全部;  get,post:
-	//
-	//
-	//beego.Router("/Index", &controllers.AdminController{}, "*:Index")
-	//beego.Router("/Home", &controllers.AdminController{}, "*:Home")
-	//
-	//beego.Router("/Nows_rend", &controllers.AdminController{}, "*:Nows_rend")  // 获取未读消息
-	//// 日志
-	//beego.Router("/System/Logs", &controllers.LogsController{}, "*:List")  // 获取未读消息
-	//
-	//
-	//// 微信服务端
-	//beego.Router("/Wx/Wx_handler", &controllers.WxController{}, "*:Wx_handler")  // 获取未读消息
-	//beego.Router("/Wx/Wx_handler", &controllers.WxController{}, "*:Wx")  // 获取未读消息
-
 	// 模板路由
 	beego.Router("/Template/List_html", &controllers.TemplateController{}, "*:List_html") // 获取未读消息
 	beego.Router("/Template/List_", &controllers.TemplateController{}, "*:List_")         // 获取未读消息

+ 47 - 0
script/add_watermark.py

@@ -0,0 +1,47 @@
+import os
+import sys
+
+from PyPDF2 import PdfReader, PdfWriter
+import requests
+import PyPDF2
+
+
+def add_watermark(url, pdf_file_in, pdf_file_mark, pdf_file_out):
+    """把水印添加到pdf中"""
+    
+    response = requests.get(url)
+    with open(pdf_file_in, "wb") as pdf_file:
+        pdf_file.write(response.content)
+    input_stream = open(pdf_file_in, 'rb')
+    pdf_input = PdfReader(input_stream, strict=False)
+
+    # 获取PDF文件的页数
+    # pageNum = pdf_input.getNumPages()
+    pageNum = len(pdf_input.pages)
+
+    pdf_output = PdfWriter()
+    # 读入水印pdf文件
+    pdf_watermark = PdfReader(open(pdf_file_mark, 'rb'), strict=False)
+    # 给每一页打水印
+    for i in range(pageNum):
+        # page = pdf_input.getPage(i)
+        page = pdf_input.pages[i]
+        page.merge_page(pdf_watermark.pages[0])
+        page.compress_content_streams()  # 压缩内容
+        pdf_output.add_page(page)
+    pdf_output.write(open(pdf_file_out, 'wb'))
+
+
+
+if __name__ == '__main__':
+   
+    if len(sys.argv) < 3:
+        print("Usage: add_watermark.py <pdf_file_in>  <pdf_file_out>  <pdf_file_mark>")
+        sys.exit(1)
+
+    pdf_file_url = sys.argv[1]
+    pdf_file_in = sys.argv[2] # 要加水印的文件名
+    pdf_file_out = sys.argv[3] # 加好水印的结果文件
+    pdf_file_mark = sys.argv[4]
+    add_watermark(pdf_file_url, pdf_file_in, pdf_file_mark, pdf_file_out)
+    print(pdf_file_out)

Разница между файлами не показана из-за своего большого размера
+ 47 - 0
script/watermark.pdf


+ 23 - 0
tests/default_test.go

@@ -3,6 +3,8 @@ package test
 import (
 	"ColdVerify_server/lib"
 	"ColdVerify_server/logs"
+	"fmt"
+	"os/exec"
 	"testing"
 	"time"
 )
@@ -49,3 +51,24 @@ func TestBeego(t *testing.T) {
 	//docx3.WriteToFile("./new_result_3.docx")
 
 }
+
+func TestR(t *testing.T) {
+	// 设置要执行的Python脚本和参数
+	scriptPath := "../script"
+	arg1 := "/Users/zoie/work/study/python/project/python2wordpdf_process-master/input.pdf"
+	arg2 := "../ofile/watermarked.pdf"
+	arg3 := "../script/watermark.pdf"
+
+	// 执行Python脚本
+	cmd := exec.Command("python", "add_watermark.py", arg1, arg2, arg3)
+	cmd.Dir = scriptPath
+	// 获取命令输出
+	output, err := cmd.CombinedOutput()
+	if err != nil {
+		fmt.Println("Error:", err)
+		//return
+	}
+
+	// 打印Python脚本的输出
+	fmt.Println(string(output))
+}

Некоторые файлы не были показаны из-за большого количества измененных файлов