|
@@ -93,8 +93,6 @@ func StockManagerApiRegistRouters() {
|
93
|
93
|
func (c *StockManagerApiController) CreateWarehouse() {
|
94
|
94
|
|
95
|
95
|
warehousing_time := c.GetString("warehousing_time")
|
96
|
|
- dealer_id, _ := c.GetInt64("dealer_id", 0)
|
97
|
|
- manufacturer_id, _ := c.GetInt64("manufacturer_id", 0)
|
98
|
96
|
|
99
|
97
|
types, _ := c.GetInt64("type", 0)
|
100
|
98
|
|
|
@@ -122,8 +120,6 @@ func (c *StockManagerApiController) CreateWarehouse() {
|
122
|
120
|
Ctime: ctime,
|
123
|
121
|
Status: 1,
|
124
|
122
|
WarehousingTime: warehousingDate.Unix(),
|
125
|
|
- Dealer: dealer_id,
|
126
|
|
- Manufacturer: manufacturer_id,
|
127
|
123
|
Type: types,
|
128
|
124
|
}
|
129
|
125
|
service.AddSigleWarehouse(&warehousing)
|
|
@@ -210,6 +206,8 @@ func (c *StockManagerApiController) CreateWarehouse() {
|
210
|
206
|
|
211
|
207
|
remark, _ := items["remark"].(string)
|
212
|
208
|
|
|
209
|
+ manufacturer := int64(items["manufacturer"].(float64))
|
|
210
|
+ dealer := int64(items["dealer"].(float64))
|
213
|
211
|
warehouseInfo := &models.WarehousingInfo{
|
214
|
212
|
WarehousingOrder: warehousing.WarehousingOrder,
|
215
|
213
|
WarehousingId: warehousing.ID,
|
|
@@ -226,9 +224,9 @@ func (c *StockManagerApiController) CreateWarehouse() {
|
226
|
224
|
Remark: remark,
|
227
|
225
|
OrgId: adminUserInfo.CurrentOrgId,
|
228
|
226
|
Type: types,
|
229
|
|
- Manufacturer: manufacturer_id,
|
230
|
|
- Dealer: dealer_id,
|
|
227
|
+ Manufacturer: manufacturer,
|
231
|
228
|
StockCount: warehousing_count,
|
|
229
|
+ Dealer: dealer,
|
232
|
230
|
}
|
233
|
231
|
warehousingInfo = append(warehousingInfo, warehouseInfo)
|
234
|
232
|
|
|
@@ -464,8 +462,6 @@ func (c *StockManagerApiController) EditWarehouse() {
|
464
|
462
|
warehousing_time := c.GetString("warehousing_time")
|
465
|
463
|
id, _ := c.GetInt64("id", 0)
|
466
|
464
|
types, _ := c.GetInt64("type", 0)
|
467
|
|
- manufacturer_id, _ := c.GetInt64("manufacturer_id", 0)
|
468
|
|
- dealer_id, _ := c.GetInt64("dealer_id", 0)
|
469
|
465
|
|
470
|
466
|
if id == 0 {
|
471
|
467
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
@@ -493,8 +489,6 @@ func (c *StockManagerApiController) EditWarehouse() {
|
493
|
489
|
Status: 1,
|
494
|
490
|
WarehousingTime: warehousingDate.Unix(),
|
495
|
491
|
Type: warehouse.Type,
|
496
|
|
- Dealer: dealer_id,
|
497
|
|
- Manufacturer: manufacturer_id,
|
498
|
492
|
}
|
499
|
493
|
|
500
|
494
|
service.EditWarehousing(warehousing)
|
|
@@ -583,6 +577,9 @@ func (c *StockManagerApiController) EditWarehouse() {
|
583
|
577
|
|
584
|
578
|
remark, _ := items["remark"].(string)
|
585
|
579
|
|
|
580
|
+ manufacturer := int64(items["manufacturer"].(float64))
|
|
581
|
+ dealer := int64(items["dealer"].(float64))
|
|
582
|
+
|
586
|
583
|
if items["id"] == nil || reflect.TypeOf(items["id"]).String() != "float64" {
|
587
|
584
|
utils.ErrorLog("id")
|
588
|
585
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
@@ -607,8 +604,9 @@ func (c *StockManagerApiController) EditWarehouse() {
|
607
|
604
|
Remark: remark,
|
608
|
605
|
OrgId: adminUserInfo.CurrentOrgId,
|
609
|
606
|
Type: types,
|
610
|
|
- Manufacturer: manufacturer_id,
|
611
|
|
- Dealer: dealer_id,
|
|
607
|
+ Manufacturer: manufacturer,
|
|
608
|
+ Dealer: dealer,
|
|
609
|
+ StockCount: warehousing_count,
|
612
|
610
|
}
|
613
|
611
|
warehousingInfo = append(warehousingInfo, warehouseInfo)
|
614
|
612
|
|
|
@@ -630,8 +628,9 @@ func (c *StockManagerApiController) EditWarehouse() {
|
630
|
628
|
Remark: remark,
|
631
|
629
|
OrgId: adminUserInfo.CurrentOrgId,
|
632
|
630
|
Type: types,
|
633
|
|
- Manufacturer: manufacturer_id,
|
634
|
|
- Dealer: dealer_id,
|
|
631
|
+ Manufacturer: manufacturer,
|
|
632
|
+ Dealer: dealer,
|
|
633
|
+ StockCount: warehousing_count,
|
635
|
634
|
}
|
636
|
635
|
upDateWarehousingInfo = append(upDateWarehousingInfo, warehouseInfo)
|
637
|
636
|
}
|
|
@@ -1042,8 +1041,7 @@ func (c *StockManagerApiController) EditReturnInfo() {
|
1042
|
1041
|
}
|
1043
|
1042
|
|
1044
|
1043
|
func (c *StockManagerApiController) CreateWarehouseOut() {
|
1045
|
|
- dealer_id, _ := c.GetInt64("dealer_id", 0)
|
1046
|
|
- manufacturer_id, _ := c.GetInt64("manufacturer_id", 0)
|
|
1044
|
+
|
1047
|
1045
|
types, _ := c.GetInt64("type", 0)
|
1048
|
1046
|
|
1049
|
1047
|
ctime := time.Now().Unix()
|
|
@@ -1076,8 +1074,6 @@ func (c *StockManagerApiController) CreateWarehouseOut() {
|
1076
|
1074
|
Ctime: ctime,
|
1077
|
1075
|
Status: 1,
|
1078
|
1076
|
WarehouseOutTime: warehousingOutDate.Unix(),
|
1079
|
|
- Dealer: dealer_id,
|
1080
|
|
- Manufacturer: manufacturer_id,
|
1081
|
1077
|
Type: types,
|
1082
|
1078
|
}
|
1083
|
1079
|
service.AddSigleWarehouseOut(&warehouseOut)
|
|
@@ -1105,7 +1101,7 @@ func (c *StockManagerApiController) CreateWarehouseOut() {
|
1105
|
1101
|
}
|
1106
|
1102
|
|
1107
|
1103
|
good_id := int64(items["good_id"].(float64))
|
1108
|
|
- fmt.Println("stockout223232324343445456465656565565665", good_id)
|
|
1104
|
+
|
1109
|
1105
|
if items["good_type_id"] == nil || reflect.TypeOf(items["good_type_id"]).String() != "float64" {
|
1110
|
1106
|
utils.ErrorLog("good_type_id")
|
1111
|
1107
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
@@ -1131,6 +1127,8 @@ func (c *StockManagerApiController) CreateWarehouseOut() {
|
1131
|
1127
|
total := float64(count) * price
|
1132
|
1128
|
remark := items["remark"].(string)
|
1133
|
1129
|
|
|
1130
|
+ manufacturer := int64(items["manufacturer"].(float64))
|
|
1131
|
+
|
1134
|
1132
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
1135
|
1133
|
WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
|
1136
|
1134
|
WarehouseOutId: warehouseOut.ID,
|
|
@@ -1144,8 +1142,7 @@ func (c *StockManagerApiController) CreateWarehouseOut() {
|
1144
|
1142
|
Remark: remark,
|
1145
|
1143
|
OrgId: adminUserInfo.CurrentOrgId,
|
1146
|
1144
|
Type: types,
|
1147
|
|
- Manufacturer: manufacturer_id,
|
1148
|
|
- Dealer: dealer_id,
|
|
1145
|
+ Manufacturer: manufacturer,
|
1149
|
1146
|
}
|
1150
|
1147
|
warehousingOutInfo = append(warehousingOutInfo, warehouseOutInfo)
|
1151
|
1148
|
|
|
@@ -1284,8 +1281,6 @@ func (c *StockManagerApiController) EditWarehouseOut() {
|
1284
|
1281
|
warehouse_out_time := c.GetString("warehouse_out_time")
|
1285
|
1282
|
id, _ := c.GetInt64("id", 0)
|
1286
|
1283
|
types, _ := c.GetInt64("type", 0)
|
1287
|
|
- manufacturer_id, _ := c.GetInt64("manufacturer_id", 0)
|
1288
|
|
- dealer_id, _ := c.GetInt64("dealer_id", 0)
|
1289
|
1284
|
|
1290
|
1285
|
if id == 0 {
|
1291
|
1286
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
@@ -1309,8 +1304,6 @@ func (c *StockManagerApiController) EditWarehouseOut() {
|
1309
|
1304
|
ID: warehouseOut.ID,
|
1310
|
1305
|
Mtime: mtime,
|
1311
|
1306
|
WarehouseOutTime: warehouseOutDate.Unix(),
|
1312
|
|
- Manufacturer: manufacturer_id,
|
1313
|
|
- Dealer: dealer_id,
|
1314
|
1307
|
}
|
1315
|
1308
|
|
1316
|
1309
|
service.EditWarehouseOut(tempWarehouseOut)
|
|
@@ -1371,6 +1364,7 @@ func (c *StockManagerApiController) EditWarehouseOut() {
|
1371
|
1364
|
}
|
1372
|
1365
|
id := int64(items["id"].(float64))
|
1373
|
1366
|
|
|
1367
|
+ manufacturer := int64(items["manufacturer"].(float64))
|
1374
|
1368
|
if id == 0 {
|
1375
|
1369
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
1376
|
1370
|
WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
|
|
@@ -1385,8 +1379,6 @@ func (c *StockManagerApiController) EditWarehouseOut() {
|
1385
|
1379
|
Remark: remark,
|
1386
|
1380
|
OrgId: adminUserInfo.CurrentOrgId,
|
1387
|
1381
|
Type: types,
|
1388
|
|
- Manufacturer: manufacturer_id,
|
1389
|
|
- Dealer: dealer_id,
|
1390
|
1382
|
IsSys: 0,
|
1391
|
1383
|
SysRecordTime: 0,
|
1392
|
1384
|
}
|
|
@@ -1422,8 +1414,7 @@ func (c *StockManagerApiController) EditWarehouseOut() {
|
1422
|
1414
|
OrgId: adminUserInfo.CurrentOrgId,
|
1423
|
1415
|
Mtime: time.Now().Unix(),
|
1424
|
1416
|
Type: types,
|
1425
|
|
- Manufacturer: manufacturer_id,
|
1426
|
|
- Dealer: dealer_id,
|
|
1417
|
+ Manufacturer: manufacturer,
|
1427
|
1418
|
IsSys: is_sys,
|
1428
|
1419
|
SysRecordTime: sys_record_time,
|
1429
|
1420
|
}
|
|
@@ -3615,9 +3606,11 @@ func (this *StockManagerApiController) PostSearchGoodList() {
|
3615
|
3606
|
orgId := adminUserInfo.CurrentOrgId
|
3616
|
3607
|
list, _ := service.GetSearchGoodList(keyword, orgId)
|
3617
|
3608
|
manufacturerList, _ := service.GetAllManufacturerList(orgId)
|
|
3609
|
+ dealerList, _ := service.GetAllDealerList(orgId)
|
3618
|
3610
|
this.ServeSuccessJSON(map[string]interface{}{
|
3619
|
3611
|
"list": list,
|
3620
|
3612
|
"manufacturerList": manufacturerList,
|
|
3613
|
+ "dealerList": dealerList,
|
3621
|
3614
|
})
|
3622
|
3615
|
}
|
3623
|
3616
|
|
|
@@ -3695,10 +3688,12 @@ func (this *StockManagerApiController) GetStockListById() {
|
3695
|
3688
|
}
|
3696
|
3689
|
manufacturerList, _ := service.GetAllManufacturerList(orgId)
|
3697
|
3690
|
list, total, _ := service.GetStockListById(id, orgId, limit, page, startTime, endTime)
|
|
3691
|
+ outList, _, _ := service.GetStockOutList(id, orgId, limit, page, startTime, endTime)
|
3698
|
3692
|
this.ServeSuccessJSON(map[string]interface{}{
|
3699
|
3693
|
"list": list,
|
3700
|
3694
|
"total": total,
|
3701
|
3695
|
"manufacturerList": manufacturerList,
|
|
3696
|
+ "outList": outList,
|
3702
|
3697
|
})
|
3703
|
3698
|
}
|
3704
|
3699
|
|