直租发票打印
This commit is contained in:
parent
3b5d1bf589
commit
ba74cb8ca6
@ -0,0 +1,82 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
|
||||
/*
|
||||
Author: undefined 2018-09-18
|
||||
Content:
|
||||
History Log:
|
||||
*/
|
||||
ASObjectModel doTemp = new ASObjectModel("InvoiceRentIncomeConfirm");
|
||||
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","退回","退回","gobackInvoice()","","","","btn_icon_return",""},
|
||||
{"true","","Button","确认提交","确认提交","submitInvoice()","","","","btn_icon_submit",""},
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
<script type="text/javascript">
|
||||
function submitInvoice(){
|
||||
|
||||
var sParm = getItemValueArray(0,"id");
|
||||
if(typeof(sParm) == "undefined" || sParm.length == 0 )
|
||||
{
|
||||
alert("请选择开票数据!");
|
||||
return;
|
||||
}
|
||||
var ids = "";
|
||||
for(var i = 0;i < sParm.length; i++){
|
||||
ids += sParm[i] +"@";
|
||||
}
|
||||
|
||||
ids = ids.substr(0,ids.length-1);
|
||||
|
||||
spara = "ids="+ids+",CurUserID=<%=CurUser.getUserID()%>";
|
||||
var returnValue = AsControl.RunJavaMethodTrans("com.tenwa.apzl.invoicemanager.rentplaninvoice.rentPlanInvoiceDirectManager","invoiceConfirmSubmit",spara);
|
||||
alert(returnValue);
|
||||
reloadSelf();
|
||||
}
|
||||
function gobackInvoice(){
|
||||
|
||||
var sParm = getItemValueArray(0,"id");
|
||||
if(typeof(sParm) == "undefined" || sParm.length == 0 )
|
||||
{
|
||||
alert("请选择开票数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
var ids = "";
|
||||
for(var i = 0;i < sParm.length; i++){
|
||||
if(ids.length == 0){
|
||||
ids += sParm[i] +"@";
|
||||
}else{
|
||||
ids += sParm[i] +"@";
|
||||
}
|
||||
}
|
||||
spara = "ids="+ids+",CurUserID=<%=CurUser.getUserID()%>";
|
||||
var returnValue = AsControl.RunJavaMethodTrans("com.tenwa.apzl.invoicemanager.rentplaninvoice.rentPlanInvoiceManager","backInvoice",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"%>
|
||||
@ -0,0 +1,90 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
|
||||
/*
|
||||
Author: undefined 2018-09-18
|
||||
Content:
|
||||
History Log:
|
||||
*/
|
||||
ASObjectModel doTemp = new ASObjectModel("InvoiceRentDirectConfirmList");
|
||||
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","查询","查询","selectInvoice()","","","","",""},
|
||||
{"true","","Button","打印发票","打印发票","printInvoice()","","","","",""},
|
||||
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""},
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
<script type="text/javascript">
|
||||
function selectInvoice(){
|
||||
var sid = getItemValueArray(0,"sid");
|
||||
if(typeof(sid) == "undefined" || sid.length == 0 )
|
||||
{
|
||||
alert("请选择查询数据!");
|
||||
return;
|
||||
}
|
||||
//alert(sid);
|
||||
|
||||
var sids = "";
|
||||
for(var i = 0;i < sid.length; i++){
|
||||
|
||||
sids += sid[i] +"@";
|
||||
|
||||
}
|
||||
|
||||
sids = sids.substr(0,sids.length-1);
|
||||
//alert(sids);
|
||||
spara = "sid="+sids+",CurUserID=<%=CurUser.getUserID()%>";
|
||||
|
||||
var returnValue = AsControl.RunJavaMethodTrans("com.tenwa.apzl.invoicemanager.rentplaninvoice.rentPlanInvoiceDirectManager","selectConfirm",spara);
|
||||
|
||||
alert(returnValue);
|
||||
reloadSelf();
|
||||
}
|
||||
function printInvoice(){
|
||||
var sid = getItemValueArray(0,"sid");
|
||||
if(typeof(sid) == "undefined" || sid.length == 0 )
|
||||
{
|
||||
alert("请选择查询数据!");
|
||||
return;
|
||||
}
|
||||
//alert(sid);
|
||||
|
||||
var sids = "";
|
||||
for(var i = 0;i < sid.length; i++){
|
||||
|
||||
sids += sid[i] +"@";
|
||||
|
||||
}
|
||||
|
||||
sids = sids.substr(0,sids.length-1);
|
||||
//alert(sids);
|
||||
spara = "sid="+sids+",CurUserID=<%=CurUser.getUserID()%>";
|
||||
|
||||
var returnValue = AsControl.RunJavaMethodTrans("com.tenwa.apzl.invoicemanager.rentplaninvoice.rentPlanInvoiceDirectManager","printInvoice",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"%>
|
||||
@ -3729,5 +3729,30 @@
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="VI_INVOICE_RENT_INCOME_CONFIRM" label="" keyAttributes="id">
|
||||
<attributes>
|
||||
<attribute name="id" label="标识" type="STRING"/>
|
||||
<attribute name="contract_id" label="合同id" type="STRING"/>
|
||||
<attribute name="CONTRACT_NO" label="合同编号" type="STRING"/>
|
||||
<attribute name="PAYMENT_NUMBER" label="投放编号" type="STRING"/>
|
||||
<attribute name="CUSTOMER_ID" label="客户id" type="STRING"/>
|
||||
<attribute name="customer_name" label="客户姓名" type="STRING"/>
|
||||
<attribute name="plan_list" label="期次" type="STRING"/>
|
||||
<attribute name="plan_date" label="核销日期" type="STRING"/>
|
||||
<attribute name="plan_money" label="计划金额" type="STRING"/>
|
||||
<attribute name="invoice_money" label="开票金额" type="STRING"/>
|
||||
<attribute name="TAX_TYPE" label="金额类型" type="STRING"/>
|
||||
<attribute name="TAX_REG_CODE" label="纳税人识别号" type="STRING"/>
|
||||
<attribute name="TAX_BANK" label="开户行" type="STRING"/>
|
||||
<attribute name="TAX_ACC" label="开户账号" type="STRING"/>
|
||||
<attribute name="invoice_status" label="状态" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="vi_invoice_rent_income_confirm" />
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
</package>
|
||||
</jbo>
|
||||
|
||||
@ -34,6 +34,8 @@ public class InvoiceRequestBody {
|
||||
|
||||
@XmlElement
|
||||
private InvoiceRequestInput input ;
|
||||
@XmlElement
|
||||
private InvoiceRequestOutput output ;
|
||||
|
||||
public String getYylxdm() {
|
||||
return yylxdm;
|
||||
@ -51,7 +53,15 @@ public class InvoiceRequestBody {
|
||||
this.input = input;
|
||||
}
|
||||
|
||||
public String getReturncode() {
|
||||
public InvoiceRequestOutput getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
public void setOutput(InvoiceRequestOutput output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
public String getReturncode() {
|
||||
return returncode;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
package com.tenwa.app.invoice.request;
|
||||
|
||||
|
||||
import javax.xml.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlRootElement(name = "dyfpfs")
|
||||
public class InvoiceRequestDyfpfs {
|
||||
@XmlAttribute
|
||||
private String count ;
|
||||
|
||||
@XmlElement(name="group")
|
||||
private List<InvoiceRequestGroup> groupList ;
|
||||
|
||||
public String getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(String count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public List<InvoiceRequestGroup> getGroupList() {
|
||||
return groupList;
|
||||
}
|
||||
|
||||
public void setGroupList(List<InvoiceRequestGroup> groupList) {
|
||||
this.groupList = groupList;
|
||||
}
|
||||
}
|
||||
@ -41,7 +41,11 @@ public class InvoiceRequestGroup {
|
||||
private String slbs;
|
||||
@XmlElement
|
||||
private String zzstsgl;
|
||||
|
||||
//发票打印返回报文
|
||||
@XmlElement
|
||||
private String fpdm;
|
||||
@XmlElement
|
||||
private String fphm;
|
||||
|
||||
public String getXh() {
|
||||
return xh;
|
||||
@ -178,4 +182,21 @@ public class InvoiceRequestGroup {
|
||||
public void setZzstsgl(String zzstsgl) {
|
||||
this.zzstsgl = zzstsgl;
|
||||
}
|
||||
|
||||
public String getFpdm() {
|
||||
return fpdm;
|
||||
}
|
||||
|
||||
public void setFpdm(String fpdm) {
|
||||
this.fpdm = fpdm;
|
||||
}
|
||||
|
||||
public String getFphm() {
|
||||
return fphm;
|
||||
}
|
||||
|
||||
public void setFphm(String fphm) {
|
||||
this.fphm = fphm;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -73,6 +73,19 @@ public class InvoiceRequestInput {
|
||||
private String GMF_OPENID ;
|
||||
|
||||
|
||||
//·¢Æ±´òÓ¡ÊäÈë²ÎÊý
|
||||
@XmlElement
|
||||
private String fpdm ;
|
||||
@XmlElement
|
||||
private String fphm ;
|
||||
@XmlElement
|
||||
private String dylx ;
|
||||
@XmlElement
|
||||
private String dyfs ;
|
||||
@XmlElement
|
||||
private String dyjmc ;
|
||||
|
||||
|
||||
public String getFplxdm() {
|
||||
return fplxdm;
|
||||
}
|
||||
@ -304,4 +317,45 @@ public class InvoiceRequestInput {
|
||||
public void setGMF_OPENID(String GMF_OPENID) {
|
||||
this.GMF_OPENID = GMF_OPENID;
|
||||
}
|
||||
|
||||
public String getFpdm() {
|
||||
return fpdm;
|
||||
}
|
||||
|
||||
public void setFpdm(String fpdm) {
|
||||
this.fpdm = fpdm;
|
||||
}
|
||||
|
||||
public String getFphm() {
|
||||
return fphm;
|
||||
}
|
||||
|
||||
public void setFphm(String fphm) {
|
||||
this.fphm = fphm;
|
||||
}
|
||||
|
||||
public String getDylx() {
|
||||
return dylx;
|
||||
}
|
||||
|
||||
public void setDylx(String dylx) {
|
||||
this.dylx = dylx;
|
||||
}
|
||||
|
||||
public String getDyfs() {
|
||||
return dyfs;
|
||||
}
|
||||
|
||||
public void setDyfs(String dyfs) {
|
||||
this.dyfs = dyfs;
|
||||
}
|
||||
|
||||
public String getDyjmc() {
|
||||
return dyjmc;
|
||||
}
|
||||
|
||||
public void setDyjmc(String dyjmc) {
|
||||
this.dyjmc = dyjmc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,59 @@
|
||||
package com.tenwa.app.invoice.request;
|
||||
|
||||
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlRootElement(name = "output")
|
||||
public class InvoiceRequestOutput {
|
||||
@XmlAttribute
|
||||
private String yylxdm ;
|
||||
|
||||
@XmlElement
|
||||
private String returncode ;
|
||||
@XmlElement
|
||||
private String returnmsg ;
|
||||
|
||||
@XmlElement
|
||||
private InvoiceRequestDyfpfs dyfpfs ;
|
||||
|
||||
public String getYylxdm() {
|
||||
return yylxdm;
|
||||
}
|
||||
|
||||
public void setYylxdm(String yylxdm) {
|
||||
this.yylxdm = yylxdm;
|
||||
}
|
||||
|
||||
public String getReturncode() {
|
||||
return returncode;
|
||||
}
|
||||
|
||||
public void setReturncode(String returncode) {
|
||||
this.returncode = returncode;
|
||||
}
|
||||
|
||||
public String getReturnmsg() {
|
||||
return returnmsg;
|
||||
}
|
||||
|
||||
public void setReturnmsg(String returnmsg) {
|
||||
this.returnmsg = returnmsg;
|
||||
}
|
||||
|
||||
public InvoiceRequestDyfpfs getDyfpfs() {
|
||||
return dyfpfs;
|
||||
}
|
||||
|
||||
public void setDyfpfs(InvoiceRequestDyfpfs dyfpfs) {
|
||||
this.dyfpfs = dyfpfs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -8,6 +8,9 @@ import java.io.OutputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
@ -15,12 +18,17 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import jbo.app.tenwa.calc.LI_INVOICE_RESULT;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOException;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.util.DataConvert;
|
||||
import com.amarsoft.awe.Configure;
|
||||
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
import com.tenwa.util.SecurityUtil;
|
||||
|
||||
public class InvoiceDownloadServlet extends HttpServlet {
|
||||
@ -33,15 +41,31 @@ public class InvoiceDownloadServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void service(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
String customerName = "";
|
||||
String sid = "";
|
||||
String contract_no = "";
|
||||
String slocalFile = request.getParameter("path");
|
||||
JBOTransaction tx= null;
|
||||
try {
|
||||
BizObject invoiceResult = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LI_INVOICE_RESULT", "localFile=:localFile").setParameter("localFile", request.getParameter("path")).getSingleResult(false);
|
||||
sid = invoiceResult.getAttribute("sid").toString();
|
||||
BizObject invoiceConfirm = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LI_INVOICE_CONFIRM", "sid=:sid").setParameter("sid",sid).getSingleResult(false);
|
||||
if(invoiceConfirm !=null){
|
||||
customerName = invoiceConfirm.getAttribute("ghdwmc").toString();
|
||||
}
|
||||
tx = JBOFactory.createJBOTransaction();
|
||||
|
||||
String sql = "SELECT DISTINCT lci.contract_no FROM LI_INVOICE_RESULT lir LEFT JOIN li_invoice_confirm lic ON lic.sid = lir.sid LEFT JOIN li_invoice_confirm_detail licd ON licd.invoice_confirm_id = lic.id LEFT JOIN li_rent_invoice_info lrii ON lrii.id=licd.invoice_id LEFT JOIN lb_contract_info lci ON lci.id=lrii.contract_id WHERE lir.localFile=:localFile";
|
||||
Map conditon = new HashMap<String,String>();
|
||||
conditon.put("localFile", slocalFile);
|
||||
List<Map<String, String>> data;
|
||||
try {
|
||||
data = DataOperatorUtil.getDataBySql(tx, sql, conditon);
|
||||
if(data !=null){
|
||||
contract_no = data.get(0).get("contract_no");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
conditon.clear();
|
||||
tx.commit();
|
||||
/*if(invoiceResult !=null){
|
||||
contract_no = invoiceResult.getAttribute("contract_no").toString();
|
||||
}*/
|
||||
} catch (JBOException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
@ -64,9 +88,8 @@ public class InvoiceDownloadServlet extends HttpServlet {
|
||||
if (!file.exists())
|
||||
throw new Exception("Îļþ²»´æÔÚ");
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("YYYYMMddHHmmss");
|
||||
//String filename = dateFormat.format(new Date()) + ".pdf";
|
||||
String filename = customerName + ".pdf";
|
||||
//response.setContentType("text/html;charset=UTF-8");
|
||||
String filename = contract_no+dateFormat.format(new Date()) + ".pdf";
|
||||
//String filename = contract_no + ".pdf";
|
||||
response.setContentType(getServletContext().getMimeType(filename));
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + new String( filename.getBytes("gb2312"), "ISO8859-1" ) );
|
||||
InputStream in = new FileInputStream(localFile);
|
||||
|
||||
@ -10,7 +10,9 @@ import java.net.URLDecoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
@ -22,10 +24,12 @@ import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.JBOException;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.util.DataConvert;
|
||||
import com.amarsoft.awe.Configure;
|
||||
import com.tenwa.app.invoice.utils.FileCopy;
|
||||
import com.tenwa.app.invoice.utils.FilesToZipUtils;
|
||||
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
import com.tenwa.util.SecurityUtil;
|
||||
|
||||
public class InvoiceLotDownloadServlet extends HttpServlet {
|
||||
@ -38,19 +42,21 @@ public class InvoiceLotDownloadServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void service(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
JBOTransaction tx= null;
|
||||
String files = request.getParameter("files");
|
||||
String[] arr = files.split("@");
|
||||
String str = "";
|
||||
String sid ="";
|
||||
String customerName = "";
|
||||
//String sid ="";
|
||||
//String customerName = "";
|
||||
String contract_no = "";
|
||||
String zipLocalPath = "";
|
||||
List<File> filess = new ArrayList<>();
|
||||
for (int i = 0; i < arr.length; i++) {
|
||||
|
||||
str = arr[i];
|
||||
try {
|
||||
BizObject invoiceResult = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LI_INVOICE_RESULT", "localFile=:localFile").setParameter("localFile", str).getSingleResult(false);
|
||||
tx = JBOFactory.createJBOTransaction();
|
||||
/*BizObject invoiceResult = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LI_INVOICE_RESULT", "localFile=:localFile").setParameter("localFile", str).getSingleResult(false);
|
||||
if(invoiceResult !=null){
|
||||
|
||||
sid = invoiceResult.getAttribute("sid").toString();
|
||||
@ -59,9 +65,23 @@ public class InvoiceLotDownloadServlet extends HttpServlet {
|
||||
if(invoiceConfirm !=null){
|
||||
|
||||
customerName = invoiceConfirm.getAttribute("ghdwmc").toString();
|
||||
*/
|
||||
String sql = "SELECT DISTINCT lci.contract_no FROM LI_INVOICE_RESULT lir LEFT JOIN li_invoice_confirm lic ON lic.sid = lir.sid LEFT JOIN li_invoice_confirm_detail licd ON licd.invoice_confirm_id = lic.id LEFT JOIN li_rent_invoice_info lrii ON lrii.id=licd.invoice_id LEFT JOIN lb_contract_info lci ON lci.id=lrii.contract_id WHERE lir.localFile=:localFile";
|
||||
Map conditon = new HashMap<String,String>();
|
||||
conditon.put("localFile", str);
|
||||
List<Map<String, String>> data;
|
||||
try {
|
||||
data = DataOperatorUtil.getDataBySql(tx, sql, conditon);
|
||||
if(data !=null){
|
||||
contract_no = data.get(0).get("contract_no");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
conditon.clear();
|
||||
tx.commit();
|
||||
|
||||
} catch (JBOException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
try {
|
||||
@ -85,10 +105,18 @@ public class InvoiceLotDownloadServlet extends HttpServlet {
|
||||
throw new Exception("Îļþ²»´æÔÚ");
|
||||
//¸´ÖÆÎļþ
|
||||
File from = new File(localFile);
|
||||
String pdfname = customerName + ".pdf";
|
||||
String pdfname = "";
|
||||
pdfname = contract_no + ".pdf";
|
||||
//String name ="E:/liuzhaoPDF/"+pdfname;
|
||||
String name =copyLocalPath+pdfname;
|
||||
String name="";
|
||||
name =copyLocalPath+"/"+pdfname;
|
||||
File to = new File(name);
|
||||
if(filess.contains(to)){
|
||||
contract_no +="-1";
|
||||
pdfname = contract_no + ".pdf";
|
||||
name =copyLocalPath+"/"+pdfname;
|
||||
to = new File(name);
|
||||
}
|
||||
FileCopy.copyFile(from, to);
|
||||
//filess.add(new File(localFile));
|
||||
filess.add(to);
|
||||
@ -100,7 +128,7 @@ public class InvoiceLotDownloadServlet extends HttpServlet {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("YYYYMMddHHmmss");
|
||||
String filename = dateFormat.format(new Date()) + ".zip";
|
||||
//String zipFilename ="E:/liuzhaoCopyPDF/"+filename;
|
||||
String zipFilename =zipLocalPath+filename;
|
||||
String zipFilename =zipLocalPath+"/"+filename;
|
||||
|
||||
try {
|
||||
FilesToZipUtils.toZipFiles(filess, zipFilename);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,7 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.beetl.ext.fn.ParseDouble;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
@ -44,6 +45,9 @@ import com.amarsoft.are.jbo.JBOException;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.Configure;
|
||||
import com.amarsoft.awe.util.ASResultSet;
|
||||
import com.amarsoft.awe.util.SqlObject;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.tenwa.app.invoice.action.InvoiceRequest;
|
||||
import com.tenwa.app.invoice.data.ResponseEnum;
|
||||
import com.tenwa.app.invoice.pojo.ResultPojo;
|
||||
@ -116,7 +120,7 @@ public class rentPlanInvoiceManager extends BaseTable {
|
||||
tx.join(viInvoiceRentManager);
|
||||
String[] planIds = this.getPlanIds().split("@");
|
||||
String invoice_status = "1";
|
||||
String bill_type = "invoice";
|
||||
String bill_type = "electronic";
|
||||
String invoice_money = "";
|
||||
String tax_type = "";
|
||||
String plan_id = "";
|
||||
@ -125,6 +129,7 @@ public class rentPlanInvoiceManager extends BaseTable {
|
||||
String TAX_BANK = "";
|
||||
String TAX_ACC = "";
|
||||
String contract_id = "";
|
||||
String invoice_object= "back_rent";
|
||||
|
||||
for (int i = 0; i < planIds.length; i++) {
|
||||
String planId = planIds[i];
|
||||
@ -161,19 +166,15 @@ public class rentPlanInvoiceManager extends BaseTable {
|
||||
.setParameter("tax_type", tax_type)
|
||||
.getSingleResult(false);
|
||||
if (lriiObject != null) {
|
||||
lriiManager
|
||||
.createQuery(
|
||||
"update o set invoice_status='1' where plan_id=:plan_id")
|
||||
.setParameter("plan_id", planId).executeUpdate();
|
||||
lriiManager.createQuery("update o set invoice_status='1' where plan_id=:plan_id and tax_type=:tax_type").setParameter("plan_id", planId).setParameter("tax_type", tax_type).executeUpdate();
|
||||
} else {
|
||||
|
||||
BizObject rentInvoiceInfo = lriiManager.newObject();
|
||||
rentInvoiceInfo.setAttributeValue("id", id);
|
||||
rentInvoiceInfo.setAttributeValue("invoice_status",
|
||||
invoice_status);
|
||||
rentInvoiceInfo.setAttributeValue("invoice_status",invoice_status);
|
||||
rentInvoiceInfo.setAttributeValue("bill_type", bill_type);
|
||||
rentInvoiceInfo.setAttributeValue("invoice_money",
|
||||
invoice_money);
|
||||
rentInvoiceInfo.setAttributeValue("invoice_money",invoice_money);
|
||||
rentInvoiceInfo.setAttributeValue("invoice_object",invoice_object);
|
||||
|
||||
/*
|
||||
* if("利息".equals(tax_type)){
|
||||
@ -327,7 +328,7 @@ public class rentPlanInvoiceManager extends BaseTable {
|
||||
* @throws Exception
|
||||
*/
|
||||
public String invoiceConfirmSubmit(JBOTransaction tx) throws Exception {
|
||||
|
||||
Transaction Sqlca = null;
|
||||
BizObjectManager ownAccountManager = JBOFactory
|
||||
.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
|
||||
BizObject ownAccount = ownAccountManager
|
||||
@ -373,10 +374,8 @@ public class rentPlanInvoiceManager extends BaseTable {
|
||||
customerid = bizObject.getAttribute("CUSTOMER_ID").toString();
|
||||
customerName = bizObject.getAttribute("customer_name").toString();
|
||||
|
||||
List<BizObject> boList = invoiceManager
|
||||
.createQuery("contract_id=:contract_id")
|
||||
.setParameter("contract_id", contract_id)
|
||||
.getResultList(false);
|
||||
List<BizObject> boList = invoiceManager.createQuery("contract_id=:contract_id and id IN ("+rentPlanstr+")")
|
||||
.setParameter("contract_id", contract_id).getResultList(false);
|
||||
List<String> list = new ArrayList<String>();
|
||||
for (BizObject bizObject2 : boList) {
|
||||
String id = bizObject2.getAttribute("id").toString();
|
||||
@ -399,7 +398,10 @@ public class rentPlanInvoiceManager extends BaseTable {
|
||||
|
||||
BizObjectManager invoiceRentManager = JBOFactory
|
||||
.getBizObjectManager(LI_RENT_INVOICE_INFO.CLASS_NAME);
|
||||
Double sl = 0.06;
|
||||
//˰ÂÊ
|
||||
Double sl = 0.00;
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
String invoiceId = ids[i];// li_rent_invoice_info的id
|
||||
@ -416,6 +418,8 @@ public class rentPlanInvoiceManager extends BaseTable {
|
||||
String TAX_TYPE = "";
|
||||
String spbm = "";
|
||||
String spmc = "";
|
||||
String taxType = "";
|
||||
|
||||
|
||||
BizObject invoiceRentBizObject = invoiceRentManager
|
||||
.createQuery("ID=:id ").setParameter("id", invoiceId)
|
||||
@ -440,23 +444,31 @@ public class rentPlanInvoiceManager extends BaseTable {
|
||||
if ("overinterest".equals(TAX_TYPE)) {
|
||||
planList += " " + "逾期利息";
|
||||
}
|
||||
taxType = "×âÏ¢";
|
||||
spmc = "租赁利息";
|
||||
} else {
|
||||
if ("myhj".equals(TAX_TYPE)) {
|
||||
// planList = "名义货价";
|
||||
spmc = "名义货价";
|
||||
taxType = "Áô¹º¼Û";
|
||||
} else if ("sxf".equals(TAX_TYPE)) {
|
||||
// planList = "手续费";
|
||||
spmc = "手续费";
|
||||
taxType = "ÊÖÐø·Ñ";
|
||||
} else if ("gps".equals(TAX_TYPE)) {
|
||||
// planList = "GPS安装服务费";
|
||||
spmc = "GPS安装服务费";
|
||||
taxType = "GPS";
|
||||
} else {
|
||||
return "金额类型不存在!";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
String sql = "SELECT getTaxs('02','"+taxType+"',O.inputtime) AS tax FROM lb_contract_info O WHERE O.id=:contract_id";
|
||||
Map conditon = new HashMap<String,String>();
|
||||
conditon.put("contract_id", contract_id);
|
||||
List<Map<String,String>> data = DataOperatorUtil.getDataBySql(tx, sql, conditon);
|
||||
sl = Double.parseDouble(data.get(0).get("tax"));
|
||||
conditon.clear();
|
||||
|
||||
Double se = Double.valueOf(df2.format(invoiceMoney * sl));
|
||||
|
||||
confirmDetailBizObject.setAttributeValue("dj", "");
|
||||
@ -466,7 +478,7 @@ public class rentPlanInvoiceManager extends BaseTable {
|
||||
hjse = MathUtil.add(hjse, se);
|
||||
|
||||
confirmDetailBizObject.setAttributeValue("invoice_type",
|
||||
"interest");
|
||||
TAX_TYPE);
|
||||
confirmDetailBizObject.setAttributeValue("invoice_id",
|
||||
invoiceId);
|
||||
confirmDetailBizObject.setAttributeValue("spsl", "");
|
||||
|
||||
72
src_tenwa/quartz/ContractInfoForOverdue.java
Normal file
72
src_tenwa/quartz/ContractInfoForOverdue.java
Normal file
@ -0,0 +1,72 @@
|
||||
package quartz;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jbo.app.tenwa.calc.VI_CONTRACT_OVERDUE;
|
||||
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.util.StringFunction;
|
||||
import com.base.util.QuartzUtil;
|
||||
//import com.tenwa.action.channelportal.ContractSignAction;
|
||||
//import com.tenwa.action.channelportal.comm.ContractTransferRightForEnd;
|
||||
import com.tenwa.comm.util.jboutil.SaveBusinessStatus;
|
||||
import com.tenwa.lease.app.quartzmession.JobInitUserName;
|
||||
//import com.tenwa.quartz.BeforeSerialTimingTask;
|
||||
//import com.tenwa.quartz.service.BeforeSerialTimingTaskService;
|
||||
//import com.tenwa.quartz.serviceImpl.BeforeSerialTimingTaskServiceImpl;
|
||||
|
||||
|
||||
public class ContractInfoForOverdue implements Job{
|
||||
private JobInitUserName jboName;
|
||||
@Override
|
||||
public void execute(JobExecutionContext arg0) throws JobExecutionException {
|
||||
String startime = StringFunction.getTodayNow();
|
||||
|
||||
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
|
||||
String curUserId = userId == null? "system" : userId.toString();
|
||||
|
||||
try {
|
||||
JBOTransaction tx = JBOFactory.createJBOTransaction();
|
||||
ownershipTransferSign(tx,arg0);
|
||||
tx.commit();
|
||||
QuartzUtil.insertLog(startime, "quartz.ContractInfoForOverdue", "success", "成功", curUserId);
|
||||
} catch (Exception e) {
|
||||
QuartzUtil.insertLog(startime, "quartz.ContractInfoForOverdue", "error", "失败", curUserId);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void ownershipTransferSign(JBOTransaction tx ,JobExecutionContext arg0) throws Exception{
|
||||
String conInfo1 = getContractId(tx);
|
||||
if(!(conInfo1 == null || conInfo1.length() <= 0)){
|
||||
String[] conInfos = conInfo1.split("@");
|
||||
for(String conInfo:conInfos){
|
||||
String contractId = conInfo;
|
||||
//BizObjectManager bm = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME, tx);
|
||||
//bm.createQuery("update O set contract_status = '105' where id = '"+contractId+"'").executeUpdate();
|
||||
SaveBusinessStatus.saveByContractId(contractId, tx, "46", jboName.getUserId(arg0, tx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//获取逾期的合同
|
||||
public String getContractId(JBOTransaction tx ) throws Exception{
|
||||
BizObjectManager bom=JBOFactory.getBizObjectManager(VI_CONTRACT_OVERDUE.CLASS_NAME);
|
||||
List<BizObject> boList = bom.createQuery("contract_status <> '105'").getResultList(true);
|
||||
String conInfos = new String();
|
||||
for(BizObject bo : boList){
|
||||
conInfos += bo.getAttribute("contract_id")+"@";
|
||||
//conInfos += bo.getAttribute("income_number")+",";
|
||||
// conInfos += bo.getAttribute("BUSINESS_STATUS")+",";
|
||||
}
|
||||
return conInfos;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user