This commit is contained in:
58261 2018-10-10 17:14:33 +08:00
commit a8d9edd600
6 changed files with 123 additions and 87 deletions

View File

@ -5,7 +5,7 @@ function isShortDate(value){
return /^[0-9]{4}\/[0-9]{2}\/[0-9]{2}$/g.test(value);
}
function isEmail(value){
return /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/g.test(value);
return /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[-|_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/g.test(value);
}
function isEmpty(value){
//alert("isEmpty");
@ -75,7 +75,7 @@ jQuery.validator.prototype.showLabel = function(element,message){
}
this.toShow = this.toShow.add(label);
};
/*jquery.validate.js功能扩展*/
/*jquery.validate.js<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ*/
jQuery.validator.addMethod("maxlength",function(value,element,params){
if(!value) value = "";
var cArr = value.match(/[^\x00-\xff]/ig);
@ -108,21 +108,21 @@ jQuery.validator.addMethod("maxx",function(value,element,params){
return false;
});
//通过远程赋值
//ͨ<EFBFBD><EFBFBD>Զ<EFBFBD≯<EFBFBD>ֵ
function setItemValueFromRemote(dwname,rowindex,fieldName,javaClassName,params){
var sValue = remoteFetch(dwname,rowindex,javaClassName,params);
if(sValue!=null)
setItemValue(dwname,rowindex,fieldName,sValue);
}
//远程获取数据
//Զ<EFBFBD>̻<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>
function remoteFetch(dwname,rowindex,javaClassName,params){
if(!isNaN(dwname))dwname = "myiframe" + dwname;
var dwindex = dwname.substring(8);
var sUrl = sWebRootPath + "/Frame/page/ow/RemoteFetch.jsp";
var param = "ClassName=" + javaClassName + "&rand="+Math.random();
var result = ['error','无法连接服务器'];
var result = ['error','<EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
for(var i=0;i<params.length;i++){
if(params[i] && params[i]!=''){
var sParamName = params[i];
@ -135,7 +135,7 @@ function remoteFetch(dwname,rowindex,javaClassName,params){
else
sParamValue = getItemValue(dwindex,rowindex,sParamName.toUpperCase());
if(sParamValue==undefined)sParamValue = "";
param += "&"+sParamName+"=" + sParamValue.replace(/&/g, "⊙≌□");
param += "&"+sParamName+"=" + sParamValue.replace(/&/g, "<EFBFBD>ѡա<EFBFBD>");
}
}
$.ajax({
@ -157,7 +157,7 @@ function remoteFetch(dwname,rowindex,javaClassName,params){
if(result[0]=='success')
return result[1];
else{
alert('远程获取出错:'+ result[1]);
alert('Զ<EFBFBD>̻<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>?'+ result[1]);
return null;
}
}
@ -221,7 +221,7 @@ jQuery.validator.addMethod("classcheck",function(value,element,params,index){
//var sUrl = sWebRootPath + "/Frame/page/ow/ValidClass.jsp";
var sUrl = sWebRootPath + params[0];
//alert("sUrl=" + sUrl);
var param = "ClassName=" + params[1] + "&rand="+Math.random()+"&Value=" + value.replace(/&/g, "⊙≌□");
var param = "ClassName=" + params[1] + "&rand="+Math.random()+"&Value=" + value.replace(/&/g, "<EFBFBD>ѡա<EFBFBD>");
var result = false;
for(var i=3;i<=params.length;i++){
if(params[i] && params[i]!=''){
@ -241,7 +241,7 @@ jQuery.validator.addMethod("classcheck",function(value,element,params,index){
}
if(sParamValue==undefined)sParamValue = "";
if(sParamValue.length>0)sParamValue=sParamValue.replace(/&/g, "⊙≌□");
if(sParamValue.length>0)sParamValue=sParamValue.replace(/&/g, "<EFBFBD>ѡա<EFBFBD>");
param += "&"+sParamName+"=" + sParamValue;
}
}
@ -266,7 +266,7 @@ jQuery.validator.addMethod("classcheck",function(value,element,params,index){
});
return result;
});
//如果是保存则验证非空,如果暂存则不验证
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>DZ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>ǿ<EFBFBD>,<2C><><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD><EFBFBD>֤
jQuery.validator.addMethod("required0",function(value,element,param){
//alert(value +"|" + element.type + "|" + element.name + "|" +element.outerHTML);
if(SAVE_TMP==true){
@ -325,7 +325,7 @@ jQuery.validator.addMethod("expressions",function(value,element,expressions,inde
}
if(errorInfos.length>0){
//alert(element.parentNode.innerHTML);
element.setAttribute("errorInfo",errorInfos.join(',并且'));
element.setAttribute("errorInfo",errorInfos.join(',<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
return false;
}
else
@ -358,7 +358,7 @@ function isSpecialCharacter(value){
}
function addSpecialCharacterValidate(id2name){
return; // 关闭特殊校验请打开行首注释
return; // <EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>
if(!window._user_validator){
window._user_validator = new Array();
}
@ -375,7 +375,7 @@ function addSpecialCharacterValidate(id2name){
}else{
_user_validator[0]["rules"][id2name[i][0]]["SpecialCharacter"] = true;
}
var message = id2name[i][1]+"不允许特殊字符【!#$%^&*()[]{}<>】";
var message = id2name[i][1]+"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>!#$%^&*()[]{}<><3E><>";
if(!_user_validator[0]["messages"][id2name[i][0]]){
_user_validator[0]["messages"][id2name[i][0]] = {"SpecialCharacter":message};
}else{

View File

@ -30,6 +30,7 @@
dwTemp.ReadOnly = "1";
dwTemp.setPageSize(50);
// dwTemp.genHTMLObjectWindow(docname+","+contract_id);
dwTemp.genHTMLObjectWindow(flowunid);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] =null;
@ -120,7 +121,7 @@
tempParam["OBJECTTYPE"]="TriditionSuspension";
tempParam["FLOW_UNID"]="<%=flowunid%>";
tempParam["PROJ_ID"]="<%=projid%>";
tempParam["contract_id"]="<%=contract_id%>";
tempParam["CONTRACT_ID"]="<%=contract_id%>";
//生成模板固定参数
tempParam["CurUserId"]="<%=CurUser.getUserID()%>";
tempParam["CurOrgId"]="<%=CurUser.getOrgID()%>";
@ -131,11 +132,11 @@
if(sparam.length>0){sparam+=",";}
sparam+=key+"="+param[key];
}
// var deleteresult=RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentNotinyDeleteAction","deletequtation","plan_number="+plan_number+",plan_list="+plan_list);
var deleteresult=RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentNotinyDeleteAction","deletequtation","plan_number=<%=flowunid%>,plan_list=TriditionSuspension");
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
//word转pdf
var id = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","wordToPdfAnnex","FlowUnid=<%=flowunid%>,PLAN_LIST=TriditionSuspension");
alert("生成成功!!!");
reloadSelf();
}

View File

@ -44,7 +44,12 @@ public class RentNotinyDeleteAction {
//根据前台参数生成文档
public void deletequtation(JBOTransaction tx) throws Exception{
BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME);
BizObject DOCRELATIVE=bom.createQuery("plan_number=:plan_number and plan_list=:plan_list").setParameter("plan_number",plan_number).setParameter("plan_list", plan_list).getSingleResult(false);
BizObject DOCRELATIVE=null;
if("TriditionSuspension".equals(plan_list)){
DOCRELATIVE=bom.createQuery("FLOW_UNID=:flowunid and OBJECTTYPE=:objecttype").setParameter("flowunid",plan_number).setParameter("objecttype", plan_list).getSingleResult(false);
}else{
DOCRELATIVE=bom.createQuery("plan_number=:plan_number and plan_list=:plan_list").setParameter("plan_number",plan_number).setParameter("plan_list", plan_list).getSingleResult(false);
}
if(DOCRELATIVE!=null){
String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString();
BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME);

View File

@ -309,7 +309,7 @@ public class backRentPrintInvoiceManager extends BaseTable {
*/
public String invoiceConfirmSubmit(JBOTransaction tx) throws Exception {
Transaction Sqlca = null;
BizObjectManager ownAccountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
/*BizObjectManager ownAccountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
BizObject ownAccount = ownAccountManager
.createQuery("state_=:state and acc_type=:acc_type and money_type=:money_type and account_type=:account_type")
.setParameter("state", "0010").setParameter("acc_type", "0010")
@ -317,7 +317,7 @@ public class backRentPrintInvoiceManager extends BaseTable {
.setParameter("account_type", "invoice").getSingleResult(false);
if (ownAccount == null || "".equals(ownAccount)) {
return "您的本方银行账户为空!";
}
}*/
String[] rentInvoiceids = this.getIds().split("@");
List<String> rentPlanIdList = new ArrayList<String>();
@ -327,12 +327,28 @@ public class backRentPrintInvoiceManager extends BaseTable {
String customerid = "";
String customerName = "";
String xhdwyhzh = "";
String xhdwdzdh = "";
String rentPlanstr = StringUtils.join(rentPlanIdList.toArray(), ",");
BizObjectManager invoiceManager = JBOFactory.getBizObjectManager(VI_INVOICE_RENT_CONFIRM_PRINT.CLASS_NAME);
@SuppressWarnings("unchecked")
List<BizObject> checkInvoiceList = (List<BizObject>) invoiceManager.createQuery("SELECT O.contract_id,O.customer_name,O.CUSTOMER_ID FROM O WHERE O.id IN (" + rentPlanstr + ") GROUP BY O.contract_id").getResultList(false);
for (BizObject bizObject : checkInvoiceList) {
String contract_id = bizObject.getAttribute("contract_id").toString();
//查询本方银行账号和地址电话
BizObject rentIncome = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_RENT_INCOME", "SELECT O.own_number,oi.lease_tel FROM lc_rent_income O LEFT JOIN own_info oi ON O.own_account=oi.own_name WHERE O.contract_id =:contract_id GROUP BY O.contract_id")
.setParameter("contract_id", contract_id).getSingleResult(false);
if(rentIncome==null){
return "您的本方银行账户为空!";
}else{
//本方银行账号
xhdwyhzh = rentIncome.getAttribute("own_number")==null? "" : rentIncome.getAttribute("own_number").toString();
//地址电话
xhdwdzdh = rentIncome.getAttribute("lease_tel")==null? "" : rentIncome.getAttribute("lease_tel").toString();
}
customerid = bizObject.getAttribute("CUSTOMER_ID").toString();
customerName = bizObject.getAttribute("customer_name").toString();
@ -464,11 +480,11 @@ public class backRentPrintInvoiceManager extends BaseTable {
tx.join(confirmManager);
BizObject confirmBizObject = confirmManager.newObject();
String ownId = ownAccount.getAttribute("own_id").toString();
/*String ownId = ownAccount.getAttribute("own_id").toString();
BizObjectManager ownInfoManager = JBOFactory.getBizObjectManager(OWN_INFO.CLASS_NAME);
BizObject ownInfo = ownInfoManager.createQuery("OWN_NUMBER=:OWN_NUMBER").setParameter("OWN_NUMBER", ownId).getSingleResult(false);
String xhdwdzdh = ownInfo.getAttribute("LEASE_TEL").toString();// 销货单位地址电话
*/
BizObjectManager customerPersonManager = JBOFactory.getBizObjectManager(CUSTOMER_PERSON.CLASS_NAME);
BizObjectManager customerFamilyManager = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY.CLASS_NAME);
@ -515,7 +531,7 @@ public class backRentPrintInvoiceManager extends BaseTable {
confirmBizObject.setAttributeValue("kplx", "0");
confirmBizObject.setAttributeValue("tspz", "00");
confirmBizObject.setAttributeValue("xhdwdzdh", xhdwdzdh);
confirmBizObject.setAttributeValue("xhdwyhzh", ownAccount.getAttribute("acc_number").toString());
confirmBizObject.setAttributeValue("xhdwyhzh", xhdwyhzh);
confirmBizObject.setAttributeValue("ghdwsbh", certid);
confirmBizObject.setAttributeValue("ghdwmc", customerName);
confirmBizObject.setAttributeValue("ghdwdzdh", address_tel);

View File

@ -271,14 +271,16 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
public String invoiceConfirmSubmitE(JBOTransaction tx) throws Exception{
Transaction Sqlca = null;
BizObjectManager ownAccountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
/*BizObjectManager ownAccountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
BizObject ownAccount = ownAccountManager.createQuery("state_=:state and acc_type=:acc_type and money_type=:money_type and account_type=:account_type")
.setParameter("state", "0010").setParameter("acc_type", "0010")
.setParameter("money_type", "01")
.setParameter("account_type", "invoice").getSingleResult(false);
if (ownAccount == null || "".equals(ownAccount)) {
return "您的本方银行账户为空!";
}
}*/
String[] rentInvoiceids = this.getIds().split("@");
List<String> rentPlanIdList = new ArrayList<String>();
@ -288,6 +290,8 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
String customerid = "";
String customerName = "";
String xhdwyhzh = "";
String xhdwdzdh = "";
String rentPlanstr = StringUtils.join(rentPlanIdList.toArray(), ",");
BizObjectManager invoiceManager = JBOFactory.getBizObjectManager(VI_INVOICE_RENT_INCOME_CONFIRM_E.CLASS_NAME);
@SuppressWarnings("unchecked")
@ -295,6 +299,19 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
//循环遍历合同
for (BizObject bizObject : checkInvoiceList) {
String contract_id = bizObject.getAttribute("contract_id").toString();
//查询本方银行账号和地址电话
BizObject rent = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_RENT_INCOME", "SELECT O.own_number,oi.lease_tel FROM lc_rent_income O LEFT JOIN own_info oi ON O.own_account=oi.own_name WHERE O.contract_id =:contract_id GROUP BY O.contract_id")
.setParameter("contract_id", contract_id).getSingleResult(false);
if(rent==null){
return "您的本方银行账户为空!";
}else{
//本方银行账号
xhdwyhzh = rent.getAttribute("own_number")==null? "" : rent.getAttribute("own_number").toString();
//地址电话
xhdwdzdh = rent.getAttribute("lease_tel")==null? "" : rent.getAttribute("lease_tel").toString();
}
customerid = bizObject.getAttribute("CUSTOMER_ID").toString();
customerName = bizObject.getAttribute("customer_name").toString();
@ -411,11 +428,11 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
tx.join(confirmManager);
BizObject confirmBizObject = confirmManager.newObject();
String ownId = ownAccount.getAttribute("own_id").toString();
/*String ownId = ownAccount.getAttribute("own_id").toString();
BizObjectManager ownInfoManager = JBOFactory.getBizObjectManager(OWN_INFO.CLASS_NAME);
BizObject ownInfo = ownInfoManager.createQuery("OWN_NUMBER=:OWN_NUMBER").setParameter("OWN_NUMBER", ownId).getSingleResult(false);
String xhdwdzdh = ownInfo.getAttribute("LEASE_TEL").toString();// 销货单位地址电话
*/
BizObjectManager customerPersonManager = JBOFactory.getBizObjectManager(CUSTOMER_PERSON.CLASS_NAME);
BizObjectManager customerFamilyManager = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY.CLASS_NAME);
@ -465,7 +482,7 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
confirmBizObject.setAttributeValue("kplx", "0");
confirmBizObject.setAttributeValue("tspz", "00");
confirmBizObject.setAttributeValue("xhdwdzdh", xhdwdzdh);
confirmBizObject.setAttributeValue("xhdwyhzh", ownAccount.getAttribute("acc_number").toString());
confirmBizObject.setAttributeValue("xhdwyhzh", xhdwyhzh);
confirmBizObject.setAttributeValue("ghdwsbh", certid);
confirmBizObject.setAttributeValue("ghdwmc", customerName);
confirmBizObject.setAttributeValue("ghdwdzdh", address_tel);
@ -537,14 +554,14 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
public String invoiceConfirmSubmit(JBOTransaction tx) throws Exception{
Transaction Sqlca = null;
BizObjectManager ownAccountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
/*BizObjectManager ownAccountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
BizObject ownAccount = ownAccountManager.createQuery("state_=:state and acc_type=:acc_type and money_type=:money_type and account_type=:account_type")
.setParameter("state", "0010").setParameter("acc_type", "0010")
.setParameter("money_type", "01")
.setParameter("account_type", "invoice").getSingleResult(false);
if (ownAccount == null || "".equals(ownAccount)) {
return "您的本方银行账户为空!";
}
}*/
String[] rentInvoiceids = this.getIds().split("@");
List<String> rentPlanIdList = new ArrayList<String>();
@ -554,6 +571,8 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
String customerid = "";
String customerName = "";
String xhdwyhzh = "";
String xhdwdzdh = "";
String rentPlanstr = StringUtils.join(rentPlanIdList.toArray(), ",");
BizObjectManager invoiceManager = JBOFactory.getBizObjectManager(VI_INVOICE_RENT_INCOME_CONFIRM.CLASS_NAME);
// tx.join(invoiceManager);
@ -562,6 +581,19 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
//循环遍历合同
for (BizObject bizObject : checkInvoiceList) {
String contract_id = bizObject.getAttribute("contract_id").toString();
//查询本方银行账号和地址电话
BizObject rent = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_RENT_INCOME", "SELECT O.own_number,oi.lease_tel FROM lc_rent_income O LEFT JOIN own_info oi ON O.own_account=oi.own_name WHERE O.contract_id =:contract_id GROUP BY O.contract_id")
.setParameter("contract_id", contract_id).getSingleResult(false);
if(rent==null){
return "您的本方银行账户为空!";
}else{
//本方银行账号
xhdwyhzh = rent.getAttribute("own_number")==null? "" : rent.getAttribute("own_number").toString();
//地址电话
xhdwdzdh = rent.getAttribute("lease_tel")==null? "" : rent.getAttribute("lease_tel").toString();
}
customerid = bizObject.getAttribute("CUSTOMER_ID").toString();
customerName = bizObject.getAttribute("customer_name").toString();
@ -681,24 +713,20 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
tx.join(confirmManager);
BizObject confirmBizObject = confirmManager.newObject();
String ownId = ownAccount.getAttribute("own_id").toString();
/*String ownId = ownAccount.getAttribute("own_id").toString();
BizObjectManager ownInfoManager = JBOFactory.getBizObjectManager(OWN_INFO.CLASS_NAME);
BizObject ownInfo = ownInfoManager.createQuery("OWN_NUMBER=:OWN_NUMBER").setParameter("OWN_NUMBER", ownId).getSingleResult(false);
String xhdwdzdh = ownInfo.getAttribute("LEASE_TEL").toString();// 销货单位地址电话
*/
BizObjectManager customerPersonManager = JBOFactory.getBizObjectManager(CUSTOMER_PERSON.CLASS_NAME);
BizObjectManager customerFamilyManager = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY.CLASS_NAME);
BizObject customerPerson = customerPersonManager
.createQuery(
BizObject customerPerson = customerPersonManager.createQuery(
"SELECT o.certid,caa.fulladdress,o.mobile,ca.acc_number,ca.bank_name from o JOIN jbo.app.tenwa.customer.CUSTOMER_ACCOUNT ca ON ca.customerid=o.customerid JOIN jbo.app.tenwa.customer.CUSTOMER_ADDRESS caa ON caa.customerid=ca.customerid where o.customerid=:customerid")
.setParameter("customerid", customerid)
.getSingleResult(false);
.setParameter("customerid", customerid).getSingleResult(false);
BizObject customerFamily = customerFamilyManager
.createQuery("customerid=:customerid")
.setParameter("customerid", customerid)
.getSingleResult(false);
BizObject customerFamily = customerFamilyManager.createQuery("customerid=:customerid")
.setParameter("customerid", customerid).getSingleResult(false);
String familyTel = "";
if (customerFamily != null) {
familyTel = customerFamily.getAttribute("tel").toString();
@ -744,7 +772,7 @@ public class rentPlanInvoiceDirectManager extends BaseTable{
confirmBizObject.setAttributeValue("kplx", "0");
confirmBizObject.setAttributeValue("tspz", "00");
confirmBizObject.setAttributeValue("xhdwdzdh", xhdwdzdh);
confirmBizObject.setAttributeValue("xhdwyhzh", ownAccount.getAttribute("acc_number").toString());
confirmBizObject.setAttributeValue("xhdwyhzh", xhdwyhzh);
confirmBizObject.setAttributeValue("ghdwsbh", certid);
confirmBizObject.setAttributeValue("ghdwmc", customerName);
confirmBizObject.setAttributeValue("ghdwdzdh", address_tel);

View File

@ -308,7 +308,8 @@ public class rentPlanInvoiceManager extends BaseTable {
*/
public String invoiceConfirmSubmit(JBOTransaction tx) throws Exception {
Transaction Sqlca = null;
BizObjectManager ownAccountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
/* BizObjectManager ownAccountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
BizObject ownAccount = ownAccountManager
.createQuery("state_=:state and acc_type=:acc_type and money_type=:money_type and account_type=:account_type")
.setParameter("state", "0010").setParameter("acc_type", "0010")
@ -316,7 +317,9 @@ public class rentPlanInvoiceManager extends BaseTable {
.setParameter("account_type", "invoice").getSingleResult(false);
if (ownAccount == null || "".equals(ownAccount)) {
return "您的本方银行账户为空!";
}
}*/
String[] rentInvoiceids = this.getIds().split("@");
List<String> rentPlanIdList = new ArrayList<String>();
@ -328,22 +331,25 @@ public class rentPlanInvoiceManager extends BaseTable {
String customerName = "";
String rentPlanstr = StringUtils.join(rentPlanIdList.toArray(), ",");
BizObjectManager invoiceManager = JBOFactory.getBizObjectManager(VI_INVOICE_RENT_PLAN_CONFIRM.CLASS_NAME);
// tx.join(invoiceManager);
@SuppressWarnings("unchecked")
List<BizObject> checkInvoiceList = (List<BizObject>) invoiceManager
.createQuery("SELECT O.contract_id,O.customer_name,O.CUSTOMER_ID FROM O WHERE O.id IN (" + rentPlanstr + ") GROUP BY O.contract_id")
.getResultList(false);
/*
* if(checkInvoiceList!=null &&checkInvoiceList.size()>1){ return
* "选择的不是同一个客户!"; }else if(checkInvoiceList!=null
* &&checkInvoiceList.size()==1){ customerid =
* checkInvoiceList.get(0).getAttribute("CUSTOMER_ID").toString();
* customerName =
* checkInvoiceList.get(0).getAttribute("customer_name").toString();
* }else{ return "ERROR[02]"; }
*/
List<BizObject> checkInvoiceList = (List<BizObject>) invoiceManager.createQuery("SELECT O.contract_id,O.customer_name,O.CUSTOMER_ID FROM O WHERE O.id IN (" + rentPlanstr + ") GROUP BY O.contract_id").getResultList(false);
String xhdwyhzh = "";
String xhdwdzdh = "";
for (BizObject bizObject : checkInvoiceList) {
//获取合同id
String contract_id = bizObject.getAttribute("contract_id").toString();
//查询本方银行账号和地址电话
BizObject rent = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_RENT_INCOME", "SELECT O.own_number,oi.lease_tel FROM lc_rent_income O LEFT JOIN own_info oi ON O.own_account=oi.own_name WHERE O.contract_id =:contract_id GROUP BY O.contract_id")
.setParameter("contract_id", contract_id).getSingleResult(false);
if(rent==null){
return "您的本方银行账户为空!";
}else{
//本方银行账号
xhdwyhzh = rent.getAttribute("own_number")==null? "" : rent.getAttribute("own_number").toString();
//地址电话
xhdwdzdh = rent.getAttribute("lease_tel")==null? "" : rent.getAttribute("lease_tel").toString();
}
customerid = bizObject.getAttribute("CUSTOMER_ID").toString();
customerName = bizObject.getAttribute("customer_name").toString();
@ -372,8 +378,6 @@ public class rentPlanInvoiceManager extends BaseTable {
BizObjectManager invoiceRentManager = JBOFactory.getBizObjectManager(LI_RENT_INVOICE_INFO.CLASS_NAME);
//税率
Double sl = 0.00;
for (int i = 0; i < ids.length; i++) {
String invoiceId = ids[i];// li_rent_invoice_info的id
@ -391,8 +395,7 @@ public class rentPlanInvoiceManager extends BaseTable {
String taxType = "";
BizObject invoiceRentBizObject = invoiceRentManager.createQuery("ID=:id ").setParameter("id", invoiceId)
.getSingleResult(false);
BizObject invoiceRentBizObject = invoiceRentManager.createQuery("ID=:id ").setParameter("id", invoiceId).getSingleResult(false);
invoiceMoney = new BigDecimal(invoiceRentBizObject.getAttribute("INVOICE_MONEY").getString()).setScale(2,
BigDecimal.ROUND_HALF_UP).doubleValue();
TAX_TYPE = invoiceRentBizObject.getAttribute("TAX_TYPE").getString();
@ -453,8 +456,7 @@ public class rentPlanInvoiceManager extends BaseTable {
confirmDetailBizObject.setAttributeValue("spsm", "");
confirmDetailBizObject.setAttributeValue("ggxh", planList);
confirmDetailBizObject.setAttributeValue("invoice_confirm_id",
confirmId);
confirmDetailBizObject.setAttributeValue("invoice_confirm_id",confirmId);
confirmDetailBizObject.setAttributeValue("sl", sl);
confirmDetailBizObject.setAttributeValue("se", se);
confirmDetailBizObject.setAttributeValue("hsbz", "0");
@ -484,24 +486,18 @@ public class rentPlanInvoiceManager extends BaseTable {
tx.join(confirmManager);
BizObject confirmBizObject = confirmManager.newObject();
String ownId = ownAccount.getAttribute("own_id").toString();
/*String ownId = ownAccount.getAttribute("own_id").toString();
BizObjectManager ownInfoManager = JBOFactory.getBizObjectManager(OWN_INFO.CLASS_NAME);
BizObject ownInfo = ownInfoManager.createQuery("OWN_NUMBER=:OWN_NUMBER").setParameter("OWN_NUMBER", ownId).getSingleResult(false);
String xhdwdzdh = ownInfo.getAttribute("LEASE_TEL").toString();// 销货单位地址电话
*/
BizObjectManager customerPersonManager = JBOFactory.getBizObjectManager(CUSTOMER_PERSON.CLASS_NAME);
BizObjectManager customerFamilyManager = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY.CLASS_NAME);
BizObject customerPerson = customerPersonManager
.createQuery(
"SELECT o.certid,caa.fulladdress,o.mobile,ca.acc_number,ca.bank_name from o JOIN jbo.app.tenwa.customer.CUSTOMER_ACCOUNT ca ON ca.customerid=o.customerid JOIN jbo.app.tenwa.customer.CUSTOMER_ADDRESS caa ON caa.customerid=ca.customerid where o.customerid=:customerid")
.setParameter("customerid", customerid)
.getSingleResult(false);
BizObject customerPerson = customerPersonManager.createQuery("SELECT o.certid,caa.fulladdress,o.mobile,ca.acc_number,ca.bank_name from o JOIN jbo.app.tenwa.customer.CUSTOMER_ACCOUNT ca ON ca.customerid=o.customerid JOIN jbo.app.tenwa.customer.CUSTOMER_ADDRESS caa ON caa.customerid=ca.customerid where o.customerid=:customerid")
.setParameter("customerid", customerid).getSingleResult(false);
BizObject customerFamily = customerFamilyManager
.createQuery("customerid=:customerid")
.setParameter("customerid", customerid)
.getSingleResult(false);
BizObject customerFamily = customerFamilyManager.createQuery("customerid=:customerid").setParameter("customerid", customerid).getSingleResult(false);
String familyTel = "";
if (customerFamily != null) {
familyTel = customerFamily.getAttribute("tel").toString();
@ -515,13 +511,10 @@ public class rentPlanInvoiceManager extends BaseTable {
String address_tel = "";
if (customerPerson != null) {
certid = customerPerson.getAttribute("certid").toString();
fulladdress = customerPerson.getAttribute("fulladdress")
.toString();
fulladdress = customerPerson.getAttribute("fulladdress").toString();
mobile = customerPerson.getAttribute("mobile").toString();
acc_number = customerPerson.getAttribute("acc_number")
.toString();
bank_name = customerPerson.getAttribute("bank_name")
.toString();
acc_number = customerPerson.getAttribute("acc_number").toString();
bank_name = customerPerson.getAttribute("bank_name").toString();
acc_bank = "[" + bank_name + "][" + acc_number + "]";
address_tel = "[" + mobile + "][" + fulladdress + "]";
@ -543,7 +536,7 @@ public class rentPlanInvoiceManager extends BaseTable {
confirmBizObject.setAttributeValue("kplx", "0");
confirmBizObject.setAttributeValue("tspz", "00");
confirmBizObject.setAttributeValue("xhdwdzdh", xhdwdzdh);
confirmBizObject.setAttributeValue("xhdwyhzh", ownAccount.getAttribute("acc_number").toString());
confirmBizObject.setAttributeValue("xhdwyhzh", xhdwyhzh);
confirmBizObject.setAttributeValue("ghdwsbh", certid);
confirmBizObject.setAttributeValue("ghdwmc", customerName);
confirmBizObject.setAttributeValue("ghdwdzdh", address_tel);
@ -586,18 +579,11 @@ public class rentPlanInvoiceManager extends BaseTable {
if ("0".equals(returncode)) {
System.out.println("[OK][SUCCESS]");
for (BizObject confirmDetailBizObject : confirmDetailList) {
String invoiceId = confirmDetailBizObject
.getAttribute("invoice_id").toString();
// String invoice_type =
// confirmDetailBizObject.getAttribute("invoice_type").toString();
String invoiceId = confirmDetailBizObject.getAttribute("invoice_id").toString();
invoiceRentManager.createQuery("update o set INVOICE_STATUS=:invoicestatus where ID=:id ").setParameter("id",invoiceId)
.setParameter("invoicestatus","3").executeUpdate();
}
// return "开票申请成功";
} else {
return returnmsg;
}