jiaosong
2023-09-11 116e919af930037f4e5ece0b085e22feb0d50e5d
#平台素材库
已添加3个文件
已修改6个文件
494 ■■■■■ 文件已修改
server/service/src/main/java/com/doumee/dao/business/model/BaseGoods.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/BaseGoodsParam.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/Multifile.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/dto/BaseGoodsCreateOrUpdateRequest.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/dto/BaseGoodsDTO.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/dto/BaseGoodsParamCreatRequest.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/BaseGoodsService.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java 245 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/BrandServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/BaseGoods.java
@@ -1,5 +1,6 @@
package com.doumee.dao.business.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -32,7 +33,6 @@
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createDate;
    @ApiModelProperty(value = "更新人编码", example = "1")
@@ -41,7 +41,6 @@
    @ApiModelProperty(value = "更新时间")
    @ExcelColumn(name="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;
    @ApiModelProperty(value = "是否删除0否 1是", example = "1")
@@ -72,9 +71,19 @@
    @ExcelColumn(name="所属品类编码(base_category)")
    private Integer categoryId;
    @ApiModelProperty(value = "所属品类编码(base_category)", example = "1")
    @ExcelColumn(name="所属品类编码(base_category)")
    @TableField(exist = false)
    private Integer categoryName;
    @ApiModelProperty(value = "所属品牌编码(base_brand)", example = "1")
    @ExcelColumn(name="所属品牌编码(base_brand)")
    private Integer brandId;
    @ApiModelProperty(value = "所属品牌编码(base_brand)", example = "1")
    @ExcelColumn(name="所属品牌name")
    @TableField(exist = false)
    private Integer brandName;
    @ApiModelProperty(value = "指导价(元)", example = "1")
    @ExcelColumn(name="指导价(元)")
@@ -95,6 +104,7 @@
    @ApiModelProperty(value = "名称拼音首字母")
    @ExcelColumn(name="名称拼音首字母")
    private String shortPinyin;
    @ApiModelProperty(value = "关联源数据编码")
    @ExcelColumn(name="关联源数据编码")
    private String baseDataId;
server/service/src/main/java/com/doumee/dao/business/model/BaseGoodsParam.java
@@ -1,5 +1,6 @@
package com.doumee.dao.business.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -21,11 +22,11 @@
public class BaseGoodsParam {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键", example = "1")
    @ApiModelProperty(value = "主键")
    @ExcelColumn(name="主键")
    private Integer id;
    @ApiModelProperty(value = "创建人编码", example = "1")
    @ApiModelProperty(value = "创建人编码")
    @ExcelColumn(name="创建人编码")
    private Integer creator;
@@ -34,7 +35,7 @@
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createDate;
    @ApiModelProperty(value = "更新人编码", example = "1")
    @ApiModelProperty(value = "更新人编码")
    @ExcelColumn(name="更新人编码")
    private Integer editor;
@@ -43,7 +44,7 @@
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;
    @ApiModelProperty(value = "是否删除0否 1是", example = "1")
    @ApiModelProperty(value = "是否删除0否 1是")
    @ExcelColumn(name="是否删除0否 1是")
    private Integer isdeleted;
@@ -55,15 +56,15 @@
    @ExcelColumn(name="备注")
    private String remark;
    @ApiModelProperty(value = "状态 0启用 1禁用", example = "1")
    @ApiModelProperty(value = "状态 0启用 1禁用")
    @ExcelColumn(name="状态 0启用 1禁用")
    private Integer status;
    @ApiModelProperty(value = "排序码", example = "1")
    @ApiModelProperty(value = "排序码")
    @ExcelColumn(name="排序码")
    private Integer sortnum;
    @ApiModelProperty(value = "关联品类参数编码(关联base_cate_param表)", example = "1")
    @ApiModelProperty(value = "关联品类参数编码(关联base_cate_param表)")
    @ExcelColumn(name="关联品类参数编码(关联base_cate_param表)")
    private Integer pramaId;
@@ -71,8 +72,11 @@
    @ExcelColumn(name="参数值")
    private String val;
    @ApiModelProperty(value = "商品编码(关联base_goods表)", example = "1")
    @ApiModelProperty(value = "商品编码(关联base_goods表)")
    @ExcelColumn(name="商品编码(关联base_goods表)")
    private Integer goodsId;
    @ApiModelProperty(value = "关联品类参数编码")
    @TableField(exist = false)
    private String paramName;
}
server/service/src/main/java/com/doumee/dao/business/model/Multifile.java
@@ -1,5 +1,6 @@
package com.doumee.dao.business.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -64,7 +65,7 @@
    private Integer type;
    @ApiModelProperty(value = "关联对象类型 0商品多图", example = "1")
    @ExcelColumn(name="关联对象类型 0商品多图")
    @ExcelColumn(name="关联对象类型 0商品多图 1 å¹³å°å•†å“å¤šå›¾")
    private Integer objType;
    @ApiModelProperty(value = "文件地址")
@@ -78,4 +79,7 @@
    @ExcelColumn(name="排序码")
    private Integer sortnum;
    @ApiModelProperty(value = "文件地址")
    @TableField(exist = false)
    private String filefullurl;
}
server/service/src/main/java/com/doumee/dao/business/model/dto/BaseGoodsCreateOrUpdateRequest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,54 @@
package com.doumee.dao.business.model.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import com.doumee.dao.business.model.Multifile;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
 * @author T14
 */
