You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

881 lines
44 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.Areas.Account.DAL.AccountAuditDAL;
using DSWeb.Areas.Account.Models.Chfee_management;
using DSWeb.TruckMng.Comm.Cookie;
using DSWeb.TruckMng.Helper;
using DSWeb.TruckMng.Helper.Repository;
using DSWeb.Areas.TruckMng.DAL.Comm;
using HcUtility.Comm;
using HcUtility.Core;
using DSWeb.MvcShipping.DAL.Chfee_AuditDAL;
using DSWeb.MvcShipping.Models.MsChFee;
using DSWeb.Areas.Account.Models.MsOpBill;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using DSWeb.MvcContainer.Models.MsOpCtnBsCard;
using DSWeb.MvcContainer.DAL.MsOpCtnBsCard;
using DSWeb.Areas.MvcShipping.DAL;
using DSWeb.EntityDA;
using System.Data;
using DSWeb.Areas.CommMng.Models;
using DSWeb.MvcShipping.DAL.MsOpSeaeDAL;
namespace DSWeb.Areas.Account.Controllers
{
[JsonRequestBehavior]
public class Chfee_AuditController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult PiLiangSubmit()
{
return View();
}
public ActionResult LRIndex()
{
return View();
}
public ContentResult GetDataList(string bsno,int type, string optype, string isAll,string condition="")
{
var dataList = Chfee_AuditDAL.GetDataList(bsno, type, optype, isAll, condition,Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetBLListData(int start, int limit, string sort,string condition)
{
var dataList = Chfee_AuditDAL.GetBillDataList(start, limit,condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
int count = Chfee_AuditDAL.getTotalCount(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
// var list = dataList.Skip(start).Take(limit);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetBLListData2(int start, int limit, string sort, string condition)
{
var dataList = Chfee_AuditDAL.GetBillDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
// int count = Chfee_AuditDAL.getTotalCount(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
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 GetBLData(string condition)
{
MsOpBill head = null;
var list = Chfee_AuditDAL.GetBillDataList(0,2,condition, Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), Convert.ToString(Session["COMPANYID"]));
if (list.Count > 0)
head = list[0];
if (head == null)
{
head = new MsOpBill();
}
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
public ContentResult Audit(String optype, String bill, string mblno = "", string bsno = "", string isamend = "")
{
var workflowstr = "";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1" && isamend=="1") workflowstr = "AmendFeefyAudit";
DBResult result = Chfee_AuditDAL.Audit(optype, Convert.ToString(Session["USERID"]), bill, mblno, bsno, workflowstr);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult AuditList(String optype, string bill, string mblno = "", string bsno = "", string isamend = "")
{
var workflowstr = "";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1" && isamend == "1") workflowstr = "AmendFeefyAudit";
var billData = JsonConvert.Deserialize<List<MsChFee>>(bill);
DBResult result = Chfee_AuditDAL.AuditList(optype, Convert.ToString(Session["USERID"]), billData, mblno, bsno, workflowstr);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult AuditBack(String optype, String bill, string reasean,string isamend)
{
var workflowstr = "";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1" && isamend == "1") workflowstr = "AmendFeefyAudit";
var billData = JsonConvert.Deserialize<List<MsChFee>>(bill);
DBResult result = Chfee_AuditDAL.AuditBack(optype, Convert.ToString(Session["USERID"]), billData, reasean, workflowstr);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAudit(string GidStr, string optype,string bsno="")
{
DBResult result = Chfee_AuditDAL.SubmitAudit(optype, Convert.ToString(Session["USERID"]), GidStr, bsno,"");
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditAmend(string GidStr, string optype, string bsno = "")
{
var workflowstr="";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
DBResult result = Chfee_AuditDAL.SubmitAudit(optype, Convert.ToString(Session["USERID"]), GidStr, bsno, workflowstr);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditYj(string GidStr, string optype, string bsno = "")
{
DBResult result = Chfee_AuditDAL.SubmitAudit(optype, Convert.ToString(Session["USERID"]), GidStr, bsno, "YjFeefyAudit");
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditNew(string feebody, string optype)
{
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
var billData = JsonConvert.Deserialize<List<MsChFee>>(feebody);
DBResult result = Chfee_AuditDAL.SubmitAuditNew(optype, Convert.ToString(Session["USERID"]), billData, false, "", ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditOp(string feebody, string optype)
{
var workflowstr = "OpFeeAudit";
var billData = JsonConvert.Deserialize<List<MsChFee>>(feebody);
DBResult result = Chfee_AuditDAL.SubmitAuditNew(optype, Convert.ToString(Session["USERID"]), billData, false, workflowstr, "0");
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditNewAmend(string feebody, string optype)
{
var ISSALEWORK=CookieConfig.GetCookie_ISSALEWORK(Request);
var workflowstr="";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
var billData = JsonConvert.Deserialize<List<MsChFee>>(feebody);
DBResult result = Chfee_AuditDAL.SubmitAuditNew(optype, Convert.ToString(Session["USERID"]), billData, false, workflowstr, ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditOpAmend(string feebody, string optype)
{
var workflowstr = "OpFeeAudit";
//var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
//if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
var billData = JsonConvert.Deserialize<List<MsChFee>>(feebody);
DBResult result = Chfee_AuditDAL.SubmitAuditNew(optype, Convert.ToString(Session["USERID"]), billData, false, workflowstr,"0");
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditNewYj(string feebody, string optype)
{
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
var billData = JsonConvert.Deserialize<List<MsChFee>>(feebody);
DBResult result = Chfee_AuditDAL.SubmitAuditNew(optype, Convert.ToString(Session["USERID"]), billData, false, "YjFeefyAudit", ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditBL(string feebody, string optype,string bsno="")
{
#region 2018年5月24日14:26:34 李进举 存在为0的费用弹出提示不允许提交
string mblnotemp = "";
bool checkRst = MsOpSeaeDAL.CheckHasZeroFeeWithBsno("'"+bsno+"'",out mblnotemp);
if (checkRst)
{
DBResult resultC = new DBResult();
resultC.Success = false;
resultC.Message = "存在金额为0的费用无法整票提交";
var jsonC = JsonConvert.Serialize(resultC);
return new ContentResult() { Content = jsonC };
}
#endregion
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
#region 2018年2月5日 李进举 鼎世
T_ALL_DA T_ALL_DA = new T_ALL_DA();
//费用未更改的时候点击整票提交时触发以下操作(2018年2月28日17:50:58李进举 不加此限制)
//①根据系统参数判断是否进行费用锁定(2018年3月1日15:35:45 李进举 该参数不影响整票状态的操作)
//②发送消息
//③op_seae新增字段BillFeeStatus整票状态的值设置为1整票提交
try
{
if (bsno!=null&&bsno!="")
{
//if (feebody == "" || feebody == null)
if (true)
{
//更新【BillFeeStatus整票提交】的状态
string blUpSQL0 = "UPDATE " + optype + " SET BillFeeStatus=1 WHERE BSNO='" + bsno + "'";
bool bl0 = T_ALL_DA.GetExecuteSqlCommand(blUpSQL0);
//根据参数判断是否执行【锁定】操作
var SUBMITFEEBLFEELOCK = MsSysParamSetDAL.GetData("PARAMNAME='SUBMITFEEBLFEELOCK'");
if (SUBMITFEEBLFEELOCK.PARAMVALUE == "1")
{
string blUpSQL = "UPDATE " + optype + " SET FEESTATUS=1 WHERE BSNO='" + bsno + "'";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
#region 发送消息
DataSet dsFenDan = T_ALL_DA.GetAllSQL("select top 1 MBLNO,(select top 1 GID from [user] where SHOWNAME=b.SALE) SALEID,(select top 1 GID from [user] where SHOWNAME=b.CUSTSERVICE) CUSTSERVICEID from v_op_bill b where bsno='" + bsno+ "'");
if (dsFenDan != null)
{
if (dsFenDan.Tables[0].Rows.Count > 0)
{
var mblno = dsFenDan.Tables[0].Rows[0]["MBLNO"].ToString();
var SALEID = dsFenDan.Tables[0].Rows[0]["SALEID"].ToString();
var CUSTSERVICEID = dsFenDan.Tables[0].Rows[0]["CUSTSERVICEID"].ToString();
string uname = CookieConfig.GetCookie_UserName(Request);
var Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SubmitAudit";
Msgdata.DESCRIPTION = uname + "提交费用审核";
Msgdata.MESSAGECONTENT = uname + "提交费用审核," + " 提单号:" + mblno;
Msgdata.RECEIVER = SALEID;
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID =bsno;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
var Msgmodb = new ModelObjectRepository();
Msgmodb.Save(Msgdata);
Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SubmitAudit";
Msgdata.DESCRIPTION = uname + "提交费用审核";
Msgdata.MESSAGECONTENT = uname + "提交费用审核," + " 提单号:" + mblno;
Msgdata.RECEIVER = CUSTSERVICEID;
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = bsno;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
Msgmodb.Save(Msgdata);
}
}
#endregion
//DBResult result1 = new DBResult();
//result1.Success = bl;
//result1.Message = bl?"业务提交成功":"业务提交失败";
//var json1 = JsonConvert.Serialize(result1);
//return new ContentResult() { Content = json1 };
}
else
{
//整票提交锁定费用参数为0时只发送消息
#region 发送消息
DataSet dsFenDan = T_ALL_DA.GetAllSQL("select top 1 MBLNO,(select top 1 GID from [user] where SHOWNAME=b.SALE) SALEID,(select top 1 GID from [user] where SHOWNAME=b.CUSTSERVICE) CUSTSERVICEID from v_op_bill b where bsno='" + bsno + "'");
if (dsFenDan != null)
{
if (dsFenDan.Tables[0].Rows.Count > 0)
{
var mblno = dsFenDan.Tables[0].Rows[0]["MBLNO"].ToString();
var SALEID = dsFenDan.Tables[0].Rows[0]["SALEID"].ToString();
var CUSTSERVICEID = dsFenDan.Tables[0].Rows[0]["CUSTSERVICEID"].ToString();
string uname = CookieConfig.GetCookie_UserName(Request);
var Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SubmitAudit";
Msgdata.DESCRIPTION = uname + "提交费用审核";
Msgdata.MESSAGECONTENT = uname + "提交费用审核," + " 提单号:" + mblno;
Msgdata.RECEIVER = SALEID;
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = bsno;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
var Msgmodb = new ModelObjectRepository();
Msgmodb.Save(Msgdata);
Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SubmitAudit";
Msgdata.DESCRIPTION = uname + "提交费用审核";
Msgdata.MESSAGECONTENT = uname + "提交费用审核," + " 提单号:" + mblno;
Msgdata.RECEIVER = CUSTSERVICEID;
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = bsno;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
Msgmodb.Save(Msgdata);
}
}
//DBResult result1 = new DBResult();
//result1.Success = true;
//result1.Message = "业务提交成功";
//var json1 = JsonConvert.Serialize(result1);
//return new ContentResult() { Content = json1 };
#endregion
}
}
}
}
catch (Exception)
{
}
#endregion
var billData = JsonConvert.Deserialize<List<MsChFee>>(feebody);
DBResult result = Chfee_AuditDAL.SubmitAuditNew(optype, Convert.ToString(Session["USERID"]), billData, true, "", ISSALEWORK);
if (result.Success)
{
#region 运踪相关
try
{
MsOpStatusNewDAL mdal = new MsOpStatusNewDAL();
string uname = CookieConfig.GetCookie_UserName(Request);
mdal.UpdateMainStatus(billData[0].BsNo, 5, uname);
}
catch (Exception)
{
}
#endregion
var SUBMITFEEBLFEELOCK = MsSysParamSetDAL.GetData("PARAMNAME='SUBMITFEEBLFEELOCK'");
if (SUBMITFEEBLFEELOCK.PARAMVALUE == "1")
{
//2018年2月7日 李进举 鼎世 增加 BillFeeStatus字段更新
//string blUpSQL = "UPDATE " + optype + " SET FEESTATUS=1 WHERE BSNO='" + billData[0].BsNo + "'";
string blUpSQL = "UPDATE " + optype + " SET FEESTATUS=1,BillFeeStatus=1 WHERE BSNO='" + billData[0].BsNo + "'";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
DataSet dsFenDan = T_ALL_DA.GetAllSQL("select top 1 MBLNO,(select top 1 GID from [user] where SHOWNAME=b.SALE) SALEID,(select top 1 GID from [user] where SHOWNAME=b.CUSTSERVICE) CUSTSERVICEID from v_op_bill b where bsno='" + billData[0].BsNo + "'");
if (dsFenDan != null)
{
if (dsFenDan.Tables[0].Rows.Count > 0)
{
var mblno = dsFenDan.Tables[0].Rows[0]["MBLNO"].ToString();
var SALEID = dsFenDan.Tables[0].Rows[0]["SALEID"].ToString();
var CUSTSERVICEID = dsFenDan.Tables[0].Rows[0]["CUSTSERVICEID"].ToString();
string uname = CookieConfig.GetCookie_UserName(Request);
var Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SubmitAudit";
Msgdata.DESCRIPTION = uname + "提交费用审核";
Msgdata.MESSAGECONTENT = uname + "提交费用审核," + " 提单号:" + mblno;
Msgdata.RECEIVER = SALEID;
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = billData[0].BsNo;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
var Msgmodb = new ModelObjectRepository();
Msgmodb.Save(Msgdata);
Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SubmitAudit";
Msgdata.DESCRIPTION = uname + "提交费用审核";
Msgdata.MESSAGECONTENT = uname + "提交费用审核," + " 提单号:" + mblno;
Msgdata.RECEIVER = CUSTSERVICEID;
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = billData[0].BsNo;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
Msgmodb.Save(Msgdata);
}
}
}
else
{
//2018年2月5日11:20:26 李进举 鼎世 整票提交锁定参数为0时也发送消息
//2018年2月7日09:30:56 李进举 鼎世 整条提交锁定参数为0时仍然修改BillFeeStatus
string blUpSQL2 = "UPDATE " + optype + " SET BillFeeStatus=1 WHERE BSNO='" + bsno + "'";
bool bl2 = T_ALL_DA.GetExecuteSqlCommand(blUpSQL2);
DataSet dsFenDan = T_ALL_DA.GetAllSQL("select top 1 MBLNO,(select top 1 GID from [user] where SHOWNAME=b.SALE) SALEID,(select top 1 GID from [user] where SHOWNAME=b.CUSTSERVICE) CUSTSERVICEID from v_op_bill b where bsno='" + billData[0].BsNo + "'");
if (dsFenDan != null)
{
if (dsFenDan.Tables[0].Rows.Count > 0)
{
var mblno = dsFenDan.Tables[0].Rows[0]["MBLNO"].ToString();
var SALEID = dsFenDan.Tables[0].Rows[0]["SALEID"].ToString();
var CUSTSERVICEID = dsFenDan.Tables[0].Rows[0]["CUSTSERVICEID"].ToString();
string uname = CookieConfig.GetCookie_UserName(Request);
var Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SubmitAudit";
Msgdata.DESCRIPTION = uname + "提交费用审核";
Msgdata.MESSAGECONTENT = uname + "提交费用审核," + " 提单号:" + mblno;
Msgdata.RECEIVER = SALEID;
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = billData[0].BsNo;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
var Msgmodb = new ModelObjectRepository();
Msgmodb.Save(Msgdata);
Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SubmitAudit";
Msgdata.DESCRIPTION = uname + "提交费用审核";
Msgdata.MESSAGECONTENT = uname + "提交费用审核," + " 提单号:" + mblno;
Msgdata.RECEIVER = CUSTSERVICEID;
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = billData[0].BsNo;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
Msgmodb.Save(Msgdata);
}
}
}
}
//解决整票状态更新成功,但引无提交数据的报错
result.Success = true;
result.Message = "提交数据处理异常!";
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditBLAmend(string feebody, string optype)
{
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
var workflowstr = "";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
var billData = JsonConvert.Deserialize<List<MsChFee>>(feebody);
DBResult result = Chfee_AuditDAL.SubmitAuditNew(optype, Convert.ToString(Session["USERID"]), billData, true, workflowstr, ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditBLYj(string feebody, string optype)
{
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
var billData = JsonConvert.Deserialize<List<MsChFee>>(feebody);
DBResult result = Chfee_AuditDAL.SubmitAuditNew(optype, Convert.ToString(Session["USERID"]), billData, true, "YjFeefyAudit", ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult GetErrorFeeMbl(string bsnos, string optype, int feetype)
{
DBResult result = Chfee_AuditDAL.GetErrorFeeMbl(optype, bsnos, feetype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult PiliangSubmitAudit(string bsnos, string optype, int feetype)
{
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
DBResult result = Chfee_AuditDAL.piliangSubmitAudit(optype, bsnos, feetype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult PiliangSubmitAuditlist(string bsnos1, string bsnos2, string bsnos3, string bsnos4, string bsnos5, string optype, int feetype)
{
DBResult result = null;
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
if (bsnos1 != "")
{
bsnos1 = " BSNO IN (" + bsnos1 + ")";
result = Chfee_AuditDAL.piliangSubmitAudit(optype, bsnos1, feetype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), ISSALEWORK);
}
if (bsnos2 != "")
{
bsnos2 = " BSNO IN (" + bsnos2 + ")";
result = Chfee_AuditDAL.piliangSubmitAudit(optype, bsnos2, feetype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), ISSALEWORK);
}
if (bsnos3 != "")
{
bsnos3= " BSNO IN (" + bsnos3 + ")";
result = Chfee_AuditDAL.piliangSubmitAudit(optype, bsnos3, feetype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), ISSALEWORK);
}
if (bsnos4 != "")
{
bsnos4 = " BSNO IN (" + bsnos4 + ")";
result = Chfee_AuditDAL.piliangSubmitAudit(optype, bsnos4, feetype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), ISSALEWORK);
}
if (bsnos5 != "")
{
bsnos5 = " BSNO IN (" + bsnos5 + ")";
result = Chfee_AuditDAL.piliangSubmitAudit(optype, bsnos5, feetype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), ISSALEWORK);
}
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
//public ContentResult PiliangSubmitAuditlist(string bill, string optype, int feetype)
//{
// var billList = JsonConvert.Deserialize<List<MsOpBill>>(bill);
// DBResult result = Chfee_AuditDAL.piliangSubmitAuditlist(optype, billList, feetype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
// var json = JsonConvert.Serialize(result);
// return new ContentResult() { Content = json };
//}
public ContentResult CancelAudit(string GidStr, string optype)
{
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
//DBResult result = Chfee_AuditDAL.CancelAudit(optype, Convert.ToString(Session["DEPTGID"]), Convert.ToString(Session["USERID"]), GidStr);
DBResult result = Chfee_AuditDAL.CancelAudit(optype, Convert.ToString(Session["USERID"]), GidStr, "", ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult CancelAuditAmend(string GidStr, string optype)
{
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
var workflowstr = "";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
DBResult result = Chfee_AuditDAL.CancelAudit(optype, Convert.ToString(Session["USERID"]), GidStr, workflowstr, ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult CancelAuditYj(string GidStr, string optype)
{
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
DBResult result = Chfee_AuditDAL.CancelAudit(optype, Convert.ToString(Session["USERID"]), GidStr, "YjFeefyAudit", ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult ShenModify(string data, string olddata, string optype, string isamend="")
{
var NewFee = JsonConvert.Deserialize<MsChFee>(data);
var OldFee = JsonConvert.Deserialize<MsChFee>(olddata);
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
var workflowstr = "";
if (isamend == "1")
{
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
}
DBResult result = Chfee_AuditDAL.ShenModify(NewFee, OldFee, Convert.ToString(Session["USERID"]), optype, Convert.ToString(Session["DEPTGID"]), workflowstr, ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult ShenDelete(string data, string optype, string isamend = "")
{
var OldFee = JsonConvert.Deserialize<MsChFee>(data);
var workflowstr = "";
if (isamend == "1")
{
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
}
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
DBResult result = Chfee_AuditDAL.ShenDelete(OldFee, Convert.ToString(Session["USERID"]), optype, Convert.ToString(Session["DEPTGID"]), workflowstr, ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult CancelShen(string Feeid, string optype, string isamend = "")
{
var workflowstr = "";
if (isamend == "1")
{
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
}
var ISSALEWORK = CookieConfig.GetCookie_ISSALEWORK(Request);
DBResult result = Chfee_AuditDAL.CancelShen(Feeid, optype, Convert.ToString(Session["USERID"]), workflowstr, ISSALEWORK);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult AuditBackShen(String optype, string bill, string reasean, string isamend = "")
{
var billData = JsonConvert.Deserialize<List<MsChFee>>(bill);
var workflowstr = "";
if (isamend == "1")
{
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
}
DBResult result = Chfee_AuditDAL.AuditBackShen(optype, Convert.ToString(Session["USERID"]), billData, reasean, workflowstr);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult AuditShen(String optype, String bill, int Feestatus, string bsno, string isamend = "")
{
var workflowstr = "";
if (isamend == "1")
{
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
}
DBResult result = Chfee_AuditDAL.AuditShen(optype, Convert.ToString(Session["USERID"]), bill, Feestatus, bsno, workflowstr);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult AuditShenNew(String optype, String bill, string isamend = "")
{
var billData = JsonConvert.Deserialize<List<MsChFee>>(bill);
var workflowstr = "";
if (isamend == "1")
{
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
}
DBResult result = Chfee_AuditDAL.AuditShenNew(optype, Convert.ToString(Session["USERID"]), billData, workflowstr);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult ShenNewCustName(String data, string CustomerName)
{
var billData = JsonConvert.Deserialize<List<MsChFee>>(data);
DBResult result = Chfee_AuditDAL.ShenNewCustName(billData, CustomerName, Convert.ToString(Session["USERID"]));
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult NoIvoice(String bill)
{
DBResult result = Chfee_AuditDAL.NoIvoice(bill);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SetIsOpen(string GidStr)
{
DBResult result = Chfee_AuditDAL.SetIsOpen(GidStr,true);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult UpLock(string bsno, string optype)
{
var AuditAutoLock = MsSysParamSetDAL.GetData("PARAMNAME='AuditAutoLock'");
if (AuditAutoLock.PARAMVALUE != "1")
{
var jsonRespose = new JsonResponse
{
Success = true
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
else
{
DBResult result = Chfee_AuditDAL.UpLock(bsno, optype);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
}
public ContentResult CancelNoIvoice(String bill)
{
DBResult result = Chfee_AuditDAL.CancelNoIvoice(bill);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SelAudit(string data)
{
var AuditAutoLock = MsSysParamSetDAL.GetData("PARAMNAME='AuditAutoLock'");
var workflowstr = "";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
var billData = JsonConvert.Deserialize<List<MsOpBill>>(data);
DBResult result = null;
foreach (var enumValue in billData)
{
if (enumValue.OPTYPE == "更改单" && AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit"; else workflowstr = "";
result = Chfee_AuditDAL.PiliangAudit(enumValue.OPLB, enumValue.BSNO, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), workflowstr);
if (result.Success == true) {
if (AuditAutoLock.PARAMVALUE== "1")
{
Chfee_AuditDAL.UpLock(enumValue.BSNO, enumValue.OPLB);
}
}
}
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SelCtnBsCardAudit(string data)
{
var billData = JsonConvert.Deserialize<List<OpCtnBsCard>>(data);
DBResult result = null;
foreach (var enumValue in billData)
{
result = Chfee_AuditDAL.PiliangAudit("罐箱业务卡", enumValue.GID, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]),"");
}
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult AllAudit(string condition)
{
var AuditAutoLock = MsSysParamSetDAL.GetData("PARAMNAME='AuditAutoLock'");
var workflowstr = "";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
var billData = Chfee_AuditDAL.GetBillDataList(0,10000,condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), null, true);
DBResult result = null;
foreach (var enumValue in billData)
{
if (enumValue.OPTYPE == "更改单" && AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit"; else workflowstr = "";
result = Chfee_AuditDAL.PiliangAudit(enumValue.OPLB, enumValue.BSNO, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), workflowstr);
if (result.Success == true)
{
if (AuditAutoLock.PARAMVALUE == "1")
{
Chfee_AuditDAL.UpLock(enumValue.BSNO, enumValue.OPLB);
}
}
}
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult AllCtnBscardAudit(string condition)
{
var billData = MsOpCtnBsCardDAL.GetDataList(condition,"index", Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]));
DBResult result = null;
foreach (var enumValue in billData)
{
result = Chfee_AuditDAL.PiliangAudit("罐箱业务卡", enumValue.GID, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]),"");
}
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
#region 参照部分
#endregion
}
}