|
@@ -1,5 +1,672 @@
|
1
|
1
|
package service
|
2
|
2
|
|
3
|
|
-func main() {
|
|
3
|
+import (
|
|
4
|
+ "XT_New/models"
|
|
5
|
+ "XT_New/utils"
|
|
6
|
+ "fmt"
|
|
7
|
+ "github.com/jinzhu/gorm"
|
|
8
|
+ "math/rand"
|
|
9
|
+ "time"
|
|
10
|
+)
|
4
|
11
|
|
|
12
|
+//生成编号,规则为:"sh-"+4位随机数
|
|
13
|
+func CreateCode() string {
|
|
14
|
+ s := fmt.Sprintf("%04v", rand.New(rand.NewSource(time.Now().UnixNano())).Int63n(10000))
|
|
15
|
+ code := "sh-" + s
|
|
16
|
+ return code
|
|
17
|
+}
|
|
18
|
+
|
|
19
|
+//查询编号是否重复
|
|
20
|
+func FindStorehouseCode(orgid int64, code string) bool {
|
|
21
|
+ var total int
|
|
22
|
+ XTReadDB().Model(&models.Storehouse{}).Where(" storehouse_code = ? and user_org_id = ? and status = 1", code, orgid).Count(&total)
|
|
23
|
+ if total > 0 {
|
|
24
|
+ return true
|
|
25
|
+ } else {
|
|
26
|
+ return false
|
|
27
|
+ }
|
|
28
|
+}
|
|
29
|
+
|
|
30
|
+//判断仓库的库存是否为零 true为零,false不为零
|
|
31
|
+func IsStorehouseNil(id, orgid int64) bool { //根据 id gro_id 查为零的库存
|
|
32
|
+ var h, y int
|
|
33
|
+ //判断耗材是否为零
|
|
34
|
+ XTReadDB().Model(&models.WarehousingInfo{}).Where("stock_count > 0 and status = 1 and org_id = ? and storehouse_id = ?", orgid, id).Count(&h)
|
|
35
|
+ if h > 0 {
|
|
36
|
+ return false
|
|
37
|
+ }
|
|
38
|
+ //判断药品是否为零
|
|
39
|
+ XTReadDB().Model(&models.XtDrugWarehouseInfo{}).Where("stock_max_number > 0 or stock_min_number > 0 ").Where(" org_id = ? and storehouse_id = ?", orgid, id).Count(&y)
|
|
40
|
+ if y > 0 {
|
|
41
|
+ return false
|
|
42
|
+ }
|
|
43
|
+ return true
|
|
44
|
+}
|
|
45
|
+
|
|
46
|
+//修改仓库状态
|
|
47
|
+func UpdateStorehouseStatus(id int64) error {
|
|
48
|
+ err := XTWriteDB().Exec("UPDATE xt_storehouse,(SELECT CASE storehouse_status WHEN 1 THEN 0 WHEN 0 THEN 1 END AS tt FROM xt_storehouse WHERE id=?)tmp SET storehouse_status = tmp.tt where id=?", id, id).Error
|
|
49
|
+ return err
|
|
50
|
+}
|
|
51
|
+
|
|
52
|
+//删除仓库
|
|
53
|
+func DeleteStorehouse(id int64) error {
|
|
54
|
+ err := XTWriteDB().Model(&models.Storehouse{}).Where("id = ?", id).Update("status", 0).Error
|
|
55
|
+ return err
|
|
56
|
+}
|
|
57
|
+
|
|
58
|
+//查询仓库名称是否重复
|
|
59
|
+func IsStorehouseName(orgid int64, storehouse_name string) (bool, error) {
|
|
60
|
+ var total int
|
|
61
|
+ var tmp bool
|
|
62
|
+ err := XTReadDB().Model(&models.Storehouse{}).Where("storehouse_name = ? and user_org_id = ? and status = 1", storehouse_name, orgid).Count(&total).Error
|
|
63
|
+ if total > 0 {
|
|
64
|
+ tmp = true //有重复的
|
|
65
|
+ } else {
|
|
66
|
+ tmp = false
|
|
67
|
+ }
|
|
68
|
+ return tmp, err
|
|
69
|
+}
|
|
70
|
+
|
|
71
|
+//查询仓库地址是否重复
|
|
72
|
+func IsStorehouseAddress(orgid int64, storehouse_address string) (bool, error) {
|
|
73
|
+ var total int
|
|
74
|
+ var tmp bool
|
|
75
|
+ err := XTReadDB().Model(&models.Storehouse{}).Where("storehouse_address = ? and user_org_id = ? and status = 1", storehouse_address, orgid).Count(&total).Error
|
|
76
|
+ if total > 0 {
|
|
77
|
+ tmp = true //有重复的
|
|
78
|
+ } else {
|
|
79
|
+ tmp = false
|
|
80
|
+ }
|
|
81
|
+ return tmp, err
|
|
82
|
+}
|
|
83
|
+
|
|
84
|
+//新增仓库
|
|
85
|
+func AddStroehouse(storehouse models.Storehouse) error {
|
|
86
|
+ tx := XTWriteDB().Begin()
|
|
87
|
+ defer func() {
|
|
88
|
+ if err != nil {
|
|
89
|
+ tx.Rollback()
|
|
90
|
+ } else {
|
|
91
|
+ tx.Commit()
|
|
92
|
+ }
|
|
93
|
+ }()
|
|
94
|
+ //创建仓库
|
|
95
|
+ err := tx.Create(&storehouse).Error
|
|
96
|
+ if err != nil {
|
|
97
|
+ return err
|
|
98
|
+ }
|
|
99
|
+ var id models.Storehouse
|
|
100
|
+ //获取创建仓库的id
|
|
101
|
+ err = tx.Model(&models.Storehouse{}).Select("id").Where("status = 1 and user_org_id = ?", storehouse.UserOrgId).Order("id desc").First(&id).Error
|
|
102
|
+ if err != nil {
|
|
103
|
+ return err
|
|
104
|
+ }
|
|
105
|
+ //判断是否存在仓库配置
|
|
106
|
+ boolean := IsStorehouseconfigXT(storehouse.UserOrgId, tx)
|
|
107
|
+ if boolean == false {
|
|
108
|
+ //创建仓库配置
|
|
109
|
+ err = CreateStorehouseConfigXT(storehouse.UserOrgId, id.ID, tx)
|
|
110
|
+ } else {
|
|
111
|
+ utils.ErrorLog("仓库配置已存在")
|
|
112
|
+ }
|
|
113
|
+
|
|
114
|
+ return err
|
|
115
|
+}
|
|
116
|
+
|
|
117
|
+//修改仓库
|
|
118
|
+func UpdateStroehouse(storehouse models.Storehouse) error {
|
|
119
|
+ err := XTWriteDB().Model(&models.Storehouse{}).Where("id = ? and status = 1", storehouse.ID).Updates(
|
|
120
|
+ map[string]interface{}{
|
|
121
|
+ "storehouse_name": storehouse.StorehouseName,
|
|
122
|
+ "storehouse_address": storehouse.StorehouseAddress,
|
|
123
|
+ "storehouse_status": storehouse.StorehouseStatus,
|
|
124
|
+ "mtime": storehouse.Mtime,
|
|
125
|
+ }).Error
|
|
126
|
+ return err
|
|
127
|
+}
|
|
128
|
+
|
|
129
|
+//查询一条仓库的信息
|
|
130
|
+func GetOneStorehouse(id, orgid int64) (storehouse models.Storehouse, err error) {
|
|
131
|
+ err = XTReadDB().Model(&models.Storehouse{}).Where("id = ? and user_org_id = ?", id, orgid).Find(&storehouse).Error
|
|
132
|
+ return
|
|
133
|
+}
|
|
134
|
+
|
|
135
|
+//分页
|
|
136
|
+func StorehouseList(page, limit, orgid int64, keyword string) (storehouse []models.Storehouse, total int64, err error) {
|
|
137
|
+ db := XTReadDB().Model(&storehouse).Where("status = 1 and user_org_id = ?", orgid)
|
|
138
|
+ offset := (page - 1) * limit
|
|
139
|
+ if len(keyword) > 0 {
|
|
140
|
+ keyword = "%" + keyword + "%"
|
|
141
|
+ db = db.Where("storehouse_code like ? or storehouse_name like ? or storehouse_address like ? or storehouse_admin_name like ?", keyword, keyword, keyword, keyword)
|
|
142
|
+ }
|
|
143
|
+ err = db.Count(&total).Offset(offset).Order("id").Limit(limit).Find(&storehouse).Error
|
|
144
|
+ return storehouse, total, err
|
|
145
|
+}
|
|
146
|
+
|
|
147
|
+//获取当前机构所有可用的仓库名字
|
|
148
|
+func GetAllStorehouseName(orgid int64) (storehouse []models.Storehouse, err error) {
|
|
149
|
+ err = XTReadDB().Model(&models.Storehouse{}).Where("storehouse_status = 1 and status = 1 and user_org_id = ?", orgid).Find(&storehouse).Error
|
|
150
|
+ return
|
|
151
|
+}
|
|
152
|
+
|
|
153
|
+//根据机构id,生成一个默认仓库
|
|
154
|
+func GetDefaultStorehouse(orgid int64) error {
|
|
155
|
+ var code string
|
|
156
|
+ for a := true; a == true; {
|
|
157
|
+ code = CreateCode()
|
|
158
|
+ tmp := FindStorehouseCode(orgid, code)
|
|
159
|
+ //如果没有重复的编码结束循环
|
|
160
|
+ if tmp == false {
|
|
161
|
+ a = false
|
|
162
|
+ }
|
|
163
|
+ }
|
|
164
|
+ storehouse := models.Storehouse{
|
|
165
|
+ StorehouseCode: code,
|
|
166
|
+ StorehouseName: "默认仓库",
|
|
167
|
+ StorehouseAddress: "",
|
|
168
|
+ StorehouseStatus: 1,
|
|
169
|
+ UserOrgId: orgid,
|
|
170
|
+ StorehouseAdminName: "admin",
|
|
171
|
+ Status: 1,
|
|
172
|
+ Ctime: time.Now().Unix(),
|
|
173
|
+ }
|
|
174
|
+ err := AddStroehouse(storehouse)
|
|
175
|
+ return err
|
|
176
|
+}
|
|
177
|
+
|
|
178
|
+//查找该机构id是否有仓库存在,ture存在,false不存在
|
|
179
|
+func IsStorehouse(orgid int64) bool {
|
|
180
|
+ var total int
|
|
181
|
+ XTReadDB().Model(&models.Storehouse{}).Where("user_org_id = ?", orgid).Count(&total)
|
|
182
|
+ if total > 0 {
|
|
183
|
+ return true
|
|
184
|
+ } else {
|
|
185
|
+ return false
|
|
186
|
+ }
|
|
187
|
+}
|
|
188
|
+
|
|
189
|
+//查找该机构id是否有仓库配置存在,ture存在,false不存在
|
|
190
|
+func IsStorehouseconfigXT(orgid int64, tx *gorm.DB) bool {
|
|
191
|
+ var total int
|
|
192
|
+ tx.Model(&models.StorehouseConfig{}).Where("user_org_id = ? and status = 1", orgid).Count(&total)
|
|
193
|
+ if total > 0 {
|
|
194
|
+ return true
|
|
195
|
+ } else {
|
|
196
|
+ return false
|
|
197
|
+ }
|
|
198
|
+}
|
|
199
|
+
|
|
200
|
+// 根据机构id查询仓库配置
|
|
201
|
+//storehouse_info:耗材 自动入库 的仓库id
|
|
202
|
+//storehouse_out_info:耗材 自动出库 的仓库id
|
|
203
|
+//drug_storehouse_info:药品 自动入库 的仓库id
|
|
204
|
+//drug_storehouse_out:药品 自动出库 的仓库id
|
|
205
|
+func FindStorehouseConfig(orgid int64) (storehouse_config models.StorehouseConfig, err error) {
|
|
206
|
+ err = XTReadDB().Model(&models.StorehouseConfig{}).Where("status = 1 and user_org_id = ?", orgid).Find(&storehouse_config).Error
|
|
207
|
+ return
|
|
208
|
+}
|
|
209
|
+
|
|
210
|
+//根据机构id,仓库id新建一个仓库配置
|
|
211
|
+func CreateStorehouseConfig(orgid, id int64) (err error) {
|
|
212
|
+ storeconfig := models.StorehouseConfig{
|
|
213
|
+ UserOrgId: orgid,
|
|
214
|
+ StorehouseInfo: id,
|
|
215
|
+ StorehouseOutInfo: id,
|
|
216
|
+ DrugStorehouseInfo: id,
|
|
217
|
+ DrugStorehouseOut: id,
|
|
218
|
+ Status: 1,
|
|
219
|
+ Ctime: time.Now().Unix(),
|
|
220
|
+ }
|
|
221
|
+ err = XTWriteDB().Create(&storeconfig).Error
|
|
222
|
+ return
|
|
223
|
+}
|
|
224
|
+
|
|
225
|
+//根据机构id,仓库id新建一个仓库配置,带事务
|
|
226
|
+func CreateStorehouseConfigXT(orgid, id int64, tx *gorm.DB) (err error) {
|
|
227
|
+ storeconfig := models.StorehouseConfig{
|
|
228
|
+ UserOrgId: orgid,
|
|
229
|
+ StorehouseInfo: id,
|
|
230
|
+ StorehouseOutInfo: id,
|
|
231
|
+ DrugStorehouseInfo: id,
|
|
232
|
+ DrugStorehouseOut: id,
|
|
233
|
+ Status: 1,
|
|
234
|
+ Ctime: time.Now().Unix(),
|
|
235
|
+ }
|
|
236
|
+ err = tx.Create(&storeconfig).Error
|
|
237
|
+ return
|
|
238
|
+}
|
|
239
|
+
|
|
240
|
+//更改耗材自动入库仓库
|
|
241
|
+func UpdateInfo(orgid, id int64) (err error) {
|
|
242
|
+ mtime := time.Now().Unix()
|
|
243
|
+ err = XTWriteDB().Model(&models.StorehouseConfig{}).Where("user_org_id = ? and status = 1", orgid).Updates(map[string]interface{}{"storehouse_info": id, "mtime": mtime}).Error
|
|
244
|
+ return
|
|
245
|
+}
|
|
246
|
+
|
|
247
|
+//更改耗材自动出库仓库
|
|
248
|
+func UpdateOutInfo(orgid, id int64) (err error) {
|
|
249
|
+ mtime := time.Now().Unix()
|
|
250
|
+ err = XTWriteDB().Model(&models.StorehouseConfig{}).Where("user_org_id = ? and status = 1", orgid).Updates(map[string]interface{}{"storehouse_out_info": id, "mtime": mtime}).Error
|
|
251
|
+ return
|
|
252
|
+}
|
|
253
|
+
|
|
254
|
+//更改药品自动入库仓库
|
|
255
|
+func UpdateDrugInfo2(orgid, id int64) (err error) {
|
|
256
|
+ mtime := time.Now().Unix()
|
|
257
|
+ err = XTWriteDB().Model(&models.StorehouseConfig{}).Where("user_org_id = ? and status = 1", orgid).Updates(map[string]interface{}{"drug_storehouse_info": id, "mtime": mtime}).Error
|
|
258
|
+ return
|
|
259
|
+}
|
|
260
|
+
|
|
261
|
+//更改药品自动出库仓库
|
|
262
|
+func UpdateDrugOut(orgid, id int64) (err error) {
|
|
263
|
+ mtime := time.Now().Unix()
|
|
264
|
+ err = XTWriteDB().Model(&models.StorehouseConfig{}).Where("user_org_id = ? and status = 1", orgid).Updates(map[string]interface{}{"drug_storehouse_out": id, "mtime": mtime}).Error
|
|
265
|
+ return
|
|
266
|
+}
|
|
267
|
+
|
|
268
|
+//根据id查询仓库名称
|
|
269
|
+func FindStorehouseName(id int64) (storehouse models.Storehouse, err error) {
|
|
270
|
+ err = XTReadDB().Model(&models.Storehouse{}).Where("id = ?", id).Find(&storehouse).Error
|
|
271
|
+ return
|
|
272
|
+}
|
|
273
|
+
|
|
274
|
+//判断该仓库是否在仓库配置表中
|
|
275
|
+func IsInConfig(orgid, id int64) bool {
|
|
276
|
+ var total int
|
|
277
|
+ XTReadDB().Model(&models.StorehouseConfig{}).Where("user_org_id = ? and status = 1", orgid).Where(
|
|
278
|
+ "storehouse_info = ? or storehouse_out_info = ? or drug_storehouse_info = ? or drug_storehouse_out = ?", id, id, id, id).Count(&total)
|
|
279
|
+ if total > 0 {
|
|
280
|
+ return true //存在
|
|
281
|
+ } else {
|
|
282
|
+ return false
|
|
283
|
+ }
|
|
284
|
+}
|
|
285
|
+
|
|
286
|
+//兼容旧数据
|
|
287
|
+func Byliinit() (err error) {
|
|
288
|
+ tx := XTWriteDB().Begin()
|
|
289
|
+ defer func() {
|
|
290
|
+ if err != nil && err.Error() != "record not found" {
|
|
291
|
+ tx.Rollback()
|
|
292
|
+ } else {
|
|
293
|
+ tx.Commit()
|
|
294
|
+ }
|
|
295
|
+ }()
|
|
296
|
+ err = StoreReduceOrg(tx)
|
|
297
|
+ if err != nil && err.Error() != "record not found" {
|
|
298
|
+ return
|
|
299
|
+ }
|
|
300
|
+ err = StoreReduceConfig(tx)
|
|
301
|
+ if err != nil && err.Error() != "record not found" {
|
|
302
|
+ return
|
|
303
|
+ }
|
|
304
|
+ err = initxt_stock_flow(tx)
|
|
305
|
+ if err != nil && err.Error() != "record not found" {
|
|
306
|
+ return
|
|
307
|
+ }
|
|
308
|
+ err = initxt_drug_flow(tx)
|
|
309
|
+ if err != nil && err.Error() != "record not found" {
|
|
310
|
+ return
|
|
311
|
+ }
|
|
312
|
+ err = initdialysis_before_prepare(tx)
|
|
313
|
+ if err != nil && err.Error() != "record not found" {
|
|
314
|
+ return
|
|
315
|
+ }
|
|
316
|
+ err = initxt_automatic_reduce_detail(tx)
|
|
317
|
+ if err != nil && err.Error() != "record not found" {
|
|
318
|
+ return
|
|
319
|
+ }
|
|
320
|
+ err = initxt_drug_automatic_reduce_detail(tx)
|
|
321
|
+ if err != nil && err.Error() != "record not found" {
|
|
322
|
+ return
|
|
323
|
+ }
|
|
324
|
+ err = initxt_warehouse(tx)
|
|
325
|
+ if err != nil && err.Error() != "record not found" {
|
|
326
|
+ return
|
|
327
|
+ }
|
|
328
|
+ err = initxt_warehouse_info(tx)
|
|
329
|
+ if err != nil && err.Error() != "record not found" {
|
|
330
|
+ return
|
|
331
|
+ }
|
|
332
|
+ err = initxt_warehouse_out(tx)
|
|
333
|
+ if err != nil && err.Error() != "record not found" {
|
|
334
|
+ return
|
|
335
|
+ }
|
|
336
|
+ err = initxt_warehouse_out_info(tx)
|
|
337
|
+ if err != nil && err.Error() != "record not found" {
|
|
338
|
+ return
|
|
339
|
+ }
|
|
340
|
+ err = initxt_drug_warehouse(tx)
|
|
341
|
+ if err != nil && err.Error() != "record not found" {
|
|
342
|
+ return
|
|
343
|
+ }
|
|
344
|
+ err = initxt_drug_warehouse_info(tx)
|
|
345
|
+ if err != nil && err.Error() != "record not found" {
|
|
346
|
+ return
|
|
347
|
+ }
|
|
348
|
+ err = initxt_drug_warehouse_out(tx)
|
|
349
|
+ if err != nil && err.Error() != "record not found" {
|
|
350
|
+ return
|
|
351
|
+ }
|
|
352
|
+ err = initxt_drug_warehouse_out_info(tx)
|
|
353
|
+ if err != nil && err.Error() != "record not found" {
|
|
354
|
+ return
|
|
355
|
+ }
|
|
356
|
+ err = initxt_cancel_stock(tx)
|
|
357
|
+ if err != nil && err.Error() != "record not found" {
|
|
358
|
+ return
|
|
359
|
+ }
|
|
360
|
+ err = initxt_cancel_stock_info(tx)
|
|
361
|
+ if err != nil && err.Error() != "record not found" {
|
|
362
|
+ return
|
|
363
|
+ }
|
|
364
|
+ err = initxt_drug_cancel_stock(tx)
|
|
365
|
+ if err != nil && err.Error() != "record not found" {
|
|
366
|
+ return
|
|
367
|
+ }
|
|
368
|
+ err = initxt_drug_cancel_stock_info(tx)
|
|
369
|
+ if err != nil && err.Error() != "record not found" {
|
|
370
|
+ return
|
|
371
|
+ }
|
|
372
|
+ err = initxt_supplier_warehouse_info(tx)
|
|
373
|
+ if err != nil && err.Error() != "record not found" {
|
|
374
|
+ return
|
|
375
|
+ }
|
|
376
|
+ err = initxt_supplier_warehousing_info_order(tx)
|
|
377
|
+ if err != nil && err.Error() != "record not found" {
|
|
378
|
+ return
|
|
379
|
+ }
|
|
380
|
+ err = initxt_supplier_warehouse_out(tx)
|
|
381
|
+ if err != nil && err.Error() != "record not found" {
|
|
382
|
+ return
|
|
383
|
+ }
|
|
384
|
+ err = initxt_supplier_warehousing_out_order(tx)
|
|
385
|
+ if err != nil && err.Error() != "record not found" {
|
|
386
|
+ return
|
|
387
|
+ }
|
|
388
|
+ err = initxt_supplier_warehouse_cancel(tx)
|
|
389
|
+ if err != nil && err.Error() != "record not found" {
|
|
390
|
+ return
|
|
391
|
+ }
|
|
392
|
+ err = initxt_supplier_warehousing_cancel_order(tx)
|
|
393
|
+
|
|
394
|
+ return
|
|
395
|
+}
|
|
396
|
+
|
|
397
|
+//根据xt_gobal_template 获取的机构id减去仓库表存在的机构id,把结果插入到仓库表
|
|
398
|
+func StoreReduceOrg(tx *gorm.DB) (err error) {
|
|
399
|
+ err = tx.Exec("INSERT INTO sgj_xt.xt_storehouse(storehouse_code,storehouse_name,user_org_id,ctime)" +
|
|
400
|
+ "SELECT CONCAT(\"sh-\",FLOOR(RAND()*9000+1000)),\"默认仓库\",tmp.id,UNIX_TIMESTAMP()" +
|
|
401
|
+ "FROM" +
|
|
402
|
+ "(select t1.org_id as id FROM sgj_xt.xt_gobal_template as t1 LEFT JOIN " +
|
|
403
|
+ "(SELECT distinct user_org_id as i FROM sgj_xt.xt_storehouse) as t2 on t1.org_id = t2.i WHERE t2.i is null and t1.status = 1)tmp").Error
|
|
404
|
+ //err = tx.Exec("INSERT INTO sgj_xt.xt_storehouse(storehouse_code,storehouse_name,user_org_id,ctime)" +
|
|
405
|
+ // "SELECT CONCAT(\"sh-\",FLOOR(RAND()*9000+1000)),\"默认仓库\",tmp.id,UNIX_TIMESTAMP()" +
|
|
406
|
+ // "FROM" +
|
|
407
|
+ // "(select t1.id FROM sgj_users.sgj_user_org as t1 LEFT JOIN " +
|
|
408
|
+ // "(SELECT distinct user_org_id as i FROM sgj_xt.xt_storehouse) as t2 on t1.id = t2.i WHERE t2.i is null and t1.status != 0 and t1.import = 0)tmp").Error
|
|
409
|
+ return
|
|
410
|
+}
|
|
411
|
+
|
|
412
|
+//查找仓库表的orgid 减去仓库配置表的orgid,把结果插入到仓库配置表
|
|
413
|
+func StoreReduceConfig(tx *gorm.DB) (err error) {
|
|
414
|
+ err = tx.Exec("INSERT INTO sgj_xt.xt_storehouse_config(user_org_id,storehouse_info,storehouse_out_info,drug_storehouse_info,drug_storehouse_out,ctime)" +
|
|
415
|
+ "SELECT tmp.user_org_id,tmp.id,tmp.id,tmp.id,tmp.id,UNIX_TIMESTAMP()" +
|
|
416
|
+ "FROM(select t1.id,t1.user_org_id FROM sgj_xt.xt_storehouse as t1 LEFT JOIN " +
|
|
417
|
+ "(SELECT user_org_id as i FROM sgj_xt.xt_storehouse_config) as t2 on t1.user_org_id = t2.i WHERE t2.i is null and t1.status = 1)tmp").Error
|
|
418
|
+ return
|
|
419
|
+}
|
|
420
|
+
|
|
421
|
+//初始化 xt_stock_flow(完成)
|
|
422
|
+func initxt_stock_flow(tx *gorm.DB) (err error) {
|
|
423
|
+ err = tx.Exec("UPDATE sgj_xt.xt_stock_flow as t," +
|
|
424
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
425
|
+ "(SELECT distinct user_org_id as orgid FROM sgj_xt.xt_stock_flow WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
426
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
427
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
428
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.user_org_id = tmp.orgid").Error
|
|
429
|
+ return
|
|
430
|
+}
|
|
431
|
+
|
|
432
|
+//初始化 xt_drug_flow(完成)
|
|
433
|
+func initxt_drug_flow(tx *gorm.DB) (err error) {
|
|
434
|
+ err = tx.Exec("UPDATE sgj_xt.xt_drug_flow as t," +
|
|
435
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
436
|
+ "(SELECT distinct user_org_id as orgid FROM sgj_xt.xt_drug_flow WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
437
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
438
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
439
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.user_org_id = tmp.orgid").Error
|
|
440
|
+ return
|
|
441
|
+}
|
|
442
|
+
|
|
443
|
+//初始化 dialysis_before_prepare(完成)
|
|
444
|
+func initdialysis_before_prepare(tx *gorm.DB) (err error) {
|
|
445
|
+ err = tx.Exec("UPDATE sgj_xt.dialysis_before_prepare as t," +
|
|
446
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
447
|
+ "(SELECT distinct user_org_id as orgid FROM sgj_xt.dialysis_before_prepare WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
448
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
449
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
450
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.user_org_id = tmp.orgid").Error
|
|
451
|
+ return
|
|
452
|
+}
|
|
453
|
+
|
|
454
|
+//初始化 xt_automatic_reduce_detail(完成)
|
|
455
|
+func initxt_automatic_reduce_detail(tx *gorm.DB) (err error) {
|
|
456
|
+ err = tx.Exec("UPDATE sgj_xt.xt_automatic_reduce_detail as t," +
|
|
457
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_out_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
458
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_automatic_reduce_detail WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
459
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
460
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
461
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
462
|
+ return
|
|
463
|
+}
|
|
464
|
+
|
|
465
|
+//初始化 xt_drug_automatic_reduce_detail(完成)
|
|
466
|
+func initxt_drug_automatic_reduce_detail(tx *gorm.DB) (err error) {
|
|
467
|
+ err = tx.Exec("UPDATE sgj_xt.xt_drug_automatic_reduce_detail as t," +
|
|
468
|
+ "(SELECT t1.user_org_id as orgid,t1.drug_storehouse_out as id from sgj_xt.xt_storehouse_config as t1," +
|
|
469
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_drug_automatic_reduce_detail WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
470
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
471
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
472
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
473
|
+ return
|
|
474
|
+}
|
|
475
|
+
|
|
476
|
+//初始化 xt_warehouse(完成)
|
|
477
|
+func initxt_warehouse(tx *gorm.DB) (err error) {
|
|
478
|
+ err = tx.Exec("UPDATE sgj_xt.xt_warehouse as t," +
|
|
479
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
480
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_warehouse WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
481
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
482
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
483
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
484
|
+ return
|
|
485
|
+}
|
|
486
|
+
|
|
487
|
+//初始化 xt_warehouse_info(完成)
|
|
488
|
+func initxt_warehouse_info(tx *gorm.DB) (err error) {
|
|
489
|
+ err = tx.Exec("UPDATE sgj_xt.xt_warehouse_info as t," +
|
|
490
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
491
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_warehouse_info WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
492
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
493
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
494
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
495
|
+ return
|
|
496
|
+}
|
|
497
|
+
|
|
498
|
+//初始化 xt_warehouse_out(完成)
|
|
499
|
+func initxt_warehouse_out(tx *gorm.DB) (err error) {
|
|
500
|
+ err = tx.Exec("UPDATE sgj_xt.xt_warehouse_out as t," +
|
|
501
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_out_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
502
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_warehouse_out WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
503
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
504
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
505
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
506
|
+ return
|
|
507
|
+}
|
|
508
|
+
|
|
509
|
+//初始化 xt_warehouse_out_info(完成)
|
|
510
|
+func initxt_warehouse_out_info(tx *gorm.DB) (err error) {
|
|
511
|
+ err = tx.Exec("UPDATE sgj_xt.xt_warehouse_out_info as t," +
|
|
512
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_out_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
513
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_warehouse_out_info WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
514
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
515
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
516
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
517
|
+ return
|
|
518
|
+}
|
|
519
|
+
|
|
520
|
+//初始化 xt_drug_warehouse(完成)
|
|
521
|
+func initxt_drug_warehouse(tx *gorm.DB) (err error) {
|
|
522
|
+ err = tx.Exec("UPDATE sgj_xt.xt_drug_warehouse as t," +
|
|
523
|
+ "(SELECT t1.user_org_id as orgid,t1.drug_storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
524
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_drug_warehouse WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
525
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
526
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
527
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
528
|
+ return
|
|
529
|
+}
|
|
530
|
+
|
|
531
|
+//初始化 xt_drug_warehouse_info(完成)
|
|
532
|
+func initxt_drug_warehouse_info(tx *gorm.DB) (err error) {
|
|
533
|
+ err = tx.Exec("UPDATE sgj_xt.xt_drug_warehouse_info as t," +
|
|
534
|
+ "(SELECT t1.user_org_id as orgid,t1.drug_storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
535
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_drug_warehouse_info WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
536
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
537
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
538
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
539
|
+ return
|
|
540
|
+}
|
|
541
|
+
|
|
542
|
+//初始化 xt_drug_warehouse_out(完成)
|
|
543
|
+func initxt_drug_warehouse_out(tx *gorm.DB) (err error) {
|
|
544
|
+ err = tx.Exec("UPDATE sgj_xt.xt_drug_warehouse_out as t," +
|
|
545
|
+ "(SELECT t1.user_org_id as orgid,t1.drug_storehouse_out as id from sgj_xt.xt_storehouse_config as t1," +
|
|
546
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_drug_warehouse_out WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
547
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
548
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
549
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
550
|
+ return
|
|
551
|
+}
|
|
552
|
+
|
|
553
|
+//初始化 xt_drug_warehouse_out_info(完成)
|
|
554
|
+func initxt_drug_warehouse_out_info(tx *gorm.DB) (err error) {
|
|
555
|
+ err = tx.Exec("UPDATE sgj_xt.xt_drug_warehouse_out_info as t," +
|
|
556
|
+ "(SELECT t1.user_org_id as orgid,t1.drug_storehouse_out as id from sgj_xt.xt_storehouse_config as t1," +
|
|
557
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_drug_warehouse_out_info WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
558
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
559
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
560
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
561
|
+ return
|
|
562
|
+}
|
|
563
|
+
|
|
564
|
+//初始化 xt_cancel_stock(完成)
|
|
565
|
+func initxt_cancel_stock(tx *gorm.DB) (err error) {
|
|
566
|
+ err = tx.Exec("UPDATE sgj_xt.xt_cancel_stock as t," +
|
|
567
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_out_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
568
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_cancel_stock WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
569
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
570
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
571
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
572
|
+ return
|
|
573
|
+}
|
|
574
|
+
|
|
575
|
+//初始化 xt_cancel_stock_info(完成)
|
|
576
|
+func initxt_cancel_stock_info(tx *gorm.DB) (err error) {
|
|
577
|
+ err = tx.Exec("UPDATE sgj_xt.xt_cancel_stock_info as t," +
|
|
578
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_out_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
579
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_cancel_stock_info WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
580
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
581
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
582
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
583
|
+ return
|
|
584
|
+}
|
|
585
|
+
|
|
586
|
+//初始化 xt_drug_cancel_stock(完成)
|
|
587
|
+func initxt_drug_cancel_stock(tx *gorm.DB) (err error) {
|
|
588
|
+ err = tx.Exec("UPDATE sgj_xt.xt_drug_cancel_stock as t," +
|
|
589
|
+ "(SELECT t1.user_org_id as orgid,t1.drug_storehouse_out as id from sgj_xt.xt_storehouse_config as t1," +
|
|
590
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_drug_cancel_stock WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
591
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
592
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
593
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
594
|
+ return
|
|
595
|
+}
|
|
596
|
+
|
|
597
|
+//初始化 xt_drug_cancel_stock_info(完成)
|
|
598
|
+func initxt_drug_cancel_stock_info(tx *gorm.DB) (err error) {
|
|
599
|
+ err = tx.Exec("UPDATE sgj_xt.xt_drug_cancel_stock_info as t," +
|
|
600
|
+ "(SELECT t1.user_org_id as orgid,t1.drug_storehouse_out as id from sgj_xt.xt_storehouse_config as t1," +
|
|
601
|
+ "(SELECT distinct org_id as orgid FROM sgj_xt.xt_drug_cancel_stock_info WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
602
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
603
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
604
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.org_id = tmp.orgid").Error
|
|
605
|
+ return
|
|
606
|
+}
|
|
607
|
+
|
|
608
|
+//初始化 xt_supplier_warehouse_info(完成)
|
|
609
|
+func initxt_supplier_warehouse_info(tx *gorm.DB) (err error) {
|
|
610
|
+ err = tx.Exec("UPDATE sgj_xt.xt_supplier_warehouse_info as t," +
|
|
611
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
612
|
+ "(SELECT distinct user_org_id as orgid FROM sgj_xt.xt_supplier_warehouse_info WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
613
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
614
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
615
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.user_org_id = tmp.orgid").Error
|
|
616
|
+ return
|
|
617
|
+}
|
|
618
|
+
|
|
619
|
+//初始化 xt_supplier_warehousing_info_order(完成)
|
|
620
|
+func initxt_supplier_warehousing_info_order(tx *gorm.DB) (err error) {
|
|
621
|
+ err = tx.Exec("UPDATE sgj_xt.xt_supplier_warehousing_info_order as t," +
|
|
622
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
623
|
+ "(SELECT distinct user_org_id as orgid FROM sgj_xt.xt_supplier_warehousing_info_order WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
624
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
625
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
626
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.user_org_id = tmp.orgid").Error
|
|
627
|
+ return
|
|
628
|
+}
|
|
629
|
+
|
|
630
|
+//初始化 xt_supplier_warehouse_out(完成)
|
|
631
|
+func initxt_supplier_warehouse_out(tx *gorm.DB) (err error) {
|
|
632
|
+ err = tx.Exec("UPDATE sgj_xt.xt_supplier_warehouse_out as t," +
|
|
633
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_out_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
634
|
+ "(SELECT distinct user_org_id as orgid FROM sgj_xt.xt_supplier_warehouse_out WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
635
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
636
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
637
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.user_org_id = tmp.orgid").Error
|
|
638
|
+ return
|
|
639
|
+}
|
|
640
|
+
|
|
641
|
+//初始化 xt_supplier_warehousing_out_order(完成)
|
|
642
|
+func initxt_supplier_warehousing_out_order(tx *gorm.DB) (err error) {
|
|
643
|
+ err = tx.Exec("UPDATE sgj_xt.xt_supplier_warehousing_out_order as t," +
|
|
644
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
645
|
+ "(SELECT distinct user_org_id as orgid FROM sgj_xt.xt_supplier_warehousing_out_order WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
646
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
647
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
648
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.user_org_id = tmp.orgid").Error
|
|
649
|
+ return
|
|
650
|
+}
|
|
651
|
+
|
|
652
|
+//初始化 xt_supplier_warehouse_cancel(完成)
|
|
653
|
+func initxt_supplier_warehouse_cancel(tx *gorm.DB) (err error) {
|
|
654
|
+ err = tx.Exec("UPDATE sgj_xt.xt_supplier_warehouse_cancel as t," +
|
|
655
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
656
|
+ "(SELECT distinct user_org_id as orgid FROM sgj_xt.xt_supplier_warehouse_cancel WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
657
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
658
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
659
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.user_org_id = tmp.orgid").Error
|
|
660
|
+ return
|
|
661
|
+}
|
|
662
|
+
|
|
663
|
+//初始化 xt_supplier_warehousing_cancel_order(完成)
|
|
664
|
+func initxt_supplier_warehousing_cancel_order(tx *gorm.DB) (err error) {
|
|
665
|
+ err = tx.Exec("UPDATE sgj_xt.xt_supplier_warehousing_cancel_order as t," +
|
|
666
|
+ "(SELECT t1.user_org_id as orgid,t1.storehouse_info as id from sgj_xt.xt_storehouse_config as t1," +
|
|
667
|
+ "(SELECT distinct user_org_id as orgid FROM sgj_xt.xt_supplier_warehousing_cancel_order WHERE storehouse_id is NULL or storehouse_id = 0 )t2 " +
|
|
668
|
+ "WHERE t1.user_org_id = t2.orgid)tmp " +
|
|
669
|
+ "SET t.storehouse_id = tmp.id,t.mtime = UNIX_TIMESTAMP()" +
|
|
670
|
+ "WHERE (t.storehouse_id = 0 or t.storehouse_id is null) and t.user_org_id = tmp.orgid").Error
|
|
671
|
+ return
|
5
|
672
|
}
|