Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
6007c599
Commit
6007c599
authored
Mar 30, 2021
by
yangtianyou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APP版本 界面
parent
50bbdd4d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
211 additions
and
68 deletions
+211
-68
TAppVersion.java
.../java/cn/wisenergy/chnmuseum/party/model/TAppVersion.java
+6
-1
ChinaMobileRestApiController.java
...um/party/web/controller/ChinaMobileRestApiController.java
+64
-8
TAppDirPicController.java
.../chnmuseum/party/web/controller/TAppDirPicController.java
+34
-18
TAppRunPicController.java
.../chnmuseum/party/web/controller/TAppRunPicController.java
+40
-21
TAppVersionController.java
...chnmuseum/party/web/controller/TAppVersionController.java
+52
-19
BaseController.java
...y/chnmuseum/party/web/controller/base/BaseController.java
+12
-0
TAppVersionMapper.xml
src/main/resources/mapper/TAppVersionMapper.xml
+3
-1
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/model/TAppVersion.java
View file @
6007c599
...
...
@@ -74,7 +74,12 @@ public class TAppVersion implements Serializable {
@TableField
(
"apk_url"
)
private
String
apkUrl
;
@ApiModelProperty
(
"版本信息"
)
@TableField
(
"version_info"
)
private
String
versionInfo
;
@ApiModelProperty
(
"更新日志"
)
@TableField
(
"update_log"
)
private
String
updateLog
;
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ChinaMobileRestApiController.java
View file @
6007c599
...
...
@@ -3,6 +3,7 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import
cn.wisenergy.chnmuseum.party.auth.SHA256PasswordEncryptionService
;
import
cn.wisenergy.chnmuseum.party.auth.util.JwtTokenUtil
;
import
cn.wisenergy.chnmuseum.party.common.enums.LanguageEnum
;
import
cn.wisenergy.chnmuseum.party.common.util.DateUtil
;
import
cn.wisenergy.chnmuseum.party.common.util.TimeUtils
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.vo.AudioVo
;
...
...
@@ -16,6 +17,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.parser.Feature
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
...
...
@@ -41,6 +43,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.annotation.Resource
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -99,6 +102,15 @@ public class ChinaMobileRestApiController extends BaseController {
@Resource
private
LearningContentBoardService
learningContentBoardService
;
@Resource
private
TAppVersionService
appVersionService
;
@Resource
private
TAppDirPicService
appDirPicService
;
@Resource
private
TAppRunPicService
appRunPicService
;
private
static
final
String
SHIRO_JWT_TOKEN
=
"shiro:jwt:token:"
;
//用户登录次数计数 redisKey 前缀
private
static
final
String
SHIRO_LOGIN_COUNT
=
"shiro_login_count_"
;
...
...
@@ -604,16 +616,60 @@ public class ChinaMobileRestApiController extends BaseController {
return
getResult
(
page
);
}
@ApiOperation
(
value
=
"app最新版本查询"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"versionNo"
,
value
=
"app版本号"
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"/version/check"
)
@RequiresPermissions
(
"app:version:check"
)
public
Map
<
String
,
Object
>
versionCheck
(
String
versionNo
)
{
TAppVersion
current
=
new
TAppVersion
();
//当前版本
// 查询最新版本号信息
QueryWrapper
<
TAppVersion
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"is_current"
,
1
);
qw
.
select
().
orderByDesc
(
"update_time"
);
List
<
TAppVersion
>
currentList
=
appVersionService
.
list
(
qw
);
if
(
currentList
==
null
||
currentList
.
size
()
==
0
){
return
getFailResult
(
"未设置当前版本信息"
);
}
else
{
current
=
currentList
.
get
(
0
);
}
Map
map
=
new
HashMap
();
map
.
put
(
"isLatest"
,
versionNo
.
equals
(
current
.
getAppVersion
()));
map
.
put
(
"versionNo"
,
current
.
getAppVersion
());
map
.
put
(
"versionUrl"
,
current
.
getApkUrl
());
map
.
put
(
"updateLog"
,
current
.
getUpdateLog
());
map
.
put
(
"updateTime"
,
DateUtil
.
format
(
current
.
getUpdateTime
(),
DateUtil
.
FORMAT_ONE
));
return
getResult
(
map
);
}
@ApiOperation
(
value
=
"app界面图片查询"
)
@GetMapping
(
value
=
"/app/picSelect"
)
@RequiresPermissions
(
"app:pic:select"
)
public
Map
<
String
,
Object
>
appPicSelect
()
{
TAppDirPic
currentDir
=
null
;
// 当前目录页面
TAppRunPic
currentRun
=
null
;
// 当前运行画面
// 查询当前目录界面信息
QueryWrapper
<
TAppDirPic
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"is_current"
,
1
);
qw
.
select
().
orderByDesc
(
"create_time"
);
List
<
TAppDirPic
>
currentDirList
=
appDirPicService
.
list
(
qw
);
if
(
currentDirList
!=
null
&&
currentDirList
.
size
()
>
0
){
currentDir
=
currentDirList
.
get
(
0
);
}
QueryWrapper
<
TAppRunPic
>
qw1
=
new
QueryWrapper
<>();
qw1
.
eq
(
"is_current"
,
1
);
qw1
.
select
().
orderByDesc
(
"create_time"
);
List
<
TAppRunPic
>
currentRunList
=
appRunPicService
.
list
(
qw1
);
if
(
currentRunList
!=
null
&&
currentRunList
.
size
()
>
0
){
currentRun
=
currentRunList
.
get
(
0
);
}
Map
map
=
new
HashMap
();
map
.
put
(
"dirImgUrl"
,
currentDir
!=
null
?
currentDir
.
getAppDirPic
()
:
"未设置目录图片"
);
map
.
put
(
"runImgUrl"
,
currentRun
!=
null
?
currentRun
.
getAppRunPic
()
:
"未设置运行图片"
);
return
getResult
(
map
);
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TAppDirPicController.java
View file @
6007c599
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -80,30 +81,45 @@ public class TAppDirPicController extends BaseController {
@RequiresPermissions
(
"t:app:dir:pic:update"
)
@ApiOperation
(
value
=
"修改信息"
,
notes
=
"修改信息"
)
public
Map
<
String
,
Object
>
updateTAppDirPic
(
@Validated
(
value
=
{
Update
.
class
})
TAppDirPic
tAppDirPic
)
{
boolean
flag
=
tAppDirPicService
.
updateById
(
tAppDirPic
);
// 默认不为当前版本
if
(
tAppDirPic
.
getIsCurrent
()
==
null
){
tAppDirPic
.
setIsCurrent
(
0
);
}
// 如果有其他版本是当前版本状态,将其当前版本状态取消
QueryWrapper
<
TAppDirPic
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"is_current"
,
1
);
List
<
TAppDirPic
>
currentList
=
tAppDirPicService
.
list
(
qw
);
if
(
currentList
!=
null
&&
currentList
.
size
()
>
0
&&
tAppDirPic
.
getIsCurrent
()
==
1
){
currentList
.
stream
().
forEach
(
c
->{
c
.
setIsCurrent
(
0
);
});
tAppDirPicService
.
updateBatchById
(
currentList
);
}
boolean
flag
=
tAppDirPicService
.
updateById
(
tAppDirPic
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@PutMapping
(
"/updateAuditStatus/{id}"
)
@RequiresPermissions
(
"t:app:dir:pic:update:audit:status"
)
@ApiOperation
(
value
=
"更新审核状态"
,
notes
=
"更新审核状态"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"isCurrent"
,
value
=
"是否为当前界面 0:否 1:是"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
updateStatus
(
@NotNull
(
message
=
"ID不能为空"
)
@PathVariable
(
"id"
)
String
id
,
@RequestParam
(
"status"
)
Integer
isCurrent
)
{
UpdateWrapper
<
TAppDirPic
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
id
);
updateWrapper
.
eq
(
"is_current"
,
isCurrent
);
boolean
flag
=
tAppDirPicService
.
update
(
updateWrapper
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
//
@PutMapping("/updateAuditStatus/{id}")
//
@RequiresPermissions("t:app:dir:pic:update:audit:status")
//
@ApiOperation(value = "更新审核状态", notes = "更新审核状态")
//
@ApiImplicitParams(value = {
//
@ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path"),
//
@ApiImplicitParam(name = "isCurrent", value = "是否为当前界面 0:否 1:是", paramType = "query", dataType = "String")
//
})
//
public Map<String, Object> updateStatus(@NotNull(message = "ID不能为空") @PathVariable("id") String id, @RequestParam("status") Integer isCurrent) {
//
UpdateWrapper<TAppDirPic> updateWrapper = new UpdateWrapper<>();
//
updateWrapper.eq("id", id);
//
updateWrapper.eq("is_current", isCurrent);
//
boolean flag = tAppDirPicService.update(updateWrapper);
//
if (flag) {
//
return getSuccessResult();
//
}
//
return getFailResult();
//
}
@DeleteMapping
(
"/delete/{id}"
)
@RequiresPermissions
(
"t:app:dir:pic:delete"
)
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TAppRunPicController.java
View file @
6007c599
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -65,7 +66,11 @@ public class TAppRunPicController extends BaseController {
@RequiresPermissions
(
"t:app:run:pic:save"
)
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
public
Map
<
String
,
Object
>
saveTAppRunPic
(
@Validated
(
value
=
{
Add
.
class
})
TAppRunPic
tAppRunPic
)
{
// 保存业务节点信息
// 默认不为当前版本
if
(
tAppRunPic
.
getIsCurrent
()
==
null
){
tAppRunPic
.
setIsCurrent
(
0
);
}
// 保存业务节点信息
boolean
result
=
tAppRunPicService
.
save
(
tAppRunPic
);
// 返回操作结果
if
(
result
)
{
...
...
@@ -80,30 +85,44 @@ public class TAppRunPicController extends BaseController {
@RequiresPermissions
(
"t:app:run:pic:update"
)
@ApiOperation
(
value
=
"修改信息"
,
notes
=
"修改信息"
)
public
Map
<
String
,
Object
>
updateTAppRunPic
(
@Validated
(
value
=
{
Update
.
class
})
TAppRunPic
tAppRunPic
)
{
boolean
flag
=
tAppRunPicService
.
updateById
(
tAppRunPic
);
if
(
flag
)
{
return
getSuccessResult
();
// 默认不为当前版本
if
(
tAppRunPic
.
getIsCurrent
()
==
null
){
tAppRunPic
.
setIsCurrent
(
0
);
}
// 如果有其他版本是当前版本状态,将其当前版本状态取消
QueryWrapper
<
TAppRunPic
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"is_current"
,
1
);
List
<
TAppRunPic
>
currentList
=
tAppRunPicService
.
list
(
qw
);
if
(
currentList
!=
null
&&
currentList
.
size
()
>
0
&&
tAppRunPic
.
getIsCurrent
()
==
1
){
currentList
.
stream
().
forEach
(
c
->{
c
.
setIsCurrent
(
0
);
});
tAppRunPicService
.
updateBatchById
(
currentList
);
}
boolean
flag
=
tAppRunPicService
.
updateById
(
tAppRunPic
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@PutMapping
(
"/updateAuditStatus/{id}"
)
@RequiresPermissions
(
"t:app:run:pic:update:audit:status"
)
@ApiOperation
(
value
=
"更新审核状态"
,
notes
=
"更新审核状态"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"isCurrent"
,
value
=
"是否为当前界面 0:否 1:是"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
updateStatus
(
@NotNull
(
message
=
"ID不能为空"
)
@PathVariable
(
"id"
)
String
id
,
@RequestParam
(
"status"
)
String
isCurrent
)
{
UpdateWrapper
<
TAppRunPic
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
id
);
updateWrapper
.
eq
(
"is_current"
,
isCurrent
);
boolean
flag
=
tAppRunPicService
.
update
(
updateWrapper
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
//
@PutMapping("/updateAuditStatus/{id}")
//
@RequiresPermissions("t:app:run:pic:update:audit:status")
//
@ApiOperation(value = "更新审核状态", notes = "更新审核状态")
//
@ApiImplicitParams(value = {
//
@ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path"),
//
@ApiImplicitParam(name = "isCurrent", value = "是否为当前界面 0:否 1:是", paramType = "query", dataType = "String")
//
})
//
public Map<String, Object> updateStatus(@NotNull(message = "ID不能为空") @PathVariable("id") String id, @RequestParam("status") String isCurrent) {
//
UpdateWrapper<TAppRunPic> updateWrapper = new UpdateWrapper<>();
//
updateWrapper.eq("id", id);
//
updateWrapper.eq("is_current", isCurrent);
//
boolean flag = tAppRunPicService.update(updateWrapper);
//
if (flag) {
//
return getSuccessResult();
//
}
//
return getFailResult();
//
}
@DeleteMapping
(
"/delete/{id}"
)
@RequiresPermissions
(
"t:app:run:pic:delete"
)
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TAppVersionController.java
View file @
6007c599
...
...
@@ -66,6 +66,10 @@ public class TAppVersionController extends BaseController {
@RequiresPermissions
(
"t:app:version:save"
)
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
public
Map
<
String
,
Object
>
saveTAppVersion
(
@Validated
(
value
=
{
Add
.
class
})
TAppVersion
tAppVersion
)
{
// 默认不为当前版本
if
(
tAppVersion
.
getIsCurrent
()
==
null
){
tAppVersion
.
setIsCurrent
(
0
);
}
// 保存业务节点信息
boolean
result
=
tAppVersionService
.
save
(
tAppVersion
);
// 返回操作结果
...
...
@@ -81,30 +85,59 @@ public class TAppVersionController extends BaseController {
@RequiresPermissions
(
"t:app:version:update"
)
@ApiOperation
(
value
=
"修改信息"
,
notes
=
"修改信息"
)
public
Map
<
String
,
Object
>
updateTAppVersion
(
@Validated
(
value
=
{
Update
.
class
})
TAppVersion
tAppVersion
)
{
boolean
flag
=
tAppVersionService
.
updateById
(
tAppVersion
);
if
(
flag
)
{
// 默认不为当前版本
if
(
tAppVersion
.
getIsCurrent
()
==
null
){
tAppVersion
.
setIsCurrent
(
0
);
}
// 如果有其他版本是当前版本状态,将其当前版本状态取消
QueryWrapper
<
TAppVersion
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"is_current"
,
1
);
List
<
TAppVersion
>
currentList
=
tAppVersionService
.
list
(
qw
);
if
(
currentList
!=
null
&&
currentList
.
size
()
>
0
&&
tAppVersion
.
getIsCurrent
()
==
1
){
currentList
.
stream
().
forEach
(
c
->{
c
.
setIsCurrent
(
0
);
});
tAppVersionService
.
updateBatchById
(
currentList
);
}
// 更新版本信息
boolean
flag
=
tAppVersionService
.
updateById
(
tAppVersion
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@PutMapping
(
"/updateAuditStatus/{id}"
)
@RequiresPermissions
(
"t:app:version:update:audit:status"
)
@ApiOperation
(
value
=
"更新审核状态"
,
notes
=
"更新审核状态"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"isCurrent"
,
value
=
"是否为当前版本 0:否 1:是"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
updateStatus
(
@NotNull
(
message
=
"ID不能为空"
)
@PathVariable
(
"id"
)
String
id
,
@RequestParam
(
"status"
)
String
isCurrent
)
{
UpdateWrapper
<
TAppVersion
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
id
);
updateWrapper
.
eq
(
"is_current"
,
isCurrent
);
boolean
flag
=
tAppVersionService
.
update
(
updateWrapper
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
// @PutMapping("/updateStatus/{id}")
// @RequiresPermissions("t:app:version:update:status")
// @ApiOperation(value = "更新版本状态", notes = "更新版本状态")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path"),
// @ApiImplicitParam(name = "isCurrent", value = "是否为当前版本 0:否 1:是", paramType = "query", dataType = "Integer")
// })
// public Map<String, Object> updateStatus(@NotNull(message = "ID不能为空") @PathVariable("id") String id, @RequestParam("isCurrent") Integer isCurrent) {
// TAppVersion appVersion = new TAppVersion();
// appVersion.setId(id);
// appVersion.setIsCurrent(isCurrent);
//
// // 如果有其他版本是当前版本状态,将其当前版本状态取消
// QueryWrapper<TAppVersion> qw = new QueryWrapper<>();
// qw.eq("is_current",1);
// List<TAppVersion> currentList = tAppVersionService.list(qw);
// if (currentList != null && currentList.size() > 0 && isCurrent == 1){
// currentList.stream().forEach(c->{
// c.setIsCurrent(0);
// });
// tAppVersionService.updateBatchById(currentList);
// }
// // 将指定办版本设置为当前版本
// boolean flag = tAppVersionService.updateById(appVersion);
// if (flag) {
// return getSuccessResult();
// }
//
// return getFailResult();
// }
@DeleteMapping
(
"/delete/{id}"
)
@RequiresPermissions
(
"t:app:version:delete"
)
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/base/BaseController.java
View file @
6007c599
...
...
@@ -122,6 +122,18 @@ public class BaseController implements Serializable {
return
map
;
}
/**
* 返回失败
*
* @return map
*/
protected
Map
<
String
,
Object
>
getFailResult
(
String
msg
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
msg
);
return
map
;
}
/**
* JSON 过滤相关字段
*
...
...
src/main/resources/mapper/TAppVersionMapper.xml
View file @
6007c599
...
...
@@ -12,11 +12,13 @@
<result
column=
"user_id"
property=
"userId"
/>
<result
column=
"user_name"
property=
"userName"
/>
<result
column=
"apk_url"
property=
"apkUrl"
/>
<result
column=
"version_info"
property=
"versionInfo"
/>
<result
column=
"update_log"
property=
"updateLog"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, app_version, is_current, create_time, update_time, user_id, user_name, apk_url
id, app_version, is_current, create_time, update_time, user_id, user_name, apk_url
,version_info,update_log
</sql>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment