renjiaojiao 1 год назад
Родитель
Сommit
b87ccf486b
3 измененных файлов с 17 добавлено и 18 удалено
  1. 1 1
      src/commonApi/workDayApi.go
  2. 5 3
      src/order/orderManageController.go
  3. 11 14
      src/order/orderManageService.go

+ 1 - 1
src/commonApi/workDayApi.go

@@ -126,7 +126,7 @@ func RegisterCalculateWorkDayApi() {
 				return nil, fmt.Errorf("参数格式异常")
 			}
 
-			if cwd.WorkDayNum <= 0 {
+			if cwd.WorkDayNum < 0 {
 				return nil, fmt.Errorf("请输入正确工作日数量")
 			}
 			t, err := time.Parse(util.Date_Short_Layout, cwd.InputTime)

+ 5 - 3
src/order/orderManageController.go

@@ -2014,7 +2014,7 @@ func CreateSubOrder(context *admin.Context) (interface{}, error) {
 	if param.AgreementStatus == 999 {
 		return nil, errors.New("缺少协议状态")
 	}
-
+	param.PaybackOpenServer = true
 	param.CreatePerson = context.User.Username
 	param.SaleTime = strings.Split(param.SaleTime, " ")[0] + " " + strings.Split(qutil.NowFormat(qutil.Date_Full_Layout), " ")[1]
 	if param.Phone != "" {
@@ -2272,6 +2272,7 @@ func UpdateSubOrder(context *admin.Context) (interface{}, error) {
 		return nil, errors.New("未知企业id")
 	}
 	param.CreatePerson = context.User.Username
+	param.PaybackOpenServer = true
 	if param.Phone != "" {
 		res := map[string]interface{}{}
 		data := util.JysqlDB.SelectBySql("SELECT d.* FROM `dataexport_order` d WHERE d.order_code = ?", param.OrderCode)
@@ -2537,7 +2538,7 @@ func CreateSupplyOrder(context *admin.Context) (interface{}, error) {
 	if param.AgreementStatus == 999 {
 		return nil, errors.New("缺少协议状态")
 	}
-
+	param.PaybackOpenServer = true
 	param.CreatePerson = context.User.Username
 	param.SaleTime = strings.Split(param.SaleTime, " ")[0] + " " + strings.Split(qutil.NowFormat(qutil.Date_Full_Layout), " ")[1]
 	if param.Phone != "" {
@@ -2825,7 +2826,7 @@ func UpdateSupplyOrder(context *admin.Context) (interface{}, error) {
 	if param.BuySubject == "" {
 		return nil, errors.New("缺少购买主体")
 	}
-
+	param.PaybackOpenServer = true
 	param.CreatePerson = context.User.Username
 	if param.Phone != "" {
 		res := map[string]interface{}{}
@@ -3051,6 +3052,7 @@ func MyUpdateSupplySubOrder(context *admin.Context) (interface{}, error) {
 		return nil, errors.New("缺少协议状态")
 	}
 	//param.BuySubject = "1"
+	param.PaybackOpenServer = true
 	param.CreatePerson = context.User.Username
 	if param.Phone != "" {
 		res := map[string]interface{}{}

+ 11 - 14
src/order/orderManageService.go

@@ -48,21 +48,18 @@ func createBigOrderCheck(param Params) error {
 	if param.PayCycle == 0 && param.CreateType != 2 {
 		return errors.New("缺少周期")
 	}
-	if param.PayMoney > 0 {
-		//扩充服务无实付金额
-		if param.PayMoney == 0 && param.CreateType != 2 {
-			return errors.New("缺少大会员金额")
-		}
-		if param.OrderMoney == 0 {
-			return errors.New("缺少订单金额")
-		}
-		/*if param.PaySub > 0 && (param.SubMoney == 0 || param.SubPayMoney == 0) {
-			return errors.New("缺少子账号金额")
-		}
-		if param.ServerArr != nil && len(param.ServerArr) > 0 && (param.SupplyMoney == 0 || param.SupplyPayMoney == 0) {
-			return errors.New("缺少补充包金额")
-		}*/
+	//if param.PayMoney > 0 {
+	//扩充服务无实付金额
+	/*if param.OrderMoney == 0 {
+		return errors.New("缺少订单金额")
+	}*/
+	/*if param.PaySub > 0 && (param.SubMoney == 0 || param.SubPayMoney == 0) {
+		return errors.New("缺少子账号金额")
 	}
+	if param.ServerArr != nil && len(param.ServerArr) > 0 && (param.SupplyMoney == 0 || param.SupplyPayMoney == 0) {
+		return errors.New("缺少补充包金额")
+	}*/
+	//}
 	if param.AgreementStatus == 999 {
 		return errors.New("缺少协议状态")
 	}