|
@@ -572,8 +572,40 @@ func ActivitySpecialCompanyApproval(companyId int,companyName string) (err error
|
|
|
packageTypeMap := map[int]int{1: 16, 2: 10}
|
|
|
totalTrip := packageTypeMap[packageType]
|
|
|
itemBill.BillDetailed = totalTrip
|
|
|
+ itemBill.Total = strconv.Itoa(totalTrip) + "次"
|
|
|
} else {
|
|
|
- itemBill.BillDetailed = 5
|
|
|
+ itemBill.BillDetailed = 15
|
|
|
+ list, e := company.GetCompanyReportPermissionUpgrade(companyId, 2)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetCompanyReportPermissionUpgrade, Err: " + e.Error())
|
|
|
+ }
|
|
|
+ if len(list) == 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var chartPermissionIdSlice []string
|
|
|
+ mapChartName := make(map[string]int)
|
|
|
+ mapPermissionNameTrip := make(map[string]int)
|
|
|
+
|
|
|
+ for _, v := range list {
|
|
|
+ chartPermissionIdSlice = append(chartPermissionIdSlice, strconv.Itoa(v.ChartPermissionId))
|
|
|
+ }
|
|
|
+ chartList, e := models.GetChartPermissionByIds(chartPermissionIdSlice)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("获取品种信息失败, Err:" + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if len(chartList) == 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range chartList {
|
|
|
+ mapChartName[v.PermissionName] = 5 + mapPermissionNameTrip[v.ChartPermissionName]
|
|
|
+ }
|
|
|
+ for k, v := range mapChartName {
|
|
|
+ if v > 0 {
|
|
|
+ itemBill.Total += k + strconv.Itoa(v) + "次+"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ itemBill.Total = strings.TrimRight(itemBill.Total, "+")
|
|
|
}
|
|
|
err = cygx.AddCygxActivitySpecialTripBill(itemBill)
|
|
|
if err != nil {
|
|
@@ -585,17 +617,23 @@ func ActivitySpecialCompanyApproval(companyId int,companyName string) (err error
|
|
|
|
|
|
|
|
|
func ActivitySpecialPublishAndCancel(activityInfo *cygx.ActivitySpecialDetail) (err error) {
|
|
|
- itemBill := new(cygx.CygxActivitySpecialTripBill)
|
|
|
- itemBill.CreateTime = time.Now()
|
|
|
- itemBill.ActivityId = activityInfo.ActivityId
|
|
|
- itemBill.Content = activityInfo.ResearchTheme + "--活动取消"
|
|
|
- itemBill.Source = 2
|
|
|
- itemBill.DoType = 2
|
|
|
- itemBill.Way = 4
|
|
|
- itemBill.BillDetailed = 1
|
|
|
- err = cygx.AddCygxActivitySpecialTripBill(itemBill)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return
|
|
|
}
|