会员免单时间转换

This commit is contained in:
wangguocheng
2024-04-24 17:55:55 +08:00
parent 4fc29e3ad8
commit ea1252ecc0
5 changed files with 19 additions and 48 deletions

View File

@@ -66,11 +66,12 @@ public class OrderController {
return orderService.mineCoupons(userId,status,page,size); return orderService.mineCoupons(userId,status,page,size);
} }
@GetMapping("/findCoupons") @GetMapping("/findCoupons")
private Result findCoupons(@RequestHeader String token,@RequestParam String type, private Result findCoupons(@RequestHeader String token,String type,
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size) throws IOException { @RequestParam(value = "size", required = false, defaultValue = "1") Integer size) throws IOException {
return orderService.findCoupons(type,page,size); return orderService.findCoupons(type,page,size);
} }
@GetMapping("/findWiningUser") @GetMapping("/findWiningUser")
private Result findWiningUser(){ private Result findWiningUser(){
return orderService.findWiningUser(); return orderService.findWiningUser();
@@ -87,8 +88,4 @@ public class OrderController {
private Result yhqDouble(@RequestParam Integer conponsId){ private Result yhqDouble(@RequestParam Integer conponsId){
return orderService.yhqDouble(conponsId); return orderService.yhqDouble(conponsId);
} }
// @GetMapping("/testPay")
// private Result testPay(@RequestParam Integer orderId){
// return orderService.testPay(orderId);
// }
} }

View File

@@ -1,8 +1,11 @@
package com.chaozhanggui.system.cashierservice.entity; package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
@Data
public class TbYhqParams implements Serializable { public class TbYhqParams implements Serializable {
private Integer id; private Integer id;
@@ -13,46 +16,5 @@ public class TbYhqParams implements Serializable {
private BigDecimal maxPrice; private BigDecimal maxPrice;
private String status; private String status;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public BigDecimal getMinPrice() {
return minPrice;
}
public void setMinPrice(BigDecimal minPrice) {
this.minPrice = minPrice;
}
public BigDecimal getMaxPrice() {
return maxPrice;
}
public void setMaxPrice(BigDecimal maxPrice) {
this.maxPrice = maxPrice;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
} }

View File

@@ -1,5 +1,6 @@
package com.chaozhanggui.system.cashierservice.entity.vo; package com.chaozhanggui.system.cashierservice.entity.vo;
import com.chaozhanggui.system.cashierservice.config.FieldDescription;
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail; import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
import lombok.Data; import lombok.Data;
@@ -11,9 +12,17 @@ import java.util.List;
*/ */
@Data @Data
public class IntegralVo { public class IntegralVo {
//openId
@FieldDescription("用户openId")
private String openId; private String openId;
//数量
@FieldDescription("数量")
private BigDecimal num; private BigDecimal num;
//类型
@FieldDescription("类型")
private String type; private String type;
//签名
@FieldDescription("签名")
private String sign; private String sign;
} }

View File

@@ -71,7 +71,7 @@ public class TaskScheduler {
} }
@Scheduled(fixedRate = 200000) @Scheduled(cron = "0 1 0 * * ?")
public void winningUser() { public void winningUser() {
String day = DateUtils.getDay(); String day = DateUtils.getDay();
List<TbWiningParams> list = winingParamsMapper.selectAll(); List<TbWiningParams> list = winingParamsMapper.selectAll();
@@ -119,7 +119,7 @@ public class TaskScheduler {
} }
for (int i = 0; i < noUserNum; i++) { for (int i = 0; i < noUserNum; i++) {
long endDate = DateUtils.convertDate1(day + " 00:00:00").getTime(); long endDate = DateUtils.convertDate1(day + " 00:00:00").getTime();
long startDate = DateUtils.convertDate1(DateUtils.getTimes(DateUtils.getNewDate(new Date(), 3, -1)) + " 00:00:00").getTime(); long startDate = DateUtils.convertDate1(DateUtils.getSdfDayTimes(DateUtils.getNewDate(new Date(), 3, -1))+" 00:00:00").getTime();
String orderNo = generateOrderNumber(startDate, endDate); String orderNo = generateOrderNumber(startDate, endDate);
String userName = NicknameGenerator.generateRandomWeChatNickname(); String userName = NicknameGenerator.generateRandomWeChatNickname();
BigDecimal orderAmount = RandomUtil.getRandomBigDecimal(winingParams.getMinPrice(), winingParams.getMaxPrice()); BigDecimal orderAmount = RandomUtil.getRandomBigDecimal(winingParams.getMinPrice(), winingParams.getMaxPrice());

View File

@@ -59,6 +59,9 @@ public class DateUtils {
public static String getTimes(Date date){ public static String getTimes(Date date){
return sdfday.format(date); return sdfday.format(date);
} }
public static String getSdfDayTimes(Date date){
return sdfDay.format(date);
}
/** /**