增加诺诺全电发票的逻辑

QDHHYT
ddlucky 2 years ago
parent 4f1c6132f5
commit 96601b26e8

@ -2,68 +2,68 @@
extend: 'Ext.data.Model',
idProperty: 'GID',
fields: [
{ name: 'GID', type: 'string' },
{ name: 'BILLNO', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'ACTUALCUSTOMERNAME', type: 'string' },
{ name: 'CURRENCY', type: 'string' },
{ name: 'RECVCURR', type: 'string' },
{ name: 'INVOICENO', type: 'string' },
{ name: 'INVOICECUSTNAME', type: 'string' },
{ name: 'INVOICETYPE', type: 'number' },
{ name: 'INVOICETYPEREF', type: 'string' },
{ name: 'BILLSTATUS', type: 'number' },
{ name: 'BILLSTATUSREF', type: 'string' },
{ name: 'INVOICECATEGORY', type: 'string' },
{ name: 'INVOICECATEGORYREF', type: 'string' },
{ name: 'AMOUNT', type: 'number' },
{ name: 'DOAMOUNT', type: 'number' },
{ name: 'STLAMOUNT', type: 'number' },
{ name: 'INVAMOUNT', type: 'number' },
{ name: 'OTCURRAMOUNT', type: 'number' },
{ name: 'EXCHANGERATE', type: 'number' },
{ name: 'AMOUNTCAPITAL', type: 'string' },
{ name: 'APPLICANT', type: 'string' },
{ name: 'APPLICANTNAME', type: 'string' },
{ name: 'APPLYTIME', type: 'string' },
{ name: 'OPERATOR', type: 'string' },
{ name: 'OPERATORNAME', type: 'string' },
{ name: 'GID', type: 'string' },
{ name: 'BILLNO', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'ACTUALCUSTOMERNAME', type: 'string' },
{ name: 'CURRENCY', type: 'string' },
{ name: 'RECVCURR', type: 'string' },
{ name: 'INVOICENO', type: 'string' },
{ name: 'INVOICECUSTNAME', type: 'string' },
{ name: 'INVOICETYPE', type: 'number' },
{ name: 'INVOICETYPEREF', type: 'string' },
{ name: 'BILLSTATUS', type: 'number' },
{ name: 'BILLSTATUSREF', type: 'string' },
{ name: 'INVOICECATEGORY', type: 'string' },
{ name: 'INVOICECATEGORYREF', type: 'string' },
{ name: 'AMOUNT', type: 'number' },
{ name: 'DOAMOUNT', type: 'number' },
{ name: 'STLAMOUNT', type: 'number' },
{ name: 'INVAMOUNT', type: 'number' },
{ name: 'OTCURRAMOUNT', type: 'number' },
{ name: 'EXCHANGERATE', type: 'number' },
{ name: 'AMOUNTCAPITAL', type: 'string' },
{ name: 'APPLICANT', type: 'string' },
{ name: 'APPLICANTNAME', type: 'string' },
{ name: 'APPLYTIME', type: 'string' },
{ name: 'OPERATOR', type: 'string' },
{ name: 'OPERATORNAME', type: 'string' },
{ name: 'OPERATETIME', type: 'string' },
{ name: 'CREATEUSER', type: 'string' },
{ name: 'CREATEUSERREF', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'INVOICEMAKETIME', type: 'string' },
{ name: 'COMPANYID', type: 'string' },
{ name: 'BSNO', type: 'string' },
{ name: 'MBLNO', type: 'string' },
{ name: 'INVOICEMAKETIME', type: 'string' },
{ name: 'COMPANYID', type: 'string' },
{ name: 'BSNO', type: 'string' },
{ name: 'MBLNO', type: 'string' },
{ name: 'VESSELVOYAGE', type: 'string' },
{ name: 'ETD', type: 'string' },
{ name: 'POL', type: 'string' },
{ name: 'POD', type: 'string' },
{ name: 'CUSTRATENO', type: 'string' },
{ name: 'CUSTADDRTEL', type: 'string' },
{ name: 'CUSTBANK', type: 'string' },
{ name: 'BANK', type: 'string' },
{ name: 'ACCOUNT', type: 'string' },
{ name: 'LICENSECODE', type: 'string' },
{ name: 'TAXCODE', type: 'string' },
{ name: 'VOUCHERNO', type: 'string' },
{ name: 'ISNEEDPRINT', type: 'string' },
{ name: 'ISNEEDFEE', type: 'string' },
{ name: 'ISDELETE', type: 'string' },
{ name: 'DELETEOPERATOR', type: 'string' },
{ name: 'DELOPERATORNAME', type: 'string' },
{ name: 'DELETETIME', type: 'string' },
{ name: 'NOSTL', type: 'string' },
{ name: 'FEEAMOUNT', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'SALECORPID', type: 'string' },
{ name: 'SALECORP', type: 'string' },
{ name: 'DZSTATUS', type: 'string' },
{ name: 'ETD', type: 'string' },
{ name: 'POL', type: 'string' },
{ name: 'POD', type: 'string' },
{ name: 'CUSTRATENO', type: 'string' },
{ name: 'CUSTADDRTEL', type: 'string' },
{ name: 'CUSTBANK', type: 'string' },
{ name: 'BANK', type: 'string' },
{ name: 'ACCOUNT', type: 'string' },
{ name: 'LICENSECODE', type: 'string' },
{ name: 'TAXCODE', type: 'string' },
{ name: 'VOUCHERNO', type: 'string' },
{ name: 'ISNEEDPRINT', type: 'string' },
{ name: 'ISNEEDFEE', type: 'string' },
{ name: 'ISDELETE', type: 'string' },
{ name: 'DELETEOPERATOR', type: 'string' },
{ name: 'DELOPERATORNAME', type: 'string' },
{ name: 'DELETETIME', type: 'string' },
{ name: 'NOSTL', type: 'string' },
{ name: 'FEEAMOUNT', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'SALECORPID', type: 'string' },
{ name: 'SALECORP', type: 'string' },
{ name: 'DZSTATUS', type: 'string' },
{ name: 'VOUNO', type: 'string' }
//20191023添加 适应航信接口的需要
,{ name: 'CUSTTEL', type: 'string' },
, { name: 'CUSTTEL', type: 'string' },
{ name: 'CUSTADDR', type: 'string' },
{ name: 'PTORRED', type: 'string' },
{ name: 'REDCODE', type: 'string' },
@ -81,26 +81,28 @@
{ name: 'PUSHMODEREF', type: 'string' },
{ name: 'INVOICELINEREF', type: 'string' },
{ name: 'EINVOICESTATEREF', type: 'string' },
{ name: 'SETRED', type: 'string' }
{ name: 'ISFRINV', type: 'bool' },
{ name: 'SETRED', type: 'string' },
{ name: 'redReason', type: 'string' }
]
]
});
Ext.define('MsChInvoiceNo', {
extend: 'Ext.data.Model',
idProperty: 'INVNO',
fields: [
{ name: 'INVNO', type: 'string' }
]
{ name: 'INVNO', type: 'string' }
]
});
Ext.define('companymb', {
extend: 'Ext.data.Model',
fields: [
{ name: 'gid', type: 'string' },
{ name: 'name', type: 'string' }
]
{ name: 'gid', type: 'string' },
{ name: 'name', type: 'string' }
]
});
@ -109,20 +111,20 @@ Ext.define('MsInfoClientBankModel', {
extend: 'Ext.data.Model',
idProperty: 'GID',
fields: [
{ name: 'GID', type: 'string' },
{ name: 'LINKID', type: 'string' },
{ name: 'ACCOUNTNAME', type: 'string' },
{ name: 'CODENAME', type: 'string' },
{ name: 'CURRENCY', type: 'string' },
{ name: 'ACCOUNTNAMEREF', type: 'string' },
{ name: 'BANKNAME', type: 'string' },
{ name: 'ACCOUNT', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'FINANCESOFTCODE', type: 'string' },
{ name: 'CREATEUSER', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'CWGLACCID', type: 'string' },
{ name: 'BANKNAME_ACCOUNT', type: 'string' }
{ name: 'GID', type: 'string' },
{ name: 'LINKID', type: 'string' },
{ name: 'ACCOUNTNAME', type: 'string' },
{ name: 'CODENAME', type: 'string' },
{ name: 'CURRENCY', type: 'string' },
{ name: 'ACCOUNTNAMEREF', type: 'string' },
{ name: 'BANKNAME', type: 'string' },
{ name: 'ACCOUNT', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'FINANCESOFTCODE', type: 'string' },
{ name: 'CREATEUSER', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'CWGLACCID', type: 'string' },
{ name: 'BANKNAME_ACCOUNT', type: 'string' }
]
});
@ -225,7 +227,7 @@ Ext.define('MsChInvoice_FEE_P2', {
{ name: 'FEENAME', type: 'string' },
{ name: 'AMOUNT', type: 'string' },
{ name: 'AMOUNT_EX', type: 'string' },
{ name: 'RATE', type: 'string' },
{ name: 'PRICE', type: 'string' },
{ name: 'NUM', type: 'string' }

@ -31,6 +31,7 @@ using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using static DSWeb.Areas.CommMng.DAL.BasicDataRefDAL;
using System.Security.Cryptography;
namespace DSWeb.Areas.CommMng.DAL
{
@ -6131,6 +6132,87 @@ namespace DSWeb.Areas.CommMng.DAL
#endregion
#region MD5值
public static string GetMd5Hash(string str)
{
if (string.IsNullOrWhiteSpace(str))
{
return null;
}
MD5 md5hash = MD5.Create();
byte[] data = md5hash.ComputeHash(Encoding.UTF8.GetBytes(str));
StringBuilder sBuilder = new StringBuilder();
for (int i = 0; i < data.Length; i++)
{
sBuilder.Append(data[i].ToString("x2"));
}
return sBuilder.ToString();
}
#endregion
public static ContentResult GetContentResult(DBResult dbresult)
{
var jsonRespose = new JsonResponse
{
Success = dbresult.Success,
Message = dbresult.Message,
Data = null
};
if (dbresult.Data != null) jsonRespose.Data = dbresult.Data;
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public static DateTime ConvertLongToDateTime(long? d)
{
DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
long lTime = long.Parse(d + "0000");
TimeSpan toNow = new TimeSpan(lTime);
DateTime dtResult = dtStart.Add(toNow);
return dtResult;
}
public static string ConvertToChineseMoney(double money)
{
if (money < 0)
{
throw new ArgumentOutOfRangeException($"参数 money 不能为负值!");
}
string s = money.ToString("#L#E#D#C#K#E#D#C#J#E#D#C#I#E#D#C#H#E#D#C#G#E#D#C#F#E#D#C#.0B0A");
s = Regex.Replace(s, @"((?<=-|^)[^1-9]*)|((?'z'0)[0A-E]*((?=[1-9])
|(?'-z'(?=[F-L\.]|$))))|((?'b'[F-L])(?'z'0)[0A-L]*((?=[1-9])|(?'-z'(?=[\.]|$))))", "${b}${z}");
return Regex.Replace(s, ".", delegate (System.Text.RegularExpressions.Match m)
{
return "负元空零壹贰叁肆伍陆柒捌玖空空空空空空空分角拾佰仟萬億兆京垓秭穰"[m.Value[0] - '-'].ToString();
});
}
public static string ConvertToChineseMoney2(double money)
{
var result = ConvertToChineseMoney(money);
var lastchar = result.Substring(result.Length - 1, 1);
if (lastchar == "角" || lastchar == "分")
{
}
else
{
result += "整";
}
return result;
}
public static string getDatetimeString(object obj) {
if (string.IsNullOrWhiteSpace(obj.ToString())) return "";
else
@ -6146,6 +6228,19 @@ namespace DSWeb.Areas.CommMng.DAL
}
}
/// <summary>
/// 毫秒型时间戳转datetime
/// </summary>
/// <param name="timestamp"></param>
/// <returns></returns>
public static DateTime Timestamp2Datetime(long timestamp)
{
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));//当地时区
var time = startTime.AddMilliseconds(timestamp);
return time;
}
#region 解析BC的pdf文档
public static DataTable ExcelToDatatable_2(Stream stream, string fileType, out string strMsg, string sheetName = null)

@ -19,7 +19,7 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
var strSql = new StringBuilder();
strSql.Append("SELECT GID,INVOICELINE,INVITERFACE,[CREATEUSER]");
strSql.Append(",[CREATETIME],[MODIFIEDUSER],[MODIFIEDTIME],[COMPANYID]");
strSql.Append(",[CREATETIME],[MODIFIEDUSER],[MODIFIEDTIME],[COMPANYID],NUONUOAPPKEY,NUONUOAPPSECRET");
strSql.Append(",(select ShowName from [user] where GID=sys_inv_interfaceset.CREATEUSER) as CREATEUSERREF");
strSql.Append(" from sys_inv_interfaceset where 1=1 ");
@ -32,9 +32,10 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
{
strSql.Append(" order by " + sortstring);
}
else {
else
{
strSql.Append(" order by INVOICELINE");
}
return SetData(strSql);
}
@ -42,7 +43,7 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
static public SysInvInterFaceSet GetData(string condition, string companyid)
{
SysInvInterFaceSet data = null;
var list = GetDataList(condition,companyid);
var list = GetDataList(condition, companyid);
if (list.Count > 0)
data = list[0];
@ -73,6 +74,8 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
if (reader["CREATETIME"] != DBNull.Value)
data.CREATETIME = Convert.ToDateTime(reader["CREATETIME"]).ToString("yyyy-MM-dd HH:mm:ss");
data.COMPANYID = Convert.ToString(reader["COMPANYID"]);
data.NUONUOAPPKEY = Convert.ToString(reader["NUONUOAPPKEY"]);
data.NUONUOAPPSECRET = Convert.ToString(reader["NUONUOAPPSECRET"]);
#endregion
headList.Add(data);
}
@ -82,7 +85,7 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
}
#endregion
public static DBResult SaveDetail(List<SysInvInterFaceSet> bodyList, string companyid,string userid,string LOCALCURR)
public static DBResult SaveDetail(List<SysInvInterFaceSet> bodyList, string companyid, string userid, string LOCALCURR)
{
var result = new DBResult();
@ -99,11 +102,11 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
var cmdInsert =
db.GetSqlStringCommand(
@"insert into sys_inv_interfaceset (GID,INVOICELINE,INVITERFACE,COMPANYID,CREATEUSER,CREATETIME)
values (@GID,@INVOICELINE,@INVITERFACE,@COMPANYID,@CREATEUSER,@CREATETIME) ");
values (@GID,@INVOICELINE,@INVITERFACE,@COMPANYID,@CREATEUSER,@CREATETIME,@NUONUOAPPKEY,@NUONUOAPPSECRET) ");
var cmdUpdate =
db.GetSqlStringCommand(
@"update sys_inv_interfaceset set INVOICELINE=@INVOICELINE,INVITERFACE=@INVITERFACE,MODIFIEDUSER=@MODIFIEDUSER,MODIFIEDTIME=@MODIFIEDTIME where GID=@GID ");
@"update sys_inv_interfaceset set INVOICELINE=@INVOICELINE,INVITERFACE=@INVITERFACE,MODIFIEDUSER=@MODIFIEDUSER,MODIFIEDTIME=@MODIFIEDTIME,NUONUOAPPKEY=@NUONUOAPPKEY,NUONUOAPPSECRET=@NUONUOAPPSECRET where GID=@GID ");
if (bodyList != null)
{
@ -121,6 +124,8 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
db.AddInParameter(cmdInsert, "@CREATETIME", DbType.String, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
db.AddInParameter(cmdInsert, "@CREATEUSER", DbType.String, userid);
db.AddInParameter(cmdInsert, "@COMPANYID", DbType.String, companyid);
db.AddInParameter(cmdInsert, "@NUONUOAPPKEY", DbType.String, enumValue.NUONUOAPPKEY);
db.AddInParameter(cmdInsert, "@NUONUOAPPSECRET", DbType.String, enumValue.NUONUOAPPSECRET);
db.ExecuteNonQuery(cmdInsert, tran);
}
else
@ -132,6 +137,8 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
db.AddInParameter(cmdUpdate, "@INVITERFACE", DbType.String, enumValue.INVITERFACE);
db.AddInParameter(cmdUpdate, "@MODIFIEDTIME", DbType.String, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
db.AddInParameter(cmdUpdate, "@MODIFIEDUSER", DbType.String, userid);
db.AddInParameter(cmdUpdate, "@NUONUOAPPKEY", DbType.String, enumValue.NUONUOAPPKEY);
db.AddInParameter(cmdUpdate, "@NUONUOAPPSECRET", DbType.String, enumValue.NUONUOAPPSECRET);
db.AddInParameter(cmdUpdate, "@GID", DbType.String, enumValue.GID);
db.ExecuteNonQuery(cmdUpdate, tran);
}
@ -147,7 +154,7 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
tran.Rollback();
result.Success = false;
result.Message = "保存出现错误<"+e.Message+">,请重试或联系系统管理员";
result.Message = "保存出现错误<" + e.Message + ">,请重试或联系系统管理员";
return result;
}
@ -159,7 +166,7 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
return result;
}

