修改gps产品配置动态获取

This commit is contained in:
gityjf 2020-11-11 13:52:17 +08:00
parent 6dbe245590
commit dc509d1761
3 changed files with 18 additions and 32 deletions

View File

@ -42,8 +42,6 @@
doTemp.setColumnAttribute("USERNAME", "COLREQUIRED", "1");
doTemp.setColumnAttribute("USERPHONE", "COLVISIBLE", "1");
doTemp.setColumnAttribute("USERPHONE", "COLREQUIRED", "1");
doTemp.setColumnAttribute("SHOPNAME", "COLVISIBLE", "1");
doTemp.setColumnAttribute("SHOPNAME", "COLREQUIRED", "1");
}
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
@ -69,19 +67,17 @@
setItemValue(0,getRow(0),"APPLY_NO",'<%=ProjectNo%>');
setItemValue(0,getRow(0),"WIRED_PERIOD",'<%=period%>');
setItemValue(0,getRow(0),"WIRELESS_PERIOD",'<%=period%>');
if('<%=source%>'=='1'){
setItemValue(0,getRow(0),"WIRED_NUM",'1');
setItemValue(0,getRow(0),"WIRELESS_NUM",'1');
}
setItemValue(0,getRow(0),"FLOWUNID",'<%=flowunid%>');
setItemValue(0,getRow(0),"PROJECT_ID",'<%=ProjectId%>');
setItemValue(0,getRow(0),"INPUTUSERID",'<%=CurUser.getUserID()%>');
setItemValue(0,getRow(0),"INPUTORGID",'<%=CurUser.getOrgID()%>');
setItemValue(0,getRow(0),"INPUTTIME",new Date().Format("yyyy/MM/dd hh:mm:ss"));
setItemValue(0,getRow(0),"PICCONTACT_NAME",'<%=contact_name%>');
setItemValue(0,getRow(0),"PICCONTACT_PHONE",'<%=contact_phone%>');
setItemValue(0,getRow(0),"CAR_ACCOUNT",'<%=distributor_name%>');
if('<%=source%>'=='1'){
setItemValue(0,getRow(0),"SHOPNAME",'<%=distributor_name%>');//2020-11-11 yjf 修改门店取值为拉车账号
}
setItemValue(0,getRow(0),"SOURCE",'<%=source%>');
var status = getItemValue(0,getRow(),"STATUS");

View File

@ -6,12 +6,6 @@ TYUrl=http://121.43.178.183:9989/dispatch_intf/apiController/order
TYQueryOrderToVin=http://121.43.178.183:80/gps-intf/api2/getGpsInfosByCarVin
# ÖÐÈðProductId
ZR_ProfuctId_one=d5e89c74-6014-11e9-bdb3-6c92bf61e2
ZR_ProfuctId_two=d5e89c74-6014-11e9-bdb3-6c92bf61e2
ZR_ProfuctId_three=d5e89c74-6014-11e9-bdb3-6c92bf61e2
ZR_ProfuctId_four=d5e89c74-6014-11e9-bdb3-6c92bf61e2
ZR_ProfuctId_five=d5e89c74-6014-11e9-bdb3-6c92bf61e2
# 中瑞appKey
ZR_AppKey=2C6074D0-C8E4-4BA4-A50A-E3A46EAD394A
# 中瑞下单

View File

@ -202,11 +202,12 @@ public class GpsCommon {
* @throws Exception
*/
public static String zrEditCreateParameter(String applyNo, Transaction Sqlca) throws Exception {
ASResultSet res = Sqlca.getASResultSet(new SqlObject("select WIRED_PERIOD,CAR_VIN,ADDRESS_CODE,SHOPNAME,CONTACT_NAME,CONTACT_PHONE,INSTALL_TIME,ADDRESS_DETAIL,CARTYPE,USERNAME,USERPHONE from LM_GPS_ORDER_TEMP where APPLY_NO='" + applyNo + "'"));
ASResultSet res = Sqlca.getASResultSet(new SqlObject("select WIRED_PERIOD,WIRED_NUM,WIRELESS_NUM,CAR_VIN,ADDRESS_CODE,SHOPNAME,CONTACT_NAME,CONTACT_PHONE,INSTALL_TIME,ADDRESS_DETAIL,CARTYPE,USERNAME,USERPHONE from LM_GPS_ORDER_TEMP where APPLY_NO='" + applyNo + "'"));
JSONObject params = new JSONObject();
while (res.next()) {
params.put("AppCode", applyNo);
params.put("ProductId", getProductId(res.getInt("WIRED_PERIOD")));
params.put("ProductId", getProductId(res.getInt("WIRED_PERIOD"),
res.getStringValue("WIRED_NUM"), res.getStringValue("WIRELESS_NUM"), Sqlca));
params.put("VIN", res.getString("CAR_VIN"));
params.put("DistrictCode", res.getString("ADDRESS_CODE"));
params.put("ShopName", res.getString("SHOPNAME"));
@ -224,26 +225,21 @@ public class GpsCommon {
/**
* 根据安装年限选着产品中瑞
* @param period
* 获取产品配置中瑞
*
* @param period 设备年限
* @param wireNum 有线设备数量
* @param wirelessNum 无线设备数量
* @return
*/
private static String getProductId(Integer period) throws Exception{
if(period > 5 || period < 1)
private static String getProductId(Integer period, String wireNum, String wirelessNum, Transaction Sqlca) throws Exception {
if (period > 5 || period < 1)
throw new BusinessException("gps°²×°ÄêÏÞ²»ºÏ·¨!");
String productId = null;
switch (period){
case 1:
productId = GPSConfigure.get("ZR_ProfuctId_one"); break;
case 2:
productId = GPSConfigure.get("ZR_ProfuctId_two"); break;
case 3:
productId = GPSConfigure.get("ZR_ProfuctId_three"); break;
case 4:
productId = GPSConfigure.get("ZR_ProfuctId_four"); break;
case 5:
productId = GPSConfigure.get("ZR_ProfuctId_five"); break;
}
SqlObject sqlObject = new SqlObject("select product_id from gps_product_info where year=:year and wire_num = wireNum and wireless_num =:wirelessNum")
.setParameter("year", period).setParameter("wireNum", wireNum).setParameter("wirelessNum", wirelessNum);
String productId = Sqlca.getString(sqlObject);
if (productId == null)
throw new BusinessException("中瑞gps产品{年限:[" + period + "]有线数量:[" + wireNum + "]无线数量:[" + wirelessNum + "]}配置不存在!");
return productId;
}