Merge branch 'develop' of http://git2.tenwa.com.cn/ApzlDev/apzl_leasing.git into zhuhuichen

This commit is contained in:
user 2018-06-07 10:11:42 +08:00
commit 25c9ae0ae0
6 changed files with 95 additions and 21 deletions

View File

@ -1,7 +1,8 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
String orgid=CurUser.getOrgID();
String userid=CurUser.getUserID();
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
<%
String orgid=CurUser.getOrgID();
String userid=CurUser.getUserID();
ASObjectModel doTemp = new ASObjectModel("LB_CAR_LICENSE_PLATE_LIST");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1";
@ -10,14 +11,35 @@ String userid=CurUser.getUserID();
dwTemp.genHTMLObjectWindow("");
String sButtons[][] = {
{"true","All","Button","新增","新增","newRecord()","","","",""},
/* {"true","All","Button","新增","新增","newRecord()","","","",""}, */
{"true","All","Button","修改","修改","edit()","","","",""},
{"true","All","Button","删除","删除","do_delete()","","","","btn_icon_delete"},
{"true","All","Button","牌照管理导入","牌照管理导入","importExcel()","","","","btn_icon_import"}
{"true","All","Button","导入Excel","导入Excel","importExcel()","","","","btn_icon_import"},
{"true","","Button","牌照模版下载","牌照模版下载","LicensePlateDownload()","","","","btn_icon_down",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<iframe name="MyAtt" src="<%=com.amarsoft.awe.util.Escape.getBlankJsp(sWebRootPath,"正在下载附件,请稍候...")%>" style="background-color: blue" width=100% height=100% frameborder=0 hspace=0 vspace=0 marginwidth=0 marginheight=0 scrolling="no">
</iframe>
<form name=form1 method=post action="<%=sWebRootPath%>/servlet/view/fileTemplateView?CompClientID=<%=sCompClientID%>" target=MyAtt>
<div style="display:none">
<input id="sqlString" name=sqlString value="">
</div>
</form>
<script type="text/javascript">
/*~[Describe=新增记录;InputParam=无;OutPutParam=无;]~*/
function LicensePlateDownload(){
var sId="4c559680c16242c497816604aedce292";
if (typeof(sId)=="undefined" || sId.length==0){
return;
}else{
$("#sqlString").val("save@"+sId);
form1.submit();
}
}
function newRecord(){
AsDialog.OpenSelector("SelectContractCarPhoto","","dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
@ -76,9 +98,11 @@ String userid=CurUser.getUserID();
function edit(){
var sUrl = "/Tenwa/ChannelPortal/BusinessHanding/CarPhoto/LBCarPhotoDocumentInfo.jsp";
// AsControl.OpenView(sUrl,'','_self','');
var id=getItemValue(0, getRow(0), "contract_id");
var car_id=getItemValue(0, getRow(0), "car_id");
var cparam="contract_id="+id+"&car_id="+car_id;
//var car_id=getItemValue(0, getRow(0), "car_id");
//var cparam="contract_id="+id+"&car_id="+car_id;
var cparam="contract_id="+id;
AsDialog.PopView(sUrl,cparam,"dialogWidth=800px;dialogHeight=480px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(){
reloadSelf();
},"修改车牌号");
@ -95,7 +119,7 @@ String userid=CurUser.getUserID();
{width:"350px",height:"40px",title:"上传牌照管理数据"},function(){reloadSelf();});
}
function exportExcel(){
<%-- function exportExcel(){
var param={};
var tempParam={};
var sparam="";
@ -123,7 +147,7 @@ String userid=CurUser.getUserID();
"FLOW_UNID="+tempParam["FLOW_UNID"]+"&OBJECTTYPE="+tempParam["OBJECTTYPE"]);
downloadFile(attributeID);
}else{
alert("导出失败!");
alert("导出失败!");sr
}
}
@ -131,6 +155,6 @@ String userid=CurUser.getUserID();
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
window.open(sWebRootPath+"/servlet/view/docDownloadServlet?CompClientID=<%=sCompClientID%>&sqlString=save@"+id, "downloadTemplate");
}
--%>
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -5,12 +5,15 @@
//获得组件参数
String sObjectType=CurPage.getParameter("ObjectType");//
String contract_id=CurPage.getParameter("contract_id");
String car_id=CurPage.getParameter("car_id");
//String contract_id=CurPage.getParameter("contract_id");
//String car_id=CurPage.getParameter("car_id");
ASObjectModel doTemp = new ASObjectModel("LB_CAR_LICENSE_PLATE_INFO");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="2"; // 设置DW风格 1:Grid 2:Freeform
dwTemp.ReadOnly = "0"; // 设置是否只读 1:只读 0:可写
dwTemp.genHTMLObjectWindow(car_id);
//dwTemp.genHTMLObjectWindow(car_id);
dwTemp.genHTMLObjectWindow(contract_id);
String[][] sButtons=null;
sButtons=new String[][]{
{"true","","Button","保存","保存所有修改","importRecord()","","","",""},
@ -18,7 +21,7 @@
%><%@include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
$(function() {
$("#FILE2").attr("type","file");debugger;
$("#FILE2").attr("type","file");
$("#FILE3").attr("type","file");
$("#myiframe0").attr("enctype","multipart/form-data");
var params={};
@ -47,12 +50,18 @@
}
}
function saveRecord(){
var car_id="<%=car_id%>";
<%-- var car_id="<%=car_id%>"; --%>
var contract_id="<%=contract_id%>";
var plate_number=getItemValue(0,getRow(0),"plate_number");
var platetime=getItemValue(0,getRow(0),"platetime");
var car_unit=getItemValue(0,getRow(0),"car_unit");
var car_location=getItemValue(0,getRow(0),"car_location");
var param="id="+car_id+",plate_number="+plate_number+",platetime="+platetime+",car_unit="+car_unit+",car_location="+car_location;
var frame_number=getItemValue(0,getRow(0),"frame_number");
var plate_status=getItemValue(0,getRow(0),"plate_status");
/* var car_unit=getItemValue(0,getRow(0),"car_unit"); */
/* var car_location=getItemValue(0,getRow(0),"car_location"); */
var param="id="+contract_id+",plate_number="+plate_number+",platetime="+platetime+",frame_number="+frame_number+",plate_status="+plate_status;
//var param="id="+contract_id+",plate_number="+plate_number+",platetime="+platetime+",car_unit="+car_unit+",car_location="+car_location;
RunJavaMethodTrans("com.tenwa.channelmanage.SaveCarPhoto", "SaveCarPhoto", param);
}
//提交

View File

@ -11,12 +11,33 @@
{"true","All","Button","新增","新增","newRecord()","","","",""},
{"true","All","Button","修改","修改","viewAndEdit()","","","","btn_icon_edit"},
{"true","","Button","删除","删除","do_delete()","","","","btn_icon_delete"},
{"true","","Button","GPSµ¼Èë","GPSµ¼Èë","importExcel()","","","","btn_icon_import"}
{"true","","Button","导入Excel","导入Excel","importExcel()","","","","btn_icon_import"},
{"true","","Button","GPS模版下载","GPS模版下载","GPSDownload()","","","","btn_icon_down",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<iframe name="MyAtt" src="<%=com.amarsoft.awe.util.Escape.getBlankJsp(sWebRootPath,"正在下载附件,请稍候...")%>" style="background-color: blue" width=100% height=100% frameborder=0 hspace=0 vspace=0 marginwidth=0 marginheight=0 scrolling="no">
</iframe>
<form name=form1 method=post action="<%=sWebRootPath%>/servlet/view/fileTemplateView?CompClientID=<%=sCompClientID%>" target=MyAtt>
<div style="display:none">
<input id="sqlString" name=sqlString value="">
</div>
</form>
<script type="text/javascript">
/*~[Describe=新增记录;InputParam=无;OutPutParam=无;]~*/
function GPSDownload(){
var sId="52b5c3fc03ec47709f6a972b9d5d5d7a";
if (typeof(sId)=="undefined" || sId.length==0){
return;
}else{
$("#sqlString").val("save@"+sId);
form1.submit();
}
}
function newRecord(){
var sUrl = "/Tenwa/Gps/GpsRegister/GpsRegister.jsp";
AsDialog.PopView(sUrl,"","resizable=yes;dialogWidth=700px;dialogHeight=330px;center:yes;status:no;statusbar:no",function(){

View File

@ -4,9 +4,11 @@ import java.util.List;
import java.util.Map;
import jbo.app.tenwa.calc.VI_LC_RENT_PLAN;
import jbo.com.tenwa.lease.comm.LB_CAR_LICENSE_PLATE_INFO;
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
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.awe.util.Transaction;
@ -14,17 +16,35 @@ import com.amarsoft.context.ASUser;
import com.tenwa.comm.exception.BusinessException;
public class LBCarLicenseCallback extends BaseImportExcelCallBack{
@Override
public void run(ASUser CurUser, BizObject importObject,
Map<String, String> model, Integer rowIndex, JBOTransaction tx,
Transaction Sqlca) throws Exception {
//获取Excel表中的合同编号(excel表中的字段为contract_id,实际输入的内容为合同编号)
String contractNumber = importObject.getAttribute("contract_id").getString();
//jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO
BizObject contractInfo=JBOFactory.createBizObjectQuery(jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO.CLASS_NAME,"contract_number=:contractNumber").setParameter("contractNumber", contractNumber).getSingleResult(false);
//根据合同编号获取该合同信息
BizObject contractInfo=JBOFactory.createBizObjectQuery(LB_CONTRACT_INFO.CLASS_NAME,"contract_number=:contractNumber").setParameter("contractNumber", contractNumber).getSingleResult(false);
if(contractInfo != null){
//获取该合同信息的合同id
String contractId = contractInfo.getAttribute("ID").toString();
importObject.setAttributeValue("contract_id", contractId);
//判断该车辆信息表中是否已经存在该合同如果不存在则可以新增
BizObject carLicenseInfo=JBOFactory.createBizObjectQuery(LB_CAR_LICENSE_PLATE_INFO.CLASS_NAME,"CONTRACT_ID=:contractId").setParameter("contractId", contractId).getSingleResult(false);
if(carLicenseInfo==null){
BizObjectManager carLicenseManager =JBOFactory.getBizObjectManager(LB_CAR_LICENSE_PLATE_INFO.CLASS_NAME);
BizObject carLicensePlate=carLicenseManager.newObject();
carLicensePlate.setAttributeValue("CONTRACT_ID", contractId);
carLicensePlate.setAttributeValue("PLATE_STATUS", importObject.getAttribute("plate_status").getString());
carLicensePlate.setAttributeValue("FRAME_NUMBER", importObject.getAttribute("frame_number").getString());
carLicensePlate.setAttributeValue("PLATE_NUMBER", importObject.getAttribute("plate_number").getString());
carLicensePlate.setAttributeValue("PLATETIME", importObject.getAttribute("platetime").getString());
carLicenseManager.saveObject(carLicensePlate);
}else{
throw new BusinessException("该合同编号已拥有车辆");
}
}else{
throw new BusinessException("²»´æÔڸúÏͬ±àºÅ");
}