Explorar o código

跟踪信息 根据个人统计

wangshan %!s(int64=5) %!d(string=hai) anos
pai
achega
52a8d7830f

+ 10 - 0
.gitignore

@@ -0,0 +1,10 @@
+pkg
+bin
+*/pkg
+*.exe
+*.log
+*/src/src
+*.data
+*/bin
+.idea/*
+src/logs/*

+ 11 - 8
entniche/src/service/track/track.go

@@ -49,17 +49,20 @@ func (this *Action) Save() {
 			if projectid_str != "" && customer_str != "" && status != 0 && i_type != 0 && time_i != 0 {
 				projectid := qutil.Int64All(qutil.SE.Decode4HexByCheck(projectid_str))
 				customerid := qutil.Int64All(qutil.SE.Decode4HexByCheck(customer_str))
-				euc := util.Mysql.FindOne("entniche_user_customer", map[string]interface{}{
-					"customer_id": customerid,
-					"user_id":     this.GetSession("entUserId"),
-				}, "type,timestamp", "")
-				dis_type := (*euc)["type"]
-				dis_time := (*euc)["timestamp"]
+				euc := util.Mysql.SelectBySql(`SELECT a.type,a.timestamp,b.name FROM entniche_user_customer a INNER JOIN entniche_user b ON (a.user_id=b.id) WHERE a.customer_id = ? AND a.user_id = ?`, customerid, this.GetSession("entUserId"))
+				//				euc := util.Mysql.FindOne("entniche_user_customer", map[string]interface{}{
+				//					"customer_id": customerid,
+				//					"user_id":     this.GetSession("entUserId"),
+				//				}, "type,timestamp", "")
+				dis_type := (*euc)[0]["type"]      //分配类型
+				dis_time := (*euc)[0]["timestamp"] //分配时间
+				user_name := (*euc)[0]["name"]     //用户姓名
 				i := util.Mysql.Insert("entniche_project_track", map[string]interface{}{
 					"project_id": projectid,
 					"dis_type":   dis_type,
 					"dis_time":   dis_time,
 					"user_id":    this.GetSession("entUserId"),
+					"user_name":  user_name,
 					"status":     status,
 					"type":       i_type,
 					"address":    this.GetString("address"),
@@ -155,7 +158,7 @@ func (this *Action) ListInfo() {
 			user_type := this.GetString("user_type")
 			if customer_str != "" && user_type != "" {
 				customer_id := qutil.SE.Decode4HexByCheck(customer_str)
-				track_sql := `SELECT a.user_id,a.project_id,a.status,a.time,a.createtime,a.type,a.id,b.projectname,d.name AS dept_name,a.dis_type,a.dis_time FROM entniche_project_track a 
+				track_sql := `SELECT a.user_id,a.user_name,a.project_id,a.status,a.time,a.createtime,a.type,a.id,b.projectname,d.name AS dept_name,a.dis_type,a.dis_time FROM entniche_project_track a 
 INNER JOIN entniche_project b ON (a.project_id=b.id)
 INNER JOIN entniche_department_user c ON (c.user_id = a.user_id)
 INNER JOIN entniche_department d ON (d.id = c.dept_id)
@@ -179,7 +182,7 @@ INNER JOIN entniche_department c ON (c.id = b.dept_id)
 					var _trackInfo = map[string]*trackInfo{}
 					for _, v := range *track_Res {
 						//分配方式fptype+分配时间fytime+部门名称dept_name+项目名称projectname
-						trackKey := strconv.FormatInt(v["dis_type"].(int64), 10) + "&" + v["dis_time"].(string) + "&" + v["dept_name"].(string) + "&" + v["projectname"].(string)
+						trackKey := strconv.FormatInt(v["dis_type"].(int64), 10) + "&" + v["dis_time"].(string) + "&" + v["user_name"].(string) + "&" + v["projectname"].(string)
 						_t := _trackInfo[trackKey]
 						if _t == nil {
 							_t = &trackInfo{}

BIN=BIN
public/pkg/windows_amd64/ent/entity.a


BIN=BIN
public/pkg/windows_amd64/ent/util.a