From 0ce2a889c2d3900b11320b6b9ff51f9972915d74 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Thu, 23 May 2024 11:16:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95isChild=E5=AD=97=E6=AE=B5=20u?= =?UTF-8?q?serInfo=E6=94=AF=E4=BB=98=E5=AF=86=E7=A0=81=20=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CommonController.java | 1 - .../controller/LoginContoller.java | 4 +- .../controller/NotifyController.java | 6 ++- .../controller/UserContoller.java | 40 +++++++++---------- .../system/cashierservice/entity/SysDict.java | 2 +- .../cashierservice/entity/TbUserInfo.java | 14 ------- .../cashierservice/entity/vo/HomeUpVO.java | 1 - .../entity/vo/OrderConfirmVo.java | 6 +-- .../entity/vo/ProductInfoVo.java | 4 +- .../service/HomeDistrictService.java | 6 ++- .../service/HomePageService.java | 3 +- .../cashierservice/service/LoginService.java | 2 +- .../service/ProductService.java | 4 +- .../resources/mapper/TbUserInfoMapper.xml | 2 +- 14 files changed, 43 insertions(+), 52 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/CommonController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/CommonController.java index eaf0c2b..0002982 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/CommonController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/CommonController.java @@ -1,6 +1,5 @@ package com.chaozhanggui.system.cashierservice.controller; -import com.alibaba.fastjson.TypeReference; import com.chaozhanggui.system.cashierservice.dao.TbPlatformDictMapper; import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict; import com.chaozhanggui.system.cashierservice.entity.vo.DistrictVo; diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java index aed4f14..4307bd4 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java @@ -329,8 +329,8 @@ public class LoginContoller { String mdPasswordString = MD5Utils.MD5Encode(authUserDto.getPassword(), "utf-8"); return loginService.appLogin(authUserDto.getUsername(), mdPasswordString); } else { - tf = true; -// tf = loginService.validate(authUserDto.getCode(), authUserDto.getUsername()); +// tf = true; + tf = loginService.validate(authUserDto.getCode(), authUserDto.getUsername()); if (tf) { return loginService.appLogin(authUserDto.getUsername(), null); } else { diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java index 96f5749..52970dc 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java @@ -136,12 +136,14 @@ public class NotifyController { } - private Map getParameterMap(HttpServletRequest request) { + private Map getParameterMap(HttpServletRequest request) { RequestWrapper requestWrapper = new RequestWrapper(request); String body = requestWrapper.getBody(); if (ObjectUtil.isNotEmpty(body)) { return JSONUtil.toBean(body, Map.class); + }else { + Map parameterMap = request.getParameterMap(); + return parameterMap; } - return null; } } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/UserContoller.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/UserContoller.java index 98aa3a7..d9ff82d 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/UserContoller.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/UserContoller.java @@ -55,26 +55,26 @@ public class UserContoller { @Autowired private TbUserInfoMapper userInfoMapper; - @GetMapping("/userInfo") - public JSONObject userInfo(@RequestParam("openId") String openId ) throws Exception { - TbUserInfo shopUser = userInfoMapper.selectByOpenId(openId); - JSONObject jsonObject = new JSONObject(); - if (Objects.isNull(shopUser)){ - jsonObject.put("status","fail"); - jsonObject.put("msg","用户不存在"); - return jsonObject; - } - String userSign = UUID.randomUUID().toString().replaceAll("-",""); - String token = TokenUtil.generateJfToken(openId,userSign); - JSONObject object = new JSONObject(); - object.put("token",token); - object.put("userSign",userSign); - object.put("num",shopUser.getTotalScore()); - jsonObject.put("status","success"); - jsonObject.put("msg","成功"); - jsonObject.put("data",object); - return jsonObject; - } +// @GetMapping("/userInfo") +// public JSONObject userInfo(@RequestParam("openId") String openId ) throws Exception { +// TbUserInfo shopUser = userInfoMapper.selectByOpenId(openId); +// JSONObject jsonObject = new JSONObject(); +// if (Objects.isNull(shopUser)){ +// jsonObject.put("status","fail"); +// jsonObject.put("msg","用户不存在"); +// return jsonObject; +// } +// String userSign = UUID.randomUUID().toString().replaceAll("-",""); +// String token = TokenUtil.generateJfToken(openId,userSign); +// JSONObject object = new JSONObject(); +// object.put("token",token); +// object.put("userSign",userSign); +// object.put("num",shopUser.getTotalScore()); +// jsonObject.put("status","success"); +// jsonObject.put("msg","成功"); +// jsonObject.put("data",object); +// return jsonObject; +// } @GetMapping("/shopUserInfo") public Result shopUserInfo(@RequestParam("userId") String userId ,@RequestParam("shopId") String shopId ) throws Exception { TbShopUser shopUser = shopUserMapper.selectByUserIdAndShopId(userId,shopId); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDict.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDict.java index a4498b9..cb25ae5 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDict.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDict.java @@ -19,7 +19,7 @@ public class SysDict implements Serializable { /** * 是否有子类0否1是 */ - private Integer isChild; + private Object isChild; /** * 值 diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbUserInfo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbUserInfo.java index bf905f9..6111e6a 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbUserInfo.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbUserInfo.java @@ -97,25 +97,11 @@ public class TbUserInfo implements Serializable { private String avatar = ""; - private String phone=""; - - private String isPwd; private String pwd; - - - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - public String getAvatar() { return avatar; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeUpVO.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeUpVO.java index 6984234..ef2272d 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeUpVO.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeUpVO.java @@ -1,7 +1,6 @@ package com.chaozhanggui.system.cashierservice.entity.vo; import com.chaozhanggui.system.cashierservice.entity.SysDict; -import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict; import java.util.List; diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/OrderConfirmVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/OrderConfirmVo.java index a518199..e3e96c4 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/OrderConfirmVo.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/OrderConfirmVo.java @@ -1,6 +1,7 @@ package com.chaozhanggui.system.cashierservice.entity.vo; import lombok.Data; + import java.math.BigDecimal; @Data @@ -19,12 +20,12 @@ public class OrderConfirmVo { * 可用时间说明 * 周一至周日 */ - private String avaTime; + private String avaTime = "周一至周日"; /** * 商品描述 * 随时退·过期自动退·到店 */ - private String proDetail="随时退·过期自动退·到店"; + private String proDetail = "随时退·过期自动退·到店"; /** * 商品原价/划线价 */ @@ -46,5 +47,4 @@ public class OrderConfirmVo { private TagVo couponDetail; - } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductInfoVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductInfoVo.java index efcfe7e..b1ef659 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductInfoVo.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductInfoVo.java @@ -65,7 +65,7 @@ public class ProductInfoVo { /** * 营业时间 */ - private String businessTime; + private String businessTime = "全天营业"; /** * 距离 */ @@ -86,5 +86,5 @@ public class ProductInfoVo { /** * 购买须知/价格说明 */ - private TbPurchaseNotice purchaseNotice=new TbPurchaseNotice(); + private TbPurchaseNotice purchaseNotice = new TbPurchaseNotice(); } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/HomeDistrictService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/HomeDistrictService.java index db7e26a..cadd4b4 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/HomeDistrictService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/HomeDistrictService.java @@ -62,9 +62,10 @@ public class HomeDistrictService { } List sysDicts = sysDictMapper.selectByType(null); for (SysDict sysDict : sysDicts) { - if (sysDict.getIsChild()==1) { + if (sysDict.getIsChild().equals("1")) { sysDict.setDetail(sysDictMapper.selectByDictId(sysDict.getDictId())); } + sysDict.setIsChild((sysDict.getIsChild() == null || sysDict.getIsChild().equals("0")) ? false : true); } result.setMenu(sysDicts); } @@ -84,9 +85,10 @@ public class HomeDistrictService { result.setTitle("热榜推荐"); List sysDicts = sysDictMapper.selectHot(); for (SysDict sysDict : sysDicts) { - if (sysDict.getIsChild()==1) { + if (sysDict.getIsChild().equals("1")) { sysDict.setDetail(sysDictMapper.selectByDictId(sysDict.getDictId())); } + sysDict.setIsChild((sysDict.getIsChild() == null || sysDict.getIsChild().equals("0")) ? false : true); } result.setMenu(sysDicts); } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/HomePageService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/HomePageService.java index 6202fc0..b62359e 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/HomePageService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/HomePageService.java @@ -56,9 +56,10 @@ public class HomePageService { //菜单 List sysDicts = sysDictMapper.selectByType("home"); for (SysDict sysDict : sysDicts) { - if (sysDict.getIsChild()==1) { + if (sysDict.getIsChild().equals("1")) { sysDict.setDetail(sysDictMapper.selectByDictId(sysDict.getDictId())); } + sysDict.setIsChild((sysDict.getIsChild() == null || sysDict.getIsChild().equals("0")) ? false : true); } homeUpVO.setMenu(sysDicts); /** diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/LoginService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/LoginService.java index 3c14fd4..95948e5 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/LoginService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/LoginService.java @@ -284,7 +284,7 @@ public class LoginService { } TbUserInfo userInfo=tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId)); - boolean flag= validate(map.get("code").toString(), userInfo.getPhone()); + boolean flag= validate(map.get("code").toString(), userInfo.getTelephone()); if(!flag){ return Result.fail("验证码错误"); } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java index 18b51f9..55ece29 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java @@ -330,7 +330,9 @@ public class ProductService { productInfo.setPhone(tbShopInfo.getPhone()); productInfo.setLat(tbShopInfo.getLat()); productInfo.setLng(tbShopInfo.getLng()); - productInfo.setBusinessTime(tbShopInfo.getBusinessStartDay() + "至" + tbShopInfo.getBusinessEndDay() + " " + tbShopInfo.getBusinessTime()); + if(StringUtils.isNotBlank(tbShopInfo.getBusinessStartDay())){ + productInfo.setBusinessTime(tbShopInfo.getBusinessStartDay() + "至" + tbShopInfo.getBusinessEndDay() + " " + tbShopInfo.getBusinessTime()); + } String distance = LocationUtils.getDistanceString( Double.parseDouble(lng), Double.parseDouble(lat), Double.parseDouble(tbShopInfo.getLng()), Double.parseDouble(tbShopInfo.getLat())); diff --git a/src/main/resources/mapper/TbUserInfoMapper.xml b/src/main/resources/mapper/TbUserInfoMapper.xml index 983e3a1..3f10beb 100644 --- a/src/main/resources/mapper/TbUserInfoMapper.xml +++ b/src/main/resources/mapper/TbUserInfoMapper.xml @@ -577,7 +577,7 @@ bind_parent_at = #{bindParentAt,jdbcType=BIGINT}, grand_parent_id = #{grandParentId,jdbcType=VARCHAR}, password = #{password,jdbcType=VARCHAR}, - is_pwd=${isPwd,jdbcType=VARCHAR}, + is_pwd=#{isPwd,jdbcType=VARCHAR}, pwd=#{pwd,jdbcType=VARCHAR} where id = #{id,jdbcType=INTEGER}