| | |
| | | package com.taoke.autopay.service.impl; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.taoke.autopay.dao.KeyOrderMapper; |
| | | import com.taoke.autopay.dao.WxUserSettingsMapper; |
| | | import com.taoke.autopay.dto.ChannelOrderStatistic; |
| | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public KeyOrder selectByIdForUpdate(String id) { |
| | | return keyOrderMapper.selectByPrimaryKeyForUpdate(id); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public KeyOrder addKeyOrder(SubmitKeyInfo keyInfo, Long uid, String day, Integer orderType, DYOrderDto orderDto) throws KeyOrderException, WxOrderCountException { |
| | | // 判断提交次数是否过量 |
| | | if (uid != null) { |
| | |
| | | order.setOrderNo(orderDto.getOrder_id()); |
| | | } |
| | | |
| | | order.setIp(keyInfo.getIp()); |
| | | if(keyInfo.getIpInfo()!=null) { |
| | | order.setIpInfo(new Gson().toJson(keyInfo.getIpInfo())); |
| | | } |
| | | keyOrderMapper.insertSelective(order); |
| | | |
| | | |
| | | return order; |
| | | } |
| | | |
| | |
| | | public long countAgentId(KeyOrderMapper.DaoQuery query) { |
| | | return keyOrderMapper.countAgentId(query); |
| | | } |
| | | |
| | | @Override |
| | | public long countUserNotDoOrder(Long uid, Date minCreateTime) { |
| | | KeyOrderMapper.DaoQuery daoQuery=new KeyOrderMapper.DaoQuery(); |
| | | daoQuery.uid = uid; |
| | | daoQuery.stateList=Arrays.asList(new Integer[]{KeyOrder.STATE_NOT_PROCESS,KeyOrder.STATE_NOT_PAY}); |
| | | daoQuery.minCreateTime = minCreateTime; |
| | | return keyOrderMapper.count(daoQuery); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void rejectPay(String id, String rejectMsg) { |
| | | KeyOrder keyOrder=new KeyOrder(); |
| | | keyOrder.setId(id); |
| | | keyOrder.setState(KeyOrder.STATE_REJECT_PAY); |
| | | keyOrder.setStateDesc(rejectMsg); |
| | | update(keyOrder); |
| | | } |
| | | } |