| | |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> getWorkPic(Integer id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | }; |
| | | } |
| | | } |
| | |
| | | @GetMapping(value = "/franchisee/cityDetail") |
| | | R<List<String>> cityDetail(@RequestParam("id") Integer id); |
| | | |
| | | @GetMapping(value = "/franchisee/getWorkPic") |
| | | R<String> getWorkPic(@RequestParam("id") Integer id); |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | @ApiModelProperty("预约地址") |
| | | private String reservationAddress; |
| | | @ApiModelProperty("详细地址") |
| | | private String address; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("回收服务封面图") |
| | | @TableField(exist = false) |
| | | private String cover; |
| | | @ApiModelProperty("师傅头像") |
| | | @TableField(exist = false) |
| | | private String WorkPic; |
| | | |
| | | @ApiModelProperty("再投原因") |
| | | @TableField(exist = false) |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | public class UserWithdrawRecordVO { |
| | | |
| | | @TableId("id") |
| | | private Integer id; |
| | | private String id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Integer userId; |
| | |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("申请时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date applyForTime; |
| | | |
| | | @ApiModelProperty("申请金额") |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<IPage<Order>> orderList(Integer userId, Integer pageNum, Integer pageSize) { |
| | | public R<Page<Order>> orderList(Integer userId, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Withdraw> withdrawRecordDetail(Integer id) { |
| | | public R<Withdraw> withdrawRecordDetail(Long id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> withdrawExamine(Integer id, Integer state, String opinion, String openId, Integer userId) { |
| | | public R<Boolean> withdrawExamine(Long id, Integer state, String opinion, String openId, Integer userId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | * @return 分页列表 |
| | | */ |
| | | @GetMapping(value = "/order/orderList") |
| | | R<IPage<Order>> orderList(@RequestParam("userId") Integer userId, |
| | | R<Page<Order>> orderList(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | |
| | | * @return 提现详情 |
| | | */ |
| | | @GetMapping(value = "/withdraw/withdrawRecordDetail") |
| | | R<Withdraw> withdrawRecordDetail(@RequestParam("id") Integer id); |
| | | R<Withdraw> withdrawRecordDetail(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 用户提现记录导出 |
| | |
| | | * @return 提现结果 |
| | | */ |
| | | @GetMapping(value = "/withdraw/withdrawExamine") |
| | | R<Boolean> withdrawExamine(@RequestParam("id") Integer id, @RequestParam("state") Integer state, |
| | | R<Boolean> withdrawExamine(@RequestParam("id") Long id, @RequestParam("state") Integer state, |
| | | @RequestParam(value = "opinion", required = false) String opinion, |
| | | @RequestParam(value = "openId") String openId, |
| | | @RequestParam(value = "userId") Integer userId); |
| | |
| | | package com.ruoyi.user.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.vo.AddressDto; |
| | | import com.ruoyi.common.core.vo.UserDto; |
| | | import com.ruoyi.user.api.feignClient.UserClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | @Override |
| | | public UserClient create(Throwable cause) { |
| | | return null; |
| | | return new UserClient() { |
| | | |
| | | @Override |
| | | public R<UserDto> getUser(Integer userId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<AddressDto> getCityCode(Integer addressId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.user.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | |
| | | import com.ruoyi.common.core.vo.AddressDto; |
| | | import com.ruoyi.common.core.vo.UserDto; |
| | | import com.ruoyi.user.api.factory.UserFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @author HJL |
| | |
| | | */ |
| | | @FeignClient(contextId = "UserClient", value = ServiceNameConstants.USER_SERVICE, fallbackFactory = UserFallbackFactory.class) |
| | | public interface UserClient { |
| | | @PostMapping(value = "/user/getUser") |
| | | R<UserDto> getUser(@RequestParam("userId") Integer userId); |
| | | @PostMapping(value = "/user/getCityCode") |
| | | R<AddressDto> getCityCode(@RequestParam("addressId") Integer addressId); |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 缓存有效期,默认720(分钟) |
| | | */ |
| | | public final static long EXPIRATION = 720; |
| | | public final static long EXPIRATION = 43200; |
| | | |
| | | /** |
| | | * 师傅端登录缓存 一个月 |
New file |
| | |
| | | package com.ruoyi.common.core.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AddressDto { |
| | | private String city; |
| | | private String cityCode; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UserDto { |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String profilePicture; |
| | | private String phone; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Franchisee; |
| | | import com.ruoyi.admin.entity.Region; |
| | | import com.ruoyi.admin.entity.SysUser; |
| | | import com.ruoyi.admin.entity.UserRole; |
| | | import com.ruoyi.admin.service.FranchiseeService; |
| | | import com.ruoyi.admin.service.RegionService; |
| | | import com.ruoyi.admin.service.SysUserService; |
| | | import com.ruoyi.admin.service.UserRoleService; |
| | | import com.ruoyi.admin.entity.*; |
| | | import com.ruoyi.admin.service.*; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | |
| | | private UserRoleService userRoleService; |
| | | @Resource |
| | | private RegionService regionService; |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | |
| | | /** |
| | | * 加盟商信息分页列表 |
| | |
| | | return R.ok(Arrays.stream(franchisee.getCityCode().split(",")).collect(Collectors.toList())); |
| | | } |
| | | |
| | | @GetMapping(value = "/getWorkPic") |
| | | public R<String> getWorkPic(@RequestParam("id") Integer id) { |
| | | MasterWorker byId = masterWorkerService.getById(id); |
| | | return R.ok(byId.getProfilePicture()); |
| | | } |
| | | |
| | | /** |
| | | * 新增加盟商信息 |
| | | * |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.entity.Prize; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.PrizeService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | |
| | | |
| | | @Resource |
| | | private PrizeService prizeService; |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | |
| | | /** |
| | | * 奖品分页列表 |
| | |
| | | @GetMapping("/addressTree") |
| | | @ApiOperation(value = "选择城市:省市二级联动", tags = {"后台-首页"}) |
| | | public R<List<Region>> addressTree() { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | List<String> cityCodeList; |
| | | if (loginUser.getIsFranchisee()) { |
| | | cityCodeList = loginUser.getCityList(); |
| | | } else { |
| | | cityCodeList = new ArrayList<>(); |
| | | } |
| | | return R.ok(regionService.addressTree(cityCodeList)); |
| | | // LoginUser loginUser = tokenService.getLoginUser(); |
| | | // if (null == loginUser) { |
| | | // return R.loginExpire("登录失效!"); |
| | | // } |
| | | // List<String> cityCodeList; |
| | | // if (loginUser.getIsFranchisee()) { |
| | | // cityCodeList = loginUser.getCityList(); |
| | | // } else { |
| | | // cityCodeList = new ArrayList<>(); |
| | | // } |
| | | return R.ok(regionService.addressTree(null)); |
| | | } |
| | | |
| | | } |
| | |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | return R.ok(orderClient.orderList(userId, pageNum, pageSize).getData()); |
| | | R<Page<Order>> iPageR = orderClient.orderList(userId, pageNum, pageSize); |
| | | return R.ok(iPageR.getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "审批意见", name = "opinion", dataType = "String"), |
| | | @ApiImplicitParam(value = "审批同意/不同意(1同意;2驳回)", name = "state", dataType = "Integer", required = true) |
| | | }) |
| | | public R<String> withdrawExamine(@RequestParam Integer id, @RequestParam Integer state, String opinion) { |
| | | public R<String> withdrawExamine(@RequestParam Long id, @RequestParam Integer state, String opinion) { |
| | | com.ruoyi.order.api.entity.Withdraw withdraw = withdrawClient.withdrawRecordDetail(id).getData(); |
| | | if (null == withdraw) { |
| | | throw new GlobalException("提现记录不存在或已删除!"); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "提现记录id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Withdraw> withdrawRecordDetail(@RequestParam Integer id) { |
| | | public R<Withdraw> withdrawRecordDetail(@RequestParam Long id) { |
| | | return withdrawClient.withdrawRecordDetail(id); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(value = "审批意见", name = "opinion", dataType = "String"), |
| | | @ApiImplicitParam(value = "审批同意/不同意(1同意;2驳回)", name = "state", dataType = "Integer", required = true) |
| | | }) |
| | | public R<String> withdrawExamine(@RequestParam Integer id, @RequestParam Integer state, String opinion) { |
| | | public R<String> withdrawExamine(@RequestParam Long id, @RequestParam Integer state, String opinion) { |
| | | Withdraw withdraw = withdrawClient.withdrawRecordDetail(id).getData(); |
| | | if (null == withdraw) { |
| | | throw new GlobalException("提现记录不存在或已删除!"); |
| | |
| | | */ |
| | | private List<Region> getReginList(List<String> cityCodeList) { |
| | | List<Region> regions; |
| | | if (cityCodeList.isEmpty()) { |
| | | if (cityCodeList==null) { |
| | | regions = this.list(); |
| | | } else { |
| | | regions = this.lambdaQuery() |
| | |
| | | import java.time.Year; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | userWrapper.in(User::getCityCode, cityList); |
| | | } |
| | | List<User> userList = userWrapper.list(); |
| | | |
| | | // 判断用户是否在管辖城市内下过订单 |
| | | for (User user : userList) { |
| | | Iterator<User> iterator = userList.iterator(); |
| | | while (iterator.hasNext()) { |
| | | User user = iterator.next(); |
| | | Integer userId = user.getId(); |
| | | R<Boolean> r = orderClient.orderByUserId(userId); |
| | | if (!r.getData()) { |
| | | userList.remove(user); |
| | | iterator.remove(); // 安全地移除元素 |
| | | } |
| | | } |
| | | |
| | | Integer userNumber = userList.size(); |
| | | // 用户总量 |
| | | // 计算当前季度时间所包含时间 |
| | |
| | | public R<Page<EvaluatePageVO>> evaluateList(@RequestParam(value = "userId", required = false) Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(evaluateService.evaluateList(userId, Page.of(pageNum, pageSize))); |
| | | Page<EvaluatePageVO> evaluatePageVOPage = evaluateService.evaluateList(userId, Page.of(pageNum, pageSize)); |
| | | return R.ok(evaluatePageVOPage); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<Order>> orderList(@RequestParam("userId") Integer userId, |
| | | public R<Page<Order>> orderList(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getUserId, userId) |
| | | .eq(Order::getIsDelete, 0).page(Page.of(pageNum, pageSize))); |
| | | Page<Order> page = orderService.lambdaQuery().eq(Order::getUserId, userId) |
| | | .eq(Order::getIsDelete, 0).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "提现记录id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Withdraw> withdrawRecordDetail(@RequestParam("id") Integer id) { |
| | | public R<Withdraw> withdrawRecordDetail(@RequestParam("id") Long id) { |
| | | Withdraw withdraw = withdrawService.lambdaQuery().eq(Withdraw::getId, id) |
| | | .eq(Withdraw::getIsDelete, 0).one(); |
| | | return R.ok(withdraw); |
| | |
| | | @ApiImplicitParam(value = "审批意见", name = "opinion", dataType = "String"), |
| | | @ApiImplicitParam(value = "审批同意/不同意(1同意;2驳回)", name = "state", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Boolean> withdrawExamine(@RequestParam("id") Integer id, @RequestParam("state") Integer state, |
| | | public R<Boolean> withdrawExamine(@RequestParam("id") Long id, @RequestParam("state") Integer state, |
| | | @RequestParam(value = "opinion", required = false) String opinion, |
| | | @RequestParam(value = "openId") String openId, |
| | | @RequestParam(value = "userId") Integer userId) { |
| | |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getUserId, userId) |
| | | .eq(Order::getState, 3).eq(Order::getIsDelete, 0).page(Page.of(pageNum, pageSize))); |
| | | .eq(Order::getState, 3).page(Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | @GetMapping("/withdrawRecordList") |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.OrderConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.GaoDeMapUtil; |
| | | import com.ruoyi.common.core.vo.AddressDto; |
| | | import com.ruoyi.common.core.vo.Path; |
| | | import com.ruoyi.order.entity.ChangeDispatch; |
| | | import com.ruoyi.order.entity.Order; |
| | |
| | | import com.ruoyi.order.service.ChangeDispatchService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.vo.*; |
| | | import com.ruoyi.user.api.feignClient.UserClient; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private ChangeDispatchService changeDispatchService; |
| | | @Resource |
| | | private UserClient userClient; |
| | | |
| | | @Override |
| | | public OrderResultVO orderCountHome(OrderCountRequest orderCount) { |
| | |
| | | |
| | | @Override |
| | | public Boolean placeOrder(UserOrderRequest userOrderRequest) { |
| | | |
| | | R<AddressDto> cityCode = userClient.getCityCode(userOrderRequest.getAddressId()); |
| | | |
| | | // 下单参数 |
| | | String orderNumber = userOrderRequest.getOrderNumber(); |
| | | Integer serveId = userOrderRequest.getServeId(); |
| | |
| | | order.setIsWithdrawal(Constants.ZERO); |
| | | order.setSubsidy(subsidy); |
| | | order.setAddress(addressDetail); |
| | | order.setIsEvaluate(Constants.ZERO); |
| | | |
| | | order.setCity(cityCode.getData().getCity()); |
| | | order.setCityCode(cityCode.getData().getCityCode()); |
| | | return this.save(order); |
| | | } |
| | | |
| | | @Override |
| | | public String orderEstimate(UserOrderRequest userOrderRequest) { |
| | | R<AddressDto> cityCode = userClient.getCityCode(userOrderRequest.getAddressId()); |
| | | |
| | | // 下单参数 |
| | | String orderNumber = userOrderRequest.getOrderNumber(); |
| | | Integer serveId = userOrderRequest.getServeId(); |
| | |
| | | order.setIsWithdrawal(Constants.ZERO); |
| | | order.setSubsidy(subsidy); |
| | | order.setAddress(addressDetail); |
| | | order.setCity(cityCode.getData().getCity()); |
| | | order.setCityCode(cityCode.getData().getCityCode()); |
| | | this.save(order); |
| | | return String.valueOf(order.getId()); |
| | | } |
| | |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.OrderConstants; |
| | | import com.ruoyi.common.core.constant.WechatConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.SnowflakeIdWorker; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.vo.UserDto; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.entity.Withdraw; |
| | | import com.ruoyi.order.entity.WithdrawalSetting; |
| | |
| | | import com.ruoyi.order.vo.MoneyQueryRequest; |
| | | import com.ruoyi.order.vo.UserWithdrawRecordVO; |
| | | import com.ruoyi.order.vx.HttpUtil; |
| | | import com.ruoyi.user.api.feignClient.UserClient; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | */ |
| | | @Value("wx.transferRemark") |
| | | private String transferRemark; |
| | | @Resource |
| | | private UserClient userClient; |
| | | |
| | | @Override |
| | | public Page<UserWithdrawRecordVO> withdrawPage(String nickname, String userPhone, String applyForTime, Integer state, Page<UserWithdrawRecordVO> page) { |
| | | return baseMapper.withdrawPage(nickname, userPhone, applyForTime, state, page); |
| | | Page<UserWithdrawRecordVO> userWithdrawRecordVOPage = baseMapper.withdrawPage(nickname, userPhone, applyForTime, state, page); |
| | | |
| | | return userWithdrawRecordVOPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public Page<UserWithdrawRecordVO> withdrawList(Integer userId, Page<UserWithdrawRecordVO> page) { |
| | | return baseMapper.withdrawList(userId, page); |
| | | Page<UserWithdrawRecordVO> userWithdrawRecordVOPage = baseMapper.withdrawList(userId, page); |
| | | for (UserWithdrawRecordVO record : userWithdrawRecordVOPage.getRecords()) { |
| | | R<UserDto> user = userClient.getUser(record.getUserId()); |
| | | System.err.println("==="+user.getData()); |
| | | record.setNickname(user.getData().getNickname()); |
| | | record.setProfilePicture(user.getData().getProfilePicture()); |
| | | record.setUserPhone(user.getData().getPhone()); |
| | | } |
| | | return userWithdrawRecordVOPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @ApiModelProperty("是否评价(0:未评价;1:已评价)") |
| | | private Integer isEvaluate; |
| | | @ApiModelProperty("预约地址") |
| | | private String reservationAddress; |
| | | @ApiModelProperty("详细地址") |
| | | private String address; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("服务单号") |
| | | @TableField("serve_no") |
| | | private String serveNo; |
| | | // @TableField("createBy") |
| | | // private String createBy; |
| | | // @TableField("updateBy") |
| | | // private String updateBy; |
| | | |
| | | @TableField("createTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | |
| | | @ApiModelProperty("是否还未评价") |
| | | private Boolean evaluate; |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | public Boolean getEvaluate() { |
| | | return null != evaluateInfo; |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | public class UserWithdrawRecordVO { |
| | | |
| | | @TableId("id") |
| | | private Integer id; |
| | | private String id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Integer userId; |
| | |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("申请时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date applyForTime; |
| | | |
| | | @ApiModelProperty("申请金额") |
| | |
| | | #{city} |
| | | </foreach> |
| | | </if> |
| | | <if test="data.userIdList != null and data.userIdList.size() != 0"> |
| | | and e.user_id in |
| | | <foreach collection="data.userIdList" item="userId" open="(" separator="," close=")"> |
| | | #{userId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by e.createTime desc |
| | | </select> |
| | |
| | | <result column="content" property="content"/> |
| | | <result column="worker_id" property="workerId"/> |
| | | <result column="star_rating" property="starRating"/> |
| | | <result column="createBy" property="createBy"/> |
| | | <result column="updateBy" property="updateBy"/> |
| | | <!-- <result column="createBy" property="createBy"/>--> |
| | | <!-- <result column="updateBy" property="updateBy"/>--> |
| | | <result column="createTime" property="createTime"/> |
| | | <result column="updateTime" property="updateTime"/> |
| | | <!-- <result column="updateTime" property="updateTime"/>--> |
| | | <result column="is_delete" property="isDelete"/> |
| | | <result column="reservation_name" property="userNo"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | |
| | | <association property="orderInfo" javaType="com.ruoyi.order.vo.EvaluateOrderInfoVO"> |
| | | <result column="id" property="orderId"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="complete_time" property="completeTime"/> |
| | | <result column="createTime" property="completeTime"/> |
| | | <result column="serve_name" property="serveName"/> |
| | | <result column="serve_describe" property="serveDescribe"/> |
| | | <result column="cover" property="cover"/> |
| | |
| | | <result column="server_phone" property="serverPhone"/> |
| | | <result column="serve_id" property="serveId"/> |
| | | <result column="is_evaluate" property="isEvaluate"/> |
| | | <result column="reservation_address" property="reservationAddress"/> |
| | | <result column="address" property="address"/> |
| | | </association> |
| | | <association property="evaluateInfo" javaType="com.ruoyi.order.vo.EvaluateInfoVO"> |
| | | <result column="content" property="content"/> |
| | |
| | | o.is_evaluate, |
| | | e.content, |
| | | e.star_rating, |
| | | e.createTime, |
| | | o.serve_id |
| | | e.createTime as createTime, |
| | | o.serve_id, |
| | | o.reservation_address, |
| | | o.address |
| | | FROM t_order o |
| | | LEFT JOIN t_evaluate e on o.id = e.order_id |
| | | <where> |
| | |
| | | Map<Integer, RecoveryServe> map = serveList.stream().collect(Collectors. |
| | | toMap(RecoveryServe::getId, data -> data)); |
| | | for (OrderEvaluateVO data : list.getRecords()) { |
| | | Integer serveId = data.getServeId(); |
| | | Integer serveId = data.getOrderInfo().getServeId(); |
| | | RecoveryServe recoveryServe = map.get(serveId); |
| | | if (null != recoveryServe) { |
| | | EvaluateOrderInfoVO orderInfo = data.getOrderInfo(); |
| | |
| | | import com.ruoyi.user.service.OrderService; |
| | | import com.ruoyi.user.service.RecoveryServePriceService; |
| | | import com.ruoyi.user.service.RecoveryServeService; |
| | | import com.ruoyi.user.service.UserService; |
| | | import com.ruoyi.user.vo.OrderDetailVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.boot.autoconfigure.kafka.KafkaProperties; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | Map<Integer, String> map = serveList.stream().collect(Collectors.toMap(RecoveryServe::getId, |
| | | mw -> Optional.ofNullable(mw.getCover()).orElse(""))); |
| | | for (Order order : data.getRecords()) { |
| | | |
| | | Integer serveId = order.getServeId(); |
| | | order.setCover(map.get(serveId)); |
| | | } |
| | |
| | | orderDetail.setPhoto(serveRecord.getPhoto()); |
| | | } |
| | | } |
| | | R<String> workPic = adminClient.getWorkPic(order.getServerId()); |
| | | orderDetail.setWorkPic(workPic.getMsg()); |
| | | return R.ok(orderDetail); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.vo.AddressDto; |
| | | import com.ruoyi.common.core.vo.UserDto; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.user.entity.RecoveryClassify; |
| | | import com.ruoyi.user.entity.RecoveryServe; |
| | | import com.ruoyi.user.entity.User; |
| | | import com.ruoyi.user.entity.UserRecipient; |
| | | import com.ruoyi.user.request.LoginPhoneRequest; |
| | | import com.ruoyi.user.service.RecoveryClassifyService; |
| | | import com.ruoyi.user.service.RecoveryServeService; |
| | | import com.ruoyi.user.service.UserRecipientService; |
| | | import com.ruoyi.user.service.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private RecoveryClassifyService recoveryClassifyService; |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | @Resource |
| | | private UserRecipientService userRecipientService; |
| | | |
| | | /** |
| | | * 用户端默认头像 |
| | |
| | | .eq(User::getIsDelete, 0).one(); |
| | | if (null != user) { |
| | | if (!Constants.ONE.equals(user.getState())) { |
| | | return R.notEnabled("登录失败,当前账号未启用!"); |
| | | return R.notEnabled("账号已被禁用,请联系平台管理员。"); |
| | | } |
| | | } else { |
| | | user = new User(); |
| | |
| | | return R.ok(serveList); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "订单列表-更改订单提现状态", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/getUser") |
| | | public R<UserDto> updateWithdrawalState(@RequestParam("userId") Integer userId) { |
| | | |
| | | User byId = userService.getById(userId); |
| | | UserDto userDto = new UserDto(); |
| | | BeanUtils.copyProperties(byId,userDto); |
| | | return R.ok(userDto); |
| | | |
| | | } |
| | | |
| | | // @ApiOperation(value = "订单列表-更改订单提现状态", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/getCityCode") |
| | | public R<AddressDto> getCityCode(@RequestParam("addressId") Integer addressId) { |
| | | UserRecipient byId = userRecipientService.getById(addressId); |
| | | AddressDto userDto = new AddressDto(); |
| | | userDto.setCityCode(byId.getCityCode()); |
| | | userDto.setCity(byId.getCity()); |
| | | return R.ok(userDto); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用户端-个人中心用户信息 |
| | | */ |
| | |
| | | user = new User(); |
| | | user.setUserNo(String.format(Constants.USER_NO_PRE, RandomUtil.randomNumbers(Constants.EIGHT))); |
| | | user.setState(Constants.ONE); |
| | | user.setPhone(phoneNumber); |
| | | user.setProfilePicture(profilePicture); |
| | | user.setNickname(String.format(Constants.USER_NO_PRE, StringUtils.getCharAndNum(Constants.SIX))); |
| | | user.setState(Constants.ONE); |
| | |
| | | } else { |
| | | Integer state = user.getState(); |
| | | if (state == 0) { |
| | | throw new GlobalException("该账号未开启,无法进行登录!"); |
| | | throw new GlobalException("账号已被禁用,请联系平台管理员。"); |
| | | } |
| | | } |
| | | // 校验通过,生成token及过期时间 |
| | |
| | | |
| | | @ApiModelProperty("家电照片") |
| | | private String photo; |
| | | @ApiModelProperty("师傅照片") |
| | | private String workPic; |
| | | |
| | | @ApiModelProperty("是否评价(0:未评价,1:已评价)") |
| | | private Integer isEvaluate; |