| | |
| | | // 判断是否是同一天 |
| | | desc = TimeUtil.getGernalTime(value.getTime(), "yyyy-MM-dd HH:mm:ss"); |
| | | out.value(desc); |
| | | } else |
| | | } else { |
| | | out.value(""); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @return java.lang.String 返回是否可以去支付 |
| | | * @author hxh |
| | | * @description 设置订单号 |
| | | * @date 23:08 2024/6/24 |
| | | * @param: acceptData |
| | | * @param: id 订单ID |
| | | * @param: orderNo 订单号 |
| | | * @param: orderStatus 订单状态:订单已取消/已支付 |
| | | * @return java.lang.String 返回是否可以去支付 |
| | | **/ |
| | | @ResponseBody |
| | | @RequestMapping("setOrderNo") |
| | |
| | | } |
| | | |
| | | try { |
| | | if(!StringUtil.isNullOrEmpty(orderStatus)){ |
| | | if (!StringUtil.isNullOrEmpty(orderStatus)) { |
| | | throw new KeyOrderException(orderStatus); |
| | | } |
| | | DYOrderDto dto = DYOrderApi.getOrderDetail(orderNo); |
| | |
| | | orderUpdate.setOrderType(1); |
| | | orderUpdate.setOrderNo(orderNo); |
| | | if (order.getState() == KeyOrder.STATE_NOT_PROCESS) { |
| | | if (dto.getOrder_status() == DYOrderDto.ORDER_STATUS_CANCELED) { |
| | | if (dto.getOrder_status() == DYOrderDto.ORDER_STATUS_CANCELED) { |
| | | orderUpdate.setState(KeyOrder.STATE_PAY); |
| | | orderUpdate.setStateDesc(dto.getOrder_status_desc()); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | if(order.getUid()!=null) { |
| | | if (order.getUid() != null) { |
| | | WxUserOrderCount countInfo = wxUserOrderCountService.get(order.getUid(), OrderCountTypeEnum.DY_ORDER_PAY, TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyyMMdd")); |
| | | if (countInfo != null) { |
| | | WxUserSettings settings = wxUserSettingService.selectByUid(order.getUid()); |
| | | if (settings.getDyOrderCountPerDay()<=countInfo.getOrderCount()){ |
| | | throw new Exception("今日已达支付次数上限:"+settings.getDyOrderCountPerDay()); |
| | | if (settings.getDyOrderCountPerDay() <= countInfo.getOrderCount()) { |
| | | throw new Exception("今日已达支付次数上限:" + settings.getDyOrderCountPerDay()); |
| | | } |
| | | } |
| | | } |
| | |
| | | orderUpdate.setOrderType(1); |
| | | orderUpdate.setOrderState(dto.getOrder_status()); |
| | | orderUpdate.setOrderNo(orderNo); |
| | | orderUpdate.setExcutePayTime(new Date()); |
| | | keyOrderService.update(orderUpdate); |
| | | order = keyOrderService.selectById(id); |
| | | return JsonUtil.loadTrueResult(gson.toJson(OrderFactory.create(order))); |
| | |
| | | orderUpdate.setOrderState(0); |
| | | orderUpdate.setOrderNo(orderNo); |
| | | orderUpdate.setState(KeyOrder.STATE_REJECT_PAY); |
| | | if (order.getExcutePayTime() == null) { |
| | | orderUpdate.setExcutePayTime(new Date()); |
| | | } |
| | | orderUpdate.setStateDesc(e.getMessage()); |
| | | keyOrderService.update(orderUpdate); |
| | | return JsonUtil.loadFalseResult(e.getMessage()); |
| | |
| | | return JsonUtil.loadFalseResult("没有匹配到订单号"); |
| | | } |
| | | |
| | | if(order.getState()==KeyOrder.STATE_NOT_PROCESS) { |
| | | if (order.getState() == KeyOrder.STATE_NOT_PROCESS) { |
| | | if (!paySuccess) { |
| | | // 支付失败 |
| | | KeyOrder orderUpdate = new KeyOrder(); |
| | |
| | | KeyOrder orderUpdate = new KeyOrder(); |
| | | orderUpdate.setId(id); |
| | | orderUpdate.setState(KeyOrder.STATE_PAY); |
| | | if (order.getPayTime() == null) { |
| | | orderUpdate.setPayTime(new Date()); |
| | | } |
| | | orderUpdate.setStateDesc("支付成功"); |
| | | try { |
| | | keyOrderService.paySuccess(id,"支付成功",TimeUtil.getGernalTime(System.currentTimeMillis(),"yyyyMMdd")); |
| | | keyOrderService.paySuccess(id, "支付成功", TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyyMMdd")); |
| | | } catch (WxOrderCountException e) { |
| | | e.printStackTrace(); |
| | | return JsonUtil.loadFalseResult(e.getMessage()); |
| | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("deleteAll") |
| | | public String deleteAll(AcceptData acceptData,Long uid) { |
| | | public String deleteAll(AcceptData acceptData, Long uid) { |
| | | |
| | | ClientInfo user= clientInfoService.selectByPrimaryKey(uid); |
| | | if(user==null){ |
| | | return JsonUtil.loadFalseResult("用户不存在"); |
| | | } |
| | | ClientInfo user = clientInfoService.selectByPrimaryKey(uid); |
| | | if (user == null) { |
| | | return JsonUtil.loadFalseResult("用户不存在"); |
| | | } |
| | | |
| | | if(user.getRule() != ClientInfo.RULE_ADMIN){ |
| | | return JsonUtil.loadFalseResult("只有管理员才能删除"); |
| | | } |
| | | if (user.getRule() != ClientInfo.RULE_ADMIN) { |
| | | return JsonUtil.loadFalseResult("只有管理员才能删除"); |
| | | } |
| | | |
| | | // 删除24小时之前的数据 |
| | | // keyOrderService.deleteAll(new Date(System.currentTimeMillis() - 24*60*60*1000L)); |