Commit e6c39311 by guojuxing

会员卡域和企业查询的微盟店铺信息

parent 3cca38b8
......@@ -101,10 +101,10 @@ public interface WmStoreApiService {
* @Description:

* @author guojuxing
* @param enterpriseId 商户ID
* @param appId
小程序ID
* @param memberCardAreaId
会员卡域ID
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.enterprise.dto.wm.WmCouponPackageDTO>>


*/
ServiceResponse<List<WmCouponPackageDTO>> getWmListByAppId(Integer enterpriseId, String appId);
ServiceResponse<List<WmCouponPackageDTO>> getWmListByAppId(Integer enterpriseId, Long memberCardAreaId);
/**
* 根据微盟主账号查询配置
......
......@@ -196,6 +196,11 @@
<artifactId>gic-thirdparty-sdk</artifactId>
<version>${gic-thirdparty-sdk}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-weimob-api</artifactId>
<version>${gic-weimob-api}</version>
</dependency>
</dependencies>
<build>
......
......@@ -67,7 +67,7 @@ public interface TabWmStoreMapper {
int countByStoreName(@Param("storeName") String storeName, @Param("wmMallStoreId") Integer wmMallStoreId, @Param("enterpriseId") Integer enterpriseId);
List<TabWmStore> listWmStore(@Param("enterpriseId") Integer enterpriseId, @Param("appId") String appId);
List<TabWmStore> listWmStore(@Param("enterpriseId") Integer enterpriseId, @Param("appId") String appId, @Param("authStatus") Integer authStatus);
TabWmStore getByWmMainAccount(String wmMainAccount);
}
\ No newline at end of file
......@@ -62,5 +62,10 @@ public interface WmStoreService {
List<TabWmStore> listWmStore(Integer enterpriseId);
List<TabWmStore> getWmListByAppId(Integer enterpriseId, String appId);
/**
* 已授权店铺
* @param enterpriseId
* @return
*/
List<TabWmStore> getHasAuth(Integer enterpriseId);
}
......@@ -65,11 +65,11 @@ public class WmStoreServiceImpl implements WmStoreService{
@Override
public List<TabWmStore> listWmStore(Integer enterpriseId) {
return tabWmStoreMapper.listWmStore(enterpriseId, null);
return tabWmStoreMapper.listWmStore(enterpriseId, null, null);
}
@Override
public List<TabWmStore> getWmListByAppId(Integer enterpriseId, String appId) {
return tabWmStoreMapper.listWmStore(enterpriseId, appId);
public List<TabWmStore> getHasAuth(Integer enterpriseId) {
return tabWmStoreMapper.listWmStore(enterpriseId, null, 1);
}
}
......@@ -3,9 +3,11 @@ package com.gic.enterprise.service.outer.impl;
import java.util.*;
import java.util.stream.Collectors;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.wm.*;
import com.gic.enterprise.entity.TabWmStoreSyncLog;
import com.gic.enterprise.service.*;
import com.gic.weimob.api.service.WeimobMerchantService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -38,6 +40,8 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
private WmStoreCouponConfigService wmStoreCouponConfigService;
@Autowired
private WmStoreSyncLogService wmStoreSyncLogService;
@Autowired
private WeimobMerchantService weimobMerchantService;
@Override
public ServiceResponse<Integer> saveWmStore(WmStoreDTO wmStoreDTO) {
......@@ -138,8 +142,11 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
}
@Override
public ServiceResponse<List<WmCouponPackageDTO>> getWmListByAppId(Integer enterpriseId, String appId) {
List<TabWmStore> list = wmStoreService.getWmListByAppId(enterpriseId, appId);
public ServiceResponse<List<WmCouponPackageDTO>> getWmListByAppId(Integer enterpriseId, Long memberCardAreaId) {
if (memberCardAreaId == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "会员卡域ID为空");
}
List<TabWmStore> list = wmStoreService.getHasAuth(enterpriseId);
if (CollectionUtils.isNotEmpty(list)) {
return ServiceResponse.success(list
.stream()
......@@ -148,7 +155,10 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
ServiceResponse<TabWmStoreConfig> result = getWmConfig(e.getWmMallStoreId(), WmStoreConfigTypeEnum.COUPON_CONFIG);
if (result.isSuccess()) {
if ("2".equals(JSON.parseObject(result.getResult().getStoreConfigJson()).getString("couponMode"))) {
return true;
//
if (memberCardAreaId.toString().equals(getMemberCardArea(e.getWmMallStoreId()))) {
return true;
}
}
}
return false;
......@@ -162,6 +172,16 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
return ServiceResponse.success(Collections.emptyList());
}
private String getMemberCardArea(Integer wmMallStoreId) {
ServiceResponse<Long> result = weimobMerchantService.getMcuAreaId(wmMallStoreId);
if (result.isSuccess()) {
if (result.getResult() != null) {
return result.getResult().toString();
}
}
return null;
}
private ServiceResponse<TabWmStoreConfig> getWmConfig(Integer wmMallStoreId, WmStoreConfigTypeEnum typeEnum) {
TabWmStore record = wmStoreService.getByWmMallStoreId(wmMallStoreId);
if (record == null) {
......
......@@ -140,4 +140,6 @@
<dubbo:reference interface="com.gic.member.api.service.UserOwnerApiService" id="userOwnerApiService" timeout="60000" />
<dubbo:reference interface="com.gic.marketing.process.api.service.sms.SmsSendApiService" id="smsSendApiService" timeout="60000" />
<dubbo:reference interface="com.gic.wechat.business.api.service.wxa.WeixinWxaFunService" id="weixinWxaFunService" timeout="60000" />
<dubbo:reference interface="com.gic.weimob.api.service.WeimobMerchantService" id="weimobMerchantService" timeout="6000"/>
</beans>
......@@ -239,6 +239,9 @@
<if test="appId != null and appId != '' ">
and wm_appid = #{appId}
</if>
<if test="authStatus != null">
and auth_status = #{authStatus}
</if>
</select>
<select id="getByWmMainAccount" resultMap="BaseResultMap">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment