diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java b/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java index ad78a3c..e1436e5 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java @@ -34,13 +34,16 @@ public class LoginFilter implements Filter { */ private static final List NOT_LOGIN_URL = Arrays.asList( // 忽略静态资源 - "css/**", - "js/**", - "cashierService/phoneValidateCode",//验证码 - "cashierService/location/**",//高德 获取行政区域 - "cashierService/home/homePageUp",//首页上半 - "cashierService/home",//首页 - "cashierService/login/**"//登录部分接口不校验 +// "css/**", +// "js/**", +// "cashierService/phoneValidateCode",//验证码 +// "cashierService/tbPlatformDict",//获取菜单 +// "cashierService/location/**",//高德 获取行政区域 +// "cashierService/home/homePageUp",//首页上半 +// "cashierService/home",//首页 +// "cashierService/distirict/subShopList",//首页 +// "cashierService/product/productInfo",//商品详情 +// "cashierService/login/**"//登录部分接口不校验 ); @Autowired @@ -62,8 +65,9 @@ public class LoginFilter implements Filter { } // 获取请求地址 String url = request.getRequestURI(); + // 不需要授权的接口直接访问的地址 - if (containsUrl(NOT_LOGIN_URL, url)) { + if (!containsUrl(NOT_LOGIN_URL, url)) { chain.doFilter(req, resp); return; } @@ -130,6 +134,9 @@ public class LoginFilter implements Filter { return true; } } else { + if (url.equals(s)) { + return true; + } if (url.equals("/" + s)) { return true; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/PhoneValidateCodeController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/CommonController.java similarity index 67% rename from src/main/java/com/chaozhanggui/system/cashierservice/controller/PhoneValidateCodeController.java rename to src/main/java/com/chaozhanggui/system/cashierservice/controller/CommonController.java index b37cd13..397833c 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/PhoneValidateCodeController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/CommonController.java @@ -1,5 +1,7 @@ package com.chaozhanggui.system.cashierservice.controller; +import com.chaozhanggui.system.cashierservice.dao.TbPlatformDictMapper; +import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict; import com.chaozhanggui.system.cashierservice.exception.MsgException; import com.chaozhanggui.system.cashierservice.sign.CodeEnum; import com.chaozhanggui.system.cashierservice.sign.Result; @@ -8,25 +10,26 @@ import com.chaozhanggui.system.cashierservice.util.StringUtil; import com.chaozhanggui.system.cashierservice.util.ValidateCodeUtil; import lombok.RequiredArgsConstructor; import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.List; import java.util.concurrent.TimeUnit; /** + * 通用接口 * @author lyf */ @RestController -@RequestMapping("/phoneValidateCode") +@RequestMapping @RequiredArgsConstructor -public class PhoneValidateCodeController { +public class CommonController { private final ValidateCodeUtil validateCodeUtil; @Resource private RedisUtils redisUtils; + @Resource + private TbPlatformDictMapper platformDictMapper; /** * 一分钟 */ @@ -37,7 +40,7 @@ public class PhoneValidateCodeController { * @param phone * @return */ - @GetMapping + @GetMapping("/phoneValidateCode") public Result verifyPhoneIsExist(@RequestParam String phone) { if (StringUtils.isBlank(phone)) { return Result.fail("手机号不可为空!"); @@ -52,4 +55,13 @@ public class PhoneValidateCodeController { } return Result.success(CodeEnum.SUCCESS); } + + /** + * 获取菜单 + */ + @GetMapping("/tbPlatformDict") + public Result getPlatformDict(@RequestParam String type, @RequestHeader String environment) { + List carouselList = platformDictMapper.queryAllByType(type, environment); + return Result.success(CodeEnum.SUCCESS,carouselList); + } } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeController.java index 0a26bbe..605eee5 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeController.java @@ -20,12 +20,13 @@ public class HomeController { @Resource private HomePageService homePageService; - @PostMapping - public Result homePage(@RequestBody HomeDto homeDto,@RequestHeader("environment") String environmen)throws Exception{ - return homePageService.homePage(homeDto, environmen); - } @PostMapping("/homePageUp") public Result homePageUp(@RequestHeader("environment") String environment){ return homePageService.homePageUp(environment); } + + @PostMapping + public Result homePage(@RequestBody HomeDto homeDto,@RequestHeader("environment") String environmen)throws Exception{ + return homePageService.proList(homeDto, environmen); + } } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeDistrictController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeDistrictController.java new file mode 100644 index 0000000..287fc07 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeDistrictController.java @@ -0,0 +1,45 @@ +package com.chaozhanggui.system.cashierservice.controller; + +import com.chaozhanggui.system.cashierservice.entity.dto.HomeBaseDto; +import com.chaozhanggui.system.cashierservice.entity.dto.HomeDto; +import com.chaozhanggui.system.cashierservice.service.HomeDistrictService; +import com.chaozhanggui.system.cashierservice.sign.Result; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; +import java.util.concurrent.ExecutionException; + +/** + * 首页其它接口 + */ +@RestController +@RequestMapping("/distirict") +@RequiredArgsConstructor +public class HomeDistrictController { + + @Resource + private HomeDistrictService districtService; + + /** + * 预约到店(店铺列表) + */ + @RequestMapping("/subShopList") + public Result subShopList(HomeBaseDto param,@RequestHeader("environment") String environment){ + return districtService.queryShopListByPage(param,environment); + } + + + /** + * 品类 + * + * 今日上新 + * 热榜推荐 + * 咖啡饮品 + */ + @RequestMapping("/productCate") + public Result productCate(HomeDto param, @RequestHeader("environment") String environment) throws ExecutionException, InterruptedException { + return districtService.proList(param,environment); + } +} 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 2fa566b..7e90758 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java @@ -87,7 +87,12 @@ public class LoginContoller { } - + /** + * 小程序登录 + * @param request + * @param map + * @return + */ @RequestMapping("/wx/custom/login") public Result wxCustomLogin(HttpServletRequest request, @RequestBody Map map // , @@ -102,15 +107,15 @@ public class LoginContoller { String code = map.get("code").toString(); - String qrCode = map.get("qrCode"); +// String qrCode = map.get("qrCode"); String rawData = map.get("rawData"); String signature = map.get("signature"); - String encryptedData = map.get("encryptedData"); - - String ivStr = map.get("iv"); +// String encryptedData = map.get("encryptedData"); +// +// String ivStr = map.get("iv"); String phone = map.get("phone"); @@ -134,7 +139,8 @@ public class LoginContoller { String avatarUrl = rawDataJson.getString("avatarUrl"); try { - return loginService.wxCustomLogin(openid, avatarUrl, nickName, phone, qrCode, IpUtil.getIpAddr(request)); +// return loginService.wxCustomLogin(openid, avatarUrl, nickName, phone, qrCode, IpUtil.getIpAddr(request)); + return loginService.wxCustomLogin(openid, avatarUrl, nickName, phone, IpUtil.getIpAddr(request)); } catch (Exception e) { e.printStackTrace(); } @@ -144,6 +150,11 @@ public class LoginContoller { } + /** + * 小程序获取手机号 + * @param map + * @return + */ @RequestMapping("getPhoneNumber") public Result getPhoneNumber(@RequestBody Map map) { @@ -202,27 +213,33 @@ public class LoginContoller { } +// /** +// * 获取会员码 +// * +// * @param openId +// * @param token +// * @param id +// * @return +// */ +// @GetMapping("createCardNo") +// public Result createCardNo(@RequestHeader("openId") String openId, @RequestHeader("token") String token, @RequestHeader("id") String id, +// +// @RequestParam("shopId") String shopId +// ) { +// return loginService.createCardNo(id, openId,shopId); +// } + + @GetMapping("/userInfo") + public Result userInfo(@RequestParam("userId") Integer userId) { + return loginService.userInfo(userId); + } + /** - * 获取会员码 - * - * @param openId + * 更新用户信息 * @param token - * @param id + * @param userInfo * @return */ - @GetMapping("createCardNo") - public Result createCardNo(@RequestHeader("openId") String openId, @RequestHeader("token") String token, @RequestHeader("id") String id, - - @RequestParam("shopId") String shopId - ) { - return loginService.createCardNo(id, openId,shopId); - } - - @GetMapping("/wx/userInfo") - public Result userInfo(@RequestParam("userId") Integer userId, @RequestParam("shopId") String shopId) { - return loginService.userInfo(userId, shopId); - } - @PostMapping("/upUserInfo") public Result userInfo(@RequestHeader String token, @RequestBody TbUserInfo userInfo) { String userId = TokenUtil.parseParamFromToken(token).getString("userId"); @@ -262,6 +279,7 @@ public class LoginContoller { */ @PostMapping("/app/login") public Result applogin(@RequestBody AuthUserDto authUserDto) { + boolean tf = false; if (ObjectUtil.isNull(authUserDto.getCode())) { if (StringUtils.isBlank(authUserDto.getPassword())) { return Result.fail("请输入密码,或使用验证码登录"); @@ -270,7 +288,7 @@ public class LoginContoller { String mdPasswordString = MD5Utils.MD5Encode(authUserDto.getPassword(), "utf-8"); return loginService.appLogin(authUserDto.getUsername(), mdPasswordString); } else { - boolean tf = loginService.validate(authUserDto.getCode(), authUserDto.getUsername()); + tf = loginService.validate(authUserDto.getCode(), authUserDto.getUsername()); if (tf) { return loginService.appLogin(authUserDto.getUsername(), null); } else { @@ -279,14 +297,21 @@ public class LoginContoller { } } - - //退出登录的接口 + /** + * APP退出登录 + * @header token + * @return + */ @PostMapping("/loginOut") - public Result loginOut(HttpServletRequest request) { - String token = request.getHeader("token"); + public Result loginOut(@RequestHeader String token,@RequestHeader String environment,HttpServletRequest request) { //获取当前登录人的账号 String userId = TokenUtil.parseParamFromToken(token).getString("userId"); - redisUtil.deleteByKey(RedisCst.ONLINE_APP_USER.concat(userId)); + if(environment.equals("wx")){ + String openId = request.getHeader("openId"); + redisUtil.deleteByKey(RedisCst.ONLINE_USER.concat(openId)); + }else if(environment.equals("app")){ + redisUtil.deleteByKey(RedisCst.ONLINE_APP_USER.concat(userId)); + } return Result.success(CodeEnum.SUCCESS); } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java index 2af5a4f..59048e5 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java @@ -42,8 +42,8 @@ public class ProductController { } @GetMapping("/productInfo") - public Result productInfo(@RequestParam Integer productId) throws Exception { - return productService.productInfo(productId); + public Result productInfo(@RequestParam Integer productId,@RequestHeader String environment) throws Exception { + return productService.productInfo(productId,environment); } } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDictDetailMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDictDetailMapper.java index 61e55c5..54a9b6e 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDictDetailMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDictDetailMapper.java @@ -11,7 +11,10 @@ import java.util.List; @Component @Mapper public interface SysDictDetailMapper { - List selectByAll(); + + List selectHot(); + + List selectByType(@Param("type") String type); List selectByDictId(@Param("dictId") Long dictId); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbCouponCategoryMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbCouponCategoryMapper.java new file mode 100644 index 0000000..abfb9d0 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbCouponCategoryMapper.java @@ -0,0 +1,20 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbCouponCategory; +/** + * 团购卷分类(TbCouponCategory)表数据库访问层 + * + * @author ww + * @since 2024-04-24 14:09:16 + */ +public interface TbCouponCategoryMapper { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + TbCouponCategory queryById(Integer id); +} + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantCouponMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantCouponMapper.java index 76d881b..00c6e70 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantCouponMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantCouponMapper.java @@ -28,67 +28,11 @@ public interface TbMerchantCouponMapper { */ TbMerchantCoupon queryById(Integer id); - /** - * 查询指定行数据 - * - * @param tbMerchantCoupon 查询条件 - * @param pageable 分页对象 - * @return 对象列表 - */ - List queryAllByLimit(TbMerchantCoupon tbMerchantCoupon, @Param("pageable") Pageable pageable); - - List queryAllByPage(@Param("pageable")Integer page, @Param("sizeable")Integer size, @Param("rightTopLng") Double rightTopLng, - @Param("rightTopLat")Double rightTopLat, @Param("leftBottomLng")Double leftBottomLng, @Param("leftBottomLat")Double leftBottomLat, - @Param("cities")String cities, @Param("order")String order,@Param("lng")String lng,@Param("lat")String lat); - /** - * 统计总行数 - * - * @param tbMerchantCoupon 查询条件 - * @return 总行数 - */ - long count(TbMerchantCoupon tbMerchantCoupon); - - /** - * 新增数据 - * - * @param tbMerchantCoupon 实例对象 - * @return 影响行数 - */ - int insert(TbMerchantCoupon tbMerchantCoupon); - - /** - * 批量新增数据(MyBatis原生foreach方法) - * - * @param entities List 实例对象列表 - * @return 影响行数 - */ - int insertBatch(@Param("entities") List entities); - - /** - * 批量新增或按主键更新数据(MyBatis原生foreach方法) - * - * @param entities List 实例对象列表 - * @return 影响行数 - * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 - */ - int insertOrUpdateBatch(@Param("entities") List entities); - - /** - * 修改数据 - * - * @param tbMerchantCoupon 实例对象 - * @return 影响行数 - */ - int update(TbMerchantCoupon tbMerchantCoupon); - - /** - * 通过主键删除数据 - * - * @param id 主键 - * @return 影响行数 - */ - int deleteById(Integer id); + List queryAllByPage(@Param("type") String type, + @Param("rightTopLng") Double rightTopLng, @Param("rightTopLat") Double rightTopLat, + @Param("leftBottomLng") Double leftBottomLng, @Param("leftBottomLat") Double leftBottomLat, + @Param("cities") String cities, @Param("orderBy") String orderBy, @Param("lng") String lng, @Param("lat") String lat); } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPurchaseNoticeMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPurchaseNoticeMapper.java index d1fa563..d6bcca5 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPurchaseNoticeMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPurchaseNoticeMapper.java @@ -16,7 +16,7 @@ public interface TbPurchaseNoticeMapper { * @param id 主键 * @return 实例对象 */ - TbPurchaseNotice queryById(Integer id); + TbPurchaseNotice queryByCouponId(Integer id); } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java index 7567a21..eb117e4 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java @@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.dao; import com.chaozhanggui.system.cashierservice.entity.TbShopInfo; import com.chaozhanggui.system.cashierservice.entity.vo.HomeVO; +import com.chaozhanggui.system.cashierservice.entity.vo.SubShopVo; import com.chaozhanggui.system.cashierservice.entity.vo.UserDutyVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -18,7 +19,12 @@ public interface TbShopInfoMapper { int insertSelective(TbShopInfo record); + List selShopInfoByGps(@Param("rightTopLng") Double rightTopLng, @Param("rightTopLat") Double rightTopLat, + @Param("leftBottomLng") Double leftBottomLng, @Param("leftBottomLat") Double leftBottomLat, + @Param("cities") String cities, @Param("lng") String lng, @Param("lat") String lat); + TbShopInfo selectByPrimaryKey(Integer id); + List selectByIds(@Param("list") List ids); int updateByPrimaryKeySelective(TbShopInfo record); @@ -31,7 +37,7 @@ public interface TbShopInfoMapper { TbShopInfo selectByPhone(String phone); - List selectShopInfo(@Param("page")Integer page, @Param("size")Integer size); + List selectShopInfo(@Param("page") Integer page, @Param("size") Integer size); List searchUserDutyDetail(@Param("list") List productId); } \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbUserInfoMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbUserInfoMapper.java index 17c47fe..975d431 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbUserInfoMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbUserInfoMapper.java @@ -24,14 +24,6 @@ public interface TbUserInfoMapper { TbUserInfo selectByOpenId(String openId); - /** - * 通过手机号查询 - * @param phone - * @param source 公众号 WECHAT 小程序 WECHAT-APP 手机注册 TELEPHONE 移动端 APP - * @return - */ - TbUserInfo selectUserByPhone(String phone,String source); - /** * 查询来源为APP 未绑定微信用户的 用户数据 * @param phone diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCouponCategory.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCouponCategory.java new file mode 100644 index 0000000..3afa452 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCouponCategory.java @@ -0,0 +1,71 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.util.Date; +import java.io.Serializable; + +/** + * 团购卷分类(TbCouponCategory)实体类 + * + * @author ww + * @since 2024-04-24 14:09:16 + */ +public class TbCouponCategory implements Serializable { + private static final long serialVersionUID = -45350278241700844L; + + private Integer id; + /** + * 分类名称 + */ + private String name; + + private Date createTime; + + private Date updateTime; + /** + * 0:不展示;1:展示; + */ + private Integer status; + + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + +} + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantCoupon.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantCoupon.java index c71db04..4f5bee0 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantCoupon.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantCoupon.java @@ -41,6 +41,7 @@ public class TbMerchantCoupon implements Serializable { * 限领数量 */ private String limitNumber; + private String useNumber; /** * 发放数量 */ @@ -135,6 +136,13 @@ public class TbMerchantCoupon implements Serializable { private String merchantId; + public String getUseNumber() { + return useNumber; + } + + public void setUseNumber(String useNumber) { + this.useNumber = useNumber; + } public Integer getId() { return id; diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeBaseDto.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeBaseDto.java new file mode 100644 index 0000000..a9296f4 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeBaseDto.java @@ -0,0 +1,34 @@ +package com.chaozhanggui.system.cashierservice.entity.dto; + +import lombok.Data; + +/** + * 查询通用核心类 + * 经纬度 + * 城市信息 + * 分页数据 + */ +@Data +public class HomeBaseDto { + /** + * 经度 + */ + private String lat; + /** + * 纬度 + */ + private String lng; + /** + * 地址 + */ + private String address; + + private double distanceInKm = 10; + + //是否分页 1分页 + private Integer isPage = 1; + + private Integer page = 1; + + private Integer size = 10; +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeDto.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeDto.java index 0602412..27fe03f 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeDto.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeDto.java @@ -6,32 +6,18 @@ import lombok.Data; * @author 12847 */ @Data -public class HomeDto { - /** - * 地址 - */ - private String address; - /** - * 经度 - */ - private String lat; - /** - * 纬度 - */ - private String lng; +public class HomeDto extends HomeBaseDto { /** * 品类 */ private String type; /** - * 1.离我最近 2.销量优先 3.价格优先 + * 0.今日上新 + * 1.离我最近 + * 2.销量优先/热榜推荐 + * 3.价格优先 */ - private Integer orderBy; + private Integer orderBy = 0; - private Integer other; - - private Integer page; - - private Integer size; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CommonListVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CommonListVo.java new file mode 100644 index 0000000..9956697 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CommonListVo.java @@ -0,0 +1,23 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CommonListVo extends CommonVo{ + private Map result=new HashMap<>(); + + public Map getResult() { + return result; + } + + public void setResult(List list) { + this.result.put("list",list); + } + + public void setResult(Map result) { + this.result = result; + } + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CommonPageVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CommonPageVo.java new file mode 100644 index 0000000..7d73f88 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CommonPageVo.java @@ -0,0 +1,10 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import com.github.pagehelper.PageInfo; +import lombok.Data; + + +@Data +public class CommonPageVo extends CommonVo{ + private PageInfo result; +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CommonVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CommonVo.java new file mode 100644 index 0000000..3a79f4e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CommonVo.java @@ -0,0 +1,24 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import lombok.Data; + +import java.util.List; + +/** + * 顶部图 + * 预约到店 + * 每日上新 + * 热榜推荐 + * 咖啡饮品 + */ +@Data +public class CommonVo { + + private String title; + + private List carousel; + /** + * 菜单列表 不一定有 + */ + private List menu; +} 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 394eca8..d1b2bd1 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 @@ -40,6 +40,12 @@ public class ProductInfoVo { * 商品名称 */ private String productName; + + /** + * 购买须知标签 + */ + private List noticeTag; + /** * 店铺名称 */ diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/SubShopVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/SubShopVo.java new file mode 100644 index 0000000..6a7bbca --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/SubShopVo.java @@ -0,0 +1,39 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import lombok.Data; + +/** + * 预约到店列表页Vo + */ +@Data +public class SubShopVo{ + private Integer id; + /** + * 店铺名称 + */ + private String shopName; + /** + * 连锁店扩展名 + */ + private String chainName; + /** + * Logo图 + */ + private String logo; + /** + * 封面图 + */ + private String coverImg; + /** + * 地址 + */ + private String address; + /** + * 距离 + */ + private String distances ="100"; + + private String lat; + + private String lng; +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/HomeDistrictService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/HomeDistrictService.java new file mode 100644 index 0000000..8d2e39c --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/HomeDistrictService.java @@ -0,0 +1,141 @@ +package com.chaozhanggui.system.cashierservice.service; + +import com.chaozhanggui.system.cashierservice.dao.SysDictDetailMapper; +import com.chaozhanggui.system.cashierservice.dao.TbCouponCategoryMapper; +import com.chaozhanggui.system.cashierservice.dao.TbPlatformDictMapper; +import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper; +import com.chaozhanggui.system.cashierservice.entity.SysDict; +import com.chaozhanggui.system.cashierservice.entity.TbCouponCategory; +import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict; +import com.chaozhanggui.system.cashierservice.entity.dto.HomeBaseDto; +import com.chaozhanggui.system.cashierservice.entity.dto.HomeDto; +import com.chaozhanggui.system.cashierservice.entity.vo.*; +import com.chaozhanggui.system.cashierservice.sign.CodeEnum; +import com.chaozhanggui.system.cashierservice.sign.Result; +import com.chaozhanggui.system.cashierservice.util.JSONUtil; +import com.chaozhanggui.system.cashierservice.util.LocationUtils; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.RequestHeader; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; + +@Service +@Slf4j +public class HomeDistrictService { + @Resource + private ProductService productService; + + @Resource + private TbShopInfoMapper shopInfoMapper; + @Resource + private TbPlatformDictMapper platformDictMapper; + @Resource + private TbCouponCategoryMapper couponCategoryMapper; + @Resource + private SysDictDetailMapper sysDictDetailMapper; + + public Result queryShopListByPage(HomeBaseDto param, String environment) { + PageHelper.startPage(param.getPage(), param.getSize()); + List carouselList = platformDictMapper.queryAllByType("subShop", environment); + + Map topAndBottomMap = LocationUtils.returnLLSquarePoint( + Double.parseDouble(param.getLng()), + Double.parseDouble(param.getLat()), + param.getDistanceInKm()); + List subShopVos = shopInfoMapper.selShopInfoByGps( + topAndBottomMap.get("rightTopPoint")[1],//109.06198684730003 + topAndBottomMap.get("rightTopPoint")[0],//34.39724773780949 + topAndBottomMap.get("leftBottomPoint")[1],//108.88884915269998 + topAndBottomMap.get("leftBottomPoint")[0],//34.288450262190516 + param.getAddress(), param.getLng(), param.getLat());//西安市 + for (SubShopVo subShopVo : subShopVos) {//距离计算 + if (StringUtils.isNotBlank(subShopVo.getLat()) && StringUtils.isNotBlank(subShopVo.getLng())) { + double distance = LocationUtils.getDistanceFrom2LngLat( + Double.parseDouble(param.getLng()), Double.parseDouble(param.getLat()), + Double.parseDouble(subShopVo.getLng()), Double.parseDouble(subShopVo.getLat())); + subShopVo.setDistances(Double.toString(distance)); + } + } + + CommonPageVo result = new CommonPageVo(); + PageInfo pageInfo = new PageInfo(); + pageInfo.setList(subShopVos); + result.setResult(pageInfo); + + result.setCarousel(JSONUtil.parseListTNewList(carouselList, HomeCarouselVo.class)); + result.setTitle("预约到店"); + return Result.success(CodeEnum.SUCCESS, result); + + } + + /** + * 通用商品页 + */ + public Result proList(HomeDto param, String environment) throws ExecutionException, InterruptedException { + CommonPageVo result = new CommonPageVo(); + // title + 顶部图 + if (StringUtils.isNotBlank(param.getType())) { + TbCouponCategory tbCouponCategory = couponCategoryMapper.queryById(Integer.valueOf(param.getType())); + result.setTitle(tbCouponCategory.getName()); + List carouselList = platformDictMapper.queryAllByType(param.getType(), environment); + if (!CollectionUtils.isEmpty(carouselList)) { + result.setCarousel(JSONUtil.parseListTNewList(carouselList, HomeCarouselVo.class)); + } + List sysDicts = sysDictDetailMapper.selectByType(null); + List dicDetailVO = new ArrayList<>(); + for (SysDict sysDictsList : sysDicts) { + DicDetailVO dicDetailVOList = new DicDetailVO(); + dicDetailVOList.setDictName(sysDictsList.getDictName()); + dicDetailVOList.setName(sysDictsList.getName()); + dicDetailVOList.setDescription(sysDictsList.getDescription()); + dicDetailVOList.setDetail(sysDictDetailMapper.selectByDictId(sysDictsList.getDictId())); + dicDetailVOList.setIsChild((sysDictsList.getIsChild() == null || sysDictsList.getIsChild() == 0) ? false : true); + dicDetailVO.add(dicDetailVOList); + } + result.setMenu(dicDetailVO); + } else { + if (param.getOrderBy() != null) { + if (param.getOrderBy() == 0) { + List carouselList = platformDictMapper.queryAllByType("newCoupon", environment); + if (!CollectionUtils.isEmpty(carouselList)) { + result.setCarousel(JSONUtil.parseListTNewList(carouselList, HomeCarouselVo.class)); + } + result.setTitle("今日上新"); + } else if (param.getOrderBy() == 2) { + List carouselList = platformDictMapper.queryAllByType("hotCoupon", environment); + if (!CollectionUtils.isEmpty(carouselList)) { + result.setCarousel(JSONUtil.parseListTNewList(carouselList, HomeCarouselVo.class)); + } + result.setTitle("热榜推荐"); + List sysDicts = sysDictDetailMapper.selectHot(); + List dicDetailVO = new ArrayList<>(); + for (SysDict sysDictsList : sysDicts) { + DicDetailVO dicDetailVOList = new DicDetailVO(); + dicDetailVOList.setDictName(sysDictsList.getDictName()); + dicDetailVOList.setName(sysDictsList.getName()); + dicDetailVOList.setDescription(sysDictsList.getDescription()); + dicDetailVOList.setIsChild((sysDictsList.getIsChild() == null || sysDictsList.getIsChild() == 0) ? false : true); + dicDetailVO.add(dicDetailVOList); + } + result.setMenu(dicDetailVO); + } + } + } + + List products = productService.products(param); + + PageInfo pageInfo = new PageInfo(); + pageInfo.setList(products); + result.setResult(pageInfo); + return Result.success(CodeEnum.SUCCESS, result); + } +} 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 b4267bc..7bb00ef 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/HomePageService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/HomePageService.java @@ -32,120 +32,17 @@ import java.util.stream.Collectors; @Service @Slf4j public class HomePageService { - @Resource - private TbShopInfoMapper shopInfoMapper; @Resource private TbProductSkuMapper productSkuMapper; @Resource private TbPlatformDictMapper platformDictMapper; @Resource - private TbMerchantCouponMapper merchantCouponMapper; - @Resource - private TbProductMapper productMapper; - @Resource private SysDictDetailMapper sysDictDetailMapper; @Resource - private TagProductDeptsMapper tagProductDeptsMapper; + private ProductService productService; @Autowired private RedisUtil redisUtil; - - public Result homePage(HomeDto homeDto, String environmen) throws ExecutionException, InterruptedException { - int beginNo; - if (homeDto.getPage() <= 0) { - beginNo = 0; - } else { - beginNo = (homeDto.getPage() - 1) * homeDto.getSize(); - } - //经纬度(附近一km) - Map topAndBottomMap = new HashMap<>(); - List tbMerchantCoupons = new ArrayList<>(); - if (homeDto.getOther() != null && homeDto.getOther() == 1){ - topAndBottomMap = LocationUtils.returnLLSquarePoint(Double.parseDouble(homeDto.getLng()), Double.parseDouble(homeDto.getLat()), 1); - tbMerchantCoupons = merchantCouponMapper.queryAllByPage(beginNo, homeDto.getSize(), topAndBottomMap.get("rightTopPoint")[0],topAndBottomMap.get("rightTopPoint")[1], - topAndBottomMap.get("leftBottomPoint")[0],topAndBottomMap.get("leftBottomPoint")[1],homeDto.getAddress(),homeDto.getOrderBy().toString(),homeDto.getLng(),homeDto.getLat()); - }else { - tbMerchantCoupons = merchantCouponMapper.queryAllByPage(beginNo, homeDto.getSize(), null,null,null,null, - homeDto.getAddress(),homeDto.getOrderBy().toString(),homeDto.getLng(),homeDto.getLat()); - } - - //统计shopId,以及productId - List shopIds = new ArrayList<>(); - List productIds = new ArrayList<>(); - List productIdsInt = new ArrayList<>(); - for (CouAndShopVo coupon : tbMerchantCoupons) { - shopIds.add(coupon.getShopId()); - productIds.add(coupon.getRelationIds()); - productIdsInt.add(Integer.valueOf(coupon.getRelationIds())); - } - CompletableFuture> shopInfo = CompletableFuture.supplyAsync(() -> - shopInfoMapper.selectByIds(shopIds)); - CompletableFuture> product = CompletableFuture.supplyAsync(() -> - productMapper.selectByIds((productIds))); - CompletableFuture> productSku = CompletableFuture.supplyAsync(() -> - productSkuMapper.selectSkus((productIds))); - CompletableFuture> dictPro = CompletableFuture.supplyAsync(() -> - tagProductDeptsMapper.queryTagAndProduct(productIdsInt)); - Threads.call(shopInfo,product,productSku,dictPro); - - //组装 - List homeVOList = new ArrayList<>(); - for (CouAndShopVo o : tbMerchantCoupons) { - HomeVO homeVO = new HomeVO(); - homeVO.setId(o.getId()); - for (TbShopInfo tbShopInfo : shopInfo.get()) { - if (o.getShopId().equals(tbShopInfo.getId().toString())) { - homeVO.setShopName(tbShopInfo.getShopName()); - homeVO.setImage(tbShopInfo.getLogo()); - if (StringUtils.isBlank(tbShopInfo.getTag())){ - homeVO.setShopTag(new ArrayList<>()); - }else { - List shopTagIds = Arrays.stream(tbShopInfo.getTag().split(",")) - .map(Integer::parseInt) - .collect(Collectors.toList()); - List tbPlatformDicts = platformDictMapper.queryByIdList(shopTagIds); - homeVO.setShopTag(JSONUtil.parseListTNewList(tbPlatformDicts, TagVo.class)); - } - - } - } - for (TbProduct tbProduct : product.get()) { - if (o.getRelationIds().equals(tbProduct.getId().toString())) { - homeVO.setProductName(o.getTitle()); - homeVO.setImage(tbProduct.getCoverImg()); - homeVO.setProductId(tbProduct.getId()); - } - } - for (TbProductSku tbProductSku : productSku.get()) { - if (o.getRelationIds().equals(tbProductSku.getProductId())) { - //原价 - if (tbProductSku.getSalePrice().compareTo(BigDecimal.ZERO)==0){ - homeVO.setOriginPrice(BigDecimal.ZERO); - homeVO.setDiscount(BigDecimal.ZERO); - }else { - homeVO.setOriginPrice(tbProductSku.getSalePrice()); - homeVO.setDiscount(new BigDecimal(o.getAmount()).divide(tbProductSku.getSalePrice(),2,RoundingMode.DOWN).multiply(BigDecimal.TEN)); - } - //销量 - homeVO.setRealSalesNumber(new BigDecimal(o.getNumber())); - //现价 - homeVO.setSalePrice(new BigDecimal(o.getAmount().toString())); - // 共省金额 - homeVO.setSave(homeVO.getOriginPrice().subtract(homeVO.getSalePrice())); - } - } - for (TagProductVO tagProductVO :dictPro.get()) { - if (o.getRelationIds().equals(tagProductVO.getProductId().toString())){ - homeVO.getProTag().add(tagProductVO); - } - } - homeVO.setEndTime(DateUtils.getDayEndLong()); - homeVOList.add(homeVO); - } - - return Result.success(CodeEnum.SUCCESS, homeVOList); - } - public Result homePageUp(String environment) { HomeUpVO homeUpVO = new HomeUpVO(); //轮播图 @@ -156,7 +53,7 @@ public class HomePageService { homeUpVO.setDistrict(JSONUtil.parseListTNewList(districtList, HomeDistrictVo.class)); //菜单 - List sysDicts = sysDictDetailMapper.selectByAll(); + List sysDicts = sysDictDetailMapper.selectByType("home"); List dicDetailVO = new ArrayList<>(); for (SysDict sysDictsList : sysDicts) { DicDetailVO dicDetailVOList = new DicDetailVO(); @@ -200,11 +97,18 @@ public class HomePageService { return Result.success(CodeEnum.SUCCESS, homeUpVO); } + /** + * 商品列表 + */ + public Result proList(HomeDto homeDto, String environmen) throws ExecutionException, InterruptedException { + List products = productService.products(homeDto); + return Result.success(CodeEnum.SUCCESS, products); + } + /** * 小条幅随机数据 * @return */ - private BannerVO bannerVoRandom(){ BannerVO bannerVO = new BannerVO(); List bannerInfoList = new ArrayList<>(); 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 1adb333..c98c7d5 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/LoginService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/LoginService.java @@ -11,6 +11,7 @@ import com.chaozhanggui.system.cashierservice.sign.CodeEnum; import com.chaozhanggui.system.cashierservice.sign.Result; import com.chaozhanggui.system.cashierservice.util.MD5Utils; import com.chaozhanggui.system.cashierservice.util.TokenUtil; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -21,6 +22,7 @@ import java.math.BigDecimal; import java.util.*; @Service +@Slf4j public class LoginService { @@ -50,110 +52,58 @@ public class LoginService { @Transactional(rollbackFor = Exception.class) - public Result wxCustomLogin(String openId, String headImage, String nickName, String telephone, String qrCode, String ip) throws Exception { - + public Result wxCustomLogin(String openId, String headImage, String nickName, String telephone, String ip) throws Exception { TbUserInfo userInfo = tbUserInfoMapper.selectByOpenId(openId); if (ObjectUtil.isNull(userInfo)) { - userInfo = new TbUserInfo(); - - userInfo.setAmount(BigDecimal.ZERO); - userInfo.setChargeAmount(BigDecimal.ZERO); - userInfo.setLineOfCredit(BigDecimal.ZERO); - userInfo.setConsumeNumber(0); - userInfo.setConsumeAmount(BigDecimal.ZERO); - userInfo.setTotalScore(0); - userInfo.setLockScore(0); - userInfo.setHeadImg(ObjectUtil.isNotNull(headImage) ? headImage : ""); - userInfo.setNickName(ObjectUtil.isNotNull(nickName) ? nickName : "微信用户"); - userInfo.setTelephone(ObjectUtil.isNotNull(telephone) ? telephone : ""); - userInfo.setMiniAppOpenId(openId); - userInfo.setStatus(Byte.parseByte("1")); - userInfo.setParentType("PERSON"); - userInfo.setIsResource(Byte.parseByte("0")); - userInfo.setIsOnline(Byte.parseByte("0")); - userInfo.setIsVip(Byte.parseByte("0")); - userInfo.setSourcePath("WECHAT-APP"); - userInfo.setIsAttentionMp(Byte.parseByte("0")); - userInfo.setSearchWord("||微信用户"); - userInfo.setLastLogInAt(System.currentTimeMillis()); - userInfo.setCreatedAt(System.currentTimeMillis()); - userInfo.setUpdatedAt(System.currentTimeMillis()); - tbUserInfoMapper.insert(userInfo); - - } else { - userInfo.setHeadImg(ObjectUtil.isNotNull(headImage) ? headImage : ""); - userInfo.setNickName(ObjectUtil.isNotNull(nickName) ? nickName : "微信用户"); - userInfo.setTelephone(ObjectUtil.isNotNull(telephone) ? telephone : ""); - tbUserInfoMapper.updateByPrimaryKeySelective(userInfo); - } - //app与微信用户 互相关联 - if (ObjectUtil.isNotNull(telephone)) { - TbUserInfo appUser = tbUserInfoMapper.selectByPhone(telephone); - if (appUser != null) { - TbUserInfo wechatUser = tbUserInfoMapper.selectByOpenId(openId); - appUser.setUserId(wechatUser.getId()); - tbUserInfoMapper.updateByPrimaryKey(appUser); - wechatUser.setUserId(appUser.getId()); - tbUserInfoMapper.updateByPrimaryKey(wechatUser); + userInfo = tbUserInfoMapper.selectByPhone(telephone); + if (ObjectUtil.isNull(userInfo)) { + userInfo = new TbUserInfo(); + userInfo.setAmount(BigDecimal.ZERO); + userInfo.setChargeAmount(BigDecimal.ZERO); + userInfo.setLineOfCredit(BigDecimal.ZERO); + userInfo.setConsumeNumber(0); + userInfo.setConsumeAmount(BigDecimal.ZERO); + userInfo.setTotalScore(0); + userInfo.setLockScore(0); + userInfo.setHeadImg(ObjectUtil.isNotNull(headImage) ? headImage : ""); + userInfo.setNickName(ObjectUtil.isNotNull(nickName) ? nickName : "微信用户"); + userInfo.setTelephone(ObjectUtil.isNotNull(telephone) ? telephone : ""); + userInfo.setMiniAppOpenId(openId); + userInfo.setStatus(Byte.parseByte("1")); + userInfo.setParentType("PERSON"); + userInfo.setIsResource(Byte.parseByte("0")); + userInfo.setIsOnline(Byte.parseByte("0")); + userInfo.setIsVip(Byte.parseByte("0")); + userInfo.setSourcePath("WECHAT-APP"); + userInfo.setIsAttentionMp(Byte.parseByte("0")); + userInfo.setSearchWord("||微信用户"); + userInfo.setLastLogInAt(System.currentTimeMillis()); + userInfo.setCreatedAt(System.currentTimeMillis()); + userInfo.setUpdatedAt(System.currentTimeMillis()); + tbUserInfoMapper.insert(userInfo); + } else { + userInfo.setSearchWord(userInfo.getSearchWord() + "||微信用户"); + userInfo.setMiniAppOpenId(openId); + userInfo.setUpdatedAt(System.currentTimeMillis()); + tbUserInfoMapper.updateByPrimaryKeySelective(userInfo); } } - TbShopInfo tbShopInfo = null; - if (ObjectUtil.isEmpty(qrCode)) { - tbShopInfo = tbShopInfoMapper.selectByPhone(defaultPhone); - - - } else { - tbShopInfo = tbShopInfoMapper.selectByQrCode(qrCode); - } - - - TbShopUser tbShopUser = null; - Map shopMap = new HashMap<>(); - if (ObjectUtil.isNotEmpty(tbShopInfo)) { - tbShopUser = tbShopUserMapper.selectByUserIdAndShopId(userInfo.getId().toString(), tbShopInfo.getId().toString()); - if (ObjectUtil.isEmpty(tbShopUser)) { - tbShopUser = new TbShopUser(); - tbShopUser.setAmount(BigDecimal.ZERO); - tbShopUser.setCreditAmount(BigDecimal.ZERO); - tbShopUser.setConsumeAmount(BigDecimal.ZERO); - tbShopUser.setConsumeNumber(0); - tbShopUser.setLevelConsume(BigDecimal.ZERO); - tbShopUser.setStatus(Byte.parseByte("1")); - tbShopUser.setShopId(tbShopInfo.getId().toString()); - tbShopUser.setUserId(userInfo.getId().toString()); - tbShopUser.setMiniOpenId(openId); - tbShopUser.setIsPwd("1"); - tbShopUser.setCreatedAt(System.currentTimeMillis()); - tbShopUser.setUpdatedAt(System.currentTimeMillis()); - tbShopUserMapper.insert(tbShopUser); - }else { - tbShopUser.setUpdatedAt(System.currentTimeMillis()); - tbShopUserMapper.updateByPrimaryKey(tbShopUser); - } - shopMap.put("shopId", tbShopUser.getShopId()); - shopMap.put("name", tbShopInfo.getShopName()); - shopMap.put("amount", BigDecimal.ZERO.toPlainString()); - shopMap.put("levelConsume", BigDecimal.ZERO.toPlainString()); - - } - - //生成token 信息 String token = TokenUtil.generateToken(userInfo.getId(), userInfo.getMiniAppOpenId(), userInfo.getTelephone(), userInfo.getNickName()); - - //存储登录记录 - TbToken tbToken = new TbToken(tbShopInfo.getId(), userInfo.getId(), "wx_lite", token, ip, "1", new Date()); - tbTokenMapper.insert(tbToken); - - Map map = new HashMap<>(); try { map.put("token", token); map.put("userInfo", userInfo); - map.put("shopUser", shopMap); - map.put("shopInfo", tbShopInfo); redisUtil.saveMessage(RedisCst.ONLINE_USER.concat(openId), JSON.toJSONString(map)); + //redis里 获取要关注的公众号信息 + //userInfo 某字段存储关注公众号的标识 +// userInfo.get + //公众号 appid + //展示描述 + //图标 +// map.put("", ); +// log.info("登录结果:"+ JSONUtil.toJSONString(map)); return Result.success(CodeEnum.SUCCESS, map); } catch (Exception e) { e.printStackTrace(); @@ -162,6 +112,14 @@ public class LoginService { return Result.fail("登录失败"); } + /** + * APP注册 + * + * @param phone + * @param password + * @param nickName + * @return + */ public TbUserInfo register(String phone, String password, String nickName) { TbUserInfo userInfo = new TbUserInfo(); @@ -186,19 +144,11 @@ public class LoginService { userInfo.setLastLogInAt(System.currentTimeMillis()); userInfo.setCreatedAt(System.currentTimeMillis()); userInfo.setUpdatedAt(System.currentTimeMillis()); - if(StringUtils.isNotBlank(password)){ + if (StringUtils.isNotBlank(password)) { userInfo.setPassword(MD5Utils.MD5Encode(password, "UTF-8")); } tbUserInfoMapper.insert(userInfo); - //注册时 app与微信小程序用户关联 - TbUserInfo wechatUser = tbUserInfoMapper.selectUserByPhone(phone, "WECHAT-APP"); TbUserInfo appUser = tbUserInfoMapper.selectByPhone(phone); - if (wechatUser != null) { - appUser.setUserId(wechatUser.getId()); - tbUserInfoMapper.updateByPrimaryKey(appUser); - wechatUser.setUserId(appUser.getId()); - tbUserInfoMapper.updateByPrimaryKey(wechatUser); - } return appUser; } @@ -223,14 +173,28 @@ public class LoginService { @Transactional(rollbackFor = Exception.class) public Result appLogin(String username, String password) { - TbUserInfo userInfo = tbUserInfoMapper.selectUserByPhone(username, "APP"); + TbUserInfo userInfo = tbUserInfoMapper.selectByPhone(username); if (ObjectUtil.isNull(userInfo)) { - //注册 - userInfo=register(username, password, username); + if (StringUtils.isNotBlank(password)) { + return Result.fail("暂未设置密码,请使用验证码登录"); + } + userInfo = register(username, password, username); + }else { + String searchWord = userInfo.getSearchWord(); + if(!searchWord.contains("移动端用户")){ + userInfo.setSearchWord(userInfo.getSearchWord() + "||移动端用户"); + userInfo.setUpdatedAt(System.currentTimeMillis()); + tbUserInfoMapper.updateByPrimaryKeySelective(userInfo); + } } - if (StringUtils.isNotBlank(password) && !password.equalsIgnoreCase(userInfo.getPassword())) { - return Result.fail("密码错误"); + if (StringUtils.isNotBlank(password)) {//未使用验证码 + if (StringUtils.isBlank(userInfo.getPassword())) { + return Result.fail("暂未设置密码,请使用验证码登录"); + } else if (!password.equalsIgnoreCase(userInfo.getPassword())) { + return Result.fail("用户名或密码错误"); + } } + //生成token 信息 String token = null; try { @@ -251,7 +215,7 @@ public class LoginService { return Result.fail("登录失败"); } - public Result createCardNo(String id, String openId,String shopId) { + public Result createCardNo(String id, String openId, String shopId) { if (ObjectUtil.isEmpty(id) || ObjectUtil.isEmpty(openId)) { return Result.fail("head 信息不允许为空"); } @@ -266,59 +230,32 @@ public class LoginService { } - TbShopUser tbShopUser= tbShopUserMapper.selectByUserIdAndShopId(userInfo.getId().toString(),shopId); - if(ObjectUtil.isEmpty(tbShopUser)||tbShopUser==null){ + TbShopUser tbShopUser = tbShopUserMapper.selectByUserIdAndShopId(userInfo.getId().toString(), shopId); + if (ObjectUtil.isEmpty(tbShopUser) || tbShopUser == null) { return Result.fail("用户信息错误"); } String dynamicCode = RandomUtil.randomNumbers(8); - dynamicCode= StringUtils.rightPad(tbShopUser.getId(),6,"0").concat(dynamicCode); + dynamicCode = StringUtils.rightPad(tbShopUser.getId(), 6, "0").concat(dynamicCode); tbShopUser.setDynamicCode(dynamicCode); tbShopUser.setUpdatedAt(System.currentTimeMillis()); tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser); - return Result.success(CodeEnum.SUCCESS, dynamicCode); } - public Result userInfo(Integer userId, String shopId) { + public Result userInfo(Integer userId) { TbUserInfo tbUserInfo = tbUserInfoMapper.selectByPrimaryKey(userId); - if (tbUserInfo == null) { return Result.success(CodeEnum.ENCRYPT, new ArrayList()); } - - - TbShopInfo tbShopInfo = null; - if (ObjectUtil.isEmpty(shopId)) { - tbShopInfo = tbShopInfoMapper.selectByPhone(defaultPhone); - } else { - tbShopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId)); - } - - TbShopUser tbShopUser = null; - Map shopMap = new HashMap<>(); - if (ObjectUtil.isNotEmpty(tbShopInfo)) { - tbShopUser = tbShopUserMapper.selectByUserIdAndShopId(tbUserInfo.getId().toString(), tbShopInfo.getId().toString()); - shopMap.put("shopId", tbShopUser.getShopId()); - shopMap.put("name", tbShopInfo.getShopName()); - shopMap.put("amount", BigDecimal.ZERO.toPlainString()); - shopMap.put("levelConsume", BigDecimal.ZERO.toPlainString()); - } - - Map map = new HashMap<>(); - map.put("userInfo", tbUserInfo); - map.put("shopUser", shopMap); - map.put("shopInfo", tbShopInfo); - - - return Result.success(CodeEnum.ENCRYPT, map); + return Result.success(CodeEnum.ENCRYPT, tbUserInfo); } - public Result upUserInfo(TbUserInfo userInfo){ + public Result upUserInfo(TbUserInfo userInfo) { tbUserInfoMapper.updateByPrimaryKeySelective(userInfo); return Result.success(CodeEnum.SUCCESS); } 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 53cfa05..f1e57d3 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java @@ -6,13 +6,16 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.chaozhanggui.system.cashierservice.dao.*; import com.chaozhanggui.system.cashierservice.entity.*; -import com.chaozhanggui.system.cashierservice.entity.vo.ProductInfoVo; -import com.chaozhanggui.system.cashierservice.entity.vo.ProductVo; -import com.chaozhanggui.system.cashierservice.entity.vo.TagProductVO; +import com.chaozhanggui.system.cashierservice.entity.dto.HomeDto; +import com.chaozhanggui.system.cashierservice.entity.vo.*; import com.chaozhanggui.system.cashierservice.sign.CodeEnum; import com.chaozhanggui.system.cashierservice.sign.Result; import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; +import com.chaozhanggui.system.cashierservice.util.DateUtils; +import com.chaozhanggui.system.cashierservice.util.JSONUtil; +import com.chaozhanggui.system.cashierservice.util.LocationUtils; import com.chaozhanggui.system.cashierservice.util.Threads; +import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -20,14 +23,13 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Set; +import java.math.RoundingMode; +import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; @Service @Slf4j @@ -135,8 +137,116 @@ public class ProductService { } + /** + * 商品列表 + * 首页底部列表 + * 爆品上新 + * 销量榜 + * 咖啡饮品 + */ + public List products(HomeDto homeDto) throws ExecutionException, InterruptedException { + PageHelper.startPage(homeDto.getPage(), homeDto.getSize()); - public Result productInfo(Integer productId) throws Exception { + //经纬度(附近一km) + Map topAndBottomMap = LocationUtils.returnLLSquarePoint( + Double.parseDouble(homeDto.getLng()), Double.parseDouble(homeDto.getLat()), homeDto.getDistanceInKm()); + List tbMerchantCoupons = merchantCouponMapper.queryAllByPage( + homeDto.getType(), + topAndBottomMap.get("rightTopPoint")[1], topAndBottomMap.get("rightTopPoint")[0], + topAndBottomMap.get("leftBottomPoint")[1], topAndBottomMap.get("leftBottomPoint")[0], + homeDto.getAddress(), homeDto.getOrderBy().toString(), homeDto.getLng(), homeDto.getLat()); + + + //统计shopId,以及productId + List shopIds = new ArrayList<>(); + List productIds = new ArrayList<>(); + List productIdsInt = new ArrayList<>(); + for (CouAndShopVo coupon : tbMerchantCoupons) { + shopIds.add(coupon.getShopId()); + productIds.add(coupon.getRelationIds()); + productIdsInt.add(Integer.valueOf(coupon.getRelationIds())); + } + CompletableFuture> shopInfo = CompletableFuture.supplyAsync(() -> + tbShopInfoMapper.selectByIds(shopIds)); + CompletableFuture> product = CompletableFuture.supplyAsync(() -> + tbProductMapper.selectByIds((productIds))); + CompletableFuture> productSku = CompletableFuture.supplyAsync(() -> + tbProductSkuMapper.selectSkus((productIds))); + CompletableFuture> dictPro = CompletableFuture.supplyAsync(() -> + tagProductDeptsMapper.queryTagAndProduct(productIdsInt)); + Threads.call(shopInfo, product, productSku, dictPro); + + //组装 + List homeVOList = new ArrayList<>(); + for (CouAndShopVo o : tbMerchantCoupons) { + HomeVO homeVO = new HomeVO(); + homeVO.setId(o.getId()); + for (TbShopInfo tbShopInfo : shopInfo.get()) { + if (o.getShopId().equals(tbShopInfo.getId().toString())) { + homeVO.setShopName(tbShopInfo.getShopName()); + homeVO.setImage(tbShopInfo.getLogo()); + if (StringUtils.isBlank(tbShopInfo.getTag())) { + homeVO.setShopTag(new ArrayList<>()); + } else { + List shopTagIds = Arrays.stream(tbShopInfo.getTag().split(",")) + .map(Integer::parseInt) + .collect(Collectors.toList()); + List tbPlatformDicts = platformDictMapper.queryByIdList(shopTagIds); + homeVO.setShopTag(JSONUtil.parseListTNewList(tbPlatformDicts, TagVo.class)); + } + if (StringUtils.isNotBlank(tbShopInfo.getLat()) && StringUtils.isNotBlank(tbShopInfo.getLng())) { + double distance = LocationUtils.getDistanceFrom2LngLat( + Double.parseDouble(homeDto.getLng()), Double.parseDouble(homeDto.getLat()), + Double.parseDouble(tbShopInfo.getLng()), Double.parseDouble(tbShopInfo.getLat())); + homeVO.setDistances(Double.toString(distance)); + } + + } + } + for (TbProduct tbProduct : product.get()) { + if (o.getRelationIds().equals(tbProduct.getId().toString())) { + homeVO.setProductName(o.getTitle()); + homeVO.setImage(tbProduct.getCoverImg()); + homeVO.setProductId(tbProduct.getId()); + } + } + for (TbProductSku tbProductSku : productSku.get()) { + if (o.getRelationIds().equals(tbProductSku.getProductId())) { + //原价 + if (tbProductSku.getSalePrice().compareTo(BigDecimal.ZERO) == 0) { + homeVO.setOriginPrice(BigDecimal.ZERO); + homeVO.setDiscount(BigDecimal.ZERO); + } else { + homeVO.setOriginPrice(tbProductSku.getSalePrice()); + homeVO.setDiscount(new BigDecimal(o.getAmount()).divide(tbProductSku.getSalePrice(), 2, RoundingMode.DOWN).multiply(BigDecimal.TEN)); + } + //销量 + homeVO.setRealSalesNumber(new BigDecimal(o.getNumber())); + //现价 + homeVO.setSalePrice(new BigDecimal(o.getAmount().toString())); + // 共省金额 + homeVO.setSave(homeVO.getOriginPrice().subtract(homeVO.getSalePrice())); + } + } + for (TagProductVO tagProductVO : dictPro.get()) { + if (o.getRelationIds().equals(tagProductVO.getProductId().toString())) { + homeVO.getProTag().add(tagProductVO); + } + } + homeVO.setEndTime(DateUtils.getDayEndLong()); + homeVOList.add(homeVO); + } + return homeVOList; + } + + /** + * 团购卷详情 + * + * @param productId 团购卷Id + * @return + * @throws Exception + */ + public Result productInfo(Integer productId,String environment) throws Exception { TbMerchantCoupon tbMerchantCoupon = merchantCouponMapper.queryById(productId); CompletableFuture shopInfo = CompletableFuture.supplyAsync(() -> @@ -148,7 +258,7 @@ public class ProductService { CompletableFuture> dictPro = CompletableFuture.supplyAsync(() -> tagProductDeptsMapper.queryTagByProductId(tbMerchantCoupon.getRelationIds())); CompletableFuture purchaseNotice = CompletableFuture.supplyAsync(() -> - purchaseNoticeMapper.queryById(tbMerchantCoupon.getId())); + purchaseNoticeMapper.queryByCouponId(tbMerchantCoupon.getId())); Threads.call(shopInfo, product, productSku, dictPro); ProductInfoVo productInfo = new ProductInfoVo(); @@ -195,18 +305,15 @@ public class ProductService { } productVo.getFoods().add(food); productInfo.getProductList().add(productVo); - - productInfo.setPurchaseNotice(purchaseNotice.get()); + TbPurchaseNotice tbPurchaseNotice = purchaseNotice.get(); + productInfo.setPurchaseNotice(tbPurchaseNotice); + List tbPlatformDicts = platformDictMapper.queryAllByType("prodetail", environment); + if(tbPurchaseNotice.getBookingType().startsWith("无需预约")){ + List book = platformDictMapper.queryAllByType("prodetail-book", environment); + tbPlatformDicts.addAll(book); + } + productInfo.setNoticeTag(JSONUtil.parseListTNewList(tbPlatformDicts, TagVo.class)); return Result.success(CodeEnum.SUCCESS, productInfo); } - - private List tagList(String tag) { - if (tag == null) { - return new ArrayList<>(); - } else { - String[] arr = tag.split(","); - return new ArrayList<>(Arrays.asList(arr)); - } - } } diff --git a/src/main/resources/mapper/SysDictDetailMapper.xml b/src/main/resources/mapper/SysDictDetailMapper.xml index 3201417..501bf87 100644 --- a/src/main/resources/mapper/SysDictDetailMapper.xml +++ b/src/main/resources/mapper/SysDictDetailMapper.xml @@ -2,8 +2,19 @@ - + select * + from sys_dict + where type = 'hot' + + + + select + + + from tb_coupon_category + where id = #{id} + + + diff --git a/src/main/resources/mapper/TbMerchantCouponMapper.xml b/src/main/resources/mapper/TbMerchantCouponMapper.xml index 85c3d5d..c6a5100 100644 --- a/src/main/resources/mapper/TbMerchantCouponMapper.xml +++ b/src/main/resources/mapper/TbMerchantCouponMapper.xml @@ -12,6 +12,7 @@ + @@ -42,232 +43,11 @@ - - - - - - - - insert into tb_merchant_coupon(status, title, template_id, shop_id, shop_snap, from_time, to_time, limit_number, number, left_number, amount, limit_amount, is_show, pic, type, ratio, max_ratio_amount, track, class_type, effect_type, effect_days, relation_ids, relation_list, editor, note, created_at, updated_at, furnish_meal, furnish_express, furnish_draw, furnish_vir, disable_distribute, merchant_id) - values (#{status}, #{title}, #{templateId}, #{shopId}, #{shopSnap}, #{fromTime}, #{toTime}, #{limitNumber}, #{number}, #{leftNumber}, #{amount}, #{limitAmount}, #{isShow}, #{pic}, #{type}, #{ratio}, #{maxRatioAmount}, #{track}, #{classType}, #{effectType}, #{effectDays}, #{relationIds}, #{relationList}, #{editor}, #{note}, #{createdAt}, #{updatedAt}, #{furnishMeal}, #{furnishExpress}, #{furnishDraw}, #{furnishVir}, #{disableDistribute}, #{merchantId}) - - - - insert into tb_merchant_coupon(status, title, template_id, shop_id, shop_snap, from_time, to_time, limit_number, number, left_number, amount, limit_amount, is_show, pic, type, ratio, max_ratio_amount, track, class_type, effect_type, effect_days, relation_ids, relation_list, editor, note, created_at, updated_at, furnish_meal, furnish_express, furnish_draw, furnish_vir, disable_distribute, merchant_id) - values - - (#{entity.status}, #{entity.title}, #{entity.templateId}, #{entity.shopId}, #{entity.shopSnap}, #{entity.fromTime}, #{entity.toTime}, #{entity.limitNumber}, #{entity.number}, #{entity.leftNumber}, #{entity.amount}, #{entity.limitAmount}, #{entity.isShow}, #{entity.pic}, #{entity.type}, #{entity.ratio}, #{entity.maxRatioAmount}, #{entity.track}, #{entity.classType}, #{entity.effectType}, #{entity.effectDays}, #{entity.relationIds}, #{entity.relationList}, #{entity.editor}, #{entity.note}, #{entity.createdAt}, #{entity.updatedAt}, #{entity.furnishMeal}, #{entity.furnishExpress}, #{entity.furnishDraw}, #{entity.furnishVir}, #{entity.disableDistribute}, #{entity.merchantId}) - - - - - insert into tb_merchant_coupon(status, title, template_id, shop_id, shop_snap, from_time, to_time, limit_number, number, left_number, amount, limit_amount, is_show, pic, type, ratio, max_ratio_amount, track, class_type, effect_type, effect_days, relation_ids, relation_list, editor, note, created_at, updated_at, furnish_meal, furnish_express, furnish_draw, furnish_vir, disable_distribute, merchant_id) - values - - (#{entity.status}, #{entity.title}, #{entity.templateId}, #{entity.shopId}, #{entity.shopSnap}, #{entity.fromTime}, #{entity.toTime}, #{entity.limitNumber}, #{entity.number}, #{entity.leftNumber}, #{entity.amount}, #{entity.limitAmount}, #{entity.isShow}, #{entity.pic}, #{entity.type}, #{entity.ratio}, #{entity.maxRatioAmount}, #{entity.track}, #{entity.classType}, #{entity.effectType}, #{entity.effectDays}, #{entity.relationIds}, #{entity.relationList}, #{entity.editor}, #{entity.note}, #{entity.createdAt}, #{entity.updatedAt}, #{entity.furnishMeal}, #{entity.furnishExpress}, #{entity.furnishDraw}, #{entity.furnishVir}, #{entity.disableDistribute}, #{entity.merchantId}) - - on duplicate key update - status = values(status), - title = values(title), - template_id = values(template_id), - shop_id = values(shop_id), - shop_snap = values(shop_snap), - from_time = values(from_time), - to_time = values(to_time), - limit_number = values(limit_number), - number = values(number), - left_number = values(left_number), - amount = values(amount), - limit_amount = values(limit_amount), - is_show = values(is_show), - pic = values(pic), - type = values(type), - ratio = values(ratio), - max_ratio_amount = values(max_ratio_amount), - track = values(track), - class_type = values(class_type), - effect_type = values(effect_type), - effect_days = values(effect_days), - relation_ids = values(relation_ids), - relation_list = values(relation_list), - editor = values(editor), - note = values(note), - created_at = values(created_at), - updated_at = values(updated_at), - furnish_meal = values(furnish_meal), - furnish_express = values(furnish_express), - furnish_draw = values(furnish_draw), - furnish_vir = values(furnish_vir), - disable_distribute = values(disable_distribute), - merchant_id = values(merchant_id) - - - - - update tb_merchant_coupon - - - status = #{status}, - - - title = #{title}, - - - template_id = #{templateId}, - - - shop_id = #{shopId}, - - - shop_snap = #{shopSnap}, - - - from_time = #{fromTime}, - - - to_time = #{toTime}, - - - limit_number = #{limitNumber}, - - - number = #{number}, - - - left_number = #{leftNumber}, - - - amount = #{amount}, - - - limit_amount = #{limitAmount}, - - - is_show = #{isShow}, - - - pic = #{pic}, - - - type = #{type}, - - - ratio = #{ratio}, - - - max_ratio_amount = #{maxRatioAmount}, - - - track = #{track}, - - - class_type = #{classType}, - - - effect_type = #{effectType}, - - - effect_days = #{effectDays}, - - - relation_ids = #{relationIds}, - - - relation_list = #{relationList}, - - - editor = #{editor}, - - - note = #{note}, - - - created_at = #{createdAt}, - - - updated_at = #{updatedAt}, - - - furnish_meal = #{furnishMeal}, - - - furnish_express = #{furnishExpress}, - - - furnish_draw = #{furnishDraw}, - - - furnish_vir = #{furnishVir}, - - - disable_distribute = #{disableDistribute}, - - - merchant_id = #{merchantId}, - - - where id = #{id} - - - - - delete from tb_merchant_coupon where id = #{id} - diff --git a/src/main/resources/mapper/TbPurchaseNoticeMapper.xml b/src/main/resources/mapper/TbPurchaseNoticeMapper.xml index f1c18fd..f7d81ac 100644 --- a/src/main/resources/mapper/TbPurchaseNoticeMapper.xml +++ b/src/main/resources/mapper/TbPurchaseNoticeMapper.xml @@ -22,12 +22,12 @@ , coupon_id, date_used, available_time, booking_type, refund_policy, usage_rules, invoice_info, group_pur_info, market_price_Info, discount_Info, platform_tips - select from tb_purchase_notice - where id = #{id} + where coupon_id = #{couponId} diff --git a/src/main/resources/mapper/TbShopInfoMapper.xml b/src/main/resources/mapper/TbShopInfoMapper.xml index bf2b361..41185f0 100644 --- a/src/main/resources/mapper/TbShopInfoMapper.xml +++ b/src/main/resources/mapper/TbShopInfoMapper.xml @@ -1,662 +1,680 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, account, shop_code, sub_title, merchant_id, shop_name, chain_name, back_img, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + , account, shop_code, sub_title, merchant_id, shop_name, chain_name, back_img, front_img, contact_name, phone, logo, is_deposit, is_supply, cover_img, share_img, detail, lat, lng, mch_id, register_type, is_wx_ma_independent, address, city, type, industry, industry_name, business_time, post_time, post_amount_line, on_sale, settle_type, settle_time, enter_at, expire_at, status, average, order_wait_pay_minute, support_device_number, distribute_level, created_at, updated_at, proxy_id, shop_qrcode, tag,is_open_yhq - - - view - - - - - - - delete from tb_shop_info - where id = #{id,jdbcType=INTEGER} - - - insert into tb_shop_info (id, account, shop_code, - sub_title, merchant_id, shop_name, - chain_name, back_img, front_img, - contact_name, phone, logo, - is_deposit, is_supply, cover_img, - share_img, detail, lat, - lng, mch_id, register_type, - is_wx_ma_independent, address, city, - type, industry, industry_name, - business_time, post_time, post_amount_line, - on_sale, settle_type, settle_time, - enter_at, expire_at, status, - average, order_wait_pay_minute, support_device_number, - distribute_level, created_at, updated_at, - proxy_id, view) - values (#{id,jdbcType=INTEGER}, #{account,jdbcType=VARCHAR}, #{shopCode,jdbcType=VARCHAR}, - #{subTitle,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{shopName,jdbcType=VARCHAR}, - #{chainName,jdbcType=VARCHAR}, #{backImg,jdbcType=VARCHAR}, #{frontImg,jdbcType=VARCHAR}, - #{contactName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR}, - #{isDeposit,jdbcType=TINYINT}, #{isSupply,jdbcType=TINYINT}, #{coverImg,jdbcType=VARCHAR}, - #{shareImg,jdbcType=VARCHAR}, #{detail,jdbcType=VARCHAR}, #{lat,jdbcType=VARCHAR}, - #{lng,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{registerType,jdbcType=VARCHAR}, - #{isWxMaIndependent,jdbcType=TINYINT}, #{address,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{industry,jdbcType=VARCHAR}, #{industryName,jdbcType=VARCHAR}, - #{businessTime,jdbcType=VARCHAR}, #{postTime,jdbcType=VARCHAR}, #{postAmountLine,jdbcType=DECIMAL}, - #{onSale,jdbcType=TINYINT}, #{settleType,jdbcType=TINYINT}, #{settleTime,jdbcType=VARCHAR}, - #{enterAt,jdbcType=INTEGER}, #{expireAt,jdbcType=BIGINT}, #{status,jdbcType=TINYINT}, - #{average,jdbcType=REAL}, #{orderWaitPayMinute,jdbcType=INTEGER}, #{supportDeviceNumber,jdbcType=INTEGER}, - #{distributeLevel,jdbcType=TINYINT}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, - #{proxyId,jdbcType=VARCHAR}, #{view,jdbcType=LONGVARCHAR}) - - - insert into tb_shop_info - - - id, - - - account, - - - shop_code, - - - sub_title, - - - merchant_id, - - - shop_name, - - - chain_name, - - - back_img, - - - front_img, - - - contact_name, - - - phone, - - - logo, - - - is_deposit, - - - is_supply, - - - cover_img, - - - share_img, - - - detail, - - - lat, - - - lng, - - - mch_id, - - - register_type, - - - is_wx_ma_independent, - - - address, - - - city, - - - type, - - - industry, - - - industry_name, - - - business_time, - - - post_time, - - - post_amount_line, - - - on_sale, - - - settle_type, - - - settle_time, - - - enter_at, - - - expire_at, - - - status, - - - average, - - - order_wait_pay_minute, - - - support_device_number, - - - distribute_level, - - - created_at, - - - updated_at, - - - proxy_id, - - - view, - - - - - #{id,jdbcType=INTEGER}, - - - #{account,jdbcType=VARCHAR}, - - - #{shopCode,jdbcType=VARCHAR}, - - - #{subTitle,jdbcType=VARCHAR}, - - - #{merchantId,jdbcType=VARCHAR}, - - - #{shopName,jdbcType=VARCHAR}, - - - #{chainName,jdbcType=VARCHAR}, - - - #{backImg,jdbcType=VARCHAR}, - - - #{frontImg,jdbcType=VARCHAR}, - - - #{contactName,jdbcType=VARCHAR}, - - - #{phone,jdbcType=VARCHAR}, - - - #{logo,jdbcType=VARCHAR}, - - - #{isDeposit,jdbcType=TINYINT}, - - - #{isSupply,jdbcType=TINYINT}, - - - #{coverImg,jdbcType=VARCHAR}, - - - #{shareImg,jdbcType=VARCHAR}, - - - #{detail,jdbcType=VARCHAR}, - - - #{lat,jdbcType=VARCHAR}, - - - #{lng,jdbcType=VARCHAR}, - - - #{mchId,jdbcType=VARCHAR}, - - - #{registerType,jdbcType=VARCHAR}, - - - #{isWxMaIndependent,jdbcType=TINYINT}, - - - #{address,jdbcType=VARCHAR}, - - - #{city,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{industry,jdbcType=VARCHAR}, - - - #{industryName,jdbcType=VARCHAR}, - - - #{businessTime,jdbcType=VARCHAR}, - - - #{postTime,jdbcType=VARCHAR}, - - - #{postAmountLine,jdbcType=DECIMAL}, - - - #{onSale,jdbcType=TINYINT}, - - - #{settleType,jdbcType=TINYINT}, - - - #{settleTime,jdbcType=VARCHAR}, - - - #{enterAt,jdbcType=INTEGER}, - - - #{expireAt,jdbcType=BIGINT}, - - - #{status,jdbcType=TINYINT}, - - - #{average,jdbcType=REAL}, - - - #{orderWaitPayMinute,jdbcType=INTEGER}, - - - #{supportDeviceNumber,jdbcType=INTEGER}, - - - #{distributeLevel,jdbcType=TINYINT}, - - - #{createdAt,jdbcType=BIGINT}, - - - #{updatedAt,jdbcType=BIGINT}, - - - #{proxyId,jdbcType=VARCHAR}, - - - #{view,jdbcType=LONGVARCHAR}, - - - - - update tb_shop_info - - - account = #{account,jdbcType=VARCHAR}, - - - shop_code = #{shopCode,jdbcType=VARCHAR}, - - - sub_title = #{subTitle,jdbcType=VARCHAR}, - - - merchant_id = #{merchantId,jdbcType=VARCHAR}, - - - shop_name = #{shopName,jdbcType=VARCHAR}, - - - chain_name = #{chainName,jdbcType=VARCHAR}, - - - back_img = #{backImg,jdbcType=VARCHAR}, - - - front_img = #{frontImg,jdbcType=VARCHAR}, - - - contact_name = #{contactName,jdbcType=VARCHAR}, - - - phone = #{phone,jdbcType=VARCHAR}, - - - logo = #{logo,jdbcType=VARCHAR}, - - - is_deposit = #{isDeposit,jdbcType=TINYINT}, - - - is_supply = #{isSupply,jdbcType=TINYINT}, - - - cover_img = #{coverImg,jdbcType=VARCHAR}, - - - share_img = #{shareImg,jdbcType=VARCHAR}, - - - detail = #{detail,jdbcType=VARCHAR}, - - - lat = #{lat,jdbcType=VARCHAR}, - - - lng = #{lng,jdbcType=VARCHAR}, - - - mch_id = #{mchId,jdbcType=VARCHAR}, - - - register_type = #{registerType,jdbcType=VARCHAR}, - - - is_wx_ma_independent = #{isWxMaIndependent,jdbcType=TINYINT}, - - - address = #{address,jdbcType=VARCHAR}, - - - city = #{city,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - industry = #{industry,jdbcType=VARCHAR}, - - - industry_name = #{industryName,jdbcType=VARCHAR}, - - - business_time = #{businessTime,jdbcType=VARCHAR}, - - - post_time = #{postTime,jdbcType=VARCHAR}, - - - post_amount_line = #{postAmountLine,jdbcType=DECIMAL}, - - - on_sale = #{onSale,jdbcType=TINYINT}, - - - settle_type = #{settleType,jdbcType=TINYINT}, - - - settle_time = #{settleTime,jdbcType=VARCHAR}, - - - enter_at = #{enterAt,jdbcType=INTEGER}, - - - expire_at = #{expireAt,jdbcType=BIGINT}, - - - status = #{status,jdbcType=TINYINT}, - - - average = #{average,jdbcType=REAL}, - - - order_wait_pay_minute = #{orderWaitPayMinute,jdbcType=INTEGER}, - - - support_device_number = #{supportDeviceNumber,jdbcType=INTEGER}, - - - distribute_level = #{distributeLevel,jdbcType=TINYINT}, - - - created_at = #{createdAt,jdbcType=BIGINT}, - - - updated_at = #{updatedAt,jdbcType=BIGINT}, - - - proxy_id = #{proxyId,jdbcType=VARCHAR}, - - - view = #{view,jdbcType=LONGVARCHAR}, - - - where id = #{id,jdbcType=INTEGER} - - - update tb_shop_info - set account = #{account,jdbcType=VARCHAR}, - shop_code = #{shopCode,jdbcType=VARCHAR}, - sub_title = #{subTitle,jdbcType=VARCHAR}, - merchant_id = #{merchantId,jdbcType=VARCHAR}, - shop_name = #{shopName,jdbcType=VARCHAR}, - chain_name = #{chainName,jdbcType=VARCHAR}, - back_img = #{backImg,jdbcType=VARCHAR}, - front_img = #{frontImg,jdbcType=VARCHAR}, - contact_name = #{contactName,jdbcType=VARCHAR}, - phone = #{phone,jdbcType=VARCHAR}, - logo = #{logo,jdbcType=VARCHAR}, - is_deposit = #{isDeposit,jdbcType=TINYINT}, - is_supply = #{isSupply,jdbcType=TINYINT}, - cover_img = #{coverImg,jdbcType=VARCHAR}, - share_img = #{shareImg,jdbcType=VARCHAR}, - detail = #{detail,jdbcType=VARCHAR}, - lat = #{lat,jdbcType=VARCHAR}, - lng = #{lng,jdbcType=VARCHAR}, - mch_id = #{mchId,jdbcType=VARCHAR}, - register_type = #{registerType,jdbcType=VARCHAR}, - is_wx_ma_independent = #{isWxMaIndependent,jdbcType=TINYINT}, - address = #{address,jdbcType=VARCHAR}, - city = #{city,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - industry = #{industry,jdbcType=VARCHAR}, - industry_name = #{industryName,jdbcType=VARCHAR}, - business_time = #{businessTime,jdbcType=VARCHAR}, - post_time = #{postTime,jdbcType=VARCHAR}, - post_amount_line = #{postAmountLine,jdbcType=DECIMAL}, - on_sale = #{onSale,jdbcType=TINYINT}, - settle_type = #{settleType,jdbcType=TINYINT}, - settle_time = #{settleTime,jdbcType=VARCHAR}, - enter_at = #{enterAt,jdbcType=INTEGER}, - expire_at = #{expireAt,jdbcType=BIGINT}, - status = #{status,jdbcType=TINYINT}, - average = #{average,jdbcType=REAL}, - order_wait_pay_minute = #{orderWaitPayMinute,jdbcType=INTEGER}, - support_device_number = #{supportDeviceNumber,jdbcType=INTEGER}, - distribute_level = #{distributeLevel,jdbcType=TINYINT}, - created_at = #{createdAt,jdbcType=BIGINT}, - updated_at = #{updatedAt,jdbcType=BIGINT}, - proxy_id = #{proxyId,jdbcType=VARCHAR}, - view = #{view,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=INTEGER} - - - update tb_shop_info - set account = #{account,jdbcType=VARCHAR}, - shop_code = #{shopCode,jdbcType=VARCHAR}, - sub_title = #{subTitle,jdbcType=VARCHAR}, - merchant_id = #{merchantId,jdbcType=VARCHAR}, - shop_name = #{shopName,jdbcType=VARCHAR}, - chain_name = #{chainName,jdbcType=VARCHAR}, - back_img = #{backImg,jdbcType=VARCHAR}, - front_img = #{frontImg,jdbcType=VARCHAR}, - contact_name = #{contactName,jdbcType=VARCHAR}, - phone = #{phone,jdbcType=VARCHAR}, - logo = #{logo,jdbcType=VARCHAR}, - is_deposit = #{isDeposit,jdbcType=TINYINT}, - is_supply = #{isSupply,jdbcType=TINYINT}, - cover_img = #{coverImg,jdbcType=VARCHAR}, - share_img = #{shareImg,jdbcType=VARCHAR}, - detail = #{detail,jdbcType=VARCHAR}, - lat = #{lat,jdbcType=VARCHAR}, - lng = #{lng,jdbcType=VARCHAR}, - mch_id = #{mchId,jdbcType=VARCHAR}, - register_type = #{registerType,jdbcType=VARCHAR}, - is_wx_ma_independent = #{isWxMaIndependent,jdbcType=TINYINT}, - address = #{address,jdbcType=VARCHAR}, - city = #{city,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - industry = #{industry,jdbcType=VARCHAR}, - industry_name = #{industryName,jdbcType=VARCHAR}, - business_time = #{businessTime,jdbcType=VARCHAR}, - post_time = #{postTime,jdbcType=VARCHAR}, - post_amount_line = #{postAmountLine,jdbcType=DECIMAL}, - on_sale = #{onSale,jdbcType=TINYINT}, - settle_type = #{settleType,jdbcType=TINYINT}, - settle_time = #{settleTime,jdbcType=VARCHAR}, - enter_at = #{enterAt,jdbcType=INTEGER}, - expire_at = #{expireAt,jdbcType=BIGINT}, - status = #{status,jdbcType=TINYINT}, - average = #{average,jdbcType=REAL}, - order_wait_pay_minute = #{orderWaitPayMinute,jdbcType=INTEGER}, - support_device_number = #{supportDeviceNumber,jdbcType=INTEGER}, - distribute_level = #{distributeLevel,jdbcType=TINYINT}, - created_at = #{createdAt,jdbcType=BIGINT}, - updated_at = #{updatedAt,jdbcType=BIGINT}, - proxy_id = #{proxyId,jdbcType=VARCHAR} - where id = #{id,jdbcType=INTEGER} - - - + select + + , + + from tb_shop_info + where id = #{id,jdbcType=INTEGER} - - - - + + + + + + delete + from tb_shop_info + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_info (id, account, shop_code, + sub_title, merchant_id, shop_name, + chain_name, back_img, front_img, + contact_name, phone, logo, + is_deposit, is_supply, cover_img, + share_img, detail, lat, + lng, mch_id, register_type, + is_wx_ma_independent, address, city, + type, industry, industry_name, + business_time, post_time, post_amount_line, + on_sale, settle_type, settle_time, + enter_at, expire_at, status, + average, order_wait_pay_minute, support_device_number, + distribute_level, created_at, updated_at, + proxy_id, view) + values (#{id,jdbcType=INTEGER}, #{account,jdbcType=VARCHAR}, #{shopCode,jdbcType=VARCHAR}, + #{subTitle,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{shopName,jdbcType=VARCHAR}, + #{chainName,jdbcType=VARCHAR}, #{backImg,jdbcType=VARCHAR}, #{frontImg,jdbcType=VARCHAR}, + #{contactName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR}, + #{isDeposit,jdbcType=TINYINT}, #{isSupply,jdbcType=TINYINT}, #{coverImg,jdbcType=VARCHAR}, + #{shareImg,jdbcType=VARCHAR}, #{detail,jdbcType=VARCHAR}, #{lat,jdbcType=VARCHAR}, + #{lng,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{registerType,jdbcType=VARCHAR}, + #{isWxMaIndependent,jdbcType=TINYINT}, #{address,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, + #{type,jdbcType=VARCHAR}, #{industry,jdbcType=VARCHAR}, #{industryName,jdbcType=VARCHAR}, + #{businessTime,jdbcType=VARCHAR}, #{postTime,jdbcType=VARCHAR}, #{postAmountLine,jdbcType=DECIMAL}, + #{onSale,jdbcType=TINYINT}, #{settleType,jdbcType=TINYINT}, #{settleTime,jdbcType=VARCHAR}, + #{enterAt,jdbcType=INTEGER}, #{expireAt,jdbcType=BIGINT}, #{status,jdbcType=TINYINT}, + #{average,jdbcType=REAL}, #{orderWaitPayMinute,jdbcType=INTEGER}, + #{supportDeviceNumber,jdbcType=INTEGER}, + #{distributeLevel,jdbcType=TINYINT}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, + #{proxyId,jdbcType=VARCHAR}, #{view,jdbcType=LONGVARCHAR}) + + + insert into tb_shop_info + + + id, + + + account, + + + shop_code, + + + sub_title, + + + merchant_id, + + + shop_name, + + + chain_name, + + + back_img, + + + front_img, + + + contact_name, + + + phone, + + + logo, + + + is_deposit, + + + is_supply, + + + cover_img, + + + share_img, + + + detail, + + + lat, + + + lng, + + + mch_id, + + + register_type, + + + is_wx_ma_independent, + + + address, + + + city, + + + type, + + + industry, + + + industry_name, + + + business_time, + + + post_time, + + + post_amount_line, + + + on_sale, + + + settle_type, + + + settle_time, + + + enter_at, + + + expire_at, + + + status, + + + average, + + + order_wait_pay_minute, + + + support_device_number, + + + distribute_level, + + + created_at, + + + updated_at, + + + proxy_id, + + + view, + + + + + #{id,jdbcType=INTEGER}, + + + #{account,jdbcType=VARCHAR}, + + + #{shopCode,jdbcType=VARCHAR}, + + + #{subTitle,jdbcType=VARCHAR}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopName,jdbcType=VARCHAR}, + + + #{chainName,jdbcType=VARCHAR}, + + + #{backImg,jdbcType=VARCHAR}, + + + #{frontImg,jdbcType=VARCHAR}, + + + #{contactName,jdbcType=VARCHAR}, + + + #{phone,jdbcType=VARCHAR}, + + + #{logo,jdbcType=VARCHAR}, + + + #{isDeposit,jdbcType=TINYINT}, + + + #{isSupply,jdbcType=TINYINT}, + + + #{coverImg,jdbcType=VARCHAR}, + + + #{shareImg,jdbcType=VARCHAR}, + + + #{detail,jdbcType=VARCHAR}, + + + #{lat,jdbcType=VARCHAR}, + + + #{lng,jdbcType=VARCHAR}, + + + #{mchId,jdbcType=VARCHAR}, + + + #{registerType,jdbcType=VARCHAR}, + + + #{isWxMaIndependent,jdbcType=TINYINT}, + + + #{address,jdbcType=VARCHAR}, + + + #{city,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{industry,jdbcType=VARCHAR}, + + + #{industryName,jdbcType=VARCHAR}, + + + #{businessTime,jdbcType=VARCHAR}, + + + #{postTime,jdbcType=VARCHAR}, + + + #{postAmountLine,jdbcType=DECIMAL}, + + + #{onSale,jdbcType=TINYINT}, + + + #{settleType,jdbcType=TINYINT}, + + + #{settleTime,jdbcType=VARCHAR}, + + + #{enterAt,jdbcType=INTEGER}, + + + #{expireAt,jdbcType=BIGINT}, + + + #{status,jdbcType=TINYINT}, + + + #{average,jdbcType=REAL}, + + + #{orderWaitPayMinute,jdbcType=INTEGER}, + + + #{supportDeviceNumber,jdbcType=INTEGER}, + + + #{distributeLevel,jdbcType=TINYINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{proxyId,jdbcType=VARCHAR}, + + + #{view,jdbcType=LONGVARCHAR}, + + + + + update tb_shop_info + + + account = #{account,jdbcType=VARCHAR}, + + + shop_code = #{shopCode,jdbcType=VARCHAR}, + + + sub_title = #{subTitle,jdbcType=VARCHAR}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_name = #{shopName,jdbcType=VARCHAR}, + + + chain_name = #{chainName,jdbcType=VARCHAR}, + + + back_img = #{backImg,jdbcType=VARCHAR}, + + + front_img = #{frontImg,jdbcType=VARCHAR}, + + + contact_name = #{contactName,jdbcType=VARCHAR}, + + + phone = #{phone,jdbcType=VARCHAR}, + + + logo = #{logo,jdbcType=VARCHAR}, + + + is_deposit = #{isDeposit,jdbcType=TINYINT}, + + + is_supply = #{isSupply,jdbcType=TINYINT}, + + + cover_img = #{coverImg,jdbcType=VARCHAR}, + + + share_img = #{shareImg,jdbcType=VARCHAR}, + + + detail = #{detail,jdbcType=VARCHAR}, + + + lat = #{lat,jdbcType=VARCHAR}, + + + lng = #{lng,jdbcType=VARCHAR}, + + + mch_id = #{mchId,jdbcType=VARCHAR}, + + + register_type = #{registerType,jdbcType=VARCHAR}, + + + is_wx_ma_independent = #{isWxMaIndependent,jdbcType=TINYINT}, + + + address = #{address,jdbcType=VARCHAR}, + + + city = #{city,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + industry = #{industry,jdbcType=VARCHAR}, + + + industry_name = #{industryName,jdbcType=VARCHAR}, + + + business_time = #{businessTime,jdbcType=VARCHAR}, + + + post_time = #{postTime,jdbcType=VARCHAR}, + + + post_amount_line = #{postAmountLine,jdbcType=DECIMAL}, + + + on_sale = #{onSale,jdbcType=TINYINT}, + + + settle_type = #{settleType,jdbcType=TINYINT}, + + + settle_time = #{settleTime,jdbcType=VARCHAR}, + + + enter_at = #{enterAt,jdbcType=INTEGER}, + + + expire_at = #{expireAt,jdbcType=BIGINT}, + + + status = #{status,jdbcType=TINYINT}, + + + average = #{average,jdbcType=REAL}, + + + order_wait_pay_minute = #{orderWaitPayMinute,jdbcType=INTEGER}, + + + support_device_number = #{supportDeviceNumber,jdbcType=INTEGER}, + + + distribute_level = #{distributeLevel,jdbcType=TINYINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + proxy_id = #{proxyId,jdbcType=VARCHAR}, + + + view = #{view,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_info + set account = #{account,jdbcType=VARCHAR}, + shop_code = #{shopCode,jdbcType=VARCHAR}, + sub_title = #{subTitle,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_name = #{shopName,jdbcType=VARCHAR}, + chain_name = #{chainName,jdbcType=VARCHAR}, + back_img = #{backImg,jdbcType=VARCHAR}, + front_img = #{frontImg,jdbcType=VARCHAR}, + contact_name = #{contactName,jdbcType=VARCHAR}, + phone = #{phone,jdbcType=VARCHAR}, + logo = #{logo,jdbcType=VARCHAR}, + is_deposit = #{isDeposit,jdbcType=TINYINT}, + is_supply = #{isSupply,jdbcType=TINYINT}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + share_img = #{shareImg,jdbcType=VARCHAR}, + detail = #{detail,jdbcType=VARCHAR}, + lat = #{lat,jdbcType=VARCHAR}, + lng = #{lng,jdbcType=VARCHAR}, + mch_id = #{mchId,jdbcType=VARCHAR}, + register_type = #{registerType,jdbcType=VARCHAR}, + is_wx_ma_independent = #{isWxMaIndependent,jdbcType=TINYINT}, + address = #{address,jdbcType=VARCHAR}, + city = #{city,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + industry = #{industry,jdbcType=VARCHAR}, + industry_name = #{industryName,jdbcType=VARCHAR}, + business_time = #{businessTime,jdbcType=VARCHAR}, + post_time = #{postTime,jdbcType=VARCHAR}, + post_amount_line = #{postAmountLine,jdbcType=DECIMAL}, + on_sale = #{onSale,jdbcType=TINYINT}, + settle_type = #{settleType,jdbcType=TINYINT}, + settle_time = #{settleTime,jdbcType=VARCHAR}, + enter_at = #{enterAt,jdbcType=INTEGER}, + expire_at = #{expireAt,jdbcType=BIGINT}, + status = #{status,jdbcType=TINYINT}, + average = #{average,jdbcType=REAL}, + order_wait_pay_minute = #{orderWaitPayMinute,jdbcType=INTEGER}, + support_device_number = #{supportDeviceNumber,jdbcType=INTEGER}, + distribute_level = #{distributeLevel,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + proxy_id = #{proxyId,jdbcType=VARCHAR}, + view = #{view,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_info + set account = #{account,jdbcType=VARCHAR}, + shop_code = #{shopCode,jdbcType=VARCHAR}, + sub_title = #{subTitle,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_name = #{shopName,jdbcType=VARCHAR}, + chain_name = #{chainName,jdbcType=VARCHAR}, + back_img = #{backImg,jdbcType=VARCHAR}, + front_img = #{frontImg,jdbcType=VARCHAR}, + contact_name = #{contactName,jdbcType=VARCHAR}, + phone = #{phone,jdbcType=VARCHAR}, + logo = #{logo,jdbcType=VARCHAR}, + is_deposit = #{isDeposit,jdbcType=TINYINT}, + is_supply = #{isSupply,jdbcType=TINYINT}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + share_img = #{shareImg,jdbcType=VARCHAR}, + detail = #{detail,jdbcType=VARCHAR}, + lat = #{lat,jdbcType=VARCHAR}, + lng = #{lng,jdbcType=VARCHAR}, + mch_id = #{mchId,jdbcType=VARCHAR}, + register_type = #{registerType,jdbcType=VARCHAR}, + is_wx_ma_independent = #{isWxMaIndependent,jdbcType=TINYINT}, + address = #{address,jdbcType=VARCHAR}, + city = #{city,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + industry = #{industry,jdbcType=VARCHAR}, + industry_name = #{industryName,jdbcType=VARCHAR}, + business_time = #{businessTime,jdbcType=VARCHAR}, + post_time = #{postTime,jdbcType=VARCHAR}, + post_amount_line = #{postAmountLine,jdbcType=DECIMAL}, + on_sale = #{onSale,jdbcType=TINYINT}, + settle_type = #{settleType,jdbcType=TINYINT}, + settle_time = #{settleTime,jdbcType=VARCHAR}, + enter_at = #{enterAt,jdbcType=INTEGER}, + expire_at = #{expireAt,jdbcType=BIGINT}, + status = #{status,jdbcType=TINYINT}, + average = #{average,jdbcType=REAL}, + order_wait_pay_minute = #{orderWaitPayMinute,jdbcType=INTEGER}, + support_device_number = #{supportDeviceNumber,jdbcType=INTEGER}, + distribute_level = #{distributeLevel,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + proxy_id = #{proxyId,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbUserInfoMapper.xml b/src/main/resources/mapper/TbUserInfoMapper.xml index ad343cb..e04acc4 100644 --- a/src/main/resources/mapper/TbUserInfoMapper.xml +++ b/src/main/resources/mapper/TbUserInfoMapper.xml @@ -598,7 +598,7 @@