Browse Source

Merge branch 'master' of 192.168.1.5:BWPB3/B3QingDaoWanFu

master
wushukun 7 years ago
parent
commit
2985ddfaa4
16 changed files with 543 additions and 6 deletions
  1. +16
    -0
      B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj
  2. +100
    -0
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/OutFactoryRecord_/OutFactoryRecordEdit.cs
  3. +119
    -0
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/OutFactoryRecord_/OutFactoryRecordImport.cs
  4. +36
    -0
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/OutFactoryRecord_/OutFactoryRecordList.cs
  5. +58
    -0
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/OutFactoryRecord_/OutFactoryRecordList.xml
  6. +3
    -0
      B3QingDaoWanFu.Web/PluginClass.cs
  7. +4
    -0
      B3QingDaoWanFu/B3QingDaoWanFu.csproj
  8. +20
    -0
      B3QingDaoWanFu/BL/Bill/OutFactoryRecordBL/OutFactoryRecordBL.cs
  9. +29
    -0
      B3QingDaoWanFu/BO/Bill/OutFactoryRecord/OutFactoryRecord.cs
  10. +54
    -0
      B3QingDaoWanFu/BO/Bill/OutFactoryRecord/OutFactoryRecord_Detail.cs
  11. +3
    -0
      B3QingDaoWanFu/BO/TrustPay_/TrustPay.cs
  12. +72
    -0
      B3QingDaoWanFu/Tasks/CreatGatheringTask.cs
  13. +10
    -5
      B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs
  14. +1
    -0
      B3QingDaoWanFu/Utils/B3QingDaoWanFuConsts.cs
  15. BIN
      WebFolder/Template/产品出厂记录模板.xlsx
  16. +18
    -1
      WebFolder/config/plugins/B3QingDaoWanFu.plugin

+ 16
- 0
B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj View File

@ -90,6 +90,10 @@
<Private>False</Private>
</Reference>
<Reference Include="BWPTrustPayClient, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\BwpB3Project\tsref\Debug\Forks.EnterpriseServices.dll</HintPath>
@ -164,6 +168,15 @@
<Compile Include="Pages\B3QingDaoWanFu\Bills\CostRecord_\CostRecordPrint.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\Bills\OutFactoryRecord_\OutFactoryRecordEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\Bills\OutFactoryRecord_\OutFactoryRecordImport.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\Bills\OutFactoryRecord_\OutFactoryRecordList.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\CustomerDeviceSet_\CustomerDeviceSetEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -272,6 +285,9 @@
<ItemGroup>
<EmbeddedResource Include="Pages\B3QingDaoWanFu\Reports\PayAnalyse.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3QingDaoWanFu\Bills\OutFactoryRecord_\OutFactoryRecordList.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.


+ 100
- 0
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/OutFactoryRecord_/OutFactoryRecordEdit.cs View File

