diff --git a/WebContent/Tenwa/Comm/DocList/DocListMain.jsp b/WebContent/Tenwa/Comm/DocList/DocListMain.jsp index 24c6a31ea..47d672065 100644 --- a/WebContent/Tenwa/Comm/DocList/DocListMain.jsp +++ b/WebContent/Tenwa/Comm/DocList/DocListMain.jsp @@ -40,7 +40,7 @@ var docList="<%=docList%>"; myleft.width=1; if("SingleRow"=="<%=type%>"){ - if("FundPaymentCarFlow"=="<%=sFlowNo%>"||"BusinessApplyFlow"=="<%=sFlowNo%>"||"MortgageFileFlow"=="<%=sFlowNo%>"||"ProjectCreditFlow"=="<%=sFlowNo%>"||"ContractSupportFlow"=="<%=sFlowNo%>"||"ProjectRecreditFlow"=="<%=sFlowNo%>"||"ProjectSupportFlow"=="<%=sFlowNo%>"||"ProjectApprovalFlow"=="<%=sFlowNo%>"||"FundPaymentFlow"=="<%=sFlowNo%>"){ + if("FundPaymentCarFlow"=="<%=sFlowNo%>"||"BusinessApplyFlow"=="<%=sFlowNo%>"||"MortgageFileFlow"=="<%=sFlowNo%>"||"ProjectCreditFlow"=="<%=sFlowNo%>"||"ContractSupportFlow"=="<%=sFlowNo%>"||"ProjectRecreditFlow"=="<%=sFlowNo%>"||"ProjectSupportFlow"=="<%=sFlowNo%>"||"ProjectApprovalFlow"=="<%=sFlowNo%>"||"FundPaymentFlow"=="<%=sFlowNo%>"||"ProjectCancelFlow"=="<%=sFlowNo%>"){ AsControl.OpenView("/Tenwa/Comm/DocList/PayDocList.jsp","docList="+docList,"right",""); }else{ AsControl.OpenView("/Tenwa/Comm/DocList/BussinessApproveDocList.jsp","docList="+docList,"right",""); diff --git a/WebContent/Tenwa/Comm/DocList/PayDocList.jsp b/WebContent/Tenwa/Comm/DocList/PayDocList.jsp index 8a284d218..fcebf0f5f 100644 --- a/WebContent/Tenwa/Comm/DocList/PayDocList.jsp +++ b/WebContent/Tenwa/Comm/DocList/PayDocList.jsp @@ -43,7 +43,9 @@ } String compClientID = request.getParameter("CompClientID"); - + if("ProjectRecreditFlow".equals(sObjectType)){ + sTempletNo = "FlowPayDocList" ; + } Map docParam=new HashMap(); Map other=new HashMap(); other.put("carAttributes", carAttributes); diff --git a/WebContent/Tenwa/Core/FlowManager/BaseFlowList/BaseFlowApplyListStart.jspf b/WebContent/Tenwa/Core/FlowManager/BaseFlowList/BaseFlowApplyListStart.jspf index c519b4cae..26d3e3b37 100644 --- a/WebContent/Tenwa/Core/FlowManager/BaseFlowList/BaseFlowApplyListStart.jspf +++ b/WebContent/Tenwa/Core/FlowManager/BaseFlowList/BaseFlowApplyListStart.jspf @@ -36,8 +36,12 @@ doTemp.setVisible("CONTRACT_NO", true); } //doTemp.appendJboWhere(applyManager.getWhereClause()+" order by objectNo desc "); - //Èç¹ûÊÇÏîÄ¿Á¢ÏÔòÌí¼ÓÉêÇëÈËÊÇÖ÷ÉêÇëÈ˵ÄwhereÌõ¼þ - if("ProjectApproalApply".equals(sApplyType)||"ContractChangeApply".equals(sApplyType)||"ContractCancelApply".equals(sApplyType)){ + //Èç¹ûÊÇÏîÄ¿Á¢ÏÔòÌí¼ÓÉêÇëÈËÊÇÖ÷ÉêÇëÈ˵ÄwhereÌõ¼þTAssetsDisposalEndApply + if("ProjectApproalApply".equals(sApplyType)||"ContractChangeApply".equals(sApplyType)||"ContractCancelApply".equals(sApplyType) + ||"ContractOnhireChangeApply".equals(sApplyType)||"TriditionContractChangeApply".equals(sApplyType)||"ContractSupportApply".equals(sApplyType) + ||"ContractEndApply".equals(sApplyType)||"ProjectChangeApply".equals(sApplyType)||"ProjectCancelApply".equals(sApplyType)||"ProjectCreditApply".equals(sApplyType) + ||"FundPaymentApply".equals(sApplyType)||"ProjectRecreditApply".equals(sApplyType)||"ProjectSupportApply".equals(sApplyType)||"ContractApprovalApply".equals(sApplyType) + ||"TAssetsDisposalApply".equals(sApplyType)||"TAssetsDisposalEndApply".equals(sApplyType)||"TAssetsDisposalFeeApply".equals(sApplyType)){ doTemp.appendJboWhere(applyManager.getWhereClause()+" and cpt.is_main='Y'"); }else{ doTemp.appendJboWhere(applyManager.getWhereClause()); diff --git a/WebContent/Tenwa/Lease/Flow/AssetsDisposal/AssetsDisposalApply/AssetsDisposalApplyList.jsp b/WebContent/Tenwa/Lease/Flow/AssetsDisposal/AssetsDisposalApply/AssetsDisposalApplyList.jsp index 821bced6a..edba0ca80 100644 --- a/WebContent/Tenwa/Lease/Flow/AssetsDisposal/AssetsDisposalApply/AssetsDisposalApplyList.jsp +++ b/WebContent/Tenwa/Lease/Flow/AssetsDisposal/AssetsDisposalApply/AssetsDisposalApplyList.jsp @@ -5,7 +5,23 @@ /*~[Describe=ÐÂÔö¼Ç¼;InputParam=ÎÞ;OutPutParam=ÎÞ;]~*/ function newApply() { - AsDialog.OpenSelector("SelectPaymentForAssetsDisposal","","dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){ + var flowno="<%=CurPage.getParameter("ApplyType")%>"; + var selname=""; + var orgId="<%=CurUser.getOrgID()%>".substring(0,7); + var businessType=""; + if("AssetsDisposalApply"==flowno){ + businessType="1"; + }else{ + if(orgId=="8009013"){ + businessType="3"; + }else if(orgId=="8009010"){ + businessType="2"; + }else{ + alert("µ±Ç°Óû§²»ÄÜ·¢ÆðÉêÇ룡"); + return; + } + } + AsDialog.OpenSelector("SelectPaymentForAssetsDisposal","businessType,"+businessType,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){ if(!sReturn||sReturn=="_CANCEL_"||sReturn=="_NONE_"){ //alert(getHtmlMessage('1'));//ÇëÑ¡ÔñÒ»ÌõÐÅÏ¢£¡ return; diff --git a/WebContent/Tenwa/Lease/Flow/AssetsDisposal/AssetsDisposalFeeApply/AssetsDisposalFeeApplyList.jsp b/WebContent/Tenwa/Lease/Flow/AssetsDisposal/AssetsDisposalFeeApply/AssetsDisposalFeeApplyList.jsp index fe8e45df4..9f33abcb1 100644 --- a/WebContent/Tenwa/Lease/Flow/AssetsDisposal/AssetsDisposalFeeApply/AssetsDisposalFeeApplyList.jsp +++ b/WebContent/Tenwa/Lease/Flow/AssetsDisposal/AssetsDisposalFeeApply/AssetsDisposalFeeApplyList.jsp @@ -5,7 +5,23 @@ /*~[Describe=ÐÂÔö¼Ç¼;InputParam=ÎÞ;OutPutParam=ÎÞ;]~*/ function newApply() { - AsDialog.OpenSelector("SelectAssetsDisposalForFee","","dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){ + var flowno="<%=CurPage.getParameter("ApplyType")%>"; + var selname=""; + var orgId="<%=CurUser.getOrgID()%>".substring(0,7); + var businessType=""; + if("TAssetsDisposalFeeApply"==flowno){ + businessType="1"; + }else{ + if(orgId=="8009013"){ + businessType="3"; + }else if(orgId=="8009010"){ + businessType="2"; + }else{ + alert("µ±Ç°Óû§²»ÄÜ·¢ÆðÉêÇ룡"); + return; + } + } + AsDialog.OpenSelector("SelectAssetsDisposalForFee","businessType,"+businessType,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){ if(!sReturn||sReturn=="_CANCEL_"||sReturn=="_NONE_"){ //alert(getHtmlMessage('1'));//ÇëÑ¡ÔñÒ»ÌõÐÅÏ¢£¡ return; diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/TriditionLCContractTerminateInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/TriditionLCContractTerminateInfo.jsp new file mode 100644 index 000000000..afa43fa42 --- /dev/null +++ b/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/TriditionLCContractTerminateInfo.jsp @@ -0,0 +1,164 @@ +<%@ page contentType="text/html; charset=GBK"%> +<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %> +<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><% + /* + Author: undefined 2017-06-26 + Content: ʾÀýÏêÇéÒ³Ãæ + History Log: + */ + + String flowunid = CurPage.getParameter("FlowUnid"); + String contractid = CurPage.getParameter("ContractId"); + String RightType = CurPage.getParameter("RightType");//Ñ¡Ôñģʽ + String ishistory=CurPage.getParameter("IsHistory"); + String nodeNo=CurPage.getParameter("NodeNo"); + + BizObject condition=JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP","flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false); + String paymentnumber=condition.getAttribute("payment_number").getString(); + String contractId=condition.getAttribute("contract_id").getString(); + //»ñÈ¡ÏîĿΥԼ½ð£¨Ö»Óд«Í³µÄÓУ© + String total_all = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_CALC_CONDITION","CONTRACT_ID=:contractid").setParameter("contractid", contractid).getSingleResult(false).getAttribute("TOTAL_ALL").getString(); + + BizObject flow=GetFlowAction.getFlowBussinessObject(flowunid); + String productId=flow.getAttribute("productId").getString(); + + String sTempletNo = "TriditionLCContractTerminate";//--Ä£°åºÅ-- + ASObjectModel doTemp = new ASObjectModel(sTempletNo); + doTemp.setDefaultValue("PAYMENT_NUMBER", paymentnumber); + doTemp.setHtmlEvent("PAYDAY_ADJUST","onchange","getTerminateInfo"); + doTemp.setHtmlEvent("REPURCHASE_RATIO","onchange","getRepurchaseMoney"); + + doTemp.setHtmlEvent("HANDLING_CHARGE","onchange","changeContract"); + doTemp.setHtmlEvent("AGREED_PENALTY","onchange","changeContract"); + doTemp.setHtmlEvent("AGREED_INTEREST","onchange","changeContract"); + doTemp.setHtmlEvent("COLLECT_FEES","onchange","changeContract"); + + ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); + dwTemp.Style = "2";//freeform + if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){ + dwTemp.ReadOnly = "-2";//Ö»¶Áģʽ + isShowButton=false; + }else{ + isShowButton=true; + } + dwTemp.genHTMLObjectWindow(flowunid); + + String sButtons[][] = { + {"true","","Button","Ìáǰ½áÇå","Ìáǰ½áÇå","saveRecord()","","","","btn_icon_settle"}, + {"true","","Button","³·Ïú½áÇå","³·Ïú½áÇå","cancelChange()","","","","btn_icon_delete"} + }; + sButtonPosition = "south"; +%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Lease/Flow/Contract/ContractOnhireChange/ContractOnhireChangeApplyList.jsp b/WebContent/Tenwa/Lease/Flow/Contract/ContractOnhireChange/ContractOnhireChangeApplyList.jsp index ec3a8346a..cd5212213 100644 --- a/WebContent/Tenwa/Lease/Flow/Contract/ContractOnhireChange/ContractOnhireChangeApplyList.jsp +++ b/WebContent/Tenwa/Lease/Flow/Contract/ContractOnhireChange/ContractOnhireChangeApplyList.jsp @@ -9,7 +9,7 @@ var selname=""; var orgId="<%=CurUser.getOrgID()%>".substring(0,7); var businessType=""; - if("ContractOnhireCarChangeApply"==flowno){ + if("ContractOnhireCarChangeApply"==flowno||"ContractBasicInfoChangeApply"==flowno){ businessType="1"; }else{ if(orgId=="8009011"){ diff --git a/WebContent/Tenwa/Lease/Flow/RentNotify/TriditionRentNotifyList.jsp b/WebContent/Tenwa/Lease/Flow/RentNotify/TriditionRentNotifyList.jsp index f43ac50af..ffc33d11e 100644 --- a/WebContent/Tenwa/Lease/Flow/RentNotify/TriditionRentNotifyList.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentNotify/TriditionRentNotifyList.jsp @@ -60,10 +60,6 @@ window.open(sWebRootPath+"/servlet/view/docDownloadServlet?CompClientID=<%=sCompClientID%>&sqlString=save@"+id, "downloadTemplate"); } function generateQuotation(){ - /* var paymentnumber=getItemValue(0,getRow(0),"PAYMENT_NUMBER"); - var planlist=getItemValue(0,getRow(0),"PLAN_LIST"); - alert(sss); - return; */ var PAYMENT_NUMBERS=getItemValueArray(0,"PAYMENT_NUMBER"); var PLAN_LISTS=getItemValueArray(0,"PLAN_LIST"); @@ -77,7 +73,6 @@ var tempParam={}; var sparam=""; //Ä£°åºÅ - // param["templateNo"]="ceaa18f72b0e4bbaa6e66dcfd7e32c87"; param["templateNo"]="372f9e55fae944a5964b6f6b1503c0c2"; //Éú³ÉÎļþ¹ØÁª¹ØÏµ @@ -88,8 +83,7 @@ tempParam["PLAN_NUMBER"]=PAYMENT_NUMBERS[i]; tempParam["customername"]=customernames[i]; tempParam["contract_number"]=contract_numbers[i]; - - + //Éú³ÉÄ£°å¹Ì¶¨²ÎÊý tempParam["CurUserId"]="<%=CurUser.getUserID()%>"; tempParam["CurOrgId"]="<%=CurUser.getOrgID()%>"; diff --git a/WebContent/Tenwa/Lease/voucher/voucherass_detail.jsp b/WebContent/Tenwa/Lease/voucher/voucherass_detail.jsp index 363c2f383..34358e1cc 100644 --- a/WebContent/Tenwa/Lease/voucher/voucherass_detail.jsp +++ b/WebContent/Tenwa/Lease/voucher/voucherass_detail.jsp @@ -37,11 +37,7 @@ function NCInterface(){ alert("´«Ê俪ʼ"); var mes = RunJavaMethodTrans("com.tenwa.voucher.serviceImp.VoucherSysJointNCServiceImpl","sendVoucherData",""); - if("true"==mes){ - alert("´«Êä³É¹¦"); - }else{ - alert("´«Êäʧ°Ü"); - } + alert("´«ÊäÍê³É"); } function synVoucherCode(){ diff --git a/WebContent/fileTemplate/租金支付通知书.docx b/WebContent/fileTemplate/租金支付通知书.docx index 50d87fdf5..0ad42898e 100644 Binary files a/WebContent/fileTemplate/租金支付通知书.docx and b/WebContent/fileTemplate/租金支付通知书.docx differ diff --git a/calc/com/tenwa/reckon/executor/FundFundPlanExecutor.java b/calc/com/tenwa/reckon/executor/FundFundPlanExecutor.java index 0c6210e7d..98851aa90 100644 --- a/calc/com/tenwa/reckon/executor/FundFundPlanExecutor.java +++ b/calc/com/tenwa/reckon/executor/FundFundPlanExecutor.java @@ -220,7 +220,7 @@ public class FundFundPlanExecutor { if(!"business_product".equals(tcb.getProductType())) { if("N".equals(item.getItemDescribe())) continue; } else { - if("N".equals(item.getAttribute2())) continue; + if("N".equals(item.getAttribute3())) continue; } ffcp.setPlanDate(this.getPlanDate(StringUtil.nullToString(param.get("CostType02")), cb)); ffcp.setPlanMoney(temp.toString()); diff --git a/src_core/com/tenwa/util/SerialNumberUtil.java b/src_core/com/tenwa/util/SerialNumberUtil.java index 9005b54f1..04ae81e95 100644 --- a/src_core/com/tenwa/util/SerialNumberUtil.java +++ b/src_core/com/tenwa/util/SerialNumberUtil.java @@ -50,6 +50,10 @@ public class SerialNumberUtil { public static synchronized String getRentOutNoNumber(JBOTransaction tx) throws Exception{ return SerialNumberUtil.getSerialNumber("PR{year}{month}{maxOrderNumber}",4,null, "", null, tx); } + + public static synchronized String getVoucherPCNumber(JBOTransaction tx) throws Exception{ + return SerialNumberUtil.getSerialNumber("AP{year}{month}{day}-{maxOrderNumber}",3,null, "ƾ֤½Ó¿ÚÅú´Î", null, tx); + } /** * ͨÁª´ú¿ÛÁ÷Ë®ºÅ * @param tx diff --git a/src_core/com/tenwa/voucher/service/VoucherSysJointNCService.java b/src_core/com/tenwa/voucher/service/VoucherSysJointNCService.java index 956c3ea02..1e2d662c0 100644 --- a/src_core/com/tenwa/voucher/service/VoucherSysJointNCService.java +++ b/src_core/com/tenwa/voucher/service/VoucherSysJointNCService.java @@ -3,5 +3,5 @@ package com.tenwa.voucher.service; import com.amarsoft.are.jbo.JBOTransaction; public interface VoucherSysJointNCService { - public String sendVoucherData(JBOTransaction tx)throws Exception; + public void sendVoucherData(JBOTransaction tx)throws Exception; } diff --git a/src_core/com/tenwa/voucher/serviceImp/VoucherSysJointNCServiceImpl.java b/src_core/com/tenwa/voucher/serviceImp/VoucherSysJointNCServiceImpl.java index e7ef8e3a0..0fab376c3 100644 --- a/src_core/com/tenwa/voucher/serviceImp/VoucherSysJointNCServiceImpl.java +++ b/src_core/com/tenwa/voucher/serviceImp/VoucherSysJointNCServiceImpl.java @@ -22,7 +22,6 @@ import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; -import org.apache.jasper.tagplugins.jstl.core.ForEach; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; @@ -30,6 +29,7 @@ import org.dom4j.io.DocumentSource; import org.dom4j.io.OutputFormat; import org.dom4j.io.SAXReader; import org.dom4j.io.XMLWriter; +import org.junit.Test; import com.amarsoft.are.ARE; import com.amarsoft.are.jbo.BizObject; @@ -43,6 +43,7 @@ import com.amarsoft.awe.util.Transaction; import com.amarsoft.dict.als.manage.NameManager; import com.sun.istack.internal.logging.Logger; import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.util.SerialNumberUtil; import com.tenwa.voucher.service.VoucherSysJointNCService; import jbo.com.tenwa.entity.comm.own.OWN_INFO; import jbo.voucher.LV_STACTS_CONFIG; @@ -52,93 +53,57 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { /** * µ÷ÓÃÉú³ÉxmlµÄ·½·¨ */ - public String sendVoucherData(JBOTransaction tx){ - // »ñÈ¡·µ»Ø½á¹û, ÓÃÓÚÒ³ÃæÌáʾ - String trueOrFalse = getVoucherToXML(tx); - return trueOrFalse; - } - - /** - * ÏÈ»ñÈ¡V8ÊÓͼÖÐµÄÆ¾Ö¤±àºÅ, È»ºóÒÀ´ÎÉú³ÉËùÐèxml - * @param tx - */ - public static String getVoucherToXML(JBOTransaction tx) { - try { - Transaction Sqlca = null; - Sqlca = Transaction.createTransaction(tx); - Map map = new HashMap(); - // »ñÈ¡vi_voucher_v8ÊÓͼÖеÄÊý¾Ý - List> list= getDataList(Sqlca);// »ñÈ¡ËùÓÐÆ¾Ö¤±àºÅ - // Éú³Éƾ֤ÐÅÏ¢xmlÎļþ - DOM4JcreateToVoucher(Sqlca,list,map); - // Éú³É¿Í»§ÐÅÏ¢xmlÎļþ - DOM4JcreateToCustomer(Sqlca); - // Éú³É¾­ÏúÉÌÐÅÏ¢xmlÎļþ - DOM4JcreateToSupplier(Sqlca); - // Éú³É¸¨ÖúºÏͬÐÅÏ¢xmlÎļþ - DOM4JcreateToDefdoc(Sqlca); - tx.commit(); - } catch (Exception e) { - try { - tx.rollback(); - } catch (JBOException e1) { - e1.printStackTrace(); - } - e.printStackTrace(); - return "false"; - }finally { - try { - if(tx !=null){ - tx.commit(); - } - } catch (Exception e2) { - e2.printStackTrace(); } - } - return "true"; - } - /** - * »ñÈ¡Êý¾Ý¿âƾ֤ÐÅÏ¢±íËùÓеĴý´«F3ƾ֤±àºÅ - * @throws Exception - */ - private static List> getDataList(JBOTransaction tx) throws Exception{ - // ²éѯËùÓдý´«ÊäµÄÊý¾Ý - String sql = "SELECT F3,F60,ID,MODULE_NAME,DEPT_NAME,F1,F15,V8_STATUS,F5,GENERATE_DATE FROM VI_VOUCHER_V8 WHERE F3 NOT IN(SELECT F3 FROM VOUCHER_LOG WHERE FLAG = '1')"; - List> dataList = DataOperatorUtil.getDataBySql(tx, sql, null);// ½«ËùÓÐÆ¾Ö¤ºÅ·â×°µ½list¼¯ºÏÖÐ - return dataList; + public void sendVoucherData(JBOTransaction tx){ + // Éú³Éƾ֤ÐÅÏ¢xmlÎļþ + DOM4JcreateToVoucher(tx); + // Éú³É¿Í»§ÐÅÏ¢xmlÎļþ + DOM4JcreateToCustomer(tx); + // Éú³É¾­ÏúÉÌÐÅÏ¢xmlÎļþ + DOM4JcreateToSupplier(tx); + // Éú³É¸¨ÖúºÏͬÐÅÏ¢xmlÎļþ + DOM4JcreateToDefdoc(tx); } /** * ƾ֤ÐÅÏ¢xmlÉú³É, ÿ1000ÌõÉú³ÉÒ»¸öxml * @throws Exception */ - private static void DOM4JcreateToVoucher(Transaction Sqlca,List>list, Map map) throws Exception { + private static void DOM4JcreateToVoucher(JBOTransaction tx){ // ±¾µØxml´æ·ÅÎļþ¼Ð, ûÓоʹ´½¨ - /*File file2 = new File("D:\\voucherXml_NC"); - if (!file2.exists()) {file2.mkdirs();}// ÅжÏÊÇ·ñ´æÔÚ, Èç¹û²»´æÔھʹ´½¨¸ÃÎļþ¼Ð -*/ // ¶¨ÒåÈ«¾Ö¶ÔÏó + // File file2 = new File("D:\\voucherXml_NC"); + // if (!file2.exists()) {file2.mkdirs();}// ÅжÏÊÇ·ñ´æÔÚ, Èç¹û²»´æÔھʹ´½¨¸ÃÎļþ¼Ð + Transaction Sqlca = null; + try { + // ¶¨ÒåÈ«¾Ö¶ÔÏó + Sqlca = Transaction.createTransaction(tx); + Map map = new HashMap(); Document document=null; // xmlÎļþÍ· File file=null; // Éú³ÉµÄxmlÎļþ·¾¶ XMLWriter writer=null; // Êä³ö¶ÔÏó - String str=""; // xmlÖ÷¼üid + String uuid=""; // xmlÖ÷¼üid String SUBJECT_ID=null; // »ñÈ¡¿ÆÄ¿id String OWNED_COMPANY = null; // ËùÊô¹«Ë¾ String ACC_YEAR = null; // »á¼ÆÆÚ¼ä/Äê String ACC_MONTH = null; // »á¼ÆÆÚ¼ä/Ô - String tableName="VOUCHER_LOG"; // ±íÃû String insertSql=""; // ¶¨ÒåÐÂÔöÓï¾ä¶ÔÏó - SqlObject sqlObject=null; // sqlObject¶ÔÏó - Date time = new Date(); // »ñÈ¡µ±Ç°Ê±¼ä¶ÔÏó, ²¢¸ñʽ»¯ - SimpleDateFormat formatter1 = new SimpleDateFormat("yyyyMMddHHmmss");// ÄêÔÂÈÕʱ·ÖÃë - SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// ÄêÔÂÈÕʱ·ÖÃë - String year_month_day = formatter1.format(time); // ÄêÔÂÈÕʱ·ÖÃë - String year_month_days = formatter2.format(time); // ÄêÔÂÈÕʱ·ÖÃë + String type="voucher"; // ¼Ç¼±íÀà±ð String timeAll = ""; // ÖÆµ¥ÈÕÆÚ + + String year_month_day = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); + String year_month_days = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + + // ²éѯƾ֤ÊÓͼ, »ñȡÿÌõƾ֤ + String sql = "SELECT F3,F60,ID,MODULE_NAME,DEPT_NAME,F1,F15,V8_STATUS,F5,GENERATE_DATE FROM VI_VOUCHER_V8 WHERE F3 NOT IN(SELECT TABLE_NUM FROM NCXML_DETAIL_RECORDS WHERE FLAG = '1' AND XML_TYPE='"+type+"')"; + List> list = DataOperatorUtil.getDataBySql(Sqlca, sql, null);// ½«ËùÓÐÆ¾Ö¤ºÅ·â×°µ½list¼¯ºÏÖÐ + int a = list.size(); // v8ÊÓͼ×ÜÊý¾ÝÁ¿/ xmlÖÐÉú³ÉµÄ×ÜÌõÊý int b=1000; // ÉèÖõ±Ç°xmlÉú³ÉµÄÌõÊý int c = (int)(a / b); // »ñÈ¡Éú³ÉxmlÎļþµÄÊýÁ¿, ×î´óÑ­»·Öµ=c+1 for (int i = 0; i <=c; i++) { + int count=0; // ¼Ç¼µ±Ç°Åú´Î´«Êä×ÜÁ¿ + Sqlca = Transaction.createTransaction(tx); document = DocumentHelper.createDocument(); // ´´½¨Document¶ÔÏó Element root = document.addElement("ufinterface"); // ÉèÖÃxmlÍ· - root.addAttribute("account", "0001"); // ÉèÖÃxmlÍ·ÊôÐÔ + root.addAttribute("account", "q0225"); // ÉèÖÃxmlÍ·ÊôÐÔ root.addAttribute("billtype", "vouchergl"); root.addAttribute("businessunitcode", "develop"); root.addAttribute("filename", ""); @@ -149,14 +114,17 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { root.addAttribute("replace", "Y"); root.addAttribute("roottag", ""); root.addAttribute("sender", "001"); + String batch = SerialNumberUtil.getVoucherPCNumber(Sqlca); for (int x = i * b; x < (i + 1) * b && x < a; x++) { // ¾ö¶¨µ±Ç°xmlÉú³ÉµÄÊý¾ÝÁ¿ // »ñȡƾ֤±àºÅ String F3=list.get(x).get("F3"); map.clear(); map.put("F3",F3); + // »ñÈ¡v8±í½è·½Êý¾Ý String sql1 = "SELECT f7,f6,f5,f15,f63,f64,f73,f74,f75,f76 FROM VOUCHER_V8 WHERE F3=:F3 AND ENTRYDC='1'"; List> v1 = DataOperatorUtil.getDataBySql(Sqlca,sql1,map); + // »ñÈ¡v8±í´û·½Êý¾Ý String sql2 = "SELECT f8,f6,f5,f15,f63,f64,f73,f74,f75,f76,f49,f51,f52,f12 FROM VOUCHER_V8 WHERE F3=:F3 AND ENTRYDC='-1'"; List> v2 = DataOperatorUtil.getDataBySql(Sqlca,sql2,map); @@ -168,12 +136,15 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { ACC_MONTH =map2.get("f52"); // »á¼ÆÆÚ¼ä/Ô timeAll =map2.get("f15"); // ÖÆµ¥Ê±¼ä } + + // »ñÈ¡±¾·½ÐÅÏ¢ BizObject own = JBOFactory.createBizObjectQuery(OWN_INFO.CLASS_NAME, "id=:OWNED_COMPANY").setParameter("OWNED_COMPANY", OWNED_COMPANY).getSingleResult(false); + Element voucher = root.addElement("voucher"); Element voucherHead = voucher.addElement("voucher_head"); Element pkVoucher = voucherHead.addElement("pk_voucher");// ƾ֤Ö÷¼ü/·Ç¿Õ - str=UUID.randomUUID().toString().replace("-", ""); - pkVoucher.setText(str); + uuid=UUID.randomUUID().toString().replace("-", ""); + pkVoucher.setText(uuid); Element pk_vouchertype = voucherHead.addElement("pk_vouchertype");// ƾ֤Àà±ð, ĬÈÏ01/·Ç¿Õ pk_vouchertype.setText("1");//---------------------------------------------------------------------- Element year = voucherHead.addElement("year");// »á¼ÆÄê¶È/·Ç¿Õ @@ -323,6 +294,7 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { Element pk_innercorp1 = cashFlow_item1.addElement("pk_innercorp");// ÄÚ²¿µ¥Î»Ö÷¼ü,×î´ó³¤¶ÈΪ64,ÀàÐÍΪ:String pk_innercorp1.setText(""); } + // Ñ­»·´û·½¼¯ºÏ, °´ÕÕv8±íÊý¾ÝÖÐÉú³ÉÏàÓ¦µÄ½è·½item for (Map v8loan : v2) { // ¸ù¾Ý¿ÆÄ¿id, »ñÈ¡µ±Ç°Êý¾Ý¶ÔÓ¦µÄ¿ÆÄ¿ÐÅÏ¢ @@ -423,12 +395,14 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { Element pk_innercorp2 = cashflowitem2.addElement("pk_innercorp");// ÄÚ²¿µ¥Î»Ö÷¼ü,×î´ó³¤¶ÈΪ64,ÀàÐÍΪ:String pk_innercorp2.setText(""); } - // ÐÂÔöµ±Ìõƾ֤ÐÅÏ¢Èçvoucher_log±í - insertSql="INSERT INTO VOUCHER_LOG(BILLID,F3,FLAG,CREATE_TIME) VALUES('"+str+"','"+F3+"','1','"+year_month_days+"')"; + // ÐÂÔöµ±Ìõƾ֤ÐÅÏ¢Èë¼Ç¼×Ö±í + //insertSql="INSERT INTO VOUCHER_LOG(BILLID,F3,FLAG,CREATE_TIME,BATCH) VALUES('"+str+"','"+F3+"','1','"+year_month_days+"','"+batch+"')"; + insertSql="INSERT INTO NCXML_DETAIL_RECORDS(BILLID,XML_TYPE,TABLE_NUM,FLAG,CREATE_TIME,BATCH) VALUES('"+uuid+"','"+type+"','"+F3+"','1','"+year_month_days+"','"+batch+"')"; //sqlObject = new SqlObject(insertSql); //Sqlca.executeSQL(sqlObject); Sqlca.executeSQL(insertSql); logger.info("ƾ֤¼Ç¼±í²åÈëÓï¾ä: "+insertSql); + count++; } String URL="//data//files//apzl_leasing//tmp//XZW//APleasing_VOUCHER_"+year_month_day+".xml"; //String URL="D:\\voucherXml_NC\\APleasing_VOUCHER_"+year_month_day+".xml"; @@ -437,181 +411,196 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { writer.setEscapeText(false);// ×Ö·ûÊÇ·ñתÒå,ĬÈÏtrue writer.write(document); writer.close(); - InterActionToNC(Sqlca,URL,tableName); + InterActionToNC(Sqlca,URL,type,batch,count); + Sqlca.commit(); } + } catch (Exception e) { + try { + Sqlca.rollback(); + } catch (JBOException e1) { + e1.printStackTrace(); + } + e.printStackTrace(); + }finally { + if(Sqlca!=null) { + try { + Sqlca.disConnect(); + } catch (JBOException e) { + e.printStackTrace(); + } + } + } } /** * ¿Í»§ÐÅÏ¢xmlÉú³É, ÿ1000ÌõÉú³ÉÒ»¸öxml * @throws Exception * @throws Exception */ - private static void DOM4JcreateToCustomer(Transaction Sqlca) throws Exception{ - // ÅжϸÃÎļþ¼ÐÊÇ·ñ´æÔÚ, Èç¹û²»´æÔھʹ´½¨ - /*File file2 = new File("D:\\voucherXml_NC"); - if(file2.exists()) {file2.mkdirs();} */ - // ¶¨ÒåÈ«¾Ö¶ÔÏó - // Éú³ÉxmlµÄ·¾¢ - File file=null; - // Êä³ö¶ÔÏó - XMLWriter writer=null; - // ±íÃû - String tableName="CUSTOMER_LOG"; + private static void DOM4JcreateToCustomer(JBOTransaction tx){ + Transaction Sqlca = null; + try { + Sqlca = Transaction.createTransaction(tx); + File file=null; // ¶¨ÒåÎļþ¶ÔÏó + XMLWriter writer=null; // ¶¨ÒåÊä³ö¶ÔÏó + String type="customer"; // ¶¨ÒåxmlÀàÐͶÔÏó String insertSql=""; // ¶¨ÒåÐÂÔöÓï¾ä¶ÔÏó - SqlObject sqlObject=null; // sqlObject¶ÔÏó - // »ñȡʱ¼ä¶ÔÏó, ¸ñʽΪ--ÄêÔÂÈÕʱ·ÖÃë - Date time = new Date(); // »ñÈ¡µ±Ç°Ê±¼ä¶ÔÏó, ²¢¸ñʽ»¯ - SimpleDateFormat formatter1 = new SimpleDateFormat("yyyyMMddHHmmss");// ÄêÔÂÈÕʱ·ÖÃë - SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// ÄêÔÂÈÕʱ·ÖÃë - String year_month_day = formatter1.format(time); // ÄêÔÂÈÕʱ·ÖÃë - String year_month_days = formatter2.format(time); // ÄêÔÂÈÕʱ·ÖÃë - String str=""; - String customer_num=""; - String customername=""; - String customertype=""; - // ²éѯδ´«Èë¿Í»§ÐÅÏ¢ - String sql="SELECT customer_num,customername,customertype,customerid FROM CUSTOMER_INFO WHERE customer_num NOT IN(SELECT CUSTOMER_NUM FROM CUSTOMER_LOG WHERE FLAG='1') "; + String uuid=""; // ¶¨Òåxml´«Êäid¶ÔÏó + String customer_num=""; // ¶¨Òå¿Í»§±àºÅ¶ÔÏó + String customername=""; // ¶¨Òå¿Í»§Ãû³Æ¶ÔÏó + String customertype=""; // ¶¨Òå¿Í»§ÀàÐͶÔÏó + + // »ñÈ¡ÌØ¶¨¸ñʽÈÕÆÚ + String year_month_day = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); + String year_month_days = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + + // ²éѯΪ´«Êä»ò֮ǰ´«Êäʧ°ÜµÄÊý¾Ý + String sql="SELECT customer_num,customername,customertype,customerid FROM CUSTOMER_INFO WHERE customer_num NOT IN(SELECT TABLE_NUM FROM NCXML_DETAIL_RECORDS WHERE FLAG='1' AND XML_TYPE='"+type+"') "; List> rs = DataOperatorUtil.getDataBySql(Sqlca,sql,null); - // ¿Í»§xmlÍ· - Document document= DocumentHelper.createDocument(); // Éú³Éÿ¸öxmlµÄÍ· + + // Éú³ÉxmlÍ· + Document document= DocumentHelper.createDocument(); Element root = document.addElement("ufinterface"); - root.addAttribute("account", "0001"); - root.addAttribute("billtype", "customer"); - root.addAttribute("businessunitcode", "develop"); - root.addAttribute("filename", ""); - root.addAttribute("groupcode", "001"); - root.addAttribute("isexchange", "Y"); - root.addAttribute("orgcode", ""); - root.addAttribute("receiver", "½ÓÊÕ·½ÒµÎñµ¥Ôª±àÂë"); - root.addAttribute("replace", "Y"); - root.addAttribute("roottag", ""); - root.addAttribute("sender", "001"); + root.addAttribute("account", "q0225"); + root.addAttribute("billtype", "customer"); + root.addAttribute("businessunitcode", "develop"); + root.addAttribute("filename", ""); + root.addAttribute("groupcode", "001"); + root.addAttribute("isexchange", "Y"); + root.addAttribute("orgcode", ""); + root.addAttribute("receiver", "½ÓÊÕ·½ÒµÎñµ¥Ôª±àÂë"); + root.addAttribute("replace", "Y"); + root.addAttribute("roottag", ""); + root.addAttribute("sender", "001"); + + String batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);// Éú³ÉÅú´ÎºÅ + + // ±éÀúÒª´«ÊäµÄ½á¹û¼¯ for(int i=0;i ÖÁ ɾ³ý£¬°üÀ¨ ºÍ Element item1 = finances.addElement("item"); @@ -741,15 +730,8 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { acclimitcontrol.setText("»ùÓÚÉϼ¶¿Í»§ÕËÆÚ¿ØÖÆ,×î´ó³¤¶ÈΪ1,ÀàÐÍΪ:UFBoolean"); Element creditlevel = item4.addElement("creditlevel");// ÐÅÓõȼ¶,×î´ó³¤¶ÈΪ20,ÀàÐÍΪ:String creditlevel.setText("ÐÅÓõȼ¶,×î´ó³¤¶ÈΪ20,ÀàÐÍΪ:String");*/ - /*cust_id=rs.get(i).get("customerid"); - updateSql="UPDATE CUSTOMER_INFO SET FLAG='0' WHERE CUSTOMERID='"+cust_id+"'"; - SqlObject updSql=new SqlObject(updateSql); - Sqlca.executeSQL(updSql);*/ - // ½«¿Í»§xmlÐÅϢдÈë״̬±íÖÐ - insertSql="INSERT INTO CUSTOMER_LOG(BILLID,CUSTOMER_NUM,FLAG,CREATE_TIME) VALUES('"+str+"','"+customer_num+"','1','"+year_month_days+"')"; - //sqlObject = new SqlObject(insertSql); - //Sqlca.executeSQL(sqlObject); + insertSql="INSERT INTO NCXML_DETAIL_RECORDS(BILLID,XML_TYPE,TABLE_NUM,FLAG,CREATE_TIME,BATCH) VALUES('"+uuid+"','"+type+"','"+customer_num+"','1','"+year_month_days+"','"+batch+"')"; Sqlca.executeSQL(insertSql); logger.info("¿Í»§¼Ç¼Óï¾ä: "+insertSql); } @@ -760,21 +742,38 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { writer.setEscapeText(false);// ×Ö·ûÊÇ·ñתÒå,ĬÈÏtrue writer.write(document); writer.close(); - InterActionToNC(Sqlca,URL,tableName); + InterActionToNC(Sqlca,URL,type,batch,rs.size()); + Sqlca.commit(); + } catch (Exception e) { + try { + logger.debug("¿Í»§xml´«Êäʧ°Ü"); + Sqlca.rollback(); + } catch (JBOException e1) { + e1.printStackTrace(); + } + e.printStackTrace(); + }finally { + if (Sqlca!=null) { + try { + Sqlca.disConnect(); + } catch (JBOException e) { + e.printStackTrace(); + } + } + } } /** * ¹©Ó¦ÉÌÐÅÏ¢xmlÉú³É, ÿ1000ÌõÉú³ÉÒ»¸öxml * @throws Exception * @throws Exception */ - private static void DOM4JcreateToSupplier(Transaction Sqlca) throws Exception{ - //File file2 = new File("D:\\voucherXml_NC"); - //if(file2==null || "".equals(file2)) { - // file2.mkdirs();//´´½¨¸¸Îļþ¼Ð - //} - File file = null; - XMLWriter writer = null; - String tableName="DISTRIBUTOR_LOG"; // ±íÃû + private static void DOM4JcreateToSupplier(JBOTransaction tx) { + Transaction Sqlca = null; + try { + Sqlca = Transaction.createTransaction(tx); + File file = null; // Îļþ¶ÔÏó + XMLWriter writer = null; // Êä³ö¶ÔÏó + String type="distributor"; // xmlÀà±ð String DISTRIBUTOR_NAME = ""; // ¾­ÏúÉÌÃû³Æ String DISTRIBUTOR_CODING = ""; // ¾­ÏúÉÌid String DISTRIBUTOR_ADDRESS=""; // µØÇø±àÂë @@ -788,187 +787,188 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { String TYPE=""; // ¹©Ó¦ÉÌ»ù±¾·ÖÀà String BUSINESS_LICENSE_NO=""; // ×éÖ¯»ú¹¹´úÂë String DISTRIBUTOR_STATUS=""; // ÆôÓÃ״̬ - String FAX_NUMBER=""; // ÆôÓÃ״̬ - String E_MAIL=""; // ´«Õæ + String FAX_NUMBER=""; // ´«Õæ + String E_MAIL=""; // email String REGISTERED_ASSET=""; // ×¢²á×ʽð String DISTRIBUTORER=""; // ·¨ÈË String URL=""; // ÍøÖ· String insertSql=""; // ÐÂÔöÓï¾ä - SqlObject sqlObject=null; // ´´½¨sqlObject¶ÔÏó String uuid=""; // uuid String MBAFC_EARLYDISBURSEMENT_TYPE="";// ×ʽðÀàÐÍ/Ö§¸¶ÀàÐÍ - // »ñȡʱ¼ä¶ÔÏó, ¸ñʽΪ--ÄêÔÂÈÕʱ·ÖÃë - Date time = new Date(); // »ñÈ¡µ±Ç°Ê±¼ä¶ÔÏó, ²¢¸ñʽ»¯ - SimpleDateFormat formatter1 = new SimpleDateFormat("yyyyMMddHHmmss");// ÄêÔÂÈÕʱ·ÖÃë - SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// ÄêÔÂÈÕʱ·ÖÃë - String year_month_day = formatter1.format(time); // ÄêÔÂÈÕʱ·ÖÃë - String year_month_days = formatter2.format(time); // ÄêÔÂÈÕʱ·ÖÃë + + // »ñÈ¡ÌØ¶¨ÈÕÆÚ + String year_month_day = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); + String year_month_days = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + // ÉèÖÃxml±êǩͷ - Document document = DocumentHelper.createDocument(); // Éú³Éÿ¸öxmlµÄÍ· + Document document = DocumentHelper.createDocument(); Element root = document.addElement("ufinterface"); - root.addAttribute("account", "0001"); - root.addAttribute("billtype", "supplier"); - root.addAttribute("filename", ""); - root.addAttribute("groupcode", "001"); - root.addAttribute("isexchange", "Y"); - root.addAttribute("receiver", "½ÓÊÕ·½ÒµÎñµ¥Ôª±àÂë"); - root.addAttribute("replace", "Y"); - root.addAttribute("roottag", ""); - root.addAttribute("sender", "001"); - String sql="SELECT DISTRIBUTOR_NAME,DISTRIBUTOR_CODING,DISTRIBUTOR_ADDRESS,FACT_ADDR,PROVINCES,POSTCODE,REGISTERED_ADDR,BUSINESS_SCOPE,SUBSIDIARY_COMPANY,TYPE,BUSINESS_LICENSE_NO,DISTRIBUTOR_STATUS,E_MAIL,FAX_NUMBER,REGISTERED_ASSET,DISTRIBUTORER,MBAFC_EARLYDISBURSEMENT_TYPE,URL FROM DISTRIBUTOR_INFO WHERE DISTRIBUTOR_CODING NOT IN(SELECT DISTRIBUTOR_CODING FROM DISTRIBUTOR_LOG WHERE FLAG ='1' ) "; + root.addAttribute("account", "q0225"); + root.addAttribute("billtype", "supplier"); + root.addAttribute("filename", ""); + root.addAttribute("groupcode", "001"); + root.addAttribute("isexchange", "Y"); + root.addAttribute("receiver", "½ÓÊÕ·½ÒµÎñµ¥Ôª±àÂë"); + root.addAttribute("replace", "Y"); + root.addAttribute("roottag", ""); + root.addAttribute("sender", "001"); + + // »ñȡδ´«Êä¼°ÒÔǰ´«Êäʧ°ÜµÄÊý¾Ý + String sql="SELECT DISTRIBUTOR_NAME,DISTRIBUTOR_CODING,DISTRIBUTOR_ADDRESS,FACT_ADDR,PROVINCES,POSTCODE,REGISTERED_ADDR,BUSINESS_SCOPE,SUBSIDIARY_COMPANY,TYPE,BUSINESS_LICENSE_NO,DISTRIBUTOR_STATUS,E_MAIL,FAX_NUMBER,REGISTERED_ASSET,DISTRIBUTORER,MBAFC_EARLYDISBURSEMENT_TYPE,URL FROM DISTRIBUTOR_INFO WHERE DISTRIBUTOR_CODING NOT IN(SELECT TABLE_NUM FROM NCXML_DETAIL_RECORDS WHERE FLAG ='1' AND XML_TYPE='"+type+"') "; List> rs = DataOperatorUtil.getDataBySql(Sqlca,sql,null); + + // »ñÈ¡Åú´ÎºÅ + String batch = SerialNumberUtil.getVoucherPCNumber(Sqlca); + + // ±éÀúÒª´«ÊäµÄ½á¹û¼¯ for(int i=0; i> rs = DataOperatorUtil.getDataBySql(Sqlca,sql,null); + + // »ñÈ¡Åú´ÎºÅ + String batch = SerialNumberUtil.getVoucherPCNumber(Sqlca); + + // ±éÀú½á¹û¼¯ for (Map map : rs) { contract_number=(map.get("CONTRACT_NUMBER")==null)?"":map.get("CONTRACT_NUMBER"); contract_name=(map.get("PRODUCT_NAME")==null)?"":map.get("PRODUCT_NAME"); + ID=(map.get("ID")==null)?"":map.get("ID"); + Element bill = root.addElement("bill"); uuid=UUID.randomUUID().toString().replace("-", ""); bill.addAttribute("id", uuid); Element billhead = bill.addElement("billhead"); Element pk_defdoclist = billhead.addElement("pk_defdoclist");// ×Ô¶¨Òåµµ°¸ÁбíÖ÷¼ü,×î´ó³¤¶ÈΪ20,ÀàÐÍΪ:String - pk_defdoclist.setText("×Ô¶¨Òåµµ°¸ÁбíÖ÷¼ü,×î´ó³¤¶ÈΪ20,ÀàÐÍΪ:String"); + pk_defdoclist.setText(ID); Element pk_defdoc = billhead.addElement("pk_defdoc");// pk_defdoc.setText(""); Element pk_group = billhead.addElement("pk_group");// ËùÊô¼¯ÍÅ,×î´ó³¤¶ÈΪ20,ÀàÐÍΪ:String @@ -1044,8 +1074,7 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { Element memo = billhead.addElement("memo");// ±¸×¢,×î´ó³¤¶ÈΪ200,ÀàÐÍΪ:String memo.setText(""); // ½«¼Ç¼дÈ븨ÖúºÏͬÈÕÖ¾±í - insertSql="INSERT INTO SUBSIBIARY_CONTRACT_LOG(BILLID,CONTRACT_NUMBER,FLAG,CREATE_TIME) VALUES('"+uuid+"','"+contract_number+"','1','"+year_month_days+"')"; - //sqlObject= new SqlObject(insertSql); + insertSql="INSERT INTO NCXML_DETAIL_RECORDS(BILLID,XML_TYPE,TABLE_NUM,FLAG,CREATE_TIME,BATCH) VALUES('"+uuid+"','"+type+"','"+contract_number+"','1','"+year_month_days+"','"+batch+"')"; Sqlca.executeSQL(insertSql); logger.info("¸¨ÖúºÏͬ¼Ç¼Óï¾ä: " + insertSql); } @@ -1056,32 +1085,50 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { writer.setEscapeText(false);// ×Ö·ûÊÇ·ñתÒå,ĬÈÏtrue writer.write(document); writer.close(); - InterActionToNC(Sqlca,URL,tableName); + InterActionToNC(Sqlca,URL,type,batch,rs.size()); + Sqlca.commit(); + } catch (Exception e) { + try { + Sqlca.rollback(); + } catch (JBOException e1) { + e1.printStackTrace(); + } + e.printStackTrace(); + }finally { + if(Sqlca!=null) { + try { + Sqlca.disConnect(); + } catch (JBOException e) { + e.printStackTrace(); + } + } + } } /** * ÏñNC´«Êäxml, »ñÈ¡NC»ØÖ´xmlÐÅÏ¢, ¸ù¾Ý»ØÖ´ÐÅÏ¢¸ü¸Ä״̬ */ - public static void InterActionToNC(Transaction Sqlca,String inputURL,String tableName) { + public static void InterActionToNC(Transaction Sqlca,String inputURL,String type,String batch,int count) { try { - // ¶¨ÒåÈ«¾Ö±äÁ¿ - String sql=""; - String resultcode=""; //·µ»Ø×´Ì¬ - String bdocid=""; //Êý¾ÝID + String updateSql = ""; // ¸üÐÂsql¶ÔÏó + String insertSql = ""; // ÐÂÔöSQL¶ÔÏó + String deleteSql = ""; // ɾ³ýSQL¶ÔÏó + String resultcode= ""; // µ¥Ìõ·µ»Ø½á¹û + String bdocid = ""; // xml»ØÖ´id String resultdescription=""; //´íÎóÐÅÏ¢ - SqlObject updSql; /** * »ñÈ¡¶Ô·½postÁ¬½Ó */ - String url = "http://172.16.0.19/service/XChangeServlet?account=00001&groupcode=001"; + String url = "http://47.93.227.86:8858/service/XChangeServlet?account=q0225&groupcode=001"; URL realURL = new URL(url); HttpURLConnection connection = (HttpURLConnection)realURL.openConnection(); connection.setDoOutput(true); connection.setRequestProperty("Content-type", "text/xml"); connection.setRequestMethod("POST"); + /** - * ¶ÁÈ¡±¾µØÉú³ÉµÄxml, ´«Êäµ½NC + * ¶ÁÈ¡±¾·½Éú³ÉµÄxml, ´«Êäµ½NC */ File file = new File(inputURL); BufferedOutputStream out = new BufferedOutputStream(connection.getOutputStream()); @@ -1093,8 +1140,9 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { } input.close(); out.close(); + /** - * »ñÈ¡»ØÖ´ÐÅÏ¢ + * »ñÈ¡NC»ØÖ´ÐÅÏ¢ */ InputStream inputStream = connection.getInputStream(); InputStreamReader isr = new InputStreamReader(inputStream); @@ -1107,8 +1155,7 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { } input.close(); System.out.println("--------------------------" + xmlString); - String insertSql1="INSERT INTO LB_XZW_LOG(ID_,NAME_) VALUES('"+tableName+"','³É¹¦')"; - Sqlca.executeSQL(insertSql1); + /** * ½«»ñÈ¡µ½µÄ»ØÖ´ÐÅÏ¢Éú³É±¾µØxml */ @@ -1119,15 +1166,17 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //ÉèÖÃÎĵµµÄ»»ÐÐÓëËõ½ø transformer.setOutputProperty(OutputKeys.INDENT, "YES"); + // ½«»ØÖ´ÐÅÏ¢Êä³öµ½±¾µØ SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmss"); - /*File file2 = new File("D:\\voucherXml_receipt"); - if (!file2.exists()) {file2.mkdirs();}// ÅжÏÊÇ·ñ´æÔÚ, Èç¹û²»´æÔھʹ´½¨¸ÃÎļþ¼Ð*/ - String resFile = "//data//files//apzl_leasing//tmp//WEN"+fmt.format(new Date())+".xml"; + SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// ÄêÔÂÈÕʱ·ÖÃë + //File file2 = new File("D:\\VOUCHER_RECEIPT"); + //if (!file2.exists()) {file2.mkdirs();}// ÅжÏÊÇ·ñ´æÔÚ, Èç¹û²»´æÔھʹ´½¨¸ÃÎļþ¼Ð + String resFile = "//data//files//apzl_leasing//tmp//WEN//APleasing_"+type+""+fmt.format(new Date())+".xml"; + //String resFile = "D:\\VOUCHER_RECEIPT\\APleasing_"+type+""+fmt.format(new Date())+".xml"; StreamResult result = new StreamResult(new File(resFile)); transformer.transform(source,result); - String insertSql="INSERT INTO LB_XZW_LOG(ID_,NAME_) VALUES('2','³É¹¦')"; - Sqlca.executeSQL(insertSql); + /** * ½âÎöxml, ¸ù¾Ý»ØÖ´ÐÅÏ¢¸üÐÂ״̬ */ @@ -1139,28 +1188,39 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService { //ºóÃæ¶Ô»ØÖ´½á¹û×öÅжÏ,È»ºó¸Ä±äµ¼Èë״̬¾ÍÐÐÁË if(null != resSuc){ if(resSuc.equals("N")){ - logger.info("µ¼Èëʧ°Ü"); + logger.info("µ¼Èëʧ°Ü"); + // µ¼Èëʧ°Ü, ½«±¾´ÎÔÚÃ÷ϸ±íÖд洢µÄÊý¾Ýɾ³ý + deleteSql = "DELETE FROM NCXML_DETAIL_RECORDS WHERE BATCH='"+batch+"' AND XML_TYPE = '"+type+"'"; + // µ¼Èëʧ°Ü, ½«Ê§°ÜÊý¾Ý¼Ç¼Èë×ܼǼ±í + insertSql = "INSERT INTO NCXML_TOTAL_RECORDS(ID_,XML_TYPE,FLAG_,COUNT_,FAILED_COUNT,CREATETIME) VALUES('"+batch+"','"+type+"','"+resSuc+"','"+count+"','"+count+"','"+formatter2.format(new Date())+"')"; + Sqlca.executeSQL(deleteSql); + Sqlca.executeSQL(insertSql); }else if(resSuc.equals("Y")){ logger.info("µ¼Èë³É¹¦"); - /*sql="UPDATE "+tableName+" SET FLAG = '1' WHERE flag <> '1'"; - updSql = new SqlObject(sql); - Sqlca.executeSQL(updSql);*/ - List list1 = root.elements(); - for (Element element : list1) { - List list = element.elements(); - for (Element el : list) { + List list = root.elements(); + int failed_count=0; // ʧ°Ü¼Ç¼Êý + for (Element element : list) { + List list2 = element.elements(); + for (Element el : list2) { + logger.info("111111111111111111"); + // »ñÈ¡µ¥Ìõ»ØÖ´×´Ì¬ resultcode = el.element("resultcode").getStringValue(); if(!"1".equals(resultcode)) { - bdocid = el.element("bdocid").getStringValue();// xml»ØÖ´id - resultdescription = el.element("resultdescription").getStringValue();// ´íÎóÐÅÏ¢ - //sql=" UPDATE "+tableName+" SET FLAG='"+resultcode+"',ERR_DESCRIBE='"+resultdescription+"' WHERE BUILLID='"+bdocid+"' "; - sql=" UPDATE "+tableName+" SET FLAG='2',ERR_DESCRIBE='"+resultdescription+"' WHERE BUILLID='"+bdocid+"' "; - //updSql = new SqlObject(sql); - Sqlca.executeSQL(sql); - logger.info("¸ù¾Ý»ØÖ´ÐÅÏ¢, Ð޸Ĵ«Êäʧ°Ü״̬, ¼Ç¼´íÎóÐÅÏ¢"+sql); + logger.info("22222222222222"); + bdocid = el.element("bdocid").getStringValue(); // xml»ØÖ´id + resultdescription = el.element("resultdescription").getStringValue(); // ´íÎóÐÅÏ¢ + + // Èç¹û»ØÖ´×´Ì¬²»µÈÓÚ1, ˵Ã÷ÓÐÎó, ¸üе½¼Ç¼×Ö±í²¢¼Ç¼´íÎóÐÅÏ¢ + updateSql=" UPDATE NCXML_DETAIL_RECORDS SET FLAG='"+resultcode+"',ERR_DESCRIBE='"+resultdescription+"' WHERE BUILLID='"+bdocid+"' AND XML_TYPE= '"+type+"'"; + Sqlca.executeSQL(updateSql); + logger.info("¸ù¾Ý»ØÖ´ÐÅÏ¢, Ð޸Ĵ«Êäʧ°Ü״̬, ¼Ç¼´íÎóÐÅÏ¢"+updateSql); + failed_count++; } } } + // ½«±¾Åú´Î´«Êä×ÜÁ¿¼° ʧ°ÜÊýÁ¿¼Ç¼Èë¼Ç¼×ܱí + String insertSql1="INSERT INTO NCXML_TOTAL_RECORDS(ID_,XML_TYPE,FLAG_,COUNT_,FAILED_COUNT,CREATETIME) VALUES('"+batch+"','"+type+"','"+resSuc+"','"+count+"','"+failed_count+"','"+formatter2.format(new Date())+"')"; + Sqlca.executeSQL(insertSql1); }else{ logger.info("³öÏÖδ֪´íÎó"); } diff --git a/src_tenwa/com/tenwa/lease/flow/project/businessapply/businessApplyForfengxian.java b/src_tenwa/com/tenwa/lease/flow/project/businessapply/businessApplyForfengxian.java new file mode 100644 index 000000000..c4af90e43 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/flow/project/businessapply/businessApplyForfengxian.java @@ -0,0 +1,45 @@ +package com.tenwa.lease.flow.project.businessapply; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jbo.app.tenwa.calc.LC_CALC_CONDITION; +import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP; +import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP; +import jbo.sys.USER_INFO; + +import com.amarsoft.app.lc.workflow.action.GetFlowAction; +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.awe.util.Transaction; +import com.tenwa.flow.baseBussion.BaseBussiness; +import com.tenwa.lease.flow.comm.service.LeaseFlowBaseService; +import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum; +import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp; + +public class businessApplyForfengxian extends BaseBussiness { + + @Override + public Object run(Transaction Sqlca) throws Exception { + this.initBussinessParam(Sqlca); + String userId = this.getAttribute("CurUserID").toString(); + + BizObjectManager userInfo = JBOFactory.getBizObjectManager(USER_INFO.CLASS_NAME, Sqlca); + BizObject condition = userInfo.createQuery("USERID=:userId").setParameter("userId",userId).getSingleResult(false); + String sMessage=""; + String applytype = null; + if(null!=condition){ + String orgid=condition.getAttribute("BELONGORG").toString(); + applytype = orgid.substring(0, 7); + } + if("8009013"==applytype||applytype.equals("8009013")){//ת¸øÒµÎñÒ»²¿ + sMessage="true"; + }else { + sMessage="false"; + } + return sMessage; + } +} \ No newline at end of file