修改提交可以备注

day9
xiaohuang 2024-03-10 14:31:24 +08:00
parent ac8eecb4fe
commit 89ccdea2f7
12 changed files with 196 additions and 49 deletions

View File

@ -0,0 +1,50 @@
package com.muyu.product.domain;
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 lombok.experimental.SuperBuilder;
import io.swagger.annotations.*;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
/**
* as_attribute_group
*
* @author XiaoHuang
* @date 2024-03-07
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName("as_attribute_group")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "AsAttributeGroup", description = "属性与组中间")
public class AsAttributeGroup extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(name = "主键", value = "主键")
private Long id;
/** id
*/
@Excel(name = "组id")
@ApiModelProperty(name = "组id", value = "组id ", required = true)
private Long groupId;
/** 属性id */
@Excel(name = "属性id")
@ApiModelProperty(name = "属性id", value = "属性id", required = true)
private Long attributeId;
}

View File

@ -49,24 +49,24 @@ public class AsCategoryAttribute extends BaseEntity {
/** 创建人 */
@Excel(name = "创建人")
@ApiModelProperty(name = "创建人", value = "创建人", required = true)
private String createdBy;
private String createBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(name = "创建时间", value = "创建时间", required = true)
private Date createdTime;
private Date createTime;
/** 更新人 */
@Excel(name = "更新人")
@ApiModelProperty(name = "更新人", value = "更新人")
private String updatedBy;
private String updateBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(name = "更新时间", value = "更新时间")
private Date updatedTime;
private Date updateTime;
}

View File

