作者 yangfu

共创项目更新修改

... ... @@ -10,6 +10,12 @@ import (
type CreditAccountSearchCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 查询偏离量
PageNumber int `json:"pageNumber"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
// 账期结算支付状态,1待支付,2已支付 0全部
PaymentStatus int32 `json:"paymentStatus"`
}
func (cmd *CreditAccountSearchCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -11,15 +11,15 @@ type UpdateCooperationProjectCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 共创项目ID
CooperationProjectId string `json:"cooperationProjectId,string" valid:"Required"`
CooperationProjectId string `json:"cooperationProjectId" valid:"Required"`
// 模式编码,唯一确定
//CooperationModeNumber string `json:"cooperationModeNumber" valid:"Required"`
CooperationModeNumber string `json:"cooperationModeNumber" valid:"Required"`
// 组织ID
OrgId int64 `json:"departmentId,string" valid:"Required"`
// 共创项目名称
CooperationProjectName string `json:"cooperationProjectName" valid:"Required"`
// 共创发起人id
CooperationProjectSponsor string `json:"cooperationProjectSponsor,omitempty"`
CooperationProjectSponsor int64 `json:"cooperationProjectSponsor,omitempty"`
// 项目承接对象
CooperationProjectUndertakerType []int32 `json:"cooperationProjectUndertakerType,omitempty"`
// 共创项目描述
... ...
... ... @@ -73,11 +73,11 @@ func (srv CooperationProjectService) UpdateCooperationProject(updateCooperationP
})
}
_, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{
CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId,
CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName,
//CooperationModeNumber: updateCooperationProjectCommand.CooperationModeNumber,
CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId,
CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName,
CooperationModeNumber: updateCooperationProjectCommand.CooperationModeNumber,
CooperationProjectUndertakerType: updateCooperationProjectCommand.CooperationProjectUndertakerType,
SponsorUid: updateCooperationProjectCommand.CooperationProjectSponsor,
SponsorUid: strconv.Itoa(int(updateCooperationProjectCommand.CooperationProjectSponsor)),
PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)),
CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription,
Attachment: images,
... ...
... ... @@ -7,7 +7,7 @@ import (
)
type AuthController struct {
baseController
BaseController
}
func (controller *AuthController) Login() {
... ...
... ... @@ -7,11 +7,11 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type baseController struct {
type BaseController struct {
beego.BaseController
}
func (controller *baseController) returnPageListData(count int64, data interface{}, err error, pageNumber int) {
func (controller *BaseController) ReturnPageListData(count int64, data interface{}, err error, pageNumber int) {
dataMap := map[string]interface{}{
"grid": map[string]interface{}{
"total": count,
... ... @@ -22,7 +22,7 @@ func (controller *baseController) returnPageListData(count int64, data interface
controller.Response(dataMap, err)
}
func (controller *baseController) returnListData(count int64, data interface{}, err error) {
func (controller *BaseController) ReturnListData(count int64, data interface{}, err error) {
dataMap := map[string]interface{}{
"total": count,
//"pageNumber": pageNumber,
... ... @@ -31,23 +31,23 @@ func (controller *baseController) returnListData(count int64, data interface{},
controller.Response(dataMap, err)
}
func (controller *baseController) GetUserId() int64 {
func (controller *BaseController) GetUserId() int64 {
return 1
}
func (controller *baseController) GetCompanyId() int64 {
func (controller *BaseController) GetCompanyId() int64 {
return 1
}
func (controller *baseController) GetUserBaseId() int64 {
func (controller *BaseController) GetUserBaseId() int64 {
return 1
}
func (controller *baseController) GetOrgId() int64 {
func (controller *BaseController) GetOrgId() int64 {
return 1
}
func (controller *baseController) GetOperator() domain.Operator {
func (controller *BaseController) GetOperator() domain.Operator {
token := controller.Ctx.Input.Header("X-Mmm-Accesstoken")
loginToken := &domain.LoginToken{}
err := loginToken.ParseToken(token)
... ...
package mobile_client
import (
"github.com/linmadan/egglib-go/utils/json"
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type baseController struct {
beego.BaseController
}
func (controller *baseController) returnPageListData(count int64, data interface{}, err error, pageNumber int) {
dataMap := map[string]interface{}{
"grid": map[string]interface{}{
"total": count,
//"pageNumber": pageNumber,
"list": data,
},
}
controller.Response(dataMap, err)
}
func (controller *baseController) returnListData(count int64, data interface{}, err error) {
dataMap := map[string]interface{}{
"total": count,
//"pageNumber": pageNumber,
"list": data,
}
controller.Response(dataMap, err)
}
func (controller *baseController) GetUserId() int64 {
return 1
}
func (controller *baseController) GetCompanyId() int64 {
return 1
}
func (controller *baseController) GetUserBaseId() int64 {
return 1
}
func (controller *baseController) GetOrgId() int64 {
return 1
}
func (controller *baseController) GetOperator() domain.Operator {
token := controller.Ctx.Input.Header("X-Mmm-Accesstoken")
loginToken := &domain.LoginToken{}
err := loginToken.ParseToken(token)
if err != nil {
log.Logger.Error(err.Error())
}
op := domain.Operator{
UserId: loginToken.UserId,
CompanyId: loginToken.CompanyId,
OrgId: loginToken.OrgId,
UserBaseId: loginToken.UserBaseId,
Phone: loginToken.Account,
Token: token,
}
// TODO:测试数据后期删除
if op.UserId == 0 {
op.UserId = 9
op.CompanyId = 23
op.OrgId = 45
op.UserBaseId = 5
}
// TODO:打印测试日志
log.Logger.Debug("operator " + json.MarshalToString(op))
return op
}
package mobile_client
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers"
)
type baseController struct {
controllers.BaseController
}
//func (controller *baseController) ReturnPageListData(count int64, data interface{}, err error, pageNumber int) {
// dataMap := map[string]interface{}{
// "grid": map[string]interface{}{
// "total": count,
// //"pageNumber": pageNumber,
// "list": data,
// },
// }
// controller.Response(dataMap, err)
//}
//
//func (controller *baseController) ReturnListData(count int64, data interface{}, err error) {
// dataMap := map[string]interface{}{
// "total": count,
// //"pageNumber": pageNumber,
// "list": data,
// }
// controller.Response(dataMap, err)
//}
//
//func (controller *baseController) GetUserId() int64 {
// return 1
//}
//
//func (controller *baseController) GetCompanyId() int64 {
// return 1
//}
//
//func (controller *baseController) GetUserBaseId() int64 {
// return 1
//}
//
//func (controller *baseController) GetOrgId() int64 {
// return 1
//}
//
//func (controller *baseController) GetOperator() domain.Operator {
// token := controller.Ctx.Input.Header("X-Mmm-Accesstoken")
// loginToken := &domain.LoginToken{}
// err := loginToken.ParseToken(token)
// if err != nil {
// log.Logger.Error(err.Error())
// }
// op := domain.Operator{
// UserId: loginToken.UserId,
// CompanyId: loginToken.CompanyId,
// OrgId: loginToken.OrgId,
// UserBaseId: loginToken.UserBaseId,
// Phone: loginToken.Account,
// Token: token,
// }
// // TODO:测试数据后期删除
// if op.UserId == 0 {
// op.UserId = 9
// op.CompanyId = 23
// op.OrgId = 45
// op.UserBaseId = 5
// }
// // TODO:打印测试日志
// log.Logger.Debug("operator " + json.MarshalToString(op))
// return op
//}
... ...
... ... @@ -3,6 +3,7 @@ package mobile_client
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
// Controller
... ... @@ -180,6 +181,7 @@ func (controller *CooperationController) UpdateCooperationProject() {
controller.Response(nil, err)
return
}
cmd.CooperationProjectId = controller.GetString(":projectId")
cmd.Operator = controller.GetOperator()
data, err := svr.UpdateCooperationProject(cmd)
controller.Response(data, err)
... ... @@ -208,7 +210,7 @@ func (controller *CooperationController) SearchCooperationProject() {
}
cmd.Operator = controller.GetOperator()
total, data, err := svr.SearchCooperationProject(cmd)
controller.returnPageListData(int64(total), data, err, cmd.PageNumber)
controller.ReturnPageListData(int64(total), data, err, cmd.PageNumber)
}
func (controller *CooperationController) PersonSearchCooperationProject() {
... ... @@ -230,8 +232,7 @@ func (controller *CooperationController) CreditAccountSearch() {
cmd := &command.CreditAccountSearchCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.CreditAccountSearch(cmd)
... ... @@ -243,8 +244,7 @@ func (controller *CooperationController) CreditAccountGet() {
cmd := &command.CreditAccountGetCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.CreditAccountGet(cmd)
... ... @@ -256,8 +256,7 @@ func (controller *CooperationController) CreditAccountPay() {
cmd := &command.CreditAccountPayCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.CreditAccountPay(cmd)
... ... @@ -269,8 +268,7 @@ func (controller *CooperationController) CreditAccountPaySearch() {
cmd := &command.CreditAccountPaySearchCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.CreditAccountPaySearch(cmd)
... ...
package web_client
import (
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type baseController struct {
beego.BaseController
}
func (controller *baseController) returnPageListData(count int64, data interface{}, err error, pageNumber int) {
dataMap := map[string]interface{}{
"grid": map[string]interface{}{
"total": count,
"list": data,
},
}
controller.Response(dataMap, err)
}
func (controller *baseController) returnListData(count int64, data interface{}, err error) {
dataMap := map[string]interface{}{
"total": count,
"list": data,
}
controller.Response(dataMap, err)
}
func (controller *baseController) GetOperator() domain.Operator {
token := controller.Ctx.Input.Header("X-Mmm-Accesstoken")
loginToken := &domain.LoginToken{}
err := loginToken.ParseToken(token)
if err != nil {
log.Logger.Error(err.Error())
}
op := domain.Operator{
UserId: loginToken.UserId,
CompanyId: loginToken.CompanyId,
OrgId: loginToken.OrgId,
UserBaseId: loginToken.UserBaseId,
Phone: loginToken.Account,
Token: token,
}
// TODO:测试数据后期删除
if op.UserId == 0 {
op.UserId = 9
op.CompanyId = 23
op.OrgId = 45
op.UserBaseId = 5
}
return op
}
package web_client
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers"
)
type baseController struct {
controllers.BaseController
}
//func (controller *baseController) ReturnPageListData(count int64, data interface{}, err error, pageNumber int) {
// dataMap := map[string]interface{}{
// "grid": map[string]interface{}{
// "total": count,
// "list": data,
// },
// }
// controller.Response(dataMap, err)
//}
//
//func (controller *baseController) ReturnListData(count int64, data interface{}, err error) {
// dataMap := map[string]interface{}{
// "total": count,
// "list": data,
// }
// controller.Response(dataMap, err)
//}
//
//func (controller *baseController) GetOperator() domain.Operator {
// token := controller.Ctx.Input.Header("X-Mmm-Accesstoken")
// loginToken := &domain.LoginToken{}
// err := loginToken.ParseToken(token)
// if err != nil {
// log.Logger.Error(err.Error())
// }
// op := domain.Operator{
// UserId: loginToken.UserId,
// CompanyId: loginToken.CompanyId,
// OrgId: loginToken.OrgId,
// UserBaseId: loginToken.UserBaseId,
// Phone: loginToken.Account,
// Token: token,
// }
// // TODO:测试数据后期删除
// if op.UserId == 0 {
// op.UserId = 9
// op.CompanyId = 23
// op.OrgId = 45
// op.UserBaseId = 5
// }
// return op
//}
... ...
... ... @@ -29,7 +29,7 @@ func (controller *CooperationApplicationController) ListCooperationApplication()
}
listCooperationApplicationQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationApplicationService.ListCooperationApplication(listCooperationApplicationQuery)
controller.returnPageListData(cnt, data, err, listCooperationApplicationQuery.PageNumber)
controller.ReturnPageListData(cnt, data, err, listCooperationApplicationQuery.PageNumber)
}
func (controller *CooperationApplicationController) AuditCooperationApplication() {
... ...
... ... @@ -69,7 +69,7 @@ func (controller *CooperationModeController) SearchCooperationMode() {
}
listCooperationModeQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationModeService.ListCooperationMode(listCooperationModeQuery)
controller.returnPageListData(cnt, data, err, listCooperationModeQuery.PageNumber)
controller.ReturnPageListData(cnt, data, err, listCooperationModeQuery.PageNumber)
}
func (controller *CooperationModeController) ListCooperationMode() {
... ... @@ -83,7 +83,7 @@ func (controller *CooperationModeController) ListCooperationMode() {
listCooperationModeQuery.PageNumber = 1
listCooperationModeQuery.PageSize = 999
cnt, data, err := cooperationModeService.ListCooperationMode(listCooperationModeQuery)
controller.returnListData(cnt, data, err)
controller.ReturnListData(cnt, data, err)
}
func (controller *CooperationModeController) EnableCooperationMode() {
... ...
... ... @@ -56,7 +56,7 @@ func (controller *CooperationProjectController) ListCooperationProject() {
}
listCooperationProjectQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationProjectService.ListCooperationProject(listCooperationProjectQuery)
controller.returnPageListData(cnt, data, err, listCooperationProjectQuery.PageNumber)
controller.ReturnPageListData(cnt, data, err, listCooperationProjectQuery.PageNumber)
}
func (controller *CooperationProjectController) EndCooperationProject() {
... ...
... ... @@ -66,5 +66,5 @@ func (controller *DividendsOrderController) SearchDividendsOrder() {
}
searchDividendsOrderQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsOrderService.SearchDividendsOrder(searchDividendsOrderQuery)
controller.returnPageListData(int64(cnt), data, err, searchDividendsOrderQuery.PageNumber)
controller.ReturnPageListData(int64(cnt), data, err, searchDividendsOrderQuery.PageNumber)
}
... ...
... ... @@ -68,5 +68,5 @@ func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder
}
searchDividendsReturnedOrderQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery)
controller.returnPageListData(int64(cnt), data, err, searchDividendsReturnedOrderQuery.PageNumber)
controller.ReturnPageListData(int64(cnt), data, err, searchDividendsReturnedOrderQuery.PageNumber)
}
... ...
... ... @@ -20,7 +20,7 @@ func (controller *NoticeSettingController) NoticeSettingList() {
}
noticeSettingListQuery.Operator = controller.GetOperator()
cnt, data, err := noticeSettingService.NoticeSettingList(noticeSettingListQuery)
controller.returnPageListData(cnt, data, err, noticeSettingListQuery.PageNumber)
controller.ReturnPageListData(cnt, data, err, noticeSettingListQuery.PageNumber)
}
func (controller *NoticeSettingController) NoticeSettingUpdate() {
... ...
... ... @@ -46,7 +46,7 @@ func (controller *RolesController) RoleList() {
}
roleListQuery.Operator = controller.GetOperator()
cnt, data, err := rolesService.RoleList(roleListQuery)
controller.returnPageListData(cnt, data, err, roleListQuery.PageNumber)
controller.ReturnPageListData(cnt, data, err, roleListQuery.PageNumber)
}
func (controller *RolesController) RoleGet() {
... ...
... ... @@ -36,7 +36,7 @@ func (controller *UsersController) CompanyUserList() {
controller.Unmarshal(companyUserListQuery)
companyUserListQuery.Operator = controller.GetOperator()
cnt, data, err := usersService.CompanyUserList(companyUserListQuery)
controller.returnPageListData(cnt, data, err, companyUserListQuery.PageNumber)
controller.ReturnPageListData(cnt, data, err, companyUserListQuery.PageNumber)
}
func (controller *UsersController) CompanyUserGet() {
... ... @@ -93,7 +93,7 @@ func (controller *UsersController) CooperationUserList() {
controller.Unmarshal(cooperationUserListQuery)
cooperationUserListQuery.Operator = controller.GetOperator()
cnt, data, err := usersService.CooperationUserList(cooperationUserListQuery)
controller.returnPageListData(cnt, data, err, cooperationUserListQuery.PageNumber)
controller.ReturnPageListData(cnt, data, err, cooperationUserListQuery.PageNumber)
}
func (controller *UsersController) CooperationUserGet() {
... ... @@ -131,7 +131,7 @@ func (controller *UsersController) SelectorCompanyOrg() {
controller.Unmarshal(selectorQuery)
selectorQuery.Operator = controller.GetOperator()
cnt, data, err := usersService.SelectorCompanyOrg(selectorQuery)
controller.returnPageListData(cnt, data, err, selectorQuery.PageNumber)
controller.ReturnPageListData(cnt, data, err, selectorQuery.PageNumber)
}
//SelectorCompanyRole 角色选择表
... ... @@ -141,7 +141,7 @@ func (controller *UsersController) SelectorCompanyRole() {
controller.Unmarshal(selectorQuery)
selectorQuery.Operator = controller.GetOperator()
cnt, data, err := usersService.SelectorCompanyRole(selectorQuery)
controller.returnPageListData(cnt, data, err, selectorQuery.PageNumber)
controller.ReturnPageListData(cnt, data, err, selectorQuery.PageNumber)
}
//CompanyOrgSelector 全组织部门选择表
... ...