@ -0,0 +1,100 @@
using BWP.B3QingDaoWanFu.BL;
using BWP.B3QingDaoWanFu.BO;
using BWP.Web.CustomPageLayout;
using BWP.Web.Layout;
using BWP.Web.WebControls;
using Forks.EnterpriseServices.DataForm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using TSingSoft.WebControls2;
using TSingSoft.WebPluginFramework;
namespace BWP.Web.Pages.B3QingDaoWanFu.Bills.OutFactoryRecord_
{
partial class OutFactoryRecordEdit : DepartmentWorkFlowBillEditPage<OutFactoryRecord, IOutFactoryRecordBL>
{
protected override void BuildBody(Control control)
{
base.BuildBody(control);
AddDetail(control.EAdd(new TitlePanel("记录明细", "记录明细")));
}
protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, PageLayoutSection pageLayoutSection)
{
var layoutManager = new LayoutManager("", mDFInfo, mDFContainer);
var config = new AutoLayoutConfig();
layoutManager.Config = config;
config.Add("AccountingUnit_ID");
config.Add("Department_ID");
config.Add("Date");
pageLayoutSection.SetRequired("AccountingUnit_ID", "Department_ID");
pageLayoutSection.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo);
titlePanel.Controls.Add(layoutManager.CreateLayout());
}
private DFEditGrid _detailGrid;
private void AddDetail(TitlePanel titlePanel)
{
var vPanel = new VLayoutPanel();
titlePanel.Controls.Add(vPanel);
if (CanSave)
{
var hPanel = vPanel.Add(new HLayoutPanel(), new VLayoutOption(HorizontalAlign.Left));
var oFileDialog = hPanel.Add(new FileUpload());
oFileDialog.Controls.Clear();
var btn = hPanel.Add(new TSButton("导入明细", delegate
{
if (string.IsNullOrEmpty(oFileDialog.FileName))
throw new Exception("请选择要导入的Excel文件");
Import(oFileDialog.PostedFile.InputStream);
AspUtil.Alert(this, "导入成功!");
}));
btn.OnClientClick = "if(__DFContainer.getValue('Date')=='') {alert('请选择屠宰日期');return false;}";
var link = hPanel.Add(new HyperLink());
link.Text = "模板下载";
link.NavigateUrl = WpfPageUrl.ToGlobal(AspUtil.AddTimeStampToUrl("~/Template/产品出厂记录模板.xlsx"));
link.Target = "_blank";
}
var detailEditor = new DFCollectionEditor<OutFactoryRecord_Detail>(() => Dmo.Details);
detailEditor.AllowDeletionFunc = () => CanSave;
detailEditor.CanDeleteFunc = (detail) => CanSave;
detailEditor.IsEditableFunc = (field, detail) => false;
_detailGrid = vPanel.Add(new DFEditGrid(detailEditor) { Width = Unit.Percentage(100) });
_detailGrid.Columns.Add(new DFEditGridColumn("OutDate"));
_detailGrid.Columns.Add(new DFEditGridColumn("CustomerName"));
_detailGrid.Columns.Add(new DFEditGridColumn("GoodsName"));
_detailGrid.Columns.Add(new DFEditGridColumn("Number"));
_detailGrid.Columns.Add(new DFEditGridColumn("SaleUnit"));
_detailGrid.Columns.Add(new DFEditGridColumn("AnimalTest"));
_detailGrid.Columns.Add(new DFEditGridColumn("MeatTest"));
_detailGrid.Columns.Add(new DFEditGridColumn("PigSource"));
_detailGrid.Columns.Add(new DFEditGridColumn("TestMan"));
var section2 = mPageLayoutManager.AddSection("detailColumns1", "记录明细");
section2.ApplyLayout(_detailGrid, mPageLayoutManager, DFInfo.Get(typeof(OutFactoryRecord_Detail)));
titlePanel.SetPageLayoutSetting(mPageLayoutManager, section2.Name);
}
public override void GetFromUI()
{
base.GetFromUI();
_detailGrid.GetFromUI();
}
public override void AppToUI()
{
base.AppToUI();
_detailGrid.DataBind();
}
}
}

+ 119
- 0
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/OutFactoryRecord_/OutFactoryRecordImport.cs View File

