diff --git a/DSWeb.Common/DB/Comm.cs b/DSWeb.Common/DB/Comm.cs index b02b533d..71108b15 100644 --- a/DSWeb.Common/DB/Comm.cs +++ b/DSWeb.Common/DB/Comm.cs @@ -3228,4 +3228,37 @@ namespace DSWeb.Common.DB public string CHANGETYPE { get; set; } public decimal? STORAGEUNITCOUNT { get; set; } } + + + + + [Table("tMsWlDriver")] + public partial class tMsWlDriver_md + { + [Key] + public string DrvCode { get; set; } + public string OrgCode { get; set; } + + public string DrvName { get; set; } + public string DrvClass { get; set; } + public string JzNo { get; set; } + public string LzDate { get; set; } + public decimal? LimitDays { get; set; } + public decimal? DriverYears { get; set; } + public string TruckType { get; set; } + public string Licence { get; set; } + public string YearCheckDate { get; set; } + public string NextCheckDate { get; set; } + public decimal? NoticeDays { get; set; } + public string Mobile { get; set; } + public string OffTel { get; set; } + public string Remark { get; set; } + public string CertificateNo { get; set; } + public string Addr { get; set; } + public string GID { get; set; } + public decimal? BASESALARY { get; set; } + public string PassWord { get; set; } + public string OPENID { get; set; } + public bool? ISSTOP { get; set; } + } } \ No newline at end of file diff --git a/DSWeb.Common/DB/CommonDataContext.cs b/DSWeb.Common/DB/CommonDataContext.cs index 43a36e07..3d69b958 100644 --- a/DSWeb.Common/DB/CommonDataContext.cs +++ b/DSWeb.Common/DB/CommonDataContext.cs @@ -109,6 +109,13 @@ namespace DSWeb.Common.DB public DbSet OP_WMS_BASE { get; set; } public DbSet VW_OP_WMS_CHANGE_BILL { get; set; } public DbSet VW_WMSIOSUM_BYCUSTOMNO { get; set; } + + /// + /// 司机列表 + /// + public DbSet tMsWlDriver { get; set; } + + } diff --git a/DSWeb.Common/DB/DS6Comm.cs b/DSWeb.Common/DB/DS6Comm.cs index 25ebf639..2b1b5d35 100644 --- a/DSWeb.Common/DB/DS6Comm.cs +++ b/DSWeb.Common/DB/DS6Comm.cs @@ -162,17 +162,17 @@ namespace DSWeb.Common.DB public int? 周次 { get; set; } public string 主提单号 { get; set; } public string 分提单号 { get; set; } - public string 委托编号 { get; set; } + //public string 委托编号 { get; set; } public string 装运方式 { get; set; } public string 委托单位 { get; set; } - public string 发货人 { get; set; } - public string 收货人 { get; set; } - public string 通知人 { get; set; } + //public string 发货人 { get; set; } + //public string 收货人 { get; set; } + //public string 通知人 { get; set; } public string 发货人代码 { get; set; } public string 收货人代码 { get; set; } public string 通知人代码 { get; set; } public string 代理 { get; set; } - public string 代理内容 { get; set; } + //public string 代理内容 { get; set; } public string 场站 { get; set; } public string 船名 { get; set; } public string 航次 { get; set; } @@ -182,15 +182,15 @@ namespace DSWeb.Common.DB /// 实际开船日期 /// public DateTime? 预抵日期 { get; set; } - public string 起运港 { get; set; } + //public string 起运港 { get; set; } public string 装货港 { get; set; } public string 装港代码 { get; set; } public string 卸货港 { get; set; } public string 卸货代码 { get; set; } - public DateTime? 二程开船日期 { get; set; } - public string 二程港口 { get; set; } - public string 二程船名 { get; set; } - public string 二程航次 { get; set; } + //public DateTime? 二程开船日期 { get; set; } + //public string 二程港口 { get; set; } + //public string 二程船名 { get; set; } + //public string 二程航次 { get; set; } public string 目的地 { get; set; } public string 交货地点 { get; set; } public string 交货代码 { get; set; } @@ -225,7 +225,7 @@ namespace DSWeb.Common.DB public int? 箱型8 { get; set; } public int? 箱型9 { get; set; } public int? 箱型10 { get; set; } - public int? 其他箱型 { get; set; } + //public int? 其他箱型 { get; set; } public int? 箱TEU { get; set; } public string 集装箱 { get; set; } public string 录入人 { get; set; } @@ -236,184 +236,187 @@ namespace DSWeb.Common.DB public string 航线 { get; set; } public string 船公司 { get; set; } public string 货代公司 { get; set; } - public string 备注 { get; set; } + //public string 备注 { get; set; } public string 报关行 { get; set; } public string 承运车队 { get; set; } - public string 分单列表 { get; set; } + //public string 分单列表 { get; set; } public string 计费标准 { get; set; } - public bool? 报关服务 { get; set; } - public bool? 报验服务 { get; set; } - public bool? 熏蒸服务 { get; set; } - public bool? 仓储服务 { get; set; } - public bool? 拖车服务 { get; set; } - public DateTime? 报关日期 { get; set; } - public string 报关员 { get; set; } - public string 报关单号 { get; set; } - public string 核销单号 { get; set; } - public string 手册号 { get; set; } - public string 经营单位 { get; set; } - public string 单位代码 { get; set; } + //public bool? 报关服务 { get; set; } + //public bool? 报验服务 { get; set; } + //public bool? 熏蒸服务 { get; set; } + //public bool? 仓储服务 { get; set; } + //public bool? 拖车服务 { get; set; } + //public DateTime? 报关日期 { get; set; } + //public string 报关员 { get; set; } + //public string 报关单号 { get; set; } + //public string 核销单号 { get; set; } + //public string 手册号 { get; set; } + //public string 经营单位 { get; set; } + //public string 单位代码 { get; set; } public string 合同号 { get; set; } - public string 报关备注 { get; set; } - public bool? 是否退税 { get; set; } - public DateTime? 退税日期 { get; set; } - public bool? 是否通关 { get; set; } - public DateTime? 通关日期 { get; set; } + //public string 报关备注 { get; set; } + //public bool? 是否退税 { get; set; } + //public DateTime? 退税日期 { get; set; } + //public bool? 是否通关 { get; set; } + //public DateTime? 通关日期 { get; set; } public string 危险品分类 { get; set; } public string 危险品编号 { get; set; } public string 冷藏通风量 { get; set; } - public string 温度单位 { get; set; } + //public string 温度单位 { get; set; } public string 设置温度 { get; set; } public string 最低温度 { get; set; } public string 最高温度 { get; set; } public string 货物标识 { get; set; } - public string 发票号 { get; set; } - public string 商品编码 { get; set; } + //public string 发票号 { get; set; } + //public string 商品编码 { get; set; } public string 销售部门 { get; set; } public string 操作部门 { get; set; } - public int? 工作量 { get; set; } + //public int? 工作量 { get; set; } public string 业务来源 { get; set; } - public bool? 核对提单 { get; set; } - public bool? 柜检 { get; set; } - public bool? 转关 { get; set; } - public bool? 转船 { get; set; } - public string 英文船期 { get; set; } - public bool? 是否签单 { get; set; } - public DateTime? 签回日期 { get; set; } - public bool? 请求派车 { get; set; } - public bool? 是否派车 { get; set; } + //public bool? 核对提单 { get; set; } + //public bool? 柜检 { get; set; } + //public bool? 转关 { get; set; } + //public bool? 转船 { get; set; } + //public string 英文船期 { get; set; } + //public bool? 是否签单 { get; set; } + //public DateTime? 签回日期 { get; set; } + //public bool? 请求派车 { get; set; } + //public bool? 是否派车 { get; set; } public DateTime? 派车日期 { get; set; } - public DateTime? 三程开船日期 { get; set; } - public string 三程港口 { get; set; } - public string 三程船名 { get; set; } - public string 三程航次 { get; set; } + //public DateTime? 三程开船日期 { get; set; } + //public string 三程港口 { get; set; } + //public string 三程船名 { get; set; } + //public string 三程航次 { get; set; } public string 辅助字段一 { get; set; } public string 辅助字段二 { get; set; } public string 辅助字段三 { get; set; } public string 辅助字段四 { get; set; } - public bool? 是否解锁 { get; set; } - public string 解锁人 { get; set; } - public DateTime? 解锁日期 { get; set; } - public decimal? 应收陆运 { get; set; } - public decimal? 应付陆运 { get; set; } - public decimal? 陆运利润 { get; set; } - public DateTime? 二程取货日期 { get; set; } - public DateTime? 二程到港日期 { get; set; } - public DateTime? 三程取货日期 { get; set; } - public DateTime? 三程到港日期 { get; set; } + //public bool? 是否解锁 { get; set; } + //public string 解锁人 { get; set; } + //public DateTime? 解锁日期 { get; set; } + //public decimal? 应收陆运 { get; set; } + //public decimal? 应付陆运 { get; set; } + //public decimal? 陆运利润 { get; set; } + //public DateTime? 二程取货日期 { get; set; } + //public DateTime? 二程到港日期 { get; set; } + //public DateTime? 三程取货日期 { get; set; } + //public DateTime? 三程到港日期 { get; set; } public string 主提单标准 { get; set; } public string 分提单标准 { get; set; } public string 委托标准 { get; set; } - public bool? 财务 { get; set; } - public string 财务凭证 { get; set; } + //public bool? 财务 { get; set; } + //public string 财务凭证 { get; set; } public string 附加条款 { get; set; } public string 备案号 { get; set; } - public string 运抵国 { get; set; } - public string 境内货源地 { get; set; } - public string 批准文号 { get; set; } - public string 成交方式 { get; set; } - public decimal? 净重 { get; set; } - public string 单价 { get; set; } + //public string 运抵国 { get; set; } + //public string 境内货源地 { get; set; } + //public string 批准文号 { get; set; } + //public string 成交方式 { get; set; } + //public decimal? 净重 { get; set; } + //public string 单价 { get; set; } /// /// 第一层包装皮重 /// public string 总价 { get; set; } - public string 商品名称 { get; set; } - public string 数量单位 { get; set; } - public DateTime? 接单日期 { get; set; } - public DateTime? 报检日期 { get; set; } - public string 报检单号 { get; set; } - public DateTime? 验货时间 { get; set; } - public DateTime? 实验时间 { get; set; } - public DateTime? 熏蒸时间 { get; set; } - public DateTime? 出证时间 { get; set; } - public string 实验内容 { get; set; } - public string 报关操作 { get; set; } - public string 报检操作 { get; set; } - public string 币制 { get; set; } - public string 单证信息 { get; set; } + //public string 商品名称 { get; set; } + //public string 数量单位 { get; set; } + //public DateTime? 接单日期 { get; set; } + //public DateTime? 报检日期 { get; set; } + //public string 报检单号 { get; set; } + //public DateTime? 验货时间 { get; set; } + //public DateTime? 实验时间 { get; set; } + //public DateTime? 熏蒸时间 { get; set; } + //public DateTime? 出证时间 { get; set; } + //public string 实验内容 { get; set; } + //public string 报关操作 { get; set; } + //public string 报检操作 { get; set; } + //public string 币制 { get; set; } + //public string 单证信息 { get; set; } public string 核销标准 { get; set; } public string 报关标准 { get; set; } public string 报检标准 { get; set; } - public bool? 是否寄单 { get; set; } - public DateTime? 寄单日期 { get; set; } + //public bool? 是否寄单 { get; set; } + //public DateTime? 寄单日期 { get; set; } public string 目的地代码 { get; set; } - public string 包装代码 { get; set; } - public string 发货人编号 { get; set; } + //public string 包装代码 { get; set; } + //public string 发货人编号 { get; set; } public string 运输方式 { get; set; } public bool? 是否自有箱 { get; set; } public string 运费协议号 { get; set; } public string 航线操作 { get; set; } public string 航线管理 { get; set; } - public string 分票编号 { get; set; } - public string 拼箱类型 { get; set; } - public string 特殊要求 { get; set; } - public bool? 是否放单 { get; set; } - public bool? 已出号 { get; set; } - public bool? 已订舱 { get; set; } - public bool? 已放箱 { get; set; } - public bool? 已背箱 { get; set; } + //public string 分票编号 { get; set; } + //public string 拼箱类型 { get; set; } + //public string 特殊要求 { get; set; } + //public bool? 是否放单 { get; set; } + //public bool? 已出号 { get; set; } + //public bool? 已订舱 { get; set; } + //public bool? 已放箱 { get; set; } + //public bool? 已背箱 { get; set; } public string EDI备注 { get; set; } public string 第三方付费 { get; set; } - public bool? 是否商检换证 { get; set; } - public DateTime? 换证日期 { get; set; } - public bool? 是否客户入货 { get; set; } - public DateTime? 客户入货日期 { get; set; } - public bool? 是否出通关单 { get; set; } - public DateTime? 商检通关日期 { get; set; } - public bool? 是否客户派车 { get; set; } - public DateTime? 客户派车日期 { get; set; } - public bool? 是否回货 { get; set; } - public DateTime? 回货日期 { get; set; } + //public bool? 是否商检换证 { get; set; } + //public DateTime? 换证日期 { get; set; } + //public bool? 是否客户入货 { get; set; } + //public DateTime? 客户入货日期 { get; set; } + //public bool? 是否出通关单 { get; set; } + //public DateTime? 商检通关日期 { get; set; } + //public bool? 是否客户派车 { get; set; } + //public DateTime? 客户派车日期 { get; set; } + //public bool? 是否回货 { get; set; } + //public DateTime? 回货日期 { get; set; } public string 订舱人说明 { get; set; } - public DateTime? 到港日期 { get; set; } + //public DateTime? 到港日期 { get; set; } public string 真提单号 { get; set; } public string 合同号备注 { get; set; } public string 箱使堆存 { get; set; } public string HS编码 { get; set; } - public string 湿度 { get; set; } + //public string 湿度 { get; set; } //public string 方案名称 { get; set; } public string 船代 { get; set; } public string 单证员 { get; set; } - public bool? 业务解锁 { get; set; } - public string 业务解锁人 { get; set; } - public DateTime? 业务解锁日期 { get; set; } - public string 结费类型 { get; set; } - public string 扣单状态 { get; set; } - public DateTime? 应结日期 { get; set; } + //public bool? 业务解锁 { get; set; } + //public string 业务解锁人 { get; set; } + //public DateTime? 业务解锁日期 { get; set; } + //public string 结费类型 { get; set; } + //public string 扣单状态 { get; set; } + //public DateTime? 应结日期 { get; set; } public string 订舱序列号 { get; set; } //public string 销售订舱说明 { get; set; } //public string 场站联系人 { get; set; } //public DateTime? 截单日期 { get; set; } - public string 其他相关公司 { get; set; } + //public string 其他相关公司 { get; set; } public string 副本提单份数 { get; set; } //public string 放单状态 { get; set; } - public bool? FEE2 { get; set; } + //public bool? FEE2 { get; set; } public bool? 通知到港 { get; set; } public bool? 是否提货 { get; set; } public string 是否占舱 { get; set; } public string 占舱备注 { get; set; } - public int? 申请堆存 { get; set; } - public int? 批准堆存 { get; set; } - public int? 申请箱使 { get; set; } - public int? 批准箱使 { get; set; } - public int? 申请插电 { get; set; } - public int? 批准插电 { get; set; } + //public int? 申请堆存 { get; set; } + //public int? 批准堆存 { get; set; } + //public int? 申请箱使 { get; set; } + //public int? 批准箱使 { get; set; } + //public int? 申请插电 { get; set; } + //public int? 批准插电 { get; set; } + public DateTime? ETA { get; set; } - public DateTime? ATA { get; set; } + //public DateTime? ATA { get; set; } public DateTime? ETD { get; set; } - public DateTime? 预配日期 { get; set; } - public DateTime? 海关放行 { get; set; } - public DateTime? 装载放行 { get; set; } - public DateTime? 外理放行 { get; set; } - public DateTime? 码头放行 { get; set; } - public DateTime? 海关查验 { get; set; } - public string 扣单原因 { get; set; } - public string 扣放单操作人 { get; set; } - public DateTime? 扣放单操作时间 { get; set; } - public string 放单原因 { get; set; } - public bool? 是否AMS录入 { get; set; } - public DateTime? AMS录入日期 { get; set; } + //public DateTime? 预配日期 { get; set; } + //public DateTime? 海关放行 { get; set; } + //public DateTime? 装载放行 { get; set; } + //public DateTime? 外理放行 { get; set; } + //public DateTime? 码头放行 { get; set; } + //public DateTime? 海关查验 { get; set; } + //public string 扣单原因 { get; set; } + //public string 扣放单操作人 { get; set; } + //public DateTime? 扣放单操作时间 { get; set; } + //public string 放单原因 { get; set; } + //public bool? 是否AMS录入 { get; set; } + //public DateTime? AMS录入日期 { get; set; } + + //public string 是否1Y { get; set; } //public string @1Y日期 {get;set;} //public string 是否3Z { get; set; } @@ -422,10 +425,11 @@ namespace DSWeb.Common.DB public bool? 是否提交舱单 { get; set; } public bool? 是否装载放行 { get; set; } public string 其他备注 { get; set; } - public DateTime? 费用封帐日期 { get; set; } - public bool? 是否费用解封 { get; set; } - public string 费用解封人 { get; set; } - public DateTime? 费用解封日期 { get; set; } + + //public DateTime? 费用封帐日期 { get; set; } + //public bool? 是否费用解封 { get; set; } + //public string 费用解封人 { get; set; } + //public DateTime? 费用解封日期 { get; set; } public long? DJYID { get; set; } public string DJYVERSION { get; set; } diff --git a/DSWeb.DJYMQ/DS7Service.cs b/DSWeb.DJYMQ/DS7Service.cs index ce38ef7d..3ef24feb 100644 --- a/DSWeb.DJYMQ/DS7Service.cs +++ b/DSWeb.DJYMQ/DS7Service.cs @@ -1883,6 +1883,7 @@ SELECT @ps_BillNo as N'billno'"; if (count > 3) { logger.Debug($"重试完结"); + return; } var head = JsonConvert.DeserializeObject(itemstr); @@ -1931,6 +1932,12 @@ SELECT @ps_BillNo as N'billno'"; //newhead.业务状态 = updrec.业务状态; newhead.费用状态 = updrec.费用状态; + //20230726 会计期间改为:如果有实际开船日期 ATD/预抵日期 则按实际开船日期计算,如果没有,则按当前日期计算 + //如果费用封账 + if (updrec.费用状态 == "费用封帐") { + newhead.会计期间 = updrec.会计期间; + } + newhead.主提单标准 = string.IsNullOrWhiteSpace(head.mblno) ? updrec.编号 : head.mblno; newhead.报关标准 = updrec.报关标准; newhead.报检标准 = updrec.报检标准; @@ -2123,7 +2130,7 @@ SELECT @ps_BillNo as N'billno'"; AfterSave(newhead.编号); //DS6Data.SaveChanges(); - + logger.Debug($"完成处理(更新):{newhead.主提单号};{newhead.DJYID}"); } else { @@ -2150,7 +2157,10 @@ SELECT @ps_BillNo as N'billno'"; logger.Debug($"开始处理(新增):{newhead.主提单号};{newhead.DJYID}"); //执行中对象2.执行列表数(); - var 业务编号Code = "SE" + ((DateTime)(newhead.会计期间)).Year.ToString() + ((DateTime)(newhead.会计期间)).Month.ToString().PadLeft(2, '0'); + //var 业务编号Code = "SE" + ((DateTime)(newhead.会计期间)).Year.ToString() + ((DateTime)(newhead.会计期间)).Month.ToString().PadLeft(2, '0'); + DateTime now = DateTime.Now; + DateTime today2 = new DateTime(now.Year, now.Month, now.Day); + var 业务编号Code = "SE" + today2.Year.ToString() + today2.Month.ToString().PadLeft(2, '0'); newhead.业务编号 = 获取业务编号Helper.Instance. DS6GetBSNO(业务编号Code); @@ -2250,6 +2260,8 @@ SELECT @ps_BillNo as N'billno'"; DS6Data.SaveChanges(); //logger.Debug($"新增完成:{newhead.主提单号};{newhead.DJYID}"); AfterSave(newhead.编号); + + logger.Debug($"完成处理(新增):{newhead.主提单号};{newhead.DJYID}"); } } @@ -2280,8 +2292,14 @@ SELECT @ps_BillNo as N'billno'"; int count = context.Database.ExecuteSqlCommand("exec p_exec_accmonth @bsno", bsno); context.SaveChanges(); + + count = context.Database.ExecuteSqlCommand($" update t_op_seae set 应结日期=ISNULL(dbo.GetCustStlDay(预抵日期,委托单位,揽货人),预抵日期) where 编号='{编号}' and 预抵日期 is not null "); + context.SaveChanges(); + logger.Debug($"AfterSave:{编号};{count}"); } + + } catch (Exception e) { @@ -3274,7 +3292,6 @@ SELECT @ps_BillNo as N'billno'"; //{ // if(!string.IsNullOrWhiteSpace(goodscode)) { // var newrec = new t_code_goods_md(); - // newrec.代码 = SetLength(goodscode, 10); // newrec.货物名称 = SetLength(goodsname, 100); // 货物名称 = newrec.货物名称; @@ -3323,8 +3340,12 @@ SELECT @ps_BillNo as N'billno'"; DateTime today2 = new DateTime(now.Year, now.Month, now.Day); var 装运方式 = "整箱"; - if (船公司.IndexOf("拼箱") >= 0) { - 装运方式 = "拼箱"; + if (!string.IsNullOrWhiteSpace(船公司)) + { + if (船公司.IndexOf("拼箱") >= 0) + { + 装运方式 = "拼箱"; + } } var result = new t_op_seae_md @@ -3332,7 +3353,7 @@ SELECT @ps_BillNo as N'billno'"; 业务编号 = bsno, 业务状态 = string.IsNullOrWhiteSpace( bsstatusname)? "接受委托": bsstatusname, 费用状态 = "录入状态", - 会计期间 = etd==null? today2: etd, + 会计期间 = atd , 装运方式 = 装运方式, 周次 = weeks, 录入日期 = bsdate, //bsdate new DateTime(2070, 1, 1) ? DateTime.Now: bsdate, diff --git a/DSWeb/Areas/Account/Models/Chfee_invoice_HangXin/Chfee_Invoice.cs b/DSWeb/Areas/Account/Models/Chfee_invoice_HangXin/Chfee_Invoice.cs index f20c71fc..b26e7021 100644 --- a/DSWeb/Areas/Account/Models/Chfee_invoice_HangXin/Chfee_Invoice.cs +++ b/DSWeb/Areas/Account/Models/Chfee_invoice_HangXin/Chfee_Invoice.cs @@ -1115,7 +1115,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin public string appKey { get; set; } = "23646802"; public string appSecret { get; set; } = "CBFAFF5B0AED4465"; - + public string extensionNumber { get; set; } = ""; /// /// 使用沙盒地址还是实际工作地址 /// @@ -1542,6 +1542,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin { result.appKey = INVITERFACE.NUONUOAPPKEY; result.appSecret = INVITERFACE.NUONUOAPPSECRET; + result.extensionNumber = INVITERFACE.extensionNumber; } var dic = new Dictionary @@ -2074,6 +2075,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin result.appSecret = _token.appSecret; result.accessToken = _token.accessToken; result.taxnum = taxnum; + result.extensionNumber = _token.extensionNumber; return result; } @@ -2261,6 +2263,8 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin var _head = new NuoNuoQuanDianInvoice(head, detailList); + _head.order.extensionNumber = extensionNumber; + var json = DSWeb.TruckMng.Helper.JsonConvert.Serialize(_head); var _r = ""; @@ -2392,7 +2396,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin } /// - /// 诺诺全电 红字确认单申请 + /// 诺诺全电冲红 红字确认单申请 发出红字确认单 /// /// /// @@ -2406,6 +2410,8 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin var _head = new NuoNuoQuanDian_RedConfirm(head); + _head.extensionNumber = extensionNumber; + var json = DSWeb.TruckMng.Helper.JsonConvert.Serialize(_head); string method = "nuonuo.OpeMplatform.saveInvoiceRedConfirm"; diff --git a/DSWeb/Areas/Dispatch/Controllers/WxAppController.cs b/DSWeb/Areas/Dispatch/Controllers/WxAppController.cs index 1bbc74cc..61f5afef 100644 --- a/DSWeb/Areas/Dispatch/Controllers/WxAppController.cs +++ b/DSWeb/Areas/Dispatch/Controllers/WxAppController.cs @@ -14,7 +14,7 @@ using DSWeb.Areas.Dispatch.DB; using DSWeb.Areas.Dispatch.DB_Wx; using DSWeb.Areas.CommMng.DAL; using HcUtility.Comm; - +using System.Data.Entity.Migrations; namespace DSWeb.Areas.Dispatch.Controllers { @@ -31,6 +31,8 @@ namespace DSWeb.Areas.Dispatch.Controllers public string AuthCode { get; set; } } + + //微信小程序专用接口控制器 public class WxAppController : Controller { @@ -1404,5 +1406,122 @@ namespace DSWeb.Areas.Dispatch.Controllers } */ + + #region 方合派车小程序 + + //三个功能 + //1依据司机表验证登陆 + //2 司机查看业务 小程序需要的字段名对应东胜派车管理里的字段 + //提单号、船名航次、提箱场站、装货日期(到时分秒)、派车申请人、装货工厂、装货地址、箱型箱量、件数、重量、体积、货物标识、品名、危品登记、危品编号 + //、集装箱明细(包含箱型、箱号、封号)司机注意事项、放在附件管理里的司机携带的提箱单和罐证等文件(需要司机可以下载) + //3 录入费用列表 提交后向待办事务表中添加 + // 如重复添加则更新 + + public class DriverLoginInfo : LoginInfo + { + public string TEL { get; set; } + } + + [HttpPost] + public ActionResult DriverFirstLogin(DriverLoginInfo logininfo) + { + var cdc = new DSWeb.Common.DB.CommonDataContext(); + + try + { + //1首先根据手机号和密码 判断是否存在 如不存在 返回否 结束 + var DriverList = cdc.tMsWlDriver.Where(x => x.Mobile== logininfo.TEL && x.PassWord== logininfo.password ).ToList(); + + if (DriverList == null || DriverList.Count == 0) { + return Json(new { ErrorCode = 500, Message = "电话或密码错误" }, JsonRequestBehavior.AllowGet); + } + + var Driver = DriverList[0]; + + if (Driver.ISSTOP==null || Driver.ISSTOP==true) { + return Json(new { ErrorCode = 500, Message = "该账户还未启用" }, JsonRequestBehavior.AllowGet); + } + + var obj = getOpenId(logininfo.AuthCode); + + if (obj.errcode == 0) + { + + var userWxList = cdc.tMsWlDriver.Where(x => x.OPENID == obj.openid && x.DrvCode!= Driver.DrvCode).ToList(); + if (userWxList.Count > 0) + { + //将所有使用这个openid的其他司机数据的openid置为‘’ + foreach (var item in userWxList) + { + item.OPENID = ""; + cdc.tMsWlDriver.AddOrUpdate(item); + } + + } + + Driver.OPENID = obj.openid; + cdc.tMsWlDriver.AddOrUpdate(Driver); + cdc.SaveChanges(); + + BasicDataRefDAL.SaveLog("", obj.openid, "wxapp", "登录3"); + return Json(new + { + ErrorCode = 0, + Message = "获取成功", + BaseInfo = new { Driver.DrvName, Driver.Mobile, Driver.OPENID } + }, + JsonRequestBehavior.AllowGet); + + } + } + catch (Exception e) + { + BasicDataRefDAL.SaveLog("", e.Message, "wxapp", "登陆错误"); + //log.Debug("wxapp登陆错误:" + e.Message); + } + //BasicDataRefDAL.SaveLog("", obj.openid, "wxapp", "登录f"); + return Json(new { ErrorCode = 500, Message = "发生错误" }, JsonRequestBehavior.AllowGet); + } + + [HttpGet] + public ActionResult GetDriverInfo(string code) + { + try + { + var obj = getOpenId(code); + var cdc = new Common.DB.CommonDataContext(); + var Driver = cdc.tMsWlDriver.FirstOrDefault(x => x.OPENID == obj.openid && (x.ISSTOP==null || x.ISSTOP == false)); + + if (Driver != null) + { + + + return Json(new + { + ErrorCode = 0, + Message = "获取成功", + BaseInfo = new { Driver.DrvName, Driver.Mobile, Driver.OPENID } + }, + JsonRequestBehavior.AllowGet); + } + else + { + //BasicDataRefDAL.SaveLog("", "", "wxapp", "获取用户信息2"); + return Json(new { ErrorCode = -1, Message = "用户不存在" }, JsonRequestBehavior.AllowGet); + } + //BasicDataRefDAL.SaveLog("", "", "wxapp", "获取用户信息3"); + return Json(new { ErrorCode = 500, Message = "发生错误" }, JsonRequestBehavior.AllowGet); + } + catch (Exception e) + { + //log.Debug("获取信息错误" + e.Message); + //BasicDataRefDAL.SaveLog("错误", e.Message, "wxapp", "获取用户信息"); + return Json(new { ErrorCode = 500, Message = e.Message }, JsonRequestBehavior.AllowGet); + } + + + } + + #endregion } } \ No newline at end of file diff --git a/DSWeb/Areas/Dispatch/DB/CommonDataContext.cs b/DSWeb/Areas/Dispatch/DB/CommonDataContext.cs index 19f8a3a8..2fdca1d5 100644 --- a/DSWeb/Areas/Dispatch/DB/CommonDataContext.cs +++ b/DSWeb/Areas/Dispatch/DB/CommonDataContext.cs @@ -1,4 +1,5 @@ using DSWeb.Areas.MvcShipping.DB; +using DSWeb.Areas.TruckMng.Models; using System; using System.Collections.Generic; using System.Data.Entity; @@ -63,6 +64,7 @@ namespace DSWeb.Areas.Dispatch.DB public DbSet VW_OP_YARD_CTNMNG_STOREAREA_CANUSE { get; set; } public DbSet VW_OP_YARD_CTNMNG_HUJINGWXHeadList { get; set; } + } } \ No newline at end of file diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs index c3484b71..99c5c81a 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs @@ -6731,7 +6731,6 @@ namespace DSWeb.MvcShipping.Controllers #endregion - #region E-FREIGHT EDI导出 public ContentResult CreateEFEDIList(string bsnos, string mblno, string filetype, string filerole) { diff --git a/DSWeb/Areas/MvcShipping/DAL/MsSysInvInterFaceSet/MsSysInvInterFaceSetDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsSysInvInterFaceSet/MsSysInvInterFaceSetDAL.cs index 5122731b..7817a3b2 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsSysInvInterFaceSet/MsSysInvInterFaceSetDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsSysInvInterFaceSet/MsSysInvInterFaceSetDAL.cs @@ -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],NUONUOAPPKEY,NUONUOAPPSECRET"); + strSql.Append(",[CREATETIME],[MODIFIEDUSER],[MODIFIEDTIME],[COMPANYID],NUONUOAPPKEY,NUONUOAPPSECRET,extensionNumber"); strSql.Append(",(select ShowName from [user] where GID=sys_inv_interfaceset.CREATEUSER) as CREATEUSERREF"); strSql.Append(",CORPID,(select Name from [company] where GID=sys_inv_interfaceset.CORPID) as COMPANYNAME"); strSql.Append(" from sys_inv_interfaceset where 1=1 "); @@ -83,6 +83,8 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet data.NUONUOAPPKEY = Convert.ToString(reader["NUONUOAPPKEY"]); data.NUONUOAPPSECRET = Convert.ToString(reader["NUONUOAPPSECRET"]); data.CORPID = Convert.ToString(reader["CORPID"]); + data.extensionNumber = Convert.ToString(reader["extensionNumber"]); + data.COMPANYNAME = Convert.ToString(reader["COMPANYNAME"]); #endregion headList.Add(data); @@ -109,12 +111,12 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet var cmdInsert = db.GetSqlStringCommand( - @"insert into sys_inv_interfaceset (GID,INVOICELINE,INVITERFACE,COMPANYID,CREATEUSER,CREATETIME,NUONUOAPPKEY,NUONUOAPPSECRET,CORPID) - values (@GID,@INVOICELINE,@INVITERFACE,@COMPANYID,@CREATEUSER,@CREATETIME,@NUONUOAPPKEY,@NUONUOAPPSECRET,@CORPID) "); + @"insert into sys_inv_interfaceset (GID,INVOICELINE,INVITERFACE,COMPANYID,CREATEUSER,CREATETIME,NUONUOAPPKEY,NUONUOAPPSECRET,CORPID,extensionNumber) + values (@GID,@INVOICELINE,@INVITERFACE,@COMPANYID,@CREATEUSER,@CREATETIME,@NUONUOAPPKEY,@NUONUOAPPSECRET,@CORPID,@extensionNumber) "); var cmdUpdate = db.GetSqlStringCommand( - @"update sys_inv_interfaceset set INVOICELINE=@INVOICELINE,INVITERFACE=@INVITERFACE,MODIFIEDUSER=@MODIFIEDUSER,MODIFIEDTIME=@MODIFIEDTIME,NUONUOAPPKEY=@NUONUOAPPKEY,NUONUOAPPSECRET=@NUONUOAPPSECRET,CORPID=@CORPID where GID=@GID "); + @"update sys_inv_interfaceset set INVOICELINE=@INVOICELINE,INVITERFACE=@INVITERFACE,MODIFIEDUSER=@MODIFIEDUSER,MODIFIEDTIME=@MODIFIEDTIME,NUONUOAPPKEY=@NUONUOAPPKEY,NUONUOAPPSECRET=@NUONUOAPPSECRET,CORPID=@CORPID,extensionNumber=@extensionNumber where GID=@GID "); if (bodyList != null) { @@ -135,6 +137,7 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet db.AddInParameter(cmdInsert, "@NUONUOAPPKEY", DbType.String, enumValue.NUONUOAPPKEY); db.AddInParameter(cmdInsert, "@NUONUOAPPSECRET", DbType.String, enumValue.NUONUOAPPSECRET); db.AddInParameter(cmdInsert, "@CORPID", DbType.String, enumValue.CORPID); + db.AddInParameter(cmdInsert, "@extensionNumber", DbType.String, enumValue.extensionNumber); db.ExecuteNonQuery(cmdInsert, tran); } else @@ -149,6 +152,7 @@ namespace DSWeb.MvcShipping.DAL.MsSysInvInterFaceSet db.AddInParameter(cmdUpdate, "@NUONUOAPPKEY", DbType.String, enumValue.NUONUOAPPKEY); db.AddInParameter(cmdUpdate, "@NUONUOAPPSECRET", DbType.String, enumValue.NUONUOAPPSECRET); db.AddInParameter(cmdUpdate, "@CORPID", DbType.String, enumValue.CORPID); + db.AddInParameter(cmdUpdate, "@extensionNumber", DbType.String, enumValue.extensionNumber); db.AddInParameter(cmdUpdate, "@GID", DbType.String, enumValue.GID); db.ExecuteNonQuery(cmdUpdate, tran); } diff --git a/DSWeb/Areas/MvcShipping/Models/MsSysInvInterFaceSet/SysInvInterFaceSet.cs b/DSWeb/Areas/MvcShipping/Models/MsSysInvInterFaceSet/SysInvInterFaceSet.cs index 0d57c89a..9dc1336b 100644 --- a/DSWeb/Areas/MvcShipping/Models/MsSysInvInterFaceSet/SysInvInterFaceSet.cs +++ b/DSWeb/Areas/MvcShipping/Models/MsSysInvInterFaceSet/SysInvInterFaceSet.cs @@ -86,6 +86,9 @@ namespace DSWeb.MvcShipping.Models.SysInvInterFaceSet [ModelDB] public string CORPID { get; set; } + [ModelDB] + public string extensionNumber { get; set; } = ""; + public string COMPANYNAME { get; set; } #endregion } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsSysInvInterFaceSet/MsSysInvInterFaceSetIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsSysInvInterFaceSet/MsSysInvInterFaceSetIndex.js index fc48f583..edd7b7df 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsSysInvInterFaceSet/MsSysInvInterFaceSetIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsSysInvInterFaceSet/MsSysInvInterFaceSetIndex.js @@ -176,6 +176,14 @@ Ext.extend(Shipping.MsSysInvInterFaceSetIndex, Ext.Panel, { }, editor: this.comboxSaleCompany + }, { + sortable: true, + dataIndex: 'extensionNumber', + header: '分机号', + width: 80, + editor: { + xtype: 'textfield' + } }, { sortable: true, dataIndex: 'CREATEUSERREF', diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsSysInvInterFaceSet/MsSysInvInterFaceSetModel.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsSysInvInterFaceSet/MsSysInvInterFaceSetModel.js index 79dfbd58..6ed4111b 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsSysInvInterFaceSet/MsSysInvInterFaceSetModel.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsSysInvInterFaceSet/MsSysInvInterFaceSetModel.js @@ -11,6 +11,7 @@ { name: 'COMPANYID', type: 'string' }, { name: 'NUONUOAPPKEY', type: 'string' }, { name: 'NUONUOAPPSECRET', type: 'string' }, + { name: 'extensionNumber', type: 'string' }, { name: 'CORPID', type: 'string' }, { name: 'COMPANYNAME', type: 'string' } ] diff --git a/WXApp/方合派车_app b/WXApp/方合派车_app new file mode 160000 index 00000000..c1d37a0c --- /dev/null +++ b/WXApp/方合派车_app @@ -0,0 +1 @@ +Subproject commit c1d37a0c18689fdaf4617a899a9f86f8d946fd72