|
|
|
@@ -4,14 +4,9 @@ import com.iformall.annotation.AuthIgnore; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.WxAppinfo; |
|
|
|
import com.iformall.domain.po.WxLevelConfig; |
|
|
|
import com.iformall.domain.po.WxMall; |
|
|
|
import com.iformall.domain.po.WxScoreRules; |
|
|
|
import com.iformall.service.WxAppinfoService; |
|
|
|
import com.iformall.service.WxLevelConfigService; |
|
|
|
import com.iformall.service.WxMallService; |
|
|
|
import com.iformall.service.WxScoreRulesService; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.EnumMerchantStatus; |
|
|
|
import com.iformall.service.*; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@@ -48,9 +43,12 @@ public class WxMallController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private WxLevelConfigService wxLevelConfigService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxMerchantService wxMerchantService; |
|
|
|
|
|
|
|
|
|
|
|
@AuthIgnore |
|
|
|
@ApiOperation("根据appId获取") |
|
|
|
@ApiOperation("商场图标") |
|
|
|
@GetMapping("/getAppIcon") |
|
|
|
@ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true) |
|
|
|
public ResultData getAppIcon(String appId) { |
|
|
|
@@ -69,7 +67,7 @@ public class WxMallController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@AuthIgnore |
|
|
|
@ApiOperation("根据appId获取") |
|
|
|
@ApiOperation("商场提示信息") |
|
|
|
@GetMapping("/getWeapNote") |
|
|
|
@ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true) |
|
|
|
public ResultData getWeapNote(String appId) { |
|
|
|
@@ -86,37 +84,48 @@ public class WxMallController extends BaseController { |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", resultMap); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("根据appId获取") |
|
|
|
@ApiOperation("商场信息") |
|
|
|
@GetMapping("/mallInfo") |
|
|
|
@ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true) |
|
|
|
public ResultData getMallInfo(String appId) { |
|
|
|
WxAppinfo appInfo = wxAppinfoService.getByAppId(appId); |
|
|
|
if (appInfo == null) { |
|
|
|
return new ResultData(ErrorCode.APP_ID_NOT_FOUND); |
|
|
|
} |
|
|
|
WxMall mall = wxMallService.getByTenantId(appInfo.getTenantId()); |
|
|
|
public ResultData getMallInfo() { |
|
|
|
WxCUser user = getUser(); |
|
|
|
WxMall mall = wxMallService.getByTenantId(user.getTenantId()); |
|
|
|
if (mall == null) { |
|
|
|
return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", mall); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("根据appId获取") |
|
|
|
@ApiOperation("成长值相关信息") |
|
|
|
@GetMapping("/scoreLevelInfo") |
|
|
|
@ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true) |
|
|
|
public ResultData getScoreLevelInfo(String appId) { |
|
|
|
WxAppinfo appInfo = wxAppinfoService.getByAppId(appId); |
|
|
|
if (appInfo == null) { |
|
|
|
return new ResultData(ErrorCode.APP_ID_NOT_FOUND); |
|
|
|
} |
|
|
|
public ResultData getScoreLevelInfo() { |
|
|
|
WxCUser user = getUser(); |
|
|
|
Map map = new HashMap(); |
|
|
|
WxScoreRules scoreRules = wxScoreRulesService.getScoreRules(appInfo.getTenantId()); |
|
|
|
WxScoreRules scoreRules = wxScoreRulesService.getScoreRules(user.getTenantId()); |
|
|
|
map.put("score", scoreRules); |
|
|
|
List<WxLevelConfig> levelConfigList = wxLevelConfigService.getByTenantId(appInfo.getTenantId()); |
|
|
|
List<WxLevelConfig> levelConfigList = wxLevelConfigService.getByTenantId(user.getTenantId()); |
|
|
|
boolean disscountEnable = false; |
|
|
|
for(WxLevelConfig levelConfig: levelConfigList) { |
|
|
|
if (levelConfig.getDiscountEnable() > 0 ) { |
|
|
|
disscountEnable = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("levelList", levelConfigList); |
|
|
|
map.put("discountEnable", disscountEnable); |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", map); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("获取打折商户列表") |
|
|
|
@GetMapping("/discountMerchantList") |
|
|
|
public ResultData getMerchantId() { |
|
|
|
WxCUser user = getUser(); |
|
|
|
WxMerchant merchantQ = new WxMerchant(); |
|
|
|
merchantQ.setTenantId(user.getTenantId()); |
|
|
|
merchantQ.setStatus(EnumMerchantStatus.VALID.getCode()); |
|
|
|
List<WxMerchant> list = wxMerchantService.getDisCountList(merchantQ); |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", list); |
|
|
|
} |
|
|
|
|
|
|
|
@AuthIgnore |
|
|
|
@ApiOperation("获取后端版本号") |
|
|
|
@GetMapping("/version") |
|
|
|
|