From 5965511881c20a3f7c265b57cd3b7aa5df5704dd Mon Sep 17 00:00:00 2001 From: 32189 <32189@windows10.microdone.cn> Date: Wed, 19 May 2021 11:20:30 +0800 Subject: [PATCH] =?UTF-8?q?app=E6=B7=BB=E5=8A=A0=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=99=BB=E5=BD=95=E4=BA=BAid=E7=9A=84?= =?UTF-8?q?=E7=BB=8F=E9=94=80=E7=B1=BB=E5=9E=8B=EF=BC=8C=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=AD=90=E7=BB=8F=E9=94=80=E5=95=86=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apply/business/start/bo/BusinessBO.java | 39 ++++++++++++++++++- .../SelectCarAttributeController.java | 18 +++++++++ .../service/SelectCarAttributeService.java | 3 ++ .../impl/SelectCarAttributeServiceImpl.java | 19 +++++++++ .../service/impl/AppUserLoginServiceImpl.java | 8 ++++ 5 files changed, 86 insertions(+), 1 deletion(-) diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java index 994a3f924..e6b9426fa 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java @@ -70,7 +70,10 @@ public class BusinessBO implements Serializable { private String msg; private Map params; - + private String distributor_name; + private String distributor_no; + private String distributorType; + public void setParam(Map fieldMap, String param, Object obj) { obj = fieldMap.get(param.toLowerCase()) == null ? null : fieldMap.get( param.toLowerCase()).toString(); @@ -184,6 +187,11 @@ public class BusinessBO implements Serializable { this.mobile = fieldMap.get("mobile".toLowerCase()) == null ? "": fieldMap.get("mobile".toLowerCase()).toString(); // 手机号 this.newtype = fieldMap.get("newtype".toLowerCase()) == null ? "": fieldMap.get("newtype".toLowerCase()).toString(); // 申请类型 + //根据类型设置对应子经销商信息 + this.distributorType = fieldMap.get("distributor_type".toLowerCase()) == null ? "": fieldMap.get("distributor_type".toLowerCase()).toString(); + this.distributor_name = fieldMap.get("distributor_name".toLowerCase()) == null ? "": fieldMap.get("distributor_name".toLowerCase()).toString(); + this.distributor_no = fieldMap.get("new_distributor_no".toLowerCase()) == null ? "": fieldMap.get("new_distributor_no".toLowerCase()).toString(); + //更具产品id获取对应的主体信息 List> sujectIdList = DataOperatorUtil.getDataBySql("SELECT manysubject FROM PRD_SPECIFIC_LIBRARY WHERE productid='"+this.productId+"'"); if(sujectIdList.size()>0){ @@ -267,6 +275,11 @@ public class BusinessBO implements Serializable { }else{ map.put("newtype", ""); } + //根据当前经销商类是否给子经销赋值 + if(distributorType.equals("types03")){ + map.put("distributorNo", distributor_no); + map.put("distributorName", distributor_name); + } JSONObject jsonObject = JSONObject.fromObject(map); this.fixedFlowParam = jsonObject.toString(); @@ -614,6 +627,30 @@ public class BusinessBO implements Serializable { this.newtype = newtype; } + public String getDistributor_name() { + return distributor_name; + } + + public void setDistributor_name(String distributor_name) { + this.distributor_name = distributor_name; + } + + public String getDistributor_no() { + return distributor_no; + } + + public void setDistributor_no(String distributor_no) { + this.distributor_no = distributor_no; + } + + public String getDistributorType() { + return distributorType; + } + + public void setDistributorType(String distributorType) { + this.distributorType = distributorType; + } + public void sethaveCommission(String haveCommission) { haveCommission = haveCommission; } 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 index 0a17bda10..d5c80acfc 100644 --- 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 @@ -123,4 +123,22 @@ public class SelectCarAttributeController { return ReturnMapUtil.rollback(e); } } + + //获取子经销信息 + @Path("/subDistribution/name") + @POST + public Map SubDistributionName( + @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/subDistribution/name run ................."); + try { + return service + .SubDistributionName(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 index 7631333c4..3ecaf9f0e 100644 --- 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 @@ -25,4 +25,7 @@ public interface SelectCarAttributeService { Map selectProductName(@Context HttpServletRequest request, @Context Transaction sqlca, @Context JBOTransaction tx, ReturnMapUtil ReturnMapUtil) throws Exception; + + Map SubDistributionName(HttpServletRequest request, + Transaction sqlca, 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 index d3945bc41..db146c09b 100644 --- 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 @@ -1,5 +1,7 @@ package apx.com.amarsoft.als.currency.select.apzl.car.service.impl; +import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; @@ -11,7 +13,9 @@ 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.MultipartDataUtil; import com.base.util.ReturnMapUtil; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; public class SelectCarAttributeServiceImpl implements SelectCarAttributeService{ @@ -78,4 +82,19 @@ public class SelectCarAttributeServiceImpl implements SelectCarAttributeService{ return ReturnMapUtil.getReturnMap(); } + @Override + public Map SubDistributionName(HttpServletRequest request, + Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil) throws Exception { + + Map testMap = (Map) MultipartDataUtil.readRequestParam(request, "UTF-8"); + Map fieldMap = (Map) testMap.get("fieldMap"); + String distributor_no = fieldMap.get("distributor_no") == null ? "" : fieldMap.get("distributor_no").toString(); + List> dataList = DataOperatorUtil.getDataBySql("SELECT distributor_name,distributor_no as new_distributor_no FROM distributor_info WHERE LIMIT_APPROVAL_DATE='"+distributor_no+"' AND DISTRIBUTOR_STATUS='distributor_status04'"); + Map body = new HashMap(); + body.put("distributorList", dataList); + ReturnMapUtil.setReturnMap(body,RestfullConstant.baseProperty.get("success").toString(), + "查询成功"); + return ReturnMapUtil.getReturnMap(); + } + } diff --git a/src_app_fresh/apx/com/amarsoft/als/user/logon/service/impl/AppUserLoginServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/user/logon/service/impl/AppUserLoginServiceImpl.java index d1a7d7954..09db1bb0f 100644 --- a/src_app_fresh/apx/com/amarsoft/als/user/logon/service/impl/AppUserLoginServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/user/logon/service/impl/AppUserLoginServiceImpl.java @@ -234,9 +234,17 @@ public class AppUserLoginServiceImpl implements AppUserLoginService { try { List> dataList = DataOperatorUtil.getDataBySql("SELECT menuid,displayname,sortno FROM app_menu_info WHERE menuid IN (SELECT menuid FROM app_role_menu WHERE roleid in (SELECT ROLEID FROM USER_ROLE WHERE userid='"+body.get("userid")+"'))"); body.put("menu", dataList); + + //根据角色id查询对应的经销商 + List> distributorList = DataOperatorUtil.getDataBySql("SELECT distributor_no,TYPE FROM distributor_info WHERE orgid='"+o.getOrgId()+"'"); + if(distributorList != null && distributorList.size() > 0 ){ + body.put("distributor_no", distributorList.get(0).get("distributor_no") ); + body.put("distributor_type", distributorList.get(0).get("TYPE") ); + } } catch (Exception e) { e.printStackTrace(); } + ReturnMapUtil.setReturnMap(body, (String) RestfullConstant.baseProperty .get("SUCCESS".toLowerCase()), sMsg); return ReturnMapUtil.getReturnMap();