Merge branch 'master' of http://10.0.0.11:10080/nx.wms/U8-Import
This commit is contained in:
@@ -19,7 +19,7 @@ namespace NX.ERP.Model.Purchase
|
|||||||
public string UnitCode { get => unitCode; set => unitCode = value; }
|
public string UnitCode { get => unitCode; set => unitCode = value; }
|
||||||
public double Qty { get => quantity; set => quantity = value; }
|
public double Qty { get => quantity; set => quantity = value; }
|
||||||
public double RealQuantity { get; set; }
|
public double RealQuantity { get; set; }
|
||||||
public string cPosName { get; set; }
|
/// public string cPosName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 审批状态2 说明已经审核过了
|
/// 审批状态2 说明已经审核过了
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -58,9 +58,9 @@ namespace NX.ERP.U8.Purchase
|
|||||||
<> 1 THEN 0 ELSE (CASE WHEN isnull(d.igrouptype, 0)
|
<> 1 THEN 0 ELSE (CASE WHEN isnull(d.igrouptype, 0)
|
||||||
= 1 THEN unit2.ichangrate ELSE ((isnull(b.iquantity, 0) - isnull(b.finspectquantity, 0))
|
= 1 THEN unit2.ichangrate ELSE ((isnull(b.iquantity, 0) - isnull(b.finspectquantity, 0))
|
||||||
/ (isnull(b.inum, 0) - isnull(b.finspectnum, 0))) END) END) AS inspecexchrate,
|
/ (isnull(b.inum, 0) - isnull(b.finspectnum, 0))) END) END) AS inspecexchrate,
|
||||||
e.POID as Poid,Pos.cPosName,
|
e.POID as Poid,--Pos.cPosName,
|
||||||
CASE WHEN isnull(f.bflowprocess, 0) = 1 THEN isnull(f.bstoragearrivalorder, 1) ELSE 1 END AS bstoragearrivalorder,
|
CASE WHEN isnull(f.bflowprocess, 0) = 1 THEN isnull(f.bstoragearrivalorder, 1) ELSE 1 END AS bstoragearrivalorder
|
||||||
Pos.cPosName
|
--,Pos.cPosName
|
||||||
from PU_ArrivalVouch a
|
from PU_ArrivalVouch a
|
||||||
|
|
||||||
left join PU_ArrivalVouchs b on a.ID=b.ID
|
left join PU_ArrivalVouchs b on a.ID=b.ID
|
||||||
@@ -70,13 +70,9 @@ namespace NX.ERP.U8.Purchase
|
|||||||
LEFT JOIN dbo.ComputationUnit AS Unit1 ON d.cComUnitCode = Unit1.cComunitCode
|
LEFT JOIN dbo.ComputationUnit AS Unit1 ON d.cComUnitCode = Unit1.cComunitCode
|
||||||
Left Join PO_Podetails e ON B.iPOsID = e.ID
|
Left Join PO_Podetails e ON B.iPOsID = e.ID
|
||||||
LEFT JOIN dbo.PUBizFlow f ON f.iFlowID = a.iflowid
|
LEFT JOIN dbo.PUBizFlow f ON f.iFlowID = a.iflowid
|
||||||
left join (SELECT cinvcode, STUFF(( SELECT ','+ cPosName FROM ( select b.cPosName,a.cInvCode,a.iQuantity from InvPositionSum a left join Position b on a.cPosCode=b.cPosCode
|
|
||||||
where a.iQuantity <>0) a WHERE b.cinvcode = a.cinvcode order by a.iQuantity desc FOR XML PATH('')),1 ,1, '') cPosName
|
|
||||||
FROM InvPositionSum b
|
|
||||||
GROUP BY cinvcode
|
|
||||||
) Pos on b.cInvCode=Pos.cInvCode
|
|
||||||
where
|
where
|
||||||
(isnull(cbustype,'')<>'委外加工') and isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'')
|
(isnull(cbustype,'')<>'委外加工') --and isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'')
|
||||||
and isnull(b.cbcloser,'')='' And isnull(a.cverifier,'')<>''
|
and isnull(b.cbcloser,'')='' And isnull(a.cverifier,'')<>''
|
||||||
And a.iBillType ='0' and isnull(b.bGsp,'')='0' and (isnull(b.iQuantity,0)-isnull(b.fRefuseQuantity,0)>isnull(b.fValidInQuan,0) or (d.igrouptype=2
|
And a.iBillType ='0' and isnull(b.bGsp,'')='0' and (isnull(b.iQuantity,0)-isnull(b.fRefuseQuantity,0)>isnull(b.fValidInQuan,0) or (d.igrouptype=2
|
||||||
and isnull(b.inum,0)-isnull(b.frefusenum,0)>isnull(b.fvalidinnum,0))) and isnull(bStorageArrivalOrder,1)=1 ";
|
and isnull(b.inum,0)-isnull(b.frefusenum,0)>isnull(b.fvalidinnum,0))) and isnull(bStorageArrivalOrder,1)=1 ";
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ namespace NX.ERP.U8.Store
|
|||||||
voucherParameter.DomHead.loadXML(HeadTemplate);
|
voucherParameter.DomHead.loadXML(HeadTemplate);
|
||||||
voucherParameter.DomBody.loadXML(BodyTemplate);
|
voucherParameter.DomBody.loadXML(BodyTemplate);
|
||||||
IXMLDOMElement headXml = domHead.createElement("z:row");
|
IXMLDOMElement headXml = domHead.createElement("z:row");
|
||||||
headXml.setAttribute("ccode", storeOut.Code); //DomHead[0]["ccode"] = ""; //入库单号,string类型
|
headXml.setAttribute("ccode","AAA"/* storeOut.Code*/); //DomHead[0]["ccode"] = ""; //入库单号,string类型
|
||||||
headXml.setAttribute("ddate", storeOut.Date.ToShortDateString()); //DomHead[0]["ddate"] = ""; //入库日期,DateTime类型
|
headXml.setAttribute("ddate", storeOut.Date.ToShortDateString()); //DomHead[0]["ddate"] = ""; //入库日期,DateTime类型
|
||||||
headXml.setAttribute("bpufirst", "0");
|
headXml.setAttribute("bpufirst", "0");
|
||||||
headXml.setAttribute("bisstqc", "0");
|
headXml.setAttribute("bisstqc", "0");
|
||||||
@@ -342,11 +342,6 @@ namespace NX.ERP.U8.Store
|
|||||||
|
|
||||||
bodyXml = domBody.createElement("z:row");
|
bodyXml = domBody.createElement("z:row");
|
||||||
var metail = new NX.ERP.U8.MaterialDAL().GetInvPrice(detail.InvCode, 1, storeOut.Whcode, out var _cost);
|
var metail = new NX.ERP.U8.MaterialDAL().GetInvPrice(detail.InvCode, 1, storeOut.Whcode, out var _cost);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bodyXml.setAttribute("iunitcost", _cost);
|
bodyXml.setAttribute("iunitcost", _cost);
|
||||||
var info = new Account.Accinformation();
|
var info = new Account.Accinformation();
|
||||||
bodyXml.setAttribute("iprice", info.FormatMoney(_cost * detail.Quantity));
|
bodyXml.setAttribute("iprice", info.FormatMoney(_cost * detail.Quantity));
|
||||||
@@ -380,6 +375,92 @@ namespace NX.ERP.U8.Store
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else if (storeOut.Source=="领料申请单")
|
||||||
|
{
|
||||||
|
|
||||||
|
var metailApp = new U8.Store.MaterialAppDAL().GetModel(storeOut.SourceCode);
|
||||||
|
if (metailApp == null)
|
||||||
|
{
|
||||||
|
throw new Exception("未知的领料申请单");
|
||||||
|
}
|
||||||
|
|
||||||
|
string lastProductNo = null;
|
||||||
|
decimal moqty = 0;
|
||||||
|
string DeptName = "";
|
||||||
|
string moCode = "";
|
||||||
|
string DeptCode = "";
|
||||||
|
IXMLDOMElement bodyXml;
|
||||||
|
for (var n = 0; n < storeOut.Details.Count(); n++)
|
||||||
|
{
|
||||||
|
var detail = storeOut.Details[n];
|
||||||
|
var materialAppDetail = metailApp.MaterialAppVouchsLst.FirstOrDefault(m => m.MaterialAppDtlId == detail.SorceDetailId);
|
||||||
|
if (materialAppDetail == null)
|
||||||
|
{
|
||||||
|
throw new Exception("未知明细");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastProductNo == null)
|
||||||
|
{
|
||||||
|
lastProductNo = materialAppDetail.ProductNo;
|
||||||
|
moqty = materialAppDetail.MoQuantity;
|
||||||
|
DeptName = materialAppDetail.DeptName;
|
||||||
|
DeptCode = materialAppDetail.DeptCode;
|
||||||
|
moCode = materialAppDetail.MoCode;
|
||||||
|
}
|
||||||
|
else if (lastProductNo != "" && lastProductNo != materialAppDetail.ProductNo)
|
||||||
|
{
|
||||||
|
lastProductNo = "";
|
||||||
|
moqty = 0;
|
||||||
|
}
|
||||||
|
bodyXml = domBody.createElement("z:row");
|
||||||
|
var metail = new NX.ERP.U8.MaterialDAL().GetInvPrice(detail.InvCode, 1, storeOut.Whcode, out var _cost);
|
||||||
|
bodyXml.setAttribute("iunitcost", _cost);
|
||||||
|
bodyXml.setAttribute("imaids", materialAppDetail.MaterialAppDtlId);//
|
||||||
|
var info = new Account.Accinformation();
|
||||||
|
bodyXml.setAttribute("iprice", info.FormatMoney(_cost * detail.Quantity));
|
||||||
|
bodyXml.setAttribute("cinvcode", detail.InvCode);
|
||||||
|
bodyXml.setAttribute("iquantity", detail.Quantity);
|
||||||
|
bodyXml.setAttribute("irowno", domBody.selectSingleNode("//rs:data").childNodes.length + 1);
|
||||||
|
bodyXml.setAttribute("cbatch", "");
|
||||||
|
bodyXml.setAttribute("cvmivencode", "");
|
||||||
|
bodyXml.setAttribute("cposition", detail.Position);
|
||||||
|
bodyXml.setAttribute("editprop", "A");
|
||||||
|
bodyXml.setAttribute("innum", 10);
|
||||||
|
bodyXml.setAttribute("imoseq", materialAppDetail.Moseq);
|
||||||
|
bodyXml.setAttribute("inquantity", materialAppDetail.Quantit - materialAppDetail.OutQuantity);
|
||||||
|
bodyXml.setAttribute("crejectcode", materialAppDetail.RejectCode);
|
||||||
|
bodyXml.setAttribute("iOMoMID", materialAppDetail.OmomId);
|
||||||
|
bodyXml.setAttribute("iopseq", materialAppDetail.OpSeq);
|
||||||
|
bodyXml.setAttribute("copdesc", materialAppDetail.OpDesc);
|
||||||
|
bodyXml.setAttribute("invcode", materialAppDetail.MaterialCode);
|
||||||
|
bodyXml.setAttribute("cMoLotCode", materialAppDetail.MoLotCode);
|
||||||
|
bodyXml.setAttribute("cmocode", materialAppDetail.MoCode);
|
||||||
|
bodyXml.setAttribute("iMPoIds", materialAppDetail.MPoIds);
|
||||||
|
bodyXml.setAttribute("comcode", materialAppDetail.OmCode);
|
||||||
|
bodyXml.setAttribute("iOMoDID", materialAppDetail.OMoDId);
|
||||||
|
bodyXml.setAttribute("cciqbookcode", materialAppDetail.ciqBookCode);
|
||||||
|
bodyXml.setAttribute("cmworkcentercode", materialAppDetail.mWorkCenterCode);
|
||||||
|
bodyXml.setAttribute("cservicecode", materialAppDetail.ServiceCode);
|
||||||
|
bodyXml.setAttribute("isotype", materialAppDetail.SoType);
|
||||||
|
bodyXml.setAttribute("csocode", materialAppDetail.SoCode);
|
||||||
|
bodyXml.setAttribute("isodid", materialAppDetail.SodId);
|
||||||
|
bodyXml.setAttribute("isoseq", materialAppDetail.SoSeq);
|
||||||
|
bodyXml.setAttribute("iordertype", materialAppDetail.OrderType);
|
||||||
|
bodyXml.setAttribute("iordercode", materialAppDetail.OrderCode);
|
||||||
|
bodyXml.setAttribute("iorderdid", materialAppDetail.OrderdId);
|
||||||
|
bodyXml.setAttribute("iorderseq", materialAppDetail.OrderSeq);
|
||||||
|
bodyXml.setAttribute("ipesotype", materialAppDetail.PesoType);
|
||||||
|
bodyXml.setAttribute("cpesocode", materialAppDetail.PesoCode);
|
||||||
|
bodyXml.setAttribute("ipesodid", materialAppDetail.PesodId);
|
||||||
|
bodyXml.setAttribute("ipesoseq", materialAppDetail.PesoSeq);
|
||||||
|
|
||||||
|
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -111,8 +111,8 @@ namespace NX.ERP.U8.Store
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static object lockHeadobj = new object();
|
private object lockHeadobj = new object();
|
||||||
private static string strTemlateHead = "";
|
private string strTemlateHead = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -145,8 +145,8 @@ namespace NX.ERP.U8.Store
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static object lockBodyobj = new object();
|
private object lockBodyobj = new object();
|
||||||
private static string strTemlateBody = "";
|
private string strTemlateBody = "";
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -85,8 +85,9 @@ from InvPositionSum as a left join Inventory as b on a.cInvCode=b.cInvCode where
|
|||||||
var sql = @" select * from (select stock.cInvCode MaterialCode,stock.Qty as StockQty ,arrival.arrivalQty,d.cInvName as MaterialName,d.cInvStd as MaterialSpecsModel from (select cInvCode,SUM( iQuantity) as Qty from CurrentStock
|
var sql = @" select * from (select stock.cInvCode MaterialCode,stock.Qty as StockQty ,arrival.arrivalQty,d.cInvName as MaterialName,d.cInvStd as MaterialSpecsModel from (select cInvCode,SUM( iQuantity) as Qty from CurrentStock
|
||||||
group by cInvCode ) as stock
|
group by cInvCode ) as stock
|
||||||
left join
|
left join
|
||||||
(select cInvCode,SUM(iQuantity)-SUM(fValidInQuan) as arrivalQty from PU_ArrivalVouchs a,PU_ArrivalVouch b
|
(select cInvCode,SUM(iQuantity)-SUM(fValidInQuan) as arrivalQty from PU_ArrivalVouchs a
|
||||||
where a.ID=b.ID and isnull(b.cverifier,'')<>'' and bNegative=0
|
left join PU_ArrivalVouch b on a.ID=b.ID
|
||||||
|
where isnull(b.cverifier,'')<>'' and bNegative=0
|
||||||
group by cInvCode) as arrival on stock.cInvCode=arrival.cInvCode
|
group by cInvCode) as arrival on stock.cInvCode=arrival.cInvCode
|
||||||
left join Inventory as d on stock.cInvCode=d.cInvCode
|
left join Inventory as d on stock.cInvCode=d.cInvCode
|
||||||
) as tbl where (StockQty<>0 or arrivalQty<>0)
|
) as tbl where (StockQty<>0 or arrivalQty<>0)
|
||||||
|
|||||||
@@ -274,8 +274,9 @@ export const export_col_to_excel = (colums, data, filename) => {
|
|||||||
ws[XLSX.utils.encode_cell({ c: _col.left, r: _dataRow })] = v
|
ws[XLSX.utils.encode_cell({ c: _col.left, r: _dataRow })] = v
|
||||||
} else {
|
} else {
|
||||||
if (v) {
|
if (v) {
|
||||||
if (typeof v === 'number') {t = 'n'}
|
if (typeof v == 'number') t = 'n'
|
||||||
else if (typeof v === 'boolean') {t = 'b'}
|
else
|
||||||
|
if (typeof v == 'boolean') t = 'b'
|
||||||
else if (v instanceof Date) {
|
else if (v instanceof Date) {
|
||||||
t = 'd'
|
t = 'd'
|
||||||
// t = "n";
|
// t = "n";
|
||||||
|
|||||||
Reference in New Issue
Block a user