@ -0,0 +1,119 @@
using BWP.B3ButcherManage.BO;
using BWP.B3QingDaoWanFu.BO;
using BWP.B3UnitedInfos.DataExchange;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework;
namespace BWP.Web.Pages.B3QingDaoWanFu.Bills.OutFactoryRecord_
{
partial class OutFactoryRecordEdit
{
void Import(Stream fileStream)
{
GetFromUI();
var supplier = GetButcherSupplier();
var man = new ExcelImportManager();
var outDateColumn = man.Add(new ExecelImportColumn()
{
Name = "出厂日期",
Required = false,
Nullable = true
});
var customerColumn = man.Add(new ExecelImportColumn()
{
Name = "业主信息",
Required = false,
Nullable = true
});
var goodsNameColumn = man.Add(new ExecelImportColumn()
{
Name = "销售品种",
Required = false,
Nullable = true
});
var numberColumn = man.Add(new ExecelImportColumn()
{
Name = "数量",
Required = false,
Nullable = true
});
var saleUnitColumn = man.Add(new ExecelImportColumn()
{
Name = "销售市场",
Required = false,
Nullable = true
});
var animalTestColumn = man.Add(new ExecelImportColumn()
{
Name = "动检证号",
Required = false,
Nullable = true
});
var meatTestColumn = man.Add(new ExecelImportColumn()
{
Name = "肉质检验证号",
Required = false,
Nullable = true
});
var testManColumn = man.Add(new ExecelImportColumn()
{
Name = "检验人员",
Required = false,
Nullable = true
});
var details = new List<OutFactoryRecord_Detail>();
foreach (var row in man.Parse(fileStream))
{
var detail = new OutFactoryRecord_Detail();
detail.OutDate = outDateColumn.GetNullableValue<DateTime>(row);
detail.CustomerName = customerColumn.GetStringValue(row);
detail.GoodsName = goodsNameColumn.GetStringValue(row);
detail.Number = numberColumn.GetNullableValue<decimal>(row);
detail.SaleUnit = saleUnitColumn.GetStringValue(row);
detail.AnimalTest = animalTestColumn.GetStringValue(row);
detail.MeatTest = meatTestColumn.GetStringValue(row);
detail.TestMan = testManColumn.GetStringValue(row);
detail.PigSource = supplier;
details.Add(detail);
}
foreach (var detail in details)
Dmo.Details.Add(detail);
_detailGrid.DataBind();
}
string GetButcherSupplier()
{
var order = new JoinAlias(typeof(ButcherOrder));
var orderDetail = new JoinAlias(typeof(ButcherOrder_Detail));
var weight = new JoinAlias(typeof(WeighBill));
var query = new DQueryDom(order);
query.From.AddJoin(JoinType.Left, new DQDmoSource(orderDetail), DQCondition.EQ(order, "ID", orderDetail, "ButcherOrder_ID"));
query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.EQ(orderDetail, "WeighBill_ID", weight, "ID"));
query.Where.Conditions.Add(DQCondition.EQ("Date", Dmo.Date));
query.Columns.Add(DQSelectColumn.Field("Supplier_Name", weight));
query.Range = SelectRange.Top(5);
var result = query.EExecuteList<string>();
var name = string.Join(",", result);
if (result.Count > 5)
return name + ",……";
else
return name;
}
}
}

+ 36
- 0
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/OutFactoryRecord_/OutFactoryRecordList.cs View File

@ -0,0 +1,36 @@
using BWP.B3QingDaoWanFu.BL;
using BWP.B3QingDaoWanFu.BO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3QingDaoWanFu.Bills.OutFactoryRecord_
{
class OutFactoryRecordList : DomainBillListPage<OutFactoryRecord, IOutFactoryRecordBL>
{
protected override void AddQueryControls(VLayoutPanel vPanel)
{
vPanel.Add(CreateDefaultBillQueryControls((panel, config) =>
{
config.AddAfter("Date", "BillState");
config.AddAfter("AccountingUnit_ID", "Date");
config.AddAfter("Department_ID", "AccountingUnit_ID");
config.Remvoe("Remark");
}));
}
protected override void AddDFBrowseGridColumn(DFBrowseGrid grid, string field)
{
base.AddDFBrowseGridColumn(grid, field);
if (field == "BillState")
{
AddDFBrowseGridColumn(grid, "Date");
AddDFBrowseGridColumn(grid, "AccountingUnit_Name");
AddDFBrowseGridColumn(grid, "Department_Name");
AddDFBrowseGridColumn(grid, "CheckUser_Name");
}
}
}
}

