Merge remote-tracking branch 'origin/master'
| | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @Excel(name = "状态", sort = 5) |
| | | @Excel(name = "状态", sort = 5,readConverterExp = "0=禁用,1=启用") |
| | | private String status; |
| | | /** |
| | | * 创建时间 |
| | |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.log.annotation.Log; |
| | | import com.xiaopeng.common.log.enums.BusinessType; |
| | | import com.xiaopeng.operation.dto.InvitationAddDto; |
| | | import com.xiaopeng.operation.exportExcle.XpInvitationCodeExportExcel; |
| | | import com.xiaopeng.operation.exportExcle.XpWhitelistExportExcel; |
| | | import com.xiaopeng.operation.importExcel.InvitationCodeImportExcel; |
| | |
| | | /** |
| | | * 生成邀请码 |
| | | */ |
| | | @PutMapping("/api/v1/invitation/add") |
| | | @PostMapping("/api/v1/invitation/add") |
| | | @ResponseBody |
| | | @ApiOperation(value = "生成邀请码") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号 多个逗号隔开", name = "phones", dataType = "String", required = true) |
| | | }) |
| | | @Transactional |
| | | public R add(@RequestParam("phones") String phones){ |
| | | return xpInvitationCodeService.add(phones); |
| | | public R add(@RequestBody InvitationAddDto dto){ |
| | | return xpInvitationCodeService.add(dto.getPhones()); |
| | | } |
| | | /** |
| | | * 解绑 |
| | |
| | | @ApiOperation(value = "编辑白名单") |
| | | @Transactional |
| | | public R edit(@Validated @RequestBody WhitelistEditDto dto) { |
| | | if (!StringUtils.hasLength(dto.getAccount())) { |
| | | return R.fail("请输入账号"); |
| | | } |
| | | SysUser sysUser = tokenService.getLoginUser().getSysUser(); |
| | | XpWhitelist xpWhitelist = new XpWhitelist(); |
| | | BeanUtils.copyProperties(dto, xpWhitelist); |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "邀请码生成InvitationAddDto") |
| | | public class InvitationAddDto implements Serializable { |
| | | |
| | | @NotBlank(message = "手机号不能为空") |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phones; |
| | | |
| | | } |
| | |
| | | if (!PhoneUtil.isPhone(dto.getAccount())) { |
| | | throw new ServiceException("以下帐号格式不正确:", I18nKeyConstant.ACCOUNT_FORMAT_ERROR, new Object[]{dto.getAccount()}); |
| | | } |
| | | XpWhitelist old = this.lambdaQuery() |
| | | .eq(XpWhitelist::getAccount, dto.getAccount()) |
| | | .ne(XpWhitelist::getId, dto.getId()) |
| | | .last("limit 1").one(); |
| | | if (old != null) { |
| | | return R.fail("该账号已存在"); |
| | | } |
| | | XpWhitelist whitelist = this.getById(dto.getId()); |
| | | |
| | | StringBuilder operationContent = new StringBuilder("编辑账号:"); |
| | |
| | | count = fivePushTime / 3; |
| | | processPushOrder(quoteName, count, uid, split, orderNo, xpTradingStrategy, distance, duration, planRule); |
| | | |
| | | // 最终没找到车 |
| | | // redisService.popFirstElement(quoteName); |
| | | |
| | | // 取消订单 |
| | | R<XpOrder> xpOrderR = xpOrderClient.queryOrderById(Long.valueOf(orderId)); |
| | | if(xpOrderR.getCode()==200){ |
| | | if (xpOrderR.getData().getStatus()==1) { |
| | | if (xpOrderR.getCode() == 200) { |
| | | if (xpOrderR.getData().getStatus() == 1) { |
| | | xpOrderClient.cancelOrder(orderId); |
| | | |
| | | // 最终没找到车 |
| | | redisService.popFirstElement(quoteName); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | @SneakyThrows |
| | | private void processPushOrder(String quoteName, int count, String uid, String[] split, String orderNo, XpTradingStrategy xpTradingStrategy, String distance, String duration, String planRule) { |
| | | // 卡住3秒 |
| | | Thread.sleep(3000); |
| | | System.out.println("进入推单环环节"); |
| | | if (count == 0) { |
| | | count = 1; |