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

Merge branch 'develop'

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