+ 58
- 0
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/OutFactoryRecord_/OutFactoryRecordList.xml View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
<Field name="ID"/>
</Columns>
<From>
<DmoClass class="BWP.B3QingDaoWanFu.BO.OutFactoryRecord, B3QingDaoWanFu"/>
</From>
<Where>
<And>
<EQ>
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<EQ>
<Field name="AccountingUnit_ID"/>
<QBE paramName="AccountingUnit_ID"/>
</EQ>
<EQ>
<Field name="Department_ID"/>
<QBE paramName="Department_ID"/>
</EQ>
<EQ>
<Field name="IsLocked"/>
<QBE paramName="IsLocked"/>
</EQ>
<Contains>
<Field name="CreateUser_Name"/>
<QBE paramName="CreateUser_Name"/>
</Contains>
<Contains>
<Field name="CheckUser_Name"/>
<QBE paramName="CheckUser_Name"/>
</Contains>
<GreaterThanOrEqual>
<Field name="CreateTime"/>
<QBE paramName="MinCreateTime" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="CreateTime"/>
<QBE paramName="MaxCreateTime"/>
</LessThanOrEqual>
<GreaterThanOrEqual>
<Field name="Date"/>
<QBE paramName="MinDate" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="Date"/>
<QBE paramName="MaxDate"/>
</LessThanOrEqual>
<EQ>
<Field name="BillState"/>
<QBE paramName ="BillState"/>
</EQ>
</And>
</Where>
</Select>

+ 3
- 0
B3QingDaoWanFu.Web/PluginClass.cs View File

@ -13,6 +13,7 @@ using TSingSoft.WebPluginFramework;
using TSingSoft.WebPluginFramework.Pages;
using TSingSoft.WebPluginFramework.TimerTasks;
using BWP.Web.Pages.B3ButcherManage.Bills.WeighBill_;
using BWP.B3ProduceUnitedInfos;
namespace BWP.B3QingDaoWanFu
{
@ -35,8 +36,10 @@ namespace BWP.B3QingDaoWanFu
GlobalFlags.On(B3SaleConsts.Flags.CustAcceptAnalyseHasFactoryPrice);
GlobalFlags.On(B3ButcherManageConsts.GlobalFlags.);
GlobalFlags.On(B3SaleConsts.Flags.EnableABCPay);
GlobalFlags.On(B3ProduceUnitedInfosConsts.GlobalFlags.Car_UseDriver);
TimerConfig.Register(() => "* * * * *", new QueryTrustPayTask());
TimerConfig.Register(() => "*/5 * * * *", new QueryNoGatheringTrustPayTask());
}
}
}

+ 4
- 0
B3QingDaoWanFu/B3QingDaoWanFu.csproj View File

@ -154,11 +154,14 @@
<Compile Include="BLActions\SaleOrderBLAction.cs" />
<Compile Include="BLActions\SaleOutStoreBLActions.cs" />
<Compile Include="BL\Bill\CostRecordBL\CostRecordBL.cs" />
<Compile Include="BL\Bill\OutFactoryRecordBL\OutFactoryRecordBL.cs" />
<Compile Include="BL\TrustPayBL.cs" />
<Compile Include="BL\CustomerDeviceSetBL.cs" />
<Compile Include="BL\ExportBL\GoodsExportBL.cs" />
<Compile Include="BO\Bill\CostRecord\CostRecord.cs" />
<Compile Include="BO\Bill\CostRecord\CostRecord_Detail.cs" />
<Compile Include="BO\Bill\OutFactoryRecord\OutFactoryRecord.cs" />
<Compile Include="BO\Bill\OutFactoryRecord\OutFactoryRecord_Detail.cs" />
<Compile Include="BO\TrustPay_\TrustPay.cs" />
<Compile Include="BO\CustomerDeviceSet.cs" />
<Compile Include="BO\SaleOutStoreBarCodeToMESLog.cs" />
@ -169,6 +172,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rpc\TrustPayRpc.cs" />
<Compile Include="Rpc\GatheringRpc.cs" />
<Compile Include="Tasks\CreatGatheringTask.cs" />
<Compile Include="Tasks\RecheckTrustPayTask.cs" />
<Compile Include="Tasks\SyncSaleOutStoreInfoToMES.cs" />
<Compile Include="TypeIOCs\GoodsBLTypeIoc.cs" />


+ 20
- 0
B3QingDaoWanFu/BL/Bill/OutFactoryRecordBL/OutFactoryRecordBL.cs View File

