瀏覽代碼

fix:订单详情页增加发票时间限制操作

duxin 1 年之前
父節點
當前提交
a9e49857b8

+ 3 - 4
src/jfw/modules/subscribepay/src/config/config.go

@@ -162,10 +162,7 @@ type config struct {
 			Name       string `json:"name"`
 		} `json:"activity"`
 	} `json:"payRaffle"`
-	NewOrderTime   int64  `json:"newOrderTime"`
-	SigningSubject string `json:"signing_subject"` //管理后台订单发票签约主体配置
-	SubmitNum      int64  `json:"submit_num"`
-	OrderTime      int64  `json:"orderTime"`
+	NewOrderTime int64 `json:"newOrderTime"`
 }
 type mgoConf struct {
 	Address           string
@@ -243,6 +240,8 @@ type Invoice struct {
 	Red_invoice_msg    string //提示信息
 	Third_party_switch bool   //第三方开票开关
 	Order_createtime   int64  //24年之前的订单不能开票
+	SigningSubject     string `json:"signing_subject"` //管理后台订单发票签约主体配置
+	SubmitNum          int64  `json:"submit_num"`
 }
 
 type entnicheConfig struct {

+ 12 - 10
src/jfw/modules/subscribepay/src/service/invoice.go

@@ -461,9 +461,10 @@ func (this *Invoice) ShowinvoiceList() {
 				continue
 			}
 			delete(data, "user_id")
-			isJyInvoice := !strings.Contains(qutil.InterfaceToStr(data["url"]), "/jyInvoice/") //非数电票
-			isJyEntity := data["invoicing_entity"] != nil && qutil.InterfaceToStr(data["invoicing_entity"]) != config.Config.SigningSubject
-			data["changed"] = qutil.If(isJyInvoice || isChanged || isJyEntity, true, false)
+			timeLimit := qutil.Int64All(data["create_time"]) <= config.InvoiceConfig.Order_createtime //24年之前的发票不让换票
+			isJyInvoice := !strings.Contains(qutil.InterfaceToStr(data["url"]), "/jyInvoice/")        //非数电票
+			isJyEntity := data["invoicing_entity"] != nil && qutil.InterfaceToStr(data["invoicing_entity"]) != config.InvoiceConfig.SigningSubject
+			data["changed"] = qutil.If(isJyInvoice || isChanged || isJyEntity || timeLimit, true, false)
 			if url := qutil.InterfaceToStr(data["url"]); url != "" {
 				//ios 移动端
 				if isIos {
@@ -473,12 +474,13 @@ func (this *Invoice) ShowinvoiceList() {
 					}
 				}
 			}
-			var isReopen bool
-			if data["invoice_status"] == -1 {
+			isReopen := timeLimit
+			//var isReopen bool
+			if data["invoice_status"] == -1 && !isReopen {
 				isReopen = util.Mysql.Count("invoice_fail_record", map[string]interface{}{
 					"only_Identifying": data["only_Identifying"],
 					"order_code":       order_code,
-				})+1 >= config.Config.SubmitNum
+				})+1 >= config.InvoiceConfig.SubmitNum
 			}
 			data["isReopen"] = isReopen
 			invoiceData = append(invoiceData, data)
@@ -1114,7 +1116,7 @@ func (this *Invoice) NewReplaceinvoice() {
 	sid := this.GetString("sid")
 	oRes := util.Mysql.FindOne(dbname, map[string]interface{}{"id": sid, "invoie_changed": 0}, "", "") //仅线上开发票可换票
 	if oRes != nil && len(*oRes) > 0 &&
-		((*oRes)["invoicing_entity"] == nil || qutil.InterfaceToStr((*oRes)["invoicing_entity"]) == config.Config.SigningSubject) {
+		((*oRes)["invoicing_entity"] == nil || qutil.InterfaceToStr((*oRes)["invoicing_entity"]) == config.InvoiceConfig.SigningSubject) {
 		var (
 			qSql    string
 			errCode []string
@@ -1372,7 +1374,7 @@ func QmxInvoice(res map[string]interface{}) bool {
 	if res["is_backstage_order"] == 1 && res["order_channel"] != "xdqd04" {
 		if res["return_status"] == 1 && util.Mysql.Count("invoice", map[string]interface{}{
 			"order_code": res["order_code"],
-		}) == 0 && res["signing_subject"] == config.Config.SigningSubject {
+		}) == 0 && res["signing_subject"] == config.InvoiceConfig.SigningSubject {
 			return true
 		}
 	}
@@ -1525,7 +1527,7 @@ func OpenInvoiceAgain(oldOnlyIdentifying string, data map[string]interface{}) er
 	if !ok {
 		return errors.New("插入失败记录出错")
 	}
-	if util.Mysql.Count("invoice_fail_record", map[string]interface{}{"only_Identifying": oldOnlyIdentifying}) >= int64(config.Config.SubmitNum) {
+	if util.Mysql.Count("invoice_fail_record", map[string]interface{}{"only_Identifying": oldOnlyIdentifying}) >= config.InvoiceConfig.SubmitNum {
 		return errors.New("提交次数已达上限")
 	}
 	if !util.Mysql.Update("invoice", map[string]interface{}{"only_Identifying": oldOnlyIdentifying}, data) {
@@ -1719,7 +1721,7 @@ func (this *Invoice) InvoiceQuery() {
 			(*invoiceOne)["isReopen"] = util.Mysql.Count("invoice_fail_record", map[string]interface{}{
 				"only_Identifying": (*invoiceOne)["only_Identifying"],
 				"order_code":       (*invoiceOne)["order_code"],
-			})+1 >= config.Config.SubmitNum
+			})+1 >= config.InvoiceConfig.SubmitNum
 		}
 	}
 	this.ServeJson(NewResult(map[string]interface{}{

文件差異過大導致無法顯示
+ 917 - 917
src/jfw/modules/subscribepay/src/service/orderListDetails.go


部分文件因文件數量過多而無法顯示