@Data
@ApiModel("添加商品信息")
public class BaseGoodsCreateOrUpdateRequest {
    @ApiModelProperty(value = "修改主键ID")
    private Integer id;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "名称(不可重复)")
    private String name;
    @ApiModelProperty(value = "状态 0启用 1禁用", example = "1")
    private Integer status;
    @ApiModelProperty(value = "图标")
    private String imgurl;
    @ApiModelProperty(value = "所属品类编码(base_category)", example = "1")
    private Integer categoryId;
    @ApiModelProperty(value = "所属品牌编码(base_brand)", example = "1")
    private Integer brandId;
    @ApiModelProperty(value = "指导价(元)", example = "1")
    private BigDecimal zdPrice;
    @ApiModelProperty(value = "入手价格(元)", example = "1")
    private BigDecimal price;
    @ApiModelProperty(value = "商品详情")
    private String content;
    @ApiModelProperty(value = "参数类型属性值")
    private List<BaseGoodsParamCreatRequest> baseGoodsParamList;
    @ApiModelProperty(value = "附件列表")
    private List<Multifile> multifileList;
}
server/service/src/main/java/com/doumee/dao/business/model/dto/BaseGoodsDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,63 @@
package com.doumee.dao.business.model.dto;
import com.doumee.dao.business.model.BaseGoodsParam;
import com.doumee.dao.business.model.Multifile;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
 * @author T14
 */
@Data
@ApiModel("参数属性值")
public class BaseGoodsDTO {
    @ApiModelProperty(value = "修改主键ID")
    private Integer id;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "名称(不可重复)")
    private String name;
    @ApiModelProperty(value = "状态 0启用 1禁用", example = "1")
    private Integer status;
    @ApiModelProperty(value = "图标")
    private String imgurl;
    @ApiModelProperty(value = "图标")
    private String imgfullurl;
    @ApiModelProperty(value = "所属品类编码(base_category)", example = "1")
    private Integer categoryId;
    @ApiModelProperty(value = "所属品类编码(base_category)", example = "1")
    private Integer categoryName;
    @ApiModelProperty(value = "所属品牌编码(base_brand)", example = "1")
    private Integer brandId;
    @ApiModelProperty(value = "所属品牌编码(base_brand)", example = "1")
    private Integer brandName;
    @ApiModelProperty(value = "指导价(元)", example = "1")
    private BigDecimal zdPrice;
    @ApiModelProperty(value = "入手价格(元)", example = "1")
    private BigDecimal price;
    @ApiModelProperty(value = "商品详情")
    private String content;
    @ApiModelProperty(value = "参数类型属性值")
    private List<BaseGoodsParam> baseGoodsParamList;
    @ApiModelProperty(value = "附件列表")
    private List<Multifile> multifileList;
}
server/service/src/main/java/com/doumee/dao/business/model/dto/BaseGoodsParamCreatRequest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,34 @@
package com.doumee.dao.business.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author T14
 */
