作者 陈志颖

Merge branch 'dev-chenzhiying' into dev

... ... @@ -10,7 +10,7 @@ import (
type RemoveDividendsOrderCommand struct {
// 分红订单ID
DividendsOrderId string `cname:"分红订单ID" json:"dividendsOrderId" valid:"Required"`
DividendsOrderId int64 `cname:"分红订单ID" json:"dividendsOrderId" valid:"Required"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
// 组织机构ID
... ...
... ... @@ -891,15 +891,15 @@ func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeD
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if dividendsOrder == nil {
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(removeDividendsOrderCommand.DividendsOrderId)))
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeDividendsOrderCommand.DividendsOrderId, 10)))
}
if dividendsOrder, err := dividendsOrderRepository.Remove(dividendsOrder); err != nil {
if dividendsOrderRemoved, err := dividendsOrderRepository.Remove(dividendsOrder); 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 dividendsOrder, nil
return dividendsOrderRemoved, nil
}
}
... ... @@ -1058,8 +1058,14 @@ func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateD
}
orderTime := utils.TransformTimestampToTime(orderTimeInt)
// 分红订单ID类型转换
dividendsOrderId, err := strconv.ParseInt(updateDividendsOrderCommand.DividendsOrderId, 10, 64)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
// 获取分红订单
dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{"dividendsOrderId": updateDividendsOrderCommand.DividendsOrderId})
dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{"dividendsOrderId": dividendsOrderId})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "分红订单不存在")
}
... ...
... ... @@ -76,7 +76,7 @@ func (controller *DividendsOrderController) RemoveDividendsOrder() {
removeDividendsOrderCommand.OrgId = header.OrgId
removeDividendsOrderCommand.UserId = header.UserId
removeDividendsOrderCommand.UserBaseId = header.UserBaseId
dividendsOrderId := controller.GetString(":dividendsOrderId")
dividendsOrderId, _ := controller.GetInt64(":dividendsOrderId")
removeDividendsOrderCommand.DividendsOrderId = dividendsOrderId
data, err := dividendsOrderService.RemoveDividendsOrder(removeDividendsOrderCommand)
controller.Response(data, err)
... ...