|
@@ -1,9 +1,13 @@
|
|
|
package nc.bs.arap.plugin;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
import nc.bs.framework.common.NCLocator;
|
|
|
import nc.itf.uap.IUAPQueryBS;
|
|
|
import nc.jdbc.framework.processor.BeanProcessor;
|
|
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
|
|
+import nc.jdbc.framework.processor.MapProcessor;
|
|
|
import nc.vo.org.DeptVO;
|
|
|
import nc.vo.org.FinanceOrgVO;
|
|
|
import nc.vo.pu.m25.entity.InvoiceItemVO;
|
|
@@ -255,5 +259,42 @@ public class GetDataUtil {
|
|
|
return invoiceItemVO;
|
|
|
}
|
|
|
|
|
|
+ //查询源头和来源数据
|
|
|
+ public static Map<String,String> getDataMap(String type,String vbillcode,String crowno)throws Exception {
|
|
|
+ if("".equals(vbillcode)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ Map<String,String> map = new HashMap<String,String>();
|
|
|
+ String sql = "";
|
|
|
+
|
|
|
+ if("20".equals(type)) {
|
|
|
+ sql = "select pk_praybill as pk_id,pk_praybill_b as pk_id_b from po_praybill_b where pk_praybill = (select pk_praybill from po_praybill where vbillcode = '"+vbillcode+"' and nvl(dr,0) = 0) and crowno = '"+crowno+"' and nvl(dr,0) = 0";
|
|
|
+ map = (Map<String, String>) iuap.executeQuery(sql.toString(), new MapProcessor());
|
|
|
+ if(map == null) {
|
|
|
+ throw new Exception("获取请购单信息失败,未找到与参数" + vbillcode + ","+crowno+"有关的数据!");
|
|
|
+ }
|
|
|
+ }else if("Z2".equals(type)) {
|
|
|
+ sql = "select pk_ct_pu as pk_id,pk_ct_pu_b as pk_id_b from ct_pu_b where pk_ct_pu = (select pk_ct_pu from ct_pu where vbillcode = '"+vbillcode+"' and nvl(dr,0) = 0) and crowno = '"+crowno+"' and nvl(dr,0) = 0";
|
|
|
+ map = (Map<String, String>) iuap.executeQuery(sql.toString(), new MapProcessor());
|
|
|
+ if(map == null) {
|
|
|
+ throw new Exception("获取采购合同信息失败,未找到与参数" + vbillcode + ","+crowno+"有关的数据!");
|
|
|
+ }
|
|
|
+ }else if("21".equals(type)) {
|
|
|
+ sql = "select pk_order as pk_id,pk_order_b as pk_id_b from po_order_b where pk_order = (select pk_order from po_order where vbillcode = '"+vbillcode+"' and nvl(dr,0) = 0) and crowno = '"+crowno+"' and nvl(dr,0) = 0";
|
|
|
+ map = (Map<String, String>) iuap.executeQuery(sql.toString(), new MapProcessor());
|
|
|
+ if(map == null) {
|
|
|
+ throw new Exception("获取采购订单信息失败,未找到与参数" + vbillcode + ","+crowno+"有关的数据!");
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if("45".equals(type)) {
|
|
|
+ sql = "select cgeneralhid as pk_id,cgeneralbid as pk_id_b from ic_purchasein_b where cgeneralhid = (select cgeneralhid from vbillcode = '"+vbillcode+"' and nvl(dr,0) = 0) and crowno = '"+crowno+"' and nvl(dr,0) = 0";
|
|
|
+ map = (Map<String, String>) iuap.executeQuery(sql.toString(), new MapProcessor());
|
|
|
+ if(map == null) {
|
|
|
+ throw new Exception("获取采购入库单信息失败,未找到与参数" + vbillcode + ","+crowno+"有关的数据!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|