Commit 0ae089c6 by zhiwj

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer
parents 363cc7b7 76e87203
......@@ -32,7 +32,9 @@ public enum EnterpriseInitCodeEnum {
COMPLETE_DATA_COUNT_CONFIG("completeDataCountConfig", "完成数据统计配置", 6),
CONFIG_EFFECTIVE_ORDER("configEffectiveOrder", "完成有效订单的配置", 6),
CONFIG_PAY("configPay", "完成实付的配置", 6),
INTI_MEMBER_CARD_SMS("initMemberCardSmsTemplate", "初始化会员卡的短信模板", 7);
INTI_MEMBER_CARD_SMS("initMemberCardSmsTemplate", "初始化会员卡的短信模板", 7),
COMPLETE_MEMBER_INDEX("completeMemberIndex", "完成会员索引初始化", 8),
COMPLETE_GOODS_INDEX("completeGoodsIndex", "完成商品索引初始化", 9);
private String code;
private String message;
......
......@@ -19,6 +19,28 @@ public interface EnterpriseInitApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


 */
ServiceResponse<Void> addMemberCardInitConfig(Integer enterpriseId);
/**
* 完成会员索引初始化
* @Title: completeMemberIndex

* @Description:

* @author guojuxing
* @param enterpriseId

* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


*/
ServiceResponse<Void> completeMemberIndex(Integer enterpriseId);
/**
* 完成商品索引初始化
* @Title: completeGoodsIndex

* @Description:

* @author guojuxing
* @param enterpriseId

* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


*/
ServiceResponse<Void> completeGoodsIndex(Integer enterpriseId);
/**
* 新建会员等级初始化
* @Title: addMemberGradeInitConfig

......
......@@ -70,8 +70,8 @@ public class EnterpriseInitApiServiceImpl implements EnterpriseInitApiService{
.getListByParentCode(EnterpriseInitCodeEnum.COMPLETE_MEMBER_CARD_CONFIG.getCode());
if (memberCardConfigList.contains(configCode)) {
//会员组接口初始化
ServiceResponse<Void> memberInitResult = memberInitApiService.configInit(enterpriseId);
LOGGER.warn("新增商户-会员组接口初始化结果:{}", JSONObject.toJSONString(memberInitResult));
// ServiceResponse<Void> memberInitResult = memberInitApiService.configInit(enterpriseId);
// LOGGER.warn("新增商户-会员组接口初始化结果:{}", JSONObject.toJSONString(memberInitResult));
}
}
}
......@@ -84,6 +84,20 @@ public class EnterpriseInitApiServiceImpl implements EnterpriseInitApiService{
}
@Override
public ServiceResponse<Void> completeMemberIndex(Integer enterpriseId) {
ServiceResponse<Void> memberInitResult = memberInitApiService.configInit(enterpriseId);
if (memberInitResult.isSuccess()) {
return initByConfigCode(EnterpriseInitCodeEnum.COMPLETE_MEMBER_INDEX.getCode(), enterpriseId);
}
return ServiceResponse.failure(memberInitResult.getCode(), memberInitResult.getMessage());
}
@Override
public ServiceResponse<Void> completeGoodsIndex(Integer enterpriseId) {
return initByConfigCode(EnterpriseInitCodeEnum.COMPLETE_GOODS_INDEX.getCode(), enterpriseId);
}
@Override
public ServiceResponse<Void> addMemberGradeInitConfig(Integer enterpriseId) {
return initByConfigCode(EnterpriseInitCodeEnum.CREATE_MEMBER_GRADE.getCode(), enterpriseId);
}
......
......@@ -8,6 +8,7 @@ import com.gic.authcenter.security.core.constant.DataResourceEnum;
import com.gic.authcenter.security.core.dto.AuthcenterUserDetails;
import com.gic.enterprise.constants.Constants;
import com.gic.enterprise.dto.*;
import com.gic.enterprise.utils.LicenseUtils;
import com.gic.marketing.api.service.sms.SmsOuterApiService;
import com.gic.member.config.api.dto.OwnerMemberCardDTO;
import com.gic.member.config.api.service.MemberCardApiService;
......@@ -203,17 +204,18 @@ public class EnterpriseController {
listResult.forEach(e -> {
List<ApplicationLicenseDTO> tempLicense = licenseMap.get(Long.valueOf(e.getEnterpriseId()));
if (CollectionUtils.isNotEmpty(tempLicense)) {
Set<String> licenseCodeSet = new HashSet<>(Arrays.asList("165165", "member_card", "wxapp", "wxfwh"));
Set<String> licenseCodeSet = new HashSet<>(Arrays.asList(LicenseUtils.STORE_LICENSE_CODE,
LicenseUtils.MEMBER_CARD_LICENSE_CODE, LicenseUtils.WECHAT_LICENSE_CODE, LicenseUtils.SERVICE_CARD_LICENSE_CODE));
Map<String, Integer> showLicenseMap = new HashMap<>(8);
tempLicense.forEach(license -> {
if (licenseCodeSet.contains(license.getLicenseCode())) {
showLicenseMap.put(license.getLicenseCode(), license.getQuantity());
}
});
Integer memberCardNum = showLicenseMap.get("member_card") == null ? 0 : showLicenseMap.get("member_card");
Integer wxfwhNum = showLicenseMap.get("wxfwh") == null ? 0 : showLicenseMap.get("wxfwh");
Integer wxappNum = showLicenseMap.get("wxapp") == null ? 0 : showLicenseMap.get("wxapp");
Integer storeNum = showLicenseMap.get("165165") == null ? 0 : showLicenseMap.get("165165");
Integer memberCardNum = showLicenseMap.get(LicenseUtils.MEMBER_CARD_LICENSE_CODE) == null ? 0 : showLicenseMap.get(LicenseUtils.MEMBER_CARD_LICENSE_CODE);
Integer wxfwhNum = showLicenseMap.get(LicenseUtils.SERVICE_CARD_LICENSE_CODE) == null ? 0 : showLicenseMap.get(LicenseUtils.SERVICE_CARD_LICENSE_CODE);
Integer wxappNum = showLicenseMap.get(LicenseUtils.WECHAT_LICENSE_CODE) == null ? 0 : showLicenseMap.get(LicenseUtils.WECHAT_LICENSE_CODE);
Integer storeNum = showLicenseMap.get(LicenseUtils.STORE_LICENSE_CODE) == null ? 0 : showLicenseMap.get(LicenseUtils.STORE_LICENSE_CODE);
e.setServiceInfo(memberCardNum + "-" + wxfwhNum + "-" + wxappNum + "-" + storeNum);
}
});
......@@ -652,6 +654,16 @@ public class EnterpriseController {
.collect(Collectors.toList())));
}
@RequestMapping("/init-member-index")
public RestResponse completeMemberIndex(Integer enterpriseId) {
return ResultControllerUtils.commonResult(enterpriseInitApiService.completeMemberIndex(enterpriseId));
}
@RequestMapping("/init-goods-index")
public RestResponse completeGoodsIndex(Integer enterpriseId) {
return ResultControllerUtils.commonResult(enterpriseInitApiService.completeGoodsIndex(enterpriseId));
}
@RequestMapping("/list-coupon")
public RestResponse listCoupon(BigDecimal price, Long isvId, Long enterpriseId, Long serveId, Long skuId) {
return ResultControllerUtils.commonResult(
......
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