| @@ -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); | |||||
| } | |||||
| } | |||||
| @@ -59,16 +59,16 @@ public class WxMerchantBUserController extends BaseController | |||||
| WxMerchantBUser user = wxMerchantBUserService.getById(getUser().getId()); | WxMerchantBUser user = wxMerchantBUserService.getById(getUser().getId()); | ||||
| if (user==null) | 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()); | WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); | ||||
| if (merchant==null) | 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()); | WxMall mall = wxMallService.getByTenantId(merchant.getTenantId()); | ||||
| if (mall==null) | 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("phone",user.getPhone()); | ||||
| resultMap.put("name",user.getName()); | resultMap.put("name",user.getName()); | ||||
| @@ -118,6 +118,7 @@ public enum ErrorCode{ | |||||
| MCH_INFO_NOT_EQUAL(12022, "商户信息不对应"), | MCH_INFO_NOT_EQUAL(12022, "商户信息不对应"), | ||||
| API_KEY_NOT_FOUND(12023, "支付密钥未配置"), | API_KEY_NOT_FOUND(12023, "支付密钥未配置"), | ||||
| CERT_PATH_NOT_FOUND(12024, "双向证书未配置"), | CERT_PATH_NOT_FOUND(12024, "双向证书未配置"), | ||||
| MALL_INFO_NOT_FOUND(12025, "商场信息没找到"), | |||||
| PROFIT_SHARING_REQUEST_FAILED(12030, "分账请求失败"), | PROFIT_SHARING_REQUEST_FAILED(12030, "分账请求失败"), | ||||
| PROFIT_SHARING_APPLY_FAILED(12031, "分账业务失败"), | PROFIT_SHARING_APPLY_FAILED(12031, "分账业务失败"), | ||||
| @@ -82,6 +82,8 @@ public class WxMall implements Serializable { | |||||
| private Long payId; | private Long payId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="电话",name="servicePhone") | @io.swagger.annotations.ApiModelProperty(value="电话",name="servicePhone") | ||||
| private String servicePhone; | private String servicePhone; | ||||
| @io.swagger.annotations.ApiModelProperty(value="商场图标",name="imgUrl") | |||||
| private String imgUrl; | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| @@ -166,8 +168,16 @@ public class WxMall implements Serializable { | |||||
| return servicePhone; | 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 | public static enum Field | ||||
| @@ -186,6 +196,8 @@ public class WxMall implements Serializable { | |||||
| ,ParkArea_ASC("`parkArea` ASC"),ParkArea_DESC("`parkArea` DESC") | ,ParkArea_ASC("`parkArea` ASC"),ParkArea_DESC("`parkArea` DESC") | ||||
| ,ParkPlaceNumber_ASC("`parkPlaceNumber` ASC"),ParkPlaceNumber_DESC("`parkPlaceNumber` DESC") | ,ParkPlaceNumber_ASC("`parkPlaceNumber` ASC"),ParkPlaceNumber_DESC("`parkPlaceNumber` DESC") | ||||
| ,PayId_ASC("`payId` ASC"),PayId_DESC("`payId` 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; | private String value; | ||||
| Field(String value){ | Field(String value){ | ||||
| @@ -17,11 +17,12 @@ | |||||
| <result column="park_place_number" jdbcType="INTEGER" property="parkPlaceNumber" /> | <result column="park_place_number" jdbcType="INTEGER" property="parkPlaceNumber" /> | ||||
| <result column="pay_id" jdbcType="BIGINT" property="payId" /> | <result column="pay_id" jdbcType="BIGINT" property="payId" /> | ||||
| <result column="service_phone" jdbcType="VARCHAR" property="servicePhone" /> | <result column="service_phone" jdbcType="VARCHAR" property="servicePhone" /> | ||||
| <result column="img_url" jdbcType="VARCHAR" property="imgUrl" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `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` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -99,6 +100,10 @@ | |||||
| <if test=" null != servicePhone "> | <if test=" null != servicePhone "> | ||||
| and `service_phone` = #{servicePhone} | and `service_phone` = #{servicePhone} | ||||
| </if> | |||||
| <if test=" null != imgUrl "> | |||||
| and `img_url` = #{imgUrl} | |||||
| </if> | </if> | ||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||