查询套餐券列表时,如果过期且未使用,将其状态修改为已过期

This commit is contained in:
quantulr
2024-07-04 17:19:08 +08:00
parent 7bce49cefe
commit efdeee8e82
5 changed files with 71 additions and 43 deletions

76
.idea/workspace.xml generated
View File

@ -6,8 +6,8 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="bdad98b9-7a5e-48f7-b79e-ed6a34d55dab" name="Default Changelist" comment="第一次提交"> <list default="true" id="bdad98b9-7a5e-48f7-b79e-ed6a34d55dab" name="Default Changelist" comment="第一次提交">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/code/com/wisdo/mmining/config/shiro/ShiroConfiguration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/code/com/wisdo/mmining/config/shiro/ShiroConfiguration.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/code/com/wisdo/mmining/util/excel/ExcelUntils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/code/com/wisdo/mmining/util/excel/ExcelUntils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/wisdo/mmining/api/OrderApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/wisdo/mmining/api/OrderApi.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/com/wisdo/mmining/api/UserApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/wisdo/mmining/api/UserApi.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/application-db.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application-db.yml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/resources/application-db.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application-db.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.yml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.yml" afterDir="false" />
</list> </list>
@ -447,33 +447,33 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"Maven.wisdommining [clean].executor": "Run", &quot;Maven.wisdommining [clean].executor&quot;: &quot;Run&quot;,
"Maven.wisdommining [package].executor": "Run", &quot;Maven.wisdommining [package].executor&quot;: &quot;Run&quot;,
"RequestMappingsPanelOrder0": "0", &quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
"RequestMappingsPanelOrder1": "1", &quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
"RequestMappingsPanelWidth0": "75", &quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
"RequestMappingsPanelWidth1": "75", &quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"Spring Boot.WisdoMminingApplication.executor": "Debug", &quot;Spring Boot.WisdoMminingApplication.executor&quot;: &quot;Debug&quot;,
"dart.analysis.tool.window.visible": "false", &quot;dart.analysis.tool.window.visible&quot;: &quot;false&quot;,
"git-widget-placeholder": "master", &quot;git-widget-placeholder&quot;: &quot;master&quot;,
"kotlin-language-version-configured": "true", &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
"last_opened_file_path": "D:/Documents/AndroidStudioProjects/logistics_tools", &quot;last_opened_file_path&quot;: &quot;D:/Documents/AndroidStudioProjects/logistics_tools&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"project.structure.last.edited": "SDK", &quot;project.structure.last.edited&quot;: &quot;SDK&quot;,
"project.structure.proportion": "0.0", &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
"project.structure.side.proportion": "0.2", &quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
"settings.editor.selected.configurable": "preferences.pluginManager", &quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;,
"show.migrate.to.gradle.popup": "false", &quot;show.migrate.to.gradle.popup&quot;: &quot;false&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="ReactorSettings"> <component name="ReactorSettings">
<option name="notificationShown" value="true" /> <option name="notificationShown" value="true" />
</component> </component>
@ -652,7 +652,9 @@
<workItem from="1719207318590" duration="683000" /> <workItem from="1719207318590" duration="683000" />
<workItem from="1719210374799" duration="28000" /> <workItem from="1719210374799" duration="28000" />
<workItem from="1719296864680" duration="33000" /> <workItem from="1719296864680" duration="33000" />
<workItem from="1719564748404" duration="335000" /> <workItem from="1719564748404" duration="2015000" />
<workItem from="1719795551124" duration="6472000" />
<workItem from="1720079374607" duration="5264000" />
</task> </task>
<task id="LOCAL-00001" summary="第一次提交"> <task id="LOCAL-00001" summary="第一次提交">
<created>1623736948713</created> <created>1623736948713</created>
@ -786,6 +788,22 @@
<MESSAGE value="测试提交" /> <MESSAGE value="测试提交" />
<option name="LAST_COMMIT_MESSAGE" value="测试提交" /> <option name="LAST_COMMIT_MESSAGE" value="测试提交" />
</component> </component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/wisdo/mmining/service/impl/OrderServiceImpl.java</url>
<line>397</line>
<option name="timeStamp" value="16" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/wisdo/mmining/service/impl/OrderServiceImpl.java</url>
<line>400</line>
<option name="timeStamp" value="17" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
<component name="XSLT-Support.FileAssociations.UIState"> <component name="XSLT-Support.FileAssociations.UIState">
<expand /> <expand />
<select /> <select />

View File

@ -49,6 +49,7 @@ public class ExcelUntils {
/** /**
* 导入 * 导入
*
* @param in * @param in
* @param fileName * @param fileName
* @return * @return
@ -80,7 +81,8 @@ public class ExcelUntils {
List<Object> li = new ArrayList<>(); List<Object> li = new ArrayList<>();
for (int y = row.getFirstCellNum(); y < row.getLastCellNum(); y++) { for (int y = row.getFirstCellNum(); y < row.getLastCellNum(); y++) {
cell = row.getCell(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); li.add(cell);
} }
list.add(li); list.add(li);

View File

@ -17,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
import org.gavaghan.geodesy.Ellipsoid; import org.gavaghan.geodesy.Ellipsoid;
import org.gavaghan.geodesy.GlobalCoordinates; import org.gavaghan.geodesy.GlobalCoordinates;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -323,6 +324,7 @@ public class UserApi {
@ApiOperation(value = "获取套餐券") @ApiOperation(value = "获取套餐券")
@GetMapping("getUserPackage") @GetMapping("getUserPackage")
@Transactional(rollbackFor = Exception.class)
public Result getUserPackage(Long userId, Integer type) { public Result getUserPackage(Long userId, Integer type) {
WisdWxuser wxuser = wxuserService.getById(userId); WisdWxuser wxuser = wxuserService.getById(userId);
QueryWrapper<WisdUserPackage> queryWrapper = new QueryWrapper<>(); QueryWrapper<WisdUserPackage> queryWrapper = new QueryWrapper<>();
@ -333,7 +335,13 @@ public class UserApi {
List<WisdPackage> wisdPackageList = new ArrayList<>(); List<WisdPackage> wisdPackageList = new ArrayList<>();
for (WisdUserPackage wisdUserPackage : wisdUserPackageList) { for (WisdUserPackage wisdUserPackage : wisdUserPackageList) {
WisdPackage wisdPackage = packageService.getById(wisdUserPackage.getPackageId()); 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); return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_DATA, wisdPackageList);
} }

View File

@ -1,12 +1,12 @@
#开发环境 #开发环境
spring: spring:
datasource: datasource:
url: jdbc:mysql://192.168.0.233:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8 # 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 url: jdbc:mysql://146.56.198.32:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
username: yshop # username: yshop
# username: root username: root
password: Qwer1234. # password: Qwer1234.
# password: Sphc666888! password: Sphc666888!
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
druid: druid:

View File

@ -1,6 +1,6 @@
server: server:
port: 9000 # port: 9000
# port: 9090 port: 9090
servlet: servlet:
context-path: /wisdommining context-path: /wisdommining
spring: spring:
@ -39,8 +39,8 @@ spring:
# port: 6379 # port: 6379
redis: redis:
database: 10 database: 10
host: localhost # host: localhost
# host: 146.56.198.32 host: 146.56.198.32
timeout: 100000 timeout: 100000
jedis: jedis:
pool: pool:
@ -49,8 +49,8 @@ spring:
max-idle: 8 max-idle: 8
min-idle: 0 min-idle: 0
port: 6379 port: 6379
# password: Zsd@2021! password: Zsd@2021!
password: # password:
mybatis-plus: mybatis-plus: