From 4ba7d94780d0ea99063816bdfa4f35d38cd697f9 Mon Sep 17 00:00:00 2001 From: "Stormeye.Wu" Date: Mon, 20 Aug 2018 15:54:18 +0800 Subject: [PATCH] =?UTF-8?q?[B=E7=AB=AF=E5=90=8E=E5=8F=B0][=E6=96=B0?= =?UTF-8?q?=E5=A2=9E]:=E6=96=B0=E5=A2=9E=E5=95=86=E5=9C=BA=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simple/controller/WxMallController.java | 47 +++++++++++++++++++ .../controller/WxMerchantBUserController.java | 6 +-- .../java/com/simple/common/ErrorCode.java | 1 + .../java/com/simple/domain/po/WxMall.java | 16 ++++++- .../main/resources/mapper/WxMallMapper.xml | 7 ++- 5 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 mallinkBApi/src/main/java/com/simple/controller/WxMallController.java diff --git a/mallinkBApi/src/main/java/com/simple/controller/WxMallController.java b/mallinkBApi/src/main/java/com/simple/controller/WxMallController.java new file mode 100644 index 000000000..33973e22b --- /dev/null +++ b/mallinkBApi/src/main/java/com/simple/controller/WxMallController.java @@ -0,0 +1,47 @@ +package com.simple.controller; + +import com.simple.common.ErrorCode; +import com.simple.common.Result; +import com.simple.common.ResultData; +import com.simple.domain.po.WxAppinfo; +import com.simple.domain.po.WxMall; +import com.simple.mapper.WxAppinfoMapper; +import com.simple.service.WxAppinfoService; +import com.simple.service.WxMallService; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("wxMall") +public class WxMallController extends BaseController { + private Logger logger = Logger.getLogger(WxMallController.class); + + @Autowired + private WxMallService wxMallService; + + @Autowired + private WxAppinfoService wxAppinfoService; + + + @ApiOperation("根据appId获取") + @GetMapping("/getAppIcon") + @ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true) + public ResultData getAppIcon(String appId) { + WxAppinfo appInfo = wxAppinfoService.getByAppId(appId); + if (appInfo == null) { + return new ResultData(ErrorCode.APP_ID_NOT_FOUND); + } + WxMall mall = wxMallService.getByTenantId(appInfo.getTenantId()); + if (mall==null) { + return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); + } + return new ResultData(Result.SUCCESS, "查询成功", mall); + } + + +} diff --git a/mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java b/mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java index 9ef8b3eb2..2c95c5b3c 100644 --- a/mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java +++ b/mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java @@ -59,16 +59,16 @@ public class WxMerchantBUserController extends BaseController WxMerchantBUser user = wxMerchantBUserService.getById(getUser().getId()); if (user==null) - return new ResultData(ErrorCode.USER_IS_EMPTY, ErrorCode.USER_IS_EMPTY.getMessage()); + return new ResultData(ErrorCode.USER_IS_EMPTY); WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); if (merchant==null) - return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND, ErrorCode.MCH_INFO_NOT_FOUND.getMessage()); + return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND); WxMall mall = wxMallService.getByTenantId(merchant.getTenantId()); if (mall==null) - return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND, ErrorCode.MCH_INFO_NOT_FOUND.getMessage()); + return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); resultMap.put("phone",user.getPhone()); resultMap.put("name",user.getName()); diff --git a/mallinkService/src/main/java/com/simple/common/ErrorCode.java b/mallinkService/src/main/java/com/simple/common/ErrorCode.java index 12c21235c..967a792a3 100644 --- a/mallinkService/src/main/java/com/simple/common/ErrorCode.java +++ b/mallinkService/src/main/java/com/simple/common/ErrorCode.java @@ -118,6 +118,7 @@ public enum ErrorCode{ MCH_INFO_NOT_EQUAL(12022, "商户信息不对应"), API_KEY_NOT_FOUND(12023, "支付密钥未配置"), CERT_PATH_NOT_FOUND(12024, "双向证书未配置"), + MALL_INFO_NOT_FOUND(12025, "商场信息没找到"), PROFIT_SHARING_REQUEST_FAILED(12030, "分账请求失败"), PROFIT_SHARING_APPLY_FAILED(12031, "分账业务失败"), diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxMall.java b/mallinkService/src/main/java/com/simple/domain/po/WxMall.java index 2d35b4bdc..b46efc716 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxMall.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxMall.java @@ -82,6 +82,8 @@ public class WxMall implements Serializable { private Long payId; @io.swagger.annotations.ApiModelProperty(value="电话",name="servicePhone") private String servicePhone; + @io.swagger.annotations.ApiModelProperty(value="商场图标",name="imgUrl") + private String imgUrl; public String getTenantId() { return tenantId; @@ -166,8 +168,16 @@ public class WxMall implements Serializable { return servicePhone; } - public void setServicePhone(String servicePhone) { - this.servicePhone = servicePhone; + public void setServicePhone(String _servicePhone) { + this.servicePhone = _servicePhone; + } + + public String getImgUrl() { + return imgUrl; + } + + public void setImgUrl(String _imgUrl) { + this.imgUrl = _imgUrl; } public static enum Field @@ -186,6 +196,8 @@ public class WxMall implements Serializable { ,ParkArea_ASC("`parkArea` ASC"),ParkArea_DESC("`parkArea` DESC") ,ParkPlaceNumber_ASC("`parkPlaceNumber` ASC"),ParkPlaceNumber_DESC("`parkPlaceNumber` DESC") ,PayId_ASC("`payId` ASC"),PayId_DESC("`payId` DESC") + ,ServicePhone_ASC("`servicePhone` ASC"),ServicePhone_DESC("`servicePhone` DESC") + ,ImgUrl_ASC("`imgUrl` ASC"),ImgUrl_DESC("`imgUrl` DESC") ; private String value; Field(String value){ diff --git a/mallinkService/src/main/resources/mapper/WxMallMapper.xml b/mallinkService/src/main/resources/mapper/WxMallMapper.xml index c78119001..43a2928e6 100644 --- a/mallinkService/src/main/resources/mapper/WxMallMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMallMapper.xml @@ -17,11 +17,12 @@ + - `id`,`tenant_id`,`name`,`group`,`country`,`province`,`city`,`addr`,`wiwide_id`,`total_area`,`operating_area`,`park_area`,`park_place_number`,`pay_id`,`service_phone` + `id`,`tenant_id`,`name`,`group`,`country`,`province`,`city`,`addr`,`wiwide_id`,`total_area`,`operating_area`,`park_area`,`park_place_number`,`pay_id`,`service_phone`,`img_url` @@ -99,6 +100,10 @@ and `service_phone` = #{servicePhone} + + + and `img_url` = #{imgUrl} + and id in