Compare commits

...

No commits in common. "master" and "793ac29194464e5abf0f8646b08dfc6701823eb3" have entirely different histories.

64 changed files with 1070 additions and 119 deletions

View File

@ -14,10 +14,11 @@ spring:
nacos:
discovery:
# 服务注册地址
server-addr: 124.70.138.118:8848
server-addr: 124.70.138.118:8848
config:
# 配置中心地址
server-addr: 124.70.138.118:8848
namespace: 13fd7cff-3c6b-4fca-bccc-5044efe3993f
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -21,6 +21,10 @@ public enum BusinessType {
*/
UPDATE,
/**
*
*/
UPDATE_CUSTOMIZE,
/**
*
*/

View File

@ -18,6 +18,7 @@ spring:
config:
# 配置中心地址
server-addr: 124.70.138.118:8848
namespace: 13fd7cff-3c6b-4fca-bccc-5044efe3993f
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -18,6 +18,7 @@ spring:
config:
# 配置中心地址
server-addr: 124.70.138.118:8848
namespace: 13fd7cff-3c6b-4fca-bccc-5044efe3993f
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -18,6 +18,7 @@ spring:
config:
# 配置中心地址
server-addr: 124.70.138.118:8848
namespace: 13fd7cff-3c6b-4fca-bccc-5044efe3993f
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -18,6 +18,7 @@ spring:
config:
# 配置中心地址
server-addr: 124.70.138.118:8848
namespace: 13fd7cff-3c6b-4fca-bccc-5044efe3993f
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -45,11 +45,11 @@ public class AsAttributeGroup extends BaseEntity {
private Long attributeId;
public static AsAttributeGroup buildGroup (Long attributeGroupId,
Long attributeId) {
public static AsAttributeGroup buildGroup (Long attributeGroupId, Long attributeId) {
return AsAttributeGroup.builder()
.groupId(attributeGroupId)
.attributeId(attributeId)
.build();
}
}

View File

@ -5,10 +5,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import com.muyu.product.domain.req.AttributeGroupStateReq;
import lombok.*;
import lombok.experimental.SuperBuilder;
import io.swagger.annotations.*;
import com.muyu.common.core.annotation.Excel;
@ -75,8 +73,7 @@ public class AttributeGroup extends BaseEntity {
*/
public static AttributeGroup editBuild(Long id, AttributeGroupEditReq attributeGroupEditReq){
return AttributeGroup.builder()
.id(id)
.name(attributeGroupEditReq.getName())
.id(id)
.states(attributeGroupEditReq.getStates())
.build();
}

View File

@ -3,21 +3,21 @@ package com.muyu.product.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.TreeEntity;
import com.muyu.product.domain.model.CategoryInfoSaveModel;
import com.muyu.product.domain.req.CategoryInfoEditReq;
import com.muyu.product.domain.req.CategoryInfoQueryReq;
import com.muyu.product.domain.req.CategoryInfoSaveReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;
import io.swagger.annotations.*;
import com.muyu.common.core.annotation.Excel;
import com.muyu.product.domain.req.CategoryInfoQueryReq;
import com.muyu.product.domain.req.CategoryInfoSaveReq;
import com.muyu.product.domain.req.CategoryInfoEditReq;
import com.muyu.common.core.web.domain.TreeEntity;
import java.util.Date;
import java.util.function.Function;
import java.util.function.Supplier;
/**
@ -62,6 +62,30 @@ 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;
/**
*
*/
@ -99,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

@ -56,6 +56,7 @@ public class RuleAttrInfo extends BaseEntity {
@ApiModelProperty(name = "规格值", value = "规格值")
private String attrValue;
/**
*
*/

View File

@ -51,6 +51,10 @@ public class RuleInfo extends BaseEntity {
@ApiModelProperty(name = "规格状态", value = "规格状态")
private String status;
/** 规格状态 */
@Excel(name = "规格描述")
@ApiModelProperty(name = "规格描述", value = "规格描述")
private String remark;
/**
*
*/

View File

@ -3,6 +3,7 @@ package com.muyu.product.domain.model;
import com.muyu.common.core.web.domain.BaseEntity;
import com.muyu.product.domain.AttributeGroup;
import com.muyu.product.domain.req.AttributeGroupSaveReq;
import com.muyu.product.domain.req.AttributeGroupStateReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -27,6 +28,8 @@ public class AttributeGroupSaveModel extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 状态 id */
private Long id;
/** 组名称 */
private String name;
@ -46,6 +49,13 @@ public class AttributeGroupSaveModel extends BaseEntity {
.build();
}
public static AttributeGroupStateReq updateState(AttributeGroupStateReq attributeGroupStateReq) {
return AttributeGroupStateReq.builder()
.id(attributeGroupStateReq.getId())
.states(attributeGroupStateReq.getStates())
.build();
}
public AttributeGroup buildAttributeGroup () {
return AttributeGroup.builder()
.name(this.getName())

View File

@ -31,6 +31,7 @@ public class CategoryInfoSaveModel extends TreeEntity {
private static final long serialVersionUID = 1L;
/** 品类名称 */
private String name;

View File

@ -1,7 +1,10 @@
package com.muyu.product.domain.req;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.product.domain.AttributeInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@ -33,5 +36,8 @@ public class AttributeGroupEditReq extends BaseEntity {
@ApiModelProperty(name = "状态", value = "状态", required = true)
private String states;
/** 属性id 集合 */
@ApiModelProperty(name = "属性集合", value = "属性集合", required = true)
private List<AttributeInfo> attributeList;
}

View File

@ -0,0 +1,24 @@
package com.muyu.product.domain.req;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AttributeGroupStateReq {
/** 属性id */
@ApiModelProperty(name = "属性id", value = "属性id", required = true)
private Long id;
/** 状态 */
@ApiModelProperty(name = "状态", value = "状态", required = true)
private String states;
}

View File

@ -0,0 +1,34 @@
package com.muyu.product.domain.req;
import com.muyu.product.domain.AttributeInfo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AttributeGroupUpdReq {
/**
*id
*/
private Long id;
/**
*
*/
private String name;
/**
*
*/
private String remark;
/**
* id
*/
private List<AttributeInfo> attributeList;
}

View File

@ -8,6 +8,8 @@ import lombok.experimental.SuperBuilder;
import io.swagger.annotations.*;
import com.muyu.common.core.web.domain.TreeEntity;
import java.util.List;
/**
* category_info
*
@ -39,4 +41,21 @@ public class CategoryInfoEditReq extends TreeEntity {
@ApiModelProperty(name = "介绍", value = "介绍")
private String introduction;
/**
* ID
*/
@ApiModelProperty(name = "商品属性组关联ID", value = "商品属性组关联ID")
private List<Long> attributeGroupIdList;
/**
* ID
*/
@ApiModelProperty(name = "商品属性关联ID", value = "商品属性关联ID")
private List<Long> attributeIdList;
/**
* ID
*/
@ApiModelProperty(name = "商品品牌组关联ID", value = "商品品牌组关联ID")
private List<Long> brandIdList;
}

View File

@ -1,5 +1,6 @@
package com.muyu.product.domain.req;
import com.muyu.product.domain.model.RuleAttrAddModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@ -7,6 +8,9 @@ import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;
import io.swagger.annotations.*;
import com.muyu.common.core.web.domain.BaseEntity;
import org.springframework.beans.PropertyValues;
import java.util.List;
/**
* rule_info
@ -30,5 +34,9 @@ public class RuleInfoEditReq extends BaseEntity {
/** 规格状态 */
@ApiModelProperty(name = "规格状态", value = "规格状态")
private String status;
/**
*
*/
@ApiModelProperty(name = "规格子集", value = "规格子集")
private List<RuleAttrAddModel> ruleAttrList;
}

View File

@ -26,6 +26,9 @@ public class RuleInfoSaveReq extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 规格名称 */
@ApiModelProperty(name = "规格id", value = "规格id")
private Long id;
/** 规格名称 */
@ApiModelProperty(name = "规格名称", value = "规格名称")
private String name;

View File

@ -0,0 +1,15 @@
package com.muyu.product.domain.req;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class WyzRuleInfoSaveReq {
public Long id;
public String status;
}

View File

@ -34,6 +34,9 @@ public class AttributeGroupPageResp extends BaseEntity {
/** 状态 */
private String states;
/** 备注*/
private String remark;
/**
*

View File

@ -0,0 +1,31 @@
package com.muyu.product.domain.resp;
import com.muyu.product.domain.AttributeInfo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class AttributeGroupUpd {
/** 属性组编号 */
private Long id;
/** 组名称 */
private String name;
/** 状态 */
private String states;
/**
* id
*/
private List<AttributeInfo> attributeList;
}

View File

@ -0,0 +1,63 @@
package com.muyu.product.domain.resp;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.muyu.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@AllArgsConstructor
@Builder
@NoArgsConstructor
@Data
/** 品类信息*/
public class CategoryInfoUpdResp {
/** 主键 */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(name = "主键", value = "主键")
private Long id;
/** 品类名称 */
@Excel(name = "品类名称")
@ApiModelProperty(name = "品类名称", value = "品类名称", required = true)
private String name;
/** 图片 */
@Excel(name = "图片")
@ApiModelProperty(name = "图片", value = "图片", required = true)
private String image;
/** 是否启用 */
@Excel(name = "是否启用")
@ApiModelProperty(name = "是否启用", value = "是否启用", required = true)
private String start;
/** 介绍 */
@Excel(name = "介绍")
@ApiModelProperty(name = "介绍", value = "介绍")
private String introduction;
/**
* ID
* AttributeGroup
*/
/**
*
*/
private List<Long> attributeInfoList;
/**
*
*/
private List<Long> attributeGroupList;
/**
*
*/
private List<Long> brandInfoList;
}

View File

@ -0,0 +1,38 @@
package com.muyu.product.domain.resp;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.muyu.common.core.annotation.Excel;
import com.muyu.product.domain.model.RuleAttrAddModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
/**
*
*/
public class RuleInfoUpdResp {
/** 主键 */
private Long id;
/** 规格名称 */
private String name;
/** 规格状态 */
private String status;
/** 规格描述*/
private String remark;
/**
*
*/
private List<RuleAttrAddModel> ruleAttrList;
}

View File

@ -4,7 +4,9 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.muyu.product.domain.model.AttributeGroupSaveModel;
import com.muyu.product.domain.req.AttributeGroupStateReq;
import com.muyu.product.domain.resp.AttributeGroupPageResp;
import com.muyu.product.domain.resp.AttributeGroupUpd;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -74,8 +76,8 @@ public class AttributeGroupController extends BaseController {
@RequiresPermissions("product:attributeGroup:query")
@GetMapping(value = "/{id}")
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
public Result<AttributeGroup> getInfo(@PathVariable("id") Long id) {
return Result.success(attributeGroupService.getById(id));
public Result<AttributeGroupUpd> getInfo(@PathVariable("id") Long id) {
return Result.success(attributeGroupService.getByIdUpd(id));
}
/**
@ -99,7 +101,20 @@ public class AttributeGroupController extends BaseController {
@PutMapping("/{id}")
@ApiOperation("修改属性组")
public Result<String> edit(@PathVariable Long id, @RequestBody AttributeGroupEditReq attributeGroupEditReq) {
return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));
attributeGroupService.updateAttribute(id,attributeGroupEditReq);
return Result.success("修改成功");
}
/***
*
*/
@RequiresPermissions("product:attributeGroup:edit")
@Log(title = "属性状态", businessType = BusinessType.UPDATE)
@PutMapping("/updateState")
@ApiOperation("修改属性状态")
public Result<String> updateState(@RequestBody AttributeGroupStateReq attributeGroupStateReq) {
attributeGroupService.updateState(attributeGroupStateReq);
return Result.success("修改成功");
}
/**
@ -113,4 +128,6 @@ public class AttributeGroupController extends BaseController {
public Result<String> remove(@PathVariable List<Long> ids) {
return toAjax(attributeGroupService.removeBatchByIds(ids));
}
}

View File

@ -1,37 +1,28 @@
package com.muyu.product.controller;
import java.util.List;
import java.util.function.Supplier;
import javax.servlet.http.HttpServletResponse;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.product.domain.AttributeGroup;
import com.muyu.product.domain.AttributeInfo;
import com.muyu.product.domain.BrandInfo;
import com.muyu.product.domain.model.CategoryInfoSaveModel;
import com.muyu.product.domain.resp.CategoryCommonElementResp;
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log;
import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.product.domain.CategoryInfo;
import com.muyu.product.domain.req.CategoryInfoQueryReq;
import com.muyu.product.domain.req.CategoryInfoSaveReq;
import com.muyu.product.domain.model.CategoryInfoSaveModel;
import com.muyu.product.domain.req.CategoryInfoEditReq;
import com.muyu.product.domain.req.CategoryInfoSaveReq;
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.service.CategoryInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
@ -77,8 +68,8 @@ public class CategoryInfoController extends BaseController {
@RequiresPermissions("product:category:query")
@GetMapping(value = "/{id}")
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
public Result<CategoryInfo> getInfo(@PathVariable("id") Long id) {
return Result.success(categoryInfoService.getById(id));
public Result<CategoryInfoUpdResp> getInfo(@PathVariable("id") Long id) {
return Result.success(categoryInfoService.getByIdUpd(id));
}
/**
@ -104,7 +95,6 @@ public class CategoryInfoController extends BaseController {
CategoryInfoSaveModel.saveBuild(categoryInfoSaveReq, SecurityUtils::getUsername)
));
}
/**
*
*/
@ -113,7 +103,11 @@ public class CategoryInfoController extends BaseController {
@PutMapping("/{id}")
@ApiOperation("修改品类信息")
public Result<String> edit(@PathVariable Long id, @RequestBody CategoryInfoEditReq categoryInfoEditReq) {
return toAjax(categoryInfoService.updateById(CategoryInfo.editBuild(id,categoryInfoEditReq)));
boolean b = categoryInfoService.updateUpdById(id, categoryInfoEditReq);
if (b){
return Result.success("修改成功");
}
return Result.success("......");
}
/**
@ -124,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

@ -3,6 +3,7 @@ package com.muyu.product.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.muyu.product.domain.req.*;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -20,9 +21,6 @@ import com.muyu.common.log.annotation.Log;
import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.product.domain.RuleAttrInfo;
import com.muyu.product.domain.req.RuleAttrInfoQueryReq;
import com.muyu.product.domain.req.RuleAttrInfoSaveReq;
import com.muyu.product.domain.req.RuleAttrInfoEditReq;
import com.muyu.product.service.RuleAttrInfoService;
import com.muyu.common.core.web.page.TableDataInfo;
@ -105,6 +103,21 @@ public class RuleAttrInfoController extends BaseController {
return toAjax(ruleAttrInfoService.updateById(RuleAttrInfo.editBuild(id,ruleAttrInfoEditReq)));
}
/**
*
*/
@RequiresPermissions("product:ruleAttr:edit")
@Log(title = "规格xuigai", businessType = BusinessType.UPDATE)
@PutMapping("/ruleInfoStateReq")
@ApiOperation("修改规格 属性")
public Result<String> ruleInfoStateReq(@RequestBody WyzRuleInfoSaveReq wyzRuleInfoSaveReq) {
ruleAttrInfoService.updateSaveById(wyzRuleInfoSaveReq);
return Result.success("修改成功");
}
/**
*
*/

View File

@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
import com.muyu.common.core.text.Convert;
import com.muyu.product.domain.model.RuleInfoAddModel;
import com.muyu.product.domain.resp.RuleInfoResp;
import com.muyu.product.domain.resp.RuleInfoUpdResp;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -77,8 +78,8 @@ public class RuleInfoController extends BaseController {
@RequiresPermissions("product:rule:query")
@GetMapping(value = "/{id}")
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
public Result<RuleInfo> getInfo(@PathVariable("id") Long id) {
return Result.success(ruleInfoService.getById(id));
public Result<RuleInfoUpdResp> getInfo(@PathVariable("id") Long id) {
return Result.success(ruleInfoService.getUpdById(id));
}
/**
@ -100,7 +101,7 @@ public class RuleInfoController extends BaseController {
@PutMapping("/{id}")
@ApiOperation("修改商品规格")
public Result<String> edit(@PathVariable Long id, @RequestBody RuleInfoEditReq ruleInfoEditReq) {
return toAjax(ruleInfoService.updateById(RuleInfo.editBuild(id,ruleInfoEditReq)));
return toAjax(ruleInfoService.updateGoodsSpecifications(id,ruleInfoEditReq));
}
/**

View File

@ -3,6 +3,8 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsAttributeGroup;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -10,6 +12,11 @@ import com.muyu.product.domain.AsAttributeGroup;
* @author DongZeLiang
* @date 2024-02-27
*/
@Mapper
public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> {
//删除 属性组
void delete(Long id);
//添加 属性组
void add(@Param("groupId") Long groupId, @Param("id") Long id);
}

View File

@ -1,8 +1,11 @@
package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsCategoryAttributeGroup;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
@ -10,6 +13,20 @@ import com.muyu.product.domain.AsCategoryAttributeGroup;
* @author DongZeLiang
* @date 2024-02-27
*/
@Mapper
public interface AsCategoryAttributeGroupMapper extends BaseMapper<AsCategoryAttributeGroup> {
/**删除 品类 属性组 中间表 */
void deleteAsCategoryAttributeGroup(Long id);
/**
*
* categoryId:id
* attributeGroupId:id
*/
void addAsCategoryAttributeGroup(@Param("categoryId") Long categoryId, @Param("attributeGroupId") Long attributeGroupId);
/**
*
*/
List<Long> selectAsCategoryAttributeGroupList(@Param("id") Long id);
}

View File

@ -1,8 +1,11 @@
package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsCategoryAttribute;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
@ -10,6 +13,22 @@ import com.muyu.product.domain.AsCategoryAttribute;
* @author DongZeLiang
* @date 2024-02-27
*/
@Mapper
public interface AsCategoryAttributeMapper extends BaseMapper<AsCategoryAttribute> {
}
/**删除 品类 属性 中间表 */
void deleteAsCategoryAttribute(Long id);
/**
*
* categoryId:id
* attributeId:id
*/
void addAsCategoryAttribute(@Param("categoryId") Long categoryId, @Param("attributeId") Long attributeId);
/**
*
*/
List<Long> selectAsCategoryAttributeList(@Param("id") Long id);
}

View File

@ -1,8 +1,11 @@
package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsCategoryBrand;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
@ -10,6 +13,21 @@ import com.muyu.product.domain.AsCategoryBrand;
* @author DongZeLiang
* @date 2024-02-27
*/
@Mapper
public interface AsCategoryBrandMapper extends BaseMapper<AsCategoryBrand> {
/**删除 品类 品牌 中间表 */
void deleteAsCategoryBrandMapper(Long id);
/**
*
* categoryId:id
* brandId:id
*/
void addAsCategoryBrandMapper(@Param("categoryId") Long categoryId, @Param("brandId") Long brandId);
/**
*
*/
List<Long> selectAsCategoryBrandList(@Param("id") Long id);
}

View File

@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AttributeGroup;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
@ -10,6 +11,8 @@ import com.muyu.product.domain.AttributeGroup;
* @author DongZeLiang
* @date 2024-02-27
*/
@Mapper
public interface AttributeGroupMapper extends BaseMapper<AttributeGroup> {
}

View File

@ -1,8 +1,8 @@
package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.CategoryInfo;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
@ -10,6 +10,10 @@ import com.muyu.product.domain.CategoryInfo;
* @author DongZeLiang
* @date 2024-02-27
*/
@Mapper
public interface CategoryInfoMapper extends BaseMapper<CategoryInfo> {
//修改 品类
boolean updateCategoryInfo( CategoryInfo categoryInfo );
}

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

@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.RuleInfo;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
@ -10,6 +11,7 @@ import com.muyu.product.domain.RuleInfo;
* @author DongZeLiang
* @date 2024-02-27
*/
@Mapper
public interface RuleInfoMapper extends BaseMapper<RuleInfo> {
}

View File

@ -15,6 +15,7 @@ public interface AsAttributeGroupService extends IService<AsAttributeGroup> {
*
*
* @param asAttributeGroup
*
* @return
*/
public List<AsAttributeGroup> list(AsAttributeGroup asAttributeGroup);

View File

@ -1,13 +1,15 @@
package com.muyu.product.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.product.domain.AttributeGroup;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.product.domain.AttributeInfo;
import com.muyu.product.domain.model.AttributeGroupSaveModel;
import com.muyu.product.domain.req.AttributeGroupEditReq;
import com.muyu.product.domain.req.AttributeGroupStateReq;
import com.muyu.product.domain.resp.AttributeGroupPageResp;
import com.muyu.product.domain.resp.AttributeGroupUpd;
import java.util.List;
/**
* Service
@ -39,4 +41,20 @@ public interface AttributeGroupService extends IService<AttributeGroup> {
*/
public Boolean save(AttributeGroupSaveModel attributeGroupSaveModel);
/**
*
*/
void updateAttribute(Long id, AttributeGroupEditReq attributeGroupEditReq);
/**
*
* @param id
* @return
*/
AttributeGroupUpd getByIdUpd(Long id);
/**
*
* @param attributeGroupStateReq
*/
void updateState(AttributeGroupStateReq attributeGroupStateReq);
}

View File

@ -1,15 +1,19 @@
package com.muyu.product.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.product.domain.AttributeGroup;
import com.muyu.product.domain.AttributeInfo;
import com.muyu.product.domain.BrandInfo;
import com.muyu.product.domain.CategoryInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.product.domain.model.CategoryInfoSaveModel;
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;
/**
* Service
@ -18,6 +22,12 @@ import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
* @date 2024-02-27
*/
public interface CategoryInfoService extends IService<CategoryInfo> {
/**
*
*
@ -69,4 +79,19 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId);
public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService);
/**
*
* @param id
* @param categoryInfoEditReq
* @return
*/
boolean updateUpdById(Long id, CategoryInfoEditReq categoryInfoEditReq);
/** 获取品类信息详细信息 wyz*/
CategoryInfoUpdResp getByIdUpd(Long id);
void removeBatchByIdsDel(String ids);
}

View File

@ -3,6 +3,8 @@ package com.muyu.product.service;
import java.util.List;
import com.muyu.product.domain.RuleAttrInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.product.domain.req.RuleInfoSaveReq;
import com.muyu.product.domain.req.WyzRuleInfoSaveReq;
/**
* Service
@ -25,4 +27,9 @@ public interface RuleAttrInfoService extends IService<RuleAttrInfo> {
* @return
*/
List<RuleAttrInfo> getInfoByRuleId (Long ruleId);
/**
*
*/
void updateSaveById(WyzRuleInfoSaveReq wyzRuleInfoSaveReq);
}

View File

@ -6,8 +6,10 @@ import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.product.domain.RuleInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.product.domain.model.RuleInfoAddModel;
import com.muyu.product.domain.req.RuleInfoEditReq;
import com.muyu.product.domain.req.RuleInfoQueryReq;
import com.muyu.product.domain.resp.RuleInfoResp;
import com.muyu.product.domain.resp.RuleInfoUpdResp;
/**
* Service
@ -32,4 +34,20 @@ public interface RuleInfoService extends IService<RuleInfo> {
public boolean save(RuleInfoAddModel ruleInfoAddModel);
TableDataInfo<RuleInfoResp> queryList (RuleInfoQueryReq ruleInfoQueryReq);
/**
*
* @param id
* @return
*/
RuleInfoUpdResp getUpdById(Long id);
/**
*
* @param id
* @param ruleInfoEditReq
* @return
*/
boolean updateGoodsSpecifications(Long id, RuleInfoEditReq ruleInfoEditReq);
}

View File

@ -1,6 +1,8 @@
package com.muyu.product.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.utils.ObjUtils;
@ -9,7 +11,11 @@ import com.muyu.product.domain.AsAttributeGroup;
import com.muyu.product.domain.AttributeGroup;
import com.muyu.product.domain.AttributeInfo;
import com.muyu.product.domain.model.AttributeGroupSaveModel;
import com.muyu.product.domain.req.AttributeGroupEditReq;
import com.muyu.product.domain.req.AttributeGroupStateReq;
import com.muyu.product.domain.resp.AttributeGroupPageResp;
import com.muyu.product.domain.resp.AttributeGroupUpd;
import com.muyu.product.mapper.AsAttributeGroupMapper;
import com.muyu.product.mapper.AttributeGroupMapper;
import com.muyu.product.service.AsAttributeGroupService;
import com.muyu.product.service.AttributeGroupService;
@ -19,9 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Stream;
/**
* Service
@ -33,12 +38,23 @@ import java.util.stream.Stream;
@Service
public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper, AttributeGroup> implements AttributeGroupService {
//属性与组中间列表
@Autowired
private AsAttributeGroupService attributeGroupService;
//商品属性Service接口
@Autowired
private AttributeInfoService attributeInfoService;
/**
*
*/
@Autowired
private AsAttributeGroupMapper attributeGroupMapper;
@Autowired
private AttributeGroupMapper mapper;
/**
*
*
@ -81,14 +97,15 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
queryWrapper.eq(AttributeGroup::getStates, attributeGroup.getStates());
}
if (ObjUtils.notNull(attributeGroup.getRemark())) {
queryWrapper.eq(AttributeGroup::getRemark, attributeGroup.getRemark());
}
return list(queryWrapper);
}
/**
*
*
* @param attributeGroupSaveModel
*
* @return
*/
@Override
@ -107,4 +124,78 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
);
return save;
}
/**
*
*/
@Override
public void updateAttribute(Long id, AttributeGroupEditReq attributeGroupEditReq) {
//删除原 属性组
attributeGroupMapper.delete(id);
//获取新数据组
List<AttributeInfo> list = attributeGroupEditReq.getAttributeList();
//添加
for (AttributeInfo info : list) {
attributeGroupMapper.add(id,info.getId());
}
}
/**
*
* @param attributeGroupStateReq
*/
@Override
public void updateState(AttributeGroupStateReq attributeGroupStateReq) {
LambdaQueryWrapper<AttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AttributeGroup ::getId ,attributeGroupStateReq.getId());
AttributeGroup attributeGroup = new AttributeGroup();
attributeGroup.setStates(attributeGroupStateReq.getStates());
mapper.update(attributeGroup,queryWrapper);
}
/**
*
* @param id
* @return
*/
@Override
public AttributeGroupUpd getByIdUpd(Long id) {
//获取当前id的 组
AttributeGroup byId = this.getById(id);
//查询 该 组 的 属性 集合
LambdaQueryWrapper<AsAttributeGroup> wrapper = new LambdaQueryWrapper<>();
//返回
wrapper.eq(AsAttributeGroup::getGroupId,id);
List<AsAttributeGroup> asAttributeGroups=attributeGroupService.list(wrapper);
//判断当前会显得 属性及 是否为空
if (asAttributeGroups.size() != 0){
List<Long> longList = asAttributeGroups.stream()
.map(AsAttributeGroup::getAttributeId)//属性
.toList();
List<AttributeInfo> attributeInfos = attributeInfoService.listByIds(longList);
return AttributeGroupUpd.builder()
.id(byId.getId())
.name(byId.getName())
.attributeList(//属性
attributeInfos
).build();//修改回显时信息
}
List<Long> list =new ArrayList<>();
List<AttributeInfo> attributeInfos = attributeInfoService.listByIds(list);
return AttributeGroupUpd.builder()
.id(byId.getId())
.name(byId.getName())
.attributeList(//属性
attributeInfos
).build();//修改回显时信息
}
}

View File

@ -10,9 +10,11 @@ import com.muyu.product.domain.base.CategoryBase;
import com.muyu.product.domain.model.CategoryInfoSaveModel;
import com.muyu.product.domain.model.TemplateAttributeGroupModel;
import com.muyu.product.domain.model.TemplateAttributeModel;
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.CategoryInfoMapper;
import com.muyu.product.mapper.*;
import com.muyu.product.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -36,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;
@ -58,6 +62,14 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
@Autowired
private AttributeGroupService attributeGroupService;
@Autowired
private AsCategoryAttributeGroupMapper attributeGroupMapper;
@Autowired
private AsCategoryAttributeMapper asCategoryAttributeMapper;
@Autowired
private AsCategoryBrandMapper asCategoryBrandMapper;
/**
*
*
@ -270,6 +282,95 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
return list;
}
@Override
public boolean updateUpdById(Long id, CategoryInfoEditReq categoryInfoEditReq) {
LambdaQueryWrapper<CategoryInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CategoryInfo::getId,id);
//修改 品类信息
CategoryInfo info = CategoryInfo.editBuild(id, categoryInfoEditReq);
if (info != null){
//修改 品类中 的 商品属性 attributeIdList
updateAttributeIdList(id, categoryInfoEditReq);
//修改 品类中 的 商品属性组 (attributeGroupIdList)
updateAttributeGroupIdList(id, categoryInfoEditReq);
//修改 品类中 的 商品品牌组 brandIdList
updateAsCategoryBrandMapper(id, categoryInfoEditReq);
return true;
}
return false;
}
/** 获取品类信息详细信息 wyz*/
@Override
public CategoryInfoUpdResp getByIdUpd(Long id) {
LambdaQueryWrapper<CategoryInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CategoryInfo::getId,id);
CategoryInfo byId = this.getById(id);
//查询 品类信息
return CategoryInfoUpdResp.builder()
.id(byId.getId())
.name(byId.getName())
.image(byId.getImage())
.start(byId.getStart())
.introduction(byId.getIntroduction())
.attributeInfoList(attributeGroupMapper.selectAsCategoryAttributeGroupList(id))
.attributeGroupList(attributeGroupMapper.selectAsCategoryAttributeGroupList(id))
.brandInfoList(asCategoryBrandMapper.selectAsCategoryBrandList(id))
.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
/** 删除商品品牌组*/
asCategoryBrandMapper.deleteAsCategoryBrandMapper(id);
//获取 入参中的 商品品牌组 id 集合
List<Long> list = categoryInfoEditReq.getBrandIdList();
for (Long aLong : list) {
//添加 品类 商品品牌组 中间 表
asCategoryBrandMapper.addAsCategoryBrandMapper(id,aLong);
}
}
/**修改 品类中 的 商品属性 attributeIdList**/
private void updateAttributeIdList(Long id, CategoryInfoEditReq categoryInfoEditReq) {
//修改 品类中 的 商品属性 attributeIdList
/** 删除属性*/
asCategoryAttributeMapper.deleteAsCategoryAttribute(id);
//获取 入参中的 属性 id 集合
List<Long> list = categoryInfoEditReq.getAttributeIdList();
for (Long aLong : list) {
//添加 品类 属性 中间 表
asCategoryAttributeMapper.addAsCategoryAttribute(id,aLong);
}
}
/**修改 品类中 的 商品属性组 updateAttributeGroupIdList**/
private void updateAttributeGroupIdList(Long id, CategoryInfoEditReq categoryInfoEditReq) {
/** 删除 属性组*/
attributeGroupMapper.deleteAsCategoryAttributeGroup(id);
/** 添加 属性组*/
List<Long> list = categoryInfoEditReq.getAttributeGroupIdList();
for (Long aLong : list) {
attributeGroupMapper.addAsCategoryAttributeGroup(id,aLong);
}
}
/**
* ID
*

View File

@ -3,7 +3,14 @@ package com.muyu.product.service.impl;
import java.util.List;
import com.muyu.common.core.utils.ObjUtils;
import com.muyu.product.domain.AttributeGroup;
import com.muyu.product.domain.RuleInfo;
import com.muyu.product.domain.req.AttributeGroupStateReq;
import com.muyu.product.domain.req.RuleInfoSaveReq;
import com.muyu.product.domain.req.WyzRuleInfoSaveReq;
import com.muyu.product.mapper.RuleInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.muyu.product.mapper.RuleAttrInfoMapper;
import com.muyu.product.domain.RuleAttrInfo;
@ -21,6 +28,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@Service
public class RuleAttrInfoServiceImpl extends ServiceImpl<RuleAttrInfoMapper, RuleAttrInfo> implements RuleAttrInfoService {
@Autowired
private RuleInfoMapper ruleInfoMapper;
/**
*
*
@ -64,4 +73,20 @@ public class RuleAttrInfoServiceImpl extends ServiceImpl<RuleAttrInfoMapper, Rul
queryWrapper.eq(RuleAttrInfo::getRuleId, ruleId);
return this.list(queryWrapper);
}
/**
* wyz
* @param wyzRuleInfoSaveReq
*/
@Override
public void updateSaveById(WyzRuleInfoSaveReq wyzRuleInfoSaveReq) {
LambdaQueryWrapper<RuleInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(RuleInfo ::getId ,wyzRuleInfoSaveReq.getId());
RuleInfo ruleInfo = new RuleInfo();
ruleInfo.setStatus(wyzRuleInfoSaveReq.getStatus());
ruleInfoMapper.update(ruleInfo,queryWrapper);
}
}

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import com.github.pagehelper.PageHelper;
@ -15,8 +16,10 @@ import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.product.domain.RuleAttrInfo;
import com.muyu.product.domain.model.RuleAttrAddModel;
import com.muyu.product.domain.model.RuleInfoAddModel;
import com.muyu.product.domain.req.RuleInfoEditReq;
import com.muyu.product.domain.req.RuleInfoQueryReq;
import com.muyu.product.domain.resp.RuleInfoResp;
import com.muyu.product.domain.resp.RuleInfoUpdResp;
import com.muyu.product.service.RuleAttrInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -50,7 +53,6 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
public List<RuleInfo> list(RuleInfo ruleInfo) {
LambdaQueryWrapper<RuleInfo> queryWrapper = new LambdaQueryWrapper<>();
if (ObjUtils.notNull(ruleInfo.getName())){
queryWrapper.like(RuleInfo::getName, ruleInfo.getName());
}
@ -59,10 +61,6 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
queryWrapper.eq(RuleInfo::getStatus, ruleInfo.getStatus());
}
return list(queryWrapper);
}
@ -79,7 +77,8 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
boolean save = this.save(ruleInfo);
ruleAttrInfoService.saveBatch(
ruleInfoAddModel.getRuleAttrList().stream()
.map(ruleAttrAddModel -> RuleAttrInfo.addModelBuild(ruleAttrAddModel, ruleInfo::getId, SecurityUtils::getUsername))
.map(ruleAttrAddModel -> RuleAttrInfo.addModelBuild(ruleAttrAddModel, ruleInfo::getId,
SecurityUtils::getUsername))
.toList()
);
return save;
@ -107,4 +106,57 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
.total(isPage ? new PageInfo<>(list).getTotal() : 0)
.build();
}
/**
*
* @param id
* @return
*/
@Override
public RuleInfoUpdResp getUpdById(Long id) {
RuleInfo ruleInfo = this.getById(id);
//查询规格
LambdaQueryWrapper<RuleAttrInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(RuleAttrInfo::getRuleId ,ruleInfo.getId());
List<RuleAttrInfo> infoList = this.ruleAttrInfoService.list(wrapper);
return RuleInfoUpdResp.builder()
.id(ruleInfo.getId())
.name(ruleInfo.getName())
.status(ruleInfo.getStatus())
.ruleAttrList(infoList.stream().map(RuleAttrAddModel::infoBuild).toList())
.remark(ruleInfo.getRemark())
.build();
}
/**
*
* @return
*/
@Override
public boolean updateGoodsSpecifications(Long id, RuleInfoEditReq ruleInfoEditReq) {
//修改
boolean update = this.updateById(RuleInfo.editBuild(id, ruleInfoEditReq));
if (update){
LambdaQueryWrapper<RuleAttrInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(RuleAttrInfo::getRuleId,id);
//删除
this.ruleAttrInfoService.remove(queryWrapper);
//添加
ruleAttrInfoService.saveBatch(
ruleInfoEditReq.getRuleAttrList().stream()
.map(ruleAttrAddModel -> RuleAttrInfo.addModelBuild(ruleAttrAddModel,
() -> id,
SecurityUtils::getUsername))
.toList()
);
}
return update;
}
}

