作者 linmadan

重构素币功能,添加统计项

此 diff 太大无法显示。
swagger: "2.0"
info:
title: ""
description: 买买买价值系统
contact:
name: linmadan
email: 772181827@qq.com
version: 0.0.1
consumes:
- application/json
- application/xml
produces:
- application/json
- application/xml
paths:
/api/business/index:
post:
tags:
- unifiedUserCenter
summary: 同步企业员工回调
description: 同步企业员工回调
operationId: unifiedUserCenter#syncEmployeeCallback
parameters:
- name: SyncEmployeeCallbackRequestBody
in: body
required: true
schema:
$ref: '#/definitions/UnifiedUserCenterSyncEmployeeCallbackRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/UnifiedUserCenterSyncEmployeeCallbackResponseBody'
schemes:
- http
/config/bid-time-matchs:
get:
tags:
- config
summary: 返回竞标时间字典列表(1全部,2已截止,3未截止)
description: 返回竞标时间字典列表(1全部,2已截止,3未截止)
operationId: config#listBidTimeMatch
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListBidTimeMatchResponseBody'
schemes:
- http
/config/customer-values:
get:
tags:
- config
summary: 返回客户价值字典列表
description: 返回客户价值字典列表
operationId: config#listCustomerValue
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListCustomerValueResponseBody'
schemes:
- http
/config/employee-permissions:
get:
tags:
- config
summary: 返回员工权限字典列表(1任务管理,2素币管理,3成员管理)
description: 返回员工权限字典列表(1任务管理,2素币管理,3成员管理)
operationId: config#listEmployeePermission
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListEmployeePermissionResponseBody'
schemes:
- http
/config/reference-resource-types:
get:
tags:
- config
summary: 返回任务引用资源类型字典列表
description: 返回任务引用资源类型字典列表
operationId: config#listReferenceResourceType
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListReferenceResourceTypeResponseBody'
schemes:
- http
/config/task-natures:
get:
tags:
- config
summary: 返回任务性质字典列表
description: 返回任务性质字典列表
operationId: config#listTaskNature
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListTaskNatureResponseBody'
schemes:
- http
/config/task-statuses:
get:
tags:
- config
summary: 返回任务状态字典列表
description: 返回任务状态字典列表
operationId: config#listTaskStatus
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListTaskStatusResponseBody'
schemes:
- http
/config/task-types:
get:
tags:
- config
summary: 返回任务类型字典列表
description: 返回任务类型字典列表
operationId: config#listTaskType
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListTaskTypeResponseBody'
schemes:
- http
/customer-values:
get:
tags:
- customerValue
summary: 返回客户价值列表
description: 返回客户价值列表
operationId: customerValue#listCustomerValue
parameters:
- name: companyId
in: query
description: 公司ID
required: false
type: integer
- name: customerValueName
in: query
description: 客户价值名称
required: false
type: string
- name: customerValueNameMatch
in: query
description: 客户价值名称匹配
required: false
type: string
- name: offset
in: query
description: 查询偏离量
required: false
type: integer
- name: limit
in: query
description: 查询限制
required: false
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/CustomerValueListCustomerValueResponseBody'
schemes:
- http
post:
tags:
- customerValue
summary: 创建客户价值
description: 创建客户价值
operationId: customerValue#createCustomerValue
parameters:
- name: CreateCustomerValueRequestBody
in: body
required: true
schema:
$ref: '#/definitions/CustomerValueCreateCustomerValueRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/CustomerValueCreateCustomerValueResponseBody'
schemes:
- http
/customer-values/{customerValueId}:
get:
tags:
- customerValue
summary: 返回客户价值
description: 返回客户价值
operationId: customerValue#getCustomerValue
parameters:
- name: customerValueId
in: path
description: 客户价值ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/CustomerValueGetCustomerValueResponseBody'
schemes:
- http
put:
tags:
- customerValue
summary: 更新客户价值
description: 更新客户价值
operationId: customerValue#updateCustomerValue
parameters:
- name: customerValueId
in: path
description: 客户价值ID
required: true
type: integer
- name: UpdateCustomerValueRequestBody
in: body
required: true
schema:
$ref: '#/definitions/CustomerValueUpdateCustomerValueRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/CustomerValueUpdateCustomerValueResponseBody'
schemes:
- http
delete:
tags:
- customerValue
summary: 移除客户价值
description: 移除客户价值
operationId: customerValue#removeCustomerValue
parameters:
- name: customerValueId
in: path
description: 客户价值ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/CustomerValueRemoveCustomerValueResponseBody'
schemes:
- http
/employees:
get:
tags:
- employee
summary: 返回员工列表
description: 返回员工列表
operationId: employee#listEmployee
parameters:
- name: companyId
in: query
description: 公司ID
required: false
type: integer
- name: employeeNameMatch
in: query
description: 员工姓名匹配
required: false
type: string
- name: offset
in: query
description: 查询偏离量
required: false
type: integer
- name: limit
in: query
description: 查询限制
required: false
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/EmployeeListEmployeeResponseBody'
schemes:
- http
post:
tags:
- employee
summary: 创建新员工
description: 创建新员工
operationId: employee#createEmployee
parameters:
- name: CreateEmployeeRequestBody
in: body
required: true
schema:
$ref: '#/definitions/EmployeeCreateEmployeeRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/EmployeeCreateEmployeeResponseBody'
schemes:
- http
/employees/{uid}:
get:
tags:
- employee
summary: 返回员工
description: 返回员工
operationId: employee#getEmployee
parameters:
- name: uid
in: path
description: 统一用户UID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/EmployeeGetEmployeeResponseBody'
schemes:
- http
put:
tags:
- employee
summary: 更新员工
description: 更新员工
operationId: employee#updateEmployee
parameters:
- name: uid
in: path
description: 统一用户UID
required: true
type: integer
- name: UpdateEmployeeRequestBody
in: body
required: true
schema:
$ref: '#/definitions/EmployeeUpdateEmployeeRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/EmployeeUpdateEmployeeResponseBody'
schemes:
- http
delete:
tags:
- employee
summary: 移除员工
description: 移除员工
operationId: employee#removeEmployee
parameters:
- name: uid
in: path
description: 统一用户UID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/EmployeeRemoveEmployeeResponseBody'
schemes:
- http
/notifications:
get:
tags:
- notification
summary: 返回发送出的通知列表
description: 返回发送出的通知列表
operationId: notification#listSentNotification
parameters:
- name: receiverId
in: query
description: 通知接收者Uid
required: false
type: integer
- name: notificationType
in: query
description: 通知类型
required: false
type: integer
- name: offset
in: query
description: 查询偏离量
required: false
type: integer
- name: limit
in: query
description: 查询限制
required: false
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/NotificationListSentNotificationResponseBody'
schemes:
- http
/notifications/read:
post:
tags:
- notification
summary: 读取发送出的通知
description: 读取发送出的通知
operationId: notification#readSentNotification
parameters:
- name: ReadSentNotificationRequestBody
in: body
required: true
schema:
$ref: '#/definitions/NotificationReadSentNotificationRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/NotificationReadSentNotificationResponseBody'
schemes:
- http
/notifications/read-all:
post:
tags:
- notification
summary: 读取全部为读取的发送出的通知
description: 读取全部为读取的发送出的通知
operationId: notification#readAllUnReadSentNotification
parameters:
- name: ReadAllUnReadSentNotificationRequestBody
in: body
required: true
schema:
$ref: '#/definitions/NotificationReadAllUnReadSentNotificationRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/NotificationReadAllUnReadSentNotificationResponseBody'
schemes:
- http
/off-task-records/{offTaskRecordId}:
get:
tags:
- offTaskRecord
summary: 返回关闭任务记录
description: 返回关闭任务记录
operationId: offTaskRecord#getOffTaskRecord
parameters:
- name: offTaskRecordId
in: path
description: 关闭任务记录ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/OffTaskRecordGetOffTaskRecordResponseBody'
schemes:
- http
/off-task-records/search-off-task-record:
post:
tags:
- offTaskRecord
summary: 搜索关闭任务记录
description: 搜索关闭任务记录
operationId: offTaskRecord#searchOffTaskRecord
parameters:
- name: SearchOffTaskRecordRequestBody
in: body
required: true
schema:
$ref: '#/definitions/OffTaskRecordSearchOffTaskRecordRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/OffTaskRecordSearchOffTaskRecordResponseBody'
schemes:
- http
/project-belongs:
get:
tags:
- projectBelong
summary: 返回项目归属列表
description: 返回项目归属列表
operationId: projectBelong#listProjectBelong
parameters:
- name: companyId
in: query
description: 公司ID
required: false
type: integer
- name: projectBelongName
in: query
description: 项目归属名称
required: false
type: string
- name: projectBelongNameMatch
in: query
description: 项目归属名称匹配
required: false
type: string
- name: offset
in: query
description: 查询偏离量
required: false
type: integer
- name: limit
in: query
description: 查询限制
required: false
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ProjectBelongListProjectBelongResponseBody'
schemes:
- http
post:
tags:
- projectBelong
summary: 创建项目归属
description: 创建项目归属
operationId: projectBelong#createProjectBelong
parameters:
- name: CreateProjectBelongRequestBody
in: body
required: true
schema:
$ref: '#/definitions/ProjectBelongCreateProjectBelongRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ProjectBelongCreateProjectBelongResponseBody'
schemes:
- http
/project-belongs/{projectBelongId}:
get:
tags:
- projectBelong
summary: 返回项目归属
description: 返回项目归属
operationId: projectBelong#getProjectBelong
parameters:
- name: projectBelongId
in: path
description: 项目归属ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ProjectBelongGetProjectBelongResponseBody'
schemes:
- http
put:
tags:
- projectBelong
summary: 更新项目归属
description: 更新项目归属
operationId: projectBelong#updateProjectBelong
parameters:
- name: projectBelongId
in: path
description: 项目归属ID
required: true
type: integer
- name: UpdateProjectBelongRequestBody
in: body
required: true
schema:
$ref: '#/definitions/ProjectBelongUpdateProjectBelongRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ProjectBelongUpdateProjectBelongResponseBody'
schemes:
- http
delete:
tags:
- projectBelong
summary: 移除项目归属
description: 移除项目归属
operationId: projectBelong#removeProjectBelong
parameters:
- name: projectBelongId
in: path
description: 项目归属ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ProjectBelongRemoveProjectBelongResponseBody'
schemes:
- http
/reject-task-records/{rejectTaskRecordId}:
get:
tags:
- rejectTaskRecord
summary: 返回关闭任务记录
description: 返回关闭任务记录
operationId: rejectTaskRecord#getRejectTaskRecord
parameters:
- name: rejectTaskRecordId
in: path
description: 关闭任务记录ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/RejectTaskRecordGetRejectTaskRecordResponseBody'
schemes:
- http
/reject-task-records/search-reject-task-record:
post:
tags:
- rejectTaskRecord
summary: 搜索驳回任务记录
description: 搜索驳回任务记录
operationId: rejectTaskRecord#searchRejectTaskRecord
parameters:
- name: SearchRejectTaskRecordRequestBody
in: body
required: true
schema:
$ref: '#/definitions/RejectTaskRecordSearchRejectTaskRecordRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/RejectTaskRecordSearchRejectTaskRecordResponseBody'
schemes:
- http
/statistics/person-su-money:
post:
tags:
- statistics
summary: 获取个人素币统计
description: 获取个人素币统计
operationId: statistics#personSuMoneyStatistics
parameters:
- name: PersonSuMoneyStatisticsRequestBody
in: body
required: true
schema:
$ref: '#/definitions/StatisticsPersonSuMoneyStatisticsRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/StatisticsPersonSuMoneyStatisticsResponseBody'
schemes:
- http
/statistics/person-task:
post:
tags:
- statistics
summary: 获取个人任务统计
description: 获取个人任务统计
operationId: statistics#personTaskStatistics
parameters:
- name: PersonTaskStatisticsRequestBody
in: body
required: true
schema:
$ref: '#/definitions/StatisticsPersonTaskStatisticsRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/StatisticsPersonTaskStatisticsResponseBody'
schemes:
- http
/statistics/system-task:
post:
tags:
- statistics
summary: 获取系统任务统计
description: 获取系统任务统计
operationId: statistics#systemTaskStatistics
parameters:
- name: SystemTaskStatisticsRequestBody
in: body
required: true
schema:
$ref: '#/definitions/StatisticsSystemTaskStatisticsRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/StatisticsSystemTaskStatisticsResponseBody'
schemes:
- http
/su-money/exchange:
post:
tags:
- suMoney
summary: 素币兑换
description: 素币兑换
operationId: suMoney#exchangeSuMoney
parameters:
- name: ExchangeSuMoneyRequestBody
in: body
required: true
schema:
$ref: '#/definitions/SuMoneyExchangeSuMoneyRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/SuMoneyExchangeSuMoneyResponseBody'
schemes:
- http
/su-money/search-su-money-transaction-record:
post:
tags:
- suMoney
summary: 搜索素币事务记录
description: 搜索素币事务记录
operationId: suMoney#searchSuMoneyTransactionRecord
parameters:
- name: SearchSuMoneyTransactionRecordRequestBody
in: body
required: true
schema:
$ref: '#/definitions/SuMoneySearchSuMoneyTransactionRecordRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/SuMoneySearchSuMoneyTransactionRecordResponseBody'
schemes:
- http
/su-money/su-money-transaction-record-statistics:
post:
tags:
- suMoney
summary: 素币事务记录统计
description: 素币事务记录统计
operationId: suMoney#suMoneyTransactionRecordStatistics
parameters:
- name: SuMoneyTransactionRecordStatisticsRequestBody
in: body
required: true
schema:
$ref: '#/definitions/SuMoneySuMoneyTransactionRecordStatisticsRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/SuMoneySuMoneyTransactionRecordStatisticsResponseBody'
schemes:
- http
/su-money/su-money-transaction-records/{suMoneyTransactionRecordId}:
get:
tags:
- suMoney
summary: 返回素币事务记录
description: 返回素币事务记录
operationId: suMoney#getSuMoneyTransactionRecord
parameters:
- name: suMoneyTransactionRecordId
in: path
description: 素币事务记录ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/SuMoneyGetSuMoneyTransactionRecordResponseBody'
schemes:
- http
/task-natures:
get:
tags:
- taskNature
summary: 返回任务性质列表
description: 返回任务性质列表
operationId: taskNature#listTaskNature
parameters:
- name: companyId
in: query
description: 公司ID
required: false
type: integer
- name: taskNatureName
in: query
description: 任务性质名称
required: false
type: string
- name: taskNatureNameMatch
in: query
description: 任务性质名称匹配
required: false
type: string
- name: offset
in: query
description: 查询偏离量
required: false
type: integer
- name: limit
in: query
description: 查询限制
required: false
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskNatureListTaskNatureResponseBody'
schemes:
- http
post:
tags:
- taskNature
summary: 创建任务性质
description: 创建任务性质
operationId: taskNature#createTaskNature
parameters:
- name: CreateTaskNatureRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskNatureCreateTaskNatureRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskNatureCreateTaskNatureResponseBody'
schemes:
- http
/task-natures/{taskNatureId}:
get:
tags:
- taskNature
summary: 返回任务性质
description: 返回任务性质
operationId: taskNature#getTaskNature
parameters:
- name: taskNatureId
in: path
description: 任务性质ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskNatureGetTaskNatureResponseBody'
schemes:
- http
put:
tags:
- taskNature
summary: 更新任务性质
description: 更新任务性质
operationId: taskNature#updateTaskNature
parameters:
- name: taskNatureId
in: path
description: 任务性质ID
required: true
type: integer
- name: UpdateTaskNatureRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskNatureUpdateTaskNatureRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskNatureUpdateTaskNatureResponseBody'
schemes:
- http
delete:
tags:
- taskNature
summary: 移除任务性质
description: 移除任务性质
operationId: taskNature#removeTaskNature
parameters:
- name: taskNatureId
in: path
description: 任务性质ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskNatureRemoveTaskNatureResponseBody'
schemes:
- http
/tasks:
get:
tags:
- task
summary: 返回任务列表
description: 返回任务列表
operationId: task#listTask
parameters:
- name: companyId
in: query
description: 公司ID
required: false
type: integer
- name: sponsor
in: query
description: 任务发起者UID
required: false
type: integer
format: int64
- name: taskContentMatch
in: query
description: 任务内容匹配
required: false
type: string
- name: taskType
in: query
description: 任务类型
required: false
type: integer
- name: taskStatus
in: query
description: 任务状态
required: false
type: integer
- name: customerValue
in: query
description: 客户价值
required: false
type: array
items:
type: string
collectionFormat: multi
- name: taskNature
in: query
description: 任务性质
required: false
type: string
- name: isRewardTake
in: query
description: 是否悬赏任务
required: false
type: boolean
- name: bidTimeMatch
in: query
description: 竞标时间(1全部,2已截止,3未截止)
required: false
type: integer
- name: receiver
in: query
description: 任务领取人UID
required: false
type: integer
format: int64
- name: participator
in: query
description: 任务参与者UID
required: false
type: integer
format: int64
- name: offset
in: query
description: 查询偏离量
required: false
type: integer
- name: limit
in: query
description: 查询限制
required: false
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskListTaskResponseBody'
schemes:
- http
post:
tags:
- task
summary: 创建新任务
description: 创建新任务
operationId: task#createTask
parameters:
- name: CreateTaskRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskCreateTaskRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskCreateTaskResponseBody'
schemes:
- http
/tasks/{taskId}:
get:
tags:
- task
summary: 返回任务
description: 返回任务
operationId: task#getTask
parameters:
- name: taskId
in: path
description: 任务ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskGetTaskResponseBody'
schemes:
- http
put:
tags:
- task
summary: 更新任务
description: 更新任务
operationId: task#updateTask
parameters:
- name: taskId
in: path
description: 任务ID
required: true
type: integer
- name: UpdateTaskRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskUpdateTaskRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskUpdateTaskResponseBody'
schemes:
- http
delete:
tags:
- task
summary: 移除任务
description: 移除任务
operationId: task#removeTask
parameters:
- name: taskId
in: path
description: 任务ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskRemoveTaskResponseBody'
schemes:
- http
/tasks/{taskId}/acceptance:
post:
tags:
- task
summary: 验收任务
description: 验收任务
operationId: task#acceptanceTask
parameters:
- name: taskId
in: path
description: 任务ID
required: true
type: integer
- name: AcceptanceTaskRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskAcceptanceTaskRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskAcceptanceTaskResponseBody'
schemes:
- http
/tasks/{taskId}/apply-complete:
post:
tags:
- task
summary: 申请完成任务
description: 申请完成任务
operationId: task#applyCompleteTask
parameters:
- name: taskId
in: path
description: 任务ID
required: true
type: integer
- name: ApplyCompleteTaskRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskApplyCompleteTaskRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskApplyCompleteTaskResponseBody'
schemes:
- http
/tasks/{taskId}/bid:
post:
tags:
- task
summary: 对任务进行竞标
description: 对任务进行竞标
operationId: task#bidTask
parameters:
- name: taskId
in: path
description: 任务ID
required: true
type: integer
- name: BidTaskRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskBidTaskRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskBidTaskResponseBody'
schemes:
- http
/tasks/{taskId}/choose-successful-bidder:
post:
tags:
- task
summary: 选择竞标任务的中标人
description: 选择竞标任务的中标人
operationId: task#chooseSuccessfulBidder
parameters:
- name: taskId
in: path
description: 任务ID
required: true
type: integer
- name: ChooseSuccessfulBidderRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskChooseSuccessfulBidderRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskChooseSuccessfulBidderResponseBody'
schemes:
- http
/tasks/{taskId}/dff:
post:
tags:
- task
summary: 关闭任务
description: 关闭任务
operationId: task#offTask
parameters:
- name: taskId
in: path
description: 任务ID
required: true
type: integer
- name: OffTaskRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskOffTaskRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskOffTaskResponseBody'
schemes:
- http
/tasks/{taskId}/release:
post:
tags:
- task
summary: 发布任务
description: 发布任务
operationId: task#releaseTask
parameters:
- name: taskId
in: path
description: 任务ID
required: true
type: integer
- name: ReleaseTaskRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskReleaseTaskRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskReleaseTaskResponseBody'
schemes:
- http
/tasks/{taskId}/rob:
post:
tags:
- task
summary: 对任务进行抢单
description: 对任务进行抢单
operationId: task#robTask
parameters:
- name: taskId
in: path
description: 任务ID
required: true
type: integer
- name: RobTaskRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskRobTaskRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskRobTaskResponseBody'
schemes:
- http
/tasks/search:
post:
tags:
- task
summary: 搜索任务
description: 搜索任务
operationId: task#searchTask
parameters:
- name: SearchTaskRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskSearchTaskRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskSearchTaskResponseBody'
schemes:
- http
/tasks/search-off-task-record:
post:
tags:
- task
summary: 搜索关闭任务记录
description: 搜索关闭任务记录
operationId: task#searchOffTaskRecord
parameters:
- name: SearchOffTaskRecordRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskSearchOffTaskRecordRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskSearchOffTaskRecordResponseBody'
schemes:
- http
definitions:
ConfigListBidTimeMatchResponseBody:
title: 'Mediatype identifier: ConfigListBidTimeMatchResponseBody'
type: object
properties:
bidTimeMatchs:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListCustomerValueResponseBody:
title: 'Mediatype identifier: ConfigListCustomerValueResponseBody'
type: object
properties:
customerValues:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListEmployeePermissionResponseBody:
title: 'Mediatype identifier: ConfigListEmployeePermissionResponseBody'
type: object
properties:
employeePermissions:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListReferenceResourceTypeResponseBody:
title: 'Mediatype identifier: ConfigListReferenceResourceTypeResponseBody'
type: object
properties:
referenceResourceTypes:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListTaskNatureResponseBody:
title: 'Mediatype identifier: ConfigListTaskNatureResponseBody'
type: object
properties:
taskNatures:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListTaskStatusResponseBody:
title: 'Mediatype identifier: ConfigListTaskStatusResponseBody'
type: object
properties:
taskStatuses:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListTaskTypeResponseBody:
title: 'Mediatype identifier: ConfigListTaskTypeResponseBody'
type: object
properties:
taskTypes:
type: array
items:
$ref: '#/definitions/configResponseBody'
CustomerValueCreateCustomerValueRequestBody:
title: CustomerValueCreateCustomerValueRequestBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValueName:
type: string
description: 客户价值名称
required:
- customerValueName
CustomerValueCreateCustomerValueResponseBody:
title: 'Mediatype identifier: CustomerValueCreateCustomerValueResponseBody'
type: object
properties:
customerValue:
$ref: '#/definitions/customerValueResponseBody'
CustomerValueGetCustomerValueResponseBody:
title: 'Mediatype identifier: CustomerValueGetCustomerValueResponseBody'
type: object
properties:
customerValue:
$ref: '#/definitions/customerValueResponseBody'
CustomerValueListCustomerValueResponseBody:
title: 'Mediatype identifier: CustomerValueListCustomerValueResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
customerValues:
type: array
items:
$ref: '#/definitions/customerValueResponseBody'
CustomerValueRemoveCustomerValueResponseBody:
title: 'Mediatype identifier: CustomerValueRemoveCustomerValueResponseBody'
type: object
properties:
customerValue:
$ref: '#/definitions/customerValueResponseBody'
CustomerValueUpdateCustomerValueRequestBody:
title: CustomerValueUpdateCustomerValueRequestBody
type: object
properties:
customerValueName:
type: string
description: 客户价值名称
CustomerValueUpdateCustomerValueResponseBody:
title: 'Mediatype identifier: CustomerValueUpdateCustomerValueResponseBody'
type: object
properties:
customerValue:
$ref: '#/definitions/customerValueResponseBody'
EmployeeCreateEmployeeRequestBody:
title: EmployeeCreateEmployeeRequestBody
type: object
properties:
employeeAccount:
type: string
description: 员工账号
employeeAvatarUrl:
type: string
description: 员工头像URL
employeeName:
type: string
description: 员工姓名
uid:
type: integer
description: 统一用户UID
required:
- uid
EmployeeCreateEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeCreateEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
EmployeeGetEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeGetEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
EmployeeListEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeListEmployeeResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
employees:
type: array
items:
$ref: '#/definitions/employeeResponseBody'
EmployeeRemoveEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeRemoveEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
EmployeeUpdateEmployeeRequestBody:
title: EmployeeUpdateEmployeeRequestBody
type: object
properties:
employeeAccount:
type: string
description: 员工账号
employeeAvatarUrl:
type: string
description: 员工头像URL
employeeName:
type: string
description: 员工姓名
permissions:
type: array
items:
type: integer
format: int64
description: 员工权限集合
EmployeeUpdateEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeUpdateEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
NotificationListSentNotificationResponseBody:
title: 'Mediatype identifier: NotificationListSentNotificationResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
sentNotifications:
type: array
items:
$ref: '#/definitions/sentNotificationResponseBody'
NotificationReadAllUnReadSentNotificationRequestBody:
title: NotificationReadAllUnReadSentNotificationRequestBody
type: object
properties:
receiverId:
type: integer
description: 通知接收者Uid
required:
- receiverId
NotificationReadAllUnReadSentNotificationResponseBody:
title: 'Mediatype identifier: NotificationReadAllUnReadSentNotificationResponseBody'
type: object
properties:
readCount:
type: integer
description: 读取消息数
format: int64
NotificationReadSentNotificationRequestBody:
title: NotificationReadSentNotificationRequestBody
type: object
properties:
sentNotificationId:
type: integer
description: 发送出的通知ID
required:
- sentNotificationId
NotificationReadSentNotificationResponseBody:
title: 'Mediatype identifier: NotificationReadSentNotificationResponseBody'
type: object
properties:
sentNotification:
$ref: '#/definitions/sentNotificationResponseBody'
OffTaskRecordGetOffTaskRecordResponseBody:
title: 'Mediatype identifier: OffTaskRecordGetOffTaskRecordResponseBody'
type: object
properties:
offTaskRecord:
$ref: '#/definitions/offTaskRecordResponseBody'
OffTaskRecordSearchOffTaskRecordRequestBody:
title: OffTaskRecordSearchOffTaskRecordRequestBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValue:
type: array
items:
type: string
description: 客户价值
limit:
type: integer
description: 查询限制
format: int64
offEndTime:
type: string
description: 关闭任务时间区间-截止时间
format: datetime
offStartTime:
type: string
description: 关闭任务时间区间-开始时间
format: datetime
offset:
type: integer
description: 查询偏离量
format: int64
taskContentMatch:
type: string
description: 任务内容匹配
taskNature:
type: string
description: 任务性质
taskType:
type: integer
description: 任务类型
format: int64
OffTaskRecordSearchOffTaskRecordResponseBody:
title: 'Mediatype identifier: OffTaskRecordSearchOffTaskRecordResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
offTaskRecords:
type: array
items:
$ref: '#/definitions/offTaskRecordResponseBody'
ProjectBelongCreateProjectBelongRequestBody:
title: ProjectBelongCreateProjectBelongRequestBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
projectBelongName:
type: string
description: 项目归属名称
required:
- projectBelongName
ProjectBelongCreateProjectBelongResponseBody:
title: 'Mediatype identifier: ProjectBelongCreateProjectBelongResponseBody'
type: object
properties:
projectBelong:
$ref: '#/definitions/projectBelongResponseBody'
ProjectBelongGetProjectBelongResponseBody:
title: 'Mediatype identifier: ProjectBelongGetProjectBelongResponseBody'
type: object
properties:
projectBelong:
$ref: '#/definitions/projectBelongResponseBody'
ProjectBelongListProjectBelongResponseBody:
title: 'Mediatype identifier: ProjectBelongListProjectBelongResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
projectBelongs:
type: array
items:
$ref: '#/definitions/projectBelongResponseBody'
ProjectBelongRemoveProjectBelongResponseBody:
title: 'Mediatype identifier: ProjectBelongRemoveProjectBelongResponseBody'
type: object
properties:
projectBelong:
$ref: '#/definitions/projectBelongResponseBody'
ProjectBelongUpdateProjectBelongRequestBody:
title: ProjectBelongUpdateProjectBelongRequestBody
type: object
properties:
projectBelongName:
type: string
description: 项目归属名称
ProjectBelongUpdateProjectBelongResponseBody:
title: 'Mediatype identifier: ProjectBelongUpdateProjectBelongResponseBody'
type: object
properties:
projectBelong:
$ref: '#/definitions/projectBelongResponseBody'
RejectTaskRecordGetRejectTaskRecordResponseBody:
title: 'Mediatype identifier: RejectTaskRecordGetRejectTaskRecordResponseBody'
type: object
properties:
rejectTaskRecord:
$ref: '#/definitions/rejectTaskRecordResponseBody'
RejectTaskRecordSearchRejectTaskRecordRequestBody:
title: RejectTaskRecordSearchRejectTaskRecordRequestBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValue:
type: array
items:
type: integer
format: int64
description: 客户价值
limit:
type: integer
description: 查询限制
format: int64
offset:
type: integer
description: 查询偏离量
format: int64
rejectEndTime:
type: string
description: 驳回任务时间区间-截止时间
format: datetime
rejectStartTime:
type: string
description: 驳回任务时间区间-开始时间
format: datetime
taskContentMatch:
type: string
description: 任务内容匹配
taskNature:
type: integer
description: 任务性质
format: int64
taskType:
type: integer
description: 任务类型
format: int64
RejectTaskRecordSearchRejectTaskRecordResponseBody:
title: 'Mediatype identifier: RejectTaskRecordSearchRejectTaskRecordResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
rejectTaskRecords:
type: array
items:
$ref: '#/definitions/rejectTaskRecordResponseBody'
StatisticsPersonSuMoneyStatisticsRequestBody:
title: StatisticsPersonSuMoneyStatisticsRequestBody
type: object
properties:
uid:
type: integer
description: 统一用户UID
required:
- uid
StatisticsPersonSuMoneyStatisticsResponseBody:
title: 'Mediatype identifier: StatisticsPersonSuMoneyStatisticsResponseBody'
type: object
properties:
currentSuMoney:
type: number
description: 当前素币数
format: double
incomeSuMoney:
type: number
description: 任务奖励素币总数
format: double
incomeSuMoneyOfYesterday:
type: number
description: 昨日任务奖励素币数
format: double
StatisticsPersonTaskStatisticsRequestBody:
title: StatisticsPersonTaskStatisticsRequestBody
type: object
properties:
uid:
type: integer
description: 统一用户UID
required:
- uid
StatisticsPersonTaskStatisticsResponseBody:
title: 'Mediatype identifier: StatisticsPersonTaskStatisticsResponseBody'
type: object
properties:
personTaskStatistics:
$ref: '#/definitions/personTaskStatisticsResponseBody'
StatisticsSystemTaskStatisticsRequestBody:
title: StatisticsSystemTaskStatisticsRequestBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
StatisticsSystemTaskStatisticsResponseBody:
title: 'Mediatype identifier: StatisticsSystemTaskStatisticsResponseBody'
type: object
properties:
completed:
type: integer
description: 已完成的任务数
format: int64
released:
type: integer
description: 发布的任务数
format: int64
underway:
type: integer
description: 进行中的任务数
format: int64
SuMoneyExchangeSuMoneyRequestBody:
title: SuMoneyExchangeSuMoneyRequestBody
type: object
properties:
exchangeDescription:
type: string
description: 兑换描述
required:
- exchangeDescription
operator:
type: integer
description: 操作人UID
format: int64
suMoney:
type: number
description: 素币值
required:
- suMoney
uid:
type: integer
description: 兑换人UID
required:
- uid
SuMoneyExchangeSuMoneyResponseBody:
title: 'Mediatype identifier: SuMoneyExchangeSuMoneyResponseBody'
type: object
properties:
suMoneyTransactionRecord:
$ref: '#/definitions/suMoneyTransactionRecordResponseBody'
SuMoneyGetSuMoneyTransactionRecordResponseBody:
title: 'Mediatype identifier: SuMoneyGetSuMoneyTransactionRecordResponseBody'
type: object
properties:
suMoneyTransactionRecord:
$ref: '#/definitions/suMoneyTransactionRecordResponseBody'
SuMoneySearchSuMoneyTransactionRecordRequestBody:
title: SuMoneySearchSuMoneyTransactionRecordRequestBody
type: object
properties:
limit:
type: integer
description: 查询限制
format: int64
offset:
type: integer
description: 查询偏离量
format: int64
operator:
type: integer
description: 操作人UID
format: int64
recordType:
type: integer
description: 记录类型(1兑换,2任务奖励,3增加,4扣除)
required:
- recordType
transactionEndTime:
type: string
description: 事务时间区间-截止时间
format: datetime
transactionStartTime:
type: string
description: 事务时间区间-开始时间
format: datetime
uid:
type: integer
description: 统一用户UID
required:
- uid
SuMoneySearchSuMoneyTransactionRecordResponseBody:
title: 'Mediatype identifier: SuMoneySearchSuMoneyTransactionRecordResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
suMoneyTransactionRecords:
type: array
items:
$ref: '#/definitions/suMoneyTransactionRecordResponseBody'
SuMoneySuMoneyTransactionRecordStatisticsRequestBody:
title: SuMoneySuMoneyTransactionRecordStatisticsRequestBody
type: object
properties:
transactionEndTime:
type: string
description: 事务时间区间-截止时间
format: datetime
transactionStartTime:
type: string
description: 事务时间区间-开始时间
format: datetime
uid:
type: integer
description: 统一用户UID
required:
- uid
SuMoneySuMoneyTransactionRecordStatisticsResponseBody:
title: 'Mediatype identifier: SuMoneySuMoneyTransactionRecordStatisticsResponseBody'
type: object
properties:
expendSuMoney:
type: number
description: 支出素币
required:
- expendSuMoney
incomeSuMoney:
type: number
description: 收入素币
required:
- incomeSuMoney
TaskAcceptanceTaskRequestBody:
title: TaskAcceptanceTaskRequestBody
type: object
properties:
operator:
type: integer
description: 操作人uid
required:
- operator
participators:
type: array
items:
type: integer
format: int64
description: 任务参与者UID列表
referenceResourceScore:
type: array
items:
$ref: '#/definitions/referenceResourceItemRequestBody'
description: 引用资源解决分
solvePictureUrls:
type: array
items:
type: string
description: 解决图片URL列表
solveReport:
type: string
description: 解决报告
taskPercentage:
type: array
items:
$ref: '#/definitions/taskPercentageItemRequestBody'
description: 任务贡献占比
required:
- taskPercentage
TaskAcceptanceTaskResponseBody:
title: 'Mediatype identifier: TaskAcceptanceTaskResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskApplyCompleteTaskRequestBody:
title: TaskApplyCompleteTaskRequestBody
type: object
properties:
receiver:
type: integer
description: 领取人或者中标人uid
required:
- receiver
TaskApplyCompleteTaskResponseBody:
title: 'Mediatype identifier: TaskApplyCompleteTaskResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskBidTaskRequestBody:
title: TaskBidTaskRequestBody
type: object
properties:
bidder:
type: integer
description: 竞标人uid
required:
- bidder
TaskBidTaskResponseBody:
title: 'Mediatype identifier: TaskBidTaskResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskChooseSuccessfulBidderRequestBody:
title: TaskChooseSuccessfulBidderRequestBody
type: object
properties:
operator:
type: integer
description: 操作人uid
required:
- operator
successfulBidder:
type: integer
description: 中标者uid
required:
- successfulBidder
TaskChooseSuccessfulBidderResponseBody:
title: 'Mediatype identifier: TaskChooseSuccessfulBidderResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskCreateTaskRequestBody:
title: TaskCreateTaskRequestBody
type: object
properties:
acceptanceStandard:
type: string
description: 验收标准
required:
- acceptanceStandard
bidEndTime:
type: string
description: 竞标结束时间
format: datetime
bidStartTime:
type: string
description: 竞标开始时间
format: datetime
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValue:
type: array
items:
type: string
description: 客户价值列表
required:
- customerValue
isRewardTake:
type: boolean
description: 是否悬赏任务
referenceResource:
$ref: '#/definitions/referenceResourceRequestBody'
sponsor:
type: integer
description: 任务发起者uid
required:
- sponsor
suMoney:
type: number
description: 奖励素币
format: double
taskDescription:
type: string
description: 任务描述
required:
- taskDescription
taskName:
type: string
description: 任务名称
required:
- taskName
taskNature:
type: string
description: 任务性质
required:
- taskNature
taskPictureUrls:
type: array
items:
type: string
description: 任务图片URL列表
taskType:
type: integer
description: 任务类型
required:
- taskType
TaskCreateTaskResponseBody:
title: 'Mediatype identifier: TaskCreateTaskResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskGetTaskResponseBody:
title: 'Mediatype identifier: TaskGetTaskResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskListTaskResponseBody:
title: 'Mediatype identifier: TaskListTaskResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
tasks:
type: array
items:
$ref: '#/definitions/taskResponseBody'
TaskNatureCreateTaskNatureRequestBody:
title: TaskNatureCreateTaskNatureRequestBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
taskNatureName:
type: string
description: 任务性质名称
required:
- taskNatureName
TaskNatureCreateTaskNatureResponseBody:
title: 'Mediatype identifier: TaskNatureCreateTaskNatureResponseBody'
type: object
properties:
taskNature:
$ref: '#/definitions/taskNatureResponseBody'
TaskNatureGetTaskNatureResponseBody:
title: 'Mediatype identifier: TaskNatureGetTaskNatureResponseBody'
type: object
properties:
taskNature:
$ref: '#/definitions/taskNatureResponseBody'
TaskNatureListTaskNatureResponseBody:
title: 'Mediatype identifier: TaskNatureListTaskNatureResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
taskNatures:
type: array
items:
$ref: '#/definitions/taskNatureResponseBody'
TaskNatureRemoveTaskNatureResponseBody:
title: 'Mediatype identifier: TaskNatureRemoveTaskNatureResponseBody'
type: object
properties:
taskNature:
$ref: '#/definitions/taskNatureResponseBody'
TaskNatureUpdateTaskNatureRequestBody:
title: TaskNatureUpdateTaskNatureRequestBody
type: object
properties:
taskNatureName:
type: string
description: 任务性质名称
TaskNatureUpdateTaskNatureResponseBody:
title: 'Mediatype identifier: TaskNatureUpdateTaskNatureResponseBody'
type: object
properties:
taskNature:
$ref: '#/definitions/taskNatureResponseBody'
TaskOffTaskRequestBody:
title: TaskOffTaskRequestBody
type: object
properties:
offReason:
type: string
description: 关闭理由
required:
- offReason
operator:
type: integer
description: 操作人uid
required:
- operator
TaskOffTaskResponseBody:
title: 'Mediatype identifier: TaskOffTaskResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskReleaseTaskRequestBody:
title: TaskReleaseTaskRequestBody
type: object
properties:
operator:
type: integer
description: 操作人uid
required:
- operator
TaskReleaseTaskResponseBody:
title: 'Mediatype identifier: TaskReleaseTaskResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskRemoveTaskResponseBody:
title: 'Mediatype identifier: TaskRemoveTaskResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskRobTaskRequestBody:
title: TaskRobTaskRequestBody
type: object
properties:
receiver:
type: integer
description: 领取人uid
required:
- receiver
TaskRobTaskResponseBody:
title: 'Mediatype identifier: TaskRobTaskResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskSearchOffTaskRecordRequestBody:
title: TaskSearchOffTaskRecordRequestBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValue:
type: array
items:
type: string
description: 客户价值
limit:
type: integer
description: 查询限制
format: int64
offEndTime:
type: string
description: 关闭任务时间区间-截止时间
format: datetime
offStartTime:
type: string
description: 关闭任务时间区间-开始时间
format: datetime
offset:
type: integer
description: 查询偏离量
format: int64
taskContentMatch:
type: string
description: 任务内容匹配
taskNature:
type: string
description: 任务性质
taskType:
type: integer
description: 任务类型
format: int64
TaskSearchOffTaskRecordResponseBody:
title: 'Mediatype identifier: TaskSearchOffTaskRecordResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
offTaskRecords:
type: array
items:
$ref: '#/definitions/offTaskRecordResponseBody'
TaskSearchTaskRequestBody:
title: TaskSearchTaskRequestBody
type: object
properties:
bidTimeMatch:
type: integer
description: 竞标时间(1全部,2已截止,3未截止)
format: int64
bidder:
type: integer
description: 竞标参与者UID
format: int64
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValue:
type: array
items:
type: string
description: 客户价值
isFilterCloseStatus:
type: boolean
description: 是否过滤关闭状态任务
isFilterUnReleasedStatus:
type: boolean
description: 是否过滤待发布状态任务
isRewardTake:
type: boolean
description: 是否悬赏任务
limit:
type: integer
description: 查询限制
format: int64
offset:
type: integer
description: 查询偏离量
format: int64
participator:
type: integer
description: 任务参与者UID
format: int64
receiver:
type: integer
description: 任务领取人UID
format: int64
sortByAcceptanceTime:
type: string
description: 按验收方验收时间排序(ASC,DESC)
sortByCompleteTime:
type: string
description: 按完成任务操作时间排序(ASC,DESC)
sortByCreateTime:
type: string
description: 按创建任务时间排序(ASC,DESC)
sortByReceiveTime:
type: string
description: 按领取任务时间排序(ASC,DESC)
sortByReleaseTime:
type: string
description: 按发布任务时间排序(ASC,DESC)
sponsor:
type: integer
description: 任务发起者UID
format: int64
taskContentMatch:
type: string
description: 任务内容匹配
taskNature:
type: string
description: 任务性质
taskStatus:
type: integer
description: 任务状态
format: int64
taskType:
type: integer
description: 任务类型
format: int64
TaskSearchTaskResponseBody:
title: 'Mediatype identifier: TaskSearchTaskResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
tasks:
type: array
items:
$ref: '#/definitions/taskResponseBody'
TaskUpdateTaskRequestBody:
title: TaskUpdateTaskRequestBody
type: object
properties:
acceptanceStandard:
type: string
description: 验收标准
bidEndTime:
type: string
description: 竞标结束时间
format: datetime
bidStartTime:
type: string
description: 竞标开始时间
format: datetime
customerValue:
type: array
items:
type: string
description: 客户价值列表
isRewardTake:
type: boolean
description: 是否悬赏任务
referenceResource:
$ref: '#/definitions/referenceResourceRequestBody'
suMoney:
type: number
description: 奖励素币
format: double
taskDescription:
type: string
description: 任务描述
taskName:
type: string
description: 任务名称
taskNature:
type: string
description: 任务性质
taskPictureUrls:
type: array
items:
type: string
description: 任务图片URL列表
TaskUpdateTaskResponseBody:
title: 'Mediatype identifier: TaskUpdateTaskResponseBody'
type: object
properties:
task:
$ref: '#/definitions/taskResponseBody'
UnifiedUserCenterSyncEmployeeCallbackRequestBody:
title: UnifiedUserCenterSyncEmployeeCallbackRequestBody
type: object
properties:
action:
type: string
description: add:添加,edit:编辑,delete删除,batchDelete:批量删除,setCompanyCharge:更改公司主管,batchForbid:批量禁用用户,batchRemove:批量更改用户部门,changeAdmin换管理员
required:
- action
data:
type: string
description: 具体的对象JSON数据
required:
- data
module:
type: string
description: position:职位,department:部门,employee:员工,company:公司,profile员工档案
required:
- module
UnifiedUserCenterSyncEmployeeCallbackResponseBody:
title: 'Mediatype identifier: UnifiedUserCenterSyncEmployeeCallbackResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
bidInfoResponseBody:
title: bidInfoResponseBody
type: object
properties:
bidEndTime:
type: string
description: 竞标结束时间
required:
- bidEndTime
bidStartTime:
type: string
description: 竞标开始时间
required:
- bidStartTime
bidderInfos:
type: array
items:
$ref: '#/definitions/bidderInfoResponseBody'
description: 竞标人员列表
successfulBidder:
$ref: '#/definitions/employeeInfoResponseBody'
winBidTime:
type: string
description: 中标时间
required:
- winBidTime
description: 竞标任务信息
bidderInfoResponseBody:
title: bidderInfoResponseBody
type: object
properties:
bidTime:
type: string
description: 竞标时间
required:
- bidTime
bidder:
$ref: '#/definitions/employeeInfoResponseBody'
description: 竞标人员信息
configResponseBody:
title: configResponseBody
type: object
properties:
id:
type: integer
description: ID
required:
- id
name:
type: string
description: 名称
required:
- name
description: 配置字典
customerValueResponseBody:
title: customerValueResponseBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValueId:
type: integer
description: 客户价值ID
required:
- customerValueId
customerValueName:
type: string
description: 客户价值名称
required:
- customerValueName
description: 客户价值
employeeInfoRequestBody:
title: employeeInfoRequestBody
type: object
properties:
employeeAccount:
type: string
description: 员工账号
employeeAvatarUrl:
type: string
description: 员工头像URL
employeeName:
type: string
description: 员工姓名
required:
- employeeName
isPrincipal:
type: boolean
description: 是否公司负责人
uid:
type: integer
description: 统一用户UID
required:
- uid
description: 员工信息
employeeInfoResponseBody:
title: employeeInfoResponseBody
type: object
properties:
employeeAccount:
type: string
description: 员工账号
employeeAvatarUrl:
type: string
description: 员工头像URL
employeeName:
type: string
description: 员工姓名
required:
- employeeName
isPrincipal:
type: boolean
description: 是否公司负责人
uid:
type: integer
description: 统一用户UID
required:
- uid
description: 员工信息
employeeResponseBody:
title: employeeResponseBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
employeeId:
type: integer
description: 员工ID
required:
- employeeId
employeeInfo:
$ref: '#/definitions/employeeInfoResponseBody'
permissions:
type: array
items:
type: integer
format: int64
description: 员工权限集合
required:
- permissions
status:
type: integer
description: 员工状态(启用或者禁用)
format: int64
suMoney:
type: number
description: 当前素币
required:
- suMoney
description: 员工
notificationResponseBody:
title: notificationResponseBody
type: object
properties:
externalResource:
type: string
description: 外部资源引用
required:
- externalResource
notificationContent:
type: string
description: 通知内容
required:
- notificationContent
notificationId:
type: integer
description: 通知ID
required:
- notificationId
notificationTime:
type: string
description: 通知时间
required:
- notificationTime
notificationTitle:
type: string
description: 通知标题
required:
- notificationTitle
notificationType:
type: integer
description: 通知类型
required:
- notificationType
description: 通知
offTaskRecordResponseBody:
title: offTaskRecordResponseBody
type: object
properties:
createTime:
type: string
description: 创建时间
required:
- createTime
offReason:
type: string
description: 关闭理由
required:
- offReason
offTaskRecordId:
type: integer
description: 关闭任务记录ID
required:
- offTaskRecordId
operator:
$ref: '#/definitions/employeeInfoResponseBody'
task:
$ref: '#/definitions/taskResponseBody'
description: 关闭任务记录
personTaskStatisticsResponseBody:
title: personTaskStatisticsResponseBody
type: object
properties:
bidAsParticipator:
type: integer
description: 个人参与的竞标中任务
required:
- bidAsParticipator
completedAsParticipator:
type: integer
description: 个人参与的已完成任务
required:
- completedAsParticipator
completedAsReceiver:
type: integer
description: 个人领取的已完成任务
required:
- completedAsReceiver
completedAsSponsor:
type: integer
description: 个人发起的已完成任务
required:
- completedAsSponsor
unAcceptanceAsReceiver:
type: integer
description: 个人领取的待验收任务
required:
- unAcceptanceAsReceiver
unAcceptanceAsSponsor:
type: integer
description: 个人发起的待验收任务
required:
- unAcceptanceAsSponsor
unClaimedAsSponsor:
type: integer
description: 个人发起的待领取任务
required:
- unClaimedAsSponsor
unReleasedAsSponsor:
type: integer
description: 个人发起的待发布任务
required:
- unReleasedAsSponsor
underwayAsReceiver:
type: integer
description: 个人领取的进行中任务
required:
- underwayAsReceiver
underwayAsSponsor:
type: integer
description: 个人发起的进行中任务
required:
- underwayAsSponsor
description: 个人任务统计
projectBelongResponseBody:
title: projectBelongResponseBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
projectBelongId:
type: integer
description: 项目归属ID
required:
- projectBelongId
projectBelongName:
type: string
description: 项目归属名称
required:
- projectBelongName
description: 项目归属
referenceResourceItemRequestBody:
title: referenceResourceItemRequestBody
type: object
properties:
content:
type: string
description: 内容
required:
- content
issueScore:
type: number
description: 问题总分
format: double
referenceResourceId:
type: integer
description: 引用资源ID
required:
- referenceResourceId
serialNumber:
type: integer
description: 编号
required:
- serialNumber
solveScore:
type: array
items:
$ref: '#/definitions/solveScoreItemRequestBody'
description: 解决评分明细
title:
type: string
description: 标题
required:
- title
description: 引用资源项
referenceResourceItemResponseBody:
title: referenceResourceItemResponseBody
type: object
properties:
content:
type: string
description: 内容
required:
- content
issueScore:
type: number
description: 问题总分
format: double
referenceResourceId:
type: integer
description: 引用资源ID
required:
- referenceResourceId
serialNumber:
type: integer
description: 编号
required:
- serialNumber
solveScore:
type: array
items:
$ref: '#/definitions/solveScoreItemResponseBody'
description: 解决评分明细
title:
type: string
description: 标题
required:
- title
description: 引用资源项
referenceResourceRequestBody:
title: referenceResourceRequestBody
type: object
properties:
referenceResourceItems:
type: array
items:
$ref: '#/definitions/referenceResourceItemRequestBody'
description: 引用资源项列表
required:
- referenceResourceItems
referenceResourceType:
type: integer
description: 引用类型
required:
- referenceResourceType
description: 引用资源
referenceResourceResponseBody:
title: referenceResourceResponseBody
type: object
properties:
referenceResourceItems:
type: array
items:
$ref: '#/definitions/referenceResourceItemResponseBody'
description: 引用资源项列表
required:
- referenceResourceItems
referenceResourceType:
type: integer
description: 引用类型
required:
- referenceResourceType
description: 引用资源
rejectTaskRecordResponseBody:
title: rejectTaskRecordResponseBody
type: object
properties:
createTime:
type: string
description: 创建时间
required:
- createTime
operator:
$ref: '#/definitions/employeeInfoResponseBody'
rejectReason:
type: string
description: 驳回理由
required:
- rejectReason
rejectTaskRecordId:
type: integer
description: 驳回任务记录ID
required:
- rejectTaskRecordId
task:
$ref: '#/definitions/taskResponseBody'
description: 驳回任务记录
robInfoResponseBody:
title: robInfoResponseBody
type: object
properties:
receiveTime:
type: string
description: 领取时间
required:
- receiveTime
receiver:
$ref: '#/definitions/employeeInfoResponseBody'
description: 抢单任务信息
sentNotificationResponseBody:
title: sentNotificationResponseBody
type: object
properties:
isRead:
type: boolean
description: 是否已读
required:
- isRead
notification:
$ref: '#/definitions/notificationResponseBody'
readTime:
type: string
description: 通知读取时间
required:
- readTime
receiver:
$ref: '#/definitions/employeeInfoResponseBody'
sentNotificationId:
type: integer
description: 发送出的通知ID
required:
- sentNotificationId
description: 发送出的通知
solveScoreItemRequestBody:
title: solveScoreItemRequestBody
type: object
properties:
contributor:
$ref: '#/definitions/employeeInfoRequestBody'
isReceiver:
type: boolean
description: 是否领取人
required:
- isReceiver
percentage:
type: integer
description: 解决占比
required:
- percentage
score:
type: number
description: 解决评分
required:
- score
description: 解决评分项
solveScoreItemResponseBody:
title: solveScoreItemResponseBody
type: object
properties:
contributor:
$ref: '#/definitions/employeeInfoResponseBody'
isReceiver:
type: boolean
description: 是否领取人
required:
- isReceiver
percentage:
type: integer
description: 解决占比
required:
- percentage
score:
type: number
description: 解决评分
required:
- score
description: 解决评分项
suMoneyTransactionRecordResponseBody:
title: suMoneyTransactionRecordResponseBody
type: object
properties:
createTime:
type: string
description: 创建时间
required:
- createTime
employee:
$ref: '#/definitions/employeeInfoResponseBody'
operator:
$ref: '#/definitions/employeeInfoResponseBody'
recordDescription:
type: string
description: 素币事务记录描述
required:
- recordDescription
recordType:
type: integer
description: 记录类型(1兑换,2任务奖励,3增加,4扣除)
required:
- recordType
suMoney:
type: number
description: 事务素币值
required:
- suMoney
suMoneyBeforeTransaction:
type: number
description: 事务处理前素币值
required:
- suMoneyBeforeTransaction
suMoneyTransactionRecordId:
type: integer
description: 素币事务记录ID
required:
- suMoneyTransactionRecordId
description: 素币事务记录
taskNatureResponseBody:
title: taskNatureResponseBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
taskNatureId:
type: integer
description: 任务性质ID
required:
- taskNatureId
taskNatureName:
type: string
description: 任务性质名称
required:
- taskNatureName
description: 任务性质
taskPercentageItemRequestBody:
title: taskPercentageItemRequestBody
type: object
properties:
contributor:
$ref: '#/definitions/employeeInfoRequestBody'
isReceiver:
type: boolean
description: 是否领取人
required:
- isReceiver
percentage:
type: integer
description: 任务贡献占比
required:
- percentage
suMoney:
type: number
description: 分配到的奖励素币
required:
- suMoney
description: 任务贡献占比项
taskPercentageItemResponseBody:
title: taskPercentageItemResponseBody
type: object
properties:
contributor:
$ref: '#/definitions/employeeInfoResponseBody'
isReceiver:
type: boolean
description: 是否领取人
required:
- isReceiver
percentage:
type: integer
description: 任务贡献占比
required:
- percentage
suMoney:
type: number
description: 分配到的奖励素币
required:
- suMoney
description: 任务贡献占比项
taskResponseBody:
title: taskResponseBody
type: object
properties:
acceptanceStandard:
type: string
description: 验收标准
required:
- acceptanceStandard
acceptanceTime:
type: string
description: 验收方验收时间
format: datetime
bidInfo:
$ref: '#/definitions/bidInfoResponseBody'
companyId:
type: integer
description: 公司ID
required:
- companyId
completeTime:
type: string
description: 完成任务操作时间
format: datetime
createTime:
type: string
description: 创建时间
required:
- createTime
customerValues:
type: array
items:
type: integer
format: int64
description: 客户价值列表
required:
- customerValues
isRewardTake:
type: boolean
description: 是否悬赏任务
participators:
type: array
items:
$ref: '#/definitions/employeeInfoResponseBody'
description: 任务参与者列表
projectBelong:
type: array
items:
type: integer
format: int64
description: 项目归属
required:
- projectBelong
receiveTime:
type: string
description: 领取任务时间
format: datetime
referenceResource:
$ref: '#/definitions/referenceResourceResponseBody'
releaseTime:
type: string
description: 发布任务时间
format: datetime
robInfo:
$ref: '#/definitions/robInfoResponseBody'
solvePictureUrls:
type: array
items:
type: string
description: 解决图片URL列表
solveReport:
type: string
description: 解决报告
sponsor:
$ref: '#/definitions/employeeInfoResponseBody'
suMoney:
type: number
description: 奖励素币
required:
- suMoney
taskDescription:
type: string
description: 任务描述
required:
- taskDescription
taskId:
type: integer
description: 任务ID
required:
- taskId
taskName:
type: string
description: 任务名称
required:
- taskName
taskNature:
type: integer
description: 任务性质
required:
- taskNature
taskPercentage:
type: array
items:
$ref: '#/definitions/taskPercentageItemResponseBody'
description: 任务贡献占比
taskPictureUrls:
type: array
items:
type: string
description: 任务图片URL列表
taskStatus:
type: integer
description: 任务状态(1.待发布2.待领取3.进行中4.待验收5.已完成6.关闭7.待确认)
required:
- taskStatus
taskType:
type: integer
description: 任务类型(1.抢单任务2.竞标任务3.指派任务)
required:
- taskType
description: 任务
... ... @@ -20,6 +20,7 @@ func (configService *ConfigService) ListTaskStatus(listTaskStatusQuery *query.Li
3: "进行中",
4: "待验收",
5: "已完成",
7: "待确认",
}
var list []map[string]interface{}
for key, value := range taskStatusMap {
... ... @@ -41,6 +42,7 @@ func (configService *ConfigService) ListTaskType(listTaskTypeQuery *query.ListTa
taskTypeMap := map[int]string{
1: "抢单任务",
2: "竞标任务",
3: "指派任务",
}
var list []map[string]interface{}
for key, value := range taskTypeMap {
... ... @@ -172,6 +174,7 @@ func (configService *ConfigService) ListEmployeePermission(listEmployeePermissio
1: "任务管理",
2: "素币管理",
3: "成员管理",
4: "标签管理",
}
var list []map[string]interface{}
for key, value := range employeePermissionMap {
... ...
... ... @@ -6,6 +6,14 @@ import (
domainService "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/domain_service"
)
func CreateOperationSuMoneyService(options map[string]interface{}) (service.OperationSuMoneyService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domainService.NewOperationSuMoneyService(transactionContext)
}
func CreateRejectTaskReceiverService(options map[string]interface{}) (service.RejectTaskReceiverService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
... ...
package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type OperationSuMoneyCommand struct {
// 素币拥有者UID
Uid int64 `json:"uid" valid:"Required"`
// 操作类型(1增加,2扣除)
OperationType int `json:"operationType" valid:"Required"`
// 素币值
SuMoney float64 `json:"suMoney" valid:"Required"`
// 操作人UID
Operator int64 `json:"operator,omitempty"`
// 理由描述
OperationDescription string `json:"operationDescription" valid:"Required"`
}
func (operationSuMoneyCommand *OperationSuMoneyCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(operationSuMoneyCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
... ... @@ -15,6 +15,39 @@ import (
type SuMoneyService struct {
}
// 操作素币
func (suMoneyService *SuMoneyService) OperationSuMoney(operationSuMoneyCommand *command.OperationSuMoneyCommand) (interface{}, error) {
if err := operationSuMoneyCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
transactionContext.RollbackTransaction()
}()
var operationSuMoneyService service.OperationSuMoneyService
if value, err := factory.CreateOperationSuMoneyService(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
operationSuMoneyService = value
}
if task, err := operationSuMoneyService.Operation(operationSuMoneyCommand.Uid, operationSuMoneyCommand.Operator, operationSuMoneyCommand.SuMoney, operationSuMoneyCommand.OperationType, operationSuMoneyCommand.OperationDescription); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return task, nil
}
}
// 返回素币事务记录
func (suMoneyService *SuMoneyService) GetSuMoneyTransactionRecord(getSuMoneyTransactionRecordQuery *query.GetSuMoneyTransactionRecordQuery) (interface{}, error) {
if err := getSuMoneyTransactionRecordQuery.ValidateQuery(); err != nil {
... ...
package domain
// 个人任务统计
type PersonTaskStatistics struct {
// 个人领取的进行中任务
UnderwayAsReceiver int64 `json:"underwayAsReceiver"`
// 个人领取的待验收任务
UnAcceptanceAsReceiver int64 `json:"unAcceptanceAsReceiver"`
// 个人领取的已完成任务
CompletedAsReceiver int64 `json:"completedAsReceiver"`
// 个人发起的待发布任务
UnReleasedAsSponsor int64 `json:"unReleasedAsSponsor"`
// 个人发起的待领取任务
UnClaimedAsSponsor int64 `json:"unClaimedAsSponsor"`
// 个人发起的进行中任务
UnderwayAsSponsor int64 `json:"underwayAsSponsor"`
// 个人发起的待验收任务
UnAcceptanceAsSponsor int64 `json:"unAcceptanceAsSponsor"`
// 个人发起的已完成任务
CompletedAsSponsor int64 `json:"completedAsSponsor"`
// 个人参与的竞标中任务
BidAsParticipator int64 `json:"bidAsParticipator"`
// 个人参与的已完成任务
CompletedAsParticipator int64 `json:"completedAsParticipator"`
}
package service
import (
coreDomain "github.com/linmadan/egglib-go/core/domain"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain"
)
type OperationSuMoneyService interface {
coreDomain.DomainEventPublisher
Operation(uid int64, operatorUid int64, suMoney float64, operationType int, recordDescription string) (*domain.SuMoneyTransactionRecord, error)
}
... ...
... ... @@ -5,6 +5,8 @@ import "time"
const (
SU_MONEY_TRANSACTION_RECORD_TYPE_EXCHANGE = iota + 1 //兑换
SU_MONEY_TRANSACTION_RECORD_TYPE_AWARD //任务奖励
SU_MONEY_TRANSACTION_RECORD_TYPE_INCREASE //增加
SU_MONEY_TRANSACTION_RECORD_TYPE_DEDUCT //扣除
)
// 素币事务记录
... ... @@ -17,6 +19,8 @@ type SuMoneyTransactionRecord struct {
Employee *EmployeeInfo `json:"employee"`
// 事务处理前素币值
SuMoneyBeforeTransaction float64 `json:"suMoneyBeforeTransaction"`
// 当前素币值
CurrentSuMoney float64 `json:"currentSuMoney"`
// 事务素币值
SuMoney float64 `json:"suMoney"`
// 操作人
... ...
... ... @@ -96,17 +96,63 @@ func (dao *TaskDao) CalculateSystemTask(companyId int64) (map[string]interface{}
}, nil
}
func (dao *TaskDao) CalculatePersonTask(uid int64) (*domain.PersonTaskStatistics, error) {
func (dao *TaskDao) CalculatePersonTask(uid int64) (map[string]interface{}, error) {
var underwayAsAssignedPerson int64
var unAcceptanceAsAssignedPerson int64
var completedAsAssignedPerson int64
var unConfirmedAsReceiver int64
var underwayAsReceiver int64
var unAcceptanceAsReceiver int64
var completedAsReceiver int64
var unReleasedAsSponsor int64
var unClaimedAsSponsor int64
var unConfirmedAsSponsor int64
var underwayAsSponsor int64
var unAcceptanceAsSponsor int64
var completedAsSponsor int64
var bidAsParticipator int64
var completedAsParticipator int64
tx := dao.transactionContext.PgTx
taskModel := new(models.Task)
personTaskStatistics := &domain.PersonTaskStatistics{}
if count, err := tx.Model(taskModel).
Where(`task.assigned_person @> '{"uid":?}'`, uid).
Where("task.task_status = ? ", domain.TASK_STATUS_UNDERWAY).
Count(); err != nil {
return nil, err
} else {
underwayAsAssignedPerson = int64(count)
}
if count, err := tx.Model(taskModel).
Where(`task.assigned_person @> '{"uid":?}'`, uid).
Where("task.task_status = ? ", domain.TASK_STATUS_UNACCEPTANCE).
Count(); err != nil {
return nil, err
} else {
unAcceptanceAsAssignedPerson = int64(count)
}
if count, err := tx.Model(taskModel).
Where(`task.assigned_person @> '{"uid":?}'`, uid).
Where("task.task_status = ? ", domain.TASK_STATUS_COMPLETED).
Count(); err != nil {
return nil, err
} else {
completedAsAssignedPerson = int64(count)
}
if count, err := tx.Model(taskModel).
Where("task.receiver_uid = ?", uid).
Where("task.task_status = ? ", domain.TASK_STATUS_UNCONFIRMED).
Count(); err != nil {
return nil, err
} else {
unConfirmedAsReceiver = int64(count)
}
if count, err := tx.Model(taskModel).
Where("task.receiver_uid = ?", uid).
Where("task.task_status = ? ", domain.TASK_STATUS_UNDERWAY).
Count(); err != nil {
return nil, err
} else {
personTaskStatistics.UnderwayAsReceiver = int64(count)
underwayAsReceiver = int64(count)
}
if count, err := tx.Model(taskModel).
Where("task.receiver_uid = ?", uid).
... ... @@ -114,7 +160,7 @@ func (dao *TaskDao) CalculatePersonTask(uid int64) (*domain.PersonTaskStatistics
Count(); err != nil {
return nil, err
} else {
personTaskStatistics.UnAcceptanceAsReceiver = int64(count)
unAcceptanceAsReceiver = int64(count)
}
if count, err := tx.Model(taskModel).
Where("task.receiver_uid = ?", uid).
... ... @@ -122,7 +168,7 @@ func (dao *TaskDao) CalculatePersonTask(uid int64) (*domain.PersonTaskStatistics
Count(); err != nil {
return nil, err
} else {
personTaskStatistics.CompletedAsReceiver = int64(count)
completedAsReceiver = int64(count)
}
if count, err := tx.Model(taskModel).
Where(`task.sponsor @> '{"uid":?}'`, uid).
... ... @@ -130,7 +176,7 @@ func (dao *TaskDao) CalculatePersonTask(uid int64) (*domain.PersonTaskStatistics
Count(); err != nil {
return nil, err
} else {
personTaskStatistics.UnReleasedAsSponsor = int64(count)
unReleasedAsSponsor = int64(count)
}
if count, err := tx.Model(taskModel).
Where(`task.sponsor @> '{"uid":?}'`, uid).
... ... @@ -138,7 +184,15 @@ func (dao *TaskDao) CalculatePersonTask(uid int64) (*domain.PersonTaskStatistics
Count(); err != nil {
return nil, err
} else {
personTaskStatistics.UnClaimedAsSponsor = int64(count)
unClaimedAsSponsor = int64(count)
}
if count, err := tx.Model(taskModel).
Where(`task.sponsor @> '{"uid":?}'`, uid).
Where("task.task_status = ? ", domain.TASK_STATUS_UNCONFIRMED).
Count(); err != nil {
return nil, err
} else {
unConfirmedAsSponsor = int64(count)
}
if count, err := tx.Model(taskModel).
Where(`task.sponsor @> '{"uid":?}'`, uid).
... ... @@ -146,7 +200,7 @@ func (dao *TaskDao) CalculatePersonTask(uid int64) (*domain.PersonTaskStatistics
Count(); err != nil {
return nil, err
} else {
personTaskStatistics.UnderwayAsSponsor = int64(count)
underwayAsSponsor = int64(count)
}
if count, err := tx.Model(taskModel).
Where(`task.sponsor @> '{"uid":?}'`, uid).
... ... @@ -154,7 +208,7 @@ func (dao *TaskDao) CalculatePersonTask(uid int64) (*domain.PersonTaskStatistics
Count(); err != nil {
return nil, err
} else {
personTaskStatistics.UnAcceptanceAsSponsor = int64(count)
unAcceptanceAsSponsor = int64(count)
}
if count, err := tx.Model(taskModel).
Where(`task.sponsor @> '{"uid":?}'`, uid).
... ... @@ -162,7 +216,7 @@ func (dao *TaskDao) CalculatePersonTask(uid int64) (*domain.PersonTaskStatistics
Count(); err != nil {
return nil, err
} else {
personTaskStatistics.CompletedAsSponsor = int64(count)
completedAsSponsor = int64(count)
}
if count, err := tx.Model(taskModel).Join("JOIN bidder_infos AS bidder_info ON bidder_info.task_id = task.id").
Where(`bidder_info.bidder @> '{"uid":?}'`, uid).
... ... @@ -170,7 +224,7 @@ func (dao *TaskDao) CalculatePersonTask(uid int64) (*domain.PersonTaskStatistics
Count(); err != nil {
return nil, err
} else {
personTaskStatistics.BidAsParticipator = int64(count)
bidAsParticipator = int64(count)
}
if count, err := tx.Model(taskModel).
Where(`task.participators @> '[{"uid":?}]'`, uid).
... ... @@ -178,9 +232,25 @@ func (dao *TaskDao) CalculatePersonTask(uid int64) (*domain.PersonTaskStatistics
Count(); err != nil {
return nil, err
} else {
personTaskStatistics.CompletedAsParticipator = int64(count)
completedAsParticipator = int64(count)
}
return personTaskStatistics, nil
return map[string]interface{}{
"underwayAsAssignedPerson": underwayAsAssignedPerson,
"unAcceptanceAsAssignedPerson": unAcceptanceAsAssignedPerson,
"completedAsAssignedPerson": completedAsAssignedPerson,
"unConfirmedAsReceiver": unConfirmedAsReceiver,
"underwayAsReceiver": underwayAsReceiver,
"unAcceptanceAsReceiver": unAcceptanceAsReceiver,
"completedAsReceiver": completedAsReceiver,
"unReleasedAsSponsor": unReleasedAsSponsor,
"unClaimedAsSponsor": unClaimedAsSponsor,
"unConfirmedAsSponsor": unConfirmedAsSponsor,
"underwayAsSponsor": underwayAsSponsor,
"unAcceptanceAsSponsor": unAcceptanceAsSponsor,
"completedAsSponsor": completedAsSponsor,
"bidAsParticipator": bidAsParticipator,
"completedAsParticipator": completedAsParticipator,
}, nil
}
func NewTaskDao(transactionContext *pgTransaction.TransactionContext) (*TaskDao, error) {
... ...
... ... @@ -59,6 +59,7 @@ func (service *AcceptanceTaskService) Acceptance(taskId int64, operatorUid int64
if task == nil {
return nil, fmt.Errorf("无效的任务")
}
participatorMap := make(map[int64]*domain.Employee)
var participatorInfos []*domain.EmployeeInfo
for _, participatorUid := range participators {
if participator, err := employeeRepository.FindOne(map[string]interface{}{
... ... @@ -69,6 +70,7 @@ func (service *AcceptanceTaskService) Acceptance(taskId int64, operatorUid int64
if participator == nil {
return nil, fmt.Errorf("无效的参与人")
}
participatorMap[participator.EmployeeInfo.Uid] = participator
participatorInfos = append(participatorInfos, participator.EmployeeInfo)
}
}
... ... @@ -83,9 +85,30 @@ func (service *AcceptanceTaskService) Acceptance(taskId int64, operatorUid int64
if task.TaskType == domain.TASK_TYPE_ROB {
taskTypeName = "抢单任务"
}
var employee *domain.Employee
if taskPercentageItem.IsReceiver {
receiver, err := employeeRepository.FindOne(map[string]interface{}{
"uid": taskPercentageItem.Contributor.Uid,
})
if err != nil {
return nil, err
}
if receiver == nil {
return nil, fmt.Errorf("无效的任务领取者")
}
employee = receiver
} else {
participator, ok := participatorMap[taskPercentageItem.Contributor.Uid]
if !ok {
return nil, fmt.Errorf("无效的参与人")
}
employee = participator
}
suMoneyTransactionRecord := &domain.SuMoneyTransactionRecord{
RecordType: domain.SU_MONEY_TRANSACTION_RECORD_TYPE_AWARD,
Employee: taskPercentageItem.Contributor,
SuMoneyBeforeTransaction: employee.SuMoney,
CurrentSuMoney: employee.SuMoney + taskPercentageItem.SuMoney,
SuMoney: taskPercentageItem.SuMoney,
Operator: operator.EmployeeInfo,
RecordDescription: fmt.Sprintf("%s-%s", taskTypeName, task.TaskName),
... ...
... ... @@ -59,6 +59,7 @@ func (service *ExchangeSuMoneyService) Exchange(uid int64, operatorUid int64, su
RecordType: domain.SU_MONEY_TRANSACTION_RECORD_TYPE_EXCHANGE,
Employee: employee.EmployeeInfo,
SuMoneyBeforeTransaction: employee.SuMoney,
CurrentSuMoney: employee.SuMoney - suMoney,
SuMoney: suMoney,
Operator: operator.EmployeeInfo,
RecordDescription: recordDescription,
... ...
package domain_service
import (
"fmt"
coreDomain "github.com/linmadan/egglib-go/core/domain"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/dao"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/repository"
"time"
)
type OperationSuMoneyService struct {
coreDomain.BaseEventPublisher
transactionContext *pgTransaction.TransactionContext
}
func (service *OperationSuMoneyService) Operation(uid int64, operatorUid int64, suMoney float64, operationType int, recordDescription string) (*domain.SuMoneyTransactionRecord, error) {
var employeeRepository domain.EmployeeRepository
var suMoneyTransactionRecordRepository domain.SuMoneyTransactionRecordRepository
var employeeDao *dao.EmployeeDao
if repository, err := repository.NewEmployeeRepository(service.transactionContext); err != nil {
return nil, err
} else {
employeeRepository = repository
}
if repository, err := repository.NewSuMoneyTransactionRecordRepository(service.transactionContext); err != nil {
return nil, err
} else {
suMoneyTransactionRecordRepository = repository
}
if dao, err := dao.NewEmployeeDao(service.transactionContext); err != nil {
return nil, err
} else {
employeeDao = dao
}
employee, err := employeeRepository.FindOne(map[string]interface{}{
"uid": uid,
})
if err != nil {
return nil, err
}
if employee == nil {
return nil, fmt.Errorf("无效的企业员工")
}
operator, err := employeeRepository.FindOne(map[string]interface{}{
"uid": operatorUid,
})
if err != nil {
return nil, err
}
if operator == nil {
return nil, fmt.Errorf("无效的操作者")
}
if operationType == 2 && employee.SuMoney < suMoney {
return nil, fmt.Errorf("当前素币不足")
}
var recordType int
var transferSuMoney float64
if operationType == 1 {
recordType = domain.SU_MONEY_TRANSACTION_RECORD_TYPE_INCREASE
transferSuMoney = suMoney
}
if operationType == 2 {
recordType = domain.SU_MONEY_TRANSACTION_RECORD_TYPE_DEDUCT
transferSuMoney = 0 - suMoney
}
suMoneyTransactionRecord := &domain.SuMoneyTransactionRecord{
RecordType: recordType,
Employee: employee.EmployeeInfo,
SuMoneyBeforeTransaction: employee.SuMoney,
CurrentSuMoney: employee.SuMoney + transferSuMoney,
SuMoney: suMoney,
Operator: operator.EmployeeInfo,
RecordDescription: recordDescription,
CreateTime: time.Now(),
}
if err := employeeDao.TransferSuMoney(employee.EmployeeInfo.Uid, transferSuMoney); err != nil {
return nil, err
}
if suMoneyTransactionRecord, err := suMoneyTransactionRecordRepository.Save(suMoneyTransactionRecord); err != nil {
return nil, err
} else {
return suMoneyTransactionRecord, nil
}
}
func NewOperationSuMoneyService(transactionContext *pgTransaction.TransactionContext) (*OperationSuMoneyService, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &OperationSuMoneyService{
transactionContext: transactionContext,
}, nil
}
}
... ...
... ... @@ -15,6 +15,8 @@ type SuMoneyTransactionRecord struct {
Employee *domain.EmployeeInfo
// 事务处理前素币值
SuMoneyBeforeTransaction float64
// 当前素币值
CurrentSuMoney float64
// 事务素币值
SuMoney float64
// 操作人
... ...
... ... @@ -18,16 +18,16 @@ func (repository *SuMoneyTransactionRecordRepository) Save(suMoneyTransactionRec
tx := repository.transactionContext.PgTx
if suMoneyTransactionRecord.Identify() == nil {
if _, err := tx.QueryOne(
pg.Scan(&suMoneyTransactionRecord.SuMoneyTransactionRecordId, &suMoneyTransactionRecord.RecordType, &suMoneyTransactionRecord.Employee, &suMoneyTransactionRecord.SuMoneyBeforeTransaction, &suMoneyTransactionRecord.SuMoney, &suMoneyTransactionRecord.Operator, &suMoneyTransactionRecord.RecordDescription, &suMoneyTransactionRecord.CreateTime),
"INSERT INTO su_money_transaction_records (record_type, employee, su_money_before_transaction, su_money, operator, record_description, create_time) VALUES (?, ?, ?, ?, ?, ?, ?) RETURNING id, record_type, employee, su_money_before_transaction, su_money, operator, record_description, create_time",
suMoneyTransactionRecord.RecordType, suMoneyTransactionRecord.Employee, suMoneyTransactionRecord.SuMoneyBeforeTransaction, suMoneyTransactionRecord.SuMoney, suMoneyTransactionRecord.Operator, suMoneyTransactionRecord.RecordDescription, suMoneyTransactionRecord.CreateTime); err != nil {
pg.Scan(&suMoneyTransactionRecord.SuMoneyTransactionRecordId, &suMoneyTransactionRecord.RecordType, &suMoneyTransactionRecord.Employee, &suMoneyTransactionRecord.SuMoneyBeforeTransaction, &suMoneyTransactionRecord.CurrentSuMoney, &suMoneyTransactionRecord.SuMoney, &suMoneyTransactionRecord.Operator, &suMoneyTransactionRecord.RecordDescription, &suMoneyTransactionRecord.CreateTime),
"INSERT INTO su_money_transaction_records (record_type, employee, su_money_before_transaction, current_su_money, su_money, operator, record_description, create_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?) RETURNING id, record_type, employee, su_money_before_transaction, current_su_money, su_money, operator, record_description, create_time",
suMoneyTransactionRecord.RecordType, suMoneyTransactionRecord.Employee, suMoneyTransactionRecord.SuMoneyBeforeTransaction, suMoneyTransactionRecord.CurrentSuMoney, suMoneyTransactionRecord.SuMoney, suMoneyTransactionRecord.Operator, suMoneyTransactionRecord.RecordDescription, suMoneyTransactionRecord.CreateTime); err != nil {
return suMoneyTransactionRecord, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(&suMoneyTransactionRecord.SuMoneyTransactionRecordId, &suMoneyTransactionRecord.RecordType, &suMoneyTransactionRecord.Employee, &suMoneyTransactionRecord.SuMoneyBeforeTransaction, &suMoneyTransactionRecord.SuMoney, &suMoneyTransactionRecord.Operator, &suMoneyTransactionRecord.RecordDescription, &suMoneyTransactionRecord.CreateTime),
"UPDATE su_money_transaction_records SET record_type=?, employee=?, su_money_before_transaction=?, su_money=?, operator=?, record_description=?, create_time=? WHERE id=? RETURNING id, record_type, employee, su_money, operator, record_description, create_time",
suMoneyTransactionRecord.RecordType, suMoneyTransactionRecord.Employee, suMoneyTransactionRecord.SuMoneyBeforeTransaction, suMoneyTransactionRecord.SuMoney, suMoneyTransactionRecord.Operator, suMoneyTransactionRecord.RecordDescription, suMoneyTransactionRecord.CreateTime, suMoneyTransactionRecord.SuMoneyTransactionRecordId); err != nil {
pg.Scan(&suMoneyTransactionRecord.SuMoneyTransactionRecordId, &suMoneyTransactionRecord.RecordType, &suMoneyTransactionRecord.Employee, &suMoneyTransactionRecord.SuMoneyBeforeTransaction, &suMoneyTransactionRecord.CurrentSuMoney, &suMoneyTransactionRecord.SuMoney, &suMoneyTransactionRecord.Operator, &suMoneyTransactionRecord.RecordDescription, &suMoneyTransactionRecord.CreateTime),
"UPDATE su_money_transaction_records SET record_type=?, employee=?, su_money_before_transaction=?, current_su_money=?, su_money=?, operator=?, record_description=?, create_time=? WHERE id=? RETURNING id, record_type, employee, su_money_before_transaction, current_su_money, su_money, operator, record_description, create_time",
suMoneyTransactionRecord.RecordType, suMoneyTransactionRecord.Employee, suMoneyTransactionRecord.SuMoneyBeforeTransaction, suMoneyTransactionRecord.CurrentSuMoney, suMoneyTransactionRecord.SuMoney, suMoneyTransactionRecord.Operator, suMoneyTransactionRecord.RecordDescription, suMoneyTransactionRecord.CreateTime, suMoneyTransactionRecord.SuMoneyTransactionRecordId); err != nil {
return suMoneyTransactionRecord, err
}
}
... ... @@ -117,6 +117,7 @@ func (repository *SuMoneyTransactionRecordRepository) transformPgModelToDomainMo
RecordType: suMoneyTransactionRecordModel.RecordType,
Employee: suMoneyTransactionRecordModel.Employee,
SuMoneyBeforeTransaction: suMoneyTransactionRecordModel.SuMoneyBeforeTransaction,
CurrentSuMoney: suMoneyTransactionRecordModel.CurrentSuMoney,
SuMoney: suMoneyTransactionRecordModel.SuMoney,
Operator: suMoneyTransactionRecordModel.Operator,
RecordDescription: suMoneyTransactionRecordModel.RecordDescription,
... ...
... ... @@ -14,6 +14,21 @@ type SuMoneyController struct {
beego.Controller
}
func (controller *SuMoneyController) OperationSuMoney() {
suMoneyService := service.NewSuMoneyService(nil)
operationSuMoneyCommand := &command.OperationSuMoneyCommand{}
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), operationSuMoneyCommand)
data, err := suMoneyService.OperationSuMoney(operationSuMoneyCommand)
var response utils.JsonResponse
if err != nil {
response = utils.ResponseError(controller.Ctx, err)
} else {
response = utils.ResponseData(controller.Ctx, data)
}
controller.Data["json"] = response
controller.ServeJSON()
}
func (controller *SuMoneyController) GetSuMoneyTransactionRecord() {
suMoneyService := service.NewSuMoneyService(nil)
getSuMoneyTransactionRecordQuery := &query.GetSuMoneyTransactionRecordQuery{}
... ...
... ... @@ -6,6 +6,7 @@ import (
)
func init() {
beego.Router("/su-money/operation", &controllers.SuMoneyController{}, "Post:OperationSuMoney")
beego.Router("/su-money/su-money-transaction-records/:suMoneyTransactionRecordId", &controllers.SuMoneyController{}, "Get:GetSuMoneyTransactionRecord")
beego.Router("/su-money/exchange", &controllers.SuMoneyController{}, "Post:ExchangeSuMoney")
beego.Router("/su-money/search-su-money-transaction-record", &controllers.SuMoneyController{}, "Post:SearchSuMoneyTransactionRecord")
... ...
... ... @@ -17,10 +17,10 @@ var _ = Describe("获取个人任务统计", func() {
dayAfter, _ := time.ParseDuration("72h")
_, err := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, customer_value, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, receiver_uid, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, receiver_uid, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
1, 101, "抢单任务1", 1, &domain.EmployeeInfo{
Uid: 2499036607974745088,
}, 2, "null", pg.Array([]string{"口感", "便利", "品牌", "售后服务"}), "面", 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, []*domain.EmployeeInfo{
}, 2, "null", 1, pg.Array([]int{1, 2, 3, 4}), 1, 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, []*domain.EmployeeInfo{
{
Uid: 2499036607974745077,
},
... ... @@ -31,31 +31,31 @@ var _ = Describe("获取个人任务统计", func() {
Expect(err).NotTo(HaveOccurred())
_, err1 := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, customer_value, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
2, 101, "抢单任务2", 1, &domain.EmployeeInfo{
Uid: 2499036607974745088,
}, 2, "null", pg.Array([]string{"口感", "便利", "品牌"}), "面", 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), false, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
}, 2, "null", 1, pg.Array([]int{1, 2, 3, 4}), 1, 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), false, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
Expect(err1).NotTo(HaveOccurred())
_, err2 := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, customer_value, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
3, 102, "竞标任务1", 2, &domain.EmployeeInfo{
Uid: 2499036607974745088,
}, 1, "null", pg.Array([]string{"口感", "便利", "品牌"}), "面", 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
}, 1, "null", 1, pg.Array([]int{1, 2, 3, 4}), 1, 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
Expect(err2).NotTo(HaveOccurred())
_, err3 := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, customer_value, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
4, 101, "竞标任务1", 2, &domain.EmployeeInfo{
Uid: 2499036607974745099,
}, 3, "null", pg.Array([]string{"口感", "便利", "品牌"}), "面", 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), false, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
}, 3, "null", 1, pg.Array([]int{1, 2, 3, 4}), 1, 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), false, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
Expect(err3).NotTo(HaveOccurred())
_, err4 := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, customer_value, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, receiver_uid, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, receiver_uid, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
5, 303, "抢单任务1", 1, &domain.EmployeeInfo{
Uid: 2499036607974745088,
}, 6, "null", pg.Array([]string{"口感", "便利", "品牌", "售后服务"}), "面", 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, []*domain.EmployeeInfo{
}, 6, "null", 1, pg.Array([]int{1, 2, 3, 4}), 1, 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, []*domain.EmployeeInfo{
{
Uid: 2499036607974745077,
},
... ...
... ... @@ -17,10 +17,10 @@ var _ = Describe("获取系统任务统计", func() {
dayAfter, _ := time.ParseDuration("72h")
_, err := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, customer_value, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, receiver_uid, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, receiver_uid, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
1, 101, "抢单任务1", 1, &domain.EmployeeInfo{
Uid: 2499036607974745088,
}, 2, "null", pg.Array([]string{"口感", "便利", "品牌", "售后服务"}), "面", 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, []*domain.EmployeeInfo{
}, 2, "null", 1, pg.Array([]int{1, 2, 3, 4}), 1, 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, []*domain.EmployeeInfo{
{
Uid: 2499036607974745077,
},
... ... @@ -31,31 +31,31 @@ var _ = Describe("获取系统任务统计", func() {
Expect(err).NotTo(HaveOccurred())
_, err1 := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, customer_value, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
2, 101, "抢单任务2", 1, &domain.EmployeeInfo{
Uid: 2499036607974745088,
}, 2, "null", pg.Array([]string{"口感", "便利", "品牌"}), "面", 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), false, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
}, 2, "null", 1, pg.Array([]int{1, 2, 3, 4}), 1, 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), false, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
Expect(err1).NotTo(HaveOccurred())
_, err2 := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, customer_value, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
3, 102, "竞标任务1", 2, &domain.EmployeeInfo{
Uid: 2499036607974745088,
}, 1, "null", pg.Array([]string{"口感", "便利", "品牌"}), "面", 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
}, 1, "null", 1, pg.Array([]int{1, 2, 3, 4}), 1, 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
Expect(err2).NotTo(HaveOccurred())
_, err3 := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, customer_value, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
4, 101, "竞标任务1", 2, &domain.EmployeeInfo{
Uid: 2499036607974745099,
}, 5, "null", pg.Array([]string{"口感", "便利", "品牌"}), "面", 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), false, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
}, 5, "null", 1, pg.Array([]int{1, 2, 3, 4}), 1, 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), false, "null", "null", "", pg.Array([]string{}), time.Now(), time.Now().Add(dayAfter))
Expect(err3).NotTo(HaveOccurred())
_, err4 := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, customer_value, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, receiver_uid, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, participators, task_percentage, solve_report, solve_picture_urls, receiver_uid, create_time, release_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
5, 303, "抢单任务1", 1, &domain.EmployeeInfo{
Uid: 2499036607974745088,
}, 6, "null", pg.Array([]string{"口感", "便利", "品牌", "售后服务"}), "面", 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, []*domain.EmployeeInfo{
}, 6, "null", 1, pg.Array([]int{1, 2, 3, 4}), 1, 1000.00, "验收标准1", "任务描述1", pg.Array([]string{}), true, []*domain.EmployeeInfo{
{
Uid: 2499036607974745077,
},
... ...
package su_money
import (
"net/http"
"github.com/gavv/httpexpect"
"github.com/go-pg/pg"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
pG "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/pg"
)
var _ = Describe("操作素币", func() {
BeforeEach(func() {
_, err1 := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO employees (id, company_id, uid, employee_name, employee_account, su_money) VALUES (?, ?, ?, ?, ?, ?)",
1, 101, 2499036607974745088, "testEmployeeName", "testEmployeeAccount", 100.00)
Expect(err1).NotTo(HaveOccurred())
_, err2 := pG.DB.QueryOne(
pg.Scan(),
"INSERT INTO employees (id, company_id, uid, employee_name, employee_account, su_money) VALUES (?, ?, ?, ?, ?, ?)",
2, 101, 2499036607974745099, "testEmployeeName", "testEmployeeAccount", 0)
Expect(err2).NotTo(HaveOccurred())
})
Describe("操作素币", func() {
Context("操作人提交正确的数据操作素币", func() {
It("操作成功", func() {
httpExpect := httpexpect.New(GinkgoT(), server.URL)
body := map[string]interface{}{
"uid": 2499036607974745088,
"operationType": 1,
"suMoney": 50,
"operator": 2499036607974745099,
"operationDescription": "操作说明",
}
httpExpect.POST("/su-money/operation").
WithJSON(body).
Expect().
Status(http.StatusOK).
JSON().
Object().
ContainsKey("code").ValueEqual("code", 0).
ContainsKey("msg").ValueEqual("msg", "ok").
ContainsKey("data").Value("data").Object()
})
})
})
AfterEach(func() {
_, err := pG.DB.Exec("DELETE FROM employees WHERE true")
Expect(err).NotTo(HaveOccurred())
_, err1 := pG.DB.Exec("DELETE FROM su_money_transaction_records WHERE true")
Expect(err1).NotTo(HaveOccurred())
})
})
... ...