| | |
| | | import com.taoke.autopay.entity.agent.ChannelAgentSettings; |
| | | import com.taoke.autopay.exception.KeyOrderException; |
| | | import com.taoke.autopay.exception.KeyVerifyException; |
| | | import com.taoke.autopay.exception.UserCreditException; |
| | | import com.taoke.autopay.exception.WxOrderCountException; |
| | | import com.taoke.autopay.factory.OrderFactory; |
| | | import com.taoke.autopay.manager.UserCreditManager; |
| | | import com.taoke.autopay.service.*; |
| | | import com.taoke.autopay.service.agent.ChannelAgentService; |
| | | import com.taoke.autopay.service.agent.ChannelAgentSettingService; |
| | |
| | | import com.taoke.autopay.vo.SubmitKeyInfo; |
| | | import com.taoke.autopay.vo.admin.IgnoreAgentOrderSettingVO; |
| | | import net.sf.json.JSONArray; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class KeyOrderServiceImpl implements KeyOrderService { |
| | | |
| | | private Logger loggerDebug= LoggerFactory.getLogger("debugLogger"); |
| | | |
| | | @Resource |
| | | private KeyOrderMapper keyOrderMapper; |
| | |
| | | |
| | | @Resource |
| | | private WxUserService wxUserService; |
| | | |
| | | @Resource |
| | | private UserCreditManager userCreditManager; |
| | | |
| | | |
| | | @Override |
| | |
| | | orderUpdate.setPayTime(new Date()); |
| | | } |
| | | update(orderUpdate); |
| | | // 增加积分 |
| | | try { |
| | | boolean creditEnable = true; |
| | | // 判断代理是否允许增加积分 |
| | | Long agengId = old.getAgentId(); |
| | | if(agengId!=null) { |
| | | ChannelAgentSettings agentSettings = channelAgentSettingService.selectByAgentId(agengId); |
| | | if(agentSettings!=null&&agentSettings.getCreditEnable()!=null) { |
| | | creditEnable =agentSettings.getCreditEnable(); |
| | | } |
| | | } |
| | | if(creditEnable) { |
| | | if (old.getOrderType() == Constant.ORDER_TYPE_DY) { |
| | | userCreditManager.addDYOrderPayRecord(old.getUid(), id); |
| | | } else if (old.getOrderType() == Constant.ORDER_TYPE_KS) { |
| | | userCreditManager.addKSOrderPayRecord(old.getUid(), id); |
| | | } |
| | | } |
| | | |
| | | } catch (UserCreditException e) { |
| | | loggerDebug.error("增加积分出错:"+id, e); |
| | | } |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |