新增查看页面
This commit is contained in:
@@ -1,16 +1,52 @@
|
||||
package com.jeesite.modules.app.Job;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.modules.app.dao.DailyWeather;
|
||||
import com.jeesite.modules.app.dao.DateInfo;
|
||||
import com.jeesite.modules.app.utils.DateUtils;
|
||||
import com.jeesite.modules.app.utils.LoggerUtils;
|
||||
import com.jeesite.modules.app.utils.WeatherUtils;
|
||||
import com.jeesite.modules.biz.entity.BizCalendarInfo;
|
||||
import com.jeesite.modules.biz.service.BizCalendarInfoService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
@Controller
|
||||
public class appJob {
|
||||
|
||||
|
||||
@Resource
|
||||
private BizCalendarInfoService bizCalendarInfoService;
|
||||
|
||||
|
||||
String API_KEY = "7e6a6422c4b949dd90a5ad3302137b76";
|
||||
|
||||
private String LOCATION = Global.getConfig("biz.weather.Loc", "101010100");
|
||||
|
||||
private static final LoggerUtils logger = LoggerUtils.getInstance();
|
||||
|
||||
/**
|
||||
* 日历定时任务
|
||||
*/
|
||||
@Scheduled(cron = "0 10 2 * * ?")
|
||||
public void initJob() {
|
||||
try {
|
||||
System.out.println("appJob");
|
||||
WeatherUtils weather = new WeatherUtils(API_KEY);
|
||||
DailyWeather todayWeather = weather.getTodayWeather(LOCATION);
|
||||
DateInfo dateInfo = DateUtils.getDateInfo(todayWeather.getDate());
|
||||
BizCalendarInfo calendarInfo = new BizCalendarInfo();
|
||||
calendarInfo.setCalendarDate(todayWeather.getDate());
|
||||
calendarInfo.setWeekDay(dateInfo.getDayOfWeek());
|
||||
calendarInfo.setLunarCalendar(dateInfo.getFullChineseDate());
|
||||
calendarInfo.setIsHoliday(dateInfo.isWeekend() ? 1 : 0);
|
||||
calendarInfo.setDayWeather(todayWeather.getTextDay());
|
||||
calendarInfo.setNightWeather(todayWeather.getTextNight());
|
||||
calendarInfo.setMaxTemperature(todayWeather.getTempMax());
|
||||
calendarInfo.setMinTemperature(todayWeather.getTempMin());
|
||||
calendarInfo.setWindDirection(todayWeather.getWindDirDay());
|
||||
calendarInfo.setWindGrade(todayWeather.getWindScaleDay());
|
||||
bizCalendarInfoService.save(calendarInfo);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.jeesite.modules.app.Service;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.modules.app.dao.DailyWeather;
|
||||
import com.jeesite.modules.app.dao.DateInfo;
|
||||
import com.jeesite.modules.app.utils.DateUtils;
|
||||
import com.jeesite.modules.app.utils.LoggerUtils;
|
||||
import com.jeesite.modules.app.utils.WeatherUtils;
|
||||
import com.jeesite.modules.biz.entity.BizCalendarInfo;
|
||||
import com.jeesite.modules.biz.service.BizCalendarInfoService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MyService {
|
||||
|
||||
|
||||
@Resource
|
||||
private BizCalendarInfoService bizCalendarInfoService;
|
||||
|
||||
String API_KEY = "7e6a6422c4b949dd90a5ad3302137b76";
|
||||
|
||||
private String LOCATION = Global.getConfig("biz.weather.Loc", "101010100");
|
||||
|
||||
private static final LoggerUtils logger = LoggerUtils.getInstance();
|
||||
|
||||
/**
|
||||
* 日历定时任务
|
||||
*/
|
||||
public BizCalendarInfo initTask() {
|
||||
try {
|
||||
WeatherUtils weather = new WeatherUtils(API_KEY);
|
||||
DailyWeather todayWeather = weather.getTodayWeather(LOCATION);
|
||||
DateInfo dateInfo = DateUtils.getDateInfo(todayWeather.getDate());
|
||||
BizCalendarInfo calendarInfo = new BizCalendarInfo();
|
||||
calendarInfo.setCalendarDate(todayWeather.getDate());
|
||||
calendarInfo.setWeekDay(dateInfo.getDayOfWeek());
|
||||
calendarInfo.setLunarCalendar(dateInfo.getFullChineseDate());
|
||||
calendarInfo.setIsHoliday(dateInfo.isWeekend() ? 1 : 0);
|
||||
calendarInfo.setDayWeather(todayWeather.getTextDay());
|
||||
calendarInfo.setNightWeather(todayWeather.getTextNight());
|
||||
calendarInfo.setMaxTemperature(todayWeather.getTempMax());
|
||||
calendarInfo.setMinTemperature(todayWeather.getTempMin());
|
||||
calendarInfo.setWindDirection(todayWeather.getWindDirDay());
|
||||
calendarInfo.setWindGrade(todayWeather.getWindScaleDay());
|
||||
bizCalendarInfoService.save(calendarInfo);
|
||||
return calendarInfo;
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
return new BizCalendarInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,13 @@
|
||||
package com.jeesite.modules.app;
|
||||
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.modules.app.dao.DailyWeather;
|
||||
import com.jeesite.modules.app.Service.MyService;
|
||||
import com.jeesite.modules.app.dao.MyWorkInfo;
|
||||
import com.jeesite.modules.app.utils.DateUtils;
|
||||
import com.jeesite.modules.app.utils.MyUtils;
|
||||
import com.jeesite.modules.app.utils.WeatherUtils;
|
||||
import com.jeesite.modules.biz.entity.BizCalendarSchedule;
|
||||
import com.jeesite.modules.biz.entity.BizListItem;
|
||||
import com.jeesite.modules.biz.entity.BizProjectInfo;
|
||||
import com.jeesite.modules.biz.entity.BizResumeEmployee;
|
||||
import com.jeesite.modules.biz.service.BizCalendarScheduleService;
|
||||
import com.jeesite.modules.biz.service.BizListItemService;
|
||||
import com.jeesite.modules.biz.service.BizProjectInfoService;
|
||||
import com.jeesite.modules.biz.service.BizResumeEmployeeService;
|
||||
|
||||
import com.jeesite.modules.biz.entity.*;
|
||||
import com.jeesite.modules.biz.service.*;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -28,21 +22,26 @@ import java.util.Optional;
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/biz/myWork")
|
||||
public class appStart {
|
||||
|
||||
|
||||
@Resource
|
||||
private MyService myService;
|
||||
@Resource
|
||||
private BizListItemService bizListItemService;
|
||||
|
||||
@Resource
|
||||
private BizProjectInfoService bizProjectInfoService;
|
||||
|
||||
|
||||
@Resource
|
||||
private BizCalendarInfoService bizCalendarInfoService;
|
||||
|
||||
@Resource
|
||||
private BizResumeEmployeeService bizResumeEmployeeService;
|
||||
|
||||
@Resource
|
||||
private BizCalendarScheduleService bizCalendarScheduleService;
|
||||
|
||||
String API_KEY = "7e6a6422c4b949dd90a5ad3302137b76";
|
||||
|
||||
private String LOCATION = Global.getConfig("biz.weather.Loc", "101010100");
|
||||
|
||||
/**
|
||||
* 首页
|
||||
@@ -51,9 +50,16 @@ public class appStart {
|
||||
@ResponseBody
|
||||
public MyWorkInfo list() {
|
||||
User user = UserUtils.getUser();
|
||||
WeatherUtils weather = new WeatherUtils(API_KEY);
|
||||
DailyWeather dailyWeather = weather.getTodayWeather(LOCATION);
|
||||
String weatherText = MyUtils.concatParams("今日", dailyWeather.getTextDay(), ";夜间:", dailyWeather.getTextNight(), ";温度:{", dailyWeather.getTempMin(), "°C 至 ", dailyWeather.getTempMax(), "°C};", MyUtils.getPath(dailyWeather.getWindDirDay(), dailyWeather.getWindScaleDay()), "级");
|
||||
BizCalendarInfo info;
|
||||
BizCalendarInfo calendarInfo = new BizCalendarInfo();
|
||||
calendarInfo.setCalendarDate(DateUtils.getStringDate());
|
||||
List<BizCalendarInfo> infoList = bizCalendarInfoService.findList(calendarInfo);
|
||||
if (infoList.size() > 0) {
|
||||
info = infoList.get(0);
|
||||
} else {
|
||||
info = myService.initTask();
|
||||
}
|
||||
String weatherText = MyUtils.concatParams("今日", info.getDayWeather(), ";夜间:", info.getNightWeather(), ";温度:{", info.getMinTemperature(), "°C 至 ", info.getMaxTemperature(), "°C};", MyUtils.getPath(info.getWindDirection(), info.getWindGrade()), "级");
|
||||
// 日程
|
||||
BizCalendarSchedule schedule = new BizCalendarSchedule();
|
||||
schedule.setParticipantUser(user.getLoginCode());
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.jeesite.modules.app.dao;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class DateInfo implements Serializable {
|
||||
|
||||
private String queryDate; // 查询日期(yyyy-MM-dd)
|
||||
|
||||
// 农历信息字段
|
||||
private String fullChineseDate; // 完整农历(如:二零二六年正月十八)
|
||||
private Integer chineseYear; // 农历年(如:二零二六年)
|
||||
private String chineseMonth; // 农历月(如:正月)
|
||||
private String chineseDay; // 农历日(如:十八)
|
||||
private String chineseZodiac; // 生肖(如:马)
|
||||
|
||||
// 星期/周末状态字段
|
||||
private int dayOfWeekNum; // 星期数字(1=周日,7=周六)
|
||||
private String dayOfWeek; // 中文星期(如:周一)
|
||||
private boolean isWeekend; // 是否为周末
|
||||
private boolean isAdjustWorkday; // 是否为调休工作日
|
||||
|
||||
public DateInfo() {
|
||||
}
|
||||
|
||||
public DateInfo(String queryDate, String fullChineseDate, Integer chineseYear, String chineseMonth, String chineseDay, String chineseZodiac, int dayOfWeekNum, String dayOfWeek, boolean isWeekend, boolean isAdjustWorkday) {
|
||||
// 为成员变量赋值
|
||||
this.queryDate = queryDate;
|
||||
this.fullChineseDate = fullChineseDate;
|
||||
this.chineseYear = chineseYear;
|
||||
this.chineseMonth = chineseMonth;
|
||||
this.chineseDay = chineseDay;
|
||||
this.chineseZodiac = chineseZodiac;
|
||||
this.dayOfWeekNum = dayOfWeekNum;
|
||||
this.dayOfWeek = dayOfWeek;
|
||||
this.isWeekend = isWeekend;
|
||||
this.isAdjustWorkday = isAdjustWorkday;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.jeesite.modules.app.utils;
|
||||
|
||||
import cn.hutool.core.date.ChineseDate;
|
||||
import com.jeesite.modules.app.dao.DateInfo;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 日期工具类 - 支持指定日期查询基础信息、农历、周末状态等
|
||||
* 输入格式:yyyy-MM-dd(如2026-01-26)
|
||||
*/
|
||||
public class DateUtils {
|
||||
|
||||
private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd");
|
||||
private static final String[] CHINESE_WEEK = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"};
|
||||
|
||||
|
||||
private static final LoggerUtils logger = LoggerUtils.getInstance();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static DateInfo getDateInfo(String dateStr) {
|
||||
try {
|
||||
Date targetDate = DATE_FORMATTER.parse(dateStr);
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(targetDate);
|
||||
String queryDate = DATE_FORMATTER.format(targetDate);
|
||||
ChineseDate chineseDate = new ChineseDate(targetDate);
|
||||
String fullChineseDate = chineseDate.toString();
|
||||
Integer chineseYear = chineseDate.getChineseYear();
|
||||
String chineseMonth = chineseDate.getChineseMonth();
|
||||
String chineseDay = chineseDate.getChineseDay();
|
||||
String chineseZodiac = chineseDate.getChineseZodiac();
|
||||
int dayOfWeekNum = calendar.get(Calendar.DAY_OF_WEEK);
|
||||
String dayOfWeek = CHINESE_WEEK[dayOfWeekNum - 1];
|
||||
boolean isWeekend = dayOfWeekNum == Calendar.SUNDAY || dayOfWeekNum == Calendar.SATURDAY;
|
||||
boolean isAdjustWorkday = false;
|
||||
return new DateInfo(
|
||||
queryDate, // 查询日期(yyyy-MM-dd)
|
||||
fullChineseDate, // 完整农历
|
||||
chineseYear, // 农历年
|
||||
chineseMonth, // 农历月
|
||||
chineseDay, // 农历日
|
||||
chineseZodiac, // 生肖
|
||||
dayOfWeekNum, // 星期数字(1=周日,7=周六)
|
||||
dayOfWeek, // 中文星期
|
||||
isWeekend, // 是否为周末
|
||||
isAdjustWorkday // 是否为调休工作日
|
||||
);
|
||||
} catch (Exception e) {
|
||||
return new DateInfo();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String getStringDate() {
|
||||
try {
|
||||
return DATE_FORMATTER.format(new Date());
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.jeesite.modules.biz.dao;
|
||||
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.biz.entity.BizCalendarInfo;
|
||||
|
||||
/**
|
||||
* 日历信息表DAO接口
|
||||
* @author gaoxq
|
||||
* @version 2026-01-26
|
||||
*/
|
||||
@MyBatisDao(dataSourceName="work")
|
||||
public interface BizCalendarInfoDao extends CrudDao<BizCalendarInfo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.jeesite.modules.biz.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 日历信息表Entity
|
||||
*
|
||||
* @author gaoxq
|
||||
* @version 2026-01-26
|
||||
*/
|
||||
@Table(name = "biz_calendar_info", alias = "a", label = "日历信息表信息", columns = {
|
||||
@Column(name = "create_time", attrName = "createTime", label = "记录时间"),
|
||||
@Column(name = "id", attrName = "id", label = "主键", isPK = true),
|
||||
@Column(name = "calendar_date", attrName = "calendarDate", label = "日历日期"),
|
||||
@Column(name = "week_day", attrName = "weekDay", label = "星期"),
|
||||
@Column(name = "lunar_calendar", attrName = "lunarCalendar", label = "农历日期"),
|
||||
@Column(name = "holiday", attrName = "holiday", label = "假日名称"),
|
||||
@Column(name = "is_holiday", attrName = "isHoliday", label = "是否为节假日"),
|
||||
@Column(name = "day_weather", attrName = "dayWeather", label = "今日天气"),
|
||||
@Column(name = "night_weather", attrName = "nightWeather", label = "夜间天气"),
|
||||
@Column(name = "max_temperature", attrName = "maxTemperature", label = "最高温度", isUpdateForce = true),
|
||||
@Column(name = "min_temperature", attrName = "minTemperature", label = "最低温度", isUpdateForce = true),
|
||||
@Column(name = "wind_direction", attrName = "windDirection", label = "风向"),
|
||||
@Column(name = "wind_grade", attrName = "windGrade", label = "风级"),
|
||||
@Column(name = "update_time", attrName = "updateTime", label = "更新时间"),
|
||||
}, orderBy = "a.create_time DESC"
|
||||
)
|
||||
@Data
|
||||
public class BizCalendarInfo extends DataEntity<BizCalendarInfo> implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Date createTime; // 记录时间
|
||||
private String calendarDate; // 日历日期
|
||||
private String weekDay; // 星期
|
||||
private String lunarCalendar; // 农历日期
|
||||
private String holiday; // 假日名称
|
||||
private Integer isHoliday; // 是否为节假日
|
||||
private String dayWeather; // 今日天气
|
||||
private String nightWeather; // 夜间天气
|
||||
private String maxTemperature; // 最高温度
|
||||
private String minTemperature; // 最低温度
|
||||
private String windDirection; // 风向
|
||||
private String windGrade; // 风级
|
||||
private Date updateTime; // 更新时间
|
||||
|
||||
public BizCalendarInfo() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public BizCalendarInfo(String id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.jeesite.modules.biz.service;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.service.CrudService;
|
||||
import com.jeesite.modules.biz.entity.BizCalendarInfo;
|
||||
import com.jeesite.modules.biz.dao.BizCalendarInfoDao;
|
||||
|
||||
/**
|
||||
* 日历信息表Service
|
||||
* @author gaoxq
|
||||
* @version 2026-01-26
|
||||
*/
|
||||
@Service
|
||||
public class BizCalendarInfoService extends CrudService<BizCalendarInfoDao, BizCalendarInfo> {
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param bizCalendarInfo 主键
|
||||
*/
|
||||
@Override
|
||||
public BizCalendarInfo get(BizCalendarInfo bizCalendarInfo) {
|
||||
return super.get(bizCalendarInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param bizCalendarInfo 查询条件
|
||||
* @param bizCalendarInfo page 分页对象
|
||||
*/
|
||||
@Override
|
||||
public Page<BizCalendarInfo> findPage(BizCalendarInfo bizCalendarInfo) {
|
||||
return super.findPage(bizCalendarInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param bizCalendarInfo 查询条件
|
||||
*/
|
||||
@Override
|
||||
public List<BizCalendarInfo> findList(BizCalendarInfo bizCalendarInfo) {
|
||||
return super.findList(bizCalendarInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param bizCalendarInfo 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(BizCalendarInfo bizCalendarInfo) {
|
||||
super.save(bizCalendarInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param bizCalendarInfo 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateStatus(BizCalendarInfo bizCalendarInfo) {
|
||||
super.updateStatus(bizCalendarInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param bizCalendarInfo 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(BizCalendarInfo bizCalendarInfo) {
|
||||
super.delete(bizCalendarInfo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.jeesite.modules.biz.web;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.biz.entity.BizCalendarInfo;
|
||||
import com.jeesite.modules.biz.service.BizCalendarInfoService;
|
||||
|
||||
/**
|
||||
* 日历信息表Controller
|
||||
* @author gaoxq
|
||||
* @version 2026-01-26
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/biz/calendarInfo")
|
||||
public class BizCalendarInfoController extends BaseController {
|
||||
|
||||
private final BizCalendarInfoService bizCalendarInfoService;
|
||||
|
||||
public BizCalendarInfoController(BizCalendarInfoService bizCalendarInfoService) {
|
||||
this.bizCalendarInfoService = bizCalendarInfoService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public BizCalendarInfo get(String id, boolean isNewRecord) {
|
||||
return bizCalendarInfoService.get(id, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarInfo:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(BizCalendarInfo bizCalendarInfo, Model model) {
|
||||
model.addAttribute("bizCalendarInfo", bizCalendarInfo);
|
||||
return "modules/biz/bizCalendarInfoList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarInfo:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<BizCalendarInfo> listData(BizCalendarInfo bizCalendarInfo, HttpServletRequest request, HttpServletResponse response) {
|
||||
bizCalendarInfo.setPage(new Page<>(request, response));
|
||||
Page<BizCalendarInfo> page = bizCalendarInfoService.findPage(bizCalendarInfo);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarInfo:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(BizCalendarInfo bizCalendarInfo, Model model) {
|
||||
model.addAttribute("bizCalendarInfo", bizCalendarInfo);
|
||||
return "modules/biz/bizCalendarInfoForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarInfo:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated BizCalendarInfo bizCalendarInfo) {
|
||||
bizCalendarInfoService.save(bizCalendarInfo);
|
||||
return renderResult(Global.TRUE, text("保存日历信息表成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarInfo:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(BizCalendarInfo bizCalendarInfo) {
|
||||
bizCalendarInfoService.delete(bizCalendarInfo);
|
||||
return renderResult(Global.TRUE, text("删除日历信息表成功!"));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user