正在显示
16 个修改的文件
包含
80 行增加
和
72 行删除
@@ -128,6 +128,7 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 | @@ -128,6 +128,7 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 | ||
128 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | 128 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= |
129 | github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= | 129 | github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= |
130 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= | 130 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= |
131 | +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= | ||
131 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | 132 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= |
132 | github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= | 133 | github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= |
133 | github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= | 134 | github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= |
@@ -220,6 +221,7 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | @@ -220,6 +221,7 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||
220 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | 221 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |
221 | gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= | 222 | gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= |
222 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | 223 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |
224 | +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= | ||
223 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | 225 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
224 | mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w= | 226 | mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w= |
225 | mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= | 227 | mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= |
@@ -10,7 +10,7 @@ import ( | @@ -10,7 +10,7 @@ import ( | ||
10 | type CreateCashPoolCommand struct { | 10 | type CreateCashPoolCommand struct { |
11 | //Uid int64 `json:"uid"` // 统一用户id | 11 | //Uid int64 `json:"uid"` // 统一用户id |
12 | //CashPoolId int64 `json:"cashPoolId" valid:"Required"` // 现金池ID | 12 | //CashPoolId int64 `json:"cashPoolId" valid:"Required"` // 现金池ID |
13 | - CompanyId int64 `json:"companyId"` // 公司ID | 13 | + CompanyId int64 `json:"companyId" valid:"Required"` // 公司ID |
14 | Cash float64 `json:"cash" valid:"Required"` // 投入的现金值 | 14 | Cash float64 `json:"cash" valid:"Required"` // 投入的现金值 |
15 | //ExchangedCash float64 `json:"exchangedCash,omitempty"` // 现金池已兑换现金值 | 15 | //ExchangedCash float64 `json:"exchangedCash,omitempty"` // 现金池已兑换现金值 |
16 | //UnExchangeCash float64 `json:"unExchangeCash,omitempty"` // 现金池未兑换现金值 | 16 | //UnExchangeCash float64 `json:"unExchangeCash,omitempty"` // 现金池未兑换现金值 |
@@ -3,14 +3,15 @@ package command | @@ -3,14 +3,15 @@ package command | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | "github.com/astaxie/beego/validation" | 5 | "github.com/astaxie/beego/validation" |
6 | - "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain" | ||
7 | ) | 6 | ) |
8 | 7 | ||
9 | type CreateExchangeCashPersonCommand struct { | 8 | type CreateExchangeCashPersonCommand struct { |
10 | - ExchangeCashPerson *domain.Employee `json:"exchangeCashPerson"` // 兑换现金人员 | ||
11 | - ExchangeCashActivityId int64 `json:"exchangeCashActivityId"` // 参与的兑换活动id | 9 | + PersonId int64 `json:"personId" valid:"Required"` // 兑换现金人员uid |
10 | + PersonName string `json:"personName,omitempty"` // 兑换现金人员名称 | ||
11 | + PersonAccount string `json:"personAccount,omitempty"` // 手机账号 | ||
12 | + ExchangeCashActivityId int64 `json:"exchangeCashActivityId" valid:"Required"` // 参与的兑换活动id | ||
12 | ExchangedSuMoney float64 `json:"exchangedSuMoney"` // 已兑换素币值 | 13 | ExchangedSuMoney float64 `json:"exchangedSuMoney"` // 已兑换素币值 |
13 | - ExchangedCash float64 `json:"exchangedCash"` // 已兑换现金值 | 14 | + //ExchangedCash float64 `json:"exchangedCash"` // 已兑换现金值 |
14 | } | 15 | } |
15 | 16 | ||
16 | func (createExchangeCashPersonCommand *CreateExchangeCashPersonCommand) ValidateCommand() error { | 17 | func (createExchangeCashPersonCommand *CreateExchangeCashPersonCommand) ValidateCommand() error { |
@@ -9,7 +9,8 @@ import ( | @@ -9,7 +9,8 @@ import ( | ||
9 | 9 | ||
10 | type SearchSuMoneyTransactionRecordCommand struct { | 10 | type SearchSuMoneyTransactionRecordCommand struct { |
11 | // 统一用户UID | 11 | // 统一用户UID |
12 | - Uid int64 `json:"uid" valid:"Required"` | 12 | + //Uid int64 `json:"uid" valid:"Required"` |
13 | + Uid int64 `json:"uid"` | ||
13 | // 记录类型(1兑换,2任务奖励,3增加,4扣除) | 14 | // 记录类型(1兑换,2任务奖励,3增加,4扣除) |
14 | RecordType int `json:"recordType,omitempty"` | 15 | RecordType int `json:"recordType,omitempty"` |
15 | // 记录类型列表(1兑换,2任务奖励,3增加,4扣除) | 16 | // 记录类型列表(1兑换,2任务奖励,3增加,4扣除) |
@@ -20,7 +21,7 @@ type SearchSuMoneyTransactionRecordCommand struct { | @@ -20,7 +21,7 @@ type SearchSuMoneyTransactionRecordCommand struct { | ||
20 | TransactionEndTime time.Time `json:"transactionEndTime,omitempty"` | 21 | TransactionEndTime time.Time `json:"transactionEndTime,omitempty"` |
21 | // 操作人UID | 22 | // 操作人UID |
22 | Operator int64 `json:"operator,omitempty"` | 23 | Operator int64 `json:"operator,omitempty"` |
23 | - // 关联人员 | 24 | + // 关联人员姓名 |
24 | EmployeeMatchName string `json:"employeeMatchName"` | 25 | EmployeeMatchName string `json:"employeeMatchName"` |
25 | // 查询偏离量 | 26 | // 查询偏离量 |
26 | Offset int `json:"offset,omitempty"` | 27 | Offset int `json:"offset,omitempty"` |
@@ -66,6 +66,8 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co | @@ -66,6 +66,8 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co | ||
66 | systemUnChangeSuMoney = value2 | 66 | systemUnChangeSuMoney = value2 |
67 | } | 67 | } |
68 | 68 | ||
69 | + fmt.Print("1234567", createCashPoolCommand) | ||
70 | + | ||
69 | newCashPool := &domain.CashPool{ | 71 | newCashPool := &domain.CashPool{ |
70 | CompanyId: createCashPoolCommand.CompanyId, | 72 | CompanyId: createCashPoolCommand.CompanyId, |
71 | Cash: createCashPoolCommand.Cash, | 73 | Cash: createCashPoolCommand.Cash, |
@@ -86,6 +88,7 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co | @@ -86,6 +88,7 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co | ||
86 | cashPoolRepository = value | 88 | cashPoolRepository = value |
87 | } | 89 | } |
88 | 90 | ||
91 | + // 每个公司一个现金池 | ||
89 | if activity, err := cashPoolRepository.Save(newCashPool); err != nil { | 92 | if activity, err := cashPoolRepository.Save(newCashPool); err != nil { |
90 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 93 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
91 | } else { | 94 | } else { |
@@ -203,16 +206,16 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivity(listExchangeCas | @@ -203,16 +206,16 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivity(listExchangeCas | ||
203 | transactionContext.RollbackTransaction() | 206 | transactionContext.RollbackTransaction() |
204 | }() | 207 | }() |
205 | 208 | ||
206 | - var cashPoolRepository domain.CashPoolRepository | ||
207 | - if value, err := factory.CreateCashPoolRepository(map[string]interface{}{ | 209 | + var exchangeActivityRepository domain.ExchangeActivityRepository |
210 | + if value, err := factory.CreateExchangeCashActivityRepository(map[string]interface{}{ | ||
208 | "transactionContext": transactionContext, | 211 | "transactionContext": transactionContext, |
209 | }); err != nil { | 212 | }); err != nil { |
210 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 213 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
211 | } else { | 214 | } else { |
212 | - cashPoolRepository = value | 215 | + exchangeActivityRepository = value |
213 | } | 216 | } |
214 | 217 | ||
215 | - if count, activities, err := cashPoolRepository.Find(tool_funs.SimpleStructToMap(listExchangeCashActivityQuery)); err != nil { | 218 | + if count, activities, err := exchangeActivityRepository.Find(tool_funs.SimpleStructToMap(listExchangeCashActivityQuery)); err != nil { |
216 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 219 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
217 | } else { | 220 | } else { |
218 | if err := transactionContext.CommitTransaction(); err != nil { | 221 | if err := transactionContext.CommitTransaction(); err != nil { |
@@ -379,11 +382,13 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC | @@ -379,11 +382,13 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC | ||
379 | 382 | ||
380 | // 创建兑换清单 | 383 | // 创建兑换清单 |
381 | newPerson := &domain.ExchangeCashPersonList{ | 384 | newPerson := &domain.ExchangeCashPersonList{ |
382 | - CompanyId: createExchangeCashPersonCommand.ExchangeCashPerson.CompanyId, | 385 | + EmployeeInfo: &domain.EmployeeInfo{ |
386 | + Uid: createExchangeCashPersonCommand.PersonId, | ||
387 | + EmployeeName: createExchangeCashPersonCommand.PersonName, | ||
388 | + EmployeeAccount: createExchangeCashPersonCommand.PersonAccount, | ||
389 | + }, | ||
383 | ExchangeCashActivityId: createExchangeCashPersonCommand.ExchangeCashActivityId, | 390 | ExchangeCashActivityId: createExchangeCashPersonCommand.ExchangeCashActivityId, |
384 | - ExchangeCashPerson: createExchangeCashPersonCommand.ExchangeCashPerson, | ||
385 | ExchangedSuMoney: createExchangeCashPersonCommand.ExchangedSuMoney, | 391 | ExchangedSuMoney: createExchangeCashPersonCommand.ExchangedSuMoney, |
386 | - ExchangedCash: createExchangeCashPersonCommand.ExchangedCash, | ||
387 | } | 392 | } |
388 | 393 | ||
389 | // 兑换活动资源库 | 394 | // 兑换活动资源库 |
@@ -462,16 +467,16 @@ func (cashPoolService *CashPoolService) ListExchangeCashPerson(listExchangeCashP | @@ -462,16 +467,16 @@ func (cashPoolService *CashPoolService) ListExchangeCashPerson(listExchangeCashP | ||
462 | transactionContext.RollbackTransaction() | 467 | transactionContext.RollbackTransaction() |
463 | }() | 468 | }() |
464 | 469 | ||
465 | - var cashPoolRepository domain.CashPoolRepository | ||
466 | - if value, err := factory.CreateCashPoolRepository(map[string]interface{}{ | 470 | + var exchangeCashPersonListRepository domain.ExchangeCashPersonListRepository |
471 | + if value, err := factory.CreateExchangeCashPersonListRepository(map[string]interface{}{ | ||
467 | "transactionContext": transactionContext, | 472 | "transactionContext": transactionContext, |
468 | }); err != nil { | 473 | }); err != nil { |
469 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 474 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
470 | } else { | 475 | } else { |
471 | - cashPoolRepository = value | 476 | + exchangeCashPersonListRepository = value |
472 | } | 477 | } |
473 | 478 | ||
474 | - if count, people, err := cashPoolRepository.Find(tool_funs.SimpleStructToMap(listExchangeCashPersonQuery)); err != nil { | 479 | + if count, people, err := exchangeCashPersonListRepository.Find(tool_funs.SimpleStructToMap(listExchangeCashPersonQuery)); err != nil { |
475 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 480 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
476 | } else { | 481 | } else { |
477 | if err := transactionContext.CommitTransaction(); err != nil { | 482 | if err := transactionContext.CommitTransaction(); err != nil { |
@@ -5,8 +5,8 @@ import "time" | @@ -5,8 +5,8 @@ import "time" | ||
5 | // 现金池 | 5 | // 现金池 |
6 | type CashPool struct { | 6 | type CashPool struct { |
7 | CashPoolId int64 `json:"cashPoolId"` // 现金池id | 7 | CashPoolId int64 `json:"cashPoolId"` // 现金池id |
8 | - CompanyId int64 `json:"companyId"` // 公司id | ||
9 | Cash float64 `json:"cash"` // 投入现金池的现金 | 8 | Cash float64 `json:"cash"` // 投入现金池的现金 |
9 | + CompanyId int64 `json:"companyId"` // 公司id | ||
10 | ExchangedCash float64 `json:"exchangedCash"` // 已兑换的现金 | 10 | ExchangedCash float64 `json:"exchangedCash"` // 已兑换的现金 |
11 | UnExchangeCash float64 `json:"unExchangeCash"` // 未兑换的现金 | 11 | UnExchangeCash float64 `json:"unExchangeCash"` // 未兑换的现金 |
12 | ExchangedSuMoney float64 `json:"exchangedSuMoney"` // 已兑换的素币 | 12 | ExchangedSuMoney float64 `json:"exchangedSuMoney"` // 已兑换的素币 |
@@ -2,12 +2,14 @@ package domain | @@ -2,12 +2,14 @@ package domain | ||
2 | 2 | ||
3 | // 参与兑换现金人员 | 3 | // 参与兑换现金人员 |
4 | type ExchangeCashPersonList struct { | 4 | type ExchangeCashPersonList struct { |
5 | - ExchangeCashPersonListId int64 `json:"employeeId"` // 兑换人员ID | ||
6 | - CompanyId int64 `json:"companyId"` // 公司id | ||
7 | - ExchangeCashActivityId int64 `json:"exchangeActivityId"` // 参与的兑换活动id | ||
8 | - ExchangeCashPerson *Employee `json:"employeeInfo"` // 兑换人员信息 | ||
9 | - ExchangedSuMoney float64 `json:"suMoney"` // 已兑换的素币 | ||
10 | - ExchangedCash float64 `json:"cash"` // 已兑换的现金 | 5 | + ExchangeCashPersonListId int64 `json:"exchangeCashPersonListId"` // 兑换人员ID |
6 | + //CompanyId int64 `json:"companyId"` // 公司id | ||
7 | + EmployeeInfo *EmployeeInfo `json:"employeeInfo"` | ||
8 | + //PersonId int64 `json:"personId"` // 兑换人员uid | ||
9 | + //ExchangeCashPersonName string `json:"exchangeCashPersonName"` // 兑换人员名称 | ||
10 | + ExchangeCashActivityId int64 `json:"exchangeActivityId"` // 参与的兑换活动id | ||
11 | + ExchangedSuMoney float64 `json:"suMoney"` // 已兑换的素币 | ||
12 | + ExchangedCash float64 `json:"cash"` // 已兑换的现金 | ||
11 | } | 13 | } |
12 | 14 | ||
13 | type ExchangeCashPersonListRepository interface { | 15 | type ExchangeCashPersonListRepository interface { |
@@ -16,10 +16,10 @@ type SuMoneyTransactionRecord struct { | @@ -16,10 +16,10 @@ type SuMoneyTransactionRecord struct { | ||
16 | Employee *EmployeeInfo `json:"employee"` // 记录关联员工 | 16 | Employee *EmployeeInfo `json:"employee"` // 记录关联员工 |
17 | SuMoneyBeforeTransaction float64 `json:"suMoneyBeforeTransaction"` // 事务处理前素币值 | 17 | SuMoneyBeforeTransaction float64 `json:"suMoneyBeforeTransaction"` // 事务处理前素币值 |
18 | CurrentSuMoney float64 `json:"currentSuMoney"` // 当前素币值 | 18 | CurrentSuMoney float64 `json:"currentSuMoney"` // 当前素币值 |
19 | - CashPoolBeforeTransaction *CashPool `json:"cashPoolBeforeTransaction"` // 事务处理前现金池,用于兑换现金操作 | ||
20 | - CurrentCashPool *CashPool `json:"currentCashPool"` // 当前现金池,用于兑换现金操作 | 19 | + //CashPoolBeforeTransaction *CashPool `json:"cashPoolBeforeTransaction"` // 事务处理前现金池,用于兑换现金操作 |
20 | + //CurrentCashPool *CashPool `json:"currentCashPool"` // 当前现金池,用于兑换现金操作 | ||
21 | SuMoney float64 `json:"suMoney"` // 事务素币值 | 21 | SuMoney float64 `json:"suMoney"` // 事务素币值 |
22 | - Cash float64 `json:"cash"` // 事务现金值,用于兑换现金操作 | 22 | + //Cash float64 `json:"cash"` // 事务现金值,用于兑换现金操作 |
23 | Operator *EmployeeInfo `json:"operator"` // 操作人 | 23 | Operator *EmployeeInfo `json:"operator"` // 操作人 |
24 | RecordDescription string `json:"recordDescription"` // 素币事务记录描述 | 24 | RecordDescription string `json:"recordDescription"` // 素币事务记录描述 |
25 | CreateTime time.Time `json:"createTime"` // 创建时间 | 25 | CreateTime time.Time `json:"createTime"` // 创建时间 |
1 | package models | 1 | package models |
2 | 2 | ||
3 | -import ( | ||
4 | - "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain" | ||
5 | - "time" | ||
6 | -) | ||
7 | - | ||
8 | type ExchangeCashPersonList struct { | 3 | type ExchangeCashPersonList struct { |
9 | - TableName string `pg:"exchange_cash_list"` | ||
10 | - Id int64 `pg:",pk"` // 兑换现金清单id | ||
11 | - PersonInfo *domain.Employee // 兑换现金人员 | 4 | + TableName string `pg:"exchange_cash_person_list,alias:exchange_cash_person_lists"` |
5 | + Id int64 `pg:",pk"` // 清单id | ||
6 | + ActivityId int64 // 兑换活动id | ||
7 | + Uid int64 // 统一用户UID | ||
8 | + EmployeeName string // 员工姓名 | ||
9 | + EmployeeAccount string // 员工账号 | ||
10 | + EmployeeAvatarUrl string // 员工头像URL | ||
11 | + IsPrincipal bool `pg:",notnull,default:false"` // 是否公司负责人 | ||
12 | ExchangedSuMoney float64 // 已兑换素币 | 12 | ExchangedSuMoney float64 // 已兑换素币 |
13 | ExchangedCash float64 // 已兑换现金 | 13 | ExchangedCash float64 // 已兑换现金 |
14 | - CreateTime time.Time // 兑换时间 | ||
15 | } | 14 | } |
@@ -10,8 +10,8 @@ type SuMoneyExchangeTransactionRecord struct { | @@ -10,8 +10,8 @@ type SuMoneyExchangeTransactionRecord struct { | ||
10 | Id int64 `pg:",pk"` // 现金兑换务记录ID | 10 | Id int64 `pg:",pk"` // 现金兑换务记录ID |
11 | RecordType int // 记录类型 | 11 | RecordType int // 记录类型 |
12 | Employee *domain.EmployeeInfo // 记录关联员工 | 12 | Employee *domain.EmployeeInfo // 记录关联员工 |
13 | - CashPoolBeforeTransaction *domain.CashPool // 事务处理前现金池 | ||
14 | - CurrentCashPool *domain.CashPool // 当前现金池 | 13 | + //CashPoolBeforeTransaction *domain.CashPool // 事务处理前现金池 |
14 | + //CurrentCashPool *domain.CashPool // 当前现金池 | ||
15 | SuMoney float64 // 事务素币值 | 15 | SuMoney float64 // 事务素币值 |
16 | Cash float64 // 事务现金值 | 16 | Cash float64 // 事务现金值 |
17 | Operator *domain.EmployeeInfo // 操作人 | 17 | Operator *domain.EmployeeInfo // 操作人 |
@@ -17,15 +17,15 @@ func (repository *CashPoolRepository) Save(cashPool *domain.CashPool) (*domain.C | @@ -17,15 +17,15 @@ func (repository *CashPoolRepository) Save(cashPool *domain.CashPool) (*domain.C | ||
17 | if cashPool.Identity() == nil { | 17 | if cashPool.Identity() == nil { |
18 | if _, err := tx.QueryOne( | 18 | if _, err := tx.QueryOne( |
19 | pg.Scan(&cashPool.CashPoolId, &cashPool.Cash, &cashPool.CompanyId, &cashPool.ExchangedCash, &cashPool.UnExchangeCash, &cashPool.ExchangedSuMoney, &cashPool.UnExchangeSuMoney, &cashPool.Rate), | 19 | pg.Scan(&cashPool.CashPoolId, &cashPool.Cash, &cashPool.CompanyId, &cashPool.ExchangedCash, &cashPool.UnExchangeCash, &cashPool.ExchangedSuMoney, &cashPool.UnExchangeSuMoney, &cashPool.Rate), |
20 | - "INSERT INTO cash_pools (cash, company_id, exchanged_cash, un_exchange_cash, exchanged_su_money, un_exchange_su_money, rate) VALUES (?, ?, ?, ?, ?, ?, ?) RETURNING id, company_id, exchanged_cash, un_exchange_cash, exchanged_su_money, un_exchange_su_money, rate", | 20 | + "INSERT INTO cash_pools (cash, company_id, exchanged_cash, un_exchange_cash, exchanged_su_money, un_exchange_su_money, rate) VALUES (?, ?, ?, ?, ?, ?, ?) RETURNING id, cash, company_id, exchanged_cash, un_exchange_cash, exchanged_su_money, un_exchange_su_money, rate", |
21 | cashPool.Cash, cashPool.CompanyId, cashPool.ExchangedCash, cashPool.UnExchangeCash, cashPool.ExchangedSuMoney, cashPool.UnExchangeSuMoney, cashPool.Rate); err != nil { | 21 | cashPool.Cash, cashPool.CompanyId, cashPool.ExchangedCash, cashPool.UnExchangeCash, cashPool.ExchangedSuMoney, cashPool.UnExchangeSuMoney, cashPool.Rate); err != nil { |
22 | return cashPool, err | 22 | return cashPool, err |
23 | } | 23 | } |
24 | } else { | 24 | } else { |
25 | if _, err := tx.QueryOne( | 25 | if _, err := tx.QueryOne( |
26 | pg.Scan(&cashPool.CashPoolId, &cashPool.Cash, &cashPool.CompanyId, &cashPool.ExchangedCash, &cashPool.UnExchangeCash, &cashPool.ExchangedSuMoney, &cashPool.UnExchangeSuMoney, &cashPool.Rate), | 26 | pg.Scan(&cashPool.CashPoolId, &cashPool.Cash, &cashPool.CompanyId, &cashPool.ExchangedCash, &cashPool.UnExchangeCash, &cashPool.ExchangedSuMoney, &cashPool.UnExchangeSuMoney, &cashPool.Rate), |
27 | - "UPDATE cash_pools SET cash=?, company_id=? exchanged_cash=?, un_exchange_cash=?, exchanged_su_money=?, un_exchange_su_money=?, rate=? WHERE company_id=? RETURNING id, company_id, exchanged_cash, un_exchange_cash, exchanged_su_money, un_exchange_su_money, rate", | ||
28 | - cashPool.Cash, cashPool.CompanyId, cashPool.ExchangedCash, cashPool.UnExchangeCash, cashPool.ExchangedSuMoney, cashPool.UnExchangeSuMoney, cashPool.Rate, cashPool.Identity()); err != nil { | 27 | + "UPDATE cash_pools SET cash=?, company_id=?, exchanged_cash=?, un_exchange_cash=?, exchanged_su_money=?, un_exchange_su_money=?, rate=? WHERE id=? RETURNING id, cash, company_id, exchanged_cash, un_exchange_cash, exchanged_su_money, un_exchange_su_money, rate", |
28 | + cashPool.Cash, cashPool.CompanyId, cashPool.ExchangedCash, cashPool.UnExchangeCash, cashPool.ExchangedSuMoney, cashPool.UnExchangeSuMoney, cashPool.Rate, cashPool.CashPoolId, cashPool.Identity()); err != nil { | ||
29 | return cashPool, err | 29 | return cashPool, err |
30 | } | 30 | } |
31 | } | 31 | } |
@@ -39,7 +39,7 @@ func (repository *CashPoolRepository) Find(queryOptions map[string]interface{}) | @@ -39,7 +39,7 @@ func (repository *CashPoolRepository) Find(queryOptions map[string]interface{}) | ||
39 | query := tx.Model(&cashPoolModels) | 39 | query := tx.Model(&cashPoolModels) |
40 | // 根据公司id查找现金池 | 40 | // 根据公司id查找现金池 |
41 | if companyId, ok := queryOptions["companyId"]; ok { | 41 | if companyId, ok := queryOptions["companyId"]; ok { |
42 | - query = query.Where("cash_pools.company_id = ?", companyId) | 42 | + query = query.Where("cash_pool.company_id = ?", companyId) |
43 | } | 43 | } |
44 | if offset, ok := queryOptions["offset"]; ok { | 44 | if offset, ok := queryOptions["offset"]; ok { |
45 | offset := offset.(int) | 45 | offset := offset.(int) |
@@ -55,7 +55,7 @@ func (repository *CashPoolRepository) Find(queryOptions map[string]interface{}) | @@ -55,7 +55,7 @@ func (repository *CashPoolRepository) Find(queryOptions map[string]interface{}) | ||
55 | query = query.Limit(limit) | 55 | query = query.Limit(limit) |
56 | } | 56 | } |
57 | } else { | 57 | } else { |
58 | - query = query.Limit(20) | 58 | + query = query.Limit(1) |
59 | } | 59 | } |
60 | if count, err := query.Order("id DESC").SelectAndCount(); err != nil { | 60 | if count, err := query.Order("id DESC").SelectAndCount(); err != nil { |
61 | return 0, cashPools, err | 61 | return 0, cashPools, err |
@@ -2,11 +2,12 @@ package repository | @@ -2,11 +2,12 @@ package repository | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | + "time" | ||
6 | + | ||
5 | "github.com/go-pg/pg" | 7 | "github.com/go-pg/pg" |
6 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 8 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
7 | "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain" | 9 | "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain" |
8 | "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/pg/models" | 10 | "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/pg/models" |
9 | - "time" | ||
10 | ) | 11 | ) |
11 | 12 | ||
12 | type ExchangeCashActivityRepository struct { | 13 | type ExchangeCashActivityRepository struct { |
@@ -17,16 +18,16 @@ func (repository *ExchangeCashActivityRepository) Save(exchangeCashActivity *dom | @@ -17,16 +18,16 @@ func (repository *ExchangeCashActivityRepository) Save(exchangeCashActivity *dom | ||
17 | tx := repository.transactionContext.PgTx | 18 | tx := repository.transactionContext.PgTx |
18 | if exchangeCashActivity.Identity() == nil { | 19 | if exchangeCashActivity.Identity() == nil { |
19 | if _, err := tx.QueryOne( | 20 | if _, err := tx.QueryOne( |
20 | - pg.Scan(&exchangeCashActivity.ActivityId, &exchangeCashActivity.CompanyId, &exchangeCashActivity.ExchangeActivityName, &exchangeCashActivity.Deadline, &exchangeCashActivity.CountDown, &exchangeCashActivity.ExchangedCash, &exchangeCashActivity.ExchangedSuMoney, &exchangeCashActivity.Rate), | 21 | + pg.Scan(&exchangeCashActivity.ActivityId, &exchangeCashActivity.CompanyId, &exchangeCashActivity.ExchangeActivityName, &exchangeCashActivity.Deadline, &exchangeCashActivity.CountDown, &exchangeCashActivity.ExchangedCash, &exchangeCashActivity.ExchangedSuMoney, &exchangeCashActivity.Rate), |
21 | "INSERT INTO exchange_cash_activities ( company_id, activity_name, deadline, count_down, exchanged_cash, exchanged_su_money, exchange_rate) VALUES (?, ?, ?, ?, ?, ?, ? ) RETURNING id, company_id, activity_name, deadline, count_down, exchanged_cash, exchanged_su_money, exchange_rate" , | 22 | "INSERT INTO exchange_cash_activities ( company_id, activity_name, deadline, count_down, exchanged_cash, exchanged_su_money, exchange_rate) VALUES (?, ?, ?, ?, ?, ?, ? ) RETURNING id, company_id, activity_name, deadline, count_down, exchanged_cash, exchanged_su_money, exchange_rate" , |
22 | exchangeCashActivity.CompanyId, exchangeCashActivity.ExchangeActivityName, exchangeCashActivity.Deadline, exchangeCashActivity.CountDown, exchangeCashActivity.ExchangedCash, exchangeCashActivity.ExchangedSuMoney, exchangeCashActivity.Rate); err != nil { | 23 | exchangeCashActivity.CompanyId, exchangeCashActivity.ExchangeActivityName, exchangeCashActivity.Deadline, exchangeCashActivity.CountDown, exchangeCashActivity.ExchangedCash, exchangeCashActivity.ExchangedSuMoney, exchangeCashActivity.Rate); err != nil { |
23 | return exchangeCashActivity, err | 24 | return exchangeCashActivity, err |
24 | } | 25 | } |
25 | } else { | 26 | } else { |
26 | if _, err := tx.QueryOne( | 27 | if _, err := tx.QueryOne( |
27 | - pg.Scan(&exchangeCashActivity.ActivityId, &exchangeCashActivity.ExchangeActivityName), | ||
28 | - "UPDATE exchange_cash_activities SET company_id=?, activity_name=?, deadline=?, count_down=?, exchanged_cash=?, exchanged_su_money=?, exchange_rate=?, create_time=?, WHERE id=? RETURNING id, company_id, activity_name, deadline, count_down, exchanged_cash, exchanged_su_money, exchange_rate", | ||
29 | - exchangeCashActivity.CompanyId, exchangeCashActivity.ExchangeActivityName, exchangeCashActivity.Deadline, exchangeCashActivity.CountDown, exchangeCashActivity.ExchangedCash, exchangeCashActivity.ExchangedSuMoney, exchangeCashActivity.Rate); err != nil { | 28 | + pg.Scan(&exchangeCashActivity.ActivityId, &exchangeCashActivity.CompanyId, &exchangeCashActivity.ExchangeActivityName, &exchangeCashActivity.Deadline, &exchangeCashActivity.CountDown, &exchangeCashActivity.ExchangedCash, &exchangeCashActivity.ExchangedSuMoney, &exchangeCashActivity.Rate), |
29 | + "UPDATE exchange_cash_activities SET activity_name=?, deadline=?, count_down=?, exchanged_cash=?, exchanged_su_money=?, exchange_rate=? WHERE id=? RETURNING id, company_id, activity_name, deadline, count_down, exchanged_cash, exchanged_su_money, exchange_rate", | ||
30 | + exchangeCashActivity.ExchangeActivityName, exchangeCashActivity.Deadline, exchangeCashActivity.CountDown, exchangeCashActivity.ExchangedCash, exchangeCashActivity.ExchangedSuMoney, exchangeCashActivity.Rate, exchangeCashActivity.ActivityId); err != nil { | ||
30 | return exchangeCashActivity, err | 31 | return exchangeCashActivity, err |
31 | } | 32 | } |
32 | } | 33 | } |
@@ -65,7 +66,7 @@ func (repository *ExchangeCashActivityRepository) Find(queryOptions map[string]i | @@ -65,7 +66,7 @@ func (repository *ExchangeCashActivityRepository) Find(queryOptions map[string]i | ||
65 | } | 66 | } |
66 | // 活动名称模糊搜索 | 67 | // 活动名称模糊搜索 |
67 | if exchangeCashActivityNameMatch, ok := queryOptions["exchangeCashActivityNameMatch"]; ok && (exchangeCashActivityNameMatch != "") { | 68 | if exchangeCashActivityNameMatch, ok := queryOptions["exchangeCashActivityNameMatch"]; ok && (exchangeCashActivityNameMatch != "") { |
68 | - query = query.Where(`exchange_cash_activity.exchange_cash_activity_name LIKE ?`, fmt.Sprintf("%%%s%%", exchangeCashActivityNameMatch.(string))) | 69 | + query = query.Where(`exchange_cash_activity.activity_name LIKE ?`, fmt.Sprintf("%%%s%%", exchangeCashActivityNameMatch.(string))) |
69 | } | 70 | } |
70 | // 活动截止时间搜索 | 71 | // 活动截止时间搜索 |
71 | if deadline, ok := queryOptions["exchangeCashActivityDeadline"]; ok && !deadline.(time.Time).IsZero() { | 72 | if deadline, ok := queryOptions["exchangeCashActivityDeadline"]; ok && !deadline.(time.Time).IsZero() { |
@@ -135,4 +136,4 @@ func NewExchangeCashActivityRepository(transactionContext *pgTransaction.Transac | @@ -135,4 +136,4 @@ func NewExchangeCashActivityRepository(transactionContext *pgTransaction.Transac | ||
135 | transactionContext: transactionContext, | 136 | transactionContext: transactionContext, |
136 | }, nil | 137 | }, nil |
137 | } | 138 | } |
138 | -} | ||
139 | +} |
@@ -17,16 +17,16 @@ func (repository *ExchangeCashPersonListRepository) Save(exchangeCashList *domai | @@ -17,16 +17,16 @@ func (repository *ExchangeCashPersonListRepository) Save(exchangeCashList *domai | ||
17 | tx := repository.transactionContext.PgTx | 17 | tx := repository.transactionContext.PgTx |
18 | if exchangeCashList.Identity() == nil { | 18 | if exchangeCashList.Identity() == nil { |
19 | if _, err := tx.QueryOne( | 19 | if _, err := tx.QueryOne( |
20 | - pg.Scan(&exchangeCashList.ExchangeCashPersonListId, &exchangeCashList.CompanyId, &exchangeCashList.ExchangeCashActivityId, &exchangeCashList.ExchangeCashPerson, &exchangeCashList.ExchangedSuMoney, &exchangeCashList.ExchangedCash), | ||
21 | - "INSERT INTO exchange_cash_list (company_id, exchange_cash_activity_id, exchange_cash_person, exchanged_su_money, exchanged_cash) VALUES (?, ?, ?, ?, ?) RETURNING id, company_id, exchange_cash_activity_id, exchange_cash_person, exchanged_su_money, exchanged_cash", | ||
22 | - exchangeCashList.CompanyId, exchangeCashList.ExchangeCashActivityId, exchangeCashList.ExchangeCashPerson, exchangeCashList.ExchangedSuMoney, exchangeCashList.ExchangedCash); err != nil { | 20 | + pg.Scan(&exchangeCashList.ExchangeCashPersonListId, &exchangeCashList.ExchangeCashActivityId, &exchangeCashList.EmployeeInfo.Uid, &exchangeCashList.EmployeeInfo.EmployeeName, &exchangeCashList.EmployeeInfo.EmployeeAccount, &exchangeCashList.ExchangedSuMoney, &exchangeCashList.ExchangedCash), |
21 | + "INSERT INTO exchange_cash_person_lists (activity_id, uid, employee_name, employee_account, exchanged_su_money, exchanged_cash) VALUES (?, ?, ?, ?, ?, ?) RETURNING id, activity_id, uid, employee_name, employee_account, exchanged_su_money, exchanged_cash", | ||
22 | + exchangeCashList.ExchangeCashActivityId, exchangeCashList.EmployeeInfo.Uid, exchangeCashList.EmployeeInfo.EmployeeName, exchangeCashList.EmployeeInfo.EmployeeAccount, exchangeCashList.ExchangedSuMoney, exchangeCashList.ExchangedCash); err != nil { | ||
23 | return exchangeCashList, err | 23 | return exchangeCashList, err |
24 | } | 24 | } |
25 | } else { | 25 | } else { |
26 | if _, err := tx.QueryOne( | 26 | if _, err := tx.QueryOne( |
27 | - pg.Scan(&exchangeCashList.ExchangeCashPersonListId, &exchangeCashList.CompanyId, &exchangeCashList.ExchangeCashPerson, &exchangeCashList.ExchangedSuMoney, &exchangeCashList.ExchangedCash), | ||
28 | - "UPDATE exchange_cash_list SET company_id = ?, exchange_cash_activity_id=?, exchange_cash_person=?, exchanged_su_money=?, exchanged_cash=? WHERE id=? RETURNING id, company_id, exchange_cash_activity_id, exchange_cash_person, exchanged_su_money, exchanged_cash", | ||
29 | - exchangeCashList.CompanyId, exchangeCashList.ExchangeCashPerson, exchangeCashList.ExchangeCashActivityId, exchangeCashList.ExchangedSuMoney, exchangeCashList.ExchangedCash); err != nil { | 27 | + pg.Scan(&exchangeCashList.ExchangeCashPersonListId, &exchangeCashList.ExchangeCashActivityId, &exchangeCashList.EmployeeInfo.Uid, &exchangeCashList.EmployeeInfo.EmployeeName, &exchangeCashList.EmployeeInfo.EmployeeAccount, &exchangeCashList.ExchangedSuMoney, &exchangeCashList.ExchangedCash), |
28 | + "UPDATE exchange_cash_person_lists SET exchanged_su_money=? WHERE uid=? RETURNING id, activity_id, uid, employee_name, employee_account, exchanged_su_money, exchanged_cash", | ||
29 | + exchangeCashList.ExchangedSuMoney, exchangeCashList.EmployeeInfo.Uid); err != nil { | ||
30 | return exchangeCashList, err | 30 | return exchangeCashList, err |
31 | } | 31 | } |
32 | } | 32 | } |
@@ -38,7 +38,7 @@ func (repository *ExchangeCashPersonListRepository) FindOne(queryOptions map[str | @@ -38,7 +38,7 @@ func (repository *ExchangeCashPersonListRepository) FindOne(queryOptions map[str | ||
38 | exchangeCashListModel := new(models.ExchangeCashPersonList) | 38 | exchangeCashListModel := new(models.ExchangeCashPersonList) |
39 | query := tx.Model(exchangeCashListModel) | 39 | query := tx.Model(exchangeCashListModel) |
40 | if exchangeCashListId, ok := queryOptions["exchangeCashListId"]; ok { | 40 | if exchangeCashListId, ok := queryOptions["exchangeCashListId"]; ok { |
41 | - query = query.Where("exchange_cash_list.id = ?", exchangeCashListId) | 41 | + query = query.Where("exchange_cash_person_lists.id = ?", exchangeCashListId) |
42 | } | 42 | } |
43 | if err := query.First(); err != nil { | 43 | if err := query.First(); err != nil { |
44 | if err.Error() == "pg: no rows in result set" { | 44 | if err.Error() == "pg: no rows in result set" { |
@@ -60,16 +60,16 @@ func (repository *ExchangeCashPersonListRepository) Find(queryOptions map[string | @@ -60,16 +60,16 @@ func (repository *ExchangeCashPersonListRepository) Find(queryOptions map[string | ||
60 | exchangeCashPeople := make([]*domain.ExchangeCashPersonList, 0) | 60 | exchangeCashPeople := make([]*domain.ExchangeCashPersonList, 0) |
61 | query := tx.Model(&exchangeCashListModels) | 61 | query := tx.Model(&exchangeCashListModels) |
62 | // 根据公司id查找兑换现金人员清单 | 62 | // 根据公司id查找兑换现金人员清单 |
63 | - if companyId, ok := queryOptions["companyId"]; ok { | ||
64 | - query = query.Where("exchange_cash_list.company_id = ?", companyId) | ||
65 | - } | 63 | + //if companyId, ok := queryOptions["companyId"]; ok { |
64 | + // query = query.Where("exchange_cash_person_lists.company_id = ?", companyId) | ||
65 | + //} | ||
66 | // 根据活动id查找兑换现金人员清单 | 66 | // 根据活动id查找兑换现金人员清单 |
67 | if exchangeCashActivityId, ok := queryOptions["activityId"]; ok { | 67 | if exchangeCashActivityId, ok := queryOptions["activityId"]; ok { |
68 | - query = query.Where("exchange_cash_list.exchange_cash_activity_id = ?", exchangeCashActivityId) | 68 | + query = query.Where("exchange_cash_person_lists.activity_id = ?", exchangeCashActivityId) |
69 | } | 69 | } |
70 | // 根据兑换现金人员名称搜索人员清单 | 70 | // 根据兑换现金人员名称搜索人员清单 |
71 | if personNameMatch, ok := queryOptions["personNameMatch"]; ok && (personNameMatch != ""){ | 71 | if personNameMatch, ok := queryOptions["personNameMatch"]; ok && (personNameMatch != ""){ |
72 | - query = query.Where("exchange_cash_list.exchange_cash_person LIKE ?", fmt.Sprintf("%%%s%%", personNameMatch.(string))) | 72 | + query = query.Where("exchange_cash_person_lists.employee_name LIKE ?", fmt.Sprintf("%%%s%%", personNameMatch.(string))) |
73 | } | 73 | } |
74 | if offset, ok := queryOptions["offset"]; ok { | 74 | if offset, ok := queryOptions["offset"]; ok { |
75 | offset := offset.(int) | 75 | offset := offset.(int) |
@@ -75,7 +75,9 @@ func (repository *SuMoneyTransactionRecordRepository) Find(queryOptions map[stri | @@ -75,7 +75,9 @@ func (repository *SuMoneyTransactionRecordRepository) Find(queryOptions map[stri | ||
75 | } | 75 | } |
76 | // TODO 姓名模糊查询 | 76 | // TODO 姓名模糊查询 |
77 | if employeeMatchName, ok := queryOptions["employeeMatchName"]; ok && (employeeMatchName != "") { | 77 | if employeeMatchName, ok := queryOptions["employeeMatchName"]; ok && (employeeMatchName != "") { |
78 | - query = query.Where(`su_money_transaction_record.employee @> '{"employeeName":LIKE ?}'`, fmt.Sprintf("%%%s%%", employeeMatchName.(string))) | 78 | + //query = query.Where(`su_money_transaction_record.employee @> 'employeeName' LIKE ?`, fmt.Sprintf("%%%s%%", employeeMatchName.(string))) |
79 | + //query = query.Where(`su_money_transaction_record.employee :json->> 'employeeName' LIKE ?`, fmt.Sprintf("%%%s%%", employeeMatchName.(string))) | ||
80 | + query = query.Where(`su_money_transaction_record.employee @> '{"employeeName":?}'`, employeeMatchName.(string)) | ||
79 | } | 81 | } |
80 | if recordType, ok := queryOptions["recordType"]; ok && (recordType != 0) { | 82 | if recordType, ok := queryOptions["recordType"]; ok && (recordType != 0) { |
81 | query = query.Where(`su_money_transaction_record.record_type = ?`, recordType) | 83 | query = query.Where(`su_money_transaction_record.record_type = ?`, recordType) |
@@ -81,8 +81,8 @@ func (controller *SuMoneyController) SearchSuMoneyTransactionRecord() { | @@ -81,8 +81,8 @@ func (controller *SuMoneyController) SearchSuMoneyTransactionRecord() { | ||
81 | suMoneyService := service.NewSuMoneyService(nil) | 81 | suMoneyService := service.NewSuMoneyService(nil) |
82 | searchSuMoneyTransactionRecordCommand := &command.SearchSuMoneyTransactionRecordCommand{} | 82 | searchSuMoneyTransactionRecordCommand := &command.SearchSuMoneyTransactionRecordCommand{} |
83 | 83 | ||
84 | - employeeMatchName := controller.GetString("employeeMatchName") | ||
85 | - searchSuMoneyTransactionRecordCommand.EmployeeMatchName = employeeMatchName | 84 | + //employeeMatchName := controller.GetString("employeeMatchName") |
85 | + //searchSuMoneyTransactionRecordCommand.EmployeeMatchName = employeeMatchName | ||
86 | 86 | ||
87 | offset, _ := controller.GetInt("offset") | 87 | offset, _ := controller.GetInt("offset") |
88 | searchSuMoneyTransactionRecordCommand.Offset = offset | 88 | searchSuMoneyTransactionRecordCommand.Offset = offset |
@@ -130,19 +130,14 @@ func (controller *SuMoneyController) SuMoneyTransactionRecordStatistics() { | @@ -130,19 +130,14 @@ func (controller *SuMoneyController) SuMoneyTransactionRecordStatistics() { | ||
130 | func (controller *SuMoneyController) CashInput() { | 130 | func (controller *SuMoneyController) CashInput() { |
131 | cashPoolService := service.NewCashPoolService(nil) | 131 | cashPoolService := service.NewCashPoolService(nil) |
132 | createCashPoolCommand := &command.CreateCashPoolCommand{} | 132 | createCashPoolCommand := &command.CreateCashPoolCommand{} |
133 | - | ||
134 | json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), createCashPoolCommand) | 133 | json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), createCashPoolCommand) |
135 | - | ||
136 | data, err := cashPoolService.CreateCashPool(createCashPoolCommand) | 134 | data, err := cashPoolService.CreateCashPool(createCashPoolCommand) |
137 | - | ||
138 | var response utils.JsonResponse | 135 | var response utils.JsonResponse |
139 | - | ||
140 | if err != nil { | 136 | if err != nil { |
141 | response = utils.ResponseError(controller.Ctx, err) | 137 | response = utils.ResponseError(controller.Ctx, err) |
142 | } else { | 138 | } else { |
143 | response = utils.ResponseData(controller.Ctx, data) | 139 | response = utils.ResponseData(controller.Ctx, data) |
144 | } | 140 | } |
145 | - | ||
146 | controller.Data["json"] = response | 141 | controller.Data["json"] = response |
147 | controller.ServeJSON() | 142 | controller.ServeJSON() |
148 | } | 143 | } |
@@ -23,7 +23,7 @@ func init() { | @@ -23,7 +23,7 @@ func init() { | ||
23 | beego.Router("/cash-pool/activity", &controllers.SuMoneyController{}, "POST:CreateExchangeActivities") // 新增兑换活动 | 23 | beego.Router("/cash-pool/activity", &controllers.SuMoneyController{}, "POST:CreateExchangeActivities") // 新增兑换活动 |
24 | beego.Router("/cash-pool/activity/:activityId", &controllers.SuMoneyController{}, "DELETE:RemoveExchangeActivities") // 删除兑换活动 | 24 | beego.Router("/cash-pool/activity/:activityId", &controllers.SuMoneyController{}, "DELETE:RemoveExchangeActivities") // 删除兑换活动 |
25 | 25 | ||
26 | - beego.Router("/cash-pool/activity/exchange-list/", &controllers.SuMoneyController{}, "GET:ListExchangeList") // 返回素币兑换清单 | 26 | + beego.Router("/cash-pool/activity/exchange-list", &controllers.SuMoneyController{}, "GET:ListExchangeList") // 返回素币兑换清单 |
27 | beego.Router("/cash-pool/activity/exchange-list/:personId", &controllers.SuMoneyController{}, "GET:GetExchangeCashPerson") // 返回素币兑换人员 | 27 | beego.Router("/cash-pool/activity/exchange-list/:personId", &controllers.SuMoneyController{}, "GET:GetExchangeCashPerson") // 返回素币兑换人员 |
28 | beego.Router("/cash-pool/activity/exchange-list", &controllers.SuMoneyController{}, "POST:CreateExchangeList") // 新增素币兑换清单 | 28 | beego.Router("/cash-pool/activity/exchange-list", &controllers.SuMoneyController{}, "POST:CreateExchangeList") // 新增素币兑换清单 |
29 | beego.Router("/cash-pool/activity/exchange-list/:personId", &controllers.SuMoneyController{}, "PUT:UpdateExchangeList") // 编辑素币兑换清单 | 29 | beego.Router("/cash-pool/activity/exchange-list/:personId", &controllers.SuMoneyController{}, "PUT:UpdateExchangeList") // 编辑素币兑换清单 |
-
请 注册 或 登录 后发表评论