|
@@ -25,7 +25,7 @@ public class StoreApplyHelper
|
|
// 每月1号重置仓库额度
|
|
// 每月1号重置仓库额度
|
|
// 固定额度=上月出货额度与保底额度之间的最高值
|
|
// 固定额度=上月出货额度与保底额度之间的最高值
|
|
// 已用额度=仓库中机具占用额度+小分仓机具占用额度+申请补货订单占用额度
|
|
// 已用额度=仓库中机具占用额度+小分仓机具占用额度+申请补货订单占用额度
|
|
- // 可用额度=重置后的固定额度+被担保额度+临时额度-已用额度
|
|
|
|
|
|
+ // 可用额度=重置后的固定额度+被担保额度+临时额度-已用额度-小分仓未授权额度
|
|
private void DoWorks()
|
|
private void DoWorks()
|
|
{
|
|
{
|
|
while (true)
|
|
while (true)
|
|
@@ -136,6 +136,17 @@ public class StoreApplyHelper
|
|
{
|
|
{
|
|
AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
|
|
AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
|
|
}
|
|
}
|
|
|
|
+ //除开小分仓未授权机具
|
|
|
|
+ dtmore = OtherMySqlConn.dtable("select count(Id)*200 from PreSendStockDetail pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (1,2,4,6,7,8) and `Status`=1");
|
|
|
|
+ if(dtmore.Rows.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ AmountMore -= decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
|
|
|
|
+ }
|
|
|
|
+ dtmore = OtherMySqlConn.dtable("select count(Id)*300 from PreSendStockDetail pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (3,5,9) and `Status`=1");
|
|
|
|
+ if(dtmore.Rows.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ AmountMore -= decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
|
|
|
|
+ }
|
|
//申请补货订单占用额度
|
|
//申请补货订单占用额度
|
|
dt = OtherMySqlConn.dtable("select UseAmount from StoreMachineApply where UserId=" + UserId + " and Status=0");
|
|
dt = OtherMySqlConn.dtable("select UseAmount from StoreMachineApply where UserId=" + UserId + " and Status=0");
|
|
foreach(DataRow dr in dt.Rows)
|
|
foreach(DataRow dr in dt.Rows)
|
|
@@ -260,14 +271,18 @@ public class StoreApplyHelper
|
|
foreach(string SnIdString in SnIdList)
|
|
foreach(string SnIdString in SnIdList)
|
|
{
|
|
{
|
|
int SnId = int.Parse(SnIdString);
|
|
int SnId = int.Parse(SnIdString);
|
|
- PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == SnId) ?? new PosMachinesTwo();
|
|
|
|
- if(pos.BrandId == 1 || pos.BrandId == 2 || pos.BrandId == 4 || pos.BrandId == 6 || pos.BrandId == 7 || pos.BrandId == 8)
|
|
|
|
- {
|
|
|
|
- Amount += 200;
|
|
|
|
- }
|
|
|
|
- else if(pos.BrandId == 3 || pos.BrandId == 5 || pos.BrandId == 9)
|
|
|
|
|
|
+ PreSendStockDetail prepos = db.PreSendStockDetail.FirstOrDefault(m => m.SnId == SnId && m.Status == 1 && m.ApplyFlag == 1) ?? new PreSendStockDetail();
|
|
|
|
+ if(prepos.AuthFlag == 0)
|
|
{
|
|
{
|
|
- Amount += 300;
|
|
|
|
|
|
+ PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == SnId) ?? new PosMachinesTwo();
|
|
|
|
+ if(pos.BrandId == 1 || pos.BrandId == 2 || pos.BrandId == 4 || pos.BrandId == 6 || pos.BrandId == 7 || pos.BrandId == 8)
|
|
|
|
+ {
|
|
|
|
+ Amount += 200;
|
|
|
|
+ }
|
|
|
|
+ else if(pos.BrandId == 3 || pos.BrandId == 5 || pos.BrandId == 9)
|
|
|
|
+ {
|
|
|
|
+ Amount += 300;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(Amount > 0)
|
|
if(Amount > 0)
|