作者 tangxvhui

Merge branch 'dev' into test

@@ -882,6 +882,7 @@ func (service OrderInfoService) ListOrderBonusForExcel(listOrderQuery query.List @@ -882,6 +882,7 @@ func (service OrderInfoService) ListOrderBonusForExcel(listOrderQuery query.List
882 "delivery_code": result[i].DeliveryCode, 882 "delivery_code": result[i].DeliveryCode,
883 "partner_name": result[i].PartnerName, 883 "partner_name": result[i].PartnerName,
884 "bonus_status": "", 884 "bonus_status": "",
  885 + "sale_date": result[i].SaleDate,
885 "update_time": result[i].UpdateTime, 886 "update_time": result[i].UpdateTime,
886 "create_time": result[i].CreateTime, 887 "create_time": result[i].CreateTime,
887 "partner_bonus": fmt.Sprintf("%10.2f", result[i].PartnerBonus), 888 "partner_bonus": fmt.Sprintf("%10.2f", result[i].PartnerBonus),
@@ -914,6 +915,7 @@ func (service OrderInfoService) ListOrderBonusForExcel(listOrderQuery query.List @@ -914,6 +915,7 @@ func (service OrderInfoService) ListOrderBonusForExcel(listOrderQuery query.List
914 [2]string{"partner_name", "合伙人"}, 915 [2]string{"partner_name", "合伙人"},
915 [2]string{"bonus_status", "支付状态"}, 916 [2]string{"bonus_status", "支付状态"},
916 [2]string{"create_time", "创建时间"}, 917 [2]string{"create_time", "创建时间"},
  918 + [2]string{"sale_date", "销售时间"},
917 [2]string{"partner_bonus", "应收分红"}, 919 [2]string{"partner_bonus", "应收分红"},
918 [2]string{"partner_bonus_has", "已收分红"}, 920 [2]string{"partner_bonus_has", "已收分红"},
919 [2]string{"partner_bonus_not", "未收分红"}, 921 [2]string{"partner_bonus_not", "未收分红"},
@@ -23,12 +23,12 @@ func NewOrderBaseDao(transactionContext *transaction.TransactionContext) (*Order @@ -23,12 +23,12 @@ func NewOrderBaseDao(transactionContext *transaction.TransactionContext) (*Order
23 } 23 }
24 } 24 }
25 25
26 -//CheckOrderUnique 检查订单的是否已存在  
27 -//@companyId 公司id  
28 -//@orderCode 订单号  
29 -//@deliveryCode 发货单号  
30 -//@partnerCategoryCode 合伙人类型编号  
31 -//@goodNames 货品名称列表 26 +// CheckOrderUnique 检查订单的是否已存在
  27 +// @companyId 公司id
  28 +// @orderCode 订单号
  29 +// @deliveryCode 发货单号
  30 +// @partnerCategoryCode 合伙人类型编号
  31 +// @goodNames 货品名称列表
32 func (dao OrderBaseDao) CheckOrderExist(companyId int64, orderCode string, 32 func (dao OrderBaseDao) CheckOrderExist(companyId int64, orderCode string,
33 deliveryCode string, partnerCategory int64, partnerId int64, notId int64, goodNames []string) (bool, error) { 33 deliveryCode string, partnerCategory int64, partnerId int64, notId int64, goodNames []string) (bool, error) {
34 tx := dao.transactionContext.GetDB() 34 tx := dao.transactionContext.GetDB()
@@ -45,12 +45,12 @@ func (dao OrderBaseDao) CheckOrderExist(companyId int64, orderCode string, @@ -45,12 +45,12 @@ func (dao OrderBaseDao) CheckOrderExist(companyId int64, orderCode string,
45 return ok, err 45 return ok, err
46 } 46 }
47 47
48 -//OrderBonusListByCondition 根据条件获取订单分红列表  
49 -//@param orderType 订单类型  
50 -//@param partnerOrCode 合伙人姓名或订单号或发货单号  
51 -//@param companyId 公司id  
52 -//@param partnerCategory 合伙人类型  
53 -//@param createTime 创建时间 48 +// OrderBonusListByCondition 根据条件获取订单分红列表
  49 +// @param orderType 订单类型
  50 +// @param partnerOrCode 合伙人姓名或订单号或发货单号
  51 +// @param companyId 公司id
  52 +// @param partnerCategory 合伙人类型
  53 +// @param createTime 创建时间
54 func (dao OrderBaseDao) OrderBonusListByCondition(companyId int64, orderType int, partnerOrCode string, 54 func (dao OrderBaseDao) OrderBonusListByCondition(companyId int64, orderType int, partnerOrCode string,
55 partnerCategory int, createTime [2]string, limit, offset int) ([]models.OrderBase, int, error) { 55 partnerCategory int, createTime [2]string, limit, offset int) ([]models.OrderBase, int, error) {
56 tx := dao.transactionContext.GetDB() 56 tx := dao.transactionContext.GetDB()
@@ -90,7 +90,7 @@ func (dao OrderBaseDao) OrderBonusListByCondition(companyId int64, orderType int @@ -90,7 +90,7 @@ func (dao OrderBaseDao) OrderBonusListByCondition(companyId int64, orderType int
90 return orders, cnt, err 90 return orders, cnt, err
91 } 91 }
92 92
93 -//CustomOrderBonusForExcel 导出分红列表所用的结构 93 +// CustomOrderBonusForExcel 导出分红列表所用的结构
94 type CustomOrderBonusForExcel struct { 94 type CustomOrderBonusForExcel struct {
95 OrderId int64 95 OrderId int64
96 OrderType int 96 OrderType int
@@ -99,6 +99,7 @@ type CustomOrderBonusForExcel struct { @@ -99,6 +99,7 @@ type CustomOrderBonusForExcel struct {
99 DeliveryCode string 99 DeliveryCode string
100 UpdateTime string 100 UpdateTime string
101 CreateTime string 101 CreateTime string
  102 + SaleDate string
102 PartnerBonus float64 103 PartnerBonus float64
103 PartnerBonusHas float64 104 PartnerBonusHas float64
104 PartnerBonusNot float64 105 PartnerBonusNot float64
@@ -107,13 +108,13 @@ type CustomOrderBonusForExcel struct { @@ -107,13 +108,13 @@ type CustomOrderBonusForExcel struct {
107 PartnerName string 108 PartnerName string
108 } 109 }
109 110
110 -//OrderBonusListForExcel 导出分红列表所用  
111 -//@param companyId 公司id  
112 -//@param orderType 订单类型  
113 -//@param partnerOrCode 合伙人姓名或订单号或发货单号  
114 -//@param partnerCategory 合伙人类型id  
115 -//@param createTime 订单的创建时间范围"[开始时间,结束时间]" 时间格式"2006-01-02 15:04:05+07"  
116 -//@return result 查询结果数据 111 +// OrderBonusListForExcel 导出分红列表所用
  112 +// @param companyId 公司id
  113 +// @param orderType 订单类型
  114 +// @param partnerOrCode 合伙人姓名或订单号或发货单号
  115 +// @param partnerCategory 合伙人类型id
  116 +// @param createTime 订单的创建时间范围"[开始时间,结束时间]" 时间格式"2006-01-02 15:04:05+07"
  117 +// @return result 查询结果数据
117 func (dao OrderBaseDao) OrderBonusListForExcel(companyId int64, orderType int, partnerOrCode string, 118 func (dao OrderBaseDao) OrderBonusListForExcel(companyId int64, orderType int, partnerOrCode string,
118 partnerCategory int, createTime [2]string) (result []CustomOrderBonusForExcel, err error) { 119 partnerCategory int, createTime [2]string) (result []CustomOrderBonusForExcel, err error) {
119 //导出分红列表所用的sql 120 //导出分红列表所用的sql
@@ -125,6 +126,7 @@ func (dao OrderBaseDao) OrderBonusListForExcel(companyId int64, orderType int, p @@ -125,6 +126,7 @@ func (dao OrderBaseDao) OrderBonusListForExcel(companyId int64, orderType int, p
125 t1.bonus_status, 126 t1.bonus_status,
126 to_char(t1.update_time AT TIME ZONE 'CCT' ,'YYYY-MM-DD HH24:MI:SS') AS update_time, 127 to_char(t1.update_time AT TIME ZONE 'CCT' ,'YYYY-MM-DD HH24:MI:SS') AS update_time,
127 to_char(t1.create_time AT TIME ZONE 'CCT' ,'YYYY-MM-DD HH24:MI:SS') AS create_time, 128 to_char(t1.create_time AT TIME ZONE 'CCT' ,'YYYY-MM-DD HH24:MI:SS') AS create_time,
  129 + to_char(t1.sale_date AT TIME ZONE 'CCT' ,'YYYY-MM-DD HH24:MI:SS') AS sale_date,
128 (CASE 130 (CASE
129 WHEN t1.use_partner_bonus>0 131 WHEN t1.use_partner_bonus>0
130 THEN 132 THEN
@@ -183,13 +185,13 @@ func (dao OrderBaseDao) OrderBonusListForExcel(companyId int64, orderType int, p @@ -183,13 +185,13 @@ func (dao OrderBaseDao) OrderBonusListForExcel(companyId int64, orderType int, p
183 return result, nil 185 return result, nil
184 } 186 }
185 187
186 -//OrderListByCondition 获取实际订单列表  
187 -//@param companyId 公司id  
188 -//@param orderType 订单类型  
189 -//@param partnerOrCode 合伙人姓名或订单号或发货单号  
190 -//@param partnerCategory 合伙人类型id  
191 -//@param updateTime 订单更新时间范围"[开始时间,结束时间]",时间格式"2006-01-02 15:04:05+07"  
192 -//@param createTime 订单的创建时间范围"[开始时间,结束时间]" 时间格式"2006-01-02 15:04:05+07" 188 +// OrderListByCondition 获取实际订单列表
  189 +// @param companyId 公司id
  190 +// @param orderType 订单类型
  191 +// @param partnerOrCode 合伙人姓名或订单号或发货单号
  192 +// @param partnerCategory 合伙人类型id
  193 +// @param updateTime 订单更新时间范围"[开始时间,结束时间]",时间格式"2006-01-02 15:04:05+07"
  194 +// @param createTime 订单的创建时间范围"[开始时间,结束时间]" 时间格式"2006-01-02 15:04:05+07"
193 func (dao OrderBaseDao) OrderListByCondition(companyId int64, orderType int, partnerName string, orderCode string, deliveryCode string, 195 func (dao OrderBaseDao) OrderListByCondition(companyId int64, orderType int, partnerName string, orderCode string, deliveryCode string,
194 updateTime [2]string, createTime [2]string, saleDate [2]string, partnerCategory int, partnerCategoryName string, limit, offset int) ([]models.OrderBase, int, error) { 196 updateTime [2]string, createTime [2]string, saleDate [2]string, partnerCategory int, partnerCategoryName string, limit, offset int) ([]models.OrderBase, int, error) {
195 tx := dao.transactionContext.GetDB() 197 tx := dao.transactionContext.GetDB()
@@ -252,7 +254,7 @@ func (dao OrderBaseDao) OrderListByCondition(companyId int64, orderType int, par @@ -252,7 +254,7 @@ func (dao OrderBaseDao) OrderListByCondition(companyId int64, orderType int, par
252 254
253 } 255 }
254 256
255 -//CustomOrderListForExcel 导出实际订单列表所用的结构 257 +// CustomOrderListForExcel 导出实际订单列表所用的结构
256 type CustomOrderListForExcel struct { 258 type CustomOrderListForExcel struct {
257 OrderCode string //订单编号 259 OrderCode string //订单编号
258 DeliveryCode string //发货编号 260 DeliveryCode string //发货编号