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

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">
<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$/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/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/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/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.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.yml" afterDir="false" />
</list>
@ -447,33 +447,33 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"Maven.wisdommining [clean].executor": "Run",
"Maven.wisdommining [package].executor": "Run",
"RequestMappingsPanelOrder0": "0",
"RequestMappingsPanelOrder1": "1",
"RequestMappingsPanelWidth0": "75",
"RequestMappingsPanelWidth1": "75",
"RunOnceActivity.ShowReadmeOnStart": "true",
"Spring Boot.WisdoMminingApplication.executor": "Debug",
"dart.analysis.tool.window.visible": "false",
"git-widget-placeholder": "master",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "D:/Documents/AndroidStudioProjects/logistics_tools",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"project.structure.last.edited": "SDK",
"project.structure.proportion": "0.0",
"project.structure.side.proportion": "0.2",
"settings.editor.selected.configurable": "preferences.pluginManager",
"show.migrate.to.gradle.popup": "false",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;Maven.wisdommining [clean].executor&quot;: &quot;Run&quot;,
&quot;Maven.wisdommining [package].executor&quot;: &quot;Run&quot;,
&quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
&quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
&quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
&quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;Spring Boot.WisdoMminingApplication.executor&quot;: &quot;Debug&quot;,
&quot;dart.analysis.tool.window.visible&quot;: &quot;false&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;D:/Documents/AndroidStudioProjects/logistics_tools&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;project.structure.last.edited&quot;: &quot;SDK&quot;,
&quot;project.structure.proportion&quot;: &quot;0.0&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;,
&quot;show.migrate.to.gradle.popup&quot;: &quot;false&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}]]></component>
}</component>
<component name="ReactorSettings">
<option name="notificationShown" value="true" />
</component>
@ -652,7 +652,9 @@
<workItem from="1719207318590" duration="683000" />
<workItem from="1719210374799" duration="28000" />
<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 id="LOCAL-00001" summary="第一次提交">
<created>1623736948713</created>
@ -786,6 +788,22 @@
<MESSAGE value="测试提交" />
<option name="LAST_COMMIT_MESSAGE" value="测试提交" />
</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">
<expand />
<select />

View File

@ -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);

View File

@ -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);
}

View File

@ -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:

View File

@ -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: