diff --git a/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceGpsTJList.jsp b/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceGpsTJList.jsp index 03711639b..7c25a5e74 100644 --- a/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceGpsTJList.jsp +++ b/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceGpsTJList.jsp @@ -38,6 +38,10 @@ function createInvoice(){ var ros = getCheckedRows(0); + if(ros.length==0){ + alert("请至少选择一条数据!"); + return; + } var jsonArr=[]; var json={}; for(var i = 0; i < ros.length; i++){ diff --git a/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceLeaseDirectTJList.jsp b/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceLeaseDirectTJList.jsp index d7a636a3d..05a3243f8 100644 --- a/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceLeaseDirectTJList.jsp +++ b/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceLeaseDirectTJList.jsp @@ -13,6 +13,7 @@ //{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""}, //{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""}, //{"true","","Button","返回","返回","returnList()","","","","btn_icon_return",""}, + {"true","","Button","开发票","开发票","createInvoice()","","","","",""}, }; %><%@include file="/Frame/resources/include/ui/include_list.jspf"%> <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceLeasebackTJList.jsp b/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceLeasebackTJList.jsp index cdfe90e60..162af1d4d 100644 --- a/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceLeasebackTJList.jsp +++ b/WebContent/Tenwa/Core/InvoiceManager/InvoiceTJ/InvoiceLeasebackTJList.jsp @@ -6,6 +6,7 @@ dwTemp.Style="1"; //--设置为Grid风格-- dwTemp.ReadOnly = "1"; //只读模式 dwTemp.setPageSize(20); + dwTemp.MultiSelect=true; dwTemp.genHTMLObjectWindow(""); //0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格 String sButtons[][] = { @@ -13,6 +14,7 @@ //{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""}, //{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""}, //{"true","","Button","返回","返回","returnList()","","","","btn_icon_return",""}, + {"true","","Button","开发票","开发票","createInvoice()","","","","",""}, }; %><%@include file="/Frame/resources/include/ui/include_list.jspf"%> <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/src_cmb/com/tenwa/invoice/IAutokpDo.java b/src_cmb/com/tenwa/invoice/IAutokpDo.java index 936df5d46..91089ef58 100644 --- a/src_cmb/com/tenwa/invoice/IAutokpDo.java +++ b/src_cmb/com/tenwa/invoice/IAutokpDo.java @@ -67,9 +67,11 @@ public class IAutokpDo { } } catch (RemoteException e) { + flag = false; // TODO Auto-generated catch block e.printStackTrace(); } catch (ServiceException e) { + flag = false; // TODO Auto-generated catch block e.printStackTrace(); } @@ -288,30 +290,24 @@ public class IAutokpDo { hztzdh = ele_head.element("HZTZDH").getText(); } List listItems = ele_items.elements(); - for(Element item : listItems){ - String mxxh = item.element("MXXH").getText(); + for(int i=1;i<=listItems.size();i++){ + String mxxh = listItems.get(i).element("MXXH").getText(); String planList = ""; String liti_id = ""; String taxType = ""; String contractNo = ""; - for(Map map :lsm.getValue()){ - if(mxxh.equals(map.get("MXXH"))){ - planList = map.get("plan_list"); - taxType = map.get("tax_no"); - contractNo = map.get("contract_no"); - if("01".equals(fpzf)){ - liti_id = map.get("liti_id"); - String usql = "update li_invoice_tj_info O set O.status='R' where id='"+liti_id+"'"; - Sqlca.executeSQL(new SqlObject(usql)); - } - break; - } + planList = lsm.getValue().get(i).get("plan_list"); + taxType = lsm.getValue().get(i).get("tax_no"); + contractNo = lsm.getValue().get(i).get("contract_no"); + if("01".equals(fpzf)){ + liti_id = lsm.getValue().get(i).get("liti_id"); + String usql = "update li_invoice_tj_info O set O.status='R' where id='"+liti_id+"'"; + Sqlca.executeSQL(new SqlObject(usql)); } - - String invoice_money = item.element("JE").getText(); - String taxRatio = item.element("SLV").getText(); - String taxMoney = item.element("shuier").getText(); - String sw_spbm = item.element("sw_spbm").getText(); + String invoice_money = listItems.get(i).element("JE").getText(); + String taxRatio = listItems.get(i).element("SLV").getText(); + String taxMoney = listItems.get(i).element("shuier").getText(); + String sw_spbm = listItems.get(i).element("sw_spbm").getText(); String inputtime = StringFunction.getTodayNow(); ps.setString(1,contractNo); @@ -367,6 +363,7 @@ public class IAutokpDo { Transaction Sqlca = null; Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); Connection con; + try { con = Sqlca.getConnection(); boolean autoCom = con.getAutoCommit(); @@ -375,6 +372,8 @@ public class IAutokpDo { } ps = con.prepareStatement(insertSql); Element ele_order = doc.getRootElement().element("Data").element("Order"); + System.out.println("==============================+++++++++"+doc.getText()); + System.out.println("=============================="+ele_order.getText()); Element ele_head = ele_order.element("Head"); Element ele_items = ele_order.element("Items"); @@ -393,25 +392,19 @@ public class IAutokpDo { hztzdh = ele_head.element("HZTZDH").getText(); } List listItems = ele_items.elements(); - for(Element item : listItems){ - String mxxh = item.element("MXXH").getText(); + for(int i=1;i<=listItems.size();i++){ + String mxxh = listItems.get(i).element("MXXH").getText(); String planList = ""; String taxType = ""; String contractNo = ""; String customerName = ""; - for(Map map :lsm.getValue()){ - if(mxxh.equals(map.get("MXXH"))){ - planList = map.get("plan_list"); - taxType = map.get("tax_type"); - contractNo = map.get("contract_no"); - customerName = map.get("customer_name"); - break; - } - } - - String invoice_money = item.element("JE").getText(); - String taxRatio = item.element("SLV").getText(); - String taxMoney = item.element("shuier").getText(); + planList = lsm.getValue().get(i).get("plan_list"); + taxType = lsm.getValue().get(i).get("tax_type"); + contractNo = lsm.getValue().get(i).get("contract_no"); + customerName = lsm.getValue().get(i).get("customer_name"); + String invoice_money = listItems.get(i).element("JE").getText(); + String taxRatio = listItems.get(i).element("SLV").getText(); + String taxMoney = listItems.get(i).element("shuier").getText(); String inputtime = StringFunction.getTodayNow(); ps.setString(1,contractNo); diff --git a/src_cmb/com/tenwa/invoice/IAutokpXML.java b/src_cmb/com/tenwa/invoice/IAutokpXML.java index 28070200b..317e0997a 100644 --- a/src_cmb/com/tenwa/invoice/IAutokpXML.java +++ b/src_cmb/com/tenwa/invoice/IAutokpXML.java @@ -23,15 +23,12 @@ public class IAutokpXML { public Map>> getInvoiceParam (String param){ JSONArray array =JSON.parseArray(param); - + System.out.println(array.toString()); Map>> map = new HashMap>>(); - List> ls = new ArrayList>(); - for(int i=0;i mapi = new HashMap<>(); - mapi.put("MXXH",i+1+""); mapi.put("tax_type", obj.getString("tax_type")); mapi.put("tax_no", obj.getString("tax_no")); mapi.put("invoice_money",obj.getString("invoice_money")); @@ -43,15 +40,11 @@ public class IAutokpXML { mapi.put("customer_type",obj.getString("customer_type")); mapi.put("plan_list",obj.getString("plan_list")); mapi.put("contract_no", obj.getString("contract_no")); - if(map.containsKey(contract_no)){ - map.get(contract_no).add(mapi); - }else{ - ls.add(mapi); - map.put(contract_no, ls); - ls.clear(); + if(!map.containsKey(contract_no)){ + map.put(contract_no,new ArrayList>()); } + map.get(contract_no).add(mapi); } - return map; } public Map>> getRedbackInvoiceParam (String param){