Commit c50d732c authored by hezhen's avatar hezhen

Merge branch 'hz_master' into dev

parents 81ce0510 b62351bd
package com.github.wxiaoqi.security.admin.rest;
import com.github.wxiaoqi.security.admin.biz.AppUserSellingWaterBiz;
import com.github.wxiaoqi.security.admin.dto.OrderWaterDTO;
import com.github.wxiaoqi.security.admin.vo.SellingWalletPagVo;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil;
......@@ -8,10 +9,7 @@ import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
......@@ -34,6 +32,9 @@ public class UserSellingWaterController {
@Autowired
private UserAuthConfig userAuthConfig;
@Autowired
private AppUserSellingWaterBiz waterBiz;
@GetMapping("/page")
public ObjectRestResponse<SellingWalletPagVo> findSellingWaterPage(@RequestParam(required = false,value = "type") Integer wating,
@RequestParam("pageNo") Integer pageNo,
......@@ -61,4 +62,14 @@ public class UserSellingWaterController {
throw new BaseException(e);
}
}
@PostMapping("app/unauth/order")
public ObjectRestResponse order(@RequestBody OrderWaterDTO orderWaterDTO) {
try {
waterBiz.orderWater(orderWaterDTO);
return ObjectRestResponse.succ();
} catch (Exception e) {
throw new BaseException(e);
}
}
}
......@@ -59,12 +59,18 @@ public class UserCouponVo {
@ApiModelProperty(value = "开始时间", hidden = true )
private Long startTime;
/**
* 到期时间
*/
@ApiModelProperty(value = "到期时间", hidden = true )
private Long expireTime;
@ApiModelProperty(value = "到期时间字符串")
private String expireDate;
/**
* 使用时间
*/
......
......@@ -124,9 +124,12 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
if(type==1){
startTime=coupon.getStartTime();
expireTime=coupon.getValidEndTime();
}else {
}else if (type==2){
startTime=expireTime;
expireTime+=DAY*coupon.getValidDays();
} else {
startTime=expireTime;
expireTime=-1L;
}
String ticker_no=Snowflake.build()+"";
UserCoupon userCoupon=new UserCoupon();
......
......@@ -13,6 +13,7 @@
<result property="crtTime" column="crt_time"/>
<result property="startTime" column="start_time"/>
<result property="expireTime" column="expire_time"/>
<result property="expireDate" column="expireDate"/>
<result property="useTime" column="use_time"/>
<result property="title" column="title"/>
<result property="subtitle" column="subtitle"/>
......@@ -32,20 +33,20 @@
<select id="getUserCouponsByType" resultMap="userCouponMap">
SELECT
*
*,IF(expire_time=-1,'永久',FROM_UNIXTIME(expire_time/1000,'%Y-%m-%d')) as expireDate
FROM
user_coupon u
LEFT JOIN coupon c ON u.coupon_id = c.id
WHERE
u.is_del = 0 and u.user_id=#{userId}
<if test="type==0">
and u.is_use=0 and u.expire_time >=#{time}
and u.is_use=0 and (u.expire_time >=#{time} or u.expire_time=-1)
</if>
<if test="type==1">
and u.is_use=1
</if>
<if test="type==2">
and u.is_use=0 and u.expire_time &lt;#{time}
and u.is_use=0 and u.expire_time &lt;#{time} and u.expire_time!=-1
</if>
<if test="channel!=null and channel!=''">
and (c.channel=#{channel} or c.channel=0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment