Sfoglia il codice sorgente

编号获取修改

WH01243 1 anno fa
parent
commit
bfd4c17017
1 ha cambiato i file con 5 aggiunte e 4 eliminazioni
  1. 5 4
      service/acceptance.go

+ 5 - 4
service/acceptance.go

@@ -30,7 +30,7 @@ func AddAcceptance(in *biservice.AcceptanceReq, DkPersonMap []map[string]interfa
 			deptName = gconv.String((*deptData)["name"])
 		}
 	}
-	acceptance_no := fmt.Sprintf("SLD%s%s", time.Now().Format(date.Date_Short_Layout), FindNumber("sld"))
+	acceptance_no := fmt.Sprintf("SLD%s%s", time.Now().Format(date.Date_yyyyMMdd), FindNumber("sld"))
 	acceptanceMap := map[string]interface{}{
 		"acceptance_no":         acceptance_no,
 		"propose_type":          in.ProposeType,
@@ -103,7 +103,7 @@ func AddAcceptance(in *biservice.AcceptanceReq, DkPersonMap []map[string]interfa
 				}
 			}
 			if dkPositionId != 0 {
-				work_order_no := fmt.Sprintf("GD%s%s", time.Now().Format(date.Date_Short_Layout), FindNumber("gd"))
+				work_order_no := fmt.Sprintf("GD%s%s", time.Now().Format(date.Date_yyyyMMdd), FindNumber("gd"))
 				orderWorkMap := map[string]interface{}{
 					"work_order_no":         work_order_no,
 					"acceptance_no":         acceptance_no,
@@ -259,7 +259,7 @@ FROM
 			entniche_department_user a
 			INNER JOIN entniche_user_role b ON a.dept_id = ? 
 			AND a.user_id = b.user_id 
-			AND b.role_id =2
+			 AND b.role_id !=""
 			INNER JOIN entniche_user c ON a.user_id = c.id`, deptId)
 	if depthMap != nil && len(*depthMap) > 0 {
 		person["deptPersonName"] = gconv.String((*depthMap)[0]["name"])
@@ -273,7 +273,7 @@ FROM
 	INNER JOIN entniche_department_user a ON d.id = ? 
 	AND d.pid = a.dept_id
 	INNER JOIN entniche_user_role b ON a.user_id = b.user_id 
-	AND b.role_id = 1
+	AND  b.role_id !=""
 	INNER JOIN entniche_user c ON a.user_id = c.id`, deptId)
 	if superiorDepthMap != nil && len(*superiorDepthMap) > 0 {
 		person["superiorDepthPersonName"] = gconv.String((*superiorDepthMap)[0]["name"])
@@ -293,6 +293,7 @@ func FindNumber(moudle string) string {
 		redis.Del("newother", yesterdayKey)
 	}
 	count := redis.Incr("newother", key)
+	log.Println("编号获取", moudle, fmt.Sprintf("%04d", count))
 	return fmt.Sprintf("%04d", count)
 }
 func WorkMail(gmailAuth []*mail.GmailAuth, personMap map[string]interface{}, productStr string, personName1, personName2, createTimeStr, acceptance_no, phone, company string) {