This commit is contained in:
Paidax
2025-06-04 15:27:27 +08:00
parent d046c3be5d
commit 2409b3ddfe
116 changed files with 12202 additions and 1804 deletions
@@ -22,4 +22,6 @@ public class RedisConstant {
//健步走小程序TOKEN
public final static String REDIS_KEY_WE_APP_ACCESS_TOKEN = "weapp:token:";
// 疗休养配置缓存
public final static String REDIS_KEY_THE_RAPY_RECU_CONFIG_CACHE = PLATFORM_REDIS_PREFIX + "theRapyRecuConfig:";
}
+67 -22
View File
@@ -1,10 +1,12 @@
package io.v.nutz.base.utils;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import io.v.nutz.base.enums.Env;
import io.v.nutz.web.commons.base.Globals;
import lombok.extern.slf4j.Slf4j;
@@ -15,7 +17,9 @@ import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zxy
@@ -73,36 +77,77 @@ public class MsgApi {
return;
}
String msgToken = getMsgToken();
NutMap map = new NutMap();
map.put("channel", String.join(",", channels));
//推送范围(1:普通模式;2:全体教师;3:全体学生;4:全体人员)
map.put("objScope", 1);
map.put("objIds", loginNameStr);
map.put("mtype", mtype);
map.put("sendStatus", 1);
map.put("title", title);
map.put("content", content);
map.put("imageUrl", imageUrl);
map.put("link", link);
List<String> loginNamesList = Arrays.stream(loginNameStr.split(",")).map(String::trim).filter(s -> !s.isEmpty()).toList();
HttpRequest request = HttpUtil.createPost(MSG_API)
.header("token", msgToken)
.body(Json.toJson(map));
JSONObject jsonObject = JSON.parseObject(request.execute().body());
int status = jsonObject.getInteger("code");
if (Lang.isNotEmpty(loginNamesList)) {
List<List<String>> splitList = ListUtil.split(loginNamesList, 100);
if (status == 200) {
log.info("发送成功>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
} else {
log.info("发送失败>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
throw new RuntimeException("Message sending failed with status code: " + status + ", Message: " + jsonObject.getString("message"));
for (List<String> sublist : splitList) {
// 获取token
String msgToken = getMsgToken();
// 封装发送消息的参数
NutMap map = createMessageMap(channels, sublist, mtype, title, content, imageUrl, link);
System.out.println(map);
// 发送请求
JSONObject jsonObject = sendRequest(msgToken, map);
// 判断发送结果
int status = jsonObject.getInteger("code");
if (status == 200) {
log.info("=================================================================================================发送成功: {}", jsonObject.toJSONString());
} else {
log.error("=================================================================================================发送失败: {}", jsonObject.toJSONString());
throw new RuntimeException("Message sending failed with status code: " + status + ", Message: " + jsonObject.getString("message"));
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 封装发送消息的参数
* @param channels
* @param loginNameList
* @param mtype
* @param title
* @param content
* @param imageUrl
* @param link
* @return
*/
private static NutMap createMessageMap(List<String> channels, List<String> loginNameList,
int mtype, String title, String content, String imageUrl, String link) {
NutMap map = new NutMap();
map.put("channel", String.join(",", channels));
//推送范围(1:普通模式;2:全体教师;3:全体学生;4:全体人员)
map.put("objScope", 1);
map.put("objIds", String.join(",", loginNameList));
map.put("mtype", mtype);
map.put("sendStatus", 1);
map.put("title", title);
map.put("content", content);
map.put("imageUrl", imageUrl);
map.put("link", link);
return map;
}
/**
* 发送请求
* @param msgToken
* @param map
* @return
*/
private static JSONObject sendRequest(String msgToken, NutMap map) {
HttpRequest request = HttpUtil.createPost(MSG_API)
.header("token", msgToken)
.body(Json.toJson(map));
return JSON.parseObject(request.execute().body());
}
/**
* 获取token
@@ -303,10 +303,10 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
userPatUpService.renewUserState();
// 修改不在人事库的人员,删除角色
// userPatUpService.deleteNotInSourceUser(true);
// userPatUpService.deleteNotInSourceUser(true);
//清除缓存
sysUserService.clearCache();
sysRoleService.clearCache();
// sysUserService.clearCache();
// sysRoleService.clearCache();
} else {
List<String> loginNameList = middleTables.stream().map(SourceChangeMiddleTable::getLoginname).toList();
@@ -529,7 +529,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
// 变更记录
List<NutMap> changeList = new ArrayList<>();
for (String fieldName : allowChangeFieldNames) {
if (allowChangeFieldNames.contains("retireDate") || allowChangeFieldNames.contains("welfareStopDate")) {
if (List.of("retireDate", "welfareStopDate").contains(fieldName)) {
continue;
}
memberCommonService.extractChange(newMap, sourceMap, fieldName, dictMap, changeList);
@@ -577,7 +577,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
NutMap sourceMap = Lang.obj2nutmap(user);
List<NutMap> changeList = new ArrayList<>();
for (String fieldName : allowChangeFieldNames) {
if (allowChangeFieldNames.contains("retireDate") || allowChangeFieldNames.contains("welfareStopDate")) {
if (List.of("retireDate", "welfareStopDate").contains(fieldName)) {
continue;
}
memberCommonService.extractChange(newMap, sourceMap, fieldName, dictMap, changeList);
@@ -97,6 +97,16 @@ public class ProposalConfig {
@ColDefine(type = ColType.TIMESTAMP)
private Date remindProposalCreatorDate;
@Column
@Comment("开始撰写时间")
@ColDefine(type = ColType.DATETIME)
private Date startWriteTime;
@Column
@Comment("结束撰写时间")
@ColDefine(type = ColType.DATETIME)
private Date endWriteTime;
@One(field = "masterUnitConfigId")
private ProposalReplyConfig masterUnitConfig;
@@ -183,7 +183,6 @@ public class MemberApplyBranchUnionAuditController {
String content = "尊敬的%s老师,您已正式成为杭医工会会员,会员关系在%s,欢迎您的加入!"
.formatted(user.getUsername(), union.getUnionname());
System.out.println(content);
sysUserService.deleteCacheAndUpdate(record.getUserId());
msgApi.sendMsg(List.of("DingTalk"), record.getLoginname(), 1, "入会结果通知", content, "", "");
} else {
// 杭州医学院,分工会拒绝接收,还要去创建校工会的审核任务
@@ -82,6 +82,11 @@ public class MemberApplyController {
@RequiresPermissions("member.apply.submit")
@SLog(tag = "会员入会申请", msg = "保存申请")
public Object doSave(MemberApplyRecord record){
if (record.getPersonType().contains("劳务派遣")) {
return Result.error("当前暂未开放劳务派遣教工申请,请您及时关注校工会通知!");
}
record.setMember(true);
record.setUserId(ShiroUtil.getUserId());
// 变更来源 个人
@@ -105,6 +110,10 @@ public class MemberApplyController {
@SLog(tag = "会员入会申请", msg = "提交申请")
public Object doSubmit(MemberApplyRecord record){
if (record.getPersonType().contains("劳务派遣")) {
return Result.error("当前暂未开放劳务派遣教工申请,请您及时关注校工会通知!");
}
int count = dao.count(Sys_user_role.class, Cnd.where("userId", "=", record.getUserId()).and("roleId", "=", Roles.MEMBER));
if (count > 0) {
return Result.error("您已经是会员,请勿重复申请");
@@ -414,7 +414,7 @@ public class MemberChangeManageController {
// 杭医特有他们有一个福利享受截止时间在这个时间之前的退休人员也需要享受福利
Sql welfareSql = Sqls.create("select id from sys_user where welfareStopTime < CURDATE() and userState = '退休'");
Sql welfareSql = Sqls.create("select id from sys_user where welfareStopDate > CURDATE() and userState = '退休'");
welfareSql.setCallback(Sqls.callback.strList());
dao.execute(welfareSql);
ids.addAll(welfareSql.getList(String.class));
@@ -73,13 +73,14 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
if ("退休".equals(middleTable.getUserState())) {
middleTable.setMember(0);
middleTable.setIsExitActivityMemberScope(true);
if (DateUtil.parseDate(middleTable.getWelfareStopDate()).isAfter(DateUtil.date())) {
middleTable.setWelfareMember(1);
} else {
middleTable.setWelfareMember(0);
}
middleTable.setWelfareMember(0);
// if (middleTable.getWelfareStopDate() != null) {
// if (DateUtil.parseDate(middleTable.getWelfareStopDate()).isAfter(DateUtil.date())) {
// middleTable.setWelfareMember(1);
// } else {
// middleTable.setWelfareMember(0);
// }
// }
}
// 记录当前操作的时间用于后续区分短信通知
@@ -269,10 +270,13 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
*/
@Override
public void sendMsgToNewTeacher(SourceChangeMiddleTable middleTable) {
String context = "尊敬的%s老师,欢迎您加入杭州医学院大家庭,请您点击此条信息或登录“智慧工会”平台申请成为杭医工会会员!"
.formatted(middleTable.getUsername());
String link = Globals.AppDomain + "/platform/member/apply/submit/h5";
msgApi.sendMsg(List.of("DingTalk"), middleTable.getLoginname(), 2, "入会邀请", context, "", link);
if (middleTable.getPersonType().contains("劳务派遣") || middleTable.getUserState().contains("退休")) {
return;
}
String context = "尊敬的%s老师,欢迎您加入杭州医学院大家庭,请您点击此条信息或登录“智慧工会”平台申请成为杭医工会会员!"
.formatted(middleTable.getUsername());
String link = Globals.AppDomain + "/platform/member/apply/submit/h5";
msgApi.sendMsg(List.of("DingTalk"), middleTable.getLoginname(), 2, "入会邀请", context, "", link);
}
@@ -6,7 +6,7 @@ import lombok.Data;
import java.util.Date;
/**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationJoinUserImportExcelMode
* @FileName io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationJoinUserImportExcelMode
* @Description: 参加人员导入excel mode
* @Author zxc
* @Date 2022/6/14:11:10
@@ -5,7 +5,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationSignUpMode
* @FileName io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationSignUpMode
* @Description: 线路创建模式
* @Author zxc
* @Date 2022/6/2:15:22
@@ -5,7 +5,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationProvinceType
* @FileName io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationProvinceType
* @Description: TODO
* @Author zxc
* @Date 2022/6/2:14:08
@@ -5,7 +5,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationSignUpMode
* @FileName io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationSignUpMode
* @Description: 报名模式
* @Author zxc
* @Date 2022/6/2:15:22
@@ -8,7 +8,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationType
* @FileName io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType
* @Description: 疗休养分类
* @Author zxc
* @Date 2022/6/2:14:02
@@ -36,7 +36,7 @@ public enum TheRapyRecuperationType {
/**
* 酒店
*/
provinceInHotel("目的地疗休养", 3, TheRapyRecuperationProvinceType.provinceIn.getValue(), "/assets/mobile/img/therapyRecuperation/lxs.png");
provinceInHotel("定点疗休养", 3, TheRapyRecuperationProvinceType.provinceIn.getValue(), "/assets/mobile/img/therapyRecuperation/lxs.png");
/**
* 学校自由组织
@@ -0,0 +1,412 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.analysis;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.result.Result;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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.*;
import java.util.stream.Collectors;
/**
* @version 1.0
* @Author zzr
* @nameTheRapyRecuperationAnnualAnalysisController
* @Date 2025/2/10 9:16
* @注释
*/
@IocBean
@At("/platform/theRapyRecuperation/annualAnalysis")
@Ok("json:full")
public class TheRapyRecuperationAnnualAnalysisController {
@Inject
private Dao dao;
@Inject
private TheRapyRecuperationLineService lineService;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/analysis/annualAnalysis.html")
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public void index() {
}
/**
* 获取年度出行人数线路数省内省外校工会组织线路数校省内校省外线路数
* @param year
* @param lineType
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public Object getNumData(@Param(value = "year", required = false) Integer year,
@Param(value = "lineType", required = false) String lineType){
// 对于嘉兴来说这一坨吊用没有直接去报名记录里边找线路
// Cnd cnd = Cnd.NEW();
// cnd.and("delFlag", "=", false);
// cnd.and("YEAR(selectTime)", "=", year);
// // 本年选择的所有线路
// List<TheRapyRecuperationLineUnionSelect> selectLineList = dao.query(TheRapyRecuperationLineUnionSelect.class, cnd);
// 获取选择线路表的id后面发现了报名表里有线路id不在线路表的情况这类人员要排除掉
Sql selectIdSql = Sqls.create("select id from the_rapy_recuperation_line_union_select");
selectIdSql.setCallback(Sqls.callback.strList());
dao.execute(selectIdSql);
List<String> selectIdList = selectIdSql.getList(String.class);
// 获取今年报名的所有人数,还要确保报名线路是属于上面选择线路的id
Sql sql = Sqls.create("""
SELECT
takePartInLineId
FROM
`the_rapy_recuperation_enroll`
WHERE
YEAR(signingUptime) = @thisYear
AND isNormal = 1
AND stateId = @stateId
AND takePartInLineId in (@selectIdList)
""");
sql.setParam("thisYear", year);
sql.setParam("stateId", TheRapyRecuperationState.PASS);
sql.setParam("selectIdList", selectIdList);
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
// 今年的报名记录
List<String> enrollTakePartLineIdList = sql.getList(String.class);
List<String> takePartInLineIdList = enrollTakePartLineIdList.stream().distinct().collect(Collectors.toList());
// 今年报名的线路
List<TheRapyRecuperationLineUnionSelect> selectLineList = dao.query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "in", takePartInLineIdList));
// 找出选择的线路详情,用于区分省内还是省外
List<String> lineIdList = selectLineList.stream().map(TheRapyRecuperationLineUnionSelect::getLineId).distinct().collect(Collectors.toList());
List<TheRapyRecuperationLine> lineList = dao.query(TheRapyRecuperationLine.class, Cnd.where("id", "in", lineIdList));
// 如果不是全部按搜索条件查询省内还是省外
if (StrUtil.isNotBlank(lineType) && !"全部".equals(lineType)) {
lineList = lineList.stream().filter(line -> line.getRegionalNature().equals(lineType)).collect(Collectors.toList());
List<String> lineTypeIdList = lineList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList());
selectLineList = selectLineList.stream().filter(v-> lineTypeIdList.contains(v.getLineId())).collect(Collectors.toList());
}
// 省内线路
List<TheRapyRecuperationLine> inLineList = lineList.stream().filter(line -> "省内".equals(line.getRegionalNature())).collect(Collectors.toList());
Set<String> inLineIds = inLineList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toSet());
// 选择省内的线路
List<String> selectInLineIds = selectLineList.stream().filter(v -> inLineIds.contains(v.getLineId()))
.map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList());
// 省外线路
List<TheRapyRecuperationLine> outLineList = lineList.stream().filter(line -> "省外".equals(line.getRegionalNature())).collect(Collectors.toList());
Set<String> outLineIds = outLineList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toSet());
// 选择省外的线路
List<String> selectOutLineIds = selectLineList.stream().filter(v -> outLineIds.contains(v.getLineId()))
.map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList());
// List<TheRapyRecuperationEnroll> enrollList = dao.query(TheRapyRecuperationEnroll.class, Cnd.where("YEAR(signingUptime)", "=", year).and("isNormal", "=", true));
// List<String> enrollTakePartLineIdList = enrollList.stream().map(TheRapyRecuperationEnroll::getTakePartInLineId).collect(Collectors.toList());
// 返回前端的数据展示
NutMap nutMap = NutMap.NEW();
// 总出行人数
int allNum = enrollTakePartLineIdList.size();
// 省内出行人数
int provinceNum = (int) enrollTakePartLineIdList.stream().filter(selectInLineIds::contains).count();
// 省外出行人数
int outProvinceNum = (int) enrollTakePartLineIdList.stream().filter(selectOutLineIds::contains).count();
nutMap.addv("allNum", allNum).addv("provinceNum", provinceNum).addv("outProvinceNum", outProvinceNum);
// 总线路数
int lineNum = selectLineList.size();
// 总省内
int inLineNum = selectInLineIds.size();
// 总省外
int outLineNum = selectOutLineIds.size();
nutMap.addv("lineNum", lineNum).addv("inLineNum", inLineNum).addv("outLineNum", outLineNum);
// 校工会组织线路
List<TheRapyRecuperationLineUnionSelect> schoolSelectLineList = selectLineList.stream().filter(v -> v.getSignUpMode() == 2).collect(Collectors.toList());
int schoolUnionLineNum = schoolSelectLineList.size();
// 校省内
int schoolInLineNum = (int) schoolSelectLineList.stream().filter(s -> inLineIds.contains(s.getLineId())).count();
// 校省外
int schoolOutLineNum = (int) schoolSelectLineList.stream().filter(s -> outLineIds.contains(s.getLineId())).count();
nutMap.addv("schoolUnionLineNum", schoolUnionLineNum).addv("schoolInLineNum", schoolInLineNum).addv("schoolOutLineNum", schoolOutLineNum);
// 分工会组织线路
List<TheRapyRecuperationLineUnionSelect> unionSelectLineList = selectLineList.stream().filter(v -> v.getSignUpMode() == 1).collect(Collectors.toList());
int unionLineNum = unionSelectLineList.size();
// 分省内
int unionInLineNum = (int) unionSelectLineList.stream().filter(s -> inLineIds.contains(s.getLineId())).count();
// 分省外
int unionOutLineNum = (int) unionSelectLineList.stream().filter(s -> outLineIds.contains(s.getLineId())).count();
nutMap.addv("unionLineNum", unionLineNum).addv("unionInLineNum", unionInLineNum).addv("unionOutLineNum", unionOutLineNum);
return Result.success().addData(nutMap);
}
/**
* 出行时间标段统计
* @param year
* @param lineType
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public Object getLotNum(@Param(value = "year", required = false) Integer year,
@Param(value = "lineType", required = false) String lineType){
if (year == null) {
year = DateUtil.thisYear();
}
List<TheRapyRecuperationLot> lotList = dao.query(TheRapyRecuperationLot.class, Cnd.NEW().asc("lotValue"));
Sql sql = Sqls.create("""
SELECT
enroll.*,
line.lotId AS lineLotId
FROM
the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(signingUpTime)", "=", year);
cnd.and("enroll.isNormal", "=", true);
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
if (StrUtil.isNotBlank(lineType) && !"全部".equals(lineType)) {
cnd.andEX("line.regionalNature", "=", lineType);
}
sql.setCondition(cnd);
List<NutMap> list = lineService.listMap(sql);
List<NutMap> resultMap = new ArrayList<>();
lotList.forEach(item -> {
NutMap map = NutMap.NEW();
int value = list.stream().filter(v -> item.getId().equals(v.getString("lineLotId"))).collect(Collectors.toList()).size();
map.put("label", item.getLotName());
map.put("value", value);
resultMap.add(map);
});
return Result.success().addData(resultMap);
}
/**
* 出行年龄分布统计
* @param year
* @param lineType
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public Object getAgeNum(@Param(value = "year", required = false) Integer year,
@Param(value = "lineType", required = false) String lineType){
if (year == null) {
year = DateUtil.thisYear();
}
Map<String, Integer> result = new HashMap<>();
result.put("35岁以下", 0);
result.put("35至45岁", 0);
result.put("45岁以上", 0);
Sql sql = Sqls.create("""
SELECT
enroll.idCard
FROM
the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(signingUpTime)", "=", year);
cnd.and("enroll.isNormal", "=", true);
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.and("enroll.idCard", "is not", null);
cnd.groupBy("enroll.idCard");
if (StrUtil.isNotBlank(lineType) && !"全部".equals(lineType)) {
cnd.andEX("line.regionalNature", "=", lineType);
}
sql.setCondition(cnd);
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
List<String> idCardList = sql.getList(String.class);
for (String idCard : idCardList) {
if (StrUtil.isBlank(idCard)) {
continue;
}
int birthYear = getBirthYearFromIdCard(idCard);
if (birthYear == 0) {
continue;
}
int age = year - birthYear;
if (age < 35) {
result.put("35岁以下", result.get("35岁以下") + 1);
} else if (age <= 45) {
result.put("35至45岁", result.get("35至45岁") + 1);
} else {
result.put("45岁以上", result.get("45岁以上") + 1);
}
}
List<NutMap> list = new ArrayList<>();
result.forEach((k, v) -> {
NutMap map = NutMap.NEW();
map.put("label", k);
map.put("value", v);
list.add(map);
});
return Result.success().addData(list);
}
private static int getBirthYearFromIdCard(String idCard) {
String birthYearStr;
if (idCard.length() == 18) {
// 18位身份证号直接取第7到第10位作为出生年份
birthYearStr = idCard.substring(6, 10);
} else if (idCard.length() == 15) {
// 15位身份证号取第7到第8位作为出生年份的后两位 15位身份证号均为19xx年
birthYearStr = "19" + idCard.substring(6, 8);
} else {
return 0;
}
return Integer.parseInt(birthYearStr);
}
/**
* 获取线路出行人数和年龄统计数据
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public Object getLineTravelAndAgeData(@Param(value = "year", required = false) Integer year,
@Param(value = "lineType", required = false) String lineType){
Sql sql = Sqls.create("""
SELECT
us.id,
CONCAT(line.lineName,'(',DATE_FORMAT(us.playStartTime,'%m月%d'),'至',DATE_FORMAT(us.playEndTime,'%m月%d'),')') AS lineName,
su.unionname,
lot.lotName,
COUNT(enroll.id) AS takePartInLineNum,
SUM(CASE
WHEN @year - (CASE
WHEN LENGTH(enroll.idCard) = 18 THEN CAST(SUBSTR(enroll.idCard, 7, 4) AS UNSIGNED)
WHEN LENGTH(enroll.idCard) = 15 THEN 1900 + CAST(SUBSTR(enroll.idCard, 7, 2) AS UNSIGNED)
ELSE NULL
END) < 35 THEN 1 ELSE 0 END) AS underThirtyFive,
SUM(CASE
WHEN @year - (CASE
WHEN LENGTH(enroll.idCard) = 18 THEN CAST(SUBSTR(enroll.idCard, 7, 4) AS UNSIGNED)
WHEN LENGTH(enroll.idCard) = 15 THEN 1900 + CAST(SUBSTR(enroll.idCard, 7, 2) AS UNSIGNED)
ELSE NULL
END) BETWEEN 35 AND 45 THEN 1 ELSE 0 END) AS thirtyFiveToFortyFive,
SUM(CASE
WHEN @year - (CASE
WHEN LENGTH(enroll.idCard) = 18 THEN CAST(SUBSTR(enroll.idCard, 7, 4) AS UNSIGNED)
WHEN LENGTH(enroll.idCard) = 15 THEN 1900 + CAST(SUBSTR(enroll.idCard, 7, 2) AS UNSIGNED)
ELSE NULL
END) > 45 THEN 1 ELSE 0 END) AS aboveFortyFive
FROM
the_rapy_recuperation_line_union_select us
LEFT JOIN the_rapy_recuperation_line line ON us.lineId = line.id
LEFT JOIN the_rapy_recuperation_enroll enroll ON enroll.takePartInLineId = us.id
LEFT JOIN the_rapy_recuperation_lot lot ON lot.id = line.lotId
LEFT JOIN sys_union su ON su.id = us.unionId
$condition
""").setParam("year", year == null ? DateUtil.thisYear() : year);
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(us.selectTime)", "=", year);
cnd.and("enroll.isNormal", "=", true);
cnd.and("us.`enable`", "=", true);
cnd.groupBy("us.id");
if (StrUtil.isNotBlank(lineType) && !"全部".equals(lineType)) {
cnd.andEX("line.regionalNature", "=", lineType);
}
sql.setCondition(cnd);
List<NutMap> list = lineService.listMap(sql);
NutMap result = NutMap.NEW();
// 柱状图
List<NutMap> uvData = list.stream().map(v -> {
NutMap map = NutMap.NEW();
map.put("lineName", v.getString("lineName"));
map.put("value", v.getInt("takePartInLineNum"));
return map;
}).sorted(Comparator.comparing(v -> v.getString("lineName"))).collect(Collectors.toList());
// 折线图
List<NutMap> underThirtyFiveList = list.stream().map(v -> {
NutMap map = NutMap.NEW();
map.put("lineName", v.getString("lineName"));
map.put("count", v.getInt("underThirtyFive"));
map.put("name", "35岁以下");
return map;
}).collect(Collectors.toList());
List<NutMap> thirtyFiveToFortyFiveList = list.stream().map(v -> {
NutMap map = NutMap.NEW();
map.put("lineName", v.getString("lineName"));
map.put("count", v.getInt("thirtyFiveToFortyFive"));
map.put("name", "35至45岁");
return map;
}).collect(Collectors.toList());
List<NutMap> aboveFortyFiveList = list.stream().map(v -> {
NutMap map = NutMap.NEW();
map.put("lineName", v.getString("lineName"));
map.put("count", v.getInt("aboveFortyFive"));
map.put("name", "45岁以上");
return map;
}).collect(Collectors.toList());
underThirtyFiveList.addAll(thirtyFiveToFortyFiveList);
underThirtyFiveList.addAll(aboveFortyFiveList);
List<NutMap> collect = underThirtyFiveList.stream().sorted(Comparator.comparing(v -> v.getString("lineName"))).collect(Collectors.toList());
result.put("uvData", uvData);
result.put("transformData", collect);
return Result.success().addData(result);
}
/**
* 获取分工会出行人数和年龄统计数据
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public Object getLineTravelAgeData(@Param(value = "year", required = false) Integer year,
@Param(value = "lineType", required = false) String lineType){
return Result.success().addData(null);
}
}
@@ -3,32 +3,37 @@ package io.v.nutz.zhgh.therapyRecuperation.controller.audit;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.RCSCloudAPI;
import io.v.nutz.base.model.AuditState;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.model.AuditState;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationAuditService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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.Daos;
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.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 org.nutz.trans.Trans;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -54,32 +59,62 @@ public class TheRapyRecuperationAuditController {
@Inject
private Dao dao;
@Inject
private MsgApi msgApi;
@At
@ViReturn
public Object getXlByUnion(@Param(value = "state", required = false) Integer state,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "year", required = false) String year,
@Param(value = "signUpMode", required = false) Integer signUpMode) {
@RequiresAuthentication
public Object getXlByUnion(Integer state, String unionId, String regionalNature, String year,String endYear, Integer signUpMode) {
List<NutMap> xlByUnion = auditService.getXlByUnion(state, unionId, regionalNature, year, signUpMode);
List<NutMap> xlByUnion = auditService.getXlByUnion(state, unionId, regionalNature, year,endYear, signUpMode);
return xlByUnion;
}
@At
@ViReturn
@RequiresAuthentication
public Object getXlByUnionAudit(String unionId,String regionalNature, String year, Integer signUpMode) {
Sql sql = Sqls.create("""
SELECT
line.id,
line.lineName,
line.regionalNature,
ts.id as selectId,
ts.playStartTime,
ts.playEndTime
FROM
the_rapy_recuperation_line_union_select ts
LEFT JOIN the_rapy_recuperation_line line ON line.id = ts.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
if (ShiroUtil.hasAnyRoles("sysadmin,A06")){
cnd.andEX("ts.unionId", "=", unionId);
} else {
cnd.and("ts.unionId", "=", vi.getUnionId());
}
cnd.andEX("YEAR(ts.selectTime)","=",year);
cnd.andEX("line.regionalNature","=",regionalNature);
cnd.andEX("line.signUpMode","=",signUpMode);
cnd.groupBy("line.id");
sql.setCondition(cnd);
return auditService.listMap(sql);
}
@At
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyAudit")
public Object pageData(PageForm pageForm, @Param(value = "year", required = false) String year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "state", required = false) String state,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "isAudit", required = false) String isAudit,
@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "lotId", required = false) String lotId) {
public Object pageData(PageForm pageForm, String year, String unionId,
String unitId, String state, String takePartInLineId,
String isAudit, String regionalNature, String lotId,
String selectId) {
Sql sql = Sqls.create("""
SELECT
enroll.*,
@@ -89,6 +124,7 @@ public class TheRapyRecuperationAuditController {
'教职工' userNature,
state.stateColor,
state.stateName,
CONCAT(DATE_FORMAT(lineu.playStartTime,'%m月%d日'),'-',DATE_FORMAT(lineu.playEndTime,'%m月%d日')) AS linePlayTime,
IF
( enroll.takePartInUnionId != enroll.selfUnionId, TRUE, FALSE ) isTransferIn,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily,
@@ -110,6 +146,7 @@ public class TheRapyRecuperationAuditController {
cnd.andEX("enroll.takePartInLineId", "=", takePartInLineId);
cnd.andEX("enroll.isNormal", "=", true);
cnd.andEX("lineu.signUpMode", "=", 1);
cnd.andEX("lineu.id", "=", selectId);
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
}
@@ -120,7 +157,7 @@ public class TheRapyRecuperationAuditController {
} else if (state.equals("2")) {
cnd.andEX("enroll.takePartInUnionId", "!=", Vi.getUnionId());
cnd.andEX("enroll.selfUnionId", "=", Vi.getUnionId());
} else {
} else if (state.equals("3")){
cnd.andEX("enroll.selfUnionId", "!=", Vi.getUnionId());
cnd.andEX("enroll.takePartInUnionId", "=", Vi.getUnionId());
}
@@ -148,12 +185,16 @@ public class TheRapyRecuperationAuditController {
""".formatted(TheRapyRecuperationState.UNIT, vi.getUnionId(), TheRapyRecuperationState.LINEUNIT, vi.getUnionId())));
}
} else {
cnd.and(Cnd.exps("enroll.selfUnionId", "=", vi.getUnionId()).or("enroll.takePartInUnionId", "=", vi.getUnionId()));
//屏蔽了本工会选择其他工会线路的人员
// cnd.and(Cnd.exps("enroll.selfUnionId", "=", vi.getUnionId()).or("enroll.takePartInUnionId", "=", vi.getUnionId()));
cnd.and("enroll.takePartInUnionId", "=", vi.getUnionId());
}
cnd.desc("enroll.signingUptime");
cnd.desc("enroll.unitName");
// cnd.having(Cnd.where("isTransferIn","=",0));
sql.setCondition(cnd);
return auditService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
@@ -163,6 +204,7 @@ public class TheRapyRecuperationAuditController {
@At
@ViReturn
@RequiresAuthentication
public Object findOne(String id) {
NutMap one = auditService.findOne(id);
return one;
@@ -179,11 +221,9 @@ public class TheRapyRecuperationAuditController {
*/
@At
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyAudit")
public Object doAudit(@Param(value = "id", required = false) String id,
@Param(value = "flag", required = false) boolean flag,
@Param(value = "isTransferIn", required = false) boolean isTransferIn,
@Param(value = "auditOpinion", required = false) String auditOpinion) {
public Object doAudit(String id, boolean flag,Boolean adjustment, boolean isTransferIn, String auditOpinion) {
Trans.exec(() -> {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
Audit audit = new Audit();
@@ -219,8 +259,13 @@ public class TheRapyRecuperationAuditController {
enroll.setStateId(TheRapyRecuperationState.LINEUNITFAIL);
}
}
auditService.updateIgnoreNull(enroll);
//auditMsg(enroll.getStateId(), enroll.getLoginName(), enroll.getTakePartInLineId());
auditMsg(enroll.getStateId(), enroll.getLoginName(),adjustment, enroll.getTakePartInLineId());
if (adjustment){
// enroll.setNormal(false);
auditService.dao().clear(TheRapyRecuperationEnroll.class,Cnd.where("id","=",enroll.getId()));
}
});
return null;
}
@@ -233,9 +278,11 @@ public class TheRapyRecuperationAuditController {
*/
@At
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyAudit")
public Object doRecall(String id) {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
TheRapyRecuperationLineUnionSelect unionSelect = auditService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "=", enroll.getTakePartInLineId()));
if (enroll.getStateId().equals(TheRapyRecuperationState.UNITFAIL)) {
enroll.setStateId(TheRapyRecuperationState.UNIT);
enroll.setSelfUnionAuditId(null);
@@ -245,10 +292,12 @@ public class TheRapyRecuperationAuditController {
} else if (enroll.getStateId().equals(TheRapyRecuperationState.LINEUNITFAIL)) {
enroll.setStateId(TheRapyRecuperationState.LINEUNIT);
enroll.setSelfUnionAuditId(null);
} else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getSelfUnionId().equals(vi.getUnionId())) {
// } else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getSelfUnionId().equals(vi.getUnionId())) {
} else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getSelfUnionId().equals(unionSelect.getUnionId())) {
enroll.setStateId(TheRapyRecuperationState.UNIT);
enroll.setSelfUnionAuditId(null);
} else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getTakePartInUnionId().equals(vi.getUnionId())) {
// } else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getTakePartInUnionId().equals(vi.getUnionId())) {
} else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getTakePartInUnionId().equals(unionSelect.getUnionId())) {
enroll.setStateId(TheRapyRecuperationState.LINEUNIT);
enroll.setJoinLineUnionAuditId(null);
}
@@ -267,9 +316,10 @@ public class TheRapyRecuperationAuditController {
*/
@At
@ViReturn
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.TheRapyAudit")
public Object doOnekeyAudit(@Param(value = "ids", required = false) String[] ids,
@Param(value = "auditOpinion", required = false) String auditOpinion, boolean flag) {
public Object doOnekeyAudit(String[] ids, String auditOpinion, boolean flag,Boolean adjustment) {
Audit audit = new Audit();
audit.setAuditOpinion(auditOpinion);
audit.setAuditor(ShiroUtil.getUserId());
@@ -278,6 +328,7 @@ public class TheRapyRecuperationAuditController {
audit.setAuditTime(new Date());
audit.setAuditPass(flag);
Audit insert = auditService.insert(audit);
List<String> enrollIdList = new ArrayList<>();
for (String id : ids) {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
//如果状态等于分工会审核并且参加的线路分工会也是自己的工会就代表自己参加自己的工会线路
@@ -292,9 +343,14 @@ public class TheRapyRecuperationAuditController {
enroll.setStateId(flag ? TheRapyRecuperationState.PASS : TheRapyRecuperationState.LINEUNITFAIL);
enroll.setJoinLineUnionAuditId(insert.getId());
}
if (adjustment){
// enroll.setNormal(false);
enrollIdList.add(id);
}
auditService.updateIgnoreNull(enroll);
// auditMsg(enroll.getStateId(), enroll.getLoginName(), enroll.getTakePartInLineId());
auditMsg(enroll.getStateId(), enroll.getLoginName(),adjustment, enroll.getTakePartInLineId());
}
auditService.dao().clear(TheRapyRecuperationEnroll.class,Cnd.where("id","in",enrollIdList));
return null;
}
@@ -305,19 +361,20 @@ public class TheRapyRecuperationAuditController {
* @param loginName
* @param takePartInLineId
*/
private void auditMsg(Integer stateId,
String loginName,
String takePartInLineId) {
private void auditMsg(Integer stateId, String loginName,Boolean adjustment, String takePartInLineId) {
Sys_user user = auditService.dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName));
TheRapyRecuperationLine theRapyRecuperationLine = auditService.dao().fetch(TheRapyRecuperationLine.class, Cnd.where("id", "=", takePartInLineId));
TheRapyRecuperationLineUnionSelect unionSelect = auditService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "=", takePartInLineId));
TheRapyRecuperationLine theRapyRecuperationLine = auditService.dao().fetch(TheRapyRecuperationLine.class, Cnd.where("id", "=", unionSelect.getLineId()));
AuditState auditState = auditService.dao().fetch(AuditState.class, Cnd.where("stateId", "=", stateId));
if (stateId.equals(TheRapyRecuperationState.UNITFAIL)) {
RCSCloudAPI.sendTplSms("3a96eeb38ca7406aaf39dcf305507816", user.getMobile(), "@1@=" + user.getUsername() + "||@2@=" + theRapyRecuperationLine.getLineName() + "||@3@=" + auditState.getStateName() + "", "");
} else if (stateId.equals(TheRapyRecuperationState.LINEUNITFAIL)) {
RCSCloudAPI.sendTplSms("3a96eeb38ca7406aaf39dcf305507816", user.getMobile(), "@1@=" + user.getUsername() + "||@2@=" + theRapyRecuperationLine.getLineName() + "||@3@=" + auditState.getStateName() + "", "");
} else if (stateId.equals(TheRapyRecuperationState.PASS)) {
RCSCloudAPI.sendTplSms("3a96eeb38ca7406aaf39dcf305507816", user.getMobile(), "@1@=" + user.getUsername() + "||@2@=" + theRapyRecuperationLine.getLineName() + "||@3@=" + auditState.getStateName() + "", "");
String content = "【智慧工会】%s老师您好,您报名的%s线路因报名人数不足已取消,请尽快进入智慧工会重新选择线路。"
.formatted(user.getUsername(),theRapyRecuperationLine.getLineName());
if (stateId.equals(TheRapyRecuperationState.PASS)) {
content = "【智慧工会】%s老师您好,您报名的%s线路已组团成功,请按约定出行。"
.formatted(user.getUsername(), theRapyRecuperationLine.getLineName());
}
// msgApi.sendMsg(content,user.getLoginname(), MsgApi.DING_DING_TEMPLATE_ID);
}
@@ -328,6 +385,7 @@ public class TheRapyRecuperationAuditController {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getBmUserUnion() {
Sql sql = Sqls.create("""
SELECT
@@ -340,7 +398,8 @@ public class TheRapyRecuperationAuditController {
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) {
cnd.and("takePartInLineId", "IS NOT", null);
cnd.and(Cnd.exps("takePartInUnionId", "=", vi.getUnionId()).or("selfUnionId", "=", vi.getUnionId()));
// cnd.and(Cnd.exps("takePartInUnionId", "=", vi.getUnionId()).or("selfUnionId", "=", vi.getUnionId()));
cnd.and("selfUnionId", "=", vi.getUnionId());
}
cnd.groupBy("selfUnionId");
sql.setCondition(cnd);
@@ -357,13 +416,13 @@ public class TheRapyRecuperationAuditController {
*/
@At
@ViReturn
public Object getApplyNumAudit(@Param(value = "mode", required = false) String mode,
@Param(value = "isAudit", required = false) String isAudit,
@Param(value = "year", required = false) Integer year) {
@RequiresAuthentication
public Object getApplyNumAudit(String takePartInLineId,String mode, String isAudit, Integer year,String selectId) {
String unionId = Vi.getUnionId();
Sql sql = Sqls.create("""
SELECT
COUNT( 1 )
COUNT(1) as signUpNum,
IFNULL(sum(familyNumber),0) as familyNumber
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
@@ -380,13 +439,16 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("takePartInLineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(mode)) {
cnd1.and("stateId", "=", TheRapyRecuperationState.PASS);
}
if (StrUtil.isNotBlank(selectId)) cnd1.and("lineu.id","=",selectId);
sql.setCondition(cnd1);
int count1 = auditService.count(sql);
NutMap map = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
int count1 = Integer.parseInt(String.valueOf(map.getOrDefault("signUpNum", 0))) + Integer.parseInt(String.valueOf(map.getOrDefault("familyNumber",0)));
//本工会人员其他路线
Cnd cnd2 = Cnd.NEW();
@@ -394,13 +456,16 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("takePartInLineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(mode)) {
cnd2.and("stateId", "=", TheRapyRecuperationState.PASS);
}
if (StrUtil.isNotBlank(selectId)) cnd2.and("lineu.id","=",selectId);
sql2.setCondition(cnd2);
int count2 = auditService.count(sql2);
NutMap map2 = (NutMap) Daos.query(dao, sql2.toString(), Sqls.callback.map());
int count2 = Integer.parseInt(String.valueOf(map2.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map2.getOrDefault("familyNumber",0)));
//其他工会人员选我线路
Cnd cnd3 = Cnd.NEW();
@@ -408,26 +473,32 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "!=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(mode)) {
cnd3.and("stateId", "=", TheRapyRecuperationState.PASS);
}
if (StrUtil.isNotBlank(selectId)) cnd3.and("lineu.id","=",selectId);
sql3.setCondition(cnd3);
int count3 = auditService.count(sql3);
NutMap map3 = (NutMap) Daos.query(dao, sql3.toString(), Sqls.callback.map());
int count3 = Integer.parseInt(String.valueOf(map3.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map3.getOrDefault("familyNumber",0)));
//选择校工会线路人员
Cnd cnd4 = Cnd.NEW();
cnd4.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 2);
if (StrUtil.isNotBlank(mode)) {
cnd4.and("stateId", "=", TheRapyRecuperationState.PASS);
}
if (StrUtil.isNotBlank(selectId)) cnd4.and("lineu.id","=",selectId);
sql4.setCondition(cnd4);
int count4 = auditService.count(sql4);
NutMap map4 = (NutMap) Daos.query(dao, sql4.toString(), Sqls.callback.map());
int count4 = Integer.parseInt(String.valueOf(map4.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map4.getOrDefault("familyNumber",0)));
return Map.of("count1", count1, "count2", count2, "count3", count3, "count4", count4);
}
@@ -436,26 +507,30 @@ public class TheRapyRecuperationAuditController {
//本公会人员自己线路
Cnd cnd1 = Cnd.NEW();
cnd1.and("takePartInUnionId", "=", unionId)
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null).
andEX("YEAR(signingUptime)", "=", year)
.and("stateId", ">", TheRapyRecuperationState.UNIT)
.andEX("signUpMode", "=", 1);
sql.setCondition(cnd1);
int count1 = auditService.count(sql);
//本工会人员其他路线
Cnd cnd2 = Cnd.NEW();
cnd2.and("takePartInUnionId", "!=", unionId)
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.and("stateId", ">", TheRapyRecuperationState.UNIT)
.andEX("signUpMode", "=", 1);
sql2.setCondition(cnd2);
int count2 = auditService.count(sql2);
if (StrUtil.isNotBlank(selectId)) cnd1.and("lineu.id","=",selectId);
sql.setCondition(cnd1);
NutMap map = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
int count1 = Integer.parseInt(String.valueOf(map.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map.getOrDefault("familyNumber",0)));
//本工会人员其他路线
// Cnd cnd2 = Cnd.NEW();
// cnd2.and("takePartInUnionId", "!=", unionId)
// .and("selfUnionId", "=", unionId)
// .and("isNormal", "=", true)
// .and("takePartInLineId", "is not", null)
// .andEX("YEAR(signingUptime)", "=", year)
// .and("stateId", ">", TheRapyRecuperationState.UNIT)
// .andEX("signUpMode", "=", 1);
// sql2.setCondition(cnd2);
// int count2 = auditService.count(sql2);
//其他工会人员选我线路
Cnd cnd3 = Cnd.NEW();
@@ -463,13 +538,18 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "!=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.and("stateId", ">", TheRapyRecuperationState.LINEUNIT)
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(selectId)) cnd3.and("lineu.id","=",selectId);
sql3.setCondition(cnd3);
int count3 = auditService.count(sql3);
NutMap map3 = (NutMap) Daos.query(dao, sql3.toString(), Sqls.callback.map());
int count3 = Integer.parseInt(String.valueOf(map3.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map3.getOrDefault("familyNumber",0)));
return Map.of("count1", count1, "count2", count2, "count3", count3);
// return Map.of("count1", count1, "count2", count2, "count3", count3);
return Map.of("count1", count1, "count3", count3);
}
if ("false".equals(isAudit)) {
@@ -479,23 +559,27 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.and("stateId", "=", TheRapyRecuperationState.UNIT)
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(selectId)) cnd1.and("lineu.id","=",selectId);
sql.setCondition(cnd1);
int count1 = auditService.count(sql);
NutMap map = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
int count1 = Integer.parseInt(String.valueOf(map.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map.getOrDefault("familyNumber",0)));
//本工会人员其他路线
Cnd cnd2 = Cnd.NEW();
cnd2.and("takePartInUnionId", "!=", unionId)
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("YEAR(signingUptime)", "=", year)
.and("stateId", "=", TheRapyRecuperationState.UNIT)
.andEX("signUpMode", "=", 1);
sql2.setCondition(cnd2);
int count2 = auditService.count(sql2);
// Cnd cnd2 = Cnd.NEW();
// cnd2.and("takePartInUnionId", "!=", unionId)
// .and("selfUnionId", "=", unionId)
// .and("isNormal", "=", true)
// .and("takePartInLineId", "is not", null)
// .andEX("YEAR(signingUptime)", "=", year)
// .and("stateId", "=", TheRapyRecuperationState.UNIT)
// .andEX("signUpMode", "=", 1);
// sql2.setCondition(cnd2);
// int count2 = auditService.count(sql2);
//其他工会人员选我线路
Cnd cnd3 = Cnd.NEW();
@@ -503,12 +587,17 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "!=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.and("stateId", "=", TheRapyRecuperationState.LINEUNIT)
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(selectId)) cnd3.and("lineu.id","=",selectId);
sql3.setCondition(cnd3);
int count3 = auditService.count(sql3);
return Map.of("count1", count1, "count2", count2, "count3", count3);
NutMap map3 = (NutMap) Daos.query(dao, sql3.toString(), Sqls.callback.map());
int count3 = Integer.parseInt(String.valueOf(map3.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map3.getOrDefault("familyNumber",0)));
// return Map.of("count1", count1, "count2", count2, "count3", count3);
return Map.of("count1", count1, "count3", count3);
}
@@ -1,5 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.audit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
@@ -8,23 +10,29 @@ import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationAuditService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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;
import org.nutz.ioc.aop.Aop;
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 org.nutz.trans.Trans;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@IocBean
@At("/platform/theRapyRecuperation/TheRapyXghAudit")
@@ -53,16 +61,70 @@ public class TheRapyRecuperationXghAuditController {
@At
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object pageData(PageForm pageForm,
@Param(value = "year", required = false) String year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "state", required = false) String state,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "isAudit", required = false) String isAudit,
@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "lotId", required = false) String lotId) {
public Object pageData(PageForm pageForm, String year, String unionId,
String unitId, String state, String takePartInLineId,
String isAudit, String regionalNature, String lotId,
String selectId) {
Sql sql = Sqls.create("""
SELECT
enroll.*,
line.lineName,
line.id as lineId,
line.regionalNature,
'教职工' userNature,
state.stateColor,
state.stateName,
CONCAT(DATE_FORMAT(rs.playStartTime,'%m月%d日'),'-',DATE_FORMAT(rs.playEndTime,'%m月%d日')) AS linePlayTime,
IF
( enroll.takePartInUnionId != enroll.selfUnionId, TRUE, FALSE ) isTransferIn,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) num
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN `the_rapy_recuperation_line_union_select` rs ON rs.id = enroll.takePartInLineId
LEFT JOIN `the_rapy_recuperation_line` line on line.id=rs.lineId
LEFT JOIN audit_state state ON state.stateId = enroll.stateId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("line.lotId", "=", lotId);
cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.andEX("YEAR(enroll.signingUptime)", "=", year);
cnd.andEX("enroll.selfUnionId", "=", unionId);
cnd.and("enroll.takePartInLineId", "is not", null);
cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("enroll.isNormal", "=", true);
cnd.andEX("rs.signUpMode", "=", "2");
cnd.andEX("rs.id", "=", selectId);
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
}
if (Strings.isNotBlank(isAudit)) {
if (isAudit.equals("true")) {
cnd.and(new Static("enroll.stateId = %s".formatted(TheRapyRecuperationState.PASS)));
} else {
cnd.and(new Static("enroll.stateId = %s".formatted(TheRapyRecuperationState.SCHOOL)));
}
} else {
cnd.and(new Static("( enroll.stateId = %s OR enroll.stateId = %s OR enroll.stateId = %s)".
formatted(TheRapyRecuperationState.SCHOOL, TheRapyRecuperationState.SCHOOLFAIL, TheRapyRecuperationState.PASS)));
}
cnd.desc("enroll.signingUptime");
cnd.desc("enroll.unitName");
sql.setCondition(cnd);
return auditService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object getLineNumber(PageForm pageForm, String year, String unionId,
String unitId, String state, String takePartInLineId,
String isAudit, String regionalNature, String lotId, String selectId) {
Sql sql = Sqls.create("""
SELECT
enroll.*,
@@ -93,6 +155,7 @@ public class TheRapyRecuperationXghAuditController {
cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("enroll.isNormal", "=", true);
cnd.andEX("rs.signUpMode", "=", "2");
cnd.andEX("rs.id", "=", selectId);
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
}
@@ -109,7 +172,9 @@ public class TheRapyRecuperationXghAuditController {
cnd.desc("enroll.signingUptime");
cnd.desc("enroll.unitName");
sql.setCondition(cnd);
return auditService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
List<NutMap> nutMaps = auditService.listMap(sql);
int familyNumber = nutMaps.stream().filter(o -> StrUtil.isNotBlank(o.getString("familyNumber"))).mapToInt(o -> o.getInt("familyNumber")).sum();
return familyNumber + nutMaps.size();
}
@@ -124,11 +189,9 @@ public class TheRapyRecuperationXghAuditController {
*/
@At
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object doAudit(@Param(value = "id", required = false) String id,
@Param(value = "flag", required = false) boolean flag,
@Param(value = "isTransferIn", required = false) boolean isTransferIn,
@Param(value = "auditOpinion", required = false) String auditOpinion) {
public Object doAudit(String id, boolean flag, boolean isTransferIn, String auditOpinion, Boolean adjustment) {
Trans.exec(() -> {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
Audit audit = new Audit();
@@ -147,6 +210,11 @@ public class TheRapyRecuperationXghAuditController {
enroll.setStateId(TheRapyRecuperationState.SCHOOLFAIL);
}
auditService.updateIgnoreNull(enroll);
auditService.schoolAudit(enroll.getStateId(), enroll.getLoginName(), adjustment, enroll.getTakePartInLineId());
if (adjustment) {
// enroll.setNormal(false);
auditService.dao().clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "=", enroll.getId()));
}
});
return null;
}
@@ -159,6 +227,7 @@ public class TheRapyRecuperationXghAuditController {
*/
@At
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object doRecall(String id) {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
@@ -178,10 +247,10 @@ public class TheRapyRecuperationXghAuditController {
*/
@At
@ViReturn
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object doOnekeyAudit(@Param(value = "ids", required = false) String[] ids,
@Param(value = "auditOpinion", required = false) String auditOpinion,
@Param(value = "flag", required = false) boolean flag) {
public Object doOnekeyAudit(String[] ids, String auditOpinion, boolean flag, Boolean adjustment) {
Audit audit = new Audit();
audit.setAuditOpinion(auditOpinion);
audit.setAuditor(ShiroUtil.getUserId());
@@ -191,12 +260,19 @@ public class TheRapyRecuperationXghAuditController {
audit.setAuditPass(flag);
Audit insert = auditService.insert(audit);
//List<TheRapyRecuperationEnroll> enrollList = auditService.dao().query(TheRapyRecuperationEnroll.class, Cnd.where("id", "in", ids));
List<String> enrollIdList = new ArrayList<>();
for (String id : ids) {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
enroll.setStateId(TheRapyRecuperationState.PASS);
enroll.setStateId(flag ? TheRapyRecuperationState.PASS : TheRapyRecuperationState.SCHOOLFAIL);
enroll.setSchoolUnionAuditId(insert.getId());
auditService.updateIgnoreNull(enroll);
auditService.schoolAudit(enroll.getStateId(), enroll.getLoginName(), adjustment, enroll.getTakePartInLineId());
if (adjustment) {
// enroll.setNormal(false);
enrollIdList.add(id);
}
}
auditService.dao().clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "in", enrollIdList));
return null;
}
@@ -208,19 +284,61 @@ public class TheRapyRecuperationXghAuditController {
*/
@At
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object getXghLine() {
public Object getXghLine(Integer year,String regionalNature) {
// Sql sql = Sqls.create("""
// SELECT
// line.*,
// un.unionname
// FROM
// `the_rapy_recuperation_enroll` enroll
// LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
// LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
// LEFT JOIN sys_union un ON un.id = enroll.takePartInUnionId
// where line.signUpMode='2' and line.createMode='2'
// group by line.id
// """);
Sql sql = Sqls.create("""
SELECT
line.*,
un.unionname
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
the_rapy_recuperation_line_union_select lineu
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN sys_union un ON un.id = enroll.takePartInUnionId
where line.signUpMode='2' and line.createMode='2'
LEFT JOIN sys_union un ON un.id = lineu.unionId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(lineu.selectTime)","=",year);
if (StrUtil.isNotBlank(regionalNature) && !"全部".equals(regionalNature)){
cnd.and("line.regionalNature","=",regionalNature);
}
cnd.groupBy("line.id");
sql.setCondition(cnd);
return baseService.listMap(sql);
}
@At
@ViReturn
@RequiresAuthentication
public Object getLinePlayTimeByLineId(String lineId, Integer signUpMode, Integer year) {
List<TheRapyRecuperationLineUnionSelect> query = dao.query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "=", lineId)
.and("signUpMode", "=", signUpMode).and("YEAR(selectTime)", "=", year));
//.and("selectUserId", "=", ShiroUtil.getUserId()).and("unionId", "=", Vi.getUnionId()));
List<NutMap> nutMaps = new ArrayList<>();
query.forEach(v -> {
String startTime = DateUtil.formatChineseDate(v.getPlayStartTime(), false, false).substring(5);
String endTime = DateUtil.formatChineseDate(v.getPlayEndTime(), false, false).substring(5);
NutMap map = new NutMap();
map.setv("times", startTime + "-" + endTime);
map.setv("selectId", v.getId());
nutMaps.add(map);
});
return nutMaps;
}
}
@@ -11,20 +11,19 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.mobile.selfApplyUser.models.SelfApplyUser;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.baseManage.TheRapyRecuperationBaseManagerService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.nutz.aop.interceptor.ioc.TransAop;
@@ -50,7 +49,7 @@ import java.util.*;
import java.util.stream.Collectors;
/**
* @FileName io.v.nutz.therapyRecuperation.controller.baseManage.TheBaseManagerController
* @FileName io.v.nutz.zhgh.therapyRecuperation.controller.baseManage.TheBaseManagerController
* @Description: 疗休养基地管理
* @Author zzr
* @Date 2023/6/5
@@ -93,14 +92,8 @@ public class TheRapyRecuperationBaseManagerController {
@POST
@Ok("json:full")
@ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04", "lxygys"}, logical = Logical.OR)
public Object pageData(PageForm pageForm,
@Param(value = "year", required = false) Integer year,
@Param(value = "lotId", required = false) String lotId,
@Param(value = "baseName", required = false) String baseName,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "travelAgencyId", required = false) String travelAgencyId,
@Param(value = "regionalNature", required = false) String regionalNature) {
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, Integer year, String lotId, String baseName, String unionId, String travelAgencyId, String regionalNature) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
@@ -146,9 +139,6 @@ public class TheRapyRecuperationBaseManagerController {
if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"))) {
if (ShiroUtil.hasRole("H04")) {
cnd.and("tb.createUnionId", "=", Vi.getUnionId());
} else {
SelfApplyUser selfApplyUser = baseService.dao().fetch(SelfApplyUser.class, Cnd.where("mobile", "=", ShiroUtil.getPrincipalProperty("loginname")));
cnd.and("tb.id", "in", selfApplyUser.getBaseManagementIds());
}
} else {
cnd.andEX("tb.createUnionId", "=", unionId);
@@ -167,6 +157,7 @@ public class TheRapyRecuperationBaseManagerController {
@At("/openClosedBase/?")
@POST
@ViReturn
@RequiresAuthentication
public Object openClosedBase(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
@@ -184,6 +175,7 @@ public class TheRapyRecuperationBaseManagerController {
*/
@At("/selectBaseManageById/?")
@ViReturn
@RequiresAuthentication
public Object selectBaseManageById(String id) {
Assert.notBlank(id);
return dao.fetchLinks(dao.fetch(TheRapyRecuperationBaseManagement.class, id), "travelAgency");
@@ -199,8 +191,8 @@ public class TheRapyRecuperationBaseManagerController {
@At
@POST
@ViReturn
@SLog(type = "theRapyRecuperation", tag = "疗休养目的地管理", msg = "添加目的地")
@RequiresRoles(value = {"sysadmin", "A06", "H04", "lxygys"}, logical = Logical.OR)
@RequiresAuthentication
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object doSubmit(@Param("base") TheRapyRecuperationBaseManagement baseManagement) {
baseManagement.setOpBy((String) ShiroUtil.getPrincipalProperty("id"));
baseManagement.setCreateUnionId((String) ShiroUtil.getPrincipalProperty("unionid"));
@@ -218,7 +210,7 @@ public class TheRapyRecuperationBaseManagerController {
@At("/deleteBase/?")
@POST
@ViReturn
@SLog(type = "theRapyRecuperation", tag = "疗休养目的地管理", msg = "删除目的地")
@RequiresAuthentication
public Object deleteBase(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
@@ -235,10 +227,9 @@ public class TheRapyRecuperationBaseManagerController {
@At("/listAllBase")
@POST
@ViReturn
public Object listAllBase(@Param(value = "startYear", required = false) String startYear,
@Param(value = "endYear", required = false) String endYear,
@Param(value = "year", required = false) String year) {
Sql sql = Sqls.create("select * from `the_rapy_recuperation_base_management` tb $condition");
@RequiresAuthentication
public Object listAllBase(String startYear, String endYear, String year) {
Sql sql = Sqls.create("select * from `the_rapy_recuperation_base_management` tb left join `the_rapy_recuperation_lot` lot on lot.id=tb.lotId $condition");
CndPlus cnd = new CndPlus();
cnd.andEX("tb.`year`", ">=", startYear);
@@ -257,6 +248,7 @@ public class TheRapyRecuperationBaseManagerController {
@At("/selectBaseAllInfo")
@GET
@ViReturn
@RequiresAuthentication
public Object selectBaseAllInfo(@Param("id") String id) {
Assert.notBlank(id);
return theRapyRecuperationBaseManagerService.selectBaseAllInfo(id);
@@ -329,6 +321,7 @@ public class TheRapyRecuperationBaseManagerController {
*/
@At
@ViReturn
@RequiresAuthentication
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@Aop(TransAop.READ_COMMITTED)
public Object importBaseManager(TempFile file) {
@@ -12,18 +12,18 @@ import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.mobile.selfApplyUser.models.SelfApplyUser;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationLineCreateMode;
import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyTravelLineExcelMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.utils.ShiroUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.nutz.aop.interceptor.ioc.TransAop;
@@ -42,14 +42,11 @@ import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* @FileName io.v.nutz.therapyRecuperation.controller.basicManage.TheRapyRecuperationLineController
* @FileName io.v.nutz.zhgh.therapyRecuperation.controller.basicManage.TheRapyRecuperationLineController
* @Description: 疗休养线路管理
* @Author zxc
* @Date 2022/5/31:09:34
@@ -76,23 +73,17 @@ public class TheRapyRecuperationLineController {
* 页面数据
*
* @param pageForm 分页参数
* @param year 年度
* @return {@link Object}
*/
@At
@POST
@Ok("json:full")
@ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04", "lxygys"}, logical = Logical.OR)
public Object pageData(PageForm pageForm,
@Param(value = "year", required = false) Integer year,
@Param(value = "keywords", required = false) String keywords,
@Param(value = "travelAgencyId", required = false) String travelAgencyId,
@Param(value = "lineName", required = false) String lineName,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "lotId", required = false) String lotId) {
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, Integer startYear , Integer endYear, String keywords, String travelAgencyId, String lineName, String unionId, String lotId) {
Cnd cnd = Cnd.NEW();
cnd.andEX("line.`year`", "=", year);
cnd.andEX("line.`year`", ">=", startYear);
cnd.andEX("line.`year`", "<=", endYear);
cnd.andEX("line.travelAgencyId", "=", travelAgencyId);
cnd.andEX("line.lotId", "=", lotId);
cnd.and(Cnd.likeEX("line.lineName", lineName));
@@ -107,17 +98,25 @@ public class TheRapyRecuperationLineController {
if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"))) {
if (ShiroUtil.hasRole("H04")) {
cnd.and("line.createUnionId", "=", Vi.getUnionId());
} else {
SelfApplyUser selfApplyUser = lineService.dao().fetch(SelfApplyUser.class, Cnd.where("mobile", "=", ShiroUtil.getPrincipalProperty("loginname")));
cnd.and("line.id", "in", selfApplyUser.getLineIds());
}
} else {
cnd.andEX("line.createUnionId", "=", unionId);
}
cnd.asc("serialNumber");
cnd.desc("regionalNature").asc("serialNumber").asc("line.opBy");
return lineService.pageData(pageForm, cnd);
}
@At
@POST
@ViReturn
@RequiresAuthentication
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object getNo() {
Object serialNumber = dao.func2(TheRapyRecuperationLine.class, "max", "serialNumber");
serialNumber = Objects.requireNonNullElse(serialNumber, 0);
return Integer.parseInt(serialNumber.toString()) + 1;
}
/**
* 提交
*
@@ -127,7 +126,8 @@ public class TheRapyRecuperationLineController {
@At
@POST
@ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04", "lxygys"}, logical = Logical.OR)
@RequiresAuthentication
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object doSubmit(@Param("line") TheRapyRecuperationLine line) {
if (StrUtil.isBlank(line.getId())) {
if (lineService.count(Cnd.where("serialNumber", "=", line.getSerialNumber())) > 0) {
@@ -152,6 +152,7 @@ public class TheRapyRecuperationLineController {
@At("/openClosedLine/?")
@POST
@ViReturn
@RequiresAuthentication
public Object openClosedLine(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
@@ -169,6 +170,7 @@ public class TheRapyRecuperationLineController {
@At("/deleteLine/?")
@POST
@ViReturn
@RequiresAuthentication
public Object deleteLine(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
@@ -186,6 +188,7 @@ public class TheRapyRecuperationLineController {
*/
@At("/selectLineInfoById/?")
@ViReturn
@RequiresAuthentication
public Object selectLineInfoById(String id) {
Assert.notBlank(id);
return lineService.selectLineInfoById(id);
@@ -201,9 +204,8 @@ public class TheRapyRecuperationLineController {
*/
@At("/selectLineUser")
@ViReturn
public Object selectLineUser(PageForm pageForm,
@Param(value = "id", required = false) String id,
@Param(value = "unionId", required = false) String unionId) {
@RequiresAuthentication
public Object selectLineUser(PageForm pageForm, String id, String unionId) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
@@ -212,6 +214,7 @@ public class TheRapyRecuperationLineController {
@At("/getCreateMode")
@ViReturn
@RequiresAuthentication
public Object getCreateMode() {
boolean hasSchoolAdminRole = ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"));
if (hasSchoolAdminRole) {
@@ -228,6 +231,7 @@ public class TheRapyRecuperationLineController {
*/
@At("/viewUnionSelectTimeInfo/?")
@ViReturn
@RequiresAuthentication
public Object viewUnionSelectTimeInfo(String id) {
Assert.notBlank(id);
return lineService.viewUnionSelectTimeInfo(id);
@@ -240,6 +244,7 @@ public class TheRapyRecuperationLineController {
*/
@At
@ViReturn
@RequiresAuthentication
public Object hasAnyRoles(@Param("roles") String[] roles) {
boolean b = ShiroUtil.hasAnyRoles(roles);
return b;
@@ -267,6 +272,7 @@ public class TheRapyRecuperationLineController {
*/
@At
@ViReturn
@RequiresAuthentication
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@Aop(TransAop.READ_COMMITTED)
public Object travelLineImport(TempFile file) {
@@ -69,8 +69,7 @@ public class TheRapyRecuperationTravelAgencyController {
@POST
@ViReturn
@RequiresAuthentication
public Object pageData(PageForm pageForm, @Param(value = "year", required = false) Integer year,
@Param(value = "keywords", required = false) String keywords) {
public Object pageData(PageForm pageForm, Integer year, String keywords) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
if (StrUtil.isNotBlank(keywords)) {
@@ -158,7 +157,7 @@ public class TheRapyRecuperationTravelAgencyController {
@At("/selectTravelAgency")
@ViReturn
@RequiresAuthentication
public Object selectTravelAgency(@Param(value = "year", required = false) Integer year) {
public Object selectTravelAgency(Integer year) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
return travelAgencyService.selectAllTravelAgencyByYear(cnd);
@@ -175,8 +174,7 @@ public class TheRapyRecuperationTravelAgencyController {
@At("/selectTravelAgencyByYears")
@ViReturn
@RequiresAuthentication
public Object selectTravelAgencyByYears(@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear) {
public Object selectTravelAgencyByYears(Integer startYear, Integer endYear) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", ">=", startYear);
cnd.andEX("year", "<=", endYear);
@@ -246,7 +244,7 @@ public class TheRapyRecuperationTravelAgencyController {
List<TheRapyRecuperationTravelAgency> list = new ArrayList<>();
for (TheRapyTravelAgencyExcelMode travel : travelAgency) {
TheRapyRecuperationTravelAgency agency = new TheRapyRecuperationTravelAgency();
if (Strings.isNotBlank(map.get(travel.getTravelAgencyName()))) {
if (Strings.isNotBlank(map.get(travel.getTravelAgencyName()))){
agency.setId(map.get(travel.getTravelAgencyName()));
}
if (travel.getIsDisabled().equals("")) {
@@ -1,4 +1,4 @@
package io.v.nutz.zhgh.mobile.therapyRecuperation;
package io.v.nutz.zhgh.therapyRecuperation.controller.mobile;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.ioc.loader.annotation.IocBean;
@@ -64,4 +64,12 @@ public class MobileTheRapyRecuperationEnrollController {
public void myRecuperation() {
}
@At("/userSignInfo")
@Ok("beetl:/mobile/therapyRecuperation/userSignInfo.html")
@RequiresAuthentication
public void userSignInfo() {
}
}
@@ -2,6 +2,7 @@ package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
@@ -9,16 +10,13 @@ import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_config;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationCommonService;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.slog.annotation.SLog;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
@@ -28,13 +26,14 @@ import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.mvc.annotation.*;
import java.util.*;
import java.util.stream.Collectors;
/**
* @FileName io.v.nutz.therapyRecuperation.controller.process.TheRapyRecuperationEnroll
* @FileName io.v.nutz.zhgh.therapyRecuperation.controller.process.TheRapyRecuperationEnroll
* @Description: 疗休养报名报名
* @Author zxc
* @Date 2022/5/31:16:58
@@ -88,19 +87,54 @@ public class TheRapyRecuperationEnrollController {
@POST
@ViReturn
@RequiresAuthentication
public Object pageData(PageForm pageForm,
@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "theRapyRecuperationType", required = false) int theRapyRecuperationType,
@Param(value = "lineUnionType", required = false) Integer lineUnionType) {
public Object pageData(PageForm pageForm, Integer year, String unionId, int theRapyRecuperationType, Integer lineUnionType) {
return enrollService.enrollPageData(pageForm, year, unionId, theRapyRecuperationType, lineUnionType);
}
@At
@ViReturn
@SLog(type = "lxy", tag = "我的疗休养", msg = "疗休养评价")
public Object doEvaluate(TheRapyRecuperationEvaluate rapyRecuperationEvaluate) {
rapyRecuperationEvaluate.setUserId(ShiroUtil.getUserId());
rapyRecuperationEvaluate.setUserName(io.v.nutz.web.commons.utils.ShiroUtil.getPlatformUsername());
rapyRecuperationEvaluate.setLoginName(io.v.nutz.web.commons.utils.ShiroUtil.getPlatformLoginname());
rapyRecuperationEvaluate.setApplyDate(new Date());
enrollService.dao().insertOrUpdate(rapyRecuperationEvaluate);
return null;
}
@At
@ViReturn
public Object finOneEvaluate(String lineId) {
TheRapyRecuperationEvaluate fetch = enrollService.dao().fetch(TheRapyRecuperationEvaluate.class,
Cnd.where("userId", "=", ShiroUtil.getUserId())
.and("lineId", "=", lineId));
return fetch;
}
@At
@POST
@ViReturn
@RequiresAuthentication
public Object getSelectLineById(String lineId, String unionId, int theRapyRecuperationType, Integer lineUnionType) {
return enrollService.getSelectLineById(lineId, unionId, theRapyRecuperationType, lineUnionType);
}
@At
@POST
@ViReturn
@RequiresAuthentication
public Object openSignUser(String usId, String baseId, String searchKeyWord) {
return enrollService.openSignUser(usId, baseId, searchKeyWord);
}
//获取设置了公开线路的分工会
@At
@ViReturn
@RequiresAuthentication
public Object getTheRapyUnions(@Param(value = "year", required = false) Integer year) {
public Object getTheRapyUnions(Integer year) {
return enrollService.getTheRapyUnions(year);
}
@@ -118,18 +152,37 @@ public class TheRapyRecuperationEnrollController {
public Object doSignUpForLine(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) {
//省外的线路报名需要判断
// if (lineInfo.getRegionalNature().equals(TheRapyRecuperationProvinceType.provinceOut.getValue())) {
String schoolCode = Globals.schoolCode;
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "schoolCode"));
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Map<Boolean, String> validResult = new HashMap<>();
if ("zjxu".equals(schoolCode) || "zjxu".equals(config.getConfigValue())) {
if("zjxu".equals(config.getConfigValue())) {
validResult = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else {
} else if("zjiet".equals(config.getConfigValue())) {
validResult = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else if("zjnu".equals(config.getConfigValue())) {
validResult = enrollService.validSignUpInfoForZJNU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else if("hmc".equals(config.getConfigValue())) {
validResult = enrollService.validSignUpInfoForHMC((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
}
if (validResult.containsKey(false)) {
return Result.error(validResult.get(false));
}
// }
// 校验随行人的身份证信息
if (Lang.isNotEmpty(enrollInfo.getCompanionList())) {
for (TheRapyRecuperationEnrollCompanion companion : enrollInfo.getCompanionList()) {
if (StrUtil.isBlank(companion.getIdCard())) {
return Result.error("随行人身份证信息不能为空");
} else if (!IdcardUtil.isValidCard(companion.getIdCard())) {
return Result.error("随行人身份证信息有误");
}
if (companion.getAge() < 3 || companion.getAge() > 70) {
return Result.error("随行人年龄超过限制,请上传其他随行人");
}
}
}
if (StrUtil.isBlank(enrollInfo.getId())) {
enrollService.doSignUpForLine(enrollInfo);
} else {
@@ -149,10 +202,9 @@ public class TheRapyRecuperationEnrollController {
@ViReturn
@RequiresAuthentication
public Object doSignUpForTravelAgency(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) {
String schoolCode = Globals.schoolCode;
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "schoolCode"));
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Map<Boolean, String> resultMap = new HashMap<>();
if ("zjxu".equals(schoolCode) || "zjxu".equals(config.getConfigValue())) {
if("zjxu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else {
resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
@@ -179,10 +231,9 @@ public class TheRapyRecuperationEnrollController {
@ViReturn
@RequiresAuthentication
public Object doSignUpForBaseManagement(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) {
String schoolCode = Globals.schoolCode;
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "schoolCode"));
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Map<Boolean, String> resultMap = new HashMap<>();
if ("zjxu".equals(schoolCode) || "zjxu".equals(config.getConfigValue())) {
if("zjxu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else {
resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
@@ -191,6 +242,20 @@ public class TheRapyRecuperationEnrollController {
return Result.error(resultMap.get(false));
}
// 校验随行人的身份证信息
if (Lang.isNotEmpty(enrollInfo.getCompanionList())) {
for (TheRapyRecuperationEnrollCompanion companion : enrollInfo.getCompanionList()) {
if (StrUtil.isBlank(companion.getIdCard())) {
return Result.error("随行人身份证信息不能为空");
} else if (!IdcardUtil.isValidCard(companion.getIdCard())) {
return Result.error("随行人身份证信息有误");
}
if (companion.getAge() < 3 || companion.getAge() > 70) {
return Result.error("随行人年龄超过限制,请上传其他随行人");
}
}
}
if (StrUtil.isBlank(enrollInfo.getId())) {
enrollService.doSignUpForHotel(enrollInfo);
} else {
@@ -221,11 +286,7 @@ public class TheRapyRecuperationEnrollController {
@POST
@ViReturn
@RequiresAuthentication
public Object mySignUpPageData(PageForm pageForm,
@Param(value = "year", required = false) Integer year,
@Param(value = "theRapyRecuperationType", required = false) int theRapyRecuperationType,
@Param(value = "auditStateId", required = false) Integer auditStateId,
@Param(value = "signUpStateId", required = false) int signUpStateId) {
public Object mySignUpPageData(PageForm pageForm, Integer year, int theRapyRecuperationType, Integer auditStateId, int signUpStateId) {
Cnd cnd = Cnd.NEW();
cnd.and("e.loginName", "=", ShiroUtil.getPrincipalProperty("loginname"));
switch (signUpStateId) {
@@ -291,13 +352,20 @@ public class TheRapyRecuperationEnrollController {
return Result.error("线路信息不能为空");
}
String schoolCode = Globals.schoolCode;
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "schoolCode"));
if (StrUtil.isBlank(enrollInfo.getLoginName())){
enrollInfo.setLoginName(ShiroUtil.getPrincipalProperty("loginname").toString());
}
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Map<Boolean, String> resultMap = new HashMap<>();
if ("zjxu".equals(schoolCode) || "zjxu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else {
resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
if("zjxu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJXU(enrollInfo.getLoginName(), enrollInfo);
} else if("zjiet".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfo(enrollInfo.getLoginName(), enrollInfo);
} else if("zjnu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJNU(enrollInfo.getLoginName(), enrollInfo);
} else if ("hmc".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForHMC(enrollInfo.getLoginName(), enrollInfo);
}
if (resultMap.containsKey(false)) {
return Result.error(resultMap.get(false));
@@ -367,11 +435,8 @@ public class TheRapyRecuperationEnrollController {
@POST
@ViReturn
@RequiresAuthentication
public Object doFeedBack(@Param(value = "id", required = false) String id,
@Param(value = "evaluationForTravelAgency", required = false) String evaluationForTravelAgency,
@Param(value = "evaluationForLine", required = false) String evaluationForLine,
@Param(value = "evaluationForJourney", required = false) String evaluationForJourney,
@Param(value = "feedbackContent", required = false) String feedbackContent) {
public Object doFeedBack(String id, String evaluationForTravelAgency, String evaluationForLine,
String evaluationForJourney, String feedbackContent) {
Chain chain = Chain.make("evaluationForTravelAgency", evaluationForTravelAgency);
chain.add("evaluationForLine", evaluationForLine);
chain.add("evaluationForJourney", evaluationForJourney);
@@ -411,7 +476,7 @@ public class TheRapyRecuperationEnrollController {
/**
* 手机端线路介绍所有信息
*
* @param usId 行id
* @param usId 行id
* @param usUnionId 我们工会id
* @return {@link Object}
*/
@@ -419,8 +484,7 @@ public class TheRapyRecuperationEnrollController {
@GET
@ViReturn
@RequiresAuthentication
public Object selectLineAllInfo(@Param(value = "usId", required = false) String usId,
@Param(value = "usUnionId", required = false) String usUnionId) {
public Object selectLineAllInfo(@Param("usId") String usId, @Param("usUnionId") String usUnionId) {
Assert.notBlank(usId);
return enrollService.selectLineAllInfo(usId, usUnionId);
}
@@ -38,7 +38,7 @@ import java.util.List;
import java.util.Map;
/**
* @FileName io.v.nutz.therapyRecuperation.controller.process.TheRapyRecuperationEnrollJoinUserImport
* @FileName io.v.nutz.zhgh.therapyRecuperation.controller.process.TheRapyRecuperationEnrollJoinUserImport
* @Description: 导入参加人员
* @Author zxc
* @Date 2022/6/14:09:16
@@ -65,17 +65,14 @@ public class TheRapyRecuperationEnrollJoinUserImportController {
@At
@RequiresPermissions("theRapyRecuperation.joinUser.import")
@ViReturn
public Object selectLineAndTravelAgencyList(@Param(value = "year", required = false) Integer year,
@Param(value = "keyword", required = false) String keyword) {
public Object selectLineAndTravelAgencyList(Integer year, String keyword) {
return joinUserImportService.selectLineAndTravelAgencyList(year, keyword);
}
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@RequiresPermissions("theRapyRecuperation.joinUser.import")
public Object readExcel(@Param(value = "file", required = false) TempFile tempFile,
@Param(value = "lineId", required = false) String lineId,
@Param(value = "travelAgencyId", required = false) String travelAgencyId) {
public Object readExcel(@Param("file") TempFile tempFile, @Param("lineId") String lineId, @Param("travelAgencyId") String travelAgencyId) {
try {
Assert.notNull(tempFile);
File file = tempFile.getFile();
@@ -121,7 +118,7 @@ public class TheRapyRecuperationEnrollJoinUserImportController {
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.joinUser.import")
public Object selectLineOrTravelAgency(@Param(value = "year", required = false) Integer year) {
public Object selectLineOrTravelAgency(Integer year) {
return joinUserImportService.selectLineOrTravelAgency(year);
}
@@ -5,7 +5,7 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
/**
* @FileName io.v.nutz.therapyRecuperation.controller.process.TheRapyRecuperationExamineController
* @FileName io.v.nutz.zhgh.therapyRecuperation.controller.process.TheRapyRecuperationExamineController
* @Description: 疗休养报名审核
* @Author zxc
* @Date 2022/6/1:18:16
@@ -3,7 +3,9 @@ package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import cn.hutool.core.lang.Assert;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationSignUpMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineAdjustmentService;
@@ -17,15 +19,23 @@ 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.Daos;
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 org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationLineAdjustment
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineAdjustment
* @Description: 线路及人员调整
* @Author zxc
* @Date 2022/6/10:10:00
@@ -40,6 +50,9 @@ public class TheRapyRecuperationLineAdjustmentController {
@Inject
private Dao dao;
@Inject
private MsgApi msgApi;
@Inject
private TheRapyRecuperationLineAdjustmentService adjustmentService;
@@ -62,11 +75,13 @@ public class TheRapyRecuperationLineAdjustmentController {
@ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object pageData(PageForm pageForm,
@Param(value = "year", required = false) Integer year,
@Param(value = "lineId", required = false) String lineId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "keywords", required = false) String keywords) {
return adjustmentService.pageData(pageForm, year, lineId, unionId, keywords);
Integer year,
String lineId,
String unionId,
String keywords,
String regionalNature,
String lotId) {
return adjustmentService.pageData(pageForm, year, lineId, unionId, keywords, regionalNature, lotId);
}
@@ -81,7 +96,7 @@ public class TheRapyRecuperationLineAdjustmentController {
@Ok("json:full")
@ViReturn
@RequiresAuthentication
public Object findUnionSignUpModeLineList(@Param(value = "year", required = false) Integer year) {
public Object findUnionSignUpModeLineList(Integer year) {
Sql sql = Sqls.create("""
select id,lineName from the_rapy_recuperation_line
$condition
@@ -104,8 +119,7 @@ public class TheRapyRecuperationLineAdjustmentController {
@POST
@Ok("json:full")
@RequiresAuthentication
public Object findUnionSignUpModeUserList(@Param(value = "lineId", required = false) String lineId,
@Param(value = "unionId", required = false) String unionId) {
public Object findUnionSignUpModeUserList(@Param("lineId") String lineId, @Param("unionId") String unionId) {
try {
Assert.notBlank(lineId);
return Result.success().addData(adjustmentService.findUnionSignUpModeUserList(lineId, unionId));
@@ -126,8 +140,7 @@ public class TheRapyRecuperationLineAdjustmentController {
@POST
@Ok("json:full")
@RequiresAuthentication
public Object adjustmentUser(@Param(value = "lineId", required = false) String lineId,
@Param(value = "loginNames", required = false) String[] loginName) {
public Object adjustmentUser(String lineId, @Param("loginNames") String[] loginName) {
try {
Assert.notBlank(lineId);
Assert.notNull(loginName);
@@ -142,4 +155,53 @@ public class TheRapyRecuperationLineAdjustmentController {
}
}
@At
@POST
@Ok("json:full")
@RequiresAuthentication
public Object smsAlerts(String lineId,@Param("loginNames") String[] loginName){
try {
Sql sql = Sqls.create("""
SELECT
rlus.id,
rlus.unionId,
rlus.lineId,
rlus.selectUserId,
DATE_FORMAT( rlus.playStartTime, '%Y-%m-%d' ) AS playStartTime,
DATE_FORMAT( rlus.playEndTime, '%Y-%m-%d' ) AS playEndTime,
rl.lineName,
rl.regionalNature,
lot.lotName
FROM
`the_rapy_recuperation_line_union_select` rlus
LEFT JOIN `the_rapy_recuperation_line` rl ON rlus.lineId = rl.id
LEFT JOIN `the_rapy_recuperation_lot` lot ON rl.lotId = lot.id
WHERE
rlus.id = @id
""").setParam("id",lineId);
NutMap map = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
String lineName = map.getString("lineName");
String lotName = map.getString("lotName");
String regionalNature = map.getString("regionalNature");
String playStartTime = map.getString("playStartTime");
String playEndTime = map.getString("playEndTime");
List<Sys_user> userList = dao.query(Sys_user.class, Cnd.where("loginname", "in", loginName));
Map<String, String> usernameMap = userList.stream().collect(Collectors.toMap(Sys_user::getLoginname, Sys_user::getUsername));
if (Lang.isNotEmpty(loginName)){
Arrays.stream(loginName).forEach(v->{
String username = usernameMap.get(v);
String content = "%s老师您好,您报名的%s【%s-%s】(%s至%s)线路未达到成团标准,现已解散,请您选择其他线路进行报名!"
.formatted(username,lineName,lotName,regionalNature,playStartTime,playEndTime);
// msgApi.sendWxMsg(content,v);
});
}
return Result.success();
} catch (Exception e){
e.printStackTrace();
return Result.error();
}
}
}
@@ -26,7 +26,7 @@ import java.util.List;
import java.util.Map;
/**
* @FileName io.v.nutz.therapyRecuperation.controller.process.TheRapyRecuperationLineClusterController
* @FileName io.v.nutz.zhgh.therapyRecuperation.controller.process.TheRapyRecuperationLineClusterController
* @Description: TODO
* @Author zxc
* @Date 2022/6/17:08:52
@@ -59,10 +59,7 @@ public class TheRapyRecuperationLineClusterController {
@POST
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.lineCluster")
public Object pageData(PageForm pageForm,
@Param(value = "year", required = false) Integer year,
@Param(value = "keywords", required = false) String keywords,
@Param(value = "unionId", required = false) String unionId) {
public Object pageData(PageForm pageForm, Integer year, String keywords, String unionId) {
Pagination pagination = clusterService.pageData(pageForm, year, unionId, keywords);
return pagination;
}
@@ -79,8 +76,7 @@ public class TheRapyRecuperationLineClusterController {
@ViReturn
@POST
@RequiresAuthentication
public Object findClusterInfo(@Param(value = "lineId", required = false) String lineId,
@Param(value = "usUnionId", required = false) String usUnionId) {
public Object findClusterInfo(@Param("lineId") String lineId, @Param("usUnionId") String usUnionId) {
Assert.notBlank(lineId);
Assert.notBlank(usUnionId);
return clusterService.findClusterInfo(lineId, usUnionId);
@@ -97,8 +93,7 @@ public class TheRapyRecuperationLineClusterController {
@POST
@RequiresAuthentication
@SLog(tag = "疗休养", msg = "设置组团人员", param = true, result = true)
public Object setClusterMembers(@Param(value = "clusters", required = false) String clusters,
@Param(value = "lineId", required = false) String lineId) {
public Object setClusterMembers(@Param("clusters") String clusters, @Param("lineId") String lineId) {
NutMap nutMap = Json.fromJson(NutMap.class, clusters);
List<TheRapyRecuperationCluster> clusterList = new ArrayList<>();
nutMap.forEach((k, v) -> {
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
@@ -78,24 +79,30 @@ public class TheRapyRecuperationLineUnionSelectController {
@POST
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
public Object pageData(PageForm pageForm,
@Param(value = "year", required = false) Integer year,
@Param(value = "keywords", required = false) String keywords,
@Param(value = "selectStatus", required = false) int selectStatus,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "lotId", required = false) String lotId,
@Param(value = "travelAgencyId", required = false) String travelAgencyId,
@Param(value = "mode", required = false) Integer mode) {
public Object pageData(PageForm pageForm, Integer year, String keywords, int selectStatus, String unionId,
String lotId, String travelAgencyId, Integer mode, String regionalNature) {
TheRapyRecuperationConfig config = unionSelectService.dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
Cnd cnd = Cnd.NEW();
cnd.andEX("line.year", "=", year);
cnd.andEX("line.lotId", "=", lotId);
cnd.andEX("line.travelAgencyId", "=", travelAgencyId);
if (!"全部".equals(regionalNature)) {
cnd.andEX("line.regionalNature", "=", regionalNature);
}
//当前登录用户已选择的线路id
Sql hasSelectLineSql = Sqls.createf("""
select lineId from the_rapy_recuperation_line_union_select where selectUserId = '%s' AND unionId = '%s'
""", ShiroUtil.getPrincipalProperty("id"), Vi.getUnionId());
Sql hasSelectLineSql;
if (!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
cnd.and(Cnd.exps("line.createUnionId", "=", Vi.getUnionId()).or("createMode", "=", 2));
hasSelectLineSql = Sqls.createf("""
select lineId from the_rapy_recuperation_line_union_select where selectUserId = '%s' AND unionId = '%s' AND year(selectTime) = %s
""", ShiroUtil.getPrincipalProperty("id"), Vi.getUnionId(), year == null ? DateUtil.thisYear() : year);
} else {
hasSelectLineSql = Sqls.createf("""
select lineId from the_rapy_recuperation_line_union_select where year(selectTime) = %s
""", year == null ? DateUtil.thisYear() : year);
}
/*hasSelectLineSql = Sqls.createf("""
select lineId from the_rapy_recuperation_line_union_select where unionId = '%s'
@@ -103,7 +110,10 @@ public class TheRapyRecuperationLineUnionSelectController {
switch (selectStatus) {
//查询未选择的线路
case -1 -> cnd.and("line.id", "not in", hasSelectLineSql);
case -1 -> {
cnd.and("line.id", "not in", hasSelectLineSql);
cnd.and("line.year", "in", year == null ? Lang.array(config.getProvinceStartYear(), config.getProvinceStartYear() + 1) : year);
}
case 0 -> {
SqlExpressionGroup seg = new SqlExpressionGroup();
@@ -123,6 +133,7 @@ public class TheRapyRecuperationLineUnionSelectController {
case 1 -> {
cnd.and("line.id", "in", hasSelectLineSql);
cnd.and("us.signUpMode", "=", mode);
cnd.and("year(us.selectTime)", "=", year == null ? DateUtil.thisYear() : year);
}
}
@@ -137,9 +148,9 @@ public class TheRapyRecuperationLineUnionSelectController {
if (StrUtil.isAllNotEmpty(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().replace("ending", ""));
} else {
cnd.desc("year").asc("serialNumber");
cnd.asc("createUnionId").desc("year").asc("serialNumber");
}
return unionSelectService.pageData(pageForm, cnd);
return unionSelectService.pageData(pageForm, cnd, year);
}
/**
@@ -176,12 +187,14 @@ public class TheRapyRecuperationLineUnionSelectController {
//组织形式
int signUpMode = ShiroUtil.hasRole("H04") ? 1 : 2;
TheRapyRecuperationLineUnionSelect theRapyRecuperationLineUnionSelect = dao.fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "=", lineUnionSelect.getId()));
for (TheRapyRecuperationLineUnionSelect unionSelect : lineUnionSelects) {
unionSelect.setSelectTime(new Date());
unionSelect.setSelectUserId(ShiroUtil.getPlatformUid());
unionSelect.setUnionId(Vi.getUnionId());
unionSelect.setOpen(true);
unionSelect.setDelFlag(false);
unionSelect.setIsOpen(Lang.isNotEmpty(theRapyRecuperationLineUnionSelect)?theRapyRecuperationLineUnionSelect.getIsOpen():false);
unionSelect.setDelFlag(signUpMode == 2);
unionSelect.setSignUpMode(signUpMode);
}
@@ -199,9 +212,7 @@ public class TheRapyRecuperationLineUnionSelectController {
@At
@POST
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
public Object selectLineInfo(@Param(value = "lineId", required = false) String lineId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "mode", required = false) Integer mode) {
public Object selectLineInfo(@Param("lineId") String lineId, @Param("unionId") String unionId, @Param("mode") Integer mode, @Param("year") Integer year) {
try {
Assert.notBlank(lineId);
Assert.notNull(mode);
@@ -209,10 +220,10 @@ public class TheRapyRecuperationLineUnionSelectController {
if (mode == 1 && !ShiroUtil.hasRole("H04")) {
return Result.error("您没有分工会角色权限!");
} else if (mode == 2 && !ShiroUtil.hasRole("A06")) {
} else if (mode == 2 && !ShiroUtil.hasAnyRoles("A06, sysadmin")) {
return Result.error("您没有校工会角色权限!");
}
return Result.success(unionSelectService.selectLineInfo(lineId, unionId, mode));
return Result.success(unionSelectService.selectLineInfo(lineId, unionId,mode, year));
} catch (Exception e) {
log.error(e.getMessage());
return Result.error(e.getMessage());
@@ -305,4 +316,51 @@ public class TheRapyRecuperationLineUnionSelectController {
}
/**
* 一键统赋时间针对于已选择的线路
* @param lineIds 线路Id数组
* @param lineUnionSelects 出行时段
* @return {@link Object}
*/
@At("/setGiveLineTimes")
@POST
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@Aop(TransAop.READ_COMMITTED)
@SLog(type = "普惠疗休养",tag = "分工会/校工会选择线路",msg = "一键统赋时间,针对于已选择的线路",param = true,result = true)
public Object setGiveLineTimes(@Param("lineIds") String[] lineIds,@Param("lineUnionSelects") TheRapyRecuperationLineUnionSelect[] lineUnionSelects,
@Param(value = "year",required = false) Integer year) {
if (Lang.isNotEmpty(lineUnionSelects) && Lang.isNotEmpty(lineIds)) {
TheRapyRecuperationLineUnionSelect lineUnionSelect = lineUnionSelects[0];
Cnd cnd = Cnd.NEW();
cnd.and("unionId","=",Vi.getUnionId());
cnd.and("selectUserId","=", ShiroUtil.getUserId());
cnd.and("YEAR(selectTime)","=",year == null ? DateUtil.thisYear() : year);
List<TheRapyRecuperationLineUnionSelect> unionSelectList = dao.query(TheRapyRecuperationLineUnionSelect.class, cnd);
List<String> selectIdList = unionSelectList.stream().map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList());
Chain chain = Chain.make("enable",1);
if (lineUnionSelect.getSignUpStartTime() != null) chain.add("signUpStartTime",lineUnionSelect.getSignUpStartTime());
if (lineUnionSelect.getSignUpEndTime() != null) chain.add("signUpEndTime",lineUnionSelect.getSignUpEndTime());
if (lineUnionSelect.getChangeEndTime() != null) chain.add("changeEndTime",lineUnionSelect.getChangeEndTime());
if (lineUnionSelect.getPlayStartTime() != null) chain.add("playStartTime",lineUnionSelect.getPlayStartTime());
if (lineUnionSelect.getPlayEndTime() != null) chain.add("playEndTime",lineUnionSelect.getPlayEndTime());
dao.update(TheRapyRecuperationLineUnionSelect.class,chain,Cnd.where("id","in",selectIdList));
}
return null;
}
@At
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@SLog(type = "普惠疗休养",tag = "分工会/校工会选择线路",msg = "是否开放对外报名",param = true,result = true)
public Object doEditOpen(String id){
dao.update(TheRapyRecuperationLineUnionSelect.class,Chain.makeSpecial("isOpen", "isOpen ^ 1"), Cnd.where("id", "=", id));
return null;
}
}
@@ -13,7 +13,6 @@ 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;
import java.util.Map;
@@ -42,8 +41,7 @@ public class TheRapyRecuperationStatisticsController {
@At
@ViReturn
@RequiresAuthentication
public Object getLineBar(@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "year", required = false) Integer year) {
public Object getLineBar(String regionalNature, Integer year) {
Sql sql = Sqls.create("""
SELECT
line.lineName,
@@ -16,13 +16,11 @@ import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.slog.annotation.SLog;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
@@ -78,19 +76,18 @@ public class TheRapyRecuperationUnionQueryController {
@At
@ViReturn
@RequiresAuthentication
public Object getXlData(PageForm pageForm,
@Param(value = "year", required = false) String year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "lotId", required = false) String lotId) {
public Object getXlData(PageForm pageForm, String year, String unionId, String takePartInLineId, String regionalNature, String lotId) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
lot.lotName,
lot.lotValue,
line.*,
line.id,
line.lineName,
line.regionalNature,
lineu.lineId,
lineu.id AS selectId,
lineu.signUpMode,
YEAR(lineu.selectTime) as `year`,
CONCAT(DATE_FORMAT(lineu.playStartTime,'%m月%d日'),'-',DATE_FORMAT(lineu.playEndTime,'%m月%d日')) AS linePlayTime,
lineu.playStartTime as playStartTime1,
lineu.playEndTime as playEndTime2,
lxs.travelAgencyName,
@@ -98,6 +95,9 @@ public class TheRapyRecuperationUnionQueryController {
lxs.contactMobileNumber,
enroll.takePartInUnionId AS usUnionId,
un.unionname,
lot.lotName,
lot.lotValue,
SUM(enroll.familyNumber) AS familyNumber,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE takePartInLineId = lineu.id and stateId=@stateId $unionCnd) lineNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInLineId = lineu.id $unionCnd)) as signUpUserFamilyNum
FROM
@@ -115,8 +115,11 @@ public class TheRapyRecuperationUnionQueryController {
cnd.andEX("YEAR(enroll.signingUptime)", "=", year);
if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) {
sql.setVar("unionCnd", "and (takePartInUnionId='%s' or selfUnionId='%s')".formatted(Vi.getUnionId(), Vi.getUnionId()));
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
// sql.setVar("unionCnd", "and (takePartInUnionId='%s' or selfUnionId='%s')".formatted(Vi.getUnionId(), Vi.getUnionId()));
String unionCndSql = StrUtil.isBlank(year) ? "and selfUnionId='%s'".formatted(Vi.getUnionId()) : "and selfUnionId='%s' and YEAR(signingUptime)='%s'".formatted(Vi.getUnionId(), year);
sql.setVar("unionCnd", unionCndSql);
// cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
cnd.and("enroll.selfUnionId", "=", Vi.getUnionId());
/* if (Strings.isNotBlank(unionId)) {
cnd.andEX("enroll.selfUnionId", "=", unionId);
//cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
@@ -126,7 +129,8 @@ public class TheRapyRecuperationUnionQueryController {
}*/
} else {
if (Strings.isNotBlank(unionId)) {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
// cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
cnd.and("enroll.selfUnionId", "=", unionId);
}
}
if (Strings.isNotBlank(regionalNature)) {
@@ -146,17 +150,9 @@ public class TheRapyRecuperationUnionQueryController {
@At
@ViReturn
@RequiresAuthentication
public Object getRyData(PageForm pageForm,
@Param(value = "year", required = false) String year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "state", required = false) String state,
@Param(value = "state2", required = false) String state2,
@Param(value = "agencyId", required = false) String agencyId,
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId,
@Param(value = "lotId", required = false) String lotId) {
public Object getRyData(PageForm pageForm, String year, String unionId, String unitId,
String takePartInLineId, String regionalNature, String state,
String state2, String agencyId, String takePartInBaseManagementId, String lotId) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
@@ -201,7 +197,8 @@ public class TheRapyRecuperationUnionQueryController {
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (Strings.isNotBlank(unionId) && state.equals("1")) {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
// cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
cnd.and("enroll.selfUnionId", "=", unionId);
}
cnd.andEX("enroll.selfUnionId", "=", unionId);
} else {
@@ -221,7 +218,8 @@ public class TheRapyRecuperationUnionQueryController {
cnd.andEX("lineu.signUpMode", "=", 2);
}
} else {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
// cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
cnd.and("enroll.selfUnionId", "=", Vi.getUnionId());
}
}
cnd.andEX("enroll.selfUnitId", "=", unitId);
@@ -255,8 +253,7 @@ public class TheRapyRecuperationUnionQueryController {
@At
@ViReturn
@RequiresAuthentication
public Object getLxsData(PageForm pageForm, @Param(value = "year", required = false) String year,
@Param(value = "agencyId", required = false) String agencyId) {
public Object getLxsData(PageForm pageForm, String year, String agencyId) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
@@ -286,9 +283,7 @@ public class TheRapyRecuperationUnionQueryController {
@At
@ViReturn
@RequiresAuthentication
public Object getJdData(PageForm pageForm,
@Param(value = "year", required = false) String year,
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId) {
public Object getJdData(PageForm pageForm, String year, String takePartInBaseManagementId) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
@@ -321,12 +316,7 @@ public class TheRapyRecuperationUnionQueryController {
@At
@ViReturn
@RequiresAuthentication
public Object getSelfUnionUser(PageForm pageForm,
@Param(value = "year", required = false) String year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "state", required = false) String state,
@Param(value = "state2", required = false) String state2) {
public Object getSelfUnionUser(PageForm pageForm, String year, String unitId, String unionId, String state, String state2) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
@@ -364,11 +354,13 @@ public class TheRapyRecuperationUnionQueryController {
if (StrUtil.isNotBlank(unionId)) {
cnd.and("enroll.selfUnionId", "=", unionId);
} else {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
// cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
cnd.and("enroll.selfUnionId", "=", Vi.getUnionId());
}
} else {
if (StrUtil.isNotBlank(unionId)) {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
// cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
cnd.and("enroll.selfUnionId", "=", unionId);
}
}
cnd.desc("enroll.stateId");
@@ -396,15 +388,8 @@ public class TheRapyRecuperationUnionQueryController {
@Ok("void")
@ViReturn
@RequiresAuthentication
public void doExport(@Param(value = "state", required = false) String state,
@Param(value = "year", required = false) Integer year,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "agencyId", required = false) String agencyId,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "lotId", required = false) String lotId,
public void doExport(String state, Integer year, String searchName, String searchKeyword, String unionId,
String unitId, String agencyId, String takePartInLineId, String lotId,
HttpServletResponse response) throws IOException {
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(state)) {
@@ -418,17 +403,15 @@ public class TheRapyRecuperationUnionQueryController {
cnd.andEX("YEAR(signingUptime)", "=", year);
cnd.andEX("takePartInTravelAgencyId", "=", agencyId);
cnd.and("takePartInTravelAgencyId", "is not", null);
}
} else {
}
if (Strings.isNotBlank(searchKeyword) && Strings.isNotBlank(searchName)) {
cnd.and(Cnd.likeEX(searchName, searchKeyword));
}
if (!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
cnd.and(Cnd.exps("takePartInUnionId", "=", Vi.getUnionId()).or("selfUnionId", "=", Vi.getUnionId()));
}
cnd.and("stateId", "=", TheRapyRecuperationState.PASS);
cnd.and("isNormal", "=", true);
cnd.desc("unitName");
@@ -437,6 +420,9 @@ public class TheRapyRecuperationUnionQueryController {
baseService.dao().fetchLinks(v, "companionList");
baseService.dao().fetchLinks(v, "bedInfo");
});
TheRapyRecuperationConfig config = baseService.dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
List<NutMap> arrayList = new ArrayList<>();
enrollList.forEach(v -> {
arrayList.add(new NutMap() {{
@@ -447,6 +433,7 @@ public class TheRapyRecuperationUnionQueryController {
addv("unionName", v.getUnionName());
addv("idCard", v.getIdCard());
addv("mobile", v.getMobile());
addv("familyNumber", v.getFamilyNumber());
addv("relation", "本人");
addv("bedType", Lang.isNotEmpty(v.getBedInfo()) ? v.getBedInfo().getBedType() : null);
addv("bedNum", Lang.isNotEmpty(v.getBedInfo()) ? v.getBedInfo().getBedNum() : null);
@@ -476,14 +463,19 @@ public class TheRapyRecuperationUnionQueryController {
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
exportEntities.add(new ExcelExportEntity("单位", "unitName", 40));
exportEntities.add(new ExcelExportEntity("工会", "unionName", 40));
exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 60));
exportEntities.add(new ExcelExportEntity("手机号", "mobile", 60));
exportEntities.add(new ExcelExportEntity("与本人关系", "relation", 60));
exportEntities.add(new ExcelExportEntity("床型", "bedType", 20));
exportEntities.add(new ExcelExportEntity("位数", "bedNum", 20));
exportEntities.add(new ExcelExportEntity("意向拼房人", "otherSleepUser", 20));
exportEntities.add(new ExcelExportEntity("单位", "unitName", 20));
exportEntities.add(new ExcelExportEntity("工会", "unionName", 20));
exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
exportEntities.add(new ExcelExportEntity("手机号", "mobile", 10));
if (config.getFamilyInfo() == 2) {
exportEntities.add(new ExcelExportEntity("与本人关系", "relation", 10));
exportEntities.add(new ExcelExportEntity("", "bedType", 10));
exportEntities.add(new ExcelExportEntity("床位数", "bedNum", 10));
exportEntities.add(new ExcelExportEntity("意向拼房人", "otherSleepUser", 10));
} else {
exportEntities.add(new ExcelExportEntity("携带家属数", "familyNumber", 10));
}
exportEntities.add(new ExcelExportEntity("备注", "bz", 20));
response.setContentType("application/octet-stream");
@@ -512,12 +504,7 @@ public class TheRapyRecuperationUnionQueryController {
@At
@ViReturn
@RequiresAuthentication
public Object getApplyNum(@Param(value = "state", required = false)String state,
@Param(value = "state2", required = false)String state2,
@Param(value = "unionId", required = false)String unionId,
@Param(value = "year", required = false)Integer year,
@Param(value = "regionalNature", required = false)String regionalNature,
@Param(value = "takePartInLineId", required = false)String takePartInLineId) {
public Object getApplyNum(String state, String state2, String unionId, Integer year, String regionalNature, String takePartInLineId) {
Cnd cnd1 = Cnd.NEW();
Sql sql1 = Sqls.create("""
SELECT
@@ -533,9 +520,10 @@ public class TheRapyRecuperationUnionQueryController {
if (Strings.isNotBlank(state)) {
if (state.equals("1")) {
cnd1.andEX("line.regionalNature", "=", regionalNature);
cnd1.and("enroll.takePartInTravelAgencyId", "is", null);
// cnd1.and("enroll.takePartInTravelAgencyId", "is", null);
if (StrUtil.isBlank(state2)) {
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
// cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()));
}
} else if (state.equals("2")) {
cnd1.and("enroll.takePartInTravelAgencyId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId());
@@ -559,7 +547,8 @@ public class TheRapyRecuperationUnionQueryController {
}
}
} else {
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
// cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()));
}
} else {
if (Strings.isNotBlank(state)) {
@@ -579,7 +568,8 @@ public class TheRapyRecuperationUnionQueryController {
}
} else {
if (Strings.isNotBlank(unionId)) {
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId));
// cnd1.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId));
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", unionId));
}
}
}
@@ -588,26 +578,36 @@ public class TheRapyRecuperationUnionQueryController {
cnd1.andEX("enroll.isNormal", "= ", true);
cnd1.andEX("enroll.stateId", "= ", TheRapyRecuperationState.PASS);
TheRapyRecuperationConfig config = baseService.dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
Sql sql2 = null;
if (config.getFamilyInfo() == 2) {
sql2 = Sqls.create("""
SELECT
count( 1 )
FROM
the_rapy_recuperation_enroll_companion
WHERE
trreId IN ( SELECT enroll.id FROM the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId $condition )
""");
} else {
sql2 = Sqls.create("""
SELECT sum(familyNumber) FROM the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId $condition
""");
}
Cnd cnd2 = Cnd.NEW();
Sql sql2 = Sqls.create("""
SELECT
count( 1 )
FROM
the_rapy_recuperation_enroll_companion
WHERE
trreId IN ( SELECT enroll.id FROM the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId $condition )
""");
if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) {
if (Strings.isNotBlank(state)) {
if (state.equals("1")) {
cnd2.andEX("line.regionalNature", "=", regionalNature);
cnd2.and("enroll.takePartInLineId", "is not", null);
if (StrUtil.isBlank(state2)) {
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
// cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()));
}
} else if (state.equals("2")) {
cnd2.and("enroll.takePartInTravelAgencyId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId());
@@ -630,13 +630,15 @@ public class TheRapyRecuperationUnionQueryController {
}
}
} else {
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
// cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()));
}
} else {
if (Strings.isNotBlank(state)) {
if (state.equals("1")) {
if (Strings.isNotBlank(unionId)) {
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId));
// cnd2.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId));
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", unionId));
}
cnd2.andEX("line.regionalNature", "=", regionalNature);
cnd2.and("enroll.takePartInLineId", "is not", null);
@@ -659,7 +661,14 @@ public class TheRapyRecuperationUnionQueryController {
sql1.setCondition(cnd1);
int count1 = baseService.count(sql1);
sql2.setCondition(cnd2);
int count2 = baseService.count(sql2);
int count2 = 0;
if (config.getFamilyInfo() == 2) {
count2 = baseService.count(sql2);
} else {
Sql sql = Sqls.fetchInt(sql2.toString());
baseService.dao().execute(sql);
count2 = sql.getInt();
}
return Map.of("count1", count1, "count2", count2);
}
@@ -789,7 +798,7 @@ public class TheRapyRecuperationUnionQueryController {
left join `the_rapy_recuperation_line` rl on rs.lineId=rl.id
LEFT JOIN `the_rapy_recuperation_travel_agency` ta ON rl.travelAgencyId = ta.id
LEFT JOIN `the_rapy_recuperation_lot` lot ON rl.lotId = lot.id
where rs.signUpMode='1' and rl.year=@year
where rs.signUpMode='1' and YEAR(rs.selectTime)=@year
""");
sql.setParam("year", DateUtil.thisYear());
List<NutMap> lineAllList = baseService.listMap(sql);
@@ -855,7 +864,7 @@ public class TheRapyRecuperationUnionQueryController {
WHERE
rl.lineName IS NOT NULL and rs.signUpMode='1' and re.isNormal='1'
and re.takePartInUnionId=@unionid
and rl.year=@year
and YEAR(re.signingUptime)=@year
and re.stateId=@stateId
""");
String unionid = ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getId();
@@ -874,6 +883,8 @@ public class TheRapyRecuperationUnionQueryController {
}
});
map.put("unionName", ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getUnionname());
map.put("year", DateUtil.thisYear());
map.put("schoolName", Globals.MyConfig.getString("GxName"));
map.put("maplist", list);
Sys_user user = baseService.dao().fetch(Sys_user.class, Cnd.where("id", "=", ShiroUtil.getPrincipalProperty("id")));
map.put("filler", user.getUsername());
@@ -1,8 +1,12 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
@@ -11,11 +15,12 @@ import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyRecuperationEnrollExcelMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
@@ -28,6 +33,7 @@ import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
@@ -36,10 +42,18 @@ import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@IocBean
@At("/platform/theRapyRecuperation/user/query")
@@ -62,16 +76,10 @@ public class TheRapyRecuperationUserQueryController {
@At
@ViReturn
@RequiresAuthentication
public Object pageData(@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "state", required = false) Integer state, PageForm pageForm,
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "agencyId", required = false) String agencyId,
@Param(value = "lotId", required = false) String lotId,
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId) {
public Object pageData(String regionalNature, Integer state, PageForm pageForm,
Integer startYear, Integer endYear, String unionId,
String unitId, String takePartInLineId, String agencyId, String lotId,
String takePartInBaseManagementId,String signUpMode) {
Cnd cnd = Cnd.NEW();
if (Strings.isNotBlank(pageForm.getSearchKeyword()) && Strings.isNotBlank(pageForm.getSearchName())) {
@@ -84,11 +92,11 @@ public class TheRapyRecuperationUserQueryController {
SELECT
enroll.*,
lxs.travelAgencyName,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id AND relation = '亲属' ) isFamily
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = enroll.takePartInTravelAgencyId
$condition
$condition
""");
cnd.andEX("enroll.selfUnionId", "=", Vi.getUnionId());
cnd.andEX("lxs.`year`", ">=", startYear);
@@ -105,8 +113,8 @@ public class TheRapyRecuperationUserQueryController {
enroll.*,
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id AND relation = '亲属' ) isFamily
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
@@ -121,6 +129,7 @@ public class TheRapyRecuperationUserQueryController {
cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.andEX("lineu.signUpMode","=",signUpMode);
if (state == 3) {
sql.setVar("lotSql", "(select lotName from the_rapy_recuperation_lot where id = ma.lotId) as lotName");
cnd.and("enroll.takePartInBaseManagementId", "is not", null);
@@ -149,9 +158,7 @@ public class TheRapyRecuperationUserQueryController {
@At
@ViReturn
public Object getXlLxsUserCount(@Param(value = "unionId", required = false) String unionId,
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear) {
public Object getXlLxsUserCount(String unionId, Integer startYear, Integer endYear, Integer signUpMode) {
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(signingUptime)", ">=", startYear);
cnd.andEX("YEAR(signingUptime)", "<=", endYear);
@@ -161,17 +168,20 @@ public class TheRapyRecuperationUserQueryController {
cnd.and("isNormal", "=", true);
cnd.and("takePartInLineId", "is not", null);
cnd.and("stateId", "=", TheRapyRecuperationState.PASS);
cnd.andEX("(select signUpMode from the_rapy_recuperation_line_union_select where id = takePartInLineId)", "=", signUpMode);
int count = baseService.dao().count(TheRapyRecuperationEnroll.class, cnd);
int count1 = baseService.dao().count(TheRapyRecuperationEnroll.class, Cnd.where("takePartInTravelAgencyId", "is not", null)
.andEX("selfUnionId", "=", unionId)
.andEX("YEAR(signingUptime)", ">=", startYear)
.andEX("YEAR(signingUptime)", "<=", endYear)
.andEX("isNormal", "=", true));
.andEX("isNormal", "=", true)
.andEX("(select signUpMode from the_rapy_recuperation_line_union_select where id = takePartInLineId)", "=", signUpMode));
int count2 = baseService.dao().count(TheRapyRecuperationEnroll.class, Cnd.where("takePartInBaseManagementId", "is not", null)
.andEX("selfUnionId", "=", unionId)
.andEX("YEAR(signingUptime)", ">=", startYear)
.andEX("YEAR(signingUptime)", "<=", endYear)
.andEX("isNormal", "=", true));
.andEX("isNormal", "=", true)
.andEX("(select signUpMode from the_rapy_recuperation_line_union_select where id = takePartInLineId)", "=", signUpMode));
return Map.of("xlCount", count, "lxsCount", count1, "jdCount", count2);
}
@@ -259,4 +269,236 @@ public class TheRapyRecuperationUserQueryController {
return null;
}
@At
@ViReturn
public Object doEdit(TheRapyRecuperationEnroll enroll) {
enroll.setNormal(true);
baseService.dao().updateIgnoreNull(enroll);
return null;
}
@At
@ViReturn
public Object getUnionSelectLine(Integer year,Integer signUpMode){
Sql sql = Sqls.create("""
SELECT
rlus.id,
rlus.unionId,
rlus.lineId,
rlus.selectUserId,
DATE_FORMAT( rlus.playStartTime, '%Y-%m-%d' ) AS playStartTime,
DATE_FORMAT( rlus.playEndTime, '%Y-%m-%d' ) AS playEndTime,
rl.lineName,
rl.regionalNature,
if(rlus.signUpMode=1,'分工会','校工会') AS signUpMode,
lot.lotName
FROM
`the_rapy_recuperation_line_union_select` rlus
LEFT JOIN `the_rapy_recuperation_line` rl ON rlus.lineId = rl.id
LEFT JOIN `the_rapy_recuperation_lot` lot ON rl.lotId = lot.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and(Cnd.exps("rlus.isOpen","=",1).or("rlus.unionId","=",Vi.getUnionId()));
cnd.and("YEAR(rlus.selectTime)","=",DateUtil.thisYear());
// cnd.and("rlus.signUpMode","=",signUpMode);
cnd.desc("lot.lotValue");
cnd.desc("rl.lineName");
sql.setCondition(cnd);
return baseService.listMap(sql);
}
@At
@Ok("void")
@ViReturn
@RequiresAuthentication
public void doExport(@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "state", required = false) Integer state,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "agencyId", required = false) String agencyId,
@Param(value = "lotId", required = false) String lotId,
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId,
@Param(value = "signUpMode", required = false) String signUpMode,
@Param(value = "types", required = false) String[] types,
@Param(value = "satisfyPeople", required = false) Boolean satisfyPeople,
HttpServletResponse response) throws IOException {
response.setContentType("application/octet-stream");
response.setHeader("content-disposition", "attachment;filename="
+ URLEncoder.encode("疗休养报名人员名单.zip", StandardCharsets.UTF_8));
Cnd commonCnd = Cnd.NEW();
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
commonCnd.and(Cnd.likeEX(searchName, searchKeyword));
}
if (!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
commonCnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
}
commonCnd.and("enroll.isNormal", "=", true);
commonCnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
//线路的查询
Sql lineSql = Sqls.create("""
SELECT
line.regionalNature,
lxs.travelAgencyName,
line.lineName,
enroll.*,
date_format( enroll.signingUptime, '%Y-%m-%d %H:%i:%s' ) signingUptimeFormat,
date_format( lineu.playStartTime, '%Y-%m-%d' ) playStartTime,
lineu.lineId,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id) familyCount,
u.schoolTime
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN `user` u on enroll.loginName = u.loginname
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = line.travelAgencyId
$condition
""");
Cnd lineCnd = commonCnd.clone();
lineCnd.andEX("YEAR(enroll.signingUptime)", ">=", startYear);
lineCnd.andEX("YEAR(enroll.signingUptime)", "<=", endYear);
lineCnd.andEX("enroll.selfUnitId", "=", unitId);
lineCnd.andEX("line.id", "=", takePartInLineId);
lineCnd.andEX("line.regionalNature", "=", regionalNature);
lineCnd.andEX("lineu.signUpMode", "=", signUpMode);
lineCnd.andEX("enroll.selfUnionId", "=", unionId);
lineCnd.and("enroll.takePartInLineId", "is not", null);
lineCnd.and("enroll.takePartInLineId", "!=", "");
if (StrUtil.isNotBlank(lotId)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.lotId", "=", lotId);
seg.or("ma.lotId", "=", lotId);
lineCnd.and(seg);
}
lineCnd.asc("playStartTime").asc("unionName");
lineSql.setCondition(lineCnd);
List<NutMap> lineEnroll = baseService.listMap(lineSql);
if (satisfyPeople) {
//按照选择线路id分组便于判断是否成团
Map<String, List<NutMap>> enrollGroup = lineEnroll.stream().collect(Collectors.groupingBy(o -> o.getString("takePartInLineId")));
List<TheRapyRecuperationLineUnionSelect> unionSelects =
baseService.dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("enable", "=", true));
Map<String, TheRapyRecuperationLineUnionSelect> selectMap = unionSelects.stream().collect(Collectors.toMap(TheRapyRecuperationLineUnionSelect::getId, o -> o));
lineEnroll = enrollGroup.entrySet().stream()
.filter(entry -> selectMap.containsKey(entry.getKey()) && (entry.getValue().size() + entry.getValue().stream().mapToInt(o -> o.getInt("familyCount")).sum()) >= selectMap.get(entry.getKey()).getEstimatedFamilyNumbers())
.flatMap(entry -> entry.getValue().stream())
.toList();
}
Map<String, List<NutMap>> lineGroupMap = lineEnroll.stream().collect(Collectors.groupingBy(o -> o.getString("lineId")));
//查询所有的线路
List<TheRapyRecuperationLine> lineList = baseService.dao().query(TheRapyRecuperationLine.class, Cnd.NEW());
Map<String, String> lineMap = lineList.stream().collect(Collectors.toMap(TheRapyRecuperationLine::getId, TheRapyRecuperationLine::getLineName));
//定点的查询
Sql travelSql = Sqls.create("""
SELECT
enroll.*,
base.baseName,
u.schoolTime
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN `user` u ON enroll.loginName = u.loginname
LEFT JOIN the_rapy_recuperation_base_management base ON base.id = enroll.takePartInBaseManagementId
$condition
""");
Cnd baseCnd = commonCnd.clone();
baseCnd.andEX("enroll.selfUnionId", "=", unionId);
baseCnd.andEX("base.`year`", ">=", startYear);
baseCnd.andEX("base.`year`", "<=", endYear);
baseCnd.andEX("base.takePartInBaseManagementId", "=", agencyId);
baseCnd.and("enroll.takePartInBaseManagementId", "is not", null);
baseCnd.and("enroll.takePartInBaseManagementId", "!=", "");
baseCnd.desc("enroll.unionName");
travelSql.setCondition(baseCnd);
List<NutMap> travelEnroll = baseService.listMap(travelSql);
Map<String, List<NutMap>> travelGroupMap = travelEnroll.stream().collect(Collectors.groupingBy(o -> o.getString("takePartInBaseManagementId")));
//查询所有的定点酒店
List<TheRapyRecuperationBaseManagement> baseList = baseService.dao().query(TheRapyRecuperationBaseManagement.class, Cnd.NEW());
Map<String, String> baseMap = baseList.stream().collect(Collectors.toMap(TheRapyRecuperationBaseManagement::getId, TheRapyRecuperationBaseManagement::getBaseName));
//公共的导出表头
ArrayList<ExcelExportEntity> commonEntities = new ArrayList<>();
commonEntities.add(new ExcelExportEntity("姓名", "userName", 20));
commonEntities.add(new ExcelExportEntity("工号", "loginName", 20));
commonEntities.add(new ExcelExportEntity("性别", "sex", 10));
commonEntities.add(new ExcelExportEntity("所属单位", "unitName", 20));
commonEntities.add(new ExcelExportEntity("所属工会", "unionName", 20));
commonEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
commonEntities.add(new ExcelExportEntity("手机号", "mobile", 15));
ExcelExportEntity entity = new ExcelExportEntity("报名时间", "signingUptime", 15);
entity.setFormat("yyyy-MM-dd HH:mm:ss");
commonEntities.add(entity);
//线路表头
ArrayList<ExcelExportEntity> lineEntities = new ArrayList<>(commonEntities);
lineEntities.add(new ExcelExportEntity("出行时间", "playStartTime", 20));
lineEntities.add(new ExcelExportEntity("线路名称", "lineName", 20));
lineEntities.add(new ExcelExportEntity("旅行社", "travelAgencyName", 20));
lineEntities.add(new ExcelExportEntity("随行人数", "familyCount", 20));
//自由组团表头
ArrayList<ExcelExportEntity> travelEntities = new ArrayList<>(commonEntities);
travelEntities.add(new ExcelExportEntity("酒店名称", "baseName", 20));
commonEntities.add(new ExcelExportEntity("备注", "remark", 30));
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
try {
if(Arrays.asList(types).contains("line")) {
for (String key : lineGroupMap.keySet()) {
List<NutMap> enrollList = lineGroupMap.get(key);
enrollList.forEach(item -> {
// String remark = TherapyRecuperationCommon.getRemarkBySchoolTime(item.getString("schoolTime"));
// item.put("remark", remark);
});
String fileName = "线路报名人员/" + lineMap.get(key) + ".xlsx";
zipOutputStream.putNextEntry(new ZipEntry(fileName));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, lineEntities, enrollList);
workbook.write(zipOutputStream);
zipOutputStream.closeEntry();
response.flushBuffer();
}
}
if(Arrays.asList(types).contains("base")) {
for (String key : travelGroupMap.keySet()) {
List<NutMap> enrollList = travelGroupMap.get(key);
enrollList.forEach(item -> {
// String remark = TherapyRecuperationCommon.getRemarkBySchoolTime(item.getString("schoolTime"));
// item.put("remark", remark);
});
String fileName = "定点疗休养报名人员/" + baseMap.get(key) + ".xlsx";
zipOutputStream.putNextEntry(new ZipEntry(fileName));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, travelEntities, enrollList);
workbook.write(zipOutputStream);
zipOutputStream.closeEntry();
response.flushBuffer();
}
}
zipOutputStream.flush();
zipOutputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,181 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.summary;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import io.v.nutz.base.utils.ViTool;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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 javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
@IocBean
@Ok("json:full")
@At("/platform/therapyRecuperation/evaluate/statistics")
public class TherapyRecuperationEvaluateStatisticsController {
@Inject
private TheRapyRecuperationEnrollService enrollService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/summary/evaluateStatistics.html")
@RequiresPermissions("theRapyRecuperation.evaluate.statistics")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.evaluate.statistics")
public Object pageData(PageForm pageForm,
String lineId,
String unionId,
String unitId,
String personType,
String userState,
String evaluateScore) {
Sql sql = Sqls.create("""
SELECT
we.evaluateText,
we.evaluateScore,
we.userName,
we.loginName,
u.unionname,
u.unitname,
u.userState,
u.personType,
line.lineName,
us.playStartTime
FROM
`the_rapy_recuperation_evaluate` we
LEFT JOIN `user` u ON u.id = we.userId
LEFT JOIN the_rapy_recuperation_enroll en ON en.takePartInLineId = we.lineId
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = en.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(pageForm.getSearchName()) && StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
}
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equals("ascending") ? "asc" : "desc");
} else {
cnd.desc("we.evaluateScore");
}
if(StrUtil.isNotBlank(lineId)) {
cnd.andEX("we.lineId", "in", lineId.split(","));
}
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.personType", "=", personType);
cnd.andEX("u.userState", "=", userState);
cnd.andEX("we.evaluateScore", "=", evaluateScore);
cnd.groupBy("we.lineId");
sql.setCondition(cnd);
return enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.evaluate.statistics")
public Object lineList(Integer year) {
Sql sql = Sqls.create("""
SELECT
GROUP_CONCAT(us.id) as id,
line.lineName,
if(us.signUpMode = 2, '校工会', un.unionname) as unionName
FROM
the_rapy_recuperation_line_union_select us
LEFT JOIN the_rapy_recuperation_line line ON us.lineId = line.id
LEFT JOIN sys_union un ON un.id = us.unionId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("year(us.selectTime)", "=", year);
cnd.groupBy("lineId, unionid");
sql.setCondition(cnd);
return enrollService.listMap(sql);
}
@At
@Ok("void")
@RequiresPermissions("theRapyRecuperation.evaluate.statistics")
public void exportEvaluate(String lineId,
String unionId,
String unitId,
String evaluateScore,
String searchKeyword,
String searchName,
HttpServletResponse response) {
Sql sql = Sqls.create("""
SELECT
we.evaluateText,
we.evaluateScore,
we.userName,
we.loginName,
u.unionname,
u.unitname,
u.userState,
u.personType,
line.lineName,
us.playStartTime
FROM
`the_rapy_recuperation_evaluate` we
LEFT JOIN `user` u ON u.id = we.userId
LEFT JOIN the_rapy_recuperation_enroll en ON en.takePartInLineId = we.lineId
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = en.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(searchName) && StrUtil.isNotBlank(searchKeyword)) {
cnd.and(Cnd.likeEX(searchName, searchKeyword));
}
if(StrUtil.isNotBlank(lineId)) {
cnd.andEX("we.lineId", "in", lineId.split(","));
}
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("we.evaluateScore", "=", evaluateScore);
cnd.groupBy("we.lineId");
sql.setCondition(cnd);
List<NutMap> listMap = enrollService.listMap(sql);
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("线路","lineName",20));
entities.add(new ExcelExportEntity("出行时间","playStartTime",20));
entities.add(new ExcelExportEntity("工号","loginName",20));
entities.add(new ExcelExportEntity("姓名","userName",20));
entities.add(new ExcelExportEntity("所属单位","unitname",20));
entities.add(new ExcelExportEntity("所属工会","unionname",20));
entities.add(new ExcelExportEntity("在职状态","userState",20));
entities.add(new ExcelExportEntity("人员类型","personType",20));
entities.add(new ExcelExportEntity("评分","evaluateScore",20));
entities.add(new ExcelExportEntity("评价","evaluateText",40));
try {
ViTool.excelResponse(response, "评价人员名单.xls");
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entities, listMap);
workbook.write(response.getOutputStream());
} catch (Exception ignored) {}
}
}
@@ -1,6 +1,8 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.theRapyConfig;
import cn.hutool.json.JSONUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.constant.RedisConstant;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
@@ -10,6 +12,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
@@ -17,7 +20,6 @@ import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans;
import org.springframework.util.CollectionUtils;
@@ -41,6 +43,8 @@ public class TheRapyRecuperationConfigController {
@Inject
private Dao dao;
@Inject
private RedisService redisService;
@At("")
@@ -53,8 +57,7 @@ public class TheRapyRecuperationConfigController {
@ViReturn
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
public Object operation(TheRapyRecuperationConfig config,
@Param(value = "lotDeleteList", required = false) String[] lotDeleteList) {
public Object operation(TheRapyRecuperationConfig config, String[] lotDeleteList) {
if (Strings.isNotBlank(config.getId())) {
if (Lang.isNotEmpty(lotDeleteList)) {
dao.clear(TheRapyRecuperationLot.class, Cnd.where("id", "in", lotDeleteList));
@@ -68,6 +71,11 @@ public class TheRapyRecuperationConfigController {
} else {
dao.insertWith(config, "lots");
}
// 将配置存储到redis里边可以避免每次都去查一次数据库
String configCache = RedisConstant.REDIS_KEY_THE_RAPY_RECU_CONFIG_CACHE;
redisService.del(configCache);
redisService.set(configCache, JSONUtil.toJsonStr(config));
return null;
}
@@ -75,32 +83,31 @@ public class TheRapyRecuperationConfigController {
@ViReturn
@RequiresAuthentication
public Object findOne() {
return dao.fetchLinks(dao.fetch(TheRapyRecuperationConfig.class), "lots", Cnd.NEW().desc("lotValue"));
return dao.fetchLinks(dao.fetch(TheRapyRecuperationConfig.class), "lots",Cnd.NEW().desc("lotValue"));
}
/**
* 查使用该标段的线路和目的地
*
* @param lotId
* @return
*/
@At
@ViReturn
@RequiresAuthentication
public Object getLotsById(String lotId) {
public Object getLotsById(String lotId){
List<String> lineNames = new ArrayList<>();
List<String> baseNames = new ArrayList<>();
Map<String, List<String>> map = new HashMap<>();
List<TheRapyRecuperationLine> lineList = dao.query(TheRapyRecuperationLine.class, Cnd.where("lotId", "=", lotId));
if (!CollectionUtils.isEmpty(lineList)) {
lineList.forEach(v -> lineNames.add(v.getLineName()));
map.put("line", lineNames);
if (!CollectionUtils.isEmpty(lineList)){
lineList.forEach(v-> lineNames.add(v.getLineName()));
map.put("line",lineNames);
}
List<TheRapyRecuperationBaseManagement> managementList = dao.query(TheRapyRecuperationBaseManagement.class, Cnd.where("lotId", "=", lotId));
if (!CollectionUtils.isEmpty(managementList)) {
managementList.forEach(v -> baseNames.add(v.getBaseName()));
map.put("base", baseNames);
if (!CollectionUtils.isEmpty(managementList)){
managementList.forEach(v-> baseNames.add(v.getBaseName()));
map.put("base",baseNames);
}
return map;
}
@@ -108,16 +115,15 @@ public class TheRapyRecuperationConfigController {
/**
* 强制删除标段时长会删除已绑定的线路和目的地
*
* @param lotId
* @return
*/
@At
@ViReturn
@RequiresAuthentication
public Object deleteLotById(String lotId) {
Trans.exec(() -> {
dao.clear(TheRapyRecuperationLot.class, Cnd.where("id", "=", lotId));
public Object deleteLotById(String lotId){
Trans.exec(()->{
dao.clear(TheRapyRecuperationLot.class, Cnd.where("id","=",lotId));
List<TheRapyRecuperationLine> lineList = dao.query(TheRapyRecuperationLine.class, Cnd.where("lotId", "=", lotId));
if (!CollectionUtils.isEmpty(lineList)) {
lineList.forEach(v -> v.setLotId(null));
@@ -21,7 +21,7 @@ public class TheRapyTravelLineExcelMode {
@Excel(name = "活动范围")
private String regionalNature;
@Excel(name = "最少成团人数")
@Excel(name = "最少参与教工")
private Integer minimumGroupSize;
// @Excel(name = "创建模式(分工会/校工会)")
@@ -11,7 +11,7 @@ import java.util.Date;
import java.util.List;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationBaseManagement
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement
* @Description: TODO
* @Author zzr
* @Date 2023/6/5
@@ -128,6 +128,14 @@ public class TheRapyRecuperationBaseManagement {
@Excel(name = "组织形式(分工会/校工会)")
private int createMode;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地联系人")
@Excel(name = "目的地联系人")
private String baseContactPerson;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地联系人电话")
@@ -8,7 +8,7 @@ import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationCluster
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster
* @Description: TODO
* @Author zxc
* @Date 2022/6/17:09:30
@@ -6,7 +6,7 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationClusterMember
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationClusterMember
* @Description: TODO
* @Author zxc
* @Date 2022/6/17:09:30
@@ -34,6 +34,11 @@ public class TheRapyRecuperationConfig {
@Comment("省外名额分配")
private Integer outsideQuota;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("省外名额分配")
private String outsideQuotaMode;
@Column
@ColDefine(type = ColType.FLOAT, width = 3, precision = 2)
@Comment("省外名额分配比例")
@@ -79,7 +84,6 @@ public class TheRapyRecuperationConfig {
@Comment("标段")
private List<NutMap> modifyBd;
@Many(field = "configId")
private List<TheRapyRecuperationLot> lots;
@@ -93,11 +97,23 @@ public class TheRapyRecuperationConfig {
@Comment("疗休养服务须知")
private String notice;
@Column
@ColDefine(type = ColType.INT)
@Comment("省内起始年份")
private Integer provinceStartYear;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("床位信息")
private Boolean bedInfo;
@Column
@ColDefine(type = ColType.INT)
@Comment("家属信息")
private Integer familyInfo;
@Column
@Comment("分工会人数限制")
@ColDefine(type = ColType.MYSQL_JSON)
private List<NutMap> unionLimit;
}
@@ -12,7 +12,7 @@ import java.util.Date;
import java.util.List;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnroll
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll
* @Description: 疗休养报名登记表
* @Author zxc
* @Date 2022/5/31:16:58
@@ -143,6 +143,24 @@ public class TheRapyRecuperationEnroll extends BaseModel {
@Many(field = "trreId")
private List<TheRapyRecuperationEnrollCompanion> companionList;
/**
* 酒店信息
*/
@One(field = "takePartInBaseManagementId")
private TheRapyRecuperationBaseManagement managementInfo;
/**
* 线路信息
*/
// @One(field = "takePartInLineId")
private TheRapyRecuperationLine lineInfo;
private String lineId;
private Date playStartTime;
private Date playEndTime;
/**
* 床位信息
*/
@@ -179,4 +197,10 @@ public class TheRapyRecuperationEnroll extends BaseModel {
@Comment("校工会审核Id")
private String schoolUnionAuditId;
@Column
@ColDefine(type = ColType.INT)
@Comment("家属数量")
private Integer familyNumber;
private String firstLetter;
}
@@ -8,7 +8,7 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnrollBed
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollBed
* @Description: 报名拼床信息
* @Author zxc
* @Date 2022/6/2:14:44
@@ -8,7 +8,7 @@ import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnrollChangeRecord
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollChangeRecord
* @Description: 疗休养登记变更记录表
* @Author zxc
* @Date 2022/5/31:17:10
@@ -8,7 +8,7 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnrollFamily
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollFamily
* @Description: TODO
* @Author zxc
* @Date 2022/5/31:17:07
@@ -0,0 +1,58 @@
package io.v.nutz.zhgh.therapyRecuperation.model;
import io.v.nutz.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = true)
@Table
public class TheRapyRecuperationEvaluate extends BaseModel implements Serializable {
@Name
@Column
@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 lineId;
@Column
@Comment("用户ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userId;
@Column
@Comment("姓名")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userName;
@Column
@Comment("工号")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String loginName;
@Column
@Comment("评分")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String evaluateScore;
@Column
@Comment("评价内容")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String evaluateText;
@Column
@Comment("评价时间")
@ColDefine(type = ColType.DATETIME)
private Date applyDate;
}
@@ -12,7 +12,7 @@ import java.util.Date;
import java.util.List;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationLine
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine
* @Description: 疗休养线路管理
* @Author zxc
* @Date 2022/5/31:09:13
@@ -61,7 +61,7 @@ public class TheRapyRecuperationLine extends BaseModel {
@Column
@ColDefine(type = ColType.INT)
@Comment("最少成团人数")
@Comment("最少参与教工")
private Integer minimumGroupSize;
@Column
@@ -116,7 +116,7 @@ public class TheRapyRecuperationLine extends BaseModel {
@Column
@ColDefine(type = ColType.INT)
@Comment("预计人数(含家属")
@Comment("成团人数包括家属")
private Integer estimatedFamilyNumbers;
@Column
@@ -92,11 +92,11 @@ public class TheRapyRecuperationLineUnionSelect extends BaseModel {
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否公开")
private boolean isOpen;
private Boolean isOpen;
@Column
@ColDefine(type = ColType.INT)
@Comment("最少成团人数")
@Comment("最少参与教工")
private Integer minimumGroupSize;
@@ -112,7 +112,7 @@ public class TheRapyRecuperationLineUnionSelect extends BaseModel {
@Column
@ColDefine(type = ColType.INT)
@Comment("预计人数(含家属")
@Comment("成团人数包括家属")
private Integer estimatedFamilyNumbers;
@Column
@@ -6,7 +6,7 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationLot
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot
* @Description: TODO
* @Author zzr
* @Date 2023/6/6
@@ -11,7 +11,7 @@ import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationTravelAgency
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency
* @Description: 疗休养旅行社管理
* @Author zxc
* @Date 2022/5/31:14:39
@@ -18,7 +18,7 @@ public interface TheRapyRecuperationAuditService extends ViService<Audit> {
* @param year 可为空
* @return
*/
List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year, Integer signUpMode);
List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year,String endYear, Integer signUpMode);
/**
@@ -29,5 +29,12 @@ public interface TheRapyRecuperationAuditService extends ViService<Audit> {
NutMap findOne(String id);
/**
* 校工会审核
* @param stateId
* @param loginName
* @param adjustment
* @param takePartInLineId
*/
void schoolAudit(Integer stateId, String loginName,Boolean adjustment, String takePartInLineId);
}
@@ -29,6 +29,10 @@ public interface TheRapyRecuperationEnrollService extends ViService<TheRapyRecup
*/
Pagination enrollPageData(PageForm pageForm, Integer year, String unionId, int trrt, Integer lineUnionType);
List<NutMap> getSelectLineById(String lineId, String unionId, int trrt, Integer lineUnionType);
Object openSignUser(String usId, String travelId, String searchKeyWord);
/**
* 线路报名
*
@@ -78,7 +82,9 @@ public interface TheRapyRecuperationEnrollService extends ViService<TheRapyRecup
Map<Boolean, String> validSignUpInfoForZJXU(String loginName, TheRapyRecuperationEnroll enrollInfo);
Map<Boolean, String> validSignUpInfoForZJNU(String loginName, TheRapyRecuperationEnroll enrollInfo);
Map<Boolean, String> validSignUpInfoForHMC(String loginName, TheRapyRecuperationEnroll enrollInfo);
/**
* 我报名的页面数据
*
@@ -9,7 +9,7 @@ import java.util.List;
public interface TheRapyRecuperationLineAdjustmentService extends ViService {
Pagination pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords);
Pagination pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords, String regionalNature, String lotId);
List findUnionSignUpModeUserList(String lineId, String unionId);
@@ -10,7 +10,7 @@ import org.nutz.lang.util.NutMap;
import java.util.List;
/**
* @FileName io.v.nutz.therapyRecuperation.service.TheRapyRecuperationLineService
* @FileName io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService
* @Description: 疗休养线路管理service
* @Author zxc
* @Date 2022/5/31:09:45
@@ -24,7 +24,7 @@ public interface TheRapyRecuperationLineUnionSelectService extends ViService<The
* @param cnd cnd
* @return {@link Pagination}
*/
Pagination pageData(PageForm pageForm, Cnd cnd);
Pagination pageData(PageForm pageForm, Cnd cnd, Integer year);
/**
@@ -49,7 +49,7 @@ public interface TheRapyRecuperationLineUnionSelectService extends ViService<The
* @param lineId 行id
* @return {@link Object}
*/
Object selectLineInfo(String lineId, String unionId,Integer mode);
Object selectLineInfo(String lineId, String unionId,Integer mode, Integer year);
/**
* 设置线路时间信息
@@ -1,16 +1,22 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollBed;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationAuditService;
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.Strings;
import org.nutz.lang.util.NutMap;
@@ -23,12 +29,16 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
super(dao);
}
@Inject
private MsgApi msgApi;
@Override
public List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year, Integer signUpMode) {
public List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year,String endYear, Integer signUpMode) {
Sql sql = Sqls.create("""
SELECT
line.*,
lineu.id as selectId,
un.unionname,
DATE_FORMAT(lineu.playStartTime,'%Y-%m-%d') as playStartTime1
FROM
@@ -51,11 +61,18 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
}
cnd.andEX("lineu.signUpMode", "=", signUpMode);
cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.andEX("YEAR(enroll.signingUptime)", "=", year);
if (StrUtil.isNotBlank(endYear)){
cnd.andEX("YEAR(enroll.signingUptime)", ">=", year);
cnd.andEX("YEAR(enroll.signingUptime)", "<=", endYear);
} else {
cnd.andEX("YEAR(enroll.signingUptime)", "=", year);
}
cnd.and("enroll.takePartInLineId", "is not", null);
cnd.and("enroll.takePartInLineId", "!=", "");
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.groupBy("enroll.takePartInLineId");
cnd.asc("un.unionname");
cnd.groupBy("line.id");
cnd.having(Cnd.where("playStartTime1", "is not", null));
cnd.asc("un.unionname").asc("lineu.lineId").asc("lineu.playStartTime");
sql.setCondition(cnd);
return listMap(sql);
}
@@ -104,4 +121,21 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
return map;
}
@Override
public void schoolAudit(Integer stateId, String loginName, Boolean adjustment, String takePartInLineId) {
Sys_user user = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName));
TheRapyRecuperationLineUnionSelect unionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "=", takePartInLineId));
TheRapyRecuperationLine theRapyRecuperationLine = dao().fetch(TheRapyRecuperationLine.class, Cnd.where("id", "=", unionSelect.getLineId()));
String content = "【智慧工会】%s老师您好,您报名的%s线路因报名人数不足已取消,请尽快进入智慧工会重新选择线路。"
.formatted(user.getUsername(),theRapyRecuperationLine.getLineName());
if (stateId.equals(TheRapyRecuperationState.PASS)) {
content = "【智慧工会】%s老师您好,您报名的%s线路已组团成功,请按约定出行。"
.formatted(user.getUsername(), theRapyRecuperationLine.getLineName());
}
// msgApi.sendMsg(content,user.getLoginname(), MsgApi.DING_DING_TEMPLATE_ID);
}
}
@@ -12,7 +12,7 @@ import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationCommonServiceImpl
* @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationCommonServiceImpl
* @Description: TODO
* @Author zxc
* @Date 2022/6/6:10:46
@@ -13,7 +13,7 @@ import java.util.List;
import java.util.Map;
/**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationEnrollJoinUserImportServiceImpl
* @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationEnrollJoinUserImportServiceImpl
* @Description: TODO
* @Author zxc
* @Date 2022/6/14:09:57
@@ -20,7 +20,7 @@ import org.nutz.lang.util.NutMap;
import java.util.List;
/**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationLineAdjustmentServiceImpl
* @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationLineAdjustmentServiceImpl
* @Description: TODO
* @Author zxc
* @Date 2022/6/10:10:04
@@ -34,14 +34,14 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
}
@Override
public Pagination pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords) {
public Pagination pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords, String regionalNature, String lotId) {
Sql sql = Sqls.create("""
SELECT
line.id,
line.serialNumber,
line.lineName,
line.regionalNature,
line.minimumGroupSize,
us.minimumGroupSize,
line.`year`,
line.isDisabled,
line.playNumberOfDays,
@@ -51,6 +51,7 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
line.changeEndTime,
line.signUpMode,
line.createMode,
us.id as usId,
us.playStartTime,
us.playEndTime,
line.files,
@@ -59,8 +60,9 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
ta.travelAgencyName,
us.unionId,
select_gh.unionname AS selectUnionName,
(select count(1) from the_rapy_recuperation_enroll where takePartInUnionId = us.unionId AND takePartInLineId = line.id and isNormal=true) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInUnionId = us.unionId AND takePartInLineId = line.id and isNormal=true)) as signUpUserFamilyNum
(select count(1) from the_rapy_recuperation_enroll where if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) AND takePartInLineId = us.id and isNormal=true) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) AND takePartInLineId = us.id and isNormal=true)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber
FROM
the_rapy_recuperation_line_union_select us
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
@@ -70,11 +72,14 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
$condition
""");
sql.setParam("signUpSuccessCode", TheRapyRecuperationState.PASS);
sql.setParam("year", year);
Cnd cnd = Cnd.NEW();
cnd.andEX("line.regionalNature","=",regionalNature);
cnd.andEX("line.lotId", "=", lotId);
//cnd.and("line.signUpMode", "=", TheRapyRecuperationSignUpMode.UNION.getValue());
cnd.and("us.playStartTime", "is not", null);
cnd.andEX("line.year", "=", year);
//cnd.andEX("line.year", "=", year);
cnd.andEX("line.id", "=", lineId);
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.andEX("us.unionId", "=", unionId);
@@ -92,6 +97,7 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
if (Vi.isNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy());
}
cnd.and("year(selectTime)", "=", year);
sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@@ -108,13 +114,15 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
e.unionName,
e.signingUptime,
e.isNormal,
count(c.id) as companionCount
count(c.id) as companionCount,
e.familyNumber
FROM
the_rapy_recuperation_enroll e
LEFT JOIN the_rapy_recuperation_enroll_companion c ON c.trreId = e.id
left join the_rapy_recuperation_line_union_select us on e.takePartInLineId = us.id
WHERE
e.takePartInLineId = @lineId
AND e.takePartInUnionId = @unionId
and if(us.signUpMode = 1, e.takePartInUnionId = @unionId, 1=1)
GROUP BY e.id
""");
// AND (e.stateId = @passStateCode or e.stateId is null)
@@ -4,11 +4,11 @@ import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationClusterMember;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineClusterService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
@@ -25,7 +25,7 @@ import java.util.Map;
import java.util.stream.Collectors;
/**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationLineClusterServiceImpl
* @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationLineClusterServiceImpl
* @Description: 组团
* @Author zxc
* @Date 2022/6/17:09:04
@@ -28,7 +28,7 @@ import java.util.Date;
import java.util.List;
/**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationLineServiceImpl
* @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationLineServiceImpl
* @Description: TODO
* @Author zxc
* @Date 2022/5/31:09:47
@@ -212,18 +212,20 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
enroll.userName,
enroll.unionName,
enroll.unitName,
enroll.familyNumber,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id) isFamily
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
WHERE
lineu.lineId = @takePartInLineId
lineu.id = @takePartInLineId
and enroll.stateId=@stateId
$unionCnd
""").setParam("takePartInLineId", lineId).setParam("stateId", TheRapyRecuperationState.PASS);
if (StrUtil.isNotBlank(unionId) && !ShiroUtil.hasAnyRoles("sysadmin")) {
sql.setVar("unionCnd", "and (enroll.takePartInUnionId='%s' or enroll.selfUnionId='%s')".formatted(unionId, unionId));
// sql.setVar("unionCnd", "and (enroll.takePartInUnionId='%s' or enroll.selfUnionId='%s')".formatted(unionId, unionId));
sql.setVar("unionCnd", "and enroll.selfUnionId='%s'".formatted(unionId));
}
Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
List<NutMap> list = pagination.getList();
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.Vi;
@@ -24,7 +25,7 @@ import java.util.List;
import java.util.stream.Collectors;
/**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationLineUnionSelectServiceImpl
* @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationLineUnionSelectServiceImpl
* @Description: 分工会选择线路
* @Author zxc
* @Date 2022/6/1:10:18
@@ -46,7 +47,7 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
* @return {@link Pagination}
*/
@Override
public Pagination pageData(PageForm pageForm, Cnd cnd) {
public Pagination pageData(PageForm pageForm, Cnd cnd, Integer year) {
Sql sql = Sqls.create("""
select
line.id,
@@ -83,13 +84,18 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
LEFT JOIN the_rapy_recuperation_travel_agency ta on ta.id = line.travelAgencyId
LEFT JOIN sys_union gh ON gh.id = line.createUnionid
LEFT JOIN sys_user u ON u.id = line.opBy
LEFT JOIN the_rapy_recuperation_line_union_select us on us.lineId = line.id AND us.unionId = @unionId AND us.selectUserId = @userId
LEFT JOIN the_rapy_recuperation_line_union_select us on us.lineId = line.id and year(selectTime) = @year $us
LEFT JOIN sys_union usUnion on usUnion.id = us.unionId
LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId
$condition
""");
sql.setParam("unionId", Vi.getUnionId());
sql.setParam("userId", ShiroUtil.getPrincipalProperty("id"));
if(!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
sql.setVar("us", "AND us.unionId = '%s' AND us.selectUserId = '%s'".formatted(Vi.getUnionId(), ShiroUtil.getPlatformUid()));
}
//sql.setParam("unionId", Vi.getUnionId());
//sql.setParam("userId", ShiroUtil.getPrincipalProperty("id"));
sql.setParam("year", year == null ? DateUtil.thisYear() : year);
/*SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.createUnionId", "=", Vi.getUnionId());
@@ -151,7 +157,7 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
* @return {@link Object}
*/
@Override
public Object selectLineInfo(String lineId, String unionId, Integer mode) {
public Object selectLineInfo(String lineId, String unionId, Integer mode, Integer year) {
Sql sql;
sql = Sqls.create("""
@@ -176,11 +182,13 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
where unionId = @unionId
and lineId = @lineId
and signUpMode = @mode
and year(selectTime) = @year
ORDER BY signUpStartTime ASC
""");
sql.setParam("unionId", unionId);
sql.setParam("lineId", lineId);
sql.setParam("mode", mode);
sql.setParam("year", year == null ? DateUtil.thisYear() : year);
return listMap(sql);
@@ -15,7 +15,7 @@ import org.nutz.ioc.loader.annotation.IocBean;
import java.util.List;
/**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationTravelAgencyServiceImpl
* @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationTravelAgencyServiceImpl
* @Description: 疗休养旅行社
* @Author zxc
* @Date 2022/5/31:14:46
@@ -6,6 +6,7 @@ import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpActivity;
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpUser;
import io.v.nutz.zhgh.trainSignUp.service.TrainSignUpActivityService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
@@ -44,7 +45,7 @@ public class TrainSignUpActivityAddController {
@At
@ViReturn
@Ok("json:full")
@RequiresPermissions("trainSingUp.manage.activity.add")
@RequiresAuthentication
public Object getUnionLimit(@Param(value = "activityScopeId", required = false) String activityScopeId) {
Sql sql = Sqls.create("""
SELECT
@@ -14,6 +14,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
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.ioc.aop.Aop;
@@ -28,6 +29,7 @@ import org.nutz.mvc.annotation.Param;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
/**
* @ClassName WelfareChooseController
@@ -40,12 +42,15 @@ import java.util.List;
@At("/platform/welfare/userChoose")
public class WelfareUserChooseController {
@Inject
private Dao dao;
@Inject
private SimpleService simpleService;
@Inject
private WelfareProjectService welfareProjectService;
private final ReentrantLock lock = new ReentrantLock(true);
@At("")
@Ok("beetl:/platform/welfare/userChoose.html")
@RequiresPermissions("welfare.user.choose")
@@ -56,7 +61,6 @@ public class WelfareUserChooseController {
@ViReturn
@RequiresPermissions("welfare.user.choose")
public Object pageData(PageForm pageForm, Integer year) {
Sql sql = Sqls.create("""
SELECT
wp.*,
@@ -96,29 +100,44 @@ public class WelfareUserChooseController {
@SLog(type = "welfare", tag = "pc电脑选福利", msg = "福利")
@RequiresPermissions("welfare.user.choose")
public Object doChoose(String chooseIds, String projectId, String subjectId, String receiveAddress) {
//删除上次选择的
simpleService.dao().clear(WelfareUserSelection.class, Cnd.where("welfareId", "=", projectId)
.and("selectUserId", "=", ShiroUtil.getUserId()));
try {
lock.lock();
// 查询有没有这个人
int count = dao.count(WelfareList.class, Cnd.where("userId", "=", ShiroUtil.getUserId()).and("projectId", "=", projectId));
if (count <= 0) {
return Result.error("您不在此次选择名单中,如有疑问请及时联系校工会");
}
//删除上次选择的
simpleService.dao().clear(WelfareUserSelection.class, Cnd.where("welfareId", "=", projectId)
.and("selectUserId", "=", ShiroUtil.getUserId()));
List<WelfareUserSelection> insertList = new ArrayList<>();
List<String> ids = Json.fromJsonAsList(String.class, chooseIds);
ids.forEach(s -> {
WelfareUserSelection selection = new WelfareUserSelection();
selection.setWelfareId(projectId);
selection.setSubjectId(subjectId);
selection.setSelectUserId(ShiroUtil.getUserId());
selection.setSelectTime(new Date());
selection.setSelectOptionId(s);
selection.setReceiveAddress(receiveAddress);
insertList.add(selection);
});
simpleService.dao().insert(insertList);
simpleService.dao().update(WelfareList.class,
Chain.make("isReceive", true),
Cnd.where("projectId", "=", projectId)
.and("userId", "=", ShiroUtil.getUserId()));
return null;
List<WelfareUserSelection> insertList = new ArrayList<>();
List<String> ids = Json.fromJsonAsList(String.class, chooseIds);
ids.forEach(s -> {
WelfareUserSelection selection = new WelfareUserSelection();
selection.setWelfareId(projectId);
selection.setSubjectId(subjectId);
selection.setSelectUserId(ShiroUtil.getUserId());
selection.setSelectTime(new Date());
selection.setSelectOptionId(s);
selection.setReceiveAddress(receiveAddress);
insertList.add(selection);
});
simpleService.dao().insert(insertList);
simpleService.dao().update(WelfareList.class,
Chain.make("isReceive", true),
Cnd.where("projectId", "=", projectId)
.and("userId", "=", ShiroUtil.getUserId()));
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
} finally {
lock.unlock();
}
}
@@ -129,23 +148,37 @@ public class WelfareUserChooseController {
@RequiresPermissions("welfare.user.choose")
public Result confirmSelect(@Param("welfareUserSelections") WelfareUserSelection[] welfareUserSelections,
String projectId) {
//删除上次选择的
simpleService.dao().clear(WelfareUserSelection.class,
Cnd.where("welfareId", "=", projectId)
.and("selectUserId", "=", ShiroUtil.getUserId()));
try {
lock.lock();
// 查询有没有这个人
int count = dao.count(WelfareList.class, Cnd.where("userId", "=", ShiroUtil.getUserId()).and("projectId", "=", projectId));
if (count <= 0) {
return Result.error("您不在此次选择名单中,如有疑问请及时联系校工会");
}
for (WelfareUserSelection welfareUserSelection : welfareUserSelections) {
welfareUserSelection.setSelectUserId(ShiroUtil.getUserId());
welfareUserSelection.setSelectTime(new Date());
//删除上次选择的
simpleService.dao().clear(WelfareUserSelection.class,
Cnd.where("welfareId", "=", projectId)
.and("selectUserId", "=", ShiroUtil.getUserId()));
for (WelfareUserSelection welfareUserSelection : welfareUserSelections) {
welfareUserSelection.setSelectUserId(ShiroUtil.getUserId());
welfareUserSelection.setSelectTime(new Date());
}
simpleService.dao().insert(welfareUserSelections);
simpleService.dao().update(WelfareList.class,
Chain.make("isReceive", true),
Cnd.where("projectId", "=", projectId)
.and("userId", "=", ShiroUtil.getUserId()));
return Result.success("选择成功");
} catch (Exception e) {
e.printStackTrace();
return Result.error();
} finally {
lock.unlock();
}
simpleService.dao().insert(welfareUserSelections);
simpleService.dao().update(WelfareList.class,
Chain.make("isReceive", true),
Cnd.where("projectId", "=", projectId)
.and("userId", "=", ShiroUtil.getUserId()));
return Result.success("选择成功");
}
@@ -799,10 +799,11 @@ public class WelfareSingleController {
wl.userState,
wl.personType,
gh.unionname,
dw.name as unitname,
dw.name as unitname,
IF(LOCATE('undefined',wpus.receiveAddress)>0,NULL,wpus.receiveAddress) as receiveAddress,
wpus.selectNum,
wpso.optionName
wpso.optionName,
wpus.selectSpecs
FROM
welfare_project_user_selection wpus
left join user u on u.id = wpus.selectUserId
@@ -855,6 +856,7 @@ public class WelfareSingleController {
exportEntities.add(new ExcelExportEntity("所在分工会", "unionname", 30));
exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 50));
exportEntities.add(new ExcelExportEntity("选择份数", "selectNum", 10));
exportEntities.add(new ExcelExportEntity("规格参数", "selectSpecs", 20));
// if (Globals.MyConfig.getBoolean("isThreeUnit")) {
// exportEntities.add(new ExcelExportEntity("所在部门", "threeUnitName", 50));
// }
@@ -22,15 +22,21 @@ public class WelfareExportEntityTc {
@Excel(name = "姓名", width = 20d)
private String userName;
@Excel(name = "所属工会", width = 20d)
@Excel(name = "所属工会", width = 30d)
private String unionName;
// @Excel(name = "所属单位", width = 60d)
// private String unitName;
@Excel(name = "工会小组", width = 30d)
private String unionGroupName;
@Excel(name = "所属单位", width = 30d)
private String unitName;
@Excel(name = "已选福利", width = 80d)
private String optionName;
@Excel(name = "规格参数", width = 50d)
private String selectSpecs;
@Excel(name = "收货人", width = 15d)
private String recipient;
@@ -8,6 +8,7 @@ import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.export.ExcelExportService;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import com.alibaba.fastjson.JSON;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.service.impl.ViServiceImpl;
@@ -464,13 +465,15 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
u.loginname AS loginName,
u.username AS userName,
vwl.unionname,
vwl.unionname as unionName,
vwl.unitname,
vwl.unionname AS unionName,
vwl.unitname AS unitName,
vwl.unionGroupName,
u.idcard AS idCard,
u.mobile,
IF(LOCATE('undefined',wpus.receiveAddress)>0,NULL,wpus.receiveAddress) as receiveAddress,
wpus.userSign,
GROUP_CONCAT(DISTINCT wpso.optionName, IF(wpus.selectSpecs is not null, (CONCAT('规格:', wpus.selectSpecs)), ''), '',wpus.selectNum,'') optionName,
GROUP_CONCAT(DISTINCT wpso.optionName, '',wpus.selectNum,'') optionName,
wpus.selectSpecs,
wpus.courierNumber
FROM
welfare_project_user_selection wpus
@@ -645,14 +648,33 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
@Override
public void exportReceiveDetail(String projectId, String welfareUnitId, List<NutMap> allUser, List<NutMap> userChooseList, OutputStream outputStream) throws Exception {
Sql optionSql = Sqls.create("""
SELECT w2.id, w2.optionName
FROM `welfare_project_subject` w1
JOIN `welfare_project_subject_option` w2 ON w1.id = w2.subjectId
WHERE w1.projectId = @projectId;
SELECT
w2.id,
w2.optionName,
jt.fullOptionName AS fullOptionName
FROM
`welfare_project_subject` w1
JOIN
`welfare_project_subject_option` w2 ON w1.id = w2.subjectId
LEFT JOIN
JSON_TABLE(
w2.specs,
'$[*]' COLUMNS (
fullOptionName VARCHAR(255) PATH '$.value'
)
) AS jt ON 1=1
WHERE
w1.projectId = @projectId
""");
optionSql.setParam("projectId", projectId);
List<NutMap> options = (List<NutMap>) Daos.query(dao(), optionSql.toString(), Sqls.callback.maps());
// for (NutMap option : options) {
// if (StrUtil.isNotBlank(option.getString("fullOptionName"))) {
// option
// }
// }
// Sql sql = Sqls.create("""
// SELECT
// vwl.loginname,
@@ -680,7 +702,8 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
dw.`name` as unitname,
wpus.userSign,
wpus.selectOptionId,
wpus.selectNum
wpus.selectNum,
wpus.selectSpecs
FROM
welfare_list vwl
LEFT JOIN special_staff staff ON staff.userId = vwl.userId
@@ -726,7 +749,10 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
exportEntities.add(excelExportEntity1);
for (NutMap option : options) {
exportEntities.add(new ExcelExportEntity(option.getString("optionName"), option.getString("id"), 10));
exportEntities.add(new ExcelExportEntity(option.getString("optionName")
+ (StrUtil.isNotBlank(option.getString("fullOptionName")) ? ("-" + option.getString("fullOptionName")) : "")
, option.getString("id") + (StrUtil.isNotBlank(option.getString("fullOptionName")) ? ("-" + option.getString("fullOptionName")) : "")
, 40));
}
ExcelExportEntity excelExportEntity = new ExcelExportEntity();
excelExportEntity.setName("签字");
@@ -749,12 +775,29 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
data.put("qzBytes", userMap.get("qzBytes"));
for (NutMap option : options) {
if (StrUtil.isNotBlank(userMap.getString("selectOptionId"))) {
NutMap selectOption = list.stream().filter(x -> x.getString("loginname").equals(v) && x.getString("selectOptionId").equals(option.getString("id"))).findFirst().orElse(null);
if (Lang.isNotEmpty(selectOption)) {
data.put(option.getString("id"), selectOption.getInt("selectNum"));
} else {
data.put(option.getString("id"), 0);
if (StrUtil.isNotBlank(userMap.getString("selectSpecs"))) {
if (StrUtil.isNotBlank(userMap.getString("selectOptionId"))) {
String opId = (option.getString("id") + (StrUtil.isNotBlank(option.getString("fullOptionName")) ? ("-" + option.getString("fullOptionName")) : ""));
String userSpecs = userMap.getString("selectOptionId") + "-" + userMap.getString("selectSpecs");
if (opId.equals(userSpecs)) {
data.put(opId, userMap.getInt("selectNum"));
} else {
data.put(opId, 0);
}
}
} else {
if (StrUtil.isNotBlank(userMap.getString("selectOptionId"))) {
NutMap selectOption = list.stream()
.filter(x -> x.getString("loginname").equals(v)
&& x.getString("selectOptionId").equals(option.getString("id")))
.findFirst().orElse(null);
if (Lang.isNotEmpty(selectOption)) {
data.put(option.getString("id"), selectOption.getInt("selectNum"));
} else {
data.put(option.getString("id"), 0);
}
}
}
}
@@ -767,9 +810,18 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
NutMap totalMap = NutMap.NEW();
totalMap.put("no", "合计");
for (NutMap option : options) {
List<NutMap> selectOptionList = list.stream().filter(x -> StrUtil.isNotBlank(x.getString("selectOptionId")) && x.getString("selectOptionId").equals(option.getString("id"))).collect(Collectors.toList());
String opId = (option.getString("id") + (StrUtil.isNotBlank(option.getString("fullOptionName")) ? ("-" + option.getString("fullOptionName")) : ""));
List<NutMap> selectOptionList = list.stream()
.filter(x -> {
String userSpecs = "";
if (StrUtil.isNotBlank(x.getString("selectOptionId"))) {
userSpecs = x.getString("selectOptionId")
+ (StrUtil.isNotBlank(x.getString("selectSpecs")) ? ( "-" + x.getString("selectSpecs")) : "");
}
return StrUtil.isNotBlank(userSpecs) && userSpecs.equals(opId);
}).toList();
int selectNum = selectOptionList.stream().mapToInt(s -> s.getInt("selectNum")).sum();
totalMap.put(option.getString("id"), selectNum);
totalMap.put(opId, selectNum);
}
dataList.add(totalMap);
/*ExportParams exportParams = new ExportParams();
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,28 @@
(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length},
write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount;
for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-
7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a},
setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&&
(d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,
78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)-
j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+
2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0>
this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],
[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,
116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,
43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,
3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,
55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,
45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4*
(a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b),
j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width",
d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,927 @@
/*
PinchZoom.js
Copyright (c) Manuel Stofer 2013 - today
Author: Manuel Stofer (mst@rtp.ch)
Version: 2.3.5
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// polyfills
if (typeof Object.assign != 'function') {
// Must be writable: true, enumerable: false, configurable: true
Object.defineProperty(Object, "assign", {
value: function assign(target, varArgs) { // .length of function is 2
if (target == null) { // TypeError if undefined or null
throw new TypeError('Cannot convert undefined or null to object');
}
var to = Object(target);
for (var index = 1; index < arguments.length; index++) {
var nextSource = arguments[index];
if (nextSource != null) { // Skip over if undefined or null
for (var nextKey in nextSource) {
// Avoid bugs when hasOwnProperty is shadowed
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
to[nextKey] = nextSource[nextKey];
}
}
}
}
return to;
},
writable: true,
configurable: true
});
}
if (typeof Array.from != 'function') {
Array.from = function (object) {
return [].slice.call(object);
};
}
// utils
var buildElement = function(str) {
// empty string as title argument required by IE and Edge
var tmp = document.implementation.createHTMLDocument('');
tmp.body.innerHTML = str;
return Array.from(tmp.body.children)[0];
};
var triggerEvent = function(el, name) {
var event = document.createEvent('HTMLEvents');
event.initEvent(name, true, false);
el.dispatchEvent(event);
};
var definePinchZoom = function () {
/**
* Pinch zoom
* @param el
* @param options
* @constructor
*/
var PinchZoom = function (el, options) {
this.el = el;
this.zoomFactor = 1;
this.lastScale = 1;
this.offset = {
x: 0,
y: 0
};
this.initialOffset = {
x: 0,
y: 0,
};
this.options = Object.assign({}, this.defaults, options);
this.setupMarkup();
this.bindEvents();
this.update();
// The image may already be loaded when PinchZoom is initialized,
// and then the load event (which trigger update) will never fire.
if (this.isImageLoaded(this.el)) {
this.updateAspectRatio();
this.setupOffsets();
}
this.enable();
},
sum = function (a, b) {
return a + b;
},
isCloseTo = function (value, expected) {
return value > expected - 0.01 && value < expected + 0.01;
};
PinchZoom.prototype = {
defaults: {
tapZoomFactor: 2,
zoomOutFactor: 1.3,
animationDuration: 300,
maxZoom: 4,
minZoom: 0.5,
draggableUnzoomed: true,
lockDragAxis: false,
setOffsetsOnce: false,
use2d: true,
zoomStartEventName: 'pz_zoomstart',
zoomUpdateEventName: 'pz_zoomupdate',
zoomEndEventName: 'pz_zoomend',
dragStartEventName: 'pz_dragstart',
dragUpdateEventName: 'pz_dragupdate',
dragEndEventName: 'pz_dragend',
doubleTapEventName: 'pz_doubletap',
verticalPadding: 0,
horizontalPadding: 0,
onZoomStart: null,
onZoomEnd: null,
onZoomUpdate: null,
onDragStart: null,
onDragEnd: null,
onDragUpdate: null,
onDoubleTap: null
},
/**
* Event handler for 'dragstart'
* @param event
*/
handleDragStart: function (event) {
triggerEvent(this.el, this.options.dragStartEventName);
if(typeof this.options.onDragStart == "function"){
this.options.onDragStart(this, event)
}
this.stopAnimation();
this.lastDragPosition = false;
this.hasInteraction = true;
this.handleDrag(event);
},
/**
* Event handler for 'drag'
* @param event
*/
handleDrag: function (event) {
var touch = this.getTouches(event)[0];
this.drag(touch, this.lastDragPosition);
this.offset = this.sanitizeOffset(this.offset);
this.lastDragPosition = touch;
},
handleDragEnd: function () {
triggerEvent(this.el, this.options.dragEndEventName);
if(typeof this.options.onDragEnd == "function"){
this.options.onDragEnd(this, event)
}
this.end();
},
/**
* Event handler for 'zoomstart'
* @param event
*/
handleZoomStart: function (event) {
triggerEvent(this.el, this.options.zoomStartEventName);
if(typeof this.options.onZoomStart == "function"){
this.options.onZoomStart(this, event)
}
this.stopAnimation();
this.lastScale = 1;
this.nthZoom = 0;
this.lastZoomCenter = false;
this.hasInteraction = true;
},
/**
* Event handler for 'zoom'
* @param event
*/
handleZoom: function (event, newScale) {
// a relative scale factor is used
var touchCenter = this.getTouchCenter(this.getTouches(event)),
scale = newScale / this.lastScale;
this.lastScale = newScale;
// the first touch events are thrown away since they are not precise
this.nthZoom += 1;
if (this.nthZoom > 3) {
this.scale(scale, touchCenter);
this.drag(touchCenter, this.lastZoomCenter);
}
this.lastZoomCenter = touchCenter;
},
handleZoomEnd: function () {
triggerEvent(this.el, this.options.zoomEndEventName);
if(typeof this.options.onZoomEnd == "function"){
this.options.onZoomEnd(this, event)
}
this.end();
},
/**
* Event handler for 'doubletap'
* @param event
*/
handleDoubleTap: function (event) {
var center = this.getTouches(event)[0],
zoomFactor = this.zoomFactor > 1 ? 1 : this.options.tapZoomFactor,
startZoomFactor = this.zoomFactor,
updateProgress = (function (progress) {
this.scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);
}).bind(this);
if (this.hasInteraction) {
return;
}
this.isDoubleTap = true;
if (startZoomFactor > zoomFactor) {
center = this.getCurrentZoomCenter();
}
this.animate(this.options.animationDuration, updateProgress, this.swing);
triggerEvent(this.el, this.options.doubleTapEventName);
if(typeof this.options.onDoubleTap == "function"){
this.options.onDoubleTap(this, event)
}
},
/**
* Compute the initial offset
*
* the element should be centered in the container upon initialization
*/
computeInitialOffset: function () {
this.initialOffset = {
x: -Math.abs(this.el.offsetWidth * this.getInitialZoomFactor() - this.container.offsetWidth) / 2,
y: -Math.abs(this.el.offsetHeight * this.getInitialZoomFactor() - this.container.offsetHeight) / 2,
};
},
/**
* Reset current image offset to that of the initial offset
*/
resetOffset: function() {
this.offset.x = this.initialOffset.x;
this.offset.y = this.initialOffset.y;
},
/**
* Determine if image is loaded
*/
isImageLoaded: function (el) {
if (el.nodeName === 'IMG') {
return el.complete && el.naturalHeight !== 0;
} else {
return Array.from(el.querySelectorAll('img')).every(this.isImageLoaded);
}
},
setupOffsets: function() {
if (this.options.setOffsetsOnce && this._isOffsetsSet) {
return;
}
this._isOffsetsSet = true;
this.computeInitialOffset();
this.resetOffset();
},
/**
* Max / min values for the offset
* @param offset
* @return {Object} the sanitized offset
*/
sanitizeOffset: function (offset) {
var elWidth = this.el.offsetWidth * this.getInitialZoomFactor() * this.zoomFactor;
var elHeight = this.el.offsetHeight * this.getInitialZoomFactor() * this.zoomFactor;
var maxX = elWidth - this.getContainerX() + this.options.horizontalPadding,
maxY = elHeight - this.getContainerY() + this.options.verticalPadding,
maxOffsetX = Math.max(maxX, 0),
maxOffsetY = Math.max(maxY, 0),
minOffsetX = Math.min(maxX, 0) - this.options.horizontalPadding,
minOffsetY = Math.min(maxY, 0) - this.options.verticalPadding;
return {
x: Math.min(Math.max(offset.x, minOffsetX), maxOffsetX),
y: Math.min(Math.max(offset.y, minOffsetY), maxOffsetY)
};
},
/**
* Scale to a specific zoom factor (not relative)
* @param zoomFactor
* @param center
*/
scaleTo: function (zoomFactor, center) {
this.scale(zoomFactor / this.zoomFactor, center);
},
/**
* Scales the element from specified center
* @param scale
* @param center
*/
scale: function (scale, center) {
scale = this.scaleZoomFactor(scale);
this.addOffset({
x: (scale - 1) * (center.x + this.offset.x),
y: (scale - 1) * (center.y + this.offset.y)
});
triggerEvent(this.el, this.options.zoomUpdateEventName);
if(typeof this.options.onZoomUpdate == "function"){
this.options.onZoomUpdate(this, event)
}
},
/**
* Scales the zoom factor relative to current state
* @param scale
* @return the actual scale (can differ because of max min zoom factor)
*/
scaleZoomFactor: function (scale) {
var originalZoomFactor = this.zoomFactor;
this.zoomFactor *= scale;
this.zoomFactor = Math.min(this.options.maxZoom, Math.max(this.zoomFactor, this.options.minZoom));
return this.zoomFactor / originalZoomFactor;
},
/**
* Determine if the image is in a draggable state
*
* When the image can be dragged, the drag event is acted upon and cancelled.
* When not draggable, the drag event bubbles through this component.
*
* @return {Boolean}
*/
canDrag: function () {
return this.options.draggableUnzoomed || !isCloseTo(this.zoomFactor, 1);
},
/**
* Drags the element
* @param center
* @param lastCenter
*/
drag: function (center, lastCenter) {
if (lastCenter) {
if(this.options.lockDragAxis) {
// lock scroll to position that was changed the most
if(Math.abs(center.x - lastCenter.x) > Math.abs(center.y - lastCenter.y)) {
this.addOffset({
x: -(center.x - lastCenter.x),
y: 0
});
}
else {
this.addOffset({
y: -(center.y - lastCenter.y),
x: 0
});
}
}
else {
this.addOffset({
y: -(center.y - lastCenter.y),
x: -(center.x - lastCenter.x)
});
}
triggerEvent(this.el, this.options.dragUpdateEventName);
if(typeof this.options.onDragUpdate == "function"){
this.options.onDragUpdate(this, event)
}
}
},
/**
* Calculates the touch center of multiple touches
* @param touches
* @return {Object}
*/
getTouchCenter: function (touches) {
return this.getVectorAvg(touches);
},
/**
* Calculates the average of multiple vectors (x, y values)
*/
getVectorAvg: function (vectors) {
return {
x: vectors.map(function (v) { return v.x; }).reduce(sum) / vectors.length,
y: vectors.map(function (v) { return v.y; }).reduce(sum) / vectors.length
};
},
/**
* Adds an offset
* @param offset the offset to add
* @return return true when the offset change was accepted
*/
addOffset: function (offset) {
this.offset = {
x: this.offset.x + offset.x,
y: this.offset.y + offset.y
};
},
sanitize: function () {
if (this.zoomFactor < this.options.zoomOutFactor) {
this.zoomOutAnimation();
} else if (this.isInsaneOffset(this.offset)) {
this.sanitizeOffsetAnimation();
}
},
/**
* Checks if the offset is ok with the current zoom factor
* @param offset
* @return {Boolean}
*/
isInsaneOffset: function (offset) {
var sanitizedOffset = this.sanitizeOffset(offset);
return sanitizedOffset.x !== offset.x ||
sanitizedOffset.y !== offset.y;
},
/**
* Creates an animation moving to a sane offset
*/
sanitizeOffsetAnimation: function () {
var targetOffset = this.sanitizeOffset(this.offset),
startOffset = {
x: this.offset.x,
y: this.offset.y
},
updateProgress = (function (progress) {
this.offset.x = startOffset.x + progress * (targetOffset.x - startOffset.x);
this.offset.y = startOffset.y + progress * (targetOffset.y - startOffset.y);
this.update();
}).bind(this);
this.animate(
this.options.animationDuration,
updateProgress,
this.swing
);
},
/**
* Zooms back to the original position,
* (no offset and zoom factor 1)
*/
zoomOutAnimation: function () {
if (this.zoomFactor === 1) {
return;
}
var startZoomFactor = this.zoomFactor,
zoomFactor = 1,
center = this.getCurrentZoomCenter(),
updateProgress = (function (progress) {
this.scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);
}).bind(this);
this.animate(
this.options.animationDuration,
updateProgress,
this.swing
);
},
/**
* Updates the container aspect ratio
*
* Any previous container height must be cleared before re-measuring the
* parent height, since it depends implicitly on the height of any of its children
*/
updateAspectRatio: function () {
this.unsetContainerY();
this.setContainerY(this.container.parentElement.offsetHeight);
},
/**
* Calculates the initial zoom factor (for the element to fit into the container)
* @return {number} the initial zoom factor
*/
getInitialZoomFactor: function () {
var xZoomFactor = this.container.offsetWidth / this.el.offsetWidth;
var yZoomFactor = this.container.offsetHeight / this.el.offsetHeight;
return Math.min(xZoomFactor, yZoomFactor);
},
/**
* Calculates the aspect ratio of the element
* @return the aspect ratio
*/
getAspectRatio: function () {
return this.el.offsetWidth / this.el.offsetHeight;
},
/**
* Calculates the virtual zoom center for the current offset and zoom factor
* (used for reverse zoom)
* @return {Object} the current zoom center
*/
getCurrentZoomCenter: function () {
var offsetLeft = this.offset.x - this.initialOffset.x;
var centerX = -1 * this.offset.x - offsetLeft / (1 / this.zoomFactor - 1);
var offsetTop = this.offset.y - this.initialOffset.y;
var centerY = -1 * this.offset.y - offsetTop / (1 / this.zoomFactor - 1);
return {
x: centerX,
y: centerY
};
},
/**
* Returns the touches of an event relative to the container offset
* @param event
* @return array touches
*/
getTouches: function (event) {
var rect = this.container.getBoundingClientRect();
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
var posTop = rect.top + scrollTop;
var posLeft = rect.left + scrollLeft;
return Array.prototype.slice.call(event.touches).map(function (touch) {
return {
x: touch.pageX - posLeft,
y: touch.pageY - posTop,
};
});
},
/**
* Animation loop
* does not support simultaneous animations
* @param duration
* @param framefn
* @param timefn
* @param callback
*/
animate: function (duration, framefn, timefn, callback) {
var startTime = new Date().getTime(),
renderFrame = (function () {
if (!this.inAnimation) { return; }
var frameTime = new Date().getTime() - startTime,
progress = frameTime / duration;
if (frameTime >= duration) {
framefn(1);
if (callback) {
callback();
}
this.update();
this.stopAnimation();
this.update();
} else {
if (timefn) {
progress = timefn(progress);
}
framefn(progress);
this.update();
requestAnimationFrame(renderFrame);
}
}).bind(this);
this.inAnimation = true;
requestAnimationFrame(renderFrame);
},
/**
* Stops the animation
*/
stopAnimation: function () {
this.inAnimation = false;
},
/**
* Swing timing function for animations
* @param p
* @return {Number}
*/
swing: function (p) {
return -Math.cos(p * Math.PI) / 2 + 0.5;
},
getContainerX: function () {
return this.container.offsetWidth;
},
getContainerY: function () {
return this.container.offsetHeight;
},
setContainerY: function (y) {
return this.container.style.height = y + 'px';
},
unsetContainerY: function () {
this.container.style.height = null;
},
/**
* Creates the expected html structure
*/
setupMarkup: function () {
this.container = buildElement('<div class="pinch-zoom-container"></div>');
this.el.parentNode.insertBefore(this.container, this.el);
this.container.appendChild(this.el);
this.container.style.overflow = 'hidden';
this.container.style.position = 'relative';
this.el.style.webkitTransformOrigin = '0% 0%';
this.el.style.mozTransformOrigin = '0% 0%';
this.el.style.msTransformOrigin = '0% 0%';
this.el.style.oTransformOrigin = '0% 0%';
this.el.style.transformOrigin = '0% 0%';
this.el.style.position = 'absolute';
},
end: function () {
this.hasInteraction = false;
this.sanitize();
this.update();
},
/**
* Binds all required event listeners
*/
bindEvents: function () {
var self = this;
detectGestures(this.container, this);
this.resizeHandler = this.update.bind(this)
window.addEventListener('resize', this.resizeHandler);
Array.from(this.el.querySelectorAll('img')).forEach(function(imgEl) {
imgEl.addEventListener('load', self.update.bind(self));
});
if (this.el.nodeName === 'IMG') {
this.el.addEventListener('load', this.update.bind(this));
}
},
/**
* Updates the css values according to the current zoom factor and offset
*/
update: function (event) {
if (event && event.type === 'resize') {
this.updateAspectRatio();
this.setupOffsets();
}
if (event && event.type === 'load') {
this.updateAspectRatio();
this.setupOffsets();
}
if (this.updatePlanned) {
return;
}
this.updatePlanned = true;
window.setTimeout((function () {
this.updatePlanned = false;
var zoomFactor = this.getInitialZoomFactor() * this.zoomFactor,
offsetX = -this.offset.x / zoomFactor,
offsetY = -this.offset.y / zoomFactor,
transform3d = 'scale3d(' + zoomFactor + ', ' + zoomFactor + ',1) ' +
'translate3d(' + offsetX + 'px,' + offsetY + 'px,0px)',
transform2d = 'scale(' + zoomFactor + ', ' + zoomFactor + ') ' +
'translate(' + offsetX + 'px,' + offsetY + 'px)',
removeClone = (function () {
if (this.clone) {
this.clone.parentNode.removeChild(this.clone);
delete this.clone;
}
}).bind(this);
// Scale 3d and translate3d are faster (at least on ios)
// but they also reduce the quality.
// PinchZoom uses the 3d transformations during interactions
// after interactions it falls back to 2d transformations
if (!this.options.use2d || this.hasInteraction || this.inAnimation) {
this.is3d = true;
removeClone();
this.el.style.webkitTransform = transform3d;
this.el.style.mozTransform = transform2d;
this.el.style.msTransform = transform2d;
this.el.style.oTransform = transform2d;
this.el.style.transform = transform3d;
} else {
// When changing from 3d to 2d transform webkit has some glitches.
// To avoid this, a copy of the 3d transformed element is displayed in the
// foreground while the element is converted from 3d to 2d transform
if (this.is3d) {
this.clone = this.el.cloneNode(true);
this.clone.style.pointerEvents = 'none';
this.container.appendChild(this.clone);
window.setTimeout(removeClone, 200);
}
this.el.style.webkitTransform = transform2d;
this.el.style.mozTransform = transform2d;
this.el.style.msTransform = transform2d;
this.el.style.oTransform = transform2d;
this.el.style.transform = transform2d;
this.is3d = false;
}
}).bind(this), 0);
},
/**
* Enables event handling for gestures
*/
enable: function() {
this.enabled = true;
},
/**
* Disables event handling for gestures
*/
disable: function() {
this.enabled = false;
},
/**
* Unmounts the zooming container and global event listeners
*/
destroy: function () {
window.removeEventListener('resize', this.resizeHandler);
if (this.container) {
this.container.remove();
this.container = null;
}
}
};
var detectGestures = function (el, target) {
var interaction = null,
fingers = 0,
lastTouchStart = null,
startTouches = null,
setInteraction = function (newInteraction, event) {
if (interaction !== newInteraction) {
if (interaction && !newInteraction) {
switch (interaction) {
case "zoom":
target.handleZoomEnd(event);
break;
case 'drag':
target.handleDragEnd(event);
break;
}
}
switch (newInteraction) {
case 'zoom':
target.handleZoomStart(event);
break;
case 'drag':
target.handleDragStart(event);
break;
}
}
interaction = newInteraction;
},
updateInteraction = function (event) {
if (fingers === 2) {
setInteraction('zoom');
} else if (fingers === 1 && target.canDrag()) {
setInteraction('drag', event);
} else {
setInteraction(null, event);
}
},
targetTouches = function (touches) {
return Array.from(touches).map(function (touch) {
return {
x: touch.pageX,
y: touch.pageY
};
});
},
getDistance = function (a, b) {
var x, y;
x = a.x - b.x;
y = a.y - b.y;
return Math.sqrt(x * x + y * y);
},
calculateScale = function (startTouches, endTouches) {
var startDistance = getDistance(startTouches[0], startTouches[1]),
endDistance = getDistance(endTouches[0], endTouches[1]);
return endDistance / startDistance;
},
cancelEvent = function (event) {
event.stopPropagation();
event.preventDefault();
},
detectDoubleTap = function (event) {
var time = (new Date()).getTime();
if (fingers > 1) {
lastTouchStart = null;
}
if (time - lastTouchStart < 300) {
cancelEvent(event);
target.handleDoubleTap(event);
switch (interaction) {
case "zoom":
target.handleZoomEnd(event);
break;
case 'drag':
target.handleDragEnd(event);
break;
}
} else {
target.isDoubleTap = false;
}
if (fingers === 1) {
lastTouchStart = time;
}
},
firstMove = true;
el.addEventListener('touchstart', function (event) {
if(target.enabled) {
firstMove = true;
fingers = event.touches.length;
detectDoubleTap(event);
}
}, { passive: false });
el.addEventListener('touchmove', function (event) {
if(target.enabled && !target.isDoubleTap) {
if (firstMove) {
updateInteraction(event);
if (interaction) {
cancelEvent(event);
}
startTouches = targetTouches(event.touches);
} else {
switch (interaction) {
case 'zoom':
if (startTouches.length == 2 && event.touches.length == 2) {
target.handleZoom(event, calculateScale(startTouches, targetTouches(event.touches)));
}
break;
case 'drag':
target.handleDrag(event);
break;
}
if (interaction) {
cancelEvent(event);
target.update();
}
}
firstMove = false;
}
}, { passive: false });
el.addEventListener('touchend', function (event) {
if(target.enabled) {
fingers = event.touches.length;
updateInteraction(event);
}
});
};
return PinchZoom;
};
var PinchZoom = definePinchZoom();
export default PinchZoom;
@@ -267,6 +267,15 @@
margin-bottom: 0;
}
.el-descriptions__table {
table-layout: fixed !important;
}
.el-descriptions-item__label {
text-align: center !important;
width: 14% !important;
}
.descriptions-form th.el-descriptions-item__label:has(+ td.el-descriptions-item__content > div.el-form-item.is-required):before {
content: "*";
color: #f56c6c;
@@ -11,6 +11,62 @@
const { $, BtnMenu, DropListMenu, PanelMenu, DropList, Panel, Tooltip } = wangEditor
class PDFMenu extends BtnMenu {
constructor(editor) {
const $elem = wangEditor.$(
`<div class="w-e-menu" data-title="上传pdf">
pdf
</div>`
)
super($elem, editor)
}
clickHandler() {
const _this = this
const inputFileElement = document.querySelector('#'+this.editor.textElemId).parentElement.parentElement.nextElementSibling
inputFileElement.click()
inputFileElement.addEventListener('change', function () {
const file = this.files[0];
const fileName = file.name
if (!fileName.toLowerCase().endsWith('.pdf')) {
alert('请上传pdf格式的文件')
_this.clearInputFile()
return
}
const formData = new FormData()
formData.append('file', file, file.name)
axios.post('/file_server/uploadFile', formData, {}).then(response => {
console.log(response.data)
if (response.data.code === 0) {
const html = `<a target="_blank" href="${FILE_STREAM_PREVIEW_ADDRESS}?id=${response.data.data.id}">
${response.data.data.filename}
</a>`
_this.editor.txt.html(html)
} else {
alert(response.data.msg + ',上传pdf失败,请联系管理员!')
_this.clearInputFile()
}
}).catch(error => {
console.log(error)
_this.clearInputFile()
alert('上传pdf失败,请联系管理员!')
});
});
}
clearInputFile() {
const obj = document.getElementById('fileInput');
obj.outerHTML = obj.outerHTML
}
tryChangeActive() {
this.active()
}
}
class AlertMenu extends BtnMenu {
constructor(editor) {
const $elem = wangEditor.$(
@@ -77,6 +133,7 @@ class AlertMenu extends BtnMenu {
}
wangEditor.registerMenu("alertMenuKey", AlertMenu)
wangEditor.registerMenu('pdfMenuKey', PDFMenu)
module.exports = {
name: "textEditor",
props: {
@@ -37,36 +37,43 @@
<el-descriptions-item label="线路名称">{{ viewData.lineName }}</el-descriptions-item>
<el-descriptions-item label="旅行社名称">{{ viewData.travelAgencyName }}</el-descriptions-item>
<el-descriptions-item label="是否携带家属">
<el-descriptions-item label="是否含随行人">
<span class="label label-primary">
{{ viewData.isFamily ? '携带' : '未携带' }}
{{ (viewData.companionList && viewData.companionList.length > 0) ? '携带' : '未携带' }}
</span>
</el-descriptions-item>
<el-descriptions-item label="床型">{{ viewData.bedInfo.bedType }}</el-descriptions-item>
<el-descriptions-item label="床位">{{
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
}}
</el-descriptions-item>
<template v-if="modifyConfig.bedInfo && viewData.bedInfo">
<el-descriptions-item label="房间信息">
<span class="label label-primary">
{{ viewData.bedInfo.bedType }}
</span>
</el-descriptions-item>
<!-- <el-descriptions-item label="床位">{{
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
}}
</el-descriptions-item>
<el-descriptions-item label="意向拼床人">
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
</el-descriptions-item>
<el-descriptions-item label="意向拼床人">
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
</el-descriptions-item>-->
</template>
</el-descriptions>
</div>
<div class="panel panel-default mt20" style="border: none">
<div v-if="modifyConfig.familyInfo == 2" class="panel panel-default mt20" style="border: none">
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
<h3 class="panel-title">
同伴信息
随行人信息
</h3>
</div>
<div class="panel-body" style="border: 1px solid rgb(235, 238, 245)">
<el-table :data="viewData.companionList">
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份证号" prop="idCard"></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="身份证号" prop="idCard"></el-table-column>
<el-table-column label="手机号" prop="mobile"></el-table-column>
<!-- <el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo.bedType }}
</template>
@@ -80,13 +87,13 @@
<template scope="{row}">
{{ row.bedInfo.otherSleepUser ? row.bedInfo.otherSleepUser : '暂无' }}
</template>
</el-table-column>
</el-table-column>-->
<el-table-column label="关系" prop="relation"></el-table-column>
</el-table>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="所属分工会审核信息" name="2" v-if="viewData.selfUnionAuditId">
<el-tab-pane label="所属分工会审核信息" name="2" v-if="viewData.selfUnionAuditId && viewData.selfUnionAudit">
<div class="panel panel-default mt20" style="border: none">
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
<h3 class="panel-title">
@@ -104,7 +111,7 @@
</el-descriptions>
</div>
</el-tab-pane>
<el-tab-pane label="意向线路分工会审核信息" name="3" v-if="viewData.joinLineUnionAuditId">
<el-tab-pane label="意向线路分工会审核信息" name="3" v-if="viewData.joinLineUnionAuditId && viewData.joinLineUnionAudit">
<div class="panel panel-default mt20" style="border: none">
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
<h3 class="panel-title">
@@ -147,6 +154,7 @@ module.exports = {
bedInfo: {},
},
loading: false,
modifyConfig:{}
}
},
methods: {
@@ -169,9 +177,16 @@ module.exports = {
openAudit(id, activeName) {
this.findOne(id)
this.activeName = activeName
}
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
},
created() {
async created() {
await this.getModifyConfig();
}
}
</script>
@@ -42,19 +42,22 @@
{{ viewData.isFamily ? '携带' : '未携带' }}
</span>
</el-descriptions-item>
<el-descriptions-item label="床型">{{ viewData.bedInfo.bedType }}</el-descriptions-item>
<el-descriptions-item label="床位">{{
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
}}
</el-descriptions-item>
<el-descriptions-item label="意向拼床人">
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
</el-descriptions-item>
<template v-if="modifyConfig.bedInfo">
<el-descriptions-item label="床型">{{ viewData.bedInfo.bedType }}</el-descriptions-item>
<el-descriptions-item label="床位">{{
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
}}
</el-descriptions-item>
<el-descriptions-item label="意向拼床人">
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
</el-descriptions-item>
</template>
</el-descriptions>
</div>
<div class="panel panel-default mt20" style="border: none">
<div v-if="modifyConfig.familyInfo == 2" class="panel panel-default mt20" style="border: none">
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
<h3 class="panel-title">
同伴信息
@@ -129,6 +132,7 @@ module.exports = {
bedInfo: {},
},
loading: false,
modifyConfig:{}
}
},
methods: {
@@ -149,9 +153,16 @@ module.exports = {
openAudit(id, activeName) {
this.findOne(id)
this.activeName = activeName
}
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
},
created() {
async created() {
await this.getModifyConfig();
}
}
</script>
@@ -11,7 +11,7 @@
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index.css">
<link rel="stylesheet" href="${base!}/assets/platform/fonts/themify-icons.css">
<link rel="stylesheet" href="${base!}/assets/platform/fonts/font-awesome.min.css">
<link rel="stylesheet" href="${base!}/assets/platform/css/common.css">
<link rel="stylesheet" href="${base!}/assets/platform/css/common.css?v=1.0.1">
<link rel="stylesheet" href="${base!}/assets/platform/css/main.css">
<link rel="stylesheet" href="${base!}/assets/platform/css/elmain.css?v=1.0.0">
<link rel="stylesheet" href="${base!}/assets/platform/css/panel.css">
@@ -11,7 +11,7 @@
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index.css">
<link rel="stylesheet" href="${base!}/assets/platform/fonts/themify-icons.css">
<link rel="stylesheet" href="${base!}/assets/platform/fonts/font-awesome.min.css">
<link rel="stylesheet" href="${base!}/assets/platform/css/common.css">
<link rel="stylesheet" href="${base!}/assets/platform/css/common.css?v=1.0.0">
<link rel="stylesheet" href="${base!}/assets/platform/css/main.css">
<link rel="stylesheet" href="${base!}/assets/platform/css/elmain.css">
<link rel="stylesheet" href="${base!}/assets/platform/css/panel.css">
@@ -236,6 +236,7 @@ layout("/mobile/platform.html"){
this.id = item.id
this.formData.username = this.user.username
this.formData.auditTime = moment().format('YYYY-MM-DD')
this.formData.unionName = null
this.infoShow = true
this.showApprovalForm = true
this.$nextTick(() => {
@@ -257,17 +257,28 @@ layout("/mobile/platform.html"){
confirmButtonText: "确定",
cancelButtonText: "取消"
}).then(async () => {
const formData = this.formData
if (this.formData.families) {
formData.families = JSON.stringify(this.formData.families)
const formData = JSON.parse(JSON.stringify(this.formData))
if (formData.families) {
formData.families = JSON.stringify(formData.families)
}
const resp = await $.post('/platform/member/apply/submit/doSave', formData)
if (resp.code === 0) {
this.$toast.success('操作成功')
this.user.member = true
pjaxReplace('/platform/member/apply/mine/h5')
vant.Dialog.alert({
title: '温馨提示',
message: '您已成功【保存】申请,请耐心等待相关负责人审核',
}).then(() => {
this.user.member = true
pjaxReplace('/platform/member/apply/mine/h5')
});
// this.$toast.success('操作成功')
// this.user.member = true
// pjaxReplace('/platform/member/apply/mine/h5')
} else {
this.$toast.fail(resp.msg)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
// this.$toast.fail(resp.msg)
}
})
},
@@ -288,17 +299,24 @@ layout("/mobile/platform.html"){
confirmButtonText: "确定",
cancelButtonText: "取消"
}).then(async () => {
const formData = this.formData
if (this.formData.families) {
formData.families = JSON.stringify(this.formData.families)
const formData = JSON.parse(JSON.stringify(this.formData))
if (formData.families) {
formData.families = JSON.stringify(formData.families)
}
const resp = await $.post('/platform/member/apply/submit/doSubmit', formData)
if (resp.code === 0) {
this.$toast.success('操作成功')
this.user.member = true
pjaxReplace('/platform/member/apply/mine/h5')
vant.Dialog.alert({
title: '温馨提示',
message: '您已成功【提交】申请,请耐心等待相关负责人审核',
}).then(() => {
this.user.member = true
pjaxReplace('/platform/member/apply/mine/h5')
});
} else {
this.$toast.fail(resp.msg)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
}
})
},
@@ -13,6 +13,9 @@
<link rel="stylesheet" href="${base!}/assets/mobile/css/theme.css">
<link rel="stylesheet" href="${base!}/assets/mobile/css/main.css">
<link rel="stylesheet" href="${base!}/assets/mobile/css/pdfh5.css">
<link rel="stylesheet" href="${base!}/assets/platform/plugins/vant/vant.css?v=1.0.1">
<script>
@@ -56,6 +59,11 @@
<script type="text/javascript"
src="https://webapi.amap.com/maps?v=2.0&key=57f0d098ba1b881ecc436c4cfd23bbbf&plugin=AMap.PolyEditor,AMap.Geolocation"></script>
<!-- pdf -->
<script src="${base!}/assets/mobile/js/pdf/pdf.js" type="text/javascript" charset="utf-8"></script>
<script src="${base!}/assets/mobile/js/pdf/pdf.worker.js" type="text/javascript" charset="utf-8"></script>
<script src="${base!}/assets/mobile/js/pdf/pdfh5.js" type="text/javascript" charset="utf-8"></script>
<!--字典混入-->
<script src="${base!}/components/plugins/sysDict/DictData.js"></script>
@@ -370,7 +370,6 @@ layout("/mobile/platform.html"){
}
} else if (v.itx === 2) {
if (v.rval) {
debugger
formData.push({
"rwid": v.wors[0].wid,
"rval": v.rval,
@@ -17,7 +17,9 @@ layout("/mobile/platform.html"){
.content {
line-height: 26px;
padding: 0px 20px 56px 20px;
padding: 0 20px 56px 20px;
max-height: calc(100vh - 46px - 210px - 60px - 24px);
overflow-y: auto;
}
.title {
@@ -159,9 +161,9 @@ layout("/mobile/platform.html"){
color: grey;
}
.header div span {
color: grey;
}
/*.header div span {*/
/* color: grey;*/
/*}*/
.header :last-child {
font-size: 14px;
@@ -195,6 +197,11 @@ layout("/mobile/platform.html"){
background-color: white;
}
.pdf_div {
padding-bottom: 70px;
height: calc(100vh - 46px - 170px - 60px - 24px);
}
</style>
<div id="app" v-cloak>
@@ -235,8 +242,11 @@ layout("/mobile/platform.html"){
</div>
</div>
<van-divider></van-divider>
<div v-if="baseData.content" v-html="baseData.content" class="content"></div>
<div v-else v-html="configData.notice" class="content"></div>
<!-- <div v-if="baseData.content" v-html="baseData.content" class="content"></div>-->
<!-- <div v-else v-html="configData.notice" class="content"></div>-->
<van-divider :style="{ color: 'orange', fontSize: '12px' }">上下滑动翻页,单击查看图片,再单击返回</van-divider>
<div v-if="isPdf" v-html="baseData.content" class="content"></div>
<div v-else id="demo" class="pdf_div"></div>
<!--<van-empty
v-else class="custom-image"
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
@@ -254,11 +264,13 @@ layout("/mobile/platform.html"){
<div class="footer" v-if="fromUrlByMy != 'edit'">
<template v-if="baseData.isNormal==0&&baseData.isNormalFalse>0">
<van-button @click="join"
class="join">我要报名
class="join">
{{ (fromUrlByMy == 'editDo') ? '修改报名' : '我要报名' }}
</van-button>
</template>
<template v-else>
<van-button v-if="moment().unix() <= moment(baseData.signUpEndTime).unix()" @click="join" class="join">我要报名
<van-button v-if="moment().unix() <= moment(baseData.signUpEndTime).unix()" @click="join" class="join">
{{ (fromUrlByMy == 'editDo') ? '修改报名' : '我要报名' }}
</van-button>
<van-button v-if="moment().unix() > moment(baseData.signUpEndTime).unix()" class="join">报名结束</van-button>
</template>
@@ -280,8 +292,8 @@ layout("/mobile/platform.html"){
<div class="van-card-body">
<van-field label="姓名" readonly v-model="formData.userName"></van-field>
<van-field label="工号" readonly v-model="formData.loginName"></van-field>
<van-field label="身份证" name="idCard" :rules="[{ required: true }]"
placeholder="请填写身份证号" v-model="formData.idCard"></van-field>
<van-field label="身份证" name="idCard" :rules="[{ required: true }]"
placeholder="请填写身份证号、护照、台胞证等" v-model="formData.idCard"></van-field>
<van-field label="手机号" name="mobile" :rules="[{ required: true }]"
placeholder="请填写手机号" v-model="formData.mobile"></van-field>
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
@@ -293,13 +305,24 @@ layout("/mobile/platform.html"){
<div class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
床位信息
房间信息
</div>
<div class="van-card-body">
<van-field @click="self = true; roomVisible = true" readonly is-link label="房" name="bedType"
<van-field :rules="[{ required: true, message: '请选择是否包房' }]" label="是否包房" name="bedType">
<template #input>
<van-radio-group direction="horizontal" v-model="formData.bedInfo.bedType">
<van-radio name="包房" shape="square">包房</van-radio>
<van-radio name="不包房" shape="square">不包房</van-radio>
</van-radio-group>
</template>
</van-field>
<div>
<span style="color: red;margin-left: 14px;font-size: 14px">包房需自费;不包房两位老师一间且随机分配</span>
</div>
<!--<van-field @click="self = true; roomVisible = true" readonly is-link label="房间" name="bedType"
placeholder="请选择房间" v-model="formData.bedInfo.bedType"
:rules="[{ required: true }]"></van-field>
<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
:rules="[{ required: true }]"></van-field>-->
<!--<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="formData.bedInfo.bedNum"
:rules="[{ required: true }]"></van-field>
@@ -315,12 +338,12 @@ layout("/mobile/platform.html"){
<van-field v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="formData.bedInfo.otherSleepUser"
:rules="[{ required: true }]"></van-field>
:rules="[{ required: true }]"></van-field>-->
</div>
</div>
<!--随行人信息-->
<div class="van-doc-card" style="margin-bottom: 16px">
<div v-if="index != 2" class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header"
style="display: flex; justify-content: space-between; align-items: center">
@@ -330,62 +353,73 @@ layout("/mobile/platform.html"){
<van-tag @click="addCompanion" size="large" type="primary" color="#1867b0">添加随行人</van-tag>
</div>
</div>
<div v-if="formData.companionList.length > 0" class="van-card-body">
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
<van-field label="姓名" name="userName" placeholder="请填写姓名" v-model="item.userName"
:rules="[{ required: true }]"></van-field>
<!--<van-field label="工号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age"
type="digit" :rules="[{ required: true }]"></van-field>
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="item.sex">
<van-radio name="男" shape="square"></van-radio>
<van-radio name="女" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field label="身份证号" name="idCard" placeholder="请填写身份证号"
:rules="[{ required: true }]" type="digit"
v-model="item.idCard"></van-field>
<van-field label="手机号" name="mobile" placeholder="请填写手机号"
:rules="[{ required: true }]" type="digit"
v-model="item.mobile"></van-field>
<van-field @click="companionVisible = true" readonly is-link label="与本人关系"
name="relation"
placeholder="随行人与本人关系" v-model="item.relation"
:rules="[{ required: true }]"></van-field>
<van-field @click="self = false; roomVisible = true" readonly is-link label="房间"
name="bedType" placeholder="请选择房间"
v-model="item.bedInfo.bedType"></van-field>
<div style="font-size: 8px; color:orangered; padding-left: 16px; padding-bottom: 4px">
提醒:如果跟报名人员同一房间,无须选择!
</div>
<van-field v-if="item.bedInfo.bedType == '标准间'" @click="self = false; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="item.bedInfo.bedNum"></van-field>
<van-field v-if="item.bedInfo.bedType == '标准间'"
:rules="[{ validator, message: '请选择是否拼房' }]" label="是否拼房">
<template #input>
<van-radio-group direction="horizontal" v-model="item.bedInfo.isSleepTogether">
<van-radio :name="true" shape="square"></van-radio>
<van-radio :name="false" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-if="item.bedInfo.bedType == '标准间' && item.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="item.bedInfo.otherSleepUser"></van-field>
</van-tab>
</van-tabs>
</div>
<div v-if="formData.companionList.length == 0" class="companionList_empty_text">
<template v-if="configData.familyInfo === 2">
<div>
<span style="color: red;margin-left: 20px;font-size: 14px">限填写3岁以上70岁以下随行人</span>
</div>
<div v-if="formData.companionList.length > 0" class="van-card-body">
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
<van-field label="姓名" name="userName" placeholder="请填写姓名" v-model="item.userName"
:rules="[{ required: true }]"></van-field>
<!--<van-field label="工号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age"
type="digit" :rules="[{ required: true }]"></van-field>
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="item.sex">
<van-radio name="男" shape="square"></van-radio>
<van-radio name="女" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field label="身份证件" name="idCard" placeholder="请填写身份证号"
:rules="[{ required: true }]" maxlength="18"
@input="getAgeAndSex(item)" v-model="item.idCard"></van-field>
<van-field label="手机号" name="mobile" placeholder="请填写手机号"
:rules="[{ required: true }]" type="digit"
v-model="item.mobile"></van-field>
<van-field @click="companionVisible = true" readonly is-link label="与本人关系"
name="relation"
placeholder="随行人与本人关系" v-model="item.relation"
:rules="[{ required: true }]"></van-field>
<!--<van-field @click="self = false; roomVisible = true" readonly is-link label="房间"
name="bedType" placeholder="请选择房间"
v-model="item.bedInfo.bedType"></van-field>
<div style="font-size: 8px; color:orangered; padding-left: 16px; padding-bottom: 4px">
提醒:如果跟报名人员同一房间,无须选择!
</div>
<van-field v-if="item.bedInfo.bedType == '标准间'" @click="self = false; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="item.bedInfo.bedNum"></van-field>
<van-field v-if="item.bedInfo.bedType == '标准间'"
:rules="[{ validator, message: '请选择是否拼房' }]" label="是否拼房">
<template #input>
<van-radio-group direction="horizontal" v-model="item.bedInfo.isSleepTogether">
<van-radio :name="true" shape="square"></van-radio>
<van-radio :name="false" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-if="item.bedInfo.bedType == '标准间' && item.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="item.bedInfo.otherSleepUser"></van-field>-->
</van-tab>
</van-tabs>
</div>
<div v-if="formData.companionList.length == 0" class="companionList_empty_text">
<span>
如有随行人出行,请添加随行人
</span>
</div>
</div>
</template>
<template v-else>
<van-field label="家属数量" name="familyNumber" placeholder="请填写家属数量" v-model="formData.familyNumber"
type="digit" :rules="[{ required: true }]"></van-field>
</template>
</div>
<div class="submitButton">
@@ -401,7 +435,7 @@ layout("/mobile/platform.html"){
<!--房间类型弹出框-->
<van-popup position="bottom" round v-model="roomVisible">
<van-picker
title="入住房间" show-toolbar
title="房间信息" show-toolbar
:columns="roomColumns"
@confirm="roomConfirm"
@cancel="roomCancel">
@@ -436,16 +470,17 @@ layout("/mobile/platform.html"){
if (r != null) return decodeURI(r[2]);
return null;
}
let pdfh5 = null
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
isPdf: false,
active: 0,
roomColumns: ['大床房', '标准间'],
roomColumns: ['房', '默认房间'],
bedColumns: ['1', '2'],
companionColumns: ['亲属', '朋友'],
companionColumns: ['配偶', '子女', '亲属', '其他'],
bedVisible: false,
roomVisible: false,
companionVisible: false,
@@ -475,6 +510,18 @@ layout("/mobile/platform.html"){
}
},
methods: {
getAgeAndSex(item){
try {
const value = item.idCard
const age = this.calculateAgeFromIdCard(value)
this.$set(item, "age", age)
const sex = this.getGenderFromIdCard(value)
this.$set(item, "sex", sex)
} catch (error) {
console.log(error)
}
},
roomCancel() {
if (!this.self) {
this.formData.companionList[this.active].bedInfo.bedType = ''
@@ -501,18 +548,43 @@ layout("/mobile/platform.html"){
return value != null
},
async joinSubmit() {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const cloneData = clone(this.formData)
cloneData.companionList.forEach((item, index) => {
if (item.userName === '') {
cloneData.companionList.splice(index, 1)
}
})
if (cloneData.companionList) {
for (let i = 0; i < cloneData.companionList.length; i++) {
const companion = cloneData.companionList[i];
// 检查每个字段是否为空
if (!companion.userName || !companion.idCard || !companion.mobile || !companion.relation) {
this.$toast('请填写完整随行人信息')
return
}
// 填了身份证,校验是否正确
if (companion.idCard) {
if (!this.validateIdCard(companion.idCard)) {
this.$toast('随行人'+ (i+1) +'的身份证不正确')
return
} else {
// 判断companion.age,是不是在3到70岁之间,不是就提示
if (companion.age < 3 || companion.age > 70) {
this.$toast('随行人'+ (i+1) +'的年龄超出限制,请天添加其他联系人')
return
}
}
}
}
}
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doSignUpForBaseManagement', {
enroll: JSON.stringify(cloneData),
})
@@ -547,7 +619,10 @@ layout("/mobile/platform.html"){
}),
})
if (re.code !== 0) {
vant.Toast(re.msg)
vant.Dialog.alert({
title: '温馨提示',
message: re.msg,
})
return
}
if (this.fromUrlByMy !== 'editDo') {
@@ -615,6 +690,105 @@ layout("/mobile/platform.html"){
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
this.configData = resp.data
},
calculateAgeFromIdCard(idCard) {
// 检查身份证号码是否合法
if (!idCard) {
throw new Error("Invalid ID card format")
}
let birthDateStr
let birthYear, birthMonth, birthDay
// 处理18位身份证号码
if (idCard.length === 18) {
birthDateStr = idCard.substring(6, 14)
birthYear = parseInt(birthDateStr.substring(0, 4), 10)
birthMonth = parseInt(birthDateStr.substring(4, 6), 10) - 1 // 月份从0开始
birthDay = parseInt(birthDateStr.substring(6, 8), 10)
}
// 处理15位身份证号码
else if (idCard.length === 15) {
birthDateStr = idCard.substring(6, 12)
birthYear = parseInt("19" + birthDateStr.substring(0, 2), 10) // 使用字符串拼接
birthMonth = parseInt(birthDateStr.substring(2, 4), 10) - 1 // 月份从0开始
birthDay = parseInt(birthDateStr.substring(4, 6), 10)
} else {
throw new Error("Invalid ID card format. Only 15 or 18 digits are supported.")
}
// 获取当前日期
const currentDate = new Date()
// 计算年龄
let age = currentDate.getFullYear() - birthYear
// 如果当前日期还没过生日,则年龄减1
if (currentDate.getMonth() < birthMonth || (currentDate.getMonth() === birthMonth && currentDate.getDate() < birthDay)) {
age -= 1
}
return age
},
getGenderFromIdCard(idCard) {
// 检查身份证号码是否合法
if (!idCard) {
throw new Error("Invalid ID card format")
}
let genderDigit
// 处理18位身份证号码
if (idCard.length === 18) {
genderDigit = parseInt(idCard.charAt(16), 10) // 第17位
}
// 处理15位身份证号码
else if (idCard.length === 15) {
genderDigit = parseInt(idCard.charAt(14), 10) // 第15位
} else {
throw new Error("Invalid ID card format. Only 15 or 18 digits are supported.")
}
// 判断性别
if (genderDigit % 2 === 0) {
return "女"
} else {
return "男"
}
},
validateIdCard(idCard) {
if (!idCard) {
return false
}
// 18位身份证号码校验
if (idCard.length === 18) {
const idCardRegex = /^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/
if (!idCardRegex.test(idCard)) {
return false
}
// 校验码计算
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
const checksums = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]
let sum = 0
for (let i = 0; i < 17; i++) {
sum += idCard[i] * weights[i]
}
const checksum = checksums[sum % 11]
return checksum === idCard[17].toUpperCase()
}
// 15位身份证号码校验
else if (idCard.length === 15) {
const idCardRegex = /^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/
return idCardRegex.test(idCard)
}
// 外国人或其他情况
else {
return false
}
},
},
async created() {
this.id = getQueryString('id') ? getQueryString('id') : ''
@@ -626,7 +800,58 @@ layout("/mobile/platform.html"){
if (this.enrollId) {
await this.findSignUpInfoById()
}
this.getData()
await this.getData()
try {
const parser = new DOMParser();
const doc = parser.parseFromString(this.baseData.content, 'text/html');
console.log(this.baseData)
const link = doc.querySelector('a');
const href = link.getAttribute('href');
this.$nextTick(() => {
pdfh5 = new Pdfh5('#demo', {
pdfurl: href,
});
})
}catch (e) {
this.isPdf = true
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
vant.ImagePreview({
images: [event.target.src],
closeable: true,
})
}
})
}
this.$nextTick(() => {
pdfh5.on("complete", function () {
const imgDoc = document.querySelectorAll('img')
let array = []
let classArray = []
imgDoc.forEach(o => {
if(o.getAttribute('class') !== 'top_icon') {
classArray.push(o.getAttribute('class'))
array.push(o.getAttribute('src'))
}
})
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
const index = classArray.indexOf(event.target.className)
if(index !== -1) {
vant.ImagePreview({
images: array,
startPosition: index,
closeable: true,
})
}
}
})
})
})
},
mounted() {
window.addEventListener('scroll', this.scrollToTop)
@@ -29,23 +29,28 @@ layout("/mobile/platform.html"){
.pre_text {
white-space: break-spaces;
padding-left: 7px;
max-height: calc(80vh - 290px);
overflow-y: auto;
}
.pdfjs {
height: 90%;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder title="职工疗休养"></van-nav-bar>
<van-nav-bar @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder title="职工疗休养"></van-nav-bar>
</van-sticky>
<!--顶部轮播图-->
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe class="my-swipe" style="height: 20vh" :autoplay="3000" indicator-color="white">
<van-swipe-item>
<van-image width="100%" height="180" src="/assets/mobile/img/therapyRecuperation/index1.jpg"></van-image>
<van-image width="100%" height="180" src="/assets/mobile/img/therapyRecuperation/index1.jpeg"></van-image>
</van-swipe-item>
<van-swipe-item>
<van-image height="180" src="/assets/mobile/img/therapyRecuperation/index2.jpg"></van-image>
<van-image height="180" src="/assets/mobile/img/therapyRecuperation/index1.jpeg"></van-image>
</van-swipe-item>
</van-swipe>
@@ -60,35 +65,36 @@ layout("/mobile/platform.html"){
</div>
<!--疗休养描述-->
<div class="van-doc-card" style="margin-top: 20px;margin-bottom: 60px">
<div class="van-doc-card" style="margin-top: 10px; height: calc(80vh - 245px)">
<van-image width="190" height="43" src="/assets/mobile/img/therapyRecuperation/title.png"></van-image>
<div class="pre_text" v-html="configData.notice"></div>
<div v-if="isPdf" class="pre_text" v-html="configData.notice"></div>
<div v-else id="demo" class="pdf_div"></div>
</div>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养报名
</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的疗休养
</van-tabbar-item>
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养首页</van-tabbar-item>
<van-tabbar-item icon="search" replace url="/platform/mobile/theRapyRecuperation/mobileLineListPage">线路选择</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的报名</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
let pdfh5 = null
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
tarBarActive: 0,
chooseButton: [],
configData: {},
tarBarActive: 0,
isPdf: false,
}
},
methods: {
async toLineList(index) {
const isExist = await getScopeUser(this.configData.activityGroupId)
/*const isExist = await getScopeUser(this.configData.activityGroupId)
if (!isExist) {
vant.Dialog.alert({
title: '温馨提示',
@@ -96,7 +102,7 @@ layout("/mobile/platform.html"){
confirmButtonColor: '#1867b0'
})
return
}
}*/
localStorage.setItem("clickIndex", JSON.stringify({clickIndex: index}))
location.href = '/platform/mobile/theRapyRecuperation/mobileLineListPage'
},
@@ -107,8 +113,58 @@ layout("/mobile/platform.html"){
},
async created() {
this.chooseButton = await getEnumOptions('TheRapyRecuperationType')
this.chooseButton = this.chooseButton.filter(o => o.value !== 2 && o.value !== 3)
this.chooseButton = this.chooseButton.filter(o => o.value !== 2)
await this.getConfigData()
try {
const parser = new DOMParser();
const doc = parser.parseFromString(this.configData.notice, 'text/html');
const link = doc.querySelector('a');
const href = link.getAttribute('href');
this.$nextTick(() => {
pdfh5 = new Pdfh5('#demo', {
pdfurl: href,
});
})
}catch (e) {
this.isPdf = true
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && !['van-image__img', 'top_icon'].includes(event.target.className)) {
vant.ImagePreview({
images: [event.target.src],
closeable: true,
})
}
})
}
this.$nextTick(() => {
pdfh5.on("complete", function () {
const imgDoc = document.querySelectorAll('img')
let array = []
let classArray = []
imgDoc.forEach(o => {
if(!['van-image__img', 'top_icon'].includes(o.getAttribute('class'))) {
classArray.push(o.getAttribute('class'))
array.push(o.getAttribute('src'))
}
})
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && !['van-image__img', 'top_icon'].includes(event.target.className)) {
const index = classArray.indexOf(event.target.className)
if(index !== -1) {
vant.ImagePreview({
images: array,
startPosition: index,
closeable: true,
})
}
}
})
})
})
}
})
</script>
@@ -3,6 +3,10 @@ layout("/mobile/platform.html"){
#-->
<style>
#app {
font-family: 微软雅黑,serif;
}
.container img {
background-size: contain;
width: 100%;
@@ -11,13 +15,25 @@ layout("/mobile/platform.html"){
display: block;
}
.backTop {
display: none !important;
}
.header {
padding: 20px;
padding: 10px 10px 10px 10px;
}
.content {
line-height: 26px;
padding: 0px 20px 56px 20px;
padding: 0 10px 56px 10px;
max-height: calc(100vh - 46px - 210px - 60px - 24px);
overflow-y: auto;
}
.pdf_div {
padding-bottom: 70px;
/*height: 800px;*/
height: calc(100vh - 46px - 210px - 60px - 24px);
}
.title {
@@ -195,87 +211,138 @@ layout("/mobile/platform.html"){
background-color: white;
}
.van-tag {
color: white !important;
}
table {
width: 100%
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.go(-1)" fixed left-arrow placeholder title="职工疗休养-线路介绍"></van-nav-bar>
<van-nav-bar @click-left="history.go(-1)" fixed left-arrow placeholder
title="职工疗休养-线路介绍"></van-nav-bar>
</van-sticky>
<!--线路详情-->
<van-skeleton title :loading="skeLoading" :row="12">
<div class="container">
<div class="header">
<div class="title">
<van-tag size="large" color="#1867b0" style="color: white;position: relative; top: -2px">
{{lineData.lotName}}
</van-tag>
{{lineData.lineName}}
</div>
<div style="margin-top: 10px">
<div>
<span class="line_label">成团人数:</span>
{{lineData.minimumGroupSize ? lineData.minimumGroupSize : 0}}人(最少)
<template v-if="isLoad">
<!--线路详情-->
<van-skeleton title :loading="skeLoading" :row="12">
<div class="container">
<div class="header">
<div class="title">
<van-tag size="large" color="#1867b0" style="position: relative; top: -2px">
{{lineData.lotName}}
</van-tag>
{{lineData.lineName}}
</div>
<div>
<span>当前报名:</span>
{{lineData.signUpUserNum + lineData.signUpUserFamilyNum + '(家属' + lineData.signUpUserFamilyNum +
'人)'}}
</div>
<div>
<span>报名时间:</span>
{{moment(lineData.signUpStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(lineData.signUpEndTime).format('YYYY-MM-DD HH:mm')}}
</div>
<div>
<span>出行时间</span>
{{moment(lineData.playStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(lineData.playEndTime).format('YYYY-MM-DD HH:mm')}}
</div>
<div>
<span>&ensp;&ensp;社:</span>
{{lineData.travelAgencyName}}
</div>
<div>
<span>联系方式:</span>
{{lineData.contactMobileNumber}}
<div style="margin-top: 10px">
<div v-if="lineData.regionalNature == '省内'">
<div>
<span class="line_label">预计费用:</span>
<label>{{lineData.estimatedCost}}元</label>
</div>
<div v-if="configData.familyInfo == 2">
<!--<span>当前报名:</span>
{{lineData.signUpUserNum + lineData.signUpUserFamilyNum + '(家属' + lineData.signUpUserFamilyNum
+
'人)'}}-->
<span>当前报名</span>
{{lineData.signUpUserNum + lineData.signUpUserFamilyNum + '人'}}
</div>
<div v-else>
<span>当前报名:</span>
<!--{{lineData.signUpUserNum + lineData.familyNumber + '(家属' + lineData.familyNumber
+
'人)'}}-->
{{lineData.signUpUserNum + lineData.familyNumber + '人'}}
</div>
<!--<div>
<span class="line_label">成团人数包括家属:</span>
<label v-if="lineData.estimatedFamilyNumbers">{{lineData.estimatedFamilyNumbers}}人</label>
<label v-else>不限制</label>
</div>-->
</div>
<div v-else>
<div>
<span class="line_label">预计费用:</span>
<label>{{lineData.estimatedCost}}元</label>
</div>
<div v-if="configData.familyInfo == 2">
<span>当前报名:</span>
<!--{{lineData.signUpUserNum + '(家属' + lineData.signUpUserFamilyNum
+
'人)'}}-->
{{lineData.signUpUserNum + '人'}}
</div>
<div v-else>
<span>当前报名:</span>
<!--{{lineData.signUpUserNum + '(家属' + lineData.familyNumber
+
'人)'}}-->
{{lineData.signUpUserNum + '人'}}
</div>
</div>
<div>
<span>报名时间:</span>
{{moment(lineData.signUpStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(lineData.signUpEndTime).format('YYYY-MM-DD HH:mm')}}
</div>
<div>
<span>出行时间:</span>
{{moment(lineData.playStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(lineData.playEndTime).format('YYYY-MM-DD HH:mm')}}
</div>
<div>
<span>&ensp;&ensp;社:</span>
{{lineData.travelAgencyName}}
</div>
<div>
<span>联系方式:</span>
{{lineData.contactMobileNumber}}
</div>
<!--<div>
<span class="line_label">最少成团人数(包括家属):</span>
<label>{{configData.outsideQuota}}人</label>
</div>-->
</div>
</div>
<van-divider :style="{ color: 'orange', fontSize: '12px' }">上下滑动翻页,单击查看图片,再单击返回</van-divider>
<!--<div v-if="lineData.content" v-html="lineData.content" class="content"></div>
<div v-else v-html="configData.notice" class="content"></div>-->
<div v-if="isPdf" v-html="lineData.content" class="content"></div>
<div v-else id="demo" class="pdf_div"></div>
<!--<van-empty
v-else class="custom-image"
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
description="暂无详细信息"
></van-empty>-->
</div>
<van-divider></van-divider>
<div v-if="lineData.content" v-html="lineData.content" class="content"></div>
<div v-else v-html="configData.notice" class="content"></div>
<!--<van-empty
v-else class="custom-image"
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
description="暂无详细信息"
></van-empty>-->
</div>
</van-skeleton>
</van-skeleton>
<!--置顶图标-->
<image v-if="btnFlag" @click="backTop" src="/assets/mobile/svg/therapyRecuperation/top.svg"
class="top_icon"></image>
<!--置顶图标-->
<image v-if="btnFlag" @click="backTop" src="/assets/mobile/svg/therapyRecuperation/top.svg"
class="top_icon"></image>
<!--底部报名按钮-->
<div class="footer" v-if="fromUrlByMy != 'edit'">
<template v-if="lineData.isNormal==0&&lineData.isNormalFalse>0">
<van-button @click="join"
class="join">我要报名
</van-button>
</template>
<template v-else>
<!--底部报名按钮-->
<div class="footer" v-if="fromUrlByMy != 'edit'">
<van-button v-if="moment().unix() <= moment(lineData.signUpEndTime).unix()" @click="join"
class="join">我要报名
class="join">{{ enrollId ? '修改报名' : '我要报名' }}
</van-button>
<van-button v-if="moment().unix() > moment(lineData.signUpEndTime).unix()" class="join">报名结束</van-button>
</template>
<van-button v-if="moment().unix() > moment(lineData.signUpEndTime).unix()" class="join">报名结束
</van-button>
</div>
</template>
</div>
<!--报名弹出框-->
<van-popup v-model:show="joinPopup" position="right" class="joinPopup">
<van-nav-bar @click-left="joinPopup = false" fixed left-arrow placeholder title="疗休养报名"></van-nav-bar>
<van-nav-bar @click-left="signType == '2' ? history.go(-1) : joinPopup = false" fixed left-arrow placeholder title="疗休养报名"></van-nav-bar>
<div class="join_content">
<van-form @submit="joinSubmit">
@@ -289,26 +356,37 @@ layout("/mobile/platform.html"){
<div class="van-card-body">
<van-field label="姓名" readonly v-model="formData.userName"></van-field>
<van-field label="工号" readonly v-model="formData.loginName"></van-field>
<van-field label="身份证" name="idCard" :rules="[{ required: true }]"
placeholder="请填写身份证号" v-model="formData.idCard"></van-field>
<van-field label="身份证" name="idCard" :rules="[{ required: true }]"
placeholder="请填写身份证号、护照、台胞证等" v-model="formData.idCard"></van-field>
<van-field label="手机号" name="mobile" :rules="[{ required: true }]"
placeholder="请填写手机号" v-model="formData.mobile"></van-field>
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
<van-field label="报名线路" readonly v-model="formData.lineName"></van-field>
<van-field v-if="signType != '2'" label="报名线路" readonly v-model="formData.lineName"></van-field>
</div>
</div>
<!--床位信息-->
<div class="van-doc-card" style="margin-bottom: 16px">
<div v-if="configData.bedInfo === true" class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
床位信息
房间信息
</div>
<div class="van-card-body">
<van-field @click="self = true; roomVisible = true" readonly is-link label="房" name="bedType"
<van-field :rules="[{ required: true, message: '请选择是否包房' }]" label="是否包房" name="bedType">
<template #input>
<van-radio-group direction="horizontal" v-model="formData.bedInfo.bedType">
<van-radio name="包房" shape="square">包房</van-radio>
<van-radio name="不包房" shape="square">不包房</van-radio>
</van-radio-group>
</template>
</van-field>
<div>
<span style="color: red;margin-left: 14px;font-size: 14px">包房需自费;不包房两位老师一间且随机分配</span>
</div>
<!--<van-field @click="self = true; roomVisible = true" readonly is-link label="房间" name="bedType"
placeholder="请选择房间" v-model="formData.bedInfo.bedType"
:rules="[{ required: true }]"></van-field>
<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
:rules="[{ required: true }]"></van-field>-->
<!--<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="formData.bedInfo.bedNum"
:rules="[{ required: true }]"></van-field>
@@ -324,12 +402,12 @@ layout("/mobile/platform.html"){
<van-field v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="formData.bedInfo.otherSleepUser"
:rules="[{ required: true }]"></van-field>
:rules="[{ required: true }]"></van-field>-->
</div>
</div>
<!--随行人信息-->
<div class="van-doc-card" style="margin-bottom: 16px">
<div v-if="index != 2" class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header"
style="display: flex; justify-content: space-between; align-items: center">
@@ -339,62 +417,73 @@ layout("/mobile/platform.html"){
<van-tag @click="addCompanion" size="large" type="primary" color="#1867b0">添加随行人</van-tag>
</div>
</div>
<div v-if="formData.companionList.length > 0" class="van-card-body">
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
<van-field label="姓名" name="userName" placeholder="请填写姓名" v-model="item.userName"
:rules="[{ required: true }]"></van-field>
<!--<van-field label="工号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age"
type="digit" :rules="[{ required: true }]"></van-field>
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="item.sex">
<van-radio name="男" shape="square"></van-radio>
<van-radio name="女" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field label="身份证号" name="idCard" placeholder="请填写身份证号"
:rules="[{ required: true }]" type="digit"
v-model="item.idCard"></van-field>
<van-field label="手机号" name="mobile" placeholder="请填写手机号"
:rules="[{ required: true }]" type="digit"
v-model="item.mobile"></van-field>
<van-field @click="companionVisible = true" readonly is-link label="与本人关系"
name="relation"
placeholder="随行人与本人关系" v-model="item.relation"
:rules="[{ required: true }]"></van-field>
<van-field @click="self = false; roomVisible = true" readonly is-link label="房间"
name="bedType" placeholder="请选择房间"
v-model="item.bedInfo.bedType"></van-field>
<div style="font-size: 12px; color:orangered; padding-left: 16px; padding-bottom: 4px">
提醒:如果跟报名人员同一房间,无须选择!
</div>
<van-field v-if="item.bedInfo.bedType == '标准间'" @click="self = false; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="item.bedInfo.bedNum"></van-field>
<van-field v-if="item.bedInfo.bedType == '标准间'"
:rules="[{ validator, message: '请选择是否拼房' }]" label="是否拼房">
<template #input>
<van-radio-group direction="horizontal" v-model="item.bedInfo.isSleepTogether">
<van-radio :name="true" shape="square"></van-radio>
<van-radio :name="false" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-if="item.bedInfo.bedType == '标准间' && item.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="item.bedInfo.otherSleepUser"></van-field>
</van-tab>
</van-tabs>
</div>
<div v-if="formData.companionList.length == 0" class="companionList_empty_text">
<template v-if="configData.familyInfo === 2">
<div>
<span style="color: red;margin-left: 20px;font-size: 14px">限填写3岁以上70岁以下随行人</span>
</div>
<div v-if="formData.companionList.length > 0" class="van-card-body">
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
<van-field label="姓名" name="userName" placeholder="请填写姓名" v-model="item.userName"
:rules="[{ required: true }]"></van-field>
<!--<van-field label="工号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age"
type="digit" :rules="[{ required: true }]"></van-field>
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="item.sex">
<van-radio name="男" shape="square"></van-radio>
<van-radio name="女" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field label="身份证件" name="idCard" placeholder="输入身份证自动填充年龄与性别"
:rules="[{ required: true }]" maxlength="18"
@input="getAgeAndSex(item)" v-model="item.idCard"></van-field>
<van-field label="手机号" name="mobile" placeholder="请填写手机号"
:rules="[{ required: true }]" type="digit"
v-model="item.mobile"></van-field>
<van-field @click="companionVisible = true" readonly is-link label="与本人关系"
name="relation"
placeholder="随行人与本人关系" v-model="item.relation"
:rules="[{ required: true }]"></van-field>
<!--<van-field @click="self = false; roomVisible = true" readonly is-link label="房间"
name="bedType" placeholder="请选择房间"
v-model="item.bedInfo.bedType"></van-field>
<div style="font-size: 8px; color:orangered; padding-left: 16px; padding-bottom: 4px">
提醒:如果跟报名人员同一房间,无须选择!
</div>
<van-field v-if="item.bedInfo.bedType == '标准间'" @click="self = false; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="item.bedInfo.bedNum"></van-field>
<van-field v-if="item.bedInfo.bedType == '标准间'"
:rules="[{ validator, message: '请选择是否拼房' }]" label="是否拼房">
<template #input>
<van-radio-group direction="horizontal" v-model="item.bedInfo.isSleepTogether">
<van-radio :name="true" shape="square"></van-radio>
<van-radio :name="false" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-if="item.bedInfo.bedType == '标准间' && item.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="item.bedInfo.otherSleepUser"></van-field>-->
</van-tab>
</van-tabs>
</div>
<div v-if="formData.companionList.length == 0" class="companionList_empty_text">
<span>
如有随行人出行,请添加随行人
</span>
</div>
</div>
</template>
<template v-else>
<van-field label="家属数量" name="familyNumber" placeholder="请填写家属数量" v-model="formData.familyNumber"
type="digit" :rules="[{ required: true }]"></van-field>
</template>
</div>
<div class="submitButton">
@@ -410,34 +499,35 @@ layout("/mobile/platform.html"){
<!--房间类型弹出框-->
<van-popup position="bottom" round v-model="roomVisible">
<van-picker
title="入住房间" show-toolbar
:columns="roomColumns"
@confirm="roomConfirm"
@cancel="roomCancel">
title="入住房间" show-toolbar
:columns="roomColumns"
@confirm="roomConfirm"
@cancel="roomCancel">
</van-picker>
</van-popup>
<!--床位弹出框-->
<van-popup position="bottom" round v-model="bedVisible">
<van-picker
title="床位" show-toolbar
:columns="bedColumns"
@confirm="bedConfirm"
@cancel="bedVisible = false">
title="床位" show-toolbar
:columns="bedColumns"
@confirm="bedConfirm"
@cancel="bedVisible = false">
</van-picker>
</van-popup>
<!--随行人关系弹出框-->
<van-popup position="bottom" round v-model="companionVisible">
<van-picker
title="与本人关系" show-toolbar
:columns="companionColumns"
@confirm="(value, index) => {formData.companionList[active].relation = value; companionVisible = false}"
@cancel="companionVisible = false">
title="与本人关系" show-toolbar
:columns="companionColumns"
@confirm="(value, index) => {formData.companionList[active].relation = value; companionVisible = false}"
@cancel="companionVisible = false">
</van-picker>
</van-popup>
</div>
<script>
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
@@ -446,15 +536,18 @@ layout("/mobile/platform.html"){
return null;
}
let pdfh5 = null
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
isPdf: false,
isLoad: false,
active: 0,
roomColumns: ['大床房', '标准间'],
roomColumns: ['房', '默认房间'],
bedColumns: ['1', '2'],
companionColumns: ['亲属', '朋友'],
companionColumns: ['配偶', '子女', '亲属', '其他'],
bedVisible: false,
roomVisible: false,
companionVisible: false,
@@ -466,7 +559,7 @@ layout("/mobile/platform.html"){
userName: "${@shiro.getPrincipalProperty('username')}",
loginName: "${@shiro.getPrincipalProperty('loginname')}",
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
idCard: "",
idCard: "${@shiro.getPrincipalProperty('idcard')}",
mobile: "${@shiro.getPrincipalProperty('mobile')}",
lineName: '',
takePartInLineId: '',
@@ -481,9 +574,24 @@ layout("/mobile/platform.html"){
fromUrlByMy: '',
enrollId: '',
configData: {},
signType: '',
takePartInTravelAgencyId: '',
queryYear: '',
}
},
methods: {
getAgeAndSex(item){
try {
const value = item.idCard
const age = this.calculateAgeFromIdCard(value)
this.$set(item, "age", age)
const sex = this.getGenderFromIdCard(value)
this.$set(item, "sex", sex)
} catch (error) {
console.log(error)
}
},
roomCancel() {
if (!this.self) {
this.formData.companionList[this.active].bedInfo.bedType = ''
@@ -510,19 +618,53 @@ layout("/mobile/platform.html"){
return value != null
},
async joinSubmit() {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const cloneData = clone(this.formData)
cloneData.companionList.forEach((item, index) => {
if (item.userName === '') {
cloneData.companionList.splice(index, 1)
}
})
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doSignUpForLine', {
if (cloneData.companionList) {
for (let i = 0; i < cloneData.companionList.length; i++) {
const companion = cloneData.companionList[i];
// 检查每个字段是否为空
if (!companion.userName || !companion.idCard || !companion.mobile || !companion.relation) {
this.$toast('请填写完整随行人信息')
return
}
// 填了身份证,校验是否正确
if (companion.idCard) {
if (!this.validateIdCard(companion.idCard)) {
this.$toast('随行人'+ (i+1) +'的身份证不正确')
return
} else {
// 判断companion.age,是不是在3到70岁之间,不是就提示
if (companion.age < 3 || companion.age > 70) {
this.$toast('随行人'+ (i+1) +'的年龄超出限制,请天添加其他联系人')
return
}
}
}
}
}
let url = ''
if(this.signType == '2') {
cloneData.takePartInTravelAgencyId = this.takePartInTravelAgencyId
url = '/platform/theRapyRecuperation/line/enroll/doSignUpForTravelAgency'
} else {
url = '/platform/theRapyRecuperation/line/enroll/doSignUpForLine'
}
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const resp = await $.post(url, {
enroll: JSON.stringify(cloneData),
})
setTimeout(() => {
@@ -537,7 +679,7 @@ layout("/mobile/platform.html"){
toast.clear()
}, 500)
if (resp.code === 0) {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
location.replace('/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index)
}
}, 1000)
},
@@ -557,19 +699,21 @@ layout("/mobile/platform.html"){
}),
})
if (re.code !== 0) {
if(re.msg === '您今年已报名,如要继续报名请进入我的疗休养,取消已选择') {
if (re.msg === '您今年已报名,如要继续报名请进入我的疗休养,取消已选择') {
vant.Dialog.confirm({
title: '温馨提示',
message: re.msg,
confirmButtonText: '跳转页面',
}).then(() => {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
}).catch(() => {});
}).catch(() => {
});
} else {
vant.Dialog.alert({
title: '温馨提示',
message: re.msg,
}).then(() => {})
}).then(() => {
})
}
return
}
@@ -593,7 +737,8 @@ layout("/mobile/platform.html"){
async getData() {
const res = await $.get('/platform/theRapyRecuperation/line/enroll/selectLineAllInfo', {
usId: this.id,
usUnionId: this.takePartInUnionId
usUnionId: this.takePartInUnionId,
year: this.queryYear
})
if (res.code === 0) {
this.lineData = res.data
@@ -641,10 +786,120 @@ layout("/mobile/platform.html"){
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
this.configData = resp.data
},
calculateAgeFromIdCard(idCard) {
// 检查身份证号码是否合法
if (!idCard) {
throw new Error("Invalid ID card format")
}
let birthDateStr
let birthYear, birthMonth, birthDay
// 处理18位身份证号码
if (idCard.length === 18) {
birthDateStr = idCard.substring(6, 14)
birthYear = parseInt(birthDateStr.substring(0, 4), 10)
birthMonth = parseInt(birthDateStr.substring(4, 6), 10) - 1 // 月份从0开始
birthDay = parseInt(birthDateStr.substring(6, 8), 10)
}
// 处理15位身份证号码
else if (idCard.length === 15) {
birthDateStr = idCard.substring(6, 12)
birthYear = parseInt("19" + birthDateStr.substring(0, 2), 10) // 使用字符串拼接
birthMonth = parseInt(birthDateStr.substring(2, 4), 10) - 1 // 月份从0开始
birthDay = parseInt(birthDateStr.substring(4, 6), 10)
} else {
throw new Error("Invalid ID card format. Only 15 or 18 digits are supported.")
}
// 获取当前日期
const currentDate = new Date()
// 计算年龄
let age = currentDate.getFullYear() - birthYear
// 如果当前日期还没过生日,则年龄减1
if (currentDate.getMonth() < birthMonth || (currentDate.getMonth() === birthMonth && currentDate.getDate() < birthDay)) {
age -= 1
}
return age
},
getGenderFromIdCard(idCard) {
// 检查身份证号码是否合法
if (!idCard) {
throw new Error("Invalid ID card format")
}
let genderDigit
// 处理18位身份证号码
if (idCard.length === 18) {
genderDigit = parseInt(idCard.charAt(16), 10) // 第17位
}
// 处理15位身份证号码
else if (idCard.length === 15) {
genderDigit = parseInt(idCard.charAt(14), 10) // 第15位
} else {
throw new Error("Invalid ID card format. Only 15 or 18 digits are supported.")
}
// 判断性别
if (genderDigit % 2 === 0) {
return "女"
} else {
return "男"
}
},
validateIdCard(idCard) {
if (!idCard) {
return false
}
// 18位身份证号码校验
if (idCard.length === 18) {
const idCardRegex = /^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/
if (!idCardRegex.test(idCard)) {
return false
}
// 校验码计算
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
const checksums = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]
let sum = 0
for (let i = 0; i < 17; i++) {
sum += idCard[i] * weights[i]
}
const checksum = checksums[sum % 11]
return checksum === idCard[17].toUpperCase()
}
// 15位身份证号码校验
else if (idCard.length === 15) {
const idCardRegex = /^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/
return idCardRegex.test(idCard)
}
// 外国人或其他情况
else {
return false
}
},
},
async created() {
const loading = this.$toast({
duration: 0,
message: '正在加载线路信息',
forbidClick: true,
loadingType: 'spinner',
type: 'loading',
overlay: true
});
this.id = getQueryString('id') ? getQueryString('id') : ''
this.queryYear = getQueryString('queryYear') ? getQueryString('queryYear') : ''
this.index = getQueryString('index') ? getQueryString('index') : ''
this.signType = getQueryString('signType') ? getQueryString('signType') : ''
this.takePartInTravelAgencyId = getQueryString('takePartInTravelAgencyId') ? getQueryString('takePartInTravelAgencyId') : ''
await this.getConfigData()
//编辑传出来的参数
this.fromUrlByMy = getQueryString('fromUrlByMy') ? getQueryString('fromUrlByMy') : ''
@@ -653,16 +908,66 @@ layout("/mobile/platform.html"){
if (this.enrollId) {
await this.findSignUpInfoById()
}
this.getData()
if(!this.signType) {
await this.getData()
} else {
this.joinPopup = true
}
this.isLoad = true
try {
const parser = new DOMParser();
const doc = parser.parseFromString(this.lineData.content, 'text/html');
const link = doc.querySelector('a');
const href = link.getAttribute('href');
this.$nextTick(() => {
pdfh5 = new Pdfh5('#demo', {
pdfurl: href,
});
})
}catch (e) {
this.isPdf = true
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
vant.ImagePreview({
images: [event.target.src],
closeable: true,
})
}
})
}
this.$nextTick(() => {
pdfh5.on("complete", function () {
const imgDoc = document.querySelectorAll('img')
let array = []
let classArray = []
imgDoc.forEach(o => {
if(o.getAttribute('class') !== 'top_icon') {
classArray.push(o.getAttribute('class'))
array.push(o.getAttribute('src'))
}
})
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
const index = classArray.indexOf(event.target.className)
if(index !== -1) {
vant.ImagePreview({
images: array,
startPosition: index,
closeable: true,
})
}
}
})
})
})
loading.close()
},
mounted() {
window.addEventListener('scroll', this.scrollToTop)
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
vant.ImagePreview([event.target.src])
}
})
},
destroyed() {
window.removeEventListener('scroll', this.scrollToTop)
@@ -3,6 +3,10 @@ layout("/mobile/platform.html"){
#-->
<style>
#app {
font-family: 微软雅黑,serif;
}
.van-doc-card {
margin: 10px;
padding: 12px 12px 12px 12px;
@@ -77,21 +81,22 @@ layout("/mobile/platform.html"){
.footer {
background-color: white;
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
display: flex;
justify-content: space-evenly;
align-items: center;
left: 0;
}
.footer .van-button {
height: 34px;
height: 30px;
font-size: 12px;
border-radius: 6px;
}
.van-divider {
margin: 8px 0;
}
.active {
background-color: #1867b0;
color: white;
@@ -109,9 +114,7 @@ layout("/mobile/platform.html"){
.van-row {
text-align: center;
color: #1867b0;
font-weight: bold;
padding: 0px 0px 10px 0px;
font-family: cursive;
}
.van-col {
@@ -122,17 +125,37 @@ layout("/mobile/platform.html"){
font-size: 12px;
}
.sign_button .van-button{
width: 72px;
height: 26px;
color: white;
background: rgb(24, 103, 176);
border-color: rgb(24, 103, 176);
font-size: 11px;
border-radius: 6px;
}
[v-cloak] {
display: none;
}
.van-action-sheet__cancel, .van-action-sheet__item {
font-size: 13px;
}
</style>
<div id="app" v-cloak>
<div id="app" v-cloak v-if="isLoad">
<van-sticky>
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder title="疗休养线路"></van-nav-bar>
<van-nav-bar @click-left="pjaxReplace('/platform/mobile/theRapyRecuperation/index')" fixed left-arrow placeholder title="疗休养线路"></van-nav-bar>
</van-sticky>
<van-dropdown-menu>
<!--<van-dropdown-menu>
<van-dropdown-item v-model="pageForm.year" :options="yearArray"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu>
</van-dropdown-menu>-->
<!-- <van-notice-bar v-if="schoolTime != '' && schoolTime != null" mode="closeable">您的入校时间为{{schoolTime}},疗休养额度为1500。</van-notice-bar>-->
<!--按钮导航-->
<div class="choose_button van-doc-card">
@@ -145,47 +168,85 @@ layout("/mobile/platform.html"){
</div>
</van-grid-item>
</van-grid>
<van-divider></van-divider>
<!-- <div class="footer"-->
<!-- v-if="['0', 0].includes(pageForm.theRapyRecuperationType)">-->
<!-- <van-button :class="pageForm.lineUnionType == 2 ? 'active' : 'no_active'"-->
<!-- @click="otherUnionClick">-->
<!-- 其他分工会-->
<!-- </van-button>-->
<!-- <van-button :class="pageForm.lineUnionType == 1 ? 'active' : 'no_active'"-->
<!-- @click="pageForm.lineUnionType = 1; getData()">-->
<!-- 本分工会-->
<!-- </van-button>-->
<!-- <van-button :class="pageForm.lineUnionType == 3 ? 'active' : 'no_active'"-->
<!-- @click="pageForm.lineUnionType = 3; getData()">-->
<!-- 校工会-->
<!-- </van-button>-->
<!-- </div>-->
</div>
<van-list
:finished="finished"
:immediate-check="true"
@load="onLoad"
finished-text="没有更多了"
v-model="loading">
<div @click.stop="findOne(o)" class="list-card" v-for="o in tableData">
:finished="finished"
:immediate-check="true"
@load="onLoad"
finished-text="没有更多了"
v-model="loading">
<div @click.stop="clickLineRow(o)" class="list-card" v-for="o in tableData">
<div class="content">
<van-image
height="100"
radius="8"
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + o.fileId"
width="150">
height="86"
radius="8"
:src="CREATE_PREVIEW_URL(o.fileId)"
width="130">
</van-image>
<div v-if="pageForm.theRapyRecuperationType != '2' && pageForm.theRapyRecuperationType != '3'"
class="content-right">
<div class="cr-title">
<span>{{o.lineName}}</span>
<div>
<span style="font-size: 14px">{{o.lineName}}</span>
<!--<div>
<van-tag color="#1867b0">{{o.lotName}}</van-tag>
<van-tag color="#1867b0">{{o.signUpMode === 2 ? '校工会' :
o.usUnionName}}
</van-tag>
</div>
</div>-->
</div>
<div class="desc_info">
<!--<div class="union">
<span>组织形式:</span>{{o.createMode === 2 && o.signUpMode === 2 ? '校工会' : o.usUnionName}}
</div>-->
<div class="concat">
<!--<div class="concat" v-if="modifyConfig.familyInfo == 2">
<span>已报人数:</span>{{o.signUpUserNum + o.signUpUserFamilyNum + '(家属' +
o.signUpUserFamilyNum + '人)'}}
o.signUpUserFamilyNum + '人)'}}
</div>
<div class="mobile" style="color: red">
<span>出行时间:</span>{{moment(o.playStartTime).format('YYYY-MM-DD')}}
<div class="concat" v-else>
<span>已报人数:</span>{{o.signUpUserNum + o.familyNumber + '(家属' +
o.familyNumber + '人)'}}
</div>-->
<div class="concat">
<span>线路类型:</span>
{{o.regionalNature}}
</div>
<div class="concat">
<span>出行时段:</span>
{{o.lotName}}
</div>
<div class="mobile">
<span>&ensp;&ensp;社:</span>{{o.travelAgencyName}}
<!--<span>出行时间:</span>{{moment(o.playStartTime).format('YYYY-MM-DD')}}-->
<span>组织机构:</span>
{{o.signUpMode === 2 ? '校工会' : o.usUnionName}}
</div>
<!--<div class="mobile">
<span>&ensp;&ensp;社:</span>{{o.travelAgencyName}}
</div>-->
</div>
</div>
@@ -204,10 +265,33 @@ layout("/mobile/platform.html"){
<!--<div class="mobile">
<span>邮箱:</span>{{o.email}}
</div>-->
<div class="union" style="margin-top: 0">
<span>&emsp;&emsp;网:</span><span style="color: #0e5996"
@click.stop="window.open(o.officialWebsite.indexOf('http') !== -1 ? o.officialWebsite : 'https://' + o.officialWebsite)">{{o.officialWebsite}}</span>
<div class="concat" v-if="modifyConfig.familyInfo == 2">
<span>已报人数:</span>{{o.signUpUserNum + '人'}}
</div>
<div class="concat" v-else>
<span>已报人数:</span>{{o.signUpUserNum + '人'}}
</div>
<!-- <div class="concat" v-if="modifyConfig.familyInfo == 2">-->
<!-- <span>已报人数:</span>{{o.signUpUserNum + o.signUpUserFamilyNum + '(家属' +-->
<!-- o.signUpUserFamilyNum + '人)'}}-->
<!-- </div>-->
<!-- <div class="concat" v-else>-->
<!-- <span>已报人数:</span>{{o.signUpUserNum + o.familyNumber + '(家属' +-->
<!-- o.familyNumber + '人)'}}-->
<!-- </div>-->
<!--<div class="union" style="margin-top: 0">
<span>&emsp;&emsp;网:</span>
<span style="color: #0e5996"
@click.stop="window.open(o.officialWebsite.indexOf('http') !== -1 ? o.officialWebsite : 'https://' + o.officialWebsite)">
{{o.officialWebsite}}
</span>
</div>-->
</div>
</div>
@@ -233,41 +317,69 @@ layout("/mobile/platform.html"){
</div>
</div>
<div v-if="pageForm.theRapyRecuperationType == '2'">
<van-row gutter="20">
<div v-if="pageForm.theRapyRecuperationType == '3'">
<van-row gutter="20" class="sign_button">
<van-col @click="" span="12" style="border-right: 1px lightgrey solid"></van-col>
<van-col span="12">
<van-button @click.stop="join(o)" plain round size="mini" type="info">我要报名</van-button>
<van-col span="12" style="text-align: right">
<van-button @click.stop="openSignUser(o, 'base')" round size="mini" type="info">
查看人员
</van-button>
<van-button @click.stop="findOne(o)" round size="mini" type="info"
style="margin-right: 8px">
我要报名
</van-button>
</van-col>
</van-row>
</div>
</div>
</van-list>
<div class="footer"
v-if="['0', '1', 0 , 1].includes(pageForm.theRapyRecuperationType)">
<van-button :class="pageForm.lineUnionType == 2 ? 'active' : 'no_active'"
@click="otherUnionClick">
其他工会
</van-button>
<van-button :class="pageForm.lineUnionType == 1 ? 'active' : 'no_active'"
@click="pageForm.lineUnionType = 1; getData()">
本工会
</van-button>
<van-button :class="pageForm.lineUnionType == 3 ? 'active' : 'no_active'"
@click="pageForm.lineUnionType = 3; getData()">
校工会
</van-button>
</div>
<van-popup position="bottom" round v-model:show="unionPop">
<van-picker
title="选择分工会" show-toolbar
:columns="unionColumns"
@confirm="onConfirm"
@cancel="unionPop = false"
title="选择分工会" show-toolbar
:columns="unionColumns"
@confirm="onConfirm"
@cancel="unionPop = false"
></van-picker>
</van-popup>
<van-action-sheet
v-model="selectLinePopup"
cancel-text="取消"
:description="clickRow.lineName"
close-on-click-action>
<button v-for="(item,index) in selectLineList" 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">{{item.name}}</div>
<div class="van-action-sheet__name">{{item.playTime}}</div>
<div class="van-action-sheet__subname">{{item.subname}}</div>
</div>
<div class="sign_button">
<div>
<van-button @click.stop="onSelect(item)" size="mini" type="info"
style="margin-right: 8px">
点击报名
</van-button>
</div>
<div style="margin-top: 4px">
<van-button @click.stop="openSignUser(item, 'line')" size="mini" type="info"
style="margin-right: 8px">
查看人员
</van-button>
</div>
</div>
</div>
</button>
</van-action-sheet>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养首页</van-tabbar-item>
<van-tabbar-item icon="search" replace url="/platform/mobile/theRapyRecuperation/mobileLineListPage">线路选择</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的报名</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
@@ -278,33 +390,87 @@ layout("/mobile/platform.html"){
return null;
}
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
tarBarActive: 1,
searchKeyWord: '',
isLoad: false,
yearArray: [],
unionColumns: [],
unionPop: false,
chooseButton: [],
pageForm: {
theRapyRecuperationType: 0,
lineUnionType: 1,
lineUnionType: 3,
unionId: "${@shiro.getPrincipalProperty('union').getId()}",
year: new Date().getFullYear()
year: null
},
loading: false,
finished: false,
refreshing: false,
lineData: {},
modifyConfig:{},
clickRow: {},
selectLineList: [],
selectLinePopup: false,
// schoolTime: '',
}
},
methods: {
async openSignUser(row, type) {
const id = type === 'line' ? row.usId : row.id
location.href = '/platform/mobile/theRapyRecuperation/userSignInfo?type=' + type + '&id=' + id
},
async clickLineRow(o) {
this.clickRow = o
if(this.pageForm.theRapyRecuperationType == 3) {
await this.findOne(o)
return
}
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/getSelectLineById',
{
lineId: o.lineId,
unionId: this.pageForm.unionId,
theRapyRecuperationType: this.pageForm.theRapyRecuperationType,
lineUnionType: this.pageForm.lineUnionType,
}
)
this.selectLineList = resp.data
this.selectLineList.forEach((item, index) => {
item.name = '出行时间' + (index + 1) + ' ' + moment(item.playStartTime).format('YYYY-MM-DD HH:mm')
item.playTime = '报名截止:' + moment(item.signUpEndTime).format('YYYY-MM-DD HH:mm')
if(this.modifyConfig.familyInfo == 2) {
item.subname = '已报人数:'
+ (item.signUpUserNum + item.signUpUserFamilyNum)
+ '人'
} else {
item.subname = '已报人数:'
+ (item.signUpUserNum + item.signUpUserFamilyNum)
+ '人'
}
// if(this.modifyConfig.familyInfo == 2) {
// item.subname = '已报人数:'
// + (item.signUpUserNum + item.signUpUserFamilyNum)
// + '(家属' + item.signUpUserFamilyNum + '人)'
// } else {
// item.subname = '已报人数:'
// + (item.signUpUserNum + item.signUpUserFamilyNum)
// + '(家属' + item.familyNumber + '人)'
// }
})
this.selectLinePopup = true
},
onSelect(item) {
this.findOne(item)
},
otherUnionClick() {
if(this.unionColumns.length === 0) {
vant.Toast('暂时没有工会公开线路')
vant.Toast('暂时没有其他分工会公开线路')
return
}
this.pageForm.lineUnionType = 2
@@ -313,6 +479,9 @@ layout("/mobile/platform.html"){
doSearch() {
this.loading = true
this.finished = false
if (this.pageForm.theRapyRecuperationType == 0) {
this.$set(this.pageForm, 'lineUnionType', 3)
}
this.getData()
},
async join(o) {
@@ -365,14 +534,32 @@ layout("/mobile/platform.html"){
location.href = '/platform/mobile/theRapyRecuperation/lineInfo?id=' + o.usId + '&index=' + this.pageForm.theRapyRecuperationType
+ '&takePartInUnionId=' + o.takePartInUnionId
} else if (type === 3) {
location.href = '/platform/mobile/theRapyRecuperation/baseInfo?id=' + o.usId + '&index=' + this.pageForm.theRapyRecuperationType
location.href = '/platform/mobile/theRapyRecuperation/baseInfo?id=' + o.id + '&index=' + this.pageForm.theRapyRecuperationType
} else if(type === 2) {
const re = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
enroll: JSON.stringify({
takePartInTravelAgencyId: o.id,
}),
})
if (re.code !== 0) {
vant.Dialog.alert({
title: '温馨提示',
message: re.msg,
})
return
}
location.href = '/platform/mobile/theRapyRecuperation/lineInfo?id=' + o.usId + '&index=' + this.pageForm.theRapyRecuperationType
+ '&takePartInUnionId=' + o.takePartInUnionId + '&signType=2' + '&takePartInTravelAgencyId=' + o.id
}
},
getData() {
this.loading = true
if (this.pageForm.lineUnionType === 1) {
if (this.pageForm.lineUnionType === 3) {
this.pageForm.unionId = "${@shiro.getPrincipalProperty('union').getId()}"
}
if (this.pageForm.theRapyRecuperationType == 1) {
this.$set(this.pageForm, 'lineUnionType', 3)
}
this.pageForm.pageNumber = 1
this.tableData = []
this.onLoad()
@@ -394,26 +581,47 @@ layout("/mobile/platform.html"){
for (let i = 2023; i <= 2043; i++) {
this.yearArray.push({value: i, text: i + '年'})
}
this.yearArray.unshift({value: null, text: '全部'})
},
async getTheRapyUnions() {
const resp = await $.get('/platform/theRapyRecuperation/line/enroll/getTheRapyUnions', {
year: this.pageForm.year
year: this.pageForm.year,
theRapyRecuperationType: this.pageForm.theRapyRecuperationType
})
return resp.data
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
// async getSchoolTime() {
// const res = await $.post('/platform/theRapyRecuperation/line/enroll/getSchoolTime')
// this.schoolTime = res.data
// },
},
mounted() {
if(localStorage.getItem('clickIndex') !== null) {
const clickIndex = localStorage.getItem('clickIndex')
this.pageForm.theRapyRecuperationType = JSON.parse(clickIndex).clickIndex
}
if(this.pageForm.theRapyRecuperationType == 1){
this.$set(this.pageForm, 'lineUnionType', 3)
}
},
async created() {
this.createYear()
const clickIndex = localStorage.getItem('clickIndex')
this.pageForm.theRapyRecuperationType = JSON.parse(clickIndex).clickIndex
await this.getModifyConfig()
// await this.getSchoolTime()
this.chooseButton = await getEnumOptions('TheRapyRecuperationType')
this.chooseButton = this.chooseButton.filter(o => o.value !== 2 && o.value !== 3)
this.chooseButton = this.chooseButton.filter(o => o.value !== 2)
const unions = await this.getTheRapyUnions()
unions.forEach(item => {
this.unionColumns.push({text: item.unionname, value: item.id})
})
}
this.isLoad = true
},
})
</script>
@@ -72,21 +72,28 @@ layout("/mobile/platform.html"){
.footer {
background-color: white;
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
display: flex;
justify-content: space-evenly;
align-items: center;
left: 0;
}
.footer .van-button {
height: 34px;
height: 30px;
font-size: 12px;
border-radius: 6px;
}
.evaluateVisible .van-button {
height: 30px;
font-size: 12px;
border-radius: 6px;
}
.van-divider {
margin: 8px 0;
}
.active {
background-color: #1867b0;
color: white;
@@ -172,11 +179,59 @@ layout("/mobile/platform.html"){
margin-left: 4px;
}
.evaluateVisible {
width: 100%;
height: 80%;
}
.title_container {
display: flex;
justify-content: flex-end;
align-items: center;
position: relative;
padding: 9px;
}
.title {
position: absolute;
left: 0;
right: 0;
margin: auto;
text-align: center;
}
.content {
padding: 10px 20px;
}
.line_info {
display: flex;
align-items: center;
}
.evaluate_item_content {
display: flex;
gap: 20px;
}
.evaluate_item {
padding: 6px 20px;
border: 1px grey solid;
text-align: center;
border-radius: 10px;
}
.evaluate_active {
background-color: #07C160;
color: white;
border-color: #07C160;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder
<van-nav-bar @click-left="pjaxReplace('/platform/mobile/theRapyRecuperation/index')" fixed left-arrow placeholder
title="我的疗休养"></van-nav-bar>
</van-sticky>
@@ -196,6 +251,14 @@ layout("/mobile/platform.html"){
</div>
</van-grid-item>
</van-grid>
<van-divider></van-divider>
<div class="footer">
<van-button @click="pageForm.signUpStateId = 1; getData()" :class="pageForm.signUpStateId == 1 ? 'active' : 'no_active'">已报名</van-button>
<van-button @click="pageForm.signUpStateId = 2; getData()" :class="pageForm.signUpStateId == 2 ? 'active' : 'no_active'">已参加</van-button>
<van-button @click="pageForm.signUpStateId = 3; getData()" :class="pageForm.signUpStateId == 3 ? 'active' : 'no_active'">未参加</van-button>
</div>
</div>
<van-list
@@ -209,7 +272,7 @@ layout("/mobile/platform.html"){
<van-image
height="100"
radius="8"
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + o.fileId"
:src="CREATE_PREVIEW_URL(o.fileId)"
width="150"
></van-image>
@@ -241,7 +304,8 @@ layout("/mobile/platform.html"){
<span>联系方式:</span>{{o.contactMobileNumber}}
</div>
<div class="mobile" v-if="![2715,2725,2735].includes(o.stateId)">
<span>随行家属:</span>{{o.companionUserNames ? o.companionUserNames : '无'}}
<span v-if="configData.familyInfo === 1">随行家属:</span>{{o.companionUserNames ? o.companionUserNames : '无'}}
<span v-else>随行家属:</span>{{o.familyNumber}}人
</div>
<div class="mobile" v-else>
<span>审核状态:</span><span :style="'color: ' + o.stateColor">{{o.stateName}}</span>
@@ -295,6 +359,9 @@ layout("/mobile/platform.html"){
</div>
<div class="operateDiv">
<van-button v-if="pageForm.signUpStateId == 2" @click="openEvaluate(o)" type="info" size="small" color="#1867b0">
&ensp;
</van-button>
<van-button v-if="pageForm.theRapyRecuperationType != '2' && moment().unix() < moment(o.changeEndTime).unix()
&& ![2715,2725,2735].includes(o.stateId)" @click="edit(o)"
type="info" size="small" color="#1867b0" :disabled="o.isTakePartIn == true || getDisabled(o)">
@@ -302,21 +369,15 @@ layout("/mobile/platform.html"){
</van-button>
<van-button type="info" size="small" color="#1867b0" @click="cancel(o)"
:disabled="getDisabled(o)">
&ensp;
&ensp;
</van-button>
<van-button v-if="o.isTakePartIn == true" type="info" size="small" color="#1867b0"
@click="satisfaction(o)">满意度反馈</van-button>
<!--<van-button v-if="o.isTakePartIn == true" type="info" size="small" color="#1867b0"
@click="satisfaction(o)">满意度反馈</van-button>-->
</div>
</div>
</van-list>
<div class="footer">
<van-button @click="pageForm.signUpStateId = 1; getData()" :class="pageForm.signUpStateId == 1 ? 'active' : 'no_active'">已报名</van-button>
<van-button @click="pageForm.signUpStateId = 2; getData()" :class="pageForm.signUpStateId == 2 ? 'active' : 'no_active'">已参加</van-button>
<van-button @click="pageForm.signUpStateId = 3; getData()" :class="pageForm.signUpStateId == 3 ? 'active' : 'no_active'">未参加</van-button>
</div>
<van-popup class="popVisible" position="right" v-model="popVisible">
<van-nav-bar @click-left="popVisible = false" fixed left-arrow placeholder title="满意度评分"></van-nav-bar>
<div class="cus_content">
@@ -352,15 +413,53 @@ layout("/mobile/platform.html"){
</div>
</van-popup>
<van-action-sheet title="参加体验评价" v-model="evaluatePopup">
<div class="evaluateForm">
<div style="text-align: center;margin: 20px 0;font-size: 20px;color: #f18d8d;font-weight: bold;">
您的评价让我们做的更好
</div>
<div style="display: flex;justify-content: center;flex-direction: column;align-items: center">
<div style="text-align: center;font-size: 13px;color: rgb(139 134 134); margin-bottom: 10px">为本次疗休养打分
</div>
<div class="evaluate_item_content">
<div class="evaluate_item" @click="evaluateClick('满意', 1)">满意</div>
<div class="evaluate_item" @click="evaluateClick('一般', 2)">一般</div>
<div class="evaluate_item" @click="evaluateClick('不满意', 3)">不满意</div>
</div>
</div>
<van-field
autosize
class="evaluateTextField"
label="评价"
label-width="0"
maxlength="100"
placeholder="请输入评价"
rows="5"
type="textarea"
v-model="evaluateFormData.evaluateText"
>
<div slot="label"></div>
</van-field>
</div>
<div style="padding: 10px 16px">
<van-button @click="doSubmitEvaluate"
block
type="primary"
>提交
</van-button>
</div>
</van-action-sheet>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养报名
</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的疗休养
</van-tabbar-item>
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养首页</van-tabbar-item>
<van-tabbar-item icon="search" replace url="/platform/mobile/theRapyRecuperation/mobileLineListPage">线路选择</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的报名</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
@@ -376,23 +475,82 @@ layout("/mobile/platform.html"){
mixins: [mobileMixins],
data() {
return {
tarBarActive: 2,
evaluateFormData: {},
evaluatePopup: false,
yearArray: [],
popVisible: false,
chooseButton: [],
pageForm: {
theRapyRecuperationType: null,
signUpStateId: 1,
year: null,
year: new Date().getFullYear(),
},
loading: false,
finished: false,
refreshing: false,
satisfactionForm: {},
configData: {},
tarBarActive: 1
}
},
methods: {
async openEvaluate(o) {
if(o.isTakePartIn === false) {
this.$modal.msg("参加后才能评价")
return
}
await this.finOneEvaluate(o.takePartInLineId)
this.evaluatePopup = true
this.$nextTick(() => {
let score = 1
if (this.evaluateFormData.evaluateScore === '满意') {
score = 1
} else if (this.evaluateFormData.evaluateScore === '一般') {
score = 2
} else if (this.evaluateFormData.evaluateScore === '不满意') {
score = 3
}
this.evaluateClick(this.evaluateFormData.evaluateScore, score)
})
},
evaluateClick(value, index) {
this.evaluateFormData.evaluateScore = value
const elements = document.querySelectorAll('.evaluate_item')
for (let i = 0; i < elements.length; i++) {
if(index === (i + 1)) {
elements[i].classList.add('evaluate_active')
} else {
elements[i].classList.remove('evaluate_active')
}
}
},
async finOneEvaluate(lineId) {
const {data, code, msg} = await $.post("/platform/theRapyRecuperation/line/enroll/finOneEvaluate", {
lineId: lineId,
})
if (code === 0) {
if (data) {
this.evaluateFormData = data
} else {
this.evaluateFormData = {lineId: lineId}
}
} else {
this.$message.warning(msg)
}
},
async doSubmitEvaluate() {
if (!this.evaluateFormData.evaluateScore) {
this.$modal.msg("请为本次疗休养评分")
return
}
const {code, data, msg} = await $.post('/platform/theRapyRecuperation/line/enroll/doEvaluate', this.evaluateFormData)
if (code === 0) {
this.$modal.msgSuccess("评价成功")
this.evaluatePopup = false
} else {
this.$modal.msgError(msg)
}
},
getDisabled(o) {
if(o.regionalNature === '省内') {
return this.configData.isSnLine && o.stateId === 2750
@@ -465,11 +623,11 @@ layout("/mobile/platform.html"){
}
vant.Dialog.confirm({
title: '温馨提醒',
message: '您确定要取消此报名吗?',
message: '您确定要撤销此报名吗?',
}).then(async () => {
const res = await $.post('/platform/theRapyRecuperation/line/enroll/doDeleteMyEnrollInfoById/' + o.id)
if(res.code === 0) {
vant.Toast('取消成功')
vant.Toast('撤销成功')
this.getData()
}else {
vant.Toast(res.msg)
@@ -477,8 +635,10 @@ layout("/mobile/platform.html"){
}).catch(() => {});
},
async findOne(o) {
if(this.pageForm.theRapyRecuperationType != '2') {
if(this.pageForm.theRapyRecuperationType != '2' && this.pageForm.theRapyRecuperationType != '3') {
location.href = '/platform/mobile/theRapyRecuperation/lineInfo?id=' + o.takePartInLineId + '&fromUrlByMy=edit&takePartInUnionId=' + o.takePartInUnionId
} else if (this.pageForm.theRapyRecuperationType == '3') {
location.href = '/platform/mobile/theRapyRecuperation/baseInfo?id=' + o.takePartInBaseManagementId + '&fromUrlByMy=edit'
}
},
getData() {
@@ -516,17 +676,13 @@ layout("/mobile/platform.html"){
},
async created() {
this.createYear()
this.yearArray.unshift({value: null, text: '全部'})
this.pageForm.year = new Date().getFullYear()
this.yearArray.unshift({value: null, text: '所有年度'})
this.pageForm.theRapyRecuperationType = getQueryString('index') ? getQueryString('index') : await this.getType()
this.chooseButton = await getEnumOptions('TheRapyRecuperationType')
this.chooseButton = this.chooseButton.filter(o => o.value !== 2 && o.value !== 3)
this.chooseButton = this.chooseButton.filter(o => o.value !== 2)
await this.getConfigData()
this.onLoad()
},
mounted() {
}
})
</script>
@@ -0,0 +1,84 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
#app {
font-family: 微软雅黑,serif;
}
.van-index-bar {
margin-bottom: 20px;
}
.van-empty {
height: calc(100vh - 46px - 54px);
position: unset;
transform: none;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder
title="报名人员"></van-nav-bar>
</van-sticky>
<van-search v-model="searchKeyWord" placeholder="请输入姓名查询" @search="getSignUser"></van-search>
<template v-if="Object.keys(signUserData).length > 0">
<van-index-bar :sticky-offset-top="46" :index-list="Object.keys(signUserData)">
<template v-for="(value, key) in signUserData">
<van-index-anchor :index="key"></van-index-anchor>
<van-cell v-for="item in value" :title="item.userName + '' + item.unionName + ''"></van-cell>
</template>
</van-index-bar>
</template>
<van-empty v-else description="暂无报名人员"></van-empty>
</div>
<script>
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]);
return null;
}
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
searchKeyWord: '',
signUserData: [],
id: '',
type: '',
}
},
methods: {
async getSignUser() {
const params = this.type === 'line' ? {usId: this.id, searchKeyWord: this.searchKeyWord} : {baseId: this.id, searchKeyWord: this.searchKeyWord}
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力查询中',
})
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/openSignUser', params)
this.signUserData = resp.data
toast.close()
},
},
async created() {
this.id = getQueryString('id')
this.type = getQueryString('type')
await this.getSignUser()
},
})
</script>
<!--#
}
#-->
@@ -527,7 +527,6 @@ layout("/mobile/platform.html"){
this.selectSpecsPopup = true
},
specsSelectConfirm(value) {
debugger
this.selectSpecsPopup = false
if (value) {
this.projectInfo.welfareProjectSubjects[0].options.forEach(v => {
@@ -681,7 +680,7 @@ layout("/mobile/platform.html"){
for (const option of options) {
// 检查是否有 specs
if (option.specs) {
if (option.specs && option.specs.length > 0) {
// 检查 selectSpecs 是否为空或未定义
if (!option.selectSpecs) {
this.$toast.fail('请选择' + option.optionName + '的规格')
@@ -713,24 +712,28 @@ layout("/mobile/platform.html"){
if (code === 0) {
this.getUserSelection(this.projectId)
// 女性健康知识讲座福利品Id
if (this.projectId === '8799d66b0bb640078f50feb029e506ed') {
// if (this.projectId === '8799d66b0bb640078f50feb029e506ed') {
pjaxReplace('/mobile/welfare/list/receive_success?projectId=' + this.projectId + '&provideMode=' + this.projectInfo.provideMode)
} else {
vant.Dialog.alert({
title: '温馨提示',
message: "您已完成本次选择。",
}).then(async () => {
this.confirmPopup = false
await this.getProjectInfo()
window.location.reload()
});
}
// } else {
// vant.Dialog.alert({
// title: '温馨提示',
// message: "您已完成本次选择。",
// }).then(async () => {
// this.confirmPopup = false
// await this.getProjectInfo()
// window.location.reload()
// });
// }
// this.$modal.msgSuccess("您已完成本次福利选择。")
} else {
this.$modal.msgError(msg)
this.confirmPopup = false
await this.getProjectInfo()
window.location.reload()
vant.Dialog.alert({
title: '温馨提示',
message: msg,
})
// this.$modal.msgError(msg)
// this.confirmPopup = false
// await this.getProjectInfo()
// window.location.reload()
}
},
@@ -833,6 +836,11 @@ layout("/mobile/platform.html"){
window.sessionStorage.removeItem('welfareProjectSelectInfo' + loginname)
// this.selectAddressPopup = true
} else {
const flag = localStorage.getItem("reload")
if (flag) {
window.location.reload()
localStorage.removeItem("reload")
}
this.getProjectInfo()
}
},
@@ -23,7 +23,7 @@ layout("/mobile/platform.html"){
<path d="M955.330366 240.548613h-83.927839a30.723584 30.723584 0 0 0-31.472939 30.161567v1.124034a30.910923 30.910923 0 0 0 30.348906 31.472939H955.330366a30.723584 30.723584 0 0 0 31.2856-30.348906v-1.124033A30.536245 30.536245 0 0 0 955.330366 240.548613z m-72.125487-168.605033a32.222295 32.222295 0 0 0-43.837308 4.121457L786.725333 141.071644a31.285601 31.285601 0 0 0 48.146104 39.903191l52.080221-64.819268a30.536245 30.536245 0 0 0-2.810084-42.900614zM683.126907 0.005433a30.910923 30.910923 0 0 0-31.47294 30.161567v84.864533a30.723584 30.723584 0 0 0 30.348906 31.285601h1.124034a30.536245 30.536245 0 0 0 31.2856-30.161567V31.291033A30.723584 30.723584 0 0 0 684.25094 0.005433z"
fill="#07C160" p-id="3085"></path>
</svg>
<div style="margin-top: 20px;">{{code=='2' ? '您已领取' : '您已选择'}}</div>
<div style="margin-top: 20px;">{{code=='2' ? '您已领取' : '您已完成本次选择'}}</div>
<div style="margin: 20px auto 0px auto;width: 300px;word-break: break-all">
<!-- 女性健康知识讲座福利品Id -->
{{ projectId == '8799d66b0bb640078f50feb029e506ed' ? '纪念品' : '福利品' }} {{selectOptionNames}}
@@ -55,6 +55,7 @@ layout("/mobile/platform.html"){
},
back() {
pjaxReplace('/mobile/welfare/list/receive?projectId=' + this.projectId)
localStorage.setItem("reload", '1')
}
},
created() {
@@ -297,7 +297,6 @@
tissueId: row.id
})
debugger
this.leftData = data.map((user) => {
return this.getTransProp(user, row.signUpMethod)
})
@@ -106,7 +106,6 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-col>
</el-row>-->
<el-row :gutter="20" v-if="formData.activity_id != null && formData.activity_id !== ''">
@@ -217,13 +217,6 @@ layout("/layouts/platform.html"){
sex: [{required: false, message: "必填", trigger: ["change", "blur"]}],
isVoluntary: [{required: true, message: "必填", trigger: ["change", "blur"]}],
sign: [{required: true, message: "必填", trigger: ["change", "blur"]}],
phone: [
{
validator: (rule, value, callback) => {
},
trigger: ["change", "blur"]
}
],
email: [
{
validator: (rule, value, callback) => {
@@ -37,6 +37,24 @@ layout("/layouts/platform.html"){
</el-radio-group>
</el-form-item>
<el-form-item label="开始撰写时间" prop="startWriteTime">
<el-date-picker
v-model="formData.startWriteTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="开始撰写时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结束撰写时间" prop="endWriteTime">
<el-date-picker
v-model="formData.endWriteTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="结束撰写时间">
</el-date-picker>
</el-form-item>
<el-form-item label="超时自动提交天数" prop="timeoutDays">
<el-input v-model="formData.timeoutDays" oninput="value=value.replace(/[^\d]/g,'')"
placeholder="协办单位超时自动提交天数" maxlength="3"></el-input>
@@ -324,4 +342,4 @@ layout("/layouts/platform.html"){
</script>
<!--#
}
#-->
#-->
@@ -123,7 +123,7 @@ layout("/layouts/platform.html"){
<sign :qz.sync="formData.sign" prefix="proposal"></sign>
</el-form-item>
<el-form-item>
<el-form-item v-if="showWrite">
<el-row justify="center" type="flex">
<el-button @click="doAdd" type="primary" v-throttle>保存到我的提案</el-button>
<el-button @click="openSeconded" type="primary" v-if="formData.mannerCode=='W01'">邀请附议人
@@ -204,7 +204,9 @@ layout("/layouts/platform.html"){
isSign: () => {
return proposal.needSignState.map(v => v.stateCode).includes(proposal.UNSUBMIT)
},
writeRemindDialog: false
writeRemindDialog: false,
showWrite: true,
}
},
methods: {
@@ -390,18 +392,35 @@ layout("/layouts/platform.html"){
this.getInstitutions(this.pageForm.teacherMeetingId)
])
this.config = config;
this.typeOptions = typeOptions;
this.allMannerList = allMannerList;
this.delegationOptions = delegationOptions;
this.committeeOptions = institutions;
this.createMannerList()
const id = GetQueryString("proposalId")
if (id) {
await this.editProposal()
const {startWriteTime, endWriteTime} = this.config
if (moment().isBefore(moment(startWriteTime))) {
this.showWrite = false
this.writeRemindDialog = false
this.$alert('提案征集开始时间为' + startWriteTime, '提示', {
confirmButtonText: '确定'
})
} else if (moment().isAfter(moment(endWriteTime))) {
debugger
this.showWrite = false
this.writeRemindDialog = false
this.$alert('提案征集已经结束', '提示', {
confirmButtonText: '确定',
})
} else {
this.newWriteProposal()
this.typeOptions = typeOptions;
this.allMannerList = allMannerList;
this.delegationOptions = delegationOptions;
this.committeeOptions = institutions;
this.createMannerList()
const id = GetQueryString("proposalId")
if (id) {
await this.editProposal()
} else {
this.newWriteProposal()
}
}
},
},
@@ -1138,7 +1138,6 @@ layout("/layouts/platform.html"){
},
methods: {
openCakeDesc({$index}) {
debugger
this.cake_subject_option_index = $index
this.cakeDialog = true
this.$nextTick(() => {
@@ -172,7 +172,7 @@ layout("/layouts/platform.html"){
const url = "/platform/sourcechange/manage/doBatchChange"
let isSendMsg = false
const isHasNewTeacher = this.checkUsers.some(v=> v.changeInfosStr === '新入职')
const isHasNewTeacher = this.checkUsers.some(v=> v.changeInfosStr === '新入职' && !v.personType.includes('劳务派遣'))
const ids = this.checkUsers.map(item => item.id)
if (isHasNewTeacher) {
this.$confirm('勾选用户中有新入职教工,是否对新入职教职工发送入会邀请?', '提示', {
@@ -197,7 +197,7 @@ layout("/layouts/platform.html"){
async doSubmit(formData){
const url = "/platform/sourcechange/manage/doSubmit"
let isSendMsg = false;
if (formData.changeInfosStr === '新入职') {
if (formData.changeInfosStr === '新入职' && !formData.personType.includes('劳务派遣')) {
this.$confirm('该职工是新入职职工,是否发送入会邀请?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
@@ -260,6 +260,7 @@ layout("/layouts/platform.html"){
margin: 10px auto;
overflow: hidden;
box-sizing: border-box;
overflow-y: auto;
}
.layout-grid-container .grid-item {
color: white;
@@ -0,0 +1,372 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.top_block {
width: 100%;
padding: 20px 80px;
border-bottom: 10px solid rgb(240, 240, 240);
}
.top_title {
font-size: 18px;
height: 30px;
line-height: 30px;
margin-bottom: 5px;
}
.top_num {
font-size: 26px;
color: #808492;
}
.two_num {
margin-top: 8px;
font-size: 18px;
color: #808492;
}
.cut-off-line {
width: 1px;
height: 70%;
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto;
background-color: rgb(230, 230, 230);
}
.chartTitle {
font-size: 14px;
color: #808492;
margin-bottom: 20px;
}
</style>
<div id="app">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
@change="doSearch"
:clearable="false"
value-format="yyyy"
v-model="pageForm.year"
type="year"
placeholder="选择年">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">线路类型</div>
<div class="search-item-option">
<el-select v-model="pageForm.lineType" placeholder="线路类型" clearable style="width: 100%">
<el-option v-for="item in regionalNatureList" :key="item.value" :label="item.label" :value="item.value">{{item.label}}</el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch()">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<div class="top_block">
<el-row :gutter="20">
<el-col :span="4" style="position: relative">
<div class="top_title">总人数</div>
<div class="top_num">{{numData.allNum || '0'}}</div>
<div class="cut-off-line"></div>
</el-col>
<el-col :span="4" style="position: relative">
<div class="top_title">省内人数</div>
<div class="top_num">{{numData.provinceNum || '0'}}</div>
<div class="cut-off-line"></div>
</el-col>
<el-col :span="4" style="position: relative">
<div class="top_title">省外人数</div>
<div class="top_num">{{numData.outProvinceNum || '0'}}</div>
<div class="cut-off-line"></div>
</el-col>
<el-col :span="4" style="position: relative">
<div style="display: flex;justify-content: space-between;">
<div class="top_title">总线路数</div>
<div style="margin-top: 2px;font-size: 18px;color: #1867b0">共{{numData.lineNum || '0'}}条</div>
</div>
<div class="two_num">省内{{numData.inLineNum || '0'}} | 省外{{numData.outLineNum || '0'}}</div>
<div class="cut-off-line"></div>
</el-col>
<el-col :span="4" style="position: relative">
<div style="display: flex;justify-content: space-between;">
<div class="top_title">校工会组织</div>
<div style="margin-top: 2px;font-size: 18px;color: #1867b0">共{{numData.schoolUnionLineNum || '0'}}条</div>
</div>
<div class="two_num">省内{{numData.schoolInLineNum || '0'}} | 省外{{numData.schoolOutLineNum || '0'}}</div>
<div class="cut-off-line"></div>
</el-col>
<el-col :span="4">
<div style="display: flex;justify-content: space-between;">
<div class="top_title">分工会组织</div>
<div style="margin-top: 2px;font-size: 18px;color: #1867b0">共{{numData.unionLineNum || '0'}}条</div>
</div>
<div class="two_num">省内{{numData.unionInLineNum || '0'}} | 省外{{numData.unionOutLineNum || '0'}}</div>
</el-col>
</el-row>
</div>
<el-row gutter="20" style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">
<el-col :span="12" v-loading="lotLoading">
<div class="chartTitle">时间标段统计</div>
<div id="lotChart" style="width: 100%;height: 300px"></div>
</el-col>
<el-col :span="12" v-loading="ageLoading">
<div class="chartTitle">年龄分布统计</div>
<div id="ageChart" style="width: 100%;height: 300px"></div>
</el-col>
</el-row>
<el-row style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">
<el-col :span="24" style="padding: 0 20px" v-loading="lineTravelOrAgeLoading">
<div class="chartTitle">线路人数及年龄统计</div>
<div id="lineTravelChart"></div>
</el-col>
</el-row>
<!-- <el-row style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">-->
<!-- <el-col :span="24" style="padding: 0 20px">-->
<!-- <div class="chartTitle">线路出行年龄统计</div>-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-card>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return{
pageForm: {
year: moment().format('YYYY') + "",
lineType: ''
},
numData: {
allNum: '',
provinceNum: '',
outProvinceNum: '',
allLineNum: '',
schoolLineNum: '',
branchLineNum: ''
},
regionalNatureList: [{label:'全部线路',name:'provinceAll',ordinal:0,provinceIn:'provinceIn',provinceOut:'provinceOut',value:'全部'}],
lotLoading: false,
ageLoading: false,
lineTravelOrAgeLoading: false,
isLineTravel: false,
lineTravelOrAgeTip: '出行线路年龄统计',
dualAxisChartInstance: null,
chartData: [
{ "lineName": "03-15", "takePartInLineNum": 10, "underThirtyFive": 5, "thirtyFiveToFortyFive": 3, "aboveFortyFive": 2 },
{ "lineName": "04-10", "takePartInLineNum": 15, "underThirtyFive": 7, "thirtyFiveToFortyFive": 6, "aboveFortyFive": 2 }
]
}
},
methods: {
async getNumData(){
const resp = await $.post('/platform/theRapyRecuperation/annualAnalysis/getNumData', this.pageForm)
if (resp.code === 0) {
this.numData = resp.data
}
},
async getLotNumData(){
this.lotLoading = true
const resp = await $.post('/platform/theRapyRecuperation/annualAnalysis/getLotNum', this.pageForm)
if (resp.code === 0) {
let {data} = resp
document.getElementById("lotChart").innerHTML = ''
const config = {
isStack: true,
"legend": {
"position": "top-right",
"flipPage": false
},
autoFit: true,
title: {
visible: true,
text: '出行时间标段统计详情',
},
description: {
visible: true,
text: '人',
},
xField: 'label',
yField: 'value',
stackField: 'type',
color: ["#5B8FF9", "#5AD8A6"],
"xAxis": {
label: {
formatter: (v) => {
if (data.length > 30 && v.length > 3) {
return v.substr(0, 2) + '...'
} else if (data.length > 20 && v.length > 4) {
return v.substr(0, 3) + '...'
} else if (data.length > 10 && v.length > 6) {
return v.substr(0, 5) + '...'
}
return v
}
}
},
"yAxis": {},
meta: {
label: {
alias: '标段时长',
},
value: {
alias: '人数',
}
},
connectedArea: {
visible: true,
triggerOn: false,
},
}
const plot = new G2Plot.Column(document.getElementById("lotChart"), {
data,
...config,
});
plot.render();
this.lotLoading = false
}
},
async getAgeData(){
this.ageLoading = true
const resp = await $.post('/platform/theRapyRecuperation/annualAnalysis/getAgeNum', this.pageForm)
if (resp.code === 0) {
let {data} = resp
document.getElementById("ageChart").innerHTML = ''
const config = {
"legend": {
"flipPage": false
},
"label": {
"type": "spider",
"offset": 50
},
"width": $('#ageChart').width(),
"height": $('#ageChart').height(),
"forceFit": false,
"radius": 1,
"colorField": "label",
"angleField": "value",
meta: {
label: {
alias: '年龄结构',
},
value: {
alias: '人数',
}
},
}
const plot = new G2Plot.Pie(document.getElementById("ageChart"), {
data,
...config,
});
plot.render();
this.ageLoading = false
}
},
async getLineTravelData(){
if (this.dualAxisChartInstance) {
this.dualAxisChartInstance.destroy(); // 如果已有实例,先销毁
}
const resp = await $.post('/platform/theRapyRecuperation/annualAnalysis/getLineTravelAndAgeData', this.pageForm)
if (resp.code === 0) {
let {data} = resp
document.getElementById("lineTravelChart").innerHTML = ''
const dualAxes = new G2Plot.DualAxes('lineTravelChart', {
data: [data.uvData, data.transformData],
xField: 'lineName',
yField: ['value', 'count'],
meta: {
value: {
alias: '出行人数',
},
count: {
alias: '年龄段人数',
}
},
yAxis: [
{
min: 0, // 设置Y轴最小值为0
max: null, // 自动计算最大值
title: {
text: '出行人数',
},
},
{
position: 'right',
min: 0,
max: null,
title: {
text: '年龄段人数',
},
},
],
geometryOptions: [
{
geometry: 'column',
columnWidthRatio: 0.4,
color: '#5B8FF9', // 设置柱状图颜色
},
{
geometry: 'line',
seriesField: 'name',
color: ['#5AD8A6', '#E8684A', '#FF9D4D'], // 设置线的颜色
},
],
tooltip: {
shared: true, // 共享提示框
},
});
dualAxes.render();
}
},
doLineTravelOrAgeSwitch(){
this.isLineTravel = !this.isLineTravel
this.lineTravelOrAgeTip = this.isLineTravel ? '出行线路年龄统计' : '出行线路人数统计'
},
async pageData(){
await this.getNumData()
await this.getLotNumData()
await this.getAgeData()
await this.getLineTravelData()
}
},
async created() {
this.regionalNatureList.push(...await getEnumOptions('TheRapyRecuperationProvinceType'))
this.pageData()
}
})
</script>
<!--#
}
#-->

Some files were not shown because too many files have changed in this diff Show More