Browse Source

数据中心作废bj02的 asn单子 scp同步作废

master
qian 8 months ago
parent
commit
c0f1421851
  1. 67
      北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs
  2. 1
      北京北汽/Models/CK.SCP.Models.csproj
  3. 2
      北京北汽/Models/ExchangeCenterContext.cs
  4. 34
      北京北汽/Models/ExchangeCenterTables/TED_SCPAPASN.cs
  5. 1
      北京北汽/Models/ScpEntity/TB_ASN.cs
  6. 5
      北京北汽/Models/ScpEntity/V_TB_ASN.cs
  7. 8
      北京北汽/SCP/Views/SupplierData/SCP_ASN.aspx
  8. 10
      北京北汽/SCP/Views/SupplierData/SCP_ASN.aspx.cs
  9. 9
      北京北汽/SCP/Views/SupplierData/SCP_ASN.aspx.designer.cs

67
北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs

@ -244,7 +244,7 @@ namespace CK.SCP.Controller
q = q.Where(p => p.TaskState==p_entity.TaskState);
_ret.State = ReturnStatus.Succeed;
_ret.Result = q.OrderBy(p => p.CreateTime).ToList();
_ret.Result = q.ToList();
}
}
catch (Exception e)
@ -405,7 +405,8 @@ namespace CK.SCP.Controller
DataCenterContext dc = EntitiesFactory.CreateDataCenterInstance();
AppBoxContext authdb = EntitiesFactory.CreateAppBoxInstance();
using (var scope =
new TransactionScope(TransactionScopeOption.Required, new TransactionOptions()
new TransactionScope(TransactionScopeOption.Suppress, new TransactionOptions()
//new TransactionScope(TransactionScopeOption.Required, new TransactionOptions()
{
IsolationLevel = System.Transactions.IsolationLevel.Serializable,
Timeout = new TimeSpan(0, 20, 0)
@ -479,6 +480,16 @@ namespace CK.SCP.Controller
EntitiesFactory.SaveDb(dc);
scope.Complete();
break;
// 作废asn单
case "TED_SCRAPASN":
result = UpApAsn(db, scpdb, _task);
result.Message = _task.TaskID.ToString();
Update_TEA_TASK_SUB(db, _task);
scpdb.BulkSaveChanges();
db.BulkSaveChanges();
dc.BulkSaveChanges();
scope.Complete();
break;
//case "TES_SITE":
// result = UpdateFactory(db, scpdb, appscpdb, _task);
// break;
@ -3678,6 +3689,58 @@ namespace CK.SCP.Controller
}
return _ret;
}
/// <summary>
/// 作废发货单
/// </summary>
/// <param name="db"></param>
/// <param name="scpdb"></param>
/// <param name="p_entity"></param>
/// <returns></returns>
public static ResultObject<bool> UpApAsn(ExchangeCenterContext db, ScpEntities scpdb, TEA_TASK_SUB p_entity)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
var _SCPAPASNlist = db.TED_SCRAPASN.Where(p => p.TaskID == p_entity.TaskID && string.IsNullOrEmpty(p.Remark)).ToList();
var Asnlist = new List<TB_ASN>();
var AsnDetailslist = new List<TB_ASN_DETAIL>();
foreach (var asn in _SCPAPASNlist)
{
TB_ASN b_ASN = new TB_ASN();
b_ASN = scpdb.TB_ASN.FirstOrDefault(q => q.SubSite == "BJ02" && q.AsnBillNum == asn.BillNum);
b_ASN.Reason = asn.Reason;
b_ASN.State = (int)AskState.Reject;
b_ASN.IsDeleted = true;
List<TB_ASN_DETAIL> asn_details = scpdb.TB_ASN_DETAIL.Where(q => q.AsnBillNum == asn.BillNum).ToList();
if (asn_details != null)
{
asn_details.ForEach(itm => {
itm.IsDeleted = true;
itm.State = (int)AskState.Reject;
});
AsnDetailslist.AddRange(asn_details);
}
Asnlist.Add(b_ASN);
asn.Remark = "SCPREAD";
}
scpdb.TB_ASN.BulkUpdate(Asnlist);
scpdb.TB_ASN_DETAIL.BulkUpdate(AsnDetailslist);
db.TED_SCRAPASN.BulkUpdate(_SCPAPASNlist);
_ret.State = ReturnStatus.Succeed;
_ret.MessageList.Add(string.Format("更新表{0}任务ID{1}成功!", "TED_SCPAPASN", p_entity.TaskID));
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(TEA_TASK_SUB), "UpApAsn", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
}
}

1
北京北汽/Models/CK.SCP.Models.csproj

