server_commit

This commit is contained in:
zhengziru
2025-06-11 10:39:26 +08:00
parent 005b66b183
commit 8457290438
10 changed files with 140 additions and 116 deletions
@@ -79,7 +79,7 @@ public class SysWechatController {
@Ok("re")
public String oauth(@Param("redirectUrl") String redirectUrl) {
// String redirect = Globals.AppDomain + "platform/wechat/getCode";
String redirect = "http://zhgh.hrbnu.edu.cn/platform/wechat/getCode";
String redirect = "https://zhgh.hrbnu.edu.cn/platform/wechat/getCode";
if (StrUtil.isNotBlank(redirectUrl)) {
redirect += "?redirect=" + redirectUrl;
}
@@ -129,8 +129,10 @@ public class SysWechatController {
log.error(">>> openid 加密失败:{}", openid);
}
try {
return ">>:" + Globals.AppDomain + "mobile/login?state=" + URLEncoder.encode(encrypt, "UTF-8");
} catch (UnsupportedEncodingException e) {
// return ">>:" + Globals.AppDomain + "mobile/login?state=" + URLEncoder.encode(encrypt, "UTF-8");
// return ">>:" + "http://zhgh.hrbnu.edu.cn/mobile/login?state=" + URLEncoder.encode(encrypt, "UTF-8");
return ">>:" + "https://zhgh.hrbnu.edu.cn/mobile/login?state=" + openid;
} catch (Exception e) {
log.error(">>> 请求转发失败:{}", openid);
}
}
@@ -142,16 +144,16 @@ public class SysWechatController {
if (StrUtil.isNotBlank(redirect)) {
return ">>:" + redirect;
}
return ">>:" + Globals.AppDomain + "/mobile/index";
return ">>:" + "https://zhgh.hrbnu.edu.cn/mobile/index";
} catch (LockedAccountException e) {
request.setAttribute("errMsg", "帐号被锁定,请5分钟后再试");
return ">>:" + Globals.AppDomain + "/platform/home/LockedAccountError";
return ">>:" + "https://zhgh.hrbnu.edu.cn/platform/home/LockedAccountError";
} catch (UnknownAccountException e) {
request.setAttribute("errMsg", "系统中没有此用户");
return ">>:" + Globals.AppDomain + "/error/UnknownAccountError.html";
return ">>:" + "https://zhgh.hrbnu.edu.cn/error/UnknownAccountError.html";
} catch (Exception e) {
request.setAttribute("errMsg", "用户名或密码错误");
return ">>:" + Globals.AppDomain + "/error/500.html";
return ">>:" + "https://zhgh.hrbnu.edu.cn/error/500.html";
}
}
@@ -164,8 +166,8 @@ public class SysWechatController {
System.out.println(state);
int errCount = NumberUtils.toInt(Strings.sNull(SecurityUtils.getSubject().getSession(true).getAttribute("platformErrCount")));
try {
String decrypt = weChatUtils.decrypt(state);
loginUtil.doLogin(token, request, session, LoginUtil.LoginOrigin.WEI_XIN, decrypt);
// String decrypt = weChatUtils.decrypt(state);
loginUtil.doLogin(token, request, session, LoginUtil.LoginOrigin.WEI_XIN, state);
return Result.success("login.success");
} catch (CaptchaIncorrectException e) {
return Result.error(1, "login.error.captcha");
@@ -86,7 +86,8 @@ public class HealthCheckupListController {
@Param(value = "unitId", required = false) String unitId,
@Param(value = "isChoose", required = false) Integer isChoose,
@Param(value = "threeUnitId", required = false) String threeUnitId,
@Param(value = "unionGroupId", required = false) String unionGroupId) {
@Param(value = "unionGroupId", required = false) String unionGroupId,
@Param(value = "isHomeGo", required = false) String isHomeGo) {
List<HealthCheckupUnionConfirm> confirms = dao.query(HealthCheckupUnionConfirm.class, Cnd.where("projectId", "=", projectId));
HealthCheckupProject project = healthCheckupProjectService.findOne(projectId);
@@ -113,15 +114,22 @@ public class HealthCheckupListController {
AND hcus.projectId = @projectId
$condition
""").setParam("projectId", projectId);
sql.setCondition(cnd);
cnd.andEX("hcu.projectId", "=", projectId);
cnd.andEX("hcu.unionId", "=", unionId);
cnd.andEX("hcu.unitId", "=", unitId);
cnd.andEX("hcu.unionGroupId", "=", unionGroupId);
cnd.andEX("hcu.threeUnitId", "=", threeUnitId);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.andEX("hcu.unionId", "=", Vi.getUnionId());
if (StrUtil.isNotBlank(isHomeGo)) {
cnd.and("hcu.userId", "=", ShiroUtil.getUserId());
} else {
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (!ShiroUtil.hasAnyRoles("H04,gh12")) {
cnd.and("hcu.userId", "=", ShiroUtil.getUserId());
} else {
cnd.and("hcu.unionId", "=", Vi.getUnionId());
}
}
}
switch (isChoose) {
@@ -138,6 +146,7 @@ public class HealthCheckupListController {
} else {
cnd.asc("hcu.sort").desc("hcus.selectTime");
}
sql.setCondition(cnd);
Pagination pagination = healthCheckupProjectService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
List<NutMap> paginationList = pagination.getList();
@@ -372,7 +381,7 @@ public class HealthCheckupListController {
cnd.and(seg);
}
cnd.groupBy("hcu.userId");
cnd.desc("hcus.selectTime").asc("hcu.unitId");
cnd.asc("hcu.sort").desc("hcus.selectTime").asc("hcu.unitId");
List<NutMap> resultList = healthCheckupProjectService.listMap(sql);
@@ -37,6 +37,7 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl<HealthCheckupP
uc.unionId AS id,
uc.unionName AS unionname,
uc.unionCode AS unioncode,
uc.isAudit,
SUM(IF(u.id is not null,1,0)) AS sumCount
FROM
health_checkup_union_confirm uc
@@ -180,7 +180,11 @@ public class mobileLoginController {
@Ok("re")
public String clearWxOpenId() {
try {
sysUserService.update(Chain.make("openId", null), Cnd.where("id", "=", ShiroUtil.getPrincipalProperty("id")));
Sys_user sourceUser = sysUserService.dao().fetch(Sys_user.class, Cnd.where("id", "=", ShiroUtil.getUserId()));
sysUserService.update(Chain.make("openId", null)
.add("password",PwdUtil.doSm4CbcEncrypt(sourceUser.getLoginname()))
.add("weAppLoginCount", 0),
Cnd.where("id", "=", ShiroUtil.getUserId()));
Subject subject = SecurityUtils.getSubject();
Sys_user user = (Sys_user) subject.getPrincipal();
subject.logout();
@@ -673,8 +673,8 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
SELECT
u.loginname,
u.username,
IF(staffUnion.id IS NOT NULL, staffUnion.id, vwl.welfareUnitId) AS unionid,
IF(staffUnion.id IS NOT NULL, staffUnion.unionname, gh.unionname) AS unionname,
vwl.welfareUnitId AS unionid,
gh.unionname AS unionname,
vwl.welfareSecondLevelUnitId as unitid,
dw.`name` as unitname,
wpus.userSign,
@@ -682,8 +682,6 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
wpus.selectNum
FROM
welfare_list vwl
LEFT JOIN special_staff staff ON staff.userId = vwl.userId
LEFT JOIN sys_union staffUnion ON staff.unionRelationUnionId = staffUnion.id
LEFT JOIN sys_user u ON u.id = vwl.userId
LEFT JOIN sys_union gh ON gh.id = vwl.welfareUnitId
LEFT JOIN sys_unit dw ON dw.id = vwl.welfareSecondLevelUnitId
@@ -691,7 +689,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
AND wpus.welfareId = @projectId
WHERE
projectId = @projectId
AND (vwl.welfareUnitId = @unionId OR staffUnion.id = @unionId)
AND vwl.welfareUnitId = @unionId
order by vwl.welfareUnitId,vwl.welfareSecondLevelUnitId
""");