@ -44,10 +44,7 @@ public class AttributeInfo extends BaseEntity {
@ApiModelProperty(name = "属性名", value = "属性名", required = true)
private String name;
/** 分组 */
@Excel(name = "分组")
@ApiModelProperty(name = "分组", value = "分组")
private Long groupId;
/** 创建人 */
@ApiModelProperty(name = "创建人", value = "创建人")
@ -74,7 +71,6 @@ public class AttributeInfo extends BaseEntity {
public static AttributeInfo queryBuild( AttributeInfoQueryReq attributeInfoQueryReq){
return AttributeInfo.builder()
.name(attributeInfoQueryReq.getName())
.groupId(attributeInfoQueryReq.getGroupId())
.updatedBy(attributeInfoQueryReq.getUpdatedBy())
.updatedTime(attributeInfoQueryReq.getUpdatedTime())
.build();
@ -86,7 +82,6 @@ public class AttributeInfo extends BaseEntity {
public static AttributeInfo saveBuild(AttributeInfoSaveReq attributeInfoSaveReq){
return AttributeInfo.builder()
.name(attributeInfoSaveReq.getName())
.groupId(attributeInfoSaveReq.getGroupId())
.updatedBy(attributeInfoSaveReq.getUpdatedBy())
.updatedTime(attributeInfoSaveReq.getUpdatedTime())
.build();
@ -99,7 +94,6 @@ public class AttributeInfo extends BaseEntity {
return AttributeInfo.builder()
.id(id)
.name(attributeInfoEditReq.getName())
.groupId(attributeInfoEditReq.getGroupId())
.updatedBy(attributeInfoEditReq.getUpdatedBy())
.updatedTime(attributeInfoEditReq.getUpdatedTime())
.build();

View File

@ -30,7 +30,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
@TableName("brand_info")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "BrandInfo", description = "品牌信息")
public class BrandInfo extends BaseEntity {
public class BrandInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ -59,21 +59,6 @@ public class BrandInfo extends BaseEntity {
@ApiModelProperty(name = "是否启用", value = "是否启用")
private String stauts;
/** 创建人 */
@ApiModelProperty(name = "创建人", value = "创建人", required = true)
private String createdBy;
/** 创建时间 */
@ApiModelProperty(name = "创建时间", value = "创建时间", required = true)
private Date createdTime;
/** 更新人 */
@ApiModelProperty(name = "更新人", value = "更新人")
private String updatedBy;
/** 更新时间 */
@ApiModelProperty(name = "更新时间", value = "更新时间")
private Date updatedTime;
/**
*
@ -96,8 +81,9 @@ public class BrandInfo extends BaseEntity {
.logo(brandInfoSaveReq.getLogo())
.introduction(brandInfoSaveReq.getIntroduction())
.stauts(brandInfoSaveReq.getStauts())
.updatedBy(brandInfoSaveReq.getUpdatedBy())
.updatedTime(brandInfoSaveReq.getUpdatedTime())
.updateBy(brandInfoSaveReq.getUpdatedBy())
.updateTime(brandInfoSaveReq.getUpdatedTime())
.remark(brandInfoSaveReq.getRemark())
.build();
}
@ -111,8 +97,11 @@ public class BrandInfo extends BaseEntity {
.logo(brandInfoEditReq.getLogo())
.introduction(brandInfoEditReq.getIntroduction())
.stauts(brandInfoEditReq.getStauts())
.updatedBy(brandInfoEditReq.getUpdatedBy())
.updatedTime(brandInfoEditReq.getUpdatedTime())
.createBy(brandInfoEditReq.getIntroduction())
.createTime(brandInfoEditReq.getCreateTime())
.updateBy(brandInfoEditReq.getUpdatedBy())
.updateTime(brandInfoEditReq.getUpdatedTime())
.remark(brandInfoEditReq.getRemark())
.build();
}

View File

@ -29,9 +29,7 @@ public class AttributeInfoQueryReq extends BaseEntity {
@ApiModelProperty(name = "属性名", value = "属性名")
private String name;
/** 分组 */
@ApiModelProperty(name = "分组", value = "分组")
private Long groupId;
/** 更新人 */
@ApiModelProperty(name = "更新人", value = "更新人")

View File

@ -35,10 +35,7 @@ public class AttributeInfoSaveReq extends BaseEntity {
@ApiModelProperty(name = "属性名", value = "属性名", required = true)
private String name;
/** 分组 */
@ApiModelProperty(name = "分组", value = "分组")
private Long groupId;
/** 创建人 */

View File

@ -0,0 +1,15 @@
package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsAttributeGroup;
/**
* Mapper
*
* @author XiaoHuang
* @date 2024-03-07
*/
public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> {
}

View File

@ -0,0 +1,22 @@
package com.muyu.product.service;
import java.util.List;
import com.muyu.product.domain.AsAttributeGroup;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* Service
*
* @author XiaoHuang
* @date 2024-03-07
*/
public interface AsAttributeGroupService extends IService<AsAttributeGroup> {
/**
*
*
* @param asAttributeGroup
* @return
*/
public List<AsAttributeGroup> list(AsAttributeGroup asAttributeGroup);
}

View File

@ -0,0 +1,49 @@
package com.muyu.product.service.impl;
import java.util.List;
import com.muyu.common.core.utils.ObjUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.muyu.product.mapper.AsAttributeGroupMapper;
import com.muyu.product.domain.AsAttributeGroup;
import com.muyu.product.service.AsAttributeGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
/**
* Service
*
* @author XiaoHuang
* @date 2024-03-07
*/
@Slf4j
@Service
public class AsAttributeGroupServiceImpl extends ServiceImpl<AsAttributeGroupMapper, AsAttributeGroup> implements AsAttributeGroupService {
/**
*
*
* @param asAttributeGroup
* @return
*/
@Override
public List<AsAttributeGroup> list(AsAttributeGroup asAttributeGroup) {
LambdaQueryWrapper<AsAttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
if (ObjUtils.notNull(asAttributeGroup.getGroupId())){
queryWrapper.eq(AsAttributeGroup::getGroupId, asAttributeGroup.getGroupId());
}
if (ObjUtils.notNull(asAttributeGroup.getAttributeId())){
queryWrapper.eq(AsAttributeGroup::getAttributeId, asAttributeGroup.getAttributeId());
}
return list(queryWrapper);
}
}

View File

@ -41,20 +41,20 @@ public class AsCategoryAttributeServiceImpl extends ServiceImpl<AsCategoryAttrib
}
if (ObjUtils.notNull(asCategoryAttribute.getCreatedBy())){
queryWrapper.eq(AsCategoryAttribute::getCreatedBy, asCategoryAttribute.getCreatedBy());
if (ObjUtils.notNull(asCategoryAttribute.getCreateBy())){
queryWrapper.eq(AsCategoryAttribute::getCreateBy, asCategoryAttribute.getCreateBy());
}
if (ObjUtils.notNull(asCategoryAttribute.getCreatedTime())){
queryWrapper.eq(AsCategoryAttribute::getCreatedTime, asCategoryAttribute.getCreatedTime());
if (ObjUtils.notNull(asCategoryAttribute.getCreateTime())){
queryWrapper.eq(AsCategoryAttribute::getCreateTime, asCategoryAttribute.getCreateTime());
}
if (ObjUtils.notNull(asCategoryAttribute.getUpdatedBy())){
queryWrapper.eq(AsCategoryAttribute::getUpdatedBy, asCategoryAttribute.getUpdatedBy());
if (ObjUtils.notNull(asCategoryAttribute.getUpdateBy())){
queryWrapper.eq(AsCategoryAttribute::getUpdateBy, asCategoryAttribute.getUpdateBy());
}
if (ObjUtils.notNull(asCategoryAttribute.getUpdatedTime())){
queryWrapper.eq(AsCategoryAttribute::getUpdatedTime, asCategoryAttribute.getUpdatedTime());
if (ObjUtils.notNull(asCategoryAttribute.getUpdateTime())){
queryWrapper.eq(AsCategoryAttribute::getUpdateTime, asCategoryAttribute.getUpdateTime());
}
return list(queryWrapper);
}

View File

@ -1,8 +1,10 @@
package com.muyu.product.service.impl;
import java.util.Date;
import java.util.List;
import com.muyu.common.core.utils.ObjUtils;
import com.muyu.common.security.utils.SecurityUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.muyu.product.mapper.BrandInfoMapper;
@ -48,10 +50,20 @@ public class BrandInfoServiceImpl extends ServiceImpl<BrandInfoMapper, BrandInfo
queryWrapper.eq(BrandInfo::getStauts, brandInfo.getStauts());
}
return list(queryWrapper);
}
@Override
public boolean save(BrandInfo entity) {
entity.setCreateBy(SecurityUtils.getUsername());
entity.setCreateTime(new Date());
return super.save(entity);
}
@Override
public boolean updateById(BrandInfo entity) {
entity.setUpdateBy(SecurityUtils.getUsername());
entity.setUpdateTime(new Date());
return super.updateById(entity);
}
}

View File

@ -0,0 +1,21 @@
<?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.AsAttributeGroupMapper">
<resultMap type="com.muyu.product.domain.AsAttributeGroup" id="AsAttributeGroupResult">
<result property="id" column="id" />
<result property="groupId" column="group_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="selectAsAttributeGroupVo">
select id, group_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_attribute_group
</sql>
</mapper>