111
fei.wang
2025-04-18 a6686570ac48648e2bf2ec93d27272a4473cac08
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
package com.hxzkappboot.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hxzkappboot.mapper.TbWarningMapper;
import com.hxzkappboot.mapper.TbWarnmesMapper;
import com.hxzkappboot.pojo.TbDepartment;
import com.hxzkappboot.pojo.TbWarning;
import com.hxzkappboot.pojo.TbWarnmes;
import com.hxzkappboot.service.TbWarningService;
import com.hxzkappboot.service.TbWarnmesService;
import org.springframework.stereotype.Service;
 
import java.text.SimpleDateFormat;
import java.util.Date;
 
 
@Service
public class TbWarnmesServiceImpl  extends ServiceImpl<TbWarnmesMapper, TbWarnmes> implements TbWarnmesService {
 
    public int updateBumen(TbWarnmes tbFence) {
 
        tbFence.setAddtime(this.gettime());
        return  baseMapper.insert(tbFence);
    }
 
    public String gettime(){
        Date now = new Date();
        // 创建日期格式化对象,设置格式为 "yyyy-MM-dd HH:mm"
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        // 格式化日期对象,输出字符串结果
        String formattedDate = sdf.format(now);
        return formattedDate;
    }
}