Browse Source

添加配送远管理,订单对应修改

huangyan 3 months ago
parent
commit
606bf42de6
3 changed files with 11 additions and 2 deletions
  1. 1 1
      .gitignore
  2. 7 1
      controllers/Order.go
  3. 3 0
      models/Function/Order.go

+ 1 - 1
.gitignore

@@ -32,7 +32,7 @@ _testmain.go
 /logs/logx
 lastupdate.tmp
 Cold_GoodsOrder
-Cold_GoodsOrder6250
+Cold_GoodsOrder
 Makefile
 main
 ofile

+ 7 - 1
controllers/Order.go

@@ -82,6 +82,7 @@ func (c *OrderController) Order_Add() {
 	T_sn := c.GetString("T_sn")
 	T_receiving := c.GetString("T_receiving")
 	ShippingUnit := c.GetString("ShippingUnit")
+	ShippingName := c.GetString("ShippingName")
 	EstimateStartTime := c.GetString("EstimateStartTime")
 	EstimateEndTime := c.GetString("EstimateEndTime")
 	T_text := c.GetString("T_text")
@@ -131,6 +132,7 @@ func (c *OrderController) Order_Add() {
 		CouriesId:         CouriesId,
 		DeliveryAddress:   DeliveryAddress,
 		ReceivingAddress:  ReceivingAddress,
+		ShippingName:      ShippingName,
 	}
 	if var_.IsExpatriate == 2 {
 		if len(var_.Phone) < 0 {
@@ -202,6 +204,7 @@ func (c *OrderController) Order_Edit() {
 	T_sn := c.GetString("T_sn")
 	T_receiving := c.GetString("T_receiving")
 	ShippingUnit := c.GetString("ShippingUnit")
+	ShippingName := c.GetString("ShippingName")
 	EstimateStartTime := c.GetString("EstimateStartTime")
 	EstimateEndTime := c.GetString("EstimateEndTime")
 	T_text := c.GetString("T_text")
@@ -236,6 +239,9 @@ func (c *OrderController) Order_Edit() {
 	if len(ReceivingAddress) > 0 {
 		r.ReceivingAddress = ReceivingAddress
 	}
+	if len(ShippingName) > 0 {
+		r.ShippingName = ShippingName
+	}
 	if len(T_sn) > 0 {
 		r.T_sn = T_sn
 	}
@@ -278,7 +284,7 @@ func (c *OrderController) Order_Edit() {
 	if T_State != 0 {
 		r.T_State = T_State
 	}
-	is := Function.Update_Order(r, "waybill_no", "t_sn", "t_receiving", "shipping_unit", "estimate_start_time", "estimate_end_time", "peer_list", "device_type", "is_expatriate", "phone", "child_pid", "t__state", "t_text", "couries_name", "couries_id")
+	is := Function.Update_Order(r, "waybill_no", "t_sn", "t_receiving", "shipping_unit", "estimate_start_time", "estimate_end_time", "peer_list", "device_type", "is_expatriate", "phone", "child_pid", "t__state", "t_text", "couries_name", "couries_id", "delivery_address", "receiving_address", "shipping_name")
 	if !is {
 		c.Data["json"] = lib.JSONS{Code: 202, Msg: "修改失败!"}
 		c.ServeJSON()

+ 3 - 0
models/Function/Order.go

@@ -25,6 +25,7 @@ type Order struct {
 	DeviceType          string    `orm:"size(256);null"`                                        // 设备类型
 	T_receiving         string    `orm:"size(256);null"`                                        // 收货单位
 	ShippingUnit        string    `orm:"size(256);null"`                                        //发货单位
+	ShippingName        string    `orm:"size(256);null"`                                        //发货单位名称
 	T_start_Ut          time.Time `orm:"type(timestamp);null;"`                                 // 起运时间
 	T_end_Ut            time.Time `orm:"type(timestamp);null;"`                                 // 到达时间
 	EstimateEndTime     time.Time `orm:"type(timestamp);null;"`                                 // 预计到达时间
@@ -69,6 +70,7 @@ type OrderR struct {
 	CouriesId         string
 	DeliveryAddress   string //发货地址
 	ReceivingAddress  string //收货地址
+	ShippingName      string //发货单位名称
 }
 
 func OrderToOrderR(t Order) (r OrderR) {
@@ -107,6 +109,7 @@ func OrderToOrderR(t Order) (r OrderR) {
 	r.CouriesId = t.CouriesId
 	r.DeliveryAddress = t.DeliveryAddress
 	r.ReceivingAddress = t.ReceivingAddress
+	r.ShippingName = t.ShippingName
 	return
 }