diff --git a/src/main/java/io/v/nutz/zhgh/mobile/welfare/MWelfareController.java b/src/main/java/io/v/nutz/zhgh/mobile/welfare/MWelfareController.java index 95b5d16..1872a0a 100644 --- a/src/main/java/io/v/nutz/zhgh/mobile/welfare/MWelfareController.java +++ b/src/main/java/io/v/nutz/zhgh/mobile/welfare/MWelfareController.java @@ -191,10 +191,13 @@ public class MWelfareController { */ @At public Result validateUserIntegral(String projectId, String totalIntegral) { - BigDecimal totalIntegralBig = new BigDecimal(totalIntegral); if (StrUtil.isBlank(projectId)) { return Result.error("数据错误!"); } + if (StrUtil.isBlank(totalIntegral)) { + return Result.error("请选择后在提交!"); + } + BigDecimal totalIntegralBig = new BigDecimal(totalIntegral); WelfareList welfareList = dao.fetch(WelfareList.class, Cnd.where("projectId", "=", projectId).and("userId", "=", ShiroUtil.getPrincipalProperty("id"))); if (welfareList == null) { return Result.error("您暂无此福利!"); 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 2f77c16..686d4f7 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 @@ -631,6 +631,9 @@ public class WelfareCommonController { //需要去查询最新的物流信息 String receiveAddress = userSelection.getReceiveAddress(); + if (StrUtil.isBlank(receiveAddress) || receiveAddress.length() < 11) { + continue; + } String mobile = receiveAddress.substring(receiveAddress.length() - 11); JSONObject jsonObject = expressSelectUtil.getExpressInfo(courierNumber.getCourierNumber(), mobile); diff --git a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareMineController.java b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareMineController.java index a5484e0..e4f26f1 100644 --- a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareMineController.java +++ b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareMineController.java @@ -195,6 +195,9 @@ public class WelfareMineController { } } String receiveAddress = userSelection.getReceiveAddress(); + if (StrUtil.isBlank(receiveAddress) || receiveAddress.length() < 11) { + return Result.error("收货信息为空,无法查询物流信息"); + } String mobile = receiveAddress.substring(receiveAddress.length() - 11); JSONObject jsonObject = expressSelectUtil.getExpressInfo(courierNumber, mobile); 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 4dcb2f0..acb6cc0 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 @@ -186,7 +186,10 @@ public class WelfareUserChooseController { } //如果是积分模式 - if (project.getIsIntegralMode()) { + if (Boolean.TRUE.equals(project.getIsIntegralMode())) { + if (StrUtil.isBlank(totalIntegral)) { + return Result.error("请选择后在提交!"); + } BigDecimal totalIntegralBig = new BigDecimal(totalIntegral); totalIntegralBig = totalIntegralBig.divide(BigDecimal.valueOf(100)); if (totalIntegralBig.compareTo(BigDecimal.ZERO) == 0) { @@ -209,7 +212,10 @@ public class WelfareUserChooseController { for (WelfareUserSelection welfareUserSelection : welfareUserSelections) { welfareUserSelection.setSelectUserId(userId); welfareUserSelection.setSelectTime(new Date()); - if (welfareUserSelection.getSelectNum() > 1 && !project.getIsIntegralMode()) { + if (StrUtil.isBlank(welfareUserSelection.getReceiveAddress())) { + welfareUserSelection.setReceiveAddress(""); + } + if (welfareUserSelection.getSelectNum() > 1 && !Boolean.TRUE.equals(project.getIsIntegralMode())) { return Result.error("福利选择限制超过最大限制"); } } diff --git a/src/main/resources/views/mobile/welfare/list/receive.html b/src/main/resources/views/mobile/welfare/list/receive.html index 184e138..3fc2077 100644 --- a/src/main/resources/views/mobile/welfare/list/receive.html +++ b/src/main/resources/views/mobile/welfare/list/receive.html @@ -348,9 +348,12 @@ layout("/mobile/platform.html"){ + + @@ -676,13 +679,9 @@ layout("/mobile/platform.html"){ return } - const notReceiveAddress = [] const formData = this.projectInfo.welfareProjectSubjects[0].options .filter((v) => v.selectNum >= 1) .map((v) => { - if (v.shoppingId && !v.receiveAddress) { - notReceiveAddress.push(v.optionName) - } return { welfareId: this.projectId, subjectId: v.subjectId, @@ -692,14 +691,11 @@ layout("/mobile/platform.html"){ selectNum: v.selectNum } }) - if (notReceiveAddress.length > 0) { - this.$modal.msg("请选择取货门店:" + notReceiveAddress.join(",")) - return - } const {code, msg, data} = await $.post("/platform/welfare/userChoose/confirmSelect", { welfareUserSelections: JSON.stringify(formData), projectId: this.projectId, - mobile: this.mobile + mobile: this.mobile, + totalIntegral: this.totalIntegral }) if (code === 0) { this.getUserSelection(this.projectId)