Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
# ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/controller/AppFranchiseeController.java
| | |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("0注册协议;1:隐私政策;2:司机操作指导") |
| | | @ApiModelProperty("0注册协议;1:隐私政策;2:司机操作指导;3:服务规则管理") |
| | | @TableField("content_type") |
| | | private Integer contentType; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Prize>> prizeList() { |
| | | public R<List<Prize>> prizeList(Integer serveId) { |
| | | return R.fail("获取奖品列表失败" + cause.getMessage()); |
| | | } |
| | | |
| | |
| | | * @return 奖品列表 |
| | | */ |
| | | @GetMapping(value = "/prize/prizeList") |
| | | R<List<Prize>> prizeList(); |
| | | R<List<Prize>> prizeList(@RequestParam("serveId") Integer serveId); |
| | | |
| | | /** |
| | | * 奖品详情 -- 远程调用 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<String> call(String orderId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> receiving(String orderId, BigDecimal recycleSubsidy) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> changeOrderState(String orderId, Integer state) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/order/batchUpdateTime") |
| | | R<Boolean> batchUpdateTime(@RequestParam("ids")String ids,@RequestParam("arriveTime")String time); |
| | | R<Boolean> batchUpdateTime(@RequestParam("ids")String ids,@RequestParam("time")String time); |
| | | /** |
| | | * 打电话 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/order/call") |
| | | R<String> call(@RequestParam("orderId")String orderId); |
| | | |
| | | /** |
| | | * 领取补贴金 |
| | | * @param orderId |
| | | * @param recycleSubsidy |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/order/receiving") |
| | | R<String> receiving(@RequestParam("orderId")String orderId, @RequestParam("recycleSubsidy")BigDecimal recycleSubsidy); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Franchisee; |
| | | import com.ruoyi.admin.entity.FranchiseeWithdraw; |
| | | import com.ruoyi.admin.entity.RecoveryServe; |
| | | import com.ruoyi.admin.entity.TFranchiseeBalanceChange; |
| | | import com.ruoyi.admin.entity.*; |
| | | import com.ruoyi.admin.request.AuditFranchiseeWithdrawDTO; |
| | | import com.ruoyi.admin.request.FranchiseeWithdrawDTO; |
| | | import com.ruoyi.admin.service.FranchiseeService; |
| | | import com.ruoyi.admin.service.SysUserService; |
| | | import com.ruoyi.admin.service.TFranchiseeBalanceChangeService; |
| | | import com.ruoyi.admin.service.TFranchiseeWithdrawService; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | @Resource |
| | | private TFranchiseeWithdrawService franchiseeWithdrawService; |
| | | |
| | | |
| | | @Resource |
| | | private SysUserService sysUserService; |
| | | |
| | | @PostMapping("/applyWithdraw") |
| | | @ApiOperation(value = "APP-加盟商申请提现", tags = {"提现"}) |
| | |
| | | if (loginUser==null){ |
| | | return R.fail("登录失效"); |
| | | } |
| | | Franchisee franchisee = franchiseeService.getById(loginUser.getUserid()); |
| | | SysUser user = sysUserService.getById(loginUser.getUserid()); |
| | | |
| | | Franchisee franchisee = franchiseeService.getById(user.getFranchiseeId()); |
| | | if (franchisee.getBalance().subtract(dto.getMoney()).compareTo(BigDecimal.ZERO)>=0){ |
| | | BigDecimal subtract = franchisee.getBalance().subtract(dto.getMoney()); |
| | | franchisee.setBalance(subtract); |
| | |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | SysUser user = sysUserService.getById(loginWorker.getUserid()); |
| | | IPage<FranchiseeWithdraw> franchiseeWithdrawList = franchiseeWithdrawService |
| | | .lambdaQuery().eq(FranchiseeWithdraw::getFranchiseeId, loginWorker.getUserid()) |
| | | .lambdaQuery().eq(FranchiseeWithdraw::getFranchiseeId, user.getFranchiseeId()) |
| | | .orderByDesc(FranchiseeWithdraw::getCreateTime) |
| | | .page(Page.of(pageNum, pageSize)); |
| | | return R.ok(franchiseeWithdrawList); |
| | |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | SysUser byId = sysUserService.getById(loginWorker.getUserid()); |
| | | |
| | | LambdaQueryWrapper<FranchiseeWithdraw> franchiseeWithdrawLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | franchiseeWithdrawLambdaQueryWrapper.eq(FranchiseeWithdraw::getFranchiseeId, loginWorker.getUserid()) |
| | | franchiseeWithdrawLambdaQueryWrapper |
| | | .orderByDesc(FranchiseeWithdraw::getCreateTime); |
| | | if (StringUtils.hasLength(franchiseeWithdrawDTO.getFranchiseeName())){ |
| | | List<Integer> ids = franchiseeService.lambdaQuery().like(Franchisee::getName, franchiseeWithdrawDTO.getFranchiseeName()).list() |
| | |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | SysUser byId = sysUserService.getById(loginWorker.getUserid()); |
| | | FranchiseeWithdraw franchiseeWithdraw = franchiseeWithdrawService.getById(auditFranchiseeWithdrawDTO.getId()); |
| | | franchiseeWithdraw.setStatus(auditFranchiseeWithdrawDTO.getStatus()); |
| | | franchiseeWithdraw.setResult(auditFranchiseeWithdrawDTO.getResult()); |
| | | franchiseeWithdraw.setImg(auditFranchiseeWithdrawDTO.getImg()); |
| | | franchiseeWithdraw.setUpdateBy(byId.getNickName()); |
| | | franchiseeWithdraw.setUpdateTime(new Date()); |
| | | franchiseeWithdraw.setUpdateBy(loginWorker.getUsername()); |
| | | franchiseeWithdrawService.updateById(franchiseeWithdraw); |
| | |
| | | orderClient.updateArrivalTime(order.getId(),orderReasinDto.getArriveTime()); |
| | | |
| | | if (order.getState().equals(Constants.SIX) || order.getState().equals(Constants.THREE)) { |
| | | orderClient.updateState(order.getId(), Constants.ONE); |
| | | orderClient.updateState(order.getId(), 7); |
| | | |
| | | //如果是待改派,将上门时间设置为最新的,并且更新再投原因 |
| | | if (order.getState().equals(Constants.SIX)){ |
| | |
| | | if (workIds==null||workIds.isEmpty()){ |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | List<MasterWorker> list = masterWorkerService.lambdaQuery().in(MasterWorker::getId, workIds).eq(name!=null&&name!="",MasterWorker::getRealName,name).eq(cityCode!=null&&cityCode!="", MasterWorker::getCityCode,cityCode).list(); |
| | | List<MasterWorker> list = masterWorkerService.lambdaQuery() |
| | | .in(MasterWorker::getId, workIds) |
| | | .eq(name!=null&&name!="",MasterWorker::getRealName,name) |
| | | .eq(cityCode!=null&&cityCode!=""&&!cityCode.contains("0000"), MasterWorker::getCityCode,cityCode).list(); |
| | | for (MasterWorker masterWorker : list) { |
| | | masterWorker.setLacation(redisService.getCacheObject("work:"+masterWorker.getId()+":")); |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "获师傅", tags = {"后台-订单管理-地图统计"}) |
| | | @PostMapping(value = "/map/line") |
| | | public R<List<OrderByServeRecordVO>> line(Integer id) { |
| | | public R<Map<String,Object>> line(Integer id) { |
| | | |
| | | Map<String,Object> map = new HashMap<>(); |
| | | |
| | | List<OrderByServeRecordVO> list = new ArrayList<>(); |
| | | // 获取当天时间 |
| | | String today = DateUtils.dateTimeNow("yyyy-MM-dd"); |
| | |
| | | } |
| | | list.add(orderByServeRecord); |
| | | } |
| | | return R.ok(list); |
| | | map.put("orderByServeRecordVO", list); |
| | | MasterWorker masterWorker = masterWorkerService.getById(id); |
| | | map.put("masterWorker", masterWorker); |
| | | |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.entity.Prize; |
| | | import com.ruoyi.admin.entity.RecoveryServe; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.PrizeService; |
| | | import com.ruoyi.admin.service.RecoveryServeService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private PrizeService prizeService; |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | |
| | |
| | | * 奖品列表 -- 远程调用 |
| | | */ |
| | | @GetMapping(value = "/prizeList") |
| | | public R<List<Prize>> prizeList() { |
| | | return R.ok(prizeService.lambdaQuery().eq(Prize::getIsDelete, 0) |
| | | .orderByDesc(Prize::getCreateTime).list()); |
| | | public R<List<Prize>> prizeList(@RequestParam("serveId") Integer serveId) { |
| | | List<Prize> list = prizeService.lambdaQuery().eq(Prize::getIsDelete, 0) |
| | | .orderByDesc(Prize::getCreateTime).list(); |
| | | // 查询服务 |
| | | RecoveryServe recoveryServe = recoveryServeService.getById(serveId); |
| | | list.forEach(data -> { |
| | | if(Objects.nonNull(data.getPrizeType()) && data.getPrizeType() == 1){ |
| | | data.setPrizeName("补贴金¥" + recoveryServe.getRecycleSubsidy()); |
| | | } |
| | | }); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R<String> update(@RequestBody RecoveryServeRequest recoveryServeRequest) { |
| | | RecoveryServe serve = recoveryServeRequest.getServe(); |
| | | serve.setId(recoveryServeRequest.getId()); |
| | | serve.setRecycleSubsidy(recoveryServeRequest.getRecycleSubsidy()); |
| | | boolean update = recoveryServeService.updateById(serve); |
| | | // 城市及对应回收价 |
| | | List<RecoveryServePrice> priceList = recoveryServePriceService.lambdaQuery() |
| | |
| | | |
| | | @ApiModelProperty(value = "主键ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "加盟商余额明细记录id") |
| | | @TableField("changeId") |
| | | @TableField("change_id") |
| | | private Integer changeId; |
| | | |
| | | @ApiModelProperty(value = "加盟商id") |
| | | @TableField("franchiseeId") |
| | | @TableField("franchisee_id") |
| | | private Integer franchiseeId; |
| | | @ApiModelProperty(value = "状态1待审核 2已通过 3已驳回") |
| | | @TableField("status") |
| | |
| | | @ApiModelProperty("对应城市code") |
| | | @TableField("city_code") |
| | | private String cityCode; |
| | | @ApiModelProperty("纬度") |
| | | @TableField("worker_lat") |
| | | private String workerLat; |
| | | @ApiModelProperty("经度") |
| | | @TableField("worker_lon") |
| | | private String workerLon; |
| | | @TableField(exist = false) |
| | | private String lacation; |
| | | |
| | |
| | | @TableField("probability") |
| | | private String probability; |
| | | |
| | | @ApiModelProperty("类型 1=补贴金 2=奖品") |
| | | @TableField("prize_type") |
| | | private Integer prizeType; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("默认回收价") |
| | | private BigDecimal defaultPrice; |
| | | |
| | | @ApiModelProperty("回收补贴金") |
| | | private BigDecimal recycleSubsidy; |
| | | @ApiModelProperty("排序权重") |
| | | private Integer sort; |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "打电话", tags = {"师傅端-打电话[2.0]"}) |
| | | @GetMapping(value = "/call") |
| | | public R<String> call(@RequestParam Integer orderId) { |
| | | public R<String> call(@RequestParam("orderId") String orderId) { |
| | | Order order = orderService.getById(orderId); |
| | | if(Objects.isNull(order)){ |
| | | return R.fail("订单不存在"); |
| | | } |
| | | order.setState(2); |
| | | if(order.getState() == 7){ |
| | | order.setState(1); |
| | | orderService.updateById(order); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 领取补贴金 |
| | | */ |
| | | @GetMapping(value = "/receiving") |
| | | public R<String> receiving(@RequestParam("orderId")String orderId, @RequestParam("recycleSubsidy")BigDecimal recycleSubsidy) { |
| | | Order order = orderService.getById(orderId); |
| | | if(Objects.isNull(order)){ |
| | | return R.fail("订单不存在"); |
| | | } |
| | | order.setSubsidy(recycleSubsidy); |
| | | orderService.updateById(order); |
| | | return R.ok(); |
| | | } |
| | |
| | | @ApiModelProperty("再投数量") |
| | | @TableField(exist = false) |
| | | private Integer reInvestment=0; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiModelProperty("待预约数量") |
| | | @TableField(exist = false) |
| | | private Integer pending=0; |
| | | |
| | | @ApiModelProperty("是否为再投单") |
| | | @TableField("is_reinvest") |
| | |
| | | Integer completed = order.getCompleted(); |
| | | Integer canceled = order.getCanceled(); |
| | | Integer reInvestment = order.getReInvestment(); |
| | | int total = toBeDispatched + stayDoorstep + toBeCompleted + completed + canceled + reInvestment; |
| | | Integer pending = order.getPending(); |
| | | int total = toBeDispatched + stayDoorstep + toBeCompleted + completed + canceled + reInvestment + pending; |
| | | return new OrderPageCountVO(total, toBeDispatched, stayDoorstep, |
| | | toBeCompleted, completed, canceled, reInvestment); |
| | | toBeCompleted, completed, canceled, reInvestment,pending); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | @ApiModelProperty("再投订单") |
| | | private Integer reInvestment; |
| | | @ApiModelProperty("待预约数量") |
| | | private Integer pending; |
| | | |
| | | public OrderPageCountVO(Integer total, Integer toBeDispatched, Integer stayDoorstep, Integer toBeCompleted, |
| | | Integer completed, Integer canceled, Integer reInvestment) { |
| | | Integer completed, Integer canceled, Integer reInvestment,Integer pending) { |
| | | this.total = total; |
| | | this.toBeDispatched = toBeDispatched; |
| | | this.stayDoorstep = stayDoorstep; |
| | |
| | | this.completed = completed; |
| | | this.canceled = canceled; |
| | | this.reInvestment = reInvestment; |
| | | this.pending = pending; |
| | | } |
| | | } |
| | |
| | | sum(case when o.state = 2 then 1 end) as toBeCompleted, |
| | | sum(case when o.state = 3 then 1 end) as completed, |
| | | sum(case when o.state = 4 then 1 end) as canceled, |
| | | sum(case when o.state = 6 then 1 end) as reInvestment |
| | | sum(case when o.state = 6 then 1 end) as reInvestment, |
| | | sum(case when o.state = 7 then 1 end) as pending |
| | | from t_order o |
| | | <where> |
| | | o.is_delete = 0 |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | */ |
| | | @GetMapping("/prizeList") |
| | | @ApiOperation(value = "获取奖品列表", tags = {"用户端-订单"}) |
| | | public R<List<Prize>> prizeList() { |
| | | return R.ok(adminClient.prizeList().getData()); |
| | | public R<List<Prize>> prizeList(@RequestParam("serveId") String serveId) { |
| | | return R.ok(adminClient.prizeList(Integer.valueOf(serveId)).getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/allowance") |
| | | @ApiOperation(value = "抽奖获取津贴", tags = {"用户端-订单"}) |
| | | public R<Object> obtainAllowance() { |
| | | return R.ok(orderService.obtainAllowance(adminClient.prizeList().getData())); |
| | | public R<Object> obtainAllowance(@RequestParam("serveId") String serveId) { |
| | | return R.ok(orderService.obtainAllowance(adminClient.prizeList(Integer.valueOf(serveId)).getData())); |
| | | } |
| | | |
| | | /** |
| | |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 领取补贴金 |
| | | * |
| | | */ |
| | | @GetMapping("/receivingSubsidies") |
| | | @ApiOperation(value = "领取补贴金", tags = {"用户端-订单-领取补贴金[2.0]"}) |
| | | public R<Object> receivingSubsidies(@RequestParam("serveId") String serveId,@RequestParam("orderId") String orderId) { |
| | | // 查询补贴金 |
| | | RecoveryServe recoveryServe = recoveryServeService.getById(serveId); |
| | | if (Objects.isNull(recoveryServe)) { |
| | | return R.fail("该服务不存在!"); |
| | | } |
| | | orderClient.receiving(orderId,recoveryServe.getRecycleSubsidy()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiOperation(value = "用户注册协议/用户隐私协议", tags = {"用户端-登录"}) |
| | | @GetMapping(value = "/registerOrAgreement") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "0:用户注册协议、1:用户隐私协议", name = "type", dataType = "Integer", required = true) |
| | | @ApiImplicitParam(value = "0:用户注册协议、1:用户隐私协议;3:服务规则管理", name = "type", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Agreement> registerOrAgreement(@RequestParam Integer type) { |
| | | if (!Constants.ZERO.equals(type) && !Constants.ONE.equals(type)) { |
| | | if (!Constants.ZERO.equals(type) && !Constants.ONE.equals(type) && !Constants.THREE.equals(type)) { |
| | | throw new GlobalException("获取类型异常!"); |
| | | } |
| | | R<Agreement> r = adminClient.agreementPolicy(type); |
| | |
| | | @ApiModelProperty("轮播图片") |
| | | @TableField("rotate") |
| | | private String rotate; |
| | | |
| | | @ApiModelProperty("回收补贴金") |
| | | @TableField("recycle_subsidy") |
| | | private BigDecimal recycleSubsidy; |
| | | @ApiModelProperty("是否收藏") |
| | | @TableField(exist = false) |
| | | private Boolean isCollect; |
| | |
| | | // return update ? R.ok("修改成功!") : R.fail("修改失败!"); |
| | | // } |
| | | |
| | | /** |
| | | * 师傅端-打电话 |
| | | */ |
| | | @ApiOperation(value = "打电话", tags = {"师傅端-打电话[2.0]"}) |
| | | @GetMapping(value = "/workerCall") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "String", required = true), |
| | | }) |
| | | public R<String> workerCall(@RequestParam String orderId) { |
| | | orderClient.call(orderId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |