增加一个可通用的客户欠费查询小窗口;诺诺冲红对蓝票的重复点击冲红增加处理细节

DS7_JinGang
ddlucky 1 year ago
parent a02a7db2ef
commit 347b395d78

@ -1940,106 +1940,131 @@ namespace DSWeb.Areas.Account.Controllers
}
else if (head.INVITERFACE == "诺诺全电发票")
{
var hx = .getHelper(head.TAXCODE, head.COMPANYID);
//20230529
//1 如果ch_fee_invoice.billuuid有值的话
//这个值是最近一次提交的红字确认单订单编码
//用这个值读取红字确认单状态 如成功则做红票相应的处理
//如状态15申请中 则不做操作返回申请中
//如非成功和15 则返回错误 并清空billuuid
//2 如果ch_fee_invoice.billuuid无值 则重新产生值并发出红字确认单
//此时head.billUuid如果不为空 代表已有红字申请单
if (!string.IsNullOrWhiteSpace(head.billUuid))//&&
var hx = .getHelper(head.TAXCODE);
//20230608 如果ptorred=2
//代表这个head就是红票
if (head.PTORRED == "2")
{
redhead.BILLNO = redhead.billUuid;
redhead = AutoMapperHelper.MapTo<ChInvoice_HangXin, ChInvoice_HangXin>(head);
//redhead.REDNUM = head.INVOICENO;
result = hx.ReadInvoice(redhead);
var _r = hx.ReadRedConfirm(ref redhead, detailList);
if (!_r.Success)
if (!result.Success)
{
return BasicDataRefDAL.GetContentResult(_r);
return BasicDataRefDAL.GetContentResult(result);
}
else
{
ChinvoiceDAL.SetRed(redhead);
BlueInvoice = ChinvoiceDAL.GetData(" cm.INVOICECODE='" + head.REDCODE + "' and cm.INVOICENO='" + head.REDNUM + "'");
result = SetInvoiceFee(BlueInvoice);
return BasicDataRefDAL.GetContentResult(result);
}
}
else
{
//var hx = 诺诺全电发票.getHelper(head.TAXCODE);
if (!hx.CanUse)
{
result.SetErrorInfo(hx.ERRORMSG);
//20230529
//1 如果ch_fee_invoice.billuuid有值的话
//这个值是最近一次提交的红字确认单订单编码
//用这个值读取红字确认单状态 如成功则做红票相应的处理
//如状态15申请中 则不做操作返回申请中
//如非成功和15 则返回错误 并清空billuuid
//2 如果ch_fee_invoice.billuuid无值 则重新产生值并发出红字确认单
return BasicDataRefDAL.GetContentResult(result);
}
//if (hx.accessToken == "")
//{
// BasicDataRefDAL.SaveLog("NNReadInv;税号" + head.TAXCODE + "的 accessToken为空", "", "诺诺平台", "返回认证窗口");
// var _r = TokenPage();
// return _r;
//}
result = hx.ReadInvoice(redhead);
if (!result.Success)
{
return BasicDataRefDAL.GetContentResult(result);
}
//此时head.billUuid如果不为空 代表已有红字申请单
if (!string.IsNullOrWhiteSpace(head.billUuid))//&&
{
redhead.BILLNO = redhead.billUuid;
//if (result.Message == "需要重新认证")
//{
// //HangXinRequestHelper.clear(hx.accessToken);
// BasicDataRefDAL.SaveLog("ReadInvoice 反回‘需要重新认证’", "", "诺诺平台", "返回认证窗口");
// var _r = TokenPage();
// return _r;
//}
returndate = ChinvoiceDAL.GetData(" BILLNO='" + head.BILLNO + "'");
var _r = hx.ReadRedConfirm(ref redhead, detailList);
if (redhead.PTORRED == "2")
if (!_r.Success)
{
ChinvoiceDAL.SetRed(redhead);
//将原票内的申请和费用恢复原状
//var BlueInvoice = ChinvoiceDAL.GetData(" cm.INVOICECODE='" + head.REDCODE + "' and cm.INVOICENO='" + head.REDNUM + "'");
//result = SetInvoiceFee(BlueInvoice);
return BasicDataRefDAL.GetContentResult(_r);
}
//如果状态为开出成功 则执行锁定
if (returndate.EINVOICESTATE == "2" && returndate.BILLSTATUS == 0)
else
{
//ChinvoiceDAL.Lock(returndate.BILLNO);
//20200106 添加 如sys_param_set.PARAMNAME=INVOICEAUTOLOCK 没有值或值为false 则不执行锁定
var needautolock = MsSysParamSetDAL.GetSysParam("INVOICEAUTOLOCK").isnullortrue();
if (needautolock)
//var hx = 诺诺全电发票.getHelper(head.TAXCODE);
if (!hx.CanUse)
{
ChinvoiceDAL.Lock(returndate.BILLNO);
result.SetErrorInfo(hx.ERRORMSG);
return BasicDataRefDAL.GetContentResult(result);
}
//if (hx.accessToken == "")
//{
// BasicDataRefDAL.SaveLog("NNReadInv;税号" + head.TAXCODE + "的 accessToken为空", "", "诺诺平台", "返回认证窗口");
// var _r = TokenPage();
// return _r;
//}
result = hx.ReadInvoice(redhead);
if (!result.Success)
{
return BasicDataRefDAL.GetContentResult(result);
}
//if (result.Message == "需要重新认证")
//{
// //HangXinRequestHelper.clear(hx.accessToken);
// BasicDataRefDAL.SaveLog("ReadInvoice 反回‘需要重新认证’", "", "诺诺平台", "返回认证窗口");
// var _r = TokenPage();
// return _r;
//}
returndate = ChinvoiceDAL.GetData(" BILLNO='" + head.BILLNO + "'");
}
if (redhead.PTORRED == "2")
{
ChinvoiceDAL.SetRed(redhead);
result.Data = returndate;
//将原票内的申请和费用恢复原状
BlueInvoice = ChinvoiceDAL.GetData(" cm.INVOICECODE='" + head.REDCODE + "' and cm.INVOICENO='" + head.REDNUM + "'");
result = SetInvoiceFee(BlueInvoice);
}
return BasicDataRefDAL.GetContentResult(result);
}
//如果状态为开出成功 则执行锁定
if (returndate.EINVOICESTATE == "2" && returndate.BILLSTATUS == 0)
{
//ChinvoiceDAL.Lock(returndate.BILLNO);
}
else
{
//head.billUuid如果不为空 代表还没发红字申请单
//获取红票信息并发出
redhead.BILLNO = PubSysDAL.GetBillNo("0308");
//20200106 添加 如sys_param_set.PARAMNAME=INVOICEAUTOLOCK 没有值或值为false 则不执行锁定
var needautolock = MsSysParamSetDAL.GetSysParam("INVOICEAUTOLOCK").isnullortrue();
if (needautolock)
{
ChinvoiceDAL.Lock(returndate.BILLNO);
}
returndate = ChinvoiceDAL.GetData(" BILLNO='" + head.BILLNO + "'");
}
head.billUuid = redhead.BILLNO;
result.Data = returndate;
result = hx.PostRedConfirm(redhead, ref head, detailList);
if (result.Success == false)
return BasicDataRefDAL.GetContentResult(result);
}
}
else
{
//head.billUuid如果不为空 代表还没发红字申请单
//获取红票信息并发出
redhead.BILLNO = PubSysDAL.GetBillNo("0308");
head.billUuid = redhead.BILLNO;
result = hx.PostRedConfirm(redhead, ref head, detailList);
if (result.Success == false)
{
}
}
}
//诺诺全电票根据红字申请单的结果读取确认单
@ -2056,6 +2081,7 @@ namespace DSWeb.Areas.Account.Controllers
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
/// <summary>
/// 诺诺全电发票 读取红字申请单
/// </summary>

