commit
This commit is contained in:
@@ -34,6 +34,7 @@ RoleConstant {
|
||||
BRANCH_UNION_CHAIRMAN("分工会主席"),
|
||||
BRANCH_UNION_VICE_CHAIRMAN("分工会副主席"),
|
||||
BRANCH_UNION_OPERATOR("分工会操作员"),
|
||||
BRANCH_UNION_MANAGER("机关分工会负责人"),
|
||||
BRANCH_UNION_GROUP_LEADER("工会小组组长"),
|
||||
BRANCH_UNION_ARTICLE_WRITER("分工会新闻投稿员"),
|
||||
BRANCH_UNION_WY("分工会委员"),
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.budwk.app.base.sms.SmsService;
|
||||
import com.budwk.app.base.sms.impl.hgu.util.SignUtil;
|
||||
import com.budwk.app.web.commons.base.Globals;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
@@ -47,13 +48,6 @@ public class SmsHguServiceImpl implements SmsService {
|
||||
doSend(title, content, receivers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果要发链接的消息,请以html的形式写在content中,就这么规定的,我也没办法
|
||||
* channels,多个使用英文逗号进行分隔.一般情况下短信id是1;邮件是2;app消息是3;微信是4;钉钉是5;welink是6,目前先写死微信通道了
|
||||
* @param title
|
||||
* @param content
|
||||
* @param receivers
|
||||
*/
|
||||
private void doSend(String title, String content, List<Map<String, String>> receivers) {
|
||||
// 随机字符串
|
||||
String nonce = R.UU32();
|
||||
@@ -75,27 +69,30 @@ public class SmsHguServiceImpl implements SmsService {
|
||||
|
||||
log.debug("send params: {}", Json.toJson(paramsMap));
|
||||
|
||||
HttpRequest request = HttpRequest.post(URL)
|
||||
.header("sd-appid", APPID)
|
||||
.header("sd-algorithm", SignUtil.ALGORITHM_SHA1)
|
||||
.header("sd-timestamp", String.valueOf(timestamp))
|
||||
.header("sd-nonce", nonce)
|
||||
.header("sd-signature", signature)
|
||||
.body(Json.toJson(paramsMap));
|
||||
if (Globals.MyConfig.getBoolean("AppSms")){
|
||||
HttpRequest request = HttpRequest.post(URL)
|
||||
.header("sd-appid", APPID)
|
||||
.header("sd-algorithm", SignUtil.ALGORITHM_SHA1)
|
||||
.header("sd-timestamp", String.valueOf(timestamp))
|
||||
.header("sd-nonce", nonce)
|
||||
.header("sd-signature", signature)
|
||||
.body(Json.toJson(paramsMap));
|
||||
|
||||
try {
|
||||
HttpResponse response = request.execute();
|
||||
NutMap bodyMap = Json.fromJson(NutMap.class, response.body());
|
||||
NutMap resultMap = bodyMap.getAs("result", NutMap.class);
|
||||
NutMap dataMap = resultMap.getAs("data", NutMap.class);
|
||||
log.info("send response body: {}", response.body());
|
||||
if(dataMap.getBoolean("successed")) {
|
||||
log.info("send success code: {}, successed: {}", dataMap.getInt("code"), dataMap.getBoolean("successed"));
|
||||
} else {
|
||||
log.error("send error code: {}, successed: {}", dataMap.getInt("code"), dataMap.getBoolean("successed"));
|
||||
try {
|
||||
HttpResponse response = request.execute();
|
||||
NutMap bodyMap = Json.fromJson(NutMap.class, response.body());
|
||||
NutMap resultMap = bodyMap.getAs("result", NutMap.class);
|
||||
NutMap dataMap = resultMap.getAs("data", NutMap.class);
|
||||
log.info("send response body: {}", response.body());
|
||||
if(dataMap.getBoolean("successed")) {
|
||||
log.info("send success code: {}, successed: {}", dataMap.getInt("code"), dataMap.getBoolean("successed"));
|
||||
} else {
|
||||
log.error("send error code: {}, successed: {}", dataMap.getInt("code"), dataMap.getBoolean("successed"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to send: {}", e.getMessage(), e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to send: {}", e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.budwk.app.flow.enums;
|
||||
|
||||
import com.budwk.app.base.annotation.DictEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
@@ -9,6 +11,7 @@ import lombok.Getter;
|
||||
* @date 2023/10/7
|
||||
*/
|
||||
@Getter
|
||||
@DictEnum(key = "ProcessSubmitTypeEnum", name = "流程提交类型(操作类型)")
|
||||
public enum ProcessSubmitTypeEnum {
|
||||
APPLY(0, "发起申请"),
|
||||
AGREE(1, "同意"),
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.constant;
|
||||
|
||||
import com.budwk.app.base.annotation.DictEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/11/18
|
||||
* @Description
|
||||
*/
|
||||
@Getter
|
||||
@DictEnum(key = "ColumnFormTypeEnum", name = "控件类型")
|
||||
@AllArgsConstructor
|
||||
public enum ColumnFormTypeEnum {
|
||||
|
||||
INPUT("INPUT", "输入框"),
|
||||
SELECT("SELECT", "选择框"),
|
||||
STEPPER("STEPPER", "步进器"),
|
||||
//RADIO("RADIO", "单选框"),//选项数组
|
||||
FILE("FILE", "文件");
|
||||
|
||||
private String code;
|
||||
private String description;
|
||||
}
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.controller.manage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipActivity;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipActivityCourse;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipUser;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipUserCourse;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityService;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityStatisticsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/9/21
|
||||
* @Description 人员调整
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "交友联谊人员调整")
|
||||
@At("/platform/fellowship/adjust")
|
||||
public class FellowshipAdjustController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private FellowshipActivityService fellowshipActivityManageService;
|
||||
@Inject
|
||||
private FellowshipActivityStatisticsService fellowshipActivityStatisticsService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("fellowship.adjust")
|
||||
@Ok("beetl:/platform/zhgh/activity/fellowship/userAdjust/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动list
|
||||
* @param year 年度
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ApiOperation("活动列表")
|
||||
@SaCheckPermission("fellowship.adjust")
|
||||
public Result activityList(@Param(value = "year") Integer year) {
|
||||
List<FellowshipActivity> activityList = dao.query(FellowshipActivity.class, Cnd.NEW().andEX("year", "=", year).andEX("isDisabled", "=", false).desc("activityStartTime"));
|
||||
return Result.success(activityList);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("fellowship.adjust")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "activityId") String activityId) {
|
||||
Pagination pagination = fellowshipActivityStatisticsService.pageData(pageForm, activityId);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("子活动查询")
|
||||
@SaCheckPermission("fellowship.adjust")
|
||||
public Result getCourse(String activityId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
tsuc.id,
|
||||
tsuc.courseName,
|
||||
tsuc.coursePeopleNumber,
|
||||
tsuc.courseType,
|
||||
tsuc.courseLocation,
|
||||
tsuc.courseInstructor,
|
||||
tsuc.courseReservedNumber,
|
||||
tsuc.waitingNum,
|
||||
tsuc.reserveMode
|
||||
FROM
|
||||
`fellowship_course` tsuc
|
||||
WHERE
|
||||
tsuc.activityId = @activityId
|
||||
ORDER BY courseName asc
|
||||
""");
|
||||
sql.setParam("activityId", activityId);
|
||||
List<NutMap> courseList = baseService.listMap(sql);
|
||||
courseList.forEach(c -> {
|
||||
c.put("registerNum", fellowshipActivityStatisticsService.queryCourseCount(c.getString("id"), c.getString("courseType")));
|
||||
c.put("hasWaitingNum", fellowshipActivityStatisticsService.queryCourseWaitCount(c.getString("id"), c.getString("courseType")));
|
||||
});
|
||||
return Result.success(courseList);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("报名用户列表")
|
||||
@SaCheckPermission("fellowship.adjust")
|
||||
public Result registerUserList(@Param("courseId") String courseId,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "searchName") String searchName,
|
||||
@Param(value = "searchKeyword") String searchKeyword) {
|
||||
List<NutMap> list = fellowshipActivityStatisticsService.registerUserList(courseId, unionId, unitId, searchName, searchKeyword);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("人员调整")
|
||||
@SaCheckPermission("fellowship.adjust")
|
||||
@SLog(tag = "交友联谊-人员调整", msg = "人员调整")
|
||||
public Result adjust(String activityId, String oldCourseId, String newCourseId, String userId) {
|
||||
|
||||
Cnd oldCnd = Cnd.where("activityId", "=", activityId)
|
||||
.and("courseId", "=", oldCourseId).and("userId", "=", userId);
|
||||
|
||||
Cnd newCnd = Cnd.where("activityId", "=", activityId)
|
||||
.and("courseId", "=", newCourseId).and("userId", "=", userId);
|
||||
|
||||
//旧的报名信息
|
||||
FellowshipUser oldfellowshipUser = dao.fetch(FellowshipUser.class, oldCnd);
|
||||
oldfellowshipUser.setCourseId(newCourseId);
|
||||
oldfellowshipUser.setSignUpTime(DateUtil.date());
|
||||
dao.update(oldfellowshipUser);
|
||||
|
||||
//新的课程的信息,上课时间
|
||||
List<FellowshipActivityCourse> activityCourseList = dao.query(FellowshipActivityCourse.class, Cnd.where("activityId", "=", activityId)
|
||||
.and("courseId", "=", newCourseId));
|
||||
//先清楚旧的信息
|
||||
dao.clear(FellowshipUserCourse.class, oldCnd);
|
||||
//添加新的信息
|
||||
List<FellowshipUserCourse> fellowshipUserCourseList = new ArrayList<>();
|
||||
activityCourseList.forEach(item -> {
|
||||
FellowshipUserCourse course = new FellowshipUserCourse();
|
||||
course.setActivityCourseId(activityId);
|
||||
course.setCourseId(newCourseId);
|
||||
course.setUserId(userId);
|
||||
course.setCourseStartTime(item.getCourseStartTime());
|
||||
course.setCourseEndTime(item.getCourseEndTime());
|
||||
course.setActivityCourseId(item.getId());
|
||||
fellowshipUserCourseList.add(course);
|
||||
});
|
||||
dao.insert(fellowshipUserCourseList);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除报名人员")
|
||||
@SaCheckPermission("fellowship.adjust")
|
||||
@SLog(tag = "交友联谊-人员调整", msg = "删除报名人员")
|
||||
public Result deleteSignUser(String activityId, String courseId, String userId) {
|
||||
|
||||
//删除
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("activityId", "=", activityId);
|
||||
cnd.and("courseId", "=", courseId);
|
||||
cnd.and("userId", "=", userId);
|
||||
|
||||
dao.clear(FellowshipUser.class, cnd);
|
||||
dao.clear(FellowshipUserCourse.class, cnd);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+437
@@ -0,0 +1,437 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.controller.manage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.ConditionGroupUtil;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.*;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityService;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityStatisticsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "活动报名")
|
||||
@At("/platform/fellowship/apply")
|
||||
public class FellowshipApplyController {
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock(true);
|
||||
|
||||
@Inject
|
||||
private FellowshipActivityService fellowshipActivityService;
|
||||
@Inject
|
||||
private SysDictService dictService;
|
||||
@Inject
|
||||
private FellowshipActivityStatisticsService statisticsService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("fellowship.apply")
|
||||
@Ok("beetl:/platform/zhgh/activity/fellowship/apply/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.fellowship.apply")
|
||||
@Ok("beetl:/platform/zhghh5/activity/fellowship/apply/index.html")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At("/list/h5")
|
||||
@SaCheckPermission("h5.fellowship.apply")
|
||||
@Ok("beetl:/platform/zhghh5/activity/fellowship/list/index.html")
|
||||
public void listIndex() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("活动查询")
|
||||
@SaCheckPermission(value = {"fellowship.apply", "h5.fellowship.apply"}, mode = SaMode.OR)
|
||||
public Result activityPageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "activityType") Integer activityType,
|
||||
@Param(value = "id") String id,
|
||||
@Param(value = "dataType") String dataType) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("id", "=", id);
|
||||
cnd.andEX("`year`", "=", year);
|
||||
//查询报名中
|
||||
if (activityType == 2) {
|
||||
cnd.and(new Static("now() < activitySignUpEndTime"));
|
||||
}//查询已结束的
|
||||
else if (activityType == 3) {
|
||||
cnd.and(new Static("now() >= activityEndTime"));
|
||||
}
|
||||
|
||||
if (AuthUtil.hasRole("H04") && !AuthUtil.hasRoleOr("sysadmin, A06")) {
|
||||
cnd.and("activityMode", "=", 2).and("createdBy", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
|
||||
if("mine".equals(dataType)) {
|
||||
cnd.and(new Static("id in (select activityId from fellowship_user where userId = '%s')".formatted(SecurityUtil.getUserId())));
|
||||
}
|
||||
|
||||
Pagination pagination = fellowshipActivityService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
List<FellowshipActivity> fellowshipActivities = pagination.getList();
|
||||
Map<String, String> fellowshipTypeMap = dictService.getSubListByCode("FELLOWSHIP_TYPE").stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
|
||||
fellowshipActivities.forEach(v -> v.setTrainType(fellowshipTypeMap.get(v.getTrainType())));
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分活动查询")
|
||||
@SaCheckPermission(value = {"fellowship.apply", "h5.fellowship.apply"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "courseTypeId") String courseTypeId,
|
||||
@Param(value = "activityId") String activityId,
|
||||
@Param(value = "assortTypes") String[] assortTypes,
|
||||
@Param(value = "dataType") String dataType) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
tsuc.id,
|
||||
tsuc.activityId,
|
||||
tsuc.courseName,
|
||||
tsuc.coursePeopleNumber,
|
||||
tsuc.courseLocation,
|
||||
tsuc.courseType,
|
||||
tsuc.courseLocationCoordinates,
|
||||
tsuc.courseReservedNumber,
|
||||
tsuc.courseInstructor,
|
||||
tsuc.campus,
|
||||
tsuc.unionLimit,
|
||||
tsuc.isMobileSign,
|
||||
tsuc.signType,
|
||||
tsuc.isReceiveGift,
|
||||
tsuc.giftType,
|
||||
tsuc.reserveMode,
|
||||
tsuc.waitingNum,
|
||||
tsuc.assort,
|
||||
tsuc.introduce,
|
||||
type.typeName,
|
||||
tsuc.courseIsLimitApply
|
||||
FROM
|
||||
`fellowship_course` tsuc
|
||||
LEFT JOIN fellowship_type type ON type.id = tsuc.courseType
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("type.id", "=", courseTypeId);
|
||||
cnd.and("tsuc.activityId", "=", activityId);
|
||||
|
||||
if (Lang.isNotEmpty(assortTypes)) {
|
||||
cnd.and("tsuc.assort", "in", assortTypes);
|
||||
}
|
||||
|
||||
if("mine".equals(dataType)) {
|
||||
cnd.and(new Static("tsuc.id in (select courseId from fellowship_user where userId = '%s')".formatted(SecurityUtil.getUserId())));
|
||||
}
|
||||
|
||||
List<FellowshipCourse> courseArray = fellowshipActivityService.dao().query(FellowshipCourse.class, Cnd.where("activityId", "=", activityId));
|
||||
courseArray = fellowshipActivityService.filterCourseByHostUnion(courseArray);
|
||||
cnd.and("tsuc.id", "in", courseArray.stream().map(FellowshipCourse::getId).toList());
|
||||
|
||||
cnd.asc("tsuc.orderNum");
|
||||
cnd.asc("type.code");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination pagination = fellowshipActivityService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> courseList = pagination.getList();
|
||||
|
||||
courseList.forEach(c -> {
|
||||
List<FellowshipActivityCourse> courseTimes = dao.query(FellowshipActivityCourse.class, Cnd.where("courseId", "=", c.getString("id")).asc("courseDate"));
|
||||
c.put("courseTimes", courseTimes);
|
||||
|
||||
c.put("hasRegisterNum", statisticsService.queryCourseCount(c.getString("id"), c.getString("courseType")));
|
||||
c.put("hasWaitingNum", statisticsService.queryCourseWaitCount(c.getString("id"), c.getString("courseType")));
|
||||
//当前用户是否报过
|
||||
c.put("isSign", fellowshipActivityService.isSignCourseByUser(c.getString("id"), SecurityUtil.getUserId()));
|
||||
|
||||
if (StrUtil.isNotBlank(c.getString("unionLimit"))) {
|
||||
List<NutMap> unionLimit = Json.fromJsonAsList(NutMap.class, c.getString("unionLimit"));
|
||||
if (Lang.isNotEmpty(unionLimit)) {
|
||||
NutMap nutMap = unionLimit.stream().filter(o -> o.getString("id").equals(SecurityUtil.getUnionId())).findFirst().orElse(null);
|
||||
if (nutMap != null) {
|
||||
c.put("coursePeopleNumber", nutMap.getInt("limitCount"));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("获取分活动时间")
|
||||
@SaCheckPermission(value = {"fellowship.apply", "h5.fellowship.apply"}, mode = SaMode.OR)
|
||||
public Result getCourseTime(String id) {
|
||||
List<FellowshipActivityCourse> list = fellowshipActivityService.dao().query(FellowshipActivityCourse.class, Cnd.where("courseId", "=", id));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询分类标识集合")
|
||||
@SaCheckPermission(value = {"fellowship.apply", "h5.fellowship.apply"}, mode = SaMode.OR)
|
||||
public Result queryCourseAssort(String activityId) {
|
||||
List<FellowshipCourse> courseList = fellowshipActivityService.dao().query(FellowshipCourse.class, Cnd.where(FellowshipCourse::getActivityId, "=", activityId).asc(FellowshipCourse::getOrderNum));
|
||||
if (Lang.isEmpty(courseList)) {
|
||||
return Result.success(new ArrayList<>());
|
||||
}
|
||||
List<String> assortList = courseList.stream().map(FellowshipCourse::getAssort).filter(StrUtil::isNotBlank).distinct().toList();
|
||||
return Result.success(assortList);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("验证是否能报名")
|
||||
@SaCheckPermission(value = {"fellowship.apply", "h5.fellowship.apply"}, mode = SaMode.OR)
|
||||
public Result validateSignUp(String courseId,
|
||||
@Param(value = "currentFamilyNumber") Integer currentFamilyNumber) {
|
||||
try {
|
||||
lock.lock();
|
||||
if (StrUtil.isBlank(courseId)) {
|
||||
return Result.error("报名信息为空");
|
||||
}
|
||||
|
||||
currentFamilyNumber = currentFamilyNumber != null ? currentFamilyNumber : 0;
|
||||
FellowshipCourse course = dao.fetch(FellowshipCourse.class, courseId);
|
||||
FellowshipActivity activity = dao.fetch(FellowshipActivity.class, course.getActivityId());
|
||||
|
||||
//判断时间
|
||||
if (DateUtil.compare(new Date(), activity.getActivitySignUpStartTime(), "yyyy-MM-dd HH:mm:ss") < 0) {
|
||||
return Result.error("报名未开始");
|
||||
}
|
||||
if (DateUtil.compare(new Date(), activity.getActivitySignUpEndTime(), "yyyy-MM-dd HH:mm:ss") > 0) {
|
||||
return Result.error("报名已结束");
|
||||
}
|
||||
//新增:基于条件组的用户资格验证
|
||||
if (course.getMatchCnd() != null) {
|
||||
Cnd userCnd = Cnd.where("id", "=", SecurityUtil.getUserId());
|
||||
ConditionGroupUtil.applyConditionGroup(userCnd, course.getMatchCnd());
|
||||
int userCount = dao.count(Sys_user.class, userCnd);
|
||||
if (userCount == 0) {
|
||||
return Result.error("您不符合该活动的报名条件");
|
||||
}
|
||||
}
|
||||
|
||||
//判断活动组别
|
||||
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getActivityGroupId()).and("userId", "=", SecurityUtil.getUserId()));
|
||||
if (count == 0) {
|
||||
return Result.error("抱歉,您没有此次活动的权限");
|
||||
}
|
||||
|
||||
//判断是否报名
|
||||
boolean courseByUser = fellowshipActivityService.isSignCourseByUser(courseId, SecurityUtil.getUserId());
|
||||
if (courseByUser) {
|
||||
return Result.error("抱歉,您已经报名");
|
||||
}
|
||||
|
||||
//判断活动人数
|
||||
boolean signFull = fellowshipActivityService.isSignFull(course, currentFamilyNumber);
|
||||
if (signFull) {
|
||||
return Result.error("名额剩余数量不足");
|
||||
}
|
||||
|
||||
//判断活动限制
|
||||
boolean signCourse = fellowshipActivityService.isSignCourse(course, activity);
|
||||
if (!signCourse) {
|
||||
if (activity.getRestrictLimit() != 3) {
|
||||
return Result.error("您选择的类型已达上限,不能再报该类型的了");
|
||||
} else {
|
||||
return Result.error(activity.getActivityName() + "限制报" + activity.getLimitNum() + "个活动,已达上限");
|
||||
}
|
||||
}
|
||||
|
||||
//判断分工会人数限制
|
||||
boolean signFullByUnionId = fellowshipActivityService.isSignFullByUnionId(course, currentFamilyNumber);
|
||||
if (signFullByUnionId) {
|
||||
return Result.error("您所在的分工会名额不足");
|
||||
}
|
||||
|
||||
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("报名失败");
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询子活动时间段")
|
||||
@SaCheckPermission(value = {"fellowship.apply", "h5.fellowship.apply"}, mode = SaMode.OR)
|
||||
public Result getCourseTimeSelectList(String courseId) {
|
||||
// 查课程的时间段
|
||||
List<FellowshipActivityCourse> courseList = dao.query(FellowshipActivityCourse.class, Cnd.where("courseId", "=", courseId).asc("courseStartTime"));
|
||||
|
||||
// 查课程的报名人数
|
||||
List<FellowshipUserCourse> applyUserList = dao.query(FellowshipUserCourse.class, Cnd.where("courseId", "=", courseId));
|
||||
|
||||
List<FellowshipUser> userList = dao.query(FellowshipUser.class, Cnd.where("courseId", "=", courseId).and("state", "=", 1));
|
||||
List<String> idList = userList.stream().map(FellowshipUser::getUserId).toList();
|
||||
|
||||
applyUserList = applyUserList.stream().filter(o -> idList.contains(o.getUserId())).toList();
|
||||
|
||||
// 按照课程下面时间段去分组
|
||||
Map<String, List<FellowshipUserCourse>> collectMap = applyUserList.stream().collect(Collectors.groupingBy(FellowshipUserCourse::getActivityCourseId));
|
||||
List<NutMap> list = courseList.stream().map(v -> {
|
||||
String id = v.getId();
|
||||
NutMap nutMap = NutMap.NEW();
|
||||
List<FellowshipUserCourse> fellowshipUserCourses = collectMap.get(id);
|
||||
int remainingNum = v.getCourseLimitNum() != null ? v.getCourseLimitNum() : 0;
|
||||
if (Lang.isNotEmpty(fellowshipUserCourses)) {
|
||||
remainingNum = v.getCourseLimitNum() - fellowshipUserCourses.size();
|
||||
}
|
||||
nutMap.put("remainingNum", remainingNum);
|
||||
nutMap.put("text", DateUtil.format(v.getCourseStartTime(), "MM月dd日 HH:mm") + "至" + DateUtil.format(v.getCourseEndTime(), "HH:mm") + "段(剩" + remainingNum + ")");
|
||||
nutMap.put("value", id);
|
||||
nutMap.put("disabled", remainingNum == 0);
|
||||
return nutMap;
|
||||
}).toList();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("验证子活动是否能报名")
|
||||
@SaCheckPermission(value = {"fellowship.apply", "h5.fellowship.apply"}, mode = SaMode.OR)
|
||||
public Result validateSourceSignUp(String activityCourseId, String courseId) {
|
||||
try {
|
||||
lock.lock();
|
||||
|
||||
List<FellowshipUser> userList = dao.query(FellowshipUser.class, Cnd.where("courseId", "=", courseId).and("state", "=", 1));
|
||||
List<String> isList = userList.stream().map(FellowshipUser::getUserId).toList();
|
||||
|
||||
// 该时间段下已报名的人数
|
||||
int count = dao.count(FellowshipUserCourse.class, Cnd.where("activityCourseId", "=", activityCourseId)
|
||||
.and("courseId", "=", courseId).and("userId", "in", isList));
|
||||
// 获取该时间段下的活动课程限制报名人数
|
||||
FellowshipActivityCourse course = dao.fetch(FellowshipActivityCourse.class, activityCourseId);
|
||||
Integer courseLimitNum = course.getCourseLimitNum();
|
||||
// 报名加上自己,如果大于了限制人数,那就无法报名
|
||||
if (count + 1 > courseLimitNum) {
|
||||
return Result.error("该时间段名额已报满,请选择其他时段报名");
|
||||
} else {
|
||||
return Result.success();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("报名失败");
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("活动报名")
|
||||
@SaCheckPermission(value = {"fellowship.apply", "h5.fellowship.apply"}, mode = SaMode.OR)
|
||||
@SLog(tag = "交友联谊-活动报名", msg = "活动报名")
|
||||
public Result doSignUp(FellowshipUser fellowshipUser) {
|
||||
try {
|
||||
lock.lock();
|
||||
boolean courseByUser = fellowshipActivityService.isSignCourseByUser(fellowshipUser.getCourseId(), SecurityUtil.getUserId());
|
||||
if (courseByUser) {
|
||||
return Result.error("您已报过该活动");
|
||||
}
|
||||
//判断人数
|
||||
int number = 0;
|
||||
FellowshipCourse course = fellowshipActivityService.dao().fetch(FellowshipCourse.class, fellowshipUser.getCourseId());
|
||||
FellowshipType type = fellowshipActivityService.dao().fetch(FellowshipType.class, course.getCourseType());
|
||||
if (type != null) {
|
||||
if (type.getIsBringFamily() && type.getIsAddFamily()) {
|
||||
List<NutMap> mobileColumnsValue = fellowshipUser.getMobileColumnsValue();
|
||||
NutMap map = mobileColumnsValue.stream().filter(o -> "xdqsrs".equals(o.getString("columnCode"))).findAny().orElse(null);
|
||||
number = map != null ? map.getInt("columnValue") : 0;
|
||||
}
|
||||
}
|
||||
boolean signFull = fellowshipActivityService.isSignFull(course, number);
|
||||
if (signFull) {
|
||||
return Result.error("当前报名人数已满");
|
||||
}
|
||||
boolean signFullByUnionId = fellowshipActivityService.isSignFullByUnionId(course, number);
|
||||
if (signFullByUnionId) {
|
||||
return Result.error("该活动您所在的分工会名额不足");
|
||||
}
|
||||
fellowshipActivityService.doSignUp(fellowshipUser);
|
||||
return Result.success("报名成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.success("报名失败");
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("取消报名")
|
||||
@SaCheckPermission(value = {"fellowship.apply", "h5.fellowship.apply"}, mode = SaMode.OR)
|
||||
@SLog(tag = "交友联谊-活动报名", msg = "取消报名")
|
||||
public Result cancelSignUp(@Param("activityId") String activityId, @Param("courseId") String courseId) {
|
||||
String userId = SecurityUtil.getUserId();
|
||||
//取消分两种情况
|
||||
//第一种没有设置分工会人数限制,那么将候补的人按时间倒叙往上补
|
||||
//第二种如果设置了分工会人数限制,那么只将本分工会的候补人员按照时间倒叙往上补,如果本分工会没有候补人员,则名额空出来,由校工会手动调整
|
||||
FellowshipCourse course = dao.fetch(FellowshipCourse.class, courseId);
|
||||
FellowshipType type = dao.fetch(FellowshipType.class, course.getCourseType());
|
||||
//如果是正常报名取消了,将候补报名的按时间倒叙第一个改为正常报名
|
||||
Cnd cnd = Cnd.where("activityId", "=", activityId).and("courseId", "=", courseId)
|
||||
.and("state", "=", 2);
|
||||
//如果设置了分工会报名人数限制,则只查本分工会
|
||||
if (Lang.isNotEmpty(course.getUnionLimit())) {
|
||||
cnd.and(new Static(" userId in (select id from user where unionid = '%s')".formatted(SecurityUtil.getUnionId())));
|
||||
}
|
||||
cnd.asc("signUpTime");
|
||||
if (!type.getIsBringFamily() && course.getReserveMode() == 2) {
|
||||
List<FellowshipUser> signUpUsers = dao.query(FellowshipUser.class, cnd);
|
||||
int thisSignUpUserCount = dao.count(FellowshipUser.class,
|
||||
Cnd.where("activityId", "=", activityId)
|
||||
.and("courseId", "=", courseId).and("userId", "=", userId)
|
||||
.and("state", "in", List.of(1, 3)));
|
||||
if (!signUpUsers.isEmpty() && thisSignUpUserCount > 0) {
|
||||
FellowshipUser fellowshipUser = signUpUsers.get(0);
|
||||
fellowshipUser.setState(1);
|
||||
dao.update(fellowshipUser);
|
||||
Sys_user user = dao.fetch(Sys_user.class, fellowshipUser.getUserId());
|
||||
//msgApi.sendTextMsg("【" + activity.getActivityName() + "】已候补成功,请按时参加活动!", user.getLoginname());
|
||||
}
|
||||
}
|
||||
//删除报名记录
|
||||
dao.clear("fellowship_user_course", Cnd.where("activityId", "=", activityId)
|
||||
.and("courseId", "=", courseId).and("userId", "=", userId));
|
||||
|
||||
dao.clear("fellowship_user", Cnd.where("activityId", "=", activityId)
|
||||
.and("courseId", "=", courseId).and("userId", "=", userId));
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+200
@@ -0,0 +1,200 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.controller.manage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.models.Sys_home_activity;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.*;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zxy
|
||||
* @Description 培训报名 活动管理
|
||||
* @createTime 2022年02月23日 09:57:00
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "活动管理")
|
||||
@At("/platform/fellowship/manage")
|
||||
public class FellowshipManageController {
|
||||
|
||||
@Inject
|
||||
private FellowshipActivityService fellowshipActivityManageService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("fellowship.manage")
|
||||
@Ok("beetl:/platform/zhgh/activity/fellowship/manage/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("fellowship.manage")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "activityName") String activityName) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year", "=", year);
|
||||
cnd.and(Cnd.likeEX("activityName", activityName));
|
||||
cnd.orderBy("createdAt", "desc");
|
||||
return Result.success().addData(fellowshipActivityManageService.pageData(pageForm, cnd));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("活动删除")
|
||||
@SaCheckPermission("fellowship.manage")
|
||||
@SLog(tag = "交友联谊-活动管理", msg = "删除活动")
|
||||
public Result onDelete(String id) {
|
||||
Trans.exec(() -> {
|
||||
fellowshipActivityManageService.delete(id);
|
||||
dao.clear(FellowshipCourse.class, Cnd.where("activityId", "=", id));
|
||||
dao.clear(FellowshipActivityCourse.class, Cnd.where("activityId", "=", id));
|
||||
dao.clear(FellowshipUser.class, Cnd.where("activityId", "=", id));
|
||||
dao.clear(FellowshipUserCourse.class, Cnd.where("activityId", "=", id));
|
||||
dao.clear(FellowshipActivity.class, Cnd.where("id", "=", id));
|
||||
dao.clear(FellowshipTypeLimit.class, Cnd.where("activityId", "=", id));
|
||||
dao.delete(Sys_home_activity.class, id);
|
||||
});
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("活动状态变更")
|
||||
@SaCheckPermission("fellowship.manage")
|
||||
public Result activityStatusChange(FellowshipActivity activity) {
|
||||
fellowshipActivityManageService.updateActivityStatus(activity);
|
||||
dao.update(Sys_home_activity.class,
|
||||
Chain.make("enable", !activity.isDisabled()),
|
||||
Cnd.where("id", "=", activity.getId()));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询单个活动")
|
||||
@SaCheckPermission("fellowship")
|
||||
public Result findOne(@Param("id") @NotNull String id) {
|
||||
NutMap dataMap = fellowshipActivityManageService.findOne(id, null, "");
|
||||
String activityStartTime = dataMap.getString("activityStartTime");
|
||||
String activityEndTime = dataMap.getString("activityEndTime");
|
||||
if(StrUtil.isNotBlank(activityStartTime) && StrUtil.isNotBlank(activityEndTime)) {
|
||||
dataMap.put("activityTime", List.of(activityStartTime, activityEndTime));
|
||||
} else {
|
||||
dataMap.put("activityTime", new ArrayList<>());
|
||||
}
|
||||
|
||||
String activitySignUpStartTime = dataMap.getString("activitySignUpStartTime");
|
||||
String activitySignUpEndTime = dataMap.getString("activitySignUpEndTime");
|
||||
if(StrUtil.isNotBlank(activitySignUpStartTime) && StrUtil.isNotBlank(activitySignUpEndTime)) {
|
||||
dataMap.put("activitySignTime", List.of(activitySignUpStartTime, activitySignUpEndTime));
|
||||
} else {
|
||||
dataMap.put("activitySignTime", new ArrayList<>());
|
||||
}
|
||||
|
||||
List<NutMap> courseList = dataMap.getList("courseList", NutMap.class);
|
||||
|
||||
//查询所有的课程类型
|
||||
List<FellowshipType> fellowshipTypeList = dao.query(FellowshipType.class, Cnd.NEW());
|
||||
Map<String, String> typeMap = fellowshipTypeList.stream().collect(Collectors.toMap(FellowshipType::getId, FellowshipType::getTypeName));
|
||||
|
||||
courseList.forEach(v -> {
|
||||
|
||||
List<NutMap> courseTimeList = v.getList("courseTimeList", NutMap.class);
|
||||
//选择课程日期 下拉框
|
||||
List<String> setUpCourseData = courseTimeList.stream().map(cd -> cd.getString("courseDate")).distinct().collect(Collectors.toList());
|
||||
v.put("setUpCourseData", setUpCourseData);
|
||||
|
||||
courseTimeList.forEach(ct -> {
|
||||
String courseStartTime = DateUtil.format(ct.getTime("courseStartTime"), "HH:mm");
|
||||
String courseEndTime = DateUtil.format(ct.getTime("courseEndTime"), "HH:mm");
|
||||
ct.put("courseStartTime", courseStartTime);
|
||||
ct.put("courseEndTime", courseEndTime);
|
||||
});
|
||||
|
||||
v.put("courseTypeName", typeMap.get(v.getString("courseType")));
|
||||
});
|
||||
|
||||
return Result.success().addData(dataMap);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@ApiOperation("交友联谊新增/修改")
|
||||
@SaCheckPermission("fellowship.manage")
|
||||
@SLog(tag = "交友联谊-活动管理", msg = "新增/修改活动")
|
||||
public Result doHandle(FellowshipActivity activity) {
|
||||
if (StrUtil.isBlank(activity.getId())) {
|
||||
fellowshipActivityManageService.add(activity, null);
|
||||
} else {
|
||||
fellowshipActivityManageService.edit(activity);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@ApiOperation("获取分工会人数限制")
|
||||
@SaCheckPermission("fellowship.manage")
|
||||
public Result getUnionLimit(@Param(value = "activityScopeId") String activityScopeId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
gh.id,
|
||||
gh.name,
|
||||
gh.unioncode,
|
||||
(select count(1) from `vw_user` where unionid = gh.id $cnd) as teacherCount,
|
||||
NULL as ratio,
|
||||
NULL as limitCount
|
||||
FROM
|
||||
sys_union gh
|
||||
order by gh.unioncode
|
||||
""");
|
||||
if (StrUtil.isNotBlank(activityScopeId)) {
|
||||
sql.setVar("cnd", "AND id in (select userId from activity_user_scope where groupId = '" + activityScopeId + "')");
|
||||
}
|
||||
List<NutMap> list = fellowshipActivityManageService.listMap(sql);
|
||||
return Result.success().addData(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@ApiOperation("获取报名人员数量")
|
||||
@SaCheckPermission("fellowship.manage")
|
||||
public Result getRegisterUserCount(@Param(value = "courseId") String courseId) {
|
||||
return Result.success().addData(dao.count(FellowshipUser.class, Cnd.where("courseId", "=", courseId)));
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@ApiOperation("获取历史活动列表")
|
||||
@SaCheckPermission("fellowship.manage")
|
||||
public Result getHistoricalActList() {
|
||||
List<FellowshipActivity> query = dao.query(FellowshipActivity.class, Cnd.NEW().desc("activityStartTime"));
|
||||
return Result.success().addData(query);
|
||||
}
|
||||
}
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.controller.manage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipUserCourse;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName fellowshipMineController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/13 16:56
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "活动报名")
|
||||
@At("/platform/fellowship/mine")
|
||||
public class FellowshipMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FellowshipActivityService activityService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("fellowship.mine")
|
||||
@Ok("beetl:/platform/zhgh/activity/fellowship/mine/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.fellowship.mine")
|
||||
@Ok("beetl:/platform/zhghh5/activity/fellowship/mine/index.html")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("主动扫码签到")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"fellowship.mine", "h5.fellowship.mine"}, mode = SaMode.OR)
|
||||
@SLog(tag = "交友联谊-活动签到", msg = "主动扫码签到")
|
||||
public Result drivingScan(String courseId) {
|
||||
|
||||
// 主动扫码签到是用户自己打开扫一扫,扫二维码签到
|
||||
int count = dao.count(FellowshipUserCourse.class, Cnd.where("courseId", "=", courseId).and("userId", "=", SecurityUtil.getUserId()));
|
||||
if (count == 0) {
|
||||
return Result.error(99, "未查询到您的报名记录");
|
||||
}
|
||||
|
||||
// 获取现在的日期,并往后推1个小时
|
||||
String oneHourLater = DateUtil.offsetHour(new Date(), 1).toString("yyyy-MM-dd HH:mm:ss");
|
||||
FellowshipUserCourse userCourse = dao.fetch(
|
||||
FellowshipUserCourse.class,
|
||||
Cnd.where("courseId", "=", courseId)
|
||||
.and("userId", "=", SecurityUtil.getUserId())
|
||||
.and("courseStartTime", "<=", oneHourLater)
|
||||
.and("courseEndTime", ">=", oneHourLater)
|
||||
);
|
||||
if (userCourse == null) {
|
||||
return Result.error(99, "未到签到时间");
|
||||
}
|
||||
|
||||
userCourse.setAttend(true);
|
||||
userCourse.setAttendTime(DateUtil.date());
|
||||
dao.update(userCourse);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("被动扫码签到")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"fellowship.mine", "h5.fellowship.mine"}, mode = SaMode.OR)
|
||||
@SLog(tag = "交友联谊-活动签到", msg = "被动扫码签到")
|
||||
public Result passiveScan(String id) {
|
||||
|
||||
// id表示课程的某个时间段,userId表示是谁出示的二维码
|
||||
FellowshipUserCourse userCourse = dao.fetch(FellowshipUserCourse.class, id);
|
||||
if (userCourse == null) {
|
||||
return Result.error("未查询到报名记录");
|
||||
}
|
||||
int isAfter = DateUtil.compare(new Date(), userCourse.getCourseStartTime());
|
||||
if (isAfter > 0) {
|
||||
return Result.error("抱歉,已经开始,无法签到");
|
||||
}
|
||||
long diffMillis = Math.abs(DateUtil.between(new Date(), userCourse.getCourseStartTime(), DateUnit.MS));
|
||||
long oneHourInMs = 3600 * 1000;
|
||||
if (diffMillis > oneHourInMs) {
|
||||
return Result.error("签到时间为开始前1个小时");
|
||||
}
|
||||
|
||||
userCourse.setAttend(true);
|
||||
userCourse.setAttendTime(DateUtil.date());
|
||||
dao.update(userCourse);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分活动查询")
|
||||
@SaCheckPermission(value = {"fellowship.mine", "h5.fellowship.mine"}, mode = SaMode.OR)
|
||||
public Result queryCourseSign(String courseId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
uc.*,
|
||||
date(uc.courseStartTime) as courseDate
|
||||
FROM
|
||||
`fellowship_user_course` uc
|
||||
WHERE
|
||||
courseId = @courseId and userId = @userId
|
||||
""");
|
||||
sql.setParam("userId", SecurityUtil.getUserId());
|
||||
sql.setParam("courseId", courseId);
|
||||
List<NutMap> listMap = activityService.listMap(sql);
|
||||
return Result.success(listMap);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("获取我报名的课程")
|
||||
@SaCheckPermission(value = {"fellowship.mine", "h5.fellowship.mine"}, mode = SaMode.OR)
|
||||
public Result queryMineCourse(String activityId) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*,
|
||||
u.mobileColumnsValue
|
||||
FROM
|
||||
fellowship_user u
|
||||
LEFT JOIN fellowship_course c ON c.id = u.courseId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("u.activityId", "=", activityId);
|
||||
cnd.and("u.userId", "=", SecurityUtil.getUserId());
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> listMap = activityService.listMap(sql);
|
||||
return Result.success(listMap);
|
||||
}
|
||||
}
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.controller.manage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.EnumUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipMobileSignColumn;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.annotation.ColType;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/9/22
|
||||
* @Description
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "活动类型管理")
|
||||
@At("/platform/fellowship/type")
|
||||
public class FellowshipTypeController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("fellowship.type")
|
||||
@Ok("beetl:/platform/zhgh/activity/fellowship/type/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("fellowship.type")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "typeName") String typeName) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
select * from fellowship_type $condition
|
||||
""");
|
||||
if (Strings.isNotBlank(typeName)) {
|
||||
cnd.and("typeName", "like", "%" + typeName + "%");
|
||||
}
|
||||
if(Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())){
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.asc("xh");
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> list = pagination.getList();
|
||||
list.forEach(item -> {
|
||||
Cnd c = Cnd.NEW();
|
||||
c.and("typeId", "=", item.getString("id"));
|
||||
c.asc("columnIndex");
|
||||
List<FellowshipMobileSignColumn> signColumns = dao.query(FellowshipMobileSignColumn.class, c);
|
||||
item.put("mobileSignColumnList", signColumns);
|
||||
|
||||
});
|
||||
return Result.success().addData(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("活动类型新增")
|
||||
@SaCheckPermission("fellowship.type")
|
||||
@SLog(tag = "交友联谊-类型管理", msg = "活动类型新增")
|
||||
public Result doAdd(@Param("data") String data) throws Exception {
|
||||
FellowshipType type = Json.fromJson(FellowshipType.class, data);
|
||||
int count = dao.count(FellowshipType.class, Cnd.where("code", "=", type.getCode()));
|
||||
if (count > 0) {
|
||||
return Result.error("编码重复!");
|
||||
}
|
||||
int totalCount = dao.count(FellowshipType.class);
|
||||
type.setXh(totalCount + 1);
|
||||
dao.insertWith(type, "mobileSignColumnList");
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("活动类型修改")
|
||||
@SaCheckPermission("fellowship.type")
|
||||
@SLog(tag = "交友联谊-类型管理", msg = "活动类型修改")
|
||||
public Result doEdit(FellowshipType type) {
|
||||
int count = dao.count(FellowshipType.class, Cnd.where("code", "=", type.getCode()).and("id", "!=", type.getId()));
|
||||
if (count > 0) {
|
||||
return Result.error("编码重复!");
|
||||
}
|
||||
dao.update(type);
|
||||
dao.clear(FellowshipMobileSignColumn.class, Cnd.where("typeId", "=", type.getId()));
|
||||
dao.insertLinks(type, "mobileSignColumnList");
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("活动类型删除")
|
||||
@SaCheckPermission("fellowship.type")
|
||||
@SLog(tag = "交友联谊-类型管理", msg = "活动类型删除")
|
||||
public Object doDelete(@Param(value = "id") String id) {
|
||||
dao.clear(FellowshipType.class, Cnd.where("id", "=", id));
|
||||
dao.clear(FellowshipMobileSignColumn.class, Cnd.where("typeId", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("排序号变更")
|
||||
@SaCheckPermission("fellowship.type")
|
||||
public Object xhChange(String id, Integer xh, boolean toDown) {
|
||||
if (toDown) {
|
||||
FellowshipType next = dao.fetch(FellowshipType.class, Cnd.where("xh", "=", xh + 1));
|
||||
next.setXh(next.getXh() - 1);
|
||||
dao.update(next);
|
||||
dao.update(FellowshipType.class, Chain.make("xh", xh + 1), Cnd.where("id", "=", id));
|
||||
} else {
|
||||
FellowshipType pre = dao.fetch(FellowshipType.class, Cnd.where("xh", "=", xh - 1));
|
||||
pre.setXh(pre.getXh() + 1);
|
||||
dao.update(pre);
|
||||
dao.update(FellowshipType.class, Chain.make("xh", xh - 1), Cnd.where("id", "=", id));
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("获取所有类型")
|
||||
@SaCheckLogin
|
||||
public Result getAllType(@Param(value = "id") String id) {
|
||||
List<FellowshipType> fellowshipTypeList = dao.query(FellowshipType.class, Cnd.NEW().andEX("id", "=", id).asc("xh"));
|
||||
dao.fetchLinks(fellowshipTypeList, "mobileSignColumnList", Cnd.NEW().asc("columnIndex"));
|
||||
return Result.success().addData(fellowshipTypeList);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("自定义表单字段类型")
|
||||
@SaCheckPermission("fellowship.type")
|
||||
public Result getColumnType() {
|
||||
List<String> names = EnumUtil.getNames(ColType.class);
|
||||
names.add("JSON");
|
||||
return Result.success(names);
|
||||
}
|
||||
}
|
||||
+350
@@ -0,0 +1,350 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.controller.manage;
|
||||
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipActivity;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipCourse;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipUser;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipBlackListService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zxy
|
||||
* @Description 人员管理
|
||||
* @createTime 2022年03月07日 14:27:00
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "交友联谊人员黑名单")
|
||||
@At("/platform/fellowship/userManage")
|
||||
public class FellowshipUserManageController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FellowshipBlackListService fellowshipBlackListService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("fellowship.userManage")
|
||||
@Ok("beetl:/platform/zhgh/activity/fellowship/userManage/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("fellowship.userManage")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "activityId") String activityId,
|
||||
@Param(value = "courseId") String courseId,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "userKeyWord") String userKeyWord) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("tsuu.activityId", "=", activityId);
|
||||
cnd.andEX("tsuu.courseId", "=", courseId);
|
||||
cnd.andEX("act.year", "=", year);
|
||||
if (StrUtil.isNotBlank(userKeyWord)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
cnd.and(seg.andLike("u.username", userKeyWord).orLike("u.loginname", userKeyWord));
|
||||
}
|
||||
if(Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())){
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
Pagination pagination = fellowshipBlackListService.pageData(pageForm, cnd, activityId, courseId);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("报名人员处理")
|
||||
@SaCheckPermission("fellowship.userManage")
|
||||
@SLog(tag = "交友联谊-人员管理", msg = "报名人员处理")
|
||||
public Result doHandleUser(@Param("userId") String userId) {
|
||||
fellowshipBlackListService.doHandleUser(userId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("根据活动Id获取子活动")
|
||||
@SaCheckPermission("fellowship.userManage")
|
||||
public Result getCourseByActivityId(@Param("activityId") String activityId) {
|
||||
List<FellowshipCourse> list = dao.query(FellowshipCourse.class, Cnd.where("activityId", "=", activityId));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("获取子活动具体时间")
|
||||
@SaCheckPermission("fellowship.userManage")
|
||||
public Result attendClassRecord(String userId) {
|
||||
fellowshipBlackListService.attendClassRecord(userId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("获取候补人员")
|
||||
@SaCheckPermission("fellowship.userManage")
|
||||
public Result getReserveUser(String courseId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
uc.* ,
|
||||
(select signUpTime from fellowship_user su where su.activityId=uc.activityId and su.courseId = uc.courseId and su.userId=uc.userId) as signUpTime,
|
||||
(select state from fellowship_user su where su.activityId=uc.activityId and su.courseId = uc.courseId and su.userId=uc.userId) as state,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.mobile,
|
||||
u.unitName,
|
||||
u.unionName
|
||||
FROM
|
||||
fellowship_user_course uc LEFT JOIN `vw_user` u on uc.userId = u.id
|
||||
WHERE uc.courseId = @courseId and uc.isAttend = false HAVING state = 2 order by signUpTime desc
|
||||
""").setParam("courseId", courseId);
|
||||
return Result.success(fellowshipBlackListService.listMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("补充人员")
|
||||
@SaCheckPermission("fellowship.userManage")
|
||||
@SLog(tag = "交友联谊-人员管理", msg = "补充人员")
|
||||
public Result reserveSingUp(String[] ids, String courseId) {
|
||||
//先查询这个课程有多少个未签到的人员
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
uc.* ,
|
||||
(select signUpTime from fellowship_user su where su.activityId=uc.activityId and su.courseId = uc.courseId and su.userId=uc.userId) as signUpTime,
|
||||
(select state from fellowship_user su where su.activityId=uc.activityId and su.courseId = uc.courseId and su.userId=uc.userId) as state
|
||||
FROM
|
||||
fellowship_user_course uc
|
||||
WHERE uc.courseId = @courseId and uc.isAttend = false HAVING state = 1 order by signUpTime desc
|
||||
""").setParam("courseId", courseId);
|
||||
List<NutMap> list = fellowshipBlackListService.listMap(sql);
|
||||
if(ids.length > list.size()) {
|
||||
return Result.error("您选择了" + ids.length + "位,未签到人员只有" + list.size() + "位");
|
||||
}
|
||||
//ids的长度为几,就搞几个
|
||||
List<NutMap> mapList = list.subList(0, ids.length);
|
||||
List<String> idList = mapList.stream().map(o -> o.getString("userId")).collect(Collectors.toList());
|
||||
//将这几个没签到的设置为4
|
||||
dao.update(FellowshipUser.class, Chain.make("state", 4), Cnd.where("courseId", "=", courseId)
|
||||
.and("userId", "in", idList));
|
||||
//将补充的设置为1
|
||||
dao.update(FellowshipUser.class, Chain.make("state", 1), Cnd.where("courseId", "=", courseId)
|
||||
.and("userId", "in", ids));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("导出签到人员")
|
||||
public void exportSignPerson(@Param(value = "activityId") String activityId,
|
||||
HttpServletResponse response) {
|
||||
FellowshipActivity activity = dao.fetch(FellowshipActivity.class, activityId);
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
uc.*,
|
||||
DATE_FORMAT(uc.courseStartTime, '%Y-%m-%d %H:%i:%s') as courseStartTimeExcel,
|
||||
DATE_FORMAT(uc.courseEndTime, '%Y-%m-%d %H:%i:%s') as courseEndTimeExcel,
|
||||
DATE_FORMAT(uc.attendTime, '%Y-%m-%d %H:%i:%s') as attendTimeExcel,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
u.sex
|
||||
FROM
|
||||
fellowship_user_course uc
|
||||
left join fellowship_course course on uc.courseId = course.id
|
||||
left join `vw_user` u on u.id = uc.userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("uc.activityId", "=", activityId);
|
||||
cnd.and("course.isMobileSign", "=", true);
|
||||
cnd.desc("isAttend").desc("attendTime");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
List<NutMap> userList = fellowshipBlackListService.listMap(sql);
|
||||
|
||||
List<FellowshipCourse> courseList = dao.query(FellowshipCourse.class, Cnd.where("activityId", "=", activityId));
|
||||
|
||||
List<Map<String, Object>> sheetsList = new ArrayList<>();
|
||||
|
||||
List<ExcelExportEntity> excelCommonExportEntity = new ArrayList<>();
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("单位", "unitName", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("分工会", "unionName", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("开始时间", "courseStartTimeExcel", 22));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("结束时间", "courseEndTimeExcel", 22));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("是否签到", "isAttend", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("签到时间", "attendTimeExcel", 22));
|
||||
|
||||
for (FellowshipCourse c : courseList) {
|
||||
if(!c.isMobileSign()) {
|
||||
continue;
|
||||
}
|
||||
String courseId = c.getId();
|
||||
String courseName = c.getCourseName();
|
||||
List<NutMap> v = userList.stream().filter(x -> x.getString("courseId").equals(courseId)).collect(Collectors.toList());
|
||||
ExportParams userExportParams = new ExportParams();
|
||||
userExportParams.setSheetName(courseName);
|
||||
|
||||
List<ExcelExportEntity> currentEntities = new ArrayList<>(excelCommonExportEntity);
|
||||
for (NutMap userSignData : v) {
|
||||
if(!userSignData.getBoolean("isAttend")) {
|
||||
userSignData.put("isAttend", "未签到");
|
||||
userSignData.put("attendTimeExcel", "未签到");
|
||||
}else {
|
||||
userSignData.put("isAttend", "已签到");
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> userExportMap = new HashMap<>();
|
||||
userExportMap.put("name", courseName);
|
||||
userExportMap.put("title", userExportParams);
|
||||
userExportMap.put("entity", currentEntities);
|
||||
userExportMap.put("data", v);
|
||||
|
||||
sheetsList.add(userExportMap);
|
||||
}
|
||||
try {
|
||||
String fileName = activity.getActivityName() + "签到人员名单.xls";
|
||||
String disposition = "attachment;filename=" + URLEncoder.encode(fileName, "utf-8");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", disposition);
|
||||
|
||||
Workbook workbook = new HSSFWorkbook();
|
||||
for (Map<String, Object> map : sheetsList) {
|
||||
ExcelExportService service = new ExcelExportService();
|
||||
service.createSheetForMap(workbook,(ExportParams) map.get("title"),(List<ExcelExportEntity>) map.get("entity"),(Collection<?>) map.get("data"));
|
||||
}
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("导出领取人员")
|
||||
public void exportGiftPerson(@Param(value = "activityId") String activityId,
|
||||
HttpServletResponse response) {
|
||||
FellowshipActivity activity = dao.fetch(FellowshipActivity.class, activityId);
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
uc.*,
|
||||
DATE_FORMAT(uc.courseStartTime, '%Y-%m-%d %H:%i:%s') as courseStartTimeExcel,
|
||||
DATE_FORMAT(uc.courseEndTime, '%Y-%m-%d %H:%i:%s') as courseEndTimeExcel,
|
||||
DATE_FORMAT(uc.receiveTime, '%Y-%m-%d %H:%i:%s') as receiveTimeExcel,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
u.sex
|
||||
FROM
|
||||
fellowship_user_course uc
|
||||
left join fellowship_course course on uc.courseId = course.id
|
||||
left join `vw_user` u on u.id = uc.userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("uc.activityId", "=", activityId);
|
||||
cnd.and("course.isReceiveGift", "=", true).and("course.giftType" ,"=", 1);
|
||||
cnd.desc("isReceive").desc("receiveTime");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
List<NutMap> userList = fellowshipBlackListService.listMap(sql);
|
||||
|
||||
List<FellowshipCourse> courseList = dao.query(FellowshipCourse.class, Cnd.where("activityId", "=", activityId));
|
||||
|
||||
List<Map<String, Object>> sheetsList = new ArrayList<>();
|
||||
|
||||
List<ExcelExportEntity> excelCommonExportEntity = new ArrayList<>();
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("单位", "unitName", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("分工会", "unionName", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("开始时间", "courseStartTimeExcel", 22));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("结束时间", "courseEndTimeExcel", 22));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("是否领取", "isReceive", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("领取时间", "receiveTimeExcel", 22));
|
||||
|
||||
for (FellowshipCourse c : courseList) {
|
||||
String courseId = c.getId();
|
||||
String courseName = c.getCourseName();
|
||||
List<NutMap> v = userList.stream().filter(x -> x.getString("courseId").equals(courseId)).collect(Collectors.toList());
|
||||
ExportParams userExportParams = new ExportParams();
|
||||
userExportParams.setSheetName(courseName);
|
||||
|
||||
List<ExcelExportEntity> currentEntities = new ArrayList<>(excelCommonExportEntity);
|
||||
for (NutMap userSignData : v) {
|
||||
if(!userSignData.getBoolean("isReceive")) {
|
||||
userSignData.put("isReceive", "未领取");
|
||||
userSignData.put("receiveTimeExcel", "未领取");
|
||||
}else {
|
||||
userSignData.put("isReceive", "已领取");
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> userExportMap = new HashMap<>();
|
||||
userExportMap.put("name", courseName);
|
||||
userExportMap.put("title", userExportParams);
|
||||
userExportMap.put("entity", currentEntities);
|
||||
userExportMap.put("data", v);
|
||||
|
||||
sheetsList.add(userExportMap);
|
||||
}
|
||||
try {
|
||||
String fileName = activity.getActivityName() + "礼品领取人员名单.xls";
|
||||
String disposition = "attachment;filename=" + URLEncoder.encode(fileName, "utf-8");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", disposition);
|
||||
|
||||
Workbook workbook = new HSSFWorkbook();
|
||||
for (Map<String, Object> map : sheetsList) {
|
||||
ExcelExportService service = new ExcelExportService();
|
||||
service.createSheetForMap(workbook,(ExportParams) map.get("title"),(List<ExcelExportEntity>) map.get("entity"),(Collection<?>) map.get("data"));
|
||||
}
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+254
@@ -0,0 +1,254 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.controller.statistics;
|
||||
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.sys.models.Sys_file;
|
||||
import com.budwk.app.sys.utils.SysFileMinIoUtil;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipActivity;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipCourse;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipMobileSignColumn;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipType;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityService;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityStatisticsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @author zxy
|
||||
* @Description 培训报名 统计
|
||||
* @createTime 2022年02月23日 09:57:00
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "交友联谊统计")
|
||||
@At("/platform/fellowship/statistics")
|
||||
public class FellowshipActivityStatisticsController {
|
||||
|
||||
@Inject
|
||||
private FellowshipActivityService fellowshipActivityManageService;
|
||||
@Inject
|
||||
private FellowshipActivityStatisticsService fellowshipActivityStatisticsService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("fellowship.statistics")
|
||||
@Ok("beetl:/platform/zhgh/activity/fellowship/statistics/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("fellowship.statistics")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "activityId") String activityId) {
|
||||
Pagination pagination = fellowshipActivityStatisticsService.pageData(pageForm, activityId);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动list
|
||||
*
|
||||
* @param year 年度
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ApiOperation("活动列表")
|
||||
@SaCheckPermission("fellowship.statistics")
|
||||
public Result activityList(@Param(value = "year") Integer year) {
|
||||
List<FellowshipActivity> list = dao.query(FellowshipActivity.class, Cnd.NEW().andEX("year", "=", year).desc("activityStartTime"));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 培训班报名人员list
|
||||
*
|
||||
* @param courseId
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ApiOperation("报名人员列表")
|
||||
@SaCheckPermission("fellowship.statistics")
|
||||
public Result registerUserList(@Param(value = "courseId") String courseId) {
|
||||
return Result.success(fellowshipActivityStatisticsService.registerUserList(courseId));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("报名动态列")
|
||||
@SaCheckPermission("fellowship.statistics")
|
||||
public Object getTaleColumnInfo(@Param(value = "courseId") String courseId) {
|
||||
return Result.success(fellowshipActivityStatisticsService.getTaleColumnInfo(courseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 培训班上课签到信息
|
||||
*
|
||||
* @param courseId
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ApiOperation("获取签到信息")
|
||||
@SaCheckPermission("fellowship.statistics")
|
||||
public Result getSignInfo(@Param("courseId") String courseId) {
|
||||
return Result.success(fellowshipActivityStatisticsService.getSignInfo(courseId));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("开放报名")
|
||||
@SaCheckPermission("fellowship.statistics")
|
||||
public Result signChange(@Param("courseId") String courseId, @Param("openOtherUnion") Boolean openOtherUnion) {
|
||||
dao.update(FellowshipCourse.class, Chain.make("openOtherUnion", openOtherUnion)
|
||||
, Cnd.where("id", "=", courseId));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("导出签到名单")
|
||||
@SaCheckPermission("fellowship.statistics")
|
||||
public void exportSignUser(@Param(value = "activityId") String activityId,
|
||||
HttpServletResponse response) throws IOException {
|
||||
try {
|
||||
FellowshipActivity activity = dao.fetch(FellowshipActivity.class, activityId);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ts.*,
|
||||
CONCAT(DATE_FORMAT(ac.courseStartTime, '%H:%i:%s'),'至',DATE_FORMAT(ac.courseEndTime, '%H:%i:%s')) AS courseTime,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.sex,
|
||||
ifnull(ts.mobile, u.mobile) as mobile,
|
||||
u.birthday,
|
||||
tsc.courseName
|
||||
FROM
|
||||
fellowship_user ts
|
||||
left join fellowship_activity_course ac on ts.activityCourseId = ac.id
|
||||
left join `vw_user` u on u.id = ts. userId
|
||||
left join fellowship_course tsc on tsc.id = ts.courseId
|
||||
WHERE
|
||||
ts.activityId = @activityId
|
||||
""").setParam("activityId", activityId);
|
||||
List<NutMap> userList = fellowshipActivityManageService.listMap(sql);
|
||||
|
||||
List<FellowshipCourse> courseList = dao.query(FellowshipCourse.class, Cnd.where("activityId", "=", activityId));
|
||||
|
||||
List<FellowshipType> fellowshipTypeList = dao.query(FellowshipType.class, Cnd.NEW());
|
||||
dao.fetchLinks(fellowshipTypeList, "mobileSignColumnList", Cnd.NEW().asc("columnIndex"));
|
||||
Map<String, FellowshipType> typeMap = fellowshipTypeList.stream().collect(Collectors.toMap(FellowshipType::getId, o -> o));
|
||||
|
||||
List<Map<String, Object>> sheetsList = new ArrayList<>();
|
||||
|
||||
List<ExcelExportEntity> excelCommonExportEntity = new ArrayList<>();
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("单位", "unitName", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("分工会", "unionName", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("手机号", "mobile", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("生日", "birthday", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("报名时段", "courseTime", 20));
|
||||
|
||||
for (FellowshipCourse c : courseList) {
|
||||
String k = c.getCourseName();
|
||||
List<NutMap> v = userList.stream().filter(x -> x.getString("courseName").equals(k)).collect(Collectors.toList());
|
||||
ExportParams userExportParams = new ExportParams();
|
||||
userExportParams.setSheetName(k);
|
||||
userExportParams.setType(ExcelType.HSSF);
|
||||
|
||||
List<ExcelExportEntity> currentEntities = new ArrayList<>();
|
||||
currentEntities.addAll(excelCommonExportEntity);
|
||||
|
||||
FellowshipType signUpType = typeMap.get(c.getCourseType());
|
||||
if (Lang.isNotEmpty(signUpType.getMobileSignColumnList())) {
|
||||
for (FellowshipMobileSignColumn column : signUpType.getMobileSignColumnList()) {
|
||||
ExcelExportEntity entity = new ExcelExportEntity();
|
||||
entity.setName(column.getColumnName());
|
||||
entity.setKey(column.getColumnCode());
|
||||
entity.setWidth(20);
|
||||
if (column.getColumnFormType().equals("FILE")) {
|
||||
entity.setType(2);
|
||||
entity.setExportImageType(2);
|
||||
}
|
||||
currentEntities.add(entity);
|
||||
}
|
||||
}
|
||||
for (NutMap userSignData : v) {
|
||||
String mobileColumnsValueStr = userSignData.getString("mobileColumnsValue");
|
||||
if (StrUtil.isNotBlank(mobileColumnsValueStr)) {
|
||||
List<NutMap> mobileColumnsValue = Json.fromJsonAsList(NutMap.class, mobileColumnsValueStr);
|
||||
for (NutMap cv : mobileColumnsValue) {
|
||||
if (!"FILE".equals(cv.getString("columnFormType"))) {
|
||||
userSignData.put(cv.getString("columnCode"), cv.getString("columnValue"));
|
||||
} else {
|
||||
if (StrUtil.isNotBlank(cv.getString("columnValue"))) {
|
||||
List<JSONObject> columnValue = Json.fromJsonAsList(JSONObject.class, cv.getString("columnValue"));
|
||||
if (columnValue.size() == 1) {
|
||||
JSONObject sysFile = columnValue.get(0);
|
||||
Sys_file file = dao.fetch(Sys_file.class, Cnd.where(Sys_file::getDownloadPath, "=", sysFile.get("url")));
|
||||
byte[] imageBytes = SysFileMinIoUtil.getFileBytes(file.getBucket(), file.getStoragePath());
|
||||
if (imageBytes.length > 0) {
|
||||
userSignData.put(cv.getString("columnCode"), imageBytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> userExportMap = new HashMap<>();
|
||||
userExportMap.put("name", k);
|
||||
userExportMap.put("title", userExportParams);
|
||||
userExportMap.put("entity", currentEntities);
|
||||
userExportMap.put("data", v);
|
||||
|
||||
sheetsList.add(userExportMap);
|
||||
}
|
||||
|
||||
Workbook workbook = new HSSFWorkbook();
|
||||
for (Map<String, Object> map : sheetsList) {
|
||||
ExcelExportService service = new ExcelExportService();
|
||||
service.createSheetForMap(workbook, (ExportParams) map.get("title"), (List<ExcelExportEntity>) map.get("entity"), (Collection<?>) map.get("data"));
|
||||
}
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
|
||||
CommonDownloadUtil.download(activity.getActivityName() + "报名人员名单" + ".xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import com.budwk.app.sys.models.Sys_home_activity;
|
||||
import com.budwk.app.sys.services.SysHomeConvert;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Comment("交友联谊")
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class FellowshipActivity extends BaseModel implements Serializable, SysHomeConvert {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("活动名称")
|
||||
private String activityName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("年度")
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("活动报名开始时间")
|
||||
private Date activitySignUpStartTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("活动报名开始时间")
|
||||
private Date activitySignUpEndTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("活动开始时间")
|
||||
private Date activityStartTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("活动结束时间")
|
||||
private Date activityEndTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("是否禁用")
|
||||
private boolean isDisabled;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "longtext")
|
||||
@Comment("活动介绍")
|
||||
private String introduce;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
@Comment("活动限制标识")
|
||||
private Integer restrictLimit;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
@Comment("活动限制报名个数")
|
||||
private Integer limitNum;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("活动封面")
|
||||
private String cover;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("微信群二维码")
|
||||
private String wechat;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("上课前是否通知")
|
||||
private boolean notice;
|
||||
|
||||
@Column
|
||||
@Comment("活动范围Id")
|
||||
@ColDefine(type = ColType.INT, width = 32)
|
||||
private Integer activityGroupId;
|
||||
|
||||
@Column
|
||||
@Comment("活动范围名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 40)
|
||||
private String activityGroupName;
|
||||
|
||||
/**
|
||||
* 所有的培训班
|
||||
*/
|
||||
@Many(field = "activityId")
|
||||
private List<FellowshipCourse> courseList;
|
||||
|
||||
@Many(field = "activityId")
|
||||
private List<FellowshipTypeLimit> typeLimits;
|
||||
|
||||
@Column
|
||||
@Comment("活动类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String trainType;
|
||||
|
||||
@Column
|
||||
@Comment("主办单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> hostUnitIds;
|
||||
|
||||
@Column
|
||||
@Comment("承办单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> undertakeUnitIds;
|
||||
|
||||
@Override
|
||||
public Sys_home_activity covertToSysHomeActivity() {
|
||||
Sys_home_activity sysHomeActivity = new Sys_home_activity();
|
||||
sysHomeActivity.setId(this.getId());
|
||||
sysHomeActivity.setName(this.getActivityName());
|
||||
sysHomeActivity.setCover(this.getCover());
|
||||
sysHomeActivity.setUrl("/platform/fellowship/apply?id=" + this.getId());
|
||||
sysHomeActivity.setH5Url("/platform/fellowship/apply/h5?id=" + this.getId());
|
||||
if (Lang.isNotEmpty(this.getActivitySignUpStartTime())) {
|
||||
sysHomeActivity.setStartDate(this.getActivitySignUpStartTime());
|
||||
sysHomeActivity.setEndDate(this.getActivitySignUpEndTime());
|
||||
}
|
||||
sysHomeActivity.setAllowUserGroupId(this.getActivityGroupId());
|
||||
sysHomeActivity.setEnable(!this.isDisabled());
|
||||
sysHomeActivity.setClassPath(this.getClass().getPackageName() + this.getClass().getName());
|
||||
return sysHomeActivity;
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.models;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Comment("交友联谊下的子活动")
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class FellowshipActivityCourse {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("活动ID")
|
||||
private String activityId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("课程ID")
|
||||
private String courseId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("课程开始时间")
|
||||
private Date courseStartTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("课程结束时间")
|
||||
private Date courseEndTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("课程时间")
|
||||
private Date courseDate;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
@Comment("限制人数")
|
||||
private Integer courseLimitNum;
|
||||
|
||||
private Integer hasRegisterNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.models;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Comment("交友联谊黑名单")
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class FellowshipBlackList {
|
||||
|
||||
@Name
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("用户id")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("是否禁用")
|
||||
private Boolean isDisabled;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import com.budwk.app.base.param.ConditionGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Comment("交友联谊的子活动")
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class FellowshipCourse extends BaseModel implements Serializable {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("活动ID")
|
||||
private String activityId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("课程名称")
|
||||
private String courseName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("课程人数")
|
||||
private int coursePeopleNumber;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default(value = "0")
|
||||
@Comment("预留名额")
|
||||
private int courseReservedNumber;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("课程地点")
|
||||
private String courseLocation;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("课程类型")
|
||||
private String courseType;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("课程地点坐标")
|
||||
private List<Double> courseLocationCoordinates;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("课程讲师")
|
||||
private String courseInstructor;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("校区")
|
||||
private String campus;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("报名人数是否限制")
|
||||
private Boolean courseIsLimitApply;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("序号")
|
||||
private int orderNum;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "longtext")
|
||||
@Comment("详细信息")
|
||||
private String introduce;
|
||||
|
||||
@Many(field = "courseId")
|
||||
private List<FellowshipActivityCourse> courseTimeList;
|
||||
|
||||
//已报人数
|
||||
private Integer hasRegisterNum;
|
||||
|
||||
private Boolean isBringFamily;
|
||||
|
||||
private Boolean isAddFamily;
|
||||
|
||||
//是否报过该课程
|
||||
private Boolean isSign;
|
||||
|
||||
//还能报该类型的课程吗
|
||||
private Boolean canSignThisCourseType;
|
||||
|
||||
@Column
|
||||
@Comment("分工会人数限制")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<NutMap> unionLimit;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("移动端是否签到")
|
||||
private boolean isMobileSign;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("签到方式 1.扫描二维码签到 2.被扫 3.gps签到")
|
||||
private Integer signType;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("移动端是否签收礼品")
|
||||
private boolean isReceiveGift;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("领取礼品方式 1.扫描二维码 2.线下")
|
||||
private Integer giftType;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("预留名额方式 1.报名人员减少模式 2.报名人数不变模式")
|
||||
private Integer reserveMode;
|
||||
|
||||
@Column
|
||||
@Comment("承办工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hostUnionId;
|
||||
|
||||
@Column
|
||||
@Comment("对内报名时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String interTime;
|
||||
|
||||
@Column
|
||||
@Comment("是否开放给其他工会")
|
||||
@ColDefine(type = ColType.BOOLEAN, width = 4)
|
||||
private Boolean openOtherUnion;
|
||||
|
||||
@Column
|
||||
@Comment("分类标识")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String assort;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default(value = "0")
|
||||
@Comment("候补名额数")
|
||||
private Integer waitingNum;
|
||||
|
||||
//候补已报人数
|
||||
private Integer hasWaitingNum;
|
||||
|
||||
private String courseTimeName;
|
||||
|
||||
@Column
|
||||
@Comment("条件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private ConditionGroup matchCnd;
|
||||
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.models;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Comment("交友联谊移动端动态表单")
|
||||
@Table("fellowship_mobile_sign_column")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class FellowshipMobileSignColumn {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* train_sign_up_type id
|
||||
*/
|
||||
@Column
|
||||
@Comment("类型id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String typeId;
|
||||
|
||||
@Column
|
||||
@Comment("字段名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String columnName;
|
||||
|
||||
@Column
|
||||
@Comment("字段编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String columnCode;
|
||||
|
||||
@Column
|
||||
@Comment("字段值")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String columnValue;
|
||||
|
||||
@Column
|
||||
@Comment("字段类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String columnType;
|
||||
|
||||
@Column
|
||||
@Comment("下拉框的值")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> selectValues;
|
||||
|
||||
@Column
|
||||
@Comment("是否必填")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isRequired;
|
||||
|
||||
@Column
|
||||
@Comment("控件类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String columnFormType;
|
||||
|
||||
@Column
|
||||
@Comment("文件个数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer fileNumber;
|
||||
|
||||
@Column
|
||||
@Comment("文件类型")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> fileType;
|
||||
|
||||
@Column
|
||||
@Comment("序号")
|
||||
@ColDefine(type = ColType.INT, width = 1)
|
||||
private Integer columnIndex;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Comment("交友联谊的子活动类型")
|
||||
@Table("fellowship_type")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class FellowshipType extends BaseModel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("类型编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 80)
|
||||
private String code;
|
||||
|
||||
@Column
|
||||
@Comment("类型名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 80)
|
||||
private String typeName;
|
||||
|
||||
@Column
|
||||
@Comment("序号")
|
||||
@ColDefine(type = ColType.INT, width = 1)
|
||||
private Integer xh;
|
||||
|
||||
@Column
|
||||
@Comment("是否携带家属")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isBringFamily;
|
||||
|
||||
@Column
|
||||
@Comment("家属纳入总人数")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isAddFamily;
|
||||
|
||||
@Column
|
||||
@Comment("本人纳入总人数")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("1")
|
||||
private Boolean selfAddFamily;
|
||||
|
||||
@Many(field = "typeId")
|
||||
private List<FellowshipMobileSignColumn> mobileSignColumnList;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.models;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Comment("交友联谊类型限制条件")
|
||||
@Table("fellowship_type_limit")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class FellowshipTypeLimit implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("活动id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String activityId;
|
||||
|
||||
@Column
|
||||
@Comment("活动类型id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String typeId;
|
||||
|
||||
@Column
|
||||
@Comment("限制个数")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private int limitNum;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.models;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Comment("交友联谊报名人员")
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableIndexes({@Index(name = "INDEX_FELLOWSHIP_USER_COURSEID", fields = {"courseId"}, unique = false)})
|
||||
public class FellowshipUser implements Serializable {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("活动ID")
|
||||
private String activityId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("课程ID")
|
||||
private String courseId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("用户ID")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("工会ID")
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("单位ID")
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("工会")
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("单位")
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("联系方式")
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("报名时间")
|
||||
private Date signUpTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("活动课程时段id")
|
||||
private String activityCourseId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("手机端报名字段和值")
|
||||
private List<NutMap> mobileColumnsValue;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("用户报名状态(1.正常 2.待报名成功 3.也是正常,但是是从2变为1的 4.废弃[就是没签到的意思])")
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.models;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Comment("交友联谊报名人员子活动表")
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableIndexes({
|
||||
@Index(name = "INDEX_FELLOWSHIP_USER_COURSE_USERID", fields = {"userId"}, unique = false),
|
||||
@Index(name = "INDEX_FELLOWSHIP_USER_COURSE_COURSEID", fields = {"courseId"}, unique = false)
|
||||
})
|
||||
public class FellowshipUserCourse implements Serializable {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("活动ID")
|
||||
private String activityId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("课程ID")
|
||||
private String courseId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("用户ID")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("课程开始时间")
|
||||
private Date courseStartTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("课程结束时间")
|
||||
private Date courseEndTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("是否上课")
|
||||
private boolean isAttend;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("上课打卡时间")
|
||||
private Date attendTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("是否领取礼品")
|
||||
private Boolean isReceive;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("领取礼品时间")
|
||||
private Date receiveTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("签到扫码人员id(二维码模式)")
|
||||
private String signScannerCodeUserId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("礼品扫码人员id(二维码模式)")
|
||||
private String giftScannerCodeUserId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("关联train_sign_up_activity_course表的id")
|
||||
private String activityCourseId;
|
||||
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipActivity;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipCourse;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipUser;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zxy
|
||||
* @Description TODO
|
||||
* @createTime 2022年02月23日 17:14:00
|
||||
*/
|
||||
public interface FellowshipActivityService extends BaseService<FellowshipActivity> {
|
||||
|
||||
/**
|
||||
* 添加活动
|
||||
*
|
||||
* @param activity 活动信息
|
||||
* @param course 培训班信息
|
||||
*/
|
||||
void add(FellowshipActivity activity, FellowshipCourse course);
|
||||
|
||||
/**
|
||||
* 编辑活动
|
||||
*
|
||||
* @param activity 活动信息
|
||||
*/
|
||||
void edit(FellowshipActivity activity);
|
||||
|
||||
/**
|
||||
* 更新活动状态
|
||||
*
|
||||
* @param activity 活动信息
|
||||
*/
|
||||
void updateActivityStatus(FellowshipActivity activity);
|
||||
|
||||
/**
|
||||
* 查询单条活动信息
|
||||
*
|
||||
* @param id 活动ID
|
||||
* @return 返回的数据与前端符合
|
||||
*/
|
||||
NutMap findOne(String id, Cnd cnd, String fromMode);
|
||||
|
||||
/**
|
||||
* pc分页查询
|
||||
*
|
||||
* @param pageForm
|
||||
* @param cnd
|
||||
* @return
|
||||
*/
|
||||
Pagination pageData(PageForm pageForm, Cnd cnd);
|
||||
|
||||
|
||||
/**
|
||||
* 手机端分页查询
|
||||
*
|
||||
* @param pageForm 分页
|
||||
* @param year 年度
|
||||
* @param activityStatus 报名状态 0全部 1进行中 2结束
|
||||
* @return
|
||||
*/
|
||||
Pagination mPageData(PageForm pageForm, Integer year, int activityStatus, Integer activityType);
|
||||
|
||||
/**
|
||||
* 手机端报名
|
||||
*/
|
||||
void doSignUp(FellowshipUser fellowshipUser) throws Exception;
|
||||
|
||||
/**
|
||||
* 异步插入每个报名成功人员的课程数据
|
||||
*
|
||||
* @param activityId
|
||||
* @param courseId
|
||||
* @param userId
|
||||
*/
|
||||
void asyncInsertUserCourse(String activityId, String courseId, String userId);
|
||||
|
||||
/**
|
||||
* 该培训班每个分工会名额是否报满
|
||||
* @return
|
||||
*/
|
||||
boolean isSignFullByUnionId(FellowshipCourse course, Integer currentFamilyNumber);
|
||||
|
||||
/**
|
||||
* 该培训班是否报满
|
||||
*/
|
||||
boolean isSignFull(FellowshipCourse course, Integer currentFamilyNumber);
|
||||
|
||||
/**
|
||||
* 还能报该类型的培训班吗 比如书画班最多报一项 健身班两项
|
||||
* @return
|
||||
*/
|
||||
boolean isSignCourse(FellowshipCourse course, FellowshipActivity activity);
|
||||
|
||||
/**
|
||||
* 当前用户是否已报过该培训班
|
||||
*
|
||||
* @param courseId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
boolean isSignCourseByUser(String courseId, String userId);
|
||||
|
||||
/**
|
||||
* 手机端签到
|
||||
*
|
||||
* @param id 每个培训班每节课每个用户的记录ID
|
||||
*/
|
||||
void doQd(String id);
|
||||
|
||||
/**
|
||||
* 某个用户的签到信息
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @param activityId 活动id
|
||||
*/
|
||||
List<NutMap> qdInfoByUserId(String userId, String activityId);
|
||||
|
||||
List<FellowshipCourse> filterCourseByHostUnion(List<FellowshipCourse> courseList);
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipUser;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zxy
|
||||
* @Description 报名统计service
|
||||
* @createTime 2022年03月03日 10:00:00
|
||||
*/
|
||||
public interface FellowshipActivityStatisticsService extends BaseService<FellowshipUser> {
|
||||
|
||||
/**
|
||||
* 统计分页
|
||||
*
|
||||
* @param pageForm
|
||||
* @param activityId
|
||||
* @return
|
||||
*/
|
||||
Pagination pageData(PageForm pageForm, String activityId);
|
||||
|
||||
/**
|
||||
* 该课程下的报名人员信息
|
||||
*
|
||||
* @param courseId
|
||||
* @return
|
||||
*/
|
||||
List<NutMap> registerUserList(String courseId);
|
||||
|
||||
List<NutMap> getTaleColumnInfo(String courseId);
|
||||
|
||||
/**
|
||||
* 该课程下的报名人员信息
|
||||
*
|
||||
* @param courseId
|
||||
* @return
|
||||
*/
|
||||
List<NutMap> registerUserList(String courseId, String unionId, String unitId, String searchName, String searchKeyword);
|
||||
|
||||
/**
|
||||
* 获取每个课程的签到情况
|
||||
*
|
||||
* @param courseId
|
||||
* @return k->每个培训班每节课的上课时间 v->上课记录list
|
||||
*/
|
||||
Map<String, List<NutMap>> getSignInfo(String courseId);
|
||||
|
||||
/**
|
||||
* 报名人员list 导出
|
||||
* @param activityId
|
||||
* @return
|
||||
*/
|
||||
List<NutMap> baoMingUserList(String activityId);
|
||||
|
||||
int queryCourseCount(String courseId, String courseType);
|
||||
|
||||
int queryCourseWaitCount(String courseId, String courseType);
|
||||
|
||||
int queryCourseCount(String courseId, String courseType, String unionId);
|
||||
|
||||
int queryCourseWaitCount(String courseId, String courseType, String unionId);
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipBlackList;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zxy
|
||||
* @Description TODO
|
||||
* @createTime 2022年03月07日 14:29:00
|
||||
*/
|
||||
public interface FellowshipBlackListService extends BaseService<FellowshipBlackList> {
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param pageForm 分页
|
||||
* @return Pagination
|
||||
*/
|
||||
Pagination pageData(PageForm pageForm, Cnd cnd, String activityId, String courseId);
|
||||
|
||||
/**
|
||||
* 拉黑、解封用户
|
||||
*
|
||||
* @param userId
|
||||
*/
|
||||
void doHandleUser(String userId);
|
||||
|
||||
/**
|
||||
* 上课记录
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<NutMap> attendClassRecord(String userId);
|
||||
|
||||
|
||||
}
|
||||
+473
@@ -0,0 +1,473 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.sys.models.Sys_home_activity;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.*;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityService;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityStatisticsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.async.Async;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zxy
|
||||
* @Description TODO
|
||||
* @createTime 2022年02月23日 17:14:00
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class FellowshipActivityServiceImpl extends BaseServiceImpl<FellowshipActivity> implements FellowshipActivityService {
|
||||
|
||||
@Inject
|
||||
private FellowshipActivityStatisticsService statisticsService;
|
||||
|
||||
public FellowshipActivityServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void add(FellowshipActivity activity, FellowshipCourse course) {
|
||||
|
||||
dao().insert(activity);
|
||||
|
||||
//插入类型限制
|
||||
List<FellowshipTypeLimit> typeLimits = activity.getTypeLimits();
|
||||
typeLimits.forEach(v -> v.setActivityId(activity.getId()));
|
||||
dao().insert(typeLimits);
|
||||
|
||||
List<FellowshipCourse> courseList = activity.getCourseList();
|
||||
for (FellowshipCourse v : courseList) {
|
||||
v.setActivityId(activity.getId());
|
||||
v.setOpenOtherUnion(false);
|
||||
dao().insert(v);
|
||||
this.setCourseTimeAndInsert(v);
|
||||
}
|
||||
|
||||
if (!activity.isDisabled()) {
|
||||
Sys_home_activity sysHomeActivity = activity.covertToSysHomeActivity();
|
||||
dao().insertOrUpdate(sysHomeActivity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void edit(FellowshipActivity activity) {
|
||||
|
||||
//修改活动
|
||||
update(activity);
|
||||
|
||||
//修改类型限制
|
||||
List<FellowshipTypeLimit> typeLimits = activity.getTypeLimits();
|
||||
typeLimits.forEach(v -> v.setActivityId(activity.getId()));
|
||||
if(Lang.isNotEmpty(typeLimits)) {
|
||||
insertOrUpdate(typeLimits);
|
||||
}
|
||||
|
||||
List<FellowshipCourse> courseList = activity.getCourseList();
|
||||
courseList.forEach(v -> {
|
||||
v.setActivityId(activity.getId());
|
||||
dao().insertOrUpdate(v);
|
||||
if (Lang.isNotEmpty(v.getCourseTimeList())) {
|
||||
this.setCourseTimeAndInsert(v);
|
||||
}
|
||||
});
|
||||
|
||||
//查询原来的活动
|
||||
List<FellowshipCourse> oldCourseList = dao().query(FellowshipCourse.class, Cnd.where("activityId", "=", activity.getId()));
|
||||
//原来的培训班id
|
||||
List<String> oldCourseIdList = oldCourseList.stream().map(FellowshipCourse::getId).toList();
|
||||
|
||||
//原来的上课时间
|
||||
List<FellowshipActivityCourse> oldActCourseTimeList = dao().query(FellowshipActivityCourse.class, Cnd.where("activityId", "=", activity.getId()));
|
||||
|
||||
//现在的上课时间
|
||||
List<String> nowCourseTimeListId = new ArrayList<>();
|
||||
activity.getCourseList().forEach(v -> {
|
||||
if (v.getCourseTimeList() != null) {
|
||||
nowCourseTimeListId.addAll(v.getCourseTimeList().stream().map(FellowshipActivityCourse::getId).toList());
|
||||
}
|
||||
});
|
||||
|
||||
List<String> deleteCourseTimeListId = oldActCourseTimeList.stream().map(FellowshipActivityCourse::getId).filter(id -> !nowCourseTimeListId.contains(id)).collect(Collectors.toList());
|
||||
List<String> courseIdList = courseList.stream().map(FellowshipCourse::getId).collect(Collectors.toList());
|
||||
|
||||
//删除关联的培训班
|
||||
List<String> deleteIdList = oldCourseIdList.stream().filter(v -> !courseIdList.contains(v)).collect(Collectors.toList());
|
||||
dao().clear(FellowshipCourse.class, Cnd.where("id", "in", deleteIdList));
|
||||
|
||||
dao().clear(FellowshipActivityCourse.class, Cnd.where("id", "in", deleteCourseTimeListId));
|
||||
dao().clear(FellowshipUser.class, Cnd.where("courseId", "not in", courseIdList).and("activityId", "=", activity.getId()));
|
||||
dao().clear(FellowshipUserCourse.class, Cnd.where("courseId", "not in", courseIdList).and("activityId", "=", activity.getId()));
|
||||
|
||||
//查询修改过培训时间的记录
|
||||
Sql tsuucSql = Sqls.create("""
|
||||
SELECT
|
||||
tsuuc.id,
|
||||
tsuac.courseStartTime,
|
||||
tsuac.courseEndTime
|
||||
FROM
|
||||
`fellowship_user_course` tsuuc
|
||||
LEFT JOIN fellowship_activity_course tsuac ON tsuac.id = tsuuc.activityCourseId
|
||||
where tsuuc.courseStartTime != tsuac.courseStartTime or tsuuc.courseEndTime != tsuac.courseEndTime
|
||||
""");
|
||||
List<NutMap> tsuucList = listMap(tsuucSql);
|
||||
tsuucList.forEach(v -> {
|
||||
Chain chain = Chain.make("courseStartTime", v.getTime("courseStartTime"));
|
||||
chain.add("courseEndTime", v.getTime("courseEndTime"));
|
||||
Cnd cnd = Cnd.where("id", "=", v.getString("id"));
|
||||
dao().update("fellowship_user_course", chain, cnd);
|
||||
});
|
||||
|
||||
if (!activity.isDisabled()) {
|
||||
Sys_home_activity sysHomeActivity = activity.covertToSysHomeActivity();
|
||||
dao().insertOrUpdate(sysHomeActivity);
|
||||
} else {
|
||||
dao().delete(Sys_home_activity.class, activity.getId());
|
||||
}
|
||||
}
|
||||
|
||||
private void setCourseTimeAndInsert(FellowshipCourse course) {
|
||||
course.getCourseTimeList().forEach(courseTime -> {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(courseTime.getCourseDate());
|
||||
int year = calendar.get(Calendar.YEAR);
|
||||
int month = calendar.get(Calendar.MONTH);
|
||||
int day = calendar.get(Calendar.DATE);
|
||||
|
||||
Calendar startCalendar = Calendar.getInstance();
|
||||
startCalendar.setTime(courseTime.getCourseStartTime());
|
||||
startCalendar.set(year, month, day);
|
||||
courseTime.setCourseStartTime(startCalendar.getTime());
|
||||
|
||||
Calendar endCalendar = Calendar.getInstance();
|
||||
endCalendar.setTime(courseTime.getCourseEndTime());
|
||||
endCalendar.set(year, month, day);
|
||||
courseTime.setCourseEndTime(endCalendar.getTime());
|
||||
|
||||
courseTime.setActivityId(course.getActivityId());
|
||||
courseTime.setCourseId(course.getId());
|
||||
dao().insertOrUpdate(courseTime);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void updateActivityStatus(FellowshipActivity activity) {
|
||||
updateIgnoreNull(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap findOne(String id, Cnd cnd, String fromMode) {
|
||||
if (Lang.isEmpty(cnd)) {
|
||||
cnd = Cnd.NEW();
|
||||
}
|
||||
|
||||
cnd.asc("orderNum").asc("campus").desc("courseLocation").asc("courseType").asc("courseName");
|
||||
List<FellowshipCourse> courseArray = dao().query(FellowshipCourse.class, cnd.and("activityId", "=", id));
|
||||
|
||||
if (StrUtil.isNotBlank(fromMode) && "mobile".equals(fromMode)) {
|
||||
courseArray = this.filterCourseByHostUnion(courseArray);
|
||||
}
|
||||
|
||||
FellowshipActivity activity = fetchLinks(dao().fetch(FellowshipActivity.class, id), "^(conditionStructure|typeLimits)$");
|
||||
activity.setCourseList(courseArray);
|
||||
|
||||
List<FellowshipCourse> courseList = activity.getCourseList();
|
||||
|
||||
courseList.forEach(c -> {
|
||||
if (StrUtil.isNotBlank(c.getCourseType())) {
|
||||
dao().fetchLinks(c, "^(courseTimeList)$", Cnd.NEW().asc("courseStartTime"));
|
||||
int courseCount = statisticsService.queryCourseCount(c.getId(), c.getCourseType());
|
||||
c.setHasRegisterNum(courseCount);
|
||||
int courseWaitCount = statisticsService.queryCourseWaitCount(c.getId(), c.getCourseType());
|
||||
c.setHasWaitingNum(courseWaitCount);
|
||||
//当前用户是否报过
|
||||
c.setIsSign(isSignCourseByUser(c.getId(), SecurityUtil.getUserId()));
|
||||
}
|
||||
});
|
||||
return Lang.obj2nutmap(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination pageData(PageForm pageForm, Cnd cnd) {
|
||||
Pagination pagination = listPageLinks(pageForm.getPageNumber(), pageForm.getPageSize(), cnd, "^(courseList)$");
|
||||
return pagination;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination mPageData(PageForm pageForm, Integer year, int activityStatus, Integer activityType) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year", "=", year);
|
||||
switch (activityStatus) {
|
||||
case 2 -> {
|
||||
cnd.and(new Static("activitySignUpStartTime < now()"));
|
||||
cnd.and(new Static("activitySignUpEndTime > now()"));
|
||||
}
|
||||
case 3 -> {
|
||||
cnd.and(new Static("activityStartTime < now()"));
|
||||
cnd.and(new Static("activityEndTime > now()"));
|
||||
}
|
||||
case 4 -> cnd.and(new Static("activityEndTime < now()"));
|
||||
case 5 -> cnd.and(new Static("activityStartTime < now()"));
|
||||
case 6 -> cnd.and(new Static("activityStartTime > now()"));
|
||||
}
|
||||
if (activityType != null && activityType == 1) {
|
||||
cnd.and(new Static("id in (select activityId from fellowship_user where userId = '%s')".formatted(SecurityUtil.getUserId())));
|
||||
}
|
||||
cnd.and("isDisabled", "=", 0);
|
||||
cnd.orderBy("activityEndTime", "desc");
|
||||
cnd.orderBy("isDisabled", "desc");
|
||||
cnd.orderBy("createdAt", "desc");
|
||||
return listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doSignUp(FellowshipUser fellowshipUser) throws Exception {
|
||||
String userId = SecurityUtil.getUserId();
|
||||
|
||||
//查询课程
|
||||
FellowshipCourse course = dao().fetch(FellowshipCourse.class, fellowshipUser.getCourseId());
|
||||
FellowshipType type = dao().fetch(FellowshipType.class, course.getCourseType());
|
||||
//如果这个课程的预留名额方式为报名人数不变
|
||||
if (course.getReserveMode() == 2) {
|
||||
//如果当前报名+已报小于这个课程限制人数
|
||||
//课程已报人数
|
||||
int normalCount = statisticsService.queryCourseCount(course.getId(), course.getCourseType());
|
||||
//+1是算自己
|
||||
int hasRegisterNum = type.getSelfAddFamily() ? normalCount + 1 : 0;
|
||||
fellowshipUser.setState((hasRegisterNum + course.getCourseReservedNumber()) > course.getCoursePeopleNumber() ? 2 : 1);
|
||||
} else {
|
||||
fellowshipUser.setState(1);
|
||||
}
|
||||
|
||||
View_user user = dao().fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
|
||||
fellowshipUser.setUnionId(SecurityUtil.getUnionId());
|
||||
fellowshipUser.setUnionName(user.getUnionName());
|
||||
fellowshipUser.setUnitId(SecurityUtil.getUnitId());
|
||||
fellowshipUser.setUnitName(user.getUnitName());
|
||||
fellowshipUser.setUserId(userId);
|
||||
fellowshipUser.setSignUpTime(new Date());
|
||||
|
||||
dao().insert(fellowshipUser);
|
||||
|
||||
if (StrUtil.isNotBlank(fellowshipUser.getActivityCourseId())) {
|
||||
FellowshipActivityCourse fetch = dao().fetch(FellowshipActivityCourse.class, fellowshipUser.getActivityCourseId());
|
||||
FellowshipUserCourse userCourse = new FellowshipUserCourse();
|
||||
userCourse.setActivityId(fellowshipUser.getActivityId());
|
||||
userCourse.setCourseId(fellowshipUser.getCourseId());
|
||||
userCourse.setUserId(fellowshipUser.getUserId());
|
||||
userCourse.setCourseStartTime(fetch.getCourseStartTime());
|
||||
userCourse.setCourseEndTime(fetch.getCourseEndTime());
|
||||
userCourse.setAttend(false);
|
||||
userCourse.setAttendTime(null);
|
||||
userCourse.setActivityCourseId(fetch.getId());
|
||||
dao().insert(userCourse);
|
||||
} else {
|
||||
asyncInsertUserCourse(fellowshipUser.getActivityId(), fellowshipUser.getCourseId(), fellowshipUser.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
@Async
|
||||
@Override
|
||||
public void asyncInsertUserCourse(String activityId, String courseId, String userId) {
|
||||
log.info("异步插入{}的上课信息,课程ID为{},活动ID为{}", userId, courseId, activityId);
|
||||
List<FellowshipActivityCourse> courseList = dao().query(FellowshipActivityCourse.class, Cnd.where("courseId", "=", courseId));
|
||||
List<FellowshipUserCourse> list = new ArrayList<>();
|
||||
courseList.forEach(v -> {
|
||||
FellowshipUserCourse userCourse = new FellowshipUserCourse();
|
||||
userCourse.setActivityId(activityId);
|
||||
userCourse.setCourseId(courseId);
|
||||
userCourse.setUserId(userId);
|
||||
userCourse.setCourseStartTime(v.getCourseStartTime());
|
||||
userCourse.setCourseEndTime(v.getCourseEndTime());
|
||||
userCourse.setAttend(false);
|
||||
userCourse.setAttendTime(null);
|
||||
userCourse.setActivityCourseId(v.getId());
|
||||
list.add(userCourse);
|
||||
});
|
||||
dao().insert(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 该培训班每个分工会名额是否报满
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean isSignFullByUnionId(FellowshipCourse course, Integer currentFamilyNumber) {
|
||||
List<NutMap> unionLimit = course.getUnionLimit();
|
||||
if (Lang.isEmpty(unionLimit)) {
|
||||
return false;
|
||||
}
|
||||
String unionId = SecurityUtil.getUnionId();
|
||||
NutMap unionLimitMap = unionLimit.stream().filter(v -> v.getString("id").equals(unionId)).findAny().orElse(null);
|
||||
if (Lang.isEmpty(unionLimitMap)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
FellowshipType type = dao().fetch(FellowshipType.class, course.getCourseType());
|
||||
//分工会限制人数
|
||||
int limitCount = unionLimitMap.getInt("limitCount");
|
||||
|
||||
//该课程已经报名的总人数
|
||||
int hasSignCount = statisticsService.queryCourseCount(course.getId(), course.getCourseType(), unionId);
|
||||
int hasWaitCount = statisticsService.queryCourseWaitCount(course.getId(), course.getCourseType());
|
||||
|
||||
//+1是算自己
|
||||
int current = type.getSelfAddFamily() ? 1 : 0;
|
||||
currentFamilyNumber = type.getIsBringFamily() && type.getIsAddFamily() ? currentFamilyNumber : 0;
|
||||
//如果还有正常名额
|
||||
if(limitCount - hasSignCount > 0) {
|
||||
return (hasSignCount + current + currentFamilyNumber) > limitCount;
|
||||
} else {
|
||||
return (hasWaitCount + current + currentFamilyNumber) > course.getWaitingNum();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSignFull(FellowshipCourse course, Integer currentFamilyNumber) {
|
||||
//课程限制人数
|
||||
int coursePeopleNumber = course.getCoursePeopleNumber();
|
||||
if (coursePeopleNumber == 0) {
|
||||
return true;
|
||||
}
|
||||
//查询课程对应的类型
|
||||
FellowshipType type = dao().fetch(FellowshipType.class, course.getCourseType());
|
||||
//课程已报人数
|
||||
int hasSignCount = statisticsService.queryCourseCount(course.getId(), course.getCourseType());
|
||||
int hasWaitCount = statisticsService.queryCourseWaitCount(course.getId(), course.getCourseType());
|
||||
|
||||
//+1是算自己
|
||||
int current = type.getSelfAddFamily() ? 1 : 0;
|
||||
currentFamilyNumber = type.getIsBringFamily() && type.getIsAddFamily() ? currentFamilyNumber : 0;
|
||||
//如果还有正常名额
|
||||
if(coursePeopleNumber - hasSignCount > 0) {
|
||||
return (hasSignCount + current + currentFamilyNumber + course.getCourseReservedNumber()) > coursePeopleNumber;
|
||||
} else {
|
||||
return (hasWaitCount + current + currentFamilyNumber) > course.getWaitingNum();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSignCourse(FellowshipCourse course, FellowshipActivity activity) {
|
||||
//培训班类型
|
||||
String courseType = course.getCourseType();
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
count( tsus.id )
|
||||
FROM
|
||||
`fellowship_user` tsus
|
||||
LEFT JOIN fellowship_course tsuc ON tsuc.id = tsus.courseId
|
||||
WHERE
|
||||
tsuc.courseType = @courseType
|
||||
AND tsus.userId = @userId
|
||||
AND tsus.activityId = @activityId
|
||||
""");
|
||||
sql.setParam("courseType", courseType);
|
||||
sql.setParam("activityId", activity.getId());
|
||||
sql.setParam("userId", SecurityUtil.getUserId());
|
||||
int hasRegisterNum = count(sql);
|
||||
|
||||
//第一种无限制报名
|
||||
if (activity.getRestrictLimit() == null || activity.getRestrictLimit() == 1) {
|
||||
return true;
|
||||
} else if (activity.getRestrictLimit() == 2) {
|
||||
FellowshipTypeLimit signUpTypeLimit = dao().fetch(FellowshipTypeLimit.class, Cnd.where("typeId", "=", courseType).and("activityId", "=", activity.getId()));
|
||||
if (signUpTypeLimit == null) {
|
||||
return true;
|
||||
}
|
||||
//此类型的班最多可报几项
|
||||
int personMaxRegisterNum = signUpTypeLimit.getLimitNum();
|
||||
if (personMaxRegisterNum == 0) {
|
||||
return true;
|
||||
}
|
||||
return hasRegisterNum < personMaxRegisterNum;
|
||||
} else if (activity.getRestrictLimit() == 3) {
|
||||
//第三种,限制报几个,不跟类型挂钩
|
||||
int aCount = dao().count(FellowshipUser.class, Cnd.where("activityId", "=", activity.getId()).and("userId", "=", SecurityUtil.getUserId()));
|
||||
return aCount < activity.getLimitNum();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSignCourseByUser(String courseId, String userId) {
|
||||
return dao().count(FellowshipUser.class, Cnd.where("courseId", "=", courseId).and("userId", "=", userId)) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doQd(String id) {
|
||||
NutMap updateMap = NutMap.NEW();
|
||||
updateMap.put("isAttend", true);
|
||||
updateMap.put("attendTime", new Date());
|
||||
dao().update(FellowshipUserCourse.class, Chain.from(updateMap), Cnd.where("id", "=", id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> qdInfoByUserId(String userId, String activityId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*,
|
||||
t.courseLocationCoordinates,
|
||||
t.isMobileSign,
|
||||
t.signType,
|
||||
t.isReceiveGift,
|
||||
t.giftType,
|
||||
(select state from fellowship_user su where su.activityId = c.activityId and su.courseId = c.courseId and su.userId = c.userId) as state
|
||||
FROM
|
||||
`fellowship_user_course` c
|
||||
LEFT JOIN fellowship_course t ON t.id = c.courseId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("c.activityId", "=", activityId);
|
||||
cnd.and("c.userId", "=", userId);
|
||||
cnd.asc("c.courseStartTime");
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FellowshipCourse> filterCourseByHostUnion(List<FellowshipCourse> courseList) {
|
||||
if (Lang.isEmpty(courseList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return courseList.stream().filter(o -> {
|
||||
if (StrUtil.isBlank(o.getInterTime()) || o.getOpenOtherUnion() == null || o.getOpenOtherUnion()) {
|
||||
return true;
|
||||
} else {
|
||||
if (SecurityUtil.getUnionId().equals(o.getHostUnionId())) {
|
||||
return true;
|
||||
} else {
|
||||
int compare = cn.hutool.core.date.DateUtil.compare(cn.hutool.core.date.DateUtil.date(), cn.hutool.core.date.DateUtil.parse(o.getInterTime()), "yyyy-MM-dd HH:mm");
|
||||
return compare >= 0;
|
||||
}
|
||||
}
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
+263
@@ -0,0 +1,263 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipCourse;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipMobileSignColumn;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipType;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipUser;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipActivityStatisticsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zxy
|
||||
* @Description TODO
|
||||
* @createTime 2022年03月03日 10:02:00
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@Slf4j
|
||||
public class FellowshipActivityStatisticsServiceImpl extends BaseServiceImpl<FellowshipUser> implements FellowshipActivityStatisticsService {
|
||||
|
||||
public FellowshipActivityStatisticsServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination pageData(PageForm pageForm, String activityId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
tsuc.id,
|
||||
tsuc.courseName,
|
||||
tsuc.coursePeopleNumber,
|
||||
tsuc.courseReservedNumber,
|
||||
type.typeName as courseType,
|
||||
tsuc.courseLocation,
|
||||
tsuc.courseInstructor,
|
||||
tsuc.reserveMode,
|
||||
tsuc.isMobileSign,
|
||||
tsuc.hostUnionId,
|
||||
tsuc.interTime,
|
||||
tsuc.waitingNum,
|
||||
tsuc.openOtherUnion,
|
||||
tsuc.courseType as cType
|
||||
FROM
|
||||
`fellowship_course` tsuc
|
||||
LEFT JOIN
|
||||
fellowship_type type on tsuc.courseType = type.id
|
||||
WHERE
|
||||
tsuc.activityId = @activityId
|
||||
ORDER BY tsuc.orderNum
|
||||
""");
|
||||
sql.setParam("activityId", activityId);
|
||||
Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> courseList = pagination.getList();
|
||||
courseList.forEach(c -> {
|
||||
c.put("registerNum", queryCourseCount(c.getString("id"), c.getString("cType")));
|
||||
c.put("hasWaitingNum", queryCourseWaitCount(c.getString("id"), c.getString("cType")));
|
||||
});
|
||||
return pagination;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> registerUserList(String courseId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.sex,
|
||||
tsuu.unionId,
|
||||
tsuu.unionName,
|
||||
tsuu.unitId,
|
||||
tsuu.unitName,
|
||||
ifnull(tsuu.mobile, u.mobile) as mobile,
|
||||
tsuu.signUpTime,
|
||||
tsuu.state,
|
||||
tsuu.mobileColumnsValue
|
||||
FROM
|
||||
fellowship_user tsuu
|
||||
LEFT JOIN `vw_user` u ON u.id = tsuu.userId
|
||||
$condition
|
||||
ORDER BY FIELD( tsuu.state, 1, 3, 2, 4 ),tsuu.signUpTime desc,u.unionid desc, u.unitid desc
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("tsuu.courseId", "=", courseId);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = listMap(sql);
|
||||
for (NutMap o : list) {
|
||||
if(StrUtil.isBlank(o.getString("mobileColumnsValue"))) {
|
||||
continue;
|
||||
}
|
||||
List<NutMap> mobileColumnsValue = Json.fromJsonAsList(NutMap.class, o.getString("mobileColumnsValue"));
|
||||
if(Lang.isNotEmpty(mobileColumnsValue)) {
|
||||
mobileColumnsValue.forEach(m -> {
|
||||
o.put(m.getString("columnCode"), m.getString("columnValue"));
|
||||
});
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getTaleColumnInfo(String courseId) {
|
||||
FellowshipCourse course = dao().fetch(FellowshipCourse.class, courseId);
|
||||
FellowshipType upType = dao().fetch(FellowshipType.class, course.getCourseType());
|
||||
dao().fetchLinks(upType, "mobileSignColumnList", Cnd.NEW().asc("columnIndex"));
|
||||
|
||||
List<FellowshipMobileSignColumn> columnList = upType.getMobileSignColumnList();
|
||||
List<NutMap> columnTableList = columnList.stream().map(o -> NutMap.NEW().setv("label", o.getColumnName()).setv("prop", o.getColumnCode())).collect(Collectors.toList());
|
||||
return columnTableList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> registerUserList(String courseId, String unionId, String unitId, String searchName, String searchKeyword) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
tsuu.id,
|
||||
u.id as userId,
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
u.sex,
|
||||
ifnull(tsuu.mobile, u.mobile) as mobile,
|
||||
tsuu.signUpTime,
|
||||
tsuu.state
|
||||
FROM
|
||||
fellowship_user tsuu
|
||||
LEFT JOIN `vw_user` u ON u.id = tsuu.userId
|
||||
$condition
|
||||
ORDER BY FIELD( tsuu.state, 1, 3, 2, 4 ),tsuu.signUpTime desc,u.unionid desc, u.unitid desc
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("tsuu.courseId", "=", courseId);
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
cnd.andEX("u.unitid", "=", unitId);
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.andLike("username", searchKeyword).orLike("loginname", searchKeyword);
|
||||
cnd.and(group);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<NutMap>> getSignInfo(String courseId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
tsuuc.courseStartTime,
|
||||
tsuuc.courseEndTime,
|
||||
tsuuc.isAttend,
|
||||
tsuuc.attendTime,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.unitname,
|
||||
u.unionname
|
||||
FROM
|
||||
`fellowship_user_course` tsuuc
|
||||
LEFT JOIN `vw_user` u ON u.id = tsuuc.userId
|
||||
WHERE
|
||||
tsuuc.courseId = @courseId
|
||||
""");
|
||||
sql.setParam("courseId", courseId);
|
||||
List<NutMap> list = listMap(sql);
|
||||
|
||||
Map<String, List<NutMap>> courseTimeMap = list.stream().map(v -> {
|
||||
String courseTime = v.getString("courseStartTime") + " 至 " + v.getString("courseEndTime");
|
||||
v.put("courseTime", courseTime);
|
||||
return v;
|
||||
}).collect(Collectors.groupingBy(v -> v.getString("courseTime")));
|
||||
|
||||
// 使用Stream API进行降序排序
|
||||
Map<String, List<NutMap>> sortedDataMap = courseTimeMap.entrySet().stream()
|
||||
.sorted(Map.Entry.comparingByKey(Comparator.naturalOrder()))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));
|
||||
|
||||
return sortedDataMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> baoMingUserList(String activityId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.unitname,
|
||||
u.unionname,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
uc.courseName,
|
||||
uc.campus
|
||||
FROM
|
||||
`fellowship_user` uu
|
||||
RIGHT JOIN fellowship_course uc ON uc.id = uu.courseId
|
||||
LEFT JOIN `vw_user` u ON u.id = uu.userId
|
||||
WHERE
|
||||
uc.activityId = @activityId
|
||||
ORDER BY u.unitCode,u.unioncode,u.sex
|
||||
""");
|
||||
sql.setParam("activityId", activityId);
|
||||
return listMap(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int queryCourseCount(String courseId, String courseType) {
|
||||
return this.queryCourseCount(courseId, courseType, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int queryCourseWaitCount(String courseId, String courseType) {
|
||||
return this.queryCourseWaitCount(courseId, courseType, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int queryCourseCount(String courseId, String courseType, String unionId) {
|
||||
return this.calcSignCount(courseId, courseType, unionId, List.of(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int queryCourseWaitCount(String courseId, String courseType, String unionId) {
|
||||
return this.calcSignCount(courseId, courseType, unionId, List.of(2));
|
||||
}
|
||||
|
||||
private int calcSignCount(String courseId, String courseType, String unionId, List<Integer> stateList) {
|
||||
if(StrUtil.isBlank(courseId) || StrUtil.isBlank(courseType)) {
|
||||
return 0;
|
||||
}
|
||||
FellowshipType type = dao().fetch(FellowshipType.class, courseType);
|
||||
AtomicInteger hasRegisterNum = new AtomicInteger();
|
||||
List<FellowshipUser> signUpUsers = dao().query(FellowshipUser.class, Cnd.where("courseId", "=", courseId)
|
||||
.and("state", "in", stateList)
|
||||
.andEX("unionId", "=", unionId));
|
||||
signUpUsers.forEach(item -> {
|
||||
if (type.getSelfAddFamily()) {
|
||||
hasRegisterNum.getAndIncrement();
|
||||
}
|
||||
if(type.getIsBringFamily() && type.getIsAddFamily()) {
|
||||
List<NutMap> mobileColumnsValue = item.getMobileColumnsValue();
|
||||
NutMap map = mobileColumnsValue.stream().filter(o -> "xdqsrs".equals(o.getString("columnCode"))).findAny().orElse(null);
|
||||
int number = map != null ? map.getInt("columnValue") : 0;
|
||||
hasRegisterNum.addAndGet(number);
|
||||
}
|
||||
});
|
||||
return hasRegisterNum.get();
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package com.budwk.app.zhgh.activity.fellowship.service.impl;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipBlackList;
|
||||
import com.budwk.app.zhgh.activity.fellowship.service.FellowshipBlackListService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Criteria;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zxy
|
||||
* @Description TODO
|
||||
* @createTime 2022年03月07日 14:29:00
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class FellowshipUserServiceImpl extends BaseServiceImpl<FellowshipBlackList> implements FellowshipBlackListService {
|
||||
|
||||
public FellowshipUserServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination pageData(PageForm pageForm, Cnd cnd, String activityId, String courseId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id AS userId,
|
||||
u.username,
|
||||
u.loginname,
|
||||
ifnull(tsuu.mobile, u.mobile) as mobile,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
tsuc.courseName,
|
||||
tsuu.state,
|
||||
( SELECT count( 1 ) FROM fellowship_user_course WHERE userId = tsuu.userId $var) courseTotal,
|
||||
( SELECT count( 1 ) FROM fellowship_user_course WHERE userId = tsuu.userId AND isAttend = 0 and tsuu.state!=2 AND now()> courseEndTime $var) AS absentCount,
|
||||
if(tsubl.isDisabled=1,true,false) isDisabled,
|
||||
group_CONCAT( tsuc.courseName ) AS courseNames
|
||||
FROM
|
||||
`fellowship_user` tsuu
|
||||
LEFT JOIN `vw_user` u ON u.id = tsuu.userId
|
||||
LEFT JOIN fellowship_activity act on act.id = tsuu.activityId
|
||||
LEFT JOIN fellowship_course tsuc ON tsuc.id = tsuu.courseId
|
||||
LEFT JOIN fellowship_black_list tsubl on tsubl.userId = tsuu.userId
|
||||
$condition
|
||||
ORDER BY FIELD( tsuu.state, 1, 3, 2, 4 )
|
||||
""");
|
||||
cnd.groupBy("tsuu.userId");
|
||||
Criteria varCnd = Cnd.cri();
|
||||
varCnd.where().setTop(false);
|
||||
varCnd.where().andEX("activityId", "=", activityId);
|
||||
varCnd.where().andEX("courseId", "=", courseId);
|
||||
if (!varCnd.where().isEmpty()) {
|
||||
sql.vars().set("var", "and " + varCnd.toSql(null));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void doHandleUser(String userId) {
|
||||
FellowshipBlackList blackRecord = dao().fetch(FellowshipBlackList.class, Cnd.where("userId", "=", userId));
|
||||
if (Lang.isEmpty(blackRecord)) {
|
||||
FellowshipBlackList blackList = new FellowshipBlackList();
|
||||
blackList.setUserId(userId);
|
||||
blackList.setIsDisabled(true);
|
||||
dao().insert(blackList);
|
||||
} else {
|
||||
// blackRecord.setIsDisabled(!blackRecord.getIsDisabled());
|
||||
// dao().update(blackRecord);
|
||||
dao().delete(blackRecord);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> attendClassRecord(String userId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.courseName,
|
||||
uc.courseStartTime,
|
||||
courseEndTime,
|
||||
uc.isAttend,
|
||||
uc.attendTime
|
||||
FROM
|
||||
`fellowship_user_course` uc
|
||||
LEFT JOIN fellowship_course c ON c.id = uc.courseId
|
||||
WHERE
|
||||
uc.userId = @userId
|
||||
""");
|
||||
sql.setParam("userId", userId);
|
||||
return listMap(sql);
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.budwk.app.zhgh.dayofficework.asset.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.dayofficework.asset.model.Asset;
|
||||
import com.budwk.app.zhgh.dayofficework.asset.model.AssetCategory;
|
||||
import com.budwk.app.zhgh.dayofficework.asset.service.AssetService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/12/1 15:35
|
||||
* @description 数据分析
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/asset/analyze")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "资产分析")
|
||||
public class AssetAnalyzeController {
|
||||
|
||||
|
||||
@Inject
|
||||
private AssetService assetService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/asset/analyze/index.html")
|
||||
@SaCheckPermission("asset.analyze")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("asset.analyze")
|
||||
public Result pageData(String assetUsageStateName) {
|
||||
|
||||
List<AssetCategory> zclbList = assetService.dao().query(AssetCategory.class, Cnd.NEW().asc("categoryCode"));
|
||||
|
||||
List<Asset> zcxxList = assetService.query(Cnd.NEW().andEX(Asset::getAssetUsageStateName, "=", assetUsageStateName));
|
||||
|
||||
List<NutMap> list = new ArrayList<>();
|
||||
zclbList.forEach(z -> {
|
||||
int sl = zcxxList.stream().filter(zc -> zc.getAssetCategoryId().equals(z.getId())).mapToInt(Asset::getAssetQuantity).sum();
|
||||
zcxxList.stream().filter(zc -> zc.getAssetCategoryId().equals(z.getId())).toList().forEach(zc -> {
|
||||
zc.setAllMoney(zc.getAssetUnitPrice().multiply(new BigDecimal(zc.getAssetQuantity())));
|
||||
});
|
||||
Double je = zcxxList.stream().filter(zc -> zc.getAssetCategoryId().equals(z.getId())).mapToDouble(v -> v.getAllMoney().doubleValue()).sum();
|
||||
NutMap map = new NutMap();
|
||||
map.setv("typeCode", z.getCategoryCode());
|
||||
map.setv("type", z.getCategoryName());
|
||||
map.setv("sl", sl);
|
||||
map.setv("je", String.format("%.2f", je));
|
||||
list.add(map);
|
||||
});
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -138,5 +138,7 @@ public class Asset extends BaseModel implements Serializable {
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
private String assetStorageLocation;
|
||||
|
||||
private BigDecimal allMoney;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-4
@@ -73,19 +73,18 @@ public class HonorBasicSettingsController {
|
||||
@SaCheckPermission("honor.basic.setting")
|
||||
public Result doSubmit(HonorBasicSettings honorBasicSettings) {
|
||||
try {
|
||||
Dao dao = honorCommonService.dao();
|
||||
if (StrUtil.isBlank(honorBasicSettings.getId())) {
|
||||
int count = dao.count(HonorBasicSettings.class, Cnd.where("name", "=", honorBasicSettings.getName()));
|
||||
if (count > 0) {
|
||||
return Result.error("名称已存在,请勿重复添加。");
|
||||
} else {
|
||||
dao.insert(honorBasicSettings);
|
||||
honorCommonService.insert(honorBasicSettings);
|
||||
return Result.success();
|
||||
}
|
||||
} else {
|
||||
dao.updateIgnoreNull(honorBasicSettings);
|
||||
honorCommonService.updateIgnoreNull(honorBasicSettings);
|
||||
}
|
||||
dao.update(Chain.make("hasChildren", true), Cnd.where("id", "=", honorBasicSettings.getParentId()));
|
||||
honorCommonService.dao().update(HonorBasicSettings.class,Chain.make("hasChildren", true), Cnd.where("id", "=", honorBasicSettings.getParentId()));
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
|
||||
@@ -22,7 +22,7 @@ public class HonorBasicSettings extends BaseModel {
|
||||
@Column
|
||||
@Name
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
@PrevInsert(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
|
||||
+2
@@ -72,6 +72,7 @@ public class UnionReimburseCollectController {
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "reimburseProject") String reimburseProject,
|
||||
@Param(value = "reimburseFundSource") String reimburseFundSource,
|
||||
@Param(value = "userName") String searchKeyword) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -109,6 +110,7 @@ public class UnionReimburseCollectController {
|
||||
|
||||
// 报销项目查询条件
|
||||
cnd.andEX("info.reimburseProject", "=", reimburseProject);
|
||||
cnd.andEX("info.reimburseFundSource", "=", reimburseFundSource);
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ public class UnionReimburseReviewController {
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "019925d2-6f33-449a-9fb0-34c470222e99");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
// cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
|
||||
+5
@@ -139,6 +139,11 @@ public class UnionReimburse extends BaseModel {
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
@Column
|
||||
@Comment("申请人签字")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String applySign;
|
||||
|
||||
|
||||
/**
|
||||
* 慰问
|
||||
|
||||
+80
-45
@@ -17,6 +17,7 @@ import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.sms.SmsService;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||
@@ -91,6 +92,9 @@ public class TeacherCongressDelegatePushController {
|
||||
@Inject
|
||||
private TeacherCongressDelegatePushService teacherCongressDelegatePushService;
|
||||
|
||||
@Inject
|
||||
private SmsService smsService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/delegate/push/index.html")
|
||||
@SaCheckPermission("tc.delegate.push")
|
||||
@@ -308,6 +312,8 @@ public class TeacherCongressDelegatePushController {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
});
|
||||
List<String> loginnames = list.stream().map(TeacherCongressDelegatePush::getLoginName).toList();
|
||||
smsService.massSend(loginnames, "智慧工会", SecurityUtil.getUserUsername() + "推选了您为代表请到智慧工会PC端进行填写信息!");
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -321,35 +327,62 @@ public class TeacherCongressDelegatePushController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("提交到资格审查")
|
||||
@SaCheckPermission("tc.delegate.push")
|
||||
@SLog(tag = "代表管理-代表推选", msg = "提交到资格审查")
|
||||
public Result batchSubmit(String sessionId) {
|
||||
String str = teacherCongressDelegatePushService.batchSubmitWhere(sessionId, "JG");
|
||||
if (StrUtil.isNotBlank(str)) {
|
||||
return Result.error(str);
|
||||
}
|
||||
teacherCongressDelegatePushService.batchSubmit("JG", sessionId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("本单位代表上报情况")
|
||||
@SaCheckPermission(value = {"tc.delegate.push", "tc.delegate.push.dwSjAudit"}, mode = SaMode.OR)
|
||||
@SaCheckPermission(value = {"tc.delegate.push", "tc.delegate.push.dwSjAudit", "tc.delegate.push.unionFzrAudit"}, mode = SaMode.OR)
|
||||
public Result selfUnionPushMetric(String sessionId, String unionId, String submitType) {
|
||||
if (StrUtil.isBlank(unionId)) {
|
||||
unionId = SecurityUtil.getUnionId();
|
||||
}
|
||||
Integer allocationNum = 0;
|
||||
Integer femaleNum = 0;
|
||||
Integer seniorTeaNum = 0;
|
||||
Integer intermediateBelowNum = 0;
|
||||
Integer cadreNum = 0;
|
||||
Integer ordinaryTeaNum = 0;
|
||||
Integer less45Num = 0;
|
||||
Integer workerNum = 0;
|
||||
|
||||
|
||||
List<String> unionIds = new ArrayList<>();
|
||||
if (StrUtil.isBlank(unionId)) {
|
||||
if (!AuthUtil.hasRole(RoleConstant.BRANCH_UNION_MANAGER.name())) {
|
||||
unionId = SecurityUtil.getUnionId();
|
||||
} else {
|
||||
unionIds.add("563dcfc5033d4631bc7f6482b2d427b9");
|
||||
unionIds.add("9b2650eec5114a18a0d2a09803800a39");
|
||||
}
|
||||
}
|
||||
Teacher_congress_quota_allocation allocation = dao.fetch(Teacher_congress_quota_allocation.class,
|
||||
Cnd.where(Teacher_congress_quota_allocation::getSessionId, "=", sessionId)
|
||||
.and(Teacher_congress_quota_allocation::getUnionId, "=", unionId));
|
||||
if (allocation == null) {
|
||||
if (allocation != null) {
|
||||
allocationNum = allocation.getAllocationNum();
|
||||
femaleNum = allocation.getFemaleNum();
|
||||
seniorTeaNum = allocation.getSeniorTeaNum();
|
||||
intermediateBelowNum = allocation.getIntermediateBelowNum();
|
||||
cadreNum = allocation.getCadreNum();
|
||||
ordinaryTeaNum = allocation.getOrdinaryTeaNum();
|
||||
less45Num = allocation.getLess45Num();
|
||||
workerNum = allocation.getWorkerNum();
|
||||
}
|
||||
|
||||
if (!unionIds.isEmpty()) {
|
||||
List<Teacher_congress_quota_allocation> allocationList = dao.query(Teacher_congress_quota_allocation.class,
|
||||
Cnd.where(Teacher_congress_quota_allocation::getSessionId, "=", sessionId)
|
||||
.and(Teacher_congress_quota_allocation::getUnionId, "in", unionIds));
|
||||
allocationNum = allocationList.stream().mapToInt(Teacher_congress_quota_allocation::getAllocationNum).sum();
|
||||
femaleNum = allocationList.stream().mapToInt(Teacher_congress_quota_allocation::getFemaleNum).sum();
|
||||
seniorTeaNum = allocationList.stream().mapToInt(Teacher_congress_quota_allocation::getSeniorTeaNum).sum();
|
||||
intermediateBelowNum = allocationList.stream().mapToInt(Teacher_congress_quota_allocation::getIntermediateBelowNum).sum();
|
||||
cadreNum = allocationList.stream().mapToInt(Teacher_congress_quota_allocation::getCadreNum).sum();
|
||||
ordinaryTeaNum = allocationList.stream().mapToInt(Teacher_congress_quota_allocation::getOrdinaryTeaNum).sum();
|
||||
less45Num = allocationList.stream().mapToInt(Teacher_congress_quota_allocation::getLess45Num).sum();
|
||||
workerNum = allocationList.stream().mapToInt(Teacher_congress_quota_allocation::getWorkerNum).sum();
|
||||
}
|
||||
if (allocation == null && unionIds.isEmpty()) {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*
|
||||
@@ -361,18 +394,20 @@ public class TeacherCongressDelegatePushController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("info.pushUnionId", "in", unionIds);
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
if (submitType.equals("JG")) {
|
||||
group.or("t.taskName", "=", "tcDelegatePushDwSjTj");
|
||||
group.or("t.taskName", "=", "tcDelegatePushUnionFzr");
|
||||
} else {
|
||||
group.or("t.taskName", "=", "tcDelegatePushUnion");
|
||||
group.or("t.taskName", "=", "tcDelegatePushDwSjTj");
|
||||
|
||||
}
|
||||
group.or("t.taskName", "=", "tcDelegatePushZg");
|
||||
group.or("t.taskName", "is", null);
|
||||
cnd.and(group);
|
||||
cnd.and("ins.state", "!=", ProcessInstanceStateEnum.REJECT.getCode());
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.pushUnionId", "=", unionId);
|
||||
cnd.andEX("info.schoolLeader", "!=", 1);
|
||||
cnd.andEX("info.representativeType", "=", "正式代表");
|
||||
sql.setCondition(cnd);
|
||||
@@ -406,58 +441,58 @@ public class TeacherCongressDelegatePushController {
|
||||
|
||||
HashMap<String, Object> totalMap = new HashMap<>();
|
||||
totalMap.put("current", total);
|
||||
totalMap.put("target", allocation.getAllocationNum());
|
||||
totalMap.put("progress", allocation.getAllocationNum() != 0 ? (double) total / allocation.getAllocationNum() : 0.0);
|
||||
totalMap.put("remaining", allocation.getAllocationNum() - total);
|
||||
totalMap.put("target", allocationNum);
|
||||
totalMap.put("progress", allocationNum != 0 ? (double) total / allocationNum : 0.0);
|
||||
totalMap.put("remaining", allocationNum - total);
|
||||
hashMap.put("total", totalMap);
|
||||
|
||||
HashMap<String, Object> femaleMap = new HashMap<>();
|
||||
femaleMap.put("current", female);
|
||||
femaleMap.put("target", allocation.getFemaleNum());
|
||||
femaleMap.put("progress", allocation.getFemaleNum() != 0 ? (double) female / allocation.getFemaleNum() : 0.0);
|
||||
femaleMap.put("remaining", allocation.getFemaleNum() - female);
|
||||
femaleMap.put("target", femaleNum);
|
||||
femaleMap.put("progress", femaleNum != 0 ? (double) female / femaleNum : 0.0);
|
||||
femaleMap.put("remaining", femaleNum - female);
|
||||
hashMap.put("female", femaleMap);
|
||||
|
||||
HashMap<String, Object> seniorTeaMap = new HashMap<>();
|
||||
seniorTeaMap.put("current", seniorTeacher);
|
||||
seniorTeaMap.put("target", allocation.getSeniorTeaNum());
|
||||
seniorTeaMap.put("progress", allocation.getSeniorTeaNum() != 0 ? (double) seniorTeacher / allocation.getSeniorTeaNum() : 0.0);
|
||||
seniorTeaMap.put("remaining", allocation.getSeniorTeaNum() - seniorTeacher);
|
||||
seniorTeaMap.put("target", seniorTeaNum);
|
||||
seniorTeaMap.put("progress", seniorTeaNum != 0 ? (double) seniorTeacher / seniorTeaNum : 0.0);
|
||||
seniorTeaMap.put("remaining", seniorTeaNum - seniorTeacher);
|
||||
hashMap.put("seniorTeacher", seniorTeaMap);
|
||||
|
||||
HashMap<String, Object> intermediateBelowMap = new HashMap<>();
|
||||
intermediateBelowMap.put("current", intermediateBelow);
|
||||
intermediateBelowMap.put("target", allocation.getIntermediateBelowNum());
|
||||
intermediateBelowMap.put("progress", allocation.getIntermediateBelowNum() != 0 ? (double) intermediateBelow / allocation.getIntermediateBelowNum() : 0.0);
|
||||
intermediateBelowMap.put("remaining", allocation.getIntermediateBelowNum() - intermediateBelow);
|
||||
intermediateBelowMap.put("target", intermediateBelowNum);
|
||||
intermediateBelowMap.put("progress", intermediateBelowNum != 0 ? (double) intermediateBelow / intermediateBelowNum : 0.0);
|
||||
intermediateBelowMap.put("remaining", intermediateBelowNum - intermediateBelow);
|
||||
hashMap.put("intermediateBelow", intermediateBelowMap);
|
||||
|
||||
HashMap<String, Object> cadreMap = new HashMap<>();
|
||||
cadreMap.put("current", cadre);
|
||||
cadreMap.put("target", allocation.getCadreNum());
|
||||
cadreMap.put("progress", allocation.getCadreNum() != 0 ? (double) cadre / allocation.getCadreNum() : 0.0);
|
||||
cadreMap.put("remaining", allocation.getCadreNum() - cadre);
|
||||
cadreMap.put("target", cadreNum);
|
||||
cadreMap.put("progress", cadreNum != 0 ? (double) cadre / cadreNum : 0.0);
|
||||
cadreMap.put("remaining", cadreNum - cadre);
|
||||
hashMap.put("cadre", cadreMap);
|
||||
|
||||
HashMap<String, Object> workerMap = new HashMap<>();
|
||||
workerMap.put("current", worker);
|
||||
workerMap.put("target", allocation.getWorkerNum());
|
||||
workerMap.put("progress", allocation.getWorkerNum() != 0 ? (double) worker / allocation.getWorkerNum() : 0.0);
|
||||
workerMap.put("remaining", allocation.getWorkerNum() - cadre);
|
||||
workerMap.put("target", workerNum);
|
||||
workerMap.put("progress", workerNum != 0 ? (double) worker / workerNum : 0.0);
|
||||
workerMap.put("remaining", workerNum - cadre);
|
||||
hashMap.put("worker", workerMap);
|
||||
|
||||
HashMap<String, Object> ordinaryTeaMap = new HashMap<>();
|
||||
ordinaryTeaMap.put("current", ordinaryTeacher);
|
||||
ordinaryTeaMap.put("target", allocation.getOrdinaryTeaNum());
|
||||
ordinaryTeaMap.put("progress", allocation.getOrdinaryTeaNum() != 0 ? (double) ordinaryTeacher / allocation.getOrdinaryTeaNum() : 0.0);
|
||||
ordinaryTeaMap.put("remaining", allocation.getOrdinaryTeaNum() - ordinaryTeacher);
|
||||
ordinaryTeaMap.put("target", ordinaryTeaNum);
|
||||
ordinaryTeaMap.put("progress", ordinaryTeaNum != 0 ? (double) ordinaryTeacher / ordinaryTeaNum : 0.0);
|
||||
ordinaryTeaMap.put("remaining", ordinaryTeaNum - ordinaryTeacher);
|
||||
hashMap.put("ordinaryTeacher", ordinaryTeaMap);
|
||||
|
||||
HashMap<String, Object> under45Map = new HashMap<>();
|
||||
under45Map.put("current", under45);
|
||||
under45Map.put("target", allocation.getLess45Num());
|
||||
under45Map.put("progress", allocation.getLess45Num() != 0 ? (double) under45 / allocation.getLess45Num() : 0.0);
|
||||
under45Map.put("remaining", allocation.getLess45Num() - under45);
|
||||
under45Map.put("target", less45Num);
|
||||
under45Map.put("progress", less45Num != 0 ? (double) under45 / less45Num : 0.0);
|
||||
under45Map.put("remaining", less45Num - under45);
|
||||
hashMap.put("under45", under45Map);
|
||||
|
||||
/* HashMap<String, Object> ethnicMinorityMap = new HashMap<>();
|
||||
|
||||
+17
-1
@@ -9,10 +9,13 @@ import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.sms.SmsService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.entity.ProcessTaskActor;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
@@ -64,6 +67,9 @@ public class TeacherCongressDelegatePushDwFzrAuditController {
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@Inject
|
||||
private SmsService smsService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/delegate/push/dwFzrAudit.html")
|
||||
@SaCheckPermission("tc.delegate.push.dwFzrAudit")
|
||||
@@ -117,7 +123,7 @@ public class TeacherCongressDelegatePushDwFzrAuditController {
|
||||
cnd.and("info.representativeType", "=", isFormalOrAttendance);
|
||||
}
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.pushUnionId", "=", unionId);
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
@@ -142,5 +148,15 @@ public class TeacherCongressDelegatePushDwFzrAuditController {
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("tc.delegate.push.dwFzrAudit")
|
||||
public void sms(String tf_type, String instanceId) {
|
||||
if ("ROLLBACK".equals(tf_type)) {
|
||||
ProcessTask task = dao.fetch(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", instanceId).desc("id"));
|
||||
ProcessTaskActor processTask = dao.fetch(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
|
||||
smsService.send(processTask.getActorAccount(), "智慧工会", "单位负责人退回您填写的代表信息,请前往PC端进行修改!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -148,11 +148,11 @@ public class TeacherCongressDelegatePushDwSjAuditController {
|
||||
@SaCheckPermission("tc.delegate.push.dwSjAudit")
|
||||
public Result batchSubmit(String sessionId) {
|
||||
|
||||
String str = teacherCongressDelegatePushService.batchSubmitWhere(sessionId, "XY");
|
||||
String str = teacherCongressDelegatePushService.batchSubmitWhere(sessionId, null,"XY");
|
||||
if (StrUtil.isNotBlank(str)) {
|
||||
return Result.error(str);
|
||||
}
|
||||
teacherCongressDelegatePushService.batchSubmit("XY", sessionId);
|
||||
teacherCongressDelegatePushService.batchSubmit("XY", null,sessionId);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.delegate.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.service.TeacherCongressDelegatePushService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/11/26 19:02
|
||||
* @description 分工会负责人提交
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/teacherCongress/delegate/push/unionFzrAudit")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(value = "/platform/teacherCongress/delegate/push/unionFzrAudit", tags = "分工会负责人提交")
|
||||
public class TeacherCongressDelegatePushUnionFzrAuditController {
|
||||
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@Inject
|
||||
private TeacherCongressDelegatePushService teacherCongressDelegatePushService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/delegate/push/unionFzrAudit.html")
|
||||
@SaCheckPermission("tc.delegate.push.unionFzrAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("tc.delegate.push.unionFzrAudit")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "sessionId") String sessionId,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "approval") Boolean approval,
|
||||
@Param(value = "isFormalOrAttendance") String isFormalOrAttendance) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN teacher_congress_delegate_push info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "tcDelegatePushUnionFzr");
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
if (!"全部".equals(isFormalOrAttendance)) {
|
||||
cnd.and("info.representativeType", "=", isFormalOrAttendance);
|
||||
}
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
cnd.andEX("info.pushUnionId", "=", unionId);
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("info.userName", pageForm.getSearchKeyword());
|
||||
group.orLike("info.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分工会负责人提交")
|
||||
@SaCheckPermission("tc.delegate.push.unionFzrAudit")
|
||||
@SLog(tag = "代表管理-分工会负责人提交", msg = "提交到资格审查")
|
||||
public Result batchSubmit(@Valid String sessionId, @Valid String unionId) {
|
||||
String str = teacherCongressDelegatePushService.batchSubmitWhere(sessionId, unionId, "JG");
|
||||
if (StrUtil.isNotBlank(str)) {
|
||||
return Result.error(str);
|
||||
}
|
||||
if (StrUtil.isBlank(unionId)) {
|
||||
return Result.error("请选择工会");
|
||||
}
|
||||
teacherCongressDelegatePushService.batchSubmit("JG", unionId, sessionId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+9
-1
@@ -7,7 +7,10 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.sms.SmsService;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.entity.ProcessTaskActor;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
@@ -51,6 +54,8 @@ public class TeacherCongressDelegatePushWriteController {
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@Inject
|
||||
private SmsService smsService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/delegate/push/write.html")
|
||||
@@ -118,7 +123,7 @@ public class TeacherCongressDelegatePushWriteController {
|
||||
@ApiOperation("代表信息填写提交")
|
||||
@SaCheckLogin
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result submit(TeacherCongressDelegatePush teacherCongressDelegatePush,String taskId){
|
||||
public Result submit(TeacherCongressDelegatePush teacherCongressDelegatePush,String taskId,String instanceId){
|
||||
dao.updateIgnoreNull(teacherCongressDelegatePush);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
@@ -133,6 +138,9 @@ public class TeacherCongressDelegatePushWriteController {
|
||||
dict.set("argsUnitId",teacherCongressDelegatePush.getPushUnitId());
|
||||
}
|
||||
flowCommonService.executeTask(dict);
|
||||
ProcessTask task = dao.fetch(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", instanceId).desc("id"));
|
||||
ProcessTaskActor processTask = dao.fetch(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
|
||||
smsService.send(processTask.getActorAccount(), "智慧工会", teacherCongressDelegatePush.getUserName() + "填写了代表信息请您审核!");
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.TeacherCong
|
||||
|
||||
public interface TeacherCongressDelegatePushService extends BaseService<TeacherCongressDelegatePush> {
|
||||
|
||||
void batchSubmit(String submitType, String sessionId);
|
||||
void batchSubmit(String submitType, String unionId ,String sessionId);
|
||||
|
||||
String batchSubmitWhere(String sessionId,String submitType);
|
||||
String batchSubmitWhere(String sessionId,String unionId,String submitType);
|
||||
|
||||
}
|
||||
|
||||
+23
-13
@@ -3,12 +3,14 @@ package com.budwk.app.zhgh.democratic.teachercongress.delegate.service;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.TeacherCongressDelegatePush;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_quota_allocation;
|
||||
@@ -21,6 +23,7 @@ import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -38,7 +41,7 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl<Teac
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@Override
|
||||
public void batchSubmit(String submitType, String sessionId) {
|
||||
public void batchSubmit(String submitType, String unionId, String sessionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
@@ -65,12 +68,12 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl<Teac
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (submitType.equals("XY")){
|
||||
if (submitType.equals("XY")) {
|
||||
cnd.and("t.taskName", "=", "tcDelegatePushDwSjTj");
|
||||
cnd.and("info.pushUnitId","=",SecurityUtil.getUnitId());
|
||||
}else{
|
||||
cnd.and("t.taskName", "=", "tcDelegatePushUnion");
|
||||
cnd.and("info.pushUnionId","=",SecurityUtil.getUnionId());
|
||||
cnd.and("info.pushUnitId", "=", SecurityUtil.getUnitId());
|
||||
} else {
|
||||
cnd.and("t.taskName", "=", "tcDelegatePushUnionFzr");
|
||||
cnd.and("info.pushUnionId", "=", unionId);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> delegatePushList = listMap(sql);
|
||||
@@ -79,17 +82,24 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl<Teac
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, push.getString("taskId"));
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.AGREE.getCode());
|
||||
dict.set(FlowConst.EXT_ENABLE_OPERATOR,true);
|
||||
dict.set(FlowConst.EXT_ENABLE_OPERATOR, true);
|
||||
flowCommonService.executeTask(dict);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String batchSubmitWhere(String sessionId,String submitType) {
|
||||
public String batchSubmitWhere(String sessionId, String unionId, String submitType) {
|
||||
if (StrUtil.isBlank(sessionId)) {
|
||||
return "参数错误!";
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(unionId)) {
|
||||
unionId = SecurityUtil.getUnionId();
|
||||
}
|
||||
|
||||
Teacher_congress_quota_allocation allocation = dao().fetch(Teacher_congress_quota_allocation.class,
|
||||
Cnd.where(Teacher_congress_quota_allocation::getSessionId, "=", sessionId)
|
||||
.and(Teacher_congress_quota_allocation::getUnionId, "=", SecurityUtil.getUnionId()));
|
||||
.and(Teacher_congress_quota_allocation::getUnionId, "=", unionId));
|
||||
|
||||
|
||||
if (allocation == null) {
|
||||
@@ -126,13 +136,13 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl<Teac
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
cnd.andEX("info.unionId", "=", SecurityUtil.getUnionId());
|
||||
cnd.andEX("info.pushUnionId", "=", unionId);
|
||||
cnd.andEX("info.schoolLeader", "!=", 1);
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
if (submitType.equals("XY")){
|
||||
if (submitType.equals("XY")) {
|
||||
group.or("t.taskName", "=", "tcDelegatePushDwSjTj");
|
||||
}else{
|
||||
group.or("t.taskName", "=", "tcDelegatePushUnion");
|
||||
} else {
|
||||
group.or("t.taskName", "=", "tcDelegatePushUnionFzr");
|
||||
}
|
||||
group.or("t.taskName", "is", null);
|
||||
cnd.and(group);
|
||||
|
||||
+4
@@ -31,6 +31,7 @@ public class ExcellentRecuperationSummaryServiceImpl extends BaseServiceImpl imp
|
||||
SELECT
|
||||
info.*,
|
||||
line.lineName,
|
||||
agency.travelAgencyName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
@@ -50,6 +51,7 @@ public class ExcellentRecuperationSummaryServiceImpl extends BaseServiceImpl imp
|
||||
FROM
|
||||
excellent_recuperation_sign_user info
|
||||
LEFT JOIN excellent_recuperation_line line ON line.id = info.lineId
|
||||
LEFT JOIN excellent_recuperation_travel_agency agency on agency.id=line.travelAgencyId
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
|
||||
AND t.taskState = 10
|
||||
@@ -59,6 +61,8 @@ public class ExcellentRecuperationSummaryServiceImpl extends BaseServiceImpl imp
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(info.signUpTime)", "=", pageForm.getYear());
|
||||
cnd.andEX("info.activityId", "=", pageForm.getActivityId());
|
||||
cnd.andEX("info.lineId", "in", pageForm.getLinIds());
|
||||
cnd.andEX("line.travelAgencyId", "=", pageForm.getTravelAgencyId());
|
||||
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("info.unitId", "=", pageForm.getUnitId());
|
||||
cnd.and("ins.state", "=", ProcessTaskStateEnum.FINISHED.getCode());
|
||||
|
||||
+4
@@ -3,6 +3,8 @@ package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.vo;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/28 10:23
|
||||
@@ -15,4 +17,6 @@ public class ExcellentRecuperationPageForm extends PageForm {
|
||||
private String unionId;
|
||||
private String unitId;
|
||||
private String activityId;
|
||||
private String travelAgencyId;
|
||||
private List<String> linIds;
|
||||
}
|
||||
|
||||
+32
-4
@@ -1,5 +1,6 @@
|
||||
package com.budwk.app.zhgh.welfare.service.impl;
|
||||
|
||||
import cn.afterturn.easypoi.entity.BaseTypeConstants;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
@@ -10,6 +11,8 @@ import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.sys.models.Sys_file;
|
||||
import com.budwk.app.sys.services.SysFileService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareList;
|
||||
@@ -18,14 +21,17 @@ import com.budwk.app.zhgh.welfare.param.WelfareSelectionSituationPageForm;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareSelectionSituationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -36,6 +42,9 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
super(dao);
|
||||
}
|
||||
|
||||
|
||||
@Inject
|
||||
private SysFileService sysFileService;
|
||||
@Override
|
||||
public Pagination pageData(WelfareSelectionSituationPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
@@ -49,6 +58,7 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
GROUP_CONCAT(DISTINCT t3.optionName) AS selectedOptions,
|
||||
GROUP_CONCAT(DISTINCT t2.mobile) AS mobile,
|
||||
GROUP_CONCAT(DISTINCT t2.receiveAddress) AS receiveAddress,
|
||||
GROUP_CONCAT(DISTINCT t3.optionName,'-',t2.courierNumber) AS courierNumbers,
|
||||
t4.username AS userName,
|
||||
t4.loginname AS loginName,
|
||||
t4.sex,
|
||||
@@ -108,9 +118,11 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
GROUP_CONCAT(DISTINCT t3.optionName) AS selectedOptions,
|
||||
GROUP_CONCAT(DISTINCT t2.mobile) AS mobile,
|
||||
GROUP_CONCAT(DISTINCT t2.receiveAddress) AS receiveAddress,
|
||||
GROUP_CONCAT(DISTINCT t3.optionName,'-',t2.courierNumber) AS courierNumbers,
|
||||
t4.username AS userName,
|
||||
t4.loginname AS loginName,
|
||||
t4.sex
|
||||
t4.sex,
|
||||
t2.userSign
|
||||
FROM
|
||||
welfare_list t1
|
||||
LEFT JOIN welfare_project_user_selection t2 ON t2.welfareId = t1.projectId AND t2.selectUserId = t1.userId
|
||||
@@ -154,6 +166,18 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
cnd.groupBy("t1.id");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = listMap(sql);
|
||||
for (NutMap nutMap : list) {
|
||||
if (StrUtil.isNotBlank(nutMap.getString("userSign"))) {
|
||||
try {
|
||||
Sys_file userSign = dao().fetch(Sys_file.class, Cnd.where(Sys_file::getDownloadPath, "=", nutMap.getString("userSign")));
|
||||
byte[] userSigns = sysFileService.download(userSign.getId());
|
||||
nutMap.put("userSign",userSigns);
|
||||
}catch (Exception e){
|
||||
log.error("下载图片失败",e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 项目
|
||||
WelfareProject project = dao().fetch(WelfareProject.class, pageForm.getProjectId());
|
||||
@@ -169,16 +193,20 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
entities.add(new ExcelExportEntity("所选福利", "selectedOptions", 20));
|
||||
entities.add(new ExcelExportEntity("联系电话", "mobile", 20));
|
||||
|
||||
if(project.getProvideMode() == 3){
|
||||
if (project.getProvideMode() == 3) {
|
||||
entities.add(new ExcelExportEntity("收货地址", "receiveAddress", 40));
|
||||
ExcelExportEntity entity = new ExcelExportEntity("签字", "userSign", 20);
|
||||
entity.setType(BaseTypeConstants.IMAGE_TYPE);
|
||||
entity.setExportImageType(2);
|
||||
entities.add(entity);
|
||||
}
|
||||
|
||||
// 设置导出参数
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
exportParams.setType(ExcelType.HSSF);
|
||||
// 导出Excel并下载
|
||||
try (Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list)) {
|
||||
CommonDownloadUtil.download("选择情况.xlsx", workbook, response);
|
||||
CommonDownloadUtil.download("选择情况.xls", workbook, response);
|
||||
} catch (Exception e) {
|
||||
log.error("导出Excel失败", e);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
const applyForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="signDialog" title="信息填写" width="50%" append-to-body>
|
||||
<el-form :model="formData" ref="form" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="姓名" prop="username">
|
||||
<el-input readonly v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工号" prop="loginname">
|
||||
<el-input readonly v-model="formData.loginname"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属单位" prop="unitName">
|
||||
<el-input readonly v-model="formData.unitName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属工会" prop="unionName">
|
||||
<el-input readonly v-model="formData.unionName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input readonly v-model="formData.sex"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!--<el-col :span="24">
|
||||
<el-form-item label="联系方式" prop="mobile">
|
||||
<el-input v-model="formData.mobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="courseRow.courseIsLimitApply">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="报名时段" prop="activityCourseId"
|
||||
:rules="{ required: true, message: '请选择报名时段', trigger: 'blur'}">
|
||||
<el-select style="width: 100%" v-model="formData.activityCourseId" placeholder="请选择报名时段">
|
||||
<el-option v-for="item in courseTimeSelectList"
|
||||
:label="item.text.substring(0, 12)"
|
||||
:value="item.value"
|
||||
:key="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
v-for="(column, index) in formData.mobileSignColumnList"
|
||||
:prop="'mobileSignColumnList.' + index + '.columnValue'"
|
||||
:label="column.columnName"
|
||||
:key="column.columnCode"
|
||||
:rules="{ required: column.isRequired,
|
||||
message: (['SELECT', 'FILE'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName,
|
||||
trigger: 'blur'}"
|
||||
>
|
||||
<!--文本框-->
|
||||
<template v-if="!['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||
<el-input
|
||||
v-model="column.columnValue"
|
||||
:placeholder="'请填写' + column.columnName"
|
||||
:type="['INT'].includes(column.columnType) ? 'number' : ''"
|
||||
></el-input>
|
||||
</template>
|
||||
<!--选择框-->
|
||||
<template v-else-if="['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||
<el-select v-model="column.columnValue" :placeholder="'请选择' + column.columnName" style="width: 100%">
|
||||
<el-option v-for="item in column.selectValues" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<!--时间框-->
|
||||
<template v-else-if="['DATE', 'DATETIME'].includes(column.columnType)">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="column.columnValue"
|
||||
:type="column.columnType === 'DATE' ? 'date' : 'datetime'"
|
||||
:placeholder="'请选择' + column.columnName"
|
||||
:value-format="column.columnType === 'DATE' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'"
|
||||
></el-date-picker>
|
||||
</template>
|
||||
<!--文件-->
|
||||
<template v-else-if="['JSON'].includes(column.columnType)">
|
||||
<file-upload :upload_number="column.fileNumber" :value.sync="column.columnValue"
|
||||
:accept="column.fileType ? column.fileType.join(',') : ''"
|
||||
upload_result_type="url"
|
||||
complete_result upload_mode="drag"
|
||||
upload_result_category="array"></file-upload>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button @click="signDialog = false">取 消</el-button>
|
||||
<el-button @click="onSubmit" type="primary">提 交</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
signDialog: false,
|
||||
formData: {},
|
||||
courseRow: {},
|
||||
courseTimeSelectList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getCourseTimeSelectList(o) {
|
||||
const resp = await $.post('/platform/fellowship/apply/getCourseTimeSelectList',{ courseId: o.id })
|
||||
if (resp.code === 0) {
|
||||
this.courseTimeSelectList = resp.data
|
||||
} else {
|
||||
this.$message.warning('获取时段信息失败,请联系管理员')
|
||||
}
|
||||
},
|
||||
async onOpen(row, course) {
|
||||
this.initData(row, course)
|
||||
if (row.courseIsLimitApply) {
|
||||
await this.getCourseTimeSelectList(row)
|
||||
}
|
||||
this.courseRow = row
|
||||
this.signDialog = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.clearValidate()
|
||||
})
|
||||
},
|
||||
async validateSignUp() {
|
||||
// 获取家属人数
|
||||
let familyCount = this.formData.mobileSignColumnList.filter(o => o.columnCode === 'xdqsrs').reduce((sum, item) => {
|
||||
return sum + (Number(item.columnValue) || 0)
|
||||
}, 0)
|
||||
const res = await this.$axios.post("/platform/fellowship/apply/validateSignUp", {
|
||||
courseId: this.formData.courseId,
|
||||
currentFamilyNumber: familyCount
|
||||
})
|
||||
return res.code === 0
|
||||
},
|
||||
async validateCourseTime() {
|
||||
const res = await this.$axios.post('/platform/fellowship/apply/validateSourceSignUp', {
|
||||
activityCourseId: this.formData.activityCourseId,
|
||||
courseId: this.courseRow.id
|
||||
})
|
||||
return res.code === 0
|
||||
},
|
||||
async onSubmit() {
|
||||
if(!await this.validateSignUp()) return
|
||||
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
if(this.courseRow.courseIsLimitApply && !await this.validateCourseTime()) return
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const mobileColumnsValue = this.formData.mobileSignColumnList.map((v) => {
|
||||
return {
|
||||
columnName: v.columnName,
|
||||
columnValue: v.columnValue,
|
||||
columnCode: v.columnCode,
|
||||
columnFormType: v.columnFormType
|
||||
}
|
||||
})
|
||||
this.formData.mobileColumnsValue = JSON.stringify(mobileColumnsValue)
|
||||
const resp = await this.$axios.post("/platform/fellowship/apply/doSignUp", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.signDialog = false
|
||||
this.$message.success(resp.msg)
|
||||
this.$emit('refresh')
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
initData(row, course) {
|
||||
this.$set(this.formData, 'username', this.$store.state.user.username)
|
||||
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
|
||||
this.$set(this.formData, 'unionName', this.$store.state.user.union.name)
|
||||
this.$set(this.formData, 'unitName', this.$store.state.user.unit.name)
|
||||
this.$set(this.formData, 'sex', this.$store.state.user.sex)
|
||||
this.$set(this.formData, 'activityId', row.activityId)
|
||||
this.$set(this.formData, 'courseId', row.id)
|
||||
this.$set(this.formData, 'mobileSignColumnList', course.mobileSignColumnList)
|
||||
|
||||
this.formData.mobileSignColumnList.forEach((item) => {
|
||||
item.columnValue = this.$store.state.user[item.columnCode] || ""
|
||||
})
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,340 @@
|
||||
<!--#include('applyForm.js'){}#-->
|
||||
const courseList = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<!--<el-col :span="5">
|
||||
<div class="glow-box">
|
||||
<img :src="activity.cover"/>
|
||||
<div class="title">{{ activity.activityName }}</div>
|
||||
<div v-html="activity.introduce"></div>
|
||||
</div>
|
||||
</el-col>-->
|
||||
<el-col :span="24">
|
||||
<el-row class="query-row">
|
||||
<el-col class="query-title hidden-xs-only">类  型:</el-col>
|
||||
<el-col class="query-content">
|
||||
<el-select
|
||||
v-model="pageForm.courseTypeId"
|
||||
placeholder="请选择类型"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@change="doSearch"
|
||||
>
|
||||
<el-option v-for="item in courseTypeList" :key="item.id" :label="item.typeName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="query-row" v-if="assortList && assortList.length > 0">
|
||||
<el-col class="query-title hidden-xs-only">分类标识:</el-col>
|
||||
<el-col class="query-content">
|
||||
<el-tag
|
||||
:effect="pageForm.assortTypes.includes(item) ? 'dark' : 'plain'"
|
||||
:key="item"
|
||||
:type="item"
|
||||
@click="tagClick('assortTypes', item)"
|
||||
style="margin-right: 10px; cursor: pointer"
|
||||
v-for="item in assortList"
|
||||
>
|
||||
{{ item }}
|
||||
</el-tag>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="tableData" class="mt10">
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template v-slot="{row}" v-if="column.prop=='courseLocationCoordinates'">
|
||||
<el-button style="padding: 0" @click="openViewMap(row.courseLocationCoordinates)" type="text">
|
||||
{{row.courseLocation}}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<template v-slot="{row}" v-else-if="column.prop=='courseTime'">
|
||||
<el-button style="padding: 0" @click="openViewCourseTime(row.id)" type="text">点击查看时间</el-button>
|
||||
</template>
|
||||
|
||||
<template v-slot="{row}" v-else-if="column.prop=='applyNum'">
|
||||
<span v-html="calcSignUpCount(row)"></span>
|
||||
</template>
|
||||
|
||||
<template v-slot="{row}" v-else-if="column.prop=='introduce'">
|
||||
<span v-if="!row.introduce?.trim()">暂无</span>
|
||||
<el-button v-else style="padding: 0" @click="onPreview(row.introduce)" type="text">点击查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template v-slot="{row}">
|
||||
<el-button v-if="!row.isSign" type="primary" size="mini" @click="onSign(row)">我要报名</el-button>
|
||||
<el-button v-else type="danger" size="mini" @click="onCancel(row)">取消报名</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-dialog :visible.sync="courseTimeListDialog" title="时间信息" width="60%" append-to-body>
|
||||
<el-table :data="courseTimeList">
|
||||
<el-table-column label="日期" prop="courseDate">
|
||||
<template v-slot="{row}">{{$moment(row.courseDate).format('YYYY-MM-DD')}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="courseStartTime">
|
||||
<template v-slot="{row}">{{$moment(row.courseStartTime).format('HH:mm')}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" prop="courseEndTime">
|
||||
<template v-slot="{row}">{{$moment(row.courseEndTime).format('HH:mm')}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button @click="courseTimeListDialog = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="viewMapDialog" title="地点" width="60%" append-to-body>
|
||||
<div id="viewMap" style="width: 100%; height: 500px"></div>
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button @click="viewMapDialog = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="infoVisible" title="详细信息" append-to-body>
|
||||
<div v-html="introduce"></div>
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button @click="infoVisible = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<apply-form ref="formRef" @refresh="doSearch"></apply-form>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"apply-form": applyForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
assortTypes: [],
|
||||
},
|
||||
assortList: [],
|
||||
courseTimeListDialog: false,
|
||||
viewMapDialog: false,
|
||||
courseTimeList: [],
|
||||
tableColumns: [
|
||||
{ prop: "courseName", label: "名称" },
|
||||
{ prop: "typeName", label: "类型", width: 130},
|
||||
{ prop: "campus", label: "校区", width: 160 },
|
||||
{ prop: "courseLocationCoordinates", label: "地点", width: 200 },
|
||||
{ prop: "courseInstructor", label: "联系人", width: 100 },
|
||||
{ prop: "courseTime", label: "时间", width: 160 },
|
||||
{ prop: "introduce", label: "详细信息", width: 100 },
|
||||
{ prop: "applyNum", label: "已报名人数", width: 200 }
|
||||
],
|
||||
activity: {},
|
||||
courseTypeList: [],
|
||||
|
||||
trainType: '',
|
||||
pdf: false,
|
||||
infoVisible: false,
|
||||
introduce: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onPreview(introduce) {
|
||||
try {
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(introduce, 'text/html');
|
||||
const link = doc.querySelector('a');
|
||||
const href = link.getAttribute('href');
|
||||
|
||||
const id = href.substring(href.indexOf("=") + 1)
|
||||
const res = await this.$axios.post("/platform/sys/file/previewFileData", { ids: JSON.stringify([id]) })
|
||||
|
||||
this.pdf = true
|
||||
window.open("/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent(res.data[0].downloadPath), res.data[0].name)
|
||||
} catch (e) {
|
||||
this.introduce = introduce
|
||||
this.pdf = false
|
||||
this.infoVisible = true
|
||||
}
|
||||
},
|
||||
tagClick(key, val) {
|
||||
let idx = this.pageForm[key].indexOf(val)
|
||||
if (idx !== -1) {
|
||||
this.pageForm[key].splice(idx, 1)
|
||||
} else {
|
||||
this.pageForm[key].push(val)
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
async onOpen(row) {
|
||||
this.activity = row
|
||||
this.$set(this.pageForm, 'activityId', row.id)
|
||||
await this.pageData()
|
||||
await this.getCourseTypeList()
|
||||
this.queryCourseAssort()
|
||||
},
|
||||
onSign(row) {
|
||||
const course = this.courseTypeList.find((v) => v.id === row.courseType)
|
||||
this.$axios.post("/platform/fellowship/apply/validateSignUp", {courseId: row.id})
|
||||
.then((res) => {
|
||||
if (res.code !== 0) {
|
||||
this.$alert(res.msg, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
type: "warning"
|
||||
})
|
||||
} else {
|
||||
let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber)
|
||||
if(row.reserveMode === 2 && lave <= 0) {
|
||||
this.$alert('您当前的报名为候补报名状态', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
type: "warning"
|
||||
})
|
||||
}
|
||||
this.$refs.formRef.onOpen(row, course)
|
||||
}
|
||||
})
|
||||
},
|
||||
onCancel(row) {
|
||||
this.$confirm("您确定要取消吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/fellowship/apply/cancelSignUp", {
|
||||
activityId: row.activityId,
|
||||
courseId: row.id
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
await this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
async getCourseTypeList() {
|
||||
const resp = await this.$axios.post("/platform/fellowship/type/getAllType")
|
||||
if (resp.code === 0) {
|
||||
this.courseTypeList = resp.data
|
||||
}
|
||||
},
|
||||
async openViewCourseTime(id) {
|
||||
const resp = await this.$axios.post(loc() + "/getCourseTime", { id: id })
|
||||
this.courseTimeList = resp.data
|
||||
this.courseTimeListDialog = true
|
||||
},
|
||||
openViewMap(point) {
|
||||
if (!Array.isArray(point)) {
|
||||
this.$message.warning("没有设置点位,无法通过地图查看")
|
||||
return
|
||||
}
|
||||
this.viewMapDialog = true
|
||||
this.$nextTick(() => {
|
||||
const viewMap = new AMap.Map("viewMap", {
|
||||
resizeEnable: true,
|
||||
center: point,
|
||||
zoom: 16
|
||||
})
|
||||
if (viewMarker) {
|
||||
viewMap.remove(viewMarker)
|
||||
}
|
||||
viewMarker = new AMap.Marker({
|
||||
position: point,
|
||||
offset: new AMap.Pixel(-13, -30)
|
||||
})
|
||||
viewMap.add(viewMarker)
|
||||
viewMap.setFitView(null, false, [150, 60, 100, 60])
|
||||
})
|
||||
},
|
||||
calcSignUpCount(o) {
|
||||
let lave = o.coursePeopleNumber - (o.hasRegisterNum + o.courseReservedNumber)
|
||||
if(o.reserveMode === 2) {
|
||||
let lave2 = o.waitingNum - o.hasWaitingNum
|
||||
return "<span style='color: red'>余" + lave +"</span>/" + o.coursePeopleNumber + "人"
|
||||
+ ",<span style='color: red'>候补余" + lave2 + "</span>/" + o.waitingNum + "人"
|
||||
} else {
|
||||
return "<span style='color: red'>余" + lave +"</span>/" + o.coursePeopleNumber + "人"
|
||||
}
|
||||
},
|
||||
async pageData() {
|
||||
const pageForm = clone({...this.pageForm})
|
||||
pageForm.assortTypes = JSON.stringify(pageForm.assortTypes)
|
||||
const resp = await this.$axios.post(loc() + "/pageData", pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list
|
||||
this.pageForm.totalCount = resp.data.totalCount
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
queryCourseAssort() {
|
||||
this.$axios.post(loc() + "/queryCourseAssort", {activityId: this.activity.id})
|
||||
.then((resp) => {
|
||||
this.assortList = resp.data
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
/deep/ .glow-box {
|
||||
min-height: calc(100vh - 56px - 40px - 50px - 80px);
|
||||
max-height: calc(100vh - 56px - 40px - 50px - 80px);
|
||||
overflow-y: auto;
|
||||
background: #F0F2F5;
|
||||
}
|
||||
/deep/ img {
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
}
|
||||
/deep/ .title {
|
||||
background: white;
|
||||
height: 20px;
|
||||
}
|
||||
/deep/ .query-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 6px 0;
|
||||
}
|
||||
/deep/ .query-row:not(:last-child) {
|
||||
border-bottom: 1px dashed rgb(230, 230, 230);
|
||||
}
|
||||
/deep/ .query-row > .query-title {
|
||||
width: 100px;
|
||||
max-width: 100px;
|
||||
min-width: 100px;
|
||||
overflow: hidden;
|
||||
}
|
||||
/deep/ .query-row > .query-content {
|
||||
min-width: 200px;
|
||||
overflow: hidden;
|
||||
}
|
||||
/deep/ .query-row > .query-content > .el-tag {
|
||||
margin-bottom: 5px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
/deep/ @media screen and (max-width: 992px) {
|
||||
.query-row:nth-child(4) .query-content .el-col:not(:last-child) {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.query-title {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
placeholder="请选择年度"
|
||||
type="year"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
@change="doSearch"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="活动状态" style="width: 340px">
|
||||
<el-select v-model="pageForm.activityType" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择活动状态" filterable>
|
||||
<el-option :value="1" label="全部"></el-option>
|
||||
<el-option :value="2" label="即将开始 & 报名中"></el-option>
|
||||
<el-option :value="3" label="已结束"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="活动列表"></table-tool>
|
||||
<el-table :data="tableData" :size="tableSize">
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template v-slot="{row}" v-if="column.prop=='activitySignUpStartTime'">
|
||||
<span>{{$moment(row.activitySignUpStartTime).format('MM/DD HH:mm')}}</span>
|
||||
<span> 至 </span>
|
||||
<span>{{$moment(row.activitySignUpEndTime).format('MM/DD HH:mm')}}</span>
|
||||
</template>
|
||||
<template v-slot="{row}" v-else-if="column.prop=='activityStartTime'">
|
||||
<span>{{$moment(row.activityStartTime).format('MM/DD HH:mm')}}</span>
|
||||
<span> 至 </span>
|
||||
<span>{{$moment(row.activityEndTime).format('MM/DD HH:mm')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template v-slot="{row}">
|
||||
<template v-if="$moment().isBefore($moment(row.activitySignUpEndTime))">
|
||||
<el-button @click="onView(row)" size="mini" type="primary">查看介绍</el-button>
|
||||
<el-button @click="onOpen(row)" size="mini" type="primary">去报名</el-button>
|
||||
</template>
|
||||
<template v-if="$moment().isAfter($moment(row.activitySignUpEndTime))">
|
||||
<el-button size="mini" type="info">已结束</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<course-list ref="courseListRef"></course-list>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="详细信息" :visible.sync="infoVisible" width="60%">
|
||||
|
||||
<activity-info ref="infoRef"></activity-info>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-statistic
|
||||
v-if="time < 0"
|
||||
format="DD 天 HH 时 mm 分钟 ss 秒"
|
||||
:value="new Date(infoRow.activitySignUpStartTime)"
|
||||
time-indices
|
||||
title="距离开始:"
|
||||
@finish="time = 0"
|
||||
>
|
||||
</el-statistic>
|
||||
<template v-else>
|
||||
<el-button @click="infoVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onOpen(infoRow)" :disabled="time < 0">
|
||||
去报名
|
||||
</el-button>
|
||||
</template>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('courseList.js'){}#-->
|
||||
<!--#include('../manage/info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"course-list": courseList,
|
||||
"activity-info": info,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: this.$moment().format("YYYY"),
|
||||
activityType: 2
|
||||
},
|
||||
tableColumns: [
|
||||
{ label: "活动名称", prop: "activityName", width: 600},
|
||||
{ label: "活动性质", prop: "trainType"},
|
||||
{ label: "报名时间", prop: "activitySignUpStartTime"},
|
||||
{ label: "活动时间", prop: "activityStartTime"},
|
||||
],
|
||||
time: 0,
|
||||
infoRow: {},
|
||||
infoVisible: false,
|
||||
|
||||
id: GetQueryString("id"),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onView(row) {
|
||||
this.infoRow = row
|
||||
this.time = this.$moment().diff(this.$moment(row.activitySignUpStartTime), 'milliseconds')
|
||||
this.infoVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.infoRef.initData(row.id)
|
||||
})
|
||||
},
|
||||
onOpen(row) {
|
||||
if(this.$moment().isBefore(this.$moment(row.activitySignUpStartTime))) {
|
||||
this.onView(row)
|
||||
return
|
||||
}
|
||||
this.infoVisible = false
|
||||
this.$nextTick(() => {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.courseListRef.onOpen(row)
|
||||
})
|
||||
})
|
||||
},
|
||||
pageData() {
|
||||
this.$axios.post("/platform/fellowship/apply/activityPageData", this.pageForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
if(this.id) {
|
||||
const activity = this.tableData.find(o => o.id === this.id)
|
||||
this.onView(activity)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,666 @@
|
||||
<!--#include('courseTime.js'){}#-->
|
||||
<!--#include('customForm.js'){}#-->
|
||||
const basicForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-form :model="formData" label-width="110px" ref="form">
|
||||
<div v-show="step === 1">
|
||||
<el-row :gutter="20" type="flex" v-if="!formData.id">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="沿用活动" prop="useHistory">
|
||||
<el-radio-group v-model="formData.useHistory" size="small">
|
||||
<el-radio :label="true" border>沿用之前活动</el-radio>
|
||||
<el-radio :label="false" border>不沿用之前活动</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.useHistory">
|
||||
<el-form-item label="往期活动" prop="historicalAct">
|
||||
<el-select v-model="formData.historicalAct" placeholder="请选择往期活动"
|
||||
style="width: 100%" @change="historicalActChange">
|
||||
<el-option v-for="item in historicalActList" :key="item.id"
|
||||
:label="item.activityName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item :rules="{required:true,message: '请输入活动名称', trigger: 'blur'}"
|
||||
label="活动名称" prop="activityName">
|
||||
<el-input maxlength="50" v-model="formData.activityName"
|
||||
placeholder="请输入活动名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="trainType + '通知'" prop="notice">
|
||||
<el-radio-group v-model="formData.notice" size="small">
|
||||
<el-radio :label="true" border>通知</el-radio>
|
||||
<el-radio :label="false" border>不通知</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item :rules="{required:true,message: '请选择活动时间', trigger: 'blur'}"
|
||||
label="活动时间" prop="activityTime">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
end-placeholder="请选择活动结束日期"
|
||||
range-separator="至"
|
||||
start-placeholder="请选择活动开始日期"
|
||||
style="width: 100%"
|
||||
type="datetimerange"
|
||||
v-model="formData.activityTime"
|
||||
value-format="yyyy-MM-dd HH:mm"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :rules="{required:true,message: '请选择报名时间', trigger: 'blur'}"
|
||||
label="报名时间" prop="activitySignTime">
|
||||
<el-date-picker
|
||||
:disabled="false"
|
||||
end-placeholder="请选择报名结束日期"
|
||||
range-separator="至"
|
||||
start-placeholder="请选择报名开始日期"
|
||||
style="width: 100%"
|
||||
type="datetimerange"
|
||||
v-model="formData.activitySignTime"
|
||||
value-format="yyyy-MM-dd HH:mm"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="面向对象" prop="joinCnd">
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 99%">
|
||||
<el-select
|
||||
@change="changeActivity"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择可报名人员范围"
|
||||
style="width: 99%"
|
||||
v-model="formData.activityGroupId"
|
||||
>
|
||||
<el-option
|
||||
:key="item.groupId"
|
||||
:label="item.groupName"
|
||||
:value="item.groupId"
|
||||
v-for="item in activityGroupList"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button @click="$refs.drawerUserScope.userScopeDialog = true" type="primary">
|
||||
设置
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动类型" prop="trainType"
|
||||
:rules="{required:true,message: '请选择活动类型', trigger: 'blur'}">
|
||||
<el-select @change="typeChange" filterable placeholder="请选择活动类型"
|
||||
style="width: 100%" v-model="formData.trainType">
|
||||
<el-option :label="item.name" :value="item.code" :key="item.code"
|
||||
v-for="item in dict.type.FELLOWSHIP_TYPE"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="hostUnitIds" label="主办单位">
|
||||
<el-select v-model="formData.hostUnitIds" clearable filterable multiple
|
||||
placeholder="请选择主办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="undertakeUnitIds" label="承办单位">
|
||||
<el-select v-model="formData.undertakeUnitIds" clearable filterable multiple
|
||||
placeholder="请选择承办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item :rules="{required:true,message: '请输入活动介绍', trigger: 'blur'}" label="活动介绍"
|
||||
prop="introduce">
|
||||
<text-editor v-model="formData.introduce"></text-editor>
|
||||
</el-form-item>
|
||||
<el-form-item label="封面图片" prop="cover"
|
||||
:rules="{required:true,message: '请上传活动移动端封面图片', trigger: 'blur'}">
|
||||
<el-col :span="12">
|
||||
<file-upload
|
||||
:upload_number="1"
|
||||
:value.sync="formData.cover"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
complete_result
|
||||
upload_mode="image"
|
||||
upload_result_category="interval"
|
||||
></file-upload>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="微信群二维码" prop="wechat">
|
||||
<file-upload
|
||||
:upload_number="1"
|
||||
:value.sync="formData.wechat"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
complete_result
|
||||
upload_mode="image"
|
||||
upload_result_category="interval"
|
||||
></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-show="step === 2">
|
||||
<div class="left-span-label"
|
||||
style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div>{{trainType + '信息(温馨提示:如不需要人数限制,下方人数框填写0或者不填)'}}</div>
|
||||
<div>
|
||||
<el-button @click="addCourse" size="mini" type="primary">添加{{ trainType }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="formData.courseList">
|
||||
<el-table-column label="序号" prop="orderNum" width="100px">
|
||||
<template v-slot="{row}">
|
||||
<el-input-number
|
||||
v-model="row.orderNum"
|
||||
@change="courseOrderNumChange"
|
||||
:min="1"
|
||||
:max="formData.courseList.length"
|
||||
:step="1"
|
||||
step-strictly
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
style="width: 76px"
|
||||
size="small"
|
||||
label="序号"
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="活动名称" prop="courseName">
|
||||
<template v-slot="{row}">
|
||||
<el-input size="small" v-model="row.courseName"
|
||||
:placeholder="'请输入' + trainType + '名称'"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="联谊类型" prop="courseType" sortable>
|
||||
<template v-slot="{row}">
|
||||
<el-select size="small" v-model="row.courseType"
|
||||
@change="(val) => {courseTypeChange(val, row)}">
|
||||
<el-option :label="c.typeName" :value="c.id" :key="c.id"
|
||||
v-for="c in courseTypeList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '人数'" prop="coursePeopleNumber" width="110px">
|
||||
<template v-slot="{row}">
|
||||
<el-input-number
|
||||
:controls="false"
|
||||
:max="9999"
|
||||
size="small"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
step-strictly
|
||||
style="max-width: 80px"
|
||||
@change="(c, o) => validNumber(row, null)"
|
||||
v-model="row.coursePeopleNumber"
|
||||
placeholder="请输入人数"
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预留名额" prop="courseReservedNumber" width="110px">
|
||||
<template v-slot="{row}">
|
||||
<el-input-number
|
||||
:controls="false"
|
||||
:max="1000"
|
||||
:min="0"
|
||||
size="small"
|
||||
:precision="0"
|
||||
step-strictly
|
||||
style="max-width: 80px"
|
||||
@change="(c, o) => validNumber(row, o)"
|
||||
v-model="row.courseReservedNumber"
|
||||
placeholder="请输入预留名额"
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="校区" prop="campus">
|
||||
<template v-slot="{row}">
|
||||
<el-select size="small" v-model="row.campus" style="width: 100%">
|
||||
<el-option :label="item.name" :value="item.name" :key="item.code"
|
||||
v-for="item in dict.type.USER_CAMPUS"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '地点'" prop="courseLocation">
|
||||
<template v-slot="{row}">
|
||||
<el-input size="small" v-model="row.courseLocation"
|
||||
:placeholder="'请输入' + trainType + '地点'"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '负责人'" prop="courseInstructor">
|
||||
<template v-slot="{row}">
|
||||
<el-input size="small" v-model="row.courseInstructor"
|
||||
:placeholder="'请输入' + trainType + '交友联谊负责人'"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="分类标识" prop="assort">
|
||||
<template v-slot="{row}">
|
||||
<el-input size="small" v-model="row.assort" placeholder="请输入分类标识"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '时间'">
|
||||
<template v-slot="scope">
|
||||
<el-button @click="openSetUpCourseTime(scope.$index)" type="text">设置{{ trainType
|
||||
}}时间
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button @click="openMoreInfo(scope, scope.$index)" size="mini" type="primary">
|
||||
自定义设置
|
||||
</el-button>
|
||||
<el-button @click="removeTableCourse(scope.$index)" size="mini" type="danger">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="left-span-label" style="margin-top: 20px">个人报名数量限制</div>
|
||||
<el-form-item label="报名数量限制" prop="cover">
|
||||
<el-radio-group v-model="formData.restrictLimit" size="small">
|
||||
<el-radio border :label="1">无限制</el-radio>
|
||||
<el-radio border :label="2">按类型限制</el-radio>
|
||||
<el-radio border :label="3">按活动限制</el-radio>
|
||||
</el-radio-group>
|
||||
<div calss="limit_div">
|
||||
<div v-if="formData.restrictLimit === 1" style="color: #c64120; font-size: 12px">
|
||||
注:无限制指对报名的个数不做任何限制
|
||||
</div>
|
||||
<div v-if="formData.restrictLimit === 2" style="color: #c64120; font-size: 12px">
|
||||
<div>
|
||||
<el-button @click="setSignUpCondition" size="mini" type="primary">设置报名限制
|
||||
</el-button>
|
||||
<span style="color: #c64120; font-size: 12px">注:按类型限制指对每个类型下的个数进行限制</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="formData.restrictLimit === 3">
|
||||
<div>
|
||||
<el-input-number v-model="formData.limitNum" :min="1" :max="100" size="mini"
|
||||
label="限制报名个数"></el-input-number>
|
||||
<span style="color: #c64120; font-size: 12px">注:按活动限制指只能报{{formData.limitNum}}个,不与类型关联</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<div style="float: right; margin: 20px 0">
|
||||
<el-button @click="$emit('back')">取消</el-button>
|
||||
<el-button v-if="step === 2" type="primary" @click="step = 1">上一步</el-button>
|
||||
<el-button v-if="step === 1" type="primary" @click="step = 2">下一步</el-button>
|
||||
<el-button type="primary" @click="onSave">保存</el-button>
|
||||
<el-button type="primary" @click="onSubmit">提交</el-button>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="signUpDialog" title="设置报名限制" append-to-body>
|
||||
<el-table :data="formData.typeLimits">
|
||||
<el-table-column prop="code" label="类型编码"></el-table-column>
|
||||
<el-table-column prop="typeName" label="类型名称"></el-table-column>
|
||||
<el-table-column label="限制个数" width="500">
|
||||
<template v-slot="{row}">
|
||||
<el-input-number size="small" v-model="row.limitNum" :min="0"></el-input-number>
|
||||
<span style="color: #c64120; font-size: 12px">注:值为空或者为0则表示此类型不限制报名个数</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button @click="signUpDialog = false">取消</el-button>
|
||||
<el-button @click="doLimitNum" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<drawer-user-scope
|
||||
@group_change="getActivityGroup"
|
||||
ref="drawerUserScope"
|
||||
:group_id.sync="formData.activityGroupId">
|
||||
</drawer-user-scope>
|
||||
|
||||
<course-time ref="courseTimeRef"></course-time>
|
||||
<custom-form ref="customFormRef"></custom-form>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["USER_CAMPUS", "FELLOWSHIP_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
signUpDialog: false,
|
||||
step: 1,
|
||||
formData: {
|
||||
notice: false,
|
||||
courseList: [
|
||||
{ orderNum: 1, courseName: "", courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false },
|
||||
],
|
||||
conditionStructure: {
|
||||
method: "AND",
|
||||
conditions: [{}]
|
||||
},
|
||||
restrictLimit: 1,
|
||||
limitNum: 1,
|
||||
typeLimits: []
|
||||
},
|
||||
historicalActList: [],
|
||||
trainTypeList: [],
|
||||
trainType: "",
|
||||
activityGroupList: [],
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000
|
||||
}
|
||||
},
|
||||
campusList: [],
|
||||
courseTypeList: [],
|
||||
|
||||
unitOptions: [],
|
||||
clubOptions: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"drawer-user-scope": httpVueLoader("/components/module/activity/DrawerUserScope.vue"),
|
||||
"course-time": courseTime,
|
||||
"custom-form": customForm,
|
||||
},
|
||||
methods: {
|
||||
async validNumber(row, old) {
|
||||
if (GetQueryString("id") === "") {
|
||||
if (row.courseReservedNumber > row.coursePeopleNumber && row.reserveMode === 1) {
|
||||
this.$alert("预留人数不能大于" + this.trainType + "人数!", "提示", {
|
||||
confirmButtonText: "确定"
|
||||
})
|
||||
row.courseReservedNumber = 0
|
||||
}
|
||||
} else {
|
||||
const registerUserCount = await this.getRegisterUserCount(row.id)
|
||||
if (row.courseReservedNumber + registerUserCount > row.coursePeopleNumber) {
|
||||
if (row.reserveMode === 1) {
|
||||
let num = row.coursePeopleNumber - registerUserCount
|
||||
let str =
|
||||
"您设置的" +
|
||||
this.trainType +
|
||||
"人数为" +
|
||||
row.coursePeopleNumber +
|
||||
"人,当前报名人数为" +
|
||||
registerUserCount +
|
||||
"人,预留名额上限为" +
|
||||
num +
|
||||
"人!"
|
||||
this.$alert(str, "提示", {
|
||||
confirmButtonText: "确定"
|
||||
})
|
||||
row.courseReservedNumber = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async getRegisterUserCount(courseId) {
|
||||
const resp = await this.$axios.post("/platform/fellowship/manage/getRegisterUserCount", { courseId })
|
||||
return resp.code === 0 ? resp.data : 0
|
||||
},
|
||||
courseTypeChange(val, row) {
|
||||
row.reserveMode = 1
|
||||
},
|
||||
setSignUpCondition() {
|
||||
if (this.formData.courseList !== undefined && this.formData.courseList.length > 0) {
|
||||
const courseValid = this.formData.courseList.some((item, index) => {
|
||||
if (item.courseType === undefined) {
|
||||
this.$message.warning("请在" + (index + 1) + "行" + this.trainType + "信息中选择类型!")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
if (courseValid) {
|
||||
return
|
||||
}
|
||||
const array = [...new Set(this.formData.courseList.map((o) => o.courseType))]
|
||||
const typeArray = clone([...this.courseTypeList].filter((x) => array.some((y) => x.id === y)))
|
||||
const arr = []
|
||||
typeArray.forEach((item) => {
|
||||
const t = this.formData.typeLimits.find(o => o.typeId === item.id)
|
||||
if (t) {
|
||||
const type = this.courseTypeList.find(o => o.id === t.typeId)
|
||||
t.code = type.code
|
||||
t.typeName = type.typeName
|
||||
arr.push(t)
|
||||
} else {
|
||||
arr.push({
|
||||
code: item.code,
|
||||
typeName: item.typeName,
|
||||
typeId: item.id,
|
||||
limitNum: 0
|
||||
})
|
||||
}
|
||||
})
|
||||
this.formData.typeLimits = arr
|
||||
this.signUpDialog = true
|
||||
} else {
|
||||
this.$message.warning("请在" + this.trainType + "信息中选择类型!")
|
||||
}
|
||||
},
|
||||
doLimitNum() {
|
||||
this.signUpDialog = false
|
||||
},
|
||||
openMoreInfo(row, index) {
|
||||
this.$refs.customFormRef.onOpen(this.formData, row, index)
|
||||
},
|
||||
async removeTableCourse(index) {
|
||||
const confirm = await this.$confirm(
|
||||
"请确认是否删除此" + this.trainType + "?如果该" + this.trainType + "已有报名人员,会随之一起删除!确定吗?",
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
)
|
||||
if (confirm) {
|
||||
this.formData.courseList.splice(index, 1)
|
||||
}
|
||||
},
|
||||
openSetUpCourseTime(index) {
|
||||
this.$refs.courseTimeRef.onOpen(this.formData, index)
|
||||
},
|
||||
courseOrderNumChange() {
|
||||
this.formData.courseList = this.formData.courseList.sort((a, b) => a.orderNum - b.orderNum)
|
||||
},
|
||||
addCourse() {
|
||||
this.formData.courseList.push({ courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false })
|
||||
},
|
||||
async historicalActChange(val) {
|
||||
const resp = await this.$axios.post("/platform/fellowship/manage/findOne", {id: val})
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data
|
||||
this.typeChange(this.formData.trainType)
|
||||
this.formData.id = ""
|
||||
}
|
||||
},
|
||||
typeChange(val) {
|
||||
const type = this.dict.type.FELLOWSHIP_TYPE.find(o => o.code === val)
|
||||
this.trainType = type?.name || "培训班"
|
||||
},
|
||||
changeActivity(val) {
|
||||
if (val) {
|
||||
const group = this.activityGroupList.find(v => v.groupId === val)
|
||||
this.$set(this.formData, "activityGroupName", group.groupName)
|
||||
} else {
|
||||
this.$set(this.formData, "activityGroupName", "全部教职工")
|
||||
}
|
||||
},
|
||||
async getActivityGroup() {
|
||||
const { data } = await this.$axios.post("/platform/activity/basic/scope/getActivityUserScopeGroup")
|
||||
return data
|
||||
},
|
||||
async getHistoricalActList() {
|
||||
const resp = await this.$axios.post("/platform/fellowship/manage/getHistoricalActList", {})
|
||||
return resp.data
|
||||
},
|
||||
async onSave() {
|
||||
let valid = false
|
||||
this.$refs.form.validateField("activityName", (errMsg) => {
|
||||
valid = errMsg === ""
|
||||
})
|
||||
if (!valid) {
|
||||
this.$message.warning("请输入活动名称")
|
||||
return
|
||||
}
|
||||
await this.doHandle('保存')
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs["form"].validate(async (valid, errMsg) => {
|
||||
if (valid) {
|
||||
const courseValid = this.formData.courseList.some((v, i) => {
|
||||
const basicValid = v.courseName && v.coursePeopleNumber && v.courseLocation && v.courseInstructor && v.courseType
|
||||
const timeValid =
|
||||
v.courseTimeList.length > 0 &&
|
||||
v.courseTimeList.every((x) => {
|
||||
return x.courseStartTime && x.courseEndTime && x.courseStartTime < x.courseEndTime
|
||||
})
|
||||
if (!timeValid) {
|
||||
this.$message.warning("第" + (i + 1) + "行时间填写有误,请核查")
|
||||
return true
|
||||
}
|
||||
if (!basicValid) {
|
||||
this.$message.warning("第" + (i + 1) + "行信息填写有误,请核查")
|
||||
return true
|
||||
}
|
||||
if (v.isMobileSign === true && v.signType === 3 && (v.courseLocationCoordinates === undefined || v.courseLocationCoordinates.length < 2)) {
|
||||
this.$message.warning("第" + (i + 1) + "行地点坐标填写有误,请核查")
|
||||
return true
|
||||
}
|
||||
if (v.isMobileSign === true && v.signType === 3 && (v.signType === "" || v.signType === undefined)) {
|
||||
this.$message.warning("第" + (i + 1) + "行签到方式填写有误,请核查")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
if (courseValid) return
|
||||
if (this.formData.restrictLimit === 2 && this.formData.typeLimits.length === 0) {
|
||||
this.$message.warning("请设置报名限制")
|
||||
return
|
||||
}
|
||||
this.formData.isDisabled = false
|
||||
await this.doHandle('提交')
|
||||
} else {
|
||||
if(Object.keys(errMsg).length > 0) {
|
||||
this.$message.warning(errMsg[Object.keys(errMsg)[0]][0].message)
|
||||
return
|
||||
}
|
||||
this.$message.warning("存在必填项未填写")
|
||||
}
|
||||
})
|
||||
},
|
||||
async doHandle(type) {
|
||||
const cloneData = clone(this.formData)
|
||||
cloneData.activitySignUpStartTime = cloneData.activitySignTime !== undefined ? cloneData.activitySignTime[0] : null
|
||||
cloneData.activitySignUpEndTime = cloneData.activitySignTime !== undefined ? cloneData.activitySignTime[1] : null
|
||||
cloneData.activityStartTime = cloneData.activityTime !== undefined ? cloneData.activityTime[0] : null
|
||||
cloneData.activityEndTime = cloneData.activityTime !== undefined ? cloneData.activityTime[1] : null
|
||||
if (cloneData.activityStartTime !== undefined && cloneData.activityStartTime !== null) {
|
||||
cloneData.year = new Date(cloneData.activityStartTime).getFullYear()
|
||||
}
|
||||
cloneData.typeLimits = JSON.stringify(this.formData.typeLimits)
|
||||
cloneData.courseList = JSON.stringify(cloneData.courseList)
|
||||
cloneData.undertakeUnitIds = JSON.stringify(cloneData.undertakeUnitIds)
|
||||
cloneData.hostUnitIds = JSON.stringify(cloneData.hostUnitIds)
|
||||
const confirm = await this.$confirm("您确定要" + type + "吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm !== "confirm") return
|
||||
const resp = await this.$axios.post("/platform/fellowship/manage/doHandle", cloneData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.step = 1
|
||||
this.$emit('refresh')
|
||||
this.$emit('back')
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
async getAllType() {
|
||||
const resp = await this.$axios.post("/platform/fellowship/type/getAllType", {})
|
||||
return resp.data
|
||||
},
|
||||
async init(row) {
|
||||
if (row && row.id) {
|
||||
const resp = await this.$axios.post("/platform/fellowship/manage/findOne", {id: row.id})
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data
|
||||
this.typeChange(this.formData.trainType)
|
||||
}
|
||||
}
|
||||
},
|
||||
async getClubsByRole() {
|
||||
const resp = await this.$axios.post("/platform/club/examine/apply/getClubsByRole")
|
||||
return resp.data
|
||||
},
|
||||
async initData(row) {
|
||||
this.activityGroupList = await this.getActivityGroup()
|
||||
this.historicalActList = await this.getHistoricalActList()
|
||||
this.courseTypeList = await this.getAllType()
|
||||
await this.init(row)
|
||||
|
||||
this.clubOptions = await this.getClubsByRole()
|
||||
this.clubOptions.map((v) => {
|
||||
v.name = v.clubName
|
||||
})
|
||||
const units = await this.$businessTool.listUnit()
|
||||
this.unitOptions = this.clubOptions.concat(units)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'formData.restrictLimit'(val) {
|
||||
if (!this.formData.id) {
|
||||
this.formData.limitNum = val === 3 ? 1 : ''
|
||||
}
|
||||
},
|
||||
'formData.activityGroupId': {
|
||||
async handler(newVal, oldVal) {
|
||||
this.activityGroupList = await this.getActivityGroup()
|
||||
this.userScopeDialog = false
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
const courseTime = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="setUpCourseDialog" title="设置时间" width="60%" append-to-body>
|
||||
<div style="color: red; margin-bottom: 10px">温馨提示:有人员报名后,禁止修改下列时间,如有修改,请联系管理员</div>
|
||||
<div class="left-span-label">选择日期</div>
|
||||
<el-date-picker
|
||||
v-if="formData.courseList && formData.courseList[courseIndex]"
|
||||
:picker-options="setUpCoursePickerOptions"
|
||||
@change="setUpCourseDataChange"
|
||||
placeholder="选择一个或多个日期"
|
||||
style="width: 100%"
|
||||
type="dates"
|
||||
v-model="formData.courseList[courseIndex].setUpCourseData"
|
||||
value-format="yyyy-MM-dd"
|
||||
></el-date-picker>
|
||||
<div class="left-span-label">设置时间</div>
|
||||
<el-row style="margin-bottom: 10px">
|
||||
<el-time-select
|
||||
:picker-options="{
|
||||
start: '08:30',
|
||||
step: '00:05',
|
||||
end: '23:30'
|
||||
}"
|
||||
placeholder="开始时间"
|
||||
size="mini"
|
||||
v-model="courseTimeOneKeySet.startTime"
|
||||
></el-time-select>
|
||||
<el-time-select
|
||||
:picker-options="{
|
||||
start: '08:30',
|
||||
step: '00:05',
|
||||
end: '23:30'
|
||||
}"
|
||||
placeholder="结束时间"
|
||||
size="mini"
|
||||
v-model="courseTimeOneKeySet.endTime"
|
||||
></el-time-select>
|
||||
<el-button @click="oneKeySetStartEndTime" size="mini" type="primary">一键设置开始/结束时间</el-button>
|
||||
<span style="color: #ac3111">报名人数是否限制:</span>
|
||||
<el-radio-group size="mini" v-model="formData.courseList[courseIndex].courseIsLimitApply">
|
||||
<el-radio-button :label="true">是</el-radio-button>
|
||||
<el-radio-button :label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
|
||||
<el-table v-if="formData.courseList && formData.courseList[courseIndex]"
|
||||
:data="formData.courseList[courseIndex].courseTimeList">
|
||||
<el-table-column label="日期">
|
||||
<template v-slot="{row}">
|
||||
<i class="el-icon-time"></i>
|
||||
{{$moment(row.courseDate).format('YYYY-MM-DD')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间">
|
||||
<template v-slot="{row}">
|
||||
<el-time-select
|
||||
:picker-options="{
|
||||
start: '08:30',
|
||||
step: '00:05',
|
||||
end: '23:30'
|
||||
}"
|
||||
placeholder="开始时间"
|
||||
style="width: 100%"
|
||||
v-model="row.courseStartTime"
|
||||
></el-time-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间">
|
||||
<template v-slot="{row}">
|
||||
<el-time-select
|
||||
:picker-options="{
|
||||
start: '08:30',
|
||||
step: '00:05',
|
||||
end: '23:30'
|
||||
}"
|
||||
placeholder="结束时间"
|
||||
style="width: 100%"
|
||||
v-model="row.courseEndTime"
|
||||
></el-time-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-if="formData.courseList[courseIndex].courseIsLimitApply">
|
||||
<el-table-column label="人数限制">
|
||||
<template v-slot="{row}">
|
||||
<el-input-number v-model="row.courseLimitNum" :min="1" :max="1000"
|
||||
style="width: 100%"
|
||||
placeholder="限制报名个数"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="{row,$index}">
|
||||
<el-button
|
||||
@click="formData.courseList[courseIndex].courseTimeList.splice($index,0,{courseDate:row.courseDate,courseStartTime:'',courseEndTime:''})"
|
||||
size="small"
|
||||
>
|
||||
新增同天时段
|
||||
</el-button>
|
||||
<el-button @click="removeSetUpTableCourseRow(row,$index)" size="small" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button @click="doConfirmSetUpCourse" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
data() {
|
||||
const that = this
|
||||
return {
|
||||
setUpCourseDialog: false,
|
||||
courseIndex: 0,
|
||||
formData: {},
|
||||
courseTimeOneKeySet: {
|
||||
startTime: "",
|
||||
endTime: ""
|
||||
},
|
||||
setUpCoursePickerOptions: {
|
||||
disabledDate(time) {
|
||||
return (
|
||||
time.getTime() < Date.parse(that.$moment(that.formData.activityTime[0]).format("YYYY-MM-DD") + " 00:00:00") ||
|
||||
time.getTime() > Date.parse(that.$moment(that.formData.activityTime[1]).format("YYYY-MM-DD") + " 00:00:00")
|
||||
)
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
removeSetUpTableCourseRow(row, index) {
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.splice(index, 1)
|
||||
//培训时间列表日期数组
|
||||
const courseDateArray = this.formData.courseList[this.courseIndex].courseTimeList.map((v) =>
|
||||
this.$moment(v.courseDate).format("YYYY-MM-DD")
|
||||
)
|
||||
//选择课程日期数组
|
||||
const scdList = this.formData.courseList[this.courseIndex].setUpCourseData
|
||||
|
||||
this.formData.courseList[this.courseIndex].setUpCourseData = scdList.filter((v) => {
|
||||
return courseDateArray.includes(this.$moment(v).format("YYYY-MM-DD"))
|
||||
})
|
||||
},
|
||||
oneKeySetStartEndTime() {
|
||||
const { startTime, endTime } = this.courseTimeOneKeySet
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.forEach((v) => {
|
||||
this.$set(v, "courseStartTime", startTime)
|
||||
this.$set(v, "courseEndTime", endTime)
|
||||
})
|
||||
this.$forceUpdate()
|
||||
},
|
||||
setUpCourseDataChange(val) {
|
||||
if (!val) {
|
||||
this.formData.courseList[this.courseIndex].courseTimeList = []
|
||||
return
|
||||
}
|
||||
//培训时间日期Set
|
||||
if (this.formData.courseList[this.courseIndex].courseTimeList === undefined) {
|
||||
this.$set(this.formData.courseList[this.courseIndex], "courseTimeList", [])
|
||||
}
|
||||
const ctList = new Set(
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.map((v) => this.$moment(v.courseDate).format("YYYY-MM-DD"))
|
||||
)
|
||||
val.forEach((v) => {
|
||||
if (!ctList.has(v)) {
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.push({
|
||||
courseDate: v,
|
||||
courseTime: null
|
||||
})
|
||||
}
|
||||
})
|
||||
this.formData.courseList[this.courseIndex].courseTimeList = this.formData.courseList[this.courseIndex].courseTimeList.filter((v) => {
|
||||
return val.includes(this.$moment(v.courseDate).format("YYYY-MM-DD"))
|
||||
})
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.sort((a, b) => {
|
||||
return Date.parse(a["courseDate"]) - Date.parse(b["courseDate"])
|
||||
})
|
||||
},
|
||||
//设置课程时间确定
|
||||
doConfirmSetUpCourse() {
|
||||
const courseTableData = this.formData.courseList[this.courseIndex].courseTimeList
|
||||
if (courseTableData.length === 0) {
|
||||
this.$message.warning("请填写时间!")
|
||||
return
|
||||
}
|
||||
if (courseTableData && courseTableData.length > 0) {
|
||||
const valid = courseTableData.every((v) => v.courseStartTime && v.courseEndTime && v.courseStartTime < v.courseEndTime)
|
||||
if (!valid) {
|
||||
this.$message.warning("时间填写不完整或者有误!")
|
||||
return
|
||||
}
|
||||
this.setUpCourseDialog = false
|
||||
}
|
||||
},
|
||||
onOpen(formData, index) {
|
||||
this.formData = formData
|
||||
this.courseIndex = index
|
||||
if (!this.formData.activityTime || this.formData.activityTime.length === 0) {
|
||||
this.$message.warning("请先设置活动起止时间")
|
||||
return
|
||||
}
|
||||
this.courseIndex = index
|
||||
this.setUpCourseDialog = true
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if(!this.formData.courseList) {
|
||||
this.formData = {courseList: [{unionLimit: []}]}
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
<!--#include('unionForm.js'){}#-->
|
||||
const customForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-drawer title="自定义设置" size="50%" class="my-drawer" :visible.sync="moreInfoDrawer" append-to-body>
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>分工会人数限制</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-button @click="openSetUpUnionLimit(moreInfoIndex)" type="primary" size="small">
|
||||
设置分工会人数限制
|
||||
</el-button>
|
||||
<span
|
||||
v-if="formData.courseList[moreInfoIndex].unionLimit && formData.courseList[moreInfoIndex].unionLimit.length > 0"
|
||||
class="text-success"
|
||||
>
|
||||
已设置
|
||||
</span>
|
||||
<span v-else class="text-danger">未设置</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>承办工会</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-select v-model="formData.courseList[moreInfoIndex].hostUnionId" placeholder="请选择承办工会"
|
||||
style="width: 100%" clearable>
|
||||
<el-option :label="item.name" :value="item.id" :key="item.id"
|
||||
v-for="item in unionList"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>对内报名时间</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-date-picker
|
||||
placeholder="请选择对内报名时间"
|
||||
style="width: 100%"
|
||||
type="datetime"
|
||||
v-model="formData.courseList[moreInfoIndex].interTime"
|
||||
format="yyyy-MM-dd HH:mm"
|
||||
value-format="yyyy-MM-dd HH:mm"
|
||||
></el-date-picker>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>是否签到</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-radio-group v-model="formData.courseList[moreInfoIndex].isMobileSign" size="small">
|
||||
<el-radio border :label="true">签到</el-radio>
|
||||
<el-radio border :label="false">不签到</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="formData.courseList[moreInfoIndex].isMobileSign === true" :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>签到方式</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-radio-group v-model="formData.courseList[moreInfoIndex].signType" size="small">
|
||||
<el-radio border :label="1">扫描二维码</el-radio>
|
||||
<el-radio border :label="2">被扫</el-radio>
|
||||
<el-radio border :label="3">GPS定位签到</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row
|
||||
v-if="formData.courseList[moreInfoIndex].isMobileSign === true
|
||||
&& formData.courseList[moreInfoIndex].signType == 3"
|
||||
:gutter="50"
|
||||
type="flex"
|
||||
>
|
||||
<el-col :span="4">
|
||||
<span>地点坐标</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-button @click="openMap(moreInfoIndex)" type="primary" size="small">设置签到点</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>是否领取礼品</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-radio-group v-model="formData.courseList[moreInfoIndex].isReceiveGift" size="small">
|
||||
<el-radio border :label="true">领取</el-radio>
|
||||
<el-radio border :label="false">不领取</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="formData.courseList[moreInfoIndex].isReceiveGift === true" :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>领取方式</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-radio-group v-model="formData.courseList[moreInfoIndex].giftType" size="small">
|
||||
<el-radio border :label="1">扫描二维码</el-radio>
|
||||
<el-radio border :label="2">面对面确认</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>报名方式</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-radio-group
|
||||
v-model="formData.courseList[moreInfoIndex].reserveMode"
|
||||
size="small"
|
||||
>
|
||||
<el-radio border :label="1">报名人员减少模式</el-radio>
|
||||
<el-radio border :label="2">候补模式</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="50" type="flex" v-if="formData.courseList[moreInfoIndex].reserveMode === 2">
|
||||
<el-col :span="4">
|
||||
<span>候补数量</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-input-number :controls="false" style="width: 100%"
|
||||
:max="100"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
step-strictly
|
||||
v-model="formData.courseList[moreInfoIndex].waitingNum"></el-input-number>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 添加条件构造器 -->
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>可选条件</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-button size="mini" type="primary"
|
||||
@click="openCnd(moreInfoIndex)">设置可选条件 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>详细信息</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<text-editor v-model="formData.courseList[moreInfoIndex].introduce"></text-editor>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div style="text-align: right">
|
||||
<el-button @click="moreInfoDrawer = false">取 消</el-button>
|
||||
<el-button type="primary" @click="moreInfoDrawer = false">保 存</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="mapDialog" title="位置信息" :append-to-body="true">
|
||||
<map-container v-if="mapDialog" :position.sync="formData.courseList[mapIndex].courseLocationCoordinates"></map-container>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="mapDialog = false">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="conditionStructureDialogVisible" title="条件构造器" :append-to-body="true">
|
||||
<condition-group :group="conditionGroup" :field_options="fieldOptions"
|
||||
@remove="removeRootGroup"></condition-group>
|
||||
<div slot="footer">
|
||||
<el-button @click="conditionStructureDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmCnd">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<union-form ref="unionFormRef"></union-form>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
moreInfoDrawer: false,
|
||||
unionList: [],
|
||||
formData: {},
|
||||
moreInfoRow: {},
|
||||
moreInfoIndex: 0,
|
||||
|
||||
mapDialog: false,
|
||||
mapIndex: 0,
|
||||
|
||||
// 条件构造器相关
|
||||
conditionStructureDialogVisible: false,
|
||||
// 可选字段列表
|
||||
fieldOptions: [
|
||||
{label: "姓名", value: "username"},
|
||||
{label: "工号", value: "loginname"},
|
||||
{label: "性别", value: "sex"},
|
||||
{label: "年龄", value: "age"},
|
||||
{label: "婚姻状况", value: "marriage"},
|
||||
{label: "在职状态", value: "userState"},
|
||||
{label: "编制类别", value: "preparedBy"},
|
||||
{label: "教职工类别", value: "personType"},
|
||||
],
|
||||
|
||||
conditionGroup: {
|
||||
logic: "AND",
|
||||
conditions: [],
|
||||
groups: []
|
||||
},
|
||||
|
||||
// 条件构造器相关
|
||||
currentCourseIndex: -1, // 当前编辑的课程索引
|
||||
subjectMoneyIndex: null,
|
||||
hospitalIndex: null
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"union-form": unionForm,
|
||||
"map-container": httpVueLoader("/components/plugins/mapContainer/MapContainer.vue?v=1.0.1"),
|
||||
},
|
||||
methods: {
|
||||
removeRootGroup() {
|
||||
// 重置根条件组
|
||||
this.conditionGroup = {
|
||||
logic: "AND",
|
||||
conditions: [],
|
||||
groups: []
|
||||
}
|
||||
},
|
||||
openCnd(moreInfoIndex) {
|
||||
this.currentCourseIndex = moreInfoIndex;
|
||||
this.conditionStructureDialogVisible = true
|
||||
const currentCourse = this.formData.courseList[moreInfoIndex];
|
||||
if (currentCourse.matchCnd) {
|
||||
this.conditionGroup = JSON.parse(JSON.stringify(currentCourse.matchCnd));
|
||||
} else {
|
||||
this.conditionGroup = {
|
||||
logic: "AND",
|
||||
conditions: [],
|
||||
groups: []
|
||||
}
|
||||
}
|
||||
// this.$refs.conditionStructureDialog.onOpen(row.matchCnd ? row.matchCnd : null)
|
||||
},
|
||||
// 条件构造器确认
|
||||
confirmCnd() {
|
||||
if (this.currentCourseIndex >= 0) {
|
||||
this.$set(
|
||||
this.formData.courseList[this.currentCourseIndex],
|
||||
'matchCnd',
|
||||
JSON.parse(JSON.stringify(this.conditionGroup))
|
||||
);
|
||||
}
|
||||
this.conditionStructureDialogVisible = false;
|
||||
this.currentCourseIndex = -1;
|
||||
},
|
||||
openMap(index) {
|
||||
this.mapIndex = index
|
||||
this.mapDialog = true
|
||||
},
|
||||
openSetUpUnionLimit(index) {
|
||||
this.$refs.unionFormRef.onOpen(this.formData, index)
|
||||
},
|
||||
async onOpen(formData, chooseRow, index) {
|
||||
this.formData = formData
|
||||
this.moreInfoRow = chooseRow
|
||||
this.moreInfoIndex = index
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
this.moreInfoDrawer = true
|
||||
},
|
||||
addCondition(val) {
|
||||
// 保存条件到对应的课程
|
||||
if (this.currentCourseIndex >= 0) {
|
||||
this.$set(
|
||||
this.formData.courseList[this.currentCourseIndex],
|
||||
'matchCnd',
|
||||
val
|
||||
);
|
||||
}
|
||||
|
||||
this.currentCourseIndex = -1;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if(!this.formData.courseList) {
|
||||
this.formData = {courseList: [{unionLimit: []}]}
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-drawer__body {
|
||||
padding: 20px;
|
||||
}
|
||||
.my-drawer .el-col-4 {
|
||||
text-align: right;
|
||||
}
|
||||
.my-drawer .el-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.courseTimeButton {
|
||||
padding: 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="请选择年度"
|
||||
type="year"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="活动名称">
|
||||
<el-input
|
||||
@keyup.enter.native="doSearch"
|
||||
clearable
|
||||
placeholder="请输入活动名称"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="pageForm.activityName"
|
||||
></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="活动列表">
|
||||
<el-button @click="openAdd" size="small" type="primary">
|
||||
<i class="ti-plus"></i>新建活动
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize">
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip
|
||||
v-for="(column, index) in tableColumns"
|
||||
:key="index"
|
||||
>
|
||||
<template v-slot="{ row }" v-if="column.prop === 'isDisabled'">
|
||||
<el-switch
|
||||
:active-value="false"
|
||||
:inactive-value="true"
|
||||
@change="(val) => { activityStatusChange(row.notice, val,row.id) }"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
v-model="row.isDisabled"
|
||||
></el-switch>
|
||||
</template>
|
||||
<template v-slot="{ row: { createdAt } }" v-else-if="column.prop === 'createdAt'">
|
||||
{{ $moment(createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
<template v-slot="{ row }" v-else-if="column.prop === 'activityTime'">
|
||||
<span>{{ $moment(row.activityStartTime).format('YYYY/MM/DD') }}</span>
|
||||
<span> 至 </span>
|
||||
<span>{{ $moment(row.activityEndTime).format('YYYY/MM/DD') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template v-slot="{ row }">
|
||||
<el-dropdown>
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="openActivityCode(row.id)">活动二维码</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="makeCode(row)">签到二维码</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="onView(row)">查看</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="openEdit(row)">编辑</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="onDelete(row)">删除</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
<basic-form ref="formRef" @back="back" @refresh="doSearch"></basic-form>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="infoRef"></info>
|
||||
</template>
|
||||
|
||||
<make-qrcode ref="codeRef"></make-qrcode>
|
||||
|
||||
<el-dialog
|
||||
title="活动二维码"
|
||||
:visible.sync="codeDialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
width="30%">
|
||||
<div style=" display: flex;justify-content: center;">
|
||||
<qrcode :options="{ width: 400 }" :value="activityUrl" ></qrcode>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="codeDialogVisible = false" type="primary">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script src="${base!}/assets/platform/plugins/jr-qrcode/jr-qrcode.js"></script>
|
||||
<script>
|
||||
<!--#include('info.js'){}#-->
|
||||
<!--#include('basicForm.js'){}#-->
|
||||
<!--#include('makeQrcode.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
dicts: ["USER_CAMPUS", "FELLOWSHIP_TYPE"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"info": info,
|
||||
"basic-form": basicForm,
|
||||
"make-qrcode": makeQrcode,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: new Date().getFullYear() + ''
|
||||
},
|
||||
tableColumns: [
|
||||
{ label: "活动名称", prop: "activityName", width: 600 },
|
||||
{ label: "活动时间", prop: "activityTime" },
|
||||
{ label: "是否开启", prop: "isDisabled", width: 100 },
|
||||
{ label: "创建时间", prop: "createdAt" }
|
||||
],
|
||||
codeDialogVisible: false,
|
||||
activityUrl: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
this.$refs.guava.index()
|
||||
},
|
||||
openAdd() {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.formRef.initData()
|
||||
})
|
||||
},
|
||||
openEdit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.formRef.initData(row)
|
||||
})
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.infoRef.initData(row.id)
|
||||
})
|
||||
},
|
||||
openActivityCode(id) {
|
||||
this.activityUrl = location.origin + "/platform/fellowship/apply/h5?id=" + id
|
||||
this.codeDialogVisible = true
|
||||
},
|
||||
makeCode(row) {
|
||||
this.$refs.codeRef.initData(row)
|
||||
},
|
||||
async activityStatusChange(notice, val, id) {
|
||||
const resp = await this.$axios.post(loc() + "/activityStatusChange", { notice: notice, isDisabled: val, id })
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
async onDelete(row) {
|
||||
this.$confirm("此操作将永久删除, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post(loc() + "/onDelete", { id: row.id })
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
}).catch(() => {})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,111 @@
|
||||
const info = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-tabs>
|
||||
<el-tab-pane label="基础信息">
|
||||
<el-descriptions :column="2" border class="table_fixed mt20">
|
||||
<el-descriptions-item :span="2" label="活动名称">{{viewData.activityName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="年度">{{viewData.year}}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{$moment(viewData.createdAt).format('YYYY-MM-DD HH:mm:ss')}}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动开始时间">{{viewData.activityStartTime}}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动结束时间">{{viewData.activityEndTime}}</el-descriptions-item>
|
||||
<el-descriptions-item label="报名开始时间">{{viewData.activitySignUpStartTime}}</el-descriptions-item>
|
||||
<el-descriptions-item label="报名结束时间">{{viewData.activitySignUpEndTime}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="活动信息">
|
||||
<el-table :data="viewData.courseList" class="mt20">
|
||||
<el-table-column :label="trainType + '名称'" prop="courseName"></el-table-column>
|
||||
<el-table-column label="类型" prop="courseTypeName"></el-table-column>
|
||||
<el-table-column label="人数" prop="coursePeopleNumber"></el-table-column>
|
||||
<el-table-column label="预留名额" prop="courseReservedNumber"></el-table-column>
|
||||
<el-table-column label="地点" prop="courseLocation">
|
||||
<template v-slot="{row}">
|
||||
<el-button @click="openViewMap(row.courseLocationCoordinates)" type="text">{{row.courseLocation}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="校区" prop="campus"></el-table-column>
|
||||
<el-table-column label="负责人" prop="courseInstructor"></el-table-column>
|
||||
<el-table-column label="活动时间" prop="courseTimeList" width="200px">
|
||||
<template v-slot="{ row }">
|
||||
<el-button @click="openViewCourseTime(row.courseTimeList)" type="text">点击查看活动时间</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-dialog :visible.sync="courseTimeListDialog" :title="trainType + '时间'" width="60%" append-to-body>
|
||||
<el-table :data="courseTimeList">
|
||||
<el-table-column label="日期" prop="courseDate">
|
||||
<template v-slot="{row}">{{$moment(row.courseDate).format('YYYY-MM-DD')}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="courseStartTime"></el-table-column>
|
||||
<el-table-column label="结束时间" prop="courseEndTime"></el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="courseTimeListDialog = false" type="primary">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="viewMapDialog" title="地点" width="60%">
|
||||
<div id="viewMap" style="width: 100%; height: 500px"></div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
trainType: '',
|
||||
viewData: {},
|
||||
courseTimeListDialog: false,
|
||||
courseTimeList: [],
|
||||
|
||||
viewMapDialog: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initData(id) {
|
||||
this.$axios.post("/platform/fellowship/manage/findOne", { id: id })
|
||||
.then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.viewData = resp.data
|
||||
const type = this.dict.type.FELLOWSHIP_TYPE.find((o) => o.code === resp.data.trainType)
|
||||
this.trainType = type?.name || ""
|
||||
}
|
||||
})
|
||||
},
|
||||
openViewCourseTime(courseTimeList) {
|
||||
this.courseTimeList = courseTimeList
|
||||
this.courseTimeListDialog = true
|
||||
},
|
||||
openViewMap(point) {
|
||||
if (!Array.isArray(point)) {
|
||||
this.$message.warning("没有设置点位,无法通过地图查看")
|
||||
return
|
||||
}
|
||||
this.viewMapDialog = true
|
||||
this.$nextTick(() => {
|
||||
viewMap = new AMap.Map("viewMap", {
|
||||
resizeEnable: true,
|
||||
center: point,
|
||||
zoom: 16
|
||||
})
|
||||
if (viewMarker) {
|
||||
viewMap.remove(viewMarker)
|
||||
}
|
||||
viewMarker = new AMap.Marker({
|
||||
position: point,
|
||||
offset: new AMap.Pixel(-13, -30)
|
||||
})
|
||||
viewMap.add(viewMarker)
|
||||
viewMap.setFitView(null, false, [150, 60, 100, 60])
|
||||
})
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
/deep/ .el-button--text {
|
||||
padding: 0;
|
||||
}
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
const makeQrcode = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="courseDialog"
|
||||
append-to-body :title="trainType + '列表'" width="60%">
|
||||
<el-table :data="courseList">
|
||||
<el-table-column :label="trainType + '名称'" prop="courseName"></el-table-column>
|
||||
<el-table-column label="校区" prop="campus"></el-table-column>
|
||||
<el-table-column label="是否签到" prop="isMobileSign">
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.isMobileSign === true">签到</span>
|
||||
<span v-else>不签到</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签到方式" prop="signType">
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.signType === 1">扫描二维码</span>
|
||||
<span v-else-if="row.signType === 2">被扫</span>
|
||||
<span v-else-if="row.signType === 3">GPS定位签到</span>
|
||||
<span v-else>暂无签到方式</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否领取礼品" prop="isReceiveGift">
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.isReceiveGift === true">领取</span>
|
||||
<span v-else>不领取</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领取方式" prop="giftType">
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.giftType === 1">扫描二维码</span>
|
||||
<span v-else-if="row.giftType === 2">面对面确认</span>
|
||||
<span v-else>暂无领取方式</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="260">
|
||||
<template v-slot="{row}">
|
||||
<el-button v-if="row.signType === 1"
|
||||
@click="makeCourseCode(row)"
|
||||
size="mini" type="primary">
|
||||
生成二维码
|
||||
</el-button>
|
||||
<el-button v-else size="mini" type="text">该{{trainType}}的签到方式不支持生成二维码</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="courseDialog = false" type="primary">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
courseDialog: false,
|
||||
trainType: "",
|
||||
courseList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initData(row) {
|
||||
this.courseList = row.courseList
|
||||
const type = this.dict.type.FELLOWSHIP_TYPE.find((o) => o.code === row.trainType)
|
||||
this.trainType = type?.name || "培训班"
|
||||
this.courseDialog = true
|
||||
},
|
||||
makeCourseCode(row) {
|
||||
const url = '/platform/fellowship/mine/drivingScan'
|
||||
const data = url + '?courseId=' + row.id
|
||||
console.log(data)
|
||||
const content = jrQrcode.getQrBase64(data)
|
||||
let image = new Image()
|
||||
image.src = content
|
||||
let viewer = new Viewer(image, {
|
||||
zIndex: 99999999,
|
||||
})
|
||||
viewer.show()
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
const unionForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="setUpUnionLimitDialog" title="分工会人数限制" top="50px" append-to-body>
|
||||
<div class="left-span-label" style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div>分段设置</div>
|
||||
<div>
|
||||
<el-button size="small" type="primary" @click="unionLimitQuickSetting">应用分段设置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-row v-for="(item,index) in unionUserNumCalc" :key="index" :gutter="20" class="mb5">
|
||||
<el-col :span="7">
|
||||
<el-input-number
|
||||
v-model="item.startNum"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
:min="1"
|
||||
placeholder="请输入最小人数"
|
||||
style="width: 100%"
|
||||
></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-input-number
|
||||
v-model="item.endNum"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
:min="1"
|
||||
placeholder="请输入最大人数"
|
||||
style="width: 100%"
|
||||
></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input-number
|
||||
v-model="item.resultNum"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
:min="1"
|
||||
placeholder="请输入限制人数"
|
||||
style="width: 100%"
|
||||
></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="4" class="text-right">
|
||||
<el-button icon="el-icon-plus" @click="unionUserNumCalc.push({})"></el-button>
|
||||
<el-button icon="el-icon-minus" @click="unionUserNumCalc.splice(index,1)" :disabled="unionUserNumCalc.length===1"></el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="mt10">
|
||||
<div v-for="(item,index) in unionUserNumCalcTips" class="text-danger">
|
||||
<span class="mr10">({{index+1}}).</span>
|
||||
{{item}}
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<div class="left-span-label" style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div>比例设置</div>
|
||||
<div>
|
||||
一键比例:
|
||||
<el-input-number
|
||||
v-model="unionUserNumOneKeyRatio"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
:min="0"
|
||||
placeholder="请输入一键比例"
|
||||
size="small"
|
||||
:max="100"
|
||||
></el-input-number>
|
||||
<el-button size="small" type="primary" @click="applyScaleSettings" class="ml5">应用比例设置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="formData.courseList[unionLimitIndex].unionLimit" max-height="500px">
|
||||
<el-table-column prop="name" label="分工会"></el-table-column>
|
||||
<el-table-column prop="teacherCount" label="人数"></el-table-column>
|
||||
<el-table-column prop="ratio" label="比例(%)">
|
||||
<template v-slot="{row}">
|
||||
<el-input-number v-model="row.ratio" :precision="0" :step="1" :min="0" :max="100"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="limitCount" label="限制人数">
|
||||
<template v-slot="{row}">
|
||||
<el-input-number
|
||||
v-model="row.limitCount"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
:min="0"
|
||||
:max="row.teacherCount"
|
||||
@change="calSummaryCount"
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<div class="text-danger" style="width: 100%; font-size: 18px; display: flex; align-items: center; font-weight: bold">
|
||||
限制总人数:{{summaryCount}}人
|
||||
</div>
|
||||
<el-button @click="clearUnionLimit" type="danger">清空分工会人数限制</el-button>
|
||||
<el-button @click="setUpUnionLimitDialog=false">取消</el-button>
|
||||
<el-button @click="doConfirmSetUpUnionLimit" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
formData: {},
|
||||
unionLimitIndex: 0,
|
||||
setUpUnionLimitDialog: false,
|
||||
unionList: [],
|
||||
unionUserNumCalc: [{}],
|
||||
unionUserNumOneKeyRatio: null,
|
||||
summaryCount: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
unionUserNumCalcTips() {
|
||||
return this.unionUserNumCalc.map((v) => {
|
||||
return (
|
||||
(v.startNum ? v.startNum : "?") +
|
||||
"-" +
|
||||
(v.endNum ? v.endNum : "?") +
|
||||
"人的分工会,限报" +
|
||||
(v.resultNum ? v.resultNum : "?") +
|
||||
"人"
|
||||
)
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
calSummaryCount() {
|
||||
const array = this.formData.courseList[this.unionLimitIndex].unionLimit
|
||||
if (array) {
|
||||
this.summaryCount = array.reduce((prev, curr) => {
|
||||
const value = Number(curr.limitCount)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr.limitCount
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
}
|
||||
},
|
||||
async onOpen(formData, index) {
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
this.formData = formData
|
||||
this.unionLimitIndex = index
|
||||
this.setUpUnionLimitDialog = true
|
||||
if (
|
||||
!this.formData.courseList[this.unionLimitIndex].unionLimit ||
|
||||
this.formData.courseList[this.unionLimitIndex].unionLimit.length === 0
|
||||
) {
|
||||
const resp = await this.$axios.get("/platform/fellowship/manage/getUnionLimit", {
|
||||
activityScopeId: this.formData.activityGroupId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$set(this.formData.courseList[this.unionLimitIndex], "unionLimit", resp.data)
|
||||
}
|
||||
}
|
||||
this.summaryCount = this.formData.courseList[this.unionLimitIndex].unionLimit.reduce((prev, curr) => {
|
||||
const value = Number(curr.limitCount)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr.limitCount
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
},
|
||||
unionLimitQuickSetting() {
|
||||
this.unionUserNumCalc.forEach((v, i) => {
|
||||
const startNum = v.startNum
|
||||
const endNum = v.endNum
|
||||
const resultNum = v.resultNum
|
||||
if (startNum > endNum) {
|
||||
this.$message.warning("第" + (i + 1) + "行设置错误")
|
||||
} else {
|
||||
this.formData.courseList[this.unionLimitIndex].unionLimit.forEach((x) => {
|
||||
if (x.teacherCount >= startNum && x.teacherCount <= endNum) {
|
||||
x.limitCount = resultNum
|
||||
}
|
||||
})
|
||||
this.calSummaryCount()
|
||||
}
|
||||
})
|
||||
},
|
||||
doConfirmSetUpUnionLimit() {
|
||||
this.setUpUnionLimitDialog = false
|
||||
},
|
||||
//应用比例设置
|
||||
applyScaleSettings() {
|
||||
this.formData.courseList[this.unionLimitIndex].unionLimit.forEach((v) => {
|
||||
v.limitCount = parseFloat(((v.teacherCount * this.unionUserNumOneKeyRatio) / 100).toFixed(0))
|
||||
if (v.ratio) {
|
||||
v.limitCount = parseFloat(((v.teacherCount * v.ratio) / 100).toFixed(0))
|
||||
}
|
||||
})
|
||||
this.calSummaryCount()
|
||||
},
|
||||
async clearUnionLimit() {
|
||||
const confirm = await this.$confirm("确定要清空分工会人数限制吗, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if ("confirm" === confirm) {
|
||||
this.formData.courseList[this.unionLimitIndex].unionLimit = []
|
||||
this.unionUserNumOneKeyRatio = null
|
||||
this.unionUserNumCalc = [{}]
|
||||
this.setUpUnionLimitDialog = false
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if(!this.formData.courseList) {
|
||||
this.formData = {courseList: [{unionLimit: []}]}
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-icon-arrow-left,
|
||||
.el-icon-arrow-right {
|
||||
font-size: 28px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
placeholder="请选择年度"
|
||||
type="year"
|
||||
style="width: 100%"
|
||||
@change="yearChange"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="活动名称">
|
||||
<el-select @change="activityChange" style="width: 100%" v-model="pageForm.activityId">
|
||||
<el-option :label="item.activityName" :value="item.id" v-for="item in activityList" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :label="trainType">
|
||||
<el-button type="primary" size="small" @click="exportSignUser" :disabled="!pageForm.activityId">导出报名人员</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize">
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column label="活动名称" prop="courseName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="类型" prop="courseType" sortable show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="活动地点" prop="courseLocation" sortable show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="负责人" prop="courseInstructor" sortable show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="最多报名人数" prop="coursePeopleNumber" sortable align="center" header-align="center" show-overflow-tooltip>
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.reserveMode === 1">
|
||||
{{row.coursePeopleNumber}}
|
||||
</span>
|
||||
<span v-if="row.reserveMode === 2">
|
||||
{{(row.coursePeopleNumber + row.waitingNum) + '(候补占' + row.waitingNum + ')'}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预留人数" prop="courseReservedNumber" sortable show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="已报名人数" prop="registerNum" sortable show-overflow-tooltip>
|
||||
<template v-slot="{row}">
|
||||
<el-link @click="openView(row)" type="primary">
|
||||
{{row.registerNum}}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px">
|
||||
<template v-slot="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button @click="openSign(row)" size="mini" v-if="row.interTime" :type="row.openOtherUnion === true ? 'danger' : 'primary'">
|
||||
{{row.openOtherUnion === true ? '关闭报名' : '开放报名'}}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<info ref="infoRef"></info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"info": info,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activityList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear().toString(),
|
||||
activityId: null
|
||||
},
|
||||
tableColumns: [
|
||||
{ label: "培训班", prop: "courseName" },
|
||||
{ label: "类型", prop: "courseType", sortable: true },
|
||||
{ label: "地点", prop: "courseLocation" },
|
||||
{ label: "教师", prop: "courseInstructor", sortable: true },
|
||||
{ label: "最多报名人数", prop: "coursePeopleNumber", sortable: true },
|
||||
{ label: "已报名人数", prop: "registerNum", sortable: true }
|
||||
],
|
||||
trainType: "培训班",
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async openSign(row) {
|
||||
const resp = await this.$axios.post(loc() + "/signChange", { courseId: row.id, openOtherUnion: !row.openOtherUnion })
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
activityChange(val) {
|
||||
const activity = this.activityList.find((o) => o.id === val)
|
||||
const type = this.dict.type.FELLOWSHIP_TYPE.find(o => o.code === activity.trainType)
|
||||
this.trainType = type?.name || "培训班"
|
||||
},
|
||||
exportSignUser() {
|
||||
this.$downLoad(loc() + "/exportSignUser", { activityId: this.pageForm.activityId })
|
||||
},
|
||||
async yearChange() {
|
||||
this.pageForm.activityId = null
|
||||
await this.getActivityList()
|
||||
await this.doSearch()
|
||||
},
|
||||
async getActivityList() {
|
||||
const resp = await this.$axios.post(loc() + "/activityList", { year: this.pageForm.year })
|
||||
this.activityList = resp.data
|
||||
if (this.activityList && this.activityList.length > 0) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
this.activityChange(this.activityList[0].id)
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
await this.getActivityList()
|
||||
},
|
||||
async openView(row) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.initData()
|
||||
await this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,98 @@
|
||||
const info = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-tabs>
|
||||
<el-tab-pane label="报名人员">
|
||||
<el-table :data="registerUserTableData" class="mt20" max-height="600">
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="(column, index) in registerUserTableColumns"
|
||||
:key="index"
|
||||
>
|
||||
<template v-slot="{row}" v-if="column.prop === 'state'">
|
||||
<span class="text-success" v-if="row.state === 1">正常报名</span>
|
||||
<span class="text-warning" v-else-if="row.state === 2">候补报名</span>
|
||||
<span class="text-success" v-else-if="row.state === 3">正常报名(候补)</span>
|
||||
<span class="text-info" v-else-if="row.state === 4">无效报名(缺席)</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="签到情况" v-if="clickRow.isMobileSign === true && Object.keys(userSignInfo).length > 0">
|
||||
<el-tabs style="height: 600px" tab-position="left" class="mt20">
|
||||
<el-tab-pane v-for="(item, key) in userSignInfo" :key="key">
|
||||
<span slot="label">
|
||||
<i class="el-icon-date"></i>
|
||||
{{key}}
|
||||
</span>
|
||||
<el-table :data="item" style="max-height: 600px; overflow-y: auto">
|
||||
<el-table-column label="姓名" prop="username"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginname"></el-table-column>
|
||||
<el-table-column label="是否签到" prop="isAttend">
|
||||
<template v-slot="{row}">
|
||||
<template v-if="Date.now() < Date.parse(row.courseStartTime)">
|
||||
<span class="text-default">未开始</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="text-success" v-if="row.isAttend">已签到</span>
|
||||
<span class="text-warning" v-else>未签到</span>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签到时间" prop="attendTime"></el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
registerUserTableData: [],
|
||||
registerUserTableColumns: [
|
||||
{ label: "姓名", prop: "username" },
|
||||
{ label: "工号", prop: "loginname" },
|
||||
{ label: "单位", prop: "unitName" },
|
||||
{ label: "分工会", prop: "unionName" },
|
||||
{ label: "联系方式", prop: "mobile" },
|
||||
{ label: "报名时间", prop: "signUpTime" },
|
||||
{ label: "报名状态", prop: "state" }
|
||||
],
|
||||
cloneTableColumns: [
|
||||
{label: '姓名', prop: 'username'},
|
||||
{label: '工号', prop: 'loginname'},
|
||||
{label: '单位', prop: 'unitName'},
|
||||
{label: '分工会', prop: 'unionName'},
|
||||
{label: '联系方式', prop: 'mobile'},
|
||||
{label: '报名时间', prop: 'signUpTime'},
|
||||
{label: '报名状态', prop: 'state'},
|
||||
],
|
||||
userSignInfo: {},
|
||||
clickRow: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onOpen(row) {
|
||||
this.clickRow = row
|
||||
const resp_register = await this.$axios.post(loc() + "/registerUserList", {courseId: row.id})
|
||||
this.registerUserTableData = resp_register.data
|
||||
const resp_signInfo = await this.$axios.post(loc() + "/getSignInfo", {courseId: row.id})
|
||||
this.userSignInfo = resp_signInfo.data
|
||||
const resp_columnInfo = await $.get(loc() + '/getTaleColumnInfo', {courseId: row.id})
|
||||
if (resp_columnInfo.data) {
|
||||
this.registerUserTableColumns = []
|
||||
this.registerUserTableColumns = this.cloneTableColumns.concat(resp_columnInfo.data)
|
||||
}
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,354 @@
|
||||
const basicForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-form label-width="120px" :model="formData" ref="addForm" :rules="rules">
|
||||
<el-form-item prop="code" label="类型编码">
|
||||
<el-input v-model="formData.code" placeholder="请输入类型编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="typeName" label="类型名称">
|
||||
<el-input v-model="formData.typeName" placeholder="请输入类型名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="isBringFamily" label="是否携带家属">
|
||||
<el-radio-group v-model="formData.isBringFamily" @input="isBringFamilyInput">
|
||||
<el-radio :label="true" border>携带</el-radio>
|
||||
<el-radio :label="false" border>不携带</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.isBringFamily === true" prop="isAddFamily" label="家属纳入总人数">
|
||||
<el-radio-group v-model="formData.isAddFamily">
|
||||
<el-radio :label="true" border>纳入</el-radio>
|
||||
<el-radio :label="false" border>不纳入</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.isBringFamily === true" prop="selfAddFamily" label="本人纳入总人数">
|
||||
<el-radio-group v-model="formData.selfAddFamily">
|
||||
<el-radio :label="true" border>纳入</el-radio>
|
||||
<el-radio :label="false" border>不纳入</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="left-span-label" style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div>
|
||||
报名填写字段
|
||||
<span style="color: #c64120; margin-left: 10px">
|
||||
注:移动端报名时字段的显示顺序会按照下面表格中的序号进行排列、字段编码不能重复
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
@click="formData.mobileSignColumnList.push({isRequired: false})"
|
||||
size="small"
|
||||
type="primary"
|
||||
style="margin-left: 10px"
|
||||
>
|
||||
<i class="ti-plus"></i>
|
||||
添加
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="formData.mobileSignColumnList">
|
||||
<el-table-column label="序号" prop="columnIndex">
|
||||
<template v-slot="{row}">
|
||||
<el-input-number v-model="row.columnIndex" placeholder="请输入序号"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="字段名称" prop="columnName">
|
||||
<template v-slot="{row}">
|
||||
<el-input v-model="row.columnName" placeholder="请输入字段名称"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="字段编码" prop="columnCode">
|
||||
<template v-slot="{row}">
|
||||
<el-input
|
||||
v-model="row.columnCode"
|
||||
placeholder="请输入字段编码"
|
||||
:disabled="formData.isBringFamily === true && row.columnCode === 'xdqsrs'"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="控件类型" prop="columnFormType">
|
||||
<template v-slot="{row, $index}">
|
||||
<el-select
|
||||
filterable
|
||||
v-model="row.columnFormType"
|
||||
@change="(val) => {columnFormTypeChange(val, $index)}"
|
||||
placeholder="请选择控件类型"
|
||||
>
|
||||
<el-option v-for="item in columnFormTypeList" :label="item.description" :value="item.code" :key="item.code"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="字段类型" prop="columnType">
|
||||
<template v-slot="{row}">
|
||||
<el-select
|
||||
filterable
|
||||
placeholder="请选择字段类型"
|
||||
v-model="row.columnType"
|
||||
>
|
||||
<el-option v-for="item in columnTypeOptions" :label="item" :value="item" :key="item"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="是否必填" prop="isRequired" sortable>
|
||||
<template v-slot="{row}">
|
||||
<el-switch
|
||||
v-model="row.isRequired"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<template v-slot="{row, $index}">
|
||||
<el-button
|
||||
@click="openDetailedParams(row, $index)"
|
||||
:disabled="!['SELECT', 'RADIO', 'FILE'].includes(row.columnFormType)"
|
||||
size="mini"
|
||||
type="primary"
|
||||
>
|
||||
设置详细参数
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="formData.mobileSignColumnList.splice($index, 1)"
|
||||
:disabled="formData.isBringFamily === true && row.columnCode === 'xdqsrs'"
|
||||
size="mini"
|
||||
type="danger"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div style="float: right; margin: 20px 0">
|
||||
<el-button @click="$emit('refresh')">取 消</el-button>
|
||||
<el-button type="primary" @click="doHandle">确 定</el-button>
|
||||
</div>
|
||||
|
||||
<el-drawer append-to-body :visible.sync="detailedParamsVisible" size="40%">
|
||||
<template #title>
|
||||
<div class="left-span-label">设置详细参数</div>
|
||||
</template>
|
||||
<el-form class="mt20" ref="paramForm" :rules="paramFormRules" :model="clickRow" label-width="80px">
|
||||
<template v-if="['SELECT'].includes(clickRow.columnFormType)">
|
||||
<el-form-item label="选项列表" prop="selectValues">
|
||||
<el-select
|
||||
v-model="clickRow.selectValues"
|
||||
multiple
|
||||
style="width: 100%"
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
placeholder="请选择选项列表(如无数据时,需手动输入选项进行添加)"
|
||||
>
|
||||
<el-option v-for="item in clickRow.columnOptions" :label="item" :value="item" :key="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-if="['RADIO'].includes(clickRow.columnFormType)">
|
||||
<el-form-item label="选项列表" prop="selectValues">
|
||||
<el-select
|
||||
v-model="clickRow.selectValues"
|
||||
multiple
|
||||
style="width: 100%"
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
placeholder="请选择选项列表(如无数据时,需手动输入选项进行添加)"
|
||||
>
|
||||
<el-option v-for="item in clickRow.columnOptions" :label="item" :value="item" :key="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-if="['FILE'].includes(clickRow.columnFormType)">
|
||||
<el-form-item label="文件类型" prop="fileType">
|
||||
<el-select v-model="clickRow.fileType" multiple style="width: 100%" filterable placeholder="请选择文件类型">
|
||||
<el-option label="jpg" value="jpg"></el-option>
|
||||
<el-option label="png" value="png"></el-option>
|
||||
<el-option label="jpeg" value="jpeg"></el-option>
|
||||
<el-option label="doc" value="doc"></el-option>
|
||||
<el-option label="docx" value="docx"></el-option>
|
||||
<el-option label="xlsx" value="xlsx"></el-option>
|
||||
<el-option label="pdf" value="pdf"></el-option>
|
||||
<el-option label="mp3" value="mp3"></el-option>
|
||||
<el-option label="mp4" value="mp4"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件个数" prop="fileNumber">
|
||||
<el-input-number v-model="clickRow.fileNumber" :min="1" :max="10" placeholder="请输入文件个数" style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
|
||||
<div style="float: right; margin: 20px 0">
|
||||
<el-button @click="detailedParamsVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doDetailParams">确 定</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
mobileSignColumnList: [{ isRequired: false }],
|
||||
isBringFamily: false,
|
||||
isAddFamily: false,
|
||||
selfAddFamily: true,
|
||||
},
|
||||
rules: {
|
||||
typeName: [{ required: true, message: "请输入类型名称", trigger: ["change", "blur"] }],
|
||||
code: [{ required: true, message: "请输入类型编码", trigger: ["change", "blur"] }],
|
||||
isBringFamily: [{ required: true, message: "请选择是否携带家属", trigger: ["blur", "change"] }],
|
||||
isAddFamily: [{ required: true, message: "请选择家属是否纳入总人数", trigger: ["blur", "change"] }]
|
||||
},
|
||||
columnTypeOptions: [],
|
||||
columnFormTypeList: [],
|
||||
clickRow: {},
|
||||
paramFormRules: {
|
||||
selectValues: [{ required: true, message: "请选择选项列表", trigger: ["blur"] }],
|
||||
fileType: [{ required: true, message: "请选择文件类型", trigger: ["blur"] }],
|
||||
fileNumber: [{ required: true, message: "请输入文件个数", trigger: ["blur", "change"] }]
|
||||
},
|
||||
detailedParamsVisible: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isBringFamilyInput(o) {
|
||||
this.$set(this.formData, "isAddFamily", o === true ? false : null)
|
||||
if (o === true) {
|
||||
this.formData.mobileSignColumnList.unshift({
|
||||
columnName: "携带亲属人数",
|
||||
columnCode: "xdqsrs",
|
||||
columnFormType: "INPUT",
|
||||
columnType: "INT",
|
||||
isRequired: true
|
||||
})
|
||||
} else {
|
||||
this.formData.mobileSignColumnList.forEach((item, index) => {
|
||||
if (item.columnCode === "xdqsrs" && this.formData.isBringFamily === false) {
|
||||
this.formData.mobileSignColumnList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
columnFormTypeChange(val, index) {
|
||||
if (val === "FILE") {
|
||||
this.formData.mobileSignColumnList[index].columnType = "JSON"
|
||||
this.formData.mobileSignColumnList[index].isDisabled = true
|
||||
} else {
|
||||
// this.formData.mobileSignColumnList[index].columnType = ""
|
||||
this.formData.mobileSignColumnList[index].isDisabled = false
|
||||
}
|
||||
},
|
||||
doHandle() {
|
||||
if (this.formData.id) {
|
||||
this.doEdit()
|
||||
} else {
|
||||
this.doAdd()
|
||||
}
|
||||
},
|
||||
async doDetailParams() {
|
||||
const isValid = await this.$refs["paramForm"].validate()
|
||||
if (isValid) {
|
||||
this.detailedParamsVisible = false
|
||||
}
|
||||
},
|
||||
openDetailedParams(row, index) {
|
||||
this.clickRow = row
|
||||
this.detailedParamsVisible = true
|
||||
if (this.$refs["paramForm"]) this.$refs["paramForm"].clearValidate()
|
||||
},
|
||||
doAdd() {
|
||||
this.$refs["addForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
const newListLength = new Set(this.formData.mobileSignColumnList.map((item) => item.columnCode)).size
|
||||
const listLength = this.formData.mobileSignColumnList.length
|
||||
if (listLength > newListLength) {
|
||||
this.$message.warning('字段编码不能重复')
|
||||
return
|
||||
}
|
||||
const cloneData = clone(this.formData)
|
||||
this.$axios.post(loc() + "/doAdd", { data: JSON.stringify(cloneData) }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.$emit('refresh')
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
this.$refs["addForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
const newListLength = new Set(this.formData.mobileSignColumnList.map((item) => item.columnCode)).size
|
||||
const listLength = this.formData.mobileSignColumnList.length
|
||||
if (listLength > newListLength) {
|
||||
this.$message.warning('字段编码不能重复')
|
||||
return
|
||||
}
|
||||
const cloneData = clone(this.formData)
|
||||
cloneData.mobileSignColumnList = JSON.stringify(cloneData.mobileSignColumnList)
|
||||
this.$axios.post(loc() + "/doEdit", cloneData).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.$emit('refresh')
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
async getColTypeOptions() {
|
||||
const resp = await this.$axios.get(loc() + "/getColumnType")
|
||||
this.columnTypeOptions = resp.data
|
||||
},
|
||||
async getEnumOptions() {
|
||||
const resp = await this.$axios.post("/open/common/dictEnumOptions", { name: "ColumnFormTypeEnum" })
|
||||
return resp.data
|
||||
},
|
||||
initData(row) {
|
||||
if(row && row.id) {
|
||||
this.formData = JSON.parse(JSON.stringify(row))
|
||||
if (!this.formData.mobileSignColumnList || !Array.isArray(this.formData.mobileSignColumnList)) {
|
||||
this.formData.mobileSignColumnList = [{ isRequired: false }]
|
||||
} else {
|
||||
this.formData.mobileSignColumnList.forEach((item) => {
|
||||
item.isDisabled = item.columnFormType === "FILE"
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.formData = {
|
||||
mobileSignColumnList: [{ isRequired: false }],
|
||||
isBringFamily: false,
|
||||
isAddFamily: false,
|
||||
selfAddFamily: true,
|
||||
}
|
||||
if (this.$refs["addForm"]) this.$refs["addForm"].resetFields()
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.getColTypeOptions()
|
||||
this.columnFormTypeList = await this.getEnumOptions()
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-row--flex.is-justify-space-between {
|
||||
justify-content: left;
|
||||
}
|
||||
.el-drawer__body {
|
||||
padding: 0 30px 0 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="类型名称">
|
||||
<el-input clearable placeholder="请输入类型名称" v-model="pageForm.typeName"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<table-tool label="申请列表">
|
||||
<el-button type="primary" size="small" @click="openAdd">
|
||||
<i class="ti-plus"></i>
|
||||
新增类型
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" :size="tableSize">
|
||||
<el-table-column label="序号" width="70" type="index">
|
||||
<template v-slot="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型编码" prop="code" sortable></el-table-column>
|
||||
<el-table-column label="类型名称" prop="typeName"></el-table-column>
|
||||
<el-table-column label="操作" width="300px">
|
||||
<template v-slot="{ row }">
|
||||
<el-button v-if="row.xh!==1" size="mini" type="primary" @click="rowChange(row, false)">上移</el-button>
|
||||
<el-button v-if="row.xh!==pageForm.totalCount" size="mini" type="primary" @click="rowChange(row, true)">下移</el-button>
|
||||
<el-button type="primary" size="mini" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button type="danger" size="mini" @click="doDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<basic-form ref="basicFormRef" @refresh="doSearch();$refs.guava.index()"></basic-form>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
<!--#include('basicForm.js'){}#-->
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"basic-form": basicForm,
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
async rowChange(row, toDown) {
|
||||
await this.$axios.post(loc() + "/xhChange", { id: row.id, xh: row.xh, toDown }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
},
|
||||
openAdd() {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.basicFormRef.initData()
|
||||
})
|
||||
},
|
||||
pageData() {
|
||||
this.$axios.post(loc() + "/pageData", this.pageForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
openEdit(obj) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.basicFormRef.initData(obj)
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm("您确定要删除吗, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post(loc() + "/doDelete", { id: id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,138 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
placeholder="请选择年度"
|
||||
type="year"
|
||||
style="width: 100%"
|
||||
@change="yearChange"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="活动名称">
|
||||
<el-select @change="activityChange" style="width: 100%" v-model="pageForm.activityId">
|
||||
<el-option :label="item.activityName" :value="item.id" v-for="item in activityList" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="人员调整"></table-tool>
|
||||
<el-table :data="tableData" :size="tableSize">
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column label="活动名称" prop="courseName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="类型" prop="courseType" sortable show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="活动地点" prop="courseLocation" sortable show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="最多报名人数" prop="coursePeopleNumber" sortable show-overflow-tooltip>
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.reserveMode === 1">
|
||||
{{row.coursePeopleNumber}}
|
||||
</span>
|
||||
<span v-if="row.reserveMode === 2">
|
||||
{{(row.coursePeopleNumber + row.waitingNum) + '(候补占' + row.waitingNum + ')'}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预留人数" prop="courseReservedNumber" sortable show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="已报名人数" prop="registerNum" sortable show-overflow-tooltip>
|
||||
<template v-slot="{row}">
|
||||
<el-link @click="openView(row)" type="primary">
|
||||
{{row.registerNum}}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template v-slot="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">调整</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<user-info ref="userInfoRef" @refresh="doSearch"></user-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('userInfo.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"user-info": userInfo,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainType: "培训班",
|
||||
activityList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear().toString(),
|
||||
activityId: null
|
||||
},
|
||||
tableColumns: [
|
||||
{ label: "培训班", prop: "courseName" },
|
||||
{ label: "类型", prop: "courseType", sortable: true },
|
||||
{ label: "地点", prop: "courseLocation" },
|
||||
{ label: "教师", prop: "courseInstructor", sortable: true },
|
||||
{ label: "最多报名人数", prop: "coursePeopleNumber", sortable: true },
|
||||
{ label: "已报名人数", prop: "registerNum", sortable: true }
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
activityChange(val) {
|
||||
const activity = this.activityList.find((o) => o.id === val)
|
||||
const type = this.dict.type.FELLOWSHIP_TYPE.find(o => o.code === activity.trainType)
|
||||
this.trainType = type?.name || "培训班"
|
||||
},
|
||||
async yearChange() {
|
||||
this.pageForm.activityId = null
|
||||
await this.getActivityList()
|
||||
await this.doSearch()
|
||||
},
|
||||
async getActivityList() {
|
||||
const resp = await this.$axios.post(loc() + "/activityList", { year: this.pageForm.year })
|
||||
this.activityList = resp.data
|
||||
if (this.activityList && this.activityList.length > 0) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
this.activityChange(this.activityList[0].id)
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
await this.getActivityList()
|
||||
},
|
||||
async openView(o) {
|
||||
this.$refs.guava.view(() => {
|
||||
const activity = this.activityList.find((o) => o.id === this.pageForm.activityId)
|
||||
this.$refs.userInfoRef.onOpen(o, activity)
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.initData()
|
||||
await this.pageData()
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,226 @@
|
||||
const userInfo = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<div class="left-span-label">{{ registerCourse.courseName + '报名人员' }}</div>
|
||||
<div>
|
||||
<search @search="registerSearch">
|
||||
<search-item label="姓名/工号">
|
||||
<el-input v-model="registerForm.searchKeyword" placeholder="请输入姓名或工号"></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select v-model="registerForm.unionId" clearable filterable placeholder="请选择院级工会" @change="getUnitList()">
|
||||
<el-option v-for="item in unionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select v-model="registerForm.unitId" clearable filterable placeholder="请选择单位">
|
||||
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</div>
|
||||
<el-table :data="registerUserTableData" class="mt15">
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="(column, index) in registerUserTableColumns"
|
||||
:key="index"
|
||||
>
|
||||
<template v-slot="{row}" v-if="column.prop === 'state'">
|
||||
<span class="text-success" v-if="row.state === 1">正常报名</span>
|
||||
<span class="text-warning" v-else-if="row.state === 2">候补报名</span>
|
||||
<span class="text-success" v-else-if="row.state === 3">正常报名(候补)</span>
|
||||
<span class="text-info" v-else-if="row.state === 4">无效报名(缺席)</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template v-slot="{row}">
|
||||
<el-button v-if="row.state === 1 || row.state === 3" @click="adjust(row)" size="mini" type="primary">修改</el-button>
|
||||
<el-button @click="deleteSignUser(row)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-dialog title="人员调整" append-to-body class="adjustDialog" :close-on-click-modal="false" :visible.sync="adjustDialogVisible" width="50%">
|
||||
<span style="color: #c33714">注:如单选为灰色选择不了,则表示对应的{{ trainType }}人数已满!候补报名不做调整。</span>
|
||||
<el-table :data="courseList" class="mt20">
|
||||
<el-table-column label="单选" width="160">
|
||||
<template v-slot="{row}">
|
||||
<el-radio
|
||||
@change.native="getCurrentRow(row)"
|
||||
:disabled="(row.courseReservedNumber + row.registerNum) >= row.coursePeopleNumber"
|
||||
v-model="afterAdjustCourse"
|
||||
></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="trainType + '列表'"
|
||||
prop="courseName"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
></el-table-column>
|
||||
<el-table-column label="最多报名人数" prop="coursePeopleNumber" align="center" header-align="center">
|
||||
</el-table-column>
|
||||
<el-table-column label="预留名额" prop="courseReservedNumber" align="center" header-align="center"></el-table-column>
|
||||
<el-table-column label="已报名人数" prop="registerNum" align="center" header-align="center"></el-table-column>
|
||||
<el-table-column label="候补人数" prop="hasWaitingNum" align="center" header-align="center"></el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="adjustDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAdjust">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
afterAdjustCourse: "",
|
||||
adjustDialogVisible: false,
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
registerForm: {
|
||||
unionId: "",
|
||||
unitId: ""
|
||||
},
|
||||
registerCourse: {},
|
||||
courseList: [],
|
||||
userInfo: {},
|
||||
chooseRow: {},
|
||||
registerUserTableData: [],
|
||||
registerUserTableColumns: [
|
||||
{ label: "姓名", prop: "username" },
|
||||
{ label: "工号", prop: "loginname" },
|
||||
{ label: "单位", prop: "unitName" },
|
||||
{ label: "分工会", prop: "unionName" },
|
||||
{ label: "联系方式", prop: "mobile" },
|
||||
{ label: "报名时间", prop: "signUpTime" },
|
||||
{ label: "报名状态", prop: "state" }
|
||||
],
|
||||
trainType: '',
|
||||
activity: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onOpen(row, activity) {
|
||||
this.registerCourse = row
|
||||
this.registerForm.courseId = row.id
|
||||
this.activity = activity
|
||||
const resp_register = await this.$axios.post(loc() + "/registerUserList", this.registerForm)
|
||||
this.registerUserTableData = resp_register.data
|
||||
|
||||
const type = this.dict.type.FELLOWSHIP_TYPE.find(o => o.code === activity.trainType)
|
||||
this.trainType = type?.name || "培训班"
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.chooseRow = row
|
||||
},
|
||||
async doAdjust() {
|
||||
if (!this.afterAdjustCourse) {
|
||||
this.$message.warning("请选择要调整的" + this.trainType + "!")
|
||||
return
|
||||
}
|
||||
this.$confirm(
|
||||
"您确定要将" +
|
||||
"<span style='color: red'>" +
|
||||
this.userInfo.username +
|
||||
"</span>" +
|
||||
"的报名信息调整到" +
|
||||
"<span style='color: red'>" +
|
||||
this.chooseRow.courseName +
|
||||
"</span>" +
|
||||
"中吗?",
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
dangerouslyUseHTMLString: true
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: "努力调整中,感谢您的耐心等待。。。",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)"
|
||||
})
|
||||
const resp = await this.$axios.post(loc() + "/adjust", {
|
||||
activityId: this.activity.id,
|
||||
oldCourseId: this.registerCourse.id,
|
||||
newCourseId: this.afterAdjustCourse,
|
||||
userId: this.userInfo.userId
|
||||
})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.adjustDialogVisible = false
|
||||
await this.registerSearch()
|
||||
this.$emit("refresh", null)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
async adjust(o) {
|
||||
this.userInfo = o
|
||||
this.afterAdjustCourse = ""
|
||||
await this.getCourse(this.activity.id)
|
||||
this.adjustDialogVisible = true
|
||||
},
|
||||
deleteSignUser(o) {
|
||||
this.$confirm("您确定要删除" + "<span style='color: red'>" + o.username + "</span>" + "的报名信息吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
dangerouslyUseHTMLString: true
|
||||
})
|
||||
.then(async () => {
|
||||
const resp = await this.$axios.post(loc() + "/deleteSignUser", {
|
||||
activityId: this.activity.id,
|
||||
courseId: this.registerCourse.id,
|
||||
userId: o.userId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
await this.registerSearch()
|
||||
this.$emit("refresh", null)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
async registerSearch() {
|
||||
this.registerForm.courseId = this.registerCourse.id
|
||||
const resp_register = await $.get(loc() + "/registerUserList", this.registerForm)
|
||||
this.registerUserTableData = resp_register.data
|
||||
},
|
||||
async getCourse(val) {
|
||||
const {data} = await this.$axios.post(loc() + "/getCourse", {activityId: val})
|
||||
this.courseList = data
|
||||
},
|
||||
async getUnitList() {
|
||||
this.unitList = await this.$businessTool.listUnit(this.registerForm.unionId)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
this.unitList = await this.$businessTool.listUnit(this.registerForm.unionId)
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
/deep/ .adjustDialog .el-radio__label {
|
||||
display: none;
|
||||
}
|
||||
/deep/ .adjustDialog .el-dialog__body {
|
||||
max-height: 600px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
placeholder="请选择年度"
|
||||
type="year"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="活动名称">
|
||||
<el-select @change="activityChange" style="width: 100%" v-model="pageForm.activityId">
|
||||
<el-option :label="item.activityName" :value="item.id" v-for="item in activityList" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item :label="trainType">
|
||||
<el-select @change="courseChange" :placeholder="'请选择' + trainType" style="width: 100%" v-model="pageForm.courseId">
|
||||
<el-option :label="item.courseName" :value="item.id" v-for="item in courseList" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input clearable placeholder="输入姓名或工号" v-model="pageForm.userKeyWord"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool ref="tool" :label="trainType + '(温馨提示:如需补充人员,请在上面选择具体的' + trainType + ')'">
|
||||
<el-button @click="openReserve" type="primary" v-if="reserveMode === 2" size="small">补充人员</el-button>
|
||||
<el-button @click="exportSignPerson" type="primary" size="small">导出签到名单</el-button>
|
||||
<el-button @click="exportGiftPerson" type="primary" size="small">导出领取名单</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize">
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.prop === 'courseNames' ? trainType : column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-if="(column.prop !== 'state' && column.prop !== 'absentCount') || (reserveMode === 2 && column.prop === 'state' && column.prop !== 'absentCount')
|
||||
|| (column.prop === 'absentCount' && course.isMobileSign === true)"
|
||||
v-for="(column,index) in tableColumns"
|
||||
:key="index"
|
||||
>
|
||||
<template v-slot="{row}" v-if="column.prop==='isDisabled'">
|
||||
<span class="text-danger" v-if="row.isDisabled">是</span>
|
||||
<span class="text-success" v-else>否</span>
|
||||
</template>
|
||||
<template v-slot="{row}" v-else-if="column.prop==='state'">
|
||||
<span class="text-success" v-if="row.state === 1">正常报名</span>
|
||||
<span class="text-warning" v-else-if="row.state === 2">候补报名</span>
|
||||
<span class="text-success" v-else-if="row.state === 3">正常报名(候补)</span>
|
||||
<span class="text-info" v-else-if="row.state === 4">无效报名(缺席)</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template v-slot="{row}">
|
||||
<el-button @click="handleUser(row.userId)" size="mini" type="danger" v-if="!row.isDisabled">拉黑</el-button>
|
||||
<el-button @click="handleUser(row.userId)" size="mini" type="success" v-if="row.isDisabled">解封</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="补充人员" :visible.sync="reserveDialogVisible" width="55%" top="3%">
|
||||
<vi-title title="以下为候补人员,已为您按照报名时间降序排列"></vi-title>
|
||||
<el-table :data="reserveTableData" ref="multipleTable" @selection-change="handleSelectionChange">
|
||||
<el-table-column :selectable="(row, index) => {return row.state === 2}" type="selection" width="55"></el-table-column>
|
||||
<el-table-column prop="username" label="姓名"></el-table-column>
|
||||
<el-table-column prop="loginname" label="工号"></el-table-column>
|
||||
<el-table-column prop="mobile" label="联系方式"></el-table-column>
|
||||
<el-table-column prop="unitName" label="单位"></el-table-column>
|
||||
<el-table-column prop="unionName" label="工会"></el-table-column>
|
||||
<el-table-column prop="signUpTime" label="报名时间"></el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="reserveDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="reserveDo">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
dicts: ["FELLOWSHIP_TYPE"],
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
reserveDialogVisible: false,
|
||||
reserveTableData: [],
|
||||
activityList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear().toString(),
|
||||
activityId: null
|
||||
},
|
||||
tableColumns: [
|
||||
{ label: "姓名", prop: "username" },
|
||||
{ label: "工号", prop: "loginname" },
|
||||
{ label: "联系方式", prop: "mobile" },
|
||||
{ label: "单位", prop: "unitname", sortable: true },
|
||||
{ label: "分工会", prop: "unionname", sortable: true },
|
||||
{ label: "活动名称", prop: "courseNames", sortable: true },
|
||||
{ label: "缺席次数", prop: "absentCount" },
|
||||
{ label: "是否黑名单", prop: "isDisabled", sortable: true }
|
||||
],
|
||||
trainType: "",
|
||||
courseList: [],
|
||||
course: {},
|
||||
reserveMode: 1,
|
||||
multipleSelection: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
async openReserve() {
|
||||
const activity = this.activityList.find((o) => o.id === this.pageForm.activityId)
|
||||
if (this.$moment().unix() < this.$moment(activity.activityEndTime).unix()) {
|
||||
this.$alert("此活动还未结束,无法补充", "提示", {
|
||||
confirmButtonText: "确定"
|
||||
})
|
||||
return
|
||||
}
|
||||
const resp = await this.$axios.post("/platform/fellowship/userManage/getReserveUser", { courseId: this.course.id })
|
||||
this.reserveTableData = resp.data
|
||||
this.reserveDialogVisible = true
|
||||
},
|
||||
reserveDo() {
|
||||
if (this.multipleSelection.length === 0) {
|
||||
this.$message.warning("请先在左侧多选框中选择要补充的人员")
|
||||
return
|
||||
}
|
||||
this.$confirm("您选择了" + this.multipleSelection.length + "位教职工,确定要进行补充操作吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(async () => {
|
||||
const ids = this.multipleSelection.map((o) => o.userId)
|
||||
const resp = await this.$axios.post("/platform/fellowship/userManage/reserveSingUp", {
|
||||
ids: JSON.stringify(ids),
|
||||
courseId: this.course.id
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
this.multipleSelection = []
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
this.reserveDialogVisible = false
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
courseChange(val) {
|
||||
const course = this.courseList.find((o) => o.id === val)
|
||||
this.course = course
|
||||
this.reserveMode = course.reserveMode
|
||||
if (this.reserveMode === 2) {
|
||||
this.tableColumns.push({ label: "报名状态", prop: "state", sortable: true })
|
||||
} else {
|
||||
const o = this.tableColumns.find((o) => o.label === "报名状态")
|
||||
if (o !== null && o !== undefined) {
|
||||
this.tableColumns.splice(this.tableColumns.length - 1, 1)
|
||||
}
|
||||
}
|
||||
this.$refs.tool.app = this
|
||||
this.doSearch()
|
||||
},
|
||||
exportSignPerson() {
|
||||
this.exportPro(loc() + "/exportSignPerson", { activityId: this.pageForm.activityId })
|
||||
},
|
||||
exportGiftPerson() {
|
||||
this.exportPro(loc() + "/exportGiftPerson", { activityId: this.pageForm.activityId })
|
||||
},
|
||||
exportPro(url, param) {
|
||||
if (param.activityId === null) {
|
||||
this.$message.warning("请选择活动")
|
||||
return
|
||||
}
|
||||
this.$downLoad(url, param)
|
||||
},
|
||||
async activityChange(val) {
|
||||
const activity = this.activityList.find((o) => o.id === val)
|
||||
const type = this.dict.type.FELLOWSHIP_TYPE.find(o => o.code === activity.trainType)
|
||||
this.trainType = type?.name || "活动名称"
|
||||
const resp = await this.$axios.post(loc() + "/getCourseByActivityId", { activityId: val })
|
||||
this.courseList = resp.data
|
||||
this.pageForm.courseId = ""
|
||||
},
|
||||
async handleUser(userId) {
|
||||
const resp = await $.post(loc() + "/doHandleUser", { userId })
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
async yearChange() {
|
||||
this.pageForm.activityId = null
|
||||
await this.getActivityList()
|
||||
await this.doSearch()
|
||||
},
|
||||
async getActivityList() {
|
||||
const resp = await this.$axios.post("/platform/fellowship/statistics/activityList", { year: this.pageForm.year })
|
||||
this.activityList = resp.data
|
||||
if (this.activityList && this.activityList.length > 0) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
await this.activityChange(this.activityList[0].id)
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
await this.getActivityList()
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.initData()
|
||||
await this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -2,15 +2,14 @@ const BUY_INFO = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<el-dialog
|
||||
:append-to-body="true"
|
||||
:modal-append-to-body="false"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
title="收货地址"
|
||||
@closed="onClose"
|
||||
width="70%">
|
||||
<span >
|
||||
<el-steps simple :space="200" :align-center="true" :active="active" finish-status="success">
|
||||
:append-to-body="true"
|
||||
:modal-append-to-body="false"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
title="收货地址"
|
||||
width="70%">
|
||||
<span>
|
||||
<el-steps simple :space="200" :align-center="true" :active="active" finish-status="success">
|
||||
<el-step title="1.我的购物车"></el-step>
|
||||
<el-step title="2.填写核对订单信息"></el-step>
|
||||
<el-step title="3.成功提交订单"></el-step>
|
||||
@@ -18,8 +17,10 @@ const BUY_INFO = {
|
||||
</span>
|
||||
<template v-if="active==1">
|
||||
<div class="content shopCart">
|
||||
<el-empty v-if="cartList.length==0" image="https://image30.xedaojia.net/upload/wechat/images/flash/flashcart-empty.png">
|
||||
<el-button type="text" @click="dialogVisible = false">购物车空空的哦~,去看看心仪的商品吧~</el-button>
|
||||
<el-empty v-if="cartList.length==0"
|
||||
image="https://image30.xedaojia.net/upload/wechat/images/flash/flashcart-empty.png">
|
||||
<el-button type="text" @click="dialogVisible = false">购物车空空的哦~,去看看心仪的商品吧~
|
||||
</el-button>
|
||||
</el-empty>
|
||||
<!-- table -->
|
||||
<div class="table" v-else>
|
||||
@@ -33,13 +34,17 @@ const BUY_INFO = {
|
||||
@selection-change="handleSelectionChange" :close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:header-cell-style="{background:'#f3f3f3',color:'#999'}">
|
||||
<el-table-column prop="isChecked" type="selection" width="75" align="center" />
|
||||
<el-table-column align="center" width="200" label="商品">
|
||||
<el-table-column prop="isChecked" type="selection" width="75" align="center"/>
|
||||
<el-table-column align="center" width="200" label="商品">
|
||||
<template slot-scope="scope">
|
||||
<img :src="scope.row.benefitGoodsSpecifications.imgUrl[0].url" class="shopImg" alt="">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.benefitGoodsSpecifications.imgUrl[0].url"
|
||||
fit="fit"
|
||||
:preview-src-list="[scope.row.benefitGoodsSpecifications.imgUrl[0].url]"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="shop" align="left">
|
||||
<el-table-column prop="shop" align="left">
|
||||
<template slot-scope="scope">
|
||||
<span class="shop">{{scope.row.benefitGoods.name}}</span>
|
||||
<span class="shop">{{scope.row.benefitGoodsSpecifications.name}}</span>
|
||||
@@ -56,7 +61,7 @@ const BUY_INFO = {
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<span v-if="cartList.length!=0" class="dialog-footer" slot="footer">
|
||||
@@ -80,20 +85,26 @@ const BUY_INFO = {
|
||||
<div class="text item">
|
||||
<el-descriptions v-for="(item,index) in count" :column="6" :colon="false">
|
||||
<el-descriptions-item>
|
||||
<el-button type="text" @click="openAddress" v-if="tableData[index].isDefault" :icon="icon"></el-button>
|
||||
<el-button type="text" @click="openAddress" v-if="tableData[index].isDefault"
|
||||
:icon="icon"></el-button>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
{{tableData[index].userName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>{{tableData[index].province}}{{tableData[index].city}}{{tableData[index].county}}</el-descriptions-item>
|
||||
<el-descriptions-item style="width: 100px">
|
||||
<el-tooltip class="item" effect="dark" :content="tableData[index].addressDetail" placement="top">
|
||||
<div class="ellipsis" >{{tableData[index].addressDetail}}</div>
|
||||
<el-descriptions-item>
|
||||
{{tableData[index].province}}{{tableData[index].city}}{{tableData[index].county}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item style="width: 100px">
|
||||
<el-tooltip class="item" effect="dark" :content="tableData[index].addressDetail"
|
||||
placement="top">
|
||||
<div class="ellipsis">{{tableData[index].addressDetail}}</div>
|
||||
</el-tooltip>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>{{tableData[index].tel}}</el-descriptions-item>
|
||||
<el-descriptions-item >
|
||||
<el-button @click="doDefault(tableData[index])" v-if="!tableData[index].isDefault" type="text" style="padding-top: 0px;">设为默认地址</el-button>
|
||||
<el-descriptions-item>
|
||||
<el-button @click="doDefault(tableData[index])" v-if="!tableData[index].isDefault"
|
||||
type="text" style="padding-top: 0px;">设为默认地址
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
@@ -106,12 +117,13 @@ const BUY_INFO = {
|
||||
<el-descriptions v-for="data in formData" :column="4" :colon="false">
|
||||
<el-descriptions-item>
|
||||
<el-image
|
||||
style="width: 80px;height: 80px;line-height: 80px"
|
||||
:src="data.imgUrl[0].url"
|
||||
fit="cover"></el-image>
|
||||
style="width: 80px;height: 80px;line-height: 80px"
|
||||
:src="data.imgUrl[0].url"
|
||||
fit="cover"></el-image>
|
||||
<span>{{data.goodsName}}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item><span style="height: 80px;line-height: 80px">{{data.name}}</span></el-descriptions-item>
|
||||
<el-descriptions-item><span style="height: 80px;line-height: 80px">{{data.name}}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<el-tooltip class="item" effect="dark" :content="data.simpleDesc" placement="top">
|
||||
<span class="ellipsis" style="width:300px;height: 80px;line-height: 80px">
|
||||
@@ -121,7 +133,8 @@ const BUY_INFO = {
|
||||
</el-descriptions-item>
|
||||
</el-tooltip>
|
||||
|
||||
<el-descriptions-item><span class="price-show" style="height: 80px;line-height: 80px">{{data.points}}</span></el-descriptions-item>
|
||||
<el-descriptions-item><span class="price-show" style="height: 80px;line-height: 80px">{{data.points}}</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -141,7 +154,8 @@ const BUY_INFO = {
|
||||
</span>
|
||||
</template>
|
||||
<template v-if="active==3">
|
||||
<el-empty style="height: 500px" image="https://pc-b2b2c.pickmall.cn/static/img/pay-success.f880966f.png">
|
||||
<el-empty style="height: 500px"
|
||||
image="https://pc-b2b2c.pickmall.cn/static/img/pay-success.f880966f.png">
|
||||
<el-button type="primary" @click="dialogVisible = false">继续逛逛</el-button>
|
||||
</el-empty>
|
||||
</template>
|
||||
@@ -173,6 +187,7 @@ const BUY_INFO = {
|
||||
},
|
||||
onClose() {
|
||||
this.$emit("close_cart")
|
||||
this.dialogVisible = false
|
||||
},
|
||||
openAddress() {
|
||||
if (this.icon == "el-icon-arrow-right el-icon--right") {
|
||||
@@ -219,7 +234,7 @@ const BUY_INFO = {
|
||||
})
|
||||
},
|
||||
async doDefault(row) {
|
||||
const resp = await this.$axios.post("/platform/benefit/address/doDefault", { id: row.id })
|
||||
const resp = await this.$axios.post("/platform/benefit/address/doDefault", {id: row.id})
|
||||
if (resp.code === 0) {
|
||||
this.getAddress()
|
||||
this.$message({
|
||||
@@ -279,7 +294,7 @@ const BUY_INFO = {
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/benefit/shop/deleteCart", { id: id })
|
||||
const resp = await this.$axios.post("/platform/benefit/shop/deleteCart", {id: id})
|
||||
if (resp.code === 0) {
|
||||
this.getCart()
|
||||
this.$message({
|
||||
@@ -313,18 +328,21 @@ const BUY_INFO = {
|
||||
text-overflow: ellipsis; /* 用省略号表示被隐藏的部分 */
|
||||
max-width: 200px; /* 设置最大宽度以限制文本的显示长度 */
|
||||
}
|
||||
|
||||
.price-show {
|
||||
font-weight: bold;
|
||||
font-size: 27px;
|
||||
color: #E1140A;
|
||||
}
|
||||
.cart-price{
|
||||
|
||||
.cart-price {
|
||||
font-size: 16px;
|
||||
color: #e2231a;
|
||||
font-family: verdana;
|
||||
font-weight: 700;
|
||||
}
|
||||
.desc{
|
||||
|
||||
.desc {
|
||||
color: #A2A2A2;
|
||||
font-size: 14px;
|
||||
margin-top: 8px;
|
||||
@@ -336,42 +354,50 @@ const BUY_INFO = {
|
||||
.shopCart {
|
||||
.table {
|
||||
position: relative;
|
||||
.el-input__inner {
|
||||
|
||||
.el-input__inner {
|
||||
text-align: center;
|
||||
}
|
||||
.el-input-group__append {
|
||||
|
||||
.el-input-group__append {
|
||||
padding: 0 15px;
|
||||
}
|
||||
.el-input-group__prepend {
|
||||
|
||||
.el-input-group__prepend {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.shopImg {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.price,
|
||||
.shop {
|
||||
color: #000733;
|
||||
}
|
||||
|
||||
.count {
|
||||
color: #bfa548;
|
||||
}
|
||||
.el-checkbox__inner {
|
||||
|
||||
.el-checkbox__inner {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.el-checkbox__inner::after {
|
||||
.el-checkbox__inner::after {
|
||||
left: 7px;
|
||||
top: 3px;
|
||||
}
|
||||
.el-checkbox__input.is-indeterminate .el-checkbox__inner::before {
|
||||
|
||||
.el-checkbox__input.is-indeterminate .el-checkbox__inner::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.shopCart .table {
|
||||
margin-top: 50px;
|
||||
@@ -410,8 +436,7 @@ const BUY_INFO = {
|
||||
}
|
||||
|
||||
|
||||
|
||||
.shopCart .tab le .el-checkbox__inner::after {
|
||||
.shopCart .tab le .el-checkbox__inner::after {
|
||||
left: 7px;
|
||||
top: 3px;
|
||||
}
|
||||
@@ -421,7 +446,7 @@ const BUY_INFO = {
|
||||
}
|
||||
|
||||
.el-empty__image {
|
||||
width: 500px;
|
||||
width: 500px;
|
||||
}
|
||||
`
|
||||
}
|
||||
};
|
||||
|
||||
@@ -13,10 +13,10 @@ layout("/layouts/platform.html"){
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
a:link,
|
||||
/* a:link,
|
||||
a:visited {
|
||||
color: #5e5e5e;
|
||||
}
|
||||
}*/
|
||||
/* END */
|
||||
|
||||
/* 左侧分类菜单 */
|
||||
@@ -265,15 +265,19 @@ layout("/layouts/platform.html"){
|
||||
<template #view>
|
||||
<shop-dialog ref="info" @close_car="closeCar"></shop-dialog>
|
||||
</template>
|
||||
|
||||
<buy-info ref="buyInfo" ></buy-info>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
<!--#include("buyInfo.js"){}#-->
|
||||
<!--#include("shopDialog.js"){}#-->
|
||||
<!--#include("elevator.js"){}#-->
|
||||
new Vue({
|
||||
new Vue({
|
||||
el: "#app",
|
||||
components: {
|
||||
"shop-dialog": SHOP_DIALOG,
|
||||
"buy-info": BUY_INFO,
|
||||
elevator
|
||||
},
|
||||
mixins: [initTableMixins],
|
||||
@@ -339,9 +343,11 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
shopCar() {
|
||||
this.$refs.guava.view(() => {
|
||||
console.log(this.$refs.buyInfo)
|
||||
this.$refs.buyInfo.onOpen(null,1)
|
||||
/* this.$refs.guava.view(() => {
|
||||
this.$refs.info.openCart()
|
||||
})
|
||||
})*/
|
||||
},
|
||||
closeCar() {
|
||||
this.$refs.guava.index(() => {})
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<!--#include("buyInfo.js"){}#-->
|
||||
const SHOP_DIALOG = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
@@ -47,7 +46,7 @@ const SHOP_DIALOG = {
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="danger" @click="addCart">加入购物车</el-button>
|
||||
<el-button type="warning" @click="buy">立即购买</el-button>
|
||||
<!-- <el-button type="warning" @click="buy">立即购买</el-button>-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-main>
|
||||
@@ -66,7 +65,7 @@ const SHOP_DIALOG = {
|
||||
</el-main>
|
||||
</el-container>
|
||||
</div>
|
||||
<buy-info ref="buyInfo" @close_cart="closeCart"></buy-info>
|
||||
<!-- <buy-info ref="buyInfo" @close_cart="closeCart"></buy-info>-->
|
||||
|
||||
</guava>
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="使用状况">
|
||||
<dict-select v-model="pageForm.assetUsageStateName" placeholder="请选择使用状况"
|
||||
@change="doSearch"
|
||||
code="ASSET_USAGE_STATE"></dict-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="类型列表">
|
||||
|
||||
</table-tool>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:summary-method="getSummaries"
|
||||
header-align="center"
|
||||
ref="table"
|
||||
row-key="typeCode"
|
||||
show-summary
|
||||
style="width: 100%">
|
||||
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="分类" prop="type"></el-table-column>
|
||||
<el-table-column label="数量(台件)" prop="sl"></el-table-column>
|
||||
<el-table-column label="金额(元)" prop="je"></el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
async pageData() {
|
||||
const resp = await $.post(loc() + "/pageData", this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data
|
||||
}
|
||||
},
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
if (index === 3) {
|
||||
sums[index] = sums[index].toFixed(2)
|
||||
sums[index] += ' 元';
|
||||
}
|
||||
if (index === 2) {
|
||||
sums[index] += ' 台件';
|
||||
}
|
||||
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -74,7 +74,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="basicTypeDialogVisible" title="基础类型"
|
||||
width="40%">
|
||||
<el-form :model="formData" :rules="rules" label-width="80" ref="basicForm">
|
||||
<el-form :model="formData" :rules="rules" label-width="80" ref="basicForm" style="margin: 20px;">
|
||||
<el-row gutter="30">
|
||||
<el-form-item label="上级名称" prop="parentName" v-if="submitType==='add'">
|
||||
<el-input disabled maxlength="100" type="text"
|
||||
|
||||
@@ -206,8 +206,8 @@ layout("/layouts/platform.html"){
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="user_name" label="附  件">
|
||||
<file-upload v-if="viewData.files&&viewData.files.length" :files="viewData.files"
|
||||
:view="true"></file-upload>
|
||||
<file-preview complete_result :files="viewData.files"
|
||||
v-if="viewData.files&&viewData.files.length"></file-preview>
|
||||
<span v-else>暂无</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -269,8 +269,15 @@ layout("/layouts/platform.html"){
|
||||
</el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="附件" prop="files">
|
||||
<file-upload card :files.sync="formData.files"
|
||||
:max-size="50 * 1024 * 1024"></file-upload>
|
||||
<file-upload
|
||||
:value.sync="formData.files"
|
||||
:upload_number="5"
|
||||
upload_result_category="array"
|
||||
complete_result
|
||||
upload_mode="drag"
|
||||
:max-size="50 * 1024 * 1024"
|
||||
></file-upload>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
@@ -317,7 +324,8 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
doBack() {
|
||||
if (GetQueryString("id")) {
|
||||
this.$store.dispatch("pjaxRoute", "/platform/honor/manage")
|
||||
pjaxReplace("/platform/honor/manage")
|
||||
// this.$store.dispatch("pjaxRoute", "/platform/honor/manage")
|
||||
}
|
||||
},
|
||||
doSubmit() {
|
||||
@@ -405,22 +413,24 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
async findData(id) {
|
||||
const resp = await this.$axios.post(loc() + "/findData", {id: id})
|
||||
const data1 = resp.data
|
||||
this.formData = resp.data
|
||||
const data1 = clone(resp.data)
|
||||
this.formData = clone(resp.data)
|
||||
if (this.formData.userId && this.formData.userId !== "") {
|
||||
await this.userRemoteMethod(this.formData.userName)
|
||||
} else {
|
||||
this.$set(this.formData, "userName", this.formData.userName)
|
||||
}
|
||||
await this.honorTypeChange(data1.honorType)
|
||||
/* this.$set(this.formData, "prize", data1.prize)
|
||||
await this.honorTypeChange(resp.data.honorType)
|
||||
this.$set(this.formData, "prize", data1.prize)
|
||||
/*
|
||||
this.$set(this.formData, "honorLevel", data1.honorLevel)
|
||||
this.$set(this.formData, "political", data1.political)
|
||||
this.$set(this.formData, "post", data1.post)
|
||||
this.$set(this.formData, "title", data1.title)
|
||||
this.$set(this.formData, "unionId", data1.unionId)
|
||||
this.$set(this.formData, "unionLeader", data1.unionLeader)*/
|
||||
console.log(this.formData)
|
||||
console.log(data1)
|
||||
|
||||
},
|
||||
async initData() {
|
||||
await this.getHonorType()
|
||||
|
||||
+9
-2
@@ -40,8 +40,8 @@ layout("/layouts/platform.html"){
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="报销经费来源" span="2">
|
||||
<el-form-item label="报销经费来源" prop="reimburseFundSource">
|
||||
<el-descriptions-item label="报销类型" span="2">
|
||||
<el-form-item label="报销类型" prop="reimburseFundSource">
|
||||
<el-radio-group v-model="formData.reimburseFundSource" size="medium" @change="reimburseFundSourceChange">
|
||||
<el-radio :label="item.code" border v-for="item in budgetTypeOption">
|
||||
{{item.name}}
|
||||
@@ -201,6 +201,7 @@ layout("/layouts/platform.html"){
|
||||
placeholder="请填写发票号码,如有多个请用逗号分隔"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item></el-descriptions-item>-->
|
||||
|
||||
|
||||
<el-descriptions-item label="支付内容" :span="2">
|
||||
@@ -223,6 +224,11 @@ layout("/layouts/platform.html"){
|
||||
></file-upload>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="签字" :span="2">
|
||||
<el-form-item prop="applySign">
|
||||
<pc-signature v-model="formData.applySign"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end" class="mt20">
|
||||
@@ -258,6 +264,7 @@ layout("/layouts/platform.html"){
|
||||
condolenceTime: [{required: true, message: '请选择慰问时间', trigger: ["change", "blur"]}],
|
||||
invoiceNumber: [{required: true, message: '请填写发票张数', trigger: ["change", "blur"]}],
|
||||
invoice: [{required: true, message: '请填写发票号码', trigger: ["change", "blur"]}],
|
||||
applySign: [{required: true, message: '请签字', trigger: ["change", "blur"]}],
|
||||
paymentNotes: [{required: true, message: '请填写支付内容', trigger: ["change", "blur"]}],
|
||||
},
|
||||
chooseType: {},
|
||||
|
||||
+43
-21
@@ -13,25 +13,32 @@ layout("/layouts/platform.html"){
|
||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select v-model="pageForm.unionId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择所属工会" clearable>
|
||||
<el-option v-for="item in unionOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-select v-model="pageForm.unionId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择所属工会" clearable>
|
||||
<el-option v-for="item in unionOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select v-model="pageForm.unitId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择所属单位" clearable>
|
||||
<el-option v-for="item in unitOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<search-item label="所属社团">
|
||||
<el-select v-model="pageForm.clubId" style="width: 100%"
|
||||
placeholder="请选择所属社团" filterable clearable>
|
||||
<el-option v-for="item in clubOptions" :key="item.id" :label="item.clubName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<!-- <search-item label="所属单位">
|
||||
<el-select v-model="pageForm.unitId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择所属单位" clearable>
|
||||
<el-option v-for="item in unitOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>-->
|
||||
<search-item label="报销项目">
|
||||
<el-select v-model="pageForm.reimburseProject" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择报销项目" clearable>
|
||||
@@ -42,6 +49,10 @@ layout("/layouts/platform.html"){
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="报销类型">
|
||||
<dict-select clearable code="UNION_REIMBURSE_FUND_SOURCE" placeholder="请选择报销类型"
|
||||
v-model="pageForm.reimburseFundSource"></dict-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
@@ -68,6 +79,13 @@ layout("/layouts/platform.html"){
|
||||
</dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reimburseFundSource" label="报销类型">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_FUND_SOURCE"
|
||||
:value="row.reimburseFundSource">
|
||||
</dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="money" label="金额"></el-table-column>
|
||||
<el-table-column prop="createTime" label="申请时间"></el-table-column>
|
||||
<el-table-column prop="taskName" label="当前节点"></el-table-column>
|
||||
@@ -80,7 +98,9 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column label="操作" fixed="right" width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="$auth.hasRole('SYSADMIN')" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
<el-button v-if="$auth.hasRole('SYSADMIN')" @click="onDelete(row.id)" size="mini" type="danger">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -95,13 +115,12 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
<!--#include('../info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
dicts: ["UNION_REIMBURSE_TYPE","UNION_REIMBURSE_PROJECT"],
|
||||
dicts: ["UNION_REIMBURSE_TYPE", "UNION_REIMBURSE_PROJECT", "UNION_REIMBURSE_FUND_SOURCE"],
|
||||
//分页数据
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
@@ -112,12 +131,13 @@ layout("/layouts/platform.html"){
|
||||
pageDataUrl: "/platform/unionReimburse/collect/pageData",
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
clubOptions: [],
|
||||
}
|
||||
}
|
||||
,
|
||||
methods: {
|
||||
onView(row) {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.unionReimburseInfoRef.onOpen(row)
|
||||
})
|
||||
@@ -146,6 +166,8 @@ layout("/layouts/platform.html"){
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
//单位查询
|
||||
this.$businessTool.listUnit().then((res) => (this.unitOptions = res))
|
||||
this.$businessTool.listCLubByRole().then((res) => (this.clubOptions = res))
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -25,7 +25,7 @@ const unionReimburseInfo = {
|
||||
:value="viewData.reimburseProject">
|
||||
</dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="报销经费来源">
|
||||
<el-descriptions-item label="报销类型">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_FUND_SOURCE"
|
||||
:value="viewData.reimburseFundSource">
|
||||
</dict-tag>
|
||||
@@ -54,6 +54,10 @@ const unionReimburseInfo = {
|
||||
<file-preview v-if="viewData.files && viewData.files.length > 0" :files="viewData.files" complete_result></file-preview>
|
||||
<span v-else>暂无附件</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="签字" :span="2">
|
||||
<el-image :src="viewData.applySign" fit="cover" style="height: 60px"
|
||||
v-if="viewData.applySign"></el-image>
|
||||
</el-descriptions-item>
|
||||
|
||||
</el-descriptions>
|
||||
|
||||
|
||||
@@ -75,13 +75,15 @@ layout("/layouts/platform.html"){
|
||||
size="small"></enum-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="300px">
|
||||
<el-table-column label="操作" fixed="right" width="400px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
|
||||
</el-button>
|
||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
<el-button size="mini" type="primary" @click="">导出报销单</el-button>
|
||||
<el-button size="mini" type="primary" @click="">导出报销凭证</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
+11
-4
@@ -42,7 +42,6 @@ const auditInfo = {
|
||||
<div class="mt10"
|
||||
v-if="['tcDelegatePushDwSj','tcDelegatePushDwFzr'].includes(task.taskName)">
|
||||
<div class="process-title">{{ task.displayName }}</div>
|
||||
|
||||
<el-descriptions border class="flow-task-form" :column="3" :key="task.id"
|
||||
>
|
||||
<el-descriptions-item label="办理用户">{{ task.taskFormData.userName
|
||||
@@ -50,8 +49,10 @@ const auditInfo = {
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="办理时间">{{ task.finishTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="办理结果">
|
||||
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
|
||||
:value="task.ext.submitType"></dict-tag>
|
||||
{{processSubmitTypeEnums.find(v=>v.name===task.ext.tf_type)?.message}}
|
||||
<!-- {{dict.type.PROCESS_TASK_SUBMIT_TYPE.find(v=>v.code==task.ext.tf_type)}}-->
|
||||
<!-- <dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
|
||||
:value=""></dict-tag>-->
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="办理意见" v-if="!task.ext.isFirstTaskNode">{{
|
||||
task.taskFormData.opinion }}
|
||||
@@ -76,7 +77,8 @@ const auditInfo = {
|
||||
loading: true,
|
||||
search: "",
|
||||
tableKey: "",
|
||||
activeName: "1"
|
||||
activeName: "1",
|
||||
processSubmitTypeEnums:[]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -93,6 +95,7 @@ const auditInfo = {
|
||||
this.visible = true;
|
||||
this.findOne();
|
||||
this.getDoneTasks();
|
||||
this.getEnumOptions()
|
||||
},
|
||||
// 获取已办任务审批记录
|
||||
getDoneTasks() {
|
||||
@@ -102,6 +105,10 @@ const auditInfo = {
|
||||
}
|
||||
})
|
||||
},
|
||||
async getEnumOptions() {
|
||||
const resp = await this.$axios.post("/open/common/dictEnumOptions", { name: "ProcessSubmitTypeEnum" })
|
||||
this.processSubmitTypeEnums=resp.data
|
||||
},
|
||||
// 查看流程图
|
||||
openChart() {
|
||||
this.$refs.snakerChartRef.onOpenFull(this.row.instanceProcessDefineId, this.row.instanceId)
|
||||
|
||||
+5
@@ -200,6 +200,11 @@ layout("/layouts/platform.html"){
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
this.$axios.post("/platform/teacherCongress/delegate/push/dwFzrAudit/sms", {
|
||||
"tf_type": tf_type,
|
||||
"instanceId": this.formData.instanceId
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
-23
@@ -46,8 +46,6 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<template >
|
||||
<el-button icon="el-icon-check" size="small" type="primary" @click="onBatchSubmit">正式代表提交上报
|
||||
</el-button>
|
||||
</template>
|
||||
<el-button icon="el-icon-download" size="small" type="primary" @click="exportExcel">导出</el-button>
|
||||
<el-radio-group v-model="pageForm.isFormalOrAttendance" size="small" class="ml10"
|
||||
@@ -283,27 +281,6 @@ layout("/layouts/platform.html"){
|
||||
exportExcel() {
|
||||
this.$downLoad("/platform/teacherCongress/delegate/push/exportExcel", this.pageForm)
|
||||
},
|
||||
onBatchSubmit() {
|
||||
this.$confirm('您确定要上报吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const loading = createLoading('正在提交中')
|
||||
this.$axios.post('/platform/teacherCongress/delegate/push/batchSubmit', {
|
||||
sessionId: this.pageForm.sessionId
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
this.$refs.tableRef.clearSelection()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
listUnion() {
|
||||
this.$businessTool.listUnion().then((res) => {
|
||||
this.unionOptions = res
|
||||
|
||||
+10
-8
@@ -493,18 +493,20 @@ const pushProgress = {
|
||||
methods: {
|
||||
async refreshData(sessionId, teacherMeetName, unionId, submitType) {
|
||||
this.teacherMeetName = teacherMeetName
|
||||
const {code, data} = await $.get('/platform/teacherCongress/delegate/push/selfUnionPushMetric', {
|
||||
this.$axios.post('/platform/teacherCongress/delegate/push/selfUnionPushMetric', {
|
||||
sessionId: sessionId,
|
||||
unionId: unionId,
|
||||
submitType: submitType
|
||||
})
|
||||
if (code === 0) {
|
||||
if (data) {
|
||||
this.metrics = data
|
||||
} else {
|
||||
this.$message.error('暂未分配名额')
|
||||
}).then(resp=>{
|
||||
if (resp.code === 0) {
|
||||
if (resp.data) {
|
||||
this.metrics = resp.data
|
||||
} else {
|
||||
this.$message.error('暂未分配名额')
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
+293
@@ -0,0 +1,293 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="姓名/工号">
|
||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="教代会">
|
||||
<el-select v-model="pageForm.sessionId">
|
||||
<el-option v-for="item in sessionOptions" :label="item.fullName" :value="item.id"
|
||||
:key="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<push-progress ref="pushProgressRef"></push-progress>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button icon="el-icon-check" size="small" type="primary" @click="onBatchSubmit">正式代表提交上报
|
||||
</el-button>
|
||||
<!-- <el-radio-group @change="doSearch" v-model="pageForm.isFormalOrAttendance" size="small">
|
||||
<el-radio-button label="全部"></el-radio-button>
|
||||
<el-radio-button label="正式代表"></el-radio-button>
|
||||
<el-radio-button label="列席代表"></el-radio-button>
|
||||
</el-radio-group>-->
|
||||
<el-radio-group @change="doSearch" v-model="pageForm.unionId" size="small">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button label="563dcfc5033d4631bc7f6482b2d427b9">机关党群</el-radio-button>
|
||||
<el-radio-button label="9b2650eec5114a18a0d2a09803800a39">机关行政</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-radio-group v-model="pageForm.approval" size="small"
|
||||
@change="doSearch">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
</table-tool>
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
:data="tableData"
|
||||
row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
>
|
||||
<el-table-column type="index" width="55" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="姓名" prop="userName" width="100"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginName"></el-table-column>
|
||||
<el-table-column label="性别" prop="sex" width="50"></el-table-column>
|
||||
<el-table-column label="分工会" prop="unionName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="职务" prop="position"></el-table-column>
|
||||
<el-table-column label="职称" prop="professionalTitle"></el-table-column>
|
||||
<el-table-column label="是否高级职称" prop="seniorTeacher">
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.seniorTeacher" style="color:#0037ff;">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否中级职称及以下" prop="intermediateBelow">
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.intermediateBelow" style="color:#0037ff;">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否干部" prop="cadre">
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.cadre" style="color:#0037ff;">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否工人" prop="worker">
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.worker" style="color:#0037ff;">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="教代会代表" prop="isJdh">
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.isJdh" style="color:#0037ff;">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工代会代表" prop="isGdh">
|
||||
<template v-slot="{row}">
|
||||
<span v-if="row.isGdh" style="color:#0037ff;">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="代表类型" prop="representativeType"></el-table-column>
|
||||
<el-table-column prop="curTaskName" label="当前节点"></el-table-column>
|
||||
<el-table-column prop="instanceState" label="流程状态">
|
||||
<template slot-scope="{row}">
|
||||
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
|
||||
size="small"></enum-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="100px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
||||
<!--<el-button v-if="row.taskState === 10" @click="openAudit(row)" size="mini" type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
|
||||
</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
<audit-info ref="auditInfoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<!-- <div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
|
||||
class="flow-task-form">
|
||||
<el-form-item label="审批意见" prop="tf_opinion"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
<el-button @click="handleTaskAction('ROLLBACK')" size="small" type="info">退回修改</el-button>
|
||||
<el-button @click="handleTaskAction('AGREE')" size="small" type="primary">同意</el-button>
|
||||
</el-row>
|
||||
</div>-->
|
||||
</audit-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
<!--#include('push-progress.js'){}#-->
|
||||
<!--#include('auditInfo.js'){}#-->
|
||||
new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
'push-progress': pushProgress,
|
||||
'audit-info': auditInfo
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
sessionOptions: [],
|
||||
units: [],
|
||||
pageForm: {
|
||||
isFormalOrAttendance: "全部",
|
||||
unionId: null,
|
||||
sessionId: "",
|
||||
approval: false,
|
||||
},
|
||||
|
||||
showApprovalForm: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doSearch() {
|
||||
this.pageData()
|
||||
const fullName = this.sessionOptions.find(v => v.id === this.pageForm.sessionId)?.fullName;
|
||||
|
||||
this.$refs.pushProgressRef.refreshData(this.pageForm.sessionId, fullName, this.pageForm.unionId,"JG")
|
||||
},
|
||||
onBatchSubmit() {
|
||||
if (!this.pageForm.unionId){
|
||||
this.$alert('请在提交按钮右侧选择“机关党群/机关行政”!', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
|
||||
}
|
||||
});
|
||||
return
|
||||
}
|
||||
this.$confirm('您确定要上报吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const loading = createLoading('正在提交中')
|
||||
this.$axios.post('/platform/teacherCongress/delegate/push/unionFzrAudit/batchSubmit', {
|
||||
sessionId: this.pageForm.sessionId,
|
||||
unionId: this.pageForm.unionId
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
openAudit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
bizId: row.id,
|
||||
userId: row.userId,
|
||||
processTaskId: row.taskId,
|
||||
taskKey: row.taskKey,
|
||||
taskName: row.taskName,
|
||||
instanceId: row.instanceId,
|
||||
submitType: 1,
|
||||
}
|
||||
this.$refs.auditInfoRef.onOpen(row)
|
||||
})
|
||||
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.auditInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
handleTaskAction(tf_type) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.formData.tf_type = tf_type
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onRevoke(row) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
listUnion() {
|
||||
this.$businessTool.listUnit().then((res) => {
|
||||
this.units = res
|
||||
})
|
||||
},
|
||||
listSession() {
|
||||
this.$axios.post("/platform/teacherCongress/common/listSession").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.sessionOptions = res.data
|
||||
if (this.sessionOptions && this.sessionOptions.length > 0) {
|
||||
this.pageForm.sessionId = this.sessionOptions[0].id
|
||||
this.doSearch()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.listUnion()
|
||||
this.listSession()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+9
-3
@@ -242,8 +242,9 @@ const write = {
|
||||
<el-descriptions-item label="办理时间">{{ task.finishTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="办理结果">
|
||||
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
|
||||
:value="task.ext.submitType"></dict-tag>
|
||||
{{processSubmitTypeEnums.find(v=>v.name===task.ext.tf_type)?.message}}
|
||||
<!-- <dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
|
||||
:value="task.ext.submitType"></dict-tag>-->
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="办理意见" v-if="!task.ext.isFirstTaskNode">{{
|
||||
task.taskFormData.opinion }}
|
||||
@@ -311,6 +312,7 @@ const write = {
|
||||
},
|
||||
sessionOptions: [],
|
||||
representativeTypeList: ['正式代表', '列席代表'],
|
||||
processSubmitTypeEnums:[]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -375,7 +377,10 @@ const write = {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async getEnumOptions() {
|
||||
const resp = await this.$axios.post("/open/common/dictEnumOptions", { name: "ProcessSubmitTypeEnum" })
|
||||
this.processSubmitTypeEnums=resp.data
|
||||
},
|
||||
async initInfo() {
|
||||
const {code, data} = await $.get('/platform/teacherCongress/delegate/push/write/info', {
|
||||
sessionId: this.formData.sessionId
|
||||
@@ -385,6 +390,7 @@ const write = {
|
||||
if (this.isSelected) {
|
||||
this.formData = data.delegate
|
||||
this.getDoneTasks()
|
||||
this.getEnumOptions()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+58
-1
@@ -19,6 +19,7 @@ layout("/layouts/platform.html"){
|
||||
style="width: 100%"
|
||||
:clearable="false"
|
||||
value-format="yyyy"
|
||||
@change="getActivityList"
|
||||
placeholder="请选择年度"
|
||||
>
|
||||
</el-date-picker>
|
||||
@@ -35,6 +36,28 @@ layout("/layouts/platform.html"){
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="旅行社">
|
||||
<el-select clearable filterable style="width: 100%"
|
||||
v-model="pageForm.travelAgencyId"
|
||||
placeholder="请选择旅行社">
|
||||
<el-option :key="item.id"
|
||||
:label="item.travelAgencyName"
|
||||
:value="item.id"
|
||||
v-for="item in travelAgencyList"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="线路">
|
||||
<el-select clearable filterable multiple style="width: 100%"
|
||||
v-model="pageForm.linIds"
|
||||
placeholder="请选择活动线路">
|
||||
<el-option :key="item.id"
|
||||
:label="item.lineName"
|
||||
:value="item.id"
|
||||
v-for="item in lineList"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
@@ -67,6 +90,7 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column label="所属工会" prop="unionName"></el-table-column>
|
||||
<el-table-column label="所属单位" prop="unitName"></el-table-column>
|
||||
<el-table-column label="报名线路" prop="lineName"></el-table-column>
|
||||
<el-table-column label="线路旅行社" prop="travelAgencyName"></el-table-column>
|
||||
<el-table-column prop="signUpTime" label="报名时间"></el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="300px">
|
||||
<template v-slot="{row}">
|
||||
@@ -88,7 +112,7 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
<script>
|
||||
<!--#include('../common/info.js'){}#-->
|
||||
new Vue({
|
||||
const vue= new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
@@ -100,13 +124,27 @@ layout("/layouts/platform.html"){
|
||||
pageDataUrl: "/platform/excellentRecuperation/summary/pageData",
|
||||
pageForm: {
|
||||
year: moment().format('YYYY'),
|
||||
linIds: []
|
||||
},
|
||||
activityList: [],
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
travelAgencyList: [],
|
||||
lineList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async selectTravelAgencyList() {
|
||||
const resp = await this.$axios.post('/platform/excellentRecuperation/travelAgency/selectTravelAgency', {year: this.formData.year})
|
||||
this.travelAgencyList = resp.data
|
||||
},
|
||||
getLineList() {
|
||||
this.$axios.post("/platform/excellentRecuperation/activityList/listLineListByThisYear").then(res => {
|
||||
if (res.code === 0) {
|
||||
this.lineList = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(row) {
|
||||
this.$confirm("确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
@@ -145,16 +183,35 @@ layout("/layouts/platform.html"){
|
||||
this.activityList = res.data
|
||||
if (this.activityList.length > 0) {
|
||||
this.$set(this.pageForm, 'activityId', this.activityList[0].id)
|
||||
} else {
|
||||
this.$set(this.pageForm, 'activityId', "")
|
||||
this.$set(this.pageForm, 'travelAgencyId', "")
|
||||
this.$set(this.pageForm, 'linIds', [])
|
||||
}
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
},
|
||||
async pageData() {
|
||||
const pageForm=clone(this.pageForm)
|
||||
if (pageForm.linIds) {
|
||||
pageForm.linIds = JSON.stringify(pageForm.linIds)
|
||||
}
|
||||
const resp = await this.$axios.post("/platform/excellentRecuperation/summary/pageData", pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list
|
||||
this.pageForm.totalCount = resp.data.totalCount
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.getActivityList()
|
||||
this.selectTravelAgencyList()
|
||||
this.getLineList()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -9,12 +9,12 @@ layout("/layouts/platform.html"){
|
||||
<search @search="doSearch">
|
||||
<search-item label="活动时间">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
placeholder="活动时间"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
:clearable="false"
|
||||
placeholder="活动时间"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
@@ -24,35 +24,35 @@ layout("/layouts/platform.html"){
|
||||
<table-tool label="我的福利"></table-tool>
|
||||
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
class="vi-table"
|
||||
ref="table"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading"
|
||||
:data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
class="vi-table"
|
||||
ref="table"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading"
|
||||
>
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
:index="indexMethod"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='choiceTime'">
|
||||
<i class="el-icon-time"></i>
|
||||
@@ -74,9 +74,11 @@ layout("/layouts/platform.html"){
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" prop="userOnline" width="200px">
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" prop="userOnline"
|
||||
width="200px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button @click="openLogistics(row)" size="mini" type="primary">查看物流信息</el-button>
|
||||
<!-- <el-button :disabled="!row.courierNumber" @click="openEvaluate(row)" size="mini" type="primary">评价</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -101,11 +103,11 @@ layout("/layouts/platform.html"){
|
||||
searchName: "username"
|
||||
},
|
||||
tableColumns: [
|
||||
{ prop: "year", label: "年度" },
|
||||
{ prop: "name", label: "项目名称" },
|
||||
{ prop: "choiceTime", label: "选择时间" },
|
||||
{ prop: "isChoose", label: "是否选择" },
|
||||
{ prop: "gist_list", label: "所选福利" }
|
||||
{prop: "year", label: "年度"},
|
||||
{prop: "name", label: "项目名称"},
|
||||
{prop: "choiceTime", label: "选择时间"},
|
||||
{prop: "isChoose", label: "是否选择"},
|
||||
{prop: "gist_list", label: "所选福利"}
|
||||
// { prop: "receiveAddress", label: "收货地址" }
|
||||
// { prop: "courierNumber", label: "快递单号", sortable: true }
|
||||
]
|
||||
@@ -115,6 +117,9 @@ layout("/layouts/platform.html"){
|
||||
"select-view": selectView
|
||||
},
|
||||
methods: {
|
||||
openLogistics() {
|
||||
this.$message.warning("暂时还没有物流信息!")
|
||||
},
|
||||
async openView(row) {
|
||||
this.$refs.selectViewRef.onOpen(row.id)
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ const optionSelect = {
|
||||
<!-- 选择提示 -->
|
||||
<div class="welfare-notice">
|
||||
<el-alert
|
||||
:title="projectInfo.isCheckBox === 'radio' ? '请选择一项福利' : '您可以选择多项福利,最多可选 ' + (projectInfo.multiSelectNum || projectInfo.options.length) + ' 项'"
|
||||
type="info"
|
||||
show-icon>
|
||||
:title="projectInfo.isCheckBox === 'radio' ? '请选择一项福利' : '您可以选择多项福利,最多可选 ' + (projectInfo.multiSelectNum || projectInfo.options.length) + ' 项'"
|
||||
type="info"
|
||||
show-icon>
|
||||
</el-alert>
|
||||
</div>
|
||||
|
||||
@@ -70,8 +70,8 @@ const optionSelect = {
|
||||
@click="projectInfo.isCheckBox === 'radio' ? selectRadioOption(option.id) : null">
|
||||
|
||||
<el-tag
|
||||
v-if="projectInfo.isCheckBox === 'radio' ? selectedRadioId === option.id : option.selectNum > 0"
|
||||
class="option-tag" type="primary" effect="plain">已选择
|
||||
v-if="projectInfo.isCheckBox === 'radio' ? selectedRadioId === option.id : option.selectNum > 0"
|
||||
class="option-tag" type="primary" effect="plain">已选择
|
||||
</el-tag>
|
||||
|
||||
<div class="option-image">
|
||||
@@ -95,11 +95,11 @@ const optionSelect = {
|
||||
<!-- 多选模式使用步进器 -->
|
||||
<div class="option-stepper" v-else>
|
||||
<el-input-number
|
||||
v-model="option.selectNum"
|
||||
:min="0"
|
||||
:max="projectInfo.multiSelectNum || 99"
|
||||
size="small"
|
||||
controls-position="right">
|
||||
v-model="option.selectNum"
|
||||
:min="0"
|
||||
:max="projectInfo.multiSelectNum || 99"
|
||||
size="small"
|
||||
controls-position="right">
|
||||
</el-input-number>
|
||||
</div>
|
||||
</div>
|
||||
@@ -116,11 +116,11 @@ const optionSelect = {
|
||||
|
||||
<!-- 选项详情弹窗 -->
|
||||
<el-dialog
|
||||
title="福利详情"
|
||||
:visible.sync="showOptionDetailDialog"
|
||||
width="60%"
|
||||
append-to-body
|
||||
custom-class="welfare-detail-dialog">
|
||||
title="福利详情"
|
||||
:visible.sync="showOptionDetailDialog"
|
||||
width="60%"
|
||||
append-to-body
|
||||
custom-class="welfare-detail-dialog">
|
||||
<div class="welfare-detail-popup" v-if="selectedOption">
|
||||
<div class="welfare-detail-title">{{ selectedOption.optionName }}</div>
|
||||
<div class="welfare-detail-content" v-html="selectedOption.description"></div>
|
||||
@@ -129,11 +129,11 @@ const optionSelect = {
|
||||
|
||||
<!-- 确认弹窗 -->
|
||||
<el-dialog
|
||||
title="确认选择"
|
||||
:visible.sync="showConfirmDialog"
|
||||
width="500px"
|
||||
append-to-body
|
||||
custom-class="welfare-confirm-dialog">
|
||||
title="确认选择"
|
||||
:visible.sync="showConfirmDialog"
|
||||
width="50%"
|
||||
append-to-body
|
||||
custom-class="welfare-confirm-dialog">
|
||||
<div class="confirm-content">
|
||||
<!-- 联系电话输入 -->
|
||||
<div class="confirm-mobile-section">
|
||||
@@ -141,14 +141,16 @@ const optionSelect = {
|
||||
<el-form :model="contactForm" ref="contactForm" :rules="contactRules" label-width="80px">
|
||||
<el-form-item prop="mobile" label="联系电话">
|
||||
<el-input
|
||||
v-model="contactForm.mobile"
|
||||
placeholder="请输入手机号码"
|
||||
maxlength="11"
|
||||
clearable>
|
||||
v-model="contactForm.mobile"
|
||||
placeholder="请输入手机号码"
|
||||
maxlength="11"
|
||||
clearable>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="projectInfo.provideMode == 3" prop="receiveAddress" label="收货地址" :rules="[{ required: true, message: '请选择收货地址', trigger: 'change' }]">
|
||||
<el-select v-model="contactForm.receiveAddress" placeholder="请选择收货地址" style="width: 100%">
|
||||
<el-form-item v-if="projectInfo.provideMode == 3" prop="receiveAddress" label="收货地址"
|
||||
:rules="[{ required: true, message: '请选择收货地址', trigger: 'change' }]">
|
||||
<el-select v-model="contactForm.receiveAddress" placeholder="请选择收货地址"
|
||||
style="width: 100%">
|
||||
<el-option v-for="item in addressOptions"
|
||||
:key="item.id"
|
||||
:label="item.userName + ' ' + item.tel + ' ' + item.province + ' ' + item.city + ' ' + item.county + ' ' + item.addressDetail"
|
||||
@@ -156,6 +158,14 @@ const optionSelect = {
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="userSign"label="签字"
|
||||
:rules="[{ required: true, message: '请签字', trigger: 'change' }]"
|
||||
v-if="projectInfo.signMode===2">
|
||||
<div>
|
||||
<pc-signature v-model="contactForm.userSign" ref=""></pc-signature>
|
||||
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
@@ -165,9 +175,9 @@ const optionSelect = {
|
||||
<div class="selected-item-left">
|
||||
<div class="selected-item-image">
|
||||
<el-image
|
||||
:src="option.imgUrl"
|
||||
fit="cover"
|
||||
:preview-src-list="[option.imgUrl]">
|
||||
:src="option.imgUrl"
|
||||
fit="cover"
|
||||
:preview-src-list="[option.imgUrl]">
|
||||
<div slot="error" class="image-slot">
|
||||
<i class="el-icon-picture-outline"></i>
|
||||
</div>
|
||||
@@ -183,10 +193,10 @@ const optionSelect = {
|
||||
</div>
|
||||
<div class="selected-item-right">
|
||||
<el-tag
|
||||
size="small"
|
||||
type="primary"
|
||||
effect="plain"
|
||||
v-if="projectInfo.isCheckBox === 'checkBox'">
|
||||
size="small"
|
||||
type="primary"
|
||||
effect="plain"
|
||||
v-if="projectInfo.isCheckBox === 'checkBox'">
|
||||
× {{ option.selectNum }}
|
||||
</el-tag>
|
||||
</div>
|
||||
@@ -231,7 +241,8 @@ const optionSelect = {
|
||||
selectedOption: null, // 当前选中的选项
|
||||
contactForm: {
|
||||
mobile: "", // 联系电话,
|
||||
receiveAddress: ""
|
||||
receiveAddress: "",
|
||||
userSign: ""
|
||||
},
|
||||
contactRules: {
|
||||
mobile: [
|
||||
@@ -242,7 +253,8 @@ const optionSelect = {
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
addressOptions:[]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -326,7 +338,8 @@ const optionSelect = {
|
||||
this.selectedRadioId = null
|
||||
this.contactForm = {
|
||||
mobile: "",
|
||||
receiveAddress: ""
|
||||
receiveAddress: "",
|
||||
userSign: ""
|
||||
}
|
||||
|
||||
this.getProjectInfo()
|
||||
@@ -443,7 +456,8 @@ const optionSelect = {
|
||||
selectOptionId: this.selectedRadioId,
|
||||
selectNum: 1,
|
||||
mobile: this.contactForm.mobile,
|
||||
receiveAddress: this.contactForm.receiveAddress
|
||||
receiveAddress: this.contactForm.receiveAddress,
|
||||
userSign: this.contactForm.userSign
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -454,7 +468,8 @@ const optionSelect = {
|
||||
selectOptionId: option.id,
|
||||
selectNum: option.selectNum,
|
||||
mobile: this.contactForm.mobile,
|
||||
receiveAddress: this.contactForm.receiveAddress
|
||||
receiveAddress: this.contactForm.receiveAddress,
|
||||
userSign: this.contactForm.userSign
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@@ -72,8 +72,11 @@ layout("/layouts/platform.html"){
|
||||
<el-radio-button :label="false">未选择</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="importCourierNumber">
|
||||
导入快递单号
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="exportXlsx">
|
||||
导出选择情况表
|
||||
导出签字表
|
||||
</el-button>
|
||||
</table-tool>
|
||||
|
||||
@@ -144,6 +147,7 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "welfareUnionName", label: "所属工会", sortable: true },
|
||||
{ prop: "welfareUnitName", label: "所属单位", sortable: true },
|
||||
{ prop: "selectedOptions", label: "所选福利", sortable: true },
|
||||
{ prop: "courierNumbers", label: "快递号", sortable: true },
|
||||
{ prop: "mobile", label: "联系电话", sortable: true }
|
||||
],
|
||||
optionSelectVisible: false
|
||||
@@ -161,6 +165,9 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
importCourierNumber(){
|
||||
|
||||
},
|
||||
// 获取福利列表
|
||||
getWelfareList() {
|
||||
this.$axios.post("/platform/welfare/common/list", { year: this.pageForm.year }).then((res) => {
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<style scoped>
|
||||
.info-title {
|
||||
font-weight: bold;
|
||||
background-color: white;
|
||||
padding: 13px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
text-align: center !important;
|
||||
}
|
||||
.info-container {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
.button {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.info-img {
|
||||
display: block;
|
||||
}
|
||||
.van-count-down {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app">
|
||||
<van-nav-bar title="单身联谊" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
|
||||
|
||||
<van-sticky offset-top="46px">
|
||||
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.activityType" :options="typeOptions" :multiple="false"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<table-list api="/platform/fellowship/apply/activityPageData"
|
||||
:page_form.sync="pageForm"
|
||||
ref="tableListRef"
|
||||
title="activityName"
|
||||
img="cover"
|
||||
@ready="onReady"
|
||||
>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="面向对象">{{row.activityGroupName}}</table-column>
|
||||
<table-column label="报名时间">
|
||||
{{$moment(row.activitySignUpStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activitySignUpEndTime).format('MM/DD HH:mm')}}
|
||||
</table-column>
|
||||
<table-column label="活动时间">
|
||||
{{$moment(row.activityStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activityEndTime).format('MM/DD HH:mm')}}
|
||||
</table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<template v-if="$moment().isBefore($moment(row.activitySignUpEndTime))">
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>查看介绍</span>
|
||||
</div>
|
||||
<div class="action-btn" @click="onApply(row)">
|
||||
<i class="fa fa-edit"></i>
|
||||
<span>去报名</span>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
<van-action-sheet :close-on-click-overlay="false" title="详细信息" v-model="infoVisible">
|
||||
|
||||
<div class="info-container">
|
||||
<div>
|
||||
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
|
||||
<div class="info-title">{{infoRow.activityName}}</div>
|
||||
<pdf-preview :content="infoRow.introduce"></pdf-preview>
|
||||
</div>
|
||||
<div class="button">
|
||||
<van-button @click="onApply(infoRow)" type="primary" block>
|
||||
<span v-if="time >= 0">
|
||||
去报名
|
||||
</span>
|
||||
<template v-else>
|
||||
距离开始
|
||||
<van-count-down :time="Math.abs(time)" class="count-down" format="DD 天 HH 时 mm 分 ss 秒" @finish="time = 0"></van-count-down>
|
||||
</template>
|
||||
</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
components: {
|
||||
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
time: 0,
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
searchKeyword: '',
|
||||
year: new Date().getFullYear(),
|
||||
activityType: 2,
|
||||
},
|
||||
typeOptions: [
|
||||
{text: '全部', value: 1},
|
||||
{text: '即将开始 & 报名中', value: 2},
|
||||
{text: '已结束', value: 3},
|
||||
],
|
||||
infoVisible: false,
|
||||
infoRow: {},
|
||||
|
||||
id: GetQueryString('id')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onView(row) {
|
||||
this.infoRow = row
|
||||
this.time = this.$moment().diff(this.$moment(row.activitySignUpStartTime), 'milliseconds')
|
||||
this.infoVisible = true
|
||||
},
|
||||
onApply(row) {
|
||||
if(this.$moment().isBefore(this.$moment(row.activitySignUpStartTime))) {
|
||||
this.onView(row)
|
||||
return
|
||||
}
|
||||
this.$pjaxReplace('/platform/fellowship/apply/list/h5?id=' + row.id)
|
||||
},
|
||||
fetchOne() {
|
||||
this.$axios.post('/platform/fellowship/manage/findOne', {id: this.id}).then((res) => {
|
||||
if(res.code === 0) {
|
||||
this.onView(res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
onReady() {
|
||||
this.doSearch()
|
||||
if(this.id) {
|
||||
this.fetchOne()
|
||||
}
|
||||
},
|
||||
doSearch() {
|
||||
this.$nextTick(() => {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.$refs.tableListRef.doSearch()
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,89 @@
|
||||
const times = {
|
||||
template:
|
||||
/*language=HTML*/
|
||||
`
|
||||
<div>
|
||||
<van-action-sheet v-model="visible" title="时间段" cancel-text="取消">
|
||||
<button v-for="(item,index) in row?.courseTimes" type="button" class="van-action-sheet__item">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div>
|
||||
<div class="van-action-sheet__name">
|
||||
<label>{{ weekdayCNMap[$moment(item.courseDate).day()] }}</label>
|
||||
<label>{{ $moment(item.courseDate).format('YYYY-MM-DD') }}</label>
|
||||
</div>
|
||||
<div class="van-action-sheet__subname">
|
||||
{{$moment(item.courseStartTime).format('MM-DD HH:mm') + ' 至 ' + $moment(item.courseEndTime).format('MM-DD HH:mm')}}
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="row.isSign === true && row.isMobileSign === true" class="sign_button">
|
||||
<van-button v-if="item.isAttend !== true" @click.stop="onSign(item)" size="mini" type="info">签到</van-button>
|
||||
<van-button v-if="item.isAttend === true" size="mini" type="info" disabled>已签到</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</van-action-sheet>
|
||||
|
||||
<van-popup round :safe-area-inset-bottom="true"
|
||||
:close-on-click-overlay="false"
|
||||
v-model="signVisible"
|
||||
:style="{ width: '80%', height: '66%' }"
|
||||
get-container="#app"
|
||||
@close="onSignClose"
|
||||
closeable
|
||||
>
|
||||
<scan-code ref="scanCodeRef"></scan-code>
|
||||
</van-popup>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
visible:false,
|
||||
row: null,
|
||||
weekdayCNMap: {0: '周日', 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六'},
|
||||
|
||||
selectCourseTime: {},
|
||||
signVisible: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"scan-code": httpVueLoader("/components/plugins/sysScanCode/index.vue?v=" + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
onSignClose() {
|
||||
this.$refs.scanCodeRef.closeScan()
|
||||
},
|
||||
onOpen(row) {
|
||||
this.row = row
|
||||
this.visible = true
|
||||
},
|
||||
onSign(courseTime) {
|
||||
this.selectCourseTime = courseTime
|
||||
if(this.row.signType === 1) {
|
||||
this.signVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.scanCodeRef.init()
|
||||
})
|
||||
}
|
||||
if(this.row.signType === 2) {
|
||||
this.makeCode()
|
||||
}
|
||||
if(this.row.signType === 3) {
|
||||
this.$toast('此签到模式正在升级中')
|
||||
}
|
||||
},
|
||||
makeCode() {
|
||||
const url = '/platform/fellowship/mine/passiveScan'
|
||||
const data = url + '?id=' + this.selectCourseTime.id
|
||||
console.log(data)
|
||||
const content = jrQrcode.getQrBase64(data)
|
||||
vant.ImagePreview([content])
|
||||
},
|
||||
onClose(){
|
||||
this.visible = false
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
const applyForm = {
|
||||
template:
|
||||
/*language=HTML*/
|
||||
`
|
||||
<div>
|
||||
<van-action-sheet :close-on-click-overlay="false" title="报名信息" v-model="visible">
|
||||
<van-form ref="formRef" class="form-container">
|
||||
<van-cell-group title="活动信息" class="form-section">
|
||||
<van-field label="活动名称" readonly v-model="row.courseName"></van-field>
|
||||
<van-field label="校区" readonly v-model="row.campus"></van-field>
|
||||
<van-field label="活动地点" readonly v-model="row.courseLocation"></van-field>
|
||||
</van-cell-group>
|
||||
<van-cell-group title="基础信息" class="form-section">
|
||||
<van-field label="姓名" readonly v-model="formData.username"></van-field>
|
||||
<van-field label="工号" readonly v-model="formData.loginname"></van-field>
|
||||
<van-field label="所属单位" readonly v-model="formData.unitName"></van-field>
|
||||
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
|
||||
<van-field label="性别" readonly v-model="formData.sex"></van-field>
|
||||
<template v-if="row.courseIsLimitApply">
|
||||
<van-field label="报名时段"
|
||||
required
|
||||
:rules="[{ required: true, message: '请选择报名时段' }]"
|
||||
readonly
|
||||
@click="showCoursePicker = true"
|
||||
placeholder="请选择报名时段"
|
||||
name="courseTimeName"
|
||||
v-model="formData.courseTimeName">
|
||||
</van-field>
|
||||
<van-popup v-model="showCoursePicker" position="bottom">
|
||||
<van-picker
|
||||
show-toolbar
|
||||
:columns="courseTimeSelectList"
|
||||
@confirm="onCourseConfirm"
|
||||
@cancel="showCoursePicker=false"
|
||||
></van-picker>
|
||||
</van-popup>
|
||||
</template>
|
||||
<train-dynamic-form v-model="dynamicColumnsData" ref="dynamicForm"></train-dynamic-form>
|
||||
</van-cell-group>
|
||||
|
||||
<div class="button">
|
||||
<van-button @click="onSubmit" round type="info" block>提交</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
</van-action-sheet>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
row: {},
|
||||
activity: {},
|
||||
dynamicColumnsData: [],
|
||||
visible: false,
|
||||
formData: {},
|
||||
showCoursePicker: false,
|
||||
courseTimeSelectList: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"train-dynamic-form": httpVueLoader("/components/module/trainSignUp/TrainDynamicForm.vue")
|
||||
},
|
||||
methods: {
|
||||
async onOpen(row, courseType) {
|
||||
this.row = row
|
||||
this.init(row, courseType)
|
||||
if(row.courseIsLimitApply) {
|
||||
await this.getCourseTimeSelectList(row)
|
||||
}
|
||||
this.visible = true
|
||||
},
|
||||
init(row, courseType) {
|
||||
this.$set(this.formData, 'username', this.$store.state.user.username)
|
||||
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
|
||||
this.$set(this.formData, 'unionName', this.$store.state.user.union.name)
|
||||
this.$set(this.formData, 'unitName', this.$store.state.user.unit.name)
|
||||
this.$set(this.formData, 'sex', this.$store.state.user.sex)
|
||||
this.$set(this.formData, 'activityId', row.activityId)
|
||||
this.$set(this.formData, 'courseId', row.id)
|
||||
|
||||
this.dynamicColumnsData = courseType ? courseType.trainMobileSignColumnList : []
|
||||
this.dynamicColumnsData.forEach((item) => {
|
||||
item.columnValue = this.$store.state.user[item.columnCode] || ""
|
||||
})
|
||||
},
|
||||
onCourseConfirm(val){
|
||||
this.formData.activityCourseId = val.value
|
||||
this.$set(this.formData, "activityCourseId", val.value)
|
||||
this.$set(this.formData, "courseTimeName", val.text.substring(0, 12))
|
||||
this.showCoursePicker = false
|
||||
},
|
||||
async getCourseTimeSelectList(o) {
|
||||
const resp = await this.$axios.post('/platform/trainSignUp/apply/getCourseTimeSelectList',{courseId: o.id})
|
||||
if (resp.code === 0) {
|
||||
this.courseTimeSelectList = resp.data
|
||||
} else {
|
||||
this.$toast.fail("获取时段信息失败,请联系管理员")
|
||||
}
|
||||
},
|
||||
async validateSignUp() {
|
||||
// 验证自定义表单
|
||||
await this.$refs.dynamicForm.$refs.form.validate()
|
||||
// 获取家属人数
|
||||
let familyCount = this.dynamicColumnsData.filter(o => o.columnCode === 'xdqsrs').reduce((sum, item) => {
|
||||
return sum + (Number(item.columnValue) || 0)
|
||||
}, 0)
|
||||
|
||||
const res = await this.$axios.post("/platform/trainSignUp/apply/validateSignUp", {
|
||||
courseId: this.formData.courseId,
|
||||
currentFamilyNumber: familyCount
|
||||
})
|
||||
return res.code === 0
|
||||
},
|
||||
async validateCourseTime() {
|
||||
const res = await this.$axios.post('/platform/trainSignUp/apply/validateSourceSignUp', {
|
||||
activityCourseId: this.formData.activityCourseId,
|
||||
courseId: this.row.id
|
||||
})
|
||||
return res.code === 0
|
||||
},
|
||||
async onSubmit() {
|
||||
if(!await this.validateSignUp()) return
|
||||
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交吗?"
|
||||
}).then(async () => {
|
||||
if (this.row.courseIsLimitApply) {
|
||||
if(!await this.validateCourseTime()) return
|
||||
}
|
||||
|
||||
const mobileColumnsValue = this.dynamicColumnsData.map((v) => {
|
||||
return {
|
||||
columnName: v.columnName,
|
||||
columnValue: v.columnValue,
|
||||
columnCode: v.columnCode,
|
||||
columnFormType: v.columnFormType
|
||||
}
|
||||
})
|
||||
this.formData.mobileColumnsValue = JSON.stringify(mobileColumnsValue)
|
||||
this.$axios.post("/platform/trainSignUp/apply/doSignUp", this.formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$toast(res.msg)
|
||||
this.visible = false
|
||||
this.$emit('refresh')
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
/deep/ .button {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<style scoped>
|
||||
.primary-color {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
.sign_button .van-button{
|
||||
width: 66px;
|
||||
height: 30px;
|
||||
font-size: 14px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app">
|
||||
<van-nav-bar title="活动报名" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
|
||||
|
||||
<van-sticky offset-top="46px">
|
||||
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||
<van-dropdown-item v-model="pageForm.courseTypeId" :options="typeOptions" :multiple="false"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<van-tabs v-if="assortList.length > 0" type="card" color="#1867B0"
|
||||
style="margin-top: 10px" @click="tabClick">
|
||||
<van-tab v-for="item in assortList" :name="item" :title="item">
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
|
||||
<table-list api="/platform/trainSignUp/apply/pageData"
|
||||
:page_form.sync="pageForm"
|
||||
ref="tableListRef"
|
||||
@ready="onReady"
|
||||
>
|
||||
<template #header="{index,row}">
|
||||
<div class="item-header">
|
||||
<div class="item-title">{{ row.courseName }}</div>
|
||||
<div v-html="calcSignUpCount(row)"></div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="类型">{{row.typeName}}</table-column>
|
||||
<table-column label="校区">{{row.campus}}</table-column>
|
||||
<table-column label="地点">{{row.courseLocation}}</table-column>
|
||||
<table-column label="联系人">{{row.courseInstructor}}</table-column>
|
||||
<table-column label="时间">
|
||||
<span v-if="row.courseTimes && row.courseTimes.length === 1" class="primary-color" @click="onTime(row)">
|
||||
{{ weekdayCNMap[$moment(row.courseTimes[0].courseDate).day()]
|
||||
+ ' '
|
||||
+ $moment(row.courseTimes[0].courseStartTime).format('MM月DD日 HH:mm')
|
||||
+ '~'
|
||||
+ $moment(row.courseTimes[0].courseEndTime).format('HH:mm') }}
|
||||
</span>
|
||||
<span v-else @click="onTime(row)" class="primary-color">点我查看</span>
|
||||
</table-column>
|
||||
<table-column v-if="row.introduce" label="详细信息">
|
||||
<span @click="introduceRow = row; introduceVisible = true" class="primary-color">点我查看</span>
|
||||
</table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div v-if="activity.wechat && row.isSign" class="action-btn" @click="this.vant.ImagePreview([activity.wechat])">
|
||||
<i class="fa fa-wechat"></i>
|
||||
<span>微信群二维码</span>
|
||||
</div>
|
||||
<template v-if="$moment().isBefore($moment(activity.activitySignUpEndTime))">
|
||||
<div v-if="row.isSign === false" class="action-btn" @click="onApply(row)">
|
||||
<i class="fa fa-sign-in"></i>
|
||||
<span>我要报名</span>
|
||||
</div>
|
||||
<div v-if="row.isSign === true" class="action-btn delete" @click="onCancel(row)">
|
||||
<i class="fa fa-trash"></i>
|
||||
<span>取消报名</span>
|
||||
</div>
|
||||
</template>
|
||||
<div v-if="row.isSign === true && row.isMobileSign === true && $moment().isAfter($moment(activity.activitySignUpEndTime))"
|
||||
class="action-btn"
|
||||
@click="onTime(row)"
|
||||
>
|
||||
<i class="fa fa-sign-in"></i>
|
||||
<span>签到</span>
|
||||
</div>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
<van-action-sheet :close-on-click-overlay="false" title="详细信息" v-model="introduceVisible" cancel-text="取消">
|
||||
<pdf-preview :content="introduceRow.introduce"></pdf-preview>
|
||||
</van-action-sheet>
|
||||
|
||||
<times ref="timesRef"></times>
|
||||
<apply-form ref="formRef" @refresh="refresh"></apply-form>
|
||||
</div>
|
||||
|
||||
<script src="${base!}/assets/platform/plugins/jr-qrcode/jr-qrcode.js"></script>
|
||||
<script>
|
||||
<!--#include('../common/times.js'){}#-->
|
||||
<!--#include('applyForm.js'){}#-->
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
components: {
|
||||
'times': times,
|
||||
'apply-form': applyForm,
|
||||
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
searchKeyword: '',
|
||||
year: new Date().getFullYear(),
|
||||
courseTypeId: null,
|
||||
activityId: GetQueryString('id'),
|
||||
dataType: GetQueryString('dataType'),
|
||||
assortTypes: [],
|
||||
},
|
||||
typeOptions: [],
|
||||
assortOptions: [],
|
||||
sourceTypeOptions: [],
|
||||
introduceVisible: false,
|
||||
|
||||
introduceRow: {},
|
||||
activity: {},
|
||||
assortList: [],
|
||||
|
||||
weekdayCNMap: {0: '周日', 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六'},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tabClick(name) {
|
||||
this.pageForm.assortTypes = []
|
||||
this.pageForm.assortTypes.push(name)
|
||||
this.pageForm.assortTypes = JSON.stringify(this.pageForm.assortTypes)
|
||||
this.doSearch()
|
||||
},
|
||||
refresh() {
|
||||
this.doSearch()
|
||||
},
|
||||
async onTime(row) {
|
||||
// 如果设置签到,并且也报名的话
|
||||
if(row.isMobileSign === true && row.isSign === true) {
|
||||
const res = await this.$axios.post('/platform/trainSignUp/mine/queryCourseSign', {
|
||||
courseId: row.id
|
||||
})
|
||||
row.courseTimes = res.data
|
||||
}
|
||||
this.$refs.timesRef.onOpen(row)
|
||||
},
|
||||
onApply(row) {
|
||||
const courseType = this.sourceTypeOptions.find((v) => v.id === row.courseType)
|
||||
this.$axios.post('/platform/trainSignUp/apply/validateSignUp', {
|
||||
courseId: row.id
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code !== 0) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
confirmButtonColor: '#1867b0'
|
||||
})
|
||||
} else {
|
||||
let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber)
|
||||
if(row.reserveMode === 2 && lave <= 0) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
message: '您当前的报名为候补报名状态',
|
||||
confirmButtonColor: '#1867b0'
|
||||
})
|
||||
}
|
||||
this.$refs.formRef.onOpen(row, courseType)
|
||||
}
|
||||
})
|
||||
},
|
||||
onCancel(row) {
|
||||
vant.Dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: "您确定要<span style='color: red'>取消【" + row.courseName + "】</span>吗?",
|
||||
confirmButtonColor: '#1867b0',
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post('/platform/trainSignUp/apply/cancelSignUp', {
|
||||
activityId: row.activityId,
|
||||
courseId: row.id
|
||||
})
|
||||
this.$toast(resp.msg)
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
}
|
||||
}).catch(() => {})
|
||||
},
|
||||
calcSignUpCount(row) {
|
||||
if(!row.coursePeopleNumber || row.coursePeopleNumber === 0) {
|
||||
return "名额数不限制"
|
||||
}
|
||||
let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber)
|
||||
if(row.reserveMode === 2) {
|
||||
let lave2 = row.waitingNum - row.hasWaitingNum
|
||||
return "<span style='color: red'>余" + lave +"</span>/" + row.coursePeopleNumber + "人"
|
||||
+ ",<span style='color: red'>候补余" + lave2 + "</span>/" + row.waitingNum + "人"
|
||||
} else {
|
||||
return "<span style='color: red'>余" + lave +"</span>/" + row.coursePeopleNumber + "人"
|
||||
}
|
||||
},
|
||||
async onReady() {
|
||||
this.queryCourseAssort()
|
||||
const typeList = await this.getCourseTypeList()
|
||||
this.sourceTypeOptions = clone(typeList)
|
||||
this.typeOptions = [
|
||||
{
|
||||
text: "全部类型",
|
||||
value: null
|
||||
}
|
||||
].concat(typeList.map((v) => ({ text: v.typeName, value: v.id })))
|
||||
if (this.typeOptions.length > 0) {
|
||||
this.pageForm.type = this.typeOptions[0].value
|
||||
this.doSearch()
|
||||
}
|
||||
this.fetchActivity()
|
||||
},
|
||||
fetchActivity() {
|
||||
this.$axios.post('/platform/trainSignUp/manage/findOne', {id: this.pageForm.activityId})
|
||||
.then((res) => {
|
||||
this.activity = res.data
|
||||
})
|
||||
},
|
||||
async getCourseTypeList() {
|
||||
const resp = await this.$axios.post("/platform/trainSignUp/type/getAllType")
|
||||
return resp.data
|
||||
},
|
||||
queryCourseAssort() {
|
||||
this.$axios.post("/platform/trainSignUp/apply/queryCourseAssort", {activityId: this.pageForm.activityId})
|
||||
.then((resp) => {
|
||||
this.assortList = resp.data
|
||||
if(this.assortList.length > 0) {
|
||||
this.pageForm.assortTypes = JSON.stringify([this.assortList[0]])
|
||||
}
|
||||
})
|
||||
},
|
||||
doSearch() {
|
||||
this.$nextTick(() => {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.$refs.tableListRef.doSearch()
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,132 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<style scoped>
|
||||
.info-title {
|
||||
font-weight: bold;
|
||||
background-color: white;
|
||||
padding: 13px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
text-align: center !important;
|
||||
}
|
||||
.info-container {
|
||||
|
||||
}
|
||||
.button {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.info-img {
|
||||
display: block;
|
||||
}
|
||||
.van-count-down {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app">
|
||||
<van-nav-bar title="品牌活动-我的报名" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
|
||||
|
||||
<van-sticky offset-top="46px">
|
||||
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.activityType" :options="typeOptions" :multiple="false"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<table-list api="/platform/trainSignUp/apply/activityPageData"
|
||||
:page_form.sync="pageForm"
|
||||
ref="tableListRef"
|
||||
title="activityName"
|
||||
img="cover"
|
||||
@ready="onReady"
|
||||
>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="面向对象">{{row.activityGroupName}}</table-column>
|
||||
<table-column label="报名时间">
|
||||
{{$moment(row.activitySignUpStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activitySignUpEndTime).format('MM/DD HH:mm')}}
|
||||
</table-column>
|
||||
<table-column label="活动时间">
|
||||
{{$moment(row.activityStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activityEndTime).format('MM/DD HH:mm')}}
|
||||
</table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>查看介绍</span>
|
||||
</div>
|
||||
<div class="action-btn" @click="onApply(row)">
|
||||
<i class="fa fa-edit"></i>
|
||||
<span>查看</span>
|
||||
</div>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
<van-action-sheet :close-on-click-overlay="false" title="活动详细信息" v-model="infoVisible" cancel-text="取消">
|
||||
|
||||
<div class="info-container">
|
||||
<div>
|
||||
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
|
||||
<div class="info-title">{{infoRow.activityName}}</div>
|
||||
<pdf-preview :content="infoRow.introduce"></pdf-preview>
|
||||
</div>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
components: {
|
||||
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
searchKeyword: '',
|
||||
year: new Date().getFullYear(),
|
||||
activityType: 1,
|
||||
dataType: 'mine'
|
||||
},
|
||||
typeOptions: [
|
||||
{text: '全部', value: 1},
|
||||
{text: '报名中', value: 2},
|
||||
{text: '已结束', value: 3},
|
||||
],
|
||||
infoVisible: false,
|
||||
infoRow: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onView(row) {
|
||||
this.infoRow = row
|
||||
this.infoVisible = true
|
||||
},
|
||||
onApply(row) {
|
||||
this.$pjaxReplace('/platform/trainSignUp/apply/list/h5?id=' + row.id + '&dataType=mine')
|
||||
},
|
||||
onReady() {
|
||||
this.doSearch()
|
||||
},
|
||||
doSearch() {
|
||||
this.$nextTick(() => {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.$refs.tableListRef.doSearch()
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user