|
@@ -82,6 +82,32 @@ func IsStorehouseAddress(orgid int64, storehouse_address string) (bool, error) {
|
82
|
82
|
return tmp, err
|
83
|
83
|
}
|
84
|
84
|
|
|
85
|
+//查询仓库名称是否重复(用于修改)
|
|
86
|
+func IsStorehouseNameUp(orgid, id int64, storehouse_name string) (bool, error) {
|
|
87
|
+ var total int
|
|
88
|
+ var tmp bool
|
|
89
|
+ err := XTReadDB().Model(&models.Storehouse{}).Where("storehouse_name = ? and user_org_id = ? and status = 1 and id != ?", storehouse_name, orgid, id).Count(&total).Error
|
|
90
|
+ if total > 0 {
|
|
91
|
+ tmp = true //有重复的
|
|
92
|
+ } else {
|
|
93
|
+ tmp = false
|
|
94
|
+ }
|
|
95
|
+ return tmp, err
|
|
96
|
+}
|
|
97
|
+
|
|
98
|
+//查询仓库地址是否重复(用于修改)
|
|
99
|
+func IsStorehouseAddressUp(orgid, id int64, storehouse_address string) (bool, error) {
|
|
100
|
+ var total int
|
|
101
|
+ var tmp bool
|
|
102
|
+ err := XTReadDB().Model(&models.Storehouse{}).Where("storehouse_address = ? and user_org_id = ? and status = 1 and id != ?", storehouse_address, orgid, id).Count(&total).Error
|
|
103
|
+ if total > 0 {
|
|
104
|
+ tmp = true //有重复的
|
|
105
|
+ } else {
|
|
106
|
+ tmp = false
|
|
107
|
+ }
|
|
108
|
+ return tmp, err
|
|
109
|
+}
|
|
110
|
+
|
85
|
111
|
//新增仓库
|
86
|
112
|
func AddStroehouse(storehouse models.Storehouse) error {
|
87
|
113
|
tx := XTWriteDB().Begin()
|