提交 0316b915 作者: xiaowang

Merge branch 'develop' of ssh://git.mmcuav.cn:8222/iuav/pms into develop

...@@ -18,4 +18,4 @@ patches: ...@@ -18,4 +18,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag: ff6a800850b7f031aecf9add2d8c012a3f2afee1 newTag: b69bace06bf8b901861adb9ff6cd91ab34fbd6c4
...@@ -85,15 +85,15 @@ public class CategoryController { ...@@ -85,15 +85,15 @@ public class CategoryController {
@ApiOperation(value = "二级分类————删除") @ApiOperation(value = "二级分类————删除")
@GetMapping("/deleteSubCategory") @GetMapping("/deleteSubCategory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody deleteSubCategory(HttpServletRequest request, @RequestParam(value = "subId", required = true) Integer subId) { public ResultBody deleteSubCategory(HttpServletRequest request, @RequestParam(value = "id", required = true) Integer id) {
return categoryService.deleteSubCategory(subId); return categoryService.deleteSubCategory(id);
} }
@ApiOperation(value = "二级分类————详情") @ApiOperation(value = "二级分类————详情")
@GetMapping("/detailSubCategory") @GetMapping("/detailSubCategory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody<CategorySubDTO> detailSubCategory(HttpServletRequest request, @RequestParam(value = "subId", required = true) Integer subId) { public ResultBody<CategorySubDTO> detailSubCategory(HttpServletRequest request, @RequestParam(value = "id", required = true) Integer id) {
return categoryService.detailSubCategory(subId); return categoryService.detailSubCategory(id);
} }
@ApiOperation(value = "一级分类——排序交换") @ApiOperation(value = "一级分类——排序交换")
......
...@@ -35,9 +35,9 @@ public interface CategoryDao { ...@@ -35,9 +35,9 @@ public interface CategoryDao {
void updateSubCategory(CategorySubDO subDO); void updateSubCategory(CategorySubDO subDO);
void deleteSubCategory(Integer subId); void deleteSubCategory(Integer id);
CategorySubDO detailSubCategory(Integer subId); CategorySubDO detailSubCategory(Integer id);
List<CategoryPrimaryDO> categoryList(CategoryQO param); List<CategoryPrimaryDO> categoryList(CategoryQO param);
......
...@@ -33,7 +33,7 @@ public class CategorySubDO { ...@@ -33,7 +33,7 @@ public class CategorySubDO {
@NotNull(message = "id不能为空", groups = {Update.class}) @NotNull(message = "id不能为空", groups = {Update.class})
@Min(value = 1, groups = {Update.class}) @Min(value = 1, groups = {Update.class})
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
private Integer subId; private Integer id;
@ApiModelProperty(value = "分类名称", required = true, example = "无人机") @ApiModelProperty(value = "分类名称", required = true, example = "无人机")
...@@ -59,7 +59,7 @@ public class CategorySubDO { ...@@ -59,7 +59,7 @@ public class CategorySubDO {
private Date updateTime; private Date updateTime;
public CategorySubDO(CategorySubVO subVO) { public CategorySubDO(CategorySubVO subVO) {
this.subId = subVO.getSubId(); this.id = subVO.getId();
this.name = subVO.getName(); this.name = subVO.getName();
this.description = subVO.getDescription(); this.description = subVO.getDescription();
this.categoryPrimaryId = subVO.getCategoryPrimaryId(); this.categoryPrimaryId = subVO.getCategoryPrimaryId();
...@@ -67,7 +67,7 @@ public class CategorySubDO { ...@@ -67,7 +67,7 @@ public class CategorySubDO {
public CategorySubDTO buildCategorySubDTO() { public CategorySubDTO buildCategorySubDTO() {
return CategorySubDTO.builder() return CategorySubDTO.builder()
.subId(this.subId) .id(this.id)
.name(this.name) .name(this.name)
.description(this.description) .description(this.description)
.categoryPrimaryId(this.categoryPrimaryId) .categoryPrimaryId(this.categoryPrimaryId)
......
...@@ -29,7 +29,7 @@ public class CategorySubDTO { ...@@ -29,7 +29,7 @@ public class CategorySubDTO {
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
@NotNull(message = "id不能为空", groups = {Update.class}) @NotNull(message = "id不能为空", groups = {Update.class})
@Min(value = 1, groups = {Update.class}) @Min(value = 1, groups = {Update.class})
private Integer subId; private Integer id;
@ApiModelProperty(value = "分类名称", required = true, example = "无人机") @ApiModelProperty(value = "分类名称", required = true, example = "无人机")
@Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class}) @Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class})
......
...@@ -21,7 +21,7 @@ public class CategorySubVO { ...@@ -21,7 +21,7 @@ public class CategorySubVO {
@ApiModelProperty(value = "id", example = "1") @ApiModelProperty(value = "id", example = "1")
@NotNull(message = "id不能为空", groups = {Update.class}) @NotNull(message = "id不能为空", groups = {Update.class})
@Min(value = 1, groups = {Update.class}) @Min(value = 1, groups = {Update.class})
private Integer subId; private Integer id;
@ApiModelProperty(value = "分类名称", required = true, example = "无人机") @ApiModelProperty(value = "分类名称", required = true, example = "无人机")
@Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class}) @Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class})
......
...@@ -26,9 +26,9 @@ public interface CategoryService { ...@@ -26,9 +26,9 @@ public interface CategoryService {
ResultBody updateSubCategory(CategorySubVO subVO); ResultBody updateSubCategory(CategorySubVO subVO);
ResultBody deleteSubCategory(Integer subId); ResultBody deleteSubCategory(Integer id);
ResultBody detailSubCategory(Integer subId); ResultBody detailSubCategory(Integer id);
PageResult<CategoryPrimaryDTO> categoryList(CategoryQO param); PageResult<CategoryPrimaryDTO> categoryList(CategoryQO param);
......
...@@ -70,7 +70,8 @@ public class CategoryServiceImpl implements CategoryService { ...@@ -70,7 +70,8 @@ public class CategoryServiceImpl implements CategoryService {
return ResultBody.error(ResultEnum.THE_NAME_OF_THE_SECONDARY_CLASS_MUST_BE_UNIQUE); return ResultBody.error(ResultEnum.THE_NAME_OF_THE_SECONDARY_CLASS_MUST_BE_UNIQUE);
} }
CategorySubDO subDO = new CategorySubDO(subVO); CategorySubDO subDO = new CategorySubDO(subVO);
subDO.setSubId(subVO.getCategoryPrimaryId() + 1); int number = (int) (Math.random() * 90 + 10);
subDO.setId(subVO.getCategoryPrimaryId() + 1 + number);
categoryDao.addSubCategory(subDO); categoryDao.addSubCategory(subDO);
return ResultBody.success(); return ResultBody.success();
} }
...@@ -87,14 +88,14 @@ public class CategoryServiceImpl implements CategoryService { ...@@ -87,14 +88,14 @@ public class CategoryServiceImpl implements CategoryService {
} }
@Override @Override
public ResultBody deleteSubCategory(Integer subId) { public ResultBody deleteSubCategory(Integer id) {
categoryDao.deleteSubCategory(subId); categoryDao.deleteSubCategory(id);
return ResultBody.success(); return ResultBody.success();
} }
@Override @Override
public ResultBody<CategorySubDTO> detailSubCategory(Integer subId) { public ResultBody<CategorySubDTO> detailSubCategory(Integer id) {
CategorySubDO subDO = categoryDao.detailSubCategory(subId); CategorySubDO subDO = categoryDao.detailSubCategory(id);
CategorySubDTO categorySubDTO = null; CategorySubDTO categorySubDTO = null;
if (subDO != null) { if (subDO != null) {
categorySubDTO = subDO.buildCategorySubDTO(); categorySubDTO = subDO.buildCategorySubDTO();
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</resultMap> </resultMap>
<select id="selectSubList" resultType="com.mmc.pms.entity.category.CategorySubDO"> <select id="selectSubList" resultType="com.mmc.pms.entity.category.CategorySubDO">
select id AS subId, select id,
`name`, `name`,
description, description,
category_primary_id AS categoryPrimaryId, category_primary_id AS categoryPrimaryId,
...@@ -124,9 +124,9 @@ ...@@ -124,9 +124,9 @@
<insert id="addSubCategory" useGeneratedKeys="true" <insert id="addSubCategory" useGeneratedKeys="true"
keyProperty="subId" parameterType="com.mmc.pms.entity.category.CategorySubDO"> keyProperty="id" parameterType="com.mmc.pms.entity.category.CategorySubDO">
insert into category_sub(id, `name`, description, create_time, update_time, category_primary_id) insert into category_sub(id, `name`, description, create_time, update_time, category_primary_id)
values (#{subId}, #{name}, #{description}, NOW(), NOW(), #{categoryPrimaryId}) values (#{id}, #{name}, #{description}, NOW(), NOW(), #{categoryPrimaryId})
</insert> </insert>
<select id="categorySubCount" resultType="java.lang.Integer"> <select id="categorySubCount" resultType="java.lang.Integer">
...@@ -136,8 +136,8 @@ ...@@ -136,8 +136,8 @@
<if test=" name != null and name != '' "> <if test=" name != null and name != '' ">
and `name` = #{name} and `name` = #{name}
</if> </if>
<if test=" subId != null and subId != '' "> <if test=" id != null and id != '' ">
and id != #{subId} and id != #{id}
</if> </if>
<if test=" categoryPrimaryId != null and categoryPrimaryId != '' "> <if test=" categoryPrimaryId != null and categoryPrimaryId != '' ">
and category_primary_id != #{categoryPrimaryId} and category_primary_id != #{categoryPrimaryId}
...@@ -157,25 +157,25 @@ ...@@ -157,25 +157,25 @@
</if> </if>
update_time=NOW() update_time=NOW()
</set> </set>
where id = #{subId} where id = #{id}
</update> </update>
<delete id="deleteSubCategory"> <delete id="deleteSubCategory">
delete delete
from category_sub from category_sub
where id = #{subId} where id = #{id}
</delete> </delete>
<select id="detailSubCategory" resultType="com.mmc.pms.entity.category.CategorySubDO"> <select id="detailSubCategory" resultType="com.mmc.pms.entity.category.CategorySubDO">
select id AS subId, select id,
`name`, `name`,
description, description,
create_time AS createTime, create_time AS createTime,
update_time AS updateTime, update_time AS updateTime,
category_primary_id AS categoryPrimaryId category_primary_id AS categoryPrimaryId
from category_sub from category_sub
where id = #{subId} where id = #{id}
</select> </select>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论