|
|
@@ -1270,6 +1270,119 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
+ #region 快捷导出Excel
|
|
|
+ public IActionResult QuickExportExcel(string right)
|
|
|
+ {
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
+ ViewBag.right = right;
|
|
|
+
|
|
|
+ return View();
|
|
|
+ }
|
|
|
+
|
|
|
+ [HttpPost]
|
|
|
+ public string QuickExportExcelDo(string UserIdMakerCode, string UserIdRealName, string PayModeSelect, string StoreIdStoreNo, string StoreIdStoreName, string RefundStatusSelect, string DeliveryTypeSelect, string SendStatusSelect, string ProductIdSelect, string StoreTypeSelect, string StoreUserIdMakerCode, string StoreUserIdRealName, string PayStatusSelect, string CreateDateData, string SendDateData, string PayDateData)
|
|
|
+ {
|
|
|
+
|
|
|
+ string SqlString = " and Status>-1";
|
|
|
+ //创客编号
|
|
|
+ if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
+ {
|
|
|
+ SqlString += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ }
|
|
|
+ //创客真实姓名
|
|
|
+ if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
+ {
|
|
|
+ SqlString += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
|
|
|
+ }
|
|
|
+ //支付方式
|
|
|
+ if (!string.IsNullOrEmpty(PayModeSelect))
|
|
|
+ {
|
|
|
+ SqlString += " and PayMode=" + PayModeSelect;
|
|
|
+ }
|
|
|
+ //仓库编号
|
|
|
+ if (!string.IsNullOrEmpty(StoreIdStoreNo))
|
|
|
+ {
|
|
|
+ SqlString += " and StoreId in (select StoreId from StoreHouseForStoreNo where StoreNo='" + StoreIdStoreNo + "')";
|
|
|
+ }
|
|
|
+ //仓库名称
|
|
|
+ if (!string.IsNullOrEmpty(StoreIdStoreName))
|
|
|
+ {
|
|
|
+ SqlString += " and StoreId in (select StoreId from StoreHouseForStoreName where StoreName='" + StoreIdStoreName + "')";
|
|
|
+ }
|
|
|
+ //退款状态
|
|
|
+ if (!string.IsNullOrEmpty(RefundStatusSelect))
|
|
|
+ {
|
|
|
+ SqlString += " and RefundStatus=" + RefundStatusSelect;
|
|
|
+ }
|
|
|
+ //提货类型
|
|
|
+ if (!string.IsNullOrEmpty(DeliveryTypeSelect))
|
|
|
+ {
|
|
|
+ SqlString += " and DeliveryType=" + DeliveryTypeSelect;
|
|
|
+ }
|
|
|
+ //发货状态
|
|
|
+ if (!string.IsNullOrEmpty(SendStatusSelect))
|
|
|
+ {
|
|
|
+ SqlString += " and SendStatus=" + SendStatusSelect;
|
|
|
+ }
|
|
|
+ //商品名称
|
|
|
+ if (!string.IsNullOrEmpty(ProductIdSelect))
|
|
|
+ {
|
|
|
+ SqlString += " and ProductId=" + ProductIdSelect;
|
|
|
+ }
|
|
|
+ //仓库类型
|
|
|
+ if (!string.IsNullOrEmpty(StoreTypeSelect))
|
|
|
+ {
|
|
|
+ SqlString += " and StoreType=" + StoreTypeSelect;
|
|
|
+ }
|
|
|
+ //仓库归属创客编号
|
|
|
+ if (!string.IsNullOrEmpty(StoreUserIdMakerCode))
|
|
|
+ {
|
|
|
+ SqlString += " and StoreUserId in (select StoreUserId from UserForMakerCode where MakerCode='" + StoreUserIdMakerCode + "')";
|
|
|
+ }
|
|
|
+ //仓库归属创客真实姓名
|
|
|
+ if (!string.IsNullOrEmpty(StoreUserIdRealName))
|
|
|
+ {
|
|
|
+ SqlString += " and StoreUserId in (select StoreUserId from UserForRealName where RealName='" + StoreUserIdRealName + "')";
|
|
|
+ }
|
|
|
+ //支付状态
|
|
|
+ if (!string.IsNullOrEmpty(PayStatusSelect))
|
|
|
+ {
|
|
|
+ SqlString += " and PayStatus=" + PayStatusSelect;
|
|
|
+ }
|
|
|
+ //支付时间
|
|
|
+ if (!string.IsNullOrEmpty(PayDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = PayDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ SqlString += " and PayDate>='" + start + " 00:00:00' and PayDate<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
+ //下单时间
|
|
|
+ if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ SqlString += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
+ //发货时间
|
|
|
+ if (!string.IsNullOrEmpty(SendDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = SendDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ SqlString += " and SendDate>='" + start + " 00:00:00' and SendDate<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
+ var Sql = "SELECT c.MakerCode '创客编号',c.RealName '创客姓名',DATE_FORMAT(c.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间',c.Remark '变动类型',c.Type1Num '电签兑换券张数',c.Type2Num '大POS兑换券张数',d.LeaderBalanceAmount '可提现余额',c.ChangeAmt '使用额度',c.BeforeAmt '使用前剩余额度',c.AfterAmt '使用后剩余额度' FROM(SELECT a.*,b.MakerCode,b.RealName FROM(SELECT Id,UserId,CreateDate,ChangeAmt,BeforeAmt,AfterAmt,Remark,REPLACE (JSON_EXTRACT (SeoTitle, '$[0].Num'),'\\\"','') AS 'Type1Num', REPLACE (JSON_EXTRACT (SeoTitle, '$[1].Num'),'\\\"','') AS 'Type2Num' FROM LeaderReserveRecord WHERE 1=1 " + SqlString + ") a LEFT JOIN Users b ON a.UserId=b.Id) c LEFT JOIN UserAccount d ON c.UserId=d.Id";
|
|
|
+ var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
|
|
|
+ var FileName = "盟主储蓄金变动记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
|
|
|
+ RedisDbconn.Instance.AddList("ExportQueue", SendData);
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
#region 查询直推奖励100
|
|
|
|
|
|
public Dictionary<string, string> Prize100(int Id)
|