@ -0,0 +1,20 @@
using BWP.B3Frameworks.BL;
using BWP.B3QingDaoWanFu.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.BusinessInterfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3QingDaoWanFu.BL
{
[LogicName("产品出厂记录")]
[BusinessInterface(typeof(OutFactoryRecordBL))]
public interface IOutFactoryRecordBL : IDepartmentWorkFlowBillBL<OutFactoryRecord>
{ }
public class OutFactoryRecordBL : DepartmentWorkFlowBillBL<OutFactoryRecord>, IOutFactoryRecordBL
{
}
}

+ 29
- 0
B3QingDaoWanFu/BO/Bill/OutFactoryRecord/OutFactoryRecord.cs View File

@ -0,0 +1,29 @@
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3QingDaoWanFu.BO
{
[Serializable, DFClass, LogicName("产品出厂记录")]
[DmoTypeID(B3FrameworksConsts.DmoTypeIDBases.B3QingDaoWanFu, B3QingDaoWanFuConsts.DmoTypeIDOffsets.OutFactoryRecord)]
[DFCPrompt("部门", Property = "Department_ID")]
[DFCPrompt("部门", Property = "Department_Name")]
public class OutFactoryRecord : DepartmentWorkFlowBill
{
private DateTime? date = DateTime.Today;
[LogicName("屠宰日期")]
[DFNotEmpty]
public DateTime? Date { get { return date; } set { date = value; } }
private readonly OutFactoryRecord_DetailCollection mDetails = new OutFactoryRecord_DetailCollection();
[OneToMany(typeof(OutFactoryRecord_Detail), "ID")]
[Join("ID", "OutFactoryRecord_ID")]
public OutFactoryRecord_DetailCollection Details { get { return mDetails; } }
}
}

+ 54
- 0
B3QingDaoWanFu/BO/Bill/OutFactoryRecord/OutFactoryRecord_Detail.cs View File

@ -0,0 +1,54 @@
using BWP.B3Frameworks.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.Utils;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
namespace BWP.B3QingDaoWanFu.BO
{
[Serializable, DFClass, LogicName("产品出厂记录_明细")]
public class OutFactoryRecord_Detail : Base
{
public long OutFactoryRecord_ID { get; set; }
[LogicName("出厂日期")]
public DateTime? OutDate { get; set; }
[LogicName("购货业主姓名及联系方式")]
[DbColumn(DbType = SqlDbType.NVarChar, Length = 200)]
public string CustomerName { get; set; }
[LogicName("销售品种")]
public string GoodsName { get; set; }
[LogicName("数量(头数或公斤)")]
public Money<decimal>? Number { get; set; }
[LogicName("销售市场或单位")]
[DbColumn(DbType = SqlDbType.NVarChar, Length = 200)]
public string SaleUnit { get; set; }
[LogicName("动物检疫合格证编号")]
public string AnimalTest { get; set; }
[LogicName("肉品品质检验合格证编号")]
public string MeatTest { get; set; }
[LogicName("生猪来源(生猪货主姓名)")]
[DbColumn(DbType = SqlDbType.NVarChar, Length = 200)]
public string PigSource { get; set; }
[LogicName("检验人员")]
public string TestMan { get; set; }
}
[Serializable]
public class OutFactoryRecord_DetailCollection : DmoCollection<OutFactoryRecord_Detail>
{
}
}

+ 3
- 0
B3QingDaoWanFu/BO/TrustPay_/TrustPay.cs View File

