发票更新
This commit is contained in:
parent
5801156e31
commit
028a8ee365
@ -29,7 +29,7 @@ function ApplyInvoice(){
|
||||
var types = getItemValueArray(0,"moneytype");
|
||||
if(typeof(sParm) == "undefined" || sParm.length == 0 )
|
||||
{
|
||||
alert("请选择查询开票数据!");
|
||||
alert("请选择申请开票数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -41,17 +41,7 @@ function ApplyInvoice(){
|
||||
//alert(moneyTypes);
|
||||
}
|
||||
moneyTypes = moneyTypes.substr(0,moneyTypes.length-1);
|
||||
//alert(moneyTypes);
|
||||
/* for(var i = 0;i < sParm.length; i++){
|
||||
if(uids.length == 0){
|
||||
|
||||
uids += sParm[i] +"@";
|
||||
alert(uids);
|
||||
}else{
|
||||
uids += sParm[i] +"@";
|
||||
alert(uids);
|
||||
}
|
||||
} */
|
||||
|
||||
spara = "moneyTypes="+moneyTypes+",CurUserID=<%=CurUser.getUserID()%>";
|
||||
var returnValue = AsControl.RunJavaMethodTrans("com.tenwa.apzl.invoicemanager.rentplaninvoice.rentPlanInvoiceManager","selectApplyOtherConfirm",spara);
|
||||
alert(returnValue);
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
|
||||
/*
|
||||
Author: undefined 2018-09-05
|
||||
Content:
|
||||
History Log:
|
||||
*/
|
||||
ASObjectModel doTemp = new ASObjectModel("BackRentInvoicePrintOthers");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
dwTemp.Style="1"; //--设置为Grid风格--
|
||||
dwTemp.MultiSelect = true; //多选
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
dwTemp.setPageSize(10);
|
||||
dwTemp.genHTMLObjectWindow("");
|
||||
|
||||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||||
String sButtons[][] = {
|
||||
//{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
|
||||
//{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""},
|
||||
//{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""},
|
||||
{"true","","Button","申请开票","申请开票","ApplyInvoice()","","","","btn_icon_add",""},
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
function ApplyInvoice(){
|
||||
if(confirm('确实要执行申请操作吗?')){
|
||||
var sParm = getItemValueArray(0,"contract_id");
|
||||
var types = getItemValueArray(0,"moneytype");
|
||||
if(typeof(sParm) == "undefined" || sParm.length == 0 )
|
||||
{
|
||||
alert("请选择申请开票数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var moneyTypes = "";
|
||||
|
||||
for(var i = 0;i < types.length; i++){
|
||||
moneyTypes += sParm[i]+"#"+types[i] +"@";
|
||||
//alert(moneyTypes);
|
||||
}
|
||||
moneyTypes = moneyTypes.substr(0,moneyTypes.length-1);
|
||||
|
||||
spara = "moneyTypes="+moneyTypes+",CurUserID=<%=CurUser.getUserID()%>";
|
||||
var returnValue = AsControl.RunJavaMethodTrans("com.tenwa.apzl.invoicemanager.rentplaninvoice.backRentPrintInvoiceManager","selectApplyOtherConfirm",spara);
|
||||
alert(returnValue);
|
||||
reloadSelf();
|
||||
}
|
||||
}
|
||||
|
||||
function newRecord(){
|
||||
var sUrl = "";
|
||||
AsControl.OpenView(sUrl,'','_self','');
|
||||
}
|
||||
function viewAndEdit(){
|
||||
var sUrl = "";
|
||||
var sPara = getItemValue(0,getRow(0),'SerialNo');
|
||||
if(typeof(sPara)=="undefined" || sPara.length==0 ){
|
||||
alert("参数不能为空!");
|
||||
return ;
|
||||
}
|
||||
AsControl.OpenView(sUrl,'SerialNo=' +sPara ,'_self','');
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
@ -29,7 +29,7 @@
|
||||
alert("请选择打印数据!");
|
||||
return;
|
||||
}
|
||||
alert(newSid);
|
||||
//alert(newSid);
|
||||
|
||||
var newSids = "";
|
||||
for(var i = 0;i < newSid.length; i++){
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
alert("请选择打印数据!");
|
||||
return;
|
||||
}
|
||||
alert(newSid);
|
||||
//alert(newSid);
|
||||
|
||||
var newSids = "";
|
||||
for(var i = 0;i < newSid.length; i++){
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
var sid = getItemValueArray(0,"sid");
|
||||
if(typeof(sid) == "undefined" || sid.length == 0 )
|
||||
{
|
||||
alert("请选择查询数据!");
|
||||
alert("请选择打印数据!");
|
||||
return;
|
||||
}
|
||||
//alert(sid);
|
||||
|
||||
@ -221,7 +221,7 @@ public class backRentPrintInvoiceManager extends BaseTable {
|
||||
String[] moneyTypes = this.getMoneyTypes().split("@");
|
||||
|
||||
String invoice_status = "1";
|
||||
String bill_type = "electronic";
|
||||
String bill_type = "General";
|
||||
String invoice_money = "";
|
||||
String plan_id = "";
|
||||
String PAYMENT_NUMBER = "";
|
||||
@ -798,6 +798,7 @@ public class backRentPrintInvoiceManager extends BaseTable {
|
||||
String invoice_confirm_id = "";
|
||||
String ghdwmc = "";
|
||||
String invoice_type = "back_rent";//回租
|
||||
String returnmsg = "";
|
||||
for (int i = 0; i < sids.length; i++) {
|
||||
sid = sids[i];
|
||||
|
||||
@ -810,6 +811,12 @@ public class backRentPrintInvoiceManager extends BaseTable {
|
||||
}else{
|
||||
fpdm = invoiceResult.getAttribute("fpdm").toString();
|
||||
fphm = invoiceResult.getAttribute("fphm").toString();
|
||||
|
||||
// 防止重复发票打印请求 field2(returncode)
|
||||
String a = invoiceResult.getAttribute("field2")==null?"":invoiceResult.getAttribute("field2").toString();
|
||||
if("0".equals(a)){
|
||||
return "请勿重复打印申请!";
|
||||
}
|
||||
}
|
||||
} catch (JBOException e) {
|
||||
e.printStackTrace();
|
||||
@ -859,10 +866,21 @@ public class backRentPrintInvoiceManager extends BaseTable {
|
||||
if (result.getCode() == 0) {
|
||||
InvoiceRequestBase responseBase = (InvoiceRequestBase) result.getData();
|
||||
String returncode = responseBase.getBody().getReturncode();
|
||||
String returnmsg = responseBase.getBody().getReturnmsg();
|
||||
returnmsg = responseBase.getBody().getReturnmsg();
|
||||
|
||||
System.out.println("[OK][returncode]=>>>" + returncode);
|
||||
System.out.println("[OK][returnmsg]=>>>" + returnmsg);
|
||||
|
||||
//将返回的信息结果更新到LI_INVOICE_RESULT
|
||||
try {
|
||||
BizObjectManager invoiceResultManger = JBOFactory.getBizObjectManager(LI_INVOICE_RESULT.CLASS_NAME, tx);
|
||||
invoiceResultManger.createQuery("UPDATE O SET field1=:returnmsg,field2=:returncode WHERE sid=:sid ").setParameter("returnmsg", returnmsg)
|
||||
.setParameter("returncode", returncode).setParameter("sid", sid).executeUpdate();
|
||||
} catch (JBOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
if ("0".equals(returncode)) {
|
||||
// 修改租金发票信息表的状态
|
||||
BizObjectManager confirmDetailManager;
|
||||
@ -907,7 +925,7 @@ public class backRentPrintInvoiceManager extends BaseTable {
|
||||
return result.getMsg();
|
||||
}
|
||||
}
|
||||
return "打印请求成功!";
|
||||
return returnmsg;
|
||||
}
|
||||
//打印发票
|
||||
public ResultPojo doPostPrint(String xml) {
|
||||
@ -955,10 +973,25 @@ public class backRentPrintInvoiceManager extends BaseTable {
|
||||
|
||||
String[] newSids = this.newSids.split("@");
|
||||
String newSid ="";
|
||||
//String invoice_confirm_id = "";
|
||||
String returncode="";
|
||||
String returnmsg="";
|
||||
String checkReturncode = "";
|
||||
//循环遍历选中的sid
|
||||
for (int i = 0; i < newSids.length; i++) {
|
||||
newSid = newSids[i];
|
||||
|
||||
//防止重复打印 LI_INVOICE_PRINT_RESULT
|
||||
try {
|
||||
BizObject PrintResutBizObject = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LI_INVOICE_PRINT_RESULT", "new_sid=:new_sid")
|
||||
.setParameter("new_sid", newSid).getSingleResult(false);
|
||||
checkReturncode = PrintResutBizObject.getAttribute("returncode").toString();
|
||||
if("0".equals(checkReturncode)){
|
||||
return "请勿重复打印!";
|
||||
}
|
||||
} catch (JBOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
//拼xml
|
||||
InvoiceRequestBase invoiceRequestBase = new InvoiceRequestBase();
|
||||
InvoiceRequestHead invoiceRequestHead = new InvoiceRequestHead();
|
||||
@ -978,8 +1011,8 @@ public class backRentPrintInvoiceManager extends BaseTable {
|
||||
//获取返回的xml结果
|
||||
if (result.getCode() == 0) {
|
||||
InvoiceRequestBase responseBase = (InvoiceRequestBase) result.getData();
|
||||
String returncode = responseBase.getBody().getReturncode();
|
||||
String returnmsg = responseBase.getBody().getReturnmsg();
|
||||
returncode = responseBase.getBody().getReturncode();
|
||||
returnmsg = responseBase.getBody().getReturnmsg();
|
||||
|
||||
System.out.println("[OK][returncode]=>>>" + returncode);
|
||||
System.out.println("[OK][returnmsg]=>>>" + returnmsg);
|
||||
@ -987,12 +1020,9 @@ public class backRentPrintInvoiceManager extends BaseTable {
|
||||
BizObjectManager invoicePrintResultManager;
|
||||
try {
|
||||
//发票打印请求成功,更新数据插入到li_invoice_print_result
|
||||
/* invoicePrintResultManager = JBOFactory.getBizObjectManager(LI_INVOICE_PRINT_RESULT.CLASS_NAME, tx);
|
||||
invoicePrintResultManager.createQuery("update O set returncode=:returncode,returnmsg=:returnmsg where new_sid=:new_sid and invoice_type='back_rent'")
|
||||
.setParameter("returncode", returncode).setParameter("returnmsg", returnmsg)
|
||||
.setParameter("new_sid", newSid).executeUpdate();*/
|
||||
invoicePrintResultManager = JBOFactory.getBizObjectManager(LI_INVOICE_PRINT_RESULT.CLASS_NAME, tx);
|
||||
|
||||
JBOFactory.createBizObjectQuery(LI_INVOICE_PRINT_RESULT.CLASS_NAME, "update O set returncode=:returncode,returnmsg=:returnmsg where new_sid=:new_sid and invoice_type='back_rent'")
|
||||
invoicePrintResultManager.createQuery("update O set returncode=:returncode,returnmsg=:returnmsg where new_sid=:new_sid and invoice_type='back_rent'")
|
||||
.setParameter("returncode", returncode).setParameter("returnmsg", returnmsg)
|
||||
.setParameter("new_sid", newSid).executeUpdate();
|
||||
|
||||
@ -1008,7 +1038,7 @@ public class backRentPrintInvoiceManager extends BaseTable {
|
||||
return result.getMsg();
|
||||
}
|
||||
}
|
||||
return "打印成功!";
|
||||
return returnmsg;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -768,6 +768,8 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
|
||||
String invoice_confirm_id = "";
|
||||
String ghdwmc = "";
|
||||
String invoice_type = "direct_rent";
|
||||
String returnmsg = "";
|
||||
String returncode = "";
|
||||
for (int i = 0; i < sids.length; i++) {
|
||||
sid = sids[i];
|
||||
|
||||
@ -780,6 +782,12 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
|
||||
}else{
|
||||
fpdm = invoiceResult.getAttribute("fpdm").toString();
|
||||
fphm = invoiceResult.getAttribute("fphm").toString();
|
||||
// 防止重复发票打印请求 field2(returncode)
|
||||
String a = invoiceResult.getAttribute("field2")==null?"":invoiceResult.getAttribute("field2").toString();
|
||||
if("0".equals(a)){
|
||||
return "请勿重复打印申请!";
|
||||
}
|
||||
|
||||
}
|
||||
} catch (JBOException e) {
|
||||
e.printStackTrace();
|
||||
@ -828,11 +836,23 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
|
||||
String id = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
if (result.getCode() == 0) {
|
||||
InvoiceRequestBase responseBase = (InvoiceRequestBase) result.getData();
|
||||
String returncode = responseBase.getBody().getReturncode();
|
||||
String returnmsg = responseBase.getBody().getReturnmsg();
|
||||
returncode = responseBase.getBody().getReturncode();
|
||||
returnmsg = responseBase.getBody().getReturnmsg();
|
||||
|
||||
System.out.println("[OK][returncode]=>>>" + returncode);
|
||||
System.out.println("[OK][returnmsg]=>>>" + returnmsg);
|
||||
|
||||
|
||||
//将返回的信息结果更新到LI_INVOICE_RESULT
|
||||
try {
|
||||
BizObjectManager invoiceResultManger = JBOFactory.getBizObjectManager(LI_INVOICE_RESULT.CLASS_NAME, tx);
|
||||
invoiceResultManger.createQuery("UPDATE O SET field1=:returnmsg,field2=:returncode WHERE sid=:sid ").setParameter("returnmsg", returnmsg)
|
||||
.setParameter("returncode", returncode).setParameter("sid", sid).executeUpdate();
|
||||
} catch (JBOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
if ("0".equals(returncode)) {
|
||||
// 修改租金发票信息表的状态
|
||||
BizObjectManager confirmDetailManager;
|
||||
@ -850,7 +870,6 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
|
||||
try {
|
||||
invoicePrintResult = this.initTabeUserInfo(invoicePrintResult);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
invoicePrintResultManager.saveObject(invoicePrintResult);
|
||||
@ -878,9 +897,13 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
|
||||
return result.getMsg();
|
||||
}
|
||||
}
|
||||
return "打印请求成功!";
|
||||
return returnmsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 直租纸质发票打印
|
||||
* @param tx
|
||||
* @return
|
||||
*/
|
||||
public String print(JBOTransaction tx){
|
||||
Configure config = Configure.getInstance();
|
||||
String appId = "";
|
||||
@ -894,10 +917,25 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
|
||||
|
||||
String[] newSids = this.newSids.split("@");
|
||||
String newSid ="";
|
||||
//String invoice_confirm_id = "";
|
||||
String returnmsg = "";
|
||||
String checkReturncode = "";
|
||||
//循环遍历选中的sid
|
||||
for (int i = 0; i < newSids.length; i++) {
|
||||
newSid = newSids[i];
|
||||
|
||||
//防止重复打印 LI_INVOICE_PRINT_RESULT
|
||||
try {
|
||||
BizObject PrintResutBizObject = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LI_INVOICE_PRINT_RESULT", "new_sid=:new_sid")
|
||||
.setParameter("new_sid", newSid).getSingleResult(false);
|
||||
checkReturncode = PrintResutBizObject.getAttribute("returncode").toString();
|
||||
if("0".equals(checkReturncode)){
|
||||
return "请勿重复打印!";
|
||||
}
|
||||
} catch (JBOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
//拼xml
|
||||
InvoiceRequestBase invoiceRequestBase = new InvoiceRequestBase();
|
||||
InvoiceRequestHead invoiceRequestHead = new InvoiceRequestHead();
|
||||
@ -918,23 +956,24 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
|
||||
if (result.getCode() == 0) {
|
||||
InvoiceRequestBase responseBase = (InvoiceRequestBase) result.getData();
|
||||
String returncode = responseBase.getBody().getReturncode();
|
||||
String returnmsg = responseBase.getBody().getReturnmsg();
|
||||
returnmsg = responseBase.getBody().getReturnmsg();
|
||||
|
||||
System.out.println("[OK][returncode]=>>>" + returncode);
|
||||
System.out.println("[OK][returnmsg]=>>>" + returnmsg);
|
||||
BizObjectManager invoicePrintResultManager;
|
||||
try {
|
||||
//发票打印请求成功,更新数据插入到li_invoice_print_result
|
||||
invoicePrintResultManager = JBOFactory.getBizObjectManager(LI_INVOICE_PRINT_RESULT.CLASS_NAME, tx);
|
||||
|
||||
invoicePrintResultManager.createQuery("update O set returncode=:returncode,returnmsg=:returnmsg where new_sid=:new_sid and invoice_type='direct_rent'")
|
||||
.setParameter("returncode", returncode).setParameter("returnmsg", returnmsg)
|
||||
.setParameter("new_sid", newSid).executeUpdate();
|
||||
|
||||
} catch (JBOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if ("0".equals(returncode)) {
|
||||
BizObjectManager invoicePrintResultManager;
|
||||
try {
|
||||
//发票打印请求成功,更新数据插入到li_invoice_print_result
|
||||
invoicePrintResultManager = JBOFactory.getBizObjectManager(LI_INVOICE_PRINT_RESULT.CLASS_NAME, tx);
|
||||
|
||||
invoicePrintResultManager.createQuery("update O set returncode=:returncode,returnmsg=:returnmsg where new_sid=:new_sid and invoice_type='direct_rent'")
|
||||
.setParameter("returncode", returncode).setParameter("returnmsg", returnmsg)
|
||||
.setParameter("new_sid", newSid).executeUpdate();
|
||||
|
||||
} catch (JBOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
return returnmsg;
|
||||
}
|
||||
@ -943,7 +982,7 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
|
||||
return result.getMsg();
|
||||
}
|
||||
}
|
||||
return "打印成功!";
|
||||
return returnmsg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user