Commit a150317f by guojuxing

pmd

parent fb4291c3
...@@ -149,13 +149,33 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic ...@@ -149,13 +149,33 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
} }
guideTop(pageType, jsonObject, enterpriseId, appId, pageId); guideTop(pageType, jsonObject, enterpriseId, appId, pageId);
List<TabAppletPageComponent> componentList = refDeal(isAddOperation, pageType, jsonObject, enterpriseId, pageId);
//如果是会员中心,商户初始化回调
if (pageType == AppletPageTypeEnum.MEMBER_CENTER.getCode()) {
this.customStoreApiService.customSettingHasCommpleted(enterpriseId);
}
//先删除
appletPageComponentService.deleteByPageId(pageId);
if (CollectionUtils.isNotEmpty(componentList)) {
appletPageComponentService.saveFetch(componentList);
}
return ServiceResponse.success(pageId);
}
/**
* 关联数据处理
*/
private List<TabAppletPageComponent> refDeal(boolean isAddOperation, Integer pageType,
JSONObject jsonObject, Integer enterpriseId, Integer pageId) {
//保存组件表数据 //保存组件表数据
List<TabAppletPageComponent> componentList = new ArrayList<>(); List<TabAppletPageComponent> componentList = new ArrayList<>();
//组件key存储 //组件key存储
Map<String, Object> componentMap = new HashMap<>(16); Map<String, Object> componentMap = new HashMap<>(16);
ServiceResponse<Integer> componentParse = this.componentParse(jsonObject, enterpriseId, pageId, componentList, componentMap); ServiceResponse<Integer> componentParse = this.componentParse(jsonObject, enterpriseId, pageId, componentList, componentMap);
if(!componentParse.isSuccess()){ if(!componentParse.isSuccess()){
return componentParse; throw new CommonException(componentParse.getCode(), componentParse.getMessage());
} }
//如果是会员中心等页面,必须有对应的组件 //如果是会员中心等页面,必须有对应的组件
AppletPageComponentEnum mustComponent = AppletPageComponentEnum.mustComponent(pageType); AppletPageComponentEnum mustComponent = AppletPageComponentEnum.mustComponent(pageType);
...@@ -164,21 +184,11 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic ...@@ -164,21 +184,11 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
if (!componentMap.containsKey(mustComponent.getCode())) { if (!componentMap.containsKey(mustComponent.getCode())) {
//回滚 //回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "必须有" throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "必须有"
+ mustComponent.getMessage() + "组件"); + mustComponent.getMessage() + "组件");
} }
} }
//如果是会员中心,商户初始化回调 return componentList;
if (pageType == AppletPageTypeEnum.MEMBER_CENTER.getCode()) {
this.customStoreApiService.customSettingHasCommpleted(enterpriseId);
}
//先删除
appletPageComponentService.deleteByPageId(pageId);
if (CollectionUtils.isNotEmpty(componentList)) {
appletPageComponentService.saveFetch(componentList);
}
return ServiceResponse.success(pageId);
} }
private void guideTop(Integer pageType, JSONObject jsonObject, Integer enterpriseId, String appId, Integer pageId) { private void guideTop(Integer pageType, JSONObject jsonObject, Integer enterpriseId, String appId, Integer pageId) {
......
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