xiaoyong931011
2021-08-04 ea868a98b776b9e89db429a195704a1412ca8905
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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<XzxPartnerBankModel> 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;
    }
    
}