| | |
| | | import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; |
| | | import com.github.binarywang.wxpay.exception.WxPayException; |
| | | import com.github.binarywang.wxpay.service.WxPayService; |
| | | import com.ruoyi.common.utils.AliSmsUtil; |
| | | import com.ruoyi.common.utils.OrderUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.VoiceNotifyMain; |
| | | import com.ruoyi.system.dto.AddBuyerCompanyInfoDto; |
| | | import com.ruoyi.system.mapper.TbOrderMapper; |
| | | import com.ruoyi.system.model.*; |
| | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.concurrent.LinkedBlockingQueue; |
| | | import java.util.concurrent.ThreadPoolExecutor; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Autowired |
| | | private TbAccountDetailService accountDetailService; |
| | | |
| | | |
| | | // 自定义线程池 |
| | | private static final ThreadPoolExecutor executor = new ThreadPoolExecutor(2, 5, 1000, TimeUnit.MILLISECONDS,new LinkedBlockingQueue<Runnable>()); |
| | | |
| | | @Override |
| | | public Page<MyPushCompanyListVo> getMyOrderList(MyOrderListQuery query, Long userId) { |
| | |
| | | xmlData); |
| | | // 更新用户订单状态 |
| | | String outTradeNo = notifyResult.getOutTradeNo(); |
| | | TbOrder order = this.getOne(new LambdaQueryWrapper<TbOrder>().eq(TbOrder::getOrderNo, outTradeNo)); |
| | | TbOrder order = this.getOne(new LambdaQueryWrapper<TbOrder>().eq(TbOrder::getOrderNo, outTradeNo).eq(TbOrder::getStatus, 3)); |
| | | |
| | | if (order!=null) { |
| | | order.setStatus(4); |
| | | order.setPayTime(new Date()); |
| | |
| | | order.setShareUserId(user.getInviteId()); |
| | | order.setCommissionPlatform(platformCommissionMoney); |
| | | } |
| | | order.updateById(); |
| | | boolean b = order.updateById(); |
| | | if(b) { |
| | | |
| | | // 生成记录 |
| | | TbAccountDetail tbAccountDetail = new TbAccountDetail(); |
| | | tbAccountDetail.setUserId(company.getUserId()); |
| | | tbAccountDetail.setType(1); |
| | | tbAccountDetail.setCategory(2); |
| | | tbAccountDetail.setStatus(1); |
| | | BigDecimal subtract = order.getPrice().subtract(order.getCommissionPrice()).subtract(order.getCommissionPlatform()); |
| | | tbAccountDetail.setMoney(subtract); |
| | | tbAccountDetail.setOrderId(order.getId()); |
| | | tbAccountDetail.insert(); |
| | | // 生成记录 |
| | | TbAccountDetail tbAccountDetail = new TbAccountDetail(); |
| | | tbAccountDetail.setUserId(company.getUserId()); |
| | | tbAccountDetail.setType(1); |
| | | tbAccountDetail.setCategory(2); |
| | | tbAccountDetail.setStatus(1); |
| | | BigDecimal subtract = order.getPrice().subtract(order.getCommissionPrice()).subtract(order.getCommissionPlatform()); |
| | | tbAccountDetail.setMoney(subtract); |
| | | tbAccountDetail.setOrderId(order.getId()); |
| | | tbAccountDetail.insert(); |
| | | |
| | | // 生成记录 |
| | | TbAccountDetail tbAccountDetail1 = new TbAccountDetail(); |
| | | tbAccountDetail1.setUserId(order.getUserId()); |
| | | tbAccountDetail1.setType(2); |
| | | tbAccountDetail1.setCategory(5); |
| | | tbAccountDetail1.setStatus(2); |
| | | tbAccountDetail1.setMoney(order.getPrice()); |
| | | tbAccountDetail1.setOrderId(order.getId()); |
| | | tbAccountDetail1.insert(); |
| | | // 生成记录 |
| | | TbAccountDetail tbAccountDetail1 = new TbAccountDetail(); |
| | | tbAccountDetail1.setUserId(order.getUserId()); |
| | | tbAccountDetail1.setType(2); |
| | | tbAccountDetail1.setCategory(5); |
| | | tbAccountDetail1.setStatus(2); |
| | | tbAccountDetail1.setMoney(order.getPrice()); |
| | | tbAccountDetail1.setOrderId(order.getId()); |
| | | tbAccountDetail1.insert(); |
| | | |
| | | |
| | | messageService.addMessage("下单成功,请及时发送快递", order.getUserId(),order.getId(),2); |
| | | messageService.addMessage("您发布的订单买家已支付,请尽快处理!", company.getUserId(),order.getId(),1); |
| | | messageService.addMessage("下单成功,请及时发送快递", order.getUserId(), order.getId(), 2); |
| | | messageService.addMessage("您发布的订单买家已支付,请尽快处理!", company.getUserId(), order.getId(), 1); |
| | | |
| | | // 生成办理进度 |
| | | TbSchedule tbSchedule = new TbSchedule(); |
| | | tbSchedule.setOrderId(order.getId()); |
| | | tbSchedule.setText("请及时快递发送所需资料"); |
| | | tbSchedule.setCreateTime(new Date()); |
| | | tbSchedule.setUserId(company.getUserId()); |
| | | tbSchedule.insert(); |
| | | return "<xml> <return_code><![CDATA[SUCCESS]]></return_code> <return_msg><![CDATA[OK]]></return_msg> </xml>"; |
| | | // 生成办理进度 |
| | | TbSchedule tbSchedule = new TbSchedule(); |
| | | tbSchedule.setOrderId(order.getId()); |
| | | tbSchedule.setText("请及时快递发送所需资料"); |
| | | tbSchedule.setCreateTime(new Date()); |
| | | tbSchedule.setUserId(company.getUserId()); |
| | | tbSchedule.insert(); |
| | | |
| | | TbUser user1 = userService.getById(company.getUserId()); |
| | | AliSmsUtil.sendPaySuccessMessageSeller(user1.getPhone()); |
| | | try { |
| | | VoiceNotifyMain.call2(user1.getPhone()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return "<xml> <return_code><![CDATA[SUCCESS]]></return_code> <return_msg><![CDATA[OK]]></return_msg> </xml>"; |
| | | } |
| | | } |
| | | return null; |
| | | |