Commit b13cc5a1 by zhiwj

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

parents b1db9e05 cab4b621
......@@ -95,4 +95,13 @@ public interface AppletCustomPageApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>


 */
ServiceResponse<String> delete(Integer pageId);
/**
* 批量删除
* @Title: deleteFetch

* @Description:

 * @author guojuxing
* @param 
pageIds
* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>


 */
ServiceResponse<String> deleteFetch(String pageIds);
}
......@@ -105,4 +105,6 @@ public interface TabAppletCustomPageMapper {
@Param("appId") String appId, @Param("pageType") Integer pageType);
TabAppletCustomPage getDefault(@Param("pageType") Integer pageType);
void deleteFetch(@Param("list") List<Integer> pageIdList);
}
\ No newline at end of file
......@@ -134,4 +134,6 @@ public interface AppletCustomPageService {

 */
TabAppletCustomPage getDefault(Integer pageType);
void deleteFetch(List<Integer> pageIdList);
}
......@@ -103,4 +103,9 @@ public class AppletCustomPageServiceImpl implements AppletCustomPageService{
public TabAppletCustomPage getDefault(Integer pageType) {
return tabAppletCustomPageMapper.getDefault(pageType);
}
@Override
public void deleteFetch(List<Integer> pageIdList) {
tabAppletCustomPageMapper.deleteFetch(pageIdList);
}
}
......@@ -334,6 +334,32 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
return ServiceResponse.success(record.getTitle());
}
@Override
public ServiceResponse<String> deleteFetch(String pageIds) {
if (StringUtils.isBlank(pageIds)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "页面id为空");
}
String[] pageIdArr = pageIds.split(",");
StringBuilder pageName = new StringBuilder();
List<Integer> pageIdList = new ArrayList<>(pageIdArr.length);
for (String pageId : pageIdArr) {
if (!StringUtils.isNumeric(pageId)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "页面id错误,数据格式非法");
}
TabAppletCustomPage record = appletCustomPageService.getByPageId(Integer.parseInt(pageId));
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "页面ID错误,查无数据");
}
if (record.getStatus().intValue() == 1) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "发布状态不能删除");
}
pageName.append(record.getTitle()).append(",");
pageIdList.add(Integer.parseInt(pageId));
}
appletCustomPageService.deleteFetch(pageIdList);
return ServiceResponse.success(pageName.toString());
}
/**
* 获取组件信息
* @param pageId
......
......@@ -52,7 +52,7 @@ public class AppletWechatMenuApiServiceImpl implements AppletWechatMenuApiServic
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "菜单内容错误");
}
if (WeChatMenuTypeEnum.isNeedMenuCode(dto.getMenuType()) && StringUtils.isBlank(dto.getMenuCode())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "链接配置code不能为空");
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "链接配置不能为空");
}
if (WeChatMenuTypeEnum.OUT_LINK.getCode() == dto.getMenuType().intValue()) {
if (StringUtils.isBlank(dto.getMenuUrl())) {
......@@ -132,7 +132,7 @@ public class AppletWechatMenuApiServiceImpl implements AppletWechatMenuApiServic
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "菜单内容错误");
}
if (WeChatMenuTypeEnum.isNeedMenuCode(dto.getMenuType()) && StringUtils.isBlank(dto.getMenuCode())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "链接配置code不能为空");
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "链接配置不能为空");
}
if (WeChatMenuTypeEnum.OUT_LINK.getCode() == dto.getMenuType().intValue()) {
if (StringUtils.isBlank(dto.getMenuUrl())) {
......
......@@ -242,4 +242,12 @@
and enterprise_id = -1
and page_type = #{pageType}
</select>
<update id="deleteFetch">
update tab_applet_custom_page set status = 0
where page_id in
<foreach collection="list" item="item" separator="," open="(" close=")" index="">
#{item}
</foreach>
</update>
</mapper>
\ No newline at end of file
......@@ -143,7 +143,7 @@
select
<include refid="Base_Column_List" />
from tab_custom_store
where enterprise_id = #{enterpriseId,jdbcType=INTEGER}
where enterprise_id = #{enterpriseId,jdbcType=INTEGER} and status=1
<if test="appid != null and appid != ''">
and appid= #{appid}
</if>
......
......@@ -69,6 +69,12 @@ public class CustomPageController {
return OperationResultUtils.operationResult(result, "删除装修页面", OperationResultUtils.getOperationObject(result));
}
@RequestMapping("/delete-fetch")
public RestResponse deleteFetch(String pageIds) {
ServiceResponse<String> result = appletCustomPageApiService.deleteFetch(pageIds);
return OperationResultUtils.operationResult(result, "删除装修页面", OperationResultUtils.getOperationObject(result));
}
/**
* 数据资产类型
* @Title: listDataIcon

......
......@@ -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;
......@@ -23,38 +24,28 @@ import org.springframework.web.bind.annotation.RestController;
public class CustomStoreController {
@Autowired
private CustomStoreApiService customStoreApiService;
@Autowired
private StoreWidgetApiService storeWidgetApiService;
@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 +65,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);
}
}
......@@ -88,9 +72,12 @@ public class CustomStoreController {
}
@RequestMapping("delete-custom-store")
public RestResponse deleteCustomStore(String customStoreIds){
if(StringUtils.isNotBlank(customStoreIds)){
String[] arr = customStoreIds.split(",");
public RestResponse deleteCustomStore(String customStoreId){
if(StringUtils.isBlank(customStoreId)){
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "参数不能为空");
}
if(StringUtils.isNotBlank(customStoreId)){
String[] arr = customStoreId.split(",");
for(String s : arr){
this.customStoreApiService.deleteCustomStore(Integer.valueOf(s));
}
......
......@@ -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