Przeglądaj źródła

去除了测试用的接口,并添加了一个新的方法

mainqaq 2 lat temu
rodzic
commit
687ce21a0e

+ 0 - 14
controllers/secondary_order_api_contorller.go Wyświetl plik

@@ -36,23 +36,9 @@ func SecondaryOrderApiRegistRouters() {
36 36
 	beego.Router("/api/secondary/getusername", &SecondaryOrderApiController{}, "get:GetuserName")                   //获取仓库管理员信息
37 37
 	beego.Router("/api/secondary/byliinit", &SecondaryOrderApiController{}, "get:Byliinit")                         //初始化旧数据
38 38
 	beego.Router("/api/secondary/getcreaterid", &SecondaryOrderApiController{}, "get:GetCreaterId")                 //获取当前登录的人的id
39
-	beego.Router("/api/secondary/ttttt", &SecondaryOrderApiController{}, "get:TTTTT")
40 39
 
41 40
 }
42 41
 
43
-//ceshi
44
-func (this *SecondaryOrderApiController) TTTTT() {
45
-	orgid := this.GetAdminUserInfo().CurrentOrgId
46
-	err := service.GetDefaultStorehouse(orgid)
47
-	if err != nil {
48
-		utils.ErrorLog("创建默认仓库失败,原因为:", err)
49
-	}
50
-	this.ServeSuccessJSON(map[string]interface{}{
51
-		"list": err,
52
-	})
53
-	return
54
-}
55
-
56 42
 //获取仓库编码
57 43
 func (this *SecondaryOrderApiController) GetStoreCode() {
58 44
 	orgId := this.GetAdminUserInfo().CurrentOrgId

+ 21 - 0
service/secondary_service.go Wyświetl plik

@@ -724,3 +724,24 @@ func FindRoles(orgid int64) map[string]int {
724 724
 	}
725 725
 	return roles
726 726
 }
727
+
728
+//判断两个切片中的元素是否有重复的,true有重复的元素,false无相同元素
729
+func IsIdentical(str1 []string, str2 []string) (t bool) {
730
+	t = false
731
+	if len(str1) == 0 || len(str2) == 0 {
732
+		return
733
+	}
734
+	map1, map2 := make(map[string]int), make(map[string]int)
735
+	for i := 0; i < len(str1); i++ {
736
+		map1[str1[i]] = i
737
+	}
738
+	for i := 0; i < len(str2); i++ {
739
+		map2[str2[i]] = i
740
+	}
741
+	for k, _ := range map1 {
742
+		if _, ok := map2[k]; ok {
743
+			t = true
744
+		}
745
+	}
746
+	return
747
+}