Commit bd71fa28 by zhiwj

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer
parents a2c7f99b 90203601
......@@ -13,8 +13,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<libraryVersion>4.0-SNAPSHOT</libraryVersion>
</properties>
......
package com.gic.enterprise.constant;
/**
* 商城模式
* @ClassName: MallModeEnum

* @Description: 

* @author guojuxing

* @date 2020/4/13 1:45 PM

*/
public enum MallModeEnum {
MICRO_MALL(1, "微商城模式"),
SMART_RETAIL(1, "智慧零售模式"),
;
private int code;
private String msg;
MallModeEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public static boolean isContain(Integer code) {
if (code == null) {
return false;
}
for (MallModeEnum modeEnum : values()) {
if (code.intValue() == modeEnum.getCode()) {
return true;
}
}
return false;
}
public int getCode() {
return code;
}
public MallModeEnum setCode(int code) {
this.code = code;
return this;
}
public String getMsg() {
return msg;
}
public MallModeEnum setMsg(String msg) {
this.msg = msg;
return this;
}
}
......@@ -10,8 +10,8 @@ public enum ThemeEnum {
BLACK_BLUE(1, "black-blue"),
RED(2, "red"),
BLACK_GOLDEN(3, "black-golden"),
DARK_GREEN(4, "dark_green"),
TINT_GREEN(5, "tint_green")
DARK_GREEN(4, "dark-green"),
TINT_GREEN(5, "tint-green")
;
private Integer code;
......
package com.gic.enterprise.dto;
import java.io.Serializable;
import java.util.Date;
/**
* 微盟商城-会员卡配置
* @ClassName: WmMemberCardConfigDTO

* @Description: 

* @author guojuxing

* @date 2020/4/13 4:15 PM

*/
public class WmMemberCardConfigDTO implements Serializable{
private static final long serialVersionUID = 698215421069218834L;
/**
*
*/
private Integer memberCardConfigId;
/**
*
*/
private Integer enterpriseId;
/**
* 微盟主账号(平台唯一),用于关联配置
*/
private String wmMainAccount;
/**
* 开卡方式 1:达摩开卡 2:微盟开卡
*/
private Integer openCardMode;
/**
* GIC会员归属信息同步微盟 1:开启 0:关闭
*/
private Integer gicMemberToWm;
/**
* 微盟会员导购关系同步GIC 1:开启 0:关闭
*/
private Integer wmMemberClerkToGic;
/**
* 微盟会员信息(包括门店关系)同步GIC 1:开启 0:关闭
*/
private Integer wmMemberToGic;
/**
* 1:有效
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getMemberCardConfigId() {
return memberCardConfigId;
}
public WmMemberCardConfigDTO setMemberCardConfigId(Integer memberCardConfigId) {
this.memberCardConfigId = memberCardConfigId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public WmMemberCardConfigDTO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getWmMainAccount() {
return wmMainAccount;
}
public WmMemberCardConfigDTO setWmMainAccount(String wmMainAccount) {
this.wmMainAccount = wmMainAccount;
return this;
}
public Integer getOpenCardMode() {
return openCardMode;
}
public WmMemberCardConfigDTO setOpenCardMode(Integer openCardMode) {
this.openCardMode = openCardMode;
return this;
}
public Integer getGicMemberToWm() {
return gicMemberToWm;
}
public WmMemberCardConfigDTO setGicMemberToWm(Integer gicMemberToWm) {
this.gicMemberToWm = gicMemberToWm;
return this;
}
public Integer getWmMemberClerkToGic() {
return wmMemberClerkToGic;
}
public WmMemberCardConfigDTO setWmMemberClerkToGic(Integer wmMemberClerkToGic) {
this.wmMemberClerkToGic = wmMemberClerkToGic;
return this;
}
public Integer getWmMemberToGic() {
return wmMemberToGic;
}
public WmMemberCardConfigDTO setWmMemberToGic(Integer wmMemberToGic) {
this.wmMemberToGic = wmMemberToGic;
return this;
}
public Integer getStatus() {
return status;
}
public WmMemberCardConfigDTO setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public WmMemberCardConfigDTO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public WmMemberCardConfigDTO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
package com.gic.enterprise.dto;
import java.io.Serializable;
import java.util.Date;
/**
* 微盟商城店铺
* @ClassName: WmStoreDTO

* @Description: 

* @author guojuxing

* @date 2020/4/13 10:44 AM

*/
public class WmStoreDTO implements Serializable{
private static final long serialVersionUID = 7199830254908520238L;
/**
*
*/
private Integer wmMallStoreId;
/**
*
*/
private Integer enterpriseId;
/**
* 微盟主账号
*/
private String wmMainAccount;
/**
* 微盟pid
*/
private String wmPid;
/**
* 微盟store_id
*/
private String wmStoreId;
/**
* 店铺名称
*/
private String wmPidName;
/**
* 商城模式 1:微商城模式 2:智慧零售模式
*/
private Integer mallMode;
/**
* 店招品牌
*/
private Integer storeBrandId;
/**
* 授权状态 0:未授权 1:已授权
*/
private Integer authStatus;
/**
* 1:有效
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getWmMallStoreId() {
return wmMallStoreId;
}
public WmStoreDTO setWmMallStoreId(Integer wmMallStoreId) {
this.wmMallStoreId = wmMallStoreId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public WmStoreDTO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getWmMainAccount() {
return wmMainAccount;
}
public WmStoreDTO setWmMainAccount(String wmMainAccount) {
this.wmMainAccount = wmMainAccount;
return this;
}
public String getWmPid() {
return wmPid;
}
public WmStoreDTO setWmPid(String wmPid) {
this.wmPid = wmPid;
return this;
}
public String getWmStoreId() {
return wmStoreId;
}
public WmStoreDTO setWmStoreId(String wmStoreId) {
this.wmStoreId = wmStoreId;
return this;
}
public String getWmPidName() {
return wmPidName;
}
public WmStoreDTO setWmPidName(String wmPidName) {
this.wmPidName = wmPidName;
return this;
}
public Integer getMallMode() {
return mallMode;
}
public WmStoreDTO setMallMode(Integer mallMode) {
this.mallMode = mallMode;
return this;
}
public Integer getStoreBrandId() {
return storeBrandId;
}
public WmStoreDTO setStoreBrandId(Integer storeBrandId) {
this.storeBrandId = storeBrandId;
return this;
}
public Integer getAuthStatus() {
return authStatus;
}
public WmStoreDTO setAuthStatus(Integer authStatus) {
this.authStatus = authStatus;
return this;
}
public Integer getStatus() {
return status;
}
public WmStoreDTO setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public WmStoreDTO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public WmStoreDTO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
package com.gic.enterprise.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.WmMemberCardConfigDTO;
import com.gic.enterprise.dto.WmStoreDTO;
import java.util.List;
/**
* 微盟商城店铺
* @ClassName: WmStoreApiService

* @Description: 

* @author guojuxing

* @date 2020/4/13 10:47 AM

*/
public interface WmStoreApiService {
/**
* 新增
* @Title: saveWmStore

* @Description:

* @author guojuxing
* @param wmStoreDTO

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


*/
ServiceResponse<Integer> saveWmStore(WmStoreDTO wmStoreDTO);
/**
* 修改
* @Title: modifyWmStore

* @Description:

* @author guojuxing
* @param wmStoreDTO

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


*/
ServiceResponse<Void> modifyWmStore(WmStoreDTO wmStoreDTO);
/**
* 微盟商城店铺授权
* @Title: authWmStore

* @Description:

* @author guojuxing
* @param wmMallStoreId

* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>
店铺名称

*/
ServiceResponse<String> authWmStore(Integer wmMallStoreId);
ServiceResponse<List<WmStoreDTO>> listWmStore(Integer enterpriseId);
ServiceResponse<WmStoreDTO> getWmStoreByWmMallStoreId(Integer wmMallStoreId);
/**
* 新增会员卡配置
* @Title: saveOrUpdateWmMemberCardConfig

* @Description:

* @author guojuxing
* @param dto

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


*/
ServiceResponse<Integer> saveOrUpdateWmMemberCardConfig(WmMemberCardConfigDTO dto);
/**
* 根据微盟主账号查询会员卡配置
* @Title: getWmMemberCardConfigByWmMainAccount

* @Description:

* @author guojuxing
* @param wmMainAccount

* @return com.gic.api.base.commons.ServiceResponse<com.gic.enterprise.dto.WmMemberCardConfigDTO>


*/
ServiceResponse<WmMemberCardConfigDTO> getWmMemberCardConfigByWmMainAccount(String wmMainAccount);
}
......@@ -186,6 +186,11 @@
<version>1.18.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-log-api</artifactId>
<version>${gic-log-api}</version>
</dependency>
</dependencies>
<build>
......
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabWmMemberCardConfig;
public interface TabWmMemberCardConfigMapper {
/**
* 根据主键删除
*
* @param memberCardConfigId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer memberCardConfigId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabWmMemberCardConfig record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabWmMemberCardConfig record);
/**
* 根据主键查询
*
* @param memberCardConfigId 主键
* @return 实体对象
*/
TabWmMemberCardConfig selectByPrimaryKey(Integer memberCardConfigId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabWmMemberCardConfig record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabWmMemberCardConfig record);
TabWmMemberCardConfig getByWmMainAccount(String wmMainAccount);
}
\ No newline at end of file
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabWmStore;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabWmStoreMapper {
/**
* 根据主键删除
*
* @param wmMallStoreId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer wmMallStoreId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabWmStore record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabWmStore record);
/**
* 根据主键查询
*
* @param wmMallStoreId 主键
* @return 实体对象
*/
TabWmStore selectByPrimaryKey(Integer wmMallStoreId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabWmStore record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabWmStore record);
/**
* 验证是否重复(平台级)
* @Title: countByParam

* @Description:

* @author guojuxing
* @param data
* @param wmMallStoreId 店铺ID
* @param dataType
1:主账号 2:wm_store_id 3:pid
* @return int


*/
int countByParam(@Param("data") String data, @Param("wmMallStoreId") Integer wmMallStoreId, @Param("dataType") Integer dataType);
int countByStoreName(@Param("storeName") String storeName, @Param("wmMallStoreId") Integer wmMallStoreId, @Param("enterpriseId") Integer enterpriseId);
List<TabWmStore> listWmStore(Integer enterpriseId);
TabWmStore getByWmMainAccount(String wmMainAccount);
}
\ No newline at end of file
package com.gic.enterprise.entity;
import java.util.Date;
/**
* tab_wm_member_card_config
*/
public class TabWmMemberCardConfig {
/**
*
*/
private Integer memberCardConfigId;
/**
*
*/
private Integer enterpriseId;
/**
* 微盟主账号(平台唯一),用于关联配置
*/
private String wmMainAccount;
/**
* 开卡方式 1:达摩开卡 2:微盟开卡
*/
private Integer openCardMode;
/**
* GIC会员归属信息同步微盟 1:开启 0:关闭
*/
private Integer gicMemberToWm;
/**
* 微盟会员导购关系同步GIC 1:开启 0:关闭
*/
private Integer wmMemberClerkToGic;
/**
* 微盟会员信息(包括门店关系)同步GIC 1:开启 0:关闭
*/
private Integer wmMemberToGic;
/**
* 1:有效
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getMemberCardConfigId() {
return memberCardConfigId;
}
public TabWmMemberCardConfig setMemberCardConfigId(Integer memberCardConfigId) {
this.memberCardConfigId = memberCardConfigId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public TabWmMemberCardConfig setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getWmMainAccount() {
return wmMainAccount;
}
public TabWmMemberCardConfig setWmMainAccount(String wmMainAccount) {
this.wmMainAccount = wmMainAccount;
return this;
}
public Integer getOpenCardMode() {
return openCardMode;
}
public TabWmMemberCardConfig setOpenCardMode(Integer openCardMode) {
this.openCardMode = openCardMode;
return this;
}
public Integer getGicMemberToWm() {
return gicMemberToWm;
}
public TabWmMemberCardConfig setGicMemberToWm(Integer gicMemberToWm) {
this.gicMemberToWm = gicMemberToWm;
return this;
}
public Integer getWmMemberClerkToGic() {
return wmMemberClerkToGic;
}
public TabWmMemberCardConfig setWmMemberClerkToGic(Integer wmMemberClerkToGic) {
this.wmMemberClerkToGic = wmMemberClerkToGic;
return this;
}
public Integer getWmMemberToGic() {
return wmMemberToGic;
}
public TabWmMemberCardConfig setWmMemberToGic(Integer wmMemberToGic) {
this.wmMemberToGic = wmMemberToGic;
return this;
}
public Integer getStatus() {
return status;
}
public TabWmMemberCardConfig setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public TabWmMemberCardConfig setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public TabWmMemberCardConfig setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
\ No newline at end of file
package com.gic.enterprise.entity;
import java.util.Date;
/**
* tab_wm_store
*/
public class TabWmStore {
/**
*
*/
private Integer wmMallStoreId;
/**
*
*/
private Integer enterpriseId;
/**
* 微盟主账号
*/
private String wmMainAccount;
/**
* 微盟pid
*/
private String wmPid;
/**
* 微盟store_id
*/
private String wmStoreId;
/**
* 店铺名称
*/
private String wmPidName;
/**
* 商城模式 1:微商城模式 2:智慧零售模式
*/
private Integer mallMode;
/**
* 店招品牌
*/
private Integer storeBrandId;
/**
* 授权状态 0:未授权 1:已授权
*/
private Integer authStatus;
/**
* 1:有效
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getWmMallStoreId() {
return wmMallStoreId;
}
public TabWmStore setWmMallStoreId(Integer wmMallStoreId) {
this.wmMallStoreId = wmMallStoreId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public TabWmStore setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getWmMainAccount() {
return wmMainAccount;
}
public TabWmStore setWmMainAccount(String wmMainAccount) {
this.wmMainAccount = wmMainAccount;
return this;
}
public String getWmPid() {
return wmPid;
}
public TabWmStore setWmPid(String wmPid) {
this.wmPid = wmPid;
return this;
}
public String getWmStoreId() {
return wmStoreId;
}
public TabWmStore setWmStoreId(String wmStoreId) {
this.wmStoreId = wmStoreId;
return this;
}
public String getWmPidName() {
return wmPidName;
}
public TabWmStore setWmPidName(String wmPidName) {
this.wmPidName = wmPidName;
return this;
}
public Integer getMallMode() {
return mallMode;
}
public TabWmStore setMallMode(Integer mallMode) {
this.mallMode = mallMode;
return this;
}
public Integer getStoreBrandId() {
return storeBrandId;
}
public TabWmStore setStoreBrandId(Integer storeBrandId) {
this.storeBrandId = storeBrandId;
return this;
}
public Integer getAuthStatus() {
return authStatus;
}
public TabWmStore setAuthStatus(Integer authStatus) {
this.authStatus = authStatus;
return this;
}
public Integer getStatus() {
return status;
}
public TabWmStore setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public TabWmStore setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public TabWmStore setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
\ No newline at end of file
package com.gic.enterprise.service;
import com.gic.enterprise.dto.WmMemberCardConfigDTO;
import com.gic.enterprise.entity.TabWmMemberCardConfig;
public interface WmMemberCardConfigService {
/**
* 新增会员卡配置
* @Title: saveWmMemberCardConfig

* @Description:

* @author guojuxing
* @param dto

* @return java.lang.Integer


*/
Integer saveWmMemberCardConfig(WmMemberCardConfigDTO dto);
void updateWmMemberCardConfig(WmMemberCardConfigDTO dto);
/**
* 根据微盟主账号查询记录,主账号平台唯一
* @Title: getByWmMainAccount

* @Description:

* @author guojuxing
* @param wmMainAccount

* @return com.gic.enterprise.entity.TabWmMemberCardConfig


*/
TabWmMemberCardConfig getByWmMainAccount(String wmMainAccount);
}
package com.gic.enterprise.service;
import com.gic.enterprise.dto.WmStoreDTO;
import com.gic.enterprise.entity.TabWmStore;
import java.util.List;
/**
* 微盟商城店铺
* @ClassName: WmStoreService

* @Description: 

* @author guojuxing

* @date 2020/4/13 10:47 AM

*/
public interface WmStoreService {
/**
* 新增
* @Title: saveWmStore

* @Description:

* @author guojuxing
* @param wmStoreDTO

* @return java.lang.Integer


*/
Integer saveWmStore(WmStoreDTO wmStoreDTO);
void modifyWmStore(WmStoreDTO wmStoreDTO);
/**
* 验证是否重复(平台级)
* @Title: validRepeat

* @Description:

* @author guojuxing
* @param data
* @param wmMallStoreId 店铺ID
* @param dataType
1:主账号 2:wm_store_id 3:pid
* @return boolean


*/
boolean validRepeat(String data, Integer wmMallStoreId, Integer dataType);
/**
* 店铺名称商户级验证重复
* @Title: validRepeatStoreName

* @Description:

* @author guojuxing
* @param storeName
* @param wmMallStoreId 店铺ID
* @param enterpriseId
商户ID
* @return boolean


*/
boolean validRepeatStoreName(String storeName, Integer wmMallStoreId, Integer enterpriseId);
TabWmStore getByWmMallStoreId(Integer wmMallStoreId);
/**
* 微盟主账号查询记录,因为主账号平台唯一
* @Title: getByWmMainAccount

* @Description:

* @author guojuxing
* @param wmMainAccount

* @return com.gic.enterprise.entity.TabWmStore


*/
TabWmStore getByWmMainAccount(String wmMainAccount);
List<TabWmStore> listWmStore(Integer enterpriseId);
}
package com.gic.enterprise.service.impl;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.dao.mapper.TabWmMemberCardConfigMapper;
import com.gic.enterprise.dto.WmMemberCardConfigDTO;
import com.gic.enterprise.entity.TabWmMemberCardConfig;
import com.gic.enterprise.service.WmMemberCardConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service("wmMemberCardConfigService")
public class WmMemberCardConfigServiceImpl implements WmMemberCardConfigService{
@Autowired
private TabWmMemberCardConfigMapper tabWmMemberCardConfigMapper;
@Override
public Integer saveWmMemberCardConfig(WmMemberCardConfigDTO dto) {
Date now = new Date();
dto.setUpdateTime(now);
dto.setCreateTime(now);
dto.setStatus(1);
TabWmMemberCardConfig record = EntityUtil.changeEntityNew(TabWmMemberCardConfig.class, dto);
tabWmMemberCardConfigMapper.insert(record);
return record.getMemberCardConfigId();
}
@Override
public void updateWmMemberCardConfig(WmMemberCardConfigDTO dto) {
dto.setUpdateTime(new Date());
TabWmMemberCardConfig record = EntityUtil.changeEntityNew(TabWmMemberCardConfig.class, dto);
tabWmMemberCardConfigMapper.updateByPrimaryKeySelective(record);
}
@Override
public TabWmMemberCardConfig getByWmMainAccount(String wmMainAccount) {
return tabWmMemberCardConfigMapper.getByWmMainAccount(wmMainAccount);
}
}
package com.gic.enterprise.service.impl;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.dao.mapper.TabWmStoreMapper;
import com.gic.enterprise.dto.WmStoreDTO;
import com.gic.enterprise.entity.TabWmStore;
import com.gic.enterprise.service.WmStoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service("wmStoreService")
public class WmStoreServiceImpl implements WmStoreService{
@Autowired
private TabWmStoreMapper tabWmStoreMapper;
@Override
public Integer saveWmStore(WmStoreDTO wmStoreDTO) {
Date now = new Date();
wmStoreDTO.setCreateTime(now);
wmStoreDTO.setUpdateTime(now);
wmStoreDTO.setStatus(1);
wmStoreDTO.setAuthStatus(0);
TabWmStore record = EntityUtil.changeEntityNew(TabWmStore.class, wmStoreDTO);
tabWmStoreMapper.insert(record);
return record.getWmMallStoreId();
}
@Override
public void modifyWmStore(WmStoreDTO wmStoreDTO) {
wmStoreDTO.setUpdateTime(new Date());
TabWmStore record = EntityUtil.changeEntityNew(TabWmStore.class, wmStoreDTO);
tabWmStoreMapper.updateByPrimaryKeySelective(record);
}
@Override
public boolean validRepeat(String data, Integer wmMallStoreId, Integer dataType) {
int count = tabWmStoreMapper.countByParam(data, wmMallStoreId, dataType);
if (count > 0) {
return true;
}
return false;
}
@Override
public boolean validRepeatStoreName(String storeName, Integer wmMallStoreId, Integer enterpriseId) {
int count = tabWmStoreMapper.countByStoreName(storeName, wmMallStoreId, enterpriseId);
if (count > 0) {
return true;
}
return false;
}
@Override
public TabWmStore getByWmMallStoreId(Integer wmMallStoreId) {
return tabWmStoreMapper.selectByPrimaryKey(wmMallStoreId);
}
@Override
public TabWmStore getByWmMainAccount(String wmMainAccount) {
return tabWmStoreMapper.getByWmMainAccount(wmMainAccount);
}
@Override
public List<TabWmStore> listWmStore(Integer enterpriseId) {
return tabWmStoreMapper.listWmStore(enterpriseId);
}
}
......@@ -274,6 +274,7 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
//总积分平衡组卡下面的子卡列表,线下订单选择
List<AppletCardDTO> subListTemp = appletCardMap.get(totalIntegral);
Set<String> subListSet = new HashSet<>();
subListSet.add(totalIntegral);
if (CollectionUtils.isNotEmpty(subListTemp)) {
for (AppletCardDTO temp : subListTemp) {
subListSet.add(temp.getCardConfigId().toString());
......@@ -367,12 +368,12 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
if (CollectionUtils.isNotEmpty(cardList)) {
for (MemberCardRelDTO card : cardList) {
List<MemberCardRelDTO> sub = card.getRelCards();
Boolean isMainCard = card.getId().toString().endsWith(mainCardId);
Boolean isMainCard = card.getId().toString().equals(mainCardId);
List<AppletCardDTO> subList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(sub)) {
for (MemberCardRelDTO subTemp : sub) {
Boolean isMainCardTemp = subTemp.getId().toString().endsWith(mainCardId);
Boolean isMainCardTemp = subTemp.getId().toString().equals(mainCardId);
subList.add(new AppletCardDTO().setCardConfigId(subTemp.getId())
.setCardName(subTemp.getName()).setMainCard(isMainCardTemp));
}
......
......@@ -107,9 +107,9 @@ public class CustomGuideApiServiceImpl implements CustomGuideApiService {
} else if(theme == 3){
themeStr = "black-golden";
} else if(theme == 4){
themeStr = "dark_green";
themeStr = "dark-green";
} else {
themeStr = "tint_green";
themeStr = "tint-green";
}
// networkTimeout
Map<String, Object> networkTimeoutMap = new HashMap<String, Object>();
......@@ -119,17 +119,19 @@ public class CustomGuideApiServiceImpl implements CustomGuideApiService {
// tabBar
List<Map<String, Object>> tabBarList = new ArrayList<>();
Set<String> pathSet = new HashSet<String>() ;
String iconPath = "/images/footbar/"+themeStr;
String iconPath = "/images/footbar/"+themeStr+"/";
String selectIconPath = "/images/footbar/black-blue/line/foot-icon-01-active.png";
String unIconPath = "/images/footbar/black-blue/line/foot-icon-01.png";
for (int i = 0; i < guideList.size(); i++) {
TabCustomGuide guide = guideList.get(i);
String title = guide.getTitle();
Map<String, Object> listMap = new HashMap<String, Object>();
JSONObject jsonObject = JSON.parseObject(guide.getIcon());
String selectIconPath = "";
String unIconPath = "";
if(jsonObject != null){
selectIconPath = iconPath + jsonObject.getString("type")+ jsonObject.getString("name")+"-active.png";
unIconPath = iconPath + jsonObject.getString("type")+ jsonObject.getString("name")+".png";
if(StringUtils.isNotBlank(guide.getIcon()) && !"{}".equals(guide.getIcon())){
JSONObject jsonObject = JSON.parseObject(guide.getIcon());
if(jsonObject != null){
selectIconPath = iconPath + jsonObject.getString("type")+ "/"+jsonObject.getString("name")+"-active.png";
unIconPath = iconPath + jsonObject.getString("type")+ "/"+jsonObject.getString("name")+".png";
}
}
listMap.put("selectedIconPath", selectIconPath);
listMap.put("iconPath", unIconPath);
......
package com.gic.enterprise.service.outer.impl;
import java.util.List;
import java.util.Optional;
import com.gic.enterprise.dto.WmMemberCardConfigDTO;
import com.gic.enterprise.entity.TabWmMemberCardConfig;
import com.gic.enterprise.service.WmMemberCardConfigService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.constant.MallModeEnum;
import com.gic.enterprise.dto.WmStoreDTO;
import com.gic.enterprise.entity.TabWmStore;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.service.WmStoreApiService;
import com.gic.enterprise.service.WmStoreService;
@Service("wmStoreApiService")
public class WmStoreApiServiceImpl implements WmStoreApiService {
@Autowired
private WmStoreService wmStoreService;
@Autowired
private WmMemberCardConfigService wmMemberCardConfigService;
@Override
public ServiceResponse<Integer> saveWmStore(WmStoreDTO wmStoreDTO) {
ServiceResponse validParam = validParam(wmStoreDTO);
if (!validParam.isSuccess()) {
return ServiceResponse.failure(validParam.getCode(), validParam.getMessage());
}
return ServiceResponse.success(wmStoreService.saveWmStore(wmStoreDTO));
}
@Override
public ServiceResponse<Void> modifyWmStore(WmStoreDTO wmStoreDTO) {
ServiceResponse validParam = validParam(wmStoreDTO);
if (!validParam.isSuccess()) {
return ServiceResponse.failure(validParam.getCode(), validParam.getMessage());
}
wmStoreService.modifyWmStore(wmStoreDTO);
return ServiceResponse.success();
}
@Override
public ServiceResponse<String> authWmStore(Integer wmMallStoreId) {
TabWmStore record = wmStoreService.getByWmMallStoreId(wmMallStoreId);
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "微盟商城店铺ID错误,查无数据");
}
wmStoreService.modifyWmStore(new WmStoreDTO().setWmMallStoreId(wmMallStoreId).setAuthStatus(1));
return ServiceResponse.success(record.getWmPidName());
}
@Override
public ServiceResponse<List<WmStoreDTO>> listWmStore(Integer enterpriseId) {
List<TabWmStore> list = wmStoreService.listWmStore(enterpriseId);
return ServiceResponse.success(
EntityUtil.changeEntityListNew(WmStoreDTO.class, list));
}
@Override
public ServiceResponse<WmStoreDTO> getWmStoreByWmMallStoreId(Integer wmMallStoreId) {
TabWmStore record = wmStoreService.getByWmMallStoreId(wmMallStoreId);
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "微盟商城店铺ID错误,查无数据");
}
return ServiceResponse.success(EntityUtil.changeEntityNew(WmStoreDTO.class, record));
}
@Override
public ServiceResponse<Integer> saveOrUpdateWmMemberCardConfig(WmMemberCardConfigDTO dto) {
ServiceResponse validParam = validWmMemberCardConfig(dto);
if (!validParam.isSuccess()) {
return ServiceResponse.failure(validParam.getCode(), validParam.getMessage());
}
TabWmMemberCardConfig record = wmMemberCardConfigService.getByWmMainAccount(dto.getWmMainAccount());
if (record == null) {
return ServiceResponse.success(wmMemberCardConfigService.saveWmMemberCardConfig(dto));
}
//编辑
dto.setMemberCardConfigId(record.getMemberCardConfigId());
wmMemberCardConfigService.updateWmMemberCardConfig(dto);
return ServiceResponse.success(record.getMemberCardConfigId());
}
@Override
public ServiceResponse<WmMemberCardConfigDTO> getWmMemberCardConfigByWmMainAccount(String wmMainAccount) {
TabWmMemberCardConfig record = wmMemberCardConfigService.getByWmMainAccount(wmMainAccount);
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "还未配置");
}
return ServiceResponse.success(EntityUtil.changeEntityNew(WmMemberCardConfigDTO.class, record));
}
private ServiceResponse validWmMemberCardConfig(WmMemberCardConfigDTO dto) {
if (dto.getEnterpriseId() == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商户ID不能为空");
}
if (StringUtils.isBlank(dto.getWmMainAccount())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "微盟主账号不能为空");
}
TabWmStore wmStore = wmStoreService.getByWmMainAccount(dto.getWmMainAccount());
if (wmStore == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "微盟主账号错误,查无数据");
}
if (dto.getOpenCardMode() == null) {
//默认达摩开卡
dto.setOpenCardMode(1);
}
//GIC会员归属信息同步微盟 默认开启
dto.setGicMemberToWm(Optional.ofNullable(dto.getGicMemberToWm()).orElse(1));
//微盟会员导购关系同步GIC 默认开启
dto.setWmMemberClerkToGic(Optional.ofNullable(dto.getWmMemberClerkToGic()).orElse(1));
//微盟会员信息(包括门店关系)同步GIC 默认开启
dto.setWmMemberToGic(Optional.ofNullable(dto.getWmMemberToGic()).orElse(1));
return ServiceResponse.success();
}
private ServiceResponse<Void> validParam(WmStoreDTO wmStoreDTO) {
Integer wmMallStoreId = wmStoreDTO.getWmMallStoreId();
boolean isEdit = wmMallStoreId != null;
TabWmStore record = null;
if (wmMallStoreId != null) {
record = wmStoreService.getByWmMallStoreId(wmMallStoreId);
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "微盟商城店铺ID错误,查无数据");
}
wmStoreDTO.setEnterpriseId(record.getEnterpriseId());
}
//已授权
boolean isCanEdit = isEdit && record.getAuthStatus().intValue() == 1;
if (StringUtils.isBlank(wmStoreDTO.getWmMainAccount())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "微盟主账号不能为空");
}
if (wmStoreService.validRepeat(wmStoreDTO.getWmMainAccount(), wmMallStoreId, 1)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "微盟主账号已存在");
}
if (isCanEdit && !record.getWmMainAccount().equals(wmStoreDTO.getWmMainAccount())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "已授权,微盟主账号不能修改");
}
if (StringUtils.isBlank(wmStoreDTO.getWmPid())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "PID不能为空");
}
if (isCanEdit && !record.getWmPid().equals(wmStoreDTO.getWmPid())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "已授权,PID不能修改");
}
if (wmStoreService.validRepeat(wmStoreDTO.getWmPid(), wmMallStoreId, 3)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "PID已存在");
}
if (StringUtils.isBlank(wmStoreDTO.getWmStoreId())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "storeID不能为空");
}
if (isCanEdit && !record.getWmStoreId().equals(wmStoreDTO.getWmStoreId())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "已授权,storeID不能修改");
}
if (wmStoreService.validRepeat(wmStoreDTO.getWmStoreId(), wmMallStoreId, 2)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "storeID已存在");
}
if (StringUtils.isBlank(wmStoreDTO.getWmPidName())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "店铺名称不能为空");
}
if (isCanEdit && !record.getWmPidName().equals(wmStoreDTO.getWmPidName())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "已授权,店铺名称不能修改");
}
if (wmStoreService.validRepeatStoreName(wmStoreDTO.getWmPidName(), wmMallStoreId,
wmStoreDTO.getEnterpriseId())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "店铺名称已存在");
}
if (!MallModeEnum.isContain(wmStoreDTO.getMallMode())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商城模式值非法");
}
//选择智慧零售模式保存后或者有进行过门店同步则不允许切换回微商城模式
if (isEdit && (record.getMallMode().intValue() == MallModeEnum.SMART_RETAIL.getCode())
&& wmStoreDTO.getMallMode().intValue() != MallModeEnum.SMART_RETAIL.getCode()) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "已进行过智慧零售模式保存,不允许切换回微商城模式");
}
Integer storeBrandId = wmStoreDTO.getStoreBrandId();
if (storeBrandId == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "店招品牌不能为空");
}
if (isCanEdit && record.getStoreBrandId().intValue() != storeBrandId.intValue()) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "已授权,店招品牌不能修改");
}
return ServiceResponse.success();
}
}
......@@ -124,6 +124,8 @@
<dubbo:service interface="com.gic.enterprise.service.ConfigRuleApiService" ref="configRuleApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.ConfigRuleEnterpriseApiService" ref="configRuleEnterpriseApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.WmStoreApiService" ref="wmStoreApiService" timeout="6000" />
<dubbo:reference interface="com.gic.mall.share.api.service.ShopApiService" id="shopApiService" timeout="6000" />
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.enterprise.dao.mapper.TabWmMemberCardConfigMapper">
<resultMap id="BaseResultMap" type="com.gic.enterprise.entity.TabWmMemberCardConfig">
<id column="member_card_config_id" jdbcType="INTEGER" property="memberCardConfigId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="wm_main_account" jdbcType="VARCHAR" property="wmMainAccount" />
<result column="open_card_mode" jdbcType="INTEGER" property="openCardMode" />
<result column="gic_member_to_wm" jdbcType="INTEGER" property="gicMemberToWm" />
<result column="wm_member_clerk_to_gic" jdbcType="INTEGER" property="wmMemberClerkToGic" />
<result column="wm_member_to_gic" jdbcType="INTEGER" property="wmMemberToGic" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
member_card_config_id, enterprise_id, wm_main_account, open_card_mode, gic_member_to_wm,
wm_member_clerk_to_gic, wm_member_to_gic, status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_wm_member_card_config
where member_card_config_id = #{memberCardConfigId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_wm_member_card_config
where member_card_config_id = #{memberCardConfigId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabWmMemberCardConfig" useGeneratedKeys="true" keyProperty="memberCardConfigId">
insert into tab_wm_member_card_config (member_card_config_id, enterprise_id,
wm_main_account, open_card_mode, gic_member_to_wm,
wm_member_clerk_to_gic, wm_member_to_gic, status,
create_time, update_time)
values (#{memberCardConfigId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER},
#{wmMainAccount,jdbcType=VARCHAR}, #{openCardMode,jdbcType=INTEGER}, #{gicMemberToWm,jdbcType=INTEGER},
#{wmMemberClerkToGic,jdbcType=INTEGER}, #{wmMemberToGic,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabWmMemberCardConfig">
insert into tab_wm_member_card_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="memberCardConfigId != null">
member_card_config_id,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="wmMainAccount != null">
wm_main_account,
</if>
<if test="openCardMode != null">
open_card_mode,
</if>
<if test="gicMemberToWm != null">
gic_member_to_wm,
</if>
<if test="wmMemberClerkToGic != null">
wm_member_clerk_to_gic,
</if>
<if test="wmMemberToGic != null">
wm_member_to_gic,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="memberCardConfigId != null">
#{memberCardConfigId,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="wmMainAccount != null">
#{wmMainAccount,jdbcType=VARCHAR},
</if>
<if test="openCardMode != null">
#{openCardMode,jdbcType=INTEGER},
</if>
<if test="gicMemberToWm != null">
#{gicMemberToWm,jdbcType=INTEGER},
</if>
<if test="wmMemberClerkToGic != null">
#{wmMemberClerkToGic,jdbcType=INTEGER},
</if>
<if test="wmMemberToGic != null">
#{wmMemberToGic,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabWmMemberCardConfig">
update tab_wm_member_card_config
<set>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="wmMainAccount != null">
wm_main_account = #{wmMainAccount,jdbcType=VARCHAR},
</if>
<if test="openCardMode != null">
open_card_mode = #{openCardMode,jdbcType=INTEGER},
</if>
<if test="gicMemberToWm != null">
gic_member_to_wm = #{gicMemberToWm,jdbcType=INTEGER},
</if>
<if test="wmMemberClerkToGic != null">
wm_member_clerk_to_gic = #{wmMemberClerkToGic,jdbcType=INTEGER},
</if>
<if test="wmMemberToGic != null">
wm_member_to_gic = #{wmMemberToGic,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where member_card_config_id = #{memberCardConfigId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.enterprise.entity.TabWmMemberCardConfig">
update tab_wm_member_card_config
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
wm_main_account = #{wmMainAccount,jdbcType=VARCHAR},
open_card_mode = #{openCardMode,jdbcType=INTEGER},
gic_member_to_wm = #{gicMemberToWm,jdbcType=INTEGER},
wm_member_clerk_to_gic = #{wmMemberClerkToGic,jdbcType=INTEGER},
wm_member_to_gic = #{wmMemberToGic,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where member_card_config_id = #{memberCardConfigId,jdbcType=INTEGER}
</update>
<select id="getByWmMainAccount" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_wm_member_card_config
where wm_main_account = #{wmMainAccount}
and status = 1
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.enterprise.dao.mapper.TabWmStoreMapper">
<resultMap id="BaseResultMap" type="com.gic.enterprise.entity.TabWmStore">
<id column="wm_mall_store_id" jdbcType="INTEGER" property="wmMallStoreId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="wm_main_account" jdbcType="VARCHAR" property="wmMainAccount" />
<result column="wm_pid" jdbcType="VARCHAR" property="wmPid" />
<result column="wm_store_id" jdbcType="VARCHAR" property="wmStoreId" />
<result column="wm_pid_name" jdbcType="VARCHAR" property="wmPidName" />
<result column="mall_mode" jdbcType="INTEGER" property="mallMode" />
<result column="store_brand_id" jdbcType="INTEGER" property="storeBrandId" />
<result column="auth_status" jdbcType="INTEGER" property="authStatus" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
wm_mall_store_id, enterprise_id, wm_main_account, wm_pid, wm_store_id, wm_pid_name,
mall_mode, store_brand_id, auth_status, status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_wm_store
where wm_mall_store_id = #{wmMallStoreId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_wm_store
where wm_mall_store_id = #{wmMallStoreId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabWmStore" useGeneratedKeys="true" keyProperty="wmMallStoreId">
insert into tab_wm_store (wm_mall_store_id, enterprise_id, wm_main_account,
wm_pid, wm_store_id, wm_pid_name,
mall_mode, store_brand_id, auth_status,
status, create_time, update_time
)
values (#{wmMallStoreId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{wmMainAccount,jdbcType=VARCHAR},
#{wmPid,jdbcType=VARCHAR}, #{wmStoreId,jdbcType=VARCHAR}, #{wmPidName,jdbcType=VARCHAR},
#{mallMode,jdbcType=INTEGER}, #{storeBrandId,jdbcType=INTEGER}, #{authStatus,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabWmStore" useGeneratedKeys="true" keyProperty="wmMallStoreId">
insert into tab_wm_store
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="wmMallStoreId != null">
wm_mall_store_id,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="wmMainAccount != null">
wm_main_account,
</if>
<if test="wmPid != null">
wm_pid,
</if>
<if test="wmStoreId != null">
wm_store_id,
</if>
<if test="wmPidName != null">
wm_pid_name,
</if>
<if test="mallMode != null">
mall_mode,
</if>
<if test="storeBrandId != null">
store_brand_id,
</if>
<if test="authStatus != null">
auth_status,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="wmMallStoreId != null">
#{wmMallStoreId,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="wmMainAccount != null">
#{wmMainAccount,jdbcType=VARCHAR},
</if>
<if test="wmPid != null">
#{wmPid,jdbcType=VARCHAR},
</if>
<if test="wmStoreId != null">
#{wmStoreId,jdbcType=VARCHAR},
</if>
<if test="wmPidName != null">
#{wmPidName,jdbcType=VARCHAR},
</if>
<if test="mallMode != null">
#{mallMode,jdbcType=INTEGER},
</if>
<if test="storeBrandId != null">
#{storeBrandId,jdbcType=INTEGER},
</if>
<if test="authStatus != null">
#{authStatus,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabWmStore">
update tab_wm_store
<set>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="wmMainAccount != null">
wm_main_account = #{wmMainAccount,jdbcType=VARCHAR},
</if>
<if test="wmPid != null">
wm_pid = #{wmPid,jdbcType=VARCHAR},
</if>
<if test="wmStoreId != null">
wm_store_id = #{wmStoreId,jdbcType=VARCHAR},
</if>
<if test="wmPidName != null">
wm_pid_name = #{wmPidName,jdbcType=VARCHAR},
</if>
<if test="mallMode != null">
mall_mode = #{mallMode,jdbcType=INTEGER},
</if>
<if test="storeBrandId != null">
store_brand_id = #{storeBrandId,jdbcType=INTEGER},
</if>
<if test="authStatus != null">
auth_status = #{authStatus,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where wm_mall_store_id = #{wmMallStoreId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.enterprise.entity.TabWmStore">
update tab_wm_store
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
wm_main_account = #{wmMainAccount,jdbcType=VARCHAR},
wm_pid = #{wmPid,jdbcType=VARCHAR},
wm_store_id = #{wmStoreId,jdbcType=VARCHAR},
wm_pid_name = #{wmPidName,jdbcType=VARCHAR},
mall_mode = #{mallMode,jdbcType=INTEGER},
store_brand_id = #{storeBrandId,jdbcType=INTEGER},
auth_status = #{authStatus,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where wm_mall_store_id = #{wmMallStoreId,jdbcType=INTEGER}
</update>
<select id="countByParam" resultType="int">
select count(1)
from tab_wm_store
where status = 1
<if test="dataType == 1">
and wm_main_account = #{data}
</if>
<if test="dataType == 2">
and wm_store_id = #{data}
</if>
<if test="dataType == 1">
and wm_main_account = #{data}
</if>
<if test="wmMallStoreId != null">
and wm_mall_store_id &lt;&gt; #{wmMallStoreId}
</if>
</select>
<select id="countByStoreName" resultType="int">
select count(1)
from tab_wm_store
where status = 1
<if test="enterpriseId != null">
and enterprise_id = #{enterpriseId}
</if>
and wm_pid_name = #{storeName}
<if test="wmMallStoreId != null">
and wm_mall_store_id &lt;&gt; #{wmMallStoreId}
</if>
</select>
<select id="listWmStore" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from tab_wm_store
where enterprise_id = #{enterpriseId}
and status = 1
</select>
<select id="getByWmMainAccount" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from tab_wm_store
where wm_main_account = #{wmMainAccount}
and status = 1
</select>
</mapper>
\ No newline at end of file
......@@ -3,7 +3,7 @@ package com.gic.enterprise.web.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Configuration
//@Configuration
public class Config {
@Value("${host}")
private String host;
......
......@@ -282,7 +282,7 @@ public class BillingAccountController {
.BindGicEnterprise(Long.valueOf(enterpriseId), null, null, null);
if (result.isSuccess()) {
Config config = ConfigService.getConfig("COMMON.4.0-gic-properties");
String url = config.getProperty("service_host", "").replace("gic", "");
String url = config.getProperty("service_host", "").replace("/gic", "");
return RestResponse.success(url + "/market/gic" + "?loginKey=" + result.getResult()
+ "&enterpriseId=" + enterpriseId);
}
......
......@@ -97,6 +97,9 @@ public class WechatMenuController {
ServiceResponse<String> response = weixinMenuFunService.createMenu(appKey, json);
LOGGER.info("自定义菜单同步创建结果:{}", JSON.toJSONString(response));
if (!response.isSuccess()) {
return RestResponse.failure(response.getCode(), response.getMessage());
}
//初始化回调
enterpriseInitApiService.perfectMenuConfig(UserDetailUtils.getUserDetail().getEnterpriseId());
//日志
......
package com.gic.enterprise.web.controller.wm;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.constant.MallModeEnum;
import com.gic.enterprise.dto.WmMemberCardConfigDTO;
import com.gic.enterprise.utils.ResultControllerUtils;
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;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.download.utils.OperationResultUtils;
import com.gic.enterprise.dto.WmStoreDTO;
import com.gic.enterprise.service.WmStoreApiService;
import com.gic.enterprise.utils.UserDetailUtils;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/wm-mall-store")
public class WmMallStoreController {
private final static Logger LOGGER = LogManager.getLogger(WmMallStoreController.class);
@Autowired
private WmStoreApiService wmStoreApiService;
@RequestMapping("/save-wm-store")
public RestResponse save(WmStoreDTO dto) {
dto.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
return OperationResultUtils.operationResult(wmStoreApiService.saveWmStore(dto),
OperationResultUtils.LOG_NEW + "微盟商城店铺", dto.getWmPidName());
}
@RequestMapping("/edit-wm-store")
public RestResponse edit(WmStoreDTO dto) {
return OperationResultUtils.operationResult(wmStoreApiService.modifyWmStore(dto),
OperationResultUtils.LOG_EDIT + "微盟商城店铺", dto.getWmPidName());
}
@RequestMapping("/get-wm-store-detail")
public RestResponse getDetail(Integer wmMallStoreId) {
return ResultControllerUtils.commonResult(wmStoreApiService.getWmStoreByWmMallStoreId(wmMallStoreId));
}
@RequestMapping("/list-wm-store")
public RestResponse listWmStore() {
return ResultControllerUtils
.commonResult(wmStoreApiService.listWmStore(UserDetailUtils.getUserDetail().getEnterpriseId()));
}
/**
* 授权
* @Title: authWmStore

* @Description:

* @author guojuxing
* @param wmMallStoreId

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


*/
@RequestMapping("/auth-wm-store")
public RestResponse authWmStore(Integer wmMallStoreId) {
ServiceResponse<String> result = wmStoreApiService.authWmStore(wmMallStoreId);
return OperationResultUtils.operationResult(result, "授权微盟商城店铺",
OperationResultUtils.getOperationObject(result));
}
@RequestMapping("/list-mall-mode")
public RestResponse listMallMode() {
Map<String, String> result = new HashMap<>(16);
for (MallModeEnum modeEnum : MallModeEnum.values()) {
result.put(String.valueOf(modeEnum.getCode()), modeEnum.getMsg());
}
return RestResponse.success(result);
}
@RequestMapping("/save-or-update-wm-member-card-config")
public RestResponse saveOrUpdateWmMemberCardConfig(WmMemberCardConfigDTO dto) {
dto.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
return OperationResultUtils.operationResult(wmStoreApiService.saveOrUpdateWmMemberCardConfig(dto),
OperationResultUtils.LOG_EDIT + "微盟商城-会员卡配置", dto.getWmMainAccount());
}
@RequestMapping("/get-wm-member-card-config-by-wm-main-account")
public RestResponse getWmMemberCardConfigByWmMainAccount(String wmMainAccount) {
return ResultControllerUtils
.commonResult(wmStoreApiService.getWmMemberCardConfigByWmMainAccount(wmMainAccount));
}
}
......@@ -111,6 +111,7 @@
<dubbo:reference interface="com.gic.open.api.service.market.MarketUserApiService" id="marketUserApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.ProjectItemApiService" id="projectItemApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.enterprise.service.WmStoreApiService" id="wmStoreApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.marketing.api.service.coupon.CouponShelfApiService" id="couponShelfApiService" timeout="6000"/>
......
......@@ -4,7 +4,7 @@ import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Configuration
//@Configuration
public class Config {
@Value("${host}")
private String host;
......
......@@ -5,7 +5,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.gic.operation.web.config.Config;
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.springframework.beans.factory.annotation.Autowired;
......@@ -46,8 +47,7 @@ public class LoginController {
private UserApiService userApiService;
@Autowired
private MarketUserApiService marketUserApiService;
@Autowired
private Config config;
// private static final String URL = "https://four.gicdev.com";
......@@ -83,7 +83,9 @@ public class LoginController {
ServiceResponse<String> result = marketUserApiService.BindGicEnterprise(Long.valueOf(enterpriseId), null, null,
null);
if (result.isSuccess()) {
return RestResponse.success(config.getHost() + "/market/gic" + "?loginKey=" + result.getResult()
Config config = ConfigService.getConfig("COMMON.4.0-gic-properties");
String url = config.getProperty("service_host", "").replace("/gic", "");
return RestResponse.success(url + "/market/gic" + "?loginKey=" + result.getResult()
+ "&enterpriseId=" + enterpriseId);
}
return EnterpriseRestResponse.failure(result);
......@@ -91,8 +93,10 @@ public class LoginController {
@RequestMapping("login-gic")
public RestResponse login(Integer enterpriseId, String redirectUrl) throws IOException {
Config config = ConfigService.getConfig("COMMON.4.0-gic-properties");
String url = config.getProperty("service_host", "").replace("/gic", "");
if (StringUtils.isBlank(redirectUrl)) {
redirectUrl = config.getHost() + "/damo-system/overview/index";
redirectUrl = url + "/damo-system/overview/index";
// redirectUrl = "https://four.gicdev.com/cost-center/billing-center/overview";
}
String token;
......@@ -168,7 +172,7 @@ public class LoginController {
//塞缓存
token = UserDetailUtils.setUserDetail(userDetail);
String SSO_LOGIN_URL = config.getHost() + "/gic-auth-web/login-for-operation";
String SSO_LOGIN_URL = url + "/gic-auth-web/login-for-operation";
return RestResponse.success(SSO_LOGIN_URL + "?token=" + token + "&redirectUrl=" + redirectUrl);
}
return RestResponse.success();
......
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