@ -19,6 +19,7 @@ using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using static iTextSharp.text.pdf.codec.TiffWriter;
@ -2218,5 +2219,16 @@ namespace DSWeb.Areas.CommMng.Controllers
}
#endregion
#region 查看指定客户的当前欠费
public ContentResult CustomerNODR(string condition)
{
var _r = BasicDataRefDAL.CustomerNODR(condition, Session);
return BasicDataRefDAL.GetDataListContentResult(_r);
}
#endregion
}
}

@ -56,6 +56,7 @@ using DSWeb.MvcShipping.DAL.DsSendmail;
using DSWeb.MvcShipping.Models.MsOpMailLog;
using MimeKit.Text;
using CommonTool.MailKit;
using System.Web.UI.WebControls;
namespace DSWeb.Areas.CommMng.DAL
{
@ -6378,6 +6379,14 @@ namespace DSWeb.Areas.CommMng.DAL
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public static ContentResult GetDataListContentResult(DBResult dbresult)
{
var json = JsonConvert.Serialize(new { Success = dbresult.Success, Message = dbresult.Message });
if (dbresult.Data != null) json = JsonConvert.Serialize(new { Success = true, Message = dbresult.Message, data = dbresult.Data });
return new ContentResult() { Content = json };
}
@ -6842,6 +6851,26 @@ namespace DSWeb.Areas.CommMng.DAL
}
}
public static DBResult CustomerNODR(string CUSTOMERNAME, HttpSessionStateBase Session) {
var result = new DBResult();
var canlogin = BasicDataRefDAL.CheckLogin(Session);
if (!canlogin.Success)
{
return canlogin;
}
var cdc = new CommonDataContext();
var custnodr = cdc.V_CUSTOMER_NODR.Where(x => x.CUSTOMERNAME == CUSTOMERNAME).ToList();
if (custnodr == null || custnodr.Count == 0)
{
result.SetErrorInfo("没有找到该客户");
}
else {
result.OK("", custnodr);
}
return result;
}
}
public class BarCodeDrawing

