Merge branch 'main' of https://dd3skj.picp.vip/zhaoxinyu/zhgh_njnu
This commit is contained in:
@@ -67,60 +67,60 @@ public class SysMsgServiceImpl extends BaseServiceImpl<Sys_msg> implements SysMs
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Sys_msg saveMsg(Sys_msg sysMsg, String[] users, boolean isExternal) {
|
||||
this.insert(sysMsg);
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.groupBy("loginname");
|
||||
FieldFilter fieldFilter = FieldFilter.create(View_user.class, "loginname|username|unitId|unitName|unionId|unionName");
|
||||
if ("user".equals(sysMsg.getType())) {
|
||||
cnd.and(View_user::getLoginname, "in", users);
|
||||
}
|
||||
List<View_user> viewUsers = Daos.ext(dao(), fieldFilter).query(View_user.class, cnd);
|
||||
List<Sys_msg_user> list = new CopyOnWriteArrayList<>();
|
||||
for (View_user viewUser : viewUsers) {
|
||||
Sys_msg_user sys_msg_user = new Sys_msg_user();
|
||||
sys_msg_user.setId(R.UU32());
|
||||
sys_msg_user.setMsgId(sysMsg.getId());
|
||||
sys_msg_user.setStatus(0);
|
||||
sys_msg_user.setLoginname(viewUser.getLoginname());
|
||||
sys_msg_user.setUserName(viewUser.getUsername());
|
||||
sys_msg_user.setUnitId(viewUser.getUnitId());
|
||||
sys_msg_user.setUnitName(viewUser.getUnitName());
|
||||
sys_msg_user.setUnionId(viewUser.getUnionId());
|
||||
sys_msg_user.setUnionName(viewUser.getUnionName());
|
||||
list.add(sys_msg_user);
|
||||
}
|
||||
dao().fastInsert(list);
|
||||
sysMsgUserService.clearCache();
|
||||
|
||||
List<String> loginNames = viewUsers.stream().map(View_user::getLoginname).distinct().toList();
|
||||
//发送站内消息
|
||||
ThreadUtil.execute(() -> {
|
||||
for (String loginName : loginNames) {
|
||||
getMsg(loginName);
|
||||
}
|
||||
});
|
||||
|
||||
//发送学校平台消息
|
||||
// for (String loginName : loginNames) {
|
||||
// smsService.send(loginName, sysMsg.getTitle(), sysMsg.getNote());
|
||||
// this.insert(sysMsg);
|
||||
//
|
||||
// Cnd cnd = Cnd.NEW();
|
||||
// cnd.groupBy("loginname");
|
||||
// FieldFilter fieldFilter = FieldFilter.create(View_user.class, "loginname|username|unitId|unitName|unionId|unionName");
|
||||
// if ("user".equals(sysMsg.getType())) {
|
||||
// cnd.and(View_user::getLoginname, "in", users);
|
||||
// }
|
||||
ThreadUtil.execute(() -> {
|
||||
smsService.massSend(loginNames, sysMsg.getTitle(), HtmlUtil.cleanHtmlTag(StrUtil.blankToDefault(sysMsg.getNote(),"")), sysMsg.getUrl());
|
||||
});
|
||||
// List<View_user> viewUsers = Daos.ext(dao(), fieldFilter).query(View_user.class, cnd);
|
||||
// List<Sys_msg_user> list = new CopyOnWriteArrayList<>();
|
||||
// for (View_user viewUser : viewUsers) {
|
||||
// Sys_msg_user sys_msg_user = new Sys_msg_user();
|
||||
// sys_msg_user.setId(R.UU32());
|
||||
// sys_msg_user.setMsgId(sysMsg.getId());
|
||||
// sys_msg_user.setStatus(0);
|
||||
// sys_msg_user.setLoginname(viewUser.getLoginname());
|
||||
// sys_msg_user.setUserName(viewUser.getUsername());
|
||||
// sys_msg_user.setUnitId(viewUser.getUnitId());
|
||||
// sys_msg_user.setUnitName(viewUser.getUnitName());
|
||||
// sys_msg_user.setUnionId(viewUser.getUnionId());
|
||||
// sys_msg_user.setUnionName(viewUser.getUnionName());
|
||||
// list.add(sys_msg_user);
|
||||
// }
|
||||
// dao().fastInsert(list);
|
||||
// sysMsgUserService.clearCache();
|
||||
//
|
||||
// List<String> loginNames = viewUsers.stream().map(View_user::getLoginname).distinct().toList();
|
||||
// //发送站内消息
|
||||
// ThreadUtil.execute(() -> {
|
||||
// for (String loginName : loginNames) {
|
||||
// getMsg(loginName);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// //发送学校平台消息
|
||||
//// for (String loginName : loginNames) {
|
||||
//// smsService.send(loginName, sysMsg.getTitle(), sysMsg.getNote());
|
||||
//// }
|
||||
// ThreadUtil.execute(() -> {
|
||||
// smsService.massSend(loginNames, sysMsg.getTitle(), HtmlUtil.cleanHtmlTag(StrUtil.blankToDefault(sysMsg.getNote(),"")), sysMsg.getUrl());
|
||||
// });
|
||||
|
||||
return sysMsg;
|
||||
}
|
||||
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void deleteMsg(String id) {
|
||||
this.delete(id);
|
||||
List<Sys_msg_user> msgUsers = sysMsgUserService.query(Cnd.where(Sys_msg_user::getMsgId, "=", id));
|
||||
sysMsgUserService.clear(Cnd.where("msgId", "=", id));
|
||||
sysMsgUserService.clearCache();
|
||||
for (Sys_msg_user msgUser : msgUsers) {
|
||||
getMsg(msgUser.getLoginname());
|
||||
}
|
||||
// this.delete(id);
|
||||
// List<Sys_msg_user> msgUsers = sysMsgUserService.query(Cnd.where(Sys_msg_user::getMsgId, "=", id));
|
||||
// sysMsgUserService.clear(Cnd.where("msgId", "=", id));
|
||||
// sysMsgUserService.clearCache();
|
||||
// for (Sys_msg_user msgUser : msgUsers) {
|
||||
// getMsg(msgUser.getLoginname());
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -206,36 +206,36 @@ public class SysMsgServiceImpl extends BaseServiceImpl<Sys_msg> implements SysMs
|
||||
@Override
|
||||
@Async
|
||||
public void innerMsg(String room, int size, List<NutMap> list) {
|
||||
NutMap map = new NutMap();
|
||||
map.put("action", "innerMsg");
|
||||
map.put("size", size);//未读消息数
|
||||
map.put("list", list);//最新5条消息列表 type--系统消息/用户消息 title--标题 time--时间戳
|
||||
String msg = Json.toJson(map, JsonFormat.compact());
|
||||
log.debug("msg::::" + msg);
|
||||
if (jedisAgent.isClusterMode()) {
|
||||
JedisCluster jedisCluster = jedisAgent.getJedisClusterWrapper().getJedisCluster();
|
||||
for (JedisPool pool : jedisCluster.getClusterNodes().values()) {
|
||||
try (Jedis jedis = pool.getResource()) {
|
||||
ScanParams match = new ScanParams().match(RedisConstant.REDIS_KEY_WSROOM + room + ":*");
|
||||
ScanResult<String> scan = null;
|
||||
do {
|
||||
scan = jedis.scan(scan == null ? ScanParams.SCAN_POINTER_START : scan.getStringCursor(), match);
|
||||
for (String key : scan.getResult()) {
|
||||
pubSubService.fire(key, msg);
|
||||
}
|
||||
} while (!scan.isCompleteIteration());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ScanParams match = new ScanParams().match(RedisConstant.REDIS_KEY_WSROOM + room + ":*");
|
||||
ScanResult<String> scan = null;
|
||||
do {
|
||||
scan = redisService.scan(scan == null ? ScanParams.SCAN_POINTER_START : scan.getStringCursor(), match);
|
||||
for (String key : scan.getResult()) {
|
||||
pubSubService.fire(key, msg);
|
||||
}
|
||||
} while (!scan.isCompleteIteration());
|
||||
}
|
||||
// NutMap map = new NutMap();
|
||||
// map.put("action", "innerMsg");
|
||||
// map.put("size", size);//未读消息数
|
||||
// map.put("list", list);//最新5条消息列表 type--系统消息/用户消息 title--标题 time--时间戳
|
||||
// String msg = Json.toJson(map, JsonFormat.compact());
|
||||
// log.debug("msg::::" + msg);
|
||||
// if (jedisAgent.isClusterMode()) {
|
||||
// JedisCluster jedisCluster = jedisAgent.getJedisClusterWrapper().getJedisCluster();
|
||||
// for (JedisPool pool : jedisCluster.getClusterNodes().values()) {
|
||||
// try (Jedis jedis = pool.getResource()) {
|
||||
// ScanParams match = new ScanParams().match(RedisConstant.REDIS_KEY_WSROOM + room + ":*");
|
||||
// ScanResult<String> scan = null;
|
||||
// do {
|
||||
// scan = jedis.scan(scan == null ? ScanParams.SCAN_POINTER_START : scan.getStringCursor(), match);
|
||||
// for (String key : scan.getResult()) {
|
||||
// pubSubService.fire(key, msg);
|
||||
// }
|
||||
// } while (!scan.isCompleteIteration());
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// ScanParams match = new ScanParams().match(RedisConstant.REDIS_KEY_WSROOM + room + ":*");
|
||||
// ScanResult<String> scan = null;
|
||||
// do {
|
||||
// scan = redisService.scan(scan == null ? ScanParams.SCAN_POINTER_START : scan.getStringCursor(), match);
|
||||
// for (String key : scan.getResult()) {
|
||||
// pubSubService.fire(key, msg);
|
||||
// }
|
||||
// } while (!scan.isCompleteIteration());
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -247,71 +247,71 @@ public class SysMsgServiceImpl extends BaseServiceImpl<Sys_msg> implements SysMs
|
||||
@Override
|
||||
// @Async
|
||||
public void getMsg(String loginname) {
|
||||
try {
|
||||
//通过用户名查询未读消息
|
||||
int size = sysMsgUserService.getUnreadNum(loginname);
|
||||
List<Sys_msg_user> list = sysMsgUserService.getUnreadList(loginname, 1, 5);
|
||||
List<NutMap> mapList = new ArrayList<>();
|
||||
for (Sys_msg_user msgUser : list) {
|
||||
String url = "/platform/sys/msg/user/all/detail/" + msgUser.getMsgId();
|
||||
if (Strings.isNotBlank(msgUser.getMsg().getUrl())) {
|
||||
url = msgUser.getMsg().getUrl();
|
||||
}
|
||||
mapList.add(NutMap.NEW()
|
||||
.addv("msgId", msgUser.getMsgId())
|
||||
.addv("type", typeMap.getString(msgUser.getMsg().getType()))
|
||||
.addv("title", msgUser.getMsg().getTitle())
|
||||
.addv("url", url)
|
||||
.addv("time", Times.format("yyyy-MM-dd HH:mm", Times.D(1000 * msgUser.getMsg().getSendAt()))));
|
||||
}
|
||||
innerMsg(loginname, size, mapList);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
// try {
|
||||
// //通过用户名查询未读消息
|
||||
// int size = sysMsgUserService.getUnreadNum(loginname);
|
||||
// List<Sys_msg_user> list = sysMsgUserService.getUnreadList(loginname, 1, 5);
|
||||
// List<NutMap> mapList = new ArrayList<>();
|
||||
// for (Sys_msg_user msgUser : list) {
|
||||
// String url = "/platform/sys/msg/user/all/detail/" + msgUser.getMsgId();
|
||||
// if (Strings.isNotBlank(msgUser.getMsg().getUrl())) {
|
||||
// url = msgUser.getMsg().getUrl();
|
||||
// }
|
||||
// mapList.add(NutMap.NEW()
|
||||
// .addv("msgId", msgUser.getMsgId())
|
||||
// .addv("type", typeMap.getString(msgUser.getMsg().getType()))
|
||||
// .addv("title", msgUser.getMsg().getTitle())
|
||||
// .addv("url", url)
|
||||
// .addv("time", Times.format("yyyy-MM-dd HH:mm", Times.D(1000 * msgUser.getMsg().getSendAt()))));
|
||||
// }
|
||||
// innerMsg(loginname, size, mapList);
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.getMessage(), e);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void offline(String room, String userToken) {
|
||||
NutMap map = new NutMap();
|
||||
map.put("action", "offline");
|
||||
String msg = Json.toJson(map, JsonFormat.compact());
|
||||
try {
|
||||
room = RedisConstant.REDIS_KEY_WSROOM + room + ":" + userToken;
|
||||
log.debugf("offline room(name=%s)", room);
|
||||
pubSubService.fire(room, msg);
|
||||
redisService.expire(room, 60 * 3);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
// NutMap map = new NutMap();
|
||||
// map.put("action", "offline");
|
||||
// String msg = Json.toJson(map, JsonFormat.compact());
|
||||
// try {
|
||||
// room = RedisConstant.REDIS_KEY_WSROOM + room + ":" + userToken;
|
||||
// log.debugf("offline room(name=%s)", room);
|
||||
// pubSubService.fire(room, msg);
|
||||
// redisService.expire(room, 60 * 3);
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.getMessage(), e);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMsg(String loginname, String title, String body, String sender) {
|
||||
sendMsg(List.of(loginname), title, body, SecurityUtil.getUserId());
|
||||
// sendMsg(List.of(loginname), title, body, SecurityUtil.getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMsg(List<String> loginNames, String title, String body, String sender) {
|
||||
Sys_msg sysMsg = new Sys_msg();
|
||||
sysMsg.setTitle(title);
|
||||
sysMsg.setNote(body);
|
||||
sysMsg.setSendType("hide");
|
||||
sysMsg.setType("user");
|
||||
sysMsg.setSendAt(Times.getTS());
|
||||
sysMsg.setCreatedBy(sender);
|
||||
this.saveMsg(sysMsg, loginNames.toArray(new String[]{}), true);
|
||||
// Sys_msg sysMsg = new Sys_msg();
|
||||
// sysMsg.setTitle(title);
|
||||
// sysMsg.setNote(body);
|
||||
// sysMsg.setSendType("hide");
|
||||
// sysMsg.setType("user");
|
||||
// sysMsg.setSendAt(Times.getTS());
|
||||
// sysMsg.setCreatedBy(sender);
|
||||
// this.saveMsg(sysMsg, loginNames.toArray(new String[]{}), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMsgInSys(List<String> loginNames, String title, String body, String sender) {
|
||||
Sys_msg sysMsg = new Sys_msg();
|
||||
sysMsg.setTitle(title);
|
||||
sysMsg.setNote(body);
|
||||
sysMsg.setSendType("hide");
|
||||
sysMsg.setType("user");
|
||||
sysMsg.setSendAt(Times.getTS());
|
||||
sysMsg.setCreatedBy(sender);
|
||||
this.saveMsg(sysMsg, loginNames.toArray(new String[]{}), false);
|
||||
// Sys_msg sysMsg = new Sys_msg();
|
||||
// sysMsg.setTitle(title);
|
||||
// sysMsg.setNote(body);
|
||||
// sysMsg.setSendType("hide");
|
||||
// sysMsg.setType("user");
|
||||
// sysMsg.setSendAt(Times.getTS());
|
||||
// sysMsg.setCreatedBy(sender);
|
||||
// this.saveMsg(sysMsg, loginNames.toArray(new String[]{}), false);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-6
@@ -204,7 +204,7 @@ public class FamilyActivityApplyController {
|
||||
if(Lang.isEmpty(courseList)) {
|
||||
return Result.success(new ArrayList<>());
|
||||
}
|
||||
List<String> assortList = courseList.stream().map(FamilyCourse::getAssort).filter(StrUtil::isNotBlank).toList();
|
||||
List<String> assortList = courseList.stream().map(FamilyCourse::getAssort).filter(StrUtil::isNotBlank).distinct().toList();
|
||||
return Result.success(assortList);
|
||||
}
|
||||
|
||||
@@ -378,8 +378,12 @@ public class FamilyActivityApplyController {
|
||||
if(signFullByUnionId) {
|
||||
return Result.error(99,"该活动您所在的分工会名额不足");
|
||||
}
|
||||
familyActivityService.doSignUp(familyUser);
|
||||
return Result.success("祝贺您!您已报名成功!请留意各分场活动的准确时间、地点,提前10-15分钟到达活动现场做好准备。如您因故不能参加活动,还请及时登录系统取消报名,以便将机会留给其他有需要的教职工。谢谢!");
|
||||
FamilyUser finishUser = familyActivityService.doSignUp(familyUser);
|
||||
if(finishUser.getState() == 2) {
|
||||
return Result.success("正式报名已满,您已列为替补,如有老师放弃报名,将会按先后顺序依次替补。请您自行关注后续结果。谢谢!");
|
||||
} else {
|
||||
return Result.success("祝贺您!您已报名成功!请留意各分场活动的准确时间、地点,提前10-15分钟到达活动现场做好准备。如您因故不能参加活动,还请及时登录系统取消报名,以便将机会留给其他有需要的教职工。谢谢!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("报名失败");
|
||||
@@ -407,7 +411,7 @@ public class FamilyActivityApplyController {
|
||||
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) {
|
||||
/*if (type.getIsBringFamily() && course.getReserveMode() == 2) {
|
||||
List<FamilyUser> signUpUsers = dao.query(FamilyUser.class, cnd);
|
||||
int thisSignUpUserCount = dao.count(FamilyUser.class,
|
||||
Cnd.where("activityId", "=", activityId)
|
||||
@@ -418,9 +422,8 @@ public class FamilyActivityApplyController {
|
||||
familyUser.setState(1);
|
||||
dao.update(familyUser);
|
||||
Sys_user user = dao.fetch(Sys_user.class, familyUser.getUserId());
|
||||
//msgApi.sendTextMsg("【" + activity.getActivityName() + "】已候补成功,请按时参加活动!", user.getLoginname());
|
||||
}
|
||||
}
|
||||
}*/
|
||||
//删除报名记录
|
||||
dao.clear("family_user_course", Cnd.where("activityId", "=", activityId)
|
||||
.and("courseId", "=", courseId).and("userId", "=", userId));
|
||||
|
||||
+13
-1
@@ -162,6 +162,17 @@ public class FamilyActivityStatisticsController {
|
||||
ts.activityId = @activityId
|
||||
""").setParam("activityId", activityId);
|
||||
List<NutMap> userList = familyActivityManageService.listMap(sql);
|
||||
for (NutMap item : userList) {
|
||||
if (item.getInt("state") == 1) {
|
||||
item.setv("stateName", "正常报名");
|
||||
} else if (item.getInt("state") == 2) {
|
||||
item.setv("stateName", "候补报名");
|
||||
} else if (item.getInt("state") == 3) {
|
||||
item.setv("stateName", "正常报名(候补)");
|
||||
} else if (item.getInt("state") == 4) {
|
||||
item.setv("stateName", "无效报名(缺席)");
|
||||
}
|
||||
}
|
||||
|
||||
List<FamilyCourse> courseList = dao.query(FamilyCourse.class, Cnd.where("activityId", "=", activityId));
|
||||
|
||||
@@ -178,7 +189,8 @@ public class FamilyActivityStatisticsController {
|
||||
Map.of("name", "分工会", "key", "unionName"),
|
||||
Map.of("name", "性别", "key", "sex"),
|
||||
Map.of("name", "人事系统手机号", "key", "newMobile"),
|
||||
Map.of("name", "报名时段", "key", "courseTime")
|
||||
Map.of("name", "报名时段", "key", "courseTime"),
|
||||
Map.of("name", "报名状态", "key", "stateName")
|
||||
);
|
||||
|
||||
List<ExcelExportEntity> excelCommonExportEntity = basicEntity.stream().map(entity -> {
|
||||
|
||||
@@ -65,7 +65,7 @@ public interface FamilyActivityService extends BaseService<FamilyActivity> {
|
||||
* 手机端报名
|
||||
* @param familyUser 活动ID
|
||||
*/
|
||||
void doSignUp(FamilyUser familyUser) throws Exception;
|
||||
FamilyUser doSignUp(FamilyUser familyUser) throws Exception;
|
||||
|
||||
/**
|
||||
* 异步插入每个报名成功人员的课程数据
|
||||
|
||||
+13
-3
@@ -244,7 +244,7 @@ public class FamilyActivityServiceImpl extends BaseServiceImpl<FamilyActivity> i
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doSignUp(FamilyUser familyUser) throws Exception {
|
||||
public FamilyUser doSignUp(FamilyUser familyUser) throws Exception {
|
||||
String userId = SecurityUtil.getUserId();
|
||||
|
||||
//查询课程
|
||||
@@ -256,8 +256,8 @@ public class FamilyActivityServiceImpl extends BaseServiceImpl<FamilyActivity> i
|
||||
//课程已报人数
|
||||
int normalCount = statisticsService.queryCourseCount(course.getId(), course.getCourseType());
|
||||
//+1是算自己
|
||||
int hasRegisterNum = type.getSelfAddFamily() ? normalCount + 1 : 0;
|
||||
familyUser.setState((hasRegisterNum + course.getCourseReservedNumber()) > course.getCoursePeopleNumber() ? 2 : 1);
|
||||
int hasRegisterNum = type.getSelfAddFamily() ? normalCount + 1 : normalCount;
|
||||
familyUser.setState((hasRegisterNum + course.getCourseReservedNumber()) >= course.getCoursePeopleNumber() ? 2 : 1);
|
||||
} else {
|
||||
familyUser.setState(1);
|
||||
}
|
||||
@@ -287,6 +287,7 @@ public class FamilyActivityServiceImpl extends BaseServiceImpl<FamilyActivity> i
|
||||
} else {
|
||||
asyncInsertUserCourse(familyUser.getActivityId(), familyUser.getCourseId(), userId);
|
||||
}
|
||||
return familyUser;
|
||||
}
|
||||
|
||||
@Async
|
||||
@@ -408,6 +409,9 @@ public class FamilyActivityServiceImpl extends BaseServiceImpl<FamilyActivity> i
|
||||
|
||||
List<List<NutMap>> currentValue = user.getMobileColumnsValue();
|
||||
|
||||
List<String> aa = List.of("b44a39b7962a43328f2ca59330ef9cc5");
|
||||
List<String> bb = List.of("edbd44528da3465dbeb711421fe2ae63", "636c7f75d32f4413b8254e412db9770e", "baabdff339e447308f4759add2017c90");
|
||||
|
||||
String tempValue = "";
|
||||
// 循环家属
|
||||
for (List<NutMap> listMap : currentValue) {
|
||||
@@ -438,6 +442,12 @@ public class FamilyActivityServiceImpl extends BaseServiceImpl<FamilyActivity> i
|
||||
if(Objects.equals(courseMap.get(user.getCourseId()), courseMap.get(hisRecord.getCourseId()))) {
|
||||
return Map.of(false, onlyKeyValue + "已经报名" + typeMap.get(courseMap.get(user.getCourseId())) + "分场");
|
||||
}
|
||||
if(aa.contains(user.getCourseId()) && bb.contains(hisRecord.getCourseId())) {
|
||||
return Map.of(false, onlyKeyValue + "已经报名" + typeMap.get(courseMap.get(hisRecord.getCourseId())) + "分场,存在冲突");
|
||||
}
|
||||
if(bb.contains(user.getCourseId()) && aa.contains(hisRecord.getCourseId())) {
|
||||
return Map.of(false, onlyKeyValue + "已经报名" + typeMap.get(courseMap.get(hisRecord.getCourseId())) + "分场,存在冲突");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -7,6 +7,7 @@ import com.aspose.slides.internal.og.add;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpActivity;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpCourse;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpUser;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpUserCourse;
|
||||
@@ -54,6 +55,12 @@ public class TrainScanCodeController {
|
||||
}
|
||||
|
||||
TrainSignUpCourse course = dao.fetch(TrainSignUpCourse.class, courseId);
|
||||
TrainSignUpActivity activity = dao.fetch(TrainSignUpActivity.class, course.getActivityId());
|
||||
|
||||
if(!(DateUtil.date().isAfter(activity.getActivityStartTime()) && DateUtil.date().isBefore(activity.getActivityEndTime()))) {
|
||||
return Result.error(99, "不在活动时间范围内");
|
||||
}
|
||||
|
||||
int count = dao.count(TrainSignUpUserCourse.class,
|
||||
Cnd.where("activityId", "=", course.getActivityId())
|
||||
.and("userId", "=", SecurityUtil.getUserId())
|
||||
|
||||
+38
-10
@@ -87,18 +87,30 @@ public class ClubUserJoinApplyController {
|
||||
@SaCheckPermission("club.join.apply")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result submit(ClubUserApply clubUserApply) {
|
||||
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", clubUserApply.getUserId()));
|
||||
if (!user.getMember() && !("劳务派遣一类".equals(user.getPreparedBy()) || "劳务派遣二类".equals(user.getPreparedBy()))) return Result.error("暂无申请加入协会资格!");
|
||||
|
||||
ClubUserApply userApply = dao.fetch(ClubUserApply.class, Cnd.where("userId", "=", clubUserApply.getUserId()).and("clubId", "=", clubUserApply.getClubId()).and("mode", "=", 1).desc(ClubUserApply::getApplyDate));
|
||||
if (ObjectUtil.isNotEmpty(userApply) && StrUtil.isBlank(userApply.getId())) {
|
||||
if (ObjectUtil.isNotEmpty(userApply) && StrUtil.isNotBlank(userApply.getId())) {
|
||||
BpmProcessInstance processInstance = dao.fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", userApply.getId()));
|
||||
if (!processInstance.getProcessInstanceStatus().equals(BpmProcessInstanceStatusEnum.COMPLETED.name())) {
|
||||
return Result.error("您有该协会的申请记录尚未完成,请到我的申请里查看!");
|
||||
}
|
||||
}
|
||||
|
||||
//查询协会操作员
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where("userId", "=", clubUserApply.getUserId())
|
||||
.and("clubId", "=", clubUserApply.getClubId()));
|
||||
if (ObjectUtil.isNotEmpty(clubUser)) {
|
||||
return Result.error("您已经是该协会成员,无需重复申请!");
|
||||
}
|
||||
|
||||
//查询协会操作员、会长、秘书长、副会长
|
||||
String operatorLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_OPERATOR, Cnd.where(Sys_user_role::getClubId, "=", clubUserApply.getClubId()));
|
||||
String presidentLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_PRESIDENT, Cnd.where(Sys_user_role::getClubId, "=", clubUserApply.getClubId()));
|
||||
if (StrUtil.isAllBlank(operatorLoginName, presidentLoginName)) {
|
||||
String secretaryLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_SECRETARY, Cnd.where(Sys_user_role::getClubId, "=", clubUserApply.getClubId()));
|
||||
String vicePresidentLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_VICE_PRESIDENT, Cnd.where(Sys_user_role::getClubId, "=", clubUserApply.getClubId()));
|
||||
|
||||
if (StrUtil.isAllBlank(operatorLoginName, presidentLoginName, secretaryLoginName, vicePresidentLoginName)) {
|
||||
return Result.error("该协会未配置审批人,请联系校工会!");
|
||||
}
|
||||
|
||||
@@ -109,15 +121,31 @@ public class ClubUserJoinApplyController {
|
||||
|
||||
Sys_user applyUser = dao.fetch(Sys_user.class, clubUserApply.getUserId());
|
||||
|
||||
List<String> assignments = new ArrayList<>();
|
||||
if (StrUtil.isNotBlank(operatorLoginName)) {
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), List.of(operatorLoginName), null);
|
||||
// 发送消息
|
||||
sysMsgService.sendMsg(operatorLoginName, "协会入会审核", "您有一条新的协会入会申请待处理,请登录暖心工会进行审批。", SecurityUtil.getUserId());
|
||||
}else{
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), List.of(presidentLoginName), null);
|
||||
// 发送消息
|
||||
sysMsgService.sendMsg(presidentLoginName, "协会入会审核", "您有一条新的协会入会申请待处理,请登录暖心工会进行审批。", SecurityUtil.getUserId());
|
||||
assignments.add(operatorLoginName);
|
||||
}
|
||||
if (StrUtil.isNotBlank(secretaryLoginName)) {
|
||||
assignments.add(secretaryLoginName);
|
||||
}
|
||||
if (StrUtil.isNotBlank(vicePresidentLoginName)) {
|
||||
assignments.add(vicePresidentLoginName);
|
||||
}
|
||||
if (StrUtil.isNotBlank(presidentLoginName)) {
|
||||
assignments.add(presidentLoginName);
|
||||
}
|
||||
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), assignments, null);
|
||||
|
||||
// if (StrUtil.isNotBlank(operatorLoginName)) {
|
||||
// bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), List.of(operatorLoginName), null);
|
||||
// // 发送消息
|
||||
//// sysMsgService.sendMsg(operatorLoginName, "协会入会审核", "您有一条新的协会入会申请待处理,请登录暖心工会进行审批。", SecurityUtil.getUserId());
|
||||
// }else{
|
||||
// bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), List.of(presidentLoginName), null);
|
||||
// // 发送消息
|
||||
//// sysMsgService.sendMsg(presidentLoginName, "协会入会审核", "您有一条新的协会入会申请待处理,请登录暖心工会进行审批。", SecurityUtil.getUserId());
|
||||
// }
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
+39
-5
@@ -7,17 +7,22 @@ import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.enums.BpmTaskApprovalTypeEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.bpm.models.BpmProcessTask;
|
||||
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserJoinPageForm;
|
||||
import com.budwk.app.zhgh.club.service.ClubUserJoinService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubUserJoinPageVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.dao.util.cri.Static;
|
||||
@@ -44,6 +49,8 @@ public class ClubUserJoinApprovalController {
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private ClubUserJoinService clubUserJoinService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("club.join.clubApproval")
|
||||
@@ -100,6 +107,7 @@ public class ClubUserJoinApprovalController {
|
||||
cnd.and(Cnd.likeEX("u.loginName", pageForm.getLoginName()));
|
||||
cnd.andEX("u.unionId","=",pageForm.getUnionId());
|
||||
cnd.andEX("u.unitId","=",pageForm.getUnitId());
|
||||
cnd.andEX("info.clubId","=",pageForm.getClubId());
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<ClubUserJoinPageVo> pageVO = clubUserJoinService.listPageVO(pageForm, sql, ClubUserJoinPageVo.class);
|
||||
@@ -111,14 +119,31 @@ public class ClubUserJoinApprovalController {
|
||||
@ApiOperation("审核")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam){
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
// approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
// Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
// List<String> assignments = new ArrayList<>();
|
||||
// if(approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)){
|
||||
// String approvalLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN);
|
||||
// assignments.add(approvalLoginName);
|
||||
// }
|
||||
// bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, assignments);
|
||||
|
||||
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
List<String> assignments = new ArrayList<>();
|
||||
if(approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)){
|
||||
String approvalLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN);
|
||||
assignments.add(approvalLoginName);
|
||||
}
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, assignments);
|
||||
|
||||
if (approvalParam.getBpmTaskApprovalTypeEnum() == BpmTaskApprovalTypeEnum.PASS) {
|
||||
String processInstanceBusinessId = approvalParam.getProcessInstanceBusinessId();
|
||||
ClubUserApply clubUserApply = dao.fetch(ClubUserApply.class, processInstanceBusinessId);
|
||||
if (clubUserApply != null) {
|
||||
ClubUser existUser = dao.fetch(ClubUser.class, Cnd.where("userId", "=", clubUserApply.getUserId()).and("clubId", "=", clubUserApply.getClubId()));
|
||||
if (existUser == null) {
|
||||
ClubUser clubUser = BeanUtil.copyProperties(clubUserApply, ClubUser.class);
|
||||
dao.insert(clubUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -128,6 +153,15 @@ public class ClubUserJoinApprovalController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result revoke(@Valid String taskId){
|
||||
bpmService.revokeTask(taskId);
|
||||
|
||||
BpmProcessTask task = dao.fetch(BpmProcessTask.class, taskId);
|
||||
String processInstanceId = task.getProcessInstanceId();
|
||||
BpmProcessInstance processInstance = dao.fetch(BpmProcessInstance.class, processInstanceId);
|
||||
String businessId = processInstance.getProcessInstanceBusinessId();
|
||||
|
||||
ClubUserApply clubUserApply = dao.fetch(ClubUserApply.class, businessId);
|
||||
dao.clear(ClubUser.class, Cnd.where(ClubUser::getUserId, "=", clubUserApply.getUserId())
|
||||
.and(ClubUser::getClubId, "=", clubUserApply.getClubId()));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -11,6 +11,7 @@ import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserJoinPageForm;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
@@ -47,7 +48,7 @@ public class ClubUserJoinMineController {
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.mine")
|
||||
public Result pageData(@Valid PageForm pageForm,
|
||||
public Result pageData(@Valid ClubUserJoinPageForm pageForm,
|
||||
@Param("year") Integer year){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -81,6 +82,8 @@ public class ClubUserJoinMineController {
|
||||
cnd.and("inst.processInstanceInitiatorLoginName", "=", SecurityUtil.getUserLoginname());
|
||||
}
|
||||
cnd.andEX("year(info.applyDate)", "=", year);
|
||||
cnd.and(Cnd.likeEX("u.userName", pageForm.getUserName()));
|
||||
cnd.and(Cnd.likeEX("u.loginName", pageForm.getLoginName()));
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
|
||||
+18
-16
@@ -335,22 +335,24 @@ public class ClubInfoManageController {
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@ApiOperation("授权")
|
||||
public Result doAuthRole(@Valid String id, @Valid String clubId, @Param("roleCode") @Valid String[] roleCodes) {
|
||||
List<String> roleCodeList = Arrays.asList(roleCodes);
|
||||
//查询社团是否存在会长或者秘书长
|
||||
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_PRESIDENT.name())) {
|
||||
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_PRESIDENT.name()))));
|
||||
if (count > 0) {
|
||||
return Result.error("会长只能有一位");
|
||||
}
|
||||
}
|
||||
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_SECRETARY.name())) {
|
||||
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_SECRETARY.name()))));
|
||||
if (count > 0) {
|
||||
return Result.error("秘书长只能有一位");
|
||||
}
|
||||
}
|
||||
List<String> roleCodeList = Arrays.asList(roleCodes);
|
||||
//查询社团是否存在会长或者秘书长
|
||||
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_PRESIDENT.name())) {
|
||||
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_PRESIDENT.name())))
|
||||
.and("id", "!=", id));
|
||||
if (count > 0) {
|
||||
return Result.error("会长只能有一位");
|
||||
}
|
||||
}
|
||||
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_SECRETARY.name())) {
|
||||
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_SECRETARY.name())))
|
||||
.and("id", "!=", id));
|
||||
if (count > 0) {
|
||||
return Result.error("秘书长只能有一位");
|
||||
}
|
||||
}
|
||||
|
||||
ClubUser clubUser = clubInfoManageService.dao().fetch(ClubUser.class, id);
|
||||
|
||||
|
||||
+82
@@ -6,8 +6,10 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
@@ -45,6 +47,7 @@ import javax.validation.Valid;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -227,6 +230,85 @@ public class ClubStatisticsController {
|
||||
zipOutputStream.close();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.statistics")
|
||||
public void exportExcel(String clubId,
|
||||
String userState,
|
||||
String sex,
|
||||
HttpServletResponse response) throws IOException {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.unitname as unitName,
|
||||
u.userstate as userState,
|
||||
c.*,
|
||||
sc.clubName as clubName
|
||||
FROM
|
||||
club_user c
|
||||
INNER JOIN `vw_user` u ON u.id = c.userId
|
||||
LEFT JOIN sys_club sc ON c.clubId = sc.id
|
||||
$condition
|
||||
ORDER BY
|
||||
sc.clubName,
|
||||
CASE
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_PRESIDENT"') THEN 1
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_MEMBER"') THEN 5
|
||||
ELSE 99
|
||||
END
|
||||
""");
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(),
|
||||
RoleConstant.SCHOOL_UNION_ADMIN.name(),
|
||||
RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT);
|
||||
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class,
|
||||
Cnd.where("userId", "=", SecurityUtil.getUserId())
|
||||
.and("roleId", "=", sysRole.getId()));
|
||||
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
|
||||
cnd.and("c.clubId", "in", myClubId);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(clubId)) {
|
||||
cnd.andEX("c.clubId", "=", clubId);
|
||||
}
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.sex", "=", sex);
|
||||
|
||||
sql.setCondition(cnd);
|
||||
|
||||
List<NutMap> listMap = sysClubService.listMap(sql);
|
||||
for (NutMap nutMap : listMap) {
|
||||
List<String> list = JSONUtil.toList(nutMap.getString("roleCode"), String.class);
|
||||
String roleName = SysClubUserServiceImpl.convertRoleName(list);
|
||||
nutMap.put("roleName", roleName);
|
||||
nutMap.put("roleCode", list);
|
||||
|
||||
}
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("协会名称", "clubName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
exportEntities.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所在单位", "unitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
||||
exportEntities.add(new ExcelExportEntity("职务", "roleName", 20));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, listMap);
|
||||
CommonDownloadUtil.download("社团人员明细.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.statistics")
|
||||
|
||||
@@ -13,5 +13,6 @@ public class ClubUserJoinPageForm extends PageForm {
|
||||
private String userName;
|
||||
private String unionId;
|
||||
private String unitId;
|
||||
private String clubId;
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
v-if="['SELECT'].includes(column.columnFormType)"
|
||||
v-model="pickerStates[column.columnCode + 'Picker']"
|
||||
position="bottom"
|
||||
get-container="body"
|
||||
>
|
||||
<template v-if="['DATETIME', 'DATE'].includes(column.columnType)">
|
||||
<van-datetime-picker
|
||||
|
||||
@@ -38,7 +38,7 @@ module.exports = {
|
||||
.table-column {
|
||||
display: flex;
|
||||
padding: 6px 0;
|
||||
align-items: center;
|
||||
/*align-items: center;*/
|
||||
}
|
||||
|
||||
.label {
|
||||
@@ -55,8 +55,8 @@ module.exports = {
|
||||
color: #555;
|
||||
font-size: 14px;
|
||||
flex-grow: 1; /* 动态占据剩余部分 */
|
||||
white-space: nowrap; /* 防止换行 */
|
||||
overflow: hidden; /* 隐藏溢出的部分 */
|
||||
text-overflow: ellipsis; /* 省略号 */
|
||||
/*white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;*/
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="file-preview-container" v-if="fileList && fileList.length > 0">
|
||||
<div class="file-item" v-for="item in fileList" :key="item.id">
|
||||
<img
|
||||
v-if="item.suffix === 'jpg' || item.suffix === 'png' || item.suffix === 'jpeg' || item.suffix === 'gif'"
|
||||
:src="item.thumbnail"
|
||||
@click.stop="$commonUtil.previewFile(item)"
|
||||
class="file-image"
|
||||
/>
|
||||
|
||||
<img
|
||||
v-else
|
||||
:src="$commonUtil.getFileItemShowIcon(item.suffix)"
|
||||
@click.stop="$commonUtil.previewFile(item)"
|
||||
class="file-image"
|
||||
/>
|
||||
|
||||
<div class="file-download" @click="$downLoad(item.downloadPath)">
|
||||
<i class="el-icon-download"></i>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="empty-container">
|
||||
<div class="empty-text">暂无</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
name: "H5Index",
|
||||
props: {
|
||||
files: {
|
||||
type: [String, Array],
|
||||
default: undefined,
|
||||
required: false
|
||||
},
|
||||
complete_result: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
files: {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
this.buildEchoFileObject(val)
|
||||
} else {
|
||||
this.fileList = []
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fileList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
buildEchoFileObject(val) {
|
||||
let ids = []
|
||||
if (this.complete_result) {
|
||||
if (Array.isArray(val)) {
|
||||
ids = val.map((item) => {
|
||||
if (item.response.data.includes("=")) {
|
||||
return item?.response?.data.substring(item?.response?.data.lastIndexOf("=") + 1)
|
||||
} else {
|
||||
return item?.response?.data
|
||||
}
|
||||
})
|
||||
} else {
|
||||
try {
|
||||
ids = JSON.parse(val).map((item) => {
|
||||
if (item.response.data.includes("=")) {
|
||||
return item?.response?.data.substring(item?.response?.data.lastIndexOf("=") + 1)
|
||||
} else {
|
||||
return item?.response?.data
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
this.fileList = []
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//那就是链接 没有直接存id的吧。。
|
||||
if (Array.isArray(val)) {
|
||||
ids = val.map((item) => {
|
||||
return item.substring(item.lastIndexOf("=") + 1)
|
||||
})
|
||||
} else {
|
||||
ids = val.split(",").map((item) => {
|
||||
return item.substring(item.lastIndexOf("=") + 1)
|
||||
})
|
||||
}
|
||||
}
|
||||
this.requestFullFile(ids)
|
||||
},
|
||||
|
||||
requestFullFile(ids) {
|
||||
this.$axios.post("/platform/sys/file/previewFileData", {ids: JSON.stringify(ids)}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.fileList = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.file-preview-container {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.file-preview-container .file-item {
|
||||
aspect-ratio: 1;
|
||||
position: relative;
|
||||
transition: all 300ms;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #f8f9fa;
|
||||
border: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.file-preview-container .file-item:active {
|
||||
background: #e9ecef;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.file-preview-container .file-item .file-image {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
object-fit: cover;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.file-preview-container .file-item .file-download {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: white;
|
||||
background-color: rgba(0, 0, 0, 0.7);
|
||||
border-radius: 0 0 8px 8px;
|
||||
font-size: 12px;
|
||||
padding: 0 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.empty-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 480px) {
|
||||
.file-preview-container {
|
||||
gap: 4px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.file-preview-container .file-item .file-image {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.file-preview-container .file-item .file-download {
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -258,6 +258,7 @@
|
||||
//挂载
|
||||
Vue.prototype.$moment = moment
|
||||
Vue.prototype.$businessTool = businessTool
|
||||
Vue.prototype.$commonUtil = commonUtil
|
||||
Vue.prototype.$auth = commonUtil.authService()
|
||||
Vue.prototype.$axios = commonUtil.axiosService()
|
||||
Vue.prototype.$downLoad = commonUtil.downLoadService.bind(commonUtil)
|
||||
@@ -277,6 +278,7 @@
|
||||
Vue.component("enum-tag", httpVueLoader("/components/plugins/sysEnum/EnumTag.vue?v=" + new Date().getTime()))
|
||||
Vue.component("table-list", httpVueLoader("/components/plugins/h5/TableList.vue?v=" + new Date().getTime()))
|
||||
Vue.component("table-column", httpVueLoader("/components/plugins/h5/TableColumn.vue?v=" + new Date().getTime()))
|
||||
Vue.component("file-preview", httpVueLoader("/components/plugins/sysFilePreview/H5Index.vue?v=" + new Date().getTime()))
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -153,6 +153,8 @@ layout("/layouts/platform.html"){
|
||||
this.$axios.post("/platform/club/join/apply/checkApplyClub", { clubId: row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$store.dispatch("pjaxRoute", "/platform/club/join/apply?clubId=" + row.id)
|
||||
} else {
|
||||
this.$message.warning(res.msg || "网络请求失败,请稍后重试!");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -31,6 +31,11 @@ layout("/layouts/platform.html"){
|
||||
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属协会:" v-if="$auth.hasRole('SYSADMIN')">
|
||||
<el-select v-model="pageForm.clubId" placeholder="请选择所属单位" filterable clearable style="width: 100%">
|
||||
<el-option v-for="item in clubList" :key="item.id" :label="item.clubName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
@@ -121,6 +126,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
clubList: [],
|
||||
showApprovalForm: false
|
||||
}
|
||||
},
|
||||
@@ -174,6 +180,7 @@ layout("/layouts/platform.html"){
|
||||
async created() {
|
||||
this.unitList = await this.$businessTool.listUnit()
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
this.clubList = await this.$businessTool.listClub()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -15,6 +15,12 @@ layout("/layouts/platform.html"){
|
||||
style="width: 100%"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="姓名:">
|
||||
<el-input placeholder="请输入姓名查询" clearable v-model="pageForm.userName"></el-input>
|
||||
</search-item>
|
||||
<search-item label="工号:">
|
||||
<el-input placeholder="请输入工号查询" clearable v-model="pageForm.loginName"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ const CLUB_FORM_TEMPLATE = {
|
||||
clubType: [{ required: true, message: "请选择协会类型", trigger: ["blur", "change"] }],
|
||||
concatPerson: [{ required: true, message: "请选择协会联系人", trigger: ["blur", "change"] }],
|
||||
foundTime: [{ required: true, message: "请选择成立时间", trigger: ["blur", "change"] }],
|
||||
due: [{ required: true, message: "请输入会费标准", trigger: ["blur", "change"] }],
|
||||
// due: [{ required: true, message: "请输入会费标准", trigger: ["blur", "change"] }],
|
||||
// establishReport: [{ required: true, message: "请上传申请成立报告", trigger: ["blur", "change"] }]
|
||||
rulesFile: [{ required: true, message: "请上传章程", trigger: ["blur", "change"] }],
|
||||
//manageFile: [{ required: true, message: "请上传经费来源及管理办法", trigger: ["blur", "change"] }],
|
||||
|
||||
@@ -35,7 +35,10 @@ layout("/layouts/platform.html"){
|
||||
<table-tool label="协会统计">
|
||||
<el-button @click="exportData" type="primary" size="small">导出全部统计数据</el-button>
|
||||
<el-button @click="exportUserData(null)" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])" type="primary" size="small">
|
||||
导出全部人员明细
|
||||
导出全部人员明细(zip)
|
||||
</el-button>
|
||||
<el-button @click="exportExcel(null)" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])" type="primary" size="small">
|
||||
导出全部人员明细(EXCEL)
|
||||
</el-button>
|
||||
<el-button @click="exportFiles(null)" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])" type="primary" size="small">
|
||||
导出全部上传资料
|
||||
@@ -159,6 +162,14 @@ layout("/layouts/platform.html"){
|
||||
const id = row === null ? "" : row.id
|
||||
this.$downLoad("/platform/club/statistics/exportFiles", { clubId: id })
|
||||
},
|
||||
exportExcel(){
|
||||
let params = {
|
||||
clubId: this.pageForm.clubId,
|
||||
userState: this.pageForm.userState,
|
||||
sex: this.pageForm.sex
|
||||
}
|
||||
this.$downLoad("/platform/club/statistics/exportExcel", params)
|
||||
},
|
||||
async openView(row) {
|
||||
this.clickRow = row
|
||||
await this.userPageData()
|
||||
|
||||
@@ -53,7 +53,7 @@ const applyForm = {
|
||||
:name="index + ''"
|
||||
:title="activity.keyWord + (index + 1)"
|
||||
:key="index">
|
||||
<train-dynamic-form v-model="formData.mobileColumnsValue[index]"></train-dynamic-form>
|
||||
<train-dynamic-form v-model="formData.mobileColumnsValue[index]" :key="index"></train-dynamic-form>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</div>
|
||||
|
||||
@@ -49,7 +49,7 @@ layout("/layouts/platform_h5.html"){
|
||||
<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-html="row.courseInstructor"></span></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()]
|
||||
|
||||
@@ -91,19 +91,30 @@ layout("/layouts/platform_h5.html"){
|
||||
|
||||
<!-- 表单容器 -->
|
||||
<van-form @submit="doSubmit" ref="formRef" class="form-container">
|
||||
<!-- 协会信息 -->
|
||||
<van-cell-group title="协会信息" class="form-section">
|
||||
<van-field
|
||||
:rules="[{ required: true }]"
|
||||
v-model="formData.clubName"
|
||||
label="协会"
|
||||
placeholder="请选择协会"
|
||||
placeholder="点击选择协会"
|
||||
required
|
||||
is-link
|
||||
readonly
|
||||
@click="showClubPopup = true"
|
||||
class="club-field"
|
||||
></van-field>
|
||||
border="false"
|
||||
>
|
||||
<template #right-icon>
|
||||
<van-button
|
||||
type="info"
|
||||
size="small"
|
||||
style="margin-right: -4px;"
|
||||
@click.stop.prevent="onOpen(formData.clubId)"
|
||||
:disabled="!formData.clubId"
|
||||
>查看
|
||||
</van-button>
|
||||
</template>
|
||||
</van-field>
|
||||
|
||||
<van-popup v-model:show="showClubPopup" position="bottom">
|
||||
<van-picker
|
||||
show-toolbar
|
||||
@@ -195,15 +206,27 @@ layout("/layouts/platform_h5.html"){
|
||||
<van-button round block type="info">提交申请</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
<van-popup :style="{ height: '100%',width: '100%'}" position="right" safe-area-inset-bottom v-model="viewShow">
|
||||
<van-sticky>
|
||||
<van-nav-bar @click-left="viewShow = false" left-arrow left-text="返回" title="详细信息"></van-nav-bar>
|
||||
</van-sticky>
|
||||
<div style="height: calc(100vh - 44px); overflow-y: auto">
|
||||
<info ref="infoRef"></info>
|
||||
</div>
|
||||
</van-popup>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../common/clubInfo.js'){}#-->
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
components: {},
|
||||
components: {
|
||||
info: clubInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
viewShow: false,
|
||||
formData: {
|
||||
clubId: "",
|
||||
clubName: "",
|
||||
@@ -230,6 +253,12 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(clubId) {
|
||||
this.viewShow = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.infoRef.onOpen(clubId)
|
||||
})
|
||||
},
|
||||
onClubConfirm(value, index) {
|
||||
this.formData.clubId = this.clubOptions[index].id;
|
||||
this.formData.clubName = value;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
const clubInfo = {
|
||||
template:
|
||||
/*language=HTML*/
|
||||
`
|
||||
<div>
|
||||
<van-cell-group>
|
||||
<!-- <van-cell>-->
|
||||
<!-- <div slot="title" class="font-size4 bold">-->
|
||||
<!-- 协会信息-->
|
||||
<!-- </div>-->
|
||||
<!-- </van-cell>-->
|
||||
<van-cell title="协会名称">{{ viewData.clubName }}</van-cell>
|
||||
<van-cell title="成立时间">{{ viewData.foundTime }}</van-cell>
|
||||
<van-cell title="协会编码">{{ viewData.clubCode }}</van-cell>
|
||||
<van-cell title="协会类型">{{ viewData.typeName }}</van-cell>
|
||||
<van-cell title="发起人">{{ viewData.sponsorName }}</van-cell>
|
||||
<van-cell title="会费标准">{{ viewData.due }}</van-cell>
|
||||
<van-cell title="当前人数">{{ viewData.currentPeopleNum }}</van-cell>
|
||||
<van-cell class="more-text" title="协会介绍">
|
||||
<div v-html="viewData.introduce"></div>
|
||||
</van-cell>
|
||||
<van-cell class="more-text" title="协会宗旨">
|
||||
<div v-html="viewData.purpose"></div>
|
||||
</van-cell>
|
||||
|
||||
<van-cell class="more-text" title="协会章程" v-if="viewData.rulesFile">
|
||||
<file-preview :files="viewData.rulesFile" complete_result></file-preview>
|
||||
</van-cell>
|
||||
<van-cell class="more-text" title="年度活动计划" v-if="viewData.yearPlanFile">
|
||||
<file-preview :files="viewData.yearPlanFile" complete_result></file-preview>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
viewData: {},
|
||||
activeName: "first",
|
||||
isScrollNow: "0"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(id) {
|
||||
this.$axios.post("/platform/club/applyJoin/apply/findOne", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.more-text .van-field__label{
|
||||
width: 100%;
|
||||
}
|
||||
.more-text {
|
||||
display: inline-block;
|
||||
}
|
||||
.more-text .van-cell__value{
|
||||
text-align: left;
|
||||
}
|
||||
`
|
||||
}
|
||||
Reference in New Issue
Block a user