| | |
| | | @ApiModelProperty("改派状态 (0:未改派 ;1:已改派 ;2:拒绝)") |
| | | @TableField("state") |
| | | private Integer state; |
| | | @ApiModelProperty("订单类型(0:正常订单,1:后台订单(后台订单与用户端、师傅端无联系))") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | |
| | | @ApiModelProperty("所属城市") |
| | | private String cityName; |
| | | |
| | | |
| | | @ApiModelProperty("品类") |
| | | private Integer classNameId; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | | |
| | |
| | | @ApiModelProperty(value = "页码", required = true) |
| | | private Integer pageNum = 1; |
| | | |
| | | |
| | | @ApiModelProperty(value = "订单类型0:正常订单,1:后台订单") |
| | | private Integer type ; |
| | | |
| | | @ApiModelProperty(value = "每页显示条数", required = true) |
| | | private Integer pageSize = 10; |
| | | |
| | |
| | | |
| | | @ApiModelProperty("城市列表") |
| | | private List<String> cityList; |
| | | @ApiModelProperty("服务ids") |
| | | private List<Integer> servIds ; |
| | | |
| | | } |
| | |
| | | @Data |
| | | public class OrderRequest { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("下单城市") |
| | | private String city; |
| | | |
| | |
| | | @TableId("id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | @ApiModelProperty("用户ID") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户手机号") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("申请时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private Date applyForTime; |
| | | |
| | | @ApiModelProperty("申请金额") |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<EvaluatePageVO>> evaluateList1(List<String> cityList, Integer userId, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Evaluate>> evaluateByWorkerId(Integer workerId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> edit(OrderRequest orderRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Order> detailByExchangeId(String id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Integer>> queryIdsBycode(List<String> cityList) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> updateStateAndArrivalTime(String orderId, Integer state) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<Order>> orderList1(Integer userId, List<String> cityList, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<Order>> workOrderList(Integer workId, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> updateWithdrawalState(String orderId, Integer state) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<BigDecimal> tradeMoney(List<String> cityList, String type) { |
| | | public R<BigDecimal> tradeMoney(MoneyQueryRequest moneyQueryRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | public WithdrawClient create(Throwable cause) { |
| | | return new WithdrawClient() { |
| | | @Override |
| | | public R<Page<UserWithdrawRecordVO>> withdrawPage(String nickname, String userPhone, String applyForTime, Integer state, Integer pageNum, Integer pageSize) { |
| | | public R<Page<UserWithdrawRecordVO>> withdrawPage(String nickname, String userPhone, String applyForTime, Integer state, Integer pageNum, Integer pageSize ,List<Integer> userIds) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<UserWithdrawRecordVO>> withdrawPage1(List<String> cityList, String nickname, String userPhone, String applyForTime, Integer state, Integer pageNum, Integer pageSize, List<Integer> userIds) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<UserWithdrawRecordVO>> withdrawList1(List<String> cityList, Integer userId, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Withdraw>> withdrawRecordByUser(String orderId, Integer userId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | @GetMapping(value = "/evaluate/evaluateList1") |
| | | R<Page<EvaluatePageVO>> evaluateList1(@RequestParam(value = "cityList", required = false) List<String> cityList, |
| | | @RequestParam(value = "userId", required = false) Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | /** |
| | | * 根据师傅id获取评价列表 |
| | | * |
| | |
| | | @PostMapping(value = "/order/save") |
| | | R<Boolean> save(@RequestBody OrderRequest orderRequest); |
| | | |
| | | |
| | | @PostMapping(value = "/order/edit") |
| | | R<Boolean> edit(@RequestBody OrderRequest orderRequest); |
| | | |
| | | /** |
| | | * 根据改派申请id获取订单详情 |
| | | * |
| | |
| | | @PostMapping(value = "/order/updateState") |
| | | R<Boolean> updateState(@RequestParam("orderId") String orderId, @RequestParam("state") Integer state); |
| | | |
| | | |
| | | @PostMapping(value = "/order/queryIdsBycode") |
| | | R<List<Integer>> queryIdsBycode(@RequestBody List<String> cityList); |
| | | |
| | | /** |
| | | * 更改订单状态且清空到达时间 |
| | | * |
| | |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | @GetMapping(value = "/order/orderList1") |
| | | R<Page<Order>> orderList1(@RequestParam("userId") Integer userId, @RequestParam("cityList") List<String> cityList, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | @GetMapping(value = "/order/workOrderList") |
| | | R<Page<Order>> workOrderList(@RequestParam("workId") Integer workId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | /** |
| | | * 更改订单提现状态 |
| | | * |
| | |
| | | * @return 交易额 |
| | | */ |
| | | @GetMapping(value = "/order/tradeMoney") |
| | | R<BigDecimal> tradeMoney(@RequestParam("cityList") List<String> cityList, |
| | | @RequestParam("type") String type); |
| | | R<BigDecimal> tradeMoney(@RequestBody MoneyQueryRequest moneyQueryRequest); |
| | | |
| | | /** |
| | | * 师傅端-订单列表 |
| | |
| | | @RequestParam(value = "applyForTime", required = false) String applyForTime, |
| | | @RequestParam(value = "state", required = false) Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam(name = "userIds") List<Integer> userIds); |
| | | |
| | | @GetMapping(value = "/withdraw/withdrawPage1") |
| | | R<Page<UserWithdrawRecordVO>> withdrawPage1(@RequestParam(value = "cityList", required = false)List<String> cityList,@RequestParam(value = "nickname", required = false) String nickname, |
| | | @RequestParam(value = "userPhone", required = false) String userPhone, |
| | | @RequestParam(value = "applyForTime", required = false) String applyForTime, |
| | | @RequestParam(value = "state", required = false) Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam(name = "userIds") List<Integer> userIds); |
| | | |
| | | /** |
| | | * 查看提现记录详情 |
| | |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | @GetMapping(value = "/withdraw/withdrawList1") |
| | | R<Page<UserWithdrawRecordVO>> withdrawList1(@RequestParam("cityList") List<String> cityList, |
| | | @RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | |
| | | /** |
| | | * 根据订单获取用户提现申请记录 |
| | | * |
| | |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | |
| | | public R<AddressDto> getCityCode(Integer addressId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<BigDecimal> getServePrice(Integer serveId, String cityCode) { |
| | | return R.fail(cause.getMessage()); } |
| | | }; |
| | | } |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @since 2024.05.29 |
| | |
| | | R<UserDto> getUser(@RequestParam("userId") Integer userId); |
| | | @PostMapping(value = "/user/getCityCode") |
| | | R<AddressDto> getCityCode(@RequestParam("addressId") Integer addressId); |
| | | @PostMapping(value = "/user/getServePrice") |
| | | R<BigDecimal> getServePrice(@RequestParam("serveId") Integer serveId, @RequestParam("cityCode") String cityCode); |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 手机号码正则 |
| | | */ |
| | | public static final String PHONE = "^1[34578]\\d{9}$"; |
| | | public static final String PHONE = "^1[345789]\\d{9}$"; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 未授权 |
| | | */ |
| | | public static final int UNAUTHORIZED = 401; |
| | | public static final int UNAUTHORIZED = 510; |
| | | |
| | | /** |
| | | * 访问受限,授权过期 |
| | |
| | | /** |
| | | * 用户所关联vx |
| | | */ |
| | | public static final String OPEN_ID = "openId"; |
| | | public static final String OPEN_ID = "openid"; |
| | | |
| | | /** |
| | | * 转账列表 |
| | |
| | | public class AddressDto { |
| | | private String city; |
| | | private String cityCode; |
| | | private String name; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AuthDto { |
| | | private String component; |
| | | private boolean condition_met; |
| | | } |
| | |
| | | @ApiModelProperty("头像") |
| | | private String profilePicture; |
| | | private String phone; |
| | | private String userNo; |
| | | } |
| | |
| | | </properties> |
| | | |
| | | <dependencies> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.tencentcloudapi</groupId>--> |
| | | <!-- <artifactId>tencentcloud-sdk-java</artifactId>--> |
| | | <!-- </dependency>--> |
| | | |
| | | |
| | | <!-- 腾讯短信sdk --> |
| | | <dependency> |
| | | <groupId>com.tencentcloudapi</groupId> |
| | | <artifactId>tencentcloud-sdk-java</artifactId> |
| | | <version>3.1.270</version> |
| | | <version>3.1.1073</version> |
| | | <!--排除okio--> |
| | | <exclusions> |
| | | <exclusion> |
| | |
| | | List<User> userList; |
| | | if (StringUtils.isNotBlank(userNo)) { |
| | | userList = userService.lambdaQuery().like(User::getNickname, userNo).list(); |
| | | if (userList.isEmpty()){ |
| | | Page<EvaluatePageVO> page = new Page<>(); |
| | | return R.ok(page); |
| | | } |
| | | } else { |
| | | userList = new ArrayList<>(); |
| | | } |
| | |
| | | evaluatePageRequest.setPageSize(pageSize); |
| | | evaluatePageRequest.setUserIdList(userIdList); |
| | | R<Page<EvaluatePageVO>> r = evaluateClient.queryPageList(evaluatePageRequest); |
| | | for (EvaluatePageVO record : r.getData().getRecords()) { |
| | | Integer userId = record.getUserId(); |
| | | User user = userService.getById(userId); |
| | | if (null != user) { |
| | | record.setUserNo(user.getNickname()); |
| | | if (!r.getData().getRecords().isEmpty()) { |
| | | for (EvaluatePageVO record : r.getData().getRecords()) { |
| | | Integer userId = record.getUserId(); |
| | | User user = userService.getById(userId); |
| | | if (null != user) { |
| | | record.setUserNo(user.getNickname()); |
| | | } |
| | | } |
| | | } |
| | | return r; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | @ApiOperation(value = "修改加盟商信息", tags = {"后台-加盟商管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody @Validated Franchisee franchisee) { |
| | | boolean b = false; |
| | | if (franchisee.getAdminPassword().equals("")){ |
| | | b = true; |
| | | } |
| | | String md5Password = checkFranchisee(franchisee); |
| | | SysUser sysUser = sysUserService.lambdaQuery() |
| | | .eq(SysUser::getFranchiseeId, franchisee.getId()) |
| | |
| | | // 生成sysUser账号 |
| | | sysUser.setNickName(franchisee.getName()); |
| | | sysUser.setAccount(franchisee.getAdminAccount()); |
| | | sysUser.setPassword(md5Password); |
| | | if (!b) { |
| | | sysUser.setPassword(md5Password); |
| | | } |
| | | sysUser.setIsEnable(franchisee.getIsEnable()); |
| | | |
| | | |
| | | |
| | | sysUserService.updateById(sysUser); |
| | | } |
| | | List<String> cityStr = new ArrayList<>(); |
| | | String[] split = franchisee.getCityCode().split(","); |
| | | for (String s : split) { |
| | | Region one = regionService.lambdaQuery().eq(Region::getCode, s).one(); |
| | | cityStr.add(one.getName()); |
| | | } |
| | | franchisee.setCity(String.join(",", cityStr)); |
| | | |
| | | return franchiseeService.updateById(franchisee) ? R.ok() : R.fail(); |
| | | } |
| | |
| | | @ApiOperation(value = "后台-用户数据统计", tags = {"后台-首页"}) |
| | | @PostMapping(value = "/userDataCount") |
| | | public R<UserDataCountVO> userDataCount(@RequestBody UserDataCountRequest userDataCountRequest) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | |
| | | if (null == userDataCountRequest.getCityList() || userDataCountRequest.getCityList().isEmpty()) { |
| | | userDataCountRequest.setCityList(loginUser.getCityList()); |
| | | } else { |
| | | userDataCountRequest.getCityList().addAll(loginUser.getCityList()); |
| | | // userDataCountRequest.getCityList().addAll(loginUser.getCityList()); |
| | | } |
| | | R<List<Integer>> listR = orderClient.queryIdsBycode(userDataCountRequest.getCityList()); |
| | | |
| | | return R.ok(userService.userDataCount1(userDataCountRequest, listR.getData())); |
| | | |
| | | } |
| | | return R.ok(userService.userDataCount(userDataCountRequest)); |
| | | } |
| | |
| | | if (null == cityList || cityList.isEmpty()) { |
| | | cityList = loginUser.getCityList(); |
| | | } else { |
| | | cityList.addAll(loginUser.getCityList()); |
| | | // cityList.addAll(loginUser.getCityList()); |
| | | } |
| | | R<List<Integer>> listR = orderClient.queryIdsBycode(cityList); |
| | | |
| | | return R.ok(userService.userTrends1(cityList,listR.getData())); |
| | | } |
| | | return R.ok(userService.userTrends(cityList)); |
| | | } |
| | |
| | | if (null == orderCount.getCityList() || orderCount.getCityList().isEmpty()) { |
| | | orderCount.setCityList(loginUser.getCityList()); |
| | | } else { |
| | | orderCount.getCityList().addAll(loginUser.getCityList()); |
| | | // orderCount.getCityList().addAll(loginUser.getCityList()); |
| | | } |
| | | } |
| | | return orderClient.orderCountHome(orderCount); |
| | |
| | | if (null == cityList || cityList.isEmpty()) { |
| | | cityList = loginUser.getCityList(); |
| | | } else { |
| | | cityList.addAll(loginUser.getCityList()); |
| | | // cityList.addAll(loginUser.getCityList()); |
| | | } |
| | | } |
| | | return R.ok(masterWorkerService.workerRanking(cityList)); |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | if (null != state) { |
| | | wrapper.eq(MasterWorker::getIsEnable, Constants.ONE); |
| | | } |
| | | for (int i = 0; i < cityList.size(); i++) { |
| | | // 最后一跳城市不匹配or条件 |
| | | String s = cityList.get(i); |
| | | if (cityList.size() - 1 == i) { |
| | | wrapper.like(MasterWorker::getCityCode, s); |
| | | } else { |
| | | wrapper.like(MasterWorker::getCityCode, s).or(); |
| | | } |
| | | } |
| | | wrapper.in(!cityList.isEmpty(),MasterWorker::getCityCode,cityList); |
| | | // for (int i = 0; i < cityList.size(); i++) { |
| | | // // 最后一跳城市不匹配or条件 |
| | | // String s = cityList.get(i); |
| | | // if (cityList.size() - 1 == i) { |
| | | // wrapper.like(MasterWorker::getCityCode, s); |
| | | // } else { |
| | | // wrapper.like(MasterWorker::getCityCode, s).or(); |
| | | // } |
| | | // } |
| | | return R.ok(wrapper.eq(MasterWorker::getIsDelete, Constants.ZERO) |
| | | .orderByDesc(MasterWorker::getCreateTime).page(Page.of(pageNum, pageSize))); |
| | | } |
| | |
| | | if (!star.isEmpty()) { |
| | | // 总评分 / 评价数量 |
| | | double sum = star.stream().mapToDouble(Double::doubleValue).sum(); |
| | | workerDetail.setStarRating(new BigDecimal(sum / star.size())); |
| | | BigDecimal average = new BigDecimal(sum / star.size()).setScale(2, RoundingMode.HALF_UP); |
| | | workerDetail.setStarRating(average); |
| | | } else { |
| | | workerDetail.setStarRating(new BigDecimal("0.00")); |
| | | } |
| | | |
| | | return R.ok(workerDetail); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.entity.RecoveryServe; |
| | | import com.ruoyi.admin.entity.Site; |
| | | import com.ruoyi.admin.entity.*; |
| | | import com.ruoyi.admin.netty.NettyChannelMap; |
| | | import com.ruoyi.admin.netty.NettyWebSocketController; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.OrderService; |
| | | import com.ruoyi.admin.service.RecoveryServeService; |
| | | import com.ruoyi.admin.service.SiteService; |
| | | import com.ruoyi.admin.service.*; |
| | | import com.ruoyi.admin.utils.AddressDto; |
| | | import com.ruoyi.admin.utils.DescribeInstances; |
| | | import com.ruoyi.admin.utils.OcrBase; |
| | | import com.ruoyi.admin.vo.OrderDetailVO; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.utils.GaoDeMapUtil; |
| | |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.*; |
| | | import com.ruoyi.order.api.entity.ChangeDispatch; |
| | | import com.ruoyi.order.api.entity.Order; |
| | | import com.ruoyi.order.api.feignClient.ExchangeDispatchClient; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.request.OrderCountDataRequest; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import com.tencentcloudapi.ocr.v20181119.models.BusinessCardOCRResponse; |
| | | import com.tencentcloudapi.ocr.v20181119.models.ClassifyDetectOCRResponse; |
| | | import com.tencentcloudapi.ocr.v20181119.models.SmartStructuralOCRV2Response; |
| | | import com.tencentcloudapi.ocr.v20181119.models.WaybillOCRResponse; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.Get; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | // 独立orderService |
| | | return R.ok(orderService.orderListDetail(id)); |
| | | } |
| | | @Resource |
| | | private RecoveryClassifyService recoveryClassifyService; |
| | | |
| | | |
| | | /** |
| | | * 订单列表 |
| | |
| | | orderQueryRequest.getCityList().addAll(loginUser.getCityList()); |
| | | } |
| | | } |
| | | List<Integer> servIds = new ArrayList<>(); |
| | | if (orderQueryRequest.getClassNameId()!=null){ |
| | | List<Integer> classIds = recoveryClassifyService.lambdaQuery().eq(RecoveryClassify::getId, orderQueryRequest.getClassNameId()).list().stream().map(RecoveryClassify::getId).collect(Collectors.toList()); |
| | | servIds = recoveryServeService.lambdaQuery().eq(BaseEntity::getIsDelete,0).in(RecoveryServe::getClassifyId, classIds).list().stream().map(RecoveryServe::getId).collect(Collectors.toList()); |
| | | } |
| | | orderQueryRequest.setServIds(servIds); |
| | | Page<Order> data = orderClient.queryPage(orderQueryRequest).getData(); |
| | | if (null != data) { |
| | | for (Order record : data.getRecords()) { |
| | |
| | | record.setServerName(masterWorker.getRealName()); |
| | | record.setServerPhone(masterWorker.getPhone()); |
| | | } |
| | | record.setReservationAddress(record.getReservationAddress() + record.getAddress()); |
| | | if (record.getAddress()!=null) { |
| | | record.setReservationAddress(record.getReservationAddress() + record.getAddress()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(data); |
| | |
| | | orderQueryRequest.getCityList().addAll(loginUser.getCityList()); |
| | | } |
| | | } |
| | | List<Integer> servIds = new ArrayList<>(); |
| | | if (orderQueryRequest.getClassNameId()!=null){ |
| | | List<Integer> classIds = recoveryClassifyService.lambdaQuery().eq(RecoveryClassify::getId, orderQueryRequest.getClassNameId()).list().stream().map(RecoveryClassify::getId).collect(Collectors.toList()); |
| | | servIds = recoveryServeService.lambdaQuery().eq(BaseEntity::getIsDelete,0).in(RecoveryServe::getClassifyId, classIds).list().stream().map(RecoveryServe::getId).collect(Collectors.toList()); |
| | | } |
| | | orderQueryRequest.setServIds(servIds); |
| | | |
| | | return R.ok(orderClient.orderPageCount(orderQueryRequest).getData()); |
| | | } |
| | | |
| | |
| | | return R.ok(orderClient.detail(id).getData()); |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private RecoveryServePriceService recoveryServePriceService; |
| | | /** |
| | | * 新增订单 |
| | | * 后台订单为指定订单,默认为待上门状态 |
| | |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, order.getServeId()) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | |
| | | order.setServeName(recoveryServe.getServeName()); |
| | | order.setServePrice(recoveryServe.getDefaultPrice()); |
| | | order.setOrderMoney(recoveryServe.getDefaultPrice()); |
| | | RecoveryServePrice one = recoveryServePriceService.lambdaQuery().eq(RecoveryServePrice::getCity, order.getCityCode()).eq(RecoveryServePrice::getRecoveryServeId, order.getServeId()).eq(BaseEntity::getIsDelete, 0).one(); |
| | | if (one==null) { |
| | | order.setOrderMoney(recoveryServe.getDefaultPrice()); |
| | | }else { |
| | | order.setOrderMoney(one.getRecoveryPrice()); |
| | | } |
| | | Boolean data = orderClient.save(order).getData(); |
| | | if (null == data) { |
| | | return R.fail(orderClient.save(order).getMsg()); |
| | |
| | | return data ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "订单列表-编辑", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/edit") |
| | | public R<String> edit(@RequestBody OrderRequest order) { |
| | | // 站点信息 |
| | | Site site = siteService.lambdaQuery() |
| | | .eq(Site::getId, order.getSiteId()) |
| | | .eq(Site::getIsDelete, 0).one(); |
| | | order.setSiteName(site.getSiteName()); |
| | | // 师傅信息 |
| | | if (null != order.getServerId()) { |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getId, order.getServerId()) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | order.setServerName(masterWorker.getRealName()); |
| | | order.setServerPhone(masterWorker.getPhone()); |
| | | } else { |
| | | // 待派单状态 |
| | | order.setState(Constants.ZERO); |
| | | } |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, order.getServeId()) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | RecoveryServePrice one = recoveryServePriceService.lambdaQuery().eq(RecoveryServePrice::getCity, order.getCityCode()).eq(RecoveryServePrice::getRecoveryServeId, order.getServeId()).eq(BaseEntity::getIsDelete, 0).last("limit 1").one(); |
| | | if (one==null) { |
| | | order.setOrderMoney(recoveryServe.getDefaultPrice()); |
| | | }else { |
| | | order.setOrderMoney(one.getRecoveryPrice()); |
| | | } |
| | | // 后台订单 |
| | | order.setType(Constants.ONE); |
| | | Boolean data = orderClient.edit(order).getData(); |
| | | |
| | | System.out.println("服务人员id:" + order.getServerId()); |
| | | ChannelHandlerContext context = NettyChannelMap.getData(String.valueOf(order.getServerId())); |
| | | System.out.println("socket连接信息:" + context); |
| | | if (null != context) { |
| | | System.out.println("服务端发送消息到: " + order.getServerId()); |
| | | NettyWebSocketController.sendMsgToClient(context, "您有一条新的订单,请注意查收!"); |
| | | } |
| | | return data ? R.ok() : R.fail(); |
| | | |
| | | } |
| | | /** |
| | | * 订单派单/改派 |
| | | * |
| | |
| | | return R.ok(orderClient.batchDelete(ids).getData()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 订单列表-excel导出 |
| | | * |
| | |
| | | return orderClient.oldData(index, pageNum, pageSize); |
| | | } |
| | | |
| | | @ApiOperation(value = "ocr识别", tags = {"后台-首页"}) |
| | | @PostMapping (value = "/ocr") |
| | | public R<AddressDto> ocr(OcrBase ocrBase) { |
| | | return R.ok(DescribeInstances.orcr(ocrBase.getBase())); |
| | | } |
| | | |
| | | /** |
| | | * 订单列表-excel导出 |
| | | * |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.RecoveryClassify; |
| | | import com.ruoyi.admin.service.RecoveryClassifyService; |
| | | import com.ruoyi.admin.service.SiteService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @Resource |
| | | private RecoveryClassifyService recoveryClassifyService; |
| | | |
| | | |
| | | /** |
| | | * 回收分类分页列表 |
| | | * |
| | |
| | | .page(Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "分类下拉框", tags = {"后台-下拉框"}) |
| | | @GetMapping(value = "/select") |
| | | |
| | | public R<List<RecoveryClassify>> select(String className) { |
| | | return R.ok(recoveryClassifyService.lambdaQuery().eq(RecoveryClassify::getIsDelete, 0) |
| | | .orderByDesc(RecoveryClassify::getSupClassify).like(className!=null&&className!="", RecoveryClassify::getSubClassify,className) |
| | | .orderByAsc(RecoveryClassify::getSort) |
| | | .orderByDesc(RecoveryClassify::getCreateTime) |
| | | .list()); |
| | | } |
| | | |
| | | /** |
| | | * 回收分类详情 |
| | | * |
| | |
| | | return R.ok(regionService.addressTree(null)); |
| | | } |
| | | |
| | | @GetMapping("/manageaddressTree") |
| | | @ApiOperation(value = "选择城市:省市二级联动", tags = {"后台-首页"}) |
| | | public R<List<Region>> manageaddressTree() { |
| | | 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.addressTree1(cityCodeList)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.Menu; |
| | | import com.ruoyi.admin.entity.Role; |
| | | import com.ruoyi.admin.entity.RoleMenu; |
| | | import com.ruoyi.admin.entity.SysUser; |
| | | import com.ruoyi.admin.entity.*; |
| | | import com.ruoyi.admin.request.RoleRequest; |
| | | import com.ruoyi.admin.service.MenuService; |
| | | import com.ruoyi.admin.service.RoleMenuService; |
| | | import com.ruoyi.admin.service.RoleService; |
| | | import com.ruoyi.admin.service.SysUserService; |
| | | import com.ruoyi.admin.service.*; |
| | | import com.ruoyi.admin.vo.RoleDetailVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | |
| | | /** |
| | | * 角色列表 |
| | | */ |
| | | @RequiresPermissions("power_role") |
| | | @RequiresPermissions("power_account") |
| | | @ApiOperation(value = "角色列表", tags = {"后台-权限管理-账号管理"}) |
| | | @GetMapping(value = "/list") |
| | | public R<List<Role>> list() { |
| | |
| | | return roleService.saveRoleAndMenu(roleRequest, loginUser) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @Resource |
| | | private UserRoleService userRoleService; |
| | | /** |
| | | * 根据id批量删除角色 |
| | | * |
| | |
| | | List<Role> list = roleService.lambdaQuery().in(Role::getRoleId, idList).list(); |
| | | for (Role role : list) { |
| | | Long roleId = role.getRoleId(); |
| | | List<Long> collect = userRoleService.lambdaQuery().eq(UserRole::getRoleId, roleId).list().stream().map(UserRole::getUserId).collect(Collectors.toList()); |
| | | if (!collect.isEmpty()){ |
| | | List<SysUser> sysUserList = userService.lambdaQuery() |
| | | .eq(SysUser::getRoleId, roleId) |
| | | .in(SysUser::getUserId,collect) |
| | | .eq(SysUser::getIsDelete, 0).list(); |
| | | if (sysUserList.isEmpty()) { |
| | | role.setDelFlag("2"); |
| | | }else { |
| | | return R.repeatedSubmission("角色已关联账号,请先解除关联!"); |
| | | } |
| | | }else { |
| | | role.setDelFlag("2"); |
| | | |
| | | } |
| | | // 删除菜单关联信息 |
| | | roleMenuService.remove(new QueryWrapper<RoleMenu>().eq("role_id", roleId)); |
| | |
| | | }) |
| | | public R<IPage<Rotate>> queryPageList(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(rotateService.queryPage(Page.of(pageNum, pageSize))); |
| | | IPage<Rotate> rotateIPage = rotateService.queryPage(Page.of(pageNum, pageSize)); |
| | | for (Rotate record : rotateIPage.getRecords()) { |
| | | if (record.getIsRotate()==0){ |
| | | record.setServeName("不跳转"); |
| | | } |
| | | } |
| | | return R.ok(rotateIPage); |
| | | } |
| | | |
| | | /** |
| | |
| | | .eq(WorkerProcess::getPhone, phone) |
| | | .eq(WorkerProcess::getIsDelete, 0) |
| | | .orderByDesc(WorkerProcess::getCreateTime).last("limit 1").one(); |
| | | if (masterWorker != null){ |
| | | return R.fail("该手机号入驻申请已通过,请前往登录!"); |
| | | } |
| | | if (null != workerProcess) { |
| | | Integer state = workerProcess.getState(); |
| | | if (Constants.ZERO.equals(state)) { |
| | |
| | | */ |
| | | @ApiOperation(value = "站点列表", tags = {"后台-系统设置-站点管理"}) |
| | | @GetMapping(value = "/list") |
| | | public R<List<Site>> list() { |
| | | return R.ok(siteService.lambdaQuery().orderByDesc(Site::getCreateTime) |
| | | public R<List<Site>> list(String siteName) { |
| | | return R.ok(siteService.lambdaQuery().orderByDesc(Site::getCreateTime).like(siteName!=null&&siteName!="", Site::getSiteName, siteName) |
| | | .eq(Site::getIsDelete, 0) |
| | | .list()); |
| | | } |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | /** |
| | | * 用户信息分页列表 |
| | | * |
| | |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | LambdaQueryChainWrapper<User> query = userService.lambdaQuery(); |
| | | LambdaQueryChainWrapper<User> query = userService.lambdaQuery().isNotNull(User::getPhone); |
| | | // 穆湖匹配规则 |
| | | query = StringUtils.isNotBlank(nickname) ? query.like(User::getNickname, nickname) : query; |
| | | query = StringUtils.isNotBlank(phone) ? query.like(User::getPhone, phone) : query; |
| | | // 账号是否启用 |
| | | query = null != state ? query.eq(User::getState, state) : query; |
| | | if (loginUser.getIsFranchisee() && !loginUser.getCityList().isEmpty()) { |
| | | query.in(User::getCity, loginUser.getCityList()); |
| | | // if (loginUser.getIsFranchisee() && !loginUser.getCityList().isEmpty()) { |
| | | // query.in(User::getCity, loginUser.getCityList()); |
| | | // } |
| | | if (loginUser.getIsFranchisee()) { |
| | | List<String> cityList = loginUser.getCityList(); |
| | | R<List<Integer>> listR = orderClient.queryIdsBycode(cityList); |
| | | return R.ok(query.orderByDesc(User::getCreateTime).eq(User::getIsDelete, 0) |
| | | .orderByDesc(User::getCreateTime).in(User::getId, listR.getData()).page(Page.of(pageNum, pageSize))); |
| | | } |
| | | return R.ok(query.orderByDesc(User::getCreateTime).eq(User::getIsDelete, 0) |
| | | .orderByDesc(User::getCreateTime).page(Page.of(pageNum, pageSize))); |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | R<Page<Order>> iPageR = orderClient.orderList(userId, pageNum, pageSize); |
| | | return R.ok(iPageR.getData()); |
| | | |
| | | List<String> cityList= new ArrayList<>(); |
| | | if (loginUser.getCityList()!=null) { |
| | | cityList = loginUser.getCityList(); |
| | | } |
| | | R<Page<Order>> iPageR = orderClient.orderList1(userId,cityList, pageNum, pageSize); |
| | | Page<Order> data = iPageR.getData(); |
| | | |
| | | List<Order> records = data.getRecords(); |
| | | if (!records.isEmpty()) { |
| | | for (Order record : records) { |
| | | if (record.getAddress() != null) { |
| | | record.setReservationAddress(record.getReservationAddress() + record.getAddress()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | return R.ok(data); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "师傅订单详情", tags = {"后台-师傅管理-师傅列表管理"}) |
| | | @GetMapping(value = "/workOrderList") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "用户id", name = "workId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<Order>> workOrderList(@RequestParam("workId") Integer workId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | R<Page<Order>> iPageR = orderClient.workOrderList(workId, pageNum, pageSize); |
| | | Page<Order> data = iPageR.getData(); |
| | | List<Order> records = data.getRecords(); |
| | | for (Order record : records) { |
| | | if (record.getAddress()!=null) { |
| | | record.setReservationAddress(record.getReservationAddress() + record.getAddress()); |
| | | } |
| | | |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R<Page<EvaluatePageVO>> evaluateList(Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return evaluateClient.evaluateList(userId, pageNum, pageSize); |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | List<String> cityList = loginUser.getCityList(); |
| | | return evaluateClient.evaluateList1(cityList,userId, pageNum, pageSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "评价记录id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<String> deleteEvaluateRecord(@RequestParam Integer id) { |
| | | public R<String> deleteEvaluateRecord(@RequestParam Long id) { |
| | | return evaluateClient.batchDelete(String.valueOf(id)); |
| | | } |
| | | |
| | |
| | | public R<Page<UserWithdrawRecordVO>> withdrawList(@RequestParam Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return withdrawClient.withdrawList(userId, pageNum, pageSize); |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | List<String> cityList = new ArrayList<>(); |
| | | if (loginUser.getCityList()!=null) { |
| | | cityList = loginUser.getCityList(); |
| | | } |
| | | return withdrawClient.withdrawList1(cityList,userId, pageNum, pageSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "提现记录id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<String> deleteWithdrawRecord(@RequestParam Integer id) { |
| | | public R<String> deleteWithdrawRecord(@RequestParam Long id) { |
| | | return withdrawClient.batchDelete(String.valueOf(id)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.admin.service.WithdrawService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.UserWithdrawRecordVO; |
| | | import com.ruoyi.order.api.entity.Withdraw; |
| | | import com.ruoyi.order.api.entity.WithdrawExportRequest; |
| | | import com.ruoyi.order.api.feignClient.WithdrawClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | |
| | | String applyForTime, Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<UserWithdrawRecordVO> page = withdrawClient.withdrawPage(nickname, userPhone, applyForTime, |
| | | state, pageNum, pageSize).getData(); |
| | | |
| | | List<Integer> userIds = userService.lambdaQuery().like(User::getNickname, nickname).list().stream().map(User::getId).collect(Collectors.toList()); |
| | | if (nickname!=null&&nickname!="") { |
| | | if (userIds.isEmpty()) { |
| | | return R.ok(new Page<UserWithdrawRecordVO>()); |
| | | } |
| | | } |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | List<String> cityList = loginUser.getCityList(); |
| | | |
| | | |
| | | Page<UserWithdrawRecordVO> page = withdrawClient.withdrawPage1(cityList,nickname, userPhone, applyForTime, |
| | | state, pageNum, pageSize,userIds).getData(); |
| | | if (null != page) { |
| | | for (UserWithdrawRecordVO record : page.getRecords()) { |
| | | Integer userId = record.getUserId(); |
| | |
| | | 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.MasterWorker; |
| | | import com.ruoyi.admin.entity.WorkerProcess; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.WorkerProcessService; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | |
| | | @Resource |
| | | private WorkerProcessService workerProcessService; |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @ApiOperation(value = "师傅下拉框", tags = {"后台-下拉框"}) |
| | | @GetMapping(value = "/select") |
| | | |
| | | public R<List<MasterWorker>> select(String workerName) { |
| | | |
| | | return R.ok(masterWorkerService.lambdaQuery().like(workerName!=null,MasterWorker::getRealName,workerName).eq(BaseEntity::getIsDelete, 0).eq(MasterWorker::getIsEnable, 1).list()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 师傅入驻审核分页列表 |
| | | * |
| | |
| | | * @return 折线图数据 |
| | | */ |
| | | List<UserTrendsVO> userTrends(@Param("city") List<String> city); |
| | | List<UserTrendsVO> userTrends1(@Param("city") List<String> city,@Param("userIds") List<Integer> userIds); |
| | | |
| | | /** |
| | | * 统计本年度,注册用户数量 |
| | |
| | | * @return 注册用户数量 |
| | | */ |
| | | Long increaseNumberByYear(@Param("cityList") List<String> cityList); |
| | | Long increaseNumberByYear1(@Param("cityList") List<String> cityList,@Param("userIds") List<Integer> userIds); |
| | | |
| | | /** |
| | | * 统计本月,注册用户数量 |
| | |
| | | * @return 注册用户数量 |
| | | */ |
| | | Long increaseNumberByMonth(@Param("cityList") List<String> cityList); |
| | | Long increaseNumberByMonth1(@Param("cityList") List<String> cityList,@Param("userIds") List<Integer> userIds); |
| | | |
| | | } |
| | |
| | | * @return 无限级树 |
| | | */ |
| | | List<Region> addressTree(List<String> cityCodeList); |
| | | List<Region> addressTree1(List<String> cityCodeList); |
| | | } |
| | |
| | | * @return 折线图数据 |
| | | */ |
| | | List<UserTrendsVO> userTrends(List<String> city); |
| | | List<UserTrendsVO> userTrends1(List<String> city,List<Integer> userIds); |
| | | |
| | | /** |
| | | * 用户数据统计 |
| | |
| | | * @return 统计数据信息 |
| | | */ |
| | | UserDataCountVO userDataCount(UserDataCountRequest userDataCountRequest); |
| | | UserDataCountVO userDataCount1(UserDataCountRequest userDataCountRequest,List<Integer> userIds); |
| | | } |
| | |
| | | import com.ruoyi.admin.mapper.MasterWorkerMapper; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.vo.MasterWorkerRankVO; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.order.api.entity.WorkerOrderRankVO; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Override |
| | | public boolean checkOnlyPhone(String phone, Integer id) { |
| | | LambdaQueryChainWrapper<MasterWorker> wrapper = lambdaQuery().eq(MasterWorker::getPhone, phone); |
| | | LambdaQueryChainWrapper<MasterWorker> wrapper = lambdaQuery().eq(MasterWorker::getPhone, phone).eq(BaseEntity::getIsDelete, 0); |
| | | if (null != id) { |
| | | wrapper.ne(MasterWorker::getId, id); |
| | | } |
| | |
| | | orderByServe.setServeName(order.getServeName()); |
| | | } |
| | | orderByServe.setPrice(order.getServePrice()); |
| | | orderByServe.setSubsidy(order.getSubsidy()); |
| | | result.setServeInfo(orderByServe); |
| | | } |
| | | |
| | |
| | | } |
| | | orderByUserInfo.setReservationName(order.getReservationName()); |
| | | orderByUserInfo.setReservationPhone(order.getReservationPhone()); |
| | | orderByUserInfo.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | if (order.getAddress()!=null) { |
| | | orderByUserInfo.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | }else { |
| | | orderByUserInfo.setReservationAddress(order.getReservationAddress()); |
| | | } |
| | | orderByUserInfo.setTime(order.getTime()); |
| | | result.setUserInfo(orderByUserInfo); |
| | | } |
| | |
| | | return treeData; |
| | | } |
| | | |
| | | @Override |
| | | public List<Region> addressTree1(List<String> cityCodeList) { |
| | | // 获取所有地区信息 省市区三级 |
| | | List<Region> regions = getReginList(cityCodeList); |
| | | // 所有地区 |
| | | Map<String, Region> courseTypeMap = regions.stream(). |
| | | collect(Collectors.toMap(region -> region.getId().toString() |
| | | , region -> region)); |
| | | redisTemplate.opsForHash().putAll(RedisConstants.ADDRESS_TREE, courseTypeMap); |
| | | redisTemplate.expire(RedisConstants.ADDRESS_TREE, 30, TimeUnit.MINUTES); |
| | | // 生成map集合 |
| | | Map<Integer, Region> map = regions.stream().collect(Collectors.toMap(Region::getId, region -> region)); |
| | | // 存放无限级树 |
| | | List<Region> treeData = new ArrayList<>(); |
| | | // 遍历地区集合 |
| | | regions.forEach(e -> { |
| | | if (e.getParentId() == null || e.getParentId().equals(0)||!cityCodeList.isEmpty()) { |
| | | treeData.add(e); |
| | | } else { |
| | | Region region = map.get(e.getParentId()); |
| | | region.getChildren().add(e); |
| | | } |
| | | }); |
| | | for (Region region : treeData) { |
| | | List<Region> children = region.getChildren(); |
| | | for (Region child : children) { |
| | | child.setChildren(new ArrayList<>()); |
| | | } |
| | | } |
| | | return treeData; |
| | | } |
| | | |
| | | /** |
| | | * 获取redis数据进行封装 |
| | | */ |
| | | private List<Region> getReginList(List<String> cityCodeList) { |
| | | List<Region> regions; |
| | | if (cityCodeList==null) { |
| | | if (cityCodeList==null||cityCodeList.isEmpty()) { |
| | | regions = this.list(); |
| | | } else { |
| | | regions = this.lambdaQuery() |
| | |
| | | List<UserTrendsVO> userTrendsList = baseMapper.userTrends(city); |
| | | return null == userTrendsList || userTrendsList.isEmpty() ? new ArrayList<>() : userTrendsList; |
| | | } |
| | | @Override |
| | | public List<UserTrendsVO> userTrends1(List<String> city,List<Integer> userIds) { |
| | | List<UserTrendsVO> userTrendsList = baseMapper.userTrends1(city,userIds); |
| | | return null == userTrendsList || userTrendsList.isEmpty() ? new ArrayList<>() : userTrendsList; |
| | | } |
| | | |
| | | @Override |
| | | public UserDataCountVO userDataCount(UserDataCountRequest userDataCountRequest) { |
| | | List<String> cityList = userDataCountRequest.getCityList(); |
| | | String type = userDataCountRequest.getCountType(); |
| | | LambdaQueryChainWrapper<User> userWrapper = lambdaQuery().eq(User::getIsDelete, 0); |
| | | LambdaQueryChainWrapper<User> userWrapper = lambdaQuery().eq(User::getIsDelete, 0).isNotNull(User::getPhone); |
| | | if (null != cityList && !cityList.isEmpty()) { |
| | | userWrapper.in(User::getCityCode, cityList); |
| | | } |
| | | List<User> userList = userWrapper.list(); |
| | | |
| | | // 判断用户是否在管辖城市内下过订单 |
| | | // 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()) { |
| | | // iterator.remove(); // 安全地移除元素 |
| | | // } |
| | | // } |
| | | |
| | | Integer userNumber = userList.size(); |
| | | // 用户总量 |
| | | // 计算当前季度时间所包含时间 |
| | | int currentYear = Year.now().getValue(); |
| | | // 获取当前月份 |
| | | Month currentMonth = LocalDate.now().getMonth(); |
| | | // 计算当前季度的开始时间和结束时间 |
| | | LocalDate startDate = LocalDate.of(currentYear, getStartMonthOfQuarter(currentMonth), 1); |
| | | LocalDate endDate = startDate.plusMonths(2).with(TemporalAdjusters.lastDayOfMonth()); |
| | | String startDateStr = String.valueOf(startDate); |
| | | String endDateStr = String.valueOf(endDate); |
| | | // 结果数据封装 |
| | | Long increaseNumber; |
| | | // 交易额 |
| | | BigDecimal totalMoney = orderClient.tradeMoney(new MoneyQueryRequest(cityList,userDataCountRequest.getCountType())).getData(); |
| | | BigDecimal withdrawalTotalMoney = withdrawClient.withdrawalTotalMoney(new MoneyQueryRequest(cityList, type)) |
| | | .getData(); |
| | | if (OrderConstants.QUARTER.equals(type)) { |
| | | // 用户增长数 |
| | | LambdaQueryChainWrapper<User> wrapper = lambdaQuery().ge(User::getCreateTime, startDateStr) |
| | | .le(User::getCreateTime, endDateStr); |
| | | if (null != cityList && !cityList.isEmpty()) { |
| | | wrapper.in(User::getCityCode, cityList); |
| | | } |
| | | increaseNumber = wrapper.eq(User::getIsDelete, 0).isNotNull(User::getPhone).count(); |
| | | } else if (OrderConstants.YEAR.equals(type)) { |
| | | // 用户增长数 |
| | | increaseNumber = baseMapper.increaseNumberByYear(cityList); |
| | | } else if (OrderConstants.MONTH.equals(type)) { |
| | | // 用户增长数 |
| | | increaseNumber = baseMapper.increaseNumberByMonth(cityList); |
| | | } else { |
| | | // 数量初始化 |
| | | increaseNumber = 0L; |
| | | } |
| | | // 查询结果判断 |
| | | increaseNumber = null == increaseNumber ? 0L : increaseNumber; |
| | | totalMoney = null == totalMoney ? BigDecimal.ZERO : totalMoney; |
| | | withdrawalTotalMoney = null == withdrawalTotalMoney ? BigDecimal.ZERO : withdrawalTotalMoney; |
| | | return new UserDataCountVO(userNumber, increaseNumber, totalMoney, withdrawalTotalMoney); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public UserDataCountVO userDataCount1(UserDataCountRequest userDataCountRequest,List<Integer> userIds) { |
| | | List<String> cityList = userDataCountRequest.getCityList(); |
| | | String type = userDataCountRequest.getCountType(); |
| | | |
| | | LambdaQueryChainWrapper<User> userWrapper = lambdaQuery().eq(User::getIsDelete, 0).isNotNull(User::getPhone).in(!userIds.isEmpty(),User::getId,userIds); |
| | | // if (null != cityList && !cityList.isEmpty()) { |
| | | // userWrapper.in(User::getCityCode, cityList); |
| | | // } |
| | | List<User> userList = userWrapper.list(); |
| | | |
| | | // 判断用户是否在管辖城市内下过订单 |
| | |
| | | // 结果数据封装 |
| | | Long increaseNumber; |
| | | // 交易额 |
| | | BigDecimal totalMoney = orderClient.tradeMoney(cityList, userDataCountRequest.getCountType()).getData(); |
| | | BigDecimal totalMoney = orderClient.tradeMoney(new MoneyQueryRequest(cityList,userDataCountRequest.getCountType())).getData(); |
| | | BigDecimal withdrawalTotalMoney = withdrawClient.withdrawalTotalMoney(new MoneyQueryRequest(cityList, type)) |
| | | .getData(); |
| | | if (OrderConstants.QUARTER.equals(type)) { |
| | | // 用户增长数 |
| | | LambdaQueryChainWrapper<User> wrapper = lambdaQuery().ge(User::getCreateTime, startDateStr) |
| | | .le(User::getCreateTime, endDateStr); |
| | | if (null != cityList && !cityList.isEmpty()) { |
| | | wrapper.in(User::getCityCode, cityList); |
| | | } |
| | | increaseNumber = wrapper.eq(User::getIsDelete, 0).count(); |
| | | .le(User::getCreateTime, endDateStr).in(User::getId,userIds); |
| | | // if (null != cityList && !cityList.isEmpty()) { |
| | | // wrapper.in(User::getCityCode, cityList); |
| | | // } |
| | | increaseNumber = wrapper.eq(User::getIsDelete, 0).isNotNull(User::getPhone).count(); |
| | | } else if (OrderConstants.YEAR.equals(type)) { |
| | | // 用户增长数 |
| | | increaseNumber = baseMapper.increaseNumberByYear(cityList); |
| | | increaseNumber = baseMapper.increaseNumberByYear1(cityList,userIds); |
| | | } else if (OrderConstants.MONTH.equals(type)) { |
| | | // 用户增长数 |
| | | increaseNumber = baseMapper.increaseNumberByMonth(cityList); |
| | | increaseNumber = baseMapper.increaseNumberByMonth1(cityList,userIds); |
| | | } else { |
| | | // 数量初始化 |
| | | increaseNumber = 0L; |
| | |
| | | masterWorker.setPassword(encodePassword); |
| | | masterWorker.setUserNumber(Constants.DEFAULT_USER_NUMBER_PRE + RandomUtil.randomNumbers(10)); |
| | | masterWorker.setCityStr(workerProcess.getCityStr()); |
| | | masterWorker.setCityCode(workerProcess.getCityCode()); |
| | | masterWorkerService.save(masterWorker); |
| | | } |
| | | return updateById(workerProcess) ? R.ok() : R.fail("当前入驻申请审核失败!"); |
New file |
| | |
| | | package com.ruoyi.admin.utils; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AddressDto { |
| | | private String name; |
| | | private String address; |
| | | private String phone; |
| | | private String detail; |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.utils; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.tencentcloudapi.common.Credential; |
| | | import com.tencentcloudapi.common.exception.TencentCloudSDKException; |
| | | import com.tencentcloudapi.cvm.v20170312.CvmClient; |
| | | import com.tencentcloudapi.cvm.v20170312.models.DescribeInstancesRequest; |
| | | import com.tencentcloudapi.cvm.v20170312.models.DescribeInstancesResponse; |
| | | import com.tencentcloudapi.ocr.v20181119.OcrClient; |
| | | import com.tencentcloudapi.ocr.v20181119.models.*; |
| | | |
| | | public class DescribeInstances { |
| | | public static AddressDto orcr(String args) { |
| | | try { |
| | | // 为了保护密钥安全,建议将密钥设置在环境变量中或者配置文件中,请参考本文凭证管理章节。 |
| | | // 硬编码密钥到代码中有可能随代码泄露而暴露,有安全隐患,并不推荐。 |
| | | // Credential cred = new Credential("SecretId", "SecretKey"); |
| | | Credential cred = new Credential("AKIDHVcchrvvtBiRJB25bHFFJc2Laq4NnHsY", "pgUGwX4Z1SrAPXYk1PxgXVem2HlRJG9k"); |
| | | OcrClient client = new OcrClient(cred, "ap-shanghai"); |
| | | |
| | | |
| | | SmartStructuralOCRV2Request waybillOCRRequest = new SmartStructuralOCRV2Request(); |
| | | // waybillOCRRequest.setImageUrl("https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/e1bb6062-fc05-4b68-ba35-c70cb8067fff.png"); |
| | | waybillOCRRequest.setImageBase64(args); |
| | | waybillOCRRequest.setItemNames(new String[]{"收件人", "手机号", "所在地区","详细地址"}); |
| | | SmartStructuralOCRV2Response resp = client.SmartStructuralOCRV2(waybillOCRRequest); |
| | | |
| | | GroupInfo[] structuralList = resp.getStructuralList(); |
| | | AddressDto addressDto = new AddressDto(); |
| | | for (GroupInfo groupInfo : structuralList) { |
| | | LineInfo[] groups = groupInfo.getGroups(); |
| | | for (LineInfo group : groups) { |
| | | ItemInfo[] lines = group.getLines(); |
| | | for (ItemInfo line : lines) { |
| | | if (line.getKey().getAutoName().equals("收件人")){ |
| | | System.err.println(line.getValue().getAutoContent()); |
| | | addressDto.setName(line.getValue().getAutoContent()); |
| | | }else if (line.getKey().getAutoName().equals("手机号")){ |
| | | System.err.println(line.getValue().getAutoContent()); |
| | | addressDto.setPhone(line.getValue().getAutoContent()); |
| | | }else if (line.getKey().getAutoName().equals("所在地区")){ |
| | | System.err.println(line.getValue().getAutoContent()); |
| | | addressDto.setAddress(line.getValue().getAutoContent()); |
| | | }else if (line.getKey().getAutoName().equals("详细地址")){ |
| | | System.err.println(line.getValue().getAutoContent()); |
| | | addressDto.setDetail(line.getValue().getAutoContent()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | return addressDto; |
| | | |
| | | } catch (TencentCloudSDKException e) { |
| | | e.printStackTrace(); |
| | | System.out.println(e.toString()); |
| | | } |
| | | throw new RuntimeException("当前内容无法识别"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.utils; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class OcrBase { |
| | | private String base; |
| | | } |
| | |
| | | private BigDecimal starRating; |
| | | |
| | | @ApiModelProperty("评价时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date evaluateTime; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | |
| | | |
| | | @ApiModelProperty("回收价格") |
| | | private BigDecimal price; |
| | | private BigDecimal subsidy; |
| | | |
| | | @ApiModelProperty("封面图片") |
| | | private String cover; |
| | |
| | | </foreach> |
| | | </if> |
| | | and is_delete = 0 |
| | | and state = 1 |
| | | and state = 1 and phone IS NOT NULL |
| | | </where> |
| | | GROUP BY DATE_FORMAT(createTime, '%Y-%m') |
| | | ORDER BY date; |
| | | </select> |
| | | |
| | | |
| | | <select id="userTrends1" resultType="com.ruoyi.admin.vo.UserTrendsVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m') AS date, COUNT(*) AS number |
| | | FROM t_user |
| | | <where> |
| | | and is_delete = 0 |
| | | <if test="userIds != null and userIds.size() != 0"> |
| | | and id in |
| | | <foreach collection="userIds" item="userId" open="(" separator="," close=")"> |
| | | #{userId} |
| | | </foreach> |
| | | </if> |
| | | and state = 1 and phone IS NOT NULL |
| | | </where> |
| | | GROUP BY DATE_FORMAT(createTime, '%Y-%m') |
| | | ORDER BY date; |
| | |
| | | SELECT COUNT(*) AS number |
| | | FROM t_user |
| | | WHERE YEAR(createTime) = YEAR(NOW()) |
| | | and is_delete = 0 |
| | | and is_delete = 0 and phone IS NOT NULL |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city_code in |
| | | <foreach collection="cityList" item="city" open="(" separator="," close=")"> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="increaseNumberByYear1" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS number |
| | | FROM t_user |
| | | WHERE YEAR(createTime) = YEAR(NOW()) |
| | | and is_delete = 0 and phone IS NOT NULL |
| | | <if test="userIds != null and userIds.size() != 0"> |
| | | and id in |
| | | <foreach collection="userIds" item="userId" open="(" separator="," close=")"> |
| | | #{userId} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="increaseNumberByMonth" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS number |
| | | FROM t_user |
| | | WHERE MONTH(createTime) = MONTH(NOW()) |
| | | AND YEAR(createTime) = YEAR(NOW()) |
| | | AND YEAR(createTime) = YEAR(NOW()) and phone IS NOT NULL |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city_code in |
| | | <foreach collection="cityList" item="city" open="(" separator="," close=")"> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="increaseNumberByMonth1" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS number |
| | | FROM t_user |
| | | WHERE MONTH(createTime) = MONTH(NOW()) |
| | | AND YEAR(createTime) = YEAR(NOW()) and phone IS NOT NULL |
| | | <if test="userIds != null and userIds.size() != 0"> |
| | | and id in |
| | | <foreach collection="userIds" item="userId" open="(" separator="," close=")"> |
| | | #{userId} |
| | | </foreach> |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-security</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.wechatpay-apiv3</groupId> |
| | | <artifactId>wechatpay-java</artifactId> |
| | | <version>0.2.12</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | |
| | | public R<Page<ChangeDispatch>> queryPageList(@RequestBody ChangeDispatchRequest request) { |
| | | Page<ChangeDispatch> page = changeDispatchService.queryPageList(request, Page.of(request.getPageNum(), |
| | | request.getPageSize())); |
| | | for (ChangeDispatch record : page.getRecords()) { |
| | | Order byId = orderService.getById(record.getOrderId()); |
| | | if (byId!=null){ |
| | | record.setType(byId.getType()); |
| | | |
| | | } |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | |
| | | return R.ok(evaluatePageVOPage); |
| | | } |
| | | |
| | | @GetMapping(value = "/evaluateList1") |
| | | public R<Page<EvaluatePageVO>> evaluateList1(@RequestParam(value = "cityList", required = false) List<String> cityList, |
| | | @RequestParam(value = "userId", required = false) Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<EvaluatePageVO> evaluatePageVOPage = evaluateService.evaluateList1(cityList,userId, Page.of(pageNum, pageSize)); |
| | | return R.ok(evaluatePageVOPage); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据师傅id获取评价列表 |
| | | * |
| | |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.vo.Path; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getReservationPhone, phone) |
| | | .eq(Order::getIsDelete, 0).list()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 订单列表 |
| | |
| | | BigDecimal subsidy = order.getSubsidy(); |
| | | if (null == subsidy) { |
| | | order.setSubsidy(bigDecimal); |
| | | order.setOrderMoney(order.getOrderMoney().add(bigDecimal)); |
| | | } else { |
| | | BigDecimal add = order.getSubsidy().add(bigDecimal); |
| | | order.setSubsidy(add); |
| | | order.setOrderMoney(order.getOrderMoney().add(bigDecimal)); |
| | | } |
| | | return R.ok(orderService.updateById(order)); |
| | | } |
| | |
| | | public R<Boolean> generateNewOrder(@RequestBody Order order) { |
| | | return R.ok(orderService.save(order)); |
| | | } |
| | | |
| | | @PostMapping(value = "/queryIdsBycode") |
| | | public R<List<Integer>> queryIdsBycode(@RequestBody List<String> cityList) { |
| | | List<Integer> collect = orderService.lambdaQuery().eq(BaseEntity::getIsDelete,0).in(Order::getCityCode, cityList).list().stream().map(Order::getUserId).collect(Collectors.toList()); |
| | | return R.ok(collect); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 更改订单信息 |
| | |
| | | order.setReservationName(orderRequest.getReservationName()); |
| | | order.setReservationPhone(orderRequest.getReservationPhone()); |
| | | order.setReservationAddress(orderRequest.getReservationAddress()); |
| | | |
| | | order.setTime(orderRequest.getTime()); |
| | | order.setAcceptTime(orderRequest.getAcceptTime()); |
| | | // 师傅信息 |
| | |
| | | order.setCancelReason(orderRequest.getCancelReason()); |
| | | order.setApplyReason(orderRequest.getApplyReason()); |
| | | order.setIsEvaluate(Constants.ZERO); |
| | | order.setCityCode(orderRequest.getCityCode()); |
| | | order.setOrderMoney(orderRequest.getOrderMoney()); |
| | | return R.ok(orderService.save(order)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "订单列表-新增订单", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/edit") |
| | | public R<Boolean> edit(@RequestBody OrderRequest orderRequest) { |
| | | Order order = orderService.getById(orderRequest.getOrderId()); |
| | | |
| | | |
| | | order.setId(orderRequest.getOrderId()); |
| | | order.setCity(orderRequest.getCity()); |
| | | order.setOrderNumber(orderRequest.getOrderNumber()); |
| | | order.setUserId(orderRequest.getUserId()); |
| | | order.setSiteId(orderRequest.getSiteId()); |
| | | order.setSiteName(orderRequest.getSiteName()); |
| | | order.setServeId(orderRequest.getServeId()); |
| | | order.setServeName(orderRequest.getServeName()); |
| | | order.setServePrice(orderRequest.getServePrice()); |
| | | order.setSiteName(orderRequest.getSiteName()); |
| | | // 预约信息 |
| | | order.setReservationName(orderRequest.getReservationName()); |
| | | order.setReservationPhone(orderRequest.getReservationPhone()); |
| | | order.setReservationAddress(orderRequest.getReservationAddress()); |
| | | order.setTime(orderRequest.getTime()); |
| | | order.setAcceptTime(orderRequest.getAcceptTime()); |
| | | // 师傅信息 |
| | | order.setServerId(orderRequest.getServerId()); |
| | | order.setServerName(orderRequest.getServerName()); |
| | | order.setServerPhone(orderRequest.getServerPhone()); |
| | | order.setReservationRemark(orderRequest.getReservationRemark()); |
| | | if ((order.getServerId()!=orderRequest.getServerId())||(order.getTime()!=orderRequest.getTime())) { |
| | | order.setState(1); |
| | | } |
| | | order.setArriveTime(orderRequest.getArriveTime()); |
| | | order.setType(orderRequest.getType()); |
| | | order.setLongitude(orderRequest.getLongitude()); |
| | | order.setLatitude(orderRequest.getLatitude()); |
| | | order.setCompleteTime(orderRequest.getCompleteTime()); |
| | | order.setSubsidy(orderRequest.getSubsidy()); |
| | | order.setIsWithdrawal(orderRequest.getIsWithdrawal()); |
| | | order.setAddress(orderRequest.getAddress()); |
| | | order.setCancelReason(orderRequest.getCancelReason()); |
| | | order.setApplyReason(orderRequest.getApplyReason()); |
| | | order.setIsEvaluate(Constants.ZERO); |
| | | order.setCityCode(orderRequest.getCityCode()); |
| | | order.setOrderMoney(orderRequest.getOrderMoney()); |
| | | return R.ok(orderService.updateById(order)); |
| | | } |
| | | |
| | | |
| | |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @GetMapping(value = "/orderList1") |
| | | public R<Page<Order>> orderList1(@RequestParam("userId") Integer userId, @RequestParam("cityList") List<String> cityList, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<Order> page = orderService.lambdaQuery().eq(Order::getUserId, userId) |
| | | .eq(Order::getIsDelete, 0).in(!cityList.isEmpty(),Order::getCityCode, cityList).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @GetMapping(value = "/workOrderList") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "师傅id", name = "workId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Page<Order>> workOrderList(@RequestParam("workId") Integer workId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<Order> page = orderService.lambdaQuery().eq(Order::getServerId, workId) |
| | | .eq(Order::getIsDelete, 0).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | /** |
| | | * 根据类型获取交易额 |
| | | * |
| | |
| | | * @return 交易额 |
| | | */ |
| | | @ApiOperation(value = "根据类型获取交易额", tags = {"后台-用户管理-用户列表"}) |
| | | @PostMapping(value = "/tradeMoney") |
| | | @PostMapping (value = "/tradeMoney") |
| | | public R<BigDecimal> tradeMoney(@RequestBody MoneyQueryRequest moneyQueryRequest) { |
| | | return R.ok(orderService.tradeMoney(moneyQueryRequest)); |
| | | } |
| | |
| | | public R<OrderDetailVO> orderDetail(@RequestParam("orderId") String orderId) { |
| | | // 订单信息 |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId).eq(Order::getIsDelete, 0).one(); |
| | | order.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | if (order.getAddress()!=null) { |
| | | order.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | } |
| | | // 服务信息(服务备注、上门时间、完成时间、完成所拍现场照片) |
| | | ServeRecord serveRecord = serveRecordService.lambdaQuery().eq(ServeRecord::getOrderId, orderId) |
| | | .eq(ServeRecord::getIsDelete, 0).one(); |
| | |
| | | * |
| | | * @param workerId 师傅id |
| | | */ |
| | | @ApiOperation(value = "代办列表", tags = {"师傅端"}) |
| | | |
| | | |
| | | // ... |
| | | |
| | | @ApiOperation(value = "代办列表", tags ={"师傅端"}) |
| | | @GetMapping(value = "/orderNotHandle") |
| | | public R<List<Order>> orderNotHandle(@RequestParam("workerId") Integer workerId) { |
| | | // 获取当前日期 |
| | | LocalDate today = LocalDate.now(); |
| | | |
| | | // 格式化日期字符串,假设数据库中的日期格式为 yyyy-MM-dd |
| | | String todayStr = today.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | |
| | | QueryWrapper<Order> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("server_id", workerId) |
| | | .in("state", 1, 2) |
| | | .eq("is_delete", Constants.ZERO) |
| | | .eq("DATE(createTime)", todayStr) // 添加这一行来筛选当天的订单 |
| | | .orderByAsc("CASE WHEN topSort IS NULL THEN 1 ELSE 0 END") |
| | | .orderByAsc("topSort"); |
| | | |
| | | return R.ok(orderService.list(wrapper)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 师傅端-订单代办列表 |
| | | */ |
| | |
| | | @RequestParam(value = "applyForTime", required = false) String applyForTime, |
| | | @RequestParam(value = "state", required = false) Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(withdrawService.withdrawPage(nickname, userPhone, applyForTime, state, Page.of(pageNum, pageSize))); |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam(name = "userIds") List<Integer> userIds) { |
| | | return R.ok(withdrawService.withdrawPage(userIds,nickname, userPhone, applyForTime, state, Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | @GetMapping(value = "/withdrawPage1") |
| | | public R<Page<UserWithdrawRecordVO>> withdrawPage1(@RequestParam(value = "cityList", required = false)List<String> cityList,@RequestParam(value = "nickname", required = false) String nickname, |
| | | @RequestParam(value = "userPhone", required = false) String userPhone, |
| | | @RequestParam(value = "applyForTime", required = false) String applyForTime, |
| | | @RequestParam(value = "state", required = false) Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam(name = "userIds") List<Integer> userIds) { |
| | | return R.ok(withdrawService.withdrawPage1(cityList,userIds,nickname, userPhone, applyForTime, state, Page.of(pageNum, pageSize))); |
| | | } |
| | | /** |
| | | * 查看提现记录详情 |
| | | * |
| | |
| | | if (!b) { |
| | | throw new GlobalException("提现失败!"); |
| | | } |
| | | }else { |
| | | Order order = orderService.lambdaQuery() |
| | | .eq(Order::getId, withdraw.getOrderId()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单信息异常!"); |
| | | } |
| | | order.setIsWithdrawal(0); |
| | | orderService.updateById(order); |
| | | } |
| | | update = update && withdrawService.updateById(withdraw); |
| | | return R.ok(update); |
| | |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(withdrawService.withdrawList(userId, Page.of(pageNum, pageSize))); |
| | | } |
| | | @GetMapping(value = "/withdrawList1") |
| | | public R<Page<UserWithdrawRecordVO>> withdrawList1(@RequestParam("cityList") List<String> cityList,@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(withdrawService.withdrawList1(cityList,userId, Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | |
| | | /************************************* 用户端 **************************************************/ |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "用户提交提现申请", tags = {"用户端"}) |
| | | @GetMapping(value = "/confirmWithdrawByUser") |
| | | public R<Boolean> confirmWithdrawByUser(@RequestParam("orderId") String orderId, |
| | | public synchronized R<Boolean> confirmWithdrawByUser(@RequestParam("orderId") String orderId, |
| | | @RequestParam("userId") Integer userId, |
| | | @RequestParam("openId") String openId, |
| | | @RequestParam("userPhone") String userPhone) { |
| | |
| | | @ApiModelProperty("改派状态 (0:未改派 ;1:已改派 ;2:拒绝)") |
| | | @TableField("state") |
| | | private Integer state; |
| | | @ApiModelProperty("订单类型(0:正常订单,1:后台订单(后台订单与用户端、师傅端无联系))") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户提现申请记录表 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-09 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("t_withdraw_detail") |
| | | @ApiModel(value = "WithdrawDetail对象", description = "用户提现申请记录详情表") |
| | | public class WithdrawDetail { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | @TableField(value = "withdraw_id") |
| | | private String withdrawId; |
| | | |
| | | @ApiModelProperty("金额") |
| | | @TableField("money") |
| | | private BigDecimal money; |
| | | |
| | | @ApiModelProperty("状态") |
| | | @TableField("status") |
| | | private String status; |
| | | @ApiModelProperty("商家交易码") |
| | | @TableField("out_batch_no") |
| | | private String outBatchNo; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 Mapper 接口 |
| | |
| | | * @return 分页列表 |
| | | */ |
| | | Page<EvaluatePageVO> evaluateList(@Param("userId") Integer userId, Page<EvaluatePageVO> page); |
| | | Page<EvaluatePageVO> evaluateList1(@Param("cityList") List<String> cityList,@Param("userId") Integer userId, Page<EvaluatePageVO> page); |
| | | |
| | | /** |
| | | * 订单与评价列表 |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.order.entity.Withdraw; |
| | | import com.ruoyi.order.entity.WithdrawDetail; |
| | | import com.ruoyi.order.vo.UserWithdrawRecordVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户提现申请记录表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-09 |
| | | */ |
| | | @Mapper |
| | | public interface WithdrawDetailMapper extends BaseMapper<WithdrawDetail> { |
| | | |
| | | |
| | | } |
| | |
| | | * @param page 分页 |
| | | * @return 分页列表 |
| | | */ |
| | | Page<UserWithdrawRecordVO> withdrawPage(@Param("name") String nickname, @Param("phone") String userPhone, |
| | | Page<UserWithdrawRecordVO> withdrawPage(@Param("userIds") List<Integer> userIds,@Param("name") String nickname, @Param("phone") String userPhone, |
| | | @Param("time") String applyForTime, |
| | | @Param("state") Integer state, Page<UserWithdrawRecordVO> page); |
| | | |
| | | Page<UserWithdrawRecordVO> withdrawPage1(@Param("cityList") List<String> cityList,@Param("userIds") List<Integer> userIds,@Param("name") String nickname, @Param("phone") String userPhone, |
| | | @Param("time") String applyForTime, |
| | | @Param("state") Integer state, Page<UserWithdrawRecordVO> page); |
| | | |
| | | /** |
| | | * 根据所选id导出 |
| | |
| | | * @return 分页列表 |
| | | */ |
| | | Page<UserWithdrawRecordVO> withdrawList(@Param("userId") Integer userId, Page<UserWithdrawRecordVO> page); |
| | | Page<UserWithdrawRecordVO> withdrawList1(@Param("cityList") List<String> cityList,@Param("userId") Integer userId, Page<UserWithdrawRecordVO> page); |
| | | } |
| | |
| | | */ |
| | | @Data |
| | | public class OrderRequest { |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("下单城市") |
| | | private String city; |
| | | |
| | | @ApiModelProperty("城市编码") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | |
| | | @Data |
| | | @ApiModel(value = "OrderRequest对象", description = "用户下单请求参数对象") |
| | | public class UserOrderRequest { |
| | | @ApiModelProperty("城市编号") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | |
| | | import com.ruoyi.order.vo.EvaluatePageVO; |
| | | import com.ruoyi.order.vo.OrderEvaluateVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 服务类 |
| | |
| | | * @return 分页列表 |
| | | */ |
| | | Page<EvaluatePageVO> evaluateList(Integer userId, Page<EvaluatePageVO> page); |
| | | Page<EvaluatePageVO> evaluateList1(List<String> cityList,Integer userId, Page<EvaluatePageVO> page); |
| | | |
| | | /** |
| | | * 订单评价列表 |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.entity.Withdraw; |
| | | import com.ruoyi.order.entity.WithdrawDetail; |
| | | import com.ruoyi.order.entity.WithdrawalSetting; |
| | | import com.ruoyi.order.request.WithdrawExportRequest; |
| | | import com.ruoyi.order.vo.MoneyQueryRequest; |
| | | import com.ruoyi.order.vo.UserWithdrawRecordVO; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户提现申请记录表 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-09 |
| | | */ |
| | | public interface WithdrawDetailService extends IService<WithdrawDetail> { |
| | | |
| | | |
| | | } |
| | |
| | | * @param page 分页 |
| | | * @return 分页列表 |
| | | */ |
| | | Page<UserWithdrawRecordVO> withdrawPage(String nickname, String userPhone, String applyForTime, |
| | | Page<UserWithdrawRecordVO> withdrawPage(List<Integer> userIds,String nickname, String userPhone, String applyForTime, |
| | | Integer state, Page<UserWithdrawRecordVO> page); |
| | | Page<UserWithdrawRecordVO> withdrawPage1(List<String> cityList,List<Integer> userIds,String nickname, String userPhone, String applyForTime, |
| | | Integer state, Page<UserWithdrawRecordVO> page); |
| | | |
| | | |
| | | /** |
| | | * 根据筛选条件查询数据 |
| | |
| | | * @return 分页列表 |
| | | */ |
| | | Page<UserWithdrawRecordVO> withdrawList(Integer userId, Page<UserWithdrawRecordVO> page); |
| | | Page<UserWithdrawRecordVO> withdrawList1(List<String> cityList,Integer userId, Page<UserWithdrawRecordVO> page); |
| | | |
| | | /** |
| | | * 用户端-提交提现申请 |
| | |
| | | import com.ruoyi.order.vo.OrderEvaluateVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 服务实现类 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page<EvaluatePageVO> evaluateList1(List<String> cityList,Integer userId, Page<EvaluatePageVO> page) { |
| | | return baseMapper.evaluateList1(cityList,userId, page); |
| | | } |
| | | |
| | | @Override |
| | | public Page<OrderEvaluateVO> evaluateListByUser(Integer userId, Integer state, Page<OrderEvaluateVO> page) { |
| | | return baseMapper.evaluateListByUser(userId, state, page); |
| | | } |
| | |
| | | order.setUserId(userId); |
| | | order.setReservationName(reservationName); |
| | | order.setReservationPhone(reservationPhone); |
| | | order.setReservationAddress(address); |
| | | order.setReservationAddress(address+cityCode.getData().getName()); |
| | | order.setTime(time); |
| | | order.setReservationRemark(reservationRemark); |
| | | order.setOrderMoney(defaultPrice.add(new BigDecimal(String.valueOf(subsidy)))); |
| | |
| | | return this.save(order); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String orderEstimate(UserOrderRequest userOrderRequest) { |
| | | R<AddressDto> cityCode = userClient.getCityCode(userOrderRequest.getAddressId()); |
| | | R<BigDecimal> servePrice = userClient.getServePrice(userOrderRequest.getServeId(), cityCode.getData().getCityCode()); |
| | | if (servePrice.getData()!=null){ |
| | | userOrderRequest.setDefaultPrice(servePrice.getData()); |
| | | } |
| | | |
| | | |
| | | // 下单参数 |
| | | String orderNumber = userOrderRequest.getOrderNumber(); |
| | |
| | | order.setReservationName(reservationName); |
| | | order.setReservationPhone(reservationPhone); |
| | | if (null == userOrderRequest.getAddressId()) { |
| | | order.setReservationAddress(addressDetail); |
| | | order.setReservationAddress(addressDetail+cityCode.getData().getName()); |
| | | } else { |
| | | order.setReservationAddress(address); |
| | | order.setReservationAddress(address+cityCode.getData().getName()); |
| | | } |
| | | order.setTime(time); |
| | | order.setReservationRemark(reservationRemark); |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.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.common.redis.service.RedisService; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.entity.Withdraw; |
| | | import com.ruoyi.order.entity.WithdrawDetail; |
| | | import com.ruoyi.order.entity.WithdrawalSetting; |
| | | import com.ruoyi.order.mapper.WithdrawDetailMapper; |
| | | import com.ruoyi.order.mapper.WithdrawMapper; |
| | | import com.ruoyi.order.request.WithdrawExportRequest; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.WithdrawDetailService; |
| | | import com.ruoyi.order.service.WithdrawService; |
| | | import com.ruoyi.order.service.WithdrawalSettingService; |
| | | 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; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.Month; |
| | | import java.time.Year; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户提现申请记录表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-09 |
| | | */ |
| | | @Service |
| | | public class WithdrawDetailServiceImpl extends ServiceImpl<WithdrawDetailMapper, WithdrawDetail> implements WithdrawDetailService { |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | import java.io.InputStream; |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.ruoyi.common.core.utils.SnowflakeIdWorker; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.vo.UserDto; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.entity.Withdraw; |
| | | import com.ruoyi.order.entity.WithdrawDetail; |
| | | import com.ruoyi.order.entity.WithdrawalSetting; |
| | | import com.ruoyi.order.mapper.WithdrawMapper; |
| | | import com.ruoyi.order.request.WithdrawExportRequest; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.WithdrawDetailService; |
| | | import com.ruoyi.order.service.WithdrawService; |
| | | import com.ruoyi.order.service.WithdrawalSettingService; |
| | | import com.ruoyi.order.vo.MoneyQueryRequest; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.Month; |
| | | import java.time.Year; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private WithdrawalSettingService withdrawalSettingService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | /** |
| | | * 雪花算法类 |
| | | */ |
| | |
| | | private UserClient userClient; |
| | | |
| | | @Override |
| | | public Page<UserWithdrawRecordVO> withdrawPage(String nickname, String userPhone, String applyForTime, Integer state, Page<UserWithdrawRecordVO> page) { |
| | | Page<UserWithdrawRecordVO> userWithdrawRecordVOPage = baseMapper.withdrawPage(nickname, userPhone, applyForTime, state, page); |
| | | public Page<UserWithdrawRecordVO> withdrawPage(List<Integer> userIds,String nickname, String userPhone, String applyForTime, Integer state, Page<UserWithdrawRecordVO> page) { |
| | | Page<UserWithdrawRecordVO> userWithdrawRecordVOPage = baseMapper.withdrawPage(userIds,nickname, userPhone, applyForTime, state, page); |
| | | |
| | | return userWithdrawRecordVOPage; |
| | | } |
| | | @Override |
| | | public Page<UserWithdrawRecordVO> withdrawPage1(List<String> cityList,List<Integer> userIds,String nickname, String userPhone, String applyForTime, Integer state, Page<UserWithdrawRecordVO> page) { |
| | | Page<UserWithdrawRecordVO> userWithdrawRecordVOPage = baseMapper.withdrawPage1(cityList,userIds,nickname, userPhone, applyForTime, state, page); |
| | | |
| | | return userWithdrawRecordVOPage; |
| | | } |
| | |
| | | } else { |
| | | list = baseMapper.exportList(nickname, userPhone, applyForTime, state); |
| | | } |
| | | for (UserWithdrawRecordVO userWithdrawRecordVO : list) { |
| | | R<UserDto> user = userClient.getUser(userWithdrawRecordVO.getUserId()); |
| | | userWithdrawRecordVO.setUserNo(user.getData().getUserNo()); |
| | | userWithdrawRecordVO.setNickname(user.getData().getNickname()); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | |
| | | if (stateList.contains(Constants.ONE)) { |
| | | throw new GlobalException("当前订单提现申请已通过!"); |
| | | } |
| | | return weChatPay(order.getOrderMoney(), openId); |
| | | |
| | | return weChatPay(order.getOrderMoney(), openId,list.get(0).getId()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | record.setNickname(user.getData().getNickname()); |
| | | record.setProfilePicture(user.getData().getProfilePicture()); |
| | | record.setUserPhone(user.getData().getPhone()); |
| | | record.setUserNo(record.getUserNo()); |
| | | } |
| | | return userWithdrawRecordVOPage; |
| | | } |
| | | |
| | | @Override |
| | | public Page<UserWithdrawRecordVO> withdrawList1(List<String> cityList,Integer userId, Page<UserWithdrawRecordVO> page) { |
| | | Page<UserWithdrawRecordVO> userWithdrawRecordVOPage = baseMapper.withdrawList1(cityList,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()); |
| | | record.setUserNo(user.getData().getUserNo()); |
| | | } |
| | | return userWithdrawRecordVOPage; |
| | | } |
| | |
| | | // 系统审核设置 |
| | | WithdrawalSetting withdrawalSetting = withdrawalSettingService.lambdaQuery().one(); |
| | | Withdraw withdraw = new Withdraw(); |
| | | withdraw.setUserId(userId); |
| | | withdraw.setUserPhone(userPhone); |
| | | withdraw.setApplyForTime(new Date()); |
| | | withdraw.setApplyForMoney(order.getOrderMoney()); |
| | | withdraw.setOrderId(orderId); |
| | | withdraw.setCityCode(order.getCityCode()); |
| | | |
| | | this.save(withdraw); |
| | | // 未开启全局 提现审核,则用户提现不需要后台审核 |
| | | if (Constants.ZERO.equals(withdrawalSetting.getEnableProcess())) { |
| | | // 已通过 |
| | | withdraw.setState(Constants.ONE); |
| | | // 商家微信打款至微信零钱 |
| | | boolean update = weChatPay(order.getOrderMoney(), openId); |
| | | boolean update = weChatPay(order.getOrderMoney(), openId,withdraw.getId()); |
| | | if (!update) { |
| | | throw new GlobalException("交易提现失败,请检查是否绑定微信!"); |
| | | } |
| | |
| | | // 待审核 |
| | | withdraw.setState(Constants.ZERO); |
| | | } |
| | | withdraw.setUserId(userId); |
| | | withdraw.setUserPhone(userPhone); |
| | | withdraw.setApplyForTime(new Date()); |
| | | withdraw.setApplyForMoney(order.getOrderMoney()); |
| | | withdraw.setOrderId(orderId); |
| | | withdraw.setCityCode(order.getCityCode()); |
| | | return this.save(withdraw); |
| | | } |
| | | |
| | | private boolean weChatPay(BigDecimal orderMoney, String openId) { |
| | | |
| | | |
| | | order.setIsWithdrawal(1); |
| | | orderService.updateById(order); |
| | | redisService.deleteObject(orderId); |
| | | |
| | | return this.updateById(withdraw); |
| | | } |
| | | @Resource |
| | | private WithdrawDetailService withdrawDetailService; |
| | | |
| | | private boolean weChatPay(BigDecimal orderMoney, String openId,String withdrawId) { |
| | | if (StringUtils.isBlank(openId)) { |
| | | return false; |
| | | } |
| | | Map<String, Object> postMap = new HashMap<>(8); |
| | | // 小程序 id |
| | | postMap.put(WechatConstants.APP_ID, appId); |
| | | postMap.put(WechatConstants.OUT_BATCH_NO, String.valueOf(UUID.randomUUID()).replaceAll("-", "")); |
| | | // 该笔批量转账的名称 |
| | | postMap.put(WechatConstants.BATCH_NAME, batchName); |
| | | // 转账说明,UTF8编码,最多允许32个字符 |
| | | postMap.put(WechatConstants.BATCH_REMARK, batchName); |
| | | // 转账金额单位为“分”。 总金额 |
| | | postMap.put(WechatConstants.TOTAL_AMOUNT, orderMoney.multiply(new BigDecimal(Constants.ONE_HUNDRED))); |
| | | // 转账总笔数 |
| | | postMap.put(WechatConstants.TOTAL_NUM, Constants.ONE); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | Map<String, Object> subMap = new HashMap<>(4); |
| | | // 商家明细单号 该商家下唯一 |
| | | // subMap.put("out_detail_no", RandomUtil.randomString(32)) |
| | | subMap.put(WechatConstants.OUT_DETAIL_NO, SNOW_FLAKE_ID_WORKER.nextId()); |
| | | // 转账金额 |
| | | subMap.put(WechatConstants.TRANSFER_AMOUNT, orderMoney); |
| | | // 转账备注 |
| | | subMap.put(WechatConstants.TRANSFER_REMARK, transferRemark); |
| | | // 用户在直连商户应用下的用户标示 |
| | | subMap.put(WechatConstants.OPEN_ID, openId); |
| | | // 大金额需要传入真实姓名 |
| | | /*subMap.put("user_name", |
| | | RsaCryptoUtil.encryptOAEP(userName,WechatPayV3Util.getSaveCertificates(privatekeypath)))*/ |
| | | list.add(subMap); |
| | | postMap.put(WechatConstants.TRANSFER_DETAIL_LIST, list); |
| | | // 使用类加载器获取资源 URL |
| | | ClassPathResource classPathResource = new ClassPathResource("vx/apiclient_key.pem"); |
| | | /*// 获取 resources 目录下的文件路径,假设文件路径为 "resources/data/example.txt" |
| | | String filePath = "resources/data/vx/apiclient_key.pem"; |
| | | File file = new File(filePath); |
| | | // 输出文件的绝对路径 |
| | | String absolutePath = file.getAbsolutePath();*/ |
| | | String result = HttpUtil.postTransBatRequest( |
| | | WechatConstants.WE_CHAT_URL_PRE, |
| | | JSONObject.toJSONString(postMap), |
| | | // 支付证书序列号 |
| | | wechatPayserialNo, |
| | | // 商户号 |
| | | mchId, |
| | | classPathResource.getPath(), WechatConstants.WE_CHAT_URL_SUF); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | /* |
| | | * 成功示例 |
| | | * { |
| | | * "out_batch_no": "plfk2020042013", |
| | | * "batch_id": "1030000071100999991182020050700019480001", |
| | | * "create_time": "2015-05-20T13:29:35.120+08:00" |
| | | * } |
| | | */ |
| | | if (null == jsonObject || null != jsonObject.get(WechatConstants.CREATE_TIME)) { |
| | | //转账成功 |
| | | return Boolean.TRUE; |
| | | } else { |
| | | return Boolean.FALSE; |
| | | |
| | | BigDecimal maxTransferAmount = new BigDecimal("20000"); // 单次转账限额,单位为分 |
| | | int totalTransfers = orderMoney.multiply(new BigDecimal("100")).divide(maxTransferAmount, 0, RoundingMode.UP).intValue(); |
| | | boolean allTransfersSuccessful = true; |
| | | |
| | | for (int i = 0; i < totalTransfers; i++) { |
| | | BigDecimal transferAmount; |
| | | if (i < totalTransfers - 1) { |
| | | transferAmount = maxTransferAmount; |
| | | } else { |
| | | // 最后一笔转账,金额为剩余金额 |
| | | transferAmount = orderMoney.multiply(new BigDecimal("100")).subtract(maxTransferAmount.multiply(new BigDecimal(i))).setScale(0, RoundingMode.DOWN); |
| | | } |
| | | |
| | | Map<String, Object> postMap = new HashMap<>(8); |
| | | postMap.put(WechatConstants.APP_ID, "wx98563d0ec9cf21c8"); |
| | | postMap.put(WechatConstants.OUT_BATCH_NO, String.valueOf(UUID.randomUUID()).replaceAll("-", "")); |
| | | System.err.println("====="+postMap.get(WechatConstants.OUT_BATCH_NO)); |
| | | postMap.put(WechatConstants.BATCH_NAME, "二手回收提现"); |
| | | postMap.put(WechatConstants.BATCH_REMARK, "二手回收提现"); |
| | | postMap.put(WechatConstants.TOTAL_AMOUNT, transferAmount); |
| | | postMap.put(WechatConstants.TOTAL_NUM, Constants.ONE); |
| | | |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | Map<String, Object> subMap = new HashMap<>(4); |
| | | subMap.put(WechatConstants.OUT_DETAIL_NO, String.valueOf(SNOW_FLAKE_ID_WORKER.nextId())); |
| | | subMap.put(WechatConstants.TRANSFER_AMOUNT, transferAmount); |
| | | subMap.put(WechatConstants.TRANSFER_REMARK, "二手回收提现到账"); |
| | | subMap.put(WechatConstants.OPEN_ID, openId); |
| | | list.add(subMap); |
| | | postMap.put(WechatConstants.TRANSFER_DETAIL_LIST, list); |
| | | |
| | | // 使用类加载器获取资源 URL |
| | | // String path = ClassLoader.getSystemResource("/usr/local/vx/apiclient_key.pem").getPath(); |
| | | |
| | | // String result = HttpUtil.postTransBatRequest( |
| | | // WechatConstants.WE_CHAT_URL_PRE, |
| | | // JSONObject.toJSONString(postMap), |
| | | // "7EEA04429B006E12AAA421C002EC48BBEED5BE94", |
| | | // "1665330417", |
| | | // "/usr/local/vx/apiclient_key.pem", WechatConstants.WE_CHAT_URL_SUF); |
| | | String result = HttpUtil.postTransBatRequest( |
| | | WechatConstants.WE_CHAT_URL_PRE, |
| | | JSONObject.toJSONString(postMap), |
| | | "7EEA04429B006E12AAA421C002EC48BBEED5BE94", |
| | | "1665330417", |
| | | "D:\\study\\JiaDianHuiShou\\ruoyi-service\\ruoyi-order\\src\\main\\java\\com\\ruoyi\\order\\vx\\apiclient_key.pem", WechatConstants.WE_CHAT_URL_SUF); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | if (jsonObject.containsKey(WechatConstants.CREATE_TIME)) { |
| | | // 转账成功 |
| | | //保存转账明细 |
| | | WithdrawDetail withdrawDetail = new WithdrawDetail(); |
| | | withdrawDetail.setWithdrawId(withdrawId); |
| | | withdrawDetail.setMoney(transferAmount); |
| | | withdrawDetail.setOutBatchNo((String) postMap.get(WechatConstants.OUT_BATCH_NO)); |
| | | withdrawDetailService.save(withdrawDetail); |
| | | |
| | | |
| | | } else { |
| | | allTransfersSuccessful = false; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return allTransfersSuccessful; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据当前月份获取当前季度的开始月份 |
| | | */ |
New file |
| | |
| | | package com.ruoyi.order.task; |
| | | |
| | | |
| | | import com.ruoyi.order.entity.WithdrawDetail; |
| | | import com.ruoyi.order.service.WithdrawDetailService; |
| | | import com.ruoyi.order.vx.GetTransferBatchByOutNo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 定时任务工具类 |
| | | */ |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | @Resource |
| | | private WithdrawDetailService withdrawDetailService; |
| | | |
| | | |
| | | /** |
| | | * 每隔一分钟去处理的定时任务 |
| | | */ |
| | | @Scheduled(fixedRate = 10000 * 60) |
| | | public void taskMinute(){ |
| | | try { |
| | | |
| | | List<WithdrawDetail> list = withdrawDetailService.lambdaQuery().ne(WithdrawDetail::getStatus, "SUCCESS").ne(WithdrawDetail::getStatus, "FAIL").list(); |
| | | |
| | | for (WithdrawDetail withdrawDetail : list) { |
| | | String s = GetTransferBatchByOutNo.checkStatus(withdrawDetail.getOutBatchNo()); |
| | | if (s.equals("SUCCESS")) { |
| | | withdrawDetail.setStatus("SUCCESS"); |
| | | withdrawDetailService.updateById(withdrawDetail); |
| | | //执行订单提现成功,增加提现成功金额 |
| | | //查询订单 |
| | | |
| | | //增加已提现金额 |
| | | |
| | | |
| | | } else if (s.equals("FAIL")) { |
| | | withdrawDetail.setStatus("FAIL"); |
| | | withdrawDetailService.updateById(withdrawDetail); |
| | | }else { |
| | | withdrawDetail.setStatus(s); |
| | | withdrawDetailService.updateById(withdrawDetail); |
| | | } |
| | | |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("城市列表") |
| | | private List<String> cityList; |
| | | @ApiModelProperty("服务ids") |
| | | private List<Integer> servIds ; |
| | | @ApiModelProperty(value = "订单类型0:正常订单,1:后台订单") |
| | | private Integer type ; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vx; |
| | | |
| | | import com.wechat.pay.java.core.Config; |
| | | import com.wechat.pay.java.core.RSAAutoCertificateConfig; |
| | | import com.wechat.pay.java.service.transferbatch.TransferBatchService; |
| | | import com.wechat.pay.java.service.transferbatch.model.GetTransferBatchByOutNoRequest; |
| | | import com.wechat.pay.java.service.transferbatch.model.TransferBatchEntity; |
| | | |
| | | public class GetTransferBatchByOutNo { /** 商户号 */ |
| | | public static String merchantId = "1665330417"; /** 商户API私钥路径 */ |
| | | public static String privateKeyPath = |
| | | "/usr/local/vx/apiclient_key.pem"; /** 商户证书序列号 */ |
| | | public static String merchantSerialNumber = |
| | | "7EEA04429B006E12AAA421C002EC48BBEED5BE94"; /** 商户APIV3密钥 */ |
| | | public static String apiV3Key = "TA2npSNWmS0GcB0tFFRWA94rm1M0iSFs"; |
| | | public static TransferBatchService service; |
| | | public static String checkStatus(String outBatchNo) { |
| | | Config config = new RSAAutoCertificateConfig.Builder() |
| | | .merchantId(merchantId) |
| | | .privateKeyFromPath(privateKeyPath) |
| | | .merchantSerialNumber(merchantSerialNumber) |
| | | .apiV3Key(apiV3Key) |
| | | .build(); |
| | | service = new TransferBatchService.Builder().config(config).build(); |
| | | GetTransferBatchByOutNoRequest request = |
| | | new GetTransferBatchByOutNoRequest(); |
| | | request.setOutBatchNo(outBatchNo); |
| | | request.setNeedQueryDetail(false); |
| | | request.setOffset(0); |
| | | request.setLimit(20); |
| | | // request.setDetailStatus("FAIL"); |
| | | TransferBatchEntity response = service.getTransferBatchByOutNo(request); |
| | | return response.getTransferBatch().getBatchStatus(); |
| | | } |
| | | } |
New file |
| | |
| | | -----BEGIN PRIVATE KEY----- |
| | | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDC6hWEJye0tkXg |
| | | 31OxanmJ4dyw0KtRdCtNGlGC0dLst7HPN6wFGp5SR3ePKHTSoA3OpO6CrlM4LPMv |
| | | b+YudmWQoOi0lq2S50bT1dqo6kb6mGYWrBY6rB/2Qm7B7hLycN+ICFF5dxQz5E1u |
| | | 8E4QnvARKs/a8sJSjkhjB2SkeaR00ALYwOCRt0oFe6gojLbHaQp/Ic7FCH5SI4Ne |
| | | kMPI+JWr9ePaBzCKfWVpOlbs+aGGX1/8qg/DrFs+ghtSplNJ/Fuzm32ETVCoQW2a |
| | | t5rCxbHK/WtnMTtNPIeEs0kcJXhEExC+9dTmckIMvZqAaZMiyBKEKd1sujWhL2fS |
| | | zgY9MEE/AgMBAAECggEARQazEfbv186JFqbgM79aRVsoVbHASftS7l44qZR3Fv/C |
| | | x3iWwcP4d3j5vUf9fy3RVfIQyVTFAerhQFZndOLW+w4Q+ws1cwXWjmR4qEM3Wb2o |
| | | wbS1tpeIRiSmpqUSLquMbddMSzDBhdL/HR+a9cXjjKDVtVstOCFNP0y59olhlUAK |
| | | czDmuhDTTD0lVCcqI/+xc+xeY2rrbYpWVJYTtjH3g5R8oELjvJYARgRb6SAjz58a |
| | | q/4iL5g3B903d3p8XPDdGgyd4xhR0Aaf/rTUYpehUjdoEHkovUVefbrB+xKsIxll |
| | | xax3IdQJq6UvAiskflHTwLsu2Now/xXPEM6TRJC+aQKBgQDv8tvDhECqhcsEcj9/ |
| | | PyyJtfeSEbNTGs3dZqzz3ZN5BKt2FNuCkfQm8UYddVdkODSP7OU0pkVL5A/flNP/ |
| | | KTmrHl/81riYdqujwV3UYhKbIBFfgumy8lFHy6u5rrYdaCdGciKNg6xKbiD6wexd |
| | | G2gWAx+Id2QmYPArVwYhu9TFAwKBgQDP9AJ/tQRhFAIdBN1EpTFE84A5ovA7rd4j |
| | | Me/21MDlwAgOyrlidr8gzBA4TcYIfs+2B3zIWC2YxEc+uRcU5exDG++2/nO9ftMm |
| | | Nlkn/YmxcfcQAd75mPZvqLDpAXEsLogI1FyhDBAg/ICk6dM6cmLuPGDHvP5Ttl8i |
| | | SoB4oNwIFQKBgDkelgQgCojNWrvPOqBe+Io7wBiMkCS7X8BRveA7oeyQGQT+CBc4 |
| | | CWfvzaIbmdcorhKI8TMsVZiwTLsLob+/H5RFodH9h2n77fYIhP6W7hjxdFFJR7qq |
| | | hoDR0ipclcvATIEvkFwhuTTqrH0lBtBPQuLikXIaAcRFFUcr6zDClu7jAoGBAInj |
| | | gsSrgvvcCIq1bwLVhpXx4FRXdnQcFe/AbR1+dWniq3Ujd0mS86kLprWu3GFFtPU+ |
| | | gb9WuOVTQOqWUHfK/Z6CJ7Fvh89fCSONZhDeTS8cIna6xt86Ti477RKTojdpo0o3 |
| | | hjRDi25T//laEnXu4yqVXpcS+pEHnI1gWU+jWkMBAoGBAMVzBi/05H8+zusudGMR |
| | | UWZaVQ0bLtH1ePF7dgDxiEXeAg7Xp2LWxH4jABSwIhyAMApucZKOXPILwPNQBW47 |
| | | zUFB21xK39mFvZOe8UKxLtGKnrNlGtVFWvnJrKPQd+c4r2eCpXUk0QHr1SoNekVq |
| | | VNSUH+BwA3mGKhUqbJquhQZn |
| | | -----END PRIVATE KEY----- |
| | |
| | | <id column="id" property="id"/> |
| | | <result column="worker_id" property="workerId"/> |
| | | <result column="worker_name" property="workerName"/> |
| | | <result column="type" property="type"/> |
| | | <result column="apply_reason" property="applyReason"/> |
| | | <result column="apply_time" property="applyTime"/> |
| | | <result column="state" property="state"/> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="queryPageList" resultMap="BaseResultMap"> |
| | | select c.*, o.createTime as orderTime |
| | | select c.*, o.createTime as orderTime,o.type as type |
| | | from sys_change_dispatch c |
| | | left join t_order o on c.order_id = o.id |
| | | <where> |
| | |
| | | <where> |
| | | e.is_delete = 0 |
| | | and o.is_delete = 0 |
| | | <if test="data.cityList != null and data.cityList.size() != 0"> |
| | | <if test="data.userIdList != null and data.userIdList.size() != 0"> |
| | | and o.user_id in |
| | | <foreach collection="data.userIdList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | |
| | | left join t_order o on e.order_id = o.id |
| | | where e.is_delete = 0 |
| | | and o.is_delete = 0 |
| | | <if test="userId != null"> |
| | | and e.user_id = #{userId} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="evaluateList1" resultMap="pageMap"> |
| | | select e.*, o.reservation_name, o.order_number, o.server_name, o.server_phone |
| | | from t_evaluate e |
| | | left join t_order o on e.order_id = o.id |
| | | where e.is_delete = 0 |
| | | and o.is_delete = 0 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and o.city_code in |
| | | <foreach collection="cityList" item="city" open="(" separator="," close=")"> |
| | | #{city} |
| | | </foreach> |
| | | </if> |
| | | <if test="userId != null"> |
| | | and e.user_id = #{userId} |
| | | </if> |
| | | |
| | | order by e.createTime desc |
| | | </select> |
| | | |
| | | <resultMap id="evaluateMap" type="com.ruoyi.order.vo.OrderEvaluateVO"> |
| | |
| | | o.is_evaluate, |
| | | e.content, |
| | | e.star_rating, |
| | | e.createTime as createTime, |
| | | o.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> |
| | | o.user_id = #{userId} and e.user_id = #{userId} |
| | | o.user_id = #{userId} |
| | | <!--订单评价列表只展示已完成订单--> |
| | | and o.state = 3 |
| | | and o.is_delete = 0 and e.is_delete = 0 |
| | | and o.is_delete = 0 and (e.is_delete = 0 or e.is_delete is null) |
| | | <if test="state != -1"> |
| | | and o.is_evaluate = #{state} |
| | | </if> |
| | |
| | | <select id="orderCountByYear" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m') AS dateTime, |
| | | COUNT(*) AS number, |
| | | sum(IFNULL(serve_price, 0)) as totalPrice |
| | | sum(IFNULL(order_money, 0)) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | is_delete = 0 |
| | |
| | | <select id="orderCountByWeek" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m-%d') AS dateTime, |
| | | COUNT(*) AS number, |
| | | sum(IFNULL(serve_price, 0)) as totalPrice |
| | | sum(IFNULL(order_money, 0)) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | is_delete = 0 |
| | |
| | | <select id="orderCountByMonth" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m-%d') AS dateTime, |
| | | COUNT(*) AS number, |
| | | sum(IFNULL(serve_price, 0)) as totalPrice |
| | | sum(IFNULL(order_money, 0)) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | is_delete = 0 |
| | |
| | | <select id="orderCountByToday" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m-%d') AS dateTime, |
| | | COUNT(*) AS number, |
| | | sum(IFNULL(serve_price, 0)) as totalPrice |
| | | sum(IFNULL(order_money, 0)) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | is_delete = 0 |
| | |
| | | from t_order |
| | | <where> |
| | | is_delete = 0 |
| | | and state = 4 |
| | | and state = 3 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city_code in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | |
| | | </select> |
| | | |
| | | <select id="totalMoneyByYear" resultType="java.math.BigDecimal"> |
| | | SELECT sum(serve_price) as totalPrice |
| | | SELECT sum(order_money) as totalPrice |
| | | FROM t_order |
| | | where YEAR(createTime) = YEAR(NOW()) |
| | | and is_delete = 0 |
| | | and state = 4 |
| | | and state = 3 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city_code in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | |
| | | </select> |
| | | |
| | | <select id="totalMoneyByMonth" resultType="java.math.BigDecimal"> |
| | | SELECT sum(serve_price) as totalPrice |
| | | SELECT sum(order_money) as totalPrice |
| | | FROM t_order |
| | | where MONTH(createTime) = MONTH(NOW()) |
| | | AND YEAR(createTime) = YEAR(NOW()) |
| | | and is_delete = 0 |
| | | and state = 4 |
| | | and state = 3 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city_code in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | |
| | | SUM(CASE WHEN o.state = 3 THEN 1 ELSE 0 END) AS completedNumber, |
| | | SUM(CASE WHEN o.state = 6 THEN 1 ELSE 0 END) AS reInvestment |
| | | FROM t_order o |
| | | WHERE o.is_delete = 0 |
| | | WHERE o.is_delete = 0 and DATE(o.createTime) = DATE(NOW()) |
| | | and o.server_id is not null |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and o.city in |
| | | and o.city_code in |
| | | <foreach collection="cityList" item="city" open="(" separator="," close=")"> |
| | | #{city} |
| | | </foreach> |
| | |
| | | from t_order o |
| | | <where> |
| | | o.is_delete = 0 |
| | | |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | |
| | | and o.city like concat('%', #{data.cityName}, '%') |
| | | </if> |
| | | <if test="data.cityList != null and data.cityList.size() != 0"> |
| | | and o.city in |
| | | and o.city_code in |
| | | <foreach collection="data.cityList" item="c" open="(" separator="," close=")"> |
| | | #{c} |
| | | </foreach> |
| | | </if> |
| | | <if test="data.servIds != null and data.servIds.size() != 0"> |
| | | and o.serve_id in |
| | | <foreach collection="data.servIds" item="c" open="(" separator="," close=")"> |
| | | #{c} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="data.reservationName != null and data.reservationName != ''"> |
| | | and o.reservation_name like concat('%', #{data.reservationName}, '%') |
| | | </if> |
| | |
| | | </if> |
| | | <if test="data.state != null"> |
| | | and o.state = #{data.state} |
| | | </if> |
| | | <if test="data.type != null"> |
| | | and o.type = #{data.type} |
| | | </if> |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and o.server_name like concat('%', #{data.workerName}, '%') |
| | |
| | | <where> |
| | | o.is_delete = 0 |
| | | <if test="data.cityList != null and data.cityList.size() != 0"> |
| | | and o.city in |
| | | and o.city_code in |
| | | <foreach collection="data.cityList" item="city" open="(" separator="," close=")"> |
| | | #{city} |
| | | </foreach> |
| | | </if> |
| | | <if test="data.type !=null"> |
| | | and o.type = #{data.type} |
| | | </if> |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | |
| | | COALESCE(SUM(CASE WHEN o.state = 3 THEN 1 ELSE 0 END), 0) AS completed |
| | | FROM t_order o |
| | | where o.server_id = #{workerId} |
| | | and o.is_delete = 0 |
| | | and o.is_delete = 0 AND DATE(o.createTime) = CURDATE() |
| | | </select> |
| | | |
| | | <select id="orderCountByTimeRange" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m-%d') AS dateTime, |
| | | COUNT(*) AS number, |
| | | sum(IFNULL(serve_price, 0)) as totalPrice |
| | | sum(IFNULL(order_money, 0)) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | is_delete = 0 |
| | |
| | | </select> |
| | | |
| | | <select id="orderCountByTimeRangeYear" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y') AS dateTime, COUNT(*) AS number, sum(IFNULL(serve_price, 0)) as totalPrice |
| | | SELECT DATE_FORMAT(createTime, '%Y') AS dateTime, COUNT(*) AS number, sum(IFNULL(order_money, 0)) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | is_delete = 0 |
| | |
| | | <select id="orderCountByTimeRangeMonth" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m') AS dateTime, |
| | | COUNT(*) AS number, |
| | | sum(IFNULL(serve_price, 0)) as totalPrice |
| | | sum(IFNULL(order_money, 0)) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | is_delete = 0 |
| | |
| | | FROM t_withdraw w |
| | | <where> |
| | | w.is_delete = 0 |
| | | <if test="name != null and name != ''"> |
| | | and w.nick_name like concat('%', #{name}, '%') |
| | | <if test="userIds != null and userIds.size() != 0"> |
| | | and w.user_id in |
| | | <foreach collection="userIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="phone != null and phone != ''"> |
| | | and w.user_phone like concat('%', #{phone}, '%') |
| | | </if> |
| | |
| | | </if> |
| | | </where> |
| | | order by w.createTime desc |
| | | </select> |
| | | |
| | | <select id="withdrawPage1" resultMap="voMap"> |
| | | SELECT * |
| | | FROM t_withdraw w |
| | | <where> |
| | | w.is_delete = 0 |
| | | |
| | | <if test="userIds != null and userIds.size() != 0"> |
| | | and w.user_id in |
| | | <foreach collection="userIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and w.city_code in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="phone != null and phone != ''"> |
| | | and w.user_phone like concat('%', #{phone}, '%') |
| | | </if> |
| | | <if test="time != null and time != ''"> |
| | | and DATE(w.apply_for_time) = #{time} |
| | | </if> |
| | | <if test="state != null"> |
| | | and w.state = #{state} |
| | | </if> |
| | | </where> |
| | | order by w.apply_for_time desc |
| | | </select> |
| | | |
| | | <!--vo类映射--> |
| | |
| | | SELECT sum(w.apply_for_money) |
| | | FROM t_withdraw w |
| | | <where> |
| | | w.is_delete = 0 |
| | | w.is_delete = 0 and w.state = 1 |
| | | <if test="start != null and start != ''"> |
| | | and w.createTime <![CDATA[ >= ]]> #{start} |
| | | </if> |
| | |
| | | FROM t_withdraw w |
| | | <where> |
| | | YEAR(w.createTime) = YEAR(NOW()) |
| | | and w.is_delete = 0 |
| | | <!--<if test="cityList != null and cityList.size() != 0"> |
| | | and u.city in |
| | | and w.is_delete = 0 and w.state = 1 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and w.city_code in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if>--> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | FROM t_withdraw w |
| | | <where> |
| | | YEAR(w.createTime) = YEAR(NOW()) |
| | | AND YEAR(w.createTime) = YEAR(NOW()) |
| | | and w.is_delete = 0 |
| | | <!--<if test="cityList != null and cityList.size() != 0"> |
| | | and u.city in |
| | | AND MONTH(w.createTime) = MONTH(NOW()) |
| | | and w.is_delete = 0 and w.state = 1 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and w.city_code in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if>--> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="withdrawList1" resultMap="voMap"> |
| | | SELECT * |
| | | FROM t_withdraw w |
| | | <where> |
| | | w.is_delete = 0 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and w.city_code in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="userId != null and userId != ''"> |
| | | and w.user_id = #{userId} |
| | | </if> |
| | | </where> |
| | | order by w.apply_for_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | public R<ServeDetailVO> serveDetail(@RequestParam String serveId) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | recoveryServe.setIsCollect(Boolean.FALSE); |
| | | |
| | | // 获取服务分类 |
| | | Integer classifyId = recoveryServe.getClassifyId(); |
| | | RecoveryClassify classify = recoveryClassifyService.lambdaQuery() |
| | | .eq(RecoveryClassify::getId, classifyId).one(); |
| | | if (classify.getSupClassify().equals(Constants.TRADE_IN)) { |
| | | recoveryServe.setType(Constants.ZERO); |
| | | } else { |
| | | recoveryServe.setType(Constants.ONE); |
| | | } |
| | | |
| | | |
| | | return R.ok(new ServeDetailVO(recoveryServe, null)); |
| | | } |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | |
| | | import com.ruoyi.admin.api.feignClient.AdminClient; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.RedisConstants; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | 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.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.entity.*; |
| | | 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 com.ruoyi.user.service.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "订单列表-更改订单提现状态", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/getUser") |
| | | public R<UserDto> updateWithdrawalState(@RequestParam("userId") Integer userId) { |
| | | |
| | |
| | | AddressDto userDto = new AddressDto(); |
| | | userDto.setCityCode(byId.getCityCode()); |
| | | userDto.setCity(byId.getCity()); |
| | | userDto.setName(byId.getName()); |
| | | return R.ok(userDto); |
| | | |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private RecoveryServePriceService recoveryServePriceService; |
| | | |
| | | @PostMapping(value = "/getServePrice") |
| | | public R<BigDecimal> getServePrice(@RequestParam("serveId") Integer serveId, @RequestParam("cityCode") String cityCode) { |
| | | RecoveryServePrice one = recoveryServePriceService.lambdaQuery().eq(RecoveryServePrice::getRecoveryServeId, serveId).eq(RecoveryServePrice::getCity, cityCode).eq(RecoveryServePrice::getIsDelete, 0).one(); |
| | | if (one==null){ |
| | | return R.ok(null); |
| | | } |
| | | return R.ok(one.getRecoveryPrice()); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用户端-个人中心用户信息 |
| | | */ |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.user.entity.Region; |
| | | import com.ruoyi.user.entity.UserRecipient; |
| | | import com.ruoyi.user.service.RegionService; |
| | | import com.ruoyi.user.service.UserRecipientService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | Region one = regionService.lambdaQuery().eq(Region::getCode, userRecipient.getCityCode()).one(); |
| | | userRecipient.setCity(one.getName()); |
| | | |
| | | userRecipient.setUserId(loginUser.getUserid()); |
| | | // 当前新增收货地址为默认地址时 |
| | | boolean result = recipientService.updateBatchAddress(userRecipient, loginUser.getUserid()); |
| | |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private RegionService regionService; |
| | | /** |
| | | * 修改收货地址 |
| | | * |
| | |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | Region one = regionService.lambdaQuery().eq(Region::getCode, userRecipient.getCityCode()).one(); |
| | | userRecipient.setCity(one.getName()); |
| | | // 当前修改收货地址为默认地址时 |
| | | boolean result = recipientService.updateBatchAddress(userRecipient, loginUser.getUserid()); |
| | | return result && recipientService.updateById(userRecipient) ? R.ok() : R.fail(); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.Withdraw; |
| | | import com.ruoyi.order.api.entity.WithdrawDetailVO; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private WithdrawClient withdrawClient; |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | @GetMapping("/withdrawList") |
| | | @ApiOperation(value = "提现列表", tags = {"用户端-个人中心-提现"}) |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Boolean> confirmWithdraw(@RequestParam String orderId) { |
| | | |
| | | public synchronized R<Boolean> confirmWithdraw(@RequestParam String orderId) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | if (redisService.hasKey(orderId)) { |
| | | return R.repeatedSubmission("请勿重复提交!"); |
| | | } |
| | | redisService.setCacheObject(orderId, "1", 10L, TimeUnit.SECONDS); |
| | | |
| | | return R.ok(withdrawService.confirmWithdraw(orderId, loginUser.getUserid())); |
| | | } |
| | | |
| | |
| | | RegionVo regionVo = new RegionVo(region.getName(), region.getCode()); |
| | | regionVos.add(regionVo); |
| | | } |
| | | map.put(letter, regionVos); |
| | | if (!regionVos.isEmpty()) { |
| | | map.put(letter, regionVos); |
| | | } |
| | | } |
| | | } |
| | | return map; |
| | |
| | | user.setIsDelete(Constants.ZERO); |
| | | this.save(user); |
| | | } else { |
| | | if (user.getOpenId()!=null && !user.getOpenId().equals(openid)){ |
| | | user.setOpenId(openid); |
| | | this.updateById(user); |
| | | } |
| | | Integer state = user.getState(); |
| | | if (state == 0) { |
| | | throw new GlobalException("账号已被禁用,请联系平台管理员。"); |
| | |
| | | if (!orderList.getRecords().isEmpty()) { |
| | | // 总金额 |
| | | totalMoney = orderList.getRecords().stream().map(Order::getOrderMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // 未提现金额 |
| | | undelivered = orderList.getRecords().stream().filter(data -> Constants.ZERO.equals(data.getIsWithdrawal())) |
| | | // 未提现金额withdrawn |
| | | withdrawn = orderList.getRecords().stream().filter(data -> Constants.ZERO.equals(data.getIsWithdrawal())) |
| | | .map(Order::getOrderMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // 已提现金额 |
| | | withdrawn = orderList.getRecords().stream().filter(data -> Constants.ONE.equals(data.getIsWithdrawal())) |
| | | undelivered = orderList.getRecords().stream().filter(data -> Constants.ONE.equals(data.getIsWithdrawal())) |
| | | .map(Order::getOrderMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | } |
| | | withdrawList.setMoneyCount(new WithdrawMoneyVO(totalMoney, undelivered, withdrawn)); |
| | |
| | | withdrawOrder.setServeName(recoveryServe.getServeName()); |
| | | withdrawOrder.setServeDescribe(recoveryServe.getServeDescribe()); |
| | | withdrawOrder.setCover(recoveryServe.getCover()); |
| | | withdrawOrder.setCompleteTime(order.getCompleteTime()); |
| | | withdrawOrder.setCompleteTime(order.getCreateTime()); |
| | | withdrawOrder.setIsWithdrawal(order.getIsWithdrawal()); |
| | | withdrawOrder.setMoney(order.getOrderMoney()); |
| | | if (order.getAddress()!=null) { |
| | | withdrawOrder.setAddress(order.getReservationAddress() + order.getAddress()); |
| | | }else { |
| | | withdrawOrder.setAddress(order.getReservationAddress()); |
| | | } |
| | | list.add(withdrawOrder); |
| | | } |
| | | Page<WithdrawOrderVO> page = new Page<>(); |
| | |
| | | package com.ruoyi.user.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | |
| | | @ApiModelProperty("封面图片") |
| | | private String cover; |
| | | @ApiModelProperty("地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("是否已提现(0:未提现,1:已提现)") |
| | |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-admin</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- RuoYi Common Swagger --> |
| | | <dependency> |
| | |
| | | return R.ok(masterWorkerService.orderNotHandle(loginWorker.getUserid(), longitude, latitude)); |
| | | } |
| | | |
| | | @ApiOperation(value = "下拉框", tags = {"后台-下拉框"}) |
| | | @GetMapping(value = "/workSelect") |
| | | public R<List<MasterWorker>> workSelect() { |
| | | |
| | | List<MasterWorker> list = masterWorkerService.lambdaQuery().eq(MasterWorker::getIsEnable, 1).eq(MasterWorker::getIsDelete, 0).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-订单列表-地图模式 |
| | | */ |
| | |
| | | mw -> Optional.ofNullable(mw.getCover()).orElse(""))); |
| | | for (Order order : orderList) { |
| | | order.setCover(map.get(order.getServeId())); |
| | | order.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | if (order.getAddress()!=null) { |
| | | order.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(dataList); |
| | |
| | | @TableField("city") |
| | | @NotBlank(message = "请选择:服务城市") |
| | | private String city; |
| | | @TableField("city_code") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty("真实姓名") |
| | | @TableField("real_name") |
| | |
| | | orderListVO.setUserId(userid); |
| | | orderListVO.setReservationName(order.getReservationName()); |
| | | orderListVO.setReservationPhone(order.getReservationPhone()); |
| | | orderListVO.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | if (order.getAddress()!=null) { |
| | | orderListVO.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | }else { |
| | | orderListVO.setReservationAddress(order.getReservationAddress()); |
| | | |
| | | } |
| | | orderListVO.setTime(order.getTime()); |
| | | orderListVO.setServerId(order.getServerId()); |
| | | orderListVO.setServerName(order.getServerName()); |
| | |
| | | orderListVO.setUserId(userid); |
| | | orderListVO.setReservationName(order.getReservationName()); |
| | | orderListVO.setReservationPhone(order.getReservationPhone()); |
| | | orderListVO.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | if (order.getAddress()!=null) { |
| | | orderListVO.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | }else { |
| | | orderListVO.setReservationAddress(order.getReservationAddress()); |
| | | |
| | | } |
| | | orderListVO.setTime(order.getTime()); |
| | | orderListVO.setServerId(order.getServerId()); |
| | | orderListVO.setServerName(order.getServerName()); |