Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center
Commits
3be68019
Commit
3be68019
authored
Mar 22, 2021
by
罗承锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台活动提交
parent
b67b8316
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
238 additions
and
16 deletions
+238
-16
apply-net/src/main/java/com/winsun/controller/SupervisorController.java
+103
-0
common/src/main/java/com/winsun/bean/activity/HhrActivityRecord.java
+1
-1
common/src/main/java/com/winsun/mapper/activity/ActivityMapper.java
+17
-2
common/src/main/resources/com/winsun/mapper/mapping/ActivityMapper.xml
+43
-0
service-manager/src/main/java/com/winsun/controller/ActivityController.java
+49
-1
service-manager/src/main/java/com/winsun/controller/ActivityRecordController.java
+25
-12
No files found.
apply-net/src/main/java/com/winsun/controller/SupervisorController.java
0 → 100644
View file @
3be68019
package
com
.
winsun
.
controller
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.winsun.auth.core.annotion.Permission
;
import
com.winsun.auth.core.common.model.ResponseData
;
import
com.winsun.bean.Order
;
import
com.winsun.bean.Package
;
import
com.winsun.mapper.OrderMapper
;
import
com.winsun.mapper.PackageMapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
/**
* 移动端订单查询
* @author chengfengluo
* @date 2021-03-17 11:30
*/
@RestController
@RequestMapping
(
"/supervisor"
)
public
class
SupervisorController
{
@Autowired
private
OrderMapper
orderMapper
;
@Autowired
private
PackageMapper
packageMapper
;
/**
* 督导订单详情查询
*
* @param orderId
* @return
*/
@PostMapping
(
"selectOrderInfo"
)
public
ResponseData
<
Map
<
String
,
Object
>>
selectOrderInfo
(
@RequestParam
(
"orderId"
)
String
orderId
)
{
/* ShiroUser user = getShiroUser();
if (!user.getRoleNames().stream().anyMatch(roleName -> StringUtils.equalsAny(roleName, "超级管理员"))) {
return ResponseData.error("无数据权限");
}*/
if
(
StringUtils
.
isNotBlank
(
orderId
))
{
ResponseData
<
String
>
verification
=
verification
(
orderId
);
if
(!
verification
.
isSuccess
())
{
return
ResponseData
.
error
(
"订单不存在或异常!"
);
}
}
else
{
return
ResponseData
.
error
(
"页面已失效,请重新登录!"
);
}
Wrapper
<
Order
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"id"
,
orderId
);
List
<
Map
<
String
,
Object
>>
list
=
orderMapper
.
selectMaps
(
wrapper
);
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
if
(
map
.
size
()
==
0
)
{
return
ResponseData
.
error
(
"当前订单不存在!"
);
}
if
(
map
.
get
(
"packageId"
)
!=
null
)
{
Package
aPackage
=
packageMapper
.
selectById
(
Integer
.
parseInt
(
map
.
get
(
"packageId"
).
toString
()));
map
.
put
(
"packageName"
,
aPackage
.
getPackageName
());
map
.
put
(
"advImg"
,
aPackage
.
getAdvImg
());
map
.
put
(
"explains"
,
aPackage
.
getExplains
());
}
//测试用
if
(
StringUtils
.
isBlank
(
map
.
get
(
"idCard"
).
toString
()))
{
map
.
put
(
"idCard"
,
"000000000000000000"
.
substring
(
0
,
14
)
+
"****"
);
}
else
{
if
(
map
.
get
(
"idCard"
).
toString
().
length
()
==
18
)
{
map
.
put
(
"idCard"
,
map
.
get
(
"idCard"
).
toString
().
substring
(
0
,
14
)
+
"****"
);
}
else
{
map
.
put
(
"idCard"
,
map
.
get
(
"idCard"
).
toString
().
substring
(
0
,
11
)
+
"****"
);
}
}
//查询历史状态
List
<
Map
<
String
,
Object
>>
orderHis
=
orderMapper
.
selectOrderHis
(
orderId
);
map
.
put
(
"orderHis"
,
orderHis
);
return
ResponseData
.
success
(
map
);
}
/**
* 验证订单
*
* @param orderId
* @return
*/
public
ResponseData
<
String
>
verification
(
String
orderId
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"id"
,
orderId
);
List
list
=
orderMapper
.
selectList
(
wrapper
);
if
(
list
.
size
()
==
1
)
{
return
ResponseData
.
success
(
"ok"
);
}
else
if
(
list
.
size
()
==
0
)
{
return
ResponseData
.
error
(
"订单不存在!"
);
}
else
{
return
ResponseData
.
error
(
"订单异常!"
);
}
}
}
common/src/main/java/com/winsun/bean/activity/HhrActivityRecord.java
View file @
3be68019
...
...
@@ -28,7 +28,7 @@ public class HhrActivityRecord implements Serializable{
/**
* 活动积分
*/
private
int
recordIntegral
;
private
Integer
recordIntegral
;
/**
* 活动记录审核状态
...
...
common/src/main/java/com/winsun/mapper/activity/ActivityMapper.java
View file @
3be68019
package
com
.
winsun
.
mapper
.
activity
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.winsun.bean.Page
;
import
com.winsun.bean.activity.HhrActivity
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.session.RowBounds
;
import
org.springframework.stereotype.Component
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.winsun.bean.activity.HhrActivity
;
import
java.util.List
;
import
java.util.Map
;
/**
* 合伙人用户表的Mapper
...
...
@@ -12,4 +17,14 @@ import com.winsun.bean.activity.HhrActivity;
@Mapper
@Component
public
interface
ActivityMapper
extends
BaseMapper
<
HhrActivity
>
{
/**
* 移动端查询活动列表
* @param subName
* @param subClass
* @param activityType
* @return
*/
List
<
Map
<
String
,
Object
>>
mobileSelectActivityList
(
RowBounds
rowBounds
,
@Param
(
"subName"
)
String
subName
,
@Param
(
"subClass"
)
String
subClass
,
@Param
(
"activityType"
)
String
activityType
);
}
common/src/main/resources/com/winsun/mapper/mapping/ActivityMapper.xml
0 → 100644
View file @
3be68019
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.winsun.mapper.activity.ActivityMapper"
>
<select
id=
"mobileSelectActivityList"
resultType=
"HashMap"
parameterType=
"String"
>
SELECT
id AS id,
title,
`desc`,
integral,
image_url AS imageUrl,
activity_type AS activityType,
subclass,
sub_name AS subName,
sub_school AS subSchool,
`range`,
`status`,
sort,
is_sub_name AS isSubName,
create_time AS createTime,
creator,
update_time AS updateTime,
del_flag AS delFlag
FROM
hhr_activity
WHERE
(del_flag = 0 AND status = 1
<if
test=
"activityType != null and activityType != ''"
>
AND activity_type = #{activityType}
</if>
)
AND (`range` = '全市' OR `range` = #{subName})
AND (is_sub_name = 0 OR (is_sub_name = 1 AND sub_name = #{subName}))
<if
test=
"subClass != null and subClass != ''"
>
AND (subclass = #{subClass})
</if>
</select>
</mapper>
\ No newline at end of file
service-manager/src/main/java/com/winsun/controller/ActivityController.java
View file @
3be68019
...
...
@@ -5,7 +5,9 @@ import java.util.List;
import
java.util.Map
;
import
java.util.UUID
;
import
com.winsun.bean.School
;
import
com.winsun.mapper.HhrUserMapper
;
import
com.winsun.mapper.SchoolMapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -46,6 +48,9 @@ public class ActivityController extends BaseController {
@Autowired
private
HhrUserMapper
hhrUserMapper
;
@Autowired
private
SchoolMapper
schoolMapper
;
@Permission
(
menuname
=
"查询活动信息"
,
value
=
"list"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
Page
<
HhrActivity
>>
list
(
@RequestParam
(
"title"
)
String
title
,
@RequestParam
(
"activityType"
)
String
activityType
,
@RequestParam
(
"subclass"
)
String
subclass
,
...
...
@@ -213,7 +218,7 @@ public class ActivityController extends BaseController {
*/
@Permission
(
menuname
=
"获取活动列表"
,
value
=
"getActivityList"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
Map
<
String
,
Object
>>
getActivityList
(
Integer
pageNo
,
Integer
pageSize
,
String
activityType
,
String
subclass
,
String
status
)
{
try
{
Wrapper
<
HhrActivity
>
wrapper
=
new
EntityWrapper
<
HhrActivity
>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
activityType
),
"activity_type"
,
activityType
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
subclass
),
"subclass"
,
subclass
);
...
...
@@ -226,6 +231,49 @@ public class ActivityController extends BaseController {
resultMap
.
put
(
"activityList"
,
list
);
return
ResponseData
.
success
(
resultMap
,
"查询成功"
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
ResponseData
.
error
(
"查询失败!"
);
}
}
/**
* 移动端获取活动列表
* @return
*/
@Permission
(
menuname
=
"获取活动列表"
,
value
=
"mobileGetActivityList"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
Map
<
String
,
Object
>>
mobileGetActivityList
(
Integer
pageNo
,
Integer
pageSize
,
String
activityType
,
String
subclass
,
String
status
)
{
ShiroUser
shiroUser
=
getShiroUser
();
String
s
=
schoolMapper
.
selectSchoolIdByUserId
(
shiroUser
.
getId
()
+
""
);
if
(
StringUtils
.
isBlank
(
s
))
{
return
ResponseData
.
error
(
"请先设置所在学校"
);
}
if
(
shiroUser
==
null
||
shiroUser
.
getId
()
==
null
)
{
return
ResponseData
.
error
(
"查询列表失败!"
);
}
School
school
=
schoolMapper
.
selectById
(
s
);
if
(
school
==
null
)
{
return
ResponseData
.
error
(
"学校信息有误"
);
}
try
{
Page
<
HhrActivity
>
page
=
new
Page
<>(
pageNo
==
null
?
1
:
pageNo
,
pageSize
==
null
?
10
:
pageSize
);
List
<
Map
<
String
,
Object
>>
maps
=
activityMapper
.
mobileSelectActivityList
(
page
,
school
.
getSubName
(),
subclass
,
activityType
);
resultMap
.
put
(
"activityList"
,
maps
);
return
ResponseData
.
success
(
resultMap
,
"查询成功!"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseData
.
error
(
"查询失败!"
);
}
}
/**
...
...
service-manager/src/main/java/com/winsun/controller/ActivityRecordController.java
View file @
3be68019
...
...
@@ -10,6 +10,7 @@ import java.util.Map;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
com.winsun.utils.PicturesUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -112,7 +113,7 @@ public class ActivityRecordController extends BaseController {
map
.
put
(
"creator"
,
activityRecord
.
getCreator
());
map
.
put
(
"message"
,
activityRecord
.
getMessage
());
map
.
put
(
"createTime"
,
activityRecord
.
getCreateTime
());
map
.
put
(
"imageUrl"
,
activityRecord
.
getImageUrl
());
newList
.
add
(
map
);
}
}
...
...
@@ -132,13 +133,17 @@ public class ActivityRecordController extends BaseController {
@Permission
(
menuname
=
"审核活动参与记录"
,
value
=
"auditActivityRecord"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
auditActivityRecord
(
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
"status"
)
String
status
,
@RequestParam
(
"integral"
)
String
integral
,
@RequestParam
(
"status"
)
String
status
,
@RequestParam
(
"integral"
)
Integer
integral
,
@RequestParam
(
"remark"
)
String
remark
){
HhrActivityRecord
activityRecord
=
new
HhrActivityRecord
();
activityRecord
.
setId
(
id
);
activityRecord
.
setStatus
(
status
);
activityRecord
.
setRecordIntegral
(
Integer
.
parseInt
(
integral
));
if
(
"3"
.
equals
(
status
))
{
activityRecord
.
setRecordIntegral
(
0
);
}
else
{
activityRecord
.
setRecordIntegral
(
integral
);
}
activityRecord
.
setRemark
(
remark
);
activityRecord
.
setUpdateTime
(
new
Date
());
int
num
=
activityRecordMapper
.
updateById
(
activityRecord
);
...
...
@@ -167,6 +172,7 @@ public class ActivityRecordController extends BaseController {
List
<
HhrActivity
>
listActivity
=
activityMapper
.
selectList
(
wrapperActivity
);
Wrapper
<
HhrActivityRecord
>
wrapperRecord
=
new
EntityWrapper
<
HhrActivityRecord
>();
wrapperRecord
.
eq
(
"status"
,
2
);
List
<
HhrActivityRecord
>
listRecord
=
activityRecordMapper
.
selectList
(
wrapperRecord
);
Wrapper
<
SysUser
>
wrapperUser
=
new
EntityWrapper
<
SysUser
>();
...
...
@@ -183,15 +189,14 @@ public class ActivityRecordController extends BaseController {
String
userId
=
sysUser
.
getId
();
if
(
null
!=
refMap
.
get
(
userId
))
{
for
(
School
school
:
schoolList
)
{
if
(
refMap
.
get
(
userId
).
toString
().
equals
(
school
.
getId
()))
{
if
(
refMap
.
get
(
userId
).
toString
().
equals
(
school
.
getId
()
+
""
))
{
sysUser
.
setSubstName
(
school
.
getSubName
());
sysUser
.
setSchoolName
(
school
.
getS
ub
Name
());
sysUser
.
setSchoolName
(
school
.
getS
chool
Name
());
}
}
}
}
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<>(
pageIndex
,
pageSize
);
List
<
Map
<
String
,
Object
>>
newList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
HhrActivityRecord
activityRecord
:
listRecord
)
{
...
...
@@ -356,19 +361,27 @@ public class ActivityRecordController extends BaseController {
*
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"addActivityRecord"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
getActivityInfo
(
String
id
,
String
message
,
String
imageUrl
)
{
@Permission
(
menuname
=
"添加活动参与记录"
,
value
=
"addActivityRecord"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
getActivityInfo
(
String
activityId
,
String
message
,
String
imageUrl
)
{
ShiroUser
user
=
getShiroUser
();
if
(
user
==
null
)
{
return
ResponseData
.
error
(
"当前用户登录失败!"
);
}
if
(
StringUtils
.
isNotBlank
(
imageUrl
))
{
return
ResponseData
.
error
(
"请上传图片"
);
}
HhrActivityRecord
activityRecord
=
new
HhrActivityRecord
();
activityRecord
.
setActivityId
(
i
d
);
activityRecord
.
setActivityId
(
activityI
d
);
activityRecord
.
setMessage
(
message
);
activityRecord
.
setImageUrl
(
imageUrl
);
activityRecord
.
setImageUrl
(
PicturesUtil
.
uploadPictures
(
imageUrl
,
new
Date
().
getTime
()
+
""
,
"activity"
)
);
activityRecord
.
setCreateId
(
Integer
.
toString
(
user
.
getId
()));
activityRecord
.
setCreator
(
user
.
getName
());
activityRecord
.
setCreateTime
(
new
Date
());
activityRecord
.
setRecordIntegral
(
0
);
activityRecord
.
setStatus
(
"1"
);
int
num
=
activityRecordMapper
.
insert
(
activityRecord
);
if
(
num
>
0
)
{
return
ResponseData
.
success
(
"提交成功!"
);
...
...
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