Quellcode durchsuchen

add:入库/出库明细新增产品名称、产品型号搜索,入库/出库明细新增导出excel

zoie vor 2 Monaten
Ursprung
Commit
4a84170baa
5 geänderte Dateien mit 323 neuen und 31 gelöschten Zeilen
  1. 266 2
      controllers/Stock.go
  2. 10 8
      models/Stock/Device.go
  3. 15 3
      models/Stock/StockIn.go
  4. 15 3
      models/Stock/StockOut.go
  5. 17 15
      routers/Stock.go

+ 266 - 2
controllers/Stock.go

@@ -432,13 +432,15 @@ func (c *StockController) StockIn_List_Product() {
 	T_name := c.GetString("T_name")
 	T_start_date := c.GetString("T_start_date")
 	T_end_date := c.GetString("T_end_date")
+	T_product_name := c.GetString("T_product_name")   // 产品名称
+	T_product_model := c.GetString("T_product_model") // 产品型号
 
 	userList, _ := NatsServer.Read_User_List_All()
 	Account.Read_User_All_Map(userList)
 	Basic.Read_Depot_All_Map()
 
 	StockInDao := Stock.NewStockIn(orm.NewOrm())
-	R_List, R_cnt := StockInDao.Read_StockInProduct_List(T_name, T_start_date, T_end_date, T_depot_id, page, page_z)
+	R_List, R_cnt := StockInDao.Read_StockInProduct_List(T_name, T_start_date, T_end_date, T_depot_id, T_product_name, T_product_model, page, page_z)
 
 	var r_jsons lib.R_JSONS
 	r_jsons.Num = R_cnt
@@ -450,6 +452,134 @@ func (c *StockController) StockIn_List_Product() {
 	c.ServeJSON()
 	return
 }
+func (c *StockController) StockIn_List_Product_Excel() {
+	// 查询
+	T_depot_id, _ := c.GetInt("T_depot_id")
+	T_name := c.GetString("T_name")
+	T_start_date := c.GetString("T_start_date")
+	T_end_date := c.GetString("T_end_date")
+	T_product_name := c.GetString("T_product_name")   // 产品名称
+	T_product_model := c.GetString("T_product_model") // 产品型号
+
+	userList, _ := NatsServer.Read_User_List_All()
+	Account.Read_User_All_Map(userList)
+	Basic.Read_Depot_All_Map()
+
+	StockInDao := Stock.NewStockIn(orm.NewOrm())
+	R_List, _ := StockInDao.Read_StockInProduct_List(T_name, T_start_date, T_end_date, T_depot_id, T_product_name, T_product_model, 0, 9999)
+
+	filename := fmt.Sprintf("入库明细单(%s)", lib.GetRandstring(6, "0123456789", 0))
+
+	f := excelize.NewFile() // 设置单元格的值
+	Style1, _ := f.NewStyle(
+		&excelize.Style{
+			Font:      &excelize.Font{Bold: true, Size: 12, Family: "宋体"},
+			Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
+		})
+	Style2, _ := f.NewStyle(
+		&excelize.Style{
+			Font:      &excelize.Font{Bold: true, Size: 11, Family: "宋体"},
+			Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
+			Border: []excelize.Border{
+				{Type: "left", Color: "000000", Style: 1},
+				{Type: "top", Color: "000000", Style: 1},
+				{Type: "bottom", Color: "000000", Style: 1},
+				{Type: "right", Color: "000000", Style: 1},
+			},
+		})
+
+	Style3, _ := f.NewStyle(
+		&excelize.Style{
+			Font:      &excelize.Font{Size: 11, Family: "宋体"},
+			Alignment: &excelize.Alignment{Horizontal: "left", Vertical: "center", WrapText: true},
+			Border: []excelize.Border{
+				{Type: "left", Color: "000000", Style: 1},
+				{Type: "top", Color: "000000", Style: 1},
+				{Type: "bottom", Color: "000000", Style: 1},
+				{Type: "right", Color: "000000", Style: 1},
+			},
+		})
+
+	f.MergeCell("Sheet1", "A1", "K1")
+	f.SetRowStyle("Sheet1", 1, 1, Style1)
+	f.SetCellValue("Sheet1", "A1", fmt.Sprintf("入库明细单"))
+	f.SetRowHeight("Sheet1", 1, 30)
+	// 这里设置表头
+	f.SetCellStyle("Sheet1", "A2", "K2", Style2)
+	f.SetRowHeight("Sheet1", 2, 20)
+
+	f.SetCellValue("Sheet1", "A2", "序号")
+	f.SetCellValue("Sheet1", "B2", "入库单号")
+	f.SetCellValue("Sheet1", "C2", "经办人")
+	f.SetCellValue("Sheet1", "D2", "入库日期")
+	f.SetCellValue("Sheet1", "E2", "入库仓库")
+	f.SetCellValue("Sheet1", "F2", "产品名称")
+	f.SetCellValue("Sheet1", "G2", "产品型号")
+	f.SetCellValue("Sheet1", "H2", "数量")
+	f.SetCellValue("Sheet1", "I2", "是否关联SN")
+	f.SetCellValue("Sheet1", "J2", "备注")
+	f.SetCellValue("Sheet1", "K2", "SN")
+	// 设置列宽
+	f.SetColWidth("Sheet1", "A", "A", 10)
+	f.SetColWidth("Sheet1", "B", "B", 15)
+	f.SetColWidth("Sheet1", "C", "D", 10)
+	f.SetColWidth("Sheet1", "D", "D", 10)
+	f.SetColWidth("Sheet1", "E", "E", 10)
+	f.SetColWidth("Sheet1", "F", "F", 20)
+	f.SetColWidth("Sheet1", "G", "G", 15)
+	f.SetColWidth("Sheet1", "H", "H", 10)
+	f.SetColWidth("Sheet1", "I", "I", 12)
+	f.SetColWidth("Sheet1", "J", "J", 30)
+	f.SetColWidth("Sheet1", "K", "K", 100)
+	line := 2
+
+	for _, product := range R_List {
+		line += 1
+		f.SetCellValue("Sheet1", fmt.Sprintf("A%d", line), line-2)
+		f.SetCellValue("Sheet1", fmt.Sprintf("B%d", line), product.T_number)
+		f.SetCellValue("Sheet1", fmt.Sprintf("C%d", line), product.T_submit_name)
+		f.SetCellValue("Sheet1", fmt.Sprintf("D%d", line), product.T_date)
+		f.SetCellValue("Sheet1", fmt.Sprintf("E%d", line), product.T_depot_name)
+		f.SetCellValue("Sheet1", fmt.Sprintf("F%d", line), product.T_product_name)
+		f.SetCellValue("Sheet1", fmt.Sprintf("G%d", line), product.T_product_model)
+		f.SetCellValue("Sheet1", fmt.Sprintf("H%d", line), product.T_num)
+		var relation_sn string
+		if product.T_product_relation_sn == 1 {
+			relation_sn = "是"
+		} else {
+			relation_sn = "否"
+		}
+
+		f.SetCellValue("Sheet1", fmt.Sprintf("I%d", line), relation_sn)
+		f.SetCellValue("Sheet1", fmt.Sprintf("J%d", line), product.T_remark)
+		f.SetCellValue("Sheet1", fmt.Sprintf("K%d", line), product.T_relation_sn)
+
+	}
+	f.SetCellStyle("Sheet1", "A3", fmt.Sprintf("K%d", line), Style3)
+
+	// 保存文件
+	if err := f.SaveAs("ofile/" + filename + ".xlsx"); err != nil {
+		fmt.Println(err)
+	}
+	var url string
+	//// 上传 OSS
+	nats := natslibs.NewNats(Nats.Nats, conf.NatsSubj_Prefix)
+	url, is := nats.Qiniu_UploadFile(lib.GetCurrentDirectory()+"/ofile/"+filename+".xlsx", "ofile/"+filename+".xlsx")
+	if !is {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: "oss!"}
+		c.ServeJSON()
+		return
+	}
+	//删除目录
+	err := os.Remove("ofile/" + filename + ".xlsx")
+	if err != nil {
+		logs.Error(lib.FuncName(), err)
+	}
+
+	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: url}
+	c.ServeJSON()
+	return
+}
 
 func (c *StockController) StockIn_Get() {
 
@@ -1366,13 +1496,15 @@ func (c *StockController) StockOut_List_Product() {
 	T_name := c.GetString("T_name")
 	T_start_date := c.GetString("T_start_date")
 	T_end_date := c.GetString("T_end_date")
+	T_product_name := c.GetString("T_product_name")   // 产品名称
+	T_product_model := c.GetString("T_product_model") // 产品型号
 
 	userList, _ := NatsServer.Read_User_List_All()
 	Account.Read_User_All_Map(userList)
 	Basic.Read_Depot_All_Map()
 
 	StockOutDao := Stock.NewStockOut(orm.NewOrm())
-	R_List, R_cnt := StockOutDao.Read_StockOutProduct_List(T_name, T_start_date, T_end_date, T_depot_id, page, page_z)
+	R_List, R_cnt := StockOutDao.Read_StockOutProduct_List(T_name, T_start_date, T_end_date, T_depot_id, T_product_name, T_product_model, page, page_z)
 
 	var r_jsons lib.R_JSONS
 	r_jsons.Num = R_cnt
@@ -1384,6 +1516,138 @@ func (c *StockController) StockOut_List_Product() {
 	c.ServeJSON()
 	return
 }
+func (c *StockController) StockOut_List_Product_Excel() {
+
+	// 查询
+	T_depot_id, _ := c.GetInt("T_depot_id")
+	T_name := c.GetString("T_name")
+	T_start_date := c.GetString("T_start_date")
+	T_end_date := c.GetString("T_end_date")
+	T_product_name := c.GetString("T_product_name")   // 产品名称
+	T_product_model := c.GetString("T_product_model") // 产品型号
+
+	userList, _ := NatsServer.Read_User_List_All()
+	Account.Read_User_All_Map(userList)
+	Basic.Read_Depot_All_Map()
+
+	StockOutDao := Stock.NewStockOut(orm.NewOrm())
+	R_List, _ := StockOutDao.Read_StockOutProduct_List(T_name, T_start_date, T_end_date, T_depot_id, T_product_name, T_product_model, 0, 9999)
+
+	filename := fmt.Sprintf("出库明细单(%s)", lib.GetRandstring(6, "0123456789", 0))
+
+	f := excelize.NewFile() // 设置单元格的值
+	Style1, _ := f.NewStyle(
+		&excelize.Style{
+			Font:      &excelize.Font{Bold: true, Size: 12, Family: "宋体"},
+			Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
+		})
+	Style2, _ := f.NewStyle(
+		&excelize.Style{
+			Font:      &excelize.Font{Bold: true, Size: 11, Family: "宋体"},
+			Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
+			Border: []excelize.Border{
+				{Type: "left", Color: "000000", Style: 1},
+				{Type: "top", Color: "000000", Style: 1},
+				{Type: "bottom", Color: "000000", Style: 1},
+				{Type: "right", Color: "000000", Style: 1},
+			},
+		})
+
+	Style3, _ := f.NewStyle(
+		&excelize.Style{
+			Font:      &excelize.Font{Size: 11, Family: "宋体"},
+			Alignment: &excelize.Alignment{Horizontal: "left", Vertical: "center", WrapText: true},
+			Border: []excelize.Border{
+				{Type: "left", Color: "000000", Style: 1},
+				{Type: "top", Color: "000000", Style: 1},
+				{Type: "bottom", Color: "000000", Style: 1},
+				{Type: "right", Color: "000000", Style: 1},
+			},
+		})
+
+	f.MergeCell("Sheet1", "A1", "L1")
+	f.SetRowStyle("Sheet1", 1, 1, Style1)
+	f.SetCellValue("Sheet1", "A1", fmt.Sprintf("出库明细单"))
+	f.SetRowHeight("Sheet1", 1, 30)
+	// 这里设置表头
+	f.SetCellStyle("Sheet1", "A2", "L2", Style2)
+	f.SetRowHeight("Sheet1", 2, 20)
+
+	f.SetCellValue("Sheet1", "A2", "序号")
+	f.SetCellValue("Sheet1", "B2", "出库单号")
+	f.SetCellValue("Sheet1", "C2", "领取人")
+	f.SetCellValue("Sheet1", "D2", "出库日期")
+	f.SetCellValue("Sheet1", "E2", "出库仓库")
+	f.SetCellValue("Sheet1", "F2", "关联项目")
+	f.SetCellValue("Sheet1", "G2", "产品名称")
+	f.SetCellValue("Sheet1", "H2", "产品型号")
+	f.SetCellValue("Sheet1", "I2", "数量")
+	f.SetCellValue("Sheet1", "J2", "是否关联SN")
+	f.SetCellValue("Sheet1", "K2", "备注")
+	f.SetCellValue("Sheet1", "L2", "SN")
+	// 设置列宽
+	f.SetColWidth("Sheet1", "A", "A", 10)
+	f.SetColWidth("Sheet1", "B", "B", 15)
+	f.SetColWidth("Sheet1", "C", "D", 10)
+	f.SetColWidth("Sheet1", "D", "D", 10)
+	f.SetColWidth("Sheet1", "E", "E", 10)
+	f.SetColWidth("Sheet1", "F", "F", 20)
+	f.SetColWidth("Sheet1", "G", "G", 20)
+	f.SetColWidth("Sheet1", "H", "H", 15)
+	f.SetColWidth("Sheet1", "I", "I", 10)
+	f.SetColWidth("Sheet1", "J", "J", 12)
+	f.SetColWidth("Sheet1", "K", "K", 30)
+	f.SetColWidth("Sheet1", "L", "L", 100)
+	line := 2
+
+	for _, product := range R_List {
+		line += 1
+		f.SetCellValue("Sheet1", fmt.Sprintf("A%d", line), line-2)
+		f.SetCellValue("Sheet1", fmt.Sprintf("B%d", line), product.T_number)
+		f.SetCellValue("Sheet1", fmt.Sprintf("C%d", line), product.T_receive_name)
+		f.SetCellValue("Sheet1", fmt.Sprintf("D%d", line), product.T_date)
+		f.SetCellValue("Sheet1", fmt.Sprintf("E%d", line), product.T_depot_name)
+		f.SetCellValue("Sheet1", fmt.Sprintf("F%d", line), product.T_project)
+		f.SetCellValue("Sheet1", fmt.Sprintf("G%d", line), product.T_product_name)
+		f.SetCellValue("Sheet1", fmt.Sprintf("H%d", line), product.T_product_model)
+		f.SetCellValue("Sheet1", fmt.Sprintf("I%d", line), product.T_num)
+		var relation_sn string
+		if product.T_product_relation_sn == 1 {
+			relation_sn = "是"
+		} else {
+			relation_sn = "否"
+		}
+
+		f.SetCellValue("Sheet1", fmt.Sprintf("J%d", line), relation_sn)
+		f.SetCellValue("Sheet1", fmt.Sprintf("K%d", line), product.T_remark)
+		f.SetCellValue("Sheet1", fmt.Sprintf("L%d", line), product.T_relation_sn)
+
+	}
+	f.SetCellStyle("Sheet1", "A3", fmt.Sprintf("L%d", line), Style3)
+
+	// 保存文件
+	if err := f.SaveAs("ofile/" + filename + ".xlsx"); err != nil {
+		fmt.Println(err)
+	}
+	var url string
+	//// 上传 OSS
+	nats := natslibs.NewNats(Nats.Nats, conf.NatsSubj_Prefix)
+	url, is := nats.Qiniu_UploadFile(lib.GetCurrentDirectory()+"/ofile/"+filename+".xlsx", "ofile/"+filename+".xlsx")
+	if !is {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: "oss!"}
+		c.ServeJSON()
+		return
+	}
+	//删除目录
+	err := os.Remove("ofile/" + filename + ".xlsx")
+	if err != nil {
+		logs.Error(lib.FuncName(), err)
+	}
+
+	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: url}
+	c.ServeJSON()
+	return
+}
 
 func (c *StockController) StockOut_Get() {
 

+ 10 - 8
models/Stock/Device.go

@@ -56,6 +56,7 @@ type Device_R struct {
 	T_iccid           string // 物联网卡号
 	T_imei            string // 模组imei
 	T_State           int    // 1-已出库 2-未出库
+	T_device_state    int    // 1-已出库 2-未出库
 	T_remark          string
 	T_project         string
 	T_project_log     string
@@ -79,16 +80,17 @@ func DeviceToDevice_R(t Device_R) (r Device_R) {
 	r.T_sn = t.T_sn
 	r.T_iccid = t.T_iccid
 	r.T_imei = t.T_imei
-	r.T_State = t.T_State
+	r.T_State = t.T_device_state
+	r.T_device_state = t.T_device_state
 	r.T_remark = t.T_remark
 	r.T_project = t.T_project
 	r.T_project_log = t.T_project_log
 
-	r.T_product_name      =t.T_product_name
-	r.T_product_class     =t.T_product_class
-	r.T_product_model     =t.T_product_model
-	r.T_product_spec      =t.T_product_spec
-	r.T_product_img       =t.T_product_img
+	r.T_product_name = t.T_product_name
+	r.T_product_class = t.T_product_class
+	r.T_product_model = t.T_product_model
+	r.T_product_spec = t.T_product_spec
+	r.T_product_img = t.T_product_img
 
 	r.T_product_class_name = Basic.Read_ProductClass_Get(t.T_product_class)
 
@@ -251,8 +253,8 @@ func (dao *DeviceDaoImpl) Read_Device_List(T_name, T_product_name, T_product_mod
 	if len(maps_z) == 0 {
 		return r, 0
 	}
-	sql = "SELECT *,p.t_name AS t_product_name,p.t_model AS t_product_model,p.t_class AS t_product_class,p.t_spec AS t_product_spec " +
-		"FROM device d JOIN product p ON d.t_product_id = p.ID JOIN (SELECT t_sn, MAX(create_time) AS max_create_time FROM device GROUP BY t_sn) latest " +
+	sql = "SELECT *,latest.t__state as t_device_state,p.t_name AS t_product_name,p.t_model AS t_product_model,p.t_class AS t_product_class,p.t_spec AS t_product_spec " +
+		"FROM device d JOIN product p ON d.t_product_id = p.ID JOIN (SELECT t_sn,t__state, MAX(create_time) AS max_create_time FROM device GROUP BY t_sn) latest " +
 		"ON d.t_sn = latest.t_sn AND d.create_time = latest.max_create_time"
 
 	sql = sql + sqlWhere

+ 15 - 3
models/Stock/StockIn.go

@@ -185,7 +185,8 @@ func (dao *StockInDaoImpl) Read_StockIn_List(T_depot_id int, T_start_date, T_end
 }
 
 // 通过入库编号查询入库产品列表
-func (dao *StockInDaoImpl) Read_StockInProduct_List(T_name, T_start_date, T_end_date string, T_depot_id int, page int, page_z int) (
+func (dao *StockInDaoImpl) Read_StockInProduct_List(T_name, T_start_date, T_end_date string, T_depot_id int,
+	T_product_name, T_product_model string, page int, page_z int) (
 	r_ []StockInProductList, cnt int64) {
 	var offset int
 	if page <= 1 {
@@ -209,9 +210,17 @@ func (dao *StockInDaoImpl) Read_StockInProduct_List(T_name, T_start_date, T_end_
 	if len(T_end_date) > 0 {
 		sqlWhere += " AND si.t_date <= \"" + T_end_date + "\""
 	}
+	if len(T_product_name) > 0 {
+		sqlWhere += " AND p.t_name like \"%" + T_product_name + "%\""
+	}
+	if len(T_product_model) > 0 {
+		sqlWhere += " AND p.t_model like \"%" + T_product_model + "%\""
+	}
 
 	// 获取总条数
-	sql := "SELECT COUNT(product.ID) FROM stock_in_product product LEFT JOIN stock_in si ON si.t_number=product.t_number WHERE 1=1 "
+	sql := "SELECT COUNT(product.ID) FROM stock_in_product product " +
+		"JOIN product p ON product.t_product_id = p.ID " +
+		"LEFT JOIN stock_in si ON si.t_number=product.t_number WHERE 1=1 "
 	sql = sql + sqlWhere
 	fmt.Println(sql)
 	_, err := dao.orm.Raw(sql).ValuesList(&maps_z)
@@ -222,13 +231,16 @@ func (dao *StockInDaoImpl) Read_StockInProduct_List(T_name, T_start_date, T_end_
 		return r, 0
 	}
 	sql = "SELECT si.t_number as t_number,si.t_depot_id as t_depot_id,si.t_date as t_date,product.*,si.* FROM stock_in_product product " +
+		"JOIN product p ON product.t_product_id = p.ID " +
 		"LEFT JOIN stock_in si ON si.t_number=product.t_number WHERE 1=1"
 
 	sql = sql + sqlWhere
 
 	sql += " ORDER BY si.t_date DESC"
 
-	sql += " LIMIT " + strconv.Itoa(offset) + "," + strconv.Itoa(page_z)
+	if page_z != 9999 {
+		sql += " LIMIT " + strconv.Itoa(offset) + "," + strconv.Itoa(page_z)
+	}
 
 	fmt.Println(sql)
 	_, err = dao.orm.Raw(sql).QueryRows(&r)

+ 15 - 3
models/Stock/StockOut.go

@@ -263,7 +263,8 @@ func (dao *StockOutDaoImpl) Read_StockOut_T_project(T_depot_id, T_product_id int
 }
 
 // 通过入库编号查询入库产品列表
-func (dao *StockOutDaoImpl) Read_StockOutProduct_List(T_name, T_start_date, T_end_date string, T_depot_id int, page int, page_z int) (
+func (dao *StockOutDaoImpl) Read_StockOutProduct_List(T_name, T_start_date, T_end_date string, T_depot_id int,
+	T_product_name, T_product_model string, page int, page_z int) (
 	r_ []StockOutProductList, cnt int64) {
 	var offset int
 	if page <= 1 {
@@ -287,9 +288,17 @@ func (dao *StockOutDaoImpl) Read_StockOutProduct_List(T_name, T_start_date, T_en
 	if len(T_end_date) > 0 {
 		sqlWhere += " AND so.t_date <= \"" + T_end_date + "\""
 	}
+	if len(T_product_name) > 0 {
+		sqlWhere += " AND p.t_name like \"%" + T_product_name + "%\""
+	}
+	if len(T_product_model) > 0 {
+		sqlWhere += " AND p.t_model like \"%" + T_product_model + "%\""
+	}
 
 	// 获取总条数
-	sql := "SELECT COUNT(product.ID) FROM stock_out_product product LEFT JOIN stock_out so ON so.t_number=product.t_number WHERE 1=1 "
+	sql := "SELECT COUNT(product.ID) FROM stock_out_product product " +
+		"JOIN product p ON product.t_product_id = p.ID " +
+		"LEFT JOIN stock_out so ON so.t_number=product.t_number WHERE 1=1 "
 	sql = sql + sqlWhere
 	fmt.Println(sql)
 	_, err := dao.orm.Raw(sql).ValuesList(&maps_z)
@@ -300,13 +309,16 @@ func (dao *StockOutDaoImpl) Read_StockOutProduct_List(T_name, T_start_date, T_en
 		return r, 0
 	}
 	sql = "SELECT so.t_number as t_number,so.t_depot_id as t_depot_id,so.t_date as t_date,product.*,so.* FROM stock_out_product product " +
+		"JOIN product p ON product.t_product_id = p.ID " +
 		"LEFT JOIN stock_out so ON so.t_number=product.t_number WHERE 1=1"
 
 	sql = sql + sqlWhere
 
 	sql += " ORDER BY so.t_date DESC"
 
-	sql += " LIMIT " + strconv.Itoa(offset) + "," + strconv.Itoa(page_z)
+	if page_z != 9999 {
+		sql += " LIMIT " + strconv.Itoa(offset) + "," + strconv.Itoa(page_z)
+	}
 
 	fmt.Println(sql)
 	_, err = dao.orm.Raw(sql).QueryRows(&r)

+ 17 - 15
routers/Stock.go

@@ -18,24 +18,26 @@ func init() {
 		beego.NSRouter("/Detail_Excel", &controllers.StockController{}, "*:Stock_Detail_Excel"), // 导出库存明细列表
 	)
 	stockIn := beego.NewNamespace("/StockIn",
-		beego.NSRouter("/List", &controllers.StockController{}, "*:StockIn_List"),                 // 入库列表
-		beego.NSRouter("/List_Product", &controllers.StockController{}, "*:StockIn_List_Product"), // 入库列表 - 带产品明细
-		beego.NSRouter("/Get", &controllers.StockController{}, "*:StockIn_Get"),                   // 入库详情
-		beego.NSRouter("/Add", &controllers.StockController{}, "*:StockIn_Add"),                   // 入库
-		beego.NSRouter("/Edit", &controllers.StockController{}, "*:StockIn_Edit"),                 // 修改入库
-		beego.NSRouter("/Del", &controllers.StockController{}, "*:StockIn_Del"),                   // 删除入库
-		beego.NSRouter("/Excel", &controllers.StockController{}, "*:StockIn_Excel"),               // 导出入库
+		beego.NSRouter("/List", &controllers.StockController{}, "*:StockIn_List"),                             // 入库列表
+		beego.NSRouter("/List_Product", &controllers.StockController{}, "*:StockIn_List_Product"),             // 入库列表 - 带产品明细
+		beego.NSRouter("/List_Product_Excel", &controllers.StockController{}, "*:StockIn_List_Product_Excel"), // 入库产品明细excel
+		beego.NSRouter("/Get", &controllers.StockController{}, "*:StockIn_Get"),                               // 入库详情
+		beego.NSRouter("/Add", &controllers.StockController{}, "*:StockIn_Add"),                               // 入库
+		beego.NSRouter("/Edit", &controllers.StockController{}, "*:StockIn_Edit"),                             // 修改入库
+		beego.NSRouter("/Del", &controllers.StockController{}, "*:StockIn_Del"),                               // 删除入库
+		beego.NSRouter("/Excel", &controllers.StockController{}, "*:StockIn_Excel"),                           // 导出入库
 
 	)
 	stockOut := beego.NewNamespace("/StockOut",
-		beego.NSRouter("/List", &controllers.StockController{}, "*:StockOut_List"),                   // 出库列表
-		beego.NSRouter("/List_Product", &controllers.StockController{}, "*:StockOut_List_Product"),   // 出库列表 - 带产品明细
-		beego.NSRouter("/Get", &controllers.StockController{}, "*:StockOut_Get"),                     // 出库详情
-		beego.NSRouter("/Add", &controllers.StockController{}, "*:StockOut_Add"),                     // 出库
-		beego.NSRouter("/Edit_Delivery", &controllers.StockController{}, "*:StockOut_Edit_Delivery"), // 修改发货单
-		beego.NSRouter("/Edit", &controllers.StockController{}, "*:StockOut_Edit"),                   // 修改出库
-		beego.NSRouter("/Del", &controllers.StockController{}, "*:StockOut_Del"),                     // 删除出库
-		beego.NSRouter("/Excel", &controllers.StockController{}, "*:StockOut_Excel"),                 // 导出出库
+		beego.NSRouter("/List", &controllers.StockController{}, "*:StockOut_List"),                             // 出库列表
+		beego.NSRouter("/List_Product", &controllers.StockController{}, "*:StockOut_List_Product"),             // 出库列表 - 带产品明细
+		beego.NSRouter("/List_Product_Excel", &controllers.StockController{}, "*:StockOut_List_Product_Excel"), // 出库产品明细excel
+		beego.NSRouter("/Get", &controllers.StockController{}, "*:StockOut_Get"),                               // 出库详情
+		beego.NSRouter("/Add", &controllers.StockController{}, "*:StockOut_Add"),                               // 出库
+		beego.NSRouter("/Edit_Delivery", &controllers.StockController{}, "*:StockOut_Edit_Delivery"),           // 修改发货单
+		beego.NSRouter("/Edit", &controllers.StockController{}, "*:StockOut_Edit"),                             // 修改出库
+		beego.NSRouter("/Del", &controllers.StockController{}, "*:StockOut_Del"),                               // 删除出库
+		beego.NSRouter("/Excel", &controllers.StockController{}, "*:StockOut_Excel"),                           // 导出出库
 	)
 	beego.AddNamespace(device, stock, stockIn, stockOut)
 }