GPS定位信息

This commit is contained in:
lixuebo 2019-08-23 16:00:23 +08:00
parent d40aad0412
commit def7e5db11
6 changed files with 31 additions and 37 deletions

View File

@ -111,11 +111,12 @@
function queryOrder(){
var orderNo = getItemValue(0,getRow(),"ORDER_NO");
var status = getItemValue(0,getRow(),"STATUS");
var vin = getItemValue(0,getRow(),"CAR_VIN");
if(status=='7'){
alert("请先提交工单!");
return;
}
var result =AsControl.RunJavaMethodTrans("com.tenwa.gps.GpsController","queryOrder","applyNo=<%=ProjectNo%>,projectId=<%=ProjectId%>,userId=<%=userId%>,flowUnid=<%=flowunid%>,tableName=LM_GPS_ORDER_TEMP,orderNo="+orderNo);
var result =AsControl.RunJavaMethodTrans("com.tenwa.gps.GpsController","queryOrder","applyNo=<%=ProjectNo%>,projectId=<%=ProjectId%>,userId=<%=userId%>,flowUnid=<%=flowunid%>,tableName=LM_GPS_ORDER_TEMP,orderNo="+orderNo+",vin="+vin);
alert(result)
location.reload();
}

View File

@ -17,31 +17,21 @@
String sButtons[][] = {
{"true","All","Button","查看定位信息","查看定位信息","queryOrder()","","","","",""},
{"true","","Button","查看安装图","查看安装图","showImage()","","","","",""},
{"true","","Button","提交流程","提交流程","test()","","","","",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<link rel="stylesheet" href="<%=sWebRootPath%>/js/viewpicture/css/viewer.min.css">
<script type="text/javascript">
function test(){
//var sParams="ApplyType=BusinessApplyApply,CurUserID=8006U00000001,ProductId=H01-C01-X-001-WYC,ProductName=北汽新能源网约车,CustomerType=03,carAttributes=new_car,leasehold=01,carSystem=2017款 奥迪TT(进口) TTS Roadster 2.0 TFSI quattro,custname=测试自动发起流程,certtype=Ind01,certid=110101199003075170,CustomerId=,productModel=奥迪,carSeries=奥迪TT(进口),versionid=V1.0,modelid=1128682,businessType=1,price=634800,liter=2.0T,geartype=自动,sourcetype=web,operationType=AMPLE";
var sParams="submitFlowunid=FBO2019070300000005,submitFlowNo=BusinessApplyFlow,submitUserId=8006U00000001,submitTask=0030";
AsControl.RunJavaMethodTrans("com.tenwa.flow.action.comm.BaseFlowStartAction","submitFlow",sParams);
}
function queryOrder(){
var orderNo = getItemValue(0,getRow(),"ORDER_NO");
if(undefined==orderNo){alert("请选择一行");return;}
var applyNo = getItemValue(0,getRow(),"APPLY_NO");
var projectId = getItemValue(0,getRow(),"PROJECT_ID");
var result =AsControl.RunJavaMethodTrans("com.tenwa.gps.GpsController","queryOrder","userId=<%=userId%>,flowUnid=流程外查询,applyNo="+applyNo+",orderNo="+orderNo+",tableName=LM_GPS_ORDER,projectId="+projectId);
if('查询成功!'==result){
AsDialog.PopView("/Tenwa/Gps/LmGpsLocationList.jsp","ProjectNo="+applyNo,"dialogWidth=1300px;dialogHeight=200px;center:yes;status:no;statusbar:no",function(sAreaCodeInfo){
},'GPS定位信息');
}else{
alert(result)
}
var vin = getItemValue(0,getRow(),"CAR_VIN");
var result =AsControl.RunJavaMethodTrans("com.tenwa.gps.GpsController","queryOrder","userId=<%=userId%>,flowUnid=流程外查询,applyNo="+applyNo+",orderNo="+orderNo+",tableName=LM_GPS_ORDER,projectId="+projectId+",vin="+vin);
AsDialog.PopView("/Tenwa/Gps/LmGpsLocationList.jsp","ProjectNo="+applyNo,"dialogWidth=1300px;dialogHeight=200px;center:yes;status:no;statusbar:no",function(sAreaCodeInfo){
},'GPS定位信息');
}
var viewer=null;

View File

@ -2312,12 +2312,17 @@
<attribute name="APPLY_NO" label="申请编号" type="STRING" length="32"/>
<attribute name="MODEL" label="设备类型" type="STRING" length="32"/>
<attribute name="RUN_STATUS" label="运行状态" type="STRING" length="32"/>
<attribute name="STATUS" label="设备状态" type="STRING" length="32"/>
<attribute name="IMEI" label="设备号" type="STRING" length="32"/>
<attribute name="STATUS" label="设备状态" type="STRING" length="32"/>
<attribute name="STATUS_USING" label="设备启用状态" type="STRING" length="32"/>
<attribute name="IMEI" label="设备号" type="STRING" length="32"/>
<attribute name="CAR_VIN" label="车架号" type="STRING" length="32"/>
<attribute name="RECEIVE_TIME" label="数据接收时间" type="STRING" length="32"/>
<attribute name="GPS_TIME" label="GPS时间" type="STRING" length="32"/>
<attribute name="LNG" label="经度" type="STRING" length="32"/>
<attribute name="LAT" label="纬度" type="STRING" length="32"/>
<attribute name="LAT" label="纬度" type="STRING" length="32"/>
<attribute name="SPD" label="速度(单位:千米/小时)" type="STRING" length="32"/>
<attribute name="DIR" label="方向0-360,0为正北向" type="STRING" length="32"/>
<attribute name="LOCATE_TYPE" label="定位类型" type="STRING" length="32"/>
<attribute name="INPUTTIME" label="录入时间" type="STRING" length="32"/>
</attributes>
<manager>

View File

@ -136,17 +136,14 @@ public class GpsCommon {
Sqlca.executeSQL("update "+tableName+" set RESULT='"+result+"',MESSAGE='查询失败,"+job.getString("message")+"' where APPLY_NO='"+applyNo+"'");
return job.getString("message");
}
String carVin = "";
String status = job.getJSONObject("data").getString("status");
if("3".equals(status)){
JSONArray terminals = job.getJSONObject("data").getJSONArray("terminal");
Sqlca.executeSQL("delete from lm_gps_location where APPLY_NO='"+applyNo+"'");
for(int i=0;i<terminals.size();i++){
for(int i=0;i<terminals.size();i++){
JSONObject terminal = terminals.getJSONObject(i);
//定位信息入表
Sqlca.executeSQL("insert into lm_gps_location value(replace(uuid(),\"-\",\"\"),'"+applyNo+"','"+terminal.getString("model")+"','"+terminal.getString("runStatus")+"','"+terminal.getString("status")+"','"+terminal.getString("imei")+"','"+terminal.getString("receiveTime")+"','"+terminal.getString("gpsTime")+"','"+terminal.getString("lng")+"','"+terminal.getString("lat")+"','"+thisDate+"')");
//»ñÈ¡³µ¼ÜºÅ
carVin = terminal.getString("carVin");
Sqlca.executeSQL("insert into lm_gps_location(ID,APPLY_NO,MODEL,RUN_STATUS,STATUS,IMEI,CAR_VIN,RECEIVE_TIME,GPS_TIME,LNG,LAT,INPUTTIME) value(replace(uuid(),\"-\",\"\"),'"+applyNo+"','"+terminal.getString("model")+"','"+terminal.getString("runStatus")+"','"+terminal.getString("status")+"','"+terminal.getString("imei")+"','"+terminal.getString("carVin")+"','"+terminal.getString("receiveTime")+"','"+terminal.getString("gpsTime")+"','"+terminal.getString("lng")+"','"+terminal.getString("lat")+"','"+thisDate+"')");
//安装图入表
int number = Integer.valueOf(Sqlca.getString("select COUNT(1) as number from LM_GPS_PHOTO lgp where lgp.APPLY_NO='"+applyNo+"'"));
if(number>0) continue;
@ -157,7 +154,7 @@ public class GpsCommon {
}
}
}
Sqlca.executeSQL("update "+tableName+" set RESULT='"+result+"',STATUS='"+status+"',MESSAGE='²éѯ³É¹¦',CAR_VIN='"+carVin+"' where APPLY_NO='"+applyNo+"'");
Sqlca.executeSQL("update "+tableName+" set RESULT='"+result+"',STATUS='"+status+"',MESSAGE='²éѯ³É¹¦' where APPLY_NO='"+applyNo+"'");
return "查询成功!";
}
@ -169,7 +166,7 @@ public class GpsCommon {
* @return
* @throws JBOException
*/
public static boolean tyQueryToVinDataPersistence(String data) throws Exception{
public static boolean tyQueryToVinDataPersistence(String data,Transaction Sqlca) throws Exception{
JSONObject job = JSONObject.fromObject(data);
String result = job.getString("result");
if(!"0".equals(result)){
@ -178,18 +175,19 @@ public class GpsCommon {
System.err.println("********************result****************");
return false;
}
boolean startUsing = true;
JSONArray dataArr = job.getJSONArray("data");
for(int i=0;i<dataArr.size();i++){
Sqlca.executeSQL("update lm_gps_location set SPD='"+dataArr.getJSONObject(i).getString("spd")+"',DIR='"+dataArr.getJSONObject(i).getString("dir")+"',LOCATE_TYPE='"+dataArr.getJSONObject(i).getString("locateType")+"',STATUS_USING='"+dataArr.getJSONObject(i).getString("status")+"' where IMEI='"+dataArr.getJSONObject(i).getString("imei")+"'");
if("0".equals(dataArr.getJSONObject(i).getString("status"))){
System.err.println("********************status****************");
System.err.println(dataArr.getJSONObject(i).getString("status"));
System.err.println("********************status****************");
return false;
startUsing = false;
}
}
return true;
return startUsing;
}

View File

@ -162,14 +162,17 @@ public class GpsController {
logMap.put("CALL_STATUS",resultMap.get("status"));
GpsCommon.callRecord(logMap, Sqlca);
return GpsCommon.tyQueryDataPersistence(data,applyNo,tableName,Sqlca);
String result1 = GpsCommon.tyQueryDataPersistence(data,applyNo,tableName,Sqlca);
String result2 = queryOrderToVin(Sqlca)==true?"查询成功!":"查询失败!";
return "申请编号查询定位信息:"+result1+",车架号查询定位信息:"+result2;
}
/**
* 天易--根据车架号查询工单
* @throws Exception
*/
public boolean queryOrderToVin() throws Exception{
public boolean queryOrderToVin(Transaction Sqlca) throws Exception{
String url = GPSConfigure.get("TYQueryOrderToVin");
System.err.println("***************天易--根据车架号查询工单URL*****************");
@ -187,8 +190,6 @@ public class GpsController {
System.err.println(data);
System.err.println("***************天易--根据车架号查询工单返回参数*****************");
JBOTransaction tx = JBOFactory.createJBOTransaction();
Transaction Sqlca = Transaction.createTransaction(tx);
//日志参数
Map<String,String> logMap = new HashMap<String,String>();
logMap.put("URL",url);
@ -200,8 +201,7 @@ public class GpsController {
logMap.put("CALL_PURPOSE","天易--根据车架号查询工单");
logMap.put("CALL_STATUS",resultMap.get("status"));
GpsCommon.callRecord(logMap, Sqlca);
Sqlca.disConnect();
return GpsCommon.tyQueryToVinDataPersistence(data);
return GpsCommon.tyQueryToVinDataPersistence(data,Sqlca);
}

View File

@ -23,7 +23,7 @@ public class GpsStatusCheck extends DefaultBussinessCheck {
res.close();
gpsController.setFlowUnid(flowunid);
gpsController.setUserId("风险预计调用");
boolean a = gpsController.queryOrderToVin();
boolean a = gpsController.queryOrderToVin(Sqlca);
System.err.println("********************风险预计返回值****************");
System.err.println(a);
System.err.println("********************风险预计返回值****************");