hanxuntao 2 weeks ago
parent ead2ab86ef
commit be8d530782

@ -8466,7 +8466,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
public ContentResult SaveToSeaiList(string body, string comp, string op, string custservice)
public ContentResult SaveToSeaiList(string body, string comp, string op, string custservice, string oplb = "SEAI")
{
var bodyList = JsonConvert.Deserialize<List<MsOpSeae>>(body);
@ -8493,6 +8493,7 @@ namespace DSWeb.MvcShipping.Controllers
headData.INPUTTIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
headData.INPUTBY = CookieConfig.GetCookie_UserId(Request);
headData.DbOperationType = DbOperationType.DbotIns;
headData.OPTYPE = oplb;
var modb = new ModelObjectDB();
result = modb.Save(headData);
if (result.Success) {
@ -8879,7 +8880,7 @@ namespace DSWeb.MvcShipping.Controllers
}
public ContentResult SeaeSaveSeaiCtn(string data, string bsno)
public ContentResult SeaeSaveSeaiCtn(string data, string bsno,string optype)
{
var ToDataList = JsonConvert.Deserialize<List<MsOpSeaeDetail>>(data);
@ -8889,6 +8890,28 @@ namespace DSWeb.MvcShipping.Controllers
if (ToDataList != null)
{
if (optype == "SEAE")
{
var head = MsOpSeaiDAL.GetData("BSNO='" + ToDataList[0].BSNO + "'");
var headData = MsOpSeaeDAL.GetData("BSNO='" + bsno + "'");
headData.BSDATE = DateTime.Now;
headData.DbOperationType = DbOperationType.DbotUpd;
headData.SHIPPER = head.CONSIGNEE;
headData.CONSIGNEE = head.SHIPPER;
headData.NOTIFYPARTY = head.NOTIFYPARTY;
headData.CUSTOMERNAME = head.CUSTOMERNAME;
headData.REMARK = headData.REMARK + Environment.NewLine + head.MBLNO + " " + head.ETA;
headData.PORTLOAD = head.PORTDISCHARGE;
headData.PORTLOADID = head.PORTDISCHARGEID;
headData.PORTDISCHARGE = head.PORTLOAD;
headData.PORTDISCHARGEID = head.PORTLOADID;
var modb = new ModelObjectDB();
result = modb.Save(headData);
}
else
{
var head = MsOpSeaeDAL.GetData("BSNO='" + ToDataList[0].BSNO + "'");
var headData = MsOpSeaiDAL.GetData("BSNO='" + bsno + "'");
@ -8899,13 +8922,17 @@ namespace DSWeb.MvcShipping.Controllers
headData.CONSIGNEE = head.SHIPPER;
headData.NOTIFYPARTY = head.NOTIFYPARTY;
headData.CUSTOMERNAME = head.CUSTOMERNAME;
headData.REMARK = headData.REMARK+" "+ head.MBLNO +" "+ head.ETA;
headData.REMARK = headData.REMARK + Environment.NewLine + head.MBLNO + " " + head.ETA;
headData.PORTLOAD = head.PORTDISCHARGE;
headData.PORTLOADID = head.PORTDISCHARGEID;
headData.PORTDISCHARGE = head.PORTLOAD;
headData.PORTDISCHARGEID = head.PORTLOADID;
var modb = new ModelObjectDB();
result = modb.Save(headData);
}
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
foreach (var enumValue in ToDataList)
{

@ -2222,12 +2222,12 @@ namespace DSWeb.MvcShipping.Controllers
#endregion
#region 集团委托引入
public ContentResult GetImpDataList(int start, int limit, string sort, string condition)
public ContentResult GetImpDataList(int start, int limit, string sort, string condition,string optype="SEAI")
{
//var dataList = MsOpSeaiDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
//var list = dataList.Skip(start).Take(limit);
var dataList = MsOpSeaiDAL.GetImpDataList(start, limit, condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
int count = MsOpSeaiDAL.getImpTotalCount(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var dataList = MsOpSeaiDAL.GetImpDataList(start, limit, condition, optype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
int count = MsOpSeaiDAL.getImpTotalCount(condition, optype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}

@ -16,6 +16,8 @@ using HcUtility.Core;
using System.IO;
using CommonTool.MailKit;
using DSWeb.SoftMng.Filter;
using DSWeb.MvcShipping.DAL.MsOpSeaePreDAL;
using DSWeb.MvcShipping.Models.MsOpSeaePre;
namespace DSWeb.MvcShipping.Controllers
{
@ -167,6 +169,24 @@ namespace DSWeb.MvcShipping.Controllers
new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });//list.ToList()
return new ContentResult() { Content = json };
}
public ContentResult modifyStlDate(string data, string modifydata)
{
var bodyList = JsonConvert.Deserialize<List<OpTask>>(data);
var result = new DBResult();
if (bodyList != null)
{
result = MsOpTaskDAL.ModifyStlDate(bodyList, modifydata, Convert.ToString(Session["COMPANYID"]));
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult updatetaskbs(string bsno, string body)
{
var result = new DBResult();

@ -230,7 +230,7 @@ namespace DSWeb.MvcShipping.DAL.MsBaseInfoDAL
static public List<ModuTreeRefModel> GetUserModuleEnableList(string strCondition, string userid)
{
var strSql = new StringBuilder();
strSql.Append("SELECT GID,NAME,ENAME DESCRIPTION,MODULEURL,MODULEICON,SORT,STATE,PARENTID,SHOWROOTSTATE,TYPE,'' PARENTNAME FROM ");
strSql.Append("SELECT GID,NAME,DESCRIPTION,MODULEURL,MODULEICON,SORT,STATE,PARENTID,SHOWROOTSTATE,TYPE,'' PARENTNAME FROM ");
strSql.Append(" sys_module WHERE GID IN ");
strSql.Append(" (SELECT B.MODULEID FROM user_action as A INNER JOIN [action] as B ON A.ACTIONID = B.GID WHERE USERID ='" + userid + "' )");

@ -2776,7 +2776,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
{
if (addbodyList.Find(x => x.PROPER_SHIPPING_NAME == opctndetail.PROPER_SHIPPING_NAME) == null)
{
if (string.IsNullOrEmpty(str)) str = opctndetail.PROPER_SHIPPING_NAME;
if (string.IsNullOrEmpty(str)) str = Environment.NewLine + opctndetail.PROPER_SHIPPING_NAME;
else str = str + Environment.NewLine + opctndetail.PROPER_SHIPPING_NAME;
str = str + Environment.NewLine + "CLASS:" + opctndetail.DCLASS + "UN NO:" + opctndetail.DUNNO;
str = str + Environment.NewLine + "ISOTANK NO:" + opctndetail.CNTRNO ;

@ -5697,7 +5697,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaiDAL
#region 海运进口生成需引入业务
static public List<MsOpSeaeToSeai> GetImpDataList(int start, int limit, string strCondition, string userid, string usercode, string companyid, string sort = null)
static public List<MsOpSeaeToSeai> GetImpDataList(int start, int limit, string strCondition, string optype,string userid, string usercode, string companyid, string sort = null)
{
var strSql = new StringBuilder();
strSql.Append(@"SELECT * from (SELECT row_number() over (");
@ -5716,15 +5716,19 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaiDAL
strSql.Append(" T.GID,T.BSNO,T.SEAIOP,T.SEAIBSNO,T.SUBCOMPANYID,dbo.GetISIMP(T.BSNO,T.GID) ISIMP,T.IMPTIME,T.INPUTBY,T.INPUTTIME");
strSql.Append(",S.MBLNO,S.HBLNO,S.CUSTNO,S.CUSTOMERNAME,S.BLTYPE,");
strSql.Append("S.SHIPPER,S.CONSIGNEE,S.NOTIFYPARTY,S.VESSEL,S.VOYNO,S.ETD,S.CLOSINGDATE,S.ETA,S.ATD,");
strSql.Append("S.PlACERECEIPT,S.PORTLOADID,S.PORTLOAD,S.PORTDISCHARGEID,S.PORTDISCHARGE,S.PLACEDELIVERYID,S.PLACEDELIVERY,S.DESTINATIONID,S.DESTINATION,S.COPYNOBILL,");
strSql.Append("S.SHIPPER,S.CONSIGNEE,S.NOTIFYPARTY,S.VESSEL,S.VOYNO,S.ETD,S.CLOSINGDATE,S.ETA,");
strSql.Append("S.PlACERECEIPT,S.PORTLOADID,S.PORTLOAD,S.PORTDISCHARGEID,S.PORTDISCHARGE,S.PLACEDELIVERYID,S.PLACEDELIVERY,S.DESTINATIONID,S.DESTINATION,");
strSql.Append("S.NOBILL,S.ISSUETYPE,S.ISSUEDATE,S.ISSUEPLACE,S.BLFRT,S.PREPARDAT,S.PAYABLEAT,S.[SERVICE],S.MARKS,S.NOPKGS,S.[DESCRIPTION],S.GOODSNAME,");
strSql.Append("S.GROSSWEIGHT,S.MEASUREMENT,S.PKGS,S.KINDPKGS,S.KGS,S.CBM,");
strSql.Append("S.CARGOID,S.DCLASS,S.DUNNO,S.DPAGE,S.DLABEL,S.LINKMAN,");
strSql.Append("S.REEFERF,S.TEMPID,S.TEMPSET,S.TEMPMAX,S.TEMPMIN,S.HUMIDITY,S.HSCODE");
strSql.Append("S.REEFERF,S.TEMPID,S.TEMPSET,S.TEMPMAX,S.TEMPMIN");
strSql.Append(",(select ShowName from [user] where GID=T.INPUTBY) as INPUTBYREF,(SELECT TOP 1 CUSTNO FROM OP_SEAI WHERE BSNO=T.SEAIBSNO) SEAICUSTNO ");
strSql.Append(",(select ENNAME from [company] where GID=S.CORPID) as CORP,S.CORPID ");
strSql.Append(" from OP_SEAETOSEAI T LEFT JOIN OP_SEAE S ON (S.BSNO=T.BSNO) ");
if (optype == "SEAE") {
strSql.Append(" ,NULL ATD,'' HUMIDITY,'' HSCODE,'' COPYNOBILL from OP_SEAETOSEAI T LEFT JOIN OP_SEAI S ON (S.BSNO=T.BSNO) ");
}
else
strSql.Append(",S.ATD ,S.HUMIDITY,S.HSCODE,S.COPYNOBILL from OP_SEAETOSEAI T LEFT JOIN OP_SEAE S ON (S.BSNO=T.BSNO) ");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" WHERE " + strCondition + " ");
@ -5736,12 +5740,17 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaiDAL
return SetImpData(strSql);
}
public static int getImpTotalCount(string strCondition, string userid, string usercode, string companyid)
public static int getImpTotalCount(string strCondition, string optype, string userid, string usercode, string companyid)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select count(*) ");
strSql.Append(" from OP_SEAETOSEAI ");
if (optype == "SEAE")
{
strSql.Append(" T LEFT JOIN OP_SEAI S ON (S.BSNO=T.BSNO) ");
}
else
strSql.Append(" T LEFT JOIN OP_SEAE S ON (S.BSNO=T.BSNO) ");
if (!string.IsNullOrEmpty(strCondition))

@ -11,6 +11,7 @@ using DSWeb.MvcShipping.Models.MsUserAuthority;
using DSWeb.MvcShipping.DAL.MsChFeeDAL;
using DSWeb.Areas.CommMng.Models;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.MvcShipping.Models.MsOpSeaePre;
namespace DSWeb.Areas.MvcShipping.DAL
{
@ -48,7 +49,7 @@ namespace DSWeb.Areas.MvcShipping.DAL
}
strSql.Append(@") as num , ");
strSql.Append("t.GID,t.TASKNO,t.PTASKNO,t.TASKTYPE,t.TASKSOURCE,t.TASKSTATUS,t.TASKTITLE,t.TASKDESCRIP,t.CREATEUSER,t.CORPID,t.CREATETIME,t.TASKBEGINDATE");
strSql.Append(",t.COMPLETETYPE,t.COMPLETETIME,t.KPI,ISNULL(b.MBLNO,t.MBLNO) MBLNO,t.FILENO,t.MAILNO,t.FILEPATH,t.ISPUBLIC,t.OP,t.BSNO,t.ISCOMPLETE,t.REMARK,b.CUSTOMERNAME,b.ETD,b.CARRIER,b.CUSTNO ");
strSql.Append(",t.COMPLETETYPE,t.COMPLETETIME,t.KPI,ISNULL(b.MBLNO,t.MBLNO) MBLNO,t.FILENO,t.MAILNO,t.FILEPATH,t.ISPUBLIC,t.OP,t.BSNO,t.ISCOMPLETE,t.REMARK,b.CUSTOMERNAME,b.ETD,b.CARRIER,b.CUSTNO,b.STLDATE,b.OPLB ");
strSql.Append(" from op_task t left join v_op_bs b on (b.BSNO=t.BSNO) ");
if (!string.IsNullOrEmpty(strCondition))
@ -104,7 +105,7 @@ namespace DSWeb.Areas.MvcShipping.DAL
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append("t.GID,t.TASKNO,t.PTASKNO,t.TASKTYPE,t.TASKSOURCE,t.TASKSTATUS,t.TASKTITLE,t.TASKDESCRIP,t.CREATEUSER,t.CORPID,t.CREATETIME,t.TASKBEGINDATE");
strSql.Append(",t.COMPLETETYPE,t.COMPLETETIME,t.KPI,ISNULL(b.MBLNO,t.MBLNO) MBLNO,t.FILENO,t.MAILNO,t.FILEPATH,t.ISPUBLIC,t.OP,t.BSNO,t.ISCOMPLETE,t.REMARK,b.CUSTOMERNAME,b.ETD,b.CARRIER,b.CUSTNO ");
strSql.Append(",t.COMPLETETYPE,t.COMPLETETIME,t.KPI,ISNULL(b.MBLNO,t.MBLNO) MBLNO,t.FILENO,t.MAILNO,t.FILEPATH,t.ISPUBLIC,t.OP,t.BSNO,t.ISCOMPLETE,t.REMARK,b.CUSTOMERNAME,b.ETD,b.CARRIER,b.CUSTNO,b.STLDATE,b.OPLB ");
strSql.Append(" from op_task t left join v_op_bs b on (b.BSNO=t.BSNO) ");
if (!string.IsNullOrEmpty(condition))
{
@ -160,6 +161,9 @@ namespace DSWeb.Areas.MvcShipping.DAL
data.CUSTOMERNAME = Convert.ToString(reader["CUSTOMERNAME"]);
data.CARRIER= Convert.ToString(reader["CARRIER"]);
data.CUSTNO = Convert.ToString(reader["CUSTNO"]);
if (reader["STLDATE"] != DBNull.Value)
data.STLDATE = Convert.ToDateTime(reader["STLDATE"]).ToString("yyyy-MM-dd");//到港日期
data.OPLB = Convert.ToString(reader["OPLB"]);
#endregion
headList.Add(data);
@ -793,7 +797,65 @@ namespace DSWeb.Areas.MvcShipping.DAL
}
public static DBResult ModifyStlDate(List<OpTask> bodyList,string stldate, string companyid)
{
var result = new DBResult();
string errstr = "";
int i = 0;
Database db = DatabaseFactory.CreateDatabase();
using (var conn = db.CreateConnection())
{
conn.Open();
var tran = conn.BeginTransaction();
try
{
if (bodyList != null)
{
foreach (var enumValue in bodyList)
{
var strSql = new StringBuilder();
strSql.Append("update "+ enumValue.OPLB+ " set bsno=bsno ");
if (!string.IsNullOrEmpty(stldate))
strSql.Append(",STLDATE=@STLDATE");
strSql.Append(" where BSNO=@BSNO ");
var cmdupdate =
db.GetSqlStringCommand(strSql.ToString());
cmdupdate.Parameters.Clear();
if (!string.IsNullOrEmpty(stldate))
db.AddInParameter(cmdupdate, "@STLDATE", DbType.String, stldate);
db.AddInParameter(cmdupdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdupdate, tran);
i = i + 1;
}
}
tran.Commit();
}
catch (Exception)
{
tran.Rollback();
result.Success = false;
result.Message = "修改出现错误,请重试或联系系统管理员";
return result;
}
}
result.Success = true;
result.Message = "修改成功" + i.ToString() + "票";
if (errstr != "")
{
result.Message = result.Message + "(其中" + errstr + " 无法修改)";
}
return result;
}
static public List<OpTaskFieldValue> GetTaskFieldValueDataList(string strCondition)
{

@ -222,6 +222,10 @@ namespace DSWeb.MvcShipping.Models.MsOpTask
public string CUSTOMERNAME { get; set; }
public string CUSTNO { get; set; }
public string STLDATE { get; set; }
public string OPLB { get; set; }
#endregion
}

@ -49,6 +49,7 @@
<script type="text/javascript" src="../../../../Areas/Import/Viewsjs/Comm/SaveGridPanel.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOpSeai/MsOpSeaiModel.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsCodeOpService/MsCodeOpServiceModel.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsCompanys/MsCompanysModel.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOpSeae/CommonBuild.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOpSeai/MsOpSeaiIndex.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOpSeai/Index.js"></script>

@ -1115,8 +1115,12 @@ Ext.extend(Shipping.MsOpApplyEdit, Ext.Panel, {
header: '报关件数',
editor: {
xtype: 'numberfield',
allowBlank: false,
selectOnFocus: true
keyNavEnabled: false,
selectOnFocus: true,
decimalPrecision: 4,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true
},
width: 120
}, {

@ -2099,6 +2099,14 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
handler: function (button, event) {
_this.onImportCtnFromOpCtn();
}
}, '-', {
text: Zi.LAN.btnSeaiCtnCopy,
handler: function (button, event) {
DsOpenEditWin('/MvcShipping/MsOpSeai/Seae2SeaiCtnIndex?OPTYPE=SEAE', "进口引入", "600", "940", "10", "10");
},
scope: this
}],
scope: this
}, '-', {
@ -2211,6 +2219,55 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
displayField: 'NAME'
});
this.storeListGood = Ext.create('Ext.data.Store', {
model: 'MsCodeMSDS',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsCodeMSDS/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeListGood.load({ params: { start: 0, limit: 20000, condition: "" } });
this.comboxGoods = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeListGood,
fieldLabel: Zi.LAN.DUNNO, //'危险品编号',
flex: 1,
labelWidth: 70,
name: 'DUNNO',
valueField: 'UNNO',
displayField: 'UNNO',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
this.formEdit.getForm().findField('DCLASS').setValue(records[0].data.DCLASS);
this.formEdit.getForm().findField('TEMPSET2').setValue(records[0].data.DFLASH);
this.formEdit.getForm().findField('TEMPMAX2').setValue(records[0].data.PACKINGGROUP);
this.formEdit.getForm().findField('REEFERF2').setValue(records[0].data.GOODNAME);
var ISPOLLUTEOCEAN = records[0].data.ISPOLLUTEOCEAN;
if (ISPOLLUTEOCEAN)
this.formEdit.getForm().findField('TEMPMIN2').setValue('P');
else this.formEdit.getForm().findField('TEMPMIN2').setValue('');
}
}
}
});
this.panelBodyDr = new Ext.Panel({
title: Zi.LAN.panelBodyDr, //'危险品信息',
layout: "anchor",
@ -2236,12 +2293,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
flex: 1,
labelWidth: 70,
name: 'DCLASS'
}, {
fieldLabel: Zi.LAN.DUNNO, //'危险品编号',
flex: 1,
labelWidth: 70,
name: 'DUNNO'
}, {
}, this.comboxGoods, {
fieldLabel: Zi.LAN.DPAGE, //'危险品页号',
flex: 1,
labelWidth: 70,
@ -3263,6 +3315,35 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
displayField: 'NAME'
});
this.comboxGoods2 = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeListGood,
fieldLabel: Zi.LAN.DUNNO, //'危险品编号',
flex: 1,
labelWidth: 70,
name: 'DUNNO',
valueField: 'UNNO',
displayField: 'UNNO',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
this.formCargoShow.getForm().findField('DCLASS').setValue(records[0].data.DCLASS);
this.formCargoShow.getForm().findField('TEMPSET2').setValue(records[0].data.DFLASH);
this.formCargoShow.getForm().findField('TEMPMAX2').setValue(records[0].data.PACKINGGROUP);
this.formCargoShow.getForm().findField('REEFERF2').setValue(records[0].data.GOODNAME);
var ISPOLLUTEOCEAN = records[0].data.ISPOLLUTEOCEAN;
if (ISPOLLUTEOCEAN)
this.formCargoShow.getForm().findField('TEMPMIN2').setValue('P');
else this.formCargoShow.getForm().findField('TEMPMIN2').setValue('');
}
}
}
});
this.panelBodyDr2 = new Ext.Panel({
title: Zi.LAN.panelBodyDr, //'危险品信息',
layout: "anchor",
@ -3283,12 +3364,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
flex: 1,
labelWidth: 70,
name: 'DCLASS'
}, {
fieldLabel: Zi.LAN.DUNNO, //'危险品编号',
flex: 1,
labelWidth: 70,
name: 'DUNNO'
}, {
}, this.comboxGoods2, {
fieldLabel: Zi.LAN.DPAGE, //'危险品页号',
flex: 1,
labelWidth: 70,
@ -3464,6 +3540,37 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
} else if (CARGOID == 'D') {
me.panelBodyDr.setVisible(true);
me.panelBodyRf.setVisible(false);
var goodstr = "";
var GOODNAME = me.formCargoShow.getForm().findField('REEFERF2').getValue();
if (GOODNAME != '') {
if (goodstr == '') goodstr = GOODNAME;
else goodstr = goodstr + "\n" + GOODNAME;
}
var DCLASS = me.formCargoShow.getForm().findField('DCLASS').getValue();
var DUNNO = me.formCargoShow.getForm().findField('DUNNO').getValue();
if (DCLASS != '') {
if (goodstr == '') goodstr = "CLASS:" + DCLASS + "UN NO:" + DUNNO;
else goodstr = goodstr + "\n" + "CLASS:" + DCLASS + "UN NO:" + DUNNO;
}
var TEMPMAX2 = me.formCargoShow.getForm().findField('TEMPMAX2').getValue();
if (TEMPMAX2 != '' && TEMPMAX2 != null) {
if (goodstr == '') goodstr = "PG:" + TEMPMAX2;
else goodstr = goodstr + "\n" + "PG:" + TEMPMAX2;
}
var TEMPSET2 = me.formCargoShow.getForm().findField('TEMPSET2').getValue();
var TEMPMIN2 = me.formCargoShow.getForm().findField('TEMPMIN2').getValue();
var hw = "N";
if (TEMPMIN2 == "P" || TEMPMIN2 == "PP") {
hw = "Y";
}
goodstr = goodstr + "\n" + "闪点:" + TEMPSET2 + "海污:" + hw;
var descriptionstr = _this.formEdit.getForm().findField('DESCRIPTION').getValue();
descriptionstr = descriptionstr + "\n" + "\n" + goodstr;
_this.formEdit.getForm().findField('DESCRIPTION').setValue(descriptionstr);
} else {
me.panelBodyDr.setVisible(false);
me.panelBodyRf.setVisible(false);

@ -8419,10 +8419,7 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
}
});
//this.storeUser = Ext.create('DsExt.ux.RefTableStore', {
// model: 'DsShipping.ux.UserRefModel',
// proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
//});
this.storeUser = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/MvcShipping/MsOpSeae/GetCompUserList' }
@ -14709,7 +14706,8 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
body: jsonbodyAddDatas,
comp: _this.subordercomp,
op: _this.suborderop,
custservice: _this.subordercustservice
custservice: _this.subordercustservice,
oplb: 'SEAI'
},
callback: function (options, success, response) {
if (success) {

@ -913,4 +913,5 @@ Zi.LAN.PKGTYPE = "包件种类";
Zi.LAN.FACTORY = "生产企业";
Zi.LAN.GXWTHM = "更新委托货描";
Zi.LAN.DGTRUCKER = "危险品车队";
Zi.LAN.KGSCBM = "重抛比";
Zi.LAN.btnSeaiCtnCopy = "进口引入";

@ -957,3 +957,4 @@ Zi.LAN.FACTORY = "生产企业";
Zi.LAN.GXWTHM = "更新委托货描";
Zi.LAN.DGTRUCKER = "危险品车队";
Zi.LAN.KGSCBM = "重抛比";
Zi.LAN.btnSeaiCtnCopy = "进口引入";

@ -21,6 +21,7 @@ Ext.extend(Shipping.OpSeaeToSeaiCtnIndex, Ext.Panel, {
initUIComponents: function () {
this.BsNo = "";
this.OPTYPE = getUrlParam('OPTYPE');
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
@ -590,7 +591,8 @@ Ext.extend(Shipping.OpSeaeToSeaiCtnIndex, Ext.Panel, {
//#region 事件绑定
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
var optype = this.OPTYPE;
Ext.apply(store.proxy.extraParams, { condition: sql, optype: optype });
}, this);
this.storeList.on('load', function (store, records) {
@ -622,6 +624,10 @@ Ext.extend(Shipping.OpSeaeToSeaiCtnIndex, Ext.Panel, {
onAutoRefresh: function () {
var sql = " EXISTS (select 1 from OP_SEAETOSEAI_CTN WHERE T.BSNO=OP_SEAETOSEAI_CTN.BSNO AND OP_SEAETOSEAI_CTN.ISIMP=0) and (SEAIOP='" + USERID + "' OR SEAIOP='" + SHOWNAME + "')";
if (this.OPTYPE != undefined) {
sql = sql + " AND OPTYPE='" + this.OPTYPE + "'";
}
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
@ -677,7 +683,8 @@ Ext.extend(Shipping.OpSeaeToSeaiCtnIndex, Ext.Panel, {
url: '/MvcShipping/MsOpSeae/SeaeSaveSeaiCtn',
params: {
data: jsonbodyAddDatas,
bsno: _this.BsNo
bsno: _this.BsNo,
optype: _this.OPTYPE
},
callback: function (options, success, response) {
if (success) {
@ -713,6 +720,10 @@ Ext.extend(Shipping.OpSeaeToSeaiCtnIndex, Ext.Panel, {
var sql = " EXISTS (select 1 from OP_SEAETOSEAI_CTN WHERE T.BSNO=OP_SEAETOSEAI_CTN.BSNO AND OP_SEAETOSEAI_CTN.ISIMP=0) and SEAIOP='" + USERID + "'";
if (this.OPTYPE != undefined) {
sql = sql + " AND OPTYPE='" + this.OPTYPE + "'";
}
//客户名称
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "S.CUSTOMERNAME='" + CUSTOMERNAME + "'");

@ -2958,7 +2958,7 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
text: Zi.LAN.btnSeaeCtnCopy,
handler: function (button, event) {
DsOpenEditWin('/MvcShipping/MsOpSeai/Seae2SeaiCtnIndex', "出口引入", "600", "940", "10", "10");
DsOpenEditWin('/MvcShipping/MsOpSeai/Seae2SeaiCtnIndex?OPTYPE=SEAI', "出口引入", "600", "940", "10", "10");
},
scope: this

@ -2117,6 +2117,13 @@ Ext.extend(Shipping.MsOpSeaiIndex, Ext.Panel, {
handler: function (menu, event) {
_this.winModifyShow.show();
}
}, {
text: Zi.LAN.SaveSEAE, //"生成海运进口业务",
handler: function (menu, event) {
_this.subordertype = "SEAE";
_this.formSubCompOrder.getForm().findField('FeeType').setVisible(false);
_this.winSubCompOrder.show();
}
}, {
text: Zi.LAN.FanDanTongZhi, //"放单通知",
handler: function (menu, event) {
@ -5395,7 +5402,8 @@ Ext.extend(Shipping.MsOpSeaiIndex, Ext.Panel, {
body: jsonbodyAddDatas,
comp: _this.subordercomp,
op: _this.suborderop,
custservice: _this.subordercustservice
custservice: _this.subordercustservice,
oplb:'SEAE'
},
callback: function (options, success, response) {
if (success) {

@ -485,6 +485,7 @@ Zi.LAN.XINYONG = "(信永)";
Zi.LAN.btnSeaeCtnCopy = "出口引入";
Zi.LAN.ImportFee = "引入费用";
Zi.LAN.HMJ = "(HMJ)";
Zi.LAN.SaveSEAE = "生成海运出口";
//#endregion
//Zi.LAN. = "";

@ -448,6 +448,7 @@ Zi.LAN.ShengChengFenBuWeiTuo = "生成分部委托";
Zi.LAN.QueRenShengCheng = "确认生成";
Zi.LAN.WeiTuoFenGongSiWeiBiTian = "委托分公司为必填!"
Zi.LAN.CaoZuoYuanWeiBiTian = "操作员为必填!"
Zi.LAN.SaveSEAE = "生成海运出口";
//#endregion
//Zi.LAN. = "";

@ -269,6 +269,12 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
align: 'center',
header: '开船日期',
width: 120
}, {
sortable: true,
dataIndex: 'STLDATE',
align: 'center',
header: '应结日期',
width: 120
}, {
sortable: true,
dataIndex: 'FILEPATH',
@ -549,15 +555,27 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
this.onUpTransStatusClick('PENDING');
},
scope: this
}, '-',
}, '-', {
text: "其他操作",
id: "btnOper",
menu: [
{
text: "转发邮件",
// iconCls: "btndelete",
handler: function (button, event) {
handler: function (menu, event) {
this.onUpTransStatusClick('转发邮件');
},
scope: this
}, {
text: "修改承诺付款时间",
handler: function (menu, event) {
this.onUpTransStatusClick('转发邮件');
},
scope: this
}],
scope: this
}, '-',
'-',
{
@ -625,6 +643,81 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
// this.onRefreshClick();
this.formModifyStlDate = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [ {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '承诺付款日期', //'ETD',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'STLDATE'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
}); //end this.formEdit
me = this;
this.winModifyStlDateShow = Ext.create('Ext.window.Window', {
title: "批量修改承诺付款日期", //"批量修改",
width: 30,
//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: [this.formModifyStlDate],
buttons: [{
text: "确认修改", //"确认修改",
minWidth: 70,
handler: function () {
_this.onModifyStlDateClick()
}
}, {
text: "关闭", //"关闭",
minWidth: 70,
handler: function () {
_this.winModifyStlDateShow.close();
}
}]
});
},
@ -704,6 +797,9 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
var bodydatas = [];
for (var i = 0; i < selections.length ; i += 1) {
var member = selections[i];
if (transstatus == "transstatus") {
if (member.data.MAILNO != '') bodydatas.push(member);
}else
bodydatas.push(member);
}
if (bodydatas.length == 0) {
@ -758,6 +854,71 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
},
onModifyStlDateClick: function (menu, event) {
var GidStr = '';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择任务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var STLDATE = this.formModifyStlDate.getForm().findField('STLDATE').getValue();
var bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
if (rec.data.TASKTYPE=="欠费待收款")
bodyAddDatas.push(rec);
}
_this = this;
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: '提示', msg: '没有要修改的任务', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: '正在修改业务...',
url: '/MvcShipping/MsOpTask/modifyStlDate',
params: {
data: jsonbodyAddDatas,
modifydata: STLDATE
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.storeList.reload();
_this.winModifyStlDateShow.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
},
Refresh: function () {
this.treestore.load({
params: {

@ -27,6 +27,8 @@
{ name: 'ETD', type: 'string' },
{ name: 'CARRIER', type: 'string' },
{ name: 'CUSTNO', type: 'string' },
{ name: 'STLDATE', type: 'string' },
{ name: 'OPLB', type: 'string' },
{ name: 'CREATEUSER', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'REMARK', type: 'string' }

@ -1709,12 +1709,12 @@ namespace DSWeb.Areas.TruckMng.DAL.MsRptPcHeadEdit
{
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" where (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) AND EXISTS ( select 1 from tMsWlPcHead WHERE t.GID=tMsWlPcHead.PGID AND " + strCondition + " )");
strSql.Append(" where (t.BLTYPE='派车主票' or t.BLTYPE='派车单票') AND EXISTS ( select 1 from tMsWlPcHead WHERE t.GID=tMsWlPcHead.PGID AND " + strCondition + " )");
}
else
{
//strSql.Append(" where 1=1 " );
strSql.Append(" where (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) ");
strSql.Append(" where (t.BLTYPE='派车主票' or t.BLTYPE='派车单票') ");
}

@ -385,6 +385,28 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
enableKeyEvents: true
});
this.storeFrDrvName = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsWlBsHeadRefMsWlDriver',
proxy: { url: '/TruckMng/MsWlPc/GetDrvNameListRm' }
});
this.storeFrDrvName.load({ params: { condition: "" } });
this.comboxFrDrvName = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFrDrvName,
queryMode: 'remote',
minChars: 1,
queryParam: 'DrvName',
name: 'FrDrvName',
valueField: 'DrvName',
displayField: 'DrvName'
,
listeners: {
beforequery: function (e) {
return FilterCombox(e, 1); //在beforequery使用此方法
},
scope: this
}
});
_thisPcIndex = this;
/////////////////////////////////////////
@ -991,7 +1013,8 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
sortable: true,
dataIndex: 'FrDrvName',
header: '外点司机',
width: 120
width: 120,
editor: this.comboxFrDrvName
},
{
sortable: true,
@ -1200,7 +1223,17 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
{
sortable: true,
dataIndex: 'Ton',
header: '分成',
header: '外点分成',
width: 110,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'AroundTon',
header: '空箱分成',
width: 110,
editor: {
xtype: 'textfield',
@ -2336,10 +2369,8 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
///以下集中绑定事件
this.storeList.on('beforeload', function (store) {
if (!this.checkSearchCondition())
return;
var sql = this.sqlcontext;
var ISMASTER = this.formSearch.getForm().findField('ONLYMASTER').getValue();
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql, ismaster: ISMASTER });
}, this);
@ -2587,7 +2618,7 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
LoadInitData: function () {
//this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} });
var sql = " t.BsType<>'装箱' and (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) AND ISNULL(ISCANCEL,'0')<>'1' and (datediff(month,ExpDate,getdate())=0 or ExpDate is null or ExpDate='1900-01-01 00:00:00.000' ) ";
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",

@ -852,7 +852,13 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
sortable: true,
dataIndex: 'ArriveDate',
header: '装箱时间',
width: 80
width: 80,
editor: {
xtype: 'datefield',
format: 'Y-m-d',
selectOnFocus: true
},
renderer: Ext.util.Format.dateRenderer('Y-m-d')
},
{
@ -1896,12 +1902,12 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
{
text: '确认完结', //"确认退舱",
handler: function (menu, event) {
_thisPcIndex.UpdateStatus('完结');
_thisZXindex.UpdateStatus('完结');
}
}, {
text: '取消完结', //"取消退舱",
handler: function (menu, event) {
_thisPcIndex.DeleteStatus('完结');
_thisZXindex.DeleteStatus('完结');
}
}]
}, {
@ -2224,10 +2230,8 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
///以下集中绑定事件
this.storeList.on('beforeload', function (store) {
if (!this.checkSearchCondition())
return;
var ISMASTER = this.formSearch.getForm().findField('ONLYMASTER').getValue();
var sql = this.getCondition();
var sql = this.sqlcontext;
Ext.apply(store.proxy.extraParams, { condition: sql, ismaster: ISMASTER });
}, this);
@ -2467,7 +2471,7 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
LoadInitData: function () {
//this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} });
var sql = " BsType='装箱' and (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) AND ISNULL(ISCANCEL,'0')<>'1' and (datediff(month,ExpDate,getdate())=0 or ExpDate is null or ExpDate='1900-01-01 00:00:00.000' ) ";
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
@ -3532,6 +3536,14 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
if (ReturnDate != '')
ReturnDate = Ext.util.Format.date(ReturnDate, 'Y-m-d');
member.data.ReturnDate = ReturnDate;
var ArriveDate = member.data.ArriveDate;
if (ArriveDate != '')
ArriveDate = Ext.util.Format.date(ArriveDate, 'Y-m-d');
member.data.ArriveDate = ArriveDate;
bodyList.push(member);
};
@ -3543,6 +3555,11 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
if (ReturnDate != '')
ReturnDate = Ext.util.Format.date(ReturnDate, 'Y-m-d');
member.data.ReturnDate = ReturnDate;
var ArriveDate = member.data.ArriveDate;
if (ArriveDate != '')
ArriveDate = Ext.util.Format.date(ArriveDate, 'Y-m-d');
member.data.ArriveDate = ArriveDate;
bodyList.push(member);
};
}

@ -1250,6 +1250,9 @@ Ext.extend(DsTruck.MsPcHYRDEdit, Ext.Panel, {
field.setValue('');
field = basicForm.findField('CUSTNO');
field.setValue('');
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m-d');
basicForm.findField('ExpDate').setValue(mydatestr);
_thisPc.panelFee.strBSNO = BSNO;
_thisPc.panelFee.storeDrChFee.removeAll();
@ -1539,6 +1542,9 @@ Ext.extend(DsTruck.MsPcHYRDEdit, Ext.Panel, {
// items: [this.panelFix, this.panelFee]
//});
this.panelFeeTtl = new Ext.Panel({
layout: "border",
region: "center",

@ -1823,6 +1823,9 @@ Ext.extend(DsTruck.MsPcHYRDEdit, Ext.Panel, {
field = basicForm.findField('CUSTNO');
field.setValue('');
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m-d');
basicForm.findField('ExpDate').setValue(mydatestr);
_thisPc.panelFee.strBSNO = BSNO;
_thisPc.panelFee.storeDrChFee.removeAll();

@ -68,6 +68,7 @@
<ItemGroup>
<Compile Include="DateTimeExtension.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="JobCreateTask.cs" />
<Compile Include="JobGetCrInvD6Data.cs" />
<Compile Include="JobD7CoscoFee.cs" />
<Compile Include="JobBankData.cs" />

@ -0,0 +1,271 @@
using log4net;
using Newtonsoft.Json;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
namespace JobCreateFee
{
public class JobCreateTask : IJob
{
private ILog log = LogManager.GetLogger(typeof(JobCreateTask));
public void Execute(IJobExecutionContext context)
{
log.Debug($"Execute开始");
try
{
string connStr = context.JobDetail.JobDataMap.GetString("ConnectString");
string Admin = context.JobDetail.JobDataMap.GetString("Admin");
using (SqlConnection dbcon = new SqlConnection(connStr))
{
log.Debug($"清空未开票任务");
var sql = "DELETE FROM op_task where TASKTYPE='未开票' and TASKSTATUS='未开始'";
SqlCommand cmd = new SqlCommand(sql, dbcon);
cmd.ExecuteNonQuery();
log.Debug($"生成未开票任务");
var strSql = new StringBuilder();
strSql.Append(" F.FEETYPE=1 AND F.INVOICE<>F.AMOUNT AND DATEDIFF([day],GETDATE(),ISNULL(B.STLDATE,B.ETD))<=10 ");
var NoInvList = GetNoInv(strSql.ToString(),dbcon);
if (NoInvList != null && NoInvList.Count != 0) {
foreach (var NoInv in NoInvList)
{
insertTask(NoInv.BSNO, NoInv.MBLNO,NoInv.SALEDEPT+"_"+NoInv.OPLBNAME+"_"+NoInv.CUSTOMERNAME + "_" + NoInv.CUSTOMERNAME + "_RMB应收:" + NoInv.RMBDR + "_USD应收:" + NoInv.USDDR, "未开票",NoInv.OP,dbcon);
}
}
log.Debug($"更新欠费待收款任务");
var sql2 = "UPDATE op_task SET ISCOMPLETE=1,TASKSTATUS='已完成',COMPLETETYPE='自动',COMPLETETIME=GETDATE() where TASKTYPE='欠费待收款' and TASKSTATUS='未开始' and EXISTS (select 1 from v_op_gain_sum where op_task.BSNO=v_op_gain_sum.BSNO AND STLTTLDR=TTLDR and TTLDR<>0) ";
SqlCommand cmd2 = new SqlCommand(sql2, dbcon);
cmd2.ExecuteNonQuery();
var strSql2 = new StringBuilder();
strSql2.Append(" F.FEETYPE=1 AND F.SETTLEMENT<>F.AMOUNT AND DATEDIFF([day],GETDATE(),ISNULL(B.STLDATE,B.ETD))<=7 AND NOT EXISTS (SELECT 1 FROM op_task WHERE op_task.BSNO=B.BSNO AND TASKTYPE='欠费待收款' )");
var NoStlList = GetNoInv(strSql2.ToString(), dbcon);
if (NoStlList != null && NoStlList.Count != 0)
{
foreach (var NoInv in NoStlList)
{
insertTask(NoInv.BSNO, NoInv.MBLNO, NoInv.SALEDEPT + "_" + NoInv.OPLBNAME + "_RMB未收:" + NoInv.RMBDR + "_USD未收:" + NoInv.USDDR + "_RMB开票:" + NoInv.INVRMBDR + "_USD开票:" + NoInv.INVUSDDR, "欠费待收款", NoInv.OP, dbcon);
}
}
log.Debug($"更新超额度欠费任务");
var sql3 = "DELETE FROM op_task where TASKTYPE='超额度欠费' and TASKSTATUS='未开始'";
SqlCommand cmd3 = new SqlCommand(sql3, dbcon);
cmd3.ExecuteNonQuery();
var NoCustStlList = GetCustNoStl( dbcon);
if (NoCustStlList != null && NoCustStlList.Count != 0)
{
foreach (var NoInv in NoCustStlList)
{
insertTask("","", NoInv.CUSTOMERNAME + "_" + NoInv.CUSTZQ + "_欠费额度:" + NoInv.ALLOWAMOUNT + "_总欠费:" + NoInv.NOSTLAMOUNT, "超额度欠费", Admin, dbcon);
}
}
}
}
catch (Exception ex)
{
log.Error(ex.Message);
log.Error(ex.StackTrace);
}
}
static public List<MsOpSeaeFee> GetNoInv(string connStr, SqlConnection dbcon)
{
var headList = new List<MsOpSeaeFee>();
var strSql = new StringBuilder();
strSql.Append("SELECT B.BSNO,B.SALE,B.OP,B.SALEDEPT,B.OPLBNAME,B.MBLNO,F.CUSTOMERNAME");
strSql.Append(",isnull(SUM(CASE F.FEETYPE WHEN 1 THEN (CASE F.CURRENCY WHEN 'RMB' THEN ISNULL(F.AMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS RMBDR");
strSql.Append(",isnull(SUM(CASE F.FEETYPE WHEN 1 THEN (CASE F.CURRENCY WHEN 'USD' THEN ISNULL(F.AMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS USDDR");
strSql.Append(" from CH_FEE F INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) where 1=1 AND " + connStr);
strSql.Append(" GROUP BY B.BSNO,B.SALE,B.OP,B.SALEDEPT,B.OPLBNAME,B.MBLNO,F.CUSTOMERNAME");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
var Feedata = new MsOpSeaeFee();
Feedata.BSNO = row["BSNO"].ToString();
Feedata.SALE = row["SALE"].ToString();
Feedata.OP = row["OP"].ToString();
Feedata.SALEDEPT = row["SALEDEPT"].ToString();
Feedata.OPLBNAME = row["OPLBNAME"].ToString();
Feedata.MBLNO = row["MBLNO"].ToString();
Feedata.CUSTOMERNAME = row["CUSTOMERNAME"].ToString();
if (row["RMBDR"] != DBNull.Value)
Feedata.RMBDR = Convert.ToDecimal(row["RMBDR"].ToString());
if (row["USDDR"] != DBNull.Value)
Feedata.USDDR = Convert.ToDecimal(row["USDDR"].ToString());
headList.Add(Feedata);
}
}
return headList;
}
static public List<MsOpSeaeFee> GetNoStl(string connStr, SqlConnection dbcon)
{
var headList = new List<MsOpSeaeFee>();
var strSql = new StringBuilder();
strSql.Append("SELECT B.BSNO,B.SALE,B.OP,B.SALEDEPT,B.OPLBNAME,B.MBLNO,F.CUSTOMERNAME");
strSql.Append(",isnull(SUM(CASE F.FEETYPE WHEN 1 THEN (CASE F.CURRENCY WHEN 'RMB' THEN ISNULL(F.AMOUNT,0)-ISNULL(F.SETTLEMENT,0) ELSE 0 END) ELSE 0 END),0) AS RMBDR");
strSql.Append(",isnull(SUM(CASE F.FEETYPE WHEN 1 THEN (CASE F.CURRENCY WHEN 'USD' THEN ISNULL(F.AMOUNT,0)-ISNULL(F.SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS USDDR");
strSql.Append(",isnull(SUM(CASE F.FEETYPE WHEN 1 THEN (CASE F.CURRENCY WHEN 'RMB' THEN ISNULL(F.INVOICE,0) ELSE 0 END) ELSE 0 END),0) AS INVRMBDR");
strSql.Append(",isnull(SUM(CASE F.FEETYPE WHEN 1 THEN (CASE F.CURRENCY WHEN 'USD' THEN ISNULL(F.INVOICE,0) ELSE 0 END)ELSE 0 END),0) AS INVUSDDR");
strSql.Append(" from CH_FEE F INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) where 1=1 AND " + connStr);
strSql.Append(" GROUP BY B.BSNO,B.SALE,B.OP,B.SALEDEPT,B.OPLBNAME,B.MBLNO,F.CUSTOMERNAME");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
var Feedata = new MsOpSeaeFee();
Feedata.BSNO = row["BSNO"].ToString();
Feedata.SALE = row["SALE"].ToString();
Feedata.OP = row["OP"].ToString();
Feedata.SALEDEPT = row["SALEDEPT"].ToString();
Feedata.OPLBNAME = row["OPLBNAME"].ToString();
Feedata.MBLNO = row["MBLNO"].ToString();
Feedata.CUSTOMERNAME = row["CUSTOMERNAME"].ToString();
if (row["RMBDR"] != DBNull.Value)
Feedata.RMBDR = Convert.ToDecimal(row["RMBDR"].ToString());
if (row["USDDR"] != DBNull.Value)
Feedata.USDDR = Convert.ToDecimal(row["USDDR"].ToString());
if (row["INVRMBDR"] != DBNull.Value)
Feedata.INVRMBDR = Convert.ToDecimal(row["INVRMBDR"].ToString());
if (row["INVUSDDR"] != DBNull.Value)
Feedata.INVUSDDR = Convert.ToDecimal(row["INVUSDDR"].ToString());
headList.Add(Feedata);
}
}
return headList;
}
static public List<MsCustNoStlFee> GetCustNoStl(SqlConnection dbcon)
{
var headList = new List<MsCustNoStlFee>();
var strSql = new StringBuilder();
strSql.Append("SELECT * FROM (");
strSql.Append("SELECT A.ALLOWAMOUNT,C.SHORTNAME,[dbo].[GetCustZq](C.SHORTNAME) ZQ,ISNULL((SELECT SUM((AMOUNT-SETTLEMENT)*EXCHANGERATE) FROM CH_FEE WHERE FEETYPE=1 AND CUSTOMERNAME=C.SHORTNAME),0) NOSTLAMOUNT");
strSql.Append("FROM [shippingweb_qj].[dbo].[Info_Client_ACCDATE] A");
strSql.Append("left join info_client C ON C.GID=A.LINKGID");
strSql.Append("WHERE ISNULL(ALLOWAMOUNT,0)>0");
strSql.Append(" ) AS T WHERE NOSTLAMOUNT>ALLOWAMOUNT ");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
var Feedata = new MsCustNoStlFee();
Feedata.CUSTOMERNAME = row["SHORTNAME"].ToString();
Feedata.CUSTZQ = row["ZQ"].ToString();
if (row["ALLOWAMOUNT"] != DBNull.Value)
Feedata.ALLOWAMOUNT = Convert.ToDecimal(row["ALLOWAMOUNT"].ToString());
if (row["NOSTLAMOUNT"] != DBNull.Value)
Feedata.NOSTLAMOUNT = Convert.ToDecimal(row["NOSTLAMOUNT"].ToString());
headList.Add(Feedata);
}
}
return headList;
}
private string insertTask(string BSNO,string MBLNO,string TASKTITLE,string TASKTYPE,string OP, SqlConnection dbcon)
{
string sql = " INSERT INTO [op_task] (GID,[TASKNO] ,[PTASKNO],[TASKTYPE],[TASKSOURCE],[TASKSTATUS],[TASKTITLE] ";
sql = sql + ",[CREATEUSER] ,[CREATETIME] ,[TASKBEGINDATE] ,[COMPLETETYPE] ,[COMPLETETIME] ,[KPI],[MBLNO],[FILENO],[MAILNO],[FILEPATH],[ISPUBLIC],[OP],[BSNO],ISCOMPLETE)";
sql = sql + " SELECT NEWID(),NEWID(),null, '"+ TASKTYPE + "', '任务生成', '未开始' as [任务状态], '" + TASKTITLE + "' as [任务说明],";
sql = sql + "'DEMO-SA' as [发起人],GETDATE() as [录入日期],GETDATE() as[任务开始时间], '手动' as [完成方式],null as [完成时间] ,null as [KPI值] , '" + MBLNO + "' as [提单号], ";
sql = sql + " null as [文件编号], '' as [邮件编号], '' as [电子档案路径], 0 as 是否公共,'"+ OP + "','" + BSNO + "' as 编号,0";
log.Debug($"插入语句:{sql}");
SqlCommand cmd = new SqlCommand(sql, dbcon);
cmd.ExecuteNonQuery();
return "";
}
}
[JsonObject]
public class MsOpSeaeFee
{
public string BSNO { get; set; }
public string SALE { get; set; }
public string OP { get; set; }
public string SALEDEPT { get; set; }
public string OPLBNAME { get; set; }
public string MBLNO { get; set; }
public string CUSTOMERNAME { get; set; }
public decimal RMBDR { get; set; }
public decimal USDDR { get; set; }
public decimal INVRMBDR { get; set; }
public decimal INVUSDDR { get; set; }
public decimal INVAMOUNT { get; set; }
}
[JsonObject]
public class MsCustNoStlFee
{
public string CUSTOMERNAME { get; set; }
public string CUSTZQ { get; set; }
public decimal ALLOWAMOUNT { get; set; }
public decimal NOSTLAMOUNT { get; set; }
}
}

@ -130,9 +130,9 @@
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Job_DSWMS_REPORT\Job_DSWMS_REPORT.csproj">
<Project>{2eb17591-a35a-4f0b-b399-1414bc7aed89}</Project>
<Name>Job_DSWMS_REPORT</Name>
<ProjectReference Include="..\JobAutoCreateFee\JobAutoCreateFee.csproj">
<Project>{e0a766b8-34f9-4273-9509-544c691fb290}</Project>
<Name>JobAutoCreateFee</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Loading…
Cancel
Save