汽车选择框

产品选择框
This commit is contained in:
liujiaji 2018-06-12 13:57:17 +08:00
parent 94b6498016
commit 314f60f2f6
9 changed files with 419 additions and 13 deletions

View File

@ -459,7 +459,11 @@
<!-- 我的工作 -->
<!-- 申请列表 applytype phasetype ObjectNo -->
apx.com.amarsoft.als.apzl.apply.query,
<!-- 汽车选择框 -->
apx.com.amarsoft.als.currency.select.apzl.car.controller,
<!-- 产品选择框 -->
apx.com.amarsoft.als.currency.select.apzl.product.controller,
<!-- 意见 -->
<!-- 签署意见 -->
apx.com.amarsoft.als.business.opinion.sign.controller,

View File

@ -166,8 +166,6 @@ public class SelectCatalogWin {
}
}
sql = sql.trim();
sql = sql.substring(0, 6) + " ROWNUM as tenwaROWNUM ,\r\n"
+ sql.substring(7, sql.length());
// KeyFilter¼Ó¿ì²éѯËÙÈ
StringTokenizer stFilter = new StringTokenizer(sAttribute4, "@");
String sFilter = "";
@ -240,8 +238,10 @@ public class SelectCatalogWin {
iLimit = Integer.valueOf(sLimit);
int pageIndexStart = (iPageIndex) * iLimit;
int pageIndexEnd = (iPageIndex + 1) * iLimit;
sql = "SELECT * FROM (" + sql + ") A WHERE tenwaROWNUM BETWEEN "
+ pageIndexStart + " AND " + pageIndexEnd;
// sql = "SELECT * FROM (" + sql + ") A WHERE tenwaROWNUM BETWEEN "
// + pageIndexStart + " AND " + pageIndexEnd;
sql = "SELECT * FROM (" + sql + ") A limit " + pageIndexStart + "," + pageIndexEnd;
String[] aSelReturnValue = sSelReturnValue.split("@");
String[] aSelFieldName = sSelFieldName.split(",");
String[] aSelHideField = sSelHideField.split(",");
@ -262,12 +262,7 @@ public class SelectCatalogWin {
int k = 0;
Map<String, Object> col = new HashMap<String, Object>();
String key = rsmd.getColumnLabel(i);
if (key.toUpperCase().equals("tenwaROWNUM".toUpperCase())) {
k = i;
continue;
}
int index = k == 0 ? i : i + 1;
String value = rs.getString(index);
String value = rs.getString(i);
col.put("code", key);
col.put("value", value);
col.put("itemno", value);
@ -296,7 +291,7 @@ public class SelectCatalogWin {
}
}
// ÏÔʾÃû ,
col.put("display", aSelFieldName[index - 2]);
col.put("display", aSelFieldName[i-1]);
colList.add(col);
}
row.put("row", colList);

View File

@ -0,0 +1,100 @@
package apx.com.amarsoft.als.currency.select.apzl.car.controller;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;
import apx.com.amarsoft.als.currency.select.apzl.car.service.SelectCarAttributeService;
import apx.com.amarsoft.als.currency.select.apzl.car.service.impl.SelectCarAttributeServiceImpl;
import com.amarsoft.are.ARE;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.Transaction;
import com.base.util.ReturnMapUtil;
@Path("/select")
public class SelectCarAttributeController {
SelectCarAttributeService service = new SelectCarAttributeServiceImpl();
/**
* 品牌
*
* @param request
* @param sqlca
* @param tx
* @return
* @throws Exception
*/
@Path("/product/model")
@POST
public Map<String, Object> selectProductModel(
@Context HttpServletRequest request, @Context Transaction sqlca,
@Context JBOTransaction tx) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog()
.info("[CONTROLLER] SelectCarAttributeController run .................");
ARE.getLog().info("[Path] /select/product/model run .................");
try {
return service
.selectProductModel(request, sqlca, tx, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
/**
* 车系
*
* @param request
* @param sqlca
* @param tx
* @return
* @throws Exception
*/
@Path("/car/series")
@POST
public Map<String, Object> selectCarSeries(
@Context HttpServletRequest request, @Context Transaction sqlca,
@Context JBOTransaction tx) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog()
.info("[CONTROLLER] SelectCarAttributeController run .................");
ARE.getLog().info("[Path] /select/car/series run .................");
try {
return service
.selectCarSeries(request, sqlca, tx, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
/**
* 车型
*
* @param request
* @param sqlca
* @param tx
* @return
* @throws Exception
*/
@Path("/car/system")
@POST
public Map<String, Object> selectCarSystem(
@Context HttpServletRequest request, @Context Transaction sqlca,
@Context JBOTransaction tx) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog()
.info("[CONTROLLER] SelectCarAttributeController run .................");
ARE.getLog().info("[Path] /select/car/system run .................");
try {
return service
.selectCarSystem(request, sqlca, tx, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
}

View File

@ -0,0 +1,24 @@
package apx.com.amarsoft.als.currency.select.apzl.car.service;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.Transaction;
import com.base.util.ReturnMapUtil;
public interface SelectCarAttributeService {
Map<String, Object> selectProductModel(@Context HttpServletRequest request,
@Context Transaction sqlca, @Context JBOTransaction tx,
ReturnMapUtil ReturnMapUtil) throws Exception;
Map<String, Object> selectCarSeries(@Context HttpServletRequest request,
@Context Transaction sqlca, @Context JBOTransaction tx,
ReturnMapUtil ReturnMapUtil) throws Exception;
Map<String, Object> selectCarSystem(@Context HttpServletRequest request,
@Context Transaction sqlca, @Context JBOTransaction tx,
ReturnMapUtil ReturnMapUtil) throws Exception;
}

View File

@ -0,0 +1,62 @@
package apx.com.amarsoft.als.currency.select.apzl.car.service.impl;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import apx.com.amarsoft.als.base.awe.select.SelectCatalogWin;
import apx.com.amarsoft.als.currency.select.apzl.car.service.SelectCarAttributeService;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.context.ASUser;
import com.base.constant.RestfullConstant;
import com.base.util.ReturnMapUtil;
public class SelectCarAttributeServiceImpl implements SelectCarAttributeService{
public Map<String, Object> selectProductModel(HttpServletRequest request,
Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil) throws Exception {
String sSelName = "SelectCardataBrand";
SelectCatalogWin select = new SelectCatalogWin(sSelName, tx, sqlca,
request);
ASUser curUser = new ASUser((String) request.getSession().getAttribute(
"userid"), sqlca);
select.setParam("orgId", curUser.getOrgID());
Map<String, Object> body = select.execute(tx, sqlca, request);
ReturnMapUtil.setReturnMap(body,
(String) RestfullConstant.baseProperty.get("SUCCESS"), "");
return ReturnMapUtil.getReturnMap();
}
public Map<String, Object> selectCarSeries(HttpServletRequest request,
Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil)
throws Exception {
String sSelName = "SelectCardataSeries";
SelectCatalogWin select = new SelectCatalogWin(sSelName, tx, sqlca,
request);
ASUser curUser = new ASUser((String) request.getSession().getAttribute(
"userid"), sqlca);
select.setParam("orgId", curUser.getOrgID());
Map<String, Object> body = select.execute(tx, sqlca, request);
ReturnMapUtil.setReturnMap(body,
(String) RestfullConstant.baseProperty.get("SUCCESS"), "");
return ReturnMapUtil.getReturnMap();
}
public Map<String, Object> selectCarSystem(HttpServletRequest request,
Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil)
throws Exception {
String sSelName = "SelectCardataModel";
SelectCatalogWin select = new SelectCatalogWin(sSelName, tx, sqlca,
request);
ASUser curUser = new ASUser((String) request.getSession().getAttribute(
"userid"), sqlca);
select.setParam("orgId", curUser.getOrgID());
Map<String, Object> body = select.execute(tx, sqlca, request);
ReturnMapUtil.setReturnMap(body,
(String) RestfullConstant.baseProperty.get("SUCCESS"), "");
return ReturnMapUtil.getReturnMap();
}
}

View File

@ -0,0 +1,38 @@
package apx.com.amarsoft.als.currency.select.apzl.product.controller;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;
import com.amarsoft.are.ARE;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.Transaction;
import com.base.util.ReturnMapUtil;
import apx.com.amarsoft.als.currency.select.apzl.product.service.SelectProductAttributeService;
import apx.com.amarsoft.als.currency.select.apzl.product.service.impl.SelectProductAttributeServiceImpl;
@Path("/select")
public class SelectProductAttributeController {
SelectProductAttributeService service = new SelectProductAttributeServiceImpl();
@Path("/business/type")
@POST
public Map<String, Object> selectBusinessType(
@Context HttpServletRequest request, @Context Transaction sqlca,
@Context JBOTransaction tx) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog()
.info("[CONTROLLER] SelectProductAttributeController run .................");
ARE.getLog().info("[Path] /select/business/type run .................");
try {
return service
.selectBusinessType(request, sqlca, tx, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
}

View File

@ -0,0 +1,16 @@
package apx.com.amarsoft.als.currency.select.apzl.product.service;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.Transaction;
import com.base.util.ReturnMapUtil;
public interface SelectProductAttributeService {
Map<String, Object> selectBusinessType(@Context HttpServletRequest request,
@Context Transaction sqlca, @Context JBOTransaction tx,
ReturnMapUtil ReturnMapUtil) throws Exception;
}

View File

@ -0,0 +1,166 @@
package apx.com.amarsoft.als.currency.select.apzl.product.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import jbo.app.BUSINESS_TYPE;
import apx.com.amarsoft.als.currency.select.apzl.product.service.SelectProductAttributeService;
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;
import com.base.constant.RestfullConstant;
import com.base.util.MultipartDataUtil;
import com.base.util.ReturnMapUtil;
public class SelectProductAttributeServiceImpl implements
SelectProductAttributeService {
private Map<String, Object> fieldMap;
@SuppressWarnings("unchecked")
public Map<String, Object> selectBusinessType(HttpServletRequest request,
Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil)
throws Exception {
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
.readRequestParam(request, "UTF-8");
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
String sProductType = fieldMap.get("ProductType".toLowerCase()) == null ? ""
: fieldMap.get("ProductType".toLowerCase()).toString();
String sTypeNo = fieldMap.get("TypeNo".toLowerCase()) == null ? ""
: fieldMap.get("TypeNo".toLowerCase()).toString();
BizObjectManager selManage = JBOFactory
.getBizObjectManager(BUSINESS_TYPE.CLASS_NAME);
String sSelCode = "SELECT SORTNO,TYPENAME,TYPENO from O where isinuse='1'";
// 筛选业务类型
if (!sProductType.contains("@") && "1".equals(sProductType)) {
sSelCode = sSelCode + "and sortno LIKE '0005%' ";
if (sTypeNo.length() != 0) {
sSelCode += " and typeno <>'" + sTypeNo + "' ";
}
} else if (!sProductType.contains("@") && "3".equals(sProductType)) {
sSelCode = sSelCode + "and sortno LIKE '0006%' ";
if (sTypeNo.length() != 0) {
sSelCode += " and typeno <>'" + sTypeNo + "' ";
}
} else if (sProductType.contains("@") && sProductType.contains("1")
&& sProductType.contains("3")) {
sSelCode = sSelCode
+ "and sortno not LIKE '0003%' and sortno not LIKE '0004%' ";
if (sTypeNo.length() != 0) {
sSelCode += " and typeno <>'" + sTypeNo + "' ";
}
}
String sSelFilterField = "order by sortno";
sSelCode += sSelFilterField;
List<BizObject> bos = selManage.createQuery(sSelCode).getResultList(
false);
BizObject cataBo = bos.get(0);
Map<String, Object> map = new HashMap<String, Object>();
String typeNo = cataBo.getAttribute("TYPENO") == null ? "" : cataBo
.getAttribute("TYPENO").toString();
String typeName = cataBo.getAttribute("TYPENAME") == null ? "" : cataBo
.getAttribute("TYPENAME").toString();
String sortNoCata = cataBo.getAttribute("SORTNO") == null ? "" : cataBo
.getAttribute("SORTNO").toString();
List<Map<String, Object>> ListCatalog = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> ListCatalog2 = new ArrayList<Map<String, Object>>();
if (typeNo.startsWith("Cata")) {
Map<String, Object> mapCatalog = new HashMap<String, Object>();
mapCatalog.put("code", "TYPENO");
mapCatalog.put("colcheckformat", "1");
mapCatalog.put("display", "产品类型");
mapCatalog.put("isHidden", "true");
mapCatalog.put("isReturn", "true");
mapCatalog.put("itemno", typeNo);
mapCatalog.put("value", typeNo);
Map<String, Object> mapCatalog2 = new HashMap<String, Object>();
mapCatalog2.put("code", "TYPENAME");
mapCatalog2.put("colcheckformat", "1");
mapCatalog2.put("display", "产品类型");
mapCatalog2.put("isHidden", "false");
mapCatalog2.put("isReturn", "true");
mapCatalog2.put("itemno", typeName);
mapCatalog2.put("value", typeName);
Map<String, Object> mapCatalog3 = new HashMap<String, Object>();
mapCatalog3.put("code", "SORTNO");
mapCatalog3.put("colcheckformat", "1");
mapCatalog3.put("display", "排序号");
mapCatalog3.put("isHidden", "true");
mapCatalog3.put("isReturn", "false");
mapCatalog3.put("itemno", sortNoCata);
mapCatalog3.put("value", sortNoCata);
ListCatalog.add(mapCatalog);
ListCatalog.add(mapCatalog2);
ListCatalog.add(mapCatalog3);
Map<String, Object> map2 = new HashMap<String, Object>();
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
for (BizObject product : bos) {
Map<String, Object> row = new HashMap<String, Object>();
List<Map<String, Object>> ListLibrary = new ArrayList<Map<String, Object>>();
Map<String, Object> mapLibrary = new HashMap<String, Object>();
Map<String, Object> mapLibrary2 = new HashMap<String, Object>();
Map<String, Object> mapLibrary3 = new HashMap<String, Object>();
typeName = product.getAttribute("TYPENAME") == null ? "" : product
.getAttribute("TYPENAME").toString();
typeNo = product.getAttribute("TYPENO") == null ? "" : product
.getAttribute("TYPENO").toString();
String sortNo = product.getAttribute("SORTNO") == null ? ""
: product.getAttribute("SORTNO").toString();
if ((!typeNo.startsWith("Cata")) && sortNo.contains(sortNoCata)) {
mapLibrary.put("code", "TYPENO");
mapLibrary.put("colcheckformat", "1");
mapLibrary.put("display", "产品类型");
mapLibrary.put("isHidden", "true");
mapLibrary.put("isReturn", "true");
mapLibrary.put("itemno", typeNo);
mapLibrary.put("value", typeNo);
mapLibrary2.put("code", "TYPENAME");
mapLibrary2.put("colcheckformat", "1");
mapLibrary2.put("display", "产品类型");
mapLibrary2.put("isHidden", "false");
mapLibrary2.put("isReturn", "true");
mapLibrary2.put("itemno", typeName);
mapLibrary2.put("value", typeName);
mapLibrary3.put("code", "SORTNO");
mapLibrary3.put("colcheckformat", "1");
mapLibrary3.put("display", "排序号");
mapLibrary3.put("isHidden", "true");
mapLibrary3.put("isReturn", "false");
mapLibrary3.put("itemno", sortNo);
mapLibrary3.put("value", sortNo);
ListLibrary.add(mapLibrary);
ListLibrary.add(mapLibrary2);
ListLibrary.add(mapLibrary3);
} else continue;
row.put("rows", ListLibrary);
rows.add(row);
map2.put("library", rows);
}
ListCatalog2.add(map2);
}
map.put("type", ListCatalog);
map.put("products", ListCatalog2);
Map<String, Object> body = new HashMap<String, Object>();
body.put("datas", map);
ReturnMapUtil.setReturnMap(body,
RestfullConstant.baseProperty.get("SUCCESS").toString(), "");
return ReturnMapUtil.getReturnMap();
}
}

View File

@ -27,7 +27,8 @@ public class GesturePwdServiceImpl implements GesturePwdService {
String sPwd = request.getParameter("pwd");
if (null == sPwd)
sPwd = "";
DES.decrypt(sPwd);
// DES.decrypt(sPwd);
sPwd = DES.decrypt(sPwd);
sPwd = MD5Util.getMD5EncodedPassword(sPwd);
Map<String, Object> map = new HashMap<String, Object>();
map.put("ENABLE_GESTURE", "1");