Browse Source

修改通道产品面额字段

杜魏 4 years ago
parent
commit
8ab779d53f

+ 3 - 3
common/fire-dto/src/main/java/com/fire/dto/ChannelProductInfo.java

@@ -37,11 +37,11 @@ public class ChannelProductInfo {
     @ApiModelProperty("流量包id")
     private String packageId;
 
-    @ApiModelProperty("标准价格")
-    private Long standardPrice;
+    @ApiModelProperty("面额")
+    private Long facePrice;
 
     @ApiModelProperty("结算价格")
-    private Integer price;
+    private Long price;
 
     @ApiModelProperty("备注")
     private String remark;

+ 1 - 0
modules/admin/src/main/java/com/fire/admin/service/impl/ChannelProductServiceImpl.java

@@ -37,6 +37,7 @@ public class ChannelProductServiceImpl extends ServiceImpl<ChannelProductMapper,
         if (ObjectUtil.isNotEmpty(channelProductInfos)) {
             boolean result = this.saveOrUpdateBatch(channelProductInfos);
             for (ChannelProductInfo info : channelProductInfos) {
+                info.setDiscount(Double.valueOf(info.getPrice() * 10000) / Double.valueOf(info.getFacePrice() * 10000));
                 if (info.getChannelProductId() == null) {
                     log.info("添加的通道产品是:【{}】", channelProductInfos);
                 } else {

+ 1 - 1
modules/distribution/src/main/java/com/fire/dist/service/impl/CacheServiceImpl.java

@@ -91,7 +91,7 @@ public class CacheServiceImpl implements CacheService {
 
         if (CollectionUtils.isNotEmpty(productInfos) && CollectionUtils.isNotEmpty(channelInfos) && CollectionUtils.isNotEmpty(distributeGroups) && CollectionUtils.isNotEmpty(channelGroups)) {
             //通道产品 根据 通道id第一层 区域第二层 面额分第三层 进行分组
-            Map<Long, Map<String, Map<Long, ChannelProductInfo>>> productListMap = productInfos.stream().filter(a -> a.getChannelId() != null && !StringUtils.isEmpty(a.getAreaNum()) && a.getStandardPrice() != null).collect(Collectors.groupingBy(ChannelProductInfo::getChannelId, Collectors.groupingBy(ChannelProductInfo::getAreaNum, Collectors.toMap(ChannelProductInfo::getStandardPrice, a -> a, (k1, k2) -> k2))));
+            Map<Long, Map<String, Map<Long, ChannelProductInfo>>> productListMap = productInfos.stream().filter(a -> a.getChannelId() != null && !StringUtils.isEmpty(a.getAreaNum()) && a.getFacePrice() != null).collect(Collectors.groupingBy(ChannelProductInfo::getChannelId, Collectors.groupingBy(ChannelProductInfo::getAreaNum, Collectors.toMap(ChannelProductInfo::getFacePrice, a -> a, (k1, k2) -> k2))));
             //将产品挂载到通道上面
             channelInfos.forEach(a -> a.setProductListMap(productListMap.get(a.getChannelId())));
             //通道按分发组id进行分组