فهرست منبع

根据组织过滤

yaoyu 1 سال پیش
والد
کامیت
3e30d4207c
1فایلهای تغییر یافته به همراه14 افزوده شده و 2 حذف شده
  1. 14 2
      xh/xh/src/private/nc/bs/xh/impl/TransformAddImpl.java

+ 14 - 2
xh/xh/src/private/nc/bs/xh/impl/TransformAddImpl.java

@@ -80,7 +80,8 @@ public class TransformAddImpl extends BaseServlet implements IHttpServletAdaptor
 			 */
 			transformheadvo.setVbillcode(vbillcode);
 			transformheadvo.setPk_group(SqlexecuteQuery("pk_group", "org_group", "code", json.getString("pk_group")));
-			transformheadvo.setPk_org(SqlexecuteQuery("pk_stockorg", "org_stockorg", "code", json.getString("pk_org")));
+			String pk_org = SqlexecuteQuery("pk_stockorg", "org_stockorg", "code", json.getString("pk_org"));
+			transformheadvo.setPk_org(pk_org);
 			transformheadvo.setPk_org_v(SqlexecuteQuery("pk_vid", "org_stockorg_v", "code", json.getString("pk_org")));
 			transformheadvo.setCorpoid(SqlexecuteQuery("pk_corp", "org_corp", "code", json.getString("corpoid")));
 			transformheadvo.setCorpvid(SqlexecuteQuery("pk_vid", "org_corp", "code", json.getString("corpoid")));
@@ -108,7 +109,7 @@ public class TransformAddImpl extends BaseServlet implements IHttpServletAdaptor
 				transformbodyvo.setPk_org_v(SqlexecuteQuery("pk_vid", "org_stockorg_v", "code", bodyObject.getString("pk_org")));
 				transformbodyvo.setCorpoid(SqlexecuteQuery("pk_corp", "org_corp", "code", bodyObject.getString("corpoid")));
 				transformbodyvo.setCorpvid(SqlexecuteQuery("pk_vid", "org_corp", "code", bodyObject.getString("corpoid")));
-				transformbodyvo.setCbodywarehouseid(SqlexecuteQuery("pk_stordoc", "bd_stordoc", "code", bodyObject.getString("cbodywarehouseid")));
+				transformbodyvo.setCbodywarehouseid(querStordocPK(pk_org, bodyObject.getString("cbodywarehouseid")));
 				transformbodyvo.setCmaterialoid(SqlexecuteQuery("pk_source", "bd_material_v", "code", bodyObject.getString("cmaterialoid")));
 				transformbodyvo.setCmaterialvid(SqlexecuteQuery("pk_material", "bd_material", "code", bodyObject.getString("cmaterialoid")));
 				transformbodyvo.setCunitid(SqlexecuteQuery("pk_measdoc", "bd_measdoc", "code", bodyObject.getString("cunitid")));
@@ -228,6 +229,17 @@ public class TransformAddImpl extends BaseServlet implements IHttpServletAdaptor
 		}
 	}
 	
+	
+	//查询仓库主键
+	public String querStordocPK(String pk_org,String code) throws Exception {
+		String sql = "select pk_stordoc from bd_stordoc where pk_org = '"+pk_org+"' and code = '"+code+"' and enablestate = '2' and nvl(dr,0) = 0 ";
+		String pk_stordoc = (String) iuap.executeQuery(sql, new ColumnProcessor());
+		if (pk_stordoc == null) {
+			throw new Exception("未查询到数据!请检查编码"+code+"是否正确!");
+		}
+		return pk_stordoc;
+	}
+	
 	/*
 	 * 查询转换类型pk
 	 */