Browse Source

[B端后台][新增]:新增商场图标获取

release_toaliyun_real
Stormeye.Wu 7 years ago
parent
commit
4ba7d94780
5 changed files with 71 additions and 6 deletions
  1. +47
    -0
      mallinkBApi/src/main/java/com/simple/controller/WxMallController.java
  2. +3
    -3
      mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java
  3. +1
    -0
      mallinkService/src/main/java/com/simple/common/ErrorCode.java
  4. +14
    -2
      mallinkService/src/main/java/com/simple/domain/po/WxMall.java
  5. +6
    -1
      mallinkService/src/main/resources/mapper/WxMallMapper.xml

+ 47
- 0
mallinkBApi/src/main/java/com/simple/controller/WxMallController.java View File

@@ -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);
}


}

+ 3
- 3
mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java View File

@@ -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());


+ 1
- 0
mallinkService/src/main/java/com/simple/common/ErrorCode.java View File

@@ -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, "分账业务失败"),


+ 14
- 2
mallinkService/src/main/java/com/simple/domain/po/WxMall.java View File

@@ -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){


+ 6
- 1
mallinkService/src/main/resources/mapper/WxMallMapper.xml View File

@@ -17,11 +17,12 @@
<result column="park_place_number" jdbcType="INTEGER" property="parkPlaceNumber" />
<result column="pay_id" jdbcType="BIGINT" property="payId" />
<result column="service_phone" jdbcType="VARCHAR" property="servicePhone" />
<result column="img_url" jdbcType="VARCHAR" property="imgUrl" />

</resultMap>
<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 id="dynamicWhereConditions">
@@ -99,6 +100,10 @@
<if test=" null != servicePhone ">
and `service_phone` = #{servicePhone}

</if>
<if test=" null != imgUrl ">
and `img_url` = #{imgUrl}

</if>
<if test=" null != ids ">
and id in


Loading…
Cancel
Save