@ -109,7 +109,7 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet
var cmdInsert =
db.GetSqlStringCommand(
@"insert into sys_inv_interfaceset (GID,INVOICELINE,INVITERFACE,COMPANYID,CREATEUSER,CREATETIME,CORPID)
@"insert into sys_inv_interfaceset (GID,INVOICELINE,INVITERFACE,COMPANYID,CREATEUSER,CREATETIME,NUONUOAPPKEY,NUONUOAPPSECRET,CORPID)
values (@GID,@INVOICELINE,@INVITERFACE,@COMPANYID,@CREATEUSER,@CREATETIME,@NUONUOAPPKEY,@NUONUOAPPSECRET,@CORPID) ");
var cmdUpdate =

@ -456,6 +456,13 @@ Ext.extend(Shipping.BillCheckOutEdit, Ext.Panel, {
this.OpenSign();
},
scope: this
}, '-', {
text: "查看客户欠费",
//iconCls: "btnreturn",
handler: function (button, event) {
this.ShowCUSOMERNODR();
},
scope: this
}
//, '-', {
@ -3669,6 +3676,62 @@ Ext.extend(Shipping.BillCheckOutEdit, Ext.Panel, {
});
}
, ShowCUSOMERNODR: function () {
var customername = this.formHead.getForm().findField('CUSTOMERNAME').getValue();
title = "客户欠费[" + customername +"]";
model = Ext.define('V_CUSTOMER_NODR_md', {
extend: 'Ext.data.Model',
idProperty: 'CUSTOMERNAME',
fields: [
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'RMBNODR', type: 'string' },
{ name: 'USDNODR', type: 'string' },
{ name: 'OTNODR', type: 'string' },
{ name: 'TTLNODR', type: 'string' },
{ name: 'ZLRMBNODR', type: 'string' },
{ name: 'ZLUSDNODR', type: 'string' },
{ name: 'ZLOTNODR', type: 'string' },
{ name: 'ZLTTLNODR', type: 'string' }
]
});
proxyUrl = '/CommMng/BasicDataRef/CustomerNODR';
condition = customername;
columns = [
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '客户名称',
width: 120
}, {
dataIndex: 'RMBNODR',
header: 'RMB欠费',
width: 90
}, {
dataIndex: 'USDNODR',
header: 'USD欠费',
width: 90
}, {
dataIndex: 'OTNODR',
header: '其它欠费',
width: 90
}, {
dataIndex: 'TTLNODR',
header: '总欠费(合RMB)',
width: 90
}
];
ShowPublicINFO(title, model, proxyUrl, condition, columns);
}
});

@ -1308,6 +1308,114 @@ function patch(str, split) {
}
//#endregion
///显示一个小列表
ShowPublicINFO = function (title, model, proxyUrl, condition, columns, width = 550, height = 200) {
///显示一个小列表
/*
, ShowPublicINFO : function (BSNO) {
title = "分单签发状态";
model= Ext.define('FEN_BLISSUESTATUSmd', {
extend: 'Ext.data.Model',
idProperty: 'HBLNO',
fields: [
{ name: 'HBLNO', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'CNTRTOTAL', type: 'string' },
{ name: 'BLISSUESTATUS', type: 'string' }
]
});
proxyUrl = "MsOpSeae/GetBillList";
condition = "BSNO='" + BSNO + "'"
columns = [{
sortable: true,
dataIndex: 'HBLNO',
header: '分单号',
width: 120
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '货主',
width: 120
}, {
dataIndex: 'CNTRTOTAL',
header: '箱型箱量',
width: 140
}, {
dataIndex: 'BLISSUESTATUS',
header: '签发状态',
width: 140
}
];
ShowPublicINFO(title, model, proxyUrl, condition, columns);
}
*/
storeInfo = Ext.create('DsExt.ux.RefTableStore', {
model: model,
proxy: { url: proxyUrl }
});
gridInfoList = new Ext.grid.GridPanel({
store: storeInfo,
height: height,
width: width - 10,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
singleSelect: true,
selType: 'cellmodel',
columns: columns
});
me = this;
winInfoShow = Ext.create('Ext.window.Window', {
title: title,
width: width,
//height : 120,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [gridInfoList],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
me.winInfoShow.close();
}
}]
});
storeInfo.load({
params: { condition: condition },
callback: function (r, options, success) {
if (success) {
me.winInfoShow.show();
}
}
});
}
//(function (s) {
// //参数

@ -169,7 +169,7 @@ Ext.extend(Shipping.MsSysInvInterFaceSetIndex, Ext.Panel, {
sortable: true,
dataIndex: 'CORPID',
header: '所属公司',
width: 85,
width: 140,
renderer: function (value, p, record) {
if (value == null || value == '') return '';
else return record.data.COMPANYNAME;

Loading…
Cancel
Save