|
|
|
@ -7,10 +7,10 @@ |
|
|
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
|
|
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
|
|
|
* the Software, and to permit persons to whom the Software is furnished to do so, |
|
|
|
* the Software, and to permit persons to whom the Software is furnished to do so, |
|
|
|
* subject to the following conditions: |
|
|
|
* subject to the following conditions: |
|
|
|
|
|
|
|
* <p> |
|
|
|
* The above copyright notice and this permission notice shall be included in all |
|
|
|
* The above copyright notice and this permission notice shall be included in all |
|
|
|
* copies or substantial portions of the Software. |
|
|
|
* copies or substantial portions of the Software. |
|
|
|
|
|
|
|
* <p> |
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
|
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
|
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
|
|
@ -23,6 +23,7 @@ |
|
|
|
package net.mingsoft.cms.action; |
|
|
|
package net.mingsoft.cms.action; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
@ -89,7 +90,7 @@ public class CategoryAction extends BaseAction { |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category) { |
|
|
|
public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category) { |
|
|
|
BasicUtil.startPage(); |
|
|
|
BasicUtil.startPage(); |
|
|
|
List categoryList = categoryBiz.query(category); |
|
|
|
List categoryList = categoryBiz.list(new LambdaQueryWrapper<CategoryEntity>(category)); |
|
|
|
return ResultData.build().success(new EUListBean(categoryList, (int) BasicUtil.endPage(categoryList).getTotal())); |
|
|
|
return ResultData.build().success(new EUListBean(categoryList, (int) BasicUtil.endPage(categoryList).getTotal())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -122,7 +123,6 @@ public class CategoryAction extends BaseAction { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 保存分类 |
|
|
|
* 保存分类 |
|
|
|
* @param category 分类实体 |
|
|
|
* @param category 分类实体 |
|
|
|
@ -171,6 +171,9 @@ public class CategoryAction extends BaseAction { |
|
|
|
} |
|
|
|
} |
|
|
|
//判断拼音是否重复
|
|
|
|
//判断拼音是否重复
|
|
|
|
if (StrUtil.isNotBlank(category.getCategoryPinyin())) { |
|
|
|
if (StrUtil.isNotBlank(category.getCategoryPinyin())) { |
|
|
|
|
|
|
|
if (!category.getCategoryPinyin().matches("^[a-zA-Z0-9]*$")){ |
|
|
|
|
|
|
|
return ResultData.build().error(this.getResString("err.format")); |
|
|
|
|
|
|
|
} |
|
|
|
CategoryEntity _category = new CategoryEntity(); |
|
|
|
CategoryEntity _category = new CategoryEntity(); |
|
|
|
_category.setCategoryPinyin(category.getCategoryPinyin()); |
|
|
|
_category.setCategoryPinyin(category.getCategoryPinyin()); |
|
|
|
List<CategoryEntity> query = categoryBiz.query(_category); |
|
|
|
List<CategoryEntity> query = categoryBiz.query(_category); |
|
|
|
@ -253,6 +256,9 @@ public class CategoryAction extends BaseAction { |
|
|
|
} |
|
|
|
} |
|
|
|
//判断拼音是否重复并且是否和原拼音相同
|
|
|
|
//判断拼音是否重复并且是否和原拼音相同
|
|
|
|
if (StrUtil.isNotBlank(category.getCategoryPinyin()) && !categoryBiz.getById(category.getId()).getCategoryPinyin().equals(category.getCategoryPinyin())) { |
|
|
|
if (StrUtil.isNotBlank(category.getCategoryPinyin()) && !categoryBiz.getById(category.getId()).getCategoryPinyin().equals(category.getCategoryPinyin())) { |
|
|
|
|
|
|
|
if (!category.getCategoryPinyin().matches("^[a-zA-Z0-9]*$")){ |
|
|
|
|
|
|
|
return ResultData.build().error(this.getResString("err.format")); |
|
|
|
|
|
|
|
} |
|
|
|
CategoryEntity _category = new CategoryEntity(); |
|
|
|
CategoryEntity _category = new CategoryEntity(); |
|
|
|
_category.setCategoryPinyin(category.getCategoryPinyin()); |
|
|
|
_category.setCategoryPinyin(category.getCategoryPinyin()); |
|
|
|
List<CategoryEntity> query = categoryBiz.query(_category); |
|
|
|
List<CategoryEntity> query = categoryBiz.query(_category); |
|
|
|
|