查询套餐券列表时,如果过期且未使用,将其状态修改为已过期
This commit is contained in:
@ -49,6 +49,7 @@ public class ExcelUntils {
|
||||
|
||||
/**
|
||||
* 导入
|
||||
*
|
||||
* @param in
|
||||
* @param fileName
|
||||
* @return
|
||||
@ -80,7 +81,8 @@ public class ExcelUntils {
|
||||
List<Object> li = new ArrayList<>();
|
||||
for (int y = row.getFirstCellNum(); y < row.getLastCellNum(); y++) {
|
||||
cell = row.getCell(y);
|
||||
cell.setCellType(Cell.CELL_TYPE_STRING);
|
||||
// FIXME: 方法抛出 'java.lang.NumberFormatException' 异常。 无法对 org.apache.poi.xssf.usermodel.XSSFCell.toString() 求值
|
||||
// FIXME: cell.setCellType(Cell.CELL_TYPE_STRING);
|
||||
li.add(cell);
|
||||
}
|
||||
list.add(li);
|
||||
|
@ -17,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.gavaghan.geodesy.Ellipsoid;
|
||||
import org.gavaghan.geodesy.GlobalCoordinates;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -323,6 +324,7 @@ public class UserApi {
|
||||
|
||||
@ApiOperation(value = "获取套餐券")
|
||||
@GetMapping("getUserPackage")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result getUserPackage(Long userId, Integer type) {
|
||||
WisdWxuser wxuser = wxuserService.getById(userId);
|
||||
QueryWrapper<WisdUserPackage> queryWrapper = new QueryWrapper<>();
|
||||
@ -333,7 +335,13 @@ public class UserApi {
|
||||
List<WisdPackage> wisdPackageList = new ArrayList<>();
|
||||
for (WisdUserPackage wisdUserPackage : wisdUserPackageList) {
|
||||
WisdPackage wisdPackage = packageService.getById(wisdUserPackage.getPackageId());
|
||||
wisdPackageList.add(wisdPackage);
|
||||
// 套餐券已过期并且未使用,则将其设改为已过期
|
||||
if (wisdPackage.getPackageEndTime().getTime() < System.currentTimeMillis() && wisdUserPackage.getIsUsed().equals(0)) {
|
||||
wisdUserPackage.setIsUsed(2);
|
||||
userPackageService.updateById(wisdUserPackage);
|
||||
} else {
|
||||
wisdPackageList.add(wisdPackage);
|
||||
}
|
||||
}
|
||||
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_DATA, wisdPackageList);
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
#开发环境
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://192.168.0.233:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://146.56.198.32:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: yshop
|
||||
# username: root
|
||||
password: Qwer1234.
|
||||
# password: Sphc666888!
|
||||
# url: jdbc:mysql://192.168.0.233:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://146.56.198.32:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
# username: yshop
|
||||
username: root
|
||||
# password: Qwer1234.
|
||||
password: Sphc666888!
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
|
@ -1,6 +1,6 @@
|
||||
server:
|
||||
port: 9000
|
||||
# port: 9090
|
||||
# port: 9000
|
||||
port: 9090
|
||||
servlet:
|
||||
context-path: /wisdommining
|
||||
spring:
|
||||
@ -39,8 +39,8 @@ spring:
|
||||
# port: 6379
|
||||
redis:
|
||||
database: 10
|
||||
host: localhost
|
||||
# host: 146.56.198.32
|
||||
# host: localhost
|
||||
host: 146.56.198.32
|
||||
timeout: 100000
|
||||
jedis:
|
||||
pool:
|
||||
@ -49,8 +49,8 @@ spring:
|
||||
max-idle: 8
|
||||
min-idle: 0
|
||||
port: 6379
|
||||
# password: Zsd@2021!
|
||||
password:
|
||||
password: Zsd@2021!
|
||||
# password:
|
||||
|
||||
|
||||
mybatis-plus:
|
||||
|
Reference in New Issue
Block a user