新增前端vue
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.BizCalendarFlow;
|
||||
|
||||
/**
|
||||
* 日程流程DAO接口
|
||||
* @author gaoxq
|
||||
* @version 2025-12-12
|
||||
*/
|
||||
@MyBatisDao(dataSourceName="work")
|
||||
public interface BizCalendarFlowDao extends CrudDao<BizCalendarFlow> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.jeesite.modules.biz.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 日程流程Entity
|
||||
*
|
||||
* @author gaoxq
|
||||
* @version 2025-12-12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name = "biz_calendar_flow", alias = "a", label = "日程流程信息", columns = {
|
||||
@Column(name = "create_time", attrName = "createTime", label = "记录时间", isQuery = false),
|
||||
@Column(name = "calendar_flow_id", attrName = "calendarFlowId", label = "主键标识", isPK = true),
|
||||
@Column(name = "schedule_id", attrName = "scheduleId", label = "日程标识"),
|
||||
@Column(name = "operation_user", attrName = "operationUser", label = "操作人", isQuery = false),
|
||||
@Column(name = "operation_type", attrName = "operationType", label = "操作类型", isQuery = false),
|
||||
@Column(name = "status_name", attrName = "statusName", label = "操作状态", isQuery = false),
|
||||
@Column(name = "flow_content", attrName = "flowContent", label = "流程内容", isQuery = false),
|
||||
}, orderBy = "a.calendar_flow_id DESC"
|
||||
)
|
||||
@Data
|
||||
public class BizCalendarFlow extends DataEntity<BizCalendarFlow> implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Date createTime; // 记录时间
|
||||
private String calendarFlowId; // 主键标识
|
||||
private String scheduleId; // 日程标识
|
||||
private String operationUser; // 操作人
|
||||
private String operationType; // 操作类型
|
||||
private String statusName; // 操作状态
|
||||
private String flowContent;
|
||||
|
||||
public BizCalendarFlow() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public BizCalendarFlow(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.BizCalendarFlow;
|
||||
import com.jeesite.modules.biz.dao.BizCalendarFlowDao;
|
||||
|
||||
/**
|
||||
* 日程流程Service
|
||||
* @author gaoxq
|
||||
* @version 2025-12-12
|
||||
*/
|
||||
@Service
|
||||
public class BizCalendarFlowService extends CrudService<BizCalendarFlowDao, BizCalendarFlow> {
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param bizCalendarFlow 主键
|
||||
*/
|
||||
@Override
|
||||
public BizCalendarFlow get(BizCalendarFlow bizCalendarFlow) {
|
||||
return super.get(bizCalendarFlow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param bizCalendarFlow 查询条件
|
||||
* @param bizCalendarFlow page 分页对象
|
||||
*/
|
||||
@Override
|
||||
public Page<BizCalendarFlow> findPage(BizCalendarFlow bizCalendarFlow) {
|
||||
return super.findPage(bizCalendarFlow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param bizCalendarFlow 查询条件
|
||||
*/
|
||||
@Override
|
||||
public List<BizCalendarFlow> findList(BizCalendarFlow bizCalendarFlow) {
|
||||
return super.findList(bizCalendarFlow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param bizCalendarFlow 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(BizCalendarFlow bizCalendarFlow) {
|
||||
super.save(bizCalendarFlow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param bizCalendarFlow 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateStatus(BizCalendarFlow bizCalendarFlow) {
|
||||
super.updateStatus(bizCalendarFlow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param bizCalendarFlow 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(BizCalendarFlow bizCalendarFlow) {
|
||||
super.delete(bizCalendarFlow);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.jeesite.modules.biz.web;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
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.BizCalendarFlow;
|
||||
import com.jeesite.modules.biz.service.BizCalendarFlowService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日程流程Controller
|
||||
*
|
||||
* @author gaoxq
|
||||
* @version 2025-12-12
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/biz/calendarFlow")
|
||||
public class BizCalendarFlowController extends BaseController {
|
||||
|
||||
private final BizCalendarFlowService bizCalendarFlowService;
|
||||
|
||||
public BizCalendarFlowController(BizCalendarFlowService bizCalendarFlowService) {
|
||||
this.bizCalendarFlowService = bizCalendarFlowService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public BizCalendarFlow get(String calendarFlowId, boolean isNewRecord) {
|
||||
return bizCalendarFlowService.get(calendarFlowId, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(BizCalendarFlow bizCalendarFlow, Model model) {
|
||||
model.addAttribute("bizCalendarFlow", bizCalendarFlow);
|
||||
return "modules/biz/bizCalendarFlowList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<BizCalendarFlow> listData(BizCalendarFlow bizCalendarFlow, HttpServletRequest request, HttpServletResponse response) {
|
||||
bizCalendarFlow.setPage(new Page<>(request, response));
|
||||
Page<BizCalendarFlow> page = bizCalendarFlowService.findPage(bizCalendarFlow);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
|
||||
@RequestMapping(value = "form")
|
||||
public String form(BizCalendarFlow bizCalendarFlow, Model model) {
|
||||
model.addAttribute("bizCalendarFlow", bizCalendarFlow);
|
||||
return "modules/biz/bizCalendarFlowForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
*/
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated BizCalendarFlow bizCalendarFlow) {
|
||||
bizCalendarFlowService.save(bizCalendarFlow);
|
||||
return renderResult(Global.TRUE, text("保存日程流程成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(BizCalendarFlow bizCalendarFlow) {
|
||||
bizCalendarFlowService.delete(bizCalendarFlow);
|
||||
return renderResult(Global.TRUE, text("删除日程流程成功!"));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "listAll")
|
||||
@ResponseBody
|
||||
public List<BizCalendarFlow> listAll(BizCalendarFlow bizCalendarFlow) {
|
||||
return bizCalendarFlowService.findList(bizCalendarFlow);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,8 +3,12 @@ package com.jeesite.modules.biz.web;
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.modules.app.utils.vDate;
|
||||
import com.jeesite.modules.biz.entity.BizCalendarFlow;
|
||||
import com.jeesite.modules.biz.service.BizCalendarFlowService;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.utils.DictUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -38,6 +42,10 @@ import com.jeesite.modules.biz.service.BizCalendarScheduleService;
|
||||
@RequestMapping(value = "${adminPath}/biz/calendarSchedule")
|
||||
public class BizCalendarScheduleController extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
private BizCalendarFlowService flowService;
|
||||
|
||||
private final BizCalendarScheduleService bizCalendarScheduleService;
|
||||
|
||||
public BizCalendarScheduleController(BizCalendarScheduleService bizCalendarScheduleService) {
|
||||
@@ -91,11 +99,19 @@ public class BizCalendarScheduleController extends BaseController {
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated BizCalendarSchedule bizCalendarSchedule) {
|
||||
boolean isReachable = bizCalendarSchedule.getIsNewRecord();
|
||||
User user = UserUtils.getUser();
|
||||
User fUser = UserUtils.getByLoginCode(bizCalendarSchedule.getParticipantUser());
|
||||
BizCalendarFlow calendarFlow = new BizCalendarFlow();
|
||||
calendarFlow.setScheduleId(bizCalendarSchedule.getScheduleId());
|
||||
calendarFlow.setOperationType(isReachable ? "新增" : "变更");
|
||||
calendarFlow.setOperationUser(isReachable ? user.getUserName() : fUser.getUserName());
|
||||
calendarFlow.setFlowContent(bizCalendarSchedule.getContent());
|
||||
calendarFlow.setStatusName(DictUtils.getDictLabel("todo_status", bizCalendarSchedule.getUstatus(), "0"));
|
||||
bizCalendarSchedule.setCreatorUser(user.getLoginCode());
|
||||
bizCalendarSchedule.setParticipantName(fUser.getUserName());
|
||||
bizCalendarSchedule.setUpdateTime(vDate.getUpdateTime(bizCalendarSchedule.getIsNewRecord()));
|
||||
flowService.save(calendarFlow);
|
||||
bizCalendarScheduleService.save(bizCalendarSchedule);
|
||||
return renderResult(Global.TRUE, text("保存日程信息成功!"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user