From 87639316e2a7eda855d0a726e004db545feb8c77 Mon Sep 17 00:00:00 2001 From: zhanglei Date: Sat, 14 Jul 2018 11:45:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E6=89=8B=E8=BD=A6=E8=AF=84=E4=BC=B0?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LBEquipmentCarTempInfo.jsp | 27 ++-- .../vehicleAssessmentController.java | 122 +++++++++++------- 2 files changed, 94 insertions(+), 55 deletions(-) diff --git a/WebContent/Tenwa/Lease/App/Interface/VehicleEvaluation/LBEquipmentCarTempInfo.jsp b/WebContent/Tenwa/Lease/App/Interface/VehicleEvaluation/LBEquipmentCarTempInfo.jsp index 0e224f109..af92a208e 100644 --- a/WebContent/Tenwa/Lease/App/Interface/VehicleEvaluation/LBEquipmentCarTempInfo.jsp +++ b/WebContent/Tenwa/Lease/App/Interface/VehicleEvaluation/LBEquipmentCarTempInfo.jsp @@ -5,26 +5,35 @@ Content: 示例详情页面 History Log: */ + String sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号 String sPrevUrl = CurPage.getParameter("PrevUrl"); if(sPrevUrl == null) sPrevUrl = "/Tenwa/Lease/App/Interface/VehicleEvaluation/LBEquipmentCarTempList.jsp"; - String sTempletNo = "LBEquipmentCarTempInfo";//--模板号-- ASObjectModel doTemp = new ASObjectModel(sTempletNo); - doTemp.setColTips("", "测试"); + doTemp.setColTips("", "万元"); ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); dwTemp.Style = "2";//freeform //dwTemp.ReadOnly = "-2";//只读模式 - dwTemp.genHTMLObjectWindow(CurPage.getParameter("ID")); + dwTemp.genHTMLObjectWindow(sFlowUnid); String sButtons[][] = { - {"true","All","Button","保存","保存所有修改","as_save(0)","","","",""}, - {String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","返回","返回列表","returnList()","","","",""} + /* {"true","All","Button","保存","保存所有修改","as_save(0)","","","",""}, + {String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","返回","返回列表","returnList()","","","",""} */ + {"true","","Button","评估校验","评估校验","vehicleAppraisement()","","","","btn_icon_check"} }; - sButtonPosition = "south"; %><%@ include file="/Frame/resources/include/ui/include_info.jspf"%> <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/src_tenwa/com/tenwa/lease/app/vehicleAssessment/vehicleAssessmentController.java b/src_tenwa/com/tenwa/lease/app/vehicleAssessment/vehicleAssessmentController.java index 968ee24cf..10a0e9e58 100644 --- a/src_tenwa/com/tenwa/lease/app/vehicleAssessment/vehicleAssessmentController.java +++ b/src_tenwa/com/tenwa/lease/app/vehicleAssessment/vehicleAssessmentController.java @@ -12,6 +12,7 @@ import java.util.Map; import org.apache.log4j.Logger; import jbo.app.LB_EQUIPMENT_CAR_TEMP; +import jbo.sys.CODE_LIBRARY; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; @@ -24,59 +25,88 @@ import com.tenwa.lease.util.VehicleAppraisementUtil; public class vehicleAssessmentController { - private String id; + private String FlowUnid; private Logger logger = Logger.getLogger(this.getClass()); - public String getId() { - return id; + + public String getFlowUnid() { + return FlowUnid; } - public void setId(String id) { - this.id = id; + public void setFlowUnid(String flowUnid) { + FlowUnid = flowUnid; } - + public String vehicleAppraisement(JBOTransaction tx){ - String result = null; - try { - BizObjectManager bomLSNT = JBOFactory.getBizObjectManager(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME,tx); - BizObject boLSNT = bomLSNT.createQuery("ID=:ID").setParameter("ID",id).getSingleResult(true); - //获取车型ID - String modelId = boLSNT.getAttribute("modelId").toString(); - //获取地区编号 - String zone = boLSNT.getAttribute("zone").toString(); - //因为从数据库获取到的上牌日期的格式不满足接口需求,所以要利用SimpleDateFormat进行变换 - Date date = new SimpleDateFormat("yyyy/MM/dd").parse(boLSNT.getAttribute("regDate").toString()); - String regDate = new SimpleDateFormat("yyyy-MM-dd").format(date); - //获取车辆行驶里程 - String mile = boLSNT.getAttribute("mile").toString(); - //得到Car300接口返回的Json数据 - String responseResult = VehicleAppraisementUtil.getVehicleAppraisementResponse(modelId, zone, regDate, mile); - //String responseResult = ReadJSON.ReadFile("D://che300new.txt"); - JSONObject object = JSONObject.parseObject(responseResult); - String status = object.get("status").toString(); - //提取出Json数据中的status属性(1:成功;0:失败)并判断,如果为0,则将出错原因返回到前台 - if("0".equals(status)){ - String errormsg = object.getString("error_msg"); - return errormsg; - } - boLSNT.setAttributeValue("discharge_standard", object.get("discharge_standard").toString()); - boLSNT.setAttributeValue("NOW_TOTAL", object.get("model_price").toString()); - boLSNT.setAttributeValue("detail_report_url", object.get("detail_report_url").toString()); - //将Json字符串中的数组数据部分转换为Json数组 - List list = JSONArray.parseArray(JSON.toJSONString(object.get("eval_prices")),HashMap.class); - //遍历Json数组并将对应字段的数据加入到数据库中 - for(int i=0;i list = JSONArray.parseArray(JSON.toJSONString(object.get("eval_prices")),HashMap.class); + //遍历Json数组并将对应字段的数据加入到数据库中 + for(int i=0;i