475 lines
23 KiB
C#
475 lines
23 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using SuperMap.RealEstate.ServiceModel;
|
|
using Business = SuperMap.RealEstate.HighWay.SellData.Business;
|
|
using HCC = HZQR.Common.Common;
|
|
using HZQR.Common;
|
|
|
|
namespace EShang.Common.GeneralMethod
|
|
{
|
|
/// <summary>
|
|
/// 日结账期表相关方法
|
|
/// 2024/9/6 10:45:58自动生成
|
|
/// </summary>
|
|
public class ENDACCOUNTHelper
|
|
{
|
|
#region 获取日结账期表列表
|
|
/// <summary>
|
|
/// 获取日结账期表列表
|
|
/// </summary>
|
|
/// <param name="transaction">事务管理器</param>
|
|
/// <param name="TotalCount">查询结果总数</param>
|
|
/// <param name="searchModel">查询条件对象</param>
|
|
public static List<Model.ENDACCOUNTModel> GetENDACCOUNTList(Transaction transaction,
|
|
ref int TotalCount, Model.SearchModel<Model.ENDACCOUNTModel> searchModel)
|
|
{
|
|
List<Model.ENDACCOUNTModel> ENDACCOUNTList = new List<Model.ENDACCOUNTModel>();
|
|
|
|
string WhereSQL = "", RowFilterSQL = "";
|
|
if (searchModel.SearchParameter != null)
|
|
{
|
|
WhereSQL = OperationDataHelper<Model.ENDACCOUNTModel>.GetWhereSQL(searchModel.SearchParameter, searchModel.QueryType, "",
|
|
"SERVERPART_IDS", "SERVERPARTCODES", "SearchStartDate", "SearchEndDate", "SearchStatisticsStartDate", "SearchStatisticsEndDate");
|
|
if (WhereSQL != "")
|
|
{
|
|
WhereSQL = " WHERE " + WhereSQL;
|
|
}
|
|
//查询服务区内码
|
|
if (searchModel.SearchParameter.SERVERPART_IDS.TryParseToString() != "")
|
|
{
|
|
WhereSQL += (WhereSQL == "" ? " WHERE " : " AND ") + "SERVERPART_ID IN (" + searchModel.SearchParameter.SERVERPART_IDS + ")";
|
|
}
|
|
//查询服务区编码
|
|
if (searchModel.SearchParameter.SERVERPARTCODES.TryParseToString() != "")
|
|
{
|
|
WhereSQL += (WhereSQL == "" ? " WHERE " : " AND ") + "SERVERPARTCODE IN ('" +
|
|
searchModel.SearchParameter.SERVERPARTCODES.Replace(",", "','") + "')";
|
|
}
|
|
//查询结账时间
|
|
if (searchModel.SearchParameter.SearchStartDate.TryParseToString() != "")
|
|
{
|
|
WhereSQL += (WhereSQL == "" ? " WHERE " : " AND ") + "ENDACCOUNT_DATE >= TO_DATE('" +
|
|
searchModel.SearchParameter.SearchStartDate.Split(' ')[0] + "','YYYY/MM/DD')";
|
|
}
|
|
if (searchModel.SearchParameter.SearchEndDate.TryParseToString() != "")
|
|
{
|
|
WhereSQL += (WhereSQL == "" ? " WHERE " : " AND ") + "ENDACCOUNT_DATE < TO_DATE('" +
|
|
searchModel.SearchParameter.SearchEndDate.Split(' ')[0] + "','YYYY/MM/DD') + 1";
|
|
}
|
|
//查询统计日期
|
|
if (searchModel.SearchParameter.SearchStatisticsStartDate.TryParseToString() != "")
|
|
{
|
|
WhereSQL += (WhereSQL == "" ? " WHERE " : " AND ") + "STATISTICS_DATE >= TO_DATE('" +
|
|
searchModel.SearchParameter.SearchStatisticsStartDate.Split(' ')[0] + "','YYYY/MM/DD')";
|
|
}
|
|
if (searchModel.SearchParameter.SearchStatisticsEndDate.TryParseToString() != "")
|
|
{
|
|
WhereSQL += (WhereSQL == "" ? " WHERE " : " AND ") + "STATISTICS_DATE < TO_DATE('" +
|
|
searchModel.SearchParameter.SearchStatisticsEndDate.Split(' ')[0] + "','YYYY/MM/DD') + 1";
|
|
}
|
|
}
|
|
|
|
DataTable dtENDACCOUNT = new Business.ENDACCOUNT(transaction).ExecuteDataTable(
|
|
"SELECT * FROM HIGHWAY_SELLDATA.T_ENDACCOUNT" + WhereSQL);
|
|
//增加组合查询条件
|
|
if (searchModel.keyWord != null && !string.IsNullOrWhiteSpace(searchModel.keyWord.Key))
|
|
{
|
|
foreach (string KeyName in searchModel.keyWord.Key.Split(','))
|
|
{
|
|
RowFilterSQL += (RowFilterSQL == "" ? "" : " or ") +
|
|
KeyName + " like '%" + searchModel.keyWord.Value + "%'";
|
|
}
|
|
}
|
|
if (RowFilterSQL != "")
|
|
{
|
|
dtENDACCOUNT.DefaultView.RowFilter = RowFilterSQL;
|
|
}
|
|
//排序:
|
|
dtENDACCOUNT.DefaultView.Sort = searchModel.SortStr;
|
|
dtENDACCOUNT = dtENDACCOUNT.DefaultView.ToTable();
|
|
//获取查询结果总记录条数
|
|
TotalCount = dtENDACCOUNT.Rows.Count;
|
|
//根据传入的页码和每页显示条数返回结果
|
|
dtENDACCOUNT = CommonHelper.GetDataTableWithPageSize(dtENDACCOUNT, searchModel.PageSize, searchModel.PageIndex);
|
|
|
|
foreach (DataRow drENDACCOUNT in dtENDACCOUNT.Rows)
|
|
{
|
|
Model.ENDACCOUNTModel endaccountModel = new Model.ENDACCOUNTModel();
|
|
//绑定日结账期表数据对象
|
|
BindDataRowToModel(drENDACCOUNT, endaccountModel);
|
|
|
|
ENDACCOUNTList.Add(endaccountModel);
|
|
}
|
|
|
|
return ENDACCOUNTList;
|
|
}
|
|
|
|
#region 绑定model
|
|
/// <summary>
|
|
/// 绑定model
|
|
/// </summary>
|
|
/// <param name="drENDACCOUNT">datarow数据源</param>
|
|
/// <param name="endaccountModel">model对象</param>
|
|
public static void BindDataRowToModel(DataRow drENDACCOUNT, Model.ENDACCOUNTModel endaccountModel)
|
|
{
|
|
if (drENDACCOUNT["ENDACCOUNT_ID"].ToString() != "")
|
|
{
|
|
endaccountModel.ENDACCOUNT_ID = drENDACCOUNT["ENDACCOUNT_ID"].TryParseToInt(); //日结账期内码
|
|
}
|
|
if (drENDACCOUNT["SERVERPART_ID"].ToString() != "")
|
|
{
|
|
endaccountModel.SERVERPART_ID = drENDACCOUNT["SERVERPART_ID"].TryParseToInt(); //服务区内码
|
|
}
|
|
endaccountModel.SERVERPART_NAME = drENDACCOUNT["SERVERPART_NAME"].ToString(); //服务区名称
|
|
endaccountModel.SERVERPARTCODE = drENDACCOUNT["SERVERPARTCODE"].ToString(); //服务区编码
|
|
endaccountModel.SHOPCODE = drENDACCOUNT["SHOPCODE"].ToString(); //门店编码
|
|
endaccountModel.SHOPNAME = drENDACCOUNT["SHOPNAME"].ToString(); //门店名称
|
|
endaccountModel.MACHINECODE = drENDACCOUNT["MACHINECODE"].ToString(); //收银机号
|
|
if (!string.IsNullOrWhiteSpace(drENDACCOUNT["ENDACCOUNT_DATE"].ToString()))
|
|
{
|
|
//结账时间
|
|
endaccountModel.ENDACCOUNT_DATE = drENDACCOUNT["ENDACCOUNT_DATE"].ToString();
|
|
}
|
|
if (drENDACCOUNT["ENDACCOUNT_STARTDATE"].ToString() != "")
|
|
{
|
|
endaccountModel.ENDACCOUNT_STARTDATE = drENDACCOUNT["ENDACCOUNT_STARTDATE"].TryParseToDateTime(); //销售起始时间
|
|
}
|
|
if (!string.IsNullOrWhiteSpace(drENDACCOUNT["STATISTICS_DATE"].ToString()))
|
|
{
|
|
//统计日期
|
|
endaccountModel.STATISTICS_DATE = drENDACCOUNT["STATISTICS_DATE"].ToString();
|
|
}
|
|
if (drENDACCOUNT["PROVINCE_CODE"].ToString() != "")
|
|
{
|
|
endaccountModel.PROVINCE_CODE = drENDACCOUNT["PROVINCE_CODE"].TryParseToInt(); //省份编码
|
|
}
|
|
endaccountModel.ENDPERSONCODE = drENDACCOUNT["ENDPERSONCODE"].ToString(); //结账人编号
|
|
endaccountModel.WORKER_NAME = drENDACCOUNT["WORKER_NAME"].ToString(); //结账人名称
|
|
endaccountModel.CASHIER_NAME = drENDACCOUNT["CASHIER_NAME"].ToString(); //收银员名称
|
|
if (drENDACCOUNT["TICKETCOUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.TICKETCOUNT = drENDACCOUNT["TICKETCOUNT"].TryParseToDouble(); //客单数量
|
|
}
|
|
if (drENDACCOUNT["TOTALCOUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.TOTALCOUNT = drENDACCOUNT["TOTALCOUNT"].TryParseToDouble(); //销售总数
|
|
}
|
|
if (drENDACCOUNT["TOTALSELLAMOUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.TOTALSELLAMOUNT = drENDACCOUNT["TOTALSELLAMOUNT"].TryParseToDouble(); //总销售额
|
|
}
|
|
if (drENDACCOUNT["TOTALOFFAMOUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.TOTALOFFAMOUNT = drENDACCOUNT["TOTALOFFAMOUNT"].TryParseToDouble(); //总优惠额
|
|
}
|
|
if (drENDACCOUNT["CASH"].ToString() != "")
|
|
{
|
|
endaccountModel.CASH = drENDACCOUNT["CASH"].TryParseToDouble(); //现金
|
|
}
|
|
if (drENDACCOUNT["CREDITCARD"].ToString() != "")
|
|
{
|
|
endaccountModel.CREDITCARD = drENDACCOUNT["CREDITCARD"].TryParseToDouble(); //信用卡
|
|
}
|
|
if (drENDACCOUNT["TICKETBILL"].ToString() != "")
|
|
{
|
|
endaccountModel.TICKETBILL = drENDACCOUNT["TICKETBILL"].TryParseToDouble(); //微信支付
|
|
}
|
|
if (drENDACCOUNT["VIPPERSON"].ToString() != "")
|
|
{
|
|
endaccountModel.VIPPERSON = drENDACCOUNT["VIPPERSON"].TryParseToDouble(); //会员卡
|
|
}
|
|
if (drENDACCOUNT["COSTBILL"].ToString() != "")
|
|
{
|
|
endaccountModel.COSTBILL = drENDACCOUNT["COSTBILL"].TryParseToDouble(); //消费券
|
|
}
|
|
if (drENDACCOUNT["OTHERPAY"].ToString() != "")
|
|
{
|
|
endaccountModel.OTHERPAY = drENDACCOUNT["OTHERPAY"].TryParseToDouble(); //其他支付(支付宝)
|
|
}
|
|
if (drENDACCOUNT["CASHPAY"].ToString() != "")
|
|
{
|
|
endaccountModel.CASHPAY = drENDACCOUNT["CASHPAY"].TryParseToDouble(); //实收金额
|
|
}
|
|
if (drENDACCOUNT["CASHPAY_DOWNLORD"].ToString() != "")
|
|
{
|
|
endaccountModel.CASHPAY_DOWNLORD = drENDACCOUNT["CASHPAY_DOWNLORD"].TryParseToDouble(); //缴款金额
|
|
}
|
|
if (drENDACCOUNT["DIFFERENT_PRICE"].ToString() != "")
|
|
{
|
|
endaccountModel.DIFFERENT_PRICE = drENDACCOUNT["DIFFERENT_PRICE"].TryParseToDouble(); //长短款
|
|
}
|
|
endaccountModel.DIFFERENCE_REASON = drENDACCOUNT["DIFFERENCE_REASON"].ToString(); //产生原因
|
|
endaccountModel.DESCRIPTION_STAFF = drENDACCOUNT["DESCRIPTION_STAFF"].ToString(); //问题说明人
|
|
if (drENDACCOUNT["DESCRIPTION_DATE"].ToString() != "")
|
|
{
|
|
endaccountModel.DESCRIPTION_DATE = drENDACCOUNT["DESCRIPTION_DATE"].TryParseToDateTime(); //说明时间
|
|
}
|
|
endaccountModel.APPROVE_STAFF = drENDACCOUNT["APPROVE_STAFF"].ToString(); //审核人
|
|
if (drENDACCOUNT["APPROVE_DATE"].ToString() != "")
|
|
{
|
|
endaccountModel.APPROVE_DATE = drENDACCOUNT["APPROVE_DATE"].TryParseToDateTime(); //审核时间
|
|
}
|
|
endaccountModel.APPROVED_INFO = drENDACCOUNT["APPROVED_INFO"].ToString(); //审核意见
|
|
if (drENDACCOUNT["TREATMENT_MARK"].ToString() != "")
|
|
{
|
|
endaccountModel.TREATMENT_MARK = drENDACCOUNT["TREATMENT_MARK"].TryParseToShort(); //处理标记
|
|
}
|
|
if (drENDACCOUNT["DOWNLOAD_DATE"].ToString() != "")
|
|
{
|
|
endaccountModel.DOWNLOAD_DATE = drENDACCOUNT["DOWNLOAD_DATE"].TryParseToDateTime(); //下载时间
|
|
}
|
|
if (drENDACCOUNT["VALID"].ToString() != "")
|
|
{
|
|
endaccountModel.VALID = drENDACCOUNT["VALID"].TryParseToShort(); //是否有效
|
|
}
|
|
endaccountModel.ENDACCOUNT_DESC = drENDACCOUNT["ENDACCOUNT_DESC"].ToString(); //备注
|
|
if (drENDACCOUNT["OPERATE_TYPE"].ToString() != "")
|
|
{
|
|
endaccountModel.OPERATE_TYPE = drENDACCOUNT["OPERATE_TYPE"].TryParseToShort(); //操作类型
|
|
}
|
|
if (drENDACCOUNT["TICKETCODE"].ToString() != "")
|
|
{
|
|
endaccountModel.TICKETCODE = drENDACCOUNT["TICKETCODE"].TryParseToInt(); //流水客单量
|
|
}
|
|
if (drENDACCOUNT["SELLCOUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.SELLCOUNT = drENDACCOUNT["SELLCOUNT"].TryParseToDouble(); //流水销量
|
|
}
|
|
if (drENDACCOUNT["FACTAMOUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.FACTAMOUNT = drENDACCOUNT["FACTAMOUNT"].TryParseToDouble(); //流水金额
|
|
}
|
|
if (drENDACCOUNT["TICKET_COUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.TICKET_COUNT = drENDACCOUNT["TICKET_COUNT"].TryParseToDouble(); //移动支付客单量
|
|
}
|
|
if (drENDACCOUNT["FACT_AMOUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.FACT_AMOUNT = drENDACCOUNT["FACT_AMOUNT"].TryParseToDouble(); //移动支付金额
|
|
}
|
|
if (drENDACCOUNT["TICKETCODE_SALE"].ToString() != "")
|
|
{
|
|
endaccountModel.TICKETCODE_SALE = drENDACCOUNT["TICKETCODE_SALE"].TryParseToInt(); //单品客单量
|
|
}
|
|
if (drENDACCOUNT["SELLCOUNT_SALE"].ToString() != "")
|
|
{
|
|
endaccountModel.SELLCOUNT_SALE = drENDACCOUNT["SELLCOUNT_SALE"].TryParseToDouble(); //单品销量
|
|
}
|
|
if (drENDACCOUNT["FACTAMOUNT_SALE"].ToString() != "")
|
|
{
|
|
endaccountModel.FACTAMOUNT_SALE = drENDACCOUNT["FACTAMOUNT_SALE"].TryParseToDouble(); //单品金额
|
|
}
|
|
if (drENDACCOUNT["TICKETCODE_CIGARETTE"].ToString() != "")
|
|
{
|
|
endaccountModel.TICKETCODE_CIGARETTE = drENDACCOUNT["TICKETCODE_CIGARETTE"].TryParseToInt(); //香烟客单量
|
|
}
|
|
if (drENDACCOUNT["SELLCOUNT_CIGARETTE"].ToString() != "")
|
|
{
|
|
endaccountModel.SELLCOUNT_CIGARETTE = drENDACCOUNT["SELLCOUNT_CIGARETTE"].TryParseToDouble(); //香烟销量
|
|
}
|
|
if (drENDACCOUNT["FACTAMOUNT_CIGARETTE"].ToString() != "")
|
|
{
|
|
endaccountModel.FACTAMOUNT_CIGARETTE = drENDACCOUNT["FACTAMOUNT_CIGARETTE"].TryParseToDouble(); //香烟金额
|
|
}
|
|
if (drENDACCOUNT["SELLCOUNT_PROMOTION"].ToString() != "")
|
|
{
|
|
endaccountModel.SELLCOUNT_PROMOTION = drENDACCOUNT["SELLCOUNT_PROMOTION"].TryParseToDouble(); //促销数量
|
|
}
|
|
if (drENDACCOUNT["FACTAMOUNT_PROMOTION"].ToString() != "")
|
|
{
|
|
endaccountModel.FACTAMOUNT_PROMOTION = drENDACCOUNT["FACTAMOUNT_PROMOTION"].TryParseToDouble(); //促销金额
|
|
}
|
|
if (drENDACCOUNT["XCCHECK"].ToString() != "")
|
|
{
|
|
endaccountModel.XCCHECK = drENDACCOUNT["XCCHECK"].TryParseToInt(); //现场检查
|
|
}
|
|
if (drENDACCOUNT["QYCHECK"].ToString() != "")
|
|
{
|
|
endaccountModel.QYCHECK = drENDACCOUNT["QYCHECK"].TryParseToInt(); //区域稽查
|
|
}
|
|
if (drENDACCOUNT["GSCHECK"].ToString() != "")
|
|
{
|
|
endaccountModel.GSCHECK = drENDACCOUNT["GSCHECK"].TryParseToInt(); //公司稽查
|
|
}
|
|
if (drENDACCOUNT["CHECK_COUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.CHECK_COUNT = drENDACCOUNT["CHECK_COUNT"].TryParseToInt(); //稽查次数
|
|
}
|
|
endaccountModel.CHECK_INFO = drENDACCOUNT["CHECK_INFO"].ToString(); //稽查详情
|
|
if (drENDACCOUNT["CASH_CORRECT"].ToString() != "")
|
|
{
|
|
endaccountModel.CASH_CORRECT = drENDACCOUNT["CASH_CORRECT"].TryParseToDouble(); //现金冲正
|
|
}
|
|
if (drENDACCOUNT["MOBILE_CORRECT"].ToString() != "")
|
|
{
|
|
endaccountModel.MOBILE_CORRECT = drENDACCOUNT["MOBILE_CORRECT"].TryParseToDouble(); //移动支付冲正
|
|
}
|
|
if (drENDACCOUNT["SALE_CORRECT"].ToString() != "")
|
|
{
|
|
endaccountModel.SALE_CORRECT = drENDACCOUNT["SALE_CORRECT"].TryParseToDouble(); //到账实差
|
|
}
|
|
if (drENDACCOUNT["CORRECT_AMOUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.CORRECT_AMOUNT = drENDACCOUNT["CORRECT_AMOUNT"].TryParseToDouble(); //冲正总金额
|
|
}
|
|
if (drENDACCOUNT["ONLINETICKET"].ToString() != "")
|
|
{
|
|
endaccountModel.ONLINETICKET = drENDACCOUNT["ONLINETICKET"].TryParseToDouble(); //线上订单数量
|
|
}
|
|
if (drENDACCOUNT["ONLINEAMOUNT"].ToString() != "")
|
|
{
|
|
endaccountModel.ONLINEAMOUNT = drENDACCOUNT["ONLINEAMOUNT"].TryParseToDouble(); //线上订单金额
|
|
}
|
|
if (drENDACCOUNT["REVIEW_STATE"].ToString() != "")
|
|
{
|
|
endaccountModel.REVIEW_STATE = drENDACCOUNT["REVIEW_STATE"].TryParseToShort(); //复核状态
|
|
}
|
|
if (drENDACCOUNT["AUDIT_STATE"].ToString() != "")
|
|
{
|
|
endaccountModel.AUDIT_STATE = drENDACCOUNT["AUDIT_STATE"].TryParseToInt(); //是否有稽核
|
|
}
|
|
if (drENDACCOUNT["CIGARETTE_STATE"].ToString() != "")
|
|
{
|
|
endaccountModel.CIGARETTE_STATE = drENDACCOUNT["CIGARETTE_STATE"].TryParseToInt(); //是否有香烟
|
|
}
|
|
if (drENDACCOUNT["PROMOTION_STATE"].ToString() != "")
|
|
{
|
|
endaccountModel.PROMOTION_STATE = drENDACCOUNT["PROMOTION_STATE"].TryParseToInt(); //是否有促销
|
|
}
|
|
if (drENDACCOUNT["ONLINEBILL_STATE"].ToString() != "")
|
|
{
|
|
endaccountModel.ONLINEBILL_STATE = drENDACCOUNT["ONLINEBILL_STATE"].TryParseToInt(); //是否有线上订单
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region 获取日结账期表明细
|
|
/// <summary>
|
|
/// 获取日结账期表明细
|
|
/// </summary>
|
|
/// <param name="transaction">事务管理器</param>
|
|
/// <param name="ENDACCOUNTId">日结账期表内码</param>
|
|
public static Model.ENDACCOUNTModel GetENDACCOUNTDetail(Transaction transaction, int ENDACCOUNTId)
|
|
{
|
|
Model.ENDACCOUNTModel endaccountModel = new Model.ENDACCOUNTModel();
|
|
|
|
string WhereSQL = "WHERE ENDACCOUNT_ID = " + ENDACCOUNTId;
|
|
//查询明细数据
|
|
DataTable dtENDACCOUNT = new Business.ENDACCOUNT(transaction).ExecuteDataTable(
|
|
"SELECT * FROM HIGHWAY_SELLDATA.T_ENDACCOUNT " + WhereSQL);
|
|
if (dtENDACCOUNT.Rows.Count > 0)
|
|
{
|
|
//绑定日结账期表数据对象
|
|
BindDataRowToModel(dtENDACCOUNT.Rows[0], endaccountModel);
|
|
}
|
|
|
|
return endaccountModel;
|
|
}
|
|
#endregion
|
|
|
|
#region 同步日结账期表
|
|
/// <summary>
|
|
/// 赋值日结账期表数据对象
|
|
/// </summary>
|
|
/// <param name="transaction">事务管理器</param>
|
|
/// <param name="endaccountModel">日结账期表数据对象</param>
|
|
public static bool SynchroENDACCOUNT(Transaction transaction, Model.ENDACCOUNTModel endaccountModel)
|
|
{
|
|
bool SynchroFlag = true;
|
|
|
|
string SQLString;
|
|
List<string> excludeField = new List<string>();
|
|
Dictionary<string, string> dateFieldList = new Dictionary<string, string>();
|
|
string tableName = "HIGHWAY_SELLDATA.T_ENDACCOUNT", keyField = "ENDACCOUNT_ID", seqName = "SEQ_ENDACCOUNT";
|
|
Business.ENDACCOUNT _ENDACCOUNT = new Business.ENDACCOUNT(transaction);
|
|
|
|
#region 添加SQL语句中需要排除在外的字段
|
|
excludeField.Add("SERVERPART_IDS");
|
|
excludeField.Add("SERVERPARTCODES");
|
|
excludeField.Add("SearchStartDate");
|
|
excludeField.Add("SearchEndDate");
|
|
excludeField.Add("SearchStatisticsStartDate");
|
|
excludeField.Add("SearchStatisticsEndDate");
|
|
#endregion
|
|
|
|
#region 添加SQL语句中日期相关字段的执行语句
|
|
//结账时间
|
|
if (!string.IsNullOrWhiteSpace(endaccountModel.ENDACCOUNT_DATE))
|
|
{
|
|
dateFieldList.Add("ENDACCOUNT_DATE", "TO_DATE('" +
|
|
endaccountModel.ENDACCOUNT_DATE + "','YYYY/MM/DD HH24:MI:SS')");
|
|
}
|
|
else
|
|
{
|
|
dateFieldList.Add("ENDACCOUNT_DATE", "NULL");
|
|
}
|
|
//统计日期
|
|
if (!string.IsNullOrWhiteSpace(endaccountModel.STATISTICS_DATE))
|
|
{
|
|
dateFieldList.Add("STATISTICS_DATE", "TO_DATE('" +
|
|
endaccountModel.STATISTICS_DATE + "','YYYY/MM/DD HH24:MI:SS')");
|
|
}
|
|
else
|
|
{
|
|
dateFieldList.Add("STATISTICS_DATE", "NULL");
|
|
}
|
|
#endregion
|
|
|
|
if (endaccountModel.ENDACCOUNT_ID != null)
|
|
{
|
|
string WhereSQL = " WHERE ENDACCOUNT_ID = " + endaccountModel.ENDACCOUNT_ID;
|
|
DataTable dtENDACCOUNT = _ENDACCOUNT.ExecuteDataTable(
|
|
"SELECT * FROM HIGHWAY_SELLDATA.T_ENDACCOUNT" + WhereSQL);
|
|
if (dtENDACCOUNT.Rows.Count > 0)
|
|
{
|
|
SQLString = OperationDataHelper<Model.ENDACCOUNTModel>.GetTableExcuteSQL(
|
|
endaccountModel, 1, tableName, keyField, seqName, dateFieldList, excludeField, WhereSQL);
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
DataTable dtENDACCOUNT = _ENDACCOUNT.ExecuteDataTable(
|
|
"SELECT " + seqName + ".NEXTVAL FROM DUAL");
|
|
endaccountModel.ENDACCOUNT_ID = dtENDACCOUNT.Rows[0][0].TryParseToInt();
|
|
SQLString = OperationDataHelper<Model.ENDACCOUNTModel>.GetTableExcuteSQL(
|
|
endaccountModel, 0, tableName, keyField, seqName, dateFieldList, excludeField);
|
|
}
|
|
_ENDACCOUNT.ExecuteNonQuery(SQLString, null);
|
|
|
|
return SynchroFlag;
|
|
}
|
|
#endregion
|
|
|
|
#region 删除日结账期表
|
|
/// <summary>
|
|
/// 删除日结账期表
|
|
/// </summary>
|
|
/// <param name="transaction">事务管理器</param>
|
|
/// <param name="ENDACCOUNTId">日结账期表内码</param>
|
|
public static bool DeleteENDACCOUNT(Transaction transaction, int? ENDACCOUNTId)
|
|
{
|
|
bool DeleteFlag = false;
|
|
|
|
if (ENDACCOUNTId != null)
|
|
{
|
|
string SQLString = "UPDATE HIGHWAY_SELLDATA.T_ENDACCOUNT SET VALID = 0 WHERE ENDACCOUNT_ID = " + ENDACCOUNTId;
|
|
int ExcuteCount = new Business.ENDACCOUNT(transaction).ExecuteNonQuery(SQLString, null);
|
|
if (ExcuteCount > 0)
|
|
{
|
|
DeleteFlag = true;
|
|
}
|
|
}
|
|
|
|
return DeleteFlag;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|