|
@@ -163,281 +163,276 @@ func (this *PublicApiController) GetJson() {
|
163
|
163
|
}
|
164
|
164
|
|
165
|
165
|
func (c *PublicApiController) HandleData() {
|
166
|
|
- //org_app, _ := service.GetAllAppOrg()
|
|
166
|
+ org_app, _ := service.GetAllAppOrg()
|
167
|
167
|
org_role, _ := service.GetAllRole()
|
168
|
168
|
|
169
|
169
|
var org_ids []int64
|
170
|
170
|
|
171
|
|
- //for _, apps := range org_app {
|
172
|
|
- // xt_org_app, _ := service.GetAppByType(int64(apps.OrgId), 3)
|
173
|
|
- // scrm_org_app, _ := service.GetAppByType(int64(apps.OrgId), 1)
|
174
|
|
- // cdm_org_app, _ := service.GetAppByType(int64(apps.OrgId), 4)
|
175
|
|
- // mall_org_app, _ := service.GetAppByType(int64(apps.OrgId), 5)
|
176
|
|
- // org_app_6, _ := service.GetAppByType(int64(apps.OrgId), 6)
|
177
|
|
- // org_app_7, _ := service.GetAppByType(int64(apps.OrgId), 7)
|
178
|
|
- // org_app_8, _ := service.GetAppByType(int64(apps.OrgId), 8)
|
179
|
|
- // org_app_9, _ := service.GetAppByType(int64(apps.OrgId), 9)
|
180
|
|
- // org_app_10, _ := service.GetAppByType(int64(apps.OrgId), 10)
|
181
|
|
- // org_app_11, _ := service.GetAppByType(int64(apps.OrgId), 11)
|
182
|
|
- // org_app_12, _ := service.GetAppByType(int64(apps.OrgId), 12)
|
183
|
|
- // org_app_13, _ := service.GetAppByType(int64(apps.OrgId), 13)
|
184
|
|
- // org_app_14, _ := service.GetAppByType(int64(apps.OrgId), 14)
|
185
|
|
- // org_app_15, _ := service.GetAppByType(int64(apps.OrgId), 15)
|
186
|
|
- //
|
187
|
|
- // var xt_temp_org_app *models.OrgApp
|
188
|
|
- // var mall_temp_org_app *models.OrgApp
|
189
|
|
- //
|
190
|
|
- //
|
191
|
|
- // if xt_org_app == nil || xt_org_app.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
192
|
|
- //
|
193
|
|
- // app, _ := service.GetOrgApp(0,3)
|
194
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
195
|
|
- //
|
196
|
|
- // app.Id = 0
|
197
|
|
- // app.OrgId = apps.OrgId
|
198
|
|
- // app.Creator = int(org.Creator)
|
199
|
|
- // app.Number = 0
|
200
|
|
- // app.Status = 1
|
201
|
|
- // app.ModifyTime = time.Now().Unix()
|
202
|
|
- // app.CreateTime = time.Now().Unix()
|
203
|
|
- // service.CreateOrgApp(app)
|
204
|
|
- // xt_temp_org_app = app
|
205
|
|
- // }else{
|
206
|
|
- //
|
207
|
|
- // xt_temp_org_app = xt_org_app
|
208
|
|
- //
|
209
|
|
- // }
|
210
|
|
- //
|
211
|
|
- // if scrm_org_app == nil || scrm_org_app.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
212
|
|
- //
|
213
|
|
- // app, _ := service.GetOrgApp(0,1)
|
214
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
215
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
216
|
|
- //
|
217
|
|
- // app.OrgId = apps.OrgId
|
218
|
|
- // app.Id = 0
|
219
|
|
- //
|
220
|
|
- // app.Creator = int(org.Creator)
|
221
|
|
- // app.Number = 0
|
222
|
|
- // app.Status = 1
|
223
|
|
- // app.ModifyTime = time.Now().Unix()
|
224
|
|
- // app.CreateTime = time.Now().Unix()
|
225
|
|
- // service.CreateOrgApp(app)
|
226
|
|
- //
|
227
|
|
- // }
|
228
|
|
- //
|
229
|
|
- // if cdm_org_app == nil || cdm_org_app.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
230
|
|
- // app, _ := service.GetOrgApp(0,4)
|
231
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
232
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
233
|
|
- //
|
234
|
|
- // app.OrgId = apps.OrgId
|
235
|
|
- // app.Creator = int(org.Creator)
|
236
|
|
- // app.Number = 0
|
237
|
|
- // app.Id = 0
|
238
|
|
- //
|
239
|
|
- // app.Status = 1
|
240
|
|
- // app.ModifyTime = time.Now().Unix()
|
241
|
|
- // app.CreateTime = time.Now().Unix()
|
242
|
|
- // service.CreateOrgApp(app)
|
243
|
|
- // }
|
244
|
|
- //
|
245
|
|
- // if mall_org_app == nil || mall_org_app.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
246
|
|
- // app, _ := service.GetOrgApp(0,5)
|
247
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
248
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
249
|
|
- //
|
250
|
|
- // app.OrgId = apps.OrgId
|
251
|
|
- // app.Creator = int(org.Creator)
|
252
|
|
- // app.Number = 0
|
253
|
|
- // app.Id = 0
|
254
|
|
- //
|
255
|
|
- // app.Status = 1
|
256
|
|
- // app.ModifyTime = time.Now().Unix()
|
257
|
|
- // app.CreateTime = time.Now().Unix()
|
258
|
|
- // service.CreateOrgApp(app)
|
259
|
|
- // mall_temp_org_app = app
|
260
|
|
- // }else{
|
261
|
|
- // mall_temp_org_app = mall_org_app
|
262
|
|
- // }
|
263
|
|
- //
|
264
|
|
- //
|
265
|
|
- //
|
266
|
|
- // if org_app_6 == nil || org_app_6.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
267
|
|
- // app, _ := service.GetOrgApp(0,6)
|
268
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
269
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
270
|
|
- //
|
271
|
|
- // app.OrgId = apps.OrgId
|
272
|
|
- // app.Creator = int(org.Creator)
|
273
|
|
- // app.Number = 0
|
274
|
|
- // app.Id = 0
|
275
|
|
- //
|
276
|
|
- // app.Status = 1
|
277
|
|
- // app.ModifyTime = time.Now().Unix()
|
278
|
|
- // app.CreateTime = time.Now().Unix()
|
279
|
|
- // app.Pid = xt_temp_org_app.Id
|
280
|
|
- // service.CreateOrgApp(app)
|
281
|
|
- //
|
282
|
|
- //
|
283
|
|
- // }
|
284
|
|
- // if org_app_7 == nil || org_app_7.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
285
|
|
- // app, _ := service.GetOrgApp(0,7)
|
286
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
287
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
288
|
|
- //
|
289
|
|
- // app.OrgId = apps.OrgId
|
290
|
|
- // app.Creator = int(org.Creator)
|
291
|
|
- // app.Number = 0
|
292
|
|
- // app.Status = 1
|
293
|
|
- // app.Id = 0
|
294
|
|
- //
|
295
|
|
- // app.ModifyTime = time.Now().Unix()
|
296
|
|
- // app.CreateTime = time.Now().Unix()
|
297
|
|
- // app.Pid = xt_temp_org_app.Id
|
298
|
|
- //
|
299
|
|
- // service.CreateOrgApp(app)
|
300
|
|
- // }
|
301
|
|
- // if org_app_8 == nil || org_app_8.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
302
|
|
- // app, _ := service.GetOrgApp(0,8)
|
303
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
304
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
305
|
|
- //
|
306
|
|
- // app.OrgId = apps.OrgId
|
307
|
|
- // app.Creator = int(org.Creator)
|
308
|
|
- // app.Number = 0
|
309
|
|
- // app.Id = 0
|
310
|
|
- //
|
311
|
|
- // app.Pid = mall_temp_org_app.Id
|
312
|
|
- //
|
313
|
|
- // app.Status = 1
|
314
|
|
- // app.ModifyTime = time.Now().Unix()
|
315
|
|
- // app.CreateTime = time.Now().Unix()
|
316
|
|
- // service.CreateOrgApp(app)
|
317
|
|
- // }
|
318
|
|
- // if org_app_9 == nil || org_app_9.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
319
|
|
- // app, _ := service.GetOrgApp(0,9)
|
320
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
321
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
322
|
|
- //
|
323
|
|
- // app.OrgId = apps.OrgId
|
324
|
|
- // app.Pid = xt_temp_org_app.Id
|
325
|
|
- //
|
326
|
|
- // app.Creator = int(org.Creator)
|
327
|
|
- // app.Number = 0
|
328
|
|
- // app.Id = 0
|
329
|
|
- //
|
330
|
|
- // app.Status = 1
|
331
|
|
- // app.ModifyTime = time.Now().Unix()
|
332
|
|
- // app.CreateTime = time.Now().Unix()
|
333
|
|
- // service.CreateOrgApp(app)
|
334
|
|
- //
|
335
|
|
- // }
|
336
|
|
- // if org_app_10 == nil || org_app_10.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
337
|
|
- // app, _ := service.GetOrgApp(0,10)
|
338
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
339
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
340
|
|
- //
|
341
|
|
- // app.OrgId = apps.OrgId
|
342
|
|
- // app.Creator = int(org.Creator)
|
343
|
|
- // app.Pid = xt_temp_org_app.Id
|
344
|
|
- //
|
345
|
|
- // app.Number = 0
|
346
|
|
- // app.Id = 0
|
347
|
|
- //
|
348
|
|
- // app.Status = 1
|
349
|
|
- // app.ModifyTime = time.Now().Unix()
|
350
|
|
- // app.CreateTime = time.Now().Unix()
|
351
|
|
- // service.CreateOrgApp(app)
|
352
|
|
- // }
|
353
|
|
- // if org_app_11 == nil || org_app_11.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
354
|
|
- // app, _ := service.GetOrgApp(0,11)
|
355
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
356
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
357
|
|
- //
|
358
|
|
- // app.OrgId = app.OrgId
|
359
|
|
- // app.Creator = int(org.Creator)
|
360
|
|
- // app.Pid = xt_temp_org_app.Id
|
361
|
|
- // app.Id = 0
|
362
|
|
- //
|
363
|
|
- // app.Number = 0
|
364
|
|
- // app.Status = 1
|
365
|
|
- // app.ModifyTime = time.Now().Unix()
|
366
|
|
- // app.CreateTime = time.Now().Unix()
|
367
|
|
- // service.CreateOrgApp(app)
|
368
|
|
- // }
|
369
|
|
- // if org_app_12 == nil || org_app_12.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
370
|
|
- // app, _ := service.GetOrgApp(0,12)
|
371
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
372
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
373
|
|
- //
|
374
|
|
- // app.OrgId = apps.OrgId
|
375
|
|
- // app.Creator = int(org.Creator)
|
376
|
|
- // app.Pid = xt_temp_org_app.Id
|
377
|
|
- // app.Number = 0
|
378
|
|
- // app.Status = 1
|
379
|
|
- // app.Id = 0
|
380
|
|
- //
|
381
|
|
- // app.ModifyTime = time.Now().Unix()
|
382
|
|
- // app.CreateTime = time.Now().Unix()
|
383
|
|
- // service.CreateOrgApp(app)
|
384
|
|
- // }
|
385
|
|
- // if org_app_13 == nil || org_app_13.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
386
|
|
- // app, _ := service.GetOrgApp(0,13)
|
387
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
388
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
389
|
|
- //
|
390
|
|
- // app.OrgId = apps.OrgId
|
391
|
|
- // app.Creator = int(org.Creator)
|
392
|
|
- // app.Pid = xt_temp_org_app.Id
|
393
|
|
- // app.Number = 0
|
394
|
|
- // app.Id = 0
|
395
|
|
- //
|
396
|
|
- // app.Status = 1
|
397
|
|
- // app.ModifyTime = time.Now().Unix()
|
398
|
|
- // app.CreateTime = time.Now().Unix()
|
399
|
|
- // service.CreateOrgApp(app)
|
400
|
|
- // }
|
401
|
|
- // if org_app_14 == nil || org_app_14.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
402
|
|
- // app, _ := service.GetOrgApp(0,14)
|
403
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
404
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
405
|
|
- //
|
406
|
|
- // app.OrgId = apps.OrgId
|
407
|
|
- // app.Creator = int(org.Creator)
|
408
|
|
- // app.Pid = xt_temp_org_app.Id
|
409
|
|
- // app.Id = 0
|
410
|
|
- // app.Number = 0
|
411
|
|
- // app.Status = 1
|
412
|
|
- // app.ModifyTime = time.Now().Unix()
|
413
|
|
- // app.CreateTime = time.Now().Unix()
|
414
|
|
- // service.CreateOrgApp(app)
|
415
|
|
- // }
|
416
|
|
- //
|
417
|
|
- // if org_app_15 == nil || org_app_15.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
418
|
|
- // app, _ := service.GetOrgApp(0,15)
|
419
|
|
- // //org, _ := service.GetOrgById(int64(12))
|
420
|
|
- // org, _ := service.GetOrgById(int64(apps.OrgId))
|
421
|
|
- //
|
422
|
|
- // app.OrgId = apps.OrgId
|
423
|
|
- // app.Creator = int(org.Creator)
|
424
|
|
- // app.Pid = xt_temp_org_app.Id
|
425
|
|
- // app.Number = 0
|
426
|
|
- // app.Status = 1
|
427
|
|
- // app.Id = 0
|
428
|
|
- // app.ModifyTime = time.Now().Unix()
|
429
|
|
- // app.CreateTime = time.Now().Unix()
|
430
|
|
- // service.CreateOrgApp(app)
|
431
|
|
- // }
|
432
|
|
- //}
|
433
|
|
- //
|
|
171
|
+ for _, apps := range org_app {
|
|
172
|
+ xt_org_app, _ := service.GetAppByType(int64(apps.OrgId), 3)
|
|
173
|
+ scrm_org_app, _ := service.GetAppByType(int64(apps.OrgId), 1)
|
|
174
|
+ cdm_org_app, _ := service.GetAppByType(int64(apps.OrgId), 4)
|
|
175
|
+ mall_org_app, _ := service.GetAppByType(int64(apps.OrgId), 5)
|
|
176
|
+ org_app_6, _ := service.GetAppByType(int64(apps.OrgId), 6)
|
|
177
|
+ org_app_7, _ := service.GetAppByType(int64(apps.OrgId), 7)
|
|
178
|
+ org_app_8, _ := service.GetAppByType(int64(apps.OrgId), 8)
|
|
179
|
+ org_app_9, _ := service.GetAppByType(int64(apps.OrgId), 9)
|
|
180
|
+ org_app_10, _ := service.GetAppByType(int64(apps.OrgId), 10)
|
|
181
|
+ org_app_11, _ := service.GetAppByType(int64(apps.OrgId), 11)
|
|
182
|
+ org_app_12, _ := service.GetAppByType(int64(apps.OrgId), 12)
|
|
183
|
+ org_app_13, _ := service.GetAppByType(int64(apps.OrgId), 13)
|
|
184
|
+ org_app_14, _ := service.GetAppByType(int64(apps.OrgId), 14)
|
|
185
|
+ org_app_15, _ := service.GetAppByType(int64(apps.OrgId), 15)
|
|
186
|
+
|
|
187
|
+ var xt_temp_org_app *models.OrgApp
|
|
188
|
+ var mall_temp_org_app *models.OrgApp
|
|
189
|
+
|
|
190
|
+ if xt_org_app == nil || xt_org_app.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
191
|
+
|
|
192
|
+ app, _ := service.GetOrgApp(0, 3)
|
|
193
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
194
|
+
|
|
195
|
+ app.Id = 0
|
|
196
|
+ app.OrgId = apps.OrgId
|
|
197
|
+ app.Creator = int(org.Creator)
|
|
198
|
+ app.Number = 0
|
|
199
|
+ app.Status = 1
|
|
200
|
+ app.ModifyTime = time.Now().Unix()
|
|
201
|
+ app.CreateTime = time.Now().Unix()
|
|
202
|
+ service.CreateOrgApp(app)
|
|
203
|
+ xt_temp_org_app = app
|
|
204
|
+ } else {
|
|
205
|
+
|
|
206
|
+ xt_temp_org_app = xt_org_app
|
|
207
|
+
|
|
208
|
+ }
|
|
209
|
+
|
|
210
|
+ if scrm_org_app == nil || scrm_org_app.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
211
|
+
|
|
212
|
+ app, _ := service.GetOrgApp(0, 1)
|
|
213
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
214
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
215
|
+
|
|
216
|
+ app.OrgId = apps.OrgId
|
|
217
|
+ app.Id = 0
|
|
218
|
+
|
|
219
|
+ app.Creator = int(org.Creator)
|
|
220
|
+ app.Number = 0
|
|
221
|
+ app.Status = 1
|
|
222
|
+ app.ModifyTime = time.Now().Unix()
|
|
223
|
+ app.CreateTime = time.Now().Unix()
|
|
224
|
+ service.CreateOrgApp(app)
|
|
225
|
+
|
|
226
|
+ }
|
|
227
|
+
|
|
228
|
+ if cdm_org_app == nil || cdm_org_app.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
229
|
+ app, _ := service.GetOrgApp(0, 4)
|
|
230
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
231
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
232
|
+
|
|
233
|
+ app.OrgId = apps.OrgId
|
|
234
|
+ app.Creator = int(org.Creator)
|
|
235
|
+ app.Number = 0
|
|
236
|
+ app.Id = 0
|
|
237
|
+
|
|
238
|
+ app.Status = 1
|
|
239
|
+ app.ModifyTime = time.Now().Unix()
|
|
240
|
+ app.CreateTime = time.Now().Unix()
|
|
241
|
+ service.CreateOrgApp(app)
|
|
242
|
+ }
|
|
243
|
+
|
|
244
|
+ if mall_org_app == nil || mall_org_app.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
245
|
+ app, _ := service.GetOrgApp(0, 5)
|
|
246
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
247
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
248
|
+
|
|
249
|
+ app.OrgId = apps.OrgId
|
|
250
|
+ app.Creator = int(org.Creator)
|
|
251
|
+ app.Number = 0
|
|
252
|
+ app.Id = 0
|
|
253
|
+
|
|
254
|
+ app.Status = 1
|
|
255
|
+ app.ModifyTime = time.Now().Unix()
|
|
256
|
+ app.CreateTime = time.Now().Unix()
|
|
257
|
+ service.CreateOrgApp(app)
|
|
258
|
+ mall_temp_org_app = app
|
|
259
|
+ } else {
|
|
260
|
+ mall_temp_org_app = mall_org_app
|
|
261
|
+ }
|
|
262
|
+
|
|
263
|
+ if org_app_6 == nil || org_app_6.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
264
|
+ app, _ := service.GetOrgApp(0, 6)
|
|
265
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
266
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
267
|
+
|
|
268
|
+ app.OrgId = apps.OrgId
|
|
269
|
+ app.Creator = int(org.Creator)
|
|
270
|
+ app.Number = 1
|
|
271
|
+ app.Id = 0
|
|
272
|
+
|
|
273
|
+ app.Status = 1
|
|
274
|
+ app.ModifyTime = time.Now().Unix()
|
|
275
|
+ app.CreateTime = time.Now().Unix()
|
|
276
|
+ app.Pid = xt_temp_org_app.Id
|
|
277
|
+ service.CreateOrgApp(app)
|
|
278
|
+
|
|
279
|
+ }
|
|
280
|
+ if org_app_7 == nil || org_app_7.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
281
|
+ app, _ := service.GetOrgApp(0, 7)
|
|
282
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
283
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
284
|
+
|
|
285
|
+ app.OrgId = apps.OrgId
|
|
286
|
+ app.Creator = int(org.Creator)
|
|
287
|
+ app.Number = 0
|
|
288
|
+ app.Status = 2
|
|
289
|
+ app.Id = 0
|
|
290
|
+
|
|
291
|
+ app.ModifyTime = time.Now().Unix()
|
|
292
|
+ app.CreateTime = time.Now().Unix()
|
|
293
|
+ app.Pid = xt_temp_org_app.Id
|
|
294
|
+
|
|
295
|
+ service.CreateOrgApp(app)
|
|
296
|
+ }
|
|
297
|
+ if org_app_8 == nil || org_app_8.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
298
|
+ app, _ := service.GetOrgApp(0, 8)
|
|
299
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
300
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
301
|
+
|
|
302
|
+ app.OrgId = apps.OrgId
|
|
303
|
+ app.Creator = int(org.Creator)
|
|
304
|
+ app.Number = 3
|
|
305
|
+ app.Id = 0
|
|
306
|
+
|
|
307
|
+ app.Pid = mall_temp_org_app.Id
|
|
308
|
+
|
|
309
|
+ app.Status = 1
|
|
310
|
+ app.ModifyTime = time.Now().Unix()
|
|
311
|
+ app.CreateTime = time.Now().Unix()
|
|
312
|
+ service.CreateOrgApp(app)
|
|
313
|
+ }
|
|
314
|
+ if org_app_9 == nil || org_app_9.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
315
|
+ app, _ := service.GetOrgApp(0, 9)
|
|
316
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
317
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
318
|
+
|
|
319
|
+ app.OrgId = apps.OrgId
|
|
320
|
+ app.Pid = xt_temp_org_app.Id
|
|
321
|
+
|
|
322
|
+ app.Creator = int(org.Creator)
|
|
323
|
+ app.Number = 4
|
|
324
|
+ app.Id = 0
|
|
325
|
+
|
|
326
|
+ app.Status = 1
|
|
327
|
+ app.ModifyTime = time.Now().Unix()
|
|
328
|
+ app.CreateTime = time.Now().Unix()
|
|
329
|
+ service.CreateOrgApp(app)
|
|
330
|
+
|
|
331
|
+ }
|
|
332
|
+ if org_app_10 == nil || org_app_10.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
333
|
+ app, _ := service.GetOrgApp(0, 10)
|
|
334
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
335
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
336
|
+
|
|
337
|
+ app.OrgId = apps.OrgId
|
|
338
|
+ app.Creator = int(org.Creator)
|
|
339
|
+ app.Pid = xt_temp_org_app.Id
|
|
340
|
+
|
|
341
|
+ app.Number = 5
|
|
342
|
+ app.Id = 0
|
|
343
|
+
|
|
344
|
+ app.Status = 1
|
|
345
|
+ app.ModifyTime = time.Now().Unix()
|
|
346
|
+ app.CreateTime = time.Now().Unix()
|
|
347
|
+ service.CreateOrgApp(app)
|
|
348
|
+ }
|
|
349
|
+ if org_app_11 == nil || org_app_11.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
350
|
+ app, _ := service.GetOrgApp(0, 11)
|
|
351
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
352
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
353
|
+
|
|
354
|
+ app.OrgId = app.OrgId
|
|
355
|
+ app.Creator = int(org.Creator)
|
|
356
|
+ app.Pid = xt_temp_org_app.Id
|
|
357
|
+ app.Id = 0
|
|
358
|
+
|
|
359
|
+ app.Number = 6
|
|
360
|
+ app.Status = 1
|
|
361
|
+ app.ModifyTime = time.Now().Unix()
|
|
362
|
+ app.CreateTime = time.Now().Unix()
|
|
363
|
+ service.CreateOrgApp(app)
|
|
364
|
+ }
|
|
365
|
+ if org_app_12 == nil || org_app_12.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
366
|
+ app, _ := service.GetOrgApp(0, 12)
|
|
367
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
368
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
369
|
+
|
|
370
|
+ app.OrgId = apps.OrgId
|
|
371
|
+ app.Creator = int(org.Creator)
|
|
372
|
+ app.Pid = xt_temp_org_app.Id
|
|
373
|
+ app.Number = 7
|
|
374
|
+ app.Status = 1
|
|
375
|
+ app.Id = 0
|
|
376
|
+
|
|
377
|
+ app.ModifyTime = time.Now().Unix()
|
|
378
|
+ app.CreateTime = time.Now().Unix()
|
|
379
|
+ service.CreateOrgApp(app)
|
|
380
|
+ }
|
|
381
|
+ if org_app_13 == nil || org_app_13.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
382
|
+ app, _ := service.GetOrgApp(0, 13)
|
|
383
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
384
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
385
|
+
|
|
386
|
+ app.OrgId = apps.OrgId
|
|
387
|
+ app.Creator = int(org.Creator)
|
|
388
|
+ app.Pid = xt_temp_org_app.Id
|
|
389
|
+ app.Number = 8
|
|
390
|
+ app.Id = 0
|
|
391
|
+ app.Status = 1
|
|
392
|
+ app.ModifyTime = time.Now().Unix()
|
|
393
|
+ app.CreateTime = time.Now().Unix()
|
|
394
|
+ service.CreateOrgApp(app)
|
|
395
|
+ }
|
|
396
|
+ if org_app_14 == nil || org_app_14.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
397
|
+ app, _ := service.GetOrgApp(0, 14)
|
|
398
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
399
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
400
|
+
|
|
401
|
+ app.OrgId = apps.OrgId
|
|
402
|
+ app.Creator = int(org.Creator)
|
|
403
|
+ app.Pid = xt_temp_org_app.Id
|
|
404
|
+ app.Id = 0
|
|
405
|
+ app.Number = 9
|
|
406
|
+ app.Status = 1
|
|
407
|
+ app.ModifyTime = time.Now().Unix()
|
|
408
|
+ app.CreateTime = time.Now().Unix()
|
|
409
|
+ service.CreateOrgApp(app)
|
|
410
|
+ }
|
|
411
|
+
|
|
412
|
+ if org_app_15 == nil || org_app_15.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
|
|
413
|
+ app, _ := service.GetOrgApp(0, 15)
|
|
414
|
+ //org, _ := service.GetOrgById(int64(12))
|
|
415
|
+ org, _ := service.GetOrgById(int64(apps.OrgId))
|
|
416
|
+
|
|
417
|
+ app.OrgId = apps.OrgId
|
|
418
|
+ app.Creator = int(org.Creator)
|
|
419
|
+ app.Pid = xt_temp_org_app.Id
|
|
420
|
+ app.Number = 10
|
|
421
|
+ app.Status = 1
|
|
422
|
+ app.Id = 0
|
|
423
|
+ app.ModifyTime = time.Now().Unix()
|
|
424
|
+ app.CreateTime = time.Now().Unix()
|
|
425
|
+ service.CreateOrgApp(app)
|
|
426
|
+ }
|
|
427
|
+ }
|
|
428
|
+
|
434
|
429
|
for _, role := range org_role {
|
435
|
430
|
org_ids = append(org_ids, role.OrgId)
|
436
|
431
|
}
|
437
|
432
|
//
|
438
|
433
|
//
|
439
|
434
|
////创建内置角色
|
440
|
|
- //InitRoleAndPurviews(org_ids)
|
|
435
|
+ InitRoleAndPurviews(org_ids)
|
441
|
436
|
|
442
|
437
|
//var org_id int = 0
|
443
|
438
|
////管理员
|