提交 d08bc763 作者: 刘明祎-运维用途

Merge branch 'develop'

流水线 #8847 已通过 于阶段
in 2 分 31 秒
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag: b7fe2c5728b606167daee21c67c452fea7aca1f8
newTag: f0a64b8bb399c8732fd24c1725cbfe50366fb6aa
package com.mmc.pms.controller.mall;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class GambitIdsVO {
private List<Integer> gambitId;
}
......@@ -35,6 +35,7 @@ public class MallGoodsController extends BaseController {
@GetMapping("mallGoodsDetails")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsVO.class)})
public ResultBody<MallGoodsVO> mallGoodsDetails(@RequestParam Integer id) {
System.out.println(id);
return mallGoodsService.mallGoodsDetails(id);
}
......@@ -88,4 +89,12 @@ public class MallGoodsController extends BaseController {
public ResultBody feignRemoveGoodsByUserAccountId(@RequestParam(value = "id") Integer id, @RequestParam(value = "companyInfoId") Integer companyInfoId) {
return mallGoodsService.feignRemoveGoodsByBackUserAccountId(id, companyInfoId);
}
@ApiOperation(value = "根据话题id查询商城商品详情列表")
@PostMapping("GoodsInfoByGambitId")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsVO.class)})
public ResultBody<MallGoodsVO> goodsInfoByGambitIds(@RequestBody GambitIdsVO gambitIds) {
return mallGoodsService.goodsInfoByGambitId(gambitIds);
}
}
......@@ -68,4 +68,6 @@ public interface MallGoodsDao {
int getMallGoodsCount();
List<MallGoodsDO> recommendMallGoods();
MallGoodsDO getMallGoodsInfoByGambitId(Integer gambitId);
}
......@@ -3,6 +3,7 @@ package com.mmc.pms.entity.mall;
import com.mmc.pms.model.mall.GoodsResourcesVO;
import com.mmc.pms.model.mall.MallGoodsVO;
import com.mmc.pms.model.mall.UavCartDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -93,6 +94,11 @@ public class MallGoodsDO implements Serializable {
private List<PriceStockDO> priceStockDOS;
/**
* 关联话题id
*/
private Integer gambitId;
public MallGoodsDO(MallGoodsVO mallGoodsVO) {
this.id = mallGoodsVO.getId();
this.tradeName = mallGoodsVO.getTradeName();
......@@ -105,12 +111,13 @@ public class MallGoodsDO implements Serializable {
this.priceShow = mallGoodsVO.getPriceShow();
this.recommend = mallGoodsVO.getRecommend() == null ? 0 : mallGoodsVO.getRecommend();
this.goodsDetails = mallGoodsVO.getGoodsDetails();
this.gambitId = mallGoodsVO.getGambitId();
}
public MallGoodsVO buildMallGoodsVO() {
return MallGoodsVO.builder().id(id).userAccountId(userAccountId).tradeName(tradeName)
.description(description).categoryPrimaryId(categoryPrimaryId).categorySubId(categorySubId)
.shelfStatus(shelfStatus).priceShow(priceShow).goodsLabel(goodsLabel).labelShow(labelShow)
.shelfStatus(shelfStatus).priceShow(priceShow).goodsLabel(goodsLabel).labelShow(labelShow).gambitId(gambitId)
.createTime(createTime).goodsDetails(goodsDetails).recommend(recommend).build();
}
......
......@@ -84,4 +84,7 @@ public class MallGoodsVO implements Serializable {
@ApiModelProperty(value = "单位名称")
private String companyName;
@ApiModelProperty(value = "关联话题id")
private Integer gambitId;
}
......@@ -2,6 +2,7 @@ package com.mmc.pms.service.mall;
import com.mmc.pms.auth.dto.LoginSuccessDTO;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.controller.mall.GambitIdsVO;
import com.mmc.pms.model.lease.vo.LeaseGoodsVO;
import com.mmc.pms.model.lease.vo.LeasePriceStockVO;
import com.mmc.pms.model.mall.MallGoodsVO;
......@@ -44,4 +45,6 @@ public interface MallGoodsService {
void updateSpecInfo(MallGoodsVO mallGoodsVO, LeaseGoodsVO leaseGoodsVO);
PageResult listMallGoodsBySearch(MallGoodsInfoQO param, LoginSuccessDTO userLoginInfoFromRedis);
ResultBody<MallGoodsVO> goodsInfoByGambitId(GambitIdsVO gambitId);
}
......@@ -4,6 +4,7 @@ import com.mmc.pms.auth.dto.CompanyInfoVO;
import com.mmc.pms.auth.dto.LoginSuccessDTO;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.controller.mall.GambitIdsVO;
import com.mmc.pms.dao.lease.LeaseGoodsDao;
import com.mmc.pms.dao.mall.MallGoodsDao;
import com.mmc.pms.entity.lease.LeasePriceStockDO;
......@@ -30,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -202,6 +204,8 @@ public class MallGoodsServiceImpl implements MallGoodsService {
}
@Override
@Transactional(rollbackFor = Exception.class)
public ResultBody editMallGoods(MallGoodsVO mallGoodsVO, Integer userAccountId) {
......@@ -294,6 +298,24 @@ public class MallGoodsServiceImpl implements MallGoodsService {
return pageResult;
}
@Override
public ResultBody<MallGoodsVO> goodsInfoByGambitId(GambitIdsVO gambitIds) {
List<MallGoodsVO> mallGoodsList = new ArrayList<>();
List<Integer> id = gambitIds.getGambitId();
for (Integer gambitId : id) {
MallGoodsDO mallGoodsDO = mallGoodsDao.getMallGoodsInfoByGambitId(gambitId);
if (mallGoodsDO != null) {
MallGoodsVO mallGoodsVO = mallGoodsDO.buildMallGoodsVO();
// 获取图片及其他资源信息
List<MallGoodsResourcesDO> mallGoodsResourcesList = mallGoodsDao.getMallGoodsResources(mallGoodsVO.getId());
mallGoodsVO.setResourcesList(mallGoodsResourcesList.stream()
.map(MallGoodsResourcesDO::buildGoodsResourcesVO).collect(Collectors.toList()));
mallGoodsList.add(mallGoodsVO);
}
}
return ResultBody.success(mallGoodsList);
}
/**
* 添加新规格值
*
......
......@@ -17,10 +17,11 @@
user_account_id,
recommend,
price_show,
sort)
sort,
gambit_id)
values ( #{goodsNo}, #{tradeName}, #{description}, #{categoryPrimaryId}, #{categorySubId}
, #{shelfStatus}, #{goodsLabel}, #{labelShow}, #{goodsDetails}
, #{userAccountId}, #{recommend}, #{priceShow}, #{sort})
, #{userAccountId}, #{recommend}, #{priceShow}, #{sort}, #{gambitId})
</insert>
<insert id="batchInsertMallGoodsResources">
......@@ -72,7 +73,8 @@
label_show = #{mallGoodsDO.labelShow},
goods_details = #{mallGoodsDO.goodsDetails},
price_show = #{mallGoodsDO.priceShow},
recommend = #{mallGoodsDO.recommend}
recommend = #{mallGoodsDO.recommend},
gambit_id = #{mallGoodsDO.gambitId}
WHERE id = #{mallGoodsDO.id}
</update>
<update id="updateMallGoodsSort">
......@@ -163,6 +165,7 @@
price_show,
recommend,
sort,
gambit_id,
create_time
FROM mall_goods
WHERE id = #{id}
......@@ -325,4 +328,27 @@
where mg.is_deleted = 0
and mg.recommend = 1
</select>
<select id="getMallGoodsInfoByGambitId" resultType="com.mmc.pms.entity.mall.MallGoodsDO">
SELECT id,
goods_no,
trade_name,
description,
category_primary_id,
category_sub_id,
shelf_status,
goods_label,
label_show,
goods_details,
user_account_id,
price_show,
recommend,
sort,
gambit_id,
create_time
FROM mall_goods
WHERE gambit_id = #{gambitId}
and is_deleted = 0
</select>
</mapper>
......@@ -43,3 +43,5 @@ data-filter:
- /pms/app/lease/leaseGoodsList
- /pms/lease/goods/getLeaseTermInfo
- /pms/app/goods/brandStoreList
- /pms/mall/goods/mallGoodsDetails
- /pms/app/goods/appMallGoodsDetails
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论