Przeglądaj źródła

采购发票接口

yaoyu 2 tygodni temu
rodzic
commit
80b6cbbbb6
1 zmienionych plików z 10 dodań i 4 usunięć
  1. 10 4
      pu/pu/src/private/nc/impl/th/InvoiceAddImpl.java

+ 10 - 4
pu/pu/src/private/nc/impl/th/InvoiceAddImpl.java

@@ -35,17 +35,22 @@ import nc.vo.pub.workflownote.WorkflownoteVO;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
 
+/**
+ * 采购发票
+ * 
+ *
+ */
 public class InvoiceAddImpl extends BaseServlet implements IHttpServletAdaptor {
 	IUAPQueryBS iuap = (IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
 
 	@Override
 	public void doAction(HttpServletRequest req, HttpServletResponse resp)throws ServletException, IOException {
 		try {
-			//InvocationInfoProxy.getInstance().setUserDataSource("NC6337");
+			InvocationInfoProxy.getInstance().setUserDataSource("NC6337");
 			NCLocator.getInstance().lookup(ISecurityTokenCallback.class).token("NCSystem".getBytes(),"pfxx".getBytes());
 			String createStr = buildJson(req, resp, this.getClass().getName());
 			JSONObject json = JSONObject.fromObject(createStr);
-			NcLog.info(json.toString());
+			NcLog.info("采购发票"+json.toString());
 			String vbillcode = "";
 			vbillcode = json.getString("vbillcode");
 			checkJson(json);//非空判断
@@ -122,6 +127,7 @@ public class InvoiceAddImpl extends BaseServlet implements IHttpServletAdaptor {
 				invoiceItemVO.setVbdef17(bodyObject.getString("vbdef17"));//发票分类(0=增值税发票,10=普通发票,20=其它发票)
 				invoiceItemVO.setVbdef15(bodyObject.getString("vbdef15"));//销售分公司
 				invoiceItemVO.setVbdef14(bodyObject.getString("vbdef14"));//是否一致
+				invoiceItemVO.setPk_apfinanceorg(SqlexecuteQuery("pk_financeorg", "org_financeorg", "code", bodyObject.getString("pk_apfinanceorg_v")));
 				invoiceItemVO.setPk_apfinanceorg_v(SqlexecuteQuery("pk_vid", "org_financeorg_v", "code", bodyObject.getString("pk_apfinanceorg_v")));//应付财务组织
 				invoiceItemVO.setVmemob(bodyObject.getString("vmemob"));//备注
 				invoiceItemVO.setFrowtype(0);//行类型(0=货物行,1=折扣行,2=劳务行,3=零数量行)
@@ -132,7 +138,7 @@ public class InvoiceAddImpl extends BaseServlet implements IHttpServletAdaptor {
 				invoiceItemVO.setCastunitid(invoiceItemVO.getCunitid());//单位
 				Map<String,String> map = new HashMap<String,String>();
 				String vfirstcode = bodyObject.getString("vfirstcode");
-				if(!"vfirstcode".equals(vfirstcode)) {
+				if(!"".equals(vfirstcode)) {
 					String vfirstrowno = bodyObject.getString("vfirstrowno");
 					String cfirsttypecode = bodyObject.getString("cfirsttypecode");
 					map = QueryDataUtil.getDataMap(cfirsttypecode, vfirstcode, vfirstrowno);
@@ -193,7 +199,7 @@ public class InvoiceAddImpl extends BaseServlet implements IHttpServletAdaptor {
 			e.printStackTrace(new PrintWriter(stringWriter));
 			// 获取详细信息
 			String msg = stringWriter.getBuffer().toString();	
-			NcLog.info(msg);
+			NcLog.info("采购发票"+msg);
 		}
 	}