zhangback
7 天以前 ca412ade3b178fbc8ba0a4b6215a040acdede954
tms/src/main/java/com/ruoyi/tms/service/impl/TmsContractServiceImpl.java
@@ -2,8 +2,14 @@
import java.util.List;
import com.ruoyi.common.enums.SystemDataNoEnum;
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISystemDataNoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import org.springframework.scheduling.annotation.Async;
@@ -33,6 +39,8 @@
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Resource
    private TmsContractMapper tmsContractMapper;
    @Autowired
    ISystemDataNoService systemDataNoService;
    /**
@@ -102,6 +110,13 @@
    @Override
    public int insertTmsContract(TmsContract tmsContract)
    {
        if (StringUtils.isNotEmpty(tmsContract.getAttachmentPath())){
            tmsContract.setUploadedBy(SecurityUtils.getUsername());
            tmsContract.setUploadTime(DateUtils.getNowDate());
        }
        tmsContract.setSystemCode(systemDataNoService.getNoByKey(SystemDataNoEnum.HT));
        tmsContract.setCreateBy(SecurityUtils.getUsername());
        tmsContract.setCreateTime(DateUtils.getNowDate());
        return tmsContractMapper.insertTmsContract(tmsContract);
    }
@@ -128,6 +143,7 @@
    @Override
    public int updateTmsContract(TmsContract tmsContract)
    {
        tmsContract.setUpdateBy(SecurityUtils.getUsername());
        tmsContract.setUpdateTime(DateUtils.getNowDate());
        return tmsContractMapper.updateTmsContract(tmsContract);
    }