@ -30,7 +30,7 @@ namespace DSWeb.MvcShipping.Models.SysInvInterFaceSet
}
#region Public Properties
//region public
[ModelDB(MDBType = ModelDBOprationType.All, IsPrimary = true)]
public string GID
@ -52,7 +52,7 @@ namespace DSWeb.MvcShipping.Models.SysInvInterFaceSet
set { _INVOICELINE = value; }
}
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public string COMPANYID
{
@ -77,12 +77,12 @@ namespace DSWeb.MvcShipping.Models.SysInvInterFaceSet
set { _CREATETIME = value; }
}
//#endregion
[ModelDB]
public string NUONUOAPPKEY { get; set; }
[ModelDB]
public string NUONUOAPPSECRET { get; set; }
#endregion
}

@ -78,18 +78,34 @@ Ext.extend(Shipping.MsSysInvInterFaceSetIndex, Ext.Panel, {
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'INVOICELINE',
header: '发票种类',
width: 160,
editor: this.comboxINVOICELINE
}, {
sortable: true,
dataIndex: 'INVITERFACE',
header: '接口类型',
width: 160,
editor: this.comboxINVITERFACE
}, {
sortable: true,
dataIndex: 'INVOICELINE',
header: '发票种类',
width: 160,
editor: this.comboxINVOICELINE
}, {
sortable: true,
dataIndex: 'INVITERFACE',
header: '接口类型',
width: 160,
editor: this.comboxINVITERFACE
}, {
sortable: true,
dataIndex: 'NUONUOAPPKEY',
header: 'AppKey',
width: 90,
editor: {
xtype: 'textfield'
}
}, {
sortable: true,
dataIndex: 'NUONUOAPPSECRET',
header: 'AppSecret',
width: 160,
editor: {
xtype: 'textfield'
}
}, {
sortable: true,
dataIndex: 'CREATEUSERREF',
header: '录入人',
@ -248,7 +264,8 @@ Ext.extend(Shipping.MsSysInvInterFaceSetIndex, Ext.Panel, {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: '请重试',
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});

@ -8,6 +8,8 @@
{ name: 'CREATEUSER', type: 'string' },
{ name: 'CREATEUSERREF', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'COMPANYID', type: 'string' }
]
{ name: 'COMPANYID', type: 'string' },
{ name: 'NUONUOAPPKEY', type: 'string' },
{ name: 'NUONUOAPPSECRET', type: 'string' }
]
});

