diff --git a/B3QingDaoWanFu/B3QingDaoWanFu.csproj b/B3QingDaoWanFu/B3QingDaoWanFu.csproj index 220c365..be69854 100644 --- a/B3QingDaoWanFu/B3QingDaoWanFu.csproj +++ b/B3QingDaoWanFu/B3QingDaoWanFu.csproj @@ -11,7 +11,8 @@ B3QingDaoWanFu v4.0 512 - BwpApp + BwpApp + true full @@ -33,65 +34,96 @@ False D:\BwpB3Project\tsref\Debug\B3ButcherManage.dll - False + False + False D:\BwpB3Project\tsref\Debug\B3ButcherManage.Web.dll - False + False + False D:\BwpB3Project\tsref\Debug\B3Frameworks.dll - False + False + False D:\BwpB3Project\tsref\Debug\B3Frameworks.Web.dll - False + False + False D:\BwpB3Project\tsref\Debug\B3Procurement.dll - False + False + False D:\BwpB3Project\tsref\Debug\B3ProcurementInterface.dll - False + False + False D:\BwpB3Project\tsref\Debug\B3ProduceUnitedInfos.dll - False + False + False D:\BwpB3Project\tsref\Debug\B3UnitedInfos.dll - False + False + False D:\BwpB3Project\tsref\Debug\Forks.EnterpriseServices.dll - False + False + False D:\BwpB3Project\tsref\Debug\Forks.Utils.dll - False - False - False - False - False - False - False - False + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + False D:\BwpB3Project\tsref\Debug\TSingSoft.WebControls2.dll - False + False + False D:\BwpB3Project\tsref\Debug\Wpf.dll - False + False + False D:\BwpB3Project\tsref\Debug\Wpf.System.dll - False + False + - Customer_version.cs + + Customer_version.cs + + + diff --git a/B3QingDaoWanFu/DataPatchs/StatPaySetBillNeedValue20171123.cs b/B3QingDaoWanFu/DataPatchs/StatPaySetBillNeedValue20171123.cs new file mode 100644 index 0000000..21c1ea5 --- /dev/null +++ b/B3QingDaoWanFu/DataPatchs/StatPaySetBillNeedValue20171123.cs @@ -0,0 +1,55 @@ +using Forks.EnterpriseServices.BusinessInterfaces; +using TSingSoft.WebPluginFramework.Install; + +namespace BWP.B3QingDaoWanFu.DataPatchs +{ + + [DataPatch] + public class StatPaySetBillNeedValue : IDataPatch + { + public void Execute(TransactionContext context) + { + //更新异常金额 + var sql = @"with cte (id,mmoney) +as ( +select bill.ID,sum(detail.money) +from dbo.B3ButcherManage_Statpay bill left join B3ButcherManage_StatPay_Exception detail on bill.ID=detail.StatPay_ID +group by bill.ID +) +update bill set bill.ExceptionMoney=c.mmoney from dbo.B3ButcherManage_Statpay bill left join cte c on bill.ID=c.id;"; + context.Session.ExecuteSqlNonQuery(sql); + + ////更新奖罚金额 + sql = @"with cte1 (id,mmoney) +as ( +select bill.ID,sum(detail.[money]) +from dbo.B3ButcherManage_Statpay bill left join B3ButcherManage_StatPay_OtherReward detail on bill.ID=detail.StatPay_ID +group by bill.ID +) +update bill set bill.OtherRewardMoney=c.mmoney from dbo.B3ButcherManage_Statpay bill left join cte1 c on bill.ID=c.id;"; + context.Session.ExecuteSqlNonQuery(sql); + + //死猪奖罚金额 + sql = @"with cte2 (id,mmoney) +as ( +select bill.ID,sum(detail.[money]) +from dbo.B3ButcherManage_Statpay bill left join B3ButcherManage_StatPay_OtherReward detail on bill.ID=detail.StatPay_ID +where detail.Sanction_ID=36 +group by bill.ID +) +update bill set bill.DeadPigRewardMoney=c.mmoney from dbo.B3ButcherManage_Statpay bill left join cte2 c on bill.ID=c.id;"; + context.Session.ExecuteSqlNonQuery(sql); + + //明细等级 + sql = @"with cte3 (id,HogGrade_ID) +as ( +select bill.ID,detail.HogGrade_ID +from dbo.B3ButcherManage_Statpay bill left join B3ButcherManage_StatPay_Butcher detail on bill.ID=detail.StatPay_ID +group by bill.ID,detail.HogGrade_ID +) +update bill set bill.HogGrade_ID=c.HogGrade_ID from dbo.B3ButcherManage_Statpay bill left join cte3 c on bill.ID=c.id;;"; + context.Session.ExecuteSqlNonQuery(sql); + + } + } +}