Commit 0b8a752b by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents c5158c64 1699532f
package com.gic.enterprise.constant;
/**
*
* @Description:
* @author zhiwj
* @date 2019-10-24 20:46
*/
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")
;
private Integer code;
private String msg;
ThemeEnum(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Integer getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
......@@ -6,4 +6,6 @@ public interface CustomThemeApiService {
ServiceResponse<Integer> saveTheme(Integer enterpriseId, String appid, Integer theme, Integer type);
ServiceResponse<Integer> getTheme(Integer enterpriseId, String appid);
ServiceResponse<String> getTheme(Integer theme);
}
......@@ -99,17 +99,17 @@ public class CustomGuideApiServiceImpl implements CustomGuideApiService {
return ServiceResponse.success();
}
Integer theme = this.customThemeService.getTheme(enterpriseId, appid);
String themeStr = "black-blue-theme";
String themeStr = "black-blue";
if (theme == 1) {
themeStr = "black-blue-theme";
themeStr = "black-blue";
} else if(theme == 2){
themeStr = "black-golden-theme";
themeStr = "red";
} else if(theme == 3){
themeStr = "dark-green-theme";
themeStr = "black-golden";
} else if(theme == 4){
themeStr = "tint-green-theme";
themeStr = "dark_green";
} else {
themeStr = "red-theme";
themeStr = "tint_green";
}
// networkTimeout
Map<String, Object> networkTimeoutMap = new HashMap<String, Object>();
......@@ -119,12 +119,16 @@ public class CustomGuideApiServiceImpl implements CustomGuideApiService {
// tabBar
List<Map<String, Object>> tabBarList = new ArrayList<>();
Set<String> pathSet = new HashSet<String>() ;
String iconPath = "/images/footbar/"+themeStr;
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>();
listMap.put("selectedIconPath", guide.getSelectedIconPath());
listMap.put("iconPath", guide.getIconPath());
JSONObject jsonObject = JSON.parseObject(guide.getIcon());
String selectIconPath = iconPath + jsonObject.getString("type")+ jsonObject.getString("name")+"-active.png";
String unIconPath = iconPath + jsonObject.getString("type")+ jsonObject.getString("name")+".png";
listMap.put("selectedIconPath", selectIconPath);
listMap.put("iconPath", unIconPath);
listMap.put("pagePath", guide.getCustomPage());
pathSet.add(guide.getCustomPage()) ;
listMap.put("text", title);
......
package com.gic.enterprise.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.constant.ThemeEnum;
import com.gic.enterprise.service.CustomThemeApiService;
import com.gic.enterprise.service.CustomThemeService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -22,4 +23,16 @@ public class CustomThemeApiServiceImpl implements CustomThemeApiService {
Integer theme = this.customThemeService.getTheme(enterpriseId, appid);
return ServiceResponse.success(theme);
}
@Override
public ServiceResponse<String> getTheme(Integer theme) {
ThemeEnum[] values = ThemeEnum.values();
String themeStr = "black-blue";
for(ThemeEnum themeEnum : values){
if(themeEnum.getCode().intValue() == theme.intValue()){
themeStr = themeEnum.getMsg();
}
}
return ServiceResponse.success(themeStr);
}
}
......@@ -27,6 +27,8 @@
<gic-log-api>4.0-SNAPSHOT</gic-log-api>
<gic-marketing-api>4.0-SNAPSHOT</gic-marketing-api>
<gic-member-config-api>4.0-SNAPSHOT</gic-member-config-api>
<gic-mall-share-api>4.0-SNAPSHOT</gic-mall-share-api>
<gic-mall-api>4.0-SNAPSHOT</gic-mall-api>
</properties>
<dependencies>
......@@ -187,6 +189,16 @@
<artifactId>gic-open-platform-api</artifactId>
<version>${gic-open-platform-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-mall-api</artifactId>
<version>${gic-mall-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-mall-share-api</artifactId>
<version>${gic-mall-share-api}</version>
</dependency>
</dependencies>
<build>
......
......@@ -3,9 +3,15 @@ package com.gic.enterprise.web.controller;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.LinkDTO;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.service.LinkApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.mall.api.dto.activity.ActivityDTO;
import com.gic.mall.api.dto.activity.MallActivityPageSerchDTO;
import com.gic.mall.api.service.MallActivityThemeApiService;
import com.gic.mall.share.api.dto.shop.ShopDTO;
import com.gic.mall.share.api.service.ShopApiService;
import com.gic.member.config.api.dto.AppletCardRelationDTO;
import com.gic.member.config.api.dto.AppletsConfigSimpleOutputDTO;
import com.gic.member.config.api.service.AppletsConfigApiService;
......@@ -32,6 +38,10 @@ public class LinkController {
private AppletsConfigApiService appletsConfigApiService;
@Autowired
private ServiceConfigApiService serviceConfigApiService;
@Autowired
private ShopApiService shopApiService;
@Autowired
private MallActivityThemeApiService mallActivityThemeApiService;
@RequestMapping("/list-link-data")
public RestResponse listLinkData(Integer parentId) {
......@@ -57,4 +67,22 @@ public class LinkController {
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/list-mall-activity")
public RestResponse listMallActivity(String appletId) {
ServiceResponse<AppletsConfigSimpleOutputDTO> appletResp = appletsConfigApiService.selectAppletsConfigIdByAppId(appletId, UserDetailUtils.getUserDetail().getEnterpriseId());
if (!appletResp.isSuccess() || appletResp.getResult() == null) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "没有对应的小程序");
}
ServiceResponse<ShopDTO> shopResp = shopApiService.getShopByAppletId(appletResp.getResult().getAppletConfigId(), UserDetailUtils.getUserDetail().getEnterpriseId(), 1);
if (!shopResp.isSuccess() || shopResp.getResult() == null) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "没有对应的店铺");
}
MallActivityPageSerchDTO serchDTO = new MallActivityPageSerchDTO();
serchDTO.setShopId(shopResp.getResult().getId());
serchDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
serchDTO.setStatus(4);
ServiceResponse<List<ActivityDTO>> serviceResponse = mallActivityThemeApiService.listActivity(serchDTO);
return ResultControllerUtils.commonResult(serviceResponse);
}
}
......@@ -116,4 +116,6 @@
<dubbo:reference interface="com.gic.open.api.service.AppTokenApiService" id="appTokenApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.open.api.service.ApplicationApiService" id="applicationApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.mall.share.api.service.ShopApiService" id="shopApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.mall.api.service.MallActivityThemeApiService" id="mallActivityThemeApiService" timeout="6000"/>
</beans>
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