Эх сурвалжийг харах

商品、运需、求购详情返回商品类型一二三级label

yzc 2 жил өмнө
parent
commit
6bd3b86723

+ 4 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/constant/Global.java

@@ -136,6 +136,10 @@ public class Global {
 
     /**逗号-中文*/
     public static final String COMMA1 = ",";
+    /**
+     * 右斜杠
+     */
+    public static final String RIGHT_SLASH = "/";
 
     /**点*/
     public static final String DOT = ".";

+ 5 - 0
sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/model/GoodsDetail.java

@@ -75,6 +75,11 @@ public class GoodsDetail implements Serializable {
      */
     private String goodsTypeLabel;
 
+    /**
+     * 商品类型labs
+     */
+    private String goodsTypeLabels;
+
     /**
      * 库存数量
      */

+ 5 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/TransportDemandDetailRes.java

@@ -48,6 +48,11 @@ public class TransportDemandDetailRes implements Serializable {
      */
     private String goodsTypeLabel;
 
+    /**
+     * 商品类型labs
+     */
+    private String goodsTypeLabels;
+
     /**
      * 商品规格
      */

+ 6 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/WantBuyDetailRes.java

@@ -50,6 +50,12 @@ public class WantBuyDetailRes implements Serializable {
      * 商品类型label
      */
     private String goodsTypeLabel;
+
+    /**
+     * 商品类型labs
+     */
+    private String goodsTypeLabels;
+
     /**
      * 商品规格
      */

+ 2 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java

@@ -113,7 +113,8 @@ public class KwoTransportDemandService {
         TransportDemandDetailRes res = BeanUtils.copyProperties(transportDemand, TransportDemandDetailRes.class);
         List<SysDictResDto> types = remoteSystemService.queryDictFrontAll(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), res.getGoodsType());
         if (CollectionUtils.isNotEmpty(types)) {
-            res.setGoodsTypes(types.stream().map(SysDictResDto::getValue).toList());
+            res.setGoodsTypes(types.stream().map(SysDictResDto::getValue).toList())
+                    .setGoodsTypeLabels(String.join(Global.RIGHT_SLASH, types.stream().map(SysDictResDto::getLabel).toList()));
         }
         res.setGoodsTypeLabel(productNameMap.get(res.getGoodsType()))
                 .setTradingLabel(tradeMap.get(res.getTrading()))

+ 2 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwpWantBuyService.java

@@ -378,7 +378,8 @@ public class KwpWantBuyService {
         }
         List<SysDictResDto> types = remoteSystemService.queryDictFrontAll(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), responseData.getGoodsType());
         if (CollectionUtils.isNotEmpty(types)) {
-            responseData.setGoodsTypes(types.stream().map(SysDictResDto::getValue).toList());
+            responseData.setGoodsTypes(types.stream().map(SysDictResDto::getValue).toList())
+                    .setGoodsTypeLabels(String.join(Global.RIGHT_SLASH, types.stream().map(SysDictResDto::getLabel).toList()));
         }
         responseData.setGoodsTypeLabel(productNameMap.get(responseData.getGoodsType()))
                 .setStatusLabel(wantBuyStatusMap.get(String.valueOf(responseData.getStatus())));

+ 5 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/GoodsDetail.java

@@ -86,6 +86,11 @@ public class GoodsDetail {
      */
     private String goodsTypeLabel;
 
+    /**
+     * 商品类型labs
+     */
+    private String goodsTypeLabels;
+
     /**
      * 库存数量
      */

+ 5 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/OperationGoodsDetail.java

@@ -91,6 +91,11 @@ public class OperationGoodsDetail implements Serializable {
      */
     private String goodsTypeLabel;
 
+    /**
+     * 商品类型labs
+     */
+    private String goodsTypeLabels;
+
     /**
      * 库存数量
      */

+ 2 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java

@@ -268,7 +268,8 @@ public class KwpGoodsService {
         }
         List<SysDictResDto> types = remoteSystemService.queryDictFrontAll(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), detail.getGoodsType());
         if (CollectionUtils.isNotEmpty(types)) {
-            detail.setGoodsTypes(types.stream().map(SysDictResDto::getValue).toList());
+            detail.setGoodsTypes(types.stream().map(SysDictResDto::getValue).toList())
+                    .setGoodsTypeLabels(String.join(Global.RIGHT_SLASH, types.stream().map(SysDictResDto::getLabel).toList()));
         }
         detail.setGoodsTypeLabel(CollectionUtils.isNotEmpty(productNameMap) ? productNameMap.get(detail.getGoodsType()) : null)
                 .setUnitLabel(CollectionUtils.isNotEmpty(unitMap) ? unitMap.get(detail.getUnit()) : null)