yidi.wu 10 months ago
parent
commit
737ca31de0
  1. 236
      北京北汽/Controller/SCP_ASK_CONTROLLER.cs
  2. 47
      北京北汽/Controller/SCP_PO_CONTROLLER.cs
  3. 1
      北京北汽/Models/CK.SCP.Models.csproj
  4. 1
      北京北汽/Models/ScpEntities.cs
  5. 4
      北京北汽/Models/ScpEntity/V_TB_ASK.cs
  6. 54
      北京北汽/Models/ScpEntity/V_TB_ASK_DETAIL_PO.cs
  7. 8
      北京北汽/SCP/SCP.csproj
  8. 27
      北京北汽/SCP/Views/PlanData/SCP_ASK.aspx
  9. 21
      北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs
  10. 53
      北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.designer.cs
  11. 5
      北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx
  12. 4
      北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs
  13. 103
      北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx
  14. 161
      北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx.cs
  15. 179
      北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx.designer.cs

236
北京北汽/Controller/SCP_ASK_CONTROLLER.cs

@ -11,6 +11,8 @@ using CK.SCP.Utils;
using System.Data.Entity.Core;
using System.Web;
using CK.SCP.Models.AppBoxEntity;
using System.Data.SqlClient;
using System.Collections;
namespace CK.SCP.Controller
{
@ -93,7 +95,7 @@ namespace CK.SCP.Controller
}
if (!string.IsNullOrEmpty(p_entity.CreateUser))
{
q = q.Where(p => p.CreateUser==p_entity.CreateUser);
q = q.Where(p => p.CreateUser == p_entity.CreateUser);
}
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
@ -151,7 +153,8 @@ namespace CK.SCP.Controller
}
else
{
if (ex.InnerException != null) {
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_List", ex.InnerException.Message);
throw ex.InnerException;
}
@ -172,7 +175,7 @@ namespace CK.SCP.Controller
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
var site=db.TB_ASK.FirstOrDefault(p=>p.AskBillNum==ASK);
var site = db.TB_ASK.FirstOrDefault(p => p.AskBillNum == ASK);
return site;
}
}
@ -191,19 +194,19 @@ namespace CK.SCP.Controller
foreach (var itm in p_entitys)
{
var _entity = db.TB_ASK_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault();
_entity.ReduceQty= itm.ReduceQty;
_entity.ReduceQty = itm.ReduceQty;
_entity.Remark = itm.Remark;
var asn = db.V_TB_ASN_DETAIL.Where(p => p.PoBillNum == itm.PoBillNum &&p.AskBillNum==itm.AskBillNum && p.IsDeleted == false )
.GroupBy(p => new { p.PoBillNum,p.AskBillNum, p.PoLine, p.PartCode })
.Select(p => new { AsSum = p.Sum(item => item.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode,AskBillNum=p.Key.AskBillNum });
var asn = db.V_TB_ASN_DETAIL.Where(p => p.PoBillNum == itm.PoBillNum && p.AskBillNum == itm.AskBillNum && p.IsDeleted == false)
.GroupBy(p => new { p.PoBillNum, p.AskBillNum, p.PoLine, p.PartCode })
.Select(p => new { AsSum = p.Sum(item => item.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode, AskBillNum = p.Key.AskBillNum });
asn.ToList().ForEach(itm1 =>
{
if (itm.PoBillNum == itm1.PoBillNum && itm.PoLine == itm1.PoLine && itm.PartCode == itm1.PartCode && itm.AskBillNum==itm1.AskBillNum)
if (itm.PoBillNum == itm1.PoBillNum && itm.PoLine == itm1.PoLine && itm.PartCode == itm1.PartCode && itm.AskBillNum == itm1.AskBillNum)
{
if (itm.ReduceQty > itm.AskQty - itm1.AsSum )
if (itm.ReduceQty > itm.AskQty - itm1.AsSum)
{
_ret.MessageList.Add(string.Format("零件编号{0}零件名称{1}减产数量>要货数量-发货数量",itm.PartCode,itm.PartDesc1+itm.PartDesc2));
_ret.MessageList.Add(string.Format("零件编号{0}零件名称{1}减产数量>要货数量-发货数量", itm.PartCode, itm.PartDesc1 + itm.PartDesc2));
}
}
});
@ -294,7 +297,7 @@ namespace CK.SCP.Controller
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
var _list=p_list.Select(itm => itm.UID).ToList();
var _list = p_list.Select(itm => itm.UID).ToList();
var _ls = db.TB_ASK_DETAIL.Where(p => _list.Contains(p.UID)).ToList();
db.TB_ASK_DETAIL.RemoveRange(_ls);
@ -410,7 +413,7 @@ namespace CK.SCP.Controller
}
if (p_entity.Buyer != null)
{
q = q.Where(p => p.Buyer== p_entity.Buyer);
q = q.Where(p => p.Buyer == p_entity.Buyer);
}
if (p_entity.CreateUser != null)
{
@ -628,12 +631,12 @@ namespace CK.SCP.Controller
foreach (V_TB_INCOMPLETE_ASK _detail in p_list)
{
var reject = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == _detail.AskBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK&&p.BillType==3).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode }).Select(p => new { RejectSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode });
var reject = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == _detail.AskBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.BillType == 3).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode }).Select(p => new { RejectSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode });
reject.ToList().ForEach(itm =>
{
if (_detail.AskBillNum == itm.Remark && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode)
{
_detail.Number = _detail.Number+Math.Abs( itm.RejectSum);
_detail.Number = _detail.Number + Math.Abs(itm.RejectSum);
}
});
}
@ -735,7 +738,7 @@ namespace CK.SCP.Controller
//var arrive = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == _detail.AskBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.BillType == (int)ArriveBillType.Receive).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode }).Select(p => new { ArriveSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode });
//到货
var arrive = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == _detail.AskBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK &&p.Qty>0 ).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode }).Select(p => new { ArriveSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode });
var arrive = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == _detail.AskBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.Qty > 0).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode }).Select(p => new { ArriveSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode });
//退货
var reject = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == _detail.AskBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.Qty < 0).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode }).Select(p => new { ArriveSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode });
@ -791,7 +794,7 @@ namespace CK.SCP.Controller
}
});
_detail.OnRoadQty = Convert.ToDecimal( _detail.ShippedQty) - _detail.ArriveQty;
_detail.OnRoadQty = Convert.ToDecimal(_detail.ShippedQty) - _detail.ArriveQty;
}
}
@ -809,7 +812,7 @@ namespace CK.SCP.Controller
foreach (V_TB_ASK _detail in p_list)
{
_detail.Month = Convert.ToDateTime(_detail.EndTime).Month.ToString() + "月订单";
if (_detail.State==0|| _detail.State==1|| _detail.State == 2)
if (_detail.State == 0 || _detail.State == 1 || _detail.State == 2)
{
continue;
@ -819,7 +822,7 @@ namespace CK.SCP.Controller
continue;
}
var _ask = db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == _detail.AskBillNum && p.IsDeleted == false).ToList();
var _ask_can= Get_CAN_SHIPQTY(_ask.ToList()).Where(p=>p.CanQty>0).ToList();
var _ask_can = Get_CAN_SHIPQTY(_ask.ToList()).Where(p => p.CanQty > 0).ToList();
if (_ask_can.Count != 0)
{
@ -850,8 +853,8 @@ namespace CK.SCP.Controller
foreach (var itm in p_entitys)
{
var _entity = db.TB_ASK_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault();
askBill=_entity.AskBillNum;
_entity.BeginTime =(DateTime) itm.BeginTime;
askBill = _entity.AskBillNum;
_entity.BeginTime = (DateTime)itm.BeginTime;
beginTime = (DateTime)itm.BeginTime;
_entity.EndTime = (DateTime)itm.EndTime;
endTime = (DateTime)itm.EndTime;
@ -941,7 +944,7 @@ namespace CK.SCP.Controller
}
return _ret;
}
public static ResultObject<bool> Save_TB_ASK_DETAIL(List<TB_ASK_DETAIL> p_entitys,AskState p_state)
public static ResultObject<bool> Save_TB_ASK_DETAIL(List<TB_ASK_DETAIL> p_entitys, AskState p_state)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
@ -973,7 +976,8 @@ namespace CK.SCP.Controller
if (_item.AskBillNum.Contains("U"))
{
var _planList = db1.TB_PO_PLAN_EXTEND.Where(p => p.Domain == _item.Site && p.EndTime == _item.EndTime && p.PoBillNum == _item.PoBillNum).ToList();
_planList.ForEach(p => {
_planList.ForEach(p =>
{
var _first = _entityList.Where(itm => itm.PoBillNum == p.PoBillNum && itm.PartCode == p.PartCode && itm.EndTime == p.EndTime).FirstOrDefault();
if (_first != null)
{
@ -1141,8 +1145,8 @@ namespace CK.SCP.Controller
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
var _list=db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_askBillNum && p.IsDeleted==false).ToList();
var _lst=Get_CAN_SHIPQTY(_list);
var _list = db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_askBillNum && p.IsDeleted == false).ToList();
var _lst = Get_CAN_SHIPQTY(_list);
if (_lst.Select(p => p.CanQty).Sum() <= 0)
{
@ -1159,8 +1163,8 @@ namespace CK.SCP.Controller
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
var _ask= db.TB_ASK.Where(p => p.AskBillNum == p_ask.AskBillNum).FirstOrDefault();
_ask=ConvertHelper.GetObjectClone(_ask);
var _ask = db.TB_ASK.Where(p => p.AskBillNum == p_ask.AskBillNum).FirstOrDefault();
_ask = ConvertHelper.GetObjectClone(_ask);
_ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode();
_ask.GUID = Guid.NewGuid();
@ -1180,7 +1184,7 @@ namespace CK.SCP.Controller
int state = db.SaveChanges();
if (state != -1)
{
_ret.MessageList.Add("复制要货单号"+_ask.AskBillNum+",请去要货明细修改要货单订货日期和要货日期");
_ret.MessageList.Add("复制要货单号" + _ask.AskBillNum + ",请去要货明细修改要货单订货日期和要货日期");
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
@ -1254,7 +1258,7 @@ namespace CK.SCP.Controller
public static ResultObject<bool> Save_ASK_TO_ASN(V_TB_ASK p_ask, List<V_TB_ASK_DETAIL> p_order_list,string p_PlateNumber
public static ResultObject<bool> Save_ASK_TO_ASN(V_TB_ASK p_ask, List<V_TB_ASK_DETAIL> p_order_list, string p_PlateNumber
, string p_buyer, string p_buyerPhone)
{
ResultObject<bool> _ret = new ResultObject<bool>();
@ -1275,7 +1279,7 @@ namespace CK.SCP.Controller
_t.ReceiveUser = p_ask.Buyer;
_t.ReceiveTime = p_ask.BeginTime;
_t.VendId = p_ask.VendId;
_t.IsDeleted= false;//操作员
_t.IsDeleted = false;//操作员
_t.CreateTime = DateTime.Now;
_t.CreateUser = p_buyer;
_t.Site = p_ask.Site;
@ -1321,18 +1325,18 @@ namespace CK.SCP.Controller
_tDetail.LocUnit = itm.LocUnit;
_tDetail.UnConv = itm.UnConv;
_tDetail.State = _t.State;
_tDetail.Site= p_ask.Site;
_tDetail.Site = p_ask.Site;
_tDetail.ReceivedPort = itm.ReceivedPort;
_tDetail.SubSite = p_ask.SubSite;
_tDetail.Remark = itm.Remark;
_tDetail.GUID = Guid.NewGuid();
String str = itm.PartCode.Substring(0,3);
if((str== "EXP"||str== "SPA")&& (_t.SubSite== "ZZ01"|| _t.SubSite == "CQ01"))
String str = itm.PartCode.Substring(0, 3);
if ((str == "EXP" || str == "SPA") && (_t.SubSite == "ZZ01" || _t.SubSite == "CQ01"))
{
_tDetail.Batch = "000000";
}
String str2 = itm.PartCode.Substring(0, 5);
if(str2== "SPABJ"&&_t.Site== "BJBMPT")
if (str2 == "SPABJ" && _t.Site == "BJBMPT")
{
_tDetail.Batch = "000000";
}
@ -1370,11 +1374,11 @@ namespace CK.SCP.Controller
int state = db.SaveChanges();
if (state != -1)
{
var _askDetailList= db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_ask.AskBillNum && p.IsDeleted == false).ToList();//查询要货单明细
var _askDetailList = db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_ask.AskBillNum && p.IsDeleted == false).ToList();//查询要货单明细
var _lst = Get_CAN_SHIPQTY(_askDetailList);//算出可发数量
if (_lst.Select(p => p.CanQty).Sum() <= 0)//可发数量为零时,修改状态
{
var _ary=db.TB_ASK.Where(p => p.AskBillNum == p_ask.AskBillNum && p.IsDeleted == false).ToList();
var _ary = db.TB_ASK.Where(p => p.AskBillNum == p_ask.AskBillNum && p.IsDeleted == false).ToList();
_ary.ForEach(p => p.State = (int)AskState.Ship);
if (_ary.Count() > 0)
{
@ -1446,6 +1450,52 @@ namespace CK.SCP.Controller
return _ret;
}
/// <summary>
/// 要货看板零件号零件名称模糊查询
/// </summary>
/// <param name="p_list"></param>
/// <param name="PartCode"></param>
/// <param name="PartCodeDesc"></param>
/// <returns></returns>
public static List<V_TB_ASK> GET_Likesearch(List<V_TB_ASK> p_list, string PartCode, string PartCodeDesc)
{
if (string.IsNullOrEmpty(PartCode) && string.IsNullOrEmpty(PartCodeDesc))
{
return p_list;
}
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
var _ls = p_list.Select(p => p.AskBillNum).ToArray();
StringBuilder _buffer = new StringBuilder();
_buffer.Append(" SELECT Distinct(A.UID),A.* from V_TB_ASK A LEFT JOIN ");
_buffer.Append(" dbo.TB_ASK_DETAIL B on A.AskBillNum = B.AskBillNum and A.Site = B.Site LEFT JOIN ");
_buffer.Append(" dbo.TA_PART TP on TP.PartCode = B.PartCode and TP.Site = A.Site ");
_buffer.Append(" WHERE A.AskBillNum in ({0}) ");
string _str = string.Format(_buffer.ToString(), $"'{string.Join("','", _ls)}'");
if (!string.IsNullOrEmpty(PartCode))
{
//_buffer.Append(" and B.PartCode LIKE ('%{1}%')");
_str += " and B.PartCode LIKE '%" + PartCode + "%'";
}
if (!string.IsNullOrEmpty(PartCodeDesc))
{
_str += " and (TP.PartDesc1+ TP.PartDesc2 ) LIKE '%" + PartCodeDesc + "%'";
}
var _list = db.Database.SqlQuery<V_TB_ASK>(_str).ToList();
if (_list != null)
{
var S = _list.OrderBy(A => A.AskBillNum).ToList().Distinct();
return _list;
}
else
{
return p_list;
}
}
}
public static List<V_TB_ASK> GET_IS_COMPLETED_SEND(List<V_TB_ASK> p_list)
{
@ -1461,9 +1511,10 @@ namespace CK.SCP.Controller
_buffer.Append(" WHERE C.AskQty>isnull(D.Qty,0)");
_buffer.Append(" and c.AskBillNum in ('{0}')");
var _str = string.Format(_buffer.ToString(), string.Join("','", _ls.ToArray()));
var _list= db.Database.SqlQuery<string>(_str).ToList();
var _list = db.Database.SqlQuery<string>(_str).ToList();
p_list.ForEach(p => {
p_list.ForEach(p =>
{
p.IsComplete = true;
if (_list.Contains(p.AskBillNum))
{
@ -1522,7 +1573,7 @@ namespace CK.SCP.Controller
}
}
if(p_list.Count>0)
if (p_list.Count > 0)
{
return p_list;
}
@ -1569,9 +1620,9 @@ namespace CK.SCP.Controller
q = q.Where(p => p.PoUnit.Contains(p_entity.PoUnit));
}
if (p_entity.EndTime!=null)
if (p_entity.EndTime != null)
{
q = q.Where(p =>p_entity.EndTime< p.EndTime);
q = q.Where(p => p_entity.EndTime < p.EndTime);
}
if (!string.IsNullOrEmpty(p_entity.LocUnit))
{
@ -1620,7 +1671,7 @@ namespace CK.SCP.Controller
}
if (!string.IsNullOrEmpty(p_entity.VendId))
{
q = q.Where(p => p.VendId==p_entity.VendId);
q = q.Where(p => p.VendId == p_entity.VendId);
}
if (!string.IsNullOrEmpty(p_entity.AskBillNum))
@ -1631,6 +1682,10 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
}
if (!string.IsNullOrEmpty(p_entity.PartDesc1))
{
q = q.Where(p => p.PartDesc1.Contains(p_entity.PartDesc1));
}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
@ -1699,7 +1754,7 @@ namespace CK.SCP.Controller
}
public static void Get_V_TB_ASK_DETAIL_Sum(V_TB_ASK_DETAIL p_entity,Action<ResultObject<IQueryable<V_TB_ASK_DETAIL>>> p_action)
public static void Get_V_TB_ASK_DETAIL_Sum(V_TB_ASK_DETAIL p_entity, Action<ResultObject<IQueryable<V_TB_ASK_DETAIL>>> p_action)
{
ResultObject<IQueryable<V_TB_ASK_DETAIL>> _ret = new ResultObject<IQueryable<V_TB_ASK_DETAIL>>();
@ -1725,7 +1780,7 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
}
if (p_entity.ShippedQty!=null && p_entity.ShippedQty != 0)
if (p_entity.ShippedQty != null && p_entity.ShippedQty != 0)
{
q = q.Where(p => p.ShippedQty == p_entity.ShippedQty);
}
@ -1860,11 +1915,12 @@ namespace CK.SCP.Controller
{
if (p_state == AskState.Confirm)
{
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)&& p_list1.Contains(p.Site)).ToList();
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p_list1.Contains(p.Site)).ToList();
int count = _ls.Count(p => p.State == (int)AskState.Release);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p => {
_ls.ForEach(p =>
{
p.State = (int)AskState.Confirm;
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum && itm.Site == p.Site).ToList();
_list.ForEach(itm => itm.State = (int)AskState.Confirm);
@ -1895,7 +1951,8 @@ namespace CK.SCP.Controller
int count = _ls.Count(p => p.State == (int)AskState.Release);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p => {
_ls.ForEach(p =>
{
p.State = (int)AskState.New;
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList();
_list.ForEach(itm => itm.State = (int)AskState.New);
@ -2001,12 +2058,12 @@ namespace CK.SCP.Controller
if (p_state == AskState.CompleteForce)
{
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList();
int count = _ls.Count(p =>p.State == (int)AskState.Confirm || p.State == (int)AskState.Ship);
int count = _ls.Count(p => p.State == (int)AskState.Confirm || p.State == (int)AskState.Ship);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p =>
{
if(p.State==(int)AskState.Complete)
if (p.State == (int)AskState.Complete)
{
p.State = (int)AskState.Reject;
p.IsDeleted = true;
@ -2089,9 +2146,9 @@ namespace CK.SCP.Controller
}
}
if(p_state == AskState.NoConfirm)
if (p_state == AskState.NoConfirm)
{
var _ls = db.TB_ASN.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted==false ).ToList();
var _ls = db.TB_ASN.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList();
if (_ls.Count == 0)
{
var _askList = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList();
@ -2259,7 +2316,8 @@ namespace CK.SCP.Controller
int count = _ls.Count(p => p.State == (int)AskState.Release);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p => {
_ls.ForEach(p =>
{
p.State = (int)AskState.Confirm;
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList();
_list.ForEach(itm => itm.State = (int)AskState.Confirm);
@ -2290,7 +2348,8 @@ namespace CK.SCP.Controller
int count = _ls.Count(p => p.State == (int)AskState.Release);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p => {
_ls.ForEach(p =>
{
p.State = (int)AskState.New;
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList();
_list.ForEach(itm => itm.State = (int)AskState.New);
@ -2642,7 +2701,7 @@ namespace CK.SCP.Controller
return _ret;
}
public static ResultObject<bool> Save_TB_ASK_STATE_BMPT(List<string> p_list, AskState p_state,string site)
public static ResultObject<bool> Save_TB_ASK_STATE_BMPT(List<string> p_list, AskState p_state, string site)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
@ -2655,7 +2714,8 @@ namespace CK.SCP.Controller
int count = _ls.Count(p => p.State == (int)AskState.Release);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p => {
_ls.ForEach(p =>
{
p.State = (int)AskState.Confirm;
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList();
_list.ForEach(itm => itm.State = (int)AskState.Confirm);
@ -2686,7 +2746,8 @@ namespace CK.SCP.Controller
int count = _ls.Count(p => p.State == (int)AskState.Release);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p => {
_ls.ForEach(p =>
{
p.State = (int)AskState.New;
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList();
_list.ForEach(itm => itm.State = (int)AskState.New);
@ -2791,7 +2852,7 @@ namespace CK.SCP.Controller
}
if (p_state == AskState.CompleteForce)
{
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false&&p.Site==site).ToList();
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false && p.Site == site).ToList();
int count = _ls.Count(p => p.State == (int)AskState.Confirm || p.State == (int)AskState.Ship);
if (count == _ls.Count && _ls.Count > 0)
{
@ -2825,8 +2886,8 @@ namespace CK.SCP.Controller
{
itm.AskQty = 0;
var asn = db.V_TB_ASN_DETAIL.Where(ask => ask.AskBillNum == itm.AskBillNum && ask.IsDeleted == false && ask.Site == site && (ask.State == (int)AsnState.Ship || ask.State == (int)AsnState.Receive))
.GroupBy(ask => new { ask.AskBillNum, ask.PoLine, ask.PartCode,ask.Site })
.Select(ask => new { AsSum = ask.Sum(itm1 => itm1.Qty), PoLine = ask.Key.PoLine, AskBillNum = ask.Key.AskBillNum, PartCode = ask.Key.PartCode, Site=ask.Key.Site}).ToList();
.GroupBy(ask => new { ask.AskBillNum, ask.PoLine, ask.PartCode, ask.Site })
.Select(ask => new { AsSum = ask.Sum(itm1 => itm1.Qty), PoLine = ask.Key.PoLine, AskBillNum = ask.Key.AskBillNum, PartCode = ask.Key.PartCode, Site = ask.Key.Site }).ToList();
asn.ForEach(itm1 =>
{
@ -3038,7 +3099,7 @@ namespace CK.SCP.Controller
return _ret;
}
public static ResultObject<bool> Save_TB_ASK_STATE_BJBBMPT(List<string> p_list, AskState p_state,User p_user)
public static ResultObject<bool> Save_TB_ASK_STATE_BJBBMPT(List<string> p_list, AskState p_state, User p_user)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
@ -3051,7 +3112,8 @@ namespace CK.SCP.Controller
int count = _ls.Count(p => p.State == (int)AskState.Release);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p => {
_ls.ForEach(p =>
{
p.UpdateUser = p_user.ChineseName;
p.UpdateTime = DateTime.Now;
@ -3085,7 +3147,8 @@ namespace CK.SCP.Controller
int count = _ls.Count(p => p.State == (int)AskState.Release);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p => {
_ls.ForEach(p =>
{
p.UpdateUser = p_user.ChineseName;
p.UpdateTime = DateTime.Now;
p.State = (int)AskState.New;
@ -3115,7 +3178,7 @@ namespace CK.SCP.Controller
}
if (p_state == AskState.Release)
{
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)&&p.State== (int)AskState.New).ToList();
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.State == (int)AskState.New).ToList();
int count = _ls.Count(p => p.State == (int)AskState.New);
if (count > 0)
{
@ -3424,16 +3487,17 @@ namespace CK.SCP.Controller
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
var _list= db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_ask.AskBillNum && p.IsDeleted==false).ToList();
var _list = db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_ask.AskBillNum && p.IsDeleted == false).ToList();
var _ls = Get_CAN_SHIPQTY(_list);
_ls.ForEach(p => {
_ls.ForEach(p =>
{
var _entity = p_list.Where(itm => itm.AskBillNum == p.AskBillNum && itm.PoLine == p.PoLine && itm.PartCode == p.PartCode && itm.PoBillNum == p.PoBillNum).FirstOrDefault();
if (_entity != null)
{
p.AskQty = _entity.AskQty;
if(_entity.AskQty<p.ShippedQty)
if (_entity.AskQty < p.ShippedQty)
{
_ret.MessageList.Add(string.Format("零件编号{0}行号{1},【要货数量】必须大于等于【已发数量】",p.PartCode,p.PoLine.ToString()));
_ret.MessageList.Add(string.Format("零件编号{0}行号{1},【要货数量】必须大于等于【已发数量】", p.PartCode, p.PoLine.ToString()));
}
}
@ -3520,8 +3584,48 @@ namespace CK.SCP.Controller
}
/// <summary>
/// 报表
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_action"></param>
public static List<V_TB_ASK_DETAIL_PO> Get_V_TB_ASK_DETAIL_PO_List(V_TB_ASK_DETAIL_PO p_entity)
{
List<V_TB_ASK_DETAIL_PO> list = new List<V_TB_ASK_DETAIL_PO>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
SqlParameter[] prams = new SqlParameter[7];
string TimeBegin = !p_entity.TimeBegin.HasValue ? "" : DateTime.Parse(p_entity.TimeBegin.ToString()).ToString("yyyy-MM-dd");
string TimeEnd = !p_entity.TimeEnd.HasValue ? "" : DateTime.Parse(p_entity.TimeEnd.ToString()).ToString("yyyy-MM-dd");
string PoBillNum = string.IsNullOrEmpty(p_entity.PoBillNum) ? "" : p_entity.PoBillNum;
string AskBillNum = string.IsNullOrEmpty(p_entity.AskBillNum) ? "" : p_entity.AskBillNum;
string PartCode = string.IsNullOrEmpty(p_entity.PartCode) ? "" : p_entity.PartCode;
string Buyer= string.IsNullOrEmpty(p_entity.Buyer) ? "" : p_entity.Buyer;
string VendId = string.IsNullOrEmpty(p_entity.VendId) ? "" : p_entity.VendId;
string UserInAddress_where = "";
string UserName = p_entity.UserName;
if (p_entity.UserInAddress != null)
{
UserInAddress_where = string.Join(", ", p_entity.UserInAddress);
}
string str = "exec PROC_test " + " @PONum_where = '" + PoBillNum + "' ,@AskBillNum_where = '" + AskBillNum + "' ,@PartCode_where = '" + PartCode + "' ,@Buyer_where = '" + Buyer + "' ,@BeginDate_where = '" + TimeBegin + "' ,@EndDate_where = '" + TimeEnd + "', @VenderID_where = '" + VendId + "'" + ", @UserInAddress_where = " + UserInAddress_where + " ,@UserName = " + UserName;
list = db.Database.SqlQuery<V_TB_ASK_DETAIL_PO>(str).ToList();
}
}
catch (Exception e)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_DETAIL_PO_List", e.Message);
if (e.InnerException != null)
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_DETAIL_PO_List(Exception)", LogHelper.GetExceptionMessage(e).Message);
throw e;
}
return list;
}
}
}

47
北京北汽/Controller/SCP_PO_CONTROLLER.cs

@ -5400,5 +5400,52 @@ namespace CK.SCP.Controller
return p_list;
}
#endregion
public static List<V_TB_ASK_DETAIL_PO> LOAD_ASK_DETAIL_PO_SUM(List<V_TB_ASK_DETAIL_PO> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_list.Count > 0)
{
foreach (V_TB_ASK_DETAIL_PO _detail in p_list)
{
var rec = db.TB_RECEIVE_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false && p.State == (int)ReceiveState.Check && p.BillType == 0)
.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { ReceiveSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode });
var asn = db.TB_ASN_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false && (p.State == (int)AsnState.Ship || p.State == (int)AsnState.Receive))
.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode })
.Select(p => new { AsSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode });
var arrive = db.TB_ARRIVE_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.BillType == (int)ArriveBillType.Receive)
.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode, p.SubSite }).Select(p => new { ArriveSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode, Subsite = p.Key.SubSite });
rec.ToList().ForEach(itm =>
{
if (_detail.PoBillNum == itm.PoBillNum && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode)
{
_detail.ReceivedQty = itm.ReceiveSum;
}
});
asn.ToList().ForEach(itm =>
{
if (_detail.PoBillNum == itm.PoBillNum && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode)
{
_detail.ShippedQty = itm.AsSum;
}
});
arrive.ToList().ForEach(itm =>
{
if (_detail.PoBillNum == itm.PoBillNum && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode && _detail.SubSite == itm.Subsite)
{
_detail.ArriveQty = itm.ArriveSum;
}
});
}
}
}
return p_list;
}
}
}

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

@ -429,6 +429,7 @@
<Compile Include="ScpEntity\V_TB_ARRIVE_DETAIL.cs" />
<Compile Include="ScpEntity\V_TB_ASK.cs" />
<Compile Include="ScpEntity\V_TB_ASK_DETAIL_PACKAGE.cs" />
<Compile Include="ScpEntity\V_TB_ASK_DETAIL_PO.cs" />
<Compile Include="ScpEntity\V_TB_FORECAST.cs" />
<Compile Include="ScpEntity\V_TB_INCOMOLETE_DETAIL.cs" />
<Compile Include="ScpEntity\V_TB_INVOICE_ASK.cs" />

1
北京北汽/Models/ScpEntities.cs

@ -163,6 +163,7 @@ namespace CK.SCP.Models
public virtual DbSet<TB_ASK_RECEIVE> TB_ASK_RECEIVE { get; set; }
public virtual DbSet<TB_UNCOMPLETE_TEMPASK> TB_UNCOMPLETE_TEMPASK { get; set; }
public virtual DbSet<V_TB_ASK_DETAIL_PO> V_TB_ASK_DETAIL_PO { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{

4
北京北汽/Models/ScpEntity/V_TB_ASK.cs

@ -78,6 +78,10 @@ namespace CK.SCP.Models.ScpEntity
public string Month { get; set; }
[NotMapped]
public bool IsComplete { get; set; }
[NotMapped]
public string PartCode { get; set; }
[NotMapped]
public string PartCodeDesc { get; set; }
#endregion
}
}

54
北京北汽/Models/ScpEntity/V_TB_ASK_DETAIL_PO.cs

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class V_TB_ASK_DETAIL_PO
{
[Key]
public long UID { get; set; }
public string PoBillNum { get; set; }
public int ModType { get; set; }
public string ModType_DESC { get; set; }
public string AskBillNum { get; set; }
public string VendName { get; set; }
public string VendId { get; set; }
public DateTime BeginTime { get; set; }
public int PoLine { get; set; }
public string PartCode { get; set; }
public string PartDesc { get; set; }
public string VendPartCode { get; set; }
public string PoUnit { get; set; }
public decimal Price { get; set; }
public decimal AskQty { get; set; }
public decimal ShippedQty { get; set; }
public decimal ReceivedQty { get; set; }
public decimal ArriveQty { get; set; }
public DateTime EndTime { get; set; }
public string Site_Desc { get; set; }
public string Buyer { get; set; }
public string BuyerPhone { get; set; }
[NotMapped]
public string Site { get; set; }
[NotMapped]
public string SubSite { get; set; }
#region 查询条件
[NotMapped]
public DateTime? TimeBegin { get; set; }
[NotMapped]
public DateTime? TimeEnd { get; set; }
[NotMapped]
public List<string> UserInAddress { set; get; }
[NotMapped]
public List<string> UserInSubSite { set; get; }
[NotMapped]
public string UserName { set; get; }
#endregion
}
}

8
北京北汽/SCP/SCP.csproj

@ -2925,6 +2925,7 @@
<Content Include="grf\SmallBarCode.grf" />
<Content Include="grf\InvRecBill.grf" />
<Content Include="Handlers\MakeVerifyCode.ashx" />
<Content Include="Views\PlanData\SCP_TB_ASK_DETAIL_PO.aspx" />
<Content Include="Views\PlanData\SCP_PO_CQ.aspx" />
<Content Include="Views\PlanData\SCP_PO_DETAIL_CQ.aspx" />
<None Include="Properties\PublishProfiles\COM.pubxml" />
@ -5469,6 +5470,13 @@
<Compile Include="Views\PlanData\SCP_ASK.aspx.designer.cs">
<DependentUpon>SCP_ASK.aspx</DependentUpon>
</Compile>
<Compile Include="Views\PlanData\SCP_TB_ASK_DETAIL_PO.aspx.cs">
<DependentUpon>SCP_TB_ASK_DETAIL_PO.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\PlanData\SCP_TB_ASK_DETAIL_PO.aspx.designer.cs">
<DependentUpon>SCP_TB_ASK_DETAIL_PO.aspx</DependentUpon>
</Compile>
<Compile Include="Views\PlanData\SCP_ASN_EXCEPTION_DETAIL.aspx.cs">
<DependentUpon>SCP_ASN_EXCEPTION_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

27
北京北汽/SCP/Views/PlanData/SCP_ASK.aspx

@ -101,29 +101,42 @@
<%-- <f:ListItem Text="已收货" Value="4" />
<f:ListItem Text="已完成" Value="5" />--%>
</f:DropDownList>
<f:TextBox ID="TXT_Buyer" runat="server" Label="采购员"></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox ID="TXT_Buyer" runat="server" Label="采购员"></f:TextBox>
<f:TextBox ID="TXT_BuyerPhone" runat="server" Label="采购员电话"></f:TextBox>
<f:TextBox ID="TextBox_PartCode" runat="server" Label="零件编号"/>
<f:TextBox ID="TextBox_PartCodeDesc" runat="server" Label="零件名称"/>
<f:TextBox ID="TXT_Remark" runat="server" Label="备注" />
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找">
</f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找"/>
<f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"/>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:GroupPanel runat="server" ID="gp2" Hidden="true" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server">
<Items>
<f:TextBox runat="server" Required="true" Label="零件编号" EmptyText="查询请填写零件编号" ID="TXT_PartCode"></f:TextBox>
<f:Button ID="BtnSearchDetail" runat="server" OnClick="BtnSearchDetail_Click" Text="快速查找订单明细">
</f:Button>
<f:TextBox runat="server" Required="true" Label="零件名称" EmptyText="查询请填写零件名称" ID="TXT_PartCodeDesc"/>
<f:Button ID="Button10" runat="server" OnClick="BtnSearchDetail_Click" Text="订单明细快速查找"/>
<f:Button runat="server" Text="关闭" ID="Button8" OnClick="Btn2Close_Click"/>
</Items>
</f:FormRow>
</Rows>

21
北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs

@ -96,9 +96,16 @@ namespace SCP.PlanData
public void BindAsk()
{
SearchV_TB_ASKData((result) => {
Grid_V_TB_ASK.RecordCount = result.Count();
var list = SortAndPage<V_TB_ASK>(result, Grid_V_TB_ASK);
var _ls=SCP_ASK_CONTROLLER.GET_IS_COMPLETED_SEND(list.ToList());
//var list = SortAndPage<V_TB_ASK>(result, Grid_V_TB_ASK);
if (Grid_V_TB_ASK.PageIndex >= Grid_V_TB_ASK.PageCount && Grid_V_TB_ASK.PageCount >= 1)
{
Grid_V_TB_ASK.PageIndex = Grid_V_TB_ASK.PageCount - 1;
}
result = result.SortBy(Grid_V_TB_ASK.SortField + " " + Grid_V_TB_ASK.SortDirection);
var list1 = SCP_ASK_CONTROLLER.GET_Likesearch(result.ToList(), TextBox_PartCode.Text, TextBox_PartCodeDesc.Text);
Grid_V_TB_ASK.RecordCount = list1.Count();
list1 = list1.Skip(Grid_V_TB_ASK.PageIndex * Grid_V_TB_ASK.PageSize).Take(Grid_V_TB_ASK.PageSize).ToList();
var _ls=SCP_ASK_CONTROLLER.GET_IS_COMPLETED_SEND(list1);
Grid_V_TB_ASK.DataSource = _ls .OrderBy(p => p.State).ThenByDescending(p => p.BeginTime);
Grid_V_TB_ASK.DataBind();
});
@ -303,12 +310,17 @@ namespace SCP.PlanData
protected void btnShow_Click(object sender, EventArgs e)
{
gp1.Hidden = false;
gp2.Hidden = false;
}
protected void BtnClose_Click(object sender, EventArgs e)
{
gp1.Hidden = true;
}
protected void Btn2Close_Click(object sender, EventArgs e)
{
gp2.Hidden = true;
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
@ -392,7 +404,8 @@ namespace SCP.PlanData
string VendName = ddl_Vender.SelectedValue;
string State = DDL_State.SelectedValue;
string PartCode = TXT_PartCode.Text;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../PlanData/SCP_ASK_DETAIL.aspx?AskBillNum={0}&&VendName={1}&&State={2}&&PartCode={3}", AskBillNum, VendName, State, PartCode)));
string PartCodeDesc = TXT_PartCodeDesc.Text;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../PlanData/SCP_ASK_DETAIL.aspx?AskBillNum={0}&&VendName={1}&&State={2}&&PartCode={3}&&PartCodeDesc={4}", AskBillNum, VendName, State, PartCode,PartCodeDesc)));
}
protected void Grid_V_TB_ASK_RowDataBound(object sender, GridRowEventArgs e)
{

53
北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.designer.cs

@ -320,6 +320,24 @@ namespace SCP.PlanData
/// </remarks>
protected global::FineUI.TextBox TXT_BuyerPhone;
/// <summary>
/// TextBox_PartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextBox_PartCode;
/// <summary>
/// TextBox_PartCodeDesc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextBox_PartCodeDesc;
/// <summary>
/// TXT_Remark 控件。
/// </summary>
@ -329,6 +347,15 @@ namespace SCP.PlanData
/// </remarks>
protected global::FineUI.TextBox TXT_Remark;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// BtnClose 控件。
/// </summary>
@ -339,13 +366,13 @@ namespace SCP.PlanData
protected global::FineUI.Button BtnClose;
/// <summary>
/// BtnSearch 控件。
/// gp2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
protected global::FineUI.GroupPanel gp2;
/// <summary>
/// TXT_PartCode 控件。
@ -357,13 +384,31 @@ namespace SCP.PlanData
protected global::FineUI.TextBox TXT_PartCode;
/// <summary>
/// BtnSearchDetail 控件。
/// TXT_PartCodeDesc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PartCodeDesc;
/// <summary>
/// Button10 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button10;
/// <summary>
/// Button8 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearchDetail;
protected global::FineUI.Button Button8;
/// <summary>
/// Grid_V_TB_ASK 控件。

5
北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx

@ -104,7 +104,10 @@
<f:BoundField SortField="ReceivedPort" DataField="ReceivedPort" HeaderText="库位" ColumnID="ReceivedPort" />
<f:BoundField SortField="Extend1" DataField="Extend1" HeaderText="唯一码" ColumnID="Extend1" />
<f:BoundField SortField="Remark" DataField="Remark" HeaderText="备注" ColumnID="Remark" />
<f:BoundField SortField="BeginTime" DataField="BeginTime" HeaderText="订货日期" ColumnID="BeginTime" />
<f:BoundField SortField="PoBillNum" DataField="PoBillNum" HeaderText="订单号" ColumnID="PoBillNum" />
<f:BoundField DataField="AskBillNum" HeaderText="要货看板编号" SortField="AskBillNum" ColumnID="AskBillNum" />
<f:BoundField SortField="VendId" DataField="VendId" HeaderText="供应商" ColumnID="VendId" />
</Columns>
</f:Grid>

4
北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs

@ -429,6 +429,10 @@ namespace SCP.PlanData
{
_entity.State = int.Parse(Request["State"]);
}
if (!string.IsNullOrEmpty(Request["PartCodeDesc"]))
{
_entity.PartDesc1 = Request["PartCodeDesc"];
}
}
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) =>

103
北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx

@ -0,0 +1,103 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_TB_ASK_DETAIL_PO.aspx.cs" Inherits="SCP.PlanData.SCP_TB_ASK_DETAIL_PO" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<Items>
<f:Button ID="Button1" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();"/>
<f:Form runat="server" Title="">
<Items>
<f:FormRow runat="server" ColumnWidths="15% 15% 15% 15% ">
<Items>
<f:TextBox runat="server" Label="订单号" EmptyText="" ID="TXT_PoBillNum" />
<f:TextBox runat="server" Label="要货看板号" EmptyText="" ID="TXT_AskBillNum" />
<f:TextBox runat="server" Label="供应商" EmptyText="" ID="TXT_VendName" />
<f:TextBox runat="server" Label="供应商编码" EmptyText="" ID="TXT_VendID" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="15% 15% 15% 15%">
<Items>
<f:TextBox runat="server" Label="零件号" EmptyText="" ID="TXT_PartCode" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="订货日期" EmptyText="请选择日期" ID="TimeBegin" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="至" EmptyText="请选择日期" ID="TimeEnd" />
<f:TextBox runat="server" Label="采购人" EmptyText="" ID="Text_Buyer" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items>
<f:Button runat="server" Text="重置" ID="BtnReset" OnClick="BtnReset_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找">
</f:Button>
<f:Button ID="BTN_EXCEL" runat="server" OnClick="BTN_EXCEL_Click" Text="导出EXCEL">
</f:Button>
<f:Label runat="server"></f:Label>
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Grid ID="Grid_V_TB_ASK_DETAIL_PO" ShowBorder="true" ShowHeader="true" PageSize="15" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,PoBillNum,ModType_DESC,AskBillNum,VendName,VendId,BeginTime,PoLine,PartCode,PartDesc,VendPartCode,PoUnit,Price,AskQty,ShippedQty,ReceivedQty,ArriveQty,EndTime,Site_Desc,Buyer,BuyerPhone"
IsDatabasePaging="True" AllowPaging="True"
EnableRowSelectEvent="True" AutoScroll="True"
OnPageIndexChange="Grid_V_TB_ASK_DETAIL_PO_PageIndexChange">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="20" Value="10" />
<f:ListItem Text="40" Value="40" />
<f:ListItem Text="80" Value="80" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width="80px" DataField="PoBillNum" DataFormatString="{0}" HeaderText="订单号" />
<f:BoundField Width="80px" DataField="ModType_DESC" DataFormatString="{0}" HeaderText="单据类型" />
<f:BoundField Width="80px" DataField="AskBillNum" DataFormatString="{0}" HeaderText="要货看板号" />
<f:BoundField Width="80px" DataField="VendName" DataFormatString="{0}" HeaderText="供应商" />
<f:BoundField Width="100px" DataField="VendId" DataFormatString="{0}" HeaderText="供应商编码" />
<f:BoundField Width="100px" DataField="BeginTime" DataFormatString="{0}" HeaderText="订货日期" />
<f:BoundField Width="50px" DataField="PoLine" DataFormatString="{0}" HeaderText="行号" />
<f:BoundField Width="100px" DataField="PartCode" DataFormatString="{0}" HeaderText="零件号" />
<f:BoundField Width="100px" DataField="PartDesc" DataFormatString="{0}" HeaderText="零件名称" />
<f:BoundField Width="100px" DataField="VendPartCode" DataFormatString="{0}" HeaderText="供应商零件名称" />
<f:BoundField Width="50px" DataField="PoUnit" DataFormatString="{0}" HeaderText="单位" />
<f:BoundField Width="80px" DataField="Price" DataFormatString="{0:F}" HeaderText="价格" />
<f:BoundField Width="100px" DataField="AskQty" DataFormatString="{0:F}" HeaderText="要货数量" />
<f:BoundField Width="100px" DataField="ShippedQty" DataFormatString="{0:F}" HeaderText="发货数量" />
<f:BoundField Width="100px" DataField="ReceivedQty" DataFormatString="{0:F}" HeaderText="收货数量" />
<f:BoundField Width="100px" DataField="ArriveQty" DataFormatString="{0:F}" HeaderText="到货数量" />
<f:BoundField Width="100px" DataField="EndTime" DataFormatString="{0}" HeaderText="到货日期" />
<f:BoundField Width="100px" DataField="Site_Desc" DataFormatString="{0}" HeaderText="地点" />
<f:BoundField Width="100px" DataField="Buyer" DataFormatString="{0}" HeaderText="采购人员" />
<f:BoundField Width="100px" DataField="BuyerPhone" DataFormatString="{0}" HeaderText="采购电话" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

161
北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx.cs

@ -0,0 +1,161 @@
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using FineUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
namespace SCP.PlanData
{
public partial class SCP_TB_ASK_DETAIL_PO : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDetail();
TimeBegin.MinDate = DateTime.Now.AddYears(-1);
TimeBegin.MaxDate = DateTime.Now;
TimeEnd.MaxDate = DateTime.Now;
TimeEnd.MinDate = TimeBegin.MinDate;
}
}
public List<V_TB_ASK_DETAIL_PO> SearchV_TB_ASK_DETAILData()
{
List<V_TB_ASK_DETAIL_PO> list = new List<V_TB_ASK_DETAIL_PO>();
V_TB_ASK_DETAIL_PO _entity = new V_TB_ASK_DETAIL_PO();
_entity.PoBillNum = TXT_PoBillNum.Text;
_entity.AskBillNum = TXT_AskBillNum.Text;
_entity.PartCode = TXT_PartCode.Text;
_entity.VendName = TXT_VendName.Text;
_entity.VendId = TXT_VendID.Text;
if (TimeBegin.SelectedDate != null)
{
_entity.TimeBegin = TimeBegin.SelectedDate;
}
else
{
_entity.TimeBegin = DateTime.Now.AddYears(-1);
}
if (TimeEnd.SelectedDate != null)
{
_entity.TimeEnd = TimeEnd.SelectedDate;
}
else
{
_entity.TimeEnd = DateTime.Now;
}
#region 权限
if (!string.IsNullOrEmpty(CurrentUser.Name))
{
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
{
if (!string.IsNullOrEmpty(this.Text_Buyer.Text))
{
_entity.Buyer = Text_Buyer.Text;
}
}
}
_entity.UserInAddress = CurrentUser.FactoryList;
if (CurrentUser.VenderList != null && CurrentUser.VenderList.Count > 0)
{
_entity.UserName = User.Identity.Name;
}
//_entity.UserInSubSite = CurrentUser.SubSiteList;
#endregion
list = SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_PO_List(_entity);
return list;
}
public void BindDetail()
{
List<V_TB_ASK_DETAIL_PO> list = SearchV_TB_ASK_DETAILData();
Grid_V_TB_ASK_DETAIL_PO.RecordCount = list.Count();
list = list.OrderByDescending(q=>q.AskBillNum).ToList();
if (Grid_V_TB_ASK_DETAIL_PO.PageIndex >= Grid_V_TB_ASK_DETAIL_PO.PageCount && Grid_V_TB_ASK_DETAIL_PO.PageCount >= 1)
{
Grid_V_TB_ASK_DETAIL_PO.PageIndex = Grid_V_TB_ASK_DETAIL_PO.PageCount - 1;
}
list = list.Skip(Grid_V_TB_ASK_DETAIL_PO.PageIndex * Grid_V_TB_ASK_DETAIL_PO.PageSize).Take(Grid_V_TB_ASK_DETAIL_PO.PageSize).ToList();
Grid_V_TB_ASK_DETAIL_PO.DataSource = list;
Grid_V_TB_ASK_DETAIL_PO.DataBind();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_ASK_DETAIL_PO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindDetail();
}
protected void Grid_V_TB_ASK_DETAIL_PO_PageIndexChange(object sender, GridPageEventArgs e)
{
BindDetail();
}
/// <summary>
/// 重置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnReset_Click(object sender, EventArgs e)
{
TXT_PoBillNum.Text = string.Empty;
TXT_AskBillNum.Text = string.Empty;
TXT_PartCode.Text = string.Empty;
TXT_VendName.Text = string.Empty;
TXT_VendID.Text = string.Empty;
TimeBegin.SelectedDate = null;
TimeEnd.SelectedDate = null;
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
BindDetail();
}
protected void BTN_EXCEL_Click(object sender, EventArgs e)
{
List<V_TB_ASK_DETAIL_PO> list = SearchV_TB_ASK_DETAILData();
if (list == null)
{
Alert.Show("没有数据!");
return;
}
Dictionary<string, string> cellheader = new Dictionary<string, string>(){
{"PoBillNum" , "订单号" },
{"ModType_DESC" , "单据类型" },
{ "AskBillNum" , "要货看板号" },
{ "VendName" , "供应商" },
{ "VendId" , "供应商编码" },
{ "BeginTime" , "订货日期" },
{ "PoLine" , "行号" },
{ "PartCode" , "零件号" },
{ "PartDesc" , "零件名称" },
{ "VendPartCode" , "供应商零件名称" },
{ "PoUnit" , "单位" },
{ "Price" , "价格" },
{ "AskQty" , "要货数量" },
{ "ShippedQty" , "发货数量" },
{ "ReceivedQty" , "收货数量" },
{ "ArriveQty" , "到货数量" },
{ "EndTime" , "到货日期" },
{ "Site_Desc" , "地点" },
{ "Buyer" , "采购人员" },
{ "BuyerPhone" , "采购电话" },
};
string url = EntityListToExcel2003(cellheader, list, "报表明细");
}
}
}

179
北京北汽/SCP/Views/PlanData/SCP_TB_ASK_DETAIL_PO.aspx.designer.cs

@ -0,0 +1,179 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.PlanData
{
public partial class SCP_TB_ASK_DETAIL_PO
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// TXT_PoBillNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PoBillNum;
/// <summary>
/// TXT_AskBillNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_AskBillNum;
/// <summary>
/// TXT_VendName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendName;
/// <summary>
/// TXT_VendID 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendID;
/// <summary>
/// TXT_PartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PartCode;
/// <summary>
/// TimeBegin 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker TimeBegin;
/// <summary>
/// TimeEnd 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker TimeEnd;
/// <summary>
/// Text_Buyer 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox Text_Buyer;
/// <summary>
/// BtnReset 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnReset;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// BTN_EXCEL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_EXCEL;
/// <summary>
/// Grid_V_TB_ASK_DETAIL_PO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_ASK_DETAIL_PO;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}
Loading…
Cancel
Save