增加有效期
This commit is contained in:
parent
62c0529c25
commit
6dc28a4957
@ -6,6 +6,7 @@ import java.lang.reflect.Type;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -86,6 +87,21 @@ public class PaymentOrderEntity {
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 有效天数
|
||||
*/
|
||||
private Integer effectiveDay;
|
||||
|
||||
/**
|
||||
* 截止有效日期
|
||||
*/
|
||||
private Date effectiveTime;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private Date payTime;
|
||||
|
||||
/**
|
||||
* 分销商ID
|
||||
*/
|
||||
|
||||
@ -37,4 +37,7 @@ public class PaymentOrderAddForm {
|
||||
|
||||
@Schema(description = "状态(0:未支付;1:已支付;2:已退款)")
|
||||
private Integer state;
|
||||
|
||||
@Schema(description = "有效天数")
|
||||
private Integer effectiveDay;
|
||||
}
|
||||
@ -28,4 +28,6 @@ public class PaymentOrderQueryForm extends PageParam {
|
||||
@Schema(description = "状态(0:未支付;1:已支付;2:已退款)")
|
||||
private Integer state;
|
||||
|
||||
@Schema(description = "有效状态(1:已生效;2:已过期)")
|
||||
private Integer effectiveState;
|
||||
}
|
||||
|
||||
@ -227,7 +227,10 @@ public class PaymentOrderService {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (eventType.equals("TRANSACTION.SUCCESS")) {
|
||||
String outTradeNo = jsonObject.getString("out_trade_no");
|
||||
PaymentOrderEntity history = paymentOrderDao.selectOne(Wrappers.<PaymentOrderEntity>lambdaQuery().eq(PaymentOrderEntity::getPayOrderNo, outTradeNo));
|
||||
wrapper.set(PaymentOrderEntity::getState, 1);
|
||||
wrapper.set(PaymentOrderEntity::getPayTime, new Date());
|
||||
wrapper.set(PaymentOrderEntity::getEffectiveTime, DateUtil.offsetDay(new Date(), history.getEffectiveDay()));
|
||||
PaymentOrderEntity paymentOrderEntity = paymentOrderDao.selectOne(Wrappers.<PaymentOrderEntity>lambdaQuery()
|
||||
.eq(PaymentOrderEntity::getPayOrderNo, outTradeNo));
|
||||
if (paymentOrderEntity != null) {
|
||||
|
||||
@ -13,7 +13,14 @@
|
||||
t_payment_order.price,
|
||||
t_payment_order.state,
|
||||
t_payment_order.create_time,
|
||||
t_payment_order.distributor_id
|
||||
t_payment_order.distributor_id,
|
||||
t_payment_order.tange_order_id,
|
||||
t_payment_order.refund_reason,
|
||||
t_payment_order.refund_no,
|
||||
t_payment_order.refund_price,
|
||||
t_payment_order.effective_time,
|
||||
t_payment_order.pay_time,
|
||||
t_payment_order.effective_day
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
@ -34,6 +41,13 @@
|
||||
<if test="queryForm.deviceId != null">
|
||||
AND t_payment_order.device_id = #{queryForm.deviceId}
|
||||
</if>
|
||||
<!--套餐有效期-->
|
||||
<if test="queryForm.effectiveState != null and queryForm.effectiveState == 1">
|
||||
AND t_payment_order.effective_time >= now()
|
||||
</if>
|
||||
<if test="queryForm.effectiveState != null and queryForm.effectiveState == 2">
|
||||
AND t_payment_order.effective_time < now()
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
@ -12,83 +12,30 @@
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.a-c-c-e-s-s-k-e-y",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties",
|
||||
"defaultValue": "AK_2SbSCTarH0shyRiv2e1A0wAW5TN"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.a-c-c-e-s-s-s-e-c-r-e-t",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.a-c-c-e-s-s-s-e-c-r-e-t",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties",
|
||||
"defaultValue": "cccf673773e2ba5a43043b114614a626"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.a-p-p-i-d",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.a-p-p-i-d",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties",
|
||||
"defaultValue": "7886600"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.e-n-c-o-d-i-n-g",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.e-n-c-o-d-i-n-g",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties",
|
||||
"defaultValue": "UTF-8"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.e-p-s-e-r-v-e-r-u-r-l",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.e-p-s-e-r-v-e-r-u-r-l",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties",
|
||||
"defaultValue": "https:\/\/ep.tange365.com\/service"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.h-e-x-c-h-a-r-t-a-b-l-e",
|
||||
"type": "java.lang.Character[]",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.tange.h-e-x-c-h-a-r-t-a-b-l-e",
|
||||
"type": "java.lang.Character[]",
|
||||
"sourceType": "net.lab1024.sa.admin.module.business.external.config.TangeProperties",
|
||||
"defaultValue": [
|
||||
"0",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"d",
|
||||
"e",
|
||||
"f"
|
||||
]
|
||||
}
|
||||
],
|
||||
"hints": []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user