@ -311,6 +311,7 @@
<Compile Include="ExchangeCenterTables\TES_CUSTOMER_TYPE.cs" />
<Compile Include="ExchangeCenterTables\TES_DEPARTMENT.cs" />
<Compile Include="ExchangeCenterTables\TES_DOMAIN.cs" />
<Compile Include="ExchangeCenterTables\TED_SCPAPASN.cs" />
<Compile Include="ExchangeCenterTables\TES_EDI_DATA.cs" />
<Compile Include="ExchangeCenterTables\TES_ENTITY.cs" />
<Compile Include="ExchangeCenterTables\TES_LINE.cs" />

2
北京北汽/Models/ExchangeCenterContext.cs

@ -102,7 +102,7 @@ namespace CK.SCP.Models
public virtual DbSet<TED_KANBAN_MSTR> TED_KANBAN_MSTR { get; set; }
public virtual DbSet<TED_KANBAN_DET> TED_KANBAN_DET { get; set; }
public virtual DbSet<TED_SCRAPASN> TED_SCRAPASN { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);

34
北京北汽/Models/ExchangeCenterTables/TED_SCPAPASN.cs

@ -0,0 +1,34 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using CK.SCP.Models.Base;
using CK.SCP.Models.Enums;
namespace CK.SCP.Models.ExchangeCenterTables
{
[Description("ASN作废表")]
public class TED_SCRAPASN
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[Description("任务编号")]
public Guid TaskID { get; set; }
[DisplayName("ASN单号")]
public string BillNum { get; set; }
[DisplayName("报废时间")]
public DateTime Otime { get; set; }
[DisplayName("操作员")]
public string OperName { get; set; }
[DisplayName("报废原因")]
public string Reason { get; set; }
[DisplayName("备注")]
public string Remark { get; set; }
}
}

1
北京北汽/Models/ScpEntity/TB_ASN.cs

@ -106,5 +106,6 @@ namespace CK.SCP.Models.ScpEntity
public string Extend1 { get; set; }
public string Extend2{ get; set; }
public string Extend3 { get; set; }
public string Reason { get; set; }
}
}

5
北京北汽/Models/ScpEntity/V_TB_ASN.cs

@ -11,6 +11,7 @@ namespace CK.SCP.Models.ScpEntity
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@ -66,6 +67,10 @@ namespace CK.SCP.Models.ScpEntity
public string SubSite { get; set; }
[Description("原因")]
public string Reason { get; set; }
}
}

8
北京北汽/SCP/Views/SupplierData/SCP_ASN.aspx

@ -62,6 +62,13 @@
<f:TextBox ID="TXT_VenderName" runat="server" Label="供应商"/>
<f:TextBox ID="TXT_ASK" runat="server" Label="看板编号" />
<f:TextBox ID="txtPO" runat="server" Label="订单编号" />
<f:DropDownList runat="server" ID="DropDownList1" Label="状态">
<f:ListItem Text="-" Value=""/>
<f:ListItem Text="新建" Value="0" />
<f:ListItem Text="已发货" Value="1" />
<f:ListItem Text="已收货" Value="2" />
<f:ListItem Text="已作废" Value="-1" />
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_3" Hidden="true">
@ -118,6 +125,7 @@
<f:BoundField Width = "100px" DataField = "ReceiveUser" DataFormatString = "{0}" HeaderText = "收货人" />
<f:BoundField runat="server" HeaderText="发往地点" ColumnID="" DataField="Site_Desc" />
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" Hidden="true" />
<f:BoundField runat="server" HeaderText="作废原因" ColumnID="Reason" DataField="Reason" Hidden="true" />
</Columns>

10
北京北汽/SCP/Views/SupplierData/SCP_ASN.aspx.cs

@ -61,6 +61,14 @@ namespace SCP.SupplierData
_entity.AskBillNum = TXT_ASK.Text;
_entity.UserInVendIds = CurrentUser.VenderList;
_entity.UserInAddress = CurrentUser.FactoryList;
if (!string.IsNullOrEmpty(DropDownList1.SelectedValue))
{
_entity.State = int.Parse(DropDownList1.SelectedValue);
if (_entity.State == -1)
{
_entity.IsDeleted = true;
}
}
SCP_ASN_CONTROLLER.Get_V_TB_ASN_List(_entity, (_ret) => {
if (_ret.State == ReturnStatus.Succeed)
{
@ -80,7 +88,7 @@ namespace SCP.SupplierData
{
List<string> _ls = new List<string>();
SearchV_TB_ASN(rs => {
_ls=rs.Select(p => p.AsnBillNum).ToList();
_ls=rs.Where(q=> q.IsDeleted == false).Select(p => p.AsnBillNum).ToList();
if (_ls.Count == 0)
{
Alert.Show(GetResourceKey("无导出记录!"));

9
北京北汽/SCP/Views/SupplierData/SCP_ASN.aspx.designer.cs

@ -176,6 +176,15 @@ namespace SCP.SupplierData
/// </remarks>
protected global::FineUI.TextBox txtPO;
/// <summary>
/// DropDownList1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DropDownList1;
/// <summary>
/// FormRow_3 控件。
/// </summary>

Loading…
Cancel
Save