Merge remote-tracking branch 'origin/master'
# Conflicts:
# ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
New file |
| | |
| | | {"address":"四川省成都市武侯区锦辉西二街天府新谷9号楼二单元1005A","days":10,"name":"平台退货地址嘎嘎嘎嘎","phone":"19912351325"} |
| | |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "状态(1=处理中,2=成功)") |
| | | @ApiModelProperty(value = "状态(1=处理中,2=成功,3=失败)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "处理结果") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "到账时间") |
| | | @TableField("arrival_time") |
| | |
| | | @ApiModelProperty("收货地址JSON") |
| | | @TableField(exist = false) |
| | | private String addressJson; |
| | | |
| | | @ApiModelProperty(value = "第三方快递结果") |
| | | @TableField("express_result") |
| | | private String expressResult; |
| | | } |
| | |
| | | @TableField("audit_msg") |
| | | private String auditMsg; |
| | | |
| | | @ApiModelProperty(value = "状态(1=申请中,2=已到账)") |
| | | @ApiModelProperty(value = "状态(1=申请中,2=已到账,3=失败)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "处理结果") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "到账时间") |
| | | @TableField("arrival_time") |
| | | private LocalDateTime arrivalTime; |
| | |
| | | */ |
| | | @GetMapping("/user/info/{username}") |
| | | public R<LoginUser> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | @GetMapping("/user/infoShop/{username}") |
| | | public R<LoginUser> infoShop(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | |
| | | /** |
| | | * 注册用户信息 |
| | |
| | | { |
| | | return R.fail("获取用户失败:" + throwable.getMessage()); |
| | | } |
| | | @Override |
| | | public R<LoginUser> infoShop(String username, String source) |
| | | { |
| | | return R.fail("门店登录获取用户失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> registerUserInfo(SysUser sysUser, String source) |
| | |
| | | public R delShopUser(Integer objectId, Integer roleType) { |
| | | return R.fail("删除门店管理员账号失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R delSysUserById(Long userId) { |
| | | return R.fail("根据id删除管理员账户失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | public R saveUserShop(UserShop userShop) { |
| | | return R.fail("保存门店用户关系数据失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R delUserShop(UserShop userShop) { |
| | | return R.fail("删除后台账号和门店关系数据失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R delShopAllUserShop(Integer shopId) { |
| | | return R.fail("删除门店所有后台账号和门店关系数据失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/user/queryUserByUserNameAndRoleType") |
| | | R<SysUser> queryUserByUserNameAndRoleType(@RequestParam("roleType") String userName, @RequestParam("roleType") Integer roleType); |
| | | R<SysUser> queryUserByUserNameAndRoleType(@RequestParam("userName") String userName, @RequestParam("roleType") Integer roleType); |
| | | |
| | | /** |
| | | * 新增加用户信息 |
| | |
| | | */ |
| | | @PostMapping("/user/user/delShopUser") |
| | | R delShopUser(@RequestParam("objectId") Integer objectId, @RequestParam("roleType") Integer roleType); |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id删除管理员账户 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @PostMapping("/user/delSysUserById") |
| | | R delSysUserById(@RequestParam("userId") Long userId); |
| | | } |
| | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | @PostMapping("/userShop/saveUserShop") |
| | | R saveUserShop(@RequestBody UserShop userShop); |
| | | |
| | | /** |
| | | * 删除后台账号和门店关系数据 |
| | | * @param userShop |
| | | * @return |
| | | */ |
| | | @PostMapping("/userShop/delUserShop") |
| | | R delUserShop(@RequestBody UserShop userShop); |
| | | |
| | | /** |
| | | * 删除门店所有后台账号和门店关系数据 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | @PostMapping("/userShop/delShopAllUserShop") |
| | | R delShopAllUserShop(@RequestParam("shopId") Integer shopId); |
| | | } |
| | |
| | | userClient.updateSysUser(sysUser); |
| | | return R.ok(map); |
| | | } |
| | | @PostMapping("loginShop") |
| | | public R<?> loginShop(@RequestBody LoginBody form, HttpServletRequest request) { |
| | | // 用户登录 |
| | | LoginUser userInfo = sysLoginService.loginShop(form.getUsername(), form.getPassword(), request); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("token", tokenService.createToken(userInfo)); |
| | | List<SysRole> roles = userInfo.getSysUser().getRoles(); |
| | | if(CollectionUtils.isEmpty(roles)){ |
| | | return R.fail("请关联角色!"); |
| | | } |
| | | |
| | | map.put("roleName",roles.get(0).getRoleName()); |
| | | map.put("info", userInfo); |
| | | // 修改用户最后登录时间 |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.setUserId(userInfo.getSysUser().getUserId()); |
| | | sysUser.setLoginDate(new Date()); |
| | | System.out.println("修改用户登录时间" + sysUser); |
| | | userClient.updateSysUser(sysUser); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @DeleteMapping("logout") |
| | | public R<?> logout(HttpServletRequest request) { |
| | |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功"); |
| | | return userInfo; |
| | | } |
| | | public LoginUser loginShop(String username, String password, HttpServletRequest request) { |
| | | username = username.trim(); |
| | | // 查询用户信息 |
| | | R<LoginUser> userResult = remoteUserService.infoShop(username, SecurityConstants.INNER); |
| | | |
| | | if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) { |
| | | recordLogService.recordLogininfor(request, null, username, Constants.LOGIN_FAIL_STATUS, "登录用户不存在"); |
| | | throw new ServiceException("登录用户:" + username + " 不存在"); |
| | | } |
| | | LoginUser userInfo = userResult.getData(); |
| | | SysUser user = userResult.getData().getSysUser(); |
| | | |
| | | // 用户名或密码为空 错误 |
| | | if (StringUtils.isAnyBlank(username, password)) { |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户/密码必须填写"); |
| | | throw new ServiceException("用户/密码必须填写"); |
| | | } |
| | | // 密码如果不在指定范围内 错误 |
| | | if (password.length() < UserConstants.PASSWORD_MIN_LENGTH |
| | | || password.length() > UserConstants.PASSWORD_MAX_LENGTH) { |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户密码不在指定范围"); |
| | | throw new ServiceException("用户密码不在指定范围"); |
| | | } |
| | | // 用户名不在指定范围内 错误 |
| | | if (username.length() < UserConstants.USERNAME_MIN_LENGTH |
| | | || username.length() > UserConstants.USERNAME_MAX_LENGTH) { |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户名不在指定范围"); |
| | | throw new ServiceException("用户名不在指定范围"); |
| | | } |
| | | // IP黑名单校验 |
| | | String blackStr = Convert.toStr(redisService.getCacheObject(CacheConstants.SYS_LOGIN_BLACKIPLIST)); |
| | | if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) { |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "很遗憾,访问IP已被列入系统黑名单"); |
| | | throw new ServiceException("很遗憾,访问IP已被列入系统黑名单"); |
| | | } |
| | | |
| | | if (R.FAIL == userResult.getCode()) { |
| | | throw new ServiceException(userResult.getMsg()); |
| | | } |
| | | |
| | | |
| | | if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "对不起,您的账号已被删除"); |
| | | throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); |
| | | } |
| | | if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户已停用,请联系管理员"); |
| | | // throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
| | | throw new ServiceException("您的账号已被禁用,请联系平台"); |
| | | } |
| | | passwordService.validate(user, password, request); |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功"); |
| | | return userInfo; |
| | | } |
| | | |
| | | public void logout(String loginName, HttpServletRequest request) { |
| | | recordLogService.recordLogininfor(request, null, loginName, Constants.LOGIN_SUCCESS_STATUS, "退出成功"); |
| | |
| | | if(null == appUser){ |
| | | return error("请先注册小程序账号"); |
| | | } |
| | | SysUser one2 = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, user.getPhonenumber()) |
| | | .eq(SysUser::getDelFlag, "0").eq(SysUser::getStatus, "0").eq(SysUser::getObjectId, sysUser1.getObjectId()) |
| | | .eq(SysUser::getRoleType, 2)); |
| | | if(null != one2){ |
| | | return error("登录账号重复"); |
| | | } |
| | | SysUser one = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, user.getPhonenumber()) |
| | | .eq(SysUser::getDelFlag, "0").eq(SysUser::getStatus, "0").eq(SysUser::getRoleType, 2)); |
| | | if(null == one){ |
| | |
| | | } |
| | | |
| | | //添加门店员工关系数据 |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setUserId(one.getUserId()); |
| | | userShop.setShopId(sysUser1.getObjectId()); |
| | | userShop.setRoleType(2); |
| | | userShop.setRoleId(user.getRoleId()); |
| | | userShop.setDeptId(user.getDeptId()); |
| | | userShop.setNickName(user.getNickName()); |
| | | userShop.setCreateTime(LocalDateTime.now()); |
| | | userShopService.save(userShop); |
| | | UserShop one1 = userShopService.getOne(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, one.getUserId()).eq(UserShop::getShopId, sysUser1.getObjectId())); |
| | | if(null == one1){ |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setUserId(one.getUserId()); |
| | | userShop.setShopId(sysUser1.getObjectId()); |
| | | userShop.setRoleType(2); |
| | | userShop.setRoleId(user.getRoleId()); |
| | | userShop.setDeptId(user.getDeptId()); |
| | | userShop.setNickName(user.getNickName()); |
| | | userShop.setCreateTime(LocalDateTime.now()); |
| | | userShopService.save(userShop); |
| | | } |
| | | }else{ |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword("a123456")); |
| | |
| | | @GetMapping("/info/{username}") |
| | | public R<LoginUser> info(@PathVariable("username") String username) { |
| | | SysUser sysUser = userService.selectUserByUserName(username); |
| | | if (StringUtils.isNull(sysUser)) { |
| | | return R.fail("用户名或密码错误"); |
| | | } |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(sysUser); |
| | | // 权限集合getRolePermission |
| | | Set<String> permissions = permissionService.getMenuPermission(sysUser); |
| | | LoginUser sysUserVo = new LoginUser(); |
| | | sysUserVo.setSysUser(sysUser); |
| | | sysUserVo.setRoles(roles); |
| | | sysUserVo.setPermissions(permissions); |
| | | |
| | | return R.ok(sysUserVo); |
| | | } |
| | | |
| | | /** |
| | | * 门店登录使用 |
| | | * @param username |
| | | * @return |
| | | */ |
| | | @InnerAuth |
| | | @GetMapping("/infoShop/{username}") |
| | | public R<LoginUser> infoShop(@PathVariable("username") String username) { |
| | | SysUser sysUser = userService.selectUserShopByUserName(username); |
| | | if (StringUtils.isNull(sysUser)) { |
| | | return R.fail("用户名或密码错误"); |
| | | } |
| | |
| | | @PostMapping("/saveShopUser") |
| | | public R<Long> saveShopUser(@RequestBody SysUser user){ |
| | | SysUser one = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getPhonenumber, user.getPhonenumber()).eq(SysUser::getDelFlag, "0") |
| | | .eq(SysUser::getStatus, "0").eq(SysUser::getRoleType, 2).eq(SysUser::getAppUserId, user.getAppUserId())); |
| | | .eq(SysUser::getStatus, "0").eq(SysUser::getRoleType, 2)); |
| | | if(null == one){ |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | userService.save(user); |
| | |
| | | */ |
| | | @PostMapping("/user/delShopUser") |
| | | public R delShopUser(@RequestParam("objectId") Integer objectId, @RequestParam("roleType") Integer roleType){ |
| | | List<SysUser> list = userService.list(new LambdaUpdateWrapper<SysUser>().eq(SysUser::getObjectId, objectId).eq(SysUser::getRoleType, roleType) |
| | | .eq(SysUser::getDelFlag, "0").eq(SysUser::getStatus, "0")); |
| | | for (SysUser sysUser : list) { |
| | | List<UserShop> list1 = userShopService.list(new LambdaUpdateWrapper<UserShop>().eq(UserShop::getUserId, sysUser.getUserId())); |
| | | List<Integer> collect = list1.stream().map(UserShop::getShopId).collect(Collectors.toList()); |
| | | if(collect.contains(objectId) && collect.size() == 1){ |
| | | sysUser.setDelFlag("2"); |
| | | userService.updateById(sysUser); |
| | | List<UserShop> list2 = userShopService.list(new LambdaQueryWrapper<UserShop>().eq(UserShop::getShopId, objectId)); |
| | | for (UserShop userShop : list2) { |
| | | List<UserShop> list1 = userShopService.list(new LambdaUpdateWrapper<UserShop>().eq(UserShop::getUserId, userShop.getUserId())); |
| | | if(list1.size() == 1 && list1.get(0).getShopId().equals(objectId)){ |
| | | //删除管理员账号 |
| | | userService.deleteUserById(userShop.getUserId()); |
| | | }else{ |
| | | //修改管理后台账号关联的门店数据 |
| | | SysUser sysUser = userService.getById(userShop.getUserId()); |
| | | if(sysUser.getObjectId().equals(objectId)){ |
| | | Optional<UserShop> first = list1.stream().filter(s -> !s.getShopId().equals(objectId)).findFirst(); |
| | | if(first.isPresent()){ |
| | | sysUser.setObjectId(first.get().getShopId()); |
| | | userService.updateById(sysUser); |
| | | } |
| | | |
| | | } |
| | | } |
| | | if(sysUser.getObjectId().equals(objectId) && collect.size() > 1){ |
| | | Integer integer = collect.stream().filter(s -> !s.equals(sysUser.getObjectId())).findFirst().get(); |
| | | sysUser.setObjectId(integer); |
| | | userService.updateById(sysUser); |
| | | } |
| | | userShopService.remove(new LambdaUpdateWrapper<UserShop>().eq(UserShop::getUserId, sysUser.getUserId()).eq(UserShop::getShopId, objectId)); |
| | | userShopService.removeById(userShop.getId()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/queryUserByUserNameAndRoleType") |
| | | public R<SysUser> queryUserByUserNameAndRoleType(@RequestParam("roleType") String userName, @RequestParam("roleType") Integer roleType){ |
| | | public R<SysUser> queryUserByUserNameAndRoleType(@RequestParam("userName") String userName, @RequestParam("roleType") Integer roleType){ |
| | | SysUser user = userService.getOne(Wrappers.lambdaQuery(SysUser.class) |
| | | .eq(SysUser::getUserName, userName) |
| | | .eq(SysUser::getDelFlag, "0") |
| | |
| | | .last("LIMIT 1")); |
| | | return R.ok(user); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/delSysUserById") |
| | | public R delSysUserById(@RequestParam("userId") Long userId){ |
| | | userService.deleteUserById(userId); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.model.UserShop; |
| | | import com.ruoyi.system.service.UserShopService; |
| | | 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; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | userShopService.save(userShop); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除后台账号和门店关系数据 |
| | | * @param userShop |
| | | * @return |
| | | */ |
| | | @PostMapping("/delUserShop") |
| | | public R delUserShop(@RequestBody UserShop userShop){ |
| | | userShopService.remove(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, userShop.getUserId()).eq(UserShop::getShopId, userShop.getShopId())); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除门店所有关系数据 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | @PostMapping("/delShopAllUserShop") |
| | | public R delShopAllUserShop(@RequestParam("shopId") Integer shopId){ |
| | | userShopService.remove(new LambdaQueryWrapper<UserShop>().eq(UserShop::getShopId, shopId)); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | * @param sysUser 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | public List<SysUser> selectUserList(SysUser sysUser); |
| | | List<SysUser> selectUserList(SysUser sysUser); |
| | | |
| | | /** |
| | | * 根据条件分页查询已配用户角色列表 |
| | |
| | | * @param user 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | public List<SysUser> selectAllocatedList(SysUser user); |
| | | List<SysUser> selectAllocatedList(SysUser user); |
| | | |
| | | /** |
| | | * 根据条件分页查询未分配用户角色列表 |
| | |
| | | * @param user 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | public List<SysUser> selectUnallocatedList(SysUser user); |
| | | List<SysUser> selectUnallocatedList(SysUser user); |
| | | |
| | | /** |
| | | * 通过用户名查询用户 |
| | |
| | | * @param userName 用户名 |
| | | * @return 用户对象信息 |
| | | */ |
| | | public SysUser selectUserByUserName(String userName); |
| | | SysUser selectUserByUserName(String userName); |
| | | SysUser selectUserShopByUserName(String userName); |
| | | |
| | | /** |
| | | * 通过用户ID查询用户 |
| | |
| | | * @param userId 用户ID |
| | | * @return 用户对象信息 |
| | | */ |
| | | public SysUser selectUserById(Long userId); |
| | | SysUser selectUserById(Long userId); |
| | | |
| | | /** |
| | | * 新增用户信息 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertUser(SysUser user); |
| | | int insertUser(SysUser user); |
| | | |
| | | /** |
| | | * 修改用户信息 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateUser(SysUser user); |
| | | int updateUser(SysUser user); |
| | | |
| | | /** |
| | | * 修改用户头像 |
| | |
| | | * @param avatar 头像地址 |
| | | * @return 结果 |
| | | */ |
| | | public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); |
| | | int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); |
| | | |
| | | /** |
| | | * 重置用户密码 |
| | |
| | | * @param password 密码 |
| | | * @return 结果 |
| | | */ |
| | | public int resetUserPwd(@Param("userName") String userName, @Param("password") String password); |
| | | int resetUserPwd(@Param("userName") String userName, @Param("password") String password); |
| | | |
| | | /** |
| | | * 通过用户ID删除用户 |
| | |
| | | * @param userId 用户ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserById(Long userId); |
| | | int deleteUserById(Long userId); |
| | | |
| | | /** |
| | | * 批量删除用户信息 |
| | |
| | | * @param userIds 需要删除的用户ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserByIds(Long[] userIds); |
| | | int deleteUserByIds(Long[] userIds); |
| | | |
| | | /** |
| | | * 校验用户名称是否唯一 |
| | |
| | | * @param userName 用户名称 |
| | | * @return 结果 |
| | | */ |
| | | public SysUser checkUserNameUnique(String userName); |
| | | SysUser checkUserNameUnique(String userName); |
| | | |
| | | /** |
| | | * 校验手机号码是否唯一 |
| | |
| | | * @param phonenumber 手机号码 |
| | | * @return 结果 |
| | | */ |
| | | public SysUser checkPhoneUnique(String phonenumber); |
| | | SysUser checkPhoneUnique(String phonenumber); |
| | | |
| | | |
| | | |
| | |
| | | * @param email 用户邮箱 |
| | | * @return 结果 |
| | | */ |
| | | public SysUser checkEmailUnique(String email); |
| | | SysUser checkEmailUnique(String email); |
| | | |
| | | List<SysUser> getList(@Param("pageInfo") PageInfo<SysUser> pageInfo, @Param("req") GetSysUserList getSysUserList); |
| | | |
| | |
| | | * @param user 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | public List<SysUser> selectUserList(SysUser user); |
| | | List<SysUser> selectUserList(SysUser user); |
| | | |
| | | /** |
| | | * 根据条件分页查询已分配用户角色列表 |
| | |
| | | * @param user 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | public List<SysUser> selectAllocatedList(SysUser user); |
| | | List<SysUser> selectAllocatedList(SysUser user); |
| | | |
| | | /** |
| | | * 根据条件分页查询未分配用户角色列表 |
| | |
| | | * @param user 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | public List<SysUser> selectUnallocatedList(SysUser user); |
| | | List<SysUser> selectUnallocatedList(SysUser user); |
| | | |
| | | /** |
| | | * 通过用户名查询用户 |
| | |
| | | * @param userName 用户名 |
| | | * @return 用户对象信息 |
| | | */ |
| | | public SysUser selectUserByUserName(String userName); |
| | | SysUser selectUserByUserName(String userName); |
| | | SysUser selectUserShopByUserName(String userName); |
| | | |
| | | /** |
| | | * 通过用户ID查询用户 |
| | |
| | | * @param userId 用户ID |
| | | * @return 用户对象信息 |
| | | */ |
| | | public SysUser selectUserById(Long userId); |
| | | SysUser selectUserById(Long userId); |
| | | |
| | | /** |
| | | * 根据用户ID查询用户所属角色组 |
| | |
| | | * @param userName 用户名 |
| | | * @return 结果 |
| | | */ |
| | | public String selectUserRoleGroup(String userName); |
| | | String selectUserRoleGroup(String userName); |
| | | |
| | | /** |
| | | * 根据用户ID查询用户所属岗位组 |
| | |
| | | * @param userName 用户名 |
| | | * @return 结果 |
| | | */ |
| | | public String selectUserPostGroup(String userName); |
| | | String selectUserPostGroup(String userName); |
| | | |
| | | /** |
| | | * 校验用户名称是否唯一 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public boolean checkUserNameUnique(SysUser user); |
| | | boolean checkUserNameUnique(SysUser user); |
| | | |
| | | /** |
| | | * 校验手机号码是否唯一 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public boolean checkPhoneUnique(SysUser user); |
| | | boolean checkPhoneUnique(SysUser user); |
| | | |
| | | /** |
| | | * 校验email是否唯一 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public boolean checkEmailUnique(SysUser user); |
| | | boolean checkEmailUnique(SysUser user); |
| | | |
| | | /** |
| | | * 校验用户是否允许操作 |
| | | * |
| | | * @param user 用户信息 |
| | | */ |
| | | public void checkUserAllowed(SysUser user); |
| | | void checkUserAllowed(SysUser user); |
| | | |
| | | /** |
| | | * 校验用户是否有数据权限 |
| | | * |
| | | * @param userId 用户id |
| | | */ |
| | | public void checkUserDataScope(Long userId); |
| | | void checkUserDataScope(Long userId); |
| | | |
| | | /** |
| | | * 新增用户信息 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertUser(SysUser user); |
| | | int insertUser(SysUser user); |
| | | |
| | | /** |
| | | * 注册用户信息 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public boolean registerUser(SysUser user); |
| | | boolean registerUser(SysUser user); |
| | | |
| | | /** |
| | | * 修改用户信息 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateUser(SysUser user); |
| | | int updateUser(SysUser user); |
| | | |
| | | /** |
| | | * 用户授权角色 |
| | |
| | | * @param userId 用户ID |
| | | * @param roleIds 角色组 |
| | | */ |
| | | public void insertUserAuth(Long userId, Long[] roleIds); |
| | | void insertUserAuth(Long userId, Long[] roleIds); |
| | | |
| | | /** |
| | | * 修改用户状态 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateUserStatus(SysUser user); |
| | | int updateUserStatus(SysUser user); |
| | | |
| | | /** |
| | | * 修改用户基本信息 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateUserProfile(SysUser user); |
| | | int updateUserProfile(SysUser user); |
| | | |
| | | /** |
| | | * 修改用户头像 |
| | |
| | | * @param avatar 头像地址 |
| | | * @return 结果 |
| | | */ |
| | | public boolean updateUserAvatar(String userName, String avatar); |
| | | boolean updateUserAvatar(String userName, String avatar); |
| | | |
| | | /** |
| | | * 重置用户密码 |
| | |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public int resetPwd(SysUser user); |
| | | int resetPwd(SysUser user); |
| | | |
| | | /** |
| | | * 重置用户密码 |
| | |
| | | * @param password 密码 |
| | | * @return 结果 |
| | | */ |
| | | public int resetUserPwd(String userName, String password); |
| | | int resetUserPwd(String userName, String password); |
| | | |
| | | /** |
| | | * 通过用户ID删除用户 |
| | |
| | | * @param userId 用户ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserById(Long userId); |
| | | int deleteUserById(Long userId); |
| | | |
| | | /** |
| | | * 批量删除用户信息 |
| | |
| | | * @param userIds 需要删除的用户ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserByIds(Long[] userIds); |
| | | int deleteUserByIds(Long[] userIds); |
| | | |
| | | /** |
| | | * 导入用户数据 |
| | |
| | | * @param operName 操作用户 |
| | | * @return 结果 |
| | | */ |
| | | public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName); |
| | | String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName); |
| | | |
| | | PageInfo<SysUser> getList(PageInfo<SysUser> pageInfo, GetSysUserList getSysUserList); |
| | | |
| | |
| | | public SysUser selectUserByUserName(String userName) { |
| | | return userMapper.selectUserByUserName(userName); |
| | | } |
| | | @Override |
| | | public SysUser selectUserShopByUserName(String userName) { |
| | | return userMapper.selectUserShopByUserName(userName); |
| | | } |
| | | |
| | | /** |
| | | * 通过用户ID查询用户 |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int updateUser(SysUser user) { |
| | | // Long userId = user.getUserId(); |
| | | // // 删除用户与角色关联 |
| | | // userRoleMapper.deleteUserRoleByUserId(userId); |
| | | // // 新增用户与角色管理 |
| | | // insertUserRole(user); |
| | | // // 删除用户与岗位关联 |
| | | // userPostMapper.deleteUserPostByUserId(userId); |
| | | // // 新增用户与岗位管理 |
| | | // insertUserPost(user); |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deleteUserByIds(Long[] userIds) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = this.getById(userid); |
| | | for (Long userId : userIds) { |
| | | checkUserAllowed(new SysUser(userId)); |
| | | // checkUserDataScope(userId); |
| | | } |
| | | // 删除用户与角色关联 |
| | | // userRoleMapper.deleteUserRole(userIds); |
| | | // // 删除用户与岗位关联 |
| | | // userPostMapper.deleteUserPost(userIds); |
| | | // int i = userMapper.deleteUserByIds(userIds); |
| | | List<SysUser> sysUsers = this.listByIds(Arrays.asList(userIds)); |
| | | for (SysUser user : sysUsers) { |
| | | if(2 == user.getRoleType()){ |
| | |
| | | } |
| | | long count = userShopService.count(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, user.getUserId())); |
| | | if(0 == count){ |
| | | user.setDelFlag("2"); |
| | | this.updateById(user); |
| | | userMapper.deleteUserById(user.getUserId()); |
| | | } |
| | | }else{ |
| | | user.setDelFlag("2"); |
| | | this.updateById(user); |
| | | userMapper.deleteUserById(user.getUserId()); |
| | | } |
| | | } |
| | | return 0; |
| | |
| | | <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> |
| | | <include refid="selectUserVo"/> |
| | | where u.user_name = #{userName} and u.del_flag = '0' |
| | | and u.role_type = 1 |
| | | </select> |
| | | <select id="selectUserShopByUserName" parameterType="String" resultMap="SysUserResult"> |
| | | <include refid="selectUserVo"/> |
| | | where u.user_name = #{userName} and u.del_flag = '0' |
| | | and u.role_type = 2 |
| | | </select> |
| | | |
| | | <select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.redis.annotation.DistributedLock; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.feignClient.OrderClient; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | |
| | | userCancellationLogService.save(userCancellationLog); |
| | | user.setStatus(3); |
| | | appUserService.updateById(user); |
| | | |
| | | List<AppUser> subUserList = appUserService.list(new LambdaQueryWrapper<AppUser>() |
| | | .eq(AppUser::getInviteUserId, userId)); |
| | | for (AppUser appUser : subUserList) { |
| | | Long inviteUserId = user.getInviteUserId(); |
| | | appUser.setInviteUserId(inviteUserId); |
| | | } |
| | | appUserService.updateBatchById(subUserList); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | //获取在该本店下单的用户ids |
| | | Integer objectId = sysUser.getObjectId(); |
| | | R<List<Order>> listR = remoteOrderGoodsClient.byShopId(objectId); |
| | | for (Order datum : listR.getData()) { |
| | | userIds.add(datum.getAppUserId()); |
| | | if (listR.getData()!=null){ |
| | | for (Order datum : listR.getData()) { |
| | | userIds.add(datum.getAppUserId()); |
| | | } |
| | | } |
| | | IPage<AppUser> appuserPage = appUserService.getAppuserPage1(pageCurr, pageSize, appUser, objectId, userIds); |
| | | return R.ok(appuserPage); |
| | |
| | | SysUser data = sysUserClient.getSysUser(userid).getData(); |
| | | Integer shopId = null; |
| | | Set<Long> userId = null; |
| | | Set<Long> userIdT = null; |
| | | if(data.getRoleType() == 2){ |
| | | shopId = data.getObjectId(); |
| | | userId = orderClient.getAppUserByShoppingShop(shopId).getData(); |
| | | } |
| | | UserStatistics userStatistics = appUserMapper.getUserStatistics(shopId, userId); |
| | | UserStatistics userStatistics1 = appUserMapper.getUserStatistics(shopId, userIdT); |
| | | userStatistics.setShopUser(userStatistics1.getShopUser()); |
| | | return R.ok(userStatistics); |
| | | } |
| | | |
| | |
| | | List<Goods> data1 = goodsClient.getAllGoods().getData(); |
| | | List<String> collect = data1.stream().map(Goods::getName).collect(Collectors.toList()); |
| | | goodNames.addAll(collect); |
| | | }else{ |
| | | }else if(StringUtils.isEmpty(data.getForGoodIds())){ |
| | | goodNames.addAll(JSON.parseArray(data.getGoodsNameJson(), String.class)); |
| | | }else { |
| | | String[] split = vo.getForGoodIds().split(","); |
| | | R<List<Goods>> goodsById = goodsClient.getGoodsById(split); |
| | | if (goodsById.getData()!=null){ |
| | |
| | | @ApiOperation(value = "积分管理-用户积分明细(必传用户id)", tags = "后台") |
| | | public R<Page<UserPoint>> userlist(UserPoint userPoint) { |
| | | Page<UserPoint> page = userPointService.lambdaQuery() |
| | | .eq(UserPoint::getType, userPoint.getType()) |
| | | .eq(userPoint.getType()!=null,UserPoint::getType, userPoint.getType()) |
| | | .eq(UserPoint::getAppUserId, userPoint.getAppUserId()) |
| | | .orderByDesc(UserPoint::getCreateTime) |
| | | .page(Page.of(userPoint.getPageNum(), userPoint.getPageSize())); |
| | |
| | | R<BigDecimal> bigDecimalR = systemConfigClient.redPackegeSet(); |
| | | userSignRecord.setRedAmount(bigDecimalR.getData()); |
| | | userSignRecord.setSignDay(LocalDate.now()); |
| | | |
| | | BigDecimal sum = appUser.getTotalRedPacketAmount().add(bigDecimalR.getData()); |
| | | appUser.setTotalRedPacketAmount(sum); |
| | | BigDecimal sum2 = appUser.getBalance().add(bigDecimalR.getData()); |
| | | appUser.setBalance(sum2); |
| | | appUserService.updateById(appUser); |
| | | SignBackRDto signBackRDto = new SignBackRDto(); |
| | | signBackRDto.setPoint(userSignRecord.getPoint()); |
| | | signBackRDto.setRedAmount(userSignRecord.getRedAmount()); |
| | |
| | | @PostMapping("/withdrawalCallback") |
| | | public Object withdrawalCallback(@RequestBody SinglePayCallbackResult singlePayCallbackResult){ |
| | | Integer status = singlePayCallbackResult.getStatus(); |
| | | String merchantOrderNo = singlePayCallbackResult.getMerchantOrderNo(); |
| | | WithdrawalRequests withdrawalRequests = withdrawalRequestsService.getById(merchantOrderNo); |
| | | if(203 == status || 205 == status){ |
| | | String merchantOrderNo = singlePayCallbackResult.getMerchantOrderNo(); |
| | | WithdrawalRequests withdrawalRequests = withdrawalRequestsService.getById(merchantOrderNo); |
| | | if(1 == withdrawalRequests.getStatus()){ |
| | | withdrawalRequests.setStatus(2); |
| | | withdrawalRequests.setArrivalTime(LocalDateTime.now()); |
| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("statusCode", 2001); |
| | | return jsonObject; |
| | | }else{ |
| | | //回退扣除的金额,添加明细记录 |
| | | //修改用户的可提现金额 |
| | | BigDecimal withdrawalAmount = withdrawalRequests.getWithdrawalAmount(); |
| | | AppUser appUser = appUserService.getById(withdrawalRequests.getAppUserId()); |
| | | BigDecimal withdrawableAmount = appUser.getWithdrawableAmount(); |
| | | BigDecimal withdrawnAmount = appUser.getWithdrawnAmount(); |
| | | BigDecimal balance = appUser.getBalance(); |
| | | appUser.setWithdrawableAmount(withdrawableAmount.add(withdrawalAmount).setScale(2, RoundingMode.HALF_EVEN)); |
| | | appUser.setWithdrawnAmount(withdrawnAmount.subtract(withdrawalAmount).setScale(2, RoundingMode.HALF_EVEN)); |
| | | appUser.setBalance(appUser.getBalance().add(withdrawalAmount).setScale(2, RoundingMode.HALF_EVEN)); |
| | | appUserService.updateById(appUser); |
| | | //添加变动明细 |
| | | BalanceChangeRecord balanceChangeRecord = new BalanceChangeRecord(); |
| | | balanceChangeRecord.setAppUserId(appUser.getId()); |
| | | balanceChangeRecord.setVipId(appUser.getVipId()); |
| | | balanceChangeRecord.setOrderId(withdrawalRequests.getId()); |
| | | balanceChangeRecord.setChangeType(2); |
| | | balanceChangeRecord.setBeforeAmount(balance); |
| | | balanceChangeRecord.setChangeAmount(withdrawalAmount); |
| | | balanceChangeRecord.setAfterAmount(appUser.getBalance()); |
| | | balanceChangeRecord.setDelFlag(0); |
| | | balanceChangeRecord.setCreateTime(LocalDateTime.now()); |
| | | balanceChangeRecordService.save(balanceChangeRecord); |
| | | |
| | | withdrawalRequests.setStatus(3); |
| | | withdrawalRequests.setRemark(singlePayCallbackResult.getErrorCodeDesc()); |
| | | withdrawalRequestsService.updateById(withdrawalRequests); |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("statusCode", 2001); |
| | | return jsonObject; |
| | | } |
| | | return new JSONObject(); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.redis.annotation.DistributedLock; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.*; |
| | |
| | | userPointDetailVO.setVariablePoint(p.getVariablePoint()); |
| | | String format = p.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | userPointDetailVO.setCreateTime(format); |
| | | Integer historicalPoint = p.getHistoricalPoint(); |
| | | Integer balance = p.getBalance(); |
| | | if (historicalPoint != null && balance != null) { |
| | | userPointDetailVO.setFlag(historicalPoint > balance ? 2 : 1); |
| | | } |
| | | return userPointDetailVO; |
| | | }).collect(Collectors.toList()); |
| | | PageInfo<UserPointDetailVO> pageInfo1 = new PageInfo<>(pageCurr, pageSize); |
| | |
| | | // 获取提现审核中的金额 |
| | | List<WithdrawalRequests> waitAuditList = withdrawalRequestsService.list(new LambdaQueryWrapper<WithdrawalRequests>() |
| | | .eq(WithdrawalRequests::getAppUserId, userId) |
| | | .eq(WithdrawalRequests::getAuditStatus, WithdrawalAuditStatus.WAIT_AUDIT)); |
| | | |
| | | .eq(WithdrawalRequests::getAuditStatus, WithdrawalAuditStatus.WAIT_AUDIT.getCode())); |
| | | BigDecimal reduce = waitAuditList.stream().map(WithdrawalRequests::getWithdrawalAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | WalletVO walletVO = new WalletVO(); |
| | | walletVO.setWithdrawalAmount(appUser.getWithdrawableAmount()); |
| | | walletVO.setWithdrawnAmount(appUser.getWithdrawnAmount()); |
| | | walletVO.setWithdrawnAmount(appUser.getWithdrawnAmount().subtract(reduce)); |
| | | walletVO.setVipWithdrawalMinAmount(data.getVipWithdrawalMinAmount()); |
| | | walletVO.setTotalRechargeAmount(appUser.getTotalRechargeAmount()); |
| | | walletVO.setTotalRedPacketAmount(appUser.getTotalRedPacketAmount()); |
| | | walletVO.setTotalDistributionAmount(appUser.getTotalDistributionAmount()); |
| | | walletVO.setAuditAmount(waitAuditList.stream() |
| | | .map(WithdrawalRequests::getWithdrawalAmount) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | walletVO.setAuditAmount(reduce); |
| | | walletVO.setBalance(appUser.getBalance()); |
| | | return walletVO; |
| | | } |
| | |
| | | .divide(VIP_WITHDRAWAL_FEE_DENOMINATOR, 2, RoundingMode.HALF_UP); |
| | | // 减去手续费 |
| | | BigDecimal multiply = params.getWithdrawalAmount().multiply(vipWithdrawalFee); |
| | | params.setWithdrawalAmount(params.getWithdrawalAmount() |
| | | .subtract(multiply)); |
| | | params.setWithdrawalAmount(params.getWithdrawalAmount().subtract(multiply)); |
| | | |
| | | WithdrawalRequests withdrawalRequests = new WithdrawalRequests(); |
| | | BeanUtils.copyBeanProp(withdrawalRequests, params); |
| | |
| | | withdrawalRequests.setBankCardNumber(appUserBank.getBankNumber()); |
| | | } |
| | | withdrawalRequests.setWithdrawalAmount(withdrawalAmount); |
| | | withdrawalRequests.setArrivalAmount(withdrawalRequests.getWithdrawalAmount()); |
| | | withdrawalRequests.setArrivalAmount(params.getWithdrawalAmount()); |
| | | withdrawalRequests.setServiceCharge(multiply); |
| | | withdrawalRequests.setDelFlag(0); |
| | | withdrawalRequests.setAppUserId(SecurityUtils.getUserId()); |
| | |
| | | @ApiModelProperty(value = "变动时间") |
| | | private String createTime; |
| | | |
| | | @ApiModelProperty(value = "增或减标识: 1-增 2-减") |
| | | private Integer flag; |
| | | } |
| | |
| | | t_app_user tau |
| | | <where> |
| | | <if test="null != shopId"> |
| | | tau.shop_id = #{shopId} or tau.id in |
| | | <foreach collection="userId" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | tau.shop_id = #{shopId} |
| | | <if test="null != userId"> |
| | | or tau.id in |
| | | <foreach collection="userId" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | and tau.del_flag = 0 |
| | | and tau.`status` !=3 |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "String"), |
| | | }) |
| | | @GetMapping("/writeOff/{id}/{shopId}") |
| | | public R<Void> writeOff(@PathVariable("id") String id, @PathVariable("shopId") Integer shopId){ |
| | | orderService.writeOff(id, shopId); |
| | | @GetMapping("/writeOff") |
| | | public R<Void> writeOff(String code, Integer shopId, String technicianId){ |
| | | orderService.writeOff(code, shopId, technicianId); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PostMapping("/confirmDelivery") |
| | | @ApiOperation(value = "已发货操作", tags = {"管理后台-订单管理"}) |
| | | public R confirmDelivery(@RequestBody ConfirmDelivery confirmDelivery){ |
| | | return orderService.confirmDelivery(confirmDelivery.getOrderId(), confirmDelivery.getCode()); |
| | | return orderService.confirmDelivery(confirmDelivery); |
| | | } |
| | | |
| | | |
| | |
| | | .orderByAsc(Order::getCreateTime)); |
| | | |
| | | |
| | | Map<String, List<Order>> map = orderList.stream().collect(Collectors.groupingBy(item -> item.getCreateTime() |
| | | .format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))); |
| | | Map<String, List<Order>> map = orderList.stream() |
| | | .collect(Collectors.groupingBy( |
| | | item -> item.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")), |
| | | TreeMap::new, // 使用 TreeMap 按键排序 |
| | | Collectors.toList() |
| | | )); |
| | | |
| | | List<OrderStatisticsDetail> orderStatisticsDetails = new ArrayList<>(); |
| | | map.forEach((key, value) -> { |
| | |
| | | if (order.getOrderType().equals(1)) { |
| | | serviceTotal++; |
| | | serviceTotalMoney = serviceTotalMoney.add(order.getPaymentAmount()); |
| | | }else if (order.getOrderType().equals(2)){ |
| | | total++; |
| | | totalMoney = totalMoney.add(order.getPaymentAmount()); |
| | | }else if (order.getOrderType().equals(2) && 1 == order.getDistributionMode()){ |
| | | singleTotal++; |
| | | singleTotalMoney = singleTotalMoney.add(order.getPaymentAmount()); |
| | | total++; |
| | | totalMoney = totalMoney.add(order.getPaymentAmount()); |
| | | } |
| | | total++; |
| | | totalMoney = totalMoney.add(order.getPaymentAmount()); |
| | | } |
| | | orderStatisticsDetail.setDate(key); |
| | | orderStatisticsDetail.setServiceTotal(serviceTotal); |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | |
| | | import com.ruoyi.order.model.RefundPass; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.RefundPassService; |
| | | import com.ruoyi.order.util.ExpressDeliveryUtil; |
| | | import com.ruoyi.order.util.vo.MapTrackKD100Vo; |
| | | import com.ruoyi.order.vo.*; |
| | | import com.ruoyi.other.api.domain.SystemConfig; |
| | | import com.ruoyi.other.api.feignClient.SystemConfigClient; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Resource |
| | | private SystemConfigClient systemConfigClient; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/applyRefundPass") |
| | |
| | | } |
| | | RefundPass one = refundPassService.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, orderId) |
| | | .eq(RefundPass::getDelFlag, 0).last(" order by create_time desc limit 0,1")); |
| | | if(null == one){ |
| | | return R.fail("无效的售后数据"); |
| | | } |
| | | one.setIdStr(one.getId().toString()); |
| | | one.setAddressJson(order.getAddressJson()); |
| | | return R.ok(one); |
| | |
| | | } |
| | | refundPass.setStatus(5); |
| | | refundPass.setCode(pass.getCode()); |
| | | |
| | | //添加查询快递信息队列 |
| | | //一小时后定时查询快递信息 |
| | | SystemConfig systemConfig = systemConfigClient.getSystemConfig(3).getData(); |
| | | JSONObject jsonObject = JSON.parseObject(systemConfig.getContent()); |
| | | Integer waitTime = jsonObject.getInteger("waitTime"); |
| | | redisTemplate.opsForZSet().add("order_refund_express", refundPass.getId(), LocalDateTime.now().plusHours(waitTime).toEpochSecond(ZoneOffset.UTC)); |
| | | |
| | | JSONObject jsonObject1 = JSON.parseObject(pass.getCode()); |
| | | String com = jsonObject1.getString("com"); |
| | | String num = jsonObject1.getString("num"); |
| | | UserAddress userAddress = JSON.parseObject(order.getAddressJson(), UserAddress.class); |
| | | MapTrackKD100Vo mapTrackKD100Vo = ExpressDeliveryUtil.kd100MapTrack(com, num, userAddress.getProvince() + userAddress.getCity(), order.getDeliverProvince() + order.getDeliverCity()); |
| | | refundPass.setExpressResult(JSON.toJSONString(mapTrackKD100Vo)); |
| | | refundPassService.updateById(refundPass); |
| | | return R.ok(); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取订单快递明细 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/getOrderExpress/{id}") |
| | | @ApiOperation(value = "获取售后订单快递明细", tags = {"小程序-订单管理"}) |
| | | public R<MapTrackKD100Vo> getOrderExpress(@PathVariable("id") Long id){ |
| | | RefundPass refundPass = refundPassService.getById(id); |
| | | String expressResult = refundPass.getExpressResult(); |
| | | if(StringUtils.isNotEmpty(expressResult)){ |
| | | MapTrackKD100Vo mapTrackKD100Vo = JSON.parseObject(expressResult, MapTrackKD100Vo.class); |
| | | return R.ok(mapTrackKD100Vo); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | boolean check(Order order, Integer shopId, Long userId); |
| | | |
| | | void writeOff(String id,Integer shopId); |
| | | void writeOff(String id,Integer shopId, String technicianId); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 确认发货操作 |
| | | * @param orderId |
| | | * @param code |
| | | * @return |
| | | */ |
| | | R confirmDelivery(Long orderId, String code); |
| | | R confirmDelivery(ConfirmDelivery confirmDelivery); |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | RefundPassInfo getRefundPassInfo(Long id); |
| | | |
| | | |
| | | /** |
| | | * 定时查询快递信息 |
| | | */ |
| | | void taskExpress(); |
| | | } |
| | |
| | | } |
| | | OrderDetailVO orderDetailVO = new OrderDetailVO(); |
| | | orderDetailVO.setDistributionMode(order.getDistributionMode()); |
| | | Technician technician = new Technician(); |
| | | if (order.getTechnicianId() != null){ |
| | | R<Technician> shopdetail = technicianClient.shopdetail(order.getTechnicianId()); |
| | | if (shopdetail.getCode() != R.SUCCESS){ |
| | | throw new ServiceException("获取技师信息失败"); |
| | | } |
| | | technician = shopdetail.getData(); |
| | | } |
| | | Shop shop = shopR.getData(); |
| | | orderDetailVO.setId(order.getId()); |
| | | orderDetailVO.setOrderStatus(order.getOrderStatus()); |
| | |
| | | orderDetailVO.setLongitude(shop.getLongitude()); |
| | | orderDetailVO.setLatitude(shop.getLatitude()); |
| | | orderDetailVO.setShopId(shop.getId()); |
| | | orderDetailVO.setTechnicianName(technician.getName()); |
| | | orderDetailVO.setTechnicianId(technician.getId()); |
| | | if(order.getOrderType() == 1){ |
| | | List<TechnicianSubscribe> data = technicianSubscribeClient.getTechnicianSubscribeList(order.getId()).getData(); |
| | | if(data.size() > 0){ |
| | | Long id = data.get(0).getId(); |
| | | orderDetailVO.setTechnicianSubscribeId(id.toString()); |
| | | Technician technician = technicianClient.shopdetail(order.getTechnicianId()).getData(); |
| | | orderDetailVO.setTechnicianName(technician.getName()); |
| | | orderDetailVO.setTechnicianId(technician.getId()); |
| | | } |
| | | } |
| | | // 生成核销码BASE64 |
| | | try { |
| | | String base64 = QRCodeGenerator.generateQRCodeBase64(order.getOrderNumber(), 124, 124); |
| | | String base64 = QRCodeGenerator.generateQRCodeBase64(String.valueOf(order.getId()), 124, 124); |
| | | orderDetailVO.setWriteOffCode(base64); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void writeOff(String id,Integer shopId) { |
| | | public void writeOff(String id, Integer shopId, String technicianId) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | Order order = orderMapper.selectById(id); |
| | | boolean check = check(order, shopId, loginUserApplet.getUserid()); |
| | | if (!check){ |
| | | throw new ServiceException("订单不存在"); |
| | | throw new ServiceException("该订单与当前扫码门店不一致"); |
| | | } |
| | | |
| | | // 售后设置 |
| | |
| | | order.setAfterSaleTime(LocalDateTime.now().plusDays(days)); |
| | | order.setEndTime(LocalDateTime.now()); |
| | | order.setCancellerAppUserId(loginUserApplet.getUserid()); |
| | | if(StringUtils.isNotEmpty(technicianId) && !"null".equals(technicianId)){ |
| | | order.setTechnicianId(Integer.valueOf(technicianId)); |
| | | } |
| | | orderMapper.updateById(order); |
| | | } |
| | | |
| | |
| | | orderPageListVo.setUserName(appUser.getName()); |
| | | orderPageListVo.setPhone(appUser.getPhone()); |
| | | } |
| | | RefundPass one = refundPassService.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, orderPageListVo.getId()).eq(RefundPass::getDelFlag, 0).last(" order by create_time desc limit 0, 1")); |
| | | // RefundPass one = refundPassService.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, orderPageListVo.getId()).eq(RefundPass::getDelFlag, 0).last(" order by create_time desc limit 0,1")); |
| | | RefundPass one = refundPassService.lambdaQuery().eq(RefundPass::getOrderId, orderPageListVo.getId()).one(); |
| | | orderPageListVo.setRefundPassId(null != one ? one.getId().toString() : null); |
| | | |
| | | // 平台分佣 |
| | | List<ShopBalanceStatement> data = shopBalanceStatementClient.getShopBalanceStatementList(Arrays.asList(1, 2, 3), Long.valueOf(orderPageListVo.getId())).getData(); |
| | | BigDecimal reduce = data.stream().map(ShopBalanceStatement::getVariableAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | orderPageListVo.setGetCommission(reduce); |
| | | } |
| | | return pageInfo.setRecords(list); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 确认发货操作 |
| | | * @param orderId |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R confirmDelivery(Long orderId, String code) { |
| | | Order order = this.getById(orderId); |
| | | public R confirmDelivery(ConfirmDelivery confirmDelivery) { |
| | | Order order = this.getById(confirmDelivery.getOrderId()); |
| | | if(1 == order.getPayStatus()){ |
| | | return R.fail("订单还未完成支付"); |
| | | } |
| | |
| | | return R.fail("无效的操作"); |
| | | } |
| | | //添加快递号和修改订单状态 |
| | | order.setExpressJson(code); |
| | | order.setExpressJson(confirmDelivery.getCode()); |
| | | order.setDeliverProvince(confirmDelivery.getDeliverProvince()); |
| | | order.setDeliverProvinceCode(confirmDelivery.getDeliverProvinceCode()); |
| | | order.setDeliverCity(confirmDelivery.getDeliverCity()); |
| | | order.setDeliverCityCode(confirmDelivery.getDeliverCityCode()); |
| | | order.setDeliverDistrict(confirmDelivery.getDeliverDistrict()); |
| | | order.setDeliverDistrictCode(confirmDelivery.getDeliverDistrictCode()); |
| | | order.setOrderStatus(2); |
| | | //添加查询快递信息队列 |
| | | //一小时后定时查询快递信息 |
| | | SystemConfig systemConfig = systemConfigClient.getSystemConfig(3).getData(); |
| | | JSONObject jsonObject = JSON.parseObject(systemConfig.getContent()); |
| | | Integer waitTime = jsonObject.getInteger("waitTime"); |
| | | redisTemplate.opsForZSet().add("order_express", order.getId(), LocalDateTime.now().plusHours(waitTime).toEpochSecond(ZoneOffset.UTC)); |
| | | |
| | | JSONObject jsonObject1 = JSON.parseObject(confirmDelivery.getCode()); |
| | | String com = jsonObject1.getString("com"); |
| | | String num = jsonObject1.getString("num"); |
| | | UserAddress userAddress = JSON.parseObject(order.getAddressJson(), UserAddress.class); |
| | | MapTrackKD100Vo mapTrackKD100Vo = ExpressDeliveryUtil.kd100MapTrack(com, num, order.getDeliverProvince() + order.getDeliverCity(), |
| | | userAddress.getProvince() + userAddress.getCity()); |
| | | order.setExpressResult(JSON.toJSONString(mapTrackKD100Vo)); |
| | | this.updateById(order); |
| | | return R.ok(); |
| | | } |
| | |
| | | userPoint.setAppUserId(order.getAppUserId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | appUserClient.editAppUserById(appUser); |
| | | } |
| | | |
| | | order.setRefundStatus(2); |
| | |
| | | import com.kuaidi100.sdk.contant.CompanyConstant; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | |
| | | import com.ruoyi.order.model.RefundPass; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.RefundPassService; |
| | | import com.ruoyi.order.util.ExpressDeliveryUtil; |
| | | import com.ruoyi.order.util.vo.MapTrackKD100Vo; |
| | | import com.ruoyi.order.vo.*; |
| | | import com.ruoyi.other.api.domain.BaseSetting; |
| | | import com.ruoyi.other.api.domain.SystemConfig; |
| | | import com.ruoyi.other.api.feignClient.BaseSettingClient; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import com.ruoyi.other.api.feignClient.SystemConfigClient; |
| | | import com.ruoyi.other.api.feignClient.TechnicianClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Resource |
| | | private SystemConfigClient systemConfigClient; |
| | | |
| | | |
| | | |
| | |
| | | refundPass.setPhone(jsonObject.getString("phone")); |
| | | refundPass.setAddress(jsonObject.getString("address")); |
| | | this.save(refundPass); |
| | | order.setOldOrderStatus(order.getOrderStatus()); |
| | | order.setOrderStatus(7); |
| | | orderService.updateById(order); |
| | | return R.ok(); |
| | |
| | | } |
| | | return refundPassInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时查询快递信息 |
| | | */ |
| | | @Override |
| | | public void taskExpress() { |
| | | Set<Long> order_express = redisTemplate.opsForZSet().rangeByScore("order_refund_express", 0, LocalDateTime.now().toEpochSecond(ZoneOffset.UTC)); |
| | | if(order_express.size() > 0){ |
| | | for (Long id : order_express) { |
| | | RefundPass refundPass = this.getById(id); |
| | | Order order = orderService.getById(refundPass.getOrderId()); |
| | | if(refundPass.getPassStatus() != 5){ |
| | | redisTemplate.opsForZSet().remove("order_refund_express", id); |
| | | continue; |
| | | } |
| | | String expressJson = refundPass.getCode(); |
| | | if(StringUtils.isEmpty(expressJson)){ |
| | | redisTemplate.opsForZSet().remove("order_refund_express", id); |
| | | continue; |
| | | } |
| | | //{"com":"jd","num":"JDV016336234367"} |
| | | JSONObject jsonObject1 = JSON.parseObject(refundPass.getCode()); |
| | | String com = jsonObject1.getString("com"); |
| | | String num = jsonObject1.getString("num"); |
| | | UserAddress userAddress = JSON.parseObject(order.getAddressJson(), UserAddress.class); |
| | | MapTrackKD100Vo mapTrackKD100Vo = ExpressDeliveryUtil.kd100MapTrack(com, num, userAddress.getProvince() + userAddress.getCity(), order.getDeliverProvince() + order.getDeliverCity()); |
| | | refundPass.setExpressResult(JSON.toJSONString(mapTrackKD100Vo)); |
| | | this.updateById(refundPass); |
| | | //延长时间x小时 |
| | | SystemConfig systemConfig = systemConfigClient.getSystemConfig(3).getData(); |
| | | JSONObject jsonObject2 = JSON.parseObject(systemConfig.getContent()); |
| | | Integer waitTime = jsonObject2.getInteger("waitTime"); |
| | | redisTemplate.opsForZSet().add("order_refund_express", refundPass.getId(), LocalDateTime.now().plusHours(waitTime).toEpochSecond(ZoneOffset.UTC)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | BigDecimal bigDecimal = BigDecimal.ZERO; |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | bigDecimal = bigDecimal.add(myShoppingCartVo.getCash().multiply(new BigDecimal(myShoppingCartVo.getNumber()))); |
| | | myShoppingCartVo.setEarnSpendingPoints(myShoppingCartVo.getEarnSpendingPoints() * myShoppingCartVo.getNumber()); |
| | | } |
| | | confirmOrderVo.setOrderMoney(bigDecimal); |
| | | }else{ |
| | | int sum = 0; |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | sum += (myShoppingCartVo.getPoint() * myShoppingCartVo.getNumber()); |
| | | myShoppingCartVo.setEarnSpendingPoints(myShoppingCartVo.getEarnSpendingPoints() * myShoppingCartVo.getNumber()); |
| | | } |
| | | confirmOrderVo.setOrderPoint(sum); |
| | | } |
| | |
| | | userCouponClient.editUserCoupon(userCoupon); |
| | | } |
| | | } |
| | | //添加查询快递信息队列 |
| | | if(StringUtils.isNotEmpty(order.getExpressJson())){ |
| | | //一小时后定时查询快递信息 |
| | | redisTemplate.opsForZSet().add("order_express", order.getId(), LocalDateTime.now().plusHours(1).toEpochSecond(ZoneOffset.UTC)); |
| | | } |
| | | |
| | | |
| | | //删除购物车数据 |
| | | userid = tokenService.getLoginUserApplet().getUserid(); |
| | |
| | | userCouponClient.editUserCoupon(userCoupon); |
| | | } |
| | | } |
| | | //添加查询快递信息队列 |
| | | if(StringUtils.isNotEmpty(order.getExpressJson())){ |
| | | //一小时后定时查询快递信息 |
| | | redisTemplate.opsForZSet().add("order_express", order.getId(), LocalDateTime.now().plusHours(1).toEpochSecond(ZoneOffset.UTC)); |
| | | } |
| | | |
| | | } |
| | | //积分支付 |
| | | if(3 == shoppingCartPayment.getPaymentType()){ |
| | |
| | | //删除购物车数据 |
| | | this.removeBatchByIds(ids); |
| | | } |
| | | //添加查询快递信息队列 |
| | | if(StringUtils.isNotEmpty(order.getExpressJson())){ |
| | | //一小时后定时查询快递信息 |
| | | SystemConfig systemConfig = systemConfigClient.getSystemConfig(3).getData(); |
| | | JSONObject jsonObject = JSON.parseObject(systemConfig.getContent()); |
| | | Integer waitTime = jsonObject.getInteger("waitTime"); |
| | | redisTemplate.opsForZSet().add("order_express", order.getId(), LocalDateTime.now().plusHours(waitTime).toEpochSecond(ZoneOffset.UTC)); |
| | | } |
| | | |
| | | } |
| | | |
| | | //添加账户余额支付明细 |
| | |
| | | userCoupon.setUseTime(LocalDateTime.now()); |
| | | userCouponClient.editUserCoupon(userCoupon); |
| | | } |
| | | } |
| | | //添加查询快递信息队列 |
| | | if(StringUtils.isNotEmpty(order.getExpressJson())){ |
| | | //一小时后定时查询快递信息 |
| | | redisTemplate.opsForZSet().add("order_express", order.getId(), LocalDateTime.now().plusHours(1).toEpochSecond(ZoneOffset.UTC)); |
| | | } |
| | | |
| | | //删除购物车数据 |
| | |
| | | public static MapTrackKD100Vo kd100MapTrack(String com, String num, String from, String to){ |
| | | QueryTrackReq queryTrackReq = new QueryTrackReq(); |
| | | QueryTrackParam queryTrackParam = new QueryTrackParam(); |
| | | queryTrackParam.setCom(CompanyConstant.YD); |
| | | // queryTrackParam.setCom(CompanyConstant.YD); |
| | | queryTrackParam.setCom(com); |
| | | queryTrackParam.setNum(num); |
| | | queryTrackParam.setFrom(from); |
| | | queryTrackParam.setTo(to); |
| | |
| | | return mapTrackKD100Vo; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | ExpressDeliveryUtil.kd100MapTrack("zhongtong", "75617413683310", "湖南省长沙市", "四川省成都市"); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private Long orderId; |
| | | @ApiModelProperty("快递json信息{\"com\":\"shunfeng\",\"num\":\"123456\"}") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "发货省") |
| | | private String deliverProvince; |
| | | |
| | | @ApiModelProperty(value = "发货省编号") |
| | | private String deliverProvinceCode; |
| | | |
| | | @ApiModelProperty(value = "发货市") |
| | | private String deliverCity; |
| | | |
| | | @ApiModelProperty(value = "发货市编号") |
| | | private String deliverCityCode; |
| | | |
| | | @ApiModelProperty(value = "发货区") |
| | | private String deliverDistrict; |
| | | |
| | | @ApiModelProperty(value = "发货区编号") |
| | | private String deliverDistrictCode; |
| | | } |
| | |
| | | private Integer status; |
| | | @ApiModelProperty("配送方式(1=自提,2=快递)") |
| | | private Integer distributionMode; |
| | | @ApiModelProperty("获得分佣") |
| | | private BigDecimal getCommission; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long appUserId; |
| | | @ApiModelProperty("售后订单id") |
| | | private String refundPassId; |
| | | |
| | | private Integer shopId; |
| | | |
| | | public BigDecimal getGetPoint(){ |
| | | return point; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | @ApiModelProperty("联系电话") |
| | | private String phone; |
| | | @ApiModelProperty("申请时间") |
| | | private String createTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | @ApiModelProperty("售后类型(1退货退款2仅退款)") |
| | | private Integer refundMethod; |
| | | @ApiModelProperty("申请原因") |
| | |
| | | private Integer refundMethod; |
| | | @ApiModelProperty("售后状态(1待审核2已完成3已拒绝4待退货5待平台收货)") |
| | | private Integer status; |
| | | |
| | | |
| | | private String orderNumber; |
| | | private String userName; |
| | | private Integer passStatus; |
| | | |
| | | public void setOrderNumber(String orderNumber) { |
| | | this.orderNumber = orderNumber; |
| | | this.setCode(orderNumber); |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | this.setName(userName); |
| | | } |
| | | |
| | | public void setPassStatus(Integer passStatus) { |
| | | this.passStatus = passStatus; |
| | | this.setStatus(passStatus); |
| | | } |
| | | } |
| | |
| | | total_amount as orderMoney, |
| | | point, |
| | | order_status as status, |
| | | shop_id, |
| | | distribution_mode as distributionMode |
| | | from t_order where del_flag = 0 and pay_status = 2 |
| | | <if test="null != item.code and '' != item.code"> |
| | |
| | | and order_status in (4, 8) |
| | | </if> |
| | | <if test="null != item.shopId"> |
| | | and shop_id = #{item.shopId} and address_json is null |
| | | and shop_id = #{item.shopId} and distribution_mode != 2 |
| | | </if> |
| | | order by create_time desc |
| | | </select> |
| | | <select id="getOrderStatistics" resultType="com.ruoyi.order.vo.OrderStatistics"> |
| | | SELECT |
| | | count(*) as total, |
| | | SUM( CASE WHEN tor.order_type = 2 and distribution_mode = 2 THEN 0 ELSE 1 END ) as total, |
| | | SUM( CASE WHEN tor.order_type = 1 THEN 1 ELSE 0 END ) as serviceTotal, |
| | | SUM( CASE WHEN tor.order_type = 2 and distribution_mode = 1 THEN 1 ELSE 0 END ) as singleTotal, |
| | | SUM( tor.total_amount ) as totalMoney, |
| | |
| | | a.id, |
| | | b.order_number as orderNumber, |
| | | b.app_user_id as appUserId, |
| | | DATE_FORMAT(a.create_time, '%Y-%m-%d %H:%m:%s') as createTime, |
| | | a.create_time as createTime, |
| | | a.refund_method as refundMethod, |
| | | a.refund_reason as refundReason, |
| | | a.pass_status as passStatus, |
| | |
| | | */ |
| | | @GetMapping("/goodsDetail/{goodsId}") |
| | | @ApiOperation(value = "商品详情", tags = {"小程序-商城-首页"}) |
| | | public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId, String longitude, String latitude){ |
| | | return R.ok(goodsService.goodsDetail(goodsId, longitude, latitude)); |
| | | public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId, |
| | | Integer shopId, |
| | | String longitude, |
| | | String latitude) { |
| | | return R.ok(goodsService.goodsDetail(goodsId, shopId, longitude, latitude)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据类型(1=服务商品,2=单品商品)获取商品数据 |
| | | * @param type |
| | |
| | | List<Goods> list = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, type).eq(Goods::getDelFlag, 0).eq(Goods::getStatus, 2)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取商品信息 |
| | | * @param id |
| | |
| | | List<Region> list = regionService.list(); |
| | | List<Region> collect = list.stream().filter(s -> s.getParentId() == 0).collect(Collectors.toList()); |
| | | for (Region region : collect) { |
| | | List<Region> collect1 = list.stream().filter(s -> s.getParentId() == region.getId()).collect(Collectors.toList()); |
| | | List<Region> collect1 = list.stream().filter(s -> s.getParentId().equals(region.getId())).collect(Collectors.toList()); |
| | | for (Region region1 : collect1) { |
| | | List<Region> collect2 = list.stream().filter(s -> s.getParentId() == region1.getId()).collect(Collectors.toList()); |
| | | List<Region> collect2 = list.stream().filter(s -> s.getParentId().equals(region1.getId())).collect(Collectors.toList()); |
| | | region1.setChilds(collect2); |
| | | } |
| | | region.setChilds(collect1); |
| | |
| | | @GetMapping("/list") |
| | | public R<List<Share>> list(@RequestParam Integer objectId) { |
| | | List<Share> list = shareService.list(new LambdaQueryWrapper<Share>() |
| | | .eq(Share::getObjectId, objectId).eq(Share::getDelFlag, 0).or().eq(Share::getAddType, 1).eq(Share::getDelFlag, 0)); |
| | | .eq(Share::getObjectId, objectId) |
| | | .eq(Share::getDelFlag, 0).or() |
| | | .eq(Share::getAddType, 1) |
| | | .eq(Share::getDelFlag, 0)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | share.setAddType(sysUser.getRoleType() == 1 ? 1 : 3); |
| | | share.setAppletShare(0); |
| | | share.setAuditStatus(ShareAuditStatus.SUCCESS.getCode()); |
| | | if(sysUser.getRoleType() == 2){ |
| | | share.setObjectId(sysUser.getObjectId().longValue()); |
| | | } |
| | | share.setAuditStatus(0); |
| | | // if (sysUser.getRoleType() == 1){ |
| | | // share.setAuditStatus(ShareAuditStatus.SUCCESS.getCode()); |
| | | // }else{ |
| | | // share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); |
| | | // } |
| | | share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); |
| | | share.setDelFlag(0); |
| | | shareService.save(share); |
| | | return R.ok(); |
| | |
| | | @ApiOperation(value = "广告管理-分享管理-编辑", tags = {"管理后台"}) |
| | | @PostMapping("/manage/edit") |
| | | public R<Void> manageedit(@RequestBody Share share) { |
| | | if (share.getAuditStatus()==2){ |
| | | if (null == share.getAuditStatus() || share.getAuditStatus()==2){ |
| | | share.setAuditStatus(0); |
| | | } |
| | | shareService.updateById(share); |
| | |
| | | |
| | | @ApiOperation(value = "广告管理-分享管理-列表", tags = {"管理后台"}) |
| | | @GetMapping("/manage/list") |
| | | public R<Page<Share>> managelist(String name, Integer addType, @RequestParam Integer pageNum, Integer pageSize) { |
| | | public R<Page<Share>> managelist(String name, |
| | | Integer addType, |
| | | Integer auditStatus, |
| | | @RequestParam Integer pageNum, Integer pageSize) { |
| | | //判断当前登陆人是平台还是门店 |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | if (sysUser.getRoleType()==1) { |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAuditStatus, 1).eq(Share::getDelFlag, 0).like(name != null, Share::getName, name) |
| | | .eq(addType != null , Share::getAddType, addType).page(Page.of(pageNum, pageSize)); |
| | | Page<Share> page = shareService.lambdaQuery() |
| | | .eq(Share::getAuditStatus, 1) |
| | | .eq(Share::getDelFlag, 0) |
| | | .like(name != null, Share::getName, name) |
| | | .eq(addType != null , Share::getAddType, addType) |
| | | .page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | }else { |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAddType,3).eq(Share::getDelFlag, 0).eq(Share::getObjectId, sysUser.getObjectId()) |
| | | Page<Share> page = shareService.lambdaQuery() |
| | | .eq(auditStatus!= null, Share::getAuditStatus, auditStatus) |
| | | .eq(Share::getAddType,3) |
| | | .eq(Share::getDelFlag, 0) |
| | | .eq(Share::getObjectId, sysUser.getObjectId()) |
| | | .like(name != null, Share::getName, name).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static javax.swing.UIManager.get; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | |
| | | shop.setCustomOrderNumber(0); |
| | | shop.setAppUserId(appUser.getId()); |
| | | String city = TencentMapUtil.inverseGeographicalAnalysis(shop.getLongitude(), shop.getLatitude(), false); |
| | | if(!StringUtils.hasLength(city)){ |
| | | city = "510100"; |
| | | } |
| | | shop.setProvinceCode(city.substring(0, 2) + "0000"); |
| | | shop.setCityCode(city.substring(0, 4) + "00"); |
| | | shop.setDistrictCode(city); |
| | |
| | | userShop.setUserId(userId); |
| | | userShop.setShopId(shopId); |
| | | userShop.setRoleType(1); |
| | | userShop.setRoleId(2L); |
| | | userShop.setNickName(user.getNickName()); |
| | | userShop.setCreateTime(LocalDateTime.now()); |
| | | userShopClient.saveUserShop(userShop); |
| | | List<UserShop> data = userShopClient.getUserShop(userShop).getData(); |
| | | if(null == data || data.size() == 0){ |
| | | userShop = new UserShop(); |
| | | userShop.setUserId(userId); |
| | | userShop.setShopId(shopId); |
| | | userShop.setRoleType(1); |
| | | userShop.setRoleId(2L); |
| | | userShop.setNickName(user.getNickName()); |
| | | userShop.setCreateTime(LocalDateTime.now()); |
| | | userShopClient.saveUserShop(userShop); |
| | | } |
| | | } |
| | | |
| | | // 更换下级会员绑定门店 |
| | |
| | | } |
| | | Shop shop = shopService.getById(id); |
| | | shop.setDelFlag(1); |
| | | |
| | | shopService.updateById(shop); |
| | | // 查询有没有门店绑定这个被删除的门店 |
| | | List<Shop> shops = shopService.lambdaQuery().eq(Shop::getPid, shop.getId()).list(); |
| | | for (Shop shop1 : shops) { |
| | | shop1.setPid(0); |
| | | LambdaUpdateWrapper<Shop> set = new LambdaUpdateWrapper<Shop>().set(Shop::getPid, null) |
| | | .eq(Shop::getId,shop1.getId()); |
| | | shopService.update(set); |
| | | } |
| | | shopService.updateBatchById(shops); |
| | | //清除用户绑定当前门店 |
| | | appUserClient.clearBindShop(shop.getId()); |
| | | //查询门店绑定的平台账号 |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setShopId(shop.getId()); |
| | | List<UserShop> data = userShopClient.getUserShop(userShop).getData(); |
| | | if(data.size() > 0){ |
| | | //删除门店后台账号和关系数据 |
| | | sysUserClient.delShopUser(shop.getId(), 2); |
| | | |
| | | //修改小程序用户类型和门店数据 |
| | | List<Integer> collect = data.stream().map(UserShop::getUserId).collect(Collectors.toList()).stream().map(Long::intValue).collect(Collectors.toList()); |
| | | List<SysUser> sysUserList = sysUserClient.getUserList(collect).getData(); |
| | | //删除门店下的所有员工 |
| | | sysUserClient.delShopUser(shop.getId(), 2); |
| | | //修改小程序用户类型和门店数据 |
| | | for (SysUser sysUser : sysUserList) { |
| | | //通过电话号码查询小程序用户和门店关系数据 |
| | | AppUser appUser = appUserClient.getAppUserByPhone1(sysUser.getUserName()).getData(); |
| | |
| | | appUser.setUserType(1); |
| | | appUserClient.editAppUserById(appUser); |
| | | } |
| | | //删除用户门店关系表数据 |
| | | //删除用户门店关系数据 |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(shop.getId()); |
| | | appUserShop.setAppUserId(sysUser.getUserId()); |
| | | appUserShopClient.delAppUserShop(appUserShop); |
| | | } |
| | | } |
| | |
| | | technician.setDelFlag(1); |
| | | } |
| | | technicianService.updateBatchById(list); |
| | | //删除技师和门店关系数据 |
| | | //删除用户门店关系数据 |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setShopId(shop.getId()); |
| | | appUserShop.setRoleType(3); |
| | | appUserShopClient.delAppUserShop(appUserShop); |
| | | |
| | | //取消门店预约技师数据 |
| | | Set<Integer> collect = list.stream().map(Technician::getId).collect(Collectors.toSet()); |
| | | technicianSubscribeService.update(new LambdaUpdateWrapper<TechnicianSubscribe>().in(TechnicianSubscribe::getTechnicianId, collect).eq(TechnicianSubscribe::getDelFlag, 0) |
| | | .eq(TechnicianSubscribe::getStatus, 0).set(TechnicianSubscribe::getStatus, 2)); |
| | |
| | | if (!shopService.cheUserByPhone(phone)) { |
| | | return R.fail("该手机号未注册"); |
| | | } |
| | | if (shop.getPid()!=null){ |
| | | if (shop.getPid() != null && shop.getPid() != 0){ |
| | | Shop shopP = shopService.getById(shop.getPid()); |
| | | if (shopP.getPid()!=null&&shopP.getPid()!=0&& shopP.getPid().equals(shop.getId())){ |
| | | return R.fail("门店之间不能互相作为上级门店"); |
| | |
| | | AppUser appUser = appUserClient.getAppUserById(old_shop.getAppUserId()); |
| | | //需要先判断用户是否没有关联任何门店 |
| | | List<AppUserShop> userShops = appUserShopClient.getAppUserShop(appUser.getId()).getData(); |
| | | //当前小程序账号如果关联的店铺是最后一个,则将其修改为普通用户 |
| | | if(userShops.size() == 1 && userShops.get(0).getShopId().equals(shop.getId())){ |
| | | appUser.setUserType(1); |
| | | appUserClient.editAppUserById(appUser); |
| | | } |
| | | //删除原店长关系数据 |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(shop.getId()); |
| | | appUserShop.setRoleType(1); |
| | | appUserShopClient.delAppUserShop(appUserShop); |
| | | //删除后台用户和店铺关系数据 |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setShopId(shop.getId()); |
| | | userShop.setRoleType(1); |
| | | List<UserShop> data = userShopClient.getUserShop(userShop).getData(); |
| | | if(null != data && data.size() > 0){ |
| | | UserShop userShop1 = data.get(0); |
| | | userShopClient.delUserShop(userShop1); |
| | | //如果当前后台账户关联的店铺是最后一个,删除后台账户 |
| | | userShop = new UserShop(); |
| | | userShop.setUserId(userShop1.getUserId()); |
| | | data = userShopClient.getUserShop(userShop).getData(); |
| | | if(data.size() == 0){ |
| | | sysUserClient.delSysUserById(userShop1.getUserId()); |
| | | } |
| | | } |
| | | |
| | | //添加新管理员 |
| | | appUser = appUserClient.getAppUserByPhone1(phone).getData(); |
| | |
| | | appUser.setUserType(2); |
| | | appUserClient.editAppUserById(appUser); |
| | | |
| | | |
| | | //修改管理员 |
| | | shop.setAppUserId(appUser.getId()); |
| | | shopService.updateById(shop); |
| | | |
| | | |
| | | //添加门店后台账号和门店关系数据 |
| | | SysUser sysUser = sysUserClient.queryUserByUserName(phone).getData(); |
| | | if(null != sysUser){ |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setUserId(sysUser.getUserId()); |
| | | userShop = new UserShop(); |
| | | userShop.setShopId(shop.getId()); |
| | | userShop.setRoleType(1); |
| | | List<UserShop> data = userShopClient.getUserShop(userShop).getData(); |
| | | userShop.setUserId(sysUser.getUserId()); |
| | | data = userShopClient.getUserShop(userShop).getData(); |
| | | if(null == data || data.size() == 0){ |
| | | userShop = new UserShop(); |
| | | userShop.setUserId(sysUser.getUserId()); |
| | | userShop.setShopId(shop.getId()); |
| | | userShop.setRoleType(1); |
| | | userShop.setRoleId(2L); |
| | | userShop.setNickName(sysUser.getNickName()); |
| | | userShop.setCreateTime(LocalDateTime.now()); |
| | | userShopClient.saveUserShop(userShop); |
| | | } |
| | | }else{ |
| | |
| | | user.setPassword(phone.substring(5)); |
| | | user.setCreateTime(new Date()); |
| | | Long userId = sysUserClient.saveShopUser(user).getData(); |
| | | |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setUserId(userId); |
| | | |
| | | userShop = new UserShop(); |
| | | userShop.setShopId(shop.getId()); |
| | | userShop.setRoleType(1); |
| | | userShop.setRoleId(2L); |
| | | userShopClient.saveUserShop(userShop); |
| | | userShop.setUserId(userId); |
| | | data = userShopClient.getUserShop(userShop).getData(); |
| | | if(null == data || data.size() == 0){ |
| | | userShop = new UserShop(); |
| | | userShop.setUserId(userId); |
| | | userShop.setShopId(shop.getId()); |
| | | userShop.setRoleType(1); |
| | | userShop.setRoleId(2L); |
| | | userShop.setNickName(appUser.getName()); |
| | | userShop.setCreateTime(LocalDateTime.now()); |
| | | userShopClient.saveUserShop(userShop); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | } |
| | | shop.setStatus(status); |
| | | shopService.updateById(shop); |
| | | //处理员工等数据 |
| | | UserShop userSh = new UserShop(); |
| | | userSh.setShopId(id); |
| | | List<UserShop> data = userShopClient.getUserShop(userSh).getData(); |
| | | for (UserShop datum : data) { |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setUserId(datum.getUserId()); |
| | | List<UserShop> data1 = userShopClient.getUserShop(userShop).getData(); |
| | | long count = data1.stream().filter(s -> !s.getShopId().equals(id)).count(); |
| | | if(0 == count){ |
| | | SysUser sysUser = sysUserClient.getSysUser(datum.getUserId()).getData(); |
| | | sysUser.setStatus(status == 1 ? "0" : "1"); |
| | | sysUserClient.updateUser(sysUser); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | |
| | | @PostMapping("/saveWithdrawalAccount") |
| | | @ApiOperation(value = "保存提现账户", tags = {"门店后台-财务统计-提现明细"}) |
| | | public R saveWithdrawalAccount(SaveWithdrawalAccount saveWithdrawalAccount) { |
| | | public R saveWithdrawalAccount(@RequestBody SaveWithdrawalAccount saveWithdrawalAccount) { |
| | | shopService.saveWithdrawalAccount(saveWithdrawalAccount); |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/getShopById") |
| | | @ApiOperation("通过门店id获取账户信息回填") |
| | | public R<Shop> getShopById(Integer id) { |
| | | return R.ok(shopService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 提现申请列表 |
| | |
| | | return R.ok(Page.of(pageNum, pageSize)); |
| | | } |
| | | Page<ShopWithdraw> page = shopWithdrawService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<ShopWithdraw>() |
| | | .in(collect1.size() > 0, ShopWithdraw::getShopId, collect1)); |
| | | .in(collect1.size() > 0, ShopWithdraw::getShopId, collect1) |
| | | .orderByDesc(ShopWithdraw::getCreateTime)); |
| | | List<ShopWithdraw> records = page.getRecords(); |
| | | List<Integer> collect = records.stream().map(ShopWithdraw::getShopId).collect(Collectors.toList()); |
| | | List<Shop> shops = null; |
| | |
| | | public R<IPage<ShopWithdraw>> shoplist(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | ShopWithdraw shopWithdraw) { |
| | | Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId(); |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | SysUser sysUser = sysUserClient.getSysUser(loginUser.getUserid()).getData(); |
| | | Page<ShopWithdraw> page = shopWithdrawService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<ShopWithdraw>() |
| | | .eq(ShopWithdraw::getShopId,objectId) |
| | | .eq(sysUser!=null,ShopWithdraw::getShopId,sysUser.getObjectId()) |
| | | .eq(shopWithdraw.getAuditStatus()!=null,ShopWithdraw::getAuditStatus,shopWithdraw.getAuditStatus()) |
| | | .orderByDesc(ShopWithdraw::getCreateTime) |
| | | ); |
| | |
| | | @GetMapping("/shop/info") |
| | | @ApiOperation(value = "提现申请列表上方数据", notes = "提现申请列表", tags = {"门店后台"}) |
| | | public R<Shop> shopCommissionStatisticsinfo(){ |
| | | Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId(); |
| | | Shop byId = shopService.getById(objectId); |
| | | List<ShopWithdraw> list = shopWithdrawService.lambdaQuery().eq(ShopWithdraw::getShopId, objectId) |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | SysUser sysUser = sysUserClient.getSysUser(loginUser.getUserid()).getData(); |
| | | Shop byId = shopService.getById(sysUser.getObjectId()); |
| | | List<ShopWithdraw> list = shopWithdrawService.lambdaQuery().eq(ShopWithdraw::getShopId, sysUser.getObjectId()) |
| | | .eq(ShopWithdraw::getAuditStatus, 0).list(); |
| | | if (!list.isEmpty()){ |
| | | BigDecimal bigDecimal = list.stream().map(ShopWithdraw::getMoney).reduce(BigDecimal::add).orElse(BigDecimal.ZERO); |
| | |
| | | }else { |
| | | byId.setWithdrawAuditMoney(BigDecimal.ZERO); |
| | | } |
| | | byId.setWithdrawMoney(byId.getWithdrawMoney().subtract(byId.getWithdrawAuditMoney())); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | |
| | | @ApiOperation("审核") |
| | | public R<Void> audit(@RequestBody ShopWithdraw shopWithdraw) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | |
| | | ShopWithdraw shopWithdraw1 = shopWithdrawService.getById(shopWithdraw.getId()); |
| | | if(0 != shopWithdraw1.getAuditStatus()){ |
| | | return R.fail("不能重复审核"); |
| | |
| | | @PostMapping("/withdrawalCallback") |
| | | public Object withdrawalCallback(@RequestBody SinglePayCallbackResult singlePayCallbackResult){ |
| | | Integer status = singlePayCallbackResult.getStatus(); |
| | | String merchantOrderNo = singlePayCallbackResult.getMerchantOrderNo(); |
| | | ShopWithdraw shopWithdraw = shopWithdrawService.getById(merchantOrderNo); |
| | | if(203 == status || 205 == status){ |
| | | String merchantOrderNo = singlePayCallbackResult.getMerchantOrderNo(); |
| | | ShopWithdraw shopWithdraw = shopWithdrawService.getById(merchantOrderNo); |
| | | if(1 == shopWithdraw.getStatus()){ |
| | | shopWithdraw.setStatus(2); |
| | | shopWithdraw.setArrivalTime(LocalDateTime.now()); |
| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("statusCode", 2001); |
| | | return jsonObject; |
| | | }else{ |
| | | //回退金额和添加变动明细 |
| | | Shop shop = shopService.getById(shopWithdraw.getShopId()); |
| | | BigDecimal balance = shop.getBalance(); |
| | | BigDecimal canWithdrawMoney = shop.getCanWithdrawMoney(); |
| | | BigDecimal withdrawMoney = shop.getWithdrawMoney(); |
| | | shop.setBalance(balance.add(shopWithdraw.getMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | shop.setCanWithdrawMoney(canWithdrawMoney.add(shopWithdraw.getMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | shop.setWithdrawMoney(withdrawMoney.subtract(shopWithdraw.getMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | shopService.updateById(shop); |
| | | //添加门店变动明细 |
| | | ShopBalanceStatement shopBalanceStatement = new ShopBalanceStatement(); |
| | | shopBalanceStatement.setShopId(shop.getId()); |
| | | shopBalanceStatement.setType(4); |
| | | shopBalanceStatement.setHistoricalBalance(balance); |
| | | shopBalanceStatement.setVariableAmount(shopWithdraw.getMoney()); |
| | | shopBalanceStatement.setBalance(shop.getBalance()); |
| | | shopBalanceStatement.setCreateUserId(shopWithdraw.getAuditUserId()); |
| | | shopBalanceStatement.setCreateTime(LocalDateTime.now()); |
| | | shopBalanceStatement.setObjectId(shopWithdraw.getId()); |
| | | shopBalanceStatementService.save(shopBalanceStatement); |
| | | shopWithdraw.setStatus(3); |
| | | shopWithdraw.setRemark(singlePayCallbackResult.getErrorCodeDesc()); |
| | | shopWithdrawService.updateById(shopWithdraw); |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("statusCode", 2001); |
| | | return jsonObject; |
| | | } |
| | | return new JSONObject(); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | @GetMapping("/technicianListByShopId") |
| | | @ApiOperation(value = "技师列表", tags = {"技师列表-小程序"}) |
| | | public R<TableDataInfo<TechnicianVO>> technicianListByShopId(@ApiParam("门店id") @RequestParam Long shopId,@ApiParam("技师姓名") String name) { |
| | | public R<TableDataInfo<TechnicianVO>> technicianListByShopId(@ApiParam("门店id") @RequestParam Long shopId,@ApiParam("技师姓名") String name,@ApiParam("评分") Integer point) { |
| | | //@ApiParam("评分") Integer point 1倒序 2正序 |
| | | startPage(); |
| | | List<TechnicianVO> technicianListByShopId = technicianService.getTechnicianListByShopId(shopId, name); |
| | | List<TechnicianVO> technicianListByShopId = technicianService.getTechnicianListByShopId(shopId, name,point); |
| | | TableDataInfo<TechnicianVO> dataTable = getDataTable(technicianListByShopId); |
| | | return R.ok(dataTable); |
| | | } |
| | |
| | | @PostMapping("/manage/addorupdate") |
| | | @ApiOperation(value = "添加编辑", tags = {"门店-技师列表"}) |
| | | public R<Page<Technician>> add(@RequestBody Technician technician) { |
| | | |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | |
| | | |
| | | if (technician.getId()==null) { |
| | | technician.setSubscribeStatus(2); |
| | | List<Technician> list = technicianService.lambdaQuery() |
| | |
| | | @GetMapping("/manage/delete") |
| | | @ApiOperation(value = "删除", tags = {"门店-技师列表"}) |
| | | public R<Page<Technician>> delete(@RequestParam Integer id) { |
| | | technicianService.removeById(id); |
| | | Technician technician = technicianService.getById(id); |
| | | technician.setDelFlag(1); |
| | | technicianService.updateById(technician); |
| | | //检查删除app_user_shop数据 |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(technician.getAppUserId()); |
| | | appUserShop.setShopId(technician.getShopId()); |
| | | appUserShop.setRoleType(3); |
| | | appUserShopClient.delAppUserShop(appUserShop); |
| | | List<AppUserShop> userShopList = appUserShopClient.getAppUserShop(technician.getAppUserId()).getData(); |
| | | if(userShopList.size() == 0){ |
| | | AppUser appUser = appUserClient.getAppUserById(technician.getAppUserId()); |
| | | appUser.setUserType(1); |
| | | appUserClient.editAppUserById(appUser); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "预约列表", tags = {"门店-预约列表"}) |
| | | public R<PageInfo<TechnicianSubscribeVO>> shoplist(@ApiParam(value = "状态") Integer status, |
| | | @ApiParam("电话")String phone, |
| | | @ApiParam("姓名")String name, |
| | | @ApiParam("姓名")String userName, |
| | | @ApiParam("服务方式:1=上门服务,2=到店服务")Integer serviceMode, Integer pageCurr, Integer pageSize) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | PageInfo<TechnicianSubscribeVO> pageInfo = technicianSubscribeService.getTechnicianSubscribeByUserAndShop1(Long.valueOf(sysUser.getObjectId()), status, phone, name, serviceMode, pageCurr, pageSize); |
| | | PageInfo<TechnicianSubscribeVO> pageInfo = technicianSubscribeService.getTechnicianSubscribeByUserAndShop1(Long.valueOf(sysUser.getObjectId()), status, phone, userName, serviceMode, pageCurr, pageSize); |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 预约技师 |
| | | */ |
| | | @PostMapping("/switchingTechnician") |
| | | @ApiOperation(value = "切换技师", notes = "切换技师", tags = {"小程序-个人中心-门店管理-预约列表"}) |
| | | public R<Void> switchingTechnician(@RequestBody TechnicianSubscribe technicianSubscribe) { |
| | | technicianSubscribeService.switchingTechnician(technicianSubscribe); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @PostMapping("/getTechnicianSubscribeList") |
| | | public R<List<TechnicianSubscribe>> getTechnicianSubscribeList(@RequestParam("orderId") Long orderId){ |
| | | List<TechnicianSubscribe> list = technicianSubscribeService.list(new LambdaQueryWrapper<TechnicianSubscribe>().eq(TechnicianSubscribe::getOrderId, orderId) |
| | | .eq(TechnicianSubscribe::getDelFlag, 0).in(TechnicianSubscribe::getStatus, Arrays.asList(0, 1))); |
| | | .eq(TechnicianSubscribe::getDelFlag, 0).in(TechnicianSubscribe::getStatus, Arrays.asList(0, 1)).orderByDesc(TechnicianSubscribe::getCreateTime)); |
| | | return R.ok(list); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public interface TechnicianMapper extends BaseMapper<Technician> { |
| | | |
| | | List<TechnicianVO> selectTechnicianListByShopId(@Param("shopId") Long shopId,@Param("name") String name); |
| | | List<TechnicianVO> selectTechnicianListByShopId(@Param("shopId") Long shopId,@Param("name") String name,@Param("point")Integer point); |
| | | |
| | | TechnicianDetailVO selectTechnicianDetail(Long technicianId); |
| | | |
| | |
| | | |
| | | PageInfo<GoodsVO> goodsList(Goods goods); |
| | | |
| | | GoodsVO goodsDetail(Long goodsId, String longitude, String latitude); |
| | | GoodsVO goodsDetail(Long goodsId, Integer shopId, String longitude, String latitude); |
| | | |
| | | List<Goods> getGoodsListByShopId(PageInfo<Goods> pageInfo, Integer shopId); |
| | | |
| | |
| | | import com.ruoyi.other.api.domain.Technician; |
| | | import com.ruoyi.other.vo.TechnicianDetailVO; |
| | | import com.ruoyi.other.vo.TechnicianVO; |
| | | import io.swagger.models.auth.In; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @since 2024-11-20 |
| | | */ |
| | | public interface TechnicianService extends IService<Technician> { |
| | | List<TechnicianVO> getTechnicianListByShopId(Long shopId, String name); |
| | | List<TechnicianVO> getTechnicianListByShopId(Long shopId, String name, Integer point); |
| | | |
| | | TechnicianDetailVO technicianDetail(Long technicianId); |
| | | } |
| | |
| | | void subscribe(TechnicianSubscribe technicianSubscribe); |
| | | |
| | | |
| | | /** |
| | | * 切換技師 |
| | | * @param technicianSubscribe |
| | | */ |
| | | void switchingTechnician(TechnicianSubscribe technicianSubscribe); |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | }); |
| | | } |
| | | } |
| | | //手动处理分页 |
| | | // 手动处理分页 |
| | | PageInfo<GoodsVO> pageInfo = new PageInfo<>(); |
| | | pageInfo.setSize(search.getPageSize()); |
| | | pageInfo.setTotal(list.size()); |
| | | Integer pageSize = search.getPageSize(); |
| | | Integer pageNum = (search.getPageCurr() - 1) * pageSize; |
| | | |
| | | if(list.size() >= (pageNum + 1) * pageSize){ |
| | | list = list.subList(pageNum, pageNum + pageSize); |
| | | }else if(pageNum < list.size() && list.size() < (pageNum + 1) * pageSize){ |
| | | list = list.subList(pageNum, list.size()); |
| | | }else{ |
| | | list = new ArrayList<>(); |
| | | int pageSize = search.getPageSize(); |
| | | int pageCurr = search.getPageCurr(); |
| | | |
| | | // 计算起始索引 |
| | | int pageNum = (pageCurr - 1) * pageSize; |
| | | |
| | | // 检查 pageNum 是否合法 |
| | | if (pageNum < 0 || pageNum >= list.size()) { |
| | | // 如果 pageNum 不合法,返回空列表 |
| | | pageInfo.setRecords(new ArrayList<>()); |
| | | return pageInfo; |
| | | } |
| | | return pageInfo.setRecords(list); |
| | | |
| | | // 计算结束索引 |
| | | int endIndex = Math.min(pageNum + pageSize, list.size()); |
| | | |
| | | // 获取分页数据 |
| | | List<GoodsVO> pageList = list.subList(pageNum, endIndex); |
| | | |
| | | // 设置分页结果 |
| | | pageInfo.setRecords(pageList); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public GoodsVO goodsDetail(Long goodsId, String longitude, String latitude) { |
| | | public GoodsVO goodsDetail(Long goodsId, Integer shopId, String longitude, String latitude) { |
| | | if (goodsId == null || goodsId <= 0) { |
| | | throw new NullPointerException("商品ID不能为空"); |
| | | } |
| | |
| | | BeanUtils.copyBeanProp(goodsVO, goods); |
| | | goodsVO.setGoodsId(goods.getId()); |
| | | goodsVO.setGoodsName(goods.getName()); |
| | | Price price = getPrice(vipId, goods.getId(), null, 1, provinceCode, cityCode, districtCode); |
| | | Price price = getPrice(vipId, goods.getId(), shopId, 1, provinceCode, cityCode, districtCode); |
| | | if(null != price){ |
| | | goodsVO.setPointPayment(price.getPointPayment() ? 1 : 0); |
| | | goodsVO.setCashPayment(price.getCashPayment() ? 1 : 0); |
| | |
| | | area.setProvinceCode(goodsArea.getProvinceCode()); |
| | | area.setCityCode(goodsArea.getCityCode()); |
| | | area.setDistrictsCode(goodsArea.getDistrictsCode()); |
| | | if(null != area.getSellingPrice() || null != area.getIntegral()){ |
| | | goodsAreaList2.add(area); |
| | | } |
| | | // if(null != area.getSellingPrice() || null != area.getIntegral()){ |
| | | // goodsAreaList2.add(area); |
| | | // } |
| | | goodsAreaList2.add(area); |
| | | } |
| | | goodsAreaService.saveBatch(goodsAreaList2); |
| | | } |
| | |
| | | if(null == bargainPriceDetail){ |
| | | //没有门店特价,判断地区价格配置 |
| | | LambdaQueryWrapper<GoodsArea> queryWrapper = new LambdaQueryWrapper<GoodsArea>().eq(GoodsArea::getGoodsId, goodsId).eq(GoodsArea::getVip, vip); |
| | | if(StringUtils.isNotEmpty(districtCode)){ |
| | | queryWrapper.eq(GoodsArea::getDistrictsCode, districtCode); |
| | | } |
| | | if(StringUtils.isNotEmpty(cityCode)){ |
| | | queryWrapper.eq(GoodsArea::getCityCode, cityCode); |
| | | } |
| | | if(StringUtils.isNotEmpty(provinceCode)){ |
| | | queryWrapper.eq(GoodsArea::getProvinceCode, provinceCode); |
| | | } |
| | | if(StringUtils.isNotEmpty(cityCode)){ |
| | | queryWrapper.and(i -> i.eq(GoodsArea::getCityCode, cityCode).or().isNull(GoodsArea::getCityCode)); |
| | | } |
| | | if(StringUtils.isNotEmpty(districtCode)){ |
| | | queryWrapper.and(i -> i.eq(GoodsArea::getDistrictsCode, districtCode).or().isNull(GoodsArea::getDistrictsCode)); |
| | | } |
| | | GoodsArea goodsArea = goodsAreaService.getOne(queryWrapper); |
| | | if(null == goodsArea){ |
| | | //没有地区价格,则使用会员价格 |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.domain.ShopPoint; |
| | | import com.ruoyi.other.api.enums.PointChangeType; |
| | | import com.ruoyi.other.mapper.ShopPointMapper; |
| | | import com.ruoyi.other.service.ShopPointService; |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.vo.ShopPointStatistics; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | @Resource |
| | | private ShopService shopService; |
| | | |
| | | |
| | | |
| | |
| | | public ShopPointStatistics statistics(IPage<ShopPoint> page, ShopPoint shopPoint) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | List<ShopPoint> shopPoints = this.baseMapper.selectShopPointList(shopPoint); |
| | | Map<Integer, Integer> shopPointMap = shopPoints.stream() |
| | | .collect(Collectors.groupingBy( |
| | | ShopPoint::getType, |
| | | Collectors.summingInt(ShopPoint::getVariablePoint) |
| | | )); |
| | | |
| | | Integer sPoint = 0; |
| | | Integer shopCommissionPoint = 0; |
| | | Integer subShopCommissionPoint = 0; |
| | | Shop shop = shopService.getById(sysUser.getObjectId()); |
| | | sPoint += shop.getServerPoint(); |
| | | shopCommissionPoint += shop.getSharePoint(); |
| | | subShopCommissionPoint += shop.getLowerLevelSharePoint(); |
| | | ShopPointStatistics shopPointStatistics = new ShopPointStatistics(); |
| | | int sPoint = shopPointMap.getOrDefault(PointChangeType.SHOP_ACHIEVEMENT.getCode(), 0); |
| | | int shopCommissionPoint = shopPointMap.getOrDefault(PointChangeType.SHOP_REBATE.getCode(), 0); |
| | | int subShopCommissionPoint = shopPointMap.getOrDefault(PointChangeType.JUNIOR_SHOP_REBATE.getCode(), 0); |
| | | shopPointStatistics.setTotalPoint(sPoint + shopCommissionPoint + subShopCommissionPoint); |
| | | shopPointStatistics.setShopPoint(sPoint); |
| | | shopPointStatistics.setShopCommissionPoint(shopCommissionPoint); |
| | |
| | | private TechnicianScoreService technicianScoreService; |
| | | |
| | | @Override |
| | | public List<TechnicianVO> getTechnicianListByShopId(Long shopId, String name) { |
| | | return technicianMapper.selectTechnicianListByShopId(shopId,name); |
| | | public List<TechnicianVO> getTechnicianListByShopId(Long shopId, String name,Integer point) { |
| | | return technicianMapper.selectTechnicianListByShopId(shopId,name,point); |
| | | } |
| | | |
| | | @Override |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.ruoyi.account.api.feignClient.AppUserShopClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.AppUserShop; |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | |
| | | Optional<AppUserShop> first = data.stream().filter(s -> s.getShopId() == shopId.intValue() && s.getRoleType() == 3).findFirst(); |
| | | Integer technicianId = null; |
| | | if(first.isPresent()){ |
| | | AppUserShop appUserShop = first.get(); |
| | | Technician technician = technicianService.getOne(new LambdaQueryWrapper<Technician>().eq(Technician::getAppUserId, appUserShop.getAppUserId()) |
| | | .eq(Technician::getShopId, appUserShop.getShopId()).eq(Technician::getDelFlag, 0).eq(Technician::getStatus, 1)); |
| | | technicianId = technician.getId(); |
| | | //既是店员又是技师,需要取员工身份获取列表数据 |
| | | Optional<AppUserShop> first1 = data.stream().filter(s -> s.getShopId() == shopId.intValue() && s.getRoleType() != 3).findFirst(); |
| | | if(!first1.isPresent()){ |
| | | AppUserShop appUserShop = first.get(); |
| | | Technician technician = technicianService.getOne(new LambdaQueryWrapper<Technician>().eq(Technician::getAppUserId, appUserShop.getAppUserId()) |
| | | .eq(Technician::getShopId, appUserShop.getShopId()).eq(Technician::getDelFlag, 0).eq(Technician::getStatus, 2)); |
| | | if(null != technician){ |
| | | technicianId = technician.getId(); |
| | | } |
| | | } |
| | | } |
| | | List<TechnicianSubscribeVO> list = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(pageInfo, shopId, status, technicianId); |
| | | for (TechnicianSubscribeVO technicianSubscribeVO : list) { |
| | |
| | | AppUser appUser = appUserClient.getAppUserById(technicianSubscribe.getAppUserId()); |
| | | technicianSubscribeVO.setUserName(appUser.getName()); |
| | | technicianSubscribeVO.setPhone(appUser.getPhone()); |
| | | Integer serviceMode = technicianSubscribeVO.getServiceMode(); |
| | | if(1 == serviceMode){ |
| | | UserAddress userAddress = JSON.parseObject(technicianSubscribeVO.getUserAddress(), UserAddress.class); |
| | | technicianSubscribeVO.setUserAddress(userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getRecieveAddress()); |
| | | } |
| | | } |
| | | return pageInfo.setRecords(list); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void switchingTechnician(TechnicianSubscribe technicianSubscribe) { |
| | | List<TechnicianSubscribe> list = this.list(new LambdaQueryWrapper<TechnicianSubscribe>().eq(TechnicianSubscribe::getOrderId, technicianSubscribe.getOrderId()) |
| | | .eq(TechnicianSubscribe::getDelFlag, 0).eq(TechnicianSubscribe::getStatus, 0)); |
| | | for (TechnicianSubscribe subscribe : list) { |
| | | if(subscribe.getTechnicianId().equals(technicianSubscribe.getTechnicianId())){ |
| | | throw new RuntimeException("不能切换相同的技师"); |
| | | } |
| | | subscribe.setTechnicianId(technicianSubscribe.getTechnicianId()); |
| | | this.updateById(subscribe); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 定时修改到期状态 |
| | |
| | | @ApiModelProperty(value = "展示状态:0下架中 1上架中") |
| | | private Integer showStatus; |
| | | |
| | | |
| | | public Integer getType(){ |
| | | return goodsType; |
| | | } |
| | | |
| | | } |
| | |
| | | <if test="gp.auditStatus != null"> |
| | | and tgbp.audit_status = #{gp.auditStatus} |
| | | </if> |
| | | order by tgbp.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | tgs.selling_price as sellingPrice, |
| | | tgs.integral as integral, |
| | | tg.sale_num as saleNum, |
| | | tg.type goodsType, |
| | | tsai.start_time as startTime, |
| | | tsai.end_time as endTime |
| | | FROM |
| | |
| | | tsp.type, |
| | | tsp.create_time, |
| | | tsp.variable_point, |
| | | tsp.order_num |
| | | tsp.order_num as orderNum |
| | | FROM |
| | | t_shop_point tsp |
| | | LEFT JOIN t_shop ts ON tsp.shop_id = ts.id |
| | |
| | | AND tt.del_flag = 0 |
| | | AND tt.shop_id = #{shopId} |
| | | <if test="name != null and name != ''"> |
| | | AND tt.`name` LIKE concat('%', #{name}, '%') |
| | | AND tt.name LIKE concat('%', #{name}, '%') |
| | | </if> |
| | | GROUP BY |
| | | tt.id, |
| | | tt.`name`, |
| | | tt.introduction, |
| | | tt.home_picture |
| | | <if test="point != null and point == 1"> |
| | | order by score DESC |
| | | </if> |
| | | <if test="point != null and point == 2"> |
| | | order by score |
| | | </if> |
| | | </select> |
| | | <select id="selectTechnicianDetail" resultType="com.ruoyi.other.vo.TechnicianDetailVO"> |
| | | SELECT |
| | |
| | | ts.latitude, |
| | | tts.subscribe_time, |
| | | tts.service_mode, |
| | | tts.user_address, |
| | | tts.status |
| | | FROM |
| | | t_technician_subscribe tts |