TSupBalStopSupServiceImpl.java 4.58 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2
package com.zehong.system.service.impl;

耿迪迪's avatar
耿迪迪 committed
3
import java.util.Date;
耿迪迪's avatar
耿迪迪 committed
4 5
import java.util.List;
import com.zehong.common.utils.DateUtils;
耿迪迪's avatar
耿迪迪 committed
6
import com.zehong.common.utils.SecurityUtils;
7 8
import com.zehong.system.domain.TSupBalStopSupOprPressLog;
import com.zehong.system.mapper.TSupBalStopSupOprPressLogMapper;
耿迪迪's avatar
耿迪迪 committed
9 10 11 12 13
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TSupBalStopSupMapper;
import com.zehong.system.domain.TSupBalStopSup;
import com.zehong.system.service.ITSupBalStopSupService;
14 15 16
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
耿迪迪's avatar
耿迪迪 committed
17 18 19 20 21 22 23 24 25 26 27 28 29

/**
 * 供需平衡-停气监管Service业务层处理
 * 
 * @author zehong
 * @date 2024-06-21
 */
@Service
public class TSupBalStopSupServiceImpl implements ITSupBalStopSupService 
{
    @Autowired
    private TSupBalStopSupMapper tSupBalStopSupMapper;

30 31 32
    @Resource
    private TSupBalStopSupOprPressLogMapper tSupBalStopSupOprPressLogMapper;

耿迪迪's avatar
耿迪迪 committed
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
    /**
     * 查询供需平衡-停气监管
     * 
     * @param fGasStopId 供需平衡-停气监管ID
     * @return 供需平衡-停气监管
     */
    @Override
    public TSupBalStopSup selectTSupBalStopSupById(Long fGasStopId)
    {
        return tSupBalStopSupMapper.selectTSupBalStopSupById(fGasStopId);
    }

    /**
     * 查询供需平衡-停气监管列表
     * 
     * @param tSupBalStopSup 供需平衡-停气监管
     * @return 供需平衡-停气监管
     */
    @Override
    public List<TSupBalStopSup> selectTSupBalStopSupList(TSupBalStopSup tSupBalStopSup)
    {
        return tSupBalStopSupMapper.selectTSupBalStopSupList(tSupBalStopSup);
    }

    /**
     * 新增供需平衡-停气监管
     * 
     * @param tSupBalStopSup 供需平衡-停气监管
     * @return 结果
     */
    @Override
    public int insertTSupBalStopSup(TSupBalStopSup tSupBalStopSup)
    {
        tSupBalStopSup.setCreateTime(DateUtils.getNowDate());
耿迪迪's avatar
耿迪迪 committed
67
        tSupBalStopSup.setfCompanyInfoId(SecurityUtils.getLoginUser().getUser().getDeptId());
耿迪迪's avatar
耿迪迪 committed
68 69 70 71 72 73 74 75 76 77 78 79 80
        return tSupBalStopSupMapper.insertTSupBalStopSup(tSupBalStopSup);
    }

    /**
     * 修改供需平衡-停气监管
     * 
     * @param tSupBalStopSup 供需平衡-停气监管
     * @return 结果
     */
    @Override
    public int updateTSupBalStopSup(TSupBalStopSup tSupBalStopSup)
    {
        tSupBalStopSup.setUpdateTime(DateUtils.getNowDate());
耿迪迪's avatar
耿迪迪 committed
81 82 83
        if("2".equals(tSupBalStopSup.getfStopProgress())){
            tSupBalStopSup.setfRecoveryGasTime(new Date());
        }
耿迪迪's avatar
耿迪迪 committed
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
        return tSupBalStopSupMapper.updateTSupBalStopSup(tSupBalStopSup);
    }

    /**
     * 批量删除供需平衡-停气监管
     * 
     * @param fGasStopIds 需要删除的供需平衡-停气监管ID
     * @return 结果
     */
    @Override
    public int deleteTSupBalStopSupByIds(Long[] fGasStopIds)
    {
        return tSupBalStopSupMapper.deleteTSupBalStopSupByIds(fGasStopIds);
    }

    /**
     * 删除供需平衡-停气监管信息
     * 
     * @param fGasStopId 供需平衡-停气监管ID
     * @return 结果
     */
    @Override
    public int deleteTSupBalStopSupById(Long fGasStopId)
    {
        return tSupBalStopSupMapper.deleteTSupBalStopSupById(fGasStopId);
    }
耿迪迪's avatar
耿迪迪 committed
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124

    /**
     * 上传停气监管记录
     * @param fGasStopId 停气监管记录主键
     * @return
     */
    @Override
    public int reportSupBalStopSupRecInfo(Long fGasStopId) {
        TSupBalStopSup tSupBalStopSup = new TSupBalStopSup();
        tSupBalStopSup.setfGasStopId(fGasStopId);
        tSupBalStopSup.setfGovUploadStatus("1");
        tSupBalStopSup.setfGovUploadTime(new Date());
        return tSupBalStopSupMapper.updateTSupBalStopSup(tSupBalStopSup);
    }

125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
    /**
     * 改变停气状态
     * @param tSupBalStopSup
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int changeStopStatus(TSupBalStopSup tSupBalStopSup){
        tSupBalStopSup.setUpdateTime(DateUtils.getNowDate());
        if("2".equals(tSupBalStopSup.getfStopProgress())){
            tSupBalStopSup.setfRecoveryGasTime(new Date());
        }
        TSupBalStopSupOprPressLog tSupBalStopSupOprPressLog = new TSupBalStopSupOprPressLog();
        tSupBalStopSupOprPressLog.setfGasStopId(tSupBalStopSup.getfGasStopId());
        tSupBalStopSupOprPressLog.setfStopProgress(tSupBalStopSup.getfStopProgress());
        tSupBalStopSupOprPressLog.setfOprDate(new Date());
        tSupBalStopSupOprPressLogMapper.insertTSupBalStopSupOprPressLog(tSupBalStopSupOprPressLog);
        return tSupBalStopSupMapper.updateTSupBalStopSup(tSupBalStopSup);
    }

耿迪迪's avatar
耿迪迪 committed
145
}