|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
using DSWeb.MvcShipping.Helper;
|
|
|
|
|
using DSWeb.MvcShipping.Comm.Cookie;
|
|
|
|
|
using DSWeb.Areas.CommMng.DAL;
|
|
|
|
|
using DSWeb.Areas.RptMng.Comm;
|
|
|
|
|
using HcUtility.Comm;
|
|
|
|
|
using HcUtility.Core;
|
|
|
|
|
using Microsoft.Practices.EnterpriseLibrary.Data;
|
|
|
|
|
using DSWeb.EntityDA;
|
|
|
|
|
using DSWeb.Areas.CommMng.Models;
|
|
|
|
|
using DSWeb.MvcShipping.DAL.MsRptSaleBalProfitShareDAL;
|
|
|
|
|
using DSWeb.MvcShipping.Models.MsOpBillProfit;
|
|
|
|
|
|
|
|
|
|
namespace DSWeb.MvcShipping.Controllers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 利润报表查询
|
|
|
|
|
/// </summary>
|
|
|
|
|
[JsonRequestBehavior]
|
|
|
|
|
public class MsRptSaleBalProfitShareController : Controller
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
// GET: /MvcShipping/MsRptOpProfit
|
|
|
|
|
public ActionResult Index()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
public ActionResult PlanIndex()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
public ActionResult LHIndex()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
public ActionResult RQIndex()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
public ActionResult BTIndex()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
public ActionResult HYIndex()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
public ActionResult TravelFee()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
public ContentResult BsListData(int start, int limit, string condition, string stlcondition, bool isdrzero, string dcondition,bool isallstl,string sort, string printstr, string sortstr, string dcondition2="")
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
var dataList = MsRptSaleBalProfitShareDAL.GetDataList(condition, stlcondition, dcondition, dcondition2,isdrzero,isallstl, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
|
|
|
|
|
var list = dataList.Skip(start).Take(limit);
|
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult GetDataListStr(int start, int limit, string condition, string stlcondition, bool isdrzero, string dcondition, bool isallstl, string sort, string printstr, string sortstr, string dcondition2 = "")
|
|
|
|
|
{
|
|
|
|
|
var dataListStr = MsRptSaleBalProfitShareDAL.GetDataListStr(condition, stlcondition, dcondition, dcondition2, isdrzero,isallstl,Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
|
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", data = dataListStr });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult GetLHDataList(int start, int limit, string condition, string Month, string sort, string printstr, string sortstr)
|
|
|
|
|
{
|
|
|
|
|
var dataList = MsRptSaleBalProfitShareDAL.GetLHDataList(condition, Month, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
|
|
|
|
|
var list = dataList.Skip(start).Take(limit);
|
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult GetRQDataList(int start, int limit, string condition, string stlcondition, bool isdrzero, string dcondition, bool isallstl, string sort, string printstr, string sortstr, string dcondition2 = "")
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
var dataList = MsRptSaleBalProfitShareDAL.GetRQDataList(condition, stlcondition, dcondition, dcondition2, isdrzero, isallstl, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
|
|
|
|
|
var list = dataList.Skip(start).Take(limit);
|
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult GetBTDataList(int start, int limit, string condition, string stlcondition,string datecondition,string datetype, bool isdrzero, string dcondition, bool isallstl, string sort, string printstr, string sortstr, string dcondition2 = "")
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
var dataList = MsRptSaleBalProfitShareDAL.GetBTDataList(condition, stlcondition, dcondition, dcondition2, datecondition, datetype, isdrzero, isallstl, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
|
|
|
|
|
// var salelist = MsRptSaleBalProfitShareDAL.SumBTData(dataList);
|
|
|
|
|
var list = dataList.Skip(start).Take(limit);
|
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList()});
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
public ContentResult GetHYDataList(int start, int limit, string condition, string stlcondition, string datecondition, string datetype, bool isdrzero, string dcondition, bool isallstl, string sort, string printstr, string sortstr, string dcondition2 = "")
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
var dataList = MsRptSaleBalProfitShareDAL.GetHYDataList(condition, stlcondition, dcondition, dcondition2, datecondition, datetype, isdrzero, isallstl, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
|
|
|
|
|
// var salelist = MsRptSaleBalProfitShareDAL.SumBTData(dataList);
|
|
|
|
|
var list = dataList.Skip(start).Take(limit);
|
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult SaveFee(string data)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var bodyList = JsonConvert.Deserialize<List<MsOpBillProfit>>(data);
|
|
|
|
|
|
|
|
|
|
DBResult result = MsRptSaleBalProfitShareDAL.SaveFee(bodyList, Convert.ToString(Session["USERID"]));
|
|
|
|
|
|
|
|
|
|
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult SetFee(string data)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var bodyList = JsonConvert.Deserialize<List<MsOpBillProfit>>(data);
|
|
|
|
|
|
|
|
|
|
DBResult result = MsRptSaleBalProfitShareDAL.SetFee(bodyList, Convert.ToString(Session["USERID"]));
|
|
|
|
|
|
|
|
|
|
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult CancelSetFee(string data)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var bodyList = JsonConvert.Deserialize<List<MsOpBillProfit>>(data);
|
|
|
|
|
|
|
|
|
|
DBResult result = MsRptSaleBalProfitShareDAL.CancelSetFee(bodyList, Convert.ToString(Session["USERID"]));
|
|
|
|
|
|
|
|
|
|
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult SetFeeRQ(string data,string type,string ffdate)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var bodyList = JsonConvert.Deserialize<List<MsOpBillProfit>>(data);
|
|
|
|
|
|
|
|
|
|
DBResult result = MsRptSaleBalProfitShareDAL.SetFeeRQ(bodyList,type,ffdate,Convert.ToString(Session["USERID"]));
|
|
|
|
|
|
|
|
|
|
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult CancelSetFeeRQ(string data,string type)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var bodyList = JsonConvert.Deserialize<List<MsOpBillProfit>>(data);
|
|
|
|
|
|
|
|
|
|
DBResult result = MsRptSaleBalProfitShareDAL.CancelSetFeeRQ(bodyList, Convert.ToString(Session["USERID"]),type);
|
|
|
|
|
|
|
|
|
|
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
|
|
|
}
|
|
|
|
|
public ContentResult GetTravelFeeList(int start, int limit, string condition, string sort)
|
|
|
|
|
{
|
|
|
|
|
var dataList = MsRptSaleBalProfitShareDAL.GetSaleTravelFeeList(condition,sort);
|
|
|
|
|
var list = dataList.Skip(start).Take(limit);
|
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult SaveTravelFeeDetail(string body)
|
|
|
|
|
{
|
|
|
|
|
if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "")
|
|
|
|
|
{
|
|
|
|
|
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
var bodyList = JsonConvert.Deserialize<List<OpSaleTravelFee>>(body);
|
|
|
|
|
|
|
|
|
|
DBResult result = MsRptSaleBalProfitShareDAL.SaveTravelFee(bodyList, Convert.ToString(Session["USERID"]));
|
|
|
|
|
|
|
|
|
|
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ContentResult DeleteOpSaleTravelDetail(string data)
|
|
|
|
|
{
|
|
|
|
|
var headData = JsonConvert.Deserialize<List<OpSaleTravelFee>>(data);
|
|
|
|
|
|
|
|
|
|
DBResult result = MsRptSaleBalProfitShareDAL.DeleteOpSaleTravelDetail(headData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//public ContentResult SumListData(int start, int limit, string condition, string stlcondition, bool isdrzero, string sort, string printstr)
|
|
|
|
|
//{
|
|
|
|
|
// var dataList = MsRptSaleBalProfitShareDAL.GetDataList(condition, isdrzero,Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
|
|
|
|
|
// var list = dataList.Skip(start).Take(limit);
|
|
|
|
|
// var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
|
|
|
|
|
// return new ContentResult() { Content = json };
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
#region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 参照部分
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|