提交 af077d59 作者: 张小凤

add

上级 94d4d153
package com.mmc.pms.common;
import com.alibaba.fastjson2.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/15 14:28
* @Version 1.0
* @Author small @Date 2023/5/15 14:28 @Version 1.0
*/
@Builder
// @Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.result.ResultBody", description = "请求响应体")
// @ApiModel("统一返回对象")
// @ApiModel(value = "com.mmc.result.ResultBody", description = "请求响应体")
public class ResultBody<T> implements Serializable {
private static final long serialVersionUID = 6341937455634693363L;
/**
* 响应代码
*/
@ApiModelProperty(value = "响应代码")
private String code;
/**
* 响应消息
*/
@ApiModelProperty(value = "响应消息")
private String message;
/**
* 响应结果
*/
@ApiModelProperty(value = "响应结果")
private T result;
public ResultBody(BaseErrorInfoInterface errorInfo) {
this.code = errorInfo.getResultCode();
this.message = errorInfo.getResultMsg();
}
/**
* 成功
*
* @return
*/
public static ResultBody success() {
return success(null);
}
/**
* 成功
*
* @param data
* @return
*/
public static <T> ResultBody success(T data) {
ResultBody rb = new ResultBody();
rb.setCode(ResultEnum.SUCCESS.getResultCode());
rb.setMessage(ResultEnum.SUCCESS.getResultMsg());
rb.setResult(data);
return rb;
}
/**
* 成功
*
* **/
public static ResultBody success1(ResultEnum enums){
ResultBody rb = new ResultBody();
rb.setCode("200");
rb.setMessage(enums.getResultMsg());
rb.setResult(null);
return rb;
}
public void buildSuccess() {
this.setCode(ResultEnum.SUCCESS.getResultCode());
this.setMessage(ResultEnum.SUCCESS.getResultMsg());
}
/**
* 失败
*/
public static ResultBody error(BaseErrorInfoInterface errorInfo) {
ResultBody rb = new ResultBody();
rb.setCode(errorInfo.getResultCode());
rb.setMessage(errorInfo.getResultMsg());
rb.setResult(null);
return rb;
}
/**
* 失败
*/
public static ResultBody error(String code, String message) {
ResultBody rb = new ResultBody();
rb.setCode(code);
rb.setMessage(message);
rb.setResult(null);
return rb;
}
/**
* 失败
*/
public static ResultBody error(ResultEnum enums) {
ResultBody rb = new ResultBody();
rb.setCode(enums.getResultCode());
rb.setMessage(enums.getResultMsg());
rb.setResult(null);
return rb;
}
/**
* 失败
*/
public static ResultBody error(String message) {
ResultBody rb = new ResultBody();
rb.setCode("-1");
rb.setMessage(message);
rb.setResult(null);
return rb;
}
/**
* 失败
*/
public static ResultBody error(ResultEnum enums, Object data) {
ResultBody rb = new ResultBody();
rb.setCode(enums.getResultCode());
rb.setMessage(enums.getResultMsg());
rb.setResult(data);
return rb;
}
public static boolean isSuccess(ResultBody res) {
return res.getCode().equals(ResultEnum.SUCCESS.getResultCode());
}
@Override
public String toString() {
return JSONObject.toJSONString(this);
}
private static final long serialVersionUID = 6341937455634693363L;
/** 响应代码 */
@ApiModelProperty(name = "code", value = "响应码", required = true, example = "200", position = 0)
private String code;
/** 响应消息 */
@ApiModelProperty(
name = "message",
value = "响应消息",
required = true,
example = "操作成功",
position = 1)
private String message;
/** 响应结果 */
@ApiModelProperty(name = "result", value = "返回结果集", required = true, example = "{}", position = 2)
private T result;
public ResultBody(BaseErrorInfoInterface errorInfo) {
this.code = errorInfo.getResultCode();
this.message = errorInfo.getResultMsg();
}
/**
* 成功
*
* @return
*/
public static ResultBody success() {
return success(null);
}
/**
* 成功
*
* @param data
* @return
*/
public static <T> ResultBody success(T data) {
ResultBody rb = new ResultBody();
rb.setCode(ResultEnum.SUCCESS.getResultCode());
rb.setMessage(ResultEnum.SUCCESS.getResultMsg());
rb.setResult(data);
return rb;
}
/**
* 成功
*
* <p>*
*/
public static ResultBody success1(ResultEnum enums) {
ResultBody rb = new ResultBody();
rb.setCode("200");
rb.setMessage(enums.getResultMsg());
rb.setResult(null);
return rb;
}
public void buildSuccess() {
this.setCode(ResultEnum.SUCCESS.getResultCode());
this.setMessage(ResultEnum.SUCCESS.getResultMsg());
}
/** 失败 */
public static ResultBody error(BaseErrorInfoInterface errorInfo) {
ResultBody rb = new ResultBody();
rb.setCode(errorInfo.getResultCode());
rb.setMessage(errorInfo.getResultMsg());
rb.setResult(null);
return rb;
}
/** 失败 */
public static ResultBody error(String code, String message) {
ResultBody rb = new ResultBody();
rb.setCode(code);
rb.setMessage(message);
rb.setResult(null);
return rb;
}
/** 失败 */
public static ResultBody error(ResultEnum enums) {
ResultBody rb = new ResultBody();
rb.setCode(enums.getResultCode());
rb.setMessage(enums.getResultMsg());
rb.setResult(null);
return rb;
}
/** 失败 */
public static ResultBody error(String message) {
ResultBody rb = new ResultBody();
rb.setCode("-1");
rb.setMessage(message);
rb.setResult(null);
return rb;
}
/** 失败 */
public static ResultBody error(ResultEnum enums, Object data) {
ResultBody rb = new ResultBody();
rb.setCode(enums.getResultCode());
rb.setMessage(enums.getResultMsg());
rb.setResult(data);
return rb;
}
public static boolean isSuccess(ResultBody res) {
return res.getCode().equals(ResultEnum.SUCCESS.getResultCode());
}
@Override
public String toString() {
return JSONObject.toJSONString(this);
}
}
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.WareInfoItemDTO;
import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.vo.LeaseVo;
import com.mmc.pms.page.Page;
import com.mmc.pms.service.WebDeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
......@@ -45,14 +49,10 @@ public class MiniProgramDeviceController {
}
@ApiOperation(value = "设备列表筛选")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/deviceList")
public ResultBody deviceList(
@RequestParam(value = "districtId", required = false) Integer districtId,
@RequestParam(value = "categoryId", required = false) Integer categoryId,
@RequestParam(value = "brandId", required = false) Integer brandId,
@RequestParam(value = "modelId", required = false) Integer modelId) {
return webDeviceService.deviceList(districtId, categoryId, brandId, modelId);
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = WareInfoItemDTO.class)})
@PostMapping("/deviceList")
public ResultBody listWareInfoPage(@RequestBody @Validated(Page.class) WareInfoQO param) {
return webDeviceService.listWareInfoPage(param);
}
@ApiOperation(value = "设备详情")
......
package com.mmc.pms.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.AppGoodsInfoDetailDTO;
import com.mmc.pms.model.dto.GoodsInfoListDTO;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.service.MiniProgramProductMallService;
import com.mmc.pms.service.WebProductMallService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @Author small
* @Date 2023/5/15 13:23
* @Version 1.0
* @Author small @Date 2023/5/15 13:23 @Version 1.0
*/
@Api(tags = {"小程序产品商城-接口"})
@RestController
@RequestMapping("/AppProductMall")
@RequestMapping("/AppProductMall/")
public class MiniProgramProductMallController {
@Autowired private WebProductMallService webProductMallService;
@Autowired private MiniProgramProductMallService miniProgramProductMallService;
@ApiOperation(value = "小程序-商品信息-分页")
@PostMapping("listPageGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = GoodsInfoListDTO.class)})
public ResultBody listPageGoodsInfo(@ApiParam("商品查询条件QO") @RequestBody GoodsInfoQO param) {
return ResultBody.success(webProductMallService.listPageGoodsInfo(param));
}
@ApiOperation(value = "小程序端-获取商品详细信息--共多少种选择")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = AppGoodsInfoDetailDTO.class)})
@GetMapping("getAppGoodsInfoDetail")
public ResultBody getAppGoodsInfoDetail(@RequestParam Integer id) {
return miniProgramProductMallService.getAppGoodsInfoDetail(id);
}
}
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.WareInfoItemDTO;
import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.vo.LeaseVo;
import com.mmc.pms.page.Page;
import com.mmc.pms.service.WebDeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
......@@ -46,14 +50,10 @@ public class WebDeviceController {
}
@ApiOperation(value = "设备列表筛选")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/deviceList")
public ResultBody deviceList(
@RequestParam(value = "districtId", required = false) Integer districtId,
@RequestParam(value = "categoryId", required = false) Integer categoryId,
@RequestParam(value = "brandId", required = false) Integer brandId,
@RequestParam(value = "modelId", required = false) Integer modelId) {
return webDeviceService.deviceList(districtId, categoryId, brandId, modelId);
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = WareInfoItemDTO.class)})
@PostMapping("/deviceList")
public ResultBody listWareInfoPage(@RequestBody @Validated(Page.class) WareInfoQO param) {
return webDeviceService.listWareInfoPage(param);
}
@ApiOperation(value = "设备详情")
......
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.AppGoodsInfoDetailDTO;
import com.mmc.pms.model.dto.GoodsInfoListDTO;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.service.MiniProgramProductMallService;
import com.mmc.pms.service.WebProductMallService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @Author small @Date 2023/5/15 13:24 @Version 1.0
......@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
public class WebProductMallController {
@Autowired private WebProductMallService webProductMallService;
@Autowired private MiniProgramProductMallService miniProgramProductMallService;
@ApiOperation("产品类目")
@GetMapping("/category")
public ResultBody productCategory() {
......@@ -35,4 +38,18 @@ public class WebProductMallController {
public ResultBody productQuality() {
return webProductMallService.productQuality();
}
@ApiOperation(value = "Web端-商品信息-分页")
@PostMapping("listPageGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = GoodsInfoListDTO.class)})
public ResultBody listPageGoodsInfo(@ApiParam("商品查询条件QO") @RequestBody GoodsInfoQO param) {
return ResultBody.success(webProductMallService.listPageGoodsInfo(param));
}
@ApiOperation(value = "Web端-获取商品详细信息--共多少种选择")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = AppGoodsInfoDetailDTO.class)})
@GetMapping("getAppGoodsInfoDetail")
public ResultBody getAppGoodsInfoDetail(@RequestParam Integer id) {
return miniProgramProductMallService.getAppGoodsInfoDetail(id);
}
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.*;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.service.Impl.IndustryProductInventoryDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Author small @Date 2023/5/16 15:14 @Version 1.0
*/
@Mapper
public interface MiniProgramProductMallDao {
GoodsInfoDO getGoodsInfoByGoodsId(Integer goodsId);
List<GoodsImgDO> listGoodsInfoByGoodsId(Integer goodsId);
GoodsDetailDO getGoodsDetailByGoodsId(Integer goodsId);
List<GoodsQaDO> listGoodsQaInfoByGoodsId(Integer goodsId);
List<GoodsServiceDO> listGoodsServiceByGoodsId(Integer goodsId);
List<MallProdSkuInfoDO> getMallProdInfoByGoodsId(Integer goodsId);
List<MallProdSkuInfoSpecDO> listMallProdSkuInfoSpec(Integer goodsId);
List<ProductSpecDO> listProductSpecInfo(List<Integer> collect);
List<MallIndustrySkuInfoDO> getMallIndustrySkuInfo(Integer goodsInfoId);
List<MallIndustrySkuInfoSpecDO> getIndustrySkuInfoSpec(Integer goodsInfoId);
int countListGoodsByQO(GoodsInfoQO param);
List<GoodsInfoDO> listGoodsByQO(GoodsInfoQO param);
List<GoodsTypeDO> listIndustryIdBySort();
List<IndustryProductInventoryDO> getIndustryProductInventory(Integer industrySpecId);
List<InventorySpecDO> listInventorySpec(List<Integer> collect);
ProductSpecDO getProductSpecDetail(Integer productSpecId);
ProductSkuDO getProductSkuDetail(Integer productSkuId);
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.*;
import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.vo.LeaseVo;
import org.apache.ibatis.annotations.Mapper;
......@@ -26,5 +27,9 @@ public interface WebDeviceDao {
InventoryDO findInventory(Integer inventoryId);
DeviceListDO detail(Integer id);
List<WareInfoDO> detail(Integer id);
int countListWareInfoPage(WareInfoQO param);
List<WareInfoDO> listWareInfoPage(WareInfoQO param);
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.GoodsInfoDO;
import com.mmc.pms.entity.ProductCategory;
import com.mmc.pms.model.qo.GoodsInfoQO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
......@@ -16,4 +18,10 @@ public interface WebProductMallDao {
List<ProductCategory> productParts();
List<ProductCategory> productQuality();
int countListGoodsInfo(GoodsInfoQO param);
List<GoodsInfoDO> listGoodsInfo(GoodsInfoQO param);
Integer findProduct(Integer id);
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.DeviceCategoryDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -9,12 +8,11 @@ import lombok.Data;
* @Author small @Date 2023/5/15 15:03 @Version 1.0
*/
@Data
@ApiModel("设备类目")
public class DeviceCategory extends BaseEntity {
@ApiModelProperty("1")
@ApiModelProperty(name = "id", value = "类目id", example = "1")
private Integer id;
@ApiModelProperty("类目名称")
@ApiModelProperty(name = "id", value = "类目名称", example = "无人机")
private String name;
public DeviceCategoryDTO deviceCategory() {
......
package com.mmc.pms.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 13:38 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GoodsConfigExportDO implements Serializable {
private static final long serialVersionUID = -165522550874242214L;
private Integer id;
private Integer goodInfoId;
private String inventory;
private String functionConfig;
private Date createTime;
private Date updateTime;
private Integer deleted;
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsDetailInfoDTO;
import com.mmc.pms.model.vo.GoodsDetailVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:11 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Accessors(chain = true)
public class GoodsDetailDO implements Serializable {
private Integer id;
private Integer goodsInfoId;
private String goodsDesc;
private String content;
private String remark;
private Date createTime;
private Date updateTime;
public GoodsDetailDO(GoodsDetailVO goodsDetailVO) {
this.goodsDesc = goodsDetailVO.getGoodsDesc();
this.content = goodsDetailVO.getProductDesc();
this.remark = goodsDetailVO.getRemark();
}
public GoodsDetailInfoDTO buildGoodsDetailInfoDTO() {
return GoodsDetailInfoDTO.builder()
.id(this.id)
.goodsDesc(this.goodsDesc)
.content(this.content)
.remark(this.remark)
.build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsImgDTO;
import com.mmc.pms.model.vo.GoodsImgVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:10 @Version 1.0
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class GoodsImgDO implements Serializable {
private Integer id;
private Integer goodsInfoId;
private String imgUrl;
private Integer imgType;
private Integer deleted;
private Date createTime;
public GoodsImgDO(GoodsImgVO d) {
this.imgUrl = d.getImgUrl();
this.imgType = d.getImgType();
}
public GoodsImgDTO buildGoodsImgDTO() {
return GoodsImgDTO.builder().id(this.id).imgUrl(this.imgUrl).imgType(this.imgType).build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.AppGoodsInfoDTO;
import com.mmc.pms.model.dto.GoodsInfoListDTO;
import com.mmc.pms.model.vo.CategoryParamAndValueVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/16 13:33 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Accessors(chain = true)
public class GoodsInfoDO implements Serializable {
private static final long serialVersionUID = -1329342381196659417L;
private Integer id;
private Integer pid;
private String goodsNo;
private String goodsName;
private Integer masterTypeId;
private Integer slaveTypeId;
private Integer shelfStatus;
private Integer skuNum;
private Integer deleted;
private Date createTime;
private Date updateTime;
private Integer goodsAttr;
private String ecoLabel;
private Integer goodsCategoryId;
private Integer repoId;
private Integer shareFlyServiceId;
private Integer goodsType;
private Integer sort;
private Integer showCode;
private Integer standardProduct;
private String tag;
/** 辅助字段-start */
private String videoUrl;
private Integer goodsVideoId;
private String goodsDesc;
private GoodsVideoDO goodsVideoDO;
private String mainImg; // 主图
private GoodsTypeDO goodsMasterType;
private GoodsTypeDO goodsSlaveType;
private String remark; // 底部备注
private Integer sortTypeId;
private List<CategoryParamAndValueVO> paramAndValue;
private GoodsConfigExportDO goodsConfigExport; // 功能清单
private Integer buyNum; // 购买数量
private String directoryName;
private Integer isCoupons;
public GoodsInfoListDTO buildGoodsInfoListDTO() {
return GoodsInfoListDTO.builder()
.id(this.id)
.goodsName(this.goodsName)
.status(this.shelfStatus)
.createTime(this.createTime)
.imgUrl(this.mainImg)
.directoryId(this.sortTypeId)
.directoryName(this.directoryName)
.goodsOneLevelTypeName(this.goodsMasterType.getTypeName())
.goodsTwoLevelTypeName(this.goodsSlaveType.getTypeName())
.isCoupons(this.isCoupons)
.build();
}
public AppGoodsInfoDTO buildAppGoodsInfoDTO() {
return AppGoodsInfoDTO.builder()
.id(this.id)
.goodsName(this.goodsName)
.mainImg(this.mainImg)
.goodsDesc(this.goodsDesc)
.shelfStatus(this.shelfStatus)
.goodsAttr(this.goodsAttr)
.ecoLabel(this.tag)
.showCode(this.showCode)
.sort(this.sort)
.build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsQaDTO;
import com.mmc.pms.model.vo.GoodsQaVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:23 @Version 1.0
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class GoodsQaDO implements Serializable {
private Integer id;
private Integer goodsInfoId;
private String question;
private String answer;
private Integer deleted;
private Date updateTime;
private Date createTime;
public GoodsQaDO(GoodsQaVO goodsQaVO) {
this.question = goodsQaVO.getQuestion();
this.answer = goodsQaVO.getAnswer();
}
public GoodsQaDTO buildGoodsQaDTO() {
return GoodsQaDTO.builder().id(this.id).answer(this.answer).question(this.question).build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsOtherServiceDTO;
import com.mmc.pms.model.dto.GoodsServiceDTO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:25 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class GoodsServiceDO implements Serializable {
private static final long serialVersionUID = -2612831712612727210L;
private Integer id;
private Integer goodsInfoId;
private Integer saleServiceId;
private Date createTime;
/** 辅助字段-start */
private String serviceName;
private String remark;
/** 辅助字段-end */
public GoodsServiceDTO buildGoodsServiceDTO() {
return GoodsServiceDTO.builder()
.id(this.id)
.saleServiceId(this.saleServiceId)
.goodsInfoId(goodsInfoId)
.serviceName(serviceName)
.remark(remark)
.build();
}
public GoodsOtherServiceDTO buildGoodsOtherServiceDTO() {
return GoodsOtherServiceDTO.builder()
.id(this.id)
.saleServiceId(this.saleServiceId)
.serviceName(this.serviceName)
.build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.vo.GoodsGroupVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 13:34 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class GoodsTypeDO implements Serializable {
private Integer id;
private Integer pid;
private Integer sortTypeId;
private String typeName;
private String description;
private Integer sort;
private String icon;
private String remark;
private Integer deleted;
private Date updateTime;
private Date createTime;
/** 辅助字段-start */
private GoodsTypeDO slaveType;
/** 辅助字段-end */
public GoodsTypeDO(GoodsGroupVO goodsGroupVO) {
this.sortTypeId = goodsGroupVO.getSortTypeId();
this.typeName = goodsGroupVO.getGroupName();
this.pid = goodsGroupVO.getPid();
this.description = goodsGroupVO.getDescription();
this.icon = goodsGroupVO.getIcon();
this.remark = goodsGroupVO.getRemark();
}
}
package com.mmc.pms.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 13:34 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain = true)
public class GoodsVideoDO implements Serializable {
private Integer id;
private Integer goodsInfoId;
private String videoUrl;
private Integer videoType;
private Integer deleted;
private Date createTime;
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.MallIndustrySpecDTO;
import com.mmc.pms.model.vo.IndustrySpecVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:35 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IndustrySpecDO implements Serializable {
private static final long serialVersionUID = 8701065950780976397L;
private Integer id;
private Integer industrySkuId;
private String specName;
private String specImage;
private Date createTime;
private Date updateTime;
private Integer deleted;
private String solutionName;
public IndustrySpecDO(IndustrySpecVO param) {
this.id = param.getId();
this.industrySkuId = param.getIndustrySkuId();
this.specName = param.getSpecName();
this.specImage = param.getSpecImage();
}
/* public IndustrySpecDTO buildIndustrySpecDTO() {
return IndustrySpecDTO.builder()
.id(this.id)
.industrySkuId(this.industrySkuId)
.specImage(this.specImage)
.specName(this.specName)
.createTime(this.createTime)
.build();
}*/
public MallIndustrySpecDTO buildMallIndustrySpecDTO() {
return MallIndustrySpecDTO.builder()
.industrySpecId(this.id)
.industrySkuId(this.industrySkuId)
.specImage(this.specImage)
.specName(this.specName)
.build();
}
}
package com.mmc.pms.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:39 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class InventorySpecDO implements Serializable {
private static final long serialVersionUID = 8701065950780976397L;
private Integer id;
private Integer industryProductInventoryId;
private Integer productSpecId;
private Integer productSkuId;
private Integer deleted;
private Integer createTime;
private Integer updateTime;
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsSpecDTO;
import com.mmc.pms.model.vo.GoodsSpecVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:33 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class MallIndustrySkuInfoDO implements Serializable {
private static final long serialVersionUID = 1492322282696261487L;
private Integer id;
private Integer goodsInfoId;
private Integer industrySkuId;
private String industrySkuSpecName;
private Integer goodsTypeId;
private Integer chooseType;
private Integer must;
private Integer skuUnitId;
private Integer deleted;
private Date createTime;
private Date updateTime;
/** 辅助字段start */
private String typeName;
private String unitName;
private String industrySkuName;
/** 辅助字段end */
public MallIndustrySkuInfoDO(GoodsSpecVO goodsSpecVO) {
this.industrySkuId = goodsSpecVO.getSkuId();
this.chooseType = goodsSpecVO.getChooseType();
this.industrySkuSpecName = goodsSpecVO.getGoodsSpecName();
this.skuUnitId = goodsSpecVO.getSkuUnitId();
this.goodsTypeId = goodsSpecVO.getGoodsTypeId();
this.must = goodsSpecVO.getMust();
}
public GoodsSpecDTO buildGoodsSpecDTO() {
return GoodsSpecDTO.builder()
.id(this.id)
.goodsSpecName(this.industrySkuSpecName)
.goodsTypeId(this.goodsTypeId)
.chooseType(this.chooseType)
.skuUnitId(skuUnitId)
.unitName(this.unitName)
.skuId(this.industrySkuId)
.typeName(this.typeName)
.skuName(this.industrySkuName)
.must(must)
.build();
}
}
package com.mmc.pms.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:35 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class MallIndustrySkuInfoSpecDO implements Serializable {
private static final long serialVersionUID = 3405592933624268700L;
private Integer id;
private Integer mallIndustrySkuInfoId;
private Integer industrySpecId;
private Integer goodsInfoId;
private Integer deleted;
private Date createTime;
private Date updateTime;
private String goodsName;
private IndustrySpecDO industrySpecDO;
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsSpecDTO;
import com.mmc.pms.model.vo.GoodsSpecVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:26 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class MallProdSkuInfoDO implements Serializable {
private static final long serialVersionUID = 3667714765929443857L;
private Integer id;
private Integer goodsInfoId;
private Integer prodSkuId;
private String prodSkuSpecName;
private Integer goodsTypeId;
private Integer chooseType;
private Integer must;
private Integer skuUnitId;
private Integer deleted;
private Date createTime;
private Date updateTime;
private Integer flag;
/** 辅助字段 start */
private String typeName;
private String unitName;
private String productSkuName;
private Integer brandInfoId;
/** 辅助字段 end */
public MallProdSkuInfoDO(GoodsSpecVO goodsSpecVO) {
this.goodsTypeId = goodsSpecVO.getGoodsTypeId();
this.prodSkuSpecName = goodsSpecVO.getGoodsSpecName();
this.chooseType = goodsSpecVO.getChooseType();
this.skuUnitId = goodsSpecVO.getSkuUnitId();
this.must = goodsSpecVO.getMust();
this.flag = goodsSpecVO.getFlag();
}
public GoodsSpecDTO buildGoodsSpecDTO() {
return GoodsSpecDTO.builder()
.id(this.id)
.goodsSpecName(this.prodSkuSpecName)
.goodsTypeId(this.goodsTypeId)
.chooseType(this.chooseType)
.skuUnitId(skuUnitId)
.unitName(this.unitName)
.skuId(this.prodSkuId)
.typeName(this.typeName)
.must(must)
.skuName(this.productSkuName)
.brandInfoId(brandInfoId)
.flag(flag)
.build();
}
}
package com.mmc.pms.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:30 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class MallProdSkuInfoSpecDO implements Serializable {
private static final long serialVersionUID = -8247363408322497387L;
private Integer id;
private Integer mallProdSkuInfoId;
private Integer goodsInfoId;
private Integer productSpecId;
private Integer deleted;
private Date createTime;
private Date updateTime;
private String goodsName;
private ProductSpecDO productSpecDO;
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsProductSkuDTO;
import com.mmc.pms.model.dto.GoodsProductSkuVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 16:29 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ProductSkuDO implements Serializable {
private static final long serialVersionUID = -2830786012593215477L;
private Integer id;
private String productName;
private Integer goodsTypeId;
private String model;
private String productBrand;
private Date createTime;
private Date updateTime;
private Integer brandInfoId;
private Integer deleted;
private Integer sortTypeId;
private Integer customize;
/** 辅助字段 begin */
private String typeName;
private String sortName;
/** 辅助字段 end */
public ProductSkuDO(GoodsProductSkuVO param) {
this.id = param.getId();
this.goodsTypeId = param.getGoodsTypeId();
this.model = param.getModel();
this.productName = param.getProductName();
this.brandInfoId = param.getProductBrandId();
this.sortTypeId = param.getDirectoryId();
}
public GoodsProductSkuDTO buildGoodsProductSkuDTO() {
return GoodsProductSkuDTO.builder()
.id(this.id)
.productName(this.productName)
.goodsTypeId(this.goodsTypeId)
.model(this.model)
.productBrand(this.productBrand)
.productBrandId(brandInfoId)
.createTime(this.createTime)
.typeName(this.typeName)
.directoryId(sortTypeId)
.directoryName(this.sortName)
.build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.MallProductSpecDTO;
import com.mmc.pms.model.dto.ProductSpecDTO;
import com.mmc.pms.model.dto.ProductSpecVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:30 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ProductSpecDO implements Serializable {
private static final long serialVersionUID = -5476701567447257133L;
private Integer id;
private Integer productSkuId;
private String specName;
private String specImage;
private String partNo;
private String versionDesc;
private Date createTime;
private Date updateTime;
private Integer deleted;
public ProductSpecDO(ProductSpecVO param) {
this.id = param.getId();
this.productSkuId = param.getProductSkuId();
this.specName = param.getSpecName();
this.specImage = param.getSpecImage();
this.partNo = param.getPartNo();
this.versionDesc = param.getVersionDesc();
}
public ProductSpecDTO buildProductSpecDTO() {
return ProductSpecDTO.builder()
.id(this.id)
.productSkuId(this.productSkuId)
.specName(this.specName)
.specImage(this.specImage)
.partNo(this.partNo)
.versionDesc(this.versionDesc)
.createTime(this.createTime)
.build();
}
public MallProductSpecDTO buildMallProductSpecDTO() {
return MallProductSpecDTO.builder()
.productSpec(this.id)
.productSkuId(this.productSkuId)
.specName(this.specName)
.specImage(this.specImage)
.partNo(this.partNo)
.versionDesc(this.versionDesc)
.build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.WareImgDTO;
import com.mmc.pms.model.vo.WareImgVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 10:01 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WareImgDO implements Serializable {
private static final long serialVersionUID = -1711990559893951800L;
private Integer id;
private Integer wareInfoId;
private String imgUrl;
private Integer imgType;
private Integer deleted;
private Date createTime;
public WareImgDTO buildWareImgDTO() {
return WareImgDTO.builder()
.id(this.id)
.wareInfoId(this.wareInfoId)
.imgType(this.imgType)
.imgUrl(this.imgUrl)
.build();
}
public WareImgDO(WareImgVO d) {
this.id = d.getId();
this.imgUrl = d.getImgUrl();
this.imgType = d.getImgType();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.AppletWareInfoDTO;
import com.mmc.pms.model.dto.WareInfoDTO;
import com.mmc.pms.model.dto.WareInfoItemDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author small @Date 2023/5/16 10:00 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WareInfoDO implements Serializable {
private static final long serialVersionUID = 5530961803742843304L;
private Integer id;
private String wareNo;
private String wareTitle;
private Integer wareTypeId;
private Integer wareStatus;
private Integer payStatus;
private BigDecimal minDeposit;
private BigDecimal maxDeposit;
private BigDecimal minRent;
private BigDecimal maxRent;
private Integer totalStock;
private Integer totalSale;
private Integer skuNum;
private String tags;
private Integer deleted;
private Date createTime;
private Date updateTime;
private Integer pid;
/** 辅助字段-start */
private List<WareImgDO> wareImgs;
// private List<WareVideoDO> wareVideos;
private WarePropDO warePropDO;
private String wareDetailContent;
// private WareDetailDO wareDetailDO;
// private List<SkuInfoDO> skuInfoDOList;
/** 辅助字段-end */
public WareInfoDTO buildWareInfoDTO() {
return WareInfoDTO.builder()
.id(this.id)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.wareTypeId(this.wareTypeId)
.wareStatus(this.wareStatus)
.payStatus(this.payStatus)
.minDeposit(this.minDeposit)
.maxDeposit(this.maxDeposit)
.minRent(this.minRent)
.maxRent(this.maxRent)
.totalStock(this.totalStock)
.totalSale(this.totalSale)
.skuNum(this.skuNum)
.tags(StringUtils.isEmpty(this.tags) ? null : Arrays.asList(this.tags.split(",")))
.wareImgs(
CollectionUtils.isEmpty(this.wareImgs)
? null
: this.wareImgs.stream()
.map(
d -> {
return d.buildWareImgDTO();
})
.collect(Collectors.toList()))
.warePropDTO(this.warePropDO == null ? null : warePropDO.buildWarePropDTO())
.wareDetailContent(this.wareDetailContent)
.build();
}
public WareInfoItemDTO buildWareInfoItemDTO() {
return WareInfoItemDTO.builder()
.id(this.id)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.wareTypeId(this.wareTypeId)
.wareStatus(this.wareStatus)
.minDeposit(this.minDeposit)
.minRent(this.minRent)
.totalStock(this.totalStock)
.totalSale(this.totalSale)
.tags(StringUtils.isEmpty(this.tags) ? null : Arrays.asList(this.tags.split(",")))
.wareImgs(
CollectionUtils.isEmpty(this.wareImgs)
? null
: this.wareImgs.stream()
.map(
d -> {
return d.buildWareImgDTO();
})
.collect(Collectors.toList()))
.propInfoId(this.warePropDO.getPropInfoId())
.createTime(this.createTime)
.build();
}
public AppletWareInfoDTO buildAppletWareInfoDTO() {
return AppletWareInfoDTO.builder()
.id(this.id)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.wareTypeId(this.wareTypeId)
.wareStatus(this.wareStatus)
.payStatus(this.payStatus)
.minDeposit(this.minDeposit)
.minRent(this.minRent)
.totalStock(this.totalStock)
.totalSale(this.totalSale)
.skuNum(this.skuNum)
.tags(StringUtils.isEmpty(this.tags) ? null : Arrays.asList(this.tags.split(",")))
.wareImgs(
CollectionUtils.isEmpty(this.wareImgs)
? null
: this.wareImgs.stream()
.map(
d -> {
return d.buildWareImgDTO();
})
.collect(Collectors.toList()))
.build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.WarePropDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 10:01 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WarePropDO implements Serializable {
private static final long serialVersionUID = -8305801318237157082L;
private Integer id;
private Integer wareInfoId;
private Integer propInfoId;
private String propPoster;
private Date createTime;
public WarePropDTO buildWarePropDTO() {
return WarePropDTO.builder()
.id(this.id)
.wareInfoId(this.wareInfoId)
.propInfoId(this.propInfoId)
.propPoster(this.propPoster)
.createTime(this.createTime)
.build();
}
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:55 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.dto.AppGoodsInfoDTO", description = "小程序商品信息DTO")
public class AppGoodsInfoDTO implements Serializable {
private static final long serialVersionUID = 6104334488561632747L;
@ApiModelProperty("商品id")
private Integer id;
@ApiModelProperty("商品名称")
private String goodsName;
@ApiModelProperty("商品上架状态")
private Integer shelfStatus;
@ApiModelProperty("商品主图")
private String mainImg;
@ApiModelProperty("商品描述")
private String goodsDesc;
@ApiModelProperty("商品属性")
private Integer goodsAttr;
@ApiModelProperty("生态标签")
private String ecoLabel;
@ApiModelProperty("安全编码")
private String code;
@ApiModelProperty("排序")
private Integer sort;
@ApiModelProperty("安全编码是否显示 0 否 1 是")
private Integer showCode;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/16 15:02 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class AppGoodsInfoDetailDTO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "pid")
private Integer pid;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "云享飞服务id")
private Integer shareFlyServiceId;
@ApiModelProperty(value = "云仓配件id")
private Integer repoId;
@ApiModelProperty(value = "规格信息")
private List<GoodsSpecDTO> goodsSpec;
@ApiModelProperty(value = "商品图片")
private List<GoodsImgDTO> images;
@ApiModelProperty(value = "商品视频")
private String goodsVideo;
@ApiModelProperty(value = "商品视频id")
private Integer goodsVideoId;
@ApiModelProperty(value = "商品详情")
private GoodsDetailInfoDTO goodsDetail;
@ApiModelProperty(value = "所属目录")
private Integer sortTypeId;
@ApiModelProperty(value = "一级分类id")
private Integer masterTypeId;
@ApiModelProperty(value = "二级分类id")
private Integer slaveTypeId;
@ApiModelProperty(value = "商品标签")
private String tag;
@ApiModelProperty(value = "商品状态 0:下架 1:上架")
private Integer shelfStatus;
@ApiModelProperty(value = "其他服务: 1:免费配送,2:专业飞手培训2日, 3:半年保修, 4:一年保修 ")
private List<GoodsOtherServiceDTO> otherService;
@ApiModelProperty(value = "常见问题")
private List<GoodsQaDTO> question;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author small @Date 2023/5/16 10:03 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AppletWareInfoDTO implements Serializable {
private static final long serialVersionUID = -8861604532607064616L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "商品编号")
private String wareNo;
@ApiModelProperty(value = "商品名称")
private String wareName;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品类型ID")
private Integer wareTypeId;
@ApiModelProperty(value = "商品状态")
private Integer wareStatus;
@ApiModelProperty(value = "减库方式")
private Integer payStatus;
@ApiModelProperty(value = "最小押金")
private BigDecimal minDeposit;
@ApiModelProperty(value = "最小租金")
private BigDecimal minRent;
@ApiModelProperty(value = "总库存数量")
private Integer totalStock;
@ApiModelProperty(value = "总销量")
private Integer totalSale;
@ApiModelProperty(value = "sku数量")
private Integer skuNum;
@ApiModelProperty(value = "标签集合")
private List<String> tags;
@ApiModelProperty(value = "商品图片集合")
private List<WareImgDTO> wareImgs;
@ApiModelProperty(value = "商品视频集合")
private List<WareVideoDTO> wareVideos;
}
......@@ -14,9 +14,9 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
public class DeviceCategoryDTO {
@ApiModelProperty("1")
@ApiModelProperty(name = "id", value = "类目id", example = "1")
private Integer id;
@ApiModelProperty("类目名称")
@ApiModelProperty(name = "id", value = "类目名称", example = "无人机")
private String name;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:12 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.dto.GoodsDetailInfoDTO", description = "商品详细信息DTO")
public class GoodsDetailInfoDTO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "描述")
private String goodsDesc;
@ApiModelProperty(value = "富文本")
private String content;
@ApiModelProperty(value = "商品备注")
private String remark;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:07 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.dto.GoodsImgDTO", description = "商品图片信息DTO")
public class GoodsImgDTO implements Serializable {
@ApiModelProperty(value = "图片id")
private Integer id;
@ApiModelProperty(value = "图片路径")
private String imgUrl;
@ApiModelProperty(value = "图片类型 : 0:主图 1:副图")
private Integer imgType;
}
package com.mmc.pms.model.dto;
import com.mmc.pms.entity.GoodsConfigExportDO;
import com.mmc.pms.entity.GoodsTypeDO;
import com.mmc.pms.entity.GoodsVideoDO;
import com.mmc.pms.model.vo.CategoryParamAndValueVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/16 13:41 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Accessors(chain = true)
public class GoodsInfoDO implements Serializable {
private static final long serialVersionUID = -1329342381196659417L;
private Integer id;
private Integer pid;
private String goodsNo;
private String goodsName;
private Integer masterTypeId;
private Integer slaveTypeId;
private Integer shelfStatus;
private Integer skuNum;
private Integer deleted;
private Date createTime;
private Date updateTime;
private Integer goodsAttr;
private String ecoLabel;
private Integer goodsCategoryId;
private Integer repoId;
private Integer shareFlyServiceId;
private Integer goodsType;
private Integer sort;
private Integer showCode;
private Integer standardProduct;
private String tag;
/** 辅助字段-start */
private String videoUrl;
private Integer goodsVideoId;
private String goodsDesc;
private GoodsVideoDO goodsVideoDO;
private String mainImg; // 主图
private GoodsTypeDO goodsMasterType;
private GoodsTypeDO goodsSlaveType;
private String remark; // 底部备注
private Integer sortTypeId;
private List<CategoryParamAndValueVO> paramAndValue;
private GoodsConfigExportDO goodsConfigExport; // 功能清单
private Integer buyNum; // 购买数量
private String directoryName;
private Integer isCoupons;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 13:29 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.dto.GoodsInfoListDTO", description = "商品列表信息DTO")
public class GoodsInfoListDTO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "状态 : 0:下架 1:上架")
private Integer status;
@ApiModelProperty(value = "商品主图")
private String imgUrl;
@ApiModelProperty(value = "一级分类名称")
private String goodsOneLevelTypeName;
@ApiModelProperty(value = "二级分类名称")
private String goodsTwoLevelTypeName;
@ApiModelProperty(value = "目录名字")
private String directoryName;
@ApiModelProperty(value = "目录id")
private Integer directoryId;
@ApiModelProperty(value = "是否有优惠券 0表示没有 有就返回数字")
private Integer isCoupons;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:02 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.dto.GoodsOtherServiceDTO", description = "其他服务信息DTO")
public class GoodsOtherServiceDTO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "其他服务id")
private Integer saleServiceId;
@ApiModelProperty(value = "其他服务名称")
private String serviceName;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/16 16:29 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class GoodsProductSkuDTO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "产品类型id")
private Integer goodsTypeId;
@ApiModelProperty(value = "产品类型名称")
private String typeName;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "产品品牌")
private String productBrand;
@ApiModelProperty(value = "产品品牌id")
private Integer productBrandId;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "目录id")
private Integer directoryId;
@ApiModelProperty(value = "目录名称")
private String directoryName;
@ApiModelProperty(value = "产品规格信息对象")
private List<ProductSpecDTO> productSpecList;
}
package com.mmc.pms.model.dto;
import com.mmc.pms.model.vo.Create;
import com.mmc.pms.model.vo.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:05 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GoodsProductSkuVO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id")
@NotNull(
message = "修改时id不能为空",
groups = {Update.class})
private Integer id;
@NotNull(
message = "产品名称不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "产品名称")
private String productName;
@NotNull(
message = "产品类型不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "产品类型")
private Integer goodsTypeId;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "产品品牌")
private String productBrand;
@ApiModelProperty(value = "品牌id")
private Integer productBrandId;
@ApiModelProperty(value = "目录id")
private Integer directoryId;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:02 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.dto.GoodsQaDTO", description = "常见问题DTO")
public class GoodsQaDTO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "问题")
private String question;
@ApiModelProperty(value = "回答")
private String answer;
}
package com.mmc.pms.model.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:25 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.dto.GoodsServiceDTO", description = "商品服务DTO")
public class GoodsServiceDTO implements Serializable {
private static final long serialVersionUID = -3178549723714411915L;
private Integer id;
private Integer saleServiceId;
private Integer goodsInfoId;
private String serviceName;
private String remark;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/16 15:03 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain = true)
public class GoodsSpecDTO implements Serializable {
private static final long serialVersionUID = -8681372139970849591L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "规格名称")
private String goodsSpecName;
@ApiModelProperty(value = "产品或行业类型")
private Integer goodsTypeId;
@ApiModelProperty(value = "产品或行业类型名称")
private String typeName;
@ApiModelProperty(value = "产品或行业skuId")
private Integer skuId;
@ApiModelProperty(value = "品牌id")
private Integer brandInfoId;
@ApiModelProperty(value = "产品或行业sku名称")
private String skuName;
@ApiModelProperty(value = "产品规格信息")
private List<MallProductSpecDTO> productSpecList;
@ApiModelProperty(value = "行业规格信息")
private List<MallIndustrySpecDTO> industrySpecList;
@ApiModelProperty(value = "选择方式")
private Integer chooseType;
@ApiModelProperty(value = "规格单位")
private Integer skuUnitId;
@ApiModelProperty(value = "单位名称")
private String unitName;
@ApiModelProperty(value = "是否必选")
private Integer must;
@ApiModelProperty(value = "规格来源 0获取 1自定义")
private Integer flag;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/16 13:35 @Version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.dto.GoodsTypeDetailDTO", description = "分类详情DTO")
public class GoodsTypeDetailDTO implements Serializable {
private static final long serialVersionUID = 4405239380837705419L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "分类名称")
private String groupName;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "icon图标")
private String icon;
@ApiModelProperty(value = "总条数")
private Integer totalCount;
@ApiModelProperty(value = "商品对象")
private List<TypeGoodsInfoDTO> goodsInfo;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/16 15:04 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class MallIndustrySpecDTO implements Serializable {
private static final long serialVersionUID = 5476956071052692714L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "行业规格id")
private Integer industrySpecId;
@ApiModelProperty(value = "行业skuId")
private Integer industrySkuId;
@ApiModelProperty(value = "规格名称")
private String specName;
@ApiModelProperty(value = "规格图片")
private String specImage;
@ApiModelProperty(value = "产品清单")
private List<ProductInventoryVO> productInventoryList;
@ApiModelProperty(value = "创建时间")
private Date createTime;
}
package com.mmc.pms.model.dto;
import com.mmc.pms.model.vo.ProductSpecCPQVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:03 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain = true)
public class MallProductSpecDTO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "产品规格id")
private Integer productSpec;
@ApiModelProperty(value = "productSkuId")
private Integer productSkuId;
@ApiModelProperty(value = "规格名称")
private String specName;
@ApiModelProperty(value = "规格图片")
private String specImage;
@ApiModelProperty(value = "料号")
private String partNo;
@ApiModelProperty(value = "版本描述")
private String versionDesc;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "价格配置信息")
private ProductSpecCPQVO productSpecCPQVO;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/16 15:05 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ProductInventoryVO implements Serializable {
private static final long serialVersionUID = -2224789550998518979L;
@ApiModelProperty(value = "是否指定 不指定0 指定1")
private Integer select;
@ApiModelProperty(value = "产品sku")
private GoodsProductSkuVO productSku;
@ApiModelProperty(value = "productSkuId")
private Integer productSkuId;
@ApiModelProperty(value = "产品规格")
private List<ProductSpecVO> productSpecList;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/16 15:30 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors
public class ProductSpecDTO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "productSkuId")
private Integer productSkuId;
@ApiModelProperty(value = "规格名称")
private String specName;
@ApiModelProperty(value = "规格图片")
private String specImage;
@ApiModelProperty(value = "料号")
private String partNo;
@ApiModelProperty(value = "版本描述")
private String versionDesc;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "价格配置")
private List<ProductSpecPriceDTO> priceList;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:31 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ProductSpecPriceDTO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "规格id")
private Integer productSpecId;
@ApiModelProperty(value = "等级标签id")
private Integer tagInfoId;
@ApiModelProperty(value = "价格")
private BigDecimal price;
@ApiModelProperty(value = "创建时间")
private Date createTime;
}
package com.mmc.pms.model.dto;
import com.mmc.pms.model.vo.Create;
import com.mmc.pms.model.vo.ProductSpecCPQVO;
import com.mmc.pms.model.vo.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:06 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ProductSpecVO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id")
@NotNull(
message = "修改时id不能为空",
groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "productSkuId")
@NotNull(
message = "修改时productSkuId不能为空",
groups = {Create.class})
private Integer productSkuId;
@NotNull(
message = "规格名称不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "规格名称")
private String specName;
@NotNull(
message = "规格图片不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "规格图片")
private String specImage;
@NotNull(
message = "料号不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "料号")
private String partNo;
@ApiModelProperty(value = "版本描述")
private String versionDesc;
@ApiModelProperty(value = "价格配置信息")
private ProductSpecCPQVO productSpecCPQVO;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 14:05 @Version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.dto.TypeGoodsInfoDTO", description = "分类下关联的商品")
public class TypeGoodsInfoDTO implements Serializable {
private static final long serialVersionUID = 7151146563536604554L;
@ApiModelProperty(value = "商品id")
private Integer goodsId;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "商品主图")
private String goodsImg;
@ApiModelProperty(value = "商品上下架状态")
private Integer shelfStatus;
@ApiModelProperty(value = "商品安全编码是否显示:0否 1是")
private Integer showCode;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 9:54 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.pms.model.dto.WareImgDTO", description = "设备图片DTO")
public class WareImgDTO implements Serializable {
private static final long serialVersionUID = 1195966760401573468L;
@ApiModelProperty(name = "图片ID", value = "图片ID", required = false, example = "图片ID")
private Integer id;
@ApiModelProperty(name = "商品ID", value = "商品ID", required = false, example = "商品ID")
private Integer wareInfoId;
@ApiModelProperty(
name = "图片类型:0:主图 1:副图",
value = "图片类型:0:主图 1:副图",
required = false,
example = "图片类型:0:主图 1:副图")
private String imgUrl;
@ApiModelProperty(name = "图片ID", value = "图片ID", required = false, example = "图片ID")
private Integer imgType;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author small @Date 2023/5/16 10:02 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.dto.WareInfoDTO", description = "商品视频DTO")
public class WareInfoDTO implements Serializable {
private static final long serialVersionUID = -4916469576205012865L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "商品编号")
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品类型ID")
private Integer wareTypeId;
@ApiModelProperty(value = "商品状态")
private Integer wareStatus;
@ApiModelProperty(value = "减库方式")
private Integer payStatus;
@ApiModelProperty(value = "最小押金")
private BigDecimal minDeposit;
@ApiModelProperty(value = "最大押金")
private BigDecimal maxDeposit;
@ApiModelProperty(value = "最小租金")
private BigDecimal minRent;
@ApiModelProperty(value = "最大租金")
private BigDecimal maxRent;
@ApiModelProperty(value = "总库存数量")
private Integer totalStock;
@ApiModelProperty(value = "总销量")
private Integer totalSale;
@ApiModelProperty(value = "sku数量")
private Integer skuNum;
@ApiModelProperty(value = "标签集合")
private List<String> tags;
@ApiModelProperty(value = "商品图片集合")
private List<WareImgDTO> wareImgs;
// @ApiModelProperty(value = "商品视频集合")
// private List<WareVideoDTO> wareVideos;
@ApiModelProperty(value = "商品活动对象")
private WarePropDTO warePropDTO;
@ApiModelProperty(value = "商品介绍详情")
private String wareDetailContent;
// @ApiModelProperty(value = "商品介绍详情")
// private WareDetailDTO wareDetailDTO;
// @ApiModelProperty(value = "商品sku信息")
// private List<SkuInfoDTO> skuInfoDTOList;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/16 9:53 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.pms.model.dto.WareInfoItemDTO", description = "设备列表ItemDTO")
public class WareInfoItemDTO implements Serializable {
private static final long serialVersionUID = -4354269497656808831L;
@ApiModelProperty(name = "ID", value = "地域id", required = false, example = "ID")
private Integer id;
@ApiModelProperty(name = "ID", value = "商品编号", required = false, example = "商品编号")
private String wareNo;
@ApiModelProperty(name = "商品标题", value = "商品标题", required = false, example = "商品标题")
private String wareTitle;
@ApiModelProperty(name = "商品类型ID", value = "商品类型ID", required = false, example = "商品类型ID")
private Integer wareTypeId;
@ApiModelProperty(name = "商品状态", value = "商品状态", required = false, example = "商品状态")
private Integer wareStatus;
@ApiModelProperty(name = "最小押金", value = "最小押金", required = false, example = "最小押金")
private BigDecimal minDeposit;
@ApiModelProperty(name = "最小租金", value = "最小租金", required = false, example = "最小租金")
private BigDecimal minRent;
@ApiModelProperty(name = "总库存数量", value = "总库存数量", required = false, example = "总库存数量")
private Integer totalStock;
@ApiModelProperty(name = "总销量", value = "总销量", required = false, example = "总销量")
private Integer totalSale;
@ApiModelProperty(name = "商品活动属性Id", value = "商品活动属性Id", required = false, example = "商品活动属性Id")
private Integer propInfoId;
@ApiModelProperty(name = "生成时间", value = "生成时间", required = false, example = "生成时间")
private Date createTime;
@ApiModelProperty(name = "商品图片", value = "商品图片", required = false, example = "商品图片")
private List<WareImgDTO> wareImgs;
@ApiModelProperty(name = "标签集合", value = "标签集合", required = false, example = "标签集合")
private List<String> tags;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 10:02 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.dto.WarePropDTO", description = "商品活动海报信息DTO")
public class WarePropDTO implements Serializable {
private static final long serialVersionUID = 7641929218904130060L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "商品id")
private Integer wareInfoId;
@ApiModelProperty(value = "活动信息id")
private Integer propInfoId;
@ApiModelProperty(value = "活动海报")
private String propPoster;
@ApiModelProperty(value = "生成时间")
private Date createTime;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 10:03 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.dto.WareVideoDTO", description = "商品视频DTO")
public class WareVideoDTO implements Serializable {
private static final long serialVersionUID = 8707716829904299103L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "商品信息id")
private Integer wareInfoId;
@ApiModelProperty(value = "视频url")
private String videoUrl;
@ApiModelProperty(value = "0:主视频 1:副视频")
private Integer videoType;
}
package com.mmc.pms.model.qo;
import com.mmc.pms.model.vo.Freeze;
import com.mmc.pms.page.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @Author small @Date 2023/5/16 13:29 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.vo.GoodsInfoQO", description = "商品列表查询QO")
public class GoodsInfoQO {
/*@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "一级分类id")
private Integer masterTypeId;
@ApiModelProperty(value = "二级分类id")
private Integer slaveTypeId;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "状态 0:下架(仓库中)1:上架")
private Integer status;*/
@ApiModelProperty(name = "districtId", value = "地域id", example = "1", required = false)
private Integer districtId;
@ApiModelProperty(name = "产品类目id", value = "产品类目id", example = "1", required = false)
private Integer productCategoryId;
@ApiModelProperty(name = "brandId", value = "品牌id", example = "1", required = false)
private Integer brandId;
@ApiModelProperty(name = "partsId", value = "部件id", example = "1", required = false)
private Integer partsId;
@ApiModelProperty(name = "modelId", value = "型号id", example = "1", required = false)
private Integer modelId;
@ApiModelProperty(name = "qualityId", value = "成色id", example = "1", required = false)
private Integer qualityId;
@ApiModelProperty(value = "页码", required = true)
@NotNull(
message = "页码不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true)
@NotNull(
message = "每页显示数不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
package com.mmc.pms.model.qo;
import com.mmc.pms.page.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 9:55 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.qo.WareInfoQO", description = "model")
public class WareInfoQO implements Serializable {
private static final long serialVersionUID = -2953141525621912414L;
@ApiModelProperty(name = "id", value = "设备id", example = "1", required = false)
private Integer id;
@ApiModelProperty(name = "districtId", value = "地域id", example = "1", required = false)
private Integer districtId;
@ApiModelProperty(name = "categoryId", value = "类目id", example = "类目id")
private Integer categoryId;
@ApiModelProperty(name = "brandIdl", value = "品牌id", example = "品牌id")
private Integer brandId;
@ApiModelProperty(name = "modelId", value = "型号id", example = "型号id")
private Integer modelId;
/*@ApiModelProperty(value = "关键字")
private String keyword;
@ApiModelProperty(value = "商品状态,出租中或仓库中")
private Integer wareStatus;
@ApiModelProperty(value = "商品类型")
private Integer wareTypeId;
@ApiModelProperty(value = "活动属性")
private Integer propInfoId;*/
@ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true)
@NotNull(message = "每页显示数不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
package com.mmc.pms.model.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author small @Date 2023/5/16 13:37 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CategoryParamAndValueVO {
private String param;
private String value;
}
package com.mmc.pms.model.vo;
/**
* @Author small @Date 2023/5/16 13:37 @Version 1.0
*/
public interface Create {}
package com.mmc.pms.model.vo;
/**
* @Author small @Date 2023/5/16 13:49 @Version 1.0
*/
public interface Freeze {}
package com.mmc.pms.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:12 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.vo.GoodsDetailVO", description = "商品详情")
public class GoodsDetailVO implements Serializable {
private static final long serialVersionUID = -3842207843504795301L;
@ApiModelProperty(value = "商品描述 :70字内")
@Size(
max = 250,
message = "商品描述不能超过250个字符",
groups = {Create.class, Update.class})
private String goodsDesc;
@ApiModelProperty(value = "产品介绍")
private String productDesc;
@ApiModelProperty(value = "商品备注:100字以内")
@Size(
max = 100,
message = "商品备注不能超过100个字符",
groups = {Create.class, Update.class})
private String remark;
}
package com.mmc.pms.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 13:35 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.vo.GoodsGroupVO", description = "商品分类")
public class GoodsGroupVO implements Serializable {
@ApiModelProperty(value = "id")
@NotNull(
message = "id不能为空",
groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "分类类型id")
@NotNull(
message = "分类类型id不能为空",
groups = {Update.class, Create.class})
private Integer sortTypeId;
@ApiModelProperty(value = "分类名称", required = true)
@Size(
max = 15,
message = "分类名称不能超过15个字",
groups = {Update.class, Create.class})
@NotNull(
message = "分类名称不能为空",
groups = {Update.class, Create.class})
private String groupName;
@ApiModelProperty(value = "pid:一级分类的pid是0 二级分类pid是一级分类id", required = true)
@NotNull(
message = "pid不能为空",
groups = {Create.class, Update.class})
private Integer pid;
@ApiModelProperty(value = "描述")
@Size(
max = 70,
message = "分类描述不能超过70个字",
groups = {Update.class, Create.class})
private String description;
@ApiModelProperty(value = "icon图标")
private String icon;
@ApiModelProperty(value = "小程序底部备注")
@Size(
max = 150,
message = "小程序底部备注不能超过150个字",
groups = {Update.class, Create.class})
private String remark;
}
package com.mmc.pms.model.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:10 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.vo.GoodsImgVO", description = "新增/修改参数类")
public class GoodsImgVO implements Serializable {
private static final long serialVersionUID = 7742617679026160607L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "商品图片地址")
private String imgUrl;
@ApiModelProperty(value = "商品图片类型 0:主图 1:副图")
private Integer imgType;
}
package com.mmc.pms.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:23 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.vo.GoodsQaVO", description = "新增/修改参数类")
public class GoodsQaVO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "问题")
private String question;
@ApiModelProperty(value = "回答")
private String answer;
}
package com.mmc.pms.model.vo;
import com.mmc.pms.model.dto.ProductSpecVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/16 15:27 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GoodsSpecVO implements Serializable {
private static final long serialVersionUID = -8681372139970849591L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "规格名称")
private String goodsSpecName;
@ApiModelProperty(value = "产品类型")
private Integer goodsTypeId;
@ApiModelProperty(value = "产品:自定义时此字段可不用填写")
private Integer skuId;
@ApiModelProperty(value = "规格来源 0:获取 1:自定义")
private Integer flag;
@ApiModelProperty(value = "产品名称(自定义的时候才需要传值)")
private String productName;
@ApiModelProperty(value = "选项来源")
private List<MallProductSpecVO> specIds;
@ApiModelProperty(value = "选择方式")
private Integer chooseType;
@ApiModelProperty(value = "规格单位")
private Integer skuUnitId;
@ApiModelProperty(value = "是否必选")
private Integer must;
@ApiModelProperty(value = "自定义的信息填充")
private List<ProductSpecVO> customizeInfo;
@ApiModelProperty(value = "删除的自定义规格id")
private List<Integer> delProductSpecId;
}
package com.mmc.pms.model.vo;
import com.mmc.pms.model.dto.ProductInventoryVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/16 15:36 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IndustrySpecVO implements Serializable {
private static final long serialVersionUID = 5939041792432691119L;
@ApiModelProperty(value = "id")
@NotNull(message = "修改时id不能为空", groups = Update.class)
private Integer id;
@NotNull(
message = "行业sku的id不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "行业sku的id")
private Integer industrySkuId;
@NotNull(
message = "规格名称不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "规格名称")
private String specName;
@NotNull(
message = "规格图片不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "规格图片")
private String specImage;
@NotNull(
message = "产品清单不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "产品清单")
private List<ProductInventoryVO> productInventoryList;
}
package com.mmc.pms.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 15:27 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors
public class MallProductSpecVO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "产品或行业规格id")
private Integer mallSpecId;
}
package com.mmc.pms.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/16 15:04 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ProductSpecCPQVO implements Serializable {
private static final long serialVersionUID = 6055658459871113781L;
@ApiModelProperty(value = "产品规格id")
private Integer productSpecId;
@ApiModelProperty(value = "规格价格配置VO")
private List<SpecPriceVO> specPrice;
}
package com.mmc.pms.model.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author small @Date 2023/5/16 15:04 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SpecPriceVO implements Serializable {
private static final long serialVersionUID = -8976672168410262190L;
private Integer id;
private Integer tagInfoId;
private BigDecimal price;
}
package com.mmc.pms.model.vo;
/**
* @Author small @Date 2023/5/16 13:37 @Version 1.0
*/
public interface Update {}
package com.mmc.pms.model.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 10:01 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.vo.WareImgVO", description = "新增/修改参数类")
public class WareImgVO implements Serializable {
private static final long serialVersionUID = 7742617679026160607L;
@ApiModelProperty(value = "图片id")
private Integer id;
@ApiModelProperty(value = "商品图片地址")
private String imgUrl;
@ApiModelProperty(value = "商品图片类型")
private Integer imgType;
}
package com.mmc.pms.page;
/**
* @Author small @Date 2023/5/16 10:09 @Version 1.0
*/
public interface Page {}
package com.mmc.pms.page;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/16 9:58 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> implements Serializable {
private static final long serialVersionUID = -2848996493573325801L;
private int pageNo; // 分页起始页
private int pageSize; // 每页记录数
private T list; // 返回的记录集合
private long totalCount; // 总记录条数
private long totalPage; // 总页数
public static PageResult buildPage(int pageNo, int pageSize, int totalCount) {
PageResult page = new PageResult();
page.pageNo = pageNo;
page.pageSize = pageSize;
page.totalCount = totalCount;
page.totalPage =
(totalCount % pageSize == 0) ? (totalCount / pageSize) : (totalCount / pageSize + 1);
return page;
}
public static <T> PageResult buildPage(int pageNo, int pageSize, int totalCount, T list) {
PageResult page = PageResult.buildPage(pageNo, pageSize, totalCount);
page.setList(list);
return page;
}
}
package com.mmc.pms.service.Impl;
import com.mmc.pms.model.dto.ProductInventoryVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/16 15:41 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IndustryProductInventoryDO implements Serializable {
private static final long serialVersionUID = -3586673158091288317L;
private Integer id;
private Integer industrySpecId;
private Integer productSkuId;
private Integer selected;
private Integer deleted;
private Date createTime;
private Date updateTime;
public IndustryProductInventoryDO(ProductInventoryVO d) {
this.productSkuId = d.getProductSku().getId();
this.selected = d.getSelect();
}
}
package com.mmc.pms.service.Impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.dao.MiniProgramProductMallDao;
import com.mmc.pms.dao.WebDeviceDao;
import com.mmc.pms.entity.GoodsInfoDO;
import com.mmc.pms.entity.*;
import com.mmc.pms.model.dto.*;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.MiniProgramProductMallService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author small @Date 2023/5/16 15:08 @Version 1.0
*/
@Service
public class MiniProgramProductMallServiceImpl implements MiniProgramProductMallService {
@Autowired private MiniProgramProductMallDao goodsInfoDao;
@Autowired private WebDeviceDao webDeviceDao;
@Override
public ResultBody getAppGoodsInfoDetail(Integer goodsId) {
// 查询此商品是否下架或删除
GoodsInfoDO goodsInfoDO = goodsInfoDao.getGoodsInfoByGoodsId(goodsId);
if (goodsInfoDO == null || goodsInfoDO.getShelfStatus().equals(0)) {
return ResultBody.error(ResultEnum.SHOP_GOODS_NOT_ERROR);
}
AppGoodsInfoDetailDTO appGoodsInfoDetailDTO = new AppGoodsInfoDetailDTO();
appGoodsInfoDetailDTO
.setId(goodsInfoDO.getId())
.setGoodsName(goodsInfoDO.getGoodsName())
.setGoodsVideoId(goodsInfoDO.getGoodsVideoId())
.setMasterTypeId(goodsInfoDO.getMasterTypeId())
.setRepoId(goodsInfoDO.getRepoId())
.setSortTypeId(goodsInfoDO.getSortTypeId())
.setShelfStatus(goodsInfoDO.getShelfStatus())
.setSlaveTypeId(goodsInfoDO.getSlaveTypeId())
.setShareFlyServiceId(goodsInfoDO.getShareFlyServiceId())
.setGoodsVideo(goodsInfoDO.getVideoUrl())
.setTag(goodsInfoDO.getTag())
.setPid(goodsInfoDO.getPid());
// 获取商品图片信息
List<GoodsImgDO> goodsImgDO = goodsInfoDao.listGoodsInfoByGoodsId(goodsId);
appGoodsInfoDetailDTO.setImages(
goodsImgDO.stream().map(GoodsImgDO::buildGoodsImgDTO).collect(Collectors.toList()));
// 获取商品详情信息
GoodsDetailDO goodsDetailDO = goodsInfoDao.getGoodsDetailByGoodsId(goodsId);
appGoodsInfoDetailDTO.setGoodsDetail(goodsDetailDO.buildGoodsDetailInfoDTO());
// 获取常见问题信息
List<GoodsQaDO> goodsQaDO = goodsInfoDao.listGoodsQaInfoByGoodsId(goodsId);
appGoodsInfoDetailDTO.setQuestion(
goodsQaDO.stream().map(GoodsQaDO::buildGoodsQaDTO).collect(Collectors.toList()));
// 获取其他服务信息
List<GoodsServiceDO> goodsServiceDO = goodsInfoDao.listGoodsServiceByGoodsId(goodsId);
appGoodsInfoDetailDTO.setOtherService(
goodsServiceDO.stream()
.map(GoodsServiceDO::buildGoodsOtherServiceDTO)
.collect(Collectors.toList()));
// 判断商品是什么类型
if (!goodsInfoDO.getSortTypeId().equals(2)) {
// 获取该商品绑定的sku信息
List<MallProdSkuInfoDO> mallProdSkuInfo = goodsInfoDao.getMallProdInfoByGoodsId(goodsId);
// 获取该商品绑定的规格信息
List<MallProdSkuInfoSpecDO> mallProdSkuInfoSpecList =
goodsInfoDao.listMallProdSkuInfoSpec(goodsId);
Map<Integer, List<MallProdSkuInfoSpecDO>> specMap =
mallProdSkuInfoSpecList.stream()
.collect(Collectors.groupingBy(MallProdSkuInfoSpecDO::getMallProdSkuInfoId));
List<GoodsSpecDTO> list =
mallProdSkuInfo.stream()
.map(
d -> {
// 获取sku下规格信息
List<MallProdSkuInfoSpecDO> mallProdSkuInfoSpecDOList = specMap.get(d.getId());
List<ProductSpecDO> productSpecList =
goodsInfoDao.listProductSpecInfo(
mallProdSkuInfoSpecDOList.stream()
.map(MallProdSkuInfoSpecDO::getProductSpecId)
.collect(Collectors.toList()));
List<MallProductSpecDTO> collect =
productSpecList.stream()
.map(ProductSpecDO::buildMallProductSpecDTO)
.collect(Collectors.toList());
collect.stream()
.peek(
m -> {
for (MallProdSkuInfoSpecDO mallProdSkuInfoSpecDO :
mallProdSkuInfoSpecDOList) {
if (m.getProductSpec()
.equals(mallProdSkuInfoSpecDO.getProductSpecId())) {
m.setId(mallProdSkuInfoSpecDO.getId());
break;
}
}
})
.collect(Collectors.toList());
GoodsSpecDTO goodsSpecDTO = new GoodsSpecDTO();
goodsSpecDTO
.setId(d.getId())
.setSkuId(d.getProdSkuId())
.setGoodsSpecName(d.getProdSkuSpecName())
.setSkuName(d.getProductSkuName())
.setBrandInfoId(d.getBrandInfoId())
.setGoodsTypeId(d.getGoodsTypeId())
.setTypeName(d.getTypeName())
.setChooseType(d.getChooseType())
.setSkuUnitId(d.getSkuUnitId())
.setUnitName(d.getUnitName())
.setMust(d.getMust())
.setProductSpecList(collect);
return goodsSpecDTO;
})
.collect(Collectors.toList());
appGoodsInfoDetailDTO.setGoodsSpec(list);
} else {
appGoodsInfoDetailDTO.setGoodsSpec(getIndustrySpecInfo(goodsId));
}
return ResultBody.success(appGoodsInfoDetailDTO);
}
@Override
public ResultBody listGoodsByQO(GoodsInfoQO param) {
int count = goodsInfoDao.countListGoodsByQO(param);
if (count == 0) {
return ResultBody.success(
PageResult.buildPage(param.getPageNo(), param.getPageSize(), count));
}
int pageNo = param.getPageNo();
param.buildCurrentPage();
List<GoodsInfoDO> list = goodsInfoDao.listGoodsByQO(param);
// 找出行业对应的序号
List<GoodsTypeDO> ids = goodsInfoDao.listIndustryIdBySort();
int order = 0;
/*if (param.getMasterTypeId() != null) {
for (int i = 0; i < ids.size(); i++) {
if (param.getMasterTypeId().toString().equals(ids.get(i).getId().toString())) {
order = i + 1;
break;
}
}
}*/
List<AppGoodsInfoDTO> pageList = new ArrayList<>();
for (GoodsInfoDO d : list) {
AppGoodsInfoDTO appGoodsInfoDTO = d.buildAppGoodsInfoDTO();
// 直接看该服务在当前行业对应所有服务中在第几个
for (int j = 0; j < list.size(); j++) {
if (appGoodsInfoDTO.getId().toString().equals(list.get(j).getId().toString())) {
if (j < 9) {
appGoodsInfoDTO.setCode(order + "0" + (j + 1));
} else {
appGoodsInfoDTO.setCode(order + "" + (j + 1));
}
break;
}
}
if (appGoodsInfoDTO.getShelfStatus() == 1) {
pageList.add(appGoodsInfoDTO);
}
}
return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, pageList));
}
private List<GoodsSpecDTO> getIndustrySpecInfo(Integer goodsInfoId) {
// 获取商品对应绑定的行业sku信息
List<MallIndustrySkuInfoDO> mallIndustrySkuInfoList =
goodsInfoDao.getMallIndustrySkuInfo(goodsInfoId);
List<GoodsSpecDTO> list =
mallIndustrySkuInfoList.stream()
.map(MallIndustrySkuInfoDO::buildGoodsSpecDTO)
.collect(Collectors.toList());
// 根据商品id查出该商品下绑定的规格信息
List<MallIndustrySkuInfoSpecDO> mallIndustrySkuInfoSpec =
goodsInfoDao.getIndustrySkuInfoSpec(goodsInfoId);
list =
list.stream()
.peek(
d -> {
List<MallIndustrySpecDTO> industrySpec = new ArrayList<>();
for (MallIndustrySkuInfoSpecDO e : mallIndustrySkuInfoSpec) {
if (d.getId().equals(e.getMallIndustrySkuInfoId())) {
IndustrySpecDO industrySpecDO = e.getIndustrySpecDO();
// 获取商品清单信息
List<IndustryProductInventoryDO> industryProdInventory =
goodsInfoDao.getIndustryProductInventory(e.getIndustrySpecId());
List<ProductInventoryVO> productInventoryList = new ArrayList<>();
// 获取行业规格绑定的产品规格信息
List<InventorySpecDO> inventorySpecDOList =
goodsInfoDao.listInventorySpec(
industryProdInventory.stream()
.map(IndustryProductInventoryDO::getId)
.collect(Collectors.toList()));
Map<Integer, List<InventorySpecDO>> inventoryMap =
inventorySpecDOList.stream()
.collect(
Collectors.groupingBy(
InventorySpecDO::getIndustryProductInventoryId));
getIndustrySpecOnProdSpecInfo(
industryProdInventory, productInventoryList, inventoryMap);
MallIndustrySpecDTO industrySpecDTO =
industrySpecDO.buildMallIndustrySpecDTO();
industrySpecDTO.setId(e.getId());
industrySpecDTO.setIndustrySpecId(e.getIndustrySpecId());
industrySpecDTO.setIndustrySkuId(d.getSkuId());
industrySpecDTO.setProductInventoryList(productInventoryList);
industrySpec.add(industrySpecDTO);
}
}
d.setIndustrySpecList(industrySpec);
})
.collect(Collectors.toList());
return list;
}
private void getIndustrySpecOnProdSpecInfo(
List<IndustryProductInventoryDO> industryProdInventory,
List<ProductInventoryVO> productInventoryList,
Map<Integer, List<InventorySpecDO>> inventoryMap) {
for (IndustryProductInventoryDO industryProductInventoryDO : industryProdInventory) {
List<InventorySpecDO> inventorySpec = inventoryMap.get(industryProductInventoryDO.getId());
if (!CollectionUtils.isEmpty(inventorySpec)) {
List<ProductSpecVO> productSpecList =
inventorySpec.stream()
.map(
in -> {
ProductSpecDO productSpecDetail =
goodsInfoDao.getProductSpecDetail(in.getProductSpecId());
ProductSpecVO productSpecVO = new ProductSpecVO();
BeanUtils.copyProperties(productSpecDetail, productSpecVO);
return productSpecVO;
})
.collect(Collectors.toList());
ProductSkuDO productSkuDetail =
goodsInfoDao.getProductSkuDetail(industryProductInventoryDO.getProductSkuId());
GoodsProductSkuVO goodsProductSkuVO = new GoodsProductSkuVO();
BeanUtils.copyProperties(productSkuDetail, goodsProductSkuVO);
// 添加数据
ProductInventoryVO productInventoryVO = new ProductInventoryVO();
productInventoryVO.setSelect(industryProductInventoryDO.getSelected());
productInventoryVO.setProductSku(goodsProductSkuVO);
productInventoryVO.setProductSpecList(productSpecList);
productInventoryList.add(productInventoryVO);
}
}
}
}
......@@ -4,7 +4,9 @@ import com.mmc.pms.common.ResultBody;
import com.mmc.pms.dao.WebDeviceDao;
import com.mmc.pms.entity.*;
import com.mmc.pms.model.dto.*;
import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.vo.LeaseVo;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.WebDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -99,8 +101,34 @@ public class WebDeviceServiceImpl implements WebDeviceService {
@Override
public ResultBody detail(Integer id) {
DeviceListDO detail = webDeviceDao.detail(id);
DeviceListDTO deviceListDTO = detail.deviceListDTO();
return ResultBody.success(deviceListDTO);
List<WareInfoDO> list = webDeviceDao.detail(id);
List<WareInfoItemDTO> pageList =
list.stream()
.map(
d -> {
return d.buildWareInfoItemDTO();
})
.collect(Collectors.toList());
return ResultBody.success(pageList);
}
@Override
public ResultBody listWareInfoPage(WareInfoQO param) {
int count = webDeviceDao.countListWareInfoPage(param);
if (count == 0) {
return ResultBody.success(
PageResult.buildPage(param.getPageNo(), param.getPageSize(), count));
}
int pageNo = param.getPageNo();
param.buildCurrentPage();
List<WareInfoDO> list = webDeviceDao.listWareInfoPage(param);
List<WareInfoItemDTO> pageList =
list.stream()
.map(
d -> {
return d.buildWareInfoItemDTO();
})
.collect(Collectors.toList());
return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, pageList));
}
}
......@@ -2,8 +2,12 @@ package com.mmc.pms.service.Impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.dao.WebProductMallDao;
import com.mmc.pms.entity.GoodsInfoDO;
import com.mmc.pms.entity.ProductCategory;
import com.mmc.pms.model.dto.GoodsInfoListDTO;
import com.mmc.pms.model.dto.ProductCategoryDTO;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.WebProductMallService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -57,4 +61,24 @@ public class WebProductMallServiceImpl implements WebProductMallService {
.collect(Collectors.toList());
return ResultBody.success(collect);
}
@Override
public PageResult listPageGoodsInfo(GoodsInfoQO param) {
int count = webProductMallDao.countListGoodsInfo(param);
if (count == 0) {
return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count);
}
Integer pageNo = param.getPageNo();
param.buildCurrentPage();
List<GoodsInfoDO> goodsInfo = webProductMallDao.listGoodsInfo(param);
goodsInfo.stream()
.forEach(
t -> {
Integer product = webProductMallDao.findProduct(t.getId());
t.setIsCoupons(product);
});
List<GoodsInfoListDTO> pageList =
goodsInfo.stream().map(GoodsInfoDO::buildGoodsInfoListDTO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, param.getPageSize(), count, pageList);
}
}
package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.qo.GoodsInfoQO;
/**
* @Author small @Date 2023/5/16 15:08 @Version 1.0
*/
public interface MiniProgramProductMallService {
ResultBody getAppGoodsInfoDetail(Integer id);
ResultBody listGoodsByQO(GoodsInfoQO param);
}
package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.vo.LeaseVo;
/**
......@@ -20,4 +21,6 @@ public interface WebDeviceService {
ResultBody update(LeaseVo param);
ResultBody detail(Integer id);
ResultBody listWareInfoPage(WareInfoQO param);
}
package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.page.PageResult;
/**
* @Author small @Date 2023/5/15 20:08 @Version 1.0
......@@ -12,4 +14,6 @@ public interface WebProductMallService {
ResultBody productParts();
ResultBody productQuality();
PageResult listPageGoodsInfo(GoodsInfoQO param);
}
<?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.mmc.pms.dao.MiniProgramProductMallDao">
<resultMap id="resultGoodsInfo" type="com.mmc.pms.entity.GoodsInfoDO">
<id property="id" column="id"/>
<result property="pid" column="pid"/>
<result property="goodsCategoryId" column="goods_category_id"/>
<result property="goodsName" column="goods_name"/>
<result property="createTime" column="create_time"/>
<result property="masterTypeId" column="master_type_id"/>
<result property="slaveTypeId" column="slave_type_id"/>
<result property="shelfStatus" column="shelf_status"/>
<result property="sortTypeId" column="sort_type_id"/>
<result property="remark" column="remark"/>
<result property="shareFlyServiceId" column="share_fly_service_id"/>
<result property="repoId" column="repo_id"/>
<result property="ecoLabel" column="eco_label"/>
<result property="goodsAttr" column="goods_attr"/>
<result property="showCode" column="is_show_code"/>
<result property="sort" column="sort"/>
<result property="tag" column="tag"/>
<result property="goodsType" column="goods_type"/>
<result property="standardProduct" column="is_standard_product"/>
<result property="goodsVideoId" column="videoId"/>
<result property="videoUrl" column="videoUrl"/>
<association property="goodsVideoDO" resultMap="resultVideoInfo"/>
</resultMap>
<resultMap id="resultVideoInfo" type="com.mmc.pms.entity.GoodsVideoDO">
<id property="id" column="videoId"/>
<result property="videoUrl" column="videoUrl"/>
</resultMap>
<resultMap id="resultGoodsImg" type="com.mmc.pms.entity.GoodsImgDO">
<id property="id" column="id"/>
<result property="imgUrl" column="img_url"/>
<result property="imgType" column="img_type"/>
</resultMap>
<select id="getGoodsInfoByGoodsId" resultMap="resultGoodsInfo">
SELECT gi.id,
gi.pid,
gi.create_time,
gi.goods_name,
gi.goods_attr,
gi.eco_label,
gi.master_type_id,
gi.shelf_status,
gi.slave_type_id,
gi.repo_id,
gi.goods_type,
gi.goods_category_id,
gi.share_fly_service_id,
gi.is_standard_product,
gv.id AS videoId,
gv.video_url AS videoUrl,
gt.remark AS remark,
gt.sort_type_id,
gi.sort,
gi.is_show_code,
gi.tag
FROM goods_info gi
LEFT JOIN goods_video gv ON gi.id = gv.goods_info_id
AND gv.is_deleted = 0
LEFT JOIN goods_type gt ON gi.master_type_id = gt.id
AND gt.is_deleted = 0
WHERE gi.is_deleted = 0
AND gi.id = #{id}
</select>
<select id="listGoodsInfoByGoodsId" resultMap="resultGoodsImg">
SELECT id,
img_url,
img_type
FROM goods_img
WHERE is_deleted = 0
AND goods_info_id = #{id}
ORDER BY img_type DESC
</select>
<resultMap id="resultGoodsDetail" type="com.mmc.pms.entity.GoodsDetailDO">
<id column="id" property="id"/>
<result property="goodsDesc" column="goods_desc"/>
<result property="content" column="content"/>
<result property="remark" column="remark"/>
</resultMap>
<select id="getGoodsDetailByGoodsId" resultMap="resultGoodsDetail">
SELECT id,
goods_desc,
content,
remark
FROM goods_detail
WHERE goods_info_id = #{id}
</select>
<resultMap id="resultGoodsQa" type="com.mmc.pms.entity.GoodsQaDO">
<id property="id" column="id"/>
<result property="question" column="question"/>
<result property="answer" column="answer"/>
</resultMap>
<resultMap id="resultGoodsService" type="com.mmc.pms.entity.GoodsServiceDO">
<id property="id" column="id"/>
<result property="saleServiceId" column="saleServiceId"/>
<result property="serviceName" column="serviceName"/>
</resultMap>
<select id="listGoodsServiceByGoodsId" resultMap="resultGoodsService">
SELECT gc.id,
gc.sale_service_id AS saleServiceId,
ss.service_name AS serviceName
FROM goods_service gc
LEFT JOIN sale_service ss ON gc.sale_service_id = ss.id
WHERE gc.goods_info_id = #{id}
</select>
<select id="listGoodsQaInfoByGoodsId" resultMap="resultGoodsQa">
SELECT id,
question,
answer
FROM goods_qa
WHERE goods_info_id = #{id}
AND is_deleted = 0
</select>
<select id="getMallProdInfoByGoodsId" resultType="com.mmc.pms.entity.MallProdSkuInfoDO">
SELECT mp.id,
mp.prod_sku_id prodSkuId,
mp.prod_sku_spec_name prodSkuSpecName,
mp.goods_type_id goodsTypeId,
mp.choose_type chooseType,
mp.is_must must,
mp.sku_unit_id skuUnitId,
su.unit_name unitName,
ps.product_name productSkuName,
ps.brand_info_id brandInfoId,
gt.type_name typeName
FROM mall_prod_sku_info mp
INNER JOIN sku_unit su ON su.id = mp.sku_unit_id
INNER JOIN product_sku ps ON ps.id = mp.prod_sku_id
LEFT JOIN goods_type gt ON mp.goods_type_id = gt.id
WHERE mp.goods_info_id = #{goodsId}
AND mp.is_deleted = 0
</select>
<select id="listMallProdSkuInfoSpec" resultType="com.mmc.pms.entity.MallProdSkuInfoSpecDO">
SELECT id,
mall_prod_sku_info_id mallProdSkuInfoId,
product_spec_id productSpecId
FROM mall_prod_sku_info_spec
WHERE goods_info_id = #{goodsId}
AND is_deleted = 0
</select>
<select id="listProductSpecInfo" resultType="com.mmc.pms.entity.ProductSpecDO">
SELECT
id,
product_sku_id productSkuId,
spec_name specName,
spec_image specImage,
part_no partNo,
version_desc versionDesc
FROM
product_spec
WHERE
id in
<foreach collection="list" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
<select id="getMallIndustrySkuInfo" resultType="com.mmc.pms.entity.MallIndustrySkuInfoDO">
SELECT mi.id,
mi.industry_sku_id industrySkuId,
mi.industry_sku_spec_name industrySkuSpecName,
mi.choose_type chooseType,
mi.sku_unit_id skuUnitId,
mi.goods_type_id goodsTypeId,
mi.is_must must,
gt.type_name typeName,
su.unit_name unitName,
ins.solution_name industrySkuName
FROM mall_industry_sku_info mi
INNER JOIN goods_type gt ON gt.id = mi.goods_type_id
INNER JOIN sku_unit su ON su.id = mi.sku_unit_id
INNER JOIN industry_sku ins ON mi.industry_sku_id = ins.id
WHERE mi.goods_info_id = #{id}
AND mi.is_deleted = 0
</select>
<resultMap id="resultIndustrySkuInfoSpecMap" type="com.mmc.pms.entity.MallIndustrySkuInfoSpecDO">
<id column="id" property="id"/>
<result column="mall_industry_sku_info_id" property="mallIndustrySkuInfoId"/>
<result column="industry_spec_id" property="industrySpecId"/>
<association property="industrySpecDO" resultMap="resultIndustrySpecMap"/>
</resultMap>
<resultMap id="resultIndustrySpecMap" type="com.mmc.pms.entity.IndustrySpecDO">
<result column="industry_sku_id" property="industrySkuId"/>
<result column="spec_image" property="specImage"/>
<result column="spec_name" property="specName"/>
</resultMap>
<select id="getIndustrySkuInfoSpec" resultMap="resultIndustrySkuInfoSpecMap">
SELECT mi.id,
mi.mall_industry_sku_info_id,
mi.industry_spec_id,
ins.industry_sku_id,
ins.spec_image,
ins.spec_name
FROM mall_industry_sku_info_spec mi
INNER JOIN industry_spec ins ON ins.id = mi.industry_spec_id and mi.is_deleted = 0
WHERE goods_info_id = #{id}
</select>
<select id="countListGoodsByQO" resultType="int" parameterType="com.mmc.pms.model.qo.GoodsInfoQO">
SELECT count(*)
FROM
goods_info gi
LEFT JOIN goods_img img ON img.goods_info_id = gi.id
LEFT JOIN goods_type gt ON gt.id = gi.master_type_id
LEFT JOIN goods_type gty ON gty.id = gi.slave_type_id
LEFT JOIN goods_detail gd ON gd.goods_info_id = gi.id
<where>
gi.is_deleted = 0
<if test="districtId != null">
and (gi.district_id = #{districtId})
</if>
<if test="brandId != null">
and (gi.brand_id = #{brandId})
</if>
<if test="partsId != null">
and (gi.parts_id = #{partsId})
</if>
<if test="modelId != null">
and (gi.mode_id = #{modelId})
</if>
<if test="qualityId != null">
and (gi.quality_id = #{qualityId})
</if>
<if test="productCategoryId != null">
and (gi.sort_type_id = #{productCategoryId})
</if>
</where>
</select>
<resultMap id="resultMapAppGoodsInfo" type="com.mmc.pms.entity.GoodsInfoDO">
<id property="id" column="id"/>
<result property="goodsName" column="goods_name"/>
<result property="shelfStatus" column="shelf_status"/>
<result property="mainImg" column="mainImg"/>
<result property="goodsDesc" column="goods_desc"/>
<result property="masterTypeId" column="master_type_id"/>
<result property="slaveTypeId" column="slave_type_id"/>
<result property="goodsAttr" column="goods_attr"/>
<result property="ecoLabel" column="eco_label"/>
<result property="showCode" column="is_show_code"/>
<result property="sort" column="sort"/>
<result property="tag" column="tag"/>
</resultMap>
<select id="listGoodsByQO" resultMap="resultMapAppGoodsInfo" parameterType="com.mmc.pms.model.qo.GoodsInfoQO">
SELECT
gi.id,
gi.goods_name,
gi.shelf_status,
gi.create_time,
gi.sort_type_id,
gi.district_id,
gi.brand_id,
gi.parts_id,
gi.mode_id,
gi.quality_id,
img.img_url,
gt.type_name AS master_type_name,
gty.type_name AS slave_type_name,
st.sort_name
FROM
goods_info gi
LEFT JOIN goods_img img ON gi.id = img.goods_info_id
AND img.img_type = 0
AND img.is_deleted = 0
LEFT JOIN goods_type gt ON gt.id = gi.master_type_id
LEFT JOIN goods_type gty ON gty.id = gi.slave_type_id
LEFT JOIN sort_type st ON st.id = gi.sort_type_id
<where>
gi.is_deleted = 0
<if test="districtId != null">
and (gi.district_id = #{districtId})
</if>
<if test="brandId != null">
and (gi.brand_id = #{brandId})
</if>
<if test="partsId != null">
and (gi.parts_id = #{partsId})
</if>
<if test="modelId != null">
and (gi.mode_id = #{modelId})
</if>
<if test="qualityId != null">
and (gi.quality_id = #{qualityId})
</if>
<if test="productCategoryId != null">
and (gi.sort_type_id = #{productCategoryId})
</if>
</where>
ORDER BY
gi.shelf_status DESC , gi.create_time DESC
limit #{pageNo},#{pageSize}
</select>
<select id="listIndustryIdBySort" resultType="com.mmc.pms.entity.GoodsTypeDO">
SELECT id
FROM goods_type
WHERE is_deleted = 0
AND sort_type_id = 2
AND pid = 0
ORDER BY sort ASC
</select>
<select id="getIndustryProductInventory" resultType="com.mmc.pms.service.Impl.IndustryProductInventoryDO">
SELECT id,
industry_spec_id industrySpecId,
product_sku_id productSkuId,
is_selected selected
FROM industry_product_inventory
WHERE industry_spec_id = #{id}
AND is_deleted = 0
</select>
<select id="listInventorySpec" resultType="com.mmc.pms.entity.InventorySpecDO">
select id, industry_product_inventory_id industryProductInventoryId, product_spec_id productSpecId
from inventory_spec
where industry_product_inventory_id in (
<foreach collection="list" separator="," index="index" item="d">
#{d}
</foreach>)
</select>
<select id="getProductSpecDetail" resultType="com.mmc.pms.entity.ProductSpecDO">
select id,
product_sku_id productSkuId,
spec_name specName,
spec_image specImage,
part_no partNo,
version_desc versionDesc,
create_time createTime
from product_spec
where id = #{id}
</select>
<select id="getProductSkuDetail" resultType="com.mmc.pms.entity.ProductSkuDO">
SELECT ps.id,
ps.product_name productName,
ps.model,
ps.create_time createTime,
gt.id goodsTypeId,
gt.type_name typeName,
bi.brand_name productBrand,
ps.sort_type_id sortTypeId,
st.sort_name sortName
FROM product_sku ps
INNER JOIN goods_type gt ON ps.goods_type_id = gt.id
LEFT JOIN brand_info bi ON bi.id = ps.brand_info_id
LEFT JOIN sort_type st ON ps.goods_type_id = st.id
WHERE ps.id = #{id}
</select>
</mapper>
......@@ -17,6 +17,43 @@
<result property="pid" column="childPid"/>
</collection>
</resultMap>
<resultMap type="com.mmc.pms.entity.WareInfoDO"
id="wareInfoResultMap">
<id property="id" column="id"/>
<result property="wareNo" column="ware_no"/>
<result property="wareTitle" column="ware_title"/>
<result property="wareTypeId" column="ware_type_id"/>
<result property="wareStatus" column="ware_status"/>
<result property="payStatus" column="pay_status"/>
<result property="minDeposit" column="min_deposit"/>
<result property="maxDeposit" column="max_deposit"/>
<result property="minRent" column="min_rent"/>
<result property="maxRent" column="max_rent"/>
<result property="totalStock" column="total_stock"/>
<result property="totalSale" column="total_sale"/>
<result property="skuNum" column="sku_num"/>
<result property="tags" column="tags"/>
<result property="deleted" column="is_deleted"/>
<result property="updateTime" column="update_time"/>
<result property="createTime" column="create_time"/>
<association property="warePropDO"
javaType="com.mmc.pms.entity.WarePropDO">
<id property="id" column="ware_prop_id"/>
<result property="wareInfoId" column="ware_info_id"/>
<result property="propInfoId" column="prop_info_id"/>
<result property="propPoster" column="prop_poster"/>
</association>
<collection property="wareImgs" javaType="java.util.List"
ofType="com.mmc.pms.entity.WareImgDO">
<id property="id" column="ware_img_id"/>
<result property="wareInfoId" column="ware_info_id"/>
<result property="imgUrl" column="img_url"/>
<result property="imgType" column="img_type"/>
</collection>
</resultMap>
<select id="listSecondDistrict" resultMap="secondDistrict">
select p1.id,
p1.`name`,
......@@ -90,24 +127,67 @@
from inventory
</select>
<select id="detail" resultType="com.mmc.pms.entity.DeviceListDO">
SELECT d.id,
d.`name` AS deviceName,
d.image_url AS imageUrl,
d.price,
b.`name` AS brandName,
sd.`name` AS sysDistrictName,
m.`name` AS modelName,
dc.`name` AS deviceCategoryName,
i.residue_count AS residueCount,
i.id as inventoryId,
d.appraise
FROM device d
LEFT JOIN brand b ON d.brand_id = b.id
LEFT JOIN sys_district sd ON d.sys_district_id = sd.id
LEFT JOIN model m ON m.id = d.model_id
LEFT JOIN device_category dc ON dc.id = d.device_category_id
LEFT JOIN inventory i ON i.id = d.inventory_id
WHERE d.id = #{id}
<select id="detail" resultMap="wareInfoResultMap">
select
wi.id,wi.ware_no,wi.ware_type_id,wi.ware_title,wi.ware_status,wi.pay_status,wi.min_deposit,wi.max_deposit,wi.min_rent,
wi.max_rent,wi.total_stock,wi.total_sale,wi.sku_num,wi.tags,wi.district_id,
wi.brand_id,
wi.model_id,wi.create_time,wi.update_time,img.id as
ware_img_id,img.ware_info_id,img.img_url,img.img_type,wp.prop_info_id
from ware_info wi INNER JOIN ware_img img ON wi.id=img.ware_info_id LEFT JOIN ware_prop wp on
wi.id=wp.ware_info_id
where wi.is_deleted = 0 and img.img_type = 0
<if test="id != null ">
and wi.id = #{id}
</if>
order by wi.create_time DESC
</select>
<select id="countListWareInfoPage" parameterType="com.mmc.pms.model.qo.WareInfoQO" resultType="int">
select count(*)
from ware_info wi INNER JOIN ware_img img ON wi.id=img.ware_info_id LEFT JOIN ware_prop wp on
wi.id=wp.ware_info_id
where wi.is_deleted = 0 and img.img_type = 0
<if test="districtId != null ">
and wi.district_id = #{districtId}
</if>
<if test="categoryId != null ">
and wi.ware_type_id = #{categoryId}
</if>
<if test="brandId != null ">
and wi.brand_id = #{brandId}
</if>
<if test="modelId != null and modelId != '' ">
and wi.model_id = #{modelId}
</if>
</select>
<select id="listWareInfoPage" parameterType="com.mmc.pms.model.qo.WareInfoQO" resultMap="wareInfoResultMap">
select
wi.id,wi.ware_no,wi.ware_type_id,wi.ware_title,wi.ware_status,wi.pay_status,wi.min_deposit,wi.max_deposit,wi.min_rent,
wi.max_rent,wi.total_stock,wi.total_sale,wi.sku_num,wi.tags,wi.district_id,
wi.brand_id,
wi.model_id,wi.create_time,wi.update_time,img.id as
ware_img_id,img.ware_info_id,img.img_url,img.img_type,wp.prop_info_id
from ware_info wi INNER JOIN ware_img img ON wi.id=img.ware_info_id LEFT JOIN ware_prop wp on
wi.id=wp.ware_info_id
where wi.is_deleted = 0 and img.img_type = 0
<if test="id != null ">
and wi.id = #{id}
</if>
<if test="districtId != null ">
and wi.district_id = #{districtId}
</if>
<if test="categoryId != null ">
and wi.ware_type_id = #{categoryId}
</if>
<if test="brandId != null ">
and wi.brand_id = #{brandId}
</if>
<if test="modelId != null and modelId != '' ">
and wi.model_id = #{modelId}
</if>
order by wi.create_time DESC
limit #{pageNo},#{pageSize}
</select>
</mapper>
......@@ -3,7 +3,22 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mmc.pms.dao.WebProductMallDao">
<resultMap id="resultMapGoodsInfo" type="com.mmc.pms.entity.GoodsInfoDO">
<id property="id" column="id"/>
<result property="goodsName" column="goods_name"/>
<result property="createTime" column="create_time"/>
<result property="shelfStatus" column="shelf_status"/>
<result property="masterTypeId" column="master_type_id"/>
<result property="slaveTypeId" column="slave_type_id"/>
<result property="sortTypeId" column="sort_type_id"/>
<result property="mainImg" column="img_url"/>
<result property="pid" column="pid"/>
<result property="goodsNo" column="goods_no"/>
<result property="sort" column="sort"/>
<result property="directoryName" column="sort_name"/>
<association property="goodsMasterType" resultMap="resultMasterType"/>
<association property="goodsSlaveType" resultMap="resultSlaveType"/>
</resultMap>
<select id="productCategory" resultType="com.mmc.pms.entity.ProductCategory">
select id, `name`
......@@ -17,4 +32,145 @@
select id, `name`
from product_quality;
</select>
<select id="countListGoodsInfo" resultType="java.lang.Integer">
SELECT
count(*)
FROM
goods_info gi
LEFT JOIN goods_img img ON gi.id = img.goods_info_id
AND img.img_type = 0
AND img.is_deleted = 0
LEFT JOIN goods_type gt ON gt.id = gi.master_type_id
LEFT JOIN goods_type gty ON gty.id = gi.slave_type_id
<where>
gi.is_deleted = 0
<if test="districtId != null">
and (gi.district_id = #{districtId})
</if>
<if test="brandId != null">
and (gi.brand_id = #{brandId})
</if>
<if test="partsId != null">
and (gi.parts_id = #{partsId})
</if>
<if test="modelId != null">
and (gi.mode_id = #{modelId})
</if>
<if test="qualityId != null">
and (gi.quality_id = #{qualityId})
</if>
<if test="productCategoryId != null">
and (gi.sort_type_id = #{productCategoryId})
</if>
</where>
</select>
<select id="listGoodsInfo" resultMap="resultMapGoodsInfo">
SELECT
gi.id,
gi.goods_name,
gi.shelf_status,
gi.create_time,
gi.sort_type_id,
gi.district_id,
gi.brand_id,
gi.parts_id,
gi.mode_id,
gi.quality_id,
img.img_url,
gt.type_name AS master_type_name,
gty.type_name AS slave_type_name,
st.sort_name
FROM
goods_info gi
LEFT JOIN goods_img img ON gi.id = img.goods_info_id
AND img.img_type = 0
AND img.is_deleted = 0
LEFT JOIN goods_type gt ON gt.id = gi.master_type_id
LEFT JOIN goods_type gty ON gty.id = gi.slave_type_id
LEFT JOIN sort_type st ON st.id = gi.sort_type_id
<where>
gi.is_deleted = 0
<if test="districtId != null">
and (gi.district_id = #{districtId})
</if>
<if test="brandId != null">
and (gi.brand_id = #{brandId})
</if>
<if test="partsId != null">
and (gi.parts_id = #{partsId})
</if>
<if test="modelId != null">
and (gi.mode_id = #{modelId})
</if>
<if test="qualityId != null">
and (gi.quality_id = #{qualityId})
</if>
<if test="productCategoryId != null">
and (gi.sort_type_id = #{productCategoryId})
</if>
</where>
ORDER BY
gi.shelf_status DESC , gi.create_time DESC
limit #{pageNo},#{pageSize}
</select>
<resultMap id="resultMasterType" type="com.mmc.pms.entity.GoodsTypeDO">
<id property="id" column="id"/>
<result property="typeName" column="master_type_name"/>
<result property="icon" column="icon"/>
<result property="pid" column="pid"/>
<result property="sort" column="sort"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="description" column="description"/>
</resultMap>
<resultMap id="resultSlaveType" type="com.mmc.pms.entity.GoodsTypeDO">
<id property="id" column="id"/>
<result property="typeName" column="slave_type_name"/>
<result property="icon" column="icon"/>
<result property="pid" column="pid"/>
<result property="sort" column="sort"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="description" column="description"/>
</resultMap>
<select id="listGoodsTypeByTwoLevel" resultMap="resultSlaveType">
SELECT gty.type_name as slave_type_name,
gty.id,
gty.pid,
gty.description
FROM goods_type gt
INNER JOIN goods_type gty ON gt.id = gty.pid
WHERE gty.is_deleted = 0
</select>
<select id="listGoodsTypeByTwoLevelList" resultMap="resultSlaveType">
SELECT gty.type_name AS slave_type_name,
gty.id,
gty.pid,
gty.description,
gty.remark,
gty.sort,
gty.create_time
FROM goods_type gt
INNER JOIN goods_type gty ON gt.id = gty.pid
WHERE gty.is_deleted = 0
AND gty.sort_type_id = #{type}
</select>
<select id="findProduct" resultType="java.lang.Integer">
SELECT count(1)
FROM goods_info gi
INNER JOIN mall_prod_sku_info mpsi ON mpsi.goods_info_id = gi.id
INNER JOIN product_sku ps ON mpsi.prod_sku_id = ps.id
AND ps.is_deleted = 0
INNER JOIN brand_info bi ON ps.brand_info_id = bi.id
AND bi.is_delete = 0
WHERE gi.is_deleted = 0
AND gi.id = #{id}
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论