新增查看页面
This commit is contained in:
@@ -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