|
|
@@ -7,6 +7,7 @@ using System.Web;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Diagnostics;
|
|
|
using System.Linq;
|
|
|
+using System.Data;
|
|
|
using System.Threading.Tasks;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
@@ -112,8 +113,22 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
if (Status == 1) dic["StatusName"] = "已扣款";
|
|
|
if (Status == 2) dic["StatusName"] = "已退还";
|
|
|
if (Status == 3) dic["StatusName"] = "暂停扣款";
|
|
|
-
|
|
|
}
|
|
|
+ Dictionary<string, object> other = new Dictionary<string, object>();
|
|
|
+ string SuccessAmount = "0.00";//已扣款总金额
|
|
|
+ string WaitAmount = "0.00";//待扣款总金额
|
|
|
+ string StopAmount = "0.00";//暂停扣款总金额
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("SELECT SUM(if(Status=1,ChargeAmount,0)),SUM(if(Status=0,ChargeAmount,0)),SUM(if(Status=3,ChargeAmount,0)) FROM ToChargeBackRecord WHERE 1=1 " + condition);
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ SuccessAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
|
|
|
+ WaitAmount = decimal.Parse(function.CheckNum(dt.Rows[0][1].ToString())).ToString("f2");
|
|
|
+ StopAmount = decimal.Parse(function.CheckNum(dt.Rows[0][2].ToString())).ToString("f2");
|
|
|
+ }
|
|
|
+ other.Add("SuccessAmount", SuccessAmount);
|
|
|
+ other.Add("WaitAmount", WaitAmount);
|
|
|
+ other.Add("StopAmount", StopAmount);
|
|
|
+ obj.Add("other", other);
|
|
|
return Json(obj);
|
|
|
}
|
|
|
|
|
|
@@ -653,6 +668,57 @@ 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 PosSn, string CreateDateData, string ChargeTypeSelect, string StatusSelect)
|
|
|
+ {
|
|
|
+
|
|
|
+ string SqlString = " where 1=1 and a.Status>-1";
|
|
|
+ if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ SqlString += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
+ //创客编号
|
|
|
+ if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
+ {
|
|
|
+ SqlString += " and a.UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(PosSn))
|
|
|
+ {
|
|
|
+ SqlString += " and a.Remark=" + PosSn;
|
|
|
+ }
|
|
|
+ //待扣类型
|
|
|
+ if (!string.IsNullOrEmpty(ChargeTypeSelect))
|
|
|
+ {
|
|
|
+ SqlString += " and a.ChargeType=" + ChargeTypeSelect;
|
|
|
+ }
|
|
|
+ //扣款状态
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
+ {
|
|
|
+ SqlString += " and a.Status=" + StatusSelect;
|
|
|
+ }
|
|
|
+ var Sql = "SELECT b.MakerCode '创客编号',b.RealName '创客真实姓名',b.Mobile '手机号',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间',a.ChargeAmount '扣款金额',(CASE WHEN a.ChargeType=124 THEN '过期机具扣款' WHEN a.ChargeType=1 THEN '创客预扣款' WHEN a.ChargeType=2 THEN '分期预扣款' ELSE '' end) '扣款类型',DATE_FORMAT(a.UpdateDate,'%Y-%m-%d %H:%i:%s') '扣款/更新时间',(CASE WHEN a.`Status`=0 THEN '待扣款' WHEN a.`Status`=1 THEN '已扣款' WHEN a.`Status`=2 THEN '已退还' WHEN a.`Status`=3 THEN '暂停扣款' ELSE '' end) '扣款状态',a.Remark '机具Sn',a.SeoDescription '备注',a.SeoTitle '操作人' FROM ToChargeBackRecord a LEFT JOIN Users b ON a.UserId=b.Id " + SqlString + "";
|
|
|
+ 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 分期扣款
|
|
|
|
|
|
public IActionResult ChangeInfoDo(string right)
|