Browse Source

私有化部署:bug修复

tangxiangan 11 months ago
parent
commit
44beaa6a09

+ 2 - 0
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/pojo/vo/SubscriptionVO.java

@@ -15,6 +15,8 @@ public class SubscriptionVO {
 
     private BigDecimal price;
 
+    private BigDecimal cnyPrice;
+
     private Integer payment;
 
     private Date createdAt;

+ 3 - 0
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/service/impl/SubscriptionServiceImpl.java

@@ -59,6 +59,9 @@ public class SubscriptionServiceImpl implements SubscriptionService {
             int total = collect.stream().filter(c -> !c.getValidFlag().equals(LicenseCodeStatusEnum.Refunded.code())).mapToInt(o -> Objects.isNull(o.getTimes()) ? 0 : o.getTimes()).sum();
             int used = collect.stream().filter(c -> !c.getValidFlag().equals(LicenseCodeStatusEnum.Refunded.code())).mapToInt(o -> Objects.isNull(o.getUsedTimes()) ? 0 : o.getUsedTimes()).sum();
             subscriptionVO.setAvailableDeviceAmount(total - used);
+            if(subscriptionVO.getPayment().equals(1)||subscriptionVO.getPayment().equals(2)){
+                subscriptionVO.setPrice(subscriptionVO.getCnyPrice());
+            }
         }
         return new PageInfo<>(subscriptionVOS);
     }

+ 2 - 1
pdf-tech-core/src/main/resources/sqlmap/ext/ExtSubscriptionMapper.xml

@@ -6,6 +6,7 @@
     <result column="code" jdbcType="VARCHAR" property="code" />
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="price" jdbcType="NUMERIC" property="price" />
+    <result column="cny_price" jdbcType="NUMERIC" property="cnyPrice" />
     <result column="payment" jdbcType="INTEGER" property="payment" />
     <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
     <result column="expiration_at" jdbcType="TIMESTAMP" property="expirationAt" />
@@ -13,7 +14,7 @@
   </resultMap>
 
   <select id="listByCompany" resultMap="BaseResultMap">
-    select vod.id, p.code, p.name, vod.price, vod.payment, vod.created_at, vod.max_device_amount quantity, vod.end_date expiration_at, o.detail_type detailType
+    select vod.id, p.code, p.name, vod.price, vod.cny_price, vod.payment, vod.created_at, vod.max_device_amount quantity, vod.end_date expiration_at, o.detail_type detailType
     from subscriptions vod
     left join products p on p.id = vod.product_id
     left join orders o on o.subscription_id = vod.id and o.status = '2'