From 389b4da5feedfc0b49d7c6540bc836267d7bbee0 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 23 九月 2025 08:46:15 +0800
Subject: [PATCH] 作业本送货 加上客户单位 完成 订单状态默认未送货 完成
---
CY_ECommercePlatform/CY.WebForm/Pages/business/OrderList.aspx.cs | 244 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 242 insertions(+), 2 deletions(-)
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/OrderList.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/OrderList.aspx.cs
index 321a5f0..96cfe90 100644
--- a/CY_ECommercePlatform/CY.WebForm/Pages/business/OrderList.aspx.cs
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/OrderList.aspx.cs
@@ -28,6 +28,10 @@
using CY.Infrastructure.Common;
using CY.BLL;
using CY.WebForm.Pages.common;
+using System.IO;
+using CY.Infrastructure.Query;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
namespace CY.WebForm.Pages.business
{
@@ -60,6 +64,11 @@
{
try
{
+ if (Request["isSession"] != null)
+ {
+ if (!IsPostBack && !IsCallback)
+ Session["OrderList"] = null;
+ }
if (Request["downId"] != null)
{
int iDownId = Convert.ToInt32(Request["downId"]);
@@ -104,6 +113,9 @@
{
case "AcceptOrder":
Accept();
+ break;
+ case "SuodanOrder":
+ Suodan();
break;
case "AcceptOrderAll":
AcceptAll();
@@ -276,6 +288,25 @@
{
}
Response.Write(_eC_OrderBasicBLL.AcceptOrder(orderId.Value, commission.Value) ? "1" : "0");
+ }
+
+
+ /// <summary>
+ /// 閿佸崟
+ /// </summary>
+ private void Suodan()
+ {
+ Response.Clear();
+ int? orderId = string.IsNullOrEmpty(Request["id"]) ? null : MyConvert.ConvertToInt32(Request["id"]);
+ if (!orderId.HasValue)
+ {
+ Response.Write("-2");
+ return;
+ }
+ else
+ {
+ }
+ Response.Write(_eC_OrderBasicBLL.SuodingOrder(orderId.Value, CurrentUser.ShortName) ? "1" : "0");
}
/// <summary>
@@ -529,8 +560,81 @@
SetParamValue(searchParam, 19, CurrentUser.TrueMemberId);
SetParamValue(searchParam, 20, CurrentUser.StaffId);
SetParamValue(searchParam, 21, CurrentUser.TrueName);
- //SetParamValue(searchParam, 28, this.txtSearchyjname.Value);
+ SetParamValue(searchParam, 28, this.txtSearchyjname.Value);
+ SetParamValue(searchParam, 30, this.selWorkStates.Value);
+ SetParamValue(searchParam, 31, this.selDeleverStates.Value);
+ if (!IsPostBack && !IsCallback)
+ {
+ if (Session["OrderList"] != null)
+ {
+ //鍏堣繕鍘熻〃鍗�
+ searchParam = Session["OrderList"] as Dictionary<int, object>;
+ if (searchParam.Keys.Count(x => x == 4)<=0)
+ {
+ this.txtBeginData.Value = "";
+ }
+ if (searchParam.Keys.Count(x => x == 5) <= 0)
+ {
+ this.txtEndDate.Value = "";
+ }
+ foreach (int index in searchParam.Keys)
+ {
+ if (index == 2)
+ this.txtOrderId.Value = searchParam[index].ToString();
+ if (index == 3)
+ this.txtCustormerName.Value = searchParam[index].ToString();
+ if (index == 4)
+ this.txtBeginData.Value = searchParam[index].ToString();
+ if (index == 5)
+ this.txtEndDate.Value = searchParam[index].ToString();
+ if (index == 6)
+ this.selPrintTypes.Value = searchParam[index].ToString();
+ if (index == 7)
+ this.selOrderTypes.Value = searchParam[index].ToString();
+ if (index == 8)
+ this.selOrderStates.Value = searchParam[index].ToString();
+ if (index == 9)
+ this.selPayStates.Value = searchParam[index].ToString();
+ if (index == 10)
+ this.txtCreaterName.Value = searchParam[index].ToString();
+ if (index == 11)
+ this.selCustormerLevels.Value = searchParam[index].ToString();
+ if (index == 12)
+ this.selCustormerManager.Value = searchParam[index].ToString();
+ if (index == 13)
+ this.selBusinessManager.Value = searchParam[index].ToString();
+ if (index == 14)
+ this.selPayType.SelectedValue = searchParam[index].ToString();
+ if (index == 15)
+ this.selReturnvisit.SelectedValue = searchParam[index].ToString();
+ if (index == 16)
+ this.selAppraise.SelectedValue = searchParam[index].ToString();
+ if (index == 28)
+ this.txtSearchyjname.Value = searchParam[index].ToString();
+ if (index == 30)
+ this.selWorkStates.Value = searchParam[index].ToString();
+ if (index == 31)
+ this.selDeleverStates.Value = searchParam[index].ToString();
+
+ }
+
+
+
+
+ SetParamValue(searchParam, 1, CurrentUser.MemberId);
+ SetParamValue(searchParam, 18, (CurrentUser.StaffId > 0 ? 1 : 0));
+ SetParamValue(searchParam, 19, CurrentUser.TrueMemberId);
+ SetParamValue(searchParam, 20, CurrentUser.StaffId);
+ SetParamValue(searchParam, 21, CurrentUser.TrueName);
+ }
+ }
+ else
+ {
+ Session["OrderList"] = searchParam;
+ }
SearchParam = searchParam;
+
+
UCPager1.AspNetPager.CurrentPageIndex = 1;//閲嶇疆椤垫暟
//鍐嶆鏌ヨ
AspNetPager_PageChanged(UCPager1.AspNetPager, new EventArgs());
@@ -575,6 +679,20 @@
PageIndex = UCPager1.AspNetPager.CurrentPageIndex
};
IEnumerable<EC_OrderBasic> result = _eC_OrderBasicBLL.SelectModelPage_Seller(pagination, SearchParam);
+
+ foreach (var eC_OrderBasic in result)
+ {
+ if(eC_OrderBasic.DeliveryTime.HasValue && eC_OrderBasic.DeliveryTime.Value < DateTime.Now.Date)
+ {
+ eC_OrderBasic.Shifoubiaohongwangong = "<p style=\"color:red;\">瀹屽伐</p>";
+ eC_OrderBasic.Shifoubiaohongsonghuo = "<p style=\"color:red;\">閫佽揣</p>";
+ }
+ else
+ {
+ eC_OrderBasic.Shifoubiaohongwangong = "瀹屽伐";
+ eC_OrderBasic.Shifoubiaohongsonghuo = "閫佽揣";
+ }
+ }
rptData.DataSource = result;
rptData.DataBind();
@@ -665,7 +783,7 @@
{
if (opType == "鎾ゅ崟")
{
- if (orderState == 4 || orderState == 5)
+ if (orderState == 3 || orderState == 4 || orderState == 5)
{
isCan = false;
}
@@ -685,6 +803,128 @@
return isCan;
}
+
+ //鏌ヨ浜嬩欢
+ protected void btn_Daochu_Click(object src, EventArgs e)
+ {
+
+ byte[] fileBytes = ExportToExcel();
+ if (fileBytes != null)
+ {
+ Response.Clear();
+ Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
+ Response.AppendHeader("Content-Disposition", "attachment; filename=璁㈠崟瀵煎嚭.xlsx");
+ Response.BinaryWrite(fileBytes);
+ Response.End();
+ }
+ else
+ {
+ // 澶勭悊瀵煎嚭澶辫触鐨勬儏鍐�
+ Response.Write("瀵煎嚭澶辫触锛岃绋嶅悗閲嶈瘯锛�");
+ }
+
+ }
+
+ public byte[] ExportToExcel()
+ {
+ byte[] bt = null;
+ try
+ {
+ Pagination pa = new Pagination();
+ pa.PageSize = 500;
+ pa.PageIndex = 1;
+
+ Dictionary<int, object> searchParam = new Dictionary<int, object>();
+
+ SetParamValue(searchParam, 1, CurrentUser.MemberId);
+ SetParamValue(searchParam, 2, this.txtOrderId.Value.Trim());
+ SetParamValue(searchParam, 3, this.txtCustormerName.Value.Trim());
+ SetParamValue(searchParam, 4, this.txtBeginData.Value.Trim());
+ SetParamValue(searchParam, 5, this.txtEndDate.Value.Trim());
+ SetParamValue(searchParam, 6, this.selPrintTypes.Value);
+ SetParamValue(searchParam, 7, this.selOrderTypes.Value);
+ SetParamValue(searchParam, 8, this.selOrderStates.Value);
+ SetParamValue(searchParam, 9, this.selPayStates.Value);
+ SetParamValue(searchParam, 10, this.txtCreaterName.Value.Trim());
+ SetParamValue(searchParam, 11, this.selCustormerLevels.Value);
+ SetParamValue(searchParam, 12, this.selCustormerManager.Value);
+ SetParamValue(searchParam, 13, this.selBusinessManager.Value);
+ SetParamValue(searchParam, 14, this.selPayType.SelectedValue);
+ SetParamValue(searchParam, 15, this.selReturnvisit.SelectedValue);
+ SetParamValue(searchParam, 16, this.selAppraise.SelectedValue);
+ SetParamValue(searchParam, 18, (CurrentUser.StaffId > 0 ? 0 : 0));
+ SetParamValue(searchParam, 19, CurrentUser.TrueMemberId);
+ SetParamValue(searchParam, 20, CurrentUser.StaffId);
+ SetParamValue(searchParam, 21, CurrentUser.TrueName);
+ SetParamValue(searchParam, 28, this.txtSearchyjname.Value);
+
+ var oA_WorkPlans = _eC_OrderBasicBLL.SelectModelPage_Seller(pa, searchParam);
+
+
+ // 鍒涘缓宸ヤ綔绨�
+ IWorkbook workbook = new XSSFWorkbook();
+ ISheet sheet = workbook.CreateSheet("瀵煎嚭鏁版嵁");
+
+ // 鍒涘缓琛ㄥご
+ IRow headerRow = sheet.CreateRow(0);
+ headerRow.CreateCell(0).SetCellValue("缂栧彿");
+ headerRow.CreateCell(1).SetCellValue("璁㈠崟鍙�");
+ headerRow.CreateCell(2).SetCellValue("瀹㈡埛鍚嶇О");
+ headerRow.CreateCell(3).SetCellValue("璁㈠崟鏉ユ簮");
+ headerRow.CreateCell(4).SetCellValue("璁㈠崟绫诲埆");
+ headerRow.CreateCell(5).SetCellValue("鍚堝悓搴忓彿");
+ headerRow.CreateCell(6).SetCellValue("鍗颁欢鍚嶇О");
+ headerRow.CreateCell(7).SetCellValue("鏁伴噺");
+ headerRow.CreateCell(8).SetCellValue("鍗曚綅");
+ headerRow.CreateCell(9).SetCellValue("璁㈠崟鐘舵��");
+ headerRow.CreateCell(10).SetCellValue("鏀舵鐘舵��");
+ headerRow.CreateCell(11).SetCellValue("浠樻鏂瑰紡");
+ headerRow.CreateCell(12).SetCellValue("閲戦");
+ headerRow.CreateCell(13).SetCellValue("宸叉敹娆�");
+ headerRow.CreateCell(14).SetCellValue("鏈粯娆�");
+ headerRow.CreateCell(15).SetCellValue("閫佽揣閲戦");
+
+ // 娣诲姞鏁版嵁
+ int rowIndex = 1;
+ foreach (var order in oA_WorkPlans)
+ {
+ IRow row = sheet.CreateRow(rowIndex++);
+ row.CreateCell(0).SetCellValue((rowIndex - 1).ToString());
+ row.CreateCell(1).SetCellValue(order.SellerOrderId);
+ row.CreateCell(2).SetCellValue(order.BuyerName);
+ row.CreateCell(3).SetCellValue(order.OrderType.Name);
+ row.CreateCell(4).SetCellValue(order.PrintType.PrintName);
+ row.CreateCell(5).SetCellValue(order.Duiyinghetongbianhao);
+ row.CreateCell(6).SetCellValue(order.DocumentName);
+ row.CreateCell(7).SetCellValue(order.OrderExtend.PrintNum.HasValue? order.OrderExtend.PrintNum.Value:0);
+ row.CreateCell(8).SetCellValue(order.yssldw);
+ row.CreateCell(9).SetCellValue(order.OrderStateObj.Name);
+ row.CreateCell(10).SetCellValue(order.PayStateObj.Name);
+ row.CreateCell(11).SetCellValue(order.PayType);
+ row.CreateCell(12).SetCellValue(order.SumPrice.HasValue? order.SumPrice.Value.ToDouble2().Value:0);
+ row.CreateCell(13).SetCellValue(order.TradingSingle.PayedMoney.HasValue ? order.TradingSingle.PayedMoney.Value.ToDouble2().Value : 0);
+ row.CreateCell(14).SetCellValue(order.UnPayedMoney.ToDouble2().Value);
+ row.CreateCell(15).SetCellValue(order.SonghuoJine.HasValue ? order.SonghuoJine.Value.ToDouble2().Value : 0);
+
+
+ }
+
+ // 灏嗗伐浣滅翱鍐欏叆鍐呭瓨娴�
+ using (var ms = new MemoryStream())
+ {
+ workbook.Write(ms);
+ bt = ms.ToArray();
+ }
+ }
+ catch (Exception e)
+ {
+ bt = null;
+ // 璁板綍鏃ュ織
+
+ }
+ return bt;
+ }
+
/// <summary>
/// 鏄惁宸茬粡鎿嶄綔
/// </summary>
--
Gitblit v1.9.1