TComplainDealOverSuperServiceImpl.java 5.53 KB
Newer Older
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
package com.zehong.system.service.impl;

import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TComplainDeal;
import com.zehong.system.domain.TComplainDealOverSuper;
import com.zehong.system.mapper.TComplainDealMapper;
import com.zehong.system.mapper.TComplainDealOverSuperMapper;
import com.zehong.system.service.ITComplainDealOverSuperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 燃气投诉处置-超时督办Service业务层处理
 * 
 * @author zehong
 * @date 2024-06-13
 */
@Service
public class TComplainDealOverSuperServiceImpl implements ITComplainDealOverSuperService 
{
    @Autowired
    private TComplainDealOverSuperMapper tComplainDealOverSuperMapper;

    @Autowired
    private TComplainDealMapper tComplainDealMapper;

    /**
     * 查询燃气投诉处置-超时督办
     * 
     * @param complainDealOverSuperId 燃气投诉处置-超时督办ID
     * @return 燃气投诉处置-超时督办
     */
    @Override
    public TComplainDealOverSuper selectTComplainDealOverSuperById(Long complainDealOverSuperId)
    {
        return tComplainDealOverSuperMapper.selectTComplainDealOverSuperById(complainDealOverSuperId);
    }

    /**
     * 查询燃气投诉处置-超时督办列表
     * 
     * @param tComplainDealOverSuper 燃气投诉处置-超时督办
     * @return 燃气投诉处置-超时督办
     */
    @Override
    public List<TComplainDealOverSuper> selectTComplainDealOverSuperList(TComplainDealOverSuper tComplainDealOverSuper)
    {
        return tComplainDealOverSuperMapper.selectTComplainDealOverSuperList(tComplainDealOverSuper);
    }

    /**
     * 新增燃气投诉处置-超时督办
     * 
     * @param tComplainDealOverSuper 燃气投诉处置-超时督办
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor= Exception.class)
    public int insertTComplainDealOverSuper(TComplainDealOverSuper tComplainDealOverSuper)
    {
        tComplainDealOverSuper.setOvertimeSupervision("0");
        tComplainDealOverSuper.setCreateTime(DateUtils.getNowDate());
        tComplainDealOverSuperMapper.insertTComplainDealOverSuper(tComplainDealOverSuper);

        // 只根据id 修改 状态值
        TComplainDeal tComplainDeal = new TComplainDeal();
        tComplainDeal.setComplainDealId(tComplainDealOverSuper.getComplainDealId());
        tComplainDeal.setOvertimeSupervision("0");
        return tComplainDealMapper.updateTComplainDeal(tComplainDeal);
    }

    /**
     * 修改燃气投诉处置-超时督办
     * 
     * @param tComplainDealOverSuper 燃气投诉处置-超时督办
     * @return 结果
     */
    @Override
    public int updateTComplainDealOverSuper(TComplainDealOverSuper tComplainDealOverSuper)
    {

        SysUser user = SecurityUtils.getLoginUser().getUser();
        String deptId = user.getDeptId();

        if (!"-2".equals(deptId)) {
            // 只根据id 修改 状态值
            TComplainDeal tComplainDeal = new TComplainDeal();
            tComplainDeal.setComplainDealId(tComplainDealOverSuper.getComplainDealId());
            if("0".equals(tComplainDealOverSuper.getOvertimeSupervision())) {
                tComplainDealOverSuper.setOvertimeSupervision("1");
            }
            tComplainDeal.setOvertimeSupervision(tComplainDealOverSuper.getOvertimeSupervision());
            tComplainDealMapper.updateTComplainDeal(tComplainDeal);
        }
        return tComplainDealOverSuperMapper.updateTComplainDealOverSuper(tComplainDealOverSuper);
    }

    /**
     * 批量删除燃气投诉处置-超时督办
     * 
     * @param complainDealOverSuperIds 需要删除的燃气投诉处置-超时督办ID
     * @return 结果
     */
    @Override
    public int deleteTComplainDealOverSuperByIds(Long[] complainDealOverSuperIds)
    {
        return tComplainDealOverSuperMapper.deleteTComplainDealOverSuperByIds(complainDealOverSuperIds);
    }

    /**
     * 删除燃气投诉处置-超时督办信息
     * 
     * @param complainDealOverSuperId 燃气投诉处置-超时督办ID
     * @return 结果
     */
    @Override
    public int deleteTComplainDealOverSuperById(Long complainDealOverSuperId)
    {
        return tComplainDealOverSuperMapper.deleteTComplainDealOverSuperById(complainDealOverSuperId);
    }

    /**
     * 查询燃气投诉处置-超时督办列表-根据处置id 和 状态
     * @param tComplainDealOverSuper
     * @return
     */
    @Override
    public TComplainDealOverSuper getOverSuperByComplainDealIdAndStatus(TComplainDealOverSuper tComplainDealOverSuper) {
        return tComplainDealOverSuperMapper.getOverSuperByComplainDealIdAndStatus(tComplainDealOverSuper);
    }

    /**
     * 超时督办确认反馈
     * @param tComplainDealOverSuper s
     */
    @Override
    @Transactional(rollbackFor= Exception.class)
    public int overtimeSupervisionFeedbackConfirmation(TComplainDealOverSuper tComplainDealOverSuper) {

        // 只根据id 修改 状态值
        TComplainDeal tComplainDeal = new TComplainDeal();
        tComplainDeal.setComplainDealId(tComplainDealOverSuper.getComplainDealId());
        tComplainDeal.setOvertimeSupervision(tComplainDealOverSuper.getOvertimeSupervision());
        tComplainDealMapper.updateTComplainDeal(tComplainDeal);

        return tComplainDealOverSuperMapper.updateTComplainDealOverSuper(tComplainDealOverSuper);
    }
}