diff --git a/src/main/java/io/v/nutz/base/utils/PwdUtil.java b/src/main/java/io/v/nutz/base/utils/PwdUtil.java index af402ac..d5acef0 100644 --- a/src/main/java/io/v/nutz/base/utils/PwdUtil.java +++ b/src/main/java/io/v/nutz/base/utils/PwdUtil.java @@ -126,14 +126,14 @@ public class PwdUtil { // System.out.println(dbPwd); // System.out.println(s); - String pwd = "006207"; + String pwd = "004512"; String dbPwd = PwdUtil.doSm4CbcEncrypt(pwd); System.out.println(dbPwd); // 7fdc9e096de7e2c18e4ed4efa16f50f8 // e43646c461a8ee364c569552225e28be -// String ddPwd = PwdUtil.doSm4CbcDecrypt("7fdc9e096de7e2c18e4ed4efa16f50f8"); +// String ddPwd = PwdUtil.doSm4CbcDecrypt("d3b42e17dba55dbe9bfa471c8ff191d9"); // System.out.println(ddPwd); } } diff --git a/src/main/java/io/v/nutz/zhgh/mobile/mobileLoginController.java b/src/main/java/io/v/nutz/zhgh/mobile/mobileLoginController.java index cf29d46..513f1e6 100644 --- a/src/main/java/io/v/nutz/zhgh/mobile/mobileLoginController.java +++ b/src/main/java/io/v/nutz/zhgh/mobile/mobileLoginController.java @@ -6,10 +6,12 @@ import io.v.nutz.base.utils.LoginUtil; import io.v.nutz.base.utils.PwdUtil; import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.services.SysUserService; +import io.v.nutz.web.commons.base.Globals; import io.v.nutz.web.commons.shiro.exception.CaptchaEmptyException; import io.v.nutz.web.commons.shiro.exception.CaptchaIncorrectException; import io.v.nutz.web.commons.shiro.filter.PlatformAuthenticationFilter; import io.v.nutz.web.commons.utils.ShiroUtil; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.math.NumberUtils; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.AuthenticationException; @@ -29,10 +31,13 @@ import org.nutz.mvc.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; @IocBean @At("/mobile/login") @Ok("json") +@Slf4j public class mobileLoginController { @Inject @@ -164,4 +169,31 @@ public class mobileLoginController { return Result.success(); } } + + + /** + * 解绑微信openId + * + * @return + */ + @At + @Ok("re") + public String clearWxOpenId() { + try { + sysUserService.update(Chain.make("openId", null), Cnd.where("id", "=", ShiroUtil.getPrincipalProperty("id"))); + Subject subject = SecurityUtils.getSubject(); + Sys_user user = (Sys_user) subject.getPrincipal(); + subject.logout(); + sysUserService.deleteCache(user.getId()); + return ">>:" + "https://zhgh.hrbnu.edu.cn/platform/wechat/oauth"; + } catch (SessionException ise) { + log.debug("Encountered session exception during logout. This can generally safely be ignored.", ise); + return ">>:" + "https://zhgh.hrbnu.edu.cn/platform/wechat/oauth"; + } catch (Exception e) { + log.debug("Logout error", e); + return ">>:" + "https://zhgh.hrbnu.edu.cn/platform/wechat/oauth"; + } + } + + } diff --git a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareCommonController.java b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareCommonController.java index 2d4bf71..2f77c16 100644 --- a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareCommonController.java +++ b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareCommonController.java @@ -584,9 +584,9 @@ public class WelfareCommonController { entityList.add(new ExcelExportEntity("所选福利", "gift_name", 20)); } - if (welfareProject.getProvideMode().equals(WelfareProvideMode.PERSONAL.getCode())) { - entityList.add(new ExcelExportEntity("配送地址", "receiveAddress", 60)); - } +// if (welfareProject.getProvideMode().equals(WelfareProvideMode.PERSONAL.getCode())) { + entityList.add(new ExcelExportEntity("取货地址", "receiveAddress", 60)); +// } try { ViTool.excelResponse(response, "会员福利领取情况.xls"); diff --git a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareListController.java b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareListController.java index 649334c..a2f9e0f 100644 --- a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareListController.java +++ b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareListController.java @@ -120,19 +120,16 @@ public class WelfareListController { wus.userSign, wus.courierNumber, GROUP_CONCAT( - DISTINCT - CONCAT( - wuso.optionName, - IF(wus.receiveAddress IS NOT NULL AND wus.receiveAddress != '', CONCAT('(', wus.receiveAddress, ')'), '') - ) - ) AS receiveAddress, + IF + ( wus.receiveAddress IS NOT NULL AND wus.receiveAddress != '', wus.receiveAddress, '' ) + ) AS receiveAddress, GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list FROM view_welfare_list wl - LEFT JOIN welfare_project_user_selection wus ON wus.welfareId = wl.projectId + LEFT JOIN welfare_project_user_selection wus ON wus.welfareId = wl.projectId AND wus.selectUserId = wl.id LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id - LEFT JOIN welfare_courier_number wcn on wcn.selectUserId = wl.id + LEFT JOIN welfare_courier_number wcn on wcn.selectUserId = wl.id LEFT JOIN welfare_project wp ON wp.id = wus.welfareId $condition """); diff --git a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java index 8916373..15e3094 100644 --- a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java +++ b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java @@ -24,6 +24,7 @@ import org.nutz.ioc.aop.Aop; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.json.Json; +import org.nutz.lang.Lang; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; @@ -32,6 +33,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.concurrent.locks.ReentrantLock; +import java.util.stream.Collectors; /** * @ClassName WelfareChooseController @@ -126,6 +128,12 @@ public class WelfareUserChooseController { selection.setReceiveAddress(receiveAddress); insertList.add(selection); }); + + List list = insertList.stream().filter(v -> v.getSelectNum() > 1).collect(Collectors.toList()); + if (Lang.isNotEmpty(list)) { + return Result.error(); + } + simpleService.dao().insert(insertList); simpleService.dao().update(WelfareList.class, Chain.make("isReceive", true), @@ -170,6 +178,9 @@ public class WelfareUserChooseController { for (WelfareUserSelection welfareUserSelection : welfareUserSelections) { welfareUserSelection.setSelectUserId(userId); welfareUserSelection.setSelectTime(new Date()); + if (welfareUserSelection.getSelectNum() > 1) { + return Result.error("福利选择限制超过最大限制"); + } } simpleService.dao().insert(welfareUserSelections); diff --git a/src/main/resources/static/assets/mobile/img/home/解除绑定.jpg b/src/main/resources/static/assets/mobile/img/home/解除绑定.jpg new file mode 100644 index 0000000..f814c8b Binary files /dev/null and b/src/main/resources/static/assets/mobile/img/home/解除绑定.jpg differ diff --git a/src/main/resources/views/mobile/home.html b/src/main/resources/views/mobile/home.html index 4ec718e..7334488 100644 --- a/src/main/resources/views/mobile/home.html +++ b/src/main/resources/views/mobile/home.html @@ -306,6 +306,10 @@ layout("/mobile/platform.html"){ 修改密码 +