Commit c49cd427 by guanzhenshan

增加描述说明(未完成)

parent ad8a0b81
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models
{
/// <summary>
/// 月度利润报表 字段描述
/// </summary>
public class dc_month_sale_profit_description
{
/// <summary>
/// auto_increment
/// </summary>
public int id { get; set; }
/// <summary>
/// 年月
/// </summary>
public string month { get; set; }
/// <summary>
/// 销售额
/// </summary>
public string amount_sale { get; set; }
/// <summary>
/// 成本
/// </summary>
public string cost_sale { get; set; }
/// <summary>
/// 平台扣费及退款
/// </summary>
public string pt_count { get; set; }
/// <summary>
/// 平台费
/// </summary>
public string pt_platformfee { get; set; }
/// <summary>
/// Ebay刊登费
/// </summary>
public string pt_ebay_postingfee { get; set; }
/// <summary>
/// Paypal费用
/// </summary>
public string pt_paypal_fee { get; set; }
/// <summary>
/// 平台的物流费
/// </summary>
public string pt_platform_logistics_fee { get; set; }
/// <summary>
/// 广告及宣传费-订阅费
/// </summary>
public string pt_platform_ad_subscribe_fee { get; set; }
/// <summary>
/// 平台的仓储费
/// </summary>
public string pt_platform_storage_fee { get; set; }
/// <summary>
/// 退款
/// </summary>
public string pt_refund_amount { get; set; }
/// <summary>
/// 回款
/// </summary>
public string pt_incoming { get; set; }
/// <summary>
/// 物流仓储费用
/// </summary>
public string ls_count { get; set; }
/// <summary>
/// 头程运输
/// </summary>
public string ls_head_cost { get; set; }
/// <summary>
/// 尾程运输
/// </summary>
public string ls_tail_cost { get; set; }
/// <summary>
/// 海外仓仓储费
/// </summary>
public string ls_oversea_storage { get; set; }
/// <summary>
/// 平台操作费
/// </summary>
public string ls_platform_operation_fee { get; set; }
/// <summary>
/// 销售费用合计
/// </summary>
public string sale_fee_count { get; set; }
/// <summary>
/// 销售利润
/// </summary>
public string sale_profit { get; set; }
/// <summary>
/// 销售毛利率
/// </summary>
public string sale_profit_rate { get; set; }
/// <summary>
/// 销售相关管理成本
/// </summary>
public string sale_manager_cost { get; set; }
/// <summary>
/// 处理费
/// </summary>
public string handlingcharges { get; set; }
/// <summary>
/// 直接支付的与销售平台相关费用
/// </summary>
public string payfor_platform_related_fee { get; set; }
/// <summary>
/// 直接管理成本
/// </summary>
public string direct_manager_cost { get; set; }
/// <summary>
/// 管理成本-香港百伦(不含直接支付的与销售平台相关的费用)
/// </summary>
public string manager_cost_hkbailun { get; set; }
/// <summary>
/// 管理成本-广州百伦
/// </summary>
public string manager_cost_gzbailun { get; set; }
/// <summary>
/// 管理成本-美甲店
/// </summary>
public string manager_cost_meijiadian { get; set; }
/// <summary>
/// 管理成本-成品仓(不含直接支付的与销售平台相关的费用)
/// </summary>
public string manager_cost_finish_wh { get; set; }
/// <summary>
/// 财务费用
/// </summary>
public string finance_fee { get; set; }
/// <summary>
/// 管理成本合计
/// </summary>
public string manager_cost_count { get; set; }
/// <summary>
/// 营业利润
/// </summary>
public string business_profit { get; set; }
/// <summary>
/// 营业毛利率
/// </summary>
public string business_profit_rate { get; set; }
/// <summary>
/// 加:其他收入
/// </summary>
public string other_incoming { get; set; }
/// <summary>
/// 加:营业外收入
/// </summary>
public string nonbusiness_income { get; set; }
/// <summary>
/// 减:营业外支出
/// </summary>
public string nonbusiness_pay { get; set; }
/// <summary>
/// 实际利润
/// </summary>
public string actual_profit { get; set; }
/// <summary>
/// 分红
/// </summary>
public string participation_in_profit { get; set; }
/// <summary>
/// 利润结余
/// </summary>
public string balance_of_profit { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime createtime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime lastupdatetime { get; set; }
/// <summary>
/// 最后更新人id
/// </summary>
public int lastupdateuserid { get; set; }
/// <summary>
/// 最后更新人
/// </summary>
public string lastupdateusername { get; set; }
}
}
...@@ -106,4 +106,204 @@ namespace Bailun.DC.Models ...@@ -106,4 +106,204 @@ namespace Bailun.DC.Models
/// </summary> /// </summary>
public decimal? participation_in_profit { get; set; } public decimal? participation_in_profit { get; set; }
} }
/// <summary>
/// 月销售利润报表数据描述参数
/// </summary>
public class mMonthSaleProfitDesc_Input
{
/// <summary>
/// 年月
/// </summary>
public string month { get; set; }
/// <summary>
/// 销售额
/// </summary>
public string amount_sale { get; set; }
/// <summary>
/// 成本
/// </summary>
public string cost_sale { get; set; }
/// <summary>
/// 平台扣费及退款
/// </summary>
public string pt_count { get; set; }
/// <summary>
/// 平台费
/// </summary>
public string pt_platformfee { get; set; }
/// <summary>
/// Ebay刊登费
/// </summary>
public string pt_ebay_postingfee { get; set; }
/// <summary>
/// Paypal费用
/// </summary>
public string pt_paypal_fee { get; set; }
/// <summary>
/// 平台的物流费
/// </summary>
public string pt_platform_logistics_fee { get; set; }
/// <summary>
/// 广告及宣传费-订阅费
/// </summary>
public string pt_platform_ad_subscribe_fee { get; set; }
/// <summary>
/// 平台的仓储费
/// </summary>
public string pt_platform_storage_fee { get; set; }
/// <summary>
/// 退款
/// </summary>
public string pt_refund_amount { get; set; }
/// <summary>
/// 回款
/// </summary>
public string pt_incoming { get; set; }
/// <summary>
/// 物流仓储费用
/// </summary>
public string ls_count { get; set; }
/// <summary>
/// 头程运输
/// </summary>
public string ls_head_cost { get; set; }
/// <summary>
/// 尾程运输
/// </summary>
public string ls_tail_cost { get; set; }
/// <summary>
/// 海外仓仓储费
/// </summary>
public string ls_oversea_storage { get; set; }
/// <summary>
/// 平台操作费
/// </summary>
public string ls_platform_operation_fee { get; set; }
/// <summary>
/// 销售费用合计
/// </summary>
public string sale_fee_count { get; set; }
/// <summary>
/// 销售利润
/// </summary>
public string sale_profit { get; set; }
/// <summary>
/// 销售毛利率
/// </summary>
public string sale_profit_rate { get; set; }
/// <summary>
/// 销售相关管理成本
/// </summary>
public string sale_manager_cost { get; set; }
/// <summary>
/// 处理费
/// </summary>
public string handlingcharges { get; set; }
/// <summary>
/// 直接支付的与销售平台相关费用
/// </summary>
public string payfor_platform_related_fee { get; set; }
/// <summary>
/// 直接管理成本
/// </summary>
public string direct_manager_cost { get; set; }
/// <summary>
/// 管理成本-香港百伦(不含直接支付的与销售平台相关的费用)
/// </summary>
public string manager_cost_hkbailun { get; set; }
/// <summary>
/// 管理成本-广州百伦
/// </summary>
public string manager_cost_gzbailun { get; set; }
/// <summary>
/// 管理成本-美甲店
/// </summary>
public string manager_cost_meijiadian { get; set; }
/// <summary>
/// 管理成本-成品仓(不含直接支付的与销售平台相关的费用)
/// </summary>
public string manager_cost_finish_wh { get; set; }
/// <summary>
/// 财务费用
/// </summary>
public string finance_fee { get; set; }
/// <summary>
/// 管理成本合计
/// </summary>
public string manager_cost_count { get; set; }
/// <summary>
/// 营业利润
/// </summary>
public string business_profit { get; set; }
/// <summary>
/// 营业毛利率
/// </summary>
public string business_profit_rate { get; set; }
/// <summary>
/// 加:其他收入
/// </summary>
public string other_incoming { get; set; }
/// <summary>
/// 加:营业外收入
/// </summary>
public string nonbusiness_income { get; set; }
/// <summary>
/// 减:营业外支出
/// </summary>
public string nonbusiness_pay { get; set; }
/// <summary>
/// 实际利润
/// </summary>
public string actual_profit { get; set; }
/// <summary>
/// 分红
/// </summary>
public string participation_in_profit { get; set; }
/// <summary>
/// 利润结余
/// </summary>
public string balance_of_profit { get; set; }
}
} }
...@@ -3995,6 +3995,271 @@ group by currency"; ...@@ -3995,6 +3995,271 @@ group by currency";
} }
} }
/// <summary>
/// 月度利润报表 数据说明
/// </summary>
/// <param name="start">开始月份</param>
/// <param name="end">结束月份</param>
/// <returns></returns>
public List<dc_month_sale_profit_description> ListMonthSaleProfitDescription(string start, string end)
{
var sql = $"select * from dc_month_sale_profit_description where month>='{start}' ";
if (!string.IsNullOrEmpty(end))
{
sql += (" and month<='" + end + "'");
}
sql += " order by month desc limit 6";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == ConnectionState.Closed)
{
if (cn.State == ConnectionState.Closed)
{
cn.Open();
}
}
var obj = cn.Query<dc_month_sale_profit_description>(sql, null, null, true, 2 * 60);
return obj.ToList();
}
}
/// <summary>
/// 更新数据描述
/// </summary>
/// <param name="m"></param>
/// <param name="uid"></param>
/// <param name="username"></param>
/// <returns></returns>
public string SaveMonthSaleProfitDescription(mMonthSaleProfitDesc_Input m, int uid, string username)
{
var sql = $"select * from dc_month_sale_profit_description where month='{m.month}'";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == ConnectionState.Closed)
{
cn.Open();
}
var obj = cn.QueryFirstOrDefault<dc_month_sale_profit_description>(sql);
if (obj == null)
{
obj = new dc_month_sale_profit_description {
month = m.month,
createtime = DateTime.Now,
};
}
if (obj.actual_profit != m.actual_profit)
{
obj.actual_profit = m.actual_profit;
}
else if (obj.amount_sale != m.amount_sale) {
obj.amount_sale = m.amount_sale;
}
else if(obj.balance_of_profit != m.balance_of_profit)
{
obj.balance_of_profit = m.balance_of_profit;
}
else if (obj.business_profit != m.business_profit_rate) {
obj.business_profit = m.business_profit_rate;
}
else if (obj.cost_sale != m.cost_sale) {
obj.cost_sale = m.cost_sale;
}
else if (obj.direct_manager_cost != m.direct_manager_cost) {
obj.direct_manager_cost = m.direct_manager_cost;
}
else if (obj.finance_fee != m.finance_fee) {
obj.finance_fee = m.finance_fee;
}
else if (obj.handlingcharges != m.handlingcharges) {
obj.handlingcharges = m.handlingcharges;
}
else if (obj.ls_count != m.ls_count) {
obj.ls_count = m.ls_count;
}
else if (obj.ls_head_cost != m.ls_head_cost) {
obj.ls_head_cost = m.ls_head_cost;
}
else if (obj.ls_oversea_storage != m.ls_oversea_storage)
{
obj.ls_oversea_storage = m.ls_oversea_storage;
}
else if (obj.ls_platform_operation_fee != m.ls_platform_operation_fee)
{
obj.ls_platform_operation_fee = m.ls_platform_operation_fee;
}
else if (obj.ls_tail_cost != m.ls_tail_cost)
{
obj.ls_tail_cost = m.ls_tail_cost;
}
else if (obj.manager_cost_count != m.manager_cost_count)
{
obj.manager_cost_count = m.manager_cost_count;
}
else if (obj.manager_cost_finish_wh != m.manager_cost_finish_wh)
{
obj.manager_cost_finish_wh = m.manager_cost_finish_wh;
}
else if (obj.manager_cost_gzbailun != m.manager_cost_gzbailun)
{
obj.manager_cost_gzbailun = m.manager_cost_gzbailun;
}
else if (obj.manager_cost_hkbailun != m.manager_cost_hkbailun)
{
obj.manager_cost_hkbailun = m.manager_cost_hkbailun;
}
else if (obj.manager_cost_meijiadian != m.manager_cost_meijiadian)
{
obj.manager_cost_meijiadian = m.manager_cost_meijiadian;
}
else if (obj.nonbusiness_income != m.nonbusiness_income)
{
obj.nonbusiness_income = m.nonbusiness_income;
}
else if (obj.nonbusiness_pay != m.nonbusiness_pay)
{
obj.nonbusiness_pay = m.nonbusiness_pay;
}
else if (obj.other_incoming != m.other_incoming)
{
obj.other_incoming = m.other_incoming;
}
else if (obj.participation_in_profit != m.participation_in_profit)
{
obj.participation_in_profit = m.participation_in_profit;
}
else if (obj.payfor_platform_related_fee != m.payfor_platform_related_fee)
{
obj.payfor_platform_related_fee = m.payfor_platform_related_fee;
}
else if (obj.pt_count != m.pt_count)
{
obj.pt_count = m.pt_count;
}
else if (obj.pt_ebay_postingfee != m.pt_ebay_postingfee)
{
obj.pt_ebay_postingfee = m.pt_ebay_postingfee;
}
else if (obj.pt_incoming != m.pt_incoming)
{
obj.pt_incoming = m.pt_incoming;
}
else if (obj.pt_paypal_fee != m.pt_paypal_fee)
{
obj.pt_paypal_fee = m.pt_paypal_fee;
}
else if (obj.pt_platformfee != m.pt_platformfee)
{
obj.pt_platformfee = m.pt_platformfee;
}
else if (obj.pt_platform_ad_subscribe_fee != m.pt_platform_ad_subscribe_fee)
{
obj.pt_platform_ad_subscribe_fee = m.pt_platform_ad_subscribe_fee;
}
else if (obj.pt_platform_logistics_fee != m.pt_platform_logistics_fee)
{
obj.pt_platform_logistics_fee = m.pt_platform_logistics_fee;
}
else if (obj.pt_platform_storage_fee != m.pt_platform_storage_fee)
{
obj.pt_platform_storage_fee = m.pt_platform_storage_fee;
}
else if (obj.pt_refund_amount != m.pt_refund_amount)
{
obj.pt_refund_amount = m.pt_refund_amount;
}
else if (obj.sale_fee_count != m.sale_fee_count)
{
obj.sale_fee_count = m.sale_fee_count;
}
else if (obj.sale_manager_cost != m.sale_profit)
{
obj.sale_manager_cost = m.sale_profit;
}
else if (obj.sale_profit_rate != m.sale_profit_rate)
{
obj.sale_profit_rate = m.sale_profit_rate;
}
obj.lastupdatetime = DateTime.Now;
obj.lastupdateuserid = uid;
obj.lastupdateusername = username;
try
{
if (obj.id > 0)
{
cn.Update<dc_month_sale_profit_description>(obj);
}
else
{
cn.Insert<dc_month_sale_profit_description>(obj);
}
return "";
}
catch (Exception ex)
{
return ex.Message;
}
}
}
#endregion #endregion
} }
......
...@@ -5847,6 +5847,24 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -5847,6 +5847,24 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}); });
} }
/// <summary>
/// 更新月度销售利润报表的取数描述
/// </summary>
/// <param name="m"></param>
/// <returns></returns>
[BailunAuthentication(LoginMode.Enforce)]
[HttpPost]
public JsonResult UpdateMonthSaleProfitDescription(mMonthSaleProfitDesc_Input m)
{
var user = HttpContextHelper.Current?.User;
var obj = new Services.FinanceReportServices().SaveMonthSaleProfitDescription(m, user != null ? user.GetUid() : 0, user != null ? user.GetUserName() : "");
return Json(new
{
success = string.IsNullOrEmpty(obj),
msg = obj
});
}
#endregion #endregion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment