New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | |
| | | <parent> |
| | | <artifactId>yami-shop</artifactId> |
| | | <groupId>com.yami.shop</groupId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>yami-shop-security</artifactId> |
| | | |
| | | <description>商城安全模块</description> |
| | | <packaging>pom</packaging> |
| | | |
| | | <modules> |
| | | <module>yami-shop-security-api</module> |
| | | <module>yami-shop-security-multishop</module> |
| | | <module>yami-shop-security-platform</module> |
| | | <module>yami-shop-security-common</module> |
| | | </modules> |
| | | |
| | | </project> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>yami-shop-security</artifactId> |
| | | <groupId>com.yami.shop</groupId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>yami-shop-security-api</artifactId> |
| | | <description>商城安全模块接口部分</description> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-security-common</artifactId> |
| | | <version>${yami.shop.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.api.adapter; |
| | | |
| | | import com.yami.shop.security.common.adapter.DefaultAuthConfigAdapter; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/16 |
| | | */ |
| | | @Component |
| | | public class ResourceServerAdapter extends DefaultAuthConfigAdapter { |
| | | |
| | | @Override |
| | | public List<String> pathPatterns() { |
| | | return Arrays.asList("/p/*","/api/pcdn/*"); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.api.controller; |
| | | |
| | | import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.yami.shop.bean.enums.SendType; |
| | | import com.yami.shop.bean.model.CdnTeamRelation; |
| | | import com.yami.shop.bean.model.User; |
| | | import com.yami.shop.bean.param.im.ImConfigParam; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.response.ResponseEnum; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.common.util.PrincipalUtil; |
| | | import com.yami.shop.config.WxConfig; |
| | | import com.yami.shop.dao.UserMapper; |
| | | import com.yami.shop.security.api.dto.MaCodeAuthenticationDTO; |
| | | import com.yami.shop.security.api.dto.SocialAuthenticationDTO; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.dao.AppConnectMapper; |
| | | import com.yami.shop.security.common.dto.AuthenticationDTO; |
| | | import com.yami.shop.security.common.enums.SocialType; |
| | | import com.yami.shop.security.common.enums.SysTypeEnum; |
| | | import com.yami.shop.security.common.manager.PasswordCheckManager; |
| | | import com.yami.shop.security.common.manager.PasswordManager; |
| | | import com.yami.shop.security.common.manager.TokenStore; |
| | | import com.yami.shop.security.common.model.AppConnect; |
| | | import com.yami.shop.security.common.service.AppConnectService; |
| | | import com.yami.shop.security.common.service.ImTokenService; |
| | | import com.yami.shop.security.common.vo.ImTokenInfo; |
| | | import com.yami.shop.security.common.vo.TokenInfoVO; |
| | | import com.yami.shop.service.CdnTeamRelationService; |
| | | import com.yami.shop.service.SmsLogService; |
| | | import com.yami.shop.service.SysConfigService; |
| | | import com.yami.shop.service.UserService; |
| | | import com.yami.shop.service.impl.CdnQRCodeService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import me.chanjar.weixin.common.error.WxErrorException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/6/30 |
| | | */ |
| | | @RestController |
| | | @Tag(name = "登录") |
| | | public class LoginController { |
| | | |
| | | @Autowired |
| | | private TokenStore tokenStore; |
| | | |
| | | @Autowired |
| | | private UserMapper userMapper; |
| | | |
| | | @Autowired |
| | | private AppConnectService appConnectService; |
| | | |
| | | @Autowired |
| | | private PasswordCheckManager passwordCheckManager; |
| | | |
| | | @Autowired |
| | | private SmsLogService smsLogService; |
| | | |
| | | @Autowired |
| | | private PasswordManager passwordManager; |
| | | |
| | | @Autowired |
| | | private AppConnectMapper appConnectMapper; |
| | | |
| | | @Autowired |
| | | private CdnTeamRelationService cdnTeamRelationService; |
| | | |
| | | @Autowired |
| | | private WxConfig wxConfig; |
| | | |
| | | @Autowired |
| | | private SysConfigService sysConfigService; |
| | | |
| | | @Autowired |
| | | private CdnQRCodeService qrCodeService; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | @Autowired |
| | | private ImTokenService imTokenService; |
| | | |
| | | @PostMapping("/login") |
| | | @Operation(summary = "账号密码(用于h5、pc登录)" , description = "通过账号/手机号/用户名密码登录,还要携带用户的类型,也就是用户所在的系统") |
| | | public ServerResponseEntity<TokenInfoVO> login( |
| | | @Valid @RequestBody AuthenticationDTO authenticationDTO) { |
| | | String mobileOrUserName = authenticationDTO.getUserName(); |
| | | User user = getUser(mobileOrUserName); |
| | | String decryptPassword = passwordManager.decryptPassword(authenticationDTO.getPassWord()); |
| | | |
| | | // 半小时内密码输入错误十次,已限制登录30分钟 |
| | | passwordCheckManager.checkPassword(SysTypeEnum.ORDINARY,user.getUserMobile(),decryptPassword, user.getLoginPassword()); |
| | | user.setLoginTime(new Date()); |
| | | userService.updateById(user); |
| | | TokenInfoVO tokenInfoVO = getTokenInfoVO(user, null); |
| | | |
| | | try { |
| | | ImTokenInfo imTokenInfo = imProcess(user,1); |
| | | tokenInfoVO.setImToKen(imTokenInfo); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ServerResponseEntity.success(tokenInfoVO); |
| | | } |
| | | |
| | | @PostMapping("/wx/login") |
| | | @Operation(summary = "账号密码登录(用于微信小程序和公众号)" , description = "微信小程序和公众号通过账号/手机号/用户名密码登录, 二合一登录(包含绑定 + 登录)") |
| | | public ServerResponseEntity<TokenInfoVO> wxLogin( |
| | | @Valid @RequestBody SocialAuthenticationDTO authenticationDTO) { |
| | | if (StrUtil.isBlank(authenticationDTO.getTempUid())) { |
| | | return ServerResponseEntity.showFailMsg("tempUid is blank"); |
| | | } |
| | | User user = getUser(authenticationDTO.getUserName()); |
| | | String decryptPassword = passwordManager.decryptPassword(authenticationDTO.getPassWord()); |
| | | // 半小时内密码输入错误十次,已限制登录30分钟 |
| | | passwordCheckManager.checkPassword(SysTypeEnum.ORDINARY,user.getUserMobile(),decryptPassword, user.getLoginPassword()); |
| | | |
| | | AppConnect appConnect = checkAndGetAppConnect(user.getUserId(), authenticationDTO.getSocialType(), authenticationDTO.getTempUid()); |
| | | |
| | | TokenInfoVO tokenInfoVO = getTokenInfoVO(user, appConnect); |
| | | |
| | | try { |
| | | ImTokenInfo imTokenInfo = imProcess(user,1); |
| | | tokenInfoVO.setImToKen(imTokenInfo); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ServerResponseEntity.success(tokenInfoVO); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/ma/login") |
| | | @Operation(summary = "微信小程序一键登录" , description = "三合一登录(包含注册 + 绑定 + 登录)") |
| | | public ServerResponseEntity<TokenInfoVO> maLogin(@Valid @RequestBody MaCodeAuthenticationDTO maCodeAuthenticationDTO) { |
| | | WxMaPhoneNumberInfo newPhoneNoInfo; |
| | | try { |
| | | newPhoneNoInfo = wxConfig.getWxMaService().getUserService().getNewPhoneNoInfo(maCodeAuthenticationDTO.getCode()); |
| | | } catch (WxErrorException e) { |
| | | throw new YamiShopBindException(e.getMessage()); |
| | | } |
| | | // 没有区号的手机号,国外手机号会有区号 |
| | | String mobile = newPhoneNoInfo.getPurePhoneNumber(); |
| | | |
| | | return threeInOneLogin(mobile, maCodeAuthenticationDTO.getTempUid(), SocialType.MA.value(),maCodeAuthenticationDTO.getInviteCode() != null ? maCodeAuthenticationDTO.getInviteCode() : ""); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/smsLogin") |
| | | @Operation(summary = "短信登录" , description = "三合一登录(包含注册 + 绑定 + 登录)") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ServerResponseEntity<TokenInfoVO> smsLogin( |
| | | @Valid @RequestBody SocialAuthenticationDTO authenticationDTO) { |
| | | |
| | | if (StrUtil.isBlank(authenticationDTO.getTempUid()) |
| | | && (Objects.equals(authenticationDTO.getSocialType(), SocialType.MA.value()) |
| | | || Objects.equals(authenticationDTO.getSocialType(), SocialType.MP.value()))) { |
| | | return ServerResponseEntity.showFailMsg("tempUid is blank"); |
| | | } |
| | | String defaultCode = sysConfigService.getValue("DEFAULT_CODE"); |
| | | // 验证码登录 |
| | | if(!defaultCode.equals(authenticationDTO.getPassWord())) { |
| | | boolean validCode; |
| | | try { |
| | | validCode = smsLogService.checkValidCode(authenticationDTO.getUserName(), String.valueOf(authenticationDTO.getPassWord()), SendType.LOGIN); |
| | | } catch (YamiShopBindException e) { |
| | | // 验证码校验过频繁,请稍后再试 |
| | | throw new YamiShopBindException("yami.user.code.check.too.much"); |
| | | } |
| | | if (!validCode) { |
| | | // 验证码有误或已过期 |
| | | throw new YamiShopBindException("yami.user.code.error"); |
| | | } |
| | | } |
| | | // 如果没有注册的话,短信登录将会进行注册 |
| | | // 在pc/小程序/公众号的登录,都有短信登录的方法。但是公众号/小程序的短信登录,登录了之后会见这个用户和公众号/小程序绑定一起(登录并绑定) |
| | | return threeInOneLogin(authenticationDTO.getUserName(), authenticationDTO.getTempUid(), authenticationDTO.getSocialType(),authenticationDTO.getInviteCode() != null ? authenticationDTO.getInviteCode() : ""); |
| | | } |
| | | |
| | | @PostMapping("/smsRegister") |
| | | @Operation(summary = "注册" , description = "注册") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ServerResponseEntity smsRegister( |
| | | @Valid @RequestBody SocialAuthenticationDTO authenticationDTO) { |
| | | |
| | | if (StrUtil.isBlank(authenticationDTO.getTempUid()) |
| | | && (Objects.equals(authenticationDTO.getSocialType(), SocialType.MA.value()) |
| | | || Objects.equals(authenticationDTO.getSocialType(), SocialType.MP.value()))) { |
| | | return ServerResponseEntity.showFailMsg("tempUid is blank"); |
| | | } |
| | | String defaultCode = sysConfigService.getValue("DEFAULT_CODE"); |
| | | // 验证码登录 |
| | | if(!defaultCode.equals(authenticationDTO.getPassWord())) { |
| | | boolean validCode; |
| | | try { |
| | | validCode = smsLogService.checkValidCode(authenticationDTO.getUserName(), String.valueOf(authenticationDTO.getPassWord()), SendType.LOGIN); |
| | | } catch (YamiShopBindException e) { |
| | | // 验证码校验过频繁,请稍后再试 |
| | | throw new YamiShopBindException("yami.user.code.check.too.much"); |
| | | } |
| | | if (!validCode) { |
| | | // 验证码有误或已过期 |
| | | throw new YamiShopBindException("yami.user.code.error"); |
| | | } |
| | | } |
| | | // 如果没有注册的话,短信登录将会进行注册 |
| | | // 在pc/小程序/公众号的登录,都有短信登录的方法。但是公众号/小程序的短信登录,登录了之后会见这个用户和公众号/小程序绑定一起(登录并绑定) |
| | | return register(authenticationDTO.getUserName(), authenticationDTO.getTempUid(), authenticationDTO.getSocialType(),authenticationDTO.getInviteCode() != null ? authenticationDTO.getInviteCode() : ""); |
| | | } |
| | | |
| | | |
| | | private TokenInfoVO getTokenInfoVO(User user, AppConnect appConnect) { |
| | | UserInfoInTokenBO userInfoInToken = new UserInfoInTokenBO(); |
| | | userInfoInToken.setUserId(user.getUserId()); |
| | | userInfoInToken.setSysType(SysTypeEnum.ORDINARY.value()); |
| | | userInfoInToken.setEnabled(user.getStatus() == 1); |
| | | if (appConnect !=null) { |
| | | userInfoInToken.setBizUid(appConnect.getBizUnionid()); |
| | | userInfoInToken.setBizUserId(appConnect.getBizUserId()); |
| | | userInfoInToken.setSessionKey(appConnect.getBizTempSession()); |
| | | userInfoInToken.setSocialType(appConnect.getAppId()); |
| | | } |
| | | // 存储token返回vo |
| | | return tokenStore.storeAndGetVo(userInfoInToken); |
| | | } |
| | | /** |
| | | * 三合一登录(包含注册 + 绑定 + 登录) |
| | | */ |
| | | private ServerResponseEntity<TokenInfoVO> threeInOneLogin(String mobile,String tempUid, Integer socialType,String inviteCode) { |
| | | User user = userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getUserMobile, mobile)); |
| | | AppConnect appConnect = null; |
| | | // 没有就注册 |
| | | if (user == null) { |
| | | //绑定推荐人关系 |
| | | if (!Objects.equals(inviteCode, "") && inviteCode != null) { |
| | | // 根据邀请码查询推荐人信息 |
| | | User u = userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getInviteCode, inviteCode)); |
| | | if(u != null) { |
| | | if (Objects.equals(socialType,SocialType.MA.value()) || Objects.equals(socialType,SocialType.MP.value())) { |
| | | appConnect = appConnectService.getByTempUid(tempUid); |
| | | if (appConnect == null || appConnect.getUserId() != null) { |
| | | return ServerResponseEntity.fail(ResponseEnum.TEMP_UID_ERROR); |
| | | } |
| | | } |
| | | // 注册并绑定用户 |
| | | user = appConnectService.registerAndBindUser(mobile, null, tempUid); |
| | | // ImConfigParam imConfig = sysConfigService.getSysConfigObject("IM_CONFIG", ImConfigParam.class); |
| | | // imTokenService.getImToken(imConfig,user,2); |
| | | try { |
| | | imProcess(user, 2); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | CdnTeamRelation teamRelation = cdnTeamRelationService.getOne(new LambdaQueryWrapper<CdnTeamRelation>().eq(CdnTeamRelation::getUserId, u.getUserId())); |
| | | CdnTeamRelation cdnTeamRelation = new CdnTeamRelation(); |
| | | cdnTeamRelation.setUserId(user.getUserId()); |
| | | cdnTeamRelation.setLevel(0); //初始等级为0 |
| | | cdnTeamRelation.setIsAdjust(1); |
| | | cdnTeamRelation.setAgentLevelId(1);// 初始用户代理等级为会员 |
| | | cdnTeamRelation.setPid(u.getUserId()); // 推荐人id |
| | | cdnTeamRelation.setJoinTime(new Date()); |
| | | cdnTeamRelation.setCreateTime(new Date()); |
| | | if (teamRelation != null) { //不为空时推荐人合计拼接推荐人的推荐人合计,为空时推荐人合计只有推荐人 |
| | | if (teamRelation.getPids() != null && !teamRelation.getPids().equals("")) { |
| | | cdnTeamRelation.setPids(teamRelation.getPids() + (u.getUserId() + ",")); // 推荐人合计id |
| | | cdnTeamRelation.setSort(teamRelation.getSort() + 1); |
| | | }else{ |
| | | cdnTeamRelation.setPid(u.getUserId()); // 推荐人id |
| | | cdnTeamRelation.setPids("," + u.getUserId() + ","); // 推荐人合计i |
| | | cdnTeamRelation.setSort(teamRelation.getSort() + 1); |
| | | } |
| | | }else{ |
| | | cdnTeamRelation.setPid(u.getUserId()); // 推荐人id |
| | | cdnTeamRelation.setPids("," + u.getUserId() + ","); // 推荐人合计i |
| | | cdnTeamRelation.setSort(1); |
| | | } |
| | | cdnTeamRelationService.save(cdnTeamRelation); |
| | | }else { |
| | | return ServerResponseEntity.showFailMsg("该邀请码无效!"); |
| | | } |
| | | }else { |
| | | // 注册并绑定用户 |
| | | // user = appConnectService.registerAndBindUser(mobile, null, tempUid); |
| | | // CdnTeamRelation cdnTeamRelation = new CdnTeamRelation(); |
| | | // cdnTeamRelation.setUserId(user.getUserId()); |
| | | // cdnTeamRelation.setLevel(0); //初始等级为0 |
| | | // cdnTeamRelation.setAgentLevelId(1);// 初始用户代理等级为会员 |
| | | // cdnTeamRelation.setPid("0"); // 推荐人id |
| | | // cdnTeamRelation.setCreateTime(new Date()); |
| | | // cdnTeamRelation.setSort(1); |
| | | // cdnTeamRelationService.save(cdnTeamRelation); |
| | | // if (Objects.equals(socialType, SocialType.MA.value()) || Objects.equals(socialType, SocialType.MP.value())) { |
| | | // appConnect = appConnectService.getByTempUid(tempUid); |
| | | // if (appConnect == null || appConnect.getUserId() != null) { |
| | | // return ServerResponseEntity.fail(ResponseEnum.TEMP_UID_ERROR); |
| | | // } |
| | | // } |
| | | return ServerResponseEntity.showFailMsg("请输入邀请码!"); |
| | | } |
| | | } else { |
| | | if (inviteCode != null && !Objects.equals(inviteCode, "")){ |
| | | return ServerResponseEntity.showFailMsg("该邀请码无效!"); |
| | | } |
| | | appConnect = checkAndGetAppConnect(user.getUserId(), socialType, tempUid); |
| | | user.setLoginTime(new Date()); |
| | | userService.updateById(user); |
| | | } |
| | | // 绑定 |
| | | TokenInfoVO tokenInfoVO = getTokenInfoVO(user, appConnect); |
| | | |
| | | try { |
| | | ImTokenInfo imTokenInfo = imProcess(user,1); |
| | | tokenInfoVO.setImToKen(imTokenInfo); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ServerResponseEntity.success(tokenInfoVO); |
| | | } |
| | | |
| | | @Async |
| | | ImTokenInfo imProcess(User user,Integer type) { |
| | | ImConfigParam imConfig = sysConfigService.getSysConfigObject("IM_CONFIG", ImConfigParam.class); |
| | | ImTokenInfo imTokenInfo = imTokenService.getImToken(imConfig, user,type); |
| | | return imTokenInfo; |
| | | } |
| | | |
| | | /** |
| | | * 登录并绑定用户 |
| | | */ |
| | | private AppConnect checkAndGetAppConnect(String userId, Integer socialType,String tempUid) { |
| | | // 只有微信公众号和小程序的登录会进行登录并绑定的操作 |
| | | if (!Objects.equals(socialType,SocialType.MA.value()) && !Objects.equals(socialType,SocialType.MP.value())) { |
| | | return null; |
| | | } |
| | | // 在SocialLoginController 当中,会返回一个tempUid用来换取openid的 |
| | | AppConnect appConnect = appConnectService.getByTempUid(tempUid); |
| | | if (appConnect == null) { |
| | | throw new YamiShopBindException(ResponseEnum.TEMP_UID_ERROR); |
| | | } |
| | | // 二合一登录,啥意思呢? |
| | | // 1. 绑定:将该账号和该微信的openId进行绑定 |
| | | // 2. 登录:返回token登录成功 |
| | | if (appConnect.getUserId() == null) { |
| | | appConnectMapper.bindUserIdByTempUid(userId, appConnect.getTempUid()); |
| | | } |
| | | // 如果有userId就判断下是不是一样的user,不是的话,不能够绑定 |
| | | else if (!Objects.equals(appConnect.getUserId(), userId)) { |
| | | throw new YamiShopBindException(ResponseEnum.SOCIAL_ACCOUNT_BIND_BY_OTHER); |
| | | } |
| | | return appConnect; |
| | | } |
| | | |
| | | private User getUser(String mobileOrUserName) { |
| | | User user = null; |
| | | // 手机验证码登陆,或传过来的账号很像手机号 |
| | | if (PrincipalUtil.isMobile(mobileOrUserName)) { |
| | | user = userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getUserMobile, mobileOrUserName)); |
| | | } |
| | | // 如果不是手机验证码登陆, 找不到手机号就找用户名 |
| | | if (PrincipalUtil.isUserName(mobileOrUserName)) { |
| | | user = userMapper.selectOneByUserName(mobileOrUserName); |
| | | } |
| | | // 如果不是手机验证码登陆, 找不到手机号就找用户名 |
| | | if (user == null) { |
| | | user = userMapper.selectOneByUserName(mobileOrUserName); |
| | | if (user == null) { |
| | | user = userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getUserId, mobileOrUserName)); |
| | | } |
| | | } |
| | | if (user == null) { |
| | | throw new YamiShopBindException("yami.user.account.error"); |
| | | } |
| | | return user; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 注册 |
| | | */ |
| | | private ServerResponseEntity register(String mobile,String tempUid, Integer socialType,String inviteCode) { |
| | | // 正在进行申请注册 |
| | | if (userService.count(new LambdaQueryWrapper<User>().eq(User::getUserMobile, mobile)) > 0) { |
| | | // 该手机号已注册,无法重新注册 |
| | | throw new YamiShopBindException("yami.user.phone.exist"); |
| | | } |
| | | |
| | | User user; |
| | | //绑定推荐人关系 |
| | | if (!Objects.equals(inviteCode, "") && inviteCode != null) { |
| | | // 根据邀请码查询推荐人信息 |
| | | User u = userService.getOne(new LambdaQueryWrapper<User>().eq(User::getInviteCode, inviteCode)); |
| | | if(u != null) { |
| | | // 注册并绑定用户 |
| | | user = appConnectService.registerAndBindUser(mobile, null, tempUid); |
| | | // ImConfigParam imConfig = sysConfigService.getSysConfigObject("IM_CONFIG", ImConfigParam.class); |
| | | // imTokenService.getImToken(imConfig,user,2); |
| | | try { |
| | | imProcess(user, 2); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | CdnTeamRelation teamRelation = cdnTeamRelationService.getOne(new LambdaQueryWrapper<CdnTeamRelation>().eq(CdnTeamRelation::getUserId, u.getUserId())); |
| | | CdnTeamRelation cdnTeamRelation = new CdnTeamRelation(); |
| | | cdnTeamRelation.setUserId(user.getUserId()); |
| | | cdnTeamRelation.setLevel(0); //初始等级为0 |
| | | cdnTeamRelation.setAgentLevelId(1);// 初始用户代理等级为会员 |
| | | cdnTeamRelation.setPid(u.getUserId()); // 推荐人id |
| | | cdnTeamRelation.setJoinTime(new Date()); |
| | | cdnTeamRelation.setCreateTime(new Date()); |
| | | if (teamRelation != null) { //不为空时推荐人合计拼接推荐人的推荐人合计,为空时推荐人合计只有推荐人 |
| | | if (teamRelation.getPids() != null && !teamRelation.getPids().equals("")) { |
| | | cdnTeamRelation.setPids(teamRelation.getPids() + (u.getUserId() + ",")); // 推荐人合计id |
| | | cdnTeamRelation.setSort(teamRelation.getSort() + 1); |
| | | }else{ |
| | | cdnTeamRelation.setPid(u.getUserId()); // 推荐人id |
| | | cdnTeamRelation.setPids("," + u.getUserId() + ","); // 推荐人合计i |
| | | cdnTeamRelation.setSort(teamRelation.getSort() + 1); |
| | | } |
| | | }else{ |
| | | cdnTeamRelation.setPid(u.getUserId()); // 推荐人id |
| | | cdnTeamRelation.setPids("," + u.getUserId() + ","); // 推荐人合计i |
| | | cdnTeamRelation.setSort(1); |
| | | } |
| | | cdnTeamRelationService.save(cdnTeamRelation); |
| | | return ServerResponseEntity.success(); |
| | | }else { |
| | | return ServerResponseEntity.showFailMsg("该邀请码无效!"); |
| | | } |
| | | }else { |
| | | return ServerResponseEntity.showFailMsg("请输入邀请码!"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.api.controller; |
| | | |
| | | import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.yami.shop.bean.model.User; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.response.ResponseEnum; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.config.WxConfig; |
| | | import com.yami.shop.security.api.vo.TokenWithTempUidVO; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.enums.SocialType; |
| | | import com.yami.shop.security.common.enums.SysTypeEnum; |
| | | import com.yami.shop.security.common.manager.TokenStore; |
| | | import com.yami.shop.security.common.model.AppConnect; |
| | | import com.yami.shop.security.common.service.AppConnectService; |
| | | import com.yami.shop.security.common.vo.TokenInfoVO; |
| | | import com.yami.shop.service.UserService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import me.chanjar.weixin.common.bean.WxOAuth2UserInfo; |
| | | import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken; |
| | | import me.chanjar.weixin.common.error.WxErrorException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 尝试使用社交账户登录 |
| | | * 如果登录成功,返回token信息 |
| | | * 如果登录失败,返回一个临时的uid,同时把openid之类的信息保存到数据库 |
| | | * |
| | | * 前提: |
| | | * 1. 如果在小程序注册,那么会直接绑定,下次打开不需要登录按钮进行登录(换了手机也会,只要是同一个微信号) |
| | | * 2. 如果用户直接输入账号密码登录,会直接跟这个用户进行绑定,会有退出登录按钮 |
| | | * 3. 如果退出登录的话,就要解除绑定,不然没办法退出登录 |
| | | * 4. 如果用户登录过一次,其实就已经绑定了,下次进入也是直接登录,不需要输入账号密码 |
| | | * 5. 如果用户在别的微信上登录过(也就是绑定过),需要在别人的微信上进行退出登录(解除绑定),才能在新的微信上登录(换手机不影响) |
| | | * |
| | | * 代码逻辑: |
| | | * 一进去小程序/微信公众号的时候会通过code获取openid(1.获取code不需要按钮的 2.code大概几分钟会过期)。 |
| | | * 如果没有openid就没办法进行支付。所以我们要在登录的时候把openid和token进行关联,通过token获取用户的userId和openid进行支付。 |
| | | * 但是会出现一种情况 比如在微信公众号是通过页面跳转获取code的,如果跳转完页面,用户一直在这个页面不去登录。后面再登录的时候已经code已经过期了。 |
| | | * 那怎么解决这种情况呢? |
| | | * |
| | | * 我们在拿到code的时候直接调用社交登录的接口,如/social/mp,/social/ma 这两个接口,会出现两种情况 |
| | | * 1. 如果通过code获取了openid,通过openid获取绑定的userid,如果能获取userid,那就直接登录,返回token。 |
| | | * 2. 如果没有获取到openid,就将这个openid保存用一个uuid关联起来,并保持到数据库。 |
| | | * 因为code会过期,数据库我们自己写的标识不会过期,将这个标识返回给前端(同时返回了A04001这个http状态,前端用tempUid保存起来)。 |
| | | * 前端进行登录的时候,用这个tempUid给到我们进行登录,这个时候用这个标识就能获取到数据库的openid了,也不会出现过期的情况。 |
| | | * 这个时候用openid可以关联登录信息、注册信息、绑定信息。 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2021/1/16 |
| | | */ |
| | | @RequestMapping("/social") |
| | | @RestController |
| | | @Tag(name = "微信code登录") |
| | | public class SocialLoginController { |
| | | |
| | | |
| | | @Autowired |
| | | private WxConfig wxConfig; |
| | | @Autowired |
| | | private AppConnectService appConnectService; |
| | | @Autowired |
| | | private TokenStore tokenStore; |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @PostMapping("/mp") |
| | | @Operation(summary = "公众号code登录", description = "通过公众号进行登录,只要在一进入到应用的时候调用微信登录的这个接口就行了,不要重复调用这个接口(不要在什么注册页面之类的地方再调用这个接口,打开应用的时候调用就已经足够了)" + |
| | | "1.返回状态码 A04001 社交账号未绑定,当前端看到该异常时,将该值tempUid存起来,并在应该在合适的时间(比如在购买的时候跳),跳转到登录的页面" + |
| | | "2.如果返回码是正常的登录成功,前端要保留原本已经存在的tempUid,如果有人切换登录的话,起码能够用这个tempUid重新获取openid进行绑定") |
| | | public ServerResponseEntity<TokenWithTempUidVO> mp(@RequestBody String code) throws WxErrorException { |
| | | Integer socialType = SocialType.MP.value(); |
| | | WxOAuth2AccessToken wxAccessToken = wxConfig.getWxMpService().getOAuth2Service().getAccessToken(code); |
| | | |
| | | AppConnect appConnect = appConnectService.getByBizUserId(wxAccessToken.getOpenId(), socialType); |
| | | if (appConnect != null && appConnect.getUserId() != null) { |
| | | return ServerResponseEntity.success(new TokenWithTempUidVO(appConnect.getTempUid(),getTokenVo(appConnect))); |
| | | } |
| | | String tempUid = IdUtil.simpleUUID(); |
| | | WxOAuth2UserInfo wxUserInfo = wxConfig.getWxMpService().getOAuth2Service().getUserInfo(wxAccessToken, null); |
| | | if (appConnect == null) { |
| | | appConnect = new AppConnect(); |
| | | } |
| | | appConnect.setAppId(socialType); |
| | | appConnect.setTempUid(tempUid); |
| | | appConnect.setNickName(wxUserInfo.getNickname()); |
| | | appConnect.setImageUrl(wxUserInfo.getHeadImgUrl()); |
| | | appConnect.setBizUserId(wxUserInfo.getOpenid()); |
| | | appConnect.setBizUnionid(wxUserInfo.getUnionId()); |
| | | appConnectService.saveOrUpdate(appConnect); |
| | | // 前端要保存这个tempUid |
| | | return ServerResponseEntity.success(new TokenWithTempUidVO(appConnect.getTempUid(), null)); |
| | | } |
| | | |
| | | @PostMapping("/ma") |
| | | @Operation(summary = "小程序code登录", description ="通过小程序进行登录,只要在一进入到应用的时候调用微信登录的这个接口就行了,不要重复调用这个接口(不要在什么注册页面之类的地方再调用这个接口,打开应用的时候调用就已经足够了)" + |
| | | "1.返回状态码 A04001 社交账号未绑定,当前端看到该异常时,将该值tempUid存起来,并在应该在合适的时间(比如在购买的时候跳),跳转到登录的页面" + |
| | | "2.如果返回码是正常的登录成功,前端要保留原本已经存在的tempUid,如果有人切换登录的话,起码能够用这个tempUid重新获取openid进行绑定") |
| | | public ServerResponseEntity<TokenWithTempUidVO> ma(@RequestBody String code) throws WxErrorException { |
| | | String recode = code.replaceAll("\"",""); |
| | | Integer socialType = SocialType.MA.value(); |
| | | WxMaJscode2SessionResult session = wxConfig.getWxMaService().getUserService().getSessionInfo(recode); |
| | | |
| | | AppConnect appConnect = appConnectService.getByBizUserId(session.getOpenid(), socialType); |
| | | if (appConnect != null && appConnect.getUserId() != null) { |
| | | return ServerResponseEntity.success(new TokenWithTempUidVO(appConnect.getTempUid(),getTokenVo(appConnect))); |
| | | } |
| | | |
| | | if (appConnect == null) { |
| | | appConnect = new AppConnect(); |
| | | } |
| | | String tempUid = IdUtil.simpleUUID(); |
| | | appConnect.setTempUid(tempUid); |
| | | appConnect.setAppId(socialType); |
| | | appConnect.setBizTempSession(session.getSessionKey()); |
| | | appConnect.setBizUserId(session.getOpenid()); |
| | | appConnect.setBizUnionid(session.getUnionid()); |
| | | appConnectService.saveOrUpdate(appConnect); |
| | | return ServerResponseEntity.success(new TokenWithTempUidVO(appConnect.getTempUid(), null)); |
| | | } |
| | | |
| | | |
| | | |
| | | private TokenInfoVO getTokenVo(AppConnect appConnect) { |
| | | User user = userService.getUserByUserId(appConnect.getUserId()); |
| | | UserInfoInTokenBO data = new UserInfoInTokenBO(); |
| | | data.setUserId(user.getUserId()); |
| | | data.setSysType(SysTypeEnum.ORDINARY.value()); |
| | | data.setBizUid(appConnect.getBizUnionid()); |
| | | data.setBizUserId(appConnect.getBizUserId()); |
| | | data.setSessionKey(appConnect.getBizTempSession()); |
| | | data.setSocialType(appConnect.getAppId()); |
| | | data.setEnabled(user.getStatus() == 1); |
| | | // 保存token,返回token数据给前端 |
| | | return tokenStore.storeAndGetVo(data); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.api.controller; |
| | | |
| | | import com.yami.shop.bean.model.Station; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.dto.AuthenticationDTO; |
| | | import com.yami.shop.security.common.enums.SysTypeEnum; |
| | | import com.yami.shop.security.common.manager.PasswordCheckManager; |
| | | import com.yami.shop.security.common.manager.PasswordManager; |
| | | import com.yami.shop.security.common.manager.TokenStore; |
| | | import com.yami.shop.security.common.vo.TokenInfoVO; |
| | | import com.yami.shop.service.StationService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/6/30 |
| | | */ |
| | | @RestController |
| | | @Tag(name = "自提点登录") |
| | | public class StationLoginController { |
| | | |
| | | @Autowired |
| | | private TokenStore tokenStore; |
| | | |
| | | @Autowired |
| | | private StationService stationService; |
| | | |
| | | @Autowired |
| | | private PasswordCheckManager passwordCheckManager; |
| | | |
| | | @Autowired |
| | | private PasswordManager passwordManager; |
| | | |
| | | @PostMapping("/stationLogin") |
| | | @Operation(summary = "自提点账号密码(用于前端登录)" , description = "通过账号/手机号/用户名密码登录") |
| | | public ServerResponseEntity<TokenInfoVO> login( |
| | | @Valid @RequestBody AuthenticationDTO authenticationDTO) { |
| | | |
| | | Station station = stationService.getStationInfoByAccount(authenticationDTO.getUserName()); |
| | | // 密码不正确 |
| | | if (Objects.isNull(station)){ |
| | | // 账号或密码不正确 |
| | | throw new YamiShopBindException("yami.user.account.error"); |
| | | } |
| | | String decryptPassword = passwordManager.decryptPassword(authenticationDTO.getPassWord()); |
| | | // 半小时内密码输入错误十次,已限制登录30分钟 |
| | | passwordCheckManager.checkPassword(SysTypeEnum.STATION,authenticationDTO.getUserName(), decryptPassword, station.getPassword()); |
| | | |
| | | if (!Objects.equals(station.getStatus(),1)){ |
| | | // 该自提点已关闭,请联系管理员 |
| | | throw new YamiShopBindException("yami.shop.station.close"); |
| | | } |
| | | UserInfoInTokenBO userInfoInToken = new UserInfoInTokenBO(); |
| | | userInfoInToken.setUserId(station.getStationId().toString()); |
| | | userInfoInToken.setOtherId(station.getStationId()); |
| | | userInfoInToken.setShopId(station.getShopId()); |
| | | userInfoInToken.setSysType(SysTypeEnum.STATION.value()); |
| | | userInfoInToken.setEnabled(true); |
| | | // 存储token返回vo |
| | | TokenInfoVO tokenInfoVO = tokenStore.storeAndGetVo(userInfoInToken); |
| | | return ServerResponseEntity.success(tokenInfoVO); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.api.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * 用于登陆传递账号密码 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2021/01/19 |
| | | */ |
| | | public class BindSocialDTO { |
| | | |
| | | @NotBlank |
| | | @Schema(description = "尝试社交登录的时候返回的tempUid" , required = true) |
| | | private String tempUid; |
| | | |
| | | @NotBlank |
| | | @Schema(description = "校验账号 手机号" , required = true) |
| | | private String validAccount; |
| | | |
| | | @Schema(description = "验证码" ) |
| | | private String validCode; |
| | | |
| | | public String getTempUid() { |
| | | return tempUid; |
| | | } |
| | | |
| | | public void setTempUid(String tempUid) { |
| | | this.tempUid = tempUid; |
| | | } |
| | | |
| | | public String getValidAccount() { |
| | | return validAccount; |
| | | } |
| | | |
| | | public void setValidAccount(String validAccount) { |
| | | this.validAccount = validAccount; |
| | | } |
| | | |
| | | public String getValidCode() { |
| | | return validCode; |
| | | } |
| | | |
| | | public void setValidCode(String validCode) { |
| | | this.validCode = validCode; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "BindSocialDTO{" + |
| | | "tempUid='" + tempUid + '\'' + |
| | | ", validAccount='" + validAccount + '\'' + |
| | | ", validCode='" + validCode + '\'' + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.api.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * 小程序通过code进行登录 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2022/09/06 |
| | | */ |
| | | @Data |
| | | public class MaCodeAuthenticationDTO{ |
| | | |
| | | |
| | | @NotBlank |
| | | @Schema(description = "临时的uid,微信公众号支付需要openid,但用户又不绑定社交账号,所以这个openId是临时的" ) |
| | | private String tempUid; |
| | | |
| | | @NotBlank |
| | | @Schema(description = "小程序通过getPhoneNumber方法获取的code" ) |
| | | private String code; |
| | | |
| | | @Schema(description = "推荐人邀请码") |
| | | private String inviteCode; |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.api.dto; |
| | | |
| | | import com.yami.shop.security.common.dto.AuthenticationDTO; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 用于登陆传递账号密码 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/1 |
| | | */ |
| | | @Data |
| | | public class SocialAuthenticationDTO extends AuthenticationDTO { |
| | | |
| | | |
| | | @Schema(description = "临时的uid,微信公众号支付需要openid,但用户又不绑定社交账号,所以这个openId是临时的" ) |
| | | private String tempUid; |
| | | |
| | | @Schema(description = "登录类型 0.普通的系统 1.小程序 2.公众号" ) |
| | | private Integer socialType; |
| | | |
| | | @Schema(description = "推荐人邀请码") |
| | | private String inviteCode; |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.api.model; |
| | | |
| | | import lombok.Data; |
| | | /** |
| | | * 用户详细信息 |
| | | * @author LGH |
| | | */ |
| | | @Data |
| | | public class YamiUser { |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private String userId; |
| | | |
| | | private String bizUserId; |
| | | |
| | | private Boolean enabled; |
| | | |
| | | /** |
| | | * 自提点Id |
| | | */ |
| | | private Long stationId; |
| | | |
| | | /** |
| | | * 店铺Id |
| | | */ |
| | | private Long shopId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.api.util; |
| | | |
| | | import com.yami.shop.security.api.model.YamiUser; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.util.AuthUserContext; |
| | | import lombok.experimental.UtilityClass; |
| | | |
| | | /** |
| | | * @author LGH |
| | | */ |
| | | @UtilityClass |
| | | public class SecurityUtils { |
| | | |
| | | private static final String USER_REQUEST = "/p/"; |
| | | |
| | | /** |
| | | * 获取用户 |
| | | */ |
| | | public YamiUser getUser() { |
| | | // if (!HttpContextUtils.getHttpServletRequest().getRequestURI().startsWith(USER_REQUEST)) { |
| | | // // 用户相关的请求,应该以/p开头!!! |
| | | // throw new RuntimeException("yami.user.request.error"); |
| | | // } |
| | | UserInfoInTokenBO userInfoInTokenBO = AuthUserContext.get(); |
| | | |
| | | YamiUser yamiUser = new YamiUser(); |
| | | yamiUser.setUserId(userInfoInTokenBO.getUserId()); |
| | | yamiUser.setBizUserId(userInfoInTokenBO.getBizUserId()); |
| | | yamiUser.setEnabled(userInfoInTokenBO.getEnabled()); |
| | | yamiUser.setShopId(userInfoInTokenBO.getShopId()); |
| | | yamiUser.setStationId(userInfoInTokenBO.getOtherId()); |
| | | return yamiUser; |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.api.vo; |
| | | |
| | | import com.yami.shop.security.common.vo.TokenInfoVO; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * token和tempUid |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2022/09/06 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class TokenWithTempUidVO { |
| | | |
| | | |
| | | @NotBlank |
| | | @Schema(description = "临时的uid,微信公众号支付需要openid,但用户又不绑定社交账号,所以这个openId是临时的" ) |
| | | private String tempUid; |
| | | |
| | | @NotBlank |
| | | @Schema(description = "小程序通过getPhoneNumber方法获取的code" ) |
| | | private TokenInfoVO tokenInfo; |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-security</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </parent> |
| | | |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>yami-shop-security-common</artifactId> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-service</artifactId> |
| | | <version>${yami.shop.version}</version> |
| | | </dependency> |
| | | <!--security--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-security</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.anji-plus</groupId> |
| | | <artifactId>captcha</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.adapter; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 实现该接口之后,修改需要授权登陆的路径,不需要授权登陆的路径 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/4 |
| | | */ |
| | | public interface AuthConfigAdapter { |
| | | |
| | | |
| | | /** |
| | | * 也许需要登录才可用的url |
| | | */ |
| | | String MAYBE_AUTH_URI = "/**/ma/**"; |
| | | |
| | | /** |
| | | * 需要授权登陆的路径 |
| | | * @return 需要授权登陆的路径列表 |
| | | */ |
| | | List<String> pathPatterns(); |
| | | |
| | | /** |
| | | * 不需要授权登陆的路径 |
| | | * @return 不需要授权登陆的路径列表 |
| | | */ |
| | | List<String> excludePathPatterns(); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.adapter; |
| | | |
| | | import com.anji.captcha.service.CaptchaCacheService; |
| | | import com.yami.shop.common.util.RedisUtil; |
| | | |
| | | /** |
| | | * 适配验证码在redis的存储 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/8/12 |
| | | */ |
| | | public class CaptchaCacheServiceRedisImpl implements CaptchaCacheService { |
| | | |
| | | @Override |
| | | public void set(String key, String value, long expiresInSeconds) { |
| | | RedisUtil.set(key, value, expiresInSeconds); |
| | | } |
| | | |
| | | @Override |
| | | public boolean exists(String key) { |
| | | return RedisUtil.hasKey(key); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(String key) { |
| | | RedisUtil.del(key); |
| | | } |
| | | |
| | | @Override |
| | | public String get(String key) { |
| | | return RedisUtil.get(key); |
| | | } |
| | | |
| | | @Override |
| | | public String type() { |
| | | return "redis"; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.adapter; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/16 |
| | | */ |
| | | public class DefaultAuthConfigAdapter implements AuthConfigAdapter { |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(DefaultAuthConfigAdapter.class); |
| | | |
| | | public DefaultAuthConfigAdapter() { |
| | | logger.info("not implement other AuthConfigAdapter, use DefaultAuthConfigAdapter... all url need auth..."); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> pathPatterns() { |
| | | return Collections.singletonList("/*"); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> excludePathPatterns() { |
| | | return Collections.emptyList(); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.adapter; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
| | | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; |
| | | import org.springframework.security.config.http.SessionCreationPolicy; |
| | | import org.springframework.security.web.SecurityFilterChain; |
| | | import org.springframework.web.cors.CorsUtils; |
| | | |
| | | /** |
| | | * 使用security的防火墙功能,但不使用security的认证授权登录 |
| | | * @author FrozenWatermelon |
| | | */ |
| | | @Configuration |
| | | @EnableWebSecurity |
| | | public class LuckWebSecurityConfigurerAdapter { |
| | | |
| | | @Bean |
| | | public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{ |
| | | return http.csrf().disable().cors() // We don't need CSRF for token based authentication |
| | | .and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) |
| | | .and().authorizeRequests().requestMatchers(CorsUtils::isPreFlightRequest).permitAll() |
| | | .and() |
| | | .authorizeRequests().antMatchers( |
| | | "/**").permitAll().and().build(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.adapter; |
| | | |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 实现该接口之后,修改需要授权登陆的路径,不需要授权登陆的路径 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/4 |
| | | */ |
| | | public interface SignAuthAdapter { |
| | | |
| | | /** |
| | | * 补充用户信息 |
| | | * @param dataMap 请求数据 |
| | | * @return |
| | | */ |
| | | UserInfoInTokenBO loadUserInfoInToken(Map<String, Object> dataMap); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.bo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 签名校验完毕之后返回的信息 |
| | | * @author FrozenWatermelon |
| | | * @date 2021/12/29 |
| | | */ |
| | | @Data |
| | | public class SignResponse { |
| | | |
| | | /** |
| | | * 改写后的http请求信息,如果是json格式的数据的话,这边是需要进行改写的 |
| | | */ |
| | | private HttpServletRequest req; |
| | | /** |
| | | * data所在那一层的map数据 |
| | | */ |
| | | private Map<String, Object> dataMap; |
| | | |
| | | private String appSecret; |
| | | |
| | | private Long timestamp; |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.bo; |
| | | |
| | | |
| | | /** |
| | | * token信息,该信息存在redis中 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/2 |
| | | */ |
| | | public class TokenInfoBO { |
| | | |
| | | /** |
| | | * 保存在token信息里面的用户信息 |
| | | */ |
| | | private UserInfoInTokenBO userInfoInToken; |
| | | |
| | | private String accessToken; |
| | | |
| | | private String refreshToken; |
| | | |
| | | /** |
| | | * 在多少秒后过期 |
| | | */ |
| | | private Integer expiresIn; |
| | | |
| | | public UserInfoInTokenBO getUserInfoInToken() { |
| | | return userInfoInToken; |
| | | } |
| | | |
| | | public void setUserInfoInToken(UserInfoInTokenBO userInfoInToken) { |
| | | this.userInfoInToken = userInfoInToken; |
| | | } |
| | | |
| | | public String getAccessToken() { |
| | | return accessToken; |
| | | } |
| | | |
| | | public void setAccessToken(String accessToken) { |
| | | this.accessToken = accessToken; |
| | | } |
| | | |
| | | public String getRefreshToken() { |
| | | return refreshToken; |
| | | } |
| | | |
| | | public void setRefreshToken(String refreshToken) { |
| | | this.refreshToken = refreshToken; |
| | | } |
| | | |
| | | public Integer getExpiresIn() { |
| | | return expiresIn; |
| | | } |
| | | |
| | | public void setExpiresIn(Integer expiresIn) { |
| | | this.expiresIn = expiresIn; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TokenInfoBO{" + "userInfoInToken=" + userInfoInToken + ", accessToken='" + accessToken + '\'' |
| | | + ", refreshToken='" + refreshToken + '\'' + ", expiresIn=" + expiresIn + '}'; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.bo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 保存在token信息里面的用户信息 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/3 |
| | | */ |
| | | @Data |
| | | public class UserInfoInTokenBO { |
| | | |
| | | /** |
| | | * 用户在自己系统的用户id |
| | | */ |
| | | private String userId; |
| | | |
| | | /** |
| | | * 租户id (商家id) |
| | | */ |
| | | private Long shopId; |
| | | |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | private String nikeName; |
| | | |
| | | /** |
| | | * 系统类型 |
| | | * @see com.yami.shop.security.common.enums.SysTypeEnum |
| | | */ |
| | | private Integer sysType; |
| | | |
| | | /** |
| | | * 是否是管理员 |
| | | */ |
| | | private Integer isAdmin; |
| | | |
| | | private String bizUserId; |
| | | |
| | | private String bizUid; |
| | | |
| | | /** |
| | | * 第三方系统类型 见com.yami.shop.security.common.enums.SocialType |
| | | */ |
| | | private Integer socialType; |
| | | |
| | | /** |
| | | * 小程序session_key |
| | | */ |
| | | private String sessionKey; |
| | | |
| | | /** |
| | | * 权限列表 |
| | | */ |
| | | private Set<String> perms; |
| | | |
| | | /** |
| | | * 状态 1 正常 0 无效 |
| | | */ |
| | | private Boolean enabled; |
| | | |
| | | /** |
| | | * 其他Id |
| | | */ |
| | | private Long otherId; |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.config; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.yami.shop.security.common.adapter.AuthConfigAdapter; |
| | | import com.yami.shop.security.common.adapter.DefaultAuthConfigAdapter; |
| | | import com.yami.shop.security.common.filter.AuthFilter; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| | | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; |
| | | |
| | | import javax.servlet.DispatcherType; |
| | | |
| | | /** |
| | | * 授权配置 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/11 |
| | | */ |
| | | @Configuration |
| | | @EnableGlobalMethodSecurity(prePostEnabled=true) |
| | | public class AuthConfig { |
| | | |
| | | @Autowired |
| | | private AuthFilter authFilter; |
| | | |
| | | @Bean |
| | | @ConditionalOnMissingBean |
| | | public AuthConfigAdapter authConfigAdapter() { |
| | | return new DefaultAuthConfigAdapter(); |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | @Lazy |
| | | public FilterRegistrationBean<AuthFilter> filterRegistration(AuthConfigAdapter authConfigAdapter) { |
| | | FilterRegistrationBean<AuthFilter> registration = new FilterRegistrationBean<>(); |
| | | // 添加过滤器 |
| | | registration.setFilter(authFilter); |
| | | // 设置过滤路径,/*所有路径 |
| | | registration.addUrlPatterns(ArrayUtil.toArray(authConfigAdapter.pathPatterns(), String.class)); |
| | | registration.setName("authFilter"); |
| | | // 设置优先级 |
| | | registration.setOrder(0); |
| | | registration.setDispatcherTypes(DispatcherType.REQUEST); |
| | | return registration; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.config; |
| | | |
| | | import com.anji.captcha.model.common.CaptchaTypeEnum; |
| | | import com.anji.captcha.model.common.Const; |
| | | import com.anji.captcha.service.CaptchaService; |
| | | import com.anji.captcha.service.impl.CaptchaServiceFactory; |
| | | import com.anji.captcha.util.ImageUtils; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.io.Resource; |
| | | import org.springframework.core.io.support.PathMatchingResourcePatternResolver; |
| | | import org.springframework.util.Base64Utils; |
| | | import org.springframework.util.FileCopyUtils; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/8/12 |
| | | */ |
| | | @Configuration |
| | | public class CaptchaConfig { |
| | | |
| | | @Bean |
| | | public CaptchaService captchaService() { |
| | | Properties config = new Properties(); |
| | | config.put(Const.CAPTCHA_CACHETYPE, "redis"); |
| | | config.put(Const.CAPTCHA_WATER_MARK, ""); |
| | | // 滑动验证 |
| | | config.put(Const.CAPTCHA_TYPE, CaptchaTypeEnum.BLOCKPUZZLE.getCodeValue()); |
| | | config.put(Const.CAPTCHA_INIT_ORIGINAL, "true"); |
| | | initializeBaseMap(); |
| | | return CaptchaServiceFactory.getInstance(config); |
| | | } |
| | | |
| | | private static void initializeBaseMap() { |
| | | ImageUtils.cacheBootImage(getResourcesImagesFile("classpath:captcha" + "/original/*.png"), getResourcesImagesFile("classpath:captcha" + "/slidingBlock/*.png"), Collections.emptyMap()); |
| | | } |
| | | |
| | | public static Map<String, String> getResourcesImagesFile(String path) { |
| | | Map<String, String> imgMap = new HashMap<>(16); |
| | | PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); |
| | | |
| | | try { |
| | | Resource[] resources = resolver.getResources(path); |
| | | Resource[] var4 = resources; |
| | | int var5 = resources.length; |
| | | |
| | | for(int var6 = 0; var6 < var5; ++var6) { |
| | | Resource resource = var4[var6]; |
| | | byte[] bytes = FileCopyUtils.copyToByteArray(resource.getInputStream()); |
| | | String string = Base64Utils.encodeToString(bytes); |
| | | String filename = resource.getFilename(); |
| | | imgMap.put(filename, string); |
| | | } |
| | | } catch (Exception var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return imgMap; |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.cors.CorsConfiguration; |
| | | import org.springframework.web.cors.CorsConfigurationSource; |
| | | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | @Configuration |
| | | public class CorsConfig { |
| | | |
| | | /** |
| | | * 修改为添加而不是设置,* 最好生产环境改为实际的需要, 这里可以用多个add配置多个域名 |
| | | * configuration.addAllowedOrigin("http://localhost:8080"); |
| | | * configuration.addAllowedOrigin("http://192.168.1.6:8080"); |
| | | * @return CorsConfigurationSource |
| | | */ |
| | | @Bean |
| | | public CorsConfigurationSource corsConfigurationSource() { |
| | | CorsConfiguration configuration = new CorsConfiguration(); |
| | | // configuration.addAllowedOrigin("*"); |
| | | configuration.addAllowedOriginPattern("*"); |
| | | //修改为添加而不是设置 |
| | | configuration.addAllowedMethod("*"); |
| | | //这里很重要,起码需要允许 Access-Control-Allow-Origin |
| | | configuration.addAllowedHeader("*"); |
| | | configuration.setAllowCredentials(true); |
| | | configuration.setMaxAge(3600 * 24L); |
| | | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); |
| | | source.registerCorsConfiguration("/**", configuration); |
| | | return source; |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.security.crypto.factory.PasswordEncoderFactories; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/3 |
| | | */ |
| | | @Configuration |
| | | public class PasswordConfig { |
| | | |
| | | @Bean |
| | | public PasswordEncoder passwordEncoder(){ |
| | | return PasswordEncoderFactories.createDelegatingPasswordEncoder(); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.config; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springdoc.core.GroupedOpenApi; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * Swagger文档,只有在测试环境才会使用 |
| | | * @author LGH |
| | | */ |
| | | @Configuration("securitySwaggerConfiguration") |
| | | @AllArgsConstructor |
| | | public class SwaggerConfiguration { |
| | | |
| | | |
| | | @Bean |
| | | public GroupedOpenApi securityRestApi() { |
| | | return GroupedOpenApi.builder() |
| | | .group("登录接口") |
| | | .packagesToScan("com.yami.shop.security") |
| | | .pathsToMatch("/**") |
| | | .build(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.controller; |
| | | |
| | | import com.anji.captcha.model.common.RepCodeEnum; |
| | | import com.anji.captcha.model.common.ResponseModel; |
| | | import com.anji.captcha.model.vo.CaptchaVO; |
| | | import com.anji.captcha.service.CaptchaService; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/30 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/captcha") |
| | | @Tag(name = "验证码") |
| | | public class CaptchaController { |
| | | |
| | | private final CaptchaService captchaService; |
| | | |
| | | public CaptchaController(CaptchaService captchaService) { |
| | | this.captchaService = captchaService; |
| | | } |
| | | |
| | | @PostMapping({ "/get" }) |
| | | public ServerResponseEntity<ResponseModel> get(@RequestBody CaptchaVO captchaVO) { |
| | | return ServerResponseEntity.success(captchaService.get(captchaVO)); |
| | | } |
| | | |
| | | @PostMapping({ "/check" }) |
| | | public ServerResponseEntity<ResponseModel> check(@RequestBody CaptchaVO captchaVO) { |
| | | ResponseModel responseModel; |
| | | try { |
| | | responseModel = captchaService.check(captchaVO); |
| | | }catch (Exception e) { |
| | | return ServerResponseEntity.success(ResponseModel.errorMsg(RepCodeEnum.API_CAPTCHA_COORDINATE_ERROR)); |
| | | } |
| | | return ServerResponseEntity.success(responseModel); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.controller; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.enums.SocialType; |
| | | import com.yami.shop.security.common.manager.TokenStore; |
| | | import com.yami.shop.security.common.service.AppConnectService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/6/30 |
| | | */ |
| | | @RestController |
| | | @Tag(name = "注销") |
| | | public class LogoutController { |
| | | |
| | | @Autowired |
| | | private TokenStore tokenStore; |
| | | @Autowired |
| | | private AppConnectService appConnectService; |
| | | |
| | | @PostMapping("/logOut") |
| | | @Operation(summary = "退出登陆" , description = "点击退出登陆,清除token,清除菜单缓存") |
| | | public ServerResponseEntity<Void> logOut(HttpServletRequest request) { |
| | | String accessToken = request.getHeader("Authorization"); |
| | | if (StrUtil.isBlank(accessToken)) { |
| | | return ServerResponseEntity.success(); |
| | | } |
| | | |
| | | // 当前登录的用户信息 |
| | | UserInfoInTokenBO userInfoInToken = tokenStore.getUserInfoByAccessToken(accessToken, true); |
| | | |
| | | // 删除该用户在该系统当前的token(退出登录) |
| | | tokenStore.deleteCurrentToken(accessToken); |
| | | |
| | | // 只有微信公众号和小程序的登录会进行登录并绑定的操作 |
| | | if (!Objects.equals(userInfoInToken.getSocialType(), SocialType.MA.value()) && !Objects.equals(userInfoInToken.getSocialType(),SocialType.MP.value())) { |
| | | return ServerResponseEntity.success(); |
| | | } |
| | | |
| | | // 解除绑定的用户 |
| | | appConnectService.unBindUser(userInfoInToken.getBizUserId(), userInfoInToken.getSocialType()); |
| | | |
| | | return ServerResponseEntity.success(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.controller; |
| | | |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.security.common.bo.TokenInfoBO; |
| | | import com.yami.shop.security.common.dto.RefreshTokenDTO; |
| | | import com.yami.shop.security.common.manager.TokenStore; |
| | | import com.yami.shop.security.common.vo.TokenInfoVO; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import ma.glasnost.orika.MapperFacade; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/6/30 |
| | | */ |
| | | @RestController |
| | | @Tag(name = "token") |
| | | public class TokenController { |
| | | |
| | | @Autowired |
| | | private TokenStore tokenStore; |
| | | |
| | | @Autowired |
| | | private MapperFacade mapperFacade; |
| | | |
| | | @PostMapping("/token/refresh") |
| | | public ServerResponseEntity<TokenInfoVO> refreshToken(@Valid @RequestBody RefreshTokenDTO refreshTokenDTO) { |
| | | TokenInfoBO tokenInfoServerResponseEntity = tokenStore |
| | | .refreshToken(refreshTokenDTO.getRefreshToken()); |
| | | return ServerResponseEntity |
| | | .success(mapperFacade.map(tokenInfoServerResponseEntity, TokenInfoVO.class)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.security.common.model.AppConnect; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface AppConnectMapper extends BaseMapper<AppConnect> { |
| | | |
| | | /** |
| | | * 根据第三方userId和第三方系统id获取用户关联第三方信息 |
| | | * |
| | | * @param bizUserId 第三方用户id |
| | | * @param appId 第三方系统id |
| | | * @return 用户关联第三方信息 |
| | | */ |
| | | AppConnect getByBizUserId(@Param("bizUserId") String bizUserId, @Param("appId") Integer appId); |
| | | |
| | | /** |
| | | * 根据第三方userId和第三方系统id获取用户关联第三方信息 |
| | | * |
| | | * @param userId 用户id |
| | | * @param appId 第三方系统id |
| | | * @return 用户关联第三方信息 |
| | | */ |
| | | AppConnect getByUserId(@Param("userId") String userId, @Param("appId") Integer appId); |
| | | |
| | | /** |
| | | * 获取用户id |
| | | * |
| | | * @param bizUnionId 第三方userId |
| | | * @return 用户关联第三方信息 |
| | | */ |
| | | String getUserIdByUnionId(@Param("bizUnionId") String bizUnionId); |
| | | |
| | | /** |
| | | * 修改用户第三方登录信息 |
| | | * |
| | | * @param appConnect 用户第三方登录信息 |
| | | */ |
| | | void updateByBizUserIdAndAppId(@Param("appConnect") AppConnect appConnect); |
| | | |
| | | /** |
| | | * 获取根据尝试社交登录时,保存的临时的uid获取社交 |
| | | * |
| | | * @param tempUid tempUid |
| | | * @return 用户社交账号信息 |
| | | */ |
| | | AppConnect getByTempUid(@Param("tempUid") String tempUid); |
| | | |
| | | /** |
| | | * 绑定社交账号,通过tempuid |
| | | * |
| | | * @param userId userId |
| | | * @param tempUid tempUid |
| | | */ |
| | | void bindUserIdByTempUid(@Param("userId") String userId, @Param("tempUid") String tempUid); |
| | | |
| | | /** |
| | | * 解除用户绑定 |
| | | * |
| | | * @param bizUserId openid |
| | | * @param socialType 社交账号类型 |
| | | */ |
| | | void unBindUser(@Param("bizUserId") String bizUserId, @Param("socialType") Integer socialType); |
| | | |
| | | /** |
| | | * 解除用户绑定 |
| | | * |
| | | * @param userId 用户id |
| | | */ |
| | | void unBindUserByUserId(@Param("userId") String userId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * 用于登陆传递账号密码 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/1 |
| | | */ |
| | | @Data |
| | | public class AuthenticationDTO { |
| | | |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | @NotBlank(message = "userName不能为空") |
| | | @Schema(description = "用户名/邮箱/手机号" , required = true) |
| | | protected String userName; |
| | | |
| | | /** |
| | | * 密码 |
| | | */ |
| | | @NotBlank(message = "passWord不能为空") |
| | | @Schema(description = "一般用作密码" , required = true) |
| | | protected String passWord; |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * 刷新token |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/1 |
| | | */ |
| | | public class RefreshTokenDTO { |
| | | |
| | | /** |
| | | * refreshToken |
| | | */ |
| | | @NotBlank(message = "refreshToken不能为空") |
| | | @Schema(description = "refreshToken" , required = true) |
| | | private String refreshToken; |
| | | |
| | | public String getRefreshToken() { |
| | | return refreshToken; |
| | | } |
| | | |
| | | public void setRefreshToken(String refreshToken) { |
| | | this.refreshToken = refreshToken; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "RefreshTokenDTO{" + "refreshToken='" + refreshToken + '\'' + '}'; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.enums; |
| | | |
| | | /** |
| | | * 第三方系统类型 |
| | | * @author FrozenWatermelon |
| | | * @date 2021/01/16 |
| | | */ |
| | | public enum SocialType { |
| | | |
| | | /** |
| | | * 普通用户系统 |
| | | */ |
| | | ORDINARY(0), |
| | | |
| | | /** |
| | | * 小程序 |
| | | */ |
| | | MA(1), |
| | | |
| | | /** |
| | | * 公众号 |
| | | */ |
| | | MP(2), |
| | | |
| | | ; |
| | | |
| | | private final Integer value; |
| | | |
| | | public Integer value() { |
| | | return value; |
| | | } |
| | | |
| | | SocialType(Integer value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.enums; |
| | | |
| | | /** |
| | | * 系统类型 |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/2 |
| | | */ |
| | | public enum SysTypeEnum { |
| | | |
| | | /** |
| | | * 普通用户系统 |
| | | */ |
| | | ORDINARY(0), |
| | | |
| | | /** |
| | | * 商家端 |
| | | */ |
| | | MULTISHOP(1), |
| | | |
| | | /** |
| | | * 平台端 |
| | | */ |
| | | PLATFORM(2), |
| | | |
| | | /** |
| | | * 自提点 |
| | | */ |
| | | STATION(3) |
| | | |
| | | ; |
| | | |
| | | private final Integer value; |
| | | |
| | | public Integer value() { |
| | | return value; |
| | | } |
| | | |
| | | SysTypeEnum(Integer value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.even; |
| | | |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 签名访问事件 |
| | | * @author LHD |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | public class SysSignEvent { |
| | | |
| | | /** |
| | | * 积分日志类型 |
| | | */ |
| | | private UserInfoInTokenBO userInfoInTokenBO; |
| | | |
| | | /** |
| | | * 积分数额 |
| | | */ |
| | | private HttpServletRequest req; |
| | | |
| | | /** |
| | | * 积分数额 |
| | | */ |
| | | private String accessId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.filter; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.handler.HttpHandler; |
| | | import com.yami.shop.common.response.ResponseEnum; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.common.util.Json; |
| | | import com.yami.shop.common.wrapper.ResponseWrapper; |
| | | import com.yami.shop.security.common.adapter.AuthConfigAdapter; |
| | | import com.yami.shop.security.common.adapter.SignAuthAdapter; |
| | | import com.yami.shop.security.common.bo.SignResponse; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.manager.TokenStore; |
| | | import com.yami.shop.security.common.util.AuthUserContext; |
| | | import com.yami.shop.security.common.util.SignUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.AntPathMatcher; |
| | | |
| | | import javax.servlet.*; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 授权过滤,只要实现AuthConfigAdapter接口,添加对应路径即可: |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/11 |
| | | */ |
| | | @Component |
| | | public class AuthFilter implements Filter { |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(AuthFilter.class); |
| | | |
| | | @Autowired |
| | | private AuthConfigAdapter authConfigAdapter; |
| | | |
| | | @Autowired |
| | | private HttpHandler httpHandler; |
| | | |
| | | @Autowired |
| | | private TokenStore tokenStore; |
| | | |
| | | @Autowired |
| | | private SignAuthAdapter signAuthAdapter; |
| | | |
| | | @Autowired |
| | | private SignUtils signUtils; |
| | | |
| | | public static final String AUTHORIZATION = "Authorization"; |
| | | |
| | | @Override |
| | | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
| | | throws IOException, ServletException { |
| | | HttpServletRequest req = (HttpServletRequest) request; |
| | | HttpServletResponse resp = (HttpServletResponse) response; |
| | | |
| | | String requestUri = req.getRequestURI(); |
| | | |
| | | List<String> excludePathPatterns = authConfigAdapter.excludePathPatterns(); |
| | | AntPathMatcher pathMatcher = new AntPathMatcher(); |
| | | // 如果匹配不需要授权的路径,就不需要校验是否需要授权 |
| | | if (CollectionUtil.isNotEmpty(excludePathPatterns)) { |
| | | for (String excludePathPattern : excludePathPatterns) { |
| | | if (pathMatcher.match(excludePathPattern, requestUri)) { |
| | | chain.doFilter(req, resp); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | String accessToken = req.getHeader(AUTHORIZATION); |
| | | String grantType = req.getHeader(SignUtils.GRANT_TYPE); |
| | | // 也许需要登录,不登陆也能用的uri |
| | | // 比如优惠券接口,登录的时候可以判断是否已经领取过 |
| | | // 不能登录的时候会看所有的优惠券,等待领取的时候再登录 |
| | | boolean mayAuth = pathMatcher.match(AuthConfigAdapter.MAYBE_AUTH_URI, requestUri); |
| | | |
| | | try { |
| | | // 通过签名访问 |
| | | if (Objects.equals(grantType, SignUtils.GRANT_TYPE_VALUE)) { |
| | | signAccess(chain, req, resp); |
| | | } |
| | | |
| | | // 如果有token,就要获取token |
| | | else if (StrUtil.isNotBlank(accessToken)) { |
| | | // token访问 |
| | | // 这个方法不是controller里面的方法,所以抛出来的异常不会被捕获 |
| | | UserInfoInTokenBO userInfoInToken = tokenStore.getUserInfoByAccessToken(accessToken, true); |
| | | // 保存上下文 |
| | | AuthUserContext.set(userInfoInToken); |
| | | |
| | | chain.doFilter(req, resp); |
| | | } |
| | | |
| | | else if (!mayAuth) { |
| | | // 返回前端未授权 |
| | | httpHandler.printServerResponseToWeb(ServerResponseEntity.fail(ResponseEnum.UNAUTHORIZED)); |
| | | return; |
| | | } |
| | | } |
| | | catch (Exception e) { |
| | | if (e instanceof YamiShopBindException) { |
| | | httpHandler.printServerResponseToWeb((YamiShopBindException) e); |
| | | return; |
| | | } |
| | | throw e; |
| | | } |
| | | finally { |
| | | AuthUserContext.clean(); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void signAccess(FilterChain chain, HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { |
| | | UserInfoInTokenBO userInfoInToken; |
| | | ServerResponseEntity<SignResponse> verifyResponse = signUtils.verify(req); |
| | | SignResponse signResponse = verifyResponse.getData(); |
| | | long timestamp = System.currentTimeMillis(); |
| | | |
| | | if (!verifyResponse.isSuccess()) { |
| | | verifyResponse.setSign(SignUtils.sign(signResponse.getAppSecret(), timestamp, null)); |
| | | verifyResponse.setTimestamp(timestamp); |
| | | verifyResponse.setData(null); |
| | | httpHandler.printServerResponseToWeb(ServerResponseEntity.success(Json.toJsonString(verifyResponse))); |
| | | } |
| | | userInfoInToken = signAuthAdapter.loadUserInfoInToken(signResponse.getDataMap()); |
| | | // 保存上下文 |
| | | AuthUserContext.set(userInfoInToken); |
| | | ResponseWrapper responseWrapper = new ResponseWrapper(resp); |
| | | chain.doFilter(signResponse.getReq(), responseWrapper); |
| | | byte[] content = responseWrapper.getContent(); |
| | | // 获取相应数据 |
| | | String data = null; |
| | | if (content.length > 0) { |
| | | data = new String(content, StandardCharsets.UTF_8); |
| | | } |
| | | ServerResponseEntity<String> successResponse; |
| | | if (responseWrapper.getStatus() != Constant.SUCCESS_CODE) { |
| | | successResponse = ServerResponseEntity.showFailMsg(data); |
| | | } else { |
| | | successResponse = ServerResponseEntity.success(data); |
| | | } |
| | | successResponse.setSign(SignUtils.sign(signResponse.getAppSecret(), timestamp, data)); |
| | | successResponse.setTimestamp(timestamp); |
| | | successResponse.setData(data); |
| | | httpHandler.printServerResponseToWeb(successResponse); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.manager; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.util.IPHelper; |
| | | import com.yami.shop.common.util.RedisUtil; |
| | | import com.yami.shop.security.common.enums.SysTypeEnum; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2021/11/11 |
| | | */ |
| | | @Component |
| | | public class PasswordCheckManager { |
| | | |
| | | |
| | | @Autowired |
| | | private PasswordEncoder passwordEncoder; |
| | | |
| | | /** |
| | | * 半小时内最多错误10次 |
| | | */ |
| | | private static final int TIMES_CHECK_INPUT_PASSWORD_NUM = 10; |
| | | |
| | | /** |
| | | * 检查用户输入错误的验证码次数 |
| | | */ |
| | | private static final String CHECK_VALID_CODE_NUM_PREFIX = "checkUserInputErrorPassword_"; |
| | | public void checkPassword(SysTypeEnum sysTypeEnum,String userNameOrMobile, String rawPassword, String encodedPassword) { |
| | | |
| | | String checkPrefix = sysTypeEnum.value() + CHECK_VALID_CODE_NUM_PREFIX + IPHelper.getIpAddr(); |
| | | |
| | | int count = 0; |
| | | if(RedisUtil.hasKey(checkPrefix + userNameOrMobile)){ |
| | | count = RedisUtil.get(checkPrefix + userNameOrMobile); |
| | | } |
| | | if(count > TIMES_CHECK_INPUT_PASSWORD_NUM){ |
| | | // 半小时内密码输入错误十次,已限制登录30分钟 |
| | | throw new YamiShopBindException("yami.login.password.check"); |
| | | } |
| | | // 半小时后失效 |
| | | RedisUtil.set(checkPrefix + userNameOrMobile,count,1800); |
| | | // 密码不正确 |
| | | if (StrUtil.isBlank(encodedPassword) || !passwordEncoder.matches(rawPassword,encodedPassword)){ |
| | | count++; |
| | | // 半小时后失效 |
| | | RedisUtil.set(checkPrefix + userNameOrMobile,count,1800); |
| | | // 账号或密码不正确 |
| | | throw new YamiShopBindException("yami.user.account.error"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.manager; |
| | | |
| | | import cn.hutool.crypto.symmetric.AES; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | /** |
| | | * @author 菠萝凤梨 |
| | | * @date 2022/1/19 16:02 |
| | | */ |
| | | @Component |
| | | public class PasswordManager { |
| | | private static final Logger logger = LoggerFactory.getLogger(PasswordManager.class); |
| | | |
| | | /** |
| | | * 用于aes签名的key,16位 |
| | | */ |
| | | @Value("${auth.password.signKey:-mall4j-password}") |
| | | public String passwordSignKey; |
| | | |
| | | public String decryptPassword(String data) { |
| | | AES aes = new AES(passwordSignKey.getBytes(StandardCharsets.UTF_8)); |
| | | String decryptStr; |
| | | String decryptPassword; |
| | | try { |
| | | decryptStr = aes.decryptStr(data); |
| | | decryptPassword = decryptStr.substring(13); |
| | | } catch (Exception e) { |
| | | logger.error("Exception:", e); |
| | | throw new YamiShopBindException("AES解密错误", e); |
| | | } |
| | | return decryptPassword; |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.manager; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.util.BooleanUtil; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.crypto.symmetric.AES; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.yami.shop.bean.dto.DeviceTokenData; |
| | | import com.yami.shop.bean.dto.PCDNDeviceTokenDTO; |
| | | import com.yami.shop.common.bean.CDNDevice; |
| | | import com.yami.shop.common.constants.OauthCacheNames; |
| | | import com.yami.shop.common.constants.PCDNConstant; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.response.ResponseEnum; |
| | | import com.yami.shop.common.util.Json; |
| | | import com.yami.shop.common.util.PrincipalUtil; |
| | | import com.yami.shop.config.ShopConfig; |
| | | import com.yami.shop.security.common.bo.TokenInfoBO; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.enums.SysTypeEnum; |
| | | import com.yami.shop.security.common.vo.TokenInfoVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisCallback; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; |
| | | import org.springframework.data.redis.serializer.RedisSerializer; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * token管理 1. 登陆返回token 2. 刷新token 3. 清除用户过去token 4. 校验token |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/2 |
| | | */ |
| | | @Component |
| | | public class TokenStore { |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(TokenStore.class); |
| | | |
| | | /** |
| | | * 用于aes签名的key,16位 |
| | | */ |
| | | @Value("${auth.token.signKey:-mall4j--mall4j-}") |
| | | public String tokenSignKey; |
| | | |
| | | private final RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | private final RedisSerializer<Object> redisSerializer; |
| | | |
| | | private final StringRedisTemplate stringRedisTemplate; |
| | | |
| | | @Autowired |
| | | private ShopConfig cdnConfig; |
| | | |
| | | |
| | | public TokenStore(RedisTemplate<String, Object> redisTemplate, |
| | | StringRedisTemplate stringRedisTemplate, GenericJackson2JsonRedisSerializer genericJackson2JsonRedisSerializer) { |
| | | this.redisTemplate = redisTemplate; |
| | | this.redisSerializer = genericJackson2JsonRedisSerializer; |
| | | this.stringRedisTemplate = stringRedisTemplate; |
| | | } |
| | | |
| | | /** |
| | | * 将用户的部分信息存储在token中,并返回token信息 |
| | | * |
| | | * @param userInfoInToken 用户在token中的信息 |
| | | * @return token信息 |
| | | */ |
| | | public TokenInfoBO storeAccessToken(UserInfoInTokenBO userInfoInToken) { |
| | | TokenInfoBO tokenInfoBO = new TokenInfoBO(); |
| | | String accessToken = IdUtil.simpleUUID(); |
| | | String refreshToken = IdUtil.simpleUUID(); |
| | | |
| | | tokenInfoBO.setUserInfoInToken(userInfoInToken); |
| | | tokenInfoBO.setExpiresIn(getExpiresIn(userInfoInToken.getSysType())); |
| | | |
| | | String uidToAccessKeyStr = getUserIdToAccessKey(getApprovalKey(userInfoInToken)); |
| | | String accessKeyStr = getAccessKey(accessToken); |
| | | String refreshToAccessKeyStr = getRefreshToAccessKey(refreshToken); |
| | | |
| | | // 一个用户会登陆很多次,每次登陆的token都会存在 uid_to_access里面 |
| | | // 但是每次保存都会更新这个key的时间,而key里面的token有可能会过期,过期就要移除掉 |
| | | List<byte[]> existsAccessTokensBytes = new ArrayList<>(); |
| | | // 新的token数据 |
| | | existsAccessTokensBytes.add((accessToken + StrUtil.COLON + refreshToken).getBytes(StandardCharsets.UTF_8)); |
| | | |
| | | Long size = redisTemplate.opsForSet().size(uidToAccessKeyStr); |
| | | if (size != null && size != 0) { |
| | | List<String> tokenInfoBoList = stringRedisTemplate.opsForSet().pop(uidToAccessKeyStr, size); |
| | | if (tokenInfoBoList != null) { |
| | | for (String accessTokenWithRefreshToken : tokenInfoBoList) { |
| | | String[] accessTokenWithRefreshTokenArr = accessTokenWithRefreshToken.split(StrUtil.COLON); |
| | | String accessTokenData = accessTokenWithRefreshTokenArr[0]; |
| | | if (BooleanUtil.isTrue(stringRedisTemplate.hasKey(getAccessKey(accessTokenData)))) { |
| | | existsAccessTokensBytes.add(accessTokenWithRefreshToken.getBytes(StandardCharsets.UTF_8)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | redisTemplate.executePipelined((RedisCallback<Object>) connection -> { |
| | | |
| | | long expiresIn = tokenInfoBO.getExpiresIn(); |
| | | |
| | | byte[] uidKey = uidToAccessKeyStr.getBytes(StandardCharsets.UTF_8); |
| | | byte[] refreshKey = refreshToAccessKeyStr.getBytes(StandardCharsets.UTF_8); |
| | | byte[] accessKey = accessKeyStr.getBytes(StandardCharsets.UTF_8); |
| | | |
| | | connection.sAdd(uidKey, ArrayUtil.toArray(existsAccessTokensBytes, byte[].class)); |
| | | |
| | | // 通过uid + sysType 保存access_token,当需要禁用用户的时候,可以根据uid + sysType 禁用用户 |
| | | connection.expire(uidKey, expiresIn); |
| | | |
| | | // 通过refresh_token获取用户的access_token从而刷新token |
| | | connection.setEx(refreshKey, expiresIn, accessToken.getBytes(StandardCharsets.UTF_8)); |
| | | |
| | | // 通过access_token保存用户的租户id,用户id,uid |
| | | connection.setEx(accessKey, expiresIn, Objects.requireNonNull(redisSerializer.serialize(userInfoInToken))); |
| | | |
| | | return null; |
| | | }); |
| | | |
| | | // 返回给前端是加密的token |
| | | tokenInfoBO.setAccessToken(encryptToken(accessToken, userInfoInToken.getSysType())); |
| | | tokenInfoBO.setRefreshToken(encryptToken(refreshToken, userInfoInToken.getSysType())); |
| | | |
| | | return tokenInfoBO; |
| | | } |
| | | |
| | | private int getExpiresIn(int sysType) { |
| | | // 3600秒(1小时) |
| | | int expiresIn = 3600; |
| | | |
| | | // 普通用户token过期时间 1小时 * 24 * 30 = 30天 |
| | | if (Objects.equals(sysType, SysTypeEnum.ORDINARY.value())) { |
| | | expiresIn = expiresIn * 24 * 30; |
| | | } |
| | | // 系统管理员的token过期时间 1小时 * 24 * 30 = 30天 |
| | | if (Objects.equals(sysType, SysTypeEnum.MULTISHOP.value()) || Objects.equals(sysType, SysTypeEnum.PLATFORM.value()) || Objects.equals(sysType, SysTypeEnum.STATION.value())) { |
| | | expiresIn = expiresIn * 24 * 30; |
| | | } |
| | | return expiresIn; |
| | | } |
| | | |
| | | /** |
| | | * 根据accessToken 获取用户信息 |
| | | * |
| | | * @param accessToken accessToken |
| | | * @param needDecrypt 是否需要解密 |
| | | * @return 用户信息 |
| | | */ |
| | | public UserInfoInTokenBO getUserInfoByAccessToken(String accessToken, boolean needDecrypt) { |
| | | if (StrUtil.isBlank(accessToken)) { |
| | | throw new YamiShopBindException(ResponseEnum.UNAUTHORIZED, "accessToken is blank"); |
| | | } |
| | | String realAccessToken; |
| | | if (needDecrypt) { |
| | | realAccessToken = decryptToken(accessToken); |
| | | } else { |
| | | realAccessToken = accessToken; |
| | | } |
| | | UserInfoInTokenBO userInfoInTokenBO = (UserInfoInTokenBO) redisTemplate.opsForValue() |
| | | .get(getAccessKey(realAccessToken)); |
| | | |
| | | if (userInfoInTokenBO == null) { |
| | | throw new YamiShopBindException(ResponseEnum.UNAUTHORIZED, "登录过期,请重新登录"); |
| | | } |
| | | return userInfoInTokenBO; |
| | | } |
| | | |
| | | /** |
| | | * 刷新token,并返回新的token |
| | | * |
| | | * @param refreshToken |
| | | * @return |
| | | */ |
| | | public TokenInfoBO refreshToken(String refreshToken) { |
| | | if (StrUtil.isBlank(refreshToken)) { |
| | | throw new YamiShopBindException(ResponseEnum.UNAUTHORIZED, "refreshToken is blank"); |
| | | } |
| | | String realRefreshToken = decryptToken(refreshToken); |
| | | String accessToken = stringRedisTemplate.opsForValue().get(getRefreshToAccessKey(realRefreshToken)); |
| | | |
| | | if (StrUtil.isBlank(accessToken)) { |
| | | throw new YamiShopBindException(ResponseEnum.UNAUTHORIZED, "登录过期,请重新登录"); |
| | | } |
| | | UserInfoInTokenBO userInfoInTokenBO = getUserInfoByAccessToken(accessToken, |
| | | false); |
| | | |
| | | // 删除旧的refresh_token |
| | | stringRedisTemplate.delete(getRefreshToAccessKey(realRefreshToken)); |
| | | // 删除旧的access_token |
| | | stringRedisTemplate.delete(getAccessKey(accessToken)); |
| | | // 保存一份新的token |
| | | return storeAccessToken(userInfoInTokenBO); |
| | | } |
| | | |
| | | /** |
| | | * 删除全部的token |
| | | */ |
| | | public void deleteAllToken(String sysType, String userId) { |
| | | String uidKey = getUserIdToAccessKey(getApprovalKey(sysType, userId)); |
| | | Long size = redisTemplate.opsForSet().size(uidKey); |
| | | if (size == null || size == 0) { |
| | | return; |
| | | } |
| | | List<String> tokenInfoBoList = stringRedisTemplate.opsForSet().pop(uidKey, size); |
| | | |
| | | if (CollUtil.isEmpty(tokenInfoBoList)) { |
| | | return; |
| | | } |
| | | |
| | | for (String accessTokenWithRefreshToken : tokenInfoBoList) { |
| | | String[] accessTokenWithRefreshTokenArr = accessTokenWithRefreshToken.split(StrUtil.COLON); |
| | | String accessToken = accessTokenWithRefreshTokenArr[0]; |
| | | String refreshToken = accessTokenWithRefreshTokenArr[1]; |
| | | redisTemplate.delete(getRefreshToAccessKey(refreshToken)); |
| | | redisTemplate.delete(getAccessKey(accessToken)); |
| | | } |
| | | redisTemplate.delete(uidKey); |
| | | |
| | | } |
| | | |
| | | private static String getApprovalKey(UserInfoInTokenBO userInfoInToken) { |
| | | return getApprovalKey(userInfoInToken.getSysType().toString(), userInfoInToken.getUserId()); |
| | | } |
| | | |
| | | private static String getApprovalKey(String sysType, String userId) { |
| | | return userId == null ? sysType : sysType + StrUtil.COLON + userId; |
| | | } |
| | | |
| | | private String encryptToken(String accessToken, Integer sysType) { |
| | | AES aes = new AES(tokenSignKey.getBytes(StandardCharsets.UTF_8)); |
| | | return aes.encryptBase64(accessToken + System.currentTimeMillis() + sysType); |
| | | } |
| | | |
| | | private String decryptToken(String data) { |
| | | AES aes = new AES(tokenSignKey.getBytes(StandardCharsets.UTF_8)); |
| | | String decryptStr; |
| | | String decryptToken; |
| | | try { |
| | | decryptStr = aes.decryptStr(data); |
| | | decryptToken = decryptStr.substring(0, 32); |
| | | // 创建token的时间,token使用时效性,防止攻击者通过一堆的尝试找到aes的密码,虽然aes是目前几乎最好的加密算法 |
| | | long createTokenTime = Long.parseLong(decryptStr.substring(32, 45)); |
| | | // 系统类型 |
| | | int sysType = Integer.parseInt(decryptStr.substring(45)); |
| | | // token的过期时间 |
| | | int expiresIn = getExpiresIn(sysType); |
| | | long second = 1000L; |
| | | if (System.currentTimeMillis() - createTokenTime > expiresIn * second) { |
| | | throw new YamiShopBindException(ResponseEnum.UNAUTHORIZED, "token error"); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new YamiShopBindException(ResponseEnum.UNAUTHORIZED, "token error"); |
| | | } |
| | | |
| | | // 防止解密后的token是脚本,从而对redis进行攻击,uuid只能是数字和小写字母 |
| | | if (!PrincipalUtil.isSimpleChar(decryptToken)) { |
| | | throw new YamiShopBindException(ResponseEnum.UNAUTHORIZED, "token error"); |
| | | } |
| | | return decryptToken; |
| | | } |
| | | |
| | | public String getAccessKey(String accessToken) { |
| | | return OauthCacheNames.ACCESS + accessToken; |
| | | } |
| | | |
| | | public String getUserIdToAccessKey(String approvalKey) { |
| | | return OauthCacheNames.UID_TO_ACCESS + approvalKey; |
| | | } |
| | | |
| | | public String getRefreshToAccessKey(String refreshToken) { |
| | | return OauthCacheNames.REFRESH_TO_ACCESS + refreshToken; |
| | | } |
| | | |
| | | public TokenInfoVO storeAndGetVo(UserInfoInTokenBO userInfoInToken) { |
| | | if (!userInfoInToken.getEnabled()) { |
| | | // 用户已禁用,请联系客服 |
| | | throw new YamiShopBindException("yami.user.disabled"); |
| | | } |
| | | TokenInfoBO tokenInfoBO = storeAccessToken(userInfoInToken); |
| | | |
| | | TokenInfoVO tokenInfoVO = new TokenInfoVO(); |
| | | tokenInfoVO.setAccessToken(tokenInfoBO.getAccessToken()); |
| | | tokenInfoVO.setRefreshToken(tokenInfoBO.getRefreshToken()); |
| | | tokenInfoVO.setExpiresIn(tokenInfoBO.getExpiresIn()); |
| | | return tokenInfoVO; |
| | | } |
| | | |
| | | public void deleteCurrentToken(String accessToken) { |
| | | String decryptToken = decryptToken(accessToken); |
| | | |
| | | UserInfoInTokenBO userInfoInToken = getUserInfoByAccessToken(accessToken, true); |
| | | |
| | | String uidKey = getUserIdToAccessKey(getApprovalKey(userInfoInToken.getSysType().toString(), userInfoInToken.getUserId())); |
| | | Long size = redisTemplate.opsForSet().size(uidKey); |
| | | if (size == null || size == 0) { |
| | | return; |
| | | } |
| | | List<String> tokenInfoBoList = stringRedisTemplate.opsForSet().pop(uidKey, size); |
| | | |
| | | if (CollUtil.isEmpty(tokenInfoBoList)) { |
| | | return; |
| | | } |
| | | String dbAccessToken = null; |
| | | String dbRefreshToken = null; |
| | | List<byte[]> list = new ArrayList<>(); |
| | | for (String accessTokenWithRefreshToken : tokenInfoBoList) { |
| | | String[] accessTokenWithRefreshTokenArr = accessTokenWithRefreshToken.split(StrUtil.COLON); |
| | | dbAccessToken = accessTokenWithRefreshTokenArr[0]; |
| | | if (decryptToken.equals(dbAccessToken)) { |
| | | dbRefreshToken = accessTokenWithRefreshTokenArr[1]; |
| | | redisTemplate.delete(getRefreshToAccessKey(dbRefreshToken)); |
| | | redisTemplate.delete(getAccessKey(dbAccessToken)); |
| | | continue; |
| | | } |
| | | list.add(accessTokenWithRefreshToken.getBytes(StandardCharsets.UTF_8)); |
| | | } |
| | | |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | redisTemplate.executePipelined((RedisCallback<Object>) connection -> { |
| | | |
| | | connection.sAdd(uidKey.getBytes(StandardCharsets.UTF_8), ArrayUtil.toArray(list, byte[].class)); |
| | | return null; |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 获取PCDN接口调用需要的token信息 |
| | | public String getToken() { |
| | | CDNDevice cdnDevice = cdnConfig.getCDNDevice(); |
| | | String cacheToken = stringRedisTemplate.opsForValue().get(PCDNConstant.PCDN_TOKEN_CONSTANT + cdnDevice.getTelephone()); |
| | | if (StrUtil.isNotBlank(cacheToken)) { |
| | | return cacheToken; |
| | | } |
| | | logger.info("重新获取token信息:{}", cdnDevice); |
| | | PCDNDeviceTokenDTO pcdnDeviceTokenDTO = new PCDNDeviceTokenDTO(); |
| | | pcdnDeviceTokenDTO.setTelephone(cdnDevice.getTelephone()); |
| | | pcdnDeviceTokenDTO.setPassword(cdnDevice.getPassword()); |
| | | pcdnDeviceTokenDTO.setAppId(cdnDevice.getAppId()); |
| | | String post = HttpUtil.post(cdnDevice.getUrl(), Json.toJsonString(pcdnDeviceTokenDTO)); |
| | | if (StrUtil.isNotBlank(post)) { |
| | | //PCDNDeviceData<DeviceTokenData> pcdnDeviceData = JSONObject.parseObject(post, PCDNDeviceData.class); |
| | | JSONObject json = JSONObject.parseObject(post); |
| | | if (null != json) { |
| | | Integer code = json.getInteger("code"); |
| | | if (Objects.equals(code, PCDNConstant.PCDN_API_RESPONSE_CODE)) { |
| | | String data = json.getString("data"); |
| | | DeviceTokenData deviceTokenData = JSONObject.parseObject(data, DeviceTokenData.class); |
| | | String token = deviceTokenData.getToken(); |
| | | logger.info("pcdn token is: " + token); |
| | | // 将获取的token信息缓存,过期日期是1天 |
| | | stringRedisTemplate.opsForValue().set("pcdn-key:" + cdnDevice.getTelephone(), token, 1 * 60 * 60 * 24, TimeUnit.SECONDS); |
| | | return token; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.model; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | @Data |
| | | @TableName("tz_app_connect") |
| | | public class AppConnect { |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId |
| | | private Long id; |
| | | |
| | | /** |
| | | * 本系统userId |
| | | */ |
| | | |
| | | private String userId; |
| | | |
| | | /** |
| | | * 第三方系统id 1:微信小程序 |
| | | */ |
| | | |
| | | private Integer appId; |
| | | |
| | | /** |
| | | * 第三方系统昵称 |
| | | */ |
| | | |
| | | private String nickName; |
| | | |
| | | /** |
| | | * 第三方系统头像 |
| | | */ |
| | | |
| | | private String imageUrl; |
| | | |
| | | /** |
| | | * 第三方系统userid |
| | | */ |
| | | |
| | | private String bizUserId; |
| | | |
| | | /** |
| | | * 第三方系统unionid |
| | | */ |
| | | |
| | | private String bizUnionid; |
| | | |
| | | private String tempUid; |
| | | |
| | | private String bizTempSession; |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.model; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | @Data |
| | | @Schema(description = "更新密码参数") |
| | | public class UpdatePasswordDto { |
| | | |
| | | @NotBlank(message="旧密码不能为空") |
| | | @Size(max = 50) |
| | | @Schema(description = "旧密码" ,required=true) |
| | | private String password; |
| | | |
| | | @NotBlank(message="新密码不能为空") |
| | | @Size(max = 50) |
| | | @Schema(description = "新密码" ,required=true) |
| | | private String newPassword; |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.model; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | @Data |
| | | @Schema(description = "用户名和密码参数") |
| | | public class UsernameAndPasswordDto { |
| | | |
| | | @NotBlank(message="用户名不能为空") |
| | | @Size(max = 50) |
| | | @Schema(description = "用户名" ,required=true) |
| | | private String username; |
| | | |
| | | @NotBlank(message="密码不能为空") |
| | | @Size(max = 50) |
| | | @Schema(description = "密码" ,required=true) |
| | | private String password; |
| | | |
| | | @NotBlank(message="验证码不能为空") |
| | | @Size(max = 50) |
| | | @Schema(description = "验证码" ,required=true) |
| | | private String code; |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.permission; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.yami.shop.bean.event.PermissionErrorHandleEvent; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.util.AuthUserContext; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.PatternMatchUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | /** |
| | | * 接口权限判断工具 |
| | | * @author FrozenWatermelon |
| | | */ |
| | | @Slf4j |
| | | @Component("pms") |
| | | public class PermissionService { |
| | | |
| | | @Autowired |
| | | private ApplicationContext applicationContext; |
| | | |
| | | /** |
| | | * 判断接口是否有xxx:xxx权限 |
| | | * |
| | | * @param permission 权限 |
| | | * @return {boolean} |
| | | */ |
| | | public boolean hasPermission(String permission) { |
| | | if (StrUtil.isBlank(permission)) { |
| | | return false; |
| | | } |
| | | // 框架处理会抛出异常在前端提示:服务器出了小差,请稍后重试 |
| | | // 所以没有权限,就自行处理并抛出异常,且告诉用户缺失的菜单权限是哪些,同时避免服务器异常的提示 |
| | | UserInfoInTokenBO userInfoInTokenBO = AuthUserContext.get(); |
| | | boolean hasPermission = userInfoInTokenBO.getPerms() |
| | | .stream() |
| | | .filter(StringUtils::hasText) |
| | | .anyMatch(x -> PatternMatchUtils.simpleMatch(permission, x)); |
| | | if(!hasPermission) { |
| | | applicationContext.publishEvent(new PermissionErrorHandleEvent(permission, userInfoInTokenBO.getShopId())); |
| | | } |
| | | return hasPermission; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.User; |
| | | import com.yami.shop.bean.param.UserExcelParam; |
| | | import com.yami.shop.bean.param.UserRegisterExcelParam; |
| | | import com.yami.shop.security.common.model.AppConnect; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * |
| | | * @author lgh on 2018/09/07. |
| | | */ |
| | | public interface AppConnectService extends IService<AppConnect> { |
| | | |
| | | /** |
| | | * 根据第三方userId和第三方系统id获取用户关联第三方信息 |
| | | * @param bizUserId 第三方userId |
| | | * @param appId 第三方系统id |
| | | * @return 用户关联第三方信息 |
| | | */ |
| | | AppConnect getByBizUserId(String bizUserId, Integer appId); |
| | | |
| | | /** |
| | | * 用户注册并绑定第三方账号 |
| | | * @param mobile 手机号 |
| | | * @param password 密码 |
| | | * @param tempUid 用来找到openid进行关联 |
| | | * @return |
| | | */ |
| | | User registerAndBindUser(String mobile, String password, String tempUid); |
| | | |
| | | User registerAndBindUserNick(String mobile, String password, String tempUid, String nickName); |
| | | |
| | | /** |
| | | * 批量注册用户 |
| | | * @param userList 用户列表 |
| | | * @param repeatPhoneSet 重复手机号信息 |
| | | * @param repeatMailSet 重复邮箱信息 |
| | | * @return 结果 |
| | | */ |
| | | Integer batchRegisterUser(UserExcelParam params, List<UserRegisterExcelParam> userList, Set<String> repeatPhoneSet, Set<String> repeatMailSet); |
| | | |
| | | /** |
| | | * 获取根据尝试社交登录时,保存的临时的uid获取社交信息 |
| | | * |
| | | * @param tempUid tempUid |
| | | * @return 用户社交账号信息 |
| | | */ |
| | | AppConnect getByTempUid(String tempUid); |
| | | |
| | | /** |
| | | * 解除用户绑定 |
| | | * @param bizUserId openid |
| | | * @param socialType 社交账号类型 |
| | | */ |
| | | void unBindUser(String bizUserId, Integer socialType); |
| | | } |
New file |
| | |
| | | package com.yami.shop.security.common.service; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.http.HttpUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.yami.shop.bean.model.User; |
| | | import com.yami.shop.bean.param.im.ImConfigParam; |
| | | import com.yami.shop.security.common.vo.ImTokenInfo; |
| | | import com.yami.shop.service.UserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @Slf4j |
| | | public class ImTokenService { |
| | | private static final ObjectMapper objectMapper = new ObjectMapper(); |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 获取IM服务的Token信息。 |
| | | * |
| | | * @param imConfig IM配置参数 |
| | | * @param user 用户 |
| | | * @return ImTokenInfo IM服务的Token信息 |
| | | */ |
| | | |
| | | public ImTokenInfo getImToken(ImConfigParam imConfig, User user, Integer type) { // type 1.登录 2 注册 |
| | | // 构造请求参数 |
| | | // 假设HttpUtil类已经定义并实现了get方法用于发起GET请求 |
| | | String response = ""; |
| | | Map<String, String> queryParams = new HashMap<>(); |
| | | queryParams.put("id", user.getUserId()); |
| | | queryParams.put("userName", user.getUserMobile()); |
| | | queryParams.put("password", "!QAZXSW@#EDC"); |
| | | User userInfo = userService.getById(user.getUserId()); |
| | | switch (type){ |
| | | case 1: |
| | | queryParams.put("terminal", "1"); |
| | | response = HttpUtil.post(imConfig.getIp() + imConfig.getLogin(), JSONUtil.parse(queryParams).toString()); |
| | | if (!response.contains("200")){ |
| | | queryParams.put("nickName", user.getNickName()); |
| | | response = HttpUtil.post(imConfig.getIp() + imConfig.getRegister(), JSONUtil.parse(queryParams).toString()); |
| | | if (ObjectUtil.isNotEmpty(userInfo)) { |
| | | userInfo.setPayPassword(null); |
| | | this.updateImUserInfo(userInfo, imConfig); |
| | | } |
| | | break; |
| | | } |
| | | break; |
| | | case 2: |
| | | queryParams.put("nickName", user.getNickName()); |
| | | System.out.println( JSONUtil.parse(queryParams).toString()); |
| | | response = HttpUtil.post(imConfig.getIp() + imConfig.getRegister(), JSONUtil.parse(queryParams).toString()); |
| | | |
| | | if (ObjectUtil.isNotEmpty(userInfo)) { |
| | | userInfo.setPayPassword(null); |
| | | this.updateImUserInfo(userInfo, imConfig); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | // 根据响应处理逻辑,解析出Token信息 |
| | | ImTokenInfo tokenInfo = parseResponse(response); |
| | | |
| | | return tokenInfo; |
| | | } |
| | | |
| | | /** |
| | | * 解析HTTP响应并提取Token信息。 |
| | | * |
| | | * @param response HTTP响应体 |
| | | * @return ImTokenInfo 解析后的Token信息 |
| | | */ |
| | | private ImTokenInfo parseResponse(String response) { |
| | | try { |
| | | // 解析外层的JSON对象 |
| | | Map<String, Object> outerMap = objectMapper.readValue(response, Map.class); |
| | | // 获取"data"字段 |
| | | Map<String, Object> dataMap = (Map<String, Object>) outerMap.get("data"); |
| | | if (ObjectUtil.isNotEmpty(dataMap)) { |
| | | // 将"data"字段转换为ImTokenInfo对象 |
| | | ImTokenInfo tokenInfo = objectMapper.convertValue(dataMap, ImTokenInfo.class); |
| | | return tokenInfo; |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void updateImUserInfo(User user,ImConfigParam imConfig) { |
| | | String response = ""; |
| | | Map<String, String> queryParams = new HashMap<>(); |
| | | queryParams.put("id", user.getUserId()); |
| | | queryParams.put("userName", user.getUserMobile()); |
| | | queryParams.put("nickName", user.getNickName()); |
| | | queryParams.put("headImage", user.getPic()); |
| | | queryParams.put("terminal", "1"); |
| | | queryParams.put("sex", user.getSex()); |
| | | response = HttpUtil.post(imConfig.getIp() + imConfig.getSetUserInfo(), JSONUtil.parse(queryParams).toString()); |
| | | ImTokenInfo tokenInfo = parseResponse(response); |
| | | System.out.println(tokenInfo); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.service.impl; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yami.shop.bean.event.LevelUpEvent; |
| | | import com.yami.shop.bean.event.UserRegisterLogEvent; |
| | | import com.yami.shop.bean.model.CdnUserWallet; |
| | | import com.yami.shop.bean.model.User; |
| | | import com.yami.shop.bean.model.UserExtension; |
| | | import com.yami.shop.bean.param.UserExcelParam; |
| | | import com.yami.shop.bean.param.UserRegisterExcelParam; |
| | | import com.yami.shop.common.enums.WalletEnum; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.i18n.I18nMessage; |
| | | import com.yami.shop.common.util.IPHelper; |
| | | import com.yami.shop.dao.CdnUserWalletMapper; |
| | | import com.yami.shop.dao.UserExtensionMapper; |
| | | import com.yami.shop.dao.UserMapper; |
| | | import com.yami.shop.security.common.dao.AppConnectMapper; |
| | | import com.yami.shop.security.common.manager.PasswordManager; |
| | | import com.yami.shop.security.common.model.AppConnect; |
| | | import com.yami.shop.security.common.service.AppConnectService; |
| | | import com.yami.shop.service.UserExtensionService; |
| | | import com.yami.shop.service.UserService; |
| | | import lombok.AllArgsConstructor; |
| | | import ma.glasnost.orika.MapperFacade; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @author lgh on 2018/09/07. |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class AppConnectServiceImpl extends ServiceImpl<AppConnectMapper, AppConnect> implements AppConnectService { |
| | | |
| | | private final AppConnectMapper appConnectMapper; |
| | | private final ApplicationContext applicationContext; |
| | | |
| | | private final UserMapper userMapper; |
| | | private final UserService userService; |
| | | private final UserExtensionMapper userExtensionMapper; |
| | | private final UserExtensionService userExtensionService; |
| | | private final PasswordEncoder passwordEncoder; |
| | | private final MapperFacade mapperFacade; |
| | | private final PasswordManager passwordManager; |
| | | private final CdnUserWalletMapper cdnUserWalletMapper; |
| | | |
| | | /** |
| | | * YamiUserServiceImpl#insertUserIfNecessary 将会清除该缓存信息 |
| | | * @param bizUserId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AppConnect getByBizUserId(String bizUserId, Integer appId) { |
| | | return appConnectMapper.getByBizUserId(bizUserId, appId); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public User registerAndBindUser(String mobile, String password, String tempUid) { |
| | | // 新建用户 |
| | | User user = new User(); |
| | | user.setModifyTime(new Date()); |
| | | user.setUserRegtime(new Date()); |
| | | user.setUserRegip(IPHelper.getIpAddr()); |
| | | user.setStatus(1); |
| | | user.setUserMobile(mobile); |
| | | if (StrUtil.isNotBlank(password)) { |
| | | if (!password.matches("[^\\u4e00-\\u9fa5]+")) { |
| | | // 密码中包含中文字符 |
| | | throw new YamiShopBindException(I18nMessage.getMessage("密码不能包含中文字符!")); |
| | | } |
| | | user.setLoginPassword(passwordEncoder.encode(password)); |
| | | } |
| | | // 昵称默认位u + 手机尾号后4位 |
| | | user.setNickName("u" + mobile.substring(7)); |
| | | // String userId = IdUtil.simpleUUID(); |
| | | System.out.println(userMapper.selectMaxId()); |
| | | String userId = userMapper.selectMaxId(); |
| | | user.setUserId(userId); |
| | | user.setLevel(1); |
| | | user.setLevelType(0); |
| | | //淘宝联盟接入时 需要long类型的userId |
| | | user.setUserCode(Long.parseLong(String.valueOf(userId.hashCode()&Integer.MAX_VALUE))); |
| | | userMapper.insert(user); |
| | | CdnUserWallet flow = new CdnUserWallet(); |
| | | flow.setMoney(BigDecimal.ZERO); |
| | | flow.setUserId(userId); |
| | | flow.setWalletId(WalletEnum.FLOW.value()); |
| | | flow.setCreateTime(new Date()); |
| | | cdnUserWalletMapper.insert(flow); |
| | | |
| | | CdnUserWallet goldCowBean = new CdnUserWallet(); |
| | | goldCowBean.setMoney(BigDecimal.ZERO); |
| | | goldCowBean.setUserId(userId); |
| | | goldCowBean.setWalletId(WalletEnum.GOLDCOWBEAN.value()); |
| | | goldCowBean.setCreateTime(new Date()); |
| | | cdnUserWalletMapper.insert(goldCowBean); |
| | | |
| | | CdnUserWallet luckPool = new CdnUserWallet(); |
| | | luckPool.setMoney(BigDecimal.ZERO); |
| | | luckPool.setUserId(userId); |
| | | luckPool.setWalletId(WalletEnum.LUCKPOOL.value()); |
| | | luckPool.setCreateTime(new Date()); |
| | | cdnUserWalletMapper.insert(luckPool); |
| | | |
| | | CdnUserWallet integral = new CdnUserWallet(); |
| | | integral.setMoney(BigDecimal.ZERO); |
| | | integral.setUserId(userId); |
| | | integral.setWalletId(WalletEnum.INTEGRAL.value()); |
| | | integral.setCreateTime(new Date()); |
| | | cdnUserWalletMapper.insert(integral); |
| | | |
| | | UserExtension userExtension = new UserExtension(); |
| | | userExtension.setBalance(0.0); |
| | | userExtension.setTotalBalance(0.0); |
| | | userExtension.setGrowth(0); |
| | | userExtension.setLevel(1); |
| | | userExtension.setLevelType(0); |
| | | userExtension.setScore(0L); |
| | | userExtension.setUpdateTime(new Date()); |
| | | userExtension.setVersion(0); |
| | | userExtension.setSignDay(0); |
| | | userExtension.setUserId(userId); |
| | | userExtensionMapper.insert(userExtension); |
| | | //用户注册成功后发送等级提升事件 |
| | | applicationContext.publishEvent(new LevelUpEvent(userExtension,1,0)); |
| | | if (StrUtil.isNotBlank(tempUid)) { |
| | | appConnectMapper.bindUserIdByTempUid(user.getUserId(), tempUid); |
| | | } |
| | | return user; |
| | | } |
| | | |
| | | @Override |
| | | public User registerAndBindUserNick(String mobile, String password, String tempUid, String nickName) { |
| | | // 新建用户 |
| | | User user = new User(); |
| | | user.setModifyTime(new Date()); |
| | | user.setUserRegtime(new Date()); |
| | | user.setUserRegip(IPHelper.getIpAddr()); |
| | | user.setStatus(1); |
| | | user.setUserMobile(mobile); |
| | | if (StrUtil.isNotBlank(password)) { |
| | | if (!password.matches("[^\\u4e00-\\u9fa5]+")) { |
| | | // 密码中包含中文字符 |
| | | throw new YamiShopBindException(I18nMessage.getMessage("密码不能包含中文字符!")); |
| | | } |
| | | user.setLoginPassword(passwordEncoder.encode(password)); |
| | | } |
| | | // 昵称默认位u + 手机尾号后4位 |
| | | if(!StringUtils.isEmpty(nickName)){////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| | | user.setNickName(nickName); |
| | | }else{ |
| | | user.setNickName("u" + mobile.substring(7)); |
| | | } |
| | | // String userId = IdUtil.simpleUUID(); |
| | | System.out.println(userMapper.selectMaxId()); |
| | | String userId = userMapper.selectMaxId(); |
| | | user.setUserId(userId); |
| | | user.setLevel(1); |
| | | user.setLevelType(0); |
| | | //淘宝联盟接入时 需要long类型的userId |
| | | user.setUserCode(Long.parseLong(String.valueOf(userId.hashCode()&Integer.MAX_VALUE))); |
| | | userMapper.insert(user); |
| | | CdnUserWallet flow = new CdnUserWallet(); |
| | | flow.setMoney(BigDecimal.ZERO); |
| | | flow.setUserId(userId); |
| | | flow.setWalletId(WalletEnum.FLOW.value()); |
| | | flow.setCreateTime(new Date()); |
| | | cdnUserWalletMapper.insert(flow); |
| | | |
| | | CdnUserWallet goldCowBean = new CdnUserWallet(); |
| | | goldCowBean.setMoney(BigDecimal.ZERO); |
| | | goldCowBean.setUserId(userId); |
| | | goldCowBean.setWalletId(WalletEnum.GOLDCOWBEAN.value()); |
| | | goldCowBean.setCreateTime(new Date()); |
| | | cdnUserWalletMapper.insert(goldCowBean); |
| | | |
| | | CdnUserWallet luckPool = new CdnUserWallet(); |
| | | luckPool.setMoney(BigDecimal.ZERO); |
| | | luckPool.setUserId(userId); |
| | | luckPool.setWalletId(WalletEnum.LUCKPOOL.value()); |
| | | luckPool.setCreateTime(new Date()); |
| | | cdnUserWalletMapper.insert(luckPool); |
| | | |
| | | CdnUserWallet integral = new CdnUserWallet(); |
| | | integral.setMoney(BigDecimal.ZERO); |
| | | integral.setUserId(userId); |
| | | integral.setWalletId(WalletEnum.INTEGRAL.value()); |
| | | integral.setCreateTime(new Date()); |
| | | cdnUserWalletMapper.insert(integral); |
| | | |
| | | UserExtension userExtension = new UserExtension(); |
| | | userExtension.setBalance(0.0); |
| | | userExtension.setTotalBalance(0.0); |
| | | userExtension.setGrowth(0); |
| | | userExtension.setLevel(1); |
| | | userExtension.setLevelType(0); |
| | | userExtension.setScore(0L); |
| | | userExtension.setUpdateTime(new Date()); |
| | | userExtension.setVersion(0); |
| | | userExtension.setSignDay(0); |
| | | userExtension.setUserId(userId); |
| | | userExtensionMapper.insert(userExtension); |
| | | //用户注册成功后发送等级提升事件 |
| | | applicationContext.publishEvent(new LevelUpEvent(userExtension,1,0)); |
| | | if (StrUtil.isNotBlank(tempUid)) { |
| | | appConnectMapper.bindUserIdByTempUid(user.getUserId(), tempUid); |
| | | } |
| | | return user; |
| | | } |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public Integer batchRegisterUser(UserExcelParam params, List<UserRegisterExcelParam> userList, Set<String> repeatPhoneSet, Set<String> repeatMailSet) { |
| | | // 成功注册用户条数 |
| | | int registerNum = 0; |
| | | if (CollectionUtils.isEmpty(userList)) { |
| | | return registerNum; |
| | | } |
| | | List<String> phones = userList.stream().map(UserRegisterExcelParam::getPhone).collect(Collectors.toList()); |
| | | List<String> mails = userList.stream().map(UserRegisterExcelParam::getUserMail).collect(Collectors.toList()); |
| | | // 查询已经存在的手机号用户 |
| | | List<User> users = userMapper.listByUserPhones(phones); |
| | | // 查询已经存在的邮箱用户 |
| | | List<User> userListByMail =userMapper.listByUserMails(mails); |
| | | if (CollectionUtils.isNotEmpty(users)) { |
| | | List<String> mobiles = users.stream().map(User::getUserMobile).collect(Collectors.toList()); |
| | | userList = userList.stream().filter(item -> !mobiles.contains(item.getPhone())).collect(Collectors.toList()); |
| | | repeatPhoneSet.addAll(mobiles); |
| | | } |
| | | if (CollectionUtils.isNotEmpty(userListByMail) && CollectionUtils.isNotEmpty(userList)) { |
| | | List<String> userMails = userListByMail.stream().map(User::getUserMail).collect(Collectors.toList()); |
| | | userList = userList.stream().filter(item -> !userMails.contains(item.getUserMail())).collect(Collectors.toList()); |
| | | repeatMailSet.addAll(userMails); |
| | | } |
| | | if (CollectionUtils.isEmpty(userList)) { |
| | | return registerNum; |
| | | } |
| | | registerNum = userList.size(); |
| | | Date now = new Date(); |
| | | // 用户 |
| | | List<User> userSave = new ArrayList<>(); |
| | | // 用户扩展表 |
| | | List<UserExtension> userExtensionsSave = new ArrayList<>(); |
| | | for (UserRegisterExcelParam param : userList) { |
| | | // 用户 |
| | | String userId = IdUtil.simpleUUID(); |
| | | if(param.getBalance() > UserRegisterExcelParam.MaxBalance){ |
| | | //余额超出最大范围,最多不得超过999999999.99 |
| | | params.getErrorRowInfos().add(I18nMessage.getMessage("yami.balance.out.error")); |
| | | params.setSuccessNum(params.getSuccessNum() -1); |
| | | params.setErrorNum(params.getErrorNum() + 1); |
| | | registerNum --; |
| | | continue; |
| | | //throw new YamiShopBindException("yami.balance.out.error); |
| | | } |
| | | if(param.getScore() > UserRegisterExcelParam.MaxScore){ |
| | | //积分超出最大范围,最多不得超过100000000 |
| | | //throw new YamiShopBindException("yami.score.out.error"); |
| | | params.getErrorRowInfos().add(I18nMessage.getMessage("yami.score.out.error")); |
| | | params.setSuccessNum(params.getSuccessNum() -1); |
| | | params.setErrorNum(params.getErrorNum() + 1); |
| | | registerNum --; |
| | | continue; |
| | | } |
| | | User user = mapperFacade.map(param, User.class); |
| | | user.setUserId(userId); |
| | | user.setUserMobile(param.getPhone()); |
| | | user.setLoginPassword(passwordEncoder.encode(param.getPassword())); |
| | | user.setUserName(param.getPhone()); |
| | | user.setModifyTime(now); |
| | | user.setUserRegtime(now); |
| | | user.setStatus(1); |
| | | userSave.add(user); |
| | | // 用户扩展信息 |
| | | UserExtension userExtension = new UserExtension(); |
| | | userExtension.setUserId(userId); |
| | | userExtension.setLevel(user.getLevel()); |
| | | userExtension.setLevelType(user.getLevelType()); |
| | | userExtension.setGrowth(param.getGrowth()); |
| | | userExtension.setScore(param.getScore()); |
| | | userExtension.setBalance(param.getBalance()); |
| | | userExtension.setTotalBalance(param.getBalance()); |
| | | userExtension.setVersion(0); |
| | | userExtension.setUpdateTime(now); |
| | | userExtensionsSave.add(userExtension); |
| | | } |
| | | userService.saveBatch(userSave); |
| | | userExtensionService.saveBatch(userExtensionsSave); |
| | | //用户注册成功后发送日志事件 积分log 成长值log |
| | | applicationContext.publishEvent(new UserRegisterLogEvent(userExtensionsSave)); |
| | | return registerNum; |
| | | } |
| | | |
| | | @Override |
| | | public AppConnect getByTempUid(String tempUid) { |
| | | return appConnectMapper.getByTempUid(tempUid); |
| | | } |
| | | |
| | | @Override |
| | | public void unBindUser(String bizUserId, Integer socialType) { |
| | | appConnectMapper.unBindUser(bizUserId, socialType); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.util; |
| | | |
| | | |
| | | import com.alibaba.ttl.TransmittableThreadLocal; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/16 |
| | | */ |
| | | public class AuthUserContext { |
| | | |
| | | private static final ThreadLocal<UserInfoInTokenBO> USER_INFO_IN_TOKEN_HOLDER = new TransmittableThreadLocal<>(); |
| | | |
| | | public static UserInfoInTokenBO get() { |
| | | return USER_INFO_IN_TOKEN_HOLDER.get(); |
| | | } |
| | | |
| | | public static void set(UserInfoInTokenBO userInfoInTokenBo) { |
| | | USER_INFO_IN_TOKEN_HOLDER.set(userInfoInTokenBo); |
| | | } |
| | | |
| | | public static void clean() { |
| | | if (USER_INFO_IN_TOKEN_HOLDER.get() != null) { |
| | | USER_INFO_IN_TOKEN_HOLDER.remove(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.util; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.crypto.digest.DigestAlgorithm; |
| | | import cn.hutool.crypto.digest.Digester; |
| | | import cn.hutool.http.ContentType; |
| | | import com.yami.shop.bean.model.SysAccessKey; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.common.util.Json; |
| | | import com.yami.shop.common.wrapper.RequestWrapper; |
| | | import com.yami.shop.security.common.bo.SignResponse; |
| | | import com.yami.shop.service.SysAccessKeyService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.TreeMap; |
| | | |
| | | /** |
| | | * 签名工具类 |
| | | * @author yami |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class SignUtils { |
| | | |
| | | public static final String GRANT_TYPE = "grantType"; |
| | | |
| | | public static final String GRANT_TYPE_VALUE = "sign"; |
| | | |
| | | private static final long TEN_MINUTES = 1000 * 60 * 10; |
| | | |
| | | /** |
| | | * 签名,通过签名机制,防止应用的请求参数被非法篡改,业务系统必须保证该值不被泄露。 |
| | | */ |
| | | public static final String SIGN = "sign"; |
| | | |
| | | /** |
| | | * 分配给应用的系统编号 |
| | | */ |
| | | public static final String APP_ID = "appId"; |
| | | |
| | | /** |
| | | * 分配给应用的系统密钥 |
| | | */ |
| | | public static final String APP_SECRET = "appSecret"; |
| | | |
| | | /** |
| | | * 请求的时间戳,接入系统的时间误差不能超过 10 分钟 |
| | | */ |
| | | public static final String TIMESTAMP = "timestamp"; |
| | | |
| | | /** |
| | | * 真正请求的数据 |
| | | */ |
| | | public static final String DATA = "data"; |
| | | |
| | | @Autowired |
| | | private SysAccessKeyService sysAccessKeyService; |
| | | |
| | | |
| | | /** |
| | | * 验签方法 |
| | | */ |
| | | public ServerResponseEntity<SignResponse> verify(HttpServletRequest req) throws IOException { |
| | | // 这里的param map是包含sign, timestamp等信息的,如果是json形式那么data在下一层,如果不是就在同一层 |
| | | TreeMap<String, Object> paramMap; |
| | | // data所在那一层的map数据 |
| | | Map<String, Object> dataMap; |
| | | if (StrUtil.isNotBlank(req.getContentType()) && req.getContentType().contains(ContentType.JSON.getValue())) { |
| | | RequestWrapper requestWrapper = new RequestWrapper(req); |
| | | String body = requestWrapper.getBody(); |
| | | // 签名是有顺序的 |
| | | paramMap = Json.parseObject(body, TreeMap.class); |
| | | dataMap = (Map<String, Object>) paramMap.get(DATA); |
| | | requestWrapper.setBody(Json.toJsonString(dataMap)); |
| | | // 这里改写了请求将data里面的数据发送到controller |
| | | req = requestWrapper; |
| | | } else { |
| | | paramMap = new TreeMap<>(req.getParameterMap()); |
| | | for (Map.Entry<String, Object> objectEntry : paramMap.entrySet()) { |
| | | String[] list = (String[]) objectEntry.getValue(); |
| | | if (list.length == 1) { |
| | | paramMap.put(objectEntry.getKey(), list[0]); |
| | | continue; |
| | | } |
| | | Arrays.sort(list); |
| | | } |
| | | dataMap = paramMap; |
| | | } |
| | | ServerResponseEntity<SignResponse> verifyResponse = verify(paramMap); |
| | | if (!verifyResponse.isSuccess()) { |
| | | return verifyResponse; |
| | | } |
| | | SignResponse signResponse = verifyResponse.getData(); |
| | | signResponse.setReq(req); |
| | | signResponse.setDataMap(dataMap); |
| | | return ServerResponseEntity.success(signResponse); |
| | | } |
| | | |
| | | /** |
| | | * 校验参数,如果校验成功则返回data数据信息 |
| | | * @return |
| | | */ |
| | | public ServerResponseEntity<SignResponse> verify(TreeMap<String, Object> paramMap) { |
| | | SignResponse signResponse = new SignResponse(); |
| | | |
| | | try { |
| | | String appId = (String)paramMap.get(APP_ID); |
| | | if (StrUtil.isBlank(appId)) { |
| | | return ServerResponseEntity.showFailMsg("appid missing").setData(signResponse); |
| | | } |
| | | SysAccessKey sysAccessKey = sysAccessKeyService.getByAccessId(appId); |
| | | if (sysAccessKey == null) { |
| | | return ServerResponseEntity.showFailMsg("appid error").setData(signResponse); |
| | | } |
| | | // 签名 |
| | | String sign = (String)paramMap.get(SIGN); |
| | | // 移除签名 |
| | | paramMap.remove(SIGN); |
| | | // 移除appId |
| | | paramMap.remove(APP_ID); |
| | | // 用密钥来做签名 |
| | | paramMap.put(APP_SECRET, sysAccessKey.getAccessKey()); |
| | | signResponse.setAppSecret(sysAccessKey.getAccessKey()); |
| | | |
| | | |
| | | long currentTimeMillis = System.currentTimeMillis(); |
| | | Long timestamp = Long.valueOf(paramMap.get(TIMESTAMP).toString()); |
| | | // 签名时间大于十分钟,提示签名超时 |
| | | if (timestamp + TEN_MINUTES < currentTimeMillis) { |
| | | return ServerResponseEntity.showFailMsg("The request time has exceeded ten minutes").setData(signResponse); |
| | | } |
| | | // 生成签名 |
| | | Digester sha256 = new Digester(DigestAlgorithm.SHA256); |
| | | String sysSign = sha256.digestHex(Json.toJsonString(paramMap)); |
| | | |
| | | // 进行验签 |
| | | if (!Objects.equals(sign, sysSign)) { |
| | | return ServerResponseEntity.showFailMsg("sign error").setData(signResponse); |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("sign verify error : {}", e.getMessage()); |
| | | return ServerResponseEntity.showFailMsg("system error").setData(signResponse); |
| | | } |
| | | return ServerResponseEntity.success(signResponse); |
| | | } |
| | | public static String sign(String appSecret, Long timestamp, Object data) { |
| | | |
| | | TreeMap<String, Object> requestMap = new TreeMap<>(); |
| | | requestMap.put(TIMESTAMP, timestamp); |
| | | requestMap.put(APP_SECRET, appSecret); |
| | | requestMap.put(DATA, data); |
| | | |
| | | // 签名 |
| | | Digester sha256 = new Digester(DigestAlgorithm.SHA256); |
| | | String sign = sha256.digestHex(Json.toJsonString(requestMap)); |
| | | // 请求数据添加签名和账号id |
| | | requestMap.put("sign", sign); |
| | | return sign; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.security.common.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @Schema(description = "用户登录VO") |
| | | public class ImTokenInfo { |
| | | |
| | | @Schema(description = "每次请求都必须在header中携带accessToken") |
| | | private String accessToken; |
| | | |
| | | @Schema(description = "accessToken过期时间(秒)") |
| | | private Integer accessTokenExpiresIn; |
| | | |
| | | @Schema(description = "accessToken过期后,通过refreshToken换取新的token") |
| | | private String refreshToken; |
| | | |
| | | @Schema(description = "refreshToken过期时间(秒)") |
| | | private Integer refreshTokenExpiresIn; |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.common.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | /** |
| | | * token信息,该信息用户返回给前端,前端请求携带accessToken进行用户校验 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/2 |
| | | */ |
| | | public class TokenInfoVO { |
| | | |
| | | @Schema(description = "accessToken" ) |
| | | private String accessToken; |
| | | |
| | | @Schema(description = "refreshToken" ) |
| | | private String refreshToken; |
| | | |
| | | @Schema(description = "在多少秒后过期" ) |
| | | private Integer expiresIn; |
| | | |
| | | @Schema(description = "imToKen" ) |
| | | private ImTokenInfo imToKen; |
| | | |
| | | public String getAccessToken() { |
| | | return accessToken; |
| | | } |
| | | |
| | | public void setAccessToken(String accessToken) { |
| | | this.accessToken = accessToken; |
| | | } |
| | | |
| | | public String getRefreshToken() { |
| | | return refreshToken; |
| | | } |
| | | |
| | | public void setRefreshToken(String refreshToken) { |
| | | this.refreshToken = refreshToken; |
| | | } |
| | | |
| | | public Integer getExpiresIn() { |
| | | return expiresIn; |
| | | } |
| | | |
| | | public void setExpiresIn(Integer expiresIn) { |
| | | this.expiresIn = expiresIn; |
| | | } |
| | | |
| | | public ImTokenInfo getImToKen() { |
| | | return imToKen; |
| | | } |
| | | |
| | | public void setImToKen(ImTokenInfo imToKen) { |
| | | this.imToKen = imToKen; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TokenInfoVO{" + "accessToken='" + accessToken + '\'' + ", refreshToken='" + refreshToken + '\'' |
| | | + ", expiresIn=" + expiresIn + '}'; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | com.yami.shop.security.common.adapter.CaptchaCacheServiceRedisImpl |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yami.shop.security.common.dao.AppConnectMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yami.shop.security.common.model.AppConnect"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="user_id" jdbcType="VARCHAR" property="userId" /> |
| | | <result column="app_id" jdbcType="TINYINT" property="appId" /> |
| | | <result column="nick_name" jdbcType="VARCHAR" property="nickName" /> |
| | | <result column="image_url" jdbcType="VARCHAR" property="imageUrl" /> |
| | | <result column="biz_user_id" jdbcType="VARCHAR" property="bizUserId" /> |
| | | <result column="biz_unionid" jdbcType="VARCHAR" property="bizUnionid" /> |
| | | <result column="temp_uid" jdbcType="VARCHAR" property="tempUid" /> |
| | | <result column="biz_temp_session" jdbcType="VARCHAR" property="bizTempSession" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="getByBizUserId" resultType="com.yami.shop.security.common.model.AppConnect"> |
| | | select * from tz_app_connect where biz_user_id = #{bizUserId} and app_id = #{appId} |
| | | </select> |
| | | |
| | | <select id="getByUserId" resultType="com.yami.shop.security.common.model.AppConnect"> |
| | | select * from tz_app_connect where user_id = #{userId} and app_id = #{appId} limit 1 |
| | | </select> |
| | | <select id="getUserIdByUnionId" resultType="java.lang.String"> |
| | | SELECT user_id from tz_app_connect where biz_unionid = #{bizUnionId} limit 1 |
| | | </select> |
| | | |
| | | <update id="updateByBizUserIdAndAppId"> |
| | | UPDATE tz_app_connect |
| | | SET user_id = #{appConnect.userId} |
| | | where |
| | | biz_user_id = #{appConnect.bizUserId} and app_id = #{appConnect.appId} |
| | | </update> |
| | | |
| | | <select id="getByTempUid" resultType="com.yami.shop.security.common.model.AppConnect"> |
| | | select * from tz_app_connect where temp_uid = #{tempUid} |
| | | </select> |
| | | |
| | | <update id="bindUserIdByTempUid"> |
| | | update tz_app_connect set user_id = #{userId} where temp_uid = #{tempUid} |
| | | </update> |
| | | |
| | | <update id="unBindUser"> |
| | | update tz_app_connect set user_id = null where biz_user_id = #{bizUserId} and app_id = #{socialType} |
| | | </update> |
| | | |
| | | <update id="unBindUserByUserId"> |
| | | update tz_app_connect set user_id = null where user_id = #{userId} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-security</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </parent> |
| | | |
| | | <artifactId>yami-shop-security-multishop</artifactId> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <description>商城安全模块店铺管理部分</description> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-security-common</artifactId> |
| | | <version>${yami.shop.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-sys-common</artifactId> |
| | | <version>${yami.shop.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.multishop.adapter; |
| | | |
| | | import com.yami.shop.security.common.adapter.DefaultAuthConfigAdapter; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/16 |
| | | */ |
| | | @Component |
| | | public class ResourceServerAdapter extends DefaultAuthConfigAdapter { |
| | | |
| | | public static final List<String> EXCLUDE_PATH = Arrays.asList( |
| | | "/webjars/**", |
| | | "/swagger/**", |
| | | "/v3/api-docs/**", |
| | | "/doc.html", |
| | | "/swagger-ui.html", |
| | | "/swagger-resources/**", |
| | | "/captcha/**", |
| | | "/order/refund/result/**", |
| | | "/sys/webConfig/getActivity", |
| | | "/shop/shopUserRegister/**", |
| | | "/shopLogin", |
| | | "/actuator/health/liveness", |
| | | "/actuator/health/readiness"); |
| | | |
| | | @Override |
| | | public List<String> excludePathPatterns() { |
| | | return EXCLUDE_PATH; |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.multishop.controller; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.anji.captcha.model.common.ResponseModel; |
| | | import com.anji.captcha.model.vo.CaptchaVO; |
| | | import com.anji.captcha.service.CaptchaService; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yami.shop.bean.enums.PositionType; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.i18n.I18nMessage; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.enums.SysTypeEnum; |
| | | import com.yami.shop.security.common.manager.PasswordCheckManager; |
| | | import com.yami.shop.security.common.manager.PasswordManager; |
| | | import com.yami.shop.security.common.manager.TokenStore; |
| | | import com.yami.shop.security.common.vo.TokenInfoVO; |
| | | import com.yami.shop.security.multishop.dto.CaptchaAuthenticationDTO; |
| | | import com.yami.shop.sys.common.dao.ShopEmployeeMapper; |
| | | import com.yami.shop.sys.common.dao.ShopMenuMapper; |
| | | import com.yami.shop.sys.common.model.ShopEmployee; |
| | | import com.yami.shop.sys.common.model.ShopMenu; |
| | | import com.yami.shop.sys.common.service.ShopMenuService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/6/30 |
| | | */ |
| | | @RestController |
| | | @Tag(name = "登录") |
| | | public class MultishopLoginController { |
| | | |
| | | @Autowired |
| | | private TokenStore tokenStore; |
| | | |
| | | @Autowired |
| | | private ShopEmployeeMapper shopEmployeeMapper; |
| | | |
| | | @Autowired |
| | | private ShopMenuService shopMenuService; |
| | | |
| | | @Autowired |
| | | private PasswordCheckManager passwordCheckManager; |
| | | |
| | | @Autowired |
| | | private CaptchaService captchaService; |
| | | |
| | | @Autowired |
| | | private PasswordManager passwordManager; |
| | | |
| | | @PostMapping("/shopLogin") |
| | | @Operation(summary = "账号密码 + 验证码登录(用于后台登录)" , description = "通过账号/手机号/用户名密码登录") |
| | | public ServerResponseEntity<?> login( |
| | | @Valid @RequestBody CaptchaAuthenticationDTO captchaAuthenticationDTO) { |
| | | // 登陆后台登录需要再校验一遍验证码 |
| | | CaptchaVO captchaVO = new CaptchaVO(); |
| | | captchaVO.setCaptchaVerification(captchaAuthenticationDTO.getCaptchaVerification()); |
| | | ResponseModel response = captchaService.verification(captchaVO); |
| | | if (!response.isSuccess()) { |
| | | return ServerResponseEntity.showFailMsg(I18nMessage.getMessage("yami.user.code.error")); |
| | | } |
| | | |
| | | ShopEmployee shopEmployee = shopEmployeeMapper.getShopByUsernameOrMobile(captchaAuthenticationDTO.getUserName()); |
| | | if (shopEmployee == null) { |
| | | throw new YamiShopBindException("yami.user.account.error"); |
| | | } |
| | | |
| | | String decryptPassword = passwordManager.decryptPassword(captchaAuthenticationDTO.getPassWord()); |
| | | |
| | | // 半小时内密码输入错误十次,已限制登录30分钟 |
| | | passwordCheckManager.checkPassword(SysTypeEnum.MULTISHOP,captchaAuthenticationDTO.getUserName(), decryptPassword, shopEmployee.getPassword()); |
| | | |
| | | // 不是店铺超级管理员,并且是禁用状态,无法登录 |
| | | if (!Objects.equals(PositionType.ADMIN.value(), shopEmployee.getType()) && Objects.equals(shopEmployee.getStatus(),0)) { |
| | | // 未找到此用户信息 |
| | | throw new YamiShopBindException("yami.shop.user.account.lock"); |
| | | } |
| | | |
| | | UserInfoInTokenBO userInfoInToken = new UserInfoInTokenBO(); |
| | | userInfoInToken.setUserId(shopEmployee.getEmployeeId().toString()); |
| | | userInfoInToken.setSysType(SysTypeEnum.MULTISHOP.value()); |
| | | userInfoInToken.setEnabled(shopEmployee.getStatus() == 1); |
| | | userInfoInToken.setShopId(shopEmployee.getShopId()); |
| | | userInfoInToken.setOtherId(shopEmployee.getEmployeeId()); |
| | | userInfoInToken.setPerms(shopMenuService.getShopPermissions(shopEmployee)); |
| | | // 存储token返回vo |
| | | TokenInfoVO tokenInfoVO = tokenStore.storeAndGetVo(userInfoInToken); |
| | | return ServerResponseEntity.success(tokenInfoVO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.multishop.dto; |
| | | |
| | | import com.yami.shop.security.common.dto.AuthenticationDTO; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | /** |
| | | * 验证码登陆 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/1 |
| | | */ |
| | | public class CaptchaAuthenticationDTO extends AuthenticationDTO { |
| | | |
| | | @Schema(description = "验证码" , required = true) |
| | | private String captchaVerification; |
| | | |
| | | public String getCaptchaVerification() { |
| | | return captchaVerification; |
| | | } |
| | | |
| | | public void setCaptchaVerification(String captchaVerification) { |
| | | this.captchaVerification = captchaVerification; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CaptchaAuthenticationDTO{" + "captchaVerification='" + captchaVerification + '\'' + "} " |
| | | + super.toString(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.multishop.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 用户详细信息 |
| | | * |
| | | * @author |
| | | */ |
| | | @Data |
| | | public class YamiShopUser { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private String userId; |
| | | |
| | | /** |
| | | * 店铺id |
| | | */ |
| | | private Long shopId; |
| | | |
| | | private boolean enabled; |
| | | |
| | | |
| | | /** 店铺管理员id */ |
| | | private Long employeeId; |
| | | |
| | | private Set<String> authorities; |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.multishop.util; |
| | | |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.util.AuthUserContext; |
| | | import com.yami.shop.security.multishop.model.YamiShopUser; |
| | | import lombok.experimental.UtilityClass; |
| | | |
| | | /** |
| | | * |
| | | * @author LGH |
| | | */ |
| | | @UtilityClass |
| | | public class SecurityUtils { |
| | | |
| | | |
| | | /** |
| | | * 获取用户 |
| | | */ |
| | | public YamiShopUser getShopUser() { |
| | | UserInfoInTokenBO userInfoInTokenBO = AuthUserContext.get(); |
| | | |
| | | YamiShopUser details = new YamiShopUser(); |
| | | details.setUserId(userInfoInTokenBO.getUserId()); |
| | | details.setEnabled(userInfoInTokenBO.getEnabled()); |
| | | details.setShopId(userInfoInTokenBO.getShopId()); |
| | | details.setEmployeeId(userInfoInTokenBO.getOtherId()); |
| | | details.setAuthorities(userInfoInTokenBO.getPerms()); |
| | | return details; |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-security</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </parent> |
| | | |
| | | <artifactId>yami-shop-security-platform</artifactId> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <description>商城安全模块平台管理部分</description> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-security-common</artifactId> |
| | | <version>${yami.shop.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-sys-common</artifactId> |
| | | <version>${yami.shop.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.platform.adapter; |
| | | |
| | | import com.yami.shop.security.common.adapter.DefaultAuthConfigAdapter; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/16 |
| | | */ |
| | | @Component |
| | | public class ResourceServerAdapter extends DefaultAuthConfigAdapter { |
| | | |
| | | public static final List<String> EXCLUDE_PATH = Arrays.asList( |
| | | "/webjars/**", |
| | | "/swagger/**", |
| | | "/v3/api-docs/**", |
| | | "/doc.html", |
| | | "/swagger-ui.html", |
| | | "/swagger-resources/**", |
| | | "/captcha/**", |
| | | "/sys/webConfig/getActivity", |
| | | "/platformLogin", |
| | | "/actuator/health/liveness", |
| | | "/actuator/health/readiness"); |
| | | |
| | | @Override |
| | | public List<String> excludePathPatterns() { |
| | | return EXCLUDE_PATH; |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.platform.controller; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.anji.captcha.model.common.ResponseModel; |
| | | import com.anji.captcha.model.vo.CaptchaVO; |
| | | import com.anji.captcha.service.CaptchaService; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.i18n.I18nMessage; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.enums.SysTypeEnum; |
| | | import com.yami.shop.security.common.manager.PasswordCheckManager; |
| | | import com.yami.shop.security.common.manager.PasswordManager; |
| | | import com.yami.shop.security.common.manager.TokenStore; |
| | | import com.yami.shop.security.common.vo.TokenInfoVO; |
| | | import com.yami.shop.security.platform.dto.CaptchaAuthenticationDTO; |
| | | import com.yami.shop.sys.common.dao.SysMenuMapper; |
| | | import com.yami.shop.sys.common.dao.SysUserMapper; |
| | | import com.yami.shop.sys.common.model.SysMenu; |
| | | import com.yami.shop.sys.common.model.SysUser; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2020/6/30 |
| | | */ |
| | | @RestController |
| | | @Tag(name = "登录") |
| | | public class PlatformLoginController { |
| | | |
| | | @Autowired |
| | | private TokenStore tokenStore; |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Autowired |
| | | private SysMenuMapper sysMenuMapper; |
| | | |
| | | @Autowired |
| | | private PasswordCheckManager passwordCheckManager; |
| | | |
| | | @Autowired |
| | | private CaptchaService captchaService; |
| | | |
| | | @Autowired |
| | | private PasswordManager passwordManager; |
| | | |
| | | @PostMapping("/platformLogin") |
| | | @Operation(summary = "账号密码 + 验证码登录(用于后台登录)" , description = "通过账号/手机号/用户名密码登录") |
| | | public ServerResponseEntity<?> login( |
| | | @Valid @RequestBody CaptchaAuthenticationDTO captchaAuthenticationDTO) { |
| | | // 登陆后台登录需要再校验一遍验证码 |
| | | CaptchaVO captchaVO = new CaptchaVO(); |
| | | captchaVO.setCaptchaVerification(captchaAuthenticationDTO.getCaptchaVerification()); |
| | | ResponseModel response = captchaService.verification(captchaVO); |
| | | if (!response.isSuccess()) { |
| | | return ServerResponseEntity.showFailMsg(I18nMessage.getMessage("yami.user.code.error")); |
| | | } |
| | | |
| | | SysUser sysUser = sysUserMapper.selectByUsername(captchaAuthenticationDTO.getUserName()); |
| | | if (sysUser == null) { |
| | | throw new YamiShopBindException("yami.user.account.error"); |
| | | } |
| | | |
| | | String decryptPassword = passwordManager.decryptPassword(captchaAuthenticationDTO.getPassWord()); |
| | | |
| | | // 半小时内密码输入错误十次,已限制登录30分钟 |
| | | passwordCheckManager.checkPassword(SysTypeEnum.MULTISHOP,captchaAuthenticationDTO.getUserName(), decryptPassword, sysUser.getPassword()); |
| | | |
| | | // 不是店铺超级管理员,并且是禁用状态,无法登录 |
| | | if (Objects.equals(sysUser.getStatus(),0)) { |
| | | // 未找到此用户信息 |
| | | throw new YamiShopBindException("yami.shop.user.account.lock"); |
| | | } |
| | | |
| | | UserInfoInTokenBO userInfoInToken = new UserInfoInTokenBO(); |
| | | userInfoInToken.setUserId(String.valueOf(sysUser.getUserId())); |
| | | userInfoInToken.setSysType(SysTypeEnum.PLATFORM.value()); |
| | | userInfoInToken.setEnabled(sysUser.getStatus() == 1); |
| | | userInfoInToken.setPerms(getUserPermissions(sysUser.getUserId())); |
| | | userInfoInToken.setNikeName(sysUser.getNickName()); |
| | | // 存储token返回vo |
| | | TokenInfoVO tokenInfoVO = tokenStore.storeAndGetVo(userInfoInToken); |
| | | return ServerResponseEntity.success(tokenInfoVO); |
| | | } |
| | | |
| | | |
| | | private Set<String> getUserPermissions(Long userId) { |
| | | List<String> permsList; |
| | | |
| | | //系统管理员,拥有最高权限 |
| | | if(userId == Constant.SUPER_ADMIN_ID){ |
| | | List<SysMenu> menuList = sysMenuMapper.selectList(Wrappers.emptyWrapper()); |
| | | |
| | | |
| | | permsList = menuList.stream().map(SysMenu::getPerms).collect(Collectors.toList()); |
| | | }else{ |
| | | permsList = sysUserMapper.queryAllPerms(userId); |
| | | } |
| | | return permsList.stream().flatMap((perms)->{ |
| | | if (StrUtil.isBlank(perms)) { |
| | | return null; |
| | | } |
| | | return Arrays.stream(perms.trim().split(StrUtil.COMMA)); |
| | | } |
| | | ).collect(Collectors.toSet()); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.platform.dto; |
| | | |
| | | import com.yami.shop.security.common.dto.AuthenticationDTO; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | /** |
| | | * 验证码登陆 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/7/1 |
| | | */ |
| | | public class CaptchaAuthenticationDTO extends AuthenticationDTO { |
| | | |
| | | @Schema(description = "验证码" , required = true) |
| | | private String captchaVerification; |
| | | |
| | | public String getCaptchaVerification() { |
| | | return captchaVerification; |
| | | } |
| | | |
| | | public void setCaptchaVerification(String captchaVerification) { |
| | | this.captchaVerification = captchaVerification; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CaptchaAuthenticationDTO{" + "captchaVerification='" + captchaVerification + '\'' + "} " |
| | | + super.toString(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.platform.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 用户详细信息 |
| | | * |
| | | * @author |
| | | */ |
| | | @Data |
| | | public class YamiSysUser { |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private Long userId; |
| | | |
| | | private boolean enabled; |
| | | |
| | | private Set<String> authorities; |
| | | |
| | | private String username; |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.security.platform.util; |
| | | |
| | | import com.yami.shop.security.common.bo.UserInfoInTokenBO; |
| | | import com.yami.shop.security.common.util.AuthUserContext; |
| | | import com.yami.shop.security.platform.model.YamiSysUser; |
| | | import lombok.experimental.UtilityClass; |
| | | |
| | | /** |
| | | * |
| | | * @author LGH |
| | | */ |
| | | @UtilityClass |
| | | public class SecurityUtils { |
| | | |
| | | |
| | | /** |
| | | * 获取用户 |
| | | */ |
| | | public YamiSysUser getSysUser() { |
| | | UserInfoInTokenBO userInfoInTokenBO = AuthUserContext.get(); |
| | | |
| | | YamiSysUser details = new YamiSysUser(); |
| | | details.setUserId(Long.valueOf(userInfoInTokenBO.getUserId())); |
| | | details.setEnabled(userInfoInTokenBO.getEnabled()); |
| | | details.setUsername(userInfoInTokenBO.getNikeName()); |
| | | details.setAuthorities(userInfoInTokenBO.getPerms()); |
| | | return details; |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>yami-shop</artifactId> |
| | | <groupId>com.yami.shop</groupId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>yami-shop-service</artifactId> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-bean</artifactId> |
| | | <version>${yami.shop.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>yami-shop-mp-common</artifactId> |
| | | <version>${yami.shop.version}</version> |
| | | </dependency> |
| | | <!-- mybatis-plus自动生成文件依赖此包 --> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-generator</artifactId> |
| | | <version>3.5.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.velocity</groupId> |
| | | <artifactId>velocity-engine-core</artifactId> |
| | | <version>2.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.yami.shop</groupId> |
| | | <artifactId>system-im-client</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.config; |
| | | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.core.util.CharsetUtil; |
| | | import com.alipay.api.*; |
| | | import com.yami.shop.common.bean.Alipay; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | @Component |
| | | @AllArgsConstructor |
| | | public class AliPayConfig { |
| | | |
| | | private final ShopConfig shopConfig; |
| | | |
| | | public AlipayClient getAlipayClient() throws AlipayApiException { |
| | | |
| | | Alipay alipay = shopConfig.getAlipay(); |
| | | |
| | | //构造client |
| | | CertAlipayRequest certAlipayRequest = new CertAlipayRequest(); |
| | | //设置网关地址 |
| | | certAlipayRequest.setServerUrl("https://openapi.alipay.com/gateway.do"); |
| | | // certAlipayRequest.setServerUrl("https://openapi-sandbox.dl.alipaydev.com/gateway.do"); |
| | | //设置应用Id |
| | | certAlipayRequest.setAppId(alipay.getAppId()); |
| | | //设置应用私钥 |
| | | certAlipayRequest.setPrivateKey(alipay.getAppPrivateKey()); |
| | | //设置请求格式,固定值json |
| | | certAlipayRequest.setFormat("json"); |
| | | //设置字符集 |
| | | certAlipayRequest.setCharset(CharsetUtil.UTF_8); |
| | | //设置签名类型 |
| | | certAlipayRequest.setSignType(AlipayConstants.SIGN_TYPE_RSA2); |
| | | |
| | | //设置应用公钥证书路径 |
| | | certAlipayRequest.setCertPath(FileUtil.getAbsolutePath(alipay.getAppCertPath())); |
| | | //设置支付宝公钥证书路径 |
| | | certAlipayRequest.setAlipayPublicCertPath(FileUtil.getAbsolutePath(alipay.getAlipayCertPath())); |
| | | //设置支付宝根证书路径 |
| | | certAlipayRequest.setRootCertPath(FileUtil.getAbsolutePath(alipay.getAlipayRootCertPath())); |
| | | //构造client |
| | | return new DefaultAlipayClient(certAlipayRequest); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.config; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.paypal.api.payments.Error; |
| | | import com.paypal.api.payments.*; |
| | | import com.paypal.base.Constants; |
| | | import com.paypal.base.rest.APIContext; |
| | | import com.paypal.base.rest.OAuthTokenCredential; |
| | | import com.paypal.base.rest.PayPalRESTException; |
| | | import com.paypal.core.PayPalEnvironment; |
| | | import com.paypal.core.PayPalHttpClient; |
| | | import com.paypal.http.HttpResponse; |
| | | import com.paypal.orders.Capture; |
| | | import com.paypal.orders.Order; |
| | | import com.paypal.orders.Refund; |
| | | import com.paypal.orders.*; |
| | | import com.paypal.payments.CapturesGetRequest; |
| | | import com.paypal.payments.CapturesRefundRequest; |
| | | import com.paypal.payments.RefundRequest; |
| | | import com.yami.shop.bean.bo.PayInfoResultBO; |
| | | import com.yami.shop.bean.param.PayPalOrderParam; |
| | | import com.yami.shop.bean.pay.PayInfoDto; |
| | | import com.yami.shop.bean.pay.RefundInfoDto; |
| | | import com.yami.shop.common.bean.ExchangeRate; |
| | | import com.yami.shop.common.bean.PayPal; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.common.config.WebhookConstant; |
| | | import com.yami.shop.common.constants.PaypalConstant; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.util.Json; |
| | | import com.yami.shop.service.SysConfigService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.security.SignatureException; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 通过微信配置获取微信的支付信息,登陆信息等 |
| | | * @author cl |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @AllArgsConstructor |
| | | public class PayPalConfig { |
| | | |
| | | private final ShopConfig shopConfig; |
| | | private final SysConfigService sysConfigService; |
| | | |
| | | private static final String PP_SUCCESS = "success"; |
| | | |
| | | public Map<String, String> payPalSdkConfig(){ |
| | | Map<String, String> sdkConfig = new HashMap<>(16); |
| | | PayPal payPal = shopConfig.getPayPal(); |
| | | sdkConfig.put("mode", payPal.getMode()); |
| | | return sdkConfig; |
| | | } |
| | | |
| | | public OAuthTokenCredential authTokenCredential(){ |
| | | PayPal payPal = shopConfig.getPayPal(); |
| | | return new OAuthTokenCredential(payPal.getClientId(), payPal.getClientSecret(), payPalSdkConfig()); |
| | | } |
| | | |
| | | public String getPayPalToken() { |
| | | String accessToken = ""; |
| | | try { |
| | | // Bearer + xxx |
| | | accessToken = authTokenCredential().getAccessToken(); |
| | | } catch (PayPalRESTException e) { |
| | | log.error("PayPalRESTException:", e); |
| | | return accessToken; |
| | | } |
| | | return accessToken; |
| | | } |
| | | |
| | | public APIContext apiContext() { |
| | | PayPal payPal = shopConfig.getPayPal(); |
| | | APIContext apiContext = new APIContext(payPal.getClientId(), payPal.getClientSecret(),payPal.getMode()); |
| | | return apiContext; |
| | | } |
| | | |
| | | public PayPalHttpClient client() { |
| | | PayPal payPal = shopConfig.getPayPal(); |
| | | String mode = payPal.getMode(); |
| | | String clientId = payPal.getClientId(); |
| | | String clientSecret = payPal.getClientSecret(); |
| | | PayPalEnvironment environment = StrUtil.equals("live",mode) ? |
| | | new PayPalEnvironment.Live(clientId, clientSecret) : |
| | | new PayPalEnvironment.Sandbox(clientId, clientSecret); |
| | | return new PayPalHttpClient(environment); |
| | | } |
| | | |
| | | /** |
| | | * 生成paypal支付订单 |
| | | * 回调的页面 /pages/orderList/orderList?sts=0 |
| | | */ |
| | | public OrdersCreateRequest createPayPalOrder(PayInfoDto payInfo) { |
| | | OrdersCreateRequest request = new OrdersCreateRequest(); |
| | | request.header("Content-Type","application/json"); |
| | | OrderRequest orderRequest = new OrderRequest(); |
| | | orderRequest.checkoutPaymentIntent(PaypalConstant.CAPTURE); |
| | | com.paypal.orders.ApplicationContext payPalApplicationContext = new com.paypal.orders.ApplicationContext() |
| | | .brandName("Shopping") |
| | | .landingPage(PaypalConstant.LANDINGPAGE) |
| | | .cancelUrl(payInfo.getReturnUrl()) |
| | | .returnUrl(payInfo.getReturnUrl()) |
| | | .userAction(PaypalConstant.USERACTION) |
| | | ; |
| | | orderRequest.applicationContext(payPalApplicationContext); |
| | | List<PurchaseUnitRequest> purchaseUnitRequests = new ArrayList<>(); |
| | | // 金额转换为美元,然后再转为字符串类型 |
| | | // 获取汇率 |
| | | ExchangeRate exchangeRate = shopConfig.getExchangeRate(); |
| | | BigDecimal amount = new BigDecimal(payInfo.getPayAmount().toString()).multiply(exchangeRate.getUsdExchangeRate()).setScale(2, RoundingMode.HALF_EVEN); |
| | | BigDecimal min = new BigDecimal("0.01"); |
| | | // paypal只支持小数后两位,最小必须支付0.01美元 |
| | | if (min.compareTo(amount)>=0) { |
| | | amount = min; |
| | | } |
| | | log.info("paypalAmount:{}", amount); |
| | | PurchaseUnitRequest purchaseUnitRequest = new PurchaseUnitRequest() |
| | | .description("Shopping") |
| | | .customId(payInfo.getPayNo()) |
| | | .invoiceId(payInfo.getPayNo()) |
| | | .amountWithBreakdown(new AmountWithBreakdown() |
| | | .currencyCode(PaypalConstant.CURRENTCY) |
| | | // value = itemTotal + shipping + handling + taxTotal + shippingDiscount |
| | | .value(amount.toString()) |
| | | ); |
| | | purchaseUnitRequests.add(purchaseUnitRequest); |
| | | orderRequest.purchaseUnits(purchaseUnitRequests); |
| | | request.requestBody(orderRequest); |
| | | return request; |
| | | } |
| | | |
| | | /** |
| | | * 创建订单 |
| | | */ |
| | | public PayPalOrderParam getExcetuteHref (OrdersCreateRequest request) { |
| | | HttpResponse<Order> response; |
| | | PayPalOrderParam param = new PayPalOrderParam(); |
| | | try { |
| | | response = client().execute(request); |
| | | } catch (IOException e) { |
| | | log.error("调用paypal订单创建失败,失败原因:{}", e.getMessage()); |
| | | throw new YamiShopBindException("paypal请求支付失败"); |
| | | } |
| | | if (response.statusCode() == 201) { |
| | | param.setOrderId(response.result().id()); |
| | | log.info("Status Code = {}, Status = {}, OrderID = {}, Intent = {}", response.statusCode(), response.result().status(), response.result().id(), response.result().checkoutPaymentIntent()); |
| | | for (LinkDescription link : response.result().links()) { |
| | | log.info("Links-{}: {} \tCall Type: {}", link.rel(), link.href(), link.method()); |
| | | if("approve".equals(link.rel())) { |
| | | param.setHref(link.href()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return param; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用户授权支付成功,进行扣款操作 |
| | | * 用户通过CreateOrder生成 approveUrl 跳转paypal支付成功后,只是授权,并没有将用户的钱打入我们的paypal账户, |
| | | * 我们需要通过 CaptureOrder接口,将钱打入我的PayPal账户 |
| | | */ |
| | | public PayInfoResultBO captureOrder(String token){ |
| | | PayInfoResultBO payInfoResultBO = new PayInfoResultBO(); |
| | | OrdersCaptureRequest request = new OrdersCaptureRequest(token); |
| | | request.requestBody(new OrderRequest()); |
| | | HttpResponse<Order> response = null; |
| | | try { |
| | | response = client().execute(request); |
| | | } catch (IOException e1) { |
| | | log.error("调用paypal扣款失败,失败原因 {}", e1.getMessage() ); |
| | | throw new YamiShopBindException("failure"); |
| | | } |
| | | payInfoResultBO.setBizOrderNo(response.result().id()); |
| | | log.info("Status Code = {}, Status = {}, OrderID = {}", response.statusCode(), response.result().status(), response.result().id()); |
| | | for (LinkDescription link : response.result().links()) { |
| | | log.info("Links-{}: {} \tCall Type: {}", link.rel(), link.href(), link.method()); |
| | | } |
| | | for (PurchaseUnit purchaseUnit : response.result().purchaseUnits()) { |
| | | for (Capture capture : purchaseUnit.payments().captures()) { |
| | | log.info("Capture id: {}", capture.id()); |
| | | log.info("status: {}", capture.status()); |
| | | log.info("invoice_id: {}", capture.invoiceId()); |
| | | //paypal交易号 |
| | | payInfoResultBO.setBizPayNo(capture.id()); |
| | | //商户订单号,之前生成的带用户ID的订单号 |
| | | payInfoResultBO.setPayNo(capture.invoiceId()); |
| | | payInfoResultBO.setIsPaySuccess(false); |
| | | ExchangeRate exchangeRate = shopConfig.getExchangeRate(); |
| | | BigDecimal payAmount = new BigDecimal(capture.amount().value()).multiply(exchangeRate.getCurExchangeRate()).setScale(2, RoundingMode.HALF_EVEN); |
| | | BigDecimal min = new BigDecimal("0.01"); |
| | | // 最小支付金额 |
| | | if (min.compareTo(payAmount) >= 0) { |
| | | payAmount = min; |
| | | } |
| | | log.info("amount: {}", payAmount.doubleValue()); |
| | | if("COMPLETED".equals(capture.status())) { |
| | | //进行数据库操作,修改订单状态为已支付成功,尽快发货(配合回调和CapturesGet查询确定成功) |
| | | log.info("支付成功,状态为=COMPLETED"); |
| | | payInfoResultBO.setIsPaySuccess(true); |
| | | payInfoResultBO.setPayAmount(payAmount.doubleValue()); |
| | | payInfoResultBO.setSuccessString(PP_SUCCESS); |
| | | } |
| | | if("PENDING".equals(capture.status())) { |
| | | log.info("status_details: {}", capture.captureStatusDetails().reason()); |
| | | String reason = "PENDING"; |
| | | if(capture.captureStatusDetails() != null && capture.captureStatusDetails().reason() != null) { |
| | | reason = capture.captureStatusDetails().reason(); |
| | | } |
| | | //进行数据库操作,修改订单状态为已支付成功,但触发了人工审核,请审核通过后再发货(配合回调和CapturesGet查询确定成功) |
| | | log.info("支付成功,状态为=PENDING : {}", reason); |
| | | payInfoResultBO.setIsPaySuccess(true); |
| | | payInfoResultBO.setPayAmount(payAmount.doubleValue()); |
| | | payInfoResultBO.setSuccessString(PP_SUCCESS); |
| | | } |
| | | } |
| | | } |
| | | // Payer buyer = response.result().payer() |
| | | |
| | | return payInfoResultBO; |
| | | } |
| | | |
| | | /** 查询订单信息 */ |
| | | public void queryOrder(String orderId){ |
| | | OrdersGetRequest request = new OrdersGetRequest(orderId); |
| | | HttpResponse<Order> response = null; |
| | | try { |
| | | response = client().execute(request); |
| | | } catch (Exception e) { |
| | | System.out.println("调用paypal订单查询失败"); |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | String intent = response.result().checkoutPaymentIntent(); |
| | | String status = response.result().status(); |
| | | log.info("Status Code: {}", response.statusCode()); |
| | | log.info("Order id: {}", response.result().id()); |
| | | log.info("intent: {}", intent); |
| | | log.info("status: {}", status); |
| | | if(response.result().purchaseUnits().get(0).payments() != null) { |
| | | List<Capture> captures = response.result().purchaseUnits().get(0).payments().captures(); |
| | | if(captures != null) { |
| | | for (Capture capture : captures) { |
| | | System.out.println("\t订单编号= " + capture.invoiceId() + "\tCapture Id= " + capture.id() + "\tCapture status= " + capture.status() + "\tCapture amount= " + capture.amount().currencyCode() + ":" + capture.amount().value()); |
| | | } |
| | | } |
| | | List<Refund> refunds = response.result().purchaseUnits().get(0).payments().refunds(); |
| | | if(refunds != null) { |
| | | for (Refund refund : refunds) { |
| | | System.out.println("\t售后编号= " + refund.invoiceId() + "\tRefund Id= " + refund.id() + "\tRefund status= " + refund.status() + "\tRefund amount= " + refund.amount().currencyCode() + ":" + refund.amount().value()); |
| | | } |
| | | } |
| | | } |
| | | System.out.println("Links: "); |
| | | for (com.paypal.orders.LinkDescription link : response.result().links()) { |
| | | System.out.println("\t" + link.rel() + ": " + link.href() + "\tCall Type: " + link.method()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 申请退款 |
| | | */ |
| | | public Boolean refundOrder(RefundInfoDto refundInfo){ |
| | | // 第三方paypal的交易号 |
| | | String captureId = refundInfo.getBizPayNo(); |
| | | // payNo 本系统生成的流水号 |
| | | String payNo = refundInfo.getPayNo(); |
| | | CapturesRefundRequest request = new CapturesRefundRequest(captureId); |
| | | request.prefer("return=representation"); |
| | | RefundRequest refundRequest = new RefundRequest(); |
| | | com.paypal.payments.Money money = new com.paypal.payments.Money(); |
| | | money.currencyCode(PaypalConstant.CURRENTCY); |
| | | // 金额转换为美元,然后再转为字符串类型 |
| | | // 获取汇率 |
| | | ExchangeRate exchangeRate = shopConfig.getExchangeRate(); |
| | | BigDecimal refundAmount = new BigDecimal(refundInfo.getRefundAmount().toString()).multiply(exchangeRate.getUsdExchangeRate()).setScale(2, RoundingMode.HALF_EVEN); |
| | | BigDecimal min = new BigDecimal("0.01"); |
| | | // paypal只支持小数后两位,最小必须支付0.01美元 |
| | | if (min.compareTo(refundAmount)>=0) { |
| | | refundAmount = min; |
| | | } |
| | | money.value(refundAmount.toString()); |
| | | refundRequest.amount(money); |
| | | refundRequest.invoiceId(payNo); |
| | | refundRequest.noteToPayer("7天无理由退款"); |
| | | |
| | | request.requestBody(refundRequest); |
| | | HttpResponse<com.paypal.payments.Refund> response = null; |
| | | try { |
| | | response =client().execute(request); |
| | | } catch (IOException e) { |
| | | log.error("调用paypal退款申请失败,失败原因 {}", e.getMessage()); |
| | | return false; |
| | | } |
| | | log.info("Status Code = {}, Status = {}, RefundID = {}", response.statusCode(), response.result().status(), response.result().id()); |
| | | if(StrUtil.equals(PaypalConstant.COMPLETED,response.result().status())) { |
| | | // 退款成功 |
| | | log.info("退款成功"); |
| | | return true; |
| | | } |
| | | return false; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 支付后查询扣款信息 |
| | | */ |
| | | public void getCapture(PayInfoResultBO payInfo) { |
| | | // 扣款查询 |
| | | CapturesGetRequest restRequest = new CapturesGetRequest(payInfo.getBizPayNo()); |
| | | HttpResponse<com.paypal.payments.Capture> response = null; |
| | | try { |
| | | response = client().execute(restRequest); |
| | | log.info("Paypal查单:Status Code = {}, Status = {}, RefundID = {}", response.statusCode(), response.result().status(), response.result().id()); |
| | | payInfo.setIsPaySuccess("COMPLETED".equals(response.result().status())); |
| | | } catch (IOException e) { |
| | | log.info("查询支付扣款失败:{}",e.getMessage()); |
| | | payInfo.setIsPaySuccess(false); |
| | | } |
| | | // log.info("Capture ids: " + response.result().id()); |
| | | } |
| | | |
| | | /** |
| | | * payPal webHook 钩子函数验签 |
| | | */ |
| | | public boolean verifyWebhookSign(HttpServletRequest request,Map<String, String> headers,String body) { |
| | | try { |
| | | APIContext apiContext = apiContext(); |
| | | // Set the webhookId that you received when you created this webhook. |
| | | apiContext.addConfiguration(Constants.PAYPAL_WEBHOOK_ID, shopConfig.getPayPal().getWebHookId()); |
| | | Boolean result = Event.validateReceivedEvent(apiContext, headers, body); |
| | | return result; |
| | | } catch (PayPalRESTException e) { |
| | | log.error("PayPalRESTException", e); |
| | | } catch (InvalidKeyException e) { |
| | | log.error("InvalidKeyException", e); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | log.error("NoSuchAlgorithmException", e); |
| | | } catch (SignatureException e) { |
| | | log.error("SignatureException", e); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 获取请求头部信息 |
| | | */ |
| | | public Map < String, String > getHeadersInfo(HttpServletRequest request) { |
| | | Map < String, String > map = new HashMap < String, String > (16); |
| | | @SuppressWarnings("rawtypes") |
| | | Enumeration headerNames = request.getHeaderNames(); |
| | | while (headerNames.hasMoreElements()) { |
| | | String key = (String) headerNames.nextElement(); |
| | | String value = request.getHeader(key); |
| | | map.put(key, value); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 创建钩子,回调时用到 |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public void createWebhook(String url){ |
| | | // event types |
| | | List<EventType> eventTypes = eventTypes(); |
| | | Webhook webhook = new Webhook(); |
| | | // webhook.setId(webHookId) |
| | | // 事件回调地址 |
| | | webhook.setUrl(url); |
| | | webhook.setEventTypes(eventTypes); |
| | | try{ |
| | | createWebHookRequest(webhook); |
| | | return; |
| | | } catch (PayPalRESTException e) { |
| | | Error details = e.getDetails(); |
| | | String name = details.getName(); |
| | | if (StrUtil.equals(name,PaypalConstant.WEBHOOK_NUMBER_LIMIT_EXCEEDED)) { |
| | | // 钩子超出限制,查出所有钩子,并且删除 |
| | | // 查出所有钩子 |
| | | List<Webhook> webHooks = getWebHooks(); |
| | | // 批量删除钩子 |
| | | deleteWebHooks(webHooks); |
| | | // 重新请求创建钩子 |
| | | try { |
| | | createWebHookRequest(webhook); |
| | | } catch (PayPalRESTException e1) { |
| | | e1.printStackTrace(); |
| | | log.error("删除所有网路钩子,重新请求钩失败,失败原因: {}",e1.getDetails()); |
| | | return; |
| | | } |
| | | } |
| | | log.error("PayPalRESTException:", e); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | /** |
| | | * 初始化所有监听事件 |
| | | * @return |
| | | */ |
| | | private List<EventType> eventTypes() { |
| | | // event type |
| | | List<String> events = new ArrayList<>(); |
| | | events.add(WebhookConstant.CHECKOUT_ORDER_APPROVED); |
| | | events.add(WebhookConstant.CHECKOUT_ORDER_COMPLETED); |
| | | events.add(WebhookConstant.CUSTOMER_PAYOUT_COMPLETED); |
| | | events.add(WebhookConstant.PAYMENT_CAPTURE_COMPLETED); |
| | | events.add(WebhookConstant.PAYMENT_SALE_COMPLETED); |
| | | // event types |
| | | List<EventType> eventTypes = new ArrayList(); |
| | | for (String event : events) { |
| | | EventType eventType = new EventType(); |
| | | eventType.setName(event); |
| | | eventTypes.add(eventType); |
| | | } |
| | | return eventTypes; |
| | | } |
| | | |
| | | /** |
| | | * 创建钩子 |
| | | * @param webhook |
| | | * @throws PayPalRESTException |
| | | */ |
| | | private void createWebHookRequest(Webhook webhook) throws PayPalRESTException { |
| | | Webhook createdWebHook = webhook.create(apiContext(), webhook); |
| | | System.out.println("WebHook successfully created with ID " + createdWebHook.getId()); |
| | | String webHookId = createdWebHook.getId(); |
| | | // 并且将钩子id更新到后台配置中 |
| | | // 到创建钩子这步,paypal可定是已经配置好了的,所以我们直接更新就好了 |
| | | if (StrUtil.isBlank(webHookId)) { |
| | | return; |
| | | } |
| | | PayPal payPal = shopConfig.getPayPal(); |
| | | payPal.setWebHookId(webHookId); |
| | | sysConfigService.updateValueByKey(Constant.PAYPAL_CONFIG, Json.toJsonString(payPal)); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有钩子 |
| | | * @return |
| | | */ |
| | | private List<Webhook> getWebHooks(){ |
| | | WebhookList webhookList = new WebhookList(); |
| | | try { |
| | | webhookList = webhookList.getAll(apiContext()); |
| | | List<Webhook> webhooks = webhookList.getWebhooks(); |
| | | return webhooks; |
| | | } catch (PayPalRESTException e) { |
| | | log.error("PayPalRESTException:", e); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 批量删除网络钩子 |
| | | * @param webhooks |
| | | */ |
| | | private void deleteWebHooks(List<Webhook> webhooks){ |
| | | if (CollectionUtils.isEmpty(webhooks)) { |
| | | return; |
| | | } |
| | | for (Webhook webhook : webhooks) { |
| | | deleteWebHook(webhook); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除单个网络钩子 |
| | | * @param webhook |
| | | */ |
| | | private void deleteWebHook(Webhook webhook){ |
| | | String id = webhook.getId(); |
| | | try { |
| | | webhook.delete(apiContext(),id); |
| | | } catch (PayPalRESTException e) { |
| | | log.error("PayPalRESTException:", e); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.config; |
| | | |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.yami.shop.common.bean.*; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.common.constants.PaypalConstant; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.service.SysConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 商城配置文件 |
| | | * 支付配置、文件上传配置、短信配置、快递配置、小程序配置、微信网页开发配置、公众号配置 |
| | | * @author yami |
| | | */ |
| | | @Component |
| | | public class ShopConfig { |
| | | |
| | | @Autowired |
| | | private SysConfigService sysConfigService; |
| | | |
| | | public Qiniu getQiniu(){ |
| | | // 从数据库 / 缓存中获取到配置文件信息 |
| | | return sysConfigService.getSysConfigObject(Constant.QINIU_CONFIG, Qiniu.class); |
| | | } |
| | | |
| | | public AliOss getAliOss() { |
| | | return sysConfigService.getSysConfigObject(Constant.ALI_OSS_CONFIG, AliOss.class); |
| | | } |
| | | |
| | | public QCloud getQCloud() { |
| | | return sysConfigService.getSysConfigObject(Constant.Q_CLOUD_CONFIG,QCloud.class); |
| | | } |
| | | |
| | | public HuaWeiOss getHuaWeiObs() { |
| | | return sysConfigService.getSysConfigObject(Constant.HUAWEI_OBS_CONFIG, HuaWeiOss.class); |
| | | } |
| | | |
| | | public Minio getMinio() { |
| | | return sysConfigService.getSysConfigObject(Constant.MINIO_OSS_CONFIG, Minio.class); |
| | | } |
| | | |
| | | public ALiDaYu getAliDaYu(){ |
| | | ALiDaYu aLiDaYu = sysConfigService.getSysConfigObject(Constant.ALIDAYU_CONFIG, ALiDaYu.class); |
| | | if (aLiDaYu == null || StrUtil.isBlank(aLiDaYu.getAccessKeyId())) { |
| | | // 无法获取短信配置,无法发送短信 |
| | | throw new YamiShopBindException("yami.sys.sms.no.exist"); |
| | | } |
| | | return aLiDaYu; |
| | | } |
| | | |
| | | |
| | | public QuickBird getQuickBird() { |
| | | return sysConfigService.getSysConfigObject(Constant.QUICKBIRD_CONFIG, QuickBird.class); |
| | | } |
| | | |
| | | public Quick100 getQuick100() { |
| | | return sysConfigService.getSysConfigObject(Constant.QUICK100_CONFIG, Quick100.class); |
| | | } |
| | | |
| | | public QuickAli getAliQuick() { |
| | | return sysConfigService.getSysConfigObject(Constant.ALI_QUICK_CONFIG, QuickAli.class); |
| | | } |
| | | |
| | | |
| | | public WxMiniApp getWxMiniApp() { |
| | | WxMiniApp wxMiniApp = sysConfigService.getSysConfigObject(Constant.MA_CONFIG, WxMiniApp.class); |
| | | if (wxMiniApp == null || StrUtil.isBlank(wxMiniApp.getAppId())) { |
| | | // 请在后台页面设置微信小程序信息后,再进行操作 |
| | | throw new YamiShopBindException("yami.sys.wxMa.no.exist"); |
| | | } |
| | | return wxMiniApp; |
| | | } |
| | | |
| | | public WxMp getWxMp() { |
| | | WxMp wxMp = sysConfigService.getSysConfigObject(Constant.MP_CONFIG, WxMp.class); |
| | | if (wxMp == null || StrUtil.isBlank(wxMp.getAppId())) { |
| | | // 请在后台页面设置微信公众号信息后,再进行操作 |
| | | throw new YamiShopBindException("yami.sys.wxMp.no.exist"); |
| | | } |
| | | return wxMp; |
| | | } |
| | | |
| | | public WxApp getWxApp() { |
| | | WxApp wxApp = sysConfigService.getSysConfigObject(Constant.MX_APP_CONFIG, WxApp.class); |
| | | if (wxApp == null || StrUtil.isBlank(wxApp.getAppId())) { |
| | | // 请在后台页面设置微信开放平申请应用相关信息后,再进行操作 |
| | | throw new YamiShopBindException("yami.sys.wxApp.no.exist"); |
| | | } |
| | | return wxApp; |
| | | } |
| | | |
| | | public WxPay getWxPay() { |
| | | WxPay wxPay = sysConfigService.getSysConfigObject(Constant.WXPAY_CONFIG, WxPay.class); |
| | | if (wxPay == null || StrUtil.isBlank(wxPay.getMchId())) { |
| | | // 请在后台页面设置微信支付信息后,再进行操作 |
| | | throw new YamiShopBindException("yami.sys.wxPay.no.exist"); |
| | | } |
| | | return wxPay; |
| | | } |
| | | |
| | | public Alipay getAlipay() { |
| | | |
| | | return sysConfigService.getSysConfigObject(Constant.ALIPAY_CONFIG,Alipay.class); |
| | | } |
| | | |
| | | public Domain getDomain() { |
| | | Domain domain = sysConfigService.getSysConfigObject(Constant.DOMAIN_CONFIG, Domain.class); |
| | | if (domain == null || StrUtil.isBlank(domain.getApiDomainName())) { |
| | | // 请在后台页面设置回调域名后,再进行操作 |
| | | throw new YamiShopBindException("yami.sys.wxDomain.no.exist"); |
| | | } |
| | | return domain; |
| | | } |
| | | |
| | | public PayPal getPayPal() { |
| | | PayPal payPal = sysConfigService.getSysConfigObject(Constant.PAYPAL_CONFIG, PayPal.class); |
| | | boolean is = Objects.isNull(payPal) |
| | | || StrUtil.isBlank(payPal.getClientId()) |
| | | || StrUtil.isBlank(payPal.getClientSecret()); |
| | | if (is) { |
| | | // 请在后台页面设置paypal相关信息后,再进行操作 |
| | | throw new YamiShopBindException("yami.sys.paypal.no.exist"); |
| | | } |
| | | if (StrUtil.isBlank(payPal.getMode())) { |
| | | payPal.setMode(PaypalConstant.PAYPAL_MODE); |
| | | } |
| | | return payPal; |
| | | } |
| | | |
| | | public ExchangeRate getExchangeRate() { |
| | | ExchangeRate exchangeRate = sysConfigService.getSysConfigObject(Constant.EXCHANGE_RATE_CONFIG, ExchangeRate.class); |
| | | if (exchangeRate == null) { |
| | | // 请在后台页面设置paypal相关信息后,再进行操作 |
| | | throw new YamiShopBindException("yami.sys.paypal.no.exist"); |
| | | } |
| | | return exchangeRate; |
| | | } |
| | | |
| | | |
| | | private String getEbusinessIdByStr(String paramValue){ |
| | | String[] split = paramValue.split(","); |
| | | for (String s : split) { |
| | | if (s.contains("eBusinessID")){ |
| | | String[] split1 = s.split(":"); |
| | | String str = split1[1]; |
| | | String replace = str.replace("\"", ""); |
| | | return replace; |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | public CDNDevice getCDNDevice() { |
| | | CDNDevice cdnDevice = sysConfigService.getSysConfigObject(Constant.CDN_DEVICE_CONFIG, CDNDevice.class); |
| | | if (cdnDevice == null) { |
| | | // 请先配置接口调用token信息,再进行操作 |
| | | throw new YamiShopBindException("yami.pcdn.device.token"); |
| | | } |
| | | return cdnDevice; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.config; |
| | | |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | | import cn.binarywang.wx.miniapp.api.impl.WxMaServiceHttpClientImpl; |
| | | import cn.binarywang.wx.miniapp.config.impl.WxMaRedissonConfigImpl; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.github.binarywang.wxpay.config.WxPayConfig; |
| | | import com.github.binarywang.wxpay.constant.WxPayConstants; |
| | | import com.github.binarywang.wxpay.service.EntPayService; |
| | | import com.github.binarywang.wxpay.service.WxPayService; |
| | | import com.github.binarywang.wxpay.service.impl.EntPayServiceImpl; |
| | | import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl; |
| | | import com.yami.shop.common.bean.WxApp; |
| | | import com.yami.shop.common.bean.WxMiniApp; |
| | | import com.yami.shop.common.bean.WxMp; |
| | | import com.yami.shop.common.bean.WxPay; |
| | | import com.yami.shop.common.enums.PayType; |
| | | import lombok.AllArgsConstructor; |
| | | import me.chanjar.weixin.mp.api.WxMpService; |
| | | import me.chanjar.weixin.mp.api.impl.WxMpServiceHttpClientImpl; |
| | | import me.chanjar.weixin.mp.config.impl.WxMpRedissonConfigImpl; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 通过微信配置获取微信的支付信息,登陆信息等 |
| | | * @author LGH |
| | | */ |
| | | @Component |
| | | @AllArgsConstructor |
| | | public class WxConfig { |
| | | |
| | | private final ShopConfig shopConfig; |
| | | |
| | | private final RedissonClient redissonClient; |
| | | |
| | | |
| | | private static final String MA_CONFIG_KEY_PREFIX = "mall4j:ma_config_key_prefix"; |
| | | |
| | | private static final String MP_CONFIG_KEY_PREFIX = "mall4j:mp_config_key_prefix"; |
| | | |
| | | /** |
| | | * 根据支付方式,获取微信支付信息 |
| | | * @param payType |
| | | * @return |
| | | */ |
| | | public WxPayService getWxPayService(PayType payType) { |
| | | |
| | | String appid; |
| | | // 小程序支付 |
| | | if (Objects.equals(payType, PayType.WECHATPAY)) { |
| | | WxMiniApp wxMiniApp = shopConfig.getWxMiniApp(); |
| | | appid = wxMiniApp.getAppId(); |
| | | } else if (Objects.equals(payType, PayType.WECHATPAY_APP)) { |
| | | WxApp wxApp = shopConfig.getWxApp(); |
| | | appid = wxApp.getAppId(); |
| | | } else { |
| | | WxMp wxMp = shopConfig.getWxMp(); |
| | | appid = wxMp.getAppId(); |
| | | } |
| | | |
| | | WxPayConfig payConfig = getWxPay(appid); |
| | | |
| | | WxPayService wxPayService = new WxPayServiceImpl(); |
| | | |
| | | wxPayService.setConfig(payConfig); |
| | | return wxPayService; |
| | | } |
| | | |
| | | public WxMaService getWxMaService() { |
| | | WxMiniApp wxMiniApp = shopConfig.getWxMiniApp(); |
| | | // access token用redis缓存 |
| | | WxMaRedissonConfigImpl maRedissonConfig = new WxMaRedissonConfigImpl(redissonClient, MA_CONFIG_KEY_PREFIX); |
| | | maRedissonConfig.setAppid(wxMiniApp.getAppId()); |
| | | maRedissonConfig.setSecret(wxMiniApp.getSecret()); |
| | | |
| | | WxMaServiceHttpClientImpl wxMaServiceHttpClient = new WxMaServiceHttpClientImpl(); |
| | | wxMaServiceHttpClient.setWxMaConfig(maRedissonConfig); |
| | | return wxMaServiceHttpClient; |
| | | } |
| | | |
| | | |
| | | public WxMpService getWxMpService() { |
| | | WxMp wxMp = shopConfig.getWxMp(); |
| | | // access token用redis缓存 |
| | | WxMpRedissonConfigImpl wxMpRedisConfig = new WxMpRedissonConfigImpl(redissonClient, MP_CONFIG_KEY_PREFIX); |
| | | wxMpRedisConfig.setAppId(wxMp.getAppId()); |
| | | wxMpRedisConfig.setSecret(wxMp.getSecret()); |
| | | |
| | | WxMpServiceHttpClientImpl wxMpServiceHttpClient = new WxMpServiceHttpClientImpl(); |
| | | wxMpServiceHttpClient.setWxMpConfigStorage(wxMpRedisConfig); |
| | | return wxMpServiceHttpClient; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信将要废弃这个接口 |
| | | * @return |
| | | */ |
| | | @Deprecated |
| | | public EntPayService getEntPayService() { |
| | | String appid; |
| | | WxMiniApp wxMiniApp = shopConfig.getWxMiniApp(); |
| | | // 小程序支付 |
| | | if (wxMiniApp != null && StrUtil.isNotBlank(wxMiniApp.getAppId())) { |
| | | |
| | | appid = wxMiniApp.getAppId(); |
| | | } else { |
| | | WxMp wxMp = shopConfig.getWxMp(); |
| | | appid = wxMp.getAppId(); |
| | | } |
| | | |
| | | WxPayService wxPayService = new WxPayServiceImpl(); |
| | | wxPayService.setConfig(getWxPay(appid)); |
| | | return new EntPayServiceImpl(wxPayService); |
| | | } |
| | | |
| | | private WxPayConfig getWxPay(String appid) { |
| | | WxPay wxPay = shopConfig.getWxPay(); |
| | | WxPayConfig payConfig = new WxPayConfig(); |
| | | // 都需要的配置 |
| | | payConfig.setAppId(appid); |
| | | payConfig.setMchId(wxPay.getMchId()); |
| | | // v3需要的配置 |
| | | if (Objects.equals(WxPay.VERSION_3, wxPay.getVersion())) { |
| | | payConfig.setCertSerialNo(wxPay.getCertSerialNo()); |
| | | payConfig.setApiV3Key(wxPay.getApiv3Key()); |
| | | payConfig.setPrivateKeyPath(wxPay.getPrivateKeyPath()); |
| | | payConfig.setPrivateCertPath(wxPay.getPrivateCertPath()); |
| | | } else { |
| | | // v2需要的配置 |
| | | payConfig.setMchKey(wxPay.getMchKey()); |
| | | payConfig.setKeyPath(wxPay.getKeyPath()); |
| | | payConfig.setSignType(WxPayConstants.SignType.MD5); |
| | | } |
| | | return payConfig; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.AgentLevel; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_agent_level(cdn 代理等级)】的数据库操作Mapper |
| | | * @createDate 2024-06-28 17:47:05 |
| | | * @Entity com.yami.shop.bean.model.CdnAgentLevel |
| | | */ |
| | | public interface AgentLevelMapper extends BaseMapper<AgentLevel> { |
| | | |
| | | List<AgentLevel> getAgentLevelList(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.yami.shop.bean.model.Agent; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_agent(代理商表)】的数据库操作Mapper |
| | | * @createDate 2024-06-03 14:08:39 |
| | | * @Entity com.yami.shop.bean.model.Agent |
| | | */ |
| | | public interface AgentMapper extends BaseMapper<Agent> { |
| | | |
| | | @Select("select id from tz_agent where agent_code = #{agentCode}") |
| | | Long selectIdByAgentCode(String agentCode); |
| | | |
| | | @Select("select id from tz_agent where agent_region like #{areaRegion} ORDER BY id desc limit 1") |
| | | Long getAgentIdByNearAgent(String areaRegion); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.dto.AreaDto; |
| | | import com.yami.shop.bean.model.Area; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface AreaMapper extends BaseMapper<Area> { |
| | | /** |
| | | * 获取所有区域的组合数据列表 |
| | | * @return 区域信息列表 |
| | | */ |
| | | List<AreaDto> getAreaListInfo(); |
| | | |
| | | /** |
| | | * 如果level = 1 ,过滤掉没有三级地址的一级地址 |
| | | * @param pid 父级id |
| | | * @param level 地址级别 |
| | | * @return 地址列表 |
| | | */ |
| | | List<Area> listByPid(@Param("pid") Long pid, @Param("level") Integer level); |
| | | |
| | | /** |
| | | * 获取可用的省市区列表 |
| | | * @return |
| | | */ |
| | | List<AreaDto> listAreaOfEnable(); |
| | | |
| | | /** |
| | | * 获取四层可用列表 |
| | | * @return |
| | | */ |
| | | List<AreaDto> getAllAreaList(); |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.Assets; |
| | | |
| | | /** |
| | | * <p> |
| | | * 资产类型 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2024-04-24 |
| | | */ |
| | | public interface AssetsMapper extends BaseMapper<Assets> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.AttachFileGroup; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author chendt |
| | | * @date 2021/7/7 17:21 |
| | | */ |
| | | public interface AttachFileGroupMapper extends BaseMapper<AttachFileGroup> { |
| | | /** |
| | | * 获取列表 |
| | | * @param shopId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | List<AttachFileGroup> list(@Param("shopId") Long shopId, @Param("type") Integer type); |
| | | |
| | | /** |
| | | * 根据id获取 |
| | | * |
| | | * @param attachFileGroupId id |
| | | * @return |
| | | */ |
| | | AttachFileGroup getByAttachFileGroupId(@Param("attachFileGroupId") Long attachFileGroupId); |
| | | |
| | | /** |
| | | * 保存 |
| | | * |
| | | * @param attachFileGroup |
| | | */ |
| | | void save(@Param("attachFileGroup") AttachFileGroup attachFileGroup); |
| | | |
| | | /** |
| | | * 更新 |
| | | * |
| | | * @param attachFileGroup |
| | | */ |
| | | void update(@Param("attachFileGroup") AttachFileGroup attachFileGroup); |
| | | |
| | | /** |
| | | * 根据id删除 |
| | | * |
| | | * @param attachFileGroupId |
| | | */ |
| | | void deleteById(@Param("attachFileGroupId") Long attachFileGroupId); |
| | | |
| | | /** |
| | | * 根据分组名称查询分组数量 |
| | | * @param name |
| | | * @param shopId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | int getGroupCountByName(@Param("name")String name,@Param("shopId")Long shopId,@Param("type")Integer type); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.AttachFile; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface AttachFileMapper extends BaseMapper<AttachFile> { |
| | | |
| | | /** |
| | | * 根据文件ID更新文件名称和分组 |
| | | * @param attachFile 文件参数 |
| | | * @return 是否成功 |
| | | */ |
| | | Boolean updateFile(@Param("attachFile") AttachFile attachFile); |
| | | |
| | | /** |
| | | * 分页获取文件数据列表 |
| | | * @param page 分页参数 |
| | | * @param attachFile 文件搜索参数 |
| | | * @return 文件分页结果列表 |
| | | */ |
| | | IPage<AttachFile> getPage(PageParam<AttachFile> page, @Param("attachFile") AttachFile attachFile); |
| | | |
| | | /** |
| | | * 批量更新文件的分组 |
| | | * @param attachFileGroupId |
| | | */ |
| | | void updateBatchByAttachFileGroupId(@Param("attachFileGroupId") Long attachFileGroupId); |
| | | |
| | | /** |
| | | * 根据id列表获取文件信息列表 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<AttachFile> getByIds(@Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * 根据id列表批量删除文件记录 |
| | | * @param ids |
| | | */ |
| | | void batchDeleteByIds(@Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * 根据店铺id与文件id列表与分组id批量移动文件 |
| | | * @param shopId 店铺id |
| | | * @param fileIds 文件id列表 |
| | | * @param attachFileGroupId 文件分组id |
| | | */ |
| | | void batchMoveByShopIdAndIdsAndGroupId(@Param("shopId") Long shopId, @Param("fileIds") List<Long> fileIds, @Param("attachFileGroupId") Long attachFileGroupId); |
| | | |
| | | /** |
| | | * 保存 |
| | | * @param attachFile |
| | | * @return |
| | | */ |
| | | Long save(@Param("attachFile")AttachFile attachFile); |
| | | |
| | | /** |
| | | * 查看名称使用情况 |
| | | * @param fileName 文件名 |
| | | * @param shopId 店铺id |
| | | * @param fileType 文件类型 |
| | | * @return |
| | | */ |
| | | int getFileByName(@Param("fileName")String fileName,@Param("shopId") Long shopId,@Param("fileType")Integer fileType); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.app.dto.ShopCartItemDto; |
| | | import com.yami.shop.bean.app.param.CheckShopCartItemParam; |
| | | import com.yami.shop.bean.app.param.ShopCartParam; |
| | | import com.yami.shop.bean.model.Basket; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface BasketMapper extends BaseMapper<Basket> { |
| | | |
| | | /** |
| | | * 根据用户ID获取购物车项内容列表 |
| | | * |
| | | * @param userId 用户ID |
| | | * @param dbLang 当前选择的语言 |
| | | * @return 购物车信息项列表 |
| | | */ |
| | | List<ShopCartItemDto> getShopCartItems(@Param("userId") String userId, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 根据用户ID与购物车ID删除购物车信息 |
| | | * |
| | | * @param userId 用户ID |
| | | * @param basketIds 购物车ID |
| | | */ |
| | | void deleteShopCartItemsByBasketIds(@Param("userId") String userId, @Param("basketIds") List<Long> basketIds); |
| | | |
| | | /** |
| | | * 根据用户ID删除该用户下的购物车信息 |
| | | * |
| | | * @param userId 用户ID |
| | | */ |
| | | void deleteAllShopCartItems(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 根据用户ID获取购物车中已下架的商品列表 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 商品已下架的购物车项列表 |
| | | */ |
| | | List<ShopCartItemDto> getShopCartExpiryItems(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 根据用户ID删除该用户购物车中已下架的商品列表 |
| | | * |
| | | * @param userId 用户ID |
| | | */ |
| | | void cleanExpiryProdList(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 根据购物车ID列表批量获取购物车信息列表 |
| | | * |
| | | * @param basketIdList 购物车ID列表 |
| | | * @return 购物车信息列表 |
| | | */ |
| | | List<ShopCartItemDto> shopCartItemDtoList(@Param("basketIdList") List<Long> basketIdList); |
| | | |
| | | /** |
| | | * 根据用户ID批量更新用户的购物车信息 |
| | | * |
| | | * @param userId 用户ID |
| | | * @param shopCartParams 购物车信息列表 |
| | | */ |
| | | void updateDiscountItemId(@Param("userId") String userId, @Param("shopCartParams") List<ShopCartParam> shopCartParams); |
| | | |
| | | /** |
| | | * 根据商品ID批量获取购物车中有该商品的用户ID列表 |
| | | * |
| | | * @param prodId 商品ID |
| | | * @return 购物车中有该商品的用户ID列表 |
| | | */ |
| | | List<String> listUserIdByProdId(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 根据商品id获取购物车中拥有某件商品的用户 |
| | | * |
| | | * @param pIds |
| | | * @return |
| | | */ |
| | | List<String> listUserIdByProdIds(@Param("prodIds") List<Long> pIds); |
| | | |
| | | /** |
| | | * 获取加购了某个套餐的用户id |
| | | * |
| | | * @param comboId |
| | | * @param skuIds |
| | | * @return |
| | | */ |
| | | List<String> removeByComboIdAndSkuIds(@Param("comboId") Long comboId, @Param("skuIds") List<Long> skuIds); |
| | | |
| | | /** |
| | | * 获取购物车商品数量 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | Integer getShopCartProdNum(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 勾选购车车状态 |
| | | * @param userId 用户id |
| | | * @param checkShopCartItems 参数 |
| | | */ |
| | | void checkShopCartItems(@Param("userId") String userId, @Param("checkShopCartItems") List<CheckShopCartItemParam> checkShopCartItems); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.dto.BrandShopDTO; |
| | | import com.yami.shop.bean.model.BrandLang; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 品牌-国际化表 |
| | | * |
| | | * @author YXF |
| | | * @date 2021-08-09 09:51:55 |
| | | */ |
| | | public interface BrandLangMapper extends BaseMapper<BrandLang> { |
| | | |
| | | /** |
| | | * 批量删除品牌信息 |
| | | * |
| | | * @param langIds 语言id列表 |
| | | * @param brandId 品牌id |
| | | */ |
| | | void batchDelete(@Param("langIds") List<Integer> langIds, @Param("brandId") Long brandId); |
| | | |
| | | /** |
| | | * 批量更新 |
| | | * |
| | | * @param brandLangList |
| | | */ |
| | | void batchUpdate(@Param("brandLangList") List<BrandLang> brandLangList); |
| | | |
| | | /** |
| | | * 批量保存 |
| | | * |
| | | * @param brandLangList |
| | | */ |
| | | void batchSave(@Param("brandLangList") List<BrandLang> brandLangList); |
| | | |
| | | /** |
| | | * 保存 |
| | | * |
| | | * @param brandLang |
| | | */ |
| | | void save(@Param("brandLang") BrandLang brandLang); |
| | | |
| | | /** |
| | | * 批量插入品牌信息 |
| | | * |
| | | * @param brandList |
| | | * @param lang |
| | | */ |
| | | void insertBatch(@Param("brandList") List<BrandShopDTO> brandList, @Param("lang") Integer lang); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.dto.BrandShopDTO; |
| | | import com.yami.shop.bean.model.Brand; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface BrandMapper extends BaseMapper<Brand> { |
| | | |
| | | /** |
| | | * 获取品牌信息列表 |
| | | * |
| | | * @param page 分页信息 |
| | | * @param brand 品牌信息 |
| | | * @return 品牌信息列表 |
| | | */ |
| | | List<Brand> list(@Param("page") PageAdapter page, @Param("brand") Brand brand); |
| | | |
| | | /** |
| | | * 获取品牌数量 |
| | | * |
| | | * @param brand 品牌信息 |
| | | * @return 品牌信息列表 |
| | | */ |
| | | Long listTotal(@Param("brand") Brand brand); |
| | | |
| | | /** |
| | | * 根据品牌信息id获取品牌信息 |
| | | * |
| | | * @param brandId 品牌信息id |
| | | * @return 品牌信息 |
| | | */ |
| | | Brand getByBrandId(@Param("brandId") Long brandId); |
| | | |
| | | /** |
| | | * 获取品牌在商品中使用的数量 |
| | | * |
| | | * @param brandId |
| | | * @return 使用该品牌的商品数量 |
| | | */ |
| | | int getUseNum(@Param("brandId") Long brandId); |
| | | |
| | | /** |
| | | * 更新品牌状态(启用或禁用) |
| | | * |
| | | * @param brand |
| | | */ |
| | | void updateBrandStatus(@Param("brand") Brand brand); |
| | | |
| | | /** |
| | | * 根据分类id,获取品牌列表(分类中的推荐品牌) |
| | | * @param categoryId |
| | | * @param name |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Brand> listByCategoryIdAndName(@Param("categoryId") Long categoryId, @Param("name") String name, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 批量插入品牌列表 |
| | | * @param brandShopList |
| | | */ |
| | | void insertBatchByBrandShopList(@Param("brandList") List<BrandShopDTO> brandShopList); |
| | | |
| | | /** |
| | | * 获取品牌列表 |
| | | * @param brand |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Brand> listByParams(@Param("brand") Brand brand, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取分类及语言信息 |
| | | * |
| | | * @param brandIds |
| | | * @return |
| | | */ |
| | | List<Brand> listAndLang(@Param("brandIds") List<Long> brandIds); |
| | | |
| | | /** |
| | | * 根据店铺id与品牌名称,分类id获取已经签约的品牌列表 |
| | | * @param page |
| | | * @param categoryId |
| | | * @param brandName |
| | | * @param shopId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | IPage<Brand> pageSigningByShopIdAndBrandNameAndCategoryId(@Param("page") PageParam<Brand> page, @Param("categoryId") Long categoryId, @Param("brandName") String brandName, @Param("shopId") Long shopId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据店铺id更新该店铺下的品牌的店铺id和品牌状态 |
| | | * @param oldShopId |
| | | * @param status |
| | | * @param newShopId |
| | | */ |
| | | void updateShopIdAndStatusByShopId(@Param("oldShopId") Long oldShopId, @Param("status") Integer status, @Param("newShopId") Long newShopId); |
| | | |
| | | /** |
| | | * 获取指定品牌列表 |
| | | * @param brandIds |
| | | * @return |
| | | */ |
| | | List<Brand> listByBrandIds(@Param("brandIds") Set<Long> brandIds); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.dto.BrandShopDTO; |
| | | import com.yami.shop.bean.model.BrandShop; |
| | | import com.yami.shop.bean.vo.BrandShopVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author lth |
| | | * @Date 2021/7/21 16:23 |
| | | */ |
| | | public interface BrandShopMapper extends BaseMapper<BrandShop> { |
| | | |
| | | /** |
| | | * 根据品牌类型批量插入品牌店铺关联信息 |
| | | * @param shopId 店铺id |
| | | * @param brandShopList 品牌信息列表 |
| | | * @param type 签约类型 |
| | | * @param status 签约状态 |
| | | */ |
| | | void insertBatch(@Param("shopId") Long shopId, @Param("brandShopList") List<BrandShopDTO> brandShopList, @Param("type") Integer type, @Param("status") Integer status); |
| | | |
| | | /** |
| | | * 根据店铺id获取该店铺已签约的品牌信息 |
| | | * @param shopId 店铺id |
| | | * @param type 品牌类型 |
| | | * @param lang 当前语言 |
| | | * @param status 签约状态 |
| | | * @return 品牌信息列表 |
| | | */ |
| | | List<BrandShopVO> listByShopIdAndType(@Param("shopId") Long shopId, @Param("type") Integer type, @Param("lang") Integer lang, @Param("status") Integer status); |
| | | |
| | | /** |
| | | * 根据店铺id更新店铺品牌签约类型 |
| | | * @param shopId |
| | | * @param type |
| | | */ |
| | | void updateTypeByShopId(@Param("shopId") Long shopId, @Param("type") Integer type); |
| | | |
| | | /** |
| | | * 根据店铺id与状态更改签约状态 |
| | | * @param shopId |
| | | * @param oldStatus |
| | | * @param newStatus |
| | | */ |
| | | void changeStatusByShopIdAndStatus(@Param("shopId") Long shopId, @Param("oldStatus") Integer oldStatus, @Param("newStatus") Integer newStatus); |
| | | |
| | | /** |
| | | * 根据店铺id分页签约的品牌列表 |
| | | * @param page |
| | | * @param brandShop |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | IPage<BrandShopVO> pageSigningByShopId(@Param("page") PageParam<BrandShopVO> page, @Param("brandShop") BrandShopDTO brandShop, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 批量保存签约品牌信息 |
| | | * @param shopId |
| | | * @param brandShopList |
| | | * @param type |
| | | * @param status |
| | | */ |
| | | void insertBatchByBrandShopList(@Param("shopId") Long shopId, @Param("brandShopList") List<BrandShop> brandShopList, @Param("type") Integer type, @Param("status") Integer status); |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.C2cRealName; |
| | | import com.yami.shop.bean.model.CdnRealName; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_real_name(实名认证)】的数据库操作Mapper |
| | | * @createDate 2024-07-01 11:38:28 |
| | | * @Entity com.yami.shop.bean.model.CdnRealName |
| | | */ |
| | | public interface C2cRealNameMapper extends BaseMapper<C2cRealName> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.Category; |
| | | import com.yami.shop.bean.model.CategoryBrand; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface CategoryBrandMapper extends BaseMapper<CategoryBrand> { |
| | | |
| | | /** |
| | | * 批量插入分类品牌关联信息 |
| | | * @param categoryId 分类ID |
| | | * @param brandIds 品牌ID列表 |
| | | */ |
| | | void insertCategoryBrand(@Param("categoryId") Long categoryId, @Param("brandIds") List<Long> brandIds); |
| | | |
| | | /** |
| | | * 根据分类ID删除分类品牌关联信息 |
| | | * @param categoryId 分类ID |
| | | */ |
| | | void deleteByCategoryId(Long categoryId); |
| | | |
| | | /** |
| | | * 根据品牌ID删除分类品牌关联信息 |
| | | * @param brandId 品牌ID |
| | | */ |
| | | void deleteByBrandId(Long brandId); |
| | | |
| | | /** |
| | | * 根据品牌id获取关联的分类id |
| | | * |
| | | * @param brandId 品牌id |
| | | * @return 分类id列表 |
| | | */ |
| | | List<Long> getCategoryIdsByBrandId(@Param("brandId") Long brandId); |
| | | |
| | | /** |
| | | * 获取品牌分类信息 |
| | | * @param brandId 品牌id |
| | | * @param lang 语言 |
| | | * @return 分类信息 |
| | | */ |
| | | List<Category> getCategoryByBrandId(@Param("brandId") Long brandId, @Param("lang") Integer lang); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CategoryLang; |
| | | |
| | | /** |
| | | * @author yami |
| | | * @date 2021-02-24 17:02:06 |
| | | */ |
| | | public interface CategoryLangMapper extends BaseMapper<CategoryLang> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CategoryLifeShop; |
| | | import com.yami.shop.bean.model.CategoryShop; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_category_life_shop(店铺分类关联信息)】的数据库操作Mapper |
| | | * @createDate 2024-06-04 20:28:21 |
| | | * @Entity com.yami.shop.CategoryLifeShop |
| | | */ |
| | | public interface CategoryLifeShopMapper extends BaseMapper<CategoryLifeShop> { |
| | | |
| | | void saveBatch(@Param("categoryShopList") List<CategoryLifeShop> categoryShopList, @Param("shopId") Long shopId, @Param("status") Integer status); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.Category; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface CategoryMapper extends BaseMapper<Category> { |
| | | |
| | | /** |
| | | * 根据父分类ID获取所有该父分类ID下的子分类列表 |
| | | * |
| | | * @param parentId 父分类ID |
| | | * @param dbLang 当前选择语言 |
| | | * @return 子分类列表 |
| | | */ |
| | | List<Category> listByParentId(@Param("parentId") Long parentId, @Param("lang") Integer dbLang); |
| | | |
| | | /** |
| | | * 根据一级分类ID查找所有该分类下的所有三级分类列表 |
| | | * |
| | | * @param parentId 一级分类ID |
| | | * @param dbLang 当前选择语言 |
| | | * @return 三级分类列表 |
| | | */ |
| | | List<Category> listThreeByParentId(@Param("parentId") Long parentId, @Param("lang") Integer dbLang); |
| | | |
| | | /** |
| | | * 根据分类ID获取该分类的父分类ID |
| | | * |
| | | * @param parentId 分类ID |
| | | * @return 父分类ID |
| | | */ |
| | | Long getParentCategoryByParentId(@Param("parentId") Long parentId); |
| | | |
| | | /** |
| | | * 根据分类查找条件参数查找分类列表 |
| | | * |
| | | * @param category 分类查找条件参数 |
| | | * @return 分类列表 |
| | | */ |
| | | List<Category> categoryList(@Param("category") Category category); |
| | | |
| | | /** |
| | | * 根据分类查找条件参数查找分类列表[语言] |
| | | * |
| | | * @param category 分类查找条件参数 |
| | | * @return 分类列表 |
| | | */ |
| | | List<Category> categoryLangList(@Param("category") Category category); |
| | | |
| | | /** |
| | | * 分页(重载) - 根据分类查找条件参数查找分类列表[语言] |
| | | * |
| | | * @param pageParam |
| | | * @param category |
| | | * @return |
| | | */ |
| | | IPage<Category> categoryLangList(PageParam<Category> pageParam, @Param("category") Category category); |
| | | |
| | | /** |
| | | * 根据条件查找分类列表 |
| | | * |
| | | * @param lang 当前选择语言 |
| | | * @param maxGrade 最大级别 |
| | | * @param parentId 父分类ID |
| | | * @param status 状态 |
| | | * @param shopId 店铺ID |
| | | * @return 分类列表 |
| | | */ |
| | | List<Category> listByLang(@Param("lang") Integer lang, @Param("maxGrade") Integer maxGrade, |
| | | @Param("parentId") Long parentId, @Param("status") Integer status, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据分类ID与店铺ID获取分类信息 |
| | | * |
| | | * @param categoryId 分类ID |
| | | * @param shopId 店铺ID |
| | | * @return 分类信息 |
| | | */ |
| | | Category getCategory(@Param("categoryId") Long categoryId, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据名称查找名称相同的分类数量,如果设置了category_id参数,则等于category_id等于该参数的分类不参与运算 |
| | | * |
| | | * @param category 分类查找参数 |
| | | * @return 相同名称的数量 |
| | | */ |
| | | Integer getCategoryName(@Param("category") Category category); |
| | | |
| | | /** |
| | | * 根据条件参数获取分类列表 |
| | | * |
| | | * @param lang 当前选择语言 |
| | | * @param grade 最大级别 |
| | | * @param status 状态 |
| | | * @param shopId 店铺ID |
| | | * @return 分类列表 |
| | | */ |
| | | List<Category> listByGrade(@Param("lang") Integer lang, @Param("grade") Integer grade, @Param("status") Integer status, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据条件参数获取分类列表 |
| | | * |
| | | * @param shopId 店铺ID |
| | | * @param parentId 父分类ID |
| | | * @param dbLang 当前选择语言 |
| | | * @return 分类列表 |
| | | */ |
| | | List<Category> listSelect(@Param("shopId") Long shopId, @Param("parentId") Long parentId, @Param("lang") Integer dbLang); |
| | | |
| | | /** |
| | | * 获取分类及上级分类列表 |
| | | * |
| | | * @param categoryIds |
| | | * @return |
| | | */ |
| | | List<Category> listAndParentByIds(@Param("categoryIds") Set<Long> categoryIds); |
| | | |
| | | /** |
| | | * 获取当前节点所有父节点的分类,以及当前分类节点的父级节点的父级节点的分类 |
| | | * |
| | | * @param categoryIds 当前分类节点ids |
| | | * @param lang |
| | | * @return 所有父级节点 |
| | | */ |
| | | List<Category> getParentCategoryByCategoryId(@Param("categoryIds") List<Long> categoryIds, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取整个平台的佣金比例 |
| | | * |
| | | * @return 整个平台的佣金比例 |
| | | */ |
| | | List<Category> listRate(); |
| | | |
| | | /** |
| | | * 根据分类id列表,获取分类列表 |
| | | * |
| | | * @param categoryIds |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Category> getListByCategoryIds(@Param("categoryIds") Set<Long> categoryIds, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据店铺id与父分类id获取分类id列表 |
| | | * |
| | | * @param shopId |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<Long> listCategoryIdByShopIdAndParentId(@Param("shopId") Long shopId, @Param("parentId") Long parentId); |
| | | |
| | | /** |
| | | * 根据店铺id和父分类id获取分类列表 |
| | | * |
| | | * @param shopId |
| | | * @param parentId |
| | | * @param grade |
| | | * @return |
| | | */ |
| | | List<Category> getListByShopIdAndParentId(@Param("shopId") Long shopId, @Param("parentId") Long parentId, @Param("grade") Integer grade); |
| | | |
| | | /** |
| | | * 获取分类及分类国际化列表 |
| | | * |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | List<Category> listCategoryAndLangList(@Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 获取分类及上级分类的信息 |
| | | * |
| | | * @param categoryId |
| | | * @return |
| | | */ |
| | | List<Category> getCategoryAndParent(@Param("categoryId") Long categoryId); |
| | | |
| | | @Select("select category_name from tz_category where grade = 0") |
| | | List<String> getCategoryList(); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CategoryProp; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface CategoryPropMapper extends BaseMapper<CategoryProp> { |
| | | |
| | | /** |
| | | * 批量插入分类商品关联信息 |
| | | * @param categoryId 分类ID |
| | | * @param propIds 商品ID列表 |
| | | */ |
| | | void insertCategoryProp(@Param("categoryId") Long categoryId, @Param("propIds") List<Long> propIds); |
| | | |
| | | /** |
| | | * 根据分类ID删除分类商品关联信息 |
| | | * @param categoryId 分类ID |
| | | */ |
| | | void deleteByCategoryId(Long categoryId); |
| | | |
| | | /** |
| | | * 根据商品ID删除分类商品关联信息 |
| | | * @param propId 商品ID |
| | | */ |
| | | void deleteByPropId(Long propId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.dto.CategoryShopDTO; |
| | | import com.yami.shop.bean.model.Category; |
| | | import com.yami.shop.bean.model.CategoryShop; |
| | | import com.yami.shop.bean.vo.CategoryShopVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author lth |
| | | * @Date 2021/7/21 16:23 |
| | | */ |
| | | public interface CategoryShopMapper extends BaseMapper<CategoryShop> { |
| | | |
| | | /** |
| | | * 批量保存分类签约信息 |
| | | * @param categoryShopList |
| | | * @param shopId |
| | | * @param status |
| | | */ |
| | | void saveBatch(@Param("categoryShopList") List<CategoryShop> categoryShopList, @Param("shopId") Long shopId, @Param("status") Integer status); |
| | | |
| | | /** |
| | | * 根据店铺id获取签约分类信息列表 |
| | | * @param shopId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<CategoryShopVO> listSigningCategoryByShopId(@Param("shopId") Long shopId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取店铺签约成功的分类信息列表(仅关联的三级分类) |
| | | * @param shopId |
| | | * @param status |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Category> listSigningCategoryByShopIdAndStatus(@Param("shopId") Long shopId, @Param("status") int status, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据店铺id获取平台佣金 |
| | | * @param shopId 店铺id |
| | | * @return 平台佣金 |
| | | */ |
| | | List<Category> listRateByShopId(Long shopId); |
| | | |
| | | /** |
| | | * 根据分类id列表获取店铺id列表 |
| | | * @param categoryIds |
| | | * @return |
| | | */ |
| | | List<Long> listShopIdByCategoryIds(@Param("categoryIds") List<Long> categoryIds); |
| | | |
| | | /** |
| | | * 根据店铺id与状态更改签约状态 |
| | | * @param shopId |
| | | * @param oldStatus |
| | | * @param newStatus |
| | | */ |
| | | void changeStatusByShopIdAndStatus(@Param("shopId") Long shopId, @Param("oldStatus") Integer oldStatus, @Param("newStatus") Integer newStatus); |
| | | |
| | | /** |
| | | * 分页获取分类签约信息 |
| | | * @param page |
| | | * @param categoryShop |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | IPage<CategoryShopVO> pageSigningInfo(@Param("page") PageParam<CategoryShopVO> page, @Param("categoryShop") CategoryShopDTO categoryShop, @Param("lang") Integer lang); |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnAgentLevel; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_agent_level(cdn 代理等级)】的数据库操作Mapper |
| | | * @createDate 2024-06-28 17:47:05 |
| | | * @Entity com.yami.shop.bean.model.CdnAgentLevel |
| | | */ |
| | | public interface CdnAgentLevelMapper extends BaseMapper<CdnAgentLevel> { |
| | | |
| | | List<CdnAgentLevel> getCdnAgentLevelList(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnBind; |
| | | import com.yami.shop.bean.param.CdnNodeInfoParam; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_bind(cdn绑定用户)】的数据库操作Mapper |
| | | * @createDate 2024-06-29 14:41:29 |
| | | * @Entity com.yami.shop.bean.model.CdnBind |
| | | */ |
| | | public interface CdnBindMapper extends BaseMapper<CdnBind> { |
| | | |
| | | CdnNodeInfoParam selectNodeInfo(String userId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnCenterLevel; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_center_level(cdn 中心等级)】的数据库操作Mapper |
| | | * @createDate 2024-06-28 17:47:05 |
| | | * @Entity com.yami.shop.bean.model.CdnCenterLevel |
| | | */ |
| | | public interface CdnCenterLevelMapper extends BaseMapper<CdnCenterLevel> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnConfig; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_config(系统配置)】的数据库操作Mapper |
| | | * @createDate 2024-07-02 00:02:47 |
| | | * @Entity com.yami.shop.bean.model.CdnConfig |
| | | */ |
| | | public interface CdnConfigMapper extends BaseMapper<CdnConfig> { |
| | | @Select("SELECT t.id,t.name,t.group,t.title,t.tip,t.type,t.value,t.content,t.rule,t.extend,t.setting FROM tz_cdn_config t WHERE t.group = #{group}") |
| | | List<CdnConfig> selectConnfigList(String group); |
| | | |
| | | @Update("UPDATE tz_cdn_config t SET t.title = #{title}, t.value = #{value} WHERE t.id = #{id}") |
| | | void updateConfig(@Param("id") Integer id,@Param("title") String title,@Param("value") String value); |
| | | |
| | | Integer updateValueByName(@Param("name") String name,@Param("value") String value); |
| | | |
| | | @Select("SELECT t.value FROM `tz_cdn_config` t where t.name = #{pointBs}") |
| | | String selectValueByName(String pointBs); |
| | | |
| | | @Select("SELECT t.id,t.name,t.group,t.title,t.tip,t.type,t.value,t.content,t.rule,t.extend,t.setting FROM tz_cdn_config t WHERE t.name = #{agreement}") |
| | | CdnConfig getAgreement(String agreement); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnFlow; |
| | | import com.yami.shop.bean.param.CdnIncomeBangParam; |
| | | import com.yami.shop.bean.vo.CdnFlowVO; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_flow(用户流水)】的数据库操作Mapper |
| | | * @createDate 2024-06-28 17:47:05 |
| | | * @Entity com.yami.shop.bean.model.CdnFlow |
| | | */ |
| | | public interface CdnFlowMapper extends BaseMapper<CdnFlow> { |
| | | |
| | | Double getIncomeByUserId(@Param("userId") String userId,@Param("date") String date); |
| | | |
| | | List<CdnIncomeBangParam> getIncomeBang(String date); |
| | | |
| | | BigDecimal selectExpend(@Param("userId") String userId,@Param("date") String date); |
| | | |
| | | BigDecimal selectCountPrice(String userId); |
| | | |
| | | Long getEarnings(@Param("userId")String userId, @Param("date") String format,@Param("walletId") Integer walletId,@Param("taskId") Long taskId); |
| | | |
| | | List<CdnFlowVO> listPage(@Param("adapter") PageAdapter pageAdapter, @Param("flow")CdnFlow flow); |
| | | |
| | | long countListPage( @Param("flow")CdnFlow flow); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnFlowname; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_flowname(流水类型)】的数据库操作Mapper |
| | | * @createDate 2024-06-28 17:47:05 |
| | | * @Entity com.yami.shop.bean.model.CdnFlowname |
| | | */ |
| | | public interface CdnFlownameMapper extends BaseMapper<CdnFlowname> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnRealName; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_real_name(实名认证)】的数据库操作Mapper |
| | | * @createDate 2024-07-01 11:38:28 |
| | | * @Entity com.yami.shop.bean.model.CdnRealName |
| | | */ |
| | | public interface CdnRealNameMapper extends BaseMapper<CdnRealName> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnRelease; |
| | | import com.yami.shop.bean.model.Order; |
| | | import com.yami.shop.bean.param.UserReselaseParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_release(托管释放列表)】的数据库操作Mapper |
| | | * @createDate 2024-07-01 15:52:34 |
| | | * @Entity com.yami.shop.bean.model.CdnRelease |
| | | */ |
| | | public interface CdnReleaseMapper extends BaseMapper<CdnRelease> { |
| | | |
| | | Integer selectDeviceCount(@Param("startDate") String startDate, |
| | | @Param("endDate") String endDate); |
| | | |
| | | Integer selectDeviceCountByStatus(String status); |
| | | |
| | | void updateBySn(String sn); |
| | | |
| | | UserReselaseParam getUserReselase(String userId); |
| | | |
| | | BigDecimal getNormalOrderCount(@Param("startDate") String startDate, |
| | | @Param("endDate") String endDate); |
| | | |
| | | List<Order> getRelease(@Param("startDate")String startDate, @Param("endDate")String endDate); |
| | | |
| | | List<CdnRelease> getUserDevice(String userId); |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnReleaseTemp; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_release_temp(托管释放列表)】的数据库操作Mapper |
| | | * @createDate 2024-07-01 15:52:34 |
| | | * @Entity com.yami.shop.bean.model.CdnRelease |
| | | */ |
| | | public interface CdnReleaseTempMapper extends BaseMapper<CdnReleaseTemp> { |
| | | |
| | | @Delete("delete from tz_cdn_release_temp") |
| | | void deleteAll(); |
| | | |
| | | @Insert("insert into tz_cdn_release_temp(id,point_release) values (#{cdnReleaseTemp.id},#{cdnReleaseTemp.pointRelease})") |
| | | void insertEntity(@Param("cdnReleaseTemp") CdnReleaseTemp cdnReleaseTemp); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnTeamRelation; |
| | | import com.yami.shop.bean.model.User; |
| | | import com.yami.shop.bean.param.CdnShiftPidParam; |
| | | import com.yami.shop.bean.param.MyCdnTeamParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_team_relation(cdn团队关系表)】的数据库操作Mapper |
| | | * @createDate 2024-06-28 17:47:05 |
| | | * @Entity com.yami.shop.bean.model.CdnTeamRelation |
| | | */ |
| | | public interface CdnTeamRelationMapper extends BaseMapper<CdnTeamRelation> { |
| | | |
| | | MyCdnTeamParam selectMyCdnTeamInfo(@Param("userId") String userId, @Param("pattern") Integer pattern); |
| | | |
| | | List<CdnTeamRelation> geTeamRelationList(); |
| | | |
| | | CdnTeamRelation geTeamsByUserId(@Param("userId") String userId); |
| | | |
| | | List<CdnTeamRelation> getTeamRelationListSort(String pid); |
| | | |
| | | List<CdnTeamRelation> getDividendList(@Param("cdn") CdnTeamRelation cdn); |
| | | |
| | | List<CdnTeamRelation> selectByAgentLevelId(@Param("cdns") CdnTeamRelation cdns); |
| | | |
| | | List<String> selectDownLevel(String userId); |
| | | |
| | | List<String> selectAllDownLevel(String userId); |
| | | |
| | | List<CdnTeamRelation> selectAllUpLevel(String pid); |
| | | |
| | | void updateTodayQuantity(); |
| | | |
| | | void updateTodayOwnQuantity(); |
| | | |
| | | void updatePids(String userId); |
| | | |
| | | void updateShiftPid(@Param("cdnShiftPidParam") CdnShiftPidParam cdnShiftPidParam); |
| | | |
| | | User selectUserInfoByUserId(String userId); |
| | | |
| | | BigDecimal selectCountMoney(); |
| | | |
| | | BigDecimal selectTMell(@Param("id") Integer id); |
| | | |
| | | List<CdnTeamRelation> selectActiveByUserId(@Param("userId") String userId, @Param("activeStatus")String activeStatus); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnUserBank; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_user_bank(银行卡)】的数据库操作Mapper |
| | | * @createDate 2024-07-01 19:06:15 |
| | | * @Entity com.yami.shop.bean.model.CdnUserBank |
| | | */ |
| | | public interface CdnUserBankMapper extends BaseMapper<CdnUserBank> { |
| | | |
| | | Integer deleteUserBank(@Param("bank") CdnUserBank bank); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnUserRecharge; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_user_recharge(用户充值)】的数据库操作Mapper |
| | | * @createDate 2024-07-01 22:56:26 |
| | | * @Entity com.yami.shop.bean.model.CdnUserRecharge |
| | | */ |
| | | public interface CdnUserRechargeMapper extends BaseMapper<CdnUserRecharge> { |
| | | |
| | | BigDecimal selectRechargeCount(@Param("startDate")String startDate, |
| | | @Param("endDate")String endDate, |
| | | @Param("walletId") Integer walletId); |
| | | |
| | | List<CdnUserRecharge> listRechargeDetailBycdnRecharge(@Param("cdnUserRecharge")CdnUserRecharge cdnUserRecharge); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnUserWallet; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_user_wallet(用户钱包)】的数据库操作Mapper |
| | | * @createDate 2024-06-28 17:47:05 |
| | | * @Entity com.yami.shop.bean.model.CdnUserWallet |
| | | */ |
| | | public interface CdnUserWalletMapper extends BaseMapper<CdnUserWallet> { |
| | | |
| | | @Update("update tz_cdn_user_wallet set money = money + #{amount},update_time = now() where user_id = #{userId} and wallet_id = #{walletId}") |
| | | Boolean updateMoney(@Param("userId") String userId, |
| | | @Param("walletId") Integer walletId, |
| | | @Param("amount") BigDecimal amount); |
| | | |
| | | CdnUserWallet getCdnUserWallet(@Param("wallet") CdnUserWallet wallet); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnWallet; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_wallet(币种管理)】的数据库操作Mapper |
| | | * @createDate 2024-06-28 17:47:05 |
| | | * @Entity com.yami.shop.bean.model.CdnWallet |
| | | */ |
| | | public interface CdnWalletMapper extends BaseMapper<CdnWallet> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnWithdrawal; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_withdrawal(用户提现)】的数据库操作Mapper |
| | | * @createDate 2024-06-28 17:47:05 |
| | | * @Entity com.yami.shop.bean.model.CdnWithdrawal |
| | | */ |
| | | public interface CdnWithdrawalMapper extends BaseMapper<CdnWithdrawal> { |
| | | |
| | | BigDecimal selectWithdrawCount(@Param("startDate") String startDate, |
| | | @Param("endDate") String endDate, |
| | | @Param("walletId") Integer walletId); |
| | | |
| | | List<CdnWithdrawal> listWithdrawalDetailBycdnWithdrawal(@Param("cdnWithdrawal") CdnWithdrawal cdnWithdrawal); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.dto.ShopAuditingInfoDto; |
| | | import com.yami.shop.bean.model.CompanyAuditing; |
| | | import com.yami.shop.bean.model.SigningAuditing; |
| | | import com.yami.shop.bean.param.AuditingInfoParam; |
| | | import com.yami.shop.bean.param.CompanyInfoAuditParam; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author chiley |
| | | * @date 2022/9/21 15:01 |
| | | */ |
| | | public interface CompanyAuditingMapper extends BaseMapper<CompanyAuditing> { |
| | | |
| | | /** |
| | | * 获取待审核的工商信息审核列表 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param auditParam 审核搜索参数 |
| | | * @return 店铺审核信息列表 |
| | | */ |
| | | IPage<CompanyAuditing> page(@Param("page") Page<CompanyAuditing> page, @Param("auditParam") CompanyInfoAuditParam auditParam); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.common.bean.CpsConfig; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * CPS配置信息 |
| | | * @author lgh |
| | | */ |
| | | public interface CpsConfigMapper extends BaseMapper<CpsConfig> { |
| | | |
| | | /** |
| | | * 根据key,查询cps配置信息 |
| | | * @param key key |
| | | * @return CpsConfig |
| | | */ |
| | | CpsConfig queryByKey(String key); |
| | | |
| | | /** |
| | | * 根据key,更新value |
| | | * @param key |
| | | * @param value |
| | | * @return 更新成功条数 |
| | | */ |
| | | int updateValueByKey(@Param("key") String key, @Param("value") String value); |
| | | |
| | | /** |
| | | * 批量删除系统配置 |
| | | * @param ids CPS配置信息数组 |
| | | */ |
| | | void deleteBatch(@Param("ids") Long[] ids); |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CpsDdCategory; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zsq |
| | | * @description 针对表【tz_cps_dd_category】的数据库操作Mapper |
| | | * @createDate 2024-06-19 10:57:31 |
| | | */ |
| | | public interface CpsDdCategoryMapper extends BaseMapper<CpsDdCategory> { |
| | | |
| | | |
| | | List<CpsDdCategory> getPddCategoryList(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CpsDdOrder; |
| | | |
| | | /** |
| | | * @author zsq |
| | | * @description 针对表【tz_cps_dd_order】的数据库操作Mapper |
| | | * @createDate 2024-06-19 16:54:30 |
| | | */ |
| | | public interface CpsDdOrderMapper extends BaseMapper<CpsDdOrder> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CpsJdCategory; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zsq |
| | | * @description 针对表【tz_cps_jd_category】的数据库操作Mapper |
| | | * @createDate 2024-06-14 13:47:49 |
| | | */ |
| | | public interface CpsJdCategoryMapper extends BaseMapper<CpsJdCategory> { |
| | | |
| | | void insertEntity(@Param("entity") CpsJdCategory cpsJdCategory); |
| | | |
| | | List<CpsJdCategory> getCategoryList(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CpsJdOrder; |
| | | |
| | | /** |
| | | * @author zsq |
| | | * @description 针对表【tz_cps_jd_order】的数据库操作Mapper |
| | | * @createDate 2024-06-14 17:19:55 |
| | | */ |
| | | public interface CpsJdOrderMapper extends BaseMapper<CpsJdOrder> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CpsJtkOrder; |
| | | |
| | | /** |
| | | * @author zsq |
| | | * @description 针对表【tz_cps_jtk_order】的数据库操作Mapper |
| | | * @createDate 2024-06-21 11:03:22 |
| | | */ |
| | | public interface CpsJtkOrderMapper extends BaseMapper<CpsJtkOrder> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CpsMtActitvity; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zsq |
| | | * @description 针对表【tz_cps_actitvity】的数据库操作Mapper |
| | | * @createDate 2024-06-18 14:29:03 |
| | | */ |
| | | public interface CpsMtActitvityMapper extends BaseMapper<CpsMtActitvity> { |
| | | |
| | | List<CpsMtActitvity> listPropAndValue(@Param("adapter") PageAdapter pageAdapter, @Param("actitvity") CpsMtActitvity cpsMtActitvity); |
| | | |
| | | long countPropAndValue(@Param("actitvity") CpsMtActitvity cpsMtActitvity); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CpsMtOrder; |
| | | |
| | | /** |
| | | * @author zsq |
| | | * @description 针对表【tz_cps_mt_order】的数据库操作Mapper |
| | | * @createDate 2024-06-18 17:29:33 |
| | | */ |
| | | public interface CpsMtOrderMapper extends BaseMapper<CpsMtOrder> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CpsOrder; |
| | | import com.yami.shop.bean.vo.OrderResultVo; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zsq |
| | | * @description 针对表【tz_cps_order】的数据库操作Mapper |
| | | * @Date 2024-06-11 18:48:52 |
| | | */ |
| | | public interface CpsOrderMapper extends BaseMapper<CpsOrder> { |
| | | |
| | | List<OrderResultVo> listShopAndValue(@Param("adapter") PageAdapter pageAdapter, @Param("cpsOrder") CpsOrder cpsOrder); |
| | | |
| | | long countShopAndValue(@Param("cpsOrder") CpsOrder cpsOrder); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CpsShop; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface CpsShopMapper extends BaseMapper<CpsShop> { |
| | | |
| | | /** |
| | | * 分页获取商品列表 |
| | | * @param adapter 分页参数 |
| | | * @param cpsShop 查询参数 |
| | | * @return 商品属性与属性值列表 |
| | | */ |
| | | List<CpsShop> listShopAndValue(@Param("adapter") PageAdapter adapter, @Param("cpsShop") CpsShop cpsShop); |
| | | |
| | | /** |
| | | * 获取商品列表数量 |
| | | * @param cpsShop 查询参数 |
| | | * @return 商品属性与属性值列表数量 |
| | | */ |
| | | long countShopAndValue(@Param("cpsShop") CpsShop cpsShop); |
| | | |
| | | /** |
| | | * 批量插入cps商品信息 |
| | | * @param cpsShops |
| | | */ |
| | | int insertCpsShops(@Param("cpsShops") List<CpsShop> cpsShops); |
| | | |
| | | /** |
| | | * 删除失效商品 |
| | | * @param shopId |
| | | */ |
| | | void deleteByShopId(Long shopId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.yami.shop.bean.dto.flow.CustomerRetainedDTO; |
| | | import com.yami.shop.bean.dto.flow.MemberReqDTO; |
| | | import com.yami.shop.bean.param.MemberOverviewParam; |
| | | import com.yami.shop.bean.param.MemberReqParam; |
| | | import com.yami.shop.bean.vo.flow.CustomerRetainVO; |
| | | import com.yami.shop.bean.vo.flow.MemberDealVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | @Repository |
| | | public interface CustomerAnalysisMapper { |
| | | |
| | | /** |
| | | * 获取会员调查信息列表 |
| | | * |
| | | * @param startTime 起始时间 |
| | | * @param memberReqParam 客户参数 |
| | | * @return 会员调查信息列表 |
| | | */ |
| | | List<MemberOverviewParam> generalize(@Param("startTime") Date startTime, @Param("memberReqParam") MemberReqParam memberReqParam); |
| | | |
| | | /** |
| | | * 获取领券会员列表 |
| | | * |
| | | * @param param |
| | | * @return 领券会员数 |
| | | */ |
| | | Integer countMemberCouponByParam(@Param("param") MemberReqDTO param); |
| | | |
| | | /** |
| | | * @param param |
| | | * @param type 0:老会员 1:新会员 |
| | | * @return |
| | | */ |
| | | List<MemberDealVO> getMemberPayData(@Param("param") MemberReqDTO param, @Param("type") Integer type); |
| | | |
| | | List<CustomerRetainVO> getTradeRetained(@Param("param") CustomerRetainedDTO customerRetainedDTO); |
| | | |
| | | |
| | | // List<MemberOverviewListParam> generalizeList(@Param("memberReqParam") MemberReqParam memberReqParam); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.Delivery; |
| | | import com.yami.shop.bean.vo.DeliveryOrderVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface DeliveryMapper extends BaseMapper<Delivery> { |
| | | /** |
| | | * 根据订单编号获取发货数量 |
| | | * @param orderNumbers |
| | | * @return |
| | | */ |
| | | List<DeliveryOrderVO> listDeliveryCountByOrderNumber(@Param("orderNumbers") List<String> orderNumbers); |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.DeviceGroup; |
| | | |
| | | /** |
| | | * <p> |
| | | * 设备分组 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2024-04-19 |
| | | */ |
| | | public interface DeviceGroupMapper extends BaseMapper<DeviceGroup> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.CdnDeviceRelease; |
| | | import com.yami.shop.bean.model.Device; |
| | | import com.yami.shop.bean.model.V1BoxIncome; |
| | | import com.yami.shop.bean.param.DeviceIncomeParam; |
| | | import com.yami.shop.bean.param.TypeParam; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zsq |
| | | * @description 针对表【tz_device】的数据库操作Mapper |
| | | * @createDate 2024-07-11 14:22:52 |
| | | */ |
| | | public interface DeviceMapper extends BaseMapper<Device> { |
| | | |
| | | CdnDeviceRelease selectSnById(Long id); |
| | | |
| | | List<Device> listMyOrderByUserIdAndStatus(@Param("adapter") PageAdapter pageAdapter,@Param("device") Device device); |
| | | |
| | | long countMyOrderByUserIdAndStatus(@Param("device") Device device); |
| | | |
| | | int setSnDevice(@Param("cdnDeviceRelease") CdnDeviceRelease cdnDeviceRelease); |
| | | |
| | | List<DeviceIncomeParam> selectSnDeviceIncome(@Param("adapter") PageAdapter pageAdapter,@Param("device") DeviceIncomeParam param); |
| | | |
| | | List<Device> selectByType(@Param("shopCategoryId") Long shopCategoryId, @Param("productNums") Integer productNums); |
| | | |
| | | List<TypeParam> selectdeviceTypeList(); |
| | | |
| | | String selectdeviceTypeById(Long type); |
| | | |
| | | List<Device> getDeviceListBySn(String sn); |
| | | |
| | | void deleteBySn(String sn); |
| | | |
| | | List<Device> getIsActivateDeviceListBySn(String sn); |
| | | |
| | | long selectSnDeviceIncomeCount(@Param("device") DeviceIncomeParam param); |
| | | |
| | | Integer selectAbnormalCount(); |
| | | |
| | | List<V1BoxIncome> getMoneyListBySn(String sn); |
| | | |
| | | List<Device> selectPageByParam(@Param("userId") String userId, |
| | | @Param("status") String status, |
| | | @Param("isActivate") String isActivate, |
| | | @Param("orderBy") Integer orderBy, |
| | | @Param("type") Integer type, |
| | | @Param("page") PageAdapter p); |
| | | |
| | | Integer getDeviceList(@Param("device") Device device); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.yami.shop.bean.model.DeviceProfitLog; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author lyy |
| | | * @description 针对表【tz_device_profit_log(设备收益日志(AI淘金))】的数据库操作Mapper |
| | | * @createDate 2024-09-27 17:32:54 |
| | | * @Entity com.yami.shop.bean.model.DeviceProfitLog |
| | | */ |
| | | public interface DeviceProfitLogMapper extends BaseMapper<DeviceProfitLog> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.yami.shop.bean.model.Diploma; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_diploma(学历表)】的数据库操作Mapper |
| | | * @createDate 2024-06-06 17:38:37 |
| | | * @Entity com.yami.shop.mobel.Diploma |
| | | */ |
| | | public interface DiplomaMapper extends BaseMapper<Diploma> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.EnterprisePay; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @author |
| | | * @date 2019-10-15 16:44:50 |
| | | */ |
| | | public interface EnterprisePayMapper extends BaseMapper<EnterprisePay> { |
| | | |
| | | /** |
| | | * 批量获取企业支付信息列表 |
| | | * @return 企业支付信息列表 |
| | | */ |
| | | List<EnterprisePay> listApplyEnterprisePay(); |
| | | |
| | | /** |
| | | * 支付成功后根据企业支付订单号更新企业支付信息的状态为已完成 |
| | | * @param entPayOrderNo 企业支付订单号 |
| | | * @param version 版本号 |
| | | * @return 成功更新条数 |
| | | */ |
| | | int paySuccess(@Param("entPayOrderNo") Long entPayOrderNo, @Param("version") Integer version); |
| | | |
| | | /** |
| | | * 支付失败后根据企业支付订单号更新企业支付信息的状态为已失败 |
| | | * @param entPayOrderNo 企业支付订单号 |
| | | * @param version 版本号 |
| | | * @return 成功更新条数 |
| | | */ |
| | | int payFailed(@Param("entPayOrderNo") Long entPayOrderNo, @Param("version") Integer version); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.FlowLog; |
| | | import com.yami.shop.bean.param.ProdAnalysisDataParam; |
| | | import com.yami.shop.bean.param.ProdAnalysisSurveyParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户流量记录 |
| | | * |
| | | * @author YXF |
| | | * @date 2020-07-13 13:18:33 |
| | | */ |
| | | public interface FlowLogMapper extends BaseMapper<FlowLog> { |
| | | |
| | | /** |
| | | * 获得最早的创建时间 |
| | | * |
| | | * @return 最早的创建时间 |
| | | */ |
| | | Date getMinCreateTime(); |
| | | |
| | | /** |
| | | * 根据时间范围获取用户流量记录列表 |
| | | * |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | * @return 用户流量记录列表 |
| | | */ |
| | | List<FlowLog> getFlowLogByDate(@Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据时间范围删除用户流量记录 |
| | | * |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | */ |
| | | void deleteAllByDate(@Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取商品浏览量 |
| | | * |
| | | * @param param 商品分析参数 |
| | | * @return 商品浏览量 |
| | | */ |
| | | Long countVisitProdInfoNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取商品曝光数 |
| | | * |
| | | * @param param 商品分析参数 |
| | | * @return 商品曝光数 |
| | | */ |
| | | Long countProdExposeNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取被访问商品数 |
| | | * |
| | | * @param param 商品分析参数 |
| | | * @return 被访问商品数 |
| | | */ |
| | | Long countVisitProdNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取商品访客数 |
| | | * |
| | | * @param param 商品分析参数 |
| | | * @return 商品访客数 |
| | | */ |
| | | Long countProdVisitorNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取添加商品进入购物车的商品件数 |
| | | * |
| | | * @param param 商品分析参数 |
| | | * @return 添加商品进入购物车的商品件数 |
| | | */ |
| | | Long countAddCartProdNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取添加商品进入购物车的人数 |
| | | * |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | * @return 添加商品进入购物车的商品件数 |
| | | */ |
| | | Integer countAddCartUserNum(@Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据起始时间获取在起始时间之后的用户流量记录数量 |
| | | * |
| | | * @param startTime 起始时间 |
| | | * @return 在起始时间之后的用户流量记录数量 |
| | | */ |
| | | Integer getFlowLogCountByDate(@Param("startTime") Date startTime); |
| | | |
| | | /** |
| | | * 根据商品Id与起始时间、终止时间获取商品曝光数 |
| | | * |
| | | * @param prodId 商品ID |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | * @return 商品曝光数 |
| | | */ |
| | | Integer countProdExposeNumByParam(@Param("prodId") Long prodId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * ‘根据date获取时间处于date之前’或者‘根据时间范围’获取进入商城的所有访客数 |
| | | * |
| | | * @param date 最大时间 |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | * @return 进入商城的所有访客数 |
| | | */ |
| | | Integer countAllVisitor(@Param("date") Date date, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取加购的流量记录数量 |
| | | * |
| | | * @param param 商品分析参数 |
| | | * @return 加购的流量记录数量 |
| | | */ |
| | | Long countShareVisit(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 统计登陆用户数 |
| | | * |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | Integer countUserNum(@Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 商品概况分析 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | ProdAnalysisDataParam getProdSurvey(@Param("param") ProdAnalysisSurveyParam param); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.FlowPageAnalyseUser; |
| | | import com.yami.shop.bean.param.CustomerPayParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 流量分析—页面数据统计表 |
| | | * |
| | | * @author YXF |
| | | * @date 2020-07-16 16:23:53 |
| | | */ |
| | | public interface FlowPageAnalyseUserMapper extends BaseMapper<FlowPageAnalyseUser> { |
| | | |
| | | /** |
| | | * ‘根据date获取时间处于date之前’或者‘根据时间范围’获取进入商城的所有访客数 |
| | | * @param date 最大时间 |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | * @return 进入商城的所有访客数 |
| | | */ |
| | | Integer countAllVisitor(@Param("date") Date date, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 按日期统计访客人数 |
| | | * @param beforeYear |
| | | * @param endTime 结束时间 |
| | | * @return 访客人数 |
| | | */ |
| | | Integer countVisitorNumByDate(@Param("beforeYear") Date beforeYear, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 按日期统计付费访客人数 |
| | | * @param beforeYear |
| | | * @param startTime 结束时间 |
| | | * @return 付费访客人数 |
| | | */ |
| | | Integer countPaidVisitorNumByDate(@Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime); |
| | | |
| | | /** |
| | | * 按时间范围统计访客数 |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | * @return 访客数列表 |
| | | */ |
| | | List<String> countVisitors(@Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据类型与时间范围统计保留的访客数 |
| | | * @param type 类型 |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | * @param uuids |
| | | * @return 保留的访客数列表 |
| | | */ |
| | | List<String> countVisitorRetained(@Param("type") Integer type, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("uuids") List<String> uuids); |
| | | |
| | | /** |
| | | * ‘根据date获取时间处于date之前’或者‘根据时间范围’获取进入商城的所有访客数 |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | * @return 进入商城的所有访客数 |
| | | */ |
| | | List<CustomerPayParam> countByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.dto.PageAnalysisDto; |
| | | import com.yami.shop.bean.model.FlowPageAnalysis; |
| | | import com.yami.shop.bean.param.*; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 流量分析—页面数据统计表 |
| | | * |
| | | * @author YXF |
| | | * @date 2020-07-14 11:26:35 |
| | | */ |
| | | public interface FlowPageAnalysisMapper extends BaseMapper<FlowPageAnalysis> { |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取商品浏览量 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | Long countVisitProdInfoNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取商品曝光数 |
| | | * |
| | | * @param param 商品分析概况参数 |
| | | * @return 商品曝光数 |
| | | */ |
| | | Long countProdExposeNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取获取商品详情页浏览数大于0的商品数 |
| | | * |
| | | * @param param 商品分析概况参数 |
| | | * @return 商品详情页浏览数大于0的商品数 |
| | | */ |
| | | Long countVisitProdNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取商品访客数 |
| | | * |
| | | * @param param 商品分析概况参数 |
| | | * @return 商品访客数 |
| | | */ |
| | | Long countProdVisitorNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 获取访客数TOP |
| | | * |
| | | * @param pageVisitor |
| | | * @param param |
| | | * @param dbLang |
| | | * @return |
| | | */ |
| | | IPage<VisitorTopParam> getVisitorTop(@Param("pageVisitor") IPage<FlowPageAnalysis> pageVisitor, @Param("param") ProdAnalysisSurveyParam param, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 获取当天访客数TOP |
| | | * |
| | | * @param pageVisitor |
| | | * @param param |
| | | * @param dbLang |
| | | * @return |
| | | */ |
| | | IPage<VisitorTopParam> getTodayVisitorTop(@Param("pageVisitor") IPage<FlowPageAnalysis> pageVisitor, @Param("param") ProdAnalysisSurveyParam param, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 根据商品ID与时间范围获取商品浏览量 |
| | | * |
| | | * @param prodId 商品ID |
| | | * @param startTime 起始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 商品浏览量 |
| | | */ |
| | | Long countProdExposeNumByParam(@Param("prodId") Long prodId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据商品ID与时间范围获取商品曝光量 |
| | | * |
| | | * @param prodId 商品ID |
| | | * @param startTime 起始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 商品曝光量 |
| | | */ |
| | | Integer countProdExposePersonNum(@Param("prodId") Long prodId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据商品ID与时间范围获取商品访客数 |
| | | * |
| | | * @param prodId 商品ID |
| | | * @param startTime 起始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 商品访客数 |
| | | */ |
| | | Integer countProdVisitorNumByProdId(@Param("prodId") Long prodId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 分页获取流量分析页面数据统计表信息 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param flowAnalysisParam 条件参数 |
| | | * @return 分页结果 |
| | | */ |
| | | PageParam<PageAnalysisDto> getPageOrProdAnalysis(PageParam<PageAnalysisDto> page, @Param("flowAnalysisParam") FlowAnalysisParam flowAnalysisParam); |
| | | |
| | | // Integer countProdAddNum(@Param("prodId") Long prodId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | // |
| | | // Integer countprodAddPersonNum(@Param("prodId") Long prodId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | // |
| | | |
| | | /** |
| | | * 统计时间内,添加商品进入购物车的商品件数 |
| | | * |
| | | * @param param 商品分析概况参数 |
| | | * @return 商品进入购物车的商品件数 |
| | | */ |
| | | Long countAddCartProdNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | // |
| | | |
| | | /** |
| | | * 统计时间内,分享访问商品数 |
| | | * |
| | | * @param param 商品分析概况参数 |
| | | * @return 分享访问商品数 |
| | | */ |
| | | Long countShareVisitNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品ID与日期范围获取 |
| | | * |
| | | * @param prodIds |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<ProdEffectRespParam> getProdEffectByDateAndProdIds(@Param("prodIds") List<Long> prodIds, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据时间及店铺id,获取prodId |
| | | * |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | List<String> getProdIdsByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 商品概况分析 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | ProdAnalysisDataParam getProdSurvey(@Param("param") ProdAnalysisSurveyParam param); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.FlowRouteAnalysis; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 流量分析—用户路径数据 |
| | | * |
| | | * @author YXF |
| | | * @date 2020-07-14 11:26:35 |
| | | */ |
| | | public interface FlowRouteAnalysisMapper extends BaseMapper<FlowRouteAnalysis> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.dto.FlowAnalysisDto; |
| | | import com.yami.shop.bean.dto.SystemDto; |
| | | import com.yami.shop.bean.model.FlowUserAnalysis; |
| | | import com.yami.shop.bean.param.*; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author YXF |
| | | * @date 2020-07-17 09:50:13 |
| | | */ |
| | | public interface FlowUserAnalysisMapper extends BaseMapper<FlowUserAnalysis> { |
| | | |
| | | /** |
| | | * 根据时间范围获取获取用户分析数据 |
| | | * |
| | | * @param startTime 起始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 用户流量分析列表 |
| | | */ |
| | | List<FlowUserAnalysis> getUserAnalysisData(@Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取添加商品进入购物车的商品件数 |
| | | * |
| | | * @param param 商品分析概况参数 |
| | | * @return 添加商品进入购物车的商品件数 |
| | | */ |
| | | Integer countAddCartProdNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取流量趋势 |
| | | * |
| | | * @param flowAnalysisParam 商品分析概况参数 |
| | | * @return 流量分析页面数据统计列表 |
| | | */ |
| | | List<FlowAnalysisDto> flowTrend(@Param("flowAnalysisParam") FlowAnalysisParam flowAnalysisParam); |
| | | |
| | | /** |
| | | * 流量来源构成 |
| | | * |
| | | * @param flowAnalysisParam 商品分析概况参数 |
| | | * @return |
| | | */ |
| | | List<FlowAnalysisDto> flowSour(@Param("flowAnalysisParam") FlowAnalysisParam flowAnalysisParam); |
| | | |
| | | /** |
| | | * 获取流量分析数据 |
| | | * |
| | | * @param flowAnalysisParam 商品分析概况参数 |
| | | * @param startTime 起始时间 |
| | | * @return |
| | | */ |
| | | List<FlowAnalysisDto> getFlowAnalysisData(@Param("flowAnalysisParam") FlowAnalysisParam flowAnalysisParam, @Param("startTime") Date startTime); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取不同系统类型流量分析用户浏览数据记录数量 |
| | | * |
| | | * @param flowAnalysisParam 商品分析概况参数 |
| | | * @return 不同系统记录数量 |
| | | */ |
| | | List<SystemDto> systemTypeNums(@Param("flowAnalysisParam") FlowAnalysisParam flowAnalysisParam); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取商品访客数列表 |
| | | * |
| | | * @param param 商品分析概况参数 |
| | | * @return 商品访客数列表 |
| | | */ |
| | | List<ProdAnalysisDataParam> countProdVisitorNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取数据统计列表 |
| | | * |
| | | * @param param 商品分析概况参数 |
| | | * @return 数据统计列表 |
| | | */ |
| | | List<ProdAnalysisDataParam> analysisSurvey(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 获取用户留存率, 统计用户第一次访问后,之后的几个月的留存用户数 |
| | | * |
| | | * @param param 条件查询参数 |
| | | * @return 访问留存信息列表 |
| | | */ |
| | | List<CustomerRetainRespParam> getVisitRetained(@Param("param") CustomerRetainedReqParam param); |
| | | |
| | | /** |
| | | * 获取加购人数 |
| | | * |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | Integer countAddCartUserNum(@Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.dto.FormExcelDto; |
| | | import com.yami.shop.bean.model.Form; |
| | | import com.yami.shop.bean.param.FormExcelParam; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface FormMapper extends BaseMapper<Form> { |
| | | |
| | | /** |
| | | * 获取报表的店铺数据信息 |
| | | * @param formExcelParam 表格数据参数 |
| | | * @return 表格Excel数据列表 |
| | | */ |
| | | List<FormExcelDto> getShopFormInfoList(@Param("formExcelParam") FormExcelParam formExcelParam); |
| | | |
| | | /** |
| | | * 分页获取推荐报表 |
| | | * @param page 分页参数 |
| | | * @param form 表格参数 |
| | | * @return 报表数据列表 |
| | | */ |
| | | IPage<Form> getRecommendFormPage(PageParam<Form> page, @Param("form") Form form); |
| | | |
| | | /** |
| | | * 获取分析列表信息列表 |
| | | * @param formExcelParam 表格数据参数 |
| | | * @return 表格Excel数据列表 |
| | | */ |
| | | List<FormExcelDto> getAnalysisListInfoList(@Param("formExcelParam") FormExcelParam formExcelParam); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.dto.HotSearchDto; |
| | | import com.yami.shop.bean.model.HotSearch; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface HotSearchMapper extends BaseMapper<HotSearch> { |
| | | /** |
| | | * 根据店铺id获取热搜列表 |
| | | * @param shopId 店铺id |
| | | * @return 热搜列表 |
| | | */ |
| | | List<HotSearchDto> getHotSearchDtoByShopId(Long shopId); |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ImMsgUserHistory; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户聊天历史聊天记录表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mihuo |
| | | * @since 2024-06-15 |
| | | */ |
| | | public interface ImMsgUserHistoryMapper extends BaseMapper<ImMsgUserHistory> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ImMsgUser; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户最近聊天记录表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mihuo |
| | | * @since 2024-06-15 |
| | | */ |
| | | public interface ImMsgUserMapper extends BaseMapper<ImMsgUser> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.IndexImg; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface IndexImgMapper extends BaseMapper<IndexImg> { |
| | | |
| | | /** |
| | | * 根据店铺id与主页轮播图id列表批量删除主页轮播图 |
| | | * |
| | | * @param ids 主页轮播图id列表 |
| | | * @param shopId 店铺id |
| | | */ |
| | | void deleteIndexImgsByIds(@Param("ids") Long[] ids, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 更新轮播图数据 |
| | | * @param ids |
| | | */ |
| | | void updateImgProd(@Param("ids") List<Long> ids); |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.LifeServiceCategory; |
| | | import com.yami.shop.bean.vo.CategoryShopVO; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_category_life_service(生活服务产品类目)】的数据库操作Mapper |
| | | * @createDate 2024-06-04 17:59:55 |
| | | * @Entity com.yami.shop.TzCategoryLifeService |
| | | */ |
| | | public interface LifeServiceCategoryMapper extends BaseMapper<LifeServiceCategory> { |
| | | |
| | | List<CategoryShopVO> listSigningCategoryByShopId(Long shopId, Integer lang); |
| | | |
| | | @Select("select category_name from tz_category_life where grade = 0") |
| | | List<String> getCategoryList(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.LuckImGroupHistory; |
| | | |
| | | /** |
| | | * <p> |
| | | * 群聊聊天记录表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mihuo |
| | | * @since 2024-06-17 |
| | | */ |
| | | public interface LuckImGroupHistoryMapper extends BaseMapper<LuckImGroupHistory> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.LuckImGroup; |
| | | import com.yami.shop.bean.model.LuckImGroupHistoryEx; |
| | | import com.yami.shop.bean.model.LuckImGroupMember; |
| | | import com.yami.shop.bean.param.im.GetGroupListParam; |
| | | import com.yami.shop.bean.param.im.GetGroupChatMsgParam; |
| | | import com.yami.shop.bean.param.im.GetGroupMembersParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mihuo |
| | | * @since 2024-06-17 |
| | | */ |
| | | public interface LuckImGroupMapper extends BaseMapper<LuckImGroup> { |
| | | |
| | | @Select("SELECT t2.* FROM (" |
| | | + "SELECT DISTINCT group_id FROM luck_im_group_member " |
| | | + "WHERE status = 1 and user_id = #{params.selfUserId}) t1 LEFT JOIN luck_im_group t2 ON t1.group_id = t2.id and t2.status = 1 WHERE t2.user_id != #{params.selfUserId}") |
| | | List<LuckImGroup> getMyJoinGroupList(@Param("params") GetGroupListParam params); |
| | | |
| | | List<LuckImGroup> getPubGroupList(@Param("params")GetGroupListParam params); |
| | | |
| | | List<LuckImGroupHistoryEx> getGroupChatMsg(@Param("params")GetGroupChatMsgParam params); |
| | | |
| | | @Select("select count(1) from (SELECT t2.* FROM (" |
| | | + "SELECT DISTINCT group_id FROM luck_im_group_member " |
| | | + "WHERE status = 1 and user_id = #{selfUserId}) t1 LEFT JOIN luck_im_group t2 ON t1.group_id = t2.id and t2.status = 1 WHERE t2.user_id != #{selfUserId}) t") |
| | | Integer getMyJoinGroupListCount(GetGroupListParam params); |
| | | |
| | | Integer getPubGroupListCount(@Param("params")GetGroupListParam params); |
| | | |
| | | @Select("SELECT count(1) FROM luck_im_group WHERE user_id = #{params.selfUserId} and status = 1") |
| | | Integer getMyCreateGroupListCount(@Param("params")GetGroupListParam params); |
| | | |
| | | @Select("SELECT *,1 is_member FROM luck_im_group WHERE user_id = #{params.selfUserId} and status = 1") |
| | | List<LuckImGroup> getMyCreateGroupList(@Param("params")GetGroupListParam params); |
| | | |
| | | List<LuckImGroupMember> getGroupMembers(@Param("params")GetGroupMembersParam params); |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.LuckImGroupMember; |
| | | |
| | | /** |
| | | * <p> |
| | | * 群聊成员表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mihuo |
| | | * @since 2024-06-17 |
| | | */ |
| | | public interface LuckImGroupMemberMapper extends BaseMapper<LuckImGroupMember> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.LuckImGroupType; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mihuo |
| | | * @since 2024-06-17 |
| | | */ |
| | | public interface LuckImGroupTypeMapper extends BaseMapper<LuckImGroupType> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.LuckImMsgUserHistory; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户聊天历史聊天记录表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mihuo |
| | | * @since 2024-06-17 |
| | | */ |
| | | public interface LuckImMsgUserHistoryMapper extends BaseMapper<LuckImMsgUserHistory> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.dto.LuckImMsgUserQueryDTO; |
| | | import com.yami.shop.bean.model.LuckImMsgUser; |
| | | import com.yami.shop.bean.param.im.UserMsgListParam; |
| | | import com.yami.shop.bean.result.MsgUserRecordResult; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户最近聊天记录表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mihuo |
| | | * @since 2024-06-17 |
| | | */ |
| | | public interface LuckImMsgUserMapper extends BaseMapper<LuckImMsgUser> { |
| | | |
| | | /** |
| | | * 分页查询数据 |
| | | * @param page 分页参数 |
| | | * @param dto 查询参数 |
| | | * @return 分页列表 |
| | | */ |
| | | Page<LuckImMsgUser> selectLuckImMsgUserPageList(Page page, @Param("dto") LuckImMsgUserQueryDTO dto); |
| | | |
| | | List<MsgUserRecordResult> getUserMsgUserList(@Param("params") UserMsgListParam params); |
| | | |
| | | void updateUserUnreadNumForUser(@Param("selfUserId") String selfUserId, @Param("userId") String userId); |
| | | |
| | | void updateUserUnreadNumForSystem(@Param("selfUserId") String selfUserId, @Param("systemMsgType") Integer systemMsgType); |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.LuckUserFriend; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户好友表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mihuo |
| | | * @since 2024-06-26 |
| | | */ |
| | | public interface LuckUserFriendMapper extends BaseMapper<LuckUserFriend> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.yami.shop.bean.model.LuckyCoinDetail; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_lucky_coin_detail(幸运币明细表)】的数据库操作Mapper |
| | | * @createDate 2024-06-07 11:32:40 |
| | | * @Entity com.yami.shop.mobel.LuckyCoinDetail |
| | | */ |
| | | public interface LuckyCoinDetailMapper extends BaseMapper<LuckyCoinDetail> { |
| | | |
| | | @Select("select * from tz_lucky_coin_detail where user_id = #{userId}") |
| | | LuckyCoinDetail selectByUserId(String userId); |
| | | |
| | | void updateLuckyCoinAmount(@Param("paymentLuckyCoinAmount") Long paymentLuckyCoinAmount, @Param("userId") String userId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.yami.shop.bean.model.LuckyCoinLog; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_lucky_coin_log(幸运币收入支出记录表)】的数据库操作Mapper |
| | | * @createDate 2024-06-07 11:32:40 |
| | | * @Entity com.yami.shop.mobel.LuckyCoinLog |
| | | */ |
| | | public interface LuckyCoinLogMapper extends BaseMapper<LuckyCoinLog> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.MarsAdverIncome; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_mars_adver_income】的数据库操作Mapper |
| | | * @createDate 2024-08-03 16:20:22 |
| | | * @Entity com.yami.shop.service.domain.MarsAdverIncome |
| | | */ |
| | | public interface MarsAdverIncomeMapper extends BaseMapper<MarsAdverIncome> { |
| | | |
| | | BigDecimal selectAllIncome(@Param("userId") String userId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.MarsBlackLog; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_mars_black_log(黑名单记录)】的数据库操作Mapper |
| | | * @createDate 2024-08-15 14:06:25 |
| | | * @Entity .domain.MarsBlackLog |
| | | */ |
| | | public interface MarsBlackLogMapper extends BaseMapper<MarsBlackLog> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.MarsHandCard; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_mars_hand_card(刮刮卡(主表))】的数据库操作Mapper |
| | | * @createDate 2024-08-07 10:55:30 |
| | | * @Entity generator.domain.MarsHandCard |
| | | */ |
| | | public interface MarsHandCardMapper extends BaseMapper<MarsHandCard> { |
| | | |
| | | Integer saveMarsHandCards(@Param("list") List<MarsHandCard> list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.MarsSales; |
| | | import com.yami.shop.bean.vo.mars.MarsSalesVo; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_mars_sales(寄售(售卖表))】的数据库操作Mapper |
| | | * @createDate 2024-08-07 10:55:30 |
| | | * @Entity generator.domain.MarsSales |
| | | */ |
| | | public interface MarsSalesMapper extends BaseMapper<MarsSales> { |
| | | |
| | | IPage<MarsSalesVo> getPage(PageParam<MarsSales> page, @Param("sales") MarsSalesVo marsSales); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.MarsTranLeve; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_mars_tran_leve(寄售模式(交易等级))】的数据库操作Mapper |
| | | * @createDate 2024-08-12 16:10:19 |
| | | * @Entity generator.domain.MarsTranLeve |
| | | */ |
| | | public interface MarsTranLeveMapper extends BaseMapper<MarsTranLeve> { |
| | | |
| | | MarsTranLeve getByLeve(@Param("leve") String leve); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.MarsTranOrder; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_mars_tran_detail(寄售(交易明细表))】的数据库操作Mapper |
| | | * @createDate 2024-08-07 10:55:31 |
| | | * @Entity generator.domain.MarsTranDetail |
| | | */ |
| | | public interface MarsTranOrderMapper extends BaseMapper<MarsTranOrder> { |
| | | |
| | | Integer selectOrderByUserId(@Param("userId") String userId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.MarsWantbuy; |
| | | import com.yami.shop.bean.vo.mars.MarsWantbuyVo; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_mars_wantbuy(寄售(求购表))】的数据库操作Mapper |
| | | * @createDate 2024-08-07 10:55:31 |
| | | * @Entity generator.domain.MarsWantbuy |
| | | */ |
| | | public interface MarsWantbuyMapper extends BaseMapper<MarsWantbuy> { |
| | | IPage<MarsWantbuyVo> getPage(PageParam<MarsWantbuy> page,@Param("buy") MarsWantbuy wantbuy); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.Message; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface MessageMapper extends BaseMapper<Message> { |
| | | |
| | | /** |
| | | * 根据轮播图id列表批量删除轮播图 |
| | | * @param ids 轮播图id列表 |
| | | */ |
| | | void deleteByIds(Long[] ids); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.app.dto.NoticeDto; |
| | | import com.yami.shop.bean.model.Notice; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 公告管理 |
| | | * |
| | | * @author hzm |
| | | * @date 2019-04-18 21:21:40 |
| | | */ |
| | | public interface NoticeMapper extends BaseMapper<Notice> { |
| | | |
| | | /** |
| | | * 分页获取公告 |
| | | * @param page 分页参数 |
| | | * @param notice 搜索条件 |
| | | * @return 公告分页数据 |
| | | */ |
| | | Page<NoticeDto> pageNotice(Page<NoticeDto> page, @Param("notice") Notice notice); |
| | | |
| | | /** |
| | | * 删除公告 |
| | | * @param id |
| | | * @param shopId |
| | | */ |
| | | void removeByIdAndShopId(@Param("id") Long id, @Param("shopId") long shopId); |
| | | |
| | | /** |
| | | * 条件查询分页获取公告 |
| | | * @param page 分页参数 |
| | | * @param notice 公告参数 |
| | | * @return 公告分页数据 |
| | | */ |
| | | IPage<Notice> listPage(@Param("page")PageParam<Notice> page, @Param("notice")Notice notice); |
| | | |
| | | /** |
| | | * 根据条件获取公告列表 |
| | | * @param notice |
| | | * @return |
| | | */ |
| | | List<Notice> getListByParam(@Param("notice") Notice notice); |
| | | |
| | | NoticeDto getNewNotice(); |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.NoticeUserLog; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_notice_user_log(公告用户浏览记录表)】的数据库操作Mapper |
| | | * @createDate 2024-07-18 17:26:43 |
| | | * @Entity com.yami.shop.bean.model.NoticeUserLog |
| | | */ |
| | | public interface NoticeUserLogMapper extends BaseMapper<NoticeUserLog> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.NotifyLog; |
| | | import com.yami.shop.bean.param.OrderParam; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lhd |
| | | * @date 2020-07-01 15:44:27 |
| | | */ |
| | | public interface NotifyLogMapper extends BaseMapper<NotifyLog> { |
| | | |
| | | /** |
| | | * 分页获取消息日志 |
| | | * @param page 分页参数 |
| | | * @param orderParam 订单参数 |
| | | * @return 消息日志分页数据 |
| | | */ |
| | | IPage<NotifyLog> pageByParam(PageParam<NotifyLog> page, @Param("orderParam") OrderParam orderParam); |
| | | |
| | | /** |
| | | * 根据订单号查询是否发送过催付消息 |
| | | * @param orderNumber 订单号 |
| | | * @return 催付消息数 |
| | | */ |
| | | Integer countMsgNum(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 获取还未发送的消息列表 |
| | | * @return 消息列表 |
| | | */ |
| | | List<NotifyLog> listUnSendMsgList(); |
| | | |
| | | /** |
| | | * @param userId |
| | | * @return 未读客服消息数 |
| | | */ |
| | | Integer countUnreadCsMsg(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 根据消息参数分页查询消息日志 |
| | | * @param page |
| | | * @param notifyLog |
| | | * @return |
| | | */ |
| | | IPage<NotifyLog> pageByNotifyLogParam(@Param("page") PageParam<NotifyLog> page, @Param("notifyLog") NotifyLog notifyLog); |
| | | |
| | | /** |
| | | * 消息批量设置成已读状态 |
| | | * @param logIds |
| | | */ |
| | | void isReadByIds(@Param("logIds") List<Long> logIds); |
| | | |
| | | /** |
| | | * 全部消息标为已读 |
| | | * @param shopId |
| | | */ |
| | | void isReadByShopId(@Param("shopId") Long shopId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.NotifyTemplate; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lhd |
| | | * @date 2020-07-01 15:44:27 |
| | | */ |
| | | public interface NotifyTemplateMapper extends BaseMapper<NotifyTemplate> { |
| | | |
| | | /** |
| | | * 统计启用的自定义消息模板数量 |
| | | * @return 数量 |
| | | */ |
| | | long countTagNotify(); |
| | | |
| | | /** |
| | | * 分页获取消息模板 |
| | | * @param pageAdapter 分页适配器 |
| | | * @return 消息模板列表 |
| | | */ |
| | | List<NotifyTemplate> pageTagNotify(@Param("adapter") PageAdapter pageAdapter); |
| | | |
| | | /** |
| | | * 根据id获取模板信息 |
| | | * @param templateId |
| | | * @return |
| | | */ |
| | | NotifyTemplate getInfoById(@Param("templateId") Long templateId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.model.NotifyTemplateRemind; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | |
| | | /** |
| | | * 消息提醒设置表 |
| | | * |
| | | * @author LGH |
| | | * @date 2022-10-26 15:51:49 |
| | | */ |
| | | public interface NotifyTemplateRemindMapper extends BaseMapper<NotifyTemplateRemind> { |
| | | |
| | | /** |
| | | * 分页获取消息设置列表 |
| | | * @param page |
| | | * @param notifyTemplateRemind |
| | | * @return |
| | | */ |
| | | Page<NotifyTemplateRemind> pageNotifyTemplateRemind(@Param("page") PageParam<NotifyTemplateRemind> page, @Param("notifyTemplateRemind") NotifyTemplateRemind notifyTemplateRemind); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.NotifyTemplate; |
| | | import com.yami.shop.bean.model.NotifyTemplateTag; |
| | | import com.yami.shop.bean.model.User; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lhd |
| | | * @date 2020-09-12 10:08:46 |
| | | */ |
| | | public interface NotifyTemplateTagMapper extends BaseMapper<NotifyTemplateTag> { |
| | | |
| | | /** |
| | | * 批量保存消息模板 |
| | | * @param notifyTemplate 模板参数 |
| | | */ |
| | | void insertBatch(@Param("notifyTemplate") NotifyTemplate notifyTemplate); |
| | | |
| | | /** |
| | | * 获取模板标签下的相关用户 |
| | | * @param templateId 模板id |
| | | * @return 用户列表 |
| | | */ |
| | | List<User> getUserListByTemplateId(@Param("templateId") Long templateId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.OfflineHandleEventItem; |
| | | |
| | | /** |
| | | * 下线处理事件记录项 |
| | | * |
| | | * @author |
| | | * @date 2019-09-20 10:44:58 |
| | | */ |
| | | public interface OfflineHandleEventItemMapper extends BaseMapper<OfflineHandleEventItem> { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.OfflineHandleEvent; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 下线处理事件 |
| | | * |
| | | * @author |
| | | * @date 2019-09-20 10:44:58 |
| | | */ |
| | | public interface OfflineHandleEventMapper extends BaseMapper<OfflineHandleEvent> { |
| | | |
| | | |
| | | /** |
| | | * 更新商家商品为审核通过 |
| | | * @param handleType 处理类型 |
| | | * @param handleId 处理id |
| | | * @param shopId 店铺id |
| | | * @param sysUserId 系统用户id |
| | | */ |
| | | void updateToSuccess(@Param("handleType") Integer handleType, @Param("handleId") Long handleId, @Param("shopId") Long shopId, @Param("sysUserId") Long sysUserId); |
| | | |
| | | /** |
| | | * 获取正在进行中的事件 |
| | | * @param handleType 处理类型 |
| | | * @param handleId 处理id |
| | | * @return 事件信息 |
| | | */ |
| | | OfflineHandleEvent getProcessingEventByHandleTypeAndHandleId(@Param("handleType") Integer handleType, @Param("handleId") Long handleId); |
| | | |
| | | /** |
| | | * 更新事件为申请状态 |
| | | * @param eventId 事件id |
| | | * @return 数量 |
| | | */ |
| | | int updateToApply(@Param("eventId") Long eventId); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.model.OrderInvoice; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author Citrus |
| | | * @date 2021-08-16 14:22:47 |
| | | */ |
| | | public interface OrderInvoiceMapper extends BaseMapper<OrderInvoice> { |
| | | /** |
| | | * 根据参数查询店铺的订单发票列表 |
| | | * @param page |
| | | * @param orderInvoice 参数 |
| | | * @return 店铺的订单发票列表 |
| | | */ |
| | | IPage<OrderInvoice> getShopPage(Page page, @Param("orderInvoice") OrderInvoice orderInvoice); |
| | | |
| | | /** |
| | | * 获取用户发票列表 |
| | | * @param page |
| | | * @param userId 用户id |
| | | * @return 列表 |
| | | */ |
| | | IPage<OrderInvoice> getUserInvoicePage(Page page,@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 根据订单发票id获取,app端使用 |
| | | * |
| | | * @param orderInvoiceId 订单发票id |
| | | * @return 信息 |
| | | */ |
| | | OrderInvoice getById(@Param("orderInvoiceId") Long orderInvoiceId); |
| | | |
| | | /** |
| | | * 该订单是否已经开具发票 |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | | int isUpload(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 根据订单id获取发票id |
| | | * @param orderNumber 订单id |
| | | * @return |
| | | */ |
| | | Long getByorderNumber(@Param("orderNumber")String orderNumber); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param orderNumbers 被取消的订单id |
| | | */ |
| | | void deleteBatch(@Param("orderNumbers")List<String> orderNumbers); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.OrderItemLang; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lhd |
| | | * @date 2020-08-31 13:54:58 |
| | | */ |
| | | public interface OrderItemLangMapper extends BaseMapper<OrderItemLang> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.dto.StatisticsRefundDto; |
| | | import com.yami.shop.bean.model.Order; |
| | | import com.yami.shop.bean.model.OrderItem; |
| | | import com.yami.shop.bean.param.PayTopParam; |
| | | import com.yami.shop.bean.param.ProdAnalysisSurveyParam; |
| | | import com.yami.shop.bean.param.ProdEffectParam; |
| | | import com.yami.shop.bean.param.ProdEffectRespParam; |
| | | import com.yami.shop.bean.vo.OrderItemDetailVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface OrderItemMapper extends BaseMapper<OrderItem> { |
| | | |
| | | /** |
| | | * 根据订单号获取订单项信息 |
| | | * |
| | | * @param orderNumber 订单号 |
| | | * @param lang 语言 |
| | | * @return 订单项信息 |
| | | */ |
| | | List<OrderItem> listByOrderNumber(@Param("orderNumber") String orderNumber, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据订单号获取订单项信息(不包含赠品) |
| | | * |
| | | * @param orderNumber 订单号 |
| | | * @param lang 语言 |
| | | * @return 订单项信息 |
| | | */ |
| | | List<OrderItem> getUnGiveawayOrderItemsByOrderNumber(@Param("orderNumber") String orderNumber, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 更新订单项的物流状态 |
| | | * |
| | | * @param orderItems 订单项 |
| | | */ |
| | | void updateByDeliveries(@Param("orderItems") List<OrderItem> orderItems); |
| | | |
| | | /** |
| | | * 根据订单号获取订单项信息 |
| | | * |
| | | * @param orderNumber 订单号 |
| | | * @return 订单项信息 |
| | | */ |
| | | List<OrderItem> getListByOrderNumber(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 获取支付金额TOP |
| | | * |
| | | * @param page 分页信息 |
| | | * @param param 时间 |
| | | * @param dbLang 语言 |
| | | * @return 支付金额TOP 订单项 |
| | | */ |
| | | IPage<PayTopParam> getPayAmounts(PageParam<OrderItem> page, @Param("param") ProdAnalysisSurveyParam param, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 统计某个商品的付款人数 |
| | | * |
| | | * @param prodId 商品id |
| | | * @param param 查询范围 |
| | | * @return 付款人数 |
| | | */ |
| | | Integer countPayPerson(@Param("prodId") Long prodId, @Param("param") ProdEffectParam param); |
| | | |
| | | /** |
| | | * 统计某个商品在特定时间内的付款人数 |
| | | * |
| | | * @param prodId 商品id |
| | | * @param shopId 店铺id |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束是按 |
| | | * @return 付款人数 |
| | | */ |
| | | Integer getPayPersonNumByParam(@Param("prodId") Integer prodId, @Param("shopId") Long shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 批量保存订单项信息 |
| | | * |
| | | * @param orderItems 订单项 |
| | | */ |
| | | void insertBatchOrderItemLang(@Param("orderItems") List<OrderItem> orderItems); |
| | | |
| | | /** |
| | | * 获取获取商品效果分析数据 |
| | | * |
| | | * @param prodIds 商品id |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 商品效果分析数据 |
| | | */ |
| | | List<ProdEffectRespParam> getProdEffectByDateAndProdIds(@Param("prodIds") List<Long> prodIds, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据订单项id和语言获取订单项 |
| | | * |
| | | * @param orderItemId 订单项id |
| | | * @param lang 语言 |
| | | * @return 订单项 |
| | | */ |
| | | OrderItem getByOrderItemId(@Param("orderItemId") Long orderItemId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据订单项获取信息 |
| | | * |
| | | * @param orderItemId |
| | | * @return |
| | | */ |
| | | OrderItem getInfoByOrderItemId(@Param("orderItemId") Long orderItemId); |
| | | |
| | | /** |
| | | * 根据订单编号获取订单项列表 |
| | | * |
| | | * @param orderNumber 订单编号 |
| | | * @return 订单项列表 |
| | | */ |
| | | List<OrderItem> listOrderItemByOrderNumber(@Param("orderNumber") String orderNumber); |
| | | |
| | | |
| | | /** |
| | | * 根据订单id查询订单项、退款详情 |
| | | * |
| | | * @param orderNumber 订单id |
| | | * @param refundId 退款单号 |
| | | * @return 订单项、退款详情 |
| | | */ |
| | | Order listDetailByParam(String orderNumber, Long refundId); |
| | | |
| | | /** |
| | | * 根据订单id查询订单项、退款详情 |
| | | * |
| | | * @param orderNumber 订单号 |
| | | * @param shopId 店铺id |
| | | * @param lang 语言 |
| | | * @return 订单项、退款详情 |
| | | */ |
| | | List<OrderItemDetailVO> listDetailByOrderNumber(@Param("orderNumber") String orderNumber, @Param("shopId") Long shopId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取订单项的商品及商品赠品总数量 |
| | | * |
| | | * @param orderItemId |
| | | * @return |
| | | */ |
| | | Integer getOrderItemProdNum(@Param("orderItemId") Long orderItemId); |
| | | |
| | | /** |
| | | * 根据订单编号获取订单项列表及支付时间 |
| | | * |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | | List<OrderItem> listAndPayTimeByOrderNumber(@Param("orderNumber") String orderNumber, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 支付数量TOP |
| | | * |
| | | * @param statisticsRefundDto |
| | | * @param dbLang |
| | | * @return |
| | | */ |
| | | List<PayTopParam> getOrderProdPayCount(@Param("statisticsRefundDto") StatisticsRefundDto statisticsRefundDto, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 获取时间范围内的销量排序的商品ids |
| | | * @param shopId 店铺id |
| | | * @param time 时间范围内 |
| | | * @param esRenovationSpuSort |
| | | * @return |
| | | */ |
| | | List<Long> getSoldNumRankByShopIdAndTime(@Param("shopId") Long shopId, @Param("time") Date time, @Param("esRenovationSpuSort") Integer esRenovationSpuSort); |
| | | |
| | | |
| | | // List<OrderItem> getUnCloseRefundOrderItemByOrderNumber(String orderNumber); |
| | | |
| | | // void insertBatch(List<OrderItem> orderItems); |
| | | |
| | | // List<OrderItem> getPayByOrderNumber(@Param("orderNumber") String orderNumber); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.Order; |
| | | import com.yami.shop.bean.model.OrderLang; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lhd |
| | | * @date 2020-08-31 13:54:58 |
| | | */ |
| | | public interface OrderLangMapper extends BaseMapper<OrderLang> { |
| | | |
| | | /** |
| | | * 批量插入订单语言信息 |
| | | * @param orderList 订单语言信息 |
| | | */ |
| | | void insertBatchOrderLang(@Param("orderList") List<Order> orderList); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.app.dto.MyOrderDto; |
| | | import com.yami.shop.bean.app.dto.MyOrderItemDto; |
| | | import com.yami.shop.bean.app.dto.OrderCountData; |
| | | import com.yami.shop.bean.bo.flow.UserOrderStatisticBO; |
| | | import com.yami.shop.bean.distribution.UserShoppingDataDto; |
| | | import com.yami.shop.bean.dto.flow.MemberReqDTO; |
| | | import com.yami.shop.bean.model.Order; |
| | | import com.yami.shop.bean.param.*; |
| | | import com.yami.shop.bean.vo.HalfMonthShopRevenueVO; |
| | | import com.yami.shop.bean.vo.OrderAmountVO; |
| | | import com.yami.shop.bean.vo.UnDeliveryOrderExcelVO; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | |
| | | /** |
| | | * 根据订单号获取订单信息 |
| | | * |
| | | * @param orderNumber 订单号 |
| | | * @return 订单信息 |
| | | */ |
| | | Order getOrderByOrderNumber(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 根据订单状态,获取非退款状态下的订单 |
| | | * |
| | | * @param orderStatus 订单状态 |
| | | * @param lessThanUpdateTime 最后更新时间 |
| | | * @return 非退款状态下的订单 |
| | | */ |
| | | List<Order> listUnRefundOrderAndOrderItems(@Param("orderStatus") Integer orderStatus, @Param("lessThanUpdateTime") DateTime lessThanUpdateTime); |
| | | |
| | | /** |
| | | * 取消订单 |
| | | * |
| | | * @param orders 订单列表 |
| | | */ |
| | | int cancelOrders(@Param("orders") List<Order> orders); |
| | | |
| | | /** |
| | | * 确认收货 |
| | | * |
| | | * @param orders 订单列表 |
| | | */ |
| | | void receiptOrder(@Param("orders") List<Order> orders); |
| | | |
| | | /** |
| | | * 更新成支付成功的状态 |
| | | * |
| | | * @param orderNumbers 订单id |
| | | * @param payType 支付方式 |
| | | */ |
| | | void updateByToPaySuccess(@Param("orderNumbers") List<String> orderNumbers, @Param("payType") Integer payType); |
| | | |
| | | /** |
| | | * 根据时间获取订单详情列表 |
| | | * |
| | | * @param order 订单查询参数 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 订单详情列表 |
| | | */ |
| | | List<Order> listOrdersDetailByOrder(@Param("order") Order order, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 获取订单详情列表 |
| | | * |
| | | * @param adapter 分页信息 |
| | | * @param orderParam 查询参数 |
| | | * @return 订单列表 |
| | | */ |
| | | List<Order> listOrdersDetailByOrderParam(@Param("adapter") PageAdapter adapter, @Param("orderParam") OrderParam orderParam); |
| | | |
| | | /** |
| | | * 根据订单查询参数,获取订单数量 |
| | | * |
| | | * @param orderParam 查询参数 |
| | | * @return 订单数量 |
| | | */ |
| | | Long countOrderDetail(@Param("orderParam") OrderParam orderParam); |
| | | |
| | | /** |
| | | * 获取用户购物数据 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param userId 用户id |
| | | * @return 用户购物数据 |
| | | */ |
| | | UserShoppingDataDto calculateUserInShopData(@Param("shopId") Long shopId, @Param("userId") String userId); |
| | | |
| | | /** |
| | | * 获取我的订单列表 |
| | | * |
| | | * @param adapter 分页参数 |
| | | * @param userId 用户id |
| | | * @param status 订单状态 |
| | | * @param lang 语言 |
| | | * @return 我的订单列表 |
| | | */ |
| | | List<MyOrderDto> listMyOrderByUserIdAndStatus(@Param("adapter") PageAdapter adapter, @Param("userId") String userId, |
| | | @Param("status") Integer status, @Param("prodName")String prodName, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取我的订单列表订单数量 |
| | | * |
| | | * @param userId 用户id |
| | | * @param status 订单状态 |
| | | * @param isComm 是否评论 |
| | | * @param stationId 自提点id |
| | | * @return 我的订单列表订单数量 |
| | | */ |
| | | Long countMyOrderByUserIdAndStatus(@Param("userId") String userId, @Param("status") Integer status, @Param("prodName") String prodName, @Param("isComm") Integer isComm, |
| | | @Param("stationId") Long stationId); |
| | | |
| | | /** |
| | | * 获取我的订单列表订单数量 |
| | | * |
| | | * @param status 订单状态 |
| | | * @param stationId 自提点id |
| | | * @return 我的订单列表订单数量 |
| | | */ |
| | | Long countByStatusAndStationId(@Param("status") Integer status, @Param("stationId") Long stationId); |
| | | |
| | | /** |
| | | * 批量删除订单 |
| | | * |
| | | * @param orders 订单 |
| | | */ |
| | | void deleteOrders(@Param("orders") List<Order> orders); |
| | | |
| | | /** |
| | | * 计算我的订单评价列表数量 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 我的订单评价列表数量 |
| | | */ |
| | | long countMyOrderByUserIdAndComm(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 获取各个订单状态的订单数量 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 各个订单状态下的订单数量 |
| | | */ |
| | | OrderCountData getOrderCount(String userId); |
| | | |
| | | /** |
| | | * 统计订单支付、客单价、订单金额等信息 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 订单支付、客单价、订单金额等信息 |
| | | */ |
| | | OrderPayParam getOrderCountByShopId(@Param("shopId") Long shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 通过24小时分段获取支付金额 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 各个小时的支付金额 |
| | | */ |
| | | List<OrderPayParam> getActualTotalByHour(@Param("shopId") Long shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 通过天数分段获取支付金额 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 每天支付金额 |
| | | */ |
| | | List<OrderPayParam> getPayOrderByTime(@Param("shopId") Long shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 取消当前已过期的秒杀订单 |
| | | * |
| | | * @param now 当前时间 |
| | | */ |
| | | void cancelSeckillOrderByTime(@Param("now") Date now); |
| | | |
| | | /** |
| | | * 更新订单为待成团 |
| | | * |
| | | * @param orderNumber 订单号 |
| | | * @return 变更数量 |
| | | */ |
| | | int updateToWaitGroup(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 通过拼团团队id更新订单为待发货或已发货状态 |
| | | * |
| | | * @param groupTeamId 团购id |
| | | * @param mold 是否虚拟商品 |
| | | * @return 变更数量 |
| | | */ |
| | | int updateToWaitDelivery(@Param("groupTeamId") Long groupTeamId, @Param("mold") Integer mold); |
| | | |
| | | /** |
| | | * 通过拼团团队id获取所有关联订单 |
| | | * |
| | | * @param groupTeamId 拼团团队id |
| | | * @return 关联订单 |
| | | */ |
| | | List<Order> selectOrderByGroupTeamId(@Param("groupTeamId") Long groupTeamId); |
| | | |
| | | /** |
| | | * 通过用户id和订单编号获取订单 |
| | | * |
| | | * @param orderNumber 订单编号 |
| | | * @param userId 用户id |
| | | * @return 订单 |
| | | */ |
| | | Order getOrderByOrderNumberAndUserId(@Param("orderNumber") String orderNumber, @Param("userId") String userId); |
| | | |
| | | /** |
| | | * 根据订单号获取订单及订单项 |
| | | * |
| | | * @param orderNumber 订单编号 |
| | | * @return 订单 |
| | | */ |
| | | Order getOrderAndOrderItemByOrderNumber(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 根据订单号获取订单及订单项 |
| | | * |
| | | * @param orderNumberList 订单编号列表 |
| | | * @return 订单列表 |
| | | */ |
| | | List<Order> getOrderAndOrderItemByOrderNumberList(@Param("orderNumberList") Set<String> orderNumberList); |
| | | |
| | | /** |
| | | * 判断是否需要购买置指定商品(购买指定商品的数量) |
| | | * |
| | | * @param prodId 商品id |
| | | * @param userId 用户id |
| | | * @return 购买指定商品的数量 |
| | | */ |
| | | Integer hasBuySuccessProd(@Param("prodId") Long prodId, @Param("userId") String userId); |
| | | |
| | | /** |
| | | * 模糊查询订单列表中的某一项订单 |
| | | * |
| | | * @param adapter 分页信息 |
| | | * @param userId 用户id |
| | | * @param status 订单状态 |
| | | * @param orderName 订单商品名 |
| | | * @param orderTimeStatus 0全部订单 1最近七天 2最近三个月 3三个月之前 订单 |
| | | * @param preTime 七天/三十天 |
| | | * @param orderType 订单类型 |
| | | * @param orderNumber 订单号 |
| | | * @param dbLang 语言 |
| | | * @param shopId 店铺id |
| | | * @param orderMold 订单类别 |
| | | * @return 我的订单列表 |
| | | */ |
| | | List<MyOrderDto> listMyOrderByParams(@Param("adapter") PageAdapter adapter, @Param("userId") String userId, @Param("status") Integer status, |
| | | @Param("orderName") String orderName, @Param("orderTimeStatus") Integer orderTimeStatus, |
| | | @Param("preTime") String preTime, @Param("orderType") Integer orderType, @Param("orderNumber") String orderNumber, |
| | | @Param("lang") Integer dbLang, @Param("shopId") Long shopId, @Param("orderMold") Integer orderMold); |
| | | |
| | | /** |
| | | * 统计模糊查询订单列表中的某一项订单 |
| | | * |
| | | * @param userId 用户id |
| | | * @param status 订单状态 |
| | | * @param orderName 订单商品名 |
| | | * @param orderTimeStatus 0全部订单 1最近七天 2最近三个月 3三个月之前 订单 |
| | | * @param preTime 七天/三十天 |
| | | * @param orderType 订单类型 |
| | | * @param orderNumber 订单号 |
| | | * @param shopId 店铺id |
| | | * @param orderMold |
| | | * @return 我的订单列表 |
| | | */ |
| | | Long countMyOrderByParams(@Param("userId") String userId, @Param("status") Integer status, @Param("orderName") String orderName, |
| | | @Param("orderTimeStatus") Integer orderTimeStatus, @Param("preTime") String preTime, |
| | | @Param("orderType") Integer orderType, @Param("orderNumber") String orderNumber, @Param("shopId") Long shopId, @Param("orderMold") Integer orderMold); |
| | | |
| | | /** |
| | | * 获取订单列表 |
| | | * |
| | | * @param orderParam 订单参数 |
| | | * @return 订单列表 |
| | | */ |
| | | List<Order> listOrdersDetailByOrderInfo(@Param("orderParam") OrderParam orderParam); |
| | | |
| | | /** |
| | | * 获取待发货订单列表 |
| | | * |
| | | * @param orderParam 订单参数 |
| | | * @return 待发货订单列表 |
| | | */ |
| | | List<UnDeliveryOrderExcelVO> listUnDeliveryOrderExcel(@Param("orderParam") OrderParam orderParam); |
| | | |
| | | /** |
| | | * 根据订单id列表获取订单列表 |
| | | * |
| | | * @param orderNumberList 订单列表 |
| | | * @return 订单列表 |
| | | */ |
| | | List<Order> getOrderPayInfoByOrderNumber(@Param("orderNumberList") List<String> orderNumberList); |
| | | |
| | | /** |
| | | * 通过订单编号、店铺id获取订单详情 |
| | | * |
| | | * @param orderNumber 订单编号 |
| | | * @param shopId 店铺id |
| | | * @param lang 语言 |
| | | * @return 订单详情 |
| | | */ |
| | | Order getOrderDetailByOrderNumberAndShopId(@Param("orderNumber") String orderNumber, @Param("shopId") Long shopId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据订单评价状态获取订单列表信息 |
| | | * |
| | | * @param pageAdapter 分页参数 |
| | | * @param userId 用户id |
| | | * @param lang 语言 |
| | | * @return 待评价订单列表 |
| | | */ |
| | | List<MyOrderDto> orderCommentByUserIdAndStatus(@Param("adapter") PageAdapter pageAdapter, @Param("userId") String userId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取自提点的订单列表 |
| | | * |
| | | * @param pageAdapter |
| | | * @param stationId 自提点id |
| | | * @param userId 用户id |
| | | * @param shopId 店铺id |
| | | * @return 订单列表 |
| | | */ |
| | | List<MyOrderDto> getOrderListByStationId(@Param("page") PageAdapter pageAdapter, @Param("stationId") Long stationId, |
| | | @Param("userId") String userId, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 获取自提点的订单数量 |
| | | * |
| | | * @param stationId 自提点id |
| | | * @param userId 用户id |
| | | * @param shopId 店铺id |
| | | * @return 订单列表 |
| | | */ |
| | | int countOrderListByStationId(@Param("stationId") Long stationId, @Param("userId") String userId, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 分页获取自提点订单列表 |
| | | * |
| | | * @param pageAdapter 分页参数 |
| | | * @param status 订单状态 |
| | | * @param stationId 自提点id |
| | | * @return 自提点订单列表 |
| | | */ |
| | | List<MyOrderDto> orderListByStatusAndStationId(@Param("adapter") PageAdapter pageAdapter, @Param("status") Integer status, @Param("stationId") Long stationId); |
| | | |
| | | /** |
| | | * 获取待自提的订单 |
| | | * |
| | | * @param orderNumberList 订单编号列表 |
| | | * @param userId 用户id |
| | | * @param stationId 自提点id |
| | | * @return 订单列表 |
| | | */ |
| | | List<Order> getStationOrderByOrderNumbers(@Param("orderNumberList") List<String> orderNumberList, @Param("userId") String userId, @Param("stationId") Long stationId); |
| | | |
| | | /** |
| | | * 获取用户评论订单项 |
| | | * |
| | | * @param pageAdapter 分页参数 |
| | | * @param userId 用户id |
| | | * @param isComm 是否评论 |
| | | * @param lang 语言 |
| | | * @return 评论订单项列表 |
| | | */ |
| | | List<MyOrderItemDto> orderItemCommentByUserIdAndStatus(@Param("adapter") PageAdapter pageAdapter, @Param("userId") String userId, @Param("isComm") Integer isComm, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 计算用户评论订单项数量 |
| | | * |
| | | * @param userId 用户id |
| | | * @param isComm 是否已评论 |
| | | * @return 评论订单项数量 |
| | | */ |
| | | Long countOrderItemComment(@Param("userId") String userId, @Param("isComm") Integer isComm); |
| | | |
| | | /** |
| | | * 统计时间内,成功下单的商品件数之和(不剔除退款订单) |
| | | * |
| | | * @param param 统计参数 |
| | | * @return 成功下单的商品件数之和 |
| | | */ |
| | | Long countOrderNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 统计时间内, 成功付款订单的商品件数之和(不剔除退款订单) |
| | | * |
| | | * @param param 统计参数 |
| | | * @return 成功付款订单的商品件数之和 |
| | | */ |
| | | Long countPayNum(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 统计时间内, 成功付款订单的人数和(不剔除退款订单,去重userId) |
| | | * |
| | | * @param param 统计参数 |
| | | * @return 成功付款订单的人数和 |
| | | */ |
| | | Integer countPayCustomerNum(@Param("param") CustomerReqParam param); |
| | | |
| | | /** |
| | | * 统计时间内, 成交会员数 |
| | | * |
| | | * @param param 统计参数 |
| | | * @return 成交会员数 |
| | | */ |
| | | Integer countMemberPayNum(@Param("param") CustomerReqParam param); |
| | | |
| | | /** |
| | | * 新成交客户数:过去n(beforeYear:过去n年的时间点)年没有购买,在筛选时间内首次在店铺付款的客户数量 |
| | | * |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 首次在店铺付款的客户数量 |
| | | */ |
| | | Integer countNewMemberPayNum(@Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 老成交客户数:过去n(beforeYear:过去n年的时间点)年没有购买,在筛选时间内在店铺再次付款的客户数量 |
| | | * |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 再次付款的客户数量 |
| | | */ |
| | | Integer countOldMemberPayNum(@Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 成交客户数 |
| | | * |
| | | * @param param 统计参数 |
| | | * @return 全部成交客户占比 |
| | | */ |
| | | Double countMemberPayAmount(@Param("param") CustomerReqParam param); |
| | | |
| | | /** |
| | | * 新成交客户数:过去n(beforeYear:过去n年的时间点)年没有购买,在筛选时间内首次在店铺付款金额总和 |
| | | * |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 成交客户数 |
| | | */ |
| | | Double countNewMemberPayAmount(@Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 老成交客户数:过去n(beforeYear:过去n年的时间点)年没有购买,在筛选时间内在店铺再次付款金额总和 |
| | | * |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 老成交客户数 |
| | | */ |
| | | Double countOldMemberPayAmount(@Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 购买客户数 |
| | | * |
| | | * @param type 0新客户 其他老客户 |
| | | * @param f f |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 购买客户数 |
| | | */ |
| | | Integer countPayNumRfm(@Param("type") Integer type, @Param("f") Integer f, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 支付金额 |
| | | * |
| | | * @param type 0新客户 其他老客户 |
| | | * @param f f |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 支付金额 |
| | | */ |
| | | Double sumPayAmountRfm(@Param("type") Integer type, @Param("f") Integer f, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | |
| | | /** |
| | | * 新成交客户,商品支付件数 |
| | | * |
| | | * @param type 0新客户 其他老客户 |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 商品支付件数 |
| | | */ |
| | | Integer countNewOrOldPayProdNum(@Param("type") Integer type, @Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | |
| | | /** |
| | | * 统计老/新客户订单数量 |
| | | * |
| | | * @param type 0新客户 其他老客户 |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 老/新客户订单数量 |
| | | */ |
| | | Integer countNewOrOldPayTimes(@Param("type") Integer type, @Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 统计老/新客户订单信息 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param type 0新客户 其他老客户 |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 老/新客户订单信息 |
| | | */ |
| | | List<CustomerOrderParam> getNewRepurchaseParam(@Param("shopId") Long shopId, @Param("type") Integer type, @Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * "成交金额" "成交购买客户数" "成交购买数量" "回购次数" |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param type 0新客户 其他老客户 |
| | | * @param cycle 回购周期间隔 10天 30天 |
| | | * @param userId 用户id |
| | | * @param payTime 支付时间 |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 回购数据统计 |
| | | */ |
| | | CustomerRepurchaseDetailParam getNewRepurchaseCount(@Param("shopId") Long shopId, @Param("type") Integer type, @Param("cycle") Integer cycle, @Param("userId") String userId, @Param("payTime") Date payTime, @Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 会员支付数 or 订单数 |
| | | * |
| | | * @param param 参数 |
| | | * @param isOrderNum 是否订单数 |
| | | * @return 会员支付数 or 订单数 |
| | | */ |
| | | Integer countPaidMemberByParam(@Param("param") MemberReqParam param, @Param("isOrderNum") Integer isOrderNum); |
| | | |
| | | /** |
| | | * 会员支付金额 |
| | | * |
| | | * @param param 参数 |
| | | * @return 会员支付金额 |
| | | */ |
| | | Double countMemberPaidAmount(@Param("param") MemberReqParam param); |
| | | |
| | | /** |
| | | * 会员支付订单数 |
| | | * |
| | | * @param param 参数 |
| | | * @return 会员支付订单数 |
| | | */ |
| | | Integer countMemberPayOrder(@Param("param") MemberReqParam param); |
| | | |
| | | /** |
| | | * 会员客单价 |
| | | * |
| | | * @param param 参数 |
| | | * @return 会员客单价 |
| | | */ |
| | | Integer countPayMemberNum(@Param("param") MemberReqParam param); |
| | | |
| | | |
| | | /** |
| | | * 支付订单数 |
| | | * |
| | | * @param type 0新客户 其他老客户 |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 支付订单数 |
| | | */ |
| | | Integer countNewOrOldMemberPayOrder(@Param("type") Integer type, @Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | |
| | | /** |
| | | * 新成交会员数 |
| | | * |
| | | * @param type 0新客户 其他老客户 |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param dayStartTime |
| | | * @param dayEndTime |
| | | * @return 新成交会员数 |
| | | */ |
| | | Integer countNewMemberEveryDayPayNum(@Param("type") Integer type, @Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("dayStartTime") Date dayStartTime, @Param("dayEndTime") Date dayEndTime); |
| | | |
| | | /** |
| | | * 新支付订单数 |
| | | * |
| | | * @param type 0新客户 其他老客户 |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param dayStartTime |
| | | * @param dayEndTime |
| | | * @return |
| | | */ |
| | | Integer countNewOrOldMemberEveryDayPayPayOrder(@Param("type") Integer type, @Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("dayStartTime") Date dayStartTime, @Param("dayEndTime") Date dayEndTime); |
| | | |
| | | /** |
| | | * 新支付金额 |
| | | * |
| | | * @param type 0新客户 其他老客户 |
| | | * @param beforeYear 过去n年的时间点 |
| | | * @param startTime 开始时间 |
| | | * @param dayStartTime |
| | | * @param dayEndTime |
| | | * @return 新支付金额 |
| | | */ |
| | | Double countNewMemberEveryDayPayAmount(@Param("type") Integer type, @Param("beforeYear") Date beforeYear, @Param("startTime") Date startTime, @Param("dayStartTime") Date dayStartTime, @Param("dayEndTime") Date dayEndTime); |
| | | |
| | | /** |
| | | * 已支付用户id列表 |
| | | * |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 已支付用户id列表 |
| | | */ |
| | | List<String> countPayUser(@Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * type = 0 排除已经支付过的用户 1 不排除 |
| | | * |
| | | * @param type |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param userIds |
| | | * @return |
| | | */ |
| | | List<String> countPayUserRetained(@Param("type") Integer type, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("userIds") List<String> userIds); |
| | | |
| | | /** |
| | | * RFM表格返回值 |
| | | * |
| | | * @param type |
| | | * @param recentTime 当前 |
| | | * @param mouth 1个月 |
| | | * @param threeMouth 3个月 |
| | | * @param halfYear 半年 |
| | | * @param year 一年 |
| | | * @return rfm |
| | | */ |
| | | List<CustomerRFMRespTableParam> getUserOrderCrateTime(@Param("type") Integer type, @Param("recentTime") Date recentTime, @Param("mouth") Date mouth, |
| | | @Param("threeMouth") Date threeMouth, @Param("halfYear") Date halfYear, @Param("year") Date year); |
| | | |
| | | /** |
| | | * 获取在一定时间内消费一定次数的会员信息 |
| | | * |
| | | * @param isPayed 是否已支付 |
| | | * @param deleteStatus |
| | | * @param startDate 开始时间 |
| | | * @param endDate 结束时间 |
| | | * @param status 状态 |
| | | * @param minNum 最小数量 |
| | | * @param maxNum 最大数量 |
| | | * @return 会员id |
| | | */ |
| | | List<String> listUserIdByPurchaseNum(@Param("isPayed") Integer isPayed, |
| | | @Param("deleteStatus") Integer deleteStatus, |
| | | @Param("startDate") Date startDate, |
| | | @Param("endDate") Date endDate, |
| | | @Param("status") Integer status, |
| | | @Param("minNum") Long minNum, |
| | | @Param("maxNum") Long maxNum); |
| | | |
| | | /** |
| | | * 获取在一定时间内消费一定金额的会员信息 |
| | | * |
| | | * @param isPayed 是否已支付 |
| | | * @param deleteStatus |
| | | * @param startDate 开始时间 |
| | | * @param endDate 结束时间 |
| | | * @param status 状态 |
| | | * @param minAmount 最小支付金额 |
| | | * @param maxAmount 最大支付金额 |
| | | * @return 会员id |
| | | */ |
| | | List<String> listUserIdByAverageActualTotal(@Param("isPayed") Integer isPayed, |
| | | @Param("deleteStatus") Integer deleteStatus, |
| | | @Param("startDate") Date startDate, |
| | | @Param("endDate") Date endDate, |
| | | @Param("status") Integer status, |
| | | @Param("minAmount") BigDecimal minAmount, |
| | | @Param("maxAmount") BigDecimal maxAmount); |
| | | |
| | | /** |
| | | * 最近消费时间, 下单支付的时间(积分支付/余额支付), 充值时间, 比较获取最新时间 |
| | | * |
| | | * @param userId 会员id |
| | | * @return 最近消费时间 |
| | | */ |
| | | Date getLastConsumeDateByUserId(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 消费金额, 累计消费了多少金额:除了积分支付的订单累计金额 |
| | | * |
| | | * @param userId 会员id |
| | | * @param type = 0 不统计余额支付部分 type = 1 统计 |
| | | * @return 消费金额 |
| | | */ |
| | | Double countConsumeAmount(@Param("userId") String userId, @Param("type") Integer type); |
| | | |
| | | /** |
| | | * 消费次数, 累计消费的次数(积分下单不包含),下单的次数 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 消费次数, 累计消费的次数(积分下单不包含),下单的次数 |
| | | */ |
| | | Integer countPayNumByUserId(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 平均折扣, 消费下单的优惠总金额/消费次数 |
| | | * 优惠总金额 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 平均折扣 |
| | | */ |
| | | Double countReduceAmountByUserId(String userId); |
| | | |
| | | /** |
| | | * 分页获取订单信息 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param userId 用户id |
| | | * @return 订单信息 |
| | | */ |
| | | IPage<Order> getPageByUserId(@Param("page") PageParam<Order> page, @Param("userId") String userId); |
| | | |
| | | /** |
| | | * 订单统计列表 |
| | | * |
| | | * @param param 参数 |
| | | * @return 订单统计列表 |
| | | */ |
| | | List<ProdAnalysisDataParam> prodSurveyList(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 获取订单的创建状态,给秒杀提供查询是否已经创建订单成功的功能 |
| | | * |
| | | * @param orderNumber 订单id |
| | | * @return |
| | | */ |
| | | Integer countByOrderNumber(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 获取用户的成交留存率, 统计用户第一次成交后,之后的1到6个月的留存用户数 |
| | | * |
| | | * @param param 条件查询参数 |
| | | * @return 成交留存信息列表 |
| | | */ |
| | | List<CustomerRetainRespParam> getTradeRetained(@Param("param") CustomerRetainedReqParam param); |
| | | |
| | | /** |
| | | * 根据订单号和商家id获取信息 |
| | | * |
| | | * @param orderNumber 订单编号 |
| | | * @param shopId 店铺id |
| | | * @return 信息 |
| | | */ |
| | | UnDeliveryOrderExcelVO getOrderAndOrderItemsByOrderNumberAndShopId(@Param("orderNumber") String orderNumber, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 获取订单id,根据订单订单状态和时间 |
| | | * |
| | | * @param orderStatus 订单状态 |
| | | * @param startTime 开始时间 |
| | | * @return 订单和订单项 |
| | | */ |
| | | List<Order> listPendingSettlementOrders(@Param("orderStatus") Integer orderStatus, @Param("startTime") Date startTime); |
| | | |
| | | /** |
| | | * 将订单标记为已结算状态 |
| | | * |
| | | * @param orders 订单 |
| | | * @return 变更数量 |
| | | */ |
| | | int settledOrder(@Param("orders") List<Order> orders); |
| | | |
| | | /** |
| | | * 根据店铺id按订单状态分组获取订单数量 |
| | | * |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | OrderCountData getOrderCountOfStatusByShopId(@Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据时间获取成交数量 |
| | | * |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 数据 |
| | | */ |
| | | List<CustomerPayParam> countPayCustomerNumByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 获取 客户洞察-》消费能力分析 的用户信息 |
| | | * |
| | | * @param type 1新成交客户 2老成交客户 |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | CustomerConsumeRespParam getConsumePowerUserInfo(@Param("type") Integer type, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 会员支付信息 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | List<UserOrderStatisticBO> getPaidMemberByParam(@Param("param") MemberReqDTO param); |
| | | |
| | | /** |
| | | * 计算订单实际金额 |
| | | * |
| | | * @param orderNumbers |
| | | * @return |
| | | */ |
| | | OrderAmountVO getOrdersActualAmount(@Param("orderNumbers") List<String> orderNumbers); |
| | | |
| | | /** |
| | | * 获取在一定时间内消费大于一定金额的会员信息 |
| | | * |
| | | * @param isPayed 是否已支付 |
| | | * @param deleteStatus |
| | | * @param startDate 开始时间 |
| | | * @param endDate 结束时间 |
| | | * @param status 状态 |
| | | * @param minAmount 最小支付金额 |
| | | * @return 会员id |
| | | */ |
| | | List<String> listUserIdByAverageActualTotals(@Param("isPayed") Integer isPayed, |
| | | @Param("deleteStatus") Integer deleteStatus, |
| | | @Param("startDate") Date startDate, |
| | | @Param("endDate") Date endDate, |
| | | @Param("status") Integer status, |
| | | @Param("minAmount") BigDecimal minAmount) |
| | | ; |
| | | |
| | | /** |
| | | * 商品概况分析 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | ProdAnalysisDataParam getProdSurvey(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 或者指定的时间内下单或者支付订单的商品id列表 |
| | | * |
| | | * @param startTime |
| | | * @return |
| | | */ |
| | | List<Long> listProdIdByTime(@Param("startTime") Date startTime); |
| | | |
| | | /** |
| | | * 根据用户id和店铺id分页获取订单信息 |
| | | * @param page |
| | | * @param userId |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | IPage<Order> getPageByUserIdAndShopId(@Param("page") PageParam<Order> page, @Param("userId") String userId, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据店铺id获取已售订单数 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | Integer selectOrderCountByShopId(Long shopId); |
| | | |
| | | /** |
| | | * 获取近7日订单数 |
| | | * @param shopId |
| | | * @param date |
| | | * @return |
| | | */ |
| | | Integer selectCountByShopIdAndWeek(@Param("shopId") Long shopId, @Param("date") Date date); |
| | | |
| | | /** |
| | | * 获取今日交易额 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | Double selectTodayRevenueByShopId(Long shopId); |
| | | |
| | | List<HalfMonthShopRevenueVO> getDailyRevenueForShop(Long shopId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.dto.OrderRefundDto; |
| | | import com.yami.shop.bean.dto.StatisticsRefundDto; |
| | | import com.yami.shop.bean.model.OrderRefund; |
| | | import com.yami.shop.bean.param.ProdEffectParam; |
| | | import com.yami.shop.bean.param.ProdEffectRespParam; |
| | | import com.yami.shop.bean.param.StatisticsRefundParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface OrderRefundMapper extends BaseMapper<OrderRefund> { |
| | | |
| | | /** |
| | | * 获取退款申请列表 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param orderRefundDto 查询参数 |
| | | * @param beginTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 退款申请列表 |
| | | */ |
| | | IPage<OrderRefundDto> getPage(Page page, @Param("orderRefundDto") OrderRefundDto orderRefundDto, @Param("beginTime") String beginTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 获取退款详情信息 |
| | | * |
| | | * @param id 退款id |
| | | * @param shopId 店铺id |
| | | * @return 退款详情 |
| | | */ |
| | | OrderRefundDto getById(@Param("id") Long id, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 获取首页商家的退款信息 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param beginTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 首页商家的退款信息 |
| | | */ |
| | | StatisticsRefundParam getRefundByShopId(@Param("shopId") Long shopId, @Param("startTime") Date beginTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 通过时间获取商家每天的退款信息 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param beginTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 商家每天的退款信息 |
| | | */ |
| | | List<StatisticsRefundParam> getRefundByShopIdAndDay(@Param("shopId") Long shopId, @Param("startTime") Date beginTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 获取退款商品信息排行 |
| | | * |
| | | * @param statisticsRefundDto |
| | | * @param dbLang 语言 |
| | | * @return 退款商品信息排行 |
| | | */ |
| | | List<StatisticsRefundParam> getRefundRankingByProd(@Param("statisticsRefundDto") StatisticsRefundDto statisticsRefundDto, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 获取退款原因排行 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param beginTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 退款原因排行 |
| | | */ |
| | | List<StatisticsRefundParam> getRefundRankingByReason(@Param("shopId") Long shopId, @Param("startTime") Date beginTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 通过退款编号获取退款订单 |
| | | * |
| | | * @param refundSn 退款编号 |
| | | * @return 退款订单详情 |
| | | */ |
| | | OrderRefundDto getOrderRefundByRefundSn(@Param("refundSn") String refundSn); |
| | | |
| | | /** |
| | | * 批量更新退款状态 |
| | | * |
| | | * @param refundList 退款订单列表 |
| | | * @param status 退款状态 |
| | | */ |
| | | void updateReturnMoneySts(@Param("refundList") List<OrderRefund> refundList, @Param("status") Integer status); |
| | | |
| | | /** |
| | | * 计算退款成功的金额 |
| | | * |
| | | * @param orderId 订单id |
| | | * @return 退款成功金额 |
| | | */ |
| | | double sumRefundSuccessAmountByOrderId(@Param("orderId") Long orderId); |
| | | |
| | | /** |
| | | * 通过订单id获取正在处理中的退款订单 |
| | | * |
| | | * @param orderId 订单id |
| | | * @return 正在处理中的退款订单 |
| | | */ |
| | | List<OrderRefund> getProcessingOrderRefundByOrderId(@Param("orderId") Long orderId); |
| | | |
| | | /** |
| | | * 计算退款成功的平台金额 |
| | | * |
| | | * @param orderId 订单id |
| | | * @return 退款成功的平台金额 |
| | | */ |
| | | double sumRefundSuccessPlatformAmountByOrderId(@Param("orderId") Long orderId); |
| | | |
| | | /** |
| | | * 计算商品退款的数量 |
| | | * |
| | | * @param prodId 商品id |
| | | * @param param 参数 |
| | | * @return 退款数量 |
| | | */ |
| | | int countRefundNum(@Param("prodId") Long prodId, @Param("param") ProdEffectParam param); |
| | | |
| | | // Double countRefundSuccessAmount(@Param("prodId") Long prodId, @Param("param") ProdEffectParam param); |
| | | |
| | | /** |
| | | * 获取退款数量,根据退款单号 |
| | | * |
| | | * @param refundSn 退款单号 |
| | | * @return 退款数量 |
| | | */ |
| | | Integer getOrderRefundCountByRefundSn(@Param("refundSn") String refundSn); |
| | | |
| | | /** |
| | | * 获取用户在申请退款的退款单数量 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 退款单数量 |
| | | */ |
| | | Integer getRefundCount(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 计算用户退款成功金额 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 退款成功金额 |
| | | */ |
| | | Double countRefundAmountByUserId(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 计算用户退款成功数量 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 退款成功数量 |
| | | */ |
| | | Integer countRefundNumByUserId(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 商品退款率等信息 |
| | | * |
| | | * @param prodIds 商品id |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 商品退款率等信息 |
| | | */ |
| | | List<ProdEffectRespParam> getProdEffectByDateAndProdIds(@Param("prodIds") List<Long> prodIds, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 通过退款编号修改退款订单信息 |
| | | * |
| | | * @param orderRefund 退款信息 |
| | | */ |
| | | void updateByRefundSn(@Param("orderRefund") OrderRefund orderRefund); |
| | | |
| | | /** |
| | | * 通过退款编号列表获取退款订单 |
| | | * |
| | | * @param refundSn 退款编号 |
| | | * @return 退款订单详情 |
| | | */ |
| | | List<OrderRefundDto> listOrderRefundByRefundSn(@Param("refundSnList") List<String> refundSn); |
| | | } |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.OrderSettlement; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface OrderSettlementMapper extends BaseMapper<OrderSettlement> { |
| | | |
| | | /** |
| | | * 更新结算状态,根据订单编号和用户id |
| | | * @param orderSettlement 结算信息 |
| | | */ |
| | | void updateByOrderNumberAndUserId(@Param("orderSettlement") OrderSettlement orderSettlement); |
| | | |
| | | /** |
| | | * 根据支付单号获取结算信息 |
| | | * @param payNo 支付单号 |
| | | * @return 结算信息列表 |
| | | */ |
| | | List<OrderSettlement> getSettlementsByPayNo(@Param("payNo") String payNo); |
| | | |
| | | /** |
| | | * 更新成支付状态 |
| | | * @param payNo 支付单号 |
| | | * @param bizPayNo 外包支付单号 |
| | | * @param version 版本号 |
| | | * @return 是否更新成功 |
| | | */ |
| | | int updateToPay(@Param("payNo") String payNo,@Param("bizPayNo") String bizPayNo, @Param("version") Integer version); |
| | | |
| | | /** |
| | | * 更新成支付状态 |
| | | * @param orderNumbers 订单编号 |
| | | * @param bizPayNo 外包支付单号 |
| | | * @param version 版本号 |
| | | * @return 是否更新成功 |
| | | */ |
| | | int updateToOrderNumbers(@Param("orderNumbers") List<String> orderNumbers,@Param("bizPayNo") String bizPayNo, @Param("version") Integer version); |
| | | |
| | | /** |
| | | * 计算订单支付金额 |
| | | * @param orderNumber 订单编号 |
| | | * @return 支付金额 |
| | | */ |
| | | double getSumAmountByNum(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 获取支付的时候的支付金额 |
| | | * @param payNo 支付单号 |
| | | * @return 支付金额 |
| | | */ |
| | | double getPayAmountWhenPay(String payNo); |
| | | |
| | | /** |
| | | * 通过订单编号获取订单支付信息列表 |
| | | * @param orderNumbers 订单编号列表 |
| | | * @return 订单支付信息 |
| | | */ |
| | | List<OrderSettlement> listDetailByOrderNumbers(@Param("orderNumbers") List<String> orderNumbers); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.app.dto.MyOrderDto; |
| | | import com.yami.shop.bean.model.OrderVirtualInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 订单自提信息 |
| | | * |
| | | * @author lhd |
| | | * @date 2021-09-15 15:45:35 |
| | | */ |
| | | public interface OrderVirtualInfoMapper extends BaseMapper<OrderVirtualInfo> { |
| | | |
| | | /** |
| | | * 获取最新的券码 |
| | | * |
| | | * @param shopId 商家id |
| | | * @return 券码 |
| | | */ |
| | | String getNewCodeInfo(@Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 通过核销码获取订单信息 |
| | | * @param shopId 店铺id |
| | | * @param code 核销码 |
| | | * @return 订单信息 |
| | | */ |
| | | MyOrderDto getOrderByCode(@Param("shopId") Long shopId, @Param("code") String code); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.PayInfo; |
| | | import com.yami.shop.bean.vo.AccountDetailVO; |
| | | import com.yami.shop.bean.vo.ShopAccountDetailVO; |
| | | import com.yami.shop.bean.vo.ShopAccountVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author Citrus |
| | | * @date 2022-05-18 17:03:18 |
| | | */ |
| | | public interface PayInfoMapper extends BaseMapper<PayInfo> { |
| | | |
| | | /** |
| | | * 主动查单 |
| | | * @param orderNumbers 订单号 |
| | | * @param userId 用户id |
| | | * @param payEntry 支付入口 |
| | | * @return 是否支付 |
| | | */ |
| | | Integer queryPay(@Param("orderNumbers") String orderNumbers, @Param("userId") String userId, @Param("payEntry") Integer payEntry); |
| | | |
| | | /** |
| | | * 获取商家的收入账户详情 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param shopName 店铺名称 |
| | | * @return 收入账户详情 |
| | | */ |
| | | AccountDetailVO getIncomeAccountDetail(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("shopName")String shopName); |
| | | |
| | | /** |
| | | * 根据时间参数获取店铺收入账户 |
| | | * @param page |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param shopName 店铺名称 |
| | | * @return 收入账户 |
| | | */ |
| | | IPage<ShopAccountVO> pageAllIncomeAccount(PageParam<ShopAccountVO> page, @Param("startTime") Date startTime, |
| | | @Param("endTime") Date endTime, @Param("shopName")String shopName); |
| | | |
| | | /** |
| | | * 根据店铺id和时间参数获取店铺收入账户详情 |
| | | * @param page |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param shopId 店铺id |
| | | * @return 收入账户详情 |
| | | */ |
| | | IPage<ShopAccountDetailVO> pageShopIncomeAccountDetail(PageParam<ShopAccountDetailVO> page, @Param("startTime") Date startTime, |
| | | @Param("endTime") Date endTime, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据时间参数获取平台收入账户详情 |
| | | * @param page |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 收入账户详情 |
| | | */ |
| | | IPage<ShopAccountDetailVO> pagePlatformIncomeAccountDetail(PageParam<ShopAccountDetailVO> page, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据时间参数店铺id获取所有收入账户详情列表,excel |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param shopName |
| | | * @return |
| | | */ |
| | | List<ShopAccountDetailVO> listIncomeAccountDetail(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("shopName") String shopName); |
| | | |
| | | /** |
| | | * 通过用户id获取订单支付信息列表,并去掉有重复的订单支付数据 |
| | | * @param userIds 用户id列表 |
| | | * @param now 当前时间 |
| | | * @return 订单支付信息 |
| | | */ |
| | | List<PayInfo> listByUserIdList(@Param("userIds") Set<String> userIds, @Param("now") DateTime now); |
| | | |
| | | /** |
| | | * 查询出微信支付并且为二维码支付的 |
| | | * @return 订单支付信息 |
| | | */ |
| | | List<PayInfo> listByPayTypeAndTime(); |
| | | |
| | | /** |
| | | * 获取当日的支付总金额 |
| | | * @return |
| | | */ |
| | | BigDecimal selectMoney(@Param("types") Integer type); |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.enums.DeviceStatus; |
| | | import com.yami.shop.bean.model.PcdnDevice; |
| | | import com.yami.shop.bean.param.DeviceParam; |
| | | import com.yami.shop.bean.vo.DeviceVO; |
| | | import com.yami.shop.bean.vo.PCDNDevicePageVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * pcdn设备表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2024-04-17 |
| | | */ |
| | | public interface PcdnDeviceMapper extends BaseMapper<PcdnDevice> { |
| | | |
| | | IPage<PCDNDevicePageVO> deviceList(@Param("page") PageParam<PcdnDevice> page, @Param("name") String name, @Param("deviceSn") String deviceSn, @Param("deviceStatus") DeviceStatus deviceStatus); |
| | | |
| | | /** |
| | | * 返回设备列表 |
| | | * |
| | | * @param userId |
| | | * @param page |
| | | * @param deviceStatus |
| | | * @return |
| | | */ |
| | | Page<DeviceVO> pageDevice(@Param("userId") String userId, @Param("page") PageParam page, @Param("deviceStatus") DeviceStatus deviceStatus); |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.PcdnDeviceReleaseLog; |
| | | |
| | | public interface PcdnDeviceReleaseLogMapper extends BaseMapper<PcdnDeviceReleaseLog> { |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.PcdnDeviceTransferLog; |
| | | |
| | | public interface PcdnDeviceTransferLogMapper extends BaseMapper<PcdnDeviceTransferLog> { |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.PcdnEarnLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户设备收益流量记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2024-04-17 |
| | | */ |
| | | public interface PcdnEarnLogMapper extends BaseMapper<PcdnEarnLog> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.app.dto.ProductDto; |
| | | import com.yami.shop.bean.model.ProdBrowseLog; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 商品浏览记录表 |
| | | * |
| | | * @author LGH |
| | | * @date 2021-11-01 10:43:09 |
| | | */ |
| | | public interface ProdBrowseLogMapper extends BaseMapper<ProdBrowseLog> { |
| | | |
| | | /** |
| | | * 分页获取商品浏览记录 |
| | | * @param page |
| | | * @param userId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | IPage<ProdBrowseLog> pageByUserId(@Param("page") PageParam<ProductDto> page, @Param("userId") String userId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取推荐的分类id |
| | | * |
| | | * @param prodType 商品类型 |
| | | * @param userId 用户id |
| | | * @param limit 指定数量 |
| | | * @return 分类id |
| | | */ |
| | | Long recommendCategoryId(@Param("prodType") Integer prodType, @Param("userId") String userId, @Param("limit") int limit); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.app.dto.ProdCommDataDto; |
| | | import com.yami.shop.bean.app.dto.ProdCommDto; |
| | | import com.yami.shop.bean.model.ProdComm; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface ProdCommMapper extends BaseMapper<ProdComm> { |
| | | /** |
| | | * 商品评论好评率,评分数量等信息 |
| | | * |
| | | * @param prodId 商品id |
| | | * @return 商品评论好评率,评分数量等信息 |
| | | */ |
| | | ProdCommDataDto getProdCommDataByProdId(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 获取商品的各个用户评论列表 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param prodId 商品id |
| | | * @param evaluate 评分 |
| | | * @param lang |
| | | * @return 商品评论列表 |
| | | */ |
| | | IPage<ProdCommDto> getProdCommDtoPageByProdId(@Param("page") Page page, @Param("prodId") Long prodId, @Param("evaluate") Integer evaluate, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取用户的各个商品评论列表 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param userId 用户id |
| | | * @return 商品评论列表 |
| | | */ |
| | | IPage<ProdCommDto> getProdCommDtoPageByUserId(Page page, @Param("userId") String userId); |
| | | |
| | | /** |
| | | * 获取店铺中的商品评论信息 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param prodComm 查询参数 |
| | | * @param shopId 店铺id |
| | | * @param dbLang 语言 |
| | | * @return 评论信息 |
| | | */ |
| | | IPage<ProdComm> getProdCommPage(Page page, @Param("prodComm") ProdComm prodComm, @Param("shopId") Long shopId, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 获取商品的评论数量 |
| | | * |
| | | * @param prodIds |
| | | * @return |
| | | */ |
| | | List<ProdComm> countProdCommNum(@Param("prodIds") List<Long> prodIds); |
| | | |
| | | /** |
| | | * 根据商品id列表删除评论信息 |
| | | * |
| | | * @param prodIds |
| | | */ |
| | | void deleteByProdIds(@Param("prodIds") Set<Long> prodIds); |
| | | |
| | | |
| | | /** |
| | | * 获取时间范围内的评论数排序的商品ids |
| | | * @param shopId 店铺id |
| | | * @param time 时间范围内 |
| | | * @param esRenovationSpuSort |
| | | * @return |
| | | */ |
| | | List<Long> getCommNumRankSpuIdsByShopIdAndTime(@Param("shopId") Long shopId, @Param("time") Date time, @Param("esRenovationSpuSort") Integer esRenovationSpuSort); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.OrderItem; |
| | | import com.yami.shop.bean.model.ProdExtension; |
| | | import com.yami.shop.bean.model.SkuStockLock; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author LGH |
| | | * @date 2022-05-05 10:47:48 |
| | | */ |
| | | public interface ProdExtensionMapper extends BaseMapper<ProdExtension> { |
| | | |
| | | /** |
| | | * 改变商品库存 |
| | | * |
| | | * @param prodId |
| | | */ |
| | | int updateProdStocks(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 更新注水销量 |
| | | * |
| | | * @param waterSaleNum |
| | | * @param prodId |
| | | * @return |
| | | */ |
| | | int updateWaterSoldNum(@Param("waterSoldNum") Integer waterSaleNum, @Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 通过订单项更新商品的销量 |
| | | * |
| | | * @param orderItems 订单项 |
| | | */ |
| | | void updateSoldNum(@Param("orderItems") List<OrderItem> orderItems); |
| | | |
| | | /** |
| | | * 回退库存 |
| | | * |
| | | * @param prodCollect 回退数据map |
| | | */ |
| | | void returnStock(@Param("prodCollect") Map<Long, Integer> prodCollect); |
| | | |
| | | /** |
| | | * 还原退款数量库存 |
| | | * |
| | | * @param prodId 商品id |
| | | * @param count 退款数量 |
| | | */ |
| | | void addInventory(@Param("prodId") Long prodId, @Param("count") Integer count); |
| | | |
| | | /** |
| | | * 通过订单减少库存 |
| | | * |
| | | * @param prodId 商品id |
| | | * @param count 数量 |
| | | * @return |
| | | */ |
| | | int reduceStockByOrder(@Param("prodId") Long prodId, @Param("count") Integer count); |
| | | |
| | | /** |
| | | * 通过订单添加库存 |
| | | * |
| | | * @param allSkuWithStocks 库存信息 |
| | | */ |
| | | void addStockByOrder(@Param("skuWithStocks") List<SkuStockLock> allSkuWithStocks); |
| | | |
| | | |
| | | /** |
| | | * 通过订单减少实际库存 |
| | | * |
| | | * @param skuWithStocks 库存信息 |
| | | */ |
| | | void reduceActualStockByOrder(@Param("skuWithStocks") List<SkuStockLock> skuWithStocks); |
| | | |
| | | /** |
| | | * 通过已经取消的订单减少实际库存 |
| | | * |
| | | * @param skuWithStocks 库存信息 |
| | | */ |
| | | void reduceActualStockByCancelOrder(@Param("skuWithStocks") List<SkuStockLock> skuWithStocks); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ProdImg; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface ProdImgMapper extends BaseMapper<ProdImg> { |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ProdLang; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lhd |
| | | * @date 2020-08-26 15:39:09 |
| | | */ |
| | | public interface ProdLangMapper extends BaseMapper<ProdLang> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ProdParameterLang; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 商品参数语言mapper |
| | | * @author Citrus |
| | | * @date 2021-11-02 11:26:08 |
| | | */ |
| | | public interface ProdParameterLangMapper extends BaseMapper<ProdParameterLang> { |
| | | /** |
| | | * 批量保存商品参数信息 |
| | | * @param prodParameterLangList |
| | | */ |
| | | void insertBatch(@Param("prodParameterLangList") List<ProdParameterLang> prodParameterLangList); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | */ |
| | | void deleteBatch(@Param("ids") List<Long> ids); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ProdParameter; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 商品参数mapper |
| | | * @author Citrus |
| | | * @date 2021-11-01 16:50:52 |
| | | */ |
| | | public interface ProdParameterMapper extends BaseMapper<ProdParameter> { |
| | | /** |
| | | * 根据商品id删除商品参数 |
| | | * @param prodId |
| | | */ |
| | | void removeByProdId(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 根据商品id查询商品参数 |
| | | * @param prodId |
| | | * @return |
| | | */ |
| | | List<ProdParameter> listProdParameterByProdId(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 根据语言查询商品参数 |
| | | * @param prodId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<ProdParameter> listProdParameter(@Param("prodId") Long prodId,@Param("lang") Integer lang); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ProdPropLang; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | * @date 2021-02-24 17:02:07 |
| | | */ |
| | | public interface ProdPropLangMapper extends BaseMapper<ProdPropLang> { |
| | | |
| | | /** |
| | | * 批量插入规格语言信息 |
| | | * @param prodPropLangList 规格语言信息 |
| | | */ |
| | | void insertBatch(@Param("prodPropLangList") List<ProdPropLang> prodPropLangList); |
| | | |
| | | /** |
| | | * 更新规格语言信息 |
| | | * @param prodPropLang 规格语言信息 |
| | | */ |
| | | void updateByPropIdAndLang(@Param("prodPropLang") ProdPropLang prodPropLang); |
| | | |
| | | /** |
| | | * 删除商品规格语言表 |
| | | * @param propId 规格id |
| | | */ |
| | | void deleteByPropId(@Param("propId") Long propId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ProdProp; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface ProdPropMapper extends BaseMapper<ProdProp> { |
| | | |
| | | /** |
| | | * 分页获取商品属性与属性值列表 |
| | | * @param adapter 分页参数 |
| | | * @param prodProp 查询参数 |
| | | * @return 商品属性与属性值列表 |
| | | */ |
| | | List<ProdProp> listPropAndValue(@Param("adapter") PageAdapter adapter, @Param("prodProp") ProdProp prodProp); |
| | | |
| | | /** |
| | | * 获取商品属性与属性值列表数量 |
| | | * @param prodProp 查询参数 |
| | | * @return 商品属性与属性值列表数量 |
| | | */ |
| | | long countPropAndValue(@Param("prodProp") ProdProp prodProp); |
| | | |
| | | /** |
| | | * 根据商品id删除规格 |
| | | * @param propId 规格id |
| | | * @param rule 规则 |
| | | * @param shopId 店铺id |
| | | * @return 是否删除成功 |
| | | */ |
| | | int deleteByPropId(@Param("propId") Long propId, @Param("rule") Integer rule, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据分类获取分类下的规格 |
| | | * @param categoryId 分类id |
| | | * @return 规格列表 |
| | | */ |
| | | List<ProdProp> listByCategoryId(Long categoryId); |
| | | |
| | | /** |
| | | * 获取规格参数 |
| | | * @param propName 规格名称 |
| | | * @param propNameEn 规格英文名称 |
| | | * @param shopId 店铺id |
| | | * @param rule 规则 |
| | | * @return 规格参数列表 |
| | | */ |
| | | List<ProdProp> getProdPropByPropNameAndShopId(@Param("propName") String propName, |
| | | @Param("propNameEn") String propNameEn, |
| | | @Param("shopId") Long shopId, |
| | | @Param("rule") Integer rule); |
| | | |
| | | /** |
| | | * 根据不同的语言获取不同的规格显示数据 |
| | | * @param prodProp 规格查询参数 |
| | | * @return 规格参数列表 |
| | | */ |
| | | List<ProdProp> listByLang(@Param("prodProp") ProdProp prodProp); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ProdPropValueLang; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | * @date 2021-02-24 17:02:07 |
| | | */ |
| | | public interface ProdPropValueLangMapper extends BaseMapper<ProdPropValueLang> { |
| | | |
| | | /** |
| | | * 批量插入属性属性值和语言数据 |
| | | * @param prodPropValueLangList 属性属性值和语言数据 |
| | | */ |
| | | void insetBatch(@Param("prodPropValueLangList") List<ProdPropValueLang> prodPropValueLangList); |
| | | |
| | | /** |
| | | * 根据属性id删除属性属性值信息 |
| | | * @param propId 属性id |
| | | */ |
| | | void deleteByPropId(@Param("propId") Long propId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ProdPropValue; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface ProdPropValueMapper extends BaseMapper<ProdPropValue> { |
| | | |
| | | /** |
| | | * 批量插入属性属性值数据 |
| | | * @param propId 属性id |
| | | * @param prodPropValues 属性值 |
| | | */ |
| | | void insertPropValues(@Param("propId") Long propId, @Param("prodPropValues") List<ProdPropValue> prodPropValues); |
| | | |
| | | /** |
| | | * 根据属性id删除属性属性值信息 |
| | | * @param propId 属性id |
| | | */ |
| | | void deleteByPropId(@Param("propId") Long propId); |
| | | |
| | | /** |
| | | * 根据属性id获取属性值 |
| | | * @param propId 属性id |
| | | * @return 属性值列表 |
| | | */ |
| | | List<ProdPropValue> propValueListByPropId(@Param("propId") Long propId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ProdTag; |
| | | |
| | | /** |
| | | * 商品分组 |
| | | * |
| | | * @author hzm |
| | | * @date 2019-04-18 09:08:36 |
| | | */ |
| | | public interface ProdTagMapper extends BaseMapper<ProdTag> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ProdTagReference; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 分组标签引用 |
| | | * |
| | | * @author hzm |
| | | * @date 2019-04-18 16:28:01 |
| | | */ |
| | | public interface ProdTagReferenceMapper extends BaseMapper<ProdTagReference> { |
| | | /** |
| | | * 批量插入商品分组信息 |
| | | * @param shopId 店铺id |
| | | * @param prodId 属性id |
| | | * @param tagList 分组表情列表 |
| | | */ |
| | | void insertBatch(@Param("shopId") Long shopId, @Param("prodId") Long prodId, @Param("tagList") List<Long> tagList); |
| | | |
| | | /** |
| | | * 获取商品分组信息 |
| | | * @param prodId 商品id |
| | | * @return 分组列表 |
| | | */ |
| | | List<Long> listTagIdByProdId(@Param("prodId") Long prodId); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.app.dto.ProductDto; |
| | | import com.yami.shop.bean.bo.ProductBO; |
| | | import com.yami.shop.bean.dto.ProdAndSkuListsDto; |
| | | import com.yami.shop.bean.model.Product; |
| | | import com.yami.shop.bean.param.*; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface ProductMapper extends BaseMapper<Product> { |
| | | |
| | | /** |
| | | * 查看店铺的所有活动商品 |
| | | * |
| | | * @param page 分页数据 |
| | | * @param shopId 店铺id |
| | | * @param dbLang 语言 |
| | | * @return 店铺的所有活动商品 |
| | | */ |
| | | IPage<ProductDto> listByShopId(@Param("page") PageParam<ProductDto> page, @Param("shopId") Long shopId, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 通过优惠券适用商品类型、优惠券id、店铺id获取商品列表 |
| | | * |
| | | * @param page 分页数据 |
| | | * @param shopId 店铺id |
| | | * @param dbLang 语言 |
| | | * @param suitableProdType 适用商品类型 |
| | | * @param couponId 优惠券id |
| | | * @return 商品列表 |
| | | */ |
| | | IPage<ProductDto> listBySuitableProdTypeAndCouponIdAndShopId(@Param("page") PageParam<ProductDto> page, @Param("shopId") Long shopId, @Param("suitableProdType") Integer suitableProdType, |
| | | @Param("couponId") Long couponId, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 获取用户的收藏商品列表 |
| | | * |
| | | * @param page 分页数据 |
| | | * @param userId 用户id |
| | | * @param dbLang 语言 |
| | | * @return 用户的收藏商品列表 |
| | | */ |
| | | IPage<ProductDto> collectionProds(@Param("page") PageParam page, @Param("userId") String userId, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 通过商品ids列表获取商品列表及商品所有属性 |
| | | * |
| | | * @param prodIds 商品ids |
| | | * @return 商品列表 |
| | | */ |
| | | List<ProdAndSkuListsDto> getProdAndSkuLists(@Param("prodIds") List<Long> prodIds); |
| | | |
| | | /** |
| | | * 更新商品为活动商品 |
| | | * |
| | | * @param groupActivityId 拼团活动id |
| | | * @param prodId 商品id |
| | | */ |
| | | int updateProductToGroup(@Param("groupActivityId") Long groupActivityId, @Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 更新商品为待审核状态 |
| | | * |
| | | * @param prodId 商品id |
| | | * @return 更新结果 |
| | | */ |
| | | int updateToApply(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 更新商品为商家下架状态 |
| | | * |
| | | * @param prodId 商品id |
| | | * @return 更新结果 |
| | | */ |
| | | int updateToShopOffline(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 更新商品为下架状态 |
| | | * |
| | | * @param prodId 商品id |
| | | * @return 更新结果 |
| | | */ |
| | | int updateToOffline(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 下架店铺所有的商品 |
| | | * |
| | | * @param shopIds 店铺id列表 |
| | | * @return 结果 |
| | | */ |
| | | int offlineProdByShopIds(@Param("shopIds") List<Long> shopIds); |
| | | |
| | | /** |
| | | * 获取商品列表通过订单编号 |
| | | * |
| | | * @param orderNumber 订单编号 |
| | | * @return 商品列表 |
| | | */ |
| | | List<ProdOrderParam> getProdsByOrderNumber(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 获取用于导出的商品列表 |
| | | * |
| | | * @param prodIds 商品id列表 |
| | | * @return 商品列表 |
| | | */ |
| | | List<ProductExportParam> listProdsByProdParam(@Param("prodIds") List<Long> prodIds); |
| | | |
| | | /** |
| | | * 通过分类ids改变商品为下架状态 |
| | | * |
| | | * @param categoryIds 分类ids |
| | | * @param shopId 店铺id |
| | | */ |
| | | void offlineProdByCategoryId(@Param("categoryIds") List<Long> categoryIds, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 分页获取上架的商品信息 |
| | | * |
| | | * @param page 分页信息 |
| | | * @param product 商品筛选信息 |
| | | * @return |
| | | */ |
| | | IPage<Product> pageProducts(PageParam<Product> page, @Param("product") ProductParam product); |
| | | |
| | | /** |
| | | * 在架商品数据 |
| | | * |
| | | * @param param 筛选参数 |
| | | * @return 在架商品数据 |
| | | */ |
| | | Long countProdOnSale(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 统计时间内销量不为零的商品数量 |
| | | * |
| | | * @param param 筛选参数 |
| | | * @return 商品数量 |
| | | */ |
| | | Long countProdDynamicSale(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 在架商品数据,根据参数分页获取商品数据 |
| | | * |
| | | * @param page 分页数据 |
| | | * @param param 筛选参数 |
| | | * @param prodIds 商品id列表 |
| | | * @return 商品数据 |
| | | */ |
| | | IPage<ProdEffectRespParam> pageProdByParam(PageParam<Product> page, @Param("param") ProdEffectParam param, @Param("prodIds") Set<Long> prodIds, @Param("lang") Integer lang); |
| | | |
| | | |
| | | /** |
| | | * 在架商品数据,根据参数获取商品列表数据 |
| | | * |
| | | * @param param 筛选参数 |
| | | * @param prodIds 商品id列表 |
| | | * @return 商品数据 |
| | | */ |
| | | List<ProdEffectRespParam> listProdByParam(@Param("param") ProdEffectParam param, @Param("prodIds") Set<Long> prodIds, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 支付商品件数 |
| | | * |
| | | * @param prodId 商品id |
| | | * @param param 参数 |
| | | * @return 支付商品件数 |
| | | */ |
| | | Long countPayNum(@Param("prodId") Long prodId, @Param("param") ProdEffectParam param); |
| | | |
| | | /** |
| | | * 筛选获取商品分页列表 |
| | | * |
| | | * @param page 分页数据 |
| | | * @param product 商品筛选信息 |
| | | * @return 商品分页列表 |
| | | */ |
| | | IPage<Product> pageByLang(PageParam<Product> page, @Param("product") ProductParam product); |
| | | |
| | | /** |
| | | * 通过商品id和语言获取商品信息 |
| | | * |
| | | * @param prodId 商品id |
| | | * @param dbLang 语言 |
| | | * @return 商品信息 |
| | | */ |
| | | Product selectByIdAndLang(@Param("prodId") Long prodId, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 恢复普通商品 |
| | | * |
| | | * @param products 商品信息 |
| | | */ |
| | | void updatePreSale(@Param("products") List<Product> products); |
| | | |
| | | // IPage<ProductTagParam> pageByLangAndTag(PageParam<Product> page, @Param("productTagParam") ProductTagParam productTagParam, @Param("isContain") Integer isContain); |
| | | |
| | | /** |
| | | * 分页获取商品信息 |
| | | * |
| | | * @param product 商品筛选信息 |
| | | * @return 分页获取商品信息 |
| | | */ |
| | | List<Product> listProdByIdsAndType(@Param("product") ProductParam product); |
| | | |
| | | /** |
| | | * 通过商品ids获取商品列表 |
| | | * |
| | | * @param prodIds 商品ids |
| | | * @return 商品列表 |
| | | */ |
| | | List<Product> getProductListBySpuIds(@Param("prodIds") Set<Long> prodIds); |
| | | |
| | | /** |
| | | * 分页获取可以添加到分销商品的数据 |
| | | * |
| | | * @param page 分页信息 |
| | | * @param product 商品筛选信息 |
| | | * @return |
| | | */ |
| | | IPage<Product> canDistributionProdPage(PageParam<Product> page, @Param("product") ProductParam product); |
| | | |
| | | /** |
| | | * 获取商品信息 |
| | | * |
| | | * @param prodIds |
| | | * @return |
| | | */ |
| | | List<ProductBO> getProductBO(@Param("prodIds") List<Long> prodIds); |
| | | |
| | | /** |
| | | * 获取商品id列表 |
| | | * |
| | | * @param categoryId |
| | | * @param shopCategoryId |
| | | * @param shopId |
| | | * @return 商品id列表 |
| | | */ |
| | | List<Long> listProdId(@Param("categoryId") Long categoryId, @Param("shopCategoryId") Long shopCategoryId, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据品牌id,获取商品id列表 |
| | | * |
| | | * @param brandId 品牌id |
| | | * @return 商品id列表 |
| | | */ |
| | | List<Long> listIdByBrandId(@Param("brandId") Long brandId); |
| | | |
| | | /** |
| | | * 批量改变商品状态(上下架) |
| | | * |
| | | * @param cids |
| | | * @param status |
| | | * @param shopId |
| | | */ |
| | | void offlineProdByCategoryIdAndShopId(@Param("cids") List<Long> cids, @Param("status") Integer status, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据店铺id列表获取商品id列表 |
| | | * |
| | | * @param shopIds |
| | | * @return |
| | | */ |
| | | List<Long> listIdByShopIds(@Param("shopIds") List<Long> shopIds); |
| | | |
| | | /** |
| | | * 根据商品id列表修改商品状态 |
| | | * |
| | | * @param pIds |
| | | * @param status |
| | | */ |
| | | void changeStatusByProdIds(@Param("pIds") List<Long> pIds, @Param("status") Integer status); |
| | | |
| | | /** |
| | | * 获取商品及商品sku信息列表 |
| | | * |
| | | * @param pageAdapter |
| | | * @param product |
| | | * @return |
| | | */ |
| | | List<Product> prodSkuPage(@Param("page") PageAdapter pageAdapter, @Param("product") ProductParam product); |
| | | |
| | | /** |
| | | * 统计商品数量 |
| | | * |
| | | * @param pageAdapter |
| | | * @param product |
| | | * @return |
| | | */ |
| | | long countProdSkuList(@Param("page") PageAdapter pageAdapter, @Param("product") ProductParam product); |
| | | |
| | | /** |
| | | * 根据商品、sku Id, 获取商品信息 |
| | | * |
| | | * @param prodIds |
| | | * @param skuIds |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Product> prodAndSkuInfo(@Param("prodIds") List<Long> prodIds, @Param("skuIds") List<Long> skuIds, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取商品及sku |
| | | * |
| | | * @param prodIds |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Product> listProdAndSku(@Param("prodIds") List<Long> prodIds, @Param("lang") Integer lang); |
| | | |
| | | |
| | | /** |
| | | * 检验商品是否已删除 |
| | | * |
| | | * @param prodIds |
| | | * @return 返回未删除的商品id |
| | | */ |
| | | List<Long> verifySpuHasDelete(@Param("prodIds") List<Long> prodIds); |
| | | |
| | | /** |
| | | * 检验商品是否存在 |
| | | * |
| | | * @param prodIds |
| | | * @return 返回未删除的商品id |
| | | */ |
| | | List<Long> verifySpuExist(@Param("prodIds") List<Long> prodIds); |
| | | |
| | | /** |
| | | * 批量更新商品类型 |
| | | * |
| | | * @param prodIds |
| | | * @param prodType |
| | | */ |
| | | void bathUpdateProductType(@Param("prodIds") List<Long> prodIds, @Param("prodType") Integer prodType); |
| | | |
| | | /** |
| | | * 获取时间范围内的新增商品数量列表 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | List<ProdAnalysisDataParam> listNewProdByTime(@Param("param") ProdAnalysisSurveyParam param); |
| | | |
| | | |
| | | /** |
| | | * 在架商品数据 |
| | | * @param param |
| | | * @param prodIds |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<ProdEffectRespParam> getProdEffectByParam( @Param("param")ProdEffectParam param, @Param("prodIds") Set<Long> prodIds, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据商品id列表获取商品的配送模板id |
| | | * @param prodIds |
| | | * @return |
| | | */ |
| | | List<Product> getProdDeliveryTemplateIdByProdIds(@Param("prodIds") List<Long> prodIds); |
| | | |
| | | /** |
| | | * 根据店铺id 商品状态 获取商品数量 |
| | | * @param shopId |
| | | * @param status |
| | | * @return |
| | | */ |
| | | int getProductNum(@Param("shopId") Long shopId, @Param("status") Integer status); |
| | | |
| | | /** |
| | | * 获取es商品销量和库存数据 |
| | | * |
| | | * @param prodIds |
| | | * @return |
| | | */ |
| | | List<ProductBO> listEsProdSoldAndStock(@Param("prodIds") List<Long> prodIds); |
| | | |
| | | /** |
| | | * 获取es商品评论数据 |
| | | * @param prodIds |
| | | * @return |
| | | */ |
| | | List<ProductBO> listEsProdComm(List<Long> prodIds); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.PurchaseOrder; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author YXF |
| | | * @date 2021-09-08 10:42:01 |
| | | */ |
| | | public interface PurchaseOrderMapper extends BaseMapper<PurchaseOrder> { |
| | | |
| | | /** |
| | | * 分页 |
| | | * |
| | | * @param page |
| | | * @param purchaseOrder |
| | | * @return |
| | | */ |
| | | IPage<PurchaseOrder> pagePurchaseOrder(PageParam<PurchaseOrder> page, @Param("purchaseOrder") PurchaseOrder purchaseOrder); |
| | | |
| | | /** |
| | | * 采购订单信息 |
| | | * |
| | | * @param purchaseOrderId |
| | | * @return |
| | | */ |
| | | PurchaseOrder info(@Param("purchaseOrderId") Long purchaseOrderId); |
| | | |
| | | /** |
| | | * 获取指定的采购订单信息列表 |
| | | * |
| | | * @param purchaseOrderNumbers |
| | | * @return |
| | | */ |
| | | List<PurchaseOrder> listInfoByPurchaseOrderNumbers(@Param("purchaseOrderNumbers") List<String> purchaseOrderNumbers); |
| | | |
| | | /** |
| | | * 批量更新状态 |
| | | * |
| | | * @param purchaseOrderList |
| | | */ |
| | | void updateBatchStatus(@Param("purchaseOrderList") List<PurchaseOrder> purchaseOrderList); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.PurchaseProd; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author YXF |
| | | * @date 2021-09-08 10:42:00 |
| | | */ |
| | | public interface PurchaseProdMapper extends BaseMapper<PurchaseProd> { |
| | | /** |
| | | * 根据供应商商品id,获取供应商商品列表 |
| | | * |
| | | * @param partyCodes |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<PurchaseProd> listProdByPurchasePartyCodes(@Param("partyCodes") List<String> partyCodes, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据商品id获取采购编号 |
| | | * @param prodId |
| | | * @param skuIds |
| | | * @return |
| | | */ |
| | | List<String> listPurchaseNumberByProdId(@Param("prodId") Long prodId, @Param("skuIds") List<Long> skuIds); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.QrcodeTicket; |
| | | |
| | | /** |
| | | * 二维码数据信息 |
| | | * |
| | | * @author LGH |
| | | * @date 2020-03-12 16:49:20 |
| | | */ |
| | | public interface QrcodeTicketMapper extends BaseMapper<QrcodeTicket> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.RefundAddr; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface RefundAddrMapper extends BaseMapper<RefundAddr> { |
| | | |
| | | /** |
| | | * 取消设为默认退款地址 |
| | | * @param shopId 店铺id |
| | | */ |
| | | void cancelDefaultAddr(Long shopId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.RefundDelivery; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface RefundDeliveryMapper extends BaseMapper<RefundDelivery> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.RefundInfo; |
| | | import com.yami.shop.bean.vo.AccountDetailVO; |
| | | import com.yami.shop.bean.vo.ShopAccountDetailVO; |
| | | import com.yami.shop.bean.vo.ShopAccountVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author Citrus |
| | | * @date 2022-05-25 15:45:45 |
| | | */ |
| | | public interface RefundInfoMapper extends BaseMapper<RefundInfo> { |
| | | |
| | | /** |
| | | * 获取商家的退款账户详情 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param shopName 店铺名称 |
| | | * @return 收入账户详情 |
| | | */ |
| | | AccountDetailVO getRefundAccountDetail(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("shopName")String shopName); |
| | | |
| | | /** |
| | | * 根据时间参数获取店铺退款账户详情 |
| | | * @param page |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param shopName 店铺名称 |
| | | * @return 收入账户详情 |
| | | */ |
| | | IPage<ShopAccountVO> pageAllRefundAccount(PageParam<ShopAccountVO> page, @Param("startTime") Date startTime, |
| | | @Param("endTime") Date endTime, @Param("shopName")String shopName); |
| | | |
| | | /** |
| | | * 根据店铺id和时间参数获取店铺退款账户详情 |
| | | * @param page |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param shopId 店铺id |
| | | * @return 退款账户详情 |
| | | */ |
| | | IPage<ShopAccountDetailVO> pageShopRefundAccountDetail(PageParam<ShopAccountDetailVO> page, @Param("startTime") Date startTime, |
| | | @Param("endTime") Date endTime, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据时间参数获取平台退款账户详情 |
| | | * @param page |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 退款账户详情 |
| | | */ |
| | | IPage<ShopAccountDetailVO> pagePlatformRefundAccountDetail(PageParam<ShopAccountDetailVO> page, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 根据时间参数店铺id获取所有退款账户详情列表,excel |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param shopName |
| | | * @return |
| | | */ |
| | | List<ShopAccountDetailVO> listRefundAccountDetail(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("shopName") String shopName); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.RefundOrderSettlement; |
| | | |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface RefundOrderSettlementMapper extends BaseMapper<RefundOrderSettlement> { |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.dto.FinanceDetailsDto; |
| | | import com.yami.shop.bean.dto.RevenueOverviewDto; |
| | | import com.yami.shop.bean.model.OrderItem; |
| | | import com.yami.shop.bean.param.FinanceDetailsParam; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 财务管理—营收概况 |
| | | * |
| | | * @author SJL |
| | | * @date 2020-08-17 |
| | | */ |
| | | public interface RevenueOverviewMapper extends BaseMapper<OrderItem> { |
| | | |
| | | |
| | | /** |
| | | * 获取指定商家id和日期的收入金额和退款金额 |
| | | * @param stationId 自提id |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 指定商家id和日期的收入金额和退款金额 |
| | | */ |
| | | RevenueOverviewDto getData(@Param("stationId") Integer stationId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | |
| | | /** |
| | | * 条件参数,分页获取财务明细 |
| | | * @param page 分页参数 |
| | | * @param param 条件查询参数 |
| | | * @return 财务明细 |
| | | */ |
| | | IPage<FinanceDetailsDto> getPageDetail(PageParam<FinanceDetailsDto> page, @Param("financeDetailsParam") FinanceDetailsParam param); |
| | | |
| | | /** |
| | | * 条件参数查询,获取财务明细列表 |
| | | * @param param 条件查询参数 |
| | | * @return 财务明细列表 |
| | | */ |
| | | List<FinanceDetailsDto> getFinanceDetailForm(@Param("financeDetailsParam") FinanceDetailsParam param); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.dto.ShopAuditingInfoDto; |
| | | import com.yami.shop.bean.model.ShopAuditing; |
| | | import com.yami.shop.bean.param.AuditingInfoParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | |
| | | /** |
| | | * 商家审核信息 |
| | | * |
| | | * @author Dwl |
| | | * @date 2019-09-19 14:02:57 |
| | | */ |
| | | public interface ShopAuditingMapper extends BaseMapper<ShopAuditing> { |
| | | |
| | | /** |
| | | * 根据申请人id查询审核信息 |
| | | * @param userId 用户id |
| | | * @return 审核信息 |
| | | */ |
| | | ShopAuditing getShopAuditingByUserId(String userId); |
| | | |
| | | |
| | | /** |
| | | * 店铺审核信息列表 |
| | | * @param page 分页参数 |
| | | * @param auditingInfoParam 审核信息参数 |
| | | * @return 店铺审核信息列表 |
| | | */ |
| | | IPage<ShopAuditingInfoDto> auditingInfoList(@Param("page")Page<ShopAuditingInfoDto> page, @Param("map") AuditingInfoParam auditingInfoParam ); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ShopBankCard; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 商家钱包信息 |
| | | * |
| | | * @author YXF |
| | | * * @date 2020-04-07 14:22:08 |
| | | */ |
| | | public interface ShopBankCardMapper extends BaseMapper<ShopBankCard> { |
| | | |
| | | /** |
| | | * 批量保存店铺银行卡信息 |
| | | * @param shopBankCards |
| | | * @param shopId |
| | | */ |
| | | void insertBatch(@Param("shopBankCards") List<ShopBankCard> shopBankCards, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 设置银行卡为主账号 |
| | | * @param shopBankCardId |
| | | * @param shopId |
| | | */ |
| | | void setDefault(@Param("shopBankCardId") Long shopBankCardId, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 取消默认账号 |
| | | * @param shopBankCardId |
| | | * @param shopId |
| | | */ |
| | | void setNotDefault(@Param("shopBankCardId") Long shopBankCardId, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 添加银行卡 |
| | | * @param shopBankCard |
| | | * @return |
| | | */ |
| | | void insertSelective(@Param("shopBankCard") ShopBankCard shopBankCard); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ShopCompany; |
| | | |
| | | /** |
| | | * @Author lth |
| | | * @Date 2021/8/3 15:05 |
| | | */ |
| | | public interface ShopCompanyMapper extends BaseMapper<ShopCompany> { |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.dto.ShopCustomerDTO; |
| | | import com.yami.shop.bean.model.ShopCustomer; |
| | | import com.yami.shop.bean.vo.ShopCustomerVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author LGH |
| | | * @date 2023-01-12 10:37:54 |
| | | */ |
| | | public interface ShopCustomerMapper extends BaseMapper<ShopCustomer> { |
| | | |
| | | IPage<ShopCustomerVO> pageShopCustomerByParam(PageParam<ShopCustomerVO> page, @Param("shopCustomer") ShopCustomerDTO shopCustomer); |
| | | |
| | | List<ShopCustomerVO> listByParam(@Param("shopCustomer")ShopCustomerDTO shopCustomer); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.app.dto.ShopHeadInfoDto; |
| | | import com.yami.shop.bean.model.ShopDetail; |
| | | import com.yami.shop.bean.param.AuditingInfoParam; |
| | | import com.yami.shop.bean.param.ShopExportParam; |
| | | import com.yami.shop.bean.param.ShopSearchParam; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author LGH |
| | | */ |
| | | public interface ShopDetailMapper extends BaseMapper<ShopDetail> { |
| | | |
| | | /** |
| | | * 根据店铺的手机号(登陆账号),获取店铺信息 |
| | | * |
| | | * @param mobile 手机号 |
| | | * @return 店铺信息 |
| | | */ |
| | | ShopDetail getShopByMobile(@Param("mobile") String mobile); |
| | | |
| | | /** |
| | | * 修改用户密码 |
| | | * |
| | | * @param username 用户名称/账号 |
| | | * @param newPassword 新密码 |
| | | */ |
| | | void updatePasswordByUserName(@Param("username") String username, @Param("newPassword") String newPassword); |
| | | |
| | | /** |
| | | * 获取用户店铺信息 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 店铺信息 |
| | | */ |
| | | ShopDetail getShopDetailByUserId(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 修改店铺状态 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param status 状态 |
| | | */ |
| | | void updateStatus(@Param("shopId") Long shopId, @Param("status") Integer status); |
| | | |
| | | /** |
| | | * 热搜店铺信息列表 |
| | | * |
| | | * @return 热搜店铺信息列表 |
| | | */ |
| | | List<ShopHeadInfoDto> listHotShopsHead(); |
| | | |
| | | /** |
| | | * 通过经纬度获取距离 |
| | | * |
| | | * @param lat 纬度 |
| | | * @param lng 经度 |
| | | * @param shopId 店铺id |
| | | * @return 距离 |
| | | */ |
| | | double getDistance(@Param("lat") Double lat, @Param("lng") Double lng, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 条件查询,分页获取店铺头部信息 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param shopHeadInfoDto 条件参数 |
| | | * @return 分页店铺头部信息 |
| | | */ |
| | | Page<ShopHeadInfoDto> searchShops(@Param("page") PageParam<ShopHeadInfoDto> page, @Param("shopHeadInfoDto") ShopHeadInfoDto shopHeadInfoDto); |
| | | |
| | | /** |
| | | * 获取店铺详情 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @return 店铺信息 |
| | | */ |
| | | ShopDetail selectShopDetailById(@Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据店铺id更新密码和手机号 |
| | | * |
| | | * @param shopDetail 店铺信息 |
| | | */ |
| | | void updatePassWordAndMobile(@Param("shopDetail") ShopDetail shopDetail); |
| | | |
| | | /** |
| | | * 批量修改店铺类型 |
| | | * |
| | | * @param shopIds 店铺id |
| | | * @param type 店铺类型 |
| | | * @return 修改行数 |
| | | */ |
| | | int batchUpdateShopType(@Param("shopIds") List<Long> shopIds, @Param("type") Integer type); |
| | | |
| | | /** |
| | | * 根据当前时间获取状态需要改变为停业状态的店铺id列表 |
| | | * |
| | | * @param now |
| | | * @return |
| | | */ |
| | | List<Long> listShopIdsOfStatusChangeToStopByContractTime(@Param("now") Date now); |
| | | |
| | | /** |
| | | * 根据当前时间获取状态需要改变为营业状态的店铺id列表 |
| | | * |
| | | * @param now |
| | | * @return |
| | | */ |
| | | List<Long> listShopIdsOfStatusChangeToOpenByContractTime(@Param("now") Date now); |
| | | |
| | | /** |
| | | * 批量改变店铺状态 |
| | | * |
| | | * @param shopIds |
| | | * @param oldStatus |
| | | * @param newStatus |
| | | */ |
| | | void batchUpdateShopStatusByShopIds(@Param("shopIds") List<Long> shopIds, @Param("oldStatus") Integer oldStatus, @Param("newStatus") Integer newStatus); |
| | | |
| | | /** |
| | | * 根据搜索参数获取导出的店铺列表 |
| | | * |
| | | * @param auditingInfoParam |
| | | * @return |
| | | */ |
| | | List<ShopExportParam> listExportByShopParam(@Param("auditingInfoParam") AuditingInfoParam auditingInfoParam); |
| | | |
| | | /** |
| | | * 分页获取店铺列表(营业、停业状态) |
| | | * |
| | | * @param page |
| | | * @param shopSearchParam |
| | | * @return |
| | | */ |
| | | IPage<ShopHeadInfoDto> renovationShopPage(PageParam<ShopDetail> page, @Param("shopSearchParam") ShopSearchParam shopSearchParam); |
| | | |
| | | /** |
| | | * 店铺列表(营业、停业状态) |
| | | * |
| | | * @param shopSearchParam |
| | | * @return |
| | | */ |
| | | List<ShopHeadInfoDto> listRenovationShop(@Param("shopSearchParam") ShopSearchParam shopSearchParam); |
| | | |
| | | /** |
| | | * 根据店铺ids获取店铺详情列表 |
| | | * @param shopIds |
| | | * @return |
| | | */ |
| | | List<ShopDetail> getShopDetailByShopIds(@Param("shopIds") List<Long> shopIds); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ShopRenovation; |
| | | |
| | | /** |
| | | * 店铺装修信息 |
| | | * |
| | | * @author lhd |
| | | * @date 2021-01-05 11:03:38 |
| | | */ |
| | | public interface ShopRenovationMapper extends BaseMapper<ShopRenovation> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.ShopTemplate; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author LGH |
| | | * @date 2022-07-29 16:54:02 |
| | | */ |
| | | public interface ShopTemplateMapper extends BaseMapper<ShopTemplate> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.ShopWallet; |
| | | import com.yami.shop.bean.model.ShopWalletLog; |
| | | import com.yami.shop.bean.param.CustomerReqParam; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 商家钱包记录 |
| | | * |
| | | * @author Dwl |
| | | * @date 2019-09-19 14:02:57 |
| | | */ |
| | | public interface ShopWalletLogMapper extends BaseMapper<ShopWalletLog> { |
| | | |
| | | |
| | | /** |
| | | * 计算商家从订单获取金额的数量 |
| | | * |
| | | * @param orderNumber 订单编号 |
| | | * @param shopWalletChangeReason 钱包改变原因 |
| | | * @return 数量 |
| | | */ |
| | | int countInAmountByOrderNumber(@Param("orderNumber") String orderNumber, @Param("shopWalletChangeReason") Integer shopWalletChangeReason); |
| | | |
| | | /** |
| | | * 根据订单号,由该订单号引起的分账信息 |
| | | * @param orderNumber 订单编号 |
| | | * @return 钱包日志列表 |
| | | */ |
| | | List<ShopWalletLog> listByOrderNumber(String orderNumber); |
| | | |
| | | |
| | | /** |
| | | * 计算商家从订单获取金额的数量 |
| | | * |
| | | * @param orderNumber 订单编号 |
| | | * @param shopWalletChangeReason 钱包改变原因 |
| | | * @return 数量 |
| | | */ |
| | | int countInAmountByOrderId(@Param("orderNumber") String orderNumber, @Param("shopWalletChangeReason") Integer shopWalletChangeReason); |
| | | |
| | | |
| | | /** |
| | | * 计算商家从退款失去金额的数量 |
| | | * |
| | | * @param refundSn 退款编号 |
| | | * @param shopWalletChangeReason 钱包改变原因 |
| | | * @return 数量 |
| | | */ |
| | | int countOutAmountByRefundSn(@Param("refundSn") String refundSn, @Param("shopWalletChangeReason") Integer shopWalletChangeReason); |
| | | |
| | | /** |
| | | * 根据参数搜索钱包记录 |
| | | * @param page 分页参数 |
| | | * @param shopWalletLog 搜索参数 |
| | | * @return 钱包记录 |
| | | */ |
| | | IPage<ShopWalletLog> listByParam(@Param("page") PageParam<ShopWalletLog> page, @Param("shopWalletLog") ShopWalletLog shopWalletLog); |
| | | |
| | | /** |
| | | * 查询所有店铺的日志 |
| | | * @param page 分页 |
| | | * @param shopWalletLog 查询参数 |
| | | * @return 所有店铺的日志 |
| | | */ |
| | | IPage<ShopWalletLog> pageAllByParam(@Param("page") PageParam<ShopWallet> page, @Param("shopWalletLog") ShopWalletLog shopWalletLog); |
| | | |
| | | /** |
| | | * 获取店铺日志列表导出excel |
| | | * @param customerReqParam |
| | | * @return |
| | | */ |
| | | List<ShopWalletLog> listShopWalletLogByParam(@Param("customerReqParam") CustomerReqParam customerReqParam); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.ShopWallet; |
| | | import com.yami.shop.bean.vo.ShopWalletVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 商家钱包信息 |
| | | * |
| | | * @author Dwl |
| | | * @date 2019-09-19 14:02:57 |
| | | */ |
| | | public interface ShopWalletMapper extends BaseMapper<ShopWallet> { |
| | | |
| | | /** |
| | | * 条件查询,分页获取店铺钱包 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param shopWallet 店铺钱包参数 |
| | | * @return 店铺钱包分页数据 |
| | | */ |
| | | IPage<ShopWallet> pageShopWallet(PageParam<ShopWallet> page, @Param("shopWallet") ShopWallet shopWallet); |
| | | |
| | | /** |
| | | * 给商家钱包,添加未结算金额 |
| | | * |
| | | * @param shopId |
| | | * @param changeAmount |
| | | * @return |
| | | */ |
| | | int addUnsettledAmount(@Param("shopId") Long shopId, @Param("changeAmount") Double changeAmount); |
| | | |
| | | /** |
| | | * 进行结算 |
| | | * 添加结算金额可用金额、结算总金额,减少待结算金额 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param settledAmount 结算金额 |
| | | * @return |
| | | */ |
| | | int settledAmount(@Param("shopId") Long shopId, @Param("settledAmount") Double settledAmount); |
| | | |
| | | |
| | | /** |
| | | * 锁定未结算金额 |
| | | * |
| | | * @param shopId |
| | | * @param shopRealRefundAmount |
| | | * @return |
| | | */ |
| | | int subUnsettledAmount(@Param("shopId") Long shopId, @Param("shopRealRefundAmount") Double shopRealRefundAmount); |
| | | |
| | | /** |
| | | * 获取所有店铺的钱包信息 |
| | | * @param shopName |
| | | * @return 钱包信息 |
| | | */ |
| | | ShopWallet getAllShop(@Param("shopName") String shopName); |
| | | |
| | | /** |
| | | * 根据时间参数获取店铺的钱包信息 |
| | | * @param shopName |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | ShopWallet getShopByTime(@Param("shopName") String shopName, |
| | | @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 分页获取店铺钱包信息 |
| | | * @param page |
| | | * @param shopName |
| | | * @return |
| | | */ |
| | | IPage<ShopWallet> pageAllShopWallet(PageParam<ShopWallet> page, @Param("shopName") String shopName); |
| | | |
| | | /** |
| | | * 根据时间参数分页获取店铺钱包信息 |
| | | * @param page |
| | | * @param shopName |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | IPage<ShopWallet> pageShopWalletByTime(PageParam<ShopWallet> page, @Param("shopName") String shopName, |
| | | @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 添加已结算金额 |
| | | * |
| | | * @param shopId 店铺id |
| | | * @param settledAmount 收入金额 |
| | | */ |
| | | void addSettledAmount(@Param("shopId") Long shopId, @Param("settledAmount") Double settledAmount); |
| | | |
| | | /** |
| | | * 获取店铺钱包及交易信息 |
| | | * |
| | | * @param shopId |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | ShopWalletVO getShopWalletAndTransaction(@Param("shopId") Long shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.ShopWithdrawCash; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 商家提现申请信息 |
| | | * |
| | | * @author Dwl |
| | | * @date 2019-09-19 14:22:08 |
| | | */ |
| | | public interface ShopWithdrawCashMapper extends BaseMapper<ShopWithdrawCash> { |
| | | |
| | | /** |
| | | * 条件查询,分页获取店铺提现记录 |
| | | * @param page 分页参数 |
| | | * @param shopWithdrawCash 提现参数 |
| | | * @return 分页店铺提现记录 |
| | | */ |
| | | IPage<ShopWithdrawCash> pageShopWithdrawCash(PageParam<ShopWithdrawCash> page, @Param("shopWithdrawCash") ShopWithdrawCash shopWithdrawCash); |
| | | |
| | | /** |
| | | * 获取店铺提现详情 |
| | | * @param shopId 店铺id |
| | | * @return 店铺提现记录 |
| | | */ |
| | | ShopWithdrawCash getShopWithdrawCashByShopId(@Param("shopId")Long shopId); |
| | | |
| | | /** |
| | | * 获取筛选条件筛选的提现信息 |
| | | * @param shopWithdrawCash |
| | | * @return |
| | | */ |
| | | List<ShopWithdrawCash> listExportByParam(@Param("shopWithdrawCash")ShopWithdrawCash shopWithdrawCash); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.SigningAuditing; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @Author lth |
| | | * @Date 2021/8/19 10:13 |
| | | */ |
| | | public interface SigningAuditingMapper extends BaseMapper<SigningAuditing> { |
| | | |
| | | /** |
| | | * 分页获取待审核的签约信息列表 |
| | | * @param page |
| | | * @param signingAuditing |
| | | * @return |
| | | */ |
| | | IPage<SigningAuditing> pageSigningAuditing(@Param("page") PageParam<SigningAuditing> page, @Param("signingAuditing") SigningAuditing signingAuditing); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.SkuLang; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lhd |
| | | * @date 2020-08-31 13:54:58 |
| | | */ |
| | | public interface SkuLangMapper extends BaseMapper<SkuLang> { |
| | | |
| | | /** |
| | | * 修改sku语言表 |
| | | * @param skuId skuId |
| | | * @param lang 语言类型 |
| | | * @param properties 属性 |
| | | * @param skuName sku名称 |
| | | * @param prodName 商品名称 |
| | | */ |
| | | void updateSkuLangById(@Param("skuId") Long skuId, @Param("lang") Integer lang, @Param("properties") String properties, @Param("skuName") String skuName, @Param("prodName") String prodName); |
| | | |
| | | /** |
| | | * 根据商品id删除sku语言表 |
| | | * @param prodId 商品id |
| | | */ |
| | | void deleteByProdId(@Param("prodId") Long prodId); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.app.dto.SkuDto; |
| | | import com.yami.shop.bean.model.Sku; |
| | | import com.yami.shop.bean.model.StockBillLog; |
| | | import com.yami.shop.bean.model.StockBillLogItem; |
| | | import com.yami.shop.bean.param.ProductParam; |
| | | import com.yami.shop.bean.param.SkuExportParam; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface SkuMapper extends BaseMapper<Sku> { |
| | | |
| | | /** |
| | | * 获取商品的sku列表 (不包含库存信息) |
| | | * |
| | | * @param prodId 商品id |
| | | * @return sku列表 |
| | | */ |
| | | List<Sku> listByProdId(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 根据id获取sku语言列表 |
| | | * |
| | | * @param skuId |
| | | * @return |
| | | */ |
| | | Sku getSkuListBySkuId(@Param("skuId") Long skuId); |
| | | |
| | | |
| | | /** |
| | | * 删除商品 |
| | | * |
| | | * @param prodId 商品id |
| | | */ |
| | | void deleteByProdId(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 批量新增sku并且返回自增主键 |
| | | * |
| | | * @param skuList sku列表 |
| | | */ |
| | | void insertBatchReturnId(@Param("skuList") List<Sku> skuList); |
| | | |
| | | /** |
| | | * 获取sku 不用语言条件下 |
| | | * |
| | | * @param skuId skuId |
| | | * @param dbLang 语言表 |
| | | * @return |
| | | */ |
| | | Sku getSkuBySkuId(@Param("skuId") Long skuId, @Param("dbLang") Integer dbLang); |
| | | |
| | | /** |
| | | * 根据skuId列表查找库存信息,赠品使用无缓存 |
| | | * |
| | | * @param skuIds |
| | | * @return |
| | | */ |
| | | List<Sku> getSkuBySkuIds(@Param("skuIds") List<Long> skuIds); |
| | | |
| | | /** |
| | | * 根据商品id列表获取有商品编号的 |
| | | * |
| | | * @param prodIds 获取商品编号的商品id列表 |
| | | * @param disProdId 过滤掉的商品 |
| | | * @return |
| | | */ |
| | | List<String> listSkuByProdIds(@Param("prodIds") List<Long> prodIds, @Param("disProdId") Long disProdId); |
| | | |
| | | /** |
| | | * 根据商品id获取sku列表 |
| | | * |
| | | * @param prodId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Sku> listSkuByProdIdAndLang(@Param("prodId") Long prodId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 分页获取sku |
| | | * |
| | | * @param page |
| | | * @param product |
| | | * @return |
| | | */ |
| | | IPage<Sku> pageSku(@Param("page") PageParam<Sku> page, @Param("product") ProductParam product); |
| | | |
| | | /** |
| | | * 根据编码获取sku信息 |
| | | * |
| | | * @param shopId |
| | | * @param lang |
| | | * @param partyCode |
| | | * @return |
| | | */ |
| | | Sku getSkuByPartyCode(@Param("shopId") Long shopId, @Param("partyCode") String partyCode, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 更新sku,该方法不更新库存 |
| | | * |
| | | * @param sku |
| | | */ |
| | | void updateSkuById(@Param("sku") Sku sku); |
| | | |
| | | /** |
| | | * 查询库存 |
| | | * |
| | | * @param page |
| | | * @param productParam |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | IPage<StockBillLogItem> inquireStock(@Param("page") PageParam<StockBillLog> page, @Param("productParam") ProductParam productParam, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取导出sku列表 |
| | | * |
| | | * @param product |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<SkuExportParam> listExportSku(@Param("product") ProductParam product, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取指定商品的sku列表(包括sku库存信息等)(仅获取启用状态) |
| | | * |
| | | * @param prodId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<SkuDto> getProdDetailSkuInfo(@Param("prodId") Long prodId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 或者指定的sku列表 |
| | | * |
| | | * @param skuIds |
| | | * @return |
| | | */ |
| | | List<Sku> listSkuBySKuIds(@Param("skuIds") List<Long> skuIds); |
| | | |
| | | /** |
| | | * 根据商品编码获取sku信息 |
| | | * @param partyCode |
| | | * @return |
| | | */ |
| | | List<Sku> listSkuByPartyCode(@Param("partyCode")String partyCode); |
| | | |
| | | /** |
| | | * 获取库存预警数量 |
| | | * @return |
| | | */ |
| | | Integer stockWarningCount(@Param("shopId") Long shopId); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.SkuStockLock; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 库存锁定信息 |
| | | * |
| | | * @author lhd |
| | | * @date 2022-05-06 17:27:53 |
| | | */ |
| | | public interface SkuStockLockMapper extends BaseMapper<SkuStockLock> { |
| | | |
| | | |
| | | /** |
| | | * 批量保存库存锁定信息 |
| | | * |
| | | * @param skuStockLocks 库存锁定信息 |
| | | */ |
| | | void saveBatch(@Param("skuStockLocks") List<SkuStockLock> skuStockLocks); |
| | | |
| | | |
| | | /** |
| | | * 将锁定状态标记为已解锁 |
| | | * |
| | | * @param lockIds ids |
| | | * @return 是否锁定成功 |
| | | */ |
| | | int unLockByIds(@Param("lockIds") List<Long> lockIds); |
| | | |
| | | |
| | | /** |
| | | * 正式锁定库存,标记为使用状态 |
| | | * @param orderNumbers 锁定库存的订单 |
| | | * @param status |
| | | * @return |
| | | */ |
| | | int markerStockUse(@Param("orderNumbers") List<String> orderNumbers, @Param("status") Integer status); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.Sku; |
| | | import com.yami.shop.bean.model.SkuStock; |
| | | import com.yami.shop.bean.model.SkuStockLock; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 库存信息 |
| | | * |
| | | * @author LGH |
| | | * @date 2022-05-06 14:59:42 |
| | | */ |
| | | public interface SkuStockMapper extends BaseMapper<SkuStock> { |
| | | /** |
| | | * 通过订单减少库存 |
| | | * |
| | | * @param skuId 商品id |
| | | * @param count 数量 |
| | | * @return |
| | | */ |
| | | int reduceStockByOrder(@Param("skuId") Long skuId, @Param("count") Integer count); |
| | | |
| | | /** |
| | | * 更新商品库存(增加或减少库存) |
| | | * |
| | | * @param skuId |
| | | * @param changeStock 大于0:增加库存, 小于0:减少库存 |
| | | * @return 更新的条数 |
| | | */ |
| | | int updateSkuStocks(@Param("skuId") Long skuId, @Param("changeStock") Integer changeStock); |
| | | |
| | | /** |
| | | * 批量更新商品库存(增加或减少库存) |
| | | * |
| | | * @param skuMap (value 大于0:增加库存, 小于0:减少库存) |
| | | * @return 更新的条数 |
| | | */ |
| | | int batchUpdateSkuStocks(@Param("skuMap") Map<Long, Integer> skuMap); |
| | | |
| | | /** |
| | | * 获取指定商品的sku库存信息 |
| | | * |
| | | * @param prodId |
| | | * @return |
| | | */ |
| | | List<SkuStock> listByProdId(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 通过订单添加库存 |
| | | * |
| | | * @param allSkuWithStocks 库存信息 |
| | | */ |
| | | void addStockByOrder(@Param("skuWithStocks") List<SkuStockLock> allSkuWithStocks); |
| | | |
| | | /** |
| | | * 更新sku库存(只用于减少库存) |
| | | * |
| | | * @param sku sku信息 |
| | | * @return 更新的条数 |
| | | */ |
| | | int updateStocks(@Param("sku") Sku sku); |
| | | |
| | | |
| | | /** |
| | | * 通过订单减少实际库存 |
| | | * |
| | | * @param skuWithStocks 库存信息 |
| | | */ |
| | | void reduceActualStockByOrder(@Param("skuWithStocks") List<SkuStockLock> skuWithStocks); |
| | | |
| | | |
| | | /** |
| | | * 通过已经取消的订单减少实际库存 |
| | | * |
| | | * @param skuWithStocks 库存信息 |
| | | */ |
| | | void reduceActualStockByCancelOrder(@Param("skuWithStocks") List<SkuStockLock> skuWithStocks); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.SmsLog; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface SmsLogMapper extends BaseMapper<SmsLog> { |
| | | |
| | | /** |
| | | * 失效短信记录 |
| | | * @param mobile 电话号码 |
| | | * @param type 类型 |
| | | */ |
| | | void invalidSmsByMobileAndType(@Param("mobile") String mobile, @Param("type") Integer type); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.app.dto.StationSalesDto; |
| | | import com.yami.shop.bean.model.Station; |
| | | import com.yami.shop.bean.param.StationDetailParam; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 自提点 |
| | | * |
| | | * @author YXF |
| | | * @date 2020-04-23 15:18:29 |
| | | */ |
| | | public interface StationMapper extends BaseMapper<Station> { |
| | | |
| | | /** |
| | | * 更新自提门店状态 |
| | | * @param handleId 自提门店id |
| | | * @param status 状态 |
| | | */ |
| | | void updateStatus(@Param("handleId") Long handleId, @Param("status") int status); |
| | | |
| | | /** |
| | | * 条件查询,分页获取自提门店 |
| | | * @param page 分页参数 |
| | | * @param station 条件查询参数 |
| | | * @return 分页自提门店 |
| | | */ |
| | | IPage<Station> getPage(PageParam<Station> page, @Param("station") Station station); |
| | | |
| | | /** |
| | | * 获取自提门店详情 |
| | | * @param stationId 自提门店id |
| | | * @return 自提门店详情 |
| | | */ |
| | | Station getStationInfoById(@Param("stationId") Long stationId); |
| | | |
| | | /** |
| | | * 通过账号,获取自提门店信息 |
| | | * @param account 账号 |
| | | * @return 自提门店信息 |
| | | */ |
| | | Station getStationInfoByAccount(String account); |
| | | |
| | | /** |
| | | * 获取自提点销售记录列表 |
| | | * @param shopId 店铺id |
| | | * @param stationId 自提门店id |
| | | * @param day 天数 |
| | | * @param month 月 |
| | | * @return 自提点销售记录列表 |
| | | */ |
| | | List<StationSalesDto> getStationSalesRecord(@Param("shopId") Long shopId, @Param("stationId") Long stationId, @Param("day") Date day, @Param("month") Date month); |
| | | |
| | | /** |
| | | * 获取自提点核销销售记录列表 |
| | | * @param shopId 店铺id |
| | | * @param stationId 自提门店id |
| | | * @param day 天数 |
| | | * @param month 月 |
| | | * @return 自提点销售记录列表 |
| | | */ |
| | | List<StationSalesDto> getStationWriteOffSalesRecord(@Param("shopId") Long shopId, @Param("stationId") Long stationId, @Param("day") Date day, @Param("month") Date month); |
| | | |
| | | /** |
| | | * 统计某个账号自提点数量 |
| | | * @param account 账号 |
| | | * @param stationId 自提门店id |
| | | * @return |
| | | */ |
| | | int getCountByAccount(@Param("account") String account, @Param("stationId") Long stationId); |
| | | |
| | | /** |
| | | * 条件查询,分页获取经纬度最近的自提门店信息列表 |
| | | * @param page 分页参数 |
| | | * @param lat 纬度 |
| | | * @param lng 经度 |
| | | * @param stationName 自提门店名称 |
| | | * @param shopId 店铺id |
| | | * @param stationId 自提门店id |
| | | * @return 分页经纬度最近的自提门店信息列表 |
| | | */ |
| | | IPage<StationDetailParam> getStationList(Page page, @Param("lat") Double lat, @Param("lng") Double lng, @Param("stationName") String stationName, |
| | | @Param("shopId") Long shopId, @Param("stationId") Long stationId); |
| | | |
| | | /** |
| | | * 获取用户常用的自提点 |
| | | * @param userId 用户id |
| | | * @param shopId 店铺id |
| | | * @return 用户常用的自提点信息 |
| | | */ |
| | | StationDetailParam selectGoOften(@Param("userId") String userId, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 改变自提门店地址 |
| | | * @param stationId 自提门店id |
| | | * @param addr 地址 |
| | | * @param phone 手机号 |
| | | */ |
| | | void changeStationAddr(@Param("stationId") Long stationId, @Param("addr") String addr, @Param("phone") String phone); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.yami.shop.bean.vo.statistics.HotStatisticsVO; |
| | | import com.yami.shop.bean.vo.statistics.PlatformStatisticsVO; |
| | | import com.yami.shop.bean.vo.statistics.TrendStatisticsVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author chiley |
| | | */ |
| | | public interface StatisticsMapper { |
| | | |
| | | /** |
| | | * 获取平台主页基本信息 |
| | | * |
| | | * @param lastStartTime 上月开始时间 |
| | | * @param startTime 本月开始时间 |
| | | * @return |
| | | */ |
| | | List<PlatformStatisticsVO> getPlatformBaseInfo(@Param("lastStartTime") DateTime lastStartTime, @Param("startTime") Date startTime); |
| | | |
| | | /** |
| | | * 获取平台主页今日待办、实时概况 |
| | | * |
| | | * @param today 今日 |
| | | * @param yesterday 昨天 |
| | | * @param sevenDay 前七天 |
| | | * @param thirtyDay 前30天 |
| | | * @return |
| | | */ |
| | | PlatformStatisticsVO getAuditAndPlatformStatistics(@Param("today") Date today, @Param("yesterday") Date yesterday, @Param("sevenDay") Date sevenDay, @Param("thirtyDay") Date thirtyDay); |
| | | |
| | | /** |
| | | * 热卖店铺列表 |
| | | * |
| | | * @param startTime 开始时间 |
| | | * @return |
| | | */ |
| | | // List<HotStatisticsVO> getHotShopList(@Param("startTime") Date startTime); |
| | | |
| | | |
| | | /** |
| | | * 热卖店铺列表(指定一段时间内) |
| | | * |
| | | * @param startTime 起始时间 |
| | | * @param endTime 结束时间 |
| | | * @param lang 语言 |
| | | * @return |
| | | */ |
| | | List<HotStatisticsVO> getHotShopListByDate(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("lang") Integer lang); |
| | | |
| | | |
| | | /** |
| | | * 热卖商品列表 |
| | | * |
| | | * @param startTime 开始时间 |
| | | * @param lang 语言 |
| | | * @return |
| | | */ |
| | | // List<HotStatisticsVO> getHotProdList(@Param("startTime") Date startTime, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 热卖商品列表(指定一段时间内) |
| | | * |
| | | * @param startTime 起始时间 |
| | | * @param endTime 结束时间 |
| | | * @param lang 语言 |
| | | * @return |
| | | */ |
| | | List<HotStatisticsVO> getHotProdListByDate(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取流量走势 |
| | | * |
| | | * @param startDate |
| | | * @return |
| | | */ |
| | | // List<TrendStatisticsVO> flowTrend(@Param("startTime") Date startTime); |
| | | List<TrendStatisticsVO> flowTrend(@Param("startDate") Date startDate, @Param("endDate") Date endDate); |
| | | |
| | | /** |
| | | * 获取交易走势 |
| | | * |
| | | * @param startDate |
| | | * @return |
| | | */ |
| | | // List<TrendStatisticsVO> transactionTrend(@Param("startTime") DateTime startTime); |
| | | List<TrendStatisticsVO> transactionTrend(@Param("startDate") Date startDate, @Param("endDate") Date endDate); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.StockBillLog; |
| | | import com.yami.shop.bean.model.StockBillLogItem; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 出入库商品项 |
| | | * |
| | | * @author LGH |
| | | * @date 2021-09-09 13:11:15 |
| | | */ |
| | | public interface StockBillLogItemMapper extends BaseMapper<StockBillLogItem> { |
| | | |
| | | /** |
| | | * 批量保存 |
| | | * |
| | | * @param stockBillLogId |
| | | * @param stockBillLogItems |
| | | */ |
| | | void insertBatch(@Param("stockBillLogId") Long stockBillLogId, @Param("stockBillLogItems") List<StockBillLogItem> stockBillLogItems); |
| | | |
| | | /** |
| | | * 根据出入明细id获取出入商品项列表 |
| | | * |
| | | * @param stockBillLogId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<StockBillLogItem> listByStockBillLogId(@Param("stockBillLogId") Long stockBillLogId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取普通商品出入库项信息 |
| | | * @param stockBillLogId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<StockBillLogItem> listCommonProds(@Param("stockBillLogId") Long stockBillLogId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据出入库明细id列表获取信息 |
| | | * @param stockBillLogItemIds |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<StockBillLogItem> listProdByStockBillLogItemIds(@Param("stockBillLogItemIds") List<Long> stockBillLogItemIds, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 查询库存流水 |
| | | * @param page |
| | | * @param stockBillLog |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | IPage<StockBillLogItem> flow(@Param("page") PageParam<StockBillLog> page, @Param("stockBillLog") StockBillLog stockBillLog, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 批量获取待导出的库存流水列表 |
| | | * @param stockBillLog |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<StockBillLogItem> listExport(@Param("stockBillLog") StockBillLog stockBillLog, @Param("lang") Integer lang); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.StockBillLog; |
| | | import com.yami.shop.bean.param.StockBillExportParam; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 出入库明细 |
| | | * |
| | | * @author LGH |
| | | * @date 2021-09-09 13:11:15 |
| | | */ |
| | | public interface StockBillLogMapper extends BaseMapper<StockBillLog> { |
| | | |
| | | /** |
| | | * 分页获取出入库明细信息 |
| | | * |
| | | * @param page |
| | | * @param stockBillLog |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | IPage<StockBillLog> pageByParams(@Param("page") PageParam<StockBillLog> page, @Param("stockBillLog") StockBillLog stockBillLog, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取导出出入库明细信息列表 |
| | | * |
| | | * @param stockBillLog |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<StockBillExportParam> listExportStockBillLog(@Param("stockBillLog") StockBillLog stockBillLog, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据id获取 |
| | | * |
| | | * @param stockBillLogId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | StockBillLog getByStockBillLogId(@Param("stockBillLogId") Long stockBillLogId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取出入库明细 |
| | | * @param stockBillLogId |
| | | * @return |
| | | */ |
| | | StockBillLog info(@Param("stockBillLogId") Long stockBillLogId); |
| | | |
| | | /** |
| | | * 删除空的库存记录 |
| | | */ |
| | | void removeEmptyLog(); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.StockChangeReason; |
| | | import com.yami.shop.bean.model.StockChangeReasonLang; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lth |
| | | * @date 2020-08-26 15:39:09 |
| | | */ |
| | | public interface StockChangeReasonLangMapper extends BaseMapper<StockChangeReasonLang> { |
| | | |
| | | /** |
| | | * 统计出入库原因数量 |
| | | * @param stockChangeReason |
| | | * @param reason |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | int countReason(@Param("stockChangeReason") StockChangeReason stockChangeReason,@Param("reason") String reason, @Param("lang") Integer lang); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.StockChangeReason; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author LGH |
| | | * @date 2021-09-07 16:04:18 |
| | | */ |
| | | public interface StockChangeReasonMapper extends BaseMapper<StockChangeReason> { |
| | | |
| | | /** |
| | | * 分页查询出入库原因 |
| | | * @param page |
| | | * @param stockChangeReason |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | IPage<StockChangeReason> pageByParams(@Param("page") PageParam<StockChangeReason> page, @Param("stockChangeReason") StockChangeReason stockChangeReason, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取出入库原因列表 |
| | | * @param stockChangeReason |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<StockChangeReason> listByParams(@Param("stockChangeReason") StockChangeReason stockChangeReason, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 获取名称数量 |
| | | * @param stockChangeReason |
| | | * @return |
| | | */ |
| | | int countByParams(@Param("stockChangeReason") StockChangeReason stockChangeReason); |
| | | |
| | | /** |
| | | * 根据主键id与店铺id获取出入库原因信息 |
| | | * @param stockChangeReasonId |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | StockChangeReason getInfoByIdAndShopId(@Param("stockChangeReasonId") Long stockChangeReasonId, @Param("shopId") Long shopId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.StockChangeReasonStatus; |
| | | |
| | | /** |
| | | * 出入库原因状态 |
| | | * |
| | | * @author LGH |
| | | * @date 2021-09-26 09:46:31 |
| | | */ |
| | | public interface StockChangeReasonStatusMapper extends BaseMapper<StockChangeReasonStatus> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.SupplierCategory; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author Citrus |
| | | * @date 2021-09-07 10:12:32 |
| | | */ |
| | | public interface SupplierCategoryMapper extends BaseMapper<SupplierCategory> { |
| | | /** |
| | | * 获取供应商分类列表 |
| | | * @param shopId |
| | | * @param isAll 是否搜索全部,1为全部,0为搜索启用的 |
| | | * @return |
| | | */ |
| | | List<SupplierCategory> listSupplierCategory(@Param("shopId") Long shopId, @Param("isAll") Integer isAll); |
| | | |
| | | /** |
| | | * 改变分类状态 |
| | | * @param supplierCategoryId |
| | | */ |
| | | void changeCategory(@Param("supplierCategoryId")Long supplierCategoryId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.Supplier; |
| | | import com.yami.shop.bean.vo.SupplierVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author SJL |
| | | * @date 2020-08-25 15:50:06 |
| | | */ |
| | | public interface SupplierMapper extends BaseMapper<Supplier> { |
| | | |
| | | /** |
| | | * 供应商分页 |
| | | * @param page |
| | | * @param supplier |
| | | * @return |
| | | */ |
| | | IPage<Supplier> pageShop(@Param("page")PageParam<Supplier> page,@Param("supplier") Supplier supplier); |
| | | |
| | | /** |
| | | * 供应商商品分页 |
| | | * @param page |
| | | * @param supplier |
| | | * @return |
| | | */ |
| | | IPage<SupplierVO> pageProdSupplier(@Param("page")PageParam<Supplier> page,@Param("supplier") Supplier supplier); |
| | | |
| | | /** |
| | | * 获取店铺供应商列表 |
| | | * @param shopId 店铺id |
| | | * @return 供应商列表 |
| | | */ |
| | | List<Supplier> getByShopId(@Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 匹配的供应商 |
| | | * @param supplier |
| | | * @return |
| | | */ |
| | | List<Supplier> getByParam(@Param("supplier") Supplier supplier); |
| | | |
| | | /** |
| | | * 查找供应商名称 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | List<String> listSupplierName(@Param("shopId")Long shopId); |
| | | |
| | | /** |
| | | * 根据供应商名称获取数量 |
| | | * @param supplierName |
| | | * @param supplierId |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | Integer getCountByName(@Param("supplierName")String supplierName,@Param("supplierId")Long supplierId,@Param("shopId")Long shopId); |
| | | |
| | | /** |
| | | * 更新供应商 |
| | | * @param supplierId |
| | | * @return |
| | | */ |
| | | void updateSupplierCategory(@Param("supplierId") Long supplierId); |
| | | |
| | | /** |
| | | * 清除供应商分类信息 |
| | | * @param supplierCategoryId |
| | | */ |
| | | void updateSupplierByCategoryId(Long supplierCategoryId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.Supplier; |
| | | import com.yami.shop.bean.model.SupplierProd; |
| | | import com.yami.shop.bean.vo.SupplierProdVO; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Citrus |
| | | * @date 2021-09-07 10:12:32 |
| | | */ |
| | | public interface SupplierProdMapper extends BaseMapper<SupplierProd> { |
| | | |
| | | /** |
| | | * 搜索所有商品 |
| | | * |
| | | * @param supplierId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<SupplierProdVO> listSupplierProd(@Param("supplierId") Long supplierId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 导出商品 |
| | | * |
| | | * @param supplierId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<SupplierProdVO> getByParam(@Param("supplierId") Long supplierId, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据供应商id查找已有的商品 |
| | | * |
| | | * @param supplierId |
| | | * @return 编码列表 |
| | | */ |
| | | List<String> getPartyCodeList(@Param("supplierId") Long supplierId); |
| | | |
| | | /** |
| | | * 根据商品id删除供应商商品 |
| | | * |
| | | * @param prodId |
| | | */ |
| | | void deleteByProdId(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 根据商品id查询供应商 |
| | | * |
| | | * @param prodId |
| | | * @return |
| | | */ |
| | | List<Long> listSupplierIdByProdId(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 根据skuIds查询供应商 |
| | | * |
| | | * @param skuIds |
| | | * @return |
| | | */ |
| | | List<Long> listSupplierIdBySkuIds(@Param("skuIds") List<Long> skuIds); |
| | | |
| | | /** |
| | | * 供应商商品列表 |
| | | * |
| | | * @param pageAdapter |
| | | * @param supplierId |
| | | * @param partyCode |
| | | * @return |
| | | */ |
| | | List<SupplierProdVO> supplierProdList(@Param("page") PageAdapter pageAdapter, @Param("supplierId") Long supplierId, @Param("partyCode") String partyCode); |
| | | |
| | | /** |
| | | * 供应商商品总数 |
| | | * |
| | | * @param supplierId |
| | | * @param partyCode |
| | | * @return |
| | | */ |
| | | long supplierProdTotal(@Param("supplierId") Long supplierId, @Param("partyCode") String partyCode); |
| | | |
| | | /** |
| | | * 根据skuId删除商品 |
| | | * |
| | | * @param prodId |
| | | * @param skuIds |
| | | */ |
| | | void deleteBySkuIds(@Param("prodId") Long prodId, @Param("skuIds") List<Long> skuIds); |
| | | |
| | | /** |
| | | * 自采供应商商品总数 |
| | | * @param supplier |
| | | * @param partyCode |
| | | * @return |
| | | */ |
| | | long defaultSupplierProdTotal(@Param("supplier") Supplier supplier, @Param("partyCode") String partyCode); |
| | | |
| | | /** |
| | | * 获取默认供应商商品信息 |
| | | * |
| | | * @param pageAdapter |
| | | * @param supplier |
| | | * @param partyCode |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<SupplierProdVO> defaultSupplierProdPage(@Param("page") PageAdapter pageAdapter, @Param("supplier") Supplier supplier, @Param("partyCode") String partyCode, @Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据商品编码获取供应商商品信息 |
| | | * |
| | | * @param partyCodeList |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<SupplierProdVO> listSupplierProdByPartyCodeList(@Param("partyCodeList") List<String> partyCodeList, @Param("lang") Integer lang); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.SysAccessKey; |
| | | |
| | | /** |
| | | * 系统访问密钥 |
| | | * |
| | | * @author YXF |
| | | * @date 2021-10-19 14:41:38 |
| | | */ |
| | | public interface SysAccessKeyMapper extends BaseMapper<SysAccessKey> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.common.bean.SysConfig; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 系统配置信息 |
| | | * @author lgh |
| | | */ |
| | | public interface SysConfigMapper extends BaseMapper<SysConfig> { |
| | | |
| | | /** |
| | | * 根据key,查询系统配置信息 |
| | | * @param key key |
| | | * @return SysConfig |
| | | */ |
| | | SysConfig queryByKey(String key); |
| | | |
| | | /** |
| | | * 根据key,更新value |
| | | * @param key |
| | | * @param value |
| | | * @return 更新成功条数 |
| | | */ |
| | | int updateValueByKey(@Param("key") String key, @Param("value") String value); |
| | | |
| | | /** |
| | | * 批量删除系统配置 |
| | | * @param ids 系统配置信息数组 |
| | | */ |
| | | void deleteBatch(@Param("ids") Long[] ids); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.common.bean.SysUpgradeInfo; |
| | | |
| | | /** |
| | | * 系统配置信息 |
| | | * @author lgh |
| | | */ |
| | | public interface SysUpgradeInfoMapper extends BaseMapper<SysUpgradeInfo> { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.model.TakeStock; |
| | | import com.yami.shop.bean.param.TakeStockParam; |
| | | import com.yami.shop.bean.vo.TakeStockVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author Citrus |
| | | * @date 2021-09-15 11:18:33 |
| | | */ |
| | | public interface TakeStockMapper extends BaseMapper<TakeStock> { |
| | | /** |
| | | * 分页查询盘点列表 |
| | | * @param page |
| | | * @param takeStock |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | IPage<TakeStockVO> pageByParams(@Param("page") PageParam<TakeStock> page, @Param("takeStock") TakeStockParam takeStock, @Param("lang")Integer lang); |
| | | |
| | | /** |
| | | * 导出盘点 |
| | | * @param takeStock |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<TakeStockVO> listByParams(@Param("takeStock") TakeStockParam takeStock, @Param("lang")Integer lang); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.TakeStockProd; |
| | | import com.yami.shop.bean.vo.TakeStockProdVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 盘点商品列表 |
| | | * |
| | | * @author Citrus |
| | | * @date 2021-09-15 11:18:33 |
| | | */ |
| | | public interface TakeStockProdMapper extends BaseMapper<TakeStockProd> { |
| | | /** |
| | | * 查找商品列表 |
| | | * @param takeStockId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<TakeStockProdVO> listShopProd(@Param("takeStockId") Long takeStockId,@Param("lang") Integer lang); |
| | | |
| | | /** |
| | | * 根据商品id删除盘点商品 |
| | | * @param prodId |
| | | */ |
| | | void deleteByProdId(@Param("prodId")Long prodId); |
| | | |
| | | /** |
| | | * 根据商品id查找盘点列表 |
| | | * @param prodId |
| | | * @return |
| | | */ |
| | | List<Long> listInventoryByProdId(@Param("prodId") Long prodId); |
| | | |
| | | /** |
| | | * 根据skuIds查找盘点id |
| | | * @param skuIds |
| | | * @return |
| | | */ |
| | | List<Long> listTakeStockIdBySkuIds(@Param("skuIds") List<Long> skuIds); |
| | | |
| | | /** |
| | | * 根据skuId删除商品 |
| | | * @param prodId |
| | | * @param skuIds |
| | | */ |
| | | void deleteBySkuIds(@Param("prodId") Long prodId,@Param("skuIds") List<Long> skuIds); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.UserAddr; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface UserAddrMapper extends BaseMapper<UserAddr> { |
| | | |
| | | /** |
| | | * 获取用户默认收货地址 |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | UserAddr getDefaultUserAddr(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 移除用户默认地址 |
| | | * @param userId 用户id |
| | | */ |
| | | void removeDefaultUserAddr(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 将地址设置为默认地址 |
| | | * @param addrId 地址id |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | int setDefaultUserAddr(@Param("addrId") Long addrId, @Param("userId") String userId); |
| | | |
| | | /** |
| | | * 获取用户某个地址的信息 |
| | | * @param addrId 地址id |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | UserAddr getUserAddrByUserIdAndAddrId(@Param("userId") String userId, @Param("addrId") Long addrId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.UserAddrOrder; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface UserAddrOrderMapper extends BaseMapper<UserAddrOrder> { |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.UserAiRobotLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * AI机器人启动详情 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2024-04-24 |
| | | */ |
| | | public interface UserAiRobotLogMapper extends BaseMapper<UserAiRobotLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.UserAssetsLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户资产流水 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2024-04-24 |
| | | */ |
| | | public interface UserAssetsLogMapper extends BaseMapper<UserAssetsLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.yami.shop.bean.model.UserAssets; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户资产 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2024-04-24 |
| | | */ |
| | | public interface UserAssetsMapper extends BaseMapper<UserAssets> { |
| | | |
| | | /** |
| | | * 查询用户的幸运币 |
| | | * |
| | | * @param assetsType |
| | | * @param assetsSecType |
| | | * @return |
| | | */ |
| | | UserAssets queryUserAssetsInfo(@Param("type") Integer assetsType, @Param("secType") Integer assetsSecType, @Param("userId") String userId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.app.dto.UserCollectionDto; |
| | | import com.yami.shop.bean.model.UserCollection; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 用户收藏表 |
| | | * |
| | | * @author xwc |
| | | * @date 2019-04-19 16:57:20 |
| | | */ |
| | | public interface UserCollectionMapper extends BaseMapper<UserCollection> { |
| | | |
| | | /** |
| | | * 分页获取用户收藏商品信息 |
| | | * @param page 分页参数 |
| | | * @param userId 用户id |
| | | * @param prodName 商品名称 |
| | | * @param prodType 商品类型 |
| | | * @return 分页用户收藏商品信息 |
| | | */ |
| | | IPage<UserCollectionDto> getUserCollectionDtoPageByUserId(Page page, @Param("userId") String userId, @Param("prodName") String prodName, @Param("prodType") Integer prodType,@Param("dbLang")Integer dbLang); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.app.dto.UserCollectionShopDto; |
| | | import com.yami.shop.bean.model.UserCollectionShop; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 用户店铺收藏记录 |
| | | * |
| | | * @author LGH |
| | | * @date 2019-09-25 15:38:30 |
| | | */ |
| | | public interface UserCollectionShopMapper extends BaseMapper<UserCollectionShop> { |
| | | |
| | | /** |
| | | * 分页获取用户收藏店铺信息 |
| | | * @param page 分页参数 |
| | | * @param userId 用户id |
| | | * @param shopName 店铺名称 |
| | | * @return 分页用户收藏店铺信息 |
| | | */ |
| | | Page<UserCollectionShopDto> getUserCollectionShopPageByUserId(@Param("page") PageParam page, @Param("userId") String userId, @Param("shopName") String shopName); |
| | | |
| | | Integer selectFansCountByShopId(Long shopId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.shop.bean.app.dto.UserInfoDto; |
| | | import com.yami.shop.bean.dto.flow.MemberReqDTO; |
| | | import com.yami.shop.bean.model.UserExtension; |
| | | import com.yami.shop.bean.param.CustomerReqParam; |
| | | import com.yami.shop.bean.vo.flow.MemberOverviewVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户扩展信息 |
| | | * |
| | | * @author LGH |
| | | * @date 2020-02-26 16:03:14 |
| | | */ |
| | | public interface UserExtensionMapper extends BaseMapper<UserExtension> { |
| | | |
| | | /** |
| | | * 更新用户等级 |
| | | * |
| | | * @param userExtension 用户扩展表信息 |
| | | */ |
| | | void updateByVersion(@Param("userExtension") UserExtension userExtension); |
| | | |
| | | /** |
| | | * 条件查询,分页获取用户扩展表信息 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param userExtension 用户扩展表信息 |
| | | * @return 分页用户扩展表信息 |
| | | */ |
| | | Page<UserExtension> getPage(PageParam<UserExtension> page, @Param("userExtension") UserExtension userExtension); |
| | | |
| | | /** |
| | | * 等级设置发生变化时,更新等级更新所有用户的等级 |
| | | * |
| | | * @param level 等级 |
| | | * @param levelType 会员类型 |
| | | */ |
| | | void setUserLevelBylevelId(@Param("level") Integer level, @Param("levelType") Integer levelType); |
| | | |
| | | /** |
| | | * 根据等级,设置用户最大的等级 |
| | | * |
| | | * @param level 等级 |
| | | * @param minNeedGrowth 等级需要最小成长值 |
| | | * @param maxNeedGrowth 等级需要最大成长值 |
| | | * @param levelType 会员类型 |
| | | */ |
| | | void serMaxUserLavelByLevelId(@Param("level") Integer level, @Param("minNeedGrowth") Integer minNeedGrowth, @Param("maxNeedGrowth") Integer maxNeedGrowth, @Param("levelType") Integer levelType); |
| | | |
| | | /** |
| | | * 修改用户积分 |
| | | * |
| | | * @param userExtensions 用户扩展表信息 |
| | | */ |
| | | void updateBatchByUserId(@Param("userExtensions") List<UserExtension> userExtensions); |
| | | |
| | | /** |
| | | * 根据条件参数,统计会员数量 |
| | | * |
| | | * @param param 参数 |
| | | * @return 数量 |
| | | */ |
| | | Integer countMemberByParam(@Param("param") CustomerReqParam param); |
| | | |
| | | /** |
| | | * 根据参数条件,统计付费会员的数量 |
| | | * |
| | | * @param param 参数 |
| | | * @return 数量 |
| | | */ |
| | | Integer countPayMemberByParam(@Param("param") CustomerReqParam param); |
| | | |
| | | /** |
| | | * 统计某个时间段内,会员的人数 |
| | | * |
| | | * @param date 时间参数 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param isMember 会员类型 |
| | | * @return 数量 |
| | | */ |
| | | Integer countAllPersonNum(@Param("date") Date date, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("isMember") Integer isMember); |
| | | |
| | | /** |
| | | * 统计访客的会员信息 |
| | | * |
| | | * @param dateTime 时间参数 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 数量 |
| | | */ |
| | | Integer countVisitMemberNum(@Param("dateTime") Date dateTime, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 统计时间区间内,加购会员数 |
| | | * |
| | | * @param dateTime 时间参数 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 数量 |
| | | */ |
| | | Integer countAddCartMemberNum(@Param("dateTime") Date dateTime, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 统计访问会员数 |
| | | * |
| | | * @param dateTime 时间参数 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 数量 |
| | | */ |
| | | Integer countVisitMemberNumByFlowLog(@Param("dateTime") Date dateTime, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | /** |
| | | * 修改用户余额 |
| | | * |
| | | * @param userExtension 用户扩展表信息 |
| | | */ |
| | | void updateBalanceByVersion(@Param("userExtension") UserExtension userExtension); |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 用户信息 |
| | | */ |
| | | UserInfoDto getUserInfo(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 获取用户扩展表的详情 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 用户扩展表信息 |
| | | */ |
| | | UserExtension getByUserId(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 批量获取多个用户的扩展表信息 |
| | | * |
| | | * @param userIds 用户id集合 |
| | | * @return 用户扩展表信息列表 |
| | | */ |
| | | List<UserExtension> listByUserIds(@Param("userIds") List<String> userIds); |
| | | |
| | | /** |
| | | * 批量修改用户余额 |
| | | * |
| | | * @param userExtensions 用户扩展表信息 |
| | | * @return 修改的行数 |
| | | */ |
| | | int updateBatchUserBalanceById(@Param("userExtensions") List<UserExtension> userExtensions); |
| | | |
| | | /** |
| | | * 获取等级与普通会员成长值不匹配的用户 |
| | | * |
| | | * @param levelType 会员类型 |
| | | * @return 用户信息 |
| | | */ |
| | | List<UserExtension> getGrowthLevelMismatchUserByLevelType(@Param("levelType") Integer levelType); |
| | | |
| | | |
| | | /** |
| | | * 批量修改用户等级 |
| | | * |
| | | * @param userIds |
| | | * @param levelType 会员类型 必填 |
| | | * @return |
| | | */ |
| | | int batchUpdateLevelByUserIds(@Param("userIds") List<String> userIds, @Param("levelType") Integer levelType); |
| | | |
| | | /** |
| | | * 将用户等级从用户扩展表同步到用户表里面 |
| | | * |
| | | * @param userIds |
| | | */ |
| | | void updateUserLevelByUserExtensionAndUserIds(@Param("userIds") List<String> userIds); |
| | | |
| | | MemberOverviewVO getMemberOverviewVO(@Param("param") MemberReqDTO param, @Param("startTime") Date startTime, @Param("endTime") Date endTime); |
| | | |
| | | |
| | | /** |
| | | * 更新用户的积分 |
| | | * |
| | | * @param userIds |
| | | * @param score |
| | | * @param growth |
| | | */ |
| | | void updateUserScoreOrGrowth(@Param("userIds") List<String> userIds, @Param("score") Integer score, @Param("growth") Integer growth); |
| | | |
| | | |
| | | /** |
| | | * 通过订单锁定用户积分 |
| | | * |
| | | * @param userId 用户id |
| | | * @param useScore 积分 |
| | | * @return 是否更新成功 |
| | | */ |
| | | int lockScoreBySubmitOrder(@Param("userId") String userId, @Param("useScore") Long useScore); |
| | | |
| | | |
| | | /** |
| | | * 更新积分信息 |
| | | * @param userId 用户id |
| | | * @param useScore 用户积分 |
| | | * @return 是否更新成功 |
| | | */ |
| | | int updateScoreByUserId(@Param("userId") String userId, @Param("useScore") Long useScore); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yami.shop.bean.dto.flow.MemberReqDTO; |
| | | import com.yami.shop.bean.model.CdnUserWallet; |
| | | import com.yami.shop.bean.model.User; |
| | | import com.yami.shop.bean.param.*; |
| | | import com.yami.shop.bean.vo.CdnUserAtlasVO; |
| | | import com.yami.shop.bean.vo.flow.MemberContributeValueVO; |
| | | import com.yami.shop.bean.vo.flow.MemberOverviewVO; |
| | | import com.yami.shop.common.util.PageAdapter; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author yami |
| | | */ |
| | | public interface UserMapper extends BaseMapper<User> { |
| | | |
| | | /** |
| | | * 通过第三方用户id获取对应客户端用户 |
| | | * |
| | | * @param appId |
| | | * @param bizUserId |
| | | * @return |
| | | */ |
| | | User getUserByBizUserId(@Param("appId") Integer appId, @Param("bizUserId") String bizUserId); |
| | | |
| | | /** |
| | | * 批量給对应等级的用户降低一个等级 |
| | | * |
| | | * @param level 等级 |
| | | * @param levelType 会员类型 |
| | | */ |
| | | void setUserLevelBylevelId(@Param("level") Integer level, @Param("levelType") Integer levelType); |
| | | |
| | | /** |
| | | * 获取截至日期之前的所有付费会员信息 |
| | | * |
| | | * @param endOfDay 截至日期 |
| | | * @return |
| | | */ |
| | | List<User> selectMemberByEndTime(@Param("endOfDay") DateTime endOfDay); |
| | | |
| | | /** |
| | | * 根据等级,设置用户用等级 |
| | | * |
| | | * @param level 等级 |
| | | * @param minNeedGrowth 最小需要的成长值 |
| | | * @param maxNeedGrowth 最大需要的成长值 |
| | | * @param levelType 会员类型 |
| | | */ |
| | | void setMaxUserLevelBylevelId(@Param("level") Integer level, @Param("minNeedGrowth") Integer minNeedGrowth, @Param("maxNeedGrowth") Integer maxNeedGrowth, @Param("levelType") Integer levelType); |
| | | |
| | | /** |
| | | * 修改用户等级 |
| | | * |
| | | * @param userList 需要更新的用户列表 |
| | | */ |
| | | void updateBatchById(@Param("userList") List<User> userList); |
| | | |
| | | /** |
| | | * 获取用户详情 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 用户 |
| | | */ |
| | | User getUserDetail(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 条件按查询,分页获取用户列表 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param user 查询条件 |
| | | * @return 分页用户列表 |
| | | */ |
| | | IPage<User> getUserPage(PageParam<User> page, @Param("user") User user); |
| | | |
| | | /** |
| | | * 获取用户id和用户注册时间 |
| | | * |
| | | * @param userSet 用户列表 |
| | | * @return 用户列表 |
| | | */ |
| | | List<User> getUserListByUserNumbers(@Param("userSet") Set<String> userSet); |
| | | |
| | | /** |
| | | * 根据参数,统计用户数量 |
| | | * |
| | | * @param param 参数 |
| | | * @return 数量 |
| | | */ |
| | | Integer countUserByParam(@Param("param") CustomerReqParam param); |
| | | |
| | | /** |
| | | * 根据参数,统计会员数量 |
| | | * |
| | | * @param param 条件参数 |
| | | * @return 数量 |
| | | */ |
| | | Integer countMemberByParam(@Param("param") CustomerReqParam param); |
| | | |
| | | /** |
| | | * 根据参数,统计用户数量 |
| | | * |
| | | * @param param 条件参数 |
| | | * @return 数量 |
| | | */ |
| | | Integer countUserNums(@Param("param") CustomerReqParam param); |
| | | |
| | | /** |
| | | * 条件查询,分页获取会员信息列表 |
| | | * |
| | | * @param adapter 分页参数 |
| | | * @param param 条件查询参数 |
| | | * @return 会员信息列表 |
| | | */ |
| | | List<UserManagerParam> getUserPageByParam(@Param("adapter") PageAdapter adapter, @Param("param") UserManagerReqParam param); |
| | | |
| | | /** |
| | | * 根据参数,统计查询到的会员总数 |
| | | * |
| | | * @param adapter 分页参数 |
| | | * @param param 条件查询参数 |
| | | * @return 数量 |
| | | */ |
| | | Integer countGetUserPageByParam(@Param("adapter") PageAdapter adapter, @Param("param") UserManagerReqParam param); |
| | | |
| | | /** |
| | | * 品牌/门店端分页查询客户列表 |
| | | * @param page |
| | | * @param reqParam |
| | | * @return |
| | | */ |
| | | IPage<CustomerManagerParam> pageCustomerByMultiShop(PageParam<CustomerManagerParam> page, @Param("reqParam") CustomerManagerParam reqParam); |
| | | |
| | | |
| | | /** |
| | | * 条件查询,分页获取会员信息列表 |
| | | * |
| | | * @param adapter 分页参数 |
| | | * @param param 条件查询参数 |
| | | * @return 会员信息列表 |
| | | */ |
| | | List<UserManagerParam> getUserPageAdapterByParam(@Param("adapter") PageAdapter adapter, @Param("param") UserManagerReqParam param); |
| | | |
| | | /** |
| | | * 获取单个用户详情 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 用户信息 |
| | | */ |
| | | UserManagerParam getuserInfo(@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 根据多个手机号获取对应的用户 |
| | | * |
| | | * @param phones 手机号集合 |
| | | * @return 用户列表 |
| | | */ |
| | | List<User> listByUserPhones(@Param("phones") List<String> phones); |
| | | |
| | | /** |
| | | * 根据多个邮箱获取对应的用户 |
| | | * |
| | | * @param mails 邮箱集合 |
| | | * @return 用户列表 |
| | | */ |
| | | List<User> listByUserMails(@Param("mails") List<String> mails); |
| | | |
| | | /** |
| | | * 根据用户名查询用户信息(区分用户名大小写) |
| | | * |
| | | * @param userName |
| | | * @return |
| | | */ |
| | | User selectOneByUserName(@Param("userName") String userName); |
| | | |
| | | /** |
| | | * 根据用户名统计用户数据 |
| | | * |
| | | * @param userName |
| | | * @return |
| | | */ |
| | | Integer selectCountByUserName(@Param("userName") String userName); |
| | | |
| | | /** |
| | | * 根据时间统计数据 |
| | | * |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param levelType 等级 |
| | | * @return |
| | | */ |
| | | List<CustomerPayParam> countUserByMemberParam(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("levelType") Integer levelType); |
| | | |
| | | MemberOverviewVO getMemberAnalysisByParam(@Param("param") MemberReqDTO param); |
| | | |
| | | Integer getMemberTrend(@Param("param") MemberReqDTO param); |
| | | |
| | | |
| | | MemberContributeValueVO getMemberContributeValue(@Param("param") MemberReqDTO param, @Param("userLevelType") Integer userLevelType); |
| | | |
| | | /** |
| | | * 获取所有用户id |
| | | * @return |
| | | */ |
| | | List<String> getUserIdList(); |
| | | |
| | | /** |
| | | * 根据userIds获取用户列表 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<User> getUserByUserIds(@Param("ids") List<String> ids); |
| | | |
| | | /** |
| | | * 店铺获取客户其他信息 |
| | | * @param userIds |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | List<CustomerManagerParam> listCustomerOtherDataByMultiShop(@Param("userIds") List<String> userIds, @Param("shopId") Long shopId); |
| | | |
| | | /** |
| | | * 根据淘宝渠道Id和用户Id查询用户 |
| | | * @param relationId |
| | | * @param specialId |
| | | * @return |
| | | */ |
| | | User getRelationAndSpecialId(@Param("relationId")String relationId, @Param("specialId") String specialId); |
| | | |
| | | /** |
| | | * 查询最大Id数 |
| | | * @return |
| | | */ |
| | | String selectMaxId(); |
| | | |
| | | /** |
| | | * 查询所有会员 |
| | | * @return |
| | | */ |
| | | List<CdnUserAtlasVO> getAllAtlas(@Param("nickName") String nickName, @Param("userId") String userId , @Param("userMobile") String userMobile); |
| | | |
| | | /** |
| | | * 查询下级人员 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<CdnUserAtlasVO> findRelationsByUserId(String userId); |
| | | |
| | | CdnTeamUserParam getMyTeamDownLevel(String userId); |
| | | |
| | | /** |
| | | * 查询所有父级用户 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | String getAllParentByUserId(String userId); |
| | | |
| | | /** |
| | | * 根据userId查询推荐人信息 |
| | | * @param split |
| | | * @return |
| | | */ |
| | | List<CdnUserAtlasVO> getAllInUserId(String[] split); |
| | | |
| | | List<CdnUserAtlasVO> getAllNoPidAtlas(@Param("uid") String uid, |
| | | @Param("nickName") String nickName, |
| | | @Param("userId") String userId, |
| | | @Param("userMobile") String userMobile); |
| | | |
| | | CdnUserWallet selectUserInfo(@Param("userId") String userId, |
| | | @Param("walletId") Integer walletId); |
| | | |
| | | Integer getctiveStatusCount(@Param("user") User user); |
| | | } |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.V1BoxIncome; |
| | | import com.yami.shop.bean.param.CdnIncomeParam; |
| | | import com.yami.shop.bean.param.DeviceIncomeParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_v1_box_income(盒子收益表)】的数据库操作Mapper |
| | | * @createDate 2024-07-13 16:51:32 |
| | | * @Entity com.yami.shop.task.common.model.V1BoxIncome |
| | | */ |
| | | public interface V1BoxIncomeMapper extends BaseMapper<V1BoxIncome> { |
| | | |
| | | CdnIncomeParam selectIncomeByDate(@Param("userId") String userId, |
| | | @Param("startDate") String startDate, |
| | | @Param("endDate") String endDate); |
| | | |
| | | DeviceIncomeParam selectIncomeByCode(String deviceCode); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.V1Box; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_v1_box(cdn盒子)】的数据库操作Mapper |
| | | * @createDate 2024-06-26 17:24:37 |
| | | * @Entity com.yami.shop.cdn.common.domain.TzV1Box |
| | | */ |
| | | public interface V1BoxMapper extends BaseMapper<V1Box> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yami.shop.bean.model.WebConfig; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author SJL |
| | | * @date 2021-02-20 09:44:42 |
| | | */ |
| | | public interface WebConfigMapper extends BaseMapper<WebConfig> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.google.gson.Gson; |
| | | import com.yami.shop.bean.bo.BrandBO; |
| | | import com.yami.shop.bean.bo.CategoryBO; |
| | | import com.yami.shop.bean.bo.ProductBO; |
| | | import com.yami.shop.bean.enums.DeliveryType; |
| | | import com.yami.shop.bean.enums.EsOperationType; |
| | | import com.yami.shop.bean.enums.ProdStatusEnums; |
| | | import com.yami.shop.bean.enums.ShopStatus; |
| | | import com.yami.shop.bean.event.EsProductEvent; |
| | | import com.yami.shop.bean.model.*; |
| | | import com.yami.shop.bean.order.EsProductOrder; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.common.enums.StatusEnum; |
| | | import com.yami.shop.common.i18n.LanguageEnum; |
| | | import com.yami.shop.common.util.Arith; |
| | | import com.yami.shop.dao.*; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 获取es商品数据事件 |
| | | * |
| | | * @author yami |
| | | */ |
| | | @Component("defaultEsProductListener") |
| | | @Slf4j |
| | | @AllArgsConstructor |
| | | public class EsProductListener { |
| | | |
| | | private final ProductMapper productMapper; |
| | | private final ProdCommMapper prodCommMapper; |
| | | private final CategoryMapper categoryMapper; |
| | | private final ShopDetailMapper shopDetailMapper; |
| | | private final BrandMapper brandMapper; |
| | | private final ProdExtensionMapper prodExtensionMapper; |
| | | |
| | | @EventListener(EsProductEvent.class) |
| | | @Order(EsProductOrder.DEFAULT) |
| | | public void defaultEsProductListener(EsProductEvent event) { |
| | | if (Objects.isNull(event.getOperationType())) { |
| | | listEsProductData(event); |
| | | } |
| | | // 商品销量和库存数据 |
| | | else if (Objects.equals(event.getOperationType(), EsOperationType.UPDATE_SOLD_NUM)) { |
| | | List<ProductBO> productList = productMapper.listEsProdSoldAndStock(event.getProdIds()); |
| | | for (ProductBO productBO : productList) { |
| | | // 统计商品销量 |
| | | statisticsStock(productBO); |
| | | } |
| | | event.getProductList().addAll(productList); |
| | | } |
| | | // 商品 |
| | | else if (Objects.equals(event.getOperationType(), EsOperationType.UPDATE_PROD_COMM)) { |
| | | for (Long prodId : event.getProdIds()) { |
| | | ProductBO productBO = new ProductBO(); |
| | | productBO.setProdId(prodId); |
| | | event.getProductList().add(productBO); |
| | | } |
| | | // 商品评论 |
| | | loadProdComm(event.getProdIds(), event.getProductList()); |
| | | } |
| | | } |
| | | |
| | | private void listEsProductData(EsProductEvent event) { |
| | | // 商品信息 |
| | | List<ProductBO> productList = productMapper.getProductBO(event.getProdIds()); |
| | | if (CollUtil.isEmpty(productList)) { |
| | | return; |
| | | } |
| | | event.getProductList().addAll(productList); |
| | | Set<Long> prodIds = new HashSet<>(); |
| | | Set<Long> categoryIds = new HashSet<>(); |
| | | List<Long> shopIds = new ArrayList<>(); |
| | | List<Long> brandIds = new ArrayList<>(); |
| | | for (ProductBO productBO : productList) { |
| | | prodIds.add(productBO.getProdId()); |
| | | categoryIds.add(productBO.getCategoryId()); |
| | | categoryIds.add(productBO.getShopCategoryId()); |
| | | shopIds.add(productBO.getShopId()); |
| | | if (Objects.nonNull(productBO.getBrandId()) && productBO.getBrandId() > 0) { |
| | | brandIds.add(productBO.getBrandId()); |
| | | } |
| | | } |
| | | // 商品评论 |
| | | loadProdComm(event.getProdIds(), productList); |
| | | // 商品分类信息 |
| | | List<Category> categories = categoryMapper.listAndParentByIds(categoryIds); |
| | | Map<Long, Category> categoryMap = categories.stream().collect(Collectors.toMap(Category::getCategoryId, c -> c)); |
| | | // 商品店铺信息 |
| | | List<ShopDetail> shopDetails = shopDetailMapper.selectList(new LambdaQueryWrapper<ShopDetail>().in(ShopDetail::getShopId, shopIds)); |
| | | Map<Long, ShopDetail> shopMap = shopDetails.stream().collect(Collectors.toMap(ShopDetail::getShopId, s -> s)); |
| | | // 商品品牌信息 |
| | | Map<Long, Brand> brandMap; |
| | | if (CollUtil.isEmpty(brandIds)) { |
| | | brandMap = new HashMap<>(0); |
| | | } else { |
| | | List<Brand> brands = brandMapper.listAndLang(brandIds); |
| | | brandMap = brands.stream().collect(Collectors.toMap(Brand::getBrandId, b -> b)); |
| | | } |
| | | // 商品数据合并 |
| | | handEsProductData(productList, categoryMap, shopMap, brandMap); |
| | | } |
| | | |
| | | private void handEsProductData(List<ProductBO> productList, Map<Long, Category> categoryMap, Map<Long, ShopDetail> shopMap, Map<Long, Brand> brandMap) { |
| | | for (ProductBO productBO : productList) { |
| | | try{ |
| | | productBO.setHasStock(Boolean.TRUE); |
| | | if (Objects.isNull(productBO.getTotalStocks()) || Objects.equals(productBO.getTotalStocks(), 0)) { |
| | | productBO.setHasStock(Boolean.FALSE); |
| | | } |
| | | productBO.setAppDisplay(Boolean.TRUE); |
| | | // 插入商品分类信息 |
| | | loadProdCategory(productBO, categoryMap); |
| | | // 插入商品店铺信息 |
| | | ShopDetail shopDetail = shopMap.get(productBO.getShopId()); |
| | | if (Objects.nonNull(shopDetail)) { |
| | | productBO.setShopName(shopDetail.getShopName()); |
| | | productBO.setShopType(shopDetail.getType()); |
| | | if (productBO.getAppDisplay() && !Objects.equals(shopDetail.getShopStatus(), ShopStatus.OPEN.value())) { |
| | | productBO.setAppDisplay(Boolean.FALSE); |
| | | } |
| | | } else if (Objects.equals(productBO.getShopId(), Constant.PLATFORM_SHOP_ID)) { |
| | | productBO.setShopName(Constant.PLATFORM_SHOP_NAME); |
| | | productBO.setShopType(1); |
| | | } else { |
| | | productBO.setAppDisplay(Boolean.FALSE); |
| | | log.error("商品数据异常(prodId:{})-店铺(shopId:{})不存在", productBO.getProdId(), productBO.getShopId()); |
| | | } |
| | | // 插入商品品牌信息 |
| | | if (Objects.nonNull(productBO.getBrandId()) && !Objects.equals(productBO.getBrandId(), Constant.ZERO_LONG) && brandMap.containsKey(productBO.getBrandId())) { |
| | | Brand brand = brandMap.get(productBO.getBrandId()); |
| | | BrandBO brandBO = new BrandBO(); |
| | | brandBO.setBrandId(brand.getBrandId()); |
| | | brandBO.setBrandImg(brand.getImgUrl()); |
| | | brandBO.setBrandNameZh(getBrandName(LanguageEnum.LANGUAGE_ZH_CN, brand.getBrandLangList())); |
| | | brandBO.setBrandNameEn(getBrandName(LanguageEnum.LANGUAGE_EN, brand.getBrandLangList())); |
| | | productBO.setBrand(brandBO); |
| | | } |
| | | // 商品数据处理 |
| | | loadProdData(productBO); |
| | | } catch (Exception e) { |
| | | log.error("商品数据异常:{}", productBO); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void loadProdComm(List<Long> prodIds, List<ProductBO> productList) { |
| | | List<ProdComm> prodCommList = prodCommMapper.countProdCommNum(prodIds); |
| | | Map<Long, ProdComm> prodCommMap = prodCommList.stream().collect(Collectors.toMap(ProdComm::getProdId, p -> p)); |
| | | for (ProductBO productBO : productList) { |
| | | ProdComm prodComm = prodCommMap.get(productBO.getProdId()); |
| | | if (Objects.nonNull(prodComm)){ |
| | | // 插入商品评论数量 |
| | | int prodCommNum = Objects.nonNull(prodComm.getProdCommNum()) ? prodComm.getProdCommNum() : 0; |
| | | productBO.setCommentNum(prodCommNum); |
| | | // 插入商品好评率 |
| | | int goodCommNum = Objects.nonNull(prodComm.getGoodCommNum()) ? prodComm.getGoodCommNum() : 0; |
| | | if (prodCommNum == 0 || goodCommNum == 0) { |
| | | productBO.setPositiveRating(0.0); |
| | | } else { |
| | | productBO.setPositiveRating(Arith.div(Arith.mul(goodCommNum, 100), prodCommNum, 2)); |
| | | } |
| | | } else { |
| | | productBO.setCommentNum(0); |
| | | productBO.setPositiveRating(0.0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private String getBrandName(LanguageEnum languageEnum, List<BrandLang> brandLangs) { |
| | | Map<Integer, String> langMap = brandLangs.stream().collect(Collectors.toMap(BrandLang::getLang, BrandLang::getName)); |
| | | if (langMap.containsKey(languageEnum.getLang())) { |
| | | return langMap.get(languageEnum.getLang()); |
| | | } |
| | | return langMap.get(Constant.DEFAULT_LANG); |
| | | } |
| | | |
| | | private void loadProdData(ProductBO productBO) { |
| | | // 统计商品销量 |
| | | statisticsStock(productBO); |
| | | |
| | | // 商品名称 |
| | | if (Objects.isNull(productBO.getProdNameZh()) && Objects.isNull(productBO.getProdNameEn()) && Objects.nonNull(productBO.getProdName())) { |
| | | productBO.setProdNameZh(productBO.getProdName()); |
| | | productBO.setProdNameEn(productBO.getProdName()); |
| | | productBO.setBriefZh(productBO.getBrief()); |
| | | productBO.setBriefEn(productBO.getBrief()); |
| | | |
| | | } |
| | | // 配送方式 |
| | | Gson gson = new Gson(); |
| | | Product.DeliveryModeVO deliveryModeVO = gson.fromJson(productBO.getDeliveryMode(), Product.DeliveryModeVO.class); |
| | | List<Integer> deliveries = new ArrayList<>(); |
| | | if (Objects.nonNull(deliveryModeVO.getHasCityDelivery()) && deliveryModeVO.getHasCityDelivery()) { |
| | | // 同城配送 |
| | | deliveries.add(DeliveryType.SAME_CITY.getValue()); |
| | | } |
| | | if (Objects.nonNull(deliveryModeVO.getHasShopDelivery()) && deliveryModeVO.getHasShopDelivery()) { |
| | | // 店铺配送 |
| | | deliveries.add(DeliveryType.EXPRESS.getValue()); |
| | | } |
| | | if (Objects.nonNull(deliveryModeVO.getHasUserPickUp()) && deliveryModeVO.getHasUserPickUp()) { |
| | | // 用户自提 |
| | | deliveries.add(DeliveryType.STATION.getValue()); |
| | | } |
| | | productBO.setDeliveries(deliveries); |
| | | |
| | | if (productBO.getAppDisplay() && !Objects.equals(productBO.getStatus(), ProdStatusEnums.NORMAL.getValue())) { |
| | | productBO.setAppDisplay(Boolean.FALSE); |
| | | } |
| | | // 此字段不需要保存到es中( |
| | | productBO.setCategoryId(null); |
| | | productBO.setProdName(null); |
| | | productBO.setBrief(null); |
| | | } |
| | | |
| | | private void statisticsStock(ProductBO productBO) { |
| | | // 销量统计 |
| | | if (Objects.isNull(productBO.getWaterSoldNum())) { |
| | | productBO.setWaterSoldNum(0); |
| | | } |
| | | if (Objects.isNull(productBO.getActualSoldNum())) { |
| | | productBO.setActualSoldNum(0); |
| | | } |
| | | productBO.setSoldNum(productBO.getActualSoldNum() + productBO.getWaterSoldNum()); |
| | | } |
| | | |
| | | private void loadProdCategory(ProductBO productBO, Map<Long, Category> categoryMap) { |
| | | // 平台分类信息 |
| | | Category category = categoryMap.get(productBO.getCategoryId()); |
| | | CategoryBO categoryBO = new CategoryBO(); |
| | | if (Objects.isNull(category)) { |
| | | log.error("商品数据异常(prodId:{})-平台分类(category:{})不存在", productBO.getProdId(), productBO.getCategoryId()); |
| | | return; |
| | | } |
| | | categoryBO.setCategoryId(category.getCategoryId()); |
| | | categoryBO.setCategoryNameEn(category.getCategoryName()); |
| | | categoryBO.setCategoryNameEn(category.getCategoryNameEn()); |
| | | if (productBO.getAppDisplay() && !Objects.equals(category.getStatus(), StatusEnum.ENABLE.value())) { |
| | | productBO.setAppDisplay(Boolean.FALSE); |
| | | } |
| | | productBO.setCategory(categoryBO); |
| | | if (!categoryMap.containsKey(category.getParentId())) { |
| | | return; |
| | | } |
| | | Category secondaryCategory = categoryMap.get(category.getParentId()); |
| | | productBO.setSecondaryCategoryId(secondaryCategory.getCategoryId()); |
| | | if (!categoryMap.containsKey(secondaryCategory.getParentId())) { |
| | | return; |
| | | } |
| | | Category primaryCategory = categoryMap.get(secondaryCategory.getParentId()); |
| | | productBO.setPrimaryCategoryId(primaryCategory.getCategoryId()); |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | import com.yami.shop.common.bean.SensitiveWord; |
| | | import com.yami.shop.common.bean.event.GetSensitiveWordEvent; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.service.SysConfigService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * @author Citrus |
| | | * @date 2021/8/17 14:19 |
| | | */ |
| | | @Component("getSensitiveWordListener") |
| | | @AllArgsConstructor |
| | | public class GetSensitiveWordListener { |
| | | |
| | | private final SysConfigService sysConfigService; |
| | | |
| | | /** |
| | | * 获取敏感词配置 |
| | | */ |
| | | @EventListener(GetSensitiveWordEvent.class) |
| | | public void getSensitiveWordListener(GetSensitiveWordEvent event) { |
| | | SensitiveWord sensitiveWord = event.getSensitiveWord(); |
| | | SensitiveWord s = sysConfigService.getSysConfigObject(Constant.SENSITIVE_WORDS, SensitiveWord.class); |
| | | sensitiveWord.setSensitiveWord(s.getSensitiveWord()); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | import com.yami.shop.bean.enums.OrderType; |
| | | import com.yami.shop.bean.event.OrderSettlementEvent; |
| | | import com.yami.shop.bean.event.RefundSuccessSettlementEvent; |
| | | import com.yami.shop.bean.order.ConfirmOrderOrder; |
| | | import com.yami.shop.service.ShopWalletService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | |
| | | /** |
| | | * 确认收货的事件 |
| | | * @author yami |
| | | */ |
| | | @Slf4j |
| | | @Component("orderSettlementShopListener") |
| | | @AllArgsConstructor |
| | | public class OrderSettlementListener { |
| | | |
| | | private final ShopWalletService shopWalletService; |
| | | |
| | | /** |
| | | * 订单确认收货后过了维权期的订单结算操作 |
| | | * @param event |
| | | */ |
| | | @EventListener(OrderSettlementEvent.class) |
| | | @Order(ConfirmOrderOrder.DEFAULT) |
| | | public void defaultSettlementOrderEvent(OrderSettlementEvent event) { |
| | | for (com.yami.shop.bean.model.Order order : event.getOrder()) { |
| | | //如果是积分订单无需操作 |
| | | if(Objects.equals(order.getOrderType() , OrderType.SCORE.value())){ |
| | | continue; |
| | | } |
| | | shopWalletService.addAmountBySettledOrder(order.getOrderNumber()); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 部分退款且订单关闭的情况下的订单结算操作 |
| | | * @param event |
| | | */ |
| | | @EventListener(RefundSuccessSettlementEvent.class) |
| | | @Order(ConfirmOrderOrder.DEFAULT) |
| | | public void refundSuccessSettlementOrderEvent(RefundSuccessSettlementEvent event) { |
| | | shopWalletService.settlementShopAmountByRefund(event.getOrderChangeShopWalletAmountBO()); |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | import com.yami.shop.bean.event.PayManagerEvent; |
| | | import com.yami.shop.manager.impl.PayManager; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 失效支付二维码 |
| | | * @author yami |
| | | */ |
| | | @Slf4j |
| | | @Component("PayManagerListener") |
| | | @AllArgsConstructor |
| | | public class PayManagerListener { |
| | | |
| | | private final PayManager payManager; |
| | | |
| | | |
| | | @EventListener(PayManagerEvent.class) |
| | | public void cancelOrderQrCode(PayManagerEvent event) { |
| | | try { |
| | | payManager.cancelOrderQrCode(event.getFilterPayInfo()); |
| | | } catch (Exception e) { |
| | | log.error("失效支付二维码失败:", e); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.yami.shop.bean.enums.EsOperationType; |
| | | import com.yami.shop.bean.event.EsProductUpdateEvent; |
| | | import com.yami.shop.bean.event.PaySuccessOrderEvent; |
| | | import com.yami.shop.bean.event.PaySuccessScoreOrderEvent; |
| | | import com.yami.shop.bean.model.OrderItem; |
| | | import com.yami.shop.bean.order.PaySuccessOrderOrder; |
| | | import com.yami.shop.bean.vo.EsProdUpdateVO; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.dao.ProdExtensionMapper; |
| | | import com.yami.shop.dao.ProductMapper; |
| | | import com.yami.shop.service.ShopWalletService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 支付成功回调 |
| | | * |
| | | * @author LGH |
| | | */ |
| | | @Component("defaultPaySuccessListener") |
| | | @AllArgsConstructor |
| | | @Slf4j |
| | | public class PaySuccessOrderListener { |
| | | |
| | | private final ShopWalletService shopWalletService; |
| | | private final ProdExtensionMapper prodExtensionMapper; |
| | | private final ApplicationEventPublisher eventPublisher; |
| | | |
| | | @EventListener(PaySuccessOrderEvent.class) |
| | | @Order(PaySuccessOrderOrder.SHOP_BILLING) |
| | | public void shopPaySuccessListener(PaySuccessOrderEvent event) { |
| | | List<com.yami.shop.bean.model.Order> orders = event.getOrders(); |
| | | // 如果是积分订单,直接退出 |
| | | if(Objects.equals(orders.get(0).getShopId(),Constant.PLATFORM_SHOP_ID)){ |
| | | return; |
| | | } |
| | | // 进行分账,添加一个分账记录表,因为每一个订单进行分完帐后要进行退款,那么退款的时候也应该按照下单的时候的分账比例进行原路返回 |
| | | shopWalletService.addAmountByOrder(orders); |
| | | // 更新商品销量 |
| | | prodExtensionMapper.updateSoldNum(event.getAllOrderItems()); |
| | | |
| | | |
| | | // 更新es中的商品销量 |
| | | try { |
| | | // 获取商品的销量 |
| | | Map<Long, EsProdUpdateVO> map = new HashMap<>(); |
| | | for (com.yami.shop.bean.model.Order order : orders) { |
| | | for (OrderItem orderItem : order.getOrderItems()) { |
| | | EsProdUpdateVO esProdUpdateVO = map.get(orderItem.getProdId()); |
| | | if (Objects.isNull(esProdUpdateVO)) { |
| | | esProdUpdateVO = new EsProdUpdateVO(); |
| | | esProdUpdateVO.setProdId(orderItem.getProdId()); |
| | | // 增加销量 |
| | | esProdUpdateVO.setType(1); |
| | | esProdUpdateVO.setCount(0); |
| | | map.put(orderItem.getProdId(), esProdUpdateVO); |
| | | } |
| | | esProdUpdateVO.setCount(esProdUpdateVO.getCount() + orderItem.getProdCount()); |
| | | } |
| | | } |
| | | eventPublisher.publishEvent(new EsProductUpdateEvent(new ArrayList<>(map.values()), EsOperationType.UPDATE_ORDER_SOLD_NUM_BATCH)); |
| | | } catch (Exception e) { |
| | | log.error("订单支付成功-更新es商品销量失败,错误为:{}", e); |
| | | } |
| | | } |
| | | |
| | | @EventListener(PaySuccessScoreOrderEvent.class) |
| | | @Order(PaySuccessOrderOrder.SHOP_BILLING) |
| | | public void shopPaySuccessListener(PaySuccessScoreOrderEvent event) { |
| | | com.yami.shop.bean.model.Order order = event.getOrder(); |
| | | // 进行平台分账,添加一个分账记录表 |
| | | shopWalletService.addAmountByScoreOrder(order); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | import com.yami.shop.bean.event.RefundInfoEvent; |
| | | import com.yami.shop.bean.model.RefundInfo; |
| | | import com.yami.shop.service.OrderRefundService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 退款事件 |
| | | * @author yami |
| | | */ |
| | | @Slf4j |
| | | @Component("RefundInfoListener") |
| | | @AllArgsConstructor |
| | | public class RefundInfoListener { |
| | | |
| | | private final OrderRefundService orderRefundService; |
| | | |
| | | |
| | | @EventListener(RefundInfoEvent.class) |
| | | public void cancelOrderQrCode(RefundInfoEvent event) { |
| | | RefundInfo refundInfo = event.getRefundInfo(); |
| | | orderRefundService.verifyRefund(refundInfo, refundInfo.getPayRefundId()); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.yami.shop.bean.enums.RemindStatusEnum; |
| | | import com.yami.shop.bean.enums.RemindType; |
| | | import com.yami.shop.bean.enums.SendType; |
| | | import com.yami.shop.bean.event.SendMessageEvent; |
| | | import com.yami.shop.bean.model.*; |
| | | import com.yami.shop.bean.param.NotifyTemplateParam; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.common.util.Json; |
| | | import com.yami.shop.service.*; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | |
| | | |
| | | /** |
| | | * 统一发送通知的事件 |
| | | * |
| | | * @author yami |
| | | */ |
| | | @Slf4j |
| | | @Component("sendMessageListener") |
| | | @AllArgsConstructor |
| | | public class SendMessageListener { |
| | | |
| | | private final NotifyLogService notifyLogService; |
| | | |
| | | private final NotifyTemplateService notifyTemplateService; |
| | | |
| | | private final ShopDetailService shopDetailService; |
| | | |
| | | private final ProductService productService; |
| | | |
| | | |
| | | private final UserService userService; |
| | | private final NotifyTemplateRemindService notifyTemplateRemindService; |
| | | |
| | | @EventListener(SendMessageEvent.class) |
| | | public void sendMsgEvent(SendMessageEvent event) { |
| | | NotifyTemplateParam param = event.getParam(); |
| | | if (Objects.isNull(param)) { |
| | | return; |
| | | } |
| | | ShopDetail shopDetail = shopDetailService.getById(param.getShopId()); |
| | | //获取模板的发送方式,获取商家选择的发送方式 |
| | | NotifyTemplate template = notifyTemplateService.getOne(new LambdaQueryWrapper<NotifyTemplate>().eq(NotifyTemplate::getSendType, param.getSendType())); |
| | | if (Objects.isNull(template) || Objects.isNull(shopDetail)) { |
| | | return; |
| | | } |
| | | //是否开启消息提醒 |
| | | Boolean notifyLogStatus = false; |
| | | NotifyTemplateRemind notifyTemplateRemind = notifyTemplateRemindService.getOne(new LambdaQueryWrapper<NotifyTemplateRemind>() |
| | | .eq(NotifyTemplateRemind::getTemplateId, template.getTemplateId()) |
| | | .eq(NotifyTemplateRemind::getShopId, shopDetail.getShopId()) |
| | | ); |
| | | //关闭消息提醒 则生不成消息记录 |
| | | if(Objects.nonNull(notifyTemplateRemind) && Objects.equals(notifyTemplateRemind.getIsRemind(), RemindStatusEnum.CLOSED.value())){ |
| | | notifyLogStatus = true; |
| | | } |
| | | String shopName = Objects.isNull(shopDetail.getShopName()) ? "商城" : shopDetail.getShopName(); |
| | | param.setShopName(shopName); |
| | | // 截取字符串,处理过长商品名称 |
| | | if (StrUtil.isNotBlank(param.getProdName())) { |
| | | if (Objects.equals(param.getProdName().substring(param.getProdName().length()-1),StrUtil.SPACE)){ |
| | | param.setProdName(param.getProdName().substring(0, Math.min(14, param.getProdName().length() - 1)) + "等商品"); |
| | | } else { |
| | | param.setProdName(param.getProdName().substring(0, Math.min(14, param.getProdName().length())) + "等商品"); |
| | | } |
| | | |
| | | } |
| | | param.setGroupCount(Objects.isNull(param.getGroupCount()) ? 0 : param.getGroupCount()); |
| | | param.setPrice(Objects.isNull(param.getPrice()) ? 0.0 : param.getPrice()); |
| | | param.setPayType(Objects.isNull(param.getPayType()) ? 1 : param.getPayType()); |
| | | param.setDvyTime(Objects.isNull(param.getDvyTime()) ? new Date() : param.getDvyTime()); |
| | | param.setProdName(Objects.isNull(param.getProdName()) ? null : param.getProdName()); |
| | | String openId = ""; |
| | | if (StrUtil.isNotBlank(param.getUserId())) { |
| | | // 截取字符串,处理过长名称 |
| | | User user = userService.getUserDetail(param.getUserId()); |
| | | if (Objects.nonNull(user)) { |
| | | if (CollectionUtils.isNotEmpty(user.getBizUserIdList())) { |
| | | openId = user.getBizUserIdList().get(0); |
| | | } |
| | | param.setNickName(user.getNickName().substring(0, Math.min(19, user.getNickName().length()))); |
| | | } |
| | | } |
| | | param.setOpenId(openId); |
| | | // 设置平台的消息通知类型 |
| | | List<String> notifies = Arrays.asList(template.getTemplateTypes().split(StrUtil.COMMA)); |
| | | for (String notify : notifies) { |
| | | template.setSms(StrUtil.equals(notify, "1") || template.getSms()); |
| | | template.setSub(StrUtil.equals(notify,"2") || template.getSub()); |
| | | template.setApp(StrUtil.equals(notify,"3") || template.getApp()); |
| | | } |
| | | // 获取对应map |
| | | Map<String, String> smsParam = getSmsParam(param); |
| | | String content = replaceContent(smsParam, template.getMessage()); |
| | | // 保存的通知集合 |
| | | List<NotifyLog> notifyLogs = new ArrayList<>(); |
| | | if (template.getSms() && BooleanUtils.isFalse(notifyLogStatus)) { |
| | | SendType sendTypeEnum = SendType.instance(template.getSendType()); |
| | | if(Objects.nonNull(sendTypeEnum) && Objects.equals(sendTypeEnum.getType(),SendType.RECEIPT_ORDER.getType()) && StrUtil.isBlank(param.getUserMobile())){ |
| | | log.warn(shopDetail.getShopName() +"店铺暂未配置接收通知的手机号,无法推送消息"); |
| | | return; |
| | | } |
| | | // Boolean isRead = smsLogService.sendMsgSms(template, param.getUser().getUserMobile(), smsParam); |
| | | // 替换消息内容 |
| | | addNotifyLog(param, content, template, false, RemindType.SMS.value(), notifyLogs,param.getOrderNumber()); |
| | | } |
| | | //站内消息 |
| | | if (template.getApp() && BooleanUtils.isFalse(notifyLogStatus)) { |
| | | addNotifyLog(param, content, template, notifyLogStatus, RemindType.MINI.value(), notifyLogs,param.getOrderNumber()); |
| | | } |
| | | // 公众号 |
| | | if (template.getSub() && StrUtil.isNotBlank(openId) && BooleanUtils.isFalse(notifyLogStatus)) { |
| | | addNotifyLog(param, content, template, false, RemindType.MP.value(), notifyLogs,param.getOrderNumber()); |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(notifyLogs)) { |
| | | notifyLogService.saveBatch(notifyLogs); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加消息 |
| | | * |
| | | * @param param 参数 |
| | | * @param content 消息内容 |
| | | * @param template 模板 |
| | | * @param isRead 阅读状态 |
| | | * @param value 发送类型 |
| | | * @param notifyLogs 消息集合 |
| | | * @param orderNumber 订单号 |
| | | */ |
| | | private void addNotifyLog(NotifyTemplateParam param, String content, NotifyTemplate template, Boolean isRead, Integer value, List<NotifyLog> notifyLogs,String orderNumber) { |
| | | NotifyLog notifyLog = new NotifyLog(); |
| | | notifyLog.setCreateTime(new Date()); |
| | | notifyLog.setShopId(param.getShopId()); |
| | | // 如果大于则为店铺自行接收的消息 |
| | | if (param.getSendType() >= 100) { |
| | | notifyLog.setRemindId(param.getShopId().toString()); |
| | | } else { |
| | | notifyLog.setRemindId(param.getUserId()); |
| | | } |
| | | notifyLog.setSendType(param.getSendType()); |
| | | notifyLog.setMessage(content); |
| | | notifyLog.setNickName(param.getNickName()); |
| | | notifyLog.setUserMobile(param.getUserMobile()); |
| | | notifyLog.setRemindType(value); |
| | | notifyLog.setTemplateId(template.getTemplateId()); |
| | | notifyLog.setStatus(isRead ? 1 : 0); |
| | | notifyLog.setOrderNumber(orderNumber); |
| | | notifyLog.setParamContent(Json.toJsonString(param)); |
| | | notifyLog.setProdName(Objects.isNull(param.getProdName()) ? null : param.getProdName()); |
| | | notifyLog.setActivityName(Objects.isNull(param.getActivityName()) ? null : param.getActivityName()); |
| | | notifyLogs.add(notifyLog); |
| | | |
| | | } |
| | | |
| | | |
| | | private Map<String, String> getSmsParam(NotifyTemplateParam param) { |
| | | Map<String, String> smsParam = new HashMap<>(20); |
| | | smsParam.put("orderNumber", param.getOrderNumber()); |
| | | smsParam.put("shopName", param.getShopName()); |
| | | smsParam.put("prodName", param.getProdName()); |
| | | smsParam.put("activityName", param.getActivityName()); |
| | | if (StrUtil.isBlank(param.getNickName())) { |
| | | smsParam.put("nickName", "用户"); |
| | | } else { |
| | | smsParam.put("nickName", param.getNickName()); |
| | | } |
| | | smsParam.put("levelName", param.getLevelName()); |
| | | smsParam.put("cancelTime", param.getCancelTime()); |
| | | smsParam.put("price", String.valueOf(param.getPrice())); |
| | | smsParam.put("dvyFlowId", param.getDvyFlowId()); |
| | | smsParam.put("stationName", param.getStationName()); |
| | | smsParam.put("dvyName", param.getDvyName()); |
| | | smsParam.put("dvyTime", DateUtil.format(param.getDvyTime(), |
| | | DatePattern.NORM_DATETIME_PATTERN)); |
| | | smsParam.put("day", String.valueOf(Constant.MAX_REFUND_APPLY_TIME)); |
| | | smsParam.put("hour", param.getHour().toString()); |
| | | smsParam.put("date", DateUtil.format(param.getDvyTime(), |
| | | DatePattern.NORM_DATETIME_PATTERN)); |
| | | return smsParam; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 短信内容替换 |
| | | * |
| | | * @param maps 替换内容 |
| | | */ |
| | | private String replaceContent(Map<String, String> maps, String content) { |
| | | for (Map.Entry<String, String> element : maps.entrySet()) { |
| | | if (StrUtil.isNotBlank(element.getValue())) { |
| | | content = content.replace("${" + element.getKey() + "}", element.getValue()); |
| | | } |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yami.shop.bean.enums.AuditStatus; |
| | | import com.yami.shop.bean.enums.ShopStatus; |
| | | import com.yami.shop.bean.event.ShopApplyEvent; |
| | | import com.yami.shop.bean.model.ShopAuditing; |
| | | import com.yami.shop.bean.model.ShopDetail; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.service.ShopAuditingService; |
| | | import com.yami.shop.service.ShopDetailService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @Author lth |
| | | * @Date 2021/8/4 9:27 |
| | | */ |
| | | @Component("ShopApply") |
| | | @AllArgsConstructor |
| | | public class ShopApplyListener { |
| | | |
| | | private final ShopDetailService shopDetailService; |
| | | private final ShopAuditingService shopAuditingService; |
| | | |
| | | @EventListener(ShopApplyEvent.class) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void apply(ShopApplyEvent event) { |
| | | Long shopId = event.getShopId(); |
| | | Long employeeId = event.getEmployeeId(); |
| | | Date now = new Date(); |
| | | ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(shopId); |
| | | // if (Objects.equals(shopDetail.getShopStatus(), ShopStatus.OPEN_AWAIT_AUDIT.value())) { |
| | | // throw new YamiShopBindException("店铺审核中,请不要重复提交"); |
| | | // } |
| | | if (Objects.equals(shopDetail.getShopStatus(), ShopStatus.OPEN.value())) { |
| | | throw new YamiShopBindException("店铺状态已发生变化,请刷新后重试"); |
| | | } |
| | | ShopAuditing oldAuditing = shopAuditingService.getOne(Wrappers.lambdaQuery(ShopAuditing.class).eq(ShopAuditing::getShopId, shopId)); |
| | | ShopAuditing shopAuditing = new ShopAuditing(); |
| | | shopAuditing.setShopId(shopId); |
| | | shopAuditing.setUserId(event.getUserId()); |
| | | shopAuditing.setStatus(AuditStatus.WAITAUDIT.value()); |
| | | shopAuditing.setUpdateTime(now); |
| | | if (Objects.nonNull(oldAuditing)) { |
| | | shopAuditing.setShopAuditingId(oldAuditing.getShopAuditingId()); |
| | | shopAuditingService.updateById(shopAuditing); |
| | | } else { |
| | | shopAuditing.setCreateTime(now); |
| | | shopAuditingService.save(shopAuditing); |
| | | } |
| | | // 更新店铺状态为开店待审核 |
| | | shopDetailService.updateStatus(shopId, ShopStatus.OPEN_AWAIT_AUDIT.value()); |
| | | // 更新状态后要清除缓存 |
| | | shopDetailService.removeShopDetailCacheByShopId(shopId); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yami.shop.bean.enums.EsOperationType; |
| | | import com.yami.shop.bean.enums.ProdStatusEnums; |
| | | import com.yami.shop.bean.event.EsProductUpdateEvent; |
| | | import com.yami.shop.bean.event.ProdChangeStatusEvent; |
| | | import com.yami.shop.bean.event.SigningCategoryInvalidEvent; |
| | | import com.yami.shop.bean.model.Product; |
| | | import com.yami.shop.service.BasketService; |
| | | import com.yami.shop.service.ProductService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author lth |
| | | * @Date 2021/9/6 13:49 |
| | | */ |
| | | @Component("signingCategory") |
| | | @AllArgsConstructor |
| | | public class SigningCategoryListener { |
| | | |
| | | private final ProductService productService; |
| | | private final BasketService basketService; |
| | | private final ApplicationEventPublisher applicationEventPublisher; |
| | | |
| | | @EventListener(SigningCategoryInvalidEvent.class) |
| | | public void signingCategoryListener(SigningCategoryInvalidEvent event) { |
| | | Long shopId = event.getShopId(); |
| | | Long categoryId = event.getCategoryId(); |
| | | // 查询该店铺下使用了该分类并且处于上架状态的商品 |
| | | List<Product> productList = productService.list(Wrappers.lambdaQuery(Product.class).eq(Product::getShopId, shopId).eq(Product::getCategoryId, categoryId).eq(Product::getStatus, ProdStatusEnums.NORMAL.getValue())); |
| | | if (CollUtil.isEmpty(productList)) { |
| | | return; |
| | | } |
| | | List<Long> pIds = productList.stream().map(Product::getProdId).collect(Collectors.toList()); |
| | | // 下架商品 |
| | | productService.changeStatusByProdIds(pIds, ProdStatusEnums.SHOP_OFFLINE.getValue()); |
| | | // 清除商品缓存 |
| | | productService.removeProductCacheByProdIds(pIds); |
| | | // 清除购物车缓存 |
| | | List<String> userIds = basketService.listUserIdByProdIds(pIds); |
| | | basketService.removeCacheByUserIds(userIds); |
| | | for (Product product : productList) { |
| | | applicationEventPublisher.publishEvent(new ProdChangeStatusEvent(product, ProdStatusEnums.SHOP_OFFLINE.getValue())); |
| | | } |
| | | applicationEventPublisher.publishEvent(new EsProductUpdateEvent(null, pIds, EsOperationType.UPDATE_BATCH)); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.yami.shop.bean.enums.StockBillType; |
| | | import com.yami.shop.bean.event.StockBillChangeEvent; |
| | | import com.yami.shop.bean.model.StockBillLog; |
| | | import com.yami.shop.service.StockBillLogService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @Author lth |
| | | * @Date 2021/9/22 9:05 |
| | | */ |
| | | @Slf4j |
| | | @Component("StockBillChangeListener") |
| | | @AllArgsConstructor |
| | | public class StockBillChangeListener { |
| | | |
| | | private final StockBillLogService stockBillLogService; |
| | | |
| | | @EventListener(StockBillChangeEvent.class) |
| | | public void stockBillChangeListener(StockBillChangeEvent event) { |
| | | StockBillLog stockBillLog = event.getStockBillLog(); |
| | | if (CollUtil.isEmpty(event.getSkuList())) { |
| | | return; |
| | | } |
| | | if (Objects.equals(stockBillLog.getStockBillType(), StockBillType.INITIALIZE.value())) { |
| | | stockBillLogService.initialize(stockBillLog, event.getSkuList()); |
| | | return; |
| | | } |
| | | if (Objects.equals(stockBillLog.getStockBillType(), StockBillType.EDIT_OUTBOUND.value())) { |
| | | stockBillLogService.generateStockLogOfEditInfo(stockBillLog, event.getSkuList()); |
| | | return; |
| | | } |
| | | if (Objects.equals(stockBillLog.getStockBillType(), StockBillType.EDIT_STORAGE.value())) { |
| | | stockBillLogService.generateStockLogOfEditInfo(stockBillLog, event.getSkuList()); |
| | | return; |
| | | } |
| | | if (Objects.equals(stockBillLog.getStockBillType(), StockBillType.PROFIT_STORAGE.value()) || Objects.equals(stockBillLog.getStockBillType(), StockBillType.LOSS_OUTBOUND.value())) { |
| | | stockBillLogService.generateStockLogOfTakeStock(stockBillLog, event.getSkuList()); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.listener; |
| | | |
| | | |
| | | import com.yami.shop.bean.event.UserDataEvent; |
| | | import com.yami.shop.bean.order.UserDataOrder; |
| | | import com.yami.shop.bean.param.UserManagerParam; |
| | | import com.yami.shop.service.OrderDataAnalysisService; |
| | | import com.yami.shop.service.OrderRefundService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 统计一下用户的信息 |
| | | * @author yami |
| | | */ |
| | | @Slf4j |
| | | @Component("defaultUserDataListener") |
| | | @AllArgsConstructor |
| | | public class UserDataListener { |
| | | |
| | | |
| | | private final OrderDataAnalysisService orderDataAnalysisService; |
| | | private final OrderRefundService orderRefundService; |
| | | |
| | | @EventListener(UserDataEvent.class) |
| | | @Order(UserDataOrder.DEFAULT) |
| | | public void userReceiptOrderLister(UserDataEvent event) { |
| | | UserManagerParam param = event.getUserManagerParam(); |
| | | // 最近消费时间 消费金额 实付金额 消费次数 平均折扣 |
| | | orderDataAnalysisService.getConsumeData(param); |
| | | // 售后金额 售后次数 |
| | | orderRefundService.getRefundDataByUserId(param); |
| | | // 实付金额, 累计支付的金额: 除了余额支付/积分支付的订单累计金额 + 余额充值金额 |
| | | } |
| | | } |
New file |
| | |
| | | package com.yami.shop.manager; |
| | | |
| | | import com.yami.shop.bean.app.dto.ShopCartDto; |
| | | import com.yami.shop.bean.app.dto.ShopCartItemDto; |
| | | import com.yami.shop.bean.app.param.ChangeShopCartParam; |
| | | import com.yami.shop.bean.vo.ShopCartWithAmountVO; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 套餐+赠品购物车组装 |
| | | * @author 菠萝凤梨 |
| | | */ |
| | | public interface ComboShopCartManager { |
| | | /** |
| | | * 事件 |
| | | * 计算套餐 + 赠品,组合购物车 + 购物车金额 |
| | | * @param shopCartWithAmount 购物车列表和金额信息 |
| | | */ |
| | | void calculateComboAndMakeUpShopCartAndAmount(ShopCartWithAmountVO shopCartWithAmount); |
| | | |
| | | /** |
| | | * 购物车计算套餐 + 赠品 |
| | | * @param shopCarts 购物项 |
| | | * @return 组装好的购物项 |
| | | */ |
| | | List<ShopCartDto> calculateDiscountAndMakeUpShopCart(List<ShopCartDto> shopCarts); |
| | | |
| | | /** |
| | | * 套餐加入购物车 |
| | | * @param param |
| | | * @param userId |
| | | * @param shopCartItems |
| | | * @return |
| | | */ |
| | | ServerResponseEntity<String> comboAddCart(ChangeShopCartParam param, String userId, List<ShopCartItemDto> shopCartItems); |
| | | |
| | | /** |
| | | * 套餐改变购物车sku |
| | | * @param param |
| | | * @param userId |
| | | * @param shopCartItems |
| | | * @return |
| | | */ |
| | | ServerResponseEntity<String> comboChangeCart(ChangeShopCartParam param, String userId, List<ShopCartItemDto> shopCartItems); |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.manager; |
| | | |
| | | import com.yami.shop.bean.app.dto.ShopCartDto; |
| | | import com.yami.shop.bean.app.dto.ShopCartOrderMergerDto; |
| | | import com.yami.shop.bean.param.ChooseCouponParam; |
| | | import com.yami.shop.bean.param.PlatformChooseCouponParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2021/12/20 |
| | | */ |
| | | public interface CouponConfirmOrderManager { |
| | | |
| | | /** |
| | | * 选择店铺优惠券,并组装返回优惠券列表 |
| | | * @param chooseCouponParam 优惠券参数 |
| | | * @return void |
| | | */ |
| | | List<ShopCartDto> chooseShopCoupon(ChooseCouponParam chooseCouponParam); |
| | | |
| | | /** |
| | | * 选择平台优惠券,并组装返回优惠券列表 |
| | | * @param param 优惠券参数 |
| | | * @return void |
| | | */ |
| | | ShopCartOrderMergerDto choosePlatformCoupon(PlatformChooseCouponParam param); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.gz-yami.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | |
| | | package com.yami.shop.manager; |
| | | |
| | | import com.yami.shop.bean.app.dto.ShopCartDto; |
| | | import com.yami.shop.bean.vo.ShopCartWithAmountVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 默认的购物车进行组装时的操作 |
| | | * @author LGH |
| | | */ |
| | | public interface DiscountShopCartManager { |
| | | |
| | | /** |
| | | * 计算满减,并组合购物车 + 购物车金额 |
| | | * @param shopCartWithAmount 购物车列表和金额信息 |
| | | */ |
| | | void calculateDiscountAndMakeUpShopCartAndAmount(ShopCartWithAmountVO shopCartWithAmount); |
| | | |
| | | /** |
| | | * 计算满减,并重新组合购物车 |
| | | * @param shopCarts 购物项 |
| | | * @return void |
| | | */ |
| | | List<ShopCartDto> calculateDiscountAndMakeUpShopCart(List<ShopCartDto> shopCarts); |
| | | } |
New file |
| | |
| | | package com.yami.shop.manager; |
| | | |
| | | import com.yami.shop.bean.app.dto.ShopCartItemDto; |
| | | import com.yami.shop.bean.app.dto.ShopCartOrderMergerDto; |
| | | import com.yami.shop.bean.app.param.OrderParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2021/12/23 |
| | | */ |
| | | public interface OrderUseScoreManager { |
| | | |
| | | /** |
| | | * 订单使用积分,积分抵扣金额 |
| | | * @param shopCartOrderMergerDto 组装好的订单信息 |
| | | * @param orderParam 下单参数 |
| | | * @param allCartItem 订单内所有商品item |
| | | */ |
| | | void orderUseScore(ShopCartOrderMergerDto shopCartOrderMergerDto, OrderParam orderParam, List<ShopCartItemDto> allCartItem); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.manager; |
| | | |
| | | import com.yami.shop.bean.app.dto.ShopCartOrderMergerDto; |
| | | import com.yami.shop.bean.app.param.SubmitOrderParam; |
| | | import com.yami.shop.bean.event.TryLockStockEvent; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 提交订单适配 |
| | | * @author FrozenWatermelon |
| | | * @date 2020/12/07 |
| | | */ |
| | | @Component |
| | | public interface SubmitOrderManager { |
| | | |
| | | /** |
| | | * 检查订单所需参数和设置值 |
| | | * @param submitOrderParam 前端参数 |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | ServerResponseEntity<ShopCartOrderMergerDto> checkSubmitInfo(SubmitOrderParam submitOrderParam, String userId); |
| | | |
| | | /** |
| | | * 锁定商品库存 |
| | | * @param event 订单信息 |
| | | */ |
| | | void tryLockStock(TryLockStockEvent event); |
| | | |
| | | /** |
| | | * 锁定优惠券 |
| | | * @param event 订单信息 |
| | | */ |
| | | void tryLockCoupon(TryLockStockEvent event); |
| | | |
| | | /** |
| | | * 锁定积分 |
| | | * @param event 订单信息 |
| | | */ |
| | | void tryLockScore(TryLockStockEvent event) ; |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.manager; |
| | | |
| | | import com.yami.shop.bean.app.dto.ShopCartOrderMergerDto; |
| | | |
| | | /** |
| | | * @author FrozenWatermelon |
| | | * @date 2021/12/21 |
| | | */ |
| | | public interface UserLevelOrderManager { |
| | | |
| | | /** |
| | | * 计算订单等级 |
| | | * @param shopCartOrderMerger 订单信息 |
| | | * @return |
| | | */ |
| | | void calculateLevelDiscount(ShopCartOrderMergerDto shopCartOrderMerger); |
| | | } |
New file |
| | |
| | | package com.yami.shop.manager.impl; |
| | | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.yami.shop.bean.app.dto.*; |
| | | import com.yami.shop.bean.bo.PlatformCommissionOrderItemBO; |
| | | import com.yami.shop.bean.enums.DvyType; |
| | | import com.yami.shop.bean.enums.OrderType; |
| | | import com.yami.shop.bean.enums.ProdType; |
| | | import com.yami.shop.bean.model.Category; |
| | | import com.yami.shop.bean.model.Product; |
| | | import com.yami.shop.bean.vo.ShopTransFeeVO; |
| | | import com.yami.shop.bean.vo.UserDeliveryInfoVO; |
| | | import com.yami.shop.bean.vo.VirtualRemarkVO; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.common.constants.CacheNames; |
| | | import com.yami.shop.common.constants.OrderCacheNames; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.util.Arith; |
| | | import com.yami.shop.common.util.CacheManagerUtil; |
| | | import com.yami.shop.common.util.RedisUtil; |
| | | import com.yami.shop.service.CategoryService; |
| | | import ma.glasnost.orika.MapperFacade; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 确认订单适配 |
| | | * |
| | | * @author FrozenWatermelon |
| | | * @date 2020/12/07 |
| | | */ |
| | | @Component |
| | | public class ConfirmOrderManager { |
| | | |
| | | @Autowired |
| | | private CacheManagerUtil cacheManagerUtil; |
| | | @Autowired |
| | | private MapperFacade mapperFacade; |
| | | @Autowired |
| | | private CategoryService categoryService; |
| | | |
| | | /** |
| | | * 过滤物流不同的商品 |
| | | * |
| | | * @param dbShopCartItems 用户选择的商品项 |
| | | * @return 返回过滤掉的商品项item |
| | | */ |
| | | public List<ShopCartItemDto> filterShopItemsByType(ShopCartOrderMergerDto shopCartOrderMerger, List<ShopCartItemDto> dbShopCartItems) { |
| | | if (CollUtil.isEmpty(dbShopCartItems)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | Integer dvyType = shopCartOrderMerger.getDvyType(); |
| | | List<ShopCartItemDto> shopCartItems = new ArrayList<>(); |
| | | List<ShopCartItemDto> devList = new ArrayList<>(); |
| | | for (ShopCartItemDto shopCartItem : dbShopCartItems) { |
| | | if (Objects.isNull(shopCartItem.getComboId())) { |
| | | shopCartItem.setComboId(0L); |
| | | } |
| | | // 没有配置物流配送类型为无需配送,移除该订单项 |
| | | if (!deliverable(dvyType, shopCartItem)) { |
| | | continue; |
| | | } |
| | | // 自提和同城配送时,虚拟商品无法配送,移除该订单项 |
| | | if(shopCartItem.getMold() == 1 && (dvyType == 2 || dvyType == 4)){ |
| | | continue; |
| | | } |
| | | // 添加到可配送列表 |
| | | devList.add(shopCartItem); |
| | | } |
| | | |
| | | |
| | | Map<Long, List<ShopCartItemDto>> shopCartItemMap = dbShopCartItems.stream().collect(Collectors.groupingBy(ShopCartItemDto::getComboId)); |
| | | for (Long comboId : shopCartItemMap.keySet()) { |
| | | List<ShopCartItemDto> shopCartItemList = shopCartItemMap.get(comboId); |
| | | // 套餐商品 |
| | | if (!Objects.equals(comboId, 0L)) { |
| | | // 套餐是一个整体,需要套餐中所有的商品都是可配送才能添加到订单列表 |
| | | if (devList.containsAll(shopCartItemList)) { |
| | | shopCartItems.addAll(shopCartItemList); |
| | | } |
| | | continue; |
| | | } |
| | | // 普通商品列表 |
| | | for (ShopCartItemDto shopCartItem : shopCartItemList) { |
| | | // 活动商品购买且不属于套餐活动 |
| | | if (Objects.equals(shopCartItem.getProdType(), ProdType.PROD_TYPE_ACTIVE.value())) { |
| | | // 活动商品不能单独购买 |
| | | throw new YamiShopBindException("yami.active.prod.cannot.buy"); |
| | | } |
| | | if (devList.contains(shopCartItem)) { |
| | | shopCartItems.add(shopCartItem); |
| | | } |
| | | } |
| | | } |
| | | // 获取过滤掉的商品项 |
| | | if (CollUtil.isNotEmpty(shopCartItems) && !Objects.equals(dbShopCartItems.size(), shopCartItemMap.size())) { |
| | | dbShopCartItems.removeAll(shopCartItems); |
| | | shopCartOrderMerger.setFilterShopItems(dbShopCartItems); |
| | | } else { |
| | | shopCartOrderMerger.setFilterShopItems(new ArrayList<>()); |
| | | } |
| | | return shopCartItems; |
| | | } |
| | | |
| | | private boolean deliverable(Integer dvyType, ShopCartItemDto shopCartItem) { |
| | | Product.DeliveryModeVO deliveryModeVO = shopCartItem.getDeliveryModeVO(); |
| | | boolean hasShopDelivery = deliveryModeVO.getHasShopDelivery() != null && Objects.equals(dvyType, DvyType.DELIVERY.value()) && deliveryModeVO.getHasShopDelivery(); |
| | | boolean hasUserPickUp = deliveryModeVO.getHasUserPickUp() != null && Objects.equals(dvyType, DvyType.STATION.value()) && deliveryModeVO.getHasUserPickUp(); |
| | | boolean hasCityDelivery = deliveryModeVO.getHasCityDelivery() != null && Objects.equals(dvyType, DvyType.SAME_CITY.value()) && deliveryModeVO.getHasCityDelivery(); |
| | | if (hasShopDelivery || hasUserPickUp || hasCityDelivery) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 店铺营销活动计算完成后重算一次订单金额 |
| | | */ |
| | | public void recalculateAmountWhenFinishingCalculateShop(ShopCartOrderMergerDto shopCartOrderMerger, List<ShopCartDto> shopCarts, UserDeliveryInfoVO userDeliveryInfo) { |
| | | Map<Long, ShopTransFeeVO> shopIdWithShopTransFee = userDeliveryInfo.getShopIdWithShopTransFee(); |
| | | |
| | | // 所有店铺的订单信息 |
| | | List<ShopCartOrderDto> shopCartOrders = new ArrayList<>(); |
| | | |
| | | double actualTotal = 0; |
| | | double total = 0; |
| | | int totalCount = 0; |
| | | double allOrderReduce = 0; |
| | | double totalTransFee = 0; |
| | | long scoreTotal = 0; |
| | | |
| | | // 所有店铺所有的商品item |
| | | for (ShopCartDto shopCart : shopCarts) { |
| | | // 每个店铺的订单信息 |
| | | ShopCartOrderDto shopCartOrder = new ShopCartOrderDto(); |
| | | shopCartOrder.setOrderType(shopCartOrderMerger.getOrderType().value()); |
| | | shopCartOrder.setShopId(shopCart.getShopId()); |
| | | shopCartOrder.setShopName(shopCart.getShopName()); |
| | | shopCartOrder.setShopReduce(shopCart.getShopReduce()); |
| | | total = Arith.add(shopCart.getTotal(), total); |
| | | totalCount += shopCart.getTotalCount(); |
| | | allOrderReduce = Arith.add(allOrderReduce, shopCart.getShopReduce()); |
| | | |
| | | // 如果某家店因为各种优惠活动满减,使得金额变为负数,则这家店最低应该支付一分钱,而里面最贵的那件商品,也是支付一分钱,优惠金额 = (商品金额 - 一分钱) |
| | | if (shopCart.getActualTotal() < 0.01 && !Objects.equals(shopCart.getShopId(), Constant.PLATFORM_SHOP_ID)) { |
| | | shopCartOrder.setActualTotal(0.01); |
| | | shopCartOrder.setShopReduce(Arith.sub(shopCart.getTotal(), 0.01)); |
| | | |
| | | List<ShopCartItemDto> shopCartShopCartItem = getShopShopCartItem(shopCart.getShopCartItemDiscounts()); |
| | | resetActualTotal(shopCartShopCartItem); |
| | | } |
| | | //店铺优惠金额 = 优惠金额 |
| | | shopCartOrder.setShopReduce(shopCartOrder.getShopReduce()); |
| | | |
| | | // 要计算运费 |
| | | totalTransFee = calculateTransFee(shopIdWithShopTransFee, totalTransFee, shopCart, shopCartOrder); |
| | | |
| | | // 店铺优惠券优惠金额 |
| | | shopCartOrder.setCouponReduce(shopCart.getCouponReduce()); |
| | | shopCartOrder.setShopComboAmount(shopCart.getComboReduce()); |
| | | shopCartOrder.setShopCartItemDiscounts(shopCart.getShopCartItemDiscounts()); |
| | | shopCartOrder.setCoupons(shopCart.getCoupons()); |
| | | shopCartOrder.setTotal(shopCart.getTotal()); |
| | | shopCartOrder.setTotalCount(shopCart.getTotalCount()); |
| | | actualTotal = Arith.add(actualTotal, shopCartOrder.getActualTotal()); |
| | | if (Objects.equals(shopCartOrderMerger.getOrderType(), OrderType.SCORE)) { |
| | | // 积分订单使用积分 |
| | | shopCartOrder.setUseScore(shopCart.getScoreTotal()); |
| | | } else { |
| | | shopCartOrder.setUseScore(shopCartOrderMerger.getUsableScore()); |
| | | } |
| | | shopCartOrder.setDiscountReduce(shopCart.getDiscountReduce()); |
| | | shopCartOrders.add(shopCartOrder); |
| | | scoreTotal += shopCart.getScoreTotal(); |
| | | } |
| | | |
| | | shopCartOrderMerger.setActualTotal(actualTotal); |
| | | shopCartOrderMerger.setTotal(total); |
| | | shopCartOrderMerger.setTotalCount(totalCount); |
| | | shopCartOrderMerger.setOrderReduce(allOrderReduce); |
| | | shopCartOrderMerger.setTotalTransFee(totalTransFee); |
| | | shopCartOrderMerger.setShopCartOrders(shopCartOrders); |
| | | shopCartOrderMerger.setOrderSelfStationList(userDeliveryInfo.getOrderSelfStation()); |
| | | shopCartOrderMerger.setUserAddr(mapperFacade.map(userDeliveryInfo.getUserAddr(), UserAddrDto.class)); |
| | | shopCartOrderMerger.setShopCityStatus(userDeliveryInfo.getShopCityStatus()); |
| | | shopCartOrderMerger.setFreeTransFee(userDeliveryInfo.getTotalFreeTransFee()); |
| | | shopCartOrderMerger.setStartDeliveryFee(userDeliveryInfo.getStartDeliveryFee()); |
| | | if (Objects.equals(shopCartOrderMerger.getOrderType(), OrderType.SCORE)) { |
| | | shopCartOrderMerger.setUsableScore(scoreTotal); |
| | | } |
| | | } |
| | | |
| | | private double calculateTransFee(Map<Long, ShopTransFeeVO> shopIdWithShopTransFee, double totalTransFee, ShopCartDto shopCart, ShopCartOrderDto shopCartOrder) { |
| | | if (shopIdWithShopTransFee != null) { |
| | | ShopTransFeeVO shopTransFeeVO = shopIdWithShopTransFee.get(shopCartOrder.getShopId()); |
| | | |
| | | // 店铺的实付 = 购物车实付 + 运费 |
| | | shopCartOrder.setActualTotal(shopCart.getActualTotal() + shopTransFeeVO.getTransFee()); |
| | | // 运费 |
| | | shopCartOrder.setTransFee(shopTransFeeVO.getTransFee()); |
| | | shopCartOrder.setFreeTransFee(shopTransFeeVO.getFreeTransFee()); |
| | | totalTransFee = Arith.add(totalTransFee, shopTransFeeVO.getTransFee()); |
| | | } else { |
| | | // 运费 |
| | | shopCartOrder.setTransFee(0.0); |
| | | shopCartOrder.setFreeTransFee(0.0); |
| | | // 店铺的实付 = 购物车实付 + 运费 |
| | | shopCartOrder.setActualTotal(Arith.add(shopCart.getActualTotal(), shopCartOrder.getTransFee())); |
| | | } |
| | | return totalTransFee; |
| | | } |
| | | |
| | | /** |
| | | * 获取店铺下的所有订单 |
| | | */ |
| | | private List<ShopCartItemDto> getShopShopCartItem(List<ShopCartItemDiscountDto> shopCartItemDiscounts) { |
| | | List<ShopCartItemDto> shopCartItemList = new ArrayList<>(); |
| | | for (ShopCartItemDiscountDto shopCartItemDiscount : shopCartItemDiscounts) { |
| | | shopCartItemList.addAll(shopCartItemDiscount.getShopCartItems()); |
| | | } |
| | | shopCartItemList.sort(Comparator.comparingDouble(ShopCartItemDto::getActualTotal)); |
| | | return shopCartItemList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 重新计算金额,避免订单无法支付 |
| | | */ |
| | | private void resetActualTotal(List<ShopCartItemDto> shopCartShopCartItem) { |
| | | Iterator<ShopCartItemDto> iterator = shopCartShopCartItem.iterator(); |
| | | while (iterator.hasNext()) { |
| | | ShopCartItemDto shopCartItem = iterator.next(); |
| | | shopCartItem.setShareReduce(Arith.add(shopCartItem.getShareReduce(), shopCartItem.getPlatformShareReduce())); |
| | | shopCartItem.setActualTotal(Arith.sub(shopCartItem.getProductTotalAmount(), shopCartItem.getShareReduce())); |
| | | if (iterator.hasNext()) { |
| | | shopCartItem.setActualTotal(0.0); |
| | | shopCartItem.setShareReduce(shopCartItem.getProductTotalAmount()); |
| | | } else { |
| | | shopCartItem.setActualTotal(0.01); |
| | | shopCartItem.setShareReduce(shopCartItem.getProductTotalAmount() - 0.01); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 结束平台优惠的计算之后,还要重算一遍金额 |
| | | */ |
| | | public void recalculateAmountWhenFinishingCalculatePlatform(ShopCartOrderMergerDto shopCartOrderMergerDto) { |
| | | List<VirtualRemarkVO> virtualRemarkList = new ArrayList<>(); |
| | | |
| | | List<ShopCartOrderDto> shopCartOrders = shopCartOrderMergerDto.getShopCartOrders(); |
| | | List<ShopCartItemDto> allShopCartItem = new ArrayList<>(); |
| | | |
| | | //所有订单实际金额 |
| | | double actualTotal = 0.00; |
| | | //所有订单优惠金额 |
| | | double allOrderReduce = 0.00; |
| | | double totalTransFee = 0.00; |
| | | for (ShopCartOrderDto shopCartOrder : shopCartOrders) { |
| | | |
| | | //订单实际金额 |
| | | double orderActualTotal = 0.00; |
| | | //商家优惠金额 |
| | | double orderReduceAmount = 0.00; |
| | | //商家满减优惠金额 |
| | | double couponAmount = 0.00; |
| | | //商家优惠券优惠金额 |
| | | double discountAmount = 0.00; |
| | | //平台优惠券优惠金额 |
| | | double platformCouponAmount = 0.00; |
| | | //平台等级优惠金额 |
| | | double levelAmount = 0.00; |
| | | //商家优惠金额 |
| | | double orderPlatformAmount = 0.00; |
| | | // 满减金额计算 |
| | | List<ShopCartItemDiscountDto> shopCartItemDiscounts = shopCartOrder.getShopCartItemDiscounts(); |
| | | for (ShopCartItemDiscountDto shopCartItemDiscount : shopCartItemDiscounts) { |
| | | List<ShopCartItemDto> shopCartItems = shopCartItemDiscount.getShopCartItems(); |
| | | allShopCartItem.addAll(shopCartItems); |
| | | for (ShopCartItemDto shopCartItem : shopCartItems) { |
| | | shopCartItem.setPlatformShareReduce(Arith.roundByBanker(shopCartItem.getPlatformShareReduce(), 2)); |
| | | shopCartItem.setShareReduce(Arith.add(Arith.roundByBanker(shopCartItem.getShareReduce(), 2), shopCartItem.getPlatformShareReduce())); |
| | | shopCartItem.setActualTotal(Arith.sub(shopCartItem.getProductTotalAmount(), shopCartItem.getShareReduce())); |
| | | orderActualTotal = Arith.add(orderActualTotal, shopCartItem.getActualTotal()); |
| | | orderReduceAmount = Arith.add(orderReduceAmount, shopCartItem.getShareReduce()); |
| | | orderPlatformAmount = Arith.addMayBeEmpty(orderPlatformAmount, shopCartItem.getPlatformShareReduce()); |
| | | discountAmount = Arith.addMayBeEmpty(discountAmount, shopCartItem.getDiscountAmount()); |
| | | couponAmount = Arith.addMayBeEmpty(couponAmount, shopCartItem.getShopCouponAmount()); |
| | | platformCouponAmount = Arith.addMayBeEmpty(platformCouponAmount, shopCartItem.getPlatformCouponAmount()); |
| | | levelAmount = Arith.addMayBeEmpty(levelAmount, shopCartItem.getLevelReduce()); |
| | | if (CollectionUtil.isNotEmpty(shopCartItem.getVirtualRemarkList())) { |
| | | virtualRemarkList.addAll(shopCartItem.getVirtualRemarkList()); |
| | | } |
| | | } |
| | | } |
| | | shopCartOrder.setActualTotal(Arith.sub(Arith.add(orderActualTotal, shopCartOrder.getTransFee()), shopCartOrder.getPlatformFreeFreightAmount())); |
| | | //放入优惠金额 |
| | | shopCartOrder.setShopReduce(orderReduceAmount); |
| | | //放入平台优惠金额,如果用户等级免自营店运费也要放进去 |
| | | shopCartOrder.setPlatformAmount(Arith.add(orderPlatformAmount, shopCartOrder.getPlatformFreeFreightAmount())); |
| | | shopCartOrder.setCouponReduce(couponAmount); |
| | | shopCartOrder.setDiscountReduce(discountAmount); |
| | | shopCartOrder.setPlatformCouponReduce(platformCouponAmount); |
| | | shopCartOrder.setLevelReduce(levelAmount); |
| | | double shopActual = Arith.add(Arith.sub(shopCartOrder.getActualTotal(),shopCartOrder.getTransFee()),shopCartOrder.getFreeTransFee()); |
| | | // 如果是折扣特别小的情况下,导致实际金额为0,改变最小支付金额为0.01元,并且优惠金额减去0.01。 |
| | | if (shopActual < 0.01) { |
| | | shopCartOrder.setActualTotal(Arith.add(shopCartOrder.getActualTotal(),0.01)); |
| | | shopCartOrder.setPlatformAmount(Arith.sub(shopCartOrder.getPlatformAmount(), 0.01)); |
| | | shopCartOrder.setShopReduce(Arith.sub(shopCartOrder.getShopReduce(), 0.01)); |
| | | // 并且如果等级优惠金额不为空,则在等级优惠金额减去,否则减去平台优惠券的分摊金额 |
| | | if (shopCartOrderMergerDto.getTotalLevelAmount() > 0.00) { |
| | | shopCartOrderMergerDto.setTotalLevelAmount(Arith.sub(shopCartOrderMergerDto.getTotalLevelAmount(), 0.01)); |
| | | shopCartOrder.setLevelReduce(Arith.sub(shopCartOrder.getLevelReduce(), 0.01)); |
| | | // 按照抵扣金额大小排序,扣除最大的那个商品项的等级优惠金额0.01元 |
| | | List<ShopCartItemDto> items = allShopCartItem.stream().sorted(Comparator.comparing(ShopCartItemDto::getLevelReduce).reversed()).collect(Collectors.toList()); |
| | | ShopCartItemDto shopCartItemDto = items.get(0); |
| | | shopCartItemDto.setActualTotal(0.01); |
| | | shopCartItemDto.setPlatformShareReduce(Arith.sub(shopCartItemDto.getPlatformShareReduce(), 0.01)); |
| | | shopCartItemDto.setShareReduce(Arith.sub(shopCartItemDto.getShareReduce(), 0.01)); |
| | | shopCartItemDto.setLevelReduce(Arith.sub(shopCartItemDto.getLevelReduce(),0.01)); |
| | | } |
| | | } |
| | | actualTotal = Arith.add(actualTotal, shopCartOrder.getActualTotal()); |
| | | allOrderReduce = Arith.add(allOrderReduce, shopCartOrder.getShopReduce()); |
| | | totalTransFee = Arith.add(totalTransFee, shopCartOrder.getTransFee()); |
| | | } |
| | | |
| | | shopCartOrderMergerDto.setActualTotal(actualTotal); |
| | | shopCartOrderMergerDto.setOrderReduce(allOrderReduce); |
| | | shopCartOrderMergerDto.setTotalTransFee(totalTransFee); |
| | | shopCartOrderMergerDto.setShopCartOrders(shopCartOrders); |
| | | shopCartOrderMergerDto.setVirtualRemarkList(virtualRemarkList); |
| | | } |
| | | |
| | | /** |
| | | * 计算平台佣金,积分订单不可用 |
| | | */ |
| | | public void calculatePlatformCommission(ShopCartOrderMergerDto shopCartOrderMerger) { |
| | | List<ShopCartOrderDto> shopCartOrders = shopCartOrderMerger.getShopCartOrders(); |
| | | for (ShopCartOrderDto shopCartOrder : shopCartOrders) { |
| | | double platformCommission = 0.00; |
| | | List<ShopCartItemDiscountDto> shopCartItemDiscounts = shopCartOrder.getShopCartItemDiscounts(); |
| | | for (ShopCartItemDiscountDto shopCartItemDiscount : shopCartItemDiscounts) { |
| | | List<ShopCartItemDto> shopCartItems = shopCartItemDiscount.getShopCartItems(); |
| | | List<PlatformCommissionOrderItemBO> platformCommissionShopCartItems = new ArrayList<>(); |
| | | for (ShopCartItemDto shopCartItem : shopCartItems) { |
| | | PlatformCommissionOrderItemBO platformCommissionOrderItem = new PlatformCommissionOrderItemBO(); |
| | | platformCommissionOrderItem.setShopId(shopCartItem.getShopId()); |
| | | platformCommissionOrderItem.setCategoryId(shopCartItem.getCategoryId()); |
| | | platformCommissionOrderItem.setSkuId(shopCartItem.getSkuId()); |
| | | platformCommissionShopCartItems.add(platformCommissionOrderItem); |
| | | } |
| | | // 获取整个平台的佣金比例 |
| | | List<Category> categoryRates = categoryService.listRate(); |
| | | List<PlatformCommissionOrderItemBO> data = categoryService.calculatePlatformCommission(platformCommissionShopCartItems, categoryRates); |
| | | Map<Long, PlatformCommissionOrderItemBO> categoryMap = data.stream().collect(Collectors.toMap(PlatformCommissionOrderItemBO::getSkuId, p -> p)); |
| | | for (ShopCartItemDto shopCartItem : shopCartItems) { |
| | | PlatformCommissionOrderItemBO platformCommissionOrderItem = categoryMap.get(shopCartItem.getSkuId()); |
| | | // 分摊比例 |
| | | shopCartItem.setRate(platformCommissionOrderItem.getRate()); |
| | | // 平台佣金 = (实付金额 + 平台优惠金额) * 比例 / 100 |
| | | double itemPlatformCommission = Arith.roundByBanker(Arith.div(Arith.mul(Arith.add(shopCartItem.getActualTotal(), shopCartItem.getPlatformShareReduce()), |
| | | platformCommissionOrderItem.getRate()), 100), 2); |
| | | shopCartItem.setPlatformCommission(itemPlatformCommission); |
| | | platformCommission = Arith.add(platformCommission, itemPlatformCommission); |
| | | } |
| | | } |
| | | shopCartOrder.setPlatformCommission(platformCommission); |
| | | } |
| | | } |
| | | |
| | | public void cacheCalculatedInfo(String userId, ShopCartOrderMergerDto shopCartOrderMerger) { |
| | | // 防止重复提交 |
| | | RedisUtil.STRING_REDIS_TEMPLATE.opsForValue().set(OrderCacheNames.ORDER_CONFIRM_UUID_KEY + CacheNames.UNION + userId, String.valueOf(userId)); |
| | | // 保存订单计算结果缓存,省得重新计算 并且 用户确认的订单金额与提交的一致 |
| | | cacheManagerUtil.putCache(OrderCacheNames.ORDER_CONFIRM_KEY, String.valueOf(userId), shopCartOrderMerger); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.manager.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.alipay.api.AlipayConstants; |
| | | import com.alipay.api.domain.*; |
| | | import com.alipay.api.internal.util.AlipaySignature; |
| | | import com.alipay.api.request.*; |
| | | import com.alipay.api.response.AlipayTradeCloseResponse; |
| | | import com.alipay.api.response.AlipayTradeQueryResponse; |
| | | import com.alipay.api.response.AlipayTradeRefundResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.binarywang.wxpay.bean.notify.*; |
| | | import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult; |
| | | import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; |
| | | import com.github.binarywang.wxpay.bean.order.WxPayMwebOrderResult; |
| | | import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult; |
| | | import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest; |
| | | import com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request; |
| | | import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; |
| | | import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request; |
| | | import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryResult; |
| | | import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryV3Result; |
| | | import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result; |
| | | import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum; |
| | | import com.github.binarywang.wxpay.constant.WxPayConstants; |
| | | import com.github.binarywang.wxpay.exception.WxPayException; |
| | | import com.github.binarywang.wxpay.service.WxPayService; |
| | | import com.paypal.orders.OrdersCreateRequest; |
| | | import com.yami.shop.bean.app.param.PayInfoParam; |
| | | import com.yami.shop.bean.bo.PayInfoResultBO; |
| | | import com.yami.shop.bean.bo.RefundInfoBo; |
| | | import com.yami.shop.bean.enums.BackType; |
| | | import com.yami.shop.bean.enums.PayStatus; |
| | | import com.yami.shop.bean.event.*; |
| | | import com.yami.shop.bean.model.PayInfo; |
| | | import com.yami.shop.bean.param.PayPalOrderParam; |
| | | import com.yami.shop.bean.param.WebhookParam; |
| | | import com.yami.shop.bean.pay.PayInfoDto; |
| | | import com.yami.shop.bean.pay.RefundInfoDto; |
| | | import com.yami.shop.common.bean.Domain; |
| | | import com.yami.shop.common.bean.SysPayConfig; |
| | | import com.yami.shop.common.bean.WxPay; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.common.enums.PayType; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.common.util.Arith; |
| | | import com.yami.shop.common.util.IPHelper; |
| | | import com.yami.shop.common.util.Json; |
| | | import com.yami.shop.config.AliPayConfig; |
| | | import com.yami.shop.config.PayPalConfig; |
| | | import com.yami.shop.config.ShopConfig; |
| | | import com.yami.shop.config.WxConfig; |
| | | import com.yami.shop.dao.PayInfoMapper; |
| | | import com.yami.shop.service.SysConfigService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.http.Header; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 统一支付工具 |
| | | * |
| | | * @author LGH |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class PayManager { |
| | | private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | @Autowired |
| | | private AliPayConfig aliPayConfig; |
| | | |
| | | @Autowired |
| | | private ShopConfig shopConfig; |
| | | |
| | | @Autowired |
| | | private WxConfig wxConfig; |
| | | |
| | | @Autowired |
| | | private PayPalConfig payPalConfig; |
| | | |
| | | @Autowired |
| | | private ApplicationContext applicationContext; |
| | | |
| | | @Autowired |
| | | private SysConfigService sysConfigService; |
| | | |
| | | @Autowired |
| | | private PayInfoMapper payInfoMapper; |
| | | |
| | | private static final String WX_SUCCESS_XML = "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>"; |
| | | private static final String ALI_SUCCESS = "success"; |
| | | private static final String SUCCESS = "SUCCESS"; |
| | | private static final String TRADE_STATUS = "trade_status"; |
| | | private static final String TRADE_SUCCESS = "TRADE_SUCCESS"; |
| | | private static final String REFUND_FEE = "refund_fee"; |
| | | private static final String TRADE_CLOSED = "TRADE_CLOSED"; |
| | | |
| | | public ServerResponseEntity<?> doPay(HttpServletResponse httpResponse, PayInfoDto payInfo) throws WxPayException, AlipayApiException { |
| | | if (payInfo.getPayAmount() < Constant.MIN_PRODUCT_AMOUNT && Objects.equals(payInfo.getPayType(), PayType.SCOREPAY.value())) { |
| | | return ServerResponseEntity.success(); |
| | | } |
| | | // 微信支付不能大于1000w |
| | | if (payInfo.getPayAmount() < Constant.MIN_PRODUCT_AMOUNT) { |
| | | // 订单金额有误,无法进行支付 |
| | | throw new YamiShopBindException("yami.order.amount.error"); |
| | | } else if (payInfo.getPayAmount() > Constant.WECHAT_MAX_PAY_AMOUNT) { |
| | | throw new YamiShopBindException("yami.order.amount.too.large.error"); |
| | | } |
| | | SysPayConfig sysPayConfig = sysConfigService.getSysConfigObject(Constant.PAY_SWITCH_CONFIG, SysPayConfig.class); |
| | | String domainName = shopConfig.getDomain().getApiDomainName(); |
| | | // 如果是商家端需要回调,则使用商家端的地址 |
| | | if (Objects.nonNull(payInfo.getBackType()) && Objects.equals(payInfo.getBackType(), BackType.SHOP.value())) { |
| | | domainName = shopConfig.getDomain().getMultishopDomainName(); |
| | | } |
| | | String notifyUrl = domainName + payInfo.getApiNoticeUrl(); |
| | | // String notifyUrl = "http://zsq20240622.w1.luyouxia.net/"; |
| | | |
| | | System.out.println("notifyUrl------------------------->>>>>>>>>>>>" + notifyUrl); |
| | | |
| | | PayType payType = PayType.instance(payInfo.getPayType()); |
| | | if (PayType.isWxPay(payType)) { |
| | | if (!sysPayConfig.getWxPaySwitch()) { |
| | | throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | } |
| | | Integer wxPayVersion = shopConfig.getWxPay().getVersion(); |
| | | // v3需要的配置 |
| | | if (Objects.equals(WxPay.VERSION_3, wxPayVersion)) { |
| | | return doWxPayV3(payInfo, notifyUrl, payType); |
| | | } else { |
| | | return doWxPay(payInfo, notifyUrl, payType); |
| | | } |
| | | } else if (Objects.equals(payType, PayType.ALIPAY)) { |
| | | if (!sysPayConfig.getAliPaySwitch()) { |
| | | throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | } |
| | | //创建API对应的request |
| | | AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest(); |
| | | |
| | | //在公共参数中设置回跳和通知地址 |
| | | alipayRequest.setNotifyUrl(notifyUrl); |
| | | alipayRequest.setReturnUrl(payInfo.getReturnUrl()); |
| | | AlipayTradePagePayModel alipayTradePagePayModel = new AlipayTradePagePayModel(); |
| | | alipayTradePagePayModel.setOutTradeNo(payInfo.getPayNo()); |
| | | alipayTradePagePayModel.setBody(payInfo.getBody()); |
| | | alipayTradePagePayModel.setSubject(payInfo.getBody()); |
| | | alipayTradePagePayModel.setTotalAmount(Double.toString(payInfo.getPayAmount())); |
| | | alipayTradePagePayModel.setProductCode("FAST_INSTANT_TRADE_PAY"); |
| | | alipayRequest.setBizModel(alipayTradePagePayModel); |
| | | |
| | | return ServerResponseEntity.success(aliPayConfig.getAlipayClient().pageExecute(alipayRequest).getBody()); |
| | | } else if (Objects.equals(payType, PayType.ALIPAY_H5)) { |
| | | if (!sysPayConfig.getAliPaySwitch()) { |
| | | throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | } |
| | | AlipayTradeWapPayRequest alipayRequest = new AlipayTradeWapPayRequest(); |
| | | alipayRequest.setNotifyUrl(notifyUrl); |
| | | alipayRequest.setReturnUrl(payInfo.getReturnUrl()); |
| | | |
| | | AlipayTradeWapPayModel alipayTradeWapPayModel = new AlipayTradeWapPayModel(); |
| | | alipayTradeWapPayModel.setOutTradeNo(payInfo.getPayNo()); |
| | | alipayTradeWapPayModel.setSubject(payInfo.getBody()); |
| | | alipayTradeWapPayModel.setTotalAmount(Double.toString(payInfo.getPayAmount())); |
| | | alipayTradeWapPayModel.setProductCode("QUICK_WAP_PAY"); |
| | | alipayRequest.setBizModel(alipayTradeWapPayModel); |
| | | return ServerResponseEntity.success(aliPayConfig.getAlipayClient().pageExecute(alipayRequest).getBody()); |
| | | } |
| | | // 支付宝app支付 |
| | | else if (Objects.equals(payType, PayType.ALIPAY_APP)) { |
| | | if (!sysPayConfig.getAliPaySwitch()) { |
| | | throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | } |
| | | AlipayTradeAppPayRequest alipayRequest = new AlipayTradeAppPayRequest(); |
| | | alipayRequest.setNotifyUrl(notifyUrl); |
| | | AlipayTradeAppPayModel alipayTradeAppPayModel = new AlipayTradeAppPayModel(); |
| | | alipayTradeAppPayModel.setOutTradeNo(payInfo.getPayNo()); |
| | | alipayTradeAppPayModel.setSubject(payInfo.getBody()); |
| | | alipayTradeAppPayModel.setTotalAmount(Double.toString(payInfo.getPayAmount())); |
| | | alipayTradeAppPayModel.setProductCode("QUICK_MSECURITY_PAY"); |
| | | alipayRequest.setBizModel(alipayTradeAppPayModel); |
| | | |
| | | String body = aliPayConfig.getAlipayClient().sdkExecute(alipayRequest).getBody(); |
| | | return ServerResponseEntity.success(body); |
| | | } |
| | | //余额支付 |
| | | else if (Objects.equals(payType, PayType.BALANCE)) { |
| | | if (!sysPayConfig.getBalancePaySwitch()) { |
| | | throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | } |
| | | PayInfoParam payInfoParam = new PayInfoParam(); |
| | | applicationContext.publishEvent(new BalancePayEvent(payInfo, payInfoParam)); |
| | | return ServerResponseEntity.success(payInfoParam); |
| | | } |
| | | //瓜瓜豆支付 |
| | | else if (Objects.equals(payType, PayType.BEAN)) { |
| | | if (!sysPayConfig.getSdBeanSwitch()) { |
| | | throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | } |
| | | PayInfoParam payInfoParam = new PayInfoParam(); |
| | | applicationContext.publishEvent(new BeanPayEvent(payInfo, payInfoParam)); |
| | | return ServerResponseEntity.success(payInfoParam); |
| | | } |
| | | //余额支付 |
| | | // else if (Objects.equals(payType, PayType.BLUEPOINT)) { |
| | | // if (!sysPayConfig.getBluePointSwitch()) { |
| | | // throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | // } |
| | | // PayInfoParam payInfoParam = new PayInfoParam(); |
| | | // applicationContext.publishEvent(new BluePointPayEvent(payInfo, payInfoParam)); |
| | | // return ServerResponseEntity.success(payInfoParam); |
| | | // } |
| | | //PayPal支付 |
| | | else if (Objects.equals(payType, PayType.PAYPAL)) { |
| | | |
| | | return doPayPalPay(payInfo, sysPayConfig, notifyUrl); |
| | | } else if (Objects.equals(payType, PayType.BLUEREDPOINT)) { |
| | | if (!sysPayConfig.getSdBeanSwitch()) { |
| | | throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | } |
| | | PayInfoParam payInfoParam = new PayInfoParam(); |
| | | applicationContext.publishEvent(new BlueRedPayEvent(payInfo, payInfoParam)); |
| | | return ServerResponseEntity.success(payInfoParam); |
| | | } else if (Objects.equals(payType, PayType.BLUEBALANCEPOINT)) { |
| | | if (!sysPayConfig.getSdBeanSwitch()) { |
| | | throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | } |
| | | PayInfoParam payInfoParam = new PayInfoParam(); |
| | | applicationContext.publishEvent(new BlueBalancePayEvent(payInfo, payInfoParam)); |
| | | return ServerResponseEntity.success(payInfoParam); |
| | | } else if (Objects.equals(payType, PayType.REDPOINT)) { |
| | | if (!sysPayConfig.getSdBeanSwitch()) { |
| | | throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | } |
| | | PayInfoParam payInfoParam = new PayInfoParam(); |
| | | applicationContext.publishEvent(new RedPayEvent(payInfo, payInfoParam)); |
| | | return ServerResponseEntity.success(payInfoParam); |
| | | } |
| | | // 一般是积分支付才会到这一步 |
| | | return ServerResponseEntity.success(); |
| | | } |
| | | |
| | | private ServerResponseEntity<String> doPayPalPay(PayInfoDto payInfoDto, SysPayConfig sysPayConfig, String notifyUrl) { |
| | | if (!sysPayConfig.getPayPalSwitch()) { |
| | | throw new YamiShopBindException("yami.order.pay.type.check"); |
| | | } |
| | | payInfoDto.setApiNoticeUrl(notifyUrl); |
| | | OrdersCreateRequest request = payPalConfig.createPayPalOrder(payInfoDto); |
| | | PayPalOrderParam param = payPalConfig.getExcetuteHref(request); |
| | | // 根据支付单号,更新第三方订单号 |
| | | PayInfo payInfo = payInfoMapper.selectOne(new LambdaQueryWrapper<PayInfo>().eq(PayInfo::getPayNo, payInfoDto.getPayNo())); |
| | | payInfo.setBizOrderNo(param.getOrderId()); |
| | | int updateCount = payInfoMapper.update(payInfo, Wrappers.lambdaUpdate(PayInfo.class) |
| | | .eq(PayInfo::getPayNo, payInfoDto.getPayNo())); |
| | | if (updateCount < 1) { |
| | | // 支付信息更新失败 |
| | | throw new YamiShopBindException("yami.shop.pay.info.update.error"); |
| | | } |
| | | // 创建钩子,如果已经在paypal配置好钩子可以将下面一行注释掉 |
| | | payPalConfig.createWebhook(payInfoDto.getApiNoticeUrl()); |
| | | return ServerResponseEntity.success(param.getHref()); |
| | | } |
| | | |
| | | private ServerResponseEntity<?> doWxPay(PayInfoDto payInfo, String notifyUrl, PayType payType) throws WxPayException { |
| | | WxPayService wxPayService = wxConfig.getWxPayService(payType); |
| | | WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest(); |
| | | orderRequest.setBody(payInfo.getBody()); |
| | | orderRequest.setOutTradeNo(payInfo.getPayNo()); |
| | | orderRequest.setTotalFee((int) Arith.mul(payInfo.getPayAmount(), 100)); |
| | | orderRequest.setSpbillCreateIp(IPHelper.getIpAddr()); |
| | | orderRequest.setOpenid(payInfo.getBizUserId()); |
| | | orderRequest.setNotifyUrl(notifyUrl); |
| | | |
| | | // 微信小程序支付 || 微信公众号支付 |
| | | if (Objects.equals(payType, PayType.WECHATPAY) || Objects.equals(payType, PayType.WECHATPAY_MP)) { |
| | | orderRequest.setTradeType(WxPayConstants.TradeType.JSAPI); |
| | | WxPayMpOrderResult wxPayMpOrderResult = wxPayService.createOrder(orderRequest); |
| | | return ServerResponseEntity.success(wxPayMpOrderResult); |
| | | } |
| | | // 微信网页支付 |
| | | else if (Objects.equals(payType, PayType.WECHATPAY_SWEEP_CODE)) { |
| | | orderRequest.setProductId(payInfo.getPayNo()); |
| | | // 生成微信二维码 |
| | | orderRequest.setTradeType(WxPayConstants.TradeType.NATIVE); |
| | | WxPayNativeOrderResult wxPayNativeOrderResult = wxPayService.createOrder(orderRequest); |
| | | |
| | | return ServerResponseEntity.success(wxPayNativeOrderResult.getCodeUrl()); |
| | | } |
| | | // 微信H5支付 |
| | | else if (Objects.equals(payType, PayType.WECHATPAY_H5)) { |
| | | // 生成微信二维码 |
| | | orderRequest.setTradeType(WxPayConstants.TradeType.MWEB); |
| | | String s = "{\"h5_info\": {\"type\":\"Wap\",\"wap_url\": \"\",\"wap_name\": \"\"}}"; |
| | | orderRequest.setSceneInfo(s); |
| | | WxPayMwebOrderResult wxPayMwebOrderResult = wxPayService.createOrder(orderRequest); |
| | | return ServerResponseEntity.success(wxPayMwebOrderResult.getMwebUrl()); |
| | | } |
| | | // 微信app支付 |
| | | else if (Objects.equals(payType, PayType.WECHATPAY_APP)) { |
| | | orderRequest.setTradeType(WxPayConstants.TradeType.APP); |
| | | WxPayAppOrderResult wxPayAppOrderResult = wxPayService.createOrder(orderRequest); |
| | | return ServerResponseEntity.success(wxPayAppOrderResult); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private ServerResponseEntity<?> doWxPayV3(PayInfoDto payInfo, String notifyUrl, PayType payType) throws WxPayException { |
| | | WxPayService wxPayService = wxConfig.getWxPayService(payType); |
| | | WxPayUnifiedOrderV3Request orderRequest = new WxPayUnifiedOrderV3Request(); |
| | | orderRequest.setDescription(payInfo.getBody()); |
| | | orderRequest.setOutTradeNo(payInfo.getPayNo()); |
| | | orderRequest.setNotifyUrl(notifyUrl); |
| | | orderRequest.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal((int) Arith.mul(payInfo.getPayAmount(), 100))); |
| | | orderRequest.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(payInfo.getBizUserId())); |
| | | |
| | | // 微信小程序支付 || 微信公众号支付 |
| | | if (Objects.equals(payType, PayType.WECHATPAY) || Objects.equals(payType, PayType.WECHATPAY_MP)) { |
| | | return ServerResponseEntity.success(wxPayService.createOrderV3(TradeTypeEnum.JSAPI, orderRequest)); |
| | | } |
| | | // 微信网页支付 |
| | | else if (Objects.equals(payType, PayType.WECHATPAY_SWEEP_CODE)) { |
| | | // 生成微信二维码 |
| | | return ServerResponseEntity.success(wxPayService.createOrderV3(TradeTypeEnum.NATIVE, orderRequest)); |
| | | } |
| | | // 微信H5支付 |
| | | else if (Objects.equals(payType, PayType.WECHATPAY_H5)) { |
| | | orderRequest.setSceneInfo(new WxPayUnifiedOrderV3Request.SceneInfo() |
| | | .setPayerClientIp(IPHelper.getIpAddr()) |
| | | .setH5Info(new WxPayUnifiedOrderV3Request.H5Info().setType("Wap"))); |
| | | // 生成h5支付地址 |
| | | return ServerResponseEntity.success(wxPayService.createOrderV3(TradeTypeEnum.H5, orderRequest)); |
| | | } |
| | | // 微信app支付 |
| | | else if (Objects.equals(payType, PayType.WECHATPAY_APP)) { |
| | | return ServerResponseEntity.success(wxPayService.createOrderV3(TradeTypeEnum.APP, orderRequest)); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 校验支付结果,并返回支付单号 |
| | | */ |
| | | public PayInfoResultBO validateAndGetPayInfo(HttpServletRequest request, PayType payType, String data) throws UnsupportedEncodingException, WxPayException, AlipayApiException { |
| | | |
| | | PayInfoResultBO payInfoResultBO = new PayInfoResultBO(); |
| | | |
| | | if (PayType.isWxPay(payType)) { |
| | | WxPayService wxPayService = wxConfig.getWxPayService(payType); |
| | | Integer wxPayVersion = shopConfig.getWxPay().getVersion(); |
| | | // v3需要的配置 |
| | | if (Objects.equals(WxPay.VERSION_3, wxPayVersion)) { |
| | | WxPayOrderNotifyV3Result wxPayOrderNotifyV3Result = wxPayService.parseOrderNotifyV3Result(data, getSignatureHeader(request)); |
| | | payInfoResultBO.setPayNo(wxPayOrderNotifyV3Result.getResult().getOutTradeNo()); |
| | | payInfoResultBO.setBizPayNo(wxPayOrderNotifyV3Result.getResult().getTransactionId()); |
| | | payInfoResultBO.setIsPaySuccess(SUCCESS.equals(wxPayOrderNotifyV3Result.getResult().getTradeState())); |
| | | // 返回200就行,无需内容 |
| | | // payInfoResultBO.setSuccessString(); |
| | | payInfoResultBO.setPayAmount(Arith.div(wxPayOrderNotifyV3Result.getResult().getAmount().getTotal(), 100)); |
| | | payInfoResultBO.setCallbackContent(data); |
| | | } else { |
| | | WxPayOrderNotifyResult parseOrderNotifyResult = wxPayService.parseOrderNotifyResult(data); |
| | | payInfoResultBO.setPayNo(parseOrderNotifyResult.getOutTradeNo()); |
| | | payInfoResultBO.setBizPayNo(parseOrderNotifyResult.getTransactionId()); |
| | | payInfoResultBO.setIsPaySuccess(SUCCESS.equals(parseOrderNotifyResult.getResultCode())); |
| | | payInfoResultBO.setSuccessString(WX_SUCCESS_XML); |
| | | payInfoResultBO.setPayAmount(Arith.div(parseOrderNotifyResult.getTotalFee(), 100)); |
| | | payInfoResultBO.setCallbackContent(data); |
| | | } |
| | | } else if (PayType.isAliPay(payType)) { |
| | | //获取支付宝POST过来反馈信息 |
| | | Map<String, String> params = parseAliNotifyAndGetResult(request); |
| | | |
| | | if (Objects.equals(params.get(TRADE_STATUS), TRADE_SUCCESS)) { |
| | | //商户订单号,之前生成的带用户ID的订单号 |
| | | payInfoResultBO.setPayNo(params.get("out_trade_no")); |
| | | //支付宝交易号 |
| | | payInfoResultBO.setBizPayNo(params.get("trade_no")); |
| | | payInfoResultBO.setIsPaySuccess(true); |
| | | payInfoResultBO.setSuccessString(ALI_SUCCESS); |
| | | payInfoResultBO.setPayAmount(new BigDecimal(params.get("total_amount")).doubleValue()); |
| | | // 这个是支付宝退款的通知 |
| | | if (StrUtil.isNotBlank(params.get(REFUND_FEE))) { |
| | | payInfoResultBO.setIsPaySuccess(false); |
| | | } |
| | | } else { |
| | | payInfoResultBO.setIsPaySuccess(false); |
| | | } |
| | | payInfoResultBO.setCallbackContent(Json.toJsonString(params)); |
| | | |
| | | } else if (Objects.equals(payType, PayType.PAYPAL)) { |
| | | // webhook 回调 |
| | | Map<String, String> headers = payPalConfig.getHeadersInfo(request); |
| | | WebhookParam webhookParam = JSON.parseObject(data, WebhookParam.class); |
| | | boolean isVerify = payPalConfig.verifyWebhookSign(request, headers, data); |
| | | if (!isVerify) { |
| | | // 验签失败 |
| | | throw new YamiShopBindException("yami.sign.check"); |
| | | } |
| | | String bizOrderNo = webhookParam.getResource().getId(); |
| | | if (StrUtil.isNotBlank(bizOrderNo)) { |
| | | // 查询是否支付完成如果系统订单是已经支付完成就退款 |
| | | PayInfo payInfo = payInfoMapper.selectOne(Wrappers.lambdaQuery(PayInfo.class) |
| | | .eq(PayInfo::getBizOrderNo, bizOrderNo).last("limit 1")); |
| | | if (Objects.isNull(payInfo)) { |
| | | // 找不到支付记录 |
| | | throw new YamiShopBindException("找不到支付记录" + data); |
| | | } |
| | | if (Objects.equals(PayStatus.PAYED.value(), payInfo.getPayStatus())) { |
| | | // 已支付完成,支付失败,订单不在未支付状态 |
| | | throw new YamiShopBindException("yami.order.pay.fail"); |
| | | } |
| | | // 执行扣款操作 |
| | | payInfoResultBO = payPalConfig.captureOrder(bizOrderNo); |
| | | } else { |
| | | payInfoResultBO.setIsPaySuccess(false); |
| | | } |
| | | payInfoResultBO.setCallbackContent(data); |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(payInfoResultBO.getCallbackContent())) { |
| | | PayInfo payInfo = new PayInfo(); |
| | | payInfo.setPayNo(payInfoResultBO.getPayNo()); |
| | | payInfo.setBizPayNo(payInfoResultBO.getBizPayNo()); |
| | | payInfo.setBizOrderNo(payInfoResultBO.getBizOrderNo()); |
| | | payInfo.setCallbackTime(new Date()); |
| | | payInfo.setCallbackContent(payInfoResultBO.getCallbackContent()); |
| | | // 支付宝多次回调可能该支付单已经退款,但还是更新了回调时间导致对账查询有误 |
| | | payInfoMapper.update(payInfo, new LambdaUpdateWrapper<PayInfo>() |
| | | .eq(PayInfo::getPayNo, payInfo.getPayNo()) |
| | | .eq(PayInfo::getPayStatus, PayStatus.UNPAY.value())); |
| | | } |
| | | return payInfoResultBO; |
| | | } |
| | | |
| | | @NotNull |
| | | private SignatureHeader getSignatureHeader(HttpServletRequest request) { |
| | | SignatureHeader signatureHeader = new SignatureHeader(); |
| | | signatureHeader.setSignature(request.getHeader("Wechatpay-Signature")); |
| | | signatureHeader.setNonce(request.getHeader("Wechatpay-Nonce")); |
| | | signatureHeader.setTimeStamp(request.getHeader("Wechatpay-TimeStamp")); |
| | | signatureHeader.setSerial(request.getHeader("Wechatpay-Serial")); |
| | | return signatureHeader; |
| | | } |
| | | |
| | | public boolean doRefund(RefundInfoDto refundInfo) { |
| | | |
| | | PayType payType = refundInfo.getPayType(); |
| | | if (Objects.equals(refundInfo.getRefundAmount(), 0.0)) { |
| | | return true; |
| | | } |
| | | Domain domain = shopConfig.getDomain(); |
| | | // 提交提款操作 |
| | | try { |
| | | if (PayType.isWxPay(payType)) { |
| | | // 订单金额 |
| | | double totalFee = Arith.mul(refundInfo.getPayAmount(), 100); |
| | | // 退款金额 |
| | | double refundFee = Arith.mul(refundInfo.getRefundAmount(), 100); |
| | | WxPayService wxPayService = wxConfig.getWxPayService(payType); |
| | | Integer wxPayVersion = shopConfig.getWxPay().getVersion(); |
| | | if (Objects.equals(WxPay.VERSION_3, wxPayVersion)) { |
| | | WxPayRefundV3Request wxPayRefundV3Request = new WxPayRefundV3Request(); |
| | | wxPayRefundV3Request.setOutTradeNo(refundInfo.getPayNo()); |
| | | wxPayRefundV3Request.setAmount(new WxPayRefundV3Request.Amount().setTotal((int) totalFee).setRefund((int) refundFee).setCurrency("CNY")); |
| | | wxPayRefundV3Request.setOutRefundNo(refundInfo.getRefundSn()); |
| | | // notifyUrl(通知结果) |
| | | if (!Objects.equals(refundInfo.getOnlyRefund(), 1)) { |
| | | // 只进行退款,不需要任何回调 |
| | | wxPayRefundV3Request.setNotifyUrl(domain.getMultishopDomainName() + refundInfo.getNotifyUrl()); |
| | | } |
| | | wxPayService.refundV3(wxPayRefundV3Request); |
| | | } else { |
| | | // 退款操作 |
| | | // 生成退款请求对象 |
| | | WxPayRefundRequest wxPayRefundRequest = new WxPayRefundRequest(); |
| | | // 商户订单号 |
| | | wxPayRefundRequest.setOutTradeNo(refundInfo.getPayNo()); |
| | | wxPayRefundRequest.setTotalFee((int) totalFee); |
| | | wxPayRefundRequest.setRefundFee((int) refundFee); |
| | | // 退款编码 |
| | | wxPayRefundRequest.setOutRefundNo(refundInfo.getRefundSn()); |
| | | |
| | | // notifyUrl(通知结果) |
| | | if (!Objects.equals(refundInfo.getOnlyRefund(), 1)) { |
| | | // 只进行退款,不需要任何回调 |
| | | wxPayRefundRequest.setNotifyUrl(domain.getMultishopDomainName() + refundInfo.getNotifyUrl()); |
| | | } |
| | | wxPayService.refund(wxPayRefundRequest); |
| | | } |
| | | } else if (PayType.isAliPay(payType)) { |
| | | AlipayTradeRefundRequest request = new AlipayTradeRefundRequest(); |
| | | request.setNotifyUrl(domain.getMultishopDomainName() + refundInfo.getNotifyUrl()); |
| | | AlipayTradeRefundModel alipayTradeRefundModel = new AlipayTradeRefundModel(); |
| | | alipayTradeRefundModel.setOutTradeNo(refundInfo.getPayNo()); |
| | | alipayTradeRefundModel.setOutRequestNo(refundInfo.getRefundSn()); |
| | | alipayTradeRefundModel.setRefundAmount(Double.toString(refundInfo.getRefundAmount())); |
| | | request.setBizModel(alipayTradeRefundModel); |
| | | AlipayTradeRefundResponse response = aliPayConfig.getAlipayClient().certificateExecute(request); |
| | | // 对fund_change必须了解为本次退款操作,若相同退款参数调用,第一次返回fund_change=Y,第二次返回fund_change=N,但是第二次仍返回退款信息。 |
| | | if (response.isSuccess() && StrUtil.isNotBlank(response.getFundChange())) { |
| | | return true; |
| | | } |
| | | } else if (Objects.equals(payType, PayType.BALANCE)) { |
| | | applicationContext.publishEvent(new BalanceRefundEvent(refundInfo)); |
| | | } else if (Objects.equals(payType, PayType.PAYPAL)) { |
| | | // payPal申请退款 |
| | | return payPalConfig.refundOrder(refundInfo); |
| | | } else if (Objects.equals(payType, PayType.BLUEPOINT)) {//蓝积分退款 |
| | | applicationContext.publishEvent(new BalanceRefundEvent(refundInfo)); |
| | | } else if (Objects.equals(payType, PayType.BLUEREDPOINT)) {//蓝积分退款 |
| | | applicationContext.publishEvent(new BalanceRefundEvent(refundInfo)); |
| | | } else if (Objects.equals(payType, PayType.BLUEBALANCEPOINT)) {//蓝积分退款 |
| | | applicationContext.publishEvent(new BalanceRefundEvent(refundInfo)); |
| | | } else if (Objects.equals(payType, PayType.REDPOINT)) {//蓝积分退款 |
| | | applicationContext.publishEvent(new BalanceRefundEvent(refundInfo)); |
| | | } else if (Objects.equals(payType, PayType.SDPEOPLEPAY)) {//蓝积分退款 |
| | | applicationContext.publishEvent(new BalanceRefundEvent(refundInfo)); |
| | | } |
| | | } catch (WxPayException e) { |
| | | logger.error("微信退款发生错误:", e); |
| | | throw new YamiShopBindException(e.getCustomErrorMsg(), e); |
| | | } catch (AlipayApiException e) { |
| | | logger.error("阿里退款发生错误:", e); |
| | | throw new YamiShopBindException(e.getErrMsg(), e); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public RefundInfoBo validateAndGetRefundInfo(HttpServletRequest request, PayType payType, String data) throws UnsupportedEncodingException, WxPayException, AlipayApiException { |
| | | |
| | | RefundInfoBo refundInfoBo = new RefundInfoBo(); |
| | | refundInfoBo.setIsRefundSuccess(false); |
| | | |
| | | if (PayType.isWxPay(payType)) { |
| | | Integer wxPayVersion = shopConfig.getWxPay().getVersion(); |
| | | WxPayService wxPayService = wxConfig.getWxPayService(payType); |
| | | if (Objects.equals(WxPay.VERSION_3, wxPayVersion)) { |
| | | WxPayRefundNotifyV3Result wxPayRefundNotifyV3Result = wxPayService.parseRefundNotifyV3Result(data, getSignatureHeader(request)); |
| | | WxPayRefundNotifyV3Result.DecryptNotifyResult result = wxPayRefundNotifyV3Result.getResult(); |
| | | if (Constant.SUCCESS.equals(result.getRefundStatus())) { |
| | | refundInfoBo.setIsRefundSuccess(true); |
| | | refundInfoBo.setSuccessString(WX_SUCCESS_XML); |
| | | refundInfoBo.setRefundNo(result.getOutRefundNo()); |
| | | refundInfoBo.setBizRefundNo(result.getRefundId()); |
| | | refundInfoBo.setCallbackContent(data); |
| | | } |
| | | } else { |
| | | WxPayRefundNotifyResult wxPayRefundNotifyResult = wxPayService.parseRefundNotifyResult(data); |
| | | WxPayRefundNotifyResult.ReqInfo reqInfo = wxPayRefundNotifyResult.getReqInfo(); |
| | | if (Constant.SUCCESS.equals(reqInfo.getRefundStatus())) { |
| | | refundInfoBo.setIsRefundSuccess(true); |
| | | refundInfoBo.setSuccessString(WX_SUCCESS_XML); |
| | | refundInfoBo.setRefundNo(reqInfo.getOutRefundNo()); |
| | | refundInfoBo.setBizRefundNo(reqInfo.getRefundId()); |
| | | refundInfoBo.setCallbackContent(data); |
| | | } |
| | | } |
| | | } else if (PayType.isAliPay(payType)) { |
| | | Map<String, String> params = parseAliNotifyAndGetResult(request); |
| | | if (Objects.equals(params.get(TRADE_STATUS), TRADE_SUCCESS) || Objects.equals(params.get(TRADE_STATUS), TRADE_CLOSED)) { |
| | | refundInfoBo.setIsRefundSuccess(true); |
| | | refundInfoBo.setRefundNo(params.get("out_biz_no")); |
| | | refundInfoBo.setBizRefundNo(""); |
| | | refundInfoBo.setSuccessString(ALI_SUCCESS); |
| | | refundInfoBo.setCallbackContent(Json.toJsonString(params)); |
| | | } |
| | | } |
| | | return refundInfoBo; |
| | | } |
| | | |
| | | public PayInfoResultBO getPayInfo(PayType payType, String payNo, String bizPayNo) { |
| | | Integer wxPayVersion = shopConfig.getWxPay().getVersion(); |
| | | PayInfoResultBO payInfo = new PayInfoResultBO(); |
| | | payInfo.setPayNo(payNo); |
| | | payInfo.setBizPayNo(bizPayNo); |
| | | try { |
| | | if (PayType.isWxPay(payType)) { |
| | | WxPayService wxPayService = wxConfig.getWxPayService(payType); |
| | | // v3需要的配置 |
| | | if (Objects.equals(WxPay.VERSION_3, wxPayVersion)) { |
| | | WxPayOrderQueryV3Result wxPayOrderQueryV3Result = wxPayService.queryOrderV3(null, payNo); |
| | | if (!Objects.isNull(wxPayOrderQueryV3Result) && Objects.equals(wxPayOrderQueryV3Result.getTradeState(), Constant.SUCCESS)) { |
| | | payInfo.setBizPayNo(wxPayOrderQueryV3Result.getTransactionId()); |
| | | payInfo.setIsPaySuccess(true); |
| | | } else { |
| | | payInfo.setIsPaySuccess(false); |
| | | } |
| | | } else { |
| | | WxPayOrderQueryResult wxPayOrderQueryResult = wxPayService.queryOrder(null, payNo); |
| | | if (!Objects.isNull(wxPayOrderQueryResult) && Objects.equals(wxPayOrderQueryResult.getTradeState(), Constant.SUCCESS)) { |
| | | payInfo.setBizPayNo(wxPayOrderQueryResult.getTransactionId()); |
| | | payInfo.setIsPaySuccess(true); |
| | | } else { |
| | | payInfo.setIsPaySuccess(false); |
| | | } |
| | | } |
| | | } else if (PayType.isAliPay(payType)) { |
| | | AlipayTradeQueryRequest request = new AlipayTradeQueryRequest(); |
| | | AlipayTradeQueryModel alipayTradeQueryModel = new AlipayTradeQueryModel(); |
| | | alipayTradeQueryModel.setOutTradeNo(payNo); |
| | | |
| | | request.setBizModel(alipayTradeQueryModel); |
| | | AlipayTradeQueryResponse response = aliPayConfig.getAlipayClient().certificateExecute(request); |
| | | if (response.isSuccess()) { |
| | | payInfo.setBizPayNo(response.getTradeNo()); |
| | | payInfo.setIsPaySuccess(true); |
| | | } else { |
| | | payInfo.setIsPaySuccess(false); |
| | | } |
| | | } else if (Objects.equals(payType, PayType.PAYPAL)) { |
| | | // paypal查单 |
| | | if (Objects.isNull(bizPayNo)) { |
| | | payInfo.setIsPaySuccess(false); |
| | | return payInfo; |
| | | } |
| | | payPalConfig.getCapture(payInfo); |
| | | } else { |
| | | payInfo.setIsPaySuccess(false); |
| | | } |
| | | } catch (WxPayException | AlipayApiException e) { |
| | | logger.error("获取支付信息错误:", e); |
| | | payInfo.setIsPaySuccess(false); |
| | | } |
| | | return payInfo; |
| | | } |
| | | |
| | | public Boolean cancelOrderQrCode(List<PayInfo> payInfoList) throws WxPayException, AlipayApiException { |
| | | Integer wxPayVersion = shopConfig.getWxPay().getVersion(); |
| | | Map<Integer, List<PayInfo>> payTypeMap = payInfoList.stream().collect(Collectors.groupingBy(PayInfo::getPayType)); |
| | | for (Integer payType : payTypeMap.keySet()) { |
| | | PayType type = PayType.instance(payType); |
| | | List<PayInfo> infoList = payTypeMap.get(payType); |
| | | for (PayInfo payInfo : infoList) { |
| | | if (PayType.isWxPay(type)) { |
| | | WxPayService wxPayService = wxConfig.getWxPayService(type); |
| | | // v3需要的配置 |
| | | if (Objects.equals(WxPay.VERSION_3, wxPayVersion)) { |
| | | wxPayService.closeOrderV3(payInfo.getPayNo()); |
| | | } else { |
| | | wxPayService.closeOrder(payInfo.getPayNo()); |
| | | } |
| | | } else if (PayType.isAliPay(type)) { |
| | | AlipayTradeCloseRequest tradeCloseRequest = new AlipayTradeCloseRequest(); |
| | | AlipayTradeCloseModel tradeCloseModel = new AlipayTradeCloseModel(); |
| | | tradeCloseModel.setOutTradeNo(payInfo.getPayNo()); |
| | | tradeCloseRequest.setBizModel(tradeCloseModel); |
| | | AlipayTradeCloseResponse response = aliPayConfig.getAlipayClient().certificateExecute(tradeCloseRequest); |
| | | logger.warn(response.getBody()); |
| | | if (!response.isSuccess()) { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 获取支付宝POST过来反馈信息 |
| | | * |
| | | * @param request |
| | | * @return |
| | | * @throws UnsupportedEncodingException |
| | | * @throws AlipayApiException |
| | | */ |
| | | private Map<String, String> parseAliNotifyAndGetResult(HttpServletRequest request) throws UnsupportedEncodingException, AlipayApiException { |
| | | Map<String, String> params = getRequestParamsMap(request); |
| | | //调用SDK验证签名 |
| | | boolean signVerified = AlipaySignature.rsaCertCheckV1(params, shopConfig.getAlipay().getAlipayCertPath(), cn.hutool.core.util.CharsetUtil.UTF_8, AlipayConstants.SIGN_TYPE_RSA2); |
| | | |
| | | if (!signVerified) { |
| | | // 验签失败 |
| | | throw new YamiShopBindException("yami.sign.check"); |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | /** |
| | | * 获取请求参数 |
| | | */ |
| | | private Map<String, String> getRequestParamsMap(HttpServletRequest request) throws UnsupportedEncodingException { |
| | | //乱码解决,这段代码在出现乱码时使用 |
| | | request.setCharacterEncoding("utf-8"); |
| | | //获取支付宝POST过来反馈信息 |
| | | Map<String, String> params = new HashMap<>(16); |
| | | Map<String, String[]> requestParams = request.getParameterMap(); |
| | | for (String name : requestParams.keySet()) { |
| | | String[] values = requestParams.get(name); |
| | | String valueStr = ""; |
| | | for (int i = 0; i < values.length; i++) { |
| | | valueStr = (i == values.length - 1) ? valueStr + values[i] |
| | | : valueStr + values[i] + ","; |
| | | } |
| | | params.put(name, valueStr); |
| | | } |
| | | return params; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yami.shop.manager.impl; |
| | | |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import com.yami.shop.bean.app.dto.ShopCartDto; |
| | | import com.yami.shop.bean.app.dto.ShopCartItemDiscountDto; |
| | | import com.yami.shop.bean.app.dto.ShopCartItemDto; |
| | | import com.yami.shop.common.util.Arith; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 购物车适配器 |
| | | * @author FrozenWatermelon |
| | | */ |
| | | @Component |
| | | @AllArgsConstructor |
| | | public class ShopCartAdapter { |
| | | |
| | | /** |
| | | * 将参数转换成组装好的购物项 |
| | | * @param shopCartItems 订单参数 |
| | | * @return 组装好的购物项 |
| | | */ |
| | | public List<ShopCartDto> getShopCarts(List<ShopCartItemDto> shopCartItems) { |
| | | // 根据店铺ID划分item |
| | | Map<Long, List<ShopCartItemDto>> shopCartMap = shopCartItems.stream().collect(Collectors.groupingBy(ShopCartItemDto::getShopId)); |
| | | // 返回一个店铺的所有信息 |
| | | List<ShopCartDto> shopCartDtoList = Lists.newArrayList(); |
| | | List<Long> shopIds=Lists.newArrayList(); |
| | | for (ShopCartItemDto shopCartItem : shopCartItems) { |
| | | if(!shopIds.contains(shopCartItem.getShopId())){ |
| | | shopIds.add(shopCartItem.getShopId()); |
| | | } |
| | | } |
| | | for (Long shopId : shopIds) { |
| | | // 获取店铺的所有商品项 |
| | | List<ShopCartItemDto> shopCartItemDtoList = shopCartMap.get(shopId); |
| | | // 构建每个店铺的购物车信息 |
| | | ShopCartDto shopCart = buildShopCart(shopId, shopCartItemDtoList); |
| | | |
| | | // 自营店的购物车位置是放在第一的 |
| | | if (Objects.equals(1L, shopId)) { |
| | | shopCartDtoList.add(0, shopCart); |
| | | } else { |
| | | shopCartDtoList.add(shopCart); |
| | | } |
| | | } |
| | | |
| | | return shopCartDtoList; |
| | | } |
| | | |
| | | private ShopCartDto buildShopCart(Long shopId, List<ShopCartItemDto> shopCartItems) { |
| | | // 构建每个店铺的购物车信息 |
| | | ShopCartDto shopCart = new ShopCartDto(); |
| | | // 店铺信息 |
| | | shopCart.setShopId(shopId); |
| | | ShopCartItemDto shopCartItemDto = shopCartItems.get(0); |
| | | shopCart.setShopName(shopCartItemDto.getShopName()); |
| | | shopCart.setShopCityStatus(shopCartItemDto.getShopCityStatus()); |
| | | shopCart.setShopReduce(0.0); |
| | | shopCart.setComboReduce(0.0); |
| | | shopCart.setCouponReduce(0.0); |
| | | shopCart.setDiscountReduce(0.0); |
| | | double total = 0.0; |
| | | int totalCount = 0; |
| | | double reduce = 0.0; |
| | | long scoreTotal = 0; |
| | | double actualTotal = 0.0; |
| | | |
| | | for (ShopCartItemDto shopCartItem : shopCartItems) { |
| | | if (Objects.nonNull(shopCartItem.getComboId()) && shopCartItem.getComboId() != 0) { |
| | | continue; |
| | | } |
| | | total = Arith.add(total, shopCartItem.getProductTotalAmount()); |
| | | actualTotal = Arith.add(actualTotal, shopCartItem.getActualTotal()); |
| | | reduce = shopCartItem.getShareReduce() == null ? 0.0 : shopCartItem.getShareReduce(); |
| | | totalCount += shopCartItem.getProdCount(); |
| | | scoreTotal += shopCartItem.getScorePrice(); |
| | | } |
| | | |
| | | ShopCartItemDiscountDto shopCartItemDiscountVO = new ShopCartItemDiscountDto(); |
| | | shopCartItemDiscountVO.setShopCartItems(shopCartItems); |
| | | shopCart.setShopCartItemDiscounts(Collections.singletonList(shopCartItemDiscountVO)); |
| | | shopCart.setTotal(total); |
| | | shopCart.setShopReduce(reduce); |
| | | shopCart.setTotalCount(totalCount); |
| | | shopCart.setActualTotal(actualTotal); |
| | | shopCart.setScoreTotal(scoreTotal); |
| | | return shopCart; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yami.shop.manager.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.yami.shop.bean.app.dto.ShopCartItemDto; |
| | | import com.yami.shop.bean.app.param.OrderItemParam; |
| | | import com.yami.shop.bean.enums.ProdType; |
| | | import com.yami.shop.bean.enums.ShopCityStatus; |
| | | import com.yami.shop.bean.enums.ShopStatus; |
| | | import com.yami.shop.bean.event.CheckAddrEvent; |
| | | import com.yami.shop.bean.model.Product; |
| | | import com.yami.shop.bean.model.ShopDetail; |
| | | import com.yami.shop.bean.model.Sku; |
| | | import com.yami.shop.bean.vo.VirtualRemarkVO; |
| | | import com.yami.shop.common.config.Constant; |
| | | import com.yami.shop.common.exception.YamiShopBindException; |
| | | import com.yami.shop.common.i18n.I18nMessage; |
| | | import com.yami.shop.common.util.Arith; |
| | | import com.yami.shop.common.util.Json; |
| | | import com.yami.shop.dao.BasketMapper; |
| | | import com.yami.shop.service.ProductService; |
| | | import com.yami.shop.service.ShopDetailService; |
| | | import com.yami.shop.service.SkuService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.yami.shop.common.util.SpringContextUtils.applicationContext; |
| | | |
| | | /** |
| | | * 购物车适配器 |
| | | * @author FrozenWatermelon |
| | | */ |
| | | @Component |
| | | @AllArgsConstructor |
| | | public class ShopCartItemAdapter { |
| | | |
| | | private final BasketMapper basketMapper; |
| | | |
| | | private final SkuService skuService; |
| | | |
| | | private final ShopDetailService shopDetailService; |
| | | |
| | | private final ProductService productService; |
| | | |
| | | /** |
| | | * 组装获取用户提交的购物车商品项 |
| | | * @param orderItem 提交订单时携带的商品信息 |
| | | * @param userId 当前用户的用户id |
| | | * @return 所有的商品购物项 |
| | | */ |
| | | public List<ShopCartItemDto> getShopCartItemsByOrderItems(OrderItemParam orderItem, String userId, Long addrId) { |
| | | // 当立即购买时,没有提交的订单是没有购物车信息的 |
| | | if (Objects.nonNull(orderItem)) { |
| | | if (Objects.nonNull(orderItem.getComboId())) { |
| | | return getComboShopCartItems(orderItem, userId, addrId); |
| | | } |
| | | return getShopCartItem(orderItem, null, userId, addrId); |
| | | } |
| | | |
| | | List<ShopCartItemDto> dbShopCartItems = getShopCartItems(userId, addrId).stream().filter(ShopCartItemDto::getIsChecked).collect(Collectors.toList()); |
| | | |
| | | if (CollUtil.isEmpty(dbShopCartItems)) { |
| | | // 请选择您需要的商品加入购物车 |
| | | throw new YamiShopBindException("yami.selelct.items"); |
| | | } |
| | | // 返回购物车选择的商品信息 |
| | | return dbShopCartItems; |
| | | } |
| | | |
| | | /** |
| | | * 根据用户ID获取购物车项内容列表 |
| | | * @param userId 用户ID |
| | | * @return 购物车信息项列表 |
| | | */ |
| | | public List<ShopCartItemDto> getShopCartItems(String userId, Long addrId) { |
| | | List<ShopCartItemDto> shopCartItemDtoList = basketMapper.getShopCartItems(userId, I18nMessage.getDbLang()); |
| | | for (ShopCartItemDto shopCartItemDto : shopCartItemDtoList) { |
| | | // 物流配送信息 |
| | | Product.DeliveryModeVO deliveryModeVO = Json.parseObject(shopCartItemDto.getDeliveryMode(), Product.DeliveryModeVO.class); |
| | | shopCartItemDto.setDeliveryModeVO(deliveryModeVO); |
| | | // 未开启同城配送 |
| | | if (!Objects.equals(ShopCityStatus.USABLE.value(), shopCartItemDto.getShopCityStatus())) { |
| | | deliveryModeVO.setHasCityDelivery(false); |
| | | } |
| | | shopCartItemDto.setProductTotalAmount(Arith.mul(shopCartItemDto.getProdCount(), shopCartItemDto.getPrice())); |
| | | shopCartItemDto.setActualTotal(shopCartItemDto.getProductTotalAmount()); |
| | | if (Objects.isNull(shopCartItemDto.getIsChecked())) { |
| | | shopCartItemDto.setIsChecked(false); |
| | | } |
| | | if (StrUtil.isNotBlank(shopCartItemDto.getVirtualRemark())) { |
| | | List<VirtualRemarkVO> virtualRemarkList = JSONUtil.parseArray(shopCartItemDto.getVirtualRemark()).toList(VirtualRemarkVO.class); |
| | | virtualRemarkList.forEach(virtualRemark -> virtualRemark.setProdId(shopCartItemDto.getProdId())); |
| | | shopCartItemDto.setVirtualRemarkList(virtualRemarkList); |
| | | } |
| | | if(Objects.equals(shopCartItemDto.getProdType(), ProdType.PROD_TYPE_ACTIVE.value()) || Objects.equals(shopCartItemDto.getMold(), 1) || Objects.equals(userId, null)){ |
| | | shopCartItemDto.setIsDelivery(true); |
| | | }else { |
| | | // 判断用户默认地址是否在配送区域内 |
| | | applicationContext.publishEvent(new CheckAddrEvent(addrId, userId, null, shopCartItemDto)); |
| | | } |
| | | } |
| | | return shopCartItemDtoList; |
| | | } |
| | | |
| | | /** |
| | | * 将参数转换成组装好的购物项 |
| | | * @param orderItem 购物车物品参数 |
| | | * @param activityPriceFee 活动价 |
| | | * @return 商品购物项 |
| | | */ |
| | | public List<ShopCartItemDto> getShopCartItem(OrderItemParam orderItem, Double activityPriceFee, String userId, Long addrId) { |
| | | Sku sku = skuService.getSkuBySkuId(orderItem.getSkuId(), I18nMessage.getDbLang()); |
| | | if (Objects.isNull(sku)) { |
| | | // 订单包含无法识别的商品 |
| | | throw new RuntimeException("yami.order.unrecognized.prod"); |
| | | } |
| | | Product prod = productService.getProductByProdId(sku.getProdId(), I18nMessage.getDbLang()); |
| | | if (Objects.isNull(prod)) { |
| | | // 订单包含无法识别的商品 |
| | | throw new RuntimeException("yami.order.unrecognized.prod"); |
| | | } |
| | | if (orderItem.getProdCount() < 1) { |
| | | // 下单商品数量不能小于1 |
| | | throw new RuntimeException("yami.order.prod.count.limit"); |
| | | } |
| | | // 拿到购物车的所有item |
| | | ShopCartItemDto shopCartItem = new ShopCartItemDto(); |
| | | shopCartItem.setBasketId(-1L); |
| | | shopCartItem.setSkuId(sku.getSkuId()); |
| | | shopCartItem.setProdId(prod.getProdId()); |
| | | shopCartItem.setProdType(prod.getProdType()); |
| | | shopCartItem.setCategoryId(prod.getCategoryId()); |
| | | shopCartItem.setProdCount(orderItem.getProdCount()); |
| | | if (Objects.equals(prod.getProdType(), ProdType.PROD_TYPE_SCORE.value())) { |
| | | shopCartItem.setScorePrice(sku.getSkuScore() * orderItem.getProdCount()); |
| | | } |
| | | // 虚拟商品参数 |
| | | if (Objects.equals(prod.getMold(), 1)) { |
| | | shopCartItem.setWriteOffNum(prod.getWriteOffNum()); |
| | | shopCartItem.setWriteOffMultipleCount(prod.getWriteOffMultipleCount()); |
| | | shopCartItem.setWriteOffStart(prod.getWriteOffStart()); |
| | | shopCartItem.setWriteOffEnd(prod.getWriteOffEnd()); |
| | | shopCartItem.setWriteOffTime(prod.getWriteOffTime()); |
| | | shopCartItem.setIsRefund(prod.getIsRefund()); |
| | | if (StrUtil.isNotBlank(prod.getVirtualRemark())) { |
| | | List<VirtualRemarkVO> virtualRemarkList = JSONUtil.parseArray(prod.getVirtualRemark()).toList(VirtualRemarkVO.class); |
| | | for (VirtualRemarkVO virtualRemarkVO : virtualRemarkList) { |
| | | if(virtualRemarkVO.getIsRequired() == null){ |
| | | virtualRemarkVO.setIsRequired(false); |
| | | } |
| | | virtualRemarkVO.setProdId(shopCartItem.getProdId()); |
| | | } |
| | | shopCartItem.setVirtualRemarkList(virtualRemarkList); |
| | | } |
| | | } |
| | | shopCartItem.setMold(Objects.isNull(prod.getMold()) ? 0 : prod.getMold()); |
| | | shopCartItem.setSkuName(sku.getSkuName()); |
| | | shopCartItem.setProdName(prod.getProdName()); |
| | | shopCartItem.setCategoryId(prod.getCategoryId()); |
| | | shopCartItem.setPreSellTime(prod.getPreSellTime()); |
| | | shopCartItem.setPreSellStatus(prod.getPreSellStatus()); |
| | | shopCartItem.setPic(StrUtil.isBlank(sku.getPic()) ? prod.getPic() : sku.getPic()); |
| | | // 存起中英文 |
| | | shopCartItem.setProdNameCn(prod.getProdNameCn()); |
| | | shopCartItem.setProdNameEn(prod.getProdNameEn()); |
| | | shopCartItem.setBasketDate(new Date()); |
| | | shopCartItem.setDistributionCardNo(orderItem.getDistributionCardNo()); |
| | | shopCartItem.setPrice(sku.getPrice()); |
| | | shopCartItem.setProductTotalAmount(Arith.mul(sku.getPrice(), orderItem.getProdCount())); |
| | | // 初始化商品实际金额 |
| | | shopCartItem.setActualTotal(shopCartItem.getProductTotalAmount()); |
| | | shopCartItem.setShareReduce(0.0); |
| | | // 如果有活动价并且活动价大于0则使用活动价格 |
| | | if (activityPriceFee != null && activityPriceFee > 0.0) { |
| | | // 商品实际金额,优惠金额放入店铺金额 |
| | | shopCartItem.setPrice(activityPriceFee); |
| | | shopCartItem.setActualTotal(Arith.mul(shopCartItem.getProdCount(), activityPriceFee)); |
| | | double shareReduce = Math.max(Arith.sub(shopCartItem.getProductTotalAmount(), shopCartItem.getActualTotal()), 0.0); |
| | | shopCartItem.setShareReduce(shareReduce); |
| | | } |
| | | // 物流配送信息 |
| | | shopCartItem.setDeliveryMode(prod.getDeliveryMode()); |
| | | shopCartItem.setDeliveryTemplateId(prod.getDeliveryTemplateId()); |
| | | shopCartItem.setDeliveryAmount(prod.getDeliveryAmount()); |
| | | Product.DeliveryModeVO deliveryModeVO = Json.parseObject(shopCartItem.getDeliveryMode(), Product.DeliveryModeVO.class); |
| | | shopCartItem.setDeliveryModeVO(deliveryModeVO); |
| | | if (prod.getShopId() == 0) { |
| | | shopCartItem.setShopId(Constant.PLATFORM_SHOP_ID); |
| | | shopCartItem.setShopName(Constant.PLATFORM_SHOP_NAME); |
| | | } else { |
| | | ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(prod.getShopId()); |
| | | if (!Objects.equals(shopDetail.getShopStatus(), ShopStatus.OPEN.value())) { |
| | | // 店铺不处于营业状态 |
| | | throw new YamiShopBindException("yami.store.shop.state.check"); |
| | | } |
| | | shopCartItem.setShopId(shopDetail.getShopId()); |
| | | shopCartItem.setShopName(shopDetail.getShopName()); |
| | | } |
| | | shopCartItem.setVolume(sku.getVolume()); |
| | | shopCartItem.setWeight(sku.getWeight()); |
| | | if(Objects.equals(shopCartItem.getProdType(), ProdType.PROD_TYPE_ACTIVE.value()) || Objects.equals(shopCartItem.getMold(), 1) || Objects.equals(userId, null)){ |
| | | shopCartItem.setIsDelivery(true); |
| | | }else { |
| | | // 判断用户默认地址是否在配送区域内 |
| | | applicationContext.publishEvent(new CheckAddrEvent(addrId, userId, null, shopCartItem)); |
| | | } |
| | | return Collections.singletonList(shopCartItem); |
| | | } |
| | | |
| | | private List<ShopCartItemDto> getComboShopCartItems(OrderItemParam orderItem, String userId, Long addrId) { |
| | | List<ShopCartItemDto> shopCartItems = new ArrayList<>(); |
| | | ShopCartItemDto mainShopCartItem = getShopCartItem(orderItem, null, userId, addrId).get(0); |
| | | if (orderItem.getProdCount() < 1) { |
| | | orderItem.setProdCount(1); |
| | | } |
| | | mainShopCartItem.setIsMainProd(1); |
| | | shopCartItems.add(mainShopCartItem); |
| | | if (CollUtil.isNotEmpty(orderItem.getMatchingSkuIds())) { |
| | | for (Long skuId : orderItem.getMatchingSkuIds()) { |
| | | OrderItemParam matchingOrderItem = new OrderItemParam(); |
| | | matchingOrderItem.setSkuId(skuId); |
| | | matchingOrderItem.setComboId(orderItem.getComboId()); |
| | | matchingOrderItem.setProdCount(orderItem.getProdCount()); |
| | | ShopCartItemDto matchingShopCartItem = getShopCartItem(matchingOrderItem, null, userId, addrId).get(0); |
| | | matchingShopCartItem.setIsMainProd(0); |
| | | shopCartItems.add(matchingShopCartItem); |
| | | } |
| | | } |
| | | for (ShopCartItemDto shopCartItem : shopCartItems) { |
| | | shopCartItem.setComboId(orderItem.getComboId()); |
| | | shopCartItem.setComboCount(orderItem.getProdCount()); |
| | | shopCartItem.setProdCount(0); |
| | | } |
| | | return shopCartItems; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yami.shop.manager.impl; |
| | | |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.alipay.api.AlipayClient; |
| | | import com.alipay.api.AlipayConfig; |
| | | import com.alipay.api.DefaultAlipayClient; |
| | | import com.alipay.api.domain.AlipayFundTransUniTransferModel; |
| | | import com.alipay.api.domain.Participant; |
| | | import com.alipay.api.request.AlipayFundTransUniTransferRequest; |
| | | import com.alipay.api.response.AlipayFundTransUniTransferResponse; |
| | | import com.yami.shop.bean.pay.TransferDto; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.config.AliPayConfig; |
| | | import lombok.AllArgsConstructor; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class TransferManager { |
| | | private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | @Autowired |
| | | private AliPayConfig aliPayConfig; |
| | | |
| | | |
| | | public ServerResponseEntity<?> aliTransfer(TransferDto transferDto) throws AlipayApiException { |
| | | // 初始化SDK |
| | | AlipayClient alipayClient = aliPayConfig.getAlipayClient(); |
| | | |
| | | // 构造请求参数以调用接口 |
| | | AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest(); |
| | | AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel(); |
| | | // 设置商家侧唯一订单号 |
| | | model.setOutBizNo(transferDto.getOutBizNo()); |
| | | // 设置订单总金额 |
| | | model.setTransAmount(transferDto.getTransAmount()); |
| | | // 设置描述特定的业务场景 |
| | | model.setBizScene("DIRECT_TRANSFER"); |
| | | // 设置业务产品码 |
| | | model.setProductCode("TRANS_ACCOUNT_NO_PWD"); |
| | | // 设置转账业务的标题 |
| | | model.setOrderTitle(transferDto.getOrderTitle()); |
| | | // 设置收款方信息 |
| | | Participant payeeInfo = new Participant(); |
| | | payeeInfo.setIdentity(transferDto.getIdentity()); |
| | | payeeInfo.setName(transferDto.getName()); |
| | | payeeInfo.setIdentityType(transferDto.getIdentityType()); |
| | | model.setPayeeInfo(payeeInfo); |
| | | |
| | | request.setBizModel(model); |
| | | AlipayFundTransUniTransferResponse response = alipayClient.certificateExecute(request); |
| | | System.out.println(response.getBody()); |
| | | |
| | | if (response.isSuccess()) { |
| | | return ServerResponseEntity.success(response.getBody()); |
| | | } else { |
| | | System.out.println("调用失败"); |
| | | // sdk版本是"4.38.0.ALL"及以上,可以参考下面的示例获取诊断链接 |
| | | // String diagnosisUrl = DiagnosisUtils.getDiagnosisUrl(response); |
| | | // System.out.println(diagnosisUrl); |
| | | } |
| | | return ServerResponseEntity.showFailMsg("转账失败"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.AgentLevel; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_agent_level(cdn 代理等级)】的数据库操作Service |
| | | * @createDate 2024-06-28 17:47:05 |
| | | */ |
| | | public interface AgentLevelService extends IService<AgentLevel> { |
| | | |
| | | List<AgentLevel> getCdnAgentLevelList(); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.yami.shop.bean.model.Agent; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_agent(代理商表)】的数据库操作Service |
| | | * @createDate 2024-06-03 14:08:39 |
| | | */ |
| | | public interface AgentService extends IService<Agent> { |
| | | |
| | | Long getAgentIdByAgentCode(String agentCode); |
| | | |
| | | Long getAgentIdByNearAgent(Long areaId); |
| | | public String getMobileByAgentId(Long agentId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.dto.AreaDto; |
| | | import com.yami.shop.bean.model.Area; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lgh on 2018/10/26. |
| | | */ |
| | | public interface AreaService extends IService<Area> { |
| | | |
| | | /** |
| | | * 通过pid 查找地址接口 |
| | | * |
| | | * @param pid 父id |
| | | * @return |
| | | */ |
| | | List<Area> listByPid(Long pid, Integer level); |
| | | |
| | | /** |
| | | * 通过pid 清除地址缓存 |
| | | * |
| | | * @param pid |
| | | */ |
| | | void removeAreaCacheByParentId(Long pid, Integer level); |
| | | |
| | | /** |
| | | * 删除区域列表缓存 |
| | | */ |
| | | void removeAreaListCache(); |
| | | |
| | | /** |
| | | * 获取所有区域组合数据列表 |
| | | * @return 区域列表 |
| | | */ |
| | | List<AreaDto> getAreaListInfo(); |
| | | |
| | | /** |
| | | * 获取省信息列表 |
| | | * @return 省列表 |
| | | */ |
| | | List<Area> getProvinceInfoList(); |
| | | |
| | | /** |
| | | * 获取可用的省市区列表 |
| | | * @return |
| | | */ |
| | | List<AreaDto> listAreaOfEnable(); |
| | | |
| | | /** |
| | | * 获取四层可用列表 |
| | | * @return |
| | | */ |
| | | List<AreaDto> getAllAreaList(); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.AttachFileGroup; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author chendt |
| | | * @date 2021/7/7 17:20 |
| | | */ |
| | | public interface AttachFileGroupService extends IService<AttachFileGroup> { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * @param shopId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | List<AttachFileGroup> list(Long shopId,Integer type); |
| | | |
| | | /** |
| | | * 根据id获取 |
| | | * |
| | | * @param attachFileGroupId id |
| | | * @return |
| | | */ |
| | | AttachFileGroup getByAttachFileGroupId(Long attachFileGroupId); |
| | | |
| | | /** |
| | | * 保存 |
| | | * @param attachFileGroup |
| | | */ |
| | | |
| | | void saveGroup(AttachFileGroup attachFileGroup); |
| | | |
| | | /** |
| | | * 更新 |
| | | * @param attachFileGroup |
| | | */ |
| | | void update(AttachFileGroup attachFileGroup); |
| | | |
| | | /** |
| | | * 根据id删除 |
| | | * @param attachFileGroupId |
| | | */ |
| | | void deleteById(Long attachFileGroupId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.AttachFile; |
| | | import com.yami.shop.common.util.PageParam; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lgh |
| | | * @date 2018/07/27 |
| | | */ |
| | | public interface AttachFileService extends IService<AttachFile> { |
| | | |
| | | /** |
| | | * 上传文件 |
| | | * @param bytes 文件byte数组 |
| | | * @param originalName 文件原名 |
| | | * @return 文件路径 |
| | | * @throws IOException |
| | | */ |
| | | String uploadFile(byte[] bytes,String originalName) throws IOException; |
| | | |
| | | |
| | | /** |
| | | * 商家端平台端上传文件 |
| | | * @param bytes 文件byte数组 |
| | | * @param originalName 文件原名 |
| | | * @param attachFile 文件信息 |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | Long mpUploadFile(byte[] bytes,String originalName,AttachFile attachFile) throws IOException; |
| | | |
| | | /** |
| | | * 上传图片 |
| | | * @param bytes 图片byte数组 |
| | | * @param attachFile 图片信息 |
| | | * @param extName 文件类型 |
| | | * @return 图片路径 |
| | | * @throws IOException |
| | | */ |
| | | Long uploadImg(byte[] bytes,AttachFile attachFile,String extName) throws IOException; |
| | | |
| | | /** |
| | | * 上传客服文件 |
| | | * @param bytes 文件byte数组 |
| | | * @param originalName 文件原名 |
| | | * @return 文件路径 |
| | | * @throws IOException |
| | | */ |
| | | String uploadImFile(byte[] bytes,String originalName) throws IOException; |
| | | |
| | | /** |
| | | * 平台端商家端客服文件上传 |
| | | * @param bytes 图片byte数组 |
| | | * @param originalName 文件信息 |
| | | * @param attachFile 文件信息 |
| | | * @return 文件路径 |
| | | * @throws IOException |
| | | */ |
| | | String mpUploadImFile(byte[] bytes,String originalName,AttachFile attachFile) throws IOException; |
| | | |
| | | /** |
| | | * 根据文件路径删除文件 |
| | | * @param filePath 文件路径 |
| | | */ |
| | | void deleteFile(String filePath); |
| | | |
| | | /** |
| | | * 更新文件信息 |
| | | * @param attachFile 文件信息 |
| | | * @return 是否成功 |
| | | */ |
| | | Boolean updateFile(AttachFile attachFile); |
| | | |
| | | /** |
| | | * 分页获取文件信息列表 |
| | | * @param page 分页参数 |
| | | * @param attachFile 文件搜索参数 |
| | | * @return 文件分页结果列表 |
| | | */ |
| | | IPage<AttachFile> getPage(PageParam<AttachFile> page, AttachFile attachFile); |
| | | |
| | | /** |
| | | * 根据文件Id列表与店铺id批量删除文件记录 |
| | | * @param ids |
| | | * @param shopId |
| | | */ |
| | | void deleteByIdsAndShopId(List<Long> ids, Long shopId); |
| | | |
| | | /** |
| | | * 根据店铺id与文件id列表与分组id批量移动文件 |
| | | * @param shopId |
| | | * @param attachFile |
| | | */ |
| | | void batchMoveByShopIdAndIdsAndGroupId(Long shopId, AttachFile attachFile); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.app.dto.ShopCartItemDto; |
| | | import com.yami.shop.bean.app.param.ChangeShopCartParam; |
| | | import com.yami.shop.bean.app.param.CheckShopCartItemParam; |
| | | import com.yami.shop.bean.app.param.ShopCartParam; |
| | | import com.yami.shop.bean.model.Basket; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lgh on 2018/10/18. |
| | | */ |
| | | public interface BasketService extends IService<Basket> { |
| | | |
| | | /** |
| | | * 根据用户ID与购物车ID删除购物车信息 |
| | | * @param userId 用户ID |
| | | * @param basketIds 购物车id列表删除参数 |
| | | */ |
| | | void deleteShopCartItemsByBasketIds(String userId, List<Long> basketIds); |
| | | |
| | | /** |
| | | * 添加购物车信息 |
| | | * @param param 购物车信息参数 |
| | | * @param userId 用户ID |
| | | */ |
| | | void addShopCartItem(ChangeShopCartParam param, String userId); |
| | | |
| | | /** |
| | | * 更新购物车信息 |
| | | * @param basket 购物车信息参数 |
| | | */ |
| | | void updateShopCartItem(Basket basket); |
| | | |
| | | /** |
| | | * 批量更新购物车信息 |
| | | * @param userId 用户id |
| | | * @param basketList 购物车信息列表 |
| | | */ |
| | | void updateShopCartItemBatch(String userId, List<Basket> basketList); |
| | | |
| | | /** |
| | | * 根据用户ID删除该用户下的所有购物车信息 |
| | | * @param userId 用户ID |
| | | */ |
| | | void deleteAllShopCartItems(String userId); |
| | | |
| | | /** |
| | | * 根据用户ID获取购物车中已下架的商品列表 |
| | | * @param userId 用户ID |
| | | * @return 商品已下架的购物车项列表 |
| | | */ |
| | | List<ShopCartItemDto> getShopCartExpiryItems(String userId); |
| | | |
| | | /** |
| | | * 根据用户ID删除该用户购物车中已下架的商品列表 |
| | | * @param userId 用户ID |
| | | */ |
| | | void cleanExpiryProdList(String userId); |
| | | |
| | | /** |
| | | * 根据用户ID批量更新用户的购物车信息 |
| | | * @param userId 用户ID |
| | | * @param shopCartParams 购物车信息列表 |
| | | * @param dbLang 当前选择语言 |
| | | */ |
| | | void updateBasketByShopCartParam(String userId, List<ShopCartParam> shopCartParams, Integer dbLang); |
| | | |
| | | /** |
| | | * 获取购物车中拥有某件商品的用户,用于清除该用户购物车的缓存 |
| | | * @param prodId 商品id |
| | | * @return 用户id |
| | | */ |
| | | List<String> listUserIdByProdId(Long prodId); |
| | | |
| | | /** |
| | | * 根据商品id获取购物车中拥有某件商品的用户,用于清除该用户购物车的缓存 |
| | | * @param pIds 商品id列表 |
| | | * @return 用户id列表 |
| | | */ |
| | | List<String> listUserIdByProdIds(List<Long> pIds); |
| | | |
| | | /** |
| | | * 根据用户id列表清除缓存 |
| | | * @param userIds 用户id列表 |
| | | */ |
| | | void removeCacheByUserIds(List<String> userIds); |
| | | |
| | | /** |
| | | * 删除购物车中的套餐信息 |
| | | * @param comboId 套餐id |
| | | * @param skuIds 规格id列表 |
| | | */ |
| | | void removeByComboIdAndSkuIds(Long comboId, List<Long> skuIds); |
| | | |
| | | /** |
| | | * 获取购物车商品数量 |
| | | * @param userId 用户id |
| | | * @return 购物车商品数量 |
| | | */ |
| | | Integer getShopCartProdNum(String userId); |
| | | |
| | | /** |
| | | * 勾选购物车状态 |
| | | * @param userId 用户id |
| | | * @param params 参数 |
| | | */ |
| | | void checkShopCartItems(String userId, List<CheckShopCartItemParam> params); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.dto.BrandShopDTO; |
| | | import com.yami.shop.bean.model.BrandLang; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 品牌-国际化表 |
| | | * |
| | | * @author YXF |
| | | * @date 2021-08-09 09:51:55 |
| | | */ |
| | | public interface BrandLangService extends IService<BrandLang> { |
| | | /** |
| | | * 保存品牌-国际化表 |
| | | * @param brandLangList 品牌-国际化表 |
| | | * @param brandId 品牌id |
| | | */ |
| | | void saveBrandLang(List<BrandLang> brandLangList, Long brandId); |
| | | |
| | | /** |
| | | * 更新品牌-国际化表 |
| | | * @param brandLangList 品牌-国际化表 |
| | | * @param brandId 品牌id |
| | | */ |
| | | void updateBrandLang(List<BrandLang> brandLangList, Long brandId); |
| | | |
| | | /** |
| | | * 批量插入品牌信息 |
| | | * |
| | | * @param brandList |
| | | * @param lang |
| | | */ |
| | | void insertBatch(@Param("brandList") List<BrandShopDTO> brandList, @Param("lang") Integer lang); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.dto.BrandShopDTO; |
| | | import com.yami.shop.bean.model.Brand; |
| | | import com.yami.shop.common.util.PageParam; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lgh |
| | | * @date 2018/07/05 |
| | | */ |
| | | public interface BrandService extends IService<Brand> { |
| | | |
| | | /** |
| | | * 分页获取品牌信息列表 |
| | | * @param page 分页参数 |
| | | * @param brand |
| | | * @return 品牌信息列表分页数据 |
| | | */ |
| | | IPage<Brand> page(PageParam<Brand> page, Brand brand); |
| | | |
| | | /** |
| | | * 根据品牌信息id获取品牌信息 |
| | | * |
| | | * @param brandId 品牌信息id |
| | | * @param lang |
| | | * @return 品牌信息 |
| | | */ |
| | | Brand getByBrandId(Long brandId, Integer lang); |
| | | |
| | | /** |
| | | * 根据品牌信息id获取品牌信息 |
| | | * |
| | | * @param brandId 品牌信息id |
| | | * @return 品牌信息 |
| | | */ |
| | | Brand getInfo(Long brandId); |
| | | |
| | | /** |
| | | * 保存品牌信息 |
| | | * @param brand 品牌信息 |
| | | */ |
| | | void saveBrand(Brand brand); |
| | | |
| | | /** |
| | | * 更新品牌信息 |
| | | * @param brandDTO 品牌信息 |
| | | * @return |
| | | */ |
| | | List<Long> updateBrand(Brand brandDTO); |
| | | |
| | | /** |
| | | * 根据品牌id,删除品牌 |
| | | * @param brandId |
| | | * @return |
| | | */ |
| | | List<Long> deleteById(Long brandId); |
| | | |
| | | /** |
| | | * 更新品牌状态(启用或禁用) |
| | | * @param brand |
| | | * @return |
| | | */ |
| | | List<Long> updateBrandStatus(Brand brand); |
| | | |
| | | /** |
| | | * 根据分类id,获取品牌列表 |
| | | * @param categoryId 分类id |
| | | * @param lang 语言 |
| | | * @return 品牌id |
| | | */ |
| | | List<Brand> listByCategory(Long categoryId, Integer lang); |
| | | |
| | | /** |
| | | * 清楚分类缓存 |
| | | * @param categoryIds |
| | | */ |
| | | void removeCache(List<Long> categoryIds); |
| | | |
| | | /** |
| | | * 批量插入品牌列表 |
| | | * @param brandShopList |
| | | */ |
| | | void insertBatchByBrandShopList(List<BrandShopDTO> brandShopList); |
| | | |
| | | /** |
| | | * 获取品牌列表 |
| | | * @param brand |
| | | * @return |
| | | */ |
| | | List<Brand> listByParams(Brand brand); |
| | | |
| | | /** |
| | | * 根据分类id与品牌名称获取分类下的品牌与店铺签约的品牌 |
| | | * @param page |
| | | * @param categoryId |
| | | * @param brandName |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | IPage<Brand> pageAvailableBrandByCategoryIdAndBrandNameAndShopId(PageParam<Brand> page, Long categoryId, String brandName, Long shopId); |
| | | |
| | | /** |
| | | * 根据店铺id更新该店铺下的品牌的店铺id和品牌状态 |
| | | * @param oldShopId |
| | | * @param status |
| | | * @param newShopId |
| | | */ |
| | | void updateShopIdAndStatusByShopId(Long oldShopId, Integer status, Long newShopId); |
| | | /** |
| | | * 根据分类id及品牌名称,获取品牌列表 |
| | | * @param categoryId |
| | | * @param brandName |
| | | * @return |
| | | */ |
| | | List<Brand> listByCategoryIdAndName(Long categoryId, String brandName); |
| | | |
| | | /** |
| | | * 获取指定品牌信息 |
| | | * @param brandIds |
| | | * @return |
| | | */ |
| | | List<Brand> listByBrandIds(Set<Long> brandIds); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.dto.BrandShopDTO; |
| | | import com.yami.shop.bean.dto.BrandSigningDTO; |
| | | import com.yami.shop.bean.model.BrandShop; |
| | | import com.yami.shop.bean.vo.BrandShopVO; |
| | | import com.yami.shop.bean.vo.BrandSigningVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author lth |
| | | * @Date 2021/7/28 11:26 |
| | | */ |
| | | public interface BrandShopService extends IService<BrandShop> { |
| | | |
| | | /** |
| | | * 签约品牌 |
| | | * @param brandSigningDTO |
| | | * @param shopId |
| | | * @param isPlatform |
| | | */ |
| | | void signingBrands(BrandSigningDTO brandSigningDTO, Long shopId, Boolean isPlatform); |
| | | |
| | | /** |
| | | * 根据店铺id获取品牌签约信息 |
| | | * @param shopId 店铺ID |
| | | * @param status |
| | | * @return 品牌签约信息列表 |
| | | */ |
| | | BrandSigningVO listSigningByShopId(Long shopId, Integer status); |
| | | |
| | | |
| | | /** |
| | | * 根据店铺id批量保存品牌签约信息 |
| | | * @param brandShopList |
| | | * @param shopId |
| | | * @param status |
| | | */ |
| | | void insertBatchByShopId(List<BrandShopDTO> brandShopList, Long shopId, Integer status); |
| | | |
| | | |
| | | /** |
| | | * 根据店铺id把自定义品牌更新为平台品牌 |
| | | * @param shopId |
| | | */ |
| | | void updateCustomBrandToPlatformBrandByShopId(Long shopId); |
| | | |
| | | /** |
| | | * 根据店铺id与状态更改签约状态 |
| | | * @param shopId |
| | | * @param oldStatus |
| | | * @param newStatus |
| | | */ |
| | | void changeStatusByShopIdAndStatus(Long shopId, Integer oldStatus, Integer newStatus); |
| | | |
| | | /** |
| | | * 根据品牌id删除店铺品牌关联关系 |
| | | * @param brandId |
| | | */ |
| | | void deleteByBrandId(Long brandId); |
| | | |
| | | /** |
| | | * 根据店铺id分页签约的品牌列表 |
| | | * @param page |
| | | * @param brandShop |
| | | * @return |
| | | */ |
| | | IPage<BrandShopVO> pageSigningByShopId(PageParam<BrandShopVO> page, BrandShopDTO brandShop); |
| | | |
| | | /** |
| | | * 根据店铺id与品牌id删除品牌签约信息 |
| | | * @param shopId |
| | | * @param brandId |
| | | */ |
| | | void deleteByShopIdAndBrandId(Long shopId, Long brandId); |
| | | |
| | | /** |
| | | * 批量保存签约品牌信息 |
| | | * @param addBrandList |
| | | * @param shopId |
| | | * @param status |
| | | */ |
| | | void insertBatchByBrandShopListAndShopId(List<BrandShop> addBrandList, Long shopId, Integer status); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.C2cRealName; |
| | | import com.yami.shop.bean.model.C2cRealName; |
| | | import com.yami.shop.common.util.PageParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_real_name(实名认证)】的数据库操作Service |
| | | * @createDate 2024-07-01 11:38:28 |
| | | */ |
| | | public interface C2cRealNameService extends IService<C2cRealName> { |
| | | |
| | | IPage<C2cRealName> getC2cRealNamePage(PageParam<C2cRealName> page, C2cRealName C2cRealName); |
| | | List<C2cRealName> getC2cRealNames(C2cRealName C2cRealName); |
| | | C2cRealName getC2cRealNameById(Long id); |
| | | Integer saveC2cRealName(C2cRealName C2cRealName); |
| | | Integer updateC2cRealName(C2cRealName C2cRealName); |
| | | Integer deleteC2cRealName(Long id); |
| | | void audit(C2cRealName cdnRelease); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.Category; |
| | | import com.yami.shop.bean.model.CategoryBrand; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lgh |
| | | * @date 2018/07/13 |
| | | */ |
| | | public interface CategoryBrandService extends IService<CategoryBrand> { |
| | | |
| | | /** |
| | | * 根据品牌id或者关联的分类列表 |
| | | * @param brandId |
| | | * @return |
| | | */ |
| | | List<Long> getCategoryIdBrandId(Long brandId); |
| | | |
| | | /** |
| | | * 获取品牌绑定的分类信息 |
| | | * @param brandId 品牌id |
| | | * @return 分类列表 |
| | | */ |
| | | List<Category> getCategoryByBrandId(Long brandId); |
| | | |
| | | /** |
| | | * 保存品牌信息 |
| | | * @param brandId |
| | | * @param categoryIds |
| | | */ |
| | | void saveByCategoryIds(Long brandId, List<Long> categoryIds); |
| | | |
| | | /** |
| | | * 更新品牌信息 |
| | | * @param brandId |
| | | * @param categoryIds |
| | | */ |
| | | void updateByCategoryIds(Long brandId, List<Long> categoryIds); |
| | | |
| | | /** |
| | | * 根据品牌id删除品牌分类关联信息 |
| | | * @param brandId |
| | | */ |
| | | void deleteByBrandId(Long brandId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.bo.PlatformCommissionOrderItemBO; |
| | | import com.yami.shop.bean.model.Category; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 商品分类 |
| | | * @author yami |
| | | */ |
| | | public interface CategoryExcelService { |
| | | |
| | | |
| | | void export(HttpServletResponse response, Long shopId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CategoryLang; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author LGH |
| | | * @date 2021-02-24 17:02:06 |
| | | */ |
| | | public interface CategoryLangService extends IService<CategoryLang> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CategoryLifeShop; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_category_life_shop(店铺分类关联信息)】的数据库操作Service |
| | | * @createDate 2024-06-04 20:28:21 |
| | | */ |
| | | public interface CategoryLifeShopService extends IService<CategoryLifeShop> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CategoryProp; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author lgh |
| | | * @date 2018/07/13 |
| | | */ |
| | | public interface CategoryPropService extends IService<CategoryProp> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.bo.PlatformCommissionOrderItemBO; |
| | | import com.yami.shop.bean.model.Brand; |
| | | import com.yami.shop.bean.model.Category; |
| | | import com.yami.shop.bean.vo.CategoryVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 商品分类 |
| | | * @author yami |
| | | */ |
| | | public interface CategoryService extends IService<Category> { |
| | | |
| | | /** |
| | | * 保存分类、品牌、参数 |
| | | * @param category 分类信息 |
| | | */ |
| | | void saveCategroy(Category category); |
| | | |
| | | /** |
| | | * 修改分类、品牌、参数 |
| | | * @param category 分类信息 |
| | | */ |
| | | void updateCategroy(Category category); |
| | | |
| | | /** |
| | | * 删除分类、品牌、参数 以及分类对应的图片 |
| | | * @param category 分类信息 |
| | | */ |
| | | void deleteCategroy(Category category); |
| | | |
| | | /** |
| | | * 通过分类id和店铺id获取分类信息 |
| | | * @param categoryId 分类ID |
| | | * @param shopId 店铺ID |
| | | * @return 分类信息 |
| | | */ |
| | | Category getCategoryByCategoryIdAndShopId(Long categoryId, Long shopId); |
| | | |
| | | /** |
| | | * 根据店铺id和顶级分类id,获取分类 |
| | | * @param parentId 顶级分类id |
| | | * @param shopId 店铺id |
| | | * @param dbLang 当前选择语言 |
| | | * @return 分类信息列表 |
| | | */ |
| | | List<Category> listByParentIdAndShopId(Long parentId, Long shopId, Integer dbLang); |
| | | |
| | | /** |
| | | * 根据店铺id获取分类 |
| | | * @param shopId 店铺id |
| | | * @return 分类信息列表 |
| | | */ |
| | | List<Category> listByShopId(Long shopId); |
| | | |
| | | /** |
| | | * 根据分类ID获取该分类的父分类ID |
| | | * @param parentId 分类ID |
| | | * @return 父分类ID |
| | | */ |
| | | Long getParentCategoryByParentId(Long parentId); |
| | | |
| | | /** |
| | | * 通过顶级id和当前选择语言删除缓存 |
| | | * @param parentId |
| | | * @param shopId |
| | | * @param lang |
| | | */ |
| | | void removeCacheByParentIdAndLang(Long parentId,Long shopId,Integer lang); |
| | | |
| | | /** |
| | | * 根据分类查找条件参数查找分类列表 |
| | | * @param category 分类查找条件参数 |
| | | * @return 分类列表 |
| | | */ |
| | | List<Category> categoryList(Category category); |
| | | |
| | | /** |
| | | * 根据分类查找条件参数查找分类列表[语言] |
| | | * @param category 分类查找条件参数 |
| | | * @return 分类列表 |
| | | */ |
| | | List<Category> categoryLangList(Category category); |
| | | |
| | | /** |
| | | * 分页 - 根据分类查找条件参数查找分类列表[语言] |
| | | * @param page 分页参数 |
| | | * @param category 分类查找条件 |
| | | * @return |
| | | */ |
| | | IPage<Category> pageCategoryLangList(PageParam<Category> page, Category category); |
| | | |
| | | /** |
| | | * 根据语言获取分类 |
| | | * @param lang 当前选择语言 |
| | | * @param maxGrade 最大级别 |
| | | * @param parentId 父分类ID |
| | | * @param status 状态 |
| | | * @param shopId 店铺ID |
| | | * @return 分类信息列表 |
| | | */ |
| | | List<Category> listByLang(Integer lang, Integer maxGrade, Long parentId, Integer status, Long shopId); |
| | | |
| | | /** |
| | | * 根据名称查找名称相同的分类数量,如果设置了category_id参数,则等于category_id等于该参数的分类不参与运算 |
| | | * @param category 分类查找参数 |
| | | * @return 相同名称的数量 |
| | | */ |
| | | Integer getCategoryName(Category category); |
| | | |
| | | /** |
| | | * 根据分类ID获取分类 |
| | | * @param categoryId 分类ID |
| | | * @return 分类信息 |
| | | */ |
| | | Category getCategoryByCategoryId(Long categoryId); |
| | | |
| | | /** |
| | | * 根据等级,店铺id,状态获取分类列表 |
| | | * @param lang 当前选择语言 |
| | | * @param grade 最大级别 |
| | | * @param status 状态 |
| | | * @param shopId 店铺id |
| | | * @return 分类信息列表 |
| | | */ |
| | | List<Category> listByGrade(Integer lang, Integer grade, Integer status, Long shopId); |
| | | |
| | | /** |
| | | * 根据分类,店铺,获取订单项的佣金比例 |
| | | * @param platformCommissionOrderItems 订单项平台佣金需要的参数 |
| | | * @param categoryRates |
| | | * @return 订单项佣金比例 |
| | | */ |
| | | List<PlatformCommissionOrderItemBO> calculatePlatformCommission(List<PlatformCommissionOrderItemBO> platformCommissionOrderItems, List<Category> categoryRates); |
| | | |
| | | /** |
| | | * 获取整个平台的佣金比例 |
| | | * @return 整个平台的佣金比例 |
| | | */ |
| | | List<Category> listRate(); |
| | | |
| | | /** |
| | | * 清除整个平台的佣金比例缓存 |
| | | * @return 清除整个平台的佣金比例缓存 |
| | | */ |
| | | void removeListRateCache(); |
| | | |
| | | /** |
| | | * 获取当前节点所有父节点的分类ids,以及当前分类节点的父级节点的父级几点的分类ids |
| | | * @param categoryIds 当前分类节点ids |
| | | * @return 所有父级节点ids |
| | | */ |
| | | List<Long> getParentIdsByCategoryId(List<Long> categoryIds); |
| | | |
| | | /** |
| | | * 获取分类的pathName集合 |
| | | * @param categories 分类集合 |
| | | */ |
| | | void getPathNames(List<CategoryVO> categories); |
| | | |
| | | /** |
| | | * 获取可以签约的平台分类列表(已经签约平台分类不会返回) |
| | | * @param shopId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Category> listApplySigningCategory(Long shopId, Integer lang); |
| | | |
| | | /** |
| | | * 根据分类id列表获取分类列表 |
| | | * @param cids |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Category> listByCategoryIds(Set<Long> cids, Integer lang); |
| | | |
| | | /** |
| | | * 根据店铺id,父分类id,级别获取分类列表 |
| | | * @param shopId |
| | | * @param parentId |
| | | * @param grade |
| | | * @return |
| | | */ |
| | | List<Category> listByShopIdAndParentIdAndGrade(Long shopId, Long parentId, Integer grade); |
| | | |
| | | /** |
| | | * 平台可用分类-必须是启用分类且分类下包含启用的三级分类 |
| | | * |
| | | * 目前前端用的都是maxGrade = 2,也就是包含一到三级启用的分类, |
| | | * 而且要判断分类下是否包含三级分类也要查询所有分类进行判断,所以此处不需要传参了, |
| | | * 默认返回所有符合条件的分类 |
| | | * @return |
| | | */ |
| | | List<Category> platformCategory(); |
| | | |
| | | /** |
| | | * 获取分类及上级分类的信息 |
| | | * @param categoryId |
| | | * @return |
| | | */ |
| | | List<Category> getCategoryAndParent(Long categoryId); |
| | | |
| | | |
| | | /** |
| | | * 根据分类信息(分类、上级分类名称列表) |
| | | * |
| | | * @param categoryId 分类信息id |
| | | * @return 分类信息 |
| | | */ |
| | | CategoryVO getInfo(Long categoryId); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.dto.CategoryShopDTO; |
| | | import com.yami.shop.bean.model.Category; |
| | | import com.yami.shop.bean.model.CategoryShop; |
| | | import com.yami.shop.bean.vo.CategoryShopVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author lth |
| | | * @Date 2021/7/28 10:25 |
| | | */ |
| | | public interface CategoryShopService extends IService<CategoryShop> { |
| | | |
| | | /** |
| | | * 签约分类 |
| | | * @param categoryShopList 签约的分类信息列表 |
| | | * @param shopId 签约的店铺id |
| | | * @param isPlatform 是否是平台端操作 |
| | | */ |
| | | void signingCategory(List<CategoryShop> categoryShopList, Long shopId, Boolean isPlatform); |
| | | |
| | | /** |
| | | * 根据店铺id批量保存分类签约信息 |
| | | * @param categoryShopList |
| | | * @param shopId |
| | | * @param status |
| | | * @return |
| | | */ |
| | | void insertBatchByShopId(List<CategoryShop> categoryShopList, Long shopId, Integer status); |
| | | |
| | | /** |
| | | * 根据店铺id获取签约的分类列表(返回所有) |
| | | * @param shopId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<CategoryShopVO> listSigningCategoryByShopId(Long shopId, Integer lang); |
| | | |
| | | /** |
| | | * 获取店铺签约的可用分类列表(发布商品时使用) |
| | | * @param shopId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Category> listAvailableSigningCategory(Long shopId, Integer lang); |
| | | |
| | | /** |
| | | * 根据店铺id获取平台佣金 |
| | | * @param shopId 店铺id |
| | | * @return 平台佣金 |
| | | */ |
| | | List<Category> listRateByShopId(Long shopId); |
| | | |
| | | /** |
| | | * 根据分类id删除店铺分类关联关系 |
| | | * @param categoryId |
| | | */ |
| | | void deleteByCategoryId(Long categoryId); |
| | | |
| | | /** |
| | | * 根据存在变化的分类的id列表清除缓存 |
| | | * @param categoryIds |
| | | */ |
| | | void removeCacheByChangeCategoryIds(List<Long> categoryIds); |
| | | |
| | | /** |
| | | * 根据店铺id与状态更改签约状态 |
| | | * @param shopId |
| | | * @param oldStatus |
| | | * @param newStatus |
| | | */ |
| | | void changeStatusByShopIdAndStatus(Long shopId, Integer oldStatus, Integer newStatus); |
| | | |
| | | /** |
| | | * 根据店铺ids清除缓存 |
| | | * @param shopIds |
| | | */ |
| | | void removeCacheByShopIds(List<Long> shopIds); |
| | | |
| | | /** |
| | | * 分页获取分类签约信息 |
| | | * @param page |
| | | * @param categoryShop |
| | | * @return |
| | | */ |
| | | IPage<CategoryShopVO> pageSigningInfo(PageParam<CategoryShopVO> page, CategoryShopDTO categoryShop); |
| | | |
| | | /** |
| | | * 根据店铺id与分类id删除签约分类 |
| | | * @param shopId |
| | | * @param categoryId |
| | | */ |
| | | void delete(Long shopId, Long categoryId); |
| | | |
| | | /** |
| | | * 根据店铺id与分类id更新自定义扣率 |
| | | * @param shopId |
| | | * @param categoryId |
| | | * @param rate |
| | | */ |
| | | void updateRate(Long shopId, Long categoryId, Double rate); |
| | | |
| | | /** |
| | | * 获取店铺签约的分类和签约分类的上级分类 |
| | | * @param shopId |
| | | * @param lang |
| | | * @return |
| | | */ |
| | | List<Category> listSigningCategoryAndParent(Long shopId, Integer lang); |
| | | |
| | | List<String> getCategory(); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnAgentLevel; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_agent_level(cdn 代理等级)】的数据库操作Service |
| | | * @createDate 2024-06-28 17:47:05 |
| | | */ |
| | | public interface CdnAgentLevelService extends IService<CdnAgentLevel> { |
| | | |
| | | List<CdnAgentLevel> getCdnAgentLevelList(); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnBind; |
| | | import com.yami.shop.bean.param.CdnNodeInfoParam; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_bind(cdn绑定用户)】的数据库操作Service |
| | | * @createDate 2024-06-29 14:41:29 |
| | | */ |
| | | public interface CdnBindService extends IService<CdnBind> { |
| | | /** |
| | | * 获取节点建设进度 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | CdnNodeInfoParam getNodeInfo(String userId); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnCenterLevel; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_center_level(cdn 中心等级)】的数据库操作Service |
| | | * @createDate 2024-06-28 17:47:05 |
| | | */ |
| | | public interface CdnCenterLevelService extends IService<CdnCenterLevel> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnConfig; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_config(系统配置)】的数据库操作Service |
| | | * @createDate 2024-07-02 00:02:47 |
| | | */ |
| | | public interface CdnConfigService extends IService<CdnConfig> { |
| | | |
| | | List<CdnConfig> getList(String group); |
| | | |
| | | /*** |
| | | * 更新 |
| | | * @param cdnConfig |
| | | */ |
| | | void updateConfig(CdnConfig cdnConfig); |
| | | |
| | | /** |
| | | * 根据名称查询配置值 |
| | | * |
| | | * @param pointBs |
| | | * @return |
| | | */ |
| | | String selectValueByName(String pointBs); |
| | | |
| | | CdnConfig getAgreement(String agreement); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnFlow; |
| | | import com.yami.shop.bean.model.CdnFlow; |
| | | import com.yami.shop.bean.param.CdnIncomeBangParam; |
| | | import com.yami.shop.bean.vo.CdnFlowVO; |
| | | import com.yami.shop.common.util.PageParam; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_flow(用户流水)】的数据库操作Service |
| | | * @createDate 2024-06-28 17:47:05 |
| | | */ |
| | | public interface CdnFlowService extends IService<CdnFlow> { |
| | | /** |
| | | * 获取用户流水 |
| | | * @param userId |
| | | * @param walletId |
| | | * @return |
| | | */ |
| | | public List<CdnFlow> getFlowDetail(String userId, Integer walletId); |
| | | |
| | | /** |
| | | * 分页获取用户流水 |
| | | * @param userId |
| | | * @param walletId |
| | | * @return |
| | | */ |
| | | IPage<CdnFlow> getFlowDetail(String userId, Integer walletId, Page<CdnFlow> page); |
| | | |
| | | /** |
| | | * 执行转账操作 |
| | | * @param remittanceUserId 转账人用户id |
| | | * @param walletId 币种 |
| | | * @param amount 转账数额 |
| | | * @param payeeUserId 收款人用户id |
| | | */ |
| | | Boolean executeTransferAccounts(String remittanceUserId, Integer walletId, BigDecimal amount, String payeeUserId); |
| | | |
| | | /** |
| | | * 执行划转操作 |
| | | * @param userId 划转用户id |
| | | * @param walletId 币种 |
| | | * @param amount 划转数额 |
| | | * @param transFerWalletId 划转钱包币种id |
| | | */ |
| | | Boolean executeTransfer(String userId, Integer walletId, BigDecimal amount, Integer transFerWalletId); |
| | | |
| | | |
| | | /** |
| | | * 执行兑换操作 |
| | | * @param userId 兑换用户id |
| | | * @param walletId 币种 |
| | | * @param amount 兑换数额 |
| | | * @param transFerWalletId 兑换钱包币种id |
| | | */ |
| | | String cash(String userId, Integer walletId, BigDecimal amount, Integer transFerWalletId); |
| | | |
| | | |
| | | /** |
| | | * 查询用户收益 |
| | | * @param userId |
| | | * @param date |
| | | * @return |
| | | */ |
| | | Double getIncomeByUserId(String userId, String date); |
| | | |
| | | /** |
| | | * 查询用户收益排行榜 |
| | | * @param date |
| | | * @return |
| | | */ |
| | | List<CdnIncomeBangParam> getIncomeBang(String date); |
| | | |
| | | /** |
| | | * 统计设备总支出 |
| | | * @return |
| | | */ |
| | | BigDecimal getExpend(String userId,String date); |
| | | |
| | | IPage<CdnFlow> getCdnFlowPage(PageParam<CdnFlow> page, CdnFlow flow); |
| | | |
| | | List<CdnFlow> getCdnFlows(CdnFlow flow); |
| | | CdnFlow getCdnFlowByid(Long id); |
| | | Integer saveCdnFlow(CdnFlow flow); |
| | | Integer updateCdnFlow(CdnFlow flow); |
| | | Integer deleteCdnFlow(Long id); |
| | | |
| | | Long getEarnings(String userId,String format,Integer walletId, Long taskId); |
| | | |
| | | IPage<CdnFlowVO> pageDeviceIncome(PageParam<CdnFlow> page, CdnFlow flow); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnFlowname; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_flowname(流水类型)】的数据库操作Service |
| | | * @createDate 2024-06-28 17:47:05 |
| | | */ |
| | | public interface CdnFlownameService extends IService<CdnFlowname> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnRealName; |
| | | import com.yami.shop.bean.model.CdnRealName; |
| | | import com.yami.shop.common.util.PageParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_real_name(实名认证)】的数据库操作Service |
| | | * @createDate 2024-07-01 11:38:28 |
| | | */ |
| | | public interface CdnRealNameService extends IService<CdnRealName> { |
| | | |
| | | IPage<CdnRealName> getCdnRealNamePage(PageParam<CdnRealName> page, CdnRealName cdnRealName); |
| | | List<CdnRealName> getCdnRealNames(CdnRealName cdnRealName); |
| | | CdnRealName getCdnRealNameById(Long id); |
| | | Integer saveCdnRealName(CdnRealName cdnRealName); |
| | | Integer updateCdnRealName(CdnRealName cdnRealName); |
| | | Integer deleteCdnRealName(Long id); |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnRelease; |
| | | import com.yami.shop.bean.param.CdnBindParam; |
| | | import com.yami.shop.bean.param.UserReselaseParam; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_release(托管释放列表)】的数据库操作Service |
| | | * @createDate 2024-07-01 15:52:34 |
| | | */ |
| | | public interface CdnReleaseService extends IService<CdnRelease> { |
| | | /** |
| | | * 分页查询设备列表 |
| | | * @param userId |
| | | * @param p |
| | | * @return |
| | | */ |
| | | IPage<CdnRelease> getReleasePage(String userId,String status,Integer isAct, Page<CdnRelease> p); |
| | | |
| | | /** |
| | | * 获取设备数量 |
| | | * @param startDate |
| | | * @param endDate |
| | | * @return |
| | | */ |
| | | Integer getDeviceCount(String startDate, String endDate); |
| | | |
| | | ServerResponseEntity bind(CdnBindParam cdnBindParam); |
| | | |
| | | |
| | | List<CdnRelease> getRelease(String userId,String status); |
| | | |
| | | Integer getDeviceCountByStatus(String status); |
| | | |
| | | UserReselaseParam getUserReselase(String userId); |
| | | |
| | | BigDecimal getNormalOrderCount(String startDate, String endDate); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnReleaseTemp; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_release(托管释放列表)】的数据库操作Service |
| | | * @createDate 2024-07-01 15:52:34 |
| | | */ |
| | | public interface CdnReleaseTempService extends IService<CdnReleaseTemp> { |
| | | |
| | | void deleteAll(); |
| | | |
| | | void insert(CdnReleaseTemp cdnReleaseTemp); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnTeamRelation; |
| | | import com.yami.shop.bean.model.User; |
| | | import com.yami.shop.bean.param.CdnShiftPidParam; |
| | | import com.yami.shop.bean.param.MyCdnTeamParam; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_team_relation(cdn团队关系表)】的数据库操作Service |
| | | * @createDate 2024-06-28 17:47:05 |
| | | */ |
| | | public interface CdnTeamRelationService extends IService<CdnTeamRelation> { |
| | | |
| | | MyCdnTeamParam getMyCdnTeamInfo(String userId); |
| | | |
| | | CdnTeamRelation geteamRelationByUserId(String userId); |
| | | |
| | | List<CdnTeamRelation> getTeamRelationList(); |
| | | |
| | | int getCountByUserLevel(String pid, int agentLevelId); |
| | | |
| | | List<CdnTeamRelation> getTeamRelationListSort(String pid); |
| | | |
| | | List<CdnTeamRelation> getDividendList(CdnTeamRelation cdn); |
| | | |
| | | List<CdnTeamRelation> selectByAgentLevelId(CdnTeamRelation cdns); |
| | | |
| | | void updateTodayQuantity(); |
| | | |
| | | void updateTodayOwnQuantity(); |
| | | |
| | | /** |
| | | * 去除推荐人 |
| | | * @param userId |
| | | */ |
| | | void delPuser(String userId); |
| | | |
| | | /** |
| | | * 关系链转移 |
| | | * @param cdnShiftPidParam |
| | | */ |
| | | void shiftPid(CdnShiftPidParam cdnShiftPidParam); |
| | | |
| | | User getInfoByUserId(String userId); |
| | | |
| | | List<CdnTeamRelation> getUpLevel(CdnTeamRelation cdnTeamRelation); |
| | | |
| | | BigDecimal selectCountMoney(); |
| | | |
| | | List<CdnTeamRelation> getTeamRelationListByAgentLevel(Integer id); |
| | | |
| | | BigDecimal selectTMell(Integer id); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnUserBank; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_user_bank(银行卡)】的数据库操作Service |
| | | * @createDate 2024-07-01 19:06:15 |
| | | */ |
| | | public interface CdnUserBankService extends IService<CdnUserBank> { |
| | | |
| | | Integer deleteUserBank(CdnUserBank bank); |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnUserRecharge; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_user_recharge(用户充值)】的数据库操作Service |
| | | * @createDate 2024-07-01 22:56:26 |
| | | */ |
| | | public interface CdnUserRechargeService extends IService<CdnUserRecharge> { |
| | | |
| | | /** |
| | | * 查询充值记录 |
| | | * @param startDate 开始时间 |
| | | * @param endDate 结束时间 |
| | | * @param walletId 币种 |
| | | * @return |
| | | */ |
| | | BigDecimal getRechargeCount(String startDate, String endDate, Integer walletId); |
| | | |
| | | void export(HttpServletResponse response, CdnUserRecharge cdnUserRecharge); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnUserWallet; |
| | | import com.yami.shop.bean.model.MarsSales; |
| | | import com.yami.shop.bean.model.MarsTranOrder; |
| | | import com.yami.shop.common.util.PageParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_user_wallet(用户钱包)】的数据库操作Service |
| | | * @createDate 2024-06-28 17:47:05 |
| | | */ |
| | | public interface CdnUserWalletService extends IService<CdnUserWallet> { |
| | | |
| | | IPage<CdnUserWallet> getCdnUserWalletPage(PageParam<CdnUserWallet> page, CdnUserWallet CdnUserWallet); |
| | | List<CdnUserWallet> getCdnUserWallets(CdnUserWallet CdnUserWallet); |
| | | CdnUserWallet getCdnUserWallet(CdnUserWallet CdnUserWallet); |
| | | Integer saveCdnUserWallet(CdnUserWallet CdnUserWallet); |
| | | Integer updateCdnUserWallet(CdnUserWallet CdnUserWallet); |
| | | Integer deleteCdnUserWallet(Long id); |
| | | String checkRedMoney(MarsSales card); |
| | | String exchange(CdnUserWallet card, String userId); |
| | | String updateSendRed(MarsTranOrder marsTranOrder); |
| | | |
| | | CdnUserWallet getWalletByUserId(String userId, Integer value); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnWallet; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_wallet(币种管理)】的数据库操作Service |
| | | * @createDate 2024-06-28 17:47:05 |
| | | */ |
| | | public interface CdnWalletService extends IService<CdnWallet> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnWithdrawal; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_cdn_withdrawal(用户提现)】的数据库操作Service |
| | | * @createDate 2024-06-28 17:47:05 |
| | | */ |
| | | public interface CdnWithdrawalService extends IService<CdnWithdrawal> { |
| | | /** |
| | | * 查询提现总额 |
| | | * @param startDate 开始时间 |
| | | * @param endDate 结束时间 |
| | | * @param walletId 币种 |
| | | * @return |
| | | */ |
| | | BigDecimal getWithdrawCount(String startDate, String endDate, Integer walletId); |
| | | |
| | | /** |
| | | * 修改提现状态为已通过 |
| | | * @param cdnWithdrawal |
| | | * @return |
| | | */ |
| | | ServerResponseEntity doWithdrawal(CdnWithdrawal cdnWithdrawal); |
| | | |
| | | /** |
| | | * 拒绝状态返回用户余额 |
| | | * @param cdnWithdrawal |
| | | * @return |
| | | */ |
| | | ServerResponseEntity returnWithdrawal(CdnWithdrawal cdnWithdrawal); |
| | | |
| | | /** |
| | | * 执行提现操作 |
| | | * @param cdnWithdrawal |
| | | */ |
| | | ServerResponseEntity executeWithdrawal(CdnWithdrawal cdnWithdrawal); |
| | | /** |
| | | * 导出excel |
| | | * @param response |
| | | * @param cdnWithdrawal |
| | | */ |
| | | void export(HttpServletResponse response, CdnWithdrawal cdnWithdrawal); |
| | | /** |
| | | * 导出excel |
| | | * @param response |
| | | * @param cdnWithdrawal |
| | | */ |
| | | void exports(HttpServletResponse response, CdnWithdrawal cdnWithdrawal); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CompanyAuditing; |
| | | import com.yami.shop.bean.model.ShopCompany; |
| | | import com.yami.shop.bean.model.SigningAuditing; |
| | | import com.yami.shop.bean.param.CompanyInfoAuditParam; |
| | | import com.yami.shop.common.util.PageParam; |
| | | |
| | | /** |
| | | * @author chiley |
| | | * @date 2022/9/21 10:32 |
| | | */ |
| | | public interface CompanyAuditingService extends IService<CompanyAuditing> { |
| | | |
| | | /** |
| | | * 商家申请变更工商信息 |
| | | * |
| | | * @param shopCompany |
| | | * @param userId 申请用户Id |
| | | */ |
| | | void applyChangeCompanyInfo(ShopCompany shopCompany, String userId); |
| | | |
| | | /** |
| | | * 撤销申请 |
| | | * |
| | | * @param companyAuditing 申请记录 |
| | | */ |
| | | void revoke(CompanyAuditing companyAuditing); |
| | | |
| | | /** |
| | | * 分页获取待审核的签约信息列表 |
| | | * @param page |
| | | * @param companyInfoAuditParam 搜索参数 |
| | | * @return |
| | | */ |
| | | IPage<CompanyAuditing> page(Page<CompanyAuditing> page, CompanyInfoAuditParam companyInfoAuditParam); |
| | | |
| | | /** |
| | | * 审核店铺工商信息 |
| | | * @param companyAuditing |
| | | */ |
| | | void audit(CompanyAuditing companyAuditing); |
| | | |
| | | /** |
| | | * 获取工商信息审核信息 |
| | | * @param shopId |
| | | */ |
| | | CompanyAuditing getAuditInfo(Long shopId); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.common.bean.CpsConfig; |
| | | |
| | | /** |
| | | * CPS配置信息 |
| | | * @author zsq |
| | | */ |
| | | public interface CpsConfigService extends IService<CpsConfig> { |
| | | |
| | | /** |
| | | * 根据key,更新value |
| | | * @param key 参数key |
| | | * @param value 参数value |
| | | */ |
| | | void updateValueByKey(String key, String value); |
| | | |
| | | /** |
| | | * 删除配置信息 |
| | | * @param ids 配置项id列表 |
| | | */ |
| | | void deleteBatch(Long[] ids); |
| | | |
| | | /** |
| | | * 根据key,获取配置的value值 |
| | | * @param key 参数key |
| | | * @return value |
| | | */ |
| | | String getValue(String key); |
| | | |
| | | |
| | | /** |
| | | * 获取配置信息,并返回对应的类 |
| | | * @param key key |
| | | * @param clazz 类 |
| | | * @param <T> 泛型 |
| | | * @return 泛型 |
| | | */ |
| | | <T> T getCpsConfigObject(String key, Class<T> clazz); |
| | | |
| | | /** |
| | | * 删除key的配置信息 |
| | | * @param key key |
| | | */ |
| | | void removeCpsConfig(String key); |
| | | |
| | | |
| | | /** |
| | | * 根据是否已经存在以key为名称的配置进行保存或更新 |
| | | * @param cpsConfig |
| | | */ |
| | | void saveOrUpdateCpsConfigByKey(CpsConfig cpsConfig); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | |
| | | |
| | | import com.yami.shop.bean.dto.flow.CustomerRetainedDTO; |
| | | import com.yami.shop.bean.dto.flow.MemberReqDTO; |
| | | import com.yami.shop.bean.param.MemberReqParam; |
| | | import com.yami.shop.bean.param.MemberSurveyRespParam; |
| | | import com.yami.shop.bean.vo.flow.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lgh on 2018/10/26. |
| | | */ |
| | | public interface CustomerAnalysisService { |
| | | |
| | | /** |
| | | * 获取会员调查信息列表 |
| | | * @param memberReqParam 客户参数 |
| | | * @return 会员调查信息 |
| | | */ |
| | | MemberSurveyRespParam generalize(MemberReqParam memberReqParam); |
| | | |
| | | /** |
| | | * 会员分析,会员概况 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | MemberSurveyRespVO getMemberSurvey(MemberReqDTO param); |
| | | |
| | | /** |
| | | * 会员分析,会员人数趋势/ 会员占比趋势 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | List<MemberTrendRespVO> getMemberTrend(MemberReqDTO param); |
| | | |
| | | /** |
| | | * 会员分析,会员贡献价值分析 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | MemberContributeRespVO getMemberContributeValue(MemberReqDTO param); |
| | | |
| | | /** |
| | | * 会员分析,新老会员成交分析 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | MemberDealRespVO getMemberDeal(MemberReqDTO param); |
| | | |
| | | /** |
| | | * 客户分析,客户留存分析 |
| | | * @param customerRetainedDTO |
| | | * @return |
| | | */ |
| | | List<CustomerRetainVO> getTradeRetained(CustomerRetainedDTO customerRetainedDTO); |
| | | |
| | | /** |
| | | * 会员分析,会员人数趋势excel导出 |
| | | * @param param |
| | | * @param response |
| | | */ |
| | | void memberTrendExport(MemberReqDTO param, HttpServletResponse response); |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.app.dto.DeliveryDto; |
| | | import com.yami.shop.bean.model.Delivery; |
| | | import com.yami.shop.bean.vo.DeliveryOrderVO; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * @author lgh on 2018/11/26. |
| | | */ |
| | | public interface DeliveryService extends IService<Delivery> { |
| | | |
| | | /** |
| | | * 根据物流ID与物流单号查找物流信息 |
| | | * @param dvyId 物流ID |
| | | * @param expNo 物流单号 |
| | | * @param receiverMobile 收件人手机号 |
| | | * @return 物流信息 |
| | | * @throws UnsupportedEncodingException |
| | | */ |
| | | DeliveryDto query(Long dvyId, String expNo, String receiverMobile) throws UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * 根据订单编号获取发货数量 |
| | | * @param orderNumbers |
| | | * @return |
| | | */ |
| | | List<DeliveryOrderVO> listDeliveryCountByOrderNumber(List<String> orderNumbers); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.DeviceGroup; |
| | | import com.yami.shop.bean.vo.DeviceGroupVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 设备分组 服务类 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2024-04-19 |
| | | */ |
| | | public interface DeviceGroupService extends IService<DeviceGroup> { |
| | | |
| | | /** |
| | | * 获取设备分组数据 |
| | | * @param headToken |
| | | */ |
| | | void getDeviceGroup(String headToken); |
| | | |
| | | /** |
| | | * 返回小程序设备分组数据 |
| | | * @return |
| | | */ |
| | | List<DeviceGroupVO> group(); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.yami.shop.bean.model.DeviceProfitLog; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | |
| | | /** |
| | | * @author lyy |
| | | * @description 针对表【tz_device_profit_log(设备收益日志(AI淘金))】的数据库操作Service |
| | | * @createDate 2024-09-27 17:32:54 |
| | | */ |
| | | public interface DeviceProfitLogService extends IService<DeviceProfitLog> { |
| | | |
| | | ServerResponseEntity<Integer> excute(); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.CdnDeviceRelease; |
| | | import com.yami.shop.bean.model.Device; |
| | | import com.yami.shop.bean.model.V1BoxIncome; |
| | | import com.yami.shop.bean.param.DeviceIncomeParam; |
| | | import com.yami.shop.bean.param.TypeParam; |
| | | import com.yami.shop.common.response.ServerResponseEntity; |
| | | import com.yami.shop.common.util.PageParam; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zsq |
| | | * @description 针对表【tz_device】的数据库操作Service |
| | | * @createDate 2024-07-11 14:22:52 |
| | | */ |
| | | public interface DeviceService extends IService<Device> { |
| | | |
| | | /** |
| | | * 根据设备Id查询关联关系表SN号 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | CdnDeviceRelease selectSnById(Long id); |
| | | |
| | | /** |
| | | * 删除设备 |
| | | * @param id |
| | | */ |
| | | void deleteById(Long id); |
| | | |
| | | /** |
| | | * 新增设备 |
| | | * @param device |
| | | */ |
| | | void saveDevice(Device device); |
| | | |
| | | /** |
| | | * 分页查询设备列表 |
| | | * @param page |
| | | * @param device |
| | | * @return |
| | | */ |
| | | IPage<Device> pageDevice(PageParam<Device> page, Device device); |
| | | |
| | | /** |
| | | * 绑定设备 |
| | | * @param cdnDeviceRelease |
| | | * @return |
| | | */ |
| | | int setSnDevice(CdnDeviceRelease cdnDeviceRelease); |
| | | |
| | | /** |
| | | * 设备收益 |
| | | * @return |
| | | */ |
| | | IPage<DeviceIncomeParam> selectSnDeviceIncome(PageParam<DeviceIncomeParam> page,DeviceIncomeParam param); |
| | | |
| | | /** |
| | | * 根据类型查询固定条数 |
| | | * @param shopCategoryId |
| | | * @param productNums |
| | | * @return |
| | | */ |
| | | List<Device> selectByType(Long shopCategoryId, Integer productNums); |
| | | |
| | | /** |
| | | * 查询店铺类型 |
| | | * @return |
| | | */ |
| | | List<TypeParam> selectdeviceTypeList(); |
| | | |
| | | String selectdeviceTypeById(Long type); |
| | | |
| | | String exportOrderExcel(MultipartFile deviceExcelFile,List<Device> list); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | * @param response 响应信息 |
| | | */ |
| | | void downloadModel(HttpServletResponse response); |
| | | |
| | | List<Device> getDeviceListBySn(String sn); |
| | | |
| | | void deleteBySn(String sn); |
| | | |
| | | ServerResponseEntity<?> setDeviceRepeal(String sn); |
| | | |
| | | /** |
| | | * 根据SN查询是否有激活设备 |
| | | * @param sn |
| | | * @return |
| | | */ |
| | | List<Device> getIsActivateDeviceListBySn(String sn); |
| | | |
| | | /** |
| | | * 根据设备序列号查询设备信息 |
| | | * @param deviceCode |
| | | * @return |
| | | */ |
| | | Device getDeviceByDeviceCode(String deviceCode); |
| | | |
| | | Integer selectAbnormalCount(); |
| | | |
| | | List<V1BoxIncome> getMoneyListBySn(String sn); |
| | | |
| | | IPage<Device> getDevicePage(String userId, String status,String isActivate, Integer orderBy, Integer type, PageParam<Device> p); |
| | | |
| | | Integer getDevice(Device device); |
| | | } |
New file |
| | |
| | | package com.yami.shop.service; |
| | | |
| | | import com.yami.shop.bean.model.Diploma; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【tz_diploma(学历表)】的数据库操作Service |
| | | * @createDate 2024-06-06 17:38:37 |
| | | */ |
| | | public interface DiplomaService extends IService<Diploma> { |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.EnterprisePay; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author |
| | | * @date 2019-10-15 16:44:50 |
| | | */ |
| | | public interface EnterprisePayService extends IService<EnterprisePay> { |
| | | |
| | | /** |
| | | * 获取正在申请中的企业支付记录 |
| | | * @return 企业支付信息列表 |
| | | */ |
| | | List<EnterprisePay> listApplyEnterprisePay(); |
| | | |
| | | /** |
| | | * 发送企业支付 |
| | | * @param enterprisePayList 企业支付信息列表 |
| | | */ |
| | | void sendEnterprisePay(List<EnterprisePay> enterprisePayList); |
| | | |
| | | /** |
| | | * 支付成功处理 |
| | | * @param enterprisePay 企业支付信息 |
| | | */ |
| | | void paySuccess(EnterprisePay enterprisePay); |
| | | |
| | | /** |
| | | * 支付失败处理 |
| | | * @param enterprisePay 企业支付信息 |
| | | */ |
| | | void payFailed(EnterprisePay enterprisePay); |
| | | } |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved. |
| | | * |
| | | * https://www.mall4j.com/ |
| | | * |
| | | * 未经允许,不可做商业用途! |
| | | * |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | package com.yami.shop.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yami.shop.bean.model.FlowLog; |
| | | import com.yami.shop.bean.param.ProdAnalysisDataParam; |
| | | import com.yami.shop.bean.param.ProdAnalysisSurveyParam; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户流量记录 |
| | | * |
| | | * @author YXF |
| | | * @date 2020-07-13 13:18:33 |
| | | */ |
| | | public interface FlowLogService extends IService<FlowLog> { |
| | | |
| | | /** |
| | | * 获得最早的创建时间 |
| | | * @return 最早的创建时间 |
| | | */ |
| | | Date getMinCreateTime(); |
| | | |
| | | /** |
| | | * 批量插入 |
| | | */ |
| | | void insertBatch(); |
| | | |
| | | /** |
| | | * 通过缓存获取流量日志列表 |
| | | * @return 流量日志列表 |
| | | */ |
| | | List<FlowLog> getFlowLogListByCache(); |
| | | |
| | | /** |
| | | * 放置流量日志缓存 |
| | | * @param flowLogList 流量日志列表 |
| | | */ |
| | | void flowLogPutCache(List<FlowLog> flowLogList); |
| | | |
| | | /** |
| | | * 根据时间范围获取用户流量记录列表 |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | * @return 用户流量记录列表 |
| | | */ |
| | | List<FlowLog> getFlowLogByDate(Date startTime, Date endTime); |
| | | |
| | | /** |
| | | * 根据时间范围删除用户流量记录 |
| | | * @param startTime 起始时间 |
| | | * @param endTime 终止时间 |
| | | */ |
| | | void deleteAllByDate(Date startTime, Date endTime); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取被访问商品数 |
| | | * @param param 商品分析参数 |
| | | * @return 被访问商品数 |
| | | */ |
| | | Long countVisitProdNum(ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取商品浏览量 |
| | | * @param param 商品分析参数 |
| | | * @return 商品浏览量 |
| | | */ |
| | | Long countVisitProdInfoNum(ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取商品曝光数 |
| | | * @param param 商品分析参数 |
| | | * @return 商品曝光数 |
| | | */ |
| | | Long countProdExposeNum(ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取商品访客数 |
| | | * @param param 商品分析参数 |
| | | * @return 商品访客数 |
| | | */ |
| | | Long countProdVisitorNum(ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取添加商品进入购物车的商品件数 |
| | | * @param param 商品分析参数 |
| | | * @return 添加商品进入购物车的商品件数 |
| | | */ |
| | | Long countAddCartProdNum(ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 根据商品分析概况参数获取加购的流量记录数量 |
| | | * @param param 商品分析参数 |
| | | * @return 加购的流量记录数量 |
| | | */ |
| | | Long countShareVisit(ProdAnalysisSurveyParam param); |
| | | |
| | | /** |
| | | * 统计访客数 |
| | | * |
| | | * @param date |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | Integer countAllVisitor(Date date, Date startTime, Date endTime); |
| | | |
| | | /** |
| | | * 统计加购人数 |
| | | * |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | Integer countAddCartUserNum(Date startTime, Date endTime); |
| | | |
| | | /** |
| | | *统计登陆用户数 |
| | | * |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | Integer countUserNum(Date startTime, Date endTime); |
| | | |
| | | /** |
| | | * 保存用户访问记录 |
| | | * @param flowLog |
| | | * @param request |
| | | */ |
| | | void saveUserFlowLog(FlowLog flowLog, HttpServletRequest request); |
| | | |
| | | /** |
| | | * 获取用户访问的ip |
| | | * @param request |
| | | */ |
| | | String getIp(HttpServletRequest request); |
| | | |
| | | /** |
| | | * 商品概况分析 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | ProdAnalysisDataParam getProdSurvey(ProdAnalysisSurveyParam param); |
| | | |
| | | } |
yami-shop-service/src/main/java/com/yami/shop/service/FlowPageAnalyseUserService.java
yami-shop-service/src/main/java/com/yami/shop/service/FlowPageAnalysisService.java
yami-shop-service/src/main/java/com/yami/shop/service/FlowProductAnalysisService.java
yami-shop-service/src/main/java/com/yami/shop/service/FlowRouteAnalysisService.java
yami-shop-service/src/main/java/com/yami/shop/service/FlowService.java
yami-shop-service/src/main/java/com/yami/shop/service/FlowUserAnalysisExcelService.java
yami-shop-service/src/main/java/com/yami/shop/service/FlowUserAnalysisService.java
yami-shop-service/src/main/java/com/yami/shop/service/FormService.java
yami-shop-service/src/main/java/com/yami/shop/service/HotSearchService.java
yami-shop-service/src/main/java/com/yami/shop/service/IAssetsService.java
yami-shop-service/src/main/java/com/yami/shop/service/IImMsgUserHistoryService.java
yami-shop-service/src/main/java/com/yami/shop/service/IImMsgUserService.java
yami-shop-service/src/main/java/com/yami/shop/service/ILuckImGroupHistoryService.java
yami-shop-service/src/main/java/com/yami/shop/service/ILuckImGroupMemberService.java
yami-shop-service/src/main/java/com/yami/shop/service/ILuckImGroupService.java
yami-shop-service/src/main/java/com/yami/shop/service/ILuckImGroupTypeService.java
yami-shop-service/src/main/java/com/yami/shop/service/ILuckImMsgUserHistoryService.java
yami-shop-service/src/main/java/com/yami/shop/service/ILuckImMsgUserService.java
yami-shop-service/src/main/java/com/yami/shop/service/ILuckUserFriendService.java
yami-shop-service/src/main/java/com/yami/shop/service/IUserAiRobotLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/IUserAssetsLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/IUserAssetsService.java
yami-shop-service/src/main/java/com/yami/shop/service/IndexImgService.java
yami-shop-service/src/main/java/com/yami/shop/service/LifeServiceCategoryService.java
yami-shop-service/src/main/java/com/yami/shop/service/LuckyCoinDetailService.java
yami-shop-service/src/main/java/com/yami/shop/service/LuckyCoinLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/MarsAdverIncomeService.java
yami-shop-service/src/main/java/com/yami/shop/service/MarsBlackLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/MarsHandCardService.java
yami-shop-service/src/main/java/com/yami/shop/service/MarsSalesService.java
yami-shop-service/src/main/java/com/yami/shop/service/MarsTranLeveService.java
yami-shop-service/src/main/java/com/yami/shop/service/MarsTranOrderService.java
yami-shop-service/src/main/java/com/yami/shop/service/MarsWantbuyService.java
yami-shop-service/src/main/java/com/yami/shop/service/MessageService.java
yami-shop-service/src/main/java/com/yami/shop/service/MyOrderService.java
yami-shop-service/src/main/java/com/yami/shop/service/NoticeService.java
yami-shop-service/src/main/java/com/yami/shop/service/NoticeUserLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/NotifyLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/NotifyTemplateRemindService.java
yami-shop-service/src/main/java/com/yami/shop/service/NotifyTemplateService.java
yami-shop-service/src/main/java/com/yami/shop/service/OfflineHandleEventItemService.java
yami-shop-service/src/main/java/com/yami/shop/service/OfflineHandleEventService.java
yami-shop-service/src/main/java/com/yami/shop/service/OrderDataAnalysisService.java
yami-shop-service/src/main/java/com/yami/shop/service/OrderExcelService.java
yami-shop-service/src/main/java/com/yami/shop/service/OrderInvoiceService.java
yami-shop-service/src/main/java/com/yami/shop/service/OrderItemLangService.java
yami-shop-service/src/main/java/com/yami/shop/service/OrderItemService.java
yami-shop-service/src/main/java/com/yami/shop/service/OrderLangService.java
yami-shop-service/src/main/java/com/yami/shop/service/OrderRefundService.java
yami-shop-service/src/main/java/com/yami/shop/service/OrderService.java
yami-shop-service/src/main/java/com/yami/shop/service/OrderSettlementService.java
yami-shop-service/src/main/java/com/yami/shop/service/OrderVirtualInfoService.java
yami-shop-service/src/main/java/com/yami/shop/service/PayInfoService.java
yami-shop-service/src/main/java/com/yami/shop/service/PcdnDeviceReleaseLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/PcdnDeviceService.java
yami-shop-service/src/main/java/com/yami/shop/service/PcdnDeviceTransferLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/PcdnEarnLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdBrowseLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdCommService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdExtensionService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdLangService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdParameterLangService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdParameterService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdPropLangService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdPropService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdPropValueLangService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdPropValueService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdTagReferenceService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProdTagService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProductExcelService.java
yami-shop-service/src/main/java/com/yami/shop/service/ProductService.java
yami-shop-service/src/main/java/com/yami/shop/service/PurchaseOrderService.java
yami-shop-service/src/main/java/com/yami/shop/service/PurchaseProdService.java
yami-shop-service/src/main/java/com/yami/shop/service/QRCodeService.java
yami-shop-service/src/main/java/com/yami/shop/service/QrcodeTicketService.java
yami-shop-service/src/main/java/com/yami/shop/service/RefundAddrService.java
yami-shop-service/src/main/java/com/yami/shop/service/RefundDeliveryService.java
yami-shop-service/src/main/java/com/yami/shop/service/RefundInfoService.java
yami-shop-service/src/main/java/com/yami/shop/service/RefundOrderSettlementService.java
yami-shop-service/src/main/java/com/yami/shop/service/RevenueOverviewService.java
yami-shop-service/src/main/java/com/yami/shop/service/ShopAuditingService.java
yami-shop-service/src/main/java/com/yami/shop/service/ShopBankCardService.java
yami-shop-service/src/main/java/com/yami/shop/service/ShopCompanyService.java
yami-shop-service/src/main/java/com/yami/shop/service/ShopCustomerService.java
yami-shop-service/src/main/java/com/yami/shop/service/ShopDetailService.java
yami-shop-service/src/main/java/com/yami/shop/service/ShopRenovationService.java
yami-shop-service/src/main/java/com/yami/shop/service/ShopTemplateService.java
yami-shop-service/src/main/java/com/yami/shop/service/ShopWalletLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/ShopWalletService.java
yami-shop-service/src/main/java/com/yami/shop/service/ShopWithdrawCashService.java
yami-shop-service/src/main/java/com/yami/shop/service/SigningAuditingService.java
yami-shop-service/src/main/java/com/yami/shop/service/SkuLangService.java
yami-shop-service/src/main/java/com/yami/shop/service/SkuService.java
yami-shop-service/src/main/java/com/yami/shop/service/SkuStockLockService.java
yami-shop-service/src/main/java/com/yami/shop/service/SkuStockService.java
yami-shop-service/src/main/java/com/yami/shop/service/SmsLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/StationService.java
yami-shop-service/src/main/java/com/yami/shop/service/StatisticsOrderService.java
yami-shop-service/src/main/java/com/yami/shop/service/StatisticsService.java
yami-shop-service/src/main/java/com/yami/shop/service/StockBillLogItemService.java
yami-shop-service/src/main/java/com/yami/shop/service/StockBillLogService.java
yami-shop-service/src/main/java/com/yami/shop/service/StockChangeReasonLangService.java
yami-shop-service/src/main/java/com/yami/shop/service/StockChangeReasonService.java
yami-shop-service/src/main/java/com/yami/shop/service/StockChangeReasonStatusService.java
yami-shop-service/src/main/java/com/yami/shop/service/SupplierCategoryService.java
yami-shop-service/src/main/java/com/yami/shop/service/SupplierProdService.java
yami-shop-service/src/main/java/com/yami/shop/service/SupplierService.java
yami-shop-service/src/main/java/com/yami/shop/service/SysAccessKeyService.java
yami-shop-service/src/main/java/com/yami/shop/service/SysConfigService.java
yami-shop-service/src/main/java/com/yami/shop/service/SysUpgradeInfoService.java
yami-shop-service/src/main/java/com/yami/shop/service/TakeStockExcelService.java
yami-shop-service/src/main/java/com/yami/shop/service/TakeStockProdService.java
yami-shop-service/src/main/java/com/yami/shop/service/TakeStockService.java
yami-shop-service/src/main/java/com/yami/shop/service/UserAddrOrderService.java
yami-shop-service/src/main/java/com/yami/shop/service/UserAddrService.java
yami-shop-service/src/main/java/com/yami/shop/service/UserCollectionService.java
yami-shop-service/src/main/java/com/yami/shop/service/UserCollectionShopService.java
yami-shop-service/src/main/java/com/yami/shop/service/UserExtensionService.java
yami-shop-service/src/main/java/com/yami/shop/service/UserService.java
yami-shop-service/src/main/java/com/yami/shop/service/V1BoxIncomeService.java
yami-shop-service/src/main/java/com/yami/shop/service/V1BoxService.java
yami-shop-service/src/main/java/com/yami/shop/service/WebConfigService.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/AgentLevelServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/AgentServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/AreaServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/AssetsServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/AttachFileGroupServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/AttachFileServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/BasketServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/BrandLangServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/BrandServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/BrandShopServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/C2cRealNameServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryBrandServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryExcelServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryLangServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryLifeShopServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryPropServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryShopServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnAgentLevelServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnBindServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnCenterLevelServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnConfigServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnFlowServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnFlownameServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnQRCodeService.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnRealNameServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnReleaseServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnReleaseTempServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnTeamRelationServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnUserBankServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnUserRechargeServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnUserWalletServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnWalletServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CdnWithdrawalServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CompanyAuditingServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CpsConfigServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/CustomerAnalysisServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/DeliveryServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/DeviceGroupServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/DeviceProfitLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/DeviceServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/DiplomaServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/EnterprisePayServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/FlowLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/FlowPageAnalyseUserServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/FlowPageAnalysisServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/FlowProductAnalysisServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/FlowRouteAnalysisServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/FlowServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/FlowUserAnalysisExcelServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/FlowUserAnalysisServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/FormServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/HotSearchServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ImMsgUserHistoryServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ImMsgUserServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/IndexImgServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/LifeServiceCategoryServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/LuckImGroupHistoryServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/LuckImGroupMemberServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/LuckImGroupServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/LuckImGroupTypeServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/LuckImMsgUserHistoryServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/LuckImMsgUserServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/LuckUserFriendServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/LuckyCoinDetailServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/LuckyCoinLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/MarsAdverIncomeServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/MarsBlackLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/MarsHandCardServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/MarsSalesServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/MarsTranLeveServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/MarsTranOrderServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/MarsWantbuyServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/MessageServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/MyOrderServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/NoticeServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/NoticeUserLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/NotifyLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/NotifyTemplateRemindServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/NotifyTemplateServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OfflineHandleEventItemServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OfflineHandleEventServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderDataAnalysisServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderExcelServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderInvoiceServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderItemLangServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderItemServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderLangServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderRefundServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderSettlementServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderVirtualInfoServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/PayInfoServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/PcdnDeviceReleaseLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/PcdnDeviceServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/PcdnDeviceTransferLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/PcdnEarnLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdBrowseLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdCommServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdExtensionServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdLangServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdParameterLangServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdParameterServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdPropLangServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdPropServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdPropValueLangServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdPropValueServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdTagReferenceServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdTagServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProductExcelServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProductServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/PurchaseOrderServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/PurchaseProdServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/QrcodeTicketServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/RefundAddrServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/RefundDeliveryServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/RefundInfoServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/RefundOrderSettlementServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/RevenueOverviewServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopAuditingServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopBankCardServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopCompanyServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopCustomerServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopDetailServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopRenovationServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopTemplateServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopWalletLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopWalletServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopWithdrawCashServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SigningAuditingServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SkuLangServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SkuServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SkuStockLockServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SkuStockServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SmsLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/StationServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/StatisticsOrderServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/StatisticsServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/StockBillLogItemServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/StockBillLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/StockChangeReasonLangServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/StockChangeReasonServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/StockChangeReasonStatusServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SupplierCategoryServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SupplierProdServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SupplierServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SysAccessKeyServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SysConfigServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/SysUpgradeInfoServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/TakeStockExcelServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/TakeStockProdServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/TakeStockServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/UserAddrOrderServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/UserAddrServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/UserAiRobotLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/UserAssetsLogServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/UserAssetsServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/UserCollectionServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/UserCollectionShopServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/UserExtensionServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/UserServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/V1BoxIncomeServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/V1BoxServiceImpl.java
yami-shop-service/src/main/java/com/yami/shop/service/impl/WebConfigServiceImpl.java
yami-shop-service/src/main/resources/mapper/AgentLevelMapper.xml
yami-shop-service/src/main/resources/mapper/AgentMapper.xml
yami-shop-service/src/main/resources/mapper/AreaMapper.xml
yami-shop-service/src/main/resources/mapper/AssetsMapper.xml
yami-shop-service/src/main/resources/mapper/AttachFileGroupMapper.xml
yami-shop-service/src/main/resources/mapper/AttachFileMapper.xml
yami-shop-service/src/main/resources/mapper/BasketMapper.xml
yami-shop-service/src/main/resources/mapper/BrandLangMapper.xml
yami-shop-service/src/main/resources/mapper/BrandMapper.xml
yami-shop-service/src/main/resources/mapper/BrandShopMapper.xml
yami-shop-service/src/main/resources/mapper/C2cRealNameMapper.xml
yami-shop-service/src/main/resources/mapper/CategoryBrandMapper.xml
yami-shop-service/src/main/resources/mapper/CategoryLangMapper.xml
yami-shop-service/src/main/resources/mapper/CategoryLifeShopMapper.xml
yami-shop-service/src/main/resources/mapper/CategoryMapper.xml
yami-shop-service/src/main/resources/mapper/CategoryPropMapper.xml
yami-shop-service/src/main/resources/mapper/CategoryShopMapper.xml
yami-shop-service/src/main/resources/mapper/CdnAgentLevelMapper.xml
yami-shop-service/src/main/resources/mapper/CdnBindMapper.xml
yami-shop-service/src/main/resources/mapper/CdnCenterLevelMapper.xml
yami-shop-service/src/main/resources/mapper/CdnConfigMapper.xml
yami-shop-service/src/main/resources/mapper/CdnFlowMapper.xml
yami-shop-service/src/main/resources/mapper/CdnFlownameMapper.xml
yami-shop-service/src/main/resources/mapper/CdnRealNameMapper.xml
yami-shop-service/src/main/resources/mapper/CdnReleaseMapper.xml
yami-shop-service/src/main/resources/mapper/CdnTeamRelationMapper.xml
yami-shop-service/src/main/resources/mapper/CdnUserBankMapper.xml
yami-shop-service/src/main/resources/mapper/CdnUserRechargeMapper.xml
yami-shop-service/src/main/resources/mapper/CdnUserWalletMapper.xml
yami-shop-service/src/main/resources/mapper/CdnWalletMapper.xml
yami-shop-service/src/main/resources/mapper/CdnWithdrawalMapper.xml
yami-shop-service/src/main/resources/mapper/CompanyAuditingMapper.xml
yami-shop-service/src/main/resources/mapper/CpsConfigMapper.xml
yami-shop-service/src/main/resources/mapper/CpsDdCategoryMapper.xml
yami-shop-service/src/main/resources/mapper/CpsDdOrderMapper.xml
yami-shop-service/src/main/resources/mapper/CpsJdCategoryMapper.xml
yami-shop-service/src/main/resources/mapper/CpsJdOrderMapper.xml
yami-shop-service/src/main/resources/mapper/CpsJtkOrderMapper.xml
yami-shop-service/src/main/resources/mapper/CpsMtActitvityMapper.xml
yami-shop-service/src/main/resources/mapper/CpsMtOrderMapper.xml
yami-shop-service/src/main/resources/mapper/CpsOrderMapper.xml
yami-shop-service/src/main/resources/mapper/CpsShopMapper.xml
yami-shop-service/src/main/resources/mapper/CustomerAnalysisMapper.xml
yami-shop-service/src/main/resources/mapper/DeliveryMapper.xml
yami-shop-service/src/main/resources/mapper/DeviceGroupMapper.xml
yami-shop-service/src/main/resources/mapper/DeviceMapper.xml
yami-shop-service/src/main/resources/mapper/DeviceProfitLogMapper.xml
yami-shop-service/src/main/resources/mapper/DiplomaMapper.xml
yami-shop-service/src/main/resources/mapper/EnterprisePayMapper.xml
yami-shop-service/src/main/resources/mapper/FlowLogMapper.xml
yami-shop-service/src/main/resources/mapper/FlowPageAnalyseUserMapper.xml
yami-shop-service/src/main/resources/mapper/FlowPageAnalysisMapper.xml
yami-shop-service/src/main/resources/mapper/FlowRouteAnalysisMapper.xml
yami-shop-service/src/main/resources/mapper/FlowUserAnalysisMapper.xml
yami-shop-service/src/main/resources/mapper/FormMapper.xml
yami-shop-service/src/main/resources/mapper/HotSearchMapper.xml
yami-shop-service/src/main/resources/mapper/ImMsgUserHistoryMapper.xml
yami-shop-service/src/main/resources/mapper/ImMsgUserMapper.xml
yami-shop-service/src/main/resources/mapper/IndexImgMapper.xml
yami-shop-service/src/main/resources/mapper/LifeServiceCategoryMapper.xml
yami-shop-service/src/main/resources/mapper/LuckImGroupHistoryMapper.xml
yami-shop-service/src/main/resources/mapper/LuckImGroupMapper.xml
yami-shop-service/src/main/resources/mapper/LuckImGroupMemberMapper.xml
yami-shop-service/src/main/resources/mapper/LuckImGroupTypeMapper.xml
yami-shop-service/src/main/resources/mapper/LuckImMsgUserHistoryMapper.xml
yami-shop-service/src/main/resources/mapper/LuckImMsgUserMapper.xml
yami-shop-service/src/main/resources/mapper/LuckUserFriendMapper.xml
yami-shop-service/src/main/resources/mapper/LuckyCoinDetailMapper.xml
yami-shop-service/src/main/resources/mapper/LuckyCoinLogMapper.xml
yami-shop-service/src/main/resources/mapper/MarsAdverIncomeMapper.xml
yami-shop-service/src/main/resources/mapper/MarsBlackLogMapper.xml
yami-shop-service/src/main/resources/mapper/MarsHandCardMapper.xml
yami-shop-service/src/main/resources/mapper/MarsSalesMapper.xml
yami-shop-service/src/main/resources/mapper/MarsTranLeveMapper.xml
yami-shop-service/src/main/resources/mapper/MarsTranOrderMapper.xml
yami-shop-service/src/main/resources/mapper/MarsWantbuyMapper.xml
yami-shop-service/src/main/resources/mapper/MessageMapper.xml
yami-shop-service/src/main/resources/mapper/NoticeMapper.xml
yami-shop-service/src/main/resources/mapper/NoticeUserLogMapper.xml
yami-shop-service/src/main/resources/mapper/NotifyLogMapper.xml
yami-shop-service/src/main/resources/mapper/NotifyTemplateMapper.xml
yami-shop-service/src/main/resources/mapper/NotifyTemplateRemindMapper.xml
yami-shop-service/src/main/resources/mapper/NotifyTemplateTagMapper.xml
yami-shop-service/src/main/resources/mapper/OfflineHandleEventItemMapper.xml
yami-shop-service/src/main/resources/mapper/OfflineHandleEventMapper.xml
yami-shop-service/src/main/resources/mapper/OrderInvoiceMapper.xml
yami-shop-service/src/main/resources/mapper/OrderItemLangMapper.xml
yami-shop-service/src/main/resources/mapper/OrderItemMapper.xml
yami-shop-service/src/main/resources/mapper/OrderLangMapper.xml
yami-shop-service/src/main/resources/mapper/OrderMapper.xml
yami-shop-service/src/main/resources/mapper/OrderRefundMapper.xml
yami-shop-service/src/main/resources/mapper/OrderSettlementMapper.xml
yami-shop-service/src/main/resources/mapper/OrderVirtualInfoMapper.xml
yami-shop-service/src/main/resources/mapper/PayInfoMapper.xml
yami-shop-service/src/main/resources/mapper/PcdnDeviceMapper.xml
yami-shop-service/src/main/resources/mapper/PcdnDeviceReleaseLogMapper.xml
yami-shop-service/src/main/resources/mapper/PcdnDeviceTransferLogMapper.xml
yami-shop-service/src/main/resources/mapper/PcdnEarnLogMapper.xml
yami-shop-service/src/main/resources/mapper/ProdBrowseLogMapper.xml
yami-shop-service/src/main/resources/mapper/ProdCommMapper.xml
yami-shop-service/src/main/resources/mapper/ProdExtensionMapper.xml
yami-shop-service/src/main/resources/mapper/ProdImgMapper.xml
yami-shop-service/src/main/resources/mapper/ProdLangMapper.xml
yami-shop-service/src/main/resources/mapper/ProdParameterLangMapper.xml
yami-shop-service/src/main/resources/mapper/ProdParameterMapper.xml
yami-shop-service/src/main/resources/mapper/ProdPropLangMapper.xml
yami-shop-service/src/main/resources/mapper/ProdPropMapper.xml
yami-shop-service/src/main/resources/mapper/ProdPropValueLangMapper.xml
yami-shop-service/src/main/resources/mapper/ProdPropValueMapper.xml
yami-shop-service/src/main/resources/mapper/ProdTagMapper.xml
yami-shop-service/src/main/resources/mapper/ProdTagReferenceMapper.xml
yami-shop-service/src/main/resources/mapper/ProductMapper.xml
yami-shop-service/src/main/resources/mapper/PurchaseOrderMapper.xml
yami-shop-service/src/main/resources/mapper/PurchaseProdMapper.xml
yami-shop-service/src/main/resources/mapper/QrcodeTicketMapper.xml
yami-shop-service/src/main/resources/mapper/RefundAddrMapper.xml
yami-shop-service/src/main/resources/mapper/RefundDeliveryMapper.xml
yami-shop-service/src/main/resources/mapper/RefundInfoMapper.xml
yami-shop-service/src/main/resources/mapper/RefundOrderSettlementMapper.xml
yami-shop-service/src/main/resources/mapper/RevenueOverviewMapper.xml
yami-shop-service/src/main/resources/mapper/ShopAuditingMapper.xml
yami-shop-service/src/main/resources/mapper/ShopBankCardtMapper.xml
yami-shop-service/src/main/resources/mapper/ShopCompanyMapper.xml
yami-shop-service/src/main/resources/mapper/ShopCustomerMapper.xml
yami-shop-service/src/main/resources/mapper/ShopDetailMapper.xml
yami-shop-service/src/main/resources/mapper/ShopRenovationMapper.xml
yami-shop-service/src/main/resources/mapper/ShopTemplateMapper.xml
yami-shop-service/src/main/resources/mapper/ShopWalletLogMapper.xml
yami-shop-service/src/main/resources/mapper/ShopWalletMapper.xml
yami-shop-service/src/main/resources/mapper/ShopWithdrawCashMapper.xml
yami-shop-service/src/main/resources/mapper/SigningAuditingMapper.xml
yami-shop-service/src/main/resources/mapper/SkuLangMapper.xml
yami-shop-service/src/main/resources/mapper/SkuMapper.xml
yami-shop-service/src/main/resources/mapper/SkuStockLockMapper.xml
yami-shop-service/src/main/resources/mapper/SkuStockMapper.xml
yami-shop-service/src/main/resources/mapper/SmsLogMapper.xml
yami-shop-service/src/main/resources/mapper/StationMapper.xml
yami-shop-service/src/main/resources/mapper/StatisticsMapper.xml
yami-shop-service/src/main/resources/mapper/StockBillLogItemMapper.xml
yami-shop-service/src/main/resources/mapper/StockBillLogMapper.xml
yami-shop-service/src/main/resources/mapper/StockChangeReasonLangMapper.xml
yami-shop-service/src/main/resources/mapper/StockChangeReasonMapper.xml
yami-shop-service/src/main/resources/mapper/StockChangeReasonStatusMapper.xml
yami-shop-service/src/main/resources/mapper/SupplierCategoryMapper.xml
yami-shop-service/src/main/resources/mapper/SupplierMapper.xml
yami-shop-service/src/main/resources/mapper/SupplierProdMapper.xml
yami-shop-service/src/main/resources/mapper/SysAccessKeyMapper.xml
yami-shop-service/src/main/resources/mapper/SysConfigMapper.xml
yami-shop-service/src/main/resources/mapper/TakeStockMapper.xml
yami-shop-service/src/main/resources/mapper/TakeStockProdMapper.xml
yami-shop-service/src/main/resources/mapper/UserAddrMapper.xml
yami-shop-service/src/main/resources/mapper/UserAddrOrderMapper.xml
yami-shop-service/src/main/resources/mapper/UserAiRobotLogMapper.xml
yami-shop-service/src/main/resources/mapper/UserAssetsLogMapper.xml
yami-shop-service/src/main/resources/mapper/UserAssetsMapper.xml
yami-shop-service/src/main/resources/mapper/UserCollectionMapper.xml
yami-shop-service/src/main/resources/mapper/UserCollectionShopMapper.xml
yami-shop-service/src/main/resources/mapper/UserExtensionMapper.xml
yami-shop-service/src/main/resources/mapper/UserMapper.xml
yami-shop-service/src/main/resources/mapper/V1BoxIncomeMapper.xml
yami-shop-service/src/main/resources/mapper/V1BoxMapper.xml
yami-shop-service/src/main/resources/mapper/WebConfigMapper.xml |