活动功能优化。

This commit is contained in:
Renpc-kilig 2023-02-03 14:33:38 +08:00
parent 2b8e4189ef
commit ce40c998ca
13 changed files with 175 additions and 130 deletions

View File

@ -67,7 +67,7 @@ public class ActivityJoinAppController extends DefaultBaseController {
@PutMapping("updateactivityjoin/{activityJoinId}")
@CheckRequestBodyAnnotation
public SuccessResult updateActivityJoin(@RequestHeader("token") String token, @PathVariable("activityJoinId") String activityJoinId, @RequestBody ActivityJoinVO activityJoinVO) {
activityJoinService.update(token, activityJoinId, activityJoinVO);
activityJoinService.updateApp(token, activityJoinId, activityJoinVO);
return new SuccessResult();
}
@ -118,4 +118,29 @@ public class ActivityJoinAppController extends DefaultBaseController {
return new SuccessResultData<>(activityJoinService.count(params));
}
@ApiOperation(value = "报名人员列表", notes = "列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "activityJoinId", value = "报名id", paramType = "path", dataType = "String"),
@ApiImplicitParam(name = "activityId", value = "活动id", paramType = "path", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listAll")
public List<ActivityJoinDTO> listAll(@RequestHeader("token") String token) {
Map<String, Object> params = requestParams();
return activityJoinService.listAll(params);
}
@ApiOperation(value = "父级列表", notes = "列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "activityId", value = "活动id", paramType = "path", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listParent")
public List<ActivityJoinDTO> listParent(@RequestHeader("token") String token) {
Map<String, Object> params = requestParams();
return activityJoinService.listParent(params);
}
}

View File

@ -117,4 +117,10 @@ public interface IActivityDao {
*/
Integer count(Map<String, Object> params) throws SearchException;
/**
* 删除某活动下的某组报名信息
* @param params
* @throws UpdateException
*/
void deleteAll(Map<String, Object> params) throws UpdateException;
}

View File

@ -117,4 +117,11 @@ public interface IActivityJoinDao {
*/
Integer count(Map<String, Object> params) throws SearchException;
/**
* 获取报名列表(某一活动下的某组数据)
* @param params
* @return
* @throws SearchException
*/
List<ActivityJoinDTO> listAll(Map<String, Object> params) throws SearchException;
}

View File

@ -42,25 +42,27 @@ public class ActivityJoinDTO {
private String gmtModified;
@ApiModelProperty(name = "isDelete", value = "")
private Integer isDelete;
@ApiModelProperty(name = "activityName", value = "活动名称")
private String activityName;
public String getActivityJoinId() {
return activityJoinId == null ? "" : activityJoinId.trim();
return activityJoinId;
}
public void setActivityJoinId(String activityJoinId) {
this.activityJoinId = activityJoinId;
}
public String getActivityD() {
return activityId == null ? "" : activityId.trim();
public String getActivityId() {
return activityId;
}
public void setActivityD(String activityD) {
this.activityId = activityD;
public void setActivityId(String activityId) {
this.activityId = activityId;
}
public String getName() {
return name == null ? "" : name.trim();
return name;
}
public void setName(String name) {
@ -68,7 +70,7 @@ public class ActivityJoinDTO {
}
public String getCardNum() {
return cardNum == null ? "" : cardNum.trim();
return cardNum;
}
public void setCardNum(String cardNum) {
@ -76,7 +78,7 @@ public class ActivityJoinDTO {
}
public String getUserType() {
return userType == null ? "" : userType.trim();
return userType;
}
public void setUserType(String userType) {
@ -84,7 +86,7 @@ public class ActivityJoinDTO {
}
public String getPhone() {
return phone == null ? "" : phone.trim();
return phone;
}
public void setPhone(String phone) {
@ -92,7 +94,7 @@ public class ActivityJoinDTO {
}
public String getRemake() {
return remake == null ? "" : remake.trim();
return remake;
}
public void setRemake(String remake) {
@ -100,7 +102,7 @@ public class ActivityJoinDTO {
}
public String getParentId() {
return parentId == null ? "" : parentId.trim();
return parentId;
}
public void setParentId(String parentId) {
@ -108,7 +110,7 @@ public class ActivityJoinDTO {
}
public Integer getOrderNum() {
return orderNum == null ? 0 : orderNum;
return orderNum;
}
public void setOrderNum(Integer orderNum) {
@ -116,7 +118,7 @@ public class ActivityJoinDTO {
}
public String getCreator() {
return creator == null ? "" : creator.trim();
return creator;
}
public void setCreator(String creator) {
@ -124,7 +126,7 @@ public class ActivityJoinDTO {
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
return gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
@ -132,7 +134,7 @@ public class ActivityJoinDTO {
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
return modifier;
}
public void setModifier(String modifier) {
@ -140,7 +142,7 @@ public class ActivityJoinDTO {
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
return gmtModified;
}
public void setGmtModified(String gmtModified) {
@ -148,12 +150,18 @@ public class ActivityJoinDTO {
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
return isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
public String getActivityName() {
return activityName;
}
public void setActivityName(String activityName) {
this.activityName = activityName;
}
}

View File

@ -185,4 +185,9 @@ public interface IActivityJoinService {
*/
Integer count(Map<String, Object> params);
List<ActivityJoinDTO> listAll(Map<String, Object> params);
void updateApp(String token, String activityJoinId, ActivityJoinVO activityJoinVO);
List<ActivityJoinDTO> listParent(Map<String, Object> params);
}

View File

@ -1,5 +1,7 @@
package cn.com.tenlion.usercenter.service.activityjoin.impl;
import cn.com.tenlion.usercenter.dao.activity.IActivityDao;
import cn.com.tenlion.usercenter.pojo.dtos.activity.ActivityDTO;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResult;
@ -32,6 +34,8 @@ public class ActivityJoinServiceImpl extends DefaultBaseService implements IActi
@Autowired
private IActivityJoinDao activityJoinDao;
@Autowired
private IActivityDao activityDao;
@Override
public void save(ActivityJoinVO activityJoinVO) {
@ -55,10 +59,10 @@ public class ActivityJoinServiceImpl extends DefaultBaseService implements IActi
if(activityJoinVOList.size() > 0) {
for(ActivityJoinVO activityJoinVO1: activityJoinVOList) {
activityJoinVO1.setParentId(activityId);
if(StringUtils.isEmpty(activityJoinVO.getPhone())) {
if(!StringUtils.isEmpty(activityJoinVO.getPhone())) {
activityJoinVO1.setPhone(activityJoinVO.getPhone());
}
if(StringUtils.isEmpty(activityJoinVO.getRemake())) {
if(!StringUtils.isEmpty(activityJoinVO.getRemake())) {
activityJoinVO1.setRemake(activityJoinVO.getRemake());
}
saveReturnId(token, activityJoinVO1);
@ -160,7 +164,14 @@ public class ActivityJoinServiceImpl extends DefaultBaseService implements IActi
@Override
public List<ActivityJoinDTO> list(Map<String, Object> params) {
return activityJoinDao.list(params);
List<ActivityJoinDTO> list = activityJoinDao.list(params);
ActivityDTO activityDTO = activityDao.get(params);
if(list.size() > 0) {
for (ActivityJoinDTO activityJoinDTO : list) {
activityJoinDTO.setActivityName(activityDTO.getName());
}
}
return list;
}
@Override
@ -187,4 +198,24 @@ public class ActivityJoinServiceImpl extends DefaultBaseService implements IActi
return count == null ? 0 : count;
}
@Override
public List<ActivityJoinDTO> listAll(Map<String, Object> params) {
return activityJoinDao.listAll(params);
}
@Override
public void updateApp(String token, String activityJoinId, ActivityJoinVO activityJoinVO) {
Map<String, Object> params = new HashMap<>(2);
params.put("activityJoinId", activityJoinId);
activityDao.deleteAll(params);
setData(token, activityJoinVO);
}
@Override
public List<ActivityJoinDTO> listParent(Map<String, Object> params) {
params.put("listParent", "yes");
return list(params);
}
}

View File

@ -114,6 +114,15 @@
</foreach>
</update>
<!-- 删除(物理) -->
<update id="deleteAll" parameterType="map">
DELETE FROM
m_activity_join
WHERE
activity_join_id = #{activityJoinId}
OR parent_id = #{activityJoinId}
</update>
<!-- 修改 -->
<update id="update" parameterType="map">
UPDATE
@ -248,9 +257,14 @@
m_activity_join t1
WHERE
t1.is_delete = 0
<if test="activityId != null and activityId != ''">
AND t1.activity_id = #{activityId}
</if>
<if test="listParent != null and listParent != ''">
AND t1.parent_id = ''
</if>
<if test="keywords != null and keywords != ''">
AND (
<!-- 这里添加其他条件 -->
t1.id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
@ -271,6 +285,38 @@
</if>
</select>
<!-- 列表 -->
<select id="listAll" parameterType="map" resultMap="activityJoinDTO">
SELECT
t1.activity_join_id,
t1.activity_id,
t1.name,
t1.card_num,
t1.user_type,
t1.phone,
t1.remake,
t1.parent_id,
t1.order_num,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete,
1
FROM
m_activity_join t1
LEFT JOIN m_activity_join t2 ON t1.activity_id = t2.parent_id AND t2.is_delete = 0
WHERE
t1.is_delete = 0
<if test="activityId != null and activityId != ''">
AND t1.activity_id = #{activityId}
</if>
<if test="activityJoinId != null and activityJoinId != ''">
AND t1.activity_join_id = #{activityJoinId}
</if>
ORDER BY order_num ASC
</select>
<!-- 列表 -->
<select id="listBO" parameterType="map" resultMap="activityJoinBO">
SELECT

View File

@ -233,6 +233,7 @@
#{activityResponsibleIds[${index}]}
</foreach>
</if>
ORDER BY order_num ASC
</select>
<!-- 列表 -->

View File

@ -66,7 +66,7 @@
var laydate = layui.laydate;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/activity-join/listpage';
var tableUrl = 'api/activity-join/listpage?activityId={activityId}';
var activityId = top.restAjax.params(window.location.href).activityId;
// 初始化表格
@ -74,7 +74,7 @@
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, []),
url: top.restAjax.path(tableUrl, [activityId]),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
@ -141,24 +141,6 @@
}
return rowData;
}
},
{field: 'parentId', width: 180, title: '父ID', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'orderNum', width: 180, title: '排序', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
}
]
],

View File

@ -21,12 +21,6 @@
</div>
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item">
<label class="layui-form-label">活动ID</label>
<div class="layui-input-block">
<input type="text" id="activityD" name="activityD" class="layui-input" value="" placeholder="请输入活动ID" maxlength="36">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">姓名</label>
<div class="layui-input-block">
@ -37,38 +31,28 @@
<label class="layui-form-label">身份证</label>
<div class="layui-input-block">
<input type="text" id="cardNum" name="cardNum" class="layui-input" value="" placeholder="请输入身份证" maxlength="255">
<input type="hidden" id="orderNum" name="orderNum" class="layui-input" value="">
</div>
</div>
<div class="layui-form-item">
<div class="layui-form-item" pane>
<label class="layui-form-label">人员类型</label>
<div class="layui-input-block">
<input type="text" id="userType" name="userType" class="layui-input" value="" placeholder="请输入人员类型" maxlength="255">
<input type="radio" name="userType" value="适龄公民" title="适龄公民" checked>
<input type="radio" name="userType" value="非适龄公民" title="非适龄公民">
</div>
</div>
<div class="layui-form-item">
<div class="layui-form-item" id="phoneDiv">
<label class="layui-form-label">联系方式</label>
<div class="layui-input-block">
<input type="text" id="phone" name="phone" class="layui-input" value="" placeholder="请输入联系方式" maxlength="255">
</div>
</div>
<div class="layui-form-item">
<div class="layui-form-item" id="remakeDiv">
<label class="layui-form-label">备注留言</label>
<div class="layui-input-block">
<input type="text" id="remake" name="remake" class="layui-input" value="" placeholder="请输入备注留言" maxlength="500">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">父ID</label>
<div class="layui-input-block">
<input type="text" id="parentId" name="parentId" class="layui-input" value="" placeholder="请输入父ID" maxlength="36">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label>
<div class="layui-input-block">
<input type="number" id="orderNum" name="orderNum" class="layui-input" value="" placeholder="请输入排序" lay-verify="required">
</div>
</div>
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
@ -99,9 +83,6 @@
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
// 初始化内容
function initData() {
var loadLayerIndex;
@ -110,6 +91,13 @@
for(var i in data) {
dataFormData[i] = data[i] +'';
}
if(!data['parentId']) {
$('#phoneDiv').show();
$('#remakeDiv').show();
}else {
$('#phoneDiv').hide();
$('#remakeDiv').hide();
}
form.val('dataForm', dataFormData);
form.render(null, 'dataForm');
}, function(code, data) {

View File

@ -87,15 +87,6 @@
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'activityResponsibleId', width: 180, title: '主键UUID', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'titlePhoto', width: 180, title: '标题图片', align:'center',
templet: function(row) {
var rowData = row[this.field];
@ -156,52 +147,7 @@
}
return rowData;
}
},
{field: 'creator', width: 180, title: '', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'gmtCreate', width: 180, title: '', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'modifier', width: 180, title: '', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'gmtModified', width: 180, title: '', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'isDelete', width: 180, title: '', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
]
],
page: true,

View File

@ -42,7 +42,7 @@
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 9) { }}
{{# if(d[fileName].length < 1) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="标题图片" data-name="titlePhoto" lay-filter="titlePhotoUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
@ -72,7 +72,7 @@
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 9) { }}
{{# if(d[fileName].length < 1) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="标题图标" data-name="titleIcon" lay-filter="titleIconUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
@ -276,7 +276,7 @@
// 初始化描述富文本
function initDescriptionRichText() {
var editor = new wangEditor('#description');
editor.customConfig.zIndex = 1000;
editor.customConfig.zIndex = 0;
editor.customConfig.uploadImgMaxSize = 5 * 1024 * 1024;
editor.customConfig.uploadImgMaxLength = 1;
editor.customConfig.uploadFileName = 'image';
@ -299,7 +299,7 @@
// 初始化内容富文本
function initContentRichText() {
var editor = new wangEditor('#content');
editor.customConfig.zIndex = 1000;
editor.customConfig.zIndex = 0;
editor.customConfig.uploadImgMaxSize = 5 * 1024 * 1024;
editor.customConfig.uploadImgMaxLength = 1;
editor.customConfig.uploadFileName = 'image';

View File

@ -42,7 +42,7 @@
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 9) { }}
{{# if(d[fileName].length < 1) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="标题图片" data-name="titlePhoto" lay-filter="titlePhotoUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
@ -72,7 +72,7 @@
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 9) { }}
{{# if(d[fileName].length < 1) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="标题图标" data-name="titleIcon" lay-filter="titleIconUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
@ -278,7 +278,7 @@
// 初始化描述富文本
function initDescriptionRichText(value) {
var editor = new wangEditor('#description');
editor.customConfig.zIndex = 1000;
editor.customConfig.zIndex = 0;
editor.customConfig.uploadImgMaxSize = 5 * 1024 * 1024;
editor.customConfig.uploadImgMaxLength = 1;
editor.customConfig.uploadFileName = 'image';
@ -302,7 +302,7 @@
// 初始化内容富文本
function initContentRichText(value) {
var editor = new wangEditor('#content');
editor.customConfig.zIndex = 1000;
editor.customConfig.zIndex = 0;
editor.customConfig.uploadImgMaxSize = 5 * 1024 * 1024;
editor.customConfig.uploadImgMaxLength = 1;
editor.customConfig.uploadFileName = 'image';