From 8378858dd44d640a91b6f245e523ce35f43c2f1b Mon Sep 17 00:00:00 2001
From: paidaxing444 <12qwaszx>
Date: Thu, 7 May 2020 18:32:37 +0800
Subject: [PATCH] =?UTF-8?q?20200507-zlp-1=20=E5=9B=AD=E5=8E=86=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E6=A0=B9=E6=8D=AE=E6=97=B6=E9=97=B4=E5=88=A4=E6=96=AD?=
=?UTF-8?q?=E6=98=AF=E5=90=A6=E5=85=81=E8=AE=B8=E5=88=A0=E9=99=A4=20?=
=?UTF-8?q?=E4=B8=80=E6=97=A5=E6=B5=81=E7=A8=8B=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/views/benyi/schoolcalendar/index.vue | 16 +-
.../controller/ByDayFlowDetailController.java | 108 +++++++++++++
.../BySchoolcalendarController.java | 2 +
.../project/benyi/domain/ByDayFlowDetail.java | 151 ++++++++++++++++++
.../benyi/mapper/ByDayFlowDetailMapper.java | 61 +++++++
.../service/IByDayFlowDetailService.java | 61 +++++++
.../impl/ByDayFlowDetailServiceImpl.java | 96 +++++++++++
.../mybatis/benyi/ByDayFlowDetailMapper.xml | 100 ++++++++++++
8 files changed, 594 insertions(+), 1 deletion(-)
create mode 100644 ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayFlowDetailController.java
create mode 100644 ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayFlowDetail.java
create mode 100644 ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByDayFlowDetailMapper.java
create mode 100644 ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByDayFlowDetailService.java
create mode 100644 ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByDayFlowDetailServiceImpl.java
create mode 100644 ruoyi/src/main/resources/mybatis/benyi/ByDayFlowDetailMapper.xml
diff --git a/ruoyi-ui/src/views/benyi/schoolcalendar/index.vue b/ruoyi-ui/src/views/benyi/schoolcalendar/index.vue
index 20317ddb3..8942bfa81 100644
--- a/ruoyi-ui/src/views/benyi/schoolcalendar/index.vue
+++ b/ruoyi-ui/src/views/benyi/schoolcalendar/index.vue
@@ -95,7 +95,7 @@
:data="schoolcalendarList"
@selection-change="handleSelectionChange"
>
-
+
修改
删除
@@ -224,6 +226,8 @@ export default {
scopeOptions: [],
//学年学期
xnxqOptions: [],
+ //声明方法
+ selectable: Function,
// 查询参数
queryParams: {
pageNum: 1,
@@ -271,6 +275,16 @@ export default {
schoolcalendartypeFormat(row, column) {
return this.selectDictLabel(this.schoolcalendartypeOptions, row.type);
},
+ //控制按钮可用
+ checkSelectable(row) {
+ var date = new Date();
+ //console.log(date.toLocaleDateString());
+ return this.CompareDate(row.activitytime, date.toLocaleDateString());
+ },
+ //比较日期大小
+ CompareDate(d1, d2) {
+ return new Date(d1.replace(/-/g, "/")) > new Date(d2.replace(/-/g, "/"));
+ },
// 适用范围类型--字典状态字典翻译
scopeFormat(row, column) {
//alert(row.scope.split(';').length);
diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayFlowDetailController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayFlowDetailController.java
new file mode 100644
index 000000000..a7763c013
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayFlowDetailController.java
@@ -0,0 +1,108 @@
+package com.ruoyi.project.benyi.controller;
+
+import java.util.Date;
+import java.util.List;
+
+import com.ruoyi.common.utils.SecurityUtils;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.benyi.domain.ByDayFlowDetail;
+import com.ruoyi.project.benyi.service.IByDayFlowDetailService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+/**
+ * 一日流程Controller
+ *
+ * @author tsbz
+ * @date 2020-05-07
+ */
+@RestController
+@RequestMapping("/benyi/dayflowmanger")
+public class ByDayFlowDetailController extends BaseController
+{
+ @Autowired
+ private IByDayFlowDetailService byDayFlowDetailService;
+
+ /**
+ * 查询一日流程列表
+ */
+ @PreAuthorize("@ss.hasPermi('benyi:dayflowmanger:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(ByDayFlowDetail byDayFlowDetail)
+ {
+ startPage();
+ List list = byDayFlowDetailService.selectByDayFlowDetailList(byDayFlowDetail);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出一日流程列表
+ */
+ @PreAuthorize("@ss.hasPermi('benyi:dayflowmanger:export')")
+ @Log(title = "一日流程", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(ByDayFlowDetail byDayFlowDetail)
+ {
+ List list = byDayFlowDetailService.selectByDayFlowDetailList(byDayFlowDetail);
+ ExcelUtil util = new ExcelUtil(ByDayFlowDetail.class);
+ return util.exportExcel(list, "detail");
+ }
+
+ /**
+ * 获取一日流程详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('benyi:dayflowmanger:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id)
+ {
+ return AjaxResult.success(byDayFlowDetailService.selectByDayFlowDetailById(id));
+ }
+
+ /**
+ * 新增一日流程
+ */
+ @PreAuthorize("@ss.hasPermi('benyi:dayflowmanger:add')")
+ @Log(title = "一日流程", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody ByDayFlowDetail byDayFlowDetail)
+ {
+ byDayFlowDetail.setCreateUser(SecurityUtils.getLoginUser().getUser().getUserId());
+ return toAjax(byDayFlowDetailService.insertByDayFlowDetail(byDayFlowDetail));
+ }
+
+ /**
+ * 修改一日流程
+ */
+ @PreAuthorize("@ss.hasPermi('benyi:dayflowmanger:edit')")
+ @Log(title = "一日流程", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody ByDayFlowDetail byDayFlowDetail)
+ {
+ byDayFlowDetail.setUpdateUser(SecurityUtils.getLoginUser().getUser().getUserId());
+ return toAjax(byDayFlowDetailService.updateByDayFlowDetail(byDayFlowDetail));
+ }
+
+ /**
+ * 删除一日流程
+ */
+ @PreAuthorize("@ss.hasPermi('benyi:dayflowmanger:remove')")
+ @Log(title = "一日流程", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids)
+ {
+ return toAjax(byDayFlowDetailService.deleteByDayFlowDetailByIds(ids));
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarController.java
index e270d064c..9ceb56faf 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarController.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/BySchoolcalendarController.java
@@ -187,6 +187,7 @@ public class BySchoolcalendarController extends BaseController {
public AjaxResult edit(@RequestBody BySchoolcalendar bySchoolcalendar) {
//首先判断 当前用户是否为学校
if (schoolCommon.isSchool()) {
+ //应该判断记录是否在修改的时间范围内
return toAjax(bySchoolcalendarService.updateBySchoolcalendar(bySchoolcalendar));
} else {
return AjaxResult.error("当前用户非幼儿园,无法编辑园历");
@@ -202,6 +203,7 @@ public class BySchoolcalendarController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) {
//首先判断 当前用户是否为学校
if (schoolCommon.isSchool()) {
+ //应该判断记录是否在删除的时间范围内
return toAjax(bySchoolcalendarService.deleteBySchoolcalendarByIds(ids));
} else {
return AjaxResult.error("当前用户非幼儿园,无法删除园历");
diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayFlowDetail.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayFlowDetail.java
new file mode 100644
index 000000000..fb89b0ff9
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayFlowDetail.java
@@ -0,0 +1,151 @@
+package com.ruoyi.project.benyi.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+
+/**
+ * 一日流程对象 by_day_flow_detail
+ *
+ * @author tsbz
+ * @date 2020-05-07
+ */
+public class ByDayFlowDetail extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 流程ID */
+ private Long id;
+
+ /** 流程序号 */
+ @Excel(name = "流程序号")
+ private Long sortNumber;
+
+ /** 标准数量 */
+ @Excel(name = "标准数量")
+ private Long targetCount;
+
+ /** 名称 */
+ @Excel(name = "名称")
+ private String name;
+
+ /** 导言 */
+ @Excel(name = "导言")
+ private String content;
+
+ /** 目的 */
+ @Excel(name = "目的")
+ private String note;
+
+ /** 类型(1标准,2相关) */
+ @Excel(name = "类型", readConverterExp = "1=标准,2相关")
+ private String flowType;
+
+ /** 创建人 */
+ @Excel(name = "创建人")
+ private Long createUser;
+
+ /** 修改人 */
+ @Excel(name = "修改人")
+ private Long updateUser;
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+ public void setSortNumber(Long sortNumber)
+ {
+ this.sortNumber = sortNumber;
+ }
+
+ public Long getSortNumber()
+ {
+ return sortNumber;
+ }
+ public void setTargetCount(Long targetCount)
+ {
+ this.targetCount = targetCount;
+ }
+
+ public Long getTargetCount()
+ {
+ return targetCount;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+ public void setContent(String content)
+ {
+ this.content = content;
+ }
+
+ public String getContent()
+ {
+ return content;
+ }
+ public void setNote(String note)
+ {
+ this.note = note;
+ }
+
+ public String getNote()
+ {
+ return note;
+ }
+ public void setFlowType(String flowType)
+ {
+ this.flowType = flowType;
+ }
+
+ public String getFlowType()
+ {
+ return flowType;
+ }
+ public void setCreateUser(Long createUser)
+ {
+ this.createUser = createUser;
+ }
+
+ public Long getCreateUser()
+ {
+ return createUser;
+ }
+ public void setUpdateUser(Long updateUser)
+ {
+ this.updateUser = updateUser;
+ }
+
+ public Long getUpdateUser()
+ {
+ return updateUser;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("id", getId())
+ .append("sortNumber", getSortNumber())
+ .append("targetCount", getTargetCount())
+ .append("name", getName())
+ .append("content", getContent())
+ .append("note", getNote())
+ .append("flowType", getFlowType())
+ .append("createUser", getCreateUser())
+ .append("updateUser", getUpdateUser())
+ .append("createTime", getCreateTime())
+ .append("updateTime", getUpdateTime())
+ .toString();
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByDayFlowDetailMapper.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByDayFlowDetailMapper.java
new file mode 100644
index 000000000..4dfd53236
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByDayFlowDetailMapper.java
@@ -0,0 +1,61 @@
+package com.ruoyi.project.benyi.mapper;
+
+import java.util.List;
+import com.ruoyi.project.benyi.domain.ByDayFlowDetail;
+
+/**
+ * 一日流程Mapper接口
+ *
+ * @author tsbz
+ * @date 2020-05-07
+ */
+public interface ByDayFlowDetailMapper
+{
+ /**
+ * 查询一日流程
+ *
+ * @param id 一日流程ID
+ * @return 一日流程
+ */
+ public ByDayFlowDetail selectByDayFlowDetailById(Long id);
+
+ /**
+ * 查询一日流程列表
+ *
+ * @param byDayFlowDetail 一日流程
+ * @return 一日流程集合
+ */
+ public List selectByDayFlowDetailList(ByDayFlowDetail byDayFlowDetail);
+
+ /**
+ * 新增一日流程
+ *
+ * @param byDayFlowDetail 一日流程
+ * @return 结果
+ */
+ public int insertByDayFlowDetail(ByDayFlowDetail byDayFlowDetail);
+
+ /**
+ * 修改一日流程
+ *
+ * @param byDayFlowDetail 一日流程
+ * @return 结果
+ */
+ public int updateByDayFlowDetail(ByDayFlowDetail byDayFlowDetail);
+
+ /**
+ * 删除一日流程
+ *
+ * @param id 一日流程ID
+ * @return 结果
+ */
+ public int deleteByDayFlowDetailById(Long id);
+
+ /**
+ * 批量删除一日流程
+ *
+ * @param ids 需要删除的数据ID
+ * @return 结果
+ */
+ public int deleteByDayFlowDetailByIds(Long[] ids);
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByDayFlowDetailService.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByDayFlowDetailService.java
new file mode 100644
index 000000000..46aacb8d1
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByDayFlowDetailService.java
@@ -0,0 +1,61 @@
+package com.ruoyi.project.benyi.service;
+
+import java.util.List;
+import com.ruoyi.project.benyi.domain.ByDayFlowDetail;
+
+/**
+ * 一日流程Service接口
+ *
+ * @author tsbz
+ * @date 2020-05-07
+ */
+public interface IByDayFlowDetailService
+{
+ /**
+ * 查询一日流程
+ *
+ * @param id 一日流程ID
+ * @return 一日流程
+ */
+ public ByDayFlowDetail selectByDayFlowDetailById(Long id);
+
+ /**
+ * 查询一日流程列表
+ *
+ * @param byDayFlowDetail 一日流程
+ * @return 一日流程集合
+ */
+ public List selectByDayFlowDetailList(ByDayFlowDetail byDayFlowDetail);
+
+ /**
+ * 新增一日流程
+ *
+ * @param byDayFlowDetail 一日流程
+ * @return 结果
+ */
+ public int insertByDayFlowDetail(ByDayFlowDetail byDayFlowDetail);
+
+ /**
+ * 修改一日流程
+ *
+ * @param byDayFlowDetail 一日流程
+ * @return 结果
+ */
+ public int updateByDayFlowDetail(ByDayFlowDetail byDayFlowDetail);
+
+ /**
+ * 批量删除一日流程
+ *
+ * @param ids 需要删除的一日流程ID
+ * @return 结果
+ */
+ public int deleteByDayFlowDetailByIds(Long[] ids);
+
+ /**
+ * 删除一日流程信息
+ *
+ * @param id 一日流程ID
+ * @return 结果
+ */
+ public int deleteByDayFlowDetailById(Long id);
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByDayFlowDetailServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByDayFlowDetailServiceImpl.java
new file mode 100644
index 000000000..1b7274234
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByDayFlowDetailServiceImpl.java
@@ -0,0 +1,96 @@
+package com.ruoyi.project.benyi.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.benyi.mapper.ByDayFlowDetailMapper;
+import com.ruoyi.project.benyi.domain.ByDayFlowDetail;
+import com.ruoyi.project.benyi.service.IByDayFlowDetailService;
+
+/**
+ * 一日流程Service业务层处理
+ *
+ * @author tsbz
+ * @date 2020-05-07
+ */
+@Service
+public class ByDayFlowDetailServiceImpl implements IByDayFlowDetailService
+{
+ @Autowired
+ private ByDayFlowDetailMapper byDayFlowDetailMapper;
+
+ /**
+ * 查询一日流程
+ *
+ * @param id 一日流程ID
+ * @return 一日流程
+ */
+ @Override
+ public ByDayFlowDetail selectByDayFlowDetailById(Long id)
+ {
+ return byDayFlowDetailMapper.selectByDayFlowDetailById(id);
+ }
+
+ /**
+ * 查询一日流程列表
+ *
+ * @param byDayFlowDetail 一日流程
+ * @return 一日流程
+ */
+ @Override
+ public List selectByDayFlowDetailList(ByDayFlowDetail byDayFlowDetail)
+ {
+ return byDayFlowDetailMapper.selectByDayFlowDetailList(byDayFlowDetail);
+ }
+
+ /**
+ * 新增一日流程
+ *
+ * @param byDayFlowDetail 一日流程
+ * @return 结果
+ */
+ @Override
+ public int insertByDayFlowDetail(ByDayFlowDetail byDayFlowDetail)
+ {
+ byDayFlowDetail.setCreateTime(DateUtils.getNowDate());
+ return byDayFlowDetailMapper.insertByDayFlowDetail(byDayFlowDetail);
+ }
+
+ /**
+ * 修改一日流程
+ *
+ * @param byDayFlowDetail 一日流程
+ * @return 结果
+ */
+ @Override
+ public int updateByDayFlowDetail(ByDayFlowDetail byDayFlowDetail)
+ {
+ byDayFlowDetail.setUpdateTime(DateUtils.getNowDate());
+ return byDayFlowDetailMapper.updateByDayFlowDetail(byDayFlowDetail);
+ }
+
+ /**
+ * 批量删除一日流程
+ *
+ * @param ids 需要删除的一日流程ID
+ * @return 结果
+ */
+ @Override
+ public int deleteByDayFlowDetailByIds(Long[] ids)
+ {
+ return byDayFlowDetailMapper.deleteByDayFlowDetailByIds(ids);
+ }
+
+ /**
+ * 删除一日流程信息
+ *
+ * @param id 一日流程ID
+ * @return 结果
+ */
+ @Override
+ public int deleteByDayFlowDetailById(Long id)
+ {
+ return byDayFlowDetailMapper.deleteByDayFlowDetailById(id);
+ }
+}
diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByDayFlowDetailMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByDayFlowDetailMapper.xml
new file mode 100644
index 000000000..81adc2134
--- /dev/null
+++ b/ruoyi/src/main/resources/mybatis/benyi/ByDayFlowDetailMapper.xml
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select id, sort_number, target_count, name, content, note, flow_type, create_user, update_user, create_time, update_time from by_day_flow_detail
+
+
+
+
+
+
+
+ insert into by_day_flow_detail
+
+ sort_number,
+ target_count,
+ name,
+ content,
+ note,
+ flow_type,
+ create_user,
+ update_user,
+ create_time,
+ update_time,
+
+
+ #{sortNumber},
+ #{targetCount},
+ #{name},
+ #{content},
+ #{note},
+ #{flowType},
+ #{createUser},
+ #{updateUser},
+ #{createTime},
+ #{updateTime},
+
+
+
+
+ update by_day_flow_detail
+
+ sort_number = #{sortNumber},
+ target_count = #{targetCount},
+ name = #{name},
+ content = #{content},
+ note = #{note},
+ flow_type = #{flowType},
+ create_user = #{createUser},
+ update_user = #{updateUser},
+ create_time = #{createTime},
+ update_time = #{updateTime},
+
+ where id = #{id}
+
+
+
+ delete from by_day_flow_detail where id = #{id}
+
+
+
+ delete from by_day_flow_detail where id in
+
+ #{id}
+
+
+
+
\ No newline at end of file