View File

@ -18,6 +18,7 @@ spring:
config:
# 配置中心地址
server-addr: 124.70.138.118:8848
namespace: 13fd7cff-3c6b-4fca-bccc-5044efe3993f
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -18,4 +18,15 @@
<sql id="selectAsAttributeGroupVo">
select id, group_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_attribute_group
</sql>
<insert id="add">
INSERT INTO `product`.`as_attribute_group` (`id`, `group_id`, `attribute_id`, `remark`, `create_by`,
`create_time`, `update_by`, `update_time`)
VALUES (0,#{groupId}, #{id}, NULL, NULL, NULL, NULL, NULL);
</insert>
<!-- 删除 属性组-->
<delete id="delete">
delete from `as_attribute_group` where group_id =#{id}
</delete>
</mapper>

View File

@ -18,4 +18,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectAsCategoryAttributeGroupVo">
select id, category_id, attribute_group_id, remark, create_by, create_time, update_by, update_time from as_category_attribute_group
</sql>
<delete id="deleteAsCategoryAttributeGroup">
delete from `as_category_attribute_group` where category_id=#{id}
</delete>
<select id="selectAsCategoryAttributeGroupList" resultType="java.lang.Long">
select attribute_group_id from `as_category_attribute_group` where category_id=#{id}
</select>
<insert id="addAsCategoryAttributeGroup">
INSERT INTO `as_category_attribute_group` (`id`, `category_id`, `attribute_group_id`, `remark`,
`create_by`, `create_time`, `update_by`, `update_time`)
VALUES (0, #{categoryId}, #{attributeGroupId}, NULL, NULL, NULL, NULL, NULL);
</insert>
</mapper>

View File

@ -1,21 +1,43 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.product.mapper.AsCategoryAttributeMapper">
<resultMap type="com.muyu.product.domain.AsCategoryAttribute" id="AsCategoryAttributeResult">
<result property="id" column="id" />
<result property="categoryId" column="category_id" />
<result property="attributeId" column="attribute_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" />
<result property="id" column="id"/>
<result property="categoryId" column="category_id"/>
<result property="attributeId" column="attribute_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="selectAsCategoryAttributeVo">
select id, category_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_category_attribute
select id,
category_id,
attribute_id,
remark,
create_by,
create_time,
update_by,
update_time
from as_category_attribute
</sql>
<insert id="addAsCategoryAttribute">
INSERT INTO `as_category_attribute` (`id`, `category_id`, `attribute_id`, `remark`, `create_by`,
`create_time`, `update_by`, `update_time`)
VALUES (0, #{categoryId}, #{attributeId}, NULL, NULL, NULL, NULL, NULL);
</insert>
<delete id="deleteAsCategoryAttribute">
delete
from `as_category_attribute`
where category_id = #{id}
</delete>
<select id="selectAsCategoryAttributeList" resultType="java.lang.Long">
select attribute_id from `as_category_attribute` where category_id=#{id}
</select>
</mapper>

View File

@ -18,4 +18,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectAsCategoryBrandVo">
select id, category_id, brand_id, remark, create_by, create_time, update_by, update_time from as_category_brand
</sql>
<insert id="addAsCategoryBrandMapper">
INSERT INTO `product`.`as_category_brand` (`id`, `category_id`, `brand_id`, `remark`, `create_by`,
`create_time`, `update_by`, `update_time`)
VALUES (0, #{categoryId}, #{brandId}, NULL, NULL, NULL, NULL, NULL);
</insert>
<delete id="deleteAsCategoryBrandMapper">
delete from `as_category_brand` where category_id=#{id}
</delete>
<select id="selectAsCategoryBrandList" resultType="java.lang.Long">
select brand_id from `as_category_brand` where category_id=#{id}
</select>
</mapper>

View File

@ -1,21 +1,19 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.product.mapper.AttributeGroupMapper">
<resultMap type="com.muyu.product.domain.AttributeGroup" id="AttributeGroupResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="states" column="states" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updataBy" column="updata_by" />
<result property="updataTime" column="updata_time" />
<result property="remark" column="remark" />
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="states" column="states"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updataBy" column="updata_by"/>
<result property="updataTime" column="updata_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectAttributeGroupVo">
select id, name, states, create_by, create_time, updata_by, updata_time, remark from attribute_group
</sql>
</mapper>

View File

@ -1,24 +1,51 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.product.mapper.CategoryInfoMapper">
<resultMap type="com.muyu.product.domain.CategoryInfo" id="CategoryInfoResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="image" column="image" />
<result property="parentId" column="parent_id" />
<result property="start" column="start" />
<result property="introduction" column="introduction" />
<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" />
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="image" column="image"/>
<result property="parentId" column="parent_id"/>
<result property="start" column="start"/>
<result property="introduction" column="introduction"/>
<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="selectCategoryInfoVo">
select id, name, image, parent_id, start, introduction, remark, create_by, create_time, update_by, update_time from category_info
select id,
name,
image,
parent_id,
start,
introduction,
remark,
create_by,
create_time,
update_by,
update_time
from category_info
</sql>
<update id="updateCategoryInfo">
UPDATE `category_info`
SET `name` = #{name},
`image` = #{image},
`parent_id` = #{parentId},
`start` = #{start},
`introduction` = #{introduction},
`remark` = #{remark},
`create_by` = #{createBy},
`create_time` = #{createTime},
`update_by` = #{updateBy},
`update_time` = #{updateTime}
WHERE `id` = #{id};
</update>
</mapper>

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>

View File

@ -20,6 +20,7 @@ spring:
config:
# 配置中心地址
server-addr: 124.70.138.118:8848
namespace: 13fd7cff-3c6b-4fca-bccc-5044efe3993f
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -0,0 +1,10 @@
package com.muyu.system.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("wyz")
public class SysWyzController {
}

View File

@ -0,0 +1,8 @@
package com.muyu.system.mapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SysWyzMapper {
}

View File

@ -0,0 +1,4 @@
package com.muyu.system.service;
public interface SysWyzService {
}

View File

@ -0,0 +1,8 @@
package com.muyu.system.service.impl;
import com.muyu.system.service.SysWyzService;
import org.springframework.stereotype.Service;
@Service
public class SysWyzServiceImpl implements SysWyzService {
}

View File

@ -18,6 +18,7 @@ spring:
config:
# 配置中心地址
server-addr: 124.70.138.118:8848
namespace: 13fd7cff-3c6b-4fca-bccc-5044efe3993f
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -0,0 +1,6 @@
<?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.system.mapper.SysWyzMapper">
</mapper>

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 9101
port: 9104
# Spring
spring:
@ -18,6 +18,7 @@ spring:
config:
# 配置中心地址
server-addr: 124.70.138.118:8848
namespace: 13fd7cff-3c6b-4fca-bccc-5044efe3993f
# 配置文件格式
file-extension: yml
# 共享配置

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