package com.xzx.gc.user.service; import com.xzx.gc.entity.CityPartner; import com.xzx.gc.entity.CoreUser; import com.xzx.gc.entity.PartnerBank; import com.xzx.gc.model.admin.MoneyModel; import com.xzx.gc.model.admin.XzxPartnerBankModel; import com.xzx.gc.user.mapper.PartnerBankMapper; import com.xzx.gc.user.mapper.PayRequestMapper; import com.xzx.gc.util.SessionUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service @Transactional public class PartnerBankService { @Autowired private PartnerBankMapper partnerBankMapper; @Autowired private CityPartnerService cityPartnerService; @Autowired private SessionUtil platformService; @Autowired private PayRequestMapper payRequestMapper; public String queryByBankNo(String bankNo,String id){ return partnerBankMapper.queryByBankNo(bankNo,id); } public List queryByBankList(){ CoreUser user = platformService.getCurrentUser(); return partnerBankMapper.queryByBankList(user.getId()+""); } public XzxPartnerBankModel queryBankCardById(XzxPartnerBankModel model){ MoneyModel p = new MoneyModel(); p.setPayOrderId(model.getPayOrderId()); MoneyModel moneyModel = payRequestMapper.queryMoney(p); String accountNo = moneyModel.getAccountId(); XzxPartnerBankModel model1 = partnerBankMapper.queryBankByAccount(accountNo); CityPartner partner = cityPartnerService.queryById(model1.getPartnerId()); model1.setMoney(moneyModel.getMoney()); model1.setPayImg(moneyModel.getPayImg()); model1.setPayTime(moneyModel.getPayTime()); model1.setPartnerType(partner.getPartnerType()); return model1; } public boolean update(PartnerBank bank) { return partnerBankMapper.updateByPrimaryKeySelective(bank)>0?true:false; } public PartnerBank queryById(Integer id) { return partnerBankMapper.selectByPrimaryKey(id); } public boolean save(PartnerBank bank) { return partnerBankMapper.insertSelective(bank)>0?true:false; } }