| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil saveData(Reassign reassign, Integer uid, Integer type) throws Exception { |
| | | public ResultUtil saveData(Reassign reassign, Integer uid, Integer type, Integer language) throws Exception { |
| | | String content = reassign.getRemark(); |
| | | if(ToolUtil.isNotEmpty(content)){ |
| | | List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null); |
| | |
| | | } |
| | | query = reassignMapper.query(uid, null, reassign.getOrderId(), reassign.getOrderType(), 2); |
| | | if(null != query){ |
| | | return ResultUtil.error("您提交的申请正在处理中"); |
| | | return ResultUtil.error(language == 1 ? "您提交的申请正在处理中" : language == 2 ? "our application is being processed" : "Votre demande est en cours de traitement"); |
| | | } |
| | | |
| | | //获取支付金额 |
| | |
| | | orderLogisticsService.updateById(orderLogistics1); |
| | | break; |
| | | } |
| | | |
| | | //开始推送调度单 |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("orderId", reassign.getOrderId().toString()); |
| | | map.put("orderType", reassign.getOrderType().toString()); |
| | | List<Dispatch> dispatches = dispatchMapper.queryDispatchs(driver.getFranchiseeId() == null ? driver.getCompanyId() : driver.getFranchiseeId(), 1); |
| | | for(Dispatch dispatch : dispatches){ |
| | | jgPushUtil.push(2,"有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | } |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid); |
| | | systemNoticeService.addSystemNotice(2, language == 1 ? "您的改派申请已成功提交,我们会尽快为你处理!" : language == 2 ? "Your reassignment application has been successfully submitted, we will process it for you as soon as possible!" : "Votre demande de réaffectation a été soumise avec succès. Nous la traiterons pour vous dès que possible!", uid); |
| | | |
| | | return resultUtil; |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil saveData_(Reassign reassign, String orderIds, Integer uid, Integer type) throws Exception { |
| | | public ResultUtil saveData_(Reassign reassign, String orderIds, Integer uid, Integer type, Integer language) throws Exception { |
| | | type = null == type ? 2 : type;//现目前微信只支持小程序支付 |
| | | String content = reassign.getRemark(); |
| | | if(ToolUtil.isNotEmpty(content)){ |
| | |
| | | } |
| | | query = reassignMapper.query(uid, null, Integer.valueOf(id), 3, 2); |
| | | if(null != query){ |
| | | return ResultUtil.error("您提交的申请正在处理中"); |
| | | return ResultUtil.error(language == 1 ? "您提交的申请正在处理中" : language == 2 ? "Your application is being processed" : "Votre demande est en cours de traitement"); |
| | | } |
| | | |
| | | reassign.setMoney(aDouble); |
| | |
| | | ids += reassign.getId() + ","; |
| | | } |
| | | ids = ids.substring(0, ids.length() - 1); |
| | | systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid); |
| | | systemNoticeService.addSystemNotice(2, language == 1 ? "您的改派申请已成功提交,我们会尽快为你处理!" : language == 2 ? "Your reassignment application has been successfully submitted, we will process it for you as soon as possible!" : "Votre demande de réaffectation a été soumise avec succès. Nous la traiterons pour vous dès que possible!", uid); |
| | | |
| | | //开始支付 |
| | | if(null != reassign.getPayType()){ |
| | |
| | | } |
| | | resultUtil = resultUtil; |
| | | }else{ |
| | | resultUtil = ResultUtil.error("获取支付信息失败", ""); |
| | | resultUtil = ResultUtil.error(language == 1 ? "获取支付信息失败" : language == 2 ? "Failed to obtain payment information" : "Échec à obtenir les informations de paiement", ""); |
| | | } |
| | | } |
| | | if(reassign.getPayType() == 2){//支付宝 |
| | |
| | | } |
| | | resultUtil = resultUtil; |
| | | }else{ |
| | | resultUtil = ResultUtil.error("获取支付信息失败", ""); |
| | | resultUtil = ResultUtil.error(language == 1 ? "获取支付信息失败" : language == 2 ? "Failed to obtain payment information" : "Échec à obtenir les informations de paiement", ""); |
| | | } |
| | | } |
| | | if(reassign.getPayType() == 3){//余额 |
| | |
| | | query.setPayTime(new Date()); |
| | | reassignMapper.updateById(query); |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "司机改派支付", aDouble, 2, 1, 2, 3, Integer.valueOf(id)); |
| | | transactionDetailsService.saveData(uid, language == 1 ? "司机改派支付" : language == 2 ? "The driver was reassigned to pay" : "Paiement de réaffectation du conducteur", aDouble, 2, 1, 2, 3, Integer.valueOf(id)); |
| | | } |
| | | Double balance = driver.getBalance(); |
| | | if(null == balance || balance < totalMoney){ |
| | | throw new SystemException("账户余额不足"); |
| | | throw new SystemException(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde insuffisant du compte"); |
| | | } |
| | | driver.setBalance(new BigDecimal(balance).subtract(new BigDecimal(totalMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |