作者 陈志颖

Merge branch 'dev-chenzhiying' into dev

@@ -10,7 +10,7 @@ import ( @@ -10,7 +10,7 @@ import (
10 10
11 type RemoveDividendsOrderCommand struct { 11 type RemoveDividendsOrderCommand struct {
12 // 分红订单ID 12 // 分红订单ID
13 - DividendsOrderId string `cname:"分红订单ID" json:"dividendsOrderId" valid:"Required"` 13 + DividendsOrderId int64 `cname:"分红订单ID" json:"dividendsOrderId" valid:"Required"`
14 // 公司ID,通过集成REST上下文获取 14 // 公司ID,通过集成REST上下文获取
15 CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` 15 CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
16 // 组织机构ID 16 // 组织机构ID
@@ -891,15 +891,15 @@ func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeD @@ -891,15 +891,15 @@ func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeD
891 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 891 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
892 } 892 }
893 if dividendsOrder == nil { 893 if dividendsOrder == nil {
894 - return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(removeDividendsOrderCommand.DividendsOrderId))) 894 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeDividendsOrderCommand.DividendsOrderId, 10)))
895 } 895 }
896 - if dividendsOrder, err := dividendsOrderRepository.Remove(dividendsOrder); err != nil { 896 + if dividendsOrderRemoved, err := dividendsOrderRepository.Remove(dividendsOrder); err != nil {
897 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 897 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
898 } else { 898 } else {
899 if err := transactionContext.CommitTransaction(); err != nil { 899 if err := transactionContext.CommitTransaction(); err != nil {
900 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 900 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
901 } 901 }
902 - return dividendsOrder, nil 902 + return dividendsOrderRemoved, nil
903 } 903 }
904 } 904 }
905 905
@@ -1058,8 +1058,14 @@ func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateD @@ -1058,8 +1058,14 @@ func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateD
1058 } 1058 }
1059 orderTime := utils.TransformTimestampToTime(orderTimeInt) 1059 orderTime := utils.TransformTimestampToTime(orderTimeInt)
1060 1060
  1061 + // 分红订单ID类型转换
  1062 + dividendsOrderId, err := strconv.ParseInt(updateDividendsOrderCommand.DividendsOrderId, 10, 64)
  1063 + if err != nil {
  1064 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  1065 + }
  1066 +
1061 // 获取分红订单 1067 // 获取分红订单
1062 - dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{"dividendsOrderId": updateDividendsOrderCommand.DividendsOrderId}) 1068 + dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{"dividendsOrderId": dividendsOrderId})
1063 if err != nil { 1069 if err != nil {
1064 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "分红订单不存在") 1070 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "分红订单不存在")
1065 } 1071 }
@@ -76,7 +76,7 @@ func (controller *DividendsOrderController) RemoveDividendsOrder() { @@ -76,7 +76,7 @@ func (controller *DividendsOrderController) RemoveDividendsOrder() {
76 removeDividendsOrderCommand.OrgId = header.OrgId 76 removeDividendsOrderCommand.OrgId = header.OrgId
77 removeDividendsOrderCommand.UserId = header.UserId 77 removeDividendsOrderCommand.UserId = header.UserId
78 removeDividendsOrderCommand.UserBaseId = header.UserBaseId 78 removeDividendsOrderCommand.UserBaseId = header.UserBaseId
79 - dividendsOrderId := controller.GetString(":dividendsOrderId") 79 + dividendsOrderId, _ := controller.GetInt64(":dividendsOrderId")
80 removeDividendsOrderCommand.DividendsOrderId = dividendsOrderId 80 removeDividendsOrderCommand.DividendsOrderId = dividendsOrderId
81 data, err := dividendsOrderService.RemoveDividendsOrder(removeDividendsOrderCommand) 81 data, err := dividendsOrderService.RemoveDividendsOrder(removeDividendsOrderCommand)
82 controller.Response(data, err) 82 controller.Response(data, err)