@Data
@ApiModel("参数属性值")
public class BaseGoodsParamCreatRequest {
    @ApiModelProperty(value = "名称(不可重复)")
    private String name;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "状态 0启用 1禁用", example = "1")
    private Integer status;
    @ApiModelProperty(value = "排序码", example = "1")
    private Integer sortnum;
    @ApiModelProperty(value = "关联品类参数编码(关联base_cate_param表)", example = "1")
    private Integer pramaId;
    @ApiModelProperty(value = "参数值")
    private String val;
    @ApiModelProperty(value = "商品编码(关联base_goods表)", example = "1")
    private Integer goodsId;
}
server/service/src/main/java/com/doumee/service/business/BaseGoodsService.java
@@ -3,6 +3,9 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.BaseGoods;
import com.doumee.dao.business.model.dto.BaseGoodsCreateOrUpdateRequest;
import com.doumee.dao.business.model.dto.BaseGoodsDTO;
import java.util.List;
/**
@@ -18,7 +21,7 @@
     * @param baseGoods å®žä½“对象
     * @return Integer
     */
    Integer create(BaseGoods baseGoods);
    Integer create(BaseGoodsCreateOrUpdateRequest baseGoods);
    /**
     * ä¸»é”®åˆ é™¤
@@ -41,6 +44,31 @@
     */
    void deleteByIdInBatch(List<Integer> ids);
    /**
     * ä¸»é”®æ›´æ–°
     *
     * @param baseGoods å®žä½“对象
     */
    void update(BaseGoodsCreateOrUpdateRequest baseGoods);
    /**
     * ä¸»é”®ä¸Šä¸‹æž¶
     *
     * @param idList å®žä½“对象
     */
    void updateStatusByIds(List<Integer> idList,Integer status);
    /**
     * ä¸»é”®ä¸Šä¸‹æž¶
     *
     * @param id å®žä½“对象
     */
    void updateStatusByIds(Integer id,Integer status);
    /**
     * ä¸»é”®æ›´æ–°
     *
@@ -63,6 +91,15 @@
     */
    BaseGoods findById(Integer id);
    /**
     * ä¸»é”®æŸ¥è¯¢
     *
     * @param id ä¸»é”®
     * @return BaseGoods
     */
    BaseGoodsDTO findByIdBaseGoods(Integer id);
    /**
     * æ¡ä»¶æŸ¥è¯¢å•条记录
     *
server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java
@@ -1,23 +1,36 @@
package com.doumee.service.business.impl;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.PinYinUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.BaseGoodsMapper;
import com.doumee.dao.business.*;
import com.doumee.dao.business.join.BaseGoodsJoinMapper;
import com.doumee.dao.business.model.BaseGoods;
import com.doumee.dao.business.model.Goods;
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.model.dto.BaseGoodsCreateOrUpdateRequest;
import com.doumee.dao.business.model.dto.BaseGoodsDTO;
import com.doumee.dao.business.model.dto.BaseGoodsParamCreatRequest;
import com.doumee.service.business.BaseGoodsService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
 * ç´ æåº“-商品信息表Service实现
@@ -34,10 +47,90 @@
    @Autowired
    private BaseGoodsJoinMapper baseGoodsJoinMapper;
    @Autowired
    private BaseGoodsParamMapper baseGoodsParamMapper;
    @Autowired
    private MultifileMapper multifileMapper;
    @Autowired
    @Lazy
    private SystemDictDataBiz systemDictDataBiz;
    @Autowired
    private BrandMapper brandMapper;
    @Autowired
    private GoodsMapper goodsMapper;
    @Override
    public Integer create(BaseGoods baseGoods) {
        baseGoodsMapper.insert(baseGoods);
        return baseGoods.getId();
    public Integer create(BaseGoodsCreateOrUpdateRequest baseGoods) {
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(baseGoodsMapper.selectCount(new QueryWrapper<BaseGoods>().eq("ISDELETED", Constants.ZERO).eq("name",baseGoods.getName()))>0){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【"+baseGoods.getName()+"】已存在");
        }
        Integer integer = baseGoodsMapper.selectCount(new QueryWrapper<BaseGoods>().eq("ISDELETED", Constants.ZERO));
        BaseGoods insert = new BaseGoods();
        insert.setCreator(user.getId());
        insert.setCreateDate(new Date());
        insert.setEditor(user.getId());
        insert.setEditDate(new Date());
        insert.setIsdeleted(Constants.ZERO);
        insert.setRemark(baseGoods.getRemark());
        insert.setName(baseGoods.getName());
        insert.setStatus(Constants.ZERO);
        insert.setSortnum(integer+Constants.ONE);
        insert.setImgurl(baseGoods.getImgurl());
        insert.setCategoryId(baseGoods.getCategoryId());
        insert.setBrandId(baseGoods.getBrandId());
        insert.setZdPrice(baseGoods.getZdPrice());
        insert.setPrice(baseGoods.getPrice());
        insert.setContent(baseGoods.getContent());
        insert.setPinyin(PinYinUtil.getFullSpell(insert.getName()));
        insert.setShortPinyin(PinYinUtil.getFirstSpell(insert.getName()));
        baseGoodsMapper.insert(insert);
        List<Multifile> multifileList = baseGoods.getMultifileList();
        if(!Objects.isNull(multifileList)&&multifileList.size()>Constants.ZERO){
            for (int i = 0; i < multifileList.size(); i++) {
                Multifile multifile = multifileList.get(i);
                multifile.setCreator(user.getId());
                multifile.setCreateDate(new Date());
                multifile.setIsdeleted(Constants.ZERO);
                multifile.setSortnum(i+Constants.ONE);
                multifile.setObjId(insert.getId());
                multifile.setType(Constants.ZERO);
                multifile.setObjType(Constants.ONE);
                multifileMapper.insert(multifile);
            }
        }
        List<BaseGoodsParamCreatRequest> goodsParamList = baseGoods.getBaseGoodsParamList();
        if(!Objects.isNull(goodsParamList)&&goodsParamList.size()>0){
            for (int i = 0; i < goodsParamList.size(); i++) {
                BaseGoodsParamCreatRequest param = goodsParamList.get(i);
                BaseGoodsParam baseGoodsParam = new BaseGoodsParam();
                baseGoodsParam.setCreator(user.getId());
                baseGoodsParam.setCreateDate(new Date());
                baseGoodsParam.setEditor(user.getId());
                baseGoodsParam.setEditDate(new Date());
                baseGoodsParam.setIsdeleted(Constants.ZERO);
                baseGoodsParam.setName(param.getName());
                baseGoodsParam.setRemark(param.getRemark());
                baseGoodsParam.setStatus(Constants.ZERO);
                baseGoodsParam.setSortnum(i+Constants.ONE);
                baseGoodsParam.setPramaId(param.getPramaId());
                baseGoodsParam.setVal(param.getVal());
                baseGoodsParam.setGoodsId(insert.getId());
                baseGoodsParamMapper.insert(baseGoodsParam);
            }
        }
        return insert.getId();
    }
    @Override
@@ -57,6 +150,102 @@
            return;
        }
        baseGoodsMapper.deleteBatchIds(ids);
    }
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    @Override
    public void update(BaseGoodsCreateOrUpdateRequest baseGoods) {
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(baseGoodsMapper.selectCount(new QueryWrapper<BaseGoods>()
                .eq("ISDELETED",Constants.ZERO).ne("id",baseGoods.getId())
                .eq("name",baseGoods.getName()))>0){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【"+baseGoods.getName()+"】已存在");
        }
        UpdateWrapper<BaseGoods> wrapper = new UpdateWrapper<>();
        wrapper.lambda()
                .eq(BaseGoods::getId,baseGoods.getId())
                .set(BaseGoods::getName,baseGoods.getName())
                .set(BaseGoods::getName,baseGoods.getName())
                .set(BaseGoods::getName,baseGoods.getName())
                .set(BaseGoods::getName,baseGoods.getName());
        baseGoodsMapper.update(null,wrapper);
        multifileMapper.delete(new QueryWrapper<Multifile>().eq("OBJ_ID",baseGoods.getId()));
        List<Multifile> multifileList = baseGoods.getMultifileList();
        if(!Objects.isNull(multifileList)&&multifileList.size()>Constants.ZERO){
            for (int i = 0; i < multifileList.size(); i++) {
                Multifile multifile = multifileList.get(i);
                multifile.setCreator(user.getId());
                multifile.setCreateDate(new Date());
                multifile.setIsdeleted(Constants.ZERO);
                multifile.setSortnum(i+Constants.ONE);
                multifile.setObjId(baseGoods.getId());
                multifile.setType(Constants.ZERO);
                multifile.setObjType(Constants.ONE);
                multifileMapper.insert(multifile);
            }
        }
        baseGoodsParamMapper.delete(new QueryWrapper<BaseGoodsParam>().eq("GOODS_ID",baseGoods.getId()));
        List<BaseGoodsParamCreatRequest> goodsParamList = baseGoods.getBaseGoodsParamList();
        if(!Objects.isNull(goodsParamList)&&goodsParamList.size()>0){
            for (int i = 0; i < goodsParamList.size(); i++) {
                BaseGoodsParamCreatRequest param = goodsParamList.get(i);
                BaseGoodsParam baseGoodsParam = new BaseGoodsParam();
                baseGoodsParam.setCreator(user.getId());
                baseGoodsParam.setCreateDate(new Date());
                baseGoodsParam.setEditor(user.getId());
                baseGoodsParam.setEditDate(new Date());
                baseGoodsParam.setIsdeleted(Constants.ZERO);
                baseGoodsParam.setName(param.getName());
                baseGoodsParam.setRemark(param.getRemark());
                baseGoodsParam.setStatus(Constants.ZERO);
                baseGoodsParam.setSortnum(i+Constants.ONE);
                baseGoodsParam.setPramaId(param.getPramaId());
                baseGoodsParam.setVal(param.getVal());
                baseGoodsParam.setGoodsId(baseGoods.getId());
                baseGoodsParamMapper.insert(baseGoodsParam);
            }
        }
    }
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    @Override
    public void updateStatusByIds(List<Integer> idList, Integer status) {
        if (CollectionUtils.isEmpty(idList)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"商品状态不能为空");
        }
        idList.forEach(s->updateStatusByIds(s,status));
    }
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    @Override
    public void updateStatusByIds(Integer id, Integer status) {
        if (Objects.isNull(status)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"商品状态不能为空");
        }
        if (Constants.equalsInteger(status,Constants.ZERO)){
            BaseGoods baseGoods = new BaseGoods();
            baseGoods.setId(id);
            baseGoods.setStatus(status);
            baseGoodsMapper.updateById(baseGoods);
        }else if (Constants.equalsInteger(status,Constants.ONE)){
            BaseGoods baseGoods = new BaseGoods();
            baseGoods.setId(id);
            baseGoods.setStatus(status);
            baseGoodsMapper.updateById(baseGoods);
            UpdateWrapper<Goods> goodsUpdate = new UpdateWrapper<>();
            goodsUpdate.lambda()
                        .eq(Goods::getType,Constants.ONE)
                        .eq(Goods::getGoodsId,id)
                        .set(Goods::getStatus,Constants.ONE);
            goodsMapper.update(null,goodsUpdate);
        }
    }
    @Override
@@ -80,6 +269,41 @@
    }
    @Override
    public BaseGoodsDTO findByIdBaseGoods(Integer id) {
        MPJLambdaWrapper<BaseGoods> queryWrapper = new MPJLambdaWrapper<>();
        queryWrapper.leftJoin(Brand.class,Brand::getId,BaseGoods::getBrandId)
                .leftJoin(BaseCategory.class,BaseCategory::getId,BaseGoods::getBaseDataId)
                .selectAll(BaseGoods.class)
                .selectAs(Brand::getName,BaseGoodsDTO::getBrandName)
                .selectAs(BaseCategory::getSortnum,BaseGoodsDTO::getCategoryName);
        BaseGoodsDTO baseGoodsDTO = baseGoodsJoinMapper.selectJoinOne(BaseGoodsDTO.class, queryWrapper);
        String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode()
                + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode();
        baseGoodsDTO.setImgfullurl(prefixUrl+baseGoodsDTO.getImgurl());
        List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>()
                .eq("OBJ_ID", id)
                .eq("OBJ_TYPE", Constants.ONE));
        if (!CollectionUtils.isEmpty(multifiles)){
            multifiles.forEach(s->s.setFilefullurl(prefixUrl+s.getFileurl()));
        }
        baseGoodsDTO.setMultifileList(multifiles);
        QueryWrapper<BaseGoodsParam> baseGoodsParamQuery = new QueryWrapper<>();
        baseGoodsParamQuery.select("base_goods_param.*,(select name from base_cate_param bcp where (bcp.id = base_goods_param.PRAMA_ID)) as paramName")
                            .lambda()
                            .eq(BaseGoodsParam::getGoodsId,id)
                            .orderByAsc(BaseGoodsParam::getSortnum);
        List<BaseGoodsParam> baseGoodsParams = baseGoodsParamMapper.selectList(baseGoodsParamQuery);
        baseGoodsDTO.setBaseGoodsParamList(baseGoodsParams);
        return baseGoodsDTO;
    }
    @Override
    public BaseGoods findOne(BaseGoods baseGoods) {
        QueryWrapper<BaseGoods> wrapper = new QueryWrapper<>(baseGoods);
        return baseGoodsMapper.selectOne(wrapper);
@@ -98,7 +322,7 @@
        Utils.MP.blankToNull(pageWrap.getModel());
        if (pageWrap.getModel().getId() != null) {
            queryWrapper.eq(BaseGoods::getId, pageWrap.getModel().getId());
            queryWrapper.like(BaseGoods::getId, pageWrap.getModel().getId());
        }
        if (pageWrap.getModel().getName() != null) {
            queryWrapper.eq(BaseGoods::getName, pageWrap.getModel().getName());
@@ -106,15 +330,16 @@
        if (pageWrap.getModel().getStatus() != null) {
            queryWrapper.eq(BaseGoods::getStatus, pageWrap.getModel().getStatus());
        }
        if (pageWrap.getModel().getCategoryId() != null) {
            queryWrapper.eq(BaseGoods::getCategoryId, pageWrap.getModel().getCategoryId());
        }
        if (pageWrap.getModel().getBrandId() != null) {
            queryWrapper.eq(BaseGoods::getBrandId, pageWrap.getModel().getBrandId());
        }
        queryWrapper.leftJoin(Brand.class,Brand::getId,BaseGoods::getBrandId)
                    .leftJoin(BaseCategory.class,BaseCategory::getId,BaseGoods::getBaseDataId)
                    .selectAs(Brand::getName,BaseGoods::getBrandName)
                    .selectAs(BaseCategory::getSortnum,BaseGoods::getCategoryName);
        queryWrapper.orderByDesc(Goods::getId);
        return PageData.from(baseGoodsJoinMapper.selectJoinPage(page,BaseGoods.class,queryWrapper));
    }
server/service/src/main/java/com/doumee/service/business/impl/BrandServiceImpl.java
@@ -88,7 +88,14 @@
    @Override
    public void updateById(Brand brand) {
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(brandMapper.selectCount(new QueryWrapper<Brand>().eq("ISDELETED",Constants.ZERO).ne("id",brand.getId()).eq("name",brand.getName()))>0){
        if(brandMapper.selectCount(new QueryWrapper<Brand>()
                .eq("ISDELETED",Constants.ZERO)
                .eq(user.getType().equals(Constants.UserType.SYSTEM),"name",brand.getName())
                .and(user.getType().equals(Constants.UserType.COMPANY),
                        i->i.apply(" name = '"+brand.getName()+"' and type = 1 ")
                                .or().apply( "  name = '"+brand.getName()+"' and COMPANY_ID = '"+user.getCompanyId()+"' and type = 0 ")
                )
        )>0){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【"+brand.getName()+"】已存在");
        };
        brand.setStatus(Constants.ZERO);
@@ -125,10 +132,15 @@
    @Override
    public List<Brand> findList(Brand brand) {
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        QueryWrapper<Brand> wrapper = new QueryWrapper<>(brand);
        wrapper.lambda().eq(Brand::getIsdeleted,Constants.ZERO);
        wrapper.lambda().eq(Brand::getStatus,Constants.ZERO);
        wrapper.lambda().orderByAsc(Brand::getSortnum);
        // ç±»åž‹ 0企业 1平台
        if (Objects.isNull(user.getCompanyId())) {
            wrapper.lambda().eq(Brand::getType,Constants.ONE);
        }
        List<Brand> list = brandMapper.selectList(wrapper);
        String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode()
                + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode();
@@ -140,6 +152,7 @@
    @Override
    public PageData<Brand> findPage(PageWrap<Brand> pageWrap) {
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        IPage<Brand> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        QueryWrapper<Brand> queryWrapper = new QueryWrapper<>();
        Utils.MP.blankToNull(pageWrap.getModel());
@@ -150,6 +163,10 @@
        if (pageWrap.getModel().getStatus() != null) {
            queryWrapper.lambda().eq(Brand::getStatus, pageWrap.getModel().getStatus());
        }
        // ç±»åž‹ 0企业 1平台
        if (Objects.isNull(user.getCompanyId())) {
            queryWrapper.lambda().eq(Brand::getType,Constants.ONE);
        }
        queryWrapper.lambda().orderByAsc(Brand::getSortnum);
        IPage<Brand> brandIPage = brandMapper.selectPage(page, queryWrapper);
        String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode()