提交 79682236 作者: xiaowang

编辑修复

上级 52b01c3e
...@@ -48,8 +48,12 @@ public class BackstageGoodsManageController { ...@@ -48,8 +48,12 @@ public class BackstageGoodsManageController {
@ApiOperation(value = "PC端-商品详情") @ApiOperation(value = "PC端-商品详情")
@GetMapping("getGoodsInfoDetail") @GetMapping("getGoodsInfoDetail")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsDetailDTO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsDetailDTO.class)})
public ResultBody getGoodsInfoDetail(@ApiParam("商品id") @RequestParam Integer goodsInfoId) { public ResultBody getGoodsInfoDetail(
return goodsInfoService.getGoodsInfoDetail(goodsInfoId); @ApiParam("商品id") @RequestParam Integer goodsInfoId,
@RequestParam Integer type,
@RequestParam(required = false) @ApiParam("租赁时限:(输入0:1-7天、输入1:8-15天、输入2:16-30天、输入3:30天以上)")
Integer leaseTerm) {
return goodsInfoService.getGoodsInfoDetail(goodsInfoId, type, leaseTerm);
} }
@ApiOperation(value = "商品列表-分页") @ApiOperation(value = "商品列表-分页")
......
...@@ -43,12 +43,12 @@ public class ProductMallController extends BaseController { ...@@ -43,12 +43,12 @@ public class ProductMallController extends BaseController {
@ApiOperation(value = "设备设备详情") @ApiOperation(value = "设备设备详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsDetailDTO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsDetailDTO.class)})
@GetMapping("/getLeaseGoodsDetail") @GetMapping("/getLeaseGoodsDetail")
public ResultBody<MallGoodsDetailDTO> listLeaseGoodsDetail( public ResultBody<MallGoodsDetailDTO> getLeaseGoodsDetail(
Integer goodsId, HttpServletRequest request) { Integer goodsId, HttpServletRequest request) {
if (request.getHeader(TokenConstant.TOKEN) == null) { if (request.getHeader(TokenConstant.TOKEN) == null) {
return webDeviceService.listLeaseGoodsDetail(goodsId, null, null); return webDeviceService.getLeaseGoodsDetail(goodsId, null, null);
} }
return webDeviceService.listLeaseGoodsDetail( return webDeviceService.getLeaseGoodsDetail(
goodsId, this.getUserLoginInfoFromRedis(request).getUserAccountId(), request); goodsId, this.getUserLoginInfoFromRedis(request).getUserAccountId(), request);
} }
} }
...@@ -5,6 +5,8 @@ import com.mmc.pms.model.categories.vo.DirectoryInfoVO; ...@@ -5,6 +5,8 @@ import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
...@@ -19,52 +21,41 @@ import java.util.Date; ...@@ -19,52 +21,41 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class DirectoryDO implements Serializable { public class DirectoryDO implements Serializable {
private static final long serialVersionUID = 713939370607409336L; private static final long serialVersionUID = 713939370607409336L;
/** /** 主键id */
* 主键id private Integer id;
*/ /** 目录名称 */
private Integer id; private String directoryName;
/** /** 其他目录关联id */
* 目录名称 private Integer pid;
*/ /** 类型:(0:通用目录 1:作业服务目录 2:设备目录 3:飞手目录 4:商城目录) */
private String directoryName; private Integer type;
/** /** 创建时间 */
* 其他目录关联id private Date createTime;
*/ /** 修改时间 */
private Integer pid; private Date updateTime;
/** /** 是否删除 */
* 类型:(0:通用目录 1:作业服务目录 2:设备目录 3:飞手目录 4:商城目录) private Integer deleted;
*/
private Integer type; private String show;
/**
* 创建时间 private String relevanceName;
*/
private Date createTime; public DirectoryDO(DirectoryInfoVO param) {
/** if (CollectionUtils.isNotEmpty(param.getShow())) {
* 修改时间 String show = StringUtils.join(param.getShow(), ",");
*/ this.show = show;
private Date updateTime;
/**
* 是否删除
*/
private Integer deleted;
private String relevanceName;
public DirectoryDO(DirectoryInfoVO param) {
this.id = param.getId();
this.directoryName = param.getDirectoryName();
this.pid = param.getPid();
this.type = param.getType();
}
public DirectoryInfoVO buildDirectoryInfoVO() {
return DirectoryInfoVO.builder().id(id).directoryName(directoryName).pid(pid).relevanceName(relevanceName).type(type).build();
} }
this.id = param.getId();
public AllCategoryDTO buildAllCategoryDTO() { this.directoryName = param.getDirectoryName();
return AllCategoryDTO.builder().directoryId(id).name(directoryName).build(); this.type = param.getType();
} }
public DirectoryInfoVO buildDirectoryInfoVO() {
return DirectoryInfoVO.builder().id(id).directoryName(directoryName).type(type).build();
}
public AllCategoryDTO buildAllCategoryDTO() {
return AllCategoryDTO.builder().directoryId(id).name(directoryName).build();
}
} }
...@@ -6,25 +6,27 @@ import lombok.Builder; ...@@ -6,25 +6,27 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.List;
/** /**
* @Author LW * @Author LW
* @date 2023/5/24 11:06 *
* 概要: * @date 2023/5/24 11:06 概要:
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class DirectoryInfoVO { public class DirectoryInfoVO {
@ApiModelProperty(value = "目录id") @ApiModelProperty(value = "目录id")
private Integer id; private Integer id;
@ApiModelProperty(value = "目录名称")
private String directoryName; @ApiModelProperty(value = "目录名称")
@ApiModelProperty(value = "关联目录的id") private String directoryName;
private Integer pid;
@ApiModelProperty(value = "关联目录名称") @ApiModelProperty(value = "分类模块:(0:通用分类 1:作业服务分类 2:设备分类 3:飞手分类 4:商城分类)")
private String relevanceName; private Integer type;
@ApiModelProperty(value = "分类模块:(0:通用分类 1:作业服务分类 2:设备分类 3:飞手分类 4:商城分类)")
private Integer type; @ApiModelProperty(value = "显示:1:作业服务分类 2:设备分类 3:飞手分类 4:商城分类")
private List<Integer> show;
} }
...@@ -37,6 +37,9 @@ public class MallGoodsDetailDTO implements Serializable { ...@@ -37,6 +37,9 @@ public class MallGoodsDetailDTO implements Serializable {
@ApiModelProperty(value = "商品名称") @ApiModelProperty(value = "商品名称")
private String goodsName; private String goodsName;
@ApiModelProperty(value = "商品编号")
private String goodsNo;
@ApiModelProperty(value = "商品详情") @ApiModelProperty(value = "商品详情")
private GoodsDetailInfoDTO goodsDetail; private GoodsDetailInfoDTO goodsDetail;
......
...@@ -25,7 +25,7 @@ public interface GoodsInfoService { ...@@ -25,7 +25,7 @@ public interface GoodsInfoService {
ResultBody editGoodsInfo(GoodsAddVO goodsAddVO); ResultBody editGoodsInfo(GoodsAddVO goodsAddVO);
ResultBody getGoodsInfoDetail(Integer goodsInfoId); ResultBody getGoodsInfoDetail(Integer goodsInfoId, Integer type, Integer leaseTerm);
ResultBody getSkuUnit(); ResultBody getSkuUnit();
......
...@@ -638,7 +638,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -638,7 +638,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
} }
@Override @Override
public ResultBody getGoodsInfoDetail(Integer goodsInfoId) { public ResultBody getGoodsInfoDetail(Integer goodsInfoId, Integer type, Integer leaseTerm) {
// 判断此商品是否还存在 // 判断此商品是否还存在
int count = goodsInfoDao.countGoodsInfoById(goodsInfoId); int count = goodsInfoDao.countGoodsInfoById(goodsInfoId);
if (count <= 0) { if (count <= 0) {
...@@ -650,6 +650,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -650,6 +650,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
GoodsInfo goodsInfo = goodsInfoDao.getGoodsSimpleInfo(goodsInfoId); GoodsInfo goodsInfo = goodsInfoDao.getGoodsSimpleInfo(goodsInfoId);
mallGoodsDetail mallGoodsDetail
.setId(goodsInfo.getId()) .setId(goodsInfo.getId())
.setGoodsNo(goodsInfo.getGoodsNo())
.setGoodsName(goodsInfo.getGoodsName()) .setGoodsName(goodsInfo.getGoodsName())
.setCategoryByOne(goodsInfo.getCategoryByOne()) .setCategoryByOne(goodsInfo.getCategoryByOne())
.setGoodsVideo(goodsInfo.getVideoUrl()) .setGoodsVideo(goodsInfo.getVideoUrl())
...@@ -667,7 +668,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -667,7 +668,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
// 获取规格信息 // 获取规格信息
if (!goodsInfo.getDirectoryId().equals(2)) { if (!goodsInfo.getDirectoryId().equals(2)) {
// 获取产品规格信息 // 获取产品规格信息
mallGoodsDetail.setGoodsSpec(getProductSpecInfo(goodsInfoId)); mallGoodsDetail.setGoodsSpec(getProductSpecInfo(goodsInfoId, type, leaseTerm));
} else { } else {
// 获取行业规格信息 // 获取行业规格信息
mallGoodsDetail.setGoodsSpec(getIndustrySpecInfo(goodsInfoId)); mallGoodsDetail.setGoodsSpec(getIndustrySpecInfo(goodsInfoId));
...@@ -708,7 +709,8 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -708,7 +709,8 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
return list; return list;
} }
private List<GoodsSpecDTO> getProductSpecInfo(Integer goodsInfoId) { private List<GoodsSpecDTO> getProductSpecInfo(
Integer goodsInfoId, Integer type, Integer leaseTerm) {
// 获取商品对应绑定sku的信息 // 获取商品对应绑定sku的信息
List<MallProdInfoDO> mallProdSkuInfoList = goodsInfoDao.getMallProSkuInfo(goodsInfoId); List<MallProdInfoDO> mallProdSkuInfoList = goodsInfoDao.getMallProSkuInfo(goodsInfoId);
List<GoodsSpecDTO> list = List<GoodsSpecDTO> list =
...@@ -736,6 +738,8 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -736,6 +738,8 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
// 获取自定义sku下规格的价格配置信息 // 获取自定义sku下规格的价格配置信息
ProductSpecCPQVO productSpecCPQVO = new ProductSpecCPQVO(); ProductSpecCPQVO productSpecCPQVO = new ProductSpecCPQVO();
productSpecCPQVO.setProductSpecId(e.getProductSpecId()); productSpecCPQVO.setProductSpecId(e.getProductSpecId());
productSpecCPQVO.setType(type);
productSpecCPQVO.setLeaseTerm(leaseTerm);
List<ProductSpecPriceDO> productSpecPrice = List<ProductSpecPriceDO> productSpecPrice =
productDao.getProductSpecPrice(productSpecCPQVO); productDao.getProductSpecPrice(productSpecCPQVO);
List<SpecPriceVO> collect = List<SpecPriceVO> collect =
......
...@@ -212,14 +212,14 @@ public class WebDeviceServiceImpl implements WebDeviceService { ...@@ -212,14 +212,14 @@ public class WebDeviceServiceImpl implements WebDeviceService {
} }
@Override @Override
public ResultBody listLeaseGoodsDetail( public ResultBody getLeaseGoodsDetail(
Integer goodsInfoId, Integer userAccountId, HttpServletRequest request) { Integer goodsInfoId, Integer userAccountId, HttpServletRequest request) {
int count = goodsInfoDao.countGoodsInfoById(goodsInfoId); int count = goodsInfoDao.countGoodsInfoById(goodsInfoId);
if (count <= 0) { if (count <= 0) {
return ResultBody.error(ResultEnum.GOODS_NOT_EXIST_OR_ALREADY_DOWN_SHELF); return ResultBody.error(ResultEnum.GOODS_NOT_EXIST_OR_ALREADY_DOWN_SHELF);
} }
// 初始化商品返回信息的对象 // 初始化商品返回信息的对象
ResultBody goodsInfoDetail = goodsInfoService.getGoodsInfoDetail(goodsInfoId); ResultBody goodsInfoDetail = goodsInfoService.getGoodsInfoDetail(goodsInfoId, null, null);
MallGoodsDetailDTO result = (MallGoodsDetailDTO) goodsInfoDetail.getResult(); MallGoodsDetailDTO result = (MallGoodsDetailDTO) goodsInfoDetail.getResult();
if (userAccountId != null) { if (userAccountId != null) {
UserAccountSimpleDTO userAccountSimpleDTO = UserAccountSimpleDTO userAccountSimpleDTO =
......
...@@ -40,6 +40,6 @@ public interface WebDeviceService { ...@@ -40,6 +40,6 @@ public interface WebDeviceService {
List<SkuInfoDTO> listWareSkuById(Integer id); List<SkuInfoDTO> listWareSkuById(Integer id);
ResultBody listLeaseGoodsDetail( ResultBody getLeaseGoodsDetail(
Integer goodsId, Integer userAccountId, HttpServletRequest request); Integer goodsId, Integer userAccountId, HttpServletRequest request);
} }
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
</update> </update>
<update id="batchUpdateMallProSpec"> <update id="batchUpdateMallProSpec">
<foreach collection="list" separator=";" item="d"> <foreach collection="list" separator=";" item="d">
update mall_prod_sku_info_spec update mall_prod_info_spec
set is_deleted = 1 set is_deleted = 1
where mall_prod_info_id = #{d} where mall_prod_info_id = #{d}
and goods_info_id =#{id} and goods_info_id =#{id}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论