From 314f60f2f620d1b1fa499aa33f3eb6cadacb4281 Mon Sep 17 00:00:00 2001 From: liujiaji Date: Tue, 12 Jun 2018 13:57:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=BD=E8=BD=A6=E9=80=89=E6=8B=A9=E6=A1=86?= =?UTF-8?q?=20=E4=BA=A7=E5=93=81=E9=80=89=E6=8B=A9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/WEB-INF/web.xml | 6 +- .../als/base/awe/select/SelectCatalogWin.java | 17 +- .../SelectCarAttributeController.java | 100 +++++++++++ .../service/SelectCarAttributeService.java | 24 +++ .../impl/SelectCarAttributeServiceImpl.java | 62 +++++++ .../SelectProductAttributeController.java | 38 ++++ .../SelectProductAttributeService.java | 16 ++ .../SelectProductAttributeServiceImpl.java | 166 ++++++++++++++++++ .../service/impl/GesturePwdServiceImpl.java | 3 +- 9 files changed, 419 insertions(+), 13 deletions(-) create mode 100644 src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/controller/SelectCarAttributeController.java create mode 100644 src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/service/SelectCarAttributeService.java create mode 100644 src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/service/impl/SelectCarAttributeServiceImpl.java create mode 100644 src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/controller/SelectProductAttributeController.java create mode 100644 src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/SelectProductAttributeService.java create mode 100644 src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/impl/SelectProductAttributeServiceImpl.java diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml index 232de0eb5..3f221db42 100644 --- a/WebContent/WEB-INF/web.xml +++ b/WebContent/WEB-INF/web.xml @@ -459,7 +459,11 @@ 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, diff --git a/src_app_fresh/apx/com/amarsoft/als/base/awe/select/SelectCatalogWin.java b/src_app_fresh/apx/com/amarsoft/als/base/awe/select/SelectCatalogWin.java index 4f990e02c..8bde95786 100644 --- a/src_app_fresh/apx/com/amarsoft/als/base/awe/select/SelectCatalogWin.java +++ b/src_app_fresh/apx/com/amarsoft/als/base/awe/select/SelectCatalogWin.java @@ -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 col = new HashMap(); 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); diff --git a/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/controller/SelectCarAttributeController.java b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/controller/SelectCarAttributeController.java new file mode 100644 index 000000000..bce55f2fb --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/controller/SelectCarAttributeController.java @@ -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 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 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 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); + } + } +} diff --git a/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/service/SelectCarAttributeService.java b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/service/SelectCarAttributeService.java new file mode 100644 index 000000000..889aad369 --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/service/SelectCarAttributeService.java @@ -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 selectProductModel(@Context HttpServletRequest request, + @Context Transaction sqlca, @Context JBOTransaction tx, + ReturnMapUtil ReturnMapUtil) throws Exception; + + Map selectCarSeries(@Context HttpServletRequest request, + @Context Transaction sqlca, @Context JBOTransaction tx, + ReturnMapUtil ReturnMapUtil) throws Exception; + + Map selectCarSystem(@Context HttpServletRequest request, + @Context Transaction sqlca, @Context JBOTransaction tx, + ReturnMapUtil ReturnMapUtil) throws Exception; +} diff --git a/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/service/impl/SelectCarAttributeServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/service/impl/SelectCarAttributeServiceImpl.java new file mode 100644 index 000000000..093d2eeba --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/car/service/impl/SelectCarAttributeServiceImpl.java @@ -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 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 body = select.execute(tx, sqlca, request); + ReturnMapUtil.setReturnMap(body, + (String) RestfullConstant.baseProperty.get("SUCCESS"), ""); + return ReturnMapUtil.getReturnMap(); + } + + public Map 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 body = select.execute(tx, sqlca, request); + ReturnMapUtil.setReturnMap(body, + (String) RestfullConstant.baseProperty.get("SUCCESS"), ""); + return ReturnMapUtil.getReturnMap(); + } + + public Map 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 body = select.execute(tx, sqlca, request); + ReturnMapUtil.setReturnMap(body, + (String) RestfullConstant.baseProperty.get("SUCCESS"), ""); + return ReturnMapUtil.getReturnMap(); + } + +} diff --git a/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/controller/SelectProductAttributeController.java b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/controller/SelectProductAttributeController.java new file mode 100644 index 000000000..c259175e6 --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/controller/SelectProductAttributeController.java @@ -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 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); + } + } +} diff --git a/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/SelectProductAttributeService.java b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/SelectProductAttributeService.java new file mode 100644 index 000000000..6de2ac633 --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/SelectProductAttributeService.java @@ -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 selectBusinessType(@Context HttpServletRequest request, + @Context Transaction sqlca, @Context JBOTransaction tx, + ReturnMapUtil ReturnMapUtil) throws Exception; +} diff --git a/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/impl/SelectProductAttributeServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/impl/SelectProductAttributeServiceImpl.java new file mode 100644 index 000000000..ba46d5c61 --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/impl/SelectProductAttributeServiceImpl.java @@ -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 fieldMap; + + @SuppressWarnings("unchecked") + public Map selectBusinessType(HttpServletRequest request, + Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil) + throws Exception { + + Map testMap = (Map) MultipartDataUtil + .readRequestParam(request, "UTF-8"); + fieldMap = (Map) 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 bos = selManage.createQuery(sSelCode).getResultList( + false); + BizObject cataBo = bos.get(0); + Map map = new HashMap(); + 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> ListCatalog = new ArrayList>(); + List> ListCatalog2 = new ArrayList>(); + if (typeNo.startsWith("Cata")) { + Map mapCatalog = new HashMap(); + 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 mapCatalog2 = new HashMap(); + 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 mapCatalog3 = new HashMap(); + 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 map2 = new HashMap(); + List> rows = new ArrayList>(); + for (BizObject product : bos) { + Map row = new HashMap(); + List> ListLibrary = new ArrayList>(); + Map mapLibrary = new HashMap(); + Map mapLibrary2 = new HashMap(); + Map mapLibrary3 = new HashMap(); + 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 body = new HashMap(); + body.put("datas", map); + + ReturnMapUtil.setReturnMap(body, + RestfullConstant.baseProperty.get("SUCCESS").toString(), ""); + return ReturnMapUtil.getReturnMap(); + } +} diff --git a/src_app_fresh/apx/com/amarsoft/als/user/pwd/service/impl/GesturePwdServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/user/pwd/service/impl/GesturePwdServiceImpl.java index 7571930cd..187952046 100644 --- a/src_app_fresh/apx/com/amarsoft/als/user/pwd/service/impl/GesturePwdServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/user/pwd/service/impl/GesturePwdServiceImpl.java @@ -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 map = new HashMap(); map.put("ENABLE_GESTURE", "1");