| | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil saveData(Reassign reassign, Integer uid, Integer type) throws Exception { |
| | | boolean lock = redisUtil.lock(reassign.getOrderId() + "_reassign", 10); |
| | | if(!lock){ |
| | | int num1 = 1; |
| | | while (num1 <= 10){ |
| | | Thread.sleep(3000);//等待3秒 |
| | | lock = redisUtil.lock(reassign.getOrderId() + "_reassign", 10); |
| | | if(lock){ |
| | | break; |
| | | }else{ |
| | | num1++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | try { |
| | | type = null == type ? 2 : type;//现目前微信只支持小程序支付 |
| | | String content = reassign.getRemark(); |
| | | if(ToolUtil.isNotEmpty(content)){ |
| | |
| | | } |
| | | } |
| | | reassign.setRemark(content); |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | Driver driver = driverService.selectById(uid); |
| | | // TODO: 2020/11/12 司机端不控制重复提交(如果重复提交且未支付,直接将之前的数据删除) |
| | | // Reassign query = reassignMapper.query(uid, null, null, null, 1); |
| | |
| | | // } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | redisUtil.unlock(reassign.getOrderId() + "_reassign"); |
| | | } |
| | | return resultUtil; |
| | | } |
| | | |