@ -29,7 +29,8 @@ namespace HcUtility.Comm
}
public object Data { get; set; }
public DBResult() {
public DBResult()
{
success = false;
message = "";
Data = null;
@ -47,22 +48,36 @@ namespace HcUtility.Comm
message = _message;
}
public void setMessage(bool _success, string _message) {
public DBResult setMessage(bool _success, string _message, object data = null)
{
success = _success;
message += _message+ ";";
message += _message + ";";
if (data != null) this.Data = data;
return this;
}
public void OK()
public DBResult OK()
{
OK("");
return this;
}
public void OK( string _message)
public void OK(string _message)
{
success = true;
message += _message + ";";
if (!string.IsNullOrWhiteSpace(message) && !string.IsNullOrWhiteSpace(_message))
{
message += ";";
}
message += _message;
}
public void OK(string _message, object data = null)
{
OK(_message);
Data = data;
}
public void SetErrorInfo(string message, bool success = false, object data = null)
public DBResult SetErrorInfo(string message, bool success = false, object data = null)
{
if (Success != success) Message = "";
Success = success;
@ -77,12 +92,13 @@ namespace HcUtility.Comm
Message += message;
Data = data;
}
return this;
}
}
public class DBDataSetResult : DBResult
{
public DataSet DataSet {get;set;}
public DataSet DataSet { get; set; }
}
public class DBModelObjectResult : DBResult

Loading…
Cancel
Save