删除 修改

masters
Carl 2024-11-17 19:52:21 +08:00
parent 0065e444a3
commit 793ac29194
10 changed files with 156 additions and 8 deletions

View File

@ -62,8 +62,29 @@ public class CategoryInfo extends TreeEntity {
@ApiModelProperty(name = "介绍", value = "介绍")
private String introduction;
@Excel(name = "备注")
@ApiModelProperty(name = "备注", value = "备注")
private String remark;
@Excel(name = "创建人")
@ApiModelProperty(name = "创建人", value = "创建人")
private String create_by;
@Excel(name = "创建时间")
@ApiModelProperty(name = "创建时间", value = "创建时间")
private Date create_time;
@Excel(name = "修改人")
@ApiModelProperty(name = "修改人", value = "修改人")
private String update_by;
@Excel(name = "修改时间")
@ApiModelProperty(name = "修改时间", value = "修改时间")
private Date update_time;
/**
*
@ -102,6 +123,11 @@ public class CategoryInfo extends TreeEntity {
.image(categoryInfoEditReq.getImage())
.start(categoryInfoEditReq.getStart())
.introduction(categoryInfoEditReq.getIntroduction())
.remark(categoryInfoEditReq.getRemark())
.create_by(categoryInfoEditReq.getCreateBy())
.create_time(categoryInfoEditReq.getCreateTime())
.update_by(categoryInfoEditReq.getUpdateBy())
.update_time(new Date())
.build();
}

View File

@ -134,7 +134,7 @@ public class ProjectInfo extends BaseEntity {
*/
public static ProjectInfo editBuild(Long id, ProjectInfoEditReq projectInfoEditReq){
return ProjectInfo.builder()
.id(id)
.id(id)
.name(projectInfoEditReq.getName())
.introduction(projectInfoEditReq.getIntroduction())
.mianType(projectInfoEditReq.getMianType())

View File

@ -118,8 +118,13 @@ public class CategoryInfoController extends BaseController {
@DeleteMapping("/{ids}")
@ApiOperation("删除品类信息")
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
public Result<String> remove(@PathVariable List<Long> ids) {
return toAjax(categoryInfoService.removeBatchByIds(ids));
public Result<String> remove(@PathVariable String ids) {
categoryInfoService.removeBatchByIdsDel(ids);
return Result.success();
}
/**

View File

@ -77,6 +77,7 @@ public class ProjectInfoController extends BaseController {
@GetMapping(value = "/{id}")
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
public Result<ProjectInfo> getInfo(@PathVariable("id") Long id) {
return Result.success(projectInfoCache.get(id));
}

View File

@ -104,7 +104,7 @@ public class RuleAttrInfoController extends BaseController {
}
/**
* wyz
*
*/
@RequiresPermissions("product:ruleAttr:edit")
@Log(title = "规格xuigai", businessType = BusinessType.UPDATE)
@ -117,6 +117,7 @@ public class RuleAttrInfoController extends BaseController {
}
/**
*
*/

View File

@ -0,0 +1,12 @@
package com.muyu.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.CategoryInfo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface CategoryMapper extends BaseMapper<CategoryInfo> {
Integer selectall(String ids);
}

View File

@ -10,6 +10,8 @@ import com.muyu.product.domain.req.CategoryInfoEditReq;
import com.muyu.product.domain.resp.CategoryCommonElementResp;
import com.muyu.product.domain.resp.CategoryInfoUpdResp;
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
import com.muyu.product.mapper.CategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@ -20,6 +22,12 @@ import java.util.List;
* @date 2024-02-27
*/
public interface CategoryInfoService extends IService<CategoryInfo> {
/**
*
*
@ -84,4 +92,6 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
/** 获取品类信息详细信息 wyz*/
CategoryInfoUpdResp getByIdUpd(Long id);
void removeBatchByIdsDel(String ids);
}

View File

@ -14,10 +14,7 @@ import com.muyu.product.domain.req.CategoryInfoEditReq;
import com.muyu.product.domain.resp.CategoryCommonElementResp;
import com.muyu.product.domain.resp.CategoryInfoUpdResp;
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
import com.muyu.product.mapper.AsCategoryAttributeGroupMapper;
import com.muyu.product.mapper.AsCategoryAttributeMapper;
import com.muyu.product.mapper.AsCategoryBrandMapper;
import com.muyu.product.mapper.CategoryInfoMapper;
import com.muyu.product.mapper.*;
import com.muyu.product.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -41,6 +38,8 @@ import java.util.stream.Stream;
@Service
public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, CategoryInfo> implements CategoryInfoService {
@Autowired
private CategoryMapper categoryMapper;
@Autowired
private AsCategoryAttributeService asCategoryAttributeService;
@ -324,6 +323,17 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
.build();
}
@Override
public void removeBatchByIdsDel(String ids) {
Integer selectall = categoryMapper.selectall(ids);
if(selectall>0){
throw new SecurityException("有关联子集不能删除");
}
categoryMapper.deleteById(ids);
}
/**修改 品类中 的 商品品牌组 brandIdList**/
private void updateAsCategoryBrandMapper(Long id, CategoryInfoEditReq categoryInfoEditReq) {
//修改 品类中 的 商品属性 attributeIdList

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.product.mapper.CategoryMapper">
<resultMap type="com.muyu.product.domain.CommentInfo" id="CommentInfoResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="comment" column="comment" />
<result property="images" column="images" />
<result property="parentId" column="parent_id" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectCommentInfoVo">
select id, project_id, comment, images, parent_id, remark, create_by, create_time, update_by, update_time from comment_info
</sql>
<select id="selectall" resultType="java.lang.Integer">
select count(1) from category_info where parent_id=#{ids}
</select>
</mapper>

56
unnamed.patch 100644
View File

@ -0,0 +1,56 @@
Index: muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AttributeGroupService.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AttributeGroupService.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AttributeGroupService.java
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AttributeGroupService.java (revision c3210636342974c973c50cd72e3d75427bf31668)
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AttributeGroupService.java (revision 0065e444a3853fa35aa843b4798217ca6b4cc5dc)
@@ -42,18 +42,18 @@
public Boolean save(AttributeGroupSaveModel attributeGroupSaveModel);
/**
- * 吴彦祖 的 修改 属性
+ * 修改 属性
*/
void updateAttribute(Long id, AttributeGroupEditReq attributeGroupEditReq);
/**
- * 吴彦祖 的 回显属性组
+ * 回显属性组
* @param id
* @return
*/
AttributeGroupUpd getByIdUpd(Long id);
/**
- * 修改 属性 状态 wyz
+ * 修改 属性 状态
* @param attributeGroupStateReq
*/
void updateState(AttributeGroupStateReq attributeGroupStateReq);
Index: muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java (revision c3210636342974c973c50cd72e3d75427bf31668)
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java (revision 0065e444a3853fa35aa843b4798217ca6b4cc5dc)
@@ -108,7 +108,7 @@
}
/**
- * 商品规格 回显wyz
+ * 商品规格 回显
* @param id
* @return
*/
@@ -133,7 +133,7 @@
/**
- * 商品规格 修改wyz
+ * 商品规格 修改
* @return
*/
@Override