|
|
|
@@ -571,34 +571,41 @@ public class WxCouponController extends BaseController { |
|
|
|
return new ResultData(wxCouponMallService.list(wxCouponMall,true)); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("商场查询:平台券商场列表") |
|
|
|
@GetMapping("/couponMalls") |
|
|
|
@ApiOperation("平台券商场列表") |
|
|
|
@GetMapping("/getCouponMall") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "ids", value = "ids[]", dataType = "Long", paramType = "query", required = true)}) |
|
|
|
public ResultData getMallList(Long[] ids) { |
|
|
|
if (null == ids || ids.length <= 0 ) { |
|
|
|
return new ResultData(ResultData.ERROR, "缺少参数ids"); |
|
|
|
} |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)}) |
|
|
|
public ResultData getCouponMall(Long id) { |
|
|
|
//如果是集团查询,则查询所有的,如果是商场查询,则只查询商场的 |
|
|
|
WxCouponMall wxCouponMall = new WxCouponMall(); |
|
|
|
TenantEntity tenantEntity = getTenantInfo(); |
|
|
|
if (null == tenantEntity.getParentTenantId()) { |
|
|
|
wxCouponMall.updateTenantInfo(tenantEntity); |
|
|
|
wxCouponMall.setProductId(id); |
|
|
|
}else { |
|
|
|
wxCouponMall.setTenantId(tenantEntity.getParentTenantId()); |
|
|
|
//一个商场,每个平台券只有一条记录 |
|
|
|
wxCouponMall.setMallTenantId(tenantEntity.getTenantId()); |
|
|
|
wxCouponMall.setProductId(id); |
|
|
|
} |
|
|
|
//一个商场,每个平台券只有一条记录 |
|
|
|
wxCouponMall.setMallTenantId(tenantEntity.getTenantId()); |
|
|
|
wxCouponMall.setProductIds(Arrays.asList(ids)); |
|
|
|
List<WxCouponMall> mallList= wxCouponMallService.list(wxCouponMall,false); |
|
|
|
if (null == mallList || mallList.size() <= 0 ) { |
|
|
|
return new ResultData(); |
|
|
|
if (null != mallList && mallList.size() > 0 ) { |
|
|
|
boolean isComplete = true; |
|
|
|
for (int i = 0 ; i < mallList.size(); i ++) { |
|
|
|
WxCouponMall cm = mallList.get(i); |
|
|
|
if (EnumCouponMallStatus.UNFINISED.getCode() == cm.getStatus()) { |
|
|
|
isComplete = false; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (isComplete) { |
|
|
|
return new ResultData("{\"isCompleted\":1}"); |
|
|
|
}else { |
|
|
|
return new ResultData("{\"isCompleted\":0}"); |
|
|
|
} |
|
|
|
}else { |
|
|
|
return new ResultData("{\"isCompleted\":0}"); |
|
|
|
} |
|
|
|
Map<Long,WxCouponMall> productMallMap = new HashMap<Long,WxCouponMall>(); |
|
|
|
for (int i = 0 ; i < mallList.size(); i ++) { |
|
|
|
WxCouponMall cm = mallList.get(i); |
|
|
|
productMallMap.put(cm.getProductId(), cm); |
|
|
|
} |
|
|
|
return new ResultData(productMallMap); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("商场设置平台券商户") |
|
|
|
|