From 816cfad21f2ba2c54eb72535e5c898b6e8928737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A3=8A?= <寮犵@LAPTOP-O3DO03BA> Date: Sat, 16 Jun 2018 10:49:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E6=89=8B=E8=BD=A6=E8=BD=A6=E5=9E=8B?= =?UTF-8?q?=E5=BA=93=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../quartzmession/QueryVehicleModeListAction.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/QueryVehicleModeListAction.java b/src_tenwa/com/tenwa/lease/app/quartzmession/QueryVehicleModeListAction.java index 18ab75f86..bc99a5ff1 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/QueryVehicleModeListAction.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/QueryVehicleModeListAction.java @@ -37,14 +37,14 @@ public class QueryVehicleModeListAction implements Job{ //接口url中的fromVersion参数 String fromVersion = null; //开关,作用是若判断为第一次调用接口,保存版本信息到Version表,而不是第一次调用时则将这个值变为true,则更新版本表 - boolean versionflag = false; + boolean versionflag = true; //查询二手车版本表,若为空则说明是第一次调用二手车车型库接口 BizObject versionResult = bm4.createQuery("select O.currentversion,O.initialversion from O").getSingleResult(false); if(versionResult == null){ + versionflag = false; fromVersion = InitSecondHandCarConfig.VERSION; }else{ fromVersion = versionResult.getAttribute("currentversion").toString(); - versionflag = true; } String url = "http://"+InitSecondHandCarConfig.PREFIX+".che300.com/service/common/eval?fromVersion=" +fromVersion+"&token="+InitSecondHandCarConfig.TOKEN+""; @@ -201,10 +201,11 @@ public class QueryVehicleModeListAction implements Job{ versionObject.setAttributeValue("currentversion",map.get("CurrentVersion").toString()); versionObject.setAttributeValue("initialversion",map.get("InitialVersion").toString()); bm4.saveObject(versionObject); - } - bm4.createQuery("update O set currentversion=:CURRENTVERSION,initialversion=:INITIALVERSION") - .setParameter("CURRENTVERSION",map.get("CurrentVersion").toString()) - .setParameter("INITIALVERSION",map.get("InitialVersion").toString()).executeUpdate(); + }else{ + bm4.createQuery("update O set currentversion=:CURRENTVERSION,initialversion=:INITIALVERSION") + .setParameter("CURRENTVERSION",map.get("CurrentVersion").toString()) + .setParameter("INITIALVERSION",map.get("InitialVersion").toString()).executeUpdate(); + } } catch (Exception e) { try { if(null != tx){