Commit 0ea21d0d by 陶光胜

导航保存重复验证

parent 23238e50
......@@ -7,6 +7,7 @@ import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.CustomStoreDTO;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.qo.PageQO;
import com.gic.enterprise.response.EnterpriseRestResponse;
import com.gic.enterprise.service.CustomStoreApiService;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.enterprise.web.qo.CustomStoreQO;
......@@ -28,33 +29,25 @@ public class CustomStoreController {
@RequestMapping("save-custom-store")
public RestResponse saveCustomStore(@RequestBody CustomStoreQO customStoreQO){
StoreWidgetDTO widgetDTO = new StoreWidgetDTO();
widgetDTO.setWriteBackParam(customStoreQO.getWriteBackParam());
widgetDTO.setStoreWidgetId(customStoreQO.getStorewidgetId());
widgetDTO.setSearchParam(customStoreQO.getSearchParam());
widgetDTO.setAuthSearchParam(customStoreQO.getAuthSearchParam());
ServiceResponse<Integer> response = this.storeWidgetApiService.saveStoreWidget(widgetDTO);
if(response.isSuccess()){
CustomStoreDTO dto = new CustomStoreDTO();
dto.setTitle(customStoreQO.getTitle());
dto.setAppid(customStoreQO.getAppId());
dto.setAppType(customStoreQO.getAppType());
dto.setCustomStoreId(customStoreQO.getCustomStoreId());
dto.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
dto.setStoreWidgetId(response.getResult());
if(customStoreQO.getSaveType() == 2){
dto.setStatus(1);
}else {
if(customStoreQO.getCustomStoreId() == null){
dto.setStatus(2);
}
}
ServiceResponse<Integer> serviceResponse = this.customStoreApiService.saveCustomStore(dto);
if(serviceResponse.isSuccess()){
return RestResponse.success();
CustomStoreDTO dto = new CustomStoreDTO();
dto.setTitle(customStoreQO.getTitle());
dto.setAppid(customStoreQO.getAppId());
dto.setAppType(customStoreQO.getAppType());
dto.setCustomStoreId(customStoreQO.getCustomStoreId());
dto.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
dto.setStoreWidgetId(customStoreQO.getStorewidgetId());
if(customStoreQO.getSaveType() == 2){
dto.setStatus(1);
}else {
if(customStoreQO.getCustomStoreId() == null){
dto.setStatus(2);
}
}
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "门店选择器保存失败");
ServiceResponse<Integer> serviceResponse = this.customStoreApiService.saveCustomStore(dto);
if(serviceResponse.isSuccess()){
return RestResponse.success();
}
return EnterpriseRestResponse.failure(serviceResponse);
}
@RequestMapping("page-custom-store")
......@@ -74,13 +67,6 @@ public class CustomStoreController {
CustomStoreDTO dto = response.getResult();
if(dto != null){
CustomStoreVO vo = EntityUtil.changeEntityByJSON(CustomStoreVO.class, dto);
ServiceResponse<StoreWidgetDTO> storeWidget = this.storeWidgetApiService.getStoreWidget(dto.getStoreWidgetId());
if(storeWidget.isSuccess() && storeWidget.getResult() != null){
vo.setCustomStoreId(storeWidget.getResult().getStoreWidgetId());
vo.setAuthSearchParam(storeWidget.getResult().getAuthSearchParam());
vo.setSearchParam(storeWidget.getResult().getSearchParam());
vo.setWriteBackParam(storeWidget.getResult().getWriteBackParam());
}
return RestResponse.success(vo);
}
}
......
......@@ -6,9 +6,6 @@ public class CustomStoreQO {
private String appId;
private Integer appType;
private Integer storewidgetId;
private String authSearchParam;
private String searchParam;
private String writeBackParam;
private Integer saveType; //1保存 2保存发布
public Integer getCustomStoreId() {
......@@ -27,30 +24,6 @@ public class CustomStoreQO {
this.title = title;
}
public String getAuthSearchParam() {
return authSearchParam;
}
public void setAuthSearchParam(String authSearchParam) {
this.authSearchParam = authSearchParam;
}
public String getSearchParam() {
return searchParam;
}
public void setSearchParam(String searchParam) {
this.searchParam = searchParam;
}
public String getWriteBackParam() {
return writeBackParam;
}
public void setWriteBackParam(String writeBackParam) {
this.writeBackParam = writeBackParam;
}
public Integer getSaveType() {
return saveType;
}
......
......@@ -6,9 +6,6 @@ public class CustomStoreVO {
private String appid;
private Integer appType;
private Integer storeWidgetId;
private String authSearchParam;
private String searchParam;
private String writeBackParam;
public Integer getCustomStoreId() {
return customStoreId;
......@@ -26,30 +23,6 @@ public class CustomStoreVO {
this.title = title;
}
public String getAuthSearchParam() {
return authSearchParam;
}
public void setAuthSearchParam(String authSearchParam) {
this.authSearchParam = authSearchParam;
}
public String getSearchParam() {
return searchParam;
}
public void setSearchParam(String searchParam) {
this.searchParam = searchParam;
}
public String getWriteBackParam() {
return writeBackParam;
}
public void setWriteBackParam(String writeBackParam) {
this.writeBackParam = writeBackParam;
}
public String getAppid() {
return appid;
}
......
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