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
package com.dy.pipIrrRemote.monitor.p202404V201.cd92;
 
import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper;
import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper;
import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
import com.dy.pipIrrRemote.monitor.common.ComSv;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.Date;
 
/**
 * @Author: liurunyu
 * @Date: 2025/5/13 08:33
 * @Description
 */
@Slf4j
@Service("cd92Sv")
public class CdSv extends ComSv {
    @Autowired
    protected SeVirtualCardMapper seVirtualCardDao ;
    @Autowired
    protected PrWaterPriceMapper prWaterPriceDao ;
    @Autowired
    protected PrIntakeVcMapper prIntakeVcDao ;
 
    public VoVirtualCard selectClientVtCardById(Long id){
        return seVirtualCardDao.getVcById(id) ;
    }
    public Double selectWaterPrice(){
        return prWaterPriceDao.getPrice() ;
    }
    /**
     * 根据取水口ID获取与之绑定虚拟卡ID
     * @param intakeId
     * @return
     */
    public Long selectVcIdByIntakeId(Long intakeId) {
        return prIntakeVcDao.getVcIdByIntakeId(intakeId);
    }
    /**
     * 设置虚拟卡被占用
     */
    public void setVcUsed(Long id, Long intakeId){
        SeVirtualCard po = new SeVirtualCard() ;
        po.setId(id);
        po.setIntakeId(intakeId);
        po.setInUse((byte)1);
        po.setOpenTime(new Date());
        seVirtualCardDao.updateByPrimaryKeySelective(po);
    }
}