@ -59,6 +59,9 @@ namespace BWP.B3QingDaoWanFu.BO {
[DbColumn(DefaultValue = 0)]
public bool ReChecked { get; set; }
[DbColumn(DefaultValue = 0)]
public int ReCheckCount { get; set; }
[ReferenceTo(typeof(Customer), "Name")]
[Join("AccountCustomer_ID", "ID")]
[LogicName("结账客户")]


+ 72
- 0
B3QingDaoWanFu/Tasks/CreatGatheringTask.cs View File

@ -0,0 +1,72 @@
using System;
using BWP.B3Frameworks;
using BWP.B3Frameworks.Utils;
using BWP.B3QingDaoWanFu.BL;
using BWP.B3QingDaoWanFu.BO;
using BWP.B3QingDaoWanFu.BO.NamedValueTemplate;
using BWP.B3QingDaoWanFu.Utils;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using TSingSoft.WebPluginFramework;
using TSingSoft.WebPluginFramework.QueueTasks;
using TSingSoft.WebPluginFramework.TimerTasks;
namespace BWP.B3QingDaoWanFu.Tasks {
[Serializable]
public class QueryNoGatheringTrustPayTask : ITimerTask {
public void Execute() {
var query = new DQueryDom(new JoinAlias(typeof(TrustPay)));
query.Where.Conditions.Add(DQCondition.EQ("PayState", .));
query.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field("Gathering_ID")));
query.Where.Conditions.Add(DQCondition.GreaterThan("CreateTime", BLContext.Now.AddDays(-1)));
query.Columns.Add(DQSelectColumn.Field("ID"));
var list = query.EExecuteList<long>();
foreach (var id in list) {
QueueTaskService.Add(new CreatGatheringTask(id));
}
}
public string Name {
get { return "꿴璂灌눼쉔澗운데돨크契마운"; }
}
}
[Serializable]
public class CreatGatheringTask : ITimerTask {
private readonly long _trustPayID;
public CreatGatheringTask() {
}
public CreatGatheringTask(long id) {
_trustPayID = id;
}
public void Execute() {
using (var session = Dmo.NewSession()) {
var config = new WanFuOnlineConfig();
var bl = BIFactory.Create<ITrustPayBL>(session);
long gatheringID;
var trustPay = InnerBLUtil.GetSingleDmo<TrustPay>(session, "ID", _trustPayID, "AccountCustomer_ID", "PayState", "Gathering_ID", "Money", "Domain_ID");
using (new SpecialDomainUserBLScope(config.DomainUserForTrustPay.Value)) {
bl.CreateGathering(trustPay, out gatheringID);
}
trustPay.Gathering_ID = gatheringID;
InnerBLUtil.UpdateEntityProperties(session, trustPay, "Gathering_ID");
session.Commit();
}
}
public string Name {
get {
return string.Format(string.Format("마운데No.{0}껸쩌澗운데", _trustPayID));
}
}
}
}

+ 10
- 5
B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs View File

@ -22,8 +22,11 @@ namespace BWP.B3QingDaoWanFu.Tasks {
var query = new DQueryDom(new JoinAlias(typeof(TrustPay)));
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("PayState", .));
query.Where.Conditions.Add(DQCondition.LessThanOrEqual("ReCheckTime", BLContext.Now));
query.Where.Conditions.Add(DQCondition.GreaterThan("CreateTime", BLContext.Now.AddHours(-5)));
query.Where.Conditions.Add(DQCondition.EQ("ReChecked", false));
query.Where.Conditions.Add(DQCondition.LessThan("ReCheckCount", 6));
query.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field("Gathering_ID")));
query.Columns.Add(DQSelectColumn.Field("ID"));
var list = query.EExecuteList<long>();
foreach (var id in list) {
@ -60,10 +63,11 @@ namespace BWP.B3QingDaoWanFu.Tasks {
if (trustPay == null || trustPay.AccountCustomer_ID == null)
return;
trustPay.ID = _trustPayID;
trustPay.ReCheckCount++;
if (trustPay.Gathering_ID > 0) {
if (!trustPay.ReChecked) {
trustPay.ReChecked = true;
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReChecked");
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReChecked", "ReCheckCount");
session.Commit();
}
return;
@ -85,7 +89,7 @@ namespace BWP.B3QingDaoWanFu.Tasks {
var config = new WanFuOnlineConfig();
using (new SpecialDomainUserBLScope(config.DomainUserForTrustPay.Value)) {
bl.CreateGathering(trustPay, out gatheringID);
}
}
if (gatheringID > 0) {
trustPay.Gathering_ID = gatheringID;
}
@ -98,7 +102,8 @@ namespace BWP.B3QingDaoWanFu.Tasks {
using (var session = Dmo.NewSession()) {
trustPay.ReChecked = trustPay.Gathering_ID > 0;
InnerBLUtil.UpdateEntityProperties(session, trustPay, "Gathering_ID", "PayState", "ReChecked");
InnerBLUtil.UpdateEntityProperties(session, trustPay, "Gathering_ID", "PayState", "ReChecked", "ReCheckCount");
session.Commit();
}
if (!string.IsNullOrEmpty(msg))
@ -118,12 +123,12 @@ namespace BWP.B3QingDaoWanFu.Tasks {
if (res.Status == "01" || res.Status == "02" || res.Status == "03") {
trustPay.ReCheckTime = BLContext.Now.AddMinutes(5);
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReCheckTime");
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReCheckTime", "ReCheckCount");
session.Commit();
return false;
}
trustPay.ReChecked = true;
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReChecked");
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReChecked", "ReCheckCount");
session.Commit();
return false;
}


+ 1
- 0
B3QingDaoWanFu/Utils/B3QingDaoWanFuConsts.cs View File

@ -10,6 +10,7 @@ namespace BWP.B3QingDaoWanFu
internal static class DmoTypeIDOffsets
{
public const byte GoodsExport = 1;
public const byte OutFactoryRecord = 3;
}
}
}

BIN
WebFolder/Template/产品出厂记录模板.xlsx View File


+ 18
- 1
WebFolder/config/plugins/B3QingDaoWanFu.plugin View File

@ -16,6 +16,7 @@
<ContentFiles>
<Folder name="config/billreports"/>
<File name="Web.Config" overwrite="true"/>
<Folder name="Template" overwrite="true"/>
</ContentFiles>
<DbResources></DbResources>
@ -50,6 +51,21 @@
<Function index="11" name="撤销完毕"/>
<Function index="12" name="打印"/>
</FunctionGroup>
<FunctionGroup name="产品出厂记录" roleSchemas="employee">
<Function index="0" name="访问" />
<Function index="1" name="新建" />
<Function index="2" name="编辑" />
<Function index="3" name="删除" />
<Function index="4" name="审核" />
<Function index="5" name="撤销" />
<Function index="6" name="锁定" />
<Function index="7" name="解锁" />
<Function index="8" name="管理" />
<Function index="9" name="作废" />
<Function index="10" name="完毕"/>
<Function index="11" name="撤销完毕"/>
<Function index="12" name="打印"/>
</FunctionGroup>
<FunctionGroup name="农行付款" roleSchemas="employee">
<Function index="0" name="访问" />
<Function index="1" name="新建" />
@ -64,7 +80,8 @@
<Menu id="0005" name="/B3青岛万福/报表/付款清单导出" roles="B3QingDaoWanFu.报表.付款清单导出" url="B3QingDaoWanFu/Reports/PayInfoExport.aspx"/>
<Menu id="0006" name="/B3青岛万福/业务单据/费用录入" roles="B3QingDaoWanFu.费用录入.访问" url="B3QingDaoWanFu/Bills/CostRecord_/CostRecordList.aspx"/>
<Menu id="0007" name="/B3青岛万福/报表/万福销售出库分析" roles="B3QingDaoWanFu.报表.销售出库分析" url="B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.aspx"/>
<Menu id="0008" name="/B3青岛万福/农行付款" roles="B3QingDaoWanFu.农行付款.访问" url="B3QingDaoWanFu/TrustPay_/TrustPayList.aspx"/>
<Menu id="0008" name="/B3青岛万福/农行付款" roles="B3QingDaoWanFu.农行付款.访问" url="B3QingDaoWanFu/TrustPay_/TrustPayList.aspx"/>
<Menu id="0009" name="/B3青岛万福/业务单据/产品出厂记录" roles="B3QingDaoWanFu.产品出厂记录.访问" url="B3QingDaoWanFu/Bills/OutFactoryRecord_/OutFactoryRecordList.aspx"/>
</Menus>
<Features>


Loading…
Cancel
Save