Commit 47e2a79c by zhiwj

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer
parents df610bda 5c1df9e6
......@@ -8,16 +8,6 @@ import java.util.List;
* @date 2019/7/18 11:22 AM
*/
public enum EnterpriseInitCodeEnum {
CREATE_MEMBER_CARD("createMemberCard", "至少新建一张会员卡", 3),
CREATE_MEMBER_GRADE("createMemberGrade", "至少新建一个会员等级", 3),
CREATE_BELONG_STRATEGY("createBelongStrategy", "至少新建一个归属策略", 3),
CREATE_INTEGRAL_STRATEGY("createIntegralStrategy", "至少新建一个积分策略", 3),
CONFIG_USER_MERGE_STRATEGY("configUserMergeStrategy", "配置并保存用户合并策略", 3),
BIND_SERVICE_NUMBER("bindServiceNumber", "至少绑定一个服务号", 5),
PERFECT_AUTO_REPLY_CONFIG("perfectAutoReplyConfig", "完善自动回复配置", 5),
PERFECT_MENU_CONFIG("perfectMenuConfig", "完善自定义菜单配置", 5),
BIND_WECHAT("bindWeChat", "至少绑定一个小程序", 4),
PERFECT_WECHAT_PAGE("perfectWeChatPage", "完善小程序页面装修", 4),
SHORT_MESSAGE_SERVICE_CONFIG("shortMessageServiceConfig", "完成短信业务配置", 1),
COMPLETE_STORE_CONFIG("completeStoreConfig", "完成门店基础配置", 2),
CREATE_STORE_REGION("createStoreRegion", "至少新建一个门店域", 2),
......@@ -25,11 +15,24 @@ public enum EnterpriseInitCodeEnum {
CREATE_STORE_BRAND("createStoreBrand", "至少新建一个店招品牌", 2),
CREATE_STORE_STATUS_STRATEGY("createStoreStatusStrategy", "至少新建一个门店启用状态策略", 2),
COMPLETE_MEMBER_CARD_CONFIG("completeMemberCardConfig", "完成会员卡配置", 3),
COMPLETE_SERVICE_NUMBER_CONFIG("completeServiceNumberConfig", "完成服务号配置", 5),
CREATE_MEMBER_CARD("createMemberCard", "至少新建一张会员卡", 3),
ENABLE_MEMBER_CARD_FIELD("enableMemberCardField", "至少启用一个会员卡字段", 3),
CREATE_MEMBER_GRADE("createMemberGrade", "至少新建一个会员等级", 3),
CREATE_BELONG_STRATEGY("createBelongStrategy", "至少新建一个归属策略", 3),
CREATE_INTEGRAL_STRATEGY("createIntegralStrategy", "至少新建一个积分策略", 3),
CONFIG_USER_MERGE_STRATEGY("configUserMergeStrategy", "配置并保存用户合并策略", 3),
COMPLETE_WECHAT_CONFIG("completeWeChatConfig", "完成小程序配置", 4),
BIND_WECHAT("bindWeChat", "至少绑定一个小程序", 4),
COMPLETE_MANAGER_CARD_CONFIG("completeManagerCardConfig", "完善小程序进入管理卡的配置", 4),
PERFECT_WECHAT_PAGE("perfectWeChatPage", "完善小程序页面装修", 4),
COMPLETE_SERVICE_NUMBER_CONFIG("completeServiceNumberConfig", "完成服务号配置", 5),
BIND_SERVICE_NUMBER("bindServiceNumber", "至少绑定一个服务号", 5),
PERFECT_AUTO_REPLY_CONFIG("perfectAutoReplyConfig", "完善自动回复配置", 5),
PERFECT_MENU_CONFIG("perfectMenuConfig", "完善自定义菜单配置", 5),
COMPLETE_DATA_COUNT_CONFIG("completeDataCountConfig", "完成数据统计配置", 6),
CONFIG_EFFECTIVE_ORDER("configEffectiveOrder", "完成有效订单的配置", 6),
CONFIG_PAY("configPay", "完成实付的配置", 6);
CONFIG_PAY("configPay", "完成实付的配置", 6),
INTI_MEMBER_CARD_SMS("initMemberCardSmsTemplate", "初始化会员卡的短信模板", 7);
private String code;
private String message;
......
......@@ -169,6 +169,33 @@ public interface EnterpriseInitApiService {
ServiceResponse<Void> shortMessageServiceConfig(Integer enterpriseId);
/**
* 至少启用一个会员卡字段
* @Title: enableMemberCardField

* @Description:

* @author guojuxing
* @param enterpriseId

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


*/
ServiceResponse<Void> enableMemberCardField(Integer enterpriseId);
/**
* 初始化会员卡的短信模板
* @param enterpriseId
* @return
*/
ServiceResponse<Void> initMemberCardSmsTemplate(Integer enterpriseId);
/**
* 完善小程序进入管理卡的配置
* @Title: completeManagerCardConfig

* @Description:

* @author guojuxing
* @param enterpriseId

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


*/
ServiceResponse<Void> completeManagerCardConfig(Integer enterpriseId);
/**
* 状态改为未初始化状态
* @Title: unInitByConfigCode

* @Description:
......@@ -200,4 +227,14 @@ public interface EnterpriseInitApiService {

 */
ServiceResponse<List<EnterpriseInitDTO>> listByEnterpriseId(Integer enterpriseId);
/**
* 本来应该是新建商户的时候初始化数据。但是因为会调整,所以进行手工初始化
* @Title: initEnterpriseData

* @Description:

* @author guojuxing
* @param enterpriseIdList

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


*/
ServiceResponse<Void> initEnterpriseData(List<Integer> enterpriseIdList);
}
......@@ -164,4 +164,14 @@ public interface WmStoreApiService {
* @return com.gic.api.base.commons.ServiceResponse<com.gic.api.base.commons.Page<com.gic.enterprise.dto.wm.WmStoreCouponConfigDTO>>


*/
ServiceResponse<Page<WmStoreCouponConfigDTO>> pageCouponConfig(CouponConfigQO params);
/**
* 卡券删除消息通知,gic卡券删除
* @Title: deleteWmGicCoupon

* @Description:

* @author guojuxing
* @param gicCouponId

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


*/
ServiceResponse<Void> deleteWmGicCoupon(Long gicCouponId);
}
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabEnterpriseWhiteList;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -55,5 +56,5 @@ public interface TabEnterpriseWhiteListMapper {
TabEnterpriseWhiteList getEnterpriseWhiteList(Integer enterpriseId);
List<TabEnterpriseWhiteList> listEnterpriseWhiteList(String search);
List<TabEnterpriseWhiteList> listEnterpriseWhiteList(@Param("search") String search);
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabWmStoreCouponConfig;
import com.gic.enterprise.qo.wm.CouponConfigQO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -55,4 +56,6 @@ public interface TabWmStoreCouponConfigMapper {
int updateByPrimaryKey(TabWmStoreCouponConfig record);
List<TabWmStoreCouponConfig> getCouponConfig(CouponConfigQO params);
int deleteWmGicCoupon(@Param("gicCouponId") String gicCouponId);
}
\ No newline at end of file
......@@ -30,4 +30,6 @@ public interface WmStoreCouponConfigService {
List<TabWmStoreCouponConfig> getCouponConfig(CouponConfigQO params);
Page<TabWmStoreCouponConfig> pageCouponConfig(CouponConfigQO params);
int deleteWmGicCoupon(String gicCouponId);
}
......@@ -40,4 +40,9 @@ public class WmStoreCouponConfigServiceImpl implements WmStoreCouponConfigServic
List<TabWmStoreCouponConfig> list = tabWmStoreCouponConfigMapper.getCouponConfig(params);
return (Page<TabWmStoreCouponConfig>) list;
}
@Override
public int deleteWmGicCoupon(String gicCouponId) {
return tabWmStoreCouponConfigMapper.deleteWmGicCoupon(gicCouponId);
}
}
......@@ -12,6 +12,7 @@ import com.gic.enterprise.service.EnterpriseInitApiService;
import com.gic.enterprise.service.EnterpriseInitService;
import com.gic.enterprise.service.EnterpriseService;
import com.gic.member.api.service.MemberInitApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -169,6 +170,21 @@ public class EnterpriseInitApiServiceImpl implements EnterpriseInitApiService{
}
@Override
public ServiceResponse<Void> enableMemberCardField(Integer enterpriseId) {
return initByConfigCode(EnterpriseInitCodeEnum.ENABLE_MEMBER_CARD_FIELD.getCode(), enterpriseId);
}
@Override
public ServiceResponse<Void> initMemberCardSmsTemplate(Integer enterpriseId) {
return initByConfigCode(EnterpriseInitCodeEnum.INTI_MEMBER_CARD_SMS.getCode(), enterpriseId);
}
@Override
public ServiceResponse<Void> completeManagerCardConfig(Integer enterpriseId) {
return initByConfigCode(EnterpriseInitCodeEnum.COMPLETE_MANAGER_CARD_CONFIG.getCode(), enterpriseId);
}
@Override
public ServiceResponse<Void> unInitByConfigCode(String configCode, Integer enterpriseId) {
if (!EnterpriseInitCodeEnum.isRightCode(configCode)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "初始化配置代码参数有误");
......@@ -205,5 +221,13 @@ public class EnterpriseInitApiServiceImpl implements EnterpriseInitApiService{
return ServiceResponse.success(EntityUtil.changeEntityListNew(EnterpriseInitDTO.class, listByParentId));
}
@Override
public ServiceResponse<Void> initEnterpriseData(List<Integer> enterpriseIdList) {
if (CollectionUtils.isNotEmpty(enterpriseIdList)) {
enterpriseIdList.forEach(e -> enterpriseInitService.initEnterpriseConfigInfo(e));
}
return ServiceResponse.success();
}
}
......@@ -10,6 +10,8 @@ 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.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -32,6 +34,7 @@ import com.gic.enterprise.qo.wm.CouponConfigQO;
@Service("wmStoreApiService")
public class WmStoreApiServiceImpl implements WmStoreApiService {
private final static Logger LOGGER = LogManager.getLogger(WmStoreApiServiceImpl.class);
@Autowired
private WmStoreService wmStoreService;
@Autowired
......@@ -318,6 +321,19 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
return ServiceResponse.success(resultPage);
}
@Override
public ServiceResponse<Void> deleteWmGicCoupon(Long gicCouponId) {
LOGGER.info("删除gic卡券参数:{}", gicCouponId);
if (gicCouponId == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "卡券ID为空");
}
int count = wmStoreCouponConfigService.deleteWmGicCoupon(gicCouponId.toString());
if (count < 1) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "卡券ID有误,无数据删除");
}
return ServiceResponse.success();
}
private ServiceResponse validWmMemberCardConfig(WmMemberCardConfigDTO dto) {
if (dto.getEnterpriseId() == null) {
......
......@@ -283,7 +283,7 @@
a.company_name companyName,
a.create_time createTime,
a.is_init_complete isInitComplete,
GROUP_CONCAT(b.upper_limit separator '-') licenseUpperLimitStr,
GROUP_CONCAT(b.upper_limit ORDER BY b.enterprise_license_id separator '-') licenseUpperLimitStr,
a.version_code versionCode,
a.version_name versionName,
a.audit_time expirationTime,
......
......@@ -167,7 +167,7 @@
select <include refid="Base_Column_List"></include>
from tab_wm_store_coupon_config
where status = 1
where 1 = 1
<if test="wmMallStoreId != null and wmMallStoreId != '' ">
and wm_mall_store_id = #{wmMallStoreId}
</if>
......@@ -185,6 +185,7 @@
</if>
<if test="onlyShowEffective != null and onlyShowEffective == 1">
and (gic_coupon_expire is null or TIMESTAMPDIFF(DAY, now(), gic_coupon_expire) >= 0)
and status = 1
</if>
<if test="couponName != null and couponName != '' ">
and (gic_coupon_name like concat('%', #{couponName}, '%') or wm_coupon_name like concat('%', #{couponName}, '%'))
......@@ -196,4 +197,12 @@
order by create_time desc
</if>
</select>
<update id="deleteWmGicCoupon">
update tab_wm_store_coupon_config set status = 0
where gic_coupon_id = #{gicCouponId}
and status = 1
</update>
</mapper>
\ No newline at end of file
package com.gic.enterprise.web.controller;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.AppletDataAssetAreaDTO;
import com.gic.enterprise.dto.AppletDecorationConfigDTO;
import com.gic.enterprise.service.AppletDecorationConfigApiService;
import com.gic.enterprise.service.EnterpriseInitApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.enterprise.web.vo.AppletCardRealtionVO;
......@@ -19,13 +21,20 @@ public class AppletDecorationConfigController {
@Autowired
private AppletDecorationConfigApiService appletDecorationConfigApiService;
@Autowired
private EnterpriseInitApiService enterpriseInitApiService;
@RequestMapping("/save")
public RestResponse save(AppletDecorationConfigDTO dto, String dataAreaJson) {
AppletDataAssetAreaDTO dataAssetAreaDTO = JSON.parseObject(dataAreaJson, AppletDataAssetAreaDTO.class);
dto.setAppletDataAssetArea(dataAssetAreaDTO);
dto.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
return ResultControllerUtils.commonResult(appletDecorationConfigApiService.save(dto));
ServiceResponse<Integer> result = appletDecorationConfigApiService.save(dto);
if (result.isSuccess()) {
//初始化
enterpriseInitApiService.completeManagerCardConfig(UserDetailUtils.getUserDetail().getEnterpriseId());
}
return ResultControllerUtils.commonResult(result);
}
@RequestMapping("/edit")
......
......@@ -193,6 +193,11 @@
<artifactId>gic-authcenter-api</artifactId>
<version>${gic-authcenter-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-member-config-api</artifactId>
<version>${gic-member-config-api}</version>
</dependency>
</dependencies>
<dependencyManagement>
......
......@@ -2,10 +2,13 @@ package com.gic.operation.web.controller;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
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.member.config.api.service.MemberCardApiService;
import com.gic.operation.web.vo.MemberCardVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
......@@ -103,6 +106,8 @@ public class EnterpriseController {
private MarketUserApiService marketUserApiService;
@Autowired
private MarketAppCategoryApiService marketAppCategoryApiService;
@Autowired
private MemberCardApiService memberCardApiService;
@RequestMapping("/save-enterprise")
public RestResponse saveEnterprise(
......@@ -237,6 +242,29 @@ public class EnterpriseController {
return RestResponse.success(changeListToTree(0, dtoList));
}
@RequestMapping("/list-all-member-card")
public RestResponse listAllMemberCard(Integer enterpriseId) {
return ResultControllerUtils.commonResult(memberCardApiService.getAll(enterpriseId), MemberCardVO.class);
}
/**
* 初始化会员卡的短信模板
* @Title: initMemberCardSmsTemplate

* @Description:

* @author guojuxing
* @param enterpriseId

* @return com.gic.commons.webapi.reponse.RestResponse


*/
@RequestMapping("/init-member-card-sms-template")
public RestResponse initMemberCardSmsTemplate(Integer enterpriseId) {
//todo
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "初始化会员模板还未开发完毕");
// ServiceResponse<Void> initMemberCardSmsTemplateResult = enterpriseInitApiService
// .initMemberCardSmsTemplate(enterpriseId);
// return ResultControllerUtils.commonResult(initMemberCardSmsTemplateResult);
}
@RequestMapping("/edit-enterprise")
public RestResponse editEnterprise(EnterpriseDTO enterpriseDTO) {
return ResultControllerUtils.commonResult(enterpriseApiService.editEnterprise(enterpriseDTO));
......@@ -539,6 +567,21 @@ public class EnterpriseController {
return ResultControllerUtils.commonResult(enterpriseApiService.editEnterpriseInfo(enterpriseDTO));
}
@RequestMapping("/init-enterprise-data")
public RestResponse initEnterpriseDAta(String enterpriseIds) {
if (StringUtils.isBlank(enterpriseIds)) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "参数为空");
}
return ResultControllerUtils.commonResult(enterpriseInitApiService
.initEnterpriseData(Arrays.asList(enterpriseIds.split(","))
.stream()
.filter(e -> StringUtils.isNumeric(e))
.mapToInt(e -> Integer.parseInt(e))
.boxed()
.collect(Collectors.toList())));
}
@RequestMapping("/list-coupon")
public RestResponse listCoupon(BigDecimal price, Long isvId, Long enterpriseId, Long serveId, Long skuId) {
return ResultControllerUtils.commonResult(
......
......@@ -9,6 +9,8 @@ import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -37,6 +39,8 @@ import com.gic.open.api.service.market.MarketUserApiService;
@RestController
public class LoginController {
private static final Logger LOGGER = LogManager.getLogger(LoginController.class);
@Autowired
private OperationUserApiService operationUserApiService;
@Autowired
......@@ -93,6 +97,8 @@ public class LoginController {
@RequestMapping("login-gic")
public RestResponse login(Integer enterpriseId, String redirectUrl) throws IOException {
long startTime = System.currentTimeMillis();
Config config = ConfigService.getConfig("COMMON.4.0-gic-properties");
String url = config.getProperty("service_host", "").replace("/gic", "");
if (StringUtils.isBlank(redirectUrl)) {
......@@ -155,7 +161,7 @@ public class LoginController {
}
//查询全部的操作模块
Map<String, MenuInfo> moduleMap = new HashMap<>(16);
ServiceResponse<List<MenuDTO>> allGicMenu = menuApiService.getSuperAdminMenuNotTree(enterpriseId);
ServiceResponse<List<MenuDTO>> allGicMenu = menuApiService.getAllMenuNotTree(enterpriseDTO.getVersionCode());
if (allGicMenu.isSuccess()) {
List<MenuDTO> temp = allGicMenu.getResult();
List<MenuInfo> tempMenuInfoList = EntityUtil.changeEntityListNew(MenuInfo.class, temp);
......@@ -177,6 +183,8 @@ public class LoginController {
//塞缓存
token = UserDetailUtils.setUserDetail(userDetail);
LOGGER.info("单点登录所花时间:{}", System.currentTimeMillis() - startTime);
String SSO_LOGIN_URL = url + "/gic-auth-web/login-for-operation";
return RestResponse.success(SSO_LOGIN_URL + "?token=" + token + "&redirectUrl=" + redirectUrl);
}
......
package com.gic.operation.web.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
public class MemberCardVO implements Serializable{
private static final long serialVersionUID = 1276175656828771005L;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/**
* 会员卡基本信息表主键
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long cardConfigId;
private Integer ownerId;
private String cardCode;
private String cardName;
/**
* 1-自有,2-共享
*/
private Byte type;
private int gradeCount;
public Long getId() {
return id;
}
public MemberCardVO setId(Long id) {
this.id = id;
return this;
}
public Long getCardConfigId() {
return cardConfigId;
}
public MemberCardVO setCardConfigId(Long cardConfigId) {
this.cardConfigId = cardConfigId;
return this;
}
public Integer getOwnerId() {
return ownerId;
}
public MemberCardVO setOwnerId(Integer ownerId) {
this.ownerId = ownerId;
return this;
}
public String getCardCode() {
return cardCode;
}
public MemberCardVO setCardCode(String cardCode) {
this.cardCode = cardCode;
return this;
}
public String getCardName() {
return cardName;
}
public MemberCardVO setCardName(String cardName) {
this.cardName = cardName;
return this;
}
public Byte getType() {
return type;
}
public MemberCardVO setType(Byte type) {
this.type = type;
return this;
}
public int getGradeCount() {
return gradeCount;
}
public MemberCardVO setGradeCount(int gradeCount) {
this.gradeCount = gradeCount;
return this;
}
}
......@@ -91,4 +91,5 @@
<dubbo:reference interface="com.gic.mall.share.api.service.PayConfigApiService" id="payConfigApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.authcenter.api.service.GicDepartmentService" id="gicDepartmentService" timeout="6000" />
<dubbo:reference interface="com.gic.member.config.api.service.MemberCardApiService" id="memberCardApiService" timeout="6000" />
</beans>
\ No newline at end of file
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