Преглед изворни кода

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

yzc пре 2 година
родитељ
комит
1e6e3bc803

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

@@ -65,6 +65,11 @@ public class GoodsDetail implements Serializable {
      */
     private String goodsType;
 
+    /**
+     * 商品类型集合
+     */
+    private List<String> goodsTypes;
+
     /**
      * 商品类型lab
      */

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

@@ -10,6 +10,7 @@ import java.io.Serial;
 import java.io.Serializable;
 import java.time.LocalDate;
 import java.util.Date;
+import java.util.List;
 
 /**
  * @desc: 运需详情响应
@@ -37,6 +38,11 @@ public class TransportDemandDetailRes implements Serializable {
      */
     private String goodsType;
 
+    /**
+     * 商品类型集合
+     */
+    private List<String> goodsTypes;
+
     /**
      * 商品分类Label
      */

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

@@ -40,6 +40,12 @@ public class WantBuyDetailRes implements Serializable {
      * 商品类型
      */
     private String goodsType;
+
+    /**
+     * 商品类型集合
+     */
+    private List<String> goodsTypes;
+
     /**
      * 商品类型label
      */

+ 4 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java

@@ -111,6 +111,10 @@ public class KwoTransportDemandService {
                     new HashMap<>() : dict.get(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType());
         }
         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.setGoodsTypeLabel(productNameMap.get(res.getGoodsType()))
                 .setTradingLabel(tradeMap.get(res.getTrading()))
                 .setStatusLabel(statusMap.get(String.valueOf(res.getStatus())));

+ 4 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwpWantBuyService.java

@@ -376,6 +376,10 @@ public class KwpWantBuyService {
             tradeMap = CollectionUtils.isEmpty(dict.get(DictTypeEnum.TRADE_TYPE.getType())) ?
                     new HashMap<>() : dict.get(DictTypeEnum.TRADE_TYPE.getType());
         }
+        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.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

@@ -76,6 +76,11 @@ public class GoodsDetail {
      */
     private String goodsType;
 
+    /**
+     * 商品类型集合
+     */
+    private List<String> goodsTypes;
+
     /**
      * 商品类型lab
      */

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

@@ -81,6 +81,11 @@ public class OperationGoodsDetail implements Serializable {
      */
     private String goodsType;
 
+    /**
+     * 商品类型集合
+     */
+    private List<String> goodsTypes;
+
     /**
      * 商品类型lab
      */

+ 4 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java

@@ -266,6 +266,10 @@ public class KwpGoodsService {
             goodsStatusMap = dict.get(DictTypeEnum.GOODS_STATUS.getType());
             addressMap = dict.get(DictTypeEnum.ADDRESS_TYPE.getType());
         }
+        List<SysDictResDto> types = remoteSystemService.queryDictFrontAll(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), detail.getGoodsType());
+        if (CollectionUtils.isNotEmpty(types)) {
+            detail.setGoodsTypes(types.stream().map(SysDictResDto::getType).toList());
+        }
         detail.setGoodsTypeLabel(CollectionUtils.isNotEmpty(productNameMap) ? productNameMap.get(detail.getGoodsType()) : null)
                 .setUnitLabel(CollectionUtils.isNotEmpty(unitMap) ? unitMap.get(detail.getUnit()) : null)
                 .setTaxRateLabel(CollectionUtils.isNotEmpty(taxRateMap) ? taxRateMap.get(